@katlux/toolkit 0.1.0-beta.8 → 0.1.0-beta.81
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 +5 -1
- package/dist/compiled/composables/usePresetComponent.mjs +32 -21
- package/dist/compiled/utils/PresetResolver.mjs +18 -12
- package/dist/module.cjs +52 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +52 -1
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +11 -12
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +1 -0
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +25 -10
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +30 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +17 -0
- package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +16 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +88 -12
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +19 -4
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +88 -12
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +47 -4
- 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 +104 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +28 -3
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +104 -8
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +48 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +118 -7
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +93 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue +27 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +93 -8
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.d.ts +43 -1
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +168 -7
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +36 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.vue +15 -4
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +36 -0
- package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +58 -1
- package/dist/runtime/components/KDropdown/KDropdown.logic.js +152 -4
- package/dist/runtime/components/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 +51 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue +28 -12
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +51 -1
- 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 +1 -1
- package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.logic.d.ts +1 -1
- package/dist/runtime/components/KIcon/KIcon.logic.js +13 -8
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +31 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue +5 -2
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +31 -1
- 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 +12 -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/KSearchTree/KSearchTree.logic.d.ts +7 -1
- package/dist/runtime/components/KSearchTree/KSearchTree.logic.js +6 -1
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.d.ts +7 -1
- package/dist/runtime/components/KSearchTreeDropdown/KSearchTreeDropdown.logic.js +6 -1
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +9 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue +1 -0
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +9 -0
- package/dist/runtime/components/KSlider/KSlider.logic.d.ts +5 -0
- package/dist/runtime/components/KSlider/KSlider.logic.js +4 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +30 -0
- package/dist/runtime/components/KTextarea/KTextarea.global.vue +4 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +30 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.d.ts +16 -0
- package/dist/runtime/components/KTextarea/KTextarea.logic.js +13 -0
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +44 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -4
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +44 -2
- package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +26 -4
- package/dist/runtime/components/KTextbox/KTextbox.logic.js +25 -5
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +57 -0
- package/dist/runtime/components/KToast/KToast.global.vue +32 -0
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +57 -0
- package/dist/runtime/components/KToast/KToast.logic.d.ts +34 -0
- package/dist/runtime/components/KToast/KToast.logic.js +47 -0
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +31 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue +20 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +31 -1
- package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +25 -2
- package/dist/runtime/components/KTooltip/KTooltip.logic.js +81 -3
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +75 -8
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +16 -3
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +75 -8
- 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/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/usePresetComponent.d.ts +16 -0
- package/dist/runtime/composables/usePresetComponent.js +32 -21
- 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 +40 -37
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +29 -22
- package/dist/runtime/presets/default/components/KButton/KButton.vue +147 -428
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +69 -53
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +195 -161
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +59 -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 +129 -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 +78 -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 +128 -92
- 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 +104 -25
- package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +16 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +337 -241
- 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 +85 -35
- package/dist/runtime/presets/default/components/KModal/KModal.vue.d.ts +2 -0
- package/dist/runtime/presets/default/components/KPagination/KPagination.vue +42 -40
- 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 +46 -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/KSearchTree/KSearchTree.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue +9 -1
- package/dist/runtime/presets/default/components/KSearchTree/KSearchTree.vue.d.ts +4 -1
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.d.vue.ts +4 -1
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue +9 -1
- package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue.d.ts +4 -1
- 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 +105 -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 +110 -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 +70 -3
- package/dist/runtime/presets/default/components/KTooltip/KTooltip.vue.d.ts +14 -1
- package/dist/runtime/presets/default/components/KTree/KTree.vue +103 -80
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.d.vue.ts +7 -0
- package/dist/runtime/presets/default/components/KTreePicker/KTreePicker.vue +92 -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.vue +34 -27
- 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 +6 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KRangeSlider(:class="{ disabled: isDisabled }")
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
3
4
|
.slider-container(@click="handleTrackClick")
|
|
4
5
|
.slider-track
|
|
5
6
|
.slider-range(:style="{ left: minPercent + '%', width: (maxPercent - minPercent) + '%' }")
|
|
@@ -23,134 +24,168 @@
|
|
|
23
24
|
)
|
|
24
25
|
</template>
|
|
25
26
|
|
|
26
|
-
<script setup>
|
|
27
|
-
import { computed } from
|
|
28
|
-
const props = defineProps({
|
|
29
|
-
rangeMin: { type: Number, required: true },
|
|
30
|
-
rangeMax: { type: Number, required: true },
|
|
31
|
-
rangeStep: { type: Number, required: true },
|
|
32
|
-
isDisabled: { type: Boolean, required: true },
|
|
33
|
-
currentMinValue: { type: Number, required: true },
|
|
34
|
-
currentMaxValue: { type: Number, required: true },
|
|
35
|
-
minPercent: { type: Number, required: true },
|
|
36
|
-
maxPercent: { type: Number, required: true }
|
|
37
|
-
});
|
|
38
|
-
const emit = defineEmits(["update:minValue", "update:maxValue"]);
|
|
39
|
-
const updateMinValue = (event) => {
|
|
40
|
-
const value = parseFloat(event.target.value);
|
|
41
|
-
if (value <= props.currentMaxValue) {
|
|
42
|
-
emit("update:minValue", value);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const updateMaxValue = (event) => {
|
|
46
|
-
const value = parseFloat(event.target.value);
|
|
47
|
-
if (value >= props.currentMinValue) {
|
|
48
|
-
emit("update:maxValue", value);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const handleTrackClick = (event) => {
|
|
52
|
-
if (props.isDisabled) return;
|
|
53
|
-
const target = event.currentTarget;
|
|
54
|
-
const rect = target.getBoundingClientRect();
|
|
55
|
-
const clickX = event.clientX - rect.left;
|
|
56
|
-
const percentage = clickX / rect.width;
|
|
57
|
-
const rawValue = props.rangeMin + percentage * (props.rangeMax - props.rangeMin);
|
|
58
|
-
const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep;
|
|
59
|
-
const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue));
|
|
60
|
-
const distanceToMin = Math.abs(value - props.currentMinValue);
|
|
61
|
-
const distanceToMax = Math.abs(value - props.currentMaxValue);
|
|
62
|
-
if (distanceToMin < distanceToMax) {
|
|
63
|
-
if (value <= props.currentMaxValue) {
|
|
64
|
-
emit("update:minValue", value);
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
if (value >= props.currentMinValue) {
|
|
68
|
-
emit("update:maxValue", value);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
</script>
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import { computed } from 'vue'
|
|
73
29
|
|
|
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
|
-
background-color: var(--primary-500);
|
|
99
|
-
border-radius: 3px;
|
|
100
|
-
z-index: 1;
|
|
101
|
-
}
|
|
102
|
-
.KRangeSlider .slider-input {
|
|
103
|
-
position: absolute;
|
|
104
|
-
width: 100%;
|
|
105
|
-
height: 1px;
|
|
106
|
-
background: transparent;
|
|
107
|
-
pointer-events: none;
|
|
108
|
-
-webkit-appearance: none;
|
|
109
|
-
appearance: none;
|
|
110
|
-
}
|
|
111
|
-
.KRangeSlider .slider-input::-webkit-slider-thumb {
|
|
112
|
-
-webkit-appearance: none;
|
|
113
|
-
appearance: none;
|
|
114
|
-
width: 18px;
|
|
115
|
-
height: 18px;
|
|
116
|
-
background-color: var(--primary-500);
|
|
117
|
-
border: 2px solid white;
|
|
118
|
-
border-radius: 50%;
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
pointer-events: auto;
|
|
121
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
122
|
-
transition: transform 0.15s ease;
|
|
123
|
-
}
|
|
124
|
-
.KRangeSlider .slider-input::-webkit-slider-thumb:hover {
|
|
125
|
-
transform: scale(1.15);
|
|
126
|
-
}
|
|
127
|
-
.KRangeSlider .slider-input::-moz-range-thumb {
|
|
128
|
-
width: 18px;
|
|
129
|
-
height: 18px;
|
|
130
|
-
background-color: var(--primary-500);
|
|
131
|
-
border: 2px solid white;
|
|
132
|
-
border-radius: 50%;
|
|
133
|
-
cursor: pointer;
|
|
134
|
-
pointer-events: auto;
|
|
135
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
136
|
-
transition: transform 0.15s ease;
|
|
137
|
-
}
|
|
138
|
-
.KRangeSlider .slider-input::-moz-range-thumb:hover {
|
|
139
|
-
transform: scale(1.15);
|
|
140
|
-
}
|
|
141
|
-
.KRangeSlider .slider-input:disabled {
|
|
142
|
-
cursor: not-allowed;
|
|
143
|
-
}
|
|
144
|
-
.KRangeSlider .slider-input:disabled::-webkit-slider-thumb {
|
|
145
|
-
cursor: not-allowed;
|
|
30
|
+
// Default template for KRangeSlider
|
|
31
|
+
const props = defineProps<{
|
|
32
|
+
label?: string
|
|
33
|
+
rangeMin: number
|
|
34
|
+
rangeMax: number
|
|
35
|
+
rangeStep: number
|
|
36
|
+
isDisabled: boolean
|
|
37
|
+
currentMinValue: number
|
|
38
|
+
currentMaxValue: number
|
|
39
|
+
minPercent: number
|
|
40
|
+
maxPercent: number
|
|
41
|
+
}>()
|
|
42
|
+
|
|
43
|
+
const emit = defineEmits<{
|
|
44
|
+
(e: 'update:minValue', value: number): void
|
|
45
|
+
(e: 'update:maxValue', value: number): void
|
|
46
|
+
}>()
|
|
47
|
+
|
|
48
|
+
const updateMinValue = (event: Event) => {
|
|
49
|
+
const value = parseFloat((event.target as HTMLInputElement).value)
|
|
50
|
+
// Ensure min doesn't exceed max
|
|
51
|
+
if (value <= props.currentMaxValue) {
|
|
52
|
+
emit('update:minValue', value)
|
|
53
|
+
}
|
|
146
54
|
}
|
|
147
|
-
|
|
148
|
-
|
|
55
|
+
|
|
56
|
+
const updateMaxValue = (event: Event) => {
|
|
57
|
+
const value = parseFloat((event.target as HTMLInputElement).value)
|
|
58
|
+
// Ensure max doesn't go below min
|
|
59
|
+
if (value >= props.currentMinValue) {
|
|
60
|
+
emit('update:maxValue', value)
|
|
61
|
+
}
|
|
149
62
|
}
|
|
150
|
-
|
|
151
|
-
|
|
63
|
+
|
|
64
|
+
const handleTrackClick = (event: MouseEvent) => {
|
|
65
|
+
if (props.isDisabled) return
|
|
66
|
+
|
|
67
|
+
const target = event.currentTarget as HTMLElement
|
|
68
|
+
const rect = target.getBoundingClientRect()
|
|
69
|
+
const clickX = event.clientX - rect.left
|
|
70
|
+
const percentage = clickX / rect.width
|
|
71
|
+
const rawValue = props.rangeMin + (percentage * (props.rangeMax - props.rangeMin))
|
|
72
|
+
|
|
73
|
+
// Round to step
|
|
74
|
+
const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep
|
|
75
|
+
const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue))
|
|
76
|
+
|
|
77
|
+
// Determine which handle is closer
|
|
78
|
+
const distanceToMin = Math.abs(value - props.currentMinValue)
|
|
79
|
+
const distanceToMax = Math.abs(value - props.currentMaxValue)
|
|
80
|
+
|
|
81
|
+
if (distanceToMin < distanceToMax) {
|
|
82
|
+
// Move min handle
|
|
83
|
+
if (value <= props.currentMaxValue) {
|
|
84
|
+
emit('update:minValue', value)
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
// Move max handle
|
|
88
|
+
if (value >= props.currentMinValue) {
|
|
89
|
+
emit('update:maxValue', value)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
152
92
|
}
|
|
153
|
-
|
|
154
|
-
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style lang="scss" scoped>
|
|
96
|
+
.KRangeSlider {
|
|
97
|
+
position: relative;
|
|
98
|
+
padding: 20px 0;
|
|
99
|
+
|
|
100
|
+
&.disabled {
|
|
101
|
+
opacity: 0.5;
|
|
102
|
+
cursor: not-allowed;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.slider-container {
|
|
106
|
+
position: relative;
|
|
107
|
+
height: 6px;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.slider-track {
|
|
112
|
+
position: absolute;
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 6px;
|
|
115
|
+
background-color: var(--neutral-200);
|
|
116
|
+
border-radius: 3px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.slider-range {
|
|
120
|
+
position: absolute;
|
|
121
|
+
height: 6px;
|
|
122
|
+
background-color: var(--primary-500);
|
|
123
|
+
border-radius: 3px;
|
|
124
|
+
z-index: 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.slider-input {
|
|
128
|
+
position: absolute;
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: 1px;
|
|
131
|
+
background: transparent;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
-webkit-appearance: none;
|
|
134
|
+
appearance: none;
|
|
135
|
+
|
|
136
|
+
&::-webkit-slider-thumb {
|
|
137
|
+
-webkit-appearance: none;
|
|
138
|
+
appearance: none;
|
|
139
|
+
width: 18px;
|
|
140
|
+
height: 18px;
|
|
141
|
+
background-color: var(--primary-500);
|
|
142
|
+
border: 2px solid white;
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
pointer-events: auto;
|
|
146
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
147
|
+
transition: transform 0.15s ease;
|
|
148
|
+
|
|
149
|
+
&:hover {
|
|
150
|
+
transform: scale(1.15);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&::-moz-range-thumb {
|
|
155
|
+
width: 18px;
|
|
156
|
+
height: 18px;
|
|
157
|
+
background-color: var(--primary-500);
|
|
158
|
+
border: 2px solid white;
|
|
159
|
+
border-radius: 50%;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
pointer-events: auto;
|
|
162
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
163
|
+
transition: transform 0.15s ease;
|
|
164
|
+
|
|
165
|
+
&:hover {
|
|
166
|
+
transform: scale(1.15);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&:disabled {
|
|
171
|
+
cursor: not-allowed;
|
|
172
|
+
|
|
173
|
+
&::-webkit-slider-thumb {
|
|
174
|
+
cursor: not-allowed;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&::-moz-range-thumb {
|
|
178
|
+
cursor: not-allowed;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.slider-min {
|
|
184
|
+
z-index: 3;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.slider-max {
|
|
188
|
+
z-index: 4;
|
|
189
|
+
}
|
|
155
190
|
}
|
|
156
191
|
</style>
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
5
|
declare const _default: typeof __VLS_export;
|
|
3
6
|
export default _default;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KSearchTree
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
3
4
|
// Impl
|
|
4
5
|
</template>
|
|
5
|
-
<script lang="ts" setup
|
|
6
|
+
<script lang="ts" setup>
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
label?: string
|
|
9
|
+
}>()
|
|
10
|
+
</script>
|
|
11
|
+
<style lang="scss">
|
|
12
|
+
|
|
13
|
+
</style>
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
5
|
declare const _default: typeof __VLS_export;
|
|
3
6
|
export default _default;
|
package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.d.vue.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
5
|
declare const _default: typeof __VLS_export;
|
|
3
6
|
export default _default;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KSearchTreeDropdown
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
3
4
|
// Impl
|
|
4
5
|
</template>
|
|
5
|
-
<script lang="ts" setup
|
|
6
|
+
<script lang="ts" setup>
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
label?: string
|
|
9
|
+
}>()
|
|
10
|
+
</script>
|
|
11
|
+
<style lang="scss">
|
|
12
|
+
|
|
13
|
+
</style>
|
package/dist/runtime/presets/default/components/KSearchTreeDropdown/KSearchTreeDropdown.vue.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
5
|
declare const _default: typeof __VLS_export;
|
|
3
6
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KSlider(:class="{ disabled: isDisabled }")
|
|
3
|
+
label.k-input-label(v-if="label") {{ label }}
|
|
3
4
|
.slider-container(@click="handleTrackClick")
|
|
4
5
|
.slider-track
|
|
5
6
|
.slider-fill(:style="{ width: valuePercent + '%' }")
|
|
@@ -14,108 +15,132 @@
|
|
|
14
15
|
)
|
|
15
16
|
</template>
|
|
16
17
|
|
|
17
|
-
<script setup>
|
|
18
|
-
import { computed } from
|
|
19
|
-
const props = defineProps({
|
|
20
|
-
rangeMin: { type: Number, required: true },
|
|
21
|
-
rangeMax: { type: Number, required: true },
|
|
22
|
-
rangeStep: { type: Number, required: true },
|
|
23
|
-
isDisabled: { type: Boolean, required: true },
|
|
24
|
-
currentValue: { type: Number, required: true },
|
|
25
|
-
valuePercent: { type: Number, required: true }
|
|
26
|
-
});
|
|
27
|
-
const emit = defineEmits(["update:value"]);
|
|
28
|
-
const updateValue = (event) => {
|
|
29
|
-
const value = parseFloat(event.target.value);
|
|
30
|
-
emit("update:value", value);
|
|
31
|
-
};
|
|
32
|
-
const handleTrackClick = (event) => {
|
|
33
|
-
if (props.isDisabled) return;
|
|
34
|
-
const target = event.currentTarget;
|
|
35
|
-
const rect = target.getBoundingClientRect();
|
|
36
|
-
const clickX = event.clientX - rect.left;
|
|
37
|
-
const percentage = clickX / rect.width;
|
|
38
|
-
const rawValue = props.rangeMin + percentage * (props.rangeMax - props.rangeMin);
|
|
39
|
-
const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep;
|
|
40
|
-
const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue));
|
|
41
|
-
emit("update:value", value);
|
|
42
|
-
};
|
|
43
|
-
</script>
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { computed } from 'vue'
|
|
44
20
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
background-color: var(--neutral-200);
|
|
64
|
-
border-radius: 3px;
|
|
65
|
-
}
|
|
66
|
-
.KSlider .slider-fill {
|
|
67
|
-
position: absolute;
|
|
68
|
-
height: 6px;
|
|
69
|
-
background-color: var(--primary-500);
|
|
70
|
-
border-radius: 3px;
|
|
71
|
-
z-index: 1;
|
|
72
|
-
}
|
|
73
|
-
.KSlider .slider-input {
|
|
74
|
-
position: absolute;
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: 1px;
|
|
77
|
-
background: transparent;
|
|
78
|
-
pointer-events: none;
|
|
79
|
-
-webkit-appearance: none;
|
|
80
|
-
appearance: none;
|
|
81
|
-
}
|
|
82
|
-
.KSlider .slider-input::-webkit-slider-thumb {
|
|
83
|
-
-webkit-appearance: none;
|
|
84
|
-
appearance: none;
|
|
85
|
-
width: 18px;
|
|
86
|
-
height: 18px;
|
|
87
|
-
background-color: var(--primary-500);
|
|
88
|
-
border: 2px solid white;
|
|
89
|
-
border-radius: 50%;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
pointer-events: auto;
|
|
92
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
93
|
-
transition: transform 0.15s ease;
|
|
94
|
-
}
|
|
95
|
-
.KSlider .slider-input::-webkit-slider-thumb:hover {
|
|
96
|
-
transform: scale(1.15);
|
|
97
|
-
}
|
|
98
|
-
.KSlider .slider-input::-moz-range-thumb {
|
|
99
|
-
width: 18px;
|
|
100
|
-
height: 18px;
|
|
101
|
-
background-color: var(--primary-500);
|
|
102
|
-
border: 2px solid white;
|
|
103
|
-
border-radius: 50%;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
pointer-events: auto;
|
|
106
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
107
|
-
transition: transform 0.15s ease;
|
|
108
|
-
}
|
|
109
|
-
.KSlider .slider-input::-moz-range-thumb:hover {
|
|
110
|
-
transform: scale(1.15);
|
|
111
|
-
}
|
|
112
|
-
.KSlider .slider-input:disabled {
|
|
113
|
-
cursor: not-allowed;
|
|
21
|
+
// Default template for KSlider
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
label?: string
|
|
24
|
+
rangeMin: number
|
|
25
|
+
rangeMax: number
|
|
26
|
+
rangeStep: number
|
|
27
|
+
isDisabled: boolean
|
|
28
|
+
currentValue: number
|
|
29
|
+
valuePercent: number
|
|
30
|
+
}>()
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits<{
|
|
33
|
+
(e: 'update:value', value: number): void
|
|
34
|
+
}>()
|
|
35
|
+
|
|
36
|
+
const updateValue = (event: Event) => {
|
|
37
|
+
const value = parseFloat((event.target as HTMLInputElement).value)
|
|
38
|
+
emit('update:value', value)
|
|
114
39
|
}
|
|
115
|
-
|
|
116
|
-
|
|
40
|
+
|
|
41
|
+
const handleTrackClick = (event: MouseEvent) => {
|
|
42
|
+
if (props.isDisabled) return
|
|
43
|
+
|
|
44
|
+
const target = event.currentTarget as HTMLElement
|
|
45
|
+
const rect = target.getBoundingClientRect()
|
|
46
|
+
const clickX = event.clientX - rect.left
|
|
47
|
+
const percentage = clickX / rect.width
|
|
48
|
+
const rawValue = props.rangeMin + (percentage * (props.rangeMax - props.rangeMin))
|
|
49
|
+
|
|
50
|
+
// Round to step
|
|
51
|
+
const steppedValue = Math.round(rawValue / props.rangeStep) * props.rangeStep
|
|
52
|
+
const value = Math.max(props.rangeMin, Math.min(props.rangeMax, steppedValue))
|
|
53
|
+
|
|
54
|
+
emit('update:value', value)
|
|
117
55
|
}
|
|
118
|
-
|
|
119
|
-
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style lang="scss" scoped>
|
|
59
|
+
.KSlider {
|
|
60
|
+
position: relative;
|
|
61
|
+
padding: 20px 0;
|
|
62
|
+
|
|
63
|
+
&.disabled {
|
|
64
|
+
opacity: 0.5;
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.slider-container {
|
|
69
|
+
position: relative;
|
|
70
|
+
height: 6px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.slider-track {
|
|
75
|
+
position: absolute;
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 6px;
|
|
78
|
+
background-color: var(--neutral-200);
|
|
79
|
+
border-radius: 3px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.slider-fill {
|
|
83
|
+
position: absolute;
|
|
84
|
+
height: 6px;
|
|
85
|
+
background-color: var(--primary-500);
|
|
86
|
+
border-radius: 3px;
|
|
87
|
+
z-index: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.slider-input {
|
|
91
|
+
position: absolute;
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 1px;
|
|
94
|
+
background: transparent;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
-webkit-appearance: none;
|
|
97
|
+
appearance: none;
|
|
98
|
+
|
|
99
|
+
&::-webkit-slider-thumb {
|
|
100
|
+
-webkit-appearance: none;
|
|
101
|
+
appearance: none;
|
|
102
|
+
width: 18px;
|
|
103
|
+
height: 18px;
|
|
104
|
+
background-color: var(--primary-500);
|
|
105
|
+
border: 2px solid white;
|
|
106
|
+
border-radius: 50%;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
pointer-events: auto;
|
|
109
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
110
|
+
transition: transform 0.15s ease;
|
|
111
|
+
|
|
112
|
+
&:hover {
|
|
113
|
+
transform: scale(1.15);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&::-moz-range-thumb {
|
|
118
|
+
width: 18px;
|
|
119
|
+
height: 18px;
|
|
120
|
+
background-color: var(--primary-500);
|
|
121
|
+
border: 2px solid white;
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
pointer-events: auto;
|
|
125
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
126
|
+
transition: transform 0.15s ease;
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
transform: scale(1.15);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&:disabled {
|
|
134
|
+
cursor: not-allowed;
|
|
135
|
+
|
|
136
|
+
&::-webkit-slider-thumb {
|
|
137
|
+
cursor: not-allowed;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&::-moz-range-thumb {
|
|
141
|
+
cursor: not-allowed;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
120
145
|
}
|
|
121
146
|
</style>
|