@farris/ui-vue 1.2.9 → 1.3.1
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 +64 -64
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +521 -336
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +99 -97
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +496 -504
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +251 -259
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +696 -519
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +368 -376
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1141 -340
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +116 -116
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +986 -798
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +463 -998
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2233 -1057
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +335 -1002
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6193 -4702
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4562 -3294
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3420 -2623
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +914 -883
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +204 -212
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2795 -1835
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +180 -130
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +328 -336
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3349 -3626
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5344 -8588
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +2179 -2227
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +684 -675
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +482 -490
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +746 -569
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +409 -385
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +348 -1019
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3606 -2388
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10871 -8970
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +6019 -5631
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +912 -1281
- package/components/nav/index.umd.cjs +3 -3
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +660 -484
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +682 -506
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1848 -1658
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1120 -1923
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +875 -1214
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +229 -237
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +2314 -1521
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +867 -868
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +4332 -3623
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +613 -437
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +255 -263
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +144 -152
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1101 -1038
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +935 -1750
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +5264 -5677
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +151 -154
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +438 -1125
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +93 -101
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +563 -1202
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +248 -256
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +549 -373
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +2436 -3110
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +328 -336
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +339 -347
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +554 -378
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1322 -1144
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +537 -543
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5113 -9426
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3900 -2677
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +568 -570
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +266 -274
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +553 -1052
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +558 -566
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +22009 -22688
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/directive/area-response.d.ts +10 -0
- 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 +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/condition/src/types.d.ts +2 -1
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +11 -5
- package/types/data-grid/src/data-grid.component.d.ts +4 -2
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- 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 +19 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/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 +2 -3
- package/types/designer-canvas/src/types.d.ts +2 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +1 -1
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/index.d.ts +2 -0
- 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/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- 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 +2 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/{data-grid/src/designer/use-group-column.d.ts → query-solution/src/designer/query-solution-config/composition/use-property.d.ts} +4 -5
- 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/property-config/query-solution.property-config.d.ts +60 -0
- package/types/query-solution/src/solutions.d.ts +108 -509
- package/types/response-layout-editor/index.d.ts +3 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- 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/section/src/designer/use-designer-rules.d.ts +3 -3
- 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/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/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- 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/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1,102 +1,102 @@
|
|
|
1
1
|
var ee = Object.defineProperty;
|
|
2
|
-
var te = (
|
|
3
|
-
var
|
|
4
|
-
import { computed as
|
|
5
|
-
import { cloneDeep as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
const { properties:
|
|
11
|
-
return (!
|
|
2
|
+
var te = (e, n, t) => n in e ? ee(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var v = (e, n, t) => te(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { computed as F, ref as B, createVNode as E, onMounted as x, nextTick as j, defineComponent as q, watch as L, inject as W } from "vue";
|
|
5
|
+
import { isPlainObject as G, cloneDeep as z } from "lodash-es";
|
|
6
|
+
import N from "bignumber.js";
|
|
7
|
+
import { DgControl as $ } from "../designer-canvas/index.esm.js";
|
|
8
|
+
const Z = {}, X = {};
|
|
9
|
+
function O(e) {
|
|
10
|
+
const { properties: n, title: t, ignore: r } = e, i = r && Array.isArray(r), s = Object.keys(n).reduce((u, p) => ((!i || !r.find((d) => d == p)) && (u[p] = n[p].type === "object" && n[p].properties ? O(n[p]) : z(n[p].default)), u), {});
|
|
11
|
+
return t && (!i || !r.find((u) => u == "id")) && (s.id = `${t}-${Date.now()}`), s;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const r =
|
|
13
|
+
function J(e, n = {}, t) {
|
|
14
|
+
const r = Z[e];
|
|
15
15
|
if (r) {
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
return
|
|
16
|
+
let i = O(r);
|
|
17
|
+
const s = X[e];
|
|
18
|
+
return i = s ? s({ getSchemaByType: J }, i, n, t) : i, i;
|
|
19
19
|
}
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return Object.keys(
|
|
22
|
+
function ne(e, n) {
|
|
23
|
+
const t = O(n);
|
|
24
|
+
return Object.keys(e).reduce((r, i) => (r[i] && G(r[i]) && G(e[i]) ? Object.assign(r[i], e[i]) : r[i] = e[i], r), t), t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return Object.keys(
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
30
|
-
if (typeof
|
|
31
|
-
r[
|
|
26
|
+
function oe(e, n) {
|
|
27
|
+
return Object.keys(e).filter((r) => e[r] != null).reduce((r, i) => {
|
|
28
|
+
if (n.has(i)) {
|
|
29
|
+
const s = n.get(i);
|
|
30
|
+
if (typeof s == "string")
|
|
31
|
+
r[s] = e[i];
|
|
32
32
|
else {
|
|
33
|
-
const u =
|
|
33
|
+
const u = s(i, e[i], e);
|
|
34
34
|
Object.assign(r, u);
|
|
35
35
|
}
|
|
36
36
|
} else
|
|
37
|
-
r[
|
|
37
|
+
r[i] = e[i];
|
|
38
38
|
return r;
|
|
39
39
|
}, {});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const r =
|
|
43
|
-
return
|
|
41
|
+
function re(e, n, t = /* @__PURE__ */ new Map()) {
|
|
42
|
+
const r = ne(e, n);
|
|
43
|
+
return oe(r, t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
function
|
|
47
|
-
if (typeof
|
|
48
|
-
return
|
|
49
|
-
if (typeof
|
|
50
|
-
const f = Object.keys(
|
|
45
|
+
function ie(e = {}) {
|
|
46
|
+
function n(a, l, o, c) {
|
|
47
|
+
if (typeof o == "number")
|
|
48
|
+
return c[a].length === o;
|
|
49
|
+
if (typeof o == "object") {
|
|
50
|
+
const f = Object.keys(o)[0], m = o[f];
|
|
51
51
|
if (f === "not")
|
|
52
|
-
return Number(
|
|
52
|
+
return Number(c[a].length) !== Number(m);
|
|
53
53
|
if (f === "moreThan")
|
|
54
|
-
return Number(
|
|
54
|
+
return Number(c[a].length) >= Number(m);
|
|
55
55
|
if (f === "lessThan")
|
|
56
|
-
return Number(
|
|
56
|
+
return Number(c[a].length) <= Number(m);
|
|
57
57
|
}
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
60
|
+
function t(a, l, o, c) {
|
|
61
|
+
return c[a] && c[a].propertyValue && String(c[a].propertyValue.value) === String(o);
|
|
62
62
|
}
|
|
63
63
|
const r = /* @__PURE__ */ new Map([
|
|
64
|
-
["length",
|
|
65
|
-
["getProperty",
|
|
64
|
+
["length", n],
|
|
65
|
+
["getProperty", t]
|
|
66
66
|
]);
|
|
67
|
-
Object.keys(
|
|
68
|
-
function
|
|
69
|
-
const
|
|
70
|
-
return typeof
|
|
71
|
-
if (
|
|
72
|
-
return { target:
|
|
73
|
-
const f =
|
|
74
|
-
return { target:
|
|
67
|
+
Object.keys(e).reduce((a, l) => (a.set(l, e[l]), a), r);
|
|
68
|
+
function i(a, l) {
|
|
69
|
+
const o = a;
|
|
70
|
+
return typeof l == "number" ? [{ target: o, operator: "length", param: null, value: Number(l) }] : typeof l == "boolean" ? [{ target: o, operator: "getProperty", param: a, value: !!l }] : typeof l == "object" ? Object.keys(l).map((c) => {
|
|
71
|
+
if (c === "length")
|
|
72
|
+
return { target: o, operator: "length", param: null, value: l[c] };
|
|
73
|
+
const f = c, m = l[c];
|
|
74
|
+
return { target: o, operator: "getProperty", param: f, value: m };
|
|
75
75
|
}) : [];
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return Object.keys(
|
|
79
|
-
const f =
|
|
80
|
-
return
|
|
77
|
+
function s(a) {
|
|
78
|
+
return Object.keys(a).reduce((o, c) => {
|
|
79
|
+
const f = i(c, a[c]);
|
|
80
|
+
return o.push(...f), o;
|
|
81
81
|
}, []);
|
|
82
82
|
}
|
|
83
|
-
function u(
|
|
84
|
-
if (r.has(
|
|
85
|
-
const
|
|
86
|
-
return
|
|
83
|
+
function u(a, l) {
|
|
84
|
+
if (r.has(a.operator)) {
|
|
85
|
+
const o = r.get(a.operator);
|
|
86
|
+
return o && o(a.target, a.param, a.value, l) || !1;
|
|
87
87
|
}
|
|
88
88
|
return !1;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
90
|
+
function p(a, l) {
|
|
91
|
+
return s(a).reduce((f, m) => f && u(m, l), !0);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
return
|
|
93
|
+
function d(a, l) {
|
|
94
|
+
const o = Object.keys(a), c = o.includes("allOf"), f = o.includes("anyOf"), m = c || f, w = (m ? a[m ? c ? "allOf" : "anyOf" : "allOf"] : [a]).map((T) => p(T, l));
|
|
95
|
+
return c ? !w.includes(!1) : w.includes(!0);
|
|
96
96
|
}
|
|
97
|
-
return { parseValueSchema:
|
|
97
|
+
return { parseValueSchema: d };
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const y = {
|
|
100
100
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
101
101
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
102
102
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -133,21 +133,22 @@ const m = {
|
|
|
133
133
|
uploader: { type: "uploader", name: "附件上传", icon: "FileUpload" },
|
|
134
134
|
"page-header": { type: "page-header", name: "页头", icon: "Header" },
|
|
135
135
|
"page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
|
|
136
|
-
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" }
|
|
137
|
-
|
|
138
|
-
ae
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
136
|
+
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
137
|
+
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
|
|
138
|
+
}, ae = {}, le = {};
|
|
139
|
+
ie();
|
|
140
|
+
function se(e, n, t = /* @__PURE__ */ new Map(), r = (u, p, d) => p, i = {}, s = (u) => u) {
|
|
141
|
+
return Z[n.title] = n, X[n.title] = r, ae[n.title] = i, le[n.title] = s, (u = {}) => {
|
|
142
|
+
const p = re(u, n, t), d = Object.keys(e).reduce((a, l) => (a[l] = e[l].default, a), {});
|
|
143
|
+
return Object.assign(d, p);
|
|
143
144
|
};
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
-
return { customClass:
|
|
146
|
+
function ce(e, n) {
|
|
147
|
+
return { customClass: n.class, customStyle: n.style };
|
|
147
148
|
}
|
|
148
|
-
const
|
|
149
|
-
["appearance",
|
|
150
|
-
]),
|
|
149
|
+
const ue = /* @__PURE__ */ new Map([
|
|
150
|
+
["appearance", ce]
|
|
151
|
+
]), pe = "https://json-schema.org/draft/2020-12/schema", de = "https://farris-design.gitee.io/number-spinner.schema.json", me = "number-spinner", fe = "A Farris Input Component", ye = "object", ge = {
|
|
151
152
|
id: {
|
|
152
153
|
description: "The unique identifier for a number spinner",
|
|
153
154
|
type: "string"
|
|
@@ -251,24 +252,24 @@ const pe = /* @__PURE__ */ new Map([
|
|
|
251
252
|
}, he = [
|
|
252
253
|
"id",
|
|
253
254
|
"type"
|
|
254
|
-
],
|
|
255
|
+
], be = [
|
|
255
256
|
"id",
|
|
256
257
|
"appearance",
|
|
257
258
|
"binding"
|
|
258
|
-
],
|
|
259
|
-
$schema:
|
|
260
|
-
$id:
|
|
261
|
-
title:
|
|
262
|
-
description:
|
|
263
|
-
type:
|
|
264
|
-
properties:
|
|
259
|
+
], ve = {
|
|
260
|
+
$schema: pe,
|
|
261
|
+
$id: de,
|
|
262
|
+
title: me,
|
|
263
|
+
description: fe,
|
|
264
|
+
type: ye,
|
|
265
|
+
properties: ge,
|
|
265
266
|
required: he,
|
|
266
|
-
ignore:
|
|
267
|
+
ignore: be
|
|
267
268
|
};
|
|
268
|
-
function Ce(
|
|
269
|
-
return
|
|
269
|
+
function Ce(e, n, t) {
|
|
270
|
+
return n;
|
|
270
271
|
}
|
|
271
|
-
const
|
|
272
|
+
const U = {
|
|
272
273
|
/**
|
|
273
274
|
* 组件标识
|
|
274
275
|
*/
|
|
@@ -372,358 +373,349 @@ const q = {
|
|
|
372
373
|
* 作为内嵌编辑器被创建后默认选中文本
|
|
373
374
|
*/
|
|
374
375
|
selectOnCreated: { type: Boolean, default: !1 }
|
|
375
|
-
},
|
|
376
|
-
function
|
|
377
|
-
const { format:
|
|
378
|
-
function
|
|
379
|
-
const
|
|
380
|
-
return !(
|
|
381
|
-
}
|
|
382
|
-
function
|
|
383
|
-
const
|
|
384
|
-
return !(
|
|
385
|
-
}
|
|
386
|
-
function
|
|
387
|
-
if (
|
|
376
|
+
}, Q = se(U, ve, ue, Ce);
|
|
377
|
+
function Y(e, n, t, r) {
|
|
378
|
+
const { format: i } = t, { displayValue: s, getRealValue: u, modelValue: p, onNumberValueChanged: d } = r;
|
|
379
|
+
function a() {
|
|
380
|
+
const b = new N(p.value || 0);
|
|
381
|
+
return !(e.max && !new N(e.max).isNaN() && b.gte(new N(e.max)));
|
|
382
|
+
}
|
|
383
|
+
function l() {
|
|
384
|
+
const b = new N(p.value || 0);
|
|
385
|
+
return !(e.min && !new N(e.min).isNaN() && b.lte(new N(e.min)));
|
|
386
|
+
}
|
|
387
|
+
function o(b) {
|
|
388
|
+
if (e.readonly || e.disabled)
|
|
388
389
|
return;
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
const
|
|
392
|
-
|
|
390
|
+
const w = b === "up" ? a : l, S = b === "up" ? "plus" : "minus";
|
|
391
|
+
if (w()) {
|
|
392
|
+
const C = new N(p.value || 0)[S](Number(e.step)), h = C.toFixed();
|
|
393
|
+
s.value = i(h), d(u(C));
|
|
393
394
|
}
|
|
394
395
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
396
|
+
function c() {
|
|
397
|
+
o("up");
|
|
397
398
|
}
|
|
398
399
|
function f() {
|
|
399
|
-
|
|
400
|
+
o("down");
|
|
400
401
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
402
|
+
function m(b) {
|
|
403
|
+
c(), b.stopPropagation();
|
|
403
404
|
}
|
|
404
|
-
function
|
|
405
|
-
f(),
|
|
405
|
+
function g(b) {
|
|
406
|
+
f(), b.stopPropagation();
|
|
406
407
|
}
|
|
407
|
-
return { canDownward:
|
|
408
|
+
return { canDownward: l, canUpward: a, downward: f, onClickDownButton: g, onClickUpButton: m, upward: c };
|
|
408
409
|
}
|
|
409
|
-
function H(
|
|
410
|
-
const r =
|
|
411
|
-
prefix:
|
|
412
|
-
suffix:
|
|
413
|
-
decimalSeparator:
|
|
414
|
-
groupSeparator:
|
|
415
|
-
groupSize:
|
|
416
|
-
})), { getValidNumberObject:
|
|
417
|
-
function u(
|
|
418
|
-
return
|
|
419
|
-
}
|
|
420
|
-
function
|
|
421
|
-
return
|
|
422
|
-
}
|
|
423
|
-
function
|
|
424
|
-
const
|
|
425
|
-
return
|
|
426
|
-
}
|
|
427
|
-
return { cleanFormat: u, format:
|
|
410
|
+
function H(e, n, t) {
|
|
411
|
+
const r = F(() => ({
|
|
412
|
+
prefix: e.prefix,
|
|
413
|
+
suffix: e.suffix,
|
|
414
|
+
decimalSeparator: e.decimalSeparator,
|
|
415
|
+
groupSeparator: e.useThousands ? e.groupSeparator : "",
|
|
416
|
+
groupSize: e.groupSize
|
|
417
|
+
})), { getValidNumberObject: i, precision: s } = t;
|
|
418
|
+
function u(a) {
|
|
419
|
+
return a = a == null || a === "" ? "" : String(a), a = a.replace(new RegExp(e.prefix, "g"), "").replace(new RegExp(e.suffix, "g"), "").replace(/,/g, ""), e.groupSeparator && e.groupSeparator !== "," && (a = a.replace(new RegExp(`\\${e.groupSeparator}`, "g"), "")), e.decimalSeparator && e.decimalSeparator !== "." && (a = a.replace(new RegExp(`\\${e.decimalSeparator}`, "g"), ".")), a;
|
|
420
|
+
}
|
|
421
|
+
function p(a, l) {
|
|
422
|
+
return e.precision !== null && e.precision !== void 0 ? a.toFormat(s.value, l) : a.toFormat(l);
|
|
423
|
+
}
|
|
424
|
+
function d(a) {
|
|
425
|
+
const l = u(a), o = new N(l, 10), c = i(o);
|
|
426
|
+
return c.valueOf() === "0" && !e.showZero || c.isNaN() ? "" : e.formatter ? e.formatter(c.toNumber()) : p(c, r.value);
|
|
427
|
+
}
|
|
428
|
+
return { cleanFormat: u, format: d };
|
|
428
429
|
}
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
function
|
|
432
|
-
return
|
|
433
|
-
}
|
|
434
|
-
function u(
|
|
435
|
-
return isNaN(
|
|
436
|
-
}
|
|
437
|
-
function
|
|
438
|
-
const
|
|
439
|
-
return
|
|
440
|
-
}
|
|
441
|
-
function
|
|
442
|
-
if (
|
|
443
|
-
return isNaN(Number(
|
|
444
|
-
let
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
430
|
+
function _(e, n) {
|
|
431
|
+
const t = B(""), r = B(e.modelValue), i = F(() => Number(e.precision) || 0);
|
|
432
|
+
function s(l) {
|
|
433
|
+
return l.toFixed(i.value);
|
|
434
|
+
}
|
|
435
|
+
function u(l) {
|
|
436
|
+
return isNaN(l) || l === null || l === void 0 || l === "";
|
|
437
|
+
}
|
|
438
|
+
function p(l) {
|
|
439
|
+
const o = u(e.max) ? null : new N(String(e.max), 10), c = u(e.min) ? null : new N(String(e.min), 10);
|
|
440
|
+
return o && l.gt(o) ? o : c && l.lt(c) ? c : l;
|
|
441
|
+
}
|
|
442
|
+
function d(l) {
|
|
443
|
+
if (e.parser)
|
|
444
|
+
return isNaN(Number(l)) ? e.parser(l) : l;
|
|
445
|
+
let o = p(new N(l, 10));
|
|
446
|
+
if (o.isNaN()) {
|
|
447
|
+
if (e.canNull)
|
|
447
448
|
return null;
|
|
448
|
-
const f = new
|
|
449
|
+
const f = new N("" + e.min, 10), m = new N("" + e.max, 10);
|
|
449
450
|
if (!f.isNaN())
|
|
450
|
-
|
|
451
|
-
else if (!
|
|
452
|
-
|
|
451
|
+
o = f;
|
|
452
|
+
else if (!m.isNaN())
|
|
453
|
+
o = m;
|
|
453
454
|
else
|
|
454
455
|
return 0;
|
|
455
456
|
}
|
|
456
|
-
return
|
|
457
|
+
return s(o);
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
-
const
|
|
460
|
-
r.value =
|
|
459
|
+
function a(l) {
|
|
460
|
+
const o = Number(l);
|
|
461
|
+
r.value = o, n.emit("update:modelValue", o), n.emit("valueChange", o), n.emit("change", o);
|
|
461
462
|
}
|
|
462
|
-
return { displayValue:
|
|
463
|
+
return { displayValue: t, getRealValue: d, modelValue: r, isEmpty: u, onNumberValueChanged: a, precision: i, getValidNumberObject: p };
|
|
463
464
|
}
|
|
464
|
-
function
|
|
465
|
-
const { cleanFormat:
|
|
466
|
-
function
|
|
467
|
-
var
|
|
468
|
-
if (
|
|
465
|
+
function we(e, n, t, r, i) {
|
|
466
|
+
const { cleanFormat: s, format: u } = t, { displayValue: p, getRealValue: d, modelValue: a, isEmpty: l, onNumberValueChanged: o } = r, { downward: c, upward: f } = i, m = B(!1), g = F(() => p.value);
|
|
467
|
+
function b(C) {
|
|
468
|
+
var M;
|
|
469
|
+
if (C.stopPropagation(), m.value = !1, e.readonly || e.disabled)
|
|
469
470
|
return;
|
|
470
|
-
let
|
|
471
|
-
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
function
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
function
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
let
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
function
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
return { textBoxValue:
|
|
471
|
+
let h = (M = C.target) == null ? void 0 : M.value;
|
|
472
|
+
e.canNull || (h = h || 0);
|
|
473
|
+
const k = s(h);
|
|
474
|
+
p.value = u(k), o(d(k)), n.emit("blur", { event: C, formatted: p.value, value: a.value });
|
|
475
|
+
}
|
|
476
|
+
function w(C) {
|
|
477
|
+
C.stopPropagation(), m.value = !0, !(e.readonly || e.disabled) && (p.value = l(a.value) || !e.showZero && a.value === "0" ? "" : String(a.value), n.emit("focus", { event: C, formatted: p.value, value: a.value }));
|
|
478
|
+
}
|
|
479
|
+
function S(C) {
|
|
480
|
+
var M;
|
|
481
|
+
C.stopPropagation();
|
|
482
|
+
let h = (M = C.target) == null ? void 0 : M.value;
|
|
483
|
+
e.canNull || (h = h || 0);
|
|
484
|
+
const k = s(h);
|
|
485
|
+
p.value = k, o(d(k));
|
|
486
|
+
}
|
|
487
|
+
function T(C) {
|
|
488
|
+
C.key === "ArrowDown" && (C.preventDefault(), c()), C.key === "ArrowUp" && (C.preventDefault(), f()), C.stopPropagation();
|
|
489
|
+
}
|
|
490
|
+
return { textBoxValue: g, onBlurTextBox: b, onFocusTextBox: w, onInput: S, onKeyDown: T, isFocus: m };
|
|
490
491
|
}
|
|
491
|
-
function
|
|
492
|
+
function K(e, n, t) {
|
|
492
493
|
const {
|
|
493
494
|
canDownward: r,
|
|
494
|
-
canUpward:
|
|
495
|
-
onClickDownButton:
|
|
495
|
+
canUpward: i,
|
|
496
|
+
onClickDownButton: s,
|
|
496
497
|
onClickUpButton: u
|
|
497
|
-
} =
|
|
498
|
+
} = t, p = F(() => ({
|
|
498
499
|
"input-group-append": !0,
|
|
499
500
|
"btn-group": !0,
|
|
500
501
|
"btn-group-number": !0
|
|
501
|
-
})),
|
|
502
|
+
})), d = F(() => ({
|
|
502
503
|
btn: !0,
|
|
503
504
|
"btn-secondary": !0,
|
|
504
505
|
"btn-number-flag": !0
|
|
505
|
-
})),
|
|
506
|
-
cursor:
|
|
506
|
+
})), a = F(() => ({
|
|
507
|
+
cursor: i() ? "pointer" : "not-allowed",
|
|
507
508
|
"margin-left": 0
|
|
508
|
-
})),
|
|
509
|
+
})), l = F(() => ({
|
|
509
510
|
cursor: r() ? "pointer" : "not-allowed",
|
|
510
511
|
"margin-left": 0
|
|
511
512
|
}));
|
|
512
|
-
return () =>
|
|
513
|
-
class:
|
|
514
|
-
}, [
|
|
513
|
+
return () => E("div", {
|
|
514
|
+
class: p.value
|
|
515
|
+
}, [E("button", {
|
|
515
516
|
title: "upButton",
|
|
516
|
-
class:
|
|
517
|
-
style:
|
|
517
|
+
class: d.value,
|
|
518
|
+
style: a.value,
|
|
518
519
|
onClick: u,
|
|
519
|
-
disabled: !
|
|
520
|
-
}, [
|
|
520
|
+
disabled: !i()
|
|
521
|
+
}, [E("span", {
|
|
521
522
|
class: "f-icon f-icon-arrow-chevron-up number-arrow-chevron"
|
|
522
|
-
}, null)]),
|
|
523
|
+
}, null)]), E("button", {
|
|
523
524
|
title: "downButton",
|
|
524
|
-
class:
|
|
525
|
-
style:
|
|
526
|
-
onClick:
|
|
525
|
+
class: d.value,
|
|
526
|
+
style: l.value,
|
|
527
|
+
onClick: s,
|
|
527
528
|
disabled: !r()
|
|
528
|
-
}, [
|
|
529
|
+
}, [E("span", {
|
|
529
530
|
class: "f-icon f-icon-arrow-chevron-down number-arrow-chevron"
|
|
530
531
|
}, null)])]);
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
-
const r =
|
|
534
|
-
onBlurTextBox:
|
|
535
|
-
onFocusTextBox:
|
|
533
|
+
function Se(e, n, t) {
|
|
534
|
+
const r = B(), {
|
|
535
|
+
onBlurTextBox: i,
|
|
536
|
+
onFocusTextBox: s,
|
|
536
537
|
onInput: u,
|
|
537
|
-
onKeyDown:
|
|
538
|
-
textBoxValue:
|
|
539
|
-
} =
|
|
538
|
+
onKeyDown: p,
|
|
539
|
+
textBoxValue: d
|
|
540
|
+
} = t, a = F(() => e.disabled || e.readonly || !e.editable ? "" : e.placeholder), l = F(() => ({
|
|
540
541
|
"form-control": !0,
|
|
541
542
|
"f-utils-fill": !0
|
|
542
|
-
})),
|
|
543
|
-
"text-align":
|
|
543
|
+
})), o = F(() => ({
|
|
544
|
+
"text-align": e.textAlign
|
|
544
545
|
}));
|
|
545
|
-
function
|
|
546
|
-
|
|
546
|
+
function c(g) {
|
|
547
|
+
g.stopPropagation();
|
|
547
548
|
}
|
|
548
549
|
function f() {
|
|
549
|
-
|
|
550
|
+
e.selectOnCreated, e.focusOnCreated;
|
|
550
551
|
}
|
|
551
|
-
async function
|
|
552
|
-
|
|
552
|
+
async function m(g) {
|
|
553
|
+
s(g), await j, f();
|
|
553
554
|
}
|
|
554
|
-
return
|
|
555
|
-
await
|
|
556
|
-
}), () =>
|
|
555
|
+
return x(async () => {
|
|
556
|
+
await j, f();
|
|
557
|
+
}), () => E("input", {
|
|
557
558
|
ref: r,
|
|
558
|
-
class:
|
|
559
|
-
style:
|
|
559
|
+
class: l.value,
|
|
560
|
+
style: o.value,
|
|
560
561
|
type: "text",
|
|
561
|
-
value:
|
|
562
|
-
disabled:
|
|
563
|
-
readonly:
|
|
564
|
-
placeholder:
|
|
565
|
-
onBlur:
|
|
566
|
-
onChange:
|
|
567
|
-
onFocus:
|
|
562
|
+
value: d.value,
|
|
563
|
+
disabled: e.disabled,
|
|
564
|
+
readonly: e.readonly || !e.editable,
|
|
565
|
+
placeholder: a.value,
|
|
566
|
+
onBlur: i,
|
|
567
|
+
onChange: c,
|
|
568
|
+
onFocus: m,
|
|
568
569
|
onInput: u,
|
|
569
|
-
onKeydown:
|
|
570
|
+
onKeydown: p
|
|
570
571
|
}, null);
|
|
571
572
|
}
|
|
572
|
-
const
|
|
573
|
+
const P = /* @__PURE__ */ q({
|
|
573
574
|
name: "FNumberSpinner",
|
|
574
|
-
props:
|
|
575
|
+
props: U,
|
|
575
576
|
emits: ["update:modelValue", "valueChange", "change", "blur", "focus", "click", "input"],
|
|
576
|
-
setup(
|
|
577
|
-
const
|
|
578
|
-
displayValue:
|
|
579
|
-
modelValue:
|
|
580
|
-
getRealValue:
|
|
581
|
-
} =
|
|
582
|
-
format:
|
|
577
|
+
setup(e, n) {
|
|
578
|
+
const t = _(e, n), r = H(e, n, t), i = Y(e, n, r, t), s = we(e, n, r, t, i), u = K(e, n, i), {
|
|
579
|
+
displayValue: p,
|
|
580
|
+
modelValue: d,
|
|
581
|
+
getRealValue: a
|
|
582
|
+
} = t, l = Se(e, n, s), {
|
|
583
|
+
format: o
|
|
583
584
|
} = r, {
|
|
584
|
-
isFocus:
|
|
585
|
-
} =
|
|
586
|
-
return
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
}),
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
}),
|
|
593
|
-
|
|
594
|
-
}),
|
|
595
|
-
|
|
596
|
-
}), () =>
|
|
585
|
+
isFocus: c
|
|
586
|
+
} = s, f = F(() => !e.disabled && !e.readonly && e.showButton);
|
|
587
|
+
return x(() => {
|
|
588
|
+
const m = a(e.modelValue);
|
|
589
|
+
p.value = o(m);
|
|
590
|
+
}), L(() => [e.value], ([m]) => {
|
|
591
|
+
const g = a(m);
|
|
592
|
+
d.value = g, p.value = o(g);
|
|
593
|
+
}), L(() => [e.modelValue], ([m]) => {
|
|
594
|
+
m !== d.value && (d.value = m, !c.value && (p.value = o(a(m))));
|
|
595
|
+
}), L(() => [e.precision, e.useThousands, e.prefix, e.suffix, e.showZero], () => {
|
|
596
|
+
p.value = o(d.value);
|
|
597
|
+
}), () => E("div", {
|
|
597
598
|
class: "input-group f-state-hover flex-row f-cmp-number-spinner"
|
|
598
|
-
}, [
|
|
599
|
+
}, [l(), f.value && u()]);
|
|
599
600
|
}
|
|
600
601
|
});
|
|
601
|
-
function
|
|
602
|
-
var
|
|
602
|
+
function ke(e, n, t) {
|
|
603
|
+
var C;
|
|
603
604
|
function r() {
|
|
604
|
-
|
|
605
|
+
t != null && t.resolveComponentContext && t.resolveComponentContext();
|
|
605
606
|
}
|
|
606
607
|
r();
|
|
607
|
-
const
|
|
608
|
-
function
|
|
609
|
-
return (
|
|
608
|
+
const i = t && t.getStyles && t.getStyles() || "", s = t && t.getDesignerClass && t.getDesignerClass() || "", u = B();
|
|
609
|
+
function p() {
|
|
610
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
+
function d() {
|
|
612
613
|
return !1;
|
|
613
614
|
}
|
|
614
|
-
function
|
|
615
|
-
return (
|
|
615
|
+
function a() {
|
|
616
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanDeleteComponent ? t.checkCanDeleteComponent() : !0;
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
-
return (
|
|
618
|
+
function l() {
|
|
619
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !0 : t && t.hideNestedPaddingInDesginerView ? t.hideNestedPaddingInDesginerView() : !1;
|
|
619
620
|
}
|
|
620
|
-
function
|
|
621
|
-
if (!
|
|
621
|
+
function o(h) {
|
|
622
|
+
if (!h || !h.value)
|
|
622
623
|
return null;
|
|
623
|
-
if (
|
|
624
|
-
return
|
|
625
|
-
const
|
|
626
|
-
return
|
|
624
|
+
if (h.value.schema && h.value.schema.type === "component")
|
|
625
|
+
return h.value;
|
|
626
|
+
const k = B(h == null ? void 0 : h.value.parent), M = o(k);
|
|
627
|
+
return M || null;
|
|
627
628
|
}
|
|
628
|
-
function
|
|
629
|
-
const { componentInstance:
|
|
630
|
-
return !
|
|
629
|
+
function c(h = n) {
|
|
630
|
+
const { componentInstance: k, designerItemElementRef: M } = h;
|
|
631
|
+
return !k || !k.value ? null : k.value.canMove ? M : c(h.parent);
|
|
631
632
|
}
|
|
632
|
-
function f(
|
|
633
|
-
return !!
|
|
633
|
+
function f(h) {
|
|
634
|
+
return !!t && t.canAccepts(h);
|
|
634
635
|
}
|
|
635
|
-
function
|
|
636
|
-
return (
|
|
636
|
+
function m() {
|
|
637
|
+
return (n == null ? void 0 : n.schema.label) || (n == null ? void 0 : n.schema.title) || (n == null ? void 0 : n.schema.name);
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
+
function g() {
|
|
639
640
|
}
|
|
640
|
-
function
|
|
641
|
-
|
|
641
|
+
function b(h, k) {
|
|
642
|
+
k && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(k);
|
|
642
643
|
}
|
|
643
|
-
function
|
|
644
|
-
const { componentType:
|
|
645
|
-
let
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
-
return
|
|
644
|
+
function w(h, k) {
|
|
645
|
+
const { componentType: M } = h;
|
|
646
|
+
let V = J(M, h, k);
|
|
647
|
+
t && t.onResolveNewComponentSchema && (V = t.onResolveNewComponentSchema(h, V));
|
|
648
|
+
const A = M.toLowerCase().replace("-", "_");
|
|
649
|
+
return V && !V.id && V.type === M && (V.id = `${A}_${Math.random().toString().slice(2, 6)}`), V;
|
|
649
650
|
}
|
|
650
|
-
function
|
|
651
|
-
const B = String(g.getAttribute("data-controltype")), T = g.getAttribute("data-feature"), O = T ? JSON.parse(T) : {};
|
|
652
|
-
O.parentComponentInstance = u.value;
|
|
653
|
-
let x = $(B, O);
|
|
654
|
-
n && n.onAcceptNewChildElement && (x = n.onAcceptNewChildElement(g, h, x));
|
|
655
|
-
const K = B.toLowerCase().replace("-", "_");
|
|
656
|
-
return x && !x.id && x.type === B && (x.id = `${K}_${Math.random().toString().slice(2, 6)}`), x;
|
|
651
|
+
function S(h) {
|
|
657
652
|
}
|
|
658
|
-
function
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
if (n && n.getPropsConfig)
|
|
662
|
-
return n.getPropsConfig(...g);
|
|
653
|
+
function T(...h) {
|
|
654
|
+
if (t && t.getPropsConfig)
|
|
655
|
+
return t.getPropsConfig(...h);
|
|
663
656
|
}
|
|
664
657
|
return u.value = {
|
|
665
|
-
canMove:
|
|
666
|
-
canSelectParent:
|
|
667
|
-
canDelete:
|
|
668
|
-
canNested: !
|
|
669
|
-
contents:
|
|
670
|
-
elementRef:
|
|
671
|
-
parent: (
|
|
672
|
-
schema:
|
|
673
|
-
styles:
|
|
674
|
-
designerClass:
|
|
658
|
+
canMove: p(),
|
|
659
|
+
canSelectParent: d(),
|
|
660
|
+
canDelete: a(),
|
|
661
|
+
canNested: !l(),
|
|
662
|
+
contents: n == null ? void 0 : n.schema.contents,
|
|
663
|
+
elementRef: e,
|
|
664
|
+
parent: (C = n == null ? void 0 : n.parent) == null ? void 0 : C.componentInstance,
|
|
665
|
+
schema: n == null ? void 0 : n.schema,
|
|
666
|
+
styles: i,
|
|
667
|
+
designerClass: s,
|
|
675
668
|
canAccepts: f,
|
|
676
|
-
getBelongedComponentInstance:
|
|
677
|
-
getDraggableDesignItemElement:
|
|
678
|
-
getDraggingDisplayText:
|
|
679
|
-
getPropConfig:
|
|
680
|
-
getDragScopeElement:
|
|
681
|
-
onAcceptMovedChildElement:
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
addNewChildComponentSchema: F,
|
|
669
|
+
getBelongedComponentInstance: o,
|
|
670
|
+
getDraggableDesignItemElement: c,
|
|
671
|
+
getDraggingDisplayText: m,
|
|
672
|
+
getPropConfig: T,
|
|
673
|
+
getDragScopeElement: g,
|
|
674
|
+
onAcceptMovedChildElement: b,
|
|
675
|
+
onChildElementMovedOut: S,
|
|
676
|
+
addNewChildComponentSchema: w,
|
|
685
677
|
updateDragAndDropRules: r,
|
|
686
|
-
triggerBelongedComponentToMoveWhenMoved: !!
|
|
687
|
-
triggerBelongedComponentToDeleteWhenDeleted: !!
|
|
678
|
+
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || B(!1),
|
|
679
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || B(!1)
|
|
688
680
|
}, u;
|
|
689
681
|
}
|
|
690
|
-
class
|
|
691
|
-
constructor(
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
682
|
+
class Me {
|
|
683
|
+
constructor(n, t) {
|
|
684
|
+
v(this, "componentId");
|
|
685
|
+
v(this, "viewModelId");
|
|
686
|
+
v(this, "eventsEditorUtils");
|
|
687
|
+
v(this, "formSchemaUtils");
|
|
688
|
+
v(this, "formMetadataConverter");
|
|
689
|
+
v(this, "designViewModelUtils");
|
|
690
|
+
v(this, "designViewModelField");
|
|
691
|
+
v(this, "controlCreatorUtils");
|
|
692
|
+
v(this, "designerHostService");
|
|
693
|
+
v(this, "schemaService", null);
|
|
694
|
+
v(this, "metadataService", null);
|
|
695
|
+
v(this, "propertyConfig", {
|
|
704
696
|
type: "object",
|
|
705
697
|
categories: {}
|
|
706
698
|
});
|
|
707
699
|
var r;
|
|
708
|
-
this.componentId =
|
|
700
|
+
this.componentId = n, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((r = this.formSchemaUtils) == null ? void 0 : r.getViewModelIdByComponentId(n)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService;
|
|
709
701
|
}
|
|
710
702
|
getTableInfo() {
|
|
711
|
-
var
|
|
712
|
-
return (
|
|
703
|
+
var n;
|
|
704
|
+
return (n = this.schemaService) == null ? void 0 : n.getTableInfoByViewModelId(this.viewModelId);
|
|
713
705
|
}
|
|
714
|
-
setDesignViewModelField(
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
706
|
+
setDesignViewModelField(n) {
|
|
707
|
+
const t = n.binding && n.binding.type === "Form" && n.binding.field;
|
|
708
|
+
if (t) {
|
|
717
709
|
if (!this.designViewModelField) {
|
|
718
710
|
const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
719
|
-
this.designViewModelField = r.fields.find((
|
|
711
|
+
this.designViewModelField = r.fields.find((i) => i.id === t);
|
|
720
712
|
}
|
|
721
|
-
|
|
713
|
+
n.updateOn = this.designViewModelField.updateOn;
|
|
722
714
|
}
|
|
723
715
|
}
|
|
724
|
-
changeFieldEditorType(
|
|
716
|
+
changeFieldEditorType(n, t) {
|
|
725
717
|
}
|
|
726
|
-
getBasicPropConfig(
|
|
718
|
+
getBasicPropConfig(n) {
|
|
727
719
|
return {
|
|
728
720
|
description: "Basic Information",
|
|
729
721
|
title: "基本信息",
|
|
@@ -742,13 +734,13 @@ class Be {
|
|
|
742
734
|
type: "combo-list",
|
|
743
735
|
textField: "name",
|
|
744
736
|
valueField: "value",
|
|
745
|
-
data: [{ value:
|
|
737
|
+
data: [{ value: n.type, name: y[n.type].name }]
|
|
746
738
|
}
|
|
747
739
|
}
|
|
748
740
|
}
|
|
749
741
|
};
|
|
750
742
|
}
|
|
751
|
-
getAppearanceConfig(
|
|
743
|
+
getAppearanceConfig(n = null) {
|
|
752
744
|
return {
|
|
753
745
|
title: "样式",
|
|
754
746
|
description: "Appearance",
|
|
@@ -768,90 +760,212 @@ class Be {
|
|
|
768
760
|
}
|
|
769
761
|
};
|
|
770
762
|
}
|
|
763
|
+
/**
|
|
764
|
+
*
|
|
765
|
+
* @param propertyId
|
|
766
|
+
* @param componentInstance
|
|
767
|
+
* @returns
|
|
768
|
+
*/
|
|
769
|
+
updateElementByParentContainer(n, t) {
|
|
770
|
+
const r = t && t.parent && t.parent.schema;
|
|
771
|
+
if (!r)
|
|
772
|
+
return;
|
|
773
|
+
const i = r.contents.findIndex((u) => u.id === n), s = z(r.contents[i]);
|
|
774
|
+
r.contents.splice(i, 1), r.contents.splice(i, 0, s);
|
|
775
|
+
}
|
|
771
776
|
}
|
|
772
|
-
const
|
|
777
|
+
const D = class D {
|
|
773
778
|
/**
|
|
774
779
|
* 根据绑定字段类型获取可用的输入类控件
|
|
775
780
|
*/
|
|
776
|
-
static getEditorTypesByMDataType(
|
|
777
|
-
const
|
|
778
|
-
return
|
|
781
|
+
static getEditorTypesByMDataType(n) {
|
|
782
|
+
const t = D.fieldControlTypeMapping[n];
|
|
783
|
+
return t || [{ key: "", value: "" }];
|
|
779
784
|
}
|
|
780
785
|
/**
|
|
781
786
|
* 获取所有输入类控件
|
|
782
787
|
*/
|
|
783
788
|
static getAllInputTypes() {
|
|
784
|
-
const
|
|
785
|
-
for (let
|
|
786
|
-
|
|
787
|
-
|
|
789
|
+
const n = [];
|
|
790
|
+
for (let t in D.fieldControlTypeMapping)
|
|
791
|
+
D.fieldControlTypeMapping[t].forEach((r) => {
|
|
792
|
+
n.find((i) => i.key === r.key && i.value === r.value) || n.push({ key: r.key, value: r.value });
|
|
788
793
|
});
|
|
789
|
-
return
|
|
794
|
+
return n;
|
|
790
795
|
}
|
|
791
796
|
};
|
|
792
797
|
/**
|
|
793
798
|
* <字段类型,可配置的控件类型列表>的映射
|
|
794
799
|
*/
|
|
795
|
-
|
|
800
|
+
v(D, "fieldControlTypeMapping", {
|
|
796
801
|
String: [
|
|
797
|
-
{ key:
|
|
798
|
-
{ key:
|
|
799
|
-
{ key:
|
|
800
|
-
{ key:
|
|
801
|
-
{ key:
|
|
802
|
-
{ key:
|
|
803
|
-
{ key:
|
|
802
|
+
{ key: y["input-group"].type, value: y["input-group"].name },
|
|
803
|
+
{ key: y.lookup.type, value: y.lookup.name },
|
|
804
|
+
{ key: y["date-picker"].type, value: y["date-picker"].name },
|
|
805
|
+
{ key: y["check-box"].type, value: y["check-box"].name },
|
|
806
|
+
{ key: y["check-group"].type, value: y["check-group"].name },
|
|
807
|
+
{ key: y["radio-group"].type, value: y["radio-group"].name },
|
|
808
|
+
{ key: y["combo-list"].type, value: y["combo-list"].name },
|
|
809
|
+
{ key: y.textarea.type, value: y.textarea.name }
|
|
804
810
|
],
|
|
805
811
|
Text: [
|
|
806
|
-
{ key:
|
|
807
|
-
{ key:
|
|
812
|
+
{ key: y.textarea.type, value: y.textarea.name },
|
|
813
|
+
{ key: y.lookup.type, value: y.lookup.name }
|
|
808
814
|
],
|
|
809
815
|
Decimal: [
|
|
810
|
-
{ key:
|
|
816
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
811
817
|
],
|
|
812
818
|
Integer: [
|
|
813
|
-
{ key:
|
|
819
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
814
820
|
],
|
|
815
821
|
Number: [
|
|
816
|
-
{ key:
|
|
822
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
817
823
|
],
|
|
818
824
|
BigNumber: [
|
|
819
|
-
{ key:
|
|
825
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
820
826
|
],
|
|
821
827
|
Date: [
|
|
822
|
-
{ key:
|
|
828
|
+
{ key: y["date-picker"].type, value: y["date-picker"].name }
|
|
823
829
|
],
|
|
824
830
|
DateTime: [
|
|
825
|
-
{ key:
|
|
831
|
+
{ key: y["date-picker"].type, value: y["date-picker"].name }
|
|
826
832
|
],
|
|
827
833
|
Boolean: [
|
|
828
|
-
{ key:
|
|
829
|
-
{ key:
|
|
834
|
+
{ key: y.switch.type, value: y.switch.name },
|
|
835
|
+
{ key: y["check-box"].type, value: y["check-box"].name }
|
|
830
836
|
],
|
|
831
837
|
Enum: [
|
|
832
|
-
{ key:
|
|
833
|
-
{ key:
|
|
838
|
+
{ key: y["combo-list"].type, value: y["combo-list"].name },
|
|
839
|
+
{ key: y["radio-group"].type, value: y["radio-group"].name }
|
|
834
840
|
],
|
|
835
841
|
Object: [
|
|
836
|
-
{ key:
|
|
837
|
-
{ key:
|
|
838
|
-
{ key:
|
|
842
|
+
{ key: y.lookup.type, value: y.lookup.name },
|
|
843
|
+
{ key: y["combo-list"].type, value: y["combo-list"].name },
|
|
844
|
+
{ key: y["radio-group"].type, value: y["radio-group"].name }
|
|
839
845
|
]
|
|
840
846
|
});
|
|
841
|
-
let
|
|
842
|
-
const
|
|
843
|
-
class
|
|
844
|
-
constructor(
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
this
|
|
854
|
-
|
|
847
|
+
let I = D;
|
|
848
|
+
const Ne = B(0);
|
|
849
|
+
class Be {
|
|
850
|
+
constructor() {
|
|
851
|
+
/** 控件标题 */
|
|
852
|
+
v(this, "label", "");
|
|
853
|
+
/** 控件id */
|
|
854
|
+
v(this, "id", "");
|
|
855
|
+
/** 每个控件占用的栅格数 */
|
|
856
|
+
v(this, "columnInSM", 12);
|
|
857
|
+
v(this, "columnInMD", 6);
|
|
858
|
+
v(this, "columnInLG", 3);
|
|
859
|
+
v(this, "columnInEL", 2);
|
|
860
|
+
/** 每个控件占用的列数 */
|
|
861
|
+
v(this, "displayWidthInSM", 1);
|
|
862
|
+
v(this, "displayWidthInMD", 1);
|
|
863
|
+
v(this, "displayWidthInLG", 1);
|
|
864
|
+
v(this, "displayWidthInEL", 1);
|
|
865
|
+
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
|
|
866
|
+
v(this, "displayColumnCountAtBreakPoint", "md");
|
|
867
|
+
/** 控件所在行,传0即可-----编辑器内部使用 */
|
|
868
|
+
v(this, "tagRow", 0);
|
|
869
|
+
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
|
|
870
|
+
v(this, "showTopBorder", 0);
|
|
871
|
+
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
|
|
872
|
+
v(this, "group", 1);
|
|
873
|
+
/** 控件是否符合标准的class配置(设计器用的) */
|
|
874
|
+
v(this, "isSupportedClass", !0);
|
|
875
|
+
/** 控件所在分组id(设计器用的) */
|
|
876
|
+
v(this, "fieldSetId", "");
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
function Fe(e) {
|
|
880
|
+
let n, t;
|
|
881
|
+
const r = /* @__PURE__ */ new Map();
|
|
882
|
+
let i = [];
|
|
883
|
+
function s(l, o) {
|
|
884
|
+
const f = l.split(" ").filter((S) => S.startsWith("col-"));
|
|
885
|
+
if (f.length === 0) {
|
|
886
|
+
o.isSupportedClass = !1;
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
let m = f.find((S) => /^col-([1-9]|10|11|12)$/.test(S)), g = f.find((S) => /^col-md-([1-9]|10|11|12)$/.test(S)), b = f.find((S) => /^col-xl-([1-9]|10|11|12)$/.test(S)), w = f.find((S) => /^col-el-([1-9]|10|11|12)$/.test(S));
|
|
890
|
+
m = m || "col-12", o.columnInSM = parseInt(m.replace("col-", ""), 10), o.displayWidthInSM = o.columnInSM / 12, o.displayWidthInSM !== 1 && (o.isSupportedClass = !1), g = g || "col-md-" + o.columnInSM, o.columnInMD = parseInt(g.replace("col-md-", ""), 10), o.displayWidthInMD = o.columnInMD / 6, [1, 2].includes(o.displayWidthInMD) || (o.isSupportedClass = !1), b = b || "col-xl-" + o.columnInMD, o.columnInLG = parseInt(b.replace("col-xl-", ""), 10), o.displayWidthInLG = o.columnInLG / 3, [1, 2, 3, 4].includes(o.displayWidthInLG) || (o.isSupportedClass = !1), w = w || "col-el-" + o.columnInLG, o.columnInEL = parseInt(w.replace("col-el-", ""), 10), o.displayWidthInEL = o.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(o.displayWidthInEL) || (o.isSupportedClass = !1);
|
|
891
|
+
}
|
|
892
|
+
function u(l, o, c, f = !1) {
|
|
893
|
+
let m = !1;
|
|
894
|
+
l.contents.forEach((g) => {
|
|
895
|
+
if (g.type === "fieldset") {
|
|
896
|
+
c += 1, u(g, o, c, !0), m = !0;
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
m && (c += 1, m = !1);
|
|
900
|
+
const b = g.appearance && g.appearance.class, w = new Be();
|
|
901
|
+
b ? s(b, w) : w.isSupportedClass = !1, w.label = g.label || g.id, w.id = g.id, w.group = c, f && (w.fieldSetId = l.id), t === g.id && (n = c), r.set(g.id, g), o.push(w);
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
function p(l) {
|
|
905
|
+
const o = e.getComponentById(l);
|
|
906
|
+
if (!o || !o.componentType || !o.componentType.startsWith("form"))
|
|
907
|
+
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
908
|
+
const c = e.selectNode(o, (f) => f.type === $["response-form"].type);
|
|
909
|
+
return !c || !c.contents || c.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: c };
|
|
910
|
+
}
|
|
911
|
+
function d(l, o) {
|
|
912
|
+
o = o || l.id;
|
|
913
|
+
const { result: c, message: f, formNode: m } = p(o);
|
|
914
|
+
if (!c)
|
|
915
|
+
return { result: c, message: f };
|
|
916
|
+
t = l.id, i = [], r.clear();
|
|
917
|
+
const g = m.contents[0].type === $.fieldset.type ? 0 : 1;
|
|
918
|
+
u(m, i, g);
|
|
919
|
+
const b = i.find((S) => !S.isSupportedClass);
|
|
920
|
+
return {
|
|
921
|
+
defaultState: {
|
|
922
|
+
defaultGroupNumber: n || 1,
|
|
923
|
+
model: b ? "customize" : "standard"
|
|
924
|
+
},
|
|
925
|
+
importData: i
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
function a(l, o) {
|
|
929
|
+
o = o;
|
|
930
|
+
const { result: c, formNode: f } = p(o);
|
|
931
|
+
if (!c)
|
|
932
|
+
return "";
|
|
933
|
+
const m = [];
|
|
934
|
+
return l.forEach((g) => {
|
|
935
|
+
var S;
|
|
936
|
+
const b = r.get(g.id), w = b.appearance && b.appearance.class;
|
|
937
|
+
if (w) {
|
|
938
|
+
const C = w.split(" ").filter((R) => !R.startsWith("col-")), h = "col-" + g.columnInSM, k = "col-md-" + g.columnInMD, M = "col-xl-" + g.columnInLG, V = "col-el-" + g.columnInEL, A = [h, k, M, V].concat(C);
|
|
939
|
+
b.appearance.class = A.join(" ");
|
|
940
|
+
}
|
|
941
|
+
if (g.fieldSetId) {
|
|
942
|
+
const T = f.contents.find((h) => h.id === g.fieldSetId), C = m.find((h) => h.id === g.fieldSetId);
|
|
943
|
+
C ? (S = C.contents) == null || S.push(b) : (m.push(T), T.contents = [b]);
|
|
944
|
+
} else
|
|
945
|
+
m.push(b);
|
|
946
|
+
}), f.contents = m, f.id;
|
|
947
|
+
}
|
|
948
|
+
return {
|
|
949
|
+
checkCanFindFormNode: p,
|
|
950
|
+
checkCanOpenLayoutEditor: d,
|
|
951
|
+
changeFormControlsByResponseLayoutConfig: a,
|
|
952
|
+
getResonseFormLayoutConfig: u
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
class Te extends Me {
|
|
956
|
+
constructor(t, r) {
|
|
957
|
+
super(t, r);
|
|
958
|
+
v(this, "responseLayoutEditorFunction");
|
|
959
|
+
this.responseLayoutEditorFunction = Fe(this.formSchemaUtils);
|
|
960
|
+
}
|
|
961
|
+
getPropertyConfig(t, r) {
|
|
962
|
+
return this.propertyConfig.categories.basic = this.getBasicProperties(t, r), this.propertyConfig.categories.appearance = this.getAppearanceProperties(t, r), this.propertyConfig.categories.editor = this.getEditorProperties(t), this.propertyConfig;
|
|
963
|
+
}
|
|
964
|
+
getBasicProperties(t, r) {
|
|
965
|
+
var p;
|
|
966
|
+
var i = this;
|
|
967
|
+
this.setDesignViewModelField(t);
|
|
968
|
+
const s = this.formSchemaUtils.getFormMetadataBasicInfo(), u = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
|
|
855
969
|
return {
|
|
856
970
|
description: "Basic Information",
|
|
857
971
|
title: "基本信息",
|
|
@@ -873,7 +987,7 @@ class Te extends Be {
|
|
|
873
987
|
textField: "value",
|
|
874
988
|
valueField: "key",
|
|
875
989
|
editable: !1,
|
|
876
|
-
data:
|
|
990
|
+
data: i.designViewModelField ? I.getEditorTypesByMDataType((p = i.designViewModelField.type) == null ? void 0 : p.name) : I.getAllInputTypes()
|
|
877
991
|
}
|
|
878
992
|
},
|
|
879
993
|
label: {
|
|
@@ -889,8 +1003,8 @@ class Te extends Be {
|
|
|
889
1003
|
type: "field-selector",
|
|
890
1004
|
bindingType: { enable: !1 },
|
|
891
1005
|
editorParams: {
|
|
892
|
-
propertyData:
|
|
893
|
-
formBasicInfo:
|
|
1006
|
+
propertyData: t,
|
|
1007
|
+
formBasicInfo: s
|
|
894
1008
|
},
|
|
895
1009
|
columns: [
|
|
896
1010
|
{ field: "name", title: "字段名称" },
|
|
@@ -898,26 +1012,27 @@ class Te extends Be {
|
|
|
898
1012
|
{ field: "fieldType", title: "字段类型" }
|
|
899
1013
|
],
|
|
900
1014
|
textField: "bindingField",
|
|
901
|
-
data:
|
|
1015
|
+
data: u
|
|
902
1016
|
}
|
|
903
1017
|
}
|
|
904
1018
|
},
|
|
905
|
-
setPropertyRelates(
|
|
906
|
-
if (
|
|
907
|
-
switch (
|
|
1019
|
+
setPropertyRelates(d, a) {
|
|
1020
|
+
if (d)
|
|
1021
|
+
switch (d && d.propertyID) {
|
|
908
1022
|
case "type": {
|
|
909
|
-
|
|
1023
|
+
i.changeControlType(t, d, r);
|
|
910
1024
|
break;
|
|
911
1025
|
}
|
|
912
1026
|
case "label": {
|
|
913
|
-
|
|
1027
|
+
d.needRefreshControlTree = !0;
|
|
914
1028
|
break;
|
|
915
1029
|
}
|
|
916
1030
|
}
|
|
917
1031
|
}
|
|
918
1032
|
};
|
|
919
1033
|
}
|
|
920
|
-
getAppearanceProperties(
|
|
1034
|
+
getAppearanceProperties(t, r) {
|
|
1035
|
+
var i = this;
|
|
921
1036
|
return {
|
|
922
1037
|
title: "样式",
|
|
923
1038
|
description: "Appearance",
|
|
@@ -938,61 +1053,74 @@ class Te extends Be {
|
|
|
938
1053
|
description: "响应式列宽",
|
|
939
1054
|
title: "响应式列宽",
|
|
940
1055
|
type: "boolean",
|
|
941
|
-
visible: !
|
|
1056
|
+
visible: !0,
|
|
1057
|
+
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
1058
|
+
refreshPanelAfterChanged: !0,
|
|
942
1059
|
editor: {
|
|
943
|
-
type: "response-layout-editor-setting"
|
|
944
|
-
|
|
945
|
-
|
|
1060
|
+
type: "response-layout-editor-setting",
|
|
1061
|
+
initialState: i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(t, i.componentId)
|
|
1062
|
+
}
|
|
946
1063
|
}
|
|
1064
|
+
},
|
|
1065
|
+
setPropertyRelates(s, u) {
|
|
1066
|
+
if (s)
|
|
1067
|
+
switch (s && s.propertyID) {
|
|
1068
|
+
case "responseLayout":
|
|
1069
|
+
i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(s.propertyValue, i.componentId || t.id), i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId), i.updateElementByParentContainer(t.id, r), delete t.responseLayout;
|
|
1070
|
+
break;
|
|
1071
|
+
case "class":
|
|
1072
|
+
i.updateUnifiedLayoutAfterControlChanged(s.propertyValue, t.id, this.componentId), i.updateElementByParentContainer(t.id, r);
|
|
1073
|
+
break;
|
|
1074
|
+
}
|
|
947
1075
|
}
|
|
948
1076
|
};
|
|
949
1077
|
}
|
|
950
|
-
getEditorProperties(
|
|
951
|
-
return this.getComponentConfig(
|
|
1078
|
+
getEditorProperties(t) {
|
|
1079
|
+
return this.getComponentConfig(t);
|
|
952
1080
|
}
|
|
953
1081
|
/**
|
|
954
1082
|
* 卡片控件:切换控件类型后事件
|
|
955
1083
|
* @param propertyData 控件DOM属性
|
|
956
1084
|
* @param newControlType 新控件类型
|
|
957
1085
|
*/
|
|
958
|
-
changeControlType(
|
|
959
|
-
var
|
|
960
|
-
const
|
|
961
|
-
if (!
|
|
1086
|
+
changeControlType(t, r, i) {
|
|
1087
|
+
var l, o, c, f;
|
|
1088
|
+
const s = r.propertyValue, u = i && i.parent && i.parent.schema;
|
|
1089
|
+
if (!u)
|
|
962
1090
|
return;
|
|
963
|
-
const
|
|
964
|
-
let
|
|
1091
|
+
const p = u.contents.findIndex((m) => m.id === t.id), d = u.contents[p];
|
|
1092
|
+
let a;
|
|
965
1093
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
966
1094
|
editor: {
|
|
967
|
-
$type:
|
|
1095
|
+
$type: s
|
|
968
1096
|
},
|
|
969
1097
|
name: this.designViewModelField.name,
|
|
970
1098
|
require: this.designViewModelField.require,
|
|
971
1099
|
readonly: this.designViewModelField.readonly
|
|
972
|
-
}, !1),
|
|
973
|
-
id:
|
|
974
|
-
appearance:
|
|
975
|
-
size:
|
|
976
|
-
label:
|
|
977
|
-
binding:
|
|
978
|
-
visible:
|
|
979
|
-
}), Object.assign(
|
|
980
|
-
isTextArea:
|
|
981
|
-
placeholder: (
|
|
982
|
-
holdPlace: (
|
|
983
|
-
readonly: (
|
|
984
|
-
require: (
|
|
985
|
-
}),
|
|
986
|
-
(
|
|
987
|
-
),
|
|
988
|
-
}
|
|
989
|
-
getComponentConfig(
|
|
990
|
-
const
|
|
1100
|
+
}, !1), a = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, s)), a || (a = this.controlCreatorUtils.createFormGroupWithoutField(s)), Object.assign(a, {
|
|
1101
|
+
id: d.id,
|
|
1102
|
+
appearance: d.appearance,
|
|
1103
|
+
size: d.size,
|
|
1104
|
+
label: d.label,
|
|
1105
|
+
binding: d.binding,
|
|
1106
|
+
visible: d.visible
|
|
1107
|
+
}), Object.assign(a.editor, {
|
|
1108
|
+
isTextArea: a.isTextArea && d.isTextArea,
|
|
1109
|
+
placeholder: (l = d.editor) == null ? void 0 : l.placeholder,
|
|
1110
|
+
holdPlace: (o = d.editor) == null ? void 0 : o.holdPlace,
|
|
1111
|
+
readonly: (c = d.editor) == null ? void 0 : c.readonly,
|
|
1112
|
+
require: (f = d.editor) == null ? void 0 : f.require
|
|
1113
|
+
}), u.contents.splice(p, 1), u.contents.splice(p, 0, a), i.schema = Object.assign(d, a), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
1114
|
+
(m) => m.classList.remove("dgComponentSelected")
|
|
1115
|
+
), Ne.value++;
|
|
1116
|
+
}
|
|
1117
|
+
getComponentConfig(t, r = {}, i = {}) {
|
|
1118
|
+
const s = Object.assign({
|
|
991
1119
|
description: "编辑器",
|
|
992
1120
|
title: "编辑器",
|
|
993
1121
|
type: "input-group",
|
|
994
1122
|
$converter: "/converter/property-editor.converter"
|
|
995
|
-
},
|
|
1123
|
+
}, r), u = Object.assign({
|
|
996
1124
|
readonly: {
|
|
997
1125
|
description: "",
|
|
998
1126
|
title: "只读",
|
|
@@ -1013,16 +1141,64 @@ class Te extends Be {
|
|
|
1013
1141
|
title: "提示文本",
|
|
1014
1142
|
type: "string"
|
|
1015
1143
|
}
|
|
1016
|
-
},
|
|
1017
|
-
return { ...
|
|
1144
|
+
}, i);
|
|
1145
|
+
return { ...s, properties: { ...u } };
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
1149
|
+
* @param controlClass 控件样式
|
|
1150
|
+
* @param controlId 控件Id
|
|
1151
|
+
* @param componentId 控件所在组件id
|
|
1152
|
+
*/
|
|
1153
|
+
updateUnifiedLayoutAfterControlChanged(t, r, i) {
|
|
1154
|
+
const s = t.split(" ");
|
|
1155
|
+
let u = s.find((o) => /^col-([1-9]|10|11|12)$/.test(o)), p = s.find((o) => /^col-md-([1-9]|10|11|12)$/.test(o)), d = s.find((o) => /^col-xl-([1-9]|10|11|12)$/.test(o)), a = s.find((o) => /^col-el-([1-9]|10|11|12)$/.test(o));
|
|
1156
|
+
u = u || "col-12", p = p || "col-md-" + u.replace("col-", ""), d = d || "col-xl-" + p.replace("col-md-", ""), a = a || "col-el-" + d.replace("col-xl-", "");
|
|
1157
|
+
const l = {
|
|
1158
|
+
id: r,
|
|
1159
|
+
columnInSM: parseInt(u.replace("col-", ""), 10),
|
|
1160
|
+
columnInMD: parseInt(p.replace("col-md-", ""), 10),
|
|
1161
|
+
columnInLG: parseInt(d.replace("col-xl-", ""), 10),
|
|
1162
|
+
columnInEL: parseInt(a.replace("col-el-", ""), 10)
|
|
1163
|
+
};
|
|
1164
|
+
this.updateUnifiedLayoutAfterResponseLayoutChanged(i, l);
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* 修改控件布局配置后更新Form统一布局配置
|
|
1168
|
+
* @param componentId 组件Id
|
|
1169
|
+
* @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
|
|
1170
|
+
*/
|
|
1171
|
+
updateUnifiedLayoutAfterResponseLayoutChanged(t, r) {
|
|
1172
|
+
const { formNode: i } = this.responseLayoutEditorFunction.checkCanFindFormNode(t);
|
|
1173
|
+
if (!i || !i.unifiedLayout)
|
|
1174
|
+
return;
|
|
1175
|
+
const s = [];
|
|
1176
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i, s, 1), r) {
|
|
1177
|
+
const m = s.find((g) => g.id === r.id);
|
|
1178
|
+
Object.assign(m || {}, r);
|
|
1179
|
+
}
|
|
1180
|
+
const u = s.map((m) => m.columnInSM), p = s.map((m) => m.columnInMD), d = s.map((m) => m.columnInLG), a = s.map((m) => m.columnInEL), l = this.checkIsUniqueColumn(u) ? u[0] : null, o = this.checkIsUniqueColumn(p) ? p[0] : null, c = this.checkIsUniqueColumn(d) ? d[0] : null, f = this.checkIsUniqueColumn(a) ? a[0] : null;
|
|
1181
|
+
Object.assign(i.unifiedLayout, {
|
|
1182
|
+
uniqueColClassInSM: l,
|
|
1183
|
+
uniqueColClassInMD: o,
|
|
1184
|
+
uniqueColClassInLG: c,
|
|
1185
|
+
uniqueColClassInEL: f
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* 校验宽度样式值是否一致
|
|
1190
|
+
*/
|
|
1191
|
+
checkIsUniqueColumn(t) {
|
|
1192
|
+
const r = new Set(t);
|
|
1193
|
+
return Array.from(r).length === 1;
|
|
1018
1194
|
}
|
|
1019
1195
|
}
|
|
1020
1196
|
class Ve extends Te {
|
|
1021
|
-
constructor(
|
|
1022
|
-
super(
|
|
1197
|
+
constructor(n, t) {
|
|
1198
|
+
super(n, t);
|
|
1023
1199
|
}
|
|
1024
|
-
getEditorProperties(
|
|
1025
|
-
return this.getComponentConfig(
|
|
1200
|
+
getEditorProperties(n) {
|
|
1201
|
+
return this.getComponentConfig(n, { type: "number-spinner" }, {
|
|
1026
1202
|
textAlign: {
|
|
1027
1203
|
description: "",
|
|
1028
1204
|
title: "对齐方式",
|
|
@@ -1050,106 +1226,106 @@ class Ve extends Te {
|
|
|
1050
1226
|
});
|
|
1051
1227
|
}
|
|
1052
1228
|
}
|
|
1053
|
-
function
|
|
1054
|
-
|
|
1055
|
-
const
|
|
1056
|
-
function
|
|
1229
|
+
function Ee(e, n) {
|
|
1230
|
+
e.schema;
|
|
1231
|
+
const t = B(!0), r = B(!0);
|
|
1232
|
+
function i(o) {
|
|
1057
1233
|
return !1;
|
|
1058
1234
|
}
|
|
1059
|
-
function
|
|
1235
|
+
function s() {
|
|
1060
1236
|
return !1;
|
|
1061
1237
|
}
|
|
1062
1238
|
function u() {
|
|
1063
1239
|
return !1;
|
|
1064
1240
|
}
|
|
1065
|
-
function
|
|
1241
|
+
function p() {
|
|
1066
1242
|
return !0;
|
|
1067
1243
|
}
|
|
1068
|
-
function
|
|
1244
|
+
function d(o) {
|
|
1069
1245
|
}
|
|
1070
|
-
function
|
|
1246
|
+
function a() {
|
|
1071
1247
|
}
|
|
1072
|
-
function
|
|
1248
|
+
function l(o) {
|
|
1073
1249
|
return null;
|
|
1074
1250
|
}
|
|
1075
1251
|
return {
|
|
1076
|
-
canAccepts:
|
|
1077
|
-
checkCanDeleteComponent:
|
|
1252
|
+
canAccepts: i,
|
|
1253
|
+
checkCanDeleteComponent: s,
|
|
1078
1254
|
checkCanMoveComponent: u,
|
|
1079
|
-
hideNestedPaddingInDesginerView:
|
|
1080
|
-
onAcceptMovedChildElement:
|
|
1081
|
-
resolveComponentContext:
|
|
1082
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1255
|
+
hideNestedPaddingInDesginerView: p,
|
|
1256
|
+
onAcceptMovedChildElement: d,
|
|
1257
|
+
resolveComponentContext: a,
|
|
1258
|
+
triggerBelongedComponentToMoveWhenMoved: t,
|
|
1083
1259
|
triggerBelongedComponentToDeleteWhenDeleted: r,
|
|
1084
|
-
getPropsConfig:
|
|
1260
|
+
getPropsConfig: l
|
|
1085
1261
|
};
|
|
1086
1262
|
}
|
|
1087
|
-
function
|
|
1263
|
+
function De(e, n) {
|
|
1088
1264
|
const {
|
|
1089
|
-
canAccepts:
|
|
1265
|
+
canAccepts: t,
|
|
1090
1266
|
checkCanDeleteComponent: r,
|
|
1091
|
-
checkCanMoveComponent:
|
|
1092
|
-
hideNestedPaddingInDesginerView:
|
|
1267
|
+
checkCanMoveComponent: i,
|
|
1268
|
+
hideNestedPaddingInDesginerView: s,
|
|
1093
1269
|
onAcceptMovedChildElement: u,
|
|
1094
|
-
resolveComponentContext:
|
|
1095
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1096
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
1097
|
-
} =
|
|
1098
|
-
function
|
|
1099
|
-
return new Ve(
|
|
1270
|
+
resolveComponentContext: p,
|
|
1271
|
+
triggerBelongedComponentToMoveWhenMoved: d,
|
|
1272
|
+
triggerBelongedComponentToDeleteWhenDeleted: a
|
|
1273
|
+
} = Ee(e), l = e.schema;
|
|
1274
|
+
function o(c, f) {
|
|
1275
|
+
return new Ve(c, n).getPropertyConfig(l, f);
|
|
1100
1276
|
}
|
|
1101
1277
|
return {
|
|
1102
|
-
canAccepts:
|
|
1278
|
+
canAccepts: t,
|
|
1103
1279
|
checkCanDeleteComponent: r,
|
|
1104
|
-
checkCanMoveComponent:
|
|
1105
|
-
hideNestedPaddingInDesginerView:
|
|
1280
|
+
checkCanMoveComponent: i,
|
|
1281
|
+
hideNestedPaddingInDesginerView: s,
|
|
1106
1282
|
onAcceptMovedChildElement: u,
|
|
1107
|
-
resolveComponentContext:
|
|
1108
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1109
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
1110
|
-
getPropsConfig:
|
|
1283
|
+
resolveComponentContext: p,
|
|
1284
|
+
triggerBelongedComponentToMoveWhenMoved: d,
|
|
1285
|
+
triggerBelongedComponentToDeleteWhenDeleted: a,
|
|
1286
|
+
getPropsConfig: o
|
|
1111
1287
|
};
|
|
1112
1288
|
}
|
|
1113
|
-
const
|
|
1289
|
+
const Pe = /* @__PURE__ */ q({
|
|
1114
1290
|
name: "FNumberSpinnerDesign",
|
|
1115
|
-
props:
|
|
1291
|
+
props: U,
|
|
1116
1292
|
emits: ["update:modelValue", "valueChange", "change", "blur", "focus", "click", "input"],
|
|
1117
|
-
setup(
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
u.value.componentInstance =
|
|
1121
|
-
}),
|
|
1122
|
-
const
|
|
1123
|
-
return () =>
|
|
1293
|
+
setup(e, n) {
|
|
1294
|
+
const t = _(e, n), r = H(e, n, t), i = Y(e, n, r, t), s = K(e, n, i), u = B(), p = W("designer-host-service"), d = W("design-item-context"), a = De(d, p), l = ke(u, d, a);
|
|
1295
|
+
x(() => {
|
|
1296
|
+
u.value.componentInstance = l, e.readonly = !0;
|
|
1297
|
+
}), n.expose(l.value);
|
|
1298
|
+
const o = B();
|
|
1299
|
+
return () => E("div", {
|
|
1124
1300
|
ref: u,
|
|
1125
1301
|
class: "input-group f-state-hover flex-row f-cmp-number-spinner test"
|
|
1126
|
-
}, [
|
|
1127
|
-
ref:
|
|
1302
|
+
}, [E("input", {
|
|
1303
|
+
ref: o,
|
|
1128
1304
|
class: "form-control",
|
|
1129
1305
|
readonly: !0,
|
|
1130
|
-
placeholder:
|
|
1131
|
-
}, null),
|
|
1132
|
-
}
|
|
1133
|
-
}),
|
|
1134
|
-
const
|
|
1135
|
-
return
|
|
1136
|
-
|
|
1137
|
-
},
|
|
1306
|
+
placeholder: e.placeholder
|
|
1307
|
+
}, null), s()]);
|
|
1308
|
+
}
|
|
1309
|
+
}), Ie = (e) => {
|
|
1310
|
+
const n = e;
|
|
1311
|
+
return n.install = function(t) {
|
|
1312
|
+
t.component(n.name, e);
|
|
1313
|
+
}, e;
|
|
1138
1314
|
};
|
|
1139
|
-
|
|
1140
|
-
|
|
1315
|
+
P.register = (e, n, t, r) => {
|
|
1316
|
+
e["number-spinner"] = P, n["number-spinner"] = Q;
|
|
1141
1317
|
};
|
|
1142
|
-
|
|
1143
|
-
|
|
1318
|
+
P.registerDesigner = (e, n, t) => {
|
|
1319
|
+
e["number-spinner"] = Pe, n["number-spinner"] = Q;
|
|
1144
1320
|
};
|
|
1145
|
-
const
|
|
1321
|
+
const je = Ie(P);
|
|
1146
1322
|
export {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1323
|
+
P as FNumberSpinner,
|
|
1324
|
+
je as default,
|
|
1325
|
+
U as numberSpinnerProps,
|
|
1326
|
+
Q as propsResolver,
|
|
1151
1327
|
H as useFormat,
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1328
|
+
_ as useNumber,
|
|
1329
|
+
Y as useSpinner,
|
|
1330
|
+
we as useTextBox
|
|
1155
1331
|
};
|