@farris/ui-vue 1.2.5 → 1.2.6
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/package.json +1 -1
- package/components/avatar/index.esm.js +124 -116
- 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 +219 -209
- 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 +36 -28
- 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 +318 -316
- 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 +3771 -3622
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-grid/package.json +1 -1
- package/components/data-view/index.esm.js +2408 -2405
- package/components/data-view/index.umd.cjs +1 -1
- package/components/data-view/package.json +1 -1
- package/components/date-picker/index.esm.js +250 -242
- 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 +575 -565
- 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 +281 -277
- 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 +1795 -1783
- 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 +3914 -3769
- 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 +475 -465
- 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 +256 -248
- 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 +1445 -1446
- 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 +4347 -4145
- 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 +4657 -4475
- 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 +353 -345
- 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 +917 -893
- 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 +108 -101
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-editor/package.json +1 -1
- package/components/property-panel/index.esm.js +394 -384
- 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 +72 -64
- 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 +404 -393
- 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 +610 -592
- 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 +3654 -3408
- 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 +79 -71
- 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 +1448 -1406
- 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 +86 -78
- 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 +387 -379
- 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/package.json +1 -1
- package/components/{data-grid/style.css → tree-grid/index.css} +1 -1
- package/components/tree-grid/index.esm.js +3769 -3620
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-grid/package.json +1 -1
- package/components/tree-view/index.esm.js +2041 -2038
- 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 +12423 -11981
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -0
- package/package.json +2 -2
- 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/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 +8 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +29 -25
- 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 -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
1
|
var Pe = Object.defineProperty;
|
|
2
|
-
var ke = (
|
|
3
|
-
var F = (
|
|
4
|
-
import { computed as W, getCurrentInstance as de, createVNode as w, ref as
|
|
5
|
-
import { cloneDeep as
|
|
2
|
+
var ke = (r, e, n) => e in r ? Pe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
|
|
3
|
+
var F = (r, e, n) => ke(r, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { computed as W, 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 {
|
|
@@ -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
78
|
return e.reduce((a, u) => (u.children && u.children.length > 0 ? a.push(new G(u)) : a.push(new Fe(u)), a), 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 {
|
|
@@ -99,7 +99,7 @@ class G extends me {
|
|
|
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 } =
|
|
148
|
+
function re(r) {
|
|
149
|
+
const { properties: e, title: n } = r, a = Object.keys(e).reduce((u, m) => (u[m] = e[m].type === "object" && e[m].properties ? re(e[m]) : Be(e[m].default), u), {});
|
|
150
150
|
return a.id = `${n}-${Date.now()}`, a;
|
|
151
151
|
}
|
|
152
|
-
function q(
|
|
153
|
-
const n = oe[
|
|
152
|
+
function q(r, e = {}) {
|
|
153
|
+
const n = oe[r];
|
|
154
154
|
if (n) {
|
|
155
155
|
let a = re(n);
|
|
156
|
-
const u = ye[
|
|
156
|
+
const u = ye[r];
|
|
157
157
|
return a = u ? u({ getSchemaByType: q }, a, e) : a, a;
|
|
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((a, u) => (a[u] = r[u], a), n), n;
|
|
164
164
|
}
|
|
165
|
-
function Ne(
|
|
166
|
-
return Object.keys(
|
|
165
|
+
function Ne(r, e) {
|
|
166
|
+
return Object.keys(r).filter((a) => r[a] != null).reduce((a, u) => {
|
|
167
167
|
if (e.has(u)) {
|
|
168
|
-
const
|
|
169
|
-
if (typeof
|
|
170
|
-
a[
|
|
168
|
+
const m = e.get(u);
|
|
169
|
+
if (typeof m == "string")
|
|
170
|
+
a[m] = r[u];
|
|
171
171
|
else {
|
|
172
|
-
const
|
|
173
|
-
Object.assign(a,
|
|
172
|
+
const v = m(u, r[u], r);
|
|
173
|
+
Object.assign(a, v);
|
|
174
174
|
}
|
|
175
175
|
} else
|
|
176
|
-
a[u] =
|
|
176
|
+
a[u] = r[u];
|
|
177
177
|
return a;
|
|
178
178
|
}, {});
|
|
179
179
|
}
|
|
180
|
-
function Ve(
|
|
181
|
-
const a = Le(
|
|
180
|
+
function Ve(r, e, n = /* @__PURE__ */ new Map()) {
|
|
181
|
+
const a = Le(r, e);
|
|
182
182
|
return Ne(a, n);
|
|
183
183
|
}
|
|
184
|
-
function _e(
|
|
185
|
-
function e(
|
|
184
|
+
function _e(r = {}) {
|
|
185
|
+
function e(g, C, p, c) {
|
|
186
186
|
if (typeof p == "number")
|
|
187
|
-
return c[
|
|
187
|
+
return c[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(c[
|
|
191
|
+
return Number(c[g].length) !== Number(s);
|
|
192
192
|
if (d === "moreThan")
|
|
193
|
-
return Number(c[
|
|
193
|
+
return Number(c[g].length) >= Number(s);
|
|
194
194
|
if (d === "lessThan")
|
|
195
|
-
return Number(c[
|
|
195
|
+
return Number(c[g].length) <= Number(s);
|
|
196
196
|
}
|
|
197
197
|
return !1;
|
|
198
198
|
}
|
|
199
|
-
function n(
|
|
200
|
-
return c[
|
|
199
|
+
function n(g, C, p, c) {
|
|
200
|
+
return c[g] && c[g].propertyValue && String(c[g].propertyValue.value) === String(p);
|
|
201
201
|
}
|
|
202
202
|
const a = /* @__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
|
|
206
|
+
Object.keys(r).reduce((g, C) => (g.set(C, r[C]), g), a);
|
|
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((c) => {
|
|
210
210
|
if (c === "length")
|
|
211
|
-
return { target: p, operator: "length", param: null, value:
|
|
212
|
-
const d = c,
|
|
213
|
-
return { target: p, operator: "getProperty", param: d, value:
|
|
211
|
+
return { target: p, operator: "length", param: null, value: C[c] };
|
|
212
|
+
const d = c, s = C[c];
|
|
213
|
+
return { target: p, operator: "getProperty", param: d, value: s };
|
|
214
214
|
}) : [];
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
return Object.keys(
|
|
218
|
-
const d = u(c,
|
|
216
|
+
function m(g) {
|
|
217
|
+
return Object.keys(g).reduce((p, c) => {
|
|
218
|
+
const d = u(c, g[c]);
|
|
219
219
|
return p.push(...d), p;
|
|
220
220
|
}, []);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
if (a.has(
|
|
224
|
-
const p = a.get(
|
|
225
|
-
return p && p(
|
|
222
|
+
function v(g, C) {
|
|
223
|
+
if (a.has(g.operator)) {
|
|
224
|
+
const p = a.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(
|
|
232
|
+
function S(g, C) {
|
|
233
|
+
const p = Object.keys(g), c = p.includes("allOf"), d = p.includes("anyOf"), s = c || d, x = (s ? g[s ? c ? "allOf" : "anyOf" : "allOf"] : [g]).map((k) => M(k, C));
|
|
234
234
|
return c ? !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,16 +348,16 @@ const M = {
|
|
|
348
348
|
/** 审批类 end */
|
|
349
349
|
}, he = {}, $e = {};
|
|
350
350
|
_e();
|
|
351
|
-
function be(
|
|
352
|
-
return oe[e.title] = e, ye[e.title] = a, he[e.title] = u, $e[e.title] =
|
|
353
|
-
const
|
|
354
|
-
return Object.assign(S,
|
|
351
|
+
function be(r, e, n = /* @__PURE__ */ new Map(), a = (v, M, S) => M, u = {}, m = (v) => v) {
|
|
352
|
+
return oe[e.title] = e, ye[e.title] = a, 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
363
|
const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-design.gitee.io/response-toolbar.schema.json", ze = "response-toolbar", qe = "A Farris Toolbar Component", He = "object", 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,37 +516,38 @@ 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
|
|
528
|
+
function r(n) {
|
|
526
529
|
const a = {
|
|
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), a);
|
|
532
535
|
}
|
|
533
536
|
return a;
|
|
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
545
|
const c = {
|
|
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), c);
|
|
548
551
|
}
|
|
549
552
|
return c;
|
|
550
553
|
}
|
|
@@ -554,7 +557,7 @@ function ct(i) {
|
|
|
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), c), c;
|
|
558
561
|
}
|
|
559
562
|
function a(p) {
|
|
560
563
|
const c = {
|
|
@@ -562,52 +565,52 @@ function ct(i) {
|
|
|
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), c), c;
|
|
566
569
|
}
|
|
567
570
|
let u;
|
|
568
|
-
const
|
|
569
|
-
function
|
|
570
|
-
var
|
|
571
|
-
((
|
|
572
|
-
const
|
|
573
|
-
if (c.children && c.children.length && (c.expanded = !c.expanded, c.expanded ?
|
|
574
|
-
const
|
|
575
|
-
|
|
571
|
+
const m = /* @__PURE__ */ new Map();
|
|
572
|
+
function v(p, c, d) {
|
|
573
|
+
var y;
|
|
574
|
+
((y = p.target) == null ? void 0 : y.id) === c.id && p.stopPropagation();
|
|
575
|
+
const s = d ? d.id : "__top_item__";
|
|
576
|
+
if (c.children && c.children.length && (c.expanded = !c.expanded, c.expanded ? m.set(s, c) : m.delete(s)), m.has(s) && m.get(s) !== c) {
|
|
577
|
+
const h = m.get(s);
|
|
578
|
+
h && (h.expanded = !1);
|
|
576
579
|
}
|
|
577
580
|
}
|
|
578
|
-
function
|
|
581
|
+
function M(p, c) {
|
|
579
582
|
document.body.click(), c.enable && c.onClick(p, c.id);
|
|
580
583
|
}
|
|
581
584
|
function S(p) {
|
|
582
585
|
return p.children.map((c) => c.children && c.children.length ? w("li", {
|
|
583
586
|
class: n(c),
|
|
584
587
|
id: c.id,
|
|
585
|
-
onClick: (d) => c.enable &&
|
|
588
|
+
onClick: (d) => c.enable && v(d, c, p)
|
|
586
589
|
}, [w("span", {
|
|
587
590
|
id: c.id,
|
|
588
591
|
class: a(c),
|
|
589
|
-
onMouseover: (d) => c.enable &&
|
|
592
|
+
onMouseover: (d) => c.enable && v(d, c, p)
|
|
590
593
|
}, [c.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
596
|
}, null)]), u(c, c)]) : w("li", {
|
|
594
597
|
class: a(c),
|
|
595
598
|
id: c.id,
|
|
596
|
-
onClick: (d) =>
|
|
597
|
-
onMouseover: (d) => c.enable &&
|
|
598
|
-
}, [
|
|
599
|
-
class:
|
|
599
|
+
onClick: (d) => M(d, c),
|
|
600
|
+
onMouseover: (d) => c.enable && v(d, c, p)
|
|
601
|
+
}, [r.shouldShowIcon(c) && w("i", {
|
|
602
|
+
class: r.iconClass(c)
|
|
600
603
|
}, null), c.text]));
|
|
601
604
|
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
605
|
+
function g(p, c, 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 = c, x = h == null ? void 0 : h.getClientRects();
|
|
613
|
+
if (h && x && x.length) {
|
|
611
614
|
const {
|
|
612
615
|
top: O,
|
|
613
616
|
width: k,
|
|
@@ -615,93 +618,93 @@ function ct(i) {
|
|
|
615
618
|
right: N,
|
|
616
619
|
height: D
|
|
617
620
|
} = x[0], b = Math.ceil(D + O);
|
|
618
|
-
|
|
621
|
+
s.top = `${b}px`, s.left = `${A}px`;
|
|
619
622
|
const P = p.id + "_menu", E = c ? c.querySelector("#" + P) : 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
|
-
|
|
627
|
+
s.top = `${O - 6}px`;
|
|
625
628
|
const o = Math.ceil(k + A);
|
|
626
|
-
|
|
629
|
+
s.left = `${o}px`;
|
|
627
630
|
}
|
|
628
|
-
|
|
631
|
+
y - A - k < l.width && (s.left = `${(d ? A : N) - l.width}px`);
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
|
-
return
|
|
634
|
+
return s;
|
|
632
635
|
}
|
|
633
636
|
u = function(p, c) {
|
|
634
|
-
var
|
|
635
|
-
const d = de(),
|
|
637
|
+
var h, x;
|
|
638
|
+
const d = de(), s = c ? c.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, c),
|
|
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 =
|
|
655
|
+
function pt(r, e) {
|
|
656
|
+
const n = j(r.alignment), {
|
|
654
657
|
renderDropdownMenu: a,
|
|
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
|
-
}, c =
|
|
664
|
-
return c && c.length && c.reduce((d,
|
|
666
|
+
}, c = C.dropdownClass.split(" ");
|
|
667
|
+
return c && c.length && c.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 c =
|
|
675
|
-
c && c.length && c.reduce((d,
|
|
676
|
+
if (C.class) {
|
|
677
|
+
const c = C.class.split(" ");
|
|
678
|
+
c && c.length && c.reduce((d, s) => (d[s] = !0, d), p);
|
|
676
679
|
}
|
|
677
680
|
return p;
|
|
678
681
|
}
|
|
679
|
-
function
|
|
680
|
-
|
|
682
|
+
function M(C, p) {
|
|
683
|
+
C.stopPropagation();
|
|
681
684
|
const c = p.expanded;
|
|
682
685
|
document.body.click(), p.expanded = !c;
|
|
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)]), a(
|
|
700
|
+
}, null)]), a(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,42 +712,42 @@ 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)), a = 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 = W(() => S.value.children.length > 0), p = W(() => {
|
|
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 P =
|
|
726
|
+
if (r.customClass) {
|
|
727
|
+
const P = r.customClass.split(" ");
|
|
725
728
|
P && P.length && P.reduce((E, l) => (E[l] = !0, E), b);
|
|
726
729
|
}
|
|
727
730
|
return b;
|
|
728
731
|
}), c = W(() => ({
|
|
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
|
|
745
|
+
function h(b) {
|
|
743
746
|
const P = {
|
|
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) {
|
|
@@ -754,31 +757,31 @@ const {
|
|
|
754
757
|
return P;
|
|
755
758
|
}
|
|
756
759
|
function x(b, P) {
|
|
757
|
-
document.body.click(), P.onClick(b, P.id);
|
|
760
|
+
document.body.click(), P.onClick(b, P.id), e.emit("click", b, P.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
768
|
onClick: (P) => x(P, b)
|
|
766
|
-
}, [
|
|
767
|
-
class:
|
|
769
|
+
}, [g.shouldShowIcon(b) && w("i", {
|
|
770
|
+
class: g.iconClass(b)
|
|
768
771
|
}, null), b.text]);
|
|
769
772
|
}
|
|
770
773
|
const k = /* @__PURE__ */ new Map(), A = [];
|
|
771
774
|
function N(b) {
|
|
772
|
-
const P =
|
|
775
|
+
const P = m.value;
|
|
773
776
|
let E = b;
|
|
774
777
|
const l = Array.from(P.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
|
|
784
|
+
const B = T.computedStyleMap().get("margin-left"), _ = T.computedStyleMap().get("margin-right"), L = (B ? B.value : 0) + T.getBoundingClientRect().width + (_ ? _.value : 0);
|
|
782
785
|
E < L ? (k.set(T.id, !0), A.push({
|
|
783
786
|
id: T.id,
|
|
784
787
|
width: L
|
|
@@ -786,30 +789,30 @@ const {
|
|
|
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, k.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) => (k.has(B.id) && f.children.push(B), B.visible = !k.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({
|
|
@@ -821,54 +824,54 @@ const {
|
|
|
821
824
|
ref: u,
|
|
822
825
|
class: c.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
|
|
833
|
+
function dt(r, e) {
|
|
831
834
|
const n = $("design-item-context"), a = $("toolbar-item-handler", () => {
|
|
832
835
|
});
|
|
833
836
|
function u() {
|
|
834
837
|
a && a();
|
|
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
|
}
|
|
@@ -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",
|
|
@@ -929,55 +932,55 @@ function pt(i, e) {
|
|
|
929
932
|
return x(o);
|
|
930
933
|
};
|
|
931
934
|
function k(o, t) {
|
|
932
|
-
p(o), c(), d(o),
|
|
935
|
+
p(o), c(), 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,7 +1012,7 @@ 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", {
|
|
@@ -1018,93 +1021,93 @@ function pt(i, e) {
|
|
|
1018
1021
|
}
|
|
1019
1022
|
function P(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) => k(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
1055
|
right: U,
|
|
1053
1056
|
height: z
|
|
1054
|
-
} =
|
|
1057
|
+
} = B[0], Z = Math.ceil(z + _);
|
|
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 : U) - 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
|
}, [P(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 a =
|
|
1092
|
+
function ut(r, e, n) {
|
|
1093
|
+
const a = 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
1105
|
"f-btn-ml": a.value === "right",
|
|
1103
1106
|
"f-btn-mr": a.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,7 +1118,7 @@ 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
|
}
|
|
@@ -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,41 +1143,41 @@ 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
1182
|
function k(l) {
|
|
1180
1183
|
return 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,11 +1223,11 @@ 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
1233
|
p(l), A(), N(l), p(l), c(l, o), D(o.id);
|
|
@@ -1232,9 +1235,9 @@ function dt(i, e, n) {
|
|
|
1232
1235
|
function P(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
|
}, [k(l.id), e.shouldShowIcon(l) && w("i", {
|
|
@@ -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
1254
|
renderToolbarDropdown: P,
|
|
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 a = (
|
|
1266
|
+
const a = (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") && a && a.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 k = Object.keys(
|
|
1854
|
+
if (typeof h == "number")
|
|
1855
|
+
return ((O = x[s]) == null ? void 0 : O.length) === h;
|
|
1856
|
+
if (typeof h == "object") {
|
|
1857
|
+
const k = Object.keys(h)[0], A = h[k];
|
|
1855
1858
|
if (k === "not")
|
|
1856
|
-
return Number(x[
|
|
1859
|
+
return Number(x[s].length) !== Number(A);
|
|
1857
1860
|
if (k === "moreThan")
|
|
1858
|
-
return Number(x[
|
|
1861
|
+
return Number(x[s].length) >= Number(A);
|
|
1859
1862
|
if (k === "lessThan")
|
|
1860
|
-
return Number(x[
|
|
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 a(
|
|
1871
|
-
return typeof
|
|
1873
|
+
function a(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
1879
|
["hasSibling", a],
|
|
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, k =
|
|
1885
|
-
return { target:
|
|
1886
|
+
return { target: h, operator: "length", param: null, value: y[x] };
|
|
1887
|
+
const O = x, k = y[x];
|
|
1888
|
+
return { target: h, operator: s === "children" ? "hasChildren" : s === "parent" ? "hasParent" : "hasSibling", param: O, value: k };
|
|
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
|
+
function M(s, y) {
|
|
1899
|
+
return Object.keys(s).reduce((k, A) => {
|
|
1900
|
+
const N = m(A, s[A]);
|
|
1898
1901
|
return k.push(...N), k;
|
|
1899
|
-
}, []).reduce((k, A) => k &&
|
|
1902
|
+
}, []).reduce((k, A) => k && 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"), k = x || O, D = (k ? s[k ? x ? "allOf" : "anyOf" : "allOf"] : [s]).map((P) => M(P, 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 k =
|
|
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 k = s.properties[O];
|
|
1917
|
+
return x[O] = g(k, y), x;
|
|
1918
|
+
}, h), h;
|
|
1916
1919
|
};
|
|
1917
1920
|
}
|
|
1918
|
-
function p(
|
|
1919
|
-
if (
|
|
1920
|
-
const { rules: x, contents: O } =
|
|
1921
|
-
|
|
1922
|
-
(k) => p(k, O.properties[k],
|
|
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
|
+
(k) => p(k, O.properties[k], h)
|
|
1923
1926
|
);
|
|
1924
1927
|
}
|
|
1925
1928
|
}
|
|
1926
1929
|
function c() {
|
|
1927
|
-
const { properties:
|
|
1928
|
-
Object.keys(
|
|
1929
|
-
p(
|
|
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
1939
|
return c(), { 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,13 +2013,18 @@ 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
2022
|
var a;
|
|
2018
|
-
this.componentId = e, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((a = this.formSchemaUtils) == null ? void 0 : a.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService;
|
|
2023
|
+
this.componentId = e, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((a = this.formSchemaUtils) == null ? void 0 : a.getViewModelIdByComponentId(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;
|
|
@@ -2030,6 +2039,7 @@ class ae {
|
|
|
2030
2039
|
changeFieldEditorType(e, n) {
|
|
2031
2040
|
}
|
|
2032
2041
|
getBasicPropConfig(e) {
|
|
2042
|
+
var a, 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 = (a = n.designViewModelField) == null ? void 0 : a.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,12 +2088,12 @@ class ae {
|
|
|
2077
2088
|
* @param newControlType 新控件类型
|
|
2078
2089
|
*/
|
|
2079
2090
|
changeControlType(e, n) {
|
|
2080
|
-
var
|
|
2091
|
+
var g, C, p, c, d;
|
|
2081
2092
|
const a = n.propertyValue, u = this.formSchemaUtils.getComponentById(this.componentId);
|
|
2082
|
-
let
|
|
2083
|
-
if (!
|
|
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: {
|
|
@@ -2092,19 +2103,19 @@ class ae {
|
|
|
2092
2103
|
require: this.designViewModelField.require,
|
|
2093
2104
|
readonly: this.designViewModelField.readonly
|
|
2094
2105
|
}, !1), S = this.controlCreatorUtils.setFormFieldProperty("Form", this.designViewModelField, null, a)), Object.assign(S, {
|
|
2095
|
-
id:
|
|
2096
|
-
appearance:
|
|
2097
|
-
size:
|
|
2098
|
-
label:
|
|
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 &&
|
|
2111
|
+
isTextArea: S.isTextArea && M.isTextArea,
|
|
2101
2112
|
type: a || "",
|
|
2102
|
-
placeHolder: (
|
|
2103
|
-
holdPlace: (
|
|
2104
|
-
readonly: (p =
|
|
2105
|
-
require: (c =
|
|
2106
|
-
visible: (d =
|
|
2107
|
-
}),
|
|
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: (c = M.editor) == null ? void 0 : c.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 {
|
|
@@ -2174,7 +2185,7 @@ class ae {
|
|
|
2174
2185
|
};
|
|
2175
2186
|
}
|
|
2176
2187
|
}
|
|
2177
|
-
class
|
|
2188
|
+
class Tt extends ae {
|
|
2178
2189
|
constructor(e, n) {
|
|
2179
2190
|
super(e, n);
|
|
2180
2191
|
}
|
|
@@ -2198,7 +2209,9 @@ class wt extends ae {
|
|
|
2198
2209
|
description: "The type of a component.",
|
|
2199
2210
|
editor: {
|
|
2200
2211
|
type: "combo-list",
|
|
2201
|
-
|
|
2212
|
+
textField: "value",
|
|
2213
|
+
valueField: "key",
|
|
2214
|
+
data: [{ key: "response-toolbar", value: I["response-toolbar"].name }]
|
|
2202
2215
|
}
|
|
2203
2216
|
}
|
|
2204
2217
|
}
|
|
@@ -2241,22 +2254,22 @@ class wt extends ae {
|
|
|
2241
2254
|
};
|
|
2242
2255
|
}
|
|
2243
2256
|
}
|
|
2244
|
-
function
|
|
2245
|
-
const u = xe(),
|
|
2246
|
-
let
|
|
2247
|
-
function
|
|
2248
|
-
return
|
|
2257
|
+
function xt(r, e, n, a) {
|
|
2258
|
+
const u = xe(), m = j(!1), v = j(!1);
|
|
2259
|
+
let M = !0, S = !1, g;
|
|
2260
|
+
function C(D) {
|
|
2261
|
+
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
2262
|
}
|
|
2250
2263
|
function p(D) {
|
|
2251
|
-
return !
|
|
2264
|
+
return !ft().basalDragulaRuleForContainer(D) || !M || !C(D), !1;
|
|
2252
2265
|
}
|
|
2253
2266
|
function c() {
|
|
2254
|
-
|
|
2255
|
-
const D =
|
|
2267
|
+
m.value = !1, v.value = !1;
|
|
2268
|
+
const D = r, b = D.appearance && D.appearance.class || "", P = 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, U) => {
|
|
2256
2269
|
const z = U && U.appearance ? U.appearance.class : "", Z = z ? z.split(" ") : [];
|
|
2257
2270
|
return V.push(...Z), V;
|
|
2258
2271
|
}, []) : [], f = n == null ? void 0 : n.schema, R = f && f.appearance && f.appearance.class || "", T = R ? R.split(" ") : [];
|
|
2259
|
-
|
|
2272
|
+
g = {
|
|
2260
2273
|
componentClass: b,
|
|
2261
2274
|
componentClassList: P,
|
|
2262
2275
|
childContents: E,
|
|
@@ -2267,24 +2280,24 @@ function Tt(i, e, n, a) {
|
|
|
2267
2280
|
parentClass: R,
|
|
2268
2281
|
parentClassList: T,
|
|
2269
2282
|
children: E,
|
|
2270
|
-
childrenClassList:
|
|
2283
|
+
childrenClassList: i
|
|
2271
2284
|
};
|
|
2272
|
-
const { canAccept:
|
|
2273
|
-
return
|
|
2285
|
+
const { canAccept: B, fixed: _, hidePadding: L } = u.getRuleValue(P[0], g);
|
|
2286
|
+
return M = B, S = L, !0;
|
|
2274
2287
|
}
|
|
2275
2288
|
function d(D) {
|
|
2276
2289
|
}
|
|
2277
|
-
function
|
|
2278
|
-
return
|
|
2290
|
+
function s() {
|
|
2291
|
+
return r.componentType ? "display:inherit;flex-direction:inherit;margin-bottom:10px" : "";
|
|
2279
2292
|
}
|
|
2280
|
-
function
|
|
2293
|
+
function y(D, b) {
|
|
2281
2294
|
return b.text = D.label, b;
|
|
2282
2295
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const E =
|
|
2296
|
+
function h(D, b, P) {
|
|
2297
|
+
const E = r;
|
|
2285
2298
|
if ((E.appearance && E.appearance.class || "").split(" ").includes("f-form-layout")) {
|
|
2286
|
-
const t = String(D.innerText),
|
|
2287
|
-
return
|
|
2299
|
+
const t = String(D.innerText), i = q("form-group");
|
|
2300
|
+
return i.editor = P, i.label = t, i;
|
|
2288
2301
|
}
|
|
2289
2302
|
return P;
|
|
2290
2303
|
}
|
|
@@ -2301,25 +2314,25 @@ function Tt(i, e, n, a) {
|
|
|
2301
2314
|
return S;
|
|
2302
2315
|
}
|
|
2303
2316
|
function N(D) {
|
|
2304
|
-
return new
|
|
2317
|
+
return new Tt(D, e).getPropertyConfig(r);
|
|
2305
2318
|
}
|
|
2306
2319
|
return {
|
|
2307
2320
|
canAccepts: p,
|
|
2308
2321
|
checkCanAddComponent: k,
|
|
2309
2322
|
checkCanDeleteComponent: O,
|
|
2310
2323
|
checkCanMoveComponent: x,
|
|
2311
|
-
getStyles:
|
|
2324
|
+
getStyles: s,
|
|
2312
2325
|
hideNestedPaddingInDesginerView: A,
|
|
2313
|
-
onAcceptNewChildElement:
|
|
2326
|
+
onAcceptNewChildElement: h,
|
|
2314
2327
|
onAcceptMovedChildElement: d,
|
|
2315
|
-
onResolveNewComponentSchema:
|
|
2328
|
+
onResolveNewComponentSchema: y,
|
|
2316
2329
|
resolveComponentContext: c,
|
|
2317
2330
|
getPropsConfig: N,
|
|
2318
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
2319
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
2331
|
+
triggerBelongedComponentToMoveWhenMoved: m,
|
|
2332
|
+
triggerBelongedComponentToDeleteWhenDeleted: v
|
|
2320
2333
|
};
|
|
2321
2334
|
}
|
|
2322
|
-
const
|
|
2335
|
+
const St = {
|
|
2323
2336
|
id: { type: String, default: "" },
|
|
2324
2337
|
componentId: { type: String, default: "" },
|
|
2325
2338
|
canAdd: { type: Boolean, default: !1 },
|
|
@@ -2332,58 +2345,58 @@ const xt = {
|
|
|
2332
2345
|
* 组件值
|
|
2333
2346
|
*/
|
|
2334
2347
|
modelValue: { type: Object }
|
|
2335
|
-
}, ee =
|
|
2336
|
-
function
|
|
2337
|
-
const n = e.getBoundingClientRect(), a =
|
|
2338
|
-
return u &&
|
|
2348
|
+
}, ee = j(0);
|
|
2349
|
+
function Dt(r, e) {
|
|
2350
|
+
const n = e.getBoundingClientRect(), a = r.getBoundingClientRect(), u = a.top >= n.top, m = a.top <= n.bottom;
|
|
2351
|
+
return u && m;
|
|
2339
2352
|
}
|
|
2340
|
-
function
|
|
2341
|
-
if (!
|
|
2353
|
+
function It(r) {
|
|
2354
|
+
if (!r)
|
|
2342
2355
|
return;
|
|
2343
2356
|
let e;
|
|
2344
|
-
if (
|
|
2357
|
+
if (r.className.includes("dgComponentSelected") ? e = r : e = r.querySelector(".dgComponentSelected"), !e)
|
|
2345
2358
|
return;
|
|
2346
2359
|
const n = e.getBoundingClientRect();
|
|
2347
2360
|
if (n.width === 0 && n.height === 0)
|
|
2348
2361
|
return;
|
|
2349
2362
|
const a = e.querySelector(".component-btn-group");
|
|
2350
2363
|
if (a) {
|
|
2351
|
-
if (!
|
|
2364
|
+
if (!Dt(e, r)) {
|
|
2352
2365
|
a.style.display = "none";
|
|
2353
2366
|
return;
|
|
2354
2367
|
}
|
|
2355
2368
|
a.style.display = "";
|
|
2356
|
-
const
|
|
2357
|
-
if (
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2369
|
+
const m = a.getBoundingClientRect(), v = a.querySelector("div");
|
|
2370
|
+
if (v) {
|
|
2371
|
+
const M = v.getBoundingClientRect();
|
|
2372
|
+
v.style.top = m.top + "px", v.style.left = m.left - M.width + "px";
|
|
2360
2373
|
}
|
|
2361
2374
|
}
|
|
2362
2375
|
}
|
|
2363
|
-
function Mt(
|
|
2376
|
+
function Mt(r, e, n) {
|
|
2364
2377
|
var N;
|
|
2365
2378
|
function a() {
|
|
2366
2379
|
}
|
|
2367
|
-
const u = "",
|
|
2368
|
-
function
|
|
2380
|
+
const u = "", m = j();
|
|
2381
|
+
function v() {
|
|
2369
2382
|
return !0;
|
|
2370
2383
|
}
|
|
2371
|
-
function
|
|
2384
|
+
function M() {
|
|
2372
2385
|
return !1;
|
|
2373
2386
|
}
|
|
2374
2387
|
function S() {
|
|
2375
2388
|
return !0;
|
|
2376
2389
|
}
|
|
2377
|
-
function
|
|
2390
|
+
function g() {
|
|
2378
2391
|
return !0;
|
|
2379
2392
|
}
|
|
2380
|
-
function
|
|
2393
|
+
function C() {
|
|
2381
2394
|
return !0;
|
|
2382
2395
|
}
|
|
2383
2396
|
function p(D) {
|
|
2384
2397
|
if (!D || !D.value)
|
|
2385
2398
|
return null;
|
|
2386
|
-
const b =
|
|
2399
|
+
const b = j(D == null ? void 0 : D.value.parent), P = p(b);
|
|
2387
2400
|
return P || null;
|
|
2388
2401
|
}
|
|
2389
2402
|
function c(D = e) {
|
|
@@ -2393,12 +2406,12 @@ function Mt(i, e, n) {
|
|
|
2393
2406
|
function d(D) {
|
|
2394
2407
|
return !!n;
|
|
2395
2408
|
}
|
|
2396
|
-
function
|
|
2409
|
+
function s() {
|
|
2397
2410
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
2398
2411
|
}
|
|
2399
|
-
function
|
|
2412
|
+
function y() {
|
|
2400
2413
|
}
|
|
2401
|
-
function
|
|
2414
|
+
function h(D, b) {
|
|
2402
2415
|
}
|
|
2403
2416
|
function x(D) {
|
|
2404
2417
|
const { componentType: b } = D;
|
|
@@ -2408,86 +2421,88 @@ function Mt(i, e, n) {
|
|
|
2408
2421
|
}
|
|
2409
2422
|
function O(D, b) {
|
|
2410
2423
|
const P = String(D.getAttribute("data-controltype")), E = D.getAttribute("data-feature"), l = E ? JSON.parse(E) : {};
|
|
2411
|
-
l.parentComponentInstance =
|
|
2424
|
+
l.parentComponentInstance = m.value;
|
|
2412
2425
|
let o = q(P, l);
|
|
2413
2426
|
const t = P.toLowerCase().replace("-", "_");
|
|
2414
2427
|
return o && !o.id && o.type === P && (o.id = `${t}_${Math.random().toString().slice(2, 6)}`), o;
|
|
2415
2428
|
}
|
|
2416
2429
|
function k(D) {
|
|
2417
2430
|
}
|
|
2418
|
-
function A() {
|
|
2431
|
+
function A(...D) {
|
|
2419
2432
|
return [];
|
|
2420
2433
|
}
|
|
2421
|
-
return
|
|
2422
|
-
canMove:
|
|
2423
|
-
canSelectParent:
|
|
2424
|
-
canAdd:
|
|
2434
|
+
return m.value = {
|
|
2435
|
+
canMove: v(),
|
|
2436
|
+
canSelectParent: M(),
|
|
2437
|
+
canAdd: g(),
|
|
2425
2438
|
canDelete: S(),
|
|
2426
|
-
canNested: !
|
|
2439
|
+
canNested: !C(),
|
|
2427
2440
|
contents: [],
|
|
2428
|
-
elementRef:
|
|
2441
|
+
elementRef: r,
|
|
2429
2442
|
parent: (N = e.parent) == null ? void 0 : N.componentInstance,
|
|
2430
2443
|
schema: e.schema,
|
|
2431
2444
|
styles: u,
|
|
2432
2445
|
canAccepts: d,
|
|
2433
2446
|
getBelongedComponentInstance: p,
|
|
2434
2447
|
getDraggableDesignItemElement: c,
|
|
2435
|
-
getDraggingDisplayText:
|
|
2448
|
+
getDraggingDisplayText: s,
|
|
2436
2449
|
getPropConfig: A,
|
|
2437
|
-
getDragScopeElement:
|
|
2438
|
-
onAcceptMovedChildElement:
|
|
2450
|
+
getDragScopeElement: y,
|
|
2451
|
+
onAcceptMovedChildElement: h,
|
|
2439
2452
|
onAcceptNewChildElement: O,
|
|
2440
2453
|
onChildElementMovedOut: k,
|
|
2441
2454
|
addNewChildComponentSchema: x,
|
|
2442
2455
|
updateDragAndDropRules: a,
|
|
2443
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
2444
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
2445
|
-
},
|
|
2456
|
+
triggerBelongedComponentToMoveWhenMoved: j(!1),
|
|
2457
|
+
triggerBelongedComponentToDeleteWhenDeleted: j(!1)
|
|
2458
|
+
}, m;
|
|
2446
2459
|
}
|
|
2447
|
-
const
|
|
2460
|
+
const Pt = /* @__PURE__ */ Y({
|
|
2448
2461
|
name: "FDesignerInnerItem",
|
|
2449
|
-
props:
|
|
2462
|
+
props: St,
|
|
2450
2463
|
emits: ["selectionChange", "addComponent", "removeComponent"],
|
|
2451
|
-
setup(
|
|
2452
|
-
const n =
|
|
2464
|
+
setup(r, e) {
|
|
2465
|
+
const n = j(r.canMove), a = 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(), c = $("canvas-dragula"), d = j(), s = $("design-item-context"), y = {
|
|
2453
2466
|
designerItemElementRef: p,
|
|
2454
2467
|
componentInstance: d,
|
|
2455
|
-
schema:
|
|
2456
|
-
parent:
|
|
2468
|
+
schema: g.value,
|
|
2469
|
+
parent: s,
|
|
2457
2470
|
setupContext: e
|
|
2458
2471
|
};
|
|
2459
|
-
Re("design-item-context",
|
|
2460
|
-
const
|
|
2472
|
+
Re("design-item-context", y);
|
|
2473
|
+
const h = W(() => ({
|
|
2461
2474
|
"farris-component": !0,
|
|
2475
|
+
// 受position-relative影响,整个容器的高度不能被撑起
|
|
2476
|
+
"flex-fill": r.id == "root-component",
|
|
2462
2477
|
"position-relative": n.value || u.value,
|
|
2463
|
-
"farris-nested":
|
|
2478
|
+
"farris-nested": m.value,
|
|
2464
2479
|
"can-move": n.value,
|
|
2465
2480
|
"d-none": p.value && p.value.classList.contains("d-none")
|
|
2466
2481
|
})), x = W(() => {
|
|
2467
2482
|
const t = {};
|
|
2468
|
-
return
|
|
2483
|
+
return C.value && C.value.split(";").reduce((i, f) => {
|
|
2469
2484
|
const [R, T] = f.split(":");
|
|
2470
|
-
return R && (
|
|
2485
|
+
return R && (i[R] = T), i;
|
|
2471
2486
|
}, t), t;
|
|
2472
2487
|
});
|
|
2473
|
-
function O(t,
|
|
2474
|
-
if (
|
|
2475
|
-
const f =
|
|
2488
|
+
function O(t, i) {
|
|
2489
|
+
if (s && s.schema[v.value]) {
|
|
2490
|
+
const f = s.schema[v.value].findIndex((R) => R.id === i.id);
|
|
2476
2491
|
if (f > -1) {
|
|
2477
|
-
const R =
|
|
2478
|
-
|
|
2492
|
+
const R = s.schema[v.value].length, T = s.schema[v.value][f % R];
|
|
2493
|
+
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
2494
|
}
|
|
2480
2495
|
}
|
|
2481
2496
|
}
|
|
2482
2497
|
function k(t) {
|
|
2483
2498
|
if (d.value.addNewChildComponentSchema) {
|
|
2484
|
-
const
|
|
2485
|
-
componentType:
|
|
2499
|
+
const i = {
|
|
2500
|
+
componentType: M.value,
|
|
2486
2501
|
label: S.value,
|
|
2487
2502
|
parentComponentInstance: d.value,
|
|
2488
2503
|
targetPosition: -1
|
|
2489
|
-
}, f = d.value.addNewChildComponentSchema(
|
|
2490
|
-
|
|
2504
|
+
}, f = d.value.addNewChildComponentSchema(i);
|
|
2505
|
+
g.value[v.value].push(f), e.emit("addComponent");
|
|
2491
2506
|
}
|
|
2492
2507
|
}
|
|
2493
2508
|
function A() {
|
|
@@ -2509,7 +2524,7 @@ const It = /* @__PURE__ */ Y({
|
|
|
2509
2524
|
class: "btn component-settings-button",
|
|
2510
2525
|
title: "删除",
|
|
2511
2526
|
ref: "removeComponent",
|
|
2512
|
-
onClick:
|
|
2527
|
+
onClick: je((i) => O(i, t), ["stop"])
|
|
2513
2528
|
}, [w("i", {
|
|
2514
2529
|
class: "f-icon f-icon-yxs_delete"
|
|
2515
2530
|
}, null)]);
|
|
@@ -2531,25 +2546,25 @@ const It = /* @__PURE__ */ Y({
|
|
|
2531
2546
|
"data-noattach": "true"
|
|
2532
2547
|
}, [w("div", null, [A(), D(), N(t)])]);
|
|
2533
2548
|
}
|
|
2534
|
-
Q(() =>
|
|
2535
|
-
|
|
2549
|
+
Q(() => r.modelValue, (t) => {
|
|
2550
|
+
g.value = t, y.schema = t;
|
|
2536
2551
|
});
|
|
2537
2552
|
function P(t) {
|
|
2538
|
-
const
|
|
2539
|
-
|
|
2553
|
+
const i = t.target;
|
|
2554
|
+
It(i);
|
|
2540
2555
|
}
|
|
2541
2556
|
function E() {
|
|
2542
|
-
var t,
|
|
2543
|
-
(
|
|
2557
|
+
var t, i;
|
|
2558
|
+
(i = (t = g.value) == null ? void 0 : t.contents) != null && i.length && p.value && p.value.addEventListener("scroll", P);
|
|
2544
2559
|
}
|
|
2545
2560
|
function l() {
|
|
2546
|
-
const t = p.value,
|
|
2547
|
-
return Mt(
|
|
2561
|
+
const t = p.value, i = j(t.children[1]);
|
|
2562
|
+
return Mt(i, y).value;
|
|
2548
2563
|
}
|
|
2549
2564
|
H(() => {
|
|
2550
2565
|
if (p.value) {
|
|
2551
|
-
const t = p.value.querySelector(`[data-dragref='${
|
|
2552
|
-
d.value = t && t.componentInstance ? t.componentInstance.value : l(), c && t && c.attachComponents(t,
|
|
2566
|
+
const t = p.value.querySelector(`[data-dragref='${g.value.id}-container']`);
|
|
2567
|
+
d.value = t && t.componentInstance ? t.componentInstance.value : l(), c && t && c.attachComponents(t, g.value), m.value = d.value.canNested !== void 0 ? d.value.canNested : m.value, a.value = d.value.canAdd !== void 0 ? d.value.canAdd : a.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
2568
|
}
|
|
2554
2569
|
E(), ee.value++;
|
|
2555
2570
|
}), Ee(() => {
|
|
@@ -2557,27 +2572,27 @@ const It = /* @__PURE__ */ Y({
|
|
|
2557
2572
|
});
|
|
2558
2573
|
function o(t) {
|
|
2559
2574
|
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((f) => f.classList.remove("dgComponentFocused")), t && (t.preventDefault(), t.stopPropagation());
|
|
2560
|
-
const
|
|
2561
|
-
if (
|
|
2575
|
+
const i = p.value;
|
|
2576
|
+
if (i) {
|
|
2562
2577
|
const f = document.getElementsByClassName("dgComponentSelected");
|
|
2563
2578
|
if (!(f && f.length === 1 && f[0] === p.value)) {
|
|
2564
|
-
Array.from(f).forEach((
|
|
2565
|
-
const T = d.value.getDraggableDesignItemElement(
|
|
2579
|
+
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);
|
|
2580
|
+
const T = d.value.getDraggableDesignItemElement(y);
|
|
2566
2581
|
T && T.value && T.value.classList.add("dgComponentSelected");
|
|
2567
2582
|
}
|
|
2568
2583
|
}
|
|
2569
2584
|
ee.value++;
|
|
2570
2585
|
}
|
|
2571
2586
|
return () => w("div", {
|
|
2572
|
-
id: `${
|
|
2587
|
+
id: `${r.id}-design-item`,
|
|
2573
2588
|
ref: p,
|
|
2574
|
-
class:
|
|
2589
|
+
class: h.value,
|
|
2575
2590
|
style: x.value,
|
|
2576
2591
|
onClick: o
|
|
2577
|
-
}, [b(
|
|
2592
|
+
}, [b(g.value), e.slots.default && e.slots.default()]);
|
|
2578
2593
|
}
|
|
2579
2594
|
});
|
|
2580
|
-
class
|
|
2595
|
+
class kt extends ae {
|
|
2581
2596
|
constructor(e, n) {
|
|
2582
2597
|
super(e, n);
|
|
2583
2598
|
}
|
|
@@ -2640,8 +2655,8 @@ class Pt extends ae {
|
|
|
2640
2655
|
}
|
|
2641
2656
|
];
|
|
2642
2657
|
var a = this;
|
|
2643
|
-
const u = a.eventsEditorUtils.formProperties(e, a.viewModelId, n),
|
|
2644
|
-
|
|
2658
|
+
const u = a.eventsEditorUtils.formProperties(e, a.viewModelId, n), m = {};
|
|
2659
|
+
m[a.viewModelId] = {
|
|
2645
2660
|
type: "events-editor",
|
|
2646
2661
|
editor: {
|
|
2647
2662
|
initialData: u
|
|
@@ -2649,19 +2664,19 @@ class Pt extends ae {
|
|
|
2649
2664
|
}, this.propertyConfig.categories.eventsEditor = {
|
|
2650
2665
|
title: "事件",
|
|
2651
2666
|
hideTitle: !0,
|
|
2652
|
-
properties:
|
|
2667
|
+
properties: m,
|
|
2653
2668
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
2654
2669
|
refreshPanelAfterChanged: !0,
|
|
2655
2670
|
tabId: "commands",
|
|
2656
2671
|
tabName: "交互",
|
|
2657
|
-
setPropertyRelates(
|
|
2658
|
-
const S =
|
|
2672
|
+
setPropertyRelates(v, M) {
|
|
2673
|
+
const S = v.propertyValue;
|
|
2659
2674
|
delete e[a.viewModelId], S && (S.setPropertyRelates = this.setPropertyRelates, a.eventsEditorUtils.saveRelatedParameters(e, a.viewModelId, S.events, S));
|
|
2660
2675
|
}
|
|
2661
2676
|
};
|
|
2662
2677
|
}
|
|
2663
2678
|
}
|
|
2664
|
-
class
|
|
2679
|
+
class Rt extends ae {
|
|
2665
2680
|
constructor(e, n) {
|
|
2666
2681
|
super(e, n);
|
|
2667
2682
|
}
|
|
@@ -2685,7 +2700,9 @@ class kt extends ae {
|
|
|
2685
2700
|
description: "The type of a component.",
|
|
2686
2701
|
editor: {
|
|
2687
2702
|
type: "combo-list",
|
|
2688
|
-
|
|
2703
|
+
textField: "value",
|
|
2704
|
+
valueField: "key",
|
|
2705
|
+
data: [{ key: "response-toolbar-item", value: I["response-toolbar-item"].name }]
|
|
2689
2706
|
}
|
|
2690
2707
|
},
|
|
2691
2708
|
text: {
|
|
@@ -2710,8 +2727,8 @@ class kt extends ae {
|
|
|
2710
2727
|
label: "click",
|
|
2711
2728
|
name: "点击事件"
|
|
2712
2729
|
}
|
|
2713
|
-
], a = this, u = a.eventsEditorUtils.formProperties(e, a.viewModelId, n),
|
|
2714
|
-
|
|
2730
|
+
], a = this, u = a.eventsEditorUtils.formProperties(e, a.viewModelId, n), m = {};
|
|
2731
|
+
m[a.viewModelId] = {
|
|
2715
2732
|
type: "events-editor",
|
|
2716
2733
|
editor: {
|
|
2717
2734
|
initialData: u
|
|
@@ -2719,37 +2736,37 @@ class kt extends ae {
|
|
|
2719
2736
|
}, this.propertyConfig.categories.eventsEditor = {
|
|
2720
2737
|
title: "事件",
|
|
2721
2738
|
hideTitle: !0,
|
|
2722
|
-
properties:
|
|
2739
|
+
properties: m,
|
|
2723
2740
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
2724
2741
|
refreshPanelAfterChanged: !0,
|
|
2725
2742
|
tabId: "commands",
|
|
2726
2743
|
tabName: "交互",
|
|
2727
|
-
setPropertyRelates(
|
|
2728
|
-
const S =
|
|
2744
|
+
setPropertyRelates(v, M) {
|
|
2745
|
+
const S = v.propertyValue;
|
|
2729
2746
|
delete e[a.viewModelId], S && (S.setPropertyRelates = this.setPropertyRelates, a.eventsEditorUtils.saveRelatedParameters(e, a.viewModelId, S.events, S));
|
|
2730
2747
|
}
|
|
2731
2748
|
};
|
|
2732
2749
|
}
|
|
2733
2750
|
}
|
|
2734
|
-
function
|
|
2751
|
+
function Et(r, e) {
|
|
2735
2752
|
xe();
|
|
2736
|
-
const n =
|
|
2737
|
-
let u = !1,
|
|
2738
|
-
function
|
|
2753
|
+
const n = j(!1), a = j(!1);
|
|
2754
|
+
let u = !1, m = !1;
|
|
2755
|
+
function v(h) {
|
|
2739
2756
|
return !1;
|
|
2740
2757
|
}
|
|
2741
|
-
function
|
|
2758
|
+
function M(h) {
|
|
2742
2759
|
}
|
|
2743
2760
|
function S() {
|
|
2744
2761
|
return "";
|
|
2745
2762
|
}
|
|
2746
|
-
function
|
|
2747
|
-
return x.text =
|
|
2763
|
+
function g(h, x) {
|
|
2764
|
+
return x.text = h.label, x;
|
|
2748
2765
|
}
|
|
2749
|
-
function
|
|
2750
|
-
const k =
|
|
2766
|
+
function C(h, x, O) {
|
|
2767
|
+
const k = r.schema;
|
|
2751
2768
|
if ((k.appearance && k.appearance.class || "").split(" ").includes("f-form-layout")) {
|
|
2752
|
-
const D = String(
|
|
2769
|
+
const D = String(h.innerText), b = q("form-group");
|
|
2753
2770
|
return b.editor = O, b.label = D, b;
|
|
2754
2771
|
}
|
|
2755
2772
|
return O;
|
|
@@ -2758,36 +2775,36 @@ function Rt(i, e) {
|
|
|
2758
2775
|
return !1;
|
|
2759
2776
|
}
|
|
2760
2777
|
function c() {
|
|
2761
|
-
return !
|
|
2778
|
+
return !m;
|
|
2762
2779
|
}
|
|
2763
2780
|
function d() {
|
|
2764
2781
|
return !1;
|
|
2765
2782
|
}
|
|
2766
|
-
function
|
|
2783
|
+
function s() {
|
|
2767
2784
|
return u;
|
|
2768
2785
|
}
|
|
2769
|
-
function
|
|
2786
|
+
function y(h) {
|
|
2770
2787
|
let x;
|
|
2771
|
-
switch (
|
|
2788
|
+
switch (r.schema.type) {
|
|
2772
2789
|
case "tab-toolbar-item":
|
|
2773
|
-
x = new
|
|
2790
|
+
x = new kt(h, e);
|
|
2774
2791
|
break;
|
|
2775
2792
|
default:
|
|
2776
|
-
x = new
|
|
2793
|
+
x = new Rt(h, e);
|
|
2777
2794
|
}
|
|
2778
|
-
return x.getPropertyConfig(
|
|
2795
|
+
return x.getPropertyConfig(r.schema);
|
|
2779
2796
|
}
|
|
2780
2797
|
return {
|
|
2781
|
-
canAccepts:
|
|
2798
|
+
canAccepts: v,
|
|
2782
2799
|
checkCanAddComponent: d,
|
|
2783
2800
|
checkCanDeleteComponent: c,
|
|
2784
2801
|
checkCanMoveComponent: p,
|
|
2785
2802
|
getStyles: S,
|
|
2786
|
-
hideNestedPaddingInDesginerView:
|
|
2787
|
-
onAcceptNewChildElement:
|
|
2788
|
-
onAcceptMovedChildElement:
|
|
2789
|
-
onResolveNewComponentSchema:
|
|
2790
|
-
getPropsConfig:
|
|
2803
|
+
hideNestedPaddingInDesginerView: s,
|
|
2804
|
+
onAcceptNewChildElement: C,
|
|
2805
|
+
onAcceptMovedChildElement: M,
|
|
2806
|
+
onResolveNewComponentSchema: g,
|
|
2807
|
+
getPropsConfig: y,
|
|
2791
2808
|
triggerBelongedComponentToMoveWhenMoved: n,
|
|
2792
2809
|
triggerBelongedComponentToDeleteWhenDeleted: a
|
|
2793
2810
|
};
|
|
@@ -2796,30 +2813,30 @@ const De = /* @__PURE__ */ Y({
|
|
|
2796
2813
|
name: "FResponseToolbarItemDesign",
|
|
2797
2814
|
props: we,
|
|
2798
2815
|
emits: ["Click"],
|
|
2799
|
-
setup(
|
|
2800
|
-
|
|
2801
|
-
const n =
|
|
2816
|
+
setup(r, e) {
|
|
2817
|
+
j(), j();
|
|
2818
|
+
const n = j(r.alignment), a = {
|
|
2802
2819
|
id: "__more_buttons__",
|
|
2803
2820
|
text: "More"
|
|
2804
|
-
}, u =
|
|
2821
|
+
}, u = j(new G(a));
|
|
2805
2822
|
W(() => u.value.children.length > 0);
|
|
2806
|
-
const
|
|
2823
|
+
const m = j(), v = $("designer-host-service"), M = $("design-item-context"), S = Et(M, v), g = fe(m, M, S);
|
|
2807
2824
|
$("toolbar-item-handler", () => {
|
|
2808
2825
|
}), H(() => {
|
|
2809
|
-
|
|
2810
|
-
}), e.expose(
|
|
2811
|
-
function
|
|
2826
|
+
m.value.componentInstance = g;
|
|
2827
|
+
}), e.expose(g.value);
|
|
2828
|
+
function C() {
|
|
2812
2829
|
const d = {
|
|
2813
2830
|
"f-icon": !0
|
|
2814
2831
|
};
|
|
2815
|
-
if (
|
|
2816
|
-
const
|
|
2817
|
-
|
|
2832
|
+
if (r.icon) {
|
|
2833
|
+
const s = r.icon.trim().split(" ");
|
|
2834
|
+
s && s.length && s.reduce((y, h) => (y[h] = !0, y), d);
|
|
2818
2835
|
}
|
|
2819
2836
|
return d;
|
|
2820
2837
|
}
|
|
2821
2838
|
function p() {
|
|
2822
|
-
return !!(
|
|
2839
|
+
return !!(r.icon && r.icon.trim());
|
|
2823
2840
|
}
|
|
2824
2841
|
function c() {
|
|
2825
2842
|
const d = {
|
|
@@ -2827,59 +2844,59 @@ const De = /* @__PURE__ */ Y({
|
|
|
2827
2844
|
"f-rt-btn": !0,
|
|
2828
2845
|
"f-btn-ml": n.value === "right",
|
|
2829
2846
|
"f-btn-mr": n.value === "left",
|
|
2830
|
-
"btn-icontext": !!(
|
|
2847
|
+
"btn-icontext": !!(r.icon && r.icon.trim())
|
|
2831
2848
|
};
|
|
2832
|
-
if (
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2849
|
+
if (r.class) {
|
|
2850
|
+
const s = r.class.split(" ");
|
|
2851
|
+
s && s.length && s.reduce((y, h) => (y[h] = !0, y), d);
|
|
2835
2852
|
}
|
|
2836
2853
|
return d;
|
|
2837
2854
|
}
|
|
2838
2855
|
return H(() => {
|
|
2839
2856
|
}), ne(() => {
|
|
2840
2857
|
}), () => w("div", {
|
|
2841
|
-
ref:
|
|
2842
|
-
"data-dragref": `${
|
|
2858
|
+
ref: m,
|
|
2859
|
+
"data-dragref": `${M.schema.id}-container`,
|
|
2843
2860
|
class: "farris-component position-relative",
|
|
2844
2861
|
style: "display:inline-block!important;"
|
|
2845
2862
|
}, [w("button", {
|
|
2846
2863
|
type: "button",
|
|
2847
2864
|
class: c(),
|
|
2848
|
-
id:
|
|
2865
|
+
id: r.id
|
|
2849
2866
|
}, [p() && w("i", {
|
|
2850
|
-
class:
|
|
2851
|
-
}, null),
|
|
2867
|
+
class: C()
|
|
2868
|
+
}, null), r.text])]);
|
|
2852
2869
|
}
|
|
2853
|
-
}),
|
|
2870
|
+
}), jt = /* @__PURE__ */ Y({
|
|
2854
2871
|
name: "FResponseToolbarDesign",
|
|
2855
|
-
props:
|
|
2872
|
+
props: at,
|
|
2856
2873
|
emits: ["Click"],
|
|
2857
|
-
setup(
|
|
2858
|
-
const n =
|
|
2859
|
-
let a = new Array(n.value.length).fill(
|
|
2860
|
-
const u =
|
|
2874
|
+
setup(r, e) {
|
|
2875
|
+
const n = j(r.items);
|
|
2876
|
+
let a = new Array(n.value.length).fill(j());
|
|
2877
|
+
const u = j(), m = j(), v = j(r.alignment), M = {
|
|
2861
2878
|
id: "__more_buttons__",
|
|
2862
2879
|
text: "More"
|
|
2863
|
-
}, S =
|
|
2880
|
+
}, S = j(new G(M)), g = Te();
|
|
2864
2881
|
W(() => S.value.children.length > 0);
|
|
2865
|
-
const
|
|
2882
|
+
const C = j(), p = $("designer-host-service"), c = $("design-item-context"), d = xt(c.schema, p, c), s = fe(C, c, d);
|
|
2866
2883
|
$("toolbar-item-handler", () => {
|
|
2867
2884
|
}), H(() => {
|
|
2868
|
-
|
|
2869
|
-
}), e.expose(
|
|
2870
|
-
const
|
|
2885
|
+
C.value.componentInstance = s;
|
|
2886
|
+
}), e.expose(s.value);
|
|
2887
|
+
const y = W(() => ({
|
|
2871
2888
|
"f-toolbar": !0,
|
|
2872
2889
|
"f-response-toolbar": !0,
|
|
2873
2890
|
"position-relative": !0
|
|
2874
|
-
})),
|
|
2891
|
+
})), h = W(() => ({
|
|
2875
2892
|
"d-flex": !0,
|
|
2876
2893
|
"flex-nowrap": !0,
|
|
2877
|
-
"justify-content-end":
|
|
2878
|
-
"justify-content-start":
|
|
2894
|
+
"justify-content-end": v.value === "right",
|
|
2895
|
+
"justify-content-start": v.value === "left"
|
|
2879
2896
|
})), {
|
|
2880
2897
|
renderToolbarDropdown: x,
|
|
2881
2898
|
clearAllDropDown: O
|
|
2882
|
-
} =
|
|
2899
|
+
} = ut(r, g, s);
|
|
2883
2900
|
function k() {
|
|
2884
2901
|
n.value.filter((l) => l.children && l.children.length > 0).forEach((l) => {
|
|
2885
2902
|
l.expanded = !1;
|
|
@@ -2887,14 +2904,14 @@ const De = /* @__PURE__ */ Y({
|
|
|
2887
2904
|
}
|
|
2888
2905
|
const A = /* @__PURE__ */ new Map(), N = [];
|
|
2889
2906
|
function D(l) {
|
|
2890
|
-
const o =
|
|
2907
|
+
const o = m.value;
|
|
2891
2908
|
let t = l;
|
|
2892
|
-
const
|
|
2909
|
+
const i = Array.from(o.children), f = i[i.length - 1].id === "__more_buttons__" ? i[i.length - 1] : null;
|
|
2893
2910
|
if (f) {
|
|
2894
2911
|
const L = f.computedStyleMap().get("margin-left"), V = f.computedStyleMap().get("margin-right"), U = (L ? L.value : 0) + f.getBoundingClientRect().width + (V ? V.value : 0);
|
|
2895
2912
|
t -= U;
|
|
2896
2913
|
}
|
|
2897
|
-
const R =
|
|
2914
|
+
const R = i.filter((L) => L.id !== "__more_buttons__");
|
|
2898
2915
|
for (const L of R) {
|
|
2899
2916
|
const V = L.computedStyleMap().get("margin-left"), U = L.computedStyleMap().get("margin-right"), z = (V ? V.value : 0) + L.getBoundingClientRect().width + (U ? U.value : 0);
|
|
2900
2917
|
t < z ? (A.set(L.id, !0), N.push({
|
|
@@ -2912,12 +2929,12 @@ const De = /* @__PURE__ */ Y({
|
|
|
2912
2929
|
}
|
|
2913
2930
|
const T = Object.assign({}, S.value);
|
|
2914
2931
|
T.children = [];
|
|
2915
|
-
const
|
|
2916
|
-
S.value =
|
|
2932
|
+
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), []);
|
|
2933
|
+
S.value = B, n.value = _;
|
|
2917
2934
|
}
|
|
2918
2935
|
const b = new ResizeObserver((l) => {
|
|
2919
2936
|
if (l.length) {
|
|
2920
|
-
const t = l[0].contentRect.width, f =
|
|
2937
|
+
const t = l[0].contentRect.width, f = m.value.getBoundingClientRect().width;
|
|
2921
2938
|
(t < f || N.length) && D(t);
|
|
2922
2939
|
}
|
|
2923
2940
|
});
|
|
@@ -2926,32 +2943,32 @@ const De = /* @__PURE__ */ Y({
|
|
|
2926
2943
|
b.observe(l), document.body.addEventListener("click", k);
|
|
2927
2944
|
}), ne(() => {
|
|
2928
2945
|
b.disconnect(), document.body.removeEventListener("click", k);
|
|
2929
|
-
}), Q(() =>
|
|
2930
|
-
n.value =
|
|
2946
|
+
}), Q(() => r.items, () => {
|
|
2947
|
+
n.value = r.items;
|
|
2931
2948
|
}, {
|
|
2932
2949
|
deep: !0
|
|
2933
2950
|
}), Q(n, (l) => {
|
|
2934
|
-
a = new Array(n.value.length).fill(
|
|
2951
|
+
a = new Array(n.value.length).fill(j());
|
|
2935
2952
|
});
|
|
2936
|
-
function P(l, o, t,
|
|
2937
|
-
c && c.setupContext && c.setupContext.emit("selectionChange", l, o, t,
|
|
2953
|
+
function P(l, o, t, i) {
|
|
2954
|
+
c && c.setupContext && c.setupContext.emit("selectionChange", l, o, t, i);
|
|
2938
2955
|
}
|
|
2939
2956
|
function E() {
|
|
2940
|
-
const l =
|
|
2957
|
+
const l = m.value.querySelector(".dgComponentFocused.dgComponentSelected");
|
|
2941
2958
|
l == null || l.classList.remove("dgComponentSelected"), l == null || l.classList.remove("dgComponentFocused");
|
|
2942
2959
|
}
|
|
2943
2960
|
return () => w("div", {
|
|
2944
|
-
ref:
|
|
2961
|
+
ref: C,
|
|
2945
2962
|
"data-dragref": `${c.schema.id}-container`,
|
|
2946
|
-
class:
|
|
2963
|
+
class: y.value
|
|
2947
2964
|
}, [w("div", {
|
|
2948
2965
|
ref: u,
|
|
2949
|
-
class:
|
|
2966
|
+
class: h.value
|
|
2950
2967
|
}, [w("div", {
|
|
2951
|
-
ref:
|
|
2968
|
+
ref: m,
|
|
2952
2969
|
class: "d-inline-block f-response-content",
|
|
2953
2970
|
style: "white-space: nowrap;"
|
|
2954
|
-
}, [n.value.map((l, o) => w(
|
|
2971
|
+
}, [n.value.map((l, o) => w(Pt, {
|
|
2955
2972
|
ref: a[o],
|
|
2956
2973
|
class: "p-0 display-inline-block",
|
|
2957
2974
|
modelValue: l,
|
|
@@ -2960,7 +2977,7 @@ const De = /* @__PURE__ */ Y({
|
|
|
2960
2977
|
childType: "response-toolbar-item",
|
|
2961
2978
|
childLabel: "按钮",
|
|
2962
2979
|
contentKey: "buttons",
|
|
2963
|
-
componentId:
|
|
2980
|
+
componentId: r.componentId,
|
|
2964
2981
|
id: l.id,
|
|
2965
2982
|
style: "padding:0 !important;display:inline-block",
|
|
2966
2983
|
onSelectionChange: P,
|
|
@@ -2970,23 +2987,24 @@ const De = /* @__PURE__ */ Y({
|
|
|
2970
2987
|
id: l.id,
|
|
2971
2988
|
disable: l.disable,
|
|
2972
2989
|
text: l.text,
|
|
2973
|
-
icon: l.icon
|
|
2990
|
+
icon: l.icon,
|
|
2991
|
+
componentId: r.componentId
|
|
2974
2992
|
}, null)]
|
|
2975
2993
|
}))])])]);
|
|
2976
2994
|
}
|
|
2977
|
-
}),
|
|
2978
|
-
X.register = (
|
|
2979
|
-
|
|
2995
|
+
}), Vt = ie;
|
|
2996
|
+
X.register = (r, e, n) => {
|
|
2997
|
+
r["response-toolbar"] = X, e["response-toolbar"] = ie;
|
|
2980
2998
|
};
|
|
2981
|
-
X.registerDesigner = (
|
|
2982
|
-
|
|
2999
|
+
X.registerDesigner = (r, e, n) => {
|
|
3000
|
+
r["response-toolbar"] = jt, e["response-toolbar"] = ie, r["response-toolbar-item"] = De, e["response-toolbar-item"] = ct;
|
|
2983
3001
|
};
|
|
2984
|
-
const
|
|
3002
|
+
const _t = Ae(X);
|
|
2985
3003
|
export {
|
|
2986
3004
|
X as FResponseToolbar,
|
|
2987
3005
|
G as ResponseToolbarDropDownItem,
|
|
2988
|
-
|
|
3006
|
+
Nt as ResponseToolbarGroup,
|
|
2989
3007
|
Fe as ResponseToolbarItem,
|
|
2990
|
-
|
|
2991
|
-
|
|
3008
|
+
_t as default,
|
|
3009
|
+
Vt as responseToolbarResolver
|
|
2992
3010
|
};
|