@farris/ui-vue 1.3.1 → 1.3.3
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 +103 -99
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +301 -351
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +444 -0
- package/components/binding-selector/index.umd.cjs +1 -0
- package/components/binding-selector/package.json +8 -0
- package/components/border-editor/index.esm.js +5 -3
- package/components/border-editor/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +143 -139
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +407 -396
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +266 -255
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +628 -641
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +379 -374
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +471 -471
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +155 -148
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +487 -478
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +330 -279
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1171 -1277
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +220 -204
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4743 -4641
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2916 -3019
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2375 -2590
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9518 -1198
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +2 -1
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +34 -38
- package/components/drawer/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +149 -138
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1602 -1740
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +159 -151
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +218 -218
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +311 -0
- package/components/event-parameter/index.umd.cjs +1 -0
- package/components/event-parameter/package.json +8 -0
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +533 -563
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +95 -91
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2356 -2455
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3048 -3308
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10537 -3249
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9781 -1327
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +353 -341
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +510 -827
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +278 -268
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +144 -136
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2139 -2237
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6414 -6367
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +5216 -5114
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +252 -252
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +70 -70
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +486 -984
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +446 -498
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +363 -388
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1050 -1308
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +134 -131
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1072 -1082
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +412 -910
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +214 -203
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1361 -1536
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +650 -677
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12344 -5048
- package/components/query-solution/index.umd.cjs +6 -1
- package/components/radio-button/index.esm.js +97 -97
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.css +1 -1
- package/components/radio-group/index.esm.js +1821 -565
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +251 -244
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +151 -140
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +707 -676
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +719 -740
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4977 -5249
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +145 -134
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +348 -337
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +141 -130
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +311 -301
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +231 -220
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +385 -432
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1932 -1914
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +351 -340
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +209 -199
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +388 -415
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +619 -666
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +493 -486
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3169 -3278
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2320 -2418
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +563 -554
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +287 -276
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +368 -324
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +498 -487
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +51302 -47651
- package/farris.all.umd.cjs +14 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/binding-selector/index.d.ts +55 -0
- package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
- package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
- package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
- package/types/combo-list/src/components/list-container.component.d.ts +6 -6
- package/types/combo-list/src/components/list-container.props.d.ts +1 -1
- package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +6 -6
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
- package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +2 -2
- package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
- package/types/date-picker/src/components/month/month.component.d.ts +3 -3
- package/types/date-picker/src/components/year/year.component.d.ts +3 -3
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -40
- package/types/designer-canvas/src/types.d.ts +8 -20
- package/types/dynamic-form/index.d.ts +1 -1
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +5 -0
- package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
- package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
- package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
- package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
- package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
- package/types/event-parameter/index.d.ts +31 -0
- package/types/event-parameter/src/composition/type.d.ts +77 -0
- package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
- package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
- package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
- package/types/field-selector/src/field-selector.component.d.ts +1 -2
- package/types/field-selector/src/field-selector.props.d.ts +0 -9
- package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
- package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
- package/types/list-view/src/list-view-table.component.d.ts +15 -0
- package/types/lookup/src/composition/use-user-data.d.ts +2 -2
- package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
- package/types/modal/src/composition/modal.service.d.ts +2 -1
- package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
- package/types/page-header/src/page-header.component.d.ts +1 -1
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
- package/types/property-panel/src/composition/type.d.ts +0 -13
- package/types/query-solution/src/composition/types.d.ts +35 -4
- package/types/query-solution/src/composition/use-header.d.ts +21 -0
- package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
- package/types/query-solution/src/composition/use-solution.d.ts +20 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +17 -16
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +3 -51
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
- package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
- package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/property-config/section.property-config.d.ts +17 -17
- package/types/section/src/schema/schema-resolver.d.ts +1 -2
- package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
- package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
- package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
- package/types/text/src/composition/types.d.ts +4 -4
- package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
- package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
- package/types/weather/src/composition/use-weather-color.d.ts +15 -0
- package/types/weather/src/composition/use-weather-data.d.ts +15 -0
- package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
- /package/types/dynamic-form/src/designer/{use-designer-rules.d.ts → response-form-use-designer-rules.d.ts} +0 -0
- /package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +0 -0
|
@@ -2,11 +2,16 @@ var nt = Object.defineProperty;
|
|
|
2
2
|
var rt = (r, e, t) => e in r ? nt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var s = (r, e, t) => rt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { defineComponent as T, ref as S, onMounted as C, watch as F, createVNode as k, withModifiers as K, createTextVNode as Be, computed as U, onBeforeMount as qe, withDirectives as X, vShow as Z, vModelText as Ye, inject as it } from "vue";
|
|
5
|
-
import { isPlainObject as
|
|
5
|
+
import { isPlainObject as Ie, cloneDeep as st } from "lodash-es";
|
|
6
|
+
import { withInstall as at } from "../common/index.esm.js";
|
|
6
7
|
const Xe = {}, Ge = {};
|
|
7
8
|
function Re(r) {
|
|
8
|
-
const { properties: e, title: t, ignore: n } = r, i = n && Array.isArray(n), l = Object.keys(e).reduce((u, c) => ((!i || !n.find((g) => g
|
|
9
|
-
|
|
9
|
+
const { properties: e, title: t, ignore: n } = r, i = n && Array.isArray(n), l = Object.keys(e).reduce((u, c) => ((!i || !n.find((g) => g === c)) && (u[c] = e[c].type === "object" && e[c].properties ? Re(e[c]) : st(e[c].default)), u), {});
|
|
10
|
+
if (t && (!i || !n.find((u) => u === "id"))) {
|
|
11
|
+
const u = t.toLowerCase().replace(/-/g, "_");
|
|
12
|
+
l.id = `${u}_${Math.random().toString().slice(2, 6)}`;
|
|
13
|
+
}
|
|
14
|
+
return l;
|
|
10
15
|
}
|
|
11
16
|
function We(r, e = {}, t) {
|
|
12
17
|
const n = Xe[r];
|
|
@@ -17,11 +22,11 @@ function We(r, e = {}, t) {
|
|
|
17
22
|
}
|
|
18
23
|
return null;
|
|
19
24
|
}
|
|
20
|
-
function
|
|
25
|
+
function ot(r, e) {
|
|
21
26
|
const t = Re(e);
|
|
22
|
-
return Object.keys(
|
|
27
|
+
return Object.keys(t).reduce((n, i) => (n[i] && Ie(n[i]) && Ie(r[i] || !r[i]) ? Object.assign(n[i], r[i] || {}) : n[i] = r[i], n), t), t;
|
|
23
28
|
}
|
|
24
|
-
function
|
|
29
|
+
function ut(r, e) {
|
|
25
30
|
return Object.keys(r).filter((n) => r[n] != null).reduce((n, i) => {
|
|
26
31
|
if (e.has(i)) {
|
|
27
32
|
const l = e.get(i);
|
|
@@ -36,27 +41,27 @@ function ot(r, e) {
|
|
|
36
41
|
return n;
|
|
37
42
|
}, {});
|
|
38
43
|
}
|
|
39
|
-
function
|
|
40
|
-
const n =
|
|
41
|
-
return
|
|
44
|
+
function lt(r, e, t = /* @__PURE__ */ new Map()) {
|
|
45
|
+
const n = ot(r, e);
|
|
46
|
+
return ut(n, t);
|
|
42
47
|
}
|
|
43
|
-
function
|
|
44
|
-
function e(h, p,
|
|
45
|
-
if (typeof
|
|
46
|
-
return
|
|
47
|
-
if (typeof
|
|
48
|
-
const b = Object.keys(
|
|
48
|
+
function ct(r = {}) {
|
|
49
|
+
function e(h, p, f, d) {
|
|
50
|
+
if (typeof f == "number")
|
|
51
|
+
return d[h].length === f;
|
|
52
|
+
if (typeof f == "object") {
|
|
53
|
+
const b = Object.keys(f)[0], y = f[b];
|
|
49
54
|
if (b === "not")
|
|
50
|
-
return Number(
|
|
55
|
+
return Number(d[h].length) !== Number(y);
|
|
51
56
|
if (b === "moreThan")
|
|
52
|
-
return Number(
|
|
57
|
+
return Number(d[h].length) >= Number(y);
|
|
53
58
|
if (b === "lessThan")
|
|
54
|
-
return Number(
|
|
59
|
+
return Number(d[h].length) <= Number(y);
|
|
55
60
|
}
|
|
56
61
|
return !1;
|
|
57
62
|
}
|
|
58
|
-
function t(h, p,
|
|
59
|
-
return
|
|
63
|
+
function t(h, p, f, d) {
|
|
64
|
+
return d[h] && d[h].propertyValue && String(d[h].propertyValue.value) === String(f);
|
|
60
65
|
}
|
|
61
66
|
const n = /* @__PURE__ */ new Map([
|
|
62
67
|
["length", e],
|
|
@@ -64,24 +69,24 @@ function lt(r = {}) {
|
|
|
64
69
|
]);
|
|
65
70
|
Object.keys(r).reduce((h, p) => (h.set(p, r[p]), h), n);
|
|
66
71
|
function i(h, p) {
|
|
67
|
-
const
|
|
68
|
-
return typeof p == "number" ? [{ target:
|
|
69
|
-
if (
|
|
70
|
-
return { target:
|
|
71
|
-
const b =
|
|
72
|
-
return { target:
|
|
72
|
+
const f = h;
|
|
73
|
+
return typeof p == "number" ? [{ target: f, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: f, operator: "getProperty", param: h, value: !!p }] : typeof p == "object" ? Object.keys(p).map((d) => {
|
|
74
|
+
if (d === "length")
|
|
75
|
+
return { target: f, operator: "length", param: null, value: p[d] };
|
|
76
|
+
const b = d, y = p[d];
|
|
77
|
+
return { target: f, operator: "getProperty", param: b, value: y };
|
|
73
78
|
}) : [];
|
|
74
79
|
}
|
|
75
80
|
function l(h) {
|
|
76
|
-
return Object.keys(h).reduce((
|
|
77
|
-
const b = i(
|
|
78
|
-
return
|
|
81
|
+
return Object.keys(h).reduce((f, d) => {
|
|
82
|
+
const b = i(d, h[d]);
|
|
83
|
+
return f.push(...b), f;
|
|
79
84
|
}, []);
|
|
80
85
|
}
|
|
81
86
|
function u(h, p) {
|
|
82
87
|
if (n.has(h.operator)) {
|
|
83
|
-
const
|
|
84
|
-
return
|
|
88
|
+
const f = n.get(h.operator);
|
|
89
|
+
return f && f(h.target, h.param, h.value, p) || !1;
|
|
85
90
|
}
|
|
86
91
|
return !1;
|
|
87
92
|
}
|
|
@@ -89,20 +94,20 @@ function lt(r = {}) {
|
|
|
89
94
|
return l(h).reduce((b, y) => b && u(y, p), !0);
|
|
90
95
|
}
|
|
91
96
|
function g(h, p) {
|
|
92
|
-
const
|
|
93
|
-
return
|
|
97
|
+
const f = Object.keys(h), d = f.includes("allOf"), b = f.includes("anyOf"), y = d || b, M = (y ? h[y ? d ? "allOf" : "anyOf" : "allOf"] : [h]).map((j) => c(j, p));
|
|
98
|
+
return d ? !M.includes(!1) : M.includes(!0);
|
|
94
99
|
}
|
|
95
100
|
return { parseValueSchema: g };
|
|
96
101
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
function
|
|
100
|
-
return Xe[e.title] = e, Ge[e.title] = n,
|
|
101
|
-
const c =
|
|
102
|
+
const ht = {}, pt = {};
|
|
103
|
+
ct();
|
|
104
|
+
function ft(r, e, t = /* @__PURE__ */ new Map(), n = (u, c, g, h) => c, i = {}, l = (u) => u) {
|
|
105
|
+
return Xe[e.title] = e, Ge[e.title] = n, ht[e.title] = i, pt[e.title] = l, (u = {}) => {
|
|
106
|
+
const c = lt(u, e, t), g = Object.keys(r).reduce((h, p) => (h[p] = r[p].default, h), {});
|
|
102
107
|
return Object.assign(g, c);
|
|
103
108
|
};
|
|
104
109
|
}
|
|
105
|
-
const dt = "https://json-schema.org/draft/2020-12/schema",
|
|
110
|
+
const dt = "https://json-schema.org/draft/2020-12/schema", vt = "https://farris-design.gitee.io/color-picker.schema.json", gt = "color-picker", yt = "A Farris Component", mt = "object", wt = {
|
|
106
111
|
id: {
|
|
107
112
|
description: "The unique identifier for color picker",
|
|
108
113
|
type: "string"
|
|
@@ -164,27 +169,27 @@ const dt = "https://json-schema.org/draft/2020-12/schema", ft = "https://farris-
|
|
|
164
169
|
type: "boolean",
|
|
165
170
|
default: !0
|
|
166
171
|
}
|
|
167
|
-
},
|
|
172
|
+
}, bt = [
|
|
168
173
|
"id",
|
|
169
174
|
"type"
|
|
170
|
-
],
|
|
175
|
+
], kt = {
|
|
171
176
|
$schema: dt,
|
|
172
|
-
$id:
|
|
173
|
-
title:
|
|
174
|
-
description:
|
|
175
|
-
type:
|
|
176
|
-
properties:
|
|
177
|
-
required:
|
|
177
|
+
$id: vt,
|
|
178
|
+
title: gt,
|
|
179
|
+
description: yt,
|
|
180
|
+
type: mt,
|
|
181
|
+
properties: wt,
|
|
182
|
+
required: bt
|
|
178
183
|
};
|
|
179
|
-
function
|
|
184
|
+
function St(r, e, t) {
|
|
180
185
|
return e;
|
|
181
186
|
}
|
|
182
|
-
function
|
|
187
|
+
function Pt(r, e) {
|
|
183
188
|
return { customClass: e.class, customStyle: e.style };
|
|
184
189
|
}
|
|
185
|
-
const
|
|
186
|
-
["appearance",
|
|
187
|
-
]),
|
|
190
|
+
const Et = /* @__PURE__ */ new Map([
|
|
191
|
+
["appearance", Pt]
|
|
192
|
+
]), Mt = "color-picker", Ht = "A Farris Component", Ot = "object", Bt = {
|
|
188
193
|
basic: {
|
|
189
194
|
description: "Basic Infomation",
|
|
190
195
|
title: "基本信息",
|
|
@@ -206,11 +211,11 @@ const Pt = /* @__PURE__ */ new Map([
|
|
|
206
211
|
}
|
|
207
212
|
}
|
|
208
213
|
}
|
|
209
|
-
},
|
|
210
|
-
title:
|
|
211
|
-
description:
|
|
212
|
-
type:
|
|
213
|
-
categories:
|
|
214
|
+
}, Rt = {
|
|
215
|
+
title: Mt,
|
|
216
|
+
description: Ht,
|
|
217
|
+
type: Ot,
|
|
218
|
+
categories: Bt
|
|
214
219
|
}, $e = {
|
|
215
220
|
/** 初始颜色 */
|
|
216
221
|
color: { type: String, default: "#e1e2e3" },
|
|
@@ -223,7 +228,7 @@ const Pt = /* @__PURE__ */ new Map([
|
|
|
223
228
|
/** 颜色值变化事件 */
|
|
224
229
|
onValueChanged: { type: Function, default: () => {
|
|
225
230
|
} }
|
|
226
|
-
}, ze =
|
|
231
|
+
}, ze = ft($e, kt, Et, St, Rt);
|
|
227
232
|
class le {
|
|
228
233
|
}
|
|
229
234
|
class me extends le {
|
|
@@ -310,7 +315,7 @@ const a = class a {
|
|
|
310
315
|
};
|
|
311
316
|
s(a, "transparent", new o(0, 0, 0, 0)), s(a, "aliceblue", new o(240, 248, 255, 1)), s(a, "antiquewhite", new o(250, 235, 215, 1)), s(a, "aqua", new o(0, 255, 255, 1)), s(a, "aquamarine", new o(127, 255, 212, 1)), s(a, "azure", new o(240, 255, 255, 1)), s(a, "beige", new o(245, 245, 220, 1)), s(a, "bisque", new o(255, 228, 196, 1)), s(a, "black", new o(0, 0, 0, 1)), s(a, "blanchedalmond", new o(255, 235, 205, 1)), s(a, "blue", new o(0, 0, 255, 1)), s(a, "blueviolet", new o(138, 43, 226, 1)), s(a, "brown", new o(165, 42, 42, 1)), s(a, "burlywood", new o(222, 184, 135, 1)), s(a, "cadetblue", new o(95, 158, 160, 1)), s(a, "chartreuse", new o(127, 255, 0, 1)), s(a, "chocolate", new o(210, 105, 30, 1)), s(a, "coral", new o(255, 127, 80, 1)), s(a, "cornflowerblue", new o(100, 149, 237, 1)), s(a, "cornsilk", new o(255, 248, 220, 1)), s(a, "crimson", new o(220, 20, 60, 1)), s(a, "cyan", new o(0, 255, 255, 1)), s(a, "darkblue", new o(0, 0, 139, 1)), s(a, "darkcyan", new o(0, 139, 139, 1)), s(a, "darkgoldenrod", new o(184, 134, 11, 1)), s(a, "darkgray", new o(169, 169, 169, 1)), s(a, "darkgreen", new o(0, 100, 0, 1)), s(a, "darkgrey", a.darkgray), s(a, "darkkhaki", new o(189, 183, 107, 1)), s(a, "darkmagenta", new o(139, 0, 139, 1)), s(a, "darkolivegreen", new o(85, 107, 47, 1)), s(a, "darkorange", new o(255, 140, 0, 1)), s(a, "darkorchid", new o(153, 50, 204, 1)), s(a, "darkred", new o(139, 0, 0, 1)), s(a, "darksalmon", new o(233, 150, 122, 1)), s(a, "darkseagreen", new o(143, 188, 143, 1)), s(a, "darkslateblue", new o(72, 61, 139, 1)), s(a, "darkslategray", new o(47, 79, 79, 1)), s(a, "darkslategrey", a.darkslategray), s(a, "darkturquoise", new o(0, 206, 209, 1)), s(a, "darkviolet", new o(148, 0, 211, 1)), s(a, "deeppink", new o(255, 20, 147, 1)), s(a, "deepskyblue", new o(0, 191, 255, 1)), s(a, "dimgray", new o(105, 105, 105, 1)), s(a, "dimgrey", a.dimgray), s(a, "dodgerblue", new o(30, 144, 255, 1)), s(a, "firebrick", new o(178, 34, 34, 1)), s(a, "floralwhite", new o(255, 250, 240, 1)), s(a, "forestgreen", new o(34, 139, 34, 1)), s(a, "fuchsia", new o(255, 0, 255, 1)), s(a, "gainsboro", new o(220, 220, 220, 1)), s(a, "ghostwhite", new o(248, 248, 255, 1)), s(a, "gold", new o(255, 215, 0, 1)), s(a, "goldenrod", new o(218, 165, 32, 1)), s(a, "gray", new o(128, 128, 128, 1)), s(a, "grey", a.gray), s(a, "green", new o(0, 128, 0, 1)), s(a, "greenyellow", new o(173, 255, 47, 1)), s(a, "honeydew", new o(240, 255, 240, 1)), s(a, "hotpink", new o(255, 105, 180, 1)), s(a, "indianred", new o(205, 92, 92, 1)), s(a, "indigo", new o(75, 0, 130, 1)), s(a, "ivory", new o(255, 255, 240, 1)), s(a, "khaki", new o(240, 230, 140, 1)), s(a, "lavender", new o(230, 230, 250, 1)), s(a, "lavenderblush", new o(255, 240, 245, 1)), s(a, "lawngreen", new o(124, 252, 0, 1)), s(a, "lemonchiffon", new o(255, 250, 205, 1)), s(a, "lightblue", new o(173, 216, 230, 1)), s(a, "lightcoral", new o(240, 128, 128, 1)), s(a, "lightcyan", new o(224, 255, 255, 1)), s(a, "lightgoldenrodyellow", new o(250, 250, 210, 1)), s(a, "lightgray", new o(211, 211, 211, 1)), s(a, "lightgreen", new o(144, 238, 144, 1)), s(a, "lightgrey", a.lightgray), s(a, "lightpink", new o(255, 182, 193, 1)), s(a, "lightsalmon", new o(255, 160, 122, 1)), s(a, "lightseagreen", new o(32, 178, 170, 1)), s(a, "lightskyblue", new o(135, 206, 250, 1)), s(a, "lightslategray", new o(119, 136, 153, 1)), s(a, "lightslategrey", a.lightslategray), s(a, "lightsteelblue", new o(176, 196, 222, 1)), s(a, "lightyellow", new o(255, 255, 224, 1)), s(a, "lime", new o(0, 255, 0, 1)), s(a, "limegreen", new o(50, 205, 50, 1)), s(a, "linen", new o(250, 240, 230, 1)), s(a, "magenta", new o(255, 0, 255, 1)), s(a, "maroon", new o(128, 0, 0, 1)), s(a, "mediumaquamarine", new o(102, 205, 170, 1)), s(a, "mediumblue", new o(0, 0, 205, 1)), s(a, "mediumorchid", new o(186, 85, 211, 1)), s(a, "mediumpurple", new o(147, 112, 219, 1)), s(a, "mediumseagreen", new o(60, 179, 113, 1)), s(a, "mediumslateblue", new o(123, 104, 238, 1)), s(a, "mediumspringgreen", new o(0, 250, 154, 1)), s(a, "mediumturquoise", new o(72, 209, 204, 1)), s(a, "mediumvioletred", new o(199, 21, 133, 1)), s(a, "midnightblue", new o(25, 25, 112, 1)), s(a, "mintcream", new o(245, 255, 250, 1)), s(a, "mistyrose", new o(255, 228, 225, 1)), s(a, "moccasin", new o(255, 228, 181, 1)), s(a, "navajowhite", new o(255, 222, 173, 1)), s(a, "navy", new o(0, 0, 128, 1)), s(a, "oldlace", new o(253, 245, 230, 1)), s(a, "olive", new o(128, 128, 0, 1)), s(a, "olivedrab", new o(107, 142, 35, 1)), s(a, "orange", new o(255, 165, 0, 1)), s(a, "orangered", new o(255, 69, 0, 1)), s(a, "orchid", new o(218, 112, 214, 1)), s(a, "palegoldenrod", new o(238, 232, 170, 1)), s(a, "palegreen", new o(152, 251, 152, 1)), s(a, "paleturquoise", new o(175, 238, 238, 1)), s(a, "palevioletred", new o(219, 112, 147, 1)), s(a, "papayawhip", new o(255, 239, 213, 1)), s(a, "peachpuff", new o(255, 218, 185, 1)), s(a, "peru", new o(205, 133, 63, 1)), s(a, "pink", new o(255, 192, 203, 1)), s(a, "plum", new o(221, 160, 221, 1)), s(a, "powderblue", new o(176, 224, 230, 1)), s(a, "purple", new o(128, 0, 128, 1)), s(a, "red", new o(255, 0, 0, 1)), s(a, "rosybrown", new o(188, 143, 143, 1)), s(a, "royalblue", new o(65, 105, 225, 1)), s(a, "saddlebrown", new o(139, 69, 19, 1)), s(a, "salmon", new o(250, 128, 114, 1)), s(a, "sandybrown", new o(244, 164, 96, 1)), s(a, "seagreen", new o(46, 139, 87, 1)), s(a, "seashell", new o(255, 245, 238, 1)), s(a, "sienna", new o(160, 82, 45, 1)), s(a, "silver", new o(192, 192, 192, 1)), s(a, "skyblue", new o(135, 206, 235, 1)), s(a, "slateblue", new o(106, 90, 205, 1)), s(a, "slategray", new o(112, 128, 144, 1)), s(a, "slategrey", a.slategray), s(a, "snow", new o(255, 250, 250, 1)), s(a, "springgreen", new o(0, 255, 127, 1)), s(a, "steelblue", new o(70, 130, 180, 1)), s(a, "tan", new o(210, 180, 140, 1)), s(a, "teal", new o(0, 128, 128, 1)), s(a, "thistle", new o(216, 191, 216, 1)), s(a, "tomato", new o(255, 99, 71, 1)), s(a, "turquoise", new o(64, 224, 208, 1)), s(a, "violet", new o(238, 130, 238, 1)), s(a, "wheat", new o(245, 222, 179, 1)), s(a, "white", new o(255, 255, 255, 1)), s(a, "whitesmoke", new o(245, 245, 245, 1)), s(a, "yellow", new o(255, 255, 0, 1)), s(a, "yellowgreen", new o(154, 205, 50, 1));
|
|
312
317
|
let ke = a;
|
|
313
|
-
class
|
|
318
|
+
class E {
|
|
314
319
|
constructor(e) {
|
|
315
320
|
/**
|
|
316
321
|
* base color used to calculate other
|
|
@@ -324,13 +329,13 @@ class P {
|
|
|
324
329
|
e && this.stringToColor(e);
|
|
325
330
|
}
|
|
326
331
|
static from(e) {
|
|
327
|
-
return typeof e == "string" ? new
|
|
332
|
+
return typeof e == "string" ? new E(e) : e instanceof E ? e.clone() : e instanceof o ? new E().setRgba(e.red, e.green, e.blue, e.alpha) : e instanceof re ? new E().setHsva(e.hue, e.saturation, e.value, e.alpha) : e instanceof ne ? new E().setHsla(e.hue, e.saturation, e.lightness, e.alpha) : new E(e);
|
|
328
333
|
}
|
|
329
334
|
/**
|
|
330
335
|
* make from existing color new color object
|
|
331
336
|
*/
|
|
332
337
|
clone() {
|
|
333
|
-
return
|
|
338
|
+
return E.from(this.getRgba());
|
|
334
339
|
}
|
|
335
340
|
/**
|
|
336
341
|
* define Color from hex, rgb, rgba, hsl, hsla or cmyk string
|
|
@@ -429,7 +434,7 @@ class P {
|
|
|
429
434
|
}
|
|
430
435
|
rgbaToHsva(e) {
|
|
431
436
|
const t = e.red / 255, n = e.green / 255, i = e.blue / 255, { alpha: l } = e, u = Math.max(t, n, i), c = Math.min(t, n, i), g = u - c;
|
|
432
|
-
let h = 0, p = u === 0 ? 0 : g / u,
|
|
437
|
+
let h = 0, p = u === 0 ? 0 : g / u, f = u;
|
|
433
438
|
if (u !== c) {
|
|
434
439
|
switch (u) {
|
|
435
440
|
case t:
|
|
@@ -444,30 +449,30 @@ class P {
|
|
|
444
449
|
}
|
|
445
450
|
h /= 6;
|
|
446
451
|
}
|
|
447
|
-
return h *= 360, p *= 100,
|
|
452
|
+
return h *= 360, p *= 100, f *= 100, new re(h, p, f, l);
|
|
448
453
|
}
|
|
449
454
|
hsvaToRgba(e) {
|
|
450
455
|
let t = 1, n = 0, i = 0;
|
|
451
|
-
const l = e.saturation / 100, u = e.value / 100, { alpha: c } = e, g = e.hue / 60, h = Math.floor(g), p = g - h,
|
|
456
|
+
const l = e.saturation / 100, u = e.value / 100, { alpha: c } = e, g = e.hue / 60, h = Math.floor(g), p = g - h, f = (1 - l) * u, d = (1 - l * p) * u, b = (1 - l * (1 - p)) * u;
|
|
452
457
|
switch (h) {
|
|
453
458
|
case 6:
|
|
454
459
|
case 0:
|
|
455
|
-
t = u, n = b, i =
|
|
460
|
+
t = u, n = b, i = f;
|
|
456
461
|
break;
|
|
457
462
|
case 1:
|
|
458
|
-
t =
|
|
463
|
+
t = d, n = u, i = f;
|
|
459
464
|
break;
|
|
460
465
|
case 2:
|
|
461
|
-
t =
|
|
466
|
+
t = f, n = u, i = b;
|
|
462
467
|
break;
|
|
463
468
|
case 3:
|
|
464
|
-
t =
|
|
469
|
+
t = f, n = d, i = u;
|
|
465
470
|
break;
|
|
466
471
|
case 4:
|
|
467
|
-
t = b, n =
|
|
472
|
+
t = b, n = f, i = u;
|
|
468
473
|
break;
|
|
469
474
|
case 5:
|
|
470
|
-
t = u, n =
|
|
475
|
+
t = u, n = f, i = d;
|
|
471
476
|
break;
|
|
472
477
|
}
|
|
473
478
|
return t *= 255, n *= 255, i *= 255, new o(t, n, i, c);
|
|
@@ -475,17 +480,17 @@ class P {
|
|
|
475
480
|
rgbaToHsla(e) {
|
|
476
481
|
const t = e.red / 255, n = e.green / 255, i = e.blue / 255, { alpha: l } = e, u = Math.max(t, n, i), c = Math.min(t, n, i);
|
|
477
482
|
let g = 0, h = 0, p = (u + c) / 2;
|
|
478
|
-
const
|
|
483
|
+
const f = u - c;
|
|
479
484
|
if (u !== c) {
|
|
480
|
-
switch (h = p > 0.5 ?
|
|
485
|
+
switch (h = p > 0.5 ? f / (2 - u - c) : f / (u + c), u) {
|
|
481
486
|
case t:
|
|
482
|
-
g = (n - i) /
|
|
487
|
+
g = (n - i) / f + (n < i ? 6 : 0);
|
|
483
488
|
break;
|
|
484
489
|
case n:
|
|
485
|
-
g = (i - t) /
|
|
490
|
+
g = (i - t) / f + 2;
|
|
486
491
|
break;
|
|
487
492
|
case i:
|
|
488
|
-
g = (t - n) /
|
|
493
|
+
g = (t - n) / f + 4;
|
|
489
494
|
break;
|
|
490
495
|
}
|
|
491
496
|
g /= 6;
|
|
@@ -717,14 +722,14 @@ var ce = function() {
|
|
|
717
722
|
} catch (v) {
|
|
718
723
|
l = v instanceof we ? v.errors : [v];
|
|
719
724
|
}
|
|
720
|
-
var
|
|
721
|
-
if (
|
|
725
|
+
var f = this._finalizers;
|
|
726
|
+
if (f) {
|
|
722
727
|
this._finalizers = null;
|
|
723
728
|
try {
|
|
724
|
-
for (var
|
|
729
|
+
for (var d = Pe(f), b = d.next(); !b.done; b = d.next()) {
|
|
725
730
|
var y = b.value;
|
|
726
731
|
try {
|
|
727
|
-
|
|
732
|
+
xe(y);
|
|
728
733
|
} catch (v) {
|
|
729
734
|
l = l ?? [], v instanceof we ? l = Me(Me([], Ee(l)), Ee(v.errors)) : l.push(v);
|
|
730
735
|
}
|
|
@@ -733,7 +738,7 @@ var ce = function() {
|
|
|
733
738
|
n = { error: v };
|
|
734
739
|
} finally {
|
|
735
740
|
try {
|
|
736
|
-
b && !b.done && (i =
|
|
741
|
+
b && !b.done && (i = d.return) && i.call(d);
|
|
737
742
|
} finally {
|
|
738
743
|
if (n) throw n.error;
|
|
739
744
|
}
|
|
@@ -746,7 +751,7 @@ var ce = function() {
|
|
|
746
751
|
var t;
|
|
747
752
|
if (e && e !== this)
|
|
748
753
|
if (this.closed)
|
|
749
|
-
|
|
754
|
+
xe(e);
|
|
750
755
|
else {
|
|
751
756
|
if (e instanceof r) {
|
|
752
757
|
if (e.closed || e._hasParent(this))
|
|
@@ -775,7 +780,7 @@ var ce = function() {
|
|
|
775
780
|
function Ze(r) {
|
|
776
781
|
return r instanceof ce || r && "closed" in r && Y(r.remove) && Y(r.add) && Y(r.unsubscribe);
|
|
777
782
|
}
|
|
778
|
-
function
|
|
783
|
+
function xe(r) {
|
|
779
784
|
Y(r) ? r() : r.unsubscribe();
|
|
780
785
|
}
|
|
781
786
|
var Ce = {
|
|
@@ -784,7 +789,7 @@ var Ce = {
|
|
|
784
789
|
Promise: void 0,
|
|
785
790
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
786
791
|
useDeprecatedNextContext: !1
|
|
787
|
-
},
|
|
792
|
+
}, $t = {
|
|
788
793
|
setTimeout: function(r, e) {
|
|
789
794
|
for (var t = [], n = 2; n < arguments.length; n++)
|
|
790
795
|
t[n - 2] = arguments[n];
|
|
@@ -795,8 +800,8 @@ var Ce = {
|
|
|
795
800
|
},
|
|
796
801
|
delegate: void 0
|
|
797
802
|
};
|
|
798
|
-
function
|
|
799
|
-
|
|
803
|
+
function Vt(r) {
|
|
804
|
+
$t.setTimeout(function() {
|
|
800
805
|
throw r;
|
|
801
806
|
});
|
|
802
807
|
}
|
|
@@ -809,7 +814,7 @@ var Ve = function(r) {
|
|
|
809
814
|
_(e, r);
|
|
810
815
|
function e(t) {
|
|
811
816
|
var n = r.call(this) || this;
|
|
812
|
-
return n.isStopped = !1, t ? (n.destination = t, Ze(t) && t.add(n)) : n.destination =
|
|
817
|
+
return n.isStopped = !1, t ? (n.destination = t, Ze(t) && t.add(n)) : n.destination = xt, n;
|
|
813
818
|
}
|
|
814
819
|
return e.create = function(t, n, i) {
|
|
815
820
|
return new Oe(t, n, i);
|
|
@@ -836,11 +841,11 @@ var Ve = function(r) {
|
|
|
836
841
|
this.unsubscribe();
|
|
837
842
|
}
|
|
838
843
|
}, e;
|
|
839
|
-
}(ce),
|
|
844
|
+
}(ce), jt = Function.prototype.bind;
|
|
840
845
|
function be(r, e) {
|
|
841
|
-
return
|
|
846
|
+
return jt.call(r, e);
|
|
842
847
|
}
|
|
843
|
-
var
|
|
848
|
+
var At = function() {
|
|
844
849
|
function r(e) {
|
|
845
850
|
this.partialObserver = e;
|
|
846
851
|
}
|
|
@@ -891,28 +896,28 @@ var It = function() {
|
|
|
891
896
|
complete: t.complete && be(t.complete, c)
|
|
892
897
|
}) : u = t;
|
|
893
898
|
}
|
|
894
|
-
return l.destination = new
|
|
899
|
+
return l.destination = new At(u), l;
|
|
895
900
|
}
|
|
896
901
|
return e;
|
|
897
902
|
}(Ve);
|
|
898
903
|
function ae(r) {
|
|
899
|
-
|
|
904
|
+
Vt(r);
|
|
900
905
|
}
|
|
901
|
-
function
|
|
906
|
+
function It(r) {
|
|
902
907
|
throw r;
|
|
903
908
|
}
|
|
904
|
-
var
|
|
909
|
+
var xt = {
|
|
905
910
|
closed: !0,
|
|
906
911
|
next: Ne,
|
|
907
|
-
error:
|
|
912
|
+
error: It,
|
|
908
913
|
complete: Ne
|
|
909
|
-
},
|
|
914
|
+
}, Nt = function() {
|
|
910
915
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
911
916
|
}();
|
|
912
917
|
function Ke(r) {
|
|
913
918
|
return r;
|
|
914
919
|
}
|
|
915
|
-
function
|
|
920
|
+
function Ut(r) {
|
|
916
921
|
return r.length === 0 ? Ke : r.length === 1 ? r[0] : function(t) {
|
|
917
922
|
return r.reduce(function(n, i) {
|
|
918
923
|
return i(n);
|
|
@@ -940,7 +945,7 @@ var Ue = function() {
|
|
|
940
945
|
}
|
|
941
946
|
}, r.prototype.forEach = function(e, t) {
|
|
942
947
|
var n = this;
|
|
943
|
-
return t =
|
|
948
|
+
return t = Le(t), new t(function(i, l) {
|
|
944
949
|
var u = new Oe({
|
|
945
950
|
next: function(c) {
|
|
946
951
|
try {
|
|
@@ -957,15 +962,15 @@ var Ue = function() {
|
|
|
957
962
|
}, r.prototype._subscribe = function(e) {
|
|
958
963
|
var t;
|
|
959
964
|
return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
|
|
960
|
-
}, r.prototype[
|
|
965
|
+
}, r.prototype[Nt] = function() {
|
|
961
966
|
return this;
|
|
962
967
|
}, r.prototype.pipe = function() {
|
|
963
968
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
964
969
|
e[t] = arguments[t];
|
|
965
|
-
return
|
|
970
|
+
return Ut(e)(this);
|
|
966
971
|
}, r.prototype.toPromise = function(e) {
|
|
967
972
|
var t = this;
|
|
968
|
-
return e =
|
|
973
|
+
return e = Le(e), new e(function(n, i) {
|
|
969
974
|
var l;
|
|
970
975
|
t.subscribe(function(u) {
|
|
971
976
|
return l = u;
|
|
@@ -979,22 +984,22 @@ var Ue = function() {
|
|
|
979
984
|
return new r(e);
|
|
980
985
|
}, r;
|
|
981
986
|
}();
|
|
982
|
-
function
|
|
987
|
+
function Le(r) {
|
|
983
988
|
var e;
|
|
984
989
|
return (e = r ?? Ce.Promise) !== null && e !== void 0 ? e : Promise;
|
|
985
990
|
}
|
|
986
|
-
function
|
|
991
|
+
function Lt(r) {
|
|
987
992
|
return r && Y(r.next) && Y(r.error) && Y(r.complete);
|
|
988
993
|
}
|
|
989
994
|
function Dt(r) {
|
|
990
|
-
return r && r instanceof Ve ||
|
|
995
|
+
return r && r instanceof Ve || Lt(r) && Ze(r);
|
|
991
996
|
}
|
|
992
|
-
function
|
|
997
|
+
function Ft(r) {
|
|
993
998
|
return Y(r == null ? void 0 : r.lift);
|
|
994
999
|
}
|
|
995
|
-
function
|
|
1000
|
+
function qt(r) {
|
|
996
1001
|
return function(e) {
|
|
997
|
-
if (
|
|
1002
|
+
if (Ft(e))
|
|
998
1003
|
return e.lift(function(t) {
|
|
999
1004
|
try {
|
|
1000
1005
|
return r(t, this);
|
|
@@ -1005,10 +1010,10 @@ function Ft(r) {
|
|
|
1005
1010
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
1006
1011
|
};
|
|
1007
1012
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return new
|
|
1013
|
+
function Yt(r, e, t, n, i) {
|
|
1014
|
+
return new Xt(r, e, t, n, i);
|
|
1010
1015
|
}
|
|
1011
|
-
var
|
|
1016
|
+
var Xt = function(r) {
|
|
1012
1017
|
_(e, r);
|
|
1013
1018
|
function e(t, n, i, l, u, c) {
|
|
1014
1019
|
var g = r.call(this, t) || this;
|
|
@@ -1043,22 +1048,22 @@ var Yt = function(r) {
|
|
|
1043
1048
|
r.prototype.unsubscribe.call(this), !n && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
|
|
1044
1049
|
}
|
|
1045
1050
|
}, e;
|
|
1046
|
-
}(Ve),
|
|
1051
|
+
}(Ve), Gt = Je(function(r) {
|
|
1047
1052
|
return function() {
|
|
1048
1053
|
r(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
1049
1054
|
};
|
|
1050
|
-
}),
|
|
1055
|
+
}), je = function(r) {
|
|
1051
1056
|
_(e, r);
|
|
1052
1057
|
function e() {
|
|
1053
1058
|
var t = r.call(this) || this;
|
|
1054
1059
|
return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
|
|
1055
1060
|
}
|
|
1056
1061
|
return e.prototype.lift = function(t) {
|
|
1057
|
-
var n = new
|
|
1062
|
+
var n = new De(this, this);
|
|
1058
1063
|
return n.operator = t, n;
|
|
1059
1064
|
}, e.prototype._throwIfClosed = function() {
|
|
1060
1065
|
if (this.closed)
|
|
1061
|
-
throw new
|
|
1066
|
+
throw new Gt();
|
|
1062
1067
|
}, e.prototype.next = function(t) {
|
|
1063
1068
|
var n = this;
|
|
1064
1069
|
oe(function() {
|
|
@@ -1124,9 +1129,9 @@ var Yt = function(r) {
|
|
|
1124
1129
|
var t = new Ue();
|
|
1125
1130
|
return t.source = this, t;
|
|
1126
1131
|
}, e.create = function(t, n) {
|
|
1127
|
-
return new
|
|
1132
|
+
return new De(t, n);
|
|
1128
1133
|
}, e;
|
|
1129
|
-
}(Ue),
|
|
1134
|
+
}(Ue), De = function(r) {
|
|
1130
1135
|
_(e, r);
|
|
1131
1136
|
function e(t, n) {
|
|
1132
1137
|
var i = r.call(this) || this;
|
|
@@ -1145,7 +1150,7 @@ var Yt = function(r) {
|
|
|
1145
1150
|
var n, i;
|
|
1146
1151
|
return (i = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(t)) !== null && i !== void 0 ? i : Qe;
|
|
1147
1152
|
}, e;
|
|
1148
|
-
}(
|
|
1153
|
+
}(je), Fe = function(r) {
|
|
1149
1154
|
_(e, r);
|
|
1150
1155
|
function e(t) {
|
|
1151
1156
|
var n = r.call(this) || this;
|
|
@@ -1168,21 +1173,21 @@ var Yt = function(r) {
|
|
|
1168
1173
|
}, e.prototype.next = function(t) {
|
|
1169
1174
|
r.prototype.next.call(this, this._value = t);
|
|
1170
1175
|
}, e;
|
|
1171
|
-
}(
|
|
1172
|
-
function
|
|
1173
|
-
return e === void 0 && (e = Ke), r = r ??
|
|
1176
|
+
}(je);
|
|
1177
|
+
function Wt(r, e) {
|
|
1178
|
+
return e === void 0 && (e = Ke), r = r ?? zt, qt(function(t, n) {
|
|
1174
1179
|
var i, l = !0;
|
|
1175
|
-
t.subscribe(
|
|
1180
|
+
t.subscribe(Yt(n, function(u) {
|
|
1176
1181
|
var c = e(u);
|
|
1177
1182
|
(l || !r(i, c)) && (l = !1, i = c, n.next(u));
|
|
1178
1183
|
}));
|
|
1179
1184
|
});
|
|
1180
1185
|
}
|
|
1181
|
-
function
|
|
1186
|
+
function zt(r, e) {
|
|
1182
1187
|
return r === e;
|
|
1183
1188
|
}
|
|
1184
1189
|
var R = /* @__PURE__ */ ((r) => (r.hex = "hex", r.hexa = "hexa", r.rgba = "rgba", r.rgb = "rgb", r.hsla = "hsla", r.hsl = "hsl", r.cmyk = "cmyk", r))(R || {});
|
|
1185
|
-
class
|
|
1190
|
+
class Ae {
|
|
1186
1191
|
constructor(e) {
|
|
1187
1192
|
/** 所选颜色值 */
|
|
1188
1193
|
s(this, "modelValue", null);
|
|
@@ -1190,24 +1195,24 @@ class xe {
|
|
|
1190
1195
|
s(this, "hueValue", null);
|
|
1191
1196
|
/** 初始颜色值 */
|
|
1192
1197
|
s(this, "initValue", null);
|
|
1193
|
-
s(this, "valueChanged", new
|
|
1198
|
+
s(this, "valueChanged", new je());
|
|
1194
1199
|
s(this, "presetsVisibilityChanges", new Fe(!0));
|
|
1195
1200
|
s(this, "initType", null);
|
|
1196
1201
|
s(this, "alphaChannelVisibilityChanges", new Fe(!0));
|
|
1197
|
-
s(this, "valueChanges", this.valueChanged.asObservable().pipe(
|
|
1202
|
+
s(this, "valueChanges", this.valueChanged.asObservable().pipe(Wt(
|
|
1198
1203
|
(e, t) => e.toRgbaString() === t.toRgbaString()
|
|
1199
1204
|
)));
|
|
1200
1205
|
s(this, "colorPresets", []);
|
|
1201
|
-
const t = e[0], n =
|
|
1206
|
+
const t = e[0], n = E.from(t);
|
|
1202
1207
|
this.setValue(n), this.setHueColor(n);
|
|
1203
1208
|
}
|
|
1204
1209
|
/** 设置值 */
|
|
1205
1210
|
setValueFrom(e, t, n) {
|
|
1206
|
-
const i =
|
|
1207
|
-
return this.initValue || (this.initValue =
|
|
1211
|
+
const i = E.from(e);
|
|
1212
|
+
return this.initValue || (this.initValue = E.from(e)), typeof e == "string" && this.finOutInputType(e), this.setHueColor(i), this.setValue(i), this;
|
|
1208
1213
|
}
|
|
1209
1214
|
setHueColor(e) {
|
|
1210
|
-
(this.hueValue && e.getHsva().hue > 0 || !this.hueValue) && (this.hueValue = new
|
|
1215
|
+
(this.hueValue && e.getHsva().hue > 0 || !this.hueValue) && (this.hueValue = new E().setHsva(e.getHsva().hue));
|
|
1211
1216
|
}
|
|
1212
1217
|
get hue() {
|
|
1213
1218
|
return this.hueValue;
|
|
@@ -1226,7 +1231,7 @@ class xe {
|
|
|
1226
1231
|
}
|
|
1227
1232
|
reset() {
|
|
1228
1233
|
let e;
|
|
1229
|
-
return this.initValue ? (e = this.initValue.clone(), this.setHueColor(e)) : (e =
|
|
1234
|
+
return this.initValue ? (e = this.initValue.clone(), this.setHueColor(e)) : (e = E.from(new o(255, 0, 0, 1)), this.hueValue = new E().setHsva(e.getHsva().hue)), this.setValue(e), this;
|
|
1230
1235
|
}
|
|
1231
1236
|
showAlphaChannel() {
|
|
1232
1237
|
return this.alphaChannelVisibilityChanges.next(!0), this;
|
|
@@ -1260,7 +1265,7 @@ class xe {
|
|
|
1260
1265
|
setPresets(e) {
|
|
1261
1266
|
const t = [];
|
|
1262
1267
|
return e.map((n) => {
|
|
1263
|
-
Array.isArray(n) ? t.push(this.setPresets(n)) : t.push(new
|
|
1268
|
+
Array.isArray(n) ? t.push(this.setPresets(n)) : t.push(new E(n));
|
|
1264
1269
|
}), t;
|
|
1265
1270
|
}
|
|
1266
1271
|
get presets() {
|
|
@@ -1271,8 +1276,8 @@ class xe {
|
|
|
1271
1276
|
}
|
|
1272
1277
|
}
|
|
1273
1278
|
/** 确定输入颜色类型 */
|
|
1274
|
-
s(
|
|
1275
|
-
function
|
|
1279
|
+
s(Ae, "finOutInputType");
|
|
1280
|
+
function x(r, e) {
|
|
1276
1281
|
switch (e) {
|
|
1277
1282
|
case R.hex:
|
|
1278
1283
|
return r.toHexString();
|
|
@@ -1290,80 +1295,80 @@ function A(r, e) {
|
|
|
1290
1295
|
return r.toRgbaString();
|
|
1291
1296
|
}
|
|
1292
1297
|
}
|
|
1293
|
-
const
|
|
1298
|
+
const Jt = {
|
|
1294
1299
|
color: { type: Object, default: "" },
|
|
1295
1300
|
hue: { type: Object, default: "" },
|
|
1296
1301
|
randomId: { type: String, default: "" },
|
|
1297
1302
|
allowColorNull: { type: Boolean, default: !1 }
|
|
1298
1303
|
}, Te = /* @__PURE__ */ T({
|
|
1299
1304
|
name: "SvPanel",
|
|
1300
|
-
props:
|
|
1305
|
+
props: Jt,
|
|
1301
1306
|
emits: ["update:color"],
|
|
1302
1307
|
setup(r, e) {
|
|
1303
1308
|
const t = S(null), n = S(null), i = S(r.randomId), l = S(r.allowColorNull);
|
|
1304
1309
|
function u() {
|
|
1305
1310
|
return r.hue ? r.hue.toRgbaString() : "#3f51b5";
|
|
1306
1311
|
}
|
|
1307
|
-
function c(
|
|
1312
|
+
function c(f, d) {
|
|
1308
1313
|
var b, y;
|
|
1309
|
-
|
|
1314
|
+
f = Math.max(0, Math.min(f, 100)), d = Math.max(0, Math.min(d, 100)), t.value && ((b = t.value.style) == null || b.setProperty("top", `${100 - d}%`), (y = t.value.style) == null || y.setProperty("left", `${f}%`));
|
|
1310
1315
|
}
|
|
1311
1316
|
function g() {
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1317
|
+
const f = document.getElementById(`farris-color-picker-plus-sure-${i.value}`);
|
|
1318
|
+
f.className = "btn btn-secondary";
|
|
1319
|
+
const d = document.getElementById(`farris-color-picker-plus-input-${i.value}`);
|
|
1320
|
+
d.style.borderColor = "#dcdfe6";
|
|
1316
1321
|
}
|
|
1317
1322
|
function h({
|
|
1318
|
-
x:
|
|
1319
|
-
y:
|
|
1323
|
+
x: f,
|
|
1324
|
+
y: d,
|
|
1320
1325
|
height: b,
|
|
1321
1326
|
width: y
|
|
1322
1327
|
}) {
|
|
1323
|
-
const v =
|
|
1328
|
+
const v = f * 100 / y, $ = -(d * 100 / b) + 100;
|
|
1324
1329
|
c(v, $);
|
|
1325
|
-
const
|
|
1330
|
+
const M = r.color == null ? "transparent" : r.color, H = E.from(M);
|
|
1326
1331
|
if (g(), H != null) {
|
|
1327
|
-
const
|
|
1328
|
-
e.emit("update:color",
|
|
1332
|
+
const j = r.hue.getHsva(), N = H.getHsva(), P = new E().setHsva(j.hue, v, $, N.alpha);
|
|
1333
|
+
e.emit("update:color", P);
|
|
1329
1334
|
}
|
|
1330
1335
|
!H && l.value && e.emit("update:color", null);
|
|
1331
1336
|
}
|
|
1332
|
-
function p(
|
|
1337
|
+
function p(f) {
|
|
1333
1338
|
if (n.value) {
|
|
1334
1339
|
const {
|
|
1335
|
-
width:
|
|
1340
|
+
width: d,
|
|
1336
1341
|
height: b,
|
|
1337
1342
|
top: y,
|
|
1338
1343
|
left: v
|
|
1339
1344
|
} = n.value.getBoundingClientRect(), {
|
|
1340
1345
|
pageX: $,
|
|
1341
|
-
pageY:
|
|
1342
|
-
} = "touches" in
|
|
1346
|
+
pageY: M
|
|
1347
|
+
} = "touches" in f ? f.touches[0] : f, H = Math.max(0, Math.min($ - (v + window.pageXOffset), d)), j = Math.max(0, Math.min(M - (y + window.pageYOffset), b));
|
|
1343
1348
|
h({
|
|
1344
1349
|
x: H,
|
|
1345
|
-
y:
|
|
1350
|
+
y: j,
|
|
1346
1351
|
height: b,
|
|
1347
|
-
width:
|
|
1352
|
+
width: d
|
|
1348
1353
|
});
|
|
1349
1354
|
}
|
|
1350
1355
|
}
|
|
1351
1356
|
return C(() => {
|
|
1352
|
-
const
|
|
1353
|
-
c(d.saturation, d.value);
|
|
1354
|
-
}), F(() => r.color, (d) => {
|
|
1355
|
-
d.getHsva();
|
|
1356
|
-
}), F(() => r.color, (d) => {
|
|
1357
|
-
const f = d.getHsva();
|
|
1357
|
+
const f = r.color.getHsva();
|
|
1358
1358
|
c(f.saturation, f.value);
|
|
1359
|
+
}), F(() => r.color, (f) => {
|
|
1360
|
+
f.getHsva();
|
|
1361
|
+
}), F(() => r.color, (f) => {
|
|
1362
|
+
const d = f.getHsva();
|
|
1363
|
+
c(d.saturation, d.value);
|
|
1359
1364
|
}), () => k("div", {
|
|
1360
1365
|
class: "f-sv-panel-component",
|
|
1361
1366
|
ref: n,
|
|
1362
1367
|
style: {
|
|
1363
1368
|
backgroundColor: u()
|
|
1364
1369
|
},
|
|
1365
|
-
onMousedown: K((
|
|
1366
|
-
onTouchstart: K((
|
|
1370
|
+
onMousedown: K((f) => p(f), ["prevent"]),
|
|
1371
|
+
onTouchstart: K((f) => p(f), ["prevent"])
|
|
1367
1372
|
}, [k("div", {
|
|
1368
1373
|
class: "color-svpanel__white"
|
|
1369
1374
|
}, null), k("div", {
|
|
@@ -1373,14 +1378,14 @@ const zt = {
|
|
|
1373
1378
|
ref: t
|
|
1374
1379
|
}, [k("div", null, null)])]);
|
|
1375
1380
|
}
|
|
1376
|
-
}),
|
|
1381
|
+
}), Qt = {
|
|
1377
1382
|
color: { type: Object, default: "" },
|
|
1378
1383
|
hue: { type: Object, default: "" },
|
|
1379
1384
|
allowColorNull: { type: Boolean, default: !1 },
|
|
1380
1385
|
onChange: { type: Function }
|
|
1381
1386
|
}, _e = /* @__PURE__ */ T({
|
|
1382
1387
|
name: "Hue",
|
|
1383
|
-
props:
|
|
1388
|
+
props: Qt,
|
|
1384
1389
|
emits: ["update:color", "update:hue"],
|
|
1385
1390
|
setup(r, e) {
|
|
1386
1391
|
const t = S(r.hue), n = S(r.allowColorNull), i = [];
|
|
@@ -1393,15 +1398,15 @@ const zt = {
|
|
|
1393
1398
|
const {
|
|
1394
1399
|
width: v,
|
|
1395
1400
|
height: $,
|
|
1396
|
-
top:
|
|
1401
|
+
top: M,
|
|
1397
1402
|
left: H
|
|
1398
1403
|
} = u.value.getBoundingClientRect(), {
|
|
1399
|
-
pageX:
|
|
1400
|
-
pageY:
|
|
1401
|
-
} = "touches" in y ? y.touches[0] : y,
|
|
1404
|
+
pageX: j,
|
|
1405
|
+
pageY: N
|
|
1406
|
+
} = "touches" in y ? y.touches[0] : y, P = Math.max(0, Math.min(j - (H + window.pageXOffset), v)), V = Math.max(0, Math.min(N - (M + window.pageYOffset), $));
|
|
1402
1407
|
b({
|
|
1403
|
-
x:
|
|
1404
|
-
y:
|
|
1408
|
+
x: P,
|
|
1409
|
+
y: V,
|
|
1405
1410
|
height: $,
|
|
1406
1411
|
width: v
|
|
1407
1412
|
});
|
|
@@ -1421,31 +1426,31 @@ const zt = {
|
|
|
1421
1426
|
$.addEventListener("mousedown", p), $.addEventListener("touchstart", p);
|
|
1422
1427
|
});
|
|
1423
1428
|
const v = r.color.getHsva();
|
|
1424
|
-
|
|
1429
|
+
d(v.hue);
|
|
1425
1430
|
});
|
|
1426
|
-
const
|
|
1427
|
-
function
|
|
1428
|
-
var
|
|
1431
|
+
const f = S(null);
|
|
1432
|
+
function d(y) {
|
|
1433
|
+
var M;
|
|
1429
1434
|
const v = Math.max(0, Math.min(y / 360 * 100, 100));
|
|
1430
|
-
|
|
1435
|
+
f.value && ((M = f.value.style) == null || M.setProperty("top", `${v}%`));
|
|
1431
1436
|
}
|
|
1432
1437
|
function b({
|
|
1433
1438
|
x: y,
|
|
1434
1439
|
y: v,
|
|
1435
1440
|
height: $,
|
|
1436
|
-
width:
|
|
1441
|
+
width: M
|
|
1437
1442
|
}) {
|
|
1438
1443
|
const H = v / $ * 360;
|
|
1439
|
-
|
|
1440
|
-
const
|
|
1441
|
-
(r.color != null || r.color == null && n.value) && (e.emit("update:hue",
|
|
1444
|
+
d(H);
|
|
1445
|
+
const j = r.color.getHsva(), N = new E().setHsva(H, j.saturation, j.value, j.alpha), P = new E().setHsva(H, 100, 100, j.alpha);
|
|
1446
|
+
(r.color != null || r.color == null && n.value) && (e.emit("update:hue", P), e.emit("update:color", N));
|
|
1442
1447
|
}
|
|
1443
1448
|
return F(t, (y) => {
|
|
1444
1449
|
const v = y.getHsva();
|
|
1445
|
-
|
|
1450
|
+
d(v.hue);
|
|
1446
1451
|
}), F(() => r.color, (y) => {
|
|
1447
1452
|
const v = y.getHsva();
|
|
1448
|
-
|
|
1453
|
+
d(v.hue);
|
|
1449
1454
|
}), () => k("div", {
|
|
1450
1455
|
class: "f-hue-component",
|
|
1451
1456
|
ref: u,
|
|
@@ -1455,63 +1460,63 @@ const zt = {
|
|
|
1455
1460
|
class: "color-hue-slider__bar"
|
|
1456
1461
|
}, null), k("div", {
|
|
1457
1462
|
class: "color-hue-slider__thumb",
|
|
1458
|
-
ref:
|
|
1463
|
+
ref: f
|
|
1459
1464
|
}, null)]);
|
|
1460
1465
|
}
|
|
1461
|
-
}),
|
|
1466
|
+
}), Zt = {
|
|
1462
1467
|
color: { type: Object, default: "" },
|
|
1463
1468
|
randomId: { type: String, default: "" },
|
|
1464
1469
|
allowColorNull: { type: Boolean, default: !1 }
|
|
1465
1470
|
}, et = /* @__PURE__ */ T({
|
|
1466
1471
|
name: "Alpha",
|
|
1467
|
-
props:
|
|
1472
|
+
props: Zt,
|
|
1468
1473
|
emits: ["update:color"],
|
|
1469
1474
|
setup(r, e) {
|
|
1470
1475
|
const t = S(null), n = S(null), i = S(r.randomId), l = S(r.allowColorNull), u = (p) => {
|
|
1471
1476
|
var b;
|
|
1472
|
-
const
|
|
1473
|
-
n.value && ((b = n.value.style) == null || b.setProperty("left", `${
|
|
1477
|
+
const f = Math.max(0, Math.min(p * 100, 100));
|
|
1478
|
+
n.value && ((b = n.value.style) == null || b.setProperty("left", `${f}%`));
|
|
1474
1479
|
};
|
|
1475
1480
|
function c(p) {
|
|
1476
1481
|
if (t.value) {
|
|
1477
1482
|
const {
|
|
1478
|
-
width:
|
|
1479
|
-
height:
|
|
1483
|
+
width: f,
|
|
1484
|
+
height: d,
|
|
1480
1485
|
top: b,
|
|
1481
1486
|
left: y
|
|
1482
1487
|
} = t.value.getBoundingClientRect(), {
|
|
1483
1488
|
pageX: v,
|
|
1484
1489
|
pageY: $
|
|
1485
|
-
} = "touches" in p ? p.touches[0] : p,
|
|
1490
|
+
} = "touches" in p ? p.touches[0] : p, M = Math.max(0, Math.min(v - (y + window.pageXOffset), f)), H = Math.max(0, Math.min($ - (b + window.pageYOffset), d));
|
|
1486
1491
|
h({
|
|
1487
|
-
x:
|
|
1492
|
+
x: M,
|
|
1488
1493
|
y: H,
|
|
1489
|
-
height:
|
|
1490
|
-
width:
|
|
1494
|
+
height: d,
|
|
1495
|
+
width: f
|
|
1491
1496
|
});
|
|
1492
1497
|
}
|
|
1493
1498
|
}
|
|
1494
1499
|
function g() {
|
|
1495
1500
|
const p = document.getElementById(`farris-color-picker-plus-sure-${i.value}`);
|
|
1496
1501
|
p.className = "btn btn-secondary";
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1502
|
+
const f = document.getElementById(`farris-color-picker-plus-input-${i.value}`);
|
|
1503
|
+
f.style.borderColor = "#dcdfe6";
|
|
1499
1504
|
}
|
|
1500
1505
|
const h = ({
|
|
1501
1506
|
x: p,
|
|
1502
|
-
width:
|
|
1507
|
+
width: f
|
|
1503
1508
|
}) => {
|
|
1504
|
-
const
|
|
1505
|
-
u(
|
|
1506
|
-
const b = r.color.getHsva(), y = new
|
|
1509
|
+
const d = p / f;
|
|
1510
|
+
u(d), g();
|
|
1511
|
+
const b = r.color.getHsva(), y = new E().setHsva(b.hue, b.saturation, b.value, d);
|
|
1507
1512
|
r.color != null ? e.emit("update:color", y) : r.color == null && l.value && e.emit("update:color", null);
|
|
1508
1513
|
};
|
|
1509
1514
|
return C(() => {
|
|
1510
1515
|
const p = r.color.getHsva();
|
|
1511
1516
|
u(p.alpha);
|
|
1512
1517
|
}), F(() => r.color, (p) => {
|
|
1513
|
-
const
|
|
1514
|
-
u(
|
|
1518
|
+
const f = p.getHsva();
|
|
1519
|
+
u(f.alpha);
|
|
1515
1520
|
}), () => k("div", {
|
|
1516
1521
|
class: "f-alpha-component",
|
|
1517
1522
|
ref: t,
|
|
@@ -1524,17 +1529,17 @@ const zt = {
|
|
|
1524
1529
|
ref: n
|
|
1525
1530
|
}, null)]);
|
|
1526
1531
|
}
|
|
1527
|
-
}),
|
|
1532
|
+
}), Ct = {
|
|
1528
1533
|
color: { type: Object, default: "" },
|
|
1529
1534
|
hue: { type: Object, default: "" },
|
|
1530
1535
|
colorPresets: { type: Object, default: "" },
|
|
1531
1536
|
randomId: { type: String, default: "" }
|
|
1532
1537
|
}, tt = /* @__PURE__ */ T({
|
|
1533
1538
|
name: "Preset",
|
|
1534
|
-
props:
|
|
1539
|
+
props: Ct,
|
|
1535
1540
|
emits: ["update:hue", "update:color"],
|
|
1536
1541
|
setup(r, e) {
|
|
1537
|
-
const t = S(new
|
|
1542
|
+
const t = S(new E()), n = S(r.colorPresets), i = S(r.randomId);
|
|
1538
1543
|
function l() {
|
|
1539
1544
|
const h = document.getElementById(`farris-color-picker-plus-sure-${i.value}`);
|
|
1540
1545
|
h.className = "btn btn-secondary";
|
|
@@ -1543,14 +1548,14 @@ const zt = {
|
|
|
1543
1548
|
}
|
|
1544
1549
|
function u(h) {
|
|
1545
1550
|
l();
|
|
1546
|
-
const p = h.getRgba(),
|
|
1547
|
-
t.value = h, e.emit("update:hue", b), e.emit("update:color",
|
|
1551
|
+
const p = h.getRgba(), f = h.getHsva(), d = new E().setRgba(p.red, p.green, p.blue, p.alpha), b = new E().setHsva(f.hue);
|
|
1552
|
+
t.value = h, e.emit("update:hue", b), e.emit("update:color", d);
|
|
1548
1553
|
}
|
|
1549
1554
|
function c(h) {
|
|
1550
|
-
const p = t.value.getRgba().toString(),
|
|
1555
|
+
const p = t.value.getRgba().toString(), f = t.value.getHsva().toString(), d = h.getRgba().toString() === p && h.getHsva().toString() === f;
|
|
1551
1556
|
return {
|
|
1552
|
-
"color-preset__color-selector":
|
|
1553
|
-
selected:
|
|
1557
|
+
"color-preset__color-selector": d,
|
|
1558
|
+
selected: d
|
|
1554
1559
|
};
|
|
1555
1560
|
}
|
|
1556
1561
|
function g(h, p) {
|
|
@@ -1576,20 +1581,18 @@ const zt = {
|
|
|
1576
1581
|
props: $e,
|
|
1577
1582
|
emits: ["valueChanged", "activeChange", "update:color", "update:hue"],
|
|
1578
1583
|
setup(r, e) {
|
|
1579
|
-
const t = S(new
|
|
1580
|
-
let b = -1, y
|
|
1581
|
-
const $ = S(r.color);
|
|
1582
|
-
let
|
|
1583
|
-
const
|
|
1584
|
-
let I = U(() => !y && v && v.initType ? v.initType : y);
|
|
1585
|
-
const B = U({
|
|
1584
|
+
const t = S(new E(r.color)), n = S(r.color), i = S(r.disabled), l = S(r.color), u = S(r.allowColorNull), c = S(r.presets), g = S(!1), h = S(!1), p = S(!1), f = S("HEX"), d = Math.floor(Math.random() * 1e3).toString();
|
|
1585
|
+
let b = -1, y;
|
|
1586
|
+
const v = new Ae("#000000"), $ = S(r.color);
|
|
1587
|
+
let M, H;
|
|
1588
|
+
const j = S(null), N = S(null), P = S(null), V = U(() => !y && v && v.initType ? v.initType : y), O = U({
|
|
1586
1589
|
get() {
|
|
1587
|
-
return y && n.value !== null ? (te(y),
|
|
1590
|
+
return y && n.value !== null ? (te(y), x(new E(n.value), R[y])) : n.value;
|
|
1588
1591
|
},
|
|
1589
1592
|
set(w) {
|
|
1590
1593
|
w !== null && (q(w), J(w));
|
|
1591
1594
|
}
|
|
1592
|
-
}),
|
|
1595
|
+
}), A = S(O.value), I = U(() => b > -1), W = U(() => c.value.length > 0), he = U(() => ({
|
|
1593
1596
|
"background-color": l.value
|
|
1594
1597
|
})), ie = U(() => h.value && g.value ? "display:flex" : "display:none"), z = [{
|
|
1595
1598
|
text: "HEX",
|
|
@@ -1600,33 +1603,33 @@ const zt = {
|
|
|
1600
1603
|
}];
|
|
1601
1604
|
function pe() {
|
|
1602
1605
|
const w = document.getElementById("farris-color-picker-panel");
|
|
1603
|
-
w.id = `farris-color-picker-panel-${
|
|
1606
|
+
w.id = `farris-color-picker-panel-${d}`;
|
|
1604
1607
|
const m = document.getElementById("farris-color-picker-plus-sure");
|
|
1605
|
-
m.id = `farris-color-picker-plus-sure-${
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
+
m.id = `farris-color-picker-plus-sure-${d}`;
|
|
1609
|
+
const B = document.getElementById("farris-color-picker-plus-input");
|
|
1610
|
+
B.id = `farris-color-picker-plus-input-${d}`, H = document.getElementById(`farris-color-picker-plus-sure-${d}`), M = document.getElementById(`farris-color-picker-panel-${d}`), M.className = "color-picker-panel disabled";
|
|
1608
1611
|
}
|
|
1609
1612
|
function G() {
|
|
1610
1613
|
if (!u.value && !n.value) {
|
|
1611
|
-
document.getElementById(`farris-color-picker-plus-sure-${
|
|
1612
|
-
const m = document.getElementById(`farris-color-picker-plus-input-${
|
|
1614
|
+
document.getElementById(`farris-color-picker-plus-sure-${d}`).classList.toggle("disabled");
|
|
1615
|
+
const m = document.getElementById(`farris-color-picker-plus-input-${d}`);
|
|
1613
1616
|
m.style.borderColor = "red";
|
|
1614
1617
|
}
|
|
1615
1618
|
}
|
|
1616
|
-
function
|
|
1617
|
-
n.value && (q(n.value), !n.value && u.value || (n.value =
|
|
1619
|
+
function fe() {
|
|
1620
|
+
n.value && (q(n.value), !n.value && u.value || (n.value = x(new E(n.value), R[V.value])), A.value = O.value), ee(te(v.initType));
|
|
1618
1621
|
}
|
|
1619
1622
|
function se() {
|
|
1620
|
-
n.value && q(n.value), v.hasPresets() || v.setColorPresets(c.value), n.value ? l.value =
|
|
1623
|
+
n.value && q(n.value), v.hasPresets() || v.setColorPresets(c.value), n.value ? l.value = x(new E(n.value), R[V.value]) : !n.value && u.value && (l.value = null);
|
|
1621
1624
|
}
|
|
1622
|
-
function
|
|
1625
|
+
function de() {
|
|
1623
1626
|
v.valueChanges.subscribe((w) => {
|
|
1624
|
-
const m =
|
|
1627
|
+
const m = x(w, R[y || v.initType]);
|
|
1625
1628
|
n.value = m;
|
|
1626
1629
|
});
|
|
1627
1630
|
}
|
|
1628
1631
|
function ee(w) {
|
|
1629
|
-
|
|
1632
|
+
f.value = z[w].text;
|
|
1630
1633
|
}
|
|
1631
1634
|
function ve() {
|
|
1632
1635
|
var w;
|
|
@@ -1635,49 +1638,49 @@ const zt = {
|
|
|
1635
1638
|
qe(() => {
|
|
1636
1639
|
v.setColorPresets(c.value || ["#eaecf3"]);
|
|
1637
1640
|
}), C(() => {
|
|
1638
|
-
pe(), G(),
|
|
1639
|
-
}), F(
|
|
1640
|
-
|
|
1641
|
+
pe(), G(), fe(), se();
|
|
1642
|
+
}), F(f, () => {
|
|
1643
|
+
de(), O.value = x(new E(n.value), R[y || v.initType]), t.value = new E(O.value), ve();
|
|
1641
1644
|
}), F(n, (w) => {
|
|
1642
|
-
|
|
1645
|
+
x(v.value, v.initType) !== w && w !== null && q(w), ee(te(v.initType));
|
|
1643
1646
|
}), F(t, (w) => {
|
|
1644
|
-
n.value =
|
|
1647
|
+
n.value = x(w, R[y || v.initType]), q(n.value), O.value = n.value;
|
|
1645
1648
|
});
|
|
1646
1649
|
function J(w) {
|
|
1647
|
-
const m = document.getElementById(`farris-color-picker-plus-input-${
|
|
1648
|
-
(w
|
|
1650
|
+
const m = document.getElementById(`farris-color-picker-plus-input-${d}`);
|
|
1651
|
+
(w === "" || w === void 0 || w == null) && !u.value ? (n.value = null, m.style.borderColor = "red", H.className = "btn btn-secondary disabled") : (m.style.borderColor = "#dcdfe6", H.className = "btn btn-secondary");
|
|
1649
1652
|
}
|
|
1650
1653
|
function ge(w) {
|
|
1651
|
-
var m,
|
|
1654
|
+
var m, B;
|
|
1652
1655
|
if (w == null || w.stopPropagation(), u.value) {
|
|
1653
1656
|
l.value = (n == null ? void 0 : n.value) ?? null;
|
|
1654
|
-
const
|
|
1657
|
+
const D = {
|
|
1655
1658
|
elementValue: l
|
|
1656
1659
|
};
|
|
1657
|
-
e.emit("valueChanged",
|
|
1660
|
+
e.emit("valueChanged", D), L();
|
|
1658
1661
|
}
|
|
1659
|
-
if (!u.value && !(
|
|
1660
|
-
(
|
|
1661
|
-
const
|
|
1662
|
+
if (!u.value && !(O.value === void 0 || O.value == null || O.value === "")) {
|
|
1663
|
+
(B = (m = j.value) == null ? void 0 : m.style) == null || B.setProperty("background", n.value), p.value = !0, l.value = n.value;
|
|
1664
|
+
const D = {
|
|
1662
1665
|
elementValue: l
|
|
1663
1666
|
};
|
|
1664
|
-
e.emit("valueChanged",
|
|
1667
|
+
e.emit("valueChanged", D), L();
|
|
1665
1668
|
}
|
|
1666
|
-
!$.value && !n.value && !p.value && u &&
|
|
1669
|
+
!$.value && !n.value && !p.value && u && L(), J(n.value), O.value = n.value, H.classList.contains("disabled") || (A.value = n.value, g.value = !1);
|
|
1667
1670
|
}
|
|
1668
1671
|
function q(w) {
|
|
1669
|
-
v == null || v.setValueFrom(w,
|
|
1672
|
+
v == null || v.setValueFrom(w, d, u.value);
|
|
1670
1673
|
}
|
|
1671
1674
|
function ye(w) {
|
|
1672
|
-
|
|
1673
|
-
const m =
|
|
1674
|
-
i.value || m || (g.value = !0,
|
|
1675
|
+
M = document.getElementById(`farris-color-picker-panel-${d}`);
|
|
1676
|
+
const m = M.className === "color-picker-panel";
|
|
1677
|
+
i.value || m || (g.value = !0, M.classList.toggle("disabled"), G(), q(n.value), w.stopPropagation());
|
|
1675
1678
|
}
|
|
1676
|
-
function
|
|
1677
|
-
|
|
1679
|
+
function L() {
|
|
1680
|
+
M = document.getElementById(`farris-color-picker-panel-${d}`), M.className = "color-picker-panel disabled";
|
|
1678
1681
|
}
|
|
1679
1682
|
function te(w) {
|
|
1680
|
-
const m = z.findIndex((
|
|
1683
|
+
const m = z.findIndex((B) => B.type === w);
|
|
1681
1684
|
return b = m, m;
|
|
1682
1685
|
}
|
|
1683
1686
|
function Q(w) {
|
|
@@ -1688,13 +1691,13 @@ const zt = {
|
|
|
1688
1691
|
}
|
|
1689
1692
|
return () => k("div", {
|
|
1690
1693
|
class: "f-color-picker-component",
|
|
1691
|
-
ref:
|
|
1694
|
+
ref: N
|
|
1692
1695
|
}, [k("div", {
|
|
1693
1696
|
class: ["color-picker-panel", {
|
|
1694
1697
|
disabled: i.value
|
|
1695
1698
|
}],
|
|
1696
1699
|
id: "farris-color-picker-panel",
|
|
1697
|
-
ref:
|
|
1700
|
+
ref: P,
|
|
1698
1701
|
onClick: (w) => w.stopPropagation(),
|
|
1699
1702
|
style: "top:30px"
|
|
1700
1703
|
}, [k("div", {
|
|
@@ -1706,7 +1709,7 @@ const zt = {
|
|
|
1706
1709
|
color: t.value,
|
|
1707
1710
|
"onUpdate:color": (w) => t.value = w
|
|
1708
1711
|
}, null), k(Te, {
|
|
1709
|
-
randomId:
|
|
1712
|
+
randomId: d,
|
|
1710
1713
|
hue: v.hue,
|
|
1711
1714
|
"onUpdate:hue": (w) => v.hue = w,
|
|
1712
1715
|
allowColorNull: u.value,
|
|
@@ -1714,7 +1717,7 @@ const zt = {
|
|
|
1714
1717
|
"onUpdate:color": (w) => t.value = w
|
|
1715
1718
|
}, null)]), k(et, {
|
|
1716
1719
|
style: ie.value,
|
|
1717
|
-
randomId:
|
|
1720
|
+
randomId: d,
|
|
1718
1721
|
allowColorNull: u.value,
|
|
1719
1722
|
color: t.value,
|
|
1720
1723
|
"onUpdate:color": (w) => t.value = w
|
|
@@ -1723,13 +1726,13 @@ const zt = {
|
|
|
1723
1726
|
style: "display:flex;align-items: center;"
|
|
1724
1727
|
}, [X(k("span", {
|
|
1725
1728
|
style: "width:40px;margin-right:10px;"
|
|
1726
|
-
}, [
|
|
1729
|
+
}, [f.value]), [[Z, W]]), X(k("input", {
|
|
1727
1730
|
type: "text",
|
|
1728
1731
|
title: "color-picker-plus",
|
|
1729
1732
|
id: "farris-color-picker-plus-input",
|
|
1730
|
-
"onUpdate:modelValue": (w) =>
|
|
1733
|
+
"onUpdate:modelValue": (w) => O.value = w,
|
|
1731
1734
|
style: "float:none"
|
|
1732
|
-
}, null), [[Ye,
|
|
1735
|
+
}, null), [[Ye, O.value]]), X(k("div", {
|
|
1733
1736
|
class: "type-icon-btn-wrapper",
|
|
1734
1737
|
style: "cursor:pointer"
|
|
1735
1738
|
}, [k("span", {
|
|
@@ -1749,15 +1752,15 @@ const zt = {
|
|
|
1749
1752
|
"onUpdate:color": (w) => t.value = w,
|
|
1750
1753
|
hue: v.hue,
|
|
1751
1754
|
"onUpdate:hue": (w) => v.hue = w,
|
|
1752
|
-
randomId:
|
|
1755
|
+
randomId: d,
|
|
1753
1756
|
colorPresets: v.presets
|
|
1754
|
-
}, null), [[Z,
|
|
1757
|
+
}, null), [[Z, I]])]), k("div", {
|
|
1755
1758
|
class: "color-picker-wrapper"
|
|
1756
1759
|
}, [k("input", {
|
|
1757
1760
|
title: "color-picker-input",
|
|
1758
1761
|
type: "text",
|
|
1759
1762
|
class: "color-picker-input form-control",
|
|
1760
|
-
value:
|
|
1763
|
+
value: A.value,
|
|
1761
1764
|
readonly: i.value,
|
|
1762
1765
|
onClick: (w) => w.stopPropagation()
|
|
1763
1766
|
}, null), k("div", {
|
|
@@ -1770,102 +1773,108 @@ const zt = {
|
|
|
1770
1773
|
}, null)])])])]);
|
|
1771
1774
|
}
|
|
1772
1775
|
});
|
|
1773
|
-
function
|
|
1774
|
-
var
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
const i = "", l = "", u = S();
|
|
1778
|
-
function c() {
|
|
1776
|
+
function Kt(r, e, t) {
|
|
1777
|
+
var N;
|
|
1778
|
+
const n = "", i = "", l = S();
|
|
1779
|
+
function u() {
|
|
1779
1780
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
1780
1781
|
}
|
|
1781
|
-
function
|
|
1782
|
+
function c() {
|
|
1782
1783
|
return !1;
|
|
1783
1784
|
}
|
|
1784
|
-
function
|
|
1785
|
+
function g() {
|
|
1785
1786
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
1786
1787
|
}
|
|
1787
|
-
function
|
|
1788
|
+
function h() {
|
|
1788
1789
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
1789
1790
|
}
|
|
1790
|
-
function
|
|
1791
|
-
if (!
|
|
1791
|
+
function p(P) {
|
|
1792
|
+
if (!P || !P.value)
|
|
1792
1793
|
return null;
|
|
1793
|
-
if (
|
|
1794
|
-
return
|
|
1795
|
-
const
|
|
1796
|
-
return
|
|
1794
|
+
if (P.value.schema && P.value.schema.type === "component")
|
|
1795
|
+
return P.value;
|
|
1796
|
+
const V = S(P == null ? void 0 : P.value.parent), O = p(V);
|
|
1797
|
+
return O || null;
|
|
1797
1798
|
}
|
|
1798
|
-
function f(
|
|
1799
|
-
const { componentInstance:
|
|
1800
|
-
return !
|
|
1799
|
+
function f(P = e) {
|
|
1800
|
+
const { componentInstance: V, designerItemElementRef: O } = P;
|
|
1801
|
+
return !V || !V.value ? null : V.value.canMove ? O : f(P.parent);
|
|
1801
1802
|
}
|
|
1802
|
-
function
|
|
1803
|
+
function d(P) {
|
|
1803
1804
|
return !!t;
|
|
1804
1805
|
}
|
|
1805
|
-
function
|
|
1806
|
+
function b() {
|
|
1806
1807
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
1807
1808
|
}
|
|
1808
|
-
function
|
|
1809
|
+
function y() {
|
|
1809
1810
|
}
|
|
1810
|
-
function
|
|
1811
|
+
function v(P, V) {
|
|
1811
1812
|
}
|
|
1812
|
-
function
|
|
1813
|
-
const { componentType:
|
|
1814
|
-
let
|
|
1815
|
-
const
|
|
1816
|
-
return
|
|
1813
|
+
function $(P, V) {
|
|
1814
|
+
const { componentType: O } = P;
|
|
1815
|
+
let A = We(O, P, V);
|
|
1816
|
+
const I = O.toLowerCase().replace(/-/g, "_");
|
|
1817
|
+
return A && !A.id && A.type === O && (A.id = `${I}_${Math.random().toString().slice(2, 6)}`), A;
|
|
1817
1818
|
}
|
|
1818
|
-
function
|
|
1819
|
+
function M(P) {
|
|
1819
1820
|
}
|
|
1820
|
-
function
|
|
1821
|
+
function H(...P) {
|
|
1821
1822
|
}
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1823
|
+
function j() {
|
|
1824
|
+
e != null && e.schema.contents && e.schema.contents.map((P) => {
|
|
1825
|
+
var A;
|
|
1826
|
+
let V = P.id;
|
|
1827
|
+
P.type === "component-ref" && (V = P.component);
|
|
1828
|
+
const O = r.value.querySelector(`#${V}-design-item`);
|
|
1829
|
+
(A = O == null ? void 0 : O.componentInstance) != null && A.value.onRemoveComponent && O.componentInstance.value.onRemoveComponent();
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
return l.value = {
|
|
1833
|
+
canMove: u(),
|
|
1834
|
+
canSelectParent: c(),
|
|
1835
|
+
canDelete: g(),
|
|
1836
|
+
canNested: !h(),
|
|
1827
1837
|
contents: e == null ? void 0 : e.schema.contents,
|
|
1828
1838
|
elementRef: r,
|
|
1829
|
-
parent: (
|
|
1839
|
+
parent: (N = e == null ? void 0 : e.parent) == null ? void 0 : N.componentInstance,
|
|
1830
1840
|
schema: e == null ? void 0 : e.schema,
|
|
1831
|
-
styles:
|
|
1832
|
-
designerClass:
|
|
1833
|
-
canAccepts:
|
|
1834
|
-
getBelongedComponentInstance:
|
|
1841
|
+
styles: n,
|
|
1842
|
+
designerClass: i,
|
|
1843
|
+
canAccepts: d,
|
|
1844
|
+
getBelongedComponentInstance: p,
|
|
1835
1845
|
getDraggableDesignItemElement: f,
|
|
1836
|
-
getDraggingDisplayText:
|
|
1837
|
-
getPropConfig:
|
|
1838
|
-
getDragScopeElement:
|
|
1839
|
-
onAcceptMovedChildElement:
|
|
1840
|
-
onChildElementMovedOut:
|
|
1841
|
-
addNewChildComponentSchema:
|
|
1842
|
-
updateDragAndDropRules: n,
|
|
1846
|
+
getDraggingDisplayText: b,
|
|
1847
|
+
getPropConfig: H,
|
|
1848
|
+
getDragScopeElement: y,
|
|
1849
|
+
onAcceptMovedChildElement: v,
|
|
1850
|
+
onChildElementMovedOut: M,
|
|
1851
|
+
addNewChildComponentSchema: $,
|
|
1843
1852
|
triggerBelongedComponentToMoveWhenMoved: S(!1),
|
|
1844
|
-
triggerBelongedComponentToDeleteWhenDeleted: S(!1)
|
|
1845
|
-
|
|
1853
|
+
triggerBelongedComponentToDeleteWhenDeleted: S(!1),
|
|
1854
|
+
onRemoveComponent: j
|
|
1855
|
+
}, l;
|
|
1846
1856
|
}
|
|
1847
|
-
const
|
|
1857
|
+
const Tt = /* @__PURE__ */ T({
|
|
1848
1858
|
name: "FColorPickerDesign",
|
|
1849
1859
|
props: $e,
|
|
1850
1860
|
emits: ["valueChanged", "activeChange", "update:color", "update:hue"],
|
|
1851
1861
|
setup(r, e) {
|
|
1852
|
-
const t = S(new
|
|
1853
|
-
let b = -1, y
|
|
1854
|
-
const $ = S(r.color);
|
|
1855
|
-
let
|
|
1856
|
-
const
|
|
1862
|
+
const t = S(new E(r.color)), n = S(r.color), i = S(r.disabled), l = S(r.color), u = S(r.allowColorNull), c = S(r.presets), g = S(!1), h = S(!1), p = S(!1), f = S("HEX"), d = Math.floor(Math.random() * 1e3).toString();
|
|
1863
|
+
let b = -1, y;
|
|
1864
|
+
const v = new Ae("#000000"), $ = S(r.color);
|
|
1865
|
+
let M, H;
|
|
1866
|
+
const j = S(null), N = S(null), P = S(), V = it("design-item-context"), O = Kt(P, V);
|
|
1857
1867
|
C(() => {
|
|
1858
|
-
|
|
1859
|
-
}), e.expose(
|
|
1860
|
-
|
|
1861
|
-
const x = U({
|
|
1868
|
+
P.value.componentInstance = O;
|
|
1869
|
+
}), e.expose(O.value);
|
|
1870
|
+
const A = U(() => !y && v && v.initType ? v.initType : y), I = U({
|
|
1862
1871
|
get() {
|
|
1863
|
-
return y && n.value !== null ? (Q(y),
|
|
1872
|
+
return y && n.value !== null ? (Q(y), x(new E(n.value), R[y])) : n.value;
|
|
1864
1873
|
},
|
|
1865
1874
|
set(m) {
|
|
1866
|
-
m !== null && (
|
|
1875
|
+
m !== null && (L(m), q(m));
|
|
1867
1876
|
}
|
|
1868
|
-
}), W = S(
|
|
1877
|
+
}), W = S(I.value), he = U(() => b > -1), ie = U(() => c.value.length > 0), z = U(() => ({
|
|
1869
1878
|
"background-color": l.value
|
|
1870
1879
|
})), pe = U(() => h.value && g.value ? "display:flex" : "display:none"), G = [{
|
|
1871
1880
|
text: "HEX",
|
|
@@ -1874,35 +1883,35 @@ const Kt = /* @__PURE__ */ T({
|
|
|
1874
1883
|
text: "RGBA",
|
|
1875
1884
|
type: R.rgba
|
|
1876
1885
|
}];
|
|
1877
|
-
function
|
|
1886
|
+
function fe() {
|
|
1878
1887
|
const m = document.getElementById("farris-color-picker-panel");
|
|
1879
|
-
m.id = `farris-color-picker-panel-${
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1882
|
-
const
|
|
1883
|
-
|
|
1888
|
+
m.id = `farris-color-picker-panel-${d}`;
|
|
1889
|
+
const B = document.getElementById("farris-color-picker-plus-sure");
|
|
1890
|
+
B.id = `farris-color-picker-plus-sure-${d}`;
|
|
1891
|
+
const D = document.getElementById("farris-color-picker-plus-input");
|
|
1892
|
+
D.id = `farris-color-picker-plus-input-${d}`, H = document.getElementById(`farris-color-picker-plus-sure-${d}`), M = document.getElementById(`farris-color-picker-panel-${d}`), M.className = "color-picker-panel disabled";
|
|
1884
1893
|
}
|
|
1885
1894
|
function se() {
|
|
1886
1895
|
if (!u.value && !n.value) {
|
|
1887
|
-
document.getElementById(`farris-color-picker-plus-sure-${
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1896
|
+
document.getElementById(`farris-color-picker-plus-sure-${d}`).classList.toggle("disabled");
|
|
1897
|
+
const B = document.getElementById(`farris-color-picker-plus-input-${d}`);
|
|
1898
|
+
B.style.borderColor = "red";
|
|
1890
1899
|
}
|
|
1891
1900
|
}
|
|
1892
|
-
function
|
|
1893
|
-
n.value && (
|
|
1901
|
+
function de() {
|
|
1902
|
+
n.value && (L(n.value), !n.value && u.value || (n.value = x(new E(n.value), R[A.value])), W.value = I.value), J(Q(v.initType));
|
|
1894
1903
|
}
|
|
1895
1904
|
function ee() {
|
|
1896
|
-
n.value &&
|
|
1905
|
+
n.value && L(n.value), v.hasPresets() || v.setColorPresets(c.value), n.value ? l.value = x(new E(n.value), R[A.value]) : !n.value && u.value && (l.value = null);
|
|
1897
1906
|
}
|
|
1898
1907
|
function ve() {
|
|
1899
1908
|
v.valueChanges.subscribe((m) => {
|
|
1900
|
-
const
|
|
1901
|
-
n.value =
|
|
1909
|
+
const B = x(m, R[y || v.initType]);
|
|
1910
|
+
n.value = B;
|
|
1902
1911
|
});
|
|
1903
1912
|
}
|
|
1904
1913
|
function J(m) {
|
|
1905
|
-
|
|
1914
|
+
f.value = G[m].text;
|
|
1906
1915
|
}
|
|
1907
1916
|
function ge() {
|
|
1908
1917
|
var m;
|
|
@@ -1911,61 +1920,61 @@ const Kt = /* @__PURE__ */ T({
|
|
|
1911
1920
|
qe(() => {
|
|
1912
1921
|
v.setColorPresets(c.value || ["#eaecf3"]);
|
|
1913
1922
|
}), C(() => {
|
|
1914
|
-
|
|
1915
|
-
}), F(
|
|
1916
|
-
ve(),
|
|
1923
|
+
fe(), se(), de(), ee();
|
|
1924
|
+
}), F(f, () => {
|
|
1925
|
+
ve(), I.value = x(new E(n.value), R[y || v.initType]), t.value = new E(I.value), ge();
|
|
1917
1926
|
}), F(n, (m) => {
|
|
1918
|
-
|
|
1927
|
+
x(v.value, v.initType) !== m && m !== null && L(m), J(Q(v.initType));
|
|
1919
1928
|
}), F(t, (m) => {
|
|
1920
|
-
n.value =
|
|
1929
|
+
n.value = x(m, R[y || v.initType]), L(n.value), I.value = n.value;
|
|
1921
1930
|
});
|
|
1922
1931
|
function q(m) {
|
|
1923
|
-
const
|
|
1924
|
-
(m
|
|
1932
|
+
const B = document.getElementById(`farris-color-picker-plus-input-${d}`);
|
|
1933
|
+
(m === "" || m === void 0 || m == null) && !u.value ? (n.value = null, B.style.borderColor = "red", H.className = "btn btn-secondary disabled") : (B.style.borderColor = "#dcdfe6", H.className = "btn btn-secondary");
|
|
1925
1934
|
}
|
|
1926
1935
|
function ye() {
|
|
1927
|
-
var m,
|
|
1936
|
+
var m, B;
|
|
1928
1937
|
if (u.value) {
|
|
1929
1938
|
l.value = (n == null ? void 0 : n.value) ?? null;
|
|
1930
|
-
const
|
|
1939
|
+
const D = {
|
|
1931
1940
|
elementValue: l
|
|
1932
1941
|
};
|
|
1933
|
-
e.emit("valueChanged",
|
|
1942
|
+
e.emit("valueChanged", D), M.classList.toggle("disabled");
|
|
1934
1943
|
}
|
|
1935
|
-
if (!u.value && !(
|
|
1936
|
-
(
|
|
1937
|
-
const
|
|
1944
|
+
if (!u.value && !(I.value === void 0 || I.value == null || I.value === "")) {
|
|
1945
|
+
(B = (m = j.value) == null ? void 0 : m.style) == null || B.setProperty("background", n.value), p.value = !0, l.value = n.value;
|
|
1946
|
+
const D = {
|
|
1938
1947
|
elementValue: l
|
|
1939
1948
|
};
|
|
1940
|
-
e.emit("valueChanged",
|
|
1949
|
+
e.emit("valueChanged", D), M.classList.toggle("disabled");
|
|
1941
1950
|
}
|
|
1942
|
-
!$.value && !n.value && !p.value && u &&
|
|
1951
|
+
!$.value && !n.value && !p.value && u && M.classList.toggle("disabled"), q(n.value), I.value = n.value, H.classList.contains("disabled") || (W.value = n.value, g.value = !1);
|
|
1943
1952
|
}
|
|
1944
|
-
function
|
|
1945
|
-
v == null || v.setValueFrom(m,
|
|
1953
|
+
function L(m) {
|
|
1954
|
+
v == null || v.setValueFrom(m, d, u.value);
|
|
1946
1955
|
}
|
|
1947
1956
|
function te(m) {
|
|
1948
|
-
i.value || (g.value = !0,
|
|
1957
|
+
i.value || (g.value = !0, M.classList.toggle("disabled"), se(), L(n.value));
|
|
1949
1958
|
}
|
|
1950
1959
|
function Q(m) {
|
|
1951
|
-
const
|
|
1952
|
-
return b =
|
|
1960
|
+
const B = G.findIndex((D) => D.type === m);
|
|
1961
|
+
return b = B, B;
|
|
1953
1962
|
}
|
|
1954
1963
|
function w(m) {
|
|
1955
1964
|
if (!H.classList.contains("disabled")) {
|
|
1956
|
-
const
|
|
1957
|
-
b = (
|
|
1965
|
+
const B = G.length;
|
|
1966
|
+
b = (B + b + (m === "up" ? 1 : -1)) % B, y = G[b].type, J(b), L(n.value);
|
|
1958
1967
|
}
|
|
1959
1968
|
}
|
|
1960
1969
|
return () => k("div", {
|
|
1961
1970
|
class: "f-color-picker-component",
|
|
1962
|
-
ref:
|
|
1971
|
+
ref: P
|
|
1963
1972
|
}, [k("div", {
|
|
1964
1973
|
class: ["color-picker-panel", {
|
|
1965
1974
|
disabled: i.value
|
|
1966
1975
|
}],
|
|
1967
1976
|
id: "farris-color-picker-panel",
|
|
1968
|
-
ref:
|
|
1977
|
+
ref: N,
|
|
1969
1978
|
onClick: (m) => m.stopPropagation,
|
|
1970
1979
|
style: "top:30px"
|
|
1971
1980
|
}, [k("div", {
|
|
@@ -1977,7 +1986,7 @@ const Kt = /* @__PURE__ */ T({
|
|
|
1977
1986
|
color: t.value,
|
|
1978
1987
|
"onUpdate:color": (m) => t.value = m
|
|
1979
1988
|
}, null), k(Te, {
|
|
1980
|
-
randomId:
|
|
1989
|
+
randomId: d,
|
|
1981
1990
|
hue: v.hue,
|
|
1982
1991
|
"onUpdate:hue": (m) => v.hue = m,
|
|
1983
1992
|
allowColorNull: u.value,
|
|
@@ -1985,7 +1994,7 @@ const Kt = /* @__PURE__ */ T({
|
|
|
1985
1994
|
"onUpdate:color": (m) => t.value = m
|
|
1986
1995
|
}, null)]), k(et, {
|
|
1987
1996
|
style: pe.value,
|
|
1988
|
-
randomId:
|
|
1997
|
+
randomId: d,
|
|
1989
1998
|
allowColorNull: u.value,
|
|
1990
1999
|
color: t.value,
|
|
1991
2000
|
"onUpdate:color": (m) => t.value = m
|
|
@@ -1994,12 +2003,13 @@ const Kt = /* @__PURE__ */ T({
|
|
|
1994
2003
|
style: "display:flex;align-items: center;"
|
|
1995
2004
|
}, [X(k("span", {
|
|
1996
2005
|
style: "width:40px;margin-right:10px;"
|
|
1997
|
-
}, [
|
|
2006
|
+
}, [f.value]), [[Z, ie]]), X(k("input", {
|
|
2007
|
+
title: "color-picker-plus-input",
|
|
1998
2008
|
type: "text",
|
|
1999
2009
|
id: "farris-color-picker-plus-input",
|
|
2000
|
-
"onUpdate:modelValue": (m) =>
|
|
2010
|
+
"onUpdate:modelValue": (m) => I.value = m,
|
|
2001
2011
|
style: "float:none"
|
|
2002
|
-
}, null), [[Ye,
|
|
2012
|
+
}, null), [[Ye, I.value]]), X(k("div", {
|
|
2003
2013
|
class: "type-icon-btn-wrapper",
|
|
2004
2014
|
style: "cursor:pointer"
|
|
2005
2015
|
}, [k("span", {
|
|
@@ -2020,7 +2030,7 @@ const Kt = /* @__PURE__ */ T({
|
|
|
2020
2030
|
colorPresets: v.presets,
|
|
2021
2031
|
hue: v.hue,
|
|
2022
2032
|
"onUpdate:hue": (m) => v.hue = m,
|
|
2023
|
-
randomId:
|
|
2033
|
+
randomId: d
|
|
2024
2034
|
}, null), [[Z, he]])]), k("div", {
|
|
2025
2035
|
class: "color-picker-wrapper"
|
|
2026
2036
|
}, [k("input", {
|
|
@@ -2038,20 +2048,15 @@ const Kt = /* @__PURE__ */ T({
|
|
|
2038
2048
|
style: z.value
|
|
2039
2049
|
}, null)])])])]);
|
|
2040
2050
|
}
|
|
2041
|
-
})
|
|
2042
|
-
const e = r;
|
|
2043
|
-
return e.install = function(t) {
|
|
2044
|
-
t.component(e.name, r);
|
|
2045
|
-
}, r;
|
|
2046
|
-
};
|
|
2051
|
+
});
|
|
2047
2052
|
ue.register = (r, e, t) => {
|
|
2048
2053
|
r["color-picker"] = ue, e["color-picker"] = ze;
|
|
2049
2054
|
};
|
|
2050
2055
|
ue.registerDesigner = (r, e, t) => {
|
|
2051
|
-
r["color-picker"] =
|
|
2056
|
+
r["color-picker"] = Tt, e["color-picker"] = ze;
|
|
2052
2057
|
};
|
|
2053
|
-
const
|
|
2058
|
+
const rn = at(ue);
|
|
2054
2059
|
export {
|
|
2055
2060
|
ue as FColorPicker,
|
|
2056
|
-
|
|
2061
|
+
rn as default
|
|
2057
2062
|
};
|