@farris/ui-vue 1.2.8 → 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 +129 -129
- package/components/accordion/index.umd.cjs +1 -0
- package/components/avatar/index.esm.js +166 -157
- package/components/avatar/index.umd.cjs +1 -0
- package/components/border-editor/index.umd.cjs +1 -0
- package/components/button/index.umd.cjs +1 -0
- package/components/button-edit/index.esm.js +343 -325
- package/components/button-edit/index.umd.cjs +1 -0
- package/components/button-group/index.umd.cjs +1 -0
- package/components/calculator/index.umd.cjs +1 -0
- package/components/calendar/index.esm.js +338 -338
- package/components/calendar/index.umd.cjs +1 -0
- package/components/capsule/index.esm.js +182 -182
- package/components/capsule/index.umd.cjs +1 -0
- package/components/checkbox/index.esm.js +326 -317
- package/components/checkbox/index.umd.cjs +1 -0
- package/components/color-picker/index.esm.js +118 -118
- package/components/color-picker/index.umd.cjs +3 -0
- package/components/combo-list/index.esm.js +338 -325
- package/components/combo-list/index.umd.cjs +1 -0
- package/components/combo-tree/index.esm.js +62 -62
- package/components/combo-tree/index.umd.cjs +1 -0
- package/components/common/index.umd.cjs +1 -0
- package/components/component/index.esm.js +382 -270
- package/components/component/index.umd.cjs +1 -0
- package/components/condition/index.esm.js +1018 -895
- package/components/condition/index.umd.cjs +1 -0
- package/components/content-container/index.esm.js +285 -212
- package/components/content-container/index.umd.cjs +1 -0
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +4761 -4319
- package/components/data-grid/index.umd.cjs +1 -0
- package/components/data-view/index.esm.js +2901 -2664
- package/components/data-view/index.umd.cjs +1 -0
- package/components/date-picker/index.esm.js +1502 -1488
- package/components/date-picker/index.umd.cjs +1 -0
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +938 -928
- package/components/designer-canvas/index.umd.cjs +1 -0
- package/components/designer-outline/index.css +1 -1
- package/components/designer-outline/index.esm.js +27 -27
- package/components/designer-outline/index.umd.cjs +1 -0
- package/components/designer-toolbox/index.esm.js +36 -12
- package/components/designer-toolbox/index.umd.cjs +1 -0
- package/components/discussion-editor/index.umd.cjs +3 -0
- package/components/discussion-list/index.umd.cjs +1 -0
- package/components/drawer/index.umd.cjs +1 -0
- package/components/dropdown/index.esm.js +241 -241
- package/components/dropdown/index.umd.cjs +2 -0
- package/components/dynamic-form/index.esm.js +1074 -885
- package/components/dynamic-form/index.umd.cjs +1 -0
- package/components/dynamic-resolver/index.esm.js +99 -94
- package/components/dynamic-resolver/index.umd.cjs +1 -0
- package/components/dynamic-view/index.umd.cjs +1 -0
- package/components/enum-editor/index.umd.cjs +1 -0
- package/components/events-editor/index.esm.js +577 -522
- package/components/events-editor/index.umd.cjs +1 -0
- package/components/expression-editor/index.esm.js +70 -70
- package/components/expression-editor/index.umd.cjs +1 -0
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +2938 -2619
- package/components/external-container/index.umd.cjs +1 -0
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +4766 -4325
- package/components/field-selector/index.umd.cjs +1 -0
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1231 -1215
- package/components/filter-bar/index.umd.cjs +1 -0
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +1062 -1052
- package/components/flow-canvas/index.umd.cjs +1 -0
- package/components/image-cropper/index.esm.js +373 -373
- package/components/image-cropper/index.umd.cjs +1 -0
- package/components/input-group/index.esm.js +398 -394
- package/components/input-group/index.umd.cjs +1 -0
- package/components/layout/index.esm.js +268 -268
- package/components/layout/index.umd.cjs +1 -0
- package/components/list-nav/index.esm.js +234 -161
- package/components/list-nav/index.umd.cjs +1 -0
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +2288 -2048
- package/components/list-view/index.umd.cjs +1 -0
- package/components/loading/index.umd.cjs +8 -0
- package/components/locale/index.umd.cjs +1 -0
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +5776 -5305
- package/components/lookup/index.umd.cjs +1 -0
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5496 -5036
- package/components/mapping-editor/index.umd.cjs +1 -0
- package/components/message-box/index.umd.cjs +1 -0
- package/components/modal/index.umd.cjs +1 -0
- package/components/nav/index.esm.js +383 -322
- package/components/nav/index.umd.cjs +3 -0
- package/components/notify/index.umd.cjs +1 -0
- package/components/number-range/index.esm.js +273 -269
- package/components/number-range/index.umd.cjs +1 -0
- package/components/number-spinner/index.esm.js +292 -283
- package/components/number-spinner/index.umd.cjs +1 -0
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1008 -925
- package/components/order/index.umd.cjs +1 -0
- package/components/page-footer/index.esm.js +98 -98
- package/components/page-footer/index.umd.cjs +1 -0
- package/components/page-header/index.esm.js +949 -847
- package/components/page-header/index.umd.cjs +1 -0
- package/components/pagination/index.esm.js +464 -403
- package/components/pagination/index.umd.cjs +1 -0
- package/components/popover/index.umd.cjs +1 -0
- package/components/progress/index.esm.js +226 -226
- package/components/progress/index.umd.cjs +3 -0
- package/components/property-editor/index.esm.js +1110 -1092
- package/components/property-editor/index.umd.cjs +3 -0
- package/components/property-panel/index.esm.js +520 -513
- package/components/property-panel/index.umd.cjs +1 -0
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +1714 -1575
- package/components/query-solution/index.umd.cjs +1 -0
- package/components/radio-button/index.esm.js +67 -67
- package/components/radio-button/index.umd.cjs +1 -0
- package/components/radio-group/index.esm.js +298 -289
- package/components/radio-group/index.umd.cjs +1 -0
- package/components/rate/index.esm.js +195 -190
- package/components/rate/index.umd.cjs +1 -0
- package/components/response-layout/index.esm.js +112 -112
- package/components/response-layout/index.umd.cjs +1 -0
- package/components/response-layout-editor/index.esm.js +902 -877
- package/components/response-layout-editor/index.umd.cjs +1 -0
- package/components/response-toolbar/index.esm.js +874 -778
- package/components/response-toolbar/index.umd.cjs +1 -0
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4594 -4289
- package/components/schema-selector/index.umd.cjs +8 -0
- package/components/search-box/index.esm.js +126 -126
- package/components/search-box/index.umd.cjs +1 -0
- package/components/section/index.esm.js +645 -503
- package/components/section/index.umd.cjs +1 -0
- package/components/smoke-detector/index.esm.js +120 -120
- package/components/smoke-detector/index.umd.cjs +1 -0
- package/components/spacing-editor/index.umd.cjs +1 -0
- package/components/splitter/index.esm.js +421 -348
- package/components/splitter/index.umd.cjs +1 -0
- package/components/step/index.esm.js +219 -219
- package/components/step/index.umd.cjs +1 -0
- package/components/switch/index.esm.js +232 -222
- package/components/switch/index.umd.cjs +1 -0
- package/components/tabs/index.esm.js +1823 -1744
- package/components/tabs/index.umd.cjs +1 -0
- package/components/tags/index.esm.js +399 -401
- package/components/tags/index.umd.cjs +1 -0
- package/components/text/index.esm.js +164 -164
- package/components/text/index.umd.cjs +1 -0
- package/components/textarea/index.esm.js +220 -215
- package/components/textarea/index.umd.cjs +1 -0
- package/components/time-picker/index.esm.js +693 -666
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/tooltip/index.umd.cjs +1 -0
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +422 -413
- package/components/transfer/index.umd.cjs +1 -0
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +4799 -4358
- package/components/tree-grid/index.umd.cjs +1 -0
- package/components/tree-view/index.esm.js +2448 -2215
- package/components/tree-view/index.umd.cjs +1 -0
- package/components/uploader/index.esm.js +164 -164
- package/components/uploader/index.umd.cjs +2 -0
- package/components/verify-detail/index.esm.js +143 -143
- package/components/verify-detail/index.umd.cjs +1 -0
- package/components/video/index.esm.js +410 -331
- package/components/video/index.umd.cjs +1 -0
- package/components/weather/index.esm.js +901 -901
- package/components/weather/index.umd.cjs +16 -0
- package/farris.all.esm.js +12305 -11403
- package/farris.all.umd.cjs +8 -8
- 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/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/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 +18 -6
- package/types/data-view/composition/use-edit.d.ts +2 -1
- package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
- package/types/designer-canvas/src/types.d.ts +2 -2
- package/types/dynamic-form/index.d.ts +2 -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-resolver/src/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/types.d.ts +3 -2
- 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/property-config/tab-page.property-config.d.ts +60 -0
- package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
- package/types/tags/index.d.ts +36 -5
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as r, onMounted as J, computed as W, watch as ee, createVNode as
|
|
1
|
+
import { defineComponent as Z, ref as r, onMounted as J, computed as W, watch as ee, createVNode as D, withModifiers as P, createTextVNode as L, inject as te } from "vue";
|
|
2
2
|
import { cloneDeep as ae } from "lodash-es";
|
|
3
3
|
const K = {}, x = {};
|
|
4
4
|
function Q(t) {
|
|
5
|
-
const { properties: e, title: a } = t, n = Object.keys(e).reduce((
|
|
6
|
-
return n.id = `${a}-${Date.now()}
|
|
5
|
+
const { properties: e, title: a, ignore: n } = t, s = n && Array.isArray(n), h = Object.keys(e).reduce((m, b) => ((!s || !n.find((E) => E == b)) && (m[b] = e[b].type === "object" && e[b].properties ? Q(e[b]) : ae(e[b].default)), m), {});
|
|
6
|
+
return (!s || !n.find((m) => m == "id")) && (h.id = `${a}-${Date.now()}`), h;
|
|
7
7
|
}
|
|
8
|
-
function G(t, e = {}) {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
return
|
|
8
|
+
function G(t, e = {}, a) {
|
|
9
|
+
const n = K[t];
|
|
10
|
+
if (n) {
|
|
11
|
+
let s = Q(n);
|
|
12
|
+
const h = x[t];
|
|
13
|
+
return s = h ? h({ getSchemaByType: G }, s, e, a) : s, s;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
function le(t, e) {
|
|
18
18
|
const a = Q(e);
|
|
19
|
-
return Object.keys(t).reduce((n,
|
|
19
|
+
return Object.keys(t).reduce((n, s) => (n[s] && typeof n[s] == "object" ? Object.assign(n[s], t[s]) : n[s] = t[s], n), a), a;
|
|
20
20
|
}
|
|
21
21
|
function re(t, e) {
|
|
22
|
-
return Object.keys(t).filter((n) => t[n] != null).reduce((n,
|
|
23
|
-
if (e.has(
|
|
24
|
-
const
|
|
25
|
-
if (typeof
|
|
26
|
-
n[
|
|
22
|
+
return Object.keys(t).filter((n) => t[n] != null).reduce((n, s) => {
|
|
23
|
+
if (e.has(s)) {
|
|
24
|
+
const h = e.get(s);
|
|
25
|
+
if (typeof h == "string")
|
|
26
|
+
n[h] = t[s];
|
|
27
27
|
else {
|
|
28
|
-
const
|
|
29
|
-
Object.assign(n,
|
|
28
|
+
const m = h(s, t[s], t);
|
|
29
|
+
Object.assign(n, m);
|
|
30
30
|
}
|
|
31
31
|
} else
|
|
32
|
-
n[
|
|
32
|
+
n[s] = t[s];
|
|
33
33
|
return n;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
@@ -38,65 +38,65 @@ function ne(t, e, a = /* @__PURE__ */ new Map()) {
|
|
|
38
38
|
return re(n, a);
|
|
39
39
|
}
|
|
40
40
|
function oe(t = {}) {
|
|
41
|
-
function e(l,
|
|
41
|
+
function e(l, u, p, f) {
|
|
42
42
|
if (typeof p == "number")
|
|
43
43
|
return f[l].length === p;
|
|
44
44
|
if (typeof p == "object") {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
return Number(f[l].length) !== Number(
|
|
48
|
-
if (
|
|
49
|
-
return Number(f[l].length) >= Number(
|
|
50
|
-
if (
|
|
51
|
-
return Number(f[l].length) <= Number(
|
|
45
|
+
const S = Object.keys(p)[0], M = p[S];
|
|
46
|
+
if (S === "not")
|
|
47
|
+
return Number(f[l].length) !== Number(M);
|
|
48
|
+
if (S === "moreThan")
|
|
49
|
+
return Number(f[l].length) >= Number(M);
|
|
50
|
+
if (S === "lessThan")
|
|
51
|
+
return Number(f[l].length) <= Number(M);
|
|
52
52
|
}
|
|
53
53
|
return !1;
|
|
54
54
|
}
|
|
55
|
-
function a(l,
|
|
55
|
+
function a(l, u, p, f) {
|
|
56
56
|
return f[l] && f[l].propertyValue && String(f[l].propertyValue.value) === String(p);
|
|
57
57
|
}
|
|
58
58
|
const n = /* @__PURE__ */ new Map([
|
|
59
59
|
["length", e],
|
|
60
60
|
["getProperty", a]
|
|
61
61
|
]);
|
|
62
|
-
Object.keys(t).reduce((l,
|
|
63
|
-
function
|
|
62
|
+
Object.keys(t).reduce((l, u) => (l.set(u, t[u]), l), n);
|
|
63
|
+
function s(l, u) {
|
|
64
64
|
const p = l;
|
|
65
|
-
return typeof
|
|
65
|
+
return typeof u == "number" ? [{ target: p, operator: "length", param: null, value: Number(u) }] : typeof u == "boolean" ? [{ target: p, operator: "getProperty", param: l, value: !!u }] : typeof u == "object" ? Object.keys(u).map((f) => {
|
|
66
66
|
if (f === "length")
|
|
67
|
-
return { target: p, operator: "length", param: null, value:
|
|
68
|
-
const
|
|
69
|
-
return { target: p, operator: "getProperty", param:
|
|
67
|
+
return { target: p, operator: "length", param: null, value: u[f] };
|
|
68
|
+
const S = f, M = u[f];
|
|
69
|
+
return { target: p, operator: "getProperty", param: S, value: M };
|
|
70
70
|
}) : [];
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function h(l) {
|
|
73
73
|
return Object.keys(l).reduce((p, f) => {
|
|
74
|
-
const
|
|
75
|
-
return p.push(...
|
|
74
|
+
const S = s(f, l[f]);
|
|
75
|
+
return p.push(...S), p;
|
|
76
76
|
}, []);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function m(l, u) {
|
|
79
79
|
if (n.has(l.operator)) {
|
|
80
80
|
const p = n.get(l.operator);
|
|
81
|
-
return p && p(l.target, l.param, l.value,
|
|
81
|
+
return p && p(l.target, l.param, l.value, u) || !1;
|
|
82
82
|
}
|
|
83
83
|
return !1;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function b(l, u) {
|
|
86
|
+
return h(l).reduce((S, M) => S && m(M, u), !0);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
const p = Object.keys(l), f = p.includes("allOf"),
|
|
90
|
-
return f ? !
|
|
88
|
+
function E(l, u) {
|
|
89
|
+
const p = Object.keys(l), f = p.includes("allOf"), S = p.includes("anyOf"), M = f || S, O = (M ? l[M ? f ? "allOf" : "anyOf" : "allOf"] : [l]).map((d) => b(d, u));
|
|
90
|
+
return f ? !O.includes(!1) : O.includes(!0);
|
|
91
91
|
}
|
|
92
|
-
return { parseValueSchema:
|
|
92
|
+
return { parseValueSchema: E };
|
|
93
93
|
}
|
|
94
94
|
const se = {}, ue = {};
|
|
95
95
|
oe();
|
|
96
|
-
function ie(t, e, a = /* @__PURE__ */ new Map(), n = (
|
|
97
|
-
return K[e.title] = e, x[e.title] = n, se[e.title] =
|
|
98
|
-
const
|
|
99
|
-
return Object.assign(
|
|
96
|
+
function ie(t, e, a = /* @__PURE__ */ new Map(), n = (m, b, E) => b, s = {}, h = (m) => m) {
|
|
97
|
+
return K[e.title] = e, x[e.title] = n, se[e.title] = s, ue[e.title] = h, (m = {}) => {
|
|
98
|
+
const b = ne(m, e, a), E = Object.keys(t).reduce((l, u) => (l[u] = t[u].default, l), {});
|
|
99
|
+
return Object.assign(E, b);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function ce(t, e) {
|
|
@@ -173,15 +173,20 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
173
173
|
}, be = [
|
|
174
174
|
"id",
|
|
175
175
|
"type"
|
|
176
|
-
], Se =
|
|
176
|
+
], Se = [
|
|
177
|
+
"id",
|
|
178
|
+
"appearance",
|
|
179
|
+
"binding"
|
|
180
|
+
], Me = {
|
|
177
181
|
$schema: de,
|
|
178
182
|
$id: ve,
|
|
179
183
|
title: me,
|
|
180
184
|
description: ge,
|
|
181
185
|
type: ye,
|
|
182
186
|
properties: he,
|
|
183
|
-
required: be
|
|
184
|
-
|
|
187
|
+
required: be,
|
|
188
|
+
ignore: Se
|
|
189
|
+
}, Oe = "rate", Te = "A Farris Component", ke = "object", De = {
|
|
185
190
|
basic: {
|
|
186
191
|
description: "Basic Infomation",
|
|
187
192
|
title: "基本信息",
|
|
@@ -203,12 +208,12 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
203
208
|
}
|
|
204
209
|
}
|
|
205
210
|
}
|
|
206
|
-
},
|
|
207
|
-
title:
|
|
208
|
-
description:
|
|
209
|
-
type:
|
|
210
|
-
categories:
|
|
211
|
-
},
|
|
211
|
+
}, Ne = {
|
|
212
|
+
title: Oe,
|
|
213
|
+
description: Te,
|
|
214
|
+
type: ke,
|
|
215
|
+
categories: De
|
|
216
|
+
}, Ve = ["很不满意", "不满意", "一般", "满意", "非常满意"], U = {
|
|
212
217
|
/** 星星大小 */
|
|
213
218
|
size: { type: String, default: "large" },
|
|
214
219
|
/** 启用半颗星模式 */
|
|
@@ -230,7 +235,7 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
230
235
|
/** 禁用单个星星的文字提示 */
|
|
231
236
|
toolTipDisabled: { type: Boolean, default: !0 },
|
|
232
237
|
/** 默认的满意度文案 */
|
|
233
|
-
toolTipContents: { type: Array, default:
|
|
238
|
+
toolTipContents: { type: Array, default: Ve },
|
|
234
239
|
/** 启用评分 */
|
|
235
240
|
enableScore: { type: Boolean, default: !0 },
|
|
236
241
|
/** 启用满意度 */
|
|
@@ -240,31 +245,31 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
240
245
|
*/
|
|
241
246
|
value: { type: Number, default: 0 },
|
|
242
247
|
modelValue: { type: Number, default: 0 }
|
|
243
|
-
}, I = ie(U,
|
|
248
|
+
}, I = ie(U, Me, fe, pe, Ne), z = /* @__PURE__ */ Z({
|
|
244
249
|
name: "FRate",
|
|
245
250
|
props: U,
|
|
246
251
|
emits: ["selectedValue", "update:modelValue"],
|
|
247
252
|
setup(t, e) {
|
|
248
|
-
const a = r(t.size), n = r(t.enableHalf),
|
|
253
|
+
const a = r(t.size), n = r(t.enableHalf), s = r(t.enableClear), h = r(t.disabled), m = r(t.pointSystem), b = r(t.lightColor), E = r(t.darkColor), l = r(t.iconClass), u = r(t.numOfStar), p = r(t.toolTipDisabled), f = r(t.toolTipContents), S = r(t.enableScore), M = r(t.enableSatisfaction);
|
|
249
254
|
let v;
|
|
250
|
-
const
|
|
251
|
-
let
|
|
252
|
-
const
|
|
255
|
+
const T = r(0), O = r(0), k = r(0), d = r(t.modelValue);
|
|
256
|
+
let N = 1, w, c, g;
|
|
257
|
+
const y = 4;
|
|
253
258
|
J(() => {
|
|
254
259
|
});
|
|
255
|
-
function
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
for (let
|
|
259
|
-
|
|
260
|
-
id:
|
|
260
|
+
function C() {
|
|
261
|
+
const i = u.value;
|
|
262
|
+
g = [];
|
|
263
|
+
for (let V = 1; V <= i; V++)
|
|
264
|
+
g.push({
|
|
265
|
+
id: V
|
|
261
266
|
});
|
|
262
267
|
}
|
|
263
|
-
function P() {
|
|
264
|
-
let u;
|
|
265
|
-
n.value ? u = Math.ceil(d.value / D) : u = d.value, S.value = (v * d.value + Math.floor(d.value) * g) / D, j = f.value[u - 1];
|
|
266
|
-
}
|
|
267
268
|
function R() {
|
|
269
|
+
let i;
|
|
270
|
+
n.value ? i = Math.ceil(d.value / N) : i = d.value, O.value = (v * d.value + Math.floor(d.value) * y) / N, w = f.value[i - 1];
|
|
271
|
+
}
|
|
272
|
+
function A() {
|
|
268
273
|
switch (a.value) {
|
|
269
274
|
case "small":
|
|
270
275
|
v = 14;
|
|
@@ -279,52 +284,52 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
279
284
|
v = 24;
|
|
280
285
|
break;
|
|
281
286
|
}
|
|
282
|
-
|
|
287
|
+
C(), u.value && (N = m.value / u.value), d.value && R();
|
|
283
288
|
}
|
|
284
|
-
|
|
285
|
-
function
|
|
286
|
-
return
|
|
289
|
+
A();
|
|
290
|
+
function $(i) {
|
|
291
|
+
return i.className.indexOf("f-icon") !== -1;
|
|
287
292
|
}
|
|
288
293
|
function H() {
|
|
289
|
-
return
|
|
294
|
+
return T.value === O.value && s.value && O.value !== 0 ? (O.value = 0, d.value = 0, c = null, T.value = 0, k.value = 0, e.emit("selectedValue", d.value), e.emit("update:modelValue", d.value), !0) : !1;
|
|
290
295
|
}
|
|
291
|
-
function q(
|
|
292
|
-
if (
|
|
293
|
-
if (
|
|
296
|
+
function q(i, V, o) {
|
|
297
|
+
if (i.movementX || i.movementY) {
|
|
298
|
+
if (h.value)
|
|
294
299
|
return;
|
|
295
|
-
|
|
300
|
+
M.value && (w = f.value[V - 1]), i.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);
|
|
296
301
|
}
|
|
297
302
|
if (o === !0) {
|
|
298
303
|
if (H())
|
|
299
304
|
return;
|
|
300
|
-
d.value =
|
|
305
|
+
d.value = k.value, O.value = T.value, c = w, e.emit("update:modelValue", d.value), e.emit("selectedValue", d.value);
|
|
301
306
|
}
|
|
302
307
|
}
|
|
303
|
-
function F(
|
|
308
|
+
function F(i, V) {
|
|
304
309
|
var o;
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
q(
|
|
310
|
+
if ($(i.target) && i.target) {
|
|
311
|
+
const j = parseInt((o = i.target) == null ? void 0 : o.id);
|
|
312
|
+
q(i, j, V);
|
|
308
313
|
}
|
|
309
314
|
}
|
|
310
|
-
const X = W(() =>
|
|
311
|
-
width: (
|
|
315
|
+
const X = W(() => k.value ? k.value + "分" : d.value + "分"), _ = W(() => ({
|
|
316
|
+
width: (T.value || O.value) + "px"
|
|
312
317
|
}));
|
|
313
318
|
function B() {
|
|
314
|
-
|
|
319
|
+
T.value = 0;
|
|
315
320
|
}
|
|
316
|
-
return ee(() => t.modelValue, (
|
|
317
|
-
d.value =
|
|
318
|
-
}), () =>
|
|
321
|
+
return ee(() => t.modelValue, (i) => {
|
|
322
|
+
d.value = i, R();
|
|
323
|
+
}), () => D("div", {
|
|
319
324
|
class: "farris-star-rating",
|
|
320
|
-
onMouseover:
|
|
321
|
-
onMousemove:
|
|
322
|
-
onMouseleave:
|
|
323
|
-
onClick:
|
|
324
|
-
}, [
|
|
325
|
+
onMouseover: P((i) => F(i, !1), ["prevent"]),
|
|
326
|
+
onMousemove: P((i) => F(i, !1), ["prevent"]),
|
|
327
|
+
onMouseleave: P((i) => B(), ["prevent"]),
|
|
328
|
+
onClick: P((i) => F(i, !0), ["prevent"])
|
|
329
|
+
}, [D("div", {
|
|
325
330
|
class: "star-light-area",
|
|
326
331
|
style: _.value
|
|
327
|
-
}, [
|
|
332
|
+
}, [g.map((i) => D("span", {
|
|
328
333
|
class: ["f-icon default-light-color ", l.value, {
|
|
329
334
|
"f-star-sm": a.value === "small"
|
|
330
335
|
}, {
|
|
@@ -336,11 +341,11 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
336
341
|
}, {
|
|
337
342
|
disabled: p.value
|
|
338
343
|
}],
|
|
339
|
-
id:
|
|
344
|
+
id: i.id,
|
|
340
345
|
style: {
|
|
341
|
-
color:
|
|
346
|
+
color: b.value
|
|
342
347
|
}
|
|
343
|
-
}, null))]),
|
|
348
|
+
}, null))]), D("div", {
|
|
344
349
|
class: ["star-dark-area", {
|
|
345
350
|
small: a.value === "small"
|
|
346
351
|
}, {
|
|
@@ -348,7 +353,7 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
348
353
|
}, {
|
|
349
354
|
large: a.value === "large"
|
|
350
355
|
}]
|
|
351
|
-
}, [
|
|
356
|
+
}, [g.map((i) => D("span", {
|
|
352
357
|
class: ["f-icon default-dark-color", l.value, {
|
|
353
358
|
"f-star-sm": a.value === "small"
|
|
354
359
|
}, {
|
|
@@ -358,11 +363,11 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
358
363
|
}, {
|
|
359
364
|
"f-star-exlarge": a.value === "extraLarge"
|
|
360
365
|
}],
|
|
361
|
-
id:
|
|
366
|
+
id: i.id,
|
|
362
367
|
style: {
|
|
363
|
-
color:
|
|
368
|
+
color: E.value
|
|
364
369
|
}
|
|
365
|
-
}, null))]),
|
|
370
|
+
}, null))]), D("div", {
|
|
366
371
|
class: ["f-utils-fill", {
|
|
367
372
|
"font-small": a.value === "small"
|
|
368
373
|
}, {
|
|
@@ -372,24 +377,24 @@ const de = "https://json-schema.org/draft/2020-12/schema", ve = "https://farris-
|
|
|
372
377
|
}, {
|
|
373
378
|
"font-exlarge": a.value === "extraLarge"
|
|
374
379
|
}]
|
|
375
|
-
}, [
|
|
380
|
+
}, [S.value && D("span", null, [L(" "), X.value, L(" ")]), M.value && (c || w) && D("span", null, [L(" "), w || c])])]);
|
|
376
381
|
}
|
|
377
382
|
});
|
|
378
|
-
function
|
|
379
|
-
var
|
|
383
|
+
function je(t, e, a) {
|
|
384
|
+
var w;
|
|
380
385
|
function n() {
|
|
381
386
|
}
|
|
382
|
-
const
|
|
383
|
-
function
|
|
387
|
+
const s = "", h = "", m = r();
|
|
388
|
+
function b() {
|
|
384
389
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
385
390
|
}
|
|
386
|
-
function
|
|
391
|
+
function E() {
|
|
387
392
|
return !1;
|
|
388
393
|
}
|
|
389
394
|
function l() {
|
|
390
395
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
391
396
|
}
|
|
392
|
-
function
|
|
397
|
+
function u() {
|
|
393
398
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
394
399
|
}
|
|
395
400
|
function p(c) {
|
|
@@ -397,93 +402,93 @@ function Ve(t, e, a) {
|
|
|
397
402
|
return null;
|
|
398
403
|
if (c.value.schema && c.value.schema.type === "component")
|
|
399
404
|
return c.value;
|
|
400
|
-
const
|
|
401
|
-
return
|
|
405
|
+
const g = r(c == null ? void 0 : c.value.parent), y = p(g);
|
|
406
|
+
return y || null;
|
|
402
407
|
}
|
|
403
408
|
function f(c = e) {
|
|
404
|
-
const { componentInstance:
|
|
405
|
-
return !
|
|
409
|
+
const { componentInstance: g, designerItemElementRef: y } = c;
|
|
410
|
+
return !g || !g.value ? null : g.value.canMove ? y : f(c.parent);
|
|
406
411
|
}
|
|
407
|
-
function
|
|
412
|
+
function S(c) {
|
|
408
413
|
return !!a;
|
|
409
414
|
}
|
|
410
|
-
function
|
|
415
|
+
function M() {
|
|
411
416
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
412
417
|
}
|
|
413
418
|
function v() {
|
|
414
419
|
}
|
|
415
|
-
function
|
|
420
|
+
function T(c, g) {
|
|
416
421
|
}
|
|
417
|
-
function
|
|
418
|
-
const { componentType:
|
|
419
|
-
let
|
|
420
|
-
const
|
|
421
|
-
return
|
|
422
|
+
function O(c, g) {
|
|
423
|
+
const { componentType: y } = c;
|
|
424
|
+
let C = G(y, c, g);
|
|
425
|
+
const R = y.toLowerCase().replace("-", "_");
|
|
426
|
+
return C && !C.id && C.type === y && (C.id = `${R}_${Math.random().toString().slice(2, 6)}`), C;
|
|
422
427
|
}
|
|
423
|
-
function
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
let
|
|
427
|
-
const
|
|
428
|
-
return
|
|
428
|
+
function k(c, g) {
|
|
429
|
+
const y = String(c.getAttribute("data-controltype")), C = c.getAttribute("data-feature"), R = C ? JSON.parse(C) : {};
|
|
430
|
+
R.parentComponentInstance = m.value;
|
|
431
|
+
let A = G(y, R);
|
|
432
|
+
const $ = y.toLowerCase().replace("-", "_");
|
|
433
|
+
return A && !A.id && A.type === y && (A.id = `${$}_${Math.random().toString().slice(2, 6)}`), A;
|
|
429
434
|
}
|
|
430
435
|
function d(c) {
|
|
431
436
|
}
|
|
432
|
-
function
|
|
437
|
+
function N(...c) {
|
|
433
438
|
}
|
|
434
|
-
return
|
|
435
|
-
canMove:
|
|
436
|
-
canSelectParent:
|
|
439
|
+
return m.value = {
|
|
440
|
+
canMove: b(),
|
|
441
|
+
canSelectParent: E(),
|
|
437
442
|
canDelete: l(),
|
|
438
|
-
canNested: !
|
|
443
|
+
canNested: !u(),
|
|
439
444
|
contents: e == null ? void 0 : e.schema.contents,
|
|
440
445
|
elementRef: t,
|
|
441
|
-
parent: (
|
|
446
|
+
parent: (w = e == null ? void 0 : e.parent) == null ? void 0 : w.componentInstance,
|
|
442
447
|
schema: e == null ? void 0 : e.schema,
|
|
443
|
-
styles:
|
|
444
|
-
designerClass:
|
|
445
|
-
canAccepts:
|
|
448
|
+
styles: s,
|
|
449
|
+
designerClass: h,
|
|
450
|
+
canAccepts: S,
|
|
446
451
|
getBelongedComponentInstance: p,
|
|
447
452
|
getDraggableDesignItemElement: f,
|
|
448
|
-
getDraggingDisplayText:
|
|
449
|
-
getPropConfig:
|
|
453
|
+
getDraggingDisplayText: M,
|
|
454
|
+
getPropConfig: N,
|
|
450
455
|
getDragScopeElement: v,
|
|
451
|
-
onAcceptMovedChildElement:
|
|
452
|
-
onAcceptNewChildElement:
|
|
456
|
+
onAcceptMovedChildElement: T,
|
|
457
|
+
onAcceptNewChildElement: k,
|
|
453
458
|
onChildElementMovedOut: d,
|
|
454
|
-
addNewChildComponentSchema:
|
|
459
|
+
addNewChildComponentSchema: O,
|
|
455
460
|
updateDragAndDropRules: n,
|
|
456
461
|
triggerBelongedComponentToMoveWhenMoved: r(!1),
|
|
457
462
|
triggerBelongedComponentToDeleteWhenDeleted: r(!1)
|
|
458
|
-
},
|
|
463
|
+
}, m;
|
|
459
464
|
}
|
|
460
|
-
const
|
|
465
|
+
const we = /* @__PURE__ */ Z({
|
|
461
466
|
name: "FRateDesign",
|
|
462
467
|
props: U,
|
|
463
468
|
emits: ["selectedValue"],
|
|
464
469
|
setup(t, e) {
|
|
465
|
-
const a = r(t.size), n = r(t.enableHalf),
|
|
470
|
+
const a = r(t.size), n = r(t.enableHalf), s = r(t.enableClear), h = r(t.disabled), m = r(t.pointSystem), b = r(t.lightColor), E = r(t.darkColor), l = r(t.iconClass), u = r(t.numOfStar), p = r(t.toolTipDisabled), f = r(t.toolTipContents), S = r(t.enableScore), M = r(t.enableSatisfaction);
|
|
466
471
|
let v;
|
|
467
|
-
const
|
|
468
|
-
let
|
|
469
|
-
const
|
|
470
|
-
let
|
|
471
|
-
const
|
|
472
|
+
const T = r(1);
|
|
473
|
+
let O = 0;
|
|
474
|
+
const k = r(0), d = r(0);
|
|
475
|
+
let N = 1, w, c, g;
|
|
476
|
+
const y = 4, C = r(), R = te("design-item-context"), A = je(C, R);
|
|
472
477
|
J(() => {
|
|
473
|
-
|
|
474
|
-
}), e.expose(
|
|
478
|
+
C.value.componentInstance = A;
|
|
479
|
+
}), e.expose(A.value), J(() => {
|
|
475
480
|
});
|
|
476
|
-
function
|
|
477
|
-
const o =
|
|
478
|
-
|
|
479
|
-
for (let
|
|
480
|
-
|
|
481
|
-
id:
|
|
481
|
+
function $() {
|
|
482
|
+
const o = u.value;
|
|
483
|
+
g = [];
|
|
484
|
+
for (let j = 1; j <= o; j++)
|
|
485
|
+
g.push({
|
|
486
|
+
id: j
|
|
482
487
|
});
|
|
483
488
|
}
|
|
484
489
|
function H() {
|
|
485
490
|
let o;
|
|
486
|
-
n.value ? o = Math.ceil(d.value /
|
|
491
|
+
n.value ? o = Math.ceil(d.value / N) : o = d.value, O = (v * d.value + Math.floor(d.value) * y) / N, w = f.value[o - 1];
|
|
487
492
|
}
|
|
488
493
|
function q() {
|
|
489
494
|
switch (a.value) {
|
|
@@ -500,47 +505,47 @@ const je = /* @__PURE__ */ Z({
|
|
|
500
505
|
v = 24;
|
|
501
506
|
break;
|
|
502
507
|
}
|
|
503
|
-
|
|
508
|
+
$(), u.value && (N = m.value / u.value), d.value && H();
|
|
504
509
|
}
|
|
505
510
|
q();
|
|
506
511
|
function F(o) {
|
|
507
512
|
return o.className.indexOf("f-icon") !== -1;
|
|
508
513
|
}
|
|
509
514
|
function X() {
|
|
510
|
-
return
|
|
515
|
+
return T.value === O && s && O !== 0 ? (O = 0, d.value = 0, c = null, T.value = 0, k.value = 0, e.emit("selectedValue", d.value), !0) : !1;
|
|
511
516
|
}
|
|
512
|
-
function _(o,
|
|
517
|
+
function _(o, j, Y) {
|
|
513
518
|
if (o.movementX || o.movementY) {
|
|
514
|
-
if (
|
|
519
|
+
if (h.value)
|
|
515
520
|
return;
|
|
516
|
-
|
|
521
|
+
M.value && (w = f.value[j - 1]), o.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);
|
|
517
522
|
}
|
|
518
523
|
if (Y === !0) {
|
|
519
524
|
if (X())
|
|
520
525
|
return;
|
|
521
|
-
d.value =
|
|
526
|
+
d.value = k.value, O = T.value, c = w, e.emit("selectedValue", d.value);
|
|
522
527
|
}
|
|
523
528
|
}
|
|
524
|
-
function B(o,
|
|
529
|
+
function B(o, j) {
|
|
525
530
|
if (F(o.target) && o.target) {
|
|
526
531
|
const Y = parseInt(o.target.id);
|
|
527
|
-
_(o, Y,
|
|
532
|
+
_(o, Y, j);
|
|
528
533
|
}
|
|
529
534
|
}
|
|
530
|
-
const
|
|
531
|
-
width: (
|
|
535
|
+
const i = W(() => k.value ? k.value + "分" : d.value + "分"), V = W(() => ({
|
|
536
|
+
width: (T.value || O) + "px"
|
|
532
537
|
}));
|
|
533
|
-
return () =>
|
|
538
|
+
return () => D("div", {
|
|
534
539
|
class: "farris-star-rating",
|
|
535
|
-
ref:
|
|
536
|
-
onMouseover:
|
|
537
|
-
onMousemove:
|
|
538
|
-
onMouseout:
|
|
539
|
-
onClick:
|
|
540
|
-
}, [
|
|
540
|
+
ref: C,
|
|
541
|
+
onMouseover: P((o) => B(o, !1), ["prevent"]),
|
|
542
|
+
onMousemove: P((o) => B(o, !1), ["prevent"]),
|
|
543
|
+
onMouseout: P((o) => B(o, !1), ["prevent"]),
|
|
544
|
+
onClick: P((o) => B(o, !0), ["prevent"])
|
|
545
|
+
}, [D("div", {
|
|
541
546
|
class: "star-light-area",
|
|
542
|
-
style:
|
|
543
|
-
}, [
|
|
547
|
+
style: V.value
|
|
548
|
+
}, [g.map((o) => D("span", {
|
|
544
549
|
class: ["f-icon default-light-color ", l.value, {
|
|
545
550
|
"f-star-sm": a.value === "small"
|
|
546
551
|
}, {
|
|
@@ -554,9 +559,9 @@ const je = /* @__PURE__ */ Z({
|
|
|
554
559
|
}],
|
|
555
560
|
id: o.id,
|
|
556
561
|
style: {
|
|
557
|
-
color:
|
|
562
|
+
color: b.value
|
|
558
563
|
}
|
|
559
|
-
}, null))]),
|
|
564
|
+
}, null))]), D("div", {
|
|
560
565
|
class: ["star-dark-area", {
|
|
561
566
|
small: a.value === "small"
|
|
562
567
|
}, {
|
|
@@ -564,7 +569,7 @@ const je = /* @__PURE__ */ Z({
|
|
|
564
569
|
}, {
|
|
565
570
|
large: a.value === "large"
|
|
566
571
|
}]
|
|
567
|
-
}, [
|
|
572
|
+
}, [g.map((o) => D("span", {
|
|
568
573
|
class: ["f-icon default-dark-color", l.value, {
|
|
569
574
|
"f-star-sm": a.value === "small"
|
|
570
575
|
}, {
|
|
@@ -576,9 +581,9 @@ const je = /* @__PURE__ */ Z({
|
|
|
576
581
|
}],
|
|
577
582
|
id: o.id,
|
|
578
583
|
style: {
|
|
579
|
-
color:
|
|
584
|
+
color: E.value
|
|
580
585
|
}
|
|
581
|
-
}, null))]),
|
|
586
|
+
}, null))]), D("div", {
|
|
582
587
|
class: ["f-utils-fill", {
|
|
583
588
|
"font-small": a.value === "small"
|
|
584
589
|
}, {
|
|
@@ -588,9 +593,9 @@ const je = /* @__PURE__ */ Z({
|
|
|
588
593
|
}, {
|
|
589
594
|
"font-exlarge": a.value === "extraLarge"
|
|
590
595
|
}]
|
|
591
|
-
}, [
|
|
596
|
+
}, [S.value && D("span", null, [L(" "), i.value, L(" ")]), M.value && (c || w) && D("span", null, [L(" "), w || c])])]);
|
|
592
597
|
}
|
|
593
|
-
}),
|
|
598
|
+
}), Ce = (t) => {
|
|
594
599
|
const e = t;
|
|
595
600
|
return e.install = function(a) {
|
|
596
601
|
a.component(e.name, t);
|
|
@@ -600,9 +605,9 @@ z.register = (t, e, a, n) => {
|
|
|
600
605
|
t.rate = z, e.rate = I;
|
|
601
606
|
};
|
|
602
607
|
z.registerDesigner = (t, e, a) => {
|
|
603
|
-
t.rate =
|
|
608
|
+
t.rate = we, e.rate = I;
|
|
604
609
|
};
|
|
605
|
-
const Re =
|
|
610
|
+
const Re = Ce(z);
|
|
606
611
|
export {
|
|
607
612
|
z as FRate,
|
|
608
613
|
Re as default,
|