@farris/ui-vue 1.2.4 → 1.2.6
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.
- package/components/accordion/index.esm.js +58 -58
- package/components/accordion/index.umd.cjs +1 -1
- package/components/accordion/package.json +1 -1
- package/components/avatar/index.esm.js +124 -116
- package/components/avatar/index.umd.cjs +1 -1
- package/components/avatar/package.json +1 -1
- package/components/border-editor/package.json +1 -1
- package/components/button/package.json +1 -1
- package/components/button-edit/index.css +1 -0
- package/components/button-edit/package.json +1 -1
- package/components/button-group/package.json +1 -1
- package/components/calculator/package.json +1 -1
- package/components/calendar/package.json +1 -1
- package/components/capsule/index.esm.js +1 -1
- package/components/capsule/index.umd.cjs +1 -1
- package/components/capsule/package.json +1 -1
- package/components/checkbox/index.esm.js +219 -209
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/checkbox/package.json +1 -1
- package/components/color-picker/package.json +1 -1
- package/components/combo-list/index.esm.js +36 -28
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-list/package.json +1 -1
- package/components/combo-tree/index.esm.js +340 -107
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/combo-tree/package.json +1 -1
- package/components/common/index.esm.js +2 -2
- package/components/common/index.umd.cjs +1 -1
- package/components/common/package.json +1 -1
- package/components/component/index.esm.js +36 -29
- package/components/component/index.umd.cjs +1 -1
- package/components/component/package.json +1 -1
- package/components/condition/index.esm.js +406 -402
- package/components/condition/index.umd.cjs +1 -1
- package/components/condition/package.json +1 -1
- package/components/content-container/index.esm.js +9 -13
- package/components/content-container/index.umd.cjs +1 -1
- package/components/content-container/package.json +1 -1
- package/components/{tree-grid/style.css → data-grid/index.css} +1 -1
- package/components/data-grid/index.esm.js +4439 -4273
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-grid/package.json +1 -1
- package/components/data-view/index.esm.js +2904 -2892
- package/components/data-view/index.umd.cjs +1 -1
- package/components/data-view/package.json +1 -1
- package/components/date-picker/index.esm.js +250 -242
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/date-picker/package.json +1 -1
- package/components/designer-canvas/index.css +1 -0
- package/components/designer-canvas/index.esm.js +24 -21
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-canvas/package.json +1 -1
- package/components/designer-outline/index.esm.js +44 -42
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/designer-outline/package.json +1 -1
- package/components/designer-toolbox/index.esm.js +28 -467
- package/components/designer-toolbox/index.umd.cjs +1 -1
- package/components/designer-toolbox/package.json +1 -1
- package/components/discussion-editor/package.json +1 -1
- package/components/discussion-list/package.json +1 -1
- package/components/drawer/package.json +1 -1
- package/components/dropdown/index.esm.js +86 -86
- package/components/dropdown/index.umd.cjs +1 -1
- package/components/dropdown/package.json +1 -1
- package/components/dynamic-form/index.esm.js +984 -928
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-form/package.json +1 -1
- package/components/dynamic-resolver/index.esm.js +56 -47
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-resolver/package.json +1 -1
- package/components/dynamic-view/index.esm.js +281 -277
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/dynamic-view/package.json +1 -1
- package/components/enum-editor/package.json +1 -1
- package/components/events-editor/package.json +1 -1
- package/components/expression-editor/package.json +1 -1
- package/components/external-container/index.css +1 -0
- package/components/external-container/index.esm.js +1917 -1901
- package/components/external-container/index.umd.cjs +1 -1
- package/components/external-container/package.json +1 -1
- package/components/field-selector/index.css +1 -0
- package/components/field-selector/index.esm.js +4185 -4023
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/field-selector/package.json +1 -1
- package/components/filter-bar/{style.css → index.css} +1 -1
- package/components/filter-bar/index.esm.js +595 -581
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-bar/package.json +1 -1
- package/components/flow-canvas/index.css +1 -0
- package/components/flow-canvas/index.esm.js +38 -35
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/flow-canvas/package.json +1 -1
- package/components/image-cropper/package.json +1 -1
- package/components/input-group/index.esm.js +256 -248
- package/components/input-group/index.umd.cjs +1 -1
- package/components/input-group/package.json +1 -1
- package/components/layout/package.json +1 -1
- package/components/list-nav/package.json +1 -1
- package/components/list-view/index.esm.js +1522 -1519
- package/components/list-view/index.umd.cjs +1 -1
- package/components/list-view/package.json +1 -1
- package/components/loading/package.json +1 -1
- package/components/locale/package.json +1 -1
- package/components/lookup/index.css +1 -0
- package/components/lookup/index.esm.js +4629 -4410
- package/components/lookup/index.umd.cjs +1 -1
- package/components/lookup/package.json +1 -1
- package/components/mapping-editor/index.css +1 -0
- package/components/mapping-editor/index.esm.js +4454 -4255
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/mapping-editor/package.json +1 -1
- package/components/message-box/index.css +1 -0
- package/components/message-box/index.esm.js +397 -386
- package/components/message-box/index.umd.cjs +1 -1
- package/components/message-box/package.json +1 -1
- package/components/modal/index.css +1 -0
- package/components/modal/index.esm.js +308 -297
- package/components/modal/index.umd.cjs +1 -1
- package/components/modal/package.json +1 -1
- package/components/nav/index.esm.js +511 -469
- package/components/nav/index.umd.cjs +2 -2
- package/components/nav/package.json +1 -1
- package/components/notify/package.json +1 -1
- package/components/order/index.esm.js +972 -920
- package/components/order/index.umd.cjs +1 -1
- package/components/order/package.json +1 -1
- package/components/page-footer/package.json +1 -1
- package/components/page-header/index.esm.js +917 -893
- package/components/page-header/index.umd.cjs +1 -1
- package/components/page-header/package.json +1 -1
- package/components/pagination/index.esm.js +491 -449
- package/components/pagination/index.umd.cjs +1 -1
- package/components/pagination/package.json +1 -1
- package/components/popover/package.json +1 -1
- package/components/progress/package.json +1 -1
- package/components/property-editor/index.esm.js +108 -101
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-editor/package.json +1 -1
- package/components/property-panel/index.esm.js +361 -349
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/property-panel/package.json +1 -1
- package/components/radio-button/package.json +1 -1
- package/components/radio-group/index.esm.js +72 -64
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/radio-group/package.json +1 -1
- package/components/rate/package.json +1 -1
- package/components/response-layout/package.json +1 -1
- package/components/response-layout-editor/{style.css → index.css} +1 -1
- package/components/response-layout-editor/index.esm.js +452 -439
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-layout-editor/package.json +1 -1
- package/components/response-toolbar/index.esm.js +610 -592
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/response-toolbar/package.json +1 -1
- package/components/schema-selector/index.css +1 -0
- package/components/schema-selector/index.esm.js +4041 -3749
- package/components/schema-selector/index.umd.cjs +8 -1
- package/components/schema-selector/package.json +1 -1
- package/components/search-box/package.json +1 -1
- package/components/section/index.esm.js +21 -14
- package/components/section/index.umd.cjs +1 -1
- package/components/section/package.json +1 -1
- package/components/smoke-detector/package.json +1 -1
- package/components/spacing-editor/package.json +1 -1
- package/components/splitter/package.json +1 -1
- package/components/step/package.json +1 -1
- package/components/switch/index.esm.js +159 -178
- package/components/switch/index.umd.cjs +1 -1
- package/components/switch/package.json +1 -1
- package/components/tabs/index.css +1 -0
- package/components/tabs/index.esm.js +1450 -1408
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tabs/package.json +1 -1
- package/components/tags/package.json +1 -1
- package/components/text/package.json +1 -1
- package/components/textarea/index.esm.js +86 -78
- package/components/textarea/index.umd.cjs +1 -1
- package/components/textarea/package.json +1 -1
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +387 -379
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/time-picker/package.json +1 -1
- package/components/tooltip/package.json +1 -1
- package/components/transfer/index.esm.js +95 -93
- package/components/transfer/index.umd.cjs +1 -1
- package/components/transfer/package.json +1 -1
- package/components/{data-grid/style.css → tree-grid/index.css} +1 -1
- package/components/tree-grid/index.esm.js +4437 -4271
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-grid/package.json +1 -1
- package/components/tree-view/index.esm.js +1989 -1985
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/tree-view/package.json +1 -1
- package/components/uploader/package.json +1 -1
- package/components/verify-detail/package.json +1 -1
- package/components/video/package.json +1 -1
- package/components/weather/package.json +1 -1
- package/farris.all.esm.js +12989 -12513
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -0
- package/package.json +2 -2
- package/types/combo-tree/src/combo-tree.props.d.ts +4 -0
- package/types/combo-tree/src/components/tree-container.component.d.ts +13 -3
- package/types/combo-tree/src/components/tree-container.props.d.ts +15 -1
- package/types/combo-tree/src/schema/schema-mapper.d.ts +2 -0
- package/types/combo-tree/src/schema/schema-resolver.d.ts +2 -0
- package/types/components.d.ts +1 -0
- package/types/condition/index.d.ts +60 -1
- package/types/data-grid/index.d.ts +5 -5
- package/types/data-grid/src/data-grid.component.d.ts +2 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +1 -1
- package/types/data-view/components/column-setting/column-setting.component.d.ts +2 -1
- package/types/data-view/composition/types.d.ts +2 -0
- package/types/designer-canvas/src/composition/dg-control.d.ts +8 -8
- package/types/designer-canvas/src/composition/types.d.ts +1 -0
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +3 -3
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/converter/pagination.converter.d.ts +6 -0
- package/types/dynamic-resolver/src/visible-prop-resolver.d.ts +3 -0
- package/types/list-view/src/composition/types.d.ts +1 -1
- package/types/lookup/src/designer/use-lookup-rules.d.ts +3 -0
- package/types/lookup/src/property-config/converters/lookup-property.converter.d.ts +8 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +29 -25
- package/types/mapping-editor/src/mapping-editor.props.d.ts +8 -0
- package/types/message-box/index.d.ts +84 -1
- package/types/modal/src/modal.component.d.ts +3 -3
- package/types/modal/src/modal.props.d.ts +3 -5
- package/types/notify/index.d.ts +84 -1
- package/types/page-header/src/page-header.props.d.ts +7 -0
- package/types/page-header/src/property-config/page-header.property-config.d.ts +1 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +2 -0
- package/types/response-toolbar/index.d.ts +9 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
- package/types/response-toolbar/src/response-toolbar.component.d.ts +4 -2
- package/types/response-toolbar/src/response-toolbar.props.d.ts +9 -2
- package/types/schema-selector/src/composition/types.d.ts +3 -1
- package/types/schema-selector/src/schema-selector-editor.component.d.ts +5 -1
- package/types/tabs/src/designer/tab-toolbar.design.component.d.ts +1 -1
- package/types/tabs/src/tabs.props.d.ts +8 -0
- package/types/tree-grid/src/schema/column-resolver.d.ts +3 -0
- package/components/button-edit/style.css +0 -1
- package/components/designer-canvas/style.css +0 -1
- package/components/external-container/style.css +0 -1
- package/components/field-selector/style.css +0 -1
- package/components/flow-canvas/style.css +0 -1
- package/components/lookup/style.css +0 -1
- package/components/mapping-editor/style.css +0 -1
- package/components/message-box/style.css +0 -1
- package/components/modal/style.css +0 -1
- package/components/schema-selector/style.css +0 -1
- package/components/tabs/style.css +0 -1
- package/components/time-picker/style.css +0 -1
- package/style.css +0 -1
- package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +0 -19
- /package/components/border-editor/{style.css → index.css} +0 -0
- /package/components/checkbox/{style.css → index.css} +0 -0
- /package/components/date-picker/{style.css → index.css} +0 -0
- /package/components/designer-outline/{style.css → index.css} +0 -0
- /package/components/designer-toolbox/{style.css → index.css} +0 -0
- /package/components/discussion-editor/{style.css → index.css} +0 -0
- /package/components/discussion-list/{style.css → index.css} +0 -0
- /package/components/drawer/{style.css → index.css} +0 -0
- /package/components/events-editor/{style.css → index.css} +0 -0
- /package/components/list-view/{style.css → index.css} +0 -0
- /package/components/order/{style.css → index.css} +0 -0
- /package/components/property-editor/{style.css → index.css} +0 -0
- /package/components/property-panel/{style.css → index.css} +0 -0
- /package/components/radio-button/{style.css → index.css} +0 -0
- /package/components/radio-group/{style.css → index.css} +0 -0
- /package/components/smoke-detector/{style.css → index.css} +0 -0
- /package/components/spacing-editor/{style.css → index.css} +0 -0
- /package/components/splitter/{style.css → index.css} +0 -0
- /package/components/switch/{style.css → index.css} +0 -0
- /package/components/transfer/{style.css → index.css} +0 -0
- /package/components/uploader/{style.css → index.css} +0 -0
- /package/components/weather/{style.css → index.css} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as C, computed as m, createVNode as u, ref as g, inject as
|
|
1
|
+
import { defineComponent as C, computed as m, createVNode as u, ref as g, inject as k, onMounted as D } from "vue";
|
|
2
2
|
import { cloneDeep as S } from "lodash-es";
|
|
3
3
|
import { resolveAppearance as E, createPropsResolver as R } from "@farris/ui-vue/components/dynamic-resolver";
|
|
4
4
|
import { useDesignerComponent as M } from "@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-component";
|
|
5
5
|
const T = {}, V = {};
|
|
6
6
|
function I(t) {
|
|
7
|
-
const { properties: e, title:
|
|
8
|
-
return n.id = `${
|
|
7
|
+
const { properties: e, title: i } = t, n = Object.keys(e).reduce((r, l) => (r[l] = e[l].type === "object" && e[l].properties ? I(e[l]) : S(e[l].default), r), {});
|
|
8
|
+
return n.id = `${i}-${Date.now()}`, n;
|
|
9
9
|
}
|
|
10
10
|
function B(t, e) {
|
|
11
|
-
const
|
|
12
|
-
return Object.keys(t).reduce((n, r) => (n[r] = t[r], n),
|
|
11
|
+
const i = I(e);
|
|
12
|
+
return Object.keys(t).reduce((n, r) => (n[r] = t[r], n), i), i;
|
|
13
13
|
}
|
|
14
14
|
function q(t, e) {
|
|
15
15
|
return Object.keys(t).filter((n) => t[n] != null).reduce((n, r) => {
|
|
@@ -26,16 +26,16 @@ function q(t, e) {
|
|
|
26
26
|
return n;
|
|
27
27
|
}, {});
|
|
28
28
|
}
|
|
29
|
-
function x(t, e,
|
|
29
|
+
function x(t, e, i = /* @__PURE__ */ new Map()) {
|
|
30
30
|
const n = B(t, e);
|
|
31
|
-
return q(n,
|
|
31
|
+
return q(n, i);
|
|
32
32
|
}
|
|
33
33
|
function z(t = {}) {
|
|
34
|
-
function e(s, o,
|
|
35
|
-
if (typeof
|
|
36
|
-
return a[s].length ===
|
|
37
|
-
if (typeof
|
|
38
|
-
const p = Object.keys(
|
|
34
|
+
function e(s, o, c, a) {
|
|
35
|
+
if (typeof c == "number")
|
|
36
|
+
return a[s].length === c;
|
|
37
|
+
if (typeof c == "object") {
|
|
38
|
+
const p = Object.keys(c)[0], h = c[p];
|
|
39
39
|
if (p === "not")
|
|
40
40
|
return Number(a[s].length) !== Number(h);
|
|
41
41
|
if (p === "moreThan")
|
|
@@ -45,33 +45,33 @@ function z(t = {}) {
|
|
|
45
45
|
}
|
|
46
46
|
return !1;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return a[s] && a[s].propertyValue && String(a[s].propertyValue.value) === String(
|
|
48
|
+
function i(s, o, c, a) {
|
|
49
|
+
return a[s] && a[s].propertyValue && String(a[s].propertyValue.value) === String(c);
|
|
50
50
|
}
|
|
51
51
|
const n = /* @__PURE__ */ new Map([
|
|
52
52
|
["length", e],
|
|
53
|
-
["getProperty",
|
|
53
|
+
["getProperty", i]
|
|
54
54
|
]);
|
|
55
55
|
Object.keys(t).reduce((s, o) => (s.set(o, t[o]), s), n);
|
|
56
56
|
function r(s, o) {
|
|
57
|
-
const
|
|
58
|
-
return typeof o == "number" ? [{ target:
|
|
57
|
+
const c = s;
|
|
58
|
+
return typeof o == "number" ? [{ target: c, operator: "length", param: null, value: Number(o) }] : typeof o == "boolean" ? [{ target: c, operator: "getProperty", param: s, value: !!o }] : typeof o == "object" ? Object.keys(o).map((a) => {
|
|
59
59
|
if (a === "length")
|
|
60
|
-
return { target:
|
|
60
|
+
return { target: c, operator: "length", param: null, value: o[a] };
|
|
61
61
|
const p = a, h = o[a];
|
|
62
|
-
return { target:
|
|
62
|
+
return { target: c, operator: "getProperty", param: p, value: h };
|
|
63
63
|
}) : [];
|
|
64
64
|
}
|
|
65
65
|
function l(s) {
|
|
66
|
-
return Object.keys(s).reduce((
|
|
66
|
+
return Object.keys(s).reduce((c, a) => {
|
|
67
67
|
const p = r(a, s[a]);
|
|
68
|
-
return
|
|
68
|
+
return c.push(...p), c;
|
|
69
69
|
}, []);
|
|
70
70
|
}
|
|
71
71
|
function d(s, o) {
|
|
72
72
|
if (n.has(s.operator)) {
|
|
73
|
-
const
|
|
74
|
-
return
|
|
73
|
+
const c = n.get(s.operator);
|
|
74
|
+
return c && c(s.target, s.param, s.value, o) || !1;
|
|
75
75
|
}
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
@@ -79,24 +79,24 @@ function z(t = {}) {
|
|
|
79
79
|
return l(s).reduce((p, h) => p && d(h, o), !0);
|
|
80
80
|
}
|
|
81
81
|
function y(s, o) {
|
|
82
|
-
const
|
|
82
|
+
const c = Object.keys(s), a = c.includes("allOf"), p = c.includes("anyOf"), h = a || p, A = (h ? s[h ? a ? "allOf" : "anyOf" : "allOf"] : [s]).map((P) => f(P, o));
|
|
83
83
|
return a ? !A.includes(!1) : A.includes(!0);
|
|
84
84
|
}
|
|
85
85
|
return { parseValueSchema: y };
|
|
86
86
|
}
|
|
87
87
|
const H = {}, L = {};
|
|
88
88
|
z();
|
|
89
|
-
function G(t, e,
|
|
89
|
+
function G(t, e, i = /* @__PURE__ */ new Map(), n = (d, f, y) => f, r = {}, l = (d) => d) {
|
|
90
90
|
return T[e.title] = e, V[e.title] = n, H[e.title] = r, L[e.title] = l, (d = {}) => {
|
|
91
|
-
const f = x(d, e,
|
|
91
|
+
const f = x(d, e, i), y = Object.keys(t).reduce((s, o) => (s[o] = t[o].default, s), {});
|
|
92
92
|
return Object.assign(y, f);
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
const O = /* @__PURE__ */ new Map([
|
|
96
96
|
["appearance", E],
|
|
97
97
|
["size", (t, e) => {
|
|
98
|
-
const
|
|
99
|
-
return e.width && (
|
|
98
|
+
const i = {};
|
|
99
|
+
return e.width && (i.width = Number(e.width)), e.height && (i.height = Number(e.height)), i;
|
|
100
100
|
}]
|
|
101
101
|
]), J = "https://json-schema.org/draft/2020-12/schema", Q = "https://farris-design.gitee.io/accordion.schema.json", U = "accordion", W = "A Farris Container Component", X = "object", Y = {
|
|
102
102
|
id: {
|
|
@@ -167,7 +167,7 @@ const O = /* @__PURE__ */ new Map([
|
|
|
167
167
|
properties: Y,
|
|
168
168
|
required: Z
|
|
169
169
|
};
|
|
170
|
-
function K(t, e,
|
|
170
|
+
function K(t, e, i) {
|
|
171
171
|
return e;
|
|
172
172
|
}
|
|
173
173
|
const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
@@ -208,7 +208,7 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
208
208
|
props: j,
|
|
209
209
|
emits: [],
|
|
210
210
|
setup(t, e) {
|
|
211
|
-
const
|
|
211
|
+
const i = m(() => ({
|
|
212
212
|
height: t.height ? `${t.height}px` : "",
|
|
213
213
|
width: t.width ? `${t.width}px` : ""
|
|
214
214
|
})), n = m(() => {
|
|
@@ -220,7 +220,7 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
220
220
|
});
|
|
221
221
|
return () => u("div", {
|
|
222
222
|
class: n.value,
|
|
223
|
-
style:
|
|
223
|
+
style: i.value
|
|
224
224
|
}, [e.slots.default && e.slots.default()]);
|
|
225
225
|
}
|
|
226
226
|
}), re = "https://json-schema.org/draft/2020-12/schema", ie = "https://farris-design.gitee.io/accordion-item.schema.json", ce = "AccordionItem", ae = "A Farris Container Component", le = "object", ue = {
|
|
@@ -276,51 +276,51 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
276
276
|
width: { type: Number },
|
|
277
277
|
height: { type: Number, default: 100 },
|
|
278
278
|
title: { type: String, default: "" },
|
|
279
|
-
|
|
279
|
+
disabled: { type: Boolean, default: !1 },
|
|
280
280
|
active: { type: Boolean, default: !1 }
|
|
281
281
|
}, F = R(w, pe, O), $ = /* @__PURE__ */ C({
|
|
282
282
|
name: "FAccordionItem",
|
|
283
283
|
props: w,
|
|
284
284
|
emits: [],
|
|
285
285
|
setup(t, e) {
|
|
286
|
-
const
|
|
287
|
-
function
|
|
288
|
-
n.value = !n.value;
|
|
286
|
+
const i = g(t.title), n = g(t.active);
|
|
287
|
+
function r() {
|
|
288
|
+
t.disabled || (n.value = !n.value);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
|
|
290
|
+
function l(o) {
|
|
291
|
+
r();
|
|
292
292
|
}
|
|
293
|
-
const
|
|
294
|
-
"f-state-disabled":
|
|
293
|
+
const d = m(() => ({
|
|
294
|
+
"f-state-disabled": t.disabled,
|
|
295
295
|
card: !0,
|
|
296
296
|
"farris-panel-item": !0,
|
|
297
297
|
"f-state-selected": n.value
|
|
298
|
-
})),
|
|
298
|
+
})), f = m(() => !0), y = m(() => ({
|
|
299
299
|
"f-icon": !0,
|
|
300
300
|
"f-accordion-collapse": !n.value,
|
|
301
301
|
"f-accordion-expand": n.value
|
|
302
|
-
})),
|
|
303
|
-
const
|
|
302
|
+
})), s = m(() => {
|
|
303
|
+
const o = {
|
|
304
304
|
transition: "height 0.36s ease 0s",
|
|
305
305
|
height: n.value ? `${t.height}px` : 0
|
|
306
306
|
};
|
|
307
|
-
return n.value || (
|
|
307
|
+
return n.value || (o.overflow = "hidden"), o;
|
|
308
308
|
});
|
|
309
309
|
return () => u("div", {
|
|
310
|
-
class:
|
|
310
|
+
class: d.value
|
|
311
311
|
}, [u("div", {
|
|
312
312
|
class: "card-header",
|
|
313
|
-
onClick:
|
|
313
|
+
onClick: l
|
|
314
314
|
}, [u("div", {
|
|
315
315
|
class: "panel-item-title"
|
|
316
|
-
}, [
|
|
317
|
-
class:
|
|
316
|
+
}, [f.value && u("span", null, [i.value]), e.slots.head && e.slots.head(), u("span", {
|
|
317
|
+
class: y.value
|
|
318
318
|
}, null)]), u("div", {
|
|
319
319
|
class: "panel-item-tool"
|
|
320
320
|
}, [e.slots.toolbar && e.slots.toolbar()]), u("div", {
|
|
321
321
|
class: "panel-item-clear"
|
|
322
322
|
}, null)]), u("div", {
|
|
323
|
-
style:
|
|
323
|
+
style: s.value
|
|
324
324
|
}, [u("div", {
|
|
325
325
|
class: "card-body"
|
|
326
326
|
}, [e.slots.default && e.slots.default()])])]);
|
|
@@ -330,7 +330,7 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
330
330
|
props: j,
|
|
331
331
|
emits: [],
|
|
332
332
|
setup(t, e) {
|
|
333
|
-
const
|
|
333
|
+
const i = m(() => ({
|
|
334
334
|
height: t.height ? `${t.height}px` : "",
|
|
335
335
|
width: t.width ? `${t.width}px` : ""
|
|
336
336
|
})), n = m(() => {
|
|
@@ -339,13 +339,13 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
339
339
|
accordion: !0
|
|
340
340
|
};
|
|
341
341
|
return f.reduce((s, o) => (s[o] = !0, s), y), y;
|
|
342
|
-
}), r = g(), l =
|
|
343
|
-
return
|
|
342
|
+
}), r = g(), l = k("design-item-context"), d = M(r, l);
|
|
343
|
+
return D(() => {
|
|
344
344
|
r.value.componentInstance = d;
|
|
345
345
|
}), e.expose(d.value), () => u("div", {
|
|
346
346
|
ref: r,
|
|
347
347
|
class: n.value,
|
|
348
|
-
style:
|
|
348
|
+
style: i.value
|
|
349
349
|
}, [e.slots.default && e.slots.default()]);
|
|
350
350
|
}
|
|
351
351
|
}), me = /* @__PURE__ */ C({
|
|
@@ -353,7 +353,7 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
353
353
|
props: w,
|
|
354
354
|
emits: [],
|
|
355
355
|
setup(t, e) {
|
|
356
|
-
const
|
|
356
|
+
const i = g(t.title), n = g(!1), r = g(!1);
|
|
357
357
|
function l() {
|
|
358
358
|
n.value = !n.value;
|
|
359
359
|
}
|
|
@@ -369,7 +369,7 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
369
369
|
"f-icon": !0,
|
|
370
370
|
"f-accordion-collapse": !n.value,
|
|
371
371
|
"f-accordion-expand": n.value
|
|
372
|
-
})),
|
|
372
|
+
})), c = m(() => {
|
|
373
373
|
const b = {
|
|
374
374
|
transition: "height 0.36s ease 0s",
|
|
375
375
|
height: n.value ? `${t.height}px` : 0
|
|
@@ -397,14 +397,14 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
397
397
|
onClick: d
|
|
398
398
|
}, [u("div", {
|
|
399
399
|
class: "panel-item-title"
|
|
400
|
-
}, [y.value && u("span", null, [
|
|
400
|
+
}, [y.value && u("span", null, [i.value]), s.value && e.slots.head && e.slots.head(), u("span", {
|
|
401
401
|
class: o.value
|
|
402
402
|
}, null)]), u("div", {
|
|
403
403
|
class: "panel-item-tool"
|
|
404
404
|
}, [e.slots.toolbar && e.slots.toolbar()]), u("div", {
|
|
405
405
|
class: "panel-item-clear"
|
|
406
406
|
}, null)]), u("div", {
|
|
407
|
-
style:
|
|
407
|
+
style: c.value
|
|
408
408
|
}, [u("div", {
|
|
409
409
|
class: "card-body drag-container"
|
|
410
410
|
}, [e.slots.default && e.slots.default()])])]);
|
|
@@ -413,10 +413,10 @@ const ee = "accordion", te = "A Farris Component", ne = "object", se = {
|
|
|
413
413
|
v.install = (t) => {
|
|
414
414
|
t.component(v.name, v), t.component($.name, $);
|
|
415
415
|
};
|
|
416
|
-
v.register = (t, e,
|
|
416
|
+
v.register = (t, e, i, n) => {
|
|
417
417
|
t.accordion = v, t["accordion-item"] = $, e.accordion = N, e["accordion-item"] = F;
|
|
418
418
|
};
|
|
419
|
-
v.registerDesigner = (t, e,
|
|
419
|
+
v.registerDesigner = (t, e, i) => {
|
|
420
420
|
t.accordion = fe, t["accordion-item"] = me, e.accordion = N, e["accordion-item"] = F;
|
|
421
421
|
};
|
|
422
422
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(p,
|
|
1
|
+
(function(p,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es"),require("@farris/ui-vue/components/dynamic-resolver"),require("@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-component")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","@farris/ui-vue/components/dynamic-resolver","@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-component"],n):(p=typeof globalThis<"u"?globalThis:p||self,n(p.accordion={},p.Vue,p.LodashES,p.dynamicResolver,p.useDesignerComponent))})(this,function(p,n,O,j,P){"use strict";const F={},S={};function A(t){const{properties:e,title:c}=t,o=Object.keys(e).reduce((i,d)=>(i[d]=e[d].type==="object"&&e[d].properties?A(e[d]):O.cloneDeep(e[d].default),i),{});return o.id=`${c}-${Date.now()}`,o}function D(t,e){const c=A(e);return Object.keys(t).reduce((o,i)=>(o[i]=t[i],o),c),c}function k(t,e){return Object.keys(t).filter(o=>t[o]!=null).reduce((o,i)=>{if(e.has(i)){const d=e.get(i);if(typeof d=="string")o[d]=t[i];else{const u=d(i,t[i],t);Object.assign(o,u)}}else o[i]=t[i];return o},{})}function q(t,e,c=new Map){const o=D(t,e);return k(o,c)}function T(t={}){function e(r,s,a,l){if(typeof a=="number")return l[r].length===a;if(typeof a=="object"){const f=Object.keys(a)[0],h=a[f];if(f==="not")return Number(l[r].length)!==Number(h);if(f==="moreThan")return Number(l[r].length)>=Number(h);if(f==="lessThan")return Number(l[r].length)<=Number(h)}return!1}function c(r,s,a,l){return l[r]&&l[r].propertyValue&&String(l[r].propertyValue.value)===String(a)}const o=new Map([["length",e],["getProperty",c]]);Object.keys(t).reduce((r,s)=>(r.set(s,t[s]),r),o);function i(r,s){const a=r;return typeof s=="number"?[{target:a,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:a,operator:"getProperty",param:r,value:!!s}]:typeof s=="object"?Object.keys(s).map(l=>{if(l==="length")return{target:a,operator:"length",param:null,value:s[l]};const f=l,h=s[l];return{target:a,operator:"getProperty",param:f,value:h}}):[]}function d(r){return Object.keys(r).reduce((a,l)=>{const f=i(l,r[l]);return a.push(...f),a},[])}function u(r,s){if(o.has(r.operator)){const a=o.get(r.operator);return a&&a(r.target,r.param,r.value,s)||!1}return!1}function m(r,s){return d(r).reduce((f,h)=>f&&u(h,s),!0)}function y(r,s){const a=Object.keys(r),l=a.includes("allOf"),f=a.includes("anyOf"),h=l||f,I=(h?r[h?l?"allOf":"anyOf":"allOf"]:[r]).map(J=>m(J,s));return l?!I.includes(!1):I.includes(!0)}return{parseValueSchema:y}}const E={},M={};T();function R(t,e,c=new Map,o=(u,m,y)=>m,i={},d=u=>u){return F[e.title]=e,S[e.title]=o,E[e.title]=i,M[e.title]=d,(u={})=>{const m=q(u,e,c),y=Object.keys(t).reduce((r,s)=>(r[s]=t[s].default,r),{});return Object.assign(y,m)}}const w=new Map([["appearance",j.resolveAppearance],["size",(t,e)=>{const c={};return e.width&&(c.width=Number(e.width)),e.height&&(c.height=Number(e.height)),c}]]),B={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/accordion.schema.json",title:"accordion",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Accordion",type:"string"},type:{description:"The type string of Accordion component",type:"string",default:"accordion"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},customClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},enableFold:{description:"",type:"boolean",default:!0},expanded:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]};function z(t,e,c){return e}const H={title:"accordion",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},C={customClass:{type:String,default:""},height:{type:Number},width:{type:Number},enableFold:{type:Boolean,default:!0},expanded:{type:Boolean,default:!1}},V=R(C,B,w,z,H),g=n.defineComponent({name:"FAccordion",props:C,emits:[],setup(t,e){const c=n.computed(()=>({height:t.height?`${t.height}px`:"",width:t.width?`${t.width}px`:""})),o=n.computed(()=>{const i=t.customClass.split(" "),d={"farris-panel":!0,accordion:!0};return i.reduce((u,m)=>(u[m]=!0,u),d),d});return()=>n.createVNode("div",{class:o.value,style:c.value},[e.slots.default&&e.slots.default()])}}),L={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/accordion-item.schema.json",title:"AccordionItem",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Accordion Item",type:"string"},type:{description:"The type string of Accordion Item component",type:"string"},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},title:{description:"",type:"string",default:""},disable:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},$={width:{type:Number},height:{type:Number,default:100},title:{type:String,default:""},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},v=j.createPropsResolver($,L,w),N=n.defineComponent({name:"FAccordionItem",props:$,emits:[],setup(t,e){const c=n.ref(t.title),o=n.ref(t.active);function i(){t.disabled||(o.value=!o.value)}function d(s){i()}const u=n.computed(()=>({"f-state-disabled":t.disabled,card:!0,"farris-panel-item":!0,"f-state-selected":o.value})),m=n.computed(()=>!0),y=n.computed(()=>({"f-icon":!0,"f-accordion-collapse":!o.value,"f-accordion-expand":o.value})),r=n.computed(()=>{const s={transition:"height 0.36s ease 0s",height:o.value?`${t.height}px`:0};return o.value||(s.overflow="hidden"),s});return()=>n.createVNode("div",{class:u.value},[n.createVNode("div",{class:"card-header",onClick:d},[n.createVNode("div",{class:"panel-item-title"},[m.value&&n.createVNode("span",null,[c.value]),e.slots.head&&e.slots.head(),n.createVNode("span",{class:y.value},null)]),n.createVNode("div",{class:"panel-item-tool"},[e.slots.toolbar&&e.slots.toolbar()]),n.createVNode("div",{class:"panel-item-clear"},null)]),n.createVNode("div",{style:r.value},[n.createVNode("div",{class:"card-body"},[e.slots.default&&e.slots.default()])])])}}),_=n.defineComponent({name:"FAccordionDesign",props:C,emits:[],setup(t,e){const c=n.computed(()=>({height:t.height?`${t.height}px`:"",width:t.width?`${t.width}px`:""})),o=n.computed(()=>{const m=t.customClass.split(" "),y={"farris-panel":!0,accordion:!0};return m.reduce((r,s)=>(r[s]=!0,r),y),y}),i=n.ref(),d=n.inject("design-item-context"),u=P.useDesignerComponent(i,d);return n.onMounted(()=>{i.value.componentInstance=u}),e.expose(u.value),()=>n.createVNode("div",{ref:i,class:o.value,style:c.value},[e.slots.default&&e.slots.default()])}}),G=n.defineComponent({name:"FAccordionItemDesign",props:$,emits:[],setup(t,e){const c=n.ref(t.title),o=n.ref(!1),i=n.ref(!1);function d(){o.value=!o.value}function u(b){d()}const m=n.computed(()=>({"f-state-disable":i.value,card:!0,"farris-panel-item":!0,"f-state-selected":o.value})),y=n.computed(()=>!0),r=n.computed(()=>!1),s=n.computed(()=>({"f-icon":!0,"f-accordion-collapse":!o.value,"f-accordion-expand":o.value})),a=n.computed(()=>{const b={transition:"height 0.36s ease 0s",height:o.value?`${t.height}px`:0};return o.value||(b.overflow="hidden"),b});function l(){return!0}function f(){return!1}function h(){return!0}return e.expose({canMove:l(),canSelectParent:f(),canDelete:h(),canNested:!0}),()=>n.createVNode("div",{class:m.value},[n.createVNode("div",{class:"card-header",onClick:u},[n.createVNode("div",{class:"panel-item-title"},[y.value&&n.createVNode("span",null,[c.value]),r.value&&e.slots.head&&e.slots.head(),n.createVNode("span",{class:s.value},null)]),n.createVNode("div",{class:"panel-item-tool"},[e.slots.toolbar&&e.slots.toolbar()]),n.createVNode("div",{class:"panel-item-clear"},null)]),n.createVNode("div",{style:a.value},[n.createVNode("div",{class:"card-body drag-container"},[e.slots.default&&e.slots.default()])])])}});g.install=t=>{t.component(g.name,g),t.component(N.name,N)},g.register=(t,e,c,o)=>{t.accordion=g,t["accordion-item"]=N,e.accordion=V,e["accordion-item"]=v},g.registerDesigner=(t,e,c)=>{t.accordion=_,t["accordion-item"]=G,e.accordion=V,e["accordion-item"]=v},p.FAccordion=g,p.FAccordionItem=N,p.accordionItemProps=$,p.accordionItemPropsResolver=v,p.accordionProps=C,p.accordionPropsResolver=V,p.default=g,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|