@farris/ui-vue 1.2.9 → 1.3.0
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 +63 -63
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +402 -323
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +98 -96
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +66 -66
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +118 -118
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +539 -460
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +135 -135
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1007 -312
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +97 -97
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +778 -700
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +472 -329
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2231 -1055
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +79 -79
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6408 -5034
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4762 -3511
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3442 -2742
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +73 -73
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2597 -1141
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +114 -71
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +171 -171
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3075 -2586
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5272 -8511
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1726 -1822
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +126 -126
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +620 -540
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +88 -88
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +71 -71
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3582 -2356
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10752 -8972
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5601 -5329
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +535 -452
- package/components/nav/index.umd.cjs +2 -2
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +556 -477
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +504 -425
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1833 -1054
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +899 -870
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +576 -487
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +73 -73
- package/components/progress/index.umd.cjs +2 -2
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +1916 -1220
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +783 -886
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +3632 -2556
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +484 -405
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +152 -152
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +73 -73
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1081 -1043
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +753 -738
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4418 -4177
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +119 -119
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +92 -91
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +59 -59
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +103 -103
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +85 -85
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +457 -378
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +1696 -1617
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +53 -53
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +268 -268
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +420 -341
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1062 -981
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +381 -379
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5252 -9560
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3920 -2692
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +373 -367
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +92 -92
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +597 -417
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +251 -251
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +17125 -16176
- package/farris.all.umd.cjs +8 -8
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +1 -1
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +18 -1
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +1 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +2 -2
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/data-grid/src/designer/use-group-column.d.ts +0 -20
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cloneDeep as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as K, ref as r, onMounted as J, computed as W, watch as te, createVNode as D, withModifiers as R, createTextVNode as L, inject as ae } from "vue";
|
|
2
|
+
import { isPlainObject as Z, cloneDeep as le } from "lodash-es";
|
|
3
|
+
const x = {}, I = {};
|
|
4
4
|
function Q(t) {
|
|
5
|
-
const { properties: e, title: a, ignore: n } = t,
|
|
6
|
-
return (!
|
|
5
|
+
const { properties: e, title: a, ignore: n } = t, o = n && Array.isArray(n), b = Object.keys(e).reduce((m, h) => ((!o || !n.find((E) => E == h)) && (m[h] = e[h].type === "object" && e[h].properties ? Q(e[h]) : le(e[h].default)), m), {});
|
|
6
|
+
return (!o || !n.find((m) => m == "id")) && (b.id = `${a}-${Date.now()}`), b;
|
|
7
7
|
}
|
|
8
8
|
function G(t, e = {}, a) {
|
|
9
|
-
const n =
|
|
9
|
+
const n = x[t];
|
|
10
10
|
if (n) {
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
return
|
|
11
|
+
let o = Q(n);
|
|
12
|
+
const b = I[t];
|
|
13
|
+
return o = b ? b({ getSchemaByType: G }, o, e, a) : o, o;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function re(t, e) {
|
|
18
18
|
const a = Q(e);
|
|
19
|
-
return Object.keys(t).reduce((n,
|
|
19
|
+
return Object.keys(t).reduce((n, o) => (n[o] && Z(n[o]) && Z(t[o]) ? Object.assign(n[o], t[o]) : n[o] = t[o], n), a), a;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return Object.keys(t).filter((n) => t[n] != null).reduce((n,
|
|
23
|
-
if (e.has(
|
|
24
|
-
const
|
|
25
|
-
if (typeof
|
|
26
|
-
n[
|
|
21
|
+
function ne(t, e) {
|
|
22
|
+
return Object.keys(t).filter((n) => t[n] != null).reduce((n, o) => {
|
|
23
|
+
if (e.has(o)) {
|
|
24
|
+
const b = e.get(o);
|
|
25
|
+
if (typeof b == "string")
|
|
26
|
+
n[b] = t[o];
|
|
27
27
|
else {
|
|
28
|
-
const m =
|
|
28
|
+
const m = b(o, t[o], t);
|
|
29
29
|
Object.assign(n, m);
|
|
30
30
|
}
|
|
31
31
|
} else
|
|
32
|
-
n[
|
|
32
|
+
n[o] = t[o];
|
|
33
33
|
return n;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const n =
|
|
38
|
-
return
|
|
36
|
+
function oe(t, e, a = /* @__PURE__ */ new Map()) {
|
|
37
|
+
const n = re(t, e);
|
|
38
|
+
return ne(n, a);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
function e(l, u,
|
|
42
|
-
if (typeof
|
|
43
|
-
return f[l].length ===
|
|
44
|
-
if (typeof
|
|
45
|
-
const S = Object.keys(
|
|
40
|
+
function se(t = {}) {
|
|
41
|
+
function e(l, u, d, f) {
|
|
42
|
+
if (typeof d == "number")
|
|
43
|
+
return f[l].length === d;
|
|
44
|
+
if (typeof d == "object") {
|
|
45
|
+
const S = Object.keys(d)[0], M = d[S];
|
|
46
46
|
if (S === "not")
|
|
47
47
|
return Number(f[l].length) !== Number(M);
|
|
48
48
|
if (S === "moreThan")
|
|
@@ -52,63 +52,63 @@ function oe(t = {}) {
|
|
|
52
52
|
}
|
|
53
53
|
return !1;
|
|
54
54
|
}
|
|
55
|
-
function a(l, u,
|
|
56
|
-
return f[l] && f[l].propertyValue && String(f[l].propertyValue.value) === String(
|
|
55
|
+
function a(l, u, d, f) {
|
|
56
|
+
return f[l] && f[l].propertyValue && String(f[l].propertyValue.value) === String(d);
|
|
57
57
|
}
|
|
58
58
|
const n = /* @__PURE__ */ new Map([
|
|
59
59
|
["length", e],
|
|
60
60
|
["getProperty", a]
|
|
61
61
|
]);
|
|
62
62
|
Object.keys(t).reduce((l, u) => (l.set(u, t[u]), l), n);
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return typeof u == "number" ? [{ target:
|
|
63
|
+
function o(l, u) {
|
|
64
|
+
const d = l;
|
|
65
|
+
return typeof u == "number" ? [{ target: d, operator: "length", param: null, value: Number(u) }] : typeof u == "boolean" ? [{ target: d, operator: "getProperty", param: l, value: !!u }] : typeof u == "object" ? Object.keys(u).map((f) => {
|
|
66
66
|
if (f === "length")
|
|
67
|
-
return { target:
|
|
67
|
+
return { target: d, operator: "length", param: null, value: u[f] };
|
|
68
68
|
const S = f, M = u[f];
|
|
69
|
-
return { target:
|
|
69
|
+
return { target: d, operator: "getProperty", param: S, value: M };
|
|
70
70
|
}) : [];
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return Object.keys(l).reduce((
|
|
74
|
-
const S =
|
|
75
|
-
return
|
|
72
|
+
function b(l) {
|
|
73
|
+
return Object.keys(l).reduce((d, f) => {
|
|
74
|
+
const S = o(f, l[f]);
|
|
75
|
+
return d.push(...S), d;
|
|
76
76
|
}, []);
|
|
77
77
|
}
|
|
78
78
|
function m(l, u) {
|
|
79
79
|
if (n.has(l.operator)) {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
80
|
+
const d = n.get(l.operator);
|
|
81
|
+
return d && d(l.target, l.param, l.value, u) || !1;
|
|
82
82
|
}
|
|
83
83
|
return !1;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function h(l, u) {
|
|
86
|
+
return b(l).reduce((S, M) => S && m(M, u), !0);
|
|
87
87
|
}
|
|
88
88
|
function E(l, u) {
|
|
89
|
-
const
|
|
89
|
+
const d = Object.keys(l), f = d.includes("allOf"), S = d.includes("anyOf"), M = f || S, O = (M ? l[M ? f ? "allOf" : "anyOf" : "allOf"] : [l]).map((p) => h(p, u));
|
|
90
90
|
return f ? !O.includes(!1) : O.includes(!0);
|
|
91
91
|
}
|
|
92
92
|
return { parseValueSchema: E };
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
return
|
|
98
|
-
const
|
|
99
|
-
return Object.assign(E,
|
|
94
|
+
const ue = {}, ie = {};
|
|
95
|
+
se();
|
|
96
|
+
function ce(t, e, a = /* @__PURE__ */ new Map(), n = (m, h, E) => h, o = {}, b = (m) => m) {
|
|
97
|
+
return x[e.title] = e, I[e.title] = n, ue[e.title] = o, ie[e.title] = b, (m = {}) => {
|
|
98
|
+
const h = oe(m, e, a), E = Object.keys(t).reduce((l, u) => (l[u] = t[u].default, l), {});
|
|
99
|
+
return Object.assign(E, h);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function fe(t, e) {
|
|
103
103
|
return { customClass: e.class, customStyle: e.style };
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
["appearance",
|
|
105
|
+
const de = /* @__PURE__ */ new Map([
|
|
106
|
+
["appearance", fe]
|
|
107
107
|
]);
|
|
108
108
|
function pe(t, e, a) {
|
|
109
109
|
return e;
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const ve = "https://json-schema.org/draft/2020-12/schema", me = "https://farris-design.gitee.io/rate.schema.json", ge = "rate", ye = "A Farris Component", be = "object", he = {
|
|
112
112
|
id: {
|
|
113
113
|
description: "The unique identifier for rate",
|
|
114
114
|
type: "string"
|
|
@@ -170,23 +170,23 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
170
170
|
type: "boolean",
|
|
171
171
|
default: !0
|
|
172
172
|
}
|
|
173
|
-
},
|
|
173
|
+
}, Se = [
|
|
174
174
|
"id",
|
|
175
175
|
"type"
|
|
176
|
-
],
|
|
176
|
+
], Me = [
|
|
177
177
|
"id",
|
|
178
178
|
"appearance",
|
|
179
179
|
"binding"
|
|
180
|
-
],
|
|
181
|
-
$schema:
|
|
182
|
-
$id:
|
|
183
|
-
title:
|
|
184
|
-
description:
|
|
185
|
-
type:
|
|
180
|
+
], Oe = {
|
|
181
|
+
$schema: ve,
|
|
182
|
+
$id: me,
|
|
183
|
+
title: ge,
|
|
184
|
+
description: ye,
|
|
185
|
+
type: be,
|
|
186
186
|
properties: he,
|
|
187
|
-
required:
|
|
188
|
-
ignore:
|
|
189
|
-
},
|
|
187
|
+
required: Se,
|
|
188
|
+
ignore: Me
|
|
189
|
+
}, Te = "rate", ke = "A Farris Component", De = "object", Ne = {
|
|
190
190
|
basic: {
|
|
191
191
|
description: "Basic Infomation",
|
|
192
192
|
title: "基本信息",
|
|
@@ -208,11 +208,11 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
},
|
|
212
|
-
title:
|
|
213
|
-
description:
|
|
214
|
-
type:
|
|
215
|
-
categories:
|
|
211
|
+
}, je = {
|
|
212
|
+
title: Te,
|
|
213
|
+
description: ke,
|
|
214
|
+
type: De,
|
|
215
|
+
categories: Ne
|
|
216
216
|
}, Ve = ["很不满意", "不满意", "一般", "满意", "非常满意"], U = {
|
|
217
217
|
/** 星星大小 */
|
|
218
218
|
size: { type: String, default: "large" },
|
|
@@ -245,14 +245,14 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
245
245
|
*/
|
|
246
246
|
value: { type: Number, default: 0 },
|
|
247
247
|
modelValue: { type: Number, default: 0 }
|
|
248
|
-
},
|
|
248
|
+
}, ee = ce(U, Oe, de, pe, je), z = /* @__PURE__ */ K({
|
|
249
249
|
name: "FRate",
|
|
250
250
|
props: U,
|
|
251
251
|
emits: ["selectedValue", "update:modelValue"],
|
|
252
252
|
setup(t, e) {
|
|
253
|
-
const a = r(t.size), n = r(t.enableHalf),
|
|
253
|
+
const a = r(t.size), n = r(t.enableHalf), o = r(t.enableClear), b = r(t.disabled), m = r(t.pointSystem), h = r(t.lightColor), E = r(t.darkColor), l = r(t.iconClass), u = r(t.numOfStar), d = r(t.toolTipDisabled), f = r(t.toolTipContents), S = r(t.enableScore), M = r(t.enableSatisfaction);
|
|
254
254
|
let v;
|
|
255
|
-
const T = r(0), O = r(0), k = r(0),
|
|
255
|
+
const T = r(0), O = r(0), k = r(0), p = r(t.modelValue);
|
|
256
256
|
let N = 1, w, c, g;
|
|
257
257
|
const y = 4;
|
|
258
258
|
J(() => {
|
|
@@ -260,14 +260,14 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
260
260
|
function C() {
|
|
261
261
|
const i = u.value;
|
|
262
262
|
g = [];
|
|
263
|
-
for (let
|
|
263
|
+
for (let j = 1; j <= i; j++)
|
|
264
264
|
g.push({
|
|
265
|
-
id:
|
|
265
|
+
id: j
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function P() {
|
|
269
269
|
let i;
|
|
270
|
-
n.value ? i = Math.ceil(
|
|
270
|
+
n.value ? i = Math.ceil(p.value / N) : i = p.value, O.value = (v * p.value + Math.floor(p.value) * y) / N, w = f.value[i - 1];
|
|
271
271
|
}
|
|
272
272
|
function A() {
|
|
273
273
|
switch (a.value) {
|
|
@@ -284,48 +284,48 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
284
284
|
v = 24;
|
|
285
285
|
break;
|
|
286
286
|
}
|
|
287
|
-
C(), u.value && (N = m.value / u.value),
|
|
287
|
+
C(), u.value && (N = m.value / u.value), p.value && P();
|
|
288
288
|
}
|
|
289
289
|
A();
|
|
290
290
|
function $(i) {
|
|
291
291
|
return i.className.indexOf("f-icon") !== -1;
|
|
292
292
|
}
|
|
293
293
|
function H() {
|
|
294
|
-
return T.value === O.value &&
|
|
294
|
+
return T.value === O.value && o.value && O.value !== 0 ? (O.value = 0, p.value = 0, c = null, T.value = 0, k.value = 0, e.emit("selectedValue", p.value), e.emit("update:modelValue", p.value), !0) : !1;
|
|
295
295
|
}
|
|
296
|
-
function q(i,
|
|
296
|
+
function q(i, j, s) {
|
|
297
297
|
if (i.movementX || i.movementY) {
|
|
298
|
-
if (
|
|
298
|
+
if (b.value)
|
|
299
299
|
return;
|
|
300
|
-
M.value && (w = f.value[
|
|
300
|
+
M.value && (w = f.value[j - 1]), i.offsetX < v / 2 && n.value === !0 ? (T.value = v * j - v / 2 + y * (j - 1), k.value = N * j - N / 2) : (T.value = v * j + y * (j - 1), k.value = N * j);
|
|
301
301
|
}
|
|
302
|
-
if (
|
|
302
|
+
if (s === !0) {
|
|
303
303
|
if (H())
|
|
304
304
|
return;
|
|
305
|
-
|
|
305
|
+
p.value = k.value, O.value = T.value, c = w, e.emit("update:modelValue", p.value), e.emit("selectedValue", p.value);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
function F(i,
|
|
309
|
-
var
|
|
308
|
+
function F(i, j) {
|
|
309
|
+
var s;
|
|
310
310
|
if ($(i.target) && i.target) {
|
|
311
|
-
const
|
|
312
|
-
q(i,
|
|
311
|
+
const V = parseInt((s = i.target) == null ? void 0 : s.id);
|
|
312
|
+
q(i, V, j);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
const X = W(() => k.value ? k.value + "分" :
|
|
315
|
+
const X = W(() => k.value ? k.value + "分" : p.value + "分"), _ = W(() => ({
|
|
316
316
|
width: (T.value || O.value) + "px"
|
|
317
317
|
}));
|
|
318
318
|
function B() {
|
|
319
319
|
T.value = 0;
|
|
320
320
|
}
|
|
321
|
-
return
|
|
322
|
-
|
|
321
|
+
return te(() => t.modelValue, (i) => {
|
|
322
|
+
p.value = i, P();
|
|
323
323
|
}), () => D("div", {
|
|
324
324
|
class: "farris-star-rating",
|
|
325
|
-
onMouseover:
|
|
326
|
-
onMousemove:
|
|
327
|
-
onMouseleave:
|
|
328
|
-
onClick:
|
|
325
|
+
onMouseover: R((i) => F(i, !1), ["prevent"]),
|
|
326
|
+
onMousemove: R((i) => F(i, !1), ["prevent"]),
|
|
327
|
+
onMouseleave: R((i) => B(), ["prevent"]),
|
|
328
|
+
onClick: R((i) => F(i, !0), ["prevent"])
|
|
329
329
|
}, [D("div", {
|
|
330
330
|
class: "star-light-area",
|
|
331
331
|
style: _.value
|
|
@@ -339,11 +339,11 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
339
339
|
}, {
|
|
340
340
|
"f-star-exlarge": a.value === "extraLarge"
|
|
341
341
|
}, {
|
|
342
|
-
disabled:
|
|
342
|
+
disabled: d.value
|
|
343
343
|
}],
|
|
344
344
|
id: i.id,
|
|
345
345
|
style: {
|
|
346
|
-
color:
|
|
346
|
+
color: h.value
|
|
347
347
|
}
|
|
348
348
|
}, null))]), D("div", {
|
|
349
349
|
class: ["star-dark-area", {
|
|
@@ -380,12 +380,12 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
380
380
|
}, [S.value && D("span", null, [L(" "), X.value, L(" ")]), M.value && (c || w) && D("span", null, [L(" "), w || c])])]);
|
|
381
381
|
}
|
|
382
382
|
});
|
|
383
|
-
function
|
|
383
|
+
function we(t, e, a) {
|
|
384
384
|
var w;
|
|
385
385
|
function n() {
|
|
386
386
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
387
|
+
const o = "", b = "", m = r();
|
|
388
|
+
function h() {
|
|
389
389
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
390
390
|
}
|
|
391
391
|
function E() {
|
|
@@ -397,12 +397,12 @@ function je(t, e, a) {
|
|
|
397
397
|
function u() {
|
|
398
398
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function d(c) {
|
|
401
401
|
if (!c || !c.value)
|
|
402
402
|
return null;
|
|
403
403
|
if (c.value.schema && c.value.schema.type === "component")
|
|
404
404
|
return c.value;
|
|
405
|
-
const g = r(c == null ? void 0 : c.value.parent), y =
|
|
405
|
+
const g = r(c == null ? void 0 : c.value.parent), y = d(g);
|
|
406
406
|
return y || null;
|
|
407
407
|
}
|
|
408
408
|
function f(c = e) {
|
|
@@ -422,22 +422,22 @@ function je(t, e, a) {
|
|
|
422
422
|
function O(c, g) {
|
|
423
423
|
const { componentType: y } = c;
|
|
424
424
|
let C = G(y, c, g);
|
|
425
|
-
const
|
|
426
|
-
return C && !C.id && C.type === y && (C.id = `${
|
|
425
|
+
const P = y.toLowerCase().replace("-", "_");
|
|
426
|
+
return C && !C.id && C.type === y && (C.id = `${P}_${Math.random().toString().slice(2, 6)}`), C;
|
|
427
427
|
}
|
|
428
428
|
function k(c, g) {
|
|
429
|
-
const y = String(c.getAttribute("data-controltype")), C = c.getAttribute("data-feature"),
|
|
430
|
-
|
|
431
|
-
let A = G(y,
|
|
429
|
+
const y = String(c.getAttribute("data-controltype")), C = c.getAttribute("data-feature"), P = C ? JSON.parse(C) : {};
|
|
430
|
+
P.parentComponentInstance = m.value;
|
|
431
|
+
let A = G(y, P);
|
|
432
432
|
const $ = y.toLowerCase().replace("-", "_");
|
|
433
433
|
return A && !A.id && A.type === y && (A.id = `${$}_${Math.random().toString().slice(2, 6)}`), A;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function p(c) {
|
|
436
436
|
}
|
|
437
437
|
function N(...c) {
|
|
438
438
|
}
|
|
439
439
|
return m.value = {
|
|
440
|
-
canMove:
|
|
440
|
+
canMove: h(),
|
|
441
441
|
canSelectParent: E(),
|
|
442
442
|
canDelete: l(),
|
|
443
443
|
canNested: !u(),
|
|
@@ -445,50 +445,50 @@ function je(t, e, a) {
|
|
|
445
445
|
elementRef: t,
|
|
446
446
|
parent: (w = e == null ? void 0 : e.parent) == null ? void 0 : w.componentInstance,
|
|
447
447
|
schema: e == null ? void 0 : e.schema,
|
|
448
|
-
styles:
|
|
449
|
-
designerClass:
|
|
448
|
+
styles: o,
|
|
449
|
+
designerClass: b,
|
|
450
450
|
canAccepts: S,
|
|
451
|
-
getBelongedComponentInstance:
|
|
451
|
+
getBelongedComponentInstance: d,
|
|
452
452
|
getDraggableDesignItemElement: f,
|
|
453
453
|
getDraggingDisplayText: M,
|
|
454
454
|
getPropConfig: N,
|
|
455
455
|
getDragScopeElement: v,
|
|
456
456
|
onAcceptMovedChildElement: T,
|
|
457
457
|
onAcceptNewChildElement: k,
|
|
458
|
-
onChildElementMovedOut:
|
|
458
|
+
onChildElementMovedOut: p,
|
|
459
459
|
addNewChildComponentSchema: O,
|
|
460
460
|
updateDragAndDropRules: n,
|
|
461
461
|
triggerBelongedComponentToMoveWhenMoved: r(!1),
|
|
462
462
|
triggerBelongedComponentToDeleteWhenDeleted: r(!1)
|
|
463
463
|
}, m;
|
|
464
464
|
}
|
|
465
|
-
const
|
|
465
|
+
const Ce = /* @__PURE__ */ K({
|
|
466
466
|
name: "FRateDesign",
|
|
467
467
|
props: U,
|
|
468
468
|
emits: ["selectedValue"],
|
|
469
469
|
setup(t, e) {
|
|
470
|
-
const a = r(t.size), n = r(t.enableHalf),
|
|
470
|
+
const a = r(t.size), n = r(t.enableHalf), o = r(t.enableClear), b = r(t.disabled), m = r(t.pointSystem), h = r(t.lightColor), E = r(t.darkColor), l = r(t.iconClass), u = r(t.numOfStar), d = r(t.toolTipDisabled), f = r(t.toolTipContents), S = r(t.enableScore), M = r(t.enableSatisfaction);
|
|
471
471
|
let v;
|
|
472
472
|
const T = r(1);
|
|
473
473
|
let O = 0;
|
|
474
|
-
const k = r(0),
|
|
474
|
+
const k = r(0), p = r(0);
|
|
475
475
|
let N = 1, w, c, g;
|
|
476
|
-
const y = 4, C = r(),
|
|
476
|
+
const y = 4, C = r(), P = ae("design-item-context"), A = we(C, P);
|
|
477
477
|
J(() => {
|
|
478
478
|
C.value.componentInstance = A;
|
|
479
479
|
}), e.expose(A.value), J(() => {
|
|
480
480
|
});
|
|
481
481
|
function $() {
|
|
482
|
-
const
|
|
482
|
+
const s = u.value;
|
|
483
483
|
g = [];
|
|
484
|
-
for (let
|
|
484
|
+
for (let V = 1; V <= s; V++)
|
|
485
485
|
g.push({
|
|
486
|
-
id:
|
|
486
|
+
id: V
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
489
|
function H() {
|
|
490
|
-
let
|
|
491
|
-
n.value ?
|
|
490
|
+
let s;
|
|
491
|
+
n.value ? s = Math.ceil(p.value / N) : s = p.value, O = (v * p.value + Math.floor(p.value) * y) / N, w = f.value[s - 1];
|
|
492
492
|
}
|
|
493
493
|
function q() {
|
|
494
494
|
switch (a.value) {
|
|
@@ -505,47 +505,47 @@ const we = /* @__PURE__ */ Z({
|
|
|
505
505
|
v = 24;
|
|
506
506
|
break;
|
|
507
507
|
}
|
|
508
|
-
$(), u.value && (N = m.value / u.value),
|
|
508
|
+
$(), u.value && (N = m.value / u.value), p.value && H();
|
|
509
509
|
}
|
|
510
510
|
q();
|
|
511
|
-
function F(
|
|
512
|
-
return
|
|
511
|
+
function F(s) {
|
|
512
|
+
return s.className.indexOf("f-icon") !== -1;
|
|
513
513
|
}
|
|
514
514
|
function X() {
|
|
515
|
-
return T.value === O &&
|
|
515
|
+
return T.value === O && o && O !== 0 ? (O = 0, p.value = 0, c = null, T.value = 0, k.value = 0, e.emit("selectedValue", p.value), !0) : !1;
|
|
516
516
|
}
|
|
517
|
-
function _(
|
|
518
|
-
if (
|
|
519
|
-
if (
|
|
517
|
+
function _(s, V, Y) {
|
|
518
|
+
if (s.movementX || s.movementY) {
|
|
519
|
+
if (b.value)
|
|
520
520
|
return;
|
|
521
|
-
M.value && (w = f.value[
|
|
521
|
+
M.value && (w = f.value[V - 1]), s.offsetX < v / 2 && n.value === !0 ? (T.value = v * V - v / 2 + y * (V - 1), k.value = N * V - N / 2) : (T.value = v * V + y * (V - 1), k.value = N * V);
|
|
522
522
|
}
|
|
523
523
|
if (Y === !0) {
|
|
524
524
|
if (X())
|
|
525
525
|
return;
|
|
526
|
-
|
|
526
|
+
p.value = k.value, O = T.value, c = w, e.emit("selectedValue", p.value);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function B(
|
|
530
|
-
if (F(
|
|
531
|
-
const Y = parseInt(
|
|
532
|
-
_(
|
|
529
|
+
function B(s, V) {
|
|
530
|
+
if (F(s.target) && s.target) {
|
|
531
|
+
const Y = parseInt(s.target.id);
|
|
532
|
+
_(s, Y, V);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
const i = W(() => k.value ? k.value + "分" :
|
|
535
|
+
const i = W(() => k.value ? k.value + "分" : p.value + "分"), j = W(() => ({
|
|
536
536
|
width: (T.value || O) + "px"
|
|
537
537
|
}));
|
|
538
538
|
return () => D("div", {
|
|
539
539
|
class: "farris-star-rating",
|
|
540
540
|
ref: C,
|
|
541
|
-
onMouseover:
|
|
542
|
-
onMousemove:
|
|
543
|
-
onMouseout:
|
|
544
|
-
onClick:
|
|
541
|
+
onMouseover: R((s) => B(s, !1), ["prevent"]),
|
|
542
|
+
onMousemove: R((s) => B(s, !1), ["prevent"]),
|
|
543
|
+
onMouseout: R((s) => B(s, !1), ["prevent"]),
|
|
544
|
+
onClick: R((s) => B(s, !0), ["prevent"])
|
|
545
545
|
}, [D("div", {
|
|
546
546
|
class: "star-light-area",
|
|
547
|
-
style:
|
|
548
|
-
}, [g.map((
|
|
547
|
+
style: j.value
|
|
548
|
+
}, [g.map((s) => D("span", {
|
|
549
549
|
class: ["f-icon default-light-color ", l.value, {
|
|
550
550
|
"f-star-sm": a.value === "small"
|
|
551
551
|
}, {
|
|
@@ -555,11 +555,11 @@ const we = /* @__PURE__ */ Z({
|
|
|
555
555
|
}, {
|
|
556
556
|
"f-star-exlarge": a.value === "extraLarge"
|
|
557
557
|
}, {
|
|
558
|
-
disabled:
|
|
558
|
+
disabled: d.value
|
|
559
559
|
}],
|
|
560
|
-
id:
|
|
560
|
+
id: s.id,
|
|
561
561
|
style: {
|
|
562
|
-
color:
|
|
562
|
+
color: h.value
|
|
563
563
|
}
|
|
564
564
|
}, null))]), D("div", {
|
|
565
565
|
class: ["star-dark-area", {
|
|
@@ -569,7 +569,7 @@ const we = /* @__PURE__ */ Z({
|
|
|
569
569
|
}, {
|
|
570
570
|
large: a.value === "large"
|
|
571
571
|
}]
|
|
572
|
-
}, [g.map((
|
|
572
|
+
}, [g.map((s) => D("span", {
|
|
573
573
|
class: ["f-icon default-dark-color", l.value, {
|
|
574
574
|
"f-star-sm": a.value === "small"
|
|
575
575
|
}, {
|
|
@@ -579,7 +579,7 @@ const we = /* @__PURE__ */ Z({
|
|
|
579
579
|
}, {
|
|
580
580
|
"f-star-exlarge": a.value === "extraLarge"
|
|
581
581
|
}],
|
|
582
|
-
id:
|
|
582
|
+
id: s.id,
|
|
583
583
|
style: {
|
|
584
584
|
color: E.value
|
|
585
585
|
}
|
|
@@ -595,22 +595,22 @@ const we = /* @__PURE__ */ Z({
|
|
|
595
595
|
}]
|
|
596
596
|
}, [S.value && D("span", null, [L(" "), i.value, L(" ")]), M.value && (c || w) && D("span", null, [L(" "), w || c])])]);
|
|
597
597
|
}
|
|
598
|
-
}),
|
|
598
|
+
}), Ee = (t) => {
|
|
599
599
|
const e = t;
|
|
600
600
|
return e.install = function(a) {
|
|
601
601
|
a.component(e.name, t);
|
|
602
602
|
}, t;
|
|
603
603
|
};
|
|
604
604
|
z.register = (t, e, a, n) => {
|
|
605
|
-
t.rate = z, e.rate =
|
|
605
|
+
t.rate = z, e.rate = ee;
|
|
606
606
|
};
|
|
607
607
|
z.registerDesigner = (t, e, a) => {
|
|
608
|
-
t.rate =
|
|
608
|
+
t.rate = Ce, e.rate = ee;
|
|
609
609
|
};
|
|
610
|
-
const Re =
|
|
610
|
+
const Re = Ee(z);
|
|
611
611
|
export {
|
|
612
612
|
z as FRate,
|
|
613
613
|
Re as default,
|
|
614
|
-
|
|
614
|
+
ee as propsResolver,
|
|
615
615
|
U as rateProps
|
|
616
616
|
};
|