orion-design 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -0
- package/dist/Throne/index.d.ts +18 -0
- package/dist/Throne/index.js +20 -0
- package/dist/Throne/index.js.map +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
- package/dist/components/Button/Button.vue.d.ts +2 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.js +27 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Flex/Col.d.ts +4 -4
- package/dist/components/Flex/Item.d.ts +4 -4
- package/dist/components/Flex/Row.d.ts +4 -4
- package/dist/components/Flex/index.d.ts +4 -4
- package/dist/components/Flex/index.js +95 -127
- package/dist/components/Flex/index.js.map +1 -0
- package/dist/components/Form/ButtonGroup/ButtonGroup.d.ts +5 -0
- package/dist/components/Form/ButtonGroup/ButtonGroup.js +2 -0
- package/dist/components/Form/ButtonGroup/ButtonGroup.js.map +1 -0
- package/dist/components/Form/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/Form/ButtonGroup/index.d.ts +1 -0
- package/dist/components/Form/ButtonGroup/index.js +2 -0
- package/dist/components/Form/ButtonGroup/index.js.map +1 -0
- package/dist/components/Form/Checkbox/Checkbox.d.ts +10 -0
- package/dist/components/Form/Checkbox/Checkbox.js +2 -0
- package/dist/components/Form/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Form/Checkbox/Checkbox.vue.d.ts +3 -0
- package/dist/components/Form/Checkbox/index.d.ts +1 -0
- package/dist/components/Form/Checkbox/index.js +2 -0
- package/dist/components/Form/Checkbox/index.js.map +1 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.d.ts +14 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +2 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.vue.d.ts +3 -0
- package/dist/components/Form/CheckboxGroup/index.d.ts +1 -0
- package/dist/components/Form/CheckboxGroup/index.js +2 -0
- package/dist/components/Form/CheckboxGroup/index.js.map +1 -0
- package/dist/components/Form/DateInput/DateInput.d.ts +17 -0
- package/dist/components/Form/DateInput/DateInput.js +2 -0
- package/dist/components/Form/DateInput/DateInput.js.map +1 -0
- package/dist/components/Form/DateInput/DateInput.vue.d.ts +3 -0
- package/dist/components/Form/DateInput/index.d.ts +1 -0
- package/dist/components/Form/DateInput/index.js +2 -0
- package/dist/components/Form/DateInput/index.js.map +1 -0
- package/dist/components/Form/FileInput/FileInput.d.ts +10 -0
- package/dist/components/Form/FileInput/FileInput.js +2 -0
- package/dist/components/Form/FileInput/FileInput.js.map +1 -0
- package/dist/components/Form/FileInput/FileInput.vue.d.ts +451 -0
- package/dist/components/Form/FileInput/index.d.ts +1 -0
- package/dist/components/Form/FileInput/index.js +2 -0
- package/dist/components/Form/FileInput/index.js.map +1 -0
- package/dist/components/Form/Form.d.ts +21 -0
- package/dist/components/Form/Form.js +5 -0
- package/dist/components/Form/Form.js.map +1 -0
- package/dist/components/Form/Form.vue.d.ts +465 -0
- package/dist/components/Form/MultiSelect/MultiSelect.d.ts +15 -0
- package/dist/components/Form/MultiSelect/MultiSelect.js +2 -0
- package/dist/components/Form/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/components/Form/MultiSelect/MultiSelect.vue.d.ts +3 -0
- package/dist/components/Form/MultiSelect/index.d.ts +1 -0
- package/dist/components/Form/MultiSelect/index.js +2 -0
- package/dist/components/Form/MultiSelect/index.js.map +1 -0
- package/dist/components/Form/PasswordInput/PasswordInput.d.ts +13 -0
- package/dist/components/Form/PasswordInput/PasswordInput.js +2 -0
- package/dist/components/Form/PasswordInput/PasswordInput.js.map +1 -0
- package/dist/components/Form/PasswordInput/PasswordInput.vue.d.ts +3 -0
- package/dist/components/Form/PasswordInput/index.d.ts +1 -0
- package/dist/components/Form/PasswordInput/index.js +2 -0
- package/dist/components/Form/PasswordInput/index.js.map +1 -0
- package/dist/components/Form/RadioGroup/RadioGroup.d.ts +14 -0
- package/dist/components/Form/RadioGroup/RadioGroup.js +2 -0
- package/dist/components/Form/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/Form/RadioGroup/RadioGroup.vue.d.ts +3 -0
- package/dist/components/Form/RadioGroup/index.d.ts +1 -0
- package/dist/components/Form/RadioGroup/index.js +2 -0
- package/dist/components/Form/RadioGroup/index.js.map +1 -0
- package/dist/components/Form/SingleSelect/SingleSelect.d.ts +17 -0
- package/dist/components/Form/SingleSelect/SingleSelect.js +2 -0
- package/dist/components/Form/SingleSelect/SingleSelect.js.map +1 -0
- package/dist/components/Form/SingleSelect/SingleSelect.vue.d.ts +3 -0
- package/dist/components/Form/SingleSelect/index.d.ts +1 -0
- package/dist/components/Form/SingleSelect/index.js +2 -0
- package/dist/components/Form/SingleSelect/index.js.map +1 -0
- package/dist/components/Form/StringInput/StringInput.d.ts +13 -0
- package/dist/components/Form/StringInput/StringInput.js +2 -0
- package/dist/components/Form/StringInput/StringInput.js.map +1 -0
- package/dist/components/Form/StringInput/StringInput.vue.d.ts +3 -0
- package/dist/components/Form/StringInput/index.d.ts +1 -0
- package/dist/components/Form/StringInput/index.js +2 -0
- package/dist/components/Form/StringInput/index.js.map +1 -0
- package/dist/components/Form/Switch/Switch.d.ts +10 -0
- package/dist/components/Form/Switch/Switch.js +2 -0
- package/dist/components/Form/Switch/Switch.js.map +1 -0
- package/dist/components/Form/Switch/Switch.vue.d.ts +3 -0
- package/dist/components/Form/Switch/index.d.ts +1 -0
- package/dist/components/Form/Switch/index.js +2 -0
- package/dist/components/Form/Switch/index.js.map +1 -0
- package/dist/components/Form/Textarea/Textarea.d.ts +14 -0
- package/dist/components/Form/Textarea/Textarea.js +2 -0
- package/dist/components/Form/Textarea/Textarea.js.map +1 -0
- package/dist/components/Form/Textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/Form/Textarea/index.d.ts +1 -0
- package/dist/components/Form/Textarea/index.js +2 -0
- package/dist/components/Form/Textarea/index.js.map +1 -0
- package/dist/components/Form/hooks/useForm.d.ts +7 -0
- package/dist/components/Form/hooks/useForm.js +44 -0
- package/dist/components/Form/hooks/useForm.js.map +1 -0
- package/dist/components/Form/index.d.ts +301 -0
- package/dist/components/Form/index.js +660 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/Form/utils/index.d.ts +8 -0
- package/dist/components/Form/utils/index.js +26 -0
- package/dist/components/Form/utils/index.js.map +1 -0
- package/dist/components/Modal/index.d.ts +1 -14
- package/dist/components/Modal/useModal.d.ts +1 -1
- package/dist/components/Modal/useModal.js +7 -7
- package/dist/components/Modal/useModal.js.map +1 -0
- package/dist/components/Pagetable/Pagetable.d.ts +91 -0
- package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +24 -0
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +78 -0
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +101 -0
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +78 -0
- package/dist/components/Pagetable/columns/PagetableColumnIndex.d.ts +5 -0
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +109 -0
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +114 -0
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +109 -0
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +75 -0
- package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +35 -0
- package/dist/components/Pagetable/hooks/useColumns.d.ts +1 -0
- package/dist/components/Pagetable/hooks/useColumns.js +96 -0
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -0
- package/dist/components/Pagetable/index.d.ts +85 -0
- package/dist/components/Pagetable/index.js +521 -0
- package/dist/components/Pagetable/index.js.map +1 -0
- package/dist/components/Pagetable/interface.d.ts +10 -0
- package/dist/components/Pagetable/interface.js +2 -0
- package/dist/components/Pagetable/interface.js.map +1 -0
- package/dist/components/Pagetable/utils/index.d.ts +15 -0
- package/dist/components/Pagetable/utils/index.js +169 -0
- package/dist/components/Pagetable/utils/index.js.map +1 -0
- package/dist/components/Space/index.d.ts +12 -12
- package/dist/components/_util/arrays.d.ts +5 -0
- package/dist/components/_util/arrays.js +8 -0
- package/dist/components/_util/arrays.js.map +1 -0
- package/dist/components/_util/browser.d.ts +3 -0
- package/dist/components/_util/browser.js +9 -0
- package/dist/components/_util/browser.js.map +1 -0
- package/dist/components/_util/classNames.js +20 -27
- package/dist/components/_util/classNames.js.map +1 -0
- package/dist/components/_util/dom/aria.d.ts +30 -0
- package/dist/components/_util/dom/aria.js +46 -0
- package/dist/components/_util/dom/aria.js.map +1 -0
- package/dist/components/_util/dom/element.d.ts +3 -0
- package/dist/components/_util/dom/element.js +18 -0
- package/dist/components/_util/dom/element.js.map +1 -0
- package/dist/components/_util/dom/event.d.ts +6 -0
- package/dist/components/_util/dom/event.js +10 -0
- package/dist/components/_util/dom/event.js.map +1 -0
- package/dist/components/_util/dom/index.d.ts +6 -0
- package/dist/components/_util/dom/index.js +39 -0
- package/dist/components/_util/dom/index.js.map +1 -0
- package/dist/components/_util/dom/position.d.ts +7 -0
- package/dist/components/_util/dom/position.js +30 -0
- package/dist/components/_util/dom/position.js.map +1 -0
- package/dist/components/_util/dom/scroll.d.ts +11 -0
- package/dist/components/_util/dom/scroll.js +78 -0
- package/dist/components/_util/dom/scroll.js.map +1 -0
- package/dist/components/_util/dom/style.d.ts +9 -0
- package/dist/components/_util/dom/style.js +58 -0
- package/dist/components/_util/dom/style.js.map +1 -0
- package/dist/components/_util/easings.d.ts +1 -0
- package/dist/components/_util/easings.js +8 -0
- package/dist/components/_util/easings.js.map +1 -0
- package/dist/components/_util/error.d.ts +3 -0
- package/dist/components/_util/error.js +22 -0
- package/dist/components/_util/error.js.map +1 -0
- package/dist/components/_util/functions.d.ts +1 -0
- package/dist/components/_util/functions.js +6 -0
- package/dist/components/_util/functions.js.map +1 -0
- package/dist/components/_util/i18n.d.ts +1 -0
- package/dist/components/_util/i18n.js +5 -0
- package/dist/components/_util/i18n.js.map +1 -0
- package/dist/components/_util/index.d.ts +15 -0
- package/dist/components/_util/index.js +140 -0
- package/dist/components/_util/index.js.map +1 -0
- package/dist/components/_util/isValid.js +4 -4
- package/dist/components/_util/isValid.js.map +1 -0
- package/dist/components/_util/objects.d.ts +8 -0
- package/dist/components/_util/objects.js +17 -0
- package/dist/components/_util/objects.js.map +1 -0
- package/dist/components/_util/props-util/index.d.ts +4 -4
- package/dist/components/_util/props-util/index.js +23 -50
- package/dist/components/_util/props-util/index.js.map +1 -0
- package/dist/components/_util/props-util/initDefaultProps.d.ts +2 -2
- package/dist/components/_util/props-util/initDefaultProps.js +13 -24
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -0
- package/dist/components/_util/raf.d.ts +2 -0
- package/dist/components/_util/raf.js +7 -0
- package/dist/components/_util/raf.js.map +1 -0
- package/dist/components/_util/rand.d.ts +12 -0
- package/dist/components/_util/rand.js +6 -0
- package/dist/components/_util/rand.js.map +1 -0
- package/dist/components/_util/strings.d.ts +6 -0
- package/dist/components/_util/strings.js +11 -0
- package/dist/components/_util/strings.js.map +1 -0
- package/dist/components/_util/throttleByRaf.d.ts +4 -0
- package/dist/components/_util/throttleByRaf.js +16 -0
- package/dist/components/_util/throttleByRaf.js.map +1 -0
- package/dist/components/_util/type.d.ts +5 -1
- package/dist/components/_util/type.js +52 -65
- package/dist/components/_util/type.js.map +1 -0
- package/dist/components/_util/types.d.ts +10 -0
- package/dist/components/_util/types.js +25 -0
- package/dist/components/_util/types.js.map +1 -0
- package/dist/components/_util/typescript.d.ts +12 -0
- package/dist/components/_util/typescript.js +5 -0
- package/dist/components/_util/typescript.js.map +1 -0
- package/dist/components/_util/util.d.ts +1 -1
- package/dist/components/_util/util.js +46 -74
- package/dist/components/_util/util.js.map +1 -0
- package/dist/components/_util/vue/global-node.d.ts +3 -0
- package/dist/components/_util/vue/global-node.js +21 -0
- package/dist/components/_util/vue/global-node.js.map +1 -0
- package/dist/components/_util/vue/icon.d.ts +23 -0
- package/dist/components/_util/vue/icon.js +154 -0
- package/dist/components/_util/vue/icon.js.map +1 -0
- package/dist/components/_util/vue/index.d.ts +9 -0
- package/dist/components/_util/vue/index.js +44 -0
- package/dist/components/_util/vue/index.js.map +1 -0
- package/dist/components/_util/vue/install.d.ts +6 -0
- package/dist/components/_util/vue/install.js +21 -0
- package/dist/components/_util/vue/install.js.map +1 -0
- package/dist/components/_util/vue/props/index.d.ts +3 -0
- package/dist/components/_util/vue/props/index.js +9 -0
- package/dist/components/_util/vue/props/index.js.map +1 -0
- package/dist/components/_util/vue/props/runtime.d.ts +29 -0
- package/dist/components/_util/vue/props/runtime.js +37 -0
- package/dist/components/_util/vue/props/runtime.js.map +1 -0
- package/dist/components/_util/vue/props/types.d.ts +120 -0
- package/dist/components/_util/vue/props/types.js +2 -0
- package/dist/components/_util/vue/props/types.js.map +1 -0
- package/dist/components/_util/vue/props/util.d.ts +8 -0
- package/dist/components/_util/vue/props/util.js +2 -0
- package/dist/components/_util/vue/props/util.js.map +1 -0
- package/dist/components/_util/vue/refs.d.ts +3 -0
- package/dist/components/_util/vue/refs.js +12 -0
- package/dist/components/_util/vue/refs.js.map +1 -0
- package/dist/components/_util/vue/size.d.ts +2 -0
- package/dist/components/_util/vue/size.js +6 -0
- package/dist/components/_util/vue/size.js.map +1 -0
- package/dist/components/_util/vue/typescript.d.ts +5 -0
- package/dist/components/_util/vue/typescript.js +2 -0
- package/dist/components/_util/vue/typescript.js.map +1 -0
- package/dist/components/_util/vue/validator.d.ts +3 -0
- package/dist/components/_util/vue/validator.js +7 -0
- package/dist/components/_util/vue/validator.js.map +1 -0
- package/dist/components/_util/vue/vnode.d.ts +50 -0
- package/dist/components/_util/vue/vnode.js +68 -0
- package/dist/components/_util/vue/vnode.js.map +1 -0
- package/dist/components/_util/vue-types/index.d.ts +3 -3
- package/dist/components/_util/vue-types/index.js +275 -417
- package/dist/components/_util/vue-types/index.js.map +1 -0
- package/dist/components/components.d.ts +4 -0
- package/dist/components/components.js +19 -12
- package/dist/components/components.js.map +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +26 -24
- package/dist/components/index.js.map +1 -0
- package/dist/components-CutWiB7Q.js +68 -0
- package/dist/components-CutWiB7Q.js.map +1 -0
- package/dist/error/OrionError.js +7 -12
- package/dist/error/OrionError.js.map +1 -0
- package/dist/functions-DzLqXvGt.js +33 -0
- package/dist/functions-DzLqXvGt.js.map +1 -0
- package/dist/index-BbsXWo7C.js +44 -0
- package/dist/index-BbsXWo7C.js.map +1 -0
- package/dist/index-C8JNJPWW.js +8 -0
- package/dist/index-C8JNJPWW.js.map +1 -0
- package/dist/index.css +1 -44
- package/dist/index.d.ts +2 -1
- package/dist/index.js +27 -14
- package/dist/index.js.map +1 -0
- package/dist/print/LodopFuncs.js +48 -111
- package/dist/print/LodopFuncs.js.map +1 -0
- package/dist/print/index.d.ts +2 -2
- package/dist/print/index.js +111 -220
- package/dist/print/index.js.map +1 -0
- package/dist/request/ErrorHandlerChain.js +17 -15
- package/dist/request/ErrorHandlerChain.js.map +1 -0
- package/dist/request/RequestFilterChain.d.ts +1 -1
- package/dist/request/RequestFilterChain.js +16 -14
- package/dist/request/RequestFilterChain.js.map +1 -0
- package/dist/request/ResponseParserChain.d.ts +1 -1
- package/dist/request/ResponseParserChain.js +17 -15
- package/dist/request/ResponseParserChain.js.map +1 -0
- package/dist/request/disivion/DateSerializer.js +25 -46
- package/dist/request/disivion/DateSerializer.js.map +1 -0
- package/dist/request/disivion/DivisionErrorHandler.d.ts +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +30 -52
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -0
- package/dist/request/disivion/DivisionResponseParser.d.ts +2 -2
- package/dist/request/disivion/DivisionResponseParser.js +13 -25
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -0
- package/dist/request/disivion/index.d.ts +3 -3
- package/dist/request/disivion/index.js +230 -480
- package/dist/request/disivion/index.js.map +1 -0
- package/dist/request/error/BizExceptionResponseError.d.ts +2 -2
- package/dist/request/error/BizExceptionResponseError.js +8 -15
- package/dist/request/error/BizExceptionResponseError.js.map +1 -0
- package/dist/request/error/ExceptionResponseError.d.ts +2 -2
- package/dist/request/error/ExceptionResponseError.js +8 -15
- package/dist/request/error/ExceptionResponseError.js.map +1 -0
- package/dist/request/error/ResponseError.d.ts +1 -1
- package/dist/request/error/ResponseError.js +7 -14
- package/dist/request/error/ResponseError.js.map +1 -0
- package/dist/request/error/SessionExceptionResponseError.d.ts +2 -2
- package/dist/request/error/SessionExceptionResponseError.js +8 -15
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -0
- package/dist/request/index.js +11 -17
- package/dist/request/index.js.map +1 -0
- package/dist/style/index.d.ts +0 -3
- package/dist/style/index.js +1 -0
- package/dist/style/index.js.map +1 -0
- package/dist/utils/DateUtil.js +36 -50
- package/dist/utils/DateUtil.js.map +1 -0
- package/dist/utils/NumberUtil.js +9 -8
- package/dist/utils/NumberUtil.js.map +1 -0
- package/dist/utils/cloneDeep.js +5 -1
- package/dist/utils/cloneDeep.js.map +1 -0
- package/dist/utils/delay.js +6 -4
- package/dist/utils/delay.js.map +1 -0
- package/dist/utils/functions.d.ts +1 -0
- package/dist/utils/functions.js +6 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/utils/index.js +15 -9
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/md5.js +120 -245
- package/dist/utils/md5.js.map +1 -0
- package/dist/utils/uuid.js +28 -58
- package/dist/utils/uuid.js.map +1 -0
- package/dist/version/index.d.ts +1 -1
- package/dist/version/index.js +5 -6
- package/dist/version/index.js.map +1 -0
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +5 -3
- package/dist/version/version.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/global.d.ts +6 -0
- package/package.json +53 -63
- package/dist/components-BTX5S_6V.js +0 -128
@@ -0,0 +1,11 @@
|
|
1
|
+
export declare const isScroll: (el: HTMLElement, isVertical?: boolean) => boolean;
|
2
|
+
export declare const getScrollContainer: (el: HTMLElement, isVertical?: boolean) => Window | HTMLElement | undefined;
|
3
|
+
export declare const getScrollBarWidth: (namespace: string) => number;
|
4
|
+
/**
|
5
|
+
* Scroll with in the container element, positioning the **selected** element at the top
|
6
|
+
* of the container
|
7
|
+
*/
|
8
|
+
export declare function scrollIntoView(container: HTMLElement, selected: HTMLElement): void;
|
9
|
+
export declare function animateScrollTo(container: HTMLElement | Window, from: number, to: number, duration: number, callback?: unknown): () => void;
|
10
|
+
export declare const getScrollElement: (target: HTMLElement, container: HTMLElement | Window) => HTMLElement;
|
11
|
+
export declare const getScrollTop: (container: HTMLElement | Window) => number;
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import { easeInOutCubic as w } from "../easings.js";
|
2
|
+
import { isWindow as u } from "../types.js";
|
3
|
+
import { rAF as h, cAF as a } from "../raf.js";
|
4
|
+
import { getStyle as T } from "./style.js";
|
5
|
+
import { i as p } from "../../../index-C8JNJPWW.js";
|
6
|
+
const v = (o, t) => {
|
7
|
+
if (!p) return !1;
|
8
|
+
const l = {
|
9
|
+
undefined: "overflow",
|
10
|
+
true: "overflow-y",
|
11
|
+
false: "overflow-x"
|
12
|
+
}[String(t)], e = T(o, l);
|
13
|
+
return ["scroll", "auto", "overlay"].some((r) => e.includes(r));
|
14
|
+
}, b = (o, t) => {
|
15
|
+
if (!p) return;
|
16
|
+
let l = o;
|
17
|
+
for (; l; ) {
|
18
|
+
if ([window, document, document.documentElement].includes(l))
|
19
|
+
return window;
|
20
|
+
if (v(l, t)) return l;
|
21
|
+
l = l.parentNode;
|
22
|
+
}
|
23
|
+
return l;
|
24
|
+
};
|
25
|
+
let f;
|
26
|
+
const x = (o) => {
|
27
|
+
var s;
|
28
|
+
if (!p) return 0;
|
29
|
+
if (f !== void 0) return f;
|
30
|
+
const t = document.createElement("div");
|
31
|
+
t.className = `${o}-scrollbar__wrap`, t.style.visibility = "hidden", t.style.width = "100px", t.style.position = "absolute", t.style.top = "-9999px", document.body.appendChild(t);
|
32
|
+
const l = t.offsetWidth;
|
33
|
+
t.style.overflow = "scroll";
|
34
|
+
const e = document.createElement("div");
|
35
|
+
e.style.width = "100%", t.appendChild(e);
|
36
|
+
const r = e.offsetWidth;
|
37
|
+
return (s = t.parentNode) == null || s.removeChild(t), f = l - r, f;
|
38
|
+
};
|
39
|
+
function E(o, t) {
|
40
|
+
if (!p) return;
|
41
|
+
if (!t) {
|
42
|
+
o.scrollTop = 0;
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
const l = [];
|
46
|
+
let e = t.offsetParent;
|
47
|
+
for (; e !== null && o !== e && o.contains(e); )
|
48
|
+
l.push(e), e = e.offsetParent;
|
49
|
+
const r = t.offsetTop + l.reduce((m, i) => m + i.offsetTop, 0), s = r + t.offsetHeight, n = o.scrollTop, c = n + o.clientHeight;
|
50
|
+
r < n ? o.scrollTop = r : s > c && (o.scrollTop = s - o.clientHeight);
|
51
|
+
}
|
52
|
+
function N(o, t, l, e, r) {
|
53
|
+
const s = Date.now();
|
54
|
+
let n;
|
55
|
+
const c = () => {
|
56
|
+
const i = Date.now() - s, d = w(
|
57
|
+
i > e ? e : i,
|
58
|
+
t,
|
59
|
+
l,
|
60
|
+
e
|
61
|
+
);
|
62
|
+
u(o) ? o.scrollTo(window.pageXOffset, d) : o.scrollTop = d, i < e ? n = h(c) : typeof r == "function" && r();
|
63
|
+
};
|
64
|
+
return c(), () => {
|
65
|
+
n && a(n);
|
66
|
+
};
|
67
|
+
}
|
68
|
+
const B = (o, t) => u(t) ? o.ownerDocument.documentElement : t, D = (o) => u(o) ? window.scrollY : o.scrollTop;
|
69
|
+
export {
|
70
|
+
N as animateScrollTo,
|
71
|
+
x as getScrollBarWidth,
|
72
|
+
b as getScrollContainer,
|
73
|
+
B as getScrollElement,
|
74
|
+
D as getScrollTop,
|
75
|
+
v as isScroll,
|
76
|
+
E as scrollIntoView
|
77
|
+
};
|
78
|
+
//# sourceMappingURL=scroll.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scroll.js","sources":["../../../../src/components/_util/dom/scroll.ts"],"sourcesContent":["import { isClient } from '../browser'\r\nimport { easeInOutCubic } from '../easings'\r\nimport { isWindow } from '../types'\r\nimport { cAF, rAF } from '../raf'\r\nimport { getStyle } from './style'\r\n\r\nexport const isScroll = (el: HTMLElement, isVertical?: boolean): boolean => {\r\n if (!isClient) return false\r\n\r\n const key = (\r\n {\r\n undefined: 'overflow',\r\n true: 'overflow-y',\r\n false: 'overflow-x',\r\n } as const\r\n )[String(isVertical)]!\r\n const overflow = getStyle(el, key)\r\n return ['scroll', 'auto', 'overlay'].some((s) => overflow.includes(s))\r\n}\r\n\r\nexport const getScrollContainer = (\r\n el: HTMLElement,\r\n isVertical?: boolean\r\n): Window | HTMLElement | undefined => {\r\n if (!isClient) return\r\n\r\n let parent: HTMLElement = el\r\n while (parent) {\r\n if ([window, document, document.documentElement].includes(parent))\r\n return window\r\n\r\n if (isScroll(parent, isVertical)) return parent\r\n\r\n parent = parent.parentNode as HTMLElement\r\n }\r\n\r\n return parent\r\n}\r\n\r\nlet scrollBarWidth: number\r\nexport const getScrollBarWidth = (namespace: string): number => {\r\n if (!isClient) return 0\r\n if (scrollBarWidth !== undefined) return scrollBarWidth\r\n\r\n const outer = document.createElement('div')\r\n outer.className = `${namespace}-scrollbar__wrap`\r\n outer.style.visibility = 'hidden'\r\n outer.style.width = '100px'\r\n outer.style.position = 'absolute'\r\n outer.style.top = '-9999px'\r\n document.body.appendChild(outer)\r\n\r\n const widthNoScroll = outer.offsetWidth\r\n outer.style.overflow = 'scroll'\r\n\r\n const inner = document.createElement('div')\r\n inner.style.width = '100%'\r\n outer.appendChild(inner)\r\n\r\n const widthWithScroll = inner.offsetWidth\r\n outer.parentNode?.removeChild(outer)\r\n scrollBarWidth = widthNoScroll - widthWithScroll\r\n\r\n return scrollBarWidth\r\n}\r\n\r\n/**\r\n * Scroll with in the container element, positioning the **selected** element at the top\r\n * of the container\r\n */\r\nexport function scrollIntoView(\r\n container: HTMLElement,\r\n selected: HTMLElement\r\n): void {\r\n if (!isClient) return\r\n\r\n if (!selected) {\r\n container.scrollTop = 0\r\n return\r\n }\r\n\r\n const offsetParents: HTMLElement[] = []\r\n let pointer = selected.offsetParent\r\n while (\r\n pointer !== null &&\r\n container !== pointer &&\r\n container.contains(pointer)\r\n ) {\r\n offsetParents.push(pointer as HTMLElement)\r\n pointer = (pointer as HTMLElement).offsetParent\r\n }\r\n const top =\r\n selected.offsetTop +\r\n offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0)\r\n const bottom = top + selected.offsetHeight\r\n const viewRectTop = container.scrollTop\r\n const viewRectBottom = viewRectTop + container.clientHeight\r\n\r\n if (top < viewRectTop) {\r\n container.scrollTop = top\r\n } else if (bottom > viewRectBottom) {\r\n container.scrollTop = bottom - container.clientHeight\r\n }\r\n}\r\n\r\nexport function animateScrollTo(\r\n container: HTMLElement | Window,\r\n from: number,\r\n to: number,\r\n duration: number,\r\n callback?: unknown\r\n) {\r\n const startTime = Date.now()\r\n\r\n let handle: number | undefined\r\n const scroll = () => {\r\n const timestamp = Date.now()\r\n const time = timestamp - startTime\r\n const nextScrollTop = easeInOutCubic(\r\n time > duration ? duration : time,\r\n from,\r\n to,\r\n duration\r\n )\r\n\r\n if (isWindow(container)) {\r\n container.scrollTo(window.pageXOffset, nextScrollTop)\r\n } else {\r\n container.scrollTop = nextScrollTop\r\n }\r\n if (time < duration) {\r\n handle = rAF(scroll)\r\n } else if (typeof callback === 'function') {\r\n callback()\r\n }\r\n }\r\n\r\n scroll()\r\n\r\n return () => {\r\n handle && cAF(handle)\r\n }\r\n}\r\n\r\nexport const getScrollElement = (\r\n target: HTMLElement,\r\n container: HTMLElement | Window\r\n) => {\r\n if (isWindow(container)) {\r\n return target.ownerDocument.documentElement\r\n }\r\n return container\r\n}\r\n\r\nexport const getScrollTop = (container: HTMLElement | Window) => {\r\n if (isWindow(container)) {\r\n return window.scrollY\r\n }\r\n return container.scrollTop\r\n}\r\n"],"names":["isScroll","el","isVertical","isClient","key","overflow","getStyle","s","getScrollContainer","parent","scrollBarWidth","getScrollBarWidth","namespace","outer","widthNoScroll","inner","widthWithScroll","_a","scrollIntoView","container","selected","offsetParents","pointer","top","prev","curr","bottom","viewRectTop","viewRectBottom","animateScrollTo","from","to","duration","callback","startTime","handle","scroll","time","nextScrollTop","easeInOutCubic","isWindow","rAF","cAF","getScrollElement","target","getScrollTop"],"mappings":";;;;;AAMa,MAAAA,IAAW,CAACC,GAAiBC,MAAkC;AACtE,MAAA,CAACC,EAAiB,QAAA;AAEtB,QAAMC,IACJ;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,EAET,OAAOF,CAAU,CAAC,GACdG,IAAWC,EAASL,GAAIG,CAAG;AAC1B,SAAA,CAAC,UAAU,QAAQ,SAAS,EAAE,KAAK,CAACG,MAAMF,EAAS,SAASE,CAAC,CAAC;AACvE,GAEaC,IAAqB,CAChCP,GACAC,MACqC;AACrC,MAAI,CAACC,EAAU;AAEf,MAAIM,IAAsBR;AAC1B,SAAOQ,KAAQ;AACb,QAAI,CAAC,QAAQ,UAAU,SAAS,eAAe,EAAE,SAASA,CAAM;AACvD,aAAA;AAET,QAAIT,EAASS,GAAQP,CAAU,EAAU,QAAAO;AAEzC,IAAAA,IAASA,EAAO;AAAA,EAClB;AAEO,SAAAA;AACT;AAEA,IAAIC;AACS,MAAAC,IAAoB,CAACC,MAA8B;;AAC1D,MAAA,CAACT,EAAiB,QAAA;AAClB,MAAAO,MAAmB,OAAkB,QAAAA;AAEnC,QAAAG,IAAQ,SAAS,cAAc,KAAK;AACpC,EAAAA,EAAA,YAAY,GAAGD,CAAS,oBAC9BC,EAAM,MAAM,aAAa,UACzBA,EAAM,MAAM,QAAQ,SACpBA,EAAM,MAAM,WAAW,YACvBA,EAAM,MAAM,MAAM,WACT,SAAA,KAAK,YAAYA,CAAK;AAE/B,QAAMC,IAAgBD,EAAM;AAC5B,EAAAA,EAAM,MAAM,WAAW;AAEjB,QAAAE,IAAQ,SAAS,cAAc,KAAK;AAC1C,EAAAA,EAAM,MAAM,QAAQ,QACpBF,EAAM,YAAYE,CAAK;AAEvB,QAAMC,IAAkBD,EAAM;AACxB,UAAAE,IAAAJ,EAAA,eAAA,QAAAI,EAAY,YAAYJ,IAC9BH,IAAiBI,IAAgBE,GAE1BN;AACT;AAMgB,SAAAQ,EACdC,GACAC,GACM;AACN,MAAI,CAACjB,EAAU;AAEf,MAAI,CAACiB,GAAU;AACb,IAAAD,EAAU,YAAY;AACtB;AAAA,EACF;AAEA,QAAME,IAA+B,CAAA;AACrC,MAAIC,IAAUF,EAAS;AACvB,SACEE,MAAY,QACZH,MAAcG,KACdH,EAAU,SAASG,CAAO;AAE1B,IAAAD,EAAc,KAAKC,CAAsB,GACzCA,IAAWA,EAAwB;AAE/B,QAAAC,IACJH,EAAS,YACTC,EAAc,OAAO,CAACG,GAAMC,MAASD,IAAOC,EAAK,WAAW,CAAC,GACzDC,IAASH,IAAMH,EAAS,cACxBO,IAAcR,EAAU,WACxBS,IAAiBD,IAAcR,EAAU;AAE/C,EAAII,IAAMI,IACRR,EAAU,YAAYI,IACbG,IAASE,MACRT,EAAA,YAAYO,IAASP,EAAU;AAE7C;AAEO,SAASU,EACdV,GACAW,GACAC,GACAC,GACAC,GACA;AACM,QAAAC,IAAY,KAAK;AAEnB,MAAAC;AACJ,QAAMC,IAAS,MAAM;AAEnB,UAAMC,IADY,KAAK,QACEH,GACnBI,IAAgBC;AAAA,MACpBF,IAAOL,IAAWA,IAAWK;AAAA,MAC7BP;AAAA,MACAC;AAAA,MACAC;AAAA,IAAA;AAGE,IAAAQ,EAASrB,CAAS,IACVA,EAAA,SAAS,OAAO,aAAamB,CAAa,IAEpDnB,EAAU,YAAYmB,GAEpBD,IAAOL,IACTG,IAASM,EAAIL,CAAM,IACV,OAAOH,KAAa,cACpBA;EACX;AAGK,SAAAG,KAEA,MAAM;AACX,IAAAD,KAAUO,EAAIP,CAAM;AAAA,EAAA;AAExB;AAEa,MAAAQ,IAAmB,CAC9BC,GACAzB,MAEIqB,EAASrB,CAAS,IACbyB,EAAO,cAAc,kBAEvBzB,GAGI0B,IAAe,CAAC1B,MACvBqB,EAASrB,CAAS,IACb,OAAO,UAETA,EAAU;"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { CSSProperties } from 'vue';
|
2
|
+
export declare const classNameToArray: (cls?: string) => string[];
|
3
|
+
export declare const hasClass: (el: Element, cls: string) => boolean;
|
4
|
+
export declare const addClass: (el: Element, cls: string) => void;
|
5
|
+
export declare const removeClass: (el: Element, cls: string) => void;
|
6
|
+
export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
|
7
|
+
export declare const setStyle: (element: HTMLElement, styleName: CSSProperties | keyof CSSProperties, value?: string | number) => void;
|
8
|
+
export declare const removeStyle: (element: HTMLElement, style: CSSProperties | keyof CSSProperties) => void;
|
9
|
+
export declare function addUnit(value?: string | number, defaultUnit?: string): string | undefined;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { isNumber as u, isStringNumber as d } from "../types.js";
|
2
|
+
import { c as f, d as c, e as m } from "../../../functions-DzLqXvGt.js";
|
3
|
+
import { entriesOf as p, keysOf as b } from "../objects.js";
|
4
|
+
import { debugWarn as g } from "../error.js";
|
5
|
+
import { i as l } from "../../../index-C8JNJPWW.js";
|
6
|
+
const y = "utils/dom/style", e = (r = "") => r.split(" ").filter((t) => !!t.trim()), w = (r, t) => {
|
7
|
+
if (!r || !t) return !1;
|
8
|
+
if (t.includes(" ")) throw new Error("className should not contain space.");
|
9
|
+
return r.classList.contains(t);
|
10
|
+
}, L = (r, t) => {
|
11
|
+
!r || !t.trim() || r.classList.add(...e(t));
|
12
|
+
}, x = (r, t) => {
|
13
|
+
!r || !t.trim() || r.classList.remove(...e(t));
|
14
|
+
}, $ = (r, t) => {
|
15
|
+
var i;
|
16
|
+
if (!l || !r || !t) return "";
|
17
|
+
let s = f(t);
|
18
|
+
s === "float" && (s = "cssFloat");
|
19
|
+
try {
|
20
|
+
const o = r.style[s];
|
21
|
+
if (o) return o;
|
22
|
+
const n = (i = document.defaultView) == null ? void 0 : i.getComputedStyle(r, "");
|
23
|
+
return n ? n[s] : "";
|
24
|
+
} catch {
|
25
|
+
return r.style[s];
|
26
|
+
}
|
27
|
+
}, a = (r, t, s) => {
|
28
|
+
if (!(!r || !t))
|
29
|
+
if (c(t))
|
30
|
+
p(t).forEach(
|
31
|
+
([i, o]) => a(r, i, o)
|
32
|
+
);
|
33
|
+
else {
|
34
|
+
const i = f(t);
|
35
|
+
r.style[i] = s;
|
36
|
+
}
|
37
|
+
}, S = (r, t) => {
|
38
|
+
!r || !t || (c(t) ? b(t).forEach((s) => S(r, s)) : a(r, t, ""));
|
39
|
+
};
|
40
|
+
function j(r, t = "px") {
|
41
|
+
if (!r) return "";
|
42
|
+
if (u(r) || d(r))
|
43
|
+
return `${r}${t}`;
|
44
|
+
if (m(r))
|
45
|
+
return r;
|
46
|
+
g(y, "binding value must be a string or number");
|
47
|
+
}
|
48
|
+
export {
|
49
|
+
L as addClass,
|
50
|
+
j as addUnit,
|
51
|
+
e as classNameToArray,
|
52
|
+
$ as getStyle,
|
53
|
+
w as hasClass,
|
54
|
+
x as removeClass,
|
55
|
+
S as removeStyle,
|
56
|
+
a as setStyle
|
57
|
+
};
|
58
|
+
//# sourceMappingURL=style.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/_util/dom/style.ts"],"sourcesContent":["import { isNumber, isObject, isString, isStringNumber } from '../types'\r\nimport { isClient } from '../browser'\r\nimport { camelize } from '../strings'\r\nimport { entriesOf, keysOf } from '../objects'\r\nimport { debugWarn } from '../error'\r\nimport type { CSSProperties } from 'vue'\r\n\r\nconst SCOPE = 'utils/dom/style'\r\n\r\nexport const classNameToArray = (cls = '') =>\r\n cls.split(' ').filter((item) => !!item.trim())\r\n\r\nexport const hasClass = (el: Element, cls: string): boolean => {\r\n if (!el || !cls) return false\r\n if (cls.includes(' ')) throw new Error('className should not contain space.')\r\n return el.classList.contains(cls)\r\n}\r\n\r\nexport const addClass = (el: Element, cls: string) => {\r\n if (!el || !cls.trim()) return\r\n el.classList.add(...classNameToArray(cls))\r\n}\r\n\r\nexport const removeClass = (el: Element, cls: string) => {\r\n if (!el || !cls.trim()) return\r\n el.classList.remove(...classNameToArray(cls))\r\n}\r\n\r\nexport const getStyle = (\r\n element: HTMLElement,\r\n styleName: keyof CSSProperties\r\n): string => {\r\n if (!isClient || !element || !styleName) return ''\r\n\r\n let key = camelize(styleName)\r\n if (key === 'float') key = 'cssFloat'\r\n try {\r\n const style = (element.style as any)[key]\r\n if (style) return style\r\n const computed: any = document.defaultView?.getComputedStyle(element, '')\r\n return computed ? computed[key] : ''\r\n } catch {\r\n return (element.style as any)[key]\r\n }\r\n}\r\n\r\nexport const setStyle = (\r\n element: HTMLElement,\r\n styleName: CSSProperties | keyof CSSProperties,\r\n value?: string | number\r\n) => {\r\n if (!element || !styleName) return\r\n\r\n if (isObject(styleName)) {\r\n entriesOf(styleName).forEach(([prop, value]) =>\r\n setStyle(element, prop, value)\r\n )\r\n } else {\r\n const key: any = camelize(styleName)\r\n element.style[key] = value as any\r\n }\r\n}\r\n\r\nexport const removeStyle = (\r\n element: HTMLElement,\r\n style: CSSProperties | keyof CSSProperties\r\n) => {\r\n if (!element || !style) return\r\n\r\n if (isObject(style)) {\r\n keysOf(style).forEach((prop) => removeStyle(element, prop))\r\n } else {\r\n setStyle(element, style, '')\r\n }\r\n}\r\n\r\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\r\n if (!value) return ''\r\n if (isNumber(value) || isStringNumber(value)) {\r\n return `${value}${defaultUnit}`\r\n } else if (isString(value)) {\r\n return value\r\n }\r\n debugWarn(SCOPE, 'binding value must be a string or number')\r\n}\r\n"],"names":["SCOPE","classNameToArray","cls","item","hasClass","el","addClass","removeClass","getStyle","element","styleName","isClient","key","camelize","style","computed","_a","setStyle","value","isObject","entriesOf","prop","removeStyle","keysOf","addUnit","defaultUnit","isNumber","isStringNumber","isString","debugWarn"],"mappings":";;;;;AAOA,MAAMA,IAAQ,mBAEDC,IAAmB,CAACC,IAAM,OACrCA,EAAI,MAAM,GAAG,EAAE,OAAO,CAACC,MAAS,CAAC,CAACA,EAAK,MAAM,GAElCC,IAAW,CAACC,GAAaH,MAAyB;AAC7D,MAAI,CAACG,KAAM,CAACH,EAAY,QAAA;AACxB,MAAIA,EAAI,SAAS,GAAG,EAAS,OAAA,IAAI,MAAM,qCAAqC;AACrE,SAAAG,EAAG,UAAU,SAASH,CAAG;AAClC,GAEaI,IAAW,CAACD,GAAaH,MAAgB;AACpD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,IAAI,GAAGJ,EAAiBC,CAAG,CAAC;AAC3C,GAEaK,IAAc,CAACF,GAAaH,MAAgB;AACvD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,OAAO,GAAGJ,EAAiBC,CAAG,CAAC;AAC9C,GAEaM,IAAW,CACtBC,GACAC,MACW;;AACX,MAAI,CAACC,KAAY,CAACF,KAAW,CAACC,EAAkB,QAAA;AAE5C,MAAAE,IAAMC,EAASH,CAAS;AACxB,EAAAE,MAAQ,YAAeA,IAAA;AACvB,MAAA;AACI,UAAAE,IAASL,EAAQ,MAAcG,CAAG;AACxC,QAAIE,EAAc,QAAAA;AAClB,UAAMC,KAAgBC,IAAA,SAAS,gBAAT,gBAAAA,EAAsB,iBAAiBP,GAAS;AAC/D,WAAAM,IAAWA,EAASH,CAAG,IAAI;AAAA,EAAA,QAC5B;AACE,WAAAH,EAAQ,MAAcG,CAAG;AAAA,EACnC;AACF,GAEaK,IAAW,CACtBR,GACAC,GACAQ,MACG;AACC,MAAA,GAACT,KAAW,CAACC;AAEb,QAAAS,EAAST,CAAS;AACpB,MAAAU,EAAUV,CAAS,EAAE;AAAA,QAAQ,CAAC,CAACW,GAAMH,CAAK,MACxCD,EAASR,GAASY,GAAMH,CAAK;AAAA,MAAA;AAAA,SAE1B;AACC,YAAAN,IAAWC,EAASH,CAAS;AAC3B,MAAAD,EAAA,MAAMG,CAAG,IAAIM;AAAA,IACvB;AACF,GAEaI,IAAc,CACzBb,GACAK,MACG;AACC,EAAA,CAACL,KAAW,CAACK,MAEbK,EAASL,CAAK,IACTS,EAAAT,CAAK,EAAE,QAAQ,CAACO,MAASC,EAAYb,GAASY,CAAI,CAAC,IAEjDJ,EAAAR,GAASK,GAAO,EAAE;AAE/B;AAEgB,SAAAU,EAAQN,GAAyBO,IAAc,MAAM;AAC/D,MAAA,CAACP,EAAc,QAAA;AACnB,MAAIQ,EAASR,CAAK,KAAKS,EAAeT,CAAK;AAClC,WAAA,GAAGA,CAAK,GAAGO,CAAW;AAC/B,MAAWG,EAASV,CAAK;AAChB,WAAAA;AAET,EAAAW,EAAU7B,GAAO,0CAA0C;AAC7D;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"easings.js","sources":["../../../src/components/_util/easings.ts"],"sourcesContent":["export function easeInOutCubic(t: number, b: number, c: number, d: number) {\r\n const cc = c - b\r\n t /= d / 2\r\n if (t < 1) {\r\n return (cc / 2) * t * t * t + b\r\n }\r\n return (cc / 2) * ((t -= 2) * t * t + 2) + b\r\n}\r\n"],"names":["easeInOutCubic","t","b","c","d","cc"],"mappings":"AAAO,SAASA,EAAeC,GAAWC,GAAWC,GAAWC,GAAW;AACzE,QAAMC,IAAKF,IAAID;AAEf,SADAD,KAAKG,IAAI,GACLH,IAAI,IACEI,IAAK,IAAKJ,IAAIA,IAAIA,IAAIC,IAExBG,IAAK,MAAOJ,KAAK,KAAKA,IAAIA,IAAI,KAAKC;AAC7C;"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { e } from "../../functions-DzLqXvGt.js";
|
2
|
+
import "lodash-es";
|
3
|
+
import "vue";
|
4
|
+
class n extends Error {
|
5
|
+
constructor(o) {
|
6
|
+
super(o), this.name = "ElementPlusError";
|
7
|
+
}
|
8
|
+
}
|
9
|
+
function E(r, o) {
|
10
|
+
throw new n(`[${r}] ${o}`);
|
11
|
+
}
|
12
|
+
function c(r, o) {
|
13
|
+
if (process.env.NODE_ENV !== "production") {
|
14
|
+
const t = e(r) ? new n(`[${r}] ${o}`) : r;
|
15
|
+
console.warn(t);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
export {
|
19
|
+
c as debugWarn,
|
20
|
+
E as throwError
|
21
|
+
};
|
22
|
+
//# sourceMappingURL=error.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"error.js","sources":["../../../src/components/_util/error.ts"],"sourcesContent":["import { isString } from './types'\r\n\r\nclass ElementPlusError extends Error {\r\n constructor(m: string) {\r\n super(m)\r\n this.name = 'ElementPlusError'\r\n }\r\n}\r\n\r\nexport function throwError(scope: string, m: string): never {\r\n throw new ElementPlusError(`[${scope}] ${m}`)\r\n}\r\n\r\nexport function debugWarn(err: Error): void\r\nexport function debugWarn(scope: string, message: string): void\r\nexport function debugWarn(scope: string | Error, message?: string): void {\r\n if (process.env.NODE_ENV !== 'production') {\r\n const error: Error = isString(scope)\r\n ? new ElementPlusError(`[${scope}] ${message}`)\r\n : scope\r\n // eslint-disable-next-line no-console\r\n console.warn(error)\r\n }\r\n}\r\n"],"names":["ElementPlusError","m","throwError","scope","debugWarn","message","error","isString"],"mappings":";;;AAEA,MAAMA,UAAyB,MAAM;AAAA,EACnC,YAAYC,GAAW;AACrB,UAAMA,CAAC,GACP,KAAK,OAAO;AAAA,EACd;AACF;AAEgB,SAAAC,EAAWC,GAAeF,GAAkB;AAC1D,QAAM,IAAID,EAAiB,IAAIG,CAAK,KAAKF,CAAC,EAAE;AAC9C;AAIgB,SAAAG,EAAUD,GAAuBE,GAAwB;AACnE,MAAA,QAAQ,IAAI,aAAa,cAAc;AACnC,UAAAC,IAAeC,EAASJ,CAAK,IAC/B,IAAIH,EAAiB,IAAIG,CAAK,KAAKE,CAAO,EAAE,IAC5CF;AAEJ,YAAQ,KAAKG,CAAK;AAAA,EACpB;AACF;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NOOP, toRawType } from '@vue/shared';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"functions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const isKorean: (text: string) => boolean;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"i18n.js","sources":["../../../src/components/_util/i18n.ts"],"sourcesContent":["export const isKorean = (text: string) =>\r\n /([\\uAC00-\\uD7AF\\u3130-\\u318F])+/gi.test(text)\r\n"],"names":["isKorean","text"],"mappings":"AAAO,MAAMA,IAAW,CAACC,MACvB,oCAAoC,KAAKA,CAAI;"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export * from './dom';
|
2
|
+
export * from './vue';
|
3
|
+
export * from './arrays';
|
4
|
+
export * from './browser';
|
5
|
+
export * from './error';
|
6
|
+
export * from './functions';
|
7
|
+
export * from './i18n';
|
8
|
+
export * from './objects';
|
9
|
+
export * from './raf';
|
10
|
+
export * from './rand';
|
11
|
+
export * from './strings';
|
12
|
+
export * from './types';
|
13
|
+
export * from './typescript';
|
14
|
+
export * from './throttleByRaf';
|
15
|
+
export * from './easings';
|
@@ -0,0 +1,140 @@
|
|
1
|
+
import { attemptFocus as r, focusNode as t, getSibling as s, isFocusable as a, isLeaf as i, isVisible as l, obtainAllFocusableElements as n, triggerEvent as p } from "./dom/aria.js";
|
2
|
+
import { composeEventHandlers as f, whenMouse as c } from "./dom/event.js";
|
3
|
+
import { getClientXY as x, getOffsetTop as g, getOffsetTopDistance as b, isInContainer as y } from "./dom/position.js";
|
4
|
+
import { animateScrollTo as C, getScrollBarWidth as h, getScrollContainer as S, getScrollElement as N, getScrollTop as P, isScroll as T, scrollIntoView as O } from "./dom/scroll.js";
|
5
|
+
import { addClass as I, addUnit as w, classNameToArray as E, getStyle as A, hasClass as V, removeClass as v, removeStyle as k, setStyle as z } from "./dom/style.js";
|
6
|
+
import { getElement as B } from "./dom/element.js";
|
7
|
+
import { changeGlobalNodesTarget as j, createGlobalNode as G, removeGlobalNode as M } from "./vue/global-node.js";
|
8
|
+
import { CloseComponents as K, TypeComponents as U, TypeComponentsMap as q, ValidateComponentsMap as H, iconPropType as L } from "./vue/icon.js";
|
9
|
+
import { withInstall as Y, withInstallDirective as J, withInstallFunction as Q, withNoopInstall as Z } from "./vue/install.js";
|
10
|
+
import { buildProp as $, buildProps as ee, definePropType as oe, epPropKey as re, isEpProp as te } from "./vue/props/runtime.js";
|
11
|
+
import { composeRefs as ae } from "./vue/refs.js";
|
12
|
+
import { getComponentSize as le } from "./vue/size.js";
|
13
|
+
import { isValidComponentSize as pe, isValidDatePickType as me } from "./vue/validator.js";
|
14
|
+
import { PatchFlags as ce, ensureOnlyChild as de, flattedChildren as xe, getFirstValidNode as ge, getNormalizedProps as be, isComment as ye, isFragment as ue, isTemplate as Ce, isText as he, isValidElementNode as Se, renderBlock as Ne, renderIf as Pe } from "./vue/vnode.js";
|
15
|
+
import { castArray as Oe, unique as Fe } from "./arrays.js";
|
16
|
+
import { isFirefox as we } from "./browser.js";
|
17
|
+
import { debugWarn as Ae, throwError as Ve } from "./error.js";
|
18
|
+
import { N as ke, c as ze, h as Re, a as Be, i as De, f as je, b as Ge, d as Me, k as We, g as Ke, e as Ue, j as qe, a as He, t as Le } from "../../functions-DzLqXvGt.js";
|
19
|
+
import { isKorean as Ye } from "./i18n.js";
|
20
|
+
import { entriesOf as Qe, getProp as Ze, keysOf as _e } from "./objects.js";
|
21
|
+
import { cAF as eo, rAF as oo } from "./raf.js";
|
22
|
+
import { generateId as to, getRandomInt as so } from "./rand.js";
|
23
|
+
import { capitalize as io, escapeStringRegexp as lo } from "./strings.js";
|
24
|
+
import { isBoolean as po, isElement as mo, isEmpty as fo, isNumber as co, isPropAbsent as xo, isStringNumber as go, isUndefined as bo, isWindow as yo } from "./types.js";
|
25
|
+
import { mutable as Co } from "./typescript.js";
|
26
|
+
import { throttleByRaf as So } from "./throttleByRaf.js";
|
27
|
+
import { easeInOutCubic as Po } from "./easings.js";
|
28
|
+
import { castArray as Oo } from "lodash-es";
|
29
|
+
import { i as Io, a as wo } from "../../index-C8JNJPWW.js";
|
30
|
+
import { isVNode as Ao } from "vue";
|
31
|
+
export {
|
32
|
+
K as CloseComponents,
|
33
|
+
ke as NOOP,
|
34
|
+
ce as PatchFlags,
|
35
|
+
U as TypeComponents,
|
36
|
+
q as TypeComponentsMap,
|
37
|
+
H as ValidateComponentsMap,
|
38
|
+
I as addClass,
|
39
|
+
w as addUnit,
|
40
|
+
C as animateScrollTo,
|
41
|
+
r as attemptFocus,
|
42
|
+
$ as buildProp,
|
43
|
+
ee as buildProps,
|
44
|
+
eo as cAF,
|
45
|
+
ze as camelize,
|
46
|
+
io as capitalize,
|
47
|
+
Oe as castArray,
|
48
|
+
j as changeGlobalNodesTarget,
|
49
|
+
E as classNameToArray,
|
50
|
+
f as composeEventHandlers,
|
51
|
+
ae as composeRefs,
|
52
|
+
G as createGlobalNode,
|
53
|
+
Ae as debugWarn,
|
54
|
+
oe as definePropType,
|
55
|
+
Po as easeInOutCubic,
|
56
|
+
Oo as ensureArray,
|
57
|
+
de as ensureOnlyChild,
|
58
|
+
Qe as entriesOf,
|
59
|
+
re as epPropKey,
|
60
|
+
lo as escapeStringRegexp,
|
61
|
+
xe as flattedChildren,
|
62
|
+
t as focusNode,
|
63
|
+
to as generateId,
|
64
|
+
x as getClientXY,
|
65
|
+
le as getComponentSize,
|
66
|
+
B as getElement,
|
67
|
+
ge as getFirstValidNode,
|
68
|
+
be as getNormalizedProps,
|
69
|
+
g as getOffsetTop,
|
70
|
+
b as getOffsetTopDistance,
|
71
|
+
Ze as getProp,
|
72
|
+
so as getRandomInt,
|
73
|
+
h as getScrollBarWidth,
|
74
|
+
S as getScrollContainer,
|
75
|
+
N as getScrollElement,
|
76
|
+
P as getScrollTop,
|
77
|
+
s as getSibling,
|
78
|
+
A as getStyle,
|
79
|
+
V as hasClass,
|
80
|
+
Re as hasOwn,
|
81
|
+
Be as hyphenate,
|
82
|
+
L as iconPropType,
|
83
|
+
De as isArray,
|
84
|
+
po as isBoolean,
|
85
|
+
Io as isClient,
|
86
|
+
ye as isComment,
|
87
|
+
je as isDate,
|
88
|
+
mo as isElement,
|
89
|
+
fo as isEmpty,
|
90
|
+
te as isEpProp,
|
91
|
+
we as isFirefox,
|
92
|
+
a as isFocusable,
|
93
|
+
ue as isFragment,
|
94
|
+
Ge as isFunction,
|
95
|
+
wo as isIOS,
|
96
|
+
y as isInContainer,
|
97
|
+
Ye as isKorean,
|
98
|
+
i as isLeaf,
|
99
|
+
co as isNumber,
|
100
|
+
Me as isObject,
|
101
|
+
We as isPlainObject,
|
102
|
+
Ke as isPromise,
|
103
|
+
xo as isPropAbsent,
|
104
|
+
T as isScroll,
|
105
|
+
Ue as isString,
|
106
|
+
go as isStringNumber,
|
107
|
+
qe as isSymbol,
|
108
|
+
Ce as isTemplate,
|
109
|
+
he as isText,
|
110
|
+
bo as isUndefined,
|
111
|
+
Ao as isVNode,
|
112
|
+
pe as isValidComponentSize,
|
113
|
+
me as isValidDatePickType,
|
114
|
+
Se as isValidElementNode,
|
115
|
+
l as isVisible,
|
116
|
+
yo as isWindow,
|
117
|
+
He as kebabCase,
|
118
|
+
_e as keysOf,
|
119
|
+
Co as mutable,
|
120
|
+
n as obtainAllFocusableElements,
|
121
|
+
oo as rAF,
|
122
|
+
v as removeClass,
|
123
|
+
M as removeGlobalNode,
|
124
|
+
k as removeStyle,
|
125
|
+
Ne as renderBlock,
|
126
|
+
Pe as renderIf,
|
127
|
+
O as scrollIntoView,
|
128
|
+
z as setStyle,
|
129
|
+
So as throttleByRaf,
|
130
|
+
Ve as throwError,
|
131
|
+
Le as toRawType,
|
132
|
+
p as triggerEvent,
|
133
|
+
Fe as unique,
|
134
|
+
c as whenMouse,
|
135
|
+
Y as withInstall,
|
136
|
+
J as withInstallDirective,
|
137
|
+
Q as withInstallFunction,
|
138
|
+
Z as withNoopInstall
|
139
|
+
};
|
140
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"isValid.js","sources":["../../../src/components/_util/isValid.ts"],"sourcesContent":["const isValid = (value: any): boolean => {\r\n return value !== undefined && value !== null && value !== ''\r\n}\r\nexport default isValid\r\n"],"names":["isValid","value"],"mappings":"AAAM,MAAAA,IAAU,CAACC,MACeA,KAAU,QAAQA,MAAU;"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Entries } from 'type-fest';
|
2
|
+
import { Arrayable } from '.';
|
3
|
+
export declare const keysOf: <T>(arr: T) => Array<keyof T>;
|
4
|
+
export declare const entriesOf: <T>(arr: T) => Entries<T>;
|
5
|
+
export { hasOwn } from '@vue/shared';
|
6
|
+
export declare const getProp: <T = any>(obj: Record<string, any>, path: Arrayable<string>, defaultValue?: any) => {
|
7
|
+
value: T;
|
8
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { get as n, set as o } from "lodash-es";
|
2
|
+
import { h as i } from "../../functions-DzLqXvGt.js";
|
3
|
+
const O = (e) => Object.keys(e), f = (e) => Object.entries(e), u = (e, t, r) => ({
|
4
|
+
get value() {
|
5
|
+
return n(e, t, r);
|
6
|
+
},
|
7
|
+
set value(s) {
|
8
|
+
o(e, t, s);
|
9
|
+
}
|
10
|
+
});
|
11
|
+
export {
|
12
|
+
f as entriesOf,
|
13
|
+
u as getProp,
|
14
|
+
i as hasOwn,
|
15
|
+
O as keysOf
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=objects.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"objects.js","sources":["../../../src/components/_util/objects.ts"],"sourcesContent":["import { get, set } from 'lodash-unified'\r\nimport type { Entries } from 'type-fest'\r\nimport type { Arrayable } from '.'\r\n\r\nexport const keysOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>\r\nexport const entriesOf = <T>(arr: T) => Object.entries(arr) as Entries<T>\r\nexport { hasOwn } from '@vue/shared'\r\n\r\nexport const getProp = <T = any>(\r\n obj: Record<string, any>,\r\n path: Arrayable<string>,\r\n defaultValue?: any\r\n): { value: T } => {\r\n return {\r\n get value() {\r\n return get(obj, path, defaultValue)\r\n },\r\n set value(val: any) {\r\n set(obj, path, val)\r\n },\r\n }\r\n}\r\n"],"names":["keysOf","arr","entriesOf","getProp","obj","path","defaultValue","get","val","set"],"mappings":";;AAIO,MAAMA,IAAS,CAAIC,MAAW,OAAO,KAAKA,CAAG,GACvCC,IAAY,CAAID,MAAW,OAAO,QAAQA,CAAG,GAG7CE,IAAU,CACrBC,GACAC,GACAC,OAEO;AAAA,EACL,IAAI,QAAQ;AACH,WAAAC,EAAIH,GAAKC,GAAMC,CAAY;AAAA,EACpC;AAAA,EACA,IAAI,MAAME,GAAU;AACd,IAAAC,EAAAL,GAAKC,GAAMG,CAAG;AAAA,EACpB;AAAA;"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import initDefaultProps from './initDefaultProps';
|
1
|
+
import { default as initDefaultProps } from './initDefaultProps';
|
2
2
|
export declare const skipFlattenKey: unique symbol;
|
3
|
-
export declare const flattenChildren: (children?:
|
4
|
-
export declare function filterEmpty(children?:
|
5
|
-
export declare function isEmptyElement(c: any):
|
3
|
+
export declare const flattenChildren: (children?: never[], filterEmpty?: boolean) => never[];
|
4
|
+
export declare function filterEmpty(children?: never[]): never[];
|
5
|
+
export declare function isEmptyElement(c: any): any;
|
6
6
|
export { initDefaultProps };
|
@@ -1,53 +1,26 @@
|
|
1
|
-
import { Fragment, isVNode, Comment, Text } from
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
temp.forEach(child => {
|
10
|
-
if (Array.isArray(child)) {
|
11
|
-
res.push(...flattenChildren(child, filterEmpty));
|
12
|
-
// @ts-ignore
|
13
|
-
} else if (child && child.type === Fragment) {
|
14
|
-
// @ts-ignore
|
15
|
-
if (child.key === skipFlattenKey) {
|
16
|
-
res.push(child);
|
17
|
-
} else {
|
18
|
-
// @ts-ignore
|
19
|
-
res.push(...flattenChildren(child.children, filterEmpty));
|
20
|
-
}
|
21
|
-
} else if (child && isVNode(child)) {
|
22
|
-
if (filterEmpty && !isEmptyElement(child)) {
|
23
|
-
res.push(child);
|
24
|
-
} else if (!filterEmpty) {
|
25
|
-
res.push(child);
|
26
|
-
}
|
27
|
-
} else if (isValid(child)) {
|
28
|
-
res.push(child);
|
29
|
-
}
|
30
|
-
});
|
31
|
-
return res;
|
1
|
+
import { Fragment as p, isVNode as u, Comment as a, Text as y } from "vue";
|
2
|
+
import m from "../isValid.js";
|
3
|
+
import { default as C } from "./initDefaultProps.js";
|
4
|
+
const i = Symbol("skipFlatten"), o = (r = [], s = !0) => {
|
5
|
+
const t = Array.isArray(r) ? r : [r], n = [];
|
6
|
+
return t.forEach((e) => {
|
7
|
+
Array.isArray(e) ? n.push(...o(e, s)) : e && e.type === p ? e.key === i ? n.push(e) : n.push(...o(e.children, s)) : e && u(e) ? s && !f(e) ? n.push(e) : s || n.push(e) : m(e) && n.push(e);
|
8
|
+
}), n;
|
32
9
|
};
|
33
|
-
function
|
34
|
-
const
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
res.push(...child);
|
39
|
-
// @ts-ignore
|
40
|
-
} else if (child?.type === Fragment) {
|
41
|
-
// @ts-ignore
|
42
|
-
res.push(...filterEmpty(child.children));
|
43
|
-
} else {
|
44
|
-
res.push(child);
|
45
|
-
}
|
46
|
-
});
|
47
|
-
return res.filter(c => !isEmptyElement(c));
|
10
|
+
function A(r = []) {
|
11
|
+
const s = [];
|
12
|
+
return r.forEach((t) => {
|
13
|
+
Array.isArray(t) ? s.push(...t) : (t == null ? void 0 : t.type) === p ? s.push(...A(t.children)) : s.push(t);
|
14
|
+
}), s.filter((t) => !f(t));
|
48
15
|
}
|
49
|
-
function
|
50
|
-
return
|
16
|
+
function f(r) {
|
17
|
+
return r && (r.type === a || r.type === p && r.children.length === 0 || r.type === y && r.children.trim() === "");
|
51
18
|
}
|
52
|
-
|
53
|
-
|
19
|
+
export {
|
20
|
+
A as filterEmpty,
|
21
|
+
o as flattenChildren,
|
22
|
+
C as initDefaultProps,
|
23
|
+
f as isEmptyElement,
|
24
|
+
i as skipFlattenKey
|
25
|
+
};
|
26
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/_util/props-util/index.ts"],"sourcesContent":["import { isVNode, Fragment, Comment, Text } from 'vue'\r\nimport isValid from '../isValid'\r\nimport initDefaultProps from './initDefaultProps'\r\n\r\nexport const skipFlattenKey = Symbol('skipFlatten')\r\n\r\nexport const flattenChildren = (children = [], filterEmpty = true) => {\r\n const temp = Array.isArray(children) ? children : [children]\r\n const res = []\r\n temp.forEach((child) => {\r\n if (Array.isArray(child)) {\r\n res.push(...flattenChildren(child, filterEmpty))\r\n // @ts-ignore\r\n } else if (child && child.type === Fragment) {\r\n // @ts-ignore\r\n if (child.key === skipFlattenKey) {\r\n res.push(child)\r\n } else {\r\n // @ts-ignore\r\n res.push(...flattenChildren(child.children, filterEmpty))\r\n }\r\n } else if (child && isVNode(child)) {\r\n if (filterEmpty && !isEmptyElement(child)) {\r\n res.push(child)\r\n } else if (!filterEmpty) {\r\n res.push(child)\r\n }\r\n } else if (isValid(child)) {\r\n res.push(child)\r\n }\r\n })\r\n return res\r\n}\r\n\r\nexport function filterEmpty(children = []) {\r\n const res = []\r\n children.forEach((child) => {\r\n if (Array.isArray(child)) {\r\n // @ts-ignore\r\n res.push(...child)\r\n // @ts-ignore\r\n } else if (child?.type === Fragment) {\r\n // @ts-ignore\r\n res.push(...filterEmpty(child.children))\r\n } else {\r\n res.push(child)\r\n }\r\n })\r\n return res.filter((c) => !isEmptyElement(c))\r\n}\r\n\r\nexport function isEmptyElement(c: any) {\r\n return c && (c.type === Comment || (c.type === Fragment && c.children.length === 0) || (c.type === Text && c.children.trim() === ''))\r\n}\r\n\r\nexport { initDefaultProps }\r\n"],"names":["skipFlattenKey","flattenChildren","children","filterEmpty","temp","res","child","Fragment","isVNode","isEmptyElement","isValid","c","Comment","Text"],"mappings":";;;AAIa,MAAAA,IAAiB,OAAO,aAAa,GAErCC,IAAkB,CAACC,IAAW,IAAIC,IAAc,OAAS;AACpE,QAAMC,IAAO,MAAM,QAAQF,CAAQ,IAAIA,IAAW,CAACA,CAAQ,GACrDG,IAAM,CAAA;AACP,SAAAD,EAAA,QAAQ,CAACE,MAAU;AAClB,IAAA,MAAM,QAAQA,CAAK,IACrBD,EAAI,KAAK,GAAGJ,EAAgBK,GAAOH,CAAW,CAAC,IAEtCG,KAASA,EAAM,SAASC,IAE7BD,EAAM,QAAQN,IAChBK,EAAI,KAAKC,CAAK,IAGdD,EAAI,KAAK,GAAGJ,EAAgBK,EAAM,UAAUH,CAAW,CAAC,IAEjDG,KAASE,EAAQF,CAAK,IAC3BH,KAAe,CAACM,EAAeH,CAAK,IACtCD,EAAI,KAAKC,CAAK,IACJH,KACVE,EAAI,KAAKC,CAAK,IAEPI,EAAQJ,CAAK,KACtBD,EAAI,KAAKC,CAAK;AAAA,EAChB,CACD,GACMD;AACT;AAEgB,SAAAF,EAAYD,IAAW,IAAI;AACzC,QAAMG,IAAM,CAAA;AACH,SAAAH,EAAA,QAAQ,CAACI,MAAU;AACtB,IAAA,MAAM,QAAQA,CAAK,IAEjBD,EAAA,KAAK,GAAGC,CAAK,KAERA,KAAA,gBAAAA,EAAO,UAASC,IAEzBF,EAAI,KAAK,GAAGF,EAAYG,EAAM,QAAQ,CAAC,IAEvCD,EAAI,KAAKC,CAAK;AAAA,EAChB,CACD,GACMD,EAAI,OAAO,CAACM,MAAM,CAACF,EAAeE,CAAC,CAAC;AAC7C;AAEO,SAASF,EAAeE,GAAQ;AACrC,SAAOA,MAAMA,EAAE,SAASC,KAAYD,EAAE,SAASJ,KAAYI,EAAE,SAAS,WAAW,KAAOA,EAAE,SAASE,KAAQF,EAAE,SAAS,WAAW;AACnI;"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { VueTypeValidableDef, VueTypeDef } from 'vue-types';
|
3
3
|
declare const initDefaultProps: <T>(types: T, defaultProps: { [K in keyof T]?: T[K] extends VueTypeValidableDef<infer U> ? U : T[K] extends VueTypeDef<infer U> ? U : T[K] extends {
|
4
4
|
type: PropType<infer U>;
|
5
5
|
} ? U : any; }) => T;
|
@@ -1,25 +1,14 @@
|
|
1
|
-
const
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
} else if (prop.def) {
|
11
|
-
prop.def(defaultProps[k]);
|
12
|
-
} else {
|
13
|
-
propTypes[k] = {
|
14
|
-
type: prop,
|
15
|
-
default: defaultProps[k]
|
16
|
-
};
|
17
|
-
}
|
18
|
-
} else {
|
19
|
-
throw new Error(`not have ${k} prop`);
|
20
|
-
}
|
21
|
-
});
|
22
|
-
return propTypes;
|
1
|
+
const p = (f, o) => {
|
2
|
+
const r = { ...f };
|
3
|
+
return Object.keys(o).forEach((t) => {
|
4
|
+
const e = r[t];
|
5
|
+
if (e)
|
6
|
+
e.type || e.default ? e.default = o[t] : e.def ? e.def(o[t]) : r[t] = { type: e, default: o[t] };
|
7
|
+
else
|
8
|
+
throw new Error(`not have ${t} prop`);
|
9
|
+
}), r;
|
23
10
|
};
|
24
|
-
|
25
|
-
|
11
|
+
export {
|
12
|
+
p as default
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=initDefaultProps.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"initDefaultProps.js","sources":["../../../../src/components/_util/props-util/initDefaultProps.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { VueTypeValidableDef, VueTypeDef } from 'vue-types'\r\n\r\nconst initDefaultProps = <T>(\r\n types: T,\r\n defaultProps: {\r\n [K in keyof T]?: T[K] extends VueTypeValidableDef<infer U> ? U : T[K] extends VueTypeDef<infer U> ? U : T[K] extends { type: PropType<infer U> } ? U : any\r\n }\r\n): T => {\r\n const propTypes: T = { ...types }\r\n Object.keys(defaultProps).forEach((k) => {\r\n const prop = propTypes[k] as VueTypeValidableDef\r\n if (prop) {\r\n if (prop.type || prop.default) {\r\n prop.default = defaultProps[k]\r\n } else if (prop.def) {\r\n prop.def(defaultProps[k])\r\n } else {\r\n propTypes[k] = { type: prop, default: defaultProps[k] }\r\n }\r\n } else {\r\n throw new Error(`not have ${k} prop`)\r\n }\r\n })\r\n return propTypes\r\n}\r\n\r\nexport default initDefaultProps\r\n"],"names":["initDefaultProps","types","defaultProps","propTypes","k","prop"],"mappings":"AAGM,MAAAA,IAAmB,CACvBC,GACAC,MAGM;AACA,QAAAC,IAAe,EAAE,GAAGF;AAC1B,gBAAO,KAAKC,CAAY,EAAE,QAAQ,CAACE,MAAM;AACjC,UAAAC,IAAOF,EAAUC,CAAC;AACxB,QAAIC;AACE,MAAAA,EAAK,QAAQA,EAAK,UACfA,EAAA,UAAUH,EAAaE,CAAC,IACpBC,EAAK,MACTA,EAAA,IAAIH,EAAaE,CAAC,CAAC,IAEdD,EAAAC,CAAC,IAAI,EAAE,MAAMC,GAAM,SAASH,EAAaE,CAAC;;AAGtD,YAAM,IAAI,MAAM,YAAYA,CAAC,OAAO;AAAA,EACtC,CACD,GACMD;AACT;"}
|