orion-design 0.1.15 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/dist/components/Form/FileInput/FileInput.vue.d.ts +2 -2
  2. package/dist/components/Form/LovInput/LovInput.d.ts +2 -0
  3. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  4. package/dist/components/Form/index.js +337 -320
  5. package/dist/components/Form/index.js.map +1 -1
  6. package/dist/components/LovTable/LovPagetable.vue.d.ts +296 -0
  7. package/dist/components/LovTable/LovQuerytable.vue.d.ts +184 -0
  8. package/dist/components/LovTable/index.d.ts +295 -2
  9. package/dist/components/LovTable/index.js +118 -45
  10. package/dist/components/LovTable/index.js.map +1 -1
  11. package/dist/components/Pagetable/index.js +64 -63
  12. package/dist/components/Pagetable/index.js.map +1 -1
  13. package/dist/components/Querytable/index.js +62 -61
  14. package/dist/components/Querytable/index.js.map +1 -1
  15. package/dist/components/Tabs/constants.d.ts +19 -0
  16. package/dist/components/Tabs/constants.js +5 -0
  17. package/dist/components/Tabs/constants.js.map +1 -0
  18. package/dist/components/Tabs/index.d.ts +74 -0
  19. package/dist/components/Tabs/index.js +475 -0
  20. package/dist/components/Tabs/index.js.map +1 -0
  21. package/dist/components/Tabs/tab-bar.d.ts +59 -0
  22. package/dist/components/Tabs/tab-bar.js +15 -0
  23. package/dist/components/Tabs/tab-bar.js.map +1 -0
  24. package/dist/components/Tabs/tab-bar.vue.d.ts +131 -0
  25. package/dist/components/Tabs/tab-nav.d.ts +237 -0
  26. package/dist/components/Tabs/tab-pane.d.ts +16 -0
  27. package/dist/components/Tabs/tab-pane.js +35 -0
  28. package/dist/components/Tabs/tab-pane.js.map +1 -0
  29. package/dist/components/Tabs/tab-pane.vue.d.ts +43 -0
  30. package/dist/components/Tabs/tabs.d.ts +101 -0
  31. package/dist/components/_constants/aria.d.ts +17 -0
  32. package/dist/components/_constants/aria.js +25 -0
  33. package/dist/components/_constants/aria.js.map +1 -0
  34. package/dist/components/_constants/event.d.ts +3 -0
  35. package/dist/components/_constants/event.js +7 -0
  36. package/dist/components/_constants/event.js.map +1 -0
  37. package/dist/components/_constants/index.d.ts +2 -0
  38. package/dist/components/_constants/index.js +9 -0
  39. package/dist/components/_constants/index.js.map +1 -0
  40. package/dist/components/_hooks/index.d.ts +2 -0
  41. package/dist/components/_hooks/index.js +10 -0
  42. package/dist/components/_hooks/index.js.map +1 -0
  43. package/dist/components/_hooks/use-namespace/index.d.ts +23 -0
  44. package/dist/components/_hooks/use-namespace/index.js +46 -0
  45. package/dist/components/_hooks/use-namespace/index.js.map +1 -0
  46. package/dist/components/_hooks/use-ordered-children/index.d.ts +8 -0
  47. package/dist/components/_hooks/use-ordered-children/index.js +27 -0
  48. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -0
  49. package/dist/components/_util/browser.js +2 -2
  50. package/dist/components/_util/dom/element.js +1 -1
  51. package/dist/components/_util/dom/position.js +1 -1
  52. package/dist/components/_util/dom/scroll.js +1 -1
  53. package/dist/components/_util/dom/style.js +1 -1
  54. package/dist/components/_util/index.js +1 -1
  55. package/dist/components/_util/raf.js +1 -1
  56. package/dist/components/_util/vue/global-node.js +1 -1
  57. package/dist/components/_util/vue/icon.js +24 -146
  58. package/dist/components/_util/vue/icon.js.map +1 -1
  59. package/dist/components/components.d.ts +2 -0
  60. package/dist/components/components.js +13 -11
  61. package/dist/components/components.js.map +1 -1
  62. package/dist/components/index.js +21 -19
  63. package/dist/components/index.js.map +1 -1
  64. package/dist/components-0PErqPHo.js +72 -0
  65. package/dist/{components-DXZmD0GT.js.map → components-0PErqPHo.js.map} +1 -1
  66. package/dist/index-BwWeqwHB.js +164 -0
  67. package/dist/index-BwWeqwHB.js.map +1 -0
  68. package/dist/index-C9tCD90X.js +45 -0
  69. package/dist/{index-C8JNJPWW.js.map → index-C9tCD90X.js.map} +1 -1
  70. package/dist/index.css +1 -1
  71. package/dist/index.js +21 -19
  72. package/dist/index.js.map +1 -1
  73. package/dist/version/version.d.ts +1 -1
  74. package/dist/version/version.js +1 -1
  75. package/dist/version/version.js.map +1 -1
  76. package/global.d.ts +6 -1
  77. package/package.json +3 -1
  78. package/dist/components/LovTable/LovPagetable.d.ts +0 -2
  79. package/dist/components/LovTable/LovQuerytable.d.ts +0 -2
  80. package/dist/components-DXZmD0GT.js +0 -70
  81. package/dist/index-C8JNJPWW.js +0 -8
@@ -0,0 +1,74 @@
1
+ import { default as TabPane } from './tab-pane.vue';
2
+ declare const _default: import('../_util').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
+ readonly type: import('../_util').EpPropFinalized<StringConstructor, "" | "card" | "border-card", unknown, "card", boolean>;
4
+ readonly modelValue: {
5
+ readonly type: import('vue').PropType<import('../_util').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
6
+ readonly required: false;
7
+ readonly validator: ((val: unknown) => boolean) | undefined;
8
+ __epPropKey: true;
9
+ };
10
+ readonly tabPosition: import('../_util').EpPropFinalized<StringConstructor, "top" | "bottom" | "left" | "right", unknown, "top", boolean>;
11
+ readonly beforeLeave: import('../_util').EpPropFinalized<(new (...args: any[]) => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | (() => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | {
12
+ (): (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>;
13
+ new (): any;
14
+ readonly prototype: any;
15
+ } | (((new (...args: any[]) => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | (() => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | {
16
+ (): (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>;
17
+ new (): any;
18
+ readonly prototype: any;
19
+ }) | null)[], unknown, unknown, () => true, boolean>;
20
+ readonly stretch: BooleanConstructor;
21
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ "update:modelValue": (name: import('./tabs').TabPaneName) => name is string | number;
23
+ tabClick: (pane: import('./constants').TabsPaneContext, ev: Event) => boolean;
24
+ tabChange: (name: import('./tabs').TabPaneName) => name is string | number;
25
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
26
+ readonly type: import('../_util').EpPropFinalized<StringConstructor, "" | "card" | "border-card", unknown, "card", boolean>;
27
+ readonly modelValue: {
28
+ readonly type: import('vue').PropType<import('../_util').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
29
+ readonly required: false;
30
+ readonly validator: ((val: unknown) => boolean) | undefined;
31
+ __epPropKey: true;
32
+ };
33
+ readonly tabPosition: import('../_util').EpPropFinalized<StringConstructor, "top" | "bottom" | "left" | "right", unknown, "top", boolean>;
34
+ readonly beforeLeave: import('../_util').EpPropFinalized<(new (...args: any[]) => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | (() => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | {
35
+ (): (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>;
36
+ new (): any;
37
+ readonly prototype: any;
38
+ } | (((new (...args: any[]) => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | (() => (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>) | {
39
+ (): (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>;
40
+ new (): any;
41
+ readonly prototype: any;
42
+ }) | null)[], unknown, unknown, () => true, boolean>;
43
+ readonly stretch: BooleanConstructor;
44
+ }>> & Readonly<{
45
+ "onUpdate:modelValue"?: ((name: import('./tabs').TabPaneName) => any) | undefined;
46
+ onTabClick?: ((pane: {
47
+ uid: number;
48
+ slots: import('vue').Slots;
49
+ props: {
50
+ readonly label: string;
51
+ readonly disabled: boolean;
52
+ readonly closable: boolean;
53
+ readonly lazy: boolean;
54
+ readonly name?: import('../_util').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown> | undefined;
55
+ };
56
+ paneName: string | number | undefined;
57
+ active: boolean;
58
+ index: string | undefined;
59
+ }, ev: Event) => any) | undefined;
60
+ onTabChange?: ((name: import('./tabs').TabPaneName) => any) | undefined;
61
+ }>, {
62
+ readonly stretch: boolean;
63
+ readonly type: import('../_util').EpPropMergeType<StringConstructor, "" | "card" | "border-card", unknown>;
64
+ readonly tabPosition: import('../_util').EpPropMergeType<StringConstructor, "top" | "bottom" | "left" | "right", unknown>;
65
+ readonly beforeLeave: (newName: import('./tabs').TabPaneName, oldName: import('./tabs').TabPaneName) => import('../_util').Awaitable<void | boolean>;
66
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>> & {
67
+ TabPane: typeof TabPane;
68
+ };
69
+ export default _default;
70
+ export * from './tabs';
71
+ export * from './tab-bar';
72
+ export * from './tab-nav';
73
+ export * from './tab-pane';
74
+ export * from './constants';
@@ -0,0 +1,475 @@
1
+ import "lodash-es";
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-BwWeqwHB.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
+ }
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();
37
+ };
38
+ return he(v), v;
39
+ }
40
+ function qe(e, t = !1) {
41
+ const a = h(), s = () => a.value = !!e();
42
+ return s(), Me(s, t), a;
43
+ }
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;
53
+ }
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;
62
+ };
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();
72
+ };
73
+ return he(r), {
74
+ isSupported: u,
75
+ stop: r
76
+ };
77
+ }
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;
89
+ };
90
+ const nt = {
91
+ easeInSine: [0.12, 0, 0.39, 0],
92
+ easeOutSine: [0.61, 1, 0.88, 1],
93
+ easeInOutSine: [0.37, 0, 0.63, 1],
94
+ easeInQuad: [0.11, 0, 0.5, 0],
95
+ easeOutQuad: [0.5, 1, 0.89, 1],
96
+ easeInOutQuad: [0.45, 0, 0.55, 1],
97
+ easeInCubic: [0.32, 0, 0.67, 0],
98
+ easeOutCubic: [0.33, 1, 0.68, 1],
99
+ easeInOutCubic: [0.65, 0, 0.35, 1],
100
+ easeInQuart: [0.5, 0, 0.75, 0],
101
+ easeOutQuart: [0.25, 1, 0.5, 1],
102
+ easeInOutQuart: [0.76, 0, 0.24, 1],
103
+ easeInQuint: [0.64, 0, 0.78, 0],
104
+ easeOutQuint: [0.22, 1, 0.36, 1],
105
+ easeInOutQuint: [0.83, 0, 0.17, 1],
106
+ easeInExpo: [0.7, 0, 0.84, 0],
107
+ easeOutExpo: [0.16, 1, 0.3, 1],
108
+ easeInOutExpo: [0.87, 0, 0.13, 1],
109
+ easeInCirc: [0.55, 0, 1, 0.45],
110
+ easeOutCirc: [0, 0.55, 0.45, 1],
111
+ easeInOutCirc: [0.85, 0, 0.15, 1],
112
+ easeInBack: [0.36, 0, 0.66, -0.56],
113
+ easeOutBack: [0.34, 1.56, 0.64, 1],
114
+ easeInOutBack: [0.68, -0.6, 0.32, 1.6]
115
+ };
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;
128
+ }
129
+ const re = "OTabBar", ot = /* @__PURE__ */ M({
130
+ name: re,
131
+ __name: "tab-bar",
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)`
151
+ };
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));
161
+ }
162
+ }
163
+ };
164
+ B(
165
+ () => a.tabs,
166
+ async () => {
167
+ await K(), v(), i();
168
+ },
169
+ { immediate: !0 }
170
+ );
171
+ const f = j(d, () => v());
172
+ return Pe(() => {
173
+ r.forEach((b) => b.stop()), r.length = 0, f.stop();
174
+ }), t({
175
+ /** @description tab root html element */
176
+ ref: d,
177
+ /** @description method to manually update tab bar style */
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));
185
+ }
186
+ }), rt = be({
187
+ panes: {
188
+ type: pe(Array),
189
+ default: () => We([])
190
+ },
191
+ currentName: {
192
+ type: [String, Number],
193
+ default: ""
194
+ },
195
+ type: {
196
+ type: String,
197
+ values: ["card", "border-card", ""],
198
+ default: "card"
199
+ },
200
+ stretch: Boolean
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
211
+ }) {
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);
295
+ }
296
+ }, [T]);
297
+ });
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])])]);
314
+ };
315
+ }
316
+ }), ct = be({
317
+ /**
318
+ * @description type of Tab
319
+ */
320
+ type: {
321
+ type: String,
322
+ values: ["card", "border-card", ""],
323
+ default: "card"
324
+ },
325
+ /**
326
+ * @description binding value, name of the selected tab
327
+ */
328
+ modelValue: {
329
+ type: [String, Number]
330
+ },
331
+ /**
332
+ * @description position of tabs
333
+ */
334
+ tabPosition: {
335
+ type: String,
336
+ values: ["top", "right", "bottom", "left"],
337
+ default: "top"
338
+ },
339
+ /**
340
+ * @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented
341
+ */
342
+ beforeLeave: {
343
+ type: pe(Function),
344
+ default: () => !0
345
+ },
346
+ /**
347
+ * @description whether width of tab automatically fits its container
348
+ */
349
+ stretch: Boolean
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({
355
+ name: "OTabs",
356
+ props: ct,
357
+ emits: ut,
358
+ setup(e, {
359
+ emit: t,
360
+ slots: a,
361
+ expose: s
362
+ }) {
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 {
373
+ }
374
+ }, f = (o, p, N) => {
375
+ o.props.disabled || (i(p, !0), t("tabClick", o, N));
376
+ };
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);
385
+ },
386
+ sortPane: u,
387
+ unregisterPane: y
388
+ }), s({
389
+ currentName: r
390
+ });
391
+ const b = ({
392
+ render: o
393
+ }) => o();
394
+ return () => {
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
409
+ }, {
410
+ $stable: !C
411
+ });
412
+ }
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"
422
+ }]
423
+ }, [x, N]);
424
+ };
425
+ }
426
+ }), dt = ["id", "aria-hidden", "aria-labelledby"], ce = "OTabPane", vt = /* @__PURE__ */ M({
427
+ name: ce,
428
+ __name: "tab-pane",
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);
436
+ });
437
+ const i = Se({
438
+ uid: a.uid,
439
+ slots: s,
440
+ props: t,
441
+ paneName: v,
442
+ active: u,
443
+ index: d
444
+ });
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);
461
+ }
462
+ }), kt = Be(ft, {
463
+ TabPane: vt
464
+ });
465
+ export {
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
474
+ };
475
+ //# sourceMappingURL=index.js.map