@farris/ui-vue 1.3.0 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +103 -99
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +454 -398
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +444 -0
- package/components/binding-selector/index.umd.cjs +1 -0
- package/components/binding-selector/package.json +8 -0
- package/components/border-editor/index.esm.js +5 -3
- package/components/border-editor/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +143 -139
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +479 -476
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +255 -252
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +652 -567
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +518 -521
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +659 -553
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +162 -155
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +866 -747
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +371 -998
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1174 -1280
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +340 -991
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +6066 -5847
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3400 -3486
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2328 -2446
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9551 -1200
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +2 -1
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +34 -38
- package/components/drawer/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +234 -231
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1996 -2630
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +138 -123
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +218 -218
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +311 -0
- package/components/event-parameter/index.umd.cjs +1 -0
- package/components/event-parameter/package.json +8 -0
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +548 -586
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +95 -91
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2871 -3736
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3380 -3645
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10543 -3207
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9775 -1312
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +442 -438
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +587 -807
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +415 -381
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +361 -1024
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2265 -2371
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6425 -6257
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +6164 -5946
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +252 -252
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +70 -70
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +524 -1474
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +547 -502
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +646 -574
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1181 -2028
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +134 -131
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1185 -2027
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +442 -1368
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +238 -235
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1635 -1713
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +791 -716
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12203 -5274
- package/components/query-solution/index.umd.cjs +6 -1
- package/components/radio-button/index.esm.js +97 -97
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.css +1 -1
- package/components/radio-group/index.esm.js +1873 -520
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +299 -300
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +176 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +715 -659
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +1032 -1883
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4767 -5693
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +169 -161
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +490 -1167
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +154 -151
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +575 -1204
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +279 -276
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +478 -428
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +2591 -3326
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +442 -439
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +309 -307
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +500 -430
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +1391 -1341
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +574 -575
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3422 -3536
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2661 -2764
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +675 -674
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +300 -297
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +454 -1089
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +709 -706
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +54780 -52757
- package/farris.all.umd.cjs +14 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/binding-selector/index.d.ts +55 -0
- package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
- package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
- package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
- package/types/combo-list/src/components/list-container.component.d.ts +6 -6
- package/types/combo-list/src/components/list-container.props.d.ts +1 -1
- package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
- package/types/common/directive/area-response.d.ts +10 -0
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +9 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +5 -4
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +8 -5
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
- package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
- package/types/data-grid/src/data-grid.component.d.ts +3 -2
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +9 -11
- package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
- package/types/date-picker/src/components/month/month.component.d.ts +3 -3
- package/types/date-picker/src/components/year/year.component.d.ts +3 -3
- package/types/designer-canvas/index.d.ts +3 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
- package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -41
- package/types/designer-canvas/src/types.d.ts +10 -21
- package/types/dynamic-form/index.d.ts +1 -1
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/designer/response-form-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +1 -1
- package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +6 -1
- package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
- package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
- package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
- package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
- package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
- package/types/event-parameter/index.d.ts +31 -0
- package/types/event-parameter/src/composition/type.d.ts +77 -0
- package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
- package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
- package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
- package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/field-selector/src/field-selector.component.d.ts +1 -2
- package/types/field-selector/src/field-selector.props.d.ts +0 -9
- package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
- package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
- package/types/list-view/src/list-view-table.component.d.ts +15 -0
- package/types/lookup/src/composition/use-user-data.d.ts +2 -2
- package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
- package/types/modal/src/composition/modal.service.d.ts +2 -1
- package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
- package/types/page-header/src/page-header.component.d.ts +1 -1
- package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +3 -1
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -1
- package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
- package/types/property-panel/src/composition/type.d.ts +0 -13
- package/types/query-solution/src/composition/types.d.ts +35 -4
- package/types/query-solution/src/composition/use-header.d.ts +21 -0
- package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
- package/types/query-solution/src/composition/use-solution.d.ts +20 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +43 -35
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/query-solution/src/designer/query-solution-config/composition/use-property.d.ts +19 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +12 -0
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/query-solution/src/solutions.d.ts +108 -509
- package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
- package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
- package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
- package/types/response-layout-editor/index.d.ts +3 -1
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- package/types/section/src/property-config/section.property-config.d.ts +17 -17
- package/types/section/src/schema/schema-resolver.d.ts +1 -2
- package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
- package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
- package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
- package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
- package/types/text/src/composition/types.d.ts +4 -4
- package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
- package/types/tree-grid/index.d.ts +3 -3
- package/types/tree-grid/src/tree-grid.component.d.ts +1 -1
- package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
- package/types/weather/src/composition/use-weather-color.d.ts +15 -0
- package/types/weather/src/composition/use-weather-data.d.ts +15 -0
- package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
- package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +0 -3
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
|
@@ -1,102 +1,106 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { isPlainObject as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
const { properties: t, title: e, ignore:
|
|
11
|
-
|
|
1
|
+
var Y = Object.defineProperty;
|
|
2
|
+
var Z = (s, t, e) => t in s ? Y(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var v = (s, t, e) => Z(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { defineComponent as q, toRefs as O, ref as P, computed as B, watch as U, createVNode as F, inject as $, onMounted as _ } from "vue";
|
|
5
|
+
import { isPlainObject as G, cloneDeep as j } from "lodash-es";
|
|
6
|
+
import { DgControl as W } from "../designer-canvas/index.esm.js";
|
|
7
|
+
import { withInstall as K } from "../common/index.esm.js";
|
|
8
|
+
const z = {}, X = {};
|
|
9
|
+
function A(s) {
|
|
10
|
+
const { properties: t, title: e, ignore: i } = s, n = i && Array.isArray(i), r = Object.keys(t).reduce((l, f) => ((!n || !i.find((y) => y === f)) && (l[f] = t[f].type === "object" && t[f].properties ? A(t[f]) : j(t[f].default)), l), {});
|
|
11
|
+
if (e && (!n || !i.find((l) => l === "id"))) {
|
|
12
|
+
const l = e.toLowerCase().replace(/-/g, "_");
|
|
13
|
+
r.id = `${l}_${Math.random().toString().slice(2, 6)}`;
|
|
14
|
+
}
|
|
15
|
+
return r;
|
|
12
16
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
let n =
|
|
17
|
-
const
|
|
18
|
-
return n =
|
|
17
|
+
function Q(s, t = {}, e) {
|
|
18
|
+
const i = z[s];
|
|
19
|
+
if (i) {
|
|
20
|
+
let n = A(i);
|
|
21
|
+
const r = X[s];
|
|
22
|
+
return n = r ? r({ getSchemaByType: Q }, n, t, e) : n, n;
|
|
19
23
|
}
|
|
20
24
|
return null;
|
|
21
25
|
}
|
|
22
|
-
function
|
|
23
|
-
const e =
|
|
24
|
-
return Object.keys(
|
|
26
|
+
function R(s, t) {
|
|
27
|
+
const e = A(t);
|
|
28
|
+
return Object.keys(e).reduce((i, n) => (i[n] && G(i[n]) && G(s[n] || !s[n]) ? Object.assign(i[n], s[n] || {}) : i[n] = s[n], i), e), e;
|
|
25
29
|
}
|
|
26
|
-
function
|
|
27
|
-
return Object.keys(
|
|
30
|
+
function x(s, t) {
|
|
31
|
+
return Object.keys(s).filter((i) => s[i] != null).reduce((i, n) => {
|
|
28
32
|
if (t.has(n)) {
|
|
29
|
-
const
|
|
30
|
-
if (typeof
|
|
31
|
-
|
|
33
|
+
const r = t.get(n);
|
|
34
|
+
if (typeof r == "string")
|
|
35
|
+
i[r] = s[n];
|
|
32
36
|
else {
|
|
33
|
-
const
|
|
34
|
-
Object.assign(
|
|
37
|
+
const l = r(n, s[n], s);
|
|
38
|
+
Object.assign(i, l);
|
|
35
39
|
}
|
|
36
40
|
} else
|
|
37
|
-
|
|
38
|
-
return
|
|
41
|
+
i[n] = s[n];
|
|
42
|
+
return i;
|
|
39
43
|
}, {});
|
|
40
44
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
return
|
|
45
|
+
function ee(s, t, e = /* @__PURE__ */ new Map()) {
|
|
46
|
+
const i = R(s, t);
|
|
47
|
+
return x(i, e);
|
|
44
48
|
}
|
|
45
|
-
function
|
|
46
|
-
function t(
|
|
47
|
-
if (typeof
|
|
48
|
-
return
|
|
49
|
-
if (typeof
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
return Number(
|
|
53
|
-
if (
|
|
54
|
-
return Number(
|
|
55
|
-
if (
|
|
56
|
-
return Number(
|
|
49
|
+
function te(s = {}) {
|
|
50
|
+
function t(a, c, o, p) {
|
|
51
|
+
if (typeof o == "number")
|
|
52
|
+
return p[a].length === o;
|
|
53
|
+
if (typeof o == "object") {
|
|
54
|
+
const m = Object.keys(o)[0], d = o[m];
|
|
55
|
+
if (m === "not")
|
|
56
|
+
return Number(p[a].length) !== Number(d);
|
|
57
|
+
if (m === "moreThan")
|
|
58
|
+
return Number(p[a].length) >= Number(d);
|
|
59
|
+
if (m === "lessThan")
|
|
60
|
+
return Number(p[a].length) <= Number(d);
|
|
57
61
|
}
|
|
58
62
|
return !1;
|
|
59
63
|
}
|
|
60
|
-
function e(
|
|
61
|
-
return
|
|
64
|
+
function e(a, c, o, p) {
|
|
65
|
+
return p[a] && p[a].propertyValue && String(p[a].propertyValue.value) === String(o);
|
|
62
66
|
}
|
|
63
|
-
const
|
|
67
|
+
const i = /* @__PURE__ */ new Map([
|
|
64
68
|
["length", t],
|
|
65
69
|
["getProperty", e]
|
|
66
70
|
]);
|
|
67
|
-
Object.keys(
|
|
68
|
-
function n(
|
|
69
|
-
const
|
|
70
|
-
return typeof
|
|
71
|
-
if (
|
|
72
|
-
return { target:
|
|
73
|
-
const
|
|
74
|
-
return { target:
|
|
71
|
+
Object.keys(s).reduce((a, c) => (a.set(c, s[c]), a), i);
|
|
72
|
+
function n(a, c) {
|
|
73
|
+
const o = a;
|
|
74
|
+
return typeof c == "number" ? [{ target: o, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: o, operator: "getProperty", param: a, value: !!c }] : typeof c == "object" ? Object.keys(c).map((p) => {
|
|
75
|
+
if (p === "length")
|
|
76
|
+
return { target: o, operator: "length", param: null, value: c[p] };
|
|
77
|
+
const m = p, d = c[p];
|
|
78
|
+
return { target: o, operator: "getProperty", param: m, value: d };
|
|
75
79
|
}) : [];
|
|
76
80
|
}
|
|
77
|
-
function
|
|
78
|
-
return Object.keys(
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
+
function r(a) {
|
|
82
|
+
return Object.keys(a).reduce((o, p) => {
|
|
83
|
+
const m = n(p, a[p]);
|
|
84
|
+
return o.push(...m), o;
|
|
81
85
|
}, []);
|
|
82
86
|
}
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
+
function l(a, c) {
|
|
88
|
+
if (i.has(a.operator)) {
|
|
89
|
+
const o = i.get(a.operator);
|
|
90
|
+
return o && o(a.target, a.param, a.value, c) || !1;
|
|
87
91
|
}
|
|
88
92
|
return !1;
|
|
89
93
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
94
|
+
function f(a, c) {
|
|
95
|
+
return r(a).reduce((m, d) => m && l(d, c), !0);
|
|
92
96
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
return
|
|
97
|
+
function y(a, c) {
|
|
98
|
+
const o = Object.keys(a), p = o.includes("allOf"), m = o.includes("anyOf"), d = p || m, b = (d ? a[d ? p ? "allOf" : "anyOf" : "allOf"] : [a]).map((E) => f(E, c));
|
|
99
|
+
return p ? !b.includes(!1) : b.includes(!0);
|
|
96
100
|
}
|
|
97
|
-
return { parseValueSchema:
|
|
101
|
+
return { parseValueSchema: y };
|
|
98
102
|
}
|
|
99
|
-
const
|
|
103
|
+
const u = {
|
|
100
104
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
101
105
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
102
106
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -134,21 +138,22 @@ const p = {
|
|
|
134
138
|
"page-header": { type: "page-header", name: "页头", icon: "Header" },
|
|
135
139
|
"page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
|
|
136
140
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
137
|
-
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
|
|
138
|
-
|
|
139
|
-
oe
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
142
|
+
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
143
|
+
}, ne = {}, oe = {};
|
|
144
|
+
te();
|
|
145
|
+
function ie(s, t, e = /* @__PURE__ */ new Map(), i = (l, f, y, a) => f, n = {}, r = (l) => l) {
|
|
146
|
+
return z[t.title] = t, X[t.title] = i, ne[t.title] = n, oe[t.title] = r, (l = {}) => {
|
|
147
|
+
const f = ee(l, t, e), y = Object.keys(s).reduce((a, c) => (a[c] = s[c].default, a), {});
|
|
148
|
+
return Object.assign(y, f);
|
|
144
149
|
};
|
|
145
150
|
}
|
|
146
|
-
function
|
|
151
|
+
function re(s, t) {
|
|
147
152
|
return { customClass: t.class, customStyle: t.style };
|
|
148
153
|
}
|
|
149
|
-
const
|
|
150
|
-
["appearance",
|
|
151
|
-
]),
|
|
154
|
+
const ae = /* @__PURE__ */ new Map([
|
|
155
|
+
["appearance", re]
|
|
156
|
+
]), se = "https://json-schema.org/draft/2020-12/schema", le = "https://farris-design.gitee.io/switch.schema.json", ce = "switch", pe = "A Farris Component", ue = "object", de = {
|
|
152
157
|
id: {
|
|
153
158
|
description: "The unique identifier for a switch",
|
|
154
159
|
type: "string"
|
|
@@ -218,33 +223,37 @@ const le = /* @__PURE__ */ new Map([
|
|
|
218
223
|
size: {
|
|
219
224
|
description: "",
|
|
220
225
|
type: "enum",
|
|
221
|
-
default: "
|
|
226
|
+
default: "medium"
|
|
222
227
|
}
|
|
223
|
-
},
|
|
228
|
+
}, me = [
|
|
224
229
|
"id",
|
|
225
230
|
"type"
|
|
226
|
-
],
|
|
231
|
+
], fe = [
|
|
227
232
|
"id",
|
|
228
233
|
"appearance",
|
|
229
234
|
"binding"
|
|
230
|
-
],
|
|
231
|
-
$schema:
|
|
232
|
-
$id:
|
|
233
|
-
title:
|
|
234
|
-
description:
|
|
235
|
-
type:
|
|
236
|
-
properties:
|
|
237
|
-
required:
|
|
238
|
-
ignore:
|
|
235
|
+
], ye = {
|
|
236
|
+
$schema: se,
|
|
237
|
+
$id: le,
|
|
238
|
+
title: ce,
|
|
239
|
+
description: pe,
|
|
240
|
+
type: ue,
|
|
241
|
+
properties: de,
|
|
242
|
+
required: me,
|
|
243
|
+
ignore: fe
|
|
239
244
|
};
|
|
240
|
-
function
|
|
245
|
+
function he(s, t, e) {
|
|
241
246
|
return t;
|
|
242
247
|
}
|
|
243
248
|
const N = {
|
|
244
249
|
/** 组件值*/
|
|
245
250
|
modelValue: { type: Boolean, default: !1 },
|
|
246
251
|
/** 禁用 */
|
|
247
|
-
disabled: { type: Boolean },
|
|
252
|
+
disabled: { type: Boolean, default: !1 },
|
|
253
|
+
/**
|
|
254
|
+
* 同disabled
|
|
255
|
+
*/
|
|
256
|
+
readonly: { type: Boolean, default: !1 },
|
|
248
257
|
onBackground: { type: String },
|
|
249
258
|
offBackground: { type: String },
|
|
250
259
|
onColor: { type: String },
|
|
@@ -256,184 +265,182 @@ const N = {
|
|
|
256
265
|
/** 开关值变化事件 */
|
|
257
266
|
onModelValueChanged: { type: Function, default: () => {
|
|
258
267
|
} }
|
|
259
|
-
},
|
|
268
|
+
}, H = ie(N, ye, ae, he), V = /* @__PURE__ */ q({
|
|
260
269
|
name: "FSwitch",
|
|
261
270
|
props: N,
|
|
262
271
|
emits: ["update:modelValue", "modelValueChanged"],
|
|
263
|
-
setup(
|
|
272
|
+
setup(s, t) {
|
|
264
273
|
const {
|
|
265
274
|
disabled: e,
|
|
266
|
-
size:
|
|
275
|
+
size: i,
|
|
267
276
|
onLabel: n,
|
|
268
|
-
offLabel:
|
|
269
|
-
onBackground:
|
|
270
|
-
offBackground:
|
|
271
|
-
onColor:
|
|
272
|
-
offColor:
|
|
273
|
-
|
|
277
|
+
offLabel: r,
|
|
278
|
+
onBackground: l,
|
|
279
|
+
offBackground: f,
|
|
280
|
+
onColor: y,
|
|
281
|
+
offColor: a,
|
|
282
|
+
readonly: c
|
|
283
|
+
} = O(s), o = P(s.modelValue), p = B(() => ({
|
|
274
284
|
switch: !0,
|
|
275
285
|
"f-cmp-switch": !0,
|
|
276
|
-
checked:
|
|
277
|
-
disabled: e.value,
|
|
278
|
-
"switch-large":
|
|
279
|
-
"switch-medium":
|
|
280
|
-
"switch-small":
|
|
281
|
-
})), m =
|
|
286
|
+
checked: o.value,
|
|
287
|
+
disabled: c.value || e.value,
|
|
288
|
+
"switch-large": i.value === "large",
|
|
289
|
+
"switch-medium": i.value === "medium",
|
|
290
|
+
"switch-small": i.value === "small"
|
|
291
|
+
})), m = B(() => o.value ? {
|
|
282
292
|
outline: "none",
|
|
283
|
-
background:
|
|
293
|
+
background: l.value
|
|
284
294
|
} : {
|
|
285
295
|
outline: "none",
|
|
286
|
-
backgroundColor:
|
|
287
|
-
}),
|
|
288
|
-
background:
|
|
296
|
+
backgroundColor: f.value
|
|
297
|
+
}), d = B(() => o.value ? {
|
|
298
|
+
background: y.value
|
|
289
299
|
} : {
|
|
290
|
-
backgroundColor:
|
|
291
|
-
}),
|
|
292
|
-
function
|
|
293
|
-
e.value || (
|
|
300
|
+
backgroundColor: a.value
|
|
301
|
+
}), h = B(() => (n == null ? void 0 : n.value) || (r == null ? void 0 : r.value));
|
|
302
|
+
function k() {
|
|
303
|
+
c.value || e.value || (o.value = !o.value, t.emit("update:modelValue", o.value));
|
|
294
304
|
}
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
}),
|
|
298
|
-
|
|
299
|
-
}), () =>
|
|
305
|
+
return U(o, (b, C) => {
|
|
306
|
+
b !== C && t.emit("modelValueChanged", b);
|
|
307
|
+
}), U(() => s.modelValue, (b, C) => {
|
|
308
|
+
b !== C && (o.value = b);
|
|
309
|
+
}), () => F("span", {
|
|
300
310
|
tabindex: "0",
|
|
301
311
|
role: "button",
|
|
302
|
-
class:
|
|
312
|
+
class: p.value,
|
|
303
313
|
style: m.value,
|
|
304
|
-
onClick:
|
|
305
|
-
}, [
|
|
314
|
+
onClick: k
|
|
315
|
+
}, [h.value && F("span", {
|
|
306
316
|
class: "switch-pane"
|
|
307
|
-
}, [
|
|
317
|
+
}, [F("span", {
|
|
308
318
|
class: "switch-label-checked"
|
|
309
|
-
}, [n == null ? void 0 : n.value]),
|
|
319
|
+
}, [n == null ? void 0 : n.value]), F("span", {
|
|
310
320
|
class: "switch-label-unchecked"
|
|
311
|
-
}, [
|
|
312
|
-
style:
|
|
321
|
+
}, [r == null ? void 0 : r.value])]), F("small", {
|
|
322
|
+
style: d.value
|
|
313
323
|
}, [t.slots.default && t.slots.default()])]);
|
|
314
324
|
}
|
|
315
325
|
});
|
|
316
|
-
function
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
o();
|
|
322
|
-
const n = e && e.getStyles && e.getStyles() || "", i = e && e.getDesignerClass && e.getDesignerClass() || "", c = w();
|
|
323
|
-
function d() {
|
|
326
|
+
function ge(s, t, e) {
|
|
327
|
+
var T;
|
|
328
|
+
const i = e && e.getStyles && e.getStyles() || "", n = e && e.getDesignerClass && e.getDesignerClass() || "", r = P();
|
|
329
|
+
function l() {
|
|
324
330
|
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
|
|
325
331
|
}
|
|
326
|
-
function
|
|
332
|
+
function f() {
|
|
327
333
|
return !1;
|
|
328
334
|
}
|
|
329
|
-
function
|
|
335
|
+
function y() {
|
|
330
336
|
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
|
|
331
337
|
}
|
|
332
|
-
function
|
|
338
|
+
function a() {
|
|
333
339
|
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
|
|
334
340
|
}
|
|
335
|
-
function
|
|
336
|
-
if (!
|
|
341
|
+
function c(g) {
|
|
342
|
+
if (!g || !g.value)
|
|
337
343
|
return null;
|
|
338
|
-
if (
|
|
339
|
-
return
|
|
340
|
-
const
|
|
341
|
-
return
|
|
344
|
+
if (g.value.schema && g.value.schema.type === "component")
|
|
345
|
+
return g.value;
|
|
346
|
+
const w = P(g == null ? void 0 : g.value.parent), M = c(w);
|
|
347
|
+
return M || null;
|
|
342
348
|
}
|
|
343
|
-
function
|
|
344
|
-
const { componentInstance:
|
|
345
|
-
return !
|
|
349
|
+
function o(g = t) {
|
|
350
|
+
const { componentInstance: w, designerItemElementRef: M } = g;
|
|
351
|
+
return !w || !w.value ? null : w.value.canMove ? M : o(g.parent);
|
|
346
352
|
}
|
|
347
|
-
function
|
|
348
|
-
return !!e && e.canAccepts(
|
|
353
|
+
function p(g) {
|
|
354
|
+
return !!e && e.canAccepts(g);
|
|
349
355
|
}
|
|
350
|
-
function
|
|
356
|
+
function m() {
|
|
351
357
|
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
352
358
|
}
|
|
353
|
-
function
|
|
354
|
-
}
|
|
355
|
-
function M(y, v) {
|
|
356
|
-
v && e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(v);
|
|
359
|
+
function d() {
|
|
357
360
|
}
|
|
358
|
-
function
|
|
359
|
-
|
|
360
|
-
let b = L(C, y, v);
|
|
361
|
-
e && e.onResolveNewComponentSchema && (b = e.onResolveNewComponentSchema(y, b));
|
|
362
|
-
const F = C.toLowerCase().replace("-", "_");
|
|
363
|
-
return b && !b.id && b.type === C && (b.id = `${F}_${Math.random().toString().slice(2, 6)}`), b;
|
|
361
|
+
function h(g, w) {
|
|
362
|
+
w && e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(w);
|
|
364
363
|
}
|
|
365
|
-
function
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return B && !B.id && B.type === C && (B.id = `${Z}_${Math.random().toString().slice(2, 6)}`), B;
|
|
364
|
+
function k(g, w) {
|
|
365
|
+
const { componentType: M } = g;
|
|
366
|
+
let S = Q(M, g, w);
|
|
367
|
+
e && e.onResolveNewComponentSchema && (S = e.onResolveNewComponentSchema(g, S));
|
|
368
|
+
const L = M.toLowerCase().replace(/-/g, "_");
|
|
369
|
+
return S && !S.id && S.type === M && (S.id = `${L}_${Math.random().toString().slice(2, 6)}`), S;
|
|
372
370
|
}
|
|
373
|
-
function
|
|
371
|
+
function b(g) {
|
|
374
372
|
}
|
|
375
|
-
function
|
|
373
|
+
function C(...g) {
|
|
376
374
|
if (e && e.getPropsConfig)
|
|
377
|
-
return e.getPropsConfig(...
|
|
375
|
+
return e.getPropsConfig(...g);
|
|
376
|
+
}
|
|
377
|
+
function E() {
|
|
378
|
+
e && e.onRemoveComponent && e.onRemoveComponent(), t != null && t.schema.contents && t.schema.contents.map((g) => {
|
|
379
|
+
var S;
|
|
380
|
+
let w = g.id;
|
|
381
|
+
g.type === "component-ref" && (w = g.component);
|
|
382
|
+
const M = s.value.querySelector(`#${w}-design-item`);
|
|
383
|
+
(S = M == null ? void 0 : M.componentInstance) != null && S.value.onRemoveComponent && M.componentInstance.value.onRemoveComponent();
|
|
384
|
+
});
|
|
378
385
|
}
|
|
379
|
-
return
|
|
380
|
-
canMove:
|
|
381
|
-
canSelectParent:
|
|
382
|
-
canDelete:
|
|
383
|
-
canNested: !
|
|
386
|
+
return r.value = {
|
|
387
|
+
canMove: l(),
|
|
388
|
+
canSelectParent: f(),
|
|
389
|
+
canDelete: y(),
|
|
390
|
+
canNested: !a(),
|
|
384
391
|
contents: t == null ? void 0 : t.schema.contents,
|
|
385
|
-
elementRef:
|
|
386
|
-
parent: (
|
|
392
|
+
elementRef: s,
|
|
393
|
+
parent: (T = t == null ? void 0 : t.parent) == null ? void 0 : T.componentInstance,
|
|
387
394
|
schema: t == null ? void 0 : t.schema,
|
|
388
|
-
styles:
|
|
389
|
-
designerClass:
|
|
390
|
-
canAccepts:
|
|
391
|
-
getBelongedComponentInstance:
|
|
392
|
-
getDraggableDesignItemElement:
|
|
393
|
-
getDraggingDisplayText:
|
|
394
|
-
getPropConfig:
|
|
395
|
-
getDragScopeElement:
|
|
396
|
-
onAcceptMovedChildElement:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}, c;
|
|
395
|
+
styles: i,
|
|
396
|
+
designerClass: n,
|
|
397
|
+
canAccepts: p,
|
|
398
|
+
getBelongedComponentInstance: c,
|
|
399
|
+
getDraggableDesignItemElement: o,
|
|
400
|
+
getDraggingDisplayText: m,
|
|
401
|
+
getPropConfig: C,
|
|
402
|
+
getDragScopeElement: d,
|
|
403
|
+
onAcceptMovedChildElement: h,
|
|
404
|
+
onChildElementMovedOut: b,
|
|
405
|
+
addNewChildComponentSchema: k,
|
|
406
|
+
triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || P(!1),
|
|
407
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || P(!1),
|
|
408
|
+
onRemoveComponent: E
|
|
409
|
+
}, r;
|
|
404
410
|
}
|
|
405
|
-
class
|
|
411
|
+
class ve {
|
|
406
412
|
constructor(t, e) {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
413
|
+
v(this, "componentId");
|
|
414
|
+
v(this, "viewModelId");
|
|
415
|
+
v(this, "eventsEditorUtils");
|
|
416
|
+
v(this, "formSchemaUtils");
|
|
417
|
+
v(this, "formMetadataConverter");
|
|
418
|
+
v(this, "designViewModelUtils");
|
|
419
|
+
v(this, "designViewModelField");
|
|
420
|
+
v(this, "controlCreatorUtils");
|
|
421
|
+
v(this, "designerHostService");
|
|
422
|
+
v(this, "schemaService", null);
|
|
423
|
+
v(this, "metadataService", null);
|
|
424
|
+
v(this, "propertyConfig", {
|
|
419
425
|
type: "object",
|
|
420
426
|
categories: {}
|
|
421
427
|
});
|
|
422
|
-
var
|
|
423
|
-
this.componentId = t, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((
|
|
428
|
+
var i;
|
|
429
|
+
this.componentId = t, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((i = this.formSchemaUtils) == null ? void 0 : i.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService;
|
|
424
430
|
}
|
|
425
431
|
getTableInfo() {
|
|
426
432
|
var t;
|
|
427
433
|
return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
|
|
428
434
|
}
|
|
429
435
|
setDesignViewModelField(t) {
|
|
436
|
+
var i;
|
|
430
437
|
const e = t.binding && t.binding.type === "Form" && t.binding.field;
|
|
431
438
|
if (e) {
|
|
432
439
|
if (!this.designViewModelField) {
|
|
433
|
-
const
|
|
434
|
-
this.designViewModelField =
|
|
440
|
+
const n = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
441
|
+
this.designViewModelField = n.fields.find((r) => r.id === e);
|
|
435
442
|
}
|
|
436
|
-
t.updateOn = this.designViewModelField.updateOn;
|
|
443
|
+
t.updateOn = (i = this.designViewModelField) == null ? void 0 : i.updateOn;
|
|
437
444
|
}
|
|
438
445
|
}
|
|
439
446
|
changeFieldEditorType(t, e) {
|
|
@@ -457,7 +464,7 @@ class be {
|
|
|
457
464
|
type: "combo-list",
|
|
458
465
|
textField: "name",
|
|
459
466
|
valueField: "value",
|
|
460
|
-
data: [{ value: t.type, name:
|
|
467
|
+
data: [{ value: t.type, name: u[t.type].name }]
|
|
461
468
|
}
|
|
462
469
|
}
|
|
463
470
|
}
|
|
@@ -490,19 +497,19 @@ class be {
|
|
|
490
497
|
* @returns
|
|
491
498
|
*/
|
|
492
499
|
updateElementByParentContainer(t, e) {
|
|
493
|
-
const
|
|
494
|
-
if (!
|
|
500
|
+
const i = e && e.parent && e.parent.schema;
|
|
501
|
+
if (!i)
|
|
495
502
|
return;
|
|
496
|
-
const n =
|
|
497
|
-
|
|
503
|
+
const n = i.contents.findIndex((l) => l.id === t), r = j(i.contents[n]);
|
|
504
|
+
i.contents.splice(n, 1), i.contents.splice(n, 0, r);
|
|
498
505
|
}
|
|
499
506
|
}
|
|
500
|
-
const
|
|
507
|
+
const I = class I {
|
|
501
508
|
/**
|
|
502
509
|
* 根据绑定字段类型获取可用的输入类控件
|
|
503
510
|
*/
|
|
504
511
|
static getEditorTypesByMDataType(t) {
|
|
505
|
-
const e =
|
|
512
|
+
const e = I.fieldControlTypeMapping[t];
|
|
506
513
|
return e || [{ key: "", value: "" }];
|
|
507
514
|
}
|
|
508
515
|
/**
|
|
@@ -510,9 +517,9 @@ const P = class P {
|
|
|
510
517
|
*/
|
|
511
518
|
static getAllInputTypes() {
|
|
512
519
|
const t = [];
|
|
513
|
-
for (
|
|
514
|
-
|
|
515
|
-
t.find((n) => n.key ===
|
|
520
|
+
for (const e in I.fieldControlTypeMapping)
|
|
521
|
+
I.fieldControlTypeMapping[e].forEach((i) => {
|
|
522
|
+
t.find((n) => n.key === i.key && n.value === i.value) || t.push({ key: i.key, value: i.value });
|
|
516
523
|
});
|
|
517
524
|
return t;
|
|
518
525
|
}
|
|
@@ -520,69 +527,174 @@ const P = class P {
|
|
|
520
527
|
/**
|
|
521
528
|
* <字段类型,可配置的控件类型列表>的映射
|
|
522
529
|
*/
|
|
523
|
-
|
|
530
|
+
v(I, "fieldControlTypeMapping", {
|
|
524
531
|
String: [
|
|
525
|
-
{ key:
|
|
526
|
-
{ key:
|
|
527
|
-
{ key:
|
|
528
|
-
{ key:
|
|
529
|
-
{ key:
|
|
530
|
-
{ key:
|
|
531
|
-
{ key:
|
|
532
|
+
{ key: u["input-group"].type, value: u["input-group"].name },
|
|
533
|
+
{ key: u.lookup.type, value: u.lookup.name },
|
|
534
|
+
{ key: u["date-picker"].type, value: u["date-picker"].name },
|
|
535
|
+
{ key: u["check-box"].type, value: u["check-box"].name },
|
|
536
|
+
{ key: u["check-group"].type, value: u["check-group"].name },
|
|
537
|
+
{ key: u["radio-group"].type, value: u["radio-group"].name },
|
|
538
|
+
{ key: u["combo-list"].type, value: u["combo-list"].name },
|
|
539
|
+
{ key: u.textarea.type, value: u.textarea.name }
|
|
532
540
|
],
|
|
533
541
|
Text: [
|
|
534
|
-
{ key:
|
|
535
|
-
{ key:
|
|
542
|
+
{ key: u.textarea.type, value: u.textarea.name },
|
|
543
|
+
{ key: u.lookup.type, value: u.lookup.name }
|
|
536
544
|
],
|
|
537
545
|
Decimal: [
|
|
538
|
-
{ key:
|
|
546
|
+
{ key: u["number-spinner"].type, value: u["number-spinner"].name }
|
|
539
547
|
],
|
|
540
548
|
Integer: [
|
|
541
|
-
{ key:
|
|
549
|
+
{ key: u["number-spinner"].type, value: u["number-spinner"].name }
|
|
542
550
|
],
|
|
543
551
|
Number: [
|
|
544
|
-
{ key:
|
|
552
|
+
{ key: u["number-spinner"].type, value: u["number-spinner"].name }
|
|
545
553
|
],
|
|
546
554
|
BigNumber: [
|
|
547
|
-
{ key:
|
|
555
|
+
{ key: u["number-spinner"].type, value: u["number-spinner"].name }
|
|
548
556
|
],
|
|
549
557
|
Date: [
|
|
550
|
-
{ key:
|
|
558
|
+
{ key: u["date-picker"].type, value: u["date-picker"].name }
|
|
551
559
|
],
|
|
552
560
|
DateTime: [
|
|
553
|
-
{ key:
|
|
561
|
+
{ key: u["date-picker"].type, value: u["date-picker"].name }
|
|
554
562
|
],
|
|
555
563
|
Boolean: [
|
|
556
|
-
{ key:
|
|
557
|
-
{ key:
|
|
564
|
+
{ key: u.switch.type, value: u.switch.name },
|
|
565
|
+
{ key: u["check-box"].type, value: u["check-box"].name }
|
|
558
566
|
],
|
|
559
567
|
Enum: [
|
|
560
|
-
{ key:
|
|
561
|
-
{ key:
|
|
568
|
+
{ key: u["combo-list"].type, value: u["combo-list"].name },
|
|
569
|
+
{ key: u["radio-group"].type, value: u["radio-group"].name }
|
|
562
570
|
],
|
|
563
571
|
Object: [
|
|
564
|
-
{ key:
|
|
565
|
-
{ key:
|
|
566
|
-
{ key:
|
|
572
|
+
{ key: u.lookup.type, value: u.lookup.name },
|
|
573
|
+
{ key: u["combo-list"].type, value: u["combo-list"].name },
|
|
574
|
+
{ key: u["radio-group"].type, value: u["radio-group"].name }
|
|
567
575
|
]
|
|
568
576
|
});
|
|
569
|
-
let
|
|
570
|
-
const
|
|
571
|
-
class
|
|
572
|
-
constructor(
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
this
|
|
584
|
-
|
|
577
|
+
let D = I;
|
|
578
|
+
const be = P(0);
|
|
579
|
+
class Ce {
|
|
580
|
+
constructor() {
|
|
581
|
+
/** 控件标题 */
|
|
582
|
+
v(this, "label", "");
|
|
583
|
+
/** 控件id */
|
|
584
|
+
v(this, "id", "");
|
|
585
|
+
/** 每个控件占用的栅格数 */
|
|
586
|
+
v(this, "columnInSM", 12);
|
|
587
|
+
v(this, "columnInMD", 6);
|
|
588
|
+
v(this, "columnInLG", 3);
|
|
589
|
+
v(this, "columnInEL", 2);
|
|
590
|
+
/** 每个控件占用的列数 */
|
|
591
|
+
v(this, "displayWidthInSM", 1);
|
|
592
|
+
v(this, "displayWidthInMD", 1);
|
|
593
|
+
v(this, "displayWidthInLG", 1);
|
|
594
|
+
v(this, "displayWidthInEL", 1);
|
|
595
|
+
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
|
|
596
|
+
v(this, "displayColumnCountAtBreakPoint", "md");
|
|
597
|
+
/** 控件所在行,传0即可-----编辑器内部使用 */
|
|
598
|
+
v(this, "tagRow", 0);
|
|
599
|
+
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
|
|
600
|
+
v(this, "showTopBorder", 0);
|
|
601
|
+
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
|
|
602
|
+
v(this, "group", 1);
|
|
603
|
+
/** 控件是否符合标准的class配置(设计器用的) */
|
|
604
|
+
v(this, "isSupportedClass", !0);
|
|
605
|
+
/** 控件所在分组id(设计器用的) */
|
|
606
|
+
v(this, "fieldSetId", "");
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
function ke(s) {
|
|
610
|
+
let t, e;
|
|
611
|
+
const i = /* @__PURE__ */ new Map();
|
|
612
|
+
let n = [];
|
|
613
|
+
function r(c, o) {
|
|
614
|
+
const m = c.split(" ").filter((C) => C.startsWith("col-"));
|
|
615
|
+
if (m.length === 0) {
|
|
616
|
+
o.isSupportedClass = !1;
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
let d = m.find((C) => /^col-([1-9]|10|11|12)$/.test(C)), h = m.find((C) => /^col-md-([1-9]|10|11|12)$/.test(C)), k = m.find((C) => /^col-xl-([1-9]|10|11|12)$/.test(C)), b = m.find((C) => /^col-el-([1-9]|10|11|12)$/.test(C));
|
|
620
|
+
d = d || "col-12", o.columnInSM = parseInt(d.replace("col-", ""), 10), o.displayWidthInSM = o.columnInSM / 12, o.displayWidthInSM !== 1 && (o.isSupportedClass = !1), h = h || "col-md-" + o.columnInSM, o.columnInMD = parseInt(h.replace("col-md-", ""), 10), o.displayWidthInMD = o.columnInMD / 6, [1, 2].includes(o.displayWidthInMD) || (o.isSupportedClass = !1), k = k || "col-xl-" + o.columnInMD, o.columnInLG = parseInt(k.replace("col-xl-", ""), 10), o.displayWidthInLG = o.columnInLG / 3, [1, 2, 3, 4].includes(o.displayWidthInLG) || (o.isSupportedClass = !1), b = b || "col-el-" + o.columnInLG, o.columnInEL = parseInt(b.replace("col-el-", ""), 10), o.displayWidthInEL = o.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(o.displayWidthInEL) || (o.isSupportedClass = !1);
|
|
621
|
+
}
|
|
622
|
+
function l(c, o, p, m = !1) {
|
|
623
|
+
let d = !1;
|
|
624
|
+
c.contents.forEach((h) => {
|
|
625
|
+
if (h.type === "fieldset") {
|
|
626
|
+
p += 1, l(h, o, p, !0), d = !0;
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
d && (p += 1, d = !1);
|
|
630
|
+
const k = h.appearance && h.appearance.class, b = new Ce();
|
|
631
|
+
k ? r(k, b) : b.isSupportedClass = !1, b.label = h.label || h.id, b.id = h.id, b.group = p, m && (b.fieldSetId = c.id), e === h.id && (t = p), i.set(h.id, h), o.push(b);
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
function f(c) {
|
|
635
|
+
const o = s.getComponentById(c);
|
|
636
|
+
if (!o || !o.componentType || !o.componentType.startsWith("form"))
|
|
637
|
+
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
638
|
+
const p = s.selectNode(o, (m) => m.type === W["response-form"].type);
|
|
639
|
+
return !p || !p.contents || p.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: p };
|
|
640
|
+
}
|
|
641
|
+
function y(c, o) {
|
|
642
|
+
o = o || c.id;
|
|
643
|
+
const { result: p, message: m, formNode: d } = f(o);
|
|
644
|
+
if (!p)
|
|
645
|
+
return { result: p, message: m };
|
|
646
|
+
e = c.id, n = [], i.clear();
|
|
647
|
+
const h = d.contents[0].type === W.fieldset.type ? 0 : 1;
|
|
648
|
+
l(d, n, h);
|
|
649
|
+
const k = n.find((C) => !C.isSupportedClass);
|
|
585
650
|
return {
|
|
651
|
+
defaultState: {
|
|
652
|
+
defaultGroupNumber: t || 1,
|
|
653
|
+
model: k ? "customize" : "standard"
|
|
654
|
+
},
|
|
655
|
+
importData: n
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function a(c, o) {
|
|
659
|
+
o = o;
|
|
660
|
+
const { result: p, formNode: m } = f(o);
|
|
661
|
+
if (!p)
|
|
662
|
+
return "";
|
|
663
|
+
const d = [];
|
|
664
|
+
return c.forEach((h) => {
|
|
665
|
+
var C;
|
|
666
|
+
const k = i.get(h.id), b = k.appearance && k.appearance.class;
|
|
667
|
+
if (b) {
|
|
668
|
+
const T = b.split(" ").filter((J) => !J.startsWith("col-")), g = "col-" + h.columnInSM, w = "col-md-" + h.columnInMD, M = "col-xl-" + h.columnInLG, S = "col-el-" + h.columnInEL, L = [g, w, M, S].concat(T);
|
|
669
|
+
k.appearance.class = L.join(" ");
|
|
670
|
+
}
|
|
671
|
+
if (h.fieldSetId) {
|
|
672
|
+
const E = m.contents.find((g) => g.id === h.fieldSetId), T = d.find((g) => g.id === h.fieldSetId);
|
|
673
|
+
T ? (C = T.contents) == null || C.push(k) : (d.push(E), E.contents = [k]);
|
|
674
|
+
} else
|
|
675
|
+
d.push(k);
|
|
676
|
+
}), m.contents = d, m.id;
|
|
677
|
+
}
|
|
678
|
+
return {
|
|
679
|
+
checkCanFindFormNode: f,
|
|
680
|
+
checkCanOpenLayoutEditor: y,
|
|
681
|
+
changeFormControlsByResponseLayoutConfig: a,
|
|
682
|
+
getResonseFormLayoutConfig: l
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
class we extends ve {
|
|
686
|
+
constructor(e, i) {
|
|
687
|
+
super(e, i);
|
|
688
|
+
v(this, "responseLayoutEditorFunction");
|
|
689
|
+
this.responseLayoutEditorFunction = ke(this.formSchemaUtils);
|
|
690
|
+
}
|
|
691
|
+
getPropertyConfig(e, i) {
|
|
692
|
+
return this.propertyConfig.categories.basic = this.getBasicProperties(e, i), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e, i), this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig;
|
|
693
|
+
}
|
|
694
|
+
getBasicProperties(e, i) {
|
|
695
|
+
var r;
|
|
696
|
+
const n = this;
|
|
697
|
+
return this.setDesignViewModelField(e), this.formSchemaUtils.getFormMetadataBasicInfo(), {
|
|
586
698
|
description: "Basic Information",
|
|
587
699
|
title: "基本信息",
|
|
588
700
|
properties: {
|
|
@@ -603,7 +715,7 @@ class we extends be {
|
|
|
603
715
|
textField: "value",
|
|
604
716
|
valueField: "key",
|
|
605
717
|
editable: !1,
|
|
606
|
-
data: n.designViewModelField ?
|
|
718
|
+
data: n.designViewModelField ? D.getEditorTypesByMDataType((r = n.designViewModelField.type) == null ? void 0 : r.name) : D.getAllInputTypes()
|
|
607
719
|
}
|
|
608
720
|
},
|
|
609
721
|
label: {
|
|
@@ -614,41 +726,37 @@ class we extends be {
|
|
|
614
726
|
binding: {
|
|
615
727
|
description: "绑定的表单字段",
|
|
616
728
|
title: "绑定",
|
|
617
|
-
$converter: "/converter/field-selector.converter",
|
|
618
729
|
editor: {
|
|
619
|
-
type: "
|
|
730
|
+
type: "binding-selector",
|
|
620
731
|
bindingType: { enable: !1 },
|
|
621
732
|
editorParams: {
|
|
622
|
-
|
|
623
|
-
|
|
733
|
+
componentSchema: e,
|
|
734
|
+
needSyncToViewModel: !0,
|
|
735
|
+
viewModelId: this.viewModelId,
|
|
736
|
+
designerHostService: this.designerHostService,
|
|
737
|
+
disableOccupiedFields: !0
|
|
624
738
|
},
|
|
625
|
-
|
|
626
|
-
{ field: "name", title: "字段名称" },
|
|
627
|
-
{ field: "bindingField", title: "绑定字段" },
|
|
628
|
-
{ field: "fieldType", title: "字段类型" }
|
|
629
|
-
],
|
|
630
|
-
textField: "bindingField",
|
|
631
|
-
data: c
|
|
739
|
+
textField: "bindingField"
|
|
632
740
|
}
|
|
633
741
|
}
|
|
634
742
|
},
|
|
635
|
-
setPropertyRelates(
|
|
636
|
-
if (
|
|
637
|
-
switch (
|
|
743
|
+
setPropertyRelates(l, f) {
|
|
744
|
+
if (l)
|
|
745
|
+
switch (l && l.propertyID) {
|
|
638
746
|
case "type": {
|
|
639
|
-
n.changeControlType(e,
|
|
747
|
+
n.changeControlType(e, l, i);
|
|
640
748
|
break;
|
|
641
749
|
}
|
|
642
750
|
case "label": {
|
|
643
|
-
|
|
751
|
+
l.needRefreshControlTree = !0;
|
|
644
752
|
break;
|
|
645
753
|
}
|
|
646
754
|
}
|
|
647
755
|
}
|
|
648
756
|
};
|
|
649
757
|
}
|
|
650
|
-
getAppearanceProperties(e,
|
|
651
|
-
|
|
758
|
+
getAppearanceProperties(e, i) {
|
|
759
|
+
const n = this;
|
|
652
760
|
return {
|
|
653
761
|
title: "样式",
|
|
654
762
|
description: "Appearance",
|
|
@@ -678,14 +786,14 @@ class we extends be {
|
|
|
678
786
|
}
|
|
679
787
|
}
|
|
680
788
|
},
|
|
681
|
-
setPropertyRelates(
|
|
682
|
-
if (
|
|
683
|
-
switch (
|
|
789
|
+
setPropertyRelates(r, l) {
|
|
790
|
+
if (r)
|
|
791
|
+
switch (r && r.propertyID) {
|
|
684
792
|
case "responseLayout":
|
|
685
|
-
n.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(
|
|
793
|
+
n.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(r.propertyValue, n.componentId || e.id), n.updateUnifiedLayoutAfterResponseLayoutChanged(n.componentId), n.updateElementByParentContainer(e.id, i), delete e.responseLayout;
|
|
686
794
|
break;
|
|
687
795
|
case "class":
|
|
688
|
-
n.updateUnifiedLayoutAfterControlChanged(
|
|
796
|
+
n.updateUnifiedLayoutAfterControlChanged(r.propertyValue, e.id, this.componentId), n.updateElementByParentContainer(e.id, i);
|
|
689
797
|
break;
|
|
690
798
|
}
|
|
691
799
|
}
|
|
@@ -699,44 +807,44 @@ class we extends be {
|
|
|
699
807
|
* @param propertyData 控件DOM属性
|
|
700
808
|
* @param newControlType 新控件类型
|
|
701
809
|
*/
|
|
702
|
-
changeControlType(e,
|
|
703
|
-
var
|
|
704
|
-
const
|
|
705
|
-
if (!
|
|
810
|
+
changeControlType(e, i, n) {
|
|
811
|
+
var c, o, p, m;
|
|
812
|
+
const r = i.propertyValue, l = n && n.parent && n.parent.schema;
|
|
813
|
+
if (!l)
|
|
706
814
|
return;
|
|
707
|
-
const
|
|
708
|
-
let
|
|
815
|
+
const f = l.contents.findIndex((d) => d.id === e.id), y = l.contents[f];
|
|
816
|
+
let a;
|
|
709
817
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
710
818
|
editor: {
|
|
711
|
-
$type:
|
|
819
|
+
$type: r
|
|
712
820
|
},
|
|
713
821
|
name: this.designViewModelField.name,
|
|
714
822
|
require: this.designViewModelField.require,
|
|
715
823
|
readonly: this.designViewModelField.readonly
|
|
716
|
-
}, !1),
|
|
717
|
-
id:
|
|
718
|
-
appearance:
|
|
719
|
-
size:
|
|
720
|
-
label:
|
|
721
|
-
binding:
|
|
722
|
-
visible:
|
|
723
|
-
}), Object.assign(
|
|
724
|
-
isTextArea:
|
|
725
|
-
placeholder: (
|
|
726
|
-
holdPlace: (
|
|
727
|
-
readonly: (
|
|
728
|
-
require: (
|
|
729
|
-
}),
|
|
730
|
-
(
|
|
731
|
-
),
|
|
732
|
-
}
|
|
733
|
-
getComponentConfig(e,
|
|
734
|
-
const
|
|
824
|
+
}, !1), a = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, r)), a || (a = this.controlCreatorUtils.createFormGroupWithoutField(r)), Object.assign(a, {
|
|
825
|
+
id: y.id,
|
|
826
|
+
appearance: y.appearance,
|
|
827
|
+
size: y.size,
|
|
828
|
+
label: y.label,
|
|
829
|
+
binding: y.binding,
|
|
830
|
+
visible: y.visible
|
|
831
|
+
}), Object.assign(a.editor, {
|
|
832
|
+
isTextArea: a.isTextArea && y.isTextArea,
|
|
833
|
+
placeholder: (c = y.editor) == null ? void 0 : c.placeholder,
|
|
834
|
+
holdPlace: (o = y.editor) == null ? void 0 : o.holdPlace,
|
|
835
|
+
readonly: (p = y.editor) == null ? void 0 : p.readonly,
|
|
836
|
+
require: (m = y.editor) == null ? void 0 : m.require
|
|
837
|
+
}), l.contents.splice(f, 1), l.contents.splice(f, 0, a), n.schema = Object.assign(y, a), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
838
|
+
(d) => d.classList.remove("dgComponentSelected")
|
|
839
|
+
), be.value++;
|
|
840
|
+
}
|
|
841
|
+
getComponentConfig(e, i = {}, n = {}) {
|
|
842
|
+
const r = Object.assign({
|
|
735
843
|
description: "编辑器",
|
|
736
844
|
title: "编辑器",
|
|
737
845
|
type: "input-group",
|
|
738
846
|
$converter: "/converter/property-editor.converter"
|
|
739
|
-
},
|
|
847
|
+
}, i), l = Object.assign({
|
|
740
848
|
readonly: {
|
|
741
849
|
description: "",
|
|
742
850
|
title: "只读",
|
|
@@ -758,7 +866,7 @@ class we extends be {
|
|
|
758
866
|
type: "string"
|
|
759
867
|
}
|
|
760
868
|
}, n);
|
|
761
|
-
return { ...
|
|
869
|
+
return { ...r, properties: { ...l } };
|
|
762
870
|
}
|
|
763
871
|
/**
|
|
764
872
|
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
@@ -766,47 +874,47 @@ class we extends be {
|
|
|
766
874
|
* @param controlId 控件Id
|
|
767
875
|
* @param componentId 控件所在组件id
|
|
768
876
|
*/
|
|
769
|
-
updateUnifiedLayoutAfterControlChanged(e,
|
|
770
|
-
const
|
|
771
|
-
let
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
id:
|
|
775
|
-
columnInSM: parseInt(
|
|
776
|
-
columnInMD: parseInt(
|
|
777
|
-
columnInLG: parseInt(
|
|
778
|
-
columnInEL: parseInt(
|
|
877
|
+
updateUnifiedLayoutAfterControlChanged(e, i, n) {
|
|
878
|
+
const r = e.split(" ");
|
|
879
|
+
let l = r.find((o) => /^col-([1-9]|10|11|12)$/.test(o)), f = r.find((o) => /^col-md-([1-9]|10|11|12)$/.test(o)), y = r.find((o) => /^col-xl-([1-9]|10|11|12)$/.test(o)), a = r.find((o) => /^col-el-([1-9]|10|11|12)$/.test(o));
|
|
880
|
+
l = l || "col-12", f = f || "col-md-" + l.replace("col-", ""), y = y || "col-xl-" + f.replace("col-md-", ""), a = a || "col-el-" + y.replace("col-xl-", "");
|
|
881
|
+
const c = {
|
|
882
|
+
id: i,
|
|
883
|
+
columnInSM: parseInt(l.replace("col-", ""), 10),
|
|
884
|
+
columnInMD: parseInt(f.replace("col-md-", ""), 10),
|
|
885
|
+
columnInLG: parseInt(y.replace("col-xl-", ""), 10),
|
|
886
|
+
columnInEL: parseInt(a.replace("col-el-", ""), 10)
|
|
779
887
|
};
|
|
780
|
-
this.updateUnifiedLayoutAfterResponseLayoutChanged(n,
|
|
888
|
+
this.updateUnifiedLayoutAfterResponseLayoutChanged(n, c);
|
|
781
889
|
}
|
|
782
890
|
/**
|
|
783
891
|
* 修改控件布局配置后更新Form统一布局配置
|
|
784
892
|
* @param componentId 组件Id
|
|
785
893
|
* @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
|
|
786
894
|
*/
|
|
787
|
-
updateUnifiedLayoutAfterResponseLayoutChanged(e,
|
|
895
|
+
updateUnifiedLayoutAfterResponseLayoutChanged(e, i) {
|
|
788
896
|
const { formNode: n } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
|
|
789
897
|
if (!n || !n.unifiedLayout)
|
|
790
898
|
return;
|
|
791
|
-
const
|
|
792
|
-
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(n,
|
|
793
|
-
const
|
|
794
|
-
Object.assign(
|
|
899
|
+
const r = [];
|
|
900
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(n, r, 1), i) {
|
|
901
|
+
const d = r.find((h) => h.id === i.id);
|
|
902
|
+
Object.assign(d || {}, i);
|
|
795
903
|
}
|
|
796
|
-
const
|
|
904
|
+
const l = r.map((d) => d.columnInSM), f = r.map((d) => d.columnInMD), y = r.map((d) => d.columnInLG), a = r.map((d) => d.columnInEL), c = this.checkIsUniqueColumn(l) ? l[0] : null, o = this.checkIsUniqueColumn(f) ? f[0] : null, p = this.checkIsUniqueColumn(y) ? y[0] : null, m = this.checkIsUniqueColumn(a) ? a[0] : null;
|
|
797
905
|
Object.assign(n.unifiedLayout, {
|
|
798
|
-
uniqueColClassInSM:
|
|
799
|
-
uniqueColClassInMD:
|
|
800
|
-
uniqueColClassInLG:
|
|
801
|
-
uniqueColClassInEL:
|
|
906
|
+
uniqueColClassInSM: c,
|
|
907
|
+
uniqueColClassInMD: o,
|
|
908
|
+
uniqueColClassInLG: p,
|
|
909
|
+
uniqueColClassInEL: m
|
|
802
910
|
});
|
|
803
911
|
}
|
|
804
912
|
/**
|
|
805
913
|
* 校验宽度样式值是否一致
|
|
806
914
|
*/
|
|
807
915
|
checkIsUniqueColumn(e) {
|
|
808
|
-
const
|
|
809
|
-
return Array.from(
|
|
916
|
+
const i = new Set(e);
|
|
917
|
+
return Array.from(i).length === 1;
|
|
810
918
|
}
|
|
811
919
|
}
|
|
812
920
|
class Me extends we {
|
|
@@ -815,7 +923,7 @@ class Me extends we {
|
|
|
815
923
|
}
|
|
816
924
|
getEditorProperties(t) {
|
|
817
925
|
return this.getComponentConfig(t, { type: "switch" }, {
|
|
818
|
-
|
|
926
|
+
disabled: {
|
|
819
927
|
visible: !1
|
|
820
928
|
},
|
|
821
929
|
placeholder: {
|
|
@@ -848,15 +956,15 @@ class Me extends we {
|
|
|
848
956
|
editor: {
|
|
849
957
|
data: [
|
|
850
958
|
{
|
|
851
|
-
|
|
959
|
+
id: "small",
|
|
852
960
|
name: "小号"
|
|
853
961
|
},
|
|
854
962
|
{
|
|
855
|
-
|
|
963
|
+
id: "middle",
|
|
856
964
|
name: "中号"
|
|
857
965
|
},
|
|
858
966
|
{
|
|
859
|
-
|
|
967
|
+
id: "large",
|
|
860
968
|
name: "大号"
|
|
861
969
|
}
|
|
862
970
|
]
|
|
@@ -865,114 +973,56 @@ class Me extends we {
|
|
|
865
973
|
});
|
|
866
974
|
}
|
|
867
975
|
}
|
|
868
|
-
function Se(
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
return !1;
|
|
873
|
-
}
|
|
874
|
-
function i() {
|
|
875
|
-
return !1;
|
|
976
|
+
function Se(s, t) {
|
|
977
|
+
const e = s.schema;
|
|
978
|
+
function i(n, r) {
|
|
979
|
+
return new Me(n, t).getPropertyConfig(e, r);
|
|
876
980
|
}
|
|
877
|
-
|
|
878
|
-
return !1;
|
|
879
|
-
}
|
|
880
|
-
function d() {
|
|
881
|
-
return !0;
|
|
882
|
-
}
|
|
883
|
-
function u(l) {
|
|
884
|
-
}
|
|
885
|
-
function r() {
|
|
886
|
-
}
|
|
887
|
-
function s(l) {
|
|
888
|
-
return null;
|
|
889
|
-
}
|
|
890
|
-
return {
|
|
891
|
-
canAccepts: n,
|
|
892
|
-
checkCanDeleteComponent: i,
|
|
893
|
-
checkCanMoveComponent: c,
|
|
894
|
-
hideNestedPaddingInDesginerView: d,
|
|
895
|
-
onAcceptMovedChildElement: u,
|
|
896
|
-
resolveComponentContext: r,
|
|
897
|
-
triggerBelongedComponentToMoveWhenMoved: e,
|
|
898
|
-
triggerBelongedComponentToDeleteWhenDeleted: o,
|
|
899
|
-
getPropsConfig: s
|
|
900
|
-
};
|
|
981
|
+
return { getPropsConfig: i };
|
|
901
982
|
}
|
|
902
|
-
|
|
903
|
-
const {
|
|
904
|
-
canAccepts: e,
|
|
905
|
-
checkCanDeleteComponent: o,
|
|
906
|
-
checkCanMoveComponent: n,
|
|
907
|
-
hideNestedPaddingInDesginerView: i,
|
|
908
|
-
onAcceptMovedChildElement: c,
|
|
909
|
-
resolveComponentContext: d,
|
|
910
|
-
triggerBelongedComponentToMoveWhenMoved: u,
|
|
911
|
-
triggerBelongedComponentToDeleteWhenDeleted: r
|
|
912
|
-
} = Se(a), s = a.schema;
|
|
913
|
-
function l(m, h) {
|
|
914
|
-
return new Me(m, t).getPropertyConfig(s, h);
|
|
915
|
-
}
|
|
916
|
-
return {
|
|
917
|
-
canAccepts: e,
|
|
918
|
-
checkCanDeleteComponent: o,
|
|
919
|
-
checkCanMoveComponent: n,
|
|
920
|
-
hideNestedPaddingInDesginerView: i,
|
|
921
|
-
onAcceptMovedChildElement: c,
|
|
922
|
-
resolveComponentContext: d,
|
|
923
|
-
triggerBelongedComponentToMoveWhenMoved: u,
|
|
924
|
-
triggerBelongedComponentToDeleteWhenDeleted: r,
|
|
925
|
-
getPropsConfig: l
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
const Be = /* @__PURE__ */ W({
|
|
983
|
+
const Fe = /* @__PURE__ */ q({
|
|
929
984
|
name: "FSwitchDesign",
|
|
930
985
|
props: N,
|
|
931
986
|
emits: ["update:modelValue"],
|
|
932
|
-
setup(
|
|
987
|
+
setup(s, t) {
|
|
933
988
|
const {
|
|
934
989
|
size: e,
|
|
935
|
-
onLabel:
|
|
990
|
+
onLabel: i,
|
|
936
991
|
offLabel: n
|
|
937
|
-
} =
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
}), t.expose(
|
|
941
|
-
const
|
|
992
|
+
} = O(s), r = P(), l = $("designer-host-service"), f = $("design-item-context"), y = Se(f, l), a = ge(r, f, y);
|
|
993
|
+
_(() => {
|
|
994
|
+
r.value.componentInstance = a;
|
|
995
|
+
}), t.expose(a.value);
|
|
996
|
+
const c = B(() => ({
|
|
942
997
|
switch: !0,
|
|
943
998
|
"f-cmp-switch": !0,
|
|
944
999
|
checked: !1,
|
|
945
1000
|
"switch-large": e.value === "large",
|
|
946
1001
|
"switch-medium": e.value === "medium",
|
|
947
1002
|
"switch-small": e.value === "small"
|
|
948
|
-
})),
|
|
949
|
-
return () =>
|
|
950
|
-
ref:
|
|
1003
|
+
})), o = B(() => (i == null ? void 0 : i.value) || (n == null ? void 0 : n.value));
|
|
1004
|
+
return () => F("span", {
|
|
1005
|
+
ref: r,
|
|
951
1006
|
tabindex: "0",
|
|
952
1007
|
role: "button",
|
|
953
|
-
class:
|
|
954
|
-
}, [
|
|
1008
|
+
class: c.value
|
|
1009
|
+
}, [o.value && F("span", {
|
|
955
1010
|
class: "switch-pane"
|
|
956
|
-
}, [
|
|
1011
|
+
}, [F("span", {
|
|
957
1012
|
class: "switch-label-unchecked"
|
|
958
|
-
}, [n == null ? void 0 : n.value])]),
|
|
1013
|
+
}, [n == null ? void 0 : n.value])]), F("small", null, [t.slots.default && t.slots.default()])]);
|
|
959
1014
|
}
|
|
960
|
-
})
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
e.component(t.name, a);
|
|
964
|
-
}, a;
|
|
965
|
-
};
|
|
966
|
-
V.register = (a, t, e, o) => {
|
|
967
|
-
a.switch = V, t.switch = Q;
|
|
1015
|
+
});
|
|
1016
|
+
V.register = (s, t, e, i) => {
|
|
1017
|
+
s.switch = V, t.switch = H;
|
|
968
1018
|
};
|
|
969
|
-
V.registerDesigner = (
|
|
970
|
-
|
|
1019
|
+
V.registerDesigner = (s, t, e) => {
|
|
1020
|
+
s.switch = Fe, t.switch = H;
|
|
971
1021
|
};
|
|
972
|
-
const
|
|
1022
|
+
const Ve = K(V);
|
|
973
1023
|
export {
|
|
974
1024
|
V as FSwitch,
|
|
975
|
-
|
|
976
|
-
|
|
1025
|
+
Ve as default,
|
|
1026
|
+
H as propsResolver,
|
|
977
1027
|
N as switchProps
|
|
978
1028
|
};
|