@farris/ui-vue 1.3.0 → 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 +454 -398
- 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 +479 -476
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +255 -252
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +652 -567
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +518 -521
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +659 -553
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +162 -155
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +866 -747
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +371 -998
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1174 -1280
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +340 -991
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +6066 -5847
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3400 -3486
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2328 -2446
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9551 -1200
- 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 +234 -231
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1996 -2630
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +138 -123
- 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 +548 -586
- 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 +2871 -3736
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3380 -3645
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10543 -3207
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9775 -1312
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +442 -438
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +587 -807
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +415 -381
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +361 -1024
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2265 -2371
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6425 -6257
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +6164 -5946
- 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 +524 -1474
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +547 -502
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +646 -574
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1181 -2028
- 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 +1185 -2027
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +442 -1368
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +238 -235
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1635 -1713
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +791 -716
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12203 -5274
- 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 +1873 -520
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +299 -300
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +176 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +715 -659
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +1032 -1883
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4767 -5693
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +169 -161
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +490 -1167
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +154 -151
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +575 -1204
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +279 -276
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +478 -428
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +2591 -3326
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +442 -439
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +309 -307
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +500 -430
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +1391 -1341
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +574 -575
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3422 -3536
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2661 -2764
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +675 -674
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +300 -297
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +454 -1089
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +709 -706
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +54780 -52757
- 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/directive/area-response.d.ts +10 -0
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +9 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +5 -4
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +8 -5
- 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.component.d.ts +3 -2
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +9 -11
- 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 +3 -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/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -41
- package/types/designer-canvas/src/types.d.ts +10 -21
- 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/designer/response-form-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +1 -1
- 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 +6 -1
- 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/external-container/src/designer/use-designer-rules.d.ts +3 -3
- 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/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- 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/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +3 -1
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -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 +43 -35
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/query-solution/src/designer/query-solution-config/composition/use-property.d.ts +19 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- 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 +12 -0
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/query-solution/src/solutions.d.ts +108 -509
- 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-layout-editor/index.d.ts +3 -1
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- 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/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- 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/tree-grid/index.d.ts +3 -3
- package/types/tree-grid/src/tree-grid.component.d.ts +1 -1
- 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/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +0 -3
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
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
|
-
import { defineComponent as
|
|
5
|
-
import { isPlainObject as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 Ie, cloneDeep as st } from "lodash-es";
|
|
6
|
+
import { withInstall as at } from "../common/index.esm.js";
|
|
7
|
+
const Xe = {}, Ge = {};
|
|
8
|
+
function Re(r) {
|
|
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
|
-
function
|
|
12
|
-
const n =
|
|
16
|
+
function We(r, e = {}, t) {
|
|
17
|
+
const n = Xe[r];
|
|
13
18
|
if (n) {
|
|
14
|
-
let i =
|
|
15
|
-
const l =
|
|
16
|
-
return i = l ? l({ getSchemaByType:
|
|
19
|
+
let i = Re(n);
|
|
20
|
+
const l = Ge[r];
|
|
21
|
+
return i = l ? l({ getSchemaByType: We }, i, e, t) : i, i;
|
|
17
22
|
}
|
|
18
23
|
return null;
|
|
19
24
|
}
|
|
20
|
-
function at(r, e) {
|
|
21
|
-
const t = $e(e);
|
|
22
|
-
return Object.keys(r).reduce((n, i) => (n[i] && je(n[i]) && je(r[i]) ? Object.assign(n[i], r[i]) : n[i] = r[i], n), t), t;
|
|
23
|
-
}
|
|
24
25
|
function ot(r, e) {
|
|
26
|
+
const t = Re(e);
|
|
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;
|
|
28
|
+
}
|
|
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
|
|
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,12 +211,12 @@ const Pt = /* @__PURE__ */ new Map([
|
|
|
206
211
|
}
|
|
207
212
|
}
|
|
208
213
|
}
|
|
209
|
-
},
|
|
210
|
-
title:
|
|
211
|
-
description:
|
|
212
|
-
type:
|
|
213
|
-
categories:
|
|
214
|
-
},
|
|
214
|
+
}, Rt = {
|
|
215
|
+
title: Mt,
|
|
216
|
+
description: Ht,
|
|
217
|
+
type: Ot,
|
|
218
|
+
categories: Bt
|
|
219
|
+
}, $e = {
|
|
215
220
|
/** 初始颜色 */
|
|
216
221
|
color: { type: String, default: "#e1e2e3" },
|
|
217
222
|
/** 禁用 */
|
|
@@ -223,10 +228,10 @@ const Pt = /* @__PURE__ */ new Map([
|
|
|
223
228
|
/** 颜色值变化事件 */
|
|
224
229
|
onValueChanged: { type: Function, default: () => {
|
|
225
230
|
} }
|
|
226
|
-
}, ze =
|
|
227
|
-
class
|
|
231
|
+
}, ze = ft($e, kt, Et, St, Rt);
|
|
232
|
+
class le {
|
|
228
233
|
}
|
|
229
|
-
class me extends
|
|
234
|
+
class me extends le {
|
|
230
235
|
constructor(e, t, n, i) {
|
|
231
236
|
super(), this.cyan = e, this.magenta = t, this.yellow = n, this.black = i;
|
|
232
237
|
}
|
|
@@ -246,7 +251,7 @@ class me extends ce {
|
|
|
246
251
|
return Math.round(this.black);
|
|
247
252
|
}
|
|
248
253
|
}
|
|
249
|
-
class
|
|
254
|
+
class ne extends le {
|
|
250
255
|
constructor(e, t, n, i) {
|
|
251
256
|
super(), this.hue = e, this.saturation = t, this.lightness = n, this.alpha = i;
|
|
252
257
|
}
|
|
@@ -266,7 +271,7 @@ class ie extends ce {
|
|
|
266
271
|
return Math.round(this.alpha * 100) / 100;
|
|
267
272
|
}
|
|
268
273
|
}
|
|
269
|
-
class
|
|
274
|
+
class re extends le {
|
|
270
275
|
constructor(e, t, n, i) {
|
|
271
276
|
super(), this.hue = e, this.saturation = t, this.value = n, this.alpha = i;
|
|
272
277
|
}
|
|
@@ -286,7 +291,7 @@ class se extends ce {
|
|
|
286
291
|
return Math.round(this.alpha * 100) / 100;
|
|
287
292
|
}
|
|
288
293
|
}
|
|
289
|
-
class o extends
|
|
294
|
+
class o extends le {
|
|
290
295
|
constructor(e, t, n, i) {
|
|
291
296
|
super(), this.red = e, this.green = t, this.blue = n, this.alpha = i;
|
|
292
297
|
}
|
|
@@ -309,8 +314,8 @@ class o extends ce {
|
|
|
309
314
|
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
|
-
let
|
|
313
|
-
class
|
|
317
|
+
let ke = a;
|
|
318
|
+
class E {
|
|
314
319
|
constructor(e) {
|
|
315
320
|
/**
|
|
316
321
|
* base color used to calculate other
|
|
@@ -319,18 +324,18 @@ class P {
|
|
|
319
324
|
* hsl(0, 100%, 50%)
|
|
320
325
|
* 初始色#ff0000
|
|
321
326
|
*/
|
|
322
|
-
s(this, "hsva", new
|
|
327
|
+
s(this, "hsva", new re(0, 1, 1, 1));
|
|
323
328
|
s(this, "rgba", new o(255, 0, 0, 1));
|
|
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
|
|
@@ -355,7 +360,7 @@ class P {
|
|
|
355
360
|
*/
|
|
356
361
|
setHsla(e, t, n, i = 1) {
|
|
357
362
|
i != null && (i = i > 1 ? 1 : i < 0 ? 0 : i, this.rgba.alpha = i);
|
|
358
|
-
const l = new
|
|
363
|
+
const l = new ne(e, t, n, i);
|
|
359
364
|
return this.rgba = this.hslaToRgba(l), this.hsva = this.rgbaToHsva(this.rgba), this;
|
|
360
365
|
}
|
|
361
366
|
/**
|
|
@@ -408,7 +413,7 @@ class P {
|
|
|
408
413
|
return this.getCmyk().toString();
|
|
409
414
|
}
|
|
410
415
|
getHsva() {
|
|
411
|
-
return new
|
|
416
|
+
return new re(this.hsva.hue, this.hsva.saturation, this.hsva.value, this.hsva.alpha);
|
|
412
417
|
}
|
|
413
418
|
getRgba() {
|
|
414
419
|
return new o(this.rgba.red, this.rgba.green, this.rgba.blue, this.rgba.alpha);
|
|
@@ -421,15 +426,15 @@ class P {
|
|
|
421
426
|
}
|
|
422
427
|
hsvaToHsla(e) {
|
|
423
428
|
const { hue: t } = e, n = e.saturation / 100, i = e.value / 100, l = (2 - n) * e.value / 2, u = n * i / (l <= 1 ? l : 2 - l) || 0;
|
|
424
|
-
return new
|
|
429
|
+
return new ne(t, l * 100, u * 100, e.alpha);
|
|
425
430
|
}
|
|
426
431
|
hslaToHsva(e) {
|
|
427
432
|
const { hue: t } = e, n = e.lightness / 100 * 2, i = e.saturation / 100 * (n <= 1 ? n : 2 - n), l = (n + i) / 2, u = 2 * i / (n + i) || 0;
|
|
428
|
-
return new
|
|
433
|
+
return new re(t, u, l, e.alpha);
|
|
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,22 +480,22 @@ 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;
|
|
492
497
|
}
|
|
493
|
-
return g *= 360, h *= 100, p *= 100, new
|
|
498
|
+
return g *= 360, h *= 100, p *= 100, new ne(g, h, p, l);
|
|
494
499
|
}
|
|
495
500
|
/**
|
|
496
501
|
* convert rgb color from HSLa
|
|
@@ -562,7 +567,7 @@ class P {
|
|
|
562
567
|
}
|
|
563
568
|
stringToColor(e) {
|
|
564
569
|
const t = e.replace(/ /g, "").toLowerCase();
|
|
565
|
-
let n =
|
|
570
|
+
let n = ke[e] || null;
|
|
566
571
|
if (t[0] === "#") {
|
|
567
572
|
let u = t.substr(1);
|
|
568
573
|
const { length: c } = u;
|
|
@@ -591,7 +596,7 @@ class P {
|
|
|
591
596
|
g = parseFloat(c.pop());
|
|
592
597
|
break;
|
|
593
598
|
case "hsl":
|
|
594
|
-
h = new
|
|
599
|
+
h = new ne(
|
|
595
600
|
parseInt(c[0], 10),
|
|
596
601
|
parseInt(c[1], 10),
|
|
597
602
|
parseInt(c[2], 10),
|
|
@@ -611,23 +616,23 @@ class P {
|
|
|
611
616
|
return n && (this.rgba = n, this.hsva = this.rgbaToHsva(n)), this;
|
|
612
617
|
}
|
|
613
618
|
}
|
|
614
|
-
var
|
|
615
|
-
return
|
|
619
|
+
var Se = function(r, e) {
|
|
620
|
+
return Se = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
|
|
616
621
|
t.__proto__ = n;
|
|
617
622
|
} || function(t, n) {
|
|
618
623
|
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
619
|
-
},
|
|
624
|
+
}, Se(r, e);
|
|
620
625
|
};
|
|
621
|
-
function
|
|
626
|
+
function _(r, e) {
|
|
622
627
|
if (typeof e != "function" && e !== null)
|
|
623
628
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
624
|
-
|
|
629
|
+
Se(r, e);
|
|
625
630
|
function t() {
|
|
626
631
|
this.constructor = r;
|
|
627
632
|
}
|
|
628
633
|
r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
|
|
629
634
|
}
|
|
630
|
-
function
|
|
635
|
+
function Pe(r) {
|
|
631
636
|
var e = typeof Symbol == "function" && Symbol.iterator, t = e && r[e], n = 0;
|
|
632
637
|
if (t) return t.call(r);
|
|
633
638
|
if (r && typeof r.length == "number") return {
|
|
@@ -637,7 +642,7 @@ function Ee(r) {
|
|
|
637
642
|
};
|
|
638
643
|
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
639
644
|
}
|
|
640
|
-
function
|
|
645
|
+
function Ee(r, e) {
|
|
641
646
|
var t = typeof Symbol == "function" && r[Symbol.iterator];
|
|
642
647
|
if (!t) return r;
|
|
643
648
|
var n = t.call(r), i, l = [], u;
|
|
@@ -654,21 +659,21 @@ function Me(r, e) {
|
|
|
654
659
|
}
|
|
655
660
|
return l;
|
|
656
661
|
}
|
|
657
|
-
function
|
|
662
|
+
function Me(r, e, t) {
|
|
658
663
|
if (t || arguments.length === 2) for (var n = 0, i = e.length, l; n < i; n++)
|
|
659
664
|
(l || !(n in e)) && (l || (l = Array.prototype.slice.call(e, 0, n)), l[n] = e[n]);
|
|
660
665
|
return r.concat(l || Array.prototype.slice.call(e));
|
|
661
666
|
}
|
|
662
|
-
function
|
|
667
|
+
function Y(r) {
|
|
663
668
|
return typeof r == "function";
|
|
664
669
|
}
|
|
665
|
-
function
|
|
670
|
+
function Je(r) {
|
|
666
671
|
var e = function(n) {
|
|
667
672
|
Error.call(n), n.stack = new Error().stack;
|
|
668
673
|
}, t = r(e);
|
|
669
674
|
return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
|
|
670
675
|
}
|
|
671
|
-
var we =
|
|
676
|
+
var we = Je(function(r) {
|
|
672
677
|
return function(t) {
|
|
673
678
|
r(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
|
674
679
|
` + t.map(function(n, i) {
|
|
@@ -677,13 +682,13 @@ var we = Ce(function(r) {
|
|
|
677
682
|
`) : "", this.name = "UnsubscriptionError", this.errors = t;
|
|
678
683
|
};
|
|
679
684
|
});
|
|
680
|
-
function
|
|
685
|
+
function He(r, e) {
|
|
681
686
|
if (r) {
|
|
682
687
|
var t = r.indexOf(e);
|
|
683
688
|
0 <= t && r.splice(t, 1);
|
|
684
689
|
}
|
|
685
690
|
}
|
|
686
|
-
var
|
|
691
|
+
var ce = function() {
|
|
687
692
|
function r(e) {
|
|
688
693
|
this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
689
694
|
}
|
|
@@ -695,7 +700,7 @@ var he = function() {
|
|
|
695
700
|
if (u)
|
|
696
701
|
if (this._parentage = null, Array.isArray(u))
|
|
697
702
|
try {
|
|
698
|
-
for (var c =
|
|
703
|
+
for (var c = Pe(u), g = c.next(); !g.done; g = c.next()) {
|
|
699
704
|
var h = g.value;
|
|
700
705
|
h.remove(this);
|
|
701
706
|
}
|
|
@@ -711,29 +716,29 @@ var he = function() {
|
|
|
711
716
|
else
|
|
712
717
|
u.remove(this);
|
|
713
718
|
var p = this.initialTeardown;
|
|
714
|
-
if (
|
|
719
|
+
if (Y(p))
|
|
715
720
|
try {
|
|
716
721
|
p();
|
|
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
|
-
l = l ?? [], v instanceof we ? l =
|
|
734
|
+
l = l ?? [], v instanceof we ? l = Me(Me([], Ee(l)), Ee(v.errors)) : l.push(v);
|
|
730
735
|
}
|
|
731
736
|
}
|
|
732
737
|
} catch (v) {
|
|
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 he = 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))
|
|
@@ -763,56 +768,56 @@ var he = function() {
|
|
|
763
768
|
this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
|
|
764
769
|
}, r.prototype._removeParent = function(e) {
|
|
765
770
|
var t = this._parentage;
|
|
766
|
-
t === e ? this._parentage = null : Array.isArray(t) &&
|
|
771
|
+
t === e ? this._parentage = null : Array.isArray(t) && He(t, e);
|
|
767
772
|
}, r.prototype.remove = function(e) {
|
|
768
773
|
var t = this._finalizers;
|
|
769
|
-
t &&
|
|
774
|
+
t && He(t, e), e instanceof r && e._removeParent(this);
|
|
770
775
|
}, r.EMPTY = function() {
|
|
771
776
|
var e = new r();
|
|
772
777
|
return e.closed = !0, e;
|
|
773
778
|
}(), r;
|
|
774
|
-
}(),
|
|
775
|
-
function
|
|
776
|
-
return r instanceof
|
|
779
|
+
}(), Qe = ce.EMPTY;
|
|
780
|
+
function Ze(r) {
|
|
781
|
+
return r instanceof ce || r && "closed" in r && Y(r.remove) && Y(r.add) && Y(r.unsubscribe);
|
|
777
782
|
}
|
|
778
|
-
function
|
|
779
|
-
|
|
783
|
+
function xe(r) {
|
|
784
|
+
Y(r) ? r() : r.unsubscribe();
|
|
780
785
|
}
|
|
781
|
-
var
|
|
786
|
+
var Ce = {
|
|
782
787
|
onUnhandledError: null,
|
|
783
788
|
onStoppedNotification: null,
|
|
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];
|
|
791
|
-
return setTimeout.apply(void 0,
|
|
796
|
+
return setTimeout.apply(void 0, Me([r, e], Ee(t)));
|
|
792
797
|
},
|
|
793
798
|
clearTimeout: function(r) {
|
|
794
799
|
return clearTimeout(r);
|
|
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
|
}
|
|
803
|
-
function
|
|
808
|
+
function Ne() {
|
|
804
809
|
}
|
|
805
|
-
function
|
|
810
|
+
function oe(r) {
|
|
806
811
|
r();
|
|
807
812
|
}
|
|
808
|
-
var
|
|
809
|
-
|
|
813
|
+
var Ve = function(r) {
|
|
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,
|
|
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
|
-
return new
|
|
820
|
+
return new Oe(t, n, i);
|
|
816
821
|
}, e.prototype.next = function(t) {
|
|
817
822
|
this.isStopped || this._next(t);
|
|
818
823
|
}, e.prototype.error = function(t) {
|
|
@@ -836,11 +841,11 @@ var xe = function(r) {
|
|
|
836
841
|
this.unsubscribe();
|
|
837
842
|
}
|
|
838
843
|
}, e;
|
|
839
|
-
}(
|
|
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
|
}
|
|
@@ -850,7 +855,7 @@ var xt = function() {
|
|
|
850
855
|
try {
|
|
851
856
|
t.next(e);
|
|
852
857
|
} catch (n) {
|
|
853
|
-
|
|
858
|
+
ae(n);
|
|
854
859
|
}
|
|
855
860
|
}, r.prototype.error = function(e) {
|
|
856
861
|
var t = this.partialObserver;
|
|
@@ -858,24 +863,24 @@ var xt = function() {
|
|
|
858
863
|
try {
|
|
859
864
|
t.error(e);
|
|
860
865
|
} catch (n) {
|
|
861
|
-
|
|
866
|
+
ae(n);
|
|
862
867
|
}
|
|
863
868
|
else
|
|
864
|
-
|
|
869
|
+
ae(e);
|
|
865
870
|
}, r.prototype.complete = function() {
|
|
866
871
|
var e = this.partialObserver;
|
|
867
872
|
if (e.complete)
|
|
868
873
|
try {
|
|
869
874
|
e.complete();
|
|
870
875
|
} catch (t) {
|
|
871
|
-
|
|
876
|
+
ae(t);
|
|
872
877
|
}
|
|
873
878
|
}, r;
|
|
874
|
-
}(),
|
|
875
|
-
|
|
879
|
+
}(), Oe = function(r) {
|
|
880
|
+
_(e, r);
|
|
876
881
|
function e(t, n, i) {
|
|
877
882
|
var l = r.call(this) || this, u;
|
|
878
|
-
if (
|
|
883
|
+
if (Y(t) || !t)
|
|
879
884
|
u = {
|
|
880
885
|
next: t ?? void 0,
|
|
881
886
|
error: n ?? void 0,
|
|
@@ -883,7 +888,7 @@ var xt = function() {
|
|
|
883
888
|
};
|
|
884
889
|
else {
|
|
885
890
|
var c;
|
|
886
|
-
l &&
|
|
891
|
+
l && Ce.useDeprecatedNextContext ? (c = Object.create(t), c.unsubscribe = function() {
|
|
887
892
|
return l.unsubscribe();
|
|
888
893
|
}, u = {
|
|
889
894
|
next: t.next && be(t.next, c),
|
|
@@ -891,35 +896,35 @@ var xt = 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
|
-
}(
|
|
898
|
-
function
|
|
899
|
-
|
|
902
|
+
}(Ve);
|
|
903
|
+
function ae(r) {
|
|
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
|
-
next:
|
|
907
|
-
error:
|
|
908
|
-
complete:
|
|
909
|
-
},
|
|
911
|
+
next: Ne,
|
|
912
|
+
error: It,
|
|
913
|
+
complete: Ne
|
|
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);
|
|
919
924
|
}, t);
|
|
920
925
|
};
|
|
921
926
|
}
|
|
922
|
-
var
|
|
927
|
+
var Ue = function() {
|
|
923
928
|
function r(e) {
|
|
924
929
|
e && (this._subscribe = e);
|
|
925
930
|
}
|
|
@@ -927,8 +932,8 @@ var De = function() {
|
|
|
927
932
|
var t = new r();
|
|
928
933
|
return t.source = this, t.operator = e, t;
|
|
929
934
|
}, r.prototype.subscribe = function(e, t, n) {
|
|
930
|
-
var i = this, l = Dt(e) ? e : new
|
|
931
|
-
return
|
|
935
|
+
var i = this, l = Dt(e) ? e : new Oe(e, t, n);
|
|
936
|
+
return oe(function() {
|
|
932
937
|
var u = i, c = u.operator, g = u.source;
|
|
933
938
|
l.add(c ? c.call(l, g) : g ? i._subscribe(l) : i._trySubscribe(l));
|
|
934
939
|
}), l;
|
|
@@ -941,7 +946,7 @@ var De = function() {
|
|
|
941
946
|
}, r.prototype.forEach = function(e, t) {
|
|
942
947
|
var n = this;
|
|
943
948
|
return t = Le(t), new t(function(i, l) {
|
|
944
|
-
var u = new
|
|
949
|
+
var u = new Oe({
|
|
945
950
|
next: function(c) {
|
|
946
951
|
try {
|
|
947
952
|
e(c);
|
|
@@ -957,12 +962,12 @@ var De = 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
973
|
return e = Le(e), new e(function(n, i) {
|
|
@@ -981,20 +986,20 @@ var De = function() {
|
|
|
981
986
|
}();
|
|
982
987
|
function Le(r) {
|
|
983
988
|
var e;
|
|
984
|
-
return (e = r ??
|
|
989
|
+
return (e = r ?? Ce.Promise) !== null && e !== void 0 ? e : Promise;
|
|
985
990
|
}
|
|
986
|
-
function
|
|
987
|
-
return r &&
|
|
991
|
+
function Lt(r) {
|
|
992
|
+
return r && Y(r.next) && Y(r.error) && Y(r.complete);
|
|
988
993
|
}
|
|
989
994
|
function Dt(r) {
|
|
990
|
-
return r && r instanceof
|
|
991
|
-
}
|
|
992
|
-
function Lt(r) {
|
|
993
|
-
return X(r == null ? void 0 : r.lift);
|
|
995
|
+
return r && r instanceof Ve || Lt(r) && Ze(r);
|
|
994
996
|
}
|
|
995
997
|
function Ft(r) {
|
|
998
|
+
return Y(r == null ? void 0 : r.lift);
|
|
999
|
+
}
|
|
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,11 +1010,11 @@ 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
|
|
1012
|
-
|
|
1016
|
+
var Xt = function(r) {
|
|
1017
|
+
_(e, r);
|
|
1013
1018
|
function e(t, n, i, l, u, c) {
|
|
1014
1019
|
var g = r.call(this, t) || this;
|
|
1015
1020
|
return g.onFinalize = u, g.shouldUnsubscribe = c, g._next = n ? function(h) {
|
|
@@ -1043,30 +1048,30 @@ 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
|
-
}(
|
|
1051
|
+
}(Ve), Gt = Je(function(r) {
|
|
1047
1052
|
return function() {
|
|
1048
1053
|
r(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
1049
1054
|
};
|
|
1050
|
-
}),
|
|
1051
|
-
|
|
1055
|
+
}), je = function(r) {
|
|
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() {
|
|
1065
1070
|
var i, l;
|
|
1066
1071
|
if (n._throwIfClosed(), !n.isStopped) {
|
|
1067
1072
|
n.currentObservers || (n.currentObservers = Array.from(n.observers));
|
|
1068
1073
|
try {
|
|
1069
|
-
for (var u =
|
|
1074
|
+
for (var u = Pe(n.currentObservers), c = u.next(); !c.done; c = u.next()) {
|
|
1070
1075
|
var g = c.value;
|
|
1071
1076
|
g.next(t);
|
|
1072
1077
|
}
|
|
@@ -1083,7 +1088,7 @@ var Yt = function(r) {
|
|
|
1083
1088
|
});
|
|
1084
1089
|
}, e.prototype.error = function(t) {
|
|
1085
1090
|
var n = this;
|
|
1086
|
-
|
|
1091
|
+
oe(function() {
|
|
1087
1092
|
if (n._throwIfClosed(), !n.isStopped) {
|
|
1088
1093
|
n.hasError = n.isStopped = !0, n.thrownError = t;
|
|
1089
1094
|
for (var i = n.observers; i.length; )
|
|
@@ -1092,7 +1097,7 @@ var Yt = function(r) {
|
|
|
1092
1097
|
});
|
|
1093
1098
|
}, e.prototype.complete = function() {
|
|
1094
1099
|
var t = this;
|
|
1095
|
-
|
|
1100
|
+
oe(function() {
|
|
1096
1101
|
if (t._throwIfClosed(), !t.isStopped) {
|
|
1097
1102
|
t.isStopped = !0;
|
|
1098
1103
|
for (var n = t.observers; n.length; )
|
|
@@ -1114,20 +1119,20 @@ var Yt = function(r) {
|
|
|
1114
1119
|
return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
|
|
1115
1120
|
}, e.prototype._innerSubscribe = function(t) {
|
|
1116
1121
|
var n = this, i = this, l = i.hasError, u = i.isStopped, c = i.observers;
|
|
1117
|
-
return l || u ?
|
|
1118
|
-
n.currentObservers = null,
|
|
1122
|
+
return l || u ? Qe : (this.currentObservers = null, c.push(t), new ce(function() {
|
|
1123
|
+
n.currentObservers = null, He(c, t);
|
|
1119
1124
|
}));
|
|
1120
1125
|
}, e.prototype._checkFinalizedStatuses = function(t) {
|
|
1121
1126
|
var n = this, i = n.hasError, l = n.thrownError, u = n.isStopped;
|
|
1122
1127
|
i ? t.error(l) : u && t.complete();
|
|
1123
1128
|
}, e.prototype.asObservable = function() {
|
|
1124
|
-
var t = new
|
|
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
|
-
}(
|
|
1130
|
-
|
|
1134
|
+
}(Ue), De = function(r) {
|
|
1135
|
+
_(e, r);
|
|
1131
1136
|
function e(t, n) {
|
|
1132
1137
|
var i = r.call(this) || this;
|
|
1133
1138
|
return i.destination = t, i.source = n, i;
|
|
@@ -1143,10 +1148,10 @@ var Yt = function(r) {
|
|
|
1143
1148
|
(n = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || n === void 0 || n.call(t);
|
|
1144
1149
|
}, e.prototype._subscribe = function(t) {
|
|
1145
1150
|
var n, i;
|
|
1146
|
-
return (i = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(t)) !== null && i !== void 0 ? i :
|
|
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
|
-
}(
|
|
1149
|
-
|
|
1153
|
+
}(je), Fe = function(r) {
|
|
1154
|
+
_(e, r);
|
|
1150
1155
|
function e(t) {
|
|
1151
1156
|
var n = r.call(this) || this;
|
|
1152
1157
|
return n._value = t, n;
|
|
@@ -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 Ie {
|
|
|
1190
1195
|
s(this, "hueValue", null);
|
|
1191
1196
|
/** 初始颜色值 */
|
|
1192
1197
|
s(this, "initValue", null);
|
|
1193
|
-
s(this, "valueChanged", new
|
|
1194
|
-
s(this, "presetsVisibilityChanges", new
|
|
1198
|
+
s(this, "valueChanged", new je());
|
|
1199
|
+
s(this, "presetsVisibilityChanges", new Fe(!0));
|
|
1195
1200
|
s(this, "initType", null);
|
|
1196
|
-
s(this, "alphaChannelVisibilityChanges", new
|
|
1197
|
-
s(this, "valueChanges", this.valueChanged.asObservable().pipe(
|
|
1201
|
+
s(this, "alphaChannelVisibilityChanges", new Fe(!0));
|
|
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 Ie {
|
|
|
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 Ie {
|
|
|
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 Ie {
|
|
|
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 j(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
|
-
}, Te = /* @__PURE__ */
|
|
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
|
|
1326
|
-
if (g(),
|
|
1327
|
-
const
|
|
1328
|
-
e.emit("update:color",
|
|
1330
|
+
const M = r.color == null ? "transparent" : r.color, H = E.from(M);
|
|
1331
|
+
if (g(), H != null) {
|
|
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
|
-
x:
|
|
1345
|
-
y:
|
|
1349
|
+
x: H,
|
|
1350
|
+
y: j,
|
|
1346
1351
|
height: b,
|
|
1347
|
-
width:
|
|
1352
|
+
width: d
|
|
1348
1353
|
});
|
|
1349
1354
|
}
|
|
1350
1355
|
}
|
|
1351
|
-
return
|
|
1352
|
-
const
|
|
1353
|
-
c(d.saturation, d.value);
|
|
1354
|
-
}), q(() => r.color, (d) => {
|
|
1355
|
-
d.getHsva();
|
|
1356
|
-
}), q(() => r.color, (d) => {
|
|
1357
|
-
const f = d.getHsva();
|
|
1356
|
+
return C(() => {
|
|
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:
|
|
1366
|
-
onTouchstart:
|
|
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
|
-
}, _e = /* @__PURE__ */
|
|
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:
|
|
1397
|
-
left:
|
|
1401
|
+
top: M,
|
|
1402
|
+
left: H
|
|
1398
1403
|
} = u.value.getBoundingClientRect(), {
|
|
1399
|
-
pageX:
|
|
1404
|
+
pageX: j,
|
|
1400
1405
|
pageY: N
|
|
1401
|
-
} = "touches" in y ? y.touches[0] : y,
|
|
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
|
});
|
|
@@ -1416,125 +1421,125 @@ const zt = {
|
|
|
1416
1421
|
const p = (y) => {
|
|
1417
1422
|
h(y), y.stopPropagation();
|
|
1418
1423
|
};
|
|
1419
|
-
|
|
1424
|
+
C(() => {
|
|
1420
1425
|
document.querySelectorAll(".f-hue-component").forEach(($) => {
|
|
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
|
-
const
|
|
1439
|
-
|
|
1440
|
-
const
|
|
1441
|
-
(r.color != null || r.color == null && n.value) && (e.emit("update:hue",
|
|
1443
|
+
const H = v / $ * 360;
|
|
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
|
-
return
|
|
1448
|
+
return F(t, (y) => {
|
|
1444
1449
|
const v = y.getHsva();
|
|
1445
|
-
|
|
1446
|
-
}),
|
|
1450
|
+
d(v.hue);
|
|
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,
|
|
1452
|
-
onMousedown:
|
|
1453
|
-
onTouchstart:
|
|
1457
|
+
onMousedown: K((y) => c(y), ["prevent"]),
|
|
1458
|
+
onTouchstart: K((y) => c(y), ["prevent"])
|
|
1454
1459
|
}, [k("div", {
|
|
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
|
-
}, et = /* @__PURE__ */
|
|
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:
|
|
1488
|
-
y:
|
|
1489
|
-
height:
|
|
1490
|
-
width:
|
|
1492
|
+
x: M,
|
|
1493
|
+
y: H,
|
|
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
|
-
return
|
|
1514
|
+
return C(() => {
|
|
1510
1515
|
const p = r.color.getHsva();
|
|
1511
1516
|
u(p.alpha);
|
|
1512
|
-
}),
|
|
1513
|
-
const
|
|
1514
|
-
u(
|
|
1517
|
+
}), F(() => r.color, (p) => {
|
|
1518
|
+
const f = p.getHsva();
|
|
1519
|
+
u(f.alpha);
|
|
1515
1520
|
}), () => k("div", {
|
|
1516
1521
|
class: "f-alpha-component",
|
|
1517
1522
|
ref: t,
|
|
1518
|
-
onMousedown:
|
|
1519
|
-
onTouchstart:
|
|
1523
|
+
onMousedown: K((p) => c(p), ["prevent"]),
|
|
1524
|
+
onTouchstart: K((p) => c(p), ["prevent"])
|
|
1520
1525
|
}, [k("div", {
|
|
1521
1526
|
class: "color-alpha-slider__bar"
|
|
1522
|
-
}, [
|
|
1527
|
+
}, [Be(" ")]), k("div", {
|
|
1523
1528
|
class: "color-alpha-slider__thumb",
|
|
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
|
-
}, tt = /* @__PURE__ */
|
|
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) {
|
|
@@ -1571,27 +1576,25 @@ const zt = {
|
|
|
1571
1576
|
class: "color-preset__colors"
|
|
1572
1577
|
}, [n.value.map((h, p) => g(h, p))])]);
|
|
1573
1578
|
}
|
|
1574
|
-
}),
|
|
1579
|
+
}), ue = /* @__PURE__ */ T({
|
|
1575
1580
|
name: "FColorPicker",
|
|
1576
|
-
props:
|
|
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 H = U(() => !y && v && v.initType ? v.initType : y);
|
|
1585
|
-
const O = 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 ? (
|
|
1590
|
+
return y && n.value !== null ? (te(y), x(new E(n.value), R[y])) : n.value;
|
|
1588
1591
|
},
|
|
1589
1592
|
set(w) {
|
|
1590
|
-
w !== null && (
|
|
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",
|
|
1596
1599
|
type: R.hex
|
|
1597
1600
|
}, {
|
|
@@ -1600,90 +1603,90 @@ 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-${
|
|
1608
|
+
m.id = `farris-color-picker-plus-sure-${d}`;
|
|
1606
1609
|
const B = document.getElementById("farris-color-picker-plus-input");
|
|
1607
|
-
B.id = `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
|
-
function
|
|
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 && (
|
|
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
|
-
function
|
|
1620
|
-
n.value &&
|
|
1622
|
+
function se() {
|
|
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
|
-
function
|
|
1629
|
-
|
|
1631
|
+
function ee(w) {
|
|
1632
|
+
f.value = z[w].text;
|
|
1630
1633
|
}
|
|
1631
1634
|
function ve() {
|
|
1632
1635
|
var w;
|
|
1633
1636
|
h.value = !!(y != null && y.includes("a") || (w = v.initType) != null && w.includes("a"));
|
|
1634
1637
|
}
|
|
1635
|
-
|
|
1638
|
+
qe(() => {
|
|
1636
1639
|
v.setColorPresets(c.value || ["#eaecf3"]);
|
|
1637
|
-
}),
|
|
1638
|
-
pe(),
|
|
1639
|
-
}),
|
|
1640
|
-
|
|
1641
|
-
}),
|
|
1642
|
-
|
|
1643
|
-
}),
|
|
1644
|
-
n.value =
|
|
1640
|
+
}), C(() => {
|
|
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();
|
|
1644
|
+
}), F(n, (w) => {
|
|
1645
|
+
x(v.value, v.initType) !== w && w !== null && q(w), ee(te(v.initType));
|
|
1646
|
+
}), F(t, (w) => {
|
|
1647
|
+
n.value = x(w, R[y || v.initType]), q(n.value), O.value = n.value;
|
|
1645
1648
|
});
|
|
1646
|
-
function
|
|
1647
|
-
const m = document.getElementById(`farris-color-picker-plus-input-${
|
|
1648
|
-
(w
|
|
1649
|
+
function J(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
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 && !(O.value
|
|
1660
|
-
(B = (m =
|
|
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 && L(),
|
|
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
|
-
function
|
|
1669
|
-
v == null || v.setValueFrom(w,
|
|
1671
|
+
function q(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
1679
|
function L() {
|
|
1677
|
-
|
|
1680
|
+
M = document.getElementById(`farris-color-picker-panel-${d}`), M.className = "color-picker-panel disabled";
|
|
1678
1681
|
}
|
|
1679
|
-
function
|
|
1680
|
-
const m =
|
|
1682
|
+
function te(w) {
|
|
1683
|
+
const m = z.findIndex((B) => B.type === w);
|
|
1681
1684
|
return b = m, m;
|
|
1682
1685
|
}
|
|
1683
|
-
function
|
|
1684
|
-
if (!
|
|
1685
|
-
const m =
|
|
1686
|
-
b = (m + b + (w === "up" ? 1 : -1)) % m, y =
|
|
1686
|
+
function Q(w) {
|
|
1687
|
+
if (!H.classList.contains("disabled")) {
|
|
1688
|
+
const m = z.length;
|
|
1689
|
+
b = (m + b + (w === "up" ? 1 : -1)) % m, y = z[b].type, ee(b), q(n.value);
|
|
1687
1690
|
}
|
|
1688
1691
|
}
|
|
1689
1692
|
return () => k("div", {
|
|
@@ -1694,7 +1697,7 @@ const zt = {
|
|
|
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,58 +1709,58 @@ 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,
|
|
1713
1716
|
color: t.value,
|
|
1714
1717
|
"onUpdate:color": (w) => t.value = w
|
|
1715
1718
|
}, null)]), k(et, {
|
|
1716
|
-
style:
|
|
1717
|
-
randomId:
|
|
1719
|
+
style: ie.value,
|
|
1720
|
+
randomId: d,
|
|
1718
1721
|
allowColorNull: u.value,
|
|
1719
1722
|
color: t.value,
|
|
1720
1723
|
"onUpdate:color": (w) => t.value = w
|
|
1721
1724
|
}, null), k("div", {
|
|
1722
1725
|
class: "input-btn",
|
|
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
1733
|
"onUpdate:modelValue": (w) => O.value = w,
|
|
1731
1734
|
style: "float:none"
|
|
1732
|
-
}, null), [[
|
|
1735
|
+
}, null), [[Ye, O.value]]), X(k("div", {
|
|
1733
1736
|
class: "type-icon-btn-wrapper",
|
|
1734
1737
|
style: "cursor:pointer"
|
|
1735
1738
|
}, [k("span", {
|
|
1736
1739
|
class: "f-icon f-icon-arrow-60-up type-icon-btn",
|
|
1737
|
-
onClick: () =>
|
|
1740
|
+
onClick: () => Q("up")
|
|
1738
1741
|
}, null), k("span", {
|
|
1739
1742
|
class: "f-icon f-icon-arrow-60-down type-icon-btn",
|
|
1740
|
-
onClick: () =>
|
|
1741
|
-
}, null)]), [[
|
|
1743
|
+
onClick: () => Q("down")
|
|
1744
|
+
}, null)]), [[Z, W]]), k("div", {
|
|
1742
1745
|
class: "input-btn"
|
|
1743
1746
|
}, [k("button", {
|
|
1744
1747
|
id: "farris-color-picker-plus-sure",
|
|
1745
1748
|
class: "btn btn-secondary",
|
|
1746
1749
|
onClick: (w) => ge(w)
|
|
1747
|
-
}, [
|
|
1750
|
+
}, [Be("确定")])])]), X(k(tt, {
|
|
1748
1751
|
color: t.value,
|
|
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), [[
|
|
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", {
|
|
@@ -1766,208 +1769,206 @@ const zt = {
|
|
|
1766
1769
|
}, [k("div", {
|
|
1767
1770
|
class: "color-picker-trigger-inner"
|
|
1768
1771
|
}, [k("div", {
|
|
1769
|
-
style:
|
|
1772
|
+
style: he.value
|
|
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 M(
|
|
1819
|
-
const x = String(H.getAttribute("data-controltype")), V = H.getAttribute("data-feature"), D = V ? JSON.parse(V) : {};
|
|
1820
|
-
D.parentComponentInstance = u.value;
|
|
1821
|
-
let G = ke(x, D);
|
|
1822
|
-
const C = x.toLowerCase().replace("-", "_");
|
|
1823
|
-
return G && !G.id && G.type === x && (G.id = `${C}_${Math.random().toString().slice(2, 6)}`), G;
|
|
1819
|
+
function M(P) {
|
|
1824
1820
|
}
|
|
1825
|
-
function
|
|
1821
|
+
function H(...P) {
|
|
1826
1822
|
}
|
|
1827
|
-
function
|
|
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
|
+
});
|
|
1828
1831
|
}
|
|
1829
|
-
return
|
|
1830
|
-
canMove:
|
|
1831
|
-
canSelectParent:
|
|
1832
|
-
canDelete:
|
|
1833
|
-
canNested: !
|
|
1832
|
+
return l.value = {
|
|
1833
|
+
canMove: u(),
|
|
1834
|
+
canSelectParent: c(),
|
|
1835
|
+
canDelete: g(),
|
|
1836
|
+
canNested: !h(),
|
|
1834
1837
|
contents: e == null ? void 0 : e.schema.contents,
|
|
1835
1838
|
elementRef: r,
|
|
1836
|
-
parent: (
|
|
1839
|
+
parent: (N = e == null ? void 0 : e.parent) == null ? void 0 : N.componentInstance,
|
|
1837
1840
|
schema: e == null ? void 0 : e.schema,
|
|
1838
|
-
styles:
|
|
1839
|
-
designerClass:
|
|
1840
|
-
canAccepts:
|
|
1841
|
-
getBelongedComponentInstance:
|
|
1841
|
+
styles: n,
|
|
1842
|
+
designerClass: i,
|
|
1843
|
+
canAccepts: d,
|
|
1844
|
+
getBelongedComponentInstance: p,
|
|
1842
1845
|
getDraggableDesignItemElement: f,
|
|
1843
|
-
getDraggingDisplayText:
|
|
1844
|
-
getPropConfig:
|
|
1845
|
-
getDragScopeElement:
|
|
1846
|
-
onAcceptMovedChildElement:
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
addNewChildComponentSchema: E,
|
|
1850
|
-
updateDragAndDropRules: n,
|
|
1846
|
+
getDraggingDisplayText: b,
|
|
1847
|
+
getPropConfig: H,
|
|
1848
|
+
getDragScopeElement: y,
|
|
1849
|
+
onAcceptMovedChildElement: v,
|
|
1850
|
+
onChildElementMovedOut: M,
|
|
1851
|
+
addNewChildComponentSchema: $,
|
|
1851
1852
|
triggerBelongedComponentToMoveWhenMoved: S(!1),
|
|
1852
|
-
triggerBelongedComponentToDeleteWhenDeleted: S(!1)
|
|
1853
|
-
|
|
1853
|
+
triggerBelongedComponentToDeleteWhenDeleted: S(!1),
|
|
1854
|
+
onRemoveComponent: j
|
|
1855
|
+
}, l;
|
|
1854
1856
|
}
|
|
1855
|
-
const
|
|
1857
|
+
const Tt = /* @__PURE__ */ T({
|
|
1856
1858
|
name: "FColorPickerDesign",
|
|
1857
|
-
props:
|
|
1859
|
+
props: $e,
|
|
1858
1860
|
emits: ["valueChanged", "activeChange", "update:color", "update:hue"],
|
|
1859
1861
|
setup(r, e) {
|
|
1860
|
-
const t = S(new
|
|
1861
|
-
let b = -1, y
|
|
1862
|
-
const $ = S(r.color);
|
|
1863
|
-
let
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1866
|
-
|
|
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);
|
|
1867
|
+
C(() => {
|
|
1868
|
+
P.value.componentInstance = O;
|
|
1867
1869
|
}), e.expose(O.value);
|
|
1868
|
-
|
|
1869
|
-
const V = U({
|
|
1870
|
+
const A = U(() => !y && v && v.initType ? v.initType : y), I = U({
|
|
1870
1871
|
get() {
|
|
1871
|
-
return y && n.value !== null ? (
|
|
1872
|
+
return y && n.value !== null ? (Q(y), x(new E(n.value), R[y])) : n.value;
|
|
1872
1873
|
},
|
|
1873
1874
|
set(m) {
|
|
1874
|
-
m !== null && (L(m),
|
|
1875
|
+
m !== null && (L(m), q(m));
|
|
1875
1876
|
}
|
|
1876
|
-
}),
|
|
1877
|
+
}), W = S(I.value), he = U(() => b > -1), ie = U(() => c.value.length > 0), z = U(() => ({
|
|
1877
1878
|
"background-color": l.value
|
|
1878
|
-
})), pe = U(() => h.value && g.value ? "display:flex" : "display:none"),
|
|
1879
|
+
})), pe = U(() => h.value && g.value ? "display:flex" : "display:none"), G = [{
|
|
1879
1880
|
text: "HEX",
|
|
1880
1881
|
type: R.hex
|
|
1881
1882
|
}, {
|
|
1882
1883
|
text: "RGBA",
|
|
1883
1884
|
type: R.rgba
|
|
1884
1885
|
}];
|
|
1885
|
-
function
|
|
1886
|
+
function fe() {
|
|
1886
1887
|
const m = document.getElementById("farris-color-picker-panel");
|
|
1887
|
-
m.id = `farris-color-picker-panel-${
|
|
1888
|
+
m.id = `farris-color-picker-panel-${d}`;
|
|
1888
1889
|
const B = document.getElementById("farris-color-picker-plus-sure");
|
|
1889
|
-
B.id = `farris-color-picker-plus-sure-${
|
|
1890
|
-
const
|
|
1891
|
-
|
|
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";
|
|
1892
1893
|
}
|
|
1893
|
-
function
|
|
1894
|
+
function se() {
|
|
1894
1895
|
if (!u.value && !n.value) {
|
|
1895
|
-
document.getElementById(`farris-color-picker-plus-sure-${
|
|
1896
|
-
const B = document.getElementById(`farris-color-picker-plus-input-${
|
|
1896
|
+
document.getElementById(`farris-color-picker-plus-sure-${d}`).classList.toggle("disabled");
|
|
1897
|
+
const B = document.getElementById(`farris-color-picker-plus-input-${d}`);
|
|
1897
1898
|
B.style.borderColor = "red";
|
|
1898
1899
|
}
|
|
1899
1900
|
}
|
|
1900
|
-
function
|
|
1901
|
-
n.value && (L(n.value), !n.value && u.value || (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));
|
|
1902
1903
|
}
|
|
1903
|
-
function
|
|
1904
|
-
n.value && L(n.value), v.hasPresets() || v.setColorPresets(c.value), n.value ? l.value =
|
|
1904
|
+
function ee() {
|
|
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);
|
|
1905
1906
|
}
|
|
1906
1907
|
function ve() {
|
|
1907
1908
|
v.valueChanges.subscribe((m) => {
|
|
1908
|
-
const B =
|
|
1909
|
+
const B = x(m, R[y || v.initType]);
|
|
1909
1910
|
n.value = B;
|
|
1910
1911
|
});
|
|
1911
1912
|
}
|
|
1912
|
-
function
|
|
1913
|
-
|
|
1913
|
+
function J(m) {
|
|
1914
|
+
f.value = G[m].text;
|
|
1914
1915
|
}
|
|
1915
1916
|
function ge() {
|
|
1916
1917
|
var m;
|
|
1917
1918
|
h.value = !!(y != null && y.includes("a") || (m = v.initType) != null && m.includes("a"));
|
|
1918
1919
|
}
|
|
1919
|
-
|
|
1920
|
+
qe(() => {
|
|
1920
1921
|
v.setColorPresets(c.value || ["#eaecf3"]);
|
|
1921
|
-
}),
|
|
1922
|
-
|
|
1923
|
-
}),
|
|
1924
|
-
ve(),
|
|
1925
|
-
}),
|
|
1926
|
-
|
|
1927
|
-
}),
|
|
1928
|
-
n.value =
|
|
1922
|
+
}), C(() => {
|
|
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();
|
|
1926
|
+
}), F(n, (m) => {
|
|
1927
|
+
x(v.value, v.initType) !== m && m !== null && L(m), J(Q(v.initType));
|
|
1928
|
+
}), F(t, (m) => {
|
|
1929
|
+
n.value = x(m, R[y || v.initType]), L(n.value), I.value = n.value;
|
|
1929
1930
|
});
|
|
1930
|
-
function
|
|
1931
|
-
const B = document.getElementById(`farris-color-picker-plus-input-${
|
|
1932
|
-
(m
|
|
1931
|
+
function q(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");
|
|
1933
1934
|
}
|
|
1934
1935
|
function ye() {
|
|
1935
1936
|
var m, B;
|
|
1936
1937
|
if (u.value) {
|
|
1937
1938
|
l.value = (n == null ? void 0 : n.value) ?? null;
|
|
1938
|
-
const
|
|
1939
|
+
const D = {
|
|
1939
1940
|
elementValue: l
|
|
1940
1941
|
};
|
|
1941
|
-
e.emit("valueChanged",
|
|
1942
|
+
e.emit("valueChanged", D), M.classList.toggle("disabled");
|
|
1942
1943
|
}
|
|
1943
|
-
if (!u.value && !(
|
|
1944
|
-
(B = (m =
|
|
1945
|
-
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 = {
|
|
1946
1947
|
elementValue: l
|
|
1947
1948
|
};
|
|
1948
|
-
e.emit("valueChanged",
|
|
1949
|
+
e.emit("valueChanged", D), M.classList.toggle("disabled");
|
|
1949
1950
|
}
|
|
1950
|
-
!$.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);
|
|
1951
1952
|
}
|
|
1952
1953
|
function L(m) {
|
|
1953
|
-
v == null || v.setValueFrom(m,
|
|
1954
|
+
v == null || v.setValueFrom(m, d, u.value);
|
|
1954
1955
|
}
|
|
1955
|
-
function
|
|
1956
|
-
i.value || (g.value = !0,
|
|
1956
|
+
function te(m) {
|
|
1957
|
+
i.value || (g.value = !0, M.classList.toggle("disabled"), se(), L(n.value));
|
|
1957
1958
|
}
|
|
1958
|
-
function
|
|
1959
|
-
const B =
|
|
1959
|
+
function Q(m) {
|
|
1960
|
+
const B = G.findIndex((D) => D.type === m);
|
|
1960
1961
|
return b = B, B;
|
|
1961
1962
|
}
|
|
1962
1963
|
function w(m) {
|
|
1963
|
-
if (!
|
|
1964
|
-
const B =
|
|
1965
|
-
b = (B + b + (m === "up" ? 1 : -1)) % B, y =
|
|
1964
|
+
if (!H.classList.contains("disabled")) {
|
|
1965
|
+
const B = G.length;
|
|
1966
|
+
b = (B + b + (m === "up" ? 1 : -1)) % B, y = G[b].type, J(b), L(n.value);
|
|
1966
1967
|
}
|
|
1967
1968
|
}
|
|
1968
1969
|
return () => k("div", {
|
|
1969
1970
|
class: "f-color-picker-component",
|
|
1970
|
-
ref:
|
|
1971
|
+
ref: P
|
|
1971
1972
|
}, [k("div", {
|
|
1972
1973
|
class: ["color-picker-panel", {
|
|
1973
1974
|
disabled: i.value
|
|
@@ -1985,7 +1986,7 @@ const Kt = /* @__PURE__ */ ee({
|
|
|
1985
1986
|
color: t.value,
|
|
1986
1987
|
"onUpdate:color": (m) => t.value = m
|
|
1987
1988
|
}, null), k(Te, {
|
|
1988
|
-
randomId:
|
|
1989
|
+
randomId: d,
|
|
1989
1990
|
hue: v.hue,
|
|
1990
1991
|
"onUpdate:hue": (m) => v.hue = m,
|
|
1991
1992
|
allowColorNull: u.value,
|
|
@@ -1993,21 +1994,22 @@ const Kt = /* @__PURE__ */ ee({
|
|
|
1993
1994
|
"onUpdate:color": (m) => t.value = m
|
|
1994
1995
|
}, null)]), k(et, {
|
|
1995
1996
|
style: pe.value,
|
|
1996
|
-
randomId:
|
|
1997
|
+
randomId: d,
|
|
1997
1998
|
allowColorNull: u.value,
|
|
1998
1999
|
color: t.value,
|
|
1999
2000
|
"onUpdate:color": (m) => t.value = m
|
|
2000
2001
|
}, null), k("div", {
|
|
2001
2002
|
class: "input-btn",
|
|
2002
2003
|
style: "display:flex;align-items: center;"
|
|
2003
|
-
}, [
|
|
2004
|
+
}, [X(k("span", {
|
|
2004
2005
|
style: "width:40px;margin-right:10px;"
|
|
2005
|
-
}, [
|
|
2006
|
+
}, [f.value]), [[Z, ie]]), X(k("input", {
|
|
2007
|
+
title: "color-picker-plus-input",
|
|
2006
2008
|
type: "text",
|
|
2007
2009
|
id: "farris-color-picker-plus-input",
|
|
2008
|
-
"onUpdate:modelValue": (m) =>
|
|
2010
|
+
"onUpdate:modelValue": (m) => I.value = m,
|
|
2009
2011
|
style: "float:none"
|
|
2010
|
-
}, null), [[
|
|
2012
|
+
}, null), [[Ye, I.value]]), X(k("div", {
|
|
2011
2013
|
class: "type-icon-btn-wrapper",
|
|
2012
2014
|
style: "cursor:pointer"
|
|
2013
2015
|
}, [k("span", {
|
|
@@ -2016,50 +2018,45 @@ const Kt = /* @__PURE__ */ ee({
|
|
|
2016
2018
|
}, null), k("span", {
|
|
2017
2019
|
class: "f-icon f-icon-arrow-60-down type-icon-btn",
|
|
2018
2020
|
onClick: () => w("down")
|
|
2019
|
-
}, null)]), [[
|
|
2021
|
+
}, null)]), [[Z, ie]]), k("div", {
|
|
2020
2022
|
class: "input-btn"
|
|
2021
2023
|
}, [k("button", {
|
|
2022
2024
|
id: "farris-color-picker-plus-sure",
|
|
2023
2025
|
class: "btn btn-secondary",
|
|
2024
2026
|
onClick: ye
|
|
2025
|
-
}, [
|
|
2027
|
+
}, [Be("确定")])])]), X(k(tt, {
|
|
2026
2028
|
color: t.value,
|
|
2027
2029
|
"onUpdate:color": (m) => t.value = m,
|
|
2028
2030
|
colorPresets: v.presets,
|
|
2029
2031
|
hue: v.hue,
|
|
2030
2032
|
"onUpdate:hue": (m) => v.hue = m,
|
|
2031
|
-
randomId:
|
|
2032
|
-
}, null), [[
|
|
2033
|
+
randomId: d
|
|
2034
|
+
}, null), [[Z, he]])]), k("div", {
|
|
2033
2035
|
class: "color-picker-wrapper"
|
|
2034
2036
|
}, [k("input", {
|
|
2035
2037
|
type: "text",
|
|
2036
2038
|
class: "color-picker-input form-control",
|
|
2037
|
-
value:
|
|
2039
|
+
value: W.value,
|
|
2038
2040
|
readonly: i.value,
|
|
2039
2041
|
onClick: (m) => m.stopPropagation()
|
|
2040
2042
|
}, null), k("div", {
|
|
2041
2043
|
class: "color-picker-trigger",
|
|
2042
|
-
onClick:
|
|
2044
|
+
onClick: te
|
|
2043
2045
|
}, [k("div", {
|
|
2044
2046
|
class: "color-picker-trigger-inner"
|
|
2045
2047
|
}, [k("div", {
|
|
2046
|
-
style:
|
|
2048
|
+
style: z.value
|
|
2047
2049
|
}, null)])])])]);
|
|
2048
2050
|
}
|
|
2049
|
-
})
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
t.component(e.name, r);
|
|
2053
|
-
}, r;
|
|
2054
|
-
};
|
|
2055
|
-
le.register = (r, e, t) => {
|
|
2056
|
-
r["color-picker"] = le, e["color-picker"] = ze;
|
|
2051
|
+
});
|
|
2052
|
+
ue.register = (r, e, t) => {
|
|
2053
|
+
r["color-picker"] = ue, e["color-picker"] = ze;
|
|
2057
2054
|
};
|
|
2058
|
-
|
|
2059
|
-
r["color-picker"] =
|
|
2055
|
+
ue.registerDesigner = (r, e, t) => {
|
|
2056
|
+
r["color-picker"] = Tt, e["color-picker"] = ze;
|
|
2060
2057
|
};
|
|
2061
|
-
const
|
|
2058
|
+
const rn = at(ue);
|
|
2062
2059
|
export {
|
|
2063
|
-
|
|
2064
|
-
|
|
2060
|
+
ue as FColorPicker,
|
|
2061
|
+
rn as default
|
|
2065
2062
|
};
|