@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,103 +1,104 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { computed as P, ref as
|
|
5
|
-
import { cloneDeep as
|
|
6
|
-
import
|
|
1
|
+
var re = Object.defineProperty;
|
|
2
|
+
var ie = (e, n, t) => n in e ? re(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var x = (e, n, t) => ie(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { computed as P, ref as V, createVNode as T, defineComponent as X, onMounted as G, watch as L, createTextVNode as Q, inject as Z } from "vue";
|
|
5
|
+
import { isPlainObject as H, cloneDeep as Y } from "lodash-es";
|
|
6
|
+
import M from "bignumber.js";
|
|
7
7
|
import { getSchemaByType as J } from "../dynamic-resolver/index.esm.js";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { useResponseLayoutEditorSetting as ae } from "../response-layout-editor/index.esm.js/src/composition/converter/use-response-layout-editor-setting";
|
|
9
|
+
function le(e, n, t) {
|
|
10
|
+
return n;
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const { properties:
|
|
14
|
-
return o.id = `${
|
|
12
|
+
const _ = {}, K = {};
|
|
13
|
+
function W(e) {
|
|
14
|
+
const { properties: n, title: t, ignore: o } = e, r = o && Array.isArray(o), l = Object.keys(n).reduce((u, p) => ((!r || !o.find((a) => a == p)) && (u[p] = n[p].type === "object" && n[p].properties ? W(n[p]) : Y(n[p].default)), u), {});
|
|
15
|
+
return (!r || !o.find((u) => u == "id")) && (l.id = `${t}-${Date.now()}`), l;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
let
|
|
20
|
-
const
|
|
21
|
-
return
|
|
17
|
+
function R(e, n = {}, t) {
|
|
18
|
+
const o = _[e];
|
|
19
|
+
if (o) {
|
|
20
|
+
let r = W(o);
|
|
21
|
+
const l = K[e];
|
|
22
|
+
return r = l ? l({ getSchemaByType: R }, r, n, t) : r, r;
|
|
22
23
|
}
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return Object.keys(e).reduce((o,
|
|
26
|
+
function ue(e, n) {
|
|
27
|
+
const t = W(n);
|
|
28
|
+
return Object.keys(e).reduce((o, r) => (o[r] && H(o[r]) && H(e[r]) ? Object.assign(o[r], e[r]) : o[r] = e[r], o), t), t;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
return Object.keys(e).filter((o) => e[o] != null).reduce((o,
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
if (typeof
|
|
34
|
-
o[
|
|
30
|
+
function ce(e, n) {
|
|
31
|
+
return Object.keys(e).filter((o) => e[o] != null).reduce((o, r) => {
|
|
32
|
+
if (n.has(r)) {
|
|
33
|
+
const l = n.get(r);
|
|
34
|
+
if (typeof l == "string")
|
|
35
|
+
o[l] = e[r];
|
|
35
36
|
else {
|
|
36
|
-
const
|
|
37
|
-
Object.assign(o,
|
|
37
|
+
const u = l(r, e[r], e);
|
|
38
|
+
Object.assign(o, u);
|
|
38
39
|
}
|
|
39
40
|
} else
|
|
40
|
-
o[
|
|
41
|
+
o[r] = e[r];
|
|
41
42
|
return o;
|
|
42
43
|
}, {});
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
const o =
|
|
46
|
-
return
|
|
45
|
+
function se(e, n, t = /* @__PURE__ */ new Map()) {
|
|
46
|
+
const o = ue(e, n);
|
|
47
|
+
return ce(o, t);
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
function
|
|
50
|
-
if (typeof
|
|
51
|
-
return
|
|
52
|
-
if (typeof
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
return Number(
|
|
56
|
-
if (
|
|
57
|
-
return Number(
|
|
58
|
-
if (
|
|
59
|
-
return Number(
|
|
49
|
+
function pe(e = {}) {
|
|
50
|
+
function n(i, s, c, d) {
|
|
51
|
+
if (typeof c == "number")
|
|
52
|
+
return d[i].length === c;
|
|
53
|
+
if (typeof c == "object") {
|
|
54
|
+
const g = Object.keys(c)[0], f = c[g];
|
|
55
|
+
if (g === "not")
|
|
56
|
+
return Number(d[i].length) !== Number(f);
|
|
57
|
+
if (g === "moreThan")
|
|
58
|
+
return Number(d[i].length) >= Number(f);
|
|
59
|
+
if (g === "lessThan")
|
|
60
|
+
return Number(d[i].length) <= Number(f);
|
|
60
61
|
}
|
|
61
62
|
return !1;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
64
|
+
function t(i, s, c, d) {
|
|
65
|
+
return d[i] && d[i].propertyValue && String(d[i].propertyValue.value) === String(c);
|
|
65
66
|
}
|
|
66
67
|
const o = /* @__PURE__ */ new Map([
|
|
67
|
-
["length",
|
|
68
|
-
["getProperty",
|
|
68
|
+
["length", n],
|
|
69
|
+
["getProperty", t]
|
|
69
70
|
]);
|
|
70
|
-
Object.keys(e).reduce((
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
return typeof
|
|
74
|
-
if (
|
|
75
|
-
return { target:
|
|
76
|
-
const
|
|
77
|
-
return { target:
|
|
71
|
+
Object.keys(e).reduce((i, s) => (i.set(s, e[s]), i), o);
|
|
72
|
+
function r(i, s) {
|
|
73
|
+
const c = i;
|
|
74
|
+
return typeof s == "number" ? [{ target: c, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: c, operator: "getProperty", param: i, value: !!s }] : typeof s == "object" ? Object.keys(s).map((d) => {
|
|
75
|
+
if (d === "length")
|
|
76
|
+
return { target: c, operator: "length", param: null, value: s[d] };
|
|
77
|
+
const g = d, f = s[d];
|
|
78
|
+
return { target: c, operator: "getProperty", param: g, value: f };
|
|
78
79
|
}) : [];
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
return Object.keys(
|
|
82
|
-
const
|
|
83
|
-
return
|
|
81
|
+
function l(i) {
|
|
82
|
+
return Object.keys(i).reduce((c, d) => {
|
|
83
|
+
const g = r(d, i[d]);
|
|
84
|
+
return c.push(...g), c;
|
|
84
85
|
}, []);
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
if (o.has(
|
|
88
|
-
const
|
|
89
|
-
return
|
|
87
|
+
function u(i, s) {
|
|
88
|
+
if (o.has(i.operator)) {
|
|
89
|
+
const c = o.get(i.operator);
|
|
90
|
+
return c && c(i.target, i.param, i.value, s) || !1;
|
|
90
91
|
}
|
|
91
92
|
return !1;
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
94
|
+
function p(i, s) {
|
|
95
|
+
return l(i).reduce((g, f) => g && u(f, s), !0);
|
|
95
96
|
}
|
|
96
|
-
function i
|
|
97
|
-
const
|
|
98
|
-
return
|
|
97
|
+
function a(i, s) {
|
|
98
|
+
const c = Object.keys(i), d = c.includes("allOf"), g = c.includes("anyOf"), f = d || g, E = (f ? i[f ? d ? "allOf" : "anyOf" : "allOf"] : [i]).map((S) => p(S, s));
|
|
99
|
+
return d ? !E.includes(!1) : E.includes(!0);
|
|
99
100
|
}
|
|
100
|
-
return { parseValueSchema:
|
|
101
|
+
return { parseValueSchema: a };
|
|
101
102
|
}
|
|
102
103
|
const m = {
|
|
103
104
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
@@ -136,21 +137,22 @@ const m = {
|
|
|
136
137
|
uploader: { type: "uploader", name: "附件上传", icon: "FileUpload" },
|
|
137
138
|
"page-header": { type: "page-header", name: "页头", icon: "Header" },
|
|
138
139
|
"page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
|
|
139
|
-
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" }
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
141
|
+
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
|
|
142
|
+
}, de = {}, me = {};
|
|
143
|
+
pe();
|
|
144
|
+
function fe(e, n, t = /* @__PURE__ */ new Map(), o = (u, p, a) => p, r = {}, l = (u) => u) {
|
|
145
|
+
return _[n.title] = n, K[n.title] = o, de[n.title] = r, me[n.title] = l, (u = {}) => {
|
|
146
|
+
const p = se(u, n, t), a = Object.keys(e).reduce((i, s) => (i[s] = e[s].default, i), {});
|
|
147
|
+
return Object.assign(a, p);
|
|
146
148
|
};
|
|
147
149
|
}
|
|
148
|
-
function
|
|
149
|
-
return { customClass:
|
|
150
|
+
function ge(e, n) {
|
|
151
|
+
return { customClass: n.class, customStyle: n.style };
|
|
150
152
|
}
|
|
151
|
-
const
|
|
152
|
-
["appearance",
|
|
153
|
-
]),
|
|
153
|
+
const ye = /* @__PURE__ */ new Map([
|
|
154
|
+
["appearance", ge]
|
|
155
|
+
]), be = "https://json-schema.org/draft/2020-12/schema", he = "https://farris-design.gitee.io/number-range.schema.json", ve = "number-range", Ce = "A Farris Component", we = "object", Se = {
|
|
154
156
|
id: {
|
|
155
157
|
description: "The unique identifier for a number-range",
|
|
156
158
|
type: "string"
|
|
@@ -212,18 +214,18 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
212
214
|
type: "boolean",
|
|
213
215
|
default: !0
|
|
214
216
|
}
|
|
215
|
-
},
|
|
217
|
+
}, Be = [
|
|
216
218
|
"id",
|
|
217
219
|
"type"
|
|
218
|
-
],
|
|
219
|
-
$schema:
|
|
220
|
-
$id:
|
|
221
|
-
title:
|
|
222
|
-
description:
|
|
223
|
-
type:
|
|
224
|
-
properties:
|
|
225
|
-
required:
|
|
226
|
-
},
|
|
220
|
+
], ke = {
|
|
221
|
+
$schema: be,
|
|
222
|
+
$id: he,
|
|
223
|
+
title: ve,
|
|
224
|
+
description: Ce,
|
|
225
|
+
type: we,
|
|
226
|
+
properties: Se,
|
|
227
|
+
required: Be
|
|
228
|
+
}, z = {
|
|
227
229
|
/**
|
|
228
230
|
* 组件标识
|
|
229
231
|
*/
|
|
@@ -335,399 +337,399 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
335
337
|
* 是否使用千分值
|
|
336
338
|
*/
|
|
337
339
|
useThousands: { type: Boolean, default: !0 }
|
|
338
|
-
},
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
function o(
|
|
342
|
-
return
|
|
340
|
+
}, ee = fe(z, ke, ye, le);
|
|
341
|
+
function te(e, n) {
|
|
342
|
+
const t = P(() => Number(e.precision) || 0);
|
|
343
|
+
function o(a) {
|
|
344
|
+
return a.toFixed(t.value);
|
|
343
345
|
}
|
|
344
|
-
function a
|
|
345
|
-
return isNaN(
|
|
346
|
+
function r(a) {
|
|
347
|
+
return isNaN(a) || a === null || a === void 0 || a === "";
|
|
346
348
|
}
|
|
347
|
-
function
|
|
348
|
-
const
|
|
349
|
-
return
|
|
349
|
+
function l(a) {
|
|
350
|
+
const i = r(e.max) ? null : new M(String(e.max), 10), s = r(e.min) ? null : new M(String(e.min), 10);
|
|
351
|
+
return i && a.gt(i) ? i : s && a.lt(s) ? s : a;
|
|
350
352
|
}
|
|
351
|
-
function
|
|
352
|
-
const
|
|
353
|
-
let
|
|
354
|
-
return
|
|
353
|
+
function u(a, i, s, c) {
|
|
354
|
+
const d = new M(a, 10), g = r(s && s.value) ? null : new M(String(s.value), 10), f = r(i && i.value) ? null : new M(String(i.value), 10);
|
|
355
|
+
let w;
|
|
356
|
+
return c ? w = g && d.gt(g) ? g : d : w = f && d.lt(f) ? f : d, w.toString();
|
|
355
357
|
}
|
|
356
|
-
function
|
|
358
|
+
function p(a) {
|
|
357
359
|
if (e.parser)
|
|
358
|
-
return isNaN(Number(
|
|
359
|
-
let
|
|
360
|
-
if (
|
|
360
|
+
return isNaN(Number(a)) ? e.parser(a) : a;
|
|
361
|
+
let i = l(new M(a, 10));
|
|
362
|
+
if (i.isNaN()) {
|
|
361
363
|
if (e.canNull)
|
|
362
364
|
return null;
|
|
363
|
-
const
|
|
364
|
-
if (!
|
|
365
|
-
|
|
366
|
-
else if (!
|
|
367
|
-
|
|
365
|
+
const c = new M("" + e.min, 10), d = new M("" + e.max, 10);
|
|
366
|
+
if (!c.isNaN())
|
|
367
|
+
i = c;
|
|
368
|
+
else if (!d.isNaN())
|
|
369
|
+
i = d;
|
|
368
370
|
else
|
|
369
371
|
return 0;
|
|
370
372
|
}
|
|
371
|
-
return o(
|
|
373
|
+
return o(i);
|
|
372
374
|
}
|
|
373
|
-
return { getRealValue:
|
|
375
|
+
return { getRealValue: p, isEmpty: r, precision: t, getValidNumberObject: l, getValidNumberInRange: u };
|
|
374
376
|
}
|
|
375
|
-
function
|
|
377
|
+
function ne(e, n, t) {
|
|
376
378
|
const o = P(() => ({
|
|
377
379
|
prefix: e.prefix,
|
|
378
380
|
suffix: e.suffix,
|
|
379
381
|
decimalSeparator: e.decimalSeparator,
|
|
380
382
|
groupSeparator: e.useThousands ? e.groupSeparator : "",
|
|
381
383
|
groupSize: e.groupSize
|
|
382
|
-
})), { getValidNumberObject:
|
|
383
|
-
function
|
|
384
|
-
return
|
|
384
|
+
})), { getValidNumberObject: r, precision: l } = t;
|
|
385
|
+
function u(i) {
|
|
386
|
+
return i = i == null || i === "" ? "" : String(i), i = i.replace(new RegExp(e.prefix, "g"), "").replace(new RegExp(e.suffix, "g"), "").replace(/,/g, ""), e.groupSeparator && e.groupSeparator !== "," && (i = i.replace(new RegExp(`\\${e.groupSeparator}`, "g"), "")), e.decimalSeparator && e.decimalSeparator !== "." && (i = i.replace(new RegExp(`\\${e.decimalSeparator}`, "g"), ".")), i;
|
|
385
387
|
}
|
|
386
|
-
function
|
|
387
|
-
return e.precision !== null && e.precision !== void 0 ?
|
|
388
|
+
function p(i, s) {
|
|
389
|
+
return e.precision !== null && e.precision !== void 0 ? i.toFormat(l.value, s) : i.toFormat(s);
|
|
388
390
|
}
|
|
389
|
-
function i
|
|
390
|
-
const
|
|
391
|
-
return
|
|
391
|
+
function a(i) {
|
|
392
|
+
const s = u(i), c = new M(s, 10), d = r(c);
|
|
393
|
+
return d.valueOf() === "0" && !e.showZero || d.isNaN() ? "" : e.formatter ? e.formatter(d.toNumber()) : p(d, o.value);
|
|
392
394
|
}
|
|
393
|
-
return { cleanFormat:
|
|
395
|
+
return { cleanFormat: u, format: a };
|
|
394
396
|
}
|
|
395
|
-
function
|
|
396
|
-
const { format:
|
|
397
|
-
function
|
|
398
|
-
const B = new
|
|
399
|
-
return !(e.max && !new
|
|
397
|
+
function O(e, n, t, o, r, l, u, p, a, i) {
|
|
398
|
+
const { format: s } = r, { getRealValue: c, getValidNumberInRange: d } = l;
|
|
399
|
+
function g() {
|
|
400
|
+
const B = new M(o.value || 0);
|
|
401
|
+
return !(e.max && !new M(e.max).isNaN() && B.gte(new M(e.max)));
|
|
400
402
|
}
|
|
401
|
-
function
|
|
402
|
-
const B = new
|
|
403
|
-
return !(e.min && !new
|
|
403
|
+
function f() {
|
|
404
|
+
const B = new M(o.value || 0);
|
|
405
|
+
return !(e.min && !new M(e.min).isNaN() && B.lte(new M(e.min)));
|
|
404
406
|
}
|
|
405
|
-
function
|
|
407
|
+
function w(B) {
|
|
406
408
|
if (e.readonly || e.disabled)
|
|
407
409
|
return;
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
let
|
|
411
|
-
|
|
410
|
+
const N = B === "up" ? g : f, y = B === "up" ? "plus" : "minus";
|
|
411
|
+
if (N()) {
|
|
412
|
+
let h = new M(o.value || 0)[y](Number(e.step)).toFixed();
|
|
413
|
+
h = d(h, p, a, i), t.value = s(h), o.value = c(h), u(o.value);
|
|
412
414
|
}
|
|
413
415
|
}
|
|
414
|
-
function E() {
|
|
415
|
-
V("up");
|
|
416
|
-
}
|
|
417
416
|
function D() {
|
|
418
|
-
|
|
417
|
+
w("up");
|
|
419
418
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
419
|
+
function E() {
|
|
420
|
+
w("down");
|
|
422
421
|
}
|
|
423
|
-
function
|
|
422
|
+
function F(B) {
|
|
424
423
|
D(), B.stopPropagation();
|
|
425
424
|
}
|
|
426
|
-
|
|
425
|
+
function S(B) {
|
|
426
|
+
E(), B.stopPropagation();
|
|
427
|
+
}
|
|
428
|
+
return { canDownward: f, canUpward: g, downward: E, onClickDownButton: S, onClickUpButton: F, upward: D };
|
|
427
429
|
}
|
|
428
|
-
function
|
|
429
|
-
const { cleanFormat:
|
|
430
|
-
function B(
|
|
431
|
-
var
|
|
432
|
-
if (
|
|
430
|
+
function j(e, n, t, o, r, l, u, p, a, i, s) {
|
|
431
|
+
const { cleanFormat: c, format: d } = r, { getRealValue: g, isEmpty: f, getValidNumberInRange: w } = l, { downward: D, upward: E } = u, F = P(() => t.value), S = V(!1);
|
|
432
|
+
function B(b) {
|
|
433
|
+
var k;
|
|
434
|
+
if (b.stopPropagation(), e.readonly || e.disabled)
|
|
433
435
|
return;
|
|
434
|
-
|
|
435
|
-
let
|
|
436
|
-
e.canNull || (
|
|
437
|
-
let
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
function
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
function y(
|
|
444
|
-
var
|
|
445
|
-
|
|
446
|
-
let
|
|
447
|
-
e.canNull || (
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
function
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
return { textBoxValue:
|
|
436
|
+
S.value = !1;
|
|
437
|
+
let h = (k = b.target) == null ? void 0 : k.value;
|
|
438
|
+
e.canNull || (h = h || 0);
|
|
439
|
+
let v = c(h);
|
|
440
|
+
v = w(v, a, i, s), t.value = d(v), o.value = g(v), p(o.value), n.emit("blur", { event: b, formatted: t.value, value: o.value });
|
|
441
|
+
}
|
|
442
|
+
function N(b) {
|
|
443
|
+
b.stopPropagation(), !(e.readonly || e.disabled) && (S.value = !0, t.value = f(o.value) || !e.showZero && o.value === "0" ? "" : String(o.value), n.emit("focus", { event: b, formatted: t.value, value: o.value }));
|
|
444
|
+
}
|
|
445
|
+
function y(b) {
|
|
446
|
+
var k;
|
|
447
|
+
b.stopPropagation();
|
|
448
|
+
let h = (k = b.target) == null ? void 0 : k.value;
|
|
449
|
+
e.canNull || (h = h || 0);
|
|
450
|
+
const v = c(h);
|
|
451
|
+
t.value = v, o.value = g(v), p(o.value);
|
|
452
|
+
}
|
|
453
|
+
function C(b) {
|
|
454
|
+
b.key === "ArrowDown" && (b.preventDefault(), D()), b.key === "ArrowUp" && (b.preventDefault(), E()), b.stopPropagation();
|
|
455
|
+
}
|
|
456
|
+
return { textBoxValue: F, onBlurTextBox: B, onFocusTextBox: N, onInput: y, onKeyDown: C, isTextBoxFocused: S };
|
|
455
457
|
}
|
|
456
|
-
function
|
|
458
|
+
function U(e, n, t, o) {
|
|
457
459
|
const {
|
|
458
|
-
onBlurTextBox:
|
|
459
|
-
onFocusTextBox:
|
|
460
|
-
onInput:
|
|
461
|
-
onKeyDown:
|
|
462
|
-
textBoxValue:
|
|
463
|
-
} =
|
|
460
|
+
onBlurTextBox: r,
|
|
461
|
+
onFocusTextBox: l,
|
|
462
|
+
onInput: u,
|
|
463
|
+
onKeyDown: p,
|
|
464
|
+
textBoxValue: a
|
|
465
|
+
} = t, i = P(() => e.disabled || e.readonly || !e.editable ? "" : o ? e.beginPlaceHolder : e.endPlaceHolder), s = P(() => ({
|
|
464
466
|
"form-control": !0,
|
|
465
467
|
"sub-input": !0
|
|
466
|
-
})),
|
|
468
|
+
})), c = P(() => ({
|
|
467
469
|
"text-align": e.textAlign
|
|
468
470
|
}));
|
|
469
|
-
function
|
|
470
|
-
|
|
471
|
+
function d(g) {
|
|
472
|
+
g.stopPropagation();
|
|
471
473
|
}
|
|
472
|
-
return () =>
|
|
473
|
-
class:
|
|
474
|
-
style:
|
|
474
|
+
return () => T("input", {
|
|
475
|
+
class: s.value,
|
|
476
|
+
style: c.value,
|
|
475
477
|
type: "text",
|
|
476
|
-
value:
|
|
478
|
+
value: a.value,
|
|
477
479
|
disabled: e.disabled,
|
|
478
480
|
readonly: e.readonly || !e.editable,
|
|
479
|
-
placeholder:
|
|
480
|
-
onBlur:
|
|
481
|
-
onChange:
|
|
482
|
-
onFocus:
|
|
483
|
-
onInput:
|
|
484
|
-
onKeydown:
|
|
481
|
+
placeholder: i.value,
|
|
482
|
+
onBlur: r,
|
|
483
|
+
onChange: d,
|
|
484
|
+
onFocus: l,
|
|
485
|
+
onInput: u,
|
|
486
|
+
onKeydown: p
|
|
485
487
|
}, null);
|
|
486
488
|
}
|
|
487
|
-
function
|
|
489
|
+
function I(e, n, t) {
|
|
488
490
|
const {
|
|
489
491
|
canDownward: o,
|
|
490
|
-
canUpward:
|
|
491
|
-
onClickDownButton:
|
|
492
|
-
onClickUpButton:
|
|
493
|
-
} =
|
|
492
|
+
canUpward: r,
|
|
493
|
+
onClickDownButton: l,
|
|
494
|
+
onClickUpButton: u
|
|
495
|
+
} = t, p = P(() => ({
|
|
494
496
|
"input-group-append": !0,
|
|
495
497
|
"btn-group": !0,
|
|
496
498
|
"btn-group-number": !0,
|
|
497
499
|
"sub-btn-group": !0
|
|
498
|
-
})),
|
|
500
|
+
})), a = P(() => ({
|
|
499
501
|
btn: !0,
|
|
500
502
|
"btn-secondary": !0,
|
|
501
503
|
"btn-number-flag": !0
|
|
502
|
-
})),
|
|
503
|
-
cursor:
|
|
504
|
+
})), i = P(() => ({
|
|
505
|
+
cursor: r() ? "pointer" : "not-allowed",
|
|
504
506
|
"margin-left": 0
|
|
505
|
-
})),
|
|
507
|
+
})), s = P(() => ({
|
|
506
508
|
cursor: o() ? "pointer" : "not-allowed",
|
|
507
509
|
"margin-left": 0
|
|
508
510
|
}));
|
|
509
|
-
return () =>
|
|
510
|
-
class:
|
|
511
|
-
}, [
|
|
511
|
+
return () => T("div", {
|
|
512
|
+
class: p.value
|
|
513
|
+
}, [T("button", {
|
|
512
514
|
title: "upButton",
|
|
513
|
-
class:
|
|
514
|
-
style:
|
|
515
|
-
onClick:
|
|
516
|
-
disabled: !
|
|
517
|
-
}, [
|
|
515
|
+
class: a.value,
|
|
516
|
+
style: i.value,
|
|
517
|
+
onClick: u,
|
|
518
|
+
disabled: !r()
|
|
519
|
+
}, [T("span", {
|
|
518
520
|
class: "f-icon f-icon-arrow-chevron-up number-arrow-chevron"
|
|
519
|
-
}, null)]),
|
|
521
|
+
}, null)]), T("button", {
|
|
520
522
|
title: "downButton",
|
|
521
|
-
class:
|
|
522
|
-
style:
|
|
523
|
-
onClick:
|
|
523
|
+
class: a.value,
|
|
524
|
+
style: s.value,
|
|
525
|
+
onClick: l,
|
|
524
526
|
disabled: !o()
|
|
525
|
-
}, [
|
|
527
|
+
}, [T("span", {
|
|
526
528
|
class: "f-icon f-icon-arrow-chevron-down number-arrow-chevron"
|
|
527
529
|
}, null)])]);
|
|
528
530
|
}
|
|
529
|
-
const
|
|
531
|
+
const $ = /* @__PURE__ */ X({
|
|
530
532
|
name: "FNumberRange",
|
|
531
|
-
props:
|
|
533
|
+
props: z,
|
|
532
534
|
emits: ["valueChange", "blur", "focus", "click", "input", "beginValueChange", "endValueChange"],
|
|
533
|
-
setup(e,
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
},
|
|
537
|
-
|
|
538
|
-
},
|
|
539
|
-
getRealValue:
|
|
540
|
-
} =
|
|
541
|
-
format:
|
|
542
|
-
} =
|
|
535
|
+
setup(e, n) {
|
|
536
|
+
const t = V(e.beginValue), o = V(""), r = V(e.endValue), l = V(""), u = te(e), p = ne(e, n, u), a = (N) => {
|
|
537
|
+
n.emit("beginValueChange", N);
|
|
538
|
+
}, i = O(e, n, o, t, p, u, a, t, r, !0), s = j(e, n, o, t, p, u, i, a, t, r, !0), c = I(e, n, i), d = U(e, n, s, !0), g = (N) => {
|
|
539
|
+
n.emit("endValueChange", N);
|
|
540
|
+
}, f = O(e, n, l, r, p, u, g, t, r, !1), w = j(e, n, l, r, p, u, f, g, t, r, !1), D = I(e, n, f), E = U(e, n, w, !1), {
|
|
541
|
+
getRealValue: F
|
|
542
|
+
} = u, {
|
|
543
|
+
format: S
|
|
544
|
+
} = p, B = P(() => !e.disabled && !e.readonly && e.showButton);
|
|
543
545
|
return G(() => {
|
|
544
|
-
const
|
|
545
|
-
o.value =
|
|
546
|
-
}),
|
|
547
|
-
if (!
|
|
548
|
-
const y =
|
|
549
|
-
o.value =
|
|
546
|
+
const N = F(e.beginValue), y = F(e.endValue);
|
|
547
|
+
o.value = S(N), l.value = S(y);
|
|
548
|
+
}), L(() => [e.beginValue], ([N]) => {
|
|
549
|
+
if (!s.isTextBoxFocused.value) {
|
|
550
|
+
const y = F(N);
|
|
551
|
+
o.value = S(y);
|
|
550
552
|
}
|
|
551
|
-
}),
|
|
552
|
-
if (!
|
|
553
|
-
const y =
|
|
554
|
-
|
|
553
|
+
}), L(() => [e.endValue], ([N]) => {
|
|
554
|
+
if (!w.isTextBoxFocused.value) {
|
|
555
|
+
const y = F(N);
|
|
556
|
+
l.value = S(y);
|
|
555
557
|
}
|
|
556
|
-
}),
|
|
557
|
-
o.value =
|
|
558
|
-
}), () =>
|
|
558
|
+
}), L(() => [e.precision, e.useThousands, e.prefix, e.suffix, e.showZero], () => {
|
|
559
|
+
o.value = S(t.value), l.value = S(r.value);
|
|
560
|
+
}), () => T("div", {
|
|
559
561
|
class: "input-group number-range f-cmp-number-spinner"
|
|
560
|
-
}, [
|
|
562
|
+
}, [T("div", {
|
|
561
563
|
class: "form-control input-container"
|
|
562
|
-
}, [
|
|
564
|
+
}, [T("div", {
|
|
563
565
|
class: "sub-input-group"
|
|
564
|
-
}, [
|
|
566
|
+
}, [d(), B.value && c()]), T("span", {
|
|
565
567
|
class: "spliter"
|
|
566
|
-
}, [
|
|
568
|
+
}, [Q("~")]), T("div", {
|
|
567
569
|
class: "sub-input-group"
|
|
568
|
-
}, [
|
|
570
|
+
}, [E(), B.value && D()])])]);
|
|
569
571
|
}
|
|
570
572
|
});
|
|
571
|
-
function Ne(e,
|
|
572
|
-
var
|
|
573
|
+
function Ne(e, n, t) {
|
|
574
|
+
var N;
|
|
573
575
|
function o() {
|
|
574
|
-
|
|
576
|
+
t != null && t.resolveComponentContext && t.resolveComponentContext();
|
|
575
577
|
}
|
|
576
578
|
o();
|
|
577
|
-
const
|
|
578
|
-
function
|
|
579
|
-
return (
|
|
579
|
+
const r = t && t.getStyles && t.getStyles() || "", l = t && t.getDesignerClass && t.getDesignerClass() || "", u = V();
|
|
580
|
+
function p() {
|
|
581
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
|
|
580
582
|
}
|
|
581
|
-
function
|
|
583
|
+
function a() {
|
|
582
584
|
return !1;
|
|
583
585
|
}
|
|
584
|
-
function
|
|
585
|
-
return (
|
|
586
|
+
function i() {
|
|
587
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanDeleteComponent ? t.checkCanDeleteComponent() : !0;
|
|
586
588
|
}
|
|
587
|
-
function
|
|
588
|
-
return (
|
|
589
|
+
function s() {
|
|
590
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !0 : t && t.hideNestedPaddingInDesginerView ? t.hideNestedPaddingInDesginerView() : !1;
|
|
589
591
|
}
|
|
590
|
-
function
|
|
592
|
+
function c(y) {
|
|
591
593
|
if (!y || !y.value)
|
|
592
594
|
return null;
|
|
593
595
|
if (y.value.schema && y.value.schema.type === "component")
|
|
594
596
|
return y.value;
|
|
595
|
-
const
|
|
596
|
-
return
|
|
597
|
+
const C = V(y == null ? void 0 : y.value.parent), b = c(C);
|
|
598
|
+
return b || null;
|
|
597
599
|
}
|
|
598
|
-
function
|
|
599
|
-
const { componentInstance:
|
|
600
|
-
return !
|
|
600
|
+
function d(y = n) {
|
|
601
|
+
const { componentInstance: C, designerItemElementRef: b } = y;
|
|
602
|
+
return !C || !C.value ? null : C.value.canMove ? b : d(y.parent);
|
|
601
603
|
}
|
|
602
|
-
function
|
|
603
|
-
return !!
|
|
604
|
+
function g(y) {
|
|
605
|
+
return !!t && t.canAccepts(y);
|
|
604
606
|
}
|
|
605
|
-
function
|
|
606
|
-
return (
|
|
607
|
+
function f() {
|
|
608
|
+
return (n == null ? void 0 : n.schema.label) || (n == null ? void 0 : n.schema.title) || (n == null ? void 0 : n.schema.name);
|
|
607
609
|
}
|
|
608
|
-
function
|
|
610
|
+
function w() {
|
|
609
611
|
}
|
|
610
|
-
function
|
|
611
|
-
|
|
612
|
+
function D(y, C) {
|
|
613
|
+
C && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(C);
|
|
612
614
|
}
|
|
613
|
-
function
|
|
614
|
-
const { componentType:
|
|
615
|
-
let
|
|
616
|
-
|
|
617
|
-
const v =
|
|
618
|
-
return
|
|
615
|
+
function E(y, C) {
|
|
616
|
+
const { componentType: b } = y;
|
|
617
|
+
let h = R(b, y, C);
|
|
618
|
+
t && t.onResolveNewComponentSchema && (h = t.onResolveNewComponentSchema(y, h));
|
|
619
|
+
const v = b.toLowerCase().replace("-", "_");
|
|
620
|
+
return h && !h.id && h.type === b && (h.id = `${v}_${Math.random().toString().slice(2, 6)}`), h;
|
|
619
621
|
}
|
|
620
|
-
function
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
let
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
-
return
|
|
622
|
+
function F(y, C) {
|
|
623
|
+
const b = String(y.getAttribute("data-controltype")), h = y.getAttribute("data-feature"), v = h ? JSON.parse(h) : {};
|
|
624
|
+
v.parentComponentInstance = u.value;
|
|
625
|
+
let k = R(b, v);
|
|
626
|
+
t && t.onAcceptNewChildElement && (k = t.onAcceptNewChildElement(y, C, k));
|
|
627
|
+
const oe = b.toLowerCase().replace("-", "_");
|
|
628
|
+
return k && !k.id && k.type === b && (k.id = `${oe}_${Math.random().toString().slice(2, 6)}`), k;
|
|
627
629
|
}
|
|
628
|
-
function
|
|
630
|
+
function S(y) {
|
|
629
631
|
}
|
|
630
632
|
function B(...y) {
|
|
631
|
-
if (
|
|
632
|
-
return
|
|
633
|
-
}
|
|
634
|
-
return
|
|
635
|
-
canMove:
|
|
636
|
-
canSelectParent:
|
|
637
|
-
canDelete:
|
|
638
|
-
canNested: !
|
|
639
|
-
contents:
|
|
633
|
+
if (t && t.getPropsConfig)
|
|
634
|
+
return t.getPropsConfig(...y);
|
|
635
|
+
}
|
|
636
|
+
return u.value = {
|
|
637
|
+
canMove: p(),
|
|
638
|
+
canSelectParent: a(),
|
|
639
|
+
canDelete: i(),
|
|
640
|
+
canNested: !s(),
|
|
641
|
+
contents: n == null ? void 0 : n.schema.contents,
|
|
640
642
|
elementRef: e,
|
|
641
|
-
parent: (
|
|
642
|
-
schema:
|
|
643
|
-
styles:
|
|
644
|
-
designerClass:
|
|
645
|
-
canAccepts:
|
|
646
|
-
getBelongedComponentInstance:
|
|
647
|
-
getDraggableDesignItemElement:
|
|
648
|
-
getDraggingDisplayText:
|
|
643
|
+
parent: (N = n == null ? void 0 : n.parent) == null ? void 0 : N.componentInstance,
|
|
644
|
+
schema: n == null ? void 0 : n.schema,
|
|
645
|
+
styles: r,
|
|
646
|
+
designerClass: l,
|
|
647
|
+
canAccepts: g,
|
|
648
|
+
getBelongedComponentInstance: c,
|
|
649
|
+
getDraggableDesignItemElement: d,
|
|
650
|
+
getDraggingDisplayText: f,
|
|
649
651
|
getPropConfig: B,
|
|
650
|
-
getDragScopeElement:
|
|
651
|
-
onAcceptMovedChildElement:
|
|
652
|
-
onAcceptNewChildElement:
|
|
653
|
-
onChildElementMovedOut:
|
|
654
|
-
addNewChildComponentSchema:
|
|
652
|
+
getDragScopeElement: w,
|
|
653
|
+
onAcceptMovedChildElement: D,
|
|
654
|
+
onAcceptNewChildElement: F,
|
|
655
|
+
onChildElementMovedOut: S,
|
|
656
|
+
addNewChildComponentSchema: E,
|
|
655
657
|
updateDragAndDropRules: o,
|
|
656
|
-
triggerBelongedComponentToMoveWhenMoved: !!
|
|
657
|
-
triggerBelongedComponentToDeleteWhenDeleted: !!
|
|
658
|
-
},
|
|
658
|
+
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || V(!1),
|
|
659
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || V(!1)
|
|
660
|
+
}, u;
|
|
659
661
|
}
|
|
660
|
-
function
|
|
662
|
+
function Ve(e, n) {
|
|
661
663
|
e.schema;
|
|
662
|
-
const
|
|
663
|
-
function
|
|
664
|
+
const t = V(!0), o = V(!0);
|
|
665
|
+
function r(c) {
|
|
664
666
|
return !1;
|
|
665
667
|
}
|
|
666
|
-
function
|
|
668
|
+
function l() {
|
|
667
669
|
return !1;
|
|
668
670
|
}
|
|
669
|
-
function
|
|
671
|
+
function u() {
|
|
670
672
|
return !1;
|
|
671
673
|
}
|
|
672
|
-
function
|
|
674
|
+
function p() {
|
|
673
675
|
return !0;
|
|
674
676
|
}
|
|
675
|
-
function
|
|
677
|
+
function a(c) {
|
|
676
678
|
}
|
|
677
|
-
function
|
|
679
|
+
function i() {
|
|
678
680
|
}
|
|
679
|
-
function
|
|
681
|
+
function s(c) {
|
|
680
682
|
return null;
|
|
681
683
|
}
|
|
682
684
|
return {
|
|
683
|
-
canAccepts:
|
|
684
|
-
checkCanDeleteComponent:
|
|
685
|
-
checkCanMoveComponent:
|
|
686
|
-
hideNestedPaddingInDesginerView:
|
|
687
|
-
onAcceptMovedChildElement:
|
|
688
|
-
resolveComponentContext:
|
|
689
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
685
|
+
canAccepts: r,
|
|
686
|
+
checkCanDeleteComponent: l,
|
|
687
|
+
checkCanMoveComponent: u,
|
|
688
|
+
hideNestedPaddingInDesginerView: p,
|
|
689
|
+
onAcceptMovedChildElement: a,
|
|
690
|
+
resolveComponentContext: i,
|
|
691
|
+
triggerBelongedComponentToMoveWhenMoved: t,
|
|
690
692
|
triggerBelongedComponentToDeleteWhenDeleted: o,
|
|
691
|
-
getPropsConfig:
|
|
693
|
+
getPropsConfig: s
|
|
692
694
|
};
|
|
693
695
|
}
|
|
694
|
-
class
|
|
695
|
-
constructor(
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
696
|
+
class Me {
|
|
697
|
+
constructor(n, t) {
|
|
698
|
+
x(this, "componentId");
|
|
699
|
+
x(this, "viewModelId");
|
|
700
|
+
x(this, "eventsEditorUtils");
|
|
701
|
+
x(this, "formSchemaUtils");
|
|
702
|
+
x(this, "formMetadataConverter");
|
|
703
|
+
x(this, "designViewModelUtils");
|
|
704
|
+
x(this, "designViewModelField");
|
|
705
|
+
x(this, "controlCreatorUtils");
|
|
706
|
+
x(this, "designerHostService");
|
|
707
|
+
x(this, "schemaService", null);
|
|
708
|
+
x(this, "metadataService", null);
|
|
709
|
+
x(this, "propertyConfig", {
|
|
708
710
|
type: "object",
|
|
709
711
|
categories: {}
|
|
710
712
|
});
|
|
711
713
|
var o;
|
|
712
|
-
this.componentId =
|
|
714
|
+
this.componentId = n, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(n)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService;
|
|
713
715
|
}
|
|
714
716
|
getTableInfo() {
|
|
715
|
-
var
|
|
716
|
-
return (
|
|
717
|
+
var n;
|
|
718
|
+
return (n = this.schemaService) == null ? void 0 : n.getTableInfoByViewModelId(this.viewModelId);
|
|
717
719
|
}
|
|
718
|
-
setDesignViewModelField(
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
720
|
+
setDesignViewModelField(n) {
|
|
721
|
+
const t = n.binding && n.binding.type === "Form" && n.binding.field;
|
|
722
|
+
if (t) {
|
|
721
723
|
if (!this.designViewModelField) {
|
|
722
724
|
const o = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
723
|
-
this.designViewModelField = o.fields.find((
|
|
725
|
+
this.designViewModelField = o.fields.find((r) => r.id === t);
|
|
724
726
|
}
|
|
725
|
-
|
|
727
|
+
n.updateOn = this.designViewModelField.updateOn;
|
|
726
728
|
}
|
|
727
729
|
}
|
|
728
|
-
changeFieldEditorType(
|
|
730
|
+
changeFieldEditorType(n, t) {
|
|
729
731
|
}
|
|
730
|
-
getBasicPropConfig(
|
|
732
|
+
getBasicPropConfig(n) {
|
|
731
733
|
return {
|
|
732
734
|
description: "Basic Information",
|
|
733
735
|
title: "基本信息",
|
|
@@ -746,13 +748,13 @@ class Ve {
|
|
|
746
748
|
type: "combo-list",
|
|
747
749
|
textField: "name",
|
|
748
750
|
valueField: "value",
|
|
749
|
-
data: [{ value:
|
|
751
|
+
data: [{ value: n.type, name: m[n.type].name }]
|
|
750
752
|
}
|
|
751
753
|
}
|
|
752
754
|
}
|
|
753
755
|
};
|
|
754
756
|
}
|
|
755
|
-
getAppearanceConfig(
|
|
757
|
+
getAppearanceConfig(n = null) {
|
|
756
758
|
return {
|
|
757
759
|
title: "样式",
|
|
758
760
|
description: "Appearance",
|
|
@@ -772,31 +774,44 @@ class Ve {
|
|
|
772
774
|
}
|
|
773
775
|
};
|
|
774
776
|
}
|
|
777
|
+
/**
|
|
778
|
+
*
|
|
779
|
+
* @param propertyId
|
|
780
|
+
* @param componentInstance
|
|
781
|
+
* @returns
|
|
782
|
+
*/
|
|
783
|
+
updateElementByParentContainer(n, t) {
|
|
784
|
+
const o = t && t.parent && t.parent.schema;
|
|
785
|
+
if (!o)
|
|
786
|
+
return;
|
|
787
|
+
const r = o.contents.findIndex((u) => u.id === n), l = Y(o.contents[r]);
|
|
788
|
+
o.contents.splice(r, 1), o.contents.splice(r, 0, l);
|
|
789
|
+
}
|
|
775
790
|
}
|
|
776
|
-
const
|
|
791
|
+
const A = class A {
|
|
777
792
|
/**
|
|
778
793
|
* 根据绑定字段类型获取可用的输入类控件
|
|
779
794
|
*/
|
|
780
|
-
static getEditorTypesByMDataType(
|
|
781
|
-
const
|
|
782
|
-
return
|
|
795
|
+
static getEditorTypesByMDataType(n) {
|
|
796
|
+
const t = A.fieldControlTypeMapping[n];
|
|
797
|
+
return t || [{ key: "", value: "" }];
|
|
783
798
|
}
|
|
784
799
|
/**
|
|
785
800
|
* 获取所有输入类控件
|
|
786
801
|
*/
|
|
787
802
|
static getAllInputTypes() {
|
|
788
|
-
const
|
|
789
|
-
for (let
|
|
790
|
-
|
|
791
|
-
|
|
803
|
+
const n = [];
|
|
804
|
+
for (let t in A.fieldControlTypeMapping)
|
|
805
|
+
A.fieldControlTypeMapping[t].forEach((o) => {
|
|
806
|
+
n.find((r) => r.key === o.key && r.value === o.value) || n.push({ key: o.key, value: o.value });
|
|
792
807
|
});
|
|
793
|
-
return
|
|
808
|
+
return n;
|
|
794
809
|
}
|
|
795
810
|
};
|
|
796
811
|
/**
|
|
797
812
|
* <字段类型,可配置的控件类型列表>的映射
|
|
798
813
|
*/
|
|
799
|
-
|
|
814
|
+
x(A, "fieldControlTypeMapping", {
|
|
800
815
|
String: [
|
|
801
816
|
{ key: m["input-group"].type, value: m["input-group"].name },
|
|
802
817
|
{ key: m.lookup.type, value: m.lookup.name },
|
|
@@ -842,20 +857,22 @@ F(O, "fieldControlTypeMapping", {
|
|
|
842
857
|
{ key: m["radio-group"].type, value: m["radio-group"].name }
|
|
843
858
|
]
|
|
844
859
|
});
|
|
845
|
-
let
|
|
846
|
-
const
|
|
847
|
-
class
|
|
848
|
-
constructor(t,
|
|
849
|
-
super(t,
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
860
|
+
let q = A;
|
|
861
|
+
const Te = V(0);
|
|
862
|
+
class xe extends Me {
|
|
863
|
+
constructor(t, o) {
|
|
864
|
+
super(t, o);
|
|
865
|
+
x(this, "responseLayoutEditorFunction");
|
|
866
|
+
this.responseLayoutEditorFunction = ae(this.formSchemaUtils);
|
|
867
|
+
}
|
|
868
|
+
getPropertyConfig(t, o) {
|
|
869
|
+
return this.propertyConfig.categories.basic = this.getBasicProperties(t, o), this.propertyConfig.categories.appearance = this.getAppearanceProperties(t, o), this.propertyConfig.categories.editor = this.getEditorProperties(t), this.propertyConfig;
|
|
870
|
+
}
|
|
871
|
+
getBasicProperties(t, o) {
|
|
872
|
+
var p;
|
|
873
|
+
var r = this;
|
|
857
874
|
this.setDesignViewModelField(t);
|
|
858
|
-
const
|
|
875
|
+
const l = this.formSchemaUtils.getFormMetadataBasicInfo(), u = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
|
|
859
876
|
return {
|
|
860
877
|
description: "Basic Information",
|
|
861
878
|
title: "基本信息",
|
|
@@ -867,8 +884,8 @@ class Te extends Ve {
|
|
|
867
884
|
readonly: !0
|
|
868
885
|
},
|
|
869
886
|
type: {
|
|
870
|
-
description: "
|
|
871
|
-
title: "
|
|
887
|
+
description: "编辑器类型",
|
|
888
|
+
title: "编辑器类型",
|
|
872
889
|
type: "string",
|
|
873
890
|
refreshPanelAfterChanged: !0,
|
|
874
891
|
$converter: "/converter/change-editor.converter",
|
|
@@ -877,7 +894,7 @@ class Te extends Ve {
|
|
|
877
894
|
textField: "value",
|
|
878
895
|
valueField: "key",
|
|
879
896
|
editable: !1,
|
|
880
|
-
data:
|
|
897
|
+
data: r.designViewModelField ? q.getEditorTypesByMDataType((p = r.designViewModelField.type) == null ? void 0 : p.name) : q.getAllInputTypes()
|
|
881
898
|
}
|
|
882
899
|
},
|
|
883
900
|
label: {
|
|
@@ -894,7 +911,7 @@ class Te extends Ve {
|
|
|
894
911
|
bindingType: { enable: !1 },
|
|
895
912
|
editorParams: {
|
|
896
913
|
propertyData: t,
|
|
897
|
-
formBasicInfo:
|
|
914
|
+
formBasicInfo: l
|
|
898
915
|
},
|
|
899
916
|
columns: [
|
|
900
917
|
{ field: "name", title: "字段名称" },
|
|
@@ -902,22 +919,27 @@ class Te extends Ve {
|
|
|
902
919
|
{ field: "fieldType", title: "字段类型" }
|
|
903
920
|
],
|
|
904
921
|
textField: "bindingField",
|
|
905
|
-
data:
|
|
922
|
+
data: u
|
|
906
923
|
}
|
|
907
924
|
}
|
|
908
925
|
},
|
|
909
|
-
setPropertyRelates(
|
|
910
|
-
if (
|
|
911
|
-
switch (
|
|
926
|
+
setPropertyRelates(a, i) {
|
|
927
|
+
if (a)
|
|
928
|
+
switch (a && a.propertyID) {
|
|
912
929
|
case "type": {
|
|
913
|
-
|
|
930
|
+
r.changeControlType(t, a, o);
|
|
931
|
+
break;
|
|
932
|
+
}
|
|
933
|
+
case "label": {
|
|
934
|
+
a.needRefreshControlTree = !0;
|
|
914
935
|
break;
|
|
915
936
|
}
|
|
916
937
|
}
|
|
917
938
|
}
|
|
918
939
|
};
|
|
919
940
|
}
|
|
920
|
-
getAppearanceProperties(t) {
|
|
941
|
+
getAppearanceProperties(t, o) {
|
|
942
|
+
var r = this;
|
|
921
943
|
return {
|
|
922
944
|
title: "样式",
|
|
923
945
|
description: "Appearance",
|
|
@@ -938,12 +960,25 @@ class Te extends Ve {
|
|
|
938
960
|
description: "响应式列宽",
|
|
939
961
|
title: "响应式列宽",
|
|
940
962
|
type: "boolean",
|
|
941
|
-
visible: !
|
|
963
|
+
visible: !0,
|
|
964
|
+
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
965
|
+
refreshPanelAfterChanged: !0,
|
|
942
966
|
editor: {
|
|
943
|
-
type: "response-layout-editor-setting"
|
|
944
|
-
|
|
945
|
-
|
|
967
|
+
type: "response-layout-editor-setting",
|
|
968
|
+
initialState: r.responseLayoutEditorFunction.checkCanOpenLayoutEditor(t, r.componentId)
|
|
969
|
+
}
|
|
946
970
|
}
|
|
971
|
+
},
|
|
972
|
+
setPropertyRelates(l, u) {
|
|
973
|
+
if (l)
|
|
974
|
+
switch (l && l.propertyID) {
|
|
975
|
+
case "responseLayout":
|
|
976
|
+
r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(l.propertyValue, r.componentId || t.id), r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId), r.updateElementByParentContainer(t.id, o), delete t.responseLayout;
|
|
977
|
+
break;
|
|
978
|
+
case "class":
|
|
979
|
+
r.updateUnifiedLayoutAfterControlChanged(l.propertyValue, t.id, this.componentId), r.updateElementByParentContainer(t.id, o);
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
947
982
|
}
|
|
948
983
|
};
|
|
949
984
|
}
|
|
@@ -955,44 +990,44 @@ class Te extends Ve {
|
|
|
955
990
|
* @param propertyData 控件DOM属性
|
|
956
991
|
* @param newControlType 新控件类型
|
|
957
992
|
*/
|
|
958
|
-
changeControlType(t,
|
|
959
|
-
var
|
|
960
|
-
const
|
|
961
|
-
if (!
|
|
993
|
+
changeControlType(t, o, r) {
|
|
994
|
+
var s, c, d, g;
|
|
995
|
+
const l = o.propertyValue, u = r && r.parent && r.parent.schema;
|
|
996
|
+
if (!u)
|
|
962
997
|
return;
|
|
963
|
-
const
|
|
998
|
+
const p = u.contents.findIndex((f) => f.id === t.id), a = u.contents[p];
|
|
964
999
|
let i;
|
|
965
1000
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
966
1001
|
editor: {
|
|
967
|
-
$type:
|
|
1002
|
+
$type: l
|
|
968
1003
|
},
|
|
969
1004
|
name: this.designViewModelField.name,
|
|
970
1005
|
require: this.designViewModelField.require,
|
|
971
1006
|
readonly: this.designViewModelField.readonly
|
|
972
|
-
}, !1), i = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,
|
|
973
|
-
id:
|
|
974
|
-
appearance:
|
|
975
|
-
size:
|
|
976
|
-
label:
|
|
977
|
-
binding:
|
|
978
|
-
visible:
|
|
1007
|
+
}, !1), i = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, l)), i || (i = J("form-group") || {}, i.editor = J(l) || {}, delete i.editor.id, delete i.editor.binding, delete i.editor.appearance), Object.assign(i, {
|
|
1008
|
+
id: a.id,
|
|
1009
|
+
appearance: a.appearance,
|
|
1010
|
+
size: a.size,
|
|
1011
|
+
label: a.label,
|
|
1012
|
+
binding: a.binding,
|
|
1013
|
+
visible: a.visible
|
|
979
1014
|
}), Object.assign(i.editor, {
|
|
980
|
-
isTextArea: i.isTextArea &&
|
|
981
|
-
placeholder: (
|
|
982
|
-
holdPlace: (
|
|
983
|
-
readonly: (
|
|
984
|
-
require: (
|
|
985
|
-
}),
|
|
1015
|
+
isTextArea: i.isTextArea && a.isTextArea,
|
|
1016
|
+
placeholder: (s = a.editor) == null ? void 0 : s.placeholder,
|
|
1017
|
+
holdPlace: (c = a.editor) == null ? void 0 : c.holdPlace,
|
|
1018
|
+
readonly: (d = a.editor) == null ? void 0 : d.readonly,
|
|
1019
|
+
require: (g = a.editor) == null ? void 0 : g.require
|
|
1020
|
+
}), u.contents.splice(p, 1), u.contents.splice(p, 0, i), r.schema = Object.assign(a, i), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
986
1021
|
(f) => f.classList.remove("dgComponentSelected")
|
|
987
|
-
),
|
|
1022
|
+
), Te.value++;
|
|
988
1023
|
}
|
|
989
|
-
getComponentConfig(t,
|
|
990
|
-
const
|
|
991
|
-
description: "
|
|
992
|
-
title: "
|
|
1024
|
+
getComponentConfig(t, o = {}, r = {}) {
|
|
1025
|
+
const l = Object.assign({
|
|
1026
|
+
description: "编辑器",
|
|
1027
|
+
title: "编辑器",
|
|
993
1028
|
type: "input-group",
|
|
994
1029
|
$converter: "/converter/property-editor.converter"
|
|
995
|
-
},
|
|
1030
|
+
}, o), u = Object.assign({
|
|
996
1031
|
readonly: {
|
|
997
1032
|
description: "",
|
|
998
1033
|
title: "只读",
|
|
@@ -1013,16 +1048,64 @@ class Te extends Ve {
|
|
|
1013
1048
|
title: "提示文本",
|
|
1014
1049
|
type: "string"
|
|
1015
1050
|
}
|
|
1016
|
-
},
|
|
1017
|
-
return { ...
|
|
1051
|
+
}, r);
|
|
1052
|
+
return { ...l, properties: { ...u } };
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
1056
|
+
* @param controlClass 控件样式
|
|
1057
|
+
* @param controlId 控件Id
|
|
1058
|
+
* @param componentId 控件所在组件id
|
|
1059
|
+
*/
|
|
1060
|
+
updateUnifiedLayoutAfterControlChanged(t, o, r) {
|
|
1061
|
+
const l = t.split(" ");
|
|
1062
|
+
let u = l.find((c) => /^col-([1-9]|10|11|12)$/.test(c)), p = l.find((c) => /^col-md-([1-9]|10|11|12)$/.test(c)), a = l.find((c) => /^col-xl-([1-9]|10|11|12)$/.test(c)), i = l.find((c) => /^col-el-([1-9]|10|11|12)$/.test(c));
|
|
1063
|
+
u = u || "col-12", p = p || "col-md-" + u.replace("col-", ""), a = a || "col-xl-" + p.replace("col-md-", ""), i = i || "col-el-" + a.replace("col-xl-", "");
|
|
1064
|
+
const s = {
|
|
1065
|
+
id: o,
|
|
1066
|
+
columnInSM: parseInt(u.replace("col-", ""), 10),
|
|
1067
|
+
columnInMD: parseInt(p.replace("col-md-", ""), 10),
|
|
1068
|
+
columnInLG: parseInt(a.replace("col-xl-", ""), 10),
|
|
1069
|
+
columnInEL: parseInt(i.replace("col-el-", ""), 10)
|
|
1070
|
+
};
|
|
1071
|
+
this.updateUnifiedLayoutAfterResponseLayoutChanged(r, s);
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* 修改控件布局配置后更新Form统一布局配置
|
|
1075
|
+
* @param componentId 组件Id
|
|
1076
|
+
* @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
|
|
1077
|
+
*/
|
|
1078
|
+
updateUnifiedLayoutAfterResponseLayoutChanged(t, o) {
|
|
1079
|
+
const { formNode: r } = this.responseLayoutEditorFunction.checkCanFindFormNode(t);
|
|
1080
|
+
if (!r || !r.unifiedLayout)
|
|
1081
|
+
return;
|
|
1082
|
+
const l = [];
|
|
1083
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r, l, 1), o) {
|
|
1084
|
+
const f = l.find((w) => w.id === o.id);
|
|
1085
|
+
Object.assign(f || {}, o);
|
|
1086
|
+
}
|
|
1087
|
+
const u = l.map((f) => f.columnInSM), p = l.map((f) => f.columnInMD), a = l.map((f) => f.columnInLG), i = l.map((f) => f.columnInEL), s = this.checkIsUniqueColumn(u) ? u[0] : null, c = this.checkIsUniqueColumn(p) ? p[0] : null, d = this.checkIsUniqueColumn(a) ? a[0] : null, g = this.checkIsUniqueColumn(i) ? i[0] : null;
|
|
1088
|
+
Object.assign(r.unifiedLayout, {
|
|
1089
|
+
uniqueColClassInSM: s,
|
|
1090
|
+
uniqueColClassInMD: c,
|
|
1091
|
+
uniqueColClassInLG: d,
|
|
1092
|
+
uniqueColClassInEL: g
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* 校验宽度样式值是否一致
|
|
1097
|
+
*/
|
|
1098
|
+
checkIsUniqueColumn(t) {
|
|
1099
|
+
const o = new Set(t);
|
|
1100
|
+
return Array.from(o).length === 1;
|
|
1018
1101
|
}
|
|
1019
1102
|
}
|
|
1020
|
-
class
|
|
1021
|
-
constructor(
|
|
1022
|
-
super(
|
|
1103
|
+
class Fe extends xe {
|
|
1104
|
+
constructor(n, t) {
|
|
1105
|
+
super(n, t);
|
|
1023
1106
|
}
|
|
1024
|
-
getEditorProperties(
|
|
1025
|
-
return this.getComponentConfig(
|
|
1107
|
+
getEditorProperties(n) {
|
|
1108
|
+
return this.getComponentConfig(n, { type: "number-range" }, {
|
|
1026
1109
|
editable: {
|
|
1027
1110
|
description: "",
|
|
1028
1111
|
title: "允许编辑",
|
|
@@ -1031,90 +1114,90 @@ class Me extends Te {
|
|
|
1031
1114
|
});
|
|
1032
1115
|
}
|
|
1033
1116
|
}
|
|
1034
|
-
function
|
|
1117
|
+
function Ee(e, n) {
|
|
1035
1118
|
const {
|
|
1036
|
-
canAccepts:
|
|
1119
|
+
canAccepts: t,
|
|
1037
1120
|
checkCanDeleteComponent: o,
|
|
1038
|
-
checkCanMoveComponent:
|
|
1039
|
-
hideNestedPaddingInDesginerView:
|
|
1040
|
-
onAcceptMovedChildElement:
|
|
1041
|
-
resolveComponentContext:
|
|
1042
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1043
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
1044
|
-
} =
|
|
1045
|
-
function
|
|
1046
|
-
return new
|
|
1121
|
+
checkCanMoveComponent: r,
|
|
1122
|
+
hideNestedPaddingInDesginerView: l,
|
|
1123
|
+
onAcceptMovedChildElement: u,
|
|
1124
|
+
resolveComponentContext: p,
|
|
1125
|
+
triggerBelongedComponentToMoveWhenMoved: a,
|
|
1126
|
+
triggerBelongedComponentToDeleteWhenDeleted: i
|
|
1127
|
+
} = Ve(e), s = e.schema;
|
|
1128
|
+
function c(d, g) {
|
|
1129
|
+
return new Fe(d, n).getPropertyConfig(s, g);
|
|
1047
1130
|
}
|
|
1048
1131
|
return {
|
|
1049
|
-
canAccepts:
|
|
1132
|
+
canAccepts: t,
|
|
1050
1133
|
checkCanDeleteComponent: o,
|
|
1051
|
-
checkCanMoveComponent:
|
|
1052
|
-
hideNestedPaddingInDesginerView:
|
|
1053
|
-
onAcceptMovedChildElement:
|
|
1054
|
-
resolveComponentContext:
|
|
1055
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1056
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
1057
|
-
getPropsConfig:
|
|
1134
|
+
checkCanMoveComponent: r,
|
|
1135
|
+
hideNestedPaddingInDesginerView: l,
|
|
1136
|
+
onAcceptMovedChildElement: u,
|
|
1137
|
+
resolveComponentContext: p,
|
|
1138
|
+
triggerBelongedComponentToMoveWhenMoved: a,
|
|
1139
|
+
triggerBelongedComponentToDeleteWhenDeleted: i,
|
|
1140
|
+
getPropsConfig: c
|
|
1058
1141
|
};
|
|
1059
1142
|
}
|
|
1060
|
-
const
|
|
1143
|
+
const Pe = /* @__PURE__ */ X({
|
|
1061
1144
|
name: "FNumberRangeDesign",
|
|
1062
|
-
props:
|
|
1145
|
+
props: z,
|
|
1063
1146
|
emits: ["valueChange", "blur", "focus", "click", "input", "beginValueChange", "endValueChange"],
|
|
1064
|
-
setup(e,
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
},
|
|
1147
|
+
setup(e, n) {
|
|
1148
|
+
const t = V(e.beginValue), o = V(""), r = V(e.endValue), l = V(""), u = te(e), p = ne(e, n, u), a = (v) => {
|
|
1149
|
+
n.emit("beginValueChange", v);
|
|
1150
|
+
}, i = V(), s = Z("designer-host-service"), c = Z("design-item-context"), d = Ee(c, s), g = Ne(i, c, d);
|
|
1068
1151
|
G(() => {
|
|
1069
|
-
|
|
1070
|
-
}),
|
|
1071
|
-
const
|
|
1072
|
-
|
|
1073
|
-
},
|
|
1074
|
-
getRealValue:
|
|
1075
|
-
} =
|
|
1076
|
-
format:
|
|
1077
|
-
} =
|
|
1152
|
+
i.value.componentInstance = g;
|
|
1153
|
+
}), n.expose(g.value);
|
|
1154
|
+
const f = O(e, n, o, t, p, u, a, t, r, !0), w = j(e, n, o, t, p, u, f, a, t, r, !0), D = I(e, n, f), E = U(e, n, w, !0), F = (v) => {
|
|
1155
|
+
n.emit("endValueChange", v);
|
|
1156
|
+
}, S = O(e, n, l, r, p, u, F, t, r, !1), B = j(e, n, l, r, p, u, S, F, t, r, !1), N = I(e, n, S), y = U(e, n, B, !1), {
|
|
1157
|
+
getRealValue: C
|
|
1158
|
+
} = u, {
|
|
1159
|
+
format: b
|
|
1160
|
+
} = p, h = P(() => !e.disabled && !e.readonly && e.showButton);
|
|
1078
1161
|
return G(() => {
|
|
1079
|
-
const
|
|
1080
|
-
o.value =
|
|
1081
|
-
}),
|
|
1082
|
-
const
|
|
1083
|
-
o.value =
|
|
1084
|
-
}),
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
}),
|
|
1088
|
-
o.value =
|
|
1089
|
-
}), () =>
|
|
1090
|
-
ref:
|
|
1162
|
+
const v = C(e.beginValue), k = C(e.endValue);
|
|
1163
|
+
o.value = b(v), l.value = b(k);
|
|
1164
|
+
}), L(() => [e.beginValue], ([v]) => {
|
|
1165
|
+
const k = C(v);
|
|
1166
|
+
o.value = b(k);
|
|
1167
|
+
}), L(() => [e.endValue], ([v]) => {
|
|
1168
|
+
const k = C(v);
|
|
1169
|
+
l.value = b(k);
|
|
1170
|
+
}), L(() => [e.precision, e.useThousands, e.prefix, e.suffix, e.showZero], () => {
|
|
1171
|
+
o.value = b(t.value), l.value = b(r.value);
|
|
1172
|
+
}), () => T("div", {
|
|
1173
|
+
ref: i,
|
|
1091
1174
|
class: "input-group number-range f-cmp-number-spinner"
|
|
1092
|
-
}, [
|
|
1175
|
+
}, [T("div", {
|
|
1093
1176
|
class: "form-control input-container"
|
|
1094
|
-
}, [
|
|
1177
|
+
}, [T("div", {
|
|
1095
1178
|
class: "sub-input-group"
|
|
1096
|
-
}, [
|
|
1179
|
+
}, [E(), h.value && D()]), T("span", {
|
|
1097
1180
|
class: "spliter"
|
|
1098
|
-
}, [
|
|
1181
|
+
}, [Q("~")]), T("div", {
|
|
1099
1182
|
class: "sub-input-group"
|
|
1100
|
-
}, [y(),
|
|
1183
|
+
}, [y(), h.value && N()])])]);
|
|
1101
1184
|
}
|
|
1102
1185
|
}), De = (e) => {
|
|
1103
|
-
const
|
|
1104
|
-
return
|
|
1105
|
-
|
|
1186
|
+
const n = e;
|
|
1187
|
+
return n.install = function(t) {
|
|
1188
|
+
t.component(n.name, e);
|
|
1106
1189
|
}, e;
|
|
1107
1190
|
};
|
|
1108
|
-
|
|
1109
|
-
e["number-range"] =
|
|
1191
|
+
$.register = (e, n, t, o) => {
|
|
1192
|
+
e["number-range"] = $, n["number-range"] = ee;
|
|
1110
1193
|
};
|
|
1111
|
-
|
|
1112
|
-
e["number-range"] =
|
|
1194
|
+
$.registerDesigner = (e, n, t) => {
|
|
1195
|
+
e["number-range"] = Pe, n["number-range"] = ee;
|
|
1113
1196
|
};
|
|
1114
|
-
const
|
|
1197
|
+
const $e = De($);
|
|
1115
1198
|
export {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1199
|
+
$ as FNumberRange,
|
|
1200
|
+
$e as default,
|
|
1201
|
+
z as numberRangeProps,
|
|
1202
|
+
ee as propsResolver
|
|
1120
1203
|
};
|