@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,214 @@
|
|
|
1
|
+
import { type KCompositeInputProps } from './KCompositeInput.logic.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
label: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
selectionValue: {
|
|
8
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
9
|
+
default: null;
|
|
10
|
+
};
|
|
11
|
+
inputValue: {
|
|
12
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: import("vue").PropType<import("./KCompositeInput.logic.js").ICompositeItem[]>;
|
|
17
|
+
default: () => never[];
|
|
18
|
+
};
|
|
19
|
+
dataProvider: {
|
|
20
|
+
type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
|
|
21
|
+
required: boolean;
|
|
22
|
+
};
|
|
23
|
+
type: {
|
|
24
|
+
type: import("vue").PropType<import("./KCompositeInput.logic.js").CompositeInputType>;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
selectionSide: {
|
|
28
|
+
type: import("vue").PropType<import("./KCompositeInput.logic.js").SelectionSide>;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
inputType: {
|
|
32
|
+
type: import("vue").PropType<KCompositeInputProps["inputType"]>;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
mask: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
labelField: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
valueField: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
placeholder: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
inputPlaceholder: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
searchbox: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
59
|
+
inputFormat: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: undefined;
|
|
62
|
+
};
|
|
63
|
+
showClear: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
teleportTo: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
default: undefined;
|
|
70
|
+
};
|
|
71
|
+
validation: {
|
|
72
|
+
type: import("vue").PropType<KCompositeInputProps["validation"]>;
|
|
73
|
+
default: null;
|
|
74
|
+
validator: (value: string) => boolean;
|
|
75
|
+
};
|
|
76
|
+
validationText: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
80
|
+
inputConfigField: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
84
|
+
validateAll: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
singleValue: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
93
|
+
"update:modelValue": (value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any;
|
|
94
|
+
"update:selectionValue": (value: any) => any;
|
|
95
|
+
"update:inputValue": (value: any) => any;
|
|
96
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
97
|
+
label: {
|
|
98
|
+
type: StringConstructor;
|
|
99
|
+
default: string;
|
|
100
|
+
};
|
|
101
|
+
selectionValue: {
|
|
102
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
103
|
+
default: null;
|
|
104
|
+
};
|
|
105
|
+
inputValue: {
|
|
106
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
modelValue: {
|
|
110
|
+
type: import("vue").PropType<import("./KCompositeInput.logic.js").ICompositeItem[]>;
|
|
111
|
+
default: () => never[];
|
|
112
|
+
};
|
|
113
|
+
dataProvider: {
|
|
114
|
+
type: import("vue").PropType<import("@katlux/providers").ADataProvider>;
|
|
115
|
+
required: boolean;
|
|
116
|
+
};
|
|
117
|
+
type: {
|
|
118
|
+
type: import("vue").PropType<import("./KCompositeInput.logic.js").CompositeInputType>;
|
|
119
|
+
default: string;
|
|
120
|
+
};
|
|
121
|
+
selectionSide: {
|
|
122
|
+
type: import("vue").PropType<import("./KCompositeInput.logic.js").SelectionSide>;
|
|
123
|
+
default: string;
|
|
124
|
+
};
|
|
125
|
+
inputType: {
|
|
126
|
+
type: import("vue").PropType<KCompositeInputProps["inputType"]>;
|
|
127
|
+
default: string;
|
|
128
|
+
};
|
|
129
|
+
mask: {
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
labelField: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
valueField: {
|
|
138
|
+
type: StringConstructor;
|
|
139
|
+
default: string;
|
|
140
|
+
};
|
|
141
|
+
placeholder: {
|
|
142
|
+
type: StringConstructor;
|
|
143
|
+
default: string;
|
|
144
|
+
};
|
|
145
|
+
inputPlaceholder: {
|
|
146
|
+
type: StringConstructor;
|
|
147
|
+
default: string;
|
|
148
|
+
};
|
|
149
|
+
searchbox: {
|
|
150
|
+
type: BooleanConstructor;
|
|
151
|
+
default: boolean;
|
|
152
|
+
};
|
|
153
|
+
inputFormat: {
|
|
154
|
+
type: StringConstructor;
|
|
155
|
+
default: undefined;
|
|
156
|
+
};
|
|
157
|
+
showClear: {
|
|
158
|
+
type: BooleanConstructor;
|
|
159
|
+
default: boolean;
|
|
160
|
+
};
|
|
161
|
+
teleportTo: {
|
|
162
|
+
type: StringConstructor;
|
|
163
|
+
default: undefined;
|
|
164
|
+
};
|
|
165
|
+
validation: {
|
|
166
|
+
type: import("vue").PropType<KCompositeInputProps["validation"]>;
|
|
167
|
+
default: null;
|
|
168
|
+
validator: (value: string) => boolean;
|
|
169
|
+
};
|
|
170
|
+
validationText: {
|
|
171
|
+
type: StringConstructor;
|
|
172
|
+
default: string;
|
|
173
|
+
};
|
|
174
|
+
inputConfigField: {
|
|
175
|
+
type: StringConstructor;
|
|
176
|
+
default: string;
|
|
177
|
+
};
|
|
178
|
+
validateAll: {
|
|
179
|
+
type: BooleanConstructor;
|
|
180
|
+
default: boolean;
|
|
181
|
+
};
|
|
182
|
+
singleValue: {
|
|
183
|
+
type: BooleanConstructor;
|
|
184
|
+
default: boolean;
|
|
185
|
+
};
|
|
186
|
+
}>> & Readonly<{
|
|
187
|
+
"onUpdate:modelValue"?: ((value: import("./KCompositeInput.logic.js").ICompositeItem[]) => any) | undefined;
|
|
188
|
+
"onUpdate:selectionValue"?: ((value: any) => any) | undefined;
|
|
189
|
+
"onUpdate:inputValue"?: ((value: any) => any) | undefined;
|
|
190
|
+
}>, {
|
|
191
|
+
type: import("./KCompositeInput.logic.js").CompositeInputType;
|
|
192
|
+
label: string;
|
|
193
|
+
validation: "error" | "success" | "warning" | null | undefined;
|
|
194
|
+
validationText: string;
|
|
195
|
+
modelValue: import("./KCompositeInput.logic.js").ICompositeItem[];
|
|
196
|
+
searchbox: boolean;
|
|
197
|
+
labelField: string;
|
|
198
|
+
placeholder: string;
|
|
199
|
+
teleportTo: string;
|
|
200
|
+
valueField: string;
|
|
201
|
+
inputType: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
|
|
202
|
+
selectionValue: string | number | Record<string, any> | unknown[];
|
|
203
|
+
inputValue: string | number | Record<string, any> | unknown[];
|
|
204
|
+
selectionSide: import("./KCompositeInput.logic.js").SelectionSide;
|
|
205
|
+
mask: string;
|
|
206
|
+
inputPlaceholder: string;
|
|
207
|
+
showClear: boolean;
|
|
208
|
+
inputConfigField: string;
|
|
209
|
+
validateAll: boolean;
|
|
210
|
+
inputFormat: string;
|
|
211
|
+
singleValue: boolean;
|
|
212
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
213
|
+
declare const _default: typeof __VLS_export;
|
|
214
|
+
export default _default;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { ADataProvider } from '@katlux/providers';
|
|
3
|
+
export type CompositeInputType = 'textbox' | 'textarea' | 'maskedtextbox' | 'combobox' | 'datepicker' | 'datetimepicker' | 'hourpicker';
|
|
4
|
+
export type SelectionSide = 'left' | 'right';
|
|
5
|
+
export interface ICompositeItem {
|
|
6
|
+
selection: any;
|
|
7
|
+
value: any;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Per-selection input configuration.
|
|
11
|
+
* Each item in the selection dataProvider can carry this config
|
|
12
|
+
* to control what input component renders and how it behaves
|
|
13
|
+
* when that item is selected.
|
|
14
|
+
*/
|
|
15
|
+
export interface ICompositeInputConfig {
|
|
16
|
+
/** Which input component to render */
|
|
17
|
+
type?: CompositeInputType;
|
|
18
|
+
/** For textbox: HTML input type (text, email, tel, number, etc.) */
|
|
19
|
+
inputType?: 'text' | 'password' | 'email' | 'url' | 'tel' | 'search' | 'number';
|
|
20
|
+
/** For maskedtextbox: mask pattern */
|
|
21
|
+
mask?: string;
|
|
22
|
+
/** Placeholder for the input (overrides inputPlaceholder) */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/** Show clear button */
|
|
25
|
+
showClear?: boolean;
|
|
26
|
+
/** For combobox type: a separate dataProvider for the input side */
|
|
27
|
+
inputDataProvider?: ADataProvider;
|
|
28
|
+
/** For combobox type: label field */
|
|
29
|
+
inputLabelField?: string;
|
|
30
|
+
/** For combobox type: value field */
|
|
31
|
+
inputValueField?: string;
|
|
32
|
+
/** For combobox type: enable searchbox */
|
|
33
|
+
inputSearchbox?: boolean;
|
|
34
|
+
/** For date/time pickers: date or time format */
|
|
35
|
+
inputFormat?: string;
|
|
36
|
+
/** Per-selection validation state */
|
|
37
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
38
|
+
/** Per-selection validation text */
|
|
39
|
+
validationText?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface KCompositeInputProps {
|
|
42
|
+
label?: string;
|
|
43
|
+
selectionValue: any;
|
|
44
|
+
inputValue: any;
|
|
45
|
+
modelValue?: ICompositeItem[];
|
|
46
|
+
dataProvider: ADataProvider;
|
|
47
|
+
type?: CompositeInputType;
|
|
48
|
+
selectionSide?: SelectionSide;
|
|
49
|
+
inputType?: 'text' | 'password' | 'email' | 'url' | 'tel' | 'search' | 'number';
|
|
50
|
+
mask?: string;
|
|
51
|
+
labelField?: string;
|
|
52
|
+
valueField?: string;
|
|
53
|
+
placeholder?: string;
|
|
54
|
+
inputPlaceholder?: string;
|
|
55
|
+
searchbox?: boolean;
|
|
56
|
+
inputFormat?: string;
|
|
57
|
+
showClear?: boolean;
|
|
58
|
+
teleportTo?: string;
|
|
59
|
+
validation?: 'success' | 'warning' | 'error' | null;
|
|
60
|
+
validationText?: string;
|
|
61
|
+
inputConfigField?: string;
|
|
62
|
+
validateAll?: boolean;
|
|
63
|
+
singleValue?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface KCompositeInputEmits {
|
|
66
|
+
(e: 'update:selectionValue', value: any): void;
|
|
67
|
+
(e: 'update:inputValue', value: any): void;
|
|
68
|
+
(e: 'update:modelValue', value: ICompositeItem[]): void;
|
|
69
|
+
}
|
|
70
|
+
export declare const KCompositeInputDefaultProps: {
|
|
71
|
+
label: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
selectionValue: {
|
|
76
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
77
|
+
default: null;
|
|
78
|
+
};
|
|
79
|
+
inputValue: {
|
|
80
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
81
|
+
default: string;
|
|
82
|
+
};
|
|
83
|
+
modelValue: {
|
|
84
|
+
type: PropType<ICompositeItem[]>;
|
|
85
|
+
default: () => never[];
|
|
86
|
+
};
|
|
87
|
+
dataProvider: {
|
|
88
|
+
type: PropType<ADataProvider>;
|
|
89
|
+
required: boolean;
|
|
90
|
+
};
|
|
91
|
+
type: {
|
|
92
|
+
type: PropType<CompositeInputType>;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
selectionSide: {
|
|
96
|
+
type: PropType<SelectionSide>;
|
|
97
|
+
default: string;
|
|
98
|
+
};
|
|
99
|
+
inputType: {
|
|
100
|
+
type: PropType<KCompositeInputProps["inputType"]>;
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
103
|
+
mask: {
|
|
104
|
+
type: StringConstructor;
|
|
105
|
+
default: string;
|
|
106
|
+
};
|
|
107
|
+
labelField: {
|
|
108
|
+
type: StringConstructor;
|
|
109
|
+
default: string;
|
|
110
|
+
};
|
|
111
|
+
valueField: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
115
|
+
placeholder: {
|
|
116
|
+
type: StringConstructor;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
inputPlaceholder: {
|
|
120
|
+
type: StringConstructor;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
123
|
+
searchbox: {
|
|
124
|
+
type: BooleanConstructor;
|
|
125
|
+
default: boolean;
|
|
126
|
+
};
|
|
127
|
+
inputFormat: {
|
|
128
|
+
type: StringConstructor;
|
|
129
|
+
default: undefined;
|
|
130
|
+
};
|
|
131
|
+
showClear: {
|
|
132
|
+
type: BooleanConstructor;
|
|
133
|
+
default: boolean;
|
|
134
|
+
};
|
|
135
|
+
teleportTo: {
|
|
136
|
+
type: StringConstructor;
|
|
137
|
+
default: undefined;
|
|
138
|
+
};
|
|
139
|
+
validation: {
|
|
140
|
+
type: PropType<KCompositeInputProps["validation"]>;
|
|
141
|
+
default: null;
|
|
142
|
+
validator: (value: string) => boolean;
|
|
143
|
+
};
|
|
144
|
+
validationText: {
|
|
145
|
+
type: StringConstructor;
|
|
146
|
+
default: string;
|
|
147
|
+
};
|
|
148
|
+
inputConfigField: {
|
|
149
|
+
type: StringConstructor;
|
|
150
|
+
default: string;
|
|
151
|
+
};
|
|
152
|
+
validateAll: {
|
|
153
|
+
type: BooleanConstructor;
|
|
154
|
+
default: boolean;
|
|
155
|
+
};
|
|
156
|
+
singleValue: {
|
|
157
|
+
type: BooleanConstructor;
|
|
158
|
+
default: boolean;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
export declare function useKCompositeInputLogic(props: KCompositeInputProps, emit: KCompositeInputEmits): {
|
|
162
|
+
internalSelectionValue: import("vue").WritableComputedRef<any, any>;
|
|
163
|
+
internalInputValue: import("vue").WritableComputedRef<any, any>;
|
|
164
|
+
selectionProps: import("vue").ComputedRef<{
|
|
165
|
+
modelValue: any;
|
|
166
|
+
'onUpdate:modelValue': (val: any) => any;
|
|
167
|
+
dataProvider: ADataProvider;
|
|
168
|
+
labelField: string | undefined;
|
|
169
|
+
valueField: string | undefined;
|
|
170
|
+
placeholder: string | undefined;
|
|
171
|
+
searchbox: boolean | undefined;
|
|
172
|
+
closeOnSelect: boolean;
|
|
173
|
+
teleportTo: string | undefined;
|
|
174
|
+
}>;
|
|
175
|
+
inputProps: import("vue").ComputedRef<{
|
|
176
|
+
modelValue: any;
|
|
177
|
+
'onUpdate:modelValue': (val: any) => any;
|
|
178
|
+
placeholder: string | undefined;
|
|
179
|
+
type: "number" | "url" | "search" | "text" | "password" | "email" | "tel" | undefined;
|
|
180
|
+
mask: string | undefined;
|
|
181
|
+
showClear: boolean | undefined;
|
|
182
|
+
}>;
|
|
183
|
+
resolvedSelectionItem: import("vue").ComputedRef<any>;
|
|
184
|
+
resolvedInputConfig: import("vue").ComputedRef<ICompositeInputConfig>;
|
|
185
|
+
resolvedValidation: import("vue").ComputedRef<any>;
|
|
186
|
+
resolvedValidationText: import("vue").ComputedRef<any>;
|
|
187
|
+
};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { computed, watch, unref } from "vue";
|
|
2
|
+
export const KCompositeInputDefaultProps = {
|
|
3
|
+
label: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: ""
|
|
6
|
+
},
|
|
7
|
+
selectionValue: {
|
|
8
|
+
type: [String, Number, Object, Array],
|
|
9
|
+
default: null
|
|
10
|
+
},
|
|
11
|
+
inputValue: {
|
|
12
|
+
type: [String, Number, Object, Array],
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
dataProvider: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "textbox"
|
|
26
|
+
},
|
|
27
|
+
selectionSide: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "left"
|
|
30
|
+
},
|
|
31
|
+
inputType: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "text"
|
|
34
|
+
},
|
|
35
|
+
mask: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
38
|
+
},
|
|
39
|
+
labelField: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "label"
|
|
42
|
+
},
|
|
43
|
+
valueField: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "value"
|
|
46
|
+
},
|
|
47
|
+
placeholder: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "Select..."
|
|
50
|
+
},
|
|
51
|
+
inputPlaceholder: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: ""
|
|
54
|
+
},
|
|
55
|
+
searchbox: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
inputFormat: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
showClear: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
teleportTo: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: void 0
|
|
70
|
+
},
|
|
71
|
+
validation: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: null,
|
|
74
|
+
validator: (value) => [null, "success", "warning", "error"].includes(value)
|
|
75
|
+
},
|
|
76
|
+
validationText: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: ""
|
|
79
|
+
},
|
|
80
|
+
inputConfigField: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: "inputConfig"
|
|
83
|
+
},
|
|
84
|
+
validateAll: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false
|
|
87
|
+
},
|
|
88
|
+
singleValue: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
export function useKCompositeInputLogic(props, emit) {
|
|
94
|
+
const getSelectionKey = (selection) => {
|
|
95
|
+
if (selection && typeof selection === "object" && props.valueField) {
|
|
96
|
+
return selection[props.valueField];
|
|
97
|
+
}
|
|
98
|
+
return selection;
|
|
99
|
+
};
|
|
100
|
+
const resolvedSelectionItem = computed(() => {
|
|
101
|
+
if (props.selectionValue === null || props.selectionValue === void 0) return null;
|
|
102
|
+
if (typeof props.selectionValue === "object") return props.selectionValue;
|
|
103
|
+
if (props.dataProvider && typeof props.dataProvider === "object") {
|
|
104
|
+
const provider = props.dataProvider;
|
|
105
|
+
const data = unref(provider.allData) || unref(provider.pageData) || [];
|
|
106
|
+
return data.find((item) => getSelectionKey(item) === props.selectionValue) || props.selectionValue;
|
|
107
|
+
}
|
|
108
|
+
return props.selectionValue;
|
|
109
|
+
});
|
|
110
|
+
const resolvedInputConfig = computed(() => {
|
|
111
|
+
const configField = props.inputConfigField || "inputConfig";
|
|
112
|
+
const selectedItem = resolvedSelectionItem.value;
|
|
113
|
+
const itemConfig = selectedItem && typeof selectedItem === "object" && selectedItem[configField] ? { ...selectedItem[configField] } : {};
|
|
114
|
+
return {
|
|
115
|
+
type: itemConfig.type ?? props.type ?? "textbox",
|
|
116
|
+
inputType: itemConfig.inputType ?? props.inputType ?? "text",
|
|
117
|
+
mask: itemConfig.mask ?? props.mask ?? "",
|
|
118
|
+
placeholder: itemConfig.placeholder ?? props.inputPlaceholder ?? "",
|
|
119
|
+
showClear: itemConfig.showClear ?? props.showClear ?? false,
|
|
120
|
+
inputDataProvider: itemConfig.inputDataProvider ?? void 0,
|
|
121
|
+
inputLabelField: itemConfig.inputLabelField ?? props.labelField ?? "label",
|
|
122
|
+
inputValueField: itemConfig.inputValueField ?? props.valueField ?? "value",
|
|
123
|
+
inputSearchbox: itemConfig.inputSearchbox ?? false,
|
|
124
|
+
inputFormat: itemConfig.inputFormat ?? props.inputFormat ?? void 0,
|
|
125
|
+
validation: itemConfig.validation ?? props.validation ?? null,
|
|
126
|
+
validationText: itemConfig.validationText ?? props.validationText ?? ""
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
const resolvedValidation = computed(() => {
|
|
130
|
+
if (props.validateAll) {
|
|
131
|
+
const provider = props.dataProvider;
|
|
132
|
+
const data = unref(provider?.allData) || unref(provider?.pageData) || [];
|
|
133
|
+
const configField = props.inputConfigField || "inputConfig";
|
|
134
|
+
const activeConfig = resolvedInputConfig.value;
|
|
135
|
+
if (activeConfig.validation && activeConfig.validation !== "success") {
|
|
136
|
+
return activeConfig.validation;
|
|
137
|
+
}
|
|
138
|
+
for (const item of data) {
|
|
139
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
140
|
+
if (itemConfig && itemConfig.validation && itemConfig.validation !== "success") {
|
|
141
|
+
return itemConfig.validation;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (activeConfig.validation === "success") {
|
|
145
|
+
return "success";
|
|
146
|
+
}
|
|
147
|
+
for (const item of data) {
|
|
148
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
149
|
+
if (itemConfig && itemConfig.validation === "success") {
|
|
150
|
+
return "success";
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return resolvedInputConfig.value.validation || props.validation || null;
|
|
155
|
+
});
|
|
156
|
+
const resolvedValidationText = computed(() => {
|
|
157
|
+
if (props.validateAll) {
|
|
158
|
+
const provider = props.dataProvider;
|
|
159
|
+
const data = unref(provider?.allData) || unref(provider?.pageData) || [];
|
|
160
|
+
const configField = props.inputConfigField || "inputConfig";
|
|
161
|
+
const activeConfig = resolvedInputConfig.value;
|
|
162
|
+
if (activeConfig.validation && activeConfig.validation !== "success") {
|
|
163
|
+
return activeConfig.validationText || "";
|
|
164
|
+
}
|
|
165
|
+
for (const item of data) {
|
|
166
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
167
|
+
if (itemConfig && itemConfig.validation && itemConfig.validation !== "success") {
|
|
168
|
+
return itemConfig.validationText || "";
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (activeConfig.validation === "success") {
|
|
172
|
+
return activeConfig.validationText || "";
|
|
173
|
+
}
|
|
174
|
+
for (const item of data) {
|
|
175
|
+
const itemConfig = item && typeof item === "object" && item[configField] ? item[configField] : null;
|
|
176
|
+
if (itemConfig && itemConfig.validation === "success") {
|
|
177
|
+
return itemConfig.validationText || "";
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return resolvedInputConfig.value.validationText || props.validationText || "";
|
|
182
|
+
});
|
|
183
|
+
const internalSelectionValue = computed({
|
|
184
|
+
get: () => resolvedSelectionItem.value,
|
|
185
|
+
set: (val) => {
|
|
186
|
+
const key = getSelectionKey(val);
|
|
187
|
+
emit("update:selectionValue", key);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
const internalInputValue = computed({
|
|
191
|
+
get: () => props.inputValue,
|
|
192
|
+
set: (val) => {
|
|
193
|
+
emit("update:inputValue", val);
|
|
194
|
+
updateModelValue(props.selectionValue, val);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
watch(() => props.selectionValue, (newSelection) => {
|
|
198
|
+
const newKey = getSelectionKey(newSelection);
|
|
199
|
+
if (newKey !== void 0 && newKey !== null) {
|
|
200
|
+
const existingItem = props.modelValue?.find((item) => {
|
|
201
|
+
const itemKey = getSelectionKey(item.selection);
|
|
202
|
+
return JSON.stringify(itemKey) === JSON.stringify(newKey) || itemKey === newKey;
|
|
203
|
+
});
|
|
204
|
+
if (existingItem) {
|
|
205
|
+
emit("update:inputValue", existingItem.value);
|
|
206
|
+
} else if (!props.singleValue) {
|
|
207
|
+
const resolvedType = resolvedInputConfig.value.type;
|
|
208
|
+
const defaultValue = resolvedType?.includes("picker") ? null : "";
|
|
209
|
+
emit("update:inputValue", defaultValue);
|
|
210
|
+
} else if (props.inputValue !== null && props.inputValue !== "") {
|
|
211
|
+
updateModelValue(newSelection, props.inputValue);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
function updateModelValue(selection, value) {
|
|
216
|
+
const selectionKey = getSelectionKey(selection);
|
|
217
|
+
if (selectionKey === void 0 || selectionKey === null) return;
|
|
218
|
+
if (props.singleValue) {
|
|
219
|
+
emit("update:modelValue", [{ selection, value }]);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const currentModel = [...props.modelValue || []];
|
|
223
|
+
const index = currentModel.findIndex((item) => {
|
|
224
|
+
const itemKey = getSelectionKey(item.selection);
|
|
225
|
+
return JSON.stringify(itemKey) === JSON.stringify(selectionKey) || itemKey === selectionKey;
|
|
226
|
+
});
|
|
227
|
+
if (index !== -1) {
|
|
228
|
+
currentModel[index] = { ...currentModel[index], value };
|
|
229
|
+
} else {
|
|
230
|
+
currentModel.push({ selection, value });
|
|
231
|
+
}
|
|
232
|
+
emit("update:modelValue", currentModel);
|
|
233
|
+
}
|
|
234
|
+
const selectionProps = computed(() => ({
|
|
235
|
+
modelValue: internalSelectionValue.value,
|
|
236
|
+
"onUpdate:modelValue": (val) => internalSelectionValue.value = val,
|
|
237
|
+
dataProvider: props.dataProvider,
|
|
238
|
+
labelField: props.labelField,
|
|
239
|
+
valueField: props.valueField,
|
|
240
|
+
placeholder: props.placeholder,
|
|
241
|
+
searchbox: props.searchbox,
|
|
242
|
+
closeOnSelect: true,
|
|
243
|
+
teleportTo: props.teleportTo
|
|
244
|
+
}));
|
|
245
|
+
const inputProps = computed(() => ({
|
|
246
|
+
modelValue: props.inputValue,
|
|
247
|
+
"onUpdate:modelValue": (val) => internalInputValue.value = val,
|
|
248
|
+
placeholder: resolvedInputConfig.value.placeholder,
|
|
249
|
+
type: resolvedInputConfig.value.inputType,
|
|
250
|
+
mask: resolvedInputConfig.value.mask,
|
|
251
|
+
showClear: resolvedInputConfig.value.showClear
|
|
252
|
+
}));
|
|
253
|
+
return {
|
|
254
|
+
internalSelectionValue,
|
|
255
|
+
internalInputValue,
|
|
256
|
+
selectionProps,
|
|
257
|
+
inputProps,
|
|
258
|
+
resolvedSelectionItem,
|
|
259
|
+
resolvedInputConfig,
|
|
260
|
+
resolvedValidation,
|
|
261
|
+
resolvedValidationText
|
|
262
|
+
};
|
|
263
|
+
}
|