@farris/ui-vue 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +9 -7
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3096 -3069
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +296 -283
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +634 -619
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
|
@@ -1,119 +1,133 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as
|
|
2
|
-
import { isPlainObject as U, cloneDeep as
|
|
1
|
+
import { defineComponent as Z, ref as o, onMounted as G, computed as W, watch as te, createVNode as N, withModifiers as R, createTextVNode as B, inject as le } from "vue";
|
|
2
|
+
import { isPlainObject as U, cloneDeep as K } from "lodash-es";
|
|
3
3
|
import { withInstall as re } from "../common/index.esm.js";
|
|
4
|
-
const
|
|
4
|
+
const x = {}, I = {};
|
|
5
5
|
function J(a) {
|
|
6
|
-
const { properties: e, title: t, ignore:
|
|
7
|
-
if (t && (!
|
|
8
|
-
const
|
|
9
|
-
|
|
6
|
+
const { properties: e, title: t, ignore: l } = a, n = l && Array.isArray(l), v = Object.keys(e).reduce((m, b) => ((!n || !l.find((P) => P === b)) && (m[b] = e[b].type === "object" && e[b].properties ? J(e[b]) : K(e[b].default)), m), {});
|
|
7
|
+
if (t && (!n || !l.find((m) => m === "id"))) {
|
|
8
|
+
const m = t.toLowerCase().replace(/-/g, "_");
|
|
9
|
+
v.id = `${m}_${Math.random().toString().slice(2, 6)}`;
|
|
10
10
|
}
|
|
11
|
-
return
|
|
11
|
+
return v;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function ne(a) {
|
|
14
|
+
const { properties: e, title: t, required: l } = a;
|
|
15
|
+
if (l && Array.isArray(l)) {
|
|
16
|
+
const n = l.reduce((v, m) => (v[m] = e[m].type === "object" && e[m].properties ? J(e[m]) : K(e[m].default), v), {});
|
|
17
|
+
if (t && l.find((v) => v === "id")) {
|
|
18
|
+
const v = t.toLowerCase().replace(/-/g, "_");
|
|
19
|
+
n.id = `${v}_${Math.random().toString().slice(2, 6)}`;
|
|
20
|
+
}
|
|
21
|
+
return n;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
type: t
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function ee(a, e = {}, t) {
|
|
28
|
+
const l = x[a];
|
|
29
|
+
if (l) {
|
|
30
|
+
let n = ne(l);
|
|
31
|
+
const v = I[a];
|
|
32
|
+
return n = v ? v({ getSchemaByType: ee }, n, e, t) : n, n;
|
|
19
33
|
}
|
|
20
34
|
return null;
|
|
21
35
|
}
|
|
22
|
-
function
|
|
36
|
+
function oe(a, e) {
|
|
23
37
|
const t = J(e);
|
|
24
|
-
return Object.keys(t).reduce((
|
|
38
|
+
return Object.keys(t).reduce((l, n) => (Object.prototype.hasOwnProperty.call(a, n) && (l[n] && U(l[n]) && U(a[n] || !a[n]) ? Object.assign(l[n], a[n] || {}) : l[n] = a[n]), l), t), t;
|
|
25
39
|
}
|
|
26
|
-
function
|
|
27
|
-
return Object.keys(a).filter((
|
|
28
|
-
if (e.has(
|
|
29
|
-
const
|
|
30
|
-
if (typeof
|
|
31
|
-
|
|
40
|
+
function se(a, e) {
|
|
41
|
+
return Object.keys(a).filter((l) => a[l] != null).reduce((l, n) => {
|
|
42
|
+
if (e.has(n)) {
|
|
43
|
+
const v = e.get(n);
|
|
44
|
+
if (typeof v == "string")
|
|
45
|
+
l[v] = a[n];
|
|
32
46
|
else {
|
|
33
|
-
const
|
|
34
|
-
Object.assign(
|
|
47
|
+
const m = v(n, a[n], a);
|
|
48
|
+
Object.assign(l, m);
|
|
35
49
|
}
|
|
36
50
|
} else
|
|
37
|
-
n
|
|
38
|
-
return
|
|
51
|
+
l[n] = a[n];
|
|
52
|
+
return l;
|
|
39
53
|
}, {});
|
|
40
54
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
return
|
|
55
|
+
function ue(a, e, t = /* @__PURE__ */ new Map()) {
|
|
56
|
+
const l = oe(a, e);
|
|
57
|
+
return se(l, t);
|
|
44
58
|
}
|
|
45
|
-
function
|
|
46
|
-
function e(
|
|
59
|
+
function ie(a = {}) {
|
|
60
|
+
function e(r, s, f, d) {
|
|
47
61
|
if (typeof f == "number")
|
|
48
|
-
return
|
|
62
|
+
return d[r].length === f;
|
|
49
63
|
if (typeof f == "object") {
|
|
50
64
|
const S = Object.keys(f)[0], M = f[S];
|
|
51
65
|
if (S === "not")
|
|
52
|
-
return Number(
|
|
66
|
+
return Number(d[r].length) !== Number(M);
|
|
53
67
|
if (S === "moreThan")
|
|
54
|
-
return Number(
|
|
68
|
+
return Number(d[r].length) >= Number(M);
|
|
55
69
|
if (S === "lessThan")
|
|
56
|
-
return Number(
|
|
70
|
+
return Number(d[r].length) <= Number(M);
|
|
57
71
|
}
|
|
58
72
|
return !1;
|
|
59
73
|
}
|
|
60
|
-
function t(
|
|
61
|
-
return
|
|
74
|
+
function t(r, s, f, d) {
|
|
75
|
+
return d[r] && d[r].propertyValue && String(d[r].propertyValue.value) === String(f);
|
|
62
76
|
}
|
|
63
|
-
const
|
|
77
|
+
const l = /* @__PURE__ */ new Map([
|
|
64
78
|
["length", e],
|
|
65
79
|
["getProperty", t]
|
|
66
80
|
]);
|
|
67
|
-
Object.keys(a).reduce((
|
|
68
|
-
function
|
|
69
|
-
const f =
|
|
70
|
-
return typeof s == "number" ? [{ target: f, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: f, operator: "getProperty", param:
|
|
71
|
-
if (
|
|
72
|
-
return { target: f, operator: "length", param: null, value: s[
|
|
73
|
-
const S =
|
|
81
|
+
Object.keys(a).reduce((r, s) => (r.set(s, a[s]), r), l);
|
|
82
|
+
function n(r, s) {
|
|
83
|
+
const f = r;
|
|
84
|
+
return typeof s == "number" ? [{ target: f, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: f, operator: "getProperty", param: r, value: !!s }] : typeof s == "object" ? Object.keys(s).map((d) => {
|
|
85
|
+
if (d === "length")
|
|
86
|
+
return { target: f, operator: "length", param: null, value: s[d] };
|
|
87
|
+
const S = d, M = s[d];
|
|
74
88
|
return { target: f, operator: "getProperty", param: S, value: M };
|
|
75
89
|
}) : [];
|
|
76
90
|
}
|
|
77
|
-
function
|
|
78
|
-
return Object.keys(
|
|
79
|
-
const S =
|
|
91
|
+
function v(r) {
|
|
92
|
+
return Object.keys(r).reduce((f, d) => {
|
|
93
|
+
const S = n(d, r[d]);
|
|
80
94
|
return f.push(...S), f;
|
|
81
95
|
}, []);
|
|
82
96
|
}
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
85
|
-
const f =
|
|
86
|
-
return f && f(
|
|
97
|
+
function m(r, s) {
|
|
98
|
+
if (l.has(r.operator)) {
|
|
99
|
+
const f = l.get(r.operator);
|
|
100
|
+
return f && f(r.target, r.param, r.value, s) || !1;
|
|
87
101
|
}
|
|
88
102
|
return !1;
|
|
89
103
|
}
|
|
90
|
-
function b(
|
|
91
|
-
return
|
|
104
|
+
function b(r, s) {
|
|
105
|
+
return v(r).reduce((S, M) => S && m(M, s), !0);
|
|
92
106
|
}
|
|
93
|
-
function
|
|
94
|
-
const f = Object.keys(
|
|
95
|
-
return
|
|
107
|
+
function P(r, s) {
|
|
108
|
+
const f = Object.keys(r), d = f.includes("allOf"), S = f.includes("anyOf"), M = d || S, O = (M ? r[M ? d ? "allOf" : "anyOf" : "allOf"] : [r]).map((p) => b(p, s));
|
|
109
|
+
return d ? !O.includes(!1) : O.includes(!0);
|
|
96
110
|
}
|
|
97
|
-
return { parseValueSchema:
|
|
111
|
+
return { parseValueSchema: P };
|
|
98
112
|
}
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
function
|
|
102
|
-
return
|
|
103
|
-
const b =
|
|
104
|
-
return Object.assign(
|
|
113
|
+
const ce = {}, fe = {};
|
|
114
|
+
ie();
|
|
115
|
+
function de(a, e, t = /* @__PURE__ */ new Map(), l = (m, b, P, r) => b, n = {}, v = (m) => m) {
|
|
116
|
+
return x[e.title] = e, I[e.title] = l, ce[e.title] = n, fe[e.title] = v, (m = {}) => {
|
|
117
|
+
const b = ue(m, e, t), P = Object.keys(a).reduce((r, s) => (r[s] = a[s].default, r), {});
|
|
118
|
+
return Object.assign(P, b);
|
|
105
119
|
};
|
|
106
120
|
}
|
|
107
121
|
function pe(a, e) {
|
|
108
122
|
return { customClass: e.class, customStyle: e.style };
|
|
109
123
|
}
|
|
110
|
-
const
|
|
124
|
+
const ve = /* @__PURE__ */ new Map([
|
|
111
125
|
["appearance", pe]
|
|
112
126
|
]);
|
|
113
|
-
function
|
|
127
|
+
function me(a, e, t) {
|
|
114
128
|
return e;
|
|
115
129
|
}
|
|
116
|
-
const
|
|
130
|
+
const ge = "https://json-schema.org/draft/2020-12/schema", ye = "https://farris-design.gitee.io/rate.schema.json", he = "rate", be = "A Farris Component", Se = "object", Me = {
|
|
117
131
|
id: {
|
|
118
132
|
description: "The unique identifier for rate",
|
|
119
133
|
type: "string"
|
|
@@ -175,23 +189,23 @@ const me = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
175
189
|
type: "boolean",
|
|
176
190
|
default: !0
|
|
177
191
|
}
|
|
178
|
-
},
|
|
192
|
+
}, Oe = [
|
|
179
193
|
"id",
|
|
180
194
|
"type"
|
|
181
|
-
],
|
|
195
|
+
], Te = [
|
|
182
196
|
"id",
|
|
183
197
|
"appearance",
|
|
184
198
|
"binding"
|
|
185
|
-
],
|
|
186
|
-
$schema:
|
|
187
|
-
$id:
|
|
188
|
-
title:
|
|
189
|
-
description:
|
|
190
|
-
type:
|
|
191
|
-
properties:
|
|
192
|
-
required:
|
|
193
|
-
ignore:
|
|
194
|
-
},
|
|
199
|
+
], ke = {
|
|
200
|
+
$schema: ge,
|
|
201
|
+
$id: ye,
|
|
202
|
+
title: he,
|
|
203
|
+
description: be,
|
|
204
|
+
type: Se,
|
|
205
|
+
properties: Me,
|
|
206
|
+
required: Oe,
|
|
207
|
+
ignore: Te
|
|
208
|
+
}, De = "rate", je = "A Farris Component", Ne = "object", Ve = {
|
|
195
209
|
basic: {
|
|
196
210
|
description: "Basic Infomation",
|
|
197
211
|
title: "基本信息",
|
|
@@ -213,12 +227,12 @@ const me = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
213
227
|
}
|
|
214
228
|
}
|
|
215
229
|
}
|
|
216
|
-
},
|
|
217
|
-
title:
|
|
218
|
-
description:
|
|
219
|
-
type:
|
|
220
|
-
categories:
|
|
221
|
-
},
|
|
230
|
+
}, we = {
|
|
231
|
+
title: De,
|
|
232
|
+
description: je,
|
|
233
|
+
type: Ne,
|
|
234
|
+
categories: Ve
|
|
235
|
+
}, Pe = ["很不满意", "不满意", "一般", "满意", "非常满意"], Q = {
|
|
222
236
|
/** 星星大小 */
|
|
223
237
|
size: { type: String, default: "large" },
|
|
224
238
|
/** 启用半颗星模式 */
|
|
@@ -240,7 +254,7 @@ const me = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
240
254
|
/** 禁用单个星星的文字提示 */
|
|
241
255
|
toolTipDisabled: { type: Boolean, default: !0 },
|
|
242
256
|
/** 默认的满意度文案 */
|
|
243
|
-
toolTipContents: { type: Array, default:
|
|
257
|
+
toolTipContents: { type: Array, default: Pe },
|
|
244
258
|
/** 启用评分 */
|
|
245
259
|
enableScore: { type: Boolean, default: !0 },
|
|
246
260
|
/** 启用满意度 */
|
|
@@ -250,92 +264,92 @@ const me = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
250
264
|
*/
|
|
251
265
|
value: { type: Number, default: 0 },
|
|
252
266
|
modelValue: { type: Number, default: 0 }
|
|
253
|
-
},
|
|
267
|
+
}, ae = de(Q, ke, ve, me, we), q = /* @__PURE__ */ Z({
|
|
254
268
|
name: "FRate",
|
|
255
269
|
props: Q,
|
|
256
270
|
emits: ["selectedValue", "update:modelValue"],
|
|
257
271
|
setup(a, e) {
|
|
258
|
-
const t =
|
|
259
|
-
let
|
|
260
|
-
const T =
|
|
261
|
-
let D = 1, u,
|
|
272
|
+
const t = o(a.size), l = o(a.enableHalf), n = o(a.enableClear), v = o(a.disabled), m = o(a.pointSystem), b = o(a.lightColor), P = o(a.darkColor), r = o(a.iconClass), s = o(a.numOfStar), f = o(a.toolTipDisabled), d = o(a.toolTipContents), S = o(a.enableScore), M = o(a.enableSatisfaction);
|
|
273
|
+
let g;
|
|
274
|
+
const T = o(0), O = o(0), k = o(0), p = o(a.modelValue);
|
|
275
|
+
let D = 1, u, h, y;
|
|
262
276
|
const j = 4;
|
|
263
277
|
G(() => {
|
|
264
278
|
});
|
|
265
|
-
function
|
|
279
|
+
function E() {
|
|
266
280
|
const c = s.value;
|
|
267
|
-
|
|
281
|
+
y = [];
|
|
268
282
|
for (let V = 1; V <= c; V++)
|
|
269
|
-
|
|
283
|
+
y.push({
|
|
270
284
|
id: V
|
|
271
285
|
});
|
|
272
286
|
}
|
|
273
287
|
function $() {
|
|
274
288
|
let c;
|
|
275
|
-
|
|
289
|
+
l.value ? c = Math.ceil(p.value / D) : c = p.value, O.value = (g * p.value + Math.floor(p.value) * j) / D, u = d.value[c - 1];
|
|
276
290
|
}
|
|
277
291
|
function F() {
|
|
278
292
|
switch (t.value) {
|
|
279
293
|
case "small":
|
|
280
|
-
|
|
294
|
+
g = 14;
|
|
281
295
|
break;
|
|
282
296
|
case "middle":
|
|
283
|
-
|
|
297
|
+
g = 16;
|
|
284
298
|
break;
|
|
285
299
|
case "large":
|
|
286
|
-
|
|
300
|
+
g = 18;
|
|
287
301
|
break;
|
|
288
302
|
case "extraLarge":
|
|
289
|
-
|
|
303
|
+
g = 24;
|
|
290
304
|
break;
|
|
291
305
|
}
|
|
292
|
-
|
|
306
|
+
E(), s.value && (D = m.value / s.value), p.value && $();
|
|
293
307
|
}
|
|
294
308
|
F();
|
|
295
|
-
function
|
|
309
|
+
function H(c) {
|
|
296
310
|
return c.className.indexOf("f-icon") !== -1;
|
|
297
311
|
}
|
|
298
|
-
function
|
|
299
|
-
return T.value === O.value &&
|
|
312
|
+
function _() {
|
|
313
|
+
return T.value === O.value && n.value && O.value !== 0 ? (O.value = 0, p.value = 0, h = null, T.value = 0, k.value = 0, e.emit("selectedValue", p.value), e.emit("update:modelValue", p.value), !0) : !1;
|
|
300
314
|
}
|
|
301
|
-
function
|
|
315
|
+
function z(c, V, i) {
|
|
302
316
|
if (c.movementX || c.movementY) {
|
|
303
|
-
if (
|
|
317
|
+
if (v.value)
|
|
304
318
|
return;
|
|
305
|
-
M.value && (u =
|
|
319
|
+
M.value && (u = d.value[V - 1]), c.offsetX < g / 2 && l.value === !0 ? (T.value = g * V - g / 2 + j * (V - 1), k.value = D * V - D / 2) : (T.value = g * V + j * (V - 1), k.value = D * V);
|
|
306
320
|
}
|
|
307
321
|
if (i === !0) {
|
|
308
|
-
if (
|
|
322
|
+
if (_())
|
|
309
323
|
return;
|
|
310
|
-
|
|
324
|
+
p.value = k.value, O.value = T.value, h = u, e.emit("update:modelValue", p.value), e.emit("selectedValue", p.value);
|
|
311
325
|
}
|
|
312
326
|
}
|
|
313
327
|
function L(c, V) {
|
|
314
328
|
var i;
|
|
315
|
-
if (
|
|
316
|
-
const
|
|
317
|
-
|
|
329
|
+
if (H(c.target) && c.target) {
|
|
330
|
+
const w = parseInt((i = c.target) == null ? void 0 : i.id);
|
|
331
|
+
z(c, w, V);
|
|
318
332
|
}
|
|
319
333
|
}
|
|
320
|
-
const
|
|
334
|
+
const C = W(() => k.value ? k.value + "分" : p.value + "分"), X = W(() => ({
|
|
321
335
|
width: (T.value || O.value) + "px"
|
|
322
336
|
}));
|
|
323
337
|
function A() {
|
|
324
338
|
T.value = 0;
|
|
325
339
|
}
|
|
326
|
-
return
|
|
327
|
-
|
|
340
|
+
return te(() => a.modelValue, (c) => {
|
|
341
|
+
p.value = c, $();
|
|
328
342
|
}), () => N("div", {
|
|
329
343
|
class: "farris-star-rating",
|
|
330
|
-
onMouseover:
|
|
331
|
-
onMousemove:
|
|
332
|
-
onMouseleave:
|
|
333
|
-
onClick:
|
|
344
|
+
onMouseover: R((c) => L(c, !1), ["prevent"]),
|
|
345
|
+
onMousemove: R((c) => L(c, !1), ["prevent"]),
|
|
346
|
+
onMouseleave: R((c) => A(), ["prevent"]),
|
|
347
|
+
onClick: R((c) => L(c, !0), ["prevent"])
|
|
334
348
|
}, [N("div", {
|
|
335
349
|
class: "star-light-area",
|
|
336
|
-
style:
|
|
337
|
-
}, [
|
|
338
|
-
class: ["f-icon default-light-color ",
|
|
350
|
+
style: X.value
|
|
351
|
+
}, [y.map((c) => N("span", {
|
|
352
|
+
class: ["f-icon default-light-color ", r.value, {
|
|
339
353
|
"f-star-sm": t.value === "small"
|
|
340
354
|
}, {
|
|
341
355
|
"f-star-md": t.value === "middle"
|
|
@@ -358,8 +372,8 @@ const me = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
358
372
|
}, {
|
|
359
373
|
large: t.value === "large"
|
|
360
374
|
}]
|
|
361
|
-
}, [
|
|
362
|
-
class: ["f-icon default-dark-color",
|
|
375
|
+
}, [y.map((c) => N("span", {
|
|
376
|
+
class: ["f-icon default-dark-color", r.value, {
|
|
363
377
|
"f-star-sm": t.value === "small"
|
|
364
378
|
}, {
|
|
365
379
|
"f-star-md": t.value === "middle"
|
|
@@ -370,7 +384,7 @@ const me = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
370
384
|
}],
|
|
371
385
|
id: c.id,
|
|
372
386
|
style: {
|
|
373
|
-
color:
|
|
387
|
+
color: P.value
|
|
374
388
|
}
|
|
375
389
|
}, null))]), N("div", {
|
|
376
390
|
class: ["f-utils-fill", {
|
|
@@ -382,22 +396,22 @@ const me = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
382
396
|
}, {
|
|
383
397
|
"font-exlarge": t.value === "extraLarge"
|
|
384
398
|
}]
|
|
385
|
-
}, [S.value && N("span", null, [B(" "),
|
|
399
|
+
}, [S.value && N("span", null, [B(" "), C.value, B(" ")]), M.value && (h || u) && N("span", null, [B(" "), u || h])])]);
|
|
386
400
|
}
|
|
387
401
|
});
|
|
388
|
-
function
|
|
402
|
+
function Re(a, e, t) {
|
|
389
403
|
var D;
|
|
390
|
-
const
|
|
391
|
-
function
|
|
404
|
+
const l = "", n = "", v = o();
|
|
405
|
+
function m() {
|
|
392
406
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
393
407
|
}
|
|
394
408
|
function b() {
|
|
395
409
|
return !1;
|
|
396
410
|
}
|
|
397
|
-
function
|
|
411
|
+
function P() {
|
|
398
412
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
399
413
|
}
|
|
400
|
-
function
|
|
414
|
+
function r() {
|
|
401
415
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
402
416
|
}
|
|
403
417
|
function s(u) {
|
|
@@ -405,14 +419,14 @@ function we(a, e, t) {
|
|
|
405
419
|
return null;
|
|
406
420
|
if (u.value.schema && u.value.schema.type === "component")
|
|
407
421
|
return u.value;
|
|
408
|
-
const
|
|
409
|
-
return
|
|
422
|
+
const h = o(u == null ? void 0 : u.value.parent), y = s(h);
|
|
423
|
+
return y || null;
|
|
410
424
|
}
|
|
411
425
|
function f(u = e) {
|
|
412
|
-
const { componentInstance:
|
|
413
|
-
return !
|
|
426
|
+
const { componentInstance: h, designerItemElementRef: y } = u;
|
|
427
|
+
return !h || !h.value ? null : h.value.canMove ? y : f(u.parent);
|
|
414
428
|
}
|
|
415
|
-
function
|
|
429
|
+
function d(u) {
|
|
416
430
|
return !!t;
|
|
417
431
|
}
|
|
418
432
|
function S() {
|
|
@@ -420,137 +434,137 @@ function we(a, e, t) {
|
|
|
420
434
|
}
|
|
421
435
|
function M() {
|
|
422
436
|
}
|
|
423
|
-
function
|
|
437
|
+
function g(u, h) {
|
|
424
438
|
}
|
|
425
|
-
function T(u,
|
|
426
|
-
const { componentType:
|
|
427
|
-
let j =
|
|
428
|
-
const
|
|
429
|
-
return j && !j.id && j.type ===
|
|
439
|
+
function T(u, h) {
|
|
440
|
+
const { componentType: y } = u;
|
|
441
|
+
let j = ee(y, u, h);
|
|
442
|
+
const E = y.toLowerCase().replace(/-/g, "_");
|
|
443
|
+
return j && !j.id && j.type === y && (j.id = `${E}_${Math.random().toString().slice(2, 6)}`), j;
|
|
430
444
|
}
|
|
431
445
|
function O(u) {
|
|
432
446
|
}
|
|
433
447
|
function k(...u) {
|
|
434
448
|
}
|
|
435
|
-
function
|
|
449
|
+
function p() {
|
|
436
450
|
e != null && e.schema.contents && e.schema.contents.map((u) => {
|
|
437
451
|
var j;
|
|
438
|
-
let
|
|
439
|
-
u.type === "component-ref" && (
|
|
440
|
-
const
|
|
441
|
-
(j =
|
|
452
|
+
let h = u.id;
|
|
453
|
+
u.type === "component-ref" && (h = u.component);
|
|
454
|
+
const y = a.value.querySelector(`#${h}-design-item`);
|
|
455
|
+
(j = y == null ? void 0 : y.componentInstance) != null && j.value.onRemoveComponent && y.componentInstance.value.onRemoveComponent();
|
|
442
456
|
});
|
|
443
457
|
}
|
|
444
|
-
return
|
|
445
|
-
canMove:
|
|
458
|
+
return v.value = {
|
|
459
|
+
canMove: m(),
|
|
446
460
|
canSelectParent: b(),
|
|
447
|
-
canDelete:
|
|
448
|
-
canNested: !
|
|
461
|
+
canDelete: P(),
|
|
462
|
+
canNested: !r(),
|
|
449
463
|
contents: e == null ? void 0 : e.schema.contents,
|
|
450
464
|
elementRef: a,
|
|
451
465
|
parent: (D = e == null ? void 0 : e.parent) == null ? void 0 : D.componentInstance,
|
|
452
466
|
schema: e == null ? void 0 : e.schema,
|
|
453
|
-
styles:
|
|
454
|
-
designerClass:
|
|
455
|
-
canAccepts:
|
|
467
|
+
styles: l,
|
|
468
|
+
designerClass: n,
|
|
469
|
+
canAccepts: d,
|
|
456
470
|
getBelongedComponentInstance: s,
|
|
457
471
|
getDraggableDesignItemElement: f,
|
|
458
472
|
getDraggingDisplayText: S,
|
|
459
473
|
getPropConfig: k,
|
|
460
474
|
getDragScopeElement: M,
|
|
461
|
-
onAcceptMovedChildElement:
|
|
475
|
+
onAcceptMovedChildElement: g,
|
|
462
476
|
onChildElementMovedOut: O,
|
|
463
477
|
addNewChildComponentSchema: T,
|
|
464
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
465
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
466
|
-
onRemoveComponent:
|
|
467
|
-
},
|
|
478
|
+
triggerBelongedComponentToMoveWhenMoved: o(!1),
|
|
479
|
+
triggerBelongedComponentToDeleteWhenDeleted: o(!1),
|
|
480
|
+
onRemoveComponent: p
|
|
481
|
+
}, v;
|
|
468
482
|
}
|
|
469
483
|
const Ee = /* @__PURE__ */ Z({
|
|
470
484
|
name: "FRateDesign",
|
|
471
485
|
props: Q,
|
|
472
486
|
emits: ["selectedValue"],
|
|
473
487
|
setup(a, e) {
|
|
474
|
-
const t =
|
|
475
|
-
let
|
|
476
|
-
const T =
|
|
488
|
+
const t = o(a.size), l = o(a.enableHalf), n = o(a.enableClear), v = o(a.disabled), m = o(a.pointSystem), b = o(a.lightColor), P = o(a.darkColor), r = o(a.iconClass), s = o(a.numOfStar), f = o(a.toolTipDisabled), d = o(a.toolTipContents), S = o(a.enableScore), M = o(a.enableSatisfaction);
|
|
489
|
+
let g;
|
|
490
|
+
const T = o(1);
|
|
477
491
|
let O = 0;
|
|
478
|
-
const k =
|
|
479
|
-
let D = 1, u,
|
|
480
|
-
const j = 4,
|
|
492
|
+
const k = o(0), p = o(0);
|
|
493
|
+
let D = 1, u, h, y;
|
|
494
|
+
const j = 4, E = o(), $ = le("design-item-context"), F = Re(E, $);
|
|
481
495
|
G(() => {
|
|
482
|
-
|
|
496
|
+
E.value.componentInstance = F;
|
|
483
497
|
}), e.expose(F.value), G(() => {
|
|
484
498
|
});
|
|
485
|
-
function
|
|
499
|
+
function H() {
|
|
486
500
|
const i = s.value;
|
|
487
|
-
|
|
488
|
-
for (let
|
|
489
|
-
|
|
490
|
-
id:
|
|
501
|
+
y = [];
|
|
502
|
+
for (let w = 1; w <= i; w++)
|
|
503
|
+
y.push({
|
|
504
|
+
id: w
|
|
491
505
|
});
|
|
492
506
|
}
|
|
493
|
-
function
|
|
507
|
+
function _() {
|
|
494
508
|
let i;
|
|
495
|
-
|
|
509
|
+
l.value ? i = Math.ceil(p.value / D) : i = p.value, O = (g * p.value + Math.floor(p.value) * j) / D, u = d.value[i - 1];
|
|
496
510
|
}
|
|
497
|
-
function
|
|
511
|
+
function z() {
|
|
498
512
|
switch (t.value) {
|
|
499
513
|
case "small":
|
|
500
|
-
|
|
514
|
+
g = 14;
|
|
501
515
|
break;
|
|
502
516
|
case "middle":
|
|
503
|
-
|
|
517
|
+
g = 16;
|
|
504
518
|
break;
|
|
505
519
|
case "large":
|
|
506
|
-
|
|
520
|
+
g = 18;
|
|
507
521
|
break;
|
|
508
522
|
case "extraLarge":
|
|
509
|
-
|
|
523
|
+
g = 24;
|
|
510
524
|
break;
|
|
511
525
|
}
|
|
512
|
-
|
|
526
|
+
H(), s.value && (D = m.value / s.value), p.value && _();
|
|
513
527
|
}
|
|
514
|
-
|
|
528
|
+
z();
|
|
515
529
|
function L(i) {
|
|
516
530
|
return i.className.indexOf("f-icon") !== -1;
|
|
517
531
|
}
|
|
518
|
-
function
|
|
519
|
-
return T.value === O &&
|
|
532
|
+
function C() {
|
|
533
|
+
return T.value === O && n && O !== 0 ? (O = 0, p.value = 0, h = null, T.value = 0, k.value = 0, e.emit("selectedValue", p.value), !0) : !1;
|
|
520
534
|
}
|
|
521
|
-
function
|
|
535
|
+
function X(i, w, Y) {
|
|
522
536
|
if (i.movementX || i.movementY) {
|
|
523
|
-
if (
|
|
537
|
+
if (v.value)
|
|
524
538
|
return;
|
|
525
|
-
M.value && (u =
|
|
539
|
+
M.value && (u = d.value[w - 1]), i.offsetX < g / 2 && l.value === !0 ? (T.value = g * w - g / 2 + j * (w - 1), k.value = D * w - D / 2) : (T.value = g * w + j * (w - 1), k.value = D * w);
|
|
526
540
|
}
|
|
527
541
|
if (Y === !0) {
|
|
528
|
-
if (
|
|
542
|
+
if (C())
|
|
529
543
|
return;
|
|
530
|
-
|
|
544
|
+
p.value = k.value, O = T.value, h = u, e.emit("selectedValue", p.value);
|
|
531
545
|
}
|
|
532
546
|
}
|
|
533
|
-
function A(i,
|
|
547
|
+
function A(i, w) {
|
|
534
548
|
if (L(i.target) && i.target) {
|
|
535
549
|
const Y = parseInt(i.target.id);
|
|
536
|
-
|
|
550
|
+
X(i, Y, w);
|
|
537
551
|
}
|
|
538
552
|
}
|
|
539
|
-
const c = W(() => k.value ? k.value + "分" :
|
|
553
|
+
const c = W(() => k.value ? k.value + "分" : p.value + "分"), V = W(() => ({
|
|
540
554
|
width: (T.value || O) + "px"
|
|
541
555
|
}));
|
|
542
556
|
return () => N("div", {
|
|
543
557
|
class: "farris-star-rating",
|
|
544
|
-
ref:
|
|
545
|
-
onMouseover:
|
|
546
|
-
onMousemove:
|
|
547
|
-
onMouseout:
|
|
548
|
-
onClick:
|
|
558
|
+
ref: E,
|
|
559
|
+
onMouseover: R((i) => A(i, !1), ["prevent"]),
|
|
560
|
+
onMousemove: R((i) => A(i, !1), ["prevent"]),
|
|
561
|
+
onMouseout: R((i) => A(i, !1), ["prevent"]),
|
|
562
|
+
onClick: R((i) => A(i, !0), ["prevent"])
|
|
549
563
|
}, [N("div", {
|
|
550
564
|
class: "star-light-area",
|
|
551
565
|
style: V.value
|
|
552
|
-
}, [
|
|
553
|
-
class: ["f-icon default-light-color ",
|
|
566
|
+
}, [y.map((i) => N("span", {
|
|
567
|
+
class: ["f-icon default-light-color ", r.value, {
|
|
554
568
|
"f-star-sm": t.value === "small"
|
|
555
569
|
}, {
|
|
556
570
|
"f-star-md": t.value === "middle"
|
|
@@ -573,8 +587,8 @@ const Ee = /* @__PURE__ */ Z({
|
|
|
573
587
|
}, {
|
|
574
588
|
large: t.value === "large"
|
|
575
589
|
}]
|
|
576
|
-
}, [
|
|
577
|
-
class: ["f-icon default-dark-color",
|
|
590
|
+
}, [y.map((i) => N("span", {
|
|
591
|
+
class: ["f-icon default-dark-color", r.value, {
|
|
578
592
|
"f-star-sm": t.value === "small"
|
|
579
593
|
}, {
|
|
580
594
|
"f-star-md": t.value === "middle"
|
|
@@ -585,7 +599,7 @@ const Ee = /* @__PURE__ */ Z({
|
|
|
585
599
|
}],
|
|
586
600
|
id: i.id,
|
|
587
601
|
style: {
|
|
588
|
-
color:
|
|
602
|
+
color: P.value
|
|
589
603
|
}
|
|
590
604
|
}, null))]), N("div", {
|
|
591
605
|
class: ["f-utils-fill", {
|
|
@@ -597,19 +611,19 @@ const Ee = /* @__PURE__ */ Z({
|
|
|
597
611
|
}, {
|
|
598
612
|
"font-exlarge": t.value === "extraLarge"
|
|
599
613
|
}]
|
|
600
|
-
}, [S.value && N("span", null, [B(" "), c.value, B(" ")]), M.value && (
|
|
614
|
+
}, [S.value && N("span", null, [B(" "), c.value, B(" ")]), M.value && (h || u) && N("span", null, [B(" "), u || h])])]);
|
|
601
615
|
}
|
|
602
616
|
});
|
|
603
|
-
|
|
604
|
-
a.rate =
|
|
617
|
+
q.register = (a, e, t, l) => {
|
|
618
|
+
a.rate = q, e.rate = ae;
|
|
605
619
|
};
|
|
606
|
-
|
|
607
|
-
a.rate = Ee, e.rate =
|
|
620
|
+
q.registerDesigner = (a, e, t) => {
|
|
621
|
+
a.rate = Ee, e.rate = ae;
|
|
608
622
|
};
|
|
609
|
-
const
|
|
623
|
+
const $e = re(q);
|
|
610
624
|
export {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
625
|
+
q as FRate,
|
|
626
|
+
$e as default,
|
|
627
|
+
ae as propsResolver,
|
|
614
628
|
Q as rateProps
|
|
615
629
|
};
|