@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,12 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { useCheck as
|
|
6
|
-
import { isPlainObject as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var ce = (e, t, n) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var T = (e, t, n) => ce(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defineComponent as V, inject as N, onMounted as L, createVNode as g, Fragment as Q, computed as I, ref as w, provide as de, Teleport as pe, createApp as fe, onUnmounted as me, watch as j, nextTick as z, withDirectives as G, vShow as ye, mergeProps as ge, createTextVNode as A, vModelText as X } from "vue";
|
|
5
|
+
import { useCheck as he, useGuid as J } from "../common/index.esm.js";
|
|
6
|
+
import { isPlainObject as H, cloneDeep as U } from "lodash-es";
|
|
7
|
+
import { DgControl as _ } from "../designer-canvas/index.esm.js";
|
|
8
|
+
import { resolveAppearance as ve, createPropsResolver as be } from "../dynamic-resolver/index.esm.js";
|
|
9
|
+
import Ce from "../tags/index.esm.js";
|
|
10
|
+
import ke from "../popover/index.esm.js";
|
|
11
|
+
import Fe from "../data-grid/index.esm.js";
|
|
12
|
+
import { FNotifyService as Be } from "../notify/index.esm.js";
|
|
13
|
+
const Me = {
|
|
10
14
|
value: { type: String, default: "" },
|
|
11
15
|
/** 值 */
|
|
12
16
|
modelValue: { type: String, default: "" },
|
|
@@ -16,150 +20,157 @@ const re = {
|
|
|
16
20
|
label: { type: String, default: "" },
|
|
17
21
|
/** 标识 */
|
|
18
22
|
id: { type: String, default: "" }
|
|
19
|
-
},
|
|
23
|
+
}, Y = Symbol("radioGroupContext"), K = /* @__PURE__ */ V({
|
|
20
24
|
name: "FRadio",
|
|
21
|
-
props:
|
|
25
|
+
props: Me,
|
|
22
26
|
emits: ["update:value"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
buttonClass:
|
|
27
|
+
setup(e, t) {
|
|
28
|
+
const n = N(Y, null), {
|
|
29
|
+
buttonClass: a,
|
|
26
30
|
checked: o,
|
|
27
|
-
disabled:
|
|
28
|
-
name:
|
|
29
|
-
tagClass:
|
|
30
|
-
shouldRenderButton:
|
|
31
|
-
shouldRenderNative:
|
|
32
|
-
shouldRenderTag:
|
|
33
|
-
onClickRadio:
|
|
34
|
-
} =
|
|
35
|
-
return
|
|
31
|
+
disabled: l,
|
|
32
|
+
name: u,
|
|
33
|
+
tagClass: c,
|
|
34
|
+
shouldRenderButton: p,
|
|
35
|
+
shouldRenderNative: r,
|
|
36
|
+
shouldRenderTag: d,
|
|
37
|
+
onClickRadio: i
|
|
38
|
+
} = he(e, t, n == null ? void 0 : n.parentProps, n == null ? void 0 : n.parentContext);
|
|
39
|
+
return L(() => {
|
|
36
40
|
}), () => {
|
|
37
|
-
var
|
|
38
|
-
return
|
|
39
|
-
class:
|
|
41
|
+
var s, f, m, y, F, k;
|
|
42
|
+
return g(Q, null, [p.value && g("div", {
|
|
43
|
+
class: a.value,
|
|
40
44
|
style: "border-radius:0;border: 1px solid #E8EBF2;",
|
|
41
|
-
onClick:
|
|
42
|
-
}, [(
|
|
43
|
-
class:
|
|
44
|
-
onClick:
|
|
45
|
-
}, [
|
|
45
|
+
onClick: i
|
|
46
|
+
}, [(f = (s = t.slots).default) == null ? void 0 : f.call(s)]), d.value && g("div", {
|
|
47
|
+
class: c.value,
|
|
48
|
+
onClick: i
|
|
49
|
+
}, [g("div", {
|
|
46
50
|
class: "title"
|
|
47
|
-
}, [(
|
|
51
|
+
}, [(y = (m = t.slots).default) == null ? void 0 : y.call(m)]), g("div", {
|
|
48
52
|
class: "tip"
|
|
49
|
-
}, null),
|
|
53
|
+
}, null), g("span", {
|
|
50
54
|
class: "f-icon f-icon-check f-radio-icon"
|
|
51
|
-
}, null)]),
|
|
55
|
+
}, null)]), r.value && g("div", {
|
|
52
56
|
class: "custom-control custom-radio",
|
|
53
|
-
onClick:
|
|
54
|
-
}, [
|
|
57
|
+
onClick: i
|
|
58
|
+
}, [g("input", {
|
|
55
59
|
type: "radio",
|
|
56
60
|
class: "custom-control-input",
|
|
57
|
-
name:
|
|
58
|
-
id:
|
|
59
|
-
value:
|
|
61
|
+
name: u.value,
|
|
62
|
+
id: e.id,
|
|
63
|
+
value: e.value,
|
|
60
64
|
checked: o.value,
|
|
61
|
-
disabled:
|
|
62
|
-
}, null),
|
|
65
|
+
disabled: l.value
|
|
66
|
+
}, null), g("div", {
|
|
63
67
|
class: "custom-control-label"
|
|
64
|
-
}, [(
|
|
68
|
+
}, [(k = (F = t.slots).default) == null ? void 0 : k.call(F)])])]);
|
|
65
69
|
};
|
|
66
70
|
}
|
|
67
71
|
});
|
|
68
|
-
function
|
|
72
|
+
function we(e, t, n) {
|
|
73
|
+
return t;
|
|
74
|
+
}
|
|
75
|
+
function Se(e, t, n) {
|
|
69
76
|
return t;
|
|
70
77
|
}
|
|
71
|
-
const
|
|
72
|
-
function
|
|
73
|
-
const { properties: t, title:
|
|
74
|
-
|
|
78
|
+
const Z = {}, ee = {};
|
|
79
|
+
function W(e) {
|
|
80
|
+
const { properties: t, title: n, ignore: a } = e, o = a && Array.isArray(a), l = Object.keys(t).reduce((u, c) => ((!o || !a.find((p) => p === c)) && (u[c] = t[c].type === "object" && t[c].properties ? W(t[c]) : U(t[c].default)), u), {});
|
|
81
|
+
if (n && (!o || !a.find((u) => u === "id"))) {
|
|
82
|
+
const u = n.toLowerCase().replace(/-/g, "_");
|
|
83
|
+
l.id = `${u}_${Math.random().toString().slice(2, 6)}`;
|
|
84
|
+
}
|
|
85
|
+
return l;
|
|
75
86
|
}
|
|
76
|
-
function
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
let o =
|
|
80
|
-
const
|
|
81
|
-
return o =
|
|
87
|
+
function te(e, t = {}, n) {
|
|
88
|
+
const a = Z[e];
|
|
89
|
+
if (a) {
|
|
90
|
+
let o = W(a);
|
|
91
|
+
const l = ee[e];
|
|
92
|
+
return o = l ? l({ getSchemaByType: te }, o, t, n) : o, o;
|
|
82
93
|
}
|
|
83
94
|
return null;
|
|
84
95
|
}
|
|
85
|
-
function
|
|
86
|
-
const
|
|
87
|
-
return Object.keys(
|
|
96
|
+
function Te(e, t) {
|
|
97
|
+
const n = W(t);
|
|
98
|
+
return Object.keys(n).reduce((a, o) => (a[o] && H(a[o]) && H(e[o] || !e[o]) ? Object.assign(a[o], e[o] || {}) : a[o] = e[o], a), n), n;
|
|
88
99
|
}
|
|
89
|
-
function
|
|
90
|
-
return Object.keys(
|
|
100
|
+
function Ee(e, t) {
|
|
101
|
+
return Object.keys(e).filter((a) => e[a] != null).reduce((a, o) => {
|
|
91
102
|
if (t.has(o)) {
|
|
92
|
-
const
|
|
93
|
-
if (typeof
|
|
94
|
-
|
|
103
|
+
const l = t.get(o);
|
|
104
|
+
if (typeof l == "string")
|
|
105
|
+
a[l] = e[o];
|
|
95
106
|
else {
|
|
96
|
-
const
|
|
97
|
-
Object.assign(
|
|
107
|
+
const u = l(o, e[o], e);
|
|
108
|
+
Object.assign(a, u);
|
|
98
109
|
}
|
|
99
110
|
} else
|
|
100
|
-
|
|
101
|
-
return
|
|
111
|
+
a[o] = e[o];
|
|
112
|
+
return a;
|
|
102
113
|
}, {});
|
|
103
114
|
}
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
return
|
|
115
|
+
function Ie(e, t, n = /* @__PURE__ */ new Map()) {
|
|
116
|
+
const a = Te(e, t);
|
|
117
|
+
return Ee(a, n);
|
|
107
118
|
}
|
|
108
|
-
function
|
|
109
|
-
function t(
|
|
110
|
-
if (typeof
|
|
111
|
-
return
|
|
112
|
-
if (typeof
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
return Number(
|
|
116
|
-
if (
|
|
117
|
-
return Number(
|
|
118
|
-
if (
|
|
119
|
-
return Number(
|
|
119
|
+
function Pe(e = {}) {
|
|
120
|
+
function t(r, d, i, s) {
|
|
121
|
+
if (typeof i == "number")
|
|
122
|
+
return s[r].length === i;
|
|
123
|
+
if (typeof i == "object") {
|
|
124
|
+
const f = Object.keys(i)[0], m = i[f];
|
|
125
|
+
if (f === "not")
|
|
126
|
+
return Number(s[r].length) !== Number(m);
|
|
127
|
+
if (f === "moreThan")
|
|
128
|
+
return Number(s[r].length) >= Number(m);
|
|
129
|
+
if (f === "lessThan")
|
|
130
|
+
return Number(s[r].length) <= Number(m);
|
|
120
131
|
}
|
|
121
132
|
return !1;
|
|
122
133
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
134
|
+
function n(r, d, i, s) {
|
|
135
|
+
return s[r] && s[r].propertyValue && String(s[r].propertyValue.value) === String(i);
|
|
125
136
|
}
|
|
126
|
-
const
|
|
137
|
+
const a = /* @__PURE__ */ new Map([
|
|
127
138
|
["length", t],
|
|
128
|
-
["getProperty",
|
|
139
|
+
["getProperty", n]
|
|
129
140
|
]);
|
|
130
|
-
Object.keys(
|
|
131
|
-
function o(
|
|
132
|
-
const
|
|
133
|
-
return typeof
|
|
134
|
-
if (
|
|
135
|
-
return { target:
|
|
136
|
-
const
|
|
137
|
-
return { target:
|
|
141
|
+
Object.keys(e).reduce((r, d) => (r.set(d, e[d]), r), a);
|
|
142
|
+
function o(r, d) {
|
|
143
|
+
const i = r;
|
|
144
|
+
return typeof d == "number" ? [{ target: i, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: i, operator: "getProperty", param: r, value: !!d }] : typeof d == "object" ? Object.keys(d).map((s) => {
|
|
145
|
+
if (s === "length")
|
|
146
|
+
return { target: i, operator: "length", param: null, value: d[s] };
|
|
147
|
+
const f = s, m = d[s];
|
|
148
|
+
return { target: i, operator: "getProperty", param: f, value: m };
|
|
138
149
|
}) : [];
|
|
139
150
|
}
|
|
140
|
-
function
|
|
141
|
-
return Object.keys(
|
|
142
|
-
const
|
|
143
|
-
return
|
|
151
|
+
function l(r) {
|
|
152
|
+
return Object.keys(r).reduce((i, s) => {
|
|
153
|
+
const f = o(s, r[s]);
|
|
154
|
+
return i.push(...f), i;
|
|
144
155
|
}, []);
|
|
145
156
|
}
|
|
146
|
-
function
|
|
147
|
-
if (
|
|
148
|
-
const
|
|
149
|
-
return
|
|
157
|
+
function u(r, d) {
|
|
158
|
+
if (a.has(r.operator)) {
|
|
159
|
+
const i = a.get(r.operator);
|
|
160
|
+
return i && i(r.target, r.param, r.value, d) || !1;
|
|
150
161
|
}
|
|
151
162
|
return !1;
|
|
152
163
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
164
|
+
function c(r, d) {
|
|
165
|
+
return l(r).reduce((f, m) => f && u(m, d), !0);
|
|
155
166
|
}
|
|
156
|
-
function
|
|
157
|
-
const
|
|
158
|
-
return
|
|
167
|
+
function p(r, d) {
|
|
168
|
+
const i = Object.keys(r), s = i.includes("allOf"), f = i.includes("anyOf"), m = s || f, k = (m ? r[m ? s ? "allOf" : "anyOf" : "allOf"] : [r]).map((B) => c(B, d));
|
|
169
|
+
return s ? !k.includes(!1) : k.includes(!0);
|
|
159
170
|
}
|
|
160
|
-
return { parseValueSchema:
|
|
171
|
+
return { parseValueSchema: p };
|
|
161
172
|
}
|
|
162
|
-
const
|
|
173
|
+
const b = {
|
|
163
174
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
164
175
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
165
176
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -197,21 +208,22 @@ const u = {
|
|
|
197
208
|
"page-header": { type: "page-header", name: "页头", icon: "Header" },
|
|
198
209
|
"page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
|
|
199
210
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
200
|
-
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
212
|
+
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
213
|
+
}, xe = {}, Ve = {};
|
|
214
|
+
Pe();
|
|
215
|
+
function ne(e, t, n = /* @__PURE__ */ new Map(), a = (u, c, p, r) => c, o = {}, l = (u) => u) {
|
|
216
|
+
return Z[t.title] = t, ee[t.title] = a, xe[t.title] = o, Ve[t.title] = l, (u = {}) => {
|
|
217
|
+
const c = Ie(u, t, n), p = Object.keys(e).reduce((r, d) => (r[d] = e[d].default, r), {});
|
|
218
|
+
return Object.assign(p, c);
|
|
207
219
|
};
|
|
208
220
|
}
|
|
209
|
-
function
|
|
221
|
+
function Ae(e, t) {
|
|
210
222
|
return { customClass: t.class, customStyle: t.style };
|
|
211
223
|
}
|
|
212
|
-
const
|
|
213
|
-
["appearance",
|
|
214
|
-
]),
|
|
224
|
+
const Oe = /* @__PURE__ */ new Map([
|
|
225
|
+
["appearance", Ae]
|
|
226
|
+
]), De = /* @__PURE__ */ new Map([]), Le = "https://json-schema.org/draft/2020-12/schema", $e = "https://farris-design.gitee.io/radio-group.schema.json", Ne = "radio-group", qe = "A Farris Input Component", Ge = "object", je = {
|
|
215
227
|
id: {
|
|
216
228
|
description: "The unique identifier for a radio-group",
|
|
217
229
|
type: "string"
|
|
@@ -243,16 +255,6 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
243
255
|
type: "boolean",
|
|
244
256
|
default: !1
|
|
245
257
|
},
|
|
246
|
-
editable: {
|
|
247
|
-
description: "",
|
|
248
|
-
type: "boolean",
|
|
249
|
-
default: !0
|
|
250
|
-
},
|
|
251
|
-
placeholder: {
|
|
252
|
-
description: "",
|
|
253
|
-
type: "string",
|
|
254
|
-
default: ""
|
|
255
|
-
},
|
|
256
258
|
readonly: {
|
|
257
259
|
description: "",
|
|
258
260
|
type: "boolean",
|
|
@@ -288,27 +290,28 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
288
290
|
type: "string",
|
|
289
291
|
default: "value"
|
|
290
292
|
},
|
|
291
|
-
|
|
293
|
+
data: {
|
|
292
294
|
description: "",
|
|
293
295
|
type: "array"
|
|
294
296
|
}
|
|
295
|
-
},
|
|
297
|
+
}, Ue = [
|
|
296
298
|
"id",
|
|
297
299
|
"type"
|
|
298
|
-
],
|
|
300
|
+
], We = [
|
|
299
301
|
"id",
|
|
300
302
|
"appearance",
|
|
301
|
-
"binding"
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
$
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
303
|
+
"binding",
|
|
304
|
+
"visible"
|
|
305
|
+
], Re = {
|
|
306
|
+
$schema: Le,
|
|
307
|
+
$id: $e,
|
|
308
|
+
title: Ne,
|
|
309
|
+
description: qe,
|
|
310
|
+
type: Ge,
|
|
311
|
+
properties: je,
|
|
312
|
+
required: Ue,
|
|
313
|
+
ignore: We
|
|
314
|
+
}, ze = {
|
|
312
315
|
/**
|
|
313
316
|
* 是否被选中
|
|
314
317
|
*/
|
|
@@ -325,8 +328,8 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
325
328
|
* type为button或者tag时的尺寸
|
|
326
329
|
*/
|
|
327
330
|
size: { type: String, default: "middle" }
|
|
328
|
-
},
|
|
329
|
-
...
|
|
331
|
+
}, R = {
|
|
332
|
+
...ze,
|
|
330
333
|
/**
|
|
331
334
|
* 组件标识
|
|
332
335
|
*/
|
|
@@ -336,9 +339,29 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
336
339
|
*/
|
|
337
340
|
disabled: { type: Boolean, default: !1 },
|
|
338
341
|
/**
|
|
339
|
-
*
|
|
342
|
+
* 功能同disabled
|
|
340
343
|
*/
|
|
341
|
-
|
|
344
|
+
readonly: { type: Boolean, default: !1 },
|
|
345
|
+
/**
|
|
346
|
+
* 单选组枚举数组----废弃
|
|
347
|
+
*/
|
|
348
|
+
enumData: {
|
|
349
|
+
type: Array,
|
|
350
|
+
default: [
|
|
351
|
+
{ value: "example1", name: "示例一" },
|
|
352
|
+
{ value: "example2", name: "示例二" }
|
|
353
|
+
]
|
|
354
|
+
},
|
|
355
|
+
/**
|
|
356
|
+
* 单选组枚举数组
|
|
357
|
+
*/
|
|
358
|
+
data: {
|
|
359
|
+
type: Array,
|
|
360
|
+
default: [
|
|
361
|
+
{ value: "example1", name: "示例一" },
|
|
362
|
+
{ value: "example2", name: "示例二" }
|
|
363
|
+
]
|
|
364
|
+
},
|
|
342
365
|
/**
|
|
343
366
|
* 组件是否水平排列
|
|
344
367
|
*/
|
|
@@ -356,7 +379,7 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
356
379
|
/**
|
|
357
380
|
* 输入框Tab键索引
|
|
358
381
|
*/
|
|
359
|
-
tabIndex: Number,
|
|
382
|
+
tabIndex: { type: Number, default: -1 },
|
|
360
383
|
/**
|
|
361
384
|
* 枚举数组中展示文本的key值。
|
|
362
385
|
*/
|
|
@@ -365,193 +388,190 @@ const fe = /* @__PURE__ */ new Map([
|
|
|
365
388
|
* 枚举数组中枚举值的key值。
|
|
366
389
|
*/
|
|
367
390
|
valueField: { type: String, default: "value" }
|
|
368
|
-
},
|
|
369
|
-
function
|
|
370
|
-
const
|
|
371
|
-
function
|
|
372
|
-
return
|
|
373
|
-
}
|
|
374
|
-
function
|
|
375
|
-
return
|
|
376
|
-
}
|
|
377
|
-
function
|
|
378
|
-
if (
|
|
379
|
-
const
|
|
380
|
-
|
|
391
|
+
}, oe = ne(R, Re, Oe, we);
|
|
392
|
+
function ae(e, t, n) {
|
|
393
|
+
const a = I(() => !e.disabled), o = I(() => e.data || e.enumData || []);
|
|
394
|
+
function l(p) {
|
|
395
|
+
return p[e.valueField];
|
|
396
|
+
}
|
|
397
|
+
function u(p) {
|
|
398
|
+
return p[e.textField];
|
|
399
|
+
}
|
|
400
|
+
function c(p, r) {
|
|
401
|
+
if (a.value) {
|
|
402
|
+
const d = l(p);
|
|
403
|
+
n.value !== d && (n.value = d, t.emit("changeValue", d), t.emit("update:modelValue", d));
|
|
381
404
|
}
|
|
382
|
-
|
|
405
|
+
r.stopPropagation();
|
|
383
406
|
}
|
|
384
407
|
return {
|
|
385
408
|
enumData: o,
|
|
386
|
-
getValue:
|
|
387
|
-
getText:
|
|
388
|
-
onClickRadio:
|
|
409
|
+
getValue: l,
|
|
410
|
+
getText: u,
|
|
411
|
+
onClickRadio: c
|
|
389
412
|
};
|
|
390
413
|
}
|
|
391
|
-
const
|
|
414
|
+
const D = /* @__PURE__ */ V({
|
|
392
415
|
name: "FRadioGroup",
|
|
393
|
-
props:
|
|
416
|
+
props: R,
|
|
394
417
|
emits: ["changeValue", "update:modelValue"],
|
|
395
|
-
setup(
|
|
396
|
-
const
|
|
397
|
-
enumData:
|
|
418
|
+
setup(e, t) {
|
|
419
|
+
const n = w(e.modelValue), {
|
|
420
|
+
enumData: a,
|
|
398
421
|
onClickRadio: o,
|
|
399
|
-
getValue:
|
|
400
|
-
getText:
|
|
401
|
-
} =
|
|
402
|
-
"farris-checkradio-hor":
|
|
403
|
-
})),
|
|
404
|
-
return
|
|
405
|
-
radios:
|
|
406
|
-
parentProps:
|
|
422
|
+
getValue: l,
|
|
423
|
+
getText: u
|
|
424
|
+
} = ae(e, t, n), c = I(() => ({
|
|
425
|
+
"farris-checkradio-hor": e.direction === "horizontal"
|
|
426
|
+
})), p = w([]);
|
|
427
|
+
return de(Y, {
|
|
428
|
+
radios: p,
|
|
429
|
+
parentProps: e,
|
|
407
430
|
parentContext: t
|
|
408
|
-
}), () =>
|
|
409
|
-
class: ["farris-input-wrap",
|
|
410
|
-
}, [t.slots.default ? t.slots.default() :
|
|
411
|
-
const
|
|
412
|
-
return
|
|
431
|
+
}), () => g("div", {
|
|
432
|
+
class: ["farris-input-wrap", c.value]
|
|
433
|
+
}, [t.slots.default ? t.slots.default() : a.value.map((r, d) => {
|
|
434
|
+
const i = "radio_" + e.id + e.name + r[e.valueField];
|
|
435
|
+
return g("div", {
|
|
413
436
|
class: "custom-control custom-radio"
|
|
414
|
-
}, [
|
|
437
|
+
}, [g("input", {
|
|
415
438
|
type: "radio",
|
|
416
439
|
class: "custom-control-input",
|
|
417
|
-
name:
|
|
418
|
-
id:
|
|
419
|
-
value:
|
|
420
|
-
checked:
|
|
421
|
-
disabled:
|
|
422
|
-
tabindex:
|
|
423
|
-
onClick: (
|
|
424
|
-
}, null),
|
|
440
|
+
name: i,
|
|
441
|
+
id: i,
|
|
442
|
+
value: l(r),
|
|
443
|
+
checked: l(r) === n.value,
|
|
444
|
+
disabled: e.readonly || e.disabled,
|
|
445
|
+
tabindex: e.tabIndex,
|
|
446
|
+
onClick: (s) => o(r, s)
|
|
447
|
+
}, null), g("label", {
|
|
425
448
|
class: "custom-control-label",
|
|
426
|
-
for:
|
|
427
|
-
}, [
|
|
449
|
+
for: i
|
|
450
|
+
}, [u(r)])]);
|
|
428
451
|
})]);
|
|
429
452
|
}
|
|
430
453
|
});
|
|
431
|
-
function
|
|
432
|
-
var
|
|
433
|
-
|
|
434
|
-
|
|
454
|
+
function Xe(e, t, n) {
|
|
455
|
+
var P;
|
|
456
|
+
const a = n && n.getStyles && n.getStyles() || "", o = n && n.getDesignerClass && n.getDesignerClass() || "", l = w();
|
|
457
|
+
function u() {
|
|
458
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
|
|
435
459
|
}
|
|
436
|
-
|
|
437
|
-
const o = e && e.getStyles && e.getStyles() || "", a = e && e.getDesignerClass && e.getDesignerClass() || "", c = M();
|
|
438
|
-
function d() {
|
|
439
|
-
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
|
|
440
|
-
}
|
|
441
|
-
function l() {
|
|
460
|
+
function c() {
|
|
442
461
|
return !1;
|
|
443
462
|
}
|
|
444
|
-
function i() {
|
|
445
|
-
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
|
|
446
|
-
}
|
|
447
463
|
function p() {
|
|
448
|
-
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !
|
|
464
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
|
|
449
465
|
}
|
|
450
|
-
function
|
|
451
|
-
|
|
466
|
+
function r() {
|
|
467
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
|
|
468
|
+
}
|
|
469
|
+
function d(C) {
|
|
470
|
+
if (!C || !C.value)
|
|
452
471
|
return null;
|
|
453
|
-
if (
|
|
454
|
-
return
|
|
455
|
-
const
|
|
456
|
-
return
|
|
472
|
+
if (C.value.schema && C.value.schema.type === "component")
|
|
473
|
+
return C.value;
|
|
474
|
+
const E = w(C == null ? void 0 : C.value.parent), S = d(E);
|
|
475
|
+
return S || null;
|
|
457
476
|
}
|
|
458
|
-
function
|
|
459
|
-
const { componentInstance:
|
|
460
|
-
return !
|
|
477
|
+
function i(C = t) {
|
|
478
|
+
const { componentInstance: E, designerItemElementRef: S } = C;
|
|
479
|
+
return !E || !E.value ? null : E.value.canMove ? S : i(C.parent);
|
|
461
480
|
}
|
|
462
|
-
function
|
|
463
|
-
return !!
|
|
481
|
+
function s(C) {
|
|
482
|
+
return !!n && n.canAccepts(C);
|
|
464
483
|
}
|
|
465
484
|
function f() {
|
|
466
485
|
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
467
486
|
}
|
|
468
|
-
function
|
|
469
|
-
}
|
|
470
|
-
function
|
|
471
|
-
|
|
472
|
-
}
|
|
473
|
-
function F(
|
|
474
|
-
const { componentType:
|
|
475
|
-
let
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
return
|
|
479
|
-
}
|
|
480
|
-
function
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
487
|
+
function m() {
|
|
488
|
+
}
|
|
489
|
+
function y(C, E) {
|
|
490
|
+
E && n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(E);
|
|
491
|
+
}
|
|
492
|
+
function F(C, E) {
|
|
493
|
+
const { componentType: S } = C;
|
|
494
|
+
let M = te(S, C, E);
|
|
495
|
+
n && n.onResolveNewComponentSchema && (M = n.onResolveNewComponentSchema(C, M));
|
|
496
|
+
const v = S.toLowerCase().replace(/-/g, "_");
|
|
497
|
+
return M && !M.id && M.type === S && (M.id = `${v}_${Math.random().toString().slice(2, 6)}`), M;
|
|
498
|
+
}
|
|
499
|
+
function k(C) {
|
|
500
|
+
}
|
|
501
|
+
function h(...C) {
|
|
502
|
+
if (n && n.getPropsConfig)
|
|
503
|
+
return n.getPropsConfig(...C);
|
|
504
|
+
}
|
|
505
|
+
function B() {
|
|
506
|
+
n && n.onRemoveComponent && n.onRemoveComponent(), t != null && t.schema.contents && t.schema.contents.map((C) => {
|
|
507
|
+
var M;
|
|
508
|
+
let E = C.id;
|
|
509
|
+
C.type === "component-ref" && (E = C.component);
|
|
510
|
+
const S = e.value.querySelector(`#${E}-design-item`);
|
|
511
|
+
(M = S == null ? void 0 : S.componentInstance) != null && M.value.onRemoveComponent && S.componentInstance.value.onRemoveComponent();
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
return l.value = {
|
|
515
|
+
canMove: u(),
|
|
516
|
+
canSelectParent: c(),
|
|
517
|
+
canDelete: p(),
|
|
518
|
+
canNested: !r(),
|
|
499
519
|
contents: t == null ? void 0 : t.schema.contents,
|
|
500
|
-
elementRef:
|
|
501
|
-
parent: (
|
|
520
|
+
elementRef: e,
|
|
521
|
+
parent: (P = t == null ? void 0 : t.parent) == null ? void 0 : P.componentInstance,
|
|
502
522
|
schema: t == null ? void 0 : t.schema,
|
|
503
|
-
styles:
|
|
504
|
-
designerClass:
|
|
505
|
-
canAccepts:
|
|
506
|
-
getBelongedComponentInstance:
|
|
507
|
-
getDraggableDesignItemElement:
|
|
523
|
+
styles: a,
|
|
524
|
+
designerClass: o,
|
|
525
|
+
canAccepts: s,
|
|
526
|
+
getBelongedComponentInstance: d,
|
|
527
|
+
getDraggableDesignItemElement: i,
|
|
508
528
|
getDraggingDisplayText: f,
|
|
509
|
-
getPropConfig:
|
|
510
|
-
getDragScopeElement:
|
|
511
|
-
onAcceptMovedChildElement:
|
|
512
|
-
|
|
513
|
-
onChildElementMovedOut: A,
|
|
529
|
+
getPropConfig: h,
|
|
530
|
+
getDragScopeElement: m,
|
|
531
|
+
onAcceptMovedChildElement: y,
|
|
532
|
+
onChildElementMovedOut: k,
|
|
514
533
|
addNewChildComponentSchema: F,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
},
|
|
534
|
+
triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || w(!1),
|
|
535
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || w(!1),
|
|
536
|
+
onRemoveComponent: B
|
|
537
|
+
}, l;
|
|
519
538
|
}
|
|
520
|
-
class
|
|
521
|
-
constructor(t,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
539
|
+
class He {
|
|
540
|
+
constructor(t, n) {
|
|
541
|
+
T(this, "componentId");
|
|
542
|
+
T(this, "viewModelId");
|
|
543
|
+
T(this, "eventsEditorUtils");
|
|
544
|
+
T(this, "formSchemaUtils");
|
|
545
|
+
T(this, "formMetadataConverter");
|
|
546
|
+
T(this, "designViewModelUtils");
|
|
547
|
+
T(this, "designViewModelField");
|
|
548
|
+
T(this, "controlCreatorUtils");
|
|
549
|
+
T(this, "designerHostService");
|
|
550
|
+
T(this, "schemaService", null);
|
|
551
|
+
T(this, "metadataService", null);
|
|
552
|
+
T(this, "propertyConfig", {
|
|
534
553
|
type: "object",
|
|
535
554
|
categories: {}
|
|
536
555
|
});
|
|
537
|
-
var
|
|
538
|
-
this.componentId = t, this.designerHostService =
|
|
556
|
+
var a;
|
|
557
|
+
this.componentId = t, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((a = this.formSchemaUtils) == null ? void 0 : a.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService;
|
|
539
558
|
}
|
|
540
559
|
getTableInfo() {
|
|
541
560
|
var t;
|
|
542
561
|
return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
|
|
543
562
|
}
|
|
544
563
|
setDesignViewModelField(t) {
|
|
545
|
-
|
|
546
|
-
|
|
564
|
+
var a;
|
|
565
|
+
const n = t.binding && t.binding.type === "Form" && t.binding.field;
|
|
566
|
+
if (n) {
|
|
547
567
|
if (!this.designViewModelField) {
|
|
548
|
-
const
|
|
549
|
-
this.designViewModelField =
|
|
568
|
+
const o = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
569
|
+
this.designViewModelField = o.fields.find((l) => l.id === n);
|
|
550
570
|
}
|
|
551
|
-
t.updateOn = this.designViewModelField.updateOn;
|
|
571
|
+
t.updateOn = (a = this.designViewModelField) == null ? void 0 : a.updateOn;
|
|
552
572
|
}
|
|
553
573
|
}
|
|
554
|
-
changeFieldEditorType(t,
|
|
574
|
+
changeFieldEditorType(t, n) {
|
|
555
575
|
}
|
|
556
576
|
getBasicPropConfig(t) {
|
|
557
577
|
return {
|
|
@@ -572,7 +592,7 @@ class Se {
|
|
|
572
592
|
type: "combo-list",
|
|
573
593
|
textField: "name",
|
|
574
594
|
valueField: "value",
|
|
575
|
-
data: [{ value: t.type, name:
|
|
595
|
+
data: [{ value: t.type, name: b[t.type].name }]
|
|
576
596
|
}
|
|
577
597
|
}
|
|
578
598
|
}
|
|
@@ -604,30 +624,30 @@ class Se {
|
|
|
604
624
|
* @param componentInstance
|
|
605
625
|
* @returns
|
|
606
626
|
*/
|
|
607
|
-
updateElementByParentContainer(t,
|
|
608
|
-
const
|
|
609
|
-
if (!
|
|
627
|
+
updateElementByParentContainer(t, n) {
|
|
628
|
+
const a = n && n.parent && n.parent.schema;
|
|
629
|
+
if (!a)
|
|
610
630
|
return;
|
|
611
|
-
const o =
|
|
612
|
-
|
|
631
|
+
const o = a.contents.findIndex((u) => u.id === t), l = U(a.contents[o]);
|
|
632
|
+
a.contents.splice(o, 1), a.contents.splice(o, 0, l);
|
|
613
633
|
}
|
|
614
634
|
}
|
|
615
|
-
const
|
|
635
|
+
const O = class O {
|
|
616
636
|
/**
|
|
617
637
|
* 根据绑定字段类型获取可用的输入类控件
|
|
618
638
|
*/
|
|
619
639
|
static getEditorTypesByMDataType(t) {
|
|
620
|
-
const
|
|
621
|
-
return
|
|
640
|
+
const n = O.fieldControlTypeMapping[t];
|
|
641
|
+
return n || [{ key: "", value: "" }];
|
|
622
642
|
}
|
|
623
643
|
/**
|
|
624
644
|
* 获取所有输入类控件
|
|
625
645
|
*/
|
|
626
646
|
static getAllInputTypes() {
|
|
627
647
|
const t = [];
|
|
628
|
-
for (
|
|
629
|
-
|
|
630
|
-
t.find((o) => o.key ===
|
|
648
|
+
for (const n in O.fieldControlTypeMapping)
|
|
649
|
+
O.fieldControlTypeMapping[n].forEach((a) => {
|
|
650
|
+
t.find((o) => o.key === a.key && o.value === a.value) || t.push({ key: a.key, value: a.value });
|
|
631
651
|
});
|
|
632
652
|
return t;
|
|
633
653
|
}
|
|
@@ -635,69 +655,174 @@ const P = class P {
|
|
|
635
655
|
/**
|
|
636
656
|
* <字段类型,可配置的控件类型列表>的映射
|
|
637
657
|
*/
|
|
638
|
-
|
|
658
|
+
T(O, "fieldControlTypeMapping", {
|
|
639
659
|
String: [
|
|
640
|
-
{ key:
|
|
641
|
-
{ key:
|
|
642
|
-
{ key:
|
|
643
|
-
{ key:
|
|
644
|
-
{ key:
|
|
645
|
-
{ key:
|
|
646
|
-
{ key:
|
|
660
|
+
{ key: b["input-group"].type, value: b["input-group"].name },
|
|
661
|
+
{ key: b.lookup.type, value: b.lookup.name },
|
|
662
|
+
{ key: b["date-picker"].type, value: b["date-picker"].name },
|
|
663
|
+
{ key: b["check-box"].type, value: b["check-box"].name },
|
|
664
|
+
{ key: b["check-group"].type, value: b["check-group"].name },
|
|
665
|
+
{ key: b["radio-group"].type, value: b["radio-group"].name },
|
|
666
|
+
{ key: b["combo-list"].type, value: b["combo-list"].name },
|
|
667
|
+
{ key: b.textarea.type, value: b.textarea.name }
|
|
647
668
|
],
|
|
648
669
|
Text: [
|
|
649
|
-
{ key:
|
|
650
|
-
{ key:
|
|
670
|
+
{ key: b.textarea.type, value: b.textarea.name },
|
|
671
|
+
{ key: b.lookup.type, value: b.lookup.name }
|
|
651
672
|
],
|
|
652
673
|
Decimal: [
|
|
653
|
-
{ key:
|
|
674
|
+
{ key: b["number-spinner"].type, value: b["number-spinner"].name }
|
|
654
675
|
],
|
|
655
676
|
Integer: [
|
|
656
|
-
{ key:
|
|
677
|
+
{ key: b["number-spinner"].type, value: b["number-spinner"].name }
|
|
657
678
|
],
|
|
658
679
|
Number: [
|
|
659
|
-
{ key:
|
|
680
|
+
{ key: b["number-spinner"].type, value: b["number-spinner"].name }
|
|
660
681
|
],
|
|
661
682
|
BigNumber: [
|
|
662
|
-
{ key:
|
|
683
|
+
{ key: b["number-spinner"].type, value: b["number-spinner"].name }
|
|
663
684
|
],
|
|
664
685
|
Date: [
|
|
665
|
-
{ key:
|
|
686
|
+
{ key: b["date-picker"].type, value: b["date-picker"].name }
|
|
666
687
|
],
|
|
667
688
|
DateTime: [
|
|
668
|
-
{ key:
|
|
689
|
+
{ key: b["date-picker"].type, value: b["date-picker"].name }
|
|
669
690
|
],
|
|
670
691
|
Boolean: [
|
|
671
|
-
{ key:
|
|
672
|
-
{ key:
|
|
692
|
+
{ key: b.switch.type, value: b.switch.name },
|
|
693
|
+
{ key: b["check-box"].type, value: b["check-box"].name }
|
|
673
694
|
],
|
|
674
695
|
Enum: [
|
|
675
|
-
{ key:
|
|
676
|
-
{ key:
|
|
696
|
+
{ key: b["combo-list"].type, value: b["combo-list"].name },
|
|
697
|
+
{ key: b["radio-group"].type, value: b["radio-group"].name }
|
|
677
698
|
],
|
|
678
699
|
Object: [
|
|
679
|
-
{ key:
|
|
680
|
-
{ key:
|
|
681
|
-
{ key:
|
|
700
|
+
{ key: b.lookup.type, value: b.lookup.name },
|
|
701
|
+
{ key: b["combo-list"].type, value: b["combo-list"].name },
|
|
702
|
+
{ key: b["radio-group"].type, value: b["radio-group"].name }
|
|
682
703
|
]
|
|
683
704
|
});
|
|
684
|
-
let
|
|
685
|
-
const
|
|
686
|
-
class
|
|
687
|
-
constructor(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
this
|
|
699
|
-
|
|
705
|
+
let q = O;
|
|
706
|
+
const _e = w(0);
|
|
707
|
+
class Ke {
|
|
708
|
+
constructor() {
|
|
709
|
+
/** 控件标题 */
|
|
710
|
+
T(this, "label", "");
|
|
711
|
+
/** 控件id */
|
|
712
|
+
T(this, "id", "");
|
|
713
|
+
/** 每个控件占用的栅格数 */
|
|
714
|
+
T(this, "columnInSM", 12);
|
|
715
|
+
T(this, "columnInMD", 6);
|
|
716
|
+
T(this, "columnInLG", 3);
|
|
717
|
+
T(this, "columnInEL", 2);
|
|
718
|
+
/** 每个控件占用的列数 */
|
|
719
|
+
T(this, "displayWidthInSM", 1);
|
|
720
|
+
T(this, "displayWidthInMD", 1);
|
|
721
|
+
T(this, "displayWidthInLG", 1);
|
|
722
|
+
T(this, "displayWidthInEL", 1);
|
|
723
|
+
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
|
|
724
|
+
T(this, "displayColumnCountAtBreakPoint", "md");
|
|
725
|
+
/** 控件所在行,传0即可-----编辑器内部使用 */
|
|
726
|
+
T(this, "tagRow", 0);
|
|
727
|
+
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
|
|
728
|
+
T(this, "showTopBorder", 0);
|
|
729
|
+
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
|
|
730
|
+
T(this, "group", 1);
|
|
731
|
+
/** 控件是否符合标准的class配置(设计器用的) */
|
|
732
|
+
T(this, "isSupportedClass", !0);
|
|
733
|
+
/** 控件所在分组id(设计器用的) */
|
|
734
|
+
T(this, "fieldSetId", "");
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
function Qe(e) {
|
|
738
|
+
let t, n;
|
|
739
|
+
const a = /* @__PURE__ */ new Map();
|
|
740
|
+
let o = [];
|
|
741
|
+
function l(d, i) {
|
|
742
|
+
const f = d.split(" ").filter((h) => h.startsWith("col-"));
|
|
743
|
+
if (f.length === 0) {
|
|
744
|
+
i.isSupportedClass = !1;
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
let m = f.find((h) => /^col-([1-9]|10|11|12)$/.test(h)), y = f.find((h) => /^col-md-([1-9]|10|11|12)$/.test(h)), F = f.find((h) => /^col-xl-([1-9]|10|11|12)$/.test(h)), k = f.find((h) => /^col-el-([1-9]|10|11|12)$/.test(h));
|
|
748
|
+
m = m || "col-12", i.columnInSM = parseInt(m.replace("col-", ""), 10), i.displayWidthInSM = i.columnInSM / 12, i.displayWidthInSM !== 1 && (i.isSupportedClass = !1), y = y || "col-md-" + i.columnInSM, i.columnInMD = parseInt(y.replace("col-md-", ""), 10), i.displayWidthInMD = i.columnInMD / 6, [1, 2].includes(i.displayWidthInMD) || (i.isSupportedClass = !1), F = F || "col-xl-" + i.columnInMD, i.columnInLG = parseInt(F.replace("col-xl-", ""), 10), i.displayWidthInLG = i.columnInLG / 3, [1, 2, 3, 4].includes(i.displayWidthInLG) || (i.isSupportedClass = !1), k = k || "col-el-" + i.columnInLG, i.columnInEL = parseInt(k.replace("col-el-", ""), 10), i.displayWidthInEL = i.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(i.displayWidthInEL) || (i.isSupportedClass = !1);
|
|
749
|
+
}
|
|
750
|
+
function u(d, i, s, f = !1) {
|
|
751
|
+
let m = !1;
|
|
752
|
+
d.contents.forEach((y) => {
|
|
753
|
+
if (y.type === "fieldset") {
|
|
754
|
+
s += 1, u(y, i, s, !0), m = !0;
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
m && (s += 1, m = !1);
|
|
758
|
+
const F = y.appearance && y.appearance.class, k = new Ke();
|
|
759
|
+
F ? l(F, k) : k.isSupportedClass = !1, k.label = y.label || y.id, k.id = y.id, k.group = s, f && (k.fieldSetId = d.id), n === y.id && (t = s), a.set(y.id, y), i.push(k);
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
function c(d) {
|
|
763
|
+
const i = e.getComponentById(d);
|
|
764
|
+
if (!i || !i.componentType || !i.componentType.startsWith("form"))
|
|
765
|
+
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
766
|
+
const s = e.selectNode(i, (f) => f.type === _["response-form"].type);
|
|
767
|
+
return !s || !s.contents || s.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: s };
|
|
768
|
+
}
|
|
769
|
+
function p(d, i) {
|
|
770
|
+
i = i || d.id;
|
|
771
|
+
const { result: s, message: f, formNode: m } = c(i);
|
|
772
|
+
if (!s)
|
|
773
|
+
return { result: s, message: f };
|
|
774
|
+
n = d.id, o = [], a.clear();
|
|
775
|
+
const y = m.contents[0].type === _.fieldset.type ? 0 : 1;
|
|
776
|
+
u(m, o, y);
|
|
777
|
+
const F = o.find((h) => !h.isSupportedClass);
|
|
700
778
|
return {
|
|
779
|
+
defaultState: {
|
|
780
|
+
defaultGroupNumber: t || 1,
|
|
781
|
+
model: F ? "customize" : "standard"
|
|
782
|
+
},
|
|
783
|
+
importData: o
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
function r(d, i) {
|
|
787
|
+
i = i;
|
|
788
|
+
const { result: s, formNode: f } = c(i);
|
|
789
|
+
if (!s)
|
|
790
|
+
return "";
|
|
791
|
+
const m = [];
|
|
792
|
+
return d.forEach((y) => {
|
|
793
|
+
var h;
|
|
794
|
+
const F = a.get(y.id), k = F.appearance && F.appearance.class;
|
|
795
|
+
if (k) {
|
|
796
|
+
const P = k.split(" ").filter((x) => !x.startsWith("col-")), C = "col-" + y.columnInSM, E = "col-md-" + y.columnInMD, S = "col-xl-" + y.columnInLG, M = "col-el-" + y.columnInEL, v = [C, E, S, M].concat(P);
|
|
797
|
+
F.appearance.class = v.join(" ");
|
|
798
|
+
}
|
|
799
|
+
if (y.fieldSetId) {
|
|
800
|
+
const B = f.contents.find((C) => C.id === y.fieldSetId), P = m.find((C) => C.id === y.fieldSetId);
|
|
801
|
+
P ? (h = P.contents) == null || h.push(F) : (m.push(B), B.contents = [F]);
|
|
802
|
+
} else
|
|
803
|
+
m.push(F);
|
|
804
|
+
}), f.contents = m, f.id;
|
|
805
|
+
}
|
|
806
|
+
return {
|
|
807
|
+
checkCanFindFormNode: c,
|
|
808
|
+
checkCanOpenLayoutEditor: p,
|
|
809
|
+
changeFormControlsByResponseLayoutConfig: r,
|
|
810
|
+
getResonseFormLayoutConfig: u
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
class Je extends He {
|
|
814
|
+
constructor(n, a) {
|
|
815
|
+
super(n, a);
|
|
816
|
+
T(this, "responseLayoutEditorFunction");
|
|
817
|
+
this.responseLayoutEditorFunction = Qe(this.formSchemaUtils);
|
|
818
|
+
}
|
|
819
|
+
getPropertyConfig(n, a) {
|
|
820
|
+
return this.propertyConfig.categories.basic = this.getBasicProperties(n, a), this.propertyConfig.categories.appearance = this.getAppearanceProperties(n, a), this.propertyConfig.categories.editor = this.getEditorProperties(n), this.propertyConfig;
|
|
821
|
+
}
|
|
822
|
+
getBasicProperties(n, a) {
|
|
823
|
+
var l;
|
|
824
|
+
const o = this;
|
|
825
|
+
return this.setDesignViewModelField(n), this.formSchemaUtils.getFormMetadataBasicInfo(), {
|
|
701
826
|
description: "Basic Information",
|
|
702
827
|
title: "基本信息",
|
|
703
828
|
properties: {
|
|
@@ -718,7 +843,7 @@ class Ee extends Se {
|
|
|
718
843
|
textField: "value",
|
|
719
844
|
valueField: "key",
|
|
720
845
|
editable: !1,
|
|
721
|
-
data: o.designViewModelField ?
|
|
846
|
+
data: o.designViewModelField ? q.getEditorTypesByMDataType((l = o.designViewModelField.type) == null ? void 0 : l.name) : q.getAllInputTypes()
|
|
722
847
|
}
|
|
723
848
|
},
|
|
724
849
|
label: {
|
|
@@ -729,41 +854,37 @@ class Ee extends Se {
|
|
|
729
854
|
binding: {
|
|
730
855
|
description: "绑定的表单字段",
|
|
731
856
|
title: "绑定",
|
|
732
|
-
$converter: "/converter/field-selector.converter",
|
|
733
857
|
editor: {
|
|
734
|
-
type: "
|
|
858
|
+
type: "binding-selector",
|
|
735
859
|
bindingType: { enable: !1 },
|
|
736
860
|
editorParams: {
|
|
737
|
-
|
|
738
|
-
|
|
861
|
+
componentSchema: n,
|
|
862
|
+
needSyncToViewModel: !0,
|
|
863
|
+
viewModelId: this.viewModelId,
|
|
864
|
+
designerHostService: this.designerHostService,
|
|
865
|
+
disableOccupiedFields: !0
|
|
739
866
|
},
|
|
740
|
-
|
|
741
|
-
{ field: "name", title: "字段名称" },
|
|
742
|
-
{ field: "bindingField", title: "绑定字段" },
|
|
743
|
-
{ field: "fieldType", title: "字段类型" }
|
|
744
|
-
],
|
|
745
|
-
textField: "bindingField",
|
|
746
|
-
data: c
|
|
867
|
+
textField: "bindingField"
|
|
747
868
|
}
|
|
748
869
|
}
|
|
749
870
|
},
|
|
750
|
-
setPropertyRelates(
|
|
751
|
-
if (
|
|
752
|
-
switch (
|
|
871
|
+
setPropertyRelates(u, c) {
|
|
872
|
+
if (u)
|
|
873
|
+
switch (u && u.propertyID) {
|
|
753
874
|
case "type": {
|
|
754
|
-
o.changeControlType(
|
|
875
|
+
o.changeControlType(n, u, a);
|
|
755
876
|
break;
|
|
756
877
|
}
|
|
757
878
|
case "label": {
|
|
758
|
-
|
|
879
|
+
u.needRefreshControlTree = !0;
|
|
759
880
|
break;
|
|
760
881
|
}
|
|
761
882
|
}
|
|
762
883
|
}
|
|
763
884
|
};
|
|
764
885
|
}
|
|
765
|
-
getAppearanceProperties(
|
|
766
|
-
|
|
886
|
+
getAppearanceProperties(n, a) {
|
|
887
|
+
const o = this;
|
|
767
888
|
return {
|
|
768
889
|
title: "样式",
|
|
769
890
|
description: "Appearance",
|
|
@@ -789,69 +910,69 @@ class Ee extends Se {
|
|
|
789
910
|
refreshPanelAfterChanged: !0,
|
|
790
911
|
editor: {
|
|
791
912
|
type: "response-layout-editor-setting",
|
|
792
|
-
initialState: o.responseLayoutEditorFunction.checkCanOpenLayoutEditor(
|
|
913
|
+
initialState: o.responseLayoutEditorFunction.checkCanOpenLayoutEditor(n, o.componentId)
|
|
793
914
|
}
|
|
794
915
|
}
|
|
795
916
|
},
|
|
796
|
-
setPropertyRelates(
|
|
797
|
-
if (
|
|
798
|
-
switch (
|
|
917
|
+
setPropertyRelates(l, u) {
|
|
918
|
+
if (l)
|
|
919
|
+
switch (l && l.propertyID) {
|
|
799
920
|
case "responseLayout":
|
|
800
|
-
o.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(
|
|
921
|
+
o.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(l.propertyValue, o.componentId || n.id), o.updateUnifiedLayoutAfterResponseLayoutChanged(o.componentId), o.updateElementByParentContainer(n.id, a), delete n.responseLayout;
|
|
801
922
|
break;
|
|
802
923
|
case "class":
|
|
803
|
-
o.updateUnifiedLayoutAfterControlChanged(
|
|
924
|
+
o.updateUnifiedLayoutAfterControlChanged(l.propertyValue, n.id, this.componentId), o.updateElementByParentContainer(n.id, a);
|
|
804
925
|
break;
|
|
805
926
|
}
|
|
806
927
|
}
|
|
807
928
|
};
|
|
808
929
|
}
|
|
809
|
-
getEditorProperties(
|
|
810
|
-
return this.getComponentConfig(
|
|
930
|
+
getEditorProperties(n) {
|
|
931
|
+
return this.getComponentConfig(n);
|
|
811
932
|
}
|
|
812
933
|
/**
|
|
813
934
|
* 卡片控件:切换控件类型后事件
|
|
814
935
|
* @param propertyData 控件DOM属性
|
|
815
936
|
* @param newControlType 新控件类型
|
|
816
937
|
*/
|
|
817
|
-
changeControlType(
|
|
818
|
-
var
|
|
819
|
-
const
|
|
820
|
-
if (!
|
|
938
|
+
changeControlType(n, a, o) {
|
|
939
|
+
var d, i, s, f;
|
|
940
|
+
const l = a.propertyValue, u = o && o.parent && o.parent.schema;
|
|
941
|
+
if (!u)
|
|
821
942
|
return;
|
|
822
|
-
const
|
|
823
|
-
let
|
|
943
|
+
const c = u.contents.findIndex((m) => m.id === n.id), p = u.contents[c];
|
|
944
|
+
let r;
|
|
824
945
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
825
946
|
editor: {
|
|
826
|
-
$type:
|
|
947
|
+
$type: l
|
|
827
948
|
},
|
|
828
949
|
name: this.designViewModelField.name,
|
|
829
950
|
require: this.designViewModelField.require,
|
|
830
951
|
readonly: this.designViewModelField.readonly
|
|
831
|
-
}, !1),
|
|
832
|
-
id:
|
|
833
|
-
appearance:
|
|
834
|
-
size:
|
|
835
|
-
label:
|
|
836
|
-
binding:
|
|
837
|
-
visible:
|
|
838
|
-
}), Object.assign(
|
|
839
|
-
isTextArea:
|
|
840
|
-
placeholder: (
|
|
841
|
-
holdPlace: (
|
|
842
|
-
readonly: (
|
|
843
|
-
require: (
|
|
844
|
-
}),
|
|
845
|
-
(
|
|
846
|
-
),
|
|
847
|
-
}
|
|
848
|
-
getComponentConfig(
|
|
849
|
-
const
|
|
952
|
+
}, !1), r = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, l)), r || (r = this.controlCreatorUtils.createFormGroupWithoutField(l)), Object.assign(r, {
|
|
953
|
+
id: p.id,
|
|
954
|
+
appearance: p.appearance,
|
|
955
|
+
size: p.size,
|
|
956
|
+
label: p.label,
|
|
957
|
+
binding: p.binding,
|
|
958
|
+
visible: p.visible
|
|
959
|
+
}), Object.assign(r.editor, {
|
|
960
|
+
isTextArea: r.isTextArea && p.isTextArea,
|
|
961
|
+
placeholder: (d = p.editor) == null ? void 0 : d.placeholder,
|
|
962
|
+
holdPlace: (i = p.editor) == null ? void 0 : i.holdPlace,
|
|
963
|
+
readonly: (s = p.editor) == null ? void 0 : s.readonly,
|
|
964
|
+
require: (f = p.editor) == null ? void 0 : f.require
|
|
965
|
+
}), u.contents.splice(c, 1), u.contents.splice(c, 0, r), o.schema = Object.assign(p, r), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
966
|
+
(m) => m.classList.remove("dgComponentSelected")
|
|
967
|
+
), _e.value++;
|
|
968
|
+
}
|
|
969
|
+
getComponentConfig(n, a = {}, o = {}) {
|
|
970
|
+
const l = Object.assign({
|
|
850
971
|
description: "编辑器",
|
|
851
972
|
title: "编辑器",
|
|
852
973
|
type: "input-group",
|
|
853
974
|
$converter: "/converter/property-editor.converter"
|
|
854
|
-
},
|
|
975
|
+
}, a), u = Object.assign({
|
|
855
976
|
readonly: {
|
|
856
977
|
description: "",
|
|
857
978
|
title: "只读",
|
|
@@ -873,7 +994,7 @@ class Ee extends Se {
|
|
|
873
994
|
type: "string"
|
|
874
995
|
}
|
|
875
996
|
}, o);
|
|
876
|
-
return { ...
|
|
997
|
+
return { ...l, properties: { ...u } };
|
|
877
998
|
}
|
|
878
999
|
/**
|
|
879
1000
|
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
@@ -881,56 +1002,56 @@ class Ee extends Se {
|
|
|
881
1002
|
* @param controlId 控件Id
|
|
882
1003
|
* @param componentId 控件所在组件id
|
|
883
1004
|
*/
|
|
884
|
-
updateUnifiedLayoutAfterControlChanged(
|
|
885
|
-
const
|
|
886
|
-
let
|
|
887
|
-
|
|
888
|
-
const
|
|
889
|
-
id:
|
|
890
|
-
columnInSM: parseInt(
|
|
891
|
-
columnInMD: parseInt(
|
|
892
|
-
columnInLG: parseInt(
|
|
893
|
-
columnInEL: parseInt(
|
|
1005
|
+
updateUnifiedLayoutAfterControlChanged(n, a, o) {
|
|
1006
|
+
const l = n.split(" ");
|
|
1007
|
+
let u = l.find((i) => /^col-([1-9]|10|11|12)$/.test(i)), c = l.find((i) => /^col-md-([1-9]|10|11|12)$/.test(i)), p = l.find((i) => /^col-xl-([1-9]|10|11|12)$/.test(i)), r = l.find((i) => /^col-el-([1-9]|10|11|12)$/.test(i));
|
|
1008
|
+
u = u || "col-12", c = c || "col-md-" + u.replace("col-", ""), p = p || "col-xl-" + c.replace("col-md-", ""), r = r || "col-el-" + p.replace("col-xl-", "");
|
|
1009
|
+
const d = {
|
|
1010
|
+
id: a,
|
|
1011
|
+
columnInSM: parseInt(u.replace("col-", ""), 10),
|
|
1012
|
+
columnInMD: parseInt(c.replace("col-md-", ""), 10),
|
|
1013
|
+
columnInLG: parseInt(p.replace("col-xl-", ""), 10),
|
|
1014
|
+
columnInEL: parseInt(r.replace("col-el-", ""), 10)
|
|
894
1015
|
};
|
|
895
|
-
this.updateUnifiedLayoutAfterResponseLayoutChanged(o,
|
|
1016
|
+
this.updateUnifiedLayoutAfterResponseLayoutChanged(o, d);
|
|
896
1017
|
}
|
|
897
1018
|
/**
|
|
898
1019
|
* 修改控件布局配置后更新Form统一布局配置
|
|
899
1020
|
* @param componentId 组件Id
|
|
900
1021
|
* @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
|
|
901
1022
|
*/
|
|
902
|
-
updateUnifiedLayoutAfterResponseLayoutChanged(
|
|
903
|
-
const { formNode: o } = this.responseLayoutEditorFunction.checkCanFindFormNode(
|
|
1023
|
+
updateUnifiedLayoutAfterResponseLayoutChanged(n, a) {
|
|
1024
|
+
const { formNode: o } = this.responseLayoutEditorFunction.checkCanFindFormNode(n);
|
|
904
1025
|
if (!o || !o.unifiedLayout)
|
|
905
1026
|
return;
|
|
906
|
-
const
|
|
907
|
-
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(o,
|
|
908
|
-
const
|
|
909
|
-
Object.assign(
|
|
1027
|
+
const l = [];
|
|
1028
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(o, l, 1), a) {
|
|
1029
|
+
const m = l.find((y) => y.id === a.id);
|
|
1030
|
+
Object.assign(m || {}, a);
|
|
910
1031
|
}
|
|
911
|
-
const
|
|
1032
|
+
const u = l.map((m) => m.columnInSM), c = l.map((m) => m.columnInMD), p = l.map((m) => m.columnInLG), r = l.map((m) => m.columnInEL), d = this.checkIsUniqueColumn(u) ? u[0] : null, i = this.checkIsUniqueColumn(c) ? c[0] : null, s = this.checkIsUniqueColumn(p) ? p[0] : null, f = this.checkIsUniqueColumn(r) ? r[0] : null;
|
|
912
1033
|
Object.assign(o.unifiedLayout, {
|
|
913
|
-
uniqueColClassInSM:
|
|
914
|
-
uniqueColClassInMD:
|
|
915
|
-
uniqueColClassInLG:
|
|
916
|
-
uniqueColClassInEL:
|
|
1034
|
+
uniqueColClassInSM: d,
|
|
1035
|
+
uniqueColClassInMD: i,
|
|
1036
|
+
uniqueColClassInLG: s,
|
|
1037
|
+
uniqueColClassInEL: f
|
|
917
1038
|
});
|
|
918
1039
|
}
|
|
919
1040
|
/**
|
|
920
1041
|
* 校验宽度样式值是否一致
|
|
921
1042
|
*/
|
|
922
|
-
checkIsUniqueColumn(
|
|
923
|
-
const
|
|
924
|
-
return Array.from(
|
|
1043
|
+
checkIsUniqueColumn(n) {
|
|
1044
|
+
const a = new Set(n);
|
|
1045
|
+
return Array.from(a).length === 1;
|
|
925
1046
|
}
|
|
926
1047
|
}
|
|
927
|
-
class
|
|
928
|
-
constructor(t,
|
|
929
|
-
super(t,
|
|
1048
|
+
class Ye extends Je {
|
|
1049
|
+
constructor(t, n) {
|
|
1050
|
+
super(t, n);
|
|
930
1051
|
}
|
|
931
1052
|
getEditorProperties(t) {
|
|
932
|
-
|
|
933
|
-
|
|
1053
|
+
const n = this.getComponentConfig(t, { type: "radio-group" }, {
|
|
1054
|
+
disabled: {
|
|
934
1055
|
visible: !1
|
|
935
1056
|
},
|
|
936
1057
|
placeholder: {
|
|
@@ -942,136 +1063,1368 @@ class Ve extends Ee {
|
|
|
942
1063
|
type: "boolean"
|
|
943
1064
|
},
|
|
944
1065
|
textField: {
|
|
1066
|
+
visible: !1,
|
|
945
1067
|
description: "",
|
|
946
1068
|
title: "显示文本字段",
|
|
947
1069
|
type: "string"
|
|
948
1070
|
},
|
|
949
1071
|
valueField: {
|
|
1072
|
+
visible: !1,
|
|
950
1073
|
description: "",
|
|
951
1074
|
title: "值字段",
|
|
952
1075
|
type: "string"
|
|
953
1076
|
},
|
|
954
|
-
|
|
955
|
-
visible: !1,
|
|
1077
|
+
data: {
|
|
956
1078
|
description: "",
|
|
957
1079
|
title: "数据",
|
|
958
|
-
type: "array"
|
|
1080
|
+
type: "array",
|
|
1081
|
+
editor: {
|
|
1082
|
+
columns: [
|
|
1083
|
+
{ field: t.editor.valueField, title: "值", dataType: "string" },
|
|
1084
|
+
{ field: t.editor.textField, title: "名称", dataType: "string" },
|
|
1085
|
+
{ field: "disabled", title: "禁用", visible: !1, dataType: "boolean", editor: { type: "switch" } }
|
|
1086
|
+
],
|
|
1087
|
+
type: "item-collection-editor",
|
|
1088
|
+
valueField: t.editor.valueField,
|
|
1089
|
+
nameField: t.editor.textField,
|
|
1090
|
+
requiredFields: [t.editor.valueField, t.editor.textField],
|
|
1091
|
+
uniqueFields: [t.editor.valueField, t.editor.textField]
|
|
1092
|
+
},
|
|
1093
|
+
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
1094
|
+
refreshPanelAfterChanged: !0
|
|
959
1095
|
}
|
|
960
1096
|
});
|
|
1097
|
+
return n.setPropertyRelates = function(a) {
|
|
1098
|
+
if (a)
|
|
1099
|
+
switch (a.propertyID) {
|
|
1100
|
+
case "data": {
|
|
1101
|
+
a.propertyValue.parameters && (t.editor.valueField = a.propertyValue.parameters.valueField, t.editor.textField = a.propertyValue.parameters.nameField), t.editor.data = a.propertyValue.value;
|
|
1102
|
+
break;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}, n;
|
|
961
1106
|
}
|
|
962
1107
|
}
|
|
963
|
-
function
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
return !1;
|
|
1108
|
+
function Ze(e, t) {
|
|
1109
|
+
const n = e.schema;
|
|
1110
|
+
function a(o, l) {
|
|
1111
|
+
return new Ye(o, t).getPropertyConfig(n, l);
|
|
968
1112
|
}
|
|
969
|
-
|
|
970
|
-
|
|
1113
|
+
return { getPropsConfig: a };
|
|
1114
|
+
}
|
|
1115
|
+
const et = /* @__PURE__ */ V({
|
|
1116
|
+
name: "FRadioGroupDesign",
|
|
1117
|
+
props: R,
|
|
1118
|
+
emits: ["changeValue", "update:modelValue"],
|
|
1119
|
+
setup(e, t) {
|
|
1120
|
+
const n = w(e.modelValue), {
|
|
1121
|
+
enumData: a,
|
|
1122
|
+
onClickRadio: o,
|
|
1123
|
+
getValue: l,
|
|
1124
|
+
getText: u
|
|
1125
|
+
} = ae(e, t, n), c = I(() => ({
|
|
1126
|
+
"farris-checkradio-hor": e.horizontal
|
|
1127
|
+
})), p = w(), r = N("designer-host-service"), d = N("design-item-context"), i = Ze(d, r), s = Xe(p, d, i);
|
|
1128
|
+
return L(() => {
|
|
1129
|
+
p.value.componentInstance = s;
|
|
1130
|
+
}), t.expose(s.value), () => g("div", {
|
|
1131
|
+
class: ["farris-input-wrap", c.value],
|
|
1132
|
+
ref: p
|
|
1133
|
+
}, [a.value.map((f, m) => {
|
|
1134
|
+
const y = "radio_" + e.name + m;
|
|
1135
|
+
return g("div", {
|
|
1136
|
+
class: "custom-control custom-radio"
|
|
1137
|
+
}, [g("input", {
|
|
1138
|
+
type: "radio",
|
|
1139
|
+
class: "custom-control-input",
|
|
1140
|
+
name: e.name,
|
|
1141
|
+
id: y,
|
|
1142
|
+
value: l(f),
|
|
1143
|
+
checked: l(f) === n.value,
|
|
1144
|
+
disabled: e.disabled,
|
|
1145
|
+
tabindex: e.tabIndex,
|
|
1146
|
+
onClick: (F) => o(f, F)
|
|
1147
|
+
}, null), g("label", {
|
|
1148
|
+
class: "custom-control-label",
|
|
1149
|
+
for: y
|
|
1150
|
+
}, [u(f)])]);
|
|
1151
|
+
})]);
|
|
971
1152
|
}
|
|
972
|
-
|
|
973
|
-
|
|
1153
|
+
}), tt = /* @__PURE__ */ new Map([
|
|
1154
|
+
["appearance", ve]
|
|
1155
|
+
]);
|
|
1156
|
+
function nt(e, t, n) {
|
|
1157
|
+
return t;
|
|
1158
|
+
}
|
|
1159
|
+
const ot = "https://json-schema.org/draft/2020-12/schema", at = "https://farris-design.gitee.io/button-edit.schema.json", it = "button-edit", lt = "A Farris Input Component", rt = "object", st = {
|
|
1160
|
+
id: {
|
|
1161
|
+
description: "The unique identifier for a Input Group",
|
|
1162
|
+
type: "string"
|
|
1163
|
+
},
|
|
1164
|
+
type: {
|
|
1165
|
+
description: "The type string of Input Group component",
|
|
1166
|
+
type: "string",
|
|
1167
|
+
default: "button-edit"
|
|
1168
|
+
},
|
|
1169
|
+
appearance: {
|
|
1170
|
+
description: "",
|
|
1171
|
+
type: "object",
|
|
1172
|
+
properties: {
|
|
1173
|
+
class: {
|
|
1174
|
+
type: "string"
|
|
1175
|
+
},
|
|
1176
|
+
style: {
|
|
1177
|
+
type: "string"
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
default: {}
|
|
1181
|
+
},
|
|
1182
|
+
binding: {
|
|
1183
|
+
description: "",
|
|
1184
|
+
type: "object",
|
|
1185
|
+
default: {}
|
|
1186
|
+
},
|
|
1187
|
+
disable: {
|
|
1188
|
+
type: "string",
|
|
1189
|
+
default: !1
|
|
1190
|
+
},
|
|
1191
|
+
editable: {
|
|
1192
|
+
description: "",
|
|
1193
|
+
type: "boolean",
|
|
1194
|
+
default: !0
|
|
1195
|
+
},
|
|
1196
|
+
enableLinkLabel: {
|
|
1197
|
+
description: "",
|
|
1198
|
+
type: "boolean",
|
|
1199
|
+
default: !1
|
|
1200
|
+
},
|
|
1201
|
+
label: {
|
|
1202
|
+
description: "",
|
|
1203
|
+
type: "string",
|
|
1204
|
+
default: ""
|
|
1205
|
+
},
|
|
1206
|
+
lableWidth: {
|
|
1207
|
+
description: "",
|
|
1208
|
+
type: "number"
|
|
1209
|
+
},
|
|
1210
|
+
placeholder: {
|
|
1211
|
+
description: "",
|
|
1212
|
+
type: "string",
|
|
1213
|
+
default: ""
|
|
1214
|
+
},
|
|
1215
|
+
readonly: {
|
|
1216
|
+
description: "",
|
|
1217
|
+
type: "boolean",
|
|
1218
|
+
default: !1
|
|
1219
|
+
},
|
|
1220
|
+
require: {
|
|
1221
|
+
description: "",
|
|
1222
|
+
type: "boolean",
|
|
1223
|
+
default: !1
|
|
1224
|
+
},
|
|
1225
|
+
tabindex: {
|
|
1226
|
+
description: "",
|
|
1227
|
+
type: "number",
|
|
1228
|
+
default: -1
|
|
1229
|
+
},
|
|
1230
|
+
textAlign: {
|
|
1231
|
+
description: "",
|
|
1232
|
+
type: "string",
|
|
1233
|
+
enum: [
|
|
1234
|
+
"left",
|
|
1235
|
+
"middle",
|
|
1236
|
+
"right"
|
|
1237
|
+
],
|
|
1238
|
+
default: "left"
|
|
1239
|
+
},
|
|
1240
|
+
visible: {
|
|
1241
|
+
description: "",
|
|
1242
|
+
type: "boolean",
|
|
1243
|
+
default: !0
|
|
1244
|
+
},
|
|
1245
|
+
onBlur: {
|
|
1246
|
+
description: "",
|
|
1247
|
+
type: "string",
|
|
1248
|
+
default: ""
|
|
1249
|
+
},
|
|
1250
|
+
onClickLinkLabel: {
|
|
1251
|
+
description: "",
|
|
1252
|
+
type: "sting",
|
|
1253
|
+
default: ""
|
|
1254
|
+
},
|
|
1255
|
+
autoComplete: {
|
|
1256
|
+
description: "",
|
|
1257
|
+
type: "boolean",
|
|
1258
|
+
default: !1
|
|
1259
|
+
},
|
|
1260
|
+
buttonContent: {
|
|
1261
|
+
description: "",
|
|
1262
|
+
type: "string",
|
|
1263
|
+
default: ""
|
|
1264
|
+
},
|
|
1265
|
+
enableClear: {
|
|
1266
|
+
description: "",
|
|
1267
|
+
type: "boolean",
|
|
1268
|
+
default: !0
|
|
1269
|
+
},
|
|
1270
|
+
inputType: {
|
|
1271
|
+
description: "",
|
|
1272
|
+
type: "string",
|
|
1273
|
+
enum: [
|
|
1274
|
+
"text",
|
|
1275
|
+
"tag"
|
|
1276
|
+
],
|
|
1277
|
+
default: "text"
|
|
1278
|
+
},
|
|
1279
|
+
multiSelect: {
|
|
1280
|
+
description: "",
|
|
1281
|
+
type: "boolean",
|
|
1282
|
+
default: !1
|
|
1283
|
+
},
|
|
1284
|
+
popup: {
|
|
1285
|
+
description: "",
|
|
1286
|
+
type: "object",
|
|
1287
|
+
properties: {
|
|
1288
|
+
footerButtons: {
|
|
1289
|
+
type: "array",
|
|
1290
|
+
default: []
|
|
1291
|
+
},
|
|
1292
|
+
height: {
|
|
1293
|
+
type: "number",
|
|
1294
|
+
default: 600
|
|
1295
|
+
},
|
|
1296
|
+
dataMapping: {
|
|
1297
|
+
type: "object"
|
|
1298
|
+
},
|
|
1299
|
+
contents: {
|
|
1300
|
+
type: "array",
|
|
1301
|
+
default: []
|
|
1302
|
+
},
|
|
1303
|
+
showMaxButton: {
|
|
1304
|
+
type: "boolean",
|
|
1305
|
+
default: !0
|
|
1306
|
+
},
|
|
1307
|
+
showCloseButton: {
|
|
1308
|
+
type: "boolean",
|
|
1309
|
+
default: !0
|
|
1310
|
+
},
|
|
1311
|
+
showFooter: {
|
|
1312
|
+
type: "boolean",
|
|
1313
|
+
default: !0
|
|
1314
|
+
},
|
|
1315
|
+
title: {
|
|
1316
|
+
type: "string",
|
|
1317
|
+
default: ""
|
|
1318
|
+
},
|
|
1319
|
+
width: {
|
|
1320
|
+
type: "number",
|
|
1321
|
+
default: 800
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
separator: {
|
|
1326
|
+
type: "string",
|
|
1327
|
+
default: ","
|
|
1328
|
+
},
|
|
1329
|
+
showButtonWhenDisabled: {
|
|
1330
|
+
description: "",
|
|
1331
|
+
type: "boolean",
|
|
1332
|
+
default: !1
|
|
1333
|
+
},
|
|
1334
|
+
wrapText: {
|
|
1335
|
+
type: "boolean",
|
|
1336
|
+
default: !1
|
|
1337
|
+
},
|
|
1338
|
+
onClear: {
|
|
1339
|
+
description: "",
|
|
1340
|
+
type: "string",
|
|
1341
|
+
default: ""
|
|
974
1342
|
}
|
|
975
|
-
|
|
976
|
-
|
|
1343
|
+
}, ut = [
|
|
1344
|
+
"id",
|
|
1345
|
+
"type"
|
|
1346
|
+
], ct = {
|
|
1347
|
+
$schema: ot,
|
|
1348
|
+
$id: at,
|
|
1349
|
+
title: it,
|
|
1350
|
+
description: lt,
|
|
1351
|
+
type: rt,
|
|
1352
|
+
properties: st,
|
|
1353
|
+
required: ut
|
|
1354
|
+
}, dt = "buttonEdit", pt = "A Farris Component", ft = "object", mt = {
|
|
1355
|
+
basic: {
|
|
1356
|
+
description: "Basic Infomation",
|
|
1357
|
+
title: "基本信息",
|
|
1358
|
+
properties: {
|
|
1359
|
+
id: {
|
|
1360
|
+
description: "组件标识",
|
|
1361
|
+
title: "标识",
|
|
1362
|
+
type: "string",
|
|
1363
|
+
readonly: !0
|
|
1364
|
+
},
|
|
1365
|
+
type: {
|
|
1366
|
+
description: "组件类型",
|
|
1367
|
+
title: "控件类型",
|
|
1368
|
+
type: "select",
|
|
1369
|
+
editor: {
|
|
1370
|
+
type: "waiting for modification",
|
|
1371
|
+
enum: []
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
behavior: {
|
|
1377
|
+
description: "Basic Infomation",
|
|
1378
|
+
title: "行为",
|
|
1379
|
+
properties: {
|
|
1380
|
+
editable: {
|
|
1381
|
+
description: "",
|
|
1382
|
+
title: "允许编辑",
|
|
1383
|
+
type: "boolean"
|
|
1384
|
+
},
|
|
1385
|
+
readonly: {
|
|
1386
|
+
description: "",
|
|
1387
|
+
title: "只读",
|
|
1388
|
+
type: "string"
|
|
1389
|
+
},
|
|
1390
|
+
required: {
|
|
1391
|
+
description: "",
|
|
1392
|
+
title: "必填",
|
|
1393
|
+
type: "boolean"
|
|
1394
|
+
},
|
|
1395
|
+
visible: {
|
|
1396
|
+
description: "",
|
|
1397
|
+
title: "可见",
|
|
1398
|
+
type: "boolean"
|
|
1399
|
+
},
|
|
1400
|
+
placeholder: {
|
|
1401
|
+
description: "",
|
|
1402
|
+
title: "提示文本",
|
|
1403
|
+
type: "string"
|
|
1404
|
+
},
|
|
1405
|
+
tabindex: {
|
|
1406
|
+
description: "",
|
|
1407
|
+
title: "tab索引",
|
|
1408
|
+
type: "number"
|
|
1409
|
+
},
|
|
1410
|
+
textAlign: {
|
|
1411
|
+
description: "",
|
|
1412
|
+
title: "对齐方式",
|
|
1413
|
+
type: "enum",
|
|
1414
|
+
editor: {
|
|
1415
|
+
type: "combo-list",
|
|
1416
|
+
textField: "name",
|
|
1417
|
+
valueField: "value",
|
|
1418
|
+
data: [
|
|
1419
|
+
{
|
|
1420
|
+
value: "left",
|
|
1421
|
+
name: "左对齐"
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
value: "center",
|
|
1425
|
+
name: "居中"
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
value: "right",
|
|
1429
|
+
name: "右对齐"
|
|
1430
|
+
}
|
|
1431
|
+
]
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
977
1435
|
}
|
|
978
|
-
|
|
1436
|
+
}, yt = {
|
|
1437
|
+
title: dt,
|
|
1438
|
+
description: pt,
|
|
1439
|
+
type: ft,
|
|
1440
|
+
categories: mt
|
|
1441
|
+
}, ie = {
|
|
1442
|
+
/**
|
|
1443
|
+
* 组件标识
|
|
1444
|
+
*/
|
|
1445
|
+
id: String,
|
|
1446
|
+
/**
|
|
1447
|
+
* 扩展按钮显示内容,这是一段现在扩展按钮中的html标签
|
|
1448
|
+
*/
|
|
1449
|
+
buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
|
|
1450
|
+
buttonBehavior: { type: String, default: "Popup" },
|
|
1451
|
+
/**
|
|
1452
|
+
* 启用输入框自动完成功能
|
|
1453
|
+
*/
|
|
1454
|
+
autoComplete: { type: Boolean, default: !1 },
|
|
1455
|
+
/**
|
|
1456
|
+
* 组件自定义样式
|
|
1457
|
+
*/
|
|
1458
|
+
customClass: { type: String, default: "" },
|
|
1459
|
+
/**
|
|
1460
|
+
* 禁用组件,既不允许在输入框中录入,也不允许点击扩展按钮。
|
|
1461
|
+
*/
|
|
1462
|
+
disable: { type: Boolean, default: !1 },
|
|
1463
|
+
/**
|
|
1464
|
+
* 允许在输入框中录入文本。
|
|
1465
|
+
*/
|
|
1466
|
+
editable: { type: Boolean, default: !0 },
|
|
1467
|
+
/**
|
|
1468
|
+
* 显示清空文本按钮
|
|
1469
|
+
*/
|
|
1470
|
+
enableClear: { type: Boolean, default: !1 },
|
|
1471
|
+
/**
|
|
1472
|
+
* 组件值
|
|
1473
|
+
*/
|
|
1474
|
+
modelValue: { type: String, default: "" },
|
|
1475
|
+
/**
|
|
1476
|
+
* 将组件设置为只读,既不允许在输入框中录入,也不允许点击扩展按钮,但是允许复制输入框中的内容。
|
|
1477
|
+
*/
|
|
1478
|
+
readonly: { type: Boolean, default: !1 },
|
|
1479
|
+
/**
|
|
1480
|
+
* 禁用组件时,是否显示扩展按钮
|
|
1481
|
+
*/
|
|
1482
|
+
showButtonWhenDisabled: { type: Boolean, default: !1 },
|
|
1483
|
+
/**
|
|
1484
|
+
* 显示输入框的标签
|
|
1485
|
+
*/
|
|
1486
|
+
enableTitle: { type: Boolean, default: !1 },
|
|
1487
|
+
/**
|
|
1488
|
+
* 输入框类型
|
|
1489
|
+
*/
|
|
1490
|
+
inputType: { type: String, default: "text" },
|
|
1491
|
+
/**
|
|
1492
|
+
* 显示输入框提示信息
|
|
1493
|
+
*/
|
|
1494
|
+
forcePlaceholder: { type: Boolean, default: !1 },
|
|
1495
|
+
/**
|
|
1496
|
+
* 输入框提示文本
|
|
1497
|
+
*/
|
|
1498
|
+
placeholder: { type: String, default: "" },
|
|
1499
|
+
/**
|
|
1500
|
+
* 输入框最小长度
|
|
1501
|
+
*/
|
|
1502
|
+
minLength: Number,
|
|
1503
|
+
/**
|
|
1504
|
+
* 输入框最大长度
|
|
1505
|
+
*/
|
|
1506
|
+
maxLength: Number,
|
|
1507
|
+
/**
|
|
1508
|
+
* 输入框Tab键索引
|
|
1509
|
+
*/
|
|
1510
|
+
tabIndex: Number,
|
|
1511
|
+
popupHost: { type: Object },
|
|
1512
|
+
popupRightBoundary: { type: Object },
|
|
1513
|
+
popupOffsetX: { type: Object },
|
|
1514
|
+
popupOnInput: { type: Boolean, default: !1 },
|
|
1515
|
+
popupOnFocus: { type: Boolean, default: !1 },
|
|
1516
|
+
popupMinWidth: { type: Number, default: 160 },
|
|
1517
|
+
modalOptions: { type: Object, default: {} },
|
|
1518
|
+
wrapText: { type: Boolean, default: !1 },
|
|
1519
|
+
/**
|
|
1520
|
+
* 可选,是否支持多选
|
|
1521
|
+
* 默认`false`
|
|
1522
|
+
*/
|
|
1523
|
+
multiSelect: { type: Boolean, default: !1 },
|
|
1524
|
+
/**
|
|
1525
|
+
* 可选,分隔符
|
|
1526
|
+
* 默认`,`
|
|
1527
|
+
*/
|
|
1528
|
+
separator: { type: String, default: "," },
|
|
1529
|
+
/** 对齐方式 */
|
|
1530
|
+
textAlign: { type: String, default: "left" },
|
|
1531
|
+
/**
|
|
1532
|
+
* 废弃
|
|
1533
|
+
*/
|
|
1534
|
+
beforeClickButton: { type: Function, default: null },
|
|
1535
|
+
/**
|
|
1536
|
+
* 作为内嵌编辑器被创建后默认获得焦点
|
|
1537
|
+
*/
|
|
1538
|
+
focusOnCreated: { type: Boolean, default: !1 },
|
|
1539
|
+
/**
|
|
1540
|
+
* 作为内嵌编辑器被创建后默认选中文本
|
|
1541
|
+
*/
|
|
1542
|
+
selectOnCreated: { type: Boolean, default: !1 },
|
|
1543
|
+
/**
|
|
1544
|
+
* 打开前
|
|
1545
|
+
*/
|
|
1546
|
+
beforeOpen: { type: Function, default: null },
|
|
1547
|
+
/** 更新方式 blur | change */
|
|
1548
|
+
updateOn: { type: String, default: "change" }
|
|
1549
|
+
};
|
|
1550
|
+
ne(ie, ct, tt, nt, yt);
|
|
1551
|
+
const gt = {
|
|
1552
|
+
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
|
|
1553
|
+
host: { type: Object },
|
|
1554
|
+
backgroundColor: { type: String, default: "" }
|
|
1555
|
+
}, ht = /* @__PURE__ */ V({
|
|
1556
|
+
name: "FOverlay",
|
|
1557
|
+
props: gt,
|
|
1558
|
+
emits: ["click"],
|
|
1559
|
+
setup(e, t) {
|
|
1560
|
+
const n = w(e.popupContentPosition), a = w(e.host), o = I(() => ({
|
|
1561
|
+
backgroundColor: e.backgroundColor || "",
|
|
1562
|
+
pointerEvents: "auto"
|
|
1563
|
+
}));
|
|
1564
|
+
function l(c) {
|
|
1565
|
+
t.emit("click"), c.preventDefault(), c.stopPropagation();
|
|
1566
|
+
}
|
|
1567
|
+
I(() => {
|
|
1568
|
+
const c = a.value;
|
|
1569
|
+
if (c) {
|
|
1570
|
+
const p = c.getBoundingClientRect(), {
|
|
1571
|
+
left: r,
|
|
1572
|
+
top: d,
|
|
1573
|
+
height: i
|
|
1574
|
+
} = p;
|
|
1575
|
+
return {
|
|
1576
|
+
left: r,
|
|
1577
|
+
top: d + i
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
return n.value;
|
|
1581
|
+
});
|
|
1582
|
+
const u = I(() => ({
|
|
1583
|
+
// position: 'relative',
|
|
1584
|
+
// left: `${position.value.left}px`,
|
|
1585
|
+
// top: `${position.value.top}px`
|
|
1586
|
+
}));
|
|
1587
|
+
return () => g(pe, {
|
|
1588
|
+
to: "body"
|
|
1589
|
+
}, {
|
|
1590
|
+
default: () => {
|
|
1591
|
+
var c, p;
|
|
1592
|
+
return [g("div", {
|
|
1593
|
+
class: "overlay-container",
|
|
1594
|
+
onClick: (r) => l(r),
|
|
1595
|
+
style: o.value
|
|
1596
|
+
}, [g("div", {
|
|
1597
|
+
style: u.value
|
|
1598
|
+
}, [(p = (c = t.slots).default) == null ? void 0 : p.call(c)])])];
|
|
1599
|
+
}
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
});
|
|
1603
|
+
function vt(e) {
|
|
1604
|
+
if (e.content && e.content.render)
|
|
1605
|
+
return e.content.render;
|
|
1606
|
+
if (e.render && typeof e.render == "function")
|
|
1607
|
+
return e.render;
|
|
1608
|
+
}
|
|
1609
|
+
function bt(e) {
|
|
1610
|
+
const t = document.createElement("div");
|
|
1611
|
+
t.style.display = "contents";
|
|
1612
|
+
let n;
|
|
1613
|
+
const a = e.onClickCallback || (() => {
|
|
1614
|
+
}), o = () => {
|
|
1615
|
+
a(), n && n.unmount();
|
|
1616
|
+
};
|
|
1617
|
+
return n = fe({
|
|
1618
|
+
setup() {
|
|
1619
|
+
me(() => {
|
|
1620
|
+
document.body.removeChild(t);
|
|
1621
|
+
});
|
|
1622
|
+
const l = vt(e);
|
|
1623
|
+
return () => g(ht, {
|
|
1624
|
+
"popup-content-position": e.popupPosition,
|
|
1625
|
+
host: e.host,
|
|
1626
|
+
onClick: o,
|
|
1627
|
+
backgroundColor: e.backgroundColor
|
|
1628
|
+
}, {
|
|
1629
|
+
default: () => [l && l()]
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
}), document.body.appendChild(t), n.mount(t), n;
|
|
1633
|
+
}
|
|
1634
|
+
class Ct {
|
|
1635
|
+
static show(t) {
|
|
1636
|
+
return bt(t);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
const kt = Symbol("FModalService");
|
|
1640
|
+
function le(e, t) {
|
|
1641
|
+
function n() {
|
|
1642
|
+
const a = e.beforeOpen || e.beforeClickButton || null;
|
|
1643
|
+
let o = Promise.resolve(!0);
|
|
1644
|
+
if (a) {
|
|
1645
|
+
const l = a(t.value);
|
|
1646
|
+
if (typeof l > "u")
|
|
1647
|
+
return o;
|
|
1648
|
+
typeof l == "boolean" ? o = Promise.resolve(l) : o = l;
|
|
1649
|
+
}
|
|
1650
|
+
return o;
|
|
1651
|
+
}
|
|
1652
|
+
return { judgeCanOpen: n };
|
|
1653
|
+
}
|
|
1654
|
+
function Ft(e, t, n, a, o) {
|
|
1655
|
+
const l = w(e.buttonBehavior), u = w(e.popupOnInput), c = I(() => ({
|
|
1656
|
+
"input-group-append": !0,
|
|
1657
|
+
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
1658
|
+
})), { judgeCanOpen: p } = le(e, o), r = I(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable), d = N(kt, null), i = w();
|
|
1659
|
+
async function s(y) {
|
|
1660
|
+
if (await p() && r.value) {
|
|
1661
|
+
const F = !!t.slots.default;
|
|
1662
|
+
if (l.value === "Modal") {
|
|
1663
|
+
const k = e.modalOptions, h = d == null ? void 0 : d.open({
|
|
1664
|
+
...k,
|
|
1665
|
+
render: () => t.slots.default && t.slots.default()
|
|
1666
|
+
});
|
|
1667
|
+
i.value = h == null ? void 0 : h.modalRef;
|
|
1668
|
+
}
|
|
1669
|
+
l.value === "Overlay" && Ct.show({
|
|
1670
|
+
// host: buttonEditRef.value,
|
|
1671
|
+
host: document.body,
|
|
1672
|
+
backgroundColor: "rgba(0,0,0,.15)",
|
|
1673
|
+
render: () => t.slots.default && t.slots.default()
|
|
1674
|
+
}), F && l.value === "Popup" && a.togglePopup(!0), F && u.value && a.hidePopup(), t.emit("clickButton", { origin: y, value: e.modelValue });
|
|
1675
|
+
}
|
|
979
1676
|
}
|
|
980
|
-
function
|
|
1677
|
+
function f(y) {
|
|
1678
|
+
t.emit("mouseEnterIcon", y);
|
|
981
1679
|
}
|
|
982
|
-
function
|
|
983
|
-
|
|
1680
|
+
function m(y) {
|
|
1681
|
+
t.emit("mouseLeaveIcon", y);
|
|
984
1682
|
}
|
|
985
1683
|
return {
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
resolveComponentContext: i,
|
|
992
|
-
triggerBelongedComponentToMoveWhenMoved: e,
|
|
993
|
-
triggerBelongedComponentToDeleteWhenDeleted: n,
|
|
994
|
-
getPropsConfig: p
|
|
1684
|
+
buttonGroupClass: c,
|
|
1685
|
+
onClickButton: s,
|
|
1686
|
+
onMouseEnterButton: f,
|
|
1687
|
+
onMouseLeaveButton: m,
|
|
1688
|
+
modalRef: i
|
|
995
1689
|
};
|
|
996
1690
|
}
|
|
997
|
-
function
|
|
998
|
-
const {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1691
|
+
function Bt(e, t, n, a, o, l) {
|
|
1692
|
+
const u = w(!1), c = I(() => e.enableClear && !e.readonly && !e.disable), { changeTextBoxValue: p } = l;
|
|
1693
|
+
function r(f) {
|
|
1694
|
+
u.value = f;
|
|
1695
|
+
}
|
|
1696
|
+
j(o, () => {
|
|
1697
|
+
r(!!o.value);
|
|
1698
|
+
});
|
|
1699
|
+
function d(f) {
|
|
1700
|
+
const m = !e.readonly && !e.disable && e.editable, y = !e.editable;
|
|
1701
|
+
f.stopPropagation(), (m || y) && (p("", !1), r(!u.value), t.emit("clear"));
|
|
1702
|
+
}
|
|
1703
|
+
function i(f) {
|
|
1704
|
+
if (c.value) {
|
|
1705
|
+
if (!n.value) {
|
|
1706
|
+
r(!1);
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
!e.disable && !e.readonly && r(!0);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
function s(f) {
|
|
1713
|
+
c.value && r(!1);
|
|
1010
1714
|
}
|
|
1011
1715
|
return {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
resolveComponentContext: d,
|
|
1018
|
-
triggerBelongedComponentToMoveWhenMoved: l,
|
|
1019
|
-
triggerBelongedComponentToDeleteWhenDeleted: i,
|
|
1020
|
-
getPropsConfig: s
|
|
1716
|
+
enableClearButton: c,
|
|
1717
|
+
showClearButton: u,
|
|
1718
|
+
onClearValue: d,
|
|
1719
|
+
onMouseEnterTextBox: i,
|
|
1720
|
+
onMouseLeaveTextBox: s
|
|
1021
1721
|
};
|
|
1022
1722
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1723
|
+
function Mt(e, t, n, a, o) {
|
|
1724
|
+
const l = I(() => e.popupOnInput), u = I(() => e.popupOnFocus), { shouldPopupContent: c } = o, p = I(() => e.enableTitle ? n.value : ""), r = I(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), d = I(() => e.readonly || !e.editable), i = w(!1), s = I(() => !e.disable && i.value), f = I(() => ({
|
|
1725
|
+
"text-left": e.textAlign === "left",
|
|
1726
|
+
"text-center": e.textAlign === "center",
|
|
1727
|
+
"text-right": e.textAlign === "right",
|
|
1728
|
+
"form-control": !0,
|
|
1729
|
+
"f-utils-fill": !0
|
|
1730
|
+
})), m = I(() => ({
|
|
1731
|
+
"input-group": !0,
|
|
1732
|
+
"f-state-disable": e.disable,
|
|
1733
|
+
"f-state-editable": e.editable && !e.disable && !e.readonly,
|
|
1734
|
+
"f-state-readonly": e.readonly && !e.disable,
|
|
1735
|
+
"f-state-focus": s.value
|
|
1736
|
+
}));
|
|
1737
|
+
function y(v, x = !0) {
|
|
1738
|
+
n.value !== v && (n.value = v, x && (t.emit("change", v), t.emit("update:modelValue", v)));
|
|
1739
|
+
}
|
|
1740
|
+
function F(v) {
|
|
1741
|
+
c.value = !1, y(v, !0);
|
|
1742
|
+
}
|
|
1743
|
+
j(
|
|
1744
|
+
() => e.modelValue,
|
|
1745
|
+
(v) => {
|
|
1746
|
+
n.value = v;
|
|
1747
|
+
}
|
|
1748
|
+
);
|
|
1749
|
+
function k(v) {
|
|
1750
|
+
i.value = !1, t.emit("blur", v), v.stopPropagation();
|
|
1751
|
+
}
|
|
1752
|
+
function h(v) {
|
|
1753
|
+
t.emit("click", v);
|
|
1754
|
+
}
|
|
1755
|
+
function B(v) {
|
|
1756
|
+
e.disable || (i.value = !0, d.value || (t.emit("focus", v), u.value && !c.value && o.popup()));
|
|
1757
|
+
}
|
|
1758
|
+
function P(v) {
|
|
1759
|
+
t.emit("input", v.target.value);
|
|
1760
|
+
const x = v.target.value;
|
|
1761
|
+
a.value = x, n.value !== x && y(x, e.updateOn === "change"), l.value && !c.value && o.popup();
|
|
1762
|
+
}
|
|
1763
|
+
function C(v) {
|
|
1764
|
+
v.target.tagName !== "INPUT" && v.preventDefault(), v.stopPropagation();
|
|
1765
|
+
}
|
|
1766
|
+
function E(v) {
|
|
1767
|
+
t.emit("keydown", v);
|
|
1768
|
+
}
|
|
1769
|
+
function S(v) {
|
|
1770
|
+
v.key === "Enter" && (l.value || u.value) && o.hidePopup(), t.emit("keyup", v);
|
|
1771
|
+
}
|
|
1772
|
+
function M(v) {
|
|
1773
|
+
const x = v.target.value;
|
|
1774
|
+
v.stopPropagation(), y(x);
|
|
1775
|
+
}
|
|
1776
|
+
return {
|
|
1777
|
+
hasFocusedTextBox: s,
|
|
1778
|
+
isTextBoxReadonly: d,
|
|
1779
|
+
textBoxClass: f,
|
|
1780
|
+
textBoxPlaceholder: r,
|
|
1781
|
+
textBoxTitle: p,
|
|
1782
|
+
inputGroupClass: m,
|
|
1783
|
+
changeTextBoxValue: y,
|
|
1784
|
+
commitValue: F,
|
|
1785
|
+
onBlurTextBox: k,
|
|
1786
|
+
onClickTextBox: h,
|
|
1787
|
+
onFocusTextBox: B,
|
|
1788
|
+
onInput: P,
|
|
1789
|
+
onKeyDownTextBox: E,
|
|
1790
|
+
onKeyUpTextBox: S,
|
|
1791
|
+
onMouseDownTextBox: C,
|
|
1792
|
+
onTextBoxValueChange: M
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
function wt(e, t, n, a) {
|
|
1796
|
+
const o = w(), l = w(!1), { judgeCanOpen: u } = le(e, a);
|
|
1797
|
+
function c() {
|
|
1798
|
+
const i = o.value;
|
|
1799
|
+
i && i.show(n.value);
|
|
1800
|
+
}
|
|
1801
|
+
async function p(i = !1) {
|
|
1802
|
+
if (!!t.slots.default) {
|
|
1803
|
+
if (!i && !l.value && !await u())
|
|
1804
|
+
return;
|
|
1805
|
+
l.value = !l.value, await z(), c();
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
async function r(i = !1) {
|
|
1809
|
+
if (!!t.slots.default) {
|
|
1810
|
+
if (!i && !await u())
|
|
1811
|
+
return;
|
|
1812
|
+
l.value = !0, await z(), c();
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
function d() {
|
|
1816
|
+
l.value = !1;
|
|
1817
|
+
}
|
|
1818
|
+
return { hidePopup: d, popup: r, shouldPopupContent: l, togglePopup: p, popoverRef: o };
|
|
1819
|
+
}
|
|
1820
|
+
function St(e, t, n) {
|
|
1821
|
+
const a = w(), {
|
|
1822
|
+
isTextBoxReadonly: o,
|
|
1823
|
+
textBoxClass: l,
|
|
1824
|
+
textBoxPlaceholder: u,
|
|
1825
|
+
textBoxTitle: c,
|
|
1826
|
+
onBlurTextBox: p,
|
|
1827
|
+
onClickTextBox: r,
|
|
1828
|
+
onFocusTextBox: d,
|
|
1829
|
+
onInput: i,
|
|
1830
|
+
onKeyDownTextBox: s,
|
|
1831
|
+
onKeyUpTextBox: f,
|
|
1832
|
+
onMouseDownTextBox: m,
|
|
1833
|
+
onTextBoxValueChange: y
|
|
1834
|
+
} = n;
|
|
1835
|
+
return L(() => {
|
|
1836
|
+
var F, k;
|
|
1837
|
+
e.selectOnCreated && ((F = a.value) == null || F.select()), e.focusOnCreated && ((k = a.value) == null || k.focus());
|
|
1838
|
+
}), () => g("input", {
|
|
1839
|
+
ref: a,
|
|
1840
|
+
name: "input-group-value",
|
|
1841
|
+
autocomplete: e.autoComplete ? "on" : "off",
|
|
1842
|
+
class: l.value,
|
|
1843
|
+
disabled: e.disable,
|
|
1844
|
+
maxlength: e.maxLength,
|
|
1845
|
+
minlength: e.minLength,
|
|
1846
|
+
placeholder: u.value,
|
|
1847
|
+
readonly: o.value,
|
|
1848
|
+
tabindex: e.tabIndex,
|
|
1849
|
+
title: c.value,
|
|
1850
|
+
type: e.inputType,
|
|
1851
|
+
value: t.value,
|
|
1852
|
+
onBlur: p,
|
|
1853
|
+
onChange: y,
|
|
1854
|
+
onClick: r,
|
|
1855
|
+
onFocus: d,
|
|
1856
|
+
onInput: i,
|
|
1857
|
+
onKeydown: s,
|
|
1858
|
+
onKeyup: f,
|
|
1859
|
+
onMousedown: m
|
|
1860
|
+
}, null);
|
|
1861
|
+
}
|
|
1862
|
+
function Tt(e, t, n) {
|
|
1863
|
+
const a = w(e.separator), {
|
|
1864
|
+
changeTextBoxValue: o
|
|
1865
|
+
} = n, l = I(() => t.value ? t.value.split(a.value).map((c) => ({
|
|
1866
|
+
name: c,
|
|
1867
|
+
selectable: !0
|
|
1868
|
+
})) : []);
|
|
1869
|
+
function u(c) {
|
|
1870
|
+
o(c.map((p) => p.name).join(a.value), !0);
|
|
1871
|
+
}
|
|
1872
|
+
return () => g(Ce, {
|
|
1873
|
+
id: `${e.id}-tag-editor`,
|
|
1874
|
+
class: "form-control",
|
|
1875
|
+
data: l.value,
|
|
1876
|
+
showClose: !0,
|
|
1877
|
+
showInput: !0,
|
|
1878
|
+
onChange: u
|
|
1879
|
+
}, null);
|
|
1880
|
+
}
|
|
1881
|
+
function Et(e, t, n, a) {
|
|
1882
|
+
const {
|
|
1883
|
+
buttonGroupClass: o,
|
|
1884
|
+
onClickButton: l,
|
|
1885
|
+
onMouseEnterButton: u,
|
|
1886
|
+
onMouseLeaveButton: c
|
|
1887
|
+
} = n, {
|
|
1888
|
+
enableClearButton: p,
|
|
1889
|
+
showClearButton: r,
|
|
1890
|
+
onClearValue: d
|
|
1891
|
+
} = a, i = w();
|
|
1892
|
+
return {
|
|
1893
|
+
renderButtonGroup: () => g("div", {
|
|
1894
|
+
id: `${e.id}-button-group`,
|
|
1895
|
+
class: o.value
|
|
1896
|
+
}, [p.value && G(g("span", {
|
|
1897
|
+
class: "input-group-text input-group-clear",
|
|
1898
|
+
onClick: d
|
|
1899
|
+
}, [g("i", {
|
|
1900
|
+
class: "f-icon modal_close"
|
|
1901
|
+
}, null)]), [[ye, r.value]]), t.slots.buttonContent ? g("span", {
|
|
1902
|
+
class: "input-group-text input-group-append-button",
|
|
1903
|
+
onClick: l,
|
|
1904
|
+
onMouseenter: u,
|
|
1905
|
+
onMouseleave: c
|
|
1906
|
+
}, [t.slots.buttonContent()]) : e.buttonContent ? g("span", {
|
|
1907
|
+
class: "input-group-text input-group-append-button",
|
|
1908
|
+
innerHTML: e.buttonContent,
|
|
1909
|
+
ref: i,
|
|
1910
|
+
onClick: l,
|
|
1911
|
+
onMouseenter: u,
|
|
1912
|
+
onMouseleave: c
|
|
1913
|
+
}, null) : null]),
|
|
1914
|
+
buttonHandleElement: i
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
function It(e, t, n) {
|
|
1918
|
+
const a = w(e.popupMinWidth), {
|
|
1919
|
+
hidePopup: o,
|
|
1920
|
+
popoverRef: l
|
|
1921
|
+
} = n;
|
|
1922
|
+
return () => g(ke, {
|
|
1923
|
+
id: `${e.id}-popover`,
|
|
1924
|
+
ref: l,
|
|
1925
|
+
visible: !0,
|
|
1926
|
+
placement: "bottom-left",
|
|
1927
|
+
host: e.popupHost,
|
|
1928
|
+
"keep-width-with-reference": !0,
|
|
1929
|
+
fitContent: !0,
|
|
1930
|
+
"right-boundary": e.popupRightBoundary,
|
|
1931
|
+
minWidth: a.value,
|
|
1932
|
+
offsetX: e.popupOffsetX,
|
|
1933
|
+
onHidden: o
|
|
1934
|
+
}, {
|
|
1935
|
+
default: () => {
|
|
1936
|
+
var u, c;
|
|
1937
|
+
return [(c = (u = t.slots).default) == null ? void 0 : c.call(u)];
|
|
1938
|
+
}
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
const Pt = /* @__PURE__ */ V({
|
|
1942
|
+
name: "FButtonEdit",
|
|
1943
|
+
props: ie,
|
|
1944
|
+
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
|
|
1945
|
+
setup(e, t) {
|
|
1946
|
+
const n = w(), a = w(e.customClass), o = w(e.modelValue), l = wt(e, t, n, o), {
|
|
1947
|
+
shouldPopupContent: u,
|
|
1948
|
+
hidePopup: c,
|
|
1949
|
+
togglePopup: p
|
|
1950
|
+
} = l, r = Ft(e, t, n, l, o), d = w(""), i = Mt(e, t, o, d, l), {
|
|
1951
|
+
hasFocusedTextBox: s,
|
|
1952
|
+
commitValue: f,
|
|
1953
|
+
inputGroupClass: m
|
|
1954
|
+
} = i, y = Bt(e, t, o, s, d, i), {
|
|
1955
|
+
onMouseEnterTextBox: F,
|
|
1956
|
+
onMouseLeaveTextBox: k
|
|
1957
|
+
} = y, h = I(() => {
|
|
1958
|
+
const v = {
|
|
1959
|
+
"f-button-edit": !0,
|
|
1960
|
+
"f-cmp-inputgroup": !0,
|
|
1961
|
+
"f-button-edit-nowrap": !e.wrapText
|
|
1962
|
+
};
|
|
1963
|
+
return a.value && a.value.split(" ").reduce((x, $) => (x[$] = !0, x), v), v;
|
|
1964
|
+
});
|
|
1965
|
+
function B() {
|
|
1966
|
+
return e.multiSelect && e.inputType === "tag" ? Tt(e, o, i) : St(e, o, i);
|
|
1967
|
+
}
|
|
1968
|
+
let P = B();
|
|
1969
|
+
j([() => e.multiSelect, () => e.inputType], () => {
|
|
1970
|
+
P = B();
|
|
1971
|
+
});
|
|
1972
|
+
const {
|
|
1973
|
+
renderButtonGroup: C,
|
|
1974
|
+
buttonHandleElement: E
|
|
1975
|
+
} = Et(e, t, r, y), S = It(e, t, l), M = {
|
|
1976
|
+
commitValue: f,
|
|
1977
|
+
elementRef: n,
|
|
1978
|
+
hidePopup: c,
|
|
1979
|
+
shouldPopupContent: u,
|
|
1980
|
+
togglePopup: p,
|
|
1981
|
+
openDialog: () => {
|
|
1982
|
+
E.value && e.buttonBehavior === "Modal" && E.value.click();
|
|
1983
|
+
},
|
|
1984
|
+
getModal: () => {
|
|
1985
|
+
var v;
|
|
1986
|
+
return e.buttonBehavior === "Modal" ? (v = r.modalRef.value) == null ? void 0 : v.value : null;
|
|
1987
|
+
}
|
|
1988
|
+
};
|
|
1989
|
+
return L(() => {
|
|
1990
|
+
n.value.componentInstance = M, window.onresize = () => {
|
|
1991
|
+
document.body.click();
|
|
1992
|
+
};
|
|
1993
|
+
}), t.expose(M), () => g(Q, null, [g("div", ge(t.attrs, {
|
|
1994
|
+
ref: n,
|
|
1995
|
+
class: h.value,
|
|
1996
|
+
id: e.id
|
|
1997
|
+
}), [g("div", {
|
|
1998
|
+
id: `${e.id}-input-group`,
|
|
1999
|
+
class: m.value,
|
|
2000
|
+
onMouseenter: F,
|
|
2001
|
+
onMouseleave: k
|
|
2002
|
+
}, [P(), C()])]), u.value && S()]);
|
|
2003
|
+
}
|
|
2004
|
+
}), xt = "https://json-schema.org/draft/2020-12/schema", Vt = "https://farris-design.gitee.io/radio-group.schema.json", At = "item-collection-editor", Ot = "A Farris Input Component", Dt = "object", Lt = {
|
|
2005
|
+
id: {
|
|
2006
|
+
description: "The unique identifier for a item-collection-editor",
|
|
2007
|
+
type: "string"
|
|
2008
|
+
},
|
|
2009
|
+
type: {
|
|
2010
|
+
description: "The type string of item-collection-editor component",
|
|
2011
|
+
type: "string",
|
|
2012
|
+
default: "item-collection-editor"
|
|
2013
|
+
},
|
|
2014
|
+
requiredFields: {
|
|
2015
|
+
description: "",
|
|
2016
|
+
type: "array",
|
|
2017
|
+
default: []
|
|
2018
|
+
},
|
|
2019
|
+
uniqueFields: {
|
|
2020
|
+
description: "",
|
|
2021
|
+
type: "array",
|
|
2022
|
+
default: []
|
|
2023
|
+
},
|
|
2024
|
+
dynamicMappingKeys: {
|
|
2025
|
+
type: "boolean",
|
|
2026
|
+
default: !1
|
|
2027
|
+
},
|
|
2028
|
+
columns: {
|
|
2029
|
+
description: "",
|
|
2030
|
+
type: "array",
|
|
2031
|
+
default: []
|
|
2032
|
+
},
|
|
2033
|
+
modalTitle: {
|
|
2034
|
+
description: "",
|
|
2035
|
+
type: "string",
|
|
2036
|
+
default: ""
|
|
2037
|
+
},
|
|
2038
|
+
canEmpty: {
|
|
2039
|
+
description: "",
|
|
2040
|
+
type: "boolean",
|
|
2041
|
+
default: !0
|
|
2042
|
+
},
|
|
2043
|
+
valueField: {
|
|
2044
|
+
description: "",
|
|
2045
|
+
type: "string",
|
|
2046
|
+
default: "id"
|
|
2047
|
+
},
|
|
2048
|
+
nameField: {
|
|
2049
|
+
description: "",
|
|
2050
|
+
type: "string",
|
|
2051
|
+
default: "name"
|
|
2052
|
+
},
|
|
2053
|
+
idField: {
|
|
2054
|
+
description: "",
|
|
2055
|
+
type: "string",
|
|
2056
|
+
default: "id"
|
|
2057
|
+
},
|
|
2058
|
+
readonly: {
|
|
2059
|
+
description: "",
|
|
2060
|
+
type: "boolean",
|
|
2061
|
+
default: !1
|
|
2062
|
+
},
|
|
2063
|
+
modelValue: {
|
|
2064
|
+
description: "",
|
|
2065
|
+
type: "string",
|
|
2066
|
+
default: ""
|
|
2067
|
+
}
|
|
2068
|
+
}, $t = [
|
|
2069
|
+
"id",
|
|
2070
|
+
"type"
|
|
2071
|
+
], Nt = [], qt = {
|
|
2072
|
+
$schema: xt,
|
|
2073
|
+
$id: Vt,
|
|
2074
|
+
title: At,
|
|
2075
|
+
description: Ot,
|
|
2076
|
+
type: Dt,
|
|
2077
|
+
properties: Lt,
|
|
2078
|
+
required: $t,
|
|
2079
|
+
ignore: Nt
|
|
2080
|
+
}, re = {
|
|
2081
|
+
/**
|
|
2082
|
+
* 必填的列
|
|
2083
|
+
*/
|
|
2084
|
+
requiredFields: { type: Array, default: [] },
|
|
2085
|
+
/**
|
|
2086
|
+
* 值唯一的列
|
|
2087
|
+
*/
|
|
2088
|
+
uniqueFields: { type: Array, default: [] },
|
|
2089
|
+
dynamicMappingKeys: { type: Boolean, default: !1 },
|
|
2090
|
+
/**
|
|
2091
|
+
* 列配置
|
|
2092
|
+
*/
|
|
2093
|
+
columns: { type: Array, default: [] },
|
|
2094
|
+
/**
|
|
2095
|
+
* 模态框标题
|
|
2096
|
+
*/
|
|
2097
|
+
modalTitle: { type: String, default: "项编辑器" },
|
|
2098
|
+
/**
|
|
2099
|
+
* 数据是否可以置空
|
|
2100
|
+
*/
|
|
2101
|
+
canEmpty: { type: Boolean, default: !0 },
|
|
2102
|
+
/**
|
|
2103
|
+
* 动态映射键值时,枚举值的key
|
|
2104
|
+
*/
|
|
2105
|
+
valueField: { type: String, default: "id" },
|
|
2106
|
+
/**
|
|
2107
|
+
* 动态映射键值时,枚举名称的key
|
|
2108
|
+
*/
|
|
2109
|
+
nameField: { type: String, default: "name" },
|
|
2110
|
+
/**
|
|
2111
|
+
* 目前假定idField和valueField一致
|
|
2112
|
+
*/
|
|
2113
|
+
idField: { type: String, default: "id" },
|
|
2114
|
+
/**
|
|
2115
|
+
* 是否进入只读状态
|
|
2116
|
+
*/
|
|
2117
|
+
readonly: { type: Boolean, default: !1 },
|
|
2118
|
+
/**
|
|
2119
|
+
* 组件值
|
|
2120
|
+
*/
|
|
2121
|
+
modelValue: { type: Array, default: [] }
|
|
2122
|
+
/**
|
|
2123
|
+
* 列表只有一列时,将结果集转化为字符串数组
|
|
2124
|
+
*/
|
|
2125
|
+
// isSimpleArray: { type: Boolean, default: false }
|
|
2126
|
+
}, Gt = be(re, qt, De, Se), jt = {
|
|
2127
|
+
/**
|
|
2128
|
+
* 必填的列
|
|
2129
|
+
*/
|
|
2130
|
+
requiredFields: { type: Array, default: [] },
|
|
2131
|
+
/**
|
|
2132
|
+
* 值唯一的列
|
|
2133
|
+
*/
|
|
2134
|
+
uniqueFields: { type: Array, default: [] },
|
|
2135
|
+
dynamicMappingKeys: { type: Boolean, default: !1 },
|
|
2136
|
+
/**
|
|
2137
|
+
* 列配置
|
|
2138
|
+
*/
|
|
2139
|
+
columns: { type: Array, default: [] },
|
|
2140
|
+
/**
|
|
2141
|
+
* 数据是否可以置空
|
|
2142
|
+
*/
|
|
2143
|
+
canEmpty: { type: Boolean, default: !0 },
|
|
2144
|
+
/**
|
|
2145
|
+
* 动态映射键值时,枚举值的key
|
|
2146
|
+
*/
|
|
2147
|
+
valueField: { type: String, default: "id" },
|
|
2148
|
+
/**
|
|
2149
|
+
* 动态映射键值时,枚举名称的key
|
|
2150
|
+
*/
|
|
2151
|
+
nameField: { type: String, default: "name" },
|
|
2152
|
+
/**
|
|
2153
|
+
* 组件值
|
|
2154
|
+
*/
|
|
2155
|
+
datas: { type: Array, default: [] }
|
|
2156
|
+
}, Ut = /* @__PURE__ */ V({
|
|
2157
|
+
name: "FItemCollectionEditorInner",
|
|
2158
|
+
props: jt,
|
|
2159
|
+
emits: ["change"],
|
|
2160
|
+
setup(e, t) {
|
|
2161
|
+
const {
|
|
2162
|
+
guid: n
|
|
2163
|
+
} = J(), a = new Be(), o = w(e.valueField), l = w(e.nameField), u = {
|
|
2164
|
+
editMode: "cell"
|
|
2165
|
+
}, c = w(), p = e.columns;
|
|
2166
|
+
let r = e.datas;
|
|
2167
|
+
function d() {
|
|
2168
|
+
const h = {};
|
|
2169
|
+
return p.forEach((B) => {
|
|
2170
|
+
B.editor && (B.editor.type === "checkbox" || B.editor.type === "switch") ? h[B.field] = !1 : h[B.field] = "";
|
|
2171
|
+
}), h;
|
|
2172
|
+
}
|
|
2173
|
+
function i() {
|
|
2174
|
+
if (e.dynamicMappingKeys) {
|
|
2175
|
+
const h = "请先填写XXX", B = o.value.trim() ? l.value.trim() ? "" : "枚举名称字段" : "枚举值字段";
|
|
2176
|
+
return a.warning({
|
|
2177
|
+
position: "top-center",
|
|
2178
|
+
message: h.replace("XXX", B)
|
|
2179
|
+
}), !1;
|
|
2180
|
+
}
|
|
2181
|
+
return !0;
|
|
2182
|
+
}
|
|
2183
|
+
function s(h) {
|
|
2184
|
+
const B = "不允许重复。";
|
|
2185
|
+
if (!i())
|
|
2186
|
+
return !1;
|
|
2187
|
+
if (!h || h.length === 0)
|
|
2188
|
+
return e.canEmpty ? !0 : (a.warning({
|
|
2189
|
+
position: "top-center",
|
|
2190
|
+
message: "请添加值"
|
|
2191
|
+
}), !1);
|
|
2192
|
+
const P = e.requiredFields || [], C = "不允许为空";
|
|
2193
|
+
for (const S of h)
|
|
2194
|
+
for (const M of Object.keys(S)) {
|
|
2195
|
+
const v = p.find((x) => x.field === M);
|
|
2196
|
+
if (v && v.editor && (v.editor.type === "checkbox" || v.editor.type === "switch")) {
|
|
2197
|
+
if (P.includes(M) && (S[M] === null || S[M] === void 0))
|
|
2198
|
+
return a.warning({
|
|
2199
|
+
position: "top-center",
|
|
2200
|
+
message: v.title + C
|
|
2201
|
+
}), !1;
|
|
2202
|
+
} else if (P.includes(M) && (S[M] === void 0 || S[M] === "" || S[M] === null))
|
|
2203
|
+
return a.warning({
|
|
2204
|
+
position: "top-center",
|
|
2205
|
+
message: v.title + C
|
|
2206
|
+
}), !1;
|
|
2207
|
+
}
|
|
2208
|
+
const E = e.uniqueFields || [];
|
|
2209
|
+
for (const S of E) {
|
|
2210
|
+
const M = h.map(($) => $[S]), v = new Set(M), x = Array.from(v);
|
|
2211
|
+
if (M.length !== x.length) {
|
|
2212
|
+
const $ = p.find((se) => se.field === S);
|
|
2213
|
+
return a.warning({
|
|
2214
|
+
position: "top-center",
|
|
2215
|
+
message: $.title + B
|
|
2216
|
+
}), !1;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
return !0;
|
|
2220
|
+
}
|
|
2221
|
+
function f() {
|
|
2222
|
+
if (e.readonly || !i())
|
|
2223
|
+
return;
|
|
2224
|
+
const h = d(), B = n();
|
|
2225
|
+
r.push({
|
|
2226
|
+
hId: B,
|
|
2227
|
+
...h
|
|
2228
|
+
}), c.value.updateDataSource(r), c.value.selectItemById(B);
|
|
2229
|
+
}
|
|
2230
|
+
function m() {
|
|
2231
|
+
r && r.length > 0 && c.value.selectItemById(r[0].hId);
|
|
2232
|
+
}
|
|
2233
|
+
function y() {
|
|
2234
|
+
r = [...c.value.getVisibleData().filter((B) => !B.checked).map((B) => B.raw)], c.value.updateDataSource(r), m();
|
|
2235
|
+
}
|
|
2236
|
+
function F(h) {
|
|
2237
|
+
if (!h || h.length === 0)
|
|
2238
|
+
return h;
|
|
2239
|
+
const B = [];
|
|
2240
|
+
return h.forEach((P) => {
|
|
2241
|
+
const {
|
|
2242
|
+
value: C,
|
|
2243
|
+
name: E,
|
|
2244
|
+
...S
|
|
2245
|
+
} = P, M = Object.assign({}, S);
|
|
2246
|
+
M[o.value.trim()] = C, M[l.value.trim()] = E, B.push(M);
|
|
2247
|
+
}), B;
|
|
2248
|
+
}
|
|
2249
|
+
function k() {
|
|
2250
|
+
let h = [];
|
|
2251
|
+
return c.value.getVisibleData().forEach((B) => {
|
|
2252
|
+
const {
|
|
2253
|
+
hId: P,
|
|
2254
|
+
...C
|
|
2255
|
+
} = B.raw;
|
|
2256
|
+
h.push(C);
|
|
2257
|
+
}), s(h) ? (e.dynamicMappingKeys ? (h = F(h), t.emit("change", {
|
|
2258
|
+
value: h,
|
|
2259
|
+
parameters: {
|
|
2260
|
+
valueField: o.value.trim(),
|
|
2261
|
+
nameField: l.value.trim()
|
|
2262
|
+
}
|
|
2263
|
+
})) : t.emit("change", {
|
|
2264
|
+
value: h
|
|
2265
|
+
}), !0) : !1;
|
|
2266
|
+
}
|
|
2267
|
+
return t.expose({
|
|
2268
|
+
clickConfirm: k
|
|
2269
|
+
}), L(() => {
|
|
2270
|
+
m();
|
|
2271
|
+
}), () => g("div", {
|
|
2272
|
+
class: "f-utils-fill-flex-column"
|
|
2273
|
+
}, [!e.readonly && g("div", {
|
|
2274
|
+
class: "mb-1 py-1 ml-1"
|
|
2275
|
+
}, [g("button", {
|
|
2276
|
+
class: "btn f-rt-btn f-btn-ml btn-primary",
|
|
2277
|
+
onClick: () => f()
|
|
2278
|
+
}, [A("新增")]), g("button", {
|
|
2279
|
+
class: "btn f-rt-btn f-btn-ml btn-secondary",
|
|
2280
|
+
onClick: () => y()
|
|
2281
|
+
}, [A("删除")])]), g("div", {
|
|
2282
|
+
class: "f-utils-fill border",
|
|
2283
|
+
style: "margin:0 8px;border-radius:12px;"
|
|
2284
|
+
}, [g(Fe, {
|
|
2285
|
+
ref: c,
|
|
2286
|
+
showBorder: !0,
|
|
2287
|
+
idField: "hId",
|
|
2288
|
+
columns: p,
|
|
2289
|
+
data: r,
|
|
2290
|
+
editable: !0,
|
|
2291
|
+
"edit-option": u,
|
|
2292
|
+
fit: "true"
|
|
2293
|
+
}, null)])]);
|
|
2294
|
+
}
|
|
2295
|
+
}), Wt = /* @__PURE__ */ V({
|
|
2296
|
+
name: "FItemCollectionEditor",
|
|
2297
|
+
props: re,
|
|
2298
|
+
components: {},
|
|
2299
|
+
emits: ["change"],
|
|
2300
|
+
setup(e, t) {
|
|
2301
|
+
const {
|
|
2302
|
+
guid: n
|
|
2303
|
+
} = J(), a = w(`共 ${(e.modelValue || []).length} 项`), o = w(e.valueField), l = w(e.nameField), u = w();
|
|
2304
|
+
function c() {
|
|
2305
|
+
let s = [];
|
|
2306
|
+
return e.dynamicMappingKeys ? (s = [], o.value = o.value.trim(), l.value = l.value.trim(), (e.modelValue || []).forEach((f) => {
|
|
2307
|
+
if (o.value && l.value) {
|
|
2308
|
+
const {
|
|
2309
|
+
[o.value]: m,
|
|
2310
|
+
[l.value]: y,
|
|
2311
|
+
...F
|
|
2312
|
+
} = f, k = F || {};
|
|
2313
|
+
k.value = m, k.name = y, k.hId = n(), s.push(k);
|
|
2314
|
+
}
|
|
2315
|
+
})) : (s = U(e.modelValue || []), s.forEach((f) => {
|
|
2316
|
+
f.hId = n();
|
|
2317
|
+
})), s;
|
|
2318
|
+
}
|
|
2319
|
+
function p() {
|
|
2320
|
+
let s = [];
|
|
2321
|
+
return e.columns && e.columns.length > 0 ? s = e.columns : s = [{
|
|
2322
|
+
field: e.valueField,
|
|
2323
|
+
title: "值",
|
|
2324
|
+
dataType: "string"
|
|
2325
|
+
}, {
|
|
2326
|
+
field: e.nameField,
|
|
2327
|
+
title: "名称",
|
|
2328
|
+
dataType: "string"
|
|
2329
|
+
}], s;
|
|
2330
|
+
}
|
|
2331
|
+
function r() {
|
|
2332
|
+
}
|
|
2333
|
+
const d = {
|
|
2334
|
+
fitContent: !1,
|
|
2335
|
+
width: 900,
|
|
2336
|
+
height: 600,
|
|
2337
|
+
title: "项编辑器",
|
|
2338
|
+
buttons: [{
|
|
2339
|
+
name: "cancel",
|
|
2340
|
+
text: "取消",
|
|
2341
|
+
class: "btn btn-secondary",
|
|
2342
|
+
handle: (s) => !0
|
|
2343
|
+
}, {
|
|
2344
|
+
name: "accept",
|
|
2345
|
+
text: "确定",
|
|
2346
|
+
class: "btn btn-primary",
|
|
2347
|
+
handle: (s) => !!u.value.clickConfirm()
|
|
2348
|
+
}]
|
|
2349
|
+
};
|
|
2350
|
+
function i(s) {
|
|
2351
|
+
a.value = `共 ${s.value.length} 项`, t.emit("change", s);
|
|
2352
|
+
}
|
|
2353
|
+
return L(() => {
|
|
2354
|
+
}), () => g(Pt, {
|
|
2355
|
+
"button-behavior": "Modal",
|
|
2356
|
+
"modal-options": d,
|
|
2357
|
+
modelValue: a.value,
|
|
2358
|
+
"onUpdate:modelValue": (s) => a.value = s,
|
|
2359
|
+
editable: !1,
|
|
2360
|
+
beforeOpen: r
|
|
2361
|
+
}, {
|
|
2362
|
+
default: () => [g("div", {
|
|
2363
|
+
class: "f-utils-absolute-all f-utils-flex-column"
|
|
2364
|
+
}, [e.dynamicMappingKeys && g("div", {
|
|
2365
|
+
class: "farris-form-controls-inline p-2 f-form-layout farris-form f-form-lable-auto"
|
|
2366
|
+
}, [g("div", {
|
|
2367
|
+
class: "farris-group-wrap mr-3"
|
|
2368
|
+
}, [g("div", {
|
|
2369
|
+
class: "form-group farris-form-group"
|
|
2370
|
+
}, [g("label", {
|
|
2371
|
+
class: "col-form-label"
|
|
2372
|
+
}, [g("span", {
|
|
2373
|
+
class: "farris-label-info text-danger"
|
|
2374
|
+
}, [A("*")]), g("span", {
|
|
2375
|
+
class: "farris-label-text"
|
|
2376
|
+
}, [A("枚举值字段")])]), g("div", {
|
|
2377
|
+
class: "farris-input-wrap"
|
|
2378
|
+
}, [G(g("input", {
|
|
2379
|
+
type: "input",
|
|
2380
|
+
class: "form-control",
|
|
2381
|
+
"onUpdate:modelValue": (s) => o = s,
|
|
2382
|
+
readonly: e.readonly
|
|
2383
|
+
}, null), [[X, o]])])])]), g("div", {
|
|
2384
|
+
class: "farris-group-wrap"
|
|
2385
|
+
}, [g("div", {
|
|
2386
|
+
class: "form-group farris-form-group"
|
|
2387
|
+
}, [g("label", {
|
|
2388
|
+
class: "col-form-label"
|
|
2389
|
+
}, [g("span", {
|
|
2390
|
+
class: "farris-label-info text-danger"
|
|
2391
|
+
}, [A("*")]), g("span", {
|
|
2392
|
+
class: "farris-label-text"
|
|
2393
|
+
}, [A("枚举名称字段")])]), g("div", {
|
|
2394
|
+
class: "farris-input-wrap"
|
|
2395
|
+
}, [G(g("input", {
|
|
2396
|
+
type: "input",
|
|
2397
|
+
class: "form-control",
|
|
2398
|
+
"onUpdate:modelValue": (s) => l = s,
|
|
2399
|
+
readonly: e.readonly
|
|
2400
|
+
}, null), [[X, l]])])])])]), g(Ut, {
|
|
2401
|
+
ref: u,
|
|
2402
|
+
valueField: o,
|
|
2403
|
+
nameField: l,
|
|
2404
|
+
requiredFields: e.requiredFields,
|
|
2405
|
+
uniqueFields: e.uniqueFields,
|
|
2406
|
+
dynamicMappingKeys: e.dynamicMappingKeys,
|
|
2407
|
+
canEmpty: e.canEmpty,
|
|
2408
|
+
datas: c(),
|
|
2409
|
+
columns: p(),
|
|
2410
|
+
onChange: (s) => i(s)
|
|
2411
|
+
}, null)])]
|
|
2412
|
+
});
|
|
1060
2413
|
}
|
|
1061
2414
|
});
|
|
1062
|
-
|
|
1063
|
-
|
|
2415
|
+
D.install = (e) => {
|
|
2416
|
+
e.component(D.name, D), e.component(K.name, K);
|
|
1064
2417
|
};
|
|
1065
|
-
|
|
1066
|
-
|
|
2418
|
+
D.register = (e, t, n, a) => {
|
|
2419
|
+
e["radio-group"] = D, t["radio-group"] = oe, e["item-collection-editor"] = Wt, t["item-collection-editor"] = Gt;
|
|
1067
2420
|
};
|
|
1068
|
-
|
|
1069
|
-
|
|
2421
|
+
D.registerDesigner = (e, t, n) => {
|
|
2422
|
+
e["radio-group"] = et, t["radio-group"] = oe;
|
|
1070
2423
|
};
|
|
1071
2424
|
export {
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
2425
|
+
D as RadioGroup,
|
|
2426
|
+
D as default,
|
|
2427
|
+
oe as propsResolver,
|
|
2428
|
+
R as radioGroupProps,
|
|
2429
|
+
Me as radioProps
|
|
1077
2430
|
};
|