@farris/ui-vue 1.2.5 → 1.2.7
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 +147 -139
- package/components/accordion/index.umd.cjs +1 -1
- package/components/accordion/package.json +1 -1
- package/components/avatar/index.esm.js +122 -131
- package/components/avatar/index.umd.cjs +1 -1
- package/components/avatar/package.json +1 -1
- package/components/border-editor/package.json +1 -1
- package/components/button/package.json +1 -1
- package/components/button-edit/index.css +1 -0
- package/components/button-edit/package.json +1 -1
- package/components/button-group/package.json +1 -1
- package/components/calculator/package.json +1 -1
- package/components/calendar/package.json +1 -1
- package/components/capsule/package.json +1 -1
- package/components/checkbox/index.esm.js +216 -223
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/checkbox/package.json +1 -1
- package/components/color-picker/package.json +1 -1
- package/components/combo-list/index.esm.js +201 -181
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-list/package.json +1 -1
- package/components/combo-tree/index.esm.js +340 -107
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/combo-tree/package.json +1 -1
- package/components/common/package.json +1 -1
- package/components/component/index.esm.js +36 -29
- package/components/component/index.umd.cjs +1 -1
- package/components/component/package.json +1 -1
- package/components/condition/index.esm.js +341 -338
- package/components/condition/index.umd.cjs +1 -1
- package/components/condition/package.json +1 -1
- package/components/content-container/index.esm.js +9 -13
- package/components/content-container/index.umd.cjs +1 -1
- package/components/content-container/package.json +1 -1
- package/components/{tree-grid/style.css → data-grid/index.css} +1 -1
- package/components/data-grid/index.esm.js +3415 -3295
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-grid/package.json +1 -1
- package/components/data-view/index.esm.js +2719 -2717
- package/components/data-view/index.umd.cjs +1 -1
- package/components/data-view/package.json +1 -1
- package/components/date-picker/index.esm.js +31 -40
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/date-picker/package.json +1 -1
- package/components/designer-canvas/index.esm.js +23 -20
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-canvas/package.json +1 -1
- package/components/designer-outline/package.json +1 -1
- package/components/designer-toolbox/package.json +1 -1
- package/components/discussion-editor/package.json +1 -1
- package/components/discussion-list/package.json +1 -1
- package/components/drawer/package.json +1 -1
- package/components/dropdown/index.esm.js +86 -86
- package/components/dropdown/index.umd.cjs +1 -1
- package/components/dropdown/package.json +1 -1
- package/components/dynamic-form/index.esm.js +578 -584
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-form/package.json +1 -1
- package/components/dynamic-resolver/index.esm.js +56 -47
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-resolver/package.json +1 -1
- package/components/dynamic-view/index.esm.js +287 -278
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/dynamic-view/package.json +1 -1
- package/components/enum-editor/package.json +1 -1
- package/components/events-editor/package.json +1 -1
- package/components/expression-editor/package.json +1 -1
- package/components/external-container/index.css +1 -0
- package/components/external-container/index.esm.js +1923 -1908
- package/components/external-container/index.umd.cjs +1 -1
- package/components/external-container/package.json +1 -1
- package/components/field-selector/index.css +1 -0
- package/components/field-selector/index.esm.js +3719 -3604
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/field-selector/package.json +1 -1
- package/components/filter-bar/{style.css → index.css} +1 -1
- package/components/filter-bar/index.esm.js +483 -470
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-bar/package.json +1 -1
- package/components/flow-canvas/index.esm.js +37 -34
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/flow-canvas/package.json +1 -1
- package/components/image-cropper/package.json +1 -1
- package/components/input-group/index.esm.js +258 -267
- package/components/input-group/index.umd.cjs +1 -1
- package/components/input-group/package.json +1 -1
- package/components/layout/package.json +1 -1
- package/components/list-nav/package.json +1 -1
- package/components/list-view/index.esm.js +1452 -1450
- package/components/list-view/index.umd.cjs +1 -1
- package/components/list-view/package.json +1 -1
- package/components/loading/package.json +1 -1
- package/components/locale/package.json +1 -1
- package/components/lookup/index.css +1 -0
- package/components/lookup/index.esm.js +4860 -4657
- package/components/lookup/index.umd.cjs +1 -1
- package/components/lookup/package.json +1 -1
- package/components/mapping-editor/index.css +1 -0
- package/components/mapping-editor/index.esm.js +4411 -4259
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/mapping-editor/package.json +1 -1
- package/components/message-box/index.css +1 -0
- package/components/message-box/index.esm.js +397 -386
- package/components/message-box/index.umd.cjs +1 -1
- package/components/message-box/package.json +1 -1
- package/components/modal/index.css +1 -0
- package/components/modal/index.esm.js +308 -297
- package/components/modal/index.umd.cjs +1 -1
- package/components/modal/package.json +1 -1
- package/components/nav/package.json +1 -1
- package/components/notify/package.json +1 -1
- package/components/order/index.esm.js +763 -741
- package/components/order/index.umd.cjs +1 -1
- package/components/order/package.json +1 -1
- package/components/page-footer/package.json +1 -1
- package/components/page-header/index.esm.js +948 -945
- package/components/page-header/index.umd.cjs +1 -1
- package/components/page-header/package.json +1 -1
- package/components/pagination/package.json +1 -1
- package/components/popover/package.json +1 -1
- package/components/progress/package.json +1 -1
- package/components/property-editor/index.esm.js +485 -466
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-editor/package.json +1 -1
- package/components/property-panel/index.esm.js +437 -426
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/property-panel/package.json +1 -1
- package/components/radio-button/package.json +1 -1
- package/components/radio-group/index.esm.js +98 -107
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/radio-group/package.json +1 -1
- package/components/rate/package.json +1 -1
- package/components/response-layout/package.json +1 -1
- package/components/response-layout-editor/{style.css → index.css} +1 -1
- package/components/response-layout-editor/index.esm.js +840 -800
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-layout-editor/package.json +1 -1
- package/components/response-toolbar/index.esm.js +757 -760
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/response-toolbar/package.json +1 -1
- package/components/schema-selector/index.css +1 -0
- package/components/schema-selector/index.esm.js +3659 -3432
- package/components/schema-selector/index.umd.cjs +8 -1
- package/components/schema-selector/package.json +1 -1
- package/components/search-box/package.json +1 -1
- package/components/section/index.esm.js +21 -14
- package/components/section/index.umd.cjs +1 -1
- package/components/section/package.json +1 -1
- package/components/smoke-detector/package.json +1 -1
- package/components/spacing-editor/package.json +1 -1
- package/components/splitter/package.json +1 -1
- package/components/step/package.json +1 -1
- package/components/switch/index.esm.js +126 -135
- package/components/switch/index.umd.cjs +1 -1
- package/components/switch/package.json +1 -1
- package/components/tabs/index.css +1 -0
- package/components/tabs/index.esm.js +1400 -1379
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tabs/package.json +1 -1
- package/components/tags/package.json +1 -1
- package/components/text/package.json +1 -1
- package/components/textarea/index.esm.js +97 -106
- package/components/textarea/index.umd.cjs +1 -1
- package/components/textarea/package.json +1 -1
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +393 -402
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/time-picker/package.json +1 -1
- package/components/tooltip/package.json +1 -1
- package/components/transfer/index.esm.js +124 -122
- package/components/transfer/index.umd.cjs +1 -1
- package/components/transfer/package.json +1 -1
- package/components/{data-grid/style.css → tree-grid/index.css} +1 -1
- package/components/tree-grid/index.esm.js +3531 -3412
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-grid/package.json +1 -1
- package/components/tree-view/index.esm.js +2046 -2044
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/tree-view/package.json +1 -1
- package/components/uploader/package.json +1 -1
- package/components/verify-detail/package.json +1 -1
- package/components/video/package.json +1 -1
- package/components/weather/package.json +1 -1
- package/farris.all.esm.js +12370 -11917
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -0
- package/package.json +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +6 -0
- package/types/combo-list/src/components/list-container.props.d.ts +9 -1
- package/types/combo-tree/src/combo-tree.props.d.ts +4 -0
- package/types/combo-tree/src/components/tree-container.component.d.ts +13 -3
- package/types/combo-tree/src/components/tree-container.props.d.ts +15 -1
- package/types/combo-tree/src/schema/schema-mapper.d.ts +2 -0
- package/types/combo-tree/src/schema/schema-resolver.d.ts +2 -0
- package/types/components.d.ts +1 -0
- package/types/data-grid/index.d.ts +5 -5
- package/types/data-grid/src/data-grid.component.d.ts +2 -2
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +1 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +8 -8
- package/types/designer-canvas/src/composition/types.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/converter/pagination.converter.d.ts +6 -0
- package/types/dynamic-resolver/src/visible-prop-resolver.d.ts +3 -0
- package/types/lookup/src/designer/use-lookup-rules.d.ts +3 -0
- package/types/lookup/src/property-config/converters/lookup-property.converter.d.ts +7 -3
- package/types/lookup/src/property-config/lookup.property-config.d.ts +31 -27
- package/types/mapping-editor/src/mapping-editor.props.d.ts +8 -0
- package/types/modal/src/modal.component.d.ts +3 -3
- package/types/modal/src/modal.props.d.ts +3 -5
- package/types/page-header/src/page-header.props.d.ts +7 -0
- package/types/page-header/src/property-config/page-header.property-config.d.ts +1 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +2 -16
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +21 -0
- package/types/response-toolbar/index.d.ts +9 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
- package/types/response-toolbar/src/response-toolbar.component.d.ts +4 -2
- package/types/response-toolbar/src/response-toolbar.props.d.ts +9 -2
- package/types/schema-selector/src/composition/types.d.ts +3 -1
- package/types/schema-selector/src/schema-selector-editor.component.d.ts +5 -1
- package/types/tabs/src/designer/tab-toolbar.design.component.d.ts +1 -1
- package/types/tabs/src/tabs.props.d.ts +8 -0
- package/components/button-edit/style.css +0 -1
- package/components/external-container/style.css +0 -1
- package/components/field-selector/style.css +0 -1
- package/components/lookup/style.css +0 -1
- package/components/mapping-editor/style.css +0 -1
- package/components/message-box/style.css +0 -1
- package/components/modal/style.css +0 -1
- package/components/schema-selector/style.css +0 -1
- package/components/tabs/style.css +0 -1
- package/components/time-picker/style.css +0 -1
- package/style.css +0 -1
- package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +0 -19
- /package/components/border-editor/{style.css → index.css} +0 -0
- /package/components/checkbox/{style.css → index.css} +0 -0
- /package/components/date-picker/{style.css → index.css} +0 -0
- /package/components/designer-canvas/{style.css → index.css} +0 -0
- /package/components/designer-outline/{style.css → index.css} +0 -0
- /package/components/designer-toolbox/{style.css → index.css} +0 -0
- /package/components/discussion-editor/{style.css → index.css} +0 -0
- /package/components/discussion-list/{style.css → index.css} +0 -0
- /package/components/drawer/{style.css → index.css} +0 -0
- /package/components/events-editor/{style.css → index.css} +0 -0
- /package/components/flow-canvas/{style.css → index.css} +0 -0
- /package/components/list-view/{style.css → index.css} +0 -0
- /package/components/order/{style.css → index.css} +0 -0
- /package/components/property-editor/{style.css → index.css} +0 -0
- /package/components/property-panel/{style.css → index.css} +0 -0
- /package/components/radio-button/{style.css → index.css} +0 -0
- /package/components/radio-group/{style.css → index.css} +0 -0
- /package/components/smoke-detector/{style.css → index.css} +0 -0
- /package/components/spacing-editor/{style.css → index.css} +0 -0
- /package/components/splitter/{style.css → index.css} +0 -0
- /package/components/switch/{style.css → index.css} +0 -0
- /package/components/transfer/{style.css → index.css} +0 -0
- /package/components/uploader/{style.css → index.css} +0 -0
- /package/components/weather/{style.css → index.css} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var F = (
|
|
4
|
-
import { computed as
|
|
5
|
-
import { cloneDeep as
|
|
1
|
+
var ke = Object.defineProperty;
|
|
2
|
+
var Pe = (r, e, n) => e in r ? ke(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
|
|
3
|
+
var F = (r, e, n) => Pe(r, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { computed as z, getCurrentInstance as de, createVNode as w, ref as j, defineComponent as Y, onMounted as H, onUnmounted as ne, watch as Q, inject as $, createTextVNode as ue, provide as Re, onBeforeUnmount as Ee, withModifiers as je } from "vue";
|
|
5
|
+
import { cloneDeep as Be } from "lodash-es";
|
|
6
6
|
import { useDesignerInnerComponent as fe } from "@farris/ui-vue/components/designer-canvas/src/composition/function/use-designer-inner-component";
|
|
7
7
|
import { withInstall as Ae } from "@farris/ui-vue/components/common";
|
|
8
8
|
class me {
|
|
@@ -50,13 +50,13 @@ class me {
|
|
|
50
50
|
"tipsText",
|
|
51
51
|
"onClick"
|
|
52
52
|
];
|
|
53
|
-
Object.keys(e).filter((
|
|
54
|
-
this[
|
|
53
|
+
Object.keys(e).filter((c) => n.indexOf(c) > -1).forEach((c) => {
|
|
54
|
+
this[c] = e[c];
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
/** 是否可用 */
|
|
58
58
|
get enable() {
|
|
59
|
-
return Object.keys(this.options).indexOf("enable") > -1 ? this.options.enable :
|
|
59
|
+
return Object.keys(this.options).indexOf("enable") > -1 ? this.options.enable : z(() => !0);
|
|
60
60
|
}
|
|
61
61
|
/** 设置宽度 */
|
|
62
62
|
setWidth(e) {
|
|
@@ -73,11 +73,11 @@ class Fe extends me {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
function ge() {
|
|
76
|
-
function
|
|
76
|
+
function r(e) {
|
|
77
77
|
const n = [];
|
|
78
|
-
return e.reduce((
|
|
78
|
+
return e.reduce((c, u) => (u.children && u.children.length > 0 ? c.push(new G(u)) : c.push(new Fe(u)), c), n), n;
|
|
79
79
|
}
|
|
80
|
-
return { buildResponseToolbarItems:
|
|
80
|
+
return { buildResponseToolbarItems: r };
|
|
81
81
|
}
|
|
82
82
|
const { buildResponseToolbarItems: Oe } = ge();
|
|
83
83
|
class G extends me {
|
|
@@ -93,13 +93,13 @@ class G extends me {
|
|
|
93
93
|
F(this, "split", !1);
|
|
94
94
|
F(this, "children", []);
|
|
95
95
|
F(this, "expanded", !1);
|
|
96
|
-
const
|
|
97
|
-
Object.keys(n).filter((u) =>
|
|
96
|
+
const c = ["isDP", "class", "dropdownClass", "menuClass", "placement", "split", "expanded"];
|
|
97
|
+
Object.keys(n).filter((u) => c.indexOf(u) > -1).forEach((u) => {
|
|
98
98
|
this[u] = n[u];
|
|
99
99
|
}), n.children && n.children.length && (this.children = Oe(n.children));
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
class
|
|
102
|
+
class Nt {
|
|
103
103
|
constructor(e, n) {
|
|
104
104
|
F(this, "id");
|
|
105
105
|
F(this, "name");
|
|
@@ -145,102 +145,102 @@ class Lt {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
const oe = {}, ye = {};
|
|
148
|
-
function re(
|
|
149
|
-
const { properties: e, title: n } =
|
|
150
|
-
return
|
|
148
|
+
function re(r) {
|
|
149
|
+
const { properties: e, title: n } = r, c = Object.keys(e).reduce((u, m) => (u[m] = e[m].type === "object" && e[m].properties ? re(e[m]) : Be(e[m].default), u), {});
|
|
150
|
+
return c.id = `${n}-${Date.now()}`, c;
|
|
151
151
|
}
|
|
152
|
-
function q(
|
|
153
|
-
const n = oe[
|
|
152
|
+
function q(r, e = {}) {
|
|
153
|
+
const n = oe[r];
|
|
154
154
|
if (n) {
|
|
155
|
-
let
|
|
156
|
-
const u = ye[
|
|
157
|
-
return
|
|
155
|
+
let c = re(n);
|
|
156
|
+
const u = ye[r];
|
|
157
|
+
return c = u ? u({ getSchemaByType: q }, c, e) : c, c;
|
|
158
158
|
}
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
|
-
function Le(
|
|
161
|
+
function Le(r, e) {
|
|
162
162
|
const n = re(e);
|
|
163
|
-
return Object.keys(
|
|
163
|
+
return Object.keys(r).reduce((c, u) => (c[u] = r[u], c), n), n;
|
|
164
164
|
}
|
|
165
|
-
function Ne(
|
|
166
|
-
return Object.keys(
|
|
165
|
+
function Ne(r, e) {
|
|
166
|
+
return Object.keys(r).filter((c) => r[c] != null).reduce((c, u) => {
|
|
167
167
|
if (e.has(u)) {
|
|
168
|
-
const
|
|
169
|
-
if (typeof
|
|
170
|
-
|
|
168
|
+
const m = e.get(u);
|
|
169
|
+
if (typeof m == "string")
|
|
170
|
+
c[m] = r[u];
|
|
171
171
|
else {
|
|
172
|
-
const
|
|
173
|
-
Object.assign(
|
|
172
|
+
const v = m(u, r[u], r);
|
|
173
|
+
Object.assign(c, v);
|
|
174
174
|
}
|
|
175
175
|
} else
|
|
176
|
-
|
|
177
|
-
return
|
|
176
|
+
c[u] = r[u];
|
|
177
|
+
return c;
|
|
178
178
|
}, {});
|
|
179
179
|
}
|
|
180
|
-
function Ve(
|
|
181
|
-
const
|
|
182
|
-
return Ne(
|
|
180
|
+
function Ve(r, e, n = /* @__PURE__ */ new Map()) {
|
|
181
|
+
const c = Le(r, e);
|
|
182
|
+
return Ne(c, n);
|
|
183
183
|
}
|
|
184
|
-
function _e(
|
|
185
|
-
function e(
|
|
184
|
+
function _e(r = {}) {
|
|
185
|
+
function e(g, C, p, a) {
|
|
186
186
|
if (typeof p == "number")
|
|
187
|
-
return
|
|
187
|
+
return a[g].length === p;
|
|
188
188
|
if (typeof p == "object") {
|
|
189
|
-
const d = Object.keys(p)[0],
|
|
189
|
+
const d = Object.keys(p)[0], s = p[d];
|
|
190
190
|
if (d === "not")
|
|
191
|
-
return Number(
|
|
191
|
+
return Number(a[g].length) !== Number(s);
|
|
192
192
|
if (d === "moreThan")
|
|
193
|
-
return Number(
|
|
193
|
+
return Number(a[g].length) >= Number(s);
|
|
194
194
|
if (d === "lessThan")
|
|
195
|
-
return Number(
|
|
195
|
+
return Number(a[g].length) <= Number(s);
|
|
196
196
|
}
|
|
197
197
|
return !1;
|
|
198
198
|
}
|
|
199
|
-
function n(
|
|
200
|
-
return
|
|
199
|
+
function n(g, C, p, a) {
|
|
200
|
+
return a[g] && a[g].propertyValue && String(a[g].propertyValue.value) === String(p);
|
|
201
201
|
}
|
|
202
|
-
const
|
|
202
|
+
const c = /* @__PURE__ */ new Map([
|
|
203
203
|
["length", e],
|
|
204
204
|
["getProperty", n]
|
|
205
205
|
]);
|
|
206
|
-
Object.keys(
|
|
207
|
-
function u(
|
|
208
|
-
const p =
|
|
209
|
-
return typeof
|
|
210
|
-
if (
|
|
211
|
-
return { target: p, operator: "length", param: null, value:
|
|
212
|
-
const d =
|
|
213
|
-
return { target: p, operator: "getProperty", param: d, value:
|
|
206
|
+
Object.keys(r).reduce((g, C) => (g.set(C, r[C]), g), c);
|
|
207
|
+
function u(g, C) {
|
|
208
|
+
const p = g;
|
|
209
|
+
return typeof C == "number" ? [{ target: p, operator: "length", param: null, value: Number(C) }] : typeof C == "boolean" ? [{ target: p, operator: "getProperty", param: g, value: !!C }] : typeof C == "object" ? Object.keys(C).map((a) => {
|
|
210
|
+
if (a === "length")
|
|
211
|
+
return { target: p, operator: "length", param: null, value: C[a] };
|
|
212
|
+
const d = a, s = C[a];
|
|
213
|
+
return { target: p, operator: "getProperty", param: d, value: s };
|
|
214
214
|
}) : [];
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
return Object.keys(
|
|
218
|
-
const d = u(
|
|
216
|
+
function m(g) {
|
|
217
|
+
return Object.keys(g).reduce((p, a) => {
|
|
218
|
+
const d = u(a, g[a]);
|
|
219
219
|
return p.push(...d), p;
|
|
220
220
|
}, []);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
if (
|
|
224
|
-
const p =
|
|
225
|
-
return p && p(
|
|
222
|
+
function v(g, C) {
|
|
223
|
+
if (c.has(g.operator)) {
|
|
224
|
+
const p = c.get(g.operator);
|
|
225
|
+
return p && p(g.target, g.param, g.value, C) || !1;
|
|
226
226
|
}
|
|
227
227
|
return !1;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
229
|
+
function M(g, C) {
|
|
230
|
+
return m(g).reduce((d, s) => d && v(s, C), !0);
|
|
231
231
|
}
|
|
232
|
-
function S(
|
|
233
|
-
const p = Object.keys(
|
|
234
|
-
return
|
|
232
|
+
function S(g, C) {
|
|
233
|
+
const p = Object.keys(g), a = p.includes("allOf"), d = p.includes("anyOf"), s = a || d, x = (s ? g[s ? a ? "allOf" : "anyOf" : "allOf"] : [g]).map((P) => M(P, C));
|
|
234
|
+
return a ? !x.includes(!1) : x.includes(!0);
|
|
235
235
|
}
|
|
236
236
|
return { parseValueSchema: S };
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const I = {
|
|
239
239
|
Button: { type: "Button", name: "按钮", icon: "Button" },
|
|
240
240
|
ButtonGroup: { type: "ButtonGroup", name: "按钮组", icon: "ButtonGroup" },
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
242
|
+
"response-toolbar-item": { type: "response-toolbar-item", name: "工具栏项", icon: "Button" },
|
|
243
|
+
"content-container": { type: "content-container", name: "容器", icon: "ContentContainer" },
|
|
244
244
|
DisplayField: { type: "DisplayField", name: "标签", icon: "DisplayField" },
|
|
245
245
|
"input-group": { type: "input-group", name: "文本", icon: "TextBox" },
|
|
246
246
|
textarea: { type: "textarea", name: "多行文本", icon: "MultiTextBox" },
|
|
@@ -267,15 +267,15 @@ const M = {
|
|
|
267
267
|
"data-grid-column": { type: "data-grid-column", name: "表格列" },
|
|
268
268
|
Panel: { type: "Panel", name: "面板", icon: "ContentContainer" },
|
|
269
269
|
Module: { type: "Module", name: "模块", icon: "Module" },
|
|
270
|
-
|
|
270
|
+
component: { type: "component", name: "组件", icon: "Component" },
|
|
271
271
|
ExternalContainer: { type: "ExternalContainer", name: "外部容器", icon: "ContentContainer" },
|
|
272
272
|
Image: { type: "Image", name: "图像", icon: "Image" },
|
|
273
273
|
ImageUpload: { type: "ImageUpload", name: "图片上传", icon: "imageupload" },
|
|
274
274
|
HiddenContainer: { type: "HiddenContainer", name: "隐藏区域", icon: "ContentContainer" },
|
|
275
275
|
ModalContainer: { type: "ModalContainer", name: "弹窗容器", icon: "ContentContainer" },
|
|
276
276
|
RouteContainer: { type: "RouteContainer", name: "路由区域", icon: "ContentContainer" },
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
tabs: { type: "tabs", name: "标签页", icon: "Tab" },
|
|
278
|
+
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
|
|
279
279
|
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮", icon: "Button" },
|
|
280
280
|
Tag: { type: "Tag", name: "Tag", icon: "Tag" },
|
|
281
281
|
Sidebar: { type: "Sidebar", name: "侧边栏", icon: "Sidebar" },
|
|
@@ -284,7 +284,7 @@ const M = {
|
|
|
284
284
|
RichTextBox: { type: "RichTextBox", name: "富文本", icon: "RichTextBox" },
|
|
285
285
|
TimeSpinner: { type: "TimeSpinner", name: "时间调节器", icon: "TimePicker" },
|
|
286
286
|
TimePicker: { type: "TimePicker", name: "时间选择", icon: "TimePicker" },
|
|
287
|
-
|
|
287
|
+
section: { type: "section", name: "分组面板", icon: "Section" },
|
|
288
288
|
SectionToolbar: { type: "SectionToolbar", name: "分组面板工具栏" },
|
|
289
289
|
SectionToolbarItem: { type: "SectionToolbarItem", name: "分组面板按钮" },
|
|
290
290
|
QueryScheme: { type: "QueryScheme", name: "筛选方案", icon: "QueryScheme" },
|
|
@@ -314,7 +314,7 @@ const M = {
|
|
|
314
314
|
NavTab: { type: "NavTab", name: "标签类导航", icon: "NavTab" },
|
|
315
315
|
Tags: { type: "Tags", name: "标记组", icon: "Tags" },
|
|
316
316
|
Portlet: { type: "Portlet", name: "小部件", icon: "dingzhi" },
|
|
317
|
-
|
|
317
|
+
"page-header": { type: "page-header", name: "页头", icon: "Header" },
|
|
318
318
|
ModalFooter: { type: "ModalFooter", name: "弹窗页脚", icon: "ModalFooter" },
|
|
319
319
|
ScrollCollapsibleArea: { type: "ScrollCollapsibleArea", name: "滚动收折区域", icon: "ScrollCollapsibleArea" },
|
|
320
320
|
PersonnelSelector: { type: "PersonnelSelector", name: "人员选择", icon: "PersonnelSelector" },
|
|
@@ -348,19 +348,19 @@ const M = {
|
|
|
348
348
|
/** 审批类 end */
|
|
349
349
|
}, he = {}, $e = {};
|
|
350
350
|
_e();
|
|
351
|
-
function be(
|
|
352
|
-
return oe[e.title] = e, ye[e.title] =
|
|
353
|
-
const
|
|
354
|
-
return Object.assign(S,
|
|
351
|
+
function be(r, e, n = /* @__PURE__ */ new Map(), c = (v, M, S) => M, u = {}, m = (v) => v) {
|
|
352
|
+
return oe[e.title] = e, ye[e.title] = c, he[e.title] = u, $e[e.title] = m, (v = {}) => {
|
|
353
|
+
const M = Ve(v, e, n), S = Object.keys(r).reduce((g, C) => (g[C] = r[C].default, g), {});
|
|
354
|
+
return Object.assign(S, M);
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
357
|
const ve = /* @__PURE__ */ new Map([
|
|
358
358
|
["buttons", "items"]
|
|
359
359
|
]);
|
|
360
|
-
function Ce(
|
|
360
|
+
function Ce(r, e, n) {
|
|
361
361
|
return e;
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const We = "https://json-schema.org/draft/2020-12/schema", ze = "https://farris-design.gitee.io/response-toolbar.schema.json", Ue = "response-toolbar", qe = "A Farris Toolbar Component", He = "object", Ge = {
|
|
364
364
|
id: {
|
|
365
365
|
description: "The unique identifier for a Response Toolbar",
|
|
366
366
|
type: "string"
|
|
@@ -398,9 +398,9 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
398
398
|
"type",
|
|
399
399
|
"buttons"
|
|
400
400
|
], Xe = {
|
|
401
|
-
$schema:
|
|
402
|
-
$id:
|
|
403
|
-
title:
|
|
401
|
+
$schema: We,
|
|
402
|
+
$id: ze,
|
|
403
|
+
title: Ue,
|
|
404
404
|
description: qe,
|
|
405
405
|
type: He,
|
|
406
406
|
properties: Ge,
|
|
@@ -438,7 +438,7 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
438
438
|
type: "string",
|
|
439
439
|
default: ""
|
|
440
440
|
},
|
|
441
|
-
|
|
441
|
+
click: {
|
|
442
442
|
description: "The event of response toolbar item.",
|
|
443
443
|
type: "string",
|
|
444
444
|
default: ""
|
|
@@ -504,7 +504,9 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
504
504
|
};
|
|
505
505
|
oe[te.title] = te;
|
|
506
506
|
he[le.title] = le;
|
|
507
|
-
const
|
|
507
|
+
const at = Object.assign({}, se, {
|
|
508
|
+
componentId: { type: String, default: "" }
|
|
509
|
+
}), ie = be(
|
|
508
510
|
se,
|
|
509
511
|
Xe,
|
|
510
512
|
ve,
|
|
@@ -514,194 +516,195 @@ const ie = be(
|
|
|
514
516
|
items: { type: Object, default: {} },
|
|
515
517
|
text: { type: String, default: "" },
|
|
516
518
|
disabled: { type: Boolean, default: !1 },
|
|
517
|
-
icon: { type: String, default: "" }
|
|
518
|
-
|
|
519
|
+
icon: { type: String, default: "" },
|
|
520
|
+
componentId: { type: String, default: "" }
|
|
521
|
+
}, ct = be(
|
|
519
522
|
we,
|
|
520
523
|
te,
|
|
521
524
|
ve,
|
|
522
525
|
Ce
|
|
523
526
|
);
|
|
524
527
|
function Te() {
|
|
525
|
-
function
|
|
526
|
-
const
|
|
528
|
+
function r(n) {
|
|
529
|
+
const c = {
|
|
527
530
|
"f-icon": !0
|
|
528
531
|
};
|
|
529
532
|
if (n.icon) {
|
|
530
533
|
const u = n.icon.trim().split(" ");
|
|
531
|
-
u && u.length && u.reduce((
|
|
534
|
+
u && u.length && u.reduce((m, v) => (m[v] = !0, m), c);
|
|
532
535
|
}
|
|
533
|
-
return
|
|
536
|
+
return c;
|
|
534
537
|
}
|
|
535
538
|
function e(n) {
|
|
536
539
|
return !!(n.icon && n.icon.trim());
|
|
537
540
|
}
|
|
538
|
-
return { iconClass:
|
|
541
|
+
return { iconClass: r, shouldShowIcon: e };
|
|
539
542
|
}
|
|
540
|
-
function
|
|
543
|
+
function lt(r) {
|
|
541
544
|
function e(p) {
|
|
542
|
-
const
|
|
545
|
+
const a = {
|
|
543
546
|
"dropdown-menu": !0
|
|
544
547
|
};
|
|
545
548
|
if (p.class) {
|
|
546
549
|
const d = p.menuClass.split(" ");
|
|
547
|
-
d && d.length && d.reduce((
|
|
550
|
+
d && d.length && d.reduce((s, y) => (s[y] = !0, s), a);
|
|
548
551
|
}
|
|
549
|
-
return
|
|
552
|
+
return a;
|
|
550
553
|
}
|
|
551
554
|
function n(p) {
|
|
552
|
-
const
|
|
555
|
+
const a = {
|
|
553
556
|
disabled: !p.enable,
|
|
554
557
|
"dropdown-submenu": !0,
|
|
555
558
|
"f-rt-dropdown": !0
|
|
556
559
|
}, d = p.dropdownClass.split(" ");
|
|
557
|
-
return d && d.length && d.reduce((
|
|
560
|
+
return d && d.length && d.reduce((s, y) => (s[y] = !0, s), a), a;
|
|
558
561
|
}
|
|
559
|
-
function
|
|
560
|
-
const
|
|
562
|
+
function c(p) {
|
|
563
|
+
const a = {
|
|
561
564
|
disabled: !p.enable,
|
|
562
565
|
"dropdown-item": !0,
|
|
563
566
|
"f-rt-btn": !0
|
|
564
567
|
}, d = p.class.split(" ");
|
|
565
|
-
return d && d.length && d.reduce((
|
|
568
|
+
return d && d.length && d.reduce((s, y) => (s[y] = !0, s), a), a;
|
|
566
569
|
}
|
|
567
570
|
let u;
|
|
568
|
-
const
|
|
569
|
-
function
|
|
570
|
-
var
|
|
571
|
-
((
|
|
572
|
-
const
|
|
573
|
-
if (
|
|
574
|
-
const
|
|
575
|
-
|
|
571
|
+
const m = /* @__PURE__ */ new Map();
|
|
572
|
+
function v(p, a, d) {
|
|
573
|
+
var y;
|
|
574
|
+
((y = p.target) == null ? void 0 : y.id) === a.id && p.stopPropagation();
|
|
575
|
+
const s = d ? d.id : "__top_item__";
|
|
576
|
+
if (a.children && a.children.length && (a.expanded = !a.expanded, a.expanded ? m.set(s, a) : m.delete(s)), m.has(s) && m.get(s) !== a) {
|
|
577
|
+
const h = m.get(s);
|
|
578
|
+
h && (h.expanded = !1);
|
|
576
579
|
}
|
|
577
580
|
}
|
|
578
|
-
function
|
|
579
|
-
document.body.click(),
|
|
581
|
+
function M(p, a) {
|
|
582
|
+
document.body.click(), a.enable && a.onClick(p, a.id);
|
|
580
583
|
}
|
|
581
584
|
function S(p) {
|
|
582
|
-
return p.children.map((
|
|
583
|
-
class: n(
|
|
584
|
-
id:
|
|
585
|
-
onClick: (d) =>
|
|
585
|
+
return p.children.map((a) => a.children && a.children.length ? w("li", {
|
|
586
|
+
class: n(a),
|
|
587
|
+
id: a.id,
|
|
588
|
+
onClick: (d) => a.enable && v(d, a, p)
|
|
586
589
|
}, [w("span", {
|
|
587
|
-
id:
|
|
588
|
-
class: a
|
|
589
|
-
onMouseover: (d) =>
|
|
590
|
-
}, [
|
|
590
|
+
id: a.id,
|
|
591
|
+
class: c(a),
|
|
592
|
+
onMouseover: (d) => a.enable && v(d, a, p)
|
|
593
|
+
}, [a.text, w("i", {
|
|
591
594
|
class: "f-icon f-icon-arrow-chevron-right",
|
|
592
595
|
style: "display: inline-block;float: right;line-height: 1.25rem;"
|
|
593
|
-
}, null)]), u(
|
|
594
|
-
class: a
|
|
595
|
-
id:
|
|
596
|
-
onClick: (d) =>
|
|
597
|
-
onMouseover: (d) =>
|
|
598
|
-
}, [
|
|
599
|
-
class:
|
|
600
|
-
}, null),
|
|
601
|
-
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
596
|
+
}, null)]), u(a, a)]) : w("li", {
|
|
597
|
+
class: c(a),
|
|
598
|
+
id: a.id,
|
|
599
|
+
onClick: (d) => M(d, a),
|
|
600
|
+
onMouseover: (d) => a.enable && v(d, a, p)
|
|
601
|
+
}, [r.shouldShowIcon(a) && w("i", {
|
|
602
|
+
class: r.iconClass(a)
|
|
603
|
+
}, null), a.text]));
|
|
604
|
+
}
|
|
605
|
+
function g(p, a, d) {
|
|
606
|
+
const s = {
|
|
604
607
|
display: p.expanded ? "block" : "none",
|
|
605
608
|
position: "fixed",
|
|
606
609
|
maxWidth: "300px",
|
|
607
610
|
width: "auto",
|
|
608
611
|
minWidth: "120px"
|
|
609
|
-
},
|
|
610
|
-
if (
|
|
612
|
+
}, y = document.getElementsByTagName("body")[0].getClientRects()[0].width, h = a, x = h == null ? void 0 : h.getClientRects();
|
|
613
|
+
if (h && x && x.length) {
|
|
611
614
|
const {
|
|
612
615
|
top: O,
|
|
613
|
-
width:
|
|
616
|
+
width: P,
|
|
614
617
|
left: A,
|
|
615
618
|
right: N,
|
|
616
619
|
height: D
|
|
617
620
|
} = x[0], b = Math.ceil(D + O);
|
|
618
|
-
|
|
619
|
-
const
|
|
621
|
+
s.top = `${b}px`, s.left = `${A}px`;
|
|
622
|
+
const k = p.id + "_menu", E = a ? a.querySelector("#" + k) : null;
|
|
620
623
|
if (E) {
|
|
621
|
-
|
|
624
|
+
s.display === "block" && (E.style.display = "block");
|
|
622
625
|
const l = E.getBoundingClientRect();
|
|
623
626
|
if (d) {
|
|
624
|
-
|
|
625
|
-
const o = Math.ceil(
|
|
626
|
-
|
|
627
|
+
s.top = `${O - 6}px`;
|
|
628
|
+
const o = Math.ceil(P + A);
|
|
629
|
+
s.left = `${o}px`;
|
|
627
630
|
}
|
|
628
|
-
|
|
631
|
+
y - A - P < l.width && (s.left = `${(d ? A : N) - l.width}px`);
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
|
-
return
|
|
634
|
+
return s;
|
|
632
635
|
}
|
|
633
|
-
u = function(p,
|
|
634
|
-
var
|
|
635
|
-
const d = de(),
|
|
636
|
+
u = function(p, a) {
|
|
637
|
+
var h, x;
|
|
638
|
+
const d = de(), s = a ? a.id : p.id, y = (x = (h = d == null ? void 0 : d.exposed) == null ? void 0 : h.elementRef.value) == null ? void 0 : x.querySelector("#" + s);
|
|
636
639
|
return w("ul", {
|
|
637
640
|
class: e(p),
|
|
638
|
-
style:
|
|
641
|
+
style: g(p, y, a),
|
|
639
642
|
id: p.id + "_menu"
|
|
640
643
|
}, [S(p)]);
|
|
641
644
|
};
|
|
642
|
-
function
|
|
643
|
-
|
|
645
|
+
function C() {
|
|
646
|
+
m.forEach((p) => {
|
|
644
647
|
p.expanded = !1;
|
|
645
|
-
}),
|
|
648
|
+
}), m.clear();
|
|
646
649
|
}
|
|
647
650
|
return {
|
|
648
651
|
renderDropdownMenu: u,
|
|
649
|
-
clearAllDropDownMenu:
|
|
652
|
+
clearAllDropDownMenu: C
|
|
650
653
|
};
|
|
651
654
|
}
|
|
652
|
-
function
|
|
653
|
-
const n =
|
|
654
|
-
renderDropdownMenu:
|
|
655
|
+
function pt(r, e) {
|
|
656
|
+
const n = j(r.alignment), {
|
|
657
|
+
renderDropdownMenu: c,
|
|
655
658
|
clearAllDropDownMenu: u
|
|
656
|
-
} =
|
|
657
|
-
function
|
|
659
|
+
} = lt(e);
|
|
660
|
+
function m(C) {
|
|
658
661
|
const p = {
|
|
659
662
|
"btn-group": !0,
|
|
660
663
|
"f-rt-dropdown": !0,
|
|
661
664
|
"f-btn-ml": n.value === "right",
|
|
662
665
|
"f-btn-mr": n.value === "left"
|
|
663
|
-
},
|
|
664
|
-
return
|
|
666
|
+
}, a = C.dropdownClass.split(" ");
|
|
667
|
+
return a && a.length && a.reduce((d, s) => (d[s] = !0, d), p), p;
|
|
665
668
|
}
|
|
666
|
-
function C
|
|
669
|
+
function v(C) {
|
|
667
670
|
const p = {
|
|
668
671
|
btn: !0,
|
|
669
|
-
disabled: !
|
|
672
|
+
disabled: !C.enable,
|
|
670
673
|
"f-rt-btn": !0,
|
|
671
|
-
"btn-icontext": !!(
|
|
674
|
+
"btn-icontext": !!(C.icon && C.icon.trim())
|
|
672
675
|
};
|
|
673
|
-
if (
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
+
if (C.class) {
|
|
677
|
+
const a = C.class.split(" ");
|
|
678
|
+
a && a.length && a.reduce((d, s) => (d[s] = !0, d), p);
|
|
676
679
|
}
|
|
677
680
|
return p;
|
|
678
681
|
}
|
|
679
|
-
function
|
|
680
|
-
|
|
681
|
-
const
|
|
682
|
-
document.body.click(), p.expanded = !
|
|
682
|
+
function M(C, p) {
|
|
683
|
+
C.stopPropagation();
|
|
684
|
+
const a = p.expanded;
|
|
685
|
+
document.body.click(), p.expanded = !a;
|
|
683
686
|
}
|
|
684
|
-
function S(
|
|
687
|
+
function S(C) {
|
|
685
688
|
return w("div", {
|
|
686
|
-
id:
|
|
687
|
-
class:
|
|
689
|
+
id: C.id,
|
|
690
|
+
class: m(C)
|
|
688
691
|
}, [w("div", {
|
|
689
|
-
class: C
|
|
692
|
+
class: v(C),
|
|
690
693
|
style: "display: flex;padding-right: 0.1rem;border-top-right-radius: 6px;border-bottom-right-radius: 6px",
|
|
691
|
-
onClick: (p) =>
|
|
692
|
-
}, [e.shouldShowIcon(
|
|
693
|
-
class: e.iconClass(
|
|
694
|
-
}, null), w("span", null, [
|
|
694
|
+
onClick: (p) => C.enable && M(p, C)
|
|
695
|
+
}, [e.shouldShowIcon(C) && w("i", {
|
|
696
|
+
class: e.iconClass(C)
|
|
697
|
+
}, null), w("span", null, [C.text]), w("i", {
|
|
695
698
|
class: "f-icon f-icon-arrow-chevron-down",
|
|
696
699
|
style: "display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"
|
|
697
|
-
}, null)]),
|
|
700
|
+
}, null)]), c(C)]);
|
|
698
701
|
}
|
|
699
|
-
function
|
|
702
|
+
function g() {
|
|
700
703
|
u();
|
|
701
704
|
}
|
|
702
705
|
return {
|
|
703
706
|
renderToolbarDropdown: S,
|
|
704
|
-
clearAllDropDown:
|
|
707
|
+
clearAllDropDown: g
|
|
705
708
|
};
|
|
706
709
|
}
|
|
707
710
|
const {
|
|
@@ -709,173 +712,173 @@ const {
|
|
|
709
712
|
} = ge(), X = /* @__PURE__ */ Y({
|
|
710
713
|
name: "FResponseToolbar",
|
|
711
714
|
props: se,
|
|
712
|
-
emits: [],
|
|
713
|
-
setup(
|
|
714
|
-
const n =
|
|
715
|
+
emits: ["click"],
|
|
716
|
+
setup(r, e) {
|
|
717
|
+
const n = j(pe(r.items)), c = j(), u = j(), m = j(), v = j(r.alignment), M = {
|
|
715
718
|
id: "__more_buttons__",
|
|
716
719
|
text: "更多"
|
|
717
|
-
}, S =
|
|
720
|
+
}, S = j(new G(M)), g = Te(), C = z(() => S.value.children.length > 0), p = z(() => {
|
|
718
721
|
const b = {
|
|
719
722
|
"f-toolbar": !0,
|
|
720
723
|
"f-response-toolbar": !0,
|
|
721
724
|
"position-relative": !0
|
|
722
725
|
};
|
|
723
|
-
if (
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
+
if (r.customClass) {
|
|
727
|
+
const k = r.customClass.split(" ");
|
|
728
|
+
k && k.length && k.reduce((E, l) => (E[l] = !0, E), b);
|
|
726
729
|
}
|
|
727
730
|
return b;
|
|
728
|
-
}),
|
|
731
|
+
}), a = z(() => ({
|
|
729
732
|
"d-flex": !0,
|
|
730
733
|
"flex-nowrap": !0,
|
|
731
|
-
"justify-content-end":
|
|
732
|
-
"justify-content-start":
|
|
734
|
+
"justify-content-end": v.value === "right",
|
|
735
|
+
"justify-content-start": v.value === "left"
|
|
733
736
|
})), {
|
|
734
737
|
renderToolbarDropdown: d,
|
|
735
|
-
clearAllDropDown:
|
|
736
|
-
} =
|
|
737
|
-
function
|
|
738
|
+
clearAllDropDown: s
|
|
739
|
+
} = pt(r, g);
|
|
740
|
+
function y() {
|
|
738
741
|
n.value.filter((b) => b.children && b.children.length > 0).forEach((b) => {
|
|
739
742
|
b.expanded = !1;
|
|
740
|
-
}), S.value.expanded = !1,
|
|
743
|
+
}), S.value.expanded = !1, s();
|
|
741
744
|
}
|
|
742
|
-
function
|
|
743
|
-
const
|
|
745
|
+
function h(b) {
|
|
746
|
+
const k = {
|
|
744
747
|
btn: !0,
|
|
745
748
|
"f-rt-btn": !0,
|
|
746
|
-
"f-btn-ml":
|
|
747
|
-
"f-btn-mr":
|
|
749
|
+
"f-btn-ml": v.value === "right",
|
|
750
|
+
"f-btn-mr": v.value === "left",
|
|
748
751
|
"btn-icontext": !!(b.icon && b.icon.trim())
|
|
749
752
|
};
|
|
750
753
|
if (b.class) {
|
|
751
754
|
const E = b.class.split(" ");
|
|
752
|
-
E && E.length && E.reduce((l, o) => (l[o] = !0, l),
|
|
755
|
+
E && E.length && E.reduce((l, o) => (l[o] = !0, l), k);
|
|
753
756
|
}
|
|
754
|
-
return
|
|
757
|
+
return k;
|
|
755
758
|
}
|
|
756
|
-
function x(b,
|
|
757
|
-
document.body.click(),
|
|
759
|
+
function x(b, k) {
|
|
760
|
+
document.body.click(), k.onClick(b, k.id), e.emit("click", b, k.id);
|
|
758
761
|
}
|
|
759
762
|
function O(b) {
|
|
760
763
|
return w("button", {
|
|
761
764
|
type: "button",
|
|
762
|
-
class:
|
|
765
|
+
class: h(b),
|
|
763
766
|
id: b.id,
|
|
764
767
|
disabled: !b.enable,
|
|
765
|
-
onClick: (
|
|
766
|
-
}, [
|
|
767
|
-
class:
|
|
768
|
+
onClick: (k) => x(k, b)
|
|
769
|
+
}, [g.shouldShowIcon(b) && w("i", {
|
|
770
|
+
class: g.iconClass(b)
|
|
768
771
|
}, null), b.text]);
|
|
769
772
|
}
|
|
770
|
-
const
|
|
773
|
+
const P = /* @__PURE__ */ new Map(), A = [];
|
|
771
774
|
function N(b) {
|
|
772
|
-
const
|
|
775
|
+
const k = m.value;
|
|
773
776
|
let E = b;
|
|
774
|
-
const l = Array.from(
|
|
777
|
+
const l = Array.from(k.children), o = l[l.length - 1].id === "__more_buttons__" ? l[l.length - 1] : null;
|
|
775
778
|
if (o) {
|
|
776
|
-
const T = o.computedStyleMap().get("margin-left"),
|
|
779
|
+
const T = o.computedStyleMap().get("margin-left"), B = o.computedStyleMap().get("margin-right"), _ = (T ? T.value : 0) + o.getBoundingClientRect().width + (B ? B.value : 0);
|
|
777
780
|
E -= _;
|
|
778
781
|
}
|
|
779
782
|
const t = l.filter((T) => T.id !== "__more_buttons__");
|
|
780
783
|
for (const T of t) {
|
|
781
|
-
const
|
|
782
|
-
E < L ? (
|
|
784
|
+
const B = T.computedStyleMap().get("margin-left"), _ = T.computedStyleMap().get("margin-right"), L = (B ? B.value : 0) + T.getBoundingClientRect().width + (_ ? _.value : 0);
|
|
785
|
+
E < L ? (P.set(T.id, !0), A.push({
|
|
783
786
|
id: T.id,
|
|
784
787
|
width: L
|
|
785
788
|
})) : E -= L;
|
|
786
789
|
}
|
|
787
790
|
if (A.length)
|
|
788
791
|
for (let T = A.length - 1; T >= 0; T--) {
|
|
789
|
-
const
|
|
790
|
-
if (E >=
|
|
791
|
-
E -=
|
|
792
|
+
const B = A[T].width;
|
|
793
|
+
if (E >= B)
|
|
794
|
+
E -= B, P.delete(A[T].id), A.pop();
|
|
792
795
|
else
|
|
793
796
|
break;
|
|
794
797
|
}
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
const f = new G(
|
|
798
|
+
const i = Object.assign({}, S.value);
|
|
799
|
+
i.children = [];
|
|
800
|
+
const f = new G(i), R = n.value.reduce((T, B) => (P.has(B.id) && f.children.push(B), B.visible = !P.has(B.id), T.push(B), T), []);
|
|
798
801
|
S.value = f, n.value = R;
|
|
799
802
|
}
|
|
800
803
|
const D = new ResizeObserver((b) => {
|
|
801
804
|
if (b.length) {
|
|
802
|
-
const E = b[0].contentRect.width, o =
|
|
803
|
-
(E < o || A.length) && (N(E),
|
|
805
|
+
const E = b[0].contentRect.width, o = m.value.getBoundingClientRect().width;
|
|
806
|
+
(E < o || A.length) && (N(E), y());
|
|
804
807
|
}
|
|
805
808
|
});
|
|
806
809
|
return H(() => {
|
|
807
810
|
const b = u.value;
|
|
808
|
-
D.observe(b), document.body.addEventListener("click",
|
|
811
|
+
D.observe(b), document.body.addEventListener("click", y), document.body.addEventListener("wheel", y);
|
|
809
812
|
}), ne(() => {
|
|
810
|
-
D.disconnect(), document.body.removeEventListener("click",
|
|
811
|
-
}), Q(() =>
|
|
812
|
-
n.value = pe(
|
|
813
|
+
D.disconnect(), document.body.removeEventListener("click", y), document.body.removeEventListener("wheel", y);
|
|
814
|
+
}), Q(() => r.items, () => {
|
|
815
|
+
n.value = pe(r.items);
|
|
813
816
|
}, {
|
|
814
817
|
deep: !0
|
|
815
818
|
}), e.expose({
|
|
816
|
-
elementRef:
|
|
819
|
+
elementRef: c
|
|
817
820
|
}), () => w("div", {
|
|
818
821
|
class: p.value,
|
|
819
|
-
ref:
|
|
822
|
+
ref: c
|
|
820
823
|
}, [w("div", {
|
|
821
824
|
ref: u,
|
|
822
|
-
class:
|
|
825
|
+
class: a.value
|
|
823
826
|
}, [w("div", {
|
|
824
|
-
ref:
|
|
827
|
+
ref: m,
|
|
825
828
|
class: "d-inline-block f-response-content",
|
|
826
829
|
style: "white-space: nowrap;"
|
|
827
|
-
}, [n.value.filter((b) => b.visible).map((b) => b.children && b.children.length > 0 ? d(b) : O(b)),
|
|
830
|
+
}, [n.value.filter((b) => b.visible).map((b) => b.children && b.children.length > 0 ? d(b) : O(b)), C.value && d(S.value)])])]);
|
|
828
831
|
}
|
|
829
832
|
});
|
|
830
|
-
function
|
|
831
|
-
const n = $("design-item-context"),
|
|
833
|
+
function dt(r, e) {
|
|
834
|
+
const n = $("design-item-context"), c = $("toolbar-item-handler", () => {
|
|
832
835
|
});
|
|
833
836
|
function u() {
|
|
834
|
-
|
|
837
|
+
c && c();
|
|
835
838
|
}
|
|
836
|
-
function
|
|
839
|
+
function m(o) {
|
|
837
840
|
const t = {
|
|
838
841
|
"dropdown-menu": !0
|
|
839
842
|
};
|
|
840
843
|
if (o.class) {
|
|
841
|
-
const
|
|
842
|
-
|
|
844
|
+
const i = o.menuClass.split(" ");
|
|
845
|
+
i && i.length && i.reduce((f, R) => (f[R] = !0, f), t);
|
|
843
846
|
}
|
|
844
847
|
return t;
|
|
845
848
|
}
|
|
846
|
-
function
|
|
849
|
+
function v(o) {
|
|
847
850
|
const t = {
|
|
848
851
|
disabled: !o.enable,
|
|
849
852
|
"dropdown-submenu": !0,
|
|
850
853
|
"f-rt-dropdown": !0
|
|
851
|
-
},
|
|
852
|
-
return
|
|
854
|
+
}, i = o.dropdownClass.split(" ");
|
|
855
|
+
return i && i.length && i.reduce((f, R) => (f[R] = !0, f), t), t;
|
|
853
856
|
}
|
|
854
|
-
function
|
|
857
|
+
function M(o) {
|
|
855
858
|
const t = {
|
|
856
859
|
disabled: !o.enable,
|
|
857
860
|
"dropdown-item": !0,
|
|
858
861
|
"f-rt-btn": !0,
|
|
859
862
|
"position-relative": !0,
|
|
860
863
|
"farris-component": !0
|
|
861
|
-
},
|
|
862
|
-
return
|
|
864
|
+
}, i = o.class.split(" ");
|
|
865
|
+
return i && i.length && i.reduce((f, R) => (f[R] = !0, f), t), t;
|
|
863
866
|
}
|
|
864
867
|
let S;
|
|
865
|
-
const
|
|
866
|
-
function
|
|
868
|
+
const g = /* @__PURE__ */ new Map();
|
|
869
|
+
function C(o, t, i) {
|
|
867
870
|
var R;
|
|
868
871
|
((R = o.target) == null ? void 0 : R.id) === t.id && o.stopPropagation();
|
|
869
|
-
const f =
|
|
870
|
-
if (t.children && t.children.length && (t.expanded = !t.expanded, t.expanded ?
|
|
871
|
-
const T =
|
|
872
|
+
const f = i ? i.id : "__top_item__";
|
|
873
|
+
if (t.children && t.children.length && (t.expanded = !t.expanded, t.expanded ? g.set(f, t) : g.delete(f)), g.has(f) && g.get(f) !== t) {
|
|
874
|
+
const T = g.get(f);
|
|
872
875
|
T && (T.expanded = !1);
|
|
873
876
|
}
|
|
874
877
|
}
|
|
875
878
|
function p(o) {
|
|
876
879
|
o && (o.stopPropagation(), o.preventDefault());
|
|
877
880
|
}
|
|
878
|
-
function
|
|
881
|
+
function a() {
|
|
879
882
|
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((t) => t.classList.remove("dgComponentFocused"));
|
|
880
883
|
const o = document.getElementsByClassName("dgComponentSelected");
|
|
881
884
|
Array.from(o).forEach((t) => t.classList.remove("dgComponentSelected"));
|
|
@@ -883,43 +886,43 @@ function pt(i, e) {
|
|
|
883
886
|
function d(o) {
|
|
884
887
|
o.currentTarget.classList.add("dgComponentFocused", "dgComponentSelected");
|
|
885
888
|
}
|
|
886
|
-
function
|
|
889
|
+
function s(o) {
|
|
887
890
|
const {
|
|
888
891
|
buttons: t = []
|
|
889
892
|
} = n.schema;
|
|
890
|
-
let
|
|
893
|
+
let i = [];
|
|
891
894
|
t.forEach((T) => {
|
|
892
|
-
|
|
895
|
+
i = i.concat(T.children || []);
|
|
893
896
|
});
|
|
894
|
-
const f =
|
|
897
|
+
const f = i.findIndex((T) => T.id === o), R = f === -1 ? null : i[f];
|
|
895
898
|
return {
|
|
896
899
|
index: f,
|
|
897
900
|
item: R
|
|
898
901
|
};
|
|
899
902
|
}
|
|
900
|
-
function
|
|
903
|
+
function y(o) {
|
|
901
904
|
const {
|
|
902
905
|
buttons: t = []
|
|
903
|
-
} = n.schema,
|
|
906
|
+
} = n.schema, i = t.findIndex((R) => R.id === o), f = i === -1 ? null : t[i];
|
|
904
907
|
return {
|
|
905
|
-
index:
|
|
908
|
+
index: i,
|
|
906
909
|
item: f
|
|
907
910
|
};
|
|
908
911
|
}
|
|
909
|
-
function
|
|
912
|
+
function h(o) {
|
|
910
913
|
var f;
|
|
911
914
|
n.schema;
|
|
912
915
|
const {
|
|
913
916
|
index: t,
|
|
914
|
-
item:
|
|
915
|
-
} =
|
|
916
|
-
(f = n == null ? void 0 : n.setupContext) == null || f.emit("selectionChange",
|
|
917
|
+
item: i
|
|
918
|
+
} = s(o);
|
|
919
|
+
(f = n == null ? void 0 : n.setupContext) == null || f.emit("selectionChange", i == null ? void 0 : i.type, i);
|
|
917
920
|
}
|
|
918
921
|
const x = function(o) {
|
|
919
922
|
const {
|
|
920
923
|
componentType: t
|
|
921
|
-
} = o,
|
|
922
|
-
return
|
|
924
|
+
} = o, i = q(t, o), f = t.toLowerCase().replace("-", "_");
|
|
925
|
+
return i && !i.id && i.type === t && (i.id = `${f}_${Math.random().toString().slice(2, 6)}`), i;
|
|
923
926
|
}, O = function() {
|
|
924
927
|
const o = {
|
|
925
928
|
componentType: "response-toolbar-item",
|
|
@@ -928,56 +931,56 @@ function pt(i, e) {
|
|
|
928
931
|
};
|
|
929
932
|
return x(o);
|
|
930
933
|
};
|
|
931
|
-
function
|
|
932
|
-
p(o),
|
|
934
|
+
function P(o, t) {
|
|
935
|
+
p(o), a(), d(o), h(t.id);
|
|
933
936
|
}
|
|
934
|
-
function A(o, t,
|
|
937
|
+
function A(o, t, i) {
|
|
935
938
|
p(o);
|
|
936
|
-
const f = t.id, R =
|
|
939
|
+
const f = t.id, R = i && i.id, {
|
|
937
940
|
buttons: T = []
|
|
938
941
|
} = n.schema;
|
|
939
942
|
if (!R)
|
|
940
943
|
return;
|
|
941
944
|
const {
|
|
942
|
-
index:
|
|
943
|
-
} =
|
|
944
|
-
if (
|
|
945
|
+
index: B
|
|
946
|
+
} = y(R);
|
|
947
|
+
if (B === -1)
|
|
945
948
|
return;
|
|
946
949
|
const {
|
|
947
950
|
index: _
|
|
948
|
-
} =
|
|
949
|
-
_ !== -1 && (T[
|
|
951
|
+
} = s(f);
|
|
952
|
+
_ !== -1 && (T[B].children.splice(_, 1), u());
|
|
950
953
|
}
|
|
951
|
-
function N(o, t,
|
|
954
|
+
function N(o, t, i) {
|
|
952
955
|
p(o);
|
|
953
|
-
const f =
|
|
956
|
+
const f = i && i.id, {
|
|
954
957
|
buttons: R = []
|
|
955
958
|
} = n.schema;
|
|
956
959
|
if (!f)
|
|
957
960
|
return;
|
|
958
961
|
const {
|
|
959
962
|
index: T
|
|
960
|
-
} =
|
|
963
|
+
} = y(f);
|
|
961
964
|
if (T === -1)
|
|
962
965
|
return;
|
|
963
|
-
const
|
|
966
|
+
const B = O(), _ = Object.assign({}, B, {
|
|
964
967
|
text: t.text
|
|
965
968
|
});
|
|
966
969
|
R[T].children.push(_), u();
|
|
967
970
|
}
|
|
968
|
-
function D(o, t,
|
|
971
|
+
function D(o, t, i) {
|
|
969
972
|
p(o);
|
|
970
|
-
const f =
|
|
973
|
+
const f = i && i.id, {
|
|
971
974
|
buttons: R = []
|
|
972
975
|
} = n.schema;
|
|
973
976
|
if (!f)
|
|
974
977
|
return;
|
|
975
978
|
const {
|
|
976
979
|
index: T
|
|
977
|
-
} =
|
|
980
|
+
} = y(f);
|
|
978
981
|
if (T === -1)
|
|
979
982
|
return;
|
|
980
|
-
const
|
|
983
|
+
const B = O(), _ = Object.assign({}, B, {
|
|
981
984
|
text: "按钮"
|
|
982
985
|
});
|
|
983
986
|
R[T].children.push(_), u();
|
|
@@ -991,7 +994,7 @@ function pt(i, e) {
|
|
|
991
994
|
title: "删除",
|
|
992
995
|
ref: "removeButton",
|
|
993
996
|
style: "position:static;",
|
|
994
|
-
onClick: (
|
|
997
|
+
onClick: (i) => A(i, o, t)
|
|
995
998
|
}, [w("i", {
|
|
996
999
|
class: "f-icon f-icon-yxs_delete"
|
|
997
1000
|
}, null)]), w("div", {
|
|
@@ -1000,7 +1003,7 @@ function pt(i, e) {
|
|
|
1000
1003
|
title: "复制",
|
|
1001
1004
|
ref: "copyButton",
|
|
1002
1005
|
style: "position:static;",
|
|
1003
|
-
onClick: (
|
|
1006
|
+
onClick: (i) => N(i, o, t)
|
|
1004
1007
|
}, [w("i", {
|
|
1005
1008
|
class: "f-icon f-icon-yxs_copy"
|
|
1006
1009
|
}, null)]), w("div", {
|
|
@@ -1009,102 +1012,102 @@ function pt(i, e) {
|
|
|
1009
1012
|
title: "新增同级",
|
|
1010
1013
|
ref: "appendSame",
|
|
1011
1014
|
style: "width:85px!important;padding:0 5px;position:static;",
|
|
1012
|
-
onClick: (
|
|
1015
|
+
onClick: (i) => D(i, o, t)
|
|
1013
1016
|
}, [w("i", {
|
|
1014
1017
|
class: "f-icon f-icon-plus-circle text-white mr-1"
|
|
1015
1018
|
}, null), w("span", {
|
|
1016
1019
|
style: "font-size:13px;margin:auto"
|
|
1017
1020
|
}, [ue("新增同级")])])])]);
|
|
1018
1021
|
}
|
|
1019
|
-
function
|
|
1022
|
+
function k(o) {
|
|
1020
1023
|
return o.children.map((t) => t.children && t.children.length ? w("li", {
|
|
1021
|
-
class:
|
|
1024
|
+
class: v(t),
|
|
1022
1025
|
id: t.id,
|
|
1023
|
-
onClick: (
|
|
1026
|
+
onClick: (i) => t.enable && C(i, t, o)
|
|
1024
1027
|
}, [w("span", {
|
|
1025
1028
|
id: t.id,
|
|
1026
|
-
class:
|
|
1027
|
-
onMouseover: (
|
|
1029
|
+
class: M(t),
|
|
1030
|
+
onMouseover: (i) => t.enable && C(i, t, o)
|
|
1028
1031
|
}, [t.text, w("i", {
|
|
1029
1032
|
class: "f-icon f-icon-arrow-chevron-right",
|
|
1030
1033
|
style: "display: inline-block;float: right;line-height: 1.25rem;"
|
|
1031
1034
|
}, null)]), S(t, t)]) : w("li", {
|
|
1032
|
-
class:
|
|
1035
|
+
class: M(t),
|
|
1033
1036
|
id: t.id,
|
|
1034
|
-
onClick: (
|
|
1035
|
-
}, [b(t, o),
|
|
1036
|
-
class:
|
|
1037
|
+
onClick: (i) => P(i, t)
|
|
1038
|
+
}, [b(t, o), r.shouldShowIcon(t) && w("i", {
|
|
1039
|
+
class: r.iconClass(t)
|
|
1037
1040
|
}, null), t.text]));
|
|
1038
1041
|
}
|
|
1039
|
-
function E(o, t,
|
|
1042
|
+
function E(o, t, i) {
|
|
1040
1043
|
const f = {
|
|
1041
1044
|
display: o.expanded ? "block" : "none",
|
|
1042
1045
|
position: "fixed",
|
|
1043
1046
|
maxWidth: "300px",
|
|
1044
1047
|
width: "auto",
|
|
1045
1048
|
minWidth: "120px"
|
|
1046
|
-
}, R = document.getElementsByTagName("body")[0].getClientRects()[0].width, T = t,
|
|
1047
|
-
if (T &&
|
|
1049
|
+
}, R = document.getElementsByTagName("body")[0].getClientRects()[0].width, T = t, B = T == null ? void 0 : T.getClientRects();
|
|
1050
|
+
if (T && B && B.length) {
|
|
1048
1051
|
const {
|
|
1049
1052
|
top: _,
|
|
1050
1053
|
width: L,
|
|
1051
1054
|
left: V,
|
|
1052
|
-
right:
|
|
1053
|
-
height:
|
|
1054
|
-
} =
|
|
1055
|
+
right: W,
|
|
1056
|
+
height: U
|
|
1057
|
+
} = B[0], Z = Math.ceil(U + _);
|
|
1055
1058
|
f.top = `${Z}px`, f.left = `${V}px`;
|
|
1056
|
-
const
|
|
1059
|
+
const Ie = o.id + "_menu", K = t ? t.querySelector("#" + Ie) : null;
|
|
1057
1060
|
if (K) {
|
|
1058
1061
|
f.display === "block" && (K.style.display = "block");
|
|
1059
1062
|
const ce = K.getBoundingClientRect();
|
|
1060
|
-
if (
|
|
1063
|
+
if (i) {
|
|
1061
1064
|
f.top = `${_ - 6}px`;
|
|
1062
|
-
const
|
|
1063
|
-
f.left = `${
|
|
1065
|
+
const Me = Math.ceil(L + V);
|
|
1066
|
+
f.left = `${Me}px`;
|
|
1064
1067
|
}
|
|
1065
|
-
R - V - L < ce.width && (f.left = `${(
|
|
1068
|
+
R - V - L < ce.width && (f.left = `${(i ? V : W) - ce.width}px`);
|
|
1066
1069
|
}
|
|
1067
1070
|
}
|
|
1068
1071
|
return f;
|
|
1069
1072
|
}
|
|
1070
1073
|
S = function(o, t) {
|
|
1071
|
-
var T,
|
|
1072
|
-
const
|
|
1074
|
+
var T, B;
|
|
1075
|
+
const i = de(), f = t ? t.id : o.id, R = (B = (T = i == null ? void 0 : i.exposed) == null ? void 0 : T.elementRef.value) == null ? void 0 : B.querySelector("#" + f);
|
|
1073
1076
|
return w("ul", {
|
|
1074
|
-
class:
|
|
1077
|
+
class: m(o),
|
|
1075
1078
|
style: E(o, R, t),
|
|
1076
1079
|
id: o.id + "_menu"
|
|
1077
|
-
}, [
|
|
1080
|
+
}, [k(o)]);
|
|
1078
1081
|
};
|
|
1079
1082
|
function l() {
|
|
1080
|
-
|
|
1083
|
+
g.forEach((o) => {
|
|
1081
1084
|
o.expanded = !1;
|
|
1082
|
-
}),
|
|
1085
|
+
}), g.clear();
|
|
1083
1086
|
}
|
|
1084
1087
|
return {
|
|
1085
1088
|
renderDropdownMenu: S,
|
|
1086
1089
|
clearAllDropDownMenu: l
|
|
1087
1090
|
};
|
|
1088
1091
|
}
|
|
1089
|
-
function
|
|
1090
|
-
const
|
|
1092
|
+
function ut(r, e, n) {
|
|
1093
|
+
const c = j(r.alignment), {
|
|
1091
1094
|
renderDropdownMenu: u,
|
|
1092
|
-
clearAllDropDownMenu:
|
|
1093
|
-
} =
|
|
1095
|
+
clearAllDropDownMenu: m
|
|
1096
|
+
} = dt(e, n), v = $("design-item-context"), M = $("toolbar-item-handler", () => {
|
|
1094
1097
|
});
|
|
1095
1098
|
function S() {
|
|
1096
|
-
|
|
1099
|
+
M && M();
|
|
1097
1100
|
}
|
|
1098
|
-
function
|
|
1101
|
+
function g(l) {
|
|
1099
1102
|
const o = {
|
|
1100
1103
|
"btn-group": !0,
|
|
1101
1104
|
"f-rt-dropdown": !0,
|
|
1102
|
-
"f-btn-ml":
|
|
1103
|
-
"f-btn-mr":
|
|
1105
|
+
"f-btn-ml": c.value === "right",
|
|
1106
|
+
"f-btn-mr": c.value === "left"
|
|
1104
1107
|
}, t = l.dropdownClass.split(" ");
|
|
1105
|
-
return t && t.length && t.reduce((
|
|
1108
|
+
return t && t.length && t.reduce((i, f) => (i[f] = !0, i), o), o;
|
|
1106
1109
|
}
|
|
1107
|
-
function
|
|
1110
|
+
function C(l) {
|
|
1108
1111
|
const o = {
|
|
1109
1112
|
btn: !0,
|
|
1110
1113
|
disabled: !l.enable,
|
|
@@ -1115,14 +1118,14 @@ function dt(i, e, n) {
|
|
|
1115
1118
|
};
|
|
1116
1119
|
if (l.class) {
|
|
1117
1120
|
const t = l.class.split(" ");
|
|
1118
|
-
t && t.length && t.reduce((
|
|
1121
|
+
t && t.length && t.reduce((i, f) => (i[f] = !0, i), o);
|
|
1119
1122
|
}
|
|
1120
1123
|
return o;
|
|
1121
1124
|
}
|
|
1122
1125
|
function p(l) {
|
|
1123
1126
|
l && (l.stopPropagation(), l.preventDefault());
|
|
1124
1127
|
}
|
|
1125
|
-
function
|
|
1128
|
+
function a(l, o) {
|
|
1126
1129
|
p(l);
|
|
1127
1130
|
const t = o.expanded;
|
|
1128
1131
|
document.body.click(), o.expanded = !t;
|
|
@@ -1130,9 +1133,9 @@ function dt(i, e, n) {
|
|
|
1130
1133
|
const d = function(l) {
|
|
1131
1134
|
const {
|
|
1132
1135
|
componentType: o
|
|
1133
|
-
} = l, t = q(o, l),
|
|
1134
|
-
return t && !t.id && t.type === o && (t.id = `${
|
|
1135
|
-
},
|
|
1136
|
+
} = l, t = q(o, l), i = o.toLowerCase().replace("-", "_");
|
|
1137
|
+
return t && !t.id && t.type === o && (t.id = `${i}_${Math.random().toString().slice(2, 6)}`), t;
|
|
1138
|
+
}, s = function() {
|
|
1136
1139
|
const l = {
|
|
1137
1140
|
componentType: "response-toolbar-item",
|
|
1138
1141
|
parentComponentInstance: n.value,
|
|
@@ -1140,43 +1143,43 @@ function dt(i, e, n) {
|
|
|
1140
1143
|
};
|
|
1141
1144
|
return d(l);
|
|
1142
1145
|
};
|
|
1143
|
-
function
|
|
1144
|
-
const o =
|
|
1146
|
+
function y(l) {
|
|
1147
|
+
const o = v.schema.buttons || v.schema.contents, t = o == null ? void 0 : o.findIndex((f) => f.id === l), i = t === -1 ? null : o[t];
|
|
1145
1148
|
return {
|
|
1146
1149
|
index: t,
|
|
1147
|
-
toolbarItem:
|
|
1150
|
+
toolbarItem: i
|
|
1148
1151
|
};
|
|
1149
1152
|
}
|
|
1150
|
-
function
|
|
1151
|
-
var
|
|
1153
|
+
function h(l, o) {
|
|
1154
|
+
var B;
|
|
1152
1155
|
const {
|
|
1153
1156
|
index: t,
|
|
1154
|
-
toolbarItem:
|
|
1155
|
-
} =
|
|
1157
|
+
toolbarItem: i
|
|
1158
|
+
} = y(o);
|
|
1156
1159
|
if (t === -1)
|
|
1157
1160
|
return;
|
|
1158
|
-
const f =
|
|
1161
|
+
const f = i.text || "按钮", R = s(), T = Object.assign({}, R, {
|
|
1159
1162
|
text: f
|
|
1160
1163
|
});
|
|
1161
|
-
(
|
|
1164
|
+
(B = v.schema.buttons) == null || B.push(T), S();
|
|
1162
1165
|
}
|
|
1163
1166
|
function x(l, o) {
|
|
1164
1167
|
const {
|
|
1165
1168
|
index: t,
|
|
1166
|
-
toolbarItem:
|
|
1167
|
-
} =
|
|
1169
|
+
toolbarItem: i
|
|
1170
|
+
} = y(o);
|
|
1168
1171
|
if (t === -1)
|
|
1169
1172
|
return;
|
|
1170
|
-
const f =
|
|
1173
|
+
const f = i.text || "按钮", R = s(), T = Object.assign({}, R, {
|
|
1171
1174
|
text: f
|
|
1172
|
-
}),
|
|
1173
|
-
|
|
1175
|
+
}), B = v.schema.buttons[t].children || [];
|
|
1176
|
+
B.push(T), v.schema.buttons[t].children = B, S();
|
|
1174
1177
|
}
|
|
1175
1178
|
function O(l, o) {
|
|
1176
|
-
const t =
|
|
1177
|
-
|
|
1179
|
+
const t = v.schema.buttons || v.schema.contents, i = t == null ? void 0 : t.findIndex((f) => f.id === o);
|
|
1180
|
+
i !== -1 && (t.splice(i, 1), S());
|
|
1178
1181
|
}
|
|
1179
|
-
function
|
|
1182
|
+
function P(l) {
|
|
1180
1183
|
return w("div", {
|
|
1181
1184
|
class: "component-btn-group"
|
|
1182
1185
|
}, [w("div", null, [w("div", {
|
|
@@ -1194,7 +1197,7 @@ function dt(i, e, n) {
|
|
|
1194
1197
|
title: "复制",
|
|
1195
1198
|
ref: "copyButton",
|
|
1196
1199
|
style: "position:static;",
|
|
1197
|
-
onClick: (o) =>
|
|
1200
|
+
onClick: (o) => h(o, l)
|
|
1198
1201
|
}, [w("i", {
|
|
1199
1202
|
class: "f-icon f-icon-yxs_copy"
|
|
1200
1203
|
}, null)]), w("div", {
|
|
@@ -1220,24 +1223,24 @@ function dt(i, e, n) {
|
|
|
1220
1223
|
}
|
|
1221
1224
|
function D(l) {
|
|
1222
1225
|
var f;
|
|
1223
|
-
const o =
|
|
1226
|
+
const o = v.schema.buttons || v.schema.contents, t = o == null ? void 0 : o.findIndex((R) => R.id === l);
|
|
1224
1227
|
if (t === -1)
|
|
1225
1228
|
return;
|
|
1226
|
-
const
|
|
1227
|
-
(f =
|
|
1229
|
+
const i = o[t];
|
|
1230
|
+
(f = v == null ? void 0 : v.setupContext) == null || f.emit("selectionChange", "response-toolbar-item", i);
|
|
1228
1231
|
}
|
|
1229
1232
|
function b(l, o) {
|
|
1230
|
-
p(l), A(), N(l), p(l),
|
|
1233
|
+
p(l), A(), N(l), p(l), a(l, o), D(o.id);
|
|
1231
1234
|
}
|
|
1232
|
-
function
|
|
1235
|
+
function k(l) {
|
|
1233
1236
|
return w("div", {
|
|
1234
1237
|
id: l.id,
|
|
1235
|
-
class:
|
|
1238
|
+
class: g(l)
|
|
1236
1239
|
}, [w("div", {
|
|
1237
|
-
class:
|
|
1240
|
+
class: C(l),
|
|
1238
1241
|
style: "display: flex;padding-right: 0.1rem;",
|
|
1239
1242
|
onClick: (o) => l.enable && b(o, l)
|
|
1240
|
-
}, [
|
|
1243
|
+
}, [P(l.id), e.shouldShowIcon(l) && w("i", {
|
|
1241
1244
|
class: e.iconClass(l)
|
|
1242
1245
|
}, null), w("span", null, [l.text]), w("i", {
|
|
1243
1246
|
class: "f-icon f-icon-arrow-chevron-down",
|
|
@@ -1245,34 +1248,34 @@ function dt(i, e, n) {
|
|
|
1245
1248
|
}, null)]), u(l)]);
|
|
1246
1249
|
}
|
|
1247
1250
|
function E() {
|
|
1248
|
-
|
|
1251
|
+
m();
|
|
1249
1252
|
}
|
|
1250
1253
|
return {
|
|
1251
|
-
renderToolbarDropdown:
|
|
1254
|
+
renderToolbarDropdown: k,
|
|
1252
1255
|
clearAllDropDown: E
|
|
1253
1256
|
};
|
|
1254
1257
|
}
|
|
1255
|
-
function
|
|
1256
|
-
function
|
|
1257
|
-
var u,
|
|
1258
|
+
function ft() {
|
|
1259
|
+
function r(e) {
|
|
1260
|
+
var u, m;
|
|
1258
1261
|
if (!e)
|
|
1259
1262
|
return !1;
|
|
1260
1263
|
const n = ((u = e.targetContainer) == null ? void 0 : u.componentInstance) && e.targetContainer.componentInstance.value;
|
|
1261
1264
|
if (!n)
|
|
1262
1265
|
return !1;
|
|
1263
|
-
const
|
|
1266
|
+
const c = (m = n.schema.appearance) == null ? void 0 : m.class;
|
|
1264
1267
|
if (e.controlCategory === "input" || e.controlType === "form-group") {
|
|
1265
|
-
const
|
|
1266
|
-
if (n.schema.type !== "response-layout-item" && !
|
|
1268
|
+
const v = n.schema.type, M = (v === "response-form" || v === "content-container") && c && c.includes("farris-form");
|
|
1269
|
+
if (n.schema.type !== "response-layout-item" && !M)
|
|
1267
1270
|
return !1;
|
|
1268
1271
|
}
|
|
1269
1272
|
return e.controlType !== "field-set";
|
|
1270
1273
|
}
|
|
1271
1274
|
return {
|
|
1272
|
-
basalDragulaRuleForContainer:
|
|
1275
|
+
basalDragulaRuleForContainer: r
|
|
1273
1276
|
};
|
|
1274
1277
|
}
|
|
1275
|
-
const
|
|
1278
|
+
const mt = "https://json-schema.org/draft/2020-12/schema", gt = "https://farris-design.gitee.io/dragging-rules.schema.json", yt = "Dragging Rules", ht = "The rules of designer canvas", bt = "object", vt = {
|
|
1276
1279
|
"f-page": {
|
|
1277
1280
|
description: "The root class of page designed by farris.",
|
|
1278
1281
|
type: "object",
|
|
@@ -1836,108 +1839,109 @@ const ft = "https://json-schema.org/draft/2020-12/schema", mt = "https://farris-
|
|
|
1836
1839
|
description: "",
|
|
1837
1840
|
type: "object"
|
|
1838
1841
|
}
|
|
1839
|
-
},
|
|
1840
|
-
$schema:
|
|
1841
|
-
$id:
|
|
1842
|
-
title:
|
|
1843
|
-
description:
|
|
1844
|
-
type:
|
|
1845
|
-
properties:
|
|
1846
|
-
required:
|
|
1842
|
+
}, Ct = [], wt = {
|
|
1843
|
+
$schema: mt,
|
|
1844
|
+
$id: gt,
|
|
1845
|
+
title: yt,
|
|
1846
|
+
description: ht,
|
|
1847
|
+
type: bt,
|
|
1848
|
+
properties: vt,
|
|
1849
|
+
required: Ct
|
|
1847
1850
|
}, J = /* @__PURE__ */ new Map();
|
|
1848
1851
|
function xe() {
|
|
1849
|
-
function
|
|
1852
|
+
function r(s, y, h, x) {
|
|
1850
1853
|
var O;
|
|
1851
|
-
if (typeof
|
|
1852
|
-
return ((O = x[
|
|
1853
|
-
if (typeof
|
|
1854
|
-
const
|
|
1855
|
-
if (
|
|
1856
|
-
return Number(x[
|
|
1857
|
-
if (
|
|
1858
|
-
return Number(x[
|
|
1859
|
-
if (
|
|
1860
|
-
return Number(x[
|
|
1854
|
+
if (typeof h == "number")
|
|
1855
|
+
return ((O = x[s]) == null ? void 0 : O.length) === h;
|
|
1856
|
+
if (typeof h == "object") {
|
|
1857
|
+
const P = Object.keys(h)[0], A = h[P];
|
|
1858
|
+
if (P === "not")
|
|
1859
|
+
return Number(x[s].length) !== Number(A);
|
|
1860
|
+
if (P === "moreThan")
|
|
1861
|
+
return Number(x[s].length) >= Number(A);
|
|
1862
|
+
if (P === "lessThan")
|
|
1863
|
+
return Number(x[s].length) <= Number(A);
|
|
1861
1864
|
}
|
|
1862
1865
|
return !1;
|
|
1863
1866
|
}
|
|
1864
|
-
function e(
|
|
1865
|
-
return typeof
|
|
1867
|
+
function e(s, y, h, x) {
|
|
1868
|
+
return typeof h == "boolean" ? x.childrenClassList.includes(y) === !!h : !1;
|
|
1866
1869
|
}
|
|
1867
|
-
function n(
|
|
1868
|
-
return typeof
|
|
1870
|
+
function n(s, y, h, x) {
|
|
1871
|
+
return typeof h == "boolean" ? x.parentClassList.includes(y) === !!h : !1;
|
|
1869
1872
|
}
|
|
1870
|
-
function
|
|
1871
|
-
return typeof
|
|
1873
|
+
function c(s, y, h, x) {
|
|
1874
|
+
return typeof h == "boolean" ? x.parentClassList.includes(y) === !!h : !1;
|
|
1872
1875
|
}
|
|
1873
1876
|
const u = /* @__PURE__ */ new Map([
|
|
1874
|
-
["length",
|
|
1877
|
+
["length", r],
|
|
1875
1878
|
["hasChildren", e],
|
|
1876
|
-
["hasSibling",
|
|
1879
|
+
["hasSibling", c],
|
|
1877
1880
|
["hasParent", n]
|
|
1878
1881
|
]);
|
|
1879
|
-
function
|
|
1880
|
-
const
|
|
1881
|
-
return typeof
|
|
1882
|
+
function m(s, y) {
|
|
1883
|
+
const h = s;
|
|
1884
|
+
return typeof y == "number" ? [{ target: h, operator: "length", param: null, value: Number(y) }] : typeof y == "object" ? Object.keys(y).map((x) => {
|
|
1882
1885
|
if (x === "length")
|
|
1883
|
-
return { target:
|
|
1884
|
-
const O = x,
|
|
1885
|
-
return { target:
|
|
1886
|
+
return { target: h, operator: "length", param: null, value: y[x] };
|
|
1887
|
+
const O = x, P = y[x];
|
|
1888
|
+
return { target: h, operator: s === "children" ? "hasChildren" : s === "parent" ? "hasParent" : "hasSibling", param: O, value: P };
|
|
1886
1889
|
}) : [];
|
|
1887
1890
|
}
|
|
1888
|
-
function
|
|
1889
|
-
if (u.has(
|
|
1890
|
-
const
|
|
1891
|
-
return
|
|
1891
|
+
function v(s, y) {
|
|
1892
|
+
if (u.has(s.operator)) {
|
|
1893
|
+
const h = u.get(s.operator);
|
|
1894
|
+
return h && h(s.target, s.param, s.value, y) || !1;
|
|
1892
1895
|
}
|
|
1893
1896
|
return !1;
|
|
1894
1897
|
}
|
|
1895
|
-
function
|
|
1896
|
-
return Object.keys(
|
|
1897
|
-
const N =
|
|
1898
|
-
return
|
|
1899
|
-
}, []).reduce((
|
|
1898
|
+
function M(s, y) {
|
|
1899
|
+
return Object.keys(s).reduce((P, A) => {
|
|
1900
|
+
const N = m(A, s[A]);
|
|
1901
|
+
return P.push(...N), P;
|
|
1902
|
+
}, []).reduce((P, A) => P && v(A, y), !0);
|
|
1900
1903
|
}
|
|
1901
|
-
function S(
|
|
1902
|
-
const
|
|
1904
|
+
function S(s, y) {
|
|
1905
|
+
const h = Object.keys(s), x = h.includes("allOf"), O = h.includes("anyOf"), P = x || O, D = (P ? s[P ? x ? "allOf" : "anyOf" : "allOf"] : [s]).map((k) => M(k, y));
|
|
1903
1906
|
return x ? !D.includes(!1) : D.includes(!0);
|
|
1904
1907
|
}
|
|
1905
|
-
function
|
|
1906
|
-
const
|
|
1907
|
-
return
|
|
1908
|
-
}
|
|
1909
|
-
function
|
|
1910
|
-
return (
|
|
1911
|
-
const
|
|
1912
|
-
return
|
|
1913
|
-
const
|
|
1914
|
-
return x[O] =
|
|
1915
|
-
},
|
|
1908
|
+
function g(s, y) {
|
|
1909
|
+
const h = s.const;
|
|
1910
|
+
return h ? typeof h == "boolean" ? h : typeof h == "object" ? S(h, y) : !1 : !1;
|
|
1911
|
+
}
|
|
1912
|
+
function C(s) {
|
|
1913
|
+
return (y) => {
|
|
1914
|
+
const h = { canAccept: !0, fixed: !1, hidePadding: !1 };
|
|
1915
|
+
return s && s.properties && Object.keys(s.properties).reduce((x, O) => {
|
|
1916
|
+
const P = s.properties[O];
|
|
1917
|
+
return x[O] = g(P, y), x;
|
|
1918
|
+
}, h), h;
|
|
1916
1919
|
};
|
|
1917
1920
|
}
|
|
1918
|
-
function p(
|
|
1919
|
-
if (
|
|
1920
|
-
const { rules: x, contents: O } =
|
|
1921
|
-
|
|
1922
|
-
(
|
|
1921
|
+
function p(s, y, h) {
|
|
1922
|
+
if (y.type === "object" && y.properties) {
|
|
1923
|
+
const { rules: x, contents: O } = y.properties;
|
|
1924
|
+
h.set(s, C(x)), O && Object.keys(O.properties).forEach(
|
|
1925
|
+
(P) => p(P, O.properties[P], h)
|
|
1923
1926
|
);
|
|
1924
1927
|
}
|
|
1925
1928
|
}
|
|
1926
|
-
function
|
|
1927
|
-
const { properties:
|
|
1928
|
-
Object.keys(
|
|
1929
|
-
p(
|
|
1929
|
+
function a() {
|
|
1930
|
+
const { properties: s } = wt;
|
|
1931
|
+
Object.keys(s).forEach((y) => {
|
|
1932
|
+
p(y, s[y], J);
|
|
1930
1933
|
});
|
|
1931
1934
|
}
|
|
1932
|
-
function d(
|
|
1933
|
-
const
|
|
1934
|
-
return J.has(
|
|
1935
|
+
function d(s, y) {
|
|
1936
|
+
const h = { canAccept: !0, fixed: !1, hidePadding: !0 };
|
|
1937
|
+
return J.has(s) ? J.get(s)(y) : h;
|
|
1935
1938
|
}
|
|
1936
|
-
return
|
|
1939
|
+
return a(), { getRuleValue: d };
|
|
1937
1940
|
}
|
|
1938
1941
|
class Se {
|
|
1939
1942
|
static getEditorTypesByMDataType(e) {
|
|
1940
|
-
|
|
1943
|
+
const n = this.fieldControlTypeMapping[e];
|
|
1944
|
+
return n || [{ key: "", value: "" }];
|
|
1941
1945
|
}
|
|
1942
1946
|
}
|
|
1943
1947
|
/**
|
|
@@ -1945,57 +1949,57 @@ class Se {
|
|
|
1945
1949
|
*/
|
|
1946
1950
|
F(Se, "fieldControlTypeMapping", {
|
|
1947
1951
|
String: [
|
|
1948
|
-
{ key:
|
|
1949
|
-
{ key:
|
|
1950
|
-
{ key:
|
|
1951
|
-
{ key:
|
|
1952
|
-
{ key:
|
|
1953
|
-
{ key:
|
|
1954
|
-
{ key:
|
|
1955
|
-
{ key:
|
|
1952
|
+
{ key: I["input-group"].type, value: I["input-group"].name },
|
|
1953
|
+
{ key: I.lookup.type, value: I.lookup.name },
|
|
1954
|
+
{ key: I.Image.type, value: I.Image.name },
|
|
1955
|
+
{ key: I["date-picker"].type, value: I["date-picker"].name },
|
|
1956
|
+
{ key: I["check-box"].type, value: I["check-box"].name },
|
|
1957
|
+
{ key: I["radio-group"].type, value: I["radio-group"].name },
|
|
1958
|
+
{ key: I["combo-list"].type, value: I["combo-list"].name },
|
|
1959
|
+
{ key: I.textarea.type, value: I.textarea.name }
|
|
1956
1960
|
// { key: DgControl.Tags.type, value: DgControl.Tags.name },
|
|
1957
1961
|
],
|
|
1958
1962
|
Text: [
|
|
1959
|
-
{ key:
|
|
1960
|
-
{ key:
|
|
1961
|
-
{ key:
|
|
1963
|
+
{ key: I.textarea.type, value: I.textarea.name },
|
|
1964
|
+
{ key: I.avatar.type, value: I.avatar.name },
|
|
1965
|
+
{ key: I.lookup.type, value: I.lookup.name }
|
|
1962
1966
|
],
|
|
1963
1967
|
Decimal: [
|
|
1964
|
-
{ key:
|
|
1968
|
+
{ key: I["number-spinner"].type, value: I["number-spinner"].name }
|
|
1965
1969
|
],
|
|
1966
1970
|
Integer: [
|
|
1967
|
-
{ key:
|
|
1971
|
+
{ key: I["number-spinner"].type, value: I["number-spinner"].name }
|
|
1968
1972
|
],
|
|
1969
1973
|
Number: [
|
|
1970
|
-
{ key:
|
|
1974
|
+
{ key: I["number-spinner"].type, value: I["number-spinner"].name }
|
|
1971
1975
|
],
|
|
1972
1976
|
BigNumber: [
|
|
1973
|
-
{ key:
|
|
1977
|
+
{ key: I["number-spinner"].type, value: I["number-spinner"].name }
|
|
1974
1978
|
],
|
|
1975
1979
|
Date: [
|
|
1976
|
-
{ key:
|
|
1980
|
+
{ key: I["date-picker"].type, value: I["date-picker"].name }
|
|
1977
1981
|
],
|
|
1978
1982
|
DateTime: [
|
|
1979
|
-
{ key:
|
|
1983
|
+
{ key: I["date-picker"].type, value: I["date-picker"].name }
|
|
1980
1984
|
],
|
|
1981
1985
|
Boolean: [
|
|
1982
|
-
{ key:
|
|
1983
|
-
{ key:
|
|
1986
|
+
{ key: I.switch.type, value: I.switch.name },
|
|
1987
|
+
{ key: I["check-box"].type, value: I["check-box"].name }
|
|
1984
1988
|
],
|
|
1985
1989
|
Enum: [
|
|
1986
|
-
{ key:
|
|
1987
|
-
{ key:
|
|
1990
|
+
{ key: I["combo-list"].type, value: I["combo-list"].name },
|
|
1991
|
+
{ key: I["radio-group"].type, value: I["radio-group"].name }
|
|
1988
1992
|
],
|
|
1989
1993
|
Object: [
|
|
1990
|
-
{ key:
|
|
1991
|
-
{ key:
|
|
1992
|
-
{ key:
|
|
1994
|
+
{ key: I.lookup.type, value: I.lookup.name },
|
|
1995
|
+
{ key: I["combo-list"].type, value: I["combo-list"].name },
|
|
1996
|
+
{ key: I["radio-group"].type, value: I["radio-group"].name }
|
|
1993
1997
|
],
|
|
1994
1998
|
EmployeeSelector: [
|
|
1995
|
-
{ key:
|
|
1999
|
+
{ key: I.EmployeeSelector.type, value: I.EmployeeSelector.name }
|
|
1996
2000
|
],
|
|
1997
2001
|
AdminOrganizationSelector: [
|
|
1998
|
-
{ key:
|
|
2002
|
+
{ key: I.AdminOrganizationSelector.type, value: I.AdminOrganizationSelector.name }
|
|
1999
2003
|
]
|
|
2000
2004
|
});
|
|
2001
2005
|
class ae {
|
|
@@ -2009,20 +2013,25 @@ class ae {
|
|
|
2009
2013
|
F(this, "designViewModelField");
|
|
2010
2014
|
F(this, "controlCreatorUtils");
|
|
2011
2015
|
F(this, "designerHostService");
|
|
2016
|
+
F(this, "schemaService", null);
|
|
2012
2017
|
F(this, "metadataService", null);
|
|
2013
2018
|
F(this, "propertyConfig", {
|
|
2014
2019
|
type: "object",
|
|
2015
2020
|
categories: {}
|
|
2016
2021
|
});
|
|
2017
|
-
var
|
|
2018
|
-
this.componentId = e, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((
|
|
2022
|
+
var c;
|
|
2023
|
+
this.componentId = e, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((c = this.formSchemaUtils) == null ? void 0 : c.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService;
|
|
2024
|
+
}
|
|
2025
|
+
getTableInfo() {
|
|
2026
|
+
var e;
|
|
2027
|
+
return (e = this.schemaService) == null ? void 0 : e.getTableInfoByViewModelId(this.viewModelId);
|
|
2019
2028
|
}
|
|
2020
2029
|
setDesignViewModelField(e) {
|
|
2021
2030
|
const n = e.binding && e.binding.type === "Form" && e.binding.field;
|
|
2022
2031
|
if (n) {
|
|
2023
2032
|
if (!this.designViewModelField) {
|
|
2024
|
-
const
|
|
2025
|
-
this.designViewModelField =
|
|
2033
|
+
const c = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
2034
|
+
this.designViewModelField = c.fields.find((u) => u.id === n);
|
|
2026
2035
|
}
|
|
2027
2036
|
e.updateOn = this.designViewModelField.updateOn;
|
|
2028
2037
|
}
|
|
@@ -2030,6 +2039,7 @@ class ae {
|
|
|
2030
2039
|
changeFieldEditorType(e, n) {
|
|
2031
2040
|
}
|
|
2032
2041
|
getBasicPropConfig(e) {
|
|
2042
|
+
var c, u;
|
|
2033
2043
|
var n = this;
|
|
2034
2044
|
return this.setDesignViewModelField(e), {
|
|
2035
2045
|
description: "Basic Information",
|
|
@@ -2051,7 +2061,8 @@ class ae {
|
|
|
2051
2061
|
type: "combo-list",
|
|
2052
2062
|
textField: "value",
|
|
2053
2063
|
valueField: "key",
|
|
2054
|
-
data: Se.getEditorTypesByMDataType(n.designViewModelField.type.name)
|
|
2064
|
+
data: Se.getEditorTypesByMDataType(((u = (c = n.designViewModelField) == null ? void 0 : c.type) == null ? void 0 : u.name) || ""),
|
|
2065
|
+
editable: !1
|
|
2055
2066
|
}
|
|
2056
2067
|
},
|
|
2057
2068
|
label: {
|
|
@@ -2060,11 +2071,11 @@ class ae {
|
|
|
2060
2071
|
$converter: "/converter/form-group-label.converter"
|
|
2061
2072
|
}
|
|
2062
2073
|
},
|
|
2063
|
-
setPropertyRelates(
|
|
2064
|
-
if (
|
|
2065
|
-
switch (
|
|
2074
|
+
setPropertyRelates(m, v) {
|
|
2075
|
+
if (m)
|
|
2076
|
+
switch (m && m.propertyID) {
|
|
2066
2077
|
case "type": {
|
|
2067
|
-
n.changeControlType(e,
|
|
2078
|
+
n.changeControlType(e, m);
|
|
2068
2079
|
break;
|
|
2069
2080
|
}
|
|
2070
2081
|
}
|
|
@@ -2077,34 +2088,34 @@ class ae {
|
|
|
2077
2088
|
* @param newControlType 新控件类型
|
|
2078
2089
|
*/
|
|
2079
2090
|
changeControlType(e, n) {
|
|
2080
|
-
var
|
|
2081
|
-
const
|
|
2082
|
-
let
|
|
2083
|
-
if (!
|
|
2091
|
+
var g, C, p, a, d;
|
|
2092
|
+
const c = n.propertyValue, u = this.formSchemaUtils.getComponentById(this.componentId);
|
|
2093
|
+
let m = this.getControlParentContainer(e.id, u);
|
|
2094
|
+
if (!m)
|
|
2084
2095
|
return;
|
|
2085
|
-
const
|
|
2096
|
+
const v = m.contents.findIndex((s) => s.id === e.id), M = m.contents[v];
|
|
2086
2097
|
let S;
|
|
2087
2098
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
2088
2099
|
editor: {
|
|
2089
|
-
$type:
|
|
2100
|
+
$type: c
|
|
2090
2101
|
},
|
|
2091
2102
|
name: this.designViewModelField.name,
|
|
2092
2103
|
require: this.designViewModelField.require,
|
|
2093
2104
|
readonly: this.designViewModelField.readonly
|
|
2094
|
-
}, !1), S = this.controlCreatorUtils.setFormFieldProperty("Form", this.designViewModelField, null,
|
|
2095
|
-
id:
|
|
2096
|
-
appearance:
|
|
2097
|
-
size:
|
|
2098
|
-
label:
|
|
2105
|
+
}, !1), S = this.controlCreatorUtils.setFormFieldProperty("Form", this.designViewModelField, null, c)), Object.assign(S, {
|
|
2106
|
+
id: M.id,
|
|
2107
|
+
appearance: M.appearance,
|
|
2108
|
+
size: M.size,
|
|
2109
|
+
label: M.label
|
|
2099
2110
|
}), Object.assign(S.editor, {
|
|
2100
|
-
isTextArea: S.isTextArea &&
|
|
2101
|
-
type:
|
|
2102
|
-
placeHolder: (
|
|
2103
|
-
holdPlace: (
|
|
2104
|
-
readonly: (p =
|
|
2105
|
-
require: (
|
|
2106
|
-
visible: (d =
|
|
2107
|
-
}),
|
|
2111
|
+
isTextArea: S.isTextArea && M.isTextArea,
|
|
2112
|
+
type: c || "",
|
|
2113
|
+
placeHolder: (g = M.editor) == null ? void 0 : g.placeHolder,
|
|
2114
|
+
holdPlace: (C = M.editor) == null ? void 0 : C.holdPlace,
|
|
2115
|
+
readonly: (p = M.editor) == null ? void 0 : p.readonly,
|
|
2116
|
+
require: (a = M.editor) == null ? void 0 : a.require,
|
|
2117
|
+
visible: (d = M.editor) == null ? void 0 : d.visible
|
|
2118
|
+
}), m.contents.splice(v, 1, S);
|
|
2108
2119
|
}
|
|
2109
2120
|
getAppearanceConfig(e = null) {
|
|
2110
2121
|
return {
|
|
@@ -2142,39 +2153,18 @@ class ae {
|
|
|
2142
2153
|
* @param domJson 容器
|
|
2143
2154
|
*/
|
|
2144
2155
|
getControlParentContainer(e, n) {
|
|
2145
|
-
let
|
|
2156
|
+
let c;
|
|
2146
2157
|
if (!n || !n.contents || n.contents.length === 0)
|
|
2147
2158
|
return null;
|
|
2148
2159
|
for (const u of n.contents) {
|
|
2149
2160
|
if (u.id === e)
|
|
2150
|
-
return
|
|
2151
|
-
if (
|
|
2152
|
-
return
|
|
2161
|
+
return c = n, n;
|
|
2162
|
+
if (c = this.getControlParentContainer(e, u), c)
|
|
2163
|
+
return c;
|
|
2153
2164
|
}
|
|
2154
2165
|
}
|
|
2155
|
-
getBindingFieldEditorOptions(e) {
|
|
2156
|
-
const n = this.formSchemaUtils.getFormMetadataBasicInfo();
|
|
2157
|
-
return {
|
|
2158
|
-
type: "field-selector",
|
|
2159
|
-
bindingType: { enable: !1 },
|
|
2160
|
-
editorParams: {
|
|
2161
|
-
propertyData: e,
|
|
2162
|
-
formBasicInfo: n
|
|
2163
|
-
},
|
|
2164
|
-
columns: [
|
|
2165
|
-
{ field: "name", title: "字段名称" },
|
|
2166
|
-
{ field: "bindingField", title: "绑定字段" },
|
|
2167
|
-
{ field: "fieldType", title: "字段类型" }
|
|
2168
|
-
],
|
|
2169
|
-
beforeOpenDialog: (a) => {
|
|
2170
|
-
const u = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
|
|
2171
|
-
a.instance.loadData(u);
|
|
2172
|
-
},
|
|
2173
|
-
textField: "bindingField"
|
|
2174
|
-
};
|
|
2175
|
-
}
|
|
2176
2166
|
}
|
|
2177
|
-
class
|
|
2167
|
+
class Tt extends ae {
|
|
2178
2168
|
constructor(e, n) {
|
|
2179
2169
|
super(e, n);
|
|
2180
2170
|
}
|
|
@@ -2198,7 +2188,9 @@ class wt extends ae {
|
|
|
2198
2188
|
description: "The type of a component.",
|
|
2199
2189
|
editor: {
|
|
2200
2190
|
type: "combo-list",
|
|
2201
|
-
|
|
2191
|
+
textField: "value",
|
|
2192
|
+
valueField: "key",
|
|
2193
|
+
data: [{ key: "response-toolbar", value: I["response-toolbar"].name }]
|
|
2202
2194
|
}
|
|
2203
2195
|
}
|
|
2204
2196
|
}
|
|
@@ -2241,24 +2233,24 @@ class wt extends ae {
|
|
|
2241
2233
|
};
|
|
2242
2234
|
}
|
|
2243
2235
|
}
|
|
2244
|
-
function
|
|
2245
|
-
const u = xe(),
|
|
2246
|
-
let
|
|
2247
|
-
function
|
|
2248
|
-
return
|
|
2236
|
+
function xt(r, e, n, c) {
|
|
2237
|
+
const u = xe(), m = j(!1), v = j(!1);
|
|
2238
|
+
let M = !0, S = !1, g;
|
|
2239
|
+
function C(D) {
|
|
2240
|
+
return g && g.componentClassList && g.componentClassList.includes("f-form-layout") && g.componentClassList.includes("farris-form") ? D.sourceType === "control" && D.controlCategory === "input" || D.sourceType === "move" && D.controlType === "form-group" : !0;
|
|
2249
2241
|
}
|
|
2250
2242
|
function p(D) {
|
|
2251
|
-
return !
|
|
2243
|
+
return !ft().basalDragulaRuleForContainer(D) || !M || !C(D), !1;
|
|
2252
2244
|
}
|
|
2253
|
-
function
|
|
2254
|
-
|
|
2255
|
-
const D =
|
|
2256
|
-
const
|
|
2245
|
+
function a() {
|
|
2246
|
+
m.value = !1, v.value = !1;
|
|
2247
|
+
const D = r, b = D.appearance && D.appearance.class || "", k = b.split(" "), E = D.buttons || [], l = E.length ? E[0] : null, o = l && l.appearance ? l.appearance.class : "", t = o ? o.split(" ") : [], i = E.length ? E.reduce((V, W) => {
|
|
2248
|
+
const U = W && W.appearance ? W.appearance.class : "", Z = U ? U.split(" ") : [];
|
|
2257
2249
|
return V.push(...Z), V;
|
|
2258
2250
|
}, []) : [], f = n == null ? void 0 : n.schema, R = f && f.appearance && f.appearance.class || "", T = R ? R.split(" ") : [];
|
|
2259
|
-
|
|
2251
|
+
g = {
|
|
2260
2252
|
componentClass: b,
|
|
2261
|
-
componentClassList:
|
|
2253
|
+
componentClassList: k,
|
|
2262
2254
|
childContents: E,
|
|
2263
2255
|
firstChildContent: l,
|
|
2264
2256
|
firstChildClass: o,
|
|
@@ -2267,26 +2259,26 @@ function Tt(i, e, n, a) {
|
|
|
2267
2259
|
parentClass: R,
|
|
2268
2260
|
parentClassList: T,
|
|
2269
2261
|
children: E,
|
|
2270
|
-
childrenClassList:
|
|
2262
|
+
childrenClassList: i
|
|
2271
2263
|
};
|
|
2272
|
-
const { canAccept:
|
|
2273
|
-
return
|
|
2264
|
+
const { canAccept: B, fixed: _, hidePadding: L } = u.getRuleValue(k[0], g);
|
|
2265
|
+
return M = B, S = L, !0;
|
|
2274
2266
|
}
|
|
2275
2267
|
function d(D) {
|
|
2276
2268
|
}
|
|
2277
|
-
function
|
|
2278
|
-
return
|
|
2269
|
+
function s() {
|
|
2270
|
+
return r.componentType ? "display:inherit;flex-direction:inherit;margin-bottom:10px" : "";
|
|
2279
2271
|
}
|
|
2280
|
-
function
|
|
2272
|
+
function y(D, b) {
|
|
2281
2273
|
return b.text = D.label, b;
|
|
2282
2274
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const E =
|
|
2275
|
+
function h(D, b, k) {
|
|
2276
|
+
const E = r;
|
|
2285
2277
|
if ((E.appearance && E.appearance.class || "").split(" ").includes("f-form-layout")) {
|
|
2286
|
-
const t = String(D.innerText),
|
|
2287
|
-
return
|
|
2278
|
+
const t = String(D.innerText), i = q("form-group");
|
|
2279
|
+
return i.editor = k, i.label = t, i;
|
|
2288
2280
|
}
|
|
2289
|
-
return
|
|
2281
|
+
return k;
|
|
2290
2282
|
}
|
|
2291
2283
|
function x() {
|
|
2292
2284
|
return !1;
|
|
@@ -2294,32 +2286,32 @@ function Tt(i, e, n, a) {
|
|
|
2294
2286
|
function O() {
|
|
2295
2287
|
return !1;
|
|
2296
2288
|
}
|
|
2297
|
-
function
|
|
2289
|
+
function P() {
|
|
2298
2290
|
return !0;
|
|
2299
2291
|
}
|
|
2300
2292
|
function A() {
|
|
2301
2293
|
return S;
|
|
2302
2294
|
}
|
|
2303
2295
|
function N(D) {
|
|
2304
|
-
return new
|
|
2296
|
+
return new Tt(D, e).getPropertyConfig(r);
|
|
2305
2297
|
}
|
|
2306
2298
|
return {
|
|
2307
2299
|
canAccepts: p,
|
|
2308
|
-
checkCanAddComponent:
|
|
2300
|
+
checkCanAddComponent: P,
|
|
2309
2301
|
checkCanDeleteComponent: O,
|
|
2310
2302
|
checkCanMoveComponent: x,
|
|
2311
|
-
getStyles:
|
|
2303
|
+
getStyles: s,
|
|
2312
2304
|
hideNestedPaddingInDesginerView: A,
|
|
2313
|
-
onAcceptNewChildElement:
|
|
2305
|
+
onAcceptNewChildElement: h,
|
|
2314
2306
|
onAcceptMovedChildElement: d,
|
|
2315
|
-
onResolveNewComponentSchema:
|
|
2316
|
-
resolveComponentContext:
|
|
2307
|
+
onResolveNewComponentSchema: y,
|
|
2308
|
+
resolveComponentContext: a,
|
|
2317
2309
|
getPropsConfig: N,
|
|
2318
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
2319
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
2310
|
+
triggerBelongedComponentToMoveWhenMoved: m,
|
|
2311
|
+
triggerBelongedComponentToDeleteWhenDeleted: v
|
|
2320
2312
|
};
|
|
2321
2313
|
}
|
|
2322
|
-
const
|
|
2314
|
+
const St = {
|
|
2323
2315
|
id: { type: String, default: "" },
|
|
2324
2316
|
componentId: { type: String, default: "" },
|
|
2325
2317
|
canAdd: { type: Boolean, default: !1 },
|
|
@@ -2332,172 +2324,174 @@ const xt = {
|
|
|
2332
2324
|
* 组件值
|
|
2333
2325
|
*/
|
|
2334
2326
|
modelValue: { type: Object }
|
|
2335
|
-
}, ee =
|
|
2336
|
-
function
|
|
2337
|
-
const n = e.getBoundingClientRect(),
|
|
2338
|
-
return u &&
|
|
2327
|
+
}, ee = j(0);
|
|
2328
|
+
function Dt(r, e) {
|
|
2329
|
+
const n = e.getBoundingClientRect(), c = r.getBoundingClientRect(), u = c.top >= n.top, m = c.top <= n.bottom;
|
|
2330
|
+
return u && m;
|
|
2339
2331
|
}
|
|
2340
|
-
function
|
|
2341
|
-
if (!
|
|
2332
|
+
function It(r) {
|
|
2333
|
+
if (!r)
|
|
2342
2334
|
return;
|
|
2343
2335
|
let e;
|
|
2344
|
-
if (
|
|
2336
|
+
if (r.className.includes("dgComponentSelected") ? e = r : e = r.querySelector(".dgComponentSelected"), !e)
|
|
2345
2337
|
return;
|
|
2346
2338
|
const n = e.getBoundingClientRect();
|
|
2347
2339
|
if (n.width === 0 && n.height === 0)
|
|
2348
2340
|
return;
|
|
2349
|
-
const
|
|
2350
|
-
if (
|
|
2351
|
-
if (!
|
|
2352
|
-
|
|
2341
|
+
const c = e.querySelector(".component-btn-group");
|
|
2342
|
+
if (c) {
|
|
2343
|
+
if (!Dt(e, r)) {
|
|
2344
|
+
c.style.display = "none";
|
|
2353
2345
|
return;
|
|
2354
2346
|
}
|
|
2355
|
-
|
|
2356
|
-
const
|
|
2357
|
-
if (
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2347
|
+
c.style.display = "";
|
|
2348
|
+
const m = c.getBoundingClientRect(), v = c.querySelector("div");
|
|
2349
|
+
if (v) {
|
|
2350
|
+
const M = v.getBoundingClientRect();
|
|
2351
|
+
v.style.top = m.top + "px", v.style.left = m.left - M.width + "px";
|
|
2360
2352
|
}
|
|
2361
2353
|
}
|
|
2362
2354
|
}
|
|
2363
|
-
function Mt(
|
|
2355
|
+
function Mt(r, e, n) {
|
|
2364
2356
|
var N;
|
|
2365
|
-
function
|
|
2357
|
+
function c() {
|
|
2366
2358
|
}
|
|
2367
|
-
const u = "",
|
|
2368
|
-
function
|
|
2359
|
+
const u = "", m = j();
|
|
2360
|
+
function v() {
|
|
2369
2361
|
return !0;
|
|
2370
2362
|
}
|
|
2371
|
-
function
|
|
2363
|
+
function M() {
|
|
2372
2364
|
return !1;
|
|
2373
2365
|
}
|
|
2374
2366
|
function S() {
|
|
2375
2367
|
return !0;
|
|
2376
2368
|
}
|
|
2377
|
-
function
|
|
2369
|
+
function g() {
|
|
2378
2370
|
return !0;
|
|
2379
2371
|
}
|
|
2380
|
-
function
|
|
2372
|
+
function C() {
|
|
2381
2373
|
return !0;
|
|
2382
2374
|
}
|
|
2383
2375
|
function p(D) {
|
|
2384
2376
|
if (!D || !D.value)
|
|
2385
2377
|
return null;
|
|
2386
|
-
const b =
|
|
2387
|
-
return
|
|
2378
|
+
const b = j(D == null ? void 0 : D.value.parent), k = p(b);
|
|
2379
|
+
return k || null;
|
|
2388
2380
|
}
|
|
2389
|
-
function
|
|
2390
|
-
const { componentInstance: b, designerItemElementRef:
|
|
2391
|
-
return !b || !b.value ? null : b.value.canMove || b.value.canAdd || b.value.canDelete ?
|
|
2381
|
+
function a(D = e) {
|
|
2382
|
+
const { componentInstance: b, designerItemElementRef: k } = D;
|
|
2383
|
+
return !b || !b.value ? null : b.value.canMove || b.value.canAdd || b.value.canDelete ? k : a(D.parent);
|
|
2392
2384
|
}
|
|
2393
2385
|
function d(D) {
|
|
2394
2386
|
return !!n;
|
|
2395
2387
|
}
|
|
2396
|
-
function
|
|
2388
|
+
function s() {
|
|
2397
2389
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
2398
2390
|
}
|
|
2399
|
-
function
|
|
2391
|
+
function y() {
|
|
2400
2392
|
}
|
|
2401
|
-
function
|
|
2393
|
+
function h(D, b) {
|
|
2402
2394
|
}
|
|
2403
2395
|
function x(D) {
|
|
2404
2396
|
const { componentType: b } = D;
|
|
2405
|
-
let
|
|
2397
|
+
let k = q(b, D);
|
|
2406
2398
|
const E = b.toLowerCase().replace("-", "_");
|
|
2407
|
-
return
|
|
2399
|
+
return k && !k.id && k.type === b && (k.id = `${E}_${Math.random().toString().slice(2, 6)}`), k;
|
|
2408
2400
|
}
|
|
2409
2401
|
function O(D, b) {
|
|
2410
|
-
const
|
|
2411
|
-
l.parentComponentInstance =
|
|
2412
|
-
let o = q(
|
|
2413
|
-
const t =
|
|
2414
|
-
return o && !o.id && o.type ===
|
|
2402
|
+
const k = String(D.getAttribute("data-controltype")), E = D.getAttribute("data-feature"), l = E ? JSON.parse(E) : {};
|
|
2403
|
+
l.parentComponentInstance = m.value;
|
|
2404
|
+
let o = q(k, l);
|
|
2405
|
+
const t = k.toLowerCase().replace("-", "_");
|
|
2406
|
+
return o && !o.id && o.type === k && (o.id = `${t}_${Math.random().toString().slice(2, 6)}`), o;
|
|
2415
2407
|
}
|
|
2416
|
-
function
|
|
2408
|
+
function P(D) {
|
|
2417
2409
|
}
|
|
2418
|
-
function A() {
|
|
2410
|
+
function A(...D) {
|
|
2419
2411
|
return [];
|
|
2420
2412
|
}
|
|
2421
|
-
return
|
|
2422
|
-
canMove:
|
|
2423
|
-
canSelectParent:
|
|
2424
|
-
canAdd:
|
|
2413
|
+
return m.value = {
|
|
2414
|
+
canMove: v(),
|
|
2415
|
+
canSelectParent: M(),
|
|
2416
|
+
canAdd: g(),
|
|
2425
2417
|
canDelete: S(),
|
|
2426
|
-
canNested: !
|
|
2418
|
+
canNested: !C(),
|
|
2427
2419
|
contents: [],
|
|
2428
|
-
elementRef:
|
|
2420
|
+
elementRef: r,
|
|
2429
2421
|
parent: (N = e.parent) == null ? void 0 : N.componentInstance,
|
|
2430
2422
|
schema: e.schema,
|
|
2431
2423
|
styles: u,
|
|
2432
2424
|
canAccepts: d,
|
|
2433
2425
|
getBelongedComponentInstance: p,
|
|
2434
|
-
getDraggableDesignItemElement:
|
|
2435
|
-
getDraggingDisplayText:
|
|
2426
|
+
getDraggableDesignItemElement: a,
|
|
2427
|
+
getDraggingDisplayText: s,
|
|
2436
2428
|
getPropConfig: A,
|
|
2437
|
-
getDragScopeElement:
|
|
2438
|
-
onAcceptMovedChildElement:
|
|
2429
|
+
getDragScopeElement: y,
|
|
2430
|
+
onAcceptMovedChildElement: h,
|
|
2439
2431
|
onAcceptNewChildElement: O,
|
|
2440
|
-
onChildElementMovedOut:
|
|
2432
|
+
onChildElementMovedOut: P,
|
|
2441
2433
|
addNewChildComponentSchema: x,
|
|
2442
|
-
updateDragAndDropRules:
|
|
2443
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
2444
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
2445
|
-
},
|
|
2434
|
+
updateDragAndDropRules: c,
|
|
2435
|
+
triggerBelongedComponentToMoveWhenMoved: j(!1),
|
|
2436
|
+
triggerBelongedComponentToDeleteWhenDeleted: j(!1)
|
|
2437
|
+
}, m;
|
|
2446
2438
|
}
|
|
2447
|
-
const
|
|
2439
|
+
const kt = /* @__PURE__ */ Y({
|
|
2448
2440
|
name: "FDesignerInnerItem",
|
|
2449
|
-
props:
|
|
2441
|
+
props: St,
|
|
2450
2442
|
emits: ["selectionChange", "addComponent", "removeComponent"],
|
|
2451
|
-
setup(
|
|
2452
|
-
const n =
|
|
2443
|
+
setup(r, e) {
|
|
2444
|
+
const n = j(r.canMove), c = j(r.canAdd), u = j(r.canDelete), m = j(!1), v = j(r.contentKey), M = j(r.childType), S = j(r.childLabel), g = j(r.modelValue), C = j(""), p = j(), a = $("canvas-dragula"), d = j(), s = $("design-item-context"), y = {
|
|
2453
2445
|
designerItemElementRef: p,
|
|
2454
2446
|
componentInstance: d,
|
|
2455
|
-
schema:
|
|
2456
|
-
parent:
|
|
2447
|
+
schema: g.value,
|
|
2448
|
+
parent: s,
|
|
2457
2449
|
setupContext: e
|
|
2458
2450
|
};
|
|
2459
|
-
Re("design-item-context",
|
|
2460
|
-
const
|
|
2451
|
+
Re("design-item-context", y);
|
|
2452
|
+
const h = z(() => ({
|
|
2461
2453
|
"farris-component": !0,
|
|
2454
|
+
// 受position-relative影响,整个容器的高度不能被撑起
|
|
2455
|
+
"flex-fill": r.id == "root-component",
|
|
2462
2456
|
"position-relative": n.value || u.value,
|
|
2463
|
-
"farris-nested":
|
|
2457
|
+
"farris-nested": m.value,
|
|
2464
2458
|
"can-move": n.value,
|
|
2465
2459
|
"d-none": p.value && p.value.classList.contains("d-none")
|
|
2466
|
-
})), x =
|
|
2460
|
+
})), x = z(() => {
|
|
2467
2461
|
const t = {};
|
|
2468
|
-
return
|
|
2462
|
+
return C.value && C.value.split(";").reduce((i, f) => {
|
|
2469
2463
|
const [R, T] = f.split(":");
|
|
2470
|
-
return R && (
|
|
2464
|
+
return R && (i[R] = T), i;
|
|
2471
2465
|
}, t), t;
|
|
2472
2466
|
});
|
|
2473
|
-
function O(t,
|
|
2474
|
-
if (
|
|
2475
|
-
const f =
|
|
2467
|
+
function O(t, i) {
|
|
2468
|
+
if (s && s.schema[v.value]) {
|
|
2469
|
+
const f = s.schema[v.value].findIndex((R) => R.id === i.id);
|
|
2476
2470
|
if (f > -1) {
|
|
2477
|
-
const R =
|
|
2478
|
-
|
|
2471
|
+
const R = s.schema[v.value].length, T = s.schema[v.value][f % R];
|
|
2472
|
+
s.designerItemElementRef.value.querySelector(`#${T.id}-design-item`), s.schema[v.value].splice(f, 1), s.componentInstance.value.updateDragAndDropRules(), ee.value++, e.emit("removeComponent");
|
|
2479
2473
|
}
|
|
2480
2474
|
}
|
|
2481
2475
|
}
|
|
2482
|
-
function
|
|
2476
|
+
function P(t) {
|
|
2483
2477
|
if (d.value.addNewChildComponentSchema) {
|
|
2484
|
-
const
|
|
2485
|
-
componentType:
|
|
2478
|
+
const i = {
|
|
2479
|
+
componentType: M.value,
|
|
2486
2480
|
label: S.value,
|
|
2487
2481
|
parentComponentInstance: d.value,
|
|
2488
2482
|
targetPosition: -1
|
|
2489
|
-
}, f = d.value.addNewChildComponentSchema(
|
|
2490
|
-
|
|
2483
|
+
}, f = d.value.addNewChildComponentSchema(i);
|
|
2484
|
+
g.value[v.value].push(f), e.emit("addComponent");
|
|
2491
2485
|
}
|
|
2492
2486
|
}
|
|
2493
2487
|
function A() {
|
|
2494
|
-
return
|
|
2488
|
+
return c.value && w("div", {
|
|
2495
2489
|
role: "button",
|
|
2496
2490
|
class: "btn component-settings-button",
|
|
2497
2491
|
title: "新增",
|
|
2498
2492
|
ref: "removeComponent",
|
|
2499
2493
|
onClick: (t) => {
|
|
2500
|
-
|
|
2494
|
+
P();
|
|
2501
2495
|
}
|
|
2502
2496
|
}, [w("i", {
|
|
2503
2497
|
class: "f-icon f-icon-plus-circle"
|
|
@@ -2509,7 +2503,7 @@ const It = /* @__PURE__ */ Y({
|
|
|
2509
2503
|
class: "btn component-settings-button",
|
|
2510
2504
|
title: "删除",
|
|
2511
2505
|
ref: "removeComponent",
|
|
2512
|
-
onClick:
|
|
2506
|
+
onClick: je((i) => O(i, t), ["stop"])
|
|
2513
2507
|
}, [w("i", {
|
|
2514
2508
|
class: "f-icon f-icon-yxs_delete"
|
|
2515
2509
|
}, null)]);
|
|
@@ -2531,50 +2525,50 @@ const It = /* @__PURE__ */ Y({
|
|
|
2531
2525
|
"data-noattach": "true"
|
|
2532
2526
|
}, [w("div", null, [A(), D(), N(t)])]);
|
|
2533
2527
|
}
|
|
2534
|
-
Q(() =>
|
|
2535
|
-
|
|
2528
|
+
Q(() => r.modelValue, (t) => {
|
|
2529
|
+
g.value = t, y.schema = t;
|
|
2536
2530
|
});
|
|
2537
|
-
function
|
|
2538
|
-
const
|
|
2539
|
-
|
|
2531
|
+
function k(t) {
|
|
2532
|
+
const i = t.target;
|
|
2533
|
+
It(i);
|
|
2540
2534
|
}
|
|
2541
2535
|
function E() {
|
|
2542
|
-
var t,
|
|
2543
|
-
(
|
|
2536
|
+
var t, i;
|
|
2537
|
+
(i = (t = g.value) == null ? void 0 : t.contents) != null && i.length && p.value && p.value.addEventListener("scroll", k);
|
|
2544
2538
|
}
|
|
2545
2539
|
function l() {
|
|
2546
|
-
const t = p.value,
|
|
2547
|
-
return Mt(
|
|
2540
|
+
const t = p.value, i = j(t.children[1]);
|
|
2541
|
+
return Mt(i, y).value;
|
|
2548
2542
|
}
|
|
2549
2543
|
H(() => {
|
|
2550
2544
|
if (p.value) {
|
|
2551
|
-
const t = p.value.querySelector(`[data-dragref='${
|
|
2552
|
-
d.value = t && t.componentInstance ? t.componentInstance.value : l(),
|
|
2545
|
+
const t = p.value.querySelector(`[data-dragref='${g.value.id}-container']`);
|
|
2546
|
+
d.value = t && t.componentInstance ? t.componentInstance.value : l(), a && t && a.attachComponents(t, g.value), m.value = d.value.canNested !== void 0 ? d.value.canNested : m.value, c.value = d.value.canAdd !== void 0 ? d.value.canAdd : c.value, u.value = d.value.canDelete !== void 0 ? d.value.canDelete : u.value, n.value = d.value.canMove !== void 0 ? d.value.canMove : n.value, C.value = d.value.styles || "", p.value && (p.value.componentInstance = d, p.value.designItemContext = y);
|
|
2553
2547
|
}
|
|
2554
2548
|
E(), ee.value++;
|
|
2555
2549
|
}), Ee(() => {
|
|
2556
|
-
p.value && p.value.removeEventListener("scroll",
|
|
2550
|
+
p.value && p.value.removeEventListener("scroll", k);
|
|
2557
2551
|
});
|
|
2558
2552
|
function o(t) {
|
|
2559
2553
|
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((f) => f.classList.remove("dgComponentFocused")), t && (t.preventDefault(), t.stopPropagation());
|
|
2560
|
-
const
|
|
2561
|
-
if (
|
|
2554
|
+
const i = p.value;
|
|
2555
|
+
if (i) {
|
|
2562
2556
|
const f = document.getElementsByClassName("dgComponentSelected");
|
|
2563
2557
|
if (!(f && f.length === 1 && f[0] === p.value)) {
|
|
2564
|
-
Array.from(f).forEach((
|
|
2565
|
-
const T = d.value.getDraggableDesignItemElement(
|
|
2558
|
+
Array.from(f).forEach((B) => B.classList.remove("dgComponentSelected")), i.classList.add("dgComponentFocused"), e.emit("selectionChange", g.value.type, g.value, r.componentId, d.value);
|
|
2559
|
+
const T = d.value.getDraggableDesignItemElement(y);
|
|
2566
2560
|
T && T.value && T.value.classList.add("dgComponentSelected");
|
|
2567
2561
|
}
|
|
2568
2562
|
}
|
|
2569
2563
|
ee.value++;
|
|
2570
2564
|
}
|
|
2571
2565
|
return () => w("div", {
|
|
2572
|
-
id: `${
|
|
2566
|
+
id: `${r.id}-design-item`,
|
|
2573
2567
|
ref: p,
|
|
2574
|
-
class:
|
|
2568
|
+
class: h.value,
|
|
2575
2569
|
style: x.value,
|
|
2576
2570
|
onClick: o
|
|
2577
|
-
}, [b(
|
|
2571
|
+
}, [b(g.value), e.slots.default && e.slots.default()]);
|
|
2578
2572
|
}
|
|
2579
2573
|
});
|
|
2580
2574
|
class Pt extends ae {
|
|
@@ -2628,7 +2622,7 @@ class Pt extends ae {
|
|
|
2628
2622
|
title: "style样式"
|
|
2629
2623
|
}
|
|
2630
2624
|
},
|
|
2631
|
-
setPropertyRelates(n,
|
|
2625
|
+
setPropertyRelates(n, c) {
|
|
2632
2626
|
}
|
|
2633
2627
|
};
|
|
2634
2628
|
}
|
|
@@ -2639,9 +2633,9 @@ class Pt extends ae {
|
|
|
2639
2633
|
name: "点击事件"
|
|
2640
2634
|
}
|
|
2641
2635
|
];
|
|
2642
|
-
var
|
|
2643
|
-
const u =
|
|
2644
|
-
|
|
2636
|
+
var c = this;
|
|
2637
|
+
const u = c.eventsEditorUtils.formProperties(e, c.viewModelId, n), m = {};
|
|
2638
|
+
m[c.viewModelId] = {
|
|
2645
2639
|
type: "events-editor",
|
|
2646
2640
|
editor: {
|
|
2647
2641
|
initialData: u
|
|
@@ -2649,19 +2643,19 @@ class Pt extends ae {
|
|
|
2649
2643
|
}, this.propertyConfig.categories.eventsEditor = {
|
|
2650
2644
|
title: "事件",
|
|
2651
2645
|
hideTitle: !0,
|
|
2652
|
-
properties:
|
|
2646
|
+
properties: m,
|
|
2653
2647
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
2654
2648
|
refreshPanelAfterChanged: !0,
|
|
2655
2649
|
tabId: "commands",
|
|
2656
2650
|
tabName: "交互",
|
|
2657
|
-
setPropertyRelates(
|
|
2658
|
-
const S =
|
|
2659
|
-
delete e[
|
|
2651
|
+
setPropertyRelates(v, M) {
|
|
2652
|
+
const S = v.propertyValue;
|
|
2653
|
+
delete e[c.viewModelId], S && (S.setPropertyRelates = this.setPropertyRelates, c.eventsEditorUtils.saveRelatedParameters(e, c.viewModelId, S.events, S));
|
|
2660
2654
|
}
|
|
2661
2655
|
};
|
|
2662
2656
|
}
|
|
2663
2657
|
}
|
|
2664
|
-
class
|
|
2658
|
+
class Rt extends ae {
|
|
2665
2659
|
constructor(e, n) {
|
|
2666
2660
|
super(e, n);
|
|
2667
2661
|
}
|
|
@@ -2685,7 +2679,9 @@ class kt extends ae {
|
|
|
2685
2679
|
description: "The type of a component.",
|
|
2686
2680
|
editor: {
|
|
2687
2681
|
type: "combo-list",
|
|
2688
|
-
|
|
2682
|
+
textField: "value",
|
|
2683
|
+
valueField: "key",
|
|
2684
|
+
data: [{ key: "response-toolbar-item", value: I["response-toolbar-item"].name }]
|
|
2689
2685
|
}
|
|
2690
2686
|
},
|
|
2691
2687
|
text: {
|
|
@@ -2710,8 +2706,8 @@ class kt extends ae {
|
|
|
2710
2706
|
label: "click",
|
|
2711
2707
|
name: "点击事件"
|
|
2712
2708
|
}
|
|
2713
|
-
],
|
|
2714
|
-
|
|
2709
|
+
], c = this, u = c.eventsEditorUtils.formProperties(e, c.viewModelId, n), m = {};
|
|
2710
|
+
m[c.viewModelId] = {
|
|
2715
2711
|
type: "events-editor",
|
|
2716
2712
|
editor: {
|
|
2717
2713
|
initialData: u
|
|
@@ -2719,37 +2715,37 @@ class kt extends ae {
|
|
|
2719
2715
|
}, this.propertyConfig.categories.eventsEditor = {
|
|
2720
2716
|
title: "事件",
|
|
2721
2717
|
hideTitle: !0,
|
|
2722
|
-
properties:
|
|
2718
|
+
properties: m,
|
|
2723
2719
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
2724
2720
|
refreshPanelAfterChanged: !0,
|
|
2725
2721
|
tabId: "commands",
|
|
2726
2722
|
tabName: "交互",
|
|
2727
|
-
setPropertyRelates(
|
|
2728
|
-
const S =
|
|
2729
|
-
delete e[
|
|
2723
|
+
setPropertyRelates(v, M) {
|
|
2724
|
+
const S = v.propertyValue;
|
|
2725
|
+
delete e[c.viewModelId], S && (S.setPropertyRelates = this.setPropertyRelates, c.eventsEditorUtils.saveRelatedParameters(e, c.viewModelId, S.events, S));
|
|
2730
2726
|
}
|
|
2731
2727
|
};
|
|
2732
2728
|
}
|
|
2733
2729
|
}
|
|
2734
|
-
function
|
|
2730
|
+
function Et(r, e) {
|
|
2735
2731
|
xe();
|
|
2736
|
-
const n =
|
|
2737
|
-
let u = !1,
|
|
2738
|
-
function
|
|
2732
|
+
const n = j(!1), c = j(!1);
|
|
2733
|
+
let u = !1, m = !1;
|
|
2734
|
+
function v(h) {
|
|
2739
2735
|
return !1;
|
|
2740
2736
|
}
|
|
2741
|
-
function
|
|
2737
|
+
function M(h) {
|
|
2742
2738
|
}
|
|
2743
2739
|
function S() {
|
|
2744
2740
|
return "";
|
|
2745
2741
|
}
|
|
2746
|
-
function
|
|
2747
|
-
return x.text =
|
|
2742
|
+
function g(h, x) {
|
|
2743
|
+
return x.text = h.label, x;
|
|
2748
2744
|
}
|
|
2749
|
-
function
|
|
2750
|
-
const
|
|
2751
|
-
if ((
|
|
2752
|
-
const D = String(
|
|
2745
|
+
function C(h, x, O) {
|
|
2746
|
+
const P = r.schema;
|
|
2747
|
+
if ((P.appearance && P.appearance.class || "").split(" ").includes("f-form-layout")) {
|
|
2748
|
+
const D = String(h.innerText), b = q("form-group");
|
|
2753
2749
|
return b.editor = O, b.label = D, b;
|
|
2754
2750
|
}
|
|
2755
2751
|
return O;
|
|
@@ -2757,150 +2753,150 @@ function Rt(i, e) {
|
|
|
2757
2753
|
function p() {
|
|
2758
2754
|
return !1;
|
|
2759
2755
|
}
|
|
2760
|
-
function
|
|
2761
|
-
return !
|
|
2756
|
+
function a() {
|
|
2757
|
+
return !m;
|
|
2762
2758
|
}
|
|
2763
2759
|
function d() {
|
|
2764
2760
|
return !1;
|
|
2765
2761
|
}
|
|
2766
|
-
function
|
|
2762
|
+
function s() {
|
|
2767
2763
|
return u;
|
|
2768
2764
|
}
|
|
2769
|
-
function
|
|
2765
|
+
function y(h) {
|
|
2770
2766
|
let x;
|
|
2771
|
-
switch (
|
|
2767
|
+
switch (r.schema.type) {
|
|
2772
2768
|
case "tab-toolbar-item":
|
|
2773
|
-
x = new Pt(
|
|
2769
|
+
x = new Pt(h, e);
|
|
2774
2770
|
break;
|
|
2775
2771
|
default:
|
|
2776
|
-
x = new
|
|
2772
|
+
x = new Rt(h, e);
|
|
2777
2773
|
}
|
|
2778
|
-
return x.getPropertyConfig(
|
|
2774
|
+
return x.getPropertyConfig(r.schema);
|
|
2779
2775
|
}
|
|
2780
2776
|
return {
|
|
2781
|
-
canAccepts:
|
|
2777
|
+
canAccepts: v,
|
|
2782
2778
|
checkCanAddComponent: d,
|
|
2783
|
-
checkCanDeleteComponent:
|
|
2779
|
+
checkCanDeleteComponent: a,
|
|
2784
2780
|
checkCanMoveComponent: p,
|
|
2785
2781
|
getStyles: S,
|
|
2786
|
-
hideNestedPaddingInDesginerView:
|
|
2787
|
-
onAcceptNewChildElement:
|
|
2788
|
-
onAcceptMovedChildElement:
|
|
2789
|
-
onResolveNewComponentSchema:
|
|
2790
|
-
getPropsConfig:
|
|
2782
|
+
hideNestedPaddingInDesginerView: s,
|
|
2783
|
+
onAcceptNewChildElement: C,
|
|
2784
|
+
onAcceptMovedChildElement: M,
|
|
2785
|
+
onResolveNewComponentSchema: g,
|
|
2786
|
+
getPropsConfig: y,
|
|
2791
2787
|
triggerBelongedComponentToMoveWhenMoved: n,
|
|
2792
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
2788
|
+
triggerBelongedComponentToDeleteWhenDeleted: c
|
|
2793
2789
|
};
|
|
2794
2790
|
}
|
|
2795
2791
|
const De = /* @__PURE__ */ Y({
|
|
2796
2792
|
name: "FResponseToolbarItemDesign",
|
|
2797
2793
|
props: we,
|
|
2798
2794
|
emits: ["Click"],
|
|
2799
|
-
setup(
|
|
2800
|
-
|
|
2801
|
-
const n =
|
|
2795
|
+
setup(r, e) {
|
|
2796
|
+
j(), j();
|
|
2797
|
+
const n = j(r.alignment), c = {
|
|
2802
2798
|
id: "__more_buttons__",
|
|
2803
2799
|
text: "More"
|
|
2804
|
-
}, u =
|
|
2805
|
-
|
|
2806
|
-
const
|
|
2800
|
+
}, u = j(new G(c));
|
|
2801
|
+
z(() => u.value.children.length > 0);
|
|
2802
|
+
const m = j(), v = $("designer-host-service"), M = $("design-item-context"), S = Et(M, v), g = fe(m, M, S);
|
|
2807
2803
|
$("toolbar-item-handler", () => {
|
|
2808
2804
|
}), H(() => {
|
|
2809
|
-
|
|
2810
|
-
}), e.expose(
|
|
2811
|
-
function
|
|
2805
|
+
m.value.componentInstance = g;
|
|
2806
|
+
}), e.expose(g.value);
|
|
2807
|
+
function C() {
|
|
2812
2808
|
const d = {
|
|
2813
2809
|
"f-icon": !0
|
|
2814
2810
|
};
|
|
2815
|
-
if (
|
|
2816
|
-
const
|
|
2817
|
-
|
|
2811
|
+
if (r.icon) {
|
|
2812
|
+
const s = r.icon.trim().split(" ");
|
|
2813
|
+
s && s.length && s.reduce((y, h) => (y[h] = !0, y), d);
|
|
2818
2814
|
}
|
|
2819
2815
|
return d;
|
|
2820
2816
|
}
|
|
2821
2817
|
function p() {
|
|
2822
|
-
return !!(
|
|
2818
|
+
return !!(r.icon && r.icon.trim());
|
|
2823
2819
|
}
|
|
2824
|
-
function
|
|
2820
|
+
function a() {
|
|
2825
2821
|
const d = {
|
|
2826
2822
|
btn: !0,
|
|
2827
2823
|
"f-rt-btn": !0,
|
|
2828
2824
|
"f-btn-ml": n.value === "right",
|
|
2829
2825
|
"f-btn-mr": n.value === "left",
|
|
2830
|
-
"btn-icontext": !!(
|
|
2826
|
+
"btn-icontext": !!(r.icon && r.icon.trim())
|
|
2831
2827
|
};
|
|
2832
|
-
if (
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2828
|
+
if (r.class) {
|
|
2829
|
+
const s = r.class.split(" ");
|
|
2830
|
+
s && s.length && s.reduce((y, h) => (y[h] = !0, y), d);
|
|
2835
2831
|
}
|
|
2836
2832
|
return d;
|
|
2837
2833
|
}
|
|
2838
2834
|
return H(() => {
|
|
2839
2835
|
}), ne(() => {
|
|
2840
2836
|
}), () => w("div", {
|
|
2841
|
-
ref:
|
|
2842
|
-
"data-dragref": `${
|
|
2837
|
+
ref: m,
|
|
2838
|
+
"data-dragref": `${M.schema.id}-container`,
|
|
2843
2839
|
class: "farris-component position-relative",
|
|
2844
2840
|
style: "display:inline-block!important;"
|
|
2845
2841
|
}, [w("button", {
|
|
2846
2842
|
type: "button",
|
|
2847
|
-
class:
|
|
2848
|
-
id:
|
|
2843
|
+
class: a(),
|
|
2844
|
+
id: r.id
|
|
2849
2845
|
}, [p() && w("i", {
|
|
2850
|
-
class:
|
|
2851
|
-
}, null),
|
|
2846
|
+
class: C()
|
|
2847
|
+
}, null), r.text])]);
|
|
2852
2848
|
}
|
|
2853
|
-
}),
|
|
2849
|
+
}), jt = /* @__PURE__ */ Y({
|
|
2854
2850
|
name: "FResponseToolbarDesign",
|
|
2855
|
-
props:
|
|
2851
|
+
props: at,
|
|
2856
2852
|
emits: ["Click"],
|
|
2857
|
-
setup(
|
|
2858
|
-
const n =
|
|
2859
|
-
let
|
|
2860
|
-
const u =
|
|
2853
|
+
setup(r, e) {
|
|
2854
|
+
const n = j(r.items);
|
|
2855
|
+
let c = new Array(n.value.length).fill(j());
|
|
2856
|
+
const u = j(), m = j(), v = j(r.alignment), M = {
|
|
2861
2857
|
id: "__more_buttons__",
|
|
2862
2858
|
text: "More"
|
|
2863
|
-
}, S =
|
|
2864
|
-
|
|
2865
|
-
const
|
|
2859
|
+
}, S = j(new G(M)), g = Te();
|
|
2860
|
+
z(() => S.value.children.length > 0);
|
|
2861
|
+
const C = j(), p = $("designer-host-service"), a = $("design-item-context"), d = xt(a.schema, p, a), s = fe(C, a, d);
|
|
2866
2862
|
$("toolbar-item-handler", () => {
|
|
2867
2863
|
}), H(() => {
|
|
2868
|
-
|
|
2869
|
-
}), e.expose(
|
|
2870
|
-
const
|
|
2864
|
+
C.value.componentInstance = s;
|
|
2865
|
+
}), e.expose(s.value);
|
|
2866
|
+
const y = z(() => ({
|
|
2871
2867
|
"f-toolbar": !0,
|
|
2872
2868
|
"f-response-toolbar": !0,
|
|
2873
2869
|
"position-relative": !0
|
|
2874
|
-
})),
|
|
2870
|
+
})), h = z(() => ({
|
|
2875
2871
|
"d-flex": !0,
|
|
2876
2872
|
"flex-nowrap": !0,
|
|
2877
|
-
"justify-content-end":
|
|
2878
|
-
"justify-content-start":
|
|
2873
|
+
"justify-content-end": v.value === "right",
|
|
2874
|
+
"justify-content-start": v.value === "left"
|
|
2879
2875
|
})), {
|
|
2880
2876
|
renderToolbarDropdown: x,
|
|
2881
2877
|
clearAllDropDown: O
|
|
2882
|
-
} =
|
|
2883
|
-
function
|
|
2878
|
+
} = ut(r, g, s);
|
|
2879
|
+
function P() {
|
|
2884
2880
|
n.value.filter((l) => l.children && l.children.length > 0).forEach((l) => {
|
|
2885
2881
|
l.expanded = !1;
|
|
2886
2882
|
}), S.value.expanded = !1, O();
|
|
2887
2883
|
}
|
|
2888
2884
|
const A = /* @__PURE__ */ new Map(), N = [];
|
|
2889
2885
|
function D(l) {
|
|
2890
|
-
const o =
|
|
2886
|
+
const o = m.value;
|
|
2891
2887
|
let t = l;
|
|
2892
|
-
const
|
|
2888
|
+
const i = Array.from(o.children), f = i[i.length - 1].id === "__more_buttons__" ? i[i.length - 1] : null;
|
|
2893
2889
|
if (f) {
|
|
2894
|
-
const L = f.computedStyleMap().get("margin-left"), V = f.computedStyleMap().get("margin-right"),
|
|
2895
|
-
t -=
|
|
2890
|
+
const L = f.computedStyleMap().get("margin-left"), V = f.computedStyleMap().get("margin-right"), W = (L ? L.value : 0) + f.getBoundingClientRect().width + (V ? V.value : 0);
|
|
2891
|
+
t -= W;
|
|
2896
2892
|
}
|
|
2897
|
-
const R =
|
|
2893
|
+
const R = i.filter((L) => L.id !== "__more_buttons__");
|
|
2898
2894
|
for (const L of R) {
|
|
2899
|
-
const V = L.computedStyleMap().get("margin-left"),
|
|
2900
|
-
t <
|
|
2895
|
+
const V = L.computedStyleMap().get("margin-left"), W = L.computedStyleMap().get("margin-right"), U = (V ? V.value : 0) + L.getBoundingClientRect().width + (W ? W.value : 0);
|
|
2896
|
+
t < U ? (A.set(L.id, !0), N.push({
|
|
2901
2897
|
id: L.id,
|
|
2902
|
-
width:
|
|
2903
|
-
})) : t -=
|
|
2898
|
+
width: U
|
|
2899
|
+
})) : t -= U;
|
|
2904
2900
|
}
|
|
2905
2901
|
if (N.length)
|
|
2906
2902
|
for (let L = N.length - 1; L >= 0; L--) {
|
|
@@ -2912,47 +2908,47 @@ const De = /* @__PURE__ */ Y({
|
|
|
2912
2908
|
}
|
|
2913
2909
|
const T = Object.assign({}, S.value);
|
|
2914
2910
|
T.children = [];
|
|
2915
|
-
const
|
|
2916
|
-
S.value =
|
|
2911
|
+
const B = new G(T), _ = n.value.reduce((L, V) => (A.has(V.id) && B.children.push(V), V.visible = !A.has(V.id), L.push(V), L), []);
|
|
2912
|
+
S.value = B, n.value = _;
|
|
2917
2913
|
}
|
|
2918
2914
|
const b = new ResizeObserver((l) => {
|
|
2919
2915
|
if (l.length) {
|
|
2920
|
-
const t = l[0].contentRect.width, f =
|
|
2916
|
+
const t = l[0].contentRect.width, f = m.value.getBoundingClientRect().width;
|
|
2921
2917
|
(t < f || N.length) && D(t);
|
|
2922
2918
|
}
|
|
2923
2919
|
});
|
|
2924
2920
|
H(() => {
|
|
2925
2921
|
const l = u.value;
|
|
2926
|
-
b.observe(l), document.body.addEventListener("click",
|
|
2922
|
+
b.observe(l), document.body.addEventListener("click", P);
|
|
2927
2923
|
}), ne(() => {
|
|
2928
|
-
b.disconnect(), document.body.removeEventListener("click",
|
|
2929
|
-
}), Q(() =>
|
|
2930
|
-
n.value =
|
|
2924
|
+
b.disconnect(), document.body.removeEventListener("click", P);
|
|
2925
|
+
}), Q(() => r.items, () => {
|
|
2926
|
+
n.value = r.items;
|
|
2931
2927
|
}, {
|
|
2932
2928
|
deep: !0
|
|
2933
2929
|
}), Q(n, (l) => {
|
|
2934
|
-
|
|
2930
|
+
c = new Array(n.value.length).fill(j());
|
|
2935
2931
|
});
|
|
2936
|
-
function
|
|
2937
|
-
|
|
2932
|
+
function k(l, o, t, i) {
|
|
2933
|
+
a && a.setupContext && a.setupContext.emit("selectionChange", l, o, t, i);
|
|
2938
2934
|
}
|
|
2939
2935
|
function E() {
|
|
2940
|
-
const l =
|
|
2936
|
+
const l = m.value.querySelector(".dgComponentFocused.dgComponentSelected");
|
|
2941
2937
|
l == null || l.classList.remove("dgComponentSelected"), l == null || l.classList.remove("dgComponentFocused");
|
|
2942
2938
|
}
|
|
2943
2939
|
return () => w("div", {
|
|
2944
|
-
ref:
|
|
2945
|
-
"data-dragref": `${
|
|
2946
|
-
class:
|
|
2940
|
+
ref: C,
|
|
2941
|
+
"data-dragref": `${a.schema.id}-container`,
|
|
2942
|
+
class: y.value
|
|
2947
2943
|
}, [w("div", {
|
|
2948
2944
|
ref: u,
|
|
2949
|
-
class:
|
|
2945
|
+
class: h.value
|
|
2950
2946
|
}, [w("div", {
|
|
2951
|
-
ref:
|
|
2947
|
+
ref: m,
|
|
2952
2948
|
class: "d-inline-block f-response-content",
|
|
2953
2949
|
style: "white-space: nowrap;"
|
|
2954
|
-
}, [n.value.map((l, o) => w(
|
|
2955
|
-
ref:
|
|
2950
|
+
}, [n.value.map((l, o) => w(kt, {
|
|
2951
|
+
ref: c[o],
|
|
2956
2952
|
class: "p-0 display-inline-block",
|
|
2957
2953
|
modelValue: l,
|
|
2958
2954
|
"onUpdate:modelValue": (t) => l = t,
|
|
@@ -2960,33 +2956,34 @@ const De = /* @__PURE__ */ Y({
|
|
|
2960
2956
|
childType: "response-toolbar-item",
|
|
2961
2957
|
childLabel: "按钮",
|
|
2962
2958
|
contentKey: "buttons",
|
|
2963
|
-
componentId:
|
|
2959
|
+
componentId: r.componentId,
|
|
2964
2960
|
id: l.id,
|
|
2965
2961
|
style: "padding:0 !important;display:inline-block",
|
|
2966
|
-
onSelectionChange:
|
|
2962
|
+
onSelectionChange: k,
|
|
2967
2963
|
onRemoveComponent: E
|
|
2968
2964
|
}, {
|
|
2969
2965
|
default: () => [w(De, {
|
|
2970
2966
|
id: l.id,
|
|
2971
2967
|
disable: l.disable,
|
|
2972
2968
|
text: l.text,
|
|
2973
|
-
icon: l.icon
|
|
2969
|
+
icon: l.icon,
|
|
2970
|
+
componentId: r.componentId
|
|
2974
2971
|
}, null)]
|
|
2975
2972
|
}))])])]);
|
|
2976
2973
|
}
|
|
2977
|
-
}),
|
|
2978
|
-
X.register = (
|
|
2979
|
-
|
|
2974
|
+
}), Vt = ie;
|
|
2975
|
+
X.register = (r, e, n) => {
|
|
2976
|
+
r["response-toolbar"] = X, e["response-toolbar"] = ie;
|
|
2980
2977
|
};
|
|
2981
|
-
X.registerDesigner = (
|
|
2982
|
-
|
|
2978
|
+
X.registerDesigner = (r, e, n) => {
|
|
2979
|
+
r["response-toolbar"] = jt, e["response-toolbar"] = ie, r["response-toolbar-item"] = De, e["response-toolbar-item"] = ct;
|
|
2983
2980
|
};
|
|
2984
|
-
const
|
|
2981
|
+
const _t = Ae(X);
|
|
2985
2982
|
export {
|
|
2986
2983
|
X as FResponseToolbar,
|
|
2987
2984
|
G as ResponseToolbarDropDownItem,
|
|
2988
|
-
|
|
2985
|
+
Nt as ResponseToolbarGroup,
|
|
2989
2986
|
Fe as ResponseToolbarItem,
|
|
2990
|
-
|
|
2991
|
-
|
|
2987
|
+
_t as default,
|
|
2988
|
+
Vt as responseToolbarResolver
|
|
2992
2989
|
};
|