orion-design 0.1.30 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/Throne/index.js +30 -14
- package/dist/Throne/index.js.map +1 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +9 -0
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +1 -0
- package/dist/components/Button/index.js +40 -33
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Flex/index.js +122 -89
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/LovInput/LovInput.js +2 -2
- package/dist/components/Form/LovInput/LovInput.js.map +1 -1
- package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
- package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
- package/dist/components/Form/LovInput/index.js +4 -4
- package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
- package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
- package/dist/components/Form/hooks/index.js +128 -66
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.js +836 -656
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.js +30 -18
- package/dist/components/Form/utils/index.js.map +1 -1
- package/dist/components/LovTable/index.js +179 -105
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Modal/index.js +111 -56
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/types.js +4 -3
- package/dist/components/Modal/types.js.map +1 -1
- package/dist/components/Modal/useModal.js +5 -5
- package/dist/components/Modal/useModal.js.map +1 -1
- package/dist/components/Pagetable/hooks/useColumns.js +88 -80
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.js +687 -542
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +92 -54
- package/dist/components/Pagetable/utils/index.js.map +1 -1
- package/dist/components/Querytable/hooks/useColumns.js +82 -74
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.js +579 -469
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Querytable/utils/index.js +92 -54
- package/dist/components/Querytable/utils/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.js +100 -74
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Tabs/constants.js +2 -2
- package/dist/components/Tabs/constants.js.map +1 -1
- package/dist/components/Tabs/index.js +603 -358
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tab-bar.js +6 -6
- package/dist/components/Tabs/tab-bar.js.map +1 -1
- package/dist/components/Tabs/tab-pane.js +3 -3
- package/dist/components/Tabs/tab-pane.js.map +1 -1
- package/dist/components/_constants/aria.js +2 -2
- package/dist/components/_constants/aria.js.map +1 -1
- package/dist/components/_constants/event.js +6 -4
- package/dist/components/_constants/event.js.map +1 -1
- package/dist/components/_constants/index.js +6 -6
- package/dist/components/_hooks/index.js +7 -7
- package/dist/components/_hooks/use-namespace/index.js +74 -39
- package/dist/components/_hooks/use-namespace/index.js.map +1 -1
- package/dist/components/_hooks/use-ordered-children/index.js +29 -19
- package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
- package/dist/components/_util/arrays.js +9 -5
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js +6 -6
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/classNames.js +22 -17
- package/dist/components/_util/classNames.js.map +1 -1
- package/dist/components/_util/dom/aria.js +74 -39
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +9 -8
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js +14 -7
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/index.js +36 -36
- package/dist/components/_util/dom/position.js +49 -25
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +103 -61
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +65 -50
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js +8 -4
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js +12 -11
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/functions.js +3 -3
- package/dist/components/_util/i18n.js +2 -2
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/index.js +137 -137
- package/dist/components/_util/isValid.js +4 -2
- package/dist/components/_util/isValid.js.map +1 -1
- package/dist/components/_util/objects.js +18 -14
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/props-util/index.js +46 -20
- package/dist/components/_util/props-util/index.js.map +1 -1
- package/dist/components/_util/props-util/initDefaultProps.js +18 -10
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
- package/dist/components/_util/raf.js +5 -4
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js +4 -3
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js +9 -8
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js +16 -10
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/type.js +41 -38
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/types.js +41 -22
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js +2 -2
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/util.js +85 -43
- package/dist/components/_util/util.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +27 -15
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js +29 -25
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/index.js +41 -41
- package/dist/components/_util/vue/install.js +35 -18
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/index.js +6 -6
- package/dist/components/_util/vue/props/runtime.js +46 -30
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js +12 -6
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js +5 -3
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js +5 -4
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js +100 -54
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/_util/vue-types/index.js +231 -220
- package/dist/components/_util/vue-types/index.js.map +1 -1
- package/dist/components/components.js +20 -20
- package/dist/components/index.js +38 -35
- package/dist/components/index.js.map +1 -1
- package/dist/components-B3d9m_tn.js +27 -0
- package/dist/components-B3d9m_tn.js.map +1 -0
- package/dist/error/OrionError.js +8 -4
- package/dist/error/OrionError.js.map +1 -1
- package/dist/functions-BeMkokbY.js +63 -0
- package/dist/functions-BeMkokbY.js.map +1 -0
- package/dist/index-BOKLZnqH.js +54 -0
- package/dist/index-BOKLZnqH.js.map +1 -0
- package/dist/index-D1m0KTpK.js +69 -0
- package/dist/index-D1m0KTpK.js.map +1 -0
- package/dist/index-DR5ZP7mD.js +160 -0
- package/dist/index-DR5ZP7mD.js.map +1 -0
- package/dist/index-DkwIULcN.js +200 -0
- package/dist/index-DkwIULcN.js.map +1 -0
- package/dist/index.css +797 -1
- package/dist/index.js +36 -36
- package/dist/print/LodopFuncs.js +101 -43
- package/dist/print/LodopFuncs.js.map +1 -1
- package/dist/print/index.js +200 -108
- package/dist/print/index.js.map +1 -1
- package/dist/request/ErrorHandlerChain.js +17 -14
- package/dist/request/ErrorHandlerChain.js.map +1 -1
- package/dist/request/RequestFilterChain.js +16 -13
- package/dist/request/RequestFilterChain.js.map +1 -1
- package/dist/request/ResponseParserChain.js +17 -14
- package/dist/request/ResponseParserChain.js.map +1 -1
- package/dist/request/disivion/DateSerializer.js +47 -22
- package/dist/request/disivion/DateSerializer.js.map +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +40 -25
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
- package/dist/request/disivion/DivisionResponseParser.js +16 -10
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
- package/dist/request/disivion/index.js +305 -201
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/error/BizExceptionResponseError.js +11 -5
- package/dist/request/error/BizExceptionResponseError.js.map +1 -1
- package/dist/request/error/ExceptionResponseError.js +11 -5
- package/dist/request/error/ExceptionResponseError.js.map +1 -1
- package/dist/request/error/ResponseError.js +9 -4
- package/dist/request/error/ResponseError.js.map +1 -1
- package/dist/request/error/SessionExceptionResponseError.js +11 -5
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
- package/dist/request/index.js +11 -11
- package/dist/utils/DateUtil.js +48 -33
- package/dist/utils/DateUtil.js.map +1 -1
- package/dist/utils/NumberUtil.js +6 -6
- package/dist/utils/NumberUtil.js.map +1 -1
- package/dist/utils/cloneDeep.js +2 -2
- package/dist/utils/delay.js +3 -3
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/functions.js +3 -3
- package/dist/utils/index.js +12 -12
- package/dist/utils/md5.js +191 -93
- package/dist/utils/md5.js.map +1 -1
- package/dist/utils/uuid.js +35 -25
- package/dist/utils/uuid.js.map +1 -1
- package/dist/version/index.js +2 -2
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +2 -2
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
@@ -1,15 +1,15 @@
|
|
1
1
|
import "lodash-es";
|
2
2
|
import "vue";
|
3
|
-
import { buildProps
|
3
|
+
import { buildProps, definePropType } from "../_util/vue/props/runtime.js";
|
4
4
|
import "element-plus";
|
5
|
-
import { mutable
|
6
|
-
const
|
5
|
+
import { mutable } from "../_util/typescript.js";
|
6
|
+
const tabBarProps = buildProps({
|
7
7
|
tabs: {
|
8
|
-
type:
|
9
|
-
default: () =>
|
8
|
+
type: definePropType(Array),
|
9
|
+
default: () => mutable([])
|
10
10
|
}
|
11
11
|
});
|
12
12
|
export {
|
13
|
-
|
13
|
+
tabBarProps
|
14
14
|
};
|
15
15
|
//# sourceMappingURL=tab-bar.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tab-bar.js","sources":["../../../src/components/Tabs/tab-bar.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '../_util'\r\nimport type { ExtractPropTypes } from 'vue'\r\nimport type { TabsPaneContext } from './constants'\r\nimport type TabBar from './tab-bar.vue'\r\n\r\nexport const tabBarProps = buildProps({\r\n tabs: {\r\n type: definePropType<TabsPaneContext[]>(Array),\r\n default: () => mutable([] as const),\r\n },\r\n} as const)\r\n\r\nexport type TabBarProps = ExtractPropTypes<typeof tabBarProps>\r\nexport type TabBarInstance = InstanceType<typeof TabBar>\r\n"],"names":[
|
1
|
+
{"version":3,"file":"tab-bar.js","sources":["../../../src/components/Tabs/tab-bar.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '../_util'\r\nimport type { ExtractPropTypes } from 'vue'\r\nimport type { TabsPaneContext } from './constants'\r\nimport type TabBar from './tab-bar.vue'\r\n\r\nexport const tabBarProps = buildProps({\r\n tabs: {\r\n type: definePropType<TabsPaneContext[]>(Array),\r\n default: () => mutable([] as const),\r\n },\r\n} as const)\r\n\r\nexport type TabBarProps = ExtractPropTypes<typeof tabBarProps>\r\nexport type TabBarInstance = InstanceType<typeof TabBar>\r\n"],"names":[],"mappings":";;;;;AAKO,MAAM,cAAc,WAAW;AAAA,EACpC,MAAM;AAAA,IACJ,MAAM,eAAkC,KAAK;AAAA,IAC7C,SAAS,MAAM,QAAQ,EAAW;AAAA,EACpC;AACF,CAAU;"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import "lodash-es";
|
2
2
|
import "vue";
|
3
|
-
import { buildProps
|
3
|
+
import { buildProps } from "../_util/vue/props/runtime.js";
|
4
4
|
import "element-plus";
|
5
|
-
const
|
5
|
+
const tabPaneProps = buildProps({
|
6
6
|
/**
|
7
7
|
* @description title of the tab
|
8
8
|
*/
|
@@ -30,6 +30,6 @@ const r = o({
|
|
30
30
|
lazy: Boolean
|
31
31
|
});
|
32
32
|
export {
|
33
|
-
|
33
|
+
tabPaneProps
|
34
34
|
};
|
35
35
|
//# sourceMappingURL=tab-pane.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tab-pane.js","sources":["../../../src/components/Tabs/tab-pane.ts"],"sourcesContent":["import { buildProps } from '../_util'\r\nimport type { ExtractPropTypes } from 'vue'\r\nimport type TabPane from './tab-pane.vue'\r\n\r\nexport const tabPaneProps = buildProps({\r\n /**\r\n * @description title of the tab\r\n */\r\n label: {\r\n type: String,\r\n default: '',\r\n },\r\n /**\r\n * @description identifier corresponding to the name of Tabs, representing the alias of the tab-pane, the default is ordinal number of the tab-pane in the sequence, e.g. the first tab-pane is '0'\r\n */\r\n name: {\r\n type: [String, Number],\r\n },\r\n /**\r\n * @description whether Tab is closable\r\n */\r\n closable: Boolean,\r\n /**\r\n * @description whether Tab is disabled\r\n */\r\n disabled: Boolean,\r\n /**\r\n * @description whether Tab is lazily rendered\r\n */\r\n lazy: Boolean,\r\n} as const)\r\n\r\nexport type TabPaneProps = ExtractPropTypes<typeof tabPaneProps>\r\n\r\nexport type TabPaneInstance = InstanceType<typeof TabPane>\r\n"],"names":[
|
1
|
+
{"version":3,"file":"tab-pane.js","sources":["../../../src/components/Tabs/tab-pane.ts"],"sourcesContent":["import { buildProps } from '../_util'\r\nimport type { ExtractPropTypes } from 'vue'\r\nimport type TabPane from './tab-pane.vue'\r\n\r\nexport const tabPaneProps = buildProps({\r\n /**\r\n * @description title of the tab\r\n */\r\n label: {\r\n type: String,\r\n default: '',\r\n },\r\n /**\r\n * @description identifier corresponding to the name of Tabs, representing the alias of the tab-pane, the default is ordinal number of the tab-pane in the sequence, e.g. the first tab-pane is '0'\r\n */\r\n name: {\r\n type: [String, Number],\r\n },\r\n /**\r\n * @description whether Tab is closable\r\n */\r\n closable: Boolean,\r\n /**\r\n * @description whether Tab is disabled\r\n */\r\n disabled: Boolean,\r\n /**\r\n * @description whether Tab is lazily rendered\r\n */\r\n lazy: Boolean,\r\n} as const)\r\n\r\nexport type TabPaneProps = ExtractPropTypes<typeof tabPaneProps>\r\n\r\nexport type TabPaneInstance = InstanceType<typeof TabPane>\r\n"],"names":[],"mappings":";;;;AAIO,MAAM,eAAe,WAAW;AAAA;AAAA;AAAA;AAAA,EAIrC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAIA,MAAM;AAAA,IACJ,MAAM,CAAC,QAAQ,MAAM;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA,EAIA,UAAU;AAAA;AAAA;AAAA;AAAA,EAIV,UAAU;AAAA;AAAA;AAAA;AAAA,EAIV,MAAM;AACR,CAAU;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aria.js","sources":["../../../src/components/_constants/aria.ts"],"sourcesContent":["export const EVENT_CODE = {\r\n tab: 'Tab',\r\n enter: 'Enter',\r\n space: 'Space',\r\n left: 'ArrowLeft', // 37\r\n up: 'ArrowUp', // 38\r\n right: 'ArrowRight', // 39\r\n down: 'ArrowDown', // 40\r\n esc: 'Escape',\r\n delete: 'Delete',\r\n backspace: 'Backspace',\r\n numpadEnter: 'NumpadEnter',\r\n pageUp: 'PageUp',\r\n pageDown: 'PageDown',\r\n home: 'Home',\r\n end: 'End',\r\n}\r\n"],"names":[
|
1
|
+
{"version":3,"file":"aria.js","sources":["../../../src/components/_constants/aria.ts"],"sourcesContent":["export const EVENT_CODE = {\r\n tab: 'Tab',\r\n enter: 'Enter',\r\n space: 'Space',\r\n left: 'ArrowLeft', // 37\r\n up: 'ArrowUp', // 38\r\n right: 'ArrowRight', // 39\r\n down: 'ArrowDown', // 40\r\n esc: 'Escape',\r\n delete: 'Delete',\r\n backspace: 'Backspace',\r\n numpadEnter: 'NumpadEnter',\r\n pageUp: 'PageUp',\r\n pageDown: 'PageDown',\r\n home: 'Home',\r\n end: 'End',\r\n}\r\n"],"names":[],"mappings":"AAAO,MAAM,aAAa;AAAA,EACxB,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA;AAAA,EACN,IAAI;AAAA;AAAA,EACJ,OAAO;AAAA;AAAA,EACP,MAAM;AAAA;AAAA,EACN,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AAAA,EACN,KAAK;AACP;"}
|
@@ -1,7 +1,9 @@
|
|
1
|
-
const
|
1
|
+
const UPDATE_MODEL_EVENT = "update:modelValue";
|
2
|
+
const CHANGE_EVENT = "change";
|
3
|
+
const INPUT_EVENT = "input";
|
2
4
|
export {
|
3
|
-
|
4
|
-
|
5
|
-
|
5
|
+
CHANGE_EVENT,
|
6
|
+
INPUT_EVENT,
|
7
|
+
UPDATE_MODEL_EVENT
|
6
8
|
};
|
7
9
|
//# sourceMappingURL=event.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"event.js","sources":["../../../src/components/_constants/event.ts"],"sourcesContent":["export const UPDATE_MODEL_EVENT = 'update:modelValue'\r\nexport const CHANGE_EVENT = 'change'\r\nexport const INPUT_EVENT = 'input'\r\n"],"names":[
|
1
|
+
{"version":3,"file":"event.js","sources":["../../../src/components/_constants/event.ts"],"sourcesContent":["export const UPDATE_MODEL_EVENT = 'update:modelValue'\r\nexport const CHANGE_EVENT = 'change'\r\nexport const INPUT_EVENT = 'input'\r\n"],"names":[],"mappings":"AAAO,MAAM,qBAAqB;AAC3B,MAAM,eAAe;AACrB,MAAM,cAAc;"}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { EVENT_CODE
|
2
|
-
import { CHANGE_EVENT
|
1
|
+
import { EVENT_CODE } from "./aria.js";
|
2
|
+
import { CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT } from "./event.js";
|
3
3
|
export {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
CHANGE_EVENT,
|
5
|
+
EVENT_CODE,
|
6
|
+
INPUT_EVENT,
|
7
|
+
UPDATE_MODEL_EVENT
|
8
8
|
};
|
9
9
|
//# sourceMappingURL=index.js.map
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { defaultNamespace
|
2
|
-
import { useOrderedChildren
|
1
|
+
import { defaultNamespace, namespaceContextKey, useGetDerivedNamespace, useNamespace } from "./use-namespace/index.js";
|
2
|
+
import { useOrderedChildren } from "./use-ordered-children/index.js";
|
3
3
|
export {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
defaultNamespace,
|
5
|
+
namespaceContextKey,
|
6
|
+
useGetDerivedNamespace,
|
7
|
+
useNamespace,
|
8
|
+
useOrderedChildren
|
9
9
|
};
|
10
10
|
//# sourceMappingURL=index.js.map
|
@@ -1,46 +1,81 @@
|
|
1
|
-
import { getCurrentInstance
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
|
1
|
+
import { getCurrentInstance, inject, ref, computed, unref } from "vue";
|
2
|
+
const defaultNamespace = "orion";
|
3
|
+
const statePrefix = "is-";
|
4
|
+
const _bem = (namespace, block, blockSuffix, element, modifier) => {
|
5
|
+
let cls = `${namespace}-${block}`;
|
6
|
+
if (blockSuffix) {
|
7
|
+
cls += `-${blockSuffix}`;
|
8
|
+
}
|
9
|
+
if (element) {
|
10
|
+
cls += `__${element}`;
|
11
|
+
}
|
12
|
+
if (modifier) {
|
13
|
+
cls += `--${modifier}`;
|
14
|
+
}
|
15
|
+
return cls;
|
16
|
+
};
|
17
|
+
const namespaceContextKey = Symbol("namespaceContextKey");
|
18
|
+
const useGetDerivedNamespace = (namespaceOverrides) => {
|
19
|
+
const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace));
|
20
|
+
const namespace = computed(() => {
|
21
|
+
return unref(derivedNamespace) || defaultNamespace;
|
22
|
+
});
|
23
|
+
return namespace;
|
24
|
+
};
|
25
|
+
const useNamespace = (block, namespaceOverrides) => {
|
26
|
+
const namespace = useGetDerivedNamespace(namespaceOverrides);
|
27
|
+
const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
|
28
|
+
const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
|
29
|
+
const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
|
30
|
+
const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
|
31
|
+
const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
|
32
|
+
const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
|
33
|
+
const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
|
34
|
+
const is = (name, ...args) => {
|
35
|
+
const state = args.length >= 1 ? args[0] : true;
|
36
|
+
return name && state ? `${statePrefix}${name}` : "";
|
37
|
+
};
|
38
|
+
const cssVar = (object) => {
|
39
|
+
const styles = {};
|
40
|
+
for (const key in object) {
|
41
|
+
if (object[key]) {
|
42
|
+
styles[`--${namespace.value}-${key}`] = object[key];
|
43
|
+
}
|
44
|
+
}
|
45
|
+
return styles;
|
46
|
+
};
|
47
|
+
const cssVarBlock = (object) => {
|
48
|
+
const styles = {};
|
49
|
+
for (const key in object) {
|
50
|
+
if (object[key]) {
|
51
|
+
styles[`--${namespace.value}-${block}-${key}`] = object[key];
|
52
|
+
}
|
53
|
+
}
|
54
|
+
return styles;
|
55
|
+
};
|
56
|
+
const cssVarName = (name) => `--${namespace.value}-${name}`;
|
57
|
+
const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
|
10
58
|
return {
|
11
|
-
namespace
|
12
|
-
b
|
13
|
-
e
|
14
|
-
m
|
15
|
-
be
|
16
|
-
em
|
17
|
-
bm
|
18
|
-
bem
|
19
|
-
is
|
20
|
-
const n = e.length >= 1 ? e[0] : !0;
|
21
|
-
return s && n ? `${l}${s}` : "";
|
22
|
-
},
|
59
|
+
namespace,
|
60
|
+
b,
|
61
|
+
e,
|
62
|
+
m,
|
63
|
+
be,
|
64
|
+
em,
|
65
|
+
bm,
|
66
|
+
bem,
|
67
|
+
is,
|
23
68
|
// css
|
24
|
-
cssVar
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
return e;
|
29
|
-
},
|
30
|
-
cssVarName: (s) => `--${t.value}-${s}`,
|
31
|
-
cssVarBlock: (s) => {
|
32
|
-
const e = {};
|
33
|
-
for (const n in s)
|
34
|
-
s[n] && (e[`--${t.value}-${a}-${n}`] = s[n]);
|
35
|
-
return e;
|
36
|
-
},
|
37
|
-
cssVarBlockName: (s) => `--${t.value}-${a}-${s}`
|
69
|
+
cssVar,
|
70
|
+
cssVarName,
|
71
|
+
cssVarBlock,
|
72
|
+
cssVarBlockName
|
38
73
|
};
|
39
74
|
};
|
40
75
|
export {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
76
|
+
defaultNamespace,
|
77
|
+
namespaceContextKey,
|
78
|
+
useGetDerivedNamespace,
|
79
|
+
useNamespace
|
45
80
|
};
|
46
81
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/_hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, ref, unref } from 'vue'\r\n\r\nimport type { InjectionKey, Ref } from 'vue'\r\n\r\nexport const defaultNamespace = 'orion'\r\nconst statePrefix = 'is-'\r\n\r\nconst _bem = (\r\n namespace: string,\r\n block: string,\r\n blockSuffix: string,\r\n element: string,\r\n modifier: string\r\n) => {\r\n let cls = `${namespace}-${block}`\r\n if (blockSuffix) {\r\n cls += `-${blockSuffix}`\r\n }\r\n if (element) {\r\n cls += `__${element}`\r\n }\r\n if (modifier) {\r\n cls += `--${modifier}`\r\n }\r\n return cls\r\n}\r\n\r\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\r\n Symbol('namespaceContextKey')\r\n\r\nexport const useGetDerivedNamespace = (\r\n namespaceOverrides?: Ref<string | undefined>\r\n) => {\r\n const derivedNamespace =\r\n namespaceOverrides ||\r\n (getCurrentInstance()\r\n ? inject(namespaceContextKey, ref(defaultNamespace))\r\n : ref(defaultNamespace))\r\n const namespace = computed(() => {\r\n return unref(derivedNamespace) || defaultNamespace\r\n })\r\n return namespace\r\n}\r\n\r\nexport const useNamespace = (\r\n block: string,\r\n namespaceOverrides?: Ref<string | undefined>\r\n) => {\r\n const namespace = useGetDerivedNamespace(namespaceOverrides)\r\n const b = (blockSuffix = '') =>\r\n _bem(namespace.value, block, blockSuffix, '', '')\r\n const e = (element?: string) =>\r\n element ? _bem(namespace.value, block, '', element, '') : ''\r\n const m = (modifier?: string) =>\r\n modifier ? _bem(namespace.value, block, '', '', modifier) : ''\r\n const be = (blockSuffix?: string, element?: string) =>\r\n blockSuffix && element\r\n ? _bem(namespace.value, block, blockSuffix, element, '')\r\n : ''\r\n const em = (element?: string, modifier?: string) =>\r\n element && modifier\r\n ? _bem(namespace.value, block, '', element, modifier)\r\n : ''\r\n const bm = (blockSuffix?: string, modifier?: string) =>\r\n blockSuffix && modifier\r\n ? _bem(namespace.value, block, blockSuffix, '', modifier)\r\n : ''\r\n const bem = (blockSuffix?: string, element?: string, modifier?: string) =>\r\n blockSuffix && element && modifier\r\n ? _bem(namespace.value, block, blockSuffix, element, modifier)\r\n : ''\r\n const is: {\r\n (name: string, state: boolean | undefined): string\r\n (name: string): string\r\n } = (name: string, ...args: [boolean | undefined] | []) => {\r\n const state = args.length >= 1 ? args[0]! : true\r\n return name && state ? `${statePrefix}${name}` : ''\r\n }\r\n\r\n // for css var\r\n // --el-xxx: value;\r\n const cssVar = (object: Record<string, string>) => {\r\n const styles: Record<string, string> = {}\r\n for (const key in object) {\r\n if (object[key]) {\r\n styles[`--${namespace.value}-${key}`] = object[key]\r\n }\r\n }\r\n return styles\r\n }\r\n // with block\r\n const cssVarBlock = (object: Record<string, string>) => {\r\n const styles: Record<string, string> = {}\r\n for (const key in object) {\r\n if (object[key]) {\r\n styles[`--${namespace.value}-${block}-${key}`] = object[key]\r\n }\r\n }\r\n return styles\r\n }\r\n\r\n const cssVarName = (name: string) => `--${namespace.value}-${name}`\r\n const cssVarBlockName = (name: string) =>\r\n `--${namespace.value}-${block}-${name}`\r\n\r\n return {\r\n namespace,\r\n b,\r\n e,\r\n m,\r\n be,\r\n em,\r\n bm,\r\n bem,\r\n is,\r\n // css\r\n cssVar,\r\n cssVarName,\r\n cssVarBlock,\r\n cssVarBlockName,\r\n }\r\n}\r\n\r\nexport type UseNamespaceReturn = ReturnType<typeof useNamespace>\r\n"],"names":[
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/_hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, ref, unref } from 'vue'\r\n\r\nimport type { InjectionKey, Ref } from 'vue'\r\n\r\nexport const defaultNamespace = 'orion'\r\nconst statePrefix = 'is-'\r\n\r\nconst _bem = (\r\n namespace: string,\r\n block: string,\r\n blockSuffix: string,\r\n element: string,\r\n modifier: string\r\n) => {\r\n let cls = `${namespace}-${block}`\r\n if (blockSuffix) {\r\n cls += `-${blockSuffix}`\r\n }\r\n if (element) {\r\n cls += `__${element}`\r\n }\r\n if (modifier) {\r\n cls += `--${modifier}`\r\n }\r\n return cls\r\n}\r\n\r\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\r\n Symbol('namespaceContextKey')\r\n\r\nexport const useGetDerivedNamespace = (\r\n namespaceOverrides?: Ref<string | undefined>\r\n) => {\r\n const derivedNamespace =\r\n namespaceOverrides ||\r\n (getCurrentInstance()\r\n ? inject(namespaceContextKey, ref(defaultNamespace))\r\n : ref(defaultNamespace))\r\n const namespace = computed(() => {\r\n return unref(derivedNamespace) || defaultNamespace\r\n })\r\n return namespace\r\n}\r\n\r\nexport const useNamespace = (\r\n block: string,\r\n namespaceOverrides?: Ref<string | undefined>\r\n) => {\r\n const namespace = useGetDerivedNamespace(namespaceOverrides)\r\n const b = (blockSuffix = '') =>\r\n _bem(namespace.value, block, blockSuffix, '', '')\r\n const e = (element?: string) =>\r\n element ? _bem(namespace.value, block, '', element, '') : ''\r\n const m = (modifier?: string) =>\r\n modifier ? _bem(namespace.value, block, '', '', modifier) : ''\r\n const be = (blockSuffix?: string, element?: string) =>\r\n blockSuffix && element\r\n ? _bem(namespace.value, block, blockSuffix, element, '')\r\n : ''\r\n const em = (element?: string, modifier?: string) =>\r\n element && modifier\r\n ? _bem(namespace.value, block, '', element, modifier)\r\n : ''\r\n const bm = (blockSuffix?: string, modifier?: string) =>\r\n blockSuffix && modifier\r\n ? _bem(namespace.value, block, blockSuffix, '', modifier)\r\n : ''\r\n const bem = (blockSuffix?: string, element?: string, modifier?: string) =>\r\n blockSuffix && element && modifier\r\n ? _bem(namespace.value, block, blockSuffix, element, modifier)\r\n : ''\r\n const is: {\r\n (name: string, state: boolean | undefined): string\r\n (name: string): string\r\n } = (name: string, ...args: [boolean | undefined] | []) => {\r\n const state = args.length >= 1 ? args[0]! : true\r\n return name && state ? `${statePrefix}${name}` : ''\r\n }\r\n\r\n // for css var\r\n // --el-xxx: value;\r\n const cssVar = (object: Record<string, string>) => {\r\n const styles: Record<string, string> = {}\r\n for (const key in object) {\r\n if (object[key]) {\r\n styles[`--${namespace.value}-${key}`] = object[key]\r\n }\r\n }\r\n return styles\r\n }\r\n // with block\r\n const cssVarBlock = (object: Record<string, string>) => {\r\n const styles: Record<string, string> = {}\r\n for (const key in object) {\r\n if (object[key]) {\r\n styles[`--${namespace.value}-${block}-${key}`] = object[key]\r\n }\r\n }\r\n return styles\r\n }\r\n\r\n const cssVarName = (name: string) => `--${namespace.value}-${name}`\r\n const cssVarBlockName = (name: string) =>\r\n `--${namespace.value}-${block}-${name}`\r\n\r\n return {\r\n namespace,\r\n b,\r\n e,\r\n m,\r\n be,\r\n em,\r\n bm,\r\n bem,\r\n is,\r\n // css\r\n cssVar,\r\n cssVarName,\r\n cssVarBlock,\r\n cssVarBlockName,\r\n }\r\n}\r\n\r\nexport type UseNamespaceReturn = ReturnType<typeof useNamespace>\r\n"],"names":[],"mappings":";AAIO,MAAM,mBAAmB;AAChC,MAAM,cAAc;AAEpB,MAAM,OAAO,CACX,WACA,OACA,aACA,SACA,aACG;AACH,MAAI,MAAM,GAAG,SAAS,IAAI,KAAK;AAC/B,MAAI,aAAa;AACf,WAAO,IAAI,WAAW;AAAA,EACxB;AACA,MAAI,SAAS;AACX,WAAO,KAAK,OAAO;AAAA,EACrB;AACA,MAAI,UAAU;AACZ,WAAO,KAAK,QAAQ;AAAA,EACtB;AACO,SAAA;AACT;AAEa,MAAA,sBACX,OAAO,qBAAqB;AAEjB,MAAA,yBAAyB,CACpC,uBACG;AACG,QAAA,mBACJ,uBACC,mBAAA,IACG,OAAO,qBAAqB,IAAI,gBAAgB,CAAC,IACjD,IAAI,gBAAgB;AACpB,QAAA,YAAY,SAAS,MAAM;AACxB,WAAA,MAAM,gBAAgB,KAAK;AAAA,EAAA,CACnC;AACM,SAAA;AACT;AAEa,MAAA,eAAe,CAC1B,OACA,uBACG;AACG,QAAA,YAAY,uBAAuB,kBAAkB;AACrD,QAAA,IAAI,CAAC,cAAc,OACvB,KAAK,UAAU,OAAO,OAAO,aAAa,IAAI,EAAE;AAC5C,QAAA,IAAI,CAAC,YACT,UAAU,KAAK,UAAU,OAAO,OAAO,IAAI,SAAS,EAAE,IAAI;AACtD,QAAA,IAAI,CAAC,aACT,WAAW,KAAK,UAAU,OAAO,OAAO,IAAI,IAAI,QAAQ,IAAI;AAC9D,QAAM,KAAK,CAAC,aAAsB,YAChC,eAAe,UACX,KAAK,UAAU,OAAO,OAAO,aAAa,SAAS,EAAE,IACrD;AACN,QAAM,KAAK,CAAC,SAAkB,aAC5B,WAAW,WACP,KAAK,UAAU,OAAO,OAAO,IAAI,SAAS,QAAQ,IAClD;AACN,QAAM,KAAK,CAAC,aAAsB,aAChC,eAAe,WACX,KAAK,UAAU,OAAO,OAAO,aAAa,IAAI,QAAQ,IACtD;AACN,QAAM,MAAM,CAAC,aAAsB,SAAkB,aACnD,eAAe,WAAW,WACtB,KAAK,UAAU,OAAO,OAAO,aAAa,SAAS,QAAQ,IAC3D;AACA,QAAA,KAGF,CAAC,SAAiB,SAAqC;AACzD,UAAM,QAAQ,KAAK,UAAU,IAAI,KAAK,CAAC,IAAK;AAC5C,WAAO,QAAQ,QAAQ,GAAG,WAAW,GAAG,IAAI,KAAK;AAAA,EAAA;AAK7C,QAAA,SAAS,CAAC,WAAmC;AACjD,UAAM,SAAiC,CAAA;AACvC,eAAW,OAAO,QAAQ;AACpB,UAAA,OAAO,GAAG,GAAG;AACR,eAAA,KAAK,UAAU,KAAK,IAAI,GAAG,EAAE,IAAI,OAAO,GAAG;AAAA,MACpD;AAAA,IACF;AACO,WAAA;AAAA,EAAA;AAGH,QAAA,cAAc,CAAC,WAAmC;AACtD,UAAM,SAAiC,CAAA;AACvC,eAAW,OAAO,QAAQ;AACpB,UAAA,OAAO,GAAG,GAAG;AACR,eAAA,KAAK,UAAU,KAAK,IAAI,KAAK,IAAI,GAAG,EAAE,IAAI,OAAO,GAAG;AAAA,MAC7D;AAAA,IACF;AACO,WAAA;AAAA,EAAA;AAGT,QAAM,aAAa,CAAC,SAAiB,KAAK,UAAU,KAAK,IAAI,IAAI;AAC3D,QAAA,kBAAkB,CAAC,SACvB,KAAK,UAAU,KAAK,IAAI,KAAK,IAAI,IAAI;AAEhC,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
@@ -1,27 +1,37 @@
|
|
1
|
-
import { shallowRef
|
1
|
+
import { shallowRef, isVNode } from "vue";
|
2
2
|
import "lodash-es";
|
3
3
|
import "element-plus";
|
4
|
-
import { flattedChildren
|
5
|
-
const
|
6
|
-
(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
).map((e) => e.component.uid).map((e) => d[e]).filter((e) => !!e), f = (t, i) => {
|
11
|
-
const d = {}, o = s([]);
|
12
|
-
return {
|
13
|
-
children: o,
|
14
|
-
addChild: (r) => {
|
15
|
-
d[r.uid] = r, o.value = u(t, i, d);
|
16
|
-
},
|
17
|
-
removeChild: (r) => {
|
18
|
-
delete d[r], o.value = o.value.filter(
|
19
|
-
(l) => l.uid !== r
|
20
|
-
);
|
4
|
+
import { flattedChildren } from "../../_util/vue/vnode.js";
|
5
|
+
const getOrderedChildren = (vm, childComponentName, children) => {
|
6
|
+
const nodes = flattedChildren(vm.subTree).filter(
|
7
|
+
(n) => {
|
8
|
+
var _a;
|
9
|
+
return isVNode(n) && ((_a = n.type) == null ? void 0 : _a.name) === childComponentName && !!n.component;
|
21
10
|
}
|
11
|
+
);
|
12
|
+
const uids = nodes.map((n) => n.component.uid);
|
13
|
+
return uids.map((uid) => children[uid]).filter((p) => !!p);
|
14
|
+
};
|
15
|
+
const useOrderedChildren = (vm, childComponentName) => {
|
16
|
+
const children = {};
|
17
|
+
const orderedChildren = shallowRef([]);
|
18
|
+
const addChild = (child) => {
|
19
|
+
children[child.uid] = child;
|
20
|
+
orderedChildren.value = getOrderedChildren(vm, childComponentName, children);
|
21
|
+
};
|
22
|
+
const removeChild = (uid) => {
|
23
|
+
delete children[uid];
|
24
|
+
orderedChildren.value = orderedChildren.value.filter(
|
25
|
+
(children2) => children2.uid !== uid
|
26
|
+
);
|
27
|
+
};
|
28
|
+
return {
|
29
|
+
children: orderedChildren,
|
30
|
+
addChild,
|
31
|
+
removeChild
|
22
32
|
};
|
23
33
|
};
|
24
34
|
export {
|
25
|
-
|
35
|
+
useOrderedChildren
|
26
36
|
};
|
27
37
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/_hooks/use-ordered-children/index.ts"],"sourcesContent":["import { shallowRef } from 'vue'\r\nimport { flattedChildren, isVNode } from '../../_util'\r\n\r\nimport type { ComponentInternalInstance, VNode } from 'vue'\r\n\r\nconst getOrderedChildren = <T>(\r\n vm: ComponentInternalInstance,\r\n childComponentName: string,\r\n children: Record<number, T>\r\n): T[] => {\r\n const nodes = flattedChildren(vm.subTree).filter(\r\n (n): n is VNode =>\r\n isVNode(n) &&\r\n (n.type as any)?.name === childComponentName &&\r\n !!n.component\r\n )\r\n const uids = nodes.map((n) => n.component!.uid)\r\n return uids.map((uid) => children[uid]).filter((p) => !!p)\r\n}\r\n\r\nexport const useOrderedChildren = <T extends { uid: number }>(\r\n vm: ComponentInternalInstance,\r\n childComponentName: string\r\n) => {\r\n const children: Record<number, T> = {}\r\n const orderedChildren = shallowRef<T[]>([])\r\n\r\n // TODO: split into two functions: addChild and sortChildren\r\n const addChild = (child: T) => {\r\n children[child.uid] = child\r\n orderedChildren.value = getOrderedChildren(vm, childComponentName, children)\r\n }\r\n const removeChild = (uid: number) => {\r\n delete children[uid]\r\n orderedChildren.value = orderedChildren.value.filter(\r\n (children) => children.uid !== uid\r\n )\r\n }\r\n\r\n return {\r\n children: orderedChildren,\r\n addChild,\r\n removeChild,\r\n }\r\n}\r\n"],"names":["
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/_hooks/use-ordered-children/index.ts"],"sourcesContent":["import { shallowRef } from 'vue'\r\nimport { flattedChildren, isVNode } from '../../_util'\r\n\r\nimport type { ComponentInternalInstance, VNode } from 'vue'\r\n\r\nconst getOrderedChildren = <T>(\r\n vm: ComponentInternalInstance,\r\n childComponentName: string,\r\n children: Record<number, T>\r\n): T[] => {\r\n const nodes = flattedChildren(vm.subTree).filter(\r\n (n): n is VNode =>\r\n isVNode(n) &&\r\n (n.type as any)?.name === childComponentName &&\r\n !!n.component\r\n )\r\n const uids = nodes.map((n) => n.component!.uid)\r\n return uids.map((uid) => children[uid]).filter((p) => !!p)\r\n}\r\n\r\nexport const useOrderedChildren = <T extends { uid: number }>(\r\n vm: ComponentInternalInstance,\r\n childComponentName: string\r\n) => {\r\n const children: Record<number, T> = {}\r\n const orderedChildren = shallowRef<T[]>([])\r\n\r\n // TODO: split into two functions: addChild and sortChildren\r\n const addChild = (child: T) => {\r\n children[child.uid] = child\r\n orderedChildren.value = getOrderedChildren(vm, childComponentName, children)\r\n }\r\n const removeChild = (uid: number) => {\r\n delete children[uid]\r\n orderedChildren.value = orderedChildren.value.filter(\r\n (children) => children.uid !== uid\r\n )\r\n }\r\n\r\n return {\r\n children: orderedChildren,\r\n addChild,\r\n removeChild,\r\n }\r\n}\r\n"],"names":["children"],"mappings":";;;;AAKA,MAAM,qBAAqB,CACzB,IACA,oBACA,aACQ;AACR,QAAM,QAAQ,gBAAgB,GAAG,OAAO,EAAE;AAAA,IACxC,CAAC,MACC;;AAAA,qBAAQ,CAAC,OACR,OAAE,SAAF,mBAAgB,UAAS,sBAC1B,CAAC,CAAC,EAAE;AAAA;AAAA,EAAA;AAER,QAAM,OAAO,MAAM,IAAI,CAAC,MAAM,EAAE,UAAW,GAAG;AAC9C,SAAO,KAAK,IAAI,CAAC,QAAQ,SAAS,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3D;AAEa,MAAA,qBAAqB,CAChC,IACA,uBACG;AACH,QAAM,WAA8B,CAAA;AAC9B,QAAA,kBAAkB,WAAgB,CAAA,CAAE;AAGpC,QAAA,WAAW,CAAC,UAAa;AACpB,aAAA,MAAM,GAAG,IAAI;AACtB,oBAAgB,QAAQ,mBAAmB,IAAI,oBAAoB,QAAQ;AAAA,EAAA;AAEvE,QAAA,cAAc,CAAC,QAAgB;AACnC,WAAO,SAAS,GAAG;AACH,oBAAA,QAAQ,gBAAgB,MAAM;AAAA,MAC5C,CAACA,cAAaA,UAAS,QAAQ;AAAA,IAAA;AAAA,EACjC;AAGK,SAAA;AAAA,IACL,UAAU;AAAA,IACV;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
@@ -1,8 +1,12 @@
|
|
1
|
-
import { castArray
|
2
|
-
const
|
1
|
+
import { castArray } from "lodash-es";
|
2
|
+
const unique = (arr) => [...new Set(arr)];
|
3
|
+
const castArray2 = (arr) => {
|
4
|
+
if (!arr && arr !== 0) return [];
|
5
|
+
return Array.isArray(arr) ? arr : [arr];
|
6
|
+
};
|
3
7
|
export {
|
4
|
-
|
5
|
-
|
6
|
-
|
8
|
+
castArray2 as castArray,
|
9
|
+
castArray as ensureArray,
|
10
|
+
unique
|
7
11
|
};
|
8
12
|
//# sourceMappingURL=arrays.js.map
|
@@ -1 +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":["
|
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":["castArray"],"mappings":";AAAa,MAAA,SAAS,CAAI,QAAa,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC;AAK1C,MAAAA,aAAY,CAAI,QAAsB;AACjD,MAAI,CAAC,OAAQ,QAAgB,UAAU,CAAA;AACvC,SAAO,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,GAAG;AACxC;"}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { i } from "../../index-
|
2
|
-
import { a
|
3
|
-
const
|
1
|
+
import { i as isClient } from "../../index-D1m0KTpK.js";
|
2
|
+
import { a } from "../../index-D1m0KTpK.js";
|
3
|
+
const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
|
4
4
|
export {
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
isClient,
|
6
|
+
isFirefox,
|
7
|
+
a as isIOS
|
8
8
|
};
|
9
9
|
//# sourceMappingURL=browser.js.map
|
@@ -1 +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":[
|
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":[],"mappings":";;AAEO,MAAM,YAAY,MACvB,YAAY,WAAW,KAAK,OAAO,UAAU,SAAS;"}
|
@@ -1,24 +1,29 @@
|
|
1
|
-
import { isString
|
2
|
-
function
|
3
|
-
const
|
4
|
-
for (let
|
5
|
-
const
|
6
|
-
if (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
import { isString, isArray, isObject } from "./util.js";
|
2
|
+
function classNames(...args) {
|
3
|
+
const classes = [];
|
4
|
+
for (let i = 0; i < args.length; i++) {
|
5
|
+
const value = args[i];
|
6
|
+
if (!value) continue;
|
7
|
+
if (isString(value)) {
|
8
|
+
classes.push(value);
|
9
|
+
} else if (isArray(value)) {
|
10
|
+
for (let i2 = 0; i2 < value.length; i2++) {
|
11
|
+
const inner = classNames(value[i2]);
|
12
|
+
if (inner) {
|
13
|
+
classes.push(inner);
|
13
14
|
}
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
}
|
16
|
+
} else if (isObject(value)) {
|
17
|
+
for (const name in value) {
|
18
|
+
if (value[name]) {
|
19
|
+
classes.push(name);
|
20
|
+
}
|
21
|
+
}
|
17
22
|
}
|
18
23
|
}
|
19
|
-
return
|
24
|
+
return classes.join(" ");
|
20
25
|
}
|
21
26
|
export {
|
22
|
-
|
27
|
+
classNames as default
|
23
28
|
};
|
24
29
|
//# sourceMappingURL=classNames.js.map
|
@@ -1 +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":["
|
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":["i"],"mappings":";AACA,SAAS,cAAc,MAAa;AAClC,QAAM,UAAU,CAAA;AAChB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AAC9B,UAAA,QAAQ,KAAK,CAAC;AACpB,QAAI,CAAC,MAAO;AACR,QAAA,SAAS,KAAK,GAAG;AAEnB,cAAQ,KAAK,KAAK;AAAA,IAAA,WACT,QAAQ,KAAK,GAAG;AACzB,eAASA,KAAI,GAAGA,KAAI,MAAM,QAAQA,MAAK;AACrC,cAAM,QAAQ,WAAW,MAAMA,EAAC,CAAC;AACjC,YAAI,OAAO;AAET,kBAAQ,KAAK,KAAK;AAAA,QACpB;AAAA,MACF;AAAA,IAAA,WACS,SAAS,KAAK,GAAG;AAC1B,iBAAW,QAAQ,OAAO;AACpB,YAAA,MAAM,IAAI,GAAG;AAEf,kBAAQ,KAAK,IAAI;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACO,SAAA,QAAQ,KAAK,GAAG;AACzB;"}
|
@@ -1,46 +1,81 @@
|
|
1
|
-
const
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
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])`;
|
2
|
+
const isVisible = (element) => {
|
3
|
+
if (process.env.NODE_ENV === "test") return true;
|
4
|
+
const computed = getComputedStyle(element);
|
5
|
+
return computed.position === "fixed" ? false : element.offsetParent !== null;
|
6
|
+
};
|
7
|
+
const obtainAllFocusableElements = (element) => {
|
8
|
+
return Array.from(
|
9
|
+
element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)
|
10
|
+
).filter((item) => isFocusable(item) && isVisible(item));
|
11
|
+
};
|
12
|
+
const isFocusable = (element) => {
|
13
|
+
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
|
14
|
+
return true;
|
15
|
+
}
|
16
|
+
if (element.disabled) {
|
17
|
+
return false;
|
18
|
+
}
|
19
|
+
switch (element.nodeName) {
|
20
|
+
case "A": {
|
21
|
+
return !!element.href && element.rel !== "ignore";
|
22
|
+
}
|
23
|
+
case "INPUT": {
|
24
|
+
return !(element.type === "hidden" || element.type === "file");
|
25
|
+
}
|
13
26
|
case "BUTTON":
|
14
27
|
case "SELECT":
|
15
|
-
case "TEXTAREA":
|
16
|
-
return
|
17
|
-
|
18
|
-
|
28
|
+
case "TEXTAREA": {
|
29
|
+
return true;
|
30
|
+
}
|
31
|
+
default: {
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
};
|
36
|
+
const attemptFocus = (element) => {
|
37
|
+
var _a;
|
38
|
+
if (!isFocusable(element)) {
|
39
|
+
return false;
|
40
|
+
}
|
41
|
+
(_a = element.focus) == null ? void 0 : _a.call(element);
|
42
|
+
return document.activeElement === element;
|
43
|
+
};
|
44
|
+
const triggerEvent = function(elm, name, ...opts) {
|
45
|
+
let eventName;
|
46
|
+
if (name.includes("mouse") || name.includes("click")) {
|
47
|
+
eventName = "MouseEvents";
|
48
|
+
} else if (name.includes("key")) {
|
49
|
+
eventName = "KeyboardEvent";
|
50
|
+
} else {
|
51
|
+
eventName = "HTMLEvents";
|
19
52
|
}
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
const
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
53
|
+
const evt = document.createEvent(eventName);
|
54
|
+
evt.initEvent(name, ...opts);
|
55
|
+
elm.dispatchEvent(evt);
|
56
|
+
return elm;
|
57
|
+
};
|
58
|
+
const isLeaf = (el) => !el.getAttribute("aria-owns");
|
59
|
+
const getSibling = (el, distance, elClass) => {
|
60
|
+
const { parentNode } = el;
|
61
|
+
if (!parentNode) return null;
|
62
|
+
const siblings = parentNode.querySelectorAll(elClass);
|
63
|
+
const index = Array.prototype.indexOf.call(siblings, el);
|
64
|
+
return siblings[index + distance] || null;
|
65
|
+
};
|
66
|
+
const focusNode = (el) => {
|
67
|
+
if (!el) return;
|
68
|
+
el.focus();
|
69
|
+
!isLeaf(el) && el.click();
|
35
70
|
};
|
36
71
|
export {
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
72
|
+
attemptFocus,
|
73
|
+
focusNode,
|
74
|
+
getSibling,
|
75
|
+
isFocusable,
|
76
|
+
isLeaf,
|
77
|
+
isVisible,
|
78
|
+
obtainAllFocusableElements,
|
79
|
+
triggerEvent
|
45
80
|
};
|
46
81
|
//# sourceMappingURL=aria.js.map
|