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,169 @@
|
|
1
|
+
import w from "decimal.js";
|
2
|
+
import { c as s } from "../../../_commonjsHelpers-DaMA6jEr.js";
|
3
|
+
import M from "dayjs";
|
4
|
+
import u from "../../../error/OrionError.js";
|
5
|
+
var $ = {}, v = {};
|
6
|
+
Object.defineProperty(v, "__esModule", { value: !0 });
|
7
|
+
v.comma = void 0;
|
8
|
+
function j(r, e) {
|
9
|
+
e === void 0 && (e = 3);
|
10
|
+
var t = String(r).split(".");
|
11
|
+
return t[0] = t[0].replace(new RegExp("(\\d)(?=(\\d{" + e + "})+$)", "ig"), "$1,"), t.join(".");
|
12
|
+
}
|
13
|
+
v.comma = j;
|
14
|
+
var d = {}, c = {};
|
15
|
+
Object.defineProperty(c, "__esModule", { value: !0 });
|
16
|
+
c.precise = void 0;
|
17
|
+
function N(r, e) {
|
18
|
+
return e === void 0 && (e = 12), parseFloat(r.toPrecision(e));
|
19
|
+
}
|
20
|
+
c.precise = N;
|
21
|
+
Object.defineProperty(d, "__esModule", { value: !0 });
|
22
|
+
d.toFixed = void 0;
|
23
|
+
var y = c;
|
24
|
+
function O(r, e) {
|
25
|
+
e === void 0 && (e = 2);
|
26
|
+
var t = parseFloat("" + r), n = Math.pow(10, e);
|
27
|
+
return t = y.precise(t * n + 0.5), t = parseInt("" + t, 10) / n, y.precise(t).toFixed(e);
|
28
|
+
}
|
29
|
+
d.toFixed = O;
|
30
|
+
var _ = {};
|
31
|
+
Object.defineProperty(_, "__esModule", { value: !0 });
|
32
|
+
_.capital = void 0;
|
33
|
+
function E(r) {
|
34
|
+
var e = String(r);
|
35
|
+
if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(e))
|
36
|
+
return "";
|
37
|
+
var t = "千百拾亿千百拾万千百拾元角分", n = "";
|
38
|
+
e += "00";
|
39
|
+
var i = e.indexOf(".");
|
40
|
+
i >= 0 && (e = e.substring(0, i) + e.substr(i + 1, 2)), t = t.substr(t.length - e.length);
|
41
|
+
for (var o = 0; o < e.length; o++)
|
42
|
+
n += "零壹贰叁肆伍陆柒捌玖".charAt(Number(e.charAt(o))) + t.charAt(o);
|
43
|
+
return n.replace(/零(千|百|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
|
44
|
+
}
|
45
|
+
_.capital = E;
|
46
|
+
var m = {}, l = {}, f = {};
|
47
|
+
Object.defineProperty(f, "__esModule", { value: !0 });
|
48
|
+
f.MIN_SAFETY_NUMBER = f.MAX_SAFETY_NUMBER = void 0;
|
49
|
+
f.MAX_SAFETY_NUMBER = Math.pow(2, 53) - 1;
|
50
|
+
f.MIN_SAFETY_NUMBER = -1 * Math.pow(2, 53) + 1;
|
51
|
+
Object.defineProperty(l, "__esModule", { value: !0 });
|
52
|
+
l.isNumber = void 0;
|
53
|
+
var h = f;
|
54
|
+
function A(r, e) {
|
55
|
+
e === void 0 && (e = !1);
|
56
|
+
var t = typeof r == "number" && isFinite(r);
|
57
|
+
return t && e ? r <= h.MAX_SAFETY_NUMBER && r >= h.MIN_SAFETY_NUMBER : t;
|
58
|
+
}
|
59
|
+
l.isNumber = A;
|
60
|
+
Object.defineProperty(m, "__esModule", { value: !0 });
|
61
|
+
m.percentage = void 0;
|
62
|
+
var P = l, I = d;
|
63
|
+
function S(r, e) {
|
64
|
+
e === void 0 && (e = 2);
|
65
|
+
var t = Number(r);
|
66
|
+
return P.isNumber(t) ? I.toFixed(t * 100, e) + "%" : r;
|
67
|
+
}
|
68
|
+
m.percentage = S;
|
69
|
+
var g = {};
|
70
|
+
Object.defineProperty(g, "__esModule", { value: !0 });
|
71
|
+
g.idxList = void 0;
|
72
|
+
function B(r, e) {
|
73
|
+
return e === void 0 && (e = 0), Array.from(Array(r), function(t, n) {
|
74
|
+
return n + e;
|
75
|
+
});
|
76
|
+
}
|
77
|
+
g.idxList = B;
|
78
|
+
var b = {};
|
79
|
+
Object.defineProperty(b, "__esModule", { value: !0 });
|
80
|
+
b.randomInt = void 0;
|
81
|
+
function R(r, e) {
|
82
|
+
return e === void 0 && (e = r), r = Math.round(r + 0.4999999), e = Math.round(e - 0.5), r < 0 || r > e ? -1 : Math.round((e - r) * Math.random()) + r;
|
83
|
+
}
|
84
|
+
b.randomInt = R;
|
85
|
+
var p = {};
|
86
|
+
Object.defineProperty(p, "__esModule", { value: !0 });
|
87
|
+
p.sum = void 0;
|
88
|
+
function T() {
|
89
|
+
for (var r = [], e = 0; e < arguments.length; e++)
|
90
|
+
r[e] = arguments[e];
|
91
|
+
return r.reduce(function(t, n) {
|
92
|
+
return t += n;
|
93
|
+
}, 0);
|
94
|
+
}
|
95
|
+
p.sum = T;
|
96
|
+
(function(r) {
|
97
|
+
var e = s && s.__createBinding || (Object.create ? function(n, i, o, a) {
|
98
|
+
a === void 0 && (a = o), Object.defineProperty(n, a, { enumerable: !0, get: function() {
|
99
|
+
return i[o];
|
100
|
+
} });
|
101
|
+
} : function(n, i, o, a) {
|
102
|
+
a === void 0 && (a = o), n[a] = i[o];
|
103
|
+
}), t = s && s.__exportStar || function(n, i) {
|
104
|
+
for (var o in n) o !== "default" && !i.hasOwnProperty(o) && e(i, n, o);
|
105
|
+
};
|
106
|
+
Object.defineProperty(r, "__esModule", { value: !0 }), t(v, r), t(d, r), t(_, r), t(m, r), t(g, r), t(b, r), t(c, r), t(l, r), t(p, r);
|
107
|
+
})($);
|
108
|
+
const D = (r, e, t) => {
|
109
|
+
if (!r)
|
110
|
+
return r;
|
111
|
+
if (r instanceof Date && typeof e == "string") {
|
112
|
+
const n = r, i = e;
|
113
|
+
if (!n)
|
114
|
+
throw new u("value is null.");
|
115
|
+
if (!i)
|
116
|
+
throw new u("format is null.");
|
117
|
+
return M(n).format(i);
|
118
|
+
} else if (typeof r == "string" && typeof e == "string" && typeof t == "string") {
|
119
|
+
const n = r, i = e, o = t;
|
120
|
+
if (!n || !i || !o)
|
121
|
+
throw new u(`Invalid arguments: ${n}, ${i}, ${o}`);
|
122
|
+
if (M(n, i, !0).isValid())
|
123
|
+
return M(n, i).format(o);
|
124
|
+
throw new u(`日期[${n}]与格式[${i}]不匹配。`);
|
125
|
+
} else
|
126
|
+
throw new u(`入参数量[${arguments.length}]不正确。`);
|
127
|
+
};
|
128
|
+
function U(r, e) {
|
129
|
+
return new w(r).toFixed(e, 4);
|
130
|
+
}
|
131
|
+
function X(r, e, t, n) {
|
132
|
+
if (r == null)
|
133
|
+
return "";
|
134
|
+
if (typeof r == "number" || typeof r == "string") {
|
135
|
+
let i = String(r);
|
136
|
+
return t >= 0 && (i = U(r, t)), n ? (e && (i = $.comma(i)), i += "%") : e && (i = $.comma(i)), i;
|
137
|
+
} else
|
138
|
+
throw new u(`num [${r}]:[${typeof r}] is neither a number nor null.`);
|
139
|
+
}
|
140
|
+
const G = (r, e) => {
|
141
|
+
if (!e)
|
142
|
+
return null;
|
143
|
+
if (!r)
|
144
|
+
return e + "(?)";
|
145
|
+
for (let t = 0; t < r.length; t++) {
|
146
|
+
const { value: n, content: i } = r[t];
|
147
|
+
if (n == e)
|
148
|
+
return i;
|
149
|
+
}
|
150
|
+
return e + "(?)";
|
151
|
+
}, q = (r, e) => {
|
152
|
+
if (!e)
|
153
|
+
return null;
|
154
|
+
let t = "";
|
155
|
+
const n = e.split(",");
|
156
|
+
return n.forEach((i, o) => {
|
157
|
+
const a = r.findIndex((F) => {
|
158
|
+
if (F.value == i) return !0;
|
159
|
+
});
|
160
|
+
a == -1 ? t += `${i}(?)` : t += r[a].content, o != n.length - 1 && (t += ",");
|
161
|
+
}), t;
|
162
|
+
};
|
163
|
+
export {
|
164
|
+
D as formatDate,
|
165
|
+
q as getMultiCodeContent,
|
166
|
+
G as getSingleCodeContent,
|
167
|
+
X as number2string
|
168
|
+
};
|
169
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/number-magic/lib/comma.js","../../../../node_modules/number-magic/lib/precise.js","../../../../node_modules/number-magic/lib/toFixed.js","../../../../node_modules/number-magic/lib/capital.js","../../../../node_modules/number-magic/lib/utils/constants.js","../../../../node_modules/number-magic/lib/isNumber.js","../../../../node_modules/number-magic/lib/percentage.js","../../../../node_modules/number-magic/lib/idxList.js","../../../../node_modules/number-magic/lib/randomInt.js","../../../../node_modules/number-magic/lib/sum.js","../../../../node_modules/number-magic/lib/index.js","../../../../src/components/Pagetable/utils/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.comma = void 0;\nfunction comma(source, length) {\n if (length === void 0) { length = 3; }\n var arr = String(source).split('.');\n arr[0] = arr[0].replace(new RegExp('(\\\\d)(?=(\\\\d{' + length + '})+$)', 'ig'), '$1,');\n return arr.join('.');\n}\nexports.comma = comma;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.precise = void 0;\nfunction precise(source, precision) {\n if (precision === void 0) { precision = 12; }\n return parseFloat(source.toPrecision(precision));\n}\nexports.precise = precise;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toFixed = void 0;\nvar precise_1 = require(\"./precise\");\nfunction toFixed(source, digits) {\n if (digits === void 0) { digits = 2; }\n var num = parseFloat(\"\" + source);\n var times = Math.pow(10, digits);\n num = precise_1.precise(num * times + 0.5);\n num = parseInt(\"\" + num, 10) / times;\n return precise_1.precise(num).toFixed(digits);\n}\nexports.toFixed = toFixed;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.capital = void 0;\nfunction capital(source) {\n var numbStr = String(source);\n if (!/^(0|[1-9]\\d*)(\\.\\d+)?$/.test(numbStr))\n return '';\n var unit = '千百拾亿千百拾万千百拾元角分';\n var str = '';\n numbStr += '00';\n var p = numbStr.indexOf('.');\n if (p >= 0)\n numbStr = numbStr.substring(0, p) + numbStr.substr(p + 1, 2);\n unit = unit.substr(unit.length - numbStr.length);\n for (var i = 0; i < numbStr.length; i++) {\n str += '零壹贰叁肆伍陆柒捌玖'.charAt(Number(numbStr.charAt(i))) + unit.charAt(i);\n }\n return str\n .replace(/零(千|百|拾|角)/g, '零')\n .replace(/(零)+/g, '零')\n .replace(/零(万|亿|元)/g, '$1')\n .replace(/(亿)万|壹(拾)/g, '$1$2')\n .replace(/^元零?|零分/g, '')\n .replace(/元$/g, '元整');\n}\nexports.capital = capital;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MIN_SAFETY_NUMBER = exports.MAX_SAFETY_NUMBER = void 0;\nexports.MAX_SAFETY_NUMBER = Math.pow(2, 53) - 1;\nexports.MIN_SAFETY_NUMBER = -1 * Math.pow(2, 53) + 1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isNumber = void 0;\nvar constants_1 = require(\"./utils/constants\");\nfunction isNumber(source, checkSafetyNumber) {\n if (checkSafetyNumber === void 0) { checkSafetyNumber = false; }\n var isNumb = typeof source === 'number' && isFinite(source);\n if (isNumb && checkSafetyNumber)\n return source <= constants_1.MAX_SAFETY_NUMBER && source >= constants_1.MIN_SAFETY_NUMBER;\n return isNumb;\n}\nexports.isNumber = isNumber;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.percentage = void 0;\nvar isNumber_1 = require(\"./isNumber\");\nvar toFixed_1 = require(\"./toFixed\");\nfunction percentage(source, digits) {\n if (digits === void 0) { digits = 2; }\n var numb = Number(source);\n if (!isNumber_1.isNumber(numb))\n return source;\n return toFixed_1.toFixed(numb * 100, digits) + '%';\n}\nexports.percentage = percentage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.idxList = void 0;\nfunction idxList(len, delta) {\n if (delta === void 0) { delta = 0; }\n return Array.from(Array(len), function (_v, k) { return k + delta; });\n}\nexports.idxList = idxList;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomInt = void 0;\nfunction randomInt(min, max) {\n if (max === void 0) { max = min; }\n min = Math.round(min + 0.4999999);\n max = Math.round(max - 0.5);\n if (min < 0 || min > max)\n return -1;\n return Math.round((max - min) * Math.random()) + min;\n}\nexports.randomInt = randomInt;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sum = void 0;\nfunction sum() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.reduce(function (finalValue, current) {\n return (finalValue += current);\n }, 0);\n}\nexports.sum = sum;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./comma\"), exports);\n__exportStar(require(\"./toFixed\"), exports);\n__exportStar(require(\"./capital\"), exports);\n__exportStar(require(\"./percentage\"), exports);\n__exportStar(require(\"./idxList\"), exports);\n__exportStar(require(\"./randomInt\"), exports);\n__exportStar(require(\"./precise\"), exports);\n__exportStar(require(\"./isNumber\"), exports);\n__exportStar(require(\"./sum\"), exports);\n","import Decimal from 'decimal.js'\r\nimport { comma } from 'number-magic'\r\nimport dayjs from 'dayjs'\r\n\r\nimport OrionError from '../../../error/OrionError'\r\n\r\ninterface formatI {\r\n format(value: Date, targetFormat: string): string\r\n format(value: string, sourceFormat: string, targetFormat: string): string\r\n}\r\n\r\nexport const formatDate: formatI['format'] = (p1: Date | string, p2: string, p3?: string) => {\r\n if (!p1) {\r\n return p1\r\n }\r\n\r\n if (p1 instanceof Date && typeof p2 === 'string') {\r\n const value = p1\r\n const format = p2\r\n\r\n if (!value) {\r\n throw new OrionError('value is null.')\r\n }\r\n\r\n if (!format) {\r\n throw new OrionError('format is null.')\r\n }\r\n\r\n return dayjs(value).format(format)\r\n } else if (typeof p1 === 'string' && typeof p2 === 'string' && typeof p3 === 'string') {\r\n const value = p1\r\n const sourceFormat = p2\r\n const targetFormat = p3\r\n\r\n if (!value || !sourceFormat || !targetFormat) {\r\n throw new OrionError(`Invalid arguments: ${value}, ${sourceFormat}, ${targetFormat}`)\r\n }\r\n\r\n if (dayjs(value, sourceFormat, true).isValid()) {\r\n return dayjs(value, sourceFormat).format(targetFormat)\r\n } else {\r\n throw new OrionError(`日期[${value}]与格式[${sourceFormat}]不匹配。`)\r\n }\r\n } else {\r\n throw new OrionError(`入参数量[${arguments.length}]不正确。`)\r\n }\r\n}\r\n\r\nfunction round(value: number, how: number) {\r\n const dec = new Decimal(value)\r\n return dec.toFixed(how, 4)\r\n}\r\n\r\nexport function number2string(num: number | null | undefined, thousandsSeparatorValue: boolean, precisionValue: number, percentageValue: boolean): string {\r\n if (num === null || num === undefined) {\r\n return ''\r\n } else if (typeof num === 'number' || typeof num === 'string') {\r\n let result = String(num)\r\n\r\n // 基础:先实现精度化\r\n if (precisionValue >= 0) {\r\n result = round(num, precisionValue)\r\n }\r\n\r\n // 百分比优先级高于千分位,先实现百分比,再实现千分位\r\n if (percentageValue) {\r\n if (thousandsSeparatorValue) {\r\n // 千分位\r\n result = comma(result)\r\n }\r\n\r\n result += '%'\r\n } else if (thousandsSeparatorValue) {\r\n // 千分位\r\n // 小数精度优先级最高\r\n result = comma(result)\r\n }\r\n\r\n return result\r\n } else {\r\n throw new OrionError(`num [${num}]:[${typeof num}] is neither a number nor null.`)\r\n }\r\n}\r\n\r\nexport const getSingleCodeContent = (\r\n options: Array<{\r\n value: string\r\n content: string\r\n }>,\r\n curValue: string\r\n) => {\r\n if (!curValue) {\r\n return null\r\n }\r\n\r\n if (!options) {\r\n return curValue + '(?)'\r\n }\r\n\r\n for (let i = 0; i < options.length; i++) {\r\n const { value, content } = options[i]\r\n if (value == curValue) {\r\n return content\r\n }\r\n }\r\n\r\n return curValue + '(?)'\r\n}\r\n\r\nexport const getMultiCodeContent = (\r\n options: Array<{\r\n value: string\r\n content: string\r\n }>,\r\n curValue: string\r\n) => {\r\n if (!curValue) {\r\n return null\r\n }\r\n\r\n let content = ''\r\n\r\n const data = curValue.split(',')\r\n data.forEach((selectValue, valueIndex) => {\r\n const index = options.findIndex((item) => {\r\n if (item.value == selectValue) return true\r\n })\r\n\r\n if (index == -1) {\r\n content += `${selectValue}(?)`\r\n } else {\r\n content += options[index].content\r\n }\r\n\r\n if (valueIndex != data.length - 1) {\r\n content += ','\r\n }\r\n })\r\n\r\n return content\r\n}\r\n"],"names":["comma_1","comma","source","length","arr","precise_1","precise","precision","toFixed_1","require$$0","toFixed","digits","num","times","capital_1","capital","numbStr","unit","str","p","i","constants","isNumber_1","constants_1","isNumber","checkSafetyNumber","isNumb","percentage_1","require$$1","percentage","numb","idxList_1","idxList","len","delta","_v","k","randomInt_1","randomInt","min","max","sum_1","sum","args","_i","finalValue","current","__createBinding","this","o","m","k2","__exportStar","exports","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","formatDate","p1","p2","p3","value","format","OrionError","dayjs","sourceFormat","targetFormat","round","how","Decimal","number2string","thousandsSeparatorValue","precisionValue","percentageValue","result","getSingleCodeContent","options","curValue","content","getMultiCodeContent","data","selectValue","valueIndex","index","item"],"mappings":";;;;;AACA,OAAO,eAAeA,GAAS,cAAc,EAAE,OAAO,GAAI,CAAE;AAC/CA,EAAA,QAAG;AAChB,SAASC,EAAMC,GAAQC,GAAQ;AAC3B,EAAIA,MAAW,WAAUA,IAAS;AAClC,MAAIC,IAAM,OAAOF,CAAM,EAAE,MAAM,GAAG;AAClC,SAAAE,EAAI,CAAC,IAAIA,EAAI,CAAC,EAAE,QAAQ,IAAI,OAAO,kBAAkBD,IAAS,SAAS,IAAI,GAAG,KAAK,GAC5EC,EAAI,KAAK,GAAG;AACvB;AACAJ,EAAA,QAAgBC;;ACRh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1,5 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import { PropType, ExtractPropTypes, Plugin } from 'vue';
|
2
|
+
import { CustomSlotsType } from '../_util/type';
|
3
3
|
export declare const spaceProps: () => {
|
4
4
|
gutter: {
|
5
5
|
default: string | boolean;
|
@@ -12,7 +12,7 @@ export declare const spaceProps: () => {
|
|
12
12
|
};
|
13
13
|
export type SpaceProps = Partial<ExtractPropTypes<ReturnType<typeof spaceProps>>>;
|
14
14
|
declare const _default: {
|
15
|
-
new (...args: any[]): import(
|
15
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes<{
|
16
16
|
gutter: {
|
17
17
|
default: string | boolean;
|
18
18
|
type: PropType<string | boolean>;
|
@@ -21,7 +21,7 @@ declare const _default: {
|
|
21
21
|
default: string | boolean;
|
22
22
|
type: PropType<string | boolean>;
|
23
23
|
};
|
24
|
-
}>> & Readonly<{}>, () =>
|
24
|
+
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<ExtractPropTypes<{
|
25
25
|
gutter: {
|
26
26
|
default: string | boolean;
|
27
27
|
type: PropType<string | boolean>;
|
@@ -31,11 +31,11 @@ declare const _default: {
|
|
31
31
|
type: PropType<string | boolean>;
|
32
32
|
};
|
33
33
|
}>> & Readonly<{}>, {
|
34
|
-
gutter: string | boolean;
|
35
34
|
vertical: string | boolean;
|
35
|
+
gutter: string | boolean;
|
36
36
|
}, true, {}, CustomSlotsType<{
|
37
37
|
default?: any;
|
38
|
-
}>, import(
|
38
|
+
}>, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
39
39
|
P: {};
|
40
40
|
B: {};
|
41
41
|
D: {};
|
@@ -51,14 +51,14 @@ declare const _default: {
|
|
51
51
|
default: string | boolean;
|
52
52
|
type: PropType<string | boolean>;
|
53
53
|
};
|
54
|
-
}>> & Readonly<{}>, () =>
|
55
|
-
gutter: string | boolean;
|
54
|
+
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, {
|
56
55
|
vertical: string | boolean;
|
56
|
+
gutter: string | boolean;
|
57
57
|
}>;
|
58
58
|
__isFragment?: never;
|
59
59
|
__isTeleport?: never;
|
60
60
|
__isSuspense?: never;
|
61
|
-
} & import(
|
61
|
+
} & import('vue').ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
62
62
|
gutter: {
|
63
63
|
default: string | boolean;
|
64
64
|
type: PropType<string | boolean>;
|
@@ -67,10 +67,10 @@ declare const _default: {
|
|
67
67
|
default: string | boolean;
|
68
68
|
type: PropType<string | boolean>;
|
69
69
|
};
|
70
|
-
}>> & Readonly<{}>, () =>
|
71
|
-
gutter: string | boolean;
|
70
|
+
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
72
71
|
vertical: string | boolean;
|
72
|
+
gutter: string | boolean;
|
73
73
|
}, {}, string, CustomSlotsType<{
|
74
74
|
default?: any;
|
75
|
-
}>, import(
|
75
|
+
}>, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Plugin;
|
76
76
|
export default _default;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export declare const unique: <T>(arr: T[]) => T[];
|
2
|
+
type Many<T> = T | ReadonlyArray<T>;
|
3
|
+
/** like `_.castArray`, except falsy value returns empty array. */
|
4
|
+
export declare const castArray: <T>(arr: Many<T>) => T[];
|
5
|
+
export { castArray as ensureArray } from 'lodash-unified';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"arrays.js","sources":["../../../src/components/_util/arrays.ts"],"sourcesContent":["export const unique = <T>(arr: T[]) => [...new Set(arr)]\r\n\r\ntype Many<T> = T | ReadonlyArray<T>\r\n// TODO: rename to `ensureArray`\r\n/** like `_.castArray`, except falsy value returns empty array. */\r\nexport const castArray = <T>(arr: Many<T>): T[] => {\r\n if (!arr && (arr as any) !== 0) return []\r\n return Array.isArray(arr) ? arr : [arr]\r\n}\r\n\r\n// TODO: remove import alias\r\n// avoid naming conflicts\r\nexport { castArray as ensureArray } from 'lodash-unified'\r\n"],"names":["unique","arr","castArray"],"mappings":";AAAa,MAAAA,IAAS,CAAIC,MAAa,CAAC,GAAG,IAAI,IAAIA,CAAG,CAAC,GAK1CC,IAAY,CAAID,MACvB,CAACA,KAAQA,MAAgB,IAAU,CAAA,IAChC,MAAM,QAAQA,CAAG,IAAIA,IAAM,CAACA,CAAG;"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { i } from "../../index-C8JNJPWW.js";
|
2
|
+
import { a as s } from "../../index-C8JNJPWW.js";
|
3
|
+
const r = () => i && /firefox/i.test(window.navigator.userAgent);
|
4
|
+
export {
|
5
|
+
i as isClient,
|
6
|
+
r as isFirefox,
|
7
|
+
s as isIOS
|
8
|
+
};
|
9
|
+
//# sourceMappingURL=browser.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"browser.js","sources":["../../../src/components/_util/browser.ts"],"sourcesContent":["import { isClient, isIOS } from '@vueuse/core'\r\n\r\nexport const isFirefox = (): boolean =>\r\n isClient && /firefox/i.test(window.navigator.userAgent)\r\n\r\nexport { isClient, isIOS }\r\n"],"names":["isFirefox","isClient"],"mappings":";;AAEO,MAAMA,IAAY,MACvBC,KAAY,WAAW,KAAK,OAAO,UAAU,SAAS;"}
|
@@ -1,31 +1,24 @@
|
|
1
|
-
import { isString, isArray, isObject } from
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
const inner = classNames(value[i]);
|
14
|
-
if (inner) {
|
15
|
-
// @ts-ignore
|
16
|
-
classes.push(inner);
|
1
|
+
import { isString as f, isArray as r, isObject as l } from "./util.js";
|
2
|
+
function c(...t) {
|
3
|
+
const s = [];
|
4
|
+
for (let n = 0; n < t.length; n++) {
|
5
|
+
const e = t[n];
|
6
|
+
if (e) {
|
7
|
+
if (f(e))
|
8
|
+
s.push(e);
|
9
|
+
else if (r(e))
|
10
|
+
for (let i = 0; i < e.length; i++) {
|
11
|
+
const o = c(e[i]);
|
12
|
+
o && s.push(o);
|
17
13
|
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if (value[name]) {
|
22
|
-
// @ts-ignore
|
23
|
-
classes.push(name);
|
24
|
-
}
|
25
|
-
}
|
14
|
+
else if (l(e))
|
15
|
+
for (const i in e)
|
16
|
+
e[i] && s.push(i);
|
26
17
|
}
|
27
18
|
}
|
28
|
-
return
|
19
|
+
return s.join(" ");
|
29
20
|
}
|
30
|
-
|
31
|
-
|
21
|
+
export {
|
22
|
+
c as default
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=classNames.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"classNames.js","sources":["../../../src/components/_util/classNames.ts"],"sourcesContent":["import { isArray, isString, isObject } from './util'\r\nfunction classNames(...args: any[]) {\r\n const classes = []\r\n for (let i = 0; i < args.length; i++) {\r\n const value = args[i]\r\n if (!value) continue\r\n if (isString(value)) {\r\n // @ts-ignore\r\n classes.push(value)\r\n } else if (isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n const inner = classNames(value[i])\r\n if (inner) {\r\n // @ts-ignore\r\n classes.push(inner)\r\n }\r\n }\r\n } else if (isObject(value)) {\r\n for (const name in value) {\r\n if (value[name]) {\r\n // @ts-ignore\r\n classes.push(name)\r\n }\r\n }\r\n }\r\n }\r\n return classes.join(' ')\r\n}\r\n\r\nexport default classNames\r\n"],"names":["classNames","args","classes","i","value","isString","isArray","inner","isObject","name"],"mappings":";AACA,SAASA,KAAcC,GAAa;AAClC,QAAMC,IAAU,CAAA;AAChB,WAASC,IAAI,GAAGA,IAAIF,EAAK,QAAQE,KAAK;AAC9B,UAAAC,IAAQH,EAAKE,CAAC;AACpB,QAAKC;AACD,UAAAC,EAASD,CAAK;AAEhB,QAAAF,EAAQ,KAAKE,CAAK;AAAA,eACTE,EAAQF,CAAK;AACtB,iBAASD,IAAI,GAAGA,IAAIC,EAAM,QAAQD,KAAK;AACrC,gBAAMI,IAAQP,EAAWI,EAAMD,CAAC,CAAC;AACjC,UAAII,KAEFL,EAAQ,KAAKK,CAAK;AAAA,QAEtB;AAAA,eACSC,EAASJ,CAAK;AACvB,mBAAWK,KAAQL;AACb,UAAAA,EAAMK,CAAI,KAEZP,EAAQ,KAAKO,CAAI;AAAA;AAAA,EAIzB;AACO,SAAAP,EAAQ,KAAK,GAAG;AACzB;"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* Determine if the testing element is visible on screen no matter if its on the viewport or not
|
3
|
+
*/
|
4
|
+
export declare const isVisible: (element: HTMLElement) => boolean;
|
5
|
+
export declare const obtainAllFocusableElements: (element: HTMLElement) => HTMLElement[];
|
6
|
+
/**
|
7
|
+
* @desc Determine if target element is focusable
|
8
|
+
* @param element {HTMLElement}
|
9
|
+
* @returns {Boolean} true if it is focusable
|
10
|
+
*/
|
11
|
+
export declare const isFocusable: (element: HTMLElement) => boolean;
|
12
|
+
/**
|
13
|
+
* @desc Set Attempt to set focus on the current node.
|
14
|
+
* @param element
|
15
|
+
* The node to attempt to focus on.
|
16
|
+
* @returns
|
17
|
+
* true if element is focused.
|
18
|
+
*/
|
19
|
+
export declare const attemptFocus: (element: HTMLElement) => boolean;
|
20
|
+
/**
|
21
|
+
* Trigger an event
|
22
|
+
* mouseenter, mouseleave, mouseover, keyup, change, click, etc.
|
23
|
+
* @param {HTMLElement} elm
|
24
|
+
* @param {String} name
|
25
|
+
* @param {*} opts
|
26
|
+
*/
|
27
|
+
export declare const triggerEvent: (elm: HTMLElement, name: string, ...opts: Array<boolean>) => HTMLElement;
|
28
|
+
export declare const isLeaf: (el: HTMLElement) => boolean;
|
29
|
+
export declare const getSibling: (el: HTMLElement, distance: number, elClass: string) => Element | null;
|
30
|
+
export declare const focusNode: (el: HTMLElement) => void;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
const u = 'a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])', c = (t) => process.env.NODE_ENV === "test" ? !0 : getComputedStyle(t).position === "fixed" ? !1 : t.offsetParent !== null, d = (t) => Array.from(
|
2
|
+
t.querySelectorAll(u)
|
3
|
+
).filter((e) => o(e) && c(e)), o = (t) => {
|
4
|
+
if (t.tabIndex > 0 || t.tabIndex === 0 && t.getAttribute("tabIndex") !== null)
|
5
|
+
return !0;
|
6
|
+
if (t.disabled)
|
7
|
+
return !1;
|
8
|
+
switch (t.nodeName) {
|
9
|
+
case "A":
|
10
|
+
return !!t.href && t.rel !== "ignore";
|
11
|
+
case "INPUT":
|
12
|
+
return !(t.type === "hidden" || t.type === "file");
|
13
|
+
case "BUTTON":
|
14
|
+
case "SELECT":
|
15
|
+
case "TEXTAREA":
|
16
|
+
return !0;
|
17
|
+
default:
|
18
|
+
return !1;
|
19
|
+
}
|
20
|
+
}, l = (t) => {
|
21
|
+
var e;
|
22
|
+
return o(t) ? ((e = t.focus) == null || e.call(t), document.activeElement === t) : !1;
|
23
|
+
}, f = function(t, e, ...s) {
|
24
|
+
let n;
|
25
|
+
e.includes("mouse") || e.includes("click") ? n = "MouseEvents" : e.includes("key") ? n = "KeyboardEvent" : n = "HTMLEvents";
|
26
|
+
const r = document.createEvent(n);
|
27
|
+
return r.initEvent(e, ...s), t.dispatchEvent(r), t;
|
28
|
+
}, a = (t) => !t.getAttribute("aria-owns"), E = (t, e, s) => {
|
29
|
+
const { parentNode: n } = t;
|
30
|
+
if (!n) return null;
|
31
|
+
const r = n.querySelectorAll(s), i = Array.prototype.indexOf.call(r, t);
|
32
|
+
return r[i + e] || null;
|
33
|
+
}, b = (t) => {
|
34
|
+
t && (t.focus(), !a(t) && t.click());
|
35
|
+
};
|
36
|
+
export {
|
37
|
+
l as attemptFocus,
|
38
|
+
b as focusNode,
|
39
|
+
E as getSibling,
|
40
|
+
o as isFocusable,
|
41
|
+
a as isLeaf,
|
42
|
+
c as isVisible,
|
43
|
+
d as obtainAllFocusableElements,
|
44
|
+
f as triggerEvent
|
45
|
+
};
|
46
|
+
//# sourceMappingURL=aria.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"aria.js","sources":["../../../../src/components/_util/dom/aria.ts"],"sourcesContent":["const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex=\"-1\"]),input:not([disabled]),input:not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled])`\r\n\r\n/**\r\n * Determine if the testing element is visible on screen no matter if its on the viewport or not\r\n */\r\nexport const isVisible = (element: HTMLElement) => {\r\n if (process.env.NODE_ENV === 'test') return true\r\n const computed = getComputedStyle(element)\r\n // element.offsetParent won't work on fix positioned\r\n // WARNING: potential issue here, going to need some expert advices on this issue\r\n return computed.position === 'fixed' ? false : element.offsetParent !== null\r\n}\r\n\r\nexport const obtainAllFocusableElements = (\r\n element: HTMLElement\r\n): HTMLElement[] => {\r\n return Array.from(\r\n element.querySelectorAll<HTMLElement>(FOCUSABLE_ELEMENT_SELECTORS)\r\n ).filter((item: HTMLElement) => isFocusable(item) && isVisible(item))\r\n}\r\n\r\n/**\r\n * @desc Determine if target element is focusable\r\n * @param element {HTMLElement}\r\n * @returns {Boolean} true if it is focusable\r\n */\r\nexport const isFocusable = (element: HTMLElement): boolean => {\r\n if (\r\n element.tabIndex > 0 ||\r\n (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)\r\n ) {\r\n return true\r\n }\r\n // HTMLButtonElement has disabled\r\n if ((element as HTMLButtonElement).disabled) {\r\n return false\r\n }\r\n\r\n switch (element.nodeName) {\r\n case 'A': {\r\n // casting current element to Specific HTMLElement in order to be more type precise\r\n return (\r\n !!(element as HTMLAnchorElement).href &&\r\n (element as HTMLAnchorElement).rel !== 'ignore'\r\n )\r\n }\r\n case 'INPUT': {\r\n return !(\r\n (element as HTMLInputElement).type === 'hidden' ||\r\n (element as HTMLInputElement).type === 'file'\r\n )\r\n }\r\n case 'BUTTON':\r\n case 'SELECT':\r\n case 'TEXTAREA': {\r\n return true\r\n }\r\n default: {\r\n return false\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @desc Set Attempt to set focus on the current node.\r\n * @param element\r\n * The node to attempt to focus on.\r\n * @returns\r\n * true if element is focused.\r\n */\r\nexport const attemptFocus = (element: HTMLElement): boolean => {\r\n if (!isFocusable(element)) {\r\n return false\r\n }\r\n // Remove the old try catch block since there will be no error to be thrown\r\n element.focus?.()\r\n return document.activeElement === element\r\n}\r\n\r\n/**\r\n * Trigger an event\r\n * mouseenter, mouseleave, mouseover, keyup, change, click, etc.\r\n * @param {HTMLElement} elm\r\n * @param {String} name\r\n * @param {*} opts\r\n */\r\nexport const triggerEvent = function (\r\n elm: HTMLElement,\r\n name: string,\r\n ...opts: Array<boolean>\r\n): HTMLElement {\r\n let eventName: string\r\n\r\n if (name.includes('mouse') || name.includes('click')) {\r\n eventName = 'MouseEvents'\r\n } else if (name.includes('key')) {\r\n eventName = 'KeyboardEvent'\r\n } else {\r\n eventName = 'HTMLEvents'\r\n }\r\n const evt = document.createEvent(eventName)\r\n\r\n evt.initEvent(name, ...opts)\r\n elm.dispatchEvent(evt)\r\n return elm\r\n}\r\n\r\nexport const isLeaf = (el: HTMLElement) => !el.getAttribute('aria-owns')\r\n\r\nexport const getSibling = (\r\n el: HTMLElement,\r\n distance: number,\r\n elClass: string\r\n) => {\r\n const { parentNode } = el\r\n if (!parentNode) return null\r\n const siblings = parentNode.querySelectorAll(elClass)\r\n const index = Array.prototype.indexOf.call(siblings, el)\r\n return siblings[index + distance] || null\r\n}\r\n\r\nexport const focusNode = (el: HTMLElement) => {\r\n if (!el) return\r\n el.focus()\r\n !isLeaf(el) && el.click()\r\n}\r\n"],"names":["FOCUSABLE_ELEMENT_SELECTORS","isVisible","element","obtainAllFocusableElements","item","isFocusable","attemptFocus","_a","triggerEvent","elm","name","opts","eventName","evt","isLeaf","el","getSibling","distance","elClass","parentNode","siblings","index","focusNode"],"mappings":"AAAA,MAAMA,IAA8B,8KAKvBC,IAAY,CAACC,MACpB,QAAQ,IAAI,aAAa,SAAe,KAC3B,iBAAiBA,CAAO,EAGzB,aAAa,UAAU,KAAQA,EAAQ,iBAAiB,MAG7DC,IAA6B,CACxCD,MAEO,MAAM;AAAA,EACXA,EAAQ,iBAA8BF,CAA2B;AAAA,EACjE,OAAO,CAACI,MAAsBC,EAAYD,CAAI,KAAKH,EAAUG,CAAI,CAAC,GAQzDC,IAAc,CAACH,MAAkC;AAE1D,MAAAA,EAAQ,WAAW,KAClBA,EAAQ,aAAa,KAAKA,EAAQ,aAAa,UAAU,MAAM;AAEzD,WAAA;AAGT,MAAKA,EAA8B;AAC1B,WAAA;AAGT,UAAQA,EAAQ,UAAU;AAAA,IACxB,KAAK;AAEH,aACE,CAAC,CAAEA,EAA8B,QAChCA,EAA8B,QAAQ;AAAA,IAG3C,KAAK;AACH,aAAO,EACJA,EAA6B,SAAS,YACtCA,EAA6B,SAAS;AAAA,IAG3C,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IAET;AACS,aAAA;AAAA,EAEX;AACF,GASaI,IAAe,CAACJ,MAAkC;AAtE/D,MAAAK;AAuEM,SAACF,EAAYH,CAAO,MAIxBK,IAAAL,EAAQ,UAAR,QAAAK,EAAA,KAAAL,IACO,SAAS,kBAAkBA,KAJzB;AAKX,GASaM,IAAe,SAC1BC,GACAC,MACGC,GACU;AACT,MAAAC;AAEJ,EAAIF,EAAK,SAAS,OAAO,KAAKA,EAAK,SAAS,OAAO,IACrCE,IAAA,gBACHF,EAAK,SAAS,KAAK,IAChBE,IAAA,kBAEAA,IAAA;AAER,QAAAC,IAAM,SAAS,YAAYD,CAAS;AAEtC,SAAAC,EAAA,UAAUH,GAAM,GAAGC,CAAI,GAC3BF,EAAI,cAAcI,CAAG,GACdJ;AACT,GAEaK,IAAS,CAACC,MAAoB,CAACA,EAAG,aAAa,WAAW,GAE1DC,IAAa,CACxBD,GACAE,GACAC,MACG;AACG,QAAA,EAAE,YAAAC,EAAe,IAAAJ;AACnB,MAAA,CAACI,EAAmB,QAAA;AAClB,QAAAC,IAAWD,EAAW,iBAAiBD,CAAO,GAC9CG,IAAQ,MAAM,UAAU,QAAQ,KAAKD,GAAUL,CAAE;AAChD,SAAAK,EAASC,IAAQJ,CAAQ,KAAK;AACvC,GAEaK,IAAY,CAACP,MAAoB;AAC5C,EAAKA,MACLA,EAAG,MAAM,GACT,CAACD,EAAOC,CAAE,KAAKA,EAAG,MAAM;AAC1B;"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { e as t } from "../../../functions-DzLqXvGt.js";
|
2
|
+
import "lodash-es";
|
3
|
+
import "vue";
|
4
|
+
import { i as e } from "../../../index-C8JNJPWW.js";
|
5
|
+
const u = (r) => {
|
6
|
+
if (!e || r === "") return null;
|
7
|
+
if (t(r))
|
8
|
+
try {
|
9
|
+
return document.querySelector(r);
|
10
|
+
} catch {
|
11
|
+
return null;
|
12
|
+
}
|
13
|
+
return r;
|
14
|
+
};
|
15
|
+
export {
|
16
|
+
u as getElement
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=element.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"element.js","sources":["../../../../src/components/_util/dom/element.ts"],"sourcesContent":["import { isString } from '../types'\r\nimport { isClient } from '../browser'\r\n\r\ntype GetElement = <T extends string | HTMLElement | Window | null | undefined>(\r\n target: T\r\n) => T extends string ? HTMLElement | null : T\r\n\r\nexport const getElement = ((\r\n target: string | HTMLElement | Window | null | undefined\r\n) => {\r\n if (!isClient || target === '') return null\r\n if (isString(target)) {\r\n try {\r\n return document.querySelector<HTMLElement>(target)\r\n } catch {\r\n return null\r\n }\r\n }\r\n return target\r\n}) as GetElement\r\n"],"names":["getElement","target","isClient","isString"],"mappings":";;;;AAOa,MAAAA,IAAc,CACzBC,MACG;AACH,MAAI,CAACC,KAAYD,MAAW,GAAW,QAAA;AACnC,MAAAE,EAASF,CAAM;AACb,QAAA;AACK,aAAA,SAAS,cAA2BA,CAAM;AAAA,IAAA,QAC3C;AACC,aAAA;AAAA,IACT;AAEK,SAAAA;AACT;"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export declare const composeEventHandlers: <E>(theirsHandler?: (event: E) => boolean | void, oursHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
2
|
+
checkForDefaultPrevented?: boolean | undefined;
|
3
|
+
}) => (event: E) => void;
|
4
|
+
type WhenMouseHandler = (e: PointerEvent) => any;
|
5
|
+
export declare const whenMouse: (handler: WhenMouseHandler) => WhenMouseHandler;
|
6
|
+
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
const v = (o, t, { checkForDefaultPrevented: c = !0 } = {}) => (n) => {
|
2
|
+
const e = o == null ? void 0 : o(n);
|
3
|
+
if (c === !1 || !e)
|
4
|
+
return t == null ? void 0 : t(n);
|
5
|
+
}, u = (o) => (t) => t.pointerType === "mouse" ? o(t) : void 0;
|
6
|
+
export {
|
7
|
+
v as composeEventHandlers,
|
8
|
+
u as whenMouse
|
9
|
+
};
|
10
|
+
//# sourceMappingURL=event.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"event.js","sources":["../../../../src/components/_util/dom/event.ts"],"sourcesContent":["export const composeEventHandlers = <E>(\r\n theirsHandler?: (event: E) => boolean | void,\r\n oursHandler?: (event: E) => void,\r\n { checkForDefaultPrevented = true } = {}\r\n) => {\r\n const handleEvent = (event: E) => {\r\n const shouldPrevent = theirsHandler?.(event)\r\n\r\n if (checkForDefaultPrevented === false || !shouldPrevent) {\r\n return oursHandler?.(event)\r\n }\r\n }\r\n return handleEvent\r\n}\r\n\r\ntype WhenMouseHandler = (e: PointerEvent) => any\r\nexport const whenMouse = (handler: WhenMouseHandler): WhenMouseHandler => {\r\n return (e: PointerEvent) =>\r\n e.pointerType === 'mouse' ? handler(e) : undefined\r\n}\r\n"],"names":["composeEventHandlers","theirsHandler","oursHandler","checkForDefaultPrevented","event","shouldPrevent","whenMouse","handler","e"],"mappings":"AAAa,MAAAA,IAAuB,CAClCC,GACAC,GACA,EAAE,0BAAAC,IAA2B,GAAS,IAAA,OAElB,CAACC,MAAa;AAC1B,QAAAC,IAAgBJ,KAAA,gBAAAA,EAAgBG;AAElC,MAAAD,MAA6B,MAAS,CAACE;AACzC,WAAOH,KAAA,gBAAAA,EAAcE;AACvB,GAMSE,IAAY,CAACC,MACjB,CAACC,MACNA,EAAE,gBAAgB,UAAUD,EAAQC,CAAC,IAAI;"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { attemptFocus as o, focusNode as l, getSibling as r, isFocusable as s, isLeaf as a, isVisible as i, obtainAllFocusableElements as n, triggerEvent as m } from "./aria.js";
|
2
|
+
import { composeEventHandlers as g, whenMouse as f } from "./event.js";
|
3
|
+
import { getClientXY as S, getOffsetTop as d, getOffsetTopDistance as x, isInContainer as C } from "./position.js";
|
4
|
+
import { animateScrollTo as u, getScrollBarWidth as E, getScrollContainer as T, getScrollElement as v, getScrollTop as y, isScroll as h, scrollIntoView as F } from "./scroll.js";
|
5
|
+
import { addClass as A, addUnit as I, classNameToArray as N, getStyle as O, hasClass as V, removeClass as B, removeStyle as D, setStyle as H } from "./style.js";
|
6
|
+
import { getElement as M } from "./element.js";
|
7
|
+
export {
|
8
|
+
A as addClass,
|
9
|
+
I as addUnit,
|
10
|
+
u as animateScrollTo,
|
11
|
+
o as attemptFocus,
|
12
|
+
N as classNameToArray,
|
13
|
+
g as composeEventHandlers,
|
14
|
+
l as focusNode,
|
15
|
+
S as getClientXY,
|
16
|
+
M as getElement,
|
17
|
+
d as getOffsetTop,
|
18
|
+
x as getOffsetTopDistance,
|
19
|
+
E as getScrollBarWidth,
|
20
|
+
T as getScrollContainer,
|
21
|
+
v as getScrollElement,
|
22
|
+
y as getScrollTop,
|
23
|
+
r as getSibling,
|
24
|
+
O as getStyle,
|
25
|
+
V as hasClass,
|
26
|
+
s as isFocusable,
|
27
|
+
C as isInContainer,
|
28
|
+
a as isLeaf,
|
29
|
+
h as isScroll,
|
30
|
+
i as isVisible,
|
31
|
+
n as obtainAllFocusableElements,
|
32
|
+
B as removeClass,
|
33
|
+
D as removeStyle,
|
34
|
+
F as scrollIntoView,
|
35
|
+
H as setStyle,
|
36
|
+
m as triggerEvent,
|
37
|
+
f as whenMouse
|
38
|
+
};
|
39
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare const isInContainer: (el?: Element, container?: Element | Window) => boolean;
|
2
|
+
export declare const getOffsetTop: (el: HTMLElement) => number;
|
3
|
+
export declare const getOffsetTopDistance: (el: HTMLElement, containerEl: HTMLElement) => number;
|
4
|
+
export declare const getClientXY: (event: MouseEvent | TouchEvent) => {
|
5
|
+
clientX: number;
|
6
|
+
clientY: number;
|
7
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { i as c } from "../../../index-C8JNJPWW.js";
|
2
|
+
const s = (t, i) => {
|
3
|
+
if (!c || !t || !i) return !1;
|
4
|
+
const e = t.getBoundingClientRect();
|
5
|
+
let n;
|
6
|
+
return i instanceof Element ? n = i.getBoundingClientRect() : n = {
|
7
|
+
top: 0,
|
8
|
+
right: window.innerWidth,
|
9
|
+
bottom: window.innerHeight,
|
10
|
+
left: 0
|
11
|
+
}, e.top < n.bottom && e.bottom > n.top && e.right > n.left && e.left < n.right;
|
12
|
+
}, o = (t) => {
|
13
|
+
let i = 0, e = t;
|
14
|
+
for (; e; )
|
15
|
+
i += e.offsetTop, e = e.offsetParent;
|
16
|
+
return i;
|
17
|
+
}, r = (t, i) => Math.abs(o(t) - o(i)), f = (t) => {
|
18
|
+
let i, e;
|
19
|
+
return t.type === "touchend" ? (e = t.changedTouches[0].clientY, i = t.changedTouches[0].clientX) : t.type.startsWith("touch") ? (e = t.touches[0].clientY, i = t.touches[0].clientX) : (e = t.clientY, i = t.clientX), {
|
20
|
+
clientX: i,
|
21
|
+
clientY: e
|
22
|
+
};
|
23
|
+
};
|
24
|
+
export {
|
25
|
+
f as getClientXY,
|
26
|
+
o as getOffsetTop,
|
27
|
+
r as getOffsetTopDistance,
|
28
|
+
s as isInContainer
|
29
|
+
};
|
30
|
+
//# sourceMappingURL=position.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"position.js","sources":["../../../../src/components/_util/dom/position.ts"],"sourcesContent":["import { isClient } from '../browser'\r\n\r\nexport const isInContainer = (\r\n el?: Element,\r\n container?: Element | Window\r\n): boolean => {\r\n if (!isClient || !el || !container) return false\r\n\r\n const elRect = el.getBoundingClientRect()\r\n\r\n let containerRect: Pick<DOMRect, 'top' | 'bottom' | 'left' | 'right'>\r\n if (container instanceof Element) {\r\n containerRect = container.getBoundingClientRect()\r\n } else {\r\n containerRect = {\r\n top: 0,\r\n right: window.innerWidth,\r\n bottom: window.innerHeight,\r\n left: 0,\r\n }\r\n }\r\n return (\r\n elRect.top < containerRect.bottom &&\r\n elRect.bottom > containerRect.top &&\r\n elRect.right > containerRect.left &&\r\n elRect.left < containerRect.right\r\n )\r\n}\r\n\r\nexport const getOffsetTop = (el: HTMLElement) => {\r\n let offset = 0\r\n let parent = el\r\n\r\n while (parent) {\r\n offset += parent.offsetTop\r\n parent = parent.offsetParent as HTMLElement\r\n }\r\n\r\n return offset\r\n}\r\n\r\nexport const getOffsetTopDistance = (\r\n el: HTMLElement,\r\n containerEl: HTMLElement\r\n) => {\r\n return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl))\r\n}\r\n\r\nexport const getClientXY = (event: MouseEvent | TouchEvent) => {\r\n let clientX: number\r\n let clientY: number\r\n if (event.type === 'touchend') {\r\n clientY = (event as TouchEvent).changedTouches[0].clientY\r\n clientX = (event as TouchEvent).changedTouches[0].clientX\r\n } else if (event.type.startsWith('touch')) {\r\n clientY = (event as TouchEvent).touches[0].clientY\r\n clientX = (event as TouchEvent).touches[0].clientX\r\n } else {\r\n clientY = (event as MouseEvent).clientY\r\n clientX = (event as MouseEvent).clientX\r\n }\r\n return {\r\n clientX,\r\n clientY,\r\n }\r\n}\r\n"],"names":["isInContainer","el","container","isClient","elRect","containerRect","getOffsetTop","offset","parent","getOffsetTopDistance","containerEl","getClientXY","event","clientX","clientY"],"mappings":";AAEa,MAAAA,IAAgB,CAC3BC,GACAC,MACY;AACZ,MAAI,CAACC,KAAY,CAACF,KAAM,CAACC,EAAkB,QAAA;AAErC,QAAAE,IAASH,EAAG;AAEd,MAAAI;AACJ,SAAIH,aAAqB,UACvBG,IAAgBH,EAAU,0BAEVG,IAAA;AAAA,IACd,KAAK;AAAA,IACL,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,IACf,MAAM;AAAA,EAAA,GAIRD,EAAO,MAAMC,EAAc,UAC3BD,EAAO,SAASC,EAAc,OAC9BD,EAAO,QAAQC,EAAc,QAC7BD,EAAO,OAAOC,EAAc;AAEhC,GAEaC,IAAe,CAACL,MAAoB;AAC/C,MAAIM,IAAS,GACTC,IAASP;AAEb,SAAOO;AACL,IAAAD,KAAUC,EAAO,WACjBA,IAASA,EAAO;AAGX,SAAAD;AACT,GAEaE,IAAuB,CAClCR,GACAS,MAEO,KAAK,IAAIJ,EAAaL,CAAE,IAAIK,EAAaI,CAAW,CAAC,GAGjDC,IAAc,CAACC,MAAmC;AACzD,MAAAC,GACAC;AACA,SAAAF,EAAM,SAAS,cACNE,IAAAF,EAAqB,eAAe,CAAC,EAAE,SACvCC,IAAAD,EAAqB,eAAe,CAAC,EAAE,WACzCA,EAAM,KAAK,WAAW,OAAO,KAC3BE,IAAAF,EAAqB,QAAQ,CAAC,EAAE,SAChCC,IAAAD,EAAqB,QAAQ,CAAC,EAAE,YAE3CE,IAAWF,EAAqB,SAChCC,IAAWD,EAAqB,UAE3B;AAAA,IACL,SAAAC;AAAA,IACA,SAAAC;AAAA,EAAA;AAEJ;"}
|