@farris/ui-vue 1.2.7 → 1.2.9
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 +136 -136
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +418 -456
- package/components/avatar/index.umd.cjs +1 -1
- package/components/border-editor/index.esm.js +4 -4
- package/components/border-editor/index.umd.cjs +1 -1
- package/components/button/index.esm.js +1 -1
- package/components/button/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +363 -436
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/button-group/index.esm.js +5 -5
- package/components/button-group/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +417 -417
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +176 -176
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +557 -594
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +119 -119
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +502 -535
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +69 -69
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +387 -275
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1219 -983
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +292 -219
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +5718 -5546
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3291 -2930
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2650 -2682
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/dependent-base/style.js +1 -0
- package/components/dependent-fluid/style.js +1 -0
- package/components/dependent-icon/style.js +1 -0
- package/components/dependent-input/style.js +1 -0
- package/components/dependent-table/style.js +1 -0
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +945 -932
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.css +1 -1
- package/components/designer-outline/index.esm.js +175 -133
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/designer-toolbox/index.esm.js +36 -12
- package/components/designer-toolbox/index.umd.cjs +1 -1
- package/components/discussion-editor/index.esm.js +1 -1
- package/components/discussion-editor/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +246 -246
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1319 -1172
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +119 -82
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +258 -249
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/enum-editor/index.esm.js +3 -3
- package/components/enum-editor/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +569 -514
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +104 -104
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3122 -2686
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +6780 -6608
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1466 -1523
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +1048 -1035
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +422 -422
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +674 -716
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +291 -291
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +303 -230
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +2486 -2130
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +7474 -7272
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +6139 -5949
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +1 -1
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +1 -1
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +432 -371
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +1124 -0
- package/components/number-range/index.umd.cjs +1 -0
- package/components/number-range/package.json +8 -0
- package/components/number-range/style.js +6 -0
- package/components/number-spinner/index.esm.js +1155 -0
- package/components/number-spinner/index.umd.cjs +1 -0
- package/components/number-spinner/package.json +8 -0
- package/components/number-spinner/style.js +4 -0
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1215 -1178
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +147 -147
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1240 -1346
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +489 -428
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +220 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1512 -1540
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.css +1 -1
- package/components/property-panel/index.esm.js +749 -815
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -0
- package/components/query-solution/index.esm.js +7074 -0
- package/components/query-solution/index.umd.cjs +1 -0
- package/components/query-solution/package.json +8 -0
- package/components/query-solution/style.js +2 -0
- package/components/radio-button/index.esm.js +86 -86
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +442 -479
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +213 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +116 -116
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +943 -918
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +1174 -1295
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +5383 -5171
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +201 -201
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +684 -542
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +121 -121
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/spacing-editor/index.esm.js +2 -2
- package/components/spacing-editor/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +1158 -382
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +232 -232
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +451 -487
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +2078 -2168
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +318 -320
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +192 -192
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +471 -497
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +1421 -1441
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +430 -421
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +6806 -6624
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2793 -2433
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +165 -165
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +255 -255
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +413 -334
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +902 -902
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +54155 -52847
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/button-edit/src/designer/button-group.design.component.d.ts +7 -0
- package/types/checkbox/index.d.ts +1 -0
- package/types/combo-list/src/components/list-container.component.d.ts +3 -0
- package/types/combo-list/src/components/list-container.props.d.ts +5 -1
- package/types/common/entity/entity-schema.d.ts +258 -0
- package/types/component/src/component-ref.props.d.ts +4 -0
- package/types/component/src/composition/inner-component-build-info.d.ts +27 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +33 -0
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/column-header.design.component.d.ts +1 -1
- package/types/data-grid/src/designer/data-grid-column.props.d.ts +1 -0
- package/types/data-grid/src/designer/use-group-column.d.ts +20 -0
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +4 -0
- package/types/data-grid/src/schema/schema-resolver.d.ts +2 -1
- package/types/data-view/components/column-format/boolean.component.d.ts +4 -0
- package/types/data-view/components/column-format/column-format.component.d.ts +4 -0
- package/types/data-view/components/column-format/date.component.d.ts +4 -0
- package/types/data-view/components/column-format/enum.component.d.ts +4 -0
- package/types/data-view/components/column-format/number.component.d.ts +4 -0
- package/types/data-view/composition/pagination/use-pagination.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +19 -7
- package/types/data-view/composition/use-edit.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +16 -350
- package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
- package/types/designer-canvas/src/types.d.ts +3 -3
- package/types/dynamic-form/index.d.ts +3 -1
- package/types/dynamic-form/src/composition/response-form-component-creator.service.d.ts +31 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +2 -1
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/binding-resolver.d.ts +1 -0
- package/types/dynamic-resolver/src/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/types.d.ts +3 -2
- package/types/dynamic-view/src/dynamic-view.component.d.ts +1 -1
- package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -1
- package/types/modal/src/modal.props.d.ts +1 -4
- package/types/property-panel/src/composition/entity/base-property.d.ts +0 -12
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +11 -26
- package/types/property-panel/src/composition/entity/schema-dom-mapping.d.ts +10 -8
- package/types/response-toolbar/src/response-toolbar.props.d.ts +2 -2
- package/types/response-toolbar/src/schema/schema-mapper.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +93 -0
- package/types/section/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +2 -2
- package/types/tabs/src/designer/tab-header-item.design.component.d.ts +3 -1
- package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +19 -0
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +60 -0
- package/types/tabs/src/property-config/tabs.property-config.d.ts +6 -6
- package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
- package/types/tags/index.d.ts +36 -5
- package/types/tree-grid/src/designer/use-designer-rules.d.ts +3 -0
- package/types/tree-grid/src/property-config/tree-grid.property-config.d.ts +11 -0
- package/types/tree-grid/src/schema/column-resolver.d.ts +1 -1
- package/types/tree-grid/src/tree-grid.props.d.ts +8 -0
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as j, ref as V, watch as v, createVNode as b, Fragment as C } from "vue";
|
|
2
2
|
import { cloneDeep as D } from "lodash-es";
|
|
3
3
|
const T = {}, $ = {};
|
|
4
4
|
function x(t) {
|
|
5
|
-
const { properties: e, title: u } = t, s = Object.keys(e).reduce((
|
|
6
|
-
return s.id = `${u}-${Date.now()}
|
|
5
|
+
const { properties: e, title: u, ignore: r } = t, s = r && Array.isArray(r), i = Object.keys(e).reduce((l, p) => ((!s || !r.find((g) => g == p)) && (l[p] = e[p].type === "object" && e[p].properties ? x(e[p]) : D(e[p].default)), l), {});
|
|
6
|
+
return (!s || !r.find((l) => l == "id")) && (i.id = `${u}-${Date.now()}`), i;
|
|
7
7
|
}
|
|
8
8
|
function w(t, e) {
|
|
9
9
|
const u = x(e);
|
|
10
|
-
return Object.keys(t).reduce((
|
|
10
|
+
return Object.keys(t).reduce((r, s) => (r[s] && typeof r[s] == "object" ? Object.assign(r[s], t[s]) : r[s] = t[s], r), u), u;
|
|
11
11
|
}
|
|
12
12
|
function M(t, e) {
|
|
13
|
-
return Object.keys(t).filter((
|
|
14
|
-
if (e.has(
|
|
15
|
-
const
|
|
16
|
-
if (typeof
|
|
17
|
-
|
|
13
|
+
return Object.keys(t).filter((r) => t[r] != null).reduce((r, s) => {
|
|
14
|
+
if (e.has(s)) {
|
|
15
|
+
const i = e.get(s);
|
|
16
|
+
if (typeof i == "string")
|
|
17
|
+
r[i] = t[s];
|
|
18
18
|
else {
|
|
19
|
-
const l =
|
|
20
|
-
Object.assign(
|
|
19
|
+
const l = i(s, t[s], t);
|
|
20
|
+
Object.assign(r, l);
|
|
21
21
|
}
|
|
22
22
|
} else
|
|
23
|
-
s
|
|
24
|
-
return
|
|
23
|
+
r[s] = t[s];
|
|
24
|
+
return r;
|
|
25
25
|
}, {});
|
|
26
26
|
}
|
|
27
27
|
function B(t, e, u = /* @__PURE__ */ new Map()) {
|
|
28
|
-
const
|
|
29
|
-
return M(
|
|
28
|
+
const r = w(t, e);
|
|
29
|
+
return M(r, u);
|
|
30
30
|
}
|
|
31
31
|
function N(t = {}) {
|
|
32
|
-
function e(n,
|
|
32
|
+
function e(n, o, a, c) {
|
|
33
33
|
if (typeof a == "number")
|
|
34
|
-
return
|
|
34
|
+
return c[n].length === a;
|
|
35
35
|
if (typeof a == "object") {
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
return Number(
|
|
39
|
-
if (
|
|
40
|
-
return Number(
|
|
41
|
-
if (
|
|
42
|
-
return Number(
|
|
36
|
+
const f = Object.keys(a)[0], d = a[f];
|
|
37
|
+
if (f === "not")
|
|
38
|
+
return Number(c[n].length) !== Number(d);
|
|
39
|
+
if (f === "moreThan")
|
|
40
|
+
return Number(c[n].length) >= Number(d);
|
|
41
|
+
if (f === "lessThan")
|
|
42
|
+
return Number(c[n].length) <= Number(d);
|
|
43
43
|
}
|
|
44
44
|
return !1;
|
|
45
45
|
}
|
|
46
|
-
function u(n,
|
|
47
|
-
return
|
|
46
|
+
function u(n, o, a, c) {
|
|
47
|
+
return c[n] && c[n].propertyValue && String(c[n].propertyValue.value) === String(a);
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const r = /* @__PURE__ */ new Map([
|
|
50
50
|
["length", e],
|
|
51
51
|
["getProperty", u]
|
|
52
52
|
]);
|
|
53
|
-
Object.keys(t).reduce((n,
|
|
54
|
-
function
|
|
53
|
+
Object.keys(t).reduce((n, o) => (n.set(o, t[o]), n), r);
|
|
54
|
+
function s(n, o) {
|
|
55
55
|
const a = n;
|
|
56
|
-
return typeof
|
|
57
|
-
if (
|
|
58
|
-
return { target: a, operator: "length", param: null, value:
|
|
59
|
-
const
|
|
60
|
-
return { target: a, operator: "getProperty", param:
|
|
56
|
+
return typeof o == "number" ? [{ target: a, operator: "length", param: null, value: Number(o) }] : typeof o == "boolean" ? [{ target: a, operator: "getProperty", param: n, value: !!o }] : typeof o == "object" ? Object.keys(o).map((c) => {
|
|
57
|
+
if (c === "length")
|
|
58
|
+
return { target: a, operator: "length", param: null, value: o[c] };
|
|
59
|
+
const f = c, d = o[c];
|
|
60
|
+
return { target: a, operator: "getProperty", param: f, value: d };
|
|
61
61
|
}) : [];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return Object.keys(n).reduce((a,
|
|
65
|
-
const
|
|
66
|
-
return a.push(...
|
|
63
|
+
function i(n) {
|
|
64
|
+
return Object.keys(n).reduce((a, c) => {
|
|
65
|
+
const f = s(c, n[c]);
|
|
66
|
+
return a.push(...f), a;
|
|
67
67
|
}, []);
|
|
68
68
|
}
|
|
69
|
-
function l(n,
|
|
70
|
-
if (
|
|
71
|
-
const a =
|
|
72
|
-
return a && a(n.target, n.param, n.value,
|
|
69
|
+
function l(n, o) {
|
|
70
|
+
if (r.has(n.operator)) {
|
|
71
|
+
const a = r.get(n.operator);
|
|
72
|
+
return a && a(n.target, n.param, n.value, o) || !1;
|
|
73
73
|
}
|
|
74
74
|
return !1;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
76
|
+
function p(n, o) {
|
|
77
|
+
return i(n).reduce((f, d) => f && l(d, o), !0);
|
|
78
78
|
}
|
|
79
|
-
function g(n,
|
|
80
|
-
const a = Object.keys(n),
|
|
81
|
-
return
|
|
79
|
+
function g(n, o) {
|
|
80
|
+
const a = Object.keys(n), c = a.includes("allOf"), f = a.includes("anyOf"), d = c || f, h = (d ? n[d ? c ? "allOf" : "anyOf" : "allOf"] : [n]).map((R) => p(R, o));
|
|
81
|
+
return c ? !h.includes(!1) : h.includes(!0);
|
|
82
82
|
}
|
|
83
83
|
return { parseValueSchema: g };
|
|
84
84
|
}
|
|
85
|
-
const
|
|
85
|
+
const A = {}, F = {};
|
|
86
86
|
N();
|
|
87
|
-
function
|
|
88
|
-
return T[e.title] = e, $[e.title] =
|
|
89
|
-
const
|
|
90
|
-
return Object.assign(g,
|
|
87
|
+
function k(t, e, u = /* @__PURE__ */ new Map(), r = (l, p, g) => p, s = {}, i = (l) => l) {
|
|
88
|
+
return T[e.title] = e, $[e.title] = r, A[e.title] = s, F[e.title] = i, (l = {}) => {
|
|
89
|
+
const p = B(l, e, u), g = Object.keys(t).reduce((n, o) => (n[o] = t[o].default, n), {});
|
|
90
|
+
return Object.assign(g, p);
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
function P(t, e) {
|
|
@@ -99,7 +99,7 @@ const q = /* @__PURE__ */ new Map([
|
|
|
99
99
|
function L(t, e, u) {
|
|
100
100
|
return e;
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const I = "https://json-schema.org/draft/2020-12/schema", S = "https://farris-design.gitee.io/radio-button.schema.json", z = "radio-button", G = "A Farris Component", H = "object", J = {
|
|
103
103
|
id: {
|
|
104
104
|
description: "The unique identifier for radio-button",
|
|
105
105
|
type: "string"
|
|
@@ -165,8 +165,8 @@ const S = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-de
|
|
|
165
165
|
"id",
|
|
166
166
|
"type"
|
|
167
167
|
], U = {
|
|
168
|
-
$schema:
|
|
169
|
-
$id:
|
|
168
|
+
$schema: I,
|
|
169
|
+
$id: S,
|
|
170
170
|
title: z,
|
|
171
171
|
description: G,
|
|
172
172
|
type: H,
|
|
@@ -199,7 +199,7 @@ const S = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-de
|
|
|
199
199
|
description: X,
|
|
200
200
|
type: Y,
|
|
201
201
|
categories: Z
|
|
202
|
-
},
|
|
202
|
+
}, m = {
|
|
203
203
|
/**
|
|
204
204
|
* 单选组枚举数组
|
|
205
205
|
*/
|
|
@@ -213,60 +213,60 @@ const S = "https://json-schema.org/draft/2020-12/schema", I = "https://farris-de
|
|
|
213
213
|
*/
|
|
214
214
|
onSelectedValueChanged: { type: Function, default: () => {
|
|
215
215
|
} }
|
|
216
|
-
},
|
|
216
|
+
}, O = k(m, U, q, L, _), y = /* @__PURE__ */ j({
|
|
217
217
|
name: "FRadioButton",
|
|
218
|
-
props:
|
|
218
|
+
props: m,
|
|
219
219
|
emits: ["selectedValueChanged"],
|
|
220
220
|
setup(t, e) {
|
|
221
|
-
const u =
|
|
222
|
-
function
|
|
223
|
-
if (
|
|
221
|
+
const u = V(t.enumData);
|
|
222
|
+
function r(i, l) {
|
|
223
|
+
if (i.currentTarget.classList.value = "btn btn-secondary active", i.currentTarget.tagName.toLowerCase() === "label") {
|
|
224
224
|
const {
|
|
225
|
-
currentTarget:
|
|
226
|
-
} =
|
|
227
|
-
Array.from(g.querySelectorAll("label")).filter((
|
|
225
|
+
currentTarget: p
|
|
226
|
+
} = i, g = p.parentElement;
|
|
227
|
+
Array.from(g.querySelectorAll("label")).filter((o) => o !== p).forEach((o) => o.classList.remove("active"));
|
|
228
228
|
}
|
|
229
229
|
e.emit("selectedValueChanged", l);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
return `${
|
|
231
|
+
function s(i) {
|
|
232
|
+
return `${i.text}${t.suffixValue}`;
|
|
233
233
|
}
|
|
234
|
-
return
|
|
235
|
-
|
|
236
|
-
}), () =>
|
|
234
|
+
return v(() => t.enumData, (i, l) => {
|
|
235
|
+
i !== l && (u.value = t.enumData);
|
|
236
|
+
}), () => b("div", {
|
|
237
237
|
class: "f-radio-button"
|
|
238
|
-
}, [
|
|
238
|
+
}, [b("div", {
|
|
239
239
|
class: ["farris-input-wrap"]
|
|
240
|
-
}, [u.value.map((
|
|
241
|
-
class:
|
|
242
|
-
onClick: (
|
|
243
|
-
}, [
|
|
240
|
+
}, [u.value.map((i, l) => b(C, null, [b("label", {
|
|
241
|
+
class: i.active ? "btn btn-secondary active" : "btn btn-secondary",
|
|
242
|
+
onClick: (p) => r(p, i)
|
|
243
|
+
}, [b("span", {
|
|
244
244
|
class: "f-radio-button-text"
|
|
245
|
-
}, [
|
|
245
|
+
}, [s(i)])])]))])]);
|
|
246
246
|
}
|
|
247
|
-
}), K = /* @__PURE__ */
|
|
247
|
+
}), K = /* @__PURE__ */ j({
|
|
248
248
|
name: "FRadioButtonDesign",
|
|
249
|
-
props:
|
|
249
|
+
props: m,
|
|
250
250
|
emits: [""],
|
|
251
251
|
setup(t, e) {
|
|
252
|
-
return () =>
|
|
252
|
+
return () => b(C, null, null);
|
|
253
253
|
}
|
|
254
|
-
}),
|
|
254
|
+
}), tt = (t) => {
|
|
255
255
|
const e = t;
|
|
256
256
|
return e.install = function(u) {
|
|
257
257
|
u.component(e.name, t);
|
|
258
258
|
}, t;
|
|
259
259
|
};
|
|
260
|
-
y.register = (t, e, u,
|
|
261
|
-
t["radio-button"] = y, e["radio-button"] =
|
|
260
|
+
y.register = (t, e, u, r) => {
|
|
261
|
+
t["radio-button"] = y, e["radio-button"] = O;
|
|
262
262
|
};
|
|
263
263
|
y.registerDesigner = (t, e, u) => {
|
|
264
|
-
t["radio-button"] = K, e["radio-button"] =
|
|
264
|
+
t["radio-button"] = K, e["radio-button"] = O;
|
|
265
265
|
};
|
|
266
|
-
const
|
|
266
|
+
const st = tt(y);
|
|
267
267
|
export {
|
|
268
268
|
y as RadioButton,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
st as default,
|
|
270
|
+
O as propsResolver,
|
|
271
|
+
m as radioButtonProps
|
|
272
272
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(g,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],d):(g=typeof globalThis<"u"?globalThis:g||self,d(g["radio-button"]={},g.Vue,g.LodashES))})(this,function(g,d,$){"use strict";const O={},N={};function j(e){const{properties:t,title:u,ignore:r}=e,s=r&&Array.isArray(r),i=Object.keys(t).reduce((l,p)=>((!s||!r.find(b=>b==p))&&(l[p]=t[p].type==="object"&&t[p].properties?j(t[p]):$.cloneDeep(t[p].default)),l),{});return(!s||!r.find(l=>l=="id"))&&(i.id=`${u}-${Date.now()}`),i}function R(e,t){const u=j(t);return Object.keys(e).reduce((r,s)=>(r[s]&&typeof r[s]=="object"?Object.assign(r[s],e[s]):r[s]=e[s],r),u),u}function T(e,t){return Object.keys(e).filter(r=>e[r]!=null).reduce((r,s)=>{if(t.has(s)){const i=t.get(s);if(typeof i=="string")r[i]=e[s];else{const l=i(s,e[s],e);Object.assign(r,l)}}else r[s]=e[s];return r},{})}function E(e,t,u=new Map){const r=R(e,t);return T(r,u)}function x(e={}){function t(n,o,a,c){if(typeof a=="number")return c[n].length===a;if(typeof a=="object"){const f=Object.keys(a)[0],y=a[f];if(f==="not")return Number(c[n].length)!==Number(y);if(f==="moreThan")return Number(c[n].length)>=Number(y);if(f==="lessThan")return Number(c[n].length)<=Number(y)}return!1}function u(n,o,a,c){return c[n]&&c[n].propertyValue&&String(c[n].propertyValue.value)===String(a)}const r=new Map([["length",t],["getProperty",u]]);Object.keys(e).reduce((n,o)=>(n.set(o,e[o]),n),r);function s(n,o){const a=n;return typeof o=="number"?[{target:a,operator:"length",param:null,value:Number(o)}]:typeof o=="boolean"?[{target:a,operator:"getProperty",param:n,value:!!o}]:typeof o=="object"?Object.keys(o).map(c=>{if(c==="length")return{target:a,operator:"length",param:null,value:o[c]};const f=c,y=o[c];return{target:a,operator:"getProperty",param:f,value:y}}):[]}function i(n){return Object.keys(n).reduce((a,c)=>{const f=s(c,n[c]);return a.push(...f),a},[])}function l(n,o){if(r.has(n.operator)){const a=r.get(n.operator);return a&&a(n.target,n.param,n.value,o)||!1}return!1}function p(n,o){return i(n).reduce((f,y)=>f&&l(y,o),!0)}function b(n,o){const a=Object.keys(n),c=a.includes("allOf"),f=a.includes("anyOf"),y=c||f,C=(y?n[y?c?"allOf":"anyOf":"allOf"]:[n]).map(S=>p(S,o));return c?!C.includes(!1):C.includes(!0)}return{parseValueSchema:b}}const M={},B={};x();function D(e,t,u=new Map,r=(l,p,b)=>p,s={},i=l=>l){return O[t.title]=t,N[t.title]=r,M[t.title]=s,B[t.title]=i,(l={})=>{const p=E(l,t,u),b=Object.keys(e).reduce((n,o)=>(n[o]=e[o].default,n),{});return Object.assign(b,p)}}function w(e,t){return{customClass:t.class,customStyle:t.style}}const F=new Map([["appearance",w]]);function P(e,t,u){return t}const q={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-button.schema.json",title:"radio-button",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for radio-button",type:"string"},type:{description:"The type string of radio-button",type:"string",default:"radio-button"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},A={title:"radio-button",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:[]}}}}}},h={enumData:{type:Array,default:[{text:"1",active:!0}]},suffixValue:{type:String,default:""},onSelectedValueChanged:{type:Function,default:()=>{}}},V=D(h,q,F,P,A),m=d.defineComponent({name:"FRadioButton",props:h,emits:["selectedValueChanged"],setup(e,t){const u=d.ref(e.enumData);function r(i,l){if(i.currentTarget.classList.value="btn btn-secondary active",i.currentTarget.tagName.toLowerCase()==="label"){const{currentTarget:p}=i,b=p.parentElement;Array.from(b.querySelectorAll("label")).filter(o=>o!==p).forEach(o=>o.classList.remove("active"))}t.emit("selectedValueChanged",l)}function s(i){return`${i.text}${e.suffixValue}`}return d.watch(()=>e.enumData,(i,l)=>{i!==l&&(u.value=e.enumData)}),()=>d.createVNode("div",{class:"f-radio-button"},[d.createVNode("div",{class:["farris-input-wrap"]},[u.value.map((i,l)=>d.createVNode(d.Fragment,null,[d.createVNode("label",{class:i.active?"btn btn-secondary active":"btn btn-secondary",onClick:p=>r(p,i)},[d.createVNode("span",{class:"f-radio-button-text"},[s(i)])])]))])])}}),k=d.defineComponent({name:"FRadioButtonDesign",props:h,emits:[""],setup(e,t){return()=>d.createVNode(d.Fragment,null,null)}}),L=e=>{const t=e;return t.install=function(u){u.component(t.name,e)},e};m.register=(e,t,u,r)=>{e["radio-button"]=m,t["radio-button"]=V},m.registerDesigner=(e,t,u)=>{e["radio-button"]=k,t["radio-button"]=V};const v=L(m);g.RadioButton=m,g.default=v,g.propsResolver=V,g.radioButtonProps=h,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|