ep-craft 0.1.34 → 0.1.35
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/components/carousel/EpCarousel.vue.d.ts +39 -0
- package/dist/components/carousel/EpCarousel.vue.js +227 -0
- package/dist/components/carousel/EpCarousel2.vue.js +4 -0
- package/dist/components/carousel/carousel.d.ts +86 -0
- package/dist/components/carousel/carousel.js +113 -0
- package/dist/components/carousel/constants.d.ts +32 -0
- package/dist/components/carousel/constants.js +5 -0
- package/dist/components/carousel/index.d.ts +28 -2
- package/dist/components/carousel/index.js +11 -4
- package/dist/components/carousel/instance.d.ts +8 -0
- package/dist/components/carousel/use-carousel.d.ts +41 -0
- package/dist/components/carousel/use-carousel.js +200 -0
- package/dist/components/carousel-item/EpCarouselItem.vue.d.ts +16 -0
- package/dist/components/carousel-item/EpCarouselItem.vue.js +74 -0
- package/dist/components/carousel-item/EpCarouselItem2.vue.js +4 -0
- package/dist/components/carousel-item/carousel-item.d.ts +22 -0
- package/dist/components/carousel-item/carousel-item.js +22 -0
- package/dist/components/carousel-item/index.d.ts +14 -2
- package/dist/components/carousel-item/index.js +9 -4
- package/dist/components/carousel-item/use-carousel-item.d.ts +14 -0
- package/dist/components/carousel-item/use-carousel-item.js +79 -0
- package/dist/components/cascader/EpCascader.vue.d.ts +232 -0
- package/dist/components/cascader/EpCascader.vue.js +757 -0
- package/dist/components/cascader/EpCascader2.vue.js +4 -0
- package/dist/components/cascader/cascader.d.ts +313 -0
- package/dist/components/cascader/cascader.js +210 -0
- package/dist/components/cascader/index.d.ts +17 -2
- package/dist/components/cascader/index.js +9 -3
- package/dist/components/cascader/instances.d.ts +2 -0
- package/dist/components/cascader-panel/EpCascaderMenu.vue.d.ts +32 -0
- package/dist/components/cascader-panel/EpCascaderMenu.vue.js +204 -0
- package/dist/components/cascader-panel/EpCascaderMenu2.vue.js +4 -0
- package/dist/components/cascader-panel/EpCascaderNode.vue.d.ts +11 -0
- package/dist/components/cascader-panel/EpCascaderNode.vue.js +134 -0
- package/dist/components/cascader-panel/EpCascaderNode2.vue.js +4 -0
- package/dist/components/cascader-panel/EpCascaderPanel.vue.d.ts +290 -0
- package/dist/components/cascader-panel/EpCascaderPanel.vue.js +266 -0
- package/dist/components/cascader-panel/EpCascaderPanel2.vue.js +4 -0
- package/dist/components/cascader-panel/config.d.ts +102 -0
- package/dist/components/cascader-panel/config.js +136 -0
- package/dist/components/cascader-panel/index.d.ts +17 -2
- package/dist/components/cascader-panel/index.js +21 -4
- package/dist/components/cascader-panel/instance.d.ts +4 -0
- package/dist/components/cascader-panel/node-content.d.ts +14 -0
- package/dist/components/cascader-panel/node-content.js +50 -0
- package/dist/components/cascader-panel/node.d.ts +50 -0
- package/dist/components/cascader-panel/node.js +75 -0
- package/dist/components/cascader-panel/store.d.ts +17 -0
- package/dist/components/cascader-panel/store.js +49 -0
- package/dist/components/cascader-panel/types.d.ts +64 -0
- package/dist/components/cascader-panel/types.js +4 -0
- package/dist/components/cascader-panel/utils.d.ts +4 -0
- package/dist/components/cascader-panel/utils.js +26 -0
- package/dist/components/checkbox/EpCheckbox.vue.d.ts +1 -1
- package/dist/components/checkbox-button/EpCheckboxButton.vue.d.ts +1 -1
- package/dist/components/checkbox-group/index.js +4 -3
- package/dist/components/collapse-transition/index.js +4 -3
- package/dist/components/color-picker/EpColorPicker.vue.d.ts +53 -0
- package/dist/components/color-picker/EpColorPicker.vue.js +318 -0
- package/dist/components/color-picker/EpColorPicker2.vue.js +4 -0
- package/dist/components/color-picker/color-picker.d.ts +240 -0
- package/dist/components/color-picker/color-picker.js +124 -0
- package/dist/components/color-picker/index.d.ts +16 -2
- package/dist/components/color-picker/index.js +11 -4
- package/dist/components/color-picker-panel/EpColorPickerPanel.vue.d.ts +413 -0
- package/dist/components/color-picker-panel/EpColorPickerPanel.vue.js +142 -0
- package/dist/components/color-picker-panel/EpColorPickerPanel2.vue.js +4 -0
- package/dist/components/color-picker-panel/color-picker-panel.d.ts +91 -0
- package/dist/components/color-picker-panel/color-picker-panel.js +71 -0
- package/dist/components/color-picker-panel/components/EpAlphaSlider.vue.d.ts +19 -0
- package/dist/components/color-picker-panel/components/EpAlphaSlider.vue.js +92 -0
- package/dist/components/color-picker-panel/components/EpAlphaSlider2.vue.js +4 -0
- package/dist/components/color-picker-panel/components/EpHueSlider.vue.d.ts +20 -0
- package/dist/components/color-picker-panel/components/EpHueSlider.vue.js +84 -0
- package/dist/components/color-picker-panel/components/EpHueSlider2.vue.js +4 -0
- package/dist/components/color-picker-panel/components/EpPredefine.vue.d.ts +3 -0
- package/dist/components/color-picker-panel/components/EpPredefine.vue.js +39 -0
- package/dist/components/color-picker-panel/components/EpPredefine2.vue.js +4 -0
- package/dist/components/color-picker-panel/components/EpSvPanel.vue.d.ts +8 -0
- package/dist/components/color-picker-panel/components/EpSvPanel.vue.js +67 -0
- package/dist/components/color-picker-panel/components/EpSvPanel2.vue.js +4 -0
- package/dist/components/color-picker-panel/composables/use-common-color.d.ts +11 -0
- package/dist/components/color-picker-panel/composables/use-common-color.js +23 -0
- package/dist/components/color-picker-panel/composables/use-predefine.d.ts +14 -0
- package/dist/components/color-picker-panel/composables/use-predefine.js +66 -0
- package/dist/components/color-picker-panel/composables/use-slider.d.ts +35 -0
- package/dist/components/color-picker-panel/composables/use-slider.js +152 -0
- package/dist/components/color-picker-panel/composables/use-sv-panel.d.ts +25 -0
- package/dist/components/color-picker-panel/composables/use-sv-panel.js +123 -0
- package/dist/components/color-picker-panel/index.d.ts +4 -0
- package/dist/components/color-picker-panel/props/predefine.d.ts +36 -0
- package/dist/components/color-picker-panel/props/slider.d.ts +39 -0
- package/dist/components/color-picker-panel/props/sv-panel.d.ts +22 -0
- package/dist/components/color-picker-panel/utils/color.d.ts +28 -0
- package/dist/components/color-picker-panel/utils/color.js +62 -0
- package/dist/components/color-picker-panel/utils/draggable.d.ts +6 -0
- package/dist/components/color-picker-panel/utils/draggable.js +23 -0
- package/dist/components/descriptions/EpDescriptions.vue.d.ts +20 -0
- package/dist/components/descriptions/EpDescriptions.vue.js +100 -0
- package/dist/components/descriptions/EpDescriptions2.vue.js +4 -0
- package/dist/components/descriptions/EpDescriptionsRow.vue.d.ts +5 -0
- package/dist/components/descriptions/EpDescriptionsRow.vue.js +56 -0
- package/dist/components/descriptions/EpDescriptionsRow2.vue.js +4 -0
- package/dist/components/descriptions/constants.d.ts +1 -0
- package/dist/components/descriptions/constants.js +4 -0
- package/dist/components/descriptions/description.d.ts +66 -0
- package/dist/components/descriptions/description.js +61 -0
- package/dist/components/descriptions/descriptions-cell.d.ts +31 -0
- package/dist/components/descriptions/descriptions-cell.js +133 -0
- package/dist/components/descriptions/descriptions-row.d.ts +10 -0
- package/dist/components/descriptions/descriptions.type.d.ts +29 -0
- package/dist/components/descriptions/index.d.ts +22 -2
- package/dist/components/descriptions/index.js +9 -3
- package/dist/components/descriptions/token.d.ts +3 -0
- package/dist/components/descriptions/token.js +4 -0
- package/dist/components/descriptions-item/description-item.d.ts +84 -0
- package/dist/components/descriptions-item/description-item.js +87 -0
- package/dist/components/descriptions-item/index.d.ts +14 -2
- package/dist/components/descriptions-item/index.js +6 -4
- package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +1 -1
- package/dist/components/dropdown/src/dropdown-item2.vue.js +1 -1
- package/dist/components/dropdown/src/dropdown-menu2.vue.js +1 -1
- package/dist/components/dropdown/src/dropdown2.vue.js +1 -1
- package/dist/components/input-number/index.js +3 -2
- package/dist/components/mention/EpMention.vue.d.ts +430 -0
- package/dist/components/mention/EpMention.vue.js +303 -0
- package/dist/components/mention/EpMention2.vue.js +4 -0
- package/dist/components/mention/EpMentionDropdown.vue.d.ts +34 -0
- package/dist/components/mention/EpMentionDropdown.vue.js +140 -0
- package/dist/components/mention/EpMentionDropdown2.vue.js +4 -0
- package/dist/components/mention/helper.d.ts +32 -0
- package/dist/components/mention/helper.js +112 -0
- package/dist/components/mention/index.d.ts +13 -2
- package/dist/components/mention/index.js +11 -4
- package/dist/components/mention/mention-dropdown.d.ts +21 -0
- package/dist/components/mention/mention-dropdown.js +22 -0
- package/dist/components/mention/mention.d.ts +313 -0
- package/dist/components/mention/mention.js +123 -0
- package/dist/components/mention/types.d.ts +19 -0
- package/dist/components/radio/index.js +4 -3
- package/dist/components/rate/EpRate.vue.d.ts +32 -0
- package/dist/components/rate/EpRate.vue.js +229 -0
- package/dist/components/rate/EpRate2.vue.js +4 -0
- package/dist/components/rate/index.d.ts +15 -2
- package/dist/components/rate/index.js +7 -4
- package/dist/components/rate/rate.d.ts +131 -0
- package/dist/components/rate/rate.js +158 -0
- package/dist/components/roving-focus-group/index.js +1 -1
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +76 -18
- package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +18 -76
- package/dist/components/segmented/EpSegmented.vue.d.ts +22 -0
- package/dist/components/segmented/EpSegmented.vue.js +136 -0
- package/dist/components/segmented/EpSegmented2.vue.js +4 -0
- package/dist/components/segmented/index.d.ts +14 -2
- package/dist/components/segmented/index.js +11 -4
- package/dist/components/segmented/segmented.d.ts +85 -0
- package/dist/components/segmented/segmented.js +85 -0
- package/dist/components/segmented/types.d.ts +1 -0
- package/dist/components/select/index.d.ts +4 -2
- package/dist/components/select/index.js +3 -2
- package/dist/components/select/select2.vue.js +60 -61
- package/dist/components/select-v2/src/select.vue.d.ts +1 -1
- package/dist/components/slider/EpSlider.vue.d.ts +175 -0
- package/dist/components/slider/EpSlider.vue.js +211 -0
- package/dist/components/slider/EpSlider2.vue.js +4 -0
- package/dist/components/slider/EpSliderButton.vue.d.ts +26 -0
- package/dist/components/slider/EpSliderButton.vue.js +103 -0
- package/dist/components/slider/EpSliderButton2.vue.js +4 -0
- package/dist/components/slider/button.d.ts +28 -0
- package/dist/components/slider/button.js +28 -0
- package/dist/components/slider/composables/index.d.ts +7 -0
- package/dist/components/slider/composables/use-lifecycle.d.ts +4 -0
- package/dist/components/slider/composables/use-lifecycle.js +20 -0
- package/dist/components/slider/composables/use-marks.d.ts +7 -0
- package/dist/components/slider/composables/use-marks.js +30 -0
- package/dist/components/slider/composables/use-slide.d.ts +23 -0
- package/dist/components/slider/composables/use-slide.js +92 -0
- package/dist/components/slider/composables/use-slider-button.d.ts +18 -0
- package/dist/components/slider/composables/use-slider-button.js +179 -0
- package/dist/components/slider/composables/use-stops.d.ts +8 -0
- package/dist/components/slider/composables/use-stops.js +23 -0
- package/dist/components/slider/composables/use-watch.d.ts +4 -0
- package/dist/components/slider/composables/use-watch.js +42 -0
- package/dist/components/slider/constants.d.ts +17 -0
- package/dist/components/slider/constants.js +4 -0
- package/dist/components/slider/index.d.ts +18 -2
- package/dist/components/slider/index.js +10 -4
- package/dist/components/slider/marker.d.ts +64 -0
- package/dist/components/slider/marker.js +40 -0
- package/dist/components/slider/slider.d.ts +80 -0
- package/dist/components/slider/slider.js +170 -0
- package/dist/components/step/EpStep.vue.d.ts +38 -0
- package/dist/components/step/EpStep.vue.js +157 -0
- package/dist/components/step/EpStep2.vue.js +4 -0
- package/dist/components/step/index.d.ts +12 -2
- package/dist/components/step/index.js +8 -3
- package/dist/components/step/step.d.ts +42 -0
- package/dist/components/step/step.js +39 -0
- package/dist/components/steps/EpSteps.vue.d.ts +23 -0
- package/dist/components/steps/EpSteps.vue.js +57 -0
- package/dist/components/steps/EpSteps2.vue.js +4 -0
- package/dist/components/steps/index.d.ts +20 -2
- package/dist/components/steps/index.js +8 -4
- package/dist/components/steps/steps.d.ts +69 -0
- package/dist/components/steps/steps.js +66 -0
- package/dist/components/steps/tokens.d.ts +1 -0
- package/dist/components/steps/tokens.js +4 -0
- package/dist/components/switch/EpSwitch.vue.d.ts +50 -0
- package/dist/components/switch/EpSwitch.vue.js +251 -0
- package/dist/components/switch/EpSwitch2.vue.js +4 -0
- package/dist/components/switch/index.d.ts +15 -2
- package/dist/components/switch/index.js +10 -4
- package/dist/components/switch/switch.d.ts +157 -0
- package/dist/components/switch/switch.js +145 -0
- package/dist/components/table/src/filter-panel.vue.d.ts +3 -3
- package/dist/components/table/src/table-header/index.d.ts +3 -3
- package/dist/components/text/index.d.ts +4 -2
- package/dist/components/text/index.js +7 -4
- package/dist/components/text/src/text.d.ts +43 -0
- package/dist/components/text/src/text.js +45 -0
- package/dist/components/text/src/text.vue.d.ts +17 -0
- package/dist/components/text/src/text.vue.js +63 -0
- package/dist/components/text/src/text2.vue.js +4 -0
- package/dist/components/time-select/EpTimeSelect.vue.d.ts +38 -0
- package/dist/components/time-select/EpTimeSelect.vue.js +154 -0
- package/dist/components/time-select/EpTimeSelect2.vue.js +4 -0
- package/dist/components/time-select/index.d.ts +17 -2
- package/dist/components/time-select/index.js +12 -4
- package/dist/components/time-select/time-select.d.ts +143 -0
- package/dist/components/time-select/time-select.js +139 -0
- package/dist/components/time-select/utils.d.ts +11 -0
- package/dist/components/time-select/utils.js +39 -0
- package/dist/components/tour/EpTour.vue.d.ts +40 -0
- package/dist/components/tour/EpTour.vue.js +174 -0
- package/dist/components/tour/EpTour2.vue.js +4 -0
- package/dist/components/tour/EpTourContent.vue.d.ts +23 -0
- package/dist/components/tour/EpTourContent.vue.js +72 -0
- package/dist/components/tour/EpTourContent2.vue.js +4 -0
- package/dist/components/tour/EpTourMask.vue.d.ts +7 -0
- package/dist/components/tour/EpTourMask.vue.js +76 -0
- package/dist/components/tour/EpTourMask2.vue.js +4 -0
- package/dist/components/tour/constants.d.ts +10 -0
- package/dist/components/tour/constants.js +4 -0
- package/dist/components/tour/content.d.ts +49 -0
- package/dist/components/tour/content.js +70 -0
- package/dist/components/tour/helper.d.ts +36 -0
- package/dist/components/tour/helper.js +161 -0
- package/dist/components/tour/index.d.ts +28 -2
- package/dist/components/tour/index.js +19 -4
- package/dist/components/tour/mask.d.ts +43 -0
- package/dist/components/tour/steps.d.ts +19 -0
- package/dist/components/tour/steps.js +35 -0
- package/dist/components/tour/tour.d.ts +136 -0
- package/dist/components/tour/tour.js +120 -0
- package/dist/components/tour/types.d.ts +21 -0
- package/dist/components/tour-step/EpTourStep.vue.d.ts +25 -0
- package/dist/components/tour-step/EpTourStep.vue.js +179 -0
- package/dist/components/tour-step/EpTourStep2.vue.js +4 -0
- package/dist/components/tour-step/index.d.ts +13 -2
- package/dist/components/tour-step/index.js +10 -4
- package/dist/components/tour-step/step.d.ts +120 -0
- package/dist/components/tour-step/step.js +91 -0
- package/dist/components/transfer/EpTransfer.vue.d.ts +36 -0
- package/dist/components/transfer/EpTransfer.vue.js +195 -0
- package/dist/components/transfer/EpTransfer2.vue.js +4 -0
- package/dist/components/transfer/EpTransferPanel.vue.d.ts +24 -0
- package/dist/components/transfer/EpTransferPanel.vue.js +191 -0
- package/dist/components/transfer/EpTransferPanel2.vue.js +4 -0
- package/dist/components/transfer/composables/index.d.ts +5 -0
- package/dist/components/transfer/composables/use-check.d.ts +286 -0
- package/dist/components/transfer/composables/use-check.js +89 -0
- package/dist/components/transfer/composables/use-checked-change.d.ts +6 -0
- package/dist/components/transfer/composables/use-checked-change.js +12 -0
- package/dist/components/transfer/composables/use-computed-data.d.ts +5 -0
- package/dist/components/transfer/composables/use-computed-data.js +26 -0
- package/dist/components/transfer/composables/use-move.d.ts +6 -0
- package/dist/components/transfer/composables/use-move.js +27 -0
- package/dist/components/transfer/composables/use-props-alias.d.ts +8 -0
- package/dist/components/transfer/composables/use-props-alias.js +15 -0
- package/dist/components/transfer/index.d.ts +19 -2
- package/dist/components/transfer/index.js +13 -4
- package/dist/components/transfer/transfer-panel.d.ts +63 -0
- package/dist/components/transfer/transfer-panel.js +32 -0
- package/dist/components/transfer/transfer.d.ts +136 -0
- package/dist/components/transfer/transfer.js +130 -0
- package/dist/components/tree/index.d.ts +7 -2
- package/dist/components/tree/index.js +8 -4
- package/dist/components/tree/src/instance.d.ts +2 -0
- package/dist/components/tree/src/model/node.d.ts +63 -0
- package/dist/components/tree/src/model/node.js +263 -0
- package/dist/components/tree/src/model/tree-store.d.ts +51 -0
- package/dist/components/tree/src/model/tree-store.js +223 -0
- package/dist/components/tree/src/model/useDragNode.d.ts +459 -0
- package/dist/components/tree/src/model/useDragNode.js +98 -0
- package/dist/components/tree/src/model/useKeydown.d.ts +7 -0
- package/dist/components/tree/src/model/useKeydown.js +93 -0
- package/dist/components/tree/src/model/useNodeExpandEventBroadcast.d.ts +9 -0
- package/dist/components/tree/src/model/useNodeExpandEventBroadcast.js +27 -0
- package/dist/components/tree/src/model/util.d.ts +7 -0
- package/dist/components/tree/src/model/util.js +19 -0
- package/dist/components/tree/src/tokens.d.ts +3 -0
- package/dist/components/tree/src/tokens.js +6 -0
- package/dist/components/tree/src/tree-node-content.vue.d.ts +14 -0
- package/dist/components/tree/src/tree-node-content.vue.js +43 -0
- package/dist/components/tree/src/tree-node-content2.vue.js +4 -0
- package/dist/components/tree/src/tree-node.vue.d.ts +377 -0
- package/dist/components/tree/src/tree-node.vue.js +108 -0
- package/dist/components/tree/src/tree-node2.vue.js +166 -0
- package/dist/components/tree/src/tree.d.ts +103 -0
- package/dist/components/tree/src/tree.js +99 -0
- package/dist/components/tree/src/tree.type.d.ts +112 -0
- package/dist/components/tree/src/tree.vue.d.ts +1745 -0
- package/dist/components/tree/src/tree.vue.js +48 -0
- package/dist/components/tree/src/tree2.vue.js +192 -0
- package/dist/components/tree-select/index.d.ts +3 -2
- package/dist/components/tree-select/index.js +7 -4
- package/dist/components/tree-select/src/cache-options.d.ts +20 -0
- package/dist/components/tree-select/src/cache-options.js +36 -0
- package/dist/components/tree-select/src/instance.d.ts +6 -0
- package/dist/components/tree-select/src/select.d.ts +11 -0
- package/dist/components/tree-select/src/select.js +92 -0
- package/dist/components/tree-select/src/tree-select-option.d.ts +364 -0
- package/dist/components/tree-select/src/tree-select-option.js +32 -0
- package/dist/components/tree-select/src/tree-select.vue.d.ts +412 -0
- package/dist/components/tree-select/src/tree-select.vue.js +96 -0
- package/dist/components/tree-select/src/tree-select2.vue.js +4 -0
- package/dist/components/tree-select/src/tree.d.ts +12 -0
- package/dist/components/tree-select/src/tree.js +179 -0
- package/dist/components/tree-select/src/utils.d.ts +10 -0
- package/dist/components/tree-select/src/utils.js +49 -0
- package/dist/components/upload/src/upload-content.vue.d.ts +2 -2
- package/dist/components/upload/src/upload.vue.d.ts +2 -2
- package/dist/constants/column-alignment.js +4 -0
- package/dist/ep-craft.js +367 -279
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-lockscreen/index.d.ts +11 -0
- package/dist/hooks/use-lockscreen/index.js +34 -0
- package/dist/index.d.ts +98 -0
- package/dist/utils/arrays.js +4 -3
- package/dist/utils/dom/aria.js +23 -13
- package/dist/utils/dom/scroll.js +61 -46
- package/dist/utils/vue/icon.js +17 -14
- package/dist/utils/vue/validator.js +5 -0
- package/dist/utils/vue/vnode.js +24 -12
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +69 -5
- package/package.json +3 -2
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { getCurrentInstance as S, shallowRef as D, computed as p, ref as W, onMounted as O, watch as K } from "vue";
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { getEventCode as P } from "../../../utils/dom/event.js";
|
|
6
|
+
import { getClientXY as R } from "../../../utils/dom/position.js";
|
|
7
|
+
import { addUnit as T } from "../../../utils/dom/style.js";
|
|
8
|
+
import "@element-plus/icons-vue";
|
|
9
|
+
import { EVENT_CODE as m } from "../../../constants/aria.js";
|
|
10
|
+
import { useNamespace as U } from "../../../hooks/use-namespace/index.js";
|
|
11
|
+
import "../../../hooks/use-size/index.js";
|
|
12
|
+
import "@popperjs/core";
|
|
13
|
+
import "../../../hooks/use-z-index/index.js";
|
|
14
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
15
|
+
import "../../../hooks/use-aria/index.js";
|
|
16
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
17
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
18
|
+
import { draggable as E } from "../utils/draggable.js";
|
|
19
|
+
const V = (e, { key: a, minValue: b, maxValue: l }) => {
|
|
20
|
+
const c = S(), t = D(), w = D(), M = p(() => e.color.get(a));
|
|
21
|
+
function H(o) {
|
|
22
|
+
var n;
|
|
23
|
+
if (e.disabled) return;
|
|
24
|
+
o.target !== t.value && f(o), (n = t.value) == null || n.focus();
|
|
25
|
+
}
|
|
26
|
+
function f(o) {
|
|
27
|
+
if (!w.value || !t.value || e.disabled) return;
|
|
28
|
+
const n = c.vnode.el.getBoundingClientRect(), { clientX: s, clientY: d } = R(o);
|
|
29
|
+
let v;
|
|
30
|
+
if (e.vertical) {
|
|
31
|
+
let i = d - n.top;
|
|
32
|
+
i = Math.max(t.value.offsetHeight / 2, i), i = Math.min(i, n.height - t.value.offsetHeight / 2), v = Math.round(
|
|
33
|
+
(i - t.value.offsetHeight / 2) / (n.height - t.value.offsetHeight) * l
|
|
34
|
+
);
|
|
35
|
+
} else {
|
|
36
|
+
let i = s - n.left;
|
|
37
|
+
i = Math.max(t.value.offsetWidth / 2, i), i = Math.min(i, n.width - t.value.offsetWidth / 2), v = Math.round(
|
|
38
|
+
(i - t.value.offsetWidth / 2) / (n.width - t.value.offsetWidth) * l
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
e.color.set(a, v);
|
|
42
|
+
}
|
|
43
|
+
function C(o) {
|
|
44
|
+
if (e.disabled) return;
|
|
45
|
+
const { shiftKey: r } = o, n = P(o), s = r ? 10 : 1, d = a === "hue" ? -1 : 1;
|
|
46
|
+
let v = !0;
|
|
47
|
+
switch (n) {
|
|
48
|
+
case m.left:
|
|
49
|
+
case m.down:
|
|
50
|
+
u(-s * d);
|
|
51
|
+
break;
|
|
52
|
+
case m.right:
|
|
53
|
+
case m.up:
|
|
54
|
+
u(s * d);
|
|
55
|
+
break;
|
|
56
|
+
case m.home:
|
|
57
|
+
e.color.set(a, a === "hue" ? l : b);
|
|
58
|
+
break;
|
|
59
|
+
case m.end:
|
|
60
|
+
e.color.set(a, a === "hue" ? b : l);
|
|
61
|
+
break;
|
|
62
|
+
case m.pageDown:
|
|
63
|
+
u(-4 * d);
|
|
64
|
+
break;
|
|
65
|
+
case m.pageUp:
|
|
66
|
+
u(4 * d);
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
v = !1;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
v && o.preventDefault();
|
|
73
|
+
}
|
|
74
|
+
function u(o) {
|
|
75
|
+
let r = M.value + o;
|
|
76
|
+
r = r < b ? b : r > l ? l : r, e.color.set(a, r);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
thumb: t,
|
|
80
|
+
bar: w,
|
|
81
|
+
currentValue: M,
|
|
82
|
+
handleDrag: f,
|
|
83
|
+
handleClick: H,
|
|
84
|
+
handleKeydown: C
|
|
85
|
+
};
|
|
86
|
+
}, tt = (e, {
|
|
87
|
+
namespace: a,
|
|
88
|
+
maxValue: b,
|
|
89
|
+
bar: l,
|
|
90
|
+
thumb: c,
|
|
91
|
+
currentValue: t,
|
|
92
|
+
handleDrag: w,
|
|
93
|
+
getBackground: M
|
|
94
|
+
}) => {
|
|
95
|
+
const H = S(), f = U(a), C = W(0), u = W(0), o = W();
|
|
96
|
+
function r() {
|
|
97
|
+
if (!c.value || e.vertical) return 0;
|
|
98
|
+
const h = H.vnode.el, g = t.value;
|
|
99
|
+
return h ? Math.round(
|
|
100
|
+
g * (h.offsetWidth - c.value.offsetWidth / 2) / b
|
|
101
|
+
) : 0;
|
|
102
|
+
}
|
|
103
|
+
function n() {
|
|
104
|
+
if (!c.value) return 0;
|
|
105
|
+
const h = H.vnode.el;
|
|
106
|
+
if (!e.vertical) return 0;
|
|
107
|
+
const g = t.value;
|
|
108
|
+
return h ? Math.round(
|
|
109
|
+
g * (h.offsetHeight - c.value.offsetHeight / 2) / b
|
|
110
|
+
) : 0;
|
|
111
|
+
}
|
|
112
|
+
function s() {
|
|
113
|
+
C.value = r(), u.value = n(), o.value = M == null ? void 0 : M();
|
|
114
|
+
}
|
|
115
|
+
O(() => {
|
|
116
|
+
if (!l.value || !c.value) return;
|
|
117
|
+
const h = {
|
|
118
|
+
drag: (g) => {
|
|
119
|
+
w(g);
|
|
120
|
+
},
|
|
121
|
+
end: (g) => {
|
|
122
|
+
w(g);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
E(l.value, h), E(c.value, h), s();
|
|
126
|
+
}), K(t, () => s()), K(
|
|
127
|
+
() => e.color.value,
|
|
128
|
+
() => s()
|
|
129
|
+
);
|
|
130
|
+
const d = p(() => [
|
|
131
|
+
f.b(),
|
|
132
|
+
f.is("vertical", e.vertical),
|
|
133
|
+
f.is("disabled", e.disabled)
|
|
134
|
+
]), v = p(() => f.e("bar")), i = p(() => f.e("thumb")), L = p(() => ({ background: o.value })), N = p(() => ({
|
|
135
|
+
left: T(C.value),
|
|
136
|
+
top: T(u.value)
|
|
137
|
+
}));
|
|
138
|
+
return {
|
|
139
|
+
rootKls: d,
|
|
140
|
+
barKls: v,
|
|
141
|
+
barStyle: L,
|
|
142
|
+
thumbKls: i,
|
|
143
|
+
thumbStyle: N,
|
|
144
|
+
thumbLeft: C,
|
|
145
|
+
thumbTop: u,
|
|
146
|
+
update: s
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export {
|
|
150
|
+
V as useSlider,
|
|
151
|
+
tt as useSliderDOM
|
|
152
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SvPanelProps } from '../props/sv-panel';
|
|
2
|
+
export declare const useSvPanel: (props: SvPanelProps) => {
|
|
3
|
+
cursorRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
4
|
+
cursorTop: import("vue").Ref<number, number>;
|
|
5
|
+
cursorLeft: import("vue").Ref<number, number>;
|
|
6
|
+
background: import("vue").Ref<string, string>;
|
|
7
|
+
saturation: import("vue").ComputedRef<any>;
|
|
8
|
+
brightness: import("vue").ComputedRef<any>;
|
|
9
|
+
hue: import("vue").ComputedRef<any>;
|
|
10
|
+
handleClick: (event: MouseEvent | TouchEvent) => void;
|
|
11
|
+
handleDrag: (event: MouseEvent | TouchEvent) => void;
|
|
12
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const useSvPanelDOM: (props: SvPanelProps, { cursorTop, cursorLeft, background, handleDrag, }: Pick<ReturnType<typeof useSvPanel>, "cursorTop" | "cursorLeft" | "background" | "handleDrag">) => {
|
|
15
|
+
rootKls: import("vue").ComputedRef<string>;
|
|
16
|
+
cursorKls: import("vue").ComputedRef<string>;
|
|
17
|
+
rootStyle: import("vue").ComputedRef<{
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
}>;
|
|
20
|
+
cursorStyle: import("vue").ComputedRef<{
|
|
21
|
+
top: string | undefined;
|
|
22
|
+
left: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
update: () => void;
|
|
25
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { getCurrentInstance as y, ref as w, computed as l, onMounted as D, watch as E } from "vue";
|
|
2
|
+
import { EVENT_CODE as C } from "../../../constants/aria.js";
|
|
3
|
+
import { useNamespace as K } from "../../../hooks/use-namespace/index.js";
|
|
4
|
+
import "@vue/shared";
|
|
5
|
+
import "lodash-unified";
|
|
6
|
+
import "@vueuse/core";
|
|
7
|
+
import { getEventCode as P } from "../../../utils/dom/event.js";
|
|
8
|
+
import { getClientXY as B } from "../../../utils/dom/position.js";
|
|
9
|
+
import { addUnit as p } from "../../../utils/dom/style.js";
|
|
10
|
+
import "@element-plus/icons-vue";
|
|
11
|
+
import "../../../hooks/use-size/index.js";
|
|
12
|
+
import "@popperjs/core";
|
|
13
|
+
import "../../../hooks/use-z-index/index.js";
|
|
14
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
15
|
+
import "../../../hooks/use-aria/index.js";
|
|
16
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
17
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
18
|
+
import { draggable as N } from "../utils/draggable.js";
|
|
19
|
+
const J = (e) => {
|
|
20
|
+
const f = y(), a = w(), m = w(0), d = w(0), g = w("hsl(0, 100%, 50%)"), h = l(() => e.color.get("saturation")), c = l(() => e.color.get("value")), M = l(() => e.color.get("hue"));
|
|
21
|
+
function S(o) {
|
|
22
|
+
var n;
|
|
23
|
+
if (e.disabled) return;
|
|
24
|
+
o.target !== a.value && v(o), (n = a.value) == null || n.focus({ preventScroll: !0 });
|
|
25
|
+
}
|
|
26
|
+
function v(o) {
|
|
27
|
+
if (e.disabled) return;
|
|
28
|
+
const n = f.vnode.el.getBoundingClientRect(), { clientX: i, clientY: k } = B(o);
|
|
29
|
+
let u = i - n.left, s = k - n.top;
|
|
30
|
+
u = Math.max(0, u), u = Math.min(u, n.width), s = Math.max(0, s), s = Math.min(s, n.height), d.value = u, m.value = s, e.color.set({
|
|
31
|
+
saturation: u / n.width * 100,
|
|
32
|
+
value: 100 - s / n.height * 100
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function x(o) {
|
|
36
|
+
if (e.disabled) return;
|
|
37
|
+
const { shiftKey: t } = o, n = P(o), i = t ? 10 : 1;
|
|
38
|
+
let k = !0;
|
|
39
|
+
switch (n) {
|
|
40
|
+
case C.left:
|
|
41
|
+
r(-i);
|
|
42
|
+
break;
|
|
43
|
+
case C.right:
|
|
44
|
+
r(i);
|
|
45
|
+
break;
|
|
46
|
+
case C.up:
|
|
47
|
+
b(i);
|
|
48
|
+
break;
|
|
49
|
+
case C.down:
|
|
50
|
+
b(-i);
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
k = !1;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
k && o.preventDefault();
|
|
57
|
+
}
|
|
58
|
+
function r(o) {
|
|
59
|
+
let t = h.value + o;
|
|
60
|
+
t = t < 0 ? 0 : t > 100 ? 100 : t, e.color.set("saturation", t);
|
|
61
|
+
}
|
|
62
|
+
function b(o) {
|
|
63
|
+
let t = c.value + o;
|
|
64
|
+
t = t < 0 ? 0 : t > 100 ? 100 : t, e.color.set("value", t);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
cursorRef: a,
|
|
68
|
+
cursorTop: m,
|
|
69
|
+
cursorLeft: d,
|
|
70
|
+
background: g,
|
|
71
|
+
saturation: h,
|
|
72
|
+
brightness: c,
|
|
73
|
+
hue: M,
|
|
74
|
+
handleClick: S,
|
|
75
|
+
handleDrag: v,
|
|
76
|
+
handleKeydown: x
|
|
77
|
+
};
|
|
78
|
+
}, L = (e, {
|
|
79
|
+
cursorTop: f,
|
|
80
|
+
cursorLeft: a,
|
|
81
|
+
background: m,
|
|
82
|
+
handleDrag: d
|
|
83
|
+
}) => {
|
|
84
|
+
const g = y(), h = K("color-svpanel");
|
|
85
|
+
function c() {
|
|
86
|
+
const r = e.color.get("saturation"), b = e.color.get("value"), o = g.vnode.el, { clientWidth: t, clientHeight: n } = o;
|
|
87
|
+
a.value = r * t / 100, f.value = (100 - b) * n / 100, m.value = `hsl(${e.color.get("hue")}, 100%, 50%)`;
|
|
88
|
+
}
|
|
89
|
+
D(() => {
|
|
90
|
+
N(g.vnode.el, {
|
|
91
|
+
drag: (r) => {
|
|
92
|
+
d(r);
|
|
93
|
+
},
|
|
94
|
+
end: (r) => {
|
|
95
|
+
d(r);
|
|
96
|
+
}
|
|
97
|
+
}), c();
|
|
98
|
+
}), E(
|
|
99
|
+
[
|
|
100
|
+
() => e.color.get("hue"),
|
|
101
|
+
() => e.color.get("value"),
|
|
102
|
+
() => e.color.value
|
|
103
|
+
],
|
|
104
|
+
() => c()
|
|
105
|
+
);
|
|
106
|
+
const M = l(() => h.b()), S = l(() => h.e("cursor")), v = l(() => ({
|
|
107
|
+
backgroundColor: m.value
|
|
108
|
+
})), x = l(() => ({
|
|
109
|
+
top: p(f.value),
|
|
110
|
+
left: p(a.value)
|
|
111
|
+
}));
|
|
112
|
+
return {
|
|
113
|
+
rootKls: M,
|
|
114
|
+
cursorKls: S,
|
|
115
|
+
rootStyle: v,
|
|
116
|
+
cursorStyle: x,
|
|
117
|
+
update: c
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export {
|
|
121
|
+
J as useSvPanel,
|
|
122
|
+
L as useSvPanelDOM
|
|
123
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type Color from '../utils/color';
|
|
3
|
+
export interface PredefineProps {
|
|
4
|
+
colors: string[];
|
|
5
|
+
color: Color;
|
|
6
|
+
enableAlpha: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Removed after 3.0.0, Use `PredefineProps` instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare const predefineProps: {
|
|
13
|
+
readonly colors: {
|
|
14
|
+
readonly type: import("vue").PropType<string[]>;
|
|
15
|
+
readonly required: true;
|
|
16
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
17
|
+
__epPropKey: true;
|
|
18
|
+
};
|
|
19
|
+
readonly color: {
|
|
20
|
+
readonly type: import("vue").PropType<Color>;
|
|
21
|
+
readonly required: true;
|
|
22
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
23
|
+
__epPropKey: true;
|
|
24
|
+
};
|
|
25
|
+
readonly enableAlpha: {
|
|
26
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
|
|
27
|
+
readonly required: true;
|
|
28
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
29
|
+
__epPropKey: true;
|
|
30
|
+
};
|
|
31
|
+
readonly disabled: BooleanConstructor;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Removed after 3.0.0, Use `PredefineProps` instead.
|
|
35
|
+
*/
|
|
36
|
+
export type PredefinePropsPublic = ExtractPublicPropTypes<typeof predefineProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type Color from '../utils/color';
|
|
3
|
+
export interface AlphaSliderProps {
|
|
4
|
+
color: Color;
|
|
5
|
+
vertical?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface HueSliderProps extends AlphaSliderProps {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Removed after 3.0.0, Use `AlphaSliderProps` instead.
|
|
12
|
+
*/
|
|
13
|
+
export declare const alphaSliderProps: {
|
|
14
|
+
readonly color: {
|
|
15
|
+
readonly type: import("vue").PropType<Color>;
|
|
16
|
+
readonly required: true;
|
|
17
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
18
|
+
__epPropKey: true;
|
|
19
|
+
};
|
|
20
|
+
readonly vertical: BooleanConstructor;
|
|
21
|
+
readonly disabled: BooleanConstructor;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Removed after 3.0.0, Use `HueSliderProps` instead.
|
|
25
|
+
*/
|
|
26
|
+
export declare const hueSliderProps: {
|
|
27
|
+
readonly color: {
|
|
28
|
+
readonly type: import("vue").PropType<Color>;
|
|
29
|
+
readonly required: true;
|
|
30
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
31
|
+
__epPropKey: true;
|
|
32
|
+
};
|
|
33
|
+
readonly vertical: BooleanConstructor;
|
|
34
|
+
readonly disabled: BooleanConstructor;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Removed after 3.0.0, Use `AlphaSliderProps` instead.
|
|
38
|
+
*/
|
|
39
|
+
export type AlphaSliderPropsPublic = ExtractPublicPropTypes<typeof alphaSliderProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type Color from '../utils/color';
|
|
3
|
+
export interface SvPanelProps {
|
|
4
|
+
color: Color;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Removed after 3.0.0, Use `SvPanelProps` instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare const svPanelProps: {
|
|
11
|
+
readonly color: {
|
|
12
|
+
readonly type: import("vue").PropType<Color>;
|
|
13
|
+
readonly required: true;
|
|
14
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
15
|
+
__epPropKey: true;
|
|
16
|
+
};
|
|
17
|
+
readonly disabled: BooleanConstructor;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Removed after 3.0.0, Use `SvPanelProps` instead.
|
|
21
|
+
*/
|
|
22
|
+
export type SvPanelPropsPublic = ExtractPublicPropTypes<typeof svPanelProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface ColorOptions {
|
|
2
|
+
enableAlpha: boolean;
|
|
3
|
+
format: string;
|
|
4
|
+
value?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export default class Color {
|
|
7
|
+
private _hue;
|
|
8
|
+
private _saturation;
|
|
9
|
+
private _value;
|
|
10
|
+
private _alpha;
|
|
11
|
+
private _tiny;
|
|
12
|
+
private _isValid;
|
|
13
|
+
enableAlpha: boolean;
|
|
14
|
+
format: string;
|
|
15
|
+
value: string;
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
constructor(options?: Partial<ColorOptions>);
|
|
18
|
+
set(prop: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
} | any, value?: number): void;
|
|
21
|
+
get(prop: string): any;
|
|
22
|
+
toRgb(): import("@ctrl/tinycolor").Numberify<import("@ctrl/tinycolor").RGBA>;
|
|
23
|
+
fromString(value: string): void;
|
|
24
|
+
clear(): void;
|
|
25
|
+
compare(color: this): boolean;
|
|
26
|
+
doOnChange(): void;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TinyColor as e } from "@ctrl/tinycolor";
|
|
2
|
+
import { hasOwn as r } from "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import "vue";
|
|
7
|
+
class g {
|
|
8
|
+
constructor(t = {}) {
|
|
9
|
+
this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this._tiny = new e(), this._isValid = !1, this.enableAlpha = !1, this.format = "", this.value = "";
|
|
10
|
+
for (const i in t)
|
|
11
|
+
r(t, i) && (this[i] = t[i]);
|
|
12
|
+
t.value ? this.fromString(t.value) : this.doOnChange();
|
|
13
|
+
}
|
|
14
|
+
set(t, i) {
|
|
15
|
+
if (arguments.length === 1 && typeof t == "object") {
|
|
16
|
+
for (const s in t)
|
|
17
|
+
r(t, s) && this.set(s, t[s]);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
this[`_${t}`] = i, this._isValid = !0, this.doOnChange();
|
|
21
|
+
}
|
|
22
|
+
get(t) {
|
|
23
|
+
return ["hue", "saturation", "value", "alpha"].includes(t) ? Math.round(this[`_${t}`]) : this[`_${t}`];
|
|
24
|
+
}
|
|
25
|
+
toRgb() {
|
|
26
|
+
return this._isValid ? this._tiny.toRgb() : { r: 255, g: 255, b: 255, a: 0 };
|
|
27
|
+
}
|
|
28
|
+
fromString(t) {
|
|
29
|
+
const i = new e(t);
|
|
30
|
+
if (this._isValid = i.isValid, i.isValid) {
|
|
31
|
+
const { h: s, s: n, v: a, a: h } = i.toHsv();
|
|
32
|
+
this._hue = s, this._saturation = n * 100, this._value = a * 100, this._alpha = h * 100;
|
|
33
|
+
} else
|
|
34
|
+
this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100;
|
|
35
|
+
this.doOnChange();
|
|
36
|
+
}
|
|
37
|
+
clear() {
|
|
38
|
+
this._isValid = !1, this.value = "", this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100;
|
|
39
|
+
}
|
|
40
|
+
compare(t) {
|
|
41
|
+
const i = new e({
|
|
42
|
+
h: t._hue,
|
|
43
|
+
s: t._saturation / 100,
|
|
44
|
+
v: t._value / 100,
|
|
45
|
+
a: t._alpha / 100
|
|
46
|
+
});
|
|
47
|
+
return this._tiny.equals(i);
|
|
48
|
+
}
|
|
49
|
+
doOnChange() {
|
|
50
|
+
const { _hue: t, _saturation: i, _value: s, _alpha: n, format: a, enableAlpha: h } = this;
|
|
51
|
+
let l = a || (h ? "rgb" : "hex");
|
|
52
|
+
a === "hex" && h && (l = "hex8"), this._tiny = new e({
|
|
53
|
+
h: t,
|
|
54
|
+
s: i / 100,
|
|
55
|
+
v: s / 100,
|
|
56
|
+
a: n / 100
|
|
57
|
+
}), this.value = this._isValid ? this._tiny.toString(l) : "";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
g as default
|
|
62
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface DraggableOptions {
|
|
2
|
+
drag?: (event: MouseEvent | TouchEvent) => void;
|
|
3
|
+
start?: (event: MouseEvent | TouchEvent) => void;
|
|
4
|
+
end?: (event: MouseEvent | TouchEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function draggable(element: HTMLElement, options: DraggableOptions): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import { isClient as a } from "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import "vue";
|
|
6
|
+
let d = !1;
|
|
7
|
+
function i(m, e) {
|
|
8
|
+
if (!a) return;
|
|
9
|
+
const r = function(n) {
|
|
10
|
+
var t;
|
|
11
|
+
(t = e.drag) == null || t.call(e, n);
|
|
12
|
+
}, u = function(n) {
|
|
13
|
+
var t;
|
|
14
|
+
document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", u), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", u), document.onselectstart = null, document.ondragstart = null, d = !1, (t = e.end) == null || t.call(e, n);
|
|
15
|
+
}, c = function(n) {
|
|
16
|
+
var t;
|
|
17
|
+
d || (document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", r), document.addEventListener("mouseup", u), document.addEventListener("touchmove", r), document.addEventListener("touchend", u), d = !0, (t = e.start) == null || t.call(e, n));
|
|
18
|
+
};
|
|
19
|
+
m.addEventListener("mousedown", c), m.addEventListener("touchstart", c, { passive: !1 });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
i as draggable
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DescriptionProps } from './description';
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
title?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
extra?: (props: typeof __VLS_3) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<DescriptionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DescriptionProps> & Readonly<{}>, {
|
|
9
|
+
column: number;
|
|
10
|
+
direction: "horizontal" | "vertical";
|
|
11
|
+
title: string;
|
|
12
|
+
extra: string;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineComponent as F, useSlots as K, provide as M, computed as O, openBlock as b, createElementBlock as y, normalizeClass as c, unref as m, createElementVNode as h, renderSlot as C, createTextVNode as $, toDisplayString as x, createCommentVNode as w, Fragment as A, renderList as L, createBlock as P } from "vue";
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import { flattedChildren as R } from "../../utils/vue/vnode.js";
|
|
7
|
+
import { useNamespace as W } from "../../hooks/use-namespace/index.js";
|
|
8
|
+
import "../../hooks/use-size/index.js";
|
|
9
|
+
import "@popperjs/core";
|
|
10
|
+
import "../../hooks/use-z-index/index.js";
|
|
11
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
12
|
+
import "../../hooks/use-aria/index.js";
|
|
13
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
14
|
+
import "../../hooks/use-empty-values/index.js";
|
|
15
|
+
import "../form/index.js";
|
|
16
|
+
import j from "./EpDescriptionsRow.vue.js";
|
|
17
|
+
import { descriptionsKey as q } from "./token.js";
|
|
18
|
+
import { COMPONENT_NAME as G } from "./constants.js";
|
|
19
|
+
import { useFormSize as H } from "../form/src/hooks/use-form-common-props.js";
|
|
20
|
+
const ct = /* @__PURE__ */ F({
|
|
21
|
+
name: "EpDescriptions",
|
|
22
|
+
__name: "EpDescriptions",
|
|
23
|
+
props: {
|
|
24
|
+
border: { type: Boolean },
|
|
25
|
+
column: { default: 3 },
|
|
26
|
+
direction: { default: "horizontal" },
|
|
27
|
+
size: {},
|
|
28
|
+
title: { default: "" },
|
|
29
|
+
extra: { default: "" },
|
|
30
|
+
labelWidth: {}
|
|
31
|
+
},
|
|
32
|
+
setup(n) {
|
|
33
|
+
const u = n, i = W("descriptions"), B = H(), E = K();
|
|
34
|
+
M(q, u);
|
|
35
|
+
const D = O(() => [i.b(), i.m(B.value)]), N = (t, l, r, e = !1) => (t.props || (t.props = {}), l > r && (t.props.span = r), e && (t.props.span = l), t), V = () => {
|
|
36
|
+
if (!E.default) return [];
|
|
37
|
+
const t = R(E.default()).filter(
|
|
38
|
+
(s) => {
|
|
39
|
+
var f;
|
|
40
|
+
return ((f = s == null ? void 0 : s.type) == null ? void 0 : f.name) === G;
|
|
41
|
+
}
|
|
42
|
+
), l = [];
|
|
43
|
+
let r = [], e = u.column, v = 0;
|
|
44
|
+
const o = [];
|
|
45
|
+
return t.forEach((s, f) => {
|
|
46
|
+
var g, k, z;
|
|
47
|
+
const d = ((g = s.props) == null ? void 0 : g.span) || 1, S = ((k = s.props) == null ? void 0 : k.rowspan) || 1, a = l.length;
|
|
48
|
+
if (o[a] || (o[a] = 0), S > 1)
|
|
49
|
+
for (let p = 1; p < S; p++)
|
|
50
|
+
o[z = a + p] || (o[z] = 0), o[a + p]++, v++;
|
|
51
|
+
if (o[a] > 0 && (e -= o[a], o[a] = 0), f < t.length - 1 && (v += d > e ? e : d), f === t.length - 1) {
|
|
52
|
+
const p = u.column - v % u.column;
|
|
53
|
+
r.push(N(s, p, e, !0)), l.push(r);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
d < e ? (e -= d, r.push(s)) : (r.push(N(s, d, e)), l.push(r), e = u.column, r = []);
|
|
57
|
+
}), l;
|
|
58
|
+
};
|
|
59
|
+
return (t, l) => (b(), y("div", {
|
|
60
|
+
class: c(D.value)
|
|
61
|
+
}, [
|
|
62
|
+
n.title || n.extra || t.$slots.title || t.$slots.extra ? (b(), y("div", {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: c(m(i).e("header"))
|
|
65
|
+
}, [
|
|
66
|
+
h("div", {
|
|
67
|
+
class: c(m(i).e("title"))
|
|
68
|
+
}, [
|
|
69
|
+
C(t.$slots, "title", {}, () => [
|
|
70
|
+
$(x(n.title), 1)
|
|
71
|
+
])
|
|
72
|
+
], 2),
|
|
73
|
+
h("div", {
|
|
74
|
+
class: c(m(i).e("extra"))
|
|
75
|
+
}, [
|
|
76
|
+
C(t.$slots, "extra", {}, () => [
|
|
77
|
+
$(x(n.extra), 1)
|
|
78
|
+
])
|
|
79
|
+
], 2)
|
|
80
|
+
], 2)) : w("", !0),
|
|
81
|
+
h("div", {
|
|
82
|
+
class: c(m(i).e("body"))
|
|
83
|
+
}, [
|
|
84
|
+
h("table", {
|
|
85
|
+
class: c([m(i).e("table"), m(i).is("bordered", n.border)])
|
|
86
|
+
}, [
|
|
87
|
+
h("tbody", null, [
|
|
88
|
+
(b(!0), y(A, null, L(V(), (r, e) => (b(), P(j, {
|
|
89
|
+
key: e,
|
|
90
|
+
row: r
|
|
91
|
+
}, null, 8, ["row"]))), 128))
|
|
92
|
+
])
|
|
93
|
+
], 2)
|
|
94
|
+
], 2)
|
|
95
|
+
], 2));
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
ct as default
|
|
100
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DescriptionsRowProps } from './descriptions-row';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<DescriptionsRowProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DescriptionsRowProps> & Readonly<{}>, {
|
|
3
|
+
row: import(".").DescriptionItemVNode[];
|
|
4
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|