Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(column-picker-mixin): get rid of ColumnPickerMixin and refactor components which use it #1461

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/_vue3-migration-test/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.eslint.json'
},
rules: {
'max-len': 'off'
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<BaseColumnPickerDropdown v-model="selectedColumns" :columns="columns">
<template #toggle="{ item, isOpen }">Selected: {{ item }} {{ isOpen ? '🔼' : '🔽' }}️</template>
<template #item="{ item, isSelected, isHighlighted }">
<span v-if="isHighlighted">🟢</span>
<span v-if="isSelected">✅</span>
<span>{{ item }}</span>
</template>
</BaseColumnPickerDropdown>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import BaseColumnPickerDropdown from '../../../../x-components/src/components/column-picker/base-column-picker-dropdown.vue';

const columns = ref([2, 4, 6]);
const selectedColumns = ref(4);
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<!--
<BaseColumnPickerList v-model="selectedColumns" :columns="columns">
<template #default="{ column, isSelected }">
<span v-if="isSelected">✅</span>
<span>{{ column }}</span>
</template>
<template #divider>
<span>-----</span>
</template>
</BaseColumnPickerList>
-->
<span>
BREAKING Vue3: `template v-for` key should be placed on the `template` tag (rather than on its
children)
</span>
</template>

<script setup lang="ts">
/*
import { ref } from 'vue';
import BaseColumnPickerList from '../../../../x-components/src/components/column-picker/base-column-picker-list.vue';

const columns = ref([2, 4, 6]);
const selectedColumns = ref(4);
*/
</script>
2 changes: 2 additions & 0 deletions packages/_vue3-migration-test/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './animations';
export { default as TestBaseColumnPickerDropdown } from './column-picker/test-base-column-picker-dropdown.vue';
export { default as TestBaseColumnPickerList } from './column-picker/test-base-column-picker-list.vue';
export { default as TestBaseDropdown } from './test-base-dropdown.vue';
export { default as TestBaseEventButton } from './test-base-event-button.vue';
14 changes: 13 additions & 1 deletion packages/_vue3-migration-test/src/router.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { createRouter, createWebHistory } from 'vue-router';
import {
TestAnimateWidth,
TestBaseColumnPickerList,
TestBaseDropdown,
TestBaseEventButton,
TestFade,
TestSortDropdown,
TestSortList,
TestSortPickerList
TestSortPickerList,
TestBaseColumnPickerDropdown
} from './';

const routes = [
Expand All @@ -30,6 +32,16 @@ const routes = [
name: 'BaseEventButton',
component: TestBaseEventButton
},
{
path: '/base-column-picker-dropdown',
name: 'BaseColumnPickerDropdown',
component: TestBaseColumnPickerDropdown
},
{
path: '/base-column-picker-list',
name: 'BaseColumnPickerList',
component: TestBaseColumnPickerList
},
{
path: '/sort-dropdown',
name: 'SortDropdown',
Expand Down
2 changes: 1 addition & 1 deletion packages/x-components/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
preset: 'ts-jest',
transform: {
'^.+\\.vue$': require.resolve('./vue-preprocessor'),
'^.+\\.vue$': '@vue/vue2-jest',
diegopf marked this conversation as resolved.
Show resolved Hide resolved
'^.+\\.scss$': 'jest-scss-transform'
},
testMatch: ['<rootDir>/src/**/*.spec.ts'],
Expand Down
Loading
Loading