@aplus-frontend/ui 0.5.31 → 0.5.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/es/index.mjs +104 -100
  2. package/es/src/ap-grid/constants.d.ts +1 -0
  3. package/es/src/ap-grid/constants.mjs +4 -3
  4. package/es/src/ap-grid/editable/style/css.js +1 -0
  5. package/es/src/ap-grid/editable/style/index.js +1 -0
  6. package/es/src/ap-grid/index.d.ts +1 -0
  7. package/es/src/ap-grid/index.mjs +4 -0
  8. package/es/src/ap-grid/index.vue.mjs +94 -94
  9. package/es/src/ap-grid/utils/col.mjs +77 -88
  10. package/es/src/business/ap-product-info/ApProductInfo.mjs +33 -27
  11. package/es/src/index.d.ts +1 -0
  12. package/es/src/index.mjs +247 -243
  13. package/es/src/path-map.mjs +2 -1
  14. package/es/src/splitter/Panel.vue.d.ts +21 -0
  15. package/es/src/splitter/Panel.vue.mjs +4 -0
  16. package/es/src/splitter/Panel.vue2.mjs +36 -0
  17. package/es/src/splitter/SplitBar.vue.d.ts +4 -0
  18. package/es/src/splitter/SplitBar.vue.mjs +4 -0
  19. package/es/src/splitter/SplitBar.vue2.mjs +129 -0
  20. package/es/src/splitter/Splitter.vue.d.ts +6 -0
  21. package/es/src/splitter/Splitter.vue.mjs +4 -0
  22. package/es/src/splitter/Splitter.vue2.mjs +131 -0
  23. package/es/src/splitter/_Panel.vue.d.ts +4 -0
  24. package/es/src/splitter/_Panel.vue.mjs +4 -0
  25. package/es/src/splitter/_Panel.vue2.mjs +22 -0
  26. package/es/src/splitter/hooks/useItems.d.ts +10 -0
  27. package/es/src/splitter/hooks/useItems.mjs +26 -0
  28. package/es/src/splitter/hooks/useResizable.d.ts +8 -0
  29. package/es/src/splitter/hooks/useResizable.mjs +37 -0
  30. package/es/src/splitter/hooks/useResize.d.ts +4 -0
  31. package/es/src/splitter/hooks/useResize.mjs +72 -0
  32. package/es/src/splitter/hooks/useSizes.d.ts +4 -0
  33. package/es/src/splitter/hooks/useSizes.mjs +58 -0
  34. package/es/src/splitter/index.d.ts +8 -0
  35. package/es/src/splitter/index.mjs +10 -0
  36. package/es/src/splitter/interface.d.ts +70 -0
  37. package/es/src/splitter/interface.mjs +1 -0
  38. package/es/src/splitter/style/css.d.ts +0 -0
  39. package/es/src/splitter/style/css.js +1 -0
  40. package/es/src/splitter/style/index.d.ts +0 -0
  41. package/es/src/splitter/style/index.js +1 -0
  42. package/lib/index.js +1 -1
  43. package/lib/src/ap-grid/constants.d.ts +1 -0
  44. package/lib/src/ap-grid/constants.js +1 -1
  45. package/lib/src/ap-grid/editable/style/css.cjs +1 -0
  46. package/lib/src/ap-grid/editable/style/index.cjs +1 -0
  47. package/lib/src/ap-grid/index.d.ts +1 -0
  48. package/lib/src/ap-grid/index.js +1 -1
  49. package/lib/src/ap-grid/index.vue.js +1 -1
  50. package/lib/src/ap-grid/utils/col.js +1 -1
  51. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  52. package/lib/src/index.d.ts +1 -0
  53. package/lib/src/index.js +1 -1
  54. package/lib/src/path-map.js +1 -1
  55. package/lib/src/splitter/Panel.vue.d.ts +21 -0
  56. package/lib/src/splitter/Panel.vue.js +1 -0
  57. package/lib/src/splitter/Panel.vue2.js +1 -0
  58. package/lib/src/splitter/SplitBar.vue.d.ts +4 -0
  59. package/lib/src/splitter/SplitBar.vue.js +1 -0
  60. package/lib/src/splitter/SplitBar.vue2.js +1 -0
  61. package/lib/src/splitter/Splitter.vue.d.ts +6 -0
  62. package/lib/src/splitter/Splitter.vue.js +1 -0
  63. package/lib/src/splitter/Splitter.vue2.js +1 -0
  64. package/lib/src/splitter/_Panel.vue.d.ts +4 -0
  65. package/lib/src/splitter/_Panel.vue.js +1 -0
  66. package/lib/src/splitter/_Panel.vue2.js +1 -0
  67. package/lib/src/splitter/hooks/useItems.d.ts +10 -0
  68. package/lib/src/splitter/hooks/useItems.js +1 -0
  69. package/lib/src/splitter/hooks/useResizable.d.ts +8 -0
  70. package/lib/src/splitter/hooks/useResizable.js +1 -0
  71. package/lib/src/splitter/hooks/useResize.d.ts +4 -0
  72. package/lib/src/splitter/hooks/useResize.js +1 -0
  73. package/lib/src/splitter/hooks/useSizes.d.ts +4 -0
  74. package/lib/src/splitter/hooks/useSizes.js +1 -0
  75. package/lib/src/splitter/index.d.ts +8 -0
  76. package/lib/src/splitter/index.js +1 -0
  77. package/lib/src/splitter/interface.d.ts +70 -0
  78. package/lib/src/splitter/interface.js +1 -0
  79. package/lib/src/splitter/style/css.cjs +1 -0
  80. package/lib/src/splitter/style/css.d.ts +0 -0
  81. package/lib/src/splitter/style/index.cjs +1 -0
  82. package/lib/src/splitter/style/index.d.ts +0 -0
  83. package/package.json +1 -1
  84. package/theme/ap-grid/index.css +9 -0
  85. package/theme/ap-grid/index.less +10 -0
  86. package/theme/ap-product-info/ap-product-info.css +0 -1
  87. package/theme/ap-product-info/ap-product-info.less +1 -1
  88. package/theme/index.css +243 -5
  89. package/theme/index.less +1 -0
  90. package/theme/mixins/config.less +11 -0
  91. package/theme/splitter/index.css +230 -0
  92. package/theme/splitter/index.less +240 -0
@@ -97,7 +97,8 @@ const e = {
97
97
  EditableGrid: ["ap-grid", "editable"],
98
98
  EditableGridFormItem: ["ap-grid", "editable"],
99
99
  ApText: ["text"],
100
- Mask: ["mask"]
100
+ Mask: ["mask"],
101
+ Splitter: ["splitter"]
101
102
  };
102
103
  export {
103
104
  e as default
@@ -0,0 +1,21 @@
1
+ import { PanelProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, CSSProperties, ComponentProvideOptions } from 'vue';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: {
6
+ default?(_: {}): any;
7
+ };
8
+ refs: {};
9
+ rootEl: HTMLDivElement;
10
+ };
11
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
+ declare const __VLS_component: DefineComponent<PanelProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<PanelProps> & Readonly<{}>, {
13
+ style: CSSProperties;
14
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
15
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
+ export default _default;
17
+ type __VLS_WithTemplateSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Panel.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,36 @@
1
+ import { defineComponent as n, computed as r, createElementBlock as i, openBlock as p, normalizeStyle as m, normalizeClass as c, unref as s, renderSlot as u } from "vue";
2
+ import "../config-provider/index.mjs";
3
+ import { useNamespace as d } from "../config-provider/hooks/use-namespace.mjs";
4
+ const B = /* @__PURE__ */ n({
5
+ name: "InternalSplitterPanel",
6
+ __name: "Panel",
7
+ props: {
8
+ className: {},
9
+ style: { default: () => ({}) },
10
+ min: {},
11
+ max: {},
12
+ size: {},
13
+ collapsible: { type: [Boolean, Object] },
14
+ resizable: { type: Boolean },
15
+ defaultSize: {}
16
+ },
17
+ setup(a) {
18
+ const t = a, { b: l } = d("splitter-panel"), o = r(() => {
19
+ const e = t.size !== void 0;
20
+ return {
21
+ ...t.style,
22
+ flexBasis: e ? `${t.size}px` : "auto",
23
+ flexGrow: e ? 0 : 1
24
+ };
25
+ });
26
+ return (e, f) => (p(), i("div", {
27
+ class: c([s(l)(), { [s(l)("hidden")]: e.size === 0 }, e.className]),
28
+ style: m(o.value)
29
+ }, [
30
+ u(e.$slots, "default")
31
+ ], 6));
32
+ }
33
+ });
34
+ export {
35
+ B as default
36
+ };
@@ -0,0 +1,4 @@
1
+ import { SplitBarProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare const _default: DefineComponent<SplitBarProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SplitBarProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import f from "./SplitBar.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,129 @@
1
+ import { defineComponent as U, ref as z, computed as w, unref as t, watchEffect as V, createElementBlock as h, openBlock as y, normalizeClass as s, createCommentVNode as O, createElementVNode as T, normalizeStyle as F, createVNode as C } from "vue";
2
+ import "../config-provider/index.mjs";
3
+ import { UpOutlined as A, LeftOutlined as D, DownOutlined as I, RightOutlined as R } from "@ant-design/icons-vue";
4
+ import { useNamespace as $ } from "../config-provider/hooks/use-namespace.mjs";
5
+ const j = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], K = /* @__PURE__ */ U({
6
+ __name: "SplitBar",
7
+ props: {
8
+ index: {},
9
+ active: { type: Boolean },
10
+ resizable: { type: Boolean },
11
+ startCollapsible: { type: Boolean },
12
+ endCollapsible: { type: Boolean },
13
+ onOffsetStart: { type: Function },
14
+ onOffsetUpdate: { type: Function },
15
+ onOffsetEnd: {},
16
+ onCollapse: { type: Function },
17
+ vertical: { type: Boolean },
18
+ ariaNow: {},
19
+ ariaMin: {},
20
+ ariaMax: {},
21
+ lazy: { type: Boolean },
22
+ containerSize: {}
23
+ },
24
+ setup(x) {
25
+ function g(o) {
26
+ return typeof o == "number" && !Number.isNaN(o) ? Math.round(o) : 0;
27
+ }
28
+ const e = x, { b: n, cssVar: L } = $("splitter-bar"), p = z(null), l = z(0), N = w(
29
+ () => e.vertical ? 0 : t(l)
30
+ ), S = w(
31
+ () => e.vertical ? t(l) : 0
32
+ ), B = (o) => {
33
+ e.resizable && o.currentTarget && (p.value = [o.pageX, o.pageY], e.onOffsetStart(e.index));
34
+ }, k = (o) => {
35
+ if (e.resizable && o.touches.length === 1) {
36
+ const a = o.touches[0];
37
+ p.value = [a.pageX, a.pageY], e.onOffsetStart(e.index);
38
+ }
39
+ }, X = (o) => {
40
+ const { containerSize: a, ariaMax: i, ariaMin: v, ariaNow: m } = e, f = a * m / 100, r = f + o, c = Math.max(0, a * v / 100), d = Math.max(
41
+ a,
42
+ a * i / 100
43
+ );
44
+ return Math.max(c, Math.min(d, r)) - f;
45
+ }, b = (o, a) => {
46
+ const i = X(
47
+ e.vertical ? a : o
48
+ );
49
+ l.value = i;
50
+ }, M = () => {
51
+ e.onOffsetUpdate(
52
+ e.index,
53
+ t(N),
54
+ t(S)
55
+ ), l.value = 0;
56
+ };
57
+ V(
58
+ (o) => {
59
+ const a = t(p);
60
+ if (a) {
61
+ const i = (r) => {
62
+ const { pageX: c, pageY: d } = r, u = c - a[0], E = d - a[1];
63
+ e.lazy ? b(u, E) : e.onOffsetUpdate(e.index, u, E);
64
+ }, v = () => {
65
+ e.lazy && M(), p.value = null, e.onOffsetEnd();
66
+ }, m = (r) => {
67
+ if (r.touches.length === 1) {
68
+ const c = r.touches[0], d = c.pageX - a[0], u = c.pageY - a[1];
69
+ e.lazy ? b(d, u) : e.onOffsetUpdate(e.index, d, u);
70
+ }
71
+ }, f = () => {
72
+ e.lazy && M(), p.value = null, e.onOffsetEnd();
73
+ };
74
+ window.addEventListener("touchmove", m), window.addEventListener("touchend", f), window.addEventListener("mousemove", i), window.addEventListener("mouseup", v), o(() => {
75
+ window.removeEventListener("touchmove", m), window.removeEventListener("touchend", f), window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", v);
76
+ });
77
+ }
78
+ },
79
+ { flush: "post" }
80
+ );
81
+ const Y = w(
82
+ () => e.vertical ? A : D
83
+ ), P = w(
84
+ () => e.vertical ? I : R
85
+ );
86
+ return (o, a) => (y(), h("div", {
87
+ class: s(t(n)()),
88
+ role: "separator",
89
+ "aria-valuenow": g(e.ariaNow),
90
+ "aria-valuemin": g(e.ariaMin),
91
+ "aria-valuemax": g(e.ariaMax)
92
+ }, [
93
+ e.lazy ? (y(), h("div", {
94
+ key: 0,
95
+ class: s([t(n)("preview"), { [t(n)("preview-active")]: !!l.value }]),
96
+ style: F(t(L)({ "preview-offset": `${l.value}px` }))
97
+ }, null, 6)) : O("", !0),
98
+ T("div", {
99
+ class: s([
100
+ t(n)("dragger"),
101
+ { [t(n)("dragger-disabled")]: !o.resizable, [t(n)("dragger-active")]: o.active }
102
+ ]),
103
+ onMousedown: B,
104
+ onTouchstart: k
105
+ }, null, 34),
106
+ o.startCollapsible ? (y(), h("div", {
107
+ key: 1,
108
+ class: s([t(n)("collapse-bar"), t(n)("collapse-bar-start")]),
109
+ onClick: a[0] || (a[0] = () => o.onCollapse(o.index, "start"))
110
+ }, [
111
+ C(t(Y), {
112
+ class: s([t(n)("collapse-icon"), t(n)("collapse-start")])
113
+ }, null, 8, ["class"])
114
+ ], 2)) : O("", !0),
115
+ o.endCollapsible ? (y(), h("div", {
116
+ key: 2,
117
+ class: s([t(n)("collapse-bar"), t(n)("collapse-bar-end")]),
118
+ onClick: a[1] || (a[1] = () => o.onCollapse(o.index, "end"))
119
+ }, [
120
+ C(t(P), {
121
+ class: s([t(n)("collapse-icon"), t(n)("collapse-end")])
122
+ }, null, 8, ["class"])
123
+ ], 2)) : O("", !0)
124
+ ], 10, j));
125
+ }
126
+ });
127
+ export {
128
+ K as default
129
+ };
@@ -0,0 +1,6 @@
1
+ import { SplitterProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare const _default: DefineComponent<SplitterProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SplitterProps> & Readonly<{}>, {
4
+ layout: "horizontal" | "vertical";
5
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import f from "./Splitter.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,131 @@
1
+ import { defineComponent as j, ref as q, unref as n, computed as _, createBlock as y, openBlock as i, withCtx as g, createElementVNode as G, normalizeClass as b, normalizeStyle as J, createElementBlock as u, createCommentVNode as h, Fragment as d, renderList as k, createVNode as K, mergeProps as Q, resolveDynamicComponent as T } from "vue";
2
+ import { useItems as X } from "./hooks/useItems.mjs";
3
+ import "../resize-observer/index.mjs";
4
+ import { useSizes as Y } from "./hooks/useSizes.mjs";
5
+ import { useResizable as Z } from "./hooks/useResizable.mjs";
6
+ import { useResize as x } from "./hooks/useResize.mjs";
7
+ import "../config-provider/index.mjs";
8
+ import "./Panel.vue.mjs";
9
+ import "./SplitBar.vue.mjs";
10
+ import { omit as ee } from "lodash-unified";
11
+ import { useNamespace as te } from "../config-provider/hooks/use-namespace.mjs";
12
+ import ae from "../resize-observer/index.vue.mjs";
13
+ import ne from "./Panel.vue2.mjs";
14
+ import oe from "./SplitBar.vue2.mjs";
15
+ const Ce = /* @__PURE__ */ j({
16
+ __name: "Splitter",
17
+ props: {
18
+ prefixCls: {},
19
+ className: {},
20
+ style: {},
21
+ rootClassName: {},
22
+ layout: { default: "horizontal" },
23
+ onResizeStart: {},
24
+ onResize: {},
25
+ onResizeEnd: {},
26
+ lazy: { type: Boolean }
27
+ },
28
+ setup(E) {
29
+ const a = E, { b: f } = te("splitter"), l = X(), m = q(), N = (e) => {
30
+ const { offsetWidth: o, offsetHeight: s } = e.target, t = a.layout === "vertical" ? s : o;
31
+ m.value !== 0 && (m.value = t);
32
+ }, [
33
+ I,
34
+ p,
35
+ v,
36
+ O,
37
+ P,
38
+ M
39
+ ] = Y(l, m), c = Z(l, p, !1), [B, U, $, w, C] = x(
40
+ l,
41
+ c,
42
+ v,
43
+ m,
44
+ M,
45
+ !1
46
+ ), V = (e) => {
47
+ var o;
48
+ B(e), (o = a.onResizeStart) == null || o.call(a, n(p));
49
+ }, A = (e, o) => {
50
+ var t;
51
+ const s = U(e, o);
52
+ (t = a.onResize) == null || t.call(a, s);
53
+ }, D = () => {
54
+ var e;
55
+ $(), (e = a.onResizeEnd) == null || e.call(a, n(p));
56
+ }, F = (e, o) => {
57
+ var t, r;
58
+ const s = w(e, o);
59
+ (t = a.onResize) == null || t.call(a, s), (r = a.onResizeEnd) == null || r.call(a, s);
60
+ }, H = _(() => [f(), a.className, f(a.layout)]), R = _(() => {
61
+ const e = [];
62
+ let o = 0;
63
+ for (let s = 0; s < l.value.length; s += 1)
64
+ o += n(v)[s], e.push(o);
65
+ return e;
66
+ }), z = (e) => {
67
+ const o = n(R), s = n(O), t = n(P);
68
+ return {
69
+ minStart: (o[e - 1] || 0) + s[e],
70
+ minEnd: (o[e + 1] || 100) - t[e + 1],
71
+ maxStart: (o[e - 1] || 0) + t[e],
72
+ maxEnd: (o[e + 1] || 100) - s[e + 1]
73
+ };
74
+ };
75
+ return (e, o) => (i(), y(n(ae), { onResize: N }, {
76
+ default: g(() => [
77
+ G("div", {
78
+ style: J(e.style),
79
+ class: b(H.value)
80
+ }, [
81
+ (i(!0), u(d, null, k(n(l), (s, t) => (i(), u(d, { key: t }, [
82
+ K(ne, Q({ ref_for: !0 }, n(ee)(s, "_child"), {
83
+ size: n(I)[t]
84
+ }), {
85
+ default: g(() => [
86
+ (i(!0), u(d, null, k(s._child, (r, S) => (i(), y(T(r), { key: S }))), 128))
87
+ ]),
88
+ _: 2
89
+ }, 1040, ["size"]),
90
+ n(c)[t] ? (i(), y(oe, {
91
+ key: 0,
92
+ lazy: e.lazy,
93
+ index: t,
94
+ active: n(C) === t,
95
+ vertical: e.layout === "vertical",
96
+ resizable: n(c)[t].resizable,
97
+ "aria-now": R.value[t] * 100,
98
+ "aria-min": Math.max(
99
+ z(t).minStart,
100
+ z(t).minEnd
101
+ ) * 100,
102
+ "aria-max": Math.min(
103
+ z(t).maxStart,
104
+ z(t).maxEnd
105
+ ) * 100,
106
+ "start-collapsible": n(c)[t].startCollapsible,
107
+ "end-collapsible": n(c)[t].endCollapsible,
108
+ "container-size": m.value || 0,
109
+ onOffsetStart: V,
110
+ onOffsetUpdate: (r, S, L) => {
111
+ let W = e.layout === "vertical" ? L : S;
112
+ A(r, W);
113
+ },
114
+ onOffsetEnd: D,
115
+ onCollapse: F
116
+ }, null, 8, ["lazy", "index", "active", "vertical", "resizable", "aria-now", "aria-min", "aria-max", "start-collapsible", "end-collapsible", "container-size", "onOffsetUpdate"])) : h("", !0)
117
+ ], 64))), 128)),
118
+ typeof n(C) == "number" ? (i(), u("div", {
119
+ key: 0,
120
+ "aria-hidden": "",
121
+ class: b([n(f)("mask"), n(f)(`mask-${e.layout}`)])
122
+ }, null, 2)) : h("", !0)
123
+ ], 6)
124
+ ]),
125
+ _: 1
126
+ }));
127
+ }
128
+ });
129
+ export {
130
+ Ce as default
131
+ };
@@ -0,0 +1,4 @@
1
+ import { PanelProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ declare const _default: DefineComponent<PanelProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<PanelProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import f from "./_Panel.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as e } from "vue";
2
+ const l = /* @__PURE__ */ e({
3
+ name: "SplitterPanel",
4
+ __name: "_Panel",
5
+ props: {
6
+ className: {},
7
+ style: {},
8
+ min: {},
9
+ max: {},
10
+ size: {},
11
+ collapsible: { type: [Boolean, Object] },
12
+ resizable: { type: Boolean },
13
+ defaultSize: {}
14
+ },
15
+ setup(a) {
16
+ return () => {
17
+ };
18
+ }
19
+ });
20
+ export {
21
+ l as default
22
+ };
@@ -0,0 +1,10 @@
1
+ import { VNode, ComputedRef } from 'vue';
2
+ import { PanelProps } from '../interface';
3
+ export type ItemType = Omit<PanelProps, 'collapsible'> & {
4
+ collapsible: {
5
+ start?: boolean;
6
+ end?: boolean;
7
+ };
8
+ _child: VNode[];
9
+ };
10
+ export declare const useItems: () => ComputedRef<ItemType[]>;
@@ -0,0 +1,26 @@
1
+ import { useSlots as u, computed as d } from "vue";
2
+ import { genRealChildren as l } from "../../ap-form/item-group/helper.mjs";
3
+ function c(t) {
4
+ if (t && typeof t == "object")
5
+ return t;
6
+ const e = !!t || t === "";
7
+ return {
8
+ start: e,
9
+ end: e
10
+ };
11
+ }
12
+ const m = () => {
13
+ const t = u();
14
+ return d(() => t.default ? l(t.default()).map((r) => {
15
+ var o, s;
16
+ const { props: n } = r;
17
+ return {
18
+ ...n,
19
+ collapsible: c(n.collapsible),
20
+ _child: (s = (o = r.children).default) == null ? void 0 : s.call(o)
21
+ };
22
+ }) : []);
23
+ };
24
+ export {
25
+ m as useItems
26
+ };
@@ -0,0 +1,8 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ItemType } from './useItems';
3
+ export type ResizableInfo = {
4
+ resizable: boolean;
5
+ startCollapsible: boolean;
6
+ endCollapsible: boolean;
7
+ };
8
+ export declare const useResizable: (items: Ref<ItemType[]>, pxSizes: Ref<number[]>, isRTL: boolean) => ComputedRef<ResizableInfo[]>;
@@ -0,0 +1,37 @@
1
+ import { computed as R, unref as b } from "vue";
2
+ const g = (z, m, n) => R(() => {
3
+ const o = [], l = b(z), i = b(m);
4
+ for (let e = 0; e < l.length - 1; e += 1) {
5
+ const u = l[e], x = l[e + 1], t = i[e], s = i[e + 1], {
6
+ resizable: d = !0,
7
+ min: C,
8
+ collapsible: r
9
+ } = u, {
10
+ resizable: v = !0,
11
+ min: f,
12
+ collapsible: a
13
+ } = x, I = (
14
+ // Both need to be resizable
15
+ d && v && // Prev is not collapsed and limit min size
16
+ (t !== 0 || !C) && // Next is not collapsed and limit min size
17
+ (s !== 0 || !f)
18
+ ), p = (
19
+ // Self is collapsible
20
+ r.end && t > 0 || // Collapsed and can be collapsed
21
+ a.start && s === 0 && t > 0
22
+ ), c = (
23
+ // Self is collapsible
24
+ a.start && s > 0 || // Collapsed and can be collapsed
25
+ r.end && t === 0 && s > 0
26
+ );
27
+ o[e] = {
28
+ resizable: I,
29
+ startCollapsible: !!(n ? c : p),
30
+ endCollapsible: !!(n ? p : c)
31
+ };
32
+ }
33
+ return o;
34
+ });
35
+ export {
36
+ g as useResizable
37
+ };
@@ -0,0 +1,4 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ItemType } from './useItems';
3
+ import { ResizableInfo } from './useResizable';
4
+ export declare const useResize: (items: Ref<ItemType[]>, resizableInfos: Ref<ResizableInfo[]>, percentSizes: Ref<number[]>, containerSize: Ref<number | undefined>, updateSizes: (sizes: number[]) => void, isRTL: boolean) => readonly [(index: number) => void, (index: number, offset: number) => number[], () => void, (index: number, type: "start" | "end") => number[], ComputedRef<number | undefined>];
@@ -0,0 +1,72 @@
1
+ import { unref as m, computed as P, ref as _ } from "vue";
2
+ import { getPtg as T } from "./useSizes.mjs";
3
+ const J = (j, k, y, L, O, R) => {
4
+ const a = m(j).map((e) => [e.min, e.max]), x = P(() => m(L) || 0), v = (e) => e * x.value;
5
+ function l(e, f) {
6
+ return typeof e == "string" ? v(T(e)) : e ?? f;
7
+ }
8
+ const I = _([]), E = [], S = _(null), U = () => m(y).map(v);
9
+ return [
10
+ (e) => {
11
+ I.value = U(), S.value = {
12
+ index: e,
13
+ confirmed: !1
14
+ };
15
+ },
16
+ (e, f) => {
17
+ let n = null;
18
+ const u = m(S), r = m(I), i = m(x);
19
+ if ((!u || !u.confirmed) && f !== 0) {
20
+ if (f > 0)
21
+ n = e, S.value = {
22
+ index: e,
23
+ confirmed: !0
24
+ };
25
+ else
26
+ for (let d = e; d >= 0; d -= 1)
27
+ if (r[d] > 0 && m(k)[d].resizable) {
28
+ n = d, S.value = {
29
+ index: d,
30
+ confirmed: !0
31
+ };
32
+ break;
33
+ }
34
+ }
35
+ const s = n ?? (u == null ? void 0 : u.index) ?? e, t = [...r], c = s + 1, z = l(a[s][0], 0), g = l(a[c][0], 0), p = l(
36
+ a[s][1],
37
+ i
38
+ ), h = l(
39
+ a[c][1],
40
+ i
41
+ );
42
+ let o = f;
43
+ return t[s] + o < z && (o = z - t[s]), t[c] - o < g && (o = t[c] - g), t[s] + o > p && (o = p - t[s]), t[c] - o > h && (o = t[c] - h), t[s] += o, t[c] -= o, O(t), t;
44
+ },
45
+ () => {
46
+ S.value = null;
47
+ },
48
+ (e, f) => {
49
+ const n = U(), u = R ? f === "start" ? "end" : "start" : f, r = u === "start" ? e : e + 1, i = u === "start" ? e + 1 : e, s = n[r], t = n[i];
50
+ if (s !== 0 && t !== 0)
51
+ n[r] = 0, n[i] += s, E[e] = s;
52
+ else {
53
+ const c = m(x), z = s + t, g = l(a[r][0], 0), p = l(
54
+ a[r][1],
55
+ c
56
+ ), h = l(a[i][0], 0), o = l(
57
+ a[i][1],
58
+ c
59
+ ), d = Math.max(g, z - o), b = (Math.min(p, z - h) - d) / 2, C = E[e], M = z - C;
60
+ C && C <= o && C >= h && M <= p && M >= g ? (n[i] = C, n[r] = M) : (n[r] -= b, n[i] += b);
61
+ }
62
+ return O(n), n;
63
+ },
64
+ P(() => {
65
+ var e;
66
+ return (e = S.value) == null ? void 0 : e.index;
67
+ })
68
+ ];
69
+ };
70
+ export {
71
+ J as useResize
72
+ };
@@ -0,0 +1,4 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { PanelProps } from '../interface';
3
+ export declare function getPtg(str: string): number;
4
+ export declare const useSizes: (items: Ref<PanelProps[]>, containerSize?: Ref<number | undefined>) => readonly [ ComputedRef<(string | number | undefined)[]>, ComputedRef<number[]>, ComputedRef<number[]>, ComputedRef<number[]>, ComputedRef<number[]>, (nextSizes: (string | number | undefined)[]) => void];
@@ -0,0 +1,58 @@
1
+ import { computed as o, unref as r, ref as b } from "vue";
2
+ function c(n) {
3
+ return typeof n == "string" && n.endsWith("%");
4
+ }
5
+ function p(n) {
6
+ return Number(n.slice(0, -1)) / 100;
7
+ }
8
+ const I = (n, l) => {
9
+ const S = o(() => r(n).map((e) => e.size)), f = o(() => r(n).length), a = o(() => r(l) || 0), x = (e) => e * r(a), m = b(
10
+ r(n).map(
11
+ (e) => e.defaultSize || e["default-size"]
12
+ )
13
+ ), v = o(() => {
14
+ const e = [];
15
+ for (let u = 0; u < f.value; u += 1)
16
+ e[u] = S.value[u] ?? m.value[u];
17
+ return e;
18
+ }), z = o(() => {
19
+ let e = [], u = 0;
20
+ for (let s = 0; s < f.value; s += 1) {
21
+ const t = v.value[s];
22
+ if (c(t))
23
+ e[s] = p(t);
24
+ else if (t || t === 0) {
25
+ const g = Number(t);
26
+ Number.isNaN(g) || (e[s] = g / a.value);
27
+ } else
28
+ u += 1, e[s] = void 0;
29
+ }
30
+ const i = e.reduce((s, t) => s + (t || 0), 0);
31
+ if (i > 1 || !u) {
32
+ const s = 1 / i;
33
+ e = e.map((t) => t === void 0 ? 0 : t * s);
34
+ } else {
35
+ const s = (1 - i) / u;
36
+ e = e.map((t) => t === void 0 ? s : t);
37
+ }
38
+ return e;
39
+ }), d = o(() => r(z).map(x)), P = o(
40
+ () => r(n).map((e) => c(e.min) ? p(e.min) : (e.min || 0) / a.value)
41
+ ), N = o(
42
+ () => r(n).map((e) => c(e.max) ? p(e.max) : (e.max || a.value) / a.value)
43
+ );
44
+ return [
45
+ o(() => l != null && l.value ? r(d) : r(v)),
46
+ d,
47
+ z,
48
+ P,
49
+ N,
50
+ (e) => {
51
+ m.value = e;
52
+ }
53
+ ];
54
+ };
55
+ export {
56
+ p as getPtg,
57
+ I as useSizes
58
+ };
@@ -0,0 +1,8 @@
1
+ import { default as SplitterComp } from './Splitter.vue';
2
+ import { default as Panel } from './_Panel.vue';
3
+ type CompoundedComponent = typeof SplitterComp & {
4
+ Panel: typeof Panel;
5
+ };
6
+ declare const Splitter: CompoundedComponent;
7
+ export { Splitter };
8
+ export * from './interface';
@@ -0,0 +1,10 @@
1
+ import "./Splitter.vue.mjs";
2
+ import "./_Panel.vue.mjs";
3
+ import "./interface.mjs";
4
+ import m from "./Splitter.vue2.mjs";
5
+ import o from "./_Panel.vue2.mjs";
6
+ const r = m;
7
+ r.Panel = o;
8
+ export {
9
+ r as Splitter
10
+ };