@farris/ui-vue 1.2.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +63 -63
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +402 -323
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +98 -96
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +66 -66
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +118 -118
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +539 -460
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +135 -135
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1007 -312
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +97 -97
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +778 -700
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +472 -329
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2231 -1055
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +79 -79
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6408 -5034
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4762 -3511
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3442 -2742
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +73 -73
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2597 -1141
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +114 -71
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +171 -171
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3075 -2586
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5272 -8511
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1726 -1822
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +126 -126
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +620 -540
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +88 -88
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +71 -71
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3582 -2356
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10752 -8972
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +5601 -5329
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +535 -452
- package/components/nav/index.umd.cjs +2 -2
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +556 -477
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +504 -425
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1833 -1054
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +899 -870
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +576 -487
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +73 -73
- package/components/progress/index.umd.cjs +2 -2
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +1916 -1220
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +783 -886
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +3632 -2556
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +484 -405
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +152 -152
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +73 -73
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1081 -1043
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +753 -738
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +4418 -4177
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +119 -119
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +92 -91
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +59 -59
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +103 -103
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +85 -85
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +457 -378
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +1696 -1617
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +53 -53
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +268 -268
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +420 -341
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1062 -981
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +381 -379
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5252 -9560
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3920 -2692
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +373 -367
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +92 -92
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +597 -417
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +251 -251
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +17125 -16176
- package/farris.all.umd.cjs +8 -8
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +1 -1
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/data-grid/index.d.ts +5 -2
- package/types/data-grid/src/data-grid.component.d.ts +2 -1
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-view/composition/types.d.ts +18 -1
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +1 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +2 -2
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/data-grid/src/designer/use-group-column.d.ts +0 -20
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ref as w, computed as T, createVNode as M, defineComponent as
|
|
2
|
-
import { cloneDeep as
|
|
3
|
-
import
|
|
1
|
+
import { ref as w, computed as T, createVNode as M, defineComponent as G, watch as R, onMounted as _, inject as I } from "vue";
|
|
2
|
+
import { isPlainObject as W, cloneDeep as K } from "lodash-es";
|
|
3
|
+
import ee from "../response-toolbar/index.esm.js";
|
|
4
4
|
import "bignumber.js";
|
|
5
|
-
import { withInstall as
|
|
6
|
-
const
|
|
5
|
+
import { withInstall as te } from "../common/index.esm.js";
|
|
6
|
+
const J = {}, U = {};
|
|
7
7
|
function H(t) {
|
|
8
|
-
const { properties: e, title: n, ignore: o } = t, s = o && Array.isArray(o), i = Object.keys(e).reduce((y, m) => ((!s || !o.find((C) => C == m)) && (y[m] = e[m].type === "object" && e[m].properties ? H(e[m]) :
|
|
8
|
+
const { properties: e, title: n, ignore: o } = t, s = o && Array.isArray(o), i = Object.keys(e).reduce((y, m) => ((!s || !o.find((C) => C == m)) && (y[m] = e[m].type === "object" && e[m].properties ? H(e[m]) : K(e[m].default)), y), {});
|
|
9
9
|
return (!s || !o.find((y) => y == "id")) && (i.id = `${n}-${Date.now()}`), i;
|
|
10
10
|
}
|
|
11
11
|
function $(t, e = {}, n) {
|
|
12
|
-
const o =
|
|
12
|
+
const o = J[t];
|
|
13
13
|
if (o) {
|
|
14
14
|
let s = H(o);
|
|
15
|
-
const i =
|
|
15
|
+
const i = U[t];
|
|
16
16
|
return s = i ? i({ getSchemaByType: $ }, s, e, n) : s, s;
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function ne(t, e) {
|
|
21
21
|
const n = H(e);
|
|
22
|
-
return Object.keys(t).reduce((o, s) => (o[s] &&
|
|
22
|
+
return Object.keys(t).reduce((o, s) => (o[s] && W(o[s]) && W(t[s]) ? Object.assign(o[s], t[s]) : o[s] = t[s], o), n), n;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function oe(t, e) {
|
|
25
25
|
return Object.keys(t).filter((o) => t[o] != null).reduce((o, s) => {
|
|
26
26
|
if (e.has(s)) {
|
|
27
27
|
const i = e.get(s);
|
|
@@ -36,11 +36,11 @@ function ne(t, e) {
|
|
|
36
36
|
return o;
|
|
37
37
|
}, {});
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const o =
|
|
41
|
-
return
|
|
39
|
+
function re(t, e, n = /* @__PURE__ */ new Map()) {
|
|
40
|
+
const o = ne(t, e);
|
|
41
|
+
return oe(o, n);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function ae(t = {}) {
|
|
44
44
|
function e(c, b, f, u) {
|
|
45
45
|
if (typeof f == "number")
|
|
46
46
|
return u[c].length === f;
|
|
@@ -94,7 +94,7 @@ function re(t = {}) {
|
|
|
94
94
|
}
|
|
95
95
|
return { parseValueSchema: C };
|
|
96
96
|
}
|
|
97
|
-
const
|
|
97
|
+
const se = {
|
|
98
98
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
99
99
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
100
100
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -131,22 +131,23 @@ const ae = {
|
|
|
131
131
|
uploader: { type: "uploader", name: "附件上传", icon: "FileUpload" },
|
|
132
132
|
"page-header": { type: "page-header", name: "页头", icon: "Header" },
|
|
133
133
|
"page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
|
|
134
|
-
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" }
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
135
|
+
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
|
|
136
|
+
}, ce = {}, ie = {};
|
|
137
|
+
ae();
|
|
138
|
+
function le(t, e, n = /* @__PURE__ */ new Map(), o = (y, m, C) => m, s = {}, i = (y) => y) {
|
|
139
|
+
return J[e.title] = e, U[e.title] = o, ce[e.title] = s, ie[e.title] = i, (y = {}) => {
|
|
140
|
+
const m = re(y, e, n), C = Object.keys(t).reduce((c, b) => (c[b] = t[b].default, c), {});
|
|
140
141
|
return Object.assign(C, m);
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function pe(t, e) {
|
|
144
145
|
return { customClass: e.class, customStyle: e.style };
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function ue(t, e, n) {
|
|
147
148
|
return e ? { enableAccordion: n.accordionMode } : { enableAccordion: "" };
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function fe(t, e) {
|
|
150
151
|
return e && e.contents && e.contents.length && e.contents.forEach((n) => {
|
|
151
152
|
n.title && (n.text = n.title);
|
|
152
153
|
}), {
|
|
@@ -154,13 +155,13 @@ function ue(t, e) {
|
|
|
154
155
|
buttonPosition: e.position
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
|
-
const
|
|
158
|
-
["appearance",
|
|
158
|
+
const de = /* @__PURE__ */ new Map([
|
|
159
|
+
["appearance", pe],
|
|
159
160
|
["expanded", "expandStatus"],
|
|
160
|
-
["enableAccordion",
|
|
161
|
-
["toolbar",
|
|
161
|
+
["enableAccordion", ue],
|
|
162
|
+
["toolbar", fe]
|
|
162
163
|
]);
|
|
163
|
-
function
|
|
164
|
+
function ye(t, e, n, o) {
|
|
164
165
|
const s = Math.random().toString().slice(2, 6), i = n.parentComponentInstance;
|
|
165
166
|
Object.assign(e, {
|
|
166
167
|
id: `section-${s}`,
|
|
@@ -180,17 +181,17 @@ function de(t, e, n, o) {
|
|
|
180
181
|
});
|
|
181
182
|
const m = i.schema;
|
|
182
183
|
switch (m && m.type) {
|
|
183
|
-
case
|
|
184
|
+
case se.splitter.type: {
|
|
184
185
|
e.appearance.class = "f-section-in-main";
|
|
185
186
|
break;
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
return y;
|
|
189
190
|
}
|
|
190
|
-
function
|
|
191
|
-
return n.parentComponentInstance ?
|
|
191
|
+
function be(t, e, n, o) {
|
|
192
|
+
return n.parentComponentInstance ? ye(t, e, n) : e;
|
|
192
193
|
}
|
|
193
|
-
const
|
|
194
|
+
const me = "https://json-schema.org/draft/2020-12/schema", he = "https://farris-design.gitee.io/section.schema.json", ge = "section", Ce = "A Farris Container Component", ve = "object", je = {
|
|
194
195
|
id: {
|
|
195
196
|
description: "The unique identifier for a Section",
|
|
196
197
|
type: "string"
|
|
@@ -315,18 +316,18 @@ const be = "https://json-schema.org/draft/2020-12/schema", me = "https://farris-
|
|
|
315
316
|
},
|
|
316
317
|
default: null
|
|
317
318
|
}
|
|
318
|
-
},
|
|
319
|
+
}, Te = [
|
|
319
320
|
"id",
|
|
320
321
|
"type",
|
|
321
322
|
"contents"
|
|
322
|
-
],
|
|
323
|
-
$schema:
|
|
324
|
-
$id:
|
|
325
|
-
title:
|
|
326
|
-
description:
|
|
327
|
-
type:
|
|
328
|
-
properties:
|
|
329
|
-
required:
|
|
323
|
+
], Ae = {
|
|
324
|
+
$schema: me,
|
|
325
|
+
$id: he,
|
|
326
|
+
title: ge,
|
|
327
|
+
description: Ce,
|
|
328
|
+
type: ve,
|
|
329
|
+
properties: je,
|
|
330
|
+
required: Te
|
|
330
331
|
}, L = {
|
|
331
332
|
/** 设置内容区域样式 */
|
|
332
333
|
contentClass: { type: String, default: "" },
|
|
@@ -371,8 +372,8 @@ const be = "https://json-schema.org/draft/2020-12/schema", me = "https://farris-
|
|
|
371
372
|
// toolbarPosition: { type: String, default: '' },
|
|
372
373
|
// toolbarButtons: { type: Array<object>, default: [] },
|
|
373
374
|
// toolbar: { type: Object as PropType<ToolbarConfig>, default: {} }
|
|
374
|
-
},
|
|
375
|
-
function
|
|
375
|
+
}, Z = le(L, Ae, de, be);
|
|
376
|
+
function we(t, e, n) {
|
|
376
377
|
let o;
|
|
377
378
|
function s() {
|
|
378
379
|
!t || !e.value || (n.value = !n.value, n.value ? i() : y());
|
|
@@ -408,25 +409,25 @@ function Ae(t, e, n) {
|
|
|
408
409
|
}
|
|
409
410
|
return { onClickMaxMinIcon: s };
|
|
410
411
|
}
|
|
411
|
-
function
|
|
412
|
+
function z(t, e) {
|
|
412
413
|
const n = w(t.buttons), o = T(() => t.buttonPosition === "inHead" ? "right" : "left"), s = T(() => "f-section-toolbar" + (t.buttonPosition === "inHead" ? " f-section-header--toolbar" : " f-section-content--toolbar")), i = T(() => {
|
|
413
414
|
t.buttons && t.buttons.length > 0 && t.buttonPosition;
|
|
414
415
|
});
|
|
415
416
|
function y(m) {
|
|
416
417
|
e.emit("Click", m);
|
|
417
418
|
}
|
|
418
|
-
return () => i && M(
|
|
419
|
+
return () => i && M(ee, {
|
|
419
420
|
customClass: s.value,
|
|
420
421
|
items: n.value,
|
|
421
422
|
onClick: y,
|
|
422
423
|
alignment: o.value
|
|
423
424
|
}, null);
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
+
function Q(t, e, n, o, s, i) {
|
|
426
427
|
w(t.subTitle);
|
|
427
|
-
const y = T(() => t.buttonPosition), m =
|
|
428
|
+
const y = T(() => t.buttonPosition), m = z(t, e), {
|
|
428
429
|
onClickMaxMinIcon: C
|
|
429
|
-
} =
|
|
430
|
+
} = we(o, s, i), c = T(() => !!t.subTitle), b = T(() => t.enableMaximize), f = T(() => t.enableAccordion != ""), u = T(() => {
|
|
430
431
|
const d = {
|
|
431
432
|
"f-section-header": !0
|
|
432
433
|
};
|
|
@@ -487,8 +488,8 @@ function Z(t, e, n, o, s, i) {
|
|
|
487
488
|
}
|
|
488
489
|
return () => t.showHeader && (e.slots.header ? l() : j());
|
|
489
490
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
491
|
+
const Se = ["moz", "ms", "webkit"];
|
|
492
|
+
function Pe() {
|
|
492
493
|
let t = 0;
|
|
493
494
|
return (e) => {
|
|
494
495
|
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - t)), s = setTimeout(() => {
|
|
@@ -497,26 +498,26 @@ function Se() {
|
|
|
497
498
|
return t = n + o, s;
|
|
498
499
|
};
|
|
499
500
|
}
|
|
500
|
-
function
|
|
501
|
+
function Me() {
|
|
501
502
|
if (typeof window > "u")
|
|
502
503
|
return () => 0;
|
|
503
504
|
if (window.requestAnimationFrame)
|
|
504
505
|
return window.requestAnimationFrame.bind(window);
|
|
505
|
-
const t =
|
|
506
|
-
return t ? window[`${t}RequestAnimationFrame`] :
|
|
506
|
+
const t = Se.filter((e) => `${e}RequestAnimationFrame` in window)[0];
|
|
507
|
+
return t ? window[`${t}RequestAnimationFrame`] : Pe();
|
|
507
508
|
}
|
|
508
|
-
|
|
509
|
+
Me();
|
|
509
510
|
function O(t, e) {
|
|
510
511
|
return ((e == null ? void 0 : e.split(" ")) || []).reduce((o, s) => (s && (o[s] = !0), o), t), t;
|
|
511
512
|
}
|
|
512
|
-
const x = /* @__PURE__ */
|
|
513
|
+
const x = /* @__PURE__ */ G({
|
|
513
514
|
name: "FSection",
|
|
514
515
|
props: L,
|
|
515
516
|
emits: [],
|
|
516
517
|
setup(t, e) {
|
|
517
518
|
const n = w();
|
|
518
519
|
let o = w();
|
|
519
|
-
const s = w(t.customClass), i = T(() => t.enableAccordion), y = w(t.expandStatus), m = T(() => t.buttonPosition), C = w(!1), c =
|
|
520
|
+
const s = w(t.customClass), i = T(() => t.enableAccordion), y = w(t.expandStatus), m = T(() => t.buttonPosition), C = w(!1), c = Q(t, e, y, n, o, C), b = z(t, e), f = T(() => {
|
|
520
521
|
const a = {
|
|
521
522
|
"f-section": !0,
|
|
522
523
|
"f-section-accordion": i.value === "default",
|
|
@@ -541,9 +542,9 @@ const x = /* @__PURE__ */ W({
|
|
|
541
542
|
class: u.value
|
|
542
543
|
}, [m.value === "inContent" && b(), e.slots.default && e.slots.default()]);
|
|
543
544
|
}
|
|
544
|
-
return
|
|
545
|
+
return R(() => t.expandStatus, (a, p) => {
|
|
545
546
|
a !== p && (y.value = a);
|
|
546
|
-
}),
|
|
547
|
+
}), _(() => {
|
|
547
548
|
n && n.value && (o.value = n.value.parentElement);
|
|
548
549
|
}), () => M("div", {
|
|
549
550
|
class: f.value,
|
|
@@ -551,7 +552,7 @@ const x = /* @__PURE__ */ W({
|
|
|
551
552
|
}, [c(), r(), l()]);
|
|
552
553
|
}
|
|
553
554
|
});
|
|
554
|
-
function
|
|
555
|
+
function ke() {
|
|
555
556
|
function t(e) {
|
|
556
557
|
var s, i;
|
|
557
558
|
if (!e)
|
|
@@ -571,7 +572,7 @@ function Me() {
|
|
|
571
572
|
basalDragulaRuleForContainer: t
|
|
572
573
|
};
|
|
573
574
|
}
|
|
574
|
-
const
|
|
575
|
+
const De = "https://json-schema.org/draft/2020-12/schema", Ee = "https://farris-design.gitee.io/dragging-rules.schema.json", Oe = "Dragging Rules", xe = "The rules of designer canvas", Ne = "object", Fe = {
|
|
575
576
|
"f-page": {
|
|
576
577
|
description: "The root class of page designed by farris.",
|
|
577
578
|
type: "object",
|
|
@@ -1209,15 +1210,15 @@ const ke = "https://json-schema.org/draft/2020-12/schema", De = "https://farris-
|
|
|
1209
1210
|
description: "",
|
|
1210
1211
|
type: "object"
|
|
1211
1212
|
}
|
|
1212
|
-
},
|
|
1213
|
-
$schema:
|
|
1214
|
-
$id:
|
|
1215
|
-
title:
|
|
1216
|
-
description:
|
|
1217
|
-
type:
|
|
1218
|
-
properties:
|
|
1213
|
+
}, Be = {
|
|
1214
|
+
$schema: De,
|
|
1215
|
+
$id: Ee,
|
|
1216
|
+
title: Oe,
|
|
1217
|
+
description: xe,
|
|
1218
|
+
type: Ne,
|
|
1219
|
+
properties: Fe
|
|
1219
1220
|
}, B = /* @__PURE__ */ new Map();
|
|
1220
|
-
function
|
|
1221
|
+
function $e() {
|
|
1221
1222
|
function t(r, l, a, p) {
|
|
1222
1223
|
var j;
|
|
1223
1224
|
if (typeof a == "number")
|
|
@@ -1296,7 +1297,7 @@ function Be() {
|
|
|
1296
1297
|
}
|
|
1297
1298
|
}
|
|
1298
1299
|
function u() {
|
|
1299
|
-
const { properties: r } =
|
|
1300
|
+
const { properties: r } = Be;
|
|
1300
1301
|
Object.keys(r).forEach((l) => {
|
|
1301
1302
|
f(l, r[l], B);
|
|
1302
1303
|
});
|
|
@@ -1307,7 +1308,7 @@ function Be() {
|
|
|
1307
1308
|
}
|
|
1308
1309
|
return u(), { getRuleValue: g };
|
|
1309
1310
|
}
|
|
1310
|
-
const
|
|
1311
|
+
const He = {
|
|
1311
1312
|
title: "section",
|
|
1312
1313
|
description: "A Farris Container Component",
|
|
1313
1314
|
type: "object",
|
|
@@ -1410,14 +1411,14 @@ const $e = {
|
|
|
1410
1411
|
}
|
|
1411
1412
|
}
|
|
1412
1413
|
};
|
|
1413
|
-
function
|
|
1414
|
-
const n = w(!1), o = w(!1), s =
|
|
1414
|
+
function Le(t, e) {
|
|
1415
|
+
const n = w(!1), o = w(!1), s = $e();
|
|
1415
1416
|
let i = !0, y = !1, m, C = !1;
|
|
1416
1417
|
function c(a) {
|
|
1417
|
-
return
|
|
1418
|
+
return He;
|
|
1418
1419
|
}
|
|
1419
1420
|
function b(a) {
|
|
1420
|
-
return !(!
|
|
1421
|
+
return !(!ke().basalDragulaRuleForContainer(a) || !i);
|
|
1421
1422
|
}
|
|
1422
1423
|
function f() {
|
|
1423
1424
|
return !C;
|
|
@@ -1432,9 +1433,9 @@ function He(t, e) {
|
|
|
1432
1433
|
}
|
|
1433
1434
|
function l() {
|
|
1434
1435
|
n.value = !1, o.value = !1, C = !1, i = !0;
|
|
1435
|
-
const a = t, p = a.appearance && a.appearance.class || "", j = p ? p.split(" ") : [], d = a.contents || [], v = d.length ? d[0] : null, S = v && v.appearance && v.appearance.class || "", h = S ? S.split(" ") : [], P = d.length ? d.reduce((
|
|
1436
|
-
const q = F && F.appearance ? F.appearance.class : "",
|
|
1437
|
-
return
|
|
1436
|
+
const a = t, p = a.appearance && a.appearance.class || "", j = p ? p.split(" ") : [], d = a.contents || [], v = d.length ? d[0] : null, S = v && v.appearance && v.appearance.class || "", h = S ? S.split(" ") : [], P = d.length ? d.reduce((V, F) => {
|
|
1437
|
+
const q = F && F.appearance ? F.appearance.class : "", Y = q ? q.split(" ") : [];
|
|
1438
|
+
return V.push(...Y), V;
|
|
1438
1439
|
}, []) : [], A = e, k = A && A.appearance && A.appearance.class || "", E = k ? k.split(" ") : [];
|
|
1439
1440
|
m = {
|
|
1440
1441
|
componentClass: p,
|
|
@@ -1449,8 +1450,8 @@ function He(t, e) {
|
|
|
1449
1450
|
children: d,
|
|
1450
1451
|
childrenClassList: P
|
|
1451
1452
|
};
|
|
1452
|
-
const { canAccept: D, fixed: N, hidePadding:
|
|
1453
|
-
return i = D, y =
|
|
1453
|
+
const { canAccept: D, fixed: N, hidePadding: X } = s.getRuleValue(j[0], m);
|
|
1454
|
+
return i = D, y = X, C = N, !0;
|
|
1454
1455
|
}
|
|
1455
1456
|
return {
|
|
1456
1457
|
canAccepts: b,
|
|
@@ -1464,7 +1465,7 @@ function He(t, e) {
|
|
|
1464
1465
|
getPropsConfig: c
|
|
1465
1466
|
};
|
|
1466
1467
|
}
|
|
1467
|
-
function
|
|
1468
|
+
function ze(t, e, n) {
|
|
1468
1469
|
var S;
|
|
1469
1470
|
function o() {
|
|
1470
1471
|
n != null && n.resolveComponentContext && n.resolveComponentContext();
|
|
@@ -1553,7 +1554,7 @@ function Le(t, e, n) {
|
|
|
1553
1554
|
triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || w(!1)
|
|
1554
1555
|
}, y;
|
|
1555
1556
|
}
|
|
1556
|
-
const Ve = /* @__PURE__ */
|
|
1557
|
+
const Ve = /* @__PURE__ */ G({
|
|
1557
1558
|
name: "FSectionDesign",
|
|
1558
1559
|
props: L,
|
|
1559
1560
|
emits: [],
|
|
@@ -1561,11 +1562,11 @@ const Ve = /* @__PURE__ */ W({
|
|
|
1561
1562
|
var v;
|
|
1562
1563
|
const n = w(), o = w();
|
|
1563
1564
|
let s = w();
|
|
1564
|
-
const i =
|
|
1565
|
-
m.value.styles = "display: inherit;",
|
|
1565
|
+
const i = I("design-item-context"), y = Le(i.schema, (v = i.parent) == null ? void 0 : v.schema), m = ze(n, i, y);
|
|
1566
|
+
m.value.styles = "display: inherit;", _(() => {
|
|
1566
1567
|
n.value.componentInstance = m;
|
|
1567
1568
|
}), e.expose(m.value);
|
|
1568
|
-
const C = w(t.customClass), c = T(() => t.enableAccordion), b = w(t.expandStatus), f = T(() => t.buttonPosition), u = w(!1), g =
|
|
1569
|
+
const C = w(t.customClass), c = T(() => t.enableAccordion), b = w(t.expandStatus), f = T(() => t.buttonPosition), u = w(!1), g = Q(t, e, b, o, s, u), r = z(t, e), l = T(() => {
|
|
1569
1570
|
const S = {
|
|
1570
1571
|
"f-section": !0,
|
|
1571
1572
|
"f-section-accordion": c.value === "default",
|
|
@@ -1602,15 +1603,15 @@ const Ve = /* @__PURE__ */ W({
|
|
|
1602
1603
|
}
|
|
1603
1604
|
});
|
|
1604
1605
|
x.register = (t, e, n, o) => {
|
|
1605
|
-
t.section = x, e.section =
|
|
1606
|
+
t.section = x, e.section = Z;
|
|
1606
1607
|
};
|
|
1607
1608
|
x.registerDesigner = (t, e, n) => {
|
|
1608
|
-
t.section = Ve, e.section =
|
|
1609
|
+
t.section = Ve, e.section = Z;
|
|
1609
1610
|
};
|
|
1610
|
-
const
|
|
1611
|
+
const Ue = te(x);
|
|
1611
1612
|
export {
|
|
1612
1613
|
x as Section,
|
|
1613
|
-
|
|
1614
|
-
|
|
1614
|
+
Ue as default,
|
|
1615
|
+
Z as propsResolver,
|
|
1615
1616
|
L as sectionProps
|
|
1616
1617
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(P,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("lodash-es"),require("../response-toolbar/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../response-toolbar/index.umd.js","bignumber.js","../common/index.umd.js"],o):(P=typeof globalThis<"u"?globalThis:P||self,o(P.section={},P.Vue,P.LodashES,P.FResponseToolbar,P.BigNumber,P.common))})(this,function(P,o,J,U,Se,Z){"use strict";const q={},z={};function $(t){const{properties:e,title:n,ignore:r}=t,c=r&&Array.isArray(r),l=Object.keys(e).reduce((b,h)=>((!c||!r.find(j=>j==h))&&(b[h]=e[h].type==="object"&&e[h].properties?$(e[h]):J.cloneDeep(e[h].default)),b),{});return(!c||!r.find(b=>b=="id"))&&(l.id=`${n}-${Date.now()}`),l}function x(t,e={},n){const r=q[t];if(r){let c=$(r);const l=z[t];return c=l?l({getSchemaByType:x},c,e,n):c,c}return null}function Q(t,e){const n=$(e);return Object.keys(t).reduce((r,c)=>(r[c]&&typeof r[c]=="object"?Object.assign(r[c],t[c]):r[c]=t[c],r),n),n}function X(t,e){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,c)=>{if(e.has(c)){const l=e.get(c);if(typeof l=="string")r[l]=t[c];else{const b=l(c,t[c],t);Object.assign(r,b)}}else r[c]=t[c];return r},{})}function Y(t,e,n=new Map){const r=Q(t,e);return X(r,n)}function R(t={}){function e(i,m,f,d){if(typeof f=="number")return d[i].length===f;if(typeof f=="object"){const C=Object.keys(f)[0],a=f[C];if(C==="not")return Number(d[i].length)!==Number(a);if(C==="moreThan")return Number(d[i].length)>=Number(a);if(C==="lessThan")return Number(d[i].length)<=Number(a)}return!1}function n(i,m,f,d){return d[i]&&d[i].propertyValue&&String(d[i].propertyValue.value)===String(f)}const r=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((i,m)=>(i.set(m,t[m]),i),r);function c(i,m){const f=i;return typeof m=="number"?[{target:f,operator:"length",param:null,value:Number(m)}]:typeof m=="boolean"?[{target:f,operator:"getProperty",param:i,value:!!m}]:typeof m=="object"?Object.keys(m).map(d=>{if(d==="length")return{target:f,operator:"length",param:null,value:m[d]};const C=d,a=m[d];return{target:f,operator:"getProperty",param:C,value:a}}):[]}function l(i){return Object.keys(i).reduce((f,d)=>{const C=c(d,i[d]);return f.push(...C),f},[])}function b(i,m){if(r.has(i.operator)){const f=r.get(i.operator);return f&&f(i.target,i.param,i.value,m)||!1}return!1}function h(i,m){return l(i).reduce((C,a)=>C&&b(a,m),!0)}function j(i,m){const f=Object.keys(i),d=f.includes("allOf"),C=f.includes("anyOf"),a=d||C,u=(a?i[a?d?"allOf":"anyOf":"allOf"]:[i]).map(y=>h(y,m));return d?!u.includes(!1):u.includes(!0)}return{parseValueSchema:j}}const I={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"}},K={},ee={};R();function te(t,e,n=new Map,r=(b,h,j)=>h,c={},l=b=>b){return q[e.title]=e,z[e.title]=r,K[e.title]=c,ee[e.title]=l,(b={})=>{const h=Y(b,e,n),j=Object.keys(t).reduce((i,m)=>(i[m]=t[m].default,i),{});return Object.assign(j,h)}}function ne(t,e){return{customClass:e.class,customStyle:e.style}}function oe(t,e,n){return e?{enableAccordion:n.accordionMode}:{enableAccordion:""}}function re(t,e){return e&&e.contents&&e.contents.length&&e.contents.forEach(n=>{n.title&&(n.text=n.title)}),{buttons:e.contents,buttonPosition:e.position}}const ae=new Map([["appearance",ne],["expanded","expandStatus"],["enableAccordion",oe],["toolbar",re]]);function se(t,e,n,r){const c=Math.random().toString().slice(2,6),l=n.parentComponentInstance;Object.assign(e,{id:`section-${c}`,appearance:{class:"f-section-in-mainsubcard"},enableAccordion:!1,mainTitle:e.mainTitle||"标题"});const b=t.getSchemaByType("content-container");Object.assign(b,{id:`container-${c}`,appearance:{class:"f-struct-wrapper"},contents:[e]});const h=l.schema;switch(h&&h.type){case I.splitter.type:{e.appearance.class="f-section-in-main";break}}return b}function ce(t,e,n,r){return n.parentComponentInstance?se(t,e,n):e}const ie={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},O={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}},V=te(O,ie,ae,ce);function le(t,e,n){let r;function c(){!t||!e.value||(n.value=!n.value,n.value?l():b())}function l(){r=t.value.nextElementSibling;const j=document&&document.querySelector("body");j&&(j.appendChild(t.value),t.value.style.zIndex=h())}function b(){r?e.value.insertBefore(t.value,r):e.value.appendChild(t.value),t.value.style.zIndex=null}function h(j=1){const i=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],m=Array.from(document.body.querySelectorAll(i.join(","))).filter(d=>d).map(d=>{const{display:C,zIndex:a}=window.getComputedStyle(d);return C==="none"?0:parseInt(a,10)}).filter(d=>d);let f=Math.max(...m);return f<1040&&(f=1040),f+j}return{onClickMaxMinIcon:c}}function B(t,e){const n=o.ref(t.buttons),r=o.computed(()=>t.buttonPosition==="inHead"?"right":"left"),c=o.computed(()=>"f-section-toolbar"+(t.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),l=o.computed(()=>{t.buttons&&t.buttons.length>0&&t.buttonPosition});function b(h){e.emit("Click",h)}return()=>l&&o.createVNode(U,{customClass:c.value,items:n.value,onClick:b,alignment:r.value},null)}function W(t,e,n,r,c,l){o.ref(t.subTitle);const b=o.computed(()=>t.buttonPosition),h=B(t,e),{onClickMaxMinIcon:j}=le(r,c,l),i=o.computed(()=>!!t.subTitle),m=o.computed(()=>t.enableMaximize),f=o.computed(()=>t.enableAccordion!=""),d=o.computed(()=>{const y={"f-section-header":!0};return e.slots.header&&t.headerClass.split(" ").reduce((v,g)=>(v[g]=!0,v),y),y});function C(y){y.stopPropagation(),t.enableAccordion!==""&&(n.value=!n.value)}function a(){const y=o.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":n.value})),T=o.computed(()=>({"f-icon":!0,"f-icon-maximize":!l.value,"f-icon-minimize":l.value}));return o.createVNode("div",{class:"f-max-accordion"},[m.value?o.createVNode("span",{class:T.value,onClick:j},null):"",f.value?o.createVNode("button",{class:y.value,onClick:C},[o.createVNode("span",null,[n.value?t.collapseLabel:t.expandLabel])]):""])}function p(){return e.slots.header?o.createVNode("div",{class:d.value},[e.slots.header()]):""}function s(){return o.createVNode("div",{class:"f-title",onClick:C},[o.createVNode("h4",{class:"f-title-text"},[t.mainTitle]),i.value&&o.createVNode("span",null,[t.subTitle])])}function u(){const y=o.computed(()=>{const T={"f-content":!0};return t.headerContentClass&&t.headerContentClass.split(" ").reduce((g,w)=>(g[w]=!0,g),T),T});return e.slots.headerContent?o.createVNode("div",{class:y.value},[e.slots.headerContent()]):""}function A(){return o.createVNode("div",{class:d.value},[e.slots.headerTitle?e.slots.headerTitle():s(),u(),b.value==="inHead"&&h(),(m.value||f.value)&&a()])}return()=>t.showHeader&&(e.slots.header?p():A())}const pe=["moz","ms","webkit"];function ue(){let t=0;return e=>{const n=new Date().getTime(),r=Math.max(0,16-(n-t)),c=setTimeout(()=>{e(n+r)},r);return t=n+r,c}}function de(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=pe.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:ue()}de();function k(t,e){return((e==null?void 0:e.split(" "))||[]).reduce((r,c)=>(c&&(r[c]=!0),r),t),t}const E=o.defineComponent({name:"FSection",props:O,emits:[],setup(t,e){const n=o.ref();let r=o.ref();const c=o.ref(t.customClass),l=o.computed(()=>t.enableAccordion),b=o.ref(t.expandStatus),h=o.computed(()=>t.buttonPosition),j=o.ref(!1),i=W(t,e,b,n,r,j),m=B(t,e),f=o.computed(()=>{const s={"f-section":!0,"f-section-accordion":l.value==="default","f-state-collapse":(l.value==="default"||l.value==="custom")&&!b.value,"f-section-custom-accordion":l.value==="custom","f-section-fill":t.fill,"f-section-maximize":j.value};return k(s,c.value)}),d=o.computed(()=>k({"f-section-content":!0},t.contentClass)),C=o.computed(()=>k({"f-section-extend":!0},C.value));function a(){return e.slots.extend&&o.createVNode("div",{class:C.value},[e.slots.extend()])}function p(){return o.createVNode("div",{class:d.value},[h.value==="inContent"&&m(),e.slots.default&&e.slots.default()])}return o.watch(()=>t.expandStatus,(s,u)=>{s!==u&&(b.value=s)}),o.onMounted(()=>{n&&n.value&&(r.value=n.value.parentElement)}),()=>o.createVNode("div",{class:f.value,ref:n},[i(),a(),p()])}});function fe(){function t(e){var c,l;if(!e)return!1;const n=((c=e.targetContainer)==null?void 0:c.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const r=(l=n.schema.appearance)==null?void 0:l.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const b=n.schema.type,h=(b==="response-form"||b==="content-container")&&r&&r.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!h)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:t}}const ye={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"},"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}}},F=new Map;function be(){function t(a,p,s,u){var A;if(typeof s=="number")return((A=u[a])==null?void 0:A.length)===s;if(typeof s=="object"){const y=Object.keys(s)[0],T=s[y];if(y==="not")return Number(u[a].length)!==Number(T);if(y==="moreThan")return Number(u[a].length)>=Number(T);if(y==="lessThan")return Number(u[a].length)<=Number(T)}return!1}function e(a,p,s,u){return typeof s=="boolean"?u.childrenClassList.includes(p)===!!s:!1}function n(a,p,s,u){return typeof s=="boolean"?u.parentClassList.includes(p)===!!s:!1}function r(a,p,s,u){return typeof s=="boolean"?u.parentClassList.includes(p)===!!s:!1}const c=new Map([["length",t],["hasChildren",e],["hasSibling",r],["hasParent",n]]);function l(a,p){const s=a;return typeof p=="number"?[{target:s,operator:"length",param:null,value:Number(p)}]:typeof p=="object"?Object.keys(p).map(u=>{if(u==="length")return{target:s,operator:"length",param:null,value:p[u]};const A=u,y=p[u];return{target:s,operator:a==="children"?"hasChildren":a==="parent"?"hasParent":"hasSibling",param:A,value:y}}):[]}function b(a,p){if(c.has(a.operator)){const s=c.get(a.operator);return s&&s(a.target,a.param,a.value,p)||!1}return!1}function h(a,p){return Object.keys(a).reduce((y,T)=>{const v=l(T,a[T]);return y.push(...v),y},[]).reduce((y,T)=>y&&b(T,p),!0)}function j(a,p){const s=Object.keys(a),u=s.includes("allOf"),A=s.includes("anyOf"),y=u||A,g=(y?a[y?u?"allOf":"anyOf":"allOf"]:[a]).map(S=>h(S,p));return u?!g.includes(!1):g.includes(!0)}function i(a,p){const s=a.const;return s?typeof s=="boolean"?s:typeof s=="object"?j(s,p):!1:!1}function m(a){return p=>{const s={canAccept:!0,fixed:!1,hidePadding:!1};return a&&a.properties&&Object.keys(a.properties).reduce((u,A)=>{const y=a.properties[A];return u[A]=i(y,p),u},s),s}}function f(a,p,s){if(p.type==="object"&&p.properties){const{rules:u,contents:A}=p.properties;s.set(a,m(u)),A&&Object.keys(A.properties).forEach(y=>f(y,A.properties[y],s))}}function d(){const{properties:a}=ye;Object.keys(a).forEach(p=>{f(p,a[p],F)})}function C(a,p){const s={canAccept:!0,fixed:!1,hidePadding:!0};return F.has(a)?F.get(a)(p):s}return d(),{getRuleValue:C}}const me={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"组件类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",textField:"value",valueField:"key",data:[{key:"section",value:"分组面板"}]}},mainTitle:{title:"主标题",type:"string",description:"",visible:{showHeader:!0}},subTitle:{title:"副标题",type:"string",description:"",visible:{showHeader:!0}}},setPropertyRelates(t,e){if(t)switch(t&&t.propertyID){case"mainTitle":{t.needRefreshControlTree=!0;break}}}},appearance:{title:"样式",description:"Appearance",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},showHeader:{title:"显示标题区域",type:"boolean",description:""},fill:{title:"填充内容区域",type:"boolean",description:"To fill the space of parent container in flex layout."},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}}}},extends:{title:"扩展",description:"",properties:{contentClass:{title:"内容区域样式",type:"string",description:""}}}}};function he(t,e){const n=o.ref(!1),r=o.ref(!1),c=be();let l=!0,b=!1,h,j=!1;function i(s){return me}function m(s){return!(!fe().basalDragulaRuleForContainer(s)||!l)}function f(){return!j}function d(){return!j}function C(){return b}function a(s){}function p(){n.value=!1,r.value=!1,j=!1,l=!0;const s=t,u=s.appearance&&s.appearance.class||"",A=u?u.split(" "):[],y=s.contents||[],T=y.length?y[0]:null,v=T&&T.appearance&&T.appearance.class||"",g=v?v.split(" "):[],w=y.length?y.reduce((_,L)=>{const G=L&&L.appearance?L.appearance.class:"",Ae=G?G.split(" "):[];return _.push(...Ae),_},[]):[],S=e,M=S&&S.appearance&&S.appearance.class||"",D=M?M.split(" "):[];h={componentClass:u,componentClassList:A,childContents:y,firstChildContent:T,firstChildClass:v,firstChildClassList:g,parent:S,parentClass:M,parentClassList:D,children:y,childrenClassList:w};const{canAccept:N,fixed:H,hidePadding:Te}=c.getRuleValue(A[0],h);return l=N,b=Te,j=H,!0}return{canAccepts:m,checkCanDeleteComponent:f,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:C,onAcceptMovedChildElement:a,resolveComponentContext:p,triggerBelongedComponentToMoveWhenMoved:n,triggerBelongedComponentToDeleteWhenDeleted:r,getPropsConfig:i}}function ge(t,e,n){var v;function r(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}r();const c=n&&n.getStyles&&n.getStyles()||"",l=n&&n.getDesignerClass&&n.getDesignerClass()||"",b=o.ref();function h(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function j(){return!1}function i(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function f(g){if(!g||!g.value)return null;if(g.value.schema&&g.value.schema.type==="component")return g.value;const w=o.ref(g==null?void 0:g.value.parent),S=f(w);return S||null}function d(g=e){const{componentInstance:w,designerItemElementRef:S}=g;return!w||!w.value?null:w.value.canMove?S:d(g.parent)}function C(g){return!!n&&n.canAccepts(g)}function a(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function p(){}function s(g,w){w&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(w)}function u(g,w){const{componentType:S}=g;let M=x(S,g,w);n&&n.onResolveNewComponentSchema&&(M=n.onResolveNewComponentSchema(g,M));const D=S.toLowerCase().replace("-","_");return M&&!M.id&&M.type===S&&(M.id=`${D}_${Math.random().toString().slice(2,6)}`),M}function A(g,w){const S=String(g.getAttribute("data-controltype")),M=g.getAttribute("data-feature"),D=M?JSON.parse(M):{};D.parentComponentInstance=b.value;let N=x(S,D);n&&n.onAcceptNewChildElement&&(N=n.onAcceptNewChildElement(g,w,N));const H=S.toLowerCase().replace("-","_");return N&&!N.id&&N.type===S&&(N.id=`${H}_${Math.random().toString().slice(2,6)}`),N}function y(g){}function T(...g){if(n&&n.getPropsConfig)return n.getPropsConfig(...g)}return b.value={canMove:h(),canSelectParent:j(),canDelete:i(),canNested:!m(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(v=e==null?void 0:e.parent)==null?void 0:v.componentInstance,schema:e==null?void 0:e.schema,styles:c,designerClass:l,canAccepts:C,getBelongedComponentInstance:f,getDraggableDesignItemElement:d,getDraggingDisplayText:a,getPropConfig:T,getDragScopeElement:p,onAcceptMovedChildElement:s,onAcceptNewChildElement:A,onChildElementMovedOut:y,addNewChildComponentSchema:u,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1)},b}const Ce=o.defineComponent({name:"FSectionDesign",props:O,emits:[],setup(t,e){var T;const n=o.ref(),r=o.ref();let c=o.ref();const l=o.inject("design-item-context"),b=he(l.schema,(T=l.parent)==null?void 0:T.schema),h=ge(n,l,b);h.value.styles="display: inherit;",o.onMounted(()=>{n.value.componentInstance=h}),e.expose(h.value);const j=o.ref(t.customClass),i=o.computed(()=>t.enableAccordion),m=o.ref(t.expandStatus),f=o.computed(()=>t.buttonPosition),d=o.ref(!1),C=W(t,e,m,r,c,d),a=B(t,e),p=o.computed(()=>{const v={"f-section":!0,"f-section-accordion":i.value==="default","f-state-collapse":(i.value==="default"||i.value==="custom")&&!m.value,"f-section-custom-accordion":i.value==="custom","f-section-fill":t.fill,"f-section-maximize":d.value,"f-utils-fill":!0,"p-0":!0};return k(v,j.value)}),s=o.computed(()=>k({"f-section-content":!0,"drag-container":!0},t.contentClass)),u=o.computed(()=>k({"f-section-extend":!0},u.value));function A(){return e.slots.extend&&o.createVNode("div",{class:u.value},[e.slots.extend()])}function y(){return o.createVNode("div",{class:s.value,ref:n,"data-dragref":`${l.schema.id}-container`},[f.value==="inContent"&&a(),e.slots.default&&e.slots.default()])}return()=>o.createVNode("div",{class:p.value,ref:r},[C(),A(),y()])}});E.register=(t,e,n,r)=>{t.section=E,e.section=V},E.registerDesigner=(t,e,n)=>{t.section=Ce,e.section=V};const je=Z.withInstall(E);P.Section=E,P.default=je,P.propsResolver=V,P.sectionProps=O,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(w,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("lodash-es"),require("../response-toolbar/index.umd.js"),require("bignumber.js"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../response-toolbar/index.umd.js","bignumber.js","../common/index.umd.js"],o):(w=typeof globalThis<"u"?globalThis:w||self,o(w.section={},w.Vue,w.LodashES,w.FResponseToolbar,w.BigNumber,w.common))})(this,function(w,o,$,U,Se,Z){"use strict";const z={},W={};function x(t){const{properties:e,title:n,ignore:r}=t,c=r&&Array.isArray(r),l=Object.keys(e).reduce((b,h)=>((!c||!r.find(j=>j==h))&&(b[h]=e[h].type==="object"&&e[h].properties?x(e[h]):$.cloneDeep(e[h].default)),b),{});return(!c||!r.find(b=>b=="id"))&&(l.id=`${n}-${Date.now()}`),l}function V(t,e={},n){const r=z[t];if(r){let c=x(r);const l=W[t];return c=l?l({getSchemaByType:V},c,e,n):c,c}return null}function Q(t,e){const n=x(e);return Object.keys(t).reduce((r,c)=>(r[c]&&$.isPlainObject(r[c])&&$.isPlainObject(t[c])?Object.assign(r[c],t[c]):r[c]=t[c],r),n),n}function X(t,e){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,c)=>{if(e.has(c)){const l=e.get(c);if(typeof l=="string")r[l]=t[c];else{const b=l(c,t[c],t);Object.assign(r,b)}}else r[c]=t[c];return r},{})}function Y(t,e,n=new Map){const r=Q(t,e);return X(r,n)}function R(t={}){function e(i,m,f,d){if(typeof f=="number")return d[i].length===f;if(typeof f=="object"){const C=Object.keys(f)[0],a=f[C];if(C==="not")return Number(d[i].length)!==Number(a);if(C==="moreThan")return Number(d[i].length)>=Number(a);if(C==="lessThan")return Number(d[i].length)<=Number(a)}return!1}function n(i,m,f,d){return d[i]&&d[i].propertyValue&&String(d[i].propertyValue.value)===String(f)}const r=new Map([["length",e],["getProperty",n]]);Object.keys(t).reduce((i,m)=>(i.set(m,t[m]),i),r);function c(i,m){const f=i;return typeof m=="number"?[{target:f,operator:"length",param:null,value:Number(m)}]:typeof m=="boolean"?[{target:f,operator:"getProperty",param:i,value:!!m}]:typeof m=="object"?Object.keys(m).map(d=>{if(d==="length")return{target:f,operator:"length",param:null,value:m[d]};const C=d,a=m[d];return{target:f,operator:"getProperty",param:C,value:a}}):[]}function l(i){return Object.keys(i).reduce((f,d)=>{const C=c(d,i[d]);return f.push(...C),f},[])}function b(i,m){if(r.has(i.operator)){const f=r.get(i.operator);return f&&f(i.target,i.param,i.value,m)||!1}return!1}function h(i,m){return l(i).reduce((C,a)=>C&&b(a,m),!0)}function j(i,m){const f=Object.keys(i),d=f.includes("allOf"),C=f.includes("anyOf"),a=d||C,u=(a?i[a?d?"allOf":"anyOf":"allOf"]:[i]).map(y=>h(y,m));return d?!u.includes(!1):u.includes(!0)}return{parseValueSchema:j}}const I={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"}},K={},ee={};R();function te(t,e,n=new Map,r=(b,h,j)=>h,c={},l=b=>b){return z[e.title]=e,W[e.title]=r,K[e.title]=c,ee[e.title]=l,(b={})=>{const h=Y(b,e,n),j=Object.keys(t).reduce((i,m)=>(i[m]=t[m].default,i),{});return Object.assign(j,h)}}function ne(t,e){return{customClass:e.class,customStyle:e.style}}function oe(t,e,n){return e?{enableAccordion:n.accordionMode}:{enableAccordion:""}}function re(t,e){return e&&e.contents&&e.contents.length&&e.contents.forEach(n=>{n.title&&(n.text=n.title)}),{buttons:e.contents,buttonPosition:e.position}}const ae=new Map([["appearance",ne],["expanded","expandStatus"],["enableAccordion",oe],["toolbar",re]]);function se(t,e,n,r){const c=Math.random().toString().slice(2,6),l=n.parentComponentInstance;Object.assign(e,{id:`section-${c}`,appearance:{class:"f-section-in-mainsubcard"},enableAccordion:!1,mainTitle:e.mainTitle||"标题"});const b=t.getSchemaByType("content-container");Object.assign(b,{id:`container-${c}`,appearance:{class:"f-struct-wrapper"},contents:[e]});const h=l.schema;switch(h&&h.type){case I.splitter.type:{e.appearance.class="f-section-in-main";break}}return b}function ce(t,e,n,r){return n.parentComponentInstance?se(t,e,n):e}const ie={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/section.schema.json",title:"section",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"section"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contentClass:{description:"",type:"string",default:""},contents:{description:"",type:"array",default:[]},enableAccordion:{description:"",type:"boolean",default:!1},accordionMode:{description:"",type:"string",default:"default"},enableMaximize:{description:"",type:"boolean",default:!1},expanded:{description:"",type:"boolean",default:!0},fill:{description:"",type:"boolean",default:!1},headerClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},showHeader:{description:"",type:"string",default:!0},mainTitle:{description:"",type:"string",default:""},subTitle:{description:"",type:"string",default:""},headerContentClass:{description:"",type:"string",default:""},extendClass:{description:"",type:"string",default:""},visible:{description:"",type:"boolean",default:!0},toolbar:{description:"",type:"object",properties:{type:{type:"string",default:"SectionToolbar"},position:{type:"string",default:"inHead"},contents:{type:"array",default:[]}},default:null}},required:["id","type","contents"]},E={contentClass:{type:String,default:""},customClass:{type:String,default:""},enableAccordion:{type:String,default:""},expandStatus:{type:Boolean,default:!0},mainTitle:{type:String,default:""},showHeader:{type:Boolean,default:!0},subTitle:{type:String,default:""},expandLabel:{type:String,default:"展开"},collapseLabel:{type:String,default:"收起"},headerClass:{type:String,default:""},enableMaximize:{type:Boolean,default:!1},headerContentClass:{type:String,default:""},extendClass:{type:String,default:""},buttons:{type:Array,default:[]},buttonPosition:{type:String,default:"inHead"},fill:{type:Boolean,default:!1}},B=te(E,ie,ae,ce);function le(t,e,n){let r;function c(){!t||!e.value||(n.value=!n.value,n.value?l():b())}function l(){r=t.value.nextElementSibling;const j=document&&document.querySelector("body");j&&(j.appendChild(t.value),t.value.style.zIndex=h())}function b(){r?e.value.insertBefore(t.value,r):e.value.appendChild(t.value),t.value.style.zIndex=null}function h(j=1){const i=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],m=Array.from(document.body.querySelectorAll(i.join(","))).filter(d=>d).map(d=>{const{display:C,zIndex:a}=window.getComputedStyle(d);return C==="none"?0:parseInt(a,10)}).filter(d=>d);let f=Math.max(...m);return f<1040&&(f=1040),f+j}return{onClickMaxMinIcon:c}}function F(t,e){const n=o.ref(t.buttons),r=o.computed(()=>t.buttonPosition==="inHead"?"right":"left"),c=o.computed(()=>"f-section-toolbar"+(t.buttonPosition==="inHead"?" f-section-header--toolbar":" f-section-content--toolbar")),l=o.computed(()=>{t.buttons&&t.buttons.length>0&&t.buttonPosition});function b(h){e.emit("Click",h)}return()=>l&&o.createVNode(U,{customClass:c.value,items:n.value,onClick:b,alignment:r.value},null)}function _(t,e,n,r,c,l){o.ref(t.subTitle);const b=o.computed(()=>t.buttonPosition),h=F(t,e),{onClickMaxMinIcon:j}=le(r,c,l),i=o.computed(()=>!!t.subTitle),m=o.computed(()=>t.enableMaximize),f=o.computed(()=>t.enableAccordion!=""),d=o.computed(()=>{const y={"f-section-header":!0};return e.slots.header&&t.headerClass.split(" ").reduce((v,g)=>(v[g]=!0,v),y),y});function C(y){y.stopPropagation(),t.enableAccordion!==""&&(n.value=!n.value)}function a(){const y=o.computed(()=>({btn:!0,"f-btn-collapse-expand":!0,"f-btn-mx":!0,"f-state-expand":n.value})),T=o.computed(()=>({"f-icon":!0,"f-icon-maximize":!l.value,"f-icon-minimize":l.value}));return o.createVNode("div",{class:"f-max-accordion"},[m.value?o.createVNode("span",{class:T.value,onClick:j},null):"",f.value?o.createVNode("button",{class:y.value,onClick:C},[o.createVNode("span",null,[n.value?t.collapseLabel:t.expandLabel])]):""])}function p(){return e.slots.header?o.createVNode("div",{class:d.value},[e.slots.header()]):""}function s(){return o.createVNode("div",{class:"f-title",onClick:C},[o.createVNode("h4",{class:"f-title-text"},[t.mainTitle]),i.value&&o.createVNode("span",null,[t.subTitle])])}function u(){const y=o.computed(()=>{const T={"f-content":!0};return t.headerContentClass&&t.headerContentClass.split(" ").reduce((g,P)=>(g[P]=!0,g),T),T});return e.slots.headerContent?o.createVNode("div",{class:y.value},[e.slots.headerContent()]):""}function A(){return o.createVNode("div",{class:d.value},[e.slots.headerTitle?e.slots.headerTitle():s(),u(),b.value==="inHead"&&h(),(m.value||f.value)&&a()])}return()=>t.showHeader&&(e.slots.header?p():A())}const pe=["moz","ms","webkit"];function ue(){let t=0;return e=>{const n=new Date().getTime(),r=Math.max(0,16-(n-t)),c=setTimeout(()=>{e(n+r)},r);return t=n+r,c}}function de(){if(typeof window>"u")return()=>0;if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);const t=pe.filter(e=>`${e}RequestAnimationFrame`in window)[0];return t?window[`${t}RequestAnimationFrame`]:ue()}de();function k(t,e){return((e==null?void 0:e.split(" "))||[]).reduce((r,c)=>(c&&(r[c]=!0),r),t),t}const O=o.defineComponent({name:"FSection",props:E,emits:[],setup(t,e){const n=o.ref();let r=o.ref();const c=o.ref(t.customClass),l=o.computed(()=>t.enableAccordion),b=o.ref(t.expandStatus),h=o.computed(()=>t.buttonPosition),j=o.ref(!1),i=_(t,e,b,n,r,j),m=F(t,e),f=o.computed(()=>{const s={"f-section":!0,"f-section-accordion":l.value==="default","f-state-collapse":(l.value==="default"||l.value==="custom")&&!b.value,"f-section-custom-accordion":l.value==="custom","f-section-fill":t.fill,"f-section-maximize":j.value};return k(s,c.value)}),d=o.computed(()=>k({"f-section-content":!0},t.contentClass)),C=o.computed(()=>k({"f-section-extend":!0},C.value));function a(){return e.slots.extend&&o.createVNode("div",{class:C.value},[e.slots.extend()])}function p(){return o.createVNode("div",{class:d.value},[h.value==="inContent"&&m(),e.slots.default&&e.slots.default()])}return o.watch(()=>t.expandStatus,(s,u)=>{s!==u&&(b.value=s)}),o.onMounted(()=>{n&&n.value&&(r.value=n.value.parentElement)}),()=>o.createVNode("div",{class:f.value,ref:n},[i(),a(),p()])}});function fe(){function t(e){var c,l;if(!e)return!1;const n=((c=e.targetContainer)==null?void 0:c.componentInstance)&&e.targetContainer.componentInstance.value;if(!n)return!1;const r=(l=n.schema.appearance)==null?void 0:l.class;if(e.controlCategory==="input"||e.controlType==="form-group"){const b=n.schema.type,h=(b==="response-form"||b==="content-container")&&r&&r.includes("farris-form");if(n.schema.type!=="response-layout-item"&&!h)return!1}return e.controlType!=="field-set"}return{basalDragulaRuleForContainer:t}}const ye={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"},"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}}},H=new Map;function be(){function t(a,p,s,u){var A;if(typeof s=="number")return((A=u[a])==null?void 0:A.length)===s;if(typeof s=="object"){const y=Object.keys(s)[0],T=s[y];if(y==="not")return Number(u[a].length)!==Number(T);if(y==="moreThan")return Number(u[a].length)>=Number(T);if(y==="lessThan")return Number(u[a].length)<=Number(T)}return!1}function e(a,p,s,u){return typeof s=="boolean"?u.childrenClassList.includes(p)===!!s:!1}function n(a,p,s,u){return typeof s=="boolean"?u.parentClassList.includes(p)===!!s:!1}function r(a,p,s,u){return typeof s=="boolean"?u.parentClassList.includes(p)===!!s:!1}const c=new Map([["length",t],["hasChildren",e],["hasSibling",r],["hasParent",n]]);function l(a,p){const s=a;return typeof p=="number"?[{target:s,operator:"length",param:null,value:Number(p)}]:typeof p=="object"?Object.keys(p).map(u=>{if(u==="length")return{target:s,operator:"length",param:null,value:p[u]};const A=u,y=p[u];return{target:s,operator:a==="children"?"hasChildren":a==="parent"?"hasParent":"hasSibling",param:A,value:y}}):[]}function b(a,p){if(c.has(a.operator)){const s=c.get(a.operator);return s&&s(a.target,a.param,a.value,p)||!1}return!1}function h(a,p){return Object.keys(a).reduce((y,T)=>{const v=l(T,a[T]);return y.push(...v),y},[]).reduce((y,T)=>y&&b(T,p),!0)}function j(a,p){const s=Object.keys(a),u=s.includes("allOf"),A=s.includes("anyOf"),y=u||A,g=(y?a[y?u?"allOf":"anyOf":"allOf"]:[a]).map(S=>h(S,p));return u?!g.includes(!1):g.includes(!0)}function i(a,p){const s=a.const;return s?typeof s=="boolean"?s:typeof s=="object"?j(s,p):!1:!1}function m(a){return p=>{const s={canAccept:!0,fixed:!1,hidePadding:!1};return a&&a.properties&&Object.keys(a.properties).reduce((u,A)=>{const y=a.properties[A];return u[A]=i(y,p),u},s),s}}function f(a,p,s){if(p.type==="object"&&p.properties){const{rules:u,contents:A}=p.properties;s.set(a,m(u)),A&&Object.keys(A.properties).forEach(y=>f(y,A.properties[y],s))}}function d(){const{properties:a}=ye;Object.keys(a).forEach(p=>{f(p,a[p],H)})}function C(a,p){const s={canAccept:!0,fixed:!1,hidePadding:!0};return H.has(a)?H.get(a)(p):s}return d(),{getRuleValue:C}}const me={title:"section",description:"A Farris Container Component",type:"object",categories:{basic:{title:"基本信息",description:"Basic Infomation",properties:{id:{title:"标识",type:"string",description:"The identifier of a component.",readonly:!0},type:{title:"组件类型",type:"enum",description:"The type of a component.",editor:{type:"combo-list",textField:"value",valueField:"key",data:[{key:"section",value:"分组面板"}]}},mainTitle:{title:"主标题",type:"string",description:"",visible:{showHeader:!0}},subTitle:{title:"副标题",type:"string",description:"",visible:{showHeader:!0}}},setPropertyRelates(t,e){if(t)switch(t&&t.propertyID){case"mainTitle":{t.needRefreshControlTree=!0;break}}}},appearance:{title:"样式",description:"Appearance",properties:{class:{description:"组件的CSS样式",title:"class样式"},style:{description:"组件的内容样式",title:"style样式"},showHeader:{title:"显示标题区域",type:"boolean",description:""},fill:{title:"填充内容区域",type:"boolean",description:"To fill the space of parent container in flex layout."},enableAccordion:{title:"允许收折",type:"boolean",description:"",visible:{showHeader:!0}}}},extends:{title:"扩展",description:"",properties:{contentClass:{title:"内容区域样式",type:"string",description:""}}}}};function he(t,e){const n=o.ref(!1),r=o.ref(!1),c=be();let l=!0,b=!1,h,j=!1;function i(s){return me}function m(s){return!(!fe().basalDragulaRuleForContainer(s)||!l)}function f(){return!j}function d(){return!j}function C(){return b}function a(s){}function p(){n.value=!1,r.value=!1,j=!1,l=!0;const s=t,u=s.appearance&&s.appearance.class||"",A=u?u.split(" "):[],y=s.contents||[],T=y.length?y[0]:null,v=T&&T.appearance&&T.appearance.class||"",g=v?v.split(" "):[],P=y.length?y.reduce((G,q)=>{const J=q&&q.appearance?q.appearance.class:"",Ae=J?J.split(" "):[];return G.push(...Ae),G},[]):[],S=e,M=S&&S.appearance&&S.appearance.class||"",D=M?M.split(" "):[];h={componentClass:u,componentClassList:A,childContents:y,firstChildContent:T,firstChildClass:v,firstChildClassList:g,parent:S,parentClass:M,parentClassList:D,children:y,childrenClassList:P};const{canAccept:N,fixed:L,hidePadding:Te}=c.getRuleValue(A[0],h);return l=N,b=Te,j=L,!0}return{canAccepts:m,checkCanDeleteComponent:f,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:C,onAcceptMovedChildElement:a,resolveComponentContext:p,triggerBelongedComponentToMoveWhenMoved:n,triggerBelongedComponentToDeleteWhenDeleted:r,getPropsConfig:i}}function ge(t,e,n){var v;function r(){n!=null&&n.resolveComponentContext&&n.resolveComponentContext()}r();const c=n&&n.getStyles&&n.getStyles()||"",l=n&&n.getDesignerClass&&n.getDesignerClass()||"",b=o.ref();function h(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanMoveComponent?n.checkCanMoveComponent():!0}function j(){return!1}function i(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:n&&n.checkCanDeleteComponent?n.checkCanDeleteComponent():!0}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:n&&n.hideNestedPaddingInDesginerView?n.hideNestedPaddingInDesginerView():!1}function f(g){if(!g||!g.value)return null;if(g.value.schema&&g.value.schema.type==="component")return g.value;const P=o.ref(g==null?void 0:g.value.parent),S=f(P);return S||null}function d(g=e){const{componentInstance:P,designerItemElementRef:S}=g;return!P||!P.value?null:P.value.canMove?S:d(g.parent)}function C(g){return!!n&&n.canAccepts(g)}function a(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function p(){}function s(g,P){P&&n!=null&&n.onAcceptMovedChildElement&&n.onAcceptMovedChildElement(P)}function u(g,P){const{componentType:S}=g;let M=V(S,g,P);n&&n.onResolveNewComponentSchema&&(M=n.onResolveNewComponentSchema(g,M));const D=S.toLowerCase().replace("-","_");return M&&!M.id&&M.type===S&&(M.id=`${D}_${Math.random().toString().slice(2,6)}`),M}function A(g,P){const S=String(g.getAttribute("data-controltype")),M=g.getAttribute("data-feature"),D=M?JSON.parse(M):{};D.parentComponentInstance=b.value;let N=V(S,D);n&&n.onAcceptNewChildElement&&(N=n.onAcceptNewChildElement(g,P,N));const L=S.toLowerCase().replace("-","_");return N&&!N.id&&N.type===S&&(N.id=`${L}_${Math.random().toString().slice(2,6)}`),N}function y(g){}function T(...g){if(n&&n.getPropsConfig)return n.getPropsConfig(...g)}return b.value={canMove:h(),canSelectParent:j(),canDelete:i(),canNested:!m(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(v=e==null?void 0:e.parent)==null?void 0:v.componentInstance,schema:e==null?void 0:e.schema,styles:c,designerClass:l,canAccepts:C,getBelongedComponentInstance:f,getDraggableDesignItemElement:d,getDraggingDisplayText:a,getPropConfig:T,getDragScopeElement:p,onAcceptMovedChildElement:s,onAcceptNewChildElement:A,onChildElementMovedOut:y,addNewChildComponentSchema:u,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:!!n&&n.triggerBelongedComponentToMoveWhenMoved||o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!n&&n.triggerBelongedComponentToDeleteWhenDeleted||o.ref(!1)},b}const Ce=o.defineComponent({name:"FSectionDesign",props:E,emits:[],setup(t,e){var T;const n=o.ref(),r=o.ref();let c=o.ref();const l=o.inject("design-item-context"),b=he(l.schema,(T=l.parent)==null?void 0:T.schema),h=ge(n,l,b);h.value.styles="display: inherit;",o.onMounted(()=>{n.value.componentInstance=h}),e.expose(h.value);const j=o.ref(t.customClass),i=o.computed(()=>t.enableAccordion),m=o.ref(t.expandStatus),f=o.computed(()=>t.buttonPosition),d=o.ref(!1),C=_(t,e,m,r,c,d),a=F(t,e),p=o.computed(()=>{const v={"f-section":!0,"f-section-accordion":i.value==="default","f-state-collapse":(i.value==="default"||i.value==="custom")&&!m.value,"f-section-custom-accordion":i.value==="custom","f-section-fill":t.fill,"f-section-maximize":d.value,"f-utils-fill":!0,"p-0":!0};return k(v,j.value)}),s=o.computed(()=>k({"f-section-content":!0,"drag-container":!0},t.contentClass)),u=o.computed(()=>k({"f-section-extend":!0},u.value));function A(){return e.slots.extend&&o.createVNode("div",{class:u.value},[e.slots.extend()])}function y(){return o.createVNode("div",{class:s.value,ref:n,"data-dragref":`${l.schema.id}-container`},[f.value==="inContent"&&a(),e.slots.default&&e.slots.default()])}return()=>o.createVNode("div",{class:p.value,ref:r},[C(),A(),y()])}});O.register=(t,e,n,r)=>{t.section=O,e.section=B},O.registerDesigner=(t,e,n)=>{t.section=Ce,e.section=B};const je=Z.withInstall(O);w.Section=O,w.default=je,w.propsResolver=B,w.sectionProps=E,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|