@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,9 +1,231 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as O, ref as m, inject as P, computed as v, onMounted as M, createVNode as S, watch as h } from "vue";
|
|
2
|
+
import k from "@farris/ui-vue/components/button-edit";
|
|
3
|
+
import { cloneDeep as I } from "lodash-es";
|
|
4
|
+
import N from "@farris/ui-vue/components/tree-view";
|
|
4
5
|
import { withInstall as D } from "@farris/ui-vue/components/common";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const E = {}, H = {};
|
|
7
|
+
function V(e) {
|
|
8
|
+
const { properties: l, title: d } = e, i = Object.keys(l).reduce((u, s) => (u[s] = l[s].type === "object" && l[s].properties ? V(l[s]) : I(l[s].default), u), {});
|
|
9
|
+
return i.id = `${d}-${Date.now()}`, i;
|
|
10
|
+
}
|
|
11
|
+
function R(e, l) {
|
|
12
|
+
const d = V(l);
|
|
13
|
+
return Object.keys(e).reduce((i, u) => (i[u] = e[u], i), d), d;
|
|
14
|
+
}
|
|
15
|
+
function $(e, l) {
|
|
16
|
+
return Object.keys(e).filter((i) => e[i] != null).reduce((i, u) => {
|
|
17
|
+
if (l.has(u)) {
|
|
18
|
+
const s = l.get(u);
|
|
19
|
+
if (typeof s == "string")
|
|
20
|
+
i[s] = e[u];
|
|
21
|
+
else {
|
|
22
|
+
const c = s(u, e[u], e);
|
|
23
|
+
Object.assign(i, c);
|
|
24
|
+
}
|
|
25
|
+
} else
|
|
26
|
+
i[u] = e[u];
|
|
27
|
+
return i;
|
|
28
|
+
}, {});
|
|
29
|
+
}
|
|
30
|
+
function L(e, l, d = /* @__PURE__ */ new Map()) {
|
|
31
|
+
const i = R(e, l);
|
|
32
|
+
return $(i, d);
|
|
33
|
+
}
|
|
34
|
+
function A(e = {}) {
|
|
35
|
+
function l(n, t, a, r) {
|
|
36
|
+
if (typeof a == "number")
|
|
37
|
+
return r[n].length === a;
|
|
38
|
+
if (typeof a == "object") {
|
|
39
|
+
const o = Object.keys(a)[0], f = a[o];
|
|
40
|
+
if (o === "not")
|
|
41
|
+
return Number(r[n].length) !== Number(f);
|
|
42
|
+
if (o === "moreThan")
|
|
43
|
+
return Number(r[n].length) >= Number(f);
|
|
44
|
+
if (o === "lessThan")
|
|
45
|
+
return Number(r[n].length) <= Number(f);
|
|
46
|
+
}
|
|
47
|
+
return !1;
|
|
48
|
+
}
|
|
49
|
+
function d(n, t, a, r) {
|
|
50
|
+
return r[n] && r[n].propertyValue && String(r[n].propertyValue.value) === String(a);
|
|
51
|
+
}
|
|
52
|
+
const i = /* @__PURE__ */ new Map([
|
|
53
|
+
["length", l],
|
|
54
|
+
["getProperty", d]
|
|
55
|
+
]);
|
|
56
|
+
Object.keys(e).reduce((n, t) => (n.set(t, e[t]), n), i);
|
|
57
|
+
function u(n, t) {
|
|
58
|
+
const a = n;
|
|
59
|
+
return typeof t == "number" ? [{ target: a, operator: "length", param: null, value: Number(t) }] : typeof t == "boolean" ? [{ target: a, operator: "getProperty", param: n, value: !!t }] : typeof t == "object" ? Object.keys(t).map((r) => {
|
|
60
|
+
if (r === "length")
|
|
61
|
+
return { target: a, operator: "length", param: null, value: t[r] };
|
|
62
|
+
const o = r, f = t[r];
|
|
63
|
+
return { target: a, operator: "getProperty", param: o, value: f };
|
|
64
|
+
}) : [];
|
|
65
|
+
}
|
|
66
|
+
function s(n) {
|
|
67
|
+
return Object.keys(n).reduce((a, r) => {
|
|
68
|
+
const o = u(r, n[r]);
|
|
69
|
+
return a.push(...o), a;
|
|
70
|
+
}, []);
|
|
71
|
+
}
|
|
72
|
+
function c(n, t) {
|
|
73
|
+
if (i.has(n.operator)) {
|
|
74
|
+
const a = i.get(n.operator);
|
|
75
|
+
return a && a(n.target, n.param, n.value, t) || !1;
|
|
76
|
+
}
|
|
77
|
+
return !1;
|
|
78
|
+
}
|
|
79
|
+
function y(n, t) {
|
|
80
|
+
return s(n).reduce((o, f) => o && c(f, t), !0);
|
|
81
|
+
}
|
|
82
|
+
function g(n, t) {
|
|
83
|
+
const a = Object.keys(n), r = a.includes("allOf"), o = a.includes("anyOf"), f = r || o, p = (f ? n[f ? r ? "allOf" : "anyOf" : "allOf"] : [n]).map((F) => y(F, t));
|
|
84
|
+
return r ? !p.includes(!1) : p.includes(!0);
|
|
85
|
+
}
|
|
86
|
+
return { parseValueSchema: g };
|
|
87
|
+
}
|
|
88
|
+
const q = {}, U = {};
|
|
89
|
+
A();
|
|
90
|
+
function W(e, l, d = /* @__PURE__ */ new Map(), i = (c, y, g) => y, u = {}, s = (c) => c) {
|
|
91
|
+
return E[l.title] = l, H[l.title] = i, q[l.title] = u, U[l.title] = s, (c = {}) => {
|
|
92
|
+
const y = L(c, l, d), g = Object.keys(e).reduce((n, t) => (n[t] = e[t].default, n), {});
|
|
93
|
+
return Object.assign(g, y);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function z(e, l) {
|
|
97
|
+
return { customClass: l.class, customStyle: l.style };
|
|
98
|
+
}
|
|
99
|
+
const G = /* @__PURE__ */ new Map([
|
|
100
|
+
["appearance", z]
|
|
101
|
+
]), J = "https://json-schema.org/draft/2020-12/schema", Q = "https://farris-design.gitee.io/combo-list.schema.json", X = "combo-list", Y = "A Farris Input Component", Z = "object", _ = {
|
|
102
|
+
id: {
|
|
103
|
+
description: "The unique identifier for a combo list",
|
|
104
|
+
type: "string"
|
|
105
|
+
},
|
|
106
|
+
type: {
|
|
107
|
+
description: "The type string of number combo list component",
|
|
108
|
+
type: "string",
|
|
109
|
+
default: "combo-list"
|
|
110
|
+
},
|
|
111
|
+
appearance: {
|
|
112
|
+
description: "",
|
|
113
|
+
type: "object",
|
|
114
|
+
properties: {
|
|
115
|
+
class: {
|
|
116
|
+
type: "string"
|
|
117
|
+
},
|
|
118
|
+
style: {
|
|
119
|
+
type: "string"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
default: {}
|
|
123
|
+
},
|
|
124
|
+
binding: {
|
|
125
|
+
description: "",
|
|
126
|
+
type: "object",
|
|
127
|
+
default: {}
|
|
128
|
+
},
|
|
129
|
+
editable: {
|
|
130
|
+
description: "",
|
|
131
|
+
type: "boolean",
|
|
132
|
+
default: !0
|
|
133
|
+
},
|
|
134
|
+
enableLinkLabel: {
|
|
135
|
+
description: "",
|
|
136
|
+
type: "boolean",
|
|
137
|
+
default: !1
|
|
138
|
+
},
|
|
139
|
+
label: {
|
|
140
|
+
description: "",
|
|
141
|
+
type: "string",
|
|
142
|
+
default: ""
|
|
143
|
+
},
|
|
144
|
+
lableWidth: {
|
|
145
|
+
description: "",
|
|
146
|
+
type: "number"
|
|
147
|
+
},
|
|
148
|
+
placeholder: {
|
|
149
|
+
description: "",
|
|
150
|
+
type: "string",
|
|
151
|
+
default: ""
|
|
152
|
+
},
|
|
153
|
+
valueField: {
|
|
154
|
+
description: "",
|
|
155
|
+
type: "string",
|
|
156
|
+
default: "id"
|
|
157
|
+
},
|
|
158
|
+
titleField: {
|
|
159
|
+
description: "",
|
|
160
|
+
type: "string",
|
|
161
|
+
default: "name"
|
|
162
|
+
},
|
|
163
|
+
textField: {
|
|
164
|
+
description: "",
|
|
165
|
+
type: "string",
|
|
166
|
+
default: "name"
|
|
167
|
+
},
|
|
168
|
+
data: {
|
|
169
|
+
description: "",
|
|
170
|
+
type: "array"
|
|
171
|
+
},
|
|
172
|
+
readonly: {
|
|
173
|
+
description: "",
|
|
174
|
+
type: "boolean",
|
|
175
|
+
default: !1
|
|
176
|
+
},
|
|
177
|
+
required: {
|
|
178
|
+
description: "",
|
|
179
|
+
type: "boolean",
|
|
180
|
+
default: !1
|
|
181
|
+
},
|
|
182
|
+
tabindex: {
|
|
183
|
+
description: "",
|
|
184
|
+
type: "number",
|
|
185
|
+
default: -1
|
|
186
|
+
},
|
|
187
|
+
textAlign: {
|
|
188
|
+
description: "",
|
|
189
|
+
type: "string",
|
|
190
|
+
enum: [
|
|
191
|
+
"left",
|
|
192
|
+
"middle",
|
|
193
|
+
"right"
|
|
194
|
+
],
|
|
195
|
+
default: "left"
|
|
196
|
+
},
|
|
197
|
+
visible: {
|
|
198
|
+
description: "",
|
|
199
|
+
type: "boolean",
|
|
200
|
+
default: !0
|
|
201
|
+
},
|
|
202
|
+
onBlur: {
|
|
203
|
+
description: "",
|
|
204
|
+
type: "string",
|
|
205
|
+
default: ""
|
|
206
|
+
},
|
|
207
|
+
onClickLinkLabel: {
|
|
208
|
+
description: "",
|
|
209
|
+
type: "sting",
|
|
210
|
+
default: ""
|
|
211
|
+
}
|
|
212
|
+
}, K = [
|
|
213
|
+
"id",
|
|
214
|
+
"type"
|
|
215
|
+
], ee = {
|
|
216
|
+
$schema: J,
|
|
217
|
+
$id: Q,
|
|
218
|
+
title: X,
|
|
219
|
+
description: Y,
|
|
220
|
+
type: Z,
|
|
221
|
+
properties: _,
|
|
222
|
+
required: K
|
|
223
|
+
};
|
|
224
|
+
function te(e, l, d) {
|
|
225
|
+
return l;
|
|
226
|
+
}
|
|
227
|
+
var ae = /* @__PURE__ */ ((e) => (e.Text = "text", e.Tag = "tag", e))(ae || {}), ne = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e.auto = "auto", e))(ne || {});
|
|
228
|
+
const B = {
|
|
7
229
|
/**
|
|
8
230
|
* 组件标识
|
|
9
231
|
*/
|
|
@@ -103,10 +325,6 @@ const M = {
|
|
|
103
325
|
* 默认为`false`
|
|
104
326
|
*/
|
|
105
327
|
readonly: { type: Boolean, default: !1 },
|
|
106
|
-
/**
|
|
107
|
-
* 远端数据源信息
|
|
108
|
-
*/
|
|
109
|
-
remote: { type: Object, default: null },
|
|
110
328
|
/**
|
|
111
329
|
* 可选,是否支持远端过滤
|
|
112
330
|
* 默认`false`
|
|
@@ -152,9 +370,15 @@ const M = {
|
|
|
152
370
|
/**
|
|
153
371
|
* 作为内嵌编辑器被创建后默认选中文本
|
|
154
372
|
*/
|
|
155
|
-
selectOnCreated: { type: Boolean, default: !1 }
|
|
156
|
-
|
|
157
|
-
|
|
373
|
+
selectOnCreated: { type: Boolean, default: !1 },
|
|
374
|
+
/**
|
|
375
|
+
* 树表展示格式化函数
|
|
376
|
+
*/
|
|
377
|
+
formatter: { type: Function, default: null },
|
|
378
|
+
editorParams: { type: Object },
|
|
379
|
+
repositoryToken: { type: Symbol, default: null }
|
|
380
|
+
}, le = W(B, ee, G, te), re = {
|
|
381
|
+
data: { type: Array, default: [] },
|
|
158
382
|
enableSearch: { type: Boolean, default: !1 },
|
|
159
383
|
idField: { type: String, default: "id" },
|
|
160
384
|
multiSelect: { default: !1, type: Boolean },
|
|
@@ -164,149 +388,158 @@ const M = {
|
|
|
164
388
|
titleField: { type: String, default: "name" },
|
|
165
389
|
width: { type: Number },
|
|
166
390
|
height: { type: Number },
|
|
167
|
-
valueField: { type: String, default: "id" }
|
|
168
|
-
|
|
391
|
+
valueField: { type: String, default: "id" },
|
|
392
|
+
formatter: { type: Function },
|
|
393
|
+
maxHeight: { type: Number, default: 350 },
|
|
394
|
+
repositoryToken: { type: Symbol, default: null },
|
|
395
|
+
editorParams: { type: Object }
|
|
396
|
+
}, ie = /* @__PURE__ */ O({
|
|
169
397
|
name: "FComboTreeContainer",
|
|
170
|
-
props:
|
|
398
|
+
props: re,
|
|
171
399
|
emits: ["selectionChange"],
|
|
172
|
-
setup(e,
|
|
173
|
-
const
|
|
400
|
+
setup(e, l) {
|
|
401
|
+
const d = m(e.data), i = m([]), u = m(e.separator), s = m(e.width), c = m(e.height), y = m(e.maxHeight), g = m(String(e.selectedValues).split(u.value));
|
|
402
|
+
let n = null;
|
|
403
|
+
e.repositoryToken && (n = P(e.repositoryToken));
|
|
404
|
+
const t = v(() => [{
|
|
174
405
|
field: e.textField,
|
|
175
406
|
title: "",
|
|
176
|
-
dataType: "string"
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
407
|
+
dataType: "string",
|
|
408
|
+
formatter: e.formatter
|
|
409
|
+
}]), a = v(() => {
|
|
410
|
+
const o = {};
|
|
411
|
+
return s.value !== void 0 && (o.width = `${s.value}px`), c.value !== void 0 && (o.height = `${c.value}px`), y.value !== void 0 && y.value > 0 && (o.maxHeight = `${y.value}px`, o.overflow = "auto"), o;
|
|
180
412
|
});
|
|
181
|
-
function
|
|
182
|
-
|
|
413
|
+
function r(o) {
|
|
414
|
+
i.value = o.map((f) => Object.assign({}, f)), g.value = o.map((f) => f[e.idField]), l.emit("selectionChange", i.value);
|
|
183
415
|
}
|
|
184
|
-
return () =>
|
|
416
|
+
return M(() => {
|
|
417
|
+
n && n.getData(e.editorParams).then((o) => {
|
|
418
|
+
d.value = o;
|
|
419
|
+
});
|
|
420
|
+
}), () => S("div", {
|
|
185
421
|
class: "f-combo-tree-container",
|
|
186
|
-
style:
|
|
187
|
-
}, [
|
|
188
|
-
data:
|
|
422
|
+
style: a.value
|
|
423
|
+
}, [S(N, {
|
|
424
|
+
data: d.value,
|
|
189
425
|
idField: e.idField,
|
|
190
|
-
columns:
|
|
191
|
-
"selection-values":
|
|
192
|
-
onSelectionChange:
|
|
426
|
+
columns: t.value,
|
|
427
|
+
"selection-values": g.value,
|
|
428
|
+
onSelectionChange: r
|
|
193
429
|
}, null)]);
|
|
194
430
|
}
|
|
195
431
|
});
|
|
196
|
-
function
|
|
197
|
-
const
|
|
198
|
-
function y(t) {
|
|
199
|
-
const a = String(t).split(e.separator).map((d) => [d, !0]), n = new Map(a);
|
|
200
|
-
return u.value.filter((d) => n.has(String(d[e.valueField])));
|
|
201
|
-
}
|
|
432
|
+
function oe(e) {
|
|
433
|
+
const l = m(""), d = m(e.modelValue), i = m(e.data || []), u = m(e.editable);
|
|
202
434
|
function s(t) {
|
|
203
|
-
const a =
|
|
204
|
-
|
|
435
|
+
const a = String(t).split(e.separator).map((o) => [o, !0]), r = new Map(a);
|
|
436
|
+
return i.value.filter((o) => r.has(String(o[e.valueField])));
|
|
437
|
+
}
|
|
438
|
+
function c(t) {
|
|
439
|
+
const a = s(t).map((r) => r[e.textField]).join(e.separator);
|
|
440
|
+
l.value = u.value ? a || t : a;
|
|
205
441
|
}
|
|
206
|
-
function
|
|
207
|
-
const a = t.split(e.separator).map((
|
|
208
|
-
return
|
|
442
|
+
function y(t) {
|
|
443
|
+
const a = t.split(e.separator).map((o) => [o, !0]), r = new Map(a);
|
|
444
|
+
return i.value.filter((o) => r.has(o[e.textField]));
|
|
209
445
|
}
|
|
210
|
-
function
|
|
446
|
+
function g(t) {
|
|
211
447
|
const a = {};
|
|
212
448
|
return a[e.idField] = t, a[e.textField] = t, [a];
|
|
213
449
|
}
|
|
214
|
-
function
|
|
215
|
-
let a =
|
|
216
|
-
const
|
|
217
|
-
return
|
|
450
|
+
function n(t) {
|
|
451
|
+
let a = y(t);
|
|
452
|
+
const r = a && a.length > 0;
|
|
453
|
+
return u.value && !r && (a = g(t)), a;
|
|
218
454
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (f.status === 200)
|
|
223
|
-
return f.json();
|
|
224
|
-
throw new Error(f.statusText);
|
|
225
|
-
}).then((f) => {
|
|
226
|
-
u.value = f;
|
|
227
|
-
}).catch((f) => {
|
|
228
|
-
console.error(f);
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
return e.remote && c(), b(() => e.data, () => {
|
|
232
|
-
u.value = e.data;
|
|
233
|
-
}), b([u], ([t]) => {
|
|
455
|
+
return h(() => e.data, () => {
|
|
456
|
+
i.value = e.data;
|
|
457
|
+
}), h([i], ([t]) => {
|
|
234
458
|
if (e.modelValue) {
|
|
235
|
-
const a = t.find((
|
|
236
|
-
a && (
|
|
459
|
+
const a = t.find((r) => r[e.valueField] === e.modelValue);
|
|
460
|
+
a && (l.value = a[e.textField]);
|
|
237
461
|
}
|
|
238
|
-
}),
|
|
239
|
-
|
|
240
|
-
}),
|
|
462
|
+
}), h(() => e.modelValue, (t) => {
|
|
463
|
+
d.value = t, c(t);
|
|
464
|
+
}), c(e.modelValue), { dataSource: i, displayText: l, editable: u, modelValue: d, getItemsByDisplayText: y, getItemsByValue: s, getSelectedItemsByDisplayText: n };
|
|
241
465
|
}
|
|
242
|
-
const
|
|
466
|
+
const C = /* @__PURE__ */ O({
|
|
243
467
|
name: "FComboTree",
|
|
244
|
-
props:
|
|
468
|
+
props: B,
|
|
245
469
|
emits: ["clear", "update:modelValue", "change"],
|
|
246
|
-
setup(e,
|
|
470
|
+
setup(e, l) {
|
|
247
471
|
return () => {
|
|
248
|
-
const
|
|
249
|
-
dataSource:
|
|
250
|
-
displayText:
|
|
251
|
-
editable:
|
|
252
|
-
modelValue:
|
|
253
|
-
getSelectedItemsByDisplayText:
|
|
254
|
-
} =
|
|
255
|
-
|
|
256
|
-
function
|
|
257
|
-
!
|
|
472
|
+
const d = m(), i = m(e.disabled), u = m(e.enableClear), s = m(e.enableSearch), c = m(e.readonly), {
|
|
473
|
+
dataSource: y,
|
|
474
|
+
displayText: g,
|
|
475
|
+
editable: n,
|
|
476
|
+
modelValue: t,
|
|
477
|
+
getSelectedItemsByDisplayText: a
|
|
478
|
+
} = oe(e), r = v(() => e.multiSelect);
|
|
479
|
+
v(() => d.value ? d.value.elementRef.getBoundingClientRect().width : 0);
|
|
480
|
+
function o() {
|
|
481
|
+
!r.value && d.value && d.value.hidePopup();
|
|
258
482
|
}
|
|
259
|
-
function
|
|
260
|
-
|
|
483
|
+
function f(p) {
|
|
484
|
+
g.value = p.map((b) => b[e.textField]).join(e.separator), t.value = p.map((b) => b[e.valueField]).join(e.separator), l.emit("update:modelValue", t.value), l.emit("change", p, t.value), o();
|
|
261
485
|
}
|
|
262
|
-
function x(
|
|
263
|
-
|
|
486
|
+
function x(p) {
|
|
487
|
+
t.value = "", l.emit("update:modelValue", ""), l.emit("clear");
|
|
264
488
|
}
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
|
|
489
|
+
function T(p) {
|
|
490
|
+
const b = a(p);
|
|
491
|
+
f(b);
|
|
268
492
|
}
|
|
269
|
-
return
|
|
270
|
-
|
|
271
|
-
}),
|
|
272
|
-
ref:
|
|
493
|
+
return h([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([p, b, F, j, w]) => {
|
|
494
|
+
i.value = p, n.value = b, u.value = F, s.value = j, c.value = w;
|
|
495
|
+
}), S(k, {
|
|
496
|
+
ref: d,
|
|
273
497
|
id: e.id,
|
|
274
|
-
disable:
|
|
275
|
-
readonly:
|
|
498
|
+
disable: i.value,
|
|
499
|
+
readonly: c.value,
|
|
276
500
|
forcePlaceholder: e.forcePlaceholder,
|
|
277
|
-
editable:
|
|
501
|
+
editable: n.value,
|
|
278
502
|
buttonContent: e.dropDownIcon,
|
|
279
503
|
placeholder: e.placeholder,
|
|
280
|
-
enableClear:
|
|
504
|
+
enableClear: u.value,
|
|
281
505
|
maxLength: e.maxLength,
|
|
282
506
|
tabIndex: e.tabIndex,
|
|
283
507
|
enableTitle: e.enableTitle,
|
|
284
508
|
multiSelect: e.multiSelect,
|
|
285
509
|
inputType: e.multiSelect ? "tag" : "text",
|
|
286
|
-
modelValue:
|
|
287
|
-
"onUpdate:modelValue": (
|
|
510
|
+
modelValue: g.value,
|
|
511
|
+
"onUpdate:modelValue": (p) => g.value = p,
|
|
288
512
|
onClear: x,
|
|
289
|
-
onChange:
|
|
513
|
+
onChange: T,
|
|
290
514
|
focusOnCreated: e.focusOnCreated,
|
|
291
515
|
selectOnCreated: e.selectOnCreated
|
|
292
516
|
}, {
|
|
293
|
-
default: () => [
|
|
517
|
+
default: () => [S(ie, {
|
|
518
|
+
maxHeight: e.maxHeight,
|
|
294
519
|
idField: e.idField,
|
|
295
520
|
valueField: e.valueField,
|
|
296
521
|
textField: e.textField,
|
|
297
522
|
titleField: e.titleField,
|
|
298
|
-
|
|
299
|
-
selectedValues:
|
|
300
|
-
onSelectionChange:
|
|
523
|
+
data: y.value,
|
|
524
|
+
selectedValues: t.value,
|
|
525
|
+
onSelectionChange: f,
|
|
526
|
+
formatter: e.formatter,
|
|
527
|
+
editorParams: e.editorParams,
|
|
528
|
+
repositoryToken: e.repositoryToken
|
|
301
529
|
}, null)]
|
|
302
530
|
});
|
|
303
531
|
};
|
|
304
532
|
}
|
|
305
|
-
})
|
|
533
|
+
});
|
|
534
|
+
C.register = (e, l, d, i) => {
|
|
535
|
+
e["combo-tree"] = C, l["combo-tree"] = le;
|
|
536
|
+
};
|
|
537
|
+
const me = D(C);
|
|
306
538
|
export {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
539
|
+
C as FComboTree,
|
|
540
|
+
ne as Placement,
|
|
541
|
+
ae as ViewType,
|
|
542
|
+
B as comboTreeProps,
|
|
543
|
+
me as default,
|
|
544
|
+
le as propsResolver
|
|
312
545
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@farris/ui-vue/components/button-edit"),require("@farris/ui-vue/components/tree-view"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","@farris/ui-vue/components/button-edit","@farris/ui-vue/components/tree-view","@farris/ui-vue/components/common"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["combo-tree"]={},n.Vue,n.FButtonEdit,n.FTreeView,n.common))})(this,function(n,t,B,w,O){"use strict";var C=(e=>(e.Text="text",e.Tag="tag",e))(C||{}),F=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(F||{});const T={id:{type:String},data:{type:Array,default:[]},displayText:{type:String,default:""},disabled:{type:Boolean,default:!1},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-60-down"></span>'},editable:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!0},enableSearch:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!0},fitEditor:{type:Boolean,default:!1},forcePlaceholder:{type:Boolean,default:!1},hidePanelOnClear:{type:Boolean,default:!0},idField:{type:String,default:"id"},mapFields:{type:Object},maxHeight:{type:Number,default:350},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String},placement:{type:String,default:"auto"},readonly:{type:Boolean,default:!1},remote:{type:Object,default:null},remoteSearch:{type:Boolean,default:!1},separator:{type:String,default:","},tabIndex:{type:Number,default:-1},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},valueField:{type:String,default:"id"},viewType:{type:String,default:"text"},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},I={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{default:!1,type:Boolean},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},height:{type:Number},valueField:{type:String,default:"id"}},p=t.defineComponent({name:"FComboTreeContainer",props:I,emits:["selectionChange"],setup(e,r){const c=t.ref(e.dataSource),d=t.ref([]),s=t.ref(e.separator),h=t.ref(e.width),y=t.ref(e.height),b=t.ref(String(e.selectedValues).split(s.value)),S=t.computed(()=>[{field:e.textField,title:"",dataType:"string"}]),v=t.computed(()=>{const a={};return h.value!==void 0&&(a.width=`${h.value}px`),y.value!==void 0&&(a.height=`${y.value}px`),a});function f(a){d.value=a.map(l=>Object.assign({},l)),b.value=a.map(l=>l[e.idField]),r.emit("selectionChange",d.value)}return()=>t.createVNode("div",{class:"f-combo-tree-container",style:v.value},[t.createVNode(w,{data:c.value,idField:e.idField,columns:S.value,"selection-values":b.value,onSelectionChange:f},null)])}});function P(e){const r=t.ref(""),c=t.ref(e.modelValue),d=t.ref(e.data||[]),s=t.ref(e.editable);function h(a){const l=String(a).split(e.separator).map(u=>[u,!0]),i=new Map(l);return d.value.filter(u=>i.has(String(u[e.valueField])))}function y(a){const l=h(a).map(i=>i[e.textField]).join(e.separator);r.value=s.value?l||a:l}function b(a){const l=a.split(e.separator).map(u=>[u,!0]),i=new Map(l);return d.value.filter(u=>i.has(u[e.textField]))}function S(a){const l={};return l[e.idField]=a,l[e.textField]=a,[l]}function v(a){let l=b(a);const i=l&&l.length>0;return s.value&&!i&&(l=S(a)),l}function f(){const{url:a,method:l="GET",headers:i={},body:u=null}=e.remote;fetch(a,{method:l,headers:i,body:u}).then(m=>{if(m.status===200)return m.json();throw new Error(m.statusText)}).then(m=>{d.value=m}).catch(m=>{console.error(m)})}return e.remote&&f(),t.watch(()=>e.data,()=>{d.value=e.data}),t.watch([d],([a])=>{if(e.modelValue){const l=a.find(i=>i[e.valueField]===e.modelValue);l&&(r.value=l[e.textField])}}),t.watch(()=>e.modelValue,a=>{c.value=a,y(a)}),y(e.modelValue),{dataSource:d,displayText:r,editable:s,modelValue:c,getItemsByDisplayText:b,getItemsByValue:h,getSelectedItemsByDisplayText:v}}const x=t.defineComponent({name:"FComboTree",props:T,emits:["clear","update:modelValue","change"],setup(e,r){return()=>{const c=t.ref(),d=t.ref(e.disabled),s=t.ref(e.enableClear),h=t.ref(e.enableSearch),y=t.ref(e.readonly),{dataSource:b,displayText:S,editable:v,modelValue:f,getSelectedItemsByDisplayText:a}=P(e),l=t.computed(()=>e.multiSelect);t.computed(()=>c.value?c.value.elementRef.getBoundingClientRect().width:0);function i(){!l.value&&c.value&&c.value.hidePopup()}function u(o){S.value=o.map(g=>g[e.textField]).join(e.separator),f.value=o.map(g=>g[e.valueField]).join(e.separator),r.emit("update:modelValue",f.value),r.emit("change",o,f.value),i()}function V(o){f.value="",r.emit("update:modelValue",""),r.emit("clear")}function m(o){const g=a(o);u(g)}return t.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([o,g,D,N,M])=>{d.value=o,v.value=g,s.value=D,h.value=N,y.value=M}),t.createVNode(B,{ref:c,id:e.id,disable:d.value,readonly:y.value,forcePlaceholder:e.forcePlaceholder,editable:v.value,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:s.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text",modelValue:S.value,"onUpdate:modelValue":o=>S.value=o,onClear:V,onChange:m,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated},{default:()=>[t.createVNode(p,{idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,dataSource:b.value,selectedValues:f.value,onSelectionChange:u},null)]})}}}),j=O.withInstall(x);n.FComboTree=x,n.Placement=F,n.ViewType=C,n.comboTreeProps=T,n.default=j,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(y,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@farris/ui-vue/components/button-edit"),require("lodash-es"),require("@farris/ui-vue/components/tree-view"),require("@farris/ui-vue/components/common")):typeof define=="function"&&define.amd?define(["exports","vue","@farris/ui-vue/components/button-edit","lodash-es","@farris/ui-vue/components/tree-view","@farris/ui-vue/components/common"],r):(y=typeof globalThis<"u"?globalThis:y||self,r(y["combo-tree"]={},y.Vue,y.FButtonEdit,y.LodashES,y.FTreeView,y.common))})(this,function(y,r,w,j,P,M){"use strict";const N={},k={};function T(e){const{properties:l,title:s}=e,o=Object.keys(l).reduce((d,c)=>(d[c]=l[c].type==="object"&&l[c].properties?T(l[c]):j.cloneDeep(l[c].default),d),{});return o.id=`${s}-${Date.now()}`,o}function E(e,l){const s=T(l);return Object.keys(e).reduce((o,d)=>(o[d]=e[d],o),s),s}function I(e,l){return Object.keys(e).filter(o=>e[o]!=null).reduce((o,d)=>{if(l.has(d)){const c=l.get(d);if(typeof c=="string")o[c]=e[d];else{const f=c(d,e[d],e);Object.assign(o,f)}}else o[d]=e[d];return o},{})}function D(e,l,s=new Map){const o=E(e,l);return I(o,s)}function $(e={}){function l(a,t,n,i){if(typeof n=="number")return i[a].length===n;if(typeof n=="object"){const u=Object.keys(n)[0],m=n[u];if(u==="not")return Number(i[a].length)!==Number(m);if(u==="moreThan")return Number(i[a].length)>=Number(m);if(u==="lessThan")return Number(i[a].length)<=Number(m)}return!1}function s(a,t,n,i){return i[a]&&i[a].propertyValue&&String(i[a].propertyValue.value)===String(n)}const o=new Map([["length",l],["getProperty",s]]);Object.keys(e).reduce((a,t)=>(a.set(t,e[t]),a),o);function d(a,t){const n=a;return typeof t=="number"?[{target:n,operator:"length",param:null,value:Number(t)}]:typeof t=="boolean"?[{target:n,operator:"getProperty",param:a,value:!!t}]:typeof t=="object"?Object.keys(t).map(i=>{if(i==="length")return{target:n,operator:"length",param:null,value:t[i]};const u=i,m=t[i];return{target:n,operator:"getProperty",param:u,value:m}}):[]}function c(a){return Object.keys(a).reduce((n,i)=>{const u=d(i,a[i]);return n.push(...u),n},[])}function f(a,t){if(o.has(a.operator)){const n=o.get(a.operator);return n&&n(a.target,a.param,a.value,t)||!1}return!1}function p(a,t){return c(a).reduce((u,m)=>u&&f(m,t),!0)}function b(a,t){const n=Object.keys(a),i=n.includes("allOf"),u=n.includes("anyOf"),m=i||u,g=(m?a[m?i?"allOf":"anyOf":"allOf"]:[a]).map(F=>p(F,t));return i?!g.includes(!1):g.includes(!0)}return{parseValueSchema:b}}const R={},q={};$();function H(e,l,s=new Map,o=(f,p,b)=>p,d={},c=f=>f){return N[l.title]=l,k[l.title]=o,R[l.title]=d,q[l.title]=c,(f={})=>{const p=D(f,l,s),b=Object.keys(e).reduce((a,t)=>(a[t]=e[t].default,a),{});return Object.assign(b,p)}}function L(e,l){return{customClass:l.class,customStyle:l.style}}const A=new Map([["appearance",L]]),_={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},data:{description:"",type:"array"},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]};function U(e,l,s){return l}var x=(e=>(e.Text="text",e.Tag="tag",e))(x||{}),V=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(V||{});const v={id:{type:String},data:{type:Array,default:[]},displayText:{type:String,default:""},disabled:{type:Boolean,default:!1},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-60-down"></span>'},editable:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!0},enableSearch:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!0},fitEditor:{type:Boolean,default:!1},forcePlaceholder:{type:Boolean,default:!1},hidePanelOnClear:{type:Boolean,default:!0},idField:{type:String,default:"id"},mapFields:{type:Object},maxHeight:{type:Number,default:350},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String},placement:{type:String,default:"auto"},readonly:{type:Boolean,default:!1},remoteSearch:{type:Boolean,default:!1},separator:{type:String,default:","},tabIndex:{type:Number,default:-1},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},valueField:{type:String,default:"id"},viewType:{type:String,default:"text"},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},formatter:{type:Function,default:null},editorParams:{type:Object},repositoryToken:{type:Symbol,default:null}},O=H(v,_,A,U),W={data:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{default:!1,type:Boolean},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},height:{type:Number},valueField:{type:String,default:"id"},formatter:{type:Function},maxHeight:{type:Number,default:350},repositoryToken:{type:Symbol,default:null},editorParams:{type:Object}},z=r.defineComponent({name:"FComboTreeContainer",props:W,emits:["selectionChange"],setup(e,l){const s=r.ref(e.data),o=r.ref([]),d=r.ref(e.separator),c=r.ref(e.width),f=r.ref(e.height),p=r.ref(e.maxHeight),b=r.ref(String(e.selectedValues).split(d.value));let a=null;e.repositoryToken&&(a=r.inject(e.repositoryToken));const t=r.computed(()=>[{field:e.textField,title:"",dataType:"string",formatter:e.formatter}]),n=r.computed(()=>{const u={};return c.value!==void 0&&(u.width=`${c.value}px`),f.value!==void 0&&(u.height=`${f.value}px`),p.value!==void 0&&p.value>0&&(u.maxHeight=`${p.value}px`,u.overflow="auto"),u});function i(u){o.value=u.map(m=>Object.assign({},m)),b.value=u.map(m=>m[e.idField]),l.emit("selectionChange",o.value)}return r.onMounted(()=>{a&&a.getData(e.editorParams).then(u=>{s.value=u})}),()=>r.createVNode("div",{class:"f-combo-tree-container",style:n.value},[r.createVNode(P,{data:s.value,idField:e.idField,columns:t.value,"selection-values":b.value,onSelectionChange:i},null)])}});function G(e){const l=r.ref(""),s=r.ref(e.modelValue),o=r.ref(e.data||[]),d=r.ref(e.editable);function c(t){const n=String(t).split(e.separator).map(u=>[u,!0]),i=new Map(n);return o.value.filter(u=>i.has(String(u[e.valueField])))}function f(t){const n=c(t).map(i=>i[e.textField]).join(e.separator);l.value=d.value?n||t:n}function p(t){const n=t.split(e.separator).map(u=>[u,!0]),i=new Map(n);return o.value.filter(u=>i.has(u[e.textField]))}function b(t){const n={};return n[e.idField]=t,n[e.textField]=t,[n]}function a(t){let n=p(t);const i=n&&n.length>0;return d.value&&!i&&(n=b(t)),n}return r.watch(()=>e.data,()=>{o.value=e.data}),r.watch([o],([t])=>{if(e.modelValue){const n=t.find(i=>i[e.valueField]===e.modelValue);n&&(l.value=n[e.textField])}}),r.watch(()=>e.modelValue,t=>{s.value=t,f(t)}),f(e.modelValue),{dataSource:o,displayText:l,editable:d,modelValue:s,getItemsByDisplayText:p,getItemsByValue:c,getSelectedItemsByDisplayText:a}}const S=r.defineComponent({name:"FComboTree",props:v,emits:["clear","update:modelValue","change"],setup(e,l){return()=>{const s=r.ref(),o=r.ref(e.disabled),d=r.ref(e.enableClear),c=r.ref(e.enableSearch),f=r.ref(e.readonly),{dataSource:p,displayText:b,editable:a,modelValue:t,getSelectedItemsByDisplayText:n}=G(e),i=r.computed(()=>e.multiSelect);r.computed(()=>s.value?s.value.elementRef.getBoundingClientRect().width:0);function u(){!i.value&&s.value&&s.value.hidePopup()}function m(g){b.value=g.map(h=>h[e.textField]).join(e.separator),t.value=g.map(h=>h[e.valueField]).join(e.separator),l.emit("update:modelValue",t.value),l.emit("change",g,t.value),u()}function C(g){t.value="",l.emit("update:modelValue",""),l.emit("clear")}function B(g){const h=n(g);m(h)}return r.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([g,h,F,Q,X])=>{o.value=g,a.value=h,d.value=F,c.value=Q,f.value=X}),r.createVNode(w,{ref:s,id:e.id,disable:o.value,readonly:f.value,forcePlaceholder:e.forcePlaceholder,editable:a.value,buttonContent:e.dropDownIcon,placeholder:e.placeholder,enableClear:d.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?"tag":"text",modelValue:b.value,"onUpdate:modelValue":g=>b.value=g,onClear:C,onChange:B,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated},{default:()=>[r.createVNode(z,{maxHeight:e.maxHeight,idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,data:p.value,selectedValues:t.value,onSelectionChange:m,formatter:e.formatter,editorParams:e.editorParams,repositoryToken:e.repositoryToken},null)]})}}});S.register=(e,l,s,o)=>{e["combo-tree"]=S,l["combo-tree"]=O};const J=M.withInstall(S);y.FComboTree=S,y.Placement=V,y.ViewType=x,y.comboTreeProps=v,y.default=J,y.propsResolver=O,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1833,7 +1833,7 @@ const un = (t) => {
|
|
|
1833
1833
|
}, t;
|
|
1834
1834
|
}, sn = Symbol("checkboxGroupContext");
|
|
1835
1835
|
function cn(t, e, n, r) {
|
|
1836
|
-
const a = m(() => n == null ? void 0 : n.name), i = m(() => t.disabled || (n == null ? void 0 : n.disabled)), o = m(() => (n == null ? void 0 : n.mode) === "tag"), u = m(() => (n == null ? void 0 : n.mode) === "button"), c = m(() => !o.value && !u.value), f = m(() => (n == null ? void 0 : n.size) === "small"), w = m(() => (n == null ? void 0 : n.size) === "large"), x = m(() => (n == null ? void 0 : n.size) === "middle" || (n == null ? void 0 : n.size) !== "small" && (n == null ? void 0 : n.size) !== "large"), g = m(() => n ? n.modelValue === t.value || n.modelValue.includes(t.value) : t.checked), M = m(() => ({
|
|
1836
|
+
const a = m(() => n == null ? void 0 : n.name), i = m(() => t.disabled || (n == null ? void 0 : n.disabled)), o = m(() => (n == null ? void 0 : n.mode) === "tag"), u = m(() => (n == null ? void 0 : n.mode) === "button"), c = m(() => !o.value && !u.value), f = m(() => (n == null ? void 0 : n.size) === "small"), w = m(() => (n == null ? void 0 : n.size) === "large"), x = m(() => (n == null ? void 0 : n.size) === "middle" || (n == null ? void 0 : n.size) !== "small" && (n == null ? void 0 : n.size) !== "large"), g = m(() => n ? n.modelValue === t.value || n.modelValue.includes(t.value) : t.checked || t.modelValue), M = m(() => ({
|
|
1837
1837
|
btn: !0,
|
|
1838
1838
|
"f-radio-button": !0,
|
|
1839
1839
|
"btn-sm": f.value,
|
|
@@ -1869,7 +1869,7 @@ function cn(t, e, n, r) {
|
|
|
1869
1869
|
r.emit("update:modelValue", k), r.emit("changeValue", k);
|
|
1870
1870
|
}
|
|
1871
1871
|
else
|
|
1872
|
-
e.emit("update:checked", !g.value), e.emit("changeValue", !g.value), e.emit("change", { originalEvent: b, checked: !g.value });
|
|
1872
|
+
e.emit("update:checked", !g.value), e.emit("update:modelValue", !g.value), e.emit("changeValue", !g.value), e.emit("change", { originalEvent: b, checked: !g.value });
|
|
1873
1873
|
}
|
|
1874
1874
|
};
|
|
1875
1875
|
}
|