@farris/ui-vue 1.5.7 → 1.5.8
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/avatar/index.esm.js +4 -4
- package/components/avatar/index.umd.cjs +1 -1
- package/components/component/index.esm.js +4 -4
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +4 -4
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +4 -4
- package/components/content-container/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1082 -1421
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +4 -4
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +4 -4
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +4 -4
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +4 -4
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +12 -11
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +4 -4
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +4 -4
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +4 -4
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1584 -2320
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +4 -4
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +77 -76
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/response-layout/index.esm.js +4 -4
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +500 -3662
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +3008 -7347
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/section/index.esm.js +1564 -1635
- package/components/section/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +545 -4943
- package/components/tabs/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +100 -5841
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.esm.js +4 -4
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/video/index.esm.js +4 -4
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +1556 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +207 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +377 -0
- package/designer/checkbox-group/index.umd.cjs +1 -0
- package/designer/data-grid/index.css +1 -0
- package/designer/data-grid/index.esm.js +14332 -0
- package/designer/data-grid/index.umd.cjs +20 -0
- package/designer/data-view/index.esm.js +271 -0
- package/designer/data-view/index.umd.cjs +1 -0
- package/designer/date-picker/index.esm.js +1879 -0
- package/designer/date-picker/index.umd.cjs +1 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +463 -0
- package/designer/drawer/index.umd.cjs +1 -0
- package/designer/farris-designer.all.esm.js +16815 -0
- package/designer/farris-designer.all.umd.cjs +32 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +647 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/radio-group/index.esm.js +6959 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/designer/response-toolbar/index.esm.js +3015 -0
- package/designer/response-toolbar/index.umd.cjs +1 -0
- package/designer/tabs/index.esm.js +2200 -0
- package/designer/tabs/index.umd.cjs +1 -0
- package/designer/textarea/index.esm.js +249 -0
- package/designer/textarea/index.umd.cjs +1 -0
- package/designer/tree-grid/index.css +1 -0
- package/designer/tree-grid/index.esm.js +1673 -0
- package/designer/tree-grid/index.umd.cjs +1 -0
- package/farris.all.esm.js +57107 -57105
- package/farris.all.umd.cjs +16 -16
- package/package.json +1 -1
- package/types/date-picker/designer.d.ts +29 -0
- package/types/date-picker/index.d.ts +2 -1
- package/types/date-picker/src/date-picker.props.d.ts +0 -5
- package/types/date-picker/src/designer/date-picker.design.props.d.ts +22 -0
- package/types/response-toolbar/designer.d.ts +37 -0
- package/types/response-toolbar/index.d.ts +6 -5
- package/types/response-toolbar/src/composition/toolbar-item-dragula.d.ts +1 -2
- package/types/response-toolbar/src/composition/types.d.ts +1 -1
- package/types/response-toolbar/src/designer/response-toolbar.design.props.d.ts +13 -0
- package/types/response-toolbar/src/designer/use-designer-item-rules.d.ts +1 -2
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +1 -2
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
- package/types/response-toolbar/src/response-toolbar.props.d.ts +0 -12
- package/types/response-toolbar/src/schema/schema-resolver.d.ts +1 -1
- package/types/tabs/designer.d.ts +28 -0
- package/types/tabs/index.d.ts +1 -0
- package/types/tabs/src/components/tab-page.props.d.ts +0 -1
- package/types/tabs/src/designer/tab-page.design.props.d.ts +1 -0
- package/types/tabs/src/designer/tabs.design.props.d.ts +12 -0
- package/types/tabs/src/tabs.props.d.ts +0 -11
- package/types/textarea/designer.d.ts +28 -0
- package/types/textarea/index.d.ts +0 -15
- package/types/textarea/src/designer/textarea.design.props.d.ts +6 -0
- package/types/textarea/src/designer/use-design-rules.d.ts +1 -2
- package/types/textarea/src/property-config/textarea.property-config.d.ts +1 -1
- package/types/textarea/src/schema/schema-resolver.d.ts +1 -1
- package/types/textarea/src/textarea.props.d.ts +0 -5
- /package/{components/textarea → designer/radio-group}/index.css +0 -0
|
@@ -0,0 +1,1556 @@
|
|
|
1
|
+
var Fe = Object.defineProperty;
|
|
2
|
+
var We = (e, t, n) => t in e ? Fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var A = (e, t, n) => We(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { withInstall as De } from "../../components/common/index.esm.js";
|
|
5
|
+
import { resolveAppearance as Ve, createPropsResolver as Ne } from "../../components/dynamic-resolver/index.esm.js";
|
|
6
|
+
import Ae, { buttonEditProps as $e } from "../../components/button-edit/index.esm.js";
|
|
7
|
+
import { defineComponent as oe, ref as o, computed as z, createVNode as h, Teleport as re, createApp as ce, onUnmounted as ue, Fragment as Xe, watch as $, nextTick as G, onBeforeMount as Ye, onMounted as se, Transition as qe, shallowRef as Ge, render as ae, h as Ue, cloneVNode as Ke, mergeProps as de, inject as fe } from "vue";
|
|
8
|
+
import { useDesignerComponent as Je } from "../../components/designer-canvas/index.esm.js";
|
|
9
|
+
const _e = {
|
|
10
|
+
/**
|
|
11
|
+
* 组件标识
|
|
12
|
+
*/
|
|
13
|
+
id: String,
|
|
14
|
+
/**
|
|
15
|
+
* 扩展按钮显示内容,这是一段现在扩展按钮中的html标签
|
|
16
|
+
*/
|
|
17
|
+
buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
|
|
18
|
+
buttonBehavior: { type: String, default: "Popup" },
|
|
19
|
+
/**
|
|
20
|
+
* 启用输入框自动完成功能
|
|
21
|
+
*/
|
|
22
|
+
autoComplete: { type: Boolean, default: !1 },
|
|
23
|
+
/**
|
|
24
|
+
* 组件自定义样式
|
|
25
|
+
*/
|
|
26
|
+
customClass: { type: String, default: "" },
|
|
27
|
+
/**
|
|
28
|
+
* 禁用组件,既不允许在输入框中录入,也不允许点击扩展按钮。
|
|
29
|
+
*/
|
|
30
|
+
disable: { type: Boolean, default: !1 },
|
|
31
|
+
/**
|
|
32
|
+
* 允许在输入框中录入文本。
|
|
33
|
+
*/
|
|
34
|
+
editable: { type: Boolean, default: !0 },
|
|
35
|
+
/**
|
|
36
|
+
* 显示清空文本按钮
|
|
37
|
+
*/
|
|
38
|
+
enableClear: { type: Boolean, default: !1 },
|
|
39
|
+
/**
|
|
40
|
+
* 组件值
|
|
41
|
+
*/
|
|
42
|
+
modelValue: { type: String, default: "" },
|
|
43
|
+
/**
|
|
44
|
+
* 将组件设置为只读,既不允许在输入框中录入,也不允许点击扩展按钮,但是允许复制输入框中的内容。
|
|
45
|
+
*/
|
|
46
|
+
readonly: { type: Boolean, default: !1 },
|
|
47
|
+
/**
|
|
48
|
+
* 禁用组件时,是否显示扩展按钮
|
|
49
|
+
*/
|
|
50
|
+
showButtonWhenDisabled: { type: Boolean, default: !1 },
|
|
51
|
+
/**
|
|
52
|
+
* 鼠标悬停在组件上时显示文本框内容。
|
|
53
|
+
*/
|
|
54
|
+
enableTitle: { type: Boolean, default: !1 },
|
|
55
|
+
/**
|
|
56
|
+
* 输入框类型
|
|
57
|
+
*/
|
|
58
|
+
inputType: { type: String, default: "text" },
|
|
59
|
+
/**
|
|
60
|
+
* 显示输入框提示信息
|
|
61
|
+
*/
|
|
62
|
+
forcePlaceholder: { type: Boolean, default: !1 },
|
|
63
|
+
/**
|
|
64
|
+
* 输入框提示文本
|
|
65
|
+
*/
|
|
66
|
+
placeholder: { type: String, default: "" },
|
|
67
|
+
/**
|
|
68
|
+
* 输入框最小长度
|
|
69
|
+
*/
|
|
70
|
+
minLength: Number,
|
|
71
|
+
/**
|
|
72
|
+
* 输入框最大长度
|
|
73
|
+
*/
|
|
74
|
+
maxLength: Number,
|
|
75
|
+
/**
|
|
76
|
+
* 输入框Tab键索引
|
|
77
|
+
*/
|
|
78
|
+
tabIndex: Number,
|
|
79
|
+
popupHost: { type: Object },
|
|
80
|
+
popupRightBoundary: { type: Object },
|
|
81
|
+
popupOffsetX: { type: Object },
|
|
82
|
+
popupOnInput: { type: Boolean, default: !1 },
|
|
83
|
+
popupOnFocus: { type: Boolean, default: !1 },
|
|
84
|
+
popupOnClick: { type: Boolean, default: !1 },
|
|
85
|
+
/**
|
|
86
|
+
* 样式追加到弹出窗口
|
|
87
|
+
*/
|
|
88
|
+
popupClass: { type: String, default: "" },
|
|
89
|
+
popupMinWidth: { type: Number, default: 160 },
|
|
90
|
+
modalOptions: { type: Object, default: {} },
|
|
91
|
+
wrapText: { type: Boolean, default: !1 },
|
|
92
|
+
/**
|
|
93
|
+
* 可选,是否支持多选
|
|
94
|
+
* 默认`false`
|
|
95
|
+
*/
|
|
96
|
+
multiSelect: { type: Boolean, default: !1 },
|
|
97
|
+
/**
|
|
98
|
+
* 可选,分隔符
|
|
99
|
+
* 默认`,`
|
|
100
|
+
*/
|
|
101
|
+
separator: { type: String, default: "," },
|
|
102
|
+
/** 对齐方式 */
|
|
103
|
+
textAlign: { type: String, default: "left" },
|
|
104
|
+
/**
|
|
105
|
+
* 废弃
|
|
106
|
+
*/
|
|
107
|
+
beforeClickButton: { type: Function, default: null },
|
|
108
|
+
/**
|
|
109
|
+
* 作为内嵌编辑器被创建后默认获得焦点
|
|
110
|
+
*/
|
|
111
|
+
focusOnCreated: { type: Boolean, default: !1 },
|
|
112
|
+
/**
|
|
113
|
+
* 作为内嵌编辑器被创建后默认选中文本
|
|
114
|
+
*/
|
|
115
|
+
selectOnCreated: { type: Boolean, default: !1 },
|
|
116
|
+
/**
|
|
117
|
+
* 打开前
|
|
118
|
+
*/
|
|
119
|
+
beforeOpen: { type: Function, default: null },
|
|
120
|
+
/** 更新方式 blur | change */
|
|
121
|
+
updateOn: { type: String, default: "change" },
|
|
122
|
+
keepWidthWithReference: { type: Boolean, default: !0 },
|
|
123
|
+
placement: { type: String, default: "bottom-left" },
|
|
124
|
+
/**
|
|
125
|
+
* 根据空间大小重新调整,原下拉面板内容指定的高度
|
|
126
|
+
*/
|
|
127
|
+
limitContentBySpace: { type: Boolean, default: !1 }
|
|
128
|
+
}, Qe = {
|
|
129
|
+
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
|
|
130
|
+
host: { type: Object },
|
|
131
|
+
backgroundColor: { type: String, default: "" }
|
|
132
|
+
}, Ze = /* @__PURE__ */ oe({
|
|
133
|
+
name: "FOverlay",
|
|
134
|
+
props: Qe,
|
|
135
|
+
emits: ["click"],
|
|
136
|
+
setup(e, t) {
|
|
137
|
+
const n = o(e.popupContentPosition), a = o(e.host), c = z(() => ({
|
|
138
|
+
backgroundColor: e.backgroundColor || "",
|
|
139
|
+
pointerEvents: "auto"
|
|
140
|
+
}));
|
|
141
|
+
function i(u) {
|
|
142
|
+
t.emit("click"), u.preventDefault(), u.stopPropagation();
|
|
143
|
+
}
|
|
144
|
+
z(() => {
|
|
145
|
+
const u = a.value;
|
|
146
|
+
if (u) {
|
|
147
|
+
const f = u.getBoundingClientRect(), {
|
|
148
|
+
left: p,
|
|
149
|
+
top: y,
|
|
150
|
+
height: w
|
|
151
|
+
} = f;
|
|
152
|
+
return {
|
|
153
|
+
left: p,
|
|
154
|
+
top: y + w
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return n.value;
|
|
158
|
+
});
|
|
159
|
+
const v = z(() => ({
|
|
160
|
+
// position: 'relative',
|
|
161
|
+
// left: `${position.value.left}px`,
|
|
162
|
+
// top: `${position.value.top}px`
|
|
163
|
+
}));
|
|
164
|
+
return () => h(re, {
|
|
165
|
+
to: "body"
|
|
166
|
+
}, {
|
|
167
|
+
default: () => {
|
|
168
|
+
var u, f;
|
|
169
|
+
return [h("div", {
|
|
170
|
+
class: "overlay-container",
|
|
171
|
+
onClick: (p) => i(p),
|
|
172
|
+
style: c.value
|
|
173
|
+
}, [h("div", {
|
|
174
|
+
style: v.value
|
|
175
|
+
}, [(f = (u = t.slots).default) == null ? void 0 : f.call(u)])])];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
function et(e) {
|
|
181
|
+
if (e.content && e.content.render)
|
|
182
|
+
return e.content.render;
|
|
183
|
+
if (e.render && typeof e.render == "function")
|
|
184
|
+
return e.render;
|
|
185
|
+
}
|
|
186
|
+
function tt(e) {
|
|
187
|
+
const t = document.createElement("div");
|
|
188
|
+
t.style.display = "contents";
|
|
189
|
+
let n;
|
|
190
|
+
const a = e.onClickCallback || (() => {
|
|
191
|
+
}), c = () => {
|
|
192
|
+
a(), n && n.unmount();
|
|
193
|
+
};
|
|
194
|
+
return n = ce({
|
|
195
|
+
setup() {
|
|
196
|
+
ue(() => {
|
|
197
|
+
document.body.removeChild(t);
|
|
198
|
+
});
|
|
199
|
+
const i = et(e);
|
|
200
|
+
return () => h(Ze, {
|
|
201
|
+
"popup-content-position": e.popupPosition,
|
|
202
|
+
host: e.host,
|
|
203
|
+
onClick: c,
|
|
204
|
+
backgroundColor: e.backgroundColor
|
|
205
|
+
}, {
|
|
206
|
+
default: () => [i && i()]
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}), document.body.appendChild(t), n.mount(t), n;
|
|
210
|
+
}
|
|
211
|
+
class nt {
|
|
212
|
+
static show(t) {
|
|
213
|
+
return tt(t);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const lt = {
|
|
217
|
+
/**
|
|
218
|
+
* 允许点击遮罩关闭对话框
|
|
219
|
+
*/
|
|
220
|
+
allowClickMaskToClose: { type: Boolean, default: !1 },
|
|
221
|
+
/**
|
|
222
|
+
* 关闭对话框前事件, 是个函数,返回true或者false
|
|
223
|
+
*/
|
|
224
|
+
beforeClose: { type: Function, default: () => !0 },
|
|
225
|
+
/**
|
|
226
|
+
* 自定义类
|
|
227
|
+
*/
|
|
228
|
+
class: { type: String, default: "" },
|
|
229
|
+
/**
|
|
230
|
+
* 自定义遮罩类
|
|
231
|
+
*/
|
|
232
|
+
maskClass: { type: String, default: "" },
|
|
233
|
+
/**
|
|
234
|
+
* 模态框标题
|
|
235
|
+
*/
|
|
236
|
+
title: { type: String, default: "" },
|
|
237
|
+
/**
|
|
238
|
+
* 模态框宽度
|
|
239
|
+
*/
|
|
240
|
+
width: { type: Number, default: 500 },
|
|
241
|
+
/**
|
|
242
|
+
* 模态框高度
|
|
243
|
+
*/
|
|
244
|
+
height: { type: Number, default: 320 },
|
|
245
|
+
/**
|
|
246
|
+
* 自定义按钮列表
|
|
247
|
+
*/
|
|
248
|
+
buttons: {
|
|
249
|
+
type: Array,
|
|
250
|
+
default: []
|
|
251
|
+
},
|
|
252
|
+
/**
|
|
253
|
+
* 是否展示模态框
|
|
254
|
+
*/
|
|
255
|
+
modelValue: { type: Boolean, default: !1 },
|
|
256
|
+
/**
|
|
257
|
+
* 是否模态
|
|
258
|
+
*/
|
|
259
|
+
mask: { type: Boolean, default: !0 },
|
|
260
|
+
/**
|
|
261
|
+
* 是否展示头部
|
|
262
|
+
*/
|
|
263
|
+
showHeader: { type: Boolean, default: !0 },
|
|
264
|
+
/**
|
|
265
|
+
* 是否展示默认按钮
|
|
266
|
+
*/
|
|
267
|
+
showButtons: { type: Boolean, default: !0 },
|
|
268
|
+
/**
|
|
269
|
+
* 是否启用自适应样式
|
|
270
|
+
*/
|
|
271
|
+
fitContent: { type: Boolean, default: !0 },
|
|
272
|
+
/**
|
|
273
|
+
* 是否展示右上角按钮
|
|
274
|
+
*/
|
|
275
|
+
showCloseButton: { type: Boolean, default: !0 },
|
|
276
|
+
showMaxButton: { type: Boolean, default: !1 },
|
|
277
|
+
minHeight: { type: Number },
|
|
278
|
+
maxHeight: { type: Number },
|
|
279
|
+
minWidth: { type: Number },
|
|
280
|
+
maxWidth: { type: Number },
|
|
281
|
+
containment: { type: Object, default: null },
|
|
282
|
+
resizeable: { type: Boolean, default: !1 },
|
|
283
|
+
draggable: { type: Boolean, default: !1 },
|
|
284
|
+
dragHandle: { type: Object, default: null },
|
|
285
|
+
closedCallback: { type: Function, default: null },
|
|
286
|
+
resizeHandle: { type: Function, default: null },
|
|
287
|
+
render: { type: Function, default: null },
|
|
288
|
+
acceptCallback: { type: Function, default: null },
|
|
289
|
+
rejectCallback: { type: Function, default: null },
|
|
290
|
+
enableEsc: { type: Boolean, default: !0 },
|
|
291
|
+
enableEnter: { type: Boolean, default: !1 },
|
|
292
|
+
dialogType: { type: String, default: "" },
|
|
293
|
+
src: { type: String, default: "" },
|
|
294
|
+
footerHeight: { type: Number, default: 60 },
|
|
295
|
+
host: { type: Object, default: "body" }
|
|
296
|
+
};
|
|
297
|
+
class S {
|
|
298
|
+
constructor(t, n) {
|
|
299
|
+
this.x = t, this.y = n;
|
|
300
|
+
}
|
|
301
|
+
static getTransformInfo(t) {
|
|
302
|
+
const a = window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g, "").split(",");
|
|
303
|
+
if (a.length >= 6) {
|
|
304
|
+
const c = parseInt(a[4], 10), i = parseInt(a[5], 10);
|
|
305
|
+
return { x: c, y: i };
|
|
306
|
+
}
|
|
307
|
+
return { x: 0, y: 0 };
|
|
308
|
+
}
|
|
309
|
+
static fromEvent(t, n = null) {
|
|
310
|
+
if (this.isMouseEvent(t))
|
|
311
|
+
return new S(t.clientX, t.clientY);
|
|
312
|
+
if (n === null || t.changedTouches.length === 1)
|
|
313
|
+
return new S(t.changedTouches[0].clientX, t.changedTouches[0].clientY);
|
|
314
|
+
for (let a = 0; a < t.changedTouches.length; a++)
|
|
315
|
+
if (t.changedTouches[a].target === n)
|
|
316
|
+
return new S(t.changedTouches[a].clientX, t.changedTouches[a].clientY);
|
|
317
|
+
}
|
|
318
|
+
static isMouseEvent(t) {
|
|
319
|
+
return Object.prototype.toString.apply(t).indexOf("MouseEvent") === 8;
|
|
320
|
+
}
|
|
321
|
+
static isIPosition(t) {
|
|
322
|
+
return !!t && "x" in t && "y" in t;
|
|
323
|
+
}
|
|
324
|
+
static getCurrent(t) {
|
|
325
|
+
const n = new S(0, 0);
|
|
326
|
+
if (window) {
|
|
327
|
+
const a = window.getComputedStyle(t);
|
|
328
|
+
if (a) {
|
|
329
|
+
const c = parseInt(a.getPropertyValue("left"), 10), i = parseInt(a.getPropertyValue("top"), 10);
|
|
330
|
+
n.x = isNaN(c) ? 0 : c, n.y = isNaN(i) ? 0 : i;
|
|
331
|
+
}
|
|
332
|
+
return n;
|
|
333
|
+
}
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
static copy(t) {
|
|
337
|
+
return new S(0, 0).set(t);
|
|
338
|
+
}
|
|
339
|
+
get value() {
|
|
340
|
+
return { x: this.x, y: this.y };
|
|
341
|
+
}
|
|
342
|
+
add(t) {
|
|
343
|
+
return this.x += t.x, this.y += t.y, this;
|
|
344
|
+
}
|
|
345
|
+
subtract(t) {
|
|
346
|
+
return this.x -= t.x, this.y -= t.y, this;
|
|
347
|
+
}
|
|
348
|
+
multiply(t) {
|
|
349
|
+
this.x *= t, this.y *= t;
|
|
350
|
+
}
|
|
351
|
+
divide(t) {
|
|
352
|
+
this.x /= t, this.y /= t;
|
|
353
|
+
}
|
|
354
|
+
reset() {
|
|
355
|
+
return this.x = 0, this.y = 0, this;
|
|
356
|
+
}
|
|
357
|
+
set(t) {
|
|
358
|
+
return this.x = t.x, this.y = t.y, this;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
class X {
|
|
362
|
+
constructor(t, n) {
|
|
363
|
+
this.width = t, this.height = n;
|
|
364
|
+
}
|
|
365
|
+
static getCurrent(t) {
|
|
366
|
+
const n = new X(0, 0);
|
|
367
|
+
if (window) {
|
|
368
|
+
const a = window.getComputedStyle(t);
|
|
369
|
+
return a && (n.width = parseInt(a.getPropertyValue("width"), 10), n.height = parseInt(a.getPropertyValue("height"), 10)), n;
|
|
370
|
+
}
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
static copy(t) {
|
|
374
|
+
return new X(0, 0).set(t);
|
|
375
|
+
}
|
|
376
|
+
set(t) {
|
|
377
|
+
return this.width = t.width, this.height = t.height, this;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function at(e, t) {
|
|
381
|
+
const n = o(), a = o(), c = o(), i = o(), v = o(), u = o(), f = o(), p = o(), y = o(), w = o(), I = o(), g = o(e.resizeable), B = o(), k = o(e.draggable), P = o(!1);
|
|
382
|
+
function L() {
|
|
383
|
+
const s = a.value || document.body, r = window.getComputedStyle(s);
|
|
384
|
+
if (!r || !n.value)
|
|
385
|
+
return;
|
|
386
|
+
const M = S.getTransformInfo(n.value), m = {};
|
|
387
|
+
f.value && (m.deltaL = n.value.offsetLeft - f.value.x, m.deltaT = n.value.offsetTop - f.value.y);
|
|
388
|
+
const R = r.getPropertyValue("position");
|
|
389
|
+
m.width = s.clientWidth, m.height = s.clientHeight, m.pr = parseInt(r.getPropertyValue("padding-right"), 10), m.pb = parseInt(r.getPropertyValue("padding-bottom"), 10), m.position = r.getPropertyValue("position"), R === "static" && (s.style.position = "relative"), m.translateX = M.x, m.translateY = M.y, w.value = m;
|
|
390
|
+
}
|
|
391
|
+
function O(s) {
|
|
392
|
+
if (n.value) {
|
|
393
|
+
i.value = X.getCurrent(n.value), v.value = S.getCurrent(n.value), u.value = i.value ? X.copy(i.value) : null, f.value = v.value ? S.copy(v.value) : null, L();
|
|
394
|
+
const r = s.target.getAttribute("type") || "";
|
|
395
|
+
p.value = {
|
|
396
|
+
n: !!r.match(/n/),
|
|
397
|
+
s: !!r.match(/s/),
|
|
398
|
+
w: !!r.match(/w/),
|
|
399
|
+
e: !!r.match(/e/)
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function j() {
|
|
404
|
+
var s, r, M, m;
|
|
405
|
+
if (n.value) {
|
|
406
|
+
const R = n.value;
|
|
407
|
+
p.value && ((p.value.n || p.value.s) && ((s = u.value) != null && s.height) && (R.style.height = u.value.height + "px"), (p.value.w || p.value.e) && ((r = u.value) != null && r.width) && (R.style.width = u.value.width + "px"), f.value && ((M = f.value) != null && M.x && (R.style.left = f.value.x + "px"), (m = f.value) != null && m.y && (R.style.top = f.value.y + "px")));
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
function D() {
|
|
411
|
+
const s = e.minHeight ? e.minHeight : 1, r = e.minWidth ? e.minWidth : 1;
|
|
412
|
+
u.value && f.value && p.value && i.value && (u.value.height < s && (u.value.height = s, p.value.n && v.value && (f.value.y = v.value.y + (i.value.height - s))), u.value.width < r && (u.value.width = r, p.value.w && v.value && (f.value.x = v.value.x + (i.value.width - r))), e.maxHeight && u.value.height > e.maxHeight && (u.value.height = e.maxHeight, v.value && p.value.n && (f.value.y = v.value.y + (i.value.height - e.maxHeight))), e.maxWidth && u.value.width > e.maxWidth && (u.value.width = e.maxWidth, p.value.w && v.value && (f.value.x = v.value.x + (i.value.width - e.maxWidth))));
|
|
413
|
+
}
|
|
414
|
+
function x() {
|
|
415
|
+
if (a.value) {
|
|
416
|
+
const s = w.value;
|
|
417
|
+
if (f.value && u.value && p.value && i.value) {
|
|
418
|
+
const r = s.width - s.pr - s.deltaL - s.translateX - f.value.x, M = s.height - s.pb - s.deltaT - s.translateY - f.value.y;
|
|
419
|
+
p.value.n && f.value.y + s.translateY < 0 && v.value && (f.value.y = -s.translateY, u.value.height = i.value.height + v.value.y + s.translateY), p.value.w && f.value.x + s.translateX < 0 && v.value && (f.value.x = -s.translateX, u.value.width = i.value.width + v.value.x + s.translateX), u.value.width > r && (u.value.width = r), u.value.height > M && (u.value.height = M);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function H(s) {
|
|
424
|
+
if (!c.value || !i.value || !v.value || !p.value)
|
|
425
|
+
return;
|
|
426
|
+
s.subtract(c.value);
|
|
427
|
+
const r = s.x, M = s.y;
|
|
428
|
+
p.value.n ? (f.value.y = v.value.y + M, u.value.height = i.value.height - M) : p.value.s && (u.value.height = i.value.height + M), p.value.e ? u.value.width = i.value.width + r : p.value.w && (u.value.width = i.value.width - r, f.value.x = v.value.x + r), x(), D(), j();
|
|
429
|
+
}
|
|
430
|
+
function d(s) {
|
|
431
|
+
if (!y.value)
|
|
432
|
+
return;
|
|
433
|
+
const r = S.fromEvent(s);
|
|
434
|
+
r && H(r);
|
|
435
|
+
}
|
|
436
|
+
function C() {
|
|
437
|
+
if (n.value) {
|
|
438
|
+
const {
|
|
439
|
+
width: s,
|
|
440
|
+
height: r,
|
|
441
|
+
x: M,
|
|
442
|
+
y: m
|
|
443
|
+
} = n.value.getBoundingClientRect(), R = S.getTransformInfo(n.value);
|
|
444
|
+
return {
|
|
445
|
+
size: {
|
|
446
|
+
width: s,
|
|
447
|
+
height: r
|
|
448
|
+
},
|
|
449
|
+
position: {
|
|
450
|
+
x: M - R.x,
|
|
451
|
+
y: m - R.y
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
function T(s) {
|
|
458
|
+
if (n.value) {
|
|
459
|
+
const r = C();
|
|
460
|
+
I.value = r;
|
|
461
|
+
}
|
|
462
|
+
c.value = void 0, i.value = null, v.value = null, u.value = null, f.value = null, p.value = null, y.value = null, document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", T);
|
|
463
|
+
}
|
|
464
|
+
function W() {
|
|
465
|
+
document.addEventListener("mousemove", d), document.addEventListener("mouseup", T);
|
|
466
|
+
}
|
|
467
|
+
function E(s) {
|
|
468
|
+
s instanceof MouseEvent && s.button === 2 || k.value && (document.body.click(), s.stopPropagation(), s.preventDefault(), c.value = S.fromEvent(s), y.value = s.target, O(s), W());
|
|
469
|
+
}
|
|
470
|
+
function V(s) {
|
|
471
|
+
return n.value = s, g.value && h(Xe, null, [h("div", {
|
|
472
|
+
class: "fv-resizable-handle fv-resizable-n",
|
|
473
|
+
type: "n",
|
|
474
|
+
onMousedown: (r) => E(r)
|
|
475
|
+
}, null), h("div", {
|
|
476
|
+
class: "fv-resizable-handle fv-resizable-e",
|
|
477
|
+
type: "e",
|
|
478
|
+
onMousedown: (r) => E(r)
|
|
479
|
+
}, null), h("div", {
|
|
480
|
+
class: "fv-resizable-handle fv-resizable-s",
|
|
481
|
+
type: "s",
|
|
482
|
+
onMousedown: (r) => E(r)
|
|
483
|
+
}, null), h("div", {
|
|
484
|
+
class: "fv-resizable-handle fv-resizable-w",
|
|
485
|
+
type: "w",
|
|
486
|
+
onMousedown: (r) => E(r)
|
|
487
|
+
}, null), h("div", {
|
|
488
|
+
class: "fv-resizable-handle fv-resizable-ne",
|
|
489
|
+
type: "ne",
|
|
490
|
+
onMousedown: (r) => E(r)
|
|
491
|
+
}, null), h("div", {
|
|
492
|
+
class: "fv-resizable-handle fv-resizable-se fv-resizable-diagonal",
|
|
493
|
+
type: "se",
|
|
494
|
+
onMousedown: (r) => E(r)
|
|
495
|
+
}, null), h("div", {
|
|
496
|
+
class: "fv-resizable-handle fv-resizable-sw",
|
|
497
|
+
type: "sw",
|
|
498
|
+
onMousedown: (r) => E(r)
|
|
499
|
+
}, null), h("div", {
|
|
500
|
+
class: "fv-resizable-handle fv-resizable-nw",
|
|
501
|
+
type: "nw",
|
|
502
|
+
onMousedown: (r) => E(r)
|
|
503
|
+
}, null)]);
|
|
504
|
+
}
|
|
505
|
+
function K(s = !0) {
|
|
506
|
+
document.body.click();
|
|
507
|
+
const r = a.value || document.body, M = X.getCurrent(r), m = n.value;
|
|
508
|
+
s && m && (B.value = C(), B.value.transform = m.style.transform), M && m && (u.value = M, u.value.height -= 14, u.value.width -= 14, m.style.height = u.value.height + "px", m.style.width = u.value.width + "px", m.style.left = "7px", m.style.top = "7px", m.style.transform = "", I.value = {
|
|
509
|
+
size: u.value,
|
|
510
|
+
position: {
|
|
511
|
+
x: 0,
|
|
512
|
+
y: 0
|
|
513
|
+
}
|
|
514
|
+
}, k.value = !1, P.value = !0);
|
|
515
|
+
}
|
|
516
|
+
function _() {
|
|
517
|
+
var s, r;
|
|
518
|
+
if (document.body.click(), B.value) {
|
|
519
|
+
const M = {
|
|
520
|
+
width: B.value.size.width || 0,
|
|
521
|
+
height: B.value.size.height || 0
|
|
522
|
+
}, m = {
|
|
523
|
+
x: (window.innerWidth - M.width) / 2,
|
|
524
|
+
y: (window.innerHeight - M.height) / 2
|
|
525
|
+
};
|
|
526
|
+
(s = u.value) == null || s.set(M), (r = f.value) == null || r.set(m);
|
|
527
|
+
const R = n.value;
|
|
528
|
+
R.style.height = M.height + "px", R.style.width = M.width + "px", R.style.left = `${m.x}px`, R.style.top = `${m.y}px`, R.style.transform = "", I.value = {
|
|
529
|
+
size: M,
|
|
530
|
+
position: m
|
|
531
|
+
}, k.value = e.draggable, P.value = !1;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function Q() {
|
|
535
|
+
if (n.value) {
|
|
536
|
+
const s = X.getCurrent(n.value);
|
|
537
|
+
if (s) {
|
|
538
|
+
const {
|
|
539
|
+
width: r,
|
|
540
|
+
height: M
|
|
541
|
+
} = s;
|
|
542
|
+
n.value.style.left = `${(window.innerWidth - r) / 2}px`, n.value.style.top = `${(window.innerHeight - M) / 2}px`, n.value.style.transform = "";
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
function Y() {
|
|
547
|
+
const s = () => {
|
|
548
|
+
P.value ? K(!1) : Q(), document.body.click();
|
|
549
|
+
};
|
|
550
|
+
return window.addEventListener("resize", s), () => {
|
|
551
|
+
window.removeEventListener("resize", s);
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
const Z = Y();
|
|
555
|
+
return {
|
|
556
|
+
renderResizeBar: V,
|
|
557
|
+
boundingElement: a,
|
|
558
|
+
resizedEventParam: I,
|
|
559
|
+
maximize: K,
|
|
560
|
+
restore: _,
|
|
561
|
+
allowDrag: k,
|
|
562
|
+
isMaximized: P,
|
|
563
|
+
unWindowResizeHandle: Z
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
function ot(e, t, n) {
|
|
567
|
+
const a = o(), c = o(e.draggable), i = o(e.lockAxis), v = o(), u = o(), f = o(!1), p = o(new S(0, 0)), y = o(new S(0, 0)), w = o(new S(0, 0)), I = o(new S(0, 0));
|
|
568
|
+
$(() => n.value, (d) => {
|
|
569
|
+
v.value.style.cursor = d ? "move" : "default";
|
|
570
|
+
});
|
|
571
|
+
function g(d, C) {
|
|
572
|
+
if (C.tagName === "BUTTON")
|
|
573
|
+
return !1;
|
|
574
|
+
if (C === d)
|
|
575
|
+
return !0;
|
|
576
|
+
for (const T in C.children)
|
|
577
|
+
if (Object.prototype.hasOwnProperty.call(C.children, T) && g(d, C.children[T]))
|
|
578
|
+
return !0;
|
|
579
|
+
return !1;
|
|
580
|
+
}
|
|
581
|
+
function B() {
|
|
582
|
+
var W, E;
|
|
583
|
+
let d = w.value.x + y.value.x, C = w.value.y + y.value.y;
|
|
584
|
+
i.value === "x" ? (d = ((W = p.value) == null ? void 0 : W.x) || 0, w.value.x = 0) : i.value === "y" && (C = ((E = p.value) == null ? void 0 : E.y) || 0, w.value.y = 0);
|
|
585
|
+
const T = `translate3d(${Math.round(d)}px, ${Math.round(C)}px, 0px)`;
|
|
586
|
+
a.value && (a.value.style.transform = T), I.value.x = d, I.value.y = C;
|
|
587
|
+
}
|
|
588
|
+
function k() {
|
|
589
|
+
if (!u.value || !a.value)
|
|
590
|
+
return null;
|
|
591
|
+
const d = u.value.getBoundingClientRect(), C = a.value.getBoundingClientRect(), T = {
|
|
592
|
+
top: d.top < C.top,
|
|
593
|
+
right: d.right > C.right,
|
|
594
|
+
bottom: d.bottom > C.bottom,
|
|
595
|
+
left: d.left < C.left
|
|
596
|
+
};
|
|
597
|
+
return T.top || (w.value.y -= C.top - d.top), T.bottom || (w.value.y -= C.bottom - d.bottom), T.right || (w.value.x -= C.right - d.right), T.left || (w.value.x -= C.left - d.left), B(), T;
|
|
598
|
+
}
|
|
599
|
+
function P(d) {
|
|
600
|
+
d && (p.value && d.subtract(p.value), w.value.set(d), B(), k());
|
|
601
|
+
}
|
|
602
|
+
function L(d) {
|
|
603
|
+
f.value && c.value && (d.stopPropagation(), d.preventDefault(), P(S.fromEvent(d, v.value)));
|
|
604
|
+
}
|
|
605
|
+
function O() {
|
|
606
|
+
var d;
|
|
607
|
+
f.value && (f.value = !1, y.value.add(w.value), w.value.reset(), (d = a.value) == null || d.classList.remove("ng-dragging"), t.emit("stopMove"), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", O));
|
|
608
|
+
}
|
|
609
|
+
function j() {
|
|
610
|
+
!f.value && v.value && (f.value = !0, v.value.classList.add("ng-dragging"), document.addEventListener("mousemove", L), document.addEventListener("mouseup", O));
|
|
611
|
+
}
|
|
612
|
+
function D() {
|
|
613
|
+
if (a.value) {
|
|
614
|
+
const d = S.getTransformInfo(a.value);
|
|
615
|
+
y.value.set(d);
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
y.value.reset();
|
|
619
|
+
}
|
|
620
|
+
function x(d) {
|
|
621
|
+
if (!n.value || d instanceof MouseEvent && d.button === 2)
|
|
622
|
+
return;
|
|
623
|
+
const C = d.target || d.srcElement;
|
|
624
|
+
v.value !== void 0 && C && !g(C, v.value) || c.value !== !1 && (document.body.click(), d.stopPropagation(), d.preventDefault(), p.value = S.fromEvent(d, a.value), D(), j());
|
|
625
|
+
}
|
|
626
|
+
function H(d, C, T) {
|
|
627
|
+
if (c.value && C) {
|
|
628
|
+
if (d)
|
|
629
|
+
v.value = d;
|
|
630
|
+
else if (e.dragHandle) {
|
|
631
|
+
if (e.dragHandle instanceof HTMLElement)
|
|
632
|
+
v.value = e.dragHandle;
|
|
633
|
+
else if (typeof e.dragHandle == "string") {
|
|
634
|
+
const W = C.querySelector(e.dragHandle);
|
|
635
|
+
W && (v.value = W);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
a.value = C, u.value = T, v.value ? (v.value.classList.add("ng-draggable"), v.value.addEventListener("mousedown", x)) : c.value = !1;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return {
|
|
642
|
+
registerDraggle: H,
|
|
643
|
+
resetTranslate: D
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function ve(e, t) {
|
|
647
|
+
if (e) {
|
|
648
|
+
const n = (a) => {
|
|
649
|
+
a.key.toLowerCase() === e.toLowerCase() && t({ event: a, key: e });
|
|
650
|
+
};
|
|
651
|
+
return document.addEventListener("keydown", n), () => {
|
|
652
|
+
document.removeEventListener("keydown", n);
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
function ut(e, t) {
|
|
657
|
+
const n = o(e.enableEsc);
|
|
658
|
+
let a = null;
|
|
659
|
+
return n.value ? (a = ve("Escape", (c) => {
|
|
660
|
+
t.emit("esc", { event: c.event, type: "esc" });
|
|
661
|
+
}), {
|
|
662
|
+
remove: a
|
|
663
|
+
}) : null;
|
|
664
|
+
}
|
|
665
|
+
function st(e, t) {
|
|
666
|
+
const n = o(e.enableEnter);
|
|
667
|
+
let a = null;
|
|
668
|
+
return n.value ? (a = ve("Enter", (c) => {
|
|
669
|
+
t.emit("enter", { event: c.event, type: "enter" });
|
|
670
|
+
}), {
|
|
671
|
+
remove: a
|
|
672
|
+
}) : null;
|
|
673
|
+
}
|
|
674
|
+
const U = /* @__PURE__ */ oe({
|
|
675
|
+
name: "FModal",
|
|
676
|
+
props: lt,
|
|
677
|
+
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc", "enter", "stopMove"],
|
|
678
|
+
setup(e, t) {
|
|
679
|
+
const n = o(e.width || 300), a = o(e.height || 200), c = o(e.modelValue), i = o(""), v = o(e.class), u = o(e.fitContent), f = o(e.showHeader), p = o(""), y = o(e.showCloseButton), w = o(e.showMaxButton), I = o(!1), g = o(e.dialogType), B = o(e.src), k = o(""), P = o(e.showButtons), L = o(e.title), O = o(e.containment || null), j = o(), D = o(!1);
|
|
680
|
+
function x(l, b) {
|
|
681
|
+
Promise.resolve().then(() => {
|
|
682
|
+
var F;
|
|
683
|
+
return (F = e.beforeClose) == null ? void 0 : F.call(e);
|
|
684
|
+
}).then((F) => {
|
|
685
|
+
F && (c.value = !1, t.emit("update:modelValue", !1), b != null && t.emit(b ? "accept" : "cancel"), t.emit("closed", l));
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
const H = [{
|
|
689
|
+
name: "cancel",
|
|
690
|
+
text: "取消",
|
|
691
|
+
class: "btn btn-secondary",
|
|
692
|
+
handle: (l) => {
|
|
693
|
+
x(l, !1);
|
|
694
|
+
}
|
|
695
|
+
}, {
|
|
696
|
+
name: "accept",
|
|
697
|
+
text: "确定",
|
|
698
|
+
class: "btn btn-primary",
|
|
699
|
+
handle: (l) => {
|
|
700
|
+
x(l, !0);
|
|
701
|
+
}
|
|
702
|
+
}], d = o(e.buttons && e.buttons.length ? e.buttons : H), C = z(() => !!p.value), T = z(() => !!P.value && !!d.value), W = o(), E = o(), V = o(!1), {
|
|
703
|
+
renderResizeBar: K,
|
|
704
|
+
maximize: _,
|
|
705
|
+
restore: Q,
|
|
706
|
+
boundingElement: Y,
|
|
707
|
+
resizedEventParam: Z,
|
|
708
|
+
allowDrag: s,
|
|
709
|
+
unWindowResizeHandle: r
|
|
710
|
+
} = at(e), {
|
|
711
|
+
registerDraggle: M
|
|
712
|
+
} = ot(e, t, s);
|
|
713
|
+
function m() {
|
|
714
|
+
return !!document.querySelectorAll(".farris-modal").length && document.body.classList.contains("modal-open");
|
|
715
|
+
}
|
|
716
|
+
function R() {
|
|
717
|
+
const l = document.querySelectorAll(".farris-modal").length;
|
|
718
|
+
(!l || l - 1 <= 0) && document.body.classList.remove("modal-open"), j.value && j.value.classList.remove("show");
|
|
719
|
+
}
|
|
720
|
+
$(() => e.title, (l, b) => {
|
|
721
|
+
l !== b && (L.value = l);
|
|
722
|
+
}), $(() => e.modelValue, (l, b) => {
|
|
723
|
+
l !== b && (c.value = l, c.value && e.draggable && G(() => {
|
|
724
|
+
E.value && !O.value && (O.value = E.value.parentElement, Y.value = O.value, M(W.value, E.value, Y.value));
|
|
725
|
+
}), l || (O.value && (O.value = null), R())), c.value && (D.value = m());
|
|
726
|
+
}), $(() => e.showHeader, (l, b) => {
|
|
727
|
+
l !== b && (f.value = l);
|
|
728
|
+
}), $(() => e.showButtons, (l, b) => {
|
|
729
|
+
l !== b && (P.value = l);
|
|
730
|
+
}), $(() => Z.value, (l, b) => {
|
|
731
|
+
const F = l || {}, N = b || {};
|
|
732
|
+
JSON.stringify(F) !== JSON.stringify(N) && t.emit("resize", {
|
|
733
|
+
newSize: l,
|
|
734
|
+
oldSize: b,
|
|
735
|
+
isMaximized: V.value
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
const ee = z(() => (c.value && document.body.classList.add("modal-open"), c.value)), ge = z(() => {
|
|
739
|
+
var F;
|
|
740
|
+
const l = {
|
|
741
|
+
modal: !0,
|
|
742
|
+
"farris-modal": !0,
|
|
743
|
+
fade: !0
|
|
744
|
+
};
|
|
745
|
+
l["f-modal-fitContent"] = !!u.value, l.show = !!ee.value;
|
|
746
|
+
const b = (F = e.maskClass) == null ? void 0 : F.split(" ");
|
|
747
|
+
return b == null || b.reduce((N, le) => (N[le] = !0, N), l), l;
|
|
748
|
+
}), be = z(() => {
|
|
749
|
+
var F;
|
|
750
|
+
const l = {
|
|
751
|
+
"modal-dialog": !0
|
|
752
|
+
}, b = (F = v.value) == null ? void 0 : F.split(" ");
|
|
753
|
+
return b == null || b.reduce((N, le) => (N[le] = !0, N), l), l;
|
|
754
|
+
}), we = z(() => {
|
|
755
|
+
const l = {
|
|
756
|
+
position: "absolute",
|
|
757
|
+
top: `${(window.innerHeight - a.value) / 2}px`,
|
|
758
|
+
left: `${(window.innerWidth - n.value) / 2}px`,
|
|
759
|
+
width: `${n.value}px`,
|
|
760
|
+
height: u.value ? "auto" : `${a.value}px`
|
|
761
|
+
};
|
|
762
|
+
return e.mask || (l.pointerEvents = "auto"), l;
|
|
763
|
+
}), Ce = z(() => {
|
|
764
|
+
const l = {
|
|
765
|
+
display: "block"
|
|
766
|
+
};
|
|
767
|
+
return e.mask || (l.pointerEvents = "none", l.backgroundColor = "transparent"), D.value && (l.backgroundColor = "transparent"), l;
|
|
768
|
+
}), xe = z(() => ({
|
|
769
|
+
"modal-content": !0,
|
|
770
|
+
"modal-content-has-header": f.value
|
|
771
|
+
})), Me = z(() => {
|
|
772
|
+
const l = {
|
|
773
|
+
display: f.value ? "" : "none"
|
|
774
|
+
};
|
|
775
|
+
return l["pointer-events"] = s.value ? "auto" : "none", l;
|
|
776
|
+
}), Be = z(() => ({
|
|
777
|
+
"f-icon": !0,
|
|
778
|
+
modal_maximize: !0,
|
|
779
|
+
modalrevert: V.value
|
|
780
|
+
})), ke = z(() => ({
|
|
781
|
+
"modal-body": !0,
|
|
782
|
+
"f-utils-flex-column": g.value === "iframe",
|
|
783
|
+
"f-utils-fill": !0
|
|
784
|
+
}));
|
|
785
|
+
function Ee() {
|
|
786
|
+
return {
|
|
787
|
+
height: `${e.footerHeight || 60}px`
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
const Oe = z(() => {
|
|
791
|
+
const l = {
|
|
792
|
+
textAlgin: k.value
|
|
793
|
+
}, b = Ee();
|
|
794
|
+
return Object.assign(l, b);
|
|
795
|
+
});
|
|
796
|
+
function ie(l) {
|
|
797
|
+
if (l.stopPropagation(), V.value) {
|
|
798
|
+
V.value = !1, Q();
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
_(), V.value = !0;
|
|
802
|
+
}
|
|
803
|
+
async function ze(l, b) {
|
|
804
|
+
l.handle && await l.handle(b, l) && t.emit("closed", b);
|
|
805
|
+
}
|
|
806
|
+
function Ie(l) {
|
|
807
|
+
l.width && (n.value = l.width), l.height && (a.value = l.height), l.buttons && (d.value = l.buttons), l.title && (L.value = l.title);
|
|
808
|
+
}
|
|
809
|
+
let te = null, ne = null;
|
|
810
|
+
Ye(() => {
|
|
811
|
+
D.value = m();
|
|
812
|
+
}), se(() => {
|
|
813
|
+
E.value && !O.value && (O.value = E.value.parentElement, Y.value = O.value, M(W.value, E.value, Y.value)), ee.value && document.body.classList.add("modal-open"), te = ut(e, t), ne = st(e, t);
|
|
814
|
+
}), ue(() => {
|
|
815
|
+
r && r(), te && te.remove(), ne && ne.remove();
|
|
816
|
+
}), t.expose({
|
|
817
|
+
modalElementRef: E,
|
|
818
|
+
updateModalOptions: Ie,
|
|
819
|
+
close: x,
|
|
820
|
+
maxDialog: ie,
|
|
821
|
+
isMaximized: V
|
|
822
|
+
});
|
|
823
|
+
function Se() {
|
|
824
|
+
return h("ul", null, [I.value && h("li", {
|
|
825
|
+
class: "f-btn-icon f-bare"
|
|
826
|
+
}, [h("span", {
|
|
827
|
+
class: "f-icon modal_minimize"
|
|
828
|
+
}, null)]), w.value && h("li", {
|
|
829
|
+
onClick: ie,
|
|
830
|
+
class: "f-btn-icon f-bare",
|
|
831
|
+
style: "pointer-events: auto;"
|
|
832
|
+
}, [h("span", {
|
|
833
|
+
class: Be.value
|
|
834
|
+
}, null)]), y.value && h("li", {
|
|
835
|
+
class: "f-btn-icon f-bare",
|
|
836
|
+
onClick: (l) => x(l, !1),
|
|
837
|
+
style: "pointer-events: auto;"
|
|
838
|
+
}, [h("span", {
|
|
839
|
+
class: "f-icon modal_close"
|
|
840
|
+
}, null)])]);
|
|
841
|
+
}
|
|
842
|
+
function He() {
|
|
843
|
+
return h("div", {
|
|
844
|
+
class: "modal-footer",
|
|
845
|
+
style: Oe.value
|
|
846
|
+
}, [d.value && d.value.map((l) => {
|
|
847
|
+
const b = o(l.disabled);
|
|
848
|
+
return h("button", {
|
|
849
|
+
name: l.name,
|
|
850
|
+
type: "button",
|
|
851
|
+
disabled: b.value,
|
|
852
|
+
class: l.class + (l.iconClass ? " btn-icontext" : ""),
|
|
853
|
+
onClick: (F) => {
|
|
854
|
+
ze(l, F);
|
|
855
|
+
}
|
|
856
|
+
}, [!!l.iconClass && h("i", {
|
|
857
|
+
class: l.iconClass
|
|
858
|
+
}, null), l.text]);
|
|
859
|
+
})]);
|
|
860
|
+
}
|
|
861
|
+
function Te() {
|
|
862
|
+
return h("div", {
|
|
863
|
+
ref: W,
|
|
864
|
+
class: "modal-header",
|
|
865
|
+
style: Me.value
|
|
866
|
+
}, [t.slots.headerTemplate ? t.slots.headerTemplate() : h("div", {
|
|
867
|
+
class: "modal-title"
|
|
868
|
+
}, [C.value && h("span", {
|
|
869
|
+
class: p.value,
|
|
870
|
+
style: "margin-right: 8px"
|
|
871
|
+
}, null), h("span", {
|
|
872
|
+
class: "modal-title-label"
|
|
873
|
+
}, [L.value])]), h("div", {
|
|
874
|
+
class: "actions"
|
|
875
|
+
}, [Se()])]);
|
|
876
|
+
}
|
|
877
|
+
function Re() {
|
|
878
|
+
return t.slots.footerTemplate ? t.slots.footerTemplate() : T.value && He();
|
|
879
|
+
}
|
|
880
|
+
function Pe(l) {
|
|
881
|
+
if (l.stopPropagation(), e.allowClickMaskToClose) {
|
|
882
|
+
if (l.target !== j.value)
|
|
883
|
+
return;
|
|
884
|
+
x(l, !1);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
function je() {
|
|
888
|
+
var l, b;
|
|
889
|
+
return h("div", {
|
|
890
|
+
id: i.value,
|
|
891
|
+
class: be.value,
|
|
892
|
+
style: we.value,
|
|
893
|
+
ref: E
|
|
894
|
+
}, [h("div", {
|
|
895
|
+
class: xe.value
|
|
896
|
+
}, [f.value && Te(), h("div", {
|
|
897
|
+
class: ke.value
|
|
898
|
+
}, [(b = (l = t.slots).default) == null ? void 0 : b.call(l), g.value === "iframe" && h("iframe", {
|
|
899
|
+
title: i.value,
|
|
900
|
+
class: "f-utils-fill",
|
|
901
|
+
width: "100%",
|
|
902
|
+
frameborder: "0",
|
|
903
|
+
src: B.value
|
|
904
|
+
}, null)]), Re()]), !u.value && E.value && !V.value && K(E.value)]);
|
|
905
|
+
}
|
|
906
|
+
function Le(l) {
|
|
907
|
+
return l || "body";
|
|
908
|
+
}
|
|
909
|
+
return () => h(re, {
|
|
910
|
+
to: Le(e.host)
|
|
911
|
+
}, {
|
|
912
|
+
default: () => [ee.value && h(qe, {
|
|
913
|
+
name: "fade",
|
|
914
|
+
appear: !0
|
|
915
|
+
}, {
|
|
916
|
+
default: () => [h("div", {
|
|
917
|
+
ref: j,
|
|
918
|
+
class: ge.value,
|
|
919
|
+
style: Ce.value,
|
|
920
|
+
onClick: Pe
|
|
921
|
+
}, [je()])]
|
|
922
|
+
})]
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
function pe(e) {
|
|
927
|
+
if (e.content && e.content.render)
|
|
928
|
+
return e.content.render;
|
|
929
|
+
if (e.render && typeof e.render == "function")
|
|
930
|
+
return e.render;
|
|
931
|
+
}
|
|
932
|
+
function it(e) {
|
|
933
|
+
const t = document.createElement("div");
|
|
934
|
+
t.style.display = "contents";
|
|
935
|
+
const n = ce({
|
|
936
|
+
setup(a, c) {
|
|
937
|
+
ue(() => {
|
|
938
|
+
document.body.removeChild(t);
|
|
939
|
+
});
|
|
940
|
+
const i = o(), v = o(e.class || ""), u = o(!!e.showButtons), f = o(!!e.showHeader), p = o(e.showCloseButton == null ? !0 : e.showCloseButton), y = o(!0), w = o(e.title || ""), I = e.acceptCallback || (() => {
|
|
941
|
+
}), g = e.rejectCallback || (() => {
|
|
942
|
+
}), B = e.closedCallback || ((j) => {
|
|
943
|
+
}), k = e.resizeHandle || ((j) => {
|
|
944
|
+
}), P = e.stopMoveHandle || ((j) => {
|
|
945
|
+
}), L = pe(e), O = (j) => {
|
|
946
|
+
y.value = !1, n.unmount(), B(j);
|
|
947
|
+
};
|
|
948
|
+
return se(() => {
|
|
949
|
+
}), c.expose({
|
|
950
|
+
modalRef: i
|
|
951
|
+
}), () => h(U, {
|
|
952
|
+
ref: i,
|
|
953
|
+
class: v.value,
|
|
954
|
+
modelValue: y.value,
|
|
955
|
+
"onUpdate:modelValue": (j) => y.value = j,
|
|
956
|
+
title: w.value,
|
|
957
|
+
width: e.width,
|
|
958
|
+
height: e.height,
|
|
959
|
+
buttons: e.buttons,
|
|
960
|
+
"show-header": f.value,
|
|
961
|
+
"show-buttons": u.value,
|
|
962
|
+
"show-close-button": p.value,
|
|
963
|
+
"show-max-button": !1,
|
|
964
|
+
onAccept: I,
|
|
965
|
+
onCancel: g,
|
|
966
|
+
fitContent: e.fitContent == null ? !0 : e.fitContent,
|
|
967
|
+
onClosed: O,
|
|
968
|
+
onResize: k,
|
|
969
|
+
onStopMove: P
|
|
970
|
+
}, {
|
|
971
|
+
default: () => [L && L(n)]
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
return document.body.appendChild(t), n.mount(t), n;
|
|
976
|
+
}
|
|
977
|
+
class rt {
|
|
978
|
+
constructor(t) {
|
|
979
|
+
A(this, "appContext", null);
|
|
980
|
+
A(this, "modalRef", o());
|
|
981
|
+
A(this, "activeModalIndex", o(0));
|
|
982
|
+
A(this, "modalRefs", {});
|
|
983
|
+
A(this, "isUseEscCloseModal", o(!1));
|
|
984
|
+
A(this, "activeModalInstance", z(() => this.modalRefs[this.activeModalIndex.value]));
|
|
985
|
+
this.app = t, this.appContext = t ? t._context : null;
|
|
986
|
+
}
|
|
987
|
+
getCurrentModal() {
|
|
988
|
+
return this.activeModalInstance.value;
|
|
989
|
+
}
|
|
990
|
+
adaptToWindow(t, n) {
|
|
991
|
+
const {
|
|
992
|
+
width: a,
|
|
993
|
+
height: c
|
|
994
|
+
} = {
|
|
995
|
+
width: window.innerWidth,
|
|
996
|
+
height: window.innerHeight
|
|
997
|
+
};
|
|
998
|
+
return a < t && (t = a - 14), c < n && (n = c - 14), {
|
|
999
|
+
width: t,
|
|
1000
|
+
height: n
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
static show(t) {
|
|
1004
|
+
const n = Object.assign({
|
|
1005
|
+
title: "",
|
|
1006
|
+
showButtons: !0,
|
|
1007
|
+
showHeader: !0
|
|
1008
|
+
}, t);
|
|
1009
|
+
return it(n);
|
|
1010
|
+
}
|
|
1011
|
+
close(t) {
|
|
1012
|
+
var n, a;
|
|
1013
|
+
t ? (a = t.value) == null || a.close() : (n = this.getCurrentModal()) == null || n.close();
|
|
1014
|
+
}
|
|
1015
|
+
open(t) {
|
|
1016
|
+
const n = document.createDocumentFragment();
|
|
1017
|
+
t.showMaxButton && t.fitContent && (t.showMaxButton = !1);
|
|
1018
|
+
const a = Ge(Object.assign({
|
|
1019
|
+
title: "",
|
|
1020
|
+
showButtons: !0,
|
|
1021
|
+
showHeader: !0
|
|
1022
|
+
}, t)), c = o(!0), i = a.value.acceptCallback || (() => {
|
|
1023
|
+
}), v = a.value.rejectCallback || (() => {
|
|
1024
|
+
}), u = a.value.closedCallback || ((x, H) => {
|
|
1025
|
+
}), f = a.value.resizeHandle || ((x) => {
|
|
1026
|
+
}), p = t.stopMoveHandle || ((x) => {
|
|
1027
|
+
});
|
|
1028
|
+
let y;
|
|
1029
|
+
const w = pe(a.value), I = (x) => {
|
|
1030
|
+
var d;
|
|
1031
|
+
c.value = !1;
|
|
1032
|
+
const H = (d = x == null ? void 0 : x.target) == null ? void 0 : d.classList.contains("modal_close");
|
|
1033
|
+
u(x, this.isUseEscCloseModal.value ? "esc" : H ? "icon" : "button");
|
|
1034
|
+
}, g = (x) => {
|
|
1035
|
+
I(x), y && G(() => {
|
|
1036
|
+
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], ae(null, n), y = null, this.modalRef.value = null, this.modalRefs) {
|
|
1037
|
+
const H = Object.keys(this.modalRefs).map((d) => Number(d));
|
|
1038
|
+
H.length > 0 ? this.activeModalIndex.value = Math.max(...H) : this.activeModalIndex.value = 0;
|
|
1039
|
+
}
|
|
1040
|
+
this.isUseEscCloseModal.value = !1;
|
|
1041
|
+
});
|
|
1042
|
+
}, B = (x) => {
|
|
1043
|
+
var H;
|
|
1044
|
+
this.isUseEscCloseModal.value = !0, this.activeModalInstance && ((H = this.activeModalInstance.value) == null || H.close(x == null ? void 0 : x.event));
|
|
1045
|
+
}, {
|
|
1046
|
+
width: k,
|
|
1047
|
+
height: P
|
|
1048
|
+
} = a.value, L = this.adaptToWindow(k || 500, P || 320);
|
|
1049
|
+
Object.assign(a.value, L);
|
|
1050
|
+
const O = () => h(U, de({
|
|
1051
|
+
ref: this.modalRef,
|
|
1052
|
+
modelValue: c.value,
|
|
1053
|
+
"onUpdate:modelValue": (x) => c.value = x
|
|
1054
|
+
}, a.value, {
|
|
1055
|
+
onAccept: i,
|
|
1056
|
+
onCancel: v,
|
|
1057
|
+
onClosed: g,
|
|
1058
|
+
onResize: f,
|
|
1059
|
+
onEsc: B,
|
|
1060
|
+
onStopMove: p
|
|
1061
|
+
}), {
|
|
1062
|
+
default: () => [w && w(this.app)]
|
|
1063
|
+
});
|
|
1064
|
+
return y = ((x) => {
|
|
1065
|
+
const H = Ue(O, x);
|
|
1066
|
+
return H.appContext = this.appContext, ae(H, n), H;
|
|
1067
|
+
})({
|
|
1068
|
+
...a.value
|
|
1069
|
+
// 'onUpdate:modelValue': onUpdateModelValue,
|
|
1070
|
+
}), this.activeModalIndex.value++, this.modalRefs[this.activeModalIndex.value] = this.modalRef.value, {
|
|
1071
|
+
update: (x) => {
|
|
1072
|
+
a.value = {
|
|
1073
|
+
...a.value,
|
|
1074
|
+
...x
|
|
1075
|
+
}, y && ae(Ke(y, {
|
|
1076
|
+
...a
|
|
1077
|
+
}), n);
|
|
1078
|
+
},
|
|
1079
|
+
destroy: g,
|
|
1080
|
+
modalRef: this.activeModalInstance,
|
|
1081
|
+
close: () => this.close()
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
const he = Symbol("FModalService");
|
|
1086
|
+
U.install = (e) => {
|
|
1087
|
+
e.component(U.name, U);
|
|
1088
|
+
const t = new rt(e);
|
|
1089
|
+
e.provide(he, t), e.provide("FModalService", t);
|
|
1090
|
+
};
|
|
1091
|
+
function me(e, t) {
|
|
1092
|
+
function n() {
|
|
1093
|
+
const a = e.beforeOpen || e.beforeClickButton || null;
|
|
1094
|
+
let c = Promise.resolve(!0);
|
|
1095
|
+
if (a) {
|
|
1096
|
+
const i = a(t.value);
|
|
1097
|
+
if (typeof i > "u")
|
|
1098
|
+
return c;
|
|
1099
|
+
typeof i == "boolean" ? c = Promise.resolve(i) : c = i;
|
|
1100
|
+
}
|
|
1101
|
+
return c;
|
|
1102
|
+
}
|
|
1103
|
+
return { judgeCanOpen: n };
|
|
1104
|
+
}
|
|
1105
|
+
function ct(e, t, n, a, c) {
|
|
1106
|
+
const i = o(e.buttonBehavior), v = o(e.popupOnInput), u = z(() => ({
|
|
1107
|
+
"input-group-append": !0,
|
|
1108
|
+
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
1109
|
+
})), { judgeCanOpen: f } = me(e, c), p = z(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable), y = fe(he, null), w = o();
|
|
1110
|
+
async function I(k) {
|
|
1111
|
+
if (await f() && p.value) {
|
|
1112
|
+
const P = !!t.slots.default;
|
|
1113
|
+
if (i.value === "Modal") {
|
|
1114
|
+
const L = e.modalOptions, O = y == null ? void 0 : y.open({
|
|
1115
|
+
...L,
|
|
1116
|
+
render: () => t.slots.default && t.slots.default()
|
|
1117
|
+
});
|
|
1118
|
+
w.value = O == null ? void 0 : O.modalRef;
|
|
1119
|
+
}
|
|
1120
|
+
i.value === "Overlay" && nt.show({
|
|
1121
|
+
// host: buttonEditRef.value,
|
|
1122
|
+
host: document.body,
|
|
1123
|
+
backgroundColor: "rgba(0,0,0,.15)",
|
|
1124
|
+
render: () => t.slots.default && t.slots.default()
|
|
1125
|
+
}), P && i.value === "Popup" && a.togglePopup(!0), P && v.value && a.hidePopup(), t.emit("clickButton", { origin: k, value: e.modelValue });
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
function g(k) {
|
|
1129
|
+
t.emit("mouseEnterIcon", k);
|
|
1130
|
+
}
|
|
1131
|
+
function B(k) {
|
|
1132
|
+
t.emit("mouseLeaveIcon", k);
|
|
1133
|
+
}
|
|
1134
|
+
return {
|
|
1135
|
+
buttonGroupClass: u,
|
|
1136
|
+
onClickButton: I,
|
|
1137
|
+
onMouseEnterButton: g,
|
|
1138
|
+
onMouseLeaveButton: B,
|
|
1139
|
+
modalRef: w
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
const q = "FarrisVue_PopoverInstancesKey";
|
|
1143
|
+
function dt(e, t, n, a) {
|
|
1144
|
+
const c = o(), i = o(!1), { judgeCanOpen: v } = me(e, a);
|
|
1145
|
+
$(() => c.value, (g, B) => {
|
|
1146
|
+
window[q] = window[q] || /* @__PURE__ */ new WeakMap(), g ? window[q].set(n.value, g) : window[q].delete(n.value);
|
|
1147
|
+
});
|
|
1148
|
+
function u() {
|
|
1149
|
+
if (window[q]) {
|
|
1150
|
+
const g = window[q];
|
|
1151
|
+
document.querySelectorAll(".f-button-edit,.v-popover").forEach((B) => {
|
|
1152
|
+
g.get(B) && B !== n.value && g.get(B).hide();
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
function f() {
|
|
1157
|
+
const g = c.value;
|
|
1158
|
+
g && g.show(n.value);
|
|
1159
|
+
}
|
|
1160
|
+
async function p(g = !1) {
|
|
1161
|
+
if (!!t.slots.default) {
|
|
1162
|
+
if (!g && !i.value && !await v())
|
|
1163
|
+
return;
|
|
1164
|
+
i.value = !i.value, await G(), f();
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
async function y(g = !1) {
|
|
1168
|
+
if (!!t.slots.default) {
|
|
1169
|
+
if (!g && !await v())
|
|
1170
|
+
return;
|
|
1171
|
+
i.value = !0, await G(), f();
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
function w() {
|
|
1175
|
+
i.value = !1;
|
|
1176
|
+
}
|
|
1177
|
+
function I() {
|
|
1178
|
+
i.value = !0, G(() => {
|
|
1179
|
+
f();
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
return { hidePopup: w, showPopup: I, popup: y, shouldPopupContent: i, togglePopup: p, popoverRef: c, closeAllPopover: u };
|
|
1183
|
+
}
|
|
1184
|
+
function ft(e, t, n) {
|
|
1185
|
+
const {
|
|
1186
|
+
buttonGroupClass: a
|
|
1187
|
+
} = n, c = o();
|
|
1188
|
+
return {
|
|
1189
|
+
renderButtonGroup: () => h("div", {
|
|
1190
|
+
id: `${e.id}-button-group`,
|
|
1191
|
+
class: a.value
|
|
1192
|
+
}, [t.slots.buttonContent ? h("span", {
|
|
1193
|
+
class: "input-group-text input-group-append-button"
|
|
1194
|
+
}, [t.slots.buttonContent()]) : e.buttonContent ? h("span", {
|
|
1195
|
+
class: "input-group-text input-group-append-button",
|
|
1196
|
+
innerHTML: e.buttonContent,
|
|
1197
|
+
ref: c
|
|
1198
|
+
}, null) : null]),
|
|
1199
|
+
buttonHandleElement: c
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
const J = /* @__PURE__ */ oe({
|
|
1203
|
+
name: "FButtonEdit",
|
|
1204
|
+
props: _e,
|
|
1205
|
+
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
|
|
1206
|
+
setup(e, t) {
|
|
1207
|
+
const n = o(), a = fe("design-item-context"), c = Je(n, a), i = o(e.customClass), v = o(e.modelValue), u = dt(e, t, n, v), f = ct(e, t, n, u, v), p = o(), y = z(() => ({
|
|
1208
|
+
"f-cmp-inputgroup": !0,
|
|
1209
|
+
"input-group": !0,
|
|
1210
|
+
"f-state-disabled": !0,
|
|
1211
|
+
"f-state-editable": !1,
|
|
1212
|
+
"f-state-readonly": !0
|
|
1213
|
+
}));
|
|
1214
|
+
se(() => {
|
|
1215
|
+
n.value.componentInstance = c;
|
|
1216
|
+
}), t.expose(c.value);
|
|
1217
|
+
const w = z(() => {
|
|
1218
|
+
const g = {
|
|
1219
|
+
"f-button-edit": !0,
|
|
1220
|
+
"f-cmp-inputgroup": !0,
|
|
1221
|
+
"f-button-edit-nowrap": !e.wrapText
|
|
1222
|
+
};
|
|
1223
|
+
return i.value && i.value.split(" ").reduce((B, k) => (B[k] = !0, B), g), g;
|
|
1224
|
+
}), {
|
|
1225
|
+
renderButtonGroup: I
|
|
1226
|
+
} = ft(e, t, f);
|
|
1227
|
+
return () => h("div", de(t.attrs, {
|
|
1228
|
+
ref: n,
|
|
1229
|
+
class: w.value,
|
|
1230
|
+
id: e.id
|
|
1231
|
+
}), [h("div", {
|
|
1232
|
+
class: y.value
|
|
1233
|
+
}, [h("input", {
|
|
1234
|
+
ref: p,
|
|
1235
|
+
class: "form-control",
|
|
1236
|
+
readonly: !0,
|
|
1237
|
+
placeholder: e.placeholder
|
|
1238
|
+
}, null), I()])]);
|
|
1239
|
+
}
|
|
1240
|
+
}), vt = /* @__PURE__ */ new Map([
|
|
1241
|
+
["appearance", Ve]
|
|
1242
|
+
]);
|
|
1243
|
+
function pt(e, t, n) {
|
|
1244
|
+
return t;
|
|
1245
|
+
}
|
|
1246
|
+
const ht = "https://json-schema.org/draft/2020-12/schema", mt = "https://farris-design.gitee.io/button-edit.schema.json", yt = "button-edit", gt = "A Farris Input Component", bt = "object", wt = {
|
|
1247
|
+
id: {
|
|
1248
|
+
description: "The unique identifier for a Input Group",
|
|
1249
|
+
type: "string"
|
|
1250
|
+
},
|
|
1251
|
+
type: {
|
|
1252
|
+
description: "The type string of Input Group component",
|
|
1253
|
+
type: "string",
|
|
1254
|
+
default: "button-edit"
|
|
1255
|
+
},
|
|
1256
|
+
appearance: {
|
|
1257
|
+
description: "",
|
|
1258
|
+
type: "object",
|
|
1259
|
+
properties: {
|
|
1260
|
+
class: {
|
|
1261
|
+
type: "string"
|
|
1262
|
+
},
|
|
1263
|
+
style: {
|
|
1264
|
+
type: "string"
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
default: {}
|
|
1268
|
+
},
|
|
1269
|
+
binding: {
|
|
1270
|
+
description: "",
|
|
1271
|
+
type: "object",
|
|
1272
|
+
default: {}
|
|
1273
|
+
},
|
|
1274
|
+
disable: {
|
|
1275
|
+
type: "string",
|
|
1276
|
+
default: !1
|
|
1277
|
+
},
|
|
1278
|
+
editable: {
|
|
1279
|
+
description: "",
|
|
1280
|
+
type: "boolean",
|
|
1281
|
+
default: !0
|
|
1282
|
+
},
|
|
1283
|
+
enableLinkLabel: {
|
|
1284
|
+
description: "",
|
|
1285
|
+
type: "boolean",
|
|
1286
|
+
default: !1
|
|
1287
|
+
},
|
|
1288
|
+
label: {
|
|
1289
|
+
description: "",
|
|
1290
|
+
type: "string",
|
|
1291
|
+
default: ""
|
|
1292
|
+
},
|
|
1293
|
+
lableWidth: {
|
|
1294
|
+
description: "",
|
|
1295
|
+
type: "number"
|
|
1296
|
+
},
|
|
1297
|
+
placeholder: {
|
|
1298
|
+
description: "",
|
|
1299
|
+
type: "string",
|
|
1300
|
+
default: ""
|
|
1301
|
+
},
|
|
1302
|
+
forcePlaceholder: {
|
|
1303
|
+
description: "",
|
|
1304
|
+
type: "boolean",
|
|
1305
|
+
default: !1
|
|
1306
|
+
},
|
|
1307
|
+
readonly: {
|
|
1308
|
+
description: "",
|
|
1309
|
+
type: "boolean",
|
|
1310
|
+
default: !1
|
|
1311
|
+
},
|
|
1312
|
+
require: {
|
|
1313
|
+
description: "",
|
|
1314
|
+
type: "boolean",
|
|
1315
|
+
default: !1
|
|
1316
|
+
},
|
|
1317
|
+
tabindex: {
|
|
1318
|
+
description: "",
|
|
1319
|
+
type: "number",
|
|
1320
|
+
default: -1
|
|
1321
|
+
},
|
|
1322
|
+
textAlign: {
|
|
1323
|
+
description: "",
|
|
1324
|
+
type: "string",
|
|
1325
|
+
enum: [
|
|
1326
|
+
"left",
|
|
1327
|
+
"middle",
|
|
1328
|
+
"right"
|
|
1329
|
+
],
|
|
1330
|
+
default: "left"
|
|
1331
|
+
},
|
|
1332
|
+
visible: {
|
|
1333
|
+
description: "",
|
|
1334
|
+
type: "boolean",
|
|
1335
|
+
default: !0
|
|
1336
|
+
},
|
|
1337
|
+
onBlur: {
|
|
1338
|
+
description: "",
|
|
1339
|
+
type: "string",
|
|
1340
|
+
default: ""
|
|
1341
|
+
},
|
|
1342
|
+
onClickLinkLabel: {
|
|
1343
|
+
description: "",
|
|
1344
|
+
type: "sting",
|
|
1345
|
+
default: ""
|
|
1346
|
+
},
|
|
1347
|
+
autoComplete: {
|
|
1348
|
+
description: "",
|
|
1349
|
+
type: "boolean",
|
|
1350
|
+
default: !1
|
|
1351
|
+
},
|
|
1352
|
+
buttonContent: {
|
|
1353
|
+
description: "",
|
|
1354
|
+
type: "string",
|
|
1355
|
+
default: ""
|
|
1356
|
+
},
|
|
1357
|
+
enableClear: {
|
|
1358
|
+
description: "",
|
|
1359
|
+
type: "boolean",
|
|
1360
|
+
default: !0
|
|
1361
|
+
},
|
|
1362
|
+
inputType: {
|
|
1363
|
+
description: "",
|
|
1364
|
+
type: "string",
|
|
1365
|
+
enum: [
|
|
1366
|
+
"text",
|
|
1367
|
+
"tag"
|
|
1368
|
+
],
|
|
1369
|
+
default: "text"
|
|
1370
|
+
},
|
|
1371
|
+
multiSelect: {
|
|
1372
|
+
description: "",
|
|
1373
|
+
type: "boolean",
|
|
1374
|
+
default: !1
|
|
1375
|
+
},
|
|
1376
|
+
popup: {
|
|
1377
|
+
description: "",
|
|
1378
|
+
type: "object",
|
|
1379
|
+
properties: {
|
|
1380
|
+
footerButtons: {
|
|
1381
|
+
type: "array",
|
|
1382
|
+
default: []
|
|
1383
|
+
},
|
|
1384
|
+
height: {
|
|
1385
|
+
type: "number",
|
|
1386
|
+
default: 600
|
|
1387
|
+
},
|
|
1388
|
+
dataMapping: {
|
|
1389
|
+
type: "object"
|
|
1390
|
+
},
|
|
1391
|
+
contents: {
|
|
1392
|
+
type: "array",
|
|
1393
|
+
default: []
|
|
1394
|
+
},
|
|
1395
|
+
showMaxButton: {
|
|
1396
|
+
type: "boolean",
|
|
1397
|
+
default: !0
|
|
1398
|
+
},
|
|
1399
|
+
showCloseButton: {
|
|
1400
|
+
type: "boolean",
|
|
1401
|
+
default: !0
|
|
1402
|
+
},
|
|
1403
|
+
showFooter: {
|
|
1404
|
+
type: "boolean",
|
|
1405
|
+
default: !0
|
|
1406
|
+
},
|
|
1407
|
+
title: {
|
|
1408
|
+
type: "string",
|
|
1409
|
+
default: ""
|
|
1410
|
+
},
|
|
1411
|
+
width: {
|
|
1412
|
+
type: "number",
|
|
1413
|
+
default: 800
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
},
|
|
1417
|
+
popupClass: {
|
|
1418
|
+
description: "",
|
|
1419
|
+
type: "sting",
|
|
1420
|
+
default: ""
|
|
1421
|
+
},
|
|
1422
|
+
separator: {
|
|
1423
|
+
type: "string",
|
|
1424
|
+
default: ","
|
|
1425
|
+
},
|
|
1426
|
+
showButtonWhenDisabled: {
|
|
1427
|
+
description: "",
|
|
1428
|
+
type: "boolean",
|
|
1429
|
+
default: !1
|
|
1430
|
+
},
|
|
1431
|
+
wrapText: {
|
|
1432
|
+
type: "boolean",
|
|
1433
|
+
default: !1
|
|
1434
|
+
},
|
|
1435
|
+
onClear: {
|
|
1436
|
+
description: "",
|
|
1437
|
+
type: "string",
|
|
1438
|
+
default: ""
|
|
1439
|
+
}
|
|
1440
|
+
}, Ct = [
|
|
1441
|
+
"id",
|
|
1442
|
+
"type"
|
|
1443
|
+
], xt = {
|
|
1444
|
+
$schema: ht,
|
|
1445
|
+
$id: mt,
|
|
1446
|
+
title: yt,
|
|
1447
|
+
description: gt,
|
|
1448
|
+
type: bt,
|
|
1449
|
+
properties: wt,
|
|
1450
|
+
required: Ct
|
|
1451
|
+
}, Mt = "buttonEdit", Bt = "A Farris Component", kt = "object", Et = {
|
|
1452
|
+
basic: {
|
|
1453
|
+
description: "Basic Infomation",
|
|
1454
|
+
title: "基本信息",
|
|
1455
|
+
properties: {
|
|
1456
|
+
id: {
|
|
1457
|
+
description: "组件标识",
|
|
1458
|
+
title: "标识",
|
|
1459
|
+
type: "string",
|
|
1460
|
+
readonly: !0
|
|
1461
|
+
},
|
|
1462
|
+
type: {
|
|
1463
|
+
description: "组件类型",
|
|
1464
|
+
title: "控件类型",
|
|
1465
|
+
type: "select",
|
|
1466
|
+
editor: {
|
|
1467
|
+
type: "waiting for modification",
|
|
1468
|
+
enum: []
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
},
|
|
1473
|
+
behavior: {
|
|
1474
|
+
description: "Basic Infomation",
|
|
1475
|
+
title: "行为",
|
|
1476
|
+
properties: {
|
|
1477
|
+
editable: {
|
|
1478
|
+
description: "",
|
|
1479
|
+
title: "允许编辑",
|
|
1480
|
+
type: "boolean"
|
|
1481
|
+
},
|
|
1482
|
+
readonly: {
|
|
1483
|
+
description: "",
|
|
1484
|
+
title: "只读",
|
|
1485
|
+
type: "string"
|
|
1486
|
+
},
|
|
1487
|
+
required: {
|
|
1488
|
+
description: "",
|
|
1489
|
+
title: "必填",
|
|
1490
|
+
type: "boolean"
|
|
1491
|
+
},
|
|
1492
|
+
visible: {
|
|
1493
|
+
description: "",
|
|
1494
|
+
title: "可见",
|
|
1495
|
+
type: "boolean"
|
|
1496
|
+
},
|
|
1497
|
+
placeholder: {
|
|
1498
|
+
description: "",
|
|
1499
|
+
title: "提示文本",
|
|
1500
|
+
type: "string"
|
|
1501
|
+
},
|
|
1502
|
+
tabindex: {
|
|
1503
|
+
description: "",
|
|
1504
|
+
title: "tab索引",
|
|
1505
|
+
type: "number"
|
|
1506
|
+
},
|
|
1507
|
+
textAlign: {
|
|
1508
|
+
description: "",
|
|
1509
|
+
title: "对齐方式",
|
|
1510
|
+
type: "enum",
|
|
1511
|
+
editor: {
|
|
1512
|
+
type: "combo-list",
|
|
1513
|
+
textField: "name",
|
|
1514
|
+
valueField: "value",
|
|
1515
|
+
data: [
|
|
1516
|
+
{
|
|
1517
|
+
value: "left",
|
|
1518
|
+
name: "左对齐"
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
value: "center",
|
|
1522
|
+
name: "居中"
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
value: "right",
|
|
1526
|
+
name: "右对齐"
|
|
1527
|
+
}
|
|
1528
|
+
]
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
}, Ot = {
|
|
1534
|
+
title: Mt,
|
|
1535
|
+
description: Bt,
|
|
1536
|
+
type: kt,
|
|
1537
|
+
categories: Et
|
|
1538
|
+
}, ye = Ne(
|
|
1539
|
+
$e,
|
|
1540
|
+
xt,
|
|
1541
|
+
vt,
|
|
1542
|
+
pt,
|
|
1543
|
+
Ot
|
|
1544
|
+
);
|
|
1545
|
+
J.register = (e, t, n, a) => {
|
|
1546
|
+
e["button-edit"] = Ae, t["button-edit"] = ye;
|
|
1547
|
+
};
|
|
1548
|
+
J.registerDesigner = (e, t, n) => {
|
|
1549
|
+
e["button-edit"] = J, t["button-edit"] = ye;
|
|
1550
|
+
};
|
|
1551
|
+
const Pt = De(J);
|
|
1552
|
+
export {
|
|
1553
|
+
J as FButtonEditDesign,
|
|
1554
|
+
Pt as default,
|
|
1555
|
+
ye as propsResolver
|
|
1556
|
+
};
|