orion-design 0.1.31 → 0.1.33
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/hooks/use-throne-context.d.ts +5 -0
- package/dist/Throne/hooks/use-throne-context.js +15 -0
- package/dist/Throne/hooks/use-throne-context.js.map +1 -0
- package/dist/Throne/index.d.ts +1 -1
- package/dist/Throne/index.js +14 -30
- package/dist/Throne/index.js.map +1 -1
- package/dist/components/Button/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/components/Button/index.js +36 -41
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Flex/index.js +89 -122
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/FileInput/FileInput.vue.d.ts +4 -4
- 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/LovInput.vue.d.ts +894 -0
- 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/MultiTableSelect/MultiTableSelect.d.ts +26 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.js +5 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.js.map +1 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.vue.d.ts +6249 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.d.ts +1 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js +9 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js.map +1 -0
- package/dist/components/Form/MultiTableSelect/index.d.ts +2 -0
- package/dist/components/Form/MultiTableSelect/index.js +7 -0
- package/dist/components/Form/MultiTableSelect/index.js.map +1 -0
- 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 +69 -127
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.d.ts +3 -0
- package/dist/components/Form/index.js +790 -829
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.js +18 -30
- package/dist/components/Form/utils/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +510 -6
- package/dist/components/LovTable/LovQuerytable.vue.d.ts +468 -4
- package/dist/components/LovTable/index.d.ts +489 -5
- package/dist/components/LovTable/index.js +104 -179
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Modal/index.js +56 -111
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/types.d.ts +1 -1
- package/dist/components/Modal/types.js +3 -4
- 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/MultiTableSelectPagetable/MultiTableSelectPagetable.vue.d.ts +880 -0
- package/dist/components/MultiTableSelectPagetable/index.d.ts +462 -0
- package/dist/components/MultiTableSelectPagetable/index.js +164 -0
- package/dist/components/MultiTableSelectPagetable/index.js.map +1 -0
- package/dist/components/Pagetable/Pagetable.d.ts +96 -3
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +1 -1
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +14 -1
- package/dist/components/Pagetable/hooks/useCode.d.ts +2 -0
- package/dist/components/Pagetable/hooks/useCode.js +24 -0
- package/dist/components/Pagetable/hooks/useCode.js.map +1 -0
- package/dist/components/Pagetable/hooks/useColumns.js +85 -88
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +159 -2
- package/dist/components/Pagetable/index.js +601 -684
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +54 -92
- package/dist/components/Pagetable/utils/index.js.map +1 -1
- package/dist/components/Querytable/Querytable.d.ts +80 -2
- package/dist/components/Querytable/columns/QuerytableColumnButtongroup.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnDate.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnDiy.d.ts +1 -1
- package/dist/components/Querytable/columns/QuerytableColumnLink.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnMultiselect.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnNumber.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnSingleselect.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnString.d.ts +14 -1
- package/dist/components/Querytable/hooks/useColumns.js +79 -82
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.d.ts +147 -1
- package/dist/components/Querytable/index.js +526 -579
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Querytable/utils/index.js +54 -92
- package/dist/components/Querytable/utils/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.js +74 -100
- 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 +358 -603
- 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/Throne/ThroneContextProvider.d.ts +25 -0
- package/dist/components/_constants/aria.js +2 -2
- package/dist/components/_constants/aria.js.map +1 -1
- package/dist/components/_constants/event.js +4 -6
- 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 +39 -74
- package/dist/components/_hooks/use-namespace/index.js.map +1 -1
- package/dist/components/_hooks/use-ordered-children/index.js +19 -29
- package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
- package/dist/components/_util/arrays.js +5 -9
- 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 +17 -22
- package/dist/components/_util/classNames.js.map +1 -1
- package/dist/components/_util/dom/aria.js +39 -74
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +8 -9
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js +7 -14
- 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 +25 -49
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +61 -103
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +50 -65
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js +4 -8
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js +11 -12
- 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 +2 -4
- package/dist/components/_util/isValid.js.map +1 -1
- package/dist/components/_util/objects.js +14 -18
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/props-util/index.js +20 -46
- package/dist/components/_util/props-util/index.js.map +1 -1
- package/dist/components/_util/props-util/initDefaultProps.js +10 -18
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
- package/dist/components/_util/raf.js +4 -5
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js +3 -4
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js +8 -9
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js +10 -16
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/type.js +38 -41
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/types.js +22 -41
- 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 +43 -85
- package/dist/components/_util/util.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +15 -27
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js +25 -29
- 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 +18 -35
- 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 +30 -46
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js +6 -12
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js +3 -5
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js +4 -5
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js +54 -100
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/_util/vue-types/index.js +220 -231
- package/dist/components/_util/vue-types/index.js.map +1 -1
- package/dist/components/components.d.ts +2 -0
- package/dist/components/components.js +24 -20
- package/dist/components/components.js.map +1 -1
- package/dist/components/index.js +43 -38
- package/dist/components/index.js.map +1 -1
- package/dist/components-DP9bnDLm.js +48 -0
- package/dist/components-DP9bnDLm.js.map +1 -0
- package/dist/error/OrionError.js +4 -8
- package/dist/error/OrionError.js.map +1 -1
- package/dist/{index-C6P_0wAy.js → index-ChkLOmNK.js} +76 -46
- package/dist/{index-C6P_0wAy.js.map → index-ChkLOmNK.js.map} +1 -1
- package/dist/index.css +1 -797
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -36
- package/dist/index.js.map +1 -1
- package/dist/print/LodopFuncs.js +43 -101
- package/dist/print/LodopFuncs.js.map +1 -1
- package/dist/print/index.js +108 -200
- package/dist/print/index.js.map +1 -1
- package/dist/request/ErrorHandlerChain.js +14 -17
- package/dist/request/ErrorHandlerChain.js.map +1 -1
- package/dist/request/RequestFilterChain.js +13 -16
- package/dist/request/RequestFilterChain.js.map +1 -1
- package/dist/request/ResponseParserChain.js +14 -17
- package/dist/request/ResponseParserChain.js.map +1 -1
- package/dist/request/disivion/DateSerializer.js +22 -47
- package/dist/request/disivion/DateSerializer.js.map +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +25 -40
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
- package/dist/request/disivion/DivisionResponseParser.js +10 -16
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
- package/dist/request/disivion/index.js +201 -305
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/error/BizExceptionResponseError.js +5 -11
- package/dist/request/error/BizExceptionResponseError.js.map +1 -1
- package/dist/request/error/ExceptionResponseError.js +5 -11
- package/dist/request/error/ExceptionResponseError.js.map +1 -1
- package/dist/request/error/ResponseError.js +4 -9
- package/dist/request/error/ResponseError.js.map +1 -1
- package/dist/request/error/SessionExceptionResponseError.js +5 -11
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
- package/dist/request/index.js +11 -11
- package/dist/utils/DateUtil.js +33 -48
- 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 +93 -191
- package/dist/utils/md5.js.map +1 -1
- package/dist/utils/uuid.js +25 -35
- 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
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
- package/dist/components-8oZ2kpUC.js +0 -27
- package/dist/components-8oZ2kpUC.js.map +0 -1
- package/dist/components-B3d9m_tn.js +0 -27
- package/dist/components-B3d9m_tn.js.map +0 -1
- package/dist/functions-BeMkokbY.js +0 -63
- package/dist/functions-BeMkokbY.js.map +0 -1
- package/dist/index-BOKLZnqH.js +0 -54
- package/dist/index-BOKLZnqH.js.map +0 -1
- package/dist/index-D1m0KTpK.js +0 -69
- package/dist/index-D1m0KTpK.js.map +0 -1
- package/dist/index-DR5ZP7mD.js +0 -160
- package/dist/index-DR5ZP7mD.js.map +0 -1
- package/dist/index-DkwIULcN.js +0 -200
- package/dist/index-DkwIULcN.js.map +0 -1
@@ -1,156 +1,93 @@
|
|
1
1
|
import "lodash-es";
|
2
|
-
import { ref, watch, defineComponent, getCurrentInstance, inject, nextTick, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, computed, onMounted, onUpdated, createVNode, provide, renderSlot, useSlots, reactive, onUnmounted, withDirectives, vShow, createCommentVNode } from "vue";
|
3
|
-
import { withInstall } from "../_util/vue/install.js";
|
4
|
-
import { ElIcon } from "element-plus";
|
5
|
-
import { isNumber, isUndefined } from "../_util/types.js";
|
6
|
-
import { e as
|
7
|
-
import { buildProps, definePropType } from "../_util/vue/props/runtime.js";
|
8
|
-
import { UPDATE_MODEL_EVENT } from "../_constants/event.js";
|
9
|
-
import { useNamespace } from "../_hooks/use-namespace/index.js";
|
10
|
-
import { useOrderedChildren } from "../_hooks/use-ordered-children/index.js";
|
11
|
-
import { tabsRootContextKey } from "./constants.js";
|
12
|
-
import { t as
|
13
|
-
import { capitalize } from "../_util/strings.js";
|
14
|
-
import { throwError } from "../_util/error.js";
|
15
|
-
import { e as
|
16
|
-
import { mutable } from "../_util/typescript.js";
|
17
|
-
import { EVENT_CODE } from "../_constants/aria.js";
|
18
|
-
import { tabBarProps } from "./tab-bar.js";
|
19
|
-
import { tabPaneProps } from "./tab-pane.js";
|
20
|
-
function
|
21
|
-
var
|
22
|
-
const
|
23
|
-
return (
|
2
|
+
import { ref as h, watch as B, defineComponent as M, getCurrentInstance as D, inject as H, nextTick as K, onBeforeUnmount as Pe, openBlock as ue, createElementBlock as fe, normalizeClass as de, unref as k, normalizeStyle as Ne, computed as F, onMounted as ve, onUpdated as Ee, createVNode as O, provide as we, renderSlot as L, useSlots as Te, reactive as Se, onUnmounted as xe, withDirectives as $e, vShow as Ce, createCommentVNode as Ie } from "vue";
|
3
|
+
import { withInstall as Be } from "../_util/vue/install.js";
|
4
|
+
import { ElIcon as J } from "element-plus";
|
5
|
+
import { isNumber as ke, isUndefined as ze } from "../_util/types.js";
|
6
|
+
import { e as Re } from "../../functions-DzLqXvGt.js";
|
7
|
+
import { buildProps as be, definePropType as pe } from "../_util/vue/props/runtime.js";
|
8
|
+
import { UPDATE_MODEL_EVENT as me } from "../_constants/event.js";
|
9
|
+
import { useNamespace as V } from "../_hooks/use-namespace/index.js";
|
10
|
+
import { useOrderedChildren as Ae } from "../_hooks/use-ordered-children/index.js";
|
11
|
+
import { tabsRootContextKey as Q } from "./constants.js";
|
12
|
+
import { t as he, r as ye, i as Oe, b as Le, n as Fe, c as Me, d as Ve, e as Z } from "../../index-C9tCD90X.js";
|
13
|
+
import { capitalize as I } from "../_util/strings.js";
|
14
|
+
import { throwError as q } from "../_util/error.js";
|
15
|
+
import { e as Qe, f as Ue } from "../../index-ChkLOmNK.js";
|
16
|
+
import { mutable as We } from "../_util/typescript.js";
|
17
|
+
import { EVENT_CODE as je } from "../_constants/aria.js";
|
18
|
+
import { tabBarProps as De } from "./tab-bar.js";
|
19
|
+
import { tabPaneProps as He } from "./tab-pane.js";
|
20
|
+
function ge(e) {
|
21
|
+
var t;
|
22
|
+
const a = ye(e);
|
23
|
+
return (t = a == null ? void 0 : a.$el) != null ? t : a;
|
24
24
|
}
|
25
|
-
const
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
}
|
38
|
-
if (!target)
|
39
|
-
return noop;
|
40
|
-
if (!Array.isArray(events))
|
41
|
-
events = [events];
|
42
|
-
if (!Array.isArray(listeners))
|
43
|
-
listeners = [listeners];
|
44
|
-
const cleanups = [];
|
45
|
-
const cleanup = () => {
|
46
|
-
cleanups.forEach((fn) => fn());
|
47
|
-
cleanups.length = 0;
|
48
|
-
};
|
49
|
-
const register = (el, event, listener, options2) => {
|
50
|
-
el.addEventListener(event, listener, options2);
|
51
|
-
return () => el.removeEventListener(event, listener, options2);
|
25
|
+
const G = Oe ? window : void 0, Ke = Oe ? window.document : void 0;
|
26
|
+
function W(...e) {
|
27
|
+
let t, a, s, n;
|
28
|
+
if (Le(e[0]) || Array.isArray(e[0]) ? ([a, s, n] = e, t = G) : [t, a, s, n] = e, !t)
|
29
|
+
return Fe;
|
30
|
+
Array.isArray(a) || (a = [a]), Array.isArray(s) || (s = [s]);
|
31
|
+
const P = [], d = () => {
|
32
|
+
P.forEach((r) => r()), P.length = 0;
|
33
|
+
}, u = (r, i, f, b) => (r.addEventListener(i, f, b), () => r.removeEventListener(i, f, b)), y = B(() => [ge(t), ye(n)], ([r, i]) => {
|
34
|
+
d(), r && P.push(...a.flatMap((f) => s.map((b) => u(r, f, b, i))));
|
35
|
+
}, { immediate: !0, flush: "post" }), v = () => {
|
36
|
+
y(), d();
|
52
37
|
};
|
53
|
-
|
54
|
-
cleanup();
|
55
|
-
if (!el)
|
56
|
-
return;
|
57
|
-
cleanups.push(...events.flatMap((event) => {
|
58
|
-
return listeners.map((listener) => register(el, event, listener, options2));
|
59
|
-
}));
|
60
|
-
}, { immediate: true, flush: "post" });
|
61
|
-
const stop = () => {
|
62
|
-
stopWatch();
|
63
|
-
cleanup();
|
64
|
-
};
|
65
|
-
tryOnScopeDispose(stop);
|
66
|
-
return stop;
|
38
|
+
return he(v), v;
|
67
39
|
}
|
68
|
-
function
|
69
|
-
const
|
70
|
-
|
71
|
-
update();
|
72
|
-
tryOnMounted(update, sync);
|
73
|
-
return isSupported;
|
40
|
+
function qe(e, t = !1) {
|
41
|
+
const a = h(), s = () => a.value = !!e();
|
42
|
+
return s(), Me(s, t), a;
|
74
43
|
}
|
75
|
-
const
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
});
|
85
|
-
return visibility;
|
44
|
+
const ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, te = "__vueuse_ssr_handlers__";
|
45
|
+
ee[te] = ee[te] || {};
|
46
|
+
function Ge({ document: e = Ke } = {}) {
|
47
|
+
if (!e)
|
48
|
+
return h("visible");
|
49
|
+
const t = h(e.visibilityState);
|
50
|
+
return W(e, "visibilitychange", () => {
|
51
|
+
t.value = e.visibilityState;
|
52
|
+
}), t;
|
86
53
|
}
|
87
|
-
var
|
88
|
-
var
|
89
|
-
var
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
if (source != null && __getOwnPropSymbols$g)
|
96
|
-
for (var prop of __getOwnPropSymbols$g(source)) {
|
97
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
|
98
|
-
target[prop] = source[prop];
|
99
|
-
}
|
100
|
-
return target;
|
54
|
+
var ae = Object.getOwnPropertySymbols, Xe = Object.prototype.hasOwnProperty, Ye = Object.prototype.propertyIsEnumerable, Je = (e, t) => {
|
55
|
+
var a = {};
|
56
|
+
for (var s in e)
|
57
|
+
Xe.call(e, s) && t.indexOf(s) < 0 && (a[s] = e[s]);
|
58
|
+
if (e != null && ae)
|
59
|
+
for (var s of ae(e))
|
60
|
+
t.indexOf(s) < 0 && Ye.call(e, s) && (a[s] = e[s]);
|
61
|
+
return a;
|
101
62
|
};
|
102
|
-
function
|
103
|
-
const
|
104
|
-
let
|
105
|
-
const
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
63
|
+
function j(e, t, a = {}) {
|
64
|
+
const s = a, { window: n = G } = s, P = Je(s, ["window"]);
|
65
|
+
let d;
|
66
|
+
const u = qe(() => n && "ResizeObserver" in n), y = () => {
|
67
|
+
d && (d.disconnect(), d = void 0);
|
68
|
+
}, v = B(() => ge(e), (i) => {
|
69
|
+
y(), u.value && n && i && (d = new ResizeObserver(t), d.observe(i, P));
|
70
|
+
}, { immediate: !0, flush: "post" }), r = () => {
|
71
|
+
y(), v();
|
111
72
|
};
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
observer = new ResizeObserver(callback);
|
116
|
-
observer.observe(el, observerOptions);
|
117
|
-
}
|
118
|
-
}, { immediate: true, flush: "post" });
|
119
|
-
const stop = () => {
|
120
|
-
cleanup();
|
121
|
-
stopWatch();
|
122
|
-
};
|
123
|
-
tryOnScopeDispose(stop);
|
124
|
-
return {
|
125
|
-
isSupported,
|
126
|
-
stop
|
73
|
+
return he(r), {
|
74
|
+
isSupported: u,
|
75
|
+
stop: r
|
127
76
|
};
|
128
77
|
}
|
129
|
-
var
|
130
|
-
(function(
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
var
|
138
|
-
|
139
|
-
|
140
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
141
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
142
|
-
var __spreadValues = (a, b) => {
|
143
|
-
for (var prop in b || (b = {}))
|
144
|
-
if (__hasOwnProp.call(b, prop))
|
145
|
-
__defNormalProp(a, prop, b[prop]);
|
146
|
-
if (__getOwnPropSymbols)
|
147
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
148
|
-
if (__propIsEnum.call(b, prop))
|
149
|
-
__defNormalProp(a, prop, b[prop]);
|
150
|
-
}
|
151
|
-
return a;
|
78
|
+
var ne;
|
79
|
+
(function(e) {
|
80
|
+
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
81
|
+
})(ne || (ne = {}));
|
82
|
+
var Ze = Object.defineProperty, se = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable, oe = (e, t, a) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, at = (e, t) => {
|
83
|
+
for (var a in t || (t = {}))
|
84
|
+
et.call(t, a) && oe(e, a, t[a]);
|
85
|
+
if (se)
|
86
|
+
for (var a of se(t))
|
87
|
+
tt.call(t, a) && oe(e, a, t[a]);
|
88
|
+
return e;
|
152
89
|
};
|
153
|
-
const
|
90
|
+
const nt = {
|
154
91
|
easeInSine: [0.12, 0, 0.39, 0],
|
155
92
|
easeOutSine: [0.61, 1, 0.88, 1],
|
156
93
|
easeInOutSine: [0.37, 0, 0.63, 1],
|
@@ -176,115 +113,80 @@ const _TransitionPresets = {
|
|
176
113
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
177
114
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
178
115
|
};
|
179
|
-
|
180
|
-
linear:
|
181
|
-
},
|
182
|
-
function
|
183
|
-
if (!
|
184
|
-
return
|
185
|
-
const
|
186
|
-
|
187
|
-
|
188
|
-
})
|
189
|
-
|
190
|
-
|
191
|
-
});
|
192
|
-
return focused;
|
116
|
+
at({
|
117
|
+
linear: Ve
|
118
|
+
}, nt);
|
119
|
+
function st({ window: e = G } = {}) {
|
120
|
+
if (!e)
|
121
|
+
return h(!1);
|
122
|
+
const t = h(e.document.hasFocus());
|
123
|
+
return W(e, "blur", () => {
|
124
|
+
t.value = !1;
|
125
|
+
}), W(e, "focus", () => {
|
126
|
+
t.value = !0;
|
127
|
+
}), t;
|
193
128
|
}
|
194
|
-
const
|
195
|
-
|
196
|
-
...{
|
197
|
-
name: COMPONENT_NAME$2
|
198
|
-
},
|
129
|
+
const re = "OTabBar", ot = /* @__PURE__ */ M({
|
130
|
+
name: re,
|
199
131
|
__name: "tab-bar",
|
200
|
-
props:
|
201
|
-
setup(
|
202
|
-
const
|
203
|
-
|
204
|
-
const
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
if (!tab.active) {
|
220
|
-
return true;
|
221
|
-
}
|
222
|
-
offset = $el[`offset${capitalize(position)}`];
|
223
|
-
tabSize = $el[`client${capitalize(sizeName)}`];
|
224
|
-
const tabStyles = window.getComputedStyle($el);
|
225
|
-
if (sizeName === "width") {
|
226
|
-
tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
|
227
|
-
offset += Number.parseFloat(tabStyles.paddingLeft);
|
228
|
-
}
|
229
|
-
return false;
|
230
|
-
});
|
231
|
-
return {
|
232
|
-
[sizeName]: `${tabSize}px`,
|
233
|
-
transform: `translate${capitalize(sizeDir)}(${offset}px)`
|
132
|
+
props: De,
|
133
|
+
setup(e, { expose: t }) {
|
134
|
+
const a = e, s = D(), n = H(Q);
|
135
|
+
n || q(re, "<o-tabs><o-tab-bar /></p-tabs>");
|
136
|
+
const P = V("tabs"), d = h(), u = h(), y = () => {
|
137
|
+
let b = 0, o = 0;
|
138
|
+
const p = ["top", "bottom"].includes(n.props.tabPosition) ? "width" : "height", N = p === "width" ? "x" : "y", x = N === "x" ? "left" : "top";
|
139
|
+
return a.tabs.every((C) => {
|
140
|
+
var A, R;
|
141
|
+
const $ = (R = (A = s.parent) == null ? void 0 : A.refs) == null ? void 0 : R[`tab-${C.uid}`];
|
142
|
+
if (!$) return !1;
|
143
|
+
if (!C.active)
|
144
|
+
return !0;
|
145
|
+
b = $[`offset${I(x)}`], o = $[`client${I(p)}`];
|
146
|
+
const z = window.getComputedStyle($);
|
147
|
+
return p === "width" && (o -= Number.parseFloat(z.paddingLeft) + Number.parseFloat(z.paddingRight), b += Number.parseFloat(z.paddingLeft)), !1;
|
148
|
+
}), {
|
149
|
+
[p]: `${o}px`,
|
150
|
+
transform: `translate${I(N)}(${b}px)`
|
234
151
|
};
|
235
|
-
}
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
for (const key in list) {
|
245
|
-
if (key.startsWith("tab-")) {
|
246
|
-
const _el = list[key];
|
247
|
-
if (_el) {
|
248
|
-
saveObserver.push(useResizeObserver(_el, update));
|
152
|
+
}, v = () => u.value = y(), r = [], i = () => {
|
153
|
+
var o;
|
154
|
+
r.forEach((p) => p.stop()), r.length = 0;
|
155
|
+
const b = (o = s.parent) == null ? void 0 : o.refs;
|
156
|
+
if (b) {
|
157
|
+
for (const p in b)
|
158
|
+
if (p.startsWith("tab-")) {
|
159
|
+
const N = b[p];
|
160
|
+
N && r.push(j(N, v));
|
249
161
|
}
|
250
|
-
}
|
251
162
|
}
|
252
163
|
};
|
253
|
-
|
254
|
-
() =>
|
164
|
+
B(
|
165
|
+
() => a.tabs,
|
255
166
|
async () => {
|
256
|
-
await
|
257
|
-
update();
|
258
|
-
observerTabs();
|
167
|
+
await K(), v(), i();
|
259
168
|
},
|
260
|
-
{ immediate:
|
169
|
+
{ immediate: !0 }
|
261
170
|
);
|
262
|
-
const
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
barObserever.stop();
|
267
|
-
});
|
268
|
-
__expose({
|
171
|
+
const f = j(d, () => v());
|
172
|
+
return Pe(() => {
|
173
|
+
r.forEach((b) => b.stop()), r.length = 0, f.stop();
|
174
|
+
}), t({
|
269
175
|
/** @description tab root html element */
|
270
|
-
ref:
|
176
|
+
ref: d,
|
271
177
|
/** @description method to manually update tab bar style */
|
272
|
-
update
|
273
|
-
})
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
style: normalizeStyle(barStyle.value)
|
280
|
-
}, null, 6);
|
281
|
-
};
|
178
|
+
update: v
|
179
|
+
}), (b, o) => (ue(), fe("div", {
|
180
|
+
ref_key: "barRef",
|
181
|
+
ref: d,
|
182
|
+
class: de([k(P).e("active-bar"), k(P).is(k(n).props.tabPosition)]),
|
183
|
+
style: Ne(u.value)
|
184
|
+
}, null, 6));
|
282
185
|
}
|
283
|
-
})
|
284
|
-
const tabNavProps = buildProps({
|
186
|
+
}), rt = be({
|
285
187
|
panes: {
|
286
|
-
type:
|
287
|
-
default: () =>
|
188
|
+
type: pe(Array),
|
189
|
+
default: () => We([])
|
288
190
|
},
|
289
191
|
currentName: {
|
290
192
|
type: [String, Number],
|
@@ -296,222 +198,122 @@ const tabNavProps = buildProps({
|
|
296
198
|
default: "card"
|
297
199
|
},
|
298
200
|
stretch: Boolean
|
299
|
-
})
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
setup(props, {
|
310
|
-
expose,
|
311
|
-
emit
|
201
|
+
}), it = {
|
202
|
+
tabClick: (e, t, a) => a instanceof Event,
|
203
|
+
tabRemove: (e, t) => t instanceof Event
|
204
|
+
}, ie = "OTabNav", lt = /* @__PURE__ */ M({
|
205
|
+
name: ie,
|
206
|
+
props: rt,
|
207
|
+
emits: it,
|
208
|
+
setup(e, {
|
209
|
+
expose: t,
|
210
|
+
emit: a
|
312
211
|
}) {
|
313
|
-
const
|
314
|
-
|
315
|
-
const
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
if (!
|
335
|
-
const
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
const
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
scrollable.value = false;
|
397
|
-
if (currentOffset > 0) {
|
398
|
-
navOffset.value = 0;
|
399
|
-
}
|
400
|
-
}
|
401
|
-
};
|
402
|
-
const changeTab = (e) => {
|
403
|
-
const code = e.code;
|
404
|
-
const {
|
405
|
-
up,
|
406
|
-
down,
|
407
|
-
left,
|
408
|
-
right
|
409
|
-
} = EVENT_CODE;
|
410
|
-
if (![up, down, left, right].includes(code)) return;
|
411
|
-
const tabList = Array.from(e.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
|
412
|
-
const currentIndex = tabList.indexOf(e.target);
|
413
|
-
let nextIndex;
|
414
|
-
if (code === left || code === up) {
|
415
|
-
if (currentIndex === 0) {
|
416
|
-
nextIndex = tabList.length - 1;
|
417
|
-
} else {
|
418
|
-
nextIndex = currentIndex - 1;
|
419
|
-
}
|
420
|
-
} else {
|
421
|
-
if (currentIndex < tabList.length - 1) {
|
422
|
-
nextIndex = currentIndex + 1;
|
423
|
-
} else {
|
424
|
-
nextIndex = 0;
|
425
|
-
}
|
426
|
-
}
|
427
|
-
tabList[nextIndex].focus({
|
428
|
-
preventScroll: true
|
429
|
-
});
|
430
|
-
tabList[nextIndex].click();
|
431
|
-
setFocus();
|
432
|
-
};
|
433
|
-
const setFocus = () => {
|
434
|
-
if (focusable.value) isFocus.value = true;
|
435
|
-
};
|
436
|
-
const removeFocus = () => isFocus.value = false;
|
437
|
-
watch(visibility, (visibility2) => {
|
438
|
-
if (visibility2 === "hidden") {
|
439
|
-
focusable.value = false;
|
440
|
-
} else if (visibility2 === "visible") {
|
441
|
-
setTimeout(() => focusable.value = true, 50);
|
442
|
-
}
|
443
|
-
});
|
444
|
-
watch(focused, (focused2) => {
|
445
|
-
if (focused2) {
|
446
|
-
setTimeout(() => focusable.value = true, 50);
|
447
|
-
} else {
|
448
|
-
focusable.value = false;
|
449
|
-
}
|
450
|
-
});
|
451
|
-
useResizeObserver(el$, update);
|
452
|
-
onMounted(() => setTimeout(() => scrollToActiveTab(), 0));
|
453
|
-
onUpdated(() => update());
|
454
|
-
expose({
|
455
|
-
scrollToActiveTab,
|
456
|
-
removeFocus
|
457
|
-
});
|
458
|
-
return () => {
|
459
|
-
const scrollBtn = scrollable.value ? [createVNode("span", {
|
460
|
-
"class": [ns.e("nav-prev"), ns.is("disabled", !scrollable.value.prev)],
|
461
|
-
"onClick": scrollPrev
|
462
|
-
}, [createVNode(ElIcon, null, {
|
463
|
-
default: () => [createVNode(arrow_left_default, null, null)]
|
464
|
-
})]), createVNode("span", {
|
465
|
-
"class": [ns.e("nav-next"), ns.is("disabled", !scrollable.value.next)],
|
466
|
-
"onClick": scrollNext
|
467
|
-
}, [createVNode(ElIcon, null, {
|
468
|
-
default: () => [createVNode(arrow_right_default, null, null)]
|
469
|
-
})])] : null;
|
470
|
-
const tabs = props.panes.map((pane, index2) => {
|
471
|
-
var _a, _b;
|
472
|
-
const uid = pane.uid;
|
473
|
-
const disabled = pane.props.disabled;
|
474
|
-
const tabName = pane.props.name ?? pane.index ?? `${index2}`;
|
475
|
-
pane.index = `${index2}`;
|
476
|
-
const tabLabelContent = ((_b = (_a = pane.slots).label) == null ? void 0 : _b.call(_a)) || pane.props.label;
|
477
|
-
const tabindex = !disabled && pane.active ? 0 : -1;
|
478
|
-
return createVNode("div", {
|
479
|
-
"ref": `tab-${uid}`,
|
480
|
-
"class": [ns.e("item"), ns.is(rootTabs.props.tabPosition), ns.is("active", pane.active), ns.is("disabled", disabled), ns.is("focus", isFocus.value)],
|
481
|
-
"id": `tab-${tabName}`,
|
482
|
-
"key": `tab-${uid}`,
|
483
|
-
"aria-controls": `pane-${tabName}`,
|
484
|
-
"role": "tab",
|
485
|
-
"aria-selected": pane.active,
|
486
|
-
"tabindex": tabindex,
|
487
|
-
"onFocus": () => setFocus(),
|
488
|
-
"onBlur": () => removeFocus(),
|
489
|
-
"onClick": (ev) => {
|
490
|
-
removeFocus();
|
491
|
-
emit("tabClick", pane, tabName, ev);
|
212
|
+
const s = H(Q);
|
213
|
+
s || q(ie, "<o-tabs><o-tab-nav /></o-tabs>");
|
214
|
+
const n = V("tabs"), P = Ge(), d = st(), u = h(), y = h(), v = h(), r = h(), i = h(!1), f = h(0), b = h(!1), o = h(!0), p = F(() => ["top", "bottom"].includes(s.props.tabPosition) ? "width" : "height"), N = F(() => ({
|
215
|
+
transform: `translate${p.value === "width" ? "X" : "Y"}(-${f.value}px)`
|
216
|
+
})), x = () => {
|
217
|
+
if (!u.value) return;
|
218
|
+
const l = u.value[`offset${I(p.value)}`], m = f.value;
|
219
|
+
if (!m) return;
|
220
|
+
const c = m > l ? m - l : 0;
|
221
|
+
f.value = c;
|
222
|
+
}, C = () => {
|
223
|
+
if (!u.value || !y.value) return;
|
224
|
+
const l = y.value[`offset${I(p.value)}`], m = u.value[`offset${I(p.value)}`], c = f.value;
|
225
|
+
if (l - c <= m) return;
|
226
|
+
const w = l - c > m * 2 ? c + m : l - m;
|
227
|
+
f.value = w;
|
228
|
+
}, $ = async () => {
|
229
|
+
const l = y.value;
|
230
|
+
if (!i.value || !v.value || !u.value || !l) return;
|
231
|
+
await K();
|
232
|
+
const m = v.value.querySelector(".is-active");
|
233
|
+
if (!m) return;
|
234
|
+
const c = u.value, w = ["top", "bottom"].includes(s.props.tabPosition), E = m.getBoundingClientRect(), _ = c.getBoundingClientRect(), S = w ? l.offsetWidth - _.width : l.offsetHeight - _.height, T = f.value;
|
235
|
+
let g = T;
|
236
|
+
w ? (E.left < _.left && (g = T - (_.left - E.left)), E.right > _.right && (g = T + E.right - _.right)) : (E.top < _.top && (g = T - (_.top - E.top)), E.bottom > _.bottom && (g = T + (E.bottom - _.bottom))), g = Math.max(g, 0), f.value = Math.min(g, S);
|
237
|
+
}, z = () => {
|
238
|
+
var w;
|
239
|
+
if (!y.value || !u.value) return;
|
240
|
+
e.stretch && ((w = r.value) == null || w.update());
|
241
|
+
const l = y.value[`offset${I(p.value)}`], m = u.value[`offset${I(p.value)}`], c = f.value;
|
242
|
+
m < l ? (i.value = i.value || {}, i.value.prev = c, i.value.next = c + m < l, l - c < m && (f.value = l - m)) : (i.value = !1, c > 0 && (f.value = 0));
|
243
|
+
}, A = (l) => {
|
244
|
+
const m = l.code, {
|
245
|
+
up: c,
|
246
|
+
down: w,
|
247
|
+
left: E,
|
248
|
+
right: _
|
249
|
+
} = je;
|
250
|
+
if (![c, w, E, _].includes(m)) return;
|
251
|
+
const S = Array.from(l.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), T = S.indexOf(l.target);
|
252
|
+
let g;
|
253
|
+
m === E || m === c ? T === 0 ? g = S.length - 1 : g = T - 1 : T < S.length - 1 ? g = T + 1 : g = 0, S[g].focus({
|
254
|
+
preventScroll: !0
|
255
|
+
}), S[g].click(), R();
|
256
|
+
}, R = () => {
|
257
|
+
o.value && (b.value = !0);
|
258
|
+
}, U = () => b.value = !1;
|
259
|
+
return B(P, (l) => {
|
260
|
+
l === "hidden" ? o.value = !1 : l === "visible" && setTimeout(() => o.value = !0, 50);
|
261
|
+
}), B(d, (l) => {
|
262
|
+
l ? setTimeout(() => o.value = !0, 50) : o.value = !1;
|
263
|
+
}), j(v, z), ve(() => setTimeout(() => $(), 0)), Ee(() => z()), t({
|
264
|
+
scrollToActiveTab: $,
|
265
|
+
removeFocus: U
|
266
|
+
}), () => {
|
267
|
+
const l = i.value ? [O("span", {
|
268
|
+
class: [n.e("nav-prev"), n.is("disabled", !i.value.prev)],
|
269
|
+
onClick: x
|
270
|
+
}, [O(J, null, {
|
271
|
+
default: () => [O(Qe, null, null)]
|
272
|
+
})]), O("span", {
|
273
|
+
class: [n.e("nav-next"), n.is("disabled", !i.value.next)],
|
274
|
+
onClick: C
|
275
|
+
}, [O(J, null, {
|
276
|
+
default: () => [O(Ue, null, null)]
|
277
|
+
})])] : null, m = e.panes.map((c, w) => {
|
278
|
+
var X, Y;
|
279
|
+
const E = c.uid, _ = c.props.disabled, S = c.props.name ?? c.index ?? `${w}`;
|
280
|
+
c.index = `${w}`;
|
281
|
+
const T = ((Y = (X = c.slots).label) == null ? void 0 : Y.call(X)) || c.props.label, g = !_ && c.active ? 0 : -1;
|
282
|
+
return O("div", {
|
283
|
+
ref: `tab-${E}`,
|
284
|
+
class: [n.e("item"), n.is(s.props.tabPosition), n.is("active", c.active), n.is("disabled", _), n.is("focus", b.value)],
|
285
|
+
id: `tab-${S}`,
|
286
|
+
key: `tab-${E}`,
|
287
|
+
"aria-controls": `pane-${S}`,
|
288
|
+
role: "tab",
|
289
|
+
"aria-selected": c.active,
|
290
|
+
tabindex: g,
|
291
|
+
onFocus: () => R(),
|
292
|
+
onBlur: () => U(),
|
293
|
+
onClick: (_e) => {
|
294
|
+
U(), a("tabClick", c, S, _e);
|
492
295
|
}
|
493
|
-
}, [
|
296
|
+
}, [T]);
|
494
297
|
});
|
495
|
-
return
|
496
|
-
|
497
|
-
|
498
|
-
}, [
|
499
|
-
|
500
|
-
|
501
|
-
}, [
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
}, [
|
508
|
-
|
509
|
-
|
510
|
-
}, null)
|
298
|
+
return O("div", {
|
299
|
+
ref: v,
|
300
|
+
class: [n.e("nav-wrap"), n.is("scrollable", !!i.value), n.is(s.props.tabPosition)]
|
301
|
+
}, [l, O("div", {
|
302
|
+
class: n.e("nav-scroll"),
|
303
|
+
ref: u
|
304
|
+
}, [O("div", {
|
305
|
+
class: [n.e("nav"), n.is(s.props.tabPosition), n.is("stretch", e.stretch && ["top", "bottom"].includes(s.props.tabPosition))],
|
306
|
+
ref: y,
|
307
|
+
style: N.value,
|
308
|
+
role: "tablist",
|
309
|
+
onKeydown: A
|
310
|
+
}, [e.type ? null : O(ot, {
|
311
|
+
ref: r,
|
312
|
+
tabs: [...e.panes]
|
313
|
+
}, null), m])])]);
|
511
314
|
};
|
512
315
|
}
|
513
|
-
})
|
514
|
-
const tabsProps = buildProps({
|
316
|
+
}), ct = be({
|
515
317
|
/**
|
516
318
|
* @description type of Tab
|
517
319
|
*/
|
@@ -538,183 +340,136 @@ const tabsProps = buildProps({
|
|
538
340
|
* @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented
|
539
341
|
*/
|
540
342
|
beforeLeave: {
|
541
|
-
type:
|
542
|
-
default: () =>
|
343
|
+
type: pe(Function),
|
344
|
+
default: () => !0
|
543
345
|
},
|
544
346
|
/**
|
545
347
|
* @description whether width of tab automatically fits its container
|
546
348
|
*/
|
547
349
|
stretch: Boolean
|
548
|
-
})
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
tabChange: (name) => isPaneName(name)
|
554
|
-
};
|
555
|
-
const Tabs = /* @__PURE__ */ defineComponent({
|
350
|
+
}), le = (e) => Re(e) || ke(e), ut = {
|
351
|
+
[me]: (e) => le(e),
|
352
|
+
tabClick: (e, t) => t instanceof Event,
|
353
|
+
tabChange: (e) => le(e)
|
354
|
+
}, ft = /* @__PURE__ */ M({
|
556
355
|
name: "OTabs",
|
557
|
-
props:
|
558
|
-
emits:
|
559
|
-
setup(
|
560
|
-
emit,
|
561
|
-
slots,
|
562
|
-
expose
|
356
|
+
props: ct,
|
357
|
+
emits: ut,
|
358
|
+
setup(e, {
|
359
|
+
emit: t,
|
360
|
+
slots: a,
|
361
|
+
expose: s
|
563
362
|
}) {
|
564
|
-
const
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
var _a, _b, _c;
|
575
|
-
if (currentName.value === value || isUndefined(value)) return;
|
576
|
-
try {
|
577
|
-
const canLeave = await ((_a = props.beforeLeave) == null ? void 0 : _a.call(props, value, currentName.value));
|
578
|
-
if (canLeave !== false) {
|
579
|
-
currentName.value = value;
|
580
|
-
if (trigger) {
|
581
|
-
emit(UPDATE_MODEL_EVENT, value);
|
582
|
-
emit("tabChange", value);
|
583
|
-
}
|
584
|
-
(_c = (_b = nav$.value) == null ? void 0 : _b.removeFocus) == null ? void 0 : _c.call(_b);
|
363
|
+
const n = V("tabs"), P = F(() => ["left", "right"].includes(e.tabPosition)), {
|
364
|
+
children: d,
|
365
|
+
addChild: u,
|
366
|
+
removeChild: y
|
367
|
+
} = Ae(D(), "OTabPane"), v = h(), r = h(e.modelValue ?? "0"), i = async (o, p = !1) => {
|
368
|
+
var N, x, C;
|
369
|
+
if (!(r.value === o || ze(o)))
|
370
|
+
try {
|
371
|
+
await ((N = e.beforeLeave) == null ? void 0 : N.call(e, o, r.value)) !== !1 && (r.value = o, p && (t(me, o), t("tabChange", o)), (C = (x = v.value) == null ? void 0 : x.removeFocus) == null || C.call(x));
|
372
|
+
} catch {
|
585
373
|
}
|
586
|
-
|
587
|
-
|
374
|
+
}, f = (o, p, N) => {
|
375
|
+
o.props.disabled || (i(p, !0), t("tabClick", o, N));
|
588
376
|
};
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
await nextTick();
|
598
|
-
(_a = nav$.value) == null ? void 0 : _a.scrollToActiveTab();
|
599
|
-
});
|
600
|
-
provide(tabsRootContextKey, {
|
601
|
-
props,
|
602
|
-
currentName,
|
603
|
-
registerPane: (pane) => {
|
604
|
-
panes.value.push(pane);
|
377
|
+
B(() => e.modelValue, (o) => i(o)), B(r, async () => {
|
378
|
+
var o;
|
379
|
+
await K(), (o = v.value) == null || o.scrollToActiveTab();
|
380
|
+
}), we(Q, {
|
381
|
+
props: e,
|
382
|
+
currentName: r,
|
383
|
+
registerPane: (o) => {
|
384
|
+
d.value.push(o);
|
605
385
|
},
|
606
|
-
sortPane,
|
607
|
-
unregisterPane
|
608
|
-
})
|
609
|
-
|
610
|
-
currentName
|
386
|
+
sortPane: u,
|
387
|
+
unregisterPane: y
|
388
|
+
}), s({
|
389
|
+
currentName: r
|
611
390
|
});
|
612
|
-
const
|
613
|
-
render
|
614
|
-
}) =>
|
615
|
-
return render();
|
616
|
-
};
|
391
|
+
const b = ({
|
392
|
+
render: o
|
393
|
+
}) => o();
|
617
394
|
return () => {
|
618
|
-
const
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
}, [
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
stretch: props.stretch,
|
633
|
-
onTabClick: handleTabClick
|
395
|
+
const o = a["left-extra"], p = a["right-extra"], N = O("div", {
|
396
|
+
class: [n.e("header"), P.value && n.e("header-vertical"), n.is(e.tabPosition)]
|
397
|
+
}, [o && O("div", {
|
398
|
+
class: n.e("extra-content-left")
|
399
|
+
}, [L(a, "left-extra")]), O(b, {
|
400
|
+
render: () => {
|
401
|
+
const C = d.value.some(($) => $.slots.label);
|
402
|
+
return O(lt, {
|
403
|
+
ref: v,
|
404
|
+
currentName: r.value,
|
405
|
+
type: e.type,
|
406
|
+
panes: d.value,
|
407
|
+
stretch: e.stretch,
|
408
|
+
onTabClick: f
|
634
409
|
}, {
|
635
|
-
$stable: !
|
410
|
+
$stable: !C
|
636
411
|
});
|
637
412
|
}
|
638
|
-
}, null),
|
639
|
-
|
640
|
-
}, [
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
[
|
647
|
-
[ns.m("border-card")]: props.type === "border-card"
|
413
|
+
}, null), p && O("div", {
|
414
|
+
class: n.e("extra-content-right")
|
415
|
+
}, [L(a, "right-extra")])]), x = O("div", {
|
416
|
+
class: n.e("content")
|
417
|
+
}, [L(a, "default")]);
|
418
|
+
return O("div", {
|
419
|
+
class: [n.b(), n.m(e.tabPosition), {
|
420
|
+
[n.m("card")]: e.type === "card",
|
421
|
+
[n.m("border-card")]: e.type === "border-card"
|
648
422
|
}]
|
649
|
-
}, [
|
423
|
+
}, [x, N]);
|
650
424
|
};
|
651
425
|
}
|
652
|
-
})
|
653
|
-
|
654
|
-
const COMPONENT_NAME = "OTabPane";
|
655
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
656
|
-
...{
|
657
|
-
name: COMPONENT_NAME
|
658
|
-
},
|
426
|
+
}), dt = ["id", "aria-hidden", "aria-labelledby"], ce = "OTabPane", vt = /* @__PURE__ */ M({
|
427
|
+
name: ce,
|
659
428
|
__name: "tab-pane",
|
660
|
-
props:
|
661
|
-
setup(
|
662
|
-
const
|
663
|
-
|
664
|
-
const
|
665
|
-
|
666
|
-
|
667
|
-
const ns = useNamespace("tab-pane");
|
668
|
-
const index2 = ref();
|
669
|
-
const active = computedEager(() => tabsRoot.currentName.value === (props.name ?? index2.value));
|
670
|
-
const loaded = ref(active.value);
|
671
|
-
const paneName = computed(() => props.name ?? index2.value);
|
672
|
-
const shouldBeRender = computedEager(() => !props.lazy || loaded.value || active.value);
|
673
|
-
watch(active, (val) => {
|
674
|
-
if (val) loaded.value = true;
|
675
|
-
});
|
676
|
-
const pane = reactive({
|
677
|
-
uid: instance.uid,
|
678
|
-
slots,
|
679
|
-
props,
|
680
|
-
paneName,
|
681
|
-
active,
|
682
|
-
index: index2
|
429
|
+
props: He,
|
430
|
+
setup(e) {
|
431
|
+
const t = e, a = D(), s = Te(), n = H(Q);
|
432
|
+
n || q(ce, "usage: <o-tabs><o-tab-pane /></o-tabs/>");
|
433
|
+
const P = V("tab-pane"), d = h(), u = Z(() => n.currentName.value === (t.name ?? d.value)), y = h(u.value), v = F(() => t.name ?? d.value), r = Z(() => !t.lazy || y.value || u.value);
|
434
|
+
B(u, (f) => {
|
435
|
+
f && (y.value = !0);
|
683
436
|
});
|
684
|
-
|
685
|
-
|
686
|
-
|
437
|
+
const i = Se({
|
438
|
+
uid: a.uid,
|
439
|
+
slots: s,
|
440
|
+
props: t,
|
441
|
+
paneName: v,
|
442
|
+
active: u,
|
443
|
+
index: d
|
687
444
|
});
|
688
|
-
|
689
|
-
|
690
|
-
})
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
};
|
445
|
+
return n.registerPane(i), ve(() => {
|
446
|
+
n.sortPane(i);
|
447
|
+
}), xe(() => {
|
448
|
+
n.unregisterPane(i.uid);
|
449
|
+
}), (f, b) => k(r) ? $e((ue(), fe("div", {
|
450
|
+
key: 0,
|
451
|
+
id: `pane-${v.value}`,
|
452
|
+
class: de(k(P).b()),
|
453
|
+
role: "tabpanel",
|
454
|
+
"aria-hidden": !k(u),
|
455
|
+
"aria-labelledby": `tab-${v.value}`
|
456
|
+
}, [
|
457
|
+
L(f.$slots, "default")
|
458
|
+
], 10, dt)), [
|
459
|
+
[Ce, k(u)]
|
460
|
+
]) : Ie("", !0);
|
705
461
|
}
|
706
|
-
})
|
707
|
-
|
708
|
-
TabPane: _sfc_main
|
462
|
+
}), kt = Be(ft, {
|
463
|
+
TabPane: vt
|
709
464
|
});
|
710
465
|
export {
|
711
|
-
|
712
|
-
tabBarProps,
|
713
|
-
tabNavEmits,
|
714
|
-
tabNavProps,
|
715
|
-
tabPaneProps,
|
716
|
-
tabsEmits,
|
717
|
-
tabsProps,
|
718
|
-
tabsRootContextKey
|
466
|
+
kt as default,
|
467
|
+
De as tabBarProps,
|
468
|
+
it as tabNavEmits,
|
469
|
+
rt as tabNavProps,
|
470
|
+
He as tabPaneProps,
|
471
|
+
ut as tabsEmits,
|
472
|
+
ct as tabsProps,
|
473
|
+
Q as tabsRootContextKey
|
719
474
|
};
|
720
475
|
//# sourceMappingURL=index.js.map
|