@katlux/toolkit 0.1.0-beta.9 → 0.1.1-alpha.100
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/useKatluxI18n.mjs +56 -0
- package/dist/compiled/composables/useKatluxI18n.spec.mjs +10 -0
- package/dist/compiled/composables/usePresetComponent.mjs +42 -22
- package/dist/compiled/utils/PresetResolver.mjs +18 -12
- package/dist/module.cjs +122 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +123 -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 +10 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue +9 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +10 -1
- package/dist/runtime/components/KAlert/KAlert.logic.d.ts +10 -2
- package/dist/runtime/components/KAlert/KAlert.logic.js +18 -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 +10 -1
- package/dist/runtime/components/KButton/KButton.global.vue +2 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +10 -1
- 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 +62 -20
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +31 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +31 -1
- 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 +84 -12
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +214 -0
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue +55 -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/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 +4 -0
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +3 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +106 -10
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +28 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +106 -10
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +49 -2
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +118 -7
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +95 -10
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +27 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +95 -10
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +44 -2
- 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/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/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 +4 -4
- package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
- 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 +10 -1
- package/dist/runtime/components/KSlider/KSlider.global.vue +1 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +10 -1
- 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 +31 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue +4 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +31 -1
- 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 +74 -7
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +16 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +74 -7
- 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 +6 -6
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +6 -6
- 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 +52 -0
- package/dist/runtime/composables/locales.d.ts +28 -0
- package/dist/runtime/composables/locales.js +554 -0
- package/dist/runtime/composables/useKatluxI18n.d.ts +15 -0
- package/dist/runtime/composables/useKatluxI18n.js +56 -0
- package/dist/runtime/composables/usePresetComponent.d.ts +11 -0
- package/dist/runtime/composables/usePresetComponent.js +42 -22
- package/dist/runtime/plugins/PresetPlugin.d.ts +2 -3
- package/dist/runtime/plugins/PresetPlugin.js +11 -15
- package/dist/runtime/presets/default/assets/scss/css-variables.css +96 -17
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +320 -0
- package/dist/runtime/presets/default/assets/scss/docs.scss +52 -0
- package/dist/runtime/presets/default/assets/scss/index.css +191 -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 +112 -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 +195 -161
- 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 +60 -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 +155 -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 +109 -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 +343 -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 +18 -12
- 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/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
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
)
|
|
22
22
|
template(#cell-_ganttActions="{ row }")
|
|
23
23
|
.gantt-actions
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
template(v-for="rowAction in rowActions" :key="rowAction.label")
|
|
25
|
+
KButton(
|
|
26
|
+
v-if="!rowAction.visible || rowAction.visible(row)"
|
|
27
|
+
:type="rowAction.type || 'default'"
|
|
28
|
+
size="small"
|
|
29
|
+
@click="rowAction.action(row)"
|
|
30
|
+
) {{ rowAction.label }}
|
|
31
31
|
template(#header-ganttTimeline)
|
|
32
32
|
KGanttRuler(
|
|
33
33
|
:startMs="globalDateRange.start"
|
|
@@ -53,252 +53,348 @@
|
|
|
53
53
|
)
|
|
54
54
|
</template>
|
|
55
55
|
|
|
56
|
-
<script setup>
|
|
57
|
-
import { computed, ref } from
|
|
58
|
-
import KGanttRuler from
|
|
59
|
-
import KGanttTimeline from
|
|
60
|
-
import {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
56
|
+
<script lang="ts" setup>
|
|
57
|
+
import { computed, ref } from 'vue'
|
|
58
|
+
import KGanttRuler from './KGanttRuler.vue'
|
|
59
|
+
import KGanttTimeline from './KGanttTimeline.vue'
|
|
60
|
+
import type { ITreeViewColumn } from '#toolkit/components/KTreeView/KTreeView.logic'
|
|
61
|
+
import type { IKDatatableAction } from '@katlux/providers'
|
|
62
|
+
import type { IGanttTask } from '#toolkit/components/KGantt/KGantt.logic'
|
|
63
|
+
import { getSnapMs, isTaskOverlapping, calculateGanttMinWidth } from '#toolkit/components/KGantt/KGantt.logic'
|
|
64
|
+
|
|
65
|
+
const props = defineProps<{
|
|
66
|
+
dataProvider: any
|
|
67
|
+
columns: ITreeViewColumn[]
|
|
68
|
+
treeColumnIndex?: number
|
|
69
|
+
bulkActions?: IKDatatableAction[]
|
|
70
|
+
rowActions?: IKDatatableAction[]
|
|
71
|
+
|
|
72
|
+
globalDateRange: { start: number, end: number }
|
|
73
|
+
totalDuration: number
|
|
74
|
+
resolvedMapping: any
|
|
75
|
+
getTasksForRow: (row: any) => IGanttTask[]
|
|
76
|
+
getTaskStyle: (task: any) => any
|
|
77
|
+
|
|
78
|
+
editable?: boolean
|
|
79
|
+
snapTo?: string
|
|
80
|
+
resourceTypeField?: string
|
|
81
|
+
taskTypeField?: string
|
|
82
|
+
|
|
83
|
+
selectedRows?: any[]
|
|
84
|
+
selectAll?: boolean
|
|
85
|
+
cellSlots?: any
|
|
86
|
+
headerSlots?: any
|
|
87
|
+
|
|
88
|
+
endingPoint?: Date | string | number
|
|
89
|
+
mode?: 'date' | 'numeric'
|
|
90
|
+
|
|
91
|
+
moveTime?: (amount: number) => void
|
|
92
|
+
zoom?: (factor: number) => void
|
|
93
|
+
}>()
|
|
94
|
+
|
|
95
|
+
const emit = defineEmits<{
|
|
96
|
+
(e: 'update:task', payload: { task: IGanttTask; sourceRow: any; targetRow?: any }): void
|
|
97
|
+
(e: 'update:selectedRows', value: any[]): void
|
|
98
|
+
(e: 'update:selectAll', value: boolean): void
|
|
99
|
+
}>()
|
|
100
|
+
|
|
101
|
+
// ── Drag state (owned here so all rows can share it) ─────────────
|
|
102
|
+
interface ActiveDrag {
|
|
103
|
+
taskId: string | number
|
|
104
|
+
task: IGanttTask
|
|
105
|
+
sourceRow: any
|
|
106
|
+
sourceRowId: string | number
|
|
107
|
+
currentHoverRow: any
|
|
108
|
+
mode: 'move' | 'resize-left' | 'resize-right'
|
|
109
|
+
startX: number
|
|
110
|
+
wrapperWidth: number
|
|
111
|
+
originalStartMs: number
|
|
112
|
+
originalEndMs: number
|
|
113
|
+
currentStartMs: number
|
|
114
|
+
currentEndMs: number
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const activeDragState = ref<ActiveDrag | null>(null)
|
|
118
|
+
const scrollContainer = ref<HTMLElement | null>(null)
|
|
119
|
+
|
|
120
|
+
// ── Drag to pan state ─────────────
|
|
121
|
+
const isDraggingGantt = ref(false)
|
|
122
|
+
let ganttDragStartX = 0
|
|
123
|
+
|
|
124
|
+
const onMouseDown = (e: MouseEvent) => {
|
|
125
|
+
// Only initiate drag if left button and target is not a task bar or its resize handles
|
|
126
|
+
if (e.button !== 0) return
|
|
127
|
+
const target = e.target as HTMLElement
|
|
128
|
+
if (target.closest('.gantt-bar')) return
|
|
129
|
+
|
|
130
|
+
// MUST be inside the timeline cell to start panning
|
|
131
|
+
if (!target.closest('[data-field="ganttTimeline"]')) return
|
|
132
|
+
|
|
133
|
+
isDraggingGantt.value = true
|
|
134
|
+
ganttDragStartX = e.clientX
|
|
135
|
+
|
|
136
|
+
window.addEventListener('mousemove', onGanttMouseMove)
|
|
137
|
+
window.addEventListener('mouseup', onGanttMouseUp)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const onGanttMouseMove = (e: MouseEvent) => {
|
|
141
|
+
if (!isDraggingGantt.value) return
|
|
142
|
+
e.preventDefault()
|
|
143
|
+
|
|
144
|
+
const deltaX = e.clientX - ganttDragStartX
|
|
145
|
+
ganttDragStartX = e.clientX
|
|
146
|
+
|
|
147
|
+
if (scrollContainer.value) {
|
|
148
|
+
const wrapperWidth = scrollContainer.value.clientWidth || 1000
|
|
149
|
+
const viewportDuration = props.globalDateRange.end - props.globalDateRange.start
|
|
150
|
+
const msPerPx = viewportDuration / wrapperWidth
|
|
151
|
+
|
|
152
|
+
// If we drag mouse left (deltaX < 0), time moves forward (moveTime > 0)
|
|
153
|
+
props.moveTime?.(-deltaX * msPerPx)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
112
157
|
const onGanttMouseUp = () => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
const onWheel = (e) => {
|
|
118
|
-
const viewportDuration = props.globalDateRange.end - props.globalDateRange.start;
|
|
119
|
-
if (e.ctrlKey) {
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
const factor = e.deltaY > 0 ? -0.1 : 0.1;
|
|
122
|
-
props.zoom?.(factor);
|
|
123
|
-
} else if (e.shiftKey) {
|
|
124
|
-
e.preventDefault();
|
|
125
|
-
const direction = e.deltaY > 0 ? 1 : -1;
|
|
126
|
-
const delta = viewportDuration * 0.1 * direction;
|
|
127
|
-
props.moveTime?.(delta);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
const onTaskDragStart = ({ event, task, rowId, mode, wrapperEl }, row) => {
|
|
131
|
-
console.log("[KGantt] onTaskDragStart called", { editable: props.editable, mode, taskId: task.id, wrapperElFound: !!wrapperEl });
|
|
132
|
-
if (!props.editable) {
|
|
133
|
-
console.warn("[KGantt] ABORT: not editable");
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
event.preventDefault();
|
|
137
|
-
const wrapperRect = wrapperEl?.getBoundingClientRect();
|
|
138
|
-
const wrapperWidth = wrapperRect?.width ?? 1e3;
|
|
139
|
-
const startField = props.resolvedMapping?.startDate ?? "startDate";
|
|
140
|
-
const endField = props.resolvedMapping?.endDate ?? "endDate";
|
|
141
|
-
const originalStartMs = new Date(task[startField]).getTime();
|
|
142
|
-
const originalEndMs = new Date(task[endField]).getTime();
|
|
143
|
-
activeDragState.value = {
|
|
144
|
-
taskId: task.id,
|
|
145
|
-
task,
|
|
146
|
-
sourceRow: row,
|
|
147
|
-
sourceRowId: row?.id,
|
|
148
|
-
currentHoverRow: row,
|
|
149
|
-
mode,
|
|
150
|
-
startX: event.clientX,
|
|
151
|
-
wrapperWidth,
|
|
152
|
-
originalStartMs,
|
|
153
|
-
originalEndMs,
|
|
154
|
-
currentStartMs: originalStartMs,
|
|
155
|
-
currentEndMs: originalEndMs
|
|
156
|
-
};
|
|
157
|
-
window.addEventListener("mousemove", onMouseMove);
|
|
158
|
-
window.addEventListener("mouseup", onMouseUp);
|
|
159
|
-
};
|
|
160
|
-
const onCellMouseEnter = (rowId, row) => {
|
|
161
|
-
if (!activeDragState.value) return;
|
|
162
|
-
if (activeDragState.value.mode === "move") {
|
|
163
|
-
activeDragState.value.currentHoverRow = row;
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
const onMouseMove = (e) => {
|
|
167
|
-
if (!activeDragState.value) return;
|
|
168
|
-
const state = activeDragState.value;
|
|
169
|
-
const msPerPx = (props.globalDateRange.end - props.globalDateRange.start) / state.wrapperWidth;
|
|
170
|
-
const deltaX = e.clientX - state.startX;
|
|
171
|
-
const deltaMs = deltaX * msPerPx;
|
|
172
|
-
const snapMs = getSnapMs(props.snapTo || "day");
|
|
173
|
-
let newStart = state.originalStartMs;
|
|
174
|
-
let newEnd = state.originalEndMs;
|
|
175
|
-
if (state.mode === "move") {
|
|
176
|
-
const snappedDelta = Math.round(deltaMs / snapMs) * snapMs;
|
|
177
|
-
newStart = state.originalStartMs + snappedDelta;
|
|
178
|
-
newEnd = state.originalEndMs + snappedDelta;
|
|
179
|
-
} else if (state.mode === "resize-left") {
|
|
180
|
-
const snappedDelta = Math.round(deltaMs / snapMs) * snapMs;
|
|
181
|
-
newStart = Math.min(state.originalStartMs + snappedDelta, state.originalEndMs - snapMs);
|
|
182
|
-
} else if (state.mode === "resize-right") {
|
|
183
|
-
const snappedDelta = Math.round(deltaMs / snapMs) * snapMs;
|
|
184
|
-
newEnd = Math.max(state.originalEndMs + snappedDelta, state.originalStartMs + snapMs);
|
|
185
|
-
}
|
|
186
|
-
state.currentStartMs = newStart;
|
|
187
|
-
state.currentEndMs = newEnd;
|
|
188
|
-
};
|
|
189
|
-
const onMouseUp = () => {
|
|
190
|
-
window.removeEventListener("mousemove", onMouseMove);
|
|
191
|
-
window.removeEventListener("mouseup", onMouseUp);
|
|
192
|
-
if (!activeDragState.value) {
|
|
193
|
-
console.warn("[KGantt] onMouseUp: no activeDragState");
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
const state = activeDragState.value;
|
|
197
|
-
const startField = props.resolvedMapping?.startDate ?? "startDate";
|
|
198
|
-
const endField = props.resolvedMapping?.endDate ?? "endDate";
|
|
199
|
-
const tasksField = props.resolvedMapping?.tasksField ?? "tasks";
|
|
200
|
-
const updatedTask = {
|
|
201
|
-
...state.task,
|
|
202
|
-
[startField]: state.currentStartMs,
|
|
203
|
-
[endField]: state.currentEndMs
|
|
204
|
-
};
|
|
205
|
-
console.log("[KGantt] onMouseUp", {
|
|
206
|
-
mode: state.mode,
|
|
207
|
-
originalStart: new Date(state.originalStartMs).toISOString(),
|
|
208
|
-
currentStart: new Date(state.currentStartMs).toISOString(),
|
|
209
|
-
sameTime: state.currentStartMs === state.originalStartMs,
|
|
210
|
-
wrapperWidth: state.wrapperWidth
|
|
211
|
-
});
|
|
212
|
-
let targetRow = state.sourceRow;
|
|
213
|
-
if (state.mode === "move" && state.currentHoverRow !== state.sourceRow) {
|
|
214
|
-
const hoverRow = state.currentHoverRow;
|
|
215
|
-
const resourceTypeField = props.resourceTypeField || "type";
|
|
216
|
-
const taskTypeField = props.resolvedMapping?.taskTypeField || "type";
|
|
217
|
-
const taskType = state.task[taskTypeField];
|
|
218
|
-
if (resourceTypeField) {
|
|
219
|
-
const myType = state.sourceRow?.[resourceTypeField];
|
|
220
|
-
const theirType = hoverRow?.[resourceTypeField];
|
|
221
|
-
console.log("[KGantt] cross-row check", { myType, theirType, taskType, taskTypeField });
|
|
222
|
-
if (taskType && theirType && taskType !== theirType) {
|
|
223
|
-
console.warn("[KGantt] CANCEL: task type mismatch with target resource");
|
|
224
|
-
activeDragState.value = null;
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
if (myType && theirType && myType !== theirType) {
|
|
228
|
-
console.warn("[KGantt] CANCEL: resource type mismatch");
|
|
229
|
-
activeDragState.value = null;
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
targetRow = hoverRow;
|
|
234
|
-
}
|
|
235
|
-
const targetTasks = targetRow === state.sourceRow ? props.getTasksForRow(targetRow) : targetRow?.[tasksField] || [];
|
|
236
|
-
const overlapping = isTaskOverlapping(updatedTask, targetTasks, startField, endField);
|
|
237
|
-
console.log("[KGantt] overlap check", {
|
|
238
|
-
updatedTask: { id: updatedTask.id, start: updatedTask[startField], end: updatedTask[endField] },
|
|
239
|
-
targetTaskCount: targetTasks.length,
|
|
240
|
-
overlapping
|
|
241
|
-
});
|
|
242
|
-
if (overlapping) {
|
|
243
|
-
console.warn("[KGantt] CANCEL: overlap detected");
|
|
244
|
-
activeDragState.value = null;
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
console.log("[KGantt] COMMIT: emitting update:task");
|
|
248
|
-
emit("update:task", {
|
|
249
|
-
task: updatedTask,
|
|
250
|
-
sourceRow: state.sourceRow,
|
|
251
|
-
targetRow: targetRow !== state.sourceRow ? targetRow : void 0
|
|
252
|
-
});
|
|
253
|
-
activeDragState.value = null;
|
|
254
|
-
};
|
|
255
|
-
const ganttColumns = computed(() => {
|
|
256
|
-
const cols = props.columns.map((col) => ({ ...col, width: col.width ?? "1%" }));
|
|
257
|
-
cols.push({
|
|
258
|
-
field: "ganttTimeline",
|
|
259
|
-
header: "Timeline",
|
|
260
|
-
width: calculateGanttMinWidth(props.globalDateRange.start, props.globalDateRange.end, 80, props.mode)
|
|
261
|
-
});
|
|
262
|
-
if (props.rowActions && props.rowActions.length > 0) {
|
|
263
|
-
cols.push({
|
|
264
|
-
field: "_ganttActions",
|
|
265
|
-
header: "Actions",
|
|
266
|
-
width: "1%"
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
return cols;
|
|
270
|
-
});
|
|
271
|
-
</script>
|
|
158
|
+
isDraggingGantt.value = false
|
|
159
|
+
window.removeEventListener('mousemove', onGanttMouseMove)
|
|
160
|
+
window.removeEventListener('mouseup', onGanttMouseUp)
|
|
161
|
+
}
|
|
272
162
|
|
|
273
|
-
|
|
274
|
-
.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
163
|
+
const onWheel = (e: WheelEvent) => {
|
|
164
|
+
const viewportDuration = props.globalDateRange.end - props.globalDateRange.start
|
|
165
|
+
|
|
166
|
+
if (e.ctrlKey) {
|
|
167
|
+
// Ctrl + Scroll = Zoom
|
|
168
|
+
e.preventDefault()
|
|
169
|
+
const factor = e.deltaY > 0 ? -0.1 : 0.1
|
|
170
|
+
props.zoom?.(factor)
|
|
171
|
+
} else if (e.shiftKey) {
|
|
172
|
+
// Shift + Scroll = Horizontal Move
|
|
173
|
+
e.preventDefault()
|
|
174
|
+
const direction = e.deltaY > 0 ? 1 : -1
|
|
175
|
+
const delta = viewportDuration * 0.1 * direction
|
|
176
|
+
props.moveTime?.(delta)
|
|
177
|
+
}
|
|
178
|
+
// Let normal scroll through for vertical scrolling
|
|
280
179
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
180
|
+
|
|
181
|
+
const onTaskDragStart = (
|
|
182
|
+
{ event, task, rowId, mode, wrapperEl }: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperEl: HTMLElement | null },
|
|
183
|
+
row: any
|
|
184
|
+
) => {
|
|
185
|
+
console.log('[KGantt] onTaskDragStart called', { editable: props.editable, mode, taskId: task.id, wrapperElFound: !!wrapperEl })
|
|
186
|
+
if (!props.editable) { console.warn('[KGantt] ABORT: not editable'); return }
|
|
187
|
+
event.preventDefault()
|
|
188
|
+
|
|
189
|
+
const wrapperRect = wrapperEl?.getBoundingClientRect()
|
|
190
|
+
const wrapperWidth = wrapperRect?.width ?? 1000
|
|
191
|
+
|
|
192
|
+
const startField = props.resolvedMapping?.startDate ?? 'startDate'
|
|
193
|
+
const endField = props.resolvedMapping?.endDate ?? 'endDate'
|
|
194
|
+
const originalStartMs = new Date(task[startField]).getTime()
|
|
195
|
+
const originalEndMs = new Date(task[endField]).getTime()
|
|
196
|
+
|
|
197
|
+
activeDragState.value = {
|
|
198
|
+
taskId: task.id,
|
|
199
|
+
task,
|
|
200
|
+
sourceRow: row,
|
|
201
|
+
sourceRowId: row?.id,
|
|
202
|
+
currentHoverRow: row,
|
|
203
|
+
mode: mode as ActiveDrag['mode'],
|
|
204
|
+
startX: event.clientX,
|
|
205
|
+
wrapperWidth,
|
|
206
|
+
originalStartMs,
|
|
207
|
+
originalEndMs,
|
|
208
|
+
currentStartMs: originalStartMs,
|
|
209
|
+
currentEndMs: originalEndMs
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
window.addEventListener('mousemove', onMouseMove)
|
|
213
|
+
window.addEventListener('mouseup', onMouseUp)
|
|
287
214
|
}
|
|
288
|
-
|
|
289
|
-
|
|
215
|
+
|
|
216
|
+
const onCellMouseEnter = (rowId: any, row: any) => {
|
|
217
|
+
if (!activeDragState.value) return
|
|
218
|
+
// Track which row the mouse is hovering over during a move drag
|
|
219
|
+
if (activeDragState.value.mode === 'move') {
|
|
220
|
+
activeDragState.value.currentHoverRow = row
|
|
221
|
+
}
|
|
290
222
|
}
|
|
291
|
-
|
|
292
|
-
|
|
223
|
+
|
|
224
|
+
const onMouseMove = (e: MouseEvent) => {
|
|
225
|
+
if (!activeDragState.value) return
|
|
226
|
+
|
|
227
|
+
const state = activeDragState.value
|
|
228
|
+
const msPerPx = (props.globalDateRange.end - props.globalDateRange.start) / state.wrapperWidth
|
|
229
|
+
const deltaX = e.clientX - state.startX
|
|
230
|
+
const deltaMs = deltaX * msPerPx
|
|
231
|
+
const snapMs = getSnapMs(props.snapTo || 'day')
|
|
232
|
+
|
|
233
|
+
let newStart = state.originalStartMs
|
|
234
|
+
let newEnd = state.originalEndMs
|
|
235
|
+
|
|
236
|
+
if (state.mode === 'move') {
|
|
237
|
+
const snappedDelta = Math.round(deltaMs / snapMs) * snapMs
|
|
238
|
+
newStart = state.originalStartMs + snappedDelta
|
|
239
|
+
newEnd = state.originalEndMs + snappedDelta
|
|
240
|
+
} else if (state.mode === 'resize-left') {
|
|
241
|
+
const snappedDelta = Math.round(deltaMs / snapMs) * snapMs
|
|
242
|
+
newStart = Math.min(state.originalStartMs + snappedDelta, state.originalEndMs - snapMs)
|
|
243
|
+
} else if (state.mode === 'resize-right') {
|
|
244
|
+
const snappedDelta = Math.round(deltaMs / snapMs) * snapMs
|
|
245
|
+
newEnd = Math.max(state.originalEndMs + snappedDelta, state.originalStartMs + snapMs)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
state.currentStartMs = newStart
|
|
249
|
+
state.currentEndMs = newEnd
|
|
293
250
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
251
|
+
|
|
252
|
+
const onMouseUp = () => {
|
|
253
|
+
window.removeEventListener('mousemove', onMouseMove)
|
|
254
|
+
window.removeEventListener('mouseup', onMouseUp)
|
|
255
|
+
|
|
256
|
+
if (!activeDragState.value) { console.warn('[KGantt] onMouseUp: no activeDragState'); return }
|
|
257
|
+
|
|
258
|
+
const state = activeDragState.value
|
|
259
|
+
const startField = props.resolvedMapping?.startDate ?? 'startDate'
|
|
260
|
+
const endField = props.resolvedMapping?.endDate ?? 'endDate'
|
|
261
|
+
const tasksField = props.resolvedMapping?.tasksField ?? 'tasks'
|
|
262
|
+
|
|
263
|
+
const updatedTask = {
|
|
264
|
+
...state.task,
|
|
265
|
+
[startField]: state.currentStartMs,
|
|
266
|
+
[endField]: state.currentEndMs
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
console.log('[KGantt] onMouseUp', {
|
|
270
|
+
mode: state.mode,
|
|
271
|
+
originalStart: new Date(state.originalStartMs).toISOString(),
|
|
272
|
+
currentStart: new Date(state.currentStartMs).toISOString(),
|
|
273
|
+
sameTime: state.currentStartMs === state.originalStartMs,
|
|
274
|
+
wrapperWidth: state.wrapperWidth
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
let targetRow = state.sourceRow
|
|
278
|
+
|
|
279
|
+
// Check if the task was moved to a different row
|
|
280
|
+
if (state.mode === 'move' && state.currentHoverRow !== state.sourceRow) {
|
|
281
|
+
const hoverRow = state.currentHoverRow
|
|
282
|
+
|
|
283
|
+
// Enforce resource type compatibility
|
|
284
|
+
const resourceTypeField = props.resourceTypeField || 'type'
|
|
285
|
+
const taskTypeField = props.resolvedMapping?.taskTypeField || 'type'
|
|
286
|
+
const taskType = state.task[taskTypeField]
|
|
287
|
+
|
|
288
|
+
if (resourceTypeField) {
|
|
289
|
+
const myType = state.sourceRow?.[resourceTypeField]
|
|
290
|
+
const theirType = hoverRow?.[resourceTypeField]
|
|
291
|
+
console.log('[KGantt] cross-row check', { myType, theirType, taskType, taskTypeField })
|
|
292
|
+
|
|
293
|
+
// If task has a specific type, it MUST match the target resource type
|
|
294
|
+
if (taskType && theirType && taskType !== theirType) {
|
|
295
|
+
console.warn('[KGantt] CANCEL: task type mismatch with target resource')
|
|
296
|
+
activeDragState.value = null
|
|
297
|
+
return
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Original logic: if source resource has a type, target must match (if resourceTypeField is set)
|
|
301
|
+
// This covers the case where the task doesn't have a type, but we still want to keep it within the same resource group
|
|
302
|
+
if (myType && theirType && myType !== theirType) {
|
|
303
|
+
console.warn('[KGantt] CANCEL: resource type mismatch')
|
|
304
|
+
activeDragState.value = null
|
|
305
|
+
return
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
targetRow = hoverRow
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Overlap check on target row (excluding the task itself)
|
|
313
|
+
const targetTasks: IGanttTask[] = targetRow === state.sourceRow
|
|
314
|
+
? props.getTasksForRow(targetRow)
|
|
315
|
+
: (targetRow?.[tasksField] || [])
|
|
316
|
+
|
|
317
|
+
const overlapping = isTaskOverlapping(updatedTask, targetTasks, startField, endField)
|
|
318
|
+
console.log('[KGantt] overlap check', {
|
|
319
|
+
updatedTask: { id: updatedTask.id, start: updatedTask[startField], end: updatedTask[endField] },
|
|
320
|
+
targetTaskCount: targetTasks.length,
|
|
321
|
+
overlapping
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
if (overlapping) {
|
|
325
|
+
console.warn('[KGantt] CANCEL: overlap detected')
|
|
326
|
+
activeDragState.value = null
|
|
327
|
+
return
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
console.log('[KGantt] COMMIT: emitting update:task')
|
|
331
|
+
emit('update:task', {
|
|
332
|
+
|
|
333
|
+
task: updatedTask,
|
|
334
|
+
sourceRow: state.sourceRow,
|
|
335
|
+
targetRow: targetRow !== state.sourceRow ? targetRow : undefined
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
activeDragState.value = null
|
|
297
339
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
340
|
+
|
|
341
|
+
// User columns shrink to content; timeline fills remaining space
|
|
342
|
+
const ganttColumns = computed(() => {
|
|
343
|
+
const cols = props.columns.map(col => ({ ...col, width: col.width ?? '1%' }))
|
|
344
|
+
|
|
345
|
+
cols.push({
|
|
346
|
+
field: 'ganttTimeline',
|
|
347
|
+
header: 'Timeline',
|
|
348
|
+
width: calculateGanttMinWidth(props.globalDateRange.start, props.globalDateRange.end, 80, props.mode)
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
if (props.rowActions && props.rowActions.length > 0) {
|
|
352
|
+
cols.push({
|
|
353
|
+
field: '_ganttActions',
|
|
354
|
+
header: 'Actions',
|
|
355
|
+
width: '1%'
|
|
356
|
+
})
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return cols
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
</script>
|
|
363
|
+
|
|
364
|
+
<style lang="scss" scoped>
|
|
365
|
+
.KGantt {
|
|
366
|
+
width: 100%;
|
|
367
|
+
height: 100%;
|
|
368
|
+
overflow: hidden;
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-direction: column;
|
|
371
|
+
|
|
372
|
+
&__scroll-container {
|
|
373
|
+
flex: 1;
|
|
374
|
+
width: 100%;
|
|
375
|
+
overflow-x: auto;
|
|
376
|
+
overflow-y: auto;
|
|
377
|
+
cursor: grab;
|
|
378
|
+
|
|
379
|
+
&:active {
|
|
380
|
+
cursor: grabbing;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
&__inner {
|
|
385
|
+
min-width: 100%;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
:deep(th[data-field="ganttTimeline"]),
|
|
389
|
+
:deep(td[data-field="ganttTimeline"]) {
|
|
390
|
+
padding: 0;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.gantt-actions {
|
|
394
|
+
display: flex;
|
|
395
|
+
gap: 8px;
|
|
396
|
+
justify-content: flex-end;
|
|
397
|
+
white-space: nowrap;
|
|
398
|
+
}
|
|
303
399
|
}
|
|
304
400
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ITreeViewColumn
|
|
1
|
+
import type { ITreeViewColumn } from '#toolkit/components/KTreeView/KTreeView.logic';
|
|
2
2
|
import type { IKDatatableAction } from '@katlux/providers';
|
|
3
3
|
import type { IGanttTask } from '#toolkit/components/KGantt/KGantt.logic';
|
|
4
4
|
type __VLS_Props = {
|
|
@@ -6,7 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
columns: ITreeViewColumn[];
|
|
7
7
|
treeColumnIndex?: number;
|
|
8
8
|
bulkActions?: IKDatatableAction[];
|
|
9
|
-
rowActions?:
|
|
9
|
+
rowActions?: IKDatatableAction[];
|
|
10
10
|
globalDateRange: {
|
|
11
11
|
start: number;
|
|
12
12
|
end: number;
|