@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
|
@@ -57,11 +57,12 @@ const D = {
|
|
|
57
57
|
uploader: { type: "uploader", name: "附件上传", icon: "FileUpload" },
|
|
58
58
|
"page-header": { type: "page-header", name: "页头", icon: "Header" },
|
|
59
59
|
"page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
|
|
60
|
-
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" }
|
|
60
|
+
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
61
|
+
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
|
|
61
62
|
};
|
|
62
63
|
var p = /* @__PURE__ */ ((a) => (a.Frame = "frame", a.dataGrid = "data-grid", a.listView = "list-view", a.form = "form", a.attachmentPanel = "attachment-panel", a.modalFrame = "modal-frame", a.table = "table", a.appointmentCalendar = "appointment-calendar", a))(p || {});
|
|
63
64
|
function E(a) {
|
|
64
|
-
const
|
|
65
|
+
const y = s("");
|
|
65
66
|
function u(e) {
|
|
66
67
|
let i = "controlIcon mr-2 fd-i-Family ", r = "";
|
|
67
68
|
switch (e == null ? void 0 : e.type) {
|
|
@@ -129,14 +130,14 @@ function E(a) {
|
|
|
129
130
|
}
|
|
130
131
|
function v(e) {
|
|
131
132
|
const i = e.length ? e[0] : null;
|
|
132
|
-
|
|
133
|
+
y.value = i.originalId;
|
|
133
134
|
const r = i ? `${i.originalId}-design-item` : "", t = document.getElementById(r);
|
|
134
135
|
t && t && t.click();
|
|
135
136
|
}
|
|
136
|
-
return { getIcon: u, getTitle: g, onChanged: v, currentSelectedNodeId:
|
|
137
|
+
return { getIcon: u, getTitle: g, onChanged: v, currentSelectedNodeId: y };
|
|
137
138
|
}
|
|
138
|
-
function G(a,
|
|
139
|
-
const u = a.data.module ? s(a.data.module.components[0]) : s(a.data), { getIcon: b, getTitle: m } =
|
|
139
|
+
function G(a, y) {
|
|
140
|
+
const u = a.data.module ? s(a.data.module.components[0]) : s(a.data), { getIcon: b, getTitle: m } = y;
|
|
140
141
|
function w(t, n, c, l) {
|
|
141
142
|
var d;
|
|
142
143
|
const o = (d = a.data.module) == null ? void 0 : d.components.find((f) => f.id === t.component);
|
|
@@ -165,8 +166,8 @@ function G(a, h) {
|
|
|
165
166
|
t = t.filter((f) => f.layer !== 0), n.push(c);
|
|
166
167
|
let l = c.originalId, o = 0, d = 1e3;
|
|
167
168
|
for (; t.length !== 0 || d === 0; ) {
|
|
168
|
-
const f = t.find((
|
|
169
|
-
f ? (n.push(f), l = f.originalId, t = t.filter((
|
|
169
|
+
const f = t.find((h) => h.originalParent === l);
|
|
170
|
+
f ? (n.push(f), l = f.originalId, t = t.filter((h) => h.originalId !== l), o = 0) : (o -= 1, l = n.slice(o)[0].originalId), d -= 1;
|
|
170
171
|
}
|
|
171
172
|
return n;
|
|
172
173
|
}
|
|
@@ -210,7 +211,7 @@ const M = /* @__PURE__ */ N({
|
|
|
210
211
|
name: "FDesignerOutline",
|
|
211
212
|
props: D,
|
|
212
213
|
emits: ["outputValue", "currentEvent", "selectionChanged"],
|
|
213
|
-
setup(a,
|
|
214
|
+
setup(a, y) {
|
|
214
215
|
const u = s(), b = s(a.selectable), m = s(a.autoCheckChildren), w = s(a.cascade), g = s(a.showTreeNodeIcons), v = s(a.showLines), e = s(a.newDataItem), i = s(a.lineColor), r = s(a.cellHeight), t = T("designer-host-service"), n = E(t), {
|
|
215
216
|
onChanged: c,
|
|
216
217
|
currentSelectedNodeId: l
|
|
@@ -219,11 +220,11 @@ const M = /* @__PURE__ */ N({
|
|
|
219
220
|
} = G(a, n);
|
|
220
221
|
let d = o();
|
|
221
222
|
function f() {
|
|
222
|
-
d = o(), u.value && u.value.updateDataSource && (u.value.updateDataSource(d), l && u.value.clearSelection && (u.value.clearSelection(),
|
|
223
|
+
d = o(), u.value && u.value.updateDataSource && (u.value.updateDataSource(d), l && u.value.clearSelection && (u.value.clearSelection(), h({
|
|
223
224
|
id: l.value
|
|
224
225
|
})));
|
|
225
226
|
}
|
|
226
|
-
function
|
|
227
|
+
function h(S) {
|
|
227
228
|
if (!S && u.value && u.value.clearSelection && u.value.clearSelection(), S && u.value && u.value.selectItem) {
|
|
228
229
|
const C = d.findIndex((x) => x.originalId === S.id);
|
|
229
230
|
if (C > -1) {
|
|
@@ -233,8 +234,8 @@ const M = /* @__PURE__ */ N({
|
|
|
233
234
|
} else l && (l.value = "");
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
|
-
return
|
|
237
|
-
selectControlTreeNode:
|
|
237
|
+
return y.expose({
|
|
238
|
+
selectControlTreeNode: h,
|
|
238
239
|
refreshControlTree: f
|
|
239
240
|
}), () => F("div", {
|
|
240
241
|
class: "designer-control-tree"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("../tree-view/index.umd.js"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","../tree-view/index.umd.js","lodash-es"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f["designer-outline"]={},f.Vue,f.treeView,f.LodashES))})(this,function(f,d,v,P){"use strict";const N={data:{type:Object,default:[]},selectable:{type:Boolean,default:!1},autoCheckChildren:{type:Boolean,default:!0},cascade:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},newDataItem:{type:Object,default:{}},lineColor:{type:String,default:"#9399a0"},cellHeight:{type:Number,default:28}},C={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"}};var g=(i=>(i.Frame="frame",i.dataGrid="data-grid",i.listView="list-view",i.form="form",i.attachmentPanel="attachment-panel",i.modalFrame="modal-frame",i.table="table",i.appointmentCalendar="appointment-calendar",i))(g||{});function B(i){const y=d.ref("");function u(e){let r="controlIcon mr-2 fd-i-Family ",a="";switch(e==null?void 0:e.type){case"form-group":{a=e.editor&&e.editor.type?`fd_pc-${e.editor.type}`:"";break}default:r+=`fd_pc-${e.type}`}return r+=a,r}function m(e,r){var n;let a=e.id;const t=r==null?void 0:r.contents;if((r==null?void 0:r.type)==="splitter"&&t&&t.length===2){const c=r.direction!=="column";e.id===((n=t[0])==null?void 0:n.id)?a=c?"左侧区域":"上方区域":a=c?"右侧区域":"下方区域"}return a}function w(e){if(e.isLikeCardContainer)return"区块";const r=e.appearance&&e.appearance.class||"",a=r.split(" ");return e.id==="page-header"&&r&&r==="f-page-header"?"页头":a.includes("f-page-header-base")?"页头容器":a.includes("f-page-header-extend")?"页头扩展容器":a.includes("f-title")?"标题容器":a.includes("f-page")?"根容器":a.includes("f-page-main")?"内容区域":a.includes("f-scrollspy-content")&&e.isScrollspyContainer?"滚动监听容器":a.includes("f-grid-is-sub")?"表格容器":a.includes("f-filter-container")?"筛选条容器":"容器"}function S(e){const{componentType:r}=e;switch(r){case g.Frame:return"根组件";case g.dataGrid:case g.table:return(i==null?void 0:i.formSchemaUtils.selectNode(e,t=>t.type===(C["tree-grid"]&&C["tree-grid"].type)))?"树表格组件":"表格组件";case g.attachmentPanel:return"附件组件";case g.listView:return"列表视图组件";case g.modalFrame:return"弹窗页面";case g.appointmentCalendar:return"预约日历组件";default:if(r.startsWith("form"))return"卡片组件"}return"组件"}function h(e,r){const a=e.name||e.text||e.label||e.title||e.mainTitle;if(a&&typeof a=="string")return a.trim();switch(e.type){case"content-container":return w(e);case"splitter-pane":return m(e,r);case"component":return S(e);default:return C[e.type]&&C[e.type].name||e.id}}function k(e){const r=e.length?e[0]:null;y.value=r.originalId;const a=r?`${r.originalId}-design-item`:"",t=document.getElementById(a);t&&t&&t.click()}return{getIcon:u,getTitle:h,onChanged:k,currentSelectedNodeId:y}}function E(i,y){const u=i.data.module?d.ref(i.data.module.components[0]):d.ref(i.data),{getIcon:m,getTitle:w}=y;function S(t,n,c,l){var s;const o=(s=i.data.module)==null?void 0:s.components.find(p=>p.id===t.component);o&&h([o],n,c,l)}function h(t,n,c,l){return t.forEach(o=>{if(o.type==="component-ref"){S(o,n,c,l);return}const s={originalId:o.id,layer:c,originalParent:l==null?void 0:l.id,name:w(o,l),type:o.type,controlIcon:m(o),rawSchema:o};n.push(P.cloneDeep(s)),(o.contents||o.buttons)&&h(o.contents||o.buttons,n,c+1,o)}),n}function k(t){const n=[],c=t.find(p=>p.layer===0);t=t.filter(p=>p.layer!==0),n.push(c);let l=c.originalId,o=0,s=1e3;for(;t.length!==0||s===0;){const p=t.find(b=>b.originalParent===l);p?(n.push(p),l=p.originalId,t=t.filter(b=>b.originalId!==l),o=0):(o-=1,l=n.slice(o)[0].originalId),s-=1}return n}function e(t){return t.forEach((n,c)=>{n.id=(c+1).toString()}),t.forEach(n=>{var c;n.parent=((c=t.find(l=>l.originalId===n.originalParent))==null?void 0:c.id)||""}),t.forEach(n=>{n.hasChildren=t.findIndex(c=>c.parent===n.id)>0}),t}function r(t){const n={originalId:"page",layer:0,originalParent:null,name:"页面",type:"Frame",controlIcon:"fd-i-Family fd_pc-module",rawSchema:u};return t[0].originalParent=n.originalId,t.unshift(n),n}function a(){let t;if(u.value){const n=[];n.push(u.value);const o=h(n,[],1,null);r(o);const s=k(o);t=e(s)}return t}return{getData:a}}const L=d.defineComponent({name:"FDesignerOutline",props:N,emits:["outputValue","currentEvent","selectionChanged"],setup(i,y){const u=d.ref(),m=d.ref(i.selectable),w=d.ref(i.autoCheckChildren),S=d.ref(i.cascade),h=d.ref(i.showTreeNodeIcons),k=d.ref(i.showLines),e=d.ref(i.newDataItem),r=d.ref(i.lineColor),a=d.ref(i.cellHeight),t=d.inject("designer-host-service"),n=B(t),{onChanged:c,currentSelectedNodeId:l}=n,{getData:o}=E(i,n);let s=o();function p(){s=o(),u.value&&u.value.updateDataSource&&(u.value.updateDataSource(s),l&&u.value.clearSelection&&(u.value.clearSelection(),b({id:l.value})))}function b(x){if(!x&&u.value&&u.value.clearSelection&&u.value.clearSelection(),x&&u.value&&u.value.selectItem){const T=s.findIndex(F=>F.originalId===x.id);if(T>-1){u.value.selectItem(T);const F=s[T];l&&(l.value=F.originalId)}else l&&(l.value="")}}return y.expose({selectControlTreeNode:b,refreshControlTree:p}),()=>d.createVNode("div",{class:"designer-control-tree"},[d.createVNode(v.FTreeView,{ref:u,data:s,selectable:m.value,autoCheckChildren:w.value,cascade:S.value,showTreeNodeIcons:h.value,showLines:k.value,newDataItem:e.value,lineColor:r.value,cellHeight:a.value,iconField:"controlIcon",onSelectionChange:c},null)])}});f.ComponentType=g,f.FDesignerOutline=L,f.designerOutlineProps=N,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("../tree-view/index.umd.js"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","../tree-view/index.umd.js","lodash-es"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f["designer-outline"]={},f.Vue,f.treeView,f.LodashES))})(this,function(f,d,v,P){"use strict";const N={data:{type:Object,default:[]},selectable:{type:Boolean,default:!1},autoCheckChildren:{type:Boolean,default:!0},cascade:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},newDataItem:{type:Object,default:{}},lineColor:{type:String,default:"#9399a0"},cellHeight:{type:Number,default:28}},C={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"}};var g=(i=>(i.Frame="frame",i.dataGrid="data-grid",i.listView="list-view",i.form="form",i.attachmentPanel="attachment-panel",i.modalFrame="modal-frame",i.table="table",i.appointmentCalendar="appointment-calendar",i))(g||{});function B(i){const y=d.ref("");function u(e){let r="controlIcon mr-2 fd-i-Family ",a="";switch(e==null?void 0:e.type){case"form-group":{a=e.editor&&e.editor.type?`fd_pc-${e.editor.type}`:"";break}default:r+=`fd_pc-${e.type}`}return r+=a,r}function m(e,r){var n;let a=e.id;const t=r==null?void 0:r.contents;if((r==null?void 0:r.type)==="splitter"&&t&&t.length===2){const c=r.direction!=="column";e.id===((n=t[0])==null?void 0:n.id)?a=c?"左侧区域":"上方区域":a=c?"右侧区域":"下方区域"}return a}function w(e){if(e.isLikeCardContainer)return"区块";const r=e.appearance&&e.appearance.class||"",a=r.split(" ");return e.id==="page-header"&&r&&r==="f-page-header"?"页头":a.includes("f-page-header-base")?"页头容器":a.includes("f-page-header-extend")?"页头扩展容器":a.includes("f-title")?"标题容器":a.includes("f-page")?"根容器":a.includes("f-page-main")?"内容区域":a.includes("f-scrollspy-content")&&e.isScrollspyContainer?"滚动监听容器":a.includes("f-grid-is-sub")?"表格容器":a.includes("f-filter-container")?"筛选条容器":"容器"}function S(e){const{componentType:r}=e;switch(r){case g.Frame:return"根组件";case g.dataGrid:case g.table:return(i==null?void 0:i.formSchemaUtils.selectNode(e,t=>t.type===(C["tree-grid"]&&C["tree-grid"].type)))?"树表格组件":"表格组件";case g.attachmentPanel:return"附件组件";case g.listView:return"列表视图组件";case g.modalFrame:return"弹窗页面";case g.appointmentCalendar:return"预约日历组件";default:if(r.startsWith("form"))return"卡片组件"}return"组件"}function h(e,r){const a=e.name||e.text||e.label||e.title||e.mainTitle;if(a&&typeof a=="string")return a.trim();switch(e.type){case"content-container":return w(e);case"splitter-pane":return m(e,r);case"component":return S(e);default:return C[e.type]&&C[e.type].name||e.id}}function k(e){const r=e.length?e[0]:null;y.value=r.originalId;const a=r?`${r.originalId}-design-item`:"",t=document.getElementById(a);t&&t&&t.click()}return{getIcon:u,getTitle:h,onChanged:k,currentSelectedNodeId:y}}function E(i,y){const u=i.data.module?d.ref(i.data.module.components[0]):d.ref(i.data),{getIcon:m,getTitle:w}=y;function S(t,n,c,l){var s;const o=(s=i.data.module)==null?void 0:s.components.find(p=>p.id===t.component);o&&h([o],n,c,l)}function h(t,n,c,l){return t.forEach(o=>{if(o.type==="component-ref"){S(o,n,c,l);return}const s={originalId:o.id,layer:c,originalParent:l==null?void 0:l.id,name:w(o,l),type:o.type,controlIcon:m(o),rawSchema:o};n.push(P.cloneDeep(s)),(o.contents||o.buttons)&&h(o.contents||o.buttons,n,c+1,o)}),n}function k(t){const n=[],c=t.find(p=>p.layer===0);t=t.filter(p=>p.layer!==0),n.push(c);let l=c.originalId,o=0,s=1e3;for(;t.length!==0||s===0;){const p=t.find(b=>b.originalParent===l);p?(n.push(p),l=p.originalId,t=t.filter(b=>b.originalId!==l),o=0):(o-=1,l=n.slice(o)[0].originalId),s-=1}return n}function e(t){return t.forEach((n,c)=>{n.id=(c+1).toString()}),t.forEach(n=>{var c;n.parent=((c=t.find(l=>l.originalId===n.originalParent))==null?void 0:c.id)||""}),t.forEach(n=>{n.hasChildren=t.findIndex(c=>c.parent===n.id)>0}),t}function r(t){const n={originalId:"page",layer:0,originalParent:null,name:"页面",type:"Frame",controlIcon:"fd-i-Family fd_pc-module",rawSchema:u};return t[0].originalParent=n.originalId,t.unshift(n),n}function a(){let t;if(u.value){const n=[];n.push(u.value);const o=h(n,[],1,null);r(o);const s=k(o);t=e(s)}return t}return{getData:a}}const L=d.defineComponent({name:"FDesignerOutline",props:N,emits:["outputValue","currentEvent","selectionChanged"],setup(i,y){const u=d.ref(),m=d.ref(i.selectable),w=d.ref(i.autoCheckChildren),S=d.ref(i.cascade),h=d.ref(i.showTreeNodeIcons),k=d.ref(i.showLines),e=d.ref(i.newDataItem),r=d.ref(i.lineColor),a=d.ref(i.cellHeight),t=d.inject("designer-host-service"),n=B(t),{onChanged:c,currentSelectedNodeId:l}=n,{getData:o}=E(i,n);let s=o();function p(){s=o(),u.value&&u.value.updateDataSource&&(u.value.updateDataSource(s),l&&u.value.clearSelection&&(u.value.clearSelection(),b({id:l.value})))}function b(x){if(!x&&u.value&&u.value.clearSelection&&u.value.clearSelection(),x&&u.value&&u.value.selectItem){const T=s.findIndex(F=>F.originalId===x.id);if(T>-1){u.value.selectItem(T);const F=s[T];l&&(l.value=F.originalId)}else l&&(l.value="")}}return y.expose({selectControlTreeNode:b,refreshControlTree:p}),()=>d.createVNode("div",{class:"designer-control-tree"},[d.createVNode(v.FTreeView,{ref:u,data:s,selectable:m.value,autoCheckChildren:w.value,cascade:S.value,showTreeNodeIcons:h.value,showLines:k.value,newDataItem:e.value,lineColor:r.value,cellHeight:a.value,iconField:"controlIcon",onSelectionChange:c},null)])}});f.ComponentType=g,f.FDesignerOutline=L,f.designerOutlineProps=N,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ref as v, onMounted as
|
|
2
|
-
import { cloneDeep as
|
|
3
|
-
const
|
|
1
|
+
import { ref as v, onMounted as Y, defineComponent as W, createVNode as y, withDirectives as A, vShow as z, Teleport as U, Fragment as J, inject as P } from "vue";
|
|
2
|
+
import { isPlainObject as X, cloneDeep as K } from "lodash-es";
|
|
3
|
+
const Z = {}, x = {};
|
|
4
4
|
function C(e) {
|
|
5
|
-
const { properties: t, title: l, ignore: o } = e, i = o && Array.isArray(o), f = Object.keys(t).reduce((m, a) => ((!i || !o.find((B) => B == a)) && (m[a] = t[a].type === "object" && t[a].properties ? C(t[a]) :
|
|
5
|
+
const { properties: t, title: l, ignore: o } = e, i = o && Array.isArray(o), f = Object.keys(t).reduce((m, a) => ((!i || !o.find((B) => B == a)) && (m[a] = t[a].type === "object" && t[a].properties ? C(t[a]) : K(t[a].default)), m), {});
|
|
6
6
|
return (!i || !o.find((m) => m == "id")) && (f.id = `${l}-${Date.now()}`), f;
|
|
7
7
|
}
|
|
8
8
|
function M(e, t = {}, l) {
|
|
9
|
-
const o =
|
|
9
|
+
const o = Z[e];
|
|
10
10
|
if (o) {
|
|
11
11
|
let i = C(o);
|
|
12
|
-
const f =
|
|
12
|
+
const f = x[e];
|
|
13
13
|
return i = f ? f({ getSchemaByType: M }, i, t, l) : i, i;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function I(e, t) {
|
|
18
18
|
const l = C(t);
|
|
19
|
-
return Object.keys(e).reduce((o, i) => (o[i] &&
|
|
19
|
+
return Object.keys(e).reduce((o, i) => (o[i] && X(o[i]) && X(e[i]) ? Object.assign(o[i], e[i]) : o[i] = e[i], o), l), l;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function ee(e, t) {
|
|
22
22
|
return Object.keys(e).filter((o) => e[o] != null).reduce((o, i) => {
|
|
23
23
|
if (t.has(i)) {
|
|
24
24
|
const f = t.get(i);
|
|
@@ -33,11 +33,11 @@ function I(e, t) {
|
|
|
33
33
|
return o;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const o =
|
|
38
|
-
return
|
|
36
|
+
function te(e, t, l = /* @__PURE__ */ new Map()) {
|
|
37
|
+
const o = I(e, t);
|
|
38
|
+
return ee(o, l);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ne(e = {}) {
|
|
41
41
|
function t(r, c, s, d) {
|
|
42
42
|
if (typeof s == "number")
|
|
43
43
|
return d[r].length === s;
|
|
@@ -91,23 +91,23 @@ function te(e = {}) {
|
|
|
91
91
|
}
|
|
92
92
|
return { parseValueSchema: B };
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
return
|
|
98
|
-
const a =
|
|
94
|
+
const oe = {}, ie = {};
|
|
95
|
+
ne();
|
|
96
|
+
function re(e, t, l = /* @__PURE__ */ new Map(), o = (m, a, B) => a, i = {}, f = (m) => m) {
|
|
97
|
+
return Z[t.title] = t, x[t.title] = o, oe[t.title] = i, ie[t.title] = f, (m = {}) => {
|
|
98
|
+
const a = te(m, t, l), B = Object.keys(e).reduce((r, c) => (r[c] = e[c].default, r), {});
|
|
99
99
|
return Object.assign(B, a);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function se(e, t) {
|
|
103
103
|
return { customClass: t.class, customStyle: t.style };
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function ae(e, t, l) {
|
|
106
106
|
return t;
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
["appearance",
|
|
110
|
-
]),
|
|
108
|
+
const le = /* @__PURE__ */ new Map([
|
|
109
|
+
["appearance", se]
|
|
110
|
+
]), ce = "https://json-schema.org/draft/2020-12/schema", ue = "https://farris-design.gitee.io/dropdown.schema.json", de = "dropdown", fe = "A Farris Component", pe = "object", me = {
|
|
111
111
|
id: {
|
|
112
112
|
description: "The unique identifier for dropdown",
|
|
113
113
|
type: "string"
|
|
@@ -169,18 +169,18 @@ const ae = /* @__PURE__ */ new Map([
|
|
|
169
169
|
type: "boolean",
|
|
170
170
|
default: !0
|
|
171
171
|
}
|
|
172
|
-
},
|
|
172
|
+
}, ye = [
|
|
173
173
|
"id",
|
|
174
174
|
"type"
|
|
175
|
-
],
|
|
176
|
-
$schema:
|
|
177
|
-
$id:
|
|
178
|
-
title:
|
|
179
|
-
description:
|
|
180
|
-
type:
|
|
181
|
-
properties:
|
|
182
|
-
required:
|
|
183
|
-
},
|
|
175
|
+
], ge = {
|
|
176
|
+
$schema: ce,
|
|
177
|
+
$id: ue,
|
|
178
|
+
title: de,
|
|
179
|
+
description: fe,
|
|
180
|
+
type: pe,
|
|
181
|
+
properties: me,
|
|
182
|
+
required: ye
|
|
183
|
+
}, be = "dropdown", we = "A Farris Component", he = "object", ve = {
|
|
184
184
|
basic: {
|
|
185
185
|
description: "Basic Infomation",
|
|
186
186
|
title: "基本信息",
|
|
@@ -233,11 +233,11 @@ const ae = /* @__PURE__ */ new Map([
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
},
|
|
237
|
-
title:
|
|
238
|
-
description:
|
|
239
|
-
type:
|
|
240
|
-
categories:
|
|
236
|
+
}, Se = {
|
|
237
|
+
title: be,
|
|
238
|
+
description: we,
|
|
239
|
+
type: he,
|
|
240
|
+
categories: ve
|
|
241
241
|
}, V = {
|
|
242
242
|
/** 默认展开或折叠 */
|
|
243
243
|
show: { type: Boolean, default: !1 },
|
|
@@ -268,11 +268,11 @@ const ae = /* @__PURE__ */ new Map([
|
|
|
268
268
|
},
|
|
269
269
|
onSelect: { type: Function, default: () => {
|
|
270
270
|
} }
|
|
271
|
-
},
|
|
272
|
-
function
|
|
271
|
+
}, _ = re(V, ge, le, ae, Se);
|
|
272
|
+
function G(e, t) {
|
|
273
273
|
let l;
|
|
274
274
|
const o = v(e.show), i = v(), f = v(), m = v(), a = 10;
|
|
275
|
-
|
|
275
|
+
Y(() => {
|
|
276
276
|
l = f.value;
|
|
277
277
|
});
|
|
278
278
|
const B = (u = 1) => {
|
|
@@ -300,21 +300,21 @@ function x(e, t) {
|
|
|
300
300
|
width: p
|
|
301
301
|
} = u.getBoundingClientRect(), { width: h, height: D, top: $ } = n.getBoundingClientRect();
|
|
302
302
|
if (u.className.indexOf("dropdown-submenu") > -1 || u.closest(".dropdown-submenu") || u.classList.contains("dropright")) {
|
|
303
|
-
const E = window.innerWidth - S - u.offsetWidth,
|
|
303
|
+
const E = window.innerWidth - S - u.offsetWidth, N = window.innerHeight - w, { position: j } = getComputedStyle(n);
|
|
304
304
|
if (j === "fixed") {
|
|
305
305
|
let H = S + u.offsetWidth;
|
|
306
|
-
n.offsetWidth > E && S > E && (H = S - h), n.style.left = H + "px", n.style.right = "auto", window.innerHeight - 2 * a < n.offsetHeight ? (n.style.top = a + "px", n.style.bottom = a + "px", n.style.maxHeight = window.innerHeight - 2 * a + "px", n.style.overflowY = "auto", n.className += " dropdown-menu-maxheight") :
|
|
306
|
+
n.offsetWidth > E && S > E && (H = S - h), n.style.left = H + "px", n.style.right = "auto", window.innerHeight - 2 * a < n.offsetHeight ? (n.style.top = a + "px", n.style.bottom = a + "px", n.style.maxHeight = window.innerHeight - 2 * a + "px", n.style.overflowY = "auto", n.className += " dropdown-menu-maxheight") : N < n.offsetHeight ? (n.style.top = "auto", n.style.bottom = a + "px") : (n.style.top = w + "px", n.style.bottom = "auto");
|
|
307
307
|
} else {
|
|
308
308
|
if (n.offsetWidth > E) {
|
|
309
309
|
const H = -h;
|
|
310
310
|
n.style.left = H + "px";
|
|
311
311
|
}
|
|
312
|
-
window.innerHeight - 2 * a < n.offsetHeight ? (n.style.top = -1 * (w - a) + "px", n.style.bottom = "auto", n.style.maxHeight = window.innerHeight - 2 * a + "px", n.style.overflowY = "auto", n.className += " dropdown-menu-maxheight") :
|
|
312
|
+
window.innerHeight - 2 * a < n.offsetHeight ? (n.style.top = -1 * (w - a) + "px", n.style.bottom = "auto", n.style.maxHeight = window.innerHeight - 2 * a + "px", n.style.overflowY = "auto", n.className += " dropdown-menu-maxheight") : N < n.offsetHeight && (n.style.top = N - n.offsetHeight - a + "px", n.style.bottom = "auto");
|
|
313
313
|
}
|
|
314
314
|
} else {
|
|
315
|
-
const { marginTop: E, marginBottom:
|
|
315
|
+
const { marginTop: E, marginBottom: N } = getComputedStyle(n);
|
|
316
316
|
let j = 0;
|
|
317
|
-
const H = Math.ceil(parseFloat(E)) + Math.ceil(parseFloat(
|
|
317
|
+
const H = Math.ceil(parseFloat(E)) + Math.ceil(parseFloat(N));
|
|
318
318
|
let R = w + k, q = S;
|
|
319
319
|
window.innerHeight - R - H < D && (R = w - D, R < 0 && (window.innerHeight - w - k > w ? (R = w + k, j = window.innerHeight - R - H - a) : (R = a, j = w - R - H))), window.innerWidth - S < h && window.innerWidth - S < S + p && (q = S - h + p), document.body.append(n), n.style.cssText = `position:fixed;bottom:unset;left:${q}px
|
|
320
320
|
!important;top:${R}px !important;right: unset;${j ? "max-height:" + j + "px;overflow-y:auto;" : ""}`, j && (n.className += " dropdown-menu-maxheight"), n.style.zIndex = B().toString();
|
|
@@ -354,7 +354,7 @@ function x(e, t) {
|
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
const
|
|
357
|
+
const De = {
|
|
358
358
|
/** 下拉框标签 */
|
|
359
359
|
label: { type: String, default: "XM1" },
|
|
360
360
|
/** 下拉框名称 */
|
|
@@ -365,9 +365,9 @@ const Se = {
|
|
|
365
365
|
divide: { type: Boolean, default: !1 },
|
|
366
366
|
onSelect: { type: Function, default: () => {
|
|
367
367
|
} }
|
|
368
|
-
},
|
|
368
|
+
}, Q = /* @__PURE__ */ W({
|
|
369
369
|
name: "FDropdownItem",
|
|
370
|
-
props:
|
|
370
|
+
props: De,
|
|
371
371
|
emits: ["select"],
|
|
372
372
|
setup(e, t) {
|
|
373
373
|
const l = v(e.value), o = v(e.label), i = v(e.disabled), f = v(e.active), m = v(e.divide), a = () => {
|
|
@@ -397,7 +397,7 @@ const Se = {
|
|
|
397
397
|
closeDropMenu: c,
|
|
398
398
|
selectItem: s,
|
|
399
399
|
resolveSize: d
|
|
400
|
-
} =
|
|
400
|
+
} = G(e, t);
|
|
401
401
|
function b(g) {
|
|
402
402
|
t.emit("select", g);
|
|
403
403
|
}
|
|
@@ -470,22 +470,22 @@ const Se = {
|
|
|
470
470
|
class: "sr-only"
|
|
471
471
|
}, null), [[z, e.splitButton]]), e.splitButton ? "" : e.title, A(y("span", {
|
|
472
472
|
class: `f-icon ${e.iconClass.toString()}`
|
|
473
|
-
}, null), [[z, e.iconClass]])]), y(
|
|
473
|
+
}, null), [[z, e.iconClass]])]), y(U, {
|
|
474
474
|
to: "body"
|
|
475
475
|
}, {
|
|
476
476
|
default: () => [y("div", {
|
|
477
477
|
ref: i,
|
|
478
478
|
class: `dropdown-menu${o.value ? " show" : ""}`
|
|
479
|
-
}, [y(
|
|
479
|
+
}, [y(J, null, [l.value.map(({
|
|
480
480
|
label: g,
|
|
481
481
|
value: T,
|
|
482
|
-
disabled:
|
|
482
|
+
disabled: O,
|
|
483
483
|
active: u,
|
|
484
484
|
divide: n
|
|
485
|
-
}) => y(
|
|
485
|
+
}) => y(Q, {
|
|
486
486
|
value: T.toString(),
|
|
487
487
|
label: g,
|
|
488
|
-
disabled:
|
|
488
|
+
disabled: O,
|
|
489
489
|
active: u,
|
|
490
490
|
divide: n,
|
|
491
491
|
onSelect: (k) => b(k)
|
|
@@ -493,7 +493,7 @@ const Se = {
|
|
|
493
493
|
})])]);
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
|
-
function
|
|
496
|
+
function Be(e, t, l) {
|
|
497
497
|
var w;
|
|
498
498
|
function o() {
|
|
499
499
|
}
|
|
@@ -530,7 +530,7 @@ function De(e, t, l) {
|
|
|
530
530
|
}
|
|
531
531
|
function T() {
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function O(p, h) {
|
|
534
534
|
}
|
|
535
535
|
function u(p, h) {
|
|
536
536
|
const { componentType: D } = p;
|
|
@@ -542,8 +542,8 @@ function De(e, t, l) {
|
|
|
542
542
|
const D = String(p.getAttribute("data-controltype")), $ = p.getAttribute("data-feature"), L = $ ? JSON.parse($) : {};
|
|
543
543
|
L.parentComponentInstance = m.value;
|
|
544
544
|
let E = M(D, L);
|
|
545
|
-
const
|
|
546
|
-
return E && !E.id && E.type === D && (E.id = `${
|
|
545
|
+
const N = D.toLowerCase().replace("-", "_");
|
|
546
|
+
return E && !E.id && E.type === D && (E.id = `${N}_${Math.random().toString().slice(2, 6)}`), E;
|
|
547
547
|
}
|
|
548
548
|
function k(p) {
|
|
549
549
|
}
|
|
@@ -566,7 +566,7 @@ function De(e, t, l) {
|
|
|
566
566
|
getDraggingDisplayText: g,
|
|
567
567
|
getPropConfig: S,
|
|
568
568
|
getDragScopeElement: T,
|
|
569
|
-
onAcceptMovedChildElement:
|
|
569
|
+
onAcceptMovedChildElement: O,
|
|
570
570
|
onAcceptNewChildElement: n,
|
|
571
571
|
onChildElementMovedOut: k,
|
|
572
572
|
addNewChildComponentSchema: u,
|
|
@@ -575,7 +575,7 @@ function De(e, t, l) {
|
|
|
575
575
|
triggerBelongedComponentToDeleteWhenDeleted: v(!1)
|
|
576
576
|
}, m;
|
|
577
577
|
}
|
|
578
|
-
const
|
|
578
|
+
const ke = /* @__PURE__ */ W({
|
|
579
579
|
name: "FDropdownDesign",
|
|
580
580
|
props: V,
|
|
581
581
|
emits: ["select"],
|
|
@@ -588,12 +588,12 @@ const Be = /* @__PURE__ */ W({
|
|
|
588
588
|
closeDropMenu: a,
|
|
589
589
|
selectItem: B,
|
|
590
590
|
resolveSize: r
|
|
591
|
-
} =
|
|
591
|
+
} = G(e, t);
|
|
592
592
|
function c(g) {
|
|
593
593
|
t.emit("select", g);
|
|
594
594
|
}
|
|
595
|
-
const s = v(), d =
|
|
596
|
-
return
|
|
595
|
+
const s = v(), d = P("design-item-context"), b = Be(s, d);
|
|
596
|
+
return Y(() => {
|
|
597
597
|
s.value.componentInstance = b;
|
|
598
598
|
}), t.expose(b.value), () => y("div", {
|
|
599
599
|
ref: s
|
|
@@ -668,35 +668,35 @@ const Be = /* @__PURE__ */ W({
|
|
|
668
668
|
class: `f-icon ${e.iconClass.toString()}`
|
|
669
669
|
}, null), [[z, e.iconClass]])]), y("div", {
|
|
670
670
|
class: `dropdown-menu${o.value ? " show" : ""}`
|
|
671
|
-
}, [y(
|
|
671
|
+
}, [y(J, null, [l.value.map(({
|
|
672
672
|
label: g,
|
|
673
673
|
value: T,
|
|
674
|
-
disabled:
|
|
674
|
+
disabled: O,
|
|
675
675
|
active: u,
|
|
676
676
|
divide: n
|
|
677
|
-
}) => y(
|
|
677
|
+
}) => y(Q, {
|
|
678
678
|
value: T.toString(),
|
|
679
679
|
label: g,
|
|
680
|
-
disabled:
|
|
680
|
+
disabled: O,
|
|
681
681
|
active: u,
|
|
682
682
|
divide: n,
|
|
683
683
|
onSelect: (k) => c(k)
|
|
684
684
|
}, null))])])])]);
|
|
685
685
|
}
|
|
686
|
-
}),
|
|
686
|
+
}), Te = {
|
|
687
687
|
install(e) {
|
|
688
688
|
e.component(F.name, F);
|
|
689
689
|
},
|
|
690
690
|
register(e, t, l, o) {
|
|
691
|
-
e.dropdown = F, t.dropdown =
|
|
691
|
+
e.dropdown = F, t.dropdown = _;
|
|
692
692
|
},
|
|
693
693
|
registerDesigner(e, t, l) {
|
|
694
|
-
e.dropdown =
|
|
694
|
+
e.dropdown = ke, t.dropdown = _;
|
|
695
695
|
}
|
|
696
696
|
};
|
|
697
697
|
export {
|
|
698
698
|
F as Dropdown,
|
|
699
|
-
|
|
699
|
+
Te as default,
|
|
700
700
|
V as dropdownProps,
|
|
701
|
-
|
|
701
|
+
_ as propsResolver
|
|
702
702
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(B,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],n):(B=typeof globalThis<"u"?globalThis:B||self,n(B.dropdown={},B.Vue,B.LodashES))})(this,function(B,n,
|
|
2
|
-
!important;top:${
|
|
1
|
+
(function(B,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],n):(B=typeof globalThis<"u"?globalThis:B||self,n(B.dropdown={},B.Vue,B.LodashES))})(this,function(B,n,M){"use strict";const C={},q={};function F(e){const{properties:t,title:c,ignore:r}=e,i=r&&Array.isArray(r),p=Object.keys(t).reduce((y,l)=>((!i||!r.find(D=>D==l))&&(y[l]=t[l].type==="object"&&t[l].properties?F(t[l]):M.cloneDeep(t[l].default)),y),{});return(!i||!r.find(y=>y=="id"))&&(p.id=`${c}-${Date.now()}`),p}function z(e,t={},c){const r=C[e];if(r){let i=F(r);const p=q[e];return i=p?p({getSchemaByType:z},i,t,c):i,i}return null}function J(e,t){const c=F(t);return Object.keys(e).reduce((r,i)=>(r[i]&&M.isPlainObject(r[i])&&M.isPlainObject(e[i])?Object.assign(r[i],e[i]):r[i]=e[i],r),c),c}function Z(e,t){return Object.keys(e).filter(r=>e[r]!=null).reduce((r,i)=>{if(t.has(i)){const p=t.get(i);if(typeof p=="string")r[p]=e[i];else{const y=p(i,e[i],e);Object.assign(r,y)}}else r[i]=e[i];return r},{})}function G(e,t,c=new Map){const r=J(e,t);return Z(r,c)}function Q(e={}){function t(s,d,a,u){if(typeof a=="number")return u[s].length===a;if(typeof a=="object"){const b=Object.keys(a)[0],g=a[b];if(b==="not")return Number(u[s].length)!==Number(g);if(b==="moreThan")return Number(u[s].length)>=Number(g);if(b==="lessThan")return Number(u[s].length)<=Number(g)}return!1}function c(s,d,a,u){return u[s]&&u[s].propertyValue&&String(u[s].propertyValue.value)===String(a)}const r=new Map([["length",t],["getProperty",c]]);Object.keys(e).reduce((s,d)=>(s.set(d,e[d]),s),r);function i(s,d){const a=s;return typeof d=="number"?[{target:a,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:a,operator:"getProperty",param:s,value:!!d}]:typeof d=="object"?Object.keys(d).map(u=>{if(u==="length")return{target:a,operator:"length",param:null,value:d[u]};const b=u,g=d[u];return{target:a,operator:"getProperty",param:b,value:g}}):[]}function p(s){return Object.keys(s).reduce((a,u)=>{const b=i(u,s[u]);return a.push(...b),a},[])}function y(s,d){if(r.has(s.operator)){const a=r.get(s.operator);return a&&a(s.target,s.param,s.value,d)||!1}return!1}function l(s,d){return p(s).reduce((b,g)=>b&&y(g,d),!0)}function D(s,d){const a=Object.keys(s),u=a.includes("allOf"),b=a.includes("anyOf"),g=u||b,f=(g?s[g?u?"allOf":"anyOf":"allOf"]:[s]).map(N=>l(N,d));return u?!f.includes(!1):f.includes(!0)}return{parseValueSchema:D}}const U={},x={};Q();function P(e,t,c=new Map,r=(y,l,D)=>l,i={},p=y=>y){return C[t.title]=t,q[t.title]=r,U[t.title]=i,x[t.title]=p,(y={})=>{const l=G(y,t,c),D=Object.keys(e).reduce((s,d)=>(s[d]=e[d].default,s),{});return Object.assign(D,l)}}function K(e,t){return{customClass:t.class,customStyle:t.style}}function I(e,t,c){return t}const ee=new Map([["appearance",K]]),te={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dropdown.schema.json",title:"dropdown",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for dropdown",type:"string"},type:{description:"The type string of dropdown",type:"string",default:"dropdown"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},ne={title:"dropdown",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"}}}}},L={show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},title:{type:String,default:"下拉示例"},size:{type:String,default:""},type:{type:String,default:"primary"},iconClass:{type:String,default:""},active:{type:Boolean,default:!1},splitButton:{type:Boolean,default:!1},position:{type:String,default:"bottom"},model:{type:Array,default:[{label:"项目一",value:"XM1"},{label:"项目二",value:"XM2"},{label:"项目三",value:"XM3"}]},onSelect:{type:Function,default:()=>{}}},W=P(L,te,ee,I,ne);function _(e,t){let c;const r=n.ref(e.show),i=n.ref(),p=n.ref(),y=n.ref(),l=10;n.onMounted(()=>{c=p.value});const D=(f=1)=>{const o=["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"],N=Array.from(document.body.querySelectorAll(o.join(","))).filter(w=>w).map(w=>{const{display:m,zIndex:h}=window.getComputedStyle(w);return m==="none"?0:parseInt(h,10)}).filter(w=>w);let v=Math.max(...N);return v<1040&&(v=1040),v+f},s=(f,o)=>{const{height:N,left:v,top:w,width:m}=f.getBoundingClientRect(),{width:h,height:S,top:V}=o.getBoundingClientRect();if(f.className.indexOf("dropdown-submenu")>-1||f.closest(".dropdown-submenu")||f.classList.contains("dropright")){const $=window.innerWidth-v-f.offsetWidth,H=window.innerHeight-w,{position:O}=getComputedStyle(o);if(O==="fixed"){let T=v+f.offsetWidth;o.offsetWidth>$&&v>$&&(T=v-h),o.style.left=T+"px",o.style.right="auto",window.innerHeight-2*l<o.offsetHeight?(o.style.top=l+"px",o.style.bottom=l+"px",o.style.maxHeight=window.innerHeight-2*l+"px",o.style.overflowY="auto",o.className+=" dropdown-menu-maxheight"):H<o.offsetHeight?(o.style.top="auto",o.style.bottom=l+"px"):(o.style.top=w+"px",o.style.bottom="auto")}else{if(o.offsetWidth>$){const T=-h;o.style.left=T+"px"}window.innerHeight-2*l<o.offsetHeight?(o.style.top=-1*(w-l)+"px",o.style.bottom="auto",o.style.maxHeight=window.innerHeight-2*l+"px",o.style.overflowY="auto",o.className+=" dropdown-menu-maxheight"):H<o.offsetHeight&&(o.style.top=H-o.offsetHeight-l+"px",o.style.bottom="auto")}}else{const{marginTop:$,marginBottom:H}=getComputedStyle(o);let O=0;const T=Math.ceil(parseFloat($))+Math.ceil(parseFloat(H));let E=w+N,Y=v;window.innerHeight-E-T<S&&(E=w-S,E<0&&(window.innerHeight-w-N>w?(E=w+N,O=window.innerHeight-E-T-l):(E=l,O=w-E-T))),window.innerWidth-v<h&&window.innerWidth-v<v+m&&(Y=v-h+m),document.body.append(o),o.style.cssText=`position:fixed;bottom:unset;left:${Y}px
|
|
2
|
+
!important;top:${E}px !important;right: unset;${O?"max-height:"+O+"px;overflow-y:auto;":""}`,O&&(o.className+=" dropdown-menu-maxheight"),o.style.zIndex=D().toString()}},d=()=>{s(i.value,p.value)},a=()=>{e.hover||(r.value=!1,document.removeEventListener("click",a),c.removeEventListener("click",a),document.removeEventListener("scroll",a),c.removeEventListener("scroll",a))};return{show:r,dropdownRef:i,dropdownMenuRef:p,clickEventRef:y,showDropMenu:f=>{e.hover||e.disabled||(f==null||f.stopPropagation(),r.value||setTimeout(()=>{d()}),r.value=!r.value,document.addEventListener("click",a),document.addEventListener("scroll",a),e.hideOnClick||(c.addEventListener("click",o=>{o.stopPropagation()}),c.addEventListener("scroll",o=>{o.stopPropagation()})))},hoverDropdown:f=>{e.hover&&(r.value||setTimeout(()=>{}),r.value=!r.value)},leftButtonClick:()=>{},closeDropMenu:a,selectItem:f=>{t.emit("select",f)},resolveSize:f=>{const o=/px|em|rem|pt|%/;return o.test(f)?`${parseInt(f,10)}${f.match(o)[0]}`:`${f}px`}}}const oe={label:{type:String,default:"XM1"},value:{type:String||Number,default:"项目一"},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},divide:{type:Boolean,default:!1},onSelect:{type:Function,default:()=>{}}},X=n.defineComponent({name:"FDropdownItem",props:oe,emits:["select"],setup(e,t){const c=n.ref(e.value),r=n.ref(e.label),i=n.ref(e.disabled),p=n.ref(e.active),y=n.ref(e.divide),l=()=>{i.value||t.emit("select",e)};return()=>n.createVNode("div",null,[n.withDirectives(n.createVNode("div",{class:"dropdown-divider"},null),[[n.vShow,y.value]]),n.createVNode("li",{class:`dropdown-item${p.value?" active":""} ${i.value?" disabled":""}`,onClick:l,title:c.value.toString()},[r.value])])}}),A=n.defineComponent({name:"FDropdown",props:L,emits:["select"],setup(e,t){const c=n.ref(e.model),{show:r,dropdownMenuRef:i,dropdownRef:p,clickEventRef:y,showDropMenu:l,hoverDropdown:D,leftButtonClick:s,closeDropMenu:d,selectItem:a,resolveSize:u}=_(e,t);function b(g){t.emit("select",g)}return()=>n.createVNode("div",{ref:p},[n.createVNode("div",{class:["farris-dropdown","btn-group",{dropup:e.position==="top"},{dropdown:e.position==="bottom"},{dropleft:e.position==="left"},{dropright:e.position==="right"}]},[e.splitButton&&n.createVNode("span",{class:["btn",{"dropdown-item":e.nest},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"}],style:"width:100%",onClick:s},[e.title]),n.createVNode("span",{ref:y,class:["dropdown-toggle",{btn:!e.nest},{"dropdown-item":e.nest},{"dropdown-toggle-split":e.splitButton},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"},{"btn-secondary":e.type==="secondary"},{"btn-link":e.type==="link"},{disabled:e.disabled}],style:"width:100%",onClick:l,onMouseenter:D,onMouseleave:D},[n.withDirectives(n.createVNode("span",{class:"sr-only"},null),[[n.vShow,e.splitButton]]),e.splitButton?"":e.title,n.withDirectives(n.createVNode("span",{class:`f-icon ${e.iconClass.toString()}`},null),[[n.vShow,e.iconClass]])]),n.createVNode(n.Teleport,{to:"body"},{default:()=>[n.createVNode("div",{ref:i,class:`dropdown-menu${r.value?" show":""}`},[n.createVNode(n.Fragment,null,[c.value.map(({label:g,value:k,disabled:R,active:f,divide:o})=>n.createVNode(X,{value:k.toString(),label:g,disabled:R,active:f,divide:o,onSelect:N=>b(N)},null))])])]})])])}});function re(e,t,c){var w;function r(){}const i="",p="",y=n.ref();function l(){return(t==null?void 0:t.schema.componentType)!=="frame"}function D(){return!1}function s(){return(t==null?void 0:t.schema.componentType)!=="frame"}function d(){return(t==null?void 0:t.schema.componentType)==="frame"}function a(m){if(!m||!m.value)return null;if(m.value.schema&&m.value.schema.type==="component")return m.value;const h=n.ref(m==null?void 0:m.value.parent),S=a(h);return S||null}function u(m=t){const{componentInstance:h,designerItemElementRef:S}=m;return!h||!h.value?null:h.value.canMove?S:u(m.parent)}function b(m){return!!c}function g(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function k(){}function R(m,h){}function f(m,h){const{componentType:S}=m;let V=z(S,m,h);const j=S.toLowerCase().replace("-","_");return V&&!V.id&&V.type===S&&(V.id=`${j}_${Math.random().toString().slice(2,6)}`),V}function o(m,h){const S=String(m.getAttribute("data-controltype")),V=m.getAttribute("data-feature"),j=V?JSON.parse(V):{};j.parentComponentInstance=y.value;let $=z(S,j);const H=S.toLowerCase().replace("-","_");return $&&!$.id&&$.type===S&&($.id=`${H}_${Math.random().toString().slice(2,6)}`),$}function N(m){}function v(...m){}return y.value={canMove:l(),canSelectParent:D(),canDelete:s(),canNested:!d(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(w=t==null?void 0:t.parent)==null?void 0:w.componentInstance,schema:t==null?void 0:t.schema,styles:i,designerClass:p,canAccepts:b,getBelongedComponentInstance:a,getDraggableDesignItemElement:u,getDraggingDisplayText:g,getPropConfig:v,getDragScopeElement:k,onAcceptMovedChildElement:R,onAcceptNewChildElement:o,onChildElementMovedOut:N,addNewChildComponentSchema:f,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:n.ref(!1)},y}const ie=n.defineComponent({name:"FDropdownDesign",props:L,emits:["select"],setup(e,t){const c=n.ref(e.model),{show:r,showDropMenu:i,hoverDropdown:p,leftButtonClick:y,closeDropMenu:l,selectItem:D,resolveSize:s}=_(e,t);function d(g){t.emit("select",g)}const a=n.ref(),u=n.inject("design-item-context"),b=re(a,u);return n.onMounted(()=>{a.value.componentInstance=b}),t.expose(b.value),()=>n.createVNode("div",{ref:a},[n.createVNode("div",{class:["farris-dropdown","btn-group",{dropup:e.position==="top"},{dropdown:e.position==="bottom"},{dropleft:e.position==="left"},{dropright:e.position==="right"}],style:{width:e.width}},[e.splitButton&&n.createVNode("span",{class:["btn",{"dropdown-item":e.nest},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"}],style:"width:100%",onClick:y},[e.title]),n.createVNode("span",{class:["dropdown-toggle",{btn:!e.nest},{"dropdown-item":e.nest},{"dropdown-toggle-split":e.splitButton},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"},{"btn-secondary":e.type==="secondary"},{"btn-link":e.type==="link"},{disabled:e.disabled}],style:"width:100%",onClick:i,onMouseenter:p,onMouseleave:p},[n.withDirectives(n.createVNode("span",{class:"sr-only"},null),[[n.vShow,e.splitButton]]),e.splitButton?"":e.title,n.withDirectives(n.createVNode("span",{class:`f-icon ${e.iconClass.toString()}`},null),[[n.vShow,e.iconClass]])]),n.createVNode("div",{class:`dropdown-menu${r.value?" show":""}`},[n.createVNode(n.Fragment,null,[c.value.map(({label:g,value:k,disabled:R,active:f,divide:o})=>n.createVNode(X,{value:k.toString(),label:g,disabled:R,active:f,divide:o,onSelect:N=>d(N)},null))])])])])}}),se={install(e){e.component(A.name,A)},register(e,t,c,r){e.dropdown=A,t.dropdown=W},registerDesigner(e,t,c){e.dropdown=ie,t.dropdown=W}};B.Dropdown=A,B.default=se,B.dropdownProps=L,B.propsResolver=W,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.fade-enter-active,.fade-leave-active{transition:opacity .5s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fv-resizable-handle{position:absolute;font-size:.1px;display:block;touch-action:none}.fv-resizable-handle:hover{background:#2a87ff12}.fv-resizable-handle.fv-resizable-n{cursor:n-resize;height:.4375rem;width:100%;top:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-e{cursor:e-resize;width:.4375rem;right:-.3125rem;height:100%;top:0}.fv-resizable-handle.fv-resizable-s{cursor:s-resize;height:.4375rem;width:100%;bottom:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-w{cursor:w-resize;height:100%;width:.4375rem;left:-.3125rem;top:0}.fv-resizable-handle.fv-resizable-ne{cursor:ne-resize;width:.75rem;height:.75rem;right:1px;top:1px}.fv-resizable-handle.fv-resizable-se{cursor:se-resize;width:.75rem;height:.75rem;right:1px;bottom:1px}.fv-resizable-handle.fv-resizable-nw{cursor:nw-resize;width:.75rem;height:.75rem;left:1px;top:1px}.fv-resizable-handle.fv-resizable-sw{cursor:sw-resize;width:.75rem;height:.75rem;left:1px;bottom:1px}.screenGroup{background:#ffffffe6;box-shadow:0 0 3px #024bc133;border-radius:8px;padding:2px 14px;margin:5px auto;flex:1 1 0!important}.screenGroup .screenName{width:90px;font-family:PingFangSC-Regular;font-size:14px;line-height:24px;color:#2a87ff;height:32px;padding:4px;text-align:left}.screenGroup .screen-input{flex:1 1 0}.screenGroup farris-combo-list{width:84px}.screenGroup .columnText{line-height:26px}.applyBtn{margin-top:5px;display:flex;justify-content:center}.applyBtn .btn{width:110px}.en .screenGroup{width:100%;flex-direction:column;align-items:flex-start}.en .screenGroup>div{width:100%;padding:0 10px 10px 0;margin-left:0!important}.en .screenGroup .screenName{width:auto}.en .screenGroup farris-combo-list{flex:1}.en .screenGroup .columnText{width:50px}
|