@katlux/toolkit 0.1.0-beta.9 → 0.1.1-alpha.107
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/LICENSE +200 -21
- package/README.md +14 -5
- package/bin/add-ai-reference.mjs +84 -0
- package/dist/compiled/composables/locales.mjs +554 -0
- package/dist/compiled/composables/useDataProvider.mjs +140 -0
- package/dist/compiled/composables/useDataProvider.spec.mjs +86 -0
- package/dist/compiled/composables/useDebounce.mjs +3 -11
- package/dist/compiled/composables/useFilterLogic.mjs +23 -169
- package/dist/compiled/composables/useKatluxI18n.mjs +56 -0
- package/dist/compiled/composables/useKatluxI18n.spec.mjs +10 -0
- package/dist/compiled/composables/usePresetComponent.mjs +71 -27
- package/dist/compiled/composables/usePresetComponent.spec.mjs +106 -0
- package/dist/compiled/composables/useRequestProvider.mjs +9 -0
- package/dist/compiled/composables/useSortLogic.mjs +3 -55
- package/dist/compiled/composables/useTemplate.spec.mjs +30 -0
- package/dist/compiled/composables/useUnregisterProvider.mjs +4 -0
- package/dist/compiled/utils/PresetResolver.mjs +19 -13
- package/dist/compiled/utils/TemplateResolver.mjs +32 -0
- package/dist/module.cjs +123 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +124 -3
- package/dist/runtime/app.config.d.ts +2 -1
- package/dist/runtime/components/KAccordion/KAccordion.logic.d.ts +5 -1
- package/dist/runtime/components/KAccordion/KAccordion.logic.js +11 -4
- package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +12 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue +11 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +12 -1
- package/dist/runtime/components/KAlert/KAlert.logic.d.ts +12 -2
- package/dist/runtime/components/KAlert/KAlert.logic.js +24 -3
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +2 -2
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +9 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +10 -3
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +11 -2
- package/dist/runtime/components/KButton/KButton.global.vue +2 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +11 -2
- package/dist/runtime/components/KButton/KButton.logic.d.ts +7 -1
- package/dist/runtime/components/KButton/KButton.logic.js +5 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.global.vue +5 -0
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +4 -1
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +75 -26
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +13 -13
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +13 -13
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +6 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +4 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +88 -12
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +19 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +88 -12
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +48 -5
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +83 -14
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +214 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +54 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +214 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +187 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.js +263 -0
- package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +53 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +20 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +53 -1
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +53 -2
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +167 -3
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +2 -2
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +1 -1
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +4 -0
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +6 -2
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +4 -0
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +8 -2
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +48 -7
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +104 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +28 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +104 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +48 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +118 -7
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +93 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +27 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +93 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +43 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +168 -7
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +36 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.vue +15 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +36 -0
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +58 -1
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +152 -4
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +9 -9
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +9 -9
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +6 -6
- package/dist/runtime/components/KGantt/KGantt.logic.js +21 -25
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +8 -57
- package/dist/runtime/components/KGrid/KGrid.global.vue +9 -2
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +8 -57
- package/dist/runtime/components/KGrid/KGrid.logic.d.ts +1 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +50 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +28 -12
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +50 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +31 -3
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +38 -10
- package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +9 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue +1 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +9 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.d.ts +5 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +8 -1
- package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +7 -7
- package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +7 -7
- package/dist/runtime/components/KIcon/KIcon.logic.d.ts +18 -4
- package/dist/runtime/components/KIcon/KIcon.logic.js +74 -12
- package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +1 -1
- package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +30 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +5 -2
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +30 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +16 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +23 -5
- package/dist/runtime/components/KModal/KModal.global.d.vue.ts +14 -2
- package/dist/runtime/components/KModal/KModal.global.vue +6 -1
- package/dist/runtime/components/KModal/KModal.global.vue.d.ts +14 -2
- package/dist/runtime/components/KModal/KModal.logic.d.ts +10 -2
- package/dist/runtime/components/KModal/KModal.logic.js +15 -3
- package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +5 -28
- package/dist/runtime/components/KPanel/KPanel.global.vue +12 -4
- package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +5 -28
- package/dist/runtime/components/KPanel/KPanel.logic.d.ts +10 -0
- package/dist/runtime/components/KPanel/KPanel.logic.js +8 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +21 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +3 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +21 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +11 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +9 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +9 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue +1 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +9 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.d.ts +5 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.js +4 -0
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +9 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue +1 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +9 -0
- package/dist/runtime/components/KSlider/KSlider.logic.d.ts +5 -0
- package/dist/runtime/components/KSlider/KSlider.logic.js +4 -0
- package/dist/runtime/components/KTabs/KTabs.logic.js +12 -5
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +30 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.vue +4 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +30 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +16 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.js +13 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +44 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -4
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +44 -2
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +26 -4
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +25 -5
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
- package/dist/runtime/components/KToast/KToast.global.vue +32 -0
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
- package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
- package/dist/runtime/components/KToast/KToast.logic.js +47 -0
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +31 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue +20 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +31 -1
- package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +25 -2
- package/dist/runtime/components/KTooltip/KTooltip.logic.js +81 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +73 -6
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +16 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +73 -6
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +38 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +36 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +3 -3
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +2 -7
- package/dist/runtime/components/MultiTabs/MultiTabs.global.d.vue.ts +23 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.global.vue +27 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.global.vue.d.ts +23 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.logic.d.ts +25 -0
- package/dist/runtime/components/MultiTabs/MultiTabs.logic.js +63 -0
- package/dist/runtime/composables/locales.d.ts +28 -0
- package/dist/runtime/composables/locales.js +554 -0
- package/dist/runtime/composables/useDataProvider.d.ts +37 -0
- package/dist/runtime/composables/useDataProvider.js +140 -0
- package/dist/runtime/composables/useDebounce.d.ts +2 -6
- package/dist/runtime/composables/useDebounce.js +3 -11
- package/dist/runtime/composables/useFilterLogic.d.ts +5 -4
- package/dist/runtime/composables/useFilterLogic.js +23 -169
- package/dist/runtime/composables/useKatluxI18n.d.ts +15 -0
- package/dist/runtime/composables/useKatluxI18n.js +56 -0
- package/dist/runtime/composables/usePresetComponent.d.ts +23 -1
- package/dist/runtime/composables/usePresetComponent.js +71 -27
- package/dist/runtime/composables/useRequestProvider.d.ts +23 -0
- package/dist/runtime/composables/useRequestProvider.js +9 -0
- package/dist/runtime/composables/useSortLogic.d.ts +3 -2
- package/dist/runtime/composables/useSortLogic.js +3 -55
- package/dist/runtime/composables/useTemplate.d.ts +1 -1
- package/dist/runtime/composables/useTemplate.js +1 -1
- package/dist/runtime/composables/useUnregisterProvider.d.ts +25 -0
- package/dist/runtime/composables/useUnregisterProvider.js +4 -0
- package/dist/runtime/plugins/PresetPlugin.d.ts +2 -3
- package/dist/runtime/plugins/PresetPlugin.js +11 -15
- package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +9 -0
- package/dist/runtime/plugins/nuxtCompatPlugin.js +11 -0
- package/dist/runtime/presets/default/assets/scss/css-variables.css +98 -17
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +322 -0
- package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
- package/dist/runtime/presets/default/assets/scss/index.css +193 -17
- package/dist/runtime/presets/default/assets/scss/index.scss +86 -0
- package/dist/runtime/presets/default/assets/scss/mixins.scss +94 -0
- package/dist/runtime/presets/default/assets/scss/reset.scss +16 -0
- package/dist/runtime/presets/default/assets/svg/arrow-down.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/arrow-left.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/arrow-right.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/arrow-up.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/bell.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/camera.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/clock.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/copy.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/divide.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/download.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/edit.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/external-link.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/eye-off.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/eye.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/hash.svg +6 -0
- package/dist/runtime/presets/default/assets/svg/heart.svg +3 -0
- package/dist/runtime/presets/default/assets/svg/home.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/image.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/info.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/link.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/lock.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/logout.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/mail.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/map-pin.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/menu.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/message-square.svg +3 -0
- package/dist/runtime/presets/default/assets/svg/minus.svg +3 -0
- package/dist/runtime/presets/default/assets/svg/more-vertical.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/multiply.svg +3 -0
- package/dist/runtime/presets/default/assets/svg/phone.svg +3 -0
- package/dist/runtime/presets/default/assets/svg/plus.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/refresh.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/settings.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/share.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/shopping-bag.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/star.svg +3 -0
- package/dist/runtime/presets/default/assets/svg/trash.svg +4 -0
- package/dist/runtime/presets/default/assets/svg/type.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/upload.svg +5 -0
- package/dist/runtime/presets/default/assets/svg/warning.svg +5 -0
- package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue +5 -2
- package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +58 -38
- package/dist/runtime/presets/default/components/KAlert/KAlert.d.vue.ts +6 -1
- package/dist/runtime/presets/default/components/KAlert/KAlert.vue +119 -3
- package/dist/runtime/presets/default/components/KAlert/KAlert.vue.d.ts +6 -1
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +49 -26
- package/dist/runtime/presets/default/components/KButton/KButton.vue +176 -430
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +86 -54
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +196 -162
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.d.vue.ts +8 -1
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +302 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue.d.ts +8 -1
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +71 -42
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +140 -79
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +85 -61
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.d.vue.ts +34 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue +234 -0
- package/dist/runtime/presets/default/components/KCompositeInput/KCompositeInput.vue.d.ts +34 -0
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +20 -1
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +102 -3
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +20 -1
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +40 -31
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +173 -95
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +60 -25
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +85 -52
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +7 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +16 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +135 -25
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +16 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +352 -247
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +40 -35
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +170 -140
- package/dist/runtime/presets/default/components/KGrid/KGrid.vue +63 -60
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +9 -2
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +50 -28
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +9 -2
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +39 -28
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +1 -1
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue +31 -22
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +1 -1
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue +65 -48
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +119 -84
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KModal/KModal.vue +88 -35
- package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KPagination/KPagination.vue +58 -46
- package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue +100 -34
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +2 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +58 -35
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +160 -125
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KSlider/KSlider.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue +125 -100
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +41 -38
- package/dist/runtime/presets/default/components/KTabs/KTabs.vue +111 -8
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +48 -21
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +5 -1
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +113 -37
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +5 -1
- package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +17 -0
- package/dist/runtime/presets/default/components/KToast/KToast.vue +118 -0
- package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +17 -0
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.d.vue.ts +14 -1
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue +71 -3
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue.d.ts +14 -1
- package/dist/runtime/presets/default/components/KTree/KTree.vue +116 -81
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +96 -55
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +7 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +31 -30
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +34 -27
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/MultiTabs/MultiTabs.d.vue.ts +9 -0
- package/dist/runtime/presets/default/components/MultiTabs/MultiTabs.vue +61 -0
- package/dist/runtime/presets/default/components/MultiTabs/MultiTabs.vue.d.ts +9 -0
- package/dist/runtime/utils/PresetResolver.d.ts +8 -9
- package/dist/runtime/utils/PresetResolver.js +19 -13
- package/dist/runtime/utils/TemplateResolver.d.ts +14 -0
- package/dist/runtime/utils/TemplateResolver.js +32 -0
- package/package.json +12 -7
- package/dist/runtime/components/KSearchTree/KSearchTree.global.d.vue.ts +0 -3
- package/dist/runtime/components/KSearchTree/KSearchTree.global.vue +0 -9
- package/dist/runtime/components/KSearchTree/KSearchTree.global.vue.d.ts +0 -3
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.d.ts +0 -4
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.js +0 -4
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.d.vue.ts +0 -3
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.vue +0 -9
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.vue.d.ts +0 -3
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.d.ts +0 -4
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.js +0 -4
- package/dist/runtime/components/KThree/KThree.global.d.vue.ts +0 -3
- package/dist/runtime/components/KThree/KThree.global.vue +0 -7
- package/dist/runtime/components/KThree/KThree.global.vue.d.ts +0 -3
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.d.vue.ts +0 -3
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue +0 -5
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue.d.ts +0 -3
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.d.vue.ts +0 -3
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue +0 -5
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue.d.ts +0 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { IDataFilter, IDataSort, TDataRow } from '@katlux/providers';
|
|
3
|
+
export interface IUseDataProviderReturn<T = TDataRow> {
|
|
4
|
+
rawProvider: any;
|
|
5
|
+
pageData: Ref<T[]>;
|
|
6
|
+
rowCount: Ref<number>;
|
|
7
|
+
currentPage: Ref<number>;
|
|
8
|
+
pageSize: Ref<number>;
|
|
9
|
+
loading: Ref<boolean>;
|
|
10
|
+
initialLoad: Ref<boolean>;
|
|
11
|
+
error: Ref<any>;
|
|
12
|
+
filter: Ref<IDataFilter | null>;
|
|
13
|
+
sortList: Ref<IDataSort[]>;
|
|
14
|
+
selectedRows: Ref<any[]>;
|
|
15
|
+
selectAll: Ref<boolean>;
|
|
16
|
+
setCurrentPage: (page: number) => void;
|
|
17
|
+
setPageSize: (size: number) => void;
|
|
18
|
+
setFilter: (filter: IDataFilter | null) => void;
|
|
19
|
+
setSortList: (sortList: IDataSort[]) => void;
|
|
20
|
+
refresh: (hardRefresh?: boolean) => Promise<void>;
|
|
21
|
+
loadPageData: (options?: {
|
|
22
|
+
disableCache?: boolean;
|
|
23
|
+
}) => Promise<void> | void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* useDataProvider
|
|
27
|
+
*
|
|
28
|
+
* Idiomatic Vue 3 composable bridge for Katlux DataProviders.
|
|
29
|
+
* Connects any standalone framework-agnostic ADataProvider (or legacy provider)
|
|
30
|
+
* to Vue 3's reactivity system.
|
|
31
|
+
*
|
|
32
|
+
* Features:
|
|
33
|
+
* - Subscribes to provider updates and syncs reactive refs automatically.
|
|
34
|
+
* - Cleans up listeners automatically with onScopeDispose (zero SSR memory leaks).
|
|
35
|
+
* - Bi-directional syncing for currentPage, pageSize, and filter.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useDataProvider<T = TDataRow>(provider: any): IUseDataProviderReturn<T>;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { ref, shallowRef, onScopeDispose, isRef } from "vue";
|
|
2
|
+
export function useDataProvider(provider) {
|
|
3
|
+
if (!provider) {
|
|
4
|
+
const emptyArray = shallowRef([]);
|
|
5
|
+
return {
|
|
6
|
+
rawProvider: null,
|
|
7
|
+
pageData: emptyArray,
|
|
8
|
+
rowCount: ref(0),
|
|
9
|
+
currentPage: ref(1),
|
|
10
|
+
pageSize: ref(10),
|
|
11
|
+
loading: ref(false),
|
|
12
|
+
initialLoad: ref(false),
|
|
13
|
+
error: ref(null),
|
|
14
|
+
filter: ref(null),
|
|
15
|
+
sortList: ref([]),
|
|
16
|
+
selectedRows: ref([]),
|
|
17
|
+
selectAll: ref(false),
|
|
18
|
+
setCurrentPage: () => {
|
|
19
|
+
},
|
|
20
|
+
setPageSize: () => {
|
|
21
|
+
},
|
|
22
|
+
setFilter: () => {
|
|
23
|
+
},
|
|
24
|
+
setSortList: () => {
|
|
25
|
+
},
|
|
26
|
+
refresh: async () => {
|
|
27
|
+
},
|
|
28
|
+
loadPageData: () => {
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const extractVal = (prop, fallback) => {
|
|
33
|
+
if (prop === void 0 || prop === null) return fallback;
|
|
34
|
+
if (isRef(prop) || typeof prop === "object" && "value" in prop) {
|
|
35
|
+
return prop.value !== void 0 ? prop.value : fallback;
|
|
36
|
+
}
|
|
37
|
+
return prop;
|
|
38
|
+
};
|
|
39
|
+
const pageData = shallowRef(
|
|
40
|
+
Array.isArray(provider.pageData) ? [...provider.pageData] : extractVal(provider.pageData, [])
|
|
41
|
+
);
|
|
42
|
+
const rowCount = ref(extractVal(provider.rowCount, 0));
|
|
43
|
+
const currentPage = ref(extractVal(provider.currentPage, 1));
|
|
44
|
+
const pageSize = ref(extractVal(provider.pageSize, 10));
|
|
45
|
+
const loading = ref(extractVal(provider.loading, false));
|
|
46
|
+
const initialLoad = ref(extractVal(provider.initialLoad, false));
|
|
47
|
+
const error = ref(extractVal(provider.error, null));
|
|
48
|
+
const filter = ref(extractVal(provider.filter, null));
|
|
49
|
+
const sortList = ref(extractVal(provider.sortList, []));
|
|
50
|
+
const selectedRows = ref(extractVal(provider.selectedRows, []));
|
|
51
|
+
const selectAll = ref(extractVal(provider.selectAll, false));
|
|
52
|
+
const syncFromProvider = () => {
|
|
53
|
+
pageData.value = Array.isArray(provider.pageData) ? [...provider.pageData] : extractVal(provider.pageData, []);
|
|
54
|
+
rowCount.value = extractVal(provider.rowCount, 0);
|
|
55
|
+
currentPage.value = extractVal(provider.currentPage, 1);
|
|
56
|
+
pageSize.value = extractVal(provider.pageSize, 10);
|
|
57
|
+
loading.value = extractVal(provider.loading, false);
|
|
58
|
+
initialLoad.value = extractVal(provider.initialLoad, false);
|
|
59
|
+
error.value = extractVal(provider.error, null);
|
|
60
|
+
filter.value = extractVal(provider.filter, null);
|
|
61
|
+
sortList.value = extractVal(provider.sortList, []);
|
|
62
|
+
selectedRows.value = extractVal(provider.selectedRows, []);
|
|
63
|
+
selectAll.value = extractVal(provider.selectAll, false);
|
|
64
|
+
};
|
|
65
|
+
if (typeof provider.subscribe === "function") {
|
|
66
|
+
const unsubscribe = provider.subscribe(() => {
|
|
67
|
+
syncFromProvider();
|
|
68
|
+
});
|
|
69
|
+
try {
|
|
70
|
+
onScopeDispose(unsubscribe);
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const setCurrentPage = (page) => {
|
|
75
|
+
if (typeof provider.setCurrentPage === "function") {
|
|
76
|
+
provider.setCurrentPage(page);
|
|
77
|
+
} else if (provider.currentPage) {
|
|
78
|
+
provider.currentPage.value = page;
|
|
79
|
+
}
|
|
80
|
+
currentPage.value = page;
|
|
81
|
+
};
|
|
82
|
+
const setPageSize = (size) => {
|
|
83
|
+
if (typeof provider.setPageSize === "function") {
|
|
84
|
+
provider.setPageSize(size);
|
|
85
|
+
} else if (provider.pageSize) {
|
|
86
|
+
provider.pageSize.value = size;
|
|
87
|
+
}
|
|
88
|
+
pageSize.value = size;
|
|
89
|
+
};
|
|
90
|
+
const setFilter = (f) => {
|
|
91
|
+
if (typeof provider.setFilter === "function") {
|
|
92
|
+
provider.setFilter(f);
|
|
93
|
+
} else if (provider.filter) {
|
|
94
|
+
provider.filter.value = f;
|
|
95
|
+
}
|
|
96
|
+
filter.value = f;
|
|
97
|
+
};
|
|
98
|
+
const setSortList = (s) => {
|
|
99
|
+
if (typeof provider.setSortList === "function") {
|
|
100
|
+
provider.setSortList(s);
|
|
101
|
+
} else if (provider.sortList) {
|
|
102
|
+
provider.sortList.value = s;
|
|
103
|
+
}
|
|
104
|
+
sortList.value = s;
|
|
105
|
+
};
|
|
106
|
+
const refresh = async (hardRefresh = false) => {
|
|
107
|
+
if (typeof provider.refresh === "function") {
|
|
108
|
+
await provider.refresh(hardRefresh);
|
|
109
|
+
} else if (typeof provider.loadPageData === "function") {
|
|
110
|
+
await provider.loadPageData({ disableCache: hardRefresh });
|
|
111
|
+
}
|
|
112
|
+
syncFromProvider();
|
|
113
|
+
};
|
|
114
|
+
const loadPageData = (options) => {
|
|
115
|
+
if (typeof provider.loadPageData === "function") {
|
|
116
|
+
provider.loadPageData(options);
|
|
117
|
+
}
|
|
118
|
+
syncFromProvider();
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
rawProvider: provider,
|
|
122
|
+
pageData,
|
|
123
|
+
rowCount,
|
|
124
|
+
currentPage,
|
|
125
|
+
pageSize,
|
|
126
|
+
loading,
|
|
127
|
+
initialLoad,
|
|
128
|
+
error,
|
|
129
|
+
filter,
|
|
130
|
+
sortList,
|
|
131
|
+
selectedRows,
|
|
132
|
+
selectAll,
|
|
133
|
+
setCurrentPage,
|
|
134
|
+
setPageSize,
|
|
135
|
+
setFilter,
|
|
136
|
+
setSortList,
|
|
137
|
+
refresh,
|
|
138
|
+
loadPageData
|
|
139
|
+
};
|
|
140
|
+
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* Creates a debounced version of a function.
|
|
3
|
-
* @param callback The function to debounce.
|
|
4
|
-
* @param delay The delay in milliseconds.
|
|
5
|
-
* @returns A debounced function that calls the original callback after the delay.
|
|
6
|
-
*/
|
|
1
|
+
import { debounce } from '@katlux/providers';
|
|
7
2
|
export declare const useDebounce: <T extends (...args: any[]) => any>(callback: T, delay: number) => ((...args: Parameters<T>) => void);
|
|
3
|
+
export { debounce };
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (timeoutId !== null) {
|
|
5
|
-
clearTimeout(timeoutId);
|
|
6
|
-
}
|
|
7
|
-
timeoutId = setTimeout(() => {
|
|
8
|
-
callback.apply(this, args);
|
|
9
|
-
}, delay);
|
|
10
|
-
};
|
|
11
|
-
};
|
|
1
|
+
import { useDebounce as providersUseDebounce, debounce } from "@katlux/providers";
|
|
2
|
+
export const useDebounce = providersUseDebounce;
|
|
3
|
+
export { debounce };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { evaluateFilter, filterTreeData, filterData, applyOperator, compareAnd, compareOr, compareIn, compareEqual, compareValues } from '@katlux/providers';
|
|
2
2
|
export declare const useFilterLogic: () => {
|
|
3
|
-
evaluateFilter: (filter: IDataFilter, row: TDataRow) => boolean;
|
|
4
|
-
filterTreeData: (nodes: any[], filter: IDataFilter, options: {
|
|
3
|
+
evaluateFilter: (filter: import("@katlux/providers").IDataFilter, row: import("@katlux/providers").TDataRow) => boolean;
|
|
4
|
+
filterTreeData: (nodes: any[], filter: import("@katlux/providers").IDataFilter, options: {
|
|
5
5
|
idKey: string;
|
|
6
6
|
parentKey: string;
|
|
7
7
|
}) => {
|
|
8
8
|
visibleNodes: any[];
|
|
9
9
|
expandedNodes: Set<string | number>;
|
|
10
10
|
};
|
|
11
|
-
filterData: (data: any[], filter: IDataFilter, options?: {
|
|
11
|
+
filterData: (data: any[], filter: import("@katlux/providers").IDataFilter, options?: {
|
|
12
12
|
treeOptions?: {
|
|
13
13
|
idKey: string;
|
|
14
14
|
parentKey: string;
|
|
@@ -18,3 +18,4 @@ export declare const useFilterLogic: () => {
|
|
|
18
18
|
expandedNodes?: Set<string | number>;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
+
export { evaluateFilter, filterTreeData, filterData, applyOperator, compareAnd, compareOr, compareIn, compareEqual, compareValues };
|
|
@@ -1,170 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
case EDataFilterOperator.Nand:
|
|
25
|
-
return !compareAnd(rowValue, filterValue);
|
|
26
|
-
case EDataFilterOperator.Nor:
|
|
27
|
-
return !compareOr(rowValue, filterValue);
|
|
28
|
-
case EDataFilterOperator.Equal:
|
|
29
|
-
return compareEqual(rowValue, filterValue);
|
|
30
|
-
case EDataFilterOperator.NotEqual:
|
|
31
|
-
return !compareEqual(rowValue, filterValue);
|
|
32
|
-
case EDataFilterOperator.GreaterThan:
|
|
33
|
-
return compareValues(rowValue, filterValue) > 0;
|
|
34
|
-
case EDataFilterOperator.LessThan:
|
|
35
|
-
return compareValues(rowValue, filterValue) < 0;
|
|
36
|
-
case EDataFilterOperator.GreaterThanOrEqual:
|
|
37
|
-
return compareValues(rowValue, filterValue) >= 0;
|
|
38
|
-
case EDataFilterOperator.LessThanOrEqual:
|
|
39
|
-
return compareValues(rowValue, filterValue) <= 0;
|
|
40
|
-
case EDataFilterOperator.In:
|
|
41
|
-
return compareIn(rowValue, filterValue);
|
|
42
|
-
case EDataFilterOperator.NotIn:
|
|
43
|
-
return !compareIn(rowValue, filterValue);
|
|
44
|
-
default:
|
|
45
|
-
return compareEqual(rowValue, filterValue);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const compareAnd = (row, nested) => {
|
|
49
|
-
const subFilters = Array.isArray(nested) ? nested : nested && typeof nested === "object" ? Object.values(nested) : [];
|
|
50
|
-
const validFilters = subFilters.filter((f) => f && typeof f === "object" && "operator" in f && "field" in f);
|
|
51
|
-
if (validFilters.length === 0) return true;
|
|
52
|
-
return validFilters.every((f) => {
|
|
53
|
-
const active = f.active !== false;
|
|
54
|
-
return active ? evaluateFilter(f, row) : true;
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
const compareOr = (row, nested) => {
|
|
58
|
-
const subFilters = Array.isArray(nested) ? nested : nested && typeof nested === "object" ? Object.values(nested) : [];
|
|
59
|
-
const validFilters = subFilters.filter((f) => f && typeof f === "object" && "operator" in f && "field" in f);
|
|
60
|
-
const activeFilters = validFilters.filter((f) => f.active !== false);
|
|
61
|
-
if (activeFilters.length === 0) return true;
|
|
62
|
-
return activeFilters.some((f) => {
|
|
63
|
-
return evaluateFilter(f, row);
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
const compareIn = (rowValue, filterValue) => {
|
|
67
|
-
if (typeof rowValue === "string" && typeof filterValue === "string") {
|
|
68
|
-
return rowValue.toLowerCase().includes(filterValue.toLowerCase());
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
|
-
};
|
|
72
|
-
const compareEqual = (rowValue, filterValue) => {
|
|
73
|
-
if (typeof rowValue === "string" && typeof filterValue === "string") {
|
|
74
|
-
return rowValue.toLowerCase() == filterValue.toLowerCase();
|
|
75
|
-
}
|
|
76
|
-
if (typeof rowValue === "number" && typeof filterValue === "number") {
|
|
77
|
-
return rowValue === filterValue;
|
|
78
|
-
}
|
|
79
|
-
if (typeof rowValue === "boolean" && typeof filterValue === "boolean") {
|
|
80
|
-
return rowValue === filterValue;
|
|
81
|
-
}
|
|
82
|
-
return rowValue === filterValue;
|
|
83
|
-
};
|
|
84
|
-
const compareValues = (rowValue, filterValue) => {
|
|
85
|
-
if (rowValue == null || filterValue == null) {
|
|
86
|
-
return rowValue == null ? -1 : 1;
|
|
87
|
-
}
|
|
88
|
-
if (typeof rowValue === "string" && typeof filterValue === "string") {
|
|
89
|
-
return rowValue.localeCompare(filterValue);
|
|
90
|
-
}
|
|
91
|
-
if (typeof rowValue === "number" && typeof filterValue === "number") {
|
|
92
|
-
return rowValue - filterValue;
|
|
93
|
-
}
|
|
94
|
-
return String(rowValue).localeCompare(String(filterValue));
|
|
95
|
-
};
|
|
96
|
-
const filterTreeData = (nodes, filter, options) => {
|
|
97
|
-
const { idKey, parentKey } = options;
|
|
98
|
-
const nodeMap = new Map(nodes.map((node) => [node[idKey], node]));
|
|
99
|
-
const childrenMap = /* @__PURE__ */ new Map();
|
|
100
|
-
nodes.forEach((node) => {
|
|
101
|
-
const pId = node[parentKey];
|
|
102
|
-
if (pId != null) {
|
|
103
|
-
if (!childrenMap.has(pId)) {
|
|
104
|
-
childrenMap.set(pId, []);
|
|
105
|
-
}
|
|
106
|
-
childrenMap.get(pId).push(node);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
const matchingNodeIds = /* @__PURE__ */ new Set();
|
|
110
|
-
const expandedNodes = /* @__PURE__ */ new Set();
|
|
111
|
-
const visibleNodeIds = /* @__PURE__ */ new Set();
|
|
112
|
-
nodes.forEach((node) => {
|
|
113
|
-
const evalRow = node.data ? { ...node.data, ...node } : node;
|
|
114
|
-
if (evaluateFilter(filter, evalRow)) {
|
|
115
|
-
matchingNodeIds.add(node[idKey]);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
const addDescendants = (nodeId) => {
|
|
119
|
-
const children = childrenMap.get(nodeId);
|
|
120
|
-
if (children && children.length > 0) {
|
|
121
|
-
expandedNodes.add(nodeId);
|
|
122
|
-
children.forEach((child) => {
|
|
123
|
-
visibleNodeIds.add(child[idKey]);
|
|
124
|
-
addDescendants(child[idKey]);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
matchingNodeIds.forEach((id) => {
|
|
129
|
-
visibleNodeIds.add(id);
|
|
130
|
-
addDescendants(id);
|
|
131
|
-
let currentId = id;
|
|
132
|
-
while (currentId != null) {
|
|
133
|
-
visibleNodeIds.add(currentId);
|
|
134
|
-
const node = nodeMap.get(currentId);
|
|
135
|
-
if (node) {
|
|
136
|
-
if (node[parentKey] != null) {
|
|
137
|
-
expandedNodes.add(node[parentKey]);
|
|
138
|
-
currentId = node[parentKey];
|
|
139
|
-
} else {
|
|
140
|
-
currentId = null;
|
|
141
|
-
}
|
|
142
|
-
} else {
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
const visibleNodes = nodes.filter((node) => visibleNodeIds.has(node[idKey]));
|
|
148
|
-
return {
|
|
149
|
-
visibleNodes,
|
|
150
|
-
expandedNodes
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
const filterData = (data, filter, options) => {
|
|
154
|
-
if (options?.treeOptions) {
|
|
155
|
-
const { visibleNodes, expandedNodes } = filterTreeData(
|
|
156
|
-
data,
|
|
157
|
-
filter,
|
|
158
|
-
options.treeOptions
|
|
159
|
-
);
|
|
160
|
-
return { results: visibleNodes, expandedNodes };
|
|
161
|
-
}
|
|
162
|
-
const results = data.filter((row) => evaluateFilter(filter, row));
|
|
163
|
-
return { results };
|
|
164
|
-
};
|
|
165
|
-
return {
|
|
166
|
-
evaluateFilter,
|
|
167
|
-
filterTreeData,
|
|
168
|
-
filterData
|
|
169
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
useFilterLogic as providersUseFilterLogic,
|
|
3
|
+
evaluateFilter,
|
|
4
|
+
filterTreeData,
|
|
5
|
+
filterData,
|
|
6
|
+
applyOperator,
|
|
7
|
+
compareAnd,
|
|
8
|
+
compareOr,
|
|
9
|
+
compareIn,
|
|
10
|
+
compareEqual,
|
|
11
|
+
compareValues
|
|
12
|
+
} from "@katlux/providers";
|
|
13
|
+
export const useFilterLogic = providersUseFilterLogic;
|
|
14
|
+
export {
|
|
15
|
+
evaluateFilter,
|
|
16
|
+
filterTreeData,
|
|
17
|
+
filterData,
|
|
18
|
+
applyOperator,
|
|
19
|
+
compareAnd,
|
|
20
|
+
compareOr,
|
|
21
|
+
compareIn,
|
|
22
|
+
compareEqual,
|
|
23
|
+
compareValues
|
|
170
24
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const defaultKatluxTranslations: Record<string, string>;
|
|
2
|
+
/**
|
|
3
|
+
* Resilient translation composable for Katlux Toolkit components.
|
|
4
|
+
*
|
|
5
|
+
* Lookup Order:
|
|
6
|
+
* 1. nuxtApp.$t (if @nuxtjs/i18n or vue-i18n is available)
|
|
7
|
+
* 2. appConfig.katluxToolkit.translations[locale][key]
|
|
8
|
+
* 3. appConfig.katluxToolkit.translations[key]
|
|
9
|
+
* 4. Built-in LTR locale dictionary (en, es, fr, de, pt, it, nl, pl, ru, uk, zh, ja, ko, hi, bn, id, vi, th, sv, da, fi, cs, el)
|
|
10
|
+
* 5. Built-in default English dictionary
|
|
11
|
+
* 6. Raw key string
|
|
12
|
+
*/
|
|
13
|
+
export declare function useKatluxI18n(): {
|
|
14
|
+
t: (key: string, params?: Record<string, any>) => string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { en, builtInLocales } from "./locales.js";
|
|
2
|
+
export const defaultKatluxTranslations = en;
|
|
3
|
+
export function useKatluxI18n() {
|
|
4
|
+
let nuxtApp = null;
|
|
5
|
+
try {
|
|
6
|
+
if (typeof globalThis.useNuxtApp === "function") {
|
|
7
|
+
nuxtApp = globalThis.useNuxtApp();
|
|
8
|
+
}
|
|
9
|
+
} catch {
|
|
10
|
+
}
|
|
11
|
+
let appConfig = null;
|
|
12
|
+
try {
|
|
13
|
+
if (typeof globalThis.useAppConfig === "function") {
|
|
14
|
+
appConfig = globalThis.useAppConfig();
|
|
15
|
+
}
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
const toolkitConfig = appConfig?.katluxToolkit || {};
|
|
19
|
+
const customTranslations = toolkitConfig.translations || {};
|
|
20
|
+
const t = (key, params) => {
|
|
21
|
+
if (nuxtApp && typeof nuxtApp.$t === "function") {
|
|
22
|
+
try {
|
|
23
|
+
const res = nuxtApp.$t(key, params);
|
|
24
|
+
if (res && res !== key) return res;
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const currentLocale = toolkitConfig.locale || nuxtApp?.i18n?.locale?.value || "en";
|
|
29
|
+
if (customTranslations[currentLocale] && typeof customTranslations[currentLocale] === "object") {
|
|
30
|
+
const langDict = customTranslations[currentLocale];
|
|
31
|
+
if (langDict[key]) {
|
|
32
|
+
return applyParams(langDict[key], params);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (typeof customTranslations[key] === "string") {
|
|
36
|
+
return applyParams(customTranslations[key], params);
|
|
37
|
+
}
|
|
38
|
+
const builtInDict = builtInLocales[currentLocale];
|
|
39
|
+
if (builtInDict && builtInDict[key]) {
|
|
40
|
+
return applyParams(builtInDict[key], params);
|
|
41
|
+
}
|
|
42
|
+
if (defaultKatluxTranslations[key]) {
|
|
43
|
+
return applyParams(defaultKatluxTranslations[key], params);
|
|
44
|
+
}
|
|
45
|
+
return applyParams(key, params);
|
|
46
|
+
};
|
|
47
|
+
return { t };
|
|
48
|
+
}
|
|
49
|
+
function applyParams(text, params) {
|
|
50
|
+
if (!params) return text;
|
|
51
|
+
let result = text;
|
|
52
|
+
for (const [pKey, pValue] of Object.entries(params)) {
|
|
53
|
+
result = result.replace(new RegExp(`\\{${pKey}\\}`, "g"), String(pValue));
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
@@ -1,2 +1,24 @@
|
|
|
1
1
|
import { type Component } from 'vue';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Type for preset component entries: either a direct Vue Component object/function,
|
|
4
|
+
* or a dynamic loader function returning a module with the Component.
|
|
5
|
+
*/
|
|
6
|
+
export type PresetComponentEntry = Component | (() => Promise<{
|
|
7
|
+
default?: Component;
|
|
8
|
+
} | Component | any>);
|
|
9
|
+
/**
|
|
10
|
+
* API for Nuxt preset plugins or tenant configurations to register their component loaders or components.
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerPresetComponents(presetName: string, loaders: Record<string, PresetComponentEntry>): void;
|
|
13
|
+
/**
|
|
14
|
+
* Reset caches (useful for testing or hot reloading)
|
|
15
|
+
*/
|
|
16
|
+
export declare function clearPresetComponentCache(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Composable for dynamically loading preset components across a cascade of active presets.
|
|
19
|
+
*
|
|
20
|
+
* @param componentBaseName - Base name of the component (e.g., 'KButton')
|
|
21
|
+
* @param defaultComponent - The default preset component to fall back to
|
|
22
|
+
* @returns A computed ref resolving to the correct Component for the active preset stack
|
|
23
|
+
*/
|
|
24
|
+
export declare function usePresetComponent(componentBaseName: string, defaultComponent: Component): import("vue").ComputedRef<Component | undefined>;
|
|
@@ -1,36 +1,80 @@
|
|
|
1
|
-
import { computed, defineAsyncComponent } from "vue";
|
|
1
|
+
import { computed, defineAsyncComponent, shallowReactive } from "vue";
|
|
2
2
|
import { useAppConfig } from "#app";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
3
|
+
const _loadersRegistry = shallowReactive({});
|
|
4
|
+
const _asyncComponentCache = /* @__PURE__ */ new Map();
|
|
5
|
+
const _internalPresetLoaders = import.meta.glob([
|
|
6
|
+
"../presets/**/*.vue",
|
|
7
|
+
"../../runtime/presets/**/*.vue",
|
|
8
|
+
"~/presets/**/*.vue",
|
|
9
|
+
"@/presets/**/*.vue"
|
|
10
|
+
]);
|
|
11
|
+
export function registerPresetComponents(presetName, loaders) {
|
|
12
|
+
_loadersRegistry[presetName] = loaders;
|
|
13
|
+
}
|
|
14
|
+
export function clearPresetComponentCache() {
|
|
15
|
+
_asyncComponentCache.clear();
|
|
16
|
+
for (const key in _loadersRegistry) {
|
|
17
|
+
delete _loadersRegistry[key];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function isDirectComponent(entry) {
|
|
21
|
+
if (!entry) return false;
|
|
22
|
+
if (typeof entry === "object") return true;
|
|
23
|
+
if (typeof entry === "function") {
|
|
24
|
+
return Boolean(entry.setup || entry.render || entry.__name || entry.__file);
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
6
28
|
export function usePresetComponent(componentBaseName, defaultComponent) {
|
|
7
29
|
const appConfig = useAppConfig();
|
|
8
|
-
const activePreset = computed(() => appConfig.katluxToolkit?.activePreset || "default");
|
|
9
30
|
return computed(() => {
|
|
10
|
-
|
|
31
|
+
const raw = appConfig.katluxToolkit?.activePreset;
|
|
32
|
+
if (!raw || raw === "default" || Array.isArray(raw) && (raw.length === 0 || raw.length === 1 && raw[0] === "default")) {
|
|
11
33
|
return defaultComponent;
|
|
12
34
|
}
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
const list = Array.isArray(raw) ? raw : [raw];
|
|
36
|
+
const activePresets = list.filter((p) => p && p !== "default");
|
|
37
|
+
for (const presetName of activePresets) {
|
|
38
|
+
const cacheKey = `${presetName}:${componentBaseName}`;
|
|
39
|
+
const externalLoaders = _loadersRegistry[presetName];
|
|
40
|
+
if (externalLoaders) {
|
|
41
|
+
const key = `./components/${componentBaseName}/${componentBaseName}.vue`;
|
|
42
|
+
const candidate = externalLoaders[key];
|
|
43
|
+
if (candidate) {
|
|
44
|
+
if (isDirectComponent(candidate)) {
|
|
45
|
+
return candidate;
|
|
46
|
+
}
|
|
47
|
+
let cached = _asyncComponentCache.get(cacheKey);
|
|
48
|
+
if (!cached) {
|
|
49
|
+
cached = defineAsyncComponent({
|
|
50
|
+
loader: candidate,
|
|
51
|
+
errorComponent: defaultComponent
|
|
52
|
+
});
|
|
53
|
+
_asyncComponentCache.set(cacheKey, cached);
|
|
54
|
+
}
|
|
55
|
+
return cached;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
let internalLoader;
|
|
59
|
+
const targetSuffix = `/presets/${presetName}/components/${componentBaseName}/${componentBaseName}.vue`;
|
|
60
|
+
for (const [key, importFn] of Object.entries(_internalPresetLoaders)) {
|
|
61
|
+
if (key.endsWith(targetSuffix)) {
|
|
62
|
+
internalLoader = importFn;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (internalLoader) {
|
|
67
|
+
let cached = _asyncComponentCache.get(cacheKey);
|
|
68
|
+
if (!cached) {
|
|
69
|
+
cached = defineAsyncComponent({
|
|
70
|
+
loader: internalLoader,
|
|
71
|
+
errorComponent: defaultComponent
|
|
72
|
+
});
|
|
73
|
+
_asyncComponentCache.set(cacheKey, cached);
|
|
74
|
+
}
|
|
75
|
+
return cached;
|
|
76
|
+
}
|
|
28
77
|
}
|
|
29
|
-
|
|
30
|
-
loader,
|
|
31
|
-
errorComponent: defaultComponent
|
|
32
|
-
});
|
|
33
|
-
componentCache.set(cacheKey, asyncComp);
|
|
34
|
-
return asyncComp;
|
|
78
|
+
return defaultComponent;
|
|
35
79
|
});
|
|
36
80
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RequestProvider } from '@katlux/providers';
|
|
2
|
+
/**
|
|
3
|
+
* useRequestProvider
|
|
4
|
+
*
|
|
5
|
+
* Vue composable that registers a RequestProvider with the RequestProviderRegistry
|
|
6
|
+
* and automatically unregisters it when the component is destroyed.
|
|
7
|
+
*
|
|
8
|
+
* Works correctly with <keep-alive>:
|
|
9
|
+
* - Component hidden (onDeactivated) → stays registered → still receives auto-refresh ✅
|
|
10
|
+
* - Component evicted (onUnmounted) → unregistered → no leak ✅
|
|
11
|
+
* - Component destroyed normally → unregistered ✅
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* const invoiceProvider = useRequestProvider(
|
|
15
|
+
* new CAPIFlatServerDataProvider(),
|
|
16
|
+
* ['invoices', 'sales']
|
|
17
|
+
* )
|
|
18
|
+
*
|
|
19
|
+
* @param provider The RequestProvider instance to register
|
|
20
|
+
* @param tags String tags linking this provider to mutations
|
|
21
|
+
* @returns The same provider instance (for chaining)
|
|
22
|
+
*/
|
|
23
|
+
export declare function useRequestProvider<T extends RequestProvider>(provider: T, tags: string[]): T;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { onUnmounted } from "vue";
|
|
2
|
+
import { RequestProviderRegistry } from "@katlux/providers";
|
|
3
|
+
export function useRequestProvider(provider, tags) {
|
|
4
|
+
RequestProviderRegistry.register(provider, tags);
|
|
5
|
+
onUnmounted(() => {
|
|
6
|
+
RequestProviderRegistry.unregister(provider);
|
|
7
|
+
});
|
|
8
|
+
return provider;
|
|
9
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { sortData } from '@katlux/providers';
|
|
2
2
|
export declare const useSortLogic: () => {
|
|
3
|
-
sortData: (sortList: IDataSort[], rows: TDataRow[]) => TDataRow[];
|
|
3
|
+
sortData: (sortList: import("@katlux/providers").IDataSort[], rows: import("@katlux/providers").TDataRow[]) => import("@katlux/providers").TDataRow[];
|
|
4
4
|
};
|
|
5
|
+
export { sortData };
|