@wfrog/vc-ui 1.0.0
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/README.md +95 -0
- package/dist/es/chunk/-EkpfdcW.mjs +1100 -0
- package/dist/es/chunk/8rLUmOVR.mjs +29 -0
- package/dist/es/chunk/B-rxnVJv.mjs +3 -0
- package/dist/es/chunk/BAGoDD49.mjs +36 -0
- package/dist/es/chunk/BAtns-Mc.mjs +96 -0
- package/dist/es/chunk/BJS5Pdfp.mjs +55 -0
- package/dist/es/chunk/BMzd-IS6.mjs +900 -0
- package/dist/es/chunk/BWcCXRRK.mjs +229 -0
- package/dist/es/chunk/BX-Ogf7p.mjs +3743 -0
- package/dist/es/chunk/B_tU9Nax.mjs +49 -0
- package/dist/es/chunk/BdDihk0t.mjs +3420 -0
- package/dist/es/chunk/C2LgraHx.mjs +489 -0
- package/dist/es/chunk/C5hWsUfD.mjs +64 -0
- package/dist/es/chunk/C7iSSBUr.mjs +303 -0
- package/dist/es/chunk/CD98REcR.mjs +666 -0
- package/dist/es/chunk/CEClY-_T.mjs +445 -0
- package/dist/es/chunk/CEm0brzD.mjs +35 -0
- package/dist/es/chunk/CMABHk8B.mjs +1942 -0
- package/dist/es/chunk/CS4VKsqy.mjs +19 -0
- package/dist/es/chunk/CVlj9F0I.mjs +291 -0
- package/dist/es/chunk/CZ4ggqDE.mjs +140 -0
- package/dist/es/chunk/CaTfZePA.mjs +533 -0
- package/dist/es/chunk/Ce9ApjrT.mjs +201 -0
- package/dist/es/chunk/ClZGuAIb.mjs +10 -0
- package/dist/es/chunk/Coex0GxM.mjs +450 -0
- package/dist/es/chunk/Ct6q2FXg.mjs +5 -0
- package/dist/es/chunk/CyxEcbcy.mjs +29 -0
- package/dist/es/chunk/D389hx_T.mjs +35 -0
- package/dist/es/chunk/D3DXeVfC.mjs +1171 -0
- package/dist/es/chunk/D3uV7vm-.mjs +45 -0
- package/dist/es/chunk/D5259bwd.mjs +50 -0
- package/dist/es/chunk/DMHNh_tw.mjs +49 -0
- package/dist/es/chunk/DVNTpOBR.mjs +4 -0
- package/dist/es/chunk/DZACQ9LT.mjs +95 -0
- package/dist/es/chunk/De_EXLIy.mjs +22 -0
- package/dist/es/chunk/Dh4jaUSg.mjs +89 -0
- package/dist/es/chunk/DhhdKtyu.mjs +439 -0
- package/dist/es/chunk/DqUIKX7f.mjs +2039 -0
- package/dist/es/chunk/Dqz1zvKN.mjs +59 -0
- package/dist/es/chunk/Dvi7RsXg.mjs +727 -0
- package/dist/es/chunk/DyDMGLoF.mjs +123 -0
- package/dist/es/chunk/E_WRn0OP.mjs +449 -0
- package/dist/es/chunk/Fo0dZYnz.mjs +128 -0
- package/dist/es/chunk/HSv8BL8o.mjs +72 -0
- package/dist/es/chunk/JCIyOUEY.mjs +105 -0
- package/dist/es/chunk/O-uhUKF4.mjs +43 -0
- package/dist/es/chunk/Spa-JKB4.mjs +1046 -0
- package/dist/es/chunk/VAdRxe-1.mjs +16 -0
- package/dist/es/chunk/VCrtRnxt.mjs +1477 -0
- package/dist/es/chunk/ViP2SEY4.mjs +211 -0
- package/dist/es/chunk/aibQ9WSZ.mjs +249 -0
- package/dist/es/chunk/nWBcrYxV.mjs +690 -0
- package/dist/es/chunk/pcqpp-6-.mjs +9 -0
- package/dist/es/chunk/qY9OvNHY.mjs +283 -0
- package/dist/es/chunk/su2Zrql0.mjs +53 -0
- package/dist/es/chunk/zfg5SOj1.mjs +138 -0
- package/dist/es/components/awesome-icon/awesome-icon.d.ts +6 -0
- package/dist/es/components/awesome-icon/awesome-icon.mjs +41 -0
- package/dist/es/components/awesome-icon/awesome-icon.vue.d.ts +5 -0
- package/dist/es/components/awesome-icon/index.d.ts +4 -0
- package/dist/es/components/awesome-icon/index.mjs +6 -0
- package/dist/es/components/backbottom/backbottom.d.ts +7 -0
- package/dist/es/components/backbottom/backbottom.mjs +172 -0
- package/dist/es/components/backbottom/backbottom.vue.d.ts +7 -0
- package/dist/es/components/backbottom/components/child.vue.d.ts +30 -0
- package/dist/es/components/backbottom/index.d.ts +4 -0
- package/dist/es/components/backbottom/index.mjs +6 -0
- package/dist/es/components/button/button.d.ts +18 -0
- package/dist/es/components/button/button.mjs +313 -0
- package/dist/es/components/button/button.vue.d.ts +33 -0
- package/dist/es/components/button/index.css +9 -0
- package/dist/es/components/button/index.d.ts +4 -0
- package/dist/es/components/button/index.mjs +6 -0
- package/dist/es/components/cdn-tag.vue.d.ts +5 -0
- package/dist/es/components/chat-container/chat-container.d.ts +9 -0
- package/dist/es/components/chat-container/chat-container.mjs +77 -0
- package/dist/es/components/chat-container/chat-container.vue.d.ts +29 -0
- package/dist/es/components/chat-container/index.css +9 -0
- package/dist/es/components/chat-container/index.d.ts +4 -0
- package/dist/es/components/chat-container/index.mjs +6 -0
- package/dist/es/components/choice/choice.d.ts +6 -0
- package/dist/es/components/choice/choice.mjs +53 -0
- package/dist/es/components/choice/choice.vue.d.ts +5 -0
- package/dist/es/components/choice/index.css +7 -0
- package/dist/es/components/choice/index.d.ts +4 -0
- package/dist/es/components/choice/index.mjs +6 -0
- package/dist/es/components/choice-boolean/choice-boolean.d.ts +5 -0
- package/dist/es/components/choice-boolean/choice-boolean.mjs +32 -0
- package/dist/es/components/choice-boolean/choice-boolean.vue.d.ts +10 -0
- package/dist/es/components/choice-boolean/index.d.ts +4 -0
- package/dist/es/components/choice-boolean/index.mjs +6 -0
- package/dist/es/components/config-provider/config-provider.d.ts +16 -0
- package/dist/es/components/config-provider/config-provider.mjs +29 -0
- package/dist/es/components/config-provider/config-provider.vue.d.ts +18 -0
- package/dist/es/components/config-provider/config-provider2.mjs +6 -0
- package/dist/es/components/config-provider/index.d.ts +4 -0
- package/dist/es/components/config-provider/index.mjs +6 -0
- package/dist/es/components/cropper/cropper.d.ts +12 -0
- package/dist/es/components/cropper/cropper.mjs +333 -0
- package/dist/es/components/cropper/cropper.vue.d.ts +32 -0
- package/dist/es/components/cropper/index.css +4 -0
- package/dist/es/components/cropper/index.d.ts +4 -0
- package/dist/es/components/cropper/index.mjs +6 -0
- package/dist/es/components/currency/currency.d.ts +21 -0
- package/dist/es/components/currency/currency.mjs +185 -0
- package/dist/es/components/currency/currency.vue.d.ts +14 -0
- package/dist/es/components/currency/index.css +8 -0
- package/dist/es/components/currency/index.d.ts +4 -0
- package/dist/es/components/currency/index.mjs +6 -0
- package/dist/es/components/daterange-picker/daterange-picker.d.ts +6 -0
- package/dist/es/components/daterange-picker/daterange-picker.mjs +5550 -0
- package/dist/es/components/daterange-picker/daterange-picker.vue.d.ts +13 -0
- package/dist/es/components/daterange-picker/index.d.ts +4 -0
- package/dist/es/components/daterange-picker/index.mjs +6 -0
- package/dist/es/components/dialog/dialog.d.ts +13 -0
- package/dist/es/components/dialog/dialog.mjs +537 -0
- package/dist/es/components/dialog/dialog.vue.d.ts +38 -0
- package/dist/es/components/dialog/index.css +87 -0
- package/dist/es/components/dialog/index.d.ts +4 -0
- package/dist/es/components/dialog/index.mjs +6 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.d.ts +33 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +412 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.vue.d.ts +23 -0
- package/dist/es/components/dialog-camera-upload/index.css +66 -0
- package/dist/es/components/dialog-camera-upload/index.d.ts +4 -0
- package/dist/es/components/dialog-camera-upload/index.mjs +6 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.d.ts +9 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +183 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.vue.d.ts +22 -0
- package/dist/es/components/dialog-map-point/index.css +11 -0
- package/dist/es/components/dialog-map-point/index.d.ts +4 -0
- package/dist/es/components/dialog-map-point/index.mjs +6 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.d.ts +16 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +1391 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.vue.d.ts +19 -0
- package/dist/es/components/dialog-upload-images/index.css +62 -0
- package/dist/es/components/dialog-upload-images/index.d.ts +4 -0
- package/dist/es/components/dialog-upload-images/index.mjs +6 -0
- package/dist/es/components/document.vue.d.ts +14 -0
- package/dist/es/components/drawer/drawer.d.ts +7 -0
- package/dist/es/components/drawer/drawer.mjs +412 -0
- package/dist/es/components/drawer/drawer.vue.d.ts +31 -0
- package/dist/es/components/drawer/index.css +56 -0
- package/dist/es/components/drawer/index.d.ts +4 -0
- package/dist/es/components/drawer/index.mjs +6 -0
- package/dist/es/components/easy-pagination/easy-pagination.d.ts +8 -0
- package/dist/es/components/easy-pagination/easy-pagination.mjs +74 -0
- package/dist/es/components/easy-pagination/easy-pagination.vue.d.ts +19 -0
- package/dist/es/components/easy-pagination/index.css +10 -0
- package/dist/es/components/easy-pagination/index.d.ts +4 -0
- package/dist/es/components/easy-pagination/index.mjs +6 -0
- package/dist/es/components/el-icon/el-icon.d.ts +6 -0
- package/dist/es/components/el-icon/el-icon.mjs +46 -0
- package/dist/es/components/el-icon/el-icon.vue.d.ts +6 -0
- package/dist/es/components/el-icon/index.css +7 -0
- package/dist/es/components/el-icon/index.d.ts +4 -0
- package/dist/es/components/el-icon/index.mjs +6 -0
- package/dist/es/components/example-wrapper.vue.d.ts +19 -0
- package/dist/es/components/flag/flag.mjs +44 -0
- package/dist/es/components/flag/flag.vue.d.ts +5 -0
- package/dist/es/components/flag/flags.d.ts +8 -0
- package/dist/es/components/flag/index.d.ts +4 -0
- package/dist/es/components/flag/index.mjs +6 -0
- package/dist/es/components/icon/icon.d.ts +6 -0
- package/dist/es/components/icon/icon.mjs +54 -0
- package/dist/es/components/icon/icon.vue.d.ts +3 -0
- package/dist/es/components/icon/icon2.mjs +27 -0
- package/dist/es/components/icon/index.css +9 -0
- package/dist/es/components/icon/index.d.ts +4 -0
- package/dist/es/components/icon/index.mjs +6 -0
- package/dist/es/components/image/image.d.ts +16 -0
- package/dist/es/components/image/image.mjs +167 -0
- package/dist/es/components/image/image.vue.d.ts +206 -0
- package/dist/es/components/image/index.css +20 -0
- package/dist/es/components/image/index.d.ts +4 -0
- package/dist/es/components/image/index.mjs +6 -0
- package/dist/es/components/input/index.css +9 -0
- package/dist/es/components/input/index.d.ts +4 -0
- package/dist/es/components/input/index.mjs +6 -0
- package/dist/es/components/input/input.d.ts +4 -0
- package/dist/es/components/input/input.mjs +85 -0
- package/dist/es/components/input/input.vue.d.ts +1232 -0
- package/dist/es/components/input-number/index.css +24 -0
- package/dist/es/components/input-number/index.d.ts +4 -0
- package/dist/es/components/input-number/index.mjs +6 -0
- package/dist/es/components/input-number/input-number.d.ts +8 -0
- package/dist/es/components/input-number/input-number.mjs +137 -0
- package/dist/es/components/input-number/input-number.vue.d.ts +35 -0
- package/dist/es/components/pca-picker/components/c.vue.d.ts +123 -0
- package/dist/es/components/pca-picker/components/elevator-item.vue.d.ts +7 -0
- package/dist/es/components/pca-picker/components/filter.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/history.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/hot.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/p.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/pca.vue.d.ts +9 -0
- package/dist/es/components/pca-picker/index.css +107 -0
- package/dist/es/components/pca-picker/index.d.ts +4 -0
- package/dist/es/components/pca-picker/index.mjs +6 -0
- package/dist/es/components/pca-picker/pca-picker.d.ts +78 -0
- package/dist/es/components/pca-picker/pca-picker.mjs +1667 -0
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +583 -0
- package/dist/es/components/qr-code/index.d.ts +4 -0
- package/dist/es/components/qr-code/index.mjs +6 -0
- package/dist/es/components/qr-code/qr-code.d.ts +9 -0
- package/dist/es/components/qr-code/qr-code.mjs +69 -0
- package/dist/es/components/qr-code/qr-code.vue.d.ts +13 -0
- package/dist/es/components/screenfull/index.css +14 -0
- package/dist/es/components/screenfull/index.d.ts +4 -0
- package/dist/es/components/screenfull/index.mjs +6 -0
- package/dist/es/components/screenfull/screenfull.d.ts +4 -0
- package/dist/es/components/screenfull/screenfull.mjs +91 -0
- package/dist/es/components/screenfull/screenfull.vue.d.ts +20 -0
- package/dist/es/components/select/index.css +9 -0
- package/dist/es/components/select/index.d.ts +4 -0
- package/dist/es/components/select/index.mjs +6 -0
- package/dist/es/components/select/select.d.ts +6 -0
- package/dist/es/components/select/select.mjs +63 -0
- package/dist/es/components/select/select.vue.d.ts +6 -0
- package/dist/es/components/single-player/index.css +45 -0
- package/dist/es/components/single-player/index.d.ts +4 -0
- package/dist/es/components/single-player/index.mjs +6 -0
- package/dist/es/components/single-player/single-player.d.ts +4 -0
- package/dist/es/components/single-player/single-player.mjs +1172 -0
- package/dist/es/components/single-player/single-player.vue.d.ts +13 -0
- package/dist/es/components/svg-icon/index.css +9 -0
- package/dist/es/components/svg-icon/index.d.ts +4 -0
- package/dist/es/components/svg-icon/index.mjs +6 -0
- package/dist/es/components/svg-icon/svg-icon.d.ts +5 -0
- package/dist/es/components/svg-icon/svg-icon.mjs +46 -0
- package/dist/es/components/svg-icon/svg-icon.vue.d.ts +18 -0
- package/dist/es/components/switch/index.css +15 -0
- package/dist/es/components/switch/index.d.ts +4 -0
- package/dist/es/components/switch/index.mjs +6 -0
- package/dist/es/components/switch/switch.d.ts +9 -0
- package/dist/es/components/switch/switch.mjs +82 -0
- package/dist/es/components/switch/switch.vue.d.ts +14 -0
- package/dist/es/components/sync-scroll-container/index.css +82 -0
- package/dist/es/components/sync-scroll-container/index.d.ts +4 -0
- package/dist/es/components/sync-scroll-container/index.mjs +6 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.d.ts +6 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +157 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.vue.d.ts +36 -0
- package/dist/es/components/tags/index.css +17 -0
- package/dist/es/components/tags/index.d.ts +4 -0
- package/dist/es/components/tags/index.mjs +6 -0
- package/dist/es/components/tags/tags.d.ts +9 -0
- package/dist/es/components/tags/tags.mjs +296 -0
- package/dist/es/components/tags/tags.vue.d.ts +20 -0
- package/dist/es/components/text-ellipsis/index.css +15 -0
- package/dist/es/components/text-ellipsis/index.d.ts +4 -0
- package/dist/es/components/text-ellipsis/index.mjs +6 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.d.ts +12 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +137 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.vue.d.ts +41 -0
- package/dist/es/components/thousand-input/index.css +4 -0
- package/dist/es/components/thousand-input/index.d.ts +4 -0
- package/dist/es/components/thousand-input/index.mjs +6 -0
- package/dist/es/components/thousand-input/thousand-input.d.ts +11 -0
- package/dist/es/components/thousand-input/thousand-input.mjs +159 -0
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +2558 -0
- package/dist/es/components/tinymce/config.d.ts +25 -0
- package/dist/es/components/tinymce/index.css +9 -0
- package/dist/es/components/tinymce/index.d.ts +4 -0
- package/dist/es/components/tinymce/index.mjs +6 -0
- package/dist/es/components/tinymce/tinymce.d.ts +9 -0
- package/dist/es/components/tinymce/tinymce.mjs +176 -0
- package/dist/es/components/tinymce/tinymce.vue.d.ts +20 -0
- package/dist/es/components/tree-picker/components/popover-cascader.d.ts +8 -0
- package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +1361 -0
- package/dist/es/components/tree-picker/docs/data.d.ts +2 -0
- package/dist/es/components/tree-picker/index.css +41 -0
- package/dist/es/components/tree-picker/index.d.ts +4 -0
- package/dist/es/components/tree-picker/index.mjs +6 -0
- package/dist/es/components/tree-picker/popover-cascader.css +23 -0
- package/dist/es/components/tree-picker/tree-picker.d.ts +14 -0
- package/dist/es/components/tree-picker/tree-picker.mjs +173 -0
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +575 -0
- package/dist/es/components/upload-file/index.css +30 -0
- package/dist/es/components/upload-file/index.d.ts +4 -0
- package/dist/es/components/upload-file/index.mjs +6 -0
- package/dist/es/components/upload-file/upload-file.d.ts +39 -0
- package/dist/es/components/upload-file/upload-file.mjs +202 -0
- package/dist/es/components/upload-file/upload-file.vue.d.ts +30 -0
- package/dist/es/directives/cleave/index.d.ts +3 -0
- package/dist/es/directives/focus/index.d.ts +4 -0
- package/dist/es/directives/index.d.ts +3 -0
- package/dist/es/directives/thousand/index.d.ts +3 -0
- package/dist/es/index.d.ts +42 -0
- package/dist/es/index.mjs +122 -0
- package/dist/es/use/useSmallScreen/index.d.ts +4 -0
- package/dist/es/use/useSmallScreen/index.mjs +10 -0
- package/dist/es/use/useStore/index.d.ts +3 -0
- package/dist/es/use/useStore/index.mjs +22 -0
- package/dist/es/utils/index.d.ts +6 -0
- package/dist/es/utils/resolver.d.ts +3 -0
- package/dist/es/utils/resolver.mjs +24 -0
- package/dist/es/utils/typescript.d.ts +6 -0
- package/dist/global.d.ts +42 -0
- package/dist/index.css +869 -0
- package/package.json +58 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { defineComponent, computed, h, renderSlot, ref, watchEffect, createVNode, createTextVNode, isVNode, Comment } from 'vue';
|
|
2
|
+
import { c as buildProps, u as useNamespace, i as isArray, f as isNumber, h as isString, d as definePropType } from './E_WRn0OP.mjs';
|
|
3
|
+
import { P as PatchFlags, i as isFragment, a as isValidElementNode } from './B_tU9Nax.mjs';
|
|
4
|
+
import { c as componentSizes } from './CS4VKsqy.mjs';
|
|
5
|
+
import { w as withInstall } from './D389hx_T.mjs';
|
|
6
|
+
|
|
7
|
+
const spaceItemProps = buildProps({
|
|
8
|
+
prefixCls: {
|
|
9
|
+
type: String
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
const SpaceItem = defineComponent({
|
|
13
|
+
name: "ElSpaceItem",
|
|
14
|
+
props: spaceItemProps,
|
|
15
|
+
setup(props, { slots }) {
|
|
16
|
+
const ns = useNamespace("space");
|
|
17
|
+
const classes = computed(() => `${props.prefixCls || ns.b()}__item`);
|
|
18
|
+
return () => h("div", { class: classes.value }, renderSlot(slots, "default"));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const SIZE_MAP = {
|
|
23
|
+
small: 8,
|
|
24
|
+
default: 12,
|
|
25
|
+
large: 16
|
|
26
|
+
};
|
|
27
|
+
function useSpace(props) {
|
|
28
|
+
const ns = useNamespace("space");
|
|
29
|
+
const classes = computed(() => [ns.b(), ns.m(props.direction), props.class]);
|
|
30
|
+
const horizontalSize = ref(0);
|
|
31
|
+
const verticalSize = ref(0);
|
|
32
|
+
const containerStyle = computed(() => {
|
|
33
|
+
const wrapKls = props.wrap || props.fill ? { flexWrap: "wrap" } : {};
|
|
34
|
+
const alignment = {
|
|
35
|
+
alignItems: props.alignment
|
|
36
|
+
};
|
|
37
|
+
const gap = {
|
|
38
|
+
rowGap: `${verticalSize.value}px`,
|
|
39
|
+
columnGap: `${horizontalSize.value}px`
|
|
40
|
+
};
|
|
41
|
+
return [wrapKls, alignment, gap, props.style];
|
|
42
|
+
});
|
|
43
|
+
const itemStyle = computed(() => {
|
|
44
|
+
return props.fill ? { flexGrow: 1, minWidth: `${props.fillRatio}%` } : {};
|
|
45
|
+
});
|
|
46
|
+
watchEffect(() => {
|
|
47
|
+
const { size = "small", wrap, direction: dir, fill } = props;
|
|
48
|
+
if (isArray(size)) {
|
|
49
|
+
const [h = 0, v = 0] = size;
|
|
50
|
+
horizontalSize.value = h;
|
|
51
|
+
verticalSize.value = v;
|
|
52
|
+
} else {
|
|
53
|
+
let val;
|
|
54
|
+
if (isNumber(size)) {
|
|
55
|
+
val = size;
|
|
56
|
+
} else {
|
|
57
|
+
val = SIZE_MAP[size || "small"] || SIZE_MAP.small;
|
|
58
|
+
}
|
|
59
|
+
if ((wrap || fill) && dir === "horizontal") {
|
|
60
|
+
horizontalSize.value = verticalSize.value = val;
|
|
61
|
+
} else {
|
|
62
|
+
if (dir === "horizontal") {
|
|
63
|
+
horizontalSize.value = val;
|
|
64
|
+
verticalSize.value = 0;
|
|
65
|
+
} else {
|
|
66
|
+
verticalSize.value = val;
|
|
67
|
+
horizontalSize.value = 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
classes,
|
|
74
|
+
containerStyle,
|
|
75
|
+
itemStyle
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const spaceProps = buildProps({
|
|
80
|
+
direction: {
|
|
81
|
+
type: String,
|
|
82
|
+
values: ["horizontal", "vertical"],
|
|
83
|
+
default: "horizontal"
|
|
84
|
+
},
|
|
85
|
+
class: {
|
|
86
|
+
type: definePropType([
|
|
87
|
+
String,
|
|
88
|
+
Object,
|
|
89
|
+
Array
|
|
90
|
+
]),
|
|
91
|
+
default: ""
|
|
92
|
+
},
|
|
93
|
+
style: {
|
|
94
|
+
type: definePropType([String, Array, Object]),
|
|
95
|
+
default: ""
|
|
96
|
+
},
|
|
97
|
+
alignment: {
|
|
98
|
+
type: definePropType(String),
|
|
99
|
+
default: "center"
|
|
100
|
+
},
|
|
101
|
+
prefixCls: {
|
|
102
|
+
type: String
|
|
103
|
+
},
|
|
104
|
+
spacer: {
|
|
105
|
+
type: definePropType([Object, String, Number, Array]),
|
|
106
|
+
default: null,
|
|
107
|
+
validator: (val) => isVNode(val) || isNumber(val) || isString(val)
|
|
108
|
+
},
|
|
109
|
+
wrap: Boolean,
|
|
110
|
+
fill: Boolean,
|
|
111
|
+
fillRatio: {
|
|
112
|
+
type: Number,
|
|
113
|
+
default: 100
|
|
114
|
+
},
|
|
115
|
+
size: {
|
|
116
|
+
type: [String, Array, Number],
|
|
117
|
+
values: componentSizes,
|
|
118
|
+
validator: (val) => {
|
|
119
|
+
return isNumber(val) || isArray(val) && val.length === 2 && val.every(isNumber);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const Space = defineComponent({
|
|
124
|
+
name: "ElSpace",
|
|
125
|
+
props: spaceProps,
|
|
126
|
+
setup(props, { slots }) {
|
|
127
|
+
const { classes, containerStyle, itemStyle } = useSpace(props);
|
|
128
|
+
function extractChildren(children, parentKey = "", extractedChildren = []) {
|
|
129
|
+
const { prefixCls } = props;
|
|
130
|
+
children.forEach((child, loopKey) => {
|
|
131
|
+
if (isFragment(child)) {
|
|
132
|
+
if (isArray(child.children)) {
|
|
133
|
+
child.children.forEach((nested, key) => {
|
|
134
|
+
if (isFragment(nested) && isArray(nested.children)) {
|
|
135
|
+
extractChildren(nested.children, `${parentKey + key}-`, extractedChildren);
|
|
136
|
+
} else {
|
|
137
|
+
if (isVNode(nested) && (nested == null ? void 0 : nested.type) === Comment) {
|
|
138
|
+
extractedChildren.push(nested);
|
|
139
|
+
} else {
|
|
140
|
+
extractedChildren.push(createVNode(SpaceItem, {
|
|
141
|
+
style: itemStyle.value,
|
|
142
|
+
prefixCls,
|
|
143
|
+
key: `nested-${parentKey + key}`
|
|
144
|
+
}, {
|
|
145
|
+
default: () => [nested]
|
|
146
|
+
}, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
} else if (isValidElementNode(child)) {
|
|
152
|
+
extractedChildren.push(createVNode(SpaceItem, {
|
|
153
|
+
style: itemStyle.value,
|
|
154
|
+
prefixCls,
|
|
155
|
+
key: `LoopKey${parentKey + loopKey}`
|
|
156
|
+
}, {
|
|
157
|
+
default: () => [child]
|
|
158
|
+
}, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return extractedChildren;
|
|
162
|
+
}
|
|
163
|
+
return () => {
|
|
164
|
+
var _a;
|
|
165
|
+
const { spacer, direction } = props;
|
|
166
|
+
const children = renderSlot(slots, "default", { key: 0 }, () => []);
|
|
167
|
+
if (((_a = children.children) != null ? _a : []).length === 0)
|
|
168
|
+
return null;
|
|
169
|
+
if (isArray(children.children)) {
|
|
170
|
+
let extractedChildren = extractChildren(children.children);
|
|
171
|
+
if (spacer) {
|
|
172
|
+
const len = extractedChildren.length - 1;
|
|
173
|
+
extractedChildren = extractedChildren.reduce((acc, child, idx) => {
|
|
174
|
+
const children2 = [...acc, child];
|
|
175
|
+
if (idx !== len) {
|
|
176
|
+
children2.push(createVNode("span", {
|
|
177
|
+
style: [
|
|
178
|
+
itemStyle.value,
|
|
179
|
+
direction === "vertical" ? "width: 100%" : null
|
|
180
|
+
],
|
|
181
|
+
key: idx
|
|
182
|
+
}, [
|
|
183
|
+
isVNode(spacer) ? spacer : createTextVNode(spacer, PatchFlags.TEXT)
|
|
184
|
+
], PatchFlags.STYLE));
|
|
185
|
+
}
|
|
186
|
+
return children2;
|
|
187
|
+
}, []);
|
|
188
|
+
}
|
|
189
|
+
return createVNode("div", {
|
|
190
|
+
class: classes.value,
|
|
191
|
+
style: containerStyle.value
|
|
192
|
+
}, extractedChildren, PatchFlags.STYLE | PatchFlags.CLASS);
|
|
193
|
+
}
|
|
194
|
+
return children.children;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const ElSpace = withInstall(Space);
|
|
200
|
+
|
|
201
|
+
export { ElSpace as E };
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { defineComponent, ref, reactive, computed, watch, onMounted, onUpdated, createElementBlock, openBlock, withModifiers, normalizeClass, unref, withDirectives, createCommentVNode, createVNode, withKeys, renderSlot, withCtx, createBlock, createSlots } from 'vue';
|
|
2
|
+
import { E as ElInput } from './Dvi7RsXg.mjs';
|
|
3
|
+
import { E as ElIcon } from './DMHNh_tw.mjs';
|
|
4
|
+
import { ArrowDown, Minus, ArrowUp, Plus } from '@element-plus/icons-vue';
|
|
5
|
+
import { f as isNumber, k as isNil, c as buildProps, d as definePropType, u as useNamespace, g as isUndefined, e as debugWarn, t as throwError, h as isString } from './E_WRn0OP.mjs';
|
|
6
|
+
import { u as useSizeProp } from './CS4VKsqy.mjs';
|
|
7
|
+
import { u as useAriaProps } from './C2LgraHx.mjs';
|
|
8
|
+
import { U as UPDATE_MODEL_EVENT, I as INPUT_EVENT, C as CHANGE_EVENT } from './Ct6q2FXg.mjs';
|
|
9
|
+
import { _ as _export_sfc, w as withInstall } from './D389hx_T.mjs';
|
|
10
|
+
import { v as vRepeatClick } from './su2Zrql0.mjs';
|
|
11
|
+
import { g as getEventCode, a as getEventKey, E as EVENT_CODE } from './BJS5Pdfp.mjs';
|
|
12
|
+
import { u as useLocale } from './aibQ9WSZ.mjs';
|
|
13
|
+
import { u as useFormItem, c as useFormSize, b as useFormDisabled } from './DZACQ9LT.mjs';
|
|
14
|
+
|
|
15
|
+
const inputNumberProps = buildProps({
|
|
16
|
+
id: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
step: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 1
|
|
23
|
+
},
|
|
24
|
+
stepStrictly: Boolean,
|
|
25
|
+
max: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: Number.MAX_SAFE_INTEGER
|
|
28
|
+
},
|
|
29
|
+
min: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: Number.MIN_SAFE_INTEGER
|
|
32
|
+
},
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: [Number, null]
|
|
35
|
+
},
|
|
36
|
+
readonly: Boolean,
|
|
37
|
+
disabled: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
size: useSizeProp,
|
|
42
|
+
controls: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
controlsPosition: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "",
|
|
49
|
+
values: ["", "right"]
|
|
50
|
+
},
|
|
51
|
+
valueOnClear: {
|
|
52
|
+
type: [String, Number, null],
|
|
53
|
+
validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
|
|
54
|
+
default: null
|
|
55
|
+
},
|
|
56
|
+
name: String,
|
|
57
|
+
placeholder: String,
|
|
58
|
+
precision: {
|
|
59
|
+
type: Number,
|
|
60
|
+
validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
|
|
61
|
+
},
|
|
62
|
+
validateEvent: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: true
|
|
65
|
+
},
|
|
66
|
+
...useAriaProps(["ariaLabel"]),
|
|
67
|
+
inputmode: {
|
|
68
|
+
type: definePropType(String),
|
|
69
|
+
default: void 0
|
|
70
|
+
},
|
|
71
|
+
align: {
|
|
72
|
+
type: definePropType(String),
|
|
73
|
+
default: "center"
|
|
74
|
+
},
|
|
75
|
+
disabledScientific: Boolean
|
|
76
|
+
});
|
|
77
|
+
const inputNumberEmits = {
|
|
78
|
+
[CHANGE_EVENT]: (cur, prev) => prev !== cur,
|
|
79
|
+
blur: (e) => e instanceof FocusEvent,
|
|
80
|
+
focus: (e) => e instanceof FocusEvent,
|
|
81
|
+
[INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
|
|
82
|
+
[UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const __default__ = defineComponent({
|
|
86
|
+
name: "ElInputNumber"
|
|
87
|
+
});
|
|
88
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
89
|
+
...__default__,
|
|
90
|
+
props: inputNumberProps,
|
|
91
|
+
emits: inputNumberEmits,
|
|
92
|
+
setup(__props, { expose, emit }) {
|
|
93
|
+
const props = __props;
|
|
94
|
+
const { t } = useLocale();
|
|
95
|
+
const ns = useNamespace("input-number");
|
|
96
|
+
const input = ref();
|
|
97
|
+
const data = reactive({
|
|
98
|
+
currentValue: props.modelValue,
|
|
99
|
+
userInput: null
|
|
100
|
+
});
|
|
101
|
+
const { formItem } = useFormItem();
|
|
102
|
+
const minDisabled = computed(() => isNumber(props.modelValue) && props.modelValue <= props.min);
|
|
103
|
+
const maxDisabled = computed(() => isNumber(props.modelValue) && props.modelValue >= props.max);
|
|
104
|
+
const numPrecision = computed(() => {
|
|
105
|
+
const stepPrecision = getPrecision(props.step);
|
|
106
|
+
if (!isUndefined(props.precision)) {
|
|
107
|
+
if (stepPrecision > props.precision) {
|
|
108
|
+
debugWarn("InputNumber", "precision should not be less than the decimal places of step");
|
|
109
|
+
}
|
|
110
|
+
return props.precision;
|
|
111
|
+
} else {
|
|
112
|
+
return Math.max(getPrecision(props.modelValue), stepPrecision);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const controlsAtRight = computed(() => {
|
|
116
|
+
return props.controls && props.controlsPosition === "right";
|
|
117
|
+
});
|
|
118
|
+
const inputNumberSize = useFormSize();
|
|
119
|
+
const inputNumberDisabled = useFormDisabled();
|
|
120
|
+
const displayValue = computed(() => {
|
|
121
|
+
if (data.userInput !== null) {
|
|
122
|
+
return data.userInput;
|
|
123
|
+
}
|
|
124
|
+
let currentValue = data.currentValue;
|
|
125
|
+
if (isNil(currentValue))
|
|
126
|
+
return "";
|
|
127
|
+
if (isNumber(currentValue)) {
|
|
128
|
+
if (Number.isNaN(currentValue))
|
|
129
|
+
return "";
|
|
130
|
+
if (!isUndefined(props.precision)) {
|
|
131
|
+
currentValue = currentValue.toFixed(props.precision);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return currentValue;
|
|
135
|
+
});
|
|
136
|
+
const toPrecision = (num, pre) => {
|
|
137
|
+
if (isUndefined(pre))
|
|
138
|
+
pre = numPrecision.value;
|
|
139
|
+
if (pre === 0)
|
|
140
|
+
return Math.round(num);
|
|
141
|
+
let snum = String(num);
|
|
142
|
+
const pointPos = snum.indexOf(".");
|
|
143
|
+
if (pointPos === -1)
|
|
144
|
+
return num;
|
|
145
|
+
const nums = snum.replace(".", "").split("");
|
|
146
|
+
const datum = nums[pointPos + pre];
|
|
147
|
+
if (!datum)
|
|
148
|
+
return num;
|
|
149
|
+
const length = snum.length;
|
|
150
|
+
if (snum.charAt(length - 1) === "5") {
|
|
151
|
+
snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
|
|
152
|
+
}
|
|
153
|
+
return Number.parseFloat(Number(snum).toFixed(pre));
|
|
154
|
+
};
|
|
155
|
+
const getPrecision = (value) => {
|
|
156
|
+
if (isNil(value))
|
|
157
|
+
return 0;
|
|
158
|
+
const valueString = value.toString();
|
|
159
|
+
const dotPosition = valueString.indexOf(".");
|
|
160
|
+
let precision = 0;
|
|
161
|
+
if (dotPosition !== -1) {
|
|
162
|
+
precision = valueString.length - dotPosition - 1;
|
|
163
|
+
}
|
|
164
|
+
return precision;
|
|
165
|
+
};
|
|
166
|
+
const ensurePrecision = (val, coefficient = 1) => {
|
|
167
|
+
if (!isNumber(val))
|
|
168
|
+
return data.currentValue;
|
|
169
|
+
if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {
|
|
170
|
+
debugWarn("InputNumber", "The value has reached the maximum safe integer limit.");
|
|
171
|
+
return val;
|
|
172
|
+
} else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {
|
|
173
|
+
debugWarn("InputNumber", "The value has reached the minimum safe integer limit.");
|
|
174
|
+
return val;
|
|
175
|
+
}
|
|
176
|
+
return toPrecision(val + props.step * coefficient);
|
|
177
|
+
};
|
|
178
|
+
const handleKeydown = (event) => {
|
|
179
|
+
const code = getEventCode(event);
|
|
180
|
+
const key = getEventKey(event);
|
|
181
|
+
if (props.disabledScientific && ["e", "E"].includes(key)) {
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
switch (code) {
|
|
186
|
+
case EVENT_CODE.up: {
|
|
187
|
+
event.preventDefault();
|
|
188
|
+
increase();
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
case EVENT_CODE.down: {
|
|
192
|
+
event.preventDefault();
|
|
193
|
+
decrease();
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const increase = () => {
|
|
199
|
+
if (props.readonly || inputNumberDisabled.value || maxDisabled.value)
|
|
200
|
+
return;
|
|
201
|
+
const value = Number(displayValue.value) || 0;
|
|
202
|
+
const newVal = ensurePrecision(value);
|
|
203
|
+
setCurrentValue(newVal);
|
|
204
|
+
emit(INPUT_EVENT, data.currentValue);
|
|
205
|
+
setCurrentValueToModelValue();
|
|
206
|
+
};
|
|
207
|
+
const decrease = () => {
|
|
208
|
+
if (props.readonly || inputNumberDisabled.value || minDisabled.value)
|
|
209
|
+
return;
|
|
210
|
+
const value = Number(displayValue.value) || 0;
|
|
211
|
+
const newVal = ensurePrecision(value, -1);
|
|
212
|
+
setCurrentValue(newVal);
|
|
213
|
+
emit(INPUT_EVENT, data.currentValue);
|
|
214
|
+
setCurrentValueToModelValue();
|
|
215
|
+
};
|
|
216
|
+
const verifyValue = (value, update) => {
|
|
217
|
+
const { max, min, step, precision, stepStrictly, valueOnClear } = props;
|
|
218
|
+
if (max < min) {
|
|
219
|
+
throwError("InputNumber", "min should not be greater than max.");
|
|
220
|
+
}
|
|
221
|
+
let newVal = Number(value);
|
|
222
|
+
if (isNil(value) || Number.isNaN(newVal)) {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
if (value === "") {
|
|
226
|
+
if (valueOnClear === null) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear;
|
|
230
|
+
}
|
|
231
|
+
if (stepStrictly) {
|
|
232
|
+
newVal = toPrecision(Math.round(toPrecision(newVal / step)) * step, precision);
|
|
233
|
+
if (newVal !== value) {
|
|
234
|
+
update && emit(UPDATE_MODEL_EVENT, newVal);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (!isUndefined(precision)) {
|
|
238
|
+
newVal = toPrecision(newVal, precision);
|
|
239
|
+
}
|
|
240
|
+
if (newVal > max || newVal < min) {
|
|
241
|
+
newVal = newVal > max ? max : min;
|
|
242
|
+
update && emit(UPDATE_MODEL_EVENT, newVal);
|
|
243
|
+
}
|
|
244
|
+
return newVal;
|
|
245
|
+
};
|
|
246
|
+
const setCurrentValue = (value, emitChange = true) => {
|
|
247
|
+
var _a;
|
|
248
|
+
const oldVal = data.currentValue;
|
|
249
|
+
const newVal = verifyValue(value);
|
|
250
|
+
if (!emitChange) {
|
|
251
|
+
emit(UPDATE_MODEL_EVENT, newVal);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
data.userInput = null;
|
|
255
|
+
if (oldVal === newVal && value)
|
|
256
|
+
return;
|
|
257
|
+
emit(UPDATE_MODEL_EVENT, newVal);
|
|
258
|
+
if (oldVal !== newVal) {
|
|
259
|
+
emit(CHANGE_EVENT, newVal, oldVal);
|
|
260
|
+
}
|
|
261
|
+
if (props.validateEvent) {
|
|
262
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
|
|
263
|
+
}
|
|
264
|
+
data.currentValue = newVal;
|
|
265
|
+
};
|
|
266
|
+
const handleInput = (value) => {
|
|
267
|
+
data.userInput = value;
|
|
268
|
+
const newVal = value === "" ? null : Number(value);
|
|
269
|
+
emit(INPUT_EVENT, newVal);
|
|
270
|
+
setCurrentValue(newVal, false);
|
|
271
|
+
};
|
|
272
|
+
const handleInputChange = (value) => {
|
|
273
|
+
const newVal = value !== "" ? Number(value) : "";
|
|
274
|
+
if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
|
|
275
|
+
setCurrentValue(newVal);
|
|
276
|
+
}
|
|
277
|
+
setCurrentValueToModelValue();
|
|
278
|
+
data.userInput = null;
|
|
279
|
+
};
|
|
280
|
+
const focus = () => {
|
|
281
|
+
var _a, _b;
|
|
282
|
+
(_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
283
|
+
};
|
|
284
|
+
const blur = () => {
|
|
285
|
+
var _a, _b;
|
|
286
|
+
(_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
|
|
287
|
+
};
|
|
288
|
+
const handleFocus = (event) => {
|
|
289
|
+
emit("focus", event);
|
|
290
|
+
};
|
|
291
|
+
const handleBlur = (event) => {
|
|
292
|
+
var _a, _b;
|
|
293
|
+
data.userInput = null;
|
|
294
|
+
if (data.currentValue === null && ((_a = input.value) == null ? void 0 : _a.input)) {
|
|
295
|
+
input.value.input.value = "";
|
|
296
|
+
}
|
|
297
|
+
emit("blur", event);
|
|
298
|
+
if (props.validateEvent) {
|
|
299
|
+
(_b = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _b.call(formItem, "blur").catch((err) => debugWarn(err));
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const setCurrentValueToModelValue = () => {
|
|
303
|
+
if (data.currentValue !== props.modelValue) {
|
|
304
|
+
data.currentValue = props.modelValue;
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
const handleWheel = (e) => {
|
|
308
|
+
if (document.activeElement === e.target)
|
|
309
|
+
e.preventDefault();
|
|
310
|
+
};
|
|
311
|
+
watch(() => props.modelValue, (value, oldValue) => {
|
|
312
|
+
const newValue = verifyValue(value, true);
|
|
313
|
+
if (data.userInput === null && newValue !== oldValue) {
|
|
314
|
+
data.currentValue = newValue;
|
|
315
|
+
}
|
|
316
|
+
}, { immediate: true });
|
|
317
|
+
watch(() => props.precision, () => {
|
|
318
|
+
data.currentValue = verifyValue(props.modelValue);
|
|
319
|
+
});
|
|
320
|
+
onMounted(() => {
|
|
321
|
+
var _a;
|
|
322
|
+
const { min, max, modelValue } = props;
|
|
323
|
+
const innerInput = (_a = input.value) == null ? void 0 : _a.input;
|
|
324
|
+
innerInput.setAttribute("role", "spinbutton");
|
|
325
|
+
if (Number.isFinite(max)) {
|
|
326
|
+
innerInput.setAttribute("aria-valuemax", String(max));
|
|
327
|
+
} else {
|
|
328
|
+
innerInput.removeAttribute("aria-valuemax");
|
|
329
|
+
}
|
|
330
|
+
if (Number.isFinite(min)) {
|
|
331
|
+
innerInput.setAttribute("aria-valuemin", String(min));
|
|
332
|
+
} else {
|
|
333
|
+
innerInput.removeAttribute("aria-valuemin");
|
|
334
|
+
}
|
|
335
|
+
innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
|
|
336
|
+
innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
|
|
337
|
+
if (!isNumber(modelValue) && modelValue != null) {
|
|
338
|
+
let val = Number(modelValue);
|
|
339
|
+
if (Number.isNaN(val)) {
|
|
340
|
+
val = null;
|
|
341
|
+
}
|
|
342
|
+
emit(UPDATE_MODEL_EVENT, val);
|
|
343
|
+
}
|
|
344
|
+
innerInput.addEventListener("wheel", handleWheel, { passive: false });
|
|
345
|
+
});
|
|
346
|
+
onUpdated(() => {
|
|
347
|
+
var _a, _b;
|
|
348
|
+
const innerInput = (_a = input.value) == null ? void 0 : _a.input;
|
|
349
|
+
innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${(_b = data.currentValue) != null ? _b : ""}`);
|
|
350
|
+
});
|
|
351
|
+
expose({
|
|
352
|
+
focus,
|
|
353
|
+
blur
|
|
354
|
+
});
|
|
355
|
+
return (_ctx, _cache) => {
|
|
356
|
+
return openBlock(), createElementBlock("div", {
|
|
357
|
+
class: normalizeClass([
|
|
358
|
+
unref(ns).b(),
|
|
359
|
+
unref(ns).m(unref(inputNumberSize)),
|
|
360
|
+
unref(ns).is("disabled", unref(inputNumberDisabled)),
|
|
361
|
+
unref(ns).is("without-controls", !_ctx.controls),
|
|
362
|
+
unref(ns).is("controls-right", unref(controlsAtRight)),
|
|
363
|
+
unref(ns).is(_ctx.align, !!_ctx.align)
|
|
364
|
+
]),
|
|
365
|
+
onDragstart: withModifiers(() => {
|
|
366
|
+
}, ["prevent"])
|
|
367
|
+
}, [
|
|
368
|
+
_ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
|
|
369
|
+
key: 0,
|
|
370
|
+
role: "button",
|
|
371
|
+
"aria-label": unref(t)("el.inputNumber.decrease"),
|
|
372
|
+
class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", unref(minDisabled))]),
|
|
373
|
+
onKeydown: withKeys(decrease, ["enter"])
|
|
374
|
+
}, [
|
|
375
|
+
renderSlot(_ctx.$slots, "decrease-icon", {}, () => [
|
|
376
|
+
createVNode(unref(ElIcon), null, {
|
|
377
|
+
default: withCtx(() => [
|
|
378
|
+
unref(controlsAtRight) ? (openBlock(), createBlock(unref(ArrowDown), { key: 0 })) : (openBlock(), createBlock(unref(Minus), { key: 1 }))
|
|
379
|
+
]),
|
|
380
|
+
_: 1
|
|
381
|
+
})
|
|
382
|
+
])
|
|
383
|
+
], 42, ["aria-label", "onKeydown"])), [
|
|
384
|
+
[unref(vRepeatClick), decrease]
|
|
385
|
+
]) : createCommentVNode("v-if", true),
|
|
386
|
+
_ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
|
|
387
|
+
key: 1,
|
|
388
|
+
role: "button",
|
|
389
|
+
"aria-label": unref(t)("el.inputNumber.increase"),
|
|
390
|
+
class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", unref(maxDisabled))]),
|
|
391
|
+
onKeydown: withKeys(increase, ["enter"])
|
|
392
|
+
}, [
|
|
393
|
+
renderSlot(_ctx.$slots, "increase-icon", {}, () => [
|
|
394
|
+
createVNode(unref(ElIcon), null, {
|
|
395
|
+
default: withCtx(() => [
|
|
396
|
+
unref(controlsAtRight) ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(Plus), { key: 1 }))
|
|
397
|
+
]),
|
|
398
|
+
_: 1
|
|
399
|
+
})
|
|
400
|
+
])
|
|
401
|
+
], 42, ["aria-label", "onKeydown"])), [
|
|
402
|
+
[unref(vRepeatClick), increase]
|
|
403
|
+
]) : createCommentVNode("v-if", true),
|
|
404
|
+
createVNode(unref(ElInput), {
|
|
405
|
+
id: _ctx.id,
|
|
406
|
+
ref_key: "input",
|
|
407
|
+
ref: input,
|
|
408
|
+
type: "number",
|
|
409
|
+
step: _ctx.step,
|
|
410
|
+
"model-value": unref(displayValue),
|
|
411
|
+
placeholder: _ctx.placeholder,
|
|
412
|
+
readonly: _ctx.readonly,
|
|
413
|
+
disabled: unref(inputNumberDisabled),
|
|
414
|
+
size: unref(inputNumberSize),
|
|
415
|
+
max: _ctx.max,
|
|
416
|
+
min: _ctx.min,
|
|
417
|
+
name: _ctx.name,
|
|
418
|
+
"aria-label": _ctx.ariaLabel,
|
|
419
|
+
"validate-event": false,
|
|
420
|
+
inputmode: _ctx.inputmode,
|
|
421
|
+
onKeydown: handleKeydown,
|
|
422
|
+
onBlur: handleBlur,
|
|
423
|
+
onFocus: handleFocus,
|
|
424
|
+
onInput: handleInput,
|
|
425
|
+
onChange: handleInputChange
|
|
426
|
+
}, createSlots({
|
|
427
|
+
_: 2
|
|
428
|
+
}, [
|
|
429
|
+
_ctx.$slots.prefix ? {
|
|
430
|
+
name: "prefix",
|
|
431
|
+
fn: withCtx(() => [
|
|
432
|
+
renderSlot(_ctx.$slots, "prefix")
|
|
433
|
+
])
|
|
434
|
+
} : void 0,
|
|
435
|
+
_ctx.$slots.suffix ? {
|
|
436
|
+
name: "suffix",
|
|
437
|
+
fn: withCtx(() => [
|
|
438
|
+
renderSlot(_ctx.$slots, "suffix")
|
|
439
|
+
])
|
|
440
|
+
} : void 0
|
|
441
|
+
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "inputmode"])
|
|
442
|
+
], 42, ["onDragstart"]);
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "input-number.vue"]]);
|
|
447
|
+
|
|
448
|
+
const ElInputNumber = withInstall(InputNumber);
|
|
449
|
+
|
|
450
|
+
export { ElInputNumber as E };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { b as baseClone } from './nWBcrYxV.mjs';
|
|
2
|
+
|
|
3
|
+
/** Used to compose bitmasks for cloning. */
|
|
4
|
+
var CLONE_DEEP_FLAG = 1,
|
|
5
|
+
CLONE_SYMBOLS_FLAG = 4;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This method is like `_.clone` except that it recursively clones `value`.
|
|
9
|
+
*
|
|
10
|
+
* @static
|
|
11
|
+
* @memberOf _
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category Lang
|
|
14
|
+
* @param {*} value The value to recursively clone.
|
|
15
|
+
* @returns {*} Returns the deep cloned value.
|
|
16
|
+
* @see _.clone
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
|
20
|
+
*
|
|
21
|
+
* var deep = _.cloneDeep(objects);
|
|
22
|
+
* console.log(deep[0] === objects[0]);
|
|
23
|
+
* // => false
|
|
24
|
+
*/
|
|
25
|
+
function cloneDeep(value) {
|
|
26
|
+
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { cloneDeep as c };
|