@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,123 @@
|
|
|
1
|
+
import { o as isClient, q as isWindow, j as isFunction } from './E_WRn0OP.mjs';
|
|
2
|
+
import { g as getStyle } from './D5259bwd.mjs';
|
|
3
|
+
|
|
4
|
+
function easeInOutCubic(t, b, c, d) {
|
|
5
|
+
const cc = c - b;
|
|
6
|
+
t /= d / 2;
|
|
7
|
+
if (t < 1) {
|
|
8
|
+
return cc / 2 * t * t * t + b;
|
|
9
|
+
}
|
|
10
|
+
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
|
|
14
|
+
const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
|
|
15
|
+
|
|
16
|
+
const isScroll = (el, isVertical) => {
|
|
17
|
+
if (!isClient)
|
|
18
|
+
return false;
|
|
19
|
+
const key = {
|
|
20
|
+
undefined: "overflow",
|
|
21
|
+
true: "overflow-y",
|
|
22
|
+
false: "overflow-x"
|
|
23
|
+
}[String(isVertical)];
|
|
24
|
+
const overflow = getStyle(el, key);
|
|
25
|
+
return ["scroll", "auto", "overlay"].some((s) => overflow.includes(s));
|
|
26
|
+
};
|
|
27
|
+
const getScrollContainer = (el, isVertical) => {
|
|
28
|
+
if (!isClient)
|
|
29
|
+
return;
|
|
30
|
+
let parent = el;
|
|
31
|
+
while (parent) {
|
|
32
|
+
if ([window, document, document.documentElement].includes(parent))
|
|
33
|
+
return window;
|
|
34
|
+
if (isScroll(parent, isVertical))
|
|
35
|
+
return parent;
|
|
36
|
+
parent = parent.parentNode;
|
|
37
|
+
}
|
|
38
|
+
return parent;
|
|
39
|
+
};
|
|
40
|
+
let scrollBarWidth;
|
|
41
|
+
const getScrollBarWidth = (namespace) => {
|
|
42
|
+
var _a;
|
|
43
|
+
if (!isClient)
|
|
44
|
+
return 0;
|
|
45
|
+
if (scrollBarWidth !== void 0)
|
|
46
|
+
return scrollBarWidth;
|
|
47
|
+
const outer = document.createElement("div");
|
|
48
|
+
outer.className = `${namespace}-scrollbar__wrap`;
|
|
49
|
+
outer.style.visibility = "hidden";
|
|
50
|
+
outer.style.width = "100px";
|
|
51
|
+
outer.style.position = "absolute";
|
|
52
|
+
outer.style.top = "-9999px";
|
|
53
|
+
document.body.appendChild(outer);
|
|
54
|
+
const widthNoScroll = outer.offsetWidth;
|
|
55
|
+
outer.style.overflow = "scroll";
|
|
56
|
+
const inner = document.createElement("div");
|
|
57
|
+
inner.style.width = "100%";
|
|
58
|
+
outer.appendChild(inner);
|
|
59
|
+
const widthWithScroll = inner.offsetWidth;
|
|
60
|
+
(_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
|
|
61
|
+
scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
62
|
+
return scrollBarWidth;
|
|
63
|
+
};
|
|
64
|
+
function scrollIntoView(container, selected) {
|
|
65
|
+
if (!isClient)
|
|
66
|
+
return;
|
|
67
|
+
if (!selected) {
|
|
68
|
+
container.scrollTop = 0;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const offsetParents = [];
|
|
72
|
+
let pointer = selected.offsetParent;
|
|
73
|
+
while (pointer !== null && container !== pointer && container.contains(pointer)) {
|
|
74
|
+
offsetParents.push(pointer);
|
|
75
|
+
pointer = pointer.offsetParent;
|
|
76
|
+
}
|
|
77
|
+
const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
|
|
78
|
+
const bottom = top + selected.offsetHeight;
|
|
79
|
+
const viewRectTop = container.scrollTop;
|
|
80
|
+
const viewRectBottom = viewRectTop + container.clientHeight;
|
|
81
|
+
if (top < viewRectTop) {
|
|
82
|
+
container.scrollTop = top;
|
|
83
|
+
} else if (bottom > viewRectBottom) {
|
|
84
|
+
container.scrollTop = bottom - container.clientHeight;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function animateScrollTo(container, from, to, duration, callback) {
|
|
88
|
+
const startTime = Date.now();
|
|
89
|
+
let handle;
|
|
90
|
+
const scroll = () => {
|
|
91
|
+
const timestamp = Date.now();
|
|
92
|
+
const time = timestamp - startTime;
|
|
93
|
+
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, from, to, duration);
|
|
94
|
+
if (isWindow(container)) {
|
|
95
|
+
container.scrollTo(window.pageXOffset, nextScrollTop);
|
|
96
|
+
} else {
|
|
97
|
+
container.scrollTop = nextScrollTop;
|
|
98
|
+
}
|
|
99
|
+
if (time < duration) {
|
|
100
|
+
handle = rAF(scroll);
|
|
101
|
+
} else if (isFunction(callback)) {
|
|
102
|
+
callback();
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
scroll();
|
|
106
|
+
return () => {
|
|
107
|
+
handle && cAF(handle);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const getScrollElement = (target, container) => {
|
|
111
|
+
if (isWindow(container)) {
|
|
112
|
+
return target.ownerDocument.documentElement;
|
|
113
|
+
}
|
|
114
|
+
return container;
|
|
115
|
+
};
|
|
116
|
+
const getScrollTop = (container) => {
|
|
117
|
+
if (isWindow(container)) {
|
|
118
|
+
return window.scrollY;
|
|
119
|
+
}
|
|
120
|
+
return container.scrollTop;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { getScrollElement as a, animateScrollTo as b, cAF as c, getScrollTop as d, getScrollBarWidth as e, getScrollContainer as g, rAF as r, scrollIntoView as s };
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import { getCurrentInstance, inject, ref, computed, unref, shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, onMounted, nextTick, warn } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The inverse of `_.toPairs`; this method returns an object composed
|
|
5
|
+
* from key-value `pairs`.
|
|
6
|
+
*
|
|
7
|
+
* @static
|
|
8
|
+
* @memberOf _
|
|
9
|
+
* @since 4.0.0
|
|
10
|
+
* @category Array
|
|
11
|
+
* @param {Array} pairs The key-value pairs.
|
|
12
|
+
* @returns {Object} Returns the new object.
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* _.fromPairs([['a', 1], ['b', 2]]);
|
|
16
|
+
* // => { 'a': 1, 'b': 2 }
|
|
17
|
+
*/
|
|
18
|
+
function fromPairs(pairs) {
|
|
19
|
+
var index = -1,
|
|
20
|
+
length = pairs == null ? 0 : pairs.length,
|
|
21
|
+
result = {};
|
|
22
|
+
|
|
23
|
+
while (++index < length) {
|
|
24
|
+
var pair = pairs[index];
|
|
25
|
+
result[pair[0]] = pair[1];
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Checks if `value` is `null` or `undefined`.
|
|
32
|
+
*
|
|
33
|
+
* @static
|
|
34
|
+
* @memberOf _
|
|
35
|
+
* @since 4.0.0
|
|
36
|
+
* @category Lang
|
|
37
|
+
* @param {*} value The value to check.
|
|
38
|
+
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
|
|
39
|
+
* @example
|
|
40
|
+
*
|
|
41
|
+
* _.isNil(null);
|
|
42
|
+
* // => true
|
|
43
|
+
*
|
|
44
|
+
* _.isNil(void 0);
|
|
45
|
+
* // => true
|
|
46
|
+
*
|
|
47
|
+
* _.isNil(NaN);
|
|
48
|
+
* // => false
|
|
49
|
+
*/
|
|
50
|
+
function isNil(value) {
|
|
51
|
+
return value == null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const defaultNamespace = "el";
|
|
55
|
+
const statePrefix = "is-";
|
|
56
|
+
const _bem = (namespace, block, blockSuffix, element, modifier) => {
|
|
57
|
+
let cls = `${namespace}-${block}`;
|
|
58
|
+
if (blockSuffix) {
|
|
59
|
+
cls += `-${blockSuffix}`;
|
|
60
|
+
}
|
|
61
|
+
if (element) {
|
|
62
|
+
cls += `__${element}`;
|
|
63
|
+
}
|
|
64
|
+
if (modifier) {
|
|
65
|
+
cls += `--${modifier}`;
|
|
66
|
+
}
|
|
67
|
+
return cls;
|
|
68
|
+
};
|
|
69
|
+
const namespaceContextKey = Symbol("namespaceContextKey");
|
|
70
|
+
const useGetDerivedNamespace = (namespaceOverrides) => {
|
|
71
|
+
const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace));
|
|
72
|
+
const namespace = computed(() => {
|
|
73
|
+
return unref(derivedNamespace) || defaultNamespace;
|
|
74
|
+
});
|
|
75
|
+
return namespace;
|
|
76
|
+
};
|
|
77
|
+
const useNamespace = (block, namespaceOverrides) => {
|
|
78
|
+
const namespace = useGetDerivedNamespace(namespaceOverrides);
|
|
79
|
+
const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
|
|
80
|
+
const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
|
|
81
|
+
const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
|
|
82
|
+
const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
|
|
83
|
+
const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
|
|
84
|
+
const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
|
|
85
|
+
const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
|
|
86
|
+
const is = (name, ...args) => {
|
|
87
|
+
const state = args.length >= 1 ? args[0] : true;
|
|
88
|
+
return name && state ? `${statePrefix}${name}` : "";
|
|
89
|
+
};
|
|
90
|
+
const cssVar = (object) => {
|
|
91
|
+
const styles = {};
|
|
92
|
+
for (const key in object) {
|
|
93
|
+
if (object[key]) {
|
|
94
|
+
styles[`--${namespace.value}-${key}`] = object[key];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return styles;
|
|
98
|
+
};
|
|
99
|
+
const cssVarBlock = (object) => {
|
|
100
|
+
const styles = {};
|
|
101
|
+
for (const key in object) {
|
|
102
|
+
if (object[key]) {
|
|
103
|
+
styles[`--${namespace.value}-${block}-${key}`] = object[key];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return styles;
|
|
107
|
+
};
|
|
108
|
+
const cssVarName = (name) => `--${namespace.value}-${name}`;
|
|
109
|
+
const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
|
|
110
|
+
return {
|
|
111
|
+
namespace,
|
|
112
|
+
b,
|
|
113
|
+
e,
|
|
114
|
+
m,
|
|
115
|
+
be,
|
|
116
|
+
em,
|
|
117
|
+
bm,
|
|
118
|
+
bem,
|
|
119
|
+
is,
|
|
120
|
+
cssVar,
|
|
121
|
+
cssVarName,
|
|
122
|
+
cssVarBlock,
|
|
123
|
+
cssVarBlockName
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @vue/shared v3.5.25
|
|
129
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
130
|
+
* @license MIT
|
|
131
|
+
**/
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
!!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
|
135
|
+
!!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
|
|
136
|
+
const NOOP = () => {
|
|
137
|
+
};
|
|
138
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
139
|
+
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
140
|
+
const isArray = Array.isArray;
|
|
141
|
+
const isDate = (val) => toTypeString(val) === "[object Date]";
|
|
142
|
+
const isFunction$1 = (val) => typeof val === "function";
|
|
143
|
+
const isString$1 = (val) => typeof val === "string";
|
|
144
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
145
|
+
const isPromise = (val) => {
|
|
146
|
+
return (isObject(val) || isFunction$1(val)) && isFunction$1(val.then) && isFunction$1(val.catch);
|
|
147
|
+
};
|
|
148
|
+
const objectToString = Object.prototype.toString;
|
|
149
|
+
const toTypeString = (value) => objectToString.call(value);
|
|
150
|
+
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
151
|
+
const cacheStringFunction = (fn) => {
|
|
152
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
153
|
+
return ((str) => {
|
|
154
|
+
const hit = cache[str];
|
|
155
|
+
return hit || (cache[str] = fn(str));
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
const camelizeRE = /-\w/g;
|
|
159
|
+
const camelize = cacheStringFunction(
|
|
160
|
+
(str) => {
|
|
161
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
const hyphenateRE = /\B([A-Z])/g;
|
|
165
|
+
const hyphenate = cacheStringFunction(
|
|
166
|
+
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const isUndefined = (val) => val === void 0;
|
|
170
|
+
const isBoolean = (val) => typeof val === "boolean";
|
|
171
|
+
const isNumber = (val) => typeof val === "number";
|
|
172
|
+
const isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject(val) && !Object.keys(val).length;
|
|
173
|
+
const isElement = (e) => {
|
|
174
|
+
if (typeof Element === "undefined")
|
|
175
|
+
return false;
|
|
176
|
+
return e instanceof Element;
|
|
177
|
+
};
|
|
178
|
+
const isPropAbsent = (prop) => isNil(prop);
|
|
179
|
+
const isStringNumber = (val) => {
|
|
180
|
+
if (!isString$1(val)) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return !Number.isNaN(Number(val));
|
|
184
|
+
};
|
|
185
|
+
const isWindow = (val) => val === window;
|
|
186
|
+
|
|
187
|
+
var __defProp$9 = Object.defineProperty;
|
|
188
|
+
var __defProps$6 = Object.defineProperties;
|
|
189
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
190
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
191
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
192
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
193
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
194
|
+
var __spreadValues$9 = (a, b) => {
|
|
195
|
+
for (var prop in b || (b = {}))
|
|
196
|
+
if (__hasOwnProp$b.call(b, prop))
|
|
197
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
198
|
+
if (__getOwnPropSymbols$b)
|
|
199
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
200
|
+
if (__propIsEnum$b.call(b, prop))
|
|
201
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
202
|
+
}
|
|
203
|
+
return a;
|
|
204
|
+
};
|
|
205
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
206
|
+
function computedEager(fn, options) {
|
|
207
|
+
var _a;
|
|
208
|
+
const result = shallowRef();
|
|
209
|
+
watchEffect(() => {
|
|
210
|
+
result.value = fn();
|
|
211
|
+
}, __spreadProps$6(__spreadValues$9({}, options), {
|
|
212
|
+
flush: (_a = void 0 ) != null ? _a : "sync"
|
|
213
|
+
}));
|
|
214
|
+
return readonly(result);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
var _a;
|
|
218
|
+
const isClient = typeof window !== "undefined";
|
|
219
|
+
const isDef = (val) => typeof val !== "undefined";
|
|
220
|
+
const isFunction = (val) => typeof val === "function";
|
|
221
|
+
const isString = (val) => typeof val === "string";
|
|
222
|
+
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
|
223
|
+
const noop = () => {
|
|
224
|
+
};
|
|
225
|
+
const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
226
|
+
|
|
227
|
+
function resolveUnref(r) {
|
|
228
|
+
return typeof r === "function" ? r() : unref(r);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function createFilterWrapper(filter, fn) {
|
|
232
|
+
function wrapper(...args) {
|
|
233
|
+
return new Promise((resolve, reject) => {
|
|
234
|
+
Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
return wrapper;
|
|
238
|
+
}
|
|
239
|
+
function debounceFilter(ms, options = {}) {
|
|
240
|
+
let timer;
|
|
241
|
+
let maxTimer;
|
|
242
|
+
let lastRejector = noop;
|
|
243
|
+
const _clearTimeout = (timer2) => {
|
|
244
|
+
clearTimeout(timer2);
|
|
245
|
+
lastRejector();
|
|
246
|
+
lastRejector = noop;
|
|
247
|
+
};
|
|
248
|
+
const filter = (invoke) => {
|
|
249
|
+
const duration = resolveUnref(ms);
|
|
250
|
+
const maxDuration = resolveUnref(options.maxWait);
|
|
251
|
+
if (timer)
|
|
252
|
+
_clearTimeout(timer);
|
|
253
|
+
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
|
254
|
+
if (maxTimer) {
|
|
255
|
+
_clearTimeout(maxTimer);
|
|
256
|
+
maxTimer = null;
|
|
257
|
+
}
|
|
258
|
+
return Promise.resolve(invoke());
|
|
259
|
+
}
|
|
260
|
+
return new Promise((resolve, reject) => {
|
|
261
|
+
lastRejector = options.rejectOnCancel ? reject : resolve;
|
|
262
|
+
if (maxDuration && !maxTimer) {
|
|
263
|
+
maxTimer = setTimeout(() => {
|
|
264
|
+
if (timer)
|
|
265
|
+
_clearTimeout(timer);
|
|
266
|
+
maxTimer = null;
|
|
267
|
+
resolve(invoke());
|
|
268
|
+
}, maxDuration);
|
|
269
|
+
}
|
|
270
|
+
timer = setTimeout(() => {
|
|
271
|
+
if (maxTimer)
|
|
272
|
+
_clearTimeout(maxTimer);
|
|
273
|
+
maxTimer = null;
|
|
274
|
+
resolve(invoke());
|
|
275
|
+
}, duration);
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
return filter;
|
|
279
|
+
}
|
|
280
|
+
function throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = false) {
|
|
281
|
+
let lastExec = 0;
|
|
282
|
+
let timer;
|
|
283
|
+
let isLeading = true;
|
|
284
|
+
let lastRejector = noop;
|
|
285
|
+
let lastValue;
|
|
286
|
+
const clear = () => {
|
|
287
|
+
if (timer) {
|
|
288
|
+
clearTimeout(timer);
|
|
289
|
+
timer = void 0;
|
|
290
|
+
lastRejector();
|
|
291
|
+
lastRejector = noop;
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
const filter = (_invoke) => {
|
|
295
|
+
const duration = resolveUnref(ms);
|
|
296
|
+
const elapsed = Date.now() - lastExec;
|
|
297
|
+
const invoke = () => {
|
|
298
|
+
return lastValue = _invoke();
|
|
299
|
+
};
|
|
300
|
+
clear();
|
|
301
|
+
if (duration <= 0) {
|
|
302
|
+
lastExec = Date.now();
|
|
303
|
+
return invoke();
|
|
304
|
+
}
|
|
305
|
+
if (elapsed > duration && (leading || !isLeading)) {
|
|
306
|
+
lastExec = Date.now();
|
|
307
|
+
invoke();
|
|
308
|
+
} else if (trailing) {
|
|
309
|
+
lastValue = new Promise((resolve, reject) => {
|
|
310
|
+
lastRejector = rejectOnCancel ? reject : resolve;
|
|
311
|
+
timer = setTimeout(() => {
|
|
312
|
+
lastExec = Date.now();
|
|
313
|
+
isLeading = true;
|
|
314
|
+
resolve(invoke());
|
|
315
|
+
clear();
|
|
316
|
+
}, Math.max(0, duration - elapsed));
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
if (!leading && !timer)
|
|
320
|
+
timer = setTimeout(() => isLeading = true, duration);
|
|
321
|
+
isLeading = false;
|
|
322
|
+
return lastValue;
|
|
323
|
+
};
|
|
324
|
+
return filter;
|
|
325
|
+
}
|
|
326
|
+
function identity(arg) {
|
|
327
|
+
return arg;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function tryOnScopeDispose(fn) {
|
|
331
|
+
if (getCurrentScope()) {
|
|
332
|
+
onScopeDispose(fn);
|
|
333
|
+
return true;
|
|
334
|
+
}
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
339
|
+
return createFilterWrapper(debounceFilter(ms, options), fn);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
|
|
343
|
+
return createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function tryOnMounted(fn, sync = true) {
|
|
347
|
+
if (getCurrentInstance())
|
|
348
|
+
onMounted(fn);
|
|
349
|
+
else if (sync)
|
|
350
|
+
fn();
|
|
351
|
+
else
|
|
352
|
+
nextTick(fn);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function useTimeoutFn(cb, interval, options = {}) {
|
|
356
|
+
const {
|
|
357
|
+
immediate = true
|
|
358
|
+
} = options;
|
|
359
|
+
const isPending = ref(false);
|
|
360
|
+
let timer = null;
|
|
361
|
+
function clear() {
|
|
362
|
+
if (timer) {
|
|
363
|
+
clearTimeout(timer);
|
|
364
|
+
timer = null;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function stop() {
|
|
368
|
+
isPending.value = false;
|
|
369
|
+
clear();
|
|
370
|
+
}
|
|
371
|
+
function start(...args) {
|
|
372
|
+
clear();
|
|
373
|
+
isPending.value = true;
|
|
374
|
+
timer = setTimeout(() => {
|
|
375
|
+
isPending.value = false;
|
|
376
|
+
timer = null;
|
|
377
|
+
cb(...args);
|
|
378
|
+
}, resolveUnref(interval));
|
|
379
|
+
}
|
|
380
|
+
if (immediate) {
|
|
381
|
+
isPending.value = true;
|
|
382
|
+
if (isClient)
|
|
383
|
+
start();
|
|
384
|
+
}
|
|
385
|
+
tryOnScopeDispose(stop);
|
|
386
|
+
return {
|
|
387
|
+
isPending: readonly(isPending),
|
|
388
|
+
start,
|
|
389
|
+
stop
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
class ElementPlusError extends Error {
|
|
394
|
+
constructor(m) {
|
|
395
|
+
super(m);
|
|
396
|
+
this.name = "ElementPlusError";
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function throwError(scope, m) {
|
|
400
|
+
throw new ElementPlusError(`[${scope}] ${m}`);
|
|
401
|
+
}
|
|
402
|
+
function debugWarn(scope, message) {
|
|
403
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
404
|
+
const error = isString$1(scope) ? new ElementPlusError(`[${scope}] ${message}`) : scope;
|
|
405
|
+
console.warn(error);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const epPropKey = "__epPropKey";
|
|
410
|
+
const definePropType = (val) => val;
|
|
411
|
+
const isEpProp = (val) => isObject(val) && !!val[epPropKey];
|
|
412
|
+
const buildProp = (prop, key) => {
|
|
413
|
+
if (!isObject(prop) || isEpProp(prop))
|
|
414
|
+
return prop;
|
|
415
|
+
const { values, required, default: defaultValue, type, validator } = prop;
|
|
416
|
+
const _validator = values || validator ? (val) => {
|
|
417
|
+
let valid = false;
|
|
418
|
+
let allowedValues = [];
|
|
419
|
+
if (values) {
|
|
420
|
+
allowedValues = Array.from(values);
|
|
421
|
+
if (hasOwn(prop, "default")) {
|
|
422
|
+
allowedValues.push(defaultValue);
|
|
423
|
+
}
|
|
424
|
+
valid || (valid = allowedValues.includes(val));
|
|
425
|
+
}
|
|
426
|
+
if (validator)
|
|
427
|
+
valid || (valid = validator(val));
|
|
428
|
+
if (!valid && allowedValues.length > 0) {
|
|
429
|
+
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
|
|
430
|
+
warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
|
|
431
|
+
}
|
|
432
|
+
return valid;
|
|
433
|
+
} : void 0;
|
|
434
|
+
const epProp = {
|
|
435
|
+
type,
|
|
436
|
+
required: !!required,
|
|
437
|
+
validator: _validator,
|
|
438
|
+
[epPropKey]: true
|
|
439
|
+
};
|
|
440
|
+
if (hasOwn(prop, "default"))
|
|
441
|
+
epProp.default = defaultValue;
|
|
442
|
+
return epProp;
|
|
443
|
+
};
|
|
444
|
+
const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
|
|
445
|
+
key,
|
|
446
|
+
buildProp(option, key)
|
|
447
|
+
]));
|
|
448
|
+
|
|
449
|
+
export { useGetDerivedNamespace as A, computedEager as B, isPropAbsent as C, hyphenate as D, defaultNamespace as E, useTimeoutFn as F, isPromise as G, hasOwn as H, isStringNumber as I, camelize as J, namespaceContextKey as K, isString as L, noop as M, NOOP as N, resolveUnref as O, tryOnMounted as P, isDef as Q, isFunction as R, identity as S, isEmpty as a, isDate as b, buildProps as c, definePropType as d, debugWarn as e, isNumber as f, isUndefined as g, isString$1 as h, isArray as i, isFunction$1 as j, isNil as k, isPlainObject as l, clamp as m, fromPairs as n, isClient as o, isElement as p, isWindow as q, useThrottleFn as r, isObject as s, throwError as t, useNamespace as u, isIOS as v, useDebounceFn as w, isBoolean as x, tryOnScopeDispose as y, buildProp as z };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** Detect free variable `global` from Node.js. */
|
|
2
|
+
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
3
|
+
|
|
4
|
+
/** Detect free variable `self`. */
|
|
5
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
6
|
+
|
|
7
|
+
/** Used as a reference to the global object. */
|
|
8
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
9
|
+
|
|
10
|
+
/** Built-in value references. */
|
|
11
|
+
var Symbol$1 = root.Symbol;
|
|
12
|
+
|
|
13
|
+
/** Used for built-in method references. */
|
|
14
|
+
var objectProto$1 = Object.prototype;
|
|
15
|
+
|
|
16
|
+
/** Used to check objects for own properties. */
|
|
17
|
+
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Used to resolve the
|
|
21
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
22
|
+
* of values.
|
|
23
|
+
*/
|
|
24
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
25
|
+
|
|
26
|
+
/** Built-in value references. */
|
|
27
|
+
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
31
|
+
*
|
|
32
|
+
* @private
|
|
33
|
+
* @param {*} value The value to query.
|
|
34
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
35
|
+
*/
|
|
36
|
+
function getRawTag(value) {
|
|
37
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
38
|
+
tag = value[symToStringTag$1];
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
value[symToStringTag$1] = undefined;
|
|
42
|
+
var unmasked = true;
|
|
43
|
+
} catch (e) {}
|
|
44
|
+
|
|
45
|
+
var result = nativeObjectToString$1.call(value);
|
|
46
|
+
if (unmasked) {
|
|
47
|
+
if (isOwn) {
|
|
48
|
+
value[symToStringTag$1] = tag;
|
|
49
|
+
} else {
|
|
50
|
+
delete value[symToStringTag$1];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Used for built-in method references. */
|
|
57
|
+
var objectProto = Object.prototype;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Used to resolve the
|
|
61
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
62
|
+
* of values.
|
|
63
|
+
*/
|
|
64
|
+
var nativeObjectToString = objectProto.toString;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
68
|
+
*
|
|
69
|
+
* @private
|
|
70
|
+
* @param {*} value The value to convert.
|
|
71
|
+
* @returns {string} Returns the converted string.
|
|
72
|
+
*/
|
|
73
|
+
function objectToString(value) {
|
|
74
|
+
return nativeObjectToString.call(value);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** `Object#toString` result references. */
|
|
78
|
+
var nullTag = '[object Null]',
|
|
79
|
+
undefinedTag = '[object Undefined]';
|
|
80
|
+
|
|
81
|
+
/** Built-in value references. */
|
|
82
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
86
|
+
*
|
|
87
|
+
* @private
|
|
88
|
+
* @param {*} value The value to query.
|
|
89
|
+
* @returns {string} Returns the `toStringTag`.
|
|
90
|
+
*/
|
|
91
|
+
function baseGetTag(value) {
|
|
92
|
+
if (value == null) {
|
|
93
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
94
|
+
}
|
|
95
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
96
|
+
? getRawTag(value)
|
|
97
|
+
: objectToString(value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
102
|
+
* and has a `typeof` result of "object".
|
|
103
|
+
*
|
|
104
|
+
* @static
|
|
105
|
+
* @memberOf _
|
|
106
|
+
* @since 4.0.0
|
|
107
|
+
* @category Lang
|
|
108
|
+
* @param {*} value The value to check.
|
|
109
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
110
|
+
* @example
|
|
111
|
+
*
|
|
112
|
+
* _.isObjectLike({});
|
|
113
|
+
* // => true
|
|
114
|
+
*
|
|
115
|
+
* _.isObjectLike([1, 2, 3]);
|
|
116
|
+
* // => true
|
|
117
|
+
*
|
|
118
|
+
* _.isObjectLike(_.noop);
|
|
119
|
+
* // => false
|
|
120
|
+
*
|
|
121
|
+
* _.isObjectLike(null);
|
|
122
|
+
* // => false
|
|
123
|
+
*/
|
|
124
|
+
function isObjectLike(value) {
|
|
125
|
+
return value != null && typeof value == 'object';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { Symbol$1 as S, baseGetTag as b, freeGlobal as f, isObjectLike as i, root as r };
|