yuyeon 0.0.47-rc.1 → 0.0.47-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/yuyeon.js +1896 -1835
- package/dist/yuyeon.umd.cjs +5 -5
- package/lib/components/dialog/YDialog.mjs +25 -0
- package/lib/components/dialog/YDialog.mjs.map +1 -1
- package/lib/components/dropdown/YDropdown.mjs +5 -1
- package/lib/components/dropdown/YDropdown.mjs.map +1 -1
- package/lib/components/hover/YHover.mjs +47 -0
- package/lib/components/hover/YHover.mjs.map +1 -0
- package/lib/components/pagination/YPagination.mjs +13 -1
- package/lib/components/pagination/YPagination.mjs.map +1 -1
- package/lib/components/snackbar/YSnackbar.mjs +20 -2
- package/lib/components/snackbar/YSnackbar.mjs.map +1 -1
- package/lib/components/table/YDataTableBody.mjs +13 -7
- package/lib/components/table/YDataTableBody.mjs.map +1 -1
- package/lib/components/table/YDataTableRow.mjs +8 -3
- package/lib/components/table/YDataTableRow.mjs.map +1 -1
- package/lib/components/table/composibles/selection.mjs +11 -2
- package/lib/components/table/composibles/selection.mjs.map +1 -1
- package/lib/components/table/types/common.mjs +2 -0
- package/lib/components/table/types/common.mjs.map +1 -0
- package/lib/components/table/types/header.mjs +2 -0
- package/lib/components/table/types/header.mjs.map +1 -0
- package/lib/components/table/types/index.mjs.map +1 -1
- package/lib/components/table/types/item.mjs +2 -0
- package/lib/components/table/types/item.mjs.map +1 -0
- package/lib/components/table/types/row.mjs +2 -0
- package/lib/components/table/types/row.mjs.map +1 -0
- package/lib/composables/resize-observer.mjs +1 -1
- package/lib/composables/resize-observer.mjs.map +1 -1
- package/lib/composables/timing.mjs +31 -6
- package/lib/composables/timing.mjs.map +1 -1
- package/lib/locales/en.mjs +2 -1
- package/lib/locales/en.mjs.map +1 -1
- package/lib/locales/ko.mjs +2 -1
- package/lib/locales/ko.mjs.map +1 -1
- package/lib/util/vue-component.mjs +8 -2
- package/lib/util/vue-component.mjs.map +1 -1
- package/package.json +1 -1
- package/types/components/dialog/YDialog.d.ts +7 -0
- package/types/components/dropdown/YDropdown.d.ts +11 -2
- package/types/components/pagination/YPagination.d.ts +7 -0
- package/types/components/snackbar/YSnackbar.d.ts +9 -0
- package/types/components/table/YDataTable.d.ts +27 -0
- package/types/components/table/YDataTableBody.d.ts +8 -1
- package/types/components/table/YDataTableRow.d.ts +26 -5
- package/types/components/table/YDataTableServer.d.ts +27 -0
- package/types/components/table/composibles/header.d.ts +2 -2
- package/types/components/table/composibles/selection.d.ts +13 -0
- package/types/components/table/types/common.d.ts +1 -0
- package/types/components/table/types/header.d.ts +22 -0
- package/types/components/table/types/index.d.ts +6 -42
- package/types/components/table/types/item.d.ts +20 -0
- package/types/components/table/types/row.d.ts +3 -0
- package/types/composables/timing.d.ts +6 -2
- package/types/locales/en.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { computed, defineComponent } from 'vue';
|
|
3
3
|
import { useRender } from "../../composables/component.mjs";
|
|
4
4
|
import { getPropertyFromItem } from "../../util/common.mjs";
|
|
5
5
|
import { propsFactory } from "../../util/vue-component.mjs";
|
|
@@ -9,7 +9,10 @@ import { useHeader } from "./composibles/header.mjs";
|
|
|
9
9
|
import { useSelection } from "./composibles/selection.mjs";
|
|
10
10
|
export const pressYDataTableRowProps = propsFactory({
|
|
11
11
|
index: Number,
|
|
12
|
-
onClick: Function
|
|
12
|
+
onClick: Function,
|
|
13
|
+
onContextmenu: Function,
|
|
14
|
+
onDblclick: Function,
|
|
15
|
+
onHover: Function
|
|
13
16
|
}, 'YDataTableRow');
|
|
14
17
|
export const YDataTableRow = defineComponent({
|
|
15
18
|
name: 'YDataTableRow',
|
|
@@ -33,7 +36,9 @@ export const YDataTableRow = defineComponent({
|
|
|
33
36
|
useRender(() => {
|
|
34
37
|
return _createVNode("tr", {
|
|
35
38
|
"class": ['y-data-table__row'],
|
|
36
|
-
"onClick":
|
|
39
|
+
"onClick": props.onClick,
|
|
40
|
+
"onContextmenu": props.onContextmenu,
|
|
41
|
+
"onDblclick": props.onDblclick
|
|
37
42
|
}, [props.item && columns.value.map((column, colIndex) => {
|
|
38
43
|
const item = props.item;
|
|
39
44
|
const slotProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YDataTableRow.mjs","names":["
|
|
1
|
+
{"version":3,"file":"YDataTableRow.mjs","names":["computed","defineComponent","useRender","getPropertyFromItem","propsFactory","YIconCheckbox","YDataTableCell","useHeader","useSelection","pressYDataTableRowProps","index","Number","onClick","Function","onContextmenu","onDblclick","onHover","YDataTableRow","name","props","item","Object","cellProps","setup","_ref","emit","slots","isSelected","toggleSelect","columns","_createVNode","value","map","column","colIndex","slotProps","raw","internalItem","key","selected","_mergeProps","align","fixed","lastFixed","undefined","fixedOffset","width","maxWidth","default","slotName","selectable","e","stopPropagation"],"sources":["../../../src/components/table/YDataTableRow.tsx"],"sourcesContent":["import { PropType, computed, defineComponent, ref } from 'vue';\n\nimport { useRender } from '../../composables/component';\nimport { getPropertyFromItem } from '../../util/common';\nimport { propsFactory } from '../../util/vue-component';\nimport { YIconCheckbox } from '../icons';\nimport { YDataTableCell } from './YDataTableCell';\nimport { useHeader } from './composibles/header';\nimport { useSelection } from './composibles/selection';\nimport { CellProps, DataTableItem } from './types';\n\nexport const pressYDataTableRowProps = propsFactory(\n {\n index: Number as PropType<number>,\n onClick: Function as PropType<(...args: any[]) => void>,\n onContextmenu: Function as PropType<(...args: any[]) => void>,\n onDblclick: Function as PropType<(...args: any[]) => void>,\n onHover: Function as PropType<(...args: any[]) => void>,\n },\n 'YDataTableRow',\n);\n\nexport const YDataTableRow = defineComponent({\n name: 'YDataTableRow',\n props: {\n item: Object as PropType<DataTableItem>,\n cellProps: [Object, Function] as PropType<CellProps>,\n ...pressYDataTableRowProps(),\n },\n setup(props, { emit, slots }) {\n const { isSelected, toggleSelect } = useSelection();\n const { columns } = useHeader();\n\n useRender(() => {\n return (\n <tr\n class={['y-data-table__row']}\n onClick={props.onClick as any}\n onContextmenu={props.onContextmenu as any}\n onDblclick={props.onDblclick as any}\n >\n {props.item &&\n columns.value.map((column, colIndex) => {\n const item = props.item!;\n const slotProps = {\n index: props.index!,\n item: props.item!.raw,\n internalItem: props.item!,\n columns: columns.value,\n value: getPropertyFromItem(item.columns, column.key),\n selected: computed(() => isSelected(item)).value,\n toggleSelect,\n };\n\n const cellProps =\n typeof props.cellProps === 'function'\n ? props.cellProps({\n index: slotProps.index,\n column,\n internalItem: slotProps.internalItem,\n item: slotProps.item,\n value: slotProps.value,\n selected: slotProps.selected,\n })\n : props.cellProps;\n\n return (\n <YDataTableCell\n align={column.align}\n fixed={\n column.fixed\n ? column.lastFixed\n ? 'last'\n : 'lead'\n : undefined\n }\n fixedOffset={column.fixedOffset}\n width={column.width}\n maxWidth={column.maxWidth}\n class={[\n 'y-data-table-data',\n {\n 'y-data-table-data--select':\n column.key === 'data-table-select',\n },\n ]}\n {...cellProps}\n >\n {{\n default: () => {\n const slotName = `item.${column.key}`;\n\n if (slots[slotName]) {\n return slots[slotName]?.(slotProps);\n }\n\n if (column.key === 'data-table-select') {\n return (\n slots['item.data-table-select']?.(slotProps) ?? (\n <YIconCheckbox\n checked={isSelected(item)}\n disabled={!item.selectable}\n {...{\n onClick: (e: MouseEvent) => {\n e.stopPropagation();\n toggleSelect(item);\n },\n }}\n ></YIconCheckbox>\n )\n );\n }\n\n return slotProps.value;\n },\n }}\n </YDataTableCell>\n );\n })}\n </tr>\n );\n });\n },\n});\n\nexport type YDataTableRow = InstanceType<typeof YDataTableRow>;\n"],"mappings":";AAAA,SAAmBA,QAAQ,EAAEC,eAAe,QAAa,KAAK;AAAC,SAEtDC,SAAS;AAAA,SACTC,mBAAmB;AAAA,SACnBC,YAAY;AAAA,SACZC,aAAa;AAAA,SACbC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,YAAY;A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,CAAC;gBAAA,YACf,CAACA,IAAI,CAAC8B;cAAU;gBAExBtC,OAAO,EAAGuC,CAAa,IAAK;kBAC1BA,CAAC,CAACC,eAAe,CAAC,CAAC;kBACnBxB,YAAY,CAACR,IAAI,CAAC;gBACpB;cAAC,SAGN;YAEL;YAEA,OAAOe,SAAS,CAACJ,KAAK;UACxB;QAAC;MAIT,CAAC,CAAC;IAGV,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed, inject, provide } from 'vue';
|
|
2
2
|
import { useModelDuplex } from "../../../composables/communication.mjs";
|
|
3
|
+
import { deepEqual } from "../../../util/index.mjs";
|
|
3
4
|
import { wrapInArray } from "../../../util/array.mjs";
|
|
4
5
|
import { propsFactory } from "../../../util/vue-component.mjs";
|
|
5
6
|
export const pressDataTableSelectionProps = propsFactory({
|
|
@@ -11,6 +12,10 @@ export const pressDataTableSelectionProps = propsFactory({
|
|
|
11
12
|
modelValue: {
|
|
12
13
|
type: Array,
|
|
13
14
|
default: () => []
|
|
15
|
+
},
|
|
16
|
+
valueEqual: {
|
|
17
|
+
type: Function,
|
|
18
|
+
default: deepEqual
|
|
14
19
|
}
|
|
15
20
|
}, 'YDataTable--selection');
|
|
16
21
|
const singleSelectStrategy = {
|
|
@@ -101,7 +106,9 @@ export function provideSelection(props, _ref9) {
|
|
|
101
106
|
pageItems
|
|
102
107
|
} = _ref9;
|
|
103
108
|
const selected = useModelDuplex(props, 'modelValue', props.modelValue, v => {
|
|
104
|
-
return new Set(v)
|
|
109
|
+
return new Set(wrapInArray(v).map(v => {
|
|
110
|
+
return allItems.value.find(item => props.valueEqual(v, item.value))?.value ?? v;
|
|
111
|
+
}));
|
|
105
112
|
}, v => {
|
|
106
113
|
return [...v.values()];
|
|
107
114
|
});
|
|
@@ -151,7 +158,9 @@ export function provideSelection(props, _ref9) {
|
|
|
151
158
|
pageItems: pageSelectables.value
|
|
152
159
|
});
|
|
153
160
|
});
|
|
154
|
-
const someSelected = computed(() =>
|
|
161
|
+
const someSelected = computed(() => {
|
|
162
|
+
return isSomeSelected(pageSelectables.value);
|
|
163
|
+
});
|
|
155
164
|
const allSelected = computed(() => {
|
|
156
165
|
return isSelected(selectables.value);
|
|
157
166
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.mjs","names":["computed","inject","provide","useModelDuplex","wrapInArray","propsFactory","pressDataTableSelectionProps","enableSelect","Boolean","selectStrategy","type","String","Object","default","modelValue","Array","singleSelectStrategy","showSelectAll","allSelected","select","_ref","items","value","Set","selectAll","_ref2","selected","pageSelectStrategy","_ref3","pageItems","_ref4","item","add","delete","_ref5","allSelectStrategy","_ref6","allItems","_ref7","_ref8","Y_DATA_TABLE_SELECTION_KEY","Symbol","for","provideSelection","props","_ref9","v","values","allSelectables","filter","selectable","pageSelectables","isSelected","every","has","isSomeSelected","some","toggleSelect","selectables","someSelected","size","data","useSelection","Error","description"],"sources":["../../../../src/components/table/composibles/selection.ts"],"sourcesContent":["import { InjectionKey, PropType, Ref, computed, inject, provide } from 'vue';\n\nimport { useModelDuplex } from '../../../composables/communication';\nimport { wrapInArray } from '../../../util/array';\nimport { propsFactory } from '../../../util/vue-component';\n\nimport { DataTableProvideSelectionData } from '../types';\nimport { DataTableItemsProps } from './items';\n\nexport interface SelectableItem {\n value: any;\n selectable: boolean;\n}\n\nexport interface DataTableSelectStrategy {\n showSelectAll: boolean;\n allSelected: (data: {\n allItems: SelectableItem[];\n pageItems: SelectableItem[];\n }) => SelectableItem[];\n select: (data: {\n items: SelectableItem[];\n value: boolean;\n selected: Set<unknown>;\n }) => Set<unknown>;\n selectAll: (data: {\n value: boolean;\n allItems: SelectableItem[];\n pageItems: SelectableItem[];\n selected: Set<unknown>;\n }) => Set<unknown>;\n}\n\nexport const pressDataTableSelectionProps = propsFactory(\n {\n enableSelect: Boolean,\n selectStrategy: {\n type: [String, Object] as PropType<'single' | 'page' | 'all'>,\n default: 'page',\n },\n modelValue: {\n type: Array as PropType<readonly any[]>,\n default: () => [],\n },\n },\n 'YDataTable--selection',\n);\n\ntype DataTableSelectionProps = Pick<DataTableItemsProps, 'itemKey'> & {\n modelValue: readonly any[];\n selectStrategy: 'single' | 'page' | 'all';\n 'onUpdate:modelValue': ((value: any[]) => void) | undefined;\n};\n\nconst singleSelectStrategy: DataTableSelectStrategy = {\n showSelectAll: false,\n allSelected: () => [],\n select: ({ items, value }) => {\n return new Set(value ? [items[0]?.value] : []);\n },\n selectAll: ({ selected }) => selected,\n};\n\nconst pageSelectStrategy: DataTableSelectStrategy = {\n showSelectAll: true,\n allSelected: ({ pageItems }) => pageItems,\n select: ({ items, value, selected }) => {\n for (const item of items) {\n if (value) selected.add(item.value);\n else selected.delete(item.value);\n }\n\n return selected;\n },\n selectAll: ({ value, pageItems, selected }) =>\n pageSelectStrategy.select({ items: pageItems, value, selected }),\n};\n\nconst allSelectStrategy: DataTableSelectStrategy = {\n showSelectAll: true,\n allSelected: ({ allItems }) => allItems,\n select: ({ items, value, selected }) => {\n for (const item of items) {\n if (value) selected.add(item.value);\n else selected.delete(item.value);\n }\n\n return selected;\n },\n selectAll: ({ value, allItems, selected }) =>\n allSelectStrategy.select({ items: allItems, value, selected }),\n};\n\nexport const Y_DATA_TABLE_SELECTION_KEY: InjectionKey<\n ReturnType<typeof provideSelection>\n> = Symbol.for('yuyeon.data-table.selection');\n\nexport function provideSelection(\n props: DataTableSelectionProps,\n {\n allItems,\n pageItems,\n }: { allItems: Ref<SelectableItem[]>; pageItems: Ref<SelectableItem[]> },\n) {\n const selected = useModelDuplex(\n props,\n 'modelValue',\n props.modelValue,\n (v) => {\n return new Set(v);\n },\n (v) => {\n return [...v.values()];\n },\n );\n\n const allSelectables = computed(() =>\n allItems.value.filter((item) => item.selectable),\n );\n\n const pageSelectables = computed(() =>\n pageItems.value.filter((item) => item.selectable),\n );\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') {\n return props.selectStrategy;\n }\n switch (props.selectStrategy) {\n case 'single':\n return singleSelectStrategy;\n case 'all':\n return allSelectStrategy;\n case 'page':\n default:\n return pageSelectStrategy;\n }\n });\n\n function isSelected(items: SelectableItem | SelectableItem[]) {\n return wrapInArray(items).every((item) => selected.value.has(item.value));\n }\n\n function isSomeSelected(items: SelectableItem | SelectableItem[]) {\n return wrapInArray(items).some((item) => selected.value.has(item.value));\n }\n\n function select(items: SelectableItem[], value: boolean) {\n selected.value = selectStrategy.value.select({\n items,\n value,\n selected: new Set(selected.value),\n });\n }\n\n function toggleSelect(item: SelectableItem) {\n select([item], !isSelected([item]));\n }\n\n function selectAll(value: boolean) {\n selected.value = selectStrategy.value.selectAll({\n value,\n allItems: allSelectables.value,\n pageItems: pageSelectables.value,\n selected: new Set(selected.value),\n });\n }\n\n const selectables = computed(() => {\n return selectStrategy.value.allSelected({\n allItems: allSelectables.value,\n pageItems: pageSelectables.value,\n });\n });\n\n const someSelected = computed(() => selected.value.size > 0);\n\n const allSelected = computed(() => {\n return isSelected(selectables.value);\n });\n\n const data: DataTableProvideSelectionData = {\n toggleSelect,\n select,\n selectAll,\n isSelected,\n isSomeSelected,\n someSelected,\n allSelected,\n showSelectAll: selectStrategy.value.showSelectAll,\n selectables,\n };\n\n provide(Y_DATA_TABLE_SELECTION_KEY, data);\n\n return data;\n}\n\nexport function useSelection() {\n const data = inject(Y_DATA_TABLE_SELECTION_KEY);\n if (!data) {\n throw new Error(`Not provided: ${Y_DATA_TABLE_SELECTION_KEY.description}`);\n }\n\n return data;\n}\n"],"mappings":"AAAA,SAAsCA,QAAQ,EAAEC,MAAM,EAAEC,OAAO,QAAQ,KAAK;AAAC,SAEpEC,cAAc;AAAA,SACdC,WAAW;AAAA,SACXC,YAAY;AA6BrB,OAAO,MAAMC,4BAA4B,GAAGD,YAAY,CACtD;EACEE,YAAY,EAAEC,OAAO;EACrBC,cAAc,EAAE;IACdC,IAAI,EAAE,CAACC,MAAM,EAAEC,MAAM,CAAwC;IAC7DC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vB,0BAA0B,CAACwB,WAAY,EAAC,CAAC;EAC5E;EAEA,OAAOH,IAAI;AACb"}
|
|
1
|
+
{"version":3,"file":"selection.mjs","names":["computed","inject","provide","useModelDuplex","deepEqual","wrapInArray","propsFactory","pressDataTableSelectionProps","enableSelect","Boolean","selectStrategy","type","String","Object","default","modelValue","Array","valueEqual","Function","singleSelectStrategy","showSelectAll","allSelected","select","_ref","items","value","Set","selectAll","_ref2","selected","pageSelectStrategy","_ref3","pageItems","_ref4","item","add","delete","_ref5","allSelectStrategy","_ref6","allItems","_ref7","_ref8","Y_DATA_TABLE_SELECTION_KEY","Symbol","for","provideSelection","props","_ref9","v","map","find","values","allSelectables","filter","selectable","pageSelectables","isSelected","every","has","isSomeSelected","some","toggleSelect","selectables","someSelected","data","useSelection","Error","description"],"sources":["../../../../src/components/table/composibles/selection.ts"],"sourcesContent":["import { InjectionKey, PropType, Ref, computed, inject, provide } from 'vue';\n\nimport { useModelDuplex } from '../../../composables/communication';\nimport { deepEqual } from '../../../util';\nimport { wrapInArray } from '../../../util/array';\nimport { propsFactory } from '../../../util/vue-component';\nimport { DataTableProvideSelectionData } from '../types';\nimport { DataTableItemsProps } from './items';\n\nexport interface SelectableItem {\n value: any;\n selectable: boolean;\n}\n\nexport interface DataTableSelectStrategy {\n showSelectAll: boolean;\n allSelected: (data: {\n allItems: SelectableItem[];\n pageItems: SelectableItem[];\n }) => SelectableItem[];\n select: (data: {\n items: SelectableItem[];\n value: boolean;\n selected: Set<unknown>;\n }) => Set<unknown>;\n selectAll: (data: {\n value: boolean;\n allItems: SelectableItem[];\n pageItems: SelectableItem[];\n selected: Set<unknown>;\n }) => Set<unknown>;\n}\n\nexport const pressDataTableSelectionProps = propsFactory(\n {\n enableSelect: Boolean,\n selectStrategy: {\n type: [String, Object] as PropType<'single' | 'page' | 'all'>,\n default: 'page',\n },\n modelValue: {\n type: Array as PropType<readonly any[]>,\n default: () => [],\n },\n valueEqual: {\n type: Function as PropType<typeof deepEqual>,\n default: deepEqual,\n },\n },\n 'YDataTable--selection',\n);\n\ntype DataTableSelectionProps = Pick<DataTableItemsProps, 'itemKey'> & {\n modelValue: readonly any[];\n selectStrategy: 'single' | 'page' | 'all';\n 'onUpdate:modelValue': ((value: any[]) => void) | undefined;\n valueEqual: (a: any, b: any) => boolean;\n};\n\nconst singleSelectStrategy: DataTableSelectStrategy = {\n showSelectAll: false,\n allSelected: () => [],\n select: ({ items, value }) => {\n return new Set(value ? [items[0]?.value] : []);\n },\n selectAll: ({ selected }) => selected,\n};\n\nconst pageSelectStrategy: DataTableSelectStrategy = {\n showSelectAll: true,\n allSelected: ({ pageItems }) => pageItems,\n select: ({ items, value, selected }) => {\n for (const item of items) {\n if (value) selected.add(item.value);\n else selected.delete(item.value);\n }\n\n return selected;\n },\n selectAll: ({ value, pageItems, selected }) =>\n pageSelectStrategy.select({ items: pageItems, value, selected }),\n};\n\nconst allSelectStrategy: DataTableSelectStrategy = {\n showSelectAll: true,\n allSelected: ({ allItems }) => allItems,\n select: ({ items, value, selected }) => {\n for (const item of items) {\n if (value) selected.add(item.value);\n else selected.delete(item.value);\n }\n\n return selected;\n },\n selectAll: ({ value, allItems, selected }) =>\n allSelectStrategy.select({ items: allItems, value, selected }),\n};\n\nexport const Y_DATA_TABLE_SELECTION_KEY: InjectionKey<\n ReturnType<typeof provideSelection>\n> = Symbol.for('yuyeon.data-table.selection');\n\nexport function provideSelection(\n props: DataTableSelectionProps,\n {\n allItems,\n pageItems,\n }: { allItems: Ref<SelectableItem[]>; pageItems: Ref<SelectableItem[]> },\n) {\n const selected = useModelDuplex(\n props,\n 'modelValue',\n props.modelValue,\n (v) => {\n return new Set(\n wrapInArray(v).map((v) => {\n return (\n allItems.value.find((item) => props.valueEqual(v, item.value))\n ?.value ?? v\n );\n }),\n );\n },\n (v) => {\n return [...v.values()];\n },\n );\n\n const allSelectables = computed(() =>\n allItems.value.filter((item) => item.selectable),\n );\n\n const pageSelectables = computed(() =>\n pageItems.value.filter((item) => item.selectable),\n );\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') {\n return props.selectStrategy;\n }\n switch (props.selectStrategy) {\n case 'single':\n return singleSelectStrategy;\n case 'all':\n return allSelectStrategy;\n case 'page':\n default:\n return pageSelectStrategy;\n }\n });\n\n function isSelected(items: SelectableItem | SelectableItem[]) {\n return wrapInArray(items).every((item) => selected.value.has(item.value));\n }\n\n function isSomeSelected(items: SelectableItem | SelectableItem[]) {\n return wrapInArray(items).some((item) => selected.value.has(item.value));\n }\n\n function select(items: SelectableItem[], value: boolean) {\n selected.value = selectStrategy.value.select({\n items,\n value,\n selected: new Set(selected.value),\n });\n }\n\n function toggleSelect(item: SelectableItem) {\n select([item], !isSelected([item]));\n }\n\n function selectAll(value: boolean) {\n selected.value = selectStrategy.value.selectAll({\n value,\n allItems: allSelectables.value,\n pageItems: pageSelectables.value,\n selected: new Set(selected.value),\n });\n }\n\n const selectables = computed(() => {\n return selectStrategy.value.allSelected({\n allItems: allSelectables.value,\n pageItems: pageSelectables.value,\n });\n });\n\n const someSelected = computed(() => {\n return isSomeSelected(pageSelectables.value);\n });\n\n const allSelected = computed(() => {\n return isSelected(selectables.value);\n });\n\n const data: DataTableProvideSelectionData = {\n toggleSelect,\n select,\n selectAll,\n isSelected,\n isSomeSelected,\n someSelected,\n allSelected,\n showSelectAll: selectStrategy.value.showSelectAll,\n selectables,\n };\n\n provide(Y_DATA_TABLE_SELECTION_KEY, data);\n\n return data;\n}\n\nexport function useSelection() {\n const data = inject(Y_DATA_TABLE_SELECTION_KEY);\n if (!data) {\n throw new Error(`Not provided: ${Y_DATA_TABLE_SELECTION_KEY.description}`);\n }\n\n return data;\n}\n"],"mappings":"AAAA,SAAsCA,QAAQ,EAAEC,MAAM,EAAEC,OAAO,QAAQ,KAAK;AAAC,SAEpEC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,WAAW;AAAA,SACXC,YAAY;AA4BrB,OAAO,MAAMC,4BAA4B,GAAGD,YAAY,CAC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,CAAC;EAEF,MAAMwC,IAAmC,GAAG;IAC1CH,YAAY;IACZxC,MAAM;IACNK,SAAS;IACT8B,UAAU;IACVG,cAAc;IACdI,YAAY;IACZ3C,WAAW;IACXD,aAAa,EAAEV,cAAc,CAACe,KAAK,CAACL,aAAa;IACjD2C;EACF,CAAC;EAED7D,OAAO,CAACyC,0BAA0B,EAAEsB,IAAI,CAAC;EAEzC,OAAOA,IAAI;AACb;AAEA,OAAO,SAASC,YAAYA,CAAA,EAAG;EAC7B,MAAMD,IAAI,GAAGhE,MAAM,CAAC0C,0BAA0B,CAAC;EAC/C,IAAI,CAACsB,IAAI,EAAE;IACT,MAAM,IAAIE,KAAK,CAAE,iBAAgBxB,0BAA0B,CAACyB,WAAY,EAAC,CAAC;EAC5E;EAEA,OAAOH,IAAI;AACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.mjs","names":[],"sources":["../../../../src/components/table/types/common.ts"],"sourcesContent":["export type DataTableCompareFn<T = any> = (a: T, b: T) => number;\r\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.mjs","names":[],"sources":["../../../../src/components/table/types/header.ts"],"sourcesContent":["import { DataTableCompareFn } from './common';\r\n\r\nexport type DataTableHeader = {\r\n key: string;\r\n text: string;\r\n value?: any;\r\n\r\n colspan?: number;\r\n rowspan?: number;\r\n fixed?: boolean;\r\n\r\n classes?: string | string[];\r\n align?: 'start' | 'end' | 'center';\r\n width?: number | string;\r\n minWidth?: string;\r\n maxWidth?: string;\r\n sortable?: boolean;\r\n sort?: DataTableCompareFn;\r\n mustSort?: boolean;\r\n};\r\n\r\nexport type InternalDataTableHeader = DataTableHeader & {\r\n sortable: boolean;\r\n fixedOffset?: number;\r\n lastFixed?: boolean;\r\n};\r\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/table/types/index.ts"],"sourcesContent":["import { ComputedRef, Ref, UnwrapRef } from 'vue';\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/table/types/index.ts"],"sourcesContent":["import { ComputedRef, Ref, UnwrapRef } from 'vue';\n\nimport { SelectableItem } from '../composibles/selection';\nimport type { DataTableCompareFn } from './common';\nimport type { DataTableHeader, InternalDataTableHeader } from './header';\nimport type { DataTableItem, ItemKeySlot } from './item';\nimport type { RowProps, CellProps } from './row';\n\nexport type {\n ItemKeySlot,\n RowProps,\n CellProps,\n DataTableHeader,\n InternalDataTableHeader,\n DataTableItem,\n DataTableCompareFn,\n};\n\nexport type SortOption = { key: string; order?: boolean | 'asc' | 'desc' };\n\nexport type DataTableProvideSortingData = {\n sortBy: Ref<readonly SortOption[]>;\n toggleSort: (column: InternalDataTableHeader) => void;\n isSorted: (column: InternalDataTableHeader) => boolean;\n};\n\nexport interface DataTableProvidePaginationData {\n page: Ref<number>;\n pageSize: Ref<number>;\n startIndex: ComputedRef<number>;\n endIndex: ComputedRef<number>;\n pageLength: ComputedRef<number>;\n total: Ref<number>;\n nextPage: () => void;\n prevPage: () => void;\n setPage: (value: number) => void;\n setPageSize: (value: number) => void;\n}\n\nexport interface DataTableProvideSelectionData {\n toggleSelect: (item: SelectableItem) => void;\n select: (items: SelectableItem[], value: boolean) => void;\n selectAll: (value: boolean) => void;\n isSelected: (items: SelectableItem | SelectableItem[]) => any;\n isSomeSelected: (items: SelectableItem | SelectableItem[]) => any;\n someSelected: ComputedRef<boolean>;\n allSelected: ComputedRef<any>;\n showSelectAll: boolean;\n selectables: ComputedRef<SelectableItem[]>;\n}\n\nexport type YDataTableSlotProps = {\n // pagination\n page: number;\n pageSize: number;\n pageLength: number;\n setPageSize: DataTableProvidePaginationData['setPageSize'];\n // sorting\n sortBy: UnwrapRef<DataTableProvideSortingData['sortBy']>;\n toggleSort: DataTableProvideSortingData['toggleSort'];\n // selection\n someSelected: boolean;\n allSelected: boolean;\n isSelected: DataTableProvideSelectionData['isSelected'];\n select: DataTableProvideSelectionData['select'];\n selectAll: DataTableProvideSelectionData['selectAll'];\n toggleSelect: DataTableProvideSelectionData['toggleSelect'];\n //\n items: readonly DataTableItem[];\n columns: InternalDataTableHeader[];\n headers: InternalDataTableHeader[][];\n};\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.mjs","names":[],"sources":["../../../../src/components/table/types/item.ts"],"sourcesContent":["import { SelectableItem, provideSelection } from '../composibles/selection';\nimport { InternalDataTableHeader } from './header';\n\ntype ItemSlotBase<T> = {\n index: number;\n item: T;\n internalItem: DataTableItem<T>;\n selected: boolean;\n isSelected: ReturnType<typeof provideSelection>['isSelected'];\n toggleSelect: ReturnType<typeof provideSelection>['toggleSelect'];\n};\n\nexport type ItemKeySlot<T> = ItemSlotBase<T> & {\n value: any;\n column: InternalDataTableHeader;\n};\n\nexport interface DataTableItem<T = any> extends SelectableItem {\n index: number;\n columns: Record<string, any>;\n raw: T;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.mjs","names":[],"sources":["../../../../src/components/table/types/row.ts"],"sourcesContent":["import { ItemKeySlot } from './item';\r\n\r\nexport type RowProps<T> =\r\n| Record<string, any>\r\n| ((data: Pick<ItemKeySlot<T>, 'index' | 'item' | 'internalItem'>) => Record<string, any>)\r\n\r\nexport type CellProps<T = any> =\r\n | Record<string, any>\r\n | ((\r\n data: Pick<\r\n ItemKeySlot<T>,\r\n 'index' | 'item' | 'internalItem' | 'value' | 'column' | 'selected'\r\n >,\r\n) => Record<string, any>);\r\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resize-observer.mjs","names":["readonly","ref","onBeforeUnmount","watch","getHtmlElement","useResizeObserver","callback","resizeObservedRef","contentRect","window","observer","ResizeObserver","entries","length","value","disconnect","neo","old","unobserve","undefined","observe","flush"],"sources":["../../src/composables/resize-observer.ts"],"sourcesContent":["import { readonly, ref } from 'vue';\r\nimport { onBeforeUnmount } from 'vue';\r\nimport { watch } from 'vue';\r\n\r\nimport { getHtmlElement } from '../util/vue-component';\r\n\r\nexport function useResizeObserver(callback?: ResizeObserverCallback) {\r\n const resizeObservedRef = ref<HTMLElement>();\r\n const contentRect = ref<DOMRectReadOnly>();\r\n if (window) {\r\n const observer = new ResizeObserver((entries, observer) => {\r\n callback?.(entries, observer);\r\n if (!entries.length) return;\r\n contentRect.value = entries[0].contentRect;\r\n });\r\n\r\n onBeforeUnmount(() => {\r\n observer.disconnect();\r\n });\r\n\r\n watch(\r\n resizeObservedRef,\r\n (neo, old) => {\r\n if (old) {\r\n observer.unobserve(old);\r\n contentRect.value = undefined;\r\n }\r\n if (neo) {\r\n observer.observe(getHtmlElement(neo));\r\n }\r\n },\r\n { flush: 'post' },\r\n );\r\n }\r\n\r\n return {\r\n resizeObservedRef,\r\n contentRect: readonly(contentRect),\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AACnC,SAASC,eAAe,QAAQ,KAAK;AACrC,SAASC,KAAK,QAAQ,KAAK;AAAC,SAEnBC,cAAc;AAEvB,OAAO,SAASC,iBAAiBA,CAACC,QAAiC,EAAE;EACnE,MAAMC,iBAAiB,GAAGN,GAAG,CAAc,CAAC;EAC5C,MAAMO,WAAW,GAAGP,GAAG,CAAkB,CAAC;EAC1C,IAAIQ,MAAM,EAAE;IACV,MAAMC,QAAQ,GAAG,IAAIC,cAAc,CAAC,CAACC,OAAO,EAAEF,QAAQ,KAAK;MACzDJ,QAAQ,GAAGM,OAAO,EAAEF,QAAQ,CAAC;MAC7B,IAAI,CAACE,OAAO,CAACC,MAAM,EAAE;MACrBL,WAAW,CAACM,KAAK,GAAGF,OAAO,CAAC,CAAC,CAAC,CAACJ,WAAW;IAC5C,CAAC,CAAC;IAEFN,eAAe,CAAC,MAAM;MACpBQ,QAAQ,CAACK,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;IAEFZ,KAAK,CACDI,iBAAiB,EACjB,CAACS,GAAG,EAAEC,GAAG,KAAK;MACZ,IAAIA,GAAG,EAAE;QACPP,QAAQ,CAACQ,SAAS,
|
|
1
|
+
{"version":3,"file":"resize-observer.mjs","names":["readonly","ref","onBeforeUnmount","watch","getHtmlElement","useResizeObserver","callback","resizeObservedRef","contentRect","window","observer","ResizeObserver","entries","length","value","disconnect","neo","old","unobserve","undefined","observe","flush"],"sources":["../../src/composables/resize-observer.ts"],"sourcesContent":["import { readonly, ref } from 'vue';\r\nimport { onBeforeUnmount } from 'vue';\r\nimport { watch } from 'vue';\r\n\r\nimport { getHtmlElement } from '../util/vue-component';\r\n\r\nexport function useResizeObserver(callback?: ResizeObserverCallback) {\r\n const resizeObservedRef = ref<HTMLElement>();\r\n const contentRect = ref<DOMRectReadOnly>();\r\n if (window) {\r\n const observer = new ResizeObserver((entries, observer) => {\r\n callback?.(entries, observer);\r\n if (!entries.length) return;\r\n contentRect.value = entries[0].contentRect;\r\n });\r\n\r\n onBeforeUnmount(() => {\r\n observer.disconnect();\r\n });\r\n\r\n watch(\r\n resizeObservedRef,\r\n (neo, old) => {\r\n if (old) {\r\n observer.unobserve(getHtmlElement(old));\r\n contentRect.value = undefined;\r\n }\r\n if (neo) {\r\n observer.observe(getHtmlElement(neo));\r\n }\r\n },\r\n { flush: 'post' },\r\n );\r\n }\r\n\r\n return {\r\n resizeObservedRef,\r\n contentRect: readonly(contentRect),\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AACnC,SAASC,eAAe,QAAQ,KAAK;AACrC,SAASC,KAAK,QAAQ,KAAK;AAAC,SAEnBC,cAAc;AAEvB,OAAO,SAASC,iBAAiBA,CAACC,QAAiC,EAAE;EACnE,MAAMC,iBAAiB,GAAGN,GAAG,CAAc,CAAC;EAC5C,MAAMO,WAAW,GAAGP,GAAG,CAAkB,CAAC;EAC1C,IAAIQ,MAAM,EAAE;IACV,MAAMC,QAAQ,GAAG,IAAIC,cAAc,CAAC,CAACC,OAAO,EAAEF,QAAQ,KAAK;MACzDJ,QAAQ,GAAGM,OAAO,EAAEF,QAAQ,CAAC;MAC7B,IAAI,CAACE,OAAO,CAACC,MAAM,EAAE;MACrBL,WAAW,CAACM,KAAK,GAAGF,OAAO,CAAC,CAAC,CAAC,CAACJ,WAAW;IAC5C,CAAC,CAAC;IAEFN,eAAe,CAAC,MAAM;MACpBQ,QAAQ,CAACK,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;IAEFZ,KAAK,CACDI,iBAAiB,EACjB,CAACS,GAAG,EAAEC,GAAG,KAAK;MACZ,IAAIA,GAAG,EAAE;QACPP,QAAQ,CAACQ,SAAS,CAACd,cAAc,CAACa,GAAG,CAAC,CAAC;QACvCT,WAAW,CAACM,KAAK,GAAGK,SAAS;MAC/B;MACA,IAAIH,GAAG,EAAE;QACPN,QAAQ,CAACU,OAAO,CAAChB,cAAc,CAACY,GAAG,CAAC,CAAC;MACvC;IACF,CAAC,EACD;MAAEK,KAAK,EAAE;IAAO,CACpB,CAAC;EACH;EAEA,OAAO;IACLd,iBAAiB;IACjBC,WAAW,EAAER,QAAQ,CAACQ,WAAW;EACnC,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, watch } from 'vue';
|
|
1
|
+
import { computed, ref, watch, unref } from 'vue';
|
|
2
2
|
export function useLazy(eager, updated) {
|
|
3
3
|
const tick = ref(false);
|
|
4
4
|
const tack = ref();
|
|
@@ -27,16 +27,14 @@ export function useLazy(eager, updated) {
|
|
|
27
27
|
onAfterUpdate
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
export function useTimer(cb) {
|
|
31
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
32
|
-
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
30
|
+
export function useTimer(cb, duration, options) {
|
|
33
31
|
const {
|
|
34
32
|
tickDuration
|
|
35
33
|
} = options ?? {};
|
|
36
34
|
let tickInterval = tickDuration ?? 100;
|
|
37
35
|
let timer = -1;
|
|
38
36
|
const tickStart = ref(0);
|
|
39
|
-
const drift = ref(duration);
|
|
37
|
+
const drift = ref(unref(duration));
|
|
40
38
|
const isWork = ref(false);
|
|
41
39
|
function tick() {
|
|
42
40
|
const now = Date.now();
|
|
@@ -64,7 +62,7 @@ export function useTimer(cb) {
|
|
|
64
62
|
}
|
|
65
63
|
function reset() {
|
|
66
64
|
stop();
|
|
67
|
-
drift.value = duration;
|
|
65
|
+
drift.value = unref(duration);
|
|
68
66
|
}
|
|
69
67
|
return {
|
|
70
68
|
start,
|
|
@@ -74,4 +72,31 @@ export function useTimer(cb) {
|
|
|
74
72
|
isWork
|
|
75
73
|
};
|
|
76
74
|
}
|
|
75
|
+
export function useDelay(props, callback) {
|
|
76
|
+
const state = {};
|
|
77
|
+
function clearDelay(propKey) {
|
|
78
|
+
state[propKey] && window.clearTimeout(state[propKey]);
|
|
79
|
+
delete state[propKey];
|
|
80
|
+
}
|
|
81
|
+
function setDelay(propKey, timeout, resolve) {
|
|
82
|
+
state[propKey] = window.setTimeout(() => {
|
|
83
|
+
const active = propKey === 'openDelay';
|
|
84
|
+
callback?.(active);
|
|
85
|
+
resolve(active);
|
|
86
|
+
}, timeout);
|
|
87
|
+
}
|
|
88
|
+
const generateDelay = propKey => () => {
|
|
89
|
+
clearDelay('openDelay');
|
|
90
|
+
clearDelay('closeDelay');
|
|
91
|
+
const delayTime = props[propKey] ?? 0;
|
|
92
|
+
return new Promise(resolve => {
|
|
93
|
+
const delay = parseInt(String(delayTime), 10);
|
|
94
|
+
setDelay(propKey, delay, resolve);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
startOpenDelay: generateDelay('openDelay'),
|
|
99
|
+
startCloseDelay: generateDelay('closeDelay')
|
|
100
|
+
};
|
|
101
|
+
}
|
|
77
102
|
//# sourceMappingURL=timing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timing.mjs","names":["computed","ref","watch","useLazy","eager","updated","tick","tack","value","lazyValue","onAfterUpdate","entered","useTimer","cb","duration","
|
|
1
|
+
{"version":3,"file":"timing.mjs","names":["computed","ref","watch","unref","useLazy","eager","updated","tick","tack","value","lazyValue","onAfterUpdate","entered","useTimer","cb","duration","options","tickDuration","tickInterval","timer","tickStart","drift","isWork","now","Date","realTick","tickDrift","nextInterval","window","setTimeout","start","stop","clearTimeout","reset","useDelay","props","callback","state","clearDelay","propKey","setDelay","timeout","resolve","active","generateDelay","delayTime","Promise","delay","parseInt","String","startOpenDelay","startCloseDelay"],"sources":["../../src/composables/timing.ts"],"sourcesContent":["import { Ref, computed, ref, watch, MaybeRef, unref } from 'vue';\r\n\r\nexport function useLazy(eager: Ref<boolean | undefined>, updated: Ref<any>) {\r\n const tick = ref(false);\r\n const tack = ref();\r\n tack.value = updated.value;\r\n const lazyValue = computed(() => {\r\n if (eager.value) return updated.value;\r\n return tack.value;\r\n });\r\n watch(updated, () => {\r\n if (!tick.value) {\r\n tack.value = updated.value;\r\n }\r\n if (!eager.value) {\r\n tick.value = true;\r\n }\r\n });\r\n function onAfterUpdate() {\r\n tack.value = updated.value;\r\n if (!eager.value) {\r\n tick.value = false;\r\n }\r\n }\r\n return {\r\n entered: tick,\r\n lazyValue,\r\n onAfterUpdate,\r\n };\r\n}\r\n\r\nexport function useTimer(\r\n cb: () => void,\r\n duration: MaybeRef<number>,\r\n options?: { tickDuration: number },\r\n) {\r\n const { tickDuration } = options ?? {};\r\n let tickInterval = tickDuration ?? 100;\r\n let timer = -1;\r\n\r\n const tickStart = ref(0);\r\n const drift = ref(unref(duration));\r\n const isWork = ref(false);\r\n\r\n function tick() {\r\n const now = Date.now();\r\n const realTick = now - tickStart.value;\r\n drift.value = drift.value - realTick;\r\n if (drift.value < 1) {\r\n cb();\r\n } else {\r\n const tickDrift = now - tickStart.value + tickInterval;\r\n const nextInterval = tickDrift >= 1 ? tickDrift : tickInterval;\r\n tickStart.value = now;\r\n timer = window.setTimeout(tick, nextInterval);\r\n }\r\n }\r\n\r\n function start() {\r\n if (isWork.value) return;\r\n isWork.value = true;\r\n tickStart.value = Date.now();\r\n timer = window.setTimeout(tick, tickInterval);\r\n }\r\n\r\n function stop() {\r\n window.clearTimeout(timer);\r\n timer = -1;\r\n isWork.value = false;\r\n }\r\n\r\n function reset() {\r\n stop();\r\n drift.value = unref(duration);\r\n }\r\n\r\n return {\r\n start,\r\n stop,\r\n reset,\r\n drift,\r\n isWork,\r\n }\r\n}\r\n\r\ntype DelayType = 'closeDelay' | 'openDelay';\r\n\r\nexport function useDelay(props: any, callback?: (active: boolean) => void) {\r\n const state: Partial<Record<DelayType, number>> = {};\r\n\r\n function clearDelay(propKey: DelayType) {\r\n state[propKey] && window.clearTimeout(state[propKey]);\r\n delete state[propKey];\r\n }\r\n\r\n function setDelay(propKey: DelayType, timeout: number, resolve: any) {\r\n state[propKey] = window.setTimeout(() => {\r\n const active = propKey === 'openDelay';\r\n callback?.(active);\r\n resolve(active);\r\n }, timeout);\r\n }\r\n\r\n const generateDelay = (propKey: DelayType) => () => {\r\n clearDelay('openDelay');\r\n clearDelay('closeDelay');\r\n const delayTime = props[propKey] ?? 0;\r\n return new Promise<boolean>((resolve) => {\r\n const delay = parseInt(String(delayTime), 10);\r\n setDelay(propKey, delay, resolve);\r\n });\r\n };\r\n\r\n return {\r\n startOpenDelay: generateDelay('openDelay'),\r\n startCloseDelay: generateDelay('closeDelay'),\r\n };\r\n}\r\n\r\n"],"mappings":"AAAA,SAAcA,QAAQ,EAAEC,GAAG,EAAEC,KAAK,EAAYC,KAAK,QAAQ,KAAK;AAEhE,OAAO,SAASC,OAAOA,CAACC,KAA+B,EAAEC,OAAiB,EAAE;EAC1E,MAAMC,IAAI,GAAGN,GAAG,CAAC,KAAK,CAAC;EACvB,MAAMO,IAAI,GAAGP,GAAG,CAAC,CAAC;EAClBO,I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O,CAAC,CAAC;IACrD,OAAOF,KAAK,CAACE,OAAO,CAAC;EACvB;EAEA,SAASC,QAAQA,CAACD,OAAkB,EAAEE,OAAe,EAAEC,OAAY,EAAE;IACnEL,KAAK,CAACE,OAAO,CAAC,GAAGX,MAAM,CAACC,UAAU,CAAC,MAAM;MACvC,MAAMc,MAAM,GAAGJ,OAAO,KAAK,WAAW;MACtCH,QAAQ,GAAGO,MAAM,CAAC;MAClBD,OAAO,CAACC,MAAM,CAAC;IACjB,CAAC,EAAEF,OAAO,CAAC;EACb;EAEA,MAAMG,aAAa,GAAIL,OAAkB,IAAK,MAAM;IAClDD,UAAU,CAAC,WAAW,CAAC;IACvBA,UAAU,CAAC,YAAY,CAAC;IACxB,MAAMO,SAAS,GAAGV,KAAK,CAACI,OAAO,CAAC,IAAI,CAAC;IACrC,OAAO,IAAIO,OAAO,CAAWJ,OAAO,IAAK;MACvC,MAAMK,KAAK,GAAGC,QAAQ,CAACC,MAAM,CAACJ,SAAS,CAAC,EAAE,EAAE,CAAC;MAC7CL,QAAQ,CAACD,OAAO,EAAEQ,KAAK,EAAEL,OAAO,CAAC;IACnC,CAAC,CAAC;EACJ,CAAC;EAED,OAAO;IACLQ,cAAc,EAAEN,aAAa,CAAC,WAAW,CAAC;IAC1CO,eAAe,EAAEP,aAAa,CAAC,YAAY;EAC7C,CAAC;AACH"}
|
package/lib/locales/en.mjs
CHANGED
package/lib/locales/en.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.mjs","names":["search","noItems"],"sources":["../../src/locales/en.ts"],"sourcesContent":["export default {\r\n search: 'search',\r\n noItems: 'No Options'\r\n};\r\n"],"mappings":"AAAA,eAAe;EACbA,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"en.mjs","names":["search","noItems","noData"],"sources":["../../src/locales/en.ts"],"sourcesContent":["export default {\r\n search: 'search',\r\n noItems: 'No Options',\r\n noData: 'No Data'\r\n};\r\n"],"mappings":"AAAA,eAAe;EACbA,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,YAAY;EACrBC,MAAM,EAAE;AACV,CAAC"}
|
package/lib/locales/ko.mjs
CHANGED
package/lib/locales/ko.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ko.mjs","names":["search","noItems"],"sources":["../../src/locales/ko.ts"],"sourcesContent":["export default {\r\n search: '검색',\r\n noItems: '항목이 없습니다.'\r\n};\r\n"],"mappings":"AAAA,eAAe;EACbA,MAAM,EAAE,IAAI;EACZC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"ko.mjs","names":["search","noItems","noData"],"sources":["../../src/locales/ko.ts"],"sourcesContent":["export default {\r\n search: '검색',\r\n noItems: '항목이 없습니다.',\r\n noData: '데이터가 없습니다.'\r\n};\r\n"],"mappings":"AAAA,eAAe;EACbA,MAAM,EAAE,IAAI;EACZC,OAAO,EAAE,WAAW;EACpBC,MAAM,EAAE;AACV,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { capitalize } from '@vue/runtime-core';
|
|
2
2
|
import { getCurrentInstance } from 'vue';
|
|
3
|
-
import { hasOwnProperty } from "./common.mjs";
|
|
4
3
|
export function getSlot(vm) {
|
|
5
4
|
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
6
5
|
let data = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -43,7 +42,14 @@ export function bindClasses(classes) {
|
|
|
43
42
|
return boundClasses;
|
|
44
43
|
}
|
|
45
44
|
export function getHtmlElement(node) {
|
|
46
|
-
|
|
45
|
+
if (node && '$el' in node) {
|
|
46
|
+
const el = node.$el;
|
|
47
|
+
if (el.nodeType === Node.TEXT_NODE) {
|
|
48
|
+
return el.nextElementSibling;
|
|
49
|
+
}
|
|
50
|
+
return el;
|
|
51
|
+
}
|
|
52
|
+
return node;
|
|
47
53
|
}
|
|
48
54
|
export function findChildrenWithProvide(key, vnode) {
|
|
49
55
|
if (!vnode || typeof vnode !== 'object') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-component.mjs","names":["capitalize","getCurrentInstance","hasOwnProperty","getSlot","vm","name","arguments","length","undefined","data","optional","$slots","slot","Function","filter","node","el","nodeType","getUid","uid","chooseProps","props","target","Object","keys","reduce","acc","prop","bindClasses","classes","boundClasses","Array","isArray","clas","getHtmlElement","$el","findChildrenWithProvide","key","vnode","map","child","flat","children","component","getOwnPropertySymbols","provides","includes","subTree","propsFactory","source","defaults","options","option","isObjectOption","objectOption","type","default","hasEventProp","onType","EventPropOption"],"sources":["../../src/util/vue-component.ts"],"sourcesContent":["import { ComponentInternalInstance, capitalize } from '@vue/runtime-core';\nimport type { IfAny } from '@vue/shared';\nimport type {\n ComponentObjectPropsOptions,\n ComponentPublicInstance,\n ExtractPropTypes,\n InjectionKey,\n Prop,\n PropType,\n VNode,\n VNodeChild,\n} from 'vue';\nimport { getCurrentInstance } from 'vue';\n\nimport { hasOwnProperty } from './common';\n\nexport function getSlot(\n vm: ComponentPublicInstance | any,\n // eslint-disable-next-line default-param-last\n name = 'default',\n data?: any | (() => any),\n optional = false,\n): VNode[] | undefined {\n if (vm.$slots?.[name]) {\n const slot = vm.$slots[name]!(data instanceof Function ? data() : data);\n return slot.filter((node: VNode) => {\n return node.el?.nodeType !== 8;\n });\n }\n return undefined;\n}\n\nexport function getUid() {\n const vm = getCurrentInstance();\n return vm?.uid;\n}\n\nexport function chooseProps<PropsOptions extends ComponentObjectPropsOptions>(\n props: any,\n target: PropsOptions,\n): ExtractPropTypes<PropsOptions> {\n return Object.keys(target).reduce((acc, prop) => {\n if (props && prop in props) {\n acc[prop as keyof ExtractPropTypes<PropsOptions>] = props[prop];\n }\n return acc;\n }, {} as ExtractPropTypes<PropsOptions>);\n}\n\nexport function bindClasses(\n classes: string | string[] | Record<string, any> | undefined,\n) {\n const boundClasses = {} as Record<string, boolean>;\n if (typeof classes === 'string') {\n boundClasses[classes] = true;\n } else if (Array.isArray(classes)) {\n (classes as string[]).reduce((acc, clas) => {\n acc[clas] = true;\n return acc;\n }, boundClasses);\n } else if (typeof classes === 'object') {\n Object.keys(classes).reduce((acc, clas) => {\n acc[clas] = !!classes[clas];\n return acc;\n }, boundClasses);\n }\n return boundClasses;\n}\n\nexport function getHtmlElement<N extends object | undefined>(\n node: N,\n): Exclude<N, ComponentPublicInstance> | HTMLElement {\n return node && hasOwnProperty(node, '$el')\n ? ((node as ComponentPublicInstance).$el as HTMLElement)\n : (node as HTMLElement);\n}\n\nexport function findChildrenWithProvide(\n key: InjectionKey<any> | symbol,\n vnode?: VNodeChild,\n): ComponentInternalInstance[] {\n if (!vnode || typeof vnode !== 'object') {\n return [];\n }\n\n if (Array.isArray(vnode)) {\n return vnode.map((child) => findChildrenWithProvide(key, child)).flat(1);\n } else if (Array.isArray(vnode.children)) {\n return vnode.children\n .map((child) => findChildrenWithProvide(key, child))\n .flat(1);\n } else if (vnode.component) {\n if (\n Object.getOwnPropertySymbols((vnode.component as any).provides).includes(\n key as symbol,\n )\n ) {\n return [vnode.component];\n } else if (vnode.component.subTree) {\n return findChildrenWithProvide(key, vnode.component.subTree).flat(1);\n }\n }\n\n return [];\n}\n\nexport function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(\n props: PropsOptions,\n source: string,\n) {\n return <Defaults extends PartialKeys<PropsOptions> = {}>(\n defaults?: Defaults,\n ): OverwrittenPropOptions<PropsOptions, Defaults> => {\n return Object.keys(props).reduce<any>((options, prop) => {\n const option = props[prop];\n const isObjectOption =\n typeof option === 'object' && option != null && !Array.isArray(option);\n const objectOption = isObjectOption ? option : { type: option };\n if (defaults && prop in defaults) {\n options[prop] = {\n ...objectOption,\n default: defaults[prop],\n };\n } else {\n options[prop] = objectOption;\n }\n\n if (source && !options[prop].source) {\n options[prop].source = source;\n }\n return options;\n }, {} as PropsOptions);\n };\n}\n\nexport function hasEventProp(props: Record<string, any>, type: string) {\n const onType = `on${capitalize(type)}`;\n return !!(\n props[onType] ||\n props[`${onType}Once`] ||\n props[`${onType}Capture`] ||\n props[`${onType}OnceCapture`] ||\n props[`${onType}CaptureOnce`]\n );\n}\n\ntype OverwrittenPropOptions<\n T extends ComponentObjectPropsOptions,\n D extends PartialKeys<T>,\n> = {\n [P in keyof T]-?: unknown extends D[P]\n ? T[P]\n : T[P] extends Record<string, unknown>\n ? Omit<T[P], 'type' | 'default'> & {\n type: PropType<MergeDefault<T[P], D[P]>>;\n default: MergeDefault<T[P], D[P]>;\n }\n : {\n type: PropType<MergeDefault<T[P], D[P]>>;\n default: MergeDefault<T[P], D[P]>;\n };\n};\n\ntype MergeDefault<T, D> = unknown extends D\n ? InferPropType<T>\n : NonNullable<InferPropType<T>> | D;\n\ntype FollowPropType<T, P, D> = [T] extends [PropType<unknown>]\n ? T\n : PropType<MergeDefault<P, D>>;\n\ntype PartialKeys<T> = { [P in keyof T]?: unknown };\n\n// Copied from Vue\ntype InferPropType<T> = [T] extends [null]\n ? any // null & true would fail to infer\n : [T] extends [{ type: null | true }]\n ? // As TS issue https://github.com/Microsoft/TypeScript/issues/14829\n // somehow `ObjectConstructor` when inferred from { (): T } becomes `any`\n // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`\n any\n : [T] extends [ObjectConstructor | { type: ObjectConstructor }]\n ? Record<string, any>\n : [T] extends [BooleanConstructor | { type: BooleanConstructor }]\n ? boolean\n : [T] extends [DateConstructor | { type: DateConstructor }]\n ? Date\n : [T] extends [(infer U)[] | { type: (infer U)[] }]\n ? U extends DateConstructor\n ? Date | InferPropType<U>\n : InferPropType<U>\n : [T] extends [Prop<infer V, infer D>]\n ? unknown extends V\n ? IfAny<V, V, D>\n : V\n : T;\n\nexport type EventProp<T extends any[] = any[], F = (...args: T) => any> =\n | F\n | F[];\n\nexport const EventPropOption = <T extends any[] = any[]>() =>\n [Function, Array] as PropType<EventProp<T>>;\n"],"mappings":"AAAA,SAAoCA,UAAU,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AO,CAACxB,IAAI,CAAC,GAAG2B,YAAY;MAC9B;MAEA,IAAIL,MAAM,IAAI,CAACE,OAAO,CAACxB,IAAI,CAAC,CAACsB,MAAM,EAAE;QACnCE,OAAO,CAACxB,IAAI,CAAC,CAACsB,MAAM,GAAGA,MAAM;MAC/B;MACA,OAAOE,OAAO;IAChB,CAAC,EAAE,CAAC,CAAiB,CAAC;EACxB,CAAC;AACH;AAEA,OAAO,SAASM,YAAYA,CAACpC,KAA0B,EAAEkC,IAAY,EAAE;EACrE,MAAMG,MAAM,GAAI,KAAI1D,UAAU,CAACuD,IAAI,CAAE,EAAC;EACtC,OAAO,CAAC,EACNlC,KAAK,CAACqC,MAAM,CAAC,IACbrC,KAAK,CAAE,GAAEqC,MAAO,MAAK,CAAC,IACtBrC,KAAK,CAAE,GAAEqC,MAAO,SAAQ,CAAC,IACzBrC,KAAK,CAAE,GAAEqC,MAAO,aAAY,CAAC,IAC7BrC,KAAK,CAAE,GAAEqC,MAAO,aAAY,CAAC,CAC9B;AACH;;AA6BA;;AA4BA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAC7B,CAAC9C,QAAQ,EAAEkB,KAAK,CAA2B"}
|
|
1
|
+
{"version":3,"file":"vue-component.mjs","names":["capitalize","getCurrentInstance","getSlot","vm","name","arguments","length","undefined","data","optional","$slots","slot","Function","filter","node","el","nodeType","getUid","uid","chooseProps","props","target","Object","keys","reduce","acc","prop","bindClasses","classes","boundClasses","Array","isArray","clas","getHtmlElement","$el","Node","TEXT_NODE","nextElementSibling","findChildrenWithProvide","key","vnode","map","child","flat","children","component","getOwnPropertySymbols","provides","includes","subTree","propsFactory","source","defaults","options","option","isObjectOption","objectOption","type","default","hasEventProp","onType","EventPropOption"],"sources":["../../src/util/vue-component.ts"],"sourcesContent":["import { ComponentInternalInstance, capitalize } from '@vue/runtime-core';\nimport type { IfAny } from '@vue/shared';\nimport type {\n ComponentObjectPropsOptions,\n ComponentPublicInstance,\n ExtractPropTypes,\n InjectionKey,\n Prop,\n PropType,\n VNode,\n VNodeChild,\n} from 'vue';\nimport { getCurrentInstance } from 'vue';\n\nimport { hasOwnProperty } from './common';\n\nexport function getSlot(\n vm: ComponentPublicInstance | any,\n // eslint-disable-next-line default-param-last\n name = 'default',\n data?: any | (() => any),\n optional = false,\n): VNode[] | undefined {\n if (vm.$slots?.[name]) {\n const slot = vm.$slots[name]!(data instanceof Function ? data() : data);\n return slot.filter((node: VNode) => {\n return node.el?.nodeType !== 8;\n });\n }\n return undefined;\n}\n\nexport function getUid() {\n const vm = getCurrentInstance();\n return vm?.uid;\n}\n\nexport function chooseProps<PropsOptions extends ComponentObjectPropsOptions>(\n props: any,\n target: PropsOptions,\n): ExtractPropTypes<PropsOptions> {\n return Object.keys(target).reduce((acc, prop) => {\n if (props && prop in props) {\n acc[prop as keyof ExtractPropTypes<PropsOptions>] = props[prop];\n }\n return acc;\n }, {} as ExtractPropTypes<PropsOptions>);\n}\n\nexport function bindClasses(\n classes: string | string[] | Record<string, any> | undefined,\n) {\n const boundClasses = {} as Record<string, boolean>;\n if (typeof classes === 'string') {\n boundClasses[classes] = true;\n } else if (Array.isArray(classes)) {\n (classes as string[]).reduce((acc, clas) => {\n acc[clas] = true;\n return acc;\n }, boundClasses);\n } else if (typeof classes === 'object') {\n Object.keys(classes).reduce((acc, clas) => {\n acc[clas] = !!classes[clas];\n return acc;\n }, boundClasses);\n }\n return boundClasses;\n}\n\nexport function getHtmlElement<N extends object | undefined>(\n node: N,\n): Exclude<N, ComponentPublicInstance> | HTMLElement {\n if (node && '$el' in node) {\n const el = ((node as ComponentPublicInstance).$el as HTMLElement);\n if (el.nodeType === Node.TEXT_NODE) {\n return el.nextElementSibling as HTMLElement;\n }\n return el;\n }\n return (node as HTMLElement);\n}\n\nexport function findChildrenWithProvide(\n key: InjectionKey<any> | symbol,\n vnode?: VNodeChild,\n): ComponentInternalInstance[] {\n if (!vnode || typeof vnode !== 'object') {\n return [];\n }\n\n if (Array.isArray(vnode)) {\n return vnode.map((child) => findChildrenWithProvide(key, child)).flat(1);\n } else if (Array.isArray(vnode.children)) {\n return vnode.children\n .map((child) => findChildrenWithProvide(key, child))\n .flat(1);\n } else if (vnode.component) {\n if (\n Object.getOwnPropertySymbols((vnode.component as any).provides).includes(\n key as symbol,\n )\n ) {\n return [vnode.component];\n } else if (vnode.component.subTree) {\n return findChildrenWithProvide(key, vnode.component.subTree).flat(1);\n }\n }\n\n return [];\n}\n\nexport function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(\n props: PropsOptions,\n source: string,\n) {\n return <Defaults extends PartialKeys<PropsOptions> = {}>(\n defaults?: Defaults,\n ): OverwrittenPropOptions<PropsOptions, Defaults> => {\n return Object.keys(props).reduce<any>((options, prop) => {\n const option = props[prop];\n const isObjectOption =\n typeof option === 'object' && option != null && !Array.isArray(option);\n const objectOption = isObjectOption ? option : { type: option };\n if (defaults && prop in defaults) {\n options[prop] = {\n ...objectOption,\n default: defaults[prop],\n };\n } else {\n options[prop] = objectOption;\n }\n\n if (source && !options[prop].source) {\n options[prop].source = source;\n }\n return options;\n }, {} as PropsOptions);\n };\n}\n\nexport function hasEventProp(props: Record<string, any>, type: string) {\n const onType = `on${capitalize(type)}`;\n return !!(\n props[onType] ||\n props[`${onType}Once`] ||\n props[`${onType}Capture`] ||\n props[`${onType}OnceCapture`] ||\n props[`${onType}CaptureOnce`]\n );\n}\n\ntype OverwrittenPropOptions<\n T extends ComponentObjectPropsOptions,\n D extends PartialKeys<T>,\n> = {\n [P in keyof T]-?: unknown extends D[P]\n ? T[P]\n : T[P] extends Record<string, unknown>\n ? Omit<T[P], 'type' | 'default'> & {\n type: PropType<MergeDefault<T[P], D[P]>>;\n default: MergeDefault<T[P], D[P]>;\n }\n : {\n type: PropType<MergeDefault<T[P], D[P]>>;\n default: MergeDefault<T[P], D[P]>;\n };\n};\n\ntype MergeDefault<T, D> = unknown extends D\n ? InferPropType<T>\n : NonNullable<InferPropType<T>> | D;\n\ntype FollowPropType<T, P, D> = [T] extends [PropType<unknown>]\n ? T\n : PropType<MergeDefault<P, D>>;\n\ntype PartialKeys<T> = { [P in keyof T]?: unknown };\n\n// Copied from Vue\ntype InferPropType<T> = [T] extends [null]\n ? any // null & true would fail to infer\n : [T] extends [{ type: null | true }]\n ? // As TS issue https://github.com/Microsoft/TypeScript/issues/14829\n // somehow `ObjectConstructor` when inferred from { (): T } becomes `any`\n // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`\n any\n : [T] extends [ObjectConstructor | { type: ObjectConstructor }]\n ? Record<string, any>\n : [T] extends [BooleanConstructor | { type: BooleanConstructor }]\n ? boolean\n : [T] extends [DateConstructor | { type: DateConstructor }]\n ? Date\n : [T] extends [(infer U)[] | { type: (infer U)[] }]\n ? U extends DateConstructor\n ? Date | InferPropType<U>\n : InferPropType<U>\n : [T] extends [Prop<infer V, infer D>]\n ? unknown extends V\n ? IfAny<V, V, D>\n : V\n : T;\n\nexport type EventProp<T extends any[] = any[], F = (...args: T) => any> =\n | F\n | F[];\n\nexport const EventPropOption = <T extends any[] = any[]>() =>\n [Function, Array] as PropType<EventProp<T>>;\n"],"mappings":"AAAA,SAAoCA,UAAU,QAAQ,mBAAmB;AAYzE,SAASC,kBAAkB,QAAQ,KAAK;AAIxC,OAAO,SAASC,OAAOA,CACrBC,EAAiC,EAKZ;EAAA,IAHrBC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,SAAS;EAAA,IAChBG,IAAwB,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAAA,IACxBE,QAAQ,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAEhB,IAAIF,EAAE,CAACO,MAAM,GAAGN,IAAI,CAAC,EAAE;IACrB,MAAMO,IAAI,GAAGR,EAAE,CAACO,MAAM,CAACN,IAAI,CAAC,CAAEI,IAAI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E,EAAC;EACtC,OAAO,CAAC,EACNrC,KAAK,CAACwC,MAAM,CAAC,IACbxC,KAAK,CAAE,GAAEwC,MAAO,MAAK,CAAC,IACtBxC,KAAK,CAAE,GAAEwC,MAAO,SAAQ,CAAC,IACzBxC,KAAK,CAAE,GAAEwC,MAAO,aAAY,CAAC,IAC7BxC,KAAK,CAAE,GAAEwC,MAAO,aAAY,CAAC,CAC9B;AACH;;AA6BA;;AA4BA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAC7B,CAACjD,QAAQ,EAAEkB,KAAK,CAA2B"}
|
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ export declare const pressYDialogPropsOptions: <Defaults extends {
|
|
|
28
28
|
persistent?: unknown;
|
|
29
29
|
dialogClasses?: unknown;
|
|
30
30
|
maximized?: unknown;
|
|
31
|
+
focusTrap?: unknown;
|
|
31
32
|
offset?: unknown;
|
|
32
33
|
} = {}>(defaults?: Defaults | undefined) => {
|
|
33
34
|
disabled: unknown extends Defaults["disabled"] ? {
|
|
@@ -260,6 +261,10 @@ export declare const pressYDialogPropsOptions: <Defaults extends {
|
|
|
260
261
|
type: PropType<unknown extends Defaults["maximized"] ? boolean : boolean | Defaults["maximized"]>;
|
|
261
262
|
default: unknown extends Defaults["maximized"] ? boolean : boolean | Defaults["maximized"];
|
|
262
263
|
};
|
|
264
|
+
focusTrap: unknown extends Defaults["focusTrap"] ? PropType<string | false | string[] | HTMLElement> : {
|
|
265
|
+
type: PropType<unknown extends Defaults["focusTrap"] ? string | false | string[] | HTMLElement : Defaults["focusTrap"] | NonNullable<string | false | string[] | HTMLElement>>;
|
|
266
|
+
default: unknown extends Defaults["focusTrap"] ? string | false | string[] | HTMLElement : Defaults["focusTrap"] | NonNullable<string | false | string[] | HTMLElement>;
|
|
267
|
+
};
|
|
263
268
|
offset: unknown extends Defaults["offset"] ? {
|
|
264
269
|
type: PropType<string>;
|
|
265
270
|
} : Omit<{
|
|
@@ -353,6 +358,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
353
358
|
type: PropType<string | string[] | Record<string, any>>;
|
|
354
359
|
};
|
|
355
360
|
maximized: PropType<boolean>;
|
|
361
|
+
focusTrap: PropType<string | false | string[] | HTMLElement>;
|
|
356
362
|
offset: {
|
|
357
363
|
type: PropType<string>;
|
|
358
364
|
};
|
|
@@ -2217,6 +2223,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
2217
2223
|
type: PropType<string | string[] | Record<string, any>>;
|
|
2218
2224
|
};
|
|
2219
2225
|
maximized: PropType<boolean>;
|
|
2226
|
+
focusTrap: PropType<string | false | string[] | HTMLElement>;
|
|
2220
2227
|
offset: {
|
|
2221
2228
|
type: PropType<string>;
|
|
2222
2229
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
1
|
+
import { PropType, SlotsType } from 'vue';
|
|
2
2
|
import { YIconIconProp } from '../icon';
|
|
3
3
|
export declare const pressYDropdownPropsOptions: <Defaults extends {
|
|
4
4
|
items?: unknown;
|
|
@@ -237,4 +237,13 @@ export declare const YDropdown: import("vue").DefineComponent<{
|
|
|
237
237
|
itemText: string;
|
|
238
238
|
itemChildren: string | boolean;
|
|
239
239
|
dropdownIcon: YIconIconProp;
|
|
240
|
-
}, {
|
|
240
|
+
}, SlotsType<{
|
|
241
|
+
base: any;
|
|
242
|
+
default: any;
|
|
243
|
+
'dropdown-icon': any;
|
|
244
|
+
menu: any;
|
|
245
|
+
item: {
|
|
246
|
+
text: string;
|
|
247
|
+
item: any;
|
|
248
|
+
};
|
|
249
|
+
}>>;
|
|
@@ -5,6 +5,7 @@ export declare const pressYPaginationProps: <Defaults extends {
|
|
|
5
5
|
disabled?: unknown;
|
|
6
6
|
length?: unknown;
|
|
7
7
|
totalVisible?: unknown;
|
|
8
|
+
maxVisible?: unknown;
|
|
8
9
|
showEndButton?: unknown;
|
|
9
10
|
gap?: unknown;
|
|
10
11
|
color?: unknown;
|
|
@@ -52,6 +53,10 @@ export declare const pressYPaginationProps: <Defaults extends {
|
|
|
52
53
|
type: PropType<unknown extends Defaults["totalVisible"] ? string | number : NonNullable<string | number> | Defaults["totalVisible"]>;
|
|
53
54
|
default: unknown extends Defaults["totalVisible"] ? string | number : NonNullable<string | number> | Defaults["totalVisible"];
|
|
54
55
|
};
|
|
56
|
+
maxVisible: unknown extends Defaults["maxVisible"] ? (StringConstructor | NumberConstructor)[] : {
|
|
57
|
+
type: PropType<unknown extends Defaults["maxVisible"] ? string | number : NonNullable<string | number> | Defaults["maxVisible"]>;
|
|
58
|
+
default: unknown extends Defaults["maxVisible"] ? string | number : NonNullable<string | number> | Defaults["maxVisible"];
|
|
59
|
+
};
|
|
55
60
|
showEndButton: unknown extends Defaults["showEndButton"] ? BooleanConstructor : {
|
|
56
61
|
type: PropType<unknown extends Defaults["showEndButton"] ? boolean : boolean | Defaults["showEndButton"]>;
|
|
57
62
|
default: unknown extends Defaults["showEndButton"] ? boolean : boolean | Defaults["showEndButton"];
|
|
@@ -105,6 +110,7 @@ export declare const YPagination: import("vue").DefineComponent<{
|
|
|
105
110
|
validator: (val: number) => boolean;
|
|
106
111
|
};
|
|
107
112
|
totalVisible: (StringConstructor | NumberConstructor)[];
|
|
113
|
+
maxVisible: (StringConstructor | NumberConstructor)[];
|
|
108
114
|
showEndButton: BooleanConstructor;
|
|
109
115
|
gap: {
|
|
110
116
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -142,6 +148,7 @@ export declare const YPagination: import("vue").DefineComponent<{
|
|
|
142
148
|
validator: (val: number) => boolean;
|
|
143
149
|
};
|
|
144
150
|
totalVisible: (StringConstructor | NumberConstructor)[];
|
|
151
|
+
maxVisible: (StringConstructor | NumberConstructor)[];
|
|
145
152
|
showEndButton: BooleanConstructor;
|
|
146
153
|
gap: {
|
|
147
154
|
type: (StringConstructor | NumberConstructor)[];
|
|
@@ -28,6 +28,10 @@ export declare const YSnackbar: import("vue").DefineComponent<{
|
|
|
28
28
|
type: PropType<number>;
|
|
29
29
|
default: number;
|
|
30
30
|
};
|
|
31
|
+
closeClickContent: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
31
35
|
}, {
|
|
32
36
|
active: import("vue").WritableComputedRef<any> & {
|
|
33
37
|
readonly rxValue: any;
|
|
@@ -69,6 +73,10 @@ export declare const YSnackbar: import("vue").DefineComponent<{
|
|
|
69
73
|
type: PropType<number>;
|
|
70
74
|
default: number;
|
|
71
75
|
};
|
|
76
|
+
closeClickContent: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
default: boolean;
|
|
79
|
+
};
|
|
72
80
|
}>> & {
|
|
73
81
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
74
82
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -76,5 +84,6 @@ export declare const YSnackbar: import("vue").DefineComponent<{
|
|
|
76
84
|
position: string;
|
|
77
85
|
transition: any;
|
|
78
86
|
duration: number;
|
|
87
|
+
closeClickContent: boolean;
|
|
79
88
|
}, {}>;
|
|
80
89
|
export type YSnackbar = InstanceType<typeof YSnackbar>;
|