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,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mention 内部类型(源文件为纯类型模块,sourcemap 无内容,按上游同名
|
|
3
|
+
* `.d.ts` 还原)。
|
|
4
|
+
*/
|
|
5
|
+
export type MentionOption = {
|
|
6
|
+
value?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
export interface MentionCtx {
|
|
12
|
+
pattern: string;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
prefix: string;
|
|
16
|
+
prefixIndex: number;
|
|
17
|
+
splitIndex: number;
|
|
18
|
+
selectionEnd: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RateProps } from './rate';
|
|
2
|
+
declare function setCurrentValue(value: number, event?: MouseEvent): void;
|
|
3
|
+
declare function resetCurrentValue(): void;
|
|
4
|
+
declare const _default: import("vue").DefineComponent<RateProps, {
|
|
5
|
+
/** @description set current value */
|
|
6
|
+
setCurrentValue: typeof setCurrentValue;
|
|
7
|
+
/** @description reset current value */
|
|
8
|
+
resetCurrentValue: typeof resetCurrentValue;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (value: number) => void;
|
|
11
|
+
change: (value: number) => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<RateProps> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
14
|
+
onChange?: ((value: number) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
id: string;
|
|
18
|
+
modelValue: number;
|
|
19
|
+
max: number;
|
|
20
|
+
textColor: string;
|
|
21
|
+
colors: string[] | Record<number, string>;
|
|
22
|
+
lowThreshold: number;
|
|
23
|
+
highThreshold: number;
|
|
24
|
+
voidColor: string;
|
|
25
|
+
disabledVoidColor: string;
|
|
26
|
+
icons: Array<import("@element-plus/utils").IconPropType> | Record<number, import("@element-plus/utils").IconPropType>;
|
|
27
|
+
voidIcon: import("@element-plus/utils").IconPropType;
|
|
28
|
+
disabledVoidIcon: import("@element-plus/utils").IconPropType;
|
|
29
|
+
texts: string[];
|
|
30
|
+
scoreTemplate: string;
|
|
31
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { defineComponent as ce, inject as de, ref as V, computed as s, markRaw as k, watch as me, openBlock as d, createElementBlock as w, unref as t, normalizeStyle as B, normalizeClass as f, Fragment as ve, renderList as fe, createVNode as P, withCtx as G, withDirectives as C, createBlock as y, resolveDynamicComponent as I, vShow as E, toDisplayString as pe, createCommentVNode as he } from "vue";
|
|
2
|
+
import { clamp as S } from "lodash-unified";
|
|
3
|
+
import { EVENT_CODE as T } from "../../constants/aria.js";
|
|
4
|
+
import { UPDATE_MODEL_EVENT as H, CHANGE_EVENT as U } from "../../constants/event.js";
|
|
5
|
+
import { isArray as F, isObject as X, isString as q } from "@vue/shared";
|
|
6
|
+
import "@vueuse/core";
|
|
7
|
+
import { getEventCode as xe } from "../../utils/dom/event.js";
|
|
8
|
+
import { StarFilled as D, Star as be } from "@element-plus/icons-vue";
|
|
9
|
+
import "../form/index.js";
|
|
10
|
+
import { ElIcon as J } from "../icon/index.js";
|
|
11
|
+
import { useNamespace as Ve } from "../../hooks/use-namespace/index.js";
|
|
12
|
+
import "../../hooks/use-size/index.js";
|
|
13
|
+
import "@popperjs/core";
|
|
14
|
+
import "../../hooks/use-z-index/index.js";
|
|
15
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
16
|
+
import "../../hooks/use-aria/index.js";
|
|
17
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
18
|
+
import "../../hooks/use-empty-values/index.js";
|
|
19
|
+
import { rateEmits as we } from "./rate.js";
|
|
20
|
+
import { formItemContextKey as Ce } from "../form/src/constants.js";
|
|
21
|
+
import { useFormSize as ye, useFormDisabled as Ie } from "../form/src/hooks/use-form-common-props.js";
|
|
22
|
+
import { useFormItemInputId as Ee } from "../form/src/hooks/use-form-item.js";
|
|
23
|
+
const Se = ["id", "aria-label", "aria-labelledby", "aria-valuenow", "aria-valuetext", "aria-valuemax", "tabindex", "aria-disabled"], Te = ["onMousemove", "onClick"], Je = /* @__PURE__ */ ce({
|
|
24
|
+
name: "EpRate",
|
|
25
|
+
__name: "EpRate",
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: { default: 0 },
|
|
28
|
+
id: { default: void 0 },
|
|
29
|
+
lowThreshold: { default: 2 },
|
|
30
|
+
highThreshold: { default: 4 },
|
|
31
|
+
max: { default: 5 },
|
|
32
|
+
colors: { default: () => ["", "", ""] },
|
|
33
|
+
voidColor: { default: "" },
|
|
34
|
+
disabledVoidColor: { default: "" },
|
|
35
|
+
icons: { default: () => [D, D, D] },
|
|
36
|
+
voidIcon: { default: () => be },
|
|
37
|
+
disabledVoidIcon: { default: () => D },
|
|
38
|
+
disabled: { type: Boolean, default: void 0 },
|
|
39
|
+
allowHalf: { type: Boolean },
|
|
40
|
+
showText: { type: Boolean },
|
|
41
|
+
showScore: { type: Boolean },
|
|
42
|
+
textColor: { default: "" },
|
|
43
|
+
texts: { default: () => [
|
|
44
|
+
"Extremely bad",
|
|
45
|
+
"Disappointed",
|
|
46
|
+
"Fair",
|
|
47
|
+
"Satisfied",
|
|
48
|
+
"Surprise"
|
|
49
|
+
] },
|
|
50
|
+
scoreTemplate: { default: "{value}" },
|
|
51
|
+
size: {},
|
|
52
|
+
clearable: { type: Boolean },
|
|
53
|
+
ariaLabel: {}
|
|
54
|
+
},
|
|
55
|
+
emits: we,
|
|
56
|
+
setup(m, { expose: Q, emit: Y }) {
|
|
57
|
+
function M(l, n) {
|
|
58
|
+
const c = (i) => X(i), o = Object.keys(n).map((i) => +i).filter((i) => {
|
|
59
|
+
const b = n[i];
|
|
60
|
+
return (c(b) ? b.excluded : !1) ? l < i : l <= i;
|
|
61
|
+
}).sort((i, b) => i - b), h = n[o[0]];
|
|
62
|
+
return c(h) && h.value || h;
|
|
63
|
+
}
|
|
64
|
+
const e = m, p = Y, N = de(Ce, void 0), Z = ye(), r = Ve("rate"), { inputId: ee, isLabeledByFormItem: _ } = Ee(e, {
|
|
65
|
+
formItemContext: N
|
|
66
|
+
}), a = V(S(e.modelValue, 0, e.max)), g = V(-1), v = V(!0), L = V([]), le = s(
|
|
67
|
+
() => L.value.map((l) => l.$el.clientWidth)
|
|
68
|
+
), oe = s(() => [r.b(), r.m(Z.value)]), u = Ie(), ae = s(() => r.cssVarBlock({
|
|
69
|
+
"void-color": e.voidColor,
|
|
70
|
+
"disabled-void-color": e.disabledVoidColor,
|
|
71
|
+
"fill-color": O.value
|
|
72
|
+
})), z = s(() => {
|
|
73
|
+
let l = "";
|
|
74
|
+
return e.showScore ? l = e.scoreTemplate.replace(
|
|
75
|
+
/\{\s*value\s*\}/,
|
|
76
|
+
u.value ? `${e.modelValue}` : `${a.value}`
|
|
77
|
+
) : e.showText && (l = e.texts[Math.ceil(a.value) - 1]), l;
|
|
78
|
+
}), A = s(
|
|
79
|
+
() => e.modelValue * 100 - Math.floor(e.modelValue) * 100
|
|
80
|
+
), te = s(
|
|
81
|
+
() => F(e.colors) ? {
|
|
82
|
+
[e.lowThreshold]: e.colors[0],
|
|
83
|
+
[e.highThreshold]: { value: e.colors[1], excluded: !0 },
|
|
84
|
+
[e.max]: e.colors[2]
|
|
85
|
+
} : e.colors
|
|
86
|
+
), O = s(() => {
|
|
87
|
+
const l = M(a.value, te.value);
|
|
88
|
+
return X(l) ? "" : l;
|
|
89
|
+
}), re = s(() => {
|
|
90
|
+
let l = "";
|
|
91
|
+
return u.value ? l = `${A.value}%` : e.allowHalf && (l = "50%"), {
|
|
92
|
+
color: O.value,
|
|
93
|
+
width: l
|
|
94
|
+
};
|
|
95
|
+
}), R = s(() => {
|
|
96
|
+
let l = F(e.icons) ? [...e.icons] : { ...e.icons };
|
|
97
|
+
return l = k(l), F(l) ? {
|
|
98
|
+
[e.lowThreshold]: l[0],
|
|
99
|
+
[e.highThreshold]: {
|
|
100
|
+
value: l[1],
|
|
101
|
+
excluded: !0
|
|
102
|
+
},
|
|
103
|
+
[e.max]: l[2]
|
|
104
|
+
} : l;
|
|
105
|
+
}), ie = s(
|
|
106
|
+
() => M(e.modelValue, R.value)
|
|
107
|
+
), $ = s(
|
|
108
|
+
() => u.value ? q(e.disabledVoidIcon) ? e.disabledVoidIcon : k(e.disabledVoidIcon) : q(e.voidIcon) ? e.voidIcon : k(e.voidIcon)
|
|
109
|
+
), se = s(
|
|
110
|
+
() => M(a.value, R.value)
|
|
111
|
+
);
|
|
112
|
+
function x(l) {
|
|
113
|
+
const n = u.value && A.value > 0 && l - 1 < e.modelValue && l > e.modelValue, c = e.allowHalf && v.value && l - 0.5 <= a.value && l > a.value;
|
|
114
|
+
return n || c;
|
|
115
|
+
}
|
|
116
|
+
function j(l) {
|
|
117
|
+
e.clearable && l === e.modelValue && (l = 0), p(H, l), e.modelValue !== l && p(U, l);
|
|
118
|
+
}
|
|
119
|
+
function ue(l) {
|
|
120
|
+
u.value || (e.allowHalf && v.value ? j(a.value) : j(l));
|
|
121
|
+
}
|
|
122
|
+
function ne(l) {
|
|
123
|
+
if (u.value)
|
|
124
|
+
return;
|
|
125
|
+
const n = xe(l), c = e.allowHalf ? 0.5 : 1;
|
|
126
|
+
let o = a.value;
|
|
127
|
+
switch (n) {
|
|
128
|
+
case T.up:
|
|
129
|
+
case T.right:
|
|
130
|
+
o += c;
|
|
131
|
+
break;
|
|
132
|
+
case T.left:
|
|
133
|
+
case T.down:
|
|
134
|
+
o -= c;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
if (o = S(o, 0, e.max), o !== a.value)
|
|
138
|
+
return l.stopPropagation(), l.preventDefault(), p(H, o), p(U, o), o;
|
|
139
|
+
}
|
|
140
|
+
function K(l, n) {
|
|
141
|
+
u.value || (e.allowHalf && n ? (v.value = n.offsetX * 2 <= le.value[l - 1], a.value = v.value ? l - 0.5 : l) : a.value = l, g.value = l);
|
|
142
|
+
}
|
|
143
|
+
function W() {
|
|
144
|
+
u.value || (e.allowHalf && (v.value = e.modelValue !== Math.floor(e.modelValue)), a.value = S(e.modelValue, 0, e.max), g.value = -1);
|
|
145
|
+
}
|
|
146
|
+
return me(
|
|
147
|
+
() => e.modelValue,
|
|
148
|
+
(l) => {
|
|
149
|
+
a.value = S(l, 0, e.max), v.value = e.modelValue !== Math.floor(e.modelValue);
|
|
150
|
+
}
|
|
151
|
+
), e.modelValue || p(H, 0), Q({
|
|
152
|
+
/** @description set current value */
|
|
153
|
+
setCurrentValue: K,
|
|
154
|
+
/** @description reset current value */
|
|
155
|
+
resetCurrentValue: W
|
|
156
|
+
}), (l, n) => {
|
|
157
|
+
var c;
|
|
158
|
+
return d(), w("div", {
|
|
159
|
+
id: t(ee),
|
|
160
|
+
class: f([oe.value, t(r).is("disabled", t(u))]),
|
|
161
|
+
role: "slider",
|
|
162
|
+
"aria-label": t(_) ? void 0 : m.ariaLabel || "rating",
|
|
163
|
+
"aria-labelledby": t(_) ? (c = t(N)) == null ? void 0 : c.labelId : void 0,
|
|
164
|
+
"aria-valuenow": a.value,
|
|
165
|
+
"aria-valuetext": z.value || void 0,
|
|
166
|
+
"aria-valuemin": "0",
|
|
167
|
+
"aria-valuemax": m.max,
|
|
168
|
+
style: B(ae.value),
|
|
169
|
+
tabindex: t(u) ? void 0 : 0,
|
|
170
|
+
"aria-disabled": t(u),
|
|
171
|
+
onKeydown: ne
|
|
172
|
+
}, [
|
|
173
|
+
(d(!0), w(ve, null, fe(m.max, (o, h) => (d(), w("span", {
|
|
174
|
+
key: h,
|
|
175
|
+
class: f(t(r).e("item")),
|
|
176
|
+
onMousemove: (i) => K(o, i),
|
|
177
|
+
onMouseleave: W,
|
|
178
|
+
onClick: (i) => ue(o)
|
|
179
|
+
}, [
|
|
180
|
+
P(t(J), {
|
|
181
|
+
ref_for: !0,
|
|
182
|
+
ref_key: "iconRefs",
|
|
183
|
+
ref: L,
|
|
184
|
+
class: f([
|
|
185
|
+
t(r).e("icon"),
|
|
186
|
+
{ hover: g.value === o },
|
|
187
|
+
t(r).is("active", o <= a.value),
|
|
188
|
+
t(r).is("focus-visible", o === Math.ceil(a.value || 1))
|
|
189
|
+
])
|
|
190
|
+
}, {
|
|
191
|
+
default: G(() => [
|
|
192
|
+
C((d(), y(I(se.value), null, null, 512)), [
|
|
193
|
+
[E, !x(o) && o <= a.value]
|
|
194
|
+
]),
|
|
195
|
+
C((d(), y(I($.value), null, null, 512)), [
|
|
196
|
+
[E, !x(o) && o > a.value]
|
|
197
|
+
]),
|
|
198
|
+
C((d(), y(I($.value), {
|
|
199
|
+
class: f([t(r).em("decimal", "box")])
|
|
200
|
+
}, null, 8, ["class"])), [
|
|
201
|
+
[E, x(o)]
|
|
202
|
+
]),
|
|
203
|
+
C(P(t(J), {
|
|
204
|
+
style: B(re.value),
|
|
205
|
+
class: f([t(r).e("icon"), t(r).e("decimal")])
|
|
206
|
+
}, {
|
|
207
|
+
default: G(() => [
|
|
208
|
+
(d(), y(I(ie.value)))
|
|
209
|
+
]),
|
|
210
|
+
_: 1
|
|
211
|
+
}, 8, ["style", "class"]), [
|
|
212
|
+
[E, x(o)]
|
|
213
|
+
])
|
|
214
|
+
]),
|
|
215
|
+
_: 2
|
|
216
|
+
}, 1032, ["class"])
|
|
217
|
+
], 42, Te))), 128)),
|
|
218
|
+
m.showText || m.showScore ? (d(), w("span", {
|
|
219
|
+
key: 0,
|
|
220
|
+
class: f(t(r).e("text")),
|
|
221
|
+
style: B({ color: m.textColor })
|
|
222
|
+
}, pe(z.value), 7)) : he("", !0)
|
|
223
|
+
], 46, Se);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
export {
|
|
228
|
+
Je as default
|
|
229
|
+
};
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import _EpRate from './EpRate.vue';
|
|
3
|
+
/**
|
|
4
|
+
* rate 自持 barrel(vendor-batch-2 产出)。
|
|
5
|
+
*
|
|
6
|
+
* 本体来自本地 `EpRate.vue`,不再引用 element-plus 包对象。修复的关键不在
|
|
7
|
+
* barrel,而在本体的跨包导入:`@element-plus/components/form` 经 Vite alias
|
|
8
|
+
* 解析到本地 form 中枢,因此 `useFormDisabled` / `useFormSize` /
|
|
9
|
+
* `useFormItemInputId` 读的是本地 Symbol,与 `<ep-form>` / `<ep-form-item>`
|
|
10
|
+
* 的 provide 一致(迁移前包装态读的是 element-plus 包内 Symbol,永不匹配)。
|
|
11
|
+
*
|
|
12
|
+
* 不使用 `export *`,公开面按上游组件级 barrel 显式列出;不导出 `ElRate` 别名。
|
|
13
|
+
*/
|
|
14
|
+
export declare const EpRate: typeof _EpRate & Plugin;
|
|
4
15
|
export default EpRate;
|
|
16
|
+
export { rateEmits, rateProps } from './rate';
|
|
17
|
+
export type { RateEmits, RateInstance, RateProps, RatePropsPublic, } from './rate';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { withInstall as t } from "../../utils/with-install.js";
|
|
2
|
+
import r from "./EpRate.vue.js";
|
|
3
|
+
import { rateEmits as i, rateProps as s } from "./rate.js";
|
|
4
|
+
const m = t(r, "ep-rate");
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
m as EpRate,
|
|
7
|
+
i as rateEmits,
|
|
8
|
+
s as rateProps
|
|
6
9
|
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { Component, ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type { ComponentSize } from '@element-plus/constants';
|
|
3
|
+
import type { IconPropType } from '@element-plus/utils';
|
|
4
|
+
import type Rate from './EpRate.vue';
|
|
5
|
+
export interface RateProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description binding value
|
|
8
|
+
*/
|
|
9
|
+
modelValue?: number;
|
|
10
|
+
/**
|
|
11
|
+
* @description native `id` attribute
|
|
12
|
+
*/
|
|
13
|
+
id?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description threshold value between low and medium level. The value itself will be included in low level
|
|
16
|
+
*/
|
|
17
|
+
lowThreshold?: number;
|
|
18
|
+
/**
|
|
19
|
+
* @description threshold value between medium and high level. The value itself will be included in high level
|
|
20
|
+
*/
|
|
21
|
+
highThreshold?: number;
|
|
22
|
+
/**
|
|
23
|
+
* @description max rating score
|
|
24
|
+
*/
|
|
25
|
+
max?: number;
|
|
26
|
+
/**
|
|
27
|
+
* @description colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color
|
|
28
|
+
*/
|
|
29
|
+
colors?: string[] | Record<number, string>;
|
|
30
|
+
/**
|
|
31
|
+
* @description color of unselected icons
|
|
32
|
+
*/
|
|
33
|
+
voidColor?: string;
|
|
34
|
+
/**
|
|
35
|
+
* @description color of unselected read-only icons
|
|
36
|
+
*/
|
|
37
|
+
disabledVoidColor?: string;
|
|
38
|
+
/**
|
|
39
|
+
* @description icon components. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon component
|
|
40
|
+
*/
|
|
41
|
+
icons?: Array<IconPropType> | Record<number, IconPropType>;
|
|
42
|
+
/**
|
|
43
|
+
* @description component of unselected icons
|
|
44
|
+
*/
|
|
45
|
+
voidIcon?: IconPropType;
|
|
46
|
+
/**
|
|
47
|
+
* @description component of unselected read-only icons
|
|
48
|
+
*/
|
|
49
|
+
disabledVoidIcon?: IconPropType;
|
|
50
|
+
/**
|
|
51
|
+
* @description whether Rate is read-only
|
|
52
|
+
*/
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @description whether picking half start is allowed
|
|
56
|
+
*/
|
|
57
|
+
allowHalf?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @description whether to display texts
|
|
60
|
+
*/
|
|
61
|
+
showText?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @description whether to display current score. show-score and show-text cannot be true at the same time
|
|
64
|
+
*/
|
|
65
|
+
showScore?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* @description color of texts
|
|
68
|
+
*/
|
|
69
|
+
textColor?: string;
|
|
70
|
+
/**
|
|
71
|
+
* @description text array
|
|
72
|
+
*/
|
|
73
|
+
texts?: string[];
|
|
74
|
+
/**
|
|
75
|
+
* @description score template
|
|
76
|
+
*/
|
|
77
|
+
scoreTemplate?: string;
|
|
78
|
+
/**
|
|
79
|
+
* @description size of Rate
|
|
80
|
+
*/
|
|
81
|
+
size?: ComponentSize;
|
|
82
|
+
/**
|
|
83
|
+
* @description whether value can be reset to `0`
|
|
84
|
+
*/
|
|
85
|
+
clearable?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* @description native `aria-label` attribute
|
|
88
|
+
*/
|
|
89
|
+
ariaLabel?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Removed after 3.0.0, Use `RateProps` instead.
|
|
93
|
+
*/
|
|
94
|
+
export declare const rateProps: {
|
|
95
|
+
readonly ariaLabel: StringConstructor;
|
|
96
|
+
readonly modelValue: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
97
|
+
readonly id: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
98
|
+
readonly lowThreshold: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 2, boolean>;
|
|
99
|
+
readonly highThreshold: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 4, boolean>;
|
|
100
|
+
readonly max: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
|
|
101
|
+
readonly colors: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string[] | Record<number, string>) | (() => string[] | Record<number, string>) | (((new (...args: any[]) => string[] | Record<number, string>) | (() => string[] | Record<number, string>)) | null)[], unknown, unknown, () => ["", "", ""], boolean>;
|
|
102
|
+
readonly voidColor: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
103
|
+
readonly disabledVoidColor: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
104
|
+
readonly icons: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (string | Component)[] | Record<number, string | Component>) | (() => (string | Component)[] | Record<number, string | Component>) | (((new (...args: any[]) => (string | Component)[] | Record<number, string | Component>) | (() => (string | Component)[] | Record<number, string | Component>)) | null)[], unknown, unknown, () => [Component, Component, Component], boolean>;
|
|
105
|
+
readonly voidIcon: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => Component, boolean>;
|
|
106
|
+
readonly disabledVoidIcon: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => Component, boolean>;
|
|
107
|
+
readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
108
|
+
readonly allowHalf: BooleanConstructor;
|
|
109
|
+
readonly showText: BooleanConstructor;
|
|
110
|
+
readonly showScore: BooleanConstructor;
|
|
111
|
+
readonly textColor: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
112
|
+
readonly texts: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => ["Extremely bad", "Disappointed", "Fair", "Satisfied", "Surprise"], boolean>;
|
|
113
|
+
readonly scoreTemplate: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "{value}", boolean>;
|
|
114
|
+
readonly size: {
|
|
115
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
116
|
+
readonly required: false;
|
|
117
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
118
|
+
__epPropKey: true;
|
|
119
|
+
};
|
|
120
|
+
readonly clearable: BooleanConstructor;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated Removed after 3.0.0, Use `RateProps` instead.
|
|
124
|
+
*/
|
|
125
|
+
export type RatePropsPublic = ExtractPublicPropTypes<typeof rateProps>;
|
|
126
|
+
export declare const rateEmits: {
|
|
127
|
+
change: (value: number) => boolean;
|
|
128
|
+
"update:modelValue": (value: number) => boolean;
|
|
129
|
+
};
|
|
130
|
+
export type RateEmits = typeof rateEmits;
|
|
131
|
+
export type RateInstance = InstanceType<typeof Rate> & unknown;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { StarFilled as e, Star as l } from "@element-plus/icons-vue";
|
|
2
|
+
import { UPDATE_MODEL_EVENT as p, CHANGE_EVENT as d } from "../../constants/event.js";
|
|
3
|
+
import { isNumber as r } from "../../utils/types.js";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@vue/shared";
|
|
7
|
+
import { mutable as i } from "../../utils/typescript.js";
|
|
8
|
+
import { iconPropType as a } from "../../utils/vue/icon.js";
|
|
9
|
+
import "vue";
|
|
10
|
+
import { buildProps as m, definePropType as t } from "../../utils/vue/props/runtime.js";
|
|
11
|
+
import { useSizeProp as u } from "../../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 { useAriaProps as f } from "../../hooks/use-aria/index.js";
|
|
16
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
17
|
+
import "../../hooks/use-empty-values/index.js";
|
|
18
|
+
const w = m({
|
|
19
|
+
/**
|
|
20
|
+
* @description binding value
|
|
21
|
+
*/
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* @description native `id` attribute
|
|
28
|
+
*/
|
|
29
|
+
id: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* @description threshold value between low and medium level. The value itself will be included in low level
|
|
35
|
+
*/
|
|
36
|
+
lowThreshold: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 2
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* @description threshold value between medium and high level. The value itself will be included in high level
|
|
42
|
+
*/
|
|
43
|
+
highThreshold: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 4
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* @description max rating score
|
|
49
|
+
*/
|
|
50
|
+
max: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 5
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* @description colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color
|
|
56
|
+
*/
|
|
57
|
+
colors: {
|
|
58
|
+
type: t([Array, Object]),
|
|
59
|
+
default: () => i(["", "", ""])
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* @description color of unselected icons
|
|
63
|
+
*/
|
|
64
|
+
voidColor: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ""
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* @description color of unselected read-only icons
|
|
70
|
+
*/
|
|
71
|
+
disabledVoidColor: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: ""
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* @description icon components. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding icon component
|
|
77
|
+
*/
|
|
78
|
+
icons: {
|
|
79
|
+
type: t([Array, Object]),
|
|
80
|
+
default: () => [e, e, e]
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* @description component of unselected icons
|
|
84
|
+
*/
|
|
85
|
+
voidIcon: {
|
|
86
|
+
type: a,
|
|
87
|
+
default: () => l
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* @description component of unselected read-only icons
|
|
91
|
+
*/
|
|
92
|
+
disabledVoidIcon: {
|
|
93
|
+
type: a,
|
|
94
|
+
default: () => e
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* @description whether Rate is read-only
|
|
98
|
+
*/
|
|
99
|
+
disabled: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: void 0
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* @description whether picking half start is allowed
|
|
105
|
+
*/
|
|
106
|
+
allowHalf: Boolean,
|
|
107
|
+
/**
|
|
108
|
+
* @description whether to display texts
|
|
109
|
+
*/
|
|
110
|
+
showText: Boolean,
|
|
111
|
+
/**
|
|
112
|
+
* @description whether to display current score. show-score and show-text cannot be true at the same time
|
|
113
|
+
*/
|
|
114
|
+
showScore: Boolean,
|
|
115
|
+
/**
|
|
116
|
+
* @description color of texts
|
|
117
|
+
*/
|
|
118
|
+
textColor: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: ""
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* @description text array
|
|
124
|
+
*/
|
|
125
|
+
texts: {
|
|
126
|
+
type: t(Array),
|
|
127
|
+
default: () => i([
|
|
128
|
+
"Extremely bad",
|
|
129
|
+
"Disappointed",
|
|
130
|
+
"Fair",
|
|
131
|
+
"Satisfied",
|
|
132
|
+
"Surprise"
|
|
133
|
+
])
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* @description score template
|
|
137
|
+
*/
|
|
138
|
+
scoreTemplate: {
|
|
139
|
+
type: String,
|
|
140
|
+
default: "{value}"
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* @description size of Rate
|
|
144
|
+
*/
|
|
145
|
+
size: u,
|
|
146
|
+
/**
|
|
147
|
+
* @description whether value can be reset to `0`
|
|
148
|
+
*/
|
|
149
|
+
clearable: Boolean,
|
|
150
|
+
...f(["ariaLabel"])
|
|
151
|
+
}), C = {
|
|
152
|
+
[d]: (o) => r(o),
|
|
153
|
+
[p]: (o) => r(o)
|
|
154
|
+
};
|
|
155
|
+
export {
|
|
156
|
+
C as rateEmits,
|
|
157
|
+
w as rateProps
|
|
158
|
+
};
|