@farris/ui-vue 1.6.5-beta.7 → 1.6.5-beta.8
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 +65 -65
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +28 -29
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +521 -517
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +134 -134
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +192 -192
- package/components/capsule/index.umd.cjs +1 -1
- package/components/code-editor/index.esm.js +8 -8
- package/components/code-editor/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +72 -72
- package/components/collection-property-editor/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +291 -289
- package/components/color-picker/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +163 -157
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +113 -112
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +3 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +10 -10
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1122 -1121
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +190 -190
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2693 -2693
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1604 -1601
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +1082 -1079
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/discussion-editor/index.esm.js +973 -1040
- package/components/discussion-editor/index.umd.cjs +6 -6
- package/components/dropdown/index.esm.js +335 -330
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +8 -8
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +6 -6
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +344 -344
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +8 -8
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +1470 -1460
- package/components/expression-editor/index.umd.cjs +3 -3
- package/components/fieldset/index.esm.js +55 -55
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +853 -843
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +922 -911
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +12 -12
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/html-template/index.esm.js +164 -164
- package/components/html-template/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +198 -198
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/json-editor/index.esm.js +64 -64
- package/components/json-editor/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +140 -140
- package/components/language-textbox/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +111 -111
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +90 -90
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +104 -108
- package/components/list-view/index.umd.cjs +3 -3
- package/components/locale/index.esm.js +833 -901
- package/components/locale/index.umd.cjs +6 -6
- package/components/lookup/index.esm.js +1352 -1351
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1311 -1307
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/menu-lookup/index.esm.js +1059 -1127
- package/components/menu-lookup/index.umd.cjs +6 -6
- package/components/message-box/index.esm.js +7 -7
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +9 -9
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +106 -106
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +326 -326
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +168 -167
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +739 -737
- package/components/order/index.umd.cjs +4 -4
- package/components/page-footer/index.esm.js +94 -94
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +942 -939
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +82 -82
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +1 -1
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +113 -113
- package/components/progress/index.umd.cjs +2 -2
- package/components/property-editor/index.esm.js +151 -150
- package/components/property-editor/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +565 -565
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +4142 -4190
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +182 -182
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +106 -106
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +409 -409
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +1488 -1478
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +779 -776
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +1765 -1762
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/search-box/index.esm.js +114 -114
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +1184 -1181
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +163 -163
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +927 -916
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/splitter/index.esm.js +3 -3
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +133 -133
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +76 -72
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1527 -1524
- package/components/tabs/index.umd.cjs +2 -2
- package/components/tags/index.esm.js +93 -93
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +138 -138
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +361 -361
- package/components/textarea/index.umd.cjs +2 -2
- package/components/tooltip/index.esm.js +173 -171
- package/components/tooltip/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +130 -134
- package/components/transfer/index.umd.cjs +4 -4
- package/components/tree-grid/index.esm.js +25 -25
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +1746 -1743
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +170 -170
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +196 -196
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +8 -8
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +9 -9
- package/components/weather/index.umd.cjs +2 -2
- package/farris.all.esm.js +16987 -17002
- package/farris.all.umd.cjs +27 -27
- package/package.json +1 -1
- package/types/lookup/src/composition/use-dialog.d.ts +2 -0
- package/types/lookup/src/composition/use-input-change.d.ts +1 -0
- package/components/time-picker/index.css +0 -1
- package/components/time-picker/index.esm.js +0 -9793
- package/components/time-picker/index.umd.cjs +0 -1
- package/components/time-picker/package.json +0 -8
- package/components/time-picker/style.js +0 -6
- package/designer/button-edit/index.css +0 -1
- package/designer/button-edit/index.esm.js +0 -4856
- package/designer/button-edit/index.umd.cjs +0 -1
- package/designer/checkbox/index.esm.js +0 -250
- package/designer/checkbox/index.umd.cjs +0 -1
- package/designer/checkbox-group/index.esm.js +0 -377
- package/designer/checkbox-group/index.umd.cjs +0 -1
- package/designer/data-grid/index.css +0 -1
- package/designer/data-grid/index.esm.js +0 -15413
- package/designer/data-grid/index.umd.cjs +0 -23
- package/designer/data-view/index.esm.js +0 -854
- package/designer/data-view/index.umd.cjs +0 -38
- package/designer/drawer/index.css +0 -1
- package/designer/drawer/index.esm.js +0 -525
- package/designer/drawer/index.umd.cjs +0 -1
- package/designer/farris-designer.all.esm.js +0 -22320
- package/designer/farris-designer.all.umd.cjs +0 -34
- package/designer/index.css +0 -1
- package/designer/input-group/index.esm.js +0 -1098
- package/designer/input-group/index.umd.cjs +0 -1
- package/designer/list-view/index.css +0 -1
- package/designer/list-view/index.esm.js +0 -4675
- package/designer/list-view/index.umd.cjs +0 -40
- package/designer/radio-group/index.css +0 -1
- package/designer/radio-group/index.esm.js +0 -6980
- package/designer/radio-group/index.umd.cjs +0 -1
- package/designer/tree-grid/index.esm.js +0 -1099
- package/designer/tree-grid/index.umd.cjs +0 -1
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ue = (t, e, r) => e in t ?
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
|
+
var Ue = (t, e, r) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var a = (t, e, r) => Ue(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { ref as
|
|
5
|
-
import {
|
|
4
|
+
import { ref as E, computed as Z, defineComponent as oe, onMounted as ae, watch as C, createVNode as M, withModifiers as ie, createTextVNode as ge, onBeforeMount as be, withDirectives as ne, vShow as re, vModelText as ke, inject as qe } from "vue";
|
|
5
|
+
import { cloneDeep as ye, isPlainObject as we } from "lodash-es";
|
|
6
6
|
import { getSchemaByTypeForDesigner as Ie } from "../dynamic-resolver/index.esm.js";
|
|
7
7
|
import { withInstall as Xe } from "../common/index.esm.js";
|
|
8
8
|
function Pe(t, e) {
|
|
9
9
|
let r;
|
|
10
10
|
function n(c) {
|
|
11
|
-
const { properties: p, title:
|
|
12
|
-
if (
|
|
13
|
-
const P =
|
|
11
|
+
const { properties: p, title: v, ignore: l } = c, s = l && Array.isArray(l), b = Object.keys(p).reduce((P, B) => ((!s || !l.find((F) => F === B)) && (P[B] = p[B].type === "object" && p[B].properties ? n(p[B]) : ye(p[B].default)), P), {});
|
|
12
|
+
if (v && (!s || !l.find((P) => P === "id"))) {
|
|
13
|
+
const P = v.toLowerCase().replace(/-/g, "_");
|
|
14
14
|
b.id = `${P}_${Math.random().toString().slice(2, 6)}`;
|
|
15
15
|
}
|
|
16
16
|
return b;
|
|
17
17
|
}
|
|
18
18
|
function u(c) {
|
|
19
|
-
const { properties: p, title:
|
|
19
|
+
const { properties: p, title: v, required: l } = c;
|
|
20
20
|
if (l && Array.isArray(l)) {
|
|
21
|
-
const s = l.reduce((b, P) => (b[P] = p[P].type === "object" && p[P].properties ? n(p[P]) :
|
|
22
|
-
if (
|
|
23
|
-
const b =
|
|
21
|
+
const s = l.reduce((b, P) => (b[P] = p[P].type === "object" && p[P].properties ? n(p[P]) : ye(p[P].default), b), {});
|
|
22
|
+
if (v && l.find((b) => b === "id")) {
|
|
23
|
+
const b = v.toLowerCase().replace(/-/g, "_");
|
|
24
24
|
s.id = `${b}_${Math.random().toString().slice(2, 6)}`;
|
|
25
25
|
}
|
|
26
26
|
return s;
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
|
-
type:
|
|
29
|
+
type: v
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function y(c, p = {},
|
|
32
|
+
function y(c, p = {}, v) {
|
|
33
33
|
const l = t[c];
|
|
34
34
|
if (l) {
|
|
35
35
|
let s = u(l);
|
|
36
36
|
const b = e[c];
|
|
37
|
-
return s = b ? b({ getSchemaByType: y }, s, p,
|
|
37
|
+
return s = b ? b({ getSchemaByType: y }, s, p, v) : s, r != null && r.appendIdentifyForNewControl && r.appendIdentifyForNewControl(s), s;
|
|
38
38
|
}
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
function d(c, p) {
|
|
42
|
-
const
|
|
43
|
-
return Object.keys(
|
|
42
|
+
const v = n(p);
|
|
43
|
+
return Object.keys(v).reduce((l, s) => (Object.prototype.hasOwnProperty.call(c, s) && (l[s] && we(l[s]) && we(c[s] || !c[s]) ? Object.assign(l[s], c[s] || {}) : l[s] = c[s]), l), v), v;
|
|
44
44
|
}
|
|
45
45
|
function g(c, p) {
|
|
46
46
|
return Object.keys(c).filter((l) => c[l] != null).reduce((l, s) => {
|
|
@@ -57,21 +57,21 @@ function Pe(t, e) {
|
|
|
57
57
|
return l;
|
|
58
58
|
}, {});
|
|
59
59
|
}
|
|
60
|
-
function w(c, p,
|
|
60
|
+
function w(c, p, v = /* @__PURE__ */ new Map()) {
|
|
61
61
|
const l = d(c, p);
|
|
62
|
-
return g(l,
|
|
62
|
+
return g(l, v);
|
|
63
63
|
}
|
|
64
64
|
function h(c) {
|
|
65
|
-
var
|
|
65
|
+
var v;
|
|
66
66
|
const p = c.type;
|
|
67
67
|
if (p) {
|
|
68
68
|
const l = t[p];
|
|
69
69
|
if (!l)
|
|
70
70
|
return c;
|
|
71
|
-
const s = d(c, l), b = ((
|
|
71
|
+
const s = d(c, l), b = ((v = c.editor) == null ? void 0 : v.type) || "";
|
|
72
72
|
if (b) {
|
|
73
|
-
const P = t[b],
|
|
74
|
-
s.editor =
|
|
73
|
+
const P = t[b], B = d(c.editor, P);
|
|
74
|
+
s.editor = B;
|
|
75
75
|
}
|
|
76
76
|
return s;
|
|
77
77
|
}
|
|
@@ -82,18 +82,18 @@ function Pe(t, e) {
|
|
|
82
82
|
}
|
|
83
83
|
return { getSchemaByType: y, resolveSchemaWithDefaultValue: h, resolveSchemaToProps: w, mappingSchemaToProps: g, setDesignerContext: f };
|
|
84
84
|
}
|
|
85
|
-
const Se = {}, Me = {}, { resolveSchemaWithDefaultValue: Ge, resolveSchemaToProps: ze, mappingSchemaToProps: We } = Pe(Se, Me);
|
|
85
|
+
const Se = {}, Me = {}, { getSchemaByType: Gt, resolveSchemaWithDefaultValue: Ge, resolveSchemaToProps: ze, mappingSchemaToProps: We, setDesignerContext: zt } = Pe(Se, Me);
|
|
86
86
|
function Ye(t = {}) {
|
|
87
87
|
function e(h, f, c, p) {
|
|
88
88
|
if (typeof c == "number")
|
|
89
89
|
return p[h].length === c;
|
|
90
90
|
if (typeof c == "object") {
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
91
|
+
const v = Object.keys(c)[0], l = c[v];
|
|
92
|
+
if (v === "not")
|
|
93
93
|
return Number(p[h].length) !== Number(l);
|
|
94
|
-
if (
|
|
94
|
+
if (v === "moreThan")
|
|
95
95
|
return Number(p[h].length) >= Number(l);
|
|
96
|
-
if (
|
|
96
|
+
if (v === "lessThan")
|
|
97
97
|
return Number(p[h].length) <= Number(l);
|
|
98
98
|
}
|
|
99
99
|
return !1;
|
|
@@ -111,14 +111,14 @@ function Ye(t = {}) {
|
|
|
111
111
|
return typeof f == "number" ? [{ target: c, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: c, operator: "getProperty", param: h, value: !!f }] : typeof f == "object" ? Object.keys(f).map((p) => {
|
|
112
112
|
if (p === "length")
|
|
113
113
|
return { target: c, operator: "length", param: null, value: f[p] };
|
|
114
|
-
const
|
|
115
|
-
return { target: c, operator: "getProperty", param:
|
|
114
|
+
const v = p, l = f[p];
|
|
115
|
+
return { target: c, operator: "getProperty", param: v, value: l };
|
|
116
116
|
}) : [];
|
|
117
117
|
}
|
|
118
118
|
function y(h) {
|
|
119
119
|
return Object.keys(h).reduce((c, p) => {
|
|
120
|
-
const
|
|
121
|
-
return c.push(...
|
|
120
|
+
const v = u(p, h[p]);
|
|
121
|
+
return c.push(...v), c;
|
|
122
122
|
}, []);
|
|
123
123
|
}
|
|
124
124
|
function d(h, f) {
|
|
@@ -129,10 +129,10 @@ function Ye(t = {}) {
|
|
|
129
129
|
return !1;
|
|
130
130
|
}
|
|
131
131
|
function g(h, f) {
|
|
132
|
-
return y(h).reduce((
|
|
132
|
+
return y(h).reduce((v, l) => v && d(l, f), !0);
|
|
133
133
|
}
|
|
134
134
|
function w(h, f) {
|
|
135
|
-
const c = Object.keys(h), p = c.includes("allOf"),
|
|
135
|
+
const c = Object.keys(h), p = c.includes("allOf"), v = c.includes("anyOf"), l = p || v, P = (l ? h[l ? p ? "allOf" : "anyOf" : "allOf"] : [h]).map((F) => g(F, f));
|
|
136
136
|
return p ? !P.includes(!1) : P.includes(!0);
|
|
137
137
|
}
|
|
138
138
|
return { parseValueSchema: w };
|
|
@@ -439,77 +439,77 @@ function $e(t, e, r) {
|
|
|
439
439
|
const b = l.$converter || s;
|
|
440
440
|
return typeof b == "string" && b && n.has(b) ? n.get(b) || null : b || null;
|
|
441
441
|
}
|
|
442
|
-
function f(l, s, b, P,
|
|
442
|
+
function f(l, s, b, P, B, F = "", L = "") {
|
|
443
443
|
return Object.keys(l).map((V) => {
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
const G = S.type === "cascade" ? f(S.properties, s, b, P,
|
|
447
|
-
let I = h(S,
|
|
444
|
+
const D = E(1), X = V, S = l[V], q = Object.keys(S), T = S.title, $ = S.type, N = u.get($) || { type: "input-group", enableClear: !1 }, R = S.editor ? Object.assign({}, N, S.editor) : Object.assign({}, N), O = g(q, S, s), A = w(q, S, s);
|
|
445
|
+
R.readonly = R.readonly === void 0 ? A() : R.readonly;
|
|
446
|
+
const G = S.type === "cascade" ? f(S.properties, s, b, P, B, F, L) : [], K = !0;
|
|
447
|
+
let I = h(S, L);
|
|
448
448
|
const J = Z({
|
|
449
449
|
get() {
|
|
450
|
-
if (
|
|
450
|
+
if (D.value) {
|
|
451
451
|
if (["class", "style"].find((te) => te === X) && !I && (I = n.get("/converter/appearance.converter") || null), I && I.convertFrom)
|
|
452
|
-
return I.convertFrom(b, V,
|
|
452
|
+
return I.convertFrom(b, V, B, F);
|
|
453
453
|
const z = b[V];
|
|
454
454
|
return Object.prototype.hasOwnProperty.call(S, "defaultValue") && (z === void 0 || typeof z == "string" && z === "") ? S.type === "boolean" ? S.defaultValue : S.defaultValue || "" : z;
|
|
455
455
|
}
|
|
456
456
|
return null;
|
|
457
457
|
},
|
|
458
458
|
set(z) {
|
|
459
|
-
|
|
459
|
+
D.value += 1, I && I.convertTo ? (I.convertTo(P, V, z, B, F), I.convertTo(b, V, z, B, F)) : (P[V] = z, b[V] = z);
|
|
460
460
|
}
|
|
461
|
-
}), { refreshPanelAfterChanged: Q, description: se, isExpand: _, parentPropertyID: le } = S, W = { propertyID: X, propertyName: T, propertyType:
|
|
461
|
+
}), { refreshPanelAfterChanged: Q, description: se, isExpand: _, parentPropertyID: le } = S, W = { propertyID: X, propertyName: T, propertyType: $, propertyValue: J, editor: R, visible: O, readonly: A, cascadeConfig: G, hideCascadeTitle: K, refreshPanelAfterChanged: Q, description: se, isExpand: _, parentPropertyID: le };
|
|
462
462
|
return s[X] = W, W;
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
function c(l, s, b = {}) {
|
|
466
|
-
const P = {},
|
|
467
|
-
return
|
|
468
|
-
const
|
|
469
|
-
return { categoryId:
|
|
466
|
+
const P = {}, B = t[l];
|
|
467
|
+
return B && B.categories ? Object.keys(B.categories).map((L) => {
|
|
468
|
+
const j = B.categories[L], V = j == null ? void 0 : j.title, D = f(j.properties || {}, P, {}, b, s);
|
|
469
|
+
return { categoryId: L, categoryName: V, properties: D };
|
|
470
470
|
}) : [];
|
|
471
471
|
}
|
|
472
|
-
function p(l, s, b, P,
|
|
473
|
-
const F = s.$ref.schema,
|
|
472
|
+
function p(l, s, b, P, B = "") {
|
|
473
|
+
const F = s.$ref.schema, L = s.$ref.converter, j = b[F], V = j.type, D = r(j), X = {}, S = t[V];
|
|
474
474
|
if (S && S.categories) {
|
|
475
475
|
const q = S.categories[l], T = q == null ? void 0 : q.title;
|
|
476
|
-
|
|
477
|
-
q.properties[
|
|
476
|
+
L && Object.keys(q.properties).forEach((R) => {
|
|
477
|
+
q.properties[R].$converter = L;
|
|
478
478
|
});
|
|
479
|
-
const
|
|
480
|
-
return { categoryId: l, categoryName: T, properties:
|
|
479
|
+
const $ = (q == null ? void 0 : q.properties) || {}, N = f($, X, D, j, P, B);
|
|
480
|
+
return { categoryId: l, categoryName: T, properties: N };
|
|
481
481
|
}
|
|
482
482
|
return { categoryId: l, categoryName: "", properties: [] };
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
const F = l.type,
|
|
486
|
-
let V =
|
|
484
|
+
function v(l, s, b, P, B) {
|
|
485
|
+
const F = l.type, L = r(l), j = {};
|
|
486
|
+
let V = B || t[F];
|
|
487
487
|
if (V && Object.keys(V).length === 0 && b && b.getPropConfig && (V = b.getPropConfig(P)), V && V.categories) {
|
|
488
|
-
const
|
|
488
|
+
const D = [];
|
|
489
489
|
return Object.keys(V.categories).map((X) => {
|
|
490
490
|
const S = V.categories[X];
|
|
491
491
|
if (S.$ref) {
|
|
492
|
-
|
|
492
|
+
D.push(p(X, S, l, s, P));
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
|
-
const q = S == null ? void 0 : S.title, T = S == null ? void 0 : S.tabId,
|
|
496
|
-
|
|
497
|
-
}),
|
|
495
|
+
const q = S == null ? void 0 : S.title, T = S == null ? void 0 : S.tabId, $ = S == null ? void 0 : S.tabName, N = S == null ? void 0 : S.hide, R = S == null ? void 0 : S.hideTitle, O = f(S.properties || {}, j, L, l, s, P, S.$converter), { setPropertyRelates: A } = S, G = S == null ? void 0 : S.parentPropertyID;
|
|
496
|
+
D.push({ categoryId: X, categoryName: q, tabId: T, tabName: $, hide: N, properties: O, hideTitle: R, setPropertyRelates: A, parentPropertyID: G });
|
|
497
|
+
}), D;
|
|
498
498
|
}
|
|
499
499
|
return [];
|
|
500
500
|
}
|
|
501
501
|
return {
|
|
502
|
-
getPropertyConfigBySchema:
|
|
502
|
+
getPropertyConfigBySchema: v,
|
|
503
503
|
getPropertyConfigByType: c,
|
|
504
504
|
propertyConverterMap: n
|
|
505
505
|
};
|
|
506
506
|
}
|
|
507
|
-
const
|
|
508
|
-
$e(
|
|
509
|
-
const
|
|
507
|
+
const Ee = {}, Ne = {};
|
|
508
|
+
$e(Ee, Ne, Ge);
|
|
509
|
+
const Re = {}, He = {}, { getSchemaByType: Wt, resolveSchemaWithDefaultValue: ht, resolveSchemaToProps: Yt, mappingSchemaToProps: Jt, setDesignerContext: Qt } = Pe(Re, He), Oe = {}, Fe = {};
|
|
510
510
|
$e(Oe, Fe, ht);
|
|
511
511
|
function gt(t, e, r = /* @__PURE__ */ new Map(), n = (d, g, w, h) => g, u = {}, y = (d) => d) {
|
|
512
|
-
return Se[e.title] = e, Me[e.title] = n,
|
|
512
|
+
return Se[e.title] = e, Me[e.title] = n, Ee[e.title] = u, Ne[e.title] = y, Re[e.title] = e, He[e.title] = n, Oe[e.title] = u, Fe[e.title] = y, (d = {}, g = !0) => {
|
|
513
513
|
if (!g)
|
|
514
514
|
return We(d, r);
|
|
515
515
|
const w = ze(d, e, r), h = Object.keys(t).reduce((f, c) => (f[c] = t[c].default, f), {});
|
|
@@ -598,7 +598,7 @@ function Bt(t, e) {
|
|
|
598
598
|
}
|
|
599
599
|
const $t = /* @__PURE__ */ new Map([
|
|
600
600
|
["appearance", Bt]
|
|
601
|
-
]),
|
|
601
|
+
]), Et = "color-picker", Nt = "A Farris Component", Rt = "object", Ht = {
|
|
602
602
|
basic: {
|
|
603
603
|
description: "Basic Infomation",
|
|
604
604
|
title: "基本信息",
|
|
@@ -621,9 +621,9 @@ const $t = /* @__PURE__ */ new Map([
|
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
}, Ot = {
|
|
624
|
-
title:
|
|
625
|
-
description:
|
|
626
|
-
type:
|
|
624
|
+
title: Et,
|
|
625
|
+
description: Nt,
|
|
626
|
+
type: Rt,
|
|
627
627
|
categories: Ht
|
|
628
628
|
}, ve = {
|
|
629
629
|
/** 初始颜色 */
|
|
@@ -862,23 +862,23 @@ class H {
|
|
|
862
862
|
}
|
|
863
863
|
hsvaToRgba(e) {
|
|
864
864
|
let r = 1, n = 0, u = 0;
|
|
865
|
-
const y = e.saturation / 100, d = e.value / 100, { alpha: g } = e, w = e.hue / 60, h = Math.floor(w), f = w - h, c = (1 - y) * d, p = (1 - y * f) * d,
|
|
865
|
+
const y = e.saturation / 100, d = e.value / 100, { alpha: g } = e, w = e.hue / 60, h = Math.floor(w), f = w - h, c = (1 - y) * d, p = (1 - y * f) * d, v = (1 - y * (1 - f)) * d;
|
|
866
866
|
switch (h) {
|
|
867
867
|
case 6:
|
|
868
868
|
case 0:
|
|
869
|
-
r = d, n =
|
|
869
|
+
r = d, n = v, u = c;
|
|
870
870
|
break;
|
|
871
871
|
case 1:
|
|
872
872
|
r = p, n = d, u = c;
|
|
873
873
|
break;
|
|
874
874
|
case 2:
|
|
875
|
-
r = c, n = d, u =
|
|
875
|
+
r = c, n = d, u = v;
|
|
876
876
|
break;
|
|
877
877
|
case 3:
|
|
878
878
|
r = c, n = p, u = d;
|
|
879
879
|
break;
|
|
880
880
|
case 4:
|
|
881
|
-
r =
|
|
881
|
+
r = v, n = c, u = d;
|
|
882
882
|
break;
|
|
883
883
|
case 5:
|
|
884
884
|
r = d, n = c, u = p;
|
|
@@ -1034,10 +1034,10 @@ class me {
|
|
|
1034
1034
|
a(this, "hueValue", null);
|
|
1035
1035
|
/** 初始颜色值 */
|
|
1036
1036
|
a(this, "initValue", null);
|
|
1037
|
-
a(this, "valueChanged",
|
|
1037
|
+
a(this, "valueChanged", E());
|
|
1038
1038
|
a(this, "initType", null);
|
|
1039
1039
|
// 此处没有监听变量变更后操作的方法 TODO
|
|
1040
|
-
a(this, "alphaChannelVisibilityChanges",
|
|
1040
|
+
a(this, "alphaChannelVisibilityChanges", E());
|
|
1041
1041
|
a(this, "colorPresets", []);
|
|
1042
1042
|
const r = e[0], n = H.from(r);
|
|
1043
1043
|
this.setValue(n), this.setHueColor(n);
|
|
@@ -1139,18 +1139,18 @@ const Ft = {
|
|
|
1139
1139
|
hue: { type: Object, default: "" },
|
|
1140
1140
|
randomId: { type: String, default: "" },
|
|
1141
1141
|
allowColorNull: { type: Boolean, default: !1 }
|
|
1142
|
-
},
|
|
1142
|
+
}, De = /* @__PURE__ */ oe({
|
|
1143
1143
|
name: "SvPanel",
|
|
1144
1144
|
props: Ft,
|
|
1145
1145
|
emits: ["update:color"],
|
|
1146
1146
|
setup(t, e) {
|
|
1147
|
-
const r =
|
|
1147
|
+
const r = E(null), n = E(null), u = E(t.randomId), y = E(t.allowColorNull);
|
|
1148
1148
|
function d() {
|
|
1149
1149
|
return t.hue ? t.hue.toRgbaString() : "#3f51b5";
|
|
1150
1150
|
}
|
|
1151
1151
|
function g(c, p) {
|
|
1152
|
-
var
|
|
1153
|
-
c = Math.max(0, Math.min(c, 100)), p = Math.max(0, Math.min(p, 100)), r.value && ((
|
|
1152
|
+
var v, l;
|
|
1153
|
+
c = Math.max(0, Math.min(c, 100)), p = Math.max(0, Math.min(p, 100)), r.value && ((v = r.value.style) == null || v.setProperty("top", `${100 - p}%`), (l = r.value.style) == null || l.setProperty("left", `${c}%`));
|
|
1154
1154
|
}
|
|
1155
1155
|
function w() {
|
|
1156
1156
|
const c = document.getElementById(`farris-color-picker-plus-sure-${u.value}`);
|
|
@@ -1161,33 +1161,33 @@ const Ft = {
|
|
|
1161
1161
|
function h({
|
|
1162
1162
|
x: c,
|
|
1163
1163
|
y: p,
|
|
1164
|
-
height:
|
|
1164
|
+
height: v,
|
|
1165
1165
|
width: l
|
|
1166
1166
|
}) {
|
|
1167
|
-
const s = c * 100 / l, b = -(p * 100 /
|
|
1167
|
+
const s = c * 100 / l, b = -(p * 100 / v) + 100;
|
|
1168
1168
|
g(s, b);
|
|
1169
|
-
const P = t.color == null ? "transparent" : t.color,
|
|
1170
|
-
if (w(),
|
|
1171
|
-
const F = t.hue.getHsva(),
|
|
1172
|
-
e.emit("update:color",
|
|
1169
|
+
const P = t.color == null ? "transparent" : t.color, B = H.from(P);
|
|
1170
|
+
if (w(), B != null) {
|
|
1171
|
+
const F = t.hue.getHsva(), L = B.getHsva(), j = new H().setHsva(F.hue, s, b, L.alpha);
|
|
1172
|
+
e.emit("update:color", j);
|
|
1173
1173
|
}
|
|
1174
|
-
!
|
|
1174
|
+
!B && y.value && e.emit("update:color", null);
|
|
1175
1175
|
}
|
|
1176
1176
|
function f(c) {
|
|
1177
1177
|
if (n.value) {
|
|
1178
1178
|
const {
|
|
1179
1179
|
width: p,
|
|
1180
|
-
height:
|
|
1180
|
+
height: v,
|
|
1181
1181
|
top: l,
|
|
1182
1182
|
left: s
|
|
1183
1183
|
} = n.value.getBoundingClientRect(), {
|
|
1184
1184
|
pageX: b,
|
|
1185
1185
|
pageY: P
|
|
1186
|
-
} = "touches" in c ? c.touches[0] : c,
|
|
1186
|
+
} = "touches" in c ? c.touches[0] : c, B = Math.max(0, Math.min(b - (s + window.pageXOffset), p)), F = Math.max(0, Math.min(P - (l + window.pageYOffset), v));
|
|
1187
1187
|
h({
|
|
1188
|
-
x:
|
|
1188
|
+
x: B,
|
|
1189
1189
|
y: F,
|
|
1190
|
-
height:
|
|
1190
|
+
height: v,
|
|
1191
1191
|
width: p
|
|
1192
1192
|
});
|
|
1193
1193
|
}
|
|
@@ -1222,29 +1222,29 @@ const Ft = {
|
|
|
1222
1222
|
hue: { type: Object, default: "" },
|
|
1223
1223
|
allowColorNull: { type: Boolean, default: !1 },
|
|
1224
1224
|
onChange: { type: Function }
|
|
1225
|
-
},
|
|
1225
|
+
}, je = /* @__PURE__ */ oe({
|
|
1226
1226
|
name: "Hue",
|
|
1227
1227
|
props: Vt,
|
|
1228
1228
|
emits: ["update:color", "update:hue"],
|
|
1229
1229
|
setup(t, e) {
|
|
1230
|
-
const r =
|
|
1230
|
+
const r = E(t.hue), n = E(t.allowColorNull), u = [];
|
|
1231
1231
|
function y(l) {
|
|
1232
1232
|
l.preventDefault(), g(l);
|
|
1233
1233
|
}
|
|
1234
|
-
const d =
|
|
1234
|
+
const d = E(null);
|
|
1235
1235
|
function g(l) {
|
|
1236
1236
|
if (d.value) {
|
|
1237
1237
|
const {
|
|
1238
1238
|
width: s,
|
|
1239
1239
|
height: b,
|
|
1240
1240
|
top: P,
|
|
1241
|
-
left:
|
|
1241
|
+
left: B
|
|
1242
1242
|
} = d.value.getBoundingClientRect(), {
|
|
1243
1243
|
pageX: F,
|
|
1244
|
-
pageY:
|
|
1245
|
-
} = "touches" in l ? l.touches[0] : l,
|
|
1246
|
-
|
|
1247
|
-
x:
|
|
1244
|
+
pageY: L
|
|
1245
|
+
} = "touches" in l ? l.touches[0] : l, j = Math.max(0, Math.min(F - (B + window.pageXOffset), s)), V = Math.max(0, Math.min(L - (P + window.pageYOffset), b));
|
|
1246
|
+
v({
|
|
1247
|
+
x: j,
|
|
1248
1248
|
y: V,
|
|
1249
1249
|
height: b,
|
|
1250
1250
|
width: s
|
|
@@ -1267,22 +1267,22 @@ const Ft = {
|
|
|
1267
1267
|
const s = t.color.getHsva();
|
|
1268
1268
|
p(s.hue);
|
|
1269
1269
|
});
|
|
1270
|
-
const c =
|
|
1270
|
+
const c = E(null);
|
|
1271
1271
|
function p(l) {
|
|
1272
1272
|
var P;
|
|
1273
1273
|
const s = Math.max(0, Math.min(l / 360 * 100, 100));
|
|
1274
1274
|
c.value && ((P = c.value.style) == null || P.setProperty("top", `${s}%`));
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1276
|
+
function v({
|
|
1277
1277
|
x: l,
|
|
1278
1278
|
y: s,
|
|
1279
1279
|
height: b,
|
|
1280
1280
|
width: P
|
|
1281
1281
|
}) {
|
|
1282
|
-
const
|
|
1283
|
-
p(
|
|
1284
|
-
const F = t.color.getHsva(),
|
|
1285
|
-
(t.color != null || t.color == null && n.value) && (e.emit("update:hue",
|
|
1282
|
+
const B = s / b * 360;
|
|
1283
|
+
p(B);
|
|
1284
|
+
const F = t.color.getHsva(), L = new H().setHsva(B, F.saturation, F.value, F.alpha), j = new H().setHsva(B, 100, 100, F.alpha);
|
|
1285
|
+
(t.color != null || t.color == null && n.value) && (e.emit("update:hue", j), e.emit("update:color", L));
|
|
1286
1286
|
}
|
|
1287
1287
|
return C(r, (l) => {
|
|
1288
1288
|
const s = l.getHsva();
|
|
@@ -1302,33 +1302,35 @@ const Ft = {
|
|
|
1302
1302
|
ref: c
|
|
1303
1303
|
}, null)]);
|
|
1304
1304
|
}
|
|
1305
|
-
}),
|
|
1305
|
+
}), Dt = {
|
|
1306
1306
|
color: { type: Object, default: "" },
|
|
1307
1307
|
randomId: { type: String, default: "" },
|
|
1308
1308
|
allowColorNull: { type: Boolean, default: !1 }
|
|
1309
1309
|
}, Ae = /* @__PURE__ */ oe({
|
|
1310
1310
|
name: "Alpha",
|
|
1311
|
-
props:
|
|
1311
|
+
props: Dt,
|
|
1312
1312
|
emits: ["update:color"],
|
|
1313
1313
|
setup(t, e) {
|
|
1314
|
-
const r =
|
|
1315
|
-
var
|
|
1314
|
+
const r = E(null), n = E(null), u = E(t.randomId), y = E(t.allowColorNull), d = (f) => {
|
|
1315
|
+
var v;
|
|
1316
1316
|
const c = Math.max(0, Math.min(f * 100, 100));
|
|
1317
|
-
n.value && ((
|
|
1317
|
+
n.value && ((v = n.value.style) == null || v.setProperty("left", `${c}%`));
|
|
1318
1318
|
};
|
|
1319
1319
|
function g(f) {
|
|
1320
1320
|
if (r.value) {
|
|
1321
1321
|
const {
|
|
1322
1322
|
width: c,
|
|
1323
1323
|
height: p,
|
|
1324
|
-
top:
|
|
1324
|
+
top: v,
|
|
1325
1325
|
left: l
|
|
1326
1326
|
} = r.value.getBoundingClientRect(), {
|
|
1327
1327
|
pageX: s,
|
|
1328
1328
|
pageY: b
|
|
1329
|
-
} = "touches" in f ? f.touches[0] : f, P = Math.max(0, Math.min(s - (l + window.pageXOffset), c));
|
|
1329
|
+
} = "touches" in f ? f.touches[0] : f, P = Math.max(0, Math.min(s - (l + window.pageXOffset), c)), B = Math.max(0, Math.min(b - (v + window.pageYOffset), p));
|
|
1330
1330
|
h({
|
|
1331
1331
|
x: P,
|
|
1332
|
+
y: B,
|
|
1333
|
+
height: p,
|
|
1332
1334
|
width: c
|
|
1333
1335
|
});
|
|
1334
1336
|
}
|
|
@@ -1345,7 +1347,7 @@ const Ft = {
|
|
|
1345
1347
|
}) => {
|
|
1346
1348
|
const p = f / c;
|
|
1347
1349
|
d(p), w();
|
|
1348
|
-
const
|
|
1350
|
+
const v = t.color.getHsva(), l = new H().setHsva(v.hue, v.saturation, v.value, p);
|
|
1349
1351
|
t.color != null ? e.emit("update:color", l) : t.color == null && y.value && e.emit("update:color", null);
|
|
1350
1352
|
};
|
|
1351
1353
|
return ae(() => {
|
|
@@ -1366,17 +1368,17 @@ const Ft = {
|
|
|
1366
1368
|
ref: n
|
|
1367
1369
|
}, null)]);
|
|
1368
1370
|
}
|
|
1369
|
-
}),
|
|
1371
|
+
}), jt = {
|
|
1370
1372
|
color: { type: Object, default: "" },
|
|
1371
1373
|
hue: { type: Object, default: "" },
|
|
1372
1374
|
colorPresets: { type: Object, default: "" },
|
|
1373
1375
|
randomId: { type: String, default: "" }
|
|
1374
|
-
},
|
|
1376
|
+
}, xe = /* @__PURE__ */ oe({
|
|
1375
1377
|
name: "Preset",
|
|
1376
|
-
props:
|
|
1378
|
+
props: jt,
|
|
1377
1379
|
emits: ["update:hue", "update:color"],
|
|
1378
1380
|
setup(t, e) {
|
|
1379
|
-
const r =
|
|
1381
|
+
const r = E(new H()), n = E(t.colorPresets), u = E(t.randomId);
|
|
1380
1382
|
function y() {
|
|
1381
1383
|
const h = document.getElementById(`farris-color-picker-plus-sure-${u.value}`);
|
|
1382
1384
|
h.className = "btn btn-secondary";
|
|
@@ -1385,8 +1387,8 @@ const Ft = {
|
|
|
1385
1387
|
}
|
|
1386
1388
|
function d(h) {
|
|
1387
1389
|
y();
|
|
1388
|
-
const f = h.getRgba(), c = h.getHsva(), p = new H().setRgba(f.red, f.green, f.blue, f.alpha),
|
|
1389
|
-
r.value = h, e.emit("update:hue",
|
|
1390
|
+
const f = h.getRgba(), c = h.getHsva(), p = new H().setRgba(f.red, f.green, f.blue, f.alpha), v = new H().setHsva(c.hue);
|
|
1391
|
+
r.value = h, e.emit("update:hue", v), e.emit("update:color", p);
|
|
1390
1392
|
}
|
|
1391
1393
|
function g(h) {
|
|
1392
1394
|
const f = r.value.getRgba().toString(), c = r.value.getHsva().toString(), p = h.getRgba().toString() === f && h.getHsva().toString() === c;
|
|
@@ -1418,55 +1420,55 @@ const Ft = {
|
|
|
1418
1420
|
props: ve,
|
|
1419
1421
|
emits: ["valueChanged", "activeChange", "update:color", "update:hue"],
|
|
1420
1422
|
setup(t, e) {
|
|
1421
|
-
const r =
|
|
1422
|
-
let
|
|
1423
|
-
const s = new me("#000000"), b =
|
|
1424
|
-
let P,
|
|
1425
|
-
const F =
|
|
1423
|
+
const r = E(new H(t.color)), n = E(t.color), u = E(t.disabled), y = E(t.color), d = E(t.allowColorNull), g = E(t.presets), w = E(!1), h = E(!1), f = E(!1), c = E("HEX"), p = Math.floor(Math.random() * 1e3).toString();
|
|
1424
|
+
let v = -1, l;
|
|
1425
|
+
const s = new me("#000000"), b = E(t.color);
|
|
1426
|
+
let P, B;
|
|
1427
|
+
const F = E(null), L = E(null), j = E(null), V = Z(() => !l && s && s.initType ? s.initType : l), D = Z({
|
|
1426
1428
|
get() {
|
|
1427
1429
|
return l && n.value !== null ? (z(l), Y(new H(n.value), U[l])) : n.value;
|
|
1428
1430
|
},
|
|
1429
1431
|
set(k) {
|
|
1430
1432
|
k !== null && (_(k), Q(k));
|
|
1431
1433
|
}
|
|
1432
|
-
}), X =
|
|
1434
|
+
}), X = E(D.value), S = Z(() => v > -1), q = Z(() => g.value.length > 0), T = Z(() => ({
|
|
1433
1435
|
"background-color": y.value
|
|
1434
|
-
})),
|
|
1436
|
+
})), $ = Z(() => h.value && w.value ? "display:flex" : "display:none"), N = [{
|
|
1435
1437
|
text: "HEX",
|
|
1436
1438
|
type: U.hex
|
|
1437
1439
|
}, {
|
|
1438
1440
|
text: "RGBA",
|
|
1439
1441
|
type: U.rgba
|
|
1440
1442
|
}];
|
|
1441
|
-
function
|
|
1443
|
+
function R() {
|
|
1442
1444
|
const k = document.getElementById("farris-color-picker-panel");
|
|
1443
1445
|
k.id = `farris-color-picker-panel-${p}`;
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1446
|
+
const m = document.getElementById("farris-color-picker-plus-sure");
|
|
1447
|
+
m.id = `farris-color-picker-plus-sure-${p}`;
|
|
1448
|
+
const x = document.getElementById("farris-color-picker-plus-input");
|
|
1449
|
+
x.id = `farris-color-picker-plus-input-${p}`, B = document.getElementById(`farris-color-picker-plus-sure-${p}`), P = document.getElementById(`farris-color-picker-panel-${p}`), P.className = "color-picker-panel disabled";
|
|
1448
1450
|
}
|
|
1449
1451
|
function O() {
|
|
1450
1452
|
if (!d.value && !n.value) {
|
|
1451
1453
|
document.getElementById(`farris-color-picker-plus-sure-${p}`).classList.toggle("disabled");
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1454
|
+
const m = document.getElementById(`farris-color-picker-plus-input-${p}`);
|
|
1455
|
+
m.style.borderColor = "red";
|
|
1454
1456
|
}
|
|
1455
1457
|
}
|
|
1456
1458
|
function A() {
|
|
1457
|
-
n.value && (_(n.value), !n.value && d.value || (n.value = Y(new H(n.value), U[V.value])), X.value =
|
|
1459
|
+
n.value && (_(n.value), !n.value && d.value || (n.value = Y(new H(n.value), U[V.value])), X.value = D.value), I(z(s.initType));
|
|
1458
1460
|
}
|
|
1459
1461
|
function G() {
|
|
1460
1462
|
n.value && _(n.value), s.hasPresets() || s.setColorPresets(g.value), n.value ? y.value = Y(new H(n.value), U[V.value]) : !n.value && d.value && (y.value = null);
|
|
1461
1463
|
}
|
|
1462
1464
|
function K() {
|
|
1463
1465
|
C(s.valueChanged, (k) => {
|
|
1464
|
-
const
|
|
1465
|
-
n.value =
|
|
1466
|
+
const m = Y(k, U[l || s.initType]);
|
|
1467
|
+
n.value = m;
|
|
1466
1468
|
});
|
|
1467
1469
|
}
|
|
1468
1470
|
function I(k) {
|
|
1469
|
-
c.value =
|
|
1471
|
+
c.value = N[k].text;
|
|
1470
1472
|
}
|
|
1471
1473
|
function J() {
|
|
1472
1474
|
var k;
|
|
@@ -1475,20 +1477,20 @@ const Ft = {
|
|
|
1475
1477
|
be(() => {
|
|
1476
1478
|
s.setColorPresets(g.value || ["#eaecf3"]);
|
|
1477
1479
|
}), ae(() => {
|
|
1478
|
-
|
|
1480
|
+
R(), O(), A(), G();
|
|
1479
1481
|
}), K(), C(c, () => {
|
|
1480
|
-
|
|
1482
|
+
D.value = Y(new H(n.value), U[l || s.initType]), r.value = new H(D.value), J();
|
|
1481
1483
|
}), C(n, (k) => {
|
|
1482
1484
|
Y(s.value, s.initType) !== k && k !== null && _(k), I(z(s.initType));
|
|
1483
1485
|
}), C(r, (k) => {
|
|
1484
|
-
n.value = Y(k, U[l || s.initType]), _(n.value),
|
|
1486
|
+
n.value = Y(k, U[l || s.initType]), _(n.value), D.value = n.value;
|
|
1485
1487
|
});
|
|
1486
1488
|
function Q(k) {
|
|
1487
|
-
const
|
|
1488
|
-
(k === "" || k === void 0 || k == null) && !d.value ? (n.value = null,
|
|
1489
|
+
const m = document.getElementById(`farris-color-picker-plus-input-${p}`);
|
|
1490
|
+
(k === "" || k === void 0 || k == null) && !d.value ? (n.value = null, m.style.borderColor = "red", B.className = "btn btn-secondary disabled") : (m.style.borderColor = "#dcdfe6", B.className = "btn btn-secondary");
|
|
1489
1491
|
}
|
|
1490
1492
|
function se(k) {
|
|
1491
|
-
var
|
|
1493
|
+
var m, x;
|
|
1492
1494
|
if (k == null || k.stopPropagation(), d.value) {
|
|
1493
1495
|
y.value = (n == null ? void 0 : n.value) ?? null;
|
|
1494
1496
|
const ee = {
|
|
@@ -1496,56 +1498,56 @@ const Ft = {
|
|
|
1496
1498
|
};
|
|
1497
1499
|
e.emit("valueChanged", ee), W();
|
|
1498
1500
|
}
|
|
1499
|
-
if (!d.value && !(
|
|
1500
|
-
(
|
|
1501
|
+
if (!d.value && !(D.value === void 0 || D.value == null || D.value === "")) {
|
|
1502
|
+
(x = (m = F.value) == null ? void 0 : m.style) == null || x.setProperty("background", n.value), f.value = !0, y.value = n.value;
|
|
1501
1503
|
const ee = {
|
|
1502
1504
|
elementValue: y
|
|
1503
1505
|
};
|
|
1504
1506
|
e.emit("valueChanged", ee), W();
|
|
1505
1507
|
}
|
|
1506
|
-
!b.value && !n.value && !f.value && d && W(), Q(n.value),
|
|
1508
|
+
!b.value && !n.value && !f.value && d && W(), Q(n.value), D.value = n.value, B.classList.contains("disabled") || (X.value = n.value, w.value = !1);
|
|
1507
1509
|
}
|
|
1508
1510
|
function _(k) {
|
|
1509
1511
|
s == null || s.setValueFrom(k, p, d.value);
|
|
1510
1512
|
}
|
|
1511
1513
|
function le(k) {
|
|
1512
1514
|
P = document.getElementById(`farris-color-picker-panel-${p}`);
|
|
1513
|
-
const
|
|
1514
|
-
u.value ||
|
|
1515
|
+
const m = P.className === "color-picker-panel";
|
|
1516
|
+
u.value || m || (w.value = !0, P.classList.toggle("disabled"), O(), _(n.value), k.stopPropagation());
|
|
1515
1517
|
}
|
|
1516
1518
|
function W() {
|
|
1517
1519
|
P = document.getElementById(`farris-color-picker-panel-${p}`), P.className = "color-picker-panel disabled";
|
|
1518
1520
|
}
|
|
1519
1521
|
function z(k) {
|
|
1520
|
-
const
|
|
1521
|
-
return
|
|
1522
|
+
const m = N.findIndex((x) => x.type === k);
|
|
1523
|
+
return v = m, m;
|
|
1522
1524
|
}
|
|
1523
1525
|
function te(k) {
|
|
1524
|
-
if (!
|
|
1525
|
-
const
|
|
1526
|
-
|
|
1526
|
+
if (!B.classList.contains("disabled")) {
|
|
1527
|
+
const m = N.length;
|
|
1528
|
+
v = (m + v + (k === "up" ? 1 : -1)) % m, l = N[v].type, I(v), _(n.value);
|
|
1527
1529
|
}
|
|
1528
1530
|
}
|
|
1529
1531
|
return () => M("div", {
|
|
1530
1532
|
class: "f-color-picker-component",
|
|
1531
|
-
ref:
|
|
1533
|
+
ref: L
|
|
1532
1534
|
}, [M("div", {
|
|
1533
1535
|
class: ["color-picker-panel", {
|
|
1534
1536
|
disabled: u.value
|
|
1535
1537
|
}],
|
|
1536
1538
|
id: "farris-color-picker-panel",
|
|
1537
|
-
ref:
|
|
1539
|
+
ref: j,
|
|
1538
1540
|
onClick: (k) => k.stopPropagation(),
|
|
1539
1541
|
style: "top:30px"
|
|
1540
1542
|
}, [M("div", {
|
|
1541
1543
|
class: "color-picker-main"
|
|
1542
|
-
}, [M(
|
|
1544
|
+
}, [M(je, {
|
|
1543
1545
|
hue: s.hue,
|
|
1544
1546
|
"onUpdate:hue": (k) => s.hue = k,
|
|
1545
1547
|
allowColorNull: d.value,
|
|
1546
1548
|
color: r.value,
|
|
1547
1549
|
"onUpdate:color": (k) => r.value = k
|
|
1548
|
-
}, null), M(
|
|
1550
|
+
}, null), M(De, {
|
|
1549
1551
|
randomId: p,
|
|
1550
1552
|
hue: s.hue,
|
|
1551
1553
|
"onUpdate:hue": (k) => s.hue = k,
|
|
@@ -1553,7 +1555,7 @@ const Ft = {
|
|
|
1553
1555
|
color: r.value,
|
|
1554
1556
|
"onUpdate:color": (k) => r.value = k
|
|
1555
1557
|
}, null)]), M(Ae, {
|
|
1556
|
-
style:
|
|
1558
|
+
style: $.value,
|
|
1557
1559
|
randomId: p,
|
|
1558
1560
|
allowColorNull: d.value,
|
|
1559
1561
|
color: r.value,
|
|
@@ -1567,9 +1569,9 @@ const Ft = {
|
|
|
1567
1569
|
type: "text",
|
|
1568
1570
|
title: "color-picker-plus",
|
|
1569
1571
|
id: "farris-color-picker-plus-input",
|
|
1570
|
-
"onUpdate:modelValue": (k) =>
|
|
1572
|
+
"onUpdate:modelValue": (k) => D.value = k,
|
|
1571
1573
|
style: "float:none"
|
|
1572
|
-
}, null), [[ke,
|
|
1574
|
+
}, null), [[ke, D.value]]), ne(M("div", {
|
|
1573
1575
|
class: "type-icon-btn-wrapper",
|
|
1574
1576
|
style: "cursor:pointer"
|
|
1575
1577
|
}, [M("span", {
|
|
@@ -1584,7 +1586,7 @@ const Ft = {
|
|
|
1584
1586
|
id: "farris-color-picker-plus-sure",
|
|
1585
1587
|
class: "btn btn-secondary",
|
|
1586
1588
|
onClick: (k) => se(k)
|
|
1587
|
-
}, [ge("确定")])])]), ne(M(
|
|
1589
|
+
}, [ge("确定")])])]), ne(M(xe, {
|
|
1588
1590
|
color: r.value,
|
|
1589
1591
|
"onUpdate:color": (k) => r.value = k,
|
|
1590
1592
|
hue: s.hue,
|
|
@@ -1612,7 +1614,7 @@ const Ft = {
|
|
|
1612
1614
|
});
|
|
1613
1615
|
function At(t, e, r) {
|
|
1614
1616
|
var T;
|
|
1615
|
-
const n = "", u = "", y =
|
|
1617
|
+
const n = "", u = "", y = E();
|
|
1616
1618
|
let d;
|
|
1617
1619
|
function g() {
|
|
1618
1620
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
@@ -1626,91 +1628,91 @@ function At(t, e, r) {
|
|
|
1626
1628
|
function f() {
|
|
1627
1629
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
1628
1630
|
}
|
|
1629
|
-
function c(
|
|
1630
|
-
if (
|
|
1631
|
+
function c($) {
|
|
1632
|
+
if (!$ || !$.value)
|
|
1631
1633
|
return null;
|
|
1632
|
-
if (
|
|
1633
|
-
return
|
|
1634
|
-
const
|
|
1635
|
-
return
|
|
1634
|
+
if ($.value.schema && $.value.schema.type === "component")
|
|
1635
|
+
return $.value;
|
|
1636
|
+
const N = E($ == null ? void 0 : $.value.parent), R = c(N);
|
|
1637
|
+
return R || null;
|
|
1636
1638
|
}
|
|
1637
|
-
function p(
|
|
1639
|
+
function p($ = e) {
|
|
1638
1640
|
var A;
|
|
1639
|
-
const { componentInstance:
|
|
1640
|
-
if (!
|
|
1641
|
+
const { componentInstance: N, designerItemElementRef: R } = $;
|
|
1642
|
+
if (!N || !N.value)
|
|
1641
1643
|
return null;
|
|
1642
|
-
const { getCustomButtons: O } =
|
|
1643
|
-
return
|
|
1644
|
+
const { getCustomButtons: O } = N.value;
|
|
1645
|
+
return N.value.canMove || O && ((A = O()) != null && A.length) ? R : p($.parent);
|
|
1644
1646
|
}
|
|
1645
|
-
function
|
|
1646
|
-
return
|
|
1647
|
+
function v($) {
|
|
1648
|
+
return !!r;
|
|
1647
1649
|
}
|
|
1648
1650
|
function l() {
|
|
1649
1651
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
1650
1652
|
}
|
|
1651
1653
|
function s() {
|
|
1652
1654
|
}
|
|
1653
|
-
function b(
|
|
1654
|
-
var
|
|
1655
|
-
|
|
1655
|
+
function b($, N) {
|
|
1656
|
+
var R;
|
|
1657
|
+
!$ || !N || (R = e == null ? void 0 : e.setupContext) == null || R.emit("dragEnd");
|
|
1656
1658
|
}
|
|
1657
|
-
function P(
|
|
1658
|
-
const { componentType:
|
|
1659
|
-
let O = Ie(
|
|
1660
|
-
const A =
|
|
1661
|
-
return O && !O.id && O.type ===
|
|
1659
|
+
function P($, N) {
|
|
1660
|
+
const { componentType: R } = $;
|
|
1661
|
+
let O = Ie(R, $, N);
|
|
1662
|
+
const A = R.toLowerCase().replace(/-/g, "_");
|
|
1663
|
+
return O && !O.id && O.type === R && (O.id = `${A}_${Math.random().toString().slice(2, 6)}`), O;
|
|
1662
1664
|
}
|
|
1663
|
-
function
|
|
1665
|
+
function B($) {
|
|
1664
1666
|
}
|
|
1665
|
-
function F(
|
|
1667
|
+
function F(...$) {
|
|
1666
1668
|
}
|
|
1667
|
-
function
|
|
1668
|
-
if (
|
|
1669
|
+
function L($) {
|
|
1670
|
+
if (!$)
|
|
1669
1671
|
return;
|
|
1670
|
-
const
|
|
1671
|
-
if (
|
|
1672
|
-
const O =
|
|
1673
|
-
O > -1 &&
|
|
1672
|
+
const N = e == null ? void 0 : e.schema, { formSchemaUtils: R } = $;
|
|
1673
|
+
if (N && R.getExpressions().length) {
|
|
1674
|
+
const O = R.getExpressions().findIndex((A) => A.target === N.id);
|
|
1675
|
+
O > -1 && R.getExpressions().splice(O, 1);
|
|
1674
1676
|
}
|
|
1675
1677
|
}
|
|
1676
|
-
function
|
|
1677
|
-
if (
|
|
1678
|
+
function j($) {
|
|
1679
|
+
if (!$ || !(e != null && e.schema))
|
|
1678
1680
|
return;
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1681
|
-
}
|
|
1682
|
-
function V(
|
|
1683
|
-
|
|
1684
|
-
let
|
|
1685
|
-
|
|
1686
|
-
const O = t.value.querySelectorAll(`#${
|
|
1681
|
+
const N = e.schema, { formSchemaUtils: R } = $;
|
|
1682
|
+
R.removeCommunicationInComponent(N);
|
|
1683
|
+
}
|
|
1684
|
+
function V($) {
|
|
1685
|
+
L($), j($), e != null && e.schema.contents && e.schema.contents.map((N) => {
|
|
1686
|
+
let R = N.id;
|
|
1687
|
+
N.type === "component-ref" && (R = N.component);
|
|
1688
|
+
const O = t.value.querySelectorAll(`#${R}-design-item`);
|
|
1687
1689
|
O != null && O.length && Array.from(O).map((A) => {
|
|
1688
1690
|
var G;
|
|
1689
|
-
(G = A == null ? void 0 : A.componentInstance) != null && G.value.onRemoveComponent && A.componentInstance.value.onRemoveComponent(
|
|
1691
|
+
(G = A == null ? void 0 : A.componentInstance) != null && G.value.onRemoveComponent && A.componentInstance.value.onRemoveComponent($);
|
|
1690
1692
|
});
|
|
1691
1693
|
});
|
|
1692
1694
|
}
|
|
1693
|
-
function
|
|
1695
|
+
function D() {
|
|
1694
1696
|
}
|
|
1695
|
-
function X(
|
|
1696
|
-
var
|
|
1697
|
-
if (!((
|
|
1697
|
+
function X($) {
|
|
1698
|
+
var R, O;
|
|
1699
|
+
if (!((R = e == null ? void 0 : e.schema) != null && R.id))
|
|
1698
1700
|
return;
|
|
1699
|
-
!d &&
|
|
1700
|
-
let
|
|
1701
|
+
!d && $ && (d = $.formSchemaUtils);
|
|
1702
|
+
let N = "";
|
|
1701
1703
|
{
|
|
1702
1704
|
const { text: A, title: G, label: K, mainTitle: I, name: J, type: Q } = e.schema;
|
|
1703
|
-
|
|
1705
|
+
N = A || G || K || I || J || ((O = Be[Q]) == null ? void 0 : O.name);
|
|
1704
1706
|
}
|
|
1705
|
-
|
|
1706
|
-
componentTitle:
|
|
1707
|
-
parentPathName:
|
|
1707
|
+
N && d.getControlBasicInfoMap().set(e.schema.id, {
|
|
1708
|
+
componentTitle: N,
|
|
1709
|
+
parentPathName: N
|
|
1708
1710
|
});
|
|
1709
1711
|
}
|
|
1710
|
-
function S(
|
|
1712
|
+
function S($) {
|
|
1711
1713
|
var A;
|
|
1712
|
-
const { changeObject:
|
|
1713
|
-
if (["text", "title", "label", "name", "mainTitle"].includes((A =
|
|
1714
|
+
const { changeObject: N } = $, { propertyID: R, propertyValue: O } = N;
|
|
1715
|
+
if (["text", "title", "label", "name", "mainTitle"].includes((A = $ == null ? void 0 : $.changeObject) == null ? void 0 : A.propertyID) && R && O && (X(), d)) {
|
|
1714
1716
|
const G = d.getControlBasicInfoMap(), K = G.keys().toArray().filter((I) => {
|
|
1715
1717
|
var J, Q;
|
|
1716
1718
|
return ((J = G.get(I)) == null ? void 0 : J.reliedComponentId) === ((Q = e == null ? void 0 : e.schema) == null ? void 0 : Q.id);
|
|
@@ -1721,8 +1723,8 @@ function At(t, e, r) {
|
|
|
1721
1723
|
});
|
|
1722
1724
|
}
|
|
1723
1725
|
}
|
|
1724
|
-
function q(
|
|
1725
|
-
S(
|
|
1726
|
+
function q($) {
|
|
1727
|
+
S($);
|
|
1726
1728
|
}
|
|
1727
1729
|
return y.value = {
|
|
1728
1730
|
canMove: g(),
|
|
@@ -1735,47 +1737,47 @@ function At(t, e, r) {
|
|
|
1735
1737
|
schema: e == null ? void 0 : e.schema,
|
|
1736
1738
|
styles: n,
|
|
1737
1739
|
designerClass: u,
|
|
1738
|
-
canAccepts:
|
|
1740
|
+
canAccepts: v,
|
|
1739
1741
|
getBelongedComponentInstance: c,
|
|
1740
1742
|
getDraggableDesignItemElement: p,
|
|
1741
1743
|
getDraggingDisplayText: l,
|
|
1742
1744
|
getPropConfig: F,
|
|
1743
1745
|
getDragScopeElement: s,
|
|
1744
1746
|
onAcceptMovedChildElement: b,
|
|
1745
|
-
onChildElementMovedOut:
|
|
1747
|
+
onChildElementMovedOut: B,
|
|
1746
1748
|
addNewChildComponentSchema: P,
|
|
1747
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1748
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
1749
|
+
triggerBelongedComponentToMoveWhenMoved: E(!1),
|
|
1750
|
+
triggerBelongedComponentToDeleteWhenDeleted: E(!1),
|
|
1749
1751
|
onRemoveComponent: V,
|
|
1750
|
-
getCustomButtons:
|
|
1752
|
+
getCustomButtons: D,
|
|
1751
1753
|
onPropertyChanged: q,
|
|
1752
1754
|
setComponentBasicInfoMap: X,
|
|
1753
1755
|
updateContextSchema: e == null ? void 0 : e.updateContextSchema
|
|
1754
1756
|
}, y;
|
|
1755
1757
|
}
|
|
1756
|
-
const
|
|
1758
|
+
const xt = /* @__PURE__ */ oe({
|
|
1757
1759
|
name: "FColorPickerDesign",
|
|
1758
1760
|
props: ve,
|
|
1759
1761
|
emits: ["valueChanged", "activeChange", "update:color", "update:hue"],
|
|
1760
1762
|
setup(t, e) {
|
|
1761
|
-
const r =
|
|
1762
|
-
let
|
|
1763
|
-
const s = new me("#000000"), b =
|
|
1764
|
-
let P,
|
|
1765
|
-
const F =
|
|
1763
|
+
const r = E(new H(t.color)), n = E(t.color), u = E(t.disabled), y = E(t.color), d = E(t.allowColorNull), g = E(t.presets), w = E(!1), h = E(!1), f = E(!1), c = E("HEX"), p = Math.floor(Math.random() * 1e3).toString();
|
|
1764
|
+
let v = -1, l;
|
|
1765
|
+
const s = new me("#000000"), b = E(t.color);
|
|
1766
|
+
let P, B;
|
|
1767
|
+
const F = E(null), L = E(null), j = E(), V = qe("design-item-context"), D = At(j, V);
|
|
1766
1768
|
ae(() => {
|
|
1767
|
-
|
|
1768
|
-
}), e.expose(
|
|
1769
|
+
j.value.componentInstance = D;
|
|
1770
|
+
}), e.expose(D.value);
|
|
1769
1771
|
const X = Z(() => !l && s && s.initType ? s.initType : l), S = Z({
|
|
1770
1772
|
get() {
|
|
1771
1773
|
return l && n.value !== null ? (te(l), Y(new H(n.value), U[l])) : n.value;
|
|
1772
1774
|
},
|
|
1773
|
-
set(
|
|
1774
|
-
|
|
1775
|
+
set(m) {
|
|
1776
|
+
m !== null && (W(m), _(m));
|
|
1775
1777
|
}
|
|
1776
|
-
}), q =
|
|
1778
|
+
}), q = E(S.value), T = Z(() => v > -1), $ = Z(() => g.value.length > 0), N = Z(() => ({
|
|
1777
1779
|
"background-color": y.value
|
|
1778
|
-
})),
|
|
1780
|
+
})), R = Z(() => h.value && w.value ? "display:flex" : "display:none"), O = [{
|
|
1779
1781
|
text: "HEX",
|
|
1780
1782
|
type: U.hex
|
|
1781
1783
|
}, {
|
|
@@ -1783,18 +1785,18 @@ const Lt = /* @__PURE__ */ oe({
|
|
|
1783
1785
|
type: U.rgba
|
|
1784
1786
|
}];
|
|
1785
1787
|
function A() {
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1788
|
+
const m = document.getElementById("farris-color-picker-panel");
|
|
1789
|
+
m.id = `farris-color-picker-panel-${p}`;
|
|
1790
|
+
const x = document.getElementById("farris-color-picker-plus-sure");
|
|
1791
|
+
x.id = `farris-color-picker-plus-sure-${p}`;
|
|
1790
1792
|
const ee = document.getElementById("farris-color-picker-plus-input");
|
|
1791
|
-
ee.id = `farris-color-picker-plus-input-${p}`,
|
|
1793
|
+
ee.id = `farris-color-picker-plus-input-${p}`, B = document.getElementById(`farris-color-picker-plus-sure-${p}`), P = document.getElementById(`farris-color-picker-panel-${p}`), P.className = "color-picker-panel disabled";
|
|
1792
1794
|
}
|
|
1793
1795
|
function G() {
|
|
1794
1796
|
if (!d.value && !n.value) {
|
|
1795
1797
|
document.getElementById(`farris-color-picker-plus-sure-${p}`).classList.toggle("disabled");
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1798
|
+
const x = document.getElementById(`farris-color-picker-plus-input-${p}`);
|
|
1799
|
+
x.style.borderColor = "red";
|
|
1798
1800
|
}
|
|
1799
1801
|
}
|
|
1800
1802
|
function K() {
|
|
@@ -1804,17 +1806,17 @@ const Lt = /* @__PURE__ */ oe({
|
|
|
1804
1806
|
n.value && W(n.value), s.hasPresets() || s.setColorPresets(g.value), n.value ? y.value = Y(new H(n.value), U[X.value]) : !n.value && d.value && (y.value = null);
|
|
1805
1807
|
}
|
|
1806
1808
|
function J() {
|
|
1807
|
-
C(s.valueChanged, (
|
|
1808
|
-
const
|
|
1809
|
-
n.value =
|
|
1809
|
+
C(s.valueChanged, (m) => {
|
|
1810
|
+
const x = Y(m, U[l || s.initType]);
|
|
1811
|
+
n.value = x;
|
|
1810
1812
|
});
|
|
1811
1813
|
}
|
|
1812
|
-
function Q(
|
|
1813
|
-
c.value = O[
|
|
1814
|
+
function Q(m) {
|
|
1815
|
+
c.value = O[m].text;
|
|
1814
1816
|
}
|
|
1815
1817
|
function se() {
|
|
1816
|
-
var
|
|
1817
|
-
h.value = !!(l != null && l.includes("a") || (
|
|
1818
|
+
var m;
|
|
1819
|
+
h.value = !!(l != null && l.includes("a") || (m = s.initType) != null && m.includes("a"));
|
|
1818
1820
|
}
|
|
1819
1821
|
be(() => {
|
|
1820
1822
|
s.setColorPresets(g.value || ["#eaecf3"]);
|
|
@@ -1822,17 +1824,17 @@ const Lt = /* @__PURE__ */ oe({
|
|
|
1822
1824
|
A(), G(), K(), I();
|
|
1823
1825
|
}), J(), C(c, () => {
|
|
1824
1826
|
S.value = Y(new H(n.value), U[l || s.initType]), r.value = new H(S.value), se();
|
|
1825
|
-
}), C(n, (
|
|
1826
|
-
Y(s.value, s.initType) !==
|
|
1827
|
-
}), C(r, (
|
|
1828
|
-
n.value = Y(
|
|
1827
|
+
}), C(n, (m) => {
|
|
1828
|
+
Y(s.value, s.initType) !== m && m !== null && W(m), Q(te(s.initType));
|
|
1829
|
+
}), C(r, (m) => {
|
|
1830
|
+
n.value = Y(m, U[l || s.initType]), W(n.value), S.value = n.value;
|
|
1829
1831
|
});
|
|
1830
|
-
function _(
|
|
1831
|
-
const
|
|
1832
|
-
(
|
|
1832
|
+
function _(m) {
|
|
1833
|
+
const x = document.getElementById(`farris-color-picker-plus-input-${p}`);
|
|
1834
|
+
(m === "" || m === void 0 || m == null) && !d.value ? (n.value = null, x.style.borderColor = "red", B.className = "btn btn-secondary disabled") : (x.style.borderColor = "#dcdfe6", B.className = "btn btn-secondary");
|
|
1833
1835
|
}
|
|
1834
1836
|
function le() {
|
|
1835
|
-
var
|
|
1837
|
+
var m, x;
|
|
1836
1838
|
if (d.value) {
|
|
1837
1839
|
y.value = (n == null ? void 0 : n.value) ?? null;
|
|
1838
1840
|
const ee = {
|
|
@@ -1841,72 +1843,72 @@ const Lt = /* @__PURE__ */ oe({
|
|
|
1841
1843
|
e.emit("valueChanged", ee), P.classList.toggle("disabled");
|
|
1842
1844
|
}
|
|
1843
1845
|
if (!d.value && !(S.value === void 0 || S.value == null || S.value === "")) {
|
|
1844
|
-
(
|
|
1846
|
+
(x = (m = F.value) == null ? void 0 : m.style) == null || x.setProperty("background", n.value), f.value = !0, y.value = n.value;
|
|
1845
1847
|
const ee = {
|
|
1846
1848
|
elementValue: y
|
|
1847
1849
|
};
|
|
1848
1850
|
e.emit("valueChanged", ee), P.classList.toggle("disabled");
|
|
1849
1851
|
}
|
|
1850
|
-
!b.value && !n.value && !f.value && d && P.classList.toggle("disabled"), _(n.value), S.value = n.value,
|
|
1852
|
+
!b.value && !n.value && !f.value && d && P.classList.toggle("disabled"), _(n.value), S.value = n.value, B.classList.contains("disabled") || (q.value = n.value, w.value = !1);
|
|
1851
1853
|
}
|
|
1852
|
-
function W(
|
|
1853
|
-
s == null || s.setValueFrom(
|
|
1854
|
+
function W(m) {
|
|
1855
|
+
s == null || s.setValueFrom(m, p, d.value);
|
|
1854
1856
|
}
|
|
1855
|
-
function z(
|
|
1857
|
+
function z(m) {
|
|
1856
1858
|
u.value || (w.value = !0, P.classList.toggle("disabled"), G(), W(n.value));
|
|
1857
1859
|
}
|
|
1858
|
-
function te(
|
|
1859
|
-
const
|
|
1860
|
-
return
|
|
1860
|
+
function te(m) {
|
|
1861
|
+
const x = O.findIndex((ee) => ee.type === m);
|
|
1862
|
+
return v = x, x;
|
|
1861
1863
|
}
|
|
1862
|
-
function k(
|
|
1863
|
-
if (!
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1864
|
+
function k(m) {
|
|
1865
|
+
if (!B.classList.contains("disabled")) {
|
|
1866
|
+
const x = O.length;
|
|
1867
|
+
v = (x + v + (m === "up" ? 1 : -1)) % x, l = O[v].type, Q(v), W(n.value);
|
|
1866
1868
|
}
|
|
1867
1869
|
}
|
|
1868
1870
|
return () => M("div", {
|
|
1869
1871
|
class: "f-color-picker-component",
|
|
1870
|
-
ref:
|
|
1872
|
+
ref: j
|
|
1871
1873
|
}, [M("div", {
|
|
1872
1874
|
class: ["color-picker-panel", {
|
|
1873
1875
|
disabled: u.value
|
|
1874
1876
|
}],
|
|
1875
1877
|
id: "farris-color-picker-panel",
|
|
1876
|
-
ref:
|
|
1877
|
-
onClick: (
|
|
1878
|
+
ref: L,
|
|
1879
|
+
onClick: (m) => m.stopPropagation,
|
|
1878
1880
|
style: "top:30px"
|
|
1879
1881
|
}, [M("div", {
|
|
1880
1882
|
class: "color-picker-main"
|
|
1881
|
-
}, [M(
|
|
1883
|
+
}, [M(je, {
|
|
1882
1884
|
hue: s.hue,
|
|
1883
|
-
"onUpdate:hue": (
|
|
1885
|
+
"onUpdate:hue": (m) => s.hue = m,
|
|
1884
1886
|
allowColorNull: d.value,
|
|
1885
1887
|
color: r.value,
|
|
1886
|
-
"onUpdate:color": (
|
|
1887
|
-
}, null), M(
|
|
1888
|
+
"onUpdate:color": (m) => r.value = m
|
|
1889
|
+
}, null), M(De, {
|
|
1888
1890
|
randomId: p,
|
|
1889
1891
|
hue: s.hue,
|
|
1890
|
-
"onUpdate:hue": (
|
|
1892
|
+
"onUpdate:hue": (m) => s.hue = m,
|
|
1891
1893
|
allowColorNull: d.value,
|
|
1892
1894
|
color: r.value,
|
|
1893
|
-
"onUpdate:color": (
|
|
1895
|
+
"onUpdate:color": (m) => r.value = m
|
|
1894
1896
|
}, null)]), M(Ae, {
|
|
1895
|
-
style:
|
|
1897
|
+
style: R.value,
|
|
1896
1898
|
randomId: p,
|
|
1897
1899
|
allowColorNull: d.value,
|
|
1898
1900
|
color: r.value,
|
|
1899
|
-
"onUpdate:color": (
|
|
1901
|
+
"onUpdate:color": (m) => r.value = m
|
|
1900
1902
|
}, null), M("div", {
|
|
1901
1903
|
class: "input-btn",
|
|
1902
1904
|
style: "display:flex;align-items: center;"
|
|
1903
1905
|
}, [ne(M("span", {
|
|
1904
1906
|
style: "width:40px;margin-right:10px;"
|
|
1905
|
-
}, [c.value]), [[re,
|
|
1907
|
+
}, [c.value]), [[re, $]]), ne(M("input", {
|
|
1906
1908
|
title: "color-picker-plus-input",
|
|
1907
1909
|
type: "text",
|
|
1908
1910
|
id: "farris-color-picker-plus-input",
|
|
1909
|
-
"onUpdate:modelValue": (
|
|
1911
|
+
"onUpdate:modelValue": (m) => S.value = m,
|
|
1910
1912
|
style: "float:none"
|
|
1911
1913
|
}, null), [[ke, S.value]]), ne(M("div", {
|
|
1912
1914
|
class: "type-icon-btn-wrapper",
|
|
@@ -1917,18 +1919,18 @@ const Lt = /* @__PURE__ */ oe({
|
|
|
1917
1919
|
}, null), M("span", {
|
|
1918
1920
|
class: "f-icon f-icon-arrow-60-down type-icon-btn",
|
|
1919
1921
|
onClick: () => k("down")
|
|
1920
|
-
}, null)]), [[re,
|
|
1922
|
+
}, null)]), [[re, $]]), M("div", {
|
|
1921
1923
|
class: "input-btn"
|
|
1922
1924
|
}, [M("button", {
|
|
1923
1925
|
id: "farris-color-picker-plus-sure",
|
|
1924
1926
|
class: "btn btn-secondary",
|
|
1925
1927
|
onClick: le
|
|
1926
|
-
}, [ge("确定")])])]), ne(M(
|
|
1928
|
+
}, [ge("确定")])])]), ne(M(xe, {
|
|
1927
1929
|
color: r.value,
|
|
1928
|
-
"onUpdate:color": (
|
|
1930
|
+
"onUpdate:color": (m) => r.value = m,
|
|
1929
1931
|
colorPresets: s.presets,
|
|
1930
1932
|
hue: s.hue,
|
|
1931
|
-
"onUpdate:hue": (
|
|
1933
|
+
"onUpdate:hue": (m) => s.hue = m,
|
|
1932
1934
|
randomId: p
|
|
1933
1935
|
}, null), [[re, T]])]), M("div", {
|
|
1934
1936
|
class: "color-picker-wrapper"
|
|
@@ -1937,14 +1939,14 @@ const Lt = /* @__PURE__ */ oe({
|
|
|
1937
1939
|
class: "color-picker-input form-control",
|
|
1938
1940
|
value: q.value,
|
|
1939
1941
|
readonly: u.value,
|
|
1940
|
-
onClick: (
|
|
1942
|
+
onClick: (m) => m.stopPropagation()
|
|
1941
1943
|
}, null), M("div", {
|
|
1942
1944
|
class: "color-picker-trigger",
|
|
1943
1945
|
onClick: z
|
|
1944
1946
|
}, [M("div", {
|
|
1945
1947
|
class: "color-picker-trigger-inner"
|
|
1946
1948
|
}, [M("div", {
|
|
1947
|
-
style:
|
|
1949
|
+
style: N.value
|
|
1948
1950
|
}, null)])])])]);
|
|
1949
1951
|
}
|
|
1950
1952
|
});
|
|
@@ -1952,12 +1954,12 @@ pe.register = (t, e, r) => {
|
|
|
1952
1954
|
t["color-picker"] = pe, e["color-picker"] = Ve;
|
|
1953
1955
|
};
|
|
1954
1956
|
pe.registerDesigner = (t, e, r) => {
|
|
1955
|
-
t["color-picker"] =
|
|
1957
|
+
t["color-picker"] = xt, e["color-picker"] = Ve;
|
|
1956
1958
|
};
|
|
1957
|
-
const
|
|
1959
|
+
const Zt = Xe(pe);
|
|
1958
1960
|
export {
|
|
1959
1961
|
pe as FColorPicker,
|
|
1960
1962
|
ve as colorPickerProps,
|
|
1961
|
-
|
|
1963
|
+
Zt as default,
|
|
1962
1964
|
Ve as propsResolver
|
|
1963
1965
|
};
|