diff --git a/package.json b/package.json index c958d2f3..85cefeaf 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "not op_mini all" ], "peerDependencies": { - "vue": "^3.4.14" + "vue": "^3.2.0" }, "dependencies": { "@headlessui/vue": "^1.7.13", @@ -108,7 +108,7 @@ "typescript": "^5.0.4", "unplugin-vue-define-options": "^1.3.3", "vitest": "^0.32.4", - "vue": "^3.4.14", + "vue": "^3.2.47", "vue-router": "^4.1.6", "vue-tsc": "^1.2.0" } diff --git a/packages/components/table/src/table.vue b/packages/components/table/src/table.vue index 6ff25f72..4bf786d2 100644 --- a/packages/components/table/src/table.vue +++ b/packages/components/table/src/table.vue @@ -378,11 +378,11 @@ defineOptions({ const props = defineProps(tableProps) const emit = defineEmits<{ - (e: 'select', index: number): void - (e: 'select:all'): void - (e: 'update:selection', value: number[]): void - (e: 'sortColumn', column: sortOption): void - (e: 'searchSubmit', column: searchOption[]): void + select: [index: number] + 'select:all': [] + 'update:selection': [value: number[]] + sortColumn: [column: sortOption] + searchSubmit: [column: searchOption[]] }>() const { t } = useLocale() diff --git a/packages/components/table/stories/table.stories.ts b/packages/components/table/stories/table.stories.ts index 786d1167..9937b0ac 100644 --- a/packages/components/table/stories/table.stories.ts +++ b/packages/components/table/stories/table.stories.ts @@ -47,14 +47,21 @@ export default { import type { PuikTableHeader } from '@prestashopcorp/puik/es/components/table/src/table' interface PuikTableHeader { - text: string | undefined value: string - size: 'sm' | 'md' | 'lg' | undefined - width: string | undefined - align: 'left' | 'center' | 'right' | undefined - sortable: boolean | undefined - searchable: boolean | undefined - preventExpand: boolean | undefined + text?: string + size?: 'sm' | 'md' | 'lg' + align?: 'left' | 'center' | 'right' + width?: string + sortable?: boolean + preventExpand?: boolean + searchable?: boolean + searchSubmit?: boolean + searchType?: {$PuikTableSearchInputTypes} + } + + enum PuikTableSearchInputTypes { + Text = 'text', + Range = 'range', } `, }, @@ -216,8 +223,10 @@ export default { description: 'Event emitted when sorting a column', table: { type: { - summary: 'sortOption', + summary: 'event => sortOption', detail: ` +// Payload type = sortOption + import type { sortOption } from '@prestashopcorp/puik/es/components/table/src/table' type sortOption = { @@ -233,9 +242,11 @@ type sortOption = { control: 'none', table: { type: { - summary: 'event', + summary: 'event => SearchOption[]', detail: ` -Payload type = Array +// Payload type = Array + +import type { searchOption } from '@prestashopcorp/puik/es/components/table/src/table' type searchOption = { searchBy: string; diff --git a/playground/package.json b/playground/package.json index 861a9d8d..3594e127 100644 --- a/playground/package.json +++ b/playground/package.json @@ -8,7 +8,7 @@ "preview": "vite preview" }, "dependencies": { - "vue": "^3.4.14" + "vue": "3.3.10" }, "devDependencies": { "@vitejs/plugin-vue": "^4.1.0",