@katlux/toolkit 0.1.0-beta.0 → 0.1.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiled/composables/useDebounce.mjs +11 -0
- package/dist/compiled/composables/useFilterLogic.mjs +170 -0
- package/dist/compiled/composables/usePresetComponent.mjs +36 -0
- package/dist/compiled/composables/useRemainingTime.mjs +17 -0
- package/dist/compiled/composables/useSortLogic.mjs +55 -0
- package/dist/compiled/composables/useTemplate.mjs +70 -0
- package/dist/compiled/utils/PresetResolver.mjs +100 -0
- package/dist/module.cjs +32 -0
- package/dist/module.d.cts +5 -0
- package/dist/module.d.mts +5 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +29 -0
- package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +13 -0
- package/dist/runtime/components/KAccordion/KAccordion.global.vue +15 -0
- package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +13 -0
- package/dist/runtime/components/KAccordion/KAccordion.logic.d.ts +9 -0
- package/dist/runtime/components/KAccordion/KAccordion.logic.js +38 -0
- package/dist/runtime/components/KAccordion/KAccordionItem.global.d.vue.ts +21 -0
- package/dist/runtime/components/KAccordion/KAccordionItem.global.vue +20 -0
- package/dist/runtime/components/KAccordion/KAccordionItem.global.vue.d.ts +21 -0
- package/dist/runtime/components/KAccordion/KAccordionItem.logic.d.ts +17 -0
- package/dist/runtime/components/KAccordion/KAccordionItem.logic.js +59 -0
- package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +3 -0
- package/dist/runtime/components/KAlert/KAlert.global.vue +9 -0
- package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +3 -0
- package/dist/runtime/components/KAlert/KAlert.logic.d.ts +4 -0
- package/dist/runtime/components/KAlert/KAlert.logic.js +4 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +9 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +32 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +9 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +19 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +24 -0
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +56 -0
- package/dist/runtime/components/KButton/KButton.global.vue +24 -0
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +56 -0
- package/dist/runtime/components/KButton/KButton.logic.d.ts +54 -0
- package/dist/runtime/components/KButton/KButton.logic.js +42 -0
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +68 -0
- package/dist/runtime/components/KCalendar/KCalendar.global.vue +39 -0
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +68 -0
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +246 -0
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +166 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +74 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +33 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +74 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +54 -0
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +122 -0
- package/dist/runtime/components/KCalendar/KCalendarWeek.global.d.vue.ts +3 -0
- package/dist/runtime/components/KCalendar/KCalendarWeek.global.vue +9 -0
- package/dist/runtime/components/KCalendar/KCalendarWeek.global.vue.d.ts +3 -0
- package/dist/runtime/components/KCalendar/KCalendarWeek.logic.d.ts +4 -0
- package/dist/runtime/components/KCalendar/KCalendarWeek.logic.js +4 -0
- package/dist/runtime/components/KCalendar/recurringUtils.d.ts +11 -0
- package/dist/runtime/components/KCalendar/recurringUtils.js +191 -0
- package/dist/runtime/components/KCalendar/types.d.ts +38 -0
- package/dist/runtime/components/KCalendar/types.js +1 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +34 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +21 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +34 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +28 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +20 -0
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +99 -0
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +43 -0
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +99 -0
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +72 -0
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +140 -0
- package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +3 -0
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +9 -0
- package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +3 -0
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +4 -0
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +4 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +23 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +53 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +23 -0
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +20 -0
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +37 -0
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +23 -0
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +46 -0
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +23 -0
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +12 -0
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +19 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +42 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +45 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +42 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +33 -0
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +63 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +60 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +48 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +60 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +45 -0
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +77 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +28 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.vue +21 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +28 -0
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +21 -0
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +31 -0
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +172 -0
- package/dist/runtime/components/KGantt/KGantt.global.vue +73 -0
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +172 -0
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +190 -0
- package/dist/runtime/components/KGantt/KGantt.logic.js +310 -0
- package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +60 -0
- package/dist/runtime/components/KGrid/KGrid.global.vue +18 -0
- package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +60 -0
- package/dist/runtime/components/KGrid/KGrid.logic.d.ts +37 -0
- package/dist/runtime/components/KGrid/KGrid.logic.js +53 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +73 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +40 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +73 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.d.ts +46 -0
- package/dist/runtime/components/KHourPicker/KHourPicker.logic.js +58 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +55 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue +30 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +55 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.d.ts +34 -0
- package/dist/runtime/components/KHourSelect/KHourSelect.logic.js +69 -0
- package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +41 -0
- package/dist/runtime/components/KIcon/KIcon.global.vue +19 -0
- package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +41 -0
- package/dist/runtime/components/KIcon/KIcon.logic.d.ts +29 -0
- package/dist/runtime/components/KIcon/KIcon.logic.js +41 -0
- package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +33 -0
- package/dist/runtime/components/KLoader/KLoader.global.vue +22 -0
- package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +33 -0
- package/dist/runtime/components/KLoader/KLoader.logic.d.ts +29 -0
- package/dist/runtime/components/KLoader/KLoader.logic.js +25 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +45 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +25 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +45 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.d.ts +66 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +186 -0
- package/dist/runtime/components/KModal/KModal.global.d.vue.ts +6 -0
- package/dist/runtime/components/KModal/KModal.global.vue +23 -0
- package/dist/runtime/components/KModal/KModal.global.vue.d.ts +6 -0
- package/dist/runtime/components/KModal/KModal.logic.d.ts +8 -0
- package/dist/runtime/components/KModal/KModal.logic.js +16 -0
- package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +7 -0
- package/dist/runtime/components/KPagination/KPagination.global.vue +45 -0
- package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +7 -0
- package/dist/runtime/components/KPagination/KPagination.logic.d.ts +20 -0
- package/dist/runtime/components/KPagination/KPagination.logic.js +73 -0
- package/dist/runtime/components/KPanel/KPanel.global.d.vue.ts +33 -0
- package/dist/runtime/components/KPanel/KPanel.global.vue +19 -0
- package/dist/runtime/components/KPanel/KPanel.global.vue.d.ts +33 -0
- package/dist/runtime/components/KPanel/KPanel.logic.d.ts +20 -0
- package/dist/runtime/components/KPanel/KPanel.logic.js +17 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +37 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +22 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +37 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.d.ts +22 -0
- package/dist/runtime/components/KRadiobox/KRadiobox.logic.js +20 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +66 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue +36 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +66 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.d.ts +52 -0
- package/dist/runtime/components/KRangeSlider/KRangeSlider.logic.js +65 -0
- package/dist/runtime/components/KSearchTree/KSearchTree.global.d.vue.ts +3 -0
- package/dist/runtime/components/KSearchTree/KSearchTree.global.vue +9 -0
- package/dist/runtime/components/KSearchTree/KSearchTree.global.vue.d.ts +3 -0
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.d.ts +4 -0
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.js +4 -0
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.d.vue.ts +3 -0
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.vue +9 -0
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.vue.d.ts +3 -0
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.d.ts +4 -0
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.js +4 -0
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +55 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue +31 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +55 -0
- package/dist/runtime/components/KSlider/KSlider.logic.d.ts +45 -0
- package/dist/runtime/components/KSlider/KSlider.logic.js +45 -0
- package/dist/runtime/components/KTabs/KTabItem.global.d.vue.ts +21 -0
- package/dist/runtime/components/KTabs/KTabItem.global.vue +20 -0
- package/dist/runtime/components/KTabs/KTabItem.global.vue.d.ts +21 -0
- package/dist/runtime/components/KTabs/KTabItem.logic.d.ts +17 -0
- package/dist/runtime/components/KTabs/KTabItem.logic.js +37 -0
- package/dist/runtime/components/KTabs/KTabs.global.d.vue.ts +3 -0
- package/dist/runtime/components/KTabs/KTabs.global.vue +20 -0
- package/dist/runtime/components/KTabs/KTabs.global.vue.d.ts +3 -0
- package/dist/runtime/components/KTabs/KTabs.logic.d.ts +8 -0
- package/dist/runtime/components/KTabs/KTabs.logic.js +49 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +36 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.vue +19 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +36 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +31 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.js +24 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +36 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +20 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +36 -0
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +33 -0
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +32 -0
- package/dist/runtime/components/KThree/KThree.global.d.vue.ts +3 -0
- package/dist/runtime/components/KThree/KThree.global.vue +7 -0
- package/dist/runtime/components/KThree/KThree.global.vue.d.ts +3 -0
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +3 -0
- package/dist/runtime/components/KTooltip/KTooltip.global.vue +9 -0
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +3 -0
- package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +4 -0
- package/dist/runtime/components/KTooltip/KTooltip.logic.js +4 -0
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +77 -0
- package/dist/runtime/components/KTree/KTree.global.vue +36 -0
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +77 -0
- package/dist/runtime/components/KTree/KTree.logic.d.ts +51 -0
- package/dist/runtime/components/KTree/KTree.logic.js +65 -0
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +119 -0
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +66 -0
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +119 -0
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +77 -0
- package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +58 -0
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +94 -0
- package/dist/runtime/components/KTreeView/KTreeView.global.vue +69 -0
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +94 -0
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +80 -0
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +90 -0
- package/dist/runtime/composables/useDebounce.d.ts +7 -0
- package/dist/runtime/composables/useDebounce.js +11 -0
- package/dist/runtime/composables/useFilterLogic.d.ts +20 -0
- package/dist/runtime/composables/useFilterLogic.js +170 -0
- package/dist/runtime/composables/usePresetComponent.d.ts +2 -0
- package/dist/runtime/composables/usePresetComponent.js +36 -0
- package/dist/runtime/composables/useRemainingTime.d.ts +3 -0
- package/dist/runtime/composables/useRemainingTime.js +17 -0
- package/dist/runtime/composables/useSortLogic.d.ts +4 -0
- package/dist/runtime/composables/useSortLogic.js +55 -0
- package/dist/runtime/composables/useTemplate.d.ts +47 -0
- package/dist/runtime/composables/useTemplate.js +70 -0
- package/dist/runtime/directives/clickOutside.d.ts +7 -0
- package/dist/runtime/directives/clickOutside.js +45 -0
- package/dist/runtime/directives/index.d.ts +1 -0
- package/dist/runtime/directives/index.js +1 -0
- package/dist/runtime/plugins/PresetPlugin.d.ts +11 -0
- package/dist/runtime/plugins/PresetPlugin.js +34 -0
- package/dist/runtime/plugins/registerDirectives.d.ts +2 -0
- package/dist/runtime/plugins/registerDirectives.js +5 -0
- package/dist/runtime/presets/default/assets/scss/css-variables.css +151 -0
- package/dist/runtime/presets/default/assets/scss/docs.css +42 -0
- package/dist/runtime/presets/default/assets/scss/index.css +211 -0
- package/dist/runtime/presets/default/assets/scss/mixins.css +0 -0
- package/dist/runtime/presets/default/assets/scss/reset.css +16 -0
- package/dist/runtime/presets/default/components/KAccordion/KAccordion.d.vue.ts +3 -0
- package/{src → dist}/runtime/presets/default/components/KAccordion/KAccordion.vue +2 -5
- package/dist/runtime/presets/default/components/KAccordion/KAccordion.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue +50 -0
- package/dist/runtime/presets/default/components/KAccordion/KAccordionItem.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KAlert/KAlert.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KAlert/KAlert.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +17 -0
- package/{src → dist}/runtime/presets/default/components/KBulkActions/KBulkActions.vue +22 -29
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +17 -0
- package/dist/runtime/presets/default/components/KButton/KButton.d.vue.ts +11 -0
- package/dist/runtime/presets/default/components/KButton/KButton.vue +444 -0
- package/dist/runtime/presets/default/components/KButton/KButton.vue.d.ts +11 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +18 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +80 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +18 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +15 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +189 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +15 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +12 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +51 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +12 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +23 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +97 -0
- package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +23 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +17 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +83 -0
- package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +17 -0
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +24 -0
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +57 -0
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +24 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +23 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +138 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +23 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +21 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +33 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +21 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.d.vue.ts +25 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +66 -0
- package/dist/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue.d.ts +25 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +33 -0
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +49 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +304 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +49 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttRuler.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue +51 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttRuler.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +41 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +188 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +41 -0
- package/dist/runtime/presets/default/components/KGrid/KGrid.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KGrid/KGrid.vue +70 -0
- package/dist/runtime/presets/default/components/KGrid/KGrid.vue.d.ts +6 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.d.vue.ts +20 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue +51 -0
- package/dist/runtime/presets/default/components/KHourPicker/KHourPicker.vue.d.ts +20 -0
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue +43 -0
- package/dist/runtime/presets/default/components/KHourSelect/KHourSelect.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KIcon/KIcon.d.vue.ts +9 -0
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue +30 -0
- package/dist/runtime/presets/default/components/KIcon/KIcon.vue.d.ts +9 -0
- package/dist/runtime/presets/default/components/KLoader/KLoader.d.vue.ts +9 -0
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue +60 -0
- package/dist/runtime/presets/default/components/KLoader/KLoader.vue.d.ts +9 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.d.vue.ts +15 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +101 -0
- package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue.d.ts +15 -0
- package/dist/runtime/presets/default/components/KModal/KModal.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KModal/KModal.vue +42 -0
- package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +7 -0
- package/dist/runtime/presets/default/components/KPagination/KPagination.d.vue.ts +18 -0
- package/dist/runtime/presets/default/components/KPagination/KPagination.vue +70 -0
- package/dist/runtime/presets/default/components/KPagination/KPagination.vue.d.ts +18 -0
- package/dist/runtime/presets/default/components/KPanel/KPanel.d.vue.ts +12 -0
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue +47 -0
- package/dist/runtime/presets/default/components/KPanel/KPanel.vue.d.ts +12 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.d.vue.ts +17 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +43 -0
- package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue.d.ts +17 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.d.vue.ts +19 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +156 -0
- package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue.d.ts +19 -0
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KSlider/KSlider.d.vue.ts +15 -0
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue +121 -0
- package/dist/runtime/presets/default/components/KSlider/KSlider.vue.d.ts +15 -0
- package/dist/runtime/presets/default/components/KTabs/KTabItem.d.vue.ts +8 -0
- package/dist/runtime/presets/default/components/KTabs/KTabItem.vue +46 -0
- package/dist/runtime/presets/default/components/KTabs/KTabItem.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KTabs/KTabs.d.vue.ts +8 -0
- package/{src → dist}/runtime/presets/default/components/KTabs/KTabs.vue +6 -9
- package/dist/runtime/presets/default/components/KTabs/KTabs.vue.d.ts +8 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.d.vue.ts +15 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue +29 -0
- package/dist/runtime/presets/default/components/KTextarea/KTextarea.vue.d.ts +15 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +13 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +46 -0
- package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +13 -0
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +23 -0
- package/dist/runtime/presets/default/components/KTree/KTree.vue +126 -0
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +23 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +28 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +80 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue.d.ts +28 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeCell.d.vue.ts +10 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue +52 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeCell.vue.d.ts +10 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +24 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +55 -0
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +24 -0
- package/dist/runtime/utils/PresetResolver.d.ts +64 -0
- package/dist/runtime/utils/PresetResolver.js +100 -0
- package/dist/types.d.mts +7 -0
- package/package.json +10 -6
- package/ARCHITECTURE.md +0 -70
- package/PRESET_NAMING.md +0 -63
- package/PRESET_SYSTEM.md +0 -204
- package/build.config.ts +0 -3
- package/nuxt.config.ts +0 -9
- package/src/module.ts +0 -36
- package/src/runtime/components/KAccordion/KAccordion.global.vue +0 -18
- package/src/runtime/components/KAccordion/KAccordion.logic.ts +0 -49
- package/src/runtime/components/KAccordion/KAccordionItem.global.vue +0 -24
- package/src/runtime/components/KAccordion/KAccordionItem.logic.ts +0 -72
- package/src/runtime/components/KAlert/KAlert.global.vue +0 -10
- package/src/runtime/components/KAlert/KAlert.logic.ts +0 -3
- package/src/runtime/components/KBulkActions/KBulkActions.global.vue +0 -37
- package/src/runtime/components/KBulkActions/KBulkActions.logic.ts +0 -36
- package/src/runtime/components/KButton/KButton.global.vue +0 -37
- package/src/runtime/components/KButton/KButton.logic.ts +0 -75
- package/src/runtime/components/KCalendar/KCalendar.global.vue +0 -43
- package/src/runtime/components/KCalendar/KCalendar.logic.ts +0 -197
- package/src/runtime/components/KCalendar/KCalendarMonth.global.vue +0 -37
- package/src/runtime/components/KCalendar/KCalendarMonth.logic.ts +0 -175
- package/src/runtime/components/KCalendar/KCalendarWeek.global.vue +0 -10
- package/src/runtime/components/KCalendar/KCalendarWeek.logic.ts +0 -3
- package/src/runtime/components/KCalendar/recurringUtils.ts +0 -270
- package/src/runtime/components/KCalendar/types.ts +0 -54
- package/src/runtime/components/KCheckbox/KCheckbox.global.vue +0 -28
- package/src/runtime/components/KCheckbox/KCheckbox.logic.ts +0 -36
- package/src/runtime/components/KCombobox/KCombobox.global.vue +0 -51
- package/src/runtime/components/KCombobox/KCombobox.logic.ts +0 -194
- package/src/runtime/components/KContextMenu/KContextMenu.global.vue +0 -10
- package/src/runtime/components/KContextMenu/KContextMenu.logic.ts +0 -3
- package/src/runtime/components/KDatatable/KDataIterator.global.vue +0 -65
- package/src/runtime/components/KDatatable/KDataIterator.logic.ts +0 -59
- package/src/runtime/components/KDatatable/KDatatable.global.vue +0 -60
- package/src/runtime/components/KDatatable/KDatatable.logic.ts +0 -29
- package/src/runtime/components/KDatePicker/KDatePicker.global.vue +0 -52
- package/src/runtime/components/KDatePicker/KDatePicker.logic.ts +0 -87
- package/src/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +0 -53
- package/src/runtime/components/KDateTimePicker/KDateTimePicker.logic.ts +0 -103
- package/src/runtime/components/KDropdown/KDropdown.global.vue +0 -25
- package/src/runtime/components/KDropdown/KDropdown.logic.ts +0 -46
- package/src/runtime/components/KGantt/KGantt.global.vue +0 -82
- package/src/runtime/components/KGantt/KGantt.logic.ts +0 -439
- package/src/runtime/components/KGrid/KGrid.global.vue +0 -22
- package/src/runtime/components/KGrid/KGrid.logic.ts +0 -67
- package/src/runtime/components/KHourPicker/KHourPicker.global.vue +0 -47
- package/src/runtime/components/KHourPicker/KHourPicker.logic.ts +0 -74
- package/src/runtime/components/KHourSelect/KHourSelect.global.vue +0 -41
- package/src/runtime/components/KHourSelect/KHourSelect.logic.ts +0 -92
- package/src/runtime/components/KIcon/KIcon.global.vue +0 -23
- package/src/runtime/components/KIcon/KIcon.logic.ts +0 -62
- package/src/runtime/components/KLoader/KLoader.global.vue +0 -27
- package/src/runtime/components/KLoader/KLoader.logic.ts +0 -34
- package/src/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +0 -32
- package/src/runtime/components/KMaskTextbox/KMaskTextbox.logic.ts +0 -290
- package/src/runtime/components/KModal/KModal.global.vue +0 -28
- package/src/runtime/components/KModal/KModal.logic.ts +0 -20
- package/src/runtime/components/KPagination/KPagination.global.vue +0 -50
- package/src/runtime/components/KPagination/KPagination.logic.ts +0 -99
- package/src/runtime/components/KPanel/KPanel.global.vue +0 -22
- package/src/runtime/components/KPanel/KPanel.logic.ts +0 -24
- package/src/runtime/components/KRadiobox/KRadiobox.global.vue +0 -29
- package/src/runtime/components/KRadiobox/KRadiobox.logic.ts +0 -27
- package/src/runtime/components/KRangeSlider/KRangeSlider.global.vue +0 -43
- package/src/runtime/components/KRangeSlider/KRangeSlider.logic.ts +0 -94
- package/src/runtime/components/KSearchTree/KSearchTree.global.vue +0 -10
- package/src/runtime/components/KSearchTree/KSearchTree.logic.ts +0 -3
- package/src/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.global.vue +0 -10
- package/src/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.ts +0 -3
- package/src/runtime/components/KSlider/KSlider.global.vue +0 -38
- package/src/runtime/components/KSlider/KSlider.logic.ts +0 -69
- package/src/runtime/components/KTabs/KTabItem.global.vue +0 -24
- package/src/runtime/components/KTabs/KTabItem.logic.ts +0 -48
- package/src/runtime/components/KTabs/KTabs.global.vue +0 -24
- package/src/runtime/components/KTabs/KTabs.logic.ts +0 -60
- package/src/runtime/components/KTextarea/KTextarea.global.vue +0 -26
- package/src/runtime/components/KTextarea/KTextarea.logic.ts +0 -43
- package/src/runtime/components/KTextbox/KTextbox.global.vue +0 -27
- package/src/runtime/components/KTextbox/KTextbox.logic.ts +0 -53
- package/src/runtime/components/KThree/KThree.global.vue +0 -13
- package/src/runtime/components/KTooltip/KTooltip.global.vue +0 -10
- package/src/runtime/components/KTooltip/KTooltip.logic.ts +0 -3
- package/src/runtime/components/KTree/KTree.global.vue +0 -41
- package/src/runtime/components/KTree/KTree.logic.ts +0 -92
- package/src/runtime/components/KTreePicker/KTreePicker.global.vue +0 -80
- package/src/runtime/components/KTreePicker/KTreePicker.logic.ts +0 -85
- package/src/runtime/components/KTreeView/KTreeView.global.vue +0 -81
- package/src/runtime/components/KTreeView/KTreeView.logic.ts +0 -146
- package/src/runtime/composables/useDebounce.ts +0 -33
- package/src/runtime/composables/useFilterLogic.ts +0 -245
- package/src/runtime/composables/usePresetComponent.ts +0 -69
- package/src/runtime/composables/useRemainingTime.ts +0 -28
- package/src/runtime/composables/useSortLogic.ts +0 -82
- package/src/runtime/composables/useTemplate.ts +0 -135
- package/src/runtime/directives/clickOutside.ts +0 -75
- package/src/runtime/directives/index.ts +0 -1
- package/src/runtime/plugins/PresetPlugin.ts +0 -59
- package/src/runtime/plugins/registerDirectives.ts +0 -6
- package/src/runtime/presets/default/assets/scss/css-variables.scss +0 -216
- package/src/runtime/presets/default/assets/scss/docs.scss +0 -52
- package/src/runtime/presets/default/assets/scss/index.scss +0 -4
- package/src/runtime/presets/default/assets/scss/mixins.scss +0 -94
- package/src/runtime/presets/default/assets/scss/reset.scss +0 -16
- package/src/runtime/presets/default/components/KAccordion/KAccordionItem.vue +0 -53
- package/src/runtime/presets/default/components/KButton/KButton.vue +0 -163
- package/src/runtime/presets/default/components/KCalendar/KCalendar.vue +0 -84
- package/src/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +0 -217
- package/src/runtime/presets/default/components/KCheckbox/KCheckbox.vue +0 -61
- package/src/runtime/presets/default/components/KCombobox/KCombobox.vue +0 -106
- package/src/runtime/presets/default/components/KCombobox/KComboboxList.vue +0 -94
- package/src/runtime/presets/default/components/KDataIterator/KDataIterator.vue +0 -66
- package/src/runtime/presets/default/components/KDatatable/KDatatable.vue +0 -155
- package/src/runtime/presets/default/components/KDatePicker/KDatePicker.vue +0 -49
- package/src/runtime/presets/default/components/KDateTimePicker/KDateTimePicker.vue +0 -84
- package/src/runtime/presets/default/components/KDropdown/KDropdown.vue +0 -38
- package/src/runtime/presets/default/components/KGantt/KGantt.vue +0 -400
- package/src/runtime/presets/default/components/KGantt/KGanttRuler.vue +0 -56
- package/src/runtime/presets/default/components/KGantt/KGanttTimeline.vue +0 -218
- package/src/runtime/presets/default/components/KGrid/KGrid.vue +0 -72
- package/src/runtime/presets/default/components/KHourPicker/KHourPicker.vue +0 -55
- package/src/runtime/presets/default/components/KHourSelect/KHourSelect.vue +0 -49
- package/src/runtime/presets/default/components/KIcon/KIcon.vue +0 -30
- package/src/runtime/presets/default/components/KLoader/KLoader.vue +0 -66
- package/src/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +0 -125
- package/src/runtime/presets/default/components/KModal/KModal.vue +0 -45
- package/src/runtime/presets/default/components/KPagination/KPagination.vue +0 -72
- package/src/runtime/presets/default/components/KPanel/KPanel.vue +0 -55
- package/src/runtime/presets/default/components/KRadiobox/KRadiobox.vue +0 -44
- package/src/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +0 -189
- package/src/runtime/presets/default/components/KSlider/KSlider.vue +0 -144
- package/src/runtime/presets/default/components/KTabs/KTabItem.vue +0 -49
- package/src/runtime/presets/default/components/KTextarea/KTextarea.vue +0 -32
- package/src/runtime/presets/default/components/KTextbox/KTextbox.vue +0 -53
- package/src/runtime/presets/default/components/KTree/KTree.vue +0 -148
- package/src/runtime/presets/default/components/KTreePicker/KTreePicker.vue +0 -100
- package/src/runtime/presets/default/components/KTreeView/KTreeCell.vue +0 -53
- package/src/runtime/presets/default/components/KTreeView/KTreeView.vue +0 -62
- package/src/runtime/utils/PresetResolver.ts +0 -158
- package/tsconfig.json +0 -20
- /package/{src → dist}/runtime/app.config.d.ts +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/calendar.svg +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/check.svg +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/chevron.svg +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/close.svg +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/file.svg +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/folder.svg +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/search.svg +0 -0
- /package/{src → dist}/runtime/presets/default/assets/svg/user.svg +0 -0
- /package/{src → dist}/runtime/presets/default/components/KAlert/KAlert.vue +0 -0
- /package/{src → dist}/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +0 -0
- /package/{src → dist}/runtime/presets/default/components/KContextMenu/KContextMenu.vue +0 -0
- /package/{src → dist}/runtime/presets/default/components/KSearchTree/KSearchTree.vue +0 -0
- /package/{src → dist}/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue +0 -0
- /package/{src → dist}/runtime/presets/default/components/KTooltip/KTooltip.vue +0 -0
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import type { TDataRow, IDataFilter } from '@katlux/providers'
|
|
2
|
-
import { EDataFilterOperator } from '@katlux/providers'
|
|
3
|
-
|
|
4
|
-
export const useFilterLogic = () => {
|
|
5
|
-
|
|
6
|
-
const evaluateFilter = (filter: IDataFilter, row: TDataRow): boolean => {
|
|
7
|
-
// If this is a logical operator, delegate to applyOperator with the whole row and nested filters
|
|
8
|
-
if (
|
|
9
|
-
filter.operator === EDataFilterOperator.And ||
|
|
10
|
-
filter.operator === EDataFilterOperator.Or ||
|
|
11
|
-
filter.operator === EDataFilterOperator.Nand ||
|
|
12
|
-
filter.operator === EDataFilterOperator.Nor
|
|
13
|
-
) {
|
|
14
|
-
return !filter.active || applyOperator(filter.operator, row, filter.field)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Handle nested single filter (unary nesting)
|
|
18
|
-
if ('operator' in filter.field && 'field' in filter.field) {
|
|
19
|
-
return !filter.active || evaluateFilter(filter.field as IDataFilter, row)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Handle field filters
|
|
23
|
-
const field = filter.field as TDataRow
|
|
24
|
-
const fieldKeys = Object.keys(field)
|
|
25
|
-
|
|
26
|
-
/*Later on we will implement searching algoritms. Selective or check sort and then apply */
|
|
27
|
-
return !filter.active || fieldKeys.every((key) => {
|
|
28
|
-
const filterValue = field[key]
|
|
29
|
-
const rowValue = row[key]
|
|
30
|
-
return applyOperator(filter.operator, rowValue, filterValue)
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const applyOperator = (operator: string, rowValue: any, filterValue: any): boolean => {
|
|
35
|
-
switch (operator) {
|
|
36
|
-
case EDataFilterOperator.And:
|
|
37
|
-
return compareAnd(rowValue as TDataRow, filterValue)
|
|
38
|
-
case EDataFilterOperator.Or:
|
|
39
|
-
return compareOr(rowValue as TDataRow, filterValue)
|
|
40
|
-
case EDataFilterOperator.Nand:
|
|
41
|
-
return !compareAnd(rowValue as TDataRow, filterValue)
|
|
42
|
-
case EDataFilterOperator.Nor:
|
|
43
|
-
return !compareOr(rowValue as TDataRow, filterValue)
|
|
44
|
-
case EDataFilterOperator.Equal:
|
|
45
|
-
return compareEqual(rowValue, filterValue)
|
|
46
|
-
case EDataFilterOperator.NotEqual:
|
|
47
|
-
return !compareEqual(rowValue, filterValue)
|
|
48
|
-
case EDataFilterOperator.GreaterThan:
|
|
49
|
-
return compareValues(rowValue, filterValue) > 0
|
|
50
|
-
case EDataFilterOperator.LessThan:
|
|
51
|
-
return compareValues(rowValue, filterValue) < 0
|
|
52
|
-
case EDataFilterOperator.GreaterThanOrEqual:
|
|
53
|
-
return compareValues(rowValue, filterValue) >= 0
|
|
54
|
-
case EDataFilterOperator.LessThanOrEqual:
|
|
55
|
-
return compareValues(rowValue, filterValue) <= 0
|
|
56
|
-
case EDataFilterOperator.In:
|
|
57
|
-
return compareIn(rowValue, filterValue)
|
|
58
|
-
case EDataFilterOperator.NotIn:
|
|
59
|
-
return !compareIn(rowValue, filterValue)
|
|
60
|
-
default:
|
|
61
|
-
return compareEqual(rowValue, filterValue)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const compareAnd = (row: TDataRow, nested: any): boolean => {
|
|
66
|
-
const subFilters: any[] = Array.isArray(nested)
|
|
67
|
-
? nested
|
|
68
|
-
: (nested && typeof nested === 'object' ? Object.values(nested) : [])
|
|
69
|
-
const validFilters: IDataFilter[] = subFilters
|
|
70
|
-
.filter((f: any) => f && typeof f === 'object' && 'operator' in f && 'field' in f) as IDataFilter[]
|
|
71
|
-
if (validFilters.length === 0) return true
|
|
72
|
-
return validFilters.every((f) => {
|
|
73
|
-
const active = (f as any).active !== false
|
|
74
|
-
return active ? evaluateFilter(f, row) : true
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const compareOr = (row: TDataRow, nested: any): boolean => {
|
|
79
|
-
const subFilters: any[] = Array.isArray(nested)
|
|
80
|
-
? nested
|
|
81
|
-
: (nested && typeof nested === 'object' ? Object.values(nested) : [])
|
|
82
|
-
const validFilters: IDataFilter[] = subFilters
|
|
83
|
-
.filter((f: any) => f && typeof f === 'object' && 'operator' in f && 'field' in f) as IDataFilter[]
|
|
84
|
-
|
|
85
|
-
const activeFilters = validFilters.filter(f => f.active !== false)
|
|
86
|
-
|
|
87
|
-
if (activeFilters.length === 0) return true
|
|
88
|
-
|
|
89
|
-
return activeFilters.some((f) => {
|
|
90
|
-
return evaluateFilter(f, row)
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
const compareIn = (rowValue: any, filterValue: any): boolean => {
|
|
94
|
-
if (typeof rowValue === 'string' && typeof filterValue === 'string') {
|
|
95
|
-
return rowValue.toLowerCase().includes(filterValue.toLowerCase())
|
|
96
|
-
}
|
|
97
|
-
return false
|
|
98
|
-
}
|
|
99
|
-
const compareEqual = (rowValue: any, filterValue: any): boolean => {
|
|
100
|
-
// Handle string comparison (case-insensitive, contains)
|
|
101
|
-
if (typeof rowValue === 'string' && typeof filterValue === 'string') {
|
|
102
|
-
return rowValue.toLowerCase() == filterValue.toLowerCase()
|
|
103
|
-
}
|
|
104
|
-
// Handle numeric comparison
|
|
105
|
-
if (typeof rowValue === 'number' && typeof filterValue === 'number') {
|
|
106
|
-
return rowValue === filterValue
|
|
107
|
-
}
|
|
108
|
-
// Handle boolean comparison
|
|
109
|
-
if (typeof rowValue === 'boolean' && typeof filterValue === 'boolean') {
|
|
110
|
-
return rowValue === filterValue
|
|
111
|
-
}
|
|
112
|
-
// Fallback to strict equality
|
|
113
|
-
return rowValue === filterValue
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const compareValues = (rowValue: any, filterValue: any): number => {
|
|
117
|
-
// Handle null/undefined
|
|
118
|
-
if (rowValue == null || filterValue == null) {
|
|
119
|
-
return rowValue == null ? -1 : 1
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Handle strings
|
|
123
|
-
if (typeof rowValue === 'string' && typeof filterValue === 'string') {
|
|
124
|
-
return rowValue.localeCompare(filterValue)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Handle numbers
|
|
128
|
-
if (typeof rowValue === 'number' && typeof filterValue === 'number') {
|
|
129
|
-
return rowValue - filterValue
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Fallback: convert to string and compare
|
|
133
|
-
return String(rowValue).localeCompare(String(filterValue))
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const filterTreeData = (
|
|
137
|
-
nodes: any[],
|
|
138
|
-
filter: IDataFilter,
|
|
139
|
-
options: { idKey: string; parentKey: string }
|
|
140
|
-
): { visibleNodes: any[]; expandedNodes: Set<string | number> } => {
|
|
141
|
-
const { idKey, parentKey } = options
|
|
142
|
-
const nodeMap = new Map(nodes.map(node => [node[idKey], node]))
|
|
143
|
-
|
|
144
|
-
// Build children map for descendant traversal
|
|
145
|
-
const childrenMap = new Map<string | number, any[]>()
|
|
146
|
-
nodes.forEach(node => {
|
|
147
|
-
const pId = node[parentKey]
|
|
148
|
-
if (pId != null) {
|
|
149
|
-
if (!childrenMap.has(pId)) {
|
|
150
|
-
childrenMap.set(pId, [])
|
|
151
|
-
}
|
|
152
|
-
childrenMap.get(pId)!.push(node)
|
|
153
|
-
}
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
const matchingNodeIds = new Set<string | number>()
|
|
157
|
-
const expandedNodes = new Set<string | number>()
|
|
158
|
-
const visibleNodeIds = new Set<string | number>()
|
|
159
|
-
|
|
160
|
-
// First pass: Find directly matching nodes
|
|
161
|
-
nodes.forEach(node => {
|
|
162
|
-
// Strategy: Flatten for evaluation
|
|
163
|
-
const evalRow = node.data ? { ...node.data, ...node } : node
|
|
164
|
-
|
|
165
|
-
if (evaluateFilter(filter, evalRow)) {
|
|
166
|
-
matchingNodeIds.add(node[idKey])
|
|
167
|
-
}
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
// Helper to add descendants recursively
|
|
171
|
-
const addDescendants = (nodeId: string | number) => {
|
|
172
|
-
const children = childrenMap.get(nodeId)
|
|
173
|
-
if (children && children.length > 0) {
|
|
174
|
-
expandedNodes.add(nodeId) // Expand parent to show children
|
|
175
|
-
children.forEach(child => {
|
|
176
|
-
visibleNodeIds.add(child[idKey])
|
|
177
|
-
addDescendants(child[idKey])
|
|
178
|
-
})
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Second pass: Include ancestors and descendants of matching nodes
|
|
183
|
-
matchingNodeIds.forEach(id => {
|
|
184
|
-
|
|
185
|
-
// 1. All descendants
|
|
186
|
-
visibleNodeIds.add(id)
|
|
187
|
-
addDescendants(id)
|
|
188
|
-
|
|
189
|
-
// 2. All ancestors
|
|
190
|
-
let currentId: string | number | null = id
|
|
191
|
-
while (currentId != null) {
|
|
192
|
-
visibleNodeIds.add(currentId)
|
|
193
|
-
const node = nodeMap.get(currentId)
|
|
194
|
-
if (node) {
|
|
195
|
-
// Expand parent if it exists
|
|
196
|
-
if (node[parentKey] != null) {
|
|
197
|
-
expandedNodes.add(node[parentKey])
|
|
198
|
-
currentId = node[parentKey]
|
|
199
|
-
} else {
|
|
200
|
-
currentId = null
|
|
201
|
-
}
|
|
202
|
-
} else {
|
|
203
|
-
break
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
// Return filtered nodes in original order
|
|
209
|
-
const visibleNodes = nodes.filter(node => visibleNodeIds.has(node[idKey]))
|
|
210
|
-
|
|
211
|
-
return {
|
|
212
|
-
visibleNodes,
|
|
213
|
-
expandedNodes
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const filterData = (
|
|
218
|
-
data: any[],
|
|
219
|
-
filter: IDataFilter,
|
|
220
|
-
options?: {
|
|
221
|
-
treeOptions?: {
|
|
222
|
-
idKey: string
|
|
223
|
-
parentKey: string
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
): { results: any[]; expandedNodes?: Set<string | number> } => {
|
|
227
|
-
if (options?.treeOptions) {
|
|
228
|
-
const { visibleNodes, expandedNodes } = filterTreeData(
|
|
229
|
-
data,
|
|
230
|
-
filter,
|
|
231
|
-
options.treeOptions
|
|
232
|
-
)
|
|
233
|
-
return { results: visibleNodes, expandedNodes }
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const results = data.filter((row) => evaluateFilter(filter, row))
|
|
237
|
-
return { results }
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return {
|
|
241
|
-
evaluateFilter,
|
|
242
|
-
filterTreeData,
|
|
243
|
-
filterData,
|
|
244
|
-
}
|
|
245
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { computed, defineAsyncComponent, type Component } from 'vue'
|
|
2
|
-
import { useAppConfig } from '#app'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Composable for dynamically loading preset components
|
|
6
|
-
*
|
|
7
|
-
* This enables the preset system to work with any custom preset name
|
|
8
|
-
* without hardcoding preset names in components.
|
|
9
|
-
*
|
|
10
|
-
* @param componentBaseName - Base name of the component (e.g., 'KButton')
|
|
11
|
-
* @param defaultComponent - The default preset component to fall back to
|
|
12
|
-
* @returns The resolved preset component
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* const presetComponent = usePresetComponent('KButton', KButtonDefault)
|
|
17
|
-
* // With activePreset: 'modern' → resolves to KButtonModern
|
|
18
|
-
* // With activePreset: 'dark' → resolves to KButtonDark
|
|
19
|
-
* // With activePreset: 'my-theme' → resolves to KButtonMyTheme
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
const componentCache = new Map<string, Component>()
|
|
23
|
-
|
|
24
|
-
// Pre-define globs for all possible preset components
|
|
25
|
-
const modernComponents = import.meta.glob('../../../../katlux-preset-modern/src/runtime/components/**/*.vue')
|
|
26
|
-
const toolkitPresets = import.meta.glob('../presets/**/*.vue')
|
|
27
|
-
|
|
28
|
-
export function usePresetComponent(
|
|
29
|
-
componentBaseName: string,
|
|
30
|
-
defaultComponent: Component
|
|
31
|
-
) {
|
|
32
|
-
const appConfig = useAppConfig()
|
|
33
|
-
const activePreset = computed(() => appConfig.katluxToolkit?.activePreset || 'default')
|
|
34
|
-
|
|
35
|
-
return computed(() => {
|
|
36
|
-
// Use default component for 'default' preset
|
|
37
|
-
if (activePreset.value === 'default') {
|
|
38
|
-
return defaultComponent
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const cacheKey = `${activePreset.value}:${componentBaseName}`
|
|
42
|
-
if (componentCache.has(cacheKey)) {
|
|
43
|
-
return componentCache.get(cacheKey)!
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
let loader: (() => Promise<any>) | undefined
|
|
47
|
-
|
|
48
|
-
if (activePreset.value === 'modern') {
|
|
49
|
-
const path = `../../../../katlux-preset-modern/src/runtime/components/${componentBaseName}/${componentBaseName}.vue`
|
|
50
|
-
loader = modernComponents[path] as (() => Promise<any>)
|
|
51
|
-
} else {
|
|
52
|
-
const path = `../presets/${activePreset.value}/components/${componentBaseName}/${componentBaseName}.vue`
|
|
53
|
-
loader = toolkitPresets[path] as (() => Promise<any>)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (!loader) {
|
|
57
|
-
console.warn(`[${componentBaseName}] Preset "${activePreset.value}" not found, falling back to default`)
|
|
58
|
-
return defaultComponent
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const asyncComp = defineAsyncComponent({
|
|
62
|
-
loader: loader,
|
|
63
|
-
errorComponent: defaultComponent as any
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
componentCache.set(cacheKey, asyncComp)
|
|
67
|
-
return asyncComp
|
|
68
|
-
})
|
|
69
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const useRemainingTime = () => {
|
|
2
|
-
/**
|
|
3
|
-
* Formats milliseconds into a human-readable remaining time string.
|
|
4
|
-
* Returns formats like "1s", "1m", "1h", "1d".
|
|
5
|
-
*
|
|
6
|
-
* @param ms Milliseconds
|
|
7
|
-
* @returns Formatted string
|
|
8
|
-
*/
|
|
9
|
-
const formatRemainingTime = (ms: number): string => {
|
|
10
|
-
if (ms <= 0) return 'expired'
|
|
11
|
-
|
|
12
|
-
const seconds = Math.floor(ms / 1000)
|
|
13
|
-
const minutes = Math.floor(seconds / 60)
|
|
14
|
-
const hours = Math.floor(minutes / 60)
|
|
15
|
-
const days = Math.floor(hours / 24)
|
|
16
|
-
|
|
17
|
-
if (days > 0) return `${days}d`
|
|
18
|
-
if (hours > 0) return `${hours}h`
|
|
19
|
-
if (minutes > 0) return `${minutes}m`
|
|
20
|
-
if (seconds > 0) return `${seconds}s`
|
|
21
|
-
|
|
22
|
-
return '0s'
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
formatRemainingTime
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { TDataRow, IDataSort } from '@katlux/providers'
|
|
2
|
-
|
|
3
|
-
export const useSortLogic = () => {
|
|
4
|
-
|
|
5
|
-
const sortData = (sortList: IDataSort[], rows: TDataRow[]): TDataRow[] => {
|
|
6
|
-
|
|
7
|
-
if (!sortList || sortList.length === 0 || !rows || rows.length === 0) {
|
|
8
|
-
return rows
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Create a copy of the rows array to avoid mutating the original
|
|
12
|
-
const sortedRows = [...rows]
|
|
13
|
-
|
|
14
|
-
// Compare function for two rows based on sort criteria
|
|
15
|
-
// Sorts by the order of sortList: first item has highest priority, then second, etc.
|
|
16
|
-
const compare = (a: TDataRow, b: TDataRow): number => {
|
|
17
|
-
// Iterate through sortList in order - first criterion is primary, subsequent are secondary/tertiary
|
|
18
|
-
for (const sort of sortList) {
|
|
19
|
-
const aVal = a[sort.field]
|
|
20
|
-
const bVal = b[sort.field]
|
|
21
|
-
|
|
22
|
-
// Handle null/undefined values
|
|
23
|
-
if (aVal === null || aVal === undefined) {
|
|
24
|
-
if (bVal === null || bVal === undefined) continue
|
|
25
|
-
return sort.direction === 'asc' ? -1 : 1
|
|
26
|
-
}
|
|
27
|
-
if (bVal === null || bVal === undefined) {
|
|
28
|
-
return sort.direction === 'asc' ? 1 : -1
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Compare values - if not equal, use this criterion (respects sortList order priority)
|
|
32
|
-
if (aVal < bVal) {
|
|
33
|
-
return sort.direction === 'asc' ? -1 : 1
|
|
34
|
-
} else if (aVal > bVal) {
|
|
35
|
-
return sort.direction === 'asc' ? 1 : -1
|
|
36
|
-
}
|
|
37
|
-
// If equal, continue to next sort criterion in sortList order
|
|
38
|
-
}
|
|
39
|
-
// All criteria were equal
|
|
40
|
-
return 0
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Merge function for merge sort
|
|
44
|
-
const merge = (left: TDataRow[], right: TDataRow[]): TDataRow[] => {
|
|
45
|
-
const result: TDataRow[] = []
|
|
46
|
-
let leftIndex = 0
|
|
47
|
-
let rightIndex = 0
|
|
48
|
-
|
|
49
|
-
while (leftIndex < left.length && rightIndex < right.length) {
|
|
50
|
-
if (compare(left[leftIndex], right[rightIndex]) <= 0) {
|
|
51
|
-
result.push(left[leftIndex])
|
|
52
|
-
leftIndex++
|
|
53
|
-
} else {
|
|
54
|
-
result.push(right[rightIndex])
|
|
55
|
-
rightIndex++
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Add remaining elements
|
|
60
|
-
return result.concat(left.slice(leftIndex)).concat(right.slice(rightIndex))
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Merge sort implementation
|
|
64
|
-
const mergeSort = (arr: TDataRow[]): TDataRow[] => {
|
|
65
|
-
if (arr.length <= 1) {
|
|
66
|
-
return arr
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const mid = Math.floor(arr.length / 2)
|
|
70
|
-
const left = mergeSort(arr.slice(0, mid))
|
|
71
|
-
const right = mergeSort(arr.slice(mid))
|
|
72
|
-
|
|
73
|
-
return merge(left, right)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return mergeSort(sortedRows)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
sortData
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { ref, computed, onMounted, type Ref } from 'vue'
|
|
2
|
-
import { useTemplateResolver } from '../utils/TemplateResolver'
|
|
3
|
-
import type { TemplateMetadata } from '../utils/TemplateResolver'
|
|
4
|
-
|
|
5
|
-
export interface UseTemplateOptions {
|
|
6
|
-
componentName: string
|
|
7
|
-
fallbackToDefault?: boolean
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface UseTemplateReturn {
|
|
11
|
-
metadata: Ref<TemplateMetadata>
|
|
12
|
-
isCustomTemplate: Ref<boolean>
|
|
13
|
-
templateName: Ref<string>
|
|
14
|
-
isLoading: Ref<boolean>
|
|
15
|
-
error: Ref<Error | null>
|
|
16
|
-
refreshTemplate: () => void
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* useTemplate - Composable for managing component template resolution
|
|
21
|
-
*
|
|
22
|
-
* This composable provides:
|
|
23
|
-
* - Template resolution logic for components
|
|
24
|
-
* - Reactive template state
|
|
25
|
-
* - Template loading and error handling
|
|
26
|
-
* - Template refresh capability
|
|
27
|
-
*
|
|
28
|
-
* @param options - Configuration options
|
|
29
|
-
* @returns Template state and utilities
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* const { metadata, isCustomTemplate } = useTemplate({
|
|
34
|
-
* componentName: 'KButton'
|
|
35
|
-
* })
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export function useTemplate(options: UseTemplateOptions): UseTemplateReturn {
|
|
39
|
-
const { componentName, fallbackToDefault = true } = options
|
|
40
|
-
|
|
41
|
-
const resolver = useTemplateResolver()
|
|
42
|
-
const metadata = ref<TemplateMetadata>(resolver.resolveTemplate(componentName))
|
|
43
|
-
const isLoading = ref(false)
|
|
44
|
-
const error = ref<Error | null>(null)
|
|
45
|
-
|
|
46
|
-
const isCustomTemplate = computed(() => {
|
|
47
|
-
return metadata.value.hasCustomTemplate && metadata.value.templateName !== 'default'
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const templateName = computed(() => {
|
|
51
|
-
return metadata.value.templateName
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Refresh template metadata (useful when template changes in dev mode)
|
|
56
|
-
*/
|
|
57
|
-
const refreshTemplate = () => {
|
|
58
|
-
try {
|
|
59
|
-
isLoading.value = true
|
|
60
|
-
error.value = null
|
|
61
|
-
|
|
62
|
-
// Clear cache and re-resolve
|
|
63
|
-
resolver.clearCache()
|
|
64
|
-
metadata.value = resolver.resolveTemplate(componentName)
|
|
65
|
-
} catch (e) {
|
|
66
|
-
error.value = e as Error
|
|
67
|
-
console.error(`Failed to refresh template for ${componentName}:`, e)
|
|
68
|
-
|
|
69
|
-
// Fallback to default if enabled
|
|
70
|
-
if (fallbackToDefault) {
|
|
71
|
-
console.warn(`Falling back to default template for ${componentName}`)
|
|
72
|
-
resolver.setActiveTemplate('default')
|
|
73
|
-
metadata.value = resolver.resolveTemplate(componentName)
|
|
74
|
-
}
|
|
75
|
-
} finally {
|
|
76
|
-
isLoading.value = false
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Initialize on mount
|
|
81
|
-
onMounted(() => {
|
|
82
|
-
refreshTemplate()
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
metadata,
|
|
87
|
-
isCustomTemplate,
|
|
88
|
-
templateName,
|
|
89
|
-
isLoading,
|
|
90
|
-
error,
|
|
91
|
-
refreshTemplate,
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* useTemplateStyles - Composable for loading custom template styles
|
|
97
|
-
*
|
|
98
|
-
* This composable handles dynamic loading of custom SCSS styles
|
|
99
|
-
*
|
|
100
|
-
* @param componentName - Name of the component
|
|
101
|
-
* @returns Style loading state
|
|
102
|
-
*/
|
|
103
|
-
export function useTemplateStyles(componentName: string) {
|
|
104
|
-
const resolver = useTemplateResolver()
|
|
105
|
-
const metadata = resolver.resolveTemplate(componentName)
|
|
106
|
-
const isLoaded = ref(false)
|
|
107
|
-
const error = ref<Error | null>(null)
|
|
108
|
-
|
|
109
|
-
const loadStyles = async () => {
|
|
110
|
-
if (!metadata.hasCustomStyles || !metadata.stylesPath) {
|
|
111
|
-
isLoaded.value = true
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
try {
|
|
116
|
-
// In a real implementation, this would dynamically import the SCSS
|
|
117
|
-
// For now, we'll mark it as loaded
|
|
118
|
-
// TODO: Implement dynamic SCSS loading
|
|
119
|
-
isLoaded.value = true
|
|
120
|
-
} catch (e) {
|
|
121
|
-
error.value = e as Error
|
|
122
|
-
console.error(`Failed to load styles for ${componentName}:`, e)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
onMounted(() => {
|
|
127
|
-
loadStyles()
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
return {
|
|
131
|
-
isLoaded,
|
|
132
|
-
error,
|
|
133
|
-
loadStyles,
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Directive, DirectiveBinding } from 'vue'
|
|
2
|
-
|
|
3
|
-
interface ClickOutsideBinding extends DirectiveBinding {
|
|
4
|
-
value: (event: Event) => void
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface ClickOutsideOptions {
|
|
8
|
-
handler: (event: Event) => void;
|
|
9
|
-
extraInside?: string | HTMLElement | ((target: HTMLElement) => boolean);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const clickOutside: Directive = {
|
|
13
|
-
// Handle SSR by providing empty props
|
|
14
|
-
getSSRProps() {
|
|
15
|
-
return {}
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
// Only run on client side
|
|
19
|
-
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
|
20
|
-
// Skip if not on client side or no handler provided
|
|
21
|
-
if (typeof window === 'undefined' || !binding.value) return
|
|
22
|
-
|
|
23
|
-
el._clickOutside = (event: Event) => {
|
|
24
|
-
const target = event.target as HTMLElement;
|
|
25
|
-
|
|
26
|
-
// Default: check if click is inside the element
|
|
27
|
-
if (el === target || el.contains(target)) return;
|
|
28
|
-
|
|
29
|
-
// Support for extra 'inside' area(s)
|
|
30
|
-
let handler: (event: Event) => void;
|
|
31
|
-
let extraInside: string | HTMLElement | ((target: HTMLElement) => boolean) | undefined;
|
|
32
|
-
const value = binding.value;
|
|
33
|
-
if (typeof value === 'function') {
|
|
34
|
-
handler = value;
|
|
35
|
-
} else if (value && typeof value === 'object' && typeof value.handler === 'function') {
|
|
36
|
-
handler = value.handler;
|
|
37
|
-
extraInside = value.extraInside;
|
|
38
|
-
} else {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let isInsideExtra = false;
|
|
43
|
-
if (extraInside) {
|
|
44
|
-
if (typeof extraInside === 'string') {
|
|
45
|
-
const extraEl = document.querySelector(extraInside);
|
|
46
|
-
if (extraEl && (extraEl === target || extraEl.contains(target))) isInsideExtra = true;
|
|
47
|
-
} else if (extraInside instanceof HTMLElement) {
|
|
48
|
-
if (extraInside === target || extraInside.contains(target)) isInsideExtra = true;
|
|
49
|
-
} else if (typeof extraInside === 'function') {
|
|
50
|
-
if (extraInside(target)) isInsideExtra = true;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (isInsideExtra) return;
|
|
54
|
-
|
|
55
|
-
// If we get here, the click was truly outside
|
|
56
|
-
handler(event);
|
|
57
|
-
};
|
|
58
|
-
document.addEventListener('click', el._clickOutside, true);
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
unmounted(el: HTMLElement) {
|
|
62
|
-
// Remove event listener when component is unmounted
|
|
63
|
-
if (el._clickOutside) {
|
|
64
|
-
document.removeEventListener('click', el._clickOutside, true)
|
|
65
|
-
delete el._clickOutside
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Extend HTMLElement interface to include our custom property
|
|
71
|
-
declare global {
|
|
72
|
-
interface HTMLElement {
|
|
73
|
-
_clickOutside?: (event: Event) => void
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { clickOutside } from './clickOutside'
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin, useHead, useAppConfig } from '#app'
|
|
2
|
-
import { watch } from 'vue'
|
|
3
|
-
import { PresetResolver } from '../utils/PresetResolver'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Katlux Preset Plugin
|
|
7
|
-
*
|
|
8
|
-
* This plugin initializes the preset system on app startup:
|
|
9
|
-
* - Creates the PresetResolver singleton
|
|
10
|
-
* - Discovers available presets
|
|
11
|
-
* - Sets up preset watchers in dev mode
|
|
12
|
-
* - Provides global preset utilities
|
|
13
|
-
*/
|
|
14
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
15
|
-
// Initialize the preset resolver (per request for SSR safety)
|
|
16
|
-
const resolver = new PresetResolver()
|
|
17
|
-
|
|
18
|
-
// Sync the resolved preset (from cookie) with appConfig immediately
|
|
19
|
-
// This ensures useAppConfig() returns the correct preset during SSR
|
|
20
|
-
const activePreset = resolver.getActivePreset()
|
|
21
|
-
const appConfig = useAppConfig()
|
|
22
|
-
if (activePreset && appConfig.katluxToolkit) {
|
|
23
|
-
appConfig.katluxToolkit.activePreset = activePreset
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Update the root attribute for CSS variable scoping
|
|
27
|
-
// Use useHead for SSR compatibility and automatic cleanup
|
|
28
|
-
const updateRootAttribute = (preset: string) => {
|
|
29
|
-
useHead({
|
|
30
|
-
htmlAttrs: {
|
|
31
|
-
'data-template': preset
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Set initial attribute
|
|
37
|
-
updateRootAttribute(activePreset)
|
|
38
|
-
|
|
39
|
-
// Watch for changes at runtime (e.g. from a theme/preset switcher)
|
|
40
|
-
if (appConfig.katluxToolkit) {
|
|
41
|
-
watch(() => appConfig.katluxToolkit?.activePreset, (newPreset) => {
|
|
42
|
-
if (newPreset) {
|
|
43
|
-
updateRootAttribute(newPreset)
|
|
44
|
-
resolver.setActivePreset(newPreset)
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Provide the resolver to the app (single provide statement)
|
|
50
|
-
nuxtApp.provide('presetResolver', resolver)
|
|
51
|
-
|
|
52
|
-
// In development mode, set up HMR for preset changes
|
|
53
|
-
if (process.dev && import.meta.hot) {
|
|
54
|
-
import.meta.hot.accept(() => {
|
|
55
|
-
console.log('[Katlux] Preset files changed, clearing cache')
|
|
56
|
-
resolver.clearCache()
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
})
|