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