@farris/ui-vue 1.6.5-beta.8 → 1.6.5
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 +334 -334
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +4 -4
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +136 -133
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/component/index.esm.js +300 -300
- 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 +295 -295
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +99 -99
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3416 -3350
- package/components/data-view/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 +170 -170
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +637 -637
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +699 -696
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/filter-bar/index.esm.js +446 -446
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +377 -374
- package/components/filter-condition-editor/index.umd.cjs +2 -2
- package/components/flow-canvas/index.esm.js +204 -204
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +42 -40
- package/components/list-view/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +427 -427
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +212 -212
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +276 -276
- package/components/modal/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +160 -160
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +314 -314
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +468 -463
- package/components/order/index.umd.cjs +2 -2
- package/components/popover/index.esm.js +58 -56
- package/components/popover/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +215 -215
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +4 -4
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +282 -282
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +944 -941
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +498 -492
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/search-box/index.esm.js +76 -72
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +211 -211
- package/components/section/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +377 -374
- package/components/sort-condition-editor/index.umd.cjs +2 -2
- package/components/switch/index.esm.js +78 -77
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +579 -579
- package/components/tabs/index.umd.cjs +2 -2
- package/components/textarea/index.esm.js +362 -362
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +9799 -0
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/time-picker/package.json +8 -0
- package/components/time-picker/style.js +6 -0
- package/components/transfer/index.esm.js +81 -79
- package/components/transfer/index.umd.cjs +2 -2
- package/components/tree-grid/index.esm.js +100 -100
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2361 -2279
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/video/index.esm.js +219 -219
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +4856 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +254 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +382 -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 +15439 -0
- package/designer/data-grid/index.umd.cjs +23 -0
- package/designer/data-view/index.esm.js +854 -0
- package/designer/data-view/index.umd.cjs +38 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +525 -0
- package/designer/drawer/index.umd.cjs +1 -0
- package/designer/farris-designer.all.esm.js +22330 -0
- package/designer/farris-designer.all.umd.cjs +34 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +1098 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/list-view/index.css +1 -0
- package/designer/list-view/index.esm.js +4689 -0
- package/designer/list-view/index.umd.cjs +40 -0
- package/designer/radio-group/index.css +1 -0
- package/designer/radio-group/index.esm.js +6985 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/designer/tree-grid/index.esm.js +1099 -0
- package/designer/tree-grid/index.umd.cjs +1 -0
- package/farris.all.esm.js +9619 -9535
- package/farris.all.umd.cjs +24 -24
- package/locales/data-grid/ui/en.json +2 -2
- package/locales/designer/en.json +7 -6
- package/locales/designer/zh-CHS.json +2 -1
- package/locales/designer/zh-CHT.json +2 -1
- package/locales/ui/en.json +7 -6
- package/locales/ui/zh-CHS.json +2 -1
- package/locales/ui/zh-CHT.json +2 -1
- package/package.json +1 -1
- package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
- package/types/data-view/composition/types.d.ts +10 -4
|
@@ -0,0 +1,4856 @@
|
|
|
1
|
+
var kn = Object.defineProperty;
|
|
2
|
+
var Fn = (e, t, n) => t in e ? kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var ye = (e, t, n) => Fn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { getMaxZIndex as In, getCustomClass as En, withInstall as Gt, FormSchemaEntityField$Type as Vt, FormSchemaEntityFieldTypeName as _t } from "../../components/common/index.esm.js";
|
|
5
|
+
import { resolveAppearance as Ut, createPropsResolver as Nt } from "../../components/dynamic-resolver/index.esm.js";
|
|
6
|
+
import On, { buttonEditProps as Mn } from "../../components/button-edit/index.esm.js";
|
|
7
|
+
import { defineComponent as Ge, ref as h, computed as D, createVNode as w, Teleport as Xt, createApp as Pt, onUnmounted as lt, Fragment as at, watch as xe, nextTick as Ke, onBeforeMount as Rn, onMounted as st, Transition as Yt, shallowRef as jn, render as Mt, h as Nn, cloneVNode as Pn, mergeProps as gt, reactive as $e, createTextVNode as Dn, inject as Jt } from "vue";
|
|
8
|
+
import { useI18n as Dt } from "vue-i18n";
|
|
9
|
+
import { LocaleService as yt } from "../../components/locale/index.esm.js";
|
|
10
|
+
import { cloneDeep as Rt, isPlainObject as qt, isUndefined as Pe } from "lodash-es";
|
|
11
|
+
import "../../components/accordion/index.esm.js";
|
|
12
|
+
import "../../components/avatar/index.esm.js";
|
|
13
|
+
import "../button-edit/index.esm.js";
|
|
14
|
+
import "../../components/button-group/index.esm.js";
|
|
15
|
+
import "../../components/calendar/index.esm.js";
|
|
16
|
+
import "../../components/capsule/index.esm.js";
|
|
17
|
+
import "../checkbox/index.esm.js";
|
|
18
|
+
import "../checkbox-group/index.esm.js";
|
|
19
|
+
import "../../components/combo-list/index.esm.js";
|
|
20
|
+
import "../../components/combo-tree/index.esm.js";
|
|
21
|
+
import "../../components/component/index.esm.js";
|
|
22
|
+
import "../../components/color-picker/index.esm.js";
|
|
23
|
+
import "../../components/content-container/index.esm.js";
|
|
24
|
+
import "../../components/date-picker/index.esm.js";
|
|
25
|
+
import "../data-grid/index.esm.js";
|
|
26
|
+
import "../../components/dropdown/index.esm.js";
|
|
27
|
+
import "../../components/dynamic-form/index.esm.js";
|
|
28
|
+
import "../../components/events-editor/index.esm.js";
|
|
29
|
+
import "../../components/filter-bar/index.esm.js";
|
|
30
|
+
import "../../components/field-selector/index.esm.js";
|
|
31
|
+
import "../../components/binding-selector/index.esm.js";
|
|
32
|
+
import "../../components/image-cropper/index.esm.js";
|
|
33
|
+
import "../input-group/index.esm.js";
|
|
34
|
+
import "../../components/layout/index.esm.js";
|
|
35
|
+
import "../../components/list-nav/index.esm.js";
|
|
36
|
+
import "../list-view/index.esm.js";
|
|
37
|
+
import "../../components/lookup/index.esm.js";
|
|
38
|
+
import "../../components/mapping-editor/index.esm.js";
|
|
39
|
+
import "../../components/nav/index.esm.js";
|
|
40
|
+
import "../../components/number-range/index.esm.js";
|
|
41
|
+
import "../../components/number-spinner/index.esm.js";
|
|
42
|
+
import "../../components/order/index.esm.js";
|
|
43
|
+
import "../../components/page-header/index.esm.js";
|
|
44
|
+
import "../../components/page-footer/index.esm.js";
|
|
45
|
+
import "../../components/pagination/index.esm.js";
|
|
46
|
+
import "../../components/progress/index.esm.js";
|
|
47
|
+
import "../../components/query-solution/index.esm.js";
|
|
48
|
+
import "../radio-group/index.esm.js";
|
|
49
|
+
import "../../components/rate/index.esm.js";
|
|
50
|
+
import "../../components/response-toolbar/index.esm.js";
|
|
51
|
+
import "../../components/response-layout/index.esm.js";
|
|
52
|
+
import "../../components/response-layout-editor/index.esm.js";
|
|
53
|
+
import "../../components/search-box/index.esm.js";
|
|
54
|
+
import "../../components/section/index.esm.js";
|
|
55
|
+
import "../../components/smoke-detector/index.esm.js";
|
|
56
|
+
import "../../components/splitter/index.esm.js";
|
|
57
|
+
import "../../components/step/index.esm.js";
|
|
58
|
+
import "../../components/switch/index.esm.js";
|
|
59
|
+
import "../../components/tabs/index.esm.js";
|
|
60
|
+
import "../../components/tags/index.esm.js";
|
|
61
|
+
import "../../components/text/index.esm.js";
|
|
62
|
+
import "../../components/time-picker/index.esm.js";
|
|
63
|
+
import "../../components/transfer/index.esm.js";
|
|
64
|
+
import "../../components/tree-view/index.esm.js";
|
|
65
|
+
import "../../components/uploader/index.esm.js";
|
|
66
|
+
import "../../components/verify-detail/index.esm.js";
|
|
67
|
+
import "../../components/video/index.esm.js";
|
|
68
|
+
import "../../components/textarea/index.esm.js";
|
|
69
|
+
import "../../components/schema-selector/index.esm.js";
|
|
70
|
+
import "../tree-grid/index.esm.js";
|
|
71
|
+
import "../../components/event-parameter/index.esm.js";
|
|
72
|
+
import "../../components/filter-condition-editor/index.esm.js";
|
|
73
|
+
import "../../components/fieldset/index.esm.js";
|
|
74
|
+
import "../../components/sort-condition-editor/index.esm.js";
|
|
75
|
+
import "../../components/menu-lookup/index.esm.js";
|
|
76
|
+
import "../drawer/index.esm.js";
|
|
77
|
+
import "../../components/json-editor/index.esm.js";
|
|
78
|
+
import "../../components/property-editor/index.esm.js";
|
|
79
|
+
import "../../components/expression-editor/index.esm.js";
|
|
80
|
+
import "../../components/code-editor/index.esm.js";
|
|
81
|
+
import "../../components/html-template/index.esm.js";
|
|
82
|
+
import "../../components/collection-property-editor/index.esm.js";
|
|
83
|
+
import "../../components/modal/index.esm.js";
|
|
84
|
+
import "../../components/external-container/index.esm.js";
|
|
85
|
+
import "../../components/language-textbox/index.esm.js";
|
|
86
|
+
import { useDesignerComponent as $n } from "../../components/designer-canvas/index.esm.js";
|
|
87
|
+
import { useResizeObserver as Hn } from "@vueuse/core";
|
|
88
|
+
import { getHierarchyRow as Ln, useIdentify as zn, useGroupData as An, useFilter as Vn, useHierarchy as _n, useLoading as qn, useDataView as Wn, useSelection as Gn, useSelectHierarchyItem as Un, usePagination as Xn, useDataViewContainerStyle as Yn, useCommandColumn as Jn, useSettingColumn as Qn, useColumn as Zn, useSort as Kn, useGroupColumn as eo, useRow as to, useEdit as no, useVisualDataBound as oo, useVisualDataCell as ro, useVisualDataRow as io, useVisualData as ao, useCellPosition as lo, useSidebar as so, useVirtualScroll as uo, useFitColumn as co, useFilterHistory as fo, useColumnFilter as po, useDragColumn as mo, getColumnHeader as vo, getSidebar as go, getDisableMask as yo, getHorizontalScrollbar as ho, getVerticalScrollbar as bo, getEmpty as wo, getPagination as Co, getSummary as xo } from "../../components/data-view/index.esm.js";
|
|
89
|
+
import "../../components/property-panel/index.esm.js";
|
|
90
|
+
import "../../components/notify/index.esm.js";
|
|
91
|
+
const So = {
|
|
92
|
+
/**
|
|
93
|
+
* 组件标识
|
|
94
|
+
*/
|
|
95
|
+
id: { type: String, default: "" },
|
|
96
|
+
/**
|
|
97
|
+
* 扩展按钮显示内容,这是一段现在扩展按钮中的html标签
|
|
98
|
+
*/
|
|
99
|
+
buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
|
|
100
|
+
buttonBehavior: { type: String, default: "Popup" },
|
|
101
|
+
/**
|
|
102
|
+
* 启用输入框自动完成功能
|
|
103
|
+
*/
|
|
104
|
+
autoComplete: { type: Boolean, default: !1 },
|
|
105
|
+
/**
|
|
106
|
+
* 组件自定义样式
|
|
107
|
+
*/
|
|
108
|
+
customClass: { type: String, default: "" },
|
|
109
|
+
/**
|
|
110
|
+
* 禁用组件,既不允许在输入框中录入,也不允许点击扩展按钮。
|
|
111
|
+
*/
|
|
112
|
+
disable: { type: Boolean, default: !1 },
|
|
113
|
+
/**
|
|
114
|
+
* 允许在输入框中录入文本。
|
|
115
|
+
*/
|
|
116
|
+
editable: { type: Boolean, default: !0 },
|
|
117
|
+
/**
|
|
118
|
+
* 显示清空文本按钮
|
|
119
|
+
*/
|
|
120
|
+
enableClear: { type: Boolean, default: !1 },
|
|
121
|
+
/**
|
|
122
|
+
* 组件值
|
|
123
|
+
*/
|
|
124
|
+
modelValue: { type: String, default: "" },
|
|
125
|
+
/**
|
|
126
|
+
* 将组件设置为只读,既不允许在输入框中录入,也不允许点击扩展按钮,但是允许复制输入框中的内容。
|
|
127
|
+
*/
|
|
128
|
+
readonly: { type: Boolean, default: !1 },
|
|
129
|
+
/**
|
|
130
|
+
* 禁用组件时,是否显示扩展按钮
|
|
131
|
+
*/
|
|
132
|
+
showButtonWhenDisabled: { type: Boolean, default: !1 },
|
|
133
|
+
/**
|
|
134
|
+
* 鼠标悬停在组件上时显示文本框内容。
|
|
135
|
+
*/
|
|
136
|
+
enableTitle: { type: Boolean, default: !1 },
|
|
137
|
+
/**
|
|
138
|
+
* 输入框类型
|
|
139
|
+
*/
|
|
140
|
+
inputType: { type: String, default: "text" },
|
|
141
|
+
/**
|
|
142
|
+
* 显示输入框提示信息
|
|
143
|
+
*/
|
|
144
|
+
forcePlaceholder: { type: Boolean, default: !1 },
|
|
145
|
+
/**
|
|
146
|
+
* 输入框提示文本
|
|
147
|
+
*/
|
|
148
|
+
placeholder: { type: String, default: "" },
|
|
149
|
+
/**
|
|
150
|
+
* 输入框最小长度
|
|
151
|
+
*/
|
|
152
|
+
minLength: Number,
|
|
153
|
+
/**
|
|
154
|
+
* 输入框最大长度
|
|
155
|
+
*/
|
|
156
|
+
maxLength: { type: Number },
|
|
157
|
+
/**
|
|
158
|
+
* 输入框Tab键索引
|
|
159
|
+
*/
|
|
160
|
+
tabIndex: Number,
|
|
161
|
+
popupHost: { type: Object },
|
|
162
|
+
popupRightBoundary: { type: Object },
|
|
163
|
+
popupOffsetX: { type: Object },
|
|
164
|
+
popupOnInput: { type: Boolean, default: !1 },
|
|
165
|
+
popupOnFocus: { type: Boolean, default: !1 },
|
|
166
|
+
popupOnClick: { type: Boolean, default: !1 },
|
|
167
|
+
/**
|
|
168
|
+
* 样式追加到弹出窗口
|
|
169
|
+
*/
|
|
170
|
+
popupClass: { type: String, default: "" },
|
|
171
|
+
popupMinWidth: { type: Number, default: 160 },
|
|
172
|
+
modalOptions: { type: Object, default: {} },
|
|
173
|
+
wrapText: { type: Boolean, default: !1 },
|
|
174
|
+
/**
|
|
175
|
+
* 可选,是否支持多选
|
|
176
|
+
* 默认`false`
|
|
177
|
+
*/
|
|
178
|
+
multiSelect: { type: Boolean, default: !1 },
|
|
179
|
+
/**
|
|
180
|
+
* 可选,分隔符
|
|
181
|
+
* 默认`,`
|
|
182
|
+
*/
|
|
183
|
+
separator: { type: String, default: "," },
|
|
184
|
+
/** 对齐方式 */
|
|
185
|
+
textAlign: { type: String, default: "left" },
|
|
186
|
+
/**
|
|
187
|
+
* 废弃
|
|
188
|
+
*/
|
|
189
|
+
beforeClickButton: { type: Function, default: null },
|
|
190
|
+
/**
|
|
191
|
+
* 作为内嵌编辑器被创建后默认获得焦点
|
|
192
|
+
*/
|
|
193
|
+
focusOnCreated: { type: Boolean, default: !1 },
|
|
194
|
+
/**
|
|
195
|
+
* 作为内嵌编辑器被创建后默认选中文本
|
|
196
|
+
*/
|
|
197
|
+
selectOnCreated: { type: Boolean, default: !1 },
|
|
198
|
+
/**
|
|
199
|
+
* 打开前
|
|
200
|
+
*/
|
|
201
|
+
beforeOpen: { type: Function, default: null },
|
|
202
|
+
/** 更新方式 blur | change */
|
|
203
|
+
updateOn: { type: String, default: "change" },
|
|
204
|
+
keepWidthWithReference: { type: Boolean, default: !0 },
|
|
205
|
+
placement: { type: String, default: "bottom-left" },
|
|
206
|
+
/**
|
|
207
|
+
* 根据空间大小重新调整,原下拉面板内容指定的高度
|
|
208
|
+
*/
|
|
209
|
+
limitContentBySpace: { type: Boolean, default: !1 },
|
|
210
|
+
/**
|
|
211
|
+
* 关闭前
|
|
212
|
+
*/
|
|
213
|
+
beforeClose: { type: Function, default: null },
|
|
214
|
+
beforeClosePopup: { type: Function, default: null }
|
|
215
|
+
}, To = {
|
|
216
|
+
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
|
|
217
|
+
host: { type: Object },
|
|
218
|
+
backgroundColor: { type: String, default: "" }
|
|
219
|
+
}, Bo = /* @__PURE__ */ Ge({
|
|
220
|
+
name: "FOverlay",
|
|
221
|
+
props: To,
|
|
222
|
+
emits: ["click"],
|
|
223
|
+
setup(e, t) {
|
|
224
|
+
const n = h(e.popupContentPosition), o = h(e.host), r = D(() => ({
|
|
225
|
+
backgroundColor: e.backgroundColor || "",
|
|
226
|
+
pointerEvents: "auto"
|
|
227
|
+
}));
|
|
228
|
+
function i(u) {
|
|
229
|
+
t.emit("click"), u.preventDefault(), u.stopPropagation();
|
|
230
|
+
}
|
|
231
|
+
D(() => {
|
|
232
|
+
const u = o.value;
|
|
233
|
+
if (u) {
|
|
234
|
+
const c = u.getBoundingClientRect(), {
|
|
235
|
+
left: l,
|
|
236
|
+
top: m,
|
|
237
|
+
height: d
|
|
238
|
+
} = c;
|
|
239
|
+
return {
|
|
240
|
+
left: l,
|
|
241
|
+
top: m + d
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
return n.value;
|
|
245
|
+
});
|
|
246
|
+
const a = D(() => ({
|
|
247
|
+
// position: 'relative',
|
|
248
|
+
// left: `${position.value.left}px`,
|
|
249
|
+
// top: `${position.value.top}px`
|
|
250
|
+
}));
|
|
251
|
+
return () => w(Xt, {
|
|
252
|
+
to: "body"
|
|
253
|
+
}, {
|
|
254
|
+
default: () => {
|
|
255
|
+
var u, c;
|
|
256
|
+
return [w("div", {
|
|
257
|
+
class: "overlay-container",
|
|
258
|
+
onClick: (l) => i(l),
|
|
259
|
+
style: r.value
|
|
260
|
+
}, [w("div", {
|
|
261
|
+
style: a.value
|
|
262
|
+
}, [(c = (u = t.slots).default) == null ? void 0 : c.call(u)])])];
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
function ko(e) {
|
|
268
|
+
if (e.content && e.content.render)
|
|
269
|
+
return e.content.render;
|
|
270
|
+
if (e.render && typeof e.render == "function")
|
|
271
|
+
return e.render;
|
|
272
|
+
}
|
|
273
|
+
function Fo(e) {
|
|
274
|
+
const t = document.createElement("div");
|
|
275
|
+
t.style.display = "contents";
|
|
276
|
+
let n;
|
|
277
|
+
const o = e.onClickCallback || (() => {
|
|
278
|
+
}), r = () => {
|
|
279
|
+
o(), n && n.unmount();
|
|
280
|
+
};
|
|
281
|
+
return n = Pt({
|
|
282
|
+
setup() {
|
|
283
|
+
lt(() => {
|
|
284
|
+
document.body.removeChild(t);
|
|
285
|
+
});
|
|
286
|
+
const i = ko(e);
|
|
287
|
+
return () => w(Bo, {
|
|
288
|
+
"popup-content-position": e.popupPosition,
|
|
289
|
+
host: e.host,
|
|
290
|
+
onClick: r,
|
|
291
|
+
backgroundColor: e.backgroundColor
|
|
292
|
+
}, {
|
|
293
|
+
default: () => [i && i()]
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}), document.body.appendChild(t), n.mount(t), n;
|
|
297
|
+
}
|
|
298
|
+
class Io {
|
|
299
|
+
static show(t) {
|
|
300
|
+
return Fo(t);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
const Eo = "https://json-schema.org/draft/2020-12/schema", Oo = "https://farris-design.gitee.io/modal.schema.json", Mo = "modal", Ro = "弹窗组件", jo = "object", No = {
|
|
304
|
+
id: {
|
|
305
|
+
description: "组件唯一标识",
|
|
306
|
+
type: "string"
|
|
307
|
+
},
|
|
308
|
+
type: {
|
|
309
|
+
description: "组件类型",
|
|
310
|
+
type: "string",
|
|
311
|
+
default: "modal"
|
|
312
|
+
},
|
|
313
|
+
appearance: {
|
|
314
|
+
description: "组件外观",
|
|
315
|
+
type: "object",
|
|
316
|
+
properties: {
|
|
317
|
+
class: {
|
|
318
|
+
type: "string"
|
|
319
|
+
},
|
|
320
|
+
style: {
|
|
321
|
+
type: "string"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
default: {}
|
|
325
|
+
},
|
|
326
|
+
name: {
|
|
327
|
+
description: "名称",
|
|
328
|
+
type: "string",
|
|
329
|
+
default: null
|
|
330
|
+
},
|
|
331
|
+
title: {
|
|
332
|
+
description: "标题",
|
|
333
|
+
type: "string"
|
|
334
|
+
},
|
|
335
|
+
width: {
|
|
336
|
+
description: "窗口宽度",
|
|
337
|
+
type: "number",
|
|
338
|
+
default: 900
|
|
339
|
+
},
|
|
340
|
+
height: {
|
|
341
|
+
description: "窗口高度",
|
|
342
|
+
type: "number",
|
|
343
|
+
default: 600
|
|
344
|
+
},
|
|
345
|
+
contents: {
|
|
346
|
+
description: "弹窗子组件集合",
|
|
347
|
+
type: "array",
|
|
348
|
+
default: []
|
|
349
|
+
},
|
|
350
|
+
modelValue: {
|
|
351
|
+
description: "是否显示",
|
|
352
|
+
type: "boolean",
|
|
353
|
+
default: !1
|
|
354
|
+
},
|
|
355
|
+
showCloseButton: {
|
|
356
|
+
description: "显示关闭按钮",
|
|
357
|
+
type: "boolean",
|
|
358
|
+
default: !0
|
|
359
|
+
},
|
|
360
|
+
showMaxButton: {
|
|
361
|
+
description: "显示最大化按钮",
|
|
362
|
+
type: "boolean",
|
|
363
|
+
default: !0
|
|
364
|
+
},
|
|
365
|
+
enableEsc: {
|
|
366
|
+
description: "允许ESC关闭",
|
|
367
|
+
type: "boolean",
|
|
368
|
+
default: !0
|
|
369
|
+
},
|
|
370
|
+
resizeable: {
|
|
371
|
+
description: "允许调整窗口尺寸",
|
|
372
|
+
type: "boolean",
|
|
373
|
+
default: !0
|
|
374
|
+
},
|
|
375
|
+
fitContent: {
|
|
376
|
+
description: "是否自适应",
|
|
377
|
+
type: "boolean",
|
|
378
|
+
default: !1
|
|
379
|
+
},
|
|
380
|
+
showButtons: {
|
|
381
|
+
description: "是否显示底部按钮",
|
|
382
|
+
type: "boolean",
|
|
383
|
+
default: !0
|
|
384
|
+
},
|
|
385
|
+
mask: {
|
|
386
|
+
description: "是否模态",
|
|
387
|
+
type: "boolean",
|
|
388
|
+
default: !0
|
|
389
|
+
},
|
|
390
|
+
draggable: {
|
|
391
|
+
description: "是否允许拖拽调整位置",
|
|
392
|
+
type: "boolean",
|
|
393
|
+
default: !0
|
|
394
|
+
},
|
|
395
|
+
onAccept: {
|
|
396
|
+
description: "确定事件",
|
|
397
|
+
type: "object",
|
|
398
|
+
default: null
|
|
399
|
+
},
|
|
400
|
+
onCancel: {
|
|
401
|
+
description: "取消事件",
|
|
402
|
+
type: "object",
|
|
403
|
+
default: null
|
|
404
|
+
},
|
|
405
|
+
beforeClose: {
|
|
406
|
+
description: "关闭前事件",
|
|
407
|
+
type: "object",
|
|
408
|
+
default: null
|
|
409
|
+
}
|
|
410
|
+
}, Po = [
|
|
411
|
+
"id",
|
|
412
|
+
"type"
|
|
413
|
+
], Do = {
|
|
414
|
+
onAccept: "确定事件",
|
|
415
|
+
onCancel: "取消事件",
|
|
416
|
+
beforeClose: "关闭前回调"
|
|
417
|
+
}, $o = {
|
|
418
|
+
$schema: Eo,
|
|
419
|
+
$id: Oo,
|
|
420
|
+
title: Mo,
|
|
421
|
+
description: Ro,
|
|
422
|
+
type: jo,
|
|
423
|
+
properties: No,
|
|
424
|
+
required: Po,
|
|
425
|
+
events: Do
|
|
426
|
+
}, Ho = /* @__PURE__ */ new Map([
|
|
427
|
+
["appearance", Ut]
|
|
428
|
+
]);
|
|
429
|
+
function Lo(e, t, n) {
|
|
430
|
+
return t;
|
|
431
|
+
}
|
|
432
|
+
function zo() {
|
|
433
|
+
function e(t, n) {
|
|
434
|
+
const o = {};
|
|
435
|
+
return o.beforeClose = (r) => n.call("beforeClose", [r, t]), o;
|
|
436
|
+
}
|
|
437
|
+
return {
|
|
438
|
+
resolve: e
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
const Qt = {
|
|
442
|
+
/**
|
|
443
|
+
* 允许点击遮罩关闭对话框
|
|
444
|
+
*/
|
|
445
|
+
allowClickMaskToClose: { type: Boolean, default: !1 },
|
|
446
|
+
/**
|
|
447
|
+
* 关闭对话框前事件, 是个函数,返回true或者false
|
|
448
|
+
*/
|
|
449
|
+
beforeClose: { type: Function, default: () => !0 },
|
|
450
|
+
/**
|
|
451
|
+
* 自定义类
|
|
452
|
+
*/
|
|
453
|
+
class: { type: String, default: "" },
|
|
454
|
+
/**
|
|
455
|
+
* 自定义遮罩类
|
|
456
|
+
*/
|
|
457
|
+
maskClass: { type: String, default: "" },
|
|
458
|
+
/**
|
|
459
|
+
* 模态框标题
|
|
460
|
+
*/
|
|
461
|
+
title: { type: String, default: "" },
|
|
462
|
+
/**
|
|
463
|
+
* 模态框宽度
|
|
464
|
+
*/
|
|
465
|
+
width: { type: Number, default: 500 },
|
|
466
|
+
/**
|
|
467
|
+
* 模态框高度
|
|
468
|
+
*/
|
|
469
|
+
height: { type: Number, default: 320 },
|
|
470
|
+
/**
|
|
471
|
+
* 自定义按钮列表
|
|
472
|
+
*/
|
|
473
|
+
buttons: {
|
|
474
|
+
type: Array,
|
|
475
|
+
default: []
|
|
476
|
+
},
|
|
477
|
+
/**
|
|
478
|
+
* 是否展示模态框
|
|
479
|
+
*/
|
|
480
|
+
modelValue: { type: Boolean, default: !1 },
|
|
481
|
+
/**
|
|
482
|
+
* 是否模态
|
|
483
|
+
*/
|
|
484
|
+
mask: { type: Boolean, default: !0 },
|
|
485
|
+
/**
|
|
486
|
+
* 是否展示头部
|
|
487
|
+
*/
|
|
488
|
+
showHeader: { type: Boolean, default: !0 },
|
|
489
|
+
/**
|
|
490
|
+
* 是否展示默认按钮
|
|
491
|
+
*/
|
|
492
|
+
showButtons: { type: Boolean, default: !0 },
|
|
493
|
+
/**
|
|
494
|
+
* 是否启用自适应样式
|
|
495
|
+
*/
|
|
496
|
+
fitContent: { type: Boolean, default: !0 },
|
|
497
|
+
/**
|
|
498
|
+
* 是否展示右上角按钮
|
|
499
|
+
*/
|
|
500
|
+
showCloseButton: { type: Boolean, default: !0 },
|
|
501
|
+
showMaxButton: { type: Boolean, default: !1 },
|
|
502
|
+
minHeight: { type: Number },
|
|
503
|
+
maxHeight: { type: Number },
|
|
504
|
+
minWidth: { type: Number },
|
|
505
|
+
maxWidth: { type: Number },
|
|
506
|
+
containment: { type: Object, default: null },
|
|
507
|
+
resizeable: { type: Boolean, default: !1 },
|
|
508
|
+
draggable: { type: Boolean, default: !1 },
|
|
509
|
+
dragHandle: { type: Object, default: null },
|
|
510
|
+
closedCallback: { type: Function, default: null },
|
|
511
|
+
resizeHandle: { type: Function, default: null },
|
|
512
|
+
render: { type: Function, default: null },
|
|
513
|
+
acceptCallback: { type: Function, default: null },
|
|
514
|
+
rejectCallback: { type: Function, default: null },
|
|
515
|
+
enableEsc: { type: Boolean, default: !0 },
|
|
516
|
+
enableEnter: { type: Boolean, default: !1 },
|
|
517
|
+
dialogType: { type: String, default: "" },
|
|
518
|
+
src: { type: String, default: "" },
|
|
519
|
+
footerHeight: { type: Number, default: 60 },
|
|
520
|
+
host: { type: Object, default: "body" }
|
|
521
|
+
}, Ao = Nt(Qt, $o, Ho, Lo), Vo = zo();
|
|
522
|
+
class re {
|
|
523
|
+
constructor(t, n) {
|
|
524
|
+
this.x = t, this.y = n;
|
|
525
|
+
}
|
|
526
|
+
static getTransformInfo(t) {
|
|
527
|
+
const o = window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g, "").split(",");
|
|
528
|
+
if (o.length >= 6) {
|
|
529
|
+
const r = parseInt(o[4], 10), i = parseInt(o[5], 10);
|
|
530
|
+
return { x: r, y: i };
|
|
531
|
+
}
|
|
532
|
+
return { x: 0, y: 0 };
|
|
533
|
+
}
|
|
534
|
+
static fromEvent(t, n = null) {
|
|
535
|
+
if (this.isMouseEvent(t))
|
|
536
|
+
return new re(t.clientX, t.clientY);
|
|
537
|
+
if (n === null || t.changedTouches.length === 1)
|
|
538
|
+
return new re(t.changedTouches[0].clientX, t.changedTouches[0].clientY);
|
|
539
|
+
for (let o = 0; o < t.changedTouches.length; o++)
|
|
540
|
+
if (t.changedTouches[o].target === n)
|
|
541
|
+
return new re(t.changedTouches[o].clientX, t.changedTouches[o].clientY);
|
|
542
|
+
}
|
|
543
|
+
static isMouseEvent(t) {
|
|
544
|
+
return Object.prototype.toString.apply(t).indexOf("MouseEvent") === 8;
|
|
545
|
+
}
|
|
546
|
+
static isIPosition(t) {
|
|
547
|
+
return !!t && "x" in t && "y" in t;
|
|
548
|
+
}
|
|
549
|
+
static getCurrent(t) {
|
|
550
|
+
const n = new re(0, 0);
|
|
551
|
+
if (window) {
|
|
552
|
+
const o = window.getComputedStyle(t);
|
|
553
|
+
if (o) {
|
|
554
|
+
const r = parseInt(o.getPropertyValue("left"), 10), i = parseInt(o.getPropertyValue("top"), 10);
|
|
555
|
+
n.x = isNaN(r) ? 0 : r, n.y = isNaN(i) ? 0 : i;
|
|
556
|
+
}
|
|
557
|
+
return n;
|
|
558
|
+
}
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
static copy(t) {
|
|
562
|
+
return new re(0, 0).set(t);
|
|
563
|
+
}
|
|
564
|
+
get value() {
|
|
565
|
+
return { x: this.x, y: this.y };
|
|
566
|
+
}
|
|
567
|
+
add(t) {
|
|
568
|
+
return this.x += t.x, this.y += t.y, this;
|
|
569
|
+
}
|
|
570
|
+
subtract(t) {
|
|
571
|
+
return this.x -= t.x, this.y -= t.y, this;
|
|
572
|
+
}
|
|
573
|
+
multiply(t) {
|
|
574
|
+
this.x *= t, this.y *= t;
|
|
575
|
+
}
|
|
576
|
+
divide(t) {
|
|
577
|
+
this.x /= t, this.y /= t;
|
|
578
|
+
}
|
|
579
|
+
reset() {
|
|
580
|
+
return this.x = 0, this.y = 0, this;
|
|
581
|
+
}
|
|
582
|
+
set(t) {
|
|
583
|
+
return this.x = t.x, this.y = t.y, this;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
class qe {
|
|
587
|
+
constructor(t, n) {
|
|
588
|
+
this.width = t, this.height = n;
|
|
589
|
+
}
|
|
590
|
+
static getCurrent(t) {
|
|
591
|
+
const n = new qe(0, 0);
|
|
592
|
+
if (window) {
|
|
593
|
+
const o = window.getComputedStyle(t);
|
|
594
|
+
return o && (n.width = parseInt(o.getPropertyValue("width"), 10), n.height = parseInt(o.getPropertyValue("height"), 10)), n;
|
|
595
|
+
}
|
|
596
|
+
return null;
|
|
597
|
+
}
|
|
598
|
+
static copy(t) {
|
|
599
|
+
return new qe(0, 0).set(t);
|
|
600
|
+
}
|
|
601
|
+
set(t) {
|
|
602
|
+
return this.width = t.width, this.height = t.height, this;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function _o(e, t) {
|
|
606
|
+
const n = h(), o = h(), r = h(), i = h(), a = h(), u = h(), c = h(), l = h(), m = h(), d = h(), p = h(), s = h(e.resizeable), f = h(), v = h(e.draggable), x = h(!1);
|
|
607
|
+
function k() {
|
|
608
|
+
const R = o.value || document.body, O = window.getComputedStyle(R);
|
|
609
|
+
if (!O || !n.value)
|
|
610
|
+
return;
|
|
611
|
+
const U = re.getTransformInfo(n.value), $ = {};
|
|
612
|
+
c.value && ($.deltaL = n.value.offsetLeft - c.value.x, $.deltaT = n.value.offsetTop - c.value.y);
|
|
613
|
+
const K = O.getPropertyValue("position");
|
|
614
|
+
$.width = R.clientWidth, $.height = R.clientHeight, $.pr = parseInt(O.getPropertyValue("padding-right"), 10), $.pb = parseInt(O.getPropertyValue("padding-bottom"), 10), $.position = O.getPropertyValue("position"), K === "static" && (R.style.position = "relative"), $.translateX = U.x, $.translateY = U.y, d.value = $;
|
|
615
|
+
}
|
|
616
|
+
function E(R) {
|
|
617
|
+
if (n.value) {
|
|
618
|
+
i.value = qe.getCurrent(n.value), a.value = re.getCurrent(n.value), u.value = i.value ? qe.copy(i.value) : null, c.value = a.value ? re.copy(a.value) : null, k();
|
|
619
|
+
const O = R.target.getAttribute("type") || "";
|
|
620
|
+
l.value = {
|
|
621
|
+
n: !!O.match(/n/),
|
|
622
|
+
s: !!O.match(/s/),
|
|
623
|
+
w: !!O.match(/w/),
|
|
624
|
+
e: !!O.match(/e/)
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
function z() {
|
|
629
|
+
var R, O, U, $;
|
|
630
|
+
if (n.value) {
|
|
631
|
+
const K = n.value;
|
|
632
|
+
l.value && ((l.value.n || l.value.s) && ((R = u.value) != null && R.height) && (K.style.height = u.value.height + "px"), (l.value.w || l.value.e) && ((O = u.value) != null && O.width) && (K.style.width = u.value.width + "px"), c.value && ((U = c.value) != null && U.x && (K.style.left = c.value.x + "px"), ($ = c.value) != null && $.y && (K.style.top = c.value.y + "px")));
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
function N() {
|
|
636
|
+
const R = e.minHeight ? e.minHeight : 1, O = e.minWidth ? e.minWidth : 1;
|
|
637
|
+
u.value && c.value && l.value && i.value && (u.value.height < R && (u.value.height = R, l.value.n && a.value && (c.value.y = a.value.y + (i.value.height - R))), u.value.width < O && (u.value.width = O, l.value.w && a.value && (c.value.x = a.value.x + (i.value.width - O))), e.maxHeight && u.value.height > e.maxHeight && (u.value.height = e.maxHeight, a.value && l.value.n && (c.value.y = a.value.y + (i.value.height - e.maxHeight))), e.maxWidth && u.value.width > e.maxWidth && (u.value.width = e.maxWidth, l.value.w && a.value && (c.value.x = a.value.x + (i.value.width - e.maxWidth))));
|
|
638
|
+
}
|
|
639
|
+
function C() {
|
|
640
|
+
if (o.value) {
|
|
641
|
+
const R = d.value;
|
|
642
|
+
if (c.value && u.value && l.value && i.value) {
|
|
643
|
+
const O = R.width - R.pr - R.deltaL - R.translateX - c.value.x, U = R.height - R.pb - R.deltaT - R.translateY - c.value.y;
|
|
644
|
+
l.value.n && c.value.y + R.translateY < 0 && a.value && (c.value.y = -R.translateY, u.value.height = i.value.height + a.value.y + R.translateY), l.value.w && c.value.x + R.translateX < 0 && a.value && (c.value.x = -R.translateX, u.value.width = i.value.width + a.value.x + R.translateX), u.value.width > O && (u.value.width = O), u.value.height > U && (u.value.height = U);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
function y(R) {
|
|
649
|
+
if (!r.value || !i.value || !a.value || !l.value)
|
|
650
|
+
return;
|
|
651
|
+
R.subtract(r.value);
|
|
652
|
+
const O = R.x, U = R.y;
|
|
653
|
+
l.value.n ? (c.value.y = a.value.y + U, u.value.height = i.value.height - U) : l.value.s && (u.value.height = i.value.height + U), l.value.e ? u.value.width = i.value.width + O : l.value.w && (u.value.width = i.value.width - O, c.value.x = a.value.x + O), C(), N(), z();
|
|
654
|
+
}
|
|
655
|
+
function S(R) {
|
|
656
|
+
if (!m.value)
|
|
657
|
+
return;
|
|
658
|
+
const O = re.fromEvent(R);
|
|
659
|
+
O && y(O);
|
|
660
|
+
}
|
|
661
|
+
function T() {
|
|
662
|
+
if (n.value) {
|
|
663
|
+
const {
|
|
664
|
+
width: R,
|
|
665
|
+
height: O,
|
|
666
|
+
x: U,
|
|
667
|
+
y: $
|
|
668
|
+
} = n.value.getBoundingClientRect(), K = re.getTransformInfo(n.value);
|
|
669
|
+
return {
|
|
670
|
+
size: {
|
|
671
|
+
width: R,
|
|
672
|
+
height: O
|
|
673
|
+
},
|
|
674
|
+
position: {
|
|
675
|
+
x: U - K.x,
|
|
676
|
+
y: $ - K.y
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
return null;
|
|
681
|
+
}
|
|
682
|
+
function F(R) {
|
|
683
|
+
if (n.value) {
|
|
684
|
+
const O = T();
|
|
685
|
+
p.value = O;
|
|
686
|
+
}
|
|
687
|
+
r.value = void 0, i.value = null, a.value = null, u.value = null, c.value = null, l.value = null, m.value = null, document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", F);
|
|
688
|
+
}
|
|
689
|
+
function _() {
|
|
690
|
+
document.addEventListener("mousemove", S), document.addEventListener("mouseup", F);
|
|
691
|
+
}
|
|
692
|
+
function b(R) {
|
|
693
|
+
R instanceof MouseEvent && R.button === 2 || v.value && (document.body.click(), R.stopPropagation(), R.preventDefault(), r.value = re.fromEvent(R), m.value = R.target, E(R), _());
|
|
694
|
+
}
|
|
695
|
+
function q(R) {
|
|
696
|
+
return n.value = R, s.value && w(at, null, [w("div", {
|
|
697
|
+
class: "fv-resizable-handle fv-resizable-n",
|
|
698
|
+
type: "n",
|
|
699
|
+
onMousedown: (O) => b(O)
|
|
700
|
+
}, null), w("div", {
|
|
701
|
+
class: "fv-resizable-handle fv-resizable-e",
|
|
702
|
+
type: "e",
|
|
703
|
+
onMousedown: (O) => b(O)
|
|
704
|
+
}, null), w("div", {
|
|
705
|
+
class: "fv-resizable-handle fv-resizable-s",
|
|
706
|
+
type: "s",
|
|
707
|
+
onMousedown: (O) => b(O)
|
|
708
|
+
}, null), w("div", {
|
|
709
|
+
class: "fv-resizable-handle fv-resizable-w",
|
|
710
|
+
type: "w",
|
|
711
|
+
onMousedown: (O) => b(O)
|
|
712
|
+
}, null), w("div", {
|
|
713
|
+
class: "fv-resizable-handle fv-resizable-ne",
|
|
714
|
+
type: "ne",
|
|
715
|
+
onMousedown: (O) => b(O)
|
|
716
|
+
}, null), w("div", {
|
|
717
|
+
class: "fv-resizable-handle fv-resizable-se fv-resizable-diagonal",
|
|
718
|
+
type: "se",
|
|
719
|
+
onMousedown: (O) => b(O)
|
|
720
|
+
}, null), w("div", {
|
|
721
|
+
class: "fv-resizable-handle fv-resizable-sw",
|
|
722
|
+
type: "sw",
|
|
723
|
+
onMousedown: (O) => b(O)
|
|
724
|
+
}, null), w("div", {
|
|
725
|
+
class: "fv-resizable-handle fv-resizable-nw",
|
|
726
|
+
type: "nw",
|
|
727
|
+
onMousedown: (O) => b(O)
|
|
728
|
+
}, null)]);
|
|
729
|
+
}
|
|
730
|
+
function V(R = !0) {
|
|
731
|
+
document.body.click();
|
|
732
|
+
const O = o.value || document.body, U = qe.getCurrent(O), $ = n.value;
|
|
733
|
+
R && $ && (f.value = T(), f.value.transform = $.style.transform), U && $ && (u.value = U, u.value.height -= 14, u.value.width -= 14, $.style.height = u.value.height + "px", $.style.width = u.value.width + "px", $.style.left = "7px", $.style.top = "7px", $.style.transform = "", p.value = {
|
|
734
|
+
size: u.value,
|
|
735
|
+
position: {
|
|
736
|
+
x: 0,
|
|
737
|
+
y: 0
|
|
738
|
+
}
|
|
739
|
+
}, v.value = !1, x.value = !0);
|
|
740
|
+
}
|
|
741
|
+
function H() {
|
|
742
|
+
var R, O;
|
|
743
|
+
if (document.body.click(), f.value) {
|
|
744
|
+
const U = {
|
|
745
|
+
width: f.value.size.width || 0,
|
|
746
|
+
height: f.value.size.height || 0
|
|
747
|
+
}, $ = {
|
|
748
|
+
x: (window.innerWidth - U.width) / 2,
|
|
749
|
+
y: (window.innerHeight - U.height) / 2
|
|
750
|
+
};
|
|
751
|
+
(R = u.value) == null || R.set(U), (O = c.value) == null || O.set($);
|
|
752
|
+
const K = n.value;
|
|
753
|
+
K.style.height = U.height + "px", K.style.width = U.width + "px", K.style.left = `${$.x}px`, K.style.top = `${$.y}px`, K.style.transform = "", p.value = {
|
|
754
|
+
size: U,
|
|
755
|
+
position: $
|
|
756
|
+
}, v.value = e.draggable, x.value = !1;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
function W() {
|
|
760
|
+
if (n.value) {
|
|
761
|
+
const R = qe.getCurrent(n.value);
|
|
762
|
+
if (R) {
|
|
763
|
+
const {
|
|
764
|
+
width: O,
|
|
765
|
+
height: U
|
|
766
|
+
} = R;
|
|
767
|
+
n.value.style.left = `${(window.innerWidth - O) / 2}px`, n.value.style.top = `${(window.innerHeight - U) / 2}px`, n.value.style.transform = "";
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
function J() {
|
|
772
|
+
const R = () => {
|
|
773
|
+
x.value ? V(!1) : W(), document.body.click();
|
|
774
|
+
};
|
|
775
|
+
return window.addEventListener("resize", R), () => {
|
|
776
|
+
window.removeEventListener("resize", R);
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
const oe = J();
|
|
780
|
+
return {
|
|
781
|
+
renderResizeBar: q,
|
|
782
|
+
boundingElement: o,
|
|
783
|
+
resizedEventParam: p,
|
|
784
|
+
maximize: V,
|
|
785
|
+
restore: H,
|
|
786
|
+
allowDrag: v,
|
|
787
|
+
isMaximized: x,
|
|
788
|
+
unWindowResizeHandle: oe,
|
|
789
|
+
moveToCenter: W
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function qo(e, t, n) {
|
|
793
|
+
const o = h(), r = h(e.draggable), i = h(e.lockAxis), a = h(), u = h(), c = h(!1), l = h(new re(0, 0)), m = h(new re(0, 0)), d = h(new re(0, 0)), p = h(new re(0, 0));
|
|
794
|
+
xe(() => n.value, (S) => {
|
|
795
|
+
a.value.style.cursor = S ? "move" : "default";
|
|
796
|
+
});
|
|
797
|
+
function s(S, T) {
|
|
798
|
+
if (T.tagName === "BUTTON")
|
|
799
|
+
return !1;
|
|
800
|
+
if (T === S)
|
|
801
|
+
return !0;
|
|
802
|
+
for (const F in T.children)
|
|
803
|
+
if (Object.prototype.hasOwnProperty.call(T.children, F) && s(S, T.children[F]))
|
|
804
|
+
return !0;
|
|
805
|
+
return !1;
|
|
806
|
+
}
|
|
807
|
+
function f() {
|
|
808
|
+
var _, b;
|
|
809
|
+
let S = d.value.x + m.value.x, T = d.value.y + m.value.y;
|
|
810
|
+
i.value === "x" ? (S = ((_ = l.value) == null ? void 0 : _.x) || 0, d.value.x = 0) : i.value === "y" && (T = ((b = l.value) == null ? void 0 : b.y) || 0, d.value.y = 0);
|
|
811
|
+
const F = `translate3d(${Math.round(S)}px, ${Math.round(T)}px, 0px)`;
|
|
812
|
+
o.value && (o.value.style.transform = F), p.value.x = S, p.value.y = T;
|
|
813
|
+
}
|
|
814
|
+
function v() {
|
|
815
|
+
if (!u.value || !o.value)
|
|
816
|
+
return null;
|
|
817
|
+
const S = u.value.getBoundingClientRect(), T = o.value.getBoundingClientRect(), F = {
|
|
818
|
+
top: S.top < T.top,
|
|
819
|
+
right: S.right > T.right,
|
|
820
|
+
bottom: S.bottom > T.bottom,
|
|
821
|
+
left: S.left < T.left
|
|
822
|
+
};
|
|
823
|
+
return F.top || (d.value.y -= T.top - S.top), F.bottom || (d.value.y -= T.bottom - S.bottom), F.right || (d.value.x -= T.right - S.right), F.left || (d.value.x -= T.left - S.left), f(), F;
|
|
824
|
+
}
|
|
825
|
+
function x(S) {
|
|
826
|
+
S && (l.value && S.subtract(l.value), d.value.set(S), f(), v());
|
|
827
|
+
}
|
|
828
|
+
function k(S) {
|
|
829
|
+
c.value && r.value && (S.stopPropagation(), S.preventDefault(), x(re.fromEvent(S, a.value)));
|
|
830
|
+
}
|
|
831
|
+
function E() {
|
|
832
|
+
var S;
|
|
833
|
+
c.value && (c.value = !1, m.value.add(d.value), d.value.reset(), (S = o.value) == null || S.classList.remove("ng-dragging"), t.emit("stopMove"), document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", E));
|
|
834
|
+
}
|
|
835
|
+
function z() {
|
|
836
|
+
!c.value && a.value && (c.value = !0, a.value.classList.add("ng-dragging"), document.addEventListener("mousemove", k), document.addEventListener("mouseup", E));
|
|
837
|
+
}
|
|
838
|
+
function N() {
|
|
839
|
+
if (o.value) {
|
|
840
|
+
const S = re.getTransformInfo(o.value);
|
|
841
|
+
m.value.set(S);
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
m.value.reset();
|
|
845
|
+
}
|
|
846
|
+
function C(S) {
|
|
847
|
+
if (!n.value || S instanceof MouseEvent && S.button === 2)
|
|
848
|
+
return;
|
|
849
|
+
const T = S.target || S.srcElement;
|
|
850
|
+
a.value !== void 0 && T && !s(T, a.value) || r.value !== !1 && (document.body.click(), S.stopPropagation(), S.preventDefault(), l.value = re.fromEvent(S, o.value), N(), z());
|
|
851
|
+
}
|
|
852
|
+
function y(S, T, F) {
|
|
853
|
+
if (r.value && T) {
|
|
854
|
+
if (S)
|
|
855
|
+
a.value = S;
|
|
856
|
+
else if (e.dragHandle) {
|
|
857
|
+
if (e.dragHandle instanceof HTMLElement)
|
|
858
|
+
a.value = e.dragHandle;
|
|
859
|
+
else if (typeof e.dragHandle == "string") {
|
|
860
|
+
const _ = T.querySelector(e.dragHandle);
|
|
861
|
+
_ && (a.value = _);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
o.value = T, u.value = F, a.value ? (a.value.classList.add("ng-draggable"), a.value.addEventListener("mousedown", C)) : r.value = !1;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
return {
|
|
868
|
+
registerDraggle: y,
|
|
869
|
+
resetTranslate: N
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
function Zt(e, t) {
|
|
873
|
+
if (e) {
|
|
874
|
+
const n = (o) => {
|
|
875
|
+
o.key.toLowerCase() === e.toLowerCase() && t({ event: o, key: e });
|
|
876
|
+
};
|
|
877
|
+
return document.addEventListener("keydown", n), () => {
|
|
878
|
+
document.removeEventListener("keydown", n);
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
function Wo(e, t) {
|
|
883
|
+
const n = h(e.enableEsc);
|
|
884
|
+
let o = null;
|
|
885
|
+
return n.value ? (o = Zt("Escape", (r) => {
|
|
886
|
+
t.emit("esc", { event: r.event, type: "esc" });
|
|
887
|
+
}), {
|
|
888
|
+
remove: o
|
|
889
|
+
}) : null;
|
|
890
|
+
}
|
|
891
|
+
function Go(e, t) {
|
|
892
|
+
const n = h(e.enableEnter);
|
|
893
|
+
let o = null;
|
|
894
|
+
return n.value ? (o = Zt("Enter", (r) => {
|
|
895
|
+
t.emit("enter", { event: r.event, type: "enter" });
|
|
896
|
+
}), {
|
|
897
|
+
remove: o
|
|
898
|
+
}) : null;
|
|
899
|
+
}
|
|
900
|
+
const We = /* @__PURE__ */ Ge({
|
|
901
|
+
name: "FModal",
|
|
902
|
+
props: Qt,
|
|
903
|
+
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc", "enter", "stopMove"],
|
|
904
|
+
setup(e, t) {
|
|
905
|
+
const n = h(e.width || 300), o = h(e.height || 200), r = h(e.modelValue), i = h(""), a = h(e.class), u = h(e.fitContent), c = h(e.showHeader), l = h(""), m = h(e.showCloseButton), d = h(e.showMaxButton), p = h(!1), s = h(e.dialogType), f = h(e.src), v = h(""), x = h(e.showButtons), k = h(e.title), E = h(e.containment || null), z = h(), {
|
|
906
|
+
t: N
|
|
907
|
+
} = Dt();
|
|
908
|
+
k.value === "错误提示" && (k.value = N("messageBox.errorTitle"));
|
|
909
|
+
const C = h(!1);
|
|
910
|
+
function y(B, Y) {
|
|
911
|
+
const ae = Y ? "accept" : "cancel";
|
|
912
|
+
Promise.resolve().then(() => {
|
|
913
|
+
var se;
|
|
914
|
+
return (se = e.beforeClose) == null ? void 0 : se.call(e, {
|
|
915
|
+
closeType: ae
|
|
916
|
+
});
|
|
917
|
+
}).then((se) => {
|
|
918
|
+
se && (r.value = !1, t.emit("update:modelValue", !1), Y != null && t.emit(Y ? "accept" : "cancel"), t.emit("closed", B));
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
const S = [{
|
|
922
|
+
name: "cancel",
|
|
923
|
+
text: N("messageBox.cancel") || "取消",
|
|
924
|
+
class: "btn btn-secondary",
|
|
925
|
+
handle: (B) => {
|
|
926
|
+
y(B, !1);
|
|
927
|
+
}
|
|
928
|
+
}, {
|
|
929
|
+
name: "accept",
|
|
930
|
+
text: N("messageBox.ok") || "确定",
|
|
931
|
+
class: "btn btn-primary",
|
|
932
|
+
handle: (B) => {
|
|
933
|
+
y(B, !0);
|
|
934
|
+
}
|
|
935
|
+
}], T = h(e.buttons && e.buttons.length ? e.buttons : S), F = D(() => !!l.value), _ = D(() => !!x.value && !!T.value), b = h(), q = h(), V = h(!1), {
|
|
936
|
+
renderResizeBar: H,
|
|
937
|
+
maximize: W,
|
|
938
|
+
restore: J,
|
|
939
|
+
boundingElement: oe,
|
|
940
|
+
resizedEventParam: R,
|
|
941
|
+
allowDrag: O,
|
|
942
|
+
unWindowResizeHandle: U,
|
|
943
|
+
moveToCenter: $
|
|
944
|
+
} = _o(e), {
|
|
945
|
+
registerDraggle: K
|
|
946
|
+
} = qo(e, t, O);
|
|
947
|
+
function me() {
|
|
948
|
+
return !!document.querySelectorAll(".farris-modal").length && document.body.classList.contains("modal-open");
|
|
949
|
+
}
|
|
950
|
+
function ve() {
|
|
951
|
+
const B = document.querySelectorAll(".farris-modal").length;
|
|
952
|
+
(!B || B - 1 <= 0) && document.body.classList.remove("modal-open"), z.value && z.value.classList.remove("show");
|
|
953
|
+
}
|
|
954
|
+
xe(() => e.title, (B, Y) => {
|
|
955
|
+
B !== Y && (k.value = B);
|
|
956
|
+
}), xe(() => e.modelValue, (B, Y) => {
|
|
957
|
+
B !== Y && (r.value = B, r.value && e.draggable && Ke(() => {
|
|
958
|
+
q.value && !E.value && (E.value = q.value.parentElement, oe.value = E.value, K(b.value, q.value, oe.value), $());
|
|
959
|
+
}), B || (E.value && (E.value = null), ve())), r.value ? C.value = me() : (V.value = !1, O.value = e.draggable);
|
|
960
|
+
}), xe(() => e.showHeader, (B, Y) => {
|
|
961
|
+
B !== Y && (c.value = B);
|
|
962
|
+
}), xe(() => e.showButtons, (B, Y) => {
|
|
963
|
+
B !== Y && (x.value = B);
|
|
964
|
+
}), xe(() => R.value, (B, Y) => {
|
|
965
|
+
const ae = B || {}, se = Y || {};
|
|
966
|
+
JSON.stringify(ae) !== JSON.stringify(se) && t.emit("resize", {
|
|
967
|
+
newSize: B,
|
|
968
|
+
oldSize: Y,
|
|
969
|
+
isMaximized: V.value
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
const X = D(() => (r.value && document.body.classList.add("modal-open"), r.value)), ne = D(() => {
|
|
973
|
+
var ae;
|
|
974
|
+
const B = {
|
|
975
|
+
modal: !0,
|
|
976
|
+
"farris-modal": !0,
|
|
977
|
+
fade: !0
|
|
978
|
+
};
|
|
979
|
+
B["f-modal-fitContent"] = !!u.value, B.show = !!X.value;
|
|
980
|
+
const Y = (ae = e.maskClass) == null ? void 0 : ae.split(" ");
|
|
981
|
+
return Y == null || Y.reduce((se, Ee) => (se[Ee] = !0, se), B), B;
|
|
982
|
+
}), le = D(() => {
|
|
983
|
+
var ae;
|
|
984
|
+
const B = {
|
|
985
|
+
"modal-dialog": !0
|
|
986
|
+
}, Y = (ae = a.value) == null ? void 0 : ae.split(" ");
|
|
987
|
+
return Y == null || Y.reduce((se, Ee) => (se[Ee] = !0, se), B), B;
|
|
988
|
+
}), ee = D(() => {
|
|
989
|
+
const B = {
|
|
990
|
+
position: "absolute",
|
|
991
|
+
top: `${(window.innerHeight - o.value) / 2}px`,
|
|
992
|
+
left: `${(window.innerWidth - n.value) / 2}px`,
|
|
993
|
+
width: `${n.value}px`,
|
|
994
|
+
height: u.value ? "auto" : `${o.value}px`
|
|
995
|
+
};
|
|
996
|
+
return e.mask || (B.pointerEvents = "auto"), B;
|
|
997
|
+
}), L = () => In() || 1040, te = D(() => {
|
|
998
|
+
const B = {
|
|
999
|
+
display: "block",
|
|
1000
|
+
zIndex: L()
|
|
1001
|
+
};
|
|
1002
|
+
return e.mask || (B.pointerEvents = "none", B.backgroundColor = "transparent"), C.value && (B.backgroundColor = "transparent"), B;
|
|
1003
|
+
}), He = D(() => ({
|
|
1004
|
+
"modal-content": !0,
|
|
1005
|
+
"modal-content-has-header": c.value
|
|
1006
|
+
})), Oe = D(() => {
|
|
1007
|
+
const B = {
|
|
1008
|
+
display: c.value ? "" : "none"
|
|
1009
|
+
};
|
|
1010
|
+
return B["pointer-events"] = O.value ? "auto" : "none", B;
|
|
1011
|
+
}), Se = D(() => ({
|
|
1012
|
+
"f-icon": !0,
|
|
1013
|
+
modal_maximize: !0,
|
|
1014
|
+
modalrevert: V.value
|
|
1015
|
+
})), Ue = D(() => ({
|
|
1016
|
+
"modal-body": !0,
|
|
1017
|
+
"f-utils-flex-column": s.value === "iframe",
|
|
1018
|
+
"f-utils-fill": !0
|
|
1019
|
+
}));
|
|
1020
|
+
function Le() {
|
|
1021
|
+
return {
|
|
1022
|
+
height: `${e.footerHeight || 60}px`
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
const Xe = D(() => {
|
|
1026
|
+
const B = {
|
|
1027
|
+
textAlgin: v.value
|
|
1028
|
+
}, Y = Le();
|
|
1029
|
+
return Object.assign(B, Y);
|
|
1030
|
+
});
|
|
1031
|
+
function ie(B) {
|
|
1032
|
+
if (B == null || B.stopPropagation(), V.value) {
|
|
1033
|
+
V.value = !1, J();
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
W(), V.value = !0;
|
|
1037
|
+
}
|
|
1038
|
+
async function et(B, Y) {
|
|
1039
|
+
B.handle && await B.handle(Y, B) && t.emit("closed", Y);
|
|
1040
|
+
}
|
|
1041
|
+
function Me(B) {
|
|
1042
|
+
B.width && (n.value = B.width), B.height && (o.value = B.height), B.buttons && (T.value = B.buttons), B.title && (k.value = B.title);
|
|
1043
|
+
}
|
|
1044
|
+
let Re = null, Te = null;
|
|
1045
|
+
Rn(() => {
|
|
1046
|
+
C.value = me();
|
|
1047
|
+
}), st(() => {
|
|
1048
|
+
q.value && !E.value && (E.value = q.value.parentElement, oe.value = E.value, K(b.value, q.value, oe.value)), X.value && document.body.classList.add("modal-open"), Re = Wo(e, t), Te = Go(e, t);
|
|
1049
|
+
}), lt(() => {
|
|
1050
|
+
U && U(), Re && Re.remove(), Te && Te.remove();
|
|
1051
|
+
}), t.expose({
|
|
1052
|
+
modalElementRef: q,
|
|
1053
|
+
updateModalOptions: Me,
|
|
1054
|
+
close: y,
|
|
1055
|
+
maxDialog: ie,
|
|
1056
|
+
isMaximized: V
|
|
1057
|
+
});
|
|
1058
|
+
function je() {
|
|
1059
|
+
return w("ul", null, [p.value && w("li", {
|
|
1060
|
+
class: "f-btn-icon f-bare"
|
|
1061
|
+
}, [w("span", {
|
|
1062
|
+
class: "f-icon modal_minimize"
|
|
1063
|
+
}, null)]), d.value && w("li", {
|
|
1064
|
+
onClick: ie,
|
|
1065
|
+
class: "f-btn-icon f-bare",
|
|
1066
|
+
style: "pointer-events: auto;"
|
|
1067
|
+
}, [w("span", {
|
|
1068
|
+
class: Se.value
|
|
1069
|
+
}, null)]), m.value && w("li", {
|
|
1070
|
+
class: "f-btn-icon f-bare",
|
|
1071
|
+
onClick: (B) => y(B, !1),
|
|
1072
|
+
style: "pointer-events: auto;"
|
|
1073
|
+
}, [w("span", {
|
|
1074
|
+
class: "f-icon modal_close"
|
|
1075
|
+
}, null)])]);
|
|
1076
|
+
}
|
|
1077
|
+
function tt() {
|
|
1078
|
+
return w("div", {
|
|
1079
|
+
class: "modal-footer",
|
|
1080
|
+
style: Xe.value
|
|
1081
|
+
}, [T.value && T.value.map((B) => {
|
|
1082
|
+
const Y = h(B.disabled);
|
|
1083
|
+
return w("button", {
|
|
1084
|
+
name: B.name,
|
|
1085
|
+
type: "button",
|
|
1086
|
+
disabled: Y.value,
|
|
1087
|
+
class: B.class + (B.iconClass ? " btn-icontext" : ""),
|
|
1088
|
+
onClick: (ae) => {
|
|
1089
|
+
et(B, ae);
|
|
1090
|
+
}
|
|
1091
|
+
}, [!!B.iconClass && w("i", {
|
|
1092
|
+
class: B.iconClass
|
|
1093
|
+
}, null), B.text]);
|
|
1094
|
+
})]);
|
|
1095
|
+
}
|
|
1096
|
+
function ze() {
|
|
1097
|
+
return w("div", {
|
|
1098
|
+
ref: b,
|
|
1099
|
+
class: "modal-header",
|
|
1100
|
+
style: Oe.value
|
|
1101
|
+
}, [t.slots.headerTemplate ? t.slots.headerTemplate() : w("div", {
|
|
1102
|
+
class: "modal-title"
|
|
1103
|
+
}, [F.value && w("span", {
|
|
1104
|
+
class: l.value,
|
|
1105
|
+
style: "margin-right: 8px"
|
|
1106
|
+
}, null), w("span", {
|
|
1107
|
+
class: "modal-title-label"
|
|
1108
|
+
}, [k.value])]), w("div", {
|
|
1109
|
+
class: "actions"
|
|
1110
|
+
}, [je()])]);
|
|
1111
|
+
}
|
|
1112
|
+
function Ie() {
|
|
1113
|
+
return t.slots.footerTemplate ? t.slots.footerTemplate() : _.value && tt();
|
|
1114
|
+
}
|
|
1115
|
+
function Ne(B) {
|
|
1116
|
+
if (B.stopPropagation(), e.allowClickMaskToClose) {
|
|
1117
|
+
if (B.target !== z.value)
|
|
1118
|
+
return;
|
|
1119
|
+
y(B, !1);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
function Ye() {
|
|
1123
|
+
var B, Y;
|
|
1124
|
+
return w("div", {
|
|
1125
|
+
id: i.value,
|
|
1126
|
+
class: le.value,
|
|
1127
|
+
style: ee.value,
|
|
1128
|
+
ref: q
|
|
1129
|
+
}, [w("div", {
|
|
1130
|
+
class: He.value
|
|
1131
|
+
}, [c.value && ze(), w("div", {
|
|
1132
|
+
class: Ue.value
|
|
1133
|
+
}, [(Y = (B = t.slots).default) == null ? void 0 : Y.call(B), s.value === "iframe" && w("iframe", {
|
|
1134
|
+
title: i.value,
|
|
1135
|
+
class: "f-utils-fill",
|
|
1136
|
+
width: "100%",
|
|
1137
|
+
frameborder: "0",
|
|
1138
|
+
src: f.value
|
|
1139
|
+
}, null)]), Ie()]), !u.value && q.value && !V.value && H(q.value)]);
|
|
1140
|
+
}
|
|
1141
|
+
function Je(B) {
|
|
1142
|
+
return B || "body";
|
|
1143
|
+
}
|
|
1144
|
+
return () => w(Xt, {
|
|
1145
|
+
to: Je(e.host)
|
|
1146
|
+
}, {
|
|
1147
|
+
default: () => [X.value && w(Yt, {
|
|
1148
|
+
name: "fade",
|
|
1149
|
+
appear: !0
|
|
1150
|
+
}, {
|
|
1151
|
+
default: () => [w("div", {
|
|
1152
|
+
ref: z,
|
|
1153
|
+
class: ne.value,
|
|
1154
|
+
style: te.value,
|
|
1155
|
+
onClick: Ne
|
|
1156
|
+
}, [Ye()])]
|
|
1157
|
+
})]
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
function Kt(e) {
|
|
1162
|
+
if (e.content && e.content.render)
|
|
1163
|
+
return e.content.render;
|
|
1164
|
+
if (e.render && typeof e.render == "function")
|
|
1165
|
+
return e.render;
|
|
1166
|
+
}
|
|
1167
|
+
function Uo(e) {
|
|
1168
|
+
const t = document.createElement("div");
|
|
1169
|
+
t.style.display = "contents";
|
|
1170
|
+
const n = Pt({
|
|
1171
|
+
setup(o, r) {
|
|
1172
|
+
lt(() => {
|
|
1173
|
+
document.body.removeChild(t);
|
|
1174
|
+
});
|
|
1175
|
+
const i = h(), a = h(e.class || ""), u = h(!!e.showButtons), c = h(!!e.showHeader), l = h(e.showCloseButton == null ? !0 : e.showCloseButton), m = h(!0), d = h(e.title || ""), p = e.acceptCallback || (() => {
|
|
1176
|
+
}), s = e.rejectCallback || (() => {
|
|
1177
|
+
}), f = e.closedCallback || ((z) => {
|
|
1178
|
+
}), v = e.resizeHandle || ((z) => {
|
|
1179
|
+
}), x = e.stopMoveHandle || ((z) => {
|
|
1180
|
+
}), k = Kt(e), E = (z) => {
|
|
1181
|
+
m.value = !1, n.unmount(), f(z);
|
|
1182
|
+
};
|
|
1183
|
+
return st(() => {
|
|
1184
|
+
}), r.expose({
|
|
1185
|
+
modalRef: i
|
|
1186
|
+
}), () => w(We, {
|
|
1187
|
+
ref: i,
|
|
1188
|
+
class: a.value,
|
|
1189
|
+
modelValue: m.value,
|
|
1190
|
+
"onUpdate:modelValue": (z) => m.value = z,
|
|
1191
|
+
title: d.value,
|
|
1192
|
+
width: e.width,
|
|
1193
|
+
height: e.height,
|
|
1194
|
+
buttons: e.buttons,
|
|
1195
|
+
"show-header": c.value,
|
|
1196
|
+
"show-buttons": u.value,
|
|
1197
|
+
"show-close-button": l.value,
|
|
1198
|
+
"show-max-button": !1,
|
|
1199
|
+
onAccept: p,
|
|
1200
|
+
onCancel: s,
|
|
1201
|
+
fitContent: e.fitContent == null ? !0 : e.fitContent,
|
|
1202
|
+
onClosed: E,
|
|
1203
|
+
onResize: v,
|
|
1204
|
+
onStopMove: x
|
|
1205
|
+
}, {
|
|
1206
|
+
default: () => [k && k(n)]
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
return document.body.appendChild(t), n.use(yt.i18n), n.mount(t), n;
|
|
1211
|
+
}
|
|
1212
|
+
class en {
|
|
1213
|
+
constructor(t) {
|
|
1214
|
+
ye(this, "appContext", null);
|
|
1215
|
+
ye(this, "modalRef", h());
|
|
1216
|
+
ye(this, "activeModalIndex", h(0));
|
|
1217
|
+
ye(this, "modalRefs", {});
|
|
1218
|
+
ye(this, "isUseEscCloseModal", h(!1));
|
|
1219
|
+
ye(this, "activeModalInstance", D(() => this.modalRefs[this.activeModalIndex.value]));
|
|
1220
|
+
this.app = t, this.appContext = t ? t._context : null;
|
|
1221
|
+
}
|
|
1222
|
+
getCurrentModal() {
|
|
1223
|
+
return this.activeModalInstance.value;
|
|
1224
|
+
}
|
|
1225
|
+
adaptToWindow(t, n) {
|
|
1226
|
+
const {
|
|
1227
|
+
width: o,
|
|
1228
|
+
height: r
|
|
1229
|
+
} = {
|
|
1230
|
+
width: window.innerWidth,
|
|
1231
|
+
height: window.innerHeight
|
|
1232
|
+
};
|
|
1233
|
+
return o < t && (t = o - 14), r < n && (n = r - 14), {
|
|
1234
|
+
width: t,
|
|
1235
|
+
height: n
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
static show(t) {
|
|
1239
|
+
const n = Object.assign({
|
|
1240
|
+
title: "",
|
|
1241
|
+
showButtons: !0,
|
|
1242
|
+
showHeader: !0
|
|
1243
|
+
}, t);
|
|
1244
|
+
return Uo(n);
|
|
1245
|
+
}
|
|
1246
|
+
close(t) {
|
|
1247
|
+
var n, o;
|
|
1248
|
+
t ? (o = t.value) == null || o.close() : (n = this.getCurrentModal()) == null || n.close();
|
|
1249
|
+
}
|
|
1250
|
+
open(t) {
|
|
1251
|
+
const n = document.createDocumentFragment();
|
|
1252
|
+
t.showMaxButton && t.fitContent && (t.showMaxButton = !1);
|
|
1253
|
+
const o = jn(Object.assign({
|
|
1254
|
+
title: "",
|
|
1255
|
+
showButtons: !0,
|
|
1256
|
+
showHeader: !0
|
|
1257
|
+
}, t)), r = h(!0), i = o.value.acceptCallback || (() => {
|
|
1258
|
+
}), a = o.value.rejectCallback || (() => {
|
|
1259
|
+
}), u = o.value.closedCallback || ((C, y) => {
|
|
1260
|
+
}), c = o.value.resizeHandle || ((C) => {
|
|
1261
|
+
}), l = t.stopMoveHandle || ((C) => {
|
|
1262
|
+
});
|
|
1263
|
+
let m;
|
|
1264
|
+
const d = Kt(o.value), p = (C) => {
|
|
1265
|
+
var S;
|
|
1266
|
+
r.value = !1;
|
|
1267
|
+
const y = (S = C == null ? void 0 : C.target) == null ? void 0 : S.classList.contains("modal_close");
|
|
1268
|
+
u(C, this.isUseEscCloseModal.value ? "esc" : y ? "icon" : "button");
|
|
1269
|
+
}, s = (C) => {
|
|
1270
|
+
p(C), m && Ke(() => {
|
|
1271
|
+
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], Mt(null, n), m = null, this.modalRef.value = null, this.modalRefs) {
|
|
1272
|
+
const y = Object.keys(this.modalRefs).map((S) => Number(S));
|
|
1273
|
+
y.length > 0 ? this.activeModalIndex.value = Math.max(...y) : this.activeModalIndex.value = 0;
|
|
1274
|
+
}
|
|
1275
|
+
this.isUseEscCloseModal.value = !1;
|
|
1276
|
+
});
|
|
1277
|
+
}, f = (C) => {
|
|
1278
|
+
var y;
|
|
1279
|
+
this.isUseEscCloseModal.value = !0, this.activeModalInstance && ((y = this.activeModalInstance.value) == null || y.close(C == null ? void 0 : C.event));
|
|
1280
|
+
}, {
|
|
1281
|
+
width: v,
|
|
1282
|
+
height: x
|
|
1283
|
+
} = o.value, k = this.adaptToWindow(v || 500, x || 320);
|
|
1284
|
+
Object.assign(o.value, k);
|
|
1285
|
+
const E = () => w(We, gt({
|
|
1286
|
+
ref: this.modalRef,
|
|
1287
|
+
modelValue: r.value,
|
|
1288
|
+
"onUpdate:modelValue": (C) => r.value = C
|
|
1289
|
+
}, o.value, {
|
|
1290
|
+
onAccept: i,
|
|
1291
|
+
onCancel: a,
|
|
1292
|
+
onClosed: s,
|
|
1293
|
+
onResize: c,
|
|
1294
|
+
onEsc: f,
|
|
1295
|
+
onStopMove: l
|
|
1296
|
+
}), {
|
|
1297
|
+
default: () => [d && d(this.app)]
|
|
1298
|
+
});
|
|
1299
|
+
return m = ((C) => {
|
|
1300
|
+
const y = Nn(E, C);
|
|
1301
|
+
return y.appContext = this.appContext, Mt(y, n), y;
|
|
1302
|
+
})({
|
|
1303
|
+
...o.value
|
|
1304
|
+
// 'onUpdate:modelValue': onUpdateModelValue,
|
|
1305
|
+
}), this.activeModalIndex.value++, this.modalRefs[this.activeModalIndex.value] = this.modalRef.value, {
|
|
1306
|
+
update: (C) => {
|
|
1307
|
+
o.value = {
|
|
1308
|
+
...o.value,
|
|
1309
|
+
...C
|
|
1310
|
+
}, m && Mt(Pn(m, {
|
|
1311
|
+
...o
|
|
1312
|
+
}), n);
|
|
1313
|
+
},
|
|
1314
|
+
destroy: s,
|
|
1315
|
+
modalRef: this.activeModalInstance,
|
|
1316
|
+
close: () => this.close()
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
function Xo(e = {}) {
|
|
1321
|
+
function t(l, m, d, p) {
|
|
1322
|
+
if (typeof d == "number")
|
|
1323
|
+
return p[l].length === d;
|
|
1324
|
+
if (typeof d == "object") {
|
|
1325
|
+
const s = Object.keys(d)[0], f = d[s];
|
|
1326
|
+
if (s === "not")
|
|
1327
|
+
return Number(p[l].length) !== Number(f);
|
|
1328
|
+
if (s === "moreThan")
|
|
1329
|
+
return Number(p[l].length) >= Number(f);
|
|
1330
|
+
if (s === "lessThan")
|
|
1331
|
+
return Number(p[l].length) <= Number(f);
|
|
1332
|
+
}
|
|
1333
|
+
return !1;
|
|
1334
|
+
}
|
|
1335
|
+
function n(l, m, d, p) {
|
|
1336
|
+
return p[l] && p[l].propertyValue && String(p[l].propertyValue.value) === String(d);
|
|
1337
|
+
}
|
|
1338
|
+
const o = /* @__PURE__ */ new Map([
|
|
1339
|
+
["length", t],
|
|
1340
|
+
["getProperty", n]
|
|
1341
|
+
]);
|
|
1342
|
+
Object.keys(e).reduce((l, m) => (l.set(m, e[m]), l), o);
|
|
1343
|
+
function r(l, m) {
|
|
1344
|
+
const d = l;
|
|
1345
|
+
return typeof m == "number" ? [{ target: d, operator: "length", param: null, value: Number(m) }] : typeof m == "boolean" ? [{ target: d, operator: "getProperty", param: l, value: !!m }] : typeof m == "object" ? Object.keys(m).map((p) => {
|
|
1346
|
+
if (p === "length")
|
|
1347
|
+
return { target: d, operator: "length", param: null, value: m[p] };
|
|
1348
|
+
const s = p, f = m[p];
|
|
1349
|
+
return { target: d, operator: "getProperty", param: s, value: f };
|
|
1350
|
+
}) : [];
|
|
1351
|
+
}
|
|
1352
|
+
function i(l) {
|
|
1353
|
+
return Object.keys(l).reduce((d, p) => {
|
|
1354
|
+
const s = r(p, l[p]);
|
|
1355
|
+
return d.push(...s), d;
|
|
1356
|
+
}, []);
|
|
1357
|
+
}
|
|
1358
|
+
function a(l, m) {
|
|
1359
|
+
if (o.has(l.operator)) {
|
|
1360
|
+
const d = o.get(l.operator);
|
|
1361
|
+
return d && d(l.target, l.param, l.value, m) || !1;
|
|
1362
|
+
}
|
|
1363
|
+
return !1;
|
|
1364
|
+
}
|
|
1365
|
+
function u(l, m) {
|
|
1366
|
+
return i(l).reduce((s, f) => s && a(f, m), !0);
|
|
1367
|
+
}
|
|
1368
|
+
function c(l, m) {
|
|
1369
|
+
const d = Object.keys(l), p = d.includes("allOf"), s = d.includes("anyOf"), f = p || s, k = (f ? l[f ? p ? "allOf" : "anyOf" : "allOf"] : [l]).map((z) => u(z, m));
|
|
1370
|
+
return p ? !k.includes(!1) : k.includes(!0);
|
|
1371
|
+
}
|
|
1372
|
+
return { parseValueSchema: c };
|
|
1373
|
+
}
|
|
1374
|
+
const Yo = {
|
|
1375
|
+
convertTo: (e, t, n, o) => {
|
|
1376
|
+
e.appearance || (e.appearance = {}), e.appearance[t] = n;
|
|
1377
|
+
},
|
|
1378
|
+
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
|
|
1379
|
+
}, Jo = {
|
|
1380
|
+
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
|
|
1381
|
+
}, Qo = {
|
|
1382
|
+
convertTo: (e, t, n, o) => {
|
|
1383
|
+
e.editor && (e.editor[t] = n);
|
|
1384
|
+
},
|
|
1385
|
+
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
|
|
1386
|
+
}, M = {
|
|
1387
|
+
button: { type: "button", name: "按钮" },
|
|
1388
|
+
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
|
|
1389
|
+
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
|
|
1390
|
+
"content-container": { type: "content-container", name: "容器" },
|
|
1391
|
+
"input-group": { type: "input-group", name: "文本" },
|
|
1392
|
+
textarea: { type: "textarea", name: "多行文本" },
|
|
1393
|
+
lookup: { type: "lookup", name: "帮助" },
|
|
1394
|
+
"number-spinner": { type: "number-spinner", name: "数值" },
|
|
1395
|
+
"date-picker": { type: "date-picker", name: "日期" },
|
|
1396
|
+
switch: { type: "switch", name: "开关" },
|
|
1397
|
+
"radio-group": { type: "radio-group", name: "单选组" },
|
|
1398
|
+
"check-box": { type: "check-box", name: "复选框" },
|
|
1399
|
+
"check-group": { type: "check-group", name: "复选框组" },
|
|
1400
|
+
"combo-list": { type: "combo-list", name: "下拉列表" },
|
|
1401
|
+
"response-form": { type: "response-form", name: "卡片面板" },
|
|
1402
|
+
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
|
|
1403
|
+
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
|
|
1404
|
+
"tree-grid": { type: "tree-grid", name: "树表格" },
|
|
1405
|
+
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
|
|
1406
|
+
"data-grid": { type: "data-grid", name: "表格" },
|
|
1407
|
+
"data-grid-column": { type: "data-grid-column", name: "表格列" },
|
|
1408
|
+
module: { type: "Module", name: "模块" },
|
|
1409
|
+
component: { type: "component", name: "组件" },
|
|
1410
|
+
tabs: { type: "tabs", name: "标签页" },
|
|
1411
|
+
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
|
|
1412
|
+
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
|
|
1413
|
+
"html-template": { type: "html-template", name: "模板容器" },
|
|
1414
|
+
"time-picker": { type: "time-picker", name: "时间选择" },
|
|
1415
|
+
section: { type: "section", name: "分组面板" },
|
|
1416
|
+
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
|
|
1417
|
+
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
|
|
1418
|
+
splitter: { type: "splitter", name: "分栏面板" },
|
|
1419
|
+
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
|
|
1420
|
+
"component-ref": { type: "component-ref", name: "组件引用节点" },
|
|
1421
|
+
uploader: { type: "uploader", name: "附件上传" },
|
|
1422
|
+
"page-header": { type: "page-header", name: "页头" },
|
|
1423
|
+
"page-footer": { type: "page-footer", name: "页脚" },
|
|
1424
|
+
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
|
|
1425
|
+
fieldset: { type: "fieldset", name: "分组" },
|
|
1426
|
+
"query-solution": { type: "query-solution", name: "筛选方案" },
|
|
1427
|
+
drawer: { type: "drawer", name: "抽屉" },
|
|
1428
|
+
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
|
|
1429
|
+
"list-nav": { type: "list-nav", name: "列表导航" },
|
|
1430
|
+
"list-view": { type: "list-view", name: "列表" },
|
|
1431
|
+
"filter-bar": { type: "filter-bar", name: "筛选条" },
|
|
1432
|
+
"language-textbox": { type: "language-textbox", name: "多语输入框" }
|
|
1433
|
+
}, Zo = {
|
|
1434
|
+
convertFrom: (e, t, n) => {
|
|
1435
|
+
var r;
|
|
1436
|
+
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
|
|
1437
|
+
return ((r = M[o]) == null ? void 0 : r.name) || o;
|
|
1438
|
+
}
|
|
1439
|
+
}, Ko = {
|
|
1440
|
+
convertTo: (e, t, n, o) => {
|
|
1441
|
+
e[t] = e[t];
|
|
1442
|
+
},
|
|
1443
|
+
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
|
|
1444
|
+
}, er = {
|
|
1445
|
+
convertTo: (e, t, n, o) => {
|
|
1446
|
+
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
|
|
1447
|
+
[t]: n
|
|
1448
|
+
});
|
|
1449
|
+
},
|
|
1450
|
+
convertFrom: (e, t, n) => {
|
|
1451
|
+
if (e.formatter) {
|
|
1452
|
+
if (t === "trueText")
|
|
1453
|
+
return e.formatter.trueText;
|
|
1454
|
+
if (t === "falseText")
|
|
1455
|
+
return e.formatter.falseText;
|
|
1456
|
+
if (t === "prefix")
|
|
1457
|
+
return e.formatter.prefix;
|
|
1458
|
+
if (t === "suffix")
|
|
1459
|
+
return e.formatter.suffix;
|
|
1460
|
+
if (t === "precision")
|
|
1461
|
+
return e.formatter.precision;
|
|
1462
|
+
if (t === "decimal")
|
|
1463
|
+
return e.formatter.decimal;
|
|
1464
|
+
if (t === "thousand")
|
|
1465
|
+
return e.formatter.thousand;
|
|
1466
|
+
if (t === "dateFormat")
|
|
1467
|
+
return e.formatter.dateFormat || "yyyy-MM-dd";
|
|
1468
|
+
if (t === "customFormat")
|
|
1469
|
+
return e.formatter.customFormat;
|
|
1470
|
+
if (t === "type")
|
|
1471
|
+
return e.formatter.type || "none";
|
|
1472
|
+
}
|
|
1473
|
+
return "none";
|
|
1474
|
+
}
|
|
1475
|
+
}, tr = {
|
|
1476
|
+
convertTo: (e, t, n, o) => {
|
|
1477
|
+
e.command ? e.command[t] = n : e.command = {
|
|
1478
|
+
[t]: n
|
|
1479
|
+
}, t === "enable" && n && (e.command.commands || (e.command.commands = [
|
|
1480
|
+
{
|
|
1481
|
+
text: "编辑",
|
|
1482
|
+
type: "primary",
|
|
1483
|
+
command: "edit"
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
text: "删除",
|
|
1487
|
+
type: "danger",
|
|
1488
|
+
command: "remove"
|
|
1489
|
+
}
|
|
1490
|
+
]));
|
|
1491
|
+
},
|
|
1492
|
+
convertFrom: (e, t, n) => e.command && t === "enable" ? e.command.enable : ""
|
|
1493
|
+
}, nr = {
|
|
1494
|
+
convertTo: (e, t, n, o) => {
|
|
1495
|
+
e.column ? e.column[t] = n : e.column = {
|
|
1496
|
+
[t]: n
|
|
1497
|
+
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
|
|
1498
|
+
},
|
|
1499
|
+
convertFrom: (e, t, n) => {
|
|
1500
|
+
if (e.column) {
|
|
1501
|
+
if (t === "fitColumns")
|
|
1502
|
+
return e.column.fitColumns;
|
|
1503
|
+
if (t === "fitMode")
|
|
1504
|
+
return e.column.fitMode;
|
|
1505
|
+
}
|
|
1506
|
+
return "";
|
|
1507
|
+
}
|
|
1508
|
+
}, or = {
|
|
1509
|
+
convertTo: (e, t, n, o) => {
|
|
1510
|
+
e.summary ? e.summary[t] = n : e.summary = {
|
|
1511
|
+
[t]: n
|
|
1512
|
+
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
|
|
1513
|
+
enable: n,
|
|
1514
|
+
groupFields: []
|
|
1515
|
+
});
|
|
1516
|
+
},
|
|
1517
|
+
convertFrom: (e, t, n) => e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""
|
|
1518
|
+
}, rr = {
|
|
1519
|
+
convertTo: (e, t, n, o) => {
|
|
1520
|
+
e.group ? e.group[t] = n : e.group = {
|
|
1521
|
+
[t]: n
|
|
1522
|
+
}, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
|
|
1523
|
+
enable: n,
|
|
1524
|
+
groupFields: [],
|
|
1525
|
+
showSummary: !1
|
|
1526
|
+
});
|
|
1527
|
+
},
|
|
1528
|
+
convertFrom: (e, t, n) => {
|
|
1529
|
+
if (e.group) {
|
|
1530
|
+
if (t === "enable")
|
|
1531
|
+
return e.group.enable;
|
|
1532
|
+
if (t === "showSummary")
|
|
1533
|
+
return e.group.showSummary;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}, ir = {
|
|
1537
|
+
convertFrom: (e, t) => e.binding ? e.binding.path : "",
|
|
1538
|
+
convertTo: (e, t, n) => {
|
|
1539
|
+
if (n && n.length > 0) {
|
|
1540
|
+
const o = n[0];
|
|
1541
|
+
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath;
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}, ar = {
|
|
1545
|
+
convertTo: (e, t, n, o) => {
|
|
1546
|
+
e.pagination || (e.pagination = {}), e.pagination[t] = n;
|
|
1547
|
+
},
|
|
1548
|
+
convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
|
|
1549
|
+
}, lr = {
|
|
1550
|
+
convertTo: (e, t, n, o) => {
|
|
1551
|
+
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
|
|
1552
|
+
},
|
|
1553
|
+
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
|
|
1554
|
+
}, sr = {
|
|
1555
|
+
convertTo: (e, t, n, o) => {
|
|
1556
|
+
e.selection || (e.selection = {}), e.selection[t] = n;
|
|
1557
|
+
},
|
|
1558
|
+
convertFrom: (e, t, n) => {
|
|
1559
|
+
var o, r;
|
|
1560
|
+
return t === "showCheckbox" ? (o = e.selection) != null && o.multiSelect ? !0 : (r = e.selection) == null ? void 0 : r.showCheckbox : e.selection ? e.selection[t] : e[t];
|
|
1561
|
+
}
|
|
1562
|
+
}, ur = {
|
|
1563
|
+
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
|
|
1564
|
+
}, cr = {
|
|
1565
|
+
convertFrom: (e, t) => e[t] || "",
|
|
1566
|
+
convertTo: (e, t, n) => {
|
|
1567
|
+
e[t] = n;
|
|
1568
|
+
}
|
|
1569
|
+
}, dr = {
|
|
1570
|
+
convertTo: (e, t, n, o) => {
|
|
1571
|
+
e.size || (e.size = {}), e.size[t] = n;
|
|
1572
|
+
},
|
|
1573
|
+
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
|
|
1574
|
+
}, fr = {
|
|
1575
|
+
convertFrom: (e, t, n) => {
|
|
1576
|
+
var o, r;
|
|
1577
|
+
return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (r = e.formatter) == null ? void 0 : r.data : e.formatterEnumData;
|
|
1578
|
+
}
|
|
1579
|
+
}, pr = {
|
|
1580
|
+
convertTo: (e, t, n, o) => {
|
|
1581
|
+
e.sort || (e.sort = {}), e.sort[t] = n;
|
|
1582
|
+
},
|
|
1583
|
+
convertFrom: (e, t, n) => {
|
|
1584
|
+
var o, r;
|
|
1585
|
+
if (t === "mode")
|
|
1586
|
+
return ((o = e.sort) == null ? void 0 : o.mode) || "client";
|
|
1587
|
+
if (t === "multiSort")
|
|
1588
|
+
return !!((r = e.sort) != null && r.multiSort);
|
|
1589
|
+
}
|
|
1590
|
+
}, mr = {
|
|
1591
|
+
convertTo: (e, t, n, o) => {
|
|
1592
|
+
e.filter || (e.filter = {}), e.filter[t] = n;
|
|
1593
|
+
},
|
|
1594
|
+
convertFrom: (e, t, n) => {
|
|
1595
|
+
var o;
|
|
1596
|
+
if (t === "mode")
|
|
1597
|
+
return ((o = e.filter) == null ? void 0 : o.mode) || "client";
|
|
1598
|
+
}
|
|
1599
|
+
}, vr = {
|
|
1600
|
+
convertTo: (e, t, n, o) => {
|
|
1601
|
+
e.rowOption ? e.rowOption[t] = n : e.rowOption = {
|
|
1602
|
+
[t]: n
|
|
1603
|
+
};
|
|
1604
|
+
},
|
|
1605
|
+
convertFrom: (e, t, n) => {
|
|
1606
|
+
if (e.rowOption) {
|
|
1607
|
+
if (t === "customRowStyle")
|
|
1608
|
+
return e.rowOption.customRowStyle;
|
|
1609
|
+
if (t === "customCellStyle")
|
|
1610
|
+
return e.rowOption.customCellStyle;
|
|
1611
|
+
}
|
|
1612
|
+
return "";
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
function tn(e, t, n) {
|
|
1616
|
+
const o = /* @__PURE__ */ new Map([
|
|
1617
|
+
["/converter/appearance.converter", Yo],
|
|
1618
|
+
["/converter/buttons.converter", Jo],
|
|
1619
|
+
["/converter/property-editor.converter", Qo],
|
|
1620
|
+
["/converter/items-count.converter", ur],
|
|
1621
|
+
["/converter/type.converter", Zo],
|
|
1622
|
+
["/converter/change-editor.converter", Ko],
|
|
1623
|
+
["/converter/change-formatter.converter", er],
|
|
1624
|
+
["/converter/column-command.converter", tr],
|
|
1625
|
+
["/converter/column-option.converter", nr],
|
|
1626
|
+
["/converter/summary.converter", or],
|
|
1627
|
+
["/converter/group.converter", rr],
|
|
1628
|
+
["/converter/form-group-label.converter", cr],
|
|
1629
|
+
["/converter/field-selector.converter", ir],
|
|
1630
|
+
["/converter/pagination.converter", ar],
|
|
1631
|
+
["/converter/row-number.converter", lr],
|
|
1632
|
+
["/converter/grid-selection.converter", sr],
|
|
1633
|
+
["/converter/size.converter", dr],
|
|
1634
|
+
["/converter/change-formatter-enum.converter", fr],
|
|
1635
|
+
["/converter/grid-sort.converter", pr],
|
|
1636
|
+
["/converter/grid-filter.converter", mr],
|
|
1637
|
+
["/converter/row-option.converter", vr]
|
|
1638
|
+
]), r = /* @__PURE__ */ new Map([
|
|
1639
|
+
["string", { type: "input-group", enableClear: !1 }],
|
|
1640
|
+
["boolean", {
|
|
1641
|
+
type: "combo-list",
|
|
1642
|
+
textField: "name",
|
|
1643
|
+
valueField: "value",
|
|
1644
|
+
idField: "value",
|
|
1645
|
+
enableClear: !1,
|
|
1646
|
+
editable: !1,
|
|
1647
|
+
data: [
|
|
1648
|
+
{
|
|
1649
|
+
value: !0,
|
|
1650
|
+
name: "是"
|
|
1651
|
+
},
|
|
1652
|
+
{
|
|
1653
|
+
value: !1,
|
|
1654
|
+
name: "否"
|
|
1655
|
+
}
|
|
1656
|
+
]
|
|
1657
|
+
}],
|
|
1658
|
+
["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
|
|
1659
|
+
["array", { type: "button-edit" }],
|
|
1660
|
+
["number", { type: "number-spinner", placeholder: "" }],
|
|
1661
|
+
["events-editor", { type: "events-editor", hide: !0 }]
|
|
1662
|
+
]), i = Xo();
|
|
1663
|
+
function a(f, v) {
|
|
1664
|
+
return () => i.parseValueSchema(f, v);
|
|
1665
|
+
}
|
|
1666
|
+
function u(f, v, x) {
|
|
1667
|
+
return f.includes("visible") && v.visible !== void 0 ? typeof v.visible == "boolean" ? () => !!v.visible : v.visible === void 0 ? !0 : a(v.visible, x) : () => !0;
|
|
1668
|
+
}
|
|
1669
|
+
function c(f, v, x) {
|
|
1670
|
+
return f.includes("readonly") && v.readonly !== void 0 ? typeof v.readonly == "boolean" ? () => !!v.readonly : a(v.readonly, x) : () => !1;
|
|
1671
|
+
}
|
|
1672
|
+
function l(f, v) {
|
|
1673
|
+
const x = f.$converter || v;
|
|
1674
|
+
return typeof x == "string" && x && o.has(x) ? o.get(x) || null : x || null;
|
|
1675
|
+
}
|
|
1676
|
+
function m(f, v, x, k, E, z = "", N = "") {
|
|
1677
|
+
return Object.keys(f).map((y) => {
|
|
1678
|
+
const S = h(1), T = y, F = f[y], _ = Object.keys(F), b = F.title, q = F.type, V = r.get(q) || { type: "input-group", enableClear: !1 }, H = F.editor ? Object.assign({}, V, F.editor) : Object.assign({}, V), W = u(_, F, v), J = c(_, F, v);
|
|
1679
|
+
H.readonly = H.readonly === void 0 ? J() : H.readonly;
|
|
1680
|
+
const oe = F.type === "cascade" ? m(F.properties, v, x, k, E, z, N) : [], R = !0;
|
|
1681
|
+
let O = l(F, N);
|
|
1682
|
+
const U = D({
|
|
1683
|
+
get() {
|
|
1684
|
+
if (S.value) {
|
|
1685
|
+
if (["class", "style"].find((le) => le === T) && !O && (O = o.get("/converter/appearance.converter") || null), O && O.convertFrom)
|
|
1686
|
+
return O.convertFrom(x, y, E, z);
|
|
1687
|
+
const ne = x[y];
|
|
1688
|
+
return Object.prototype.hasOwnProperty.call(F, "defaultValue") && (ne === void 0 || typeof ne == "string" && ne === "") ? F.type === "boolean" ? F.defaultValue : F.defaultValue || "" : ne;
|
|
1689
|
+
}
|
|
1690
|
+
return null;
|
|
1691
|
+
},
|
|
1692
|
+
set(ne) {
|
|
1693
|
+
S.value += 1, O && O.convertTo ? (O.convertTo(k, y, ne, E, z), O.convertTo(x, y, ne, E, z)) : (k[y] = ne, x[y] = ne);
|
|
1694
|
+
}
|
|
1695
|
+
}), { refreshPanelAfterChanged: $, description: K, isExpand: me, parentPropertyID: ve } = F, X = { propertyID: T, propertyName: b, propertyType: q, propertyValue: U, editor: H, visible: W, readonly: J, cascadeConfig: oe, hideCascadeTitle: R, refreshPanelAfterChanged: $, description: K, isExpand: me, parentPropertyID: ve };
|
|
1696
|
+
return v[T] = X, X;
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1699
|
+
function d(f, v, x = {}) {
|
|
1700
|
+
const k = {}, E = e[f];
|
|
1701
|
+
return E && E.categories ? Object.keys(E.categories).map((N) => {
|
|
1702
|
+
const C = E.categories[N], y = C == null ? void 0 : C.title, S = m(C.properties || {}, k, {}, x, v);
|
|
1703
|
+
return { categoryId: N, categoryName: y, properties: S };
|
|
1704
|
+
}) : [];
|
|
1705
|
+
}
|
|
1706
|
+
function p(f, v, x, k, E = "") {
|
|
1707
|
+
const z = v.$ref.schema, N = v.$ref.converter, C = x[z], y = C.type, S = n(C), T = {}, F = e[y];
|
|
1708
|
+
if (F && F.categories) {
|
|
1709
|
+
const _ = F.categories[f], b = _ == null ? void 0 : _.title;
|
|
1710
|
+
N && Object.keys(_.properties).forEach((H) => {
|
|
1711
|
+
_.properties[H].$converter = N;
|
|
1712
|
+
});
|
|
1713
|
+
const q = (_ == null ? void 0 : _.properties) || {}, V = m(q, T, S, C, k, E);
|
|
1714
|
+
return { categoryId: f, categoryName: b, properties: V };
|
|
1715
|
+
}
|
|
1716
|
+
return { categoryId: f, categoryName: "", properties: [] };
|
|
1717
|
+
}
|
|
1718
|
+
function s(f, v, x, k, E) {
|
|
1719
|
+
const z = f.type, N = n(f), C = {};
|
|
1720
|
+
let y = E || e[z];
|
|
1721
|
+
if (y && Object.keys(y).length === 0 && x && x.getPropConfig && (y = x.getPropConfig(k)), y && y.categories) {
|
|
1722
|
+
const S = [];
|
|
1723
|
+
return Object.keys(y.categories).map((T) => {
|
|
1724
|
+
const F = y.categories[T];
|
|
1725
|
+
if (F.$ref) {
|
|
1726
|
+
S.push(p(T, F, f, v, k));
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
const _ = F == null ? void 0 : F.title, b = F == null ? void 0 : F.tabId, q = F == null ? void 0 : F.tabName, V = F == null ? void 0 : F.hide, H = F == null ? void 0 : F.hideTitle, W = m(F.properties || {}, C, N, f, v, k, F.$converter), { setPropertyRelates: J } = F, oe = F == null ? void 0 : F.parentPropertyID;
|
|
1730
|
+
S.push({ categoryId: T, categoryName: _, tabId: b, tabName: q, hide: V, properties: W, hideTitle: H, setPropertyRelates: J, parentPropertyID: oe });
|
|
1731
|
+
}), S;
|
|
1732
|
+
}
|
|
1733
|
+
return [];
|
|
1734
|
+
}
|
|
1735
|
+
return {
|
|
1736
|
+
getPropertyConfigBySchema: s,
|
|
1737
|
+
getPropertyConfigByType: d,
|
|
1738
|
+
propertyConverterMap: o
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
function nn(e, t) {
|
|
1742
|
+
let n;
|
|
1743
|
+
function o(d) {
|
|
1744
|
+
const { properties: p, title: s, ignore: f } = d, v = f && Array.isArray(f), x = Object.keys(p).reduce((k, E) => ((!v || !f.find((z) => z === E)) && (k[E] = p[E].type === "object" && p[E].properties ? o(p[E]) : Rt(p[E].default)), k), {});
|
|
1745
|
+
if (s && (!v || !f.find((k) => k === "id"))) {
|
|
1746
|
+
const k = s.toLowerCase().replace(/-/g, "_");
|
|
1747
|
+
x.id = `${k}_${Math.random().toString().slice(2, 6)}`;
|
|
1748
|
+
}
|
|
1749
|
+
return x;
|
|
1750
|
+
}
|
|
1751
|
+
function r(d) {
|
|
1752
|
+
const { properties: p, title: s, required: f } = d;
|
|
1753
|
+
if (f && Array.isArray(f)) {
|
|
1754
|
+
const v = f.reduce((x, k) => (x[k] = p[k].type === "object" && p[k].properties ? o(p[k]) : Rt(p[k].default), x), {});
|
|
1755
|
+
if (s && f.find((x) => x === "id")) {
|
|
1756
|
+
const x = s.toLowerCase().replace(/-/g, "_");
|
|
1757
|
+
v.id = `${x}_${Math.random().toString().slice(2, 6)}`;
|
|
1758
|
+
}
|
|
1759
|
+
return v;
|
|
1760
|
+
}
|
|
1761
|
+
return {
|
|
1762
|
+
type: s
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
function i(d, p = {}, s) {
|
|
1766
|
+
const f = e[d];
|
|
1767
|
+
if (f) {
|
|
1768
|
+
let v = r(f);
|
|
1769
|
+
const x = t[d];
|
|
1770
|
+
return v = x ? x({ getSchemaByType: i }, v, p, s) : v, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(v), v;
|
|
1771
|
+
}
|
|
1772
|
+
return null;
|
|
1773
|
+
}
|
|
1774
|
+
function a(d, p) {
|
|
1775
|
+
const s = o(p);
|
|
1776
|
+
return Object.keys(s).reduce((f, v) => (Object.prototype.hasOwnProperty.call(d, v) && (f[v] && qt(f[v]) && qt(d[v] || !d[v]) ? Object.assign(f[v], d[v] || {}) : f[v] = d[v]), f), s), s;
|
|
1777
|
+
}
|
|
1778
|
+
function u(d, p) {
|
|
1779
|
+
return Object.keys(d).filter((f) => d[f] != null).reduce((f, v) => {
|
|
1780
|
+
if (p.has(v)) {
|
|
1781
|
+
const x = p.get(v);
|
|
1782
|
+
if (typeof x == "string")
|
|
1783
|
+
f[x] = d[v];
|
|
1784
|
+
else {
|
|
1785
|
+
const k = x(v, d[v], d);
|
|
1786
|
+
Object.assign(f, k);
|
|
1787
|
+
}
|
|
1788
|
+
} else
|
|
1789
|
+
f[v] = d[v];
|
|
1790
|
+
return f;
|
|
1791
|
+
}, {});
|
|
1792
|
+
}
|
|
1793
|
+
function c(d, p, s = /* @__PURE__ */ new Map()) {
|
|
1794
|
+
const f = a(d, p);
|
|
1795
|
+
return u(f, s);
|
|
1796
|
+
}
|
|
1797
|
+
function l(d) {
|
|
1798
|
+
var s;
|
|
1799
|
+
const p = d.type;
|
|
1800
|
+
if (p) {
|
|
1801
|
+
const f = e[p];
|
|
1802
|
+
if (!f)
|
|
1803
|
+
return d;
|
|
1804
|
+
const v = a(d, f), x = ((s = d.editor) == null ? void 0 : s.type) || "";
|
|
1805
|
+
if (x) {
|
|
1806
|
+
const k = e[x], E = a(d.editor, k);
|
|
1807
|
+
v.editor = E;
|
|
1808
|
+
}
|
|
1809
|
+
return v;
|
|
1810
|
+
}
|
|
1811
|
+
return d;
|
|
1812
|
+
}
|
|
1813
|
+
function m(d) {
|
|
1814
|
+
n = d;
|
|
1815
|
+
}
|
|
1816
|
+
return { getSchemaByType: i, resolveSchemaWithDefaultValue: l, resolveSchemaToProps: c, mappingSchemaToProps: u, setDesignerContext: m };
|
|
1817
|
+
}
|
|
1818
|
+
const on = {}, rn = {}, { getSchemaByType: Pl, resolveSchemaWithDefaultValue: gr, resolveSchemaToProps: Dl, mappingSchemaToProps: $l, setDesignerContext: Hl } = nn(on, rn), an = {}, ln = {};
|
|
1819
|
+
tn(an, ln, gr);
|
|
1820
|
+
const sn = {}, un = {}, { getSchemaByType: Ll, resolveSchemaWithDefaultValue: yr, resolveSchemaToProps: hr, mappingSchemaToProps: br, setDesignerContext: zl } = nn(sn, un), cn = {}, dn = {};
|
|
1821
|
+
tn(cn, dn, yr);
|
|
1822
|
+
function ht(e, t, n = /* @__PURE__ */ new Map(), o = (a, u, c, l) => u, r = {}, i = (a) => a) {
|
|
1823
|
+
return sn[t.title] = t, un[t.title] = o, cn[t.title] = r, dn[t.title] = i, on[t.title] = t, rn[t.title] = o, an[t.title] = r, ln[t.title] = i, (a = {}, u = !0) => {
|
|
1824
|
+
if (!u)
|
|
1825
|
+
return br(a, n);
|
|
1826
|
+
const c = hr(a, t, n), l = Object.keys(e).reduce((m, d) => (m[d] = e[d].default, m), {});
|
|
1827
|
+
return Object.assign(l, c);
|
|
1828
|
+
};
|
|
1829
|
+
}
|
|
1830
|
+
function fn(e, t) {
|
|
1831
|
+
return { customClass: t.class, customStyle: t.style };
|
|
1832
|
+
}
|
|
1833
|
+
const $t = /* @__PURE__ */ new Map([
|
|
1834
|
+
["appearance", fn]
|
|
1835
|
+
]), wr = /* @__PURE__ */ new Map([]), Cr = "https://json-schema.org/draft/2020-12/schema", xr = "https://farris-design.gitee.io/form-group.schema.json", Sr = "form-group", Tr = "A Farris Input Component", Br = "object", kr = {
|
|
1836
|
+
id: {
|
|
1837
|
+
description: "The unique identifier for a form group",
|
|
1838
|
+
type: "string"
|
|
1839
|
+
},
|
|
1840
|
+
type: {
|
|
1841
|
+
description: "The type string of form group component",
|
|
1842
|
+
type: "string",
|
|
1843
|
+
default: "form-group"
|
|
1844
|
+
},
|
|
1845
|
+
appearance: {
|
|
1846
|
+
description: "",
|
|
1847
|
+
type: "object",
|
|
1848
|
+
properties: {
|
|
1849
|
+
class: {
|
|
1850
|
+
type: "string"
|
|
1851
|
+
},
|
|
1852
|
+
style: {
|
|
1853
|
+
type: "string"
|
|
1854
|
+
}
|
|
1855
|
+
},
|
|
1856
|
+
default: {}
|
|
1857
|
+
},
|
|
1858
|
+
enableLinkLabel: {
|
|
1859
|
+
description: "",
|
|
1860
|
+
type: "boolean",
|
|
1861
|
+
default: !1
|
|
1862
|
+
},
|
|
1863
|
+
editor: {
|
|
1864
|
+
description: "",
|
|
1865
|
+
type: "obejct",
|
|
1866
|
+
default: null
|
|
1867
|
+
},
|
|
1868
|
+
label: {
|
|
1869
|
+
description: "",
|
|
1870
|
+
type: "string",
|
|
1871
|
+
default: ""
|
|
1872
|
+
},
|
|
1873
|
+
lableWidth: {
|
|
1874
|
+
description: "",
|
|
1875
|
+
type: "number"
|
|
1876
|
+
},
|
|
1877
|
+
binding: {
|
|
1878
|
+
description: "",
|
|
1879
|
+
type: "object",
|
|
1880
|
+
default: {}
|
|
1881
|
+
},
|
|
1882
|
+
visible: {
|
|
1883
|
+
description: "",
|
|
1884
|
+
type: "boolean",
|
|
1885
|
+
default: !0
|
|
1886
|
+
},
|
|
1887
|
+
required: {
|
|
1888
|
+
description: "",
|
|
1889
|
+
type: "boolean",
|
|
1890
|
+
default: !1
|
|
1891
|
+
},
|
|
1892
|
+
errors: {
|
|
1893
|
+
description: "",
|
|
1894
|
+
type: "object",
|
|
1895
|
+
default: null
|
|
1896
|
+
},
|
|
1897
|
+
name: {
|
|
1898
|
+
description: "The name string of form group component",
|
|
1899
|
+
type: "string",
|
|
1900
|
+
default: "form group"
|
|
1901
|
+
},
|
|
1902
|
+
showLabelType: {
|
|
1903
|
+
description: "",
|
|
1904
|
+
type: "string",
|
|
1905
|
+
default: "visible"
|
|
1906
|
+
}
|
|
1907
|
+
}, Fr = [
|
|
1908
|
+
"id",
|
|
1909
|
+
"type",
|
|
1910
|
+
"editor"
|
|
1911
|
+
], pn = {
|
|
1912
|
+
$schema: Cr,
|
|
1913
|
+
$id: xr,
|
|
1914
|
+
title: Sr,
|
|
1915
|
+
description: Tr,
|
|
1916
|
+
type: Br,
|
|
1917
|
+
properties: kr,
|
|
1918
|
+
required: Fr
|
|
1919
|
+
}, Ir = {
|
|
1920
|
+
id: { type: String, default: "" },
|
|
1921
|
+
customClass: { type: String, default: "" },
|
|
1922
|
+
customStyle: { type: String, default: "" },
|
|
1923
|
+
/** 筛选组件配置器,具体配置项可查看各组件文档 */
|
|
1924
|
+
editor: { type: Object, default: {} },
|
|
1925
|
+
label: { type: String, default: "" },
|
|
1926
|
+
/** value is uncertain because type is uncertain, default value should not be set */
|
|
1927
|
+
modelValue: { type: [String, Boolean, Array, Number] },
|
|
1928
|
+
// readonly: { type: Boolean, default: false },
|
|
1929
|
+
visible: { type: Boolean, default: !0 },
|
|
1930
|
+
required: { type: Boolean, default: !1 },
|
|
1931
|
+
showLabel: { type: Boolean, default: !0 },
|
|
1932
|
+
/**
|
|
1933
|
+
* visible相当于showLabel为true,none相当于showLabel为false
|
|
1934
|
+
*/
|
|
1935
|
+
showLabelType: { type: String, default: "visible" },
|
|
1936
|
+
type: { type: String, default: "input-group" },
|
|
1937
|
+
componentId: { type: String, default: "" },
|
|
1938
|
+
errors: { type: Object, default: null }
|
|
1939
|
+
};
|
|
1940
|
+
ht(
|
|
1941
|
+
Ir,
|
|
1942
|
+
pn,
|
|
1943
|
+
$t,
|
|
1944
|
+
void 0
|
|
1945
|
+
);
|
|
1946
|
+
h(0);
|
|
1947
|
+
h(0);
|
|
1948
|
+
const Ze = class Ze {
|
|
1949
|
+
/**
|
|
1950
|
+
* 根据绑定字段类型获取可用的输入类控件
|
|
1951
|
+
*/
|
|
1952
|
+
static getEditorTypesByMDataType(t, n = !1, o = "") {
|
|
1953
|
+
if (n)
|
|
1954
|
+
return [{ key: M["language-textbox"].type, value: M["language-textbox"].name }];
|
|
1955
|
+
let r = Ze.fieldControlTypeMapping[t];
|
|
1956
|
+
if (o === "data-grid-column" && (r != null && r.length)) {
|
|
1957
|
+
const i = [M["check-group"].type, M["radio-group"].type];
|
|
1958
|
+
r = r.filter((a) => !i.includes(a.key));
|
|
1959
|
+
}
|
|
1960
|
+
return r;
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* 获取所有输入类控件
|
|
1964
|
+
*/
|
|
1965
|
+
static getAllInputTypes() {
|
|
1966
|
+
const t = [];
|
|
1967
|
+
for (const n in Ze.fieldControlTypeMapping)
|
|
1968
|
+
Ze.fieldControlTypeMapping[n].forEach((o) => {
|
|
1969
|
+
t.find((r) => r.key === o.key && r.value === o.value) || t.push({ key: o.key, value: o.value });
|
|
1970
|
+
});
|
|
1971
|
+
return t;
|
|
1972
|
+
}
|
|
1973
|
+
/**
|
|
1974
|
+
* 提供schema字段基础属性和DOM控件属性的映射
|
|
1975
|
+
* @param control 控件元数据
|
|
1976
|
+
*/
|
|
1977
|
+
static mappingDomPropAndSchemaProp(t, n) {
|
|
1978
|
+
var i;
|
|
1979
|
+
const o = (i = t.editor) == null ? void 0 : i.type, r = [];
|
|
1980
|
+
return (t.type === M["data-grid-column"].type || t.type === M["tree-grid-column"].type) && n && n.categoryId && n.categoryId.indexOf("gridFieldEditor") < 0 && r.push({ domField: "title", schemaField: "name" }), r.push({ domField: "label", schemaField: "name" }), r.push({ domField: "editor.required", schemaField: "require" }), r.push({ domField: "editor.readonly", schemaField: "readonly" }), (o === M["input-group"].type || o === M.textarea.type || o === M["number-spinner"].type) && r.push({ domField: "editor.maxLength", schemaField: "type.length" }), o === M["number-spinner"].type && r.push({ domField: "editor.precision", schemaField: "type.precision" }), (t.type === M["data-grid-column"].type || t.type === M["tree-grid-column"].type) && r.push({ domField: "formatter.precision", schemaField: "type.precision" }), (o === M["combo-list"].type || o === M["radio-group"].type) && r.push({ domField: "editor.data", schemaField: "type.enumValues" }), (t.type === M["data-grid-column"].type || t.type === M["tree-grid-column"].type) && r.push({ domField: "formatter.data", schemaField: "type.enumValues" }), o === M["date-picker"].type && (r.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), r.push({ domField: "editor.fieldType", schemaField: "type.name" })), o === M["number-spinner"].type && (r.push({ domField: "editor.max", schemaField: "editor.maxValue" }), r.push({ domField: "editor.min", schemaField: "editor.minValue" })), o === M.lookup.type && (r.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), r.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), r.push({ domField: "editor.textField", schemaField: "editor.textField" }), r.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), r.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), r.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), r.push({ domField: "path", schemaField: "bindingPath" }), r.push({ domField: "binding.path", schemaField: "bindingField" }), r.push({ domField: "binding.fullPath", schemaField: "path" }), (t.type === M["data-grid-column"].type || t.type === M["tree-grid-column"].type) && r.push({ domField: "field", schemaField: "bindingPath" }), r;
|
|
1981
|
+
}
|
|
1982
|
+
};
|
|
1983
|
+
/**
|
|
1984
|
+
* <字段类型,可配置的控件类型列表>的映射
|
|
1985
|
+
*/
|
|
1986
|
+
ye(Ze, "fieldControlTypeMapping", {
|
|
1987
|
+
String: [
|
|
1988
|
+
{ key: M["input-group"].type, value: M["input-group"].name },
|
|
1989
|
+
{ key: M.lookup.type, value: M.lookup.name },
|
|
1990
|
+
{ key: M["date-picker"].type, value: M["date-picker"].name },
|
|
1991
|
+
{ key: M.switch.type, value: M.switch.name },
|
|
1992
|
+
{ key: M["check-box"].type, value: M["check-box"].name },
|
|
1993
|
+
{ key: M["check-group"].type, value: M["check-group"].name },
|
|
1994
|
+
{ key: M["radio-group"].type, value: M["radio-group"].name },
|
|
1995
|
+
{ key: M["combo-list"].type, value: M["combo-list"].name },
|
|
1996
|
+
{ key: M.textarea.type, value: M.textarea.name },
|
|
1997
|
+
{ key: M["time-picker"].type, value: M["time-picker"].name }
|
|
1998
|
+
],
|
|
1999
|
+
Text: [
|
|
2000
|
+
{ key: M.textarea.type, value: M.textarea.name },
|
|
2001
|
+
{ key: M.lookup.type, value: M.lookup.name }
|
|
2002
|
+
],
|
|
2003
|
+
Decimal: [
|
|
2004
|
+
{ key: M["number-spinner"].type, value: M["number-spinner"].name }
|
|
2005
|
+
],
|
|
2006
|
+
Integer: [
|
|
2007
|
+
{ key: M["number-spinner"].type, value: M["number-spinner"].name }
|
|
2008
|
+
],
|
|
2009
|
+
Number: [
|
|
2010
|
+
{ key: M["number-spinner"].type, value: M["number-spinner"].name },
|
|
2011
|
+
{ key: M.switch.type, value: M.switch.name },
|
|
2012
|
+
{ key: M["check-box"].type, value: M["check-box"].name }
|
|
2013
|
+
],
|
|
2014
|
+
BigNumber: [
|
|
2015
|
+
{ key: M["number-spinner"].type, value: M["number-spinner"].name }
|
|
2016
|
+
],
|
|
2017
|
+
Date: [
|
|
2018
|
+
{ key: M["date-picker"].type, value: M["date-picker"].name }
|
|
2019
|
+
],
|
|
2020
|
+
DateTime: [
|
|
2021
|
+
{ key: M["date-picker"].type, value: M["date-picker"].name }
|
|
2022
|
+
],
|
|
2023
|
+
Boolean: [
|
|
2024
|
+
{ key: M.switch.type, value: M.switch.name },
|
|
2025
|
+
{ key: M["check-box"].type, value: M["check-box"].name }
|
|
2026
|
+
],
|
|
2027
|
+
Enum: [
|
|
2028
|
+
{ key: M["combo-list"].type, value: M["combo-list"].name },
|
|
2029
|
+
{ key: M["radio-group"].type, value: M["radio-group"].name }
|
|
2030
|
+
],
|
|
2031
|
+
Object: [
|
|
2032
|
+
{ key: M.lookup.type, value: M.lookup.name },
|
|
2033
|
+
{ key: M["combo-list"].type, value: M["combo-list"].name },
|
|
2034
|
+
{ key: M["radio-group"].type, value: M["radio-group"].name }
|
|
2035
|
+
]
|
|
2036
|
+
});
|
|
2037
|
+
let Wt = Ze;
|
|
2038
|
+
var De = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2039
|
+
function dt(e) {
|
|
2040
|
+
throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
2041
|
+
}
|
|
2042
|
+
var Er = { exports: {} };
|
|
2043
|
+
(function(e, t) {
|
|
2044
|
+
(function(n) {
|
|
2045
|
+
e.exports = n();
|
|
2046
|
+
})(function() {
|
|
2047
|
+
return (/* @__PURE__ */ function() {
|
|
2048
|
+
function n(o, r, i) {
|
|
2049
|
+
function a(l, m) {
|
|
2050
|
+
if (!r[l]) {
|
|
2051
|
+
if (!o[l]) {
|
|
2052
|
+
var d = typeof dt == "function" && dt;
|
|
2053
|
+
if (!m && d) return d(l, !0);
|
|
2054
|
+
if (u) return u(l, !0);
|
|
2055
|
+
var p = new Error("Cannot find module '" + l + "'");
|
|
2056
|
+
throw p.code = "MODULE_NOT_FOUND", p;
|
|
2057
|
+
}
|
|
2058
|
+
var s = r[l] = { exports: {} };
|
|
2059
|
+
o[l][0].call(s.exports, function(f) {
|
|
2060
|
+
var v = o[l][1][f];
|
|
2061
|
+
return a(v || f);
|
|
2062
|
+
}, s, s.exports, n, o, r, i);
|
|
2063
|
+
}
|
|
2064
|
+
return r[l].exports;
|
|
2065
|
+
}
|
|
2066
|
+
for (var u = typeof dt == "function" && dt, c = 0; c < i.length; c++) a(i[c]);
|
|
2067
|
+
return a;
|
|
2068
|
+
}
|
|
2069
|
+
return n;
|
|
2070
|
+
}())({
|
|
2071
|
+
1: [function(n, o, r) {
|
|
2072
|
+
var i = {}, a = "(?:^|\\s)", u = "(?:\\s|$)";
|
|
2073
|
+
function c(d) {
|
|
2074
|
+
var p = i[d];
|
|
2075
|
+
return p ? p.lastIndex = 0 : i[d] = p = new RegExp(a + d + u, "g"), p;
|
|
2076
|
+
}
|
|
2077
|
+
function l(d, p) {
|
|
2078
|
+
var s = d.className;
|
|
2079
|
+
s.length ? c(p).test(s) || (d.className += " " + p) : d.className = p;
|
|
2080
|
+
}
|
|
2081
|
+
function m(d, p) {
|
|
2082
|
+
d.className = d.className.replace(c(p), " ").trim();
|
|
2083
|
+
}
|
|
2084
|
+
o.exports = {
|
|
2085
|
+
add: l,
|
|
2086
|
+
rm: m
|
|
2087
|
+
};
|
|
2088
|
+
}, {}],
|
|
2089
|
+
2: [function(n, o, r) {
|
|
2090
|
+
(function(i) {
|
|
2091
|
+
var a = n("contra/emitter"), u = n("crossvent"), c = n("./classes"), l = document, m = l.documentElement;
|
|
2092
|
+
function d(b, q) {
|
|
2093
|
+
var V = arguments.length;
|
|
2094
|
+
V === 1 && Array.isArray(b) === !1 && (q = b, b = []);
|
|
2095
|
+
var H, W, J, oe, R, O, U, $, K, me = null, ve, X, ne = !1, le = 0, ee, L = q || {};
|
|
2096
|
+
L.moves === void 0 && (L.moves = E), L.accepts === void 0 && (L.accepts = E), L.invalid === void 0 && (L.invalid = tt), L.containers === void 0 && (L.containers = b || []), L.isContainer === void 0 && (L.isContainer = k), L.copy === void 0 && (L.copy = !1), L.copySortSource === void 0 && (L.copySortSource = !1), L.revertOnSpill === void 0 && (L.revertOnSpill = !1), L.removeOnSpill === void 0 && (L.removeOnSpill = !1), L.direction === void 0 && (L.direction = "vertical"), L.ignoreInputTextSelection === void 0 && (L.ignoreInputTextSelection = !0), L.mirrorContainer === void 0 && (L.mirrorContainer = l.body);
|
|
2097
|
+
var te = a({
|
|
2098
|
+
containers: L.containers,
|
|
2099
|
+
start: Te,
|
|
2100
|
+
end: ze,
|
|
2101
|
+
cancel: B,
|
|
2102
|
+
remove: Je,
|
|
2103
|
+
destroy: Le,
|
|
2104
|
+
canMove: Re,
|
|
2105
|
+
dragging: !1
|
|
2106
|
+
});
|
|
2107
|
+
return L.removeOnSpill === !0 && te.on("over", wt).on("out", Ct), Oe(), te;
|
|
2108
|
+
function He(g) {
|
|
2109
|
+
return te.containers.indexOf(g) !== -1 || L.isContainer(g);
|
|
2110
|
+
}
|
|
2111
|
+
function Oe(g) {
|
|
2112
|
+
var I = g ? "remove" : "add";
|
|
2113
|
+
f(m, I, "mousedown", ie), f(m, I, "mouseup", Ne);
|
|
2114
|
+
}
|
|
2115
|
+
function Se(g) {
|
|
2116
|
+
var I = g ? "remove" : "add";
|
|
2117
|
+
f(m, I, "mousemove", et);
|
|
2118
|
+
}
|
|
2119
|
+
function Ue(g) {
|
|
2120
|
+
var I = g ? "remove" : "add";
|
|
2121
|
+
u[I](m, "selectstart", Xe), u[I](m, "click", Xe);
|
|
2122
|
+
}
|
|
2123
|
+
function Le() {
|
|
2124
|
+
Oe(!0), Ne({});
|
|
2125
|
+
}
|
|
2126
|
+
function Xe(g) {
|
|
2127
|
+
ve && g.preventDefault();
|
|
2128
|
+
}
|
|
2129
|
+
function ie(g) {
|
|
2130
|
+
oe = g.clientX, R = g.clientY;
|
|
2131
|
+
var I = v(g) !== 1 || g.metaKey || g.ctrlKey;
|
|
2132
|
+
if (!I) {
|
|
2133
|
+
var j = g.target, A = Me(j);
|
|
2134
|
+
A && (ve = A, Se(), g.type === "mousedown" && (y(j) ? j.focus() : g.preventDefault()));
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
function et(g) {
|
|
2138
|
+
if (ve) {
|
|
2139
|
+
if (v(g) === 0) {
|
|
2140
|
+
Ne({});
|
|
2141
|
+
return;
|
|
2142
|
+
}
|
|
2143
|
+
if (!(g.clientX !== void 0 && Math.abs(g.clientX - oe) <= (L.slideFactorX || 0) && g.clientY !== void 0 && Math.abs(g.clientY - R) <= (L.slideFactorY || 0))) {
|
|
2144
|
+
if (L.ignoreInputTextSelection) {
|
|
2145
|
+
var I = _("clientX", g) || 0, j = _("clientY", g) || 0, A = l.elementFromPoint(I, j);
|
|
2146
|
+
if (y(A))
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
var Q = ve;
|
|
2150
|
+
Se(!0), Ue(), ze(), je(Q), c.add($ || J, "gu-transit"), St(), xt(), le = 0, Ee(g);
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
function Me(g) {
|
|
2155
|
+
if (!(te.dragging && H) && !He(g)) {
|
|
2156
|
+
for (var I = g; C(g) && He(C(g)) === !1; )
|
|
2157
|
+
if (L.invalid(g, I) || (g = C(g), !g))
|
|
2158
|
+
return;
|
|
2159
|
+
var j = C(g);
|
|
2160
|
+
if (j && !L.invalid(g, I)) {
|
|
2161
|
+
var A = L.moves(g, j, I, T(g));
|
|
2162
|
+
if (A)
|
|
2163
|
+
return {
|
|
2164
|
+
item: g,
|
|
2165
|
+
source: j
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
function Re(g) {
|
|
2171
|
+
return !!Me(g);
|
|
2172
|
+
}
|
|
2173
|
+
function Te(g) {
|
|
2174
|
+
var I = Me(g);
|
|
2175
|
+
I && je(I);
|
|
2176
|
+
}
|
|
2177
|
+
function je(g) {
|
|
2178
|
+
Ot(g.item, g.source) && ($ = g.item.cloneNode(!0), te.emit("cloned", $, g.item, "copy")), W = g.source, J = g.item, O = U = T(g.item), te.dragging = !0, te.emit("drag", J, W);
|
|
2179
|
+
}
|
|
2180
|
+
function tt() {
|
|
2181
|
+
return !1;
|
|
2182
|
+
}
|
|
2183
|
+
function ze() {
|
|
2184
|
+
if (te.dragging) {
|
|
2185
|
+
var g = $ || J;
|
|
2186
|
+
Ye(g, C(g));
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
function Ie() {
|
|
2190
|
+
ve = !1, Se(!0), Ue(!0);
|
|
2191
|
+
}
|
|
2192
|
+
function Ne(g) {
|
|
2193
|
+
if (Ie(), !!te.dragging) {
|
|
2194
|
+
var I = $ || J, j = _("clientX", g) || 0, A = _("clientY", g) || 0, Q = x(H, j, A), Z = se(Q, j, A);
|
|
2195
|
+
Z && ($ && L.copySortSource || !$ || Z !== W) ? Ye(I, Z) : L.removeOnSpill ? Je() : B();
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
function Ye(g, I) {
|
|
2199
|
+
var j = C(g);
|
|
2200
|
+
$ && L.copySortSource && I === W && j.removeChild(J), ae(I) ? te.emit("cancel", g, W) : te.emit("drop", g, I, W, U), Y();
|
|
2201
|
+
}
|
|
2202
|
+
function Je() {
|
|
2203
|
+
if (te.dragging) {
|
|
2204
|
+
var g = $ || J, I = C(g);
|
|
2205
|
+
I && I.removeChild(g), te.emit($ ? "cancel" : "remove", g, I, W), Y();
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
function B(g) {
|
|
2209
|
+
if (te.dragging) {
|
|
2210
|
+
var I = arguments.length > 0 ? g : L.revertOnSpill, j = $ || J, A = C(j), Q = ae(A);
|
|
2211
|
+
Q === !1 && I && ($ ? A && A.removeChild($) : W.insertBefore(j, O)), Q || I ? te.emit("cancel", j, W, W) : te.emit("drop", j, A, W, U), Y();
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
function Y() {
|
|
2215
|
+
var g = $ || J;
|
|
2216
|
+
Ie(), Tt(), Bt(), g && c.rm(g, "gu-transit"), K && clearTimeout(K), te.dragging = !1, me && te.emit("out", g, me, W), te.emit("dragend", g, le), W = J = $ = O = U = K = me = null;
|
|
2217
|
+
}
|
|
2218
|
+
function ae(g, I) {
|
|
2219
|
+
var j;
|
|
2220
|
+
return I !== void 0 ? j = I : H ? j = U : j = T($ || J), g === W && j === O;
|
|
2221
|
+
}
|
|
2222
|
+
function se(g, I, j) {
|
|
2223
|
+
for (var A = g; A && !Q(); )
|
|
2224
|
+
A = C(A);
|
|
2225
|
+
return A;
|
|
2226
|
+
function Q() {
|
|
2227
|
+
var Z = He(A);
|
|
2228
|
+
if (Z === !1)
|
|
2229
|
+
return !1;
|
|
2230
|
+
var Ce = ut(A, g), ge = ct(A, Ce, I, j), he = ae(A, ge);
|
|
2231
|
+
return he ? !0 : L.accepts(J, A, W, ge);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
function Ee(g) {
|
|
2235
|
+
if (!H)
|
|
2236
|
+
return;
|
|
2237
|
+
g.preventDefault();
|
|
2238
|
+
var I = _("clientX", g) || 0, j = _("clientY", g) || 0;
|
|
2239
|
+
H.style.left = I - 2 + "px", H.style.top = j - 2 + "px";
|
|
2240
|
+
var A = $ || J, Q = x(H, I, j), Z = se(Q, I, j), Ce = Z !== null && Z !== me;
|
|
2241
|
+
(Ce || Z === null) && (be(), me = Z, ke()), Et(Q, j);
|
|
2242
|
+
var ge = C(A);
|
|
2243
|
+
if (Z === W && $ && !L.copySortSource) {
|
|
2244
|
+
ge && ge.removeChild(A);
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
var he, Be = ut(Z, Q);
|
|
2248
|
+
if (ne = nt(Be, Z), Be !== null)
|
|
2249
|
+
he = ct(Z, Be, I, j);
|
|
2250
|
+
else if (L.revertOnSpill === !0 && !$)
|
|
2251
|
+
he = O, Z = W;
|
|
2252
|
+
else {
|
|
2253
|
+
$ && ge && ge.removeChild(A), $ && X && (X.style.display = "none");
|
|
2254
|
+
return;
|
|
2255
|
+
}
|
|
2256
|
+
X.style.display = "block", bt(he, A, Ce), he ? Ft(Be, he) : It(Z);
|
|
2257
|
+
function ue(fe) {
|
|
2258
|
+
te.emit(fe, A, me, W);
|
|
2259
|
+
}
|
|
2260
|
+
function ke() {
|
|
2261
|
+
Ce && ue("over");
|
|
2262
|
+
}
|
|
2263
|
+
function be() {
|
|
2264
|
+
me && ue("out");
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
function bt(g, I, j) {
|
|
2268
|
+
(g === I || g === T(I)) && (U = T(I)), (g === null && j || g !== I && g !== T(I)) && (U = g);
|
|
2269
|
+
}
|
|
2270
|
+
function wt(g) {
|
|
2271
|
+
c.rm(g, "gu-hide");
|
|
2272
|
+
}
|
|
2273
|
+
function Ct(g) {
|
|
2274
|
+
te.dragging && c.add(g, "gu-hide");
|
|
2275
|
+
}
|
|
2276
|
+
function xt() {
|
|
2277
|
+
H || (H = document.createElement("div"), H.style = "background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;", H.innerHTML = L.getMirrorText && L.getMirrorText(J) || "控件", c.add(H, "gu-mirror"), L.mirrorContainer.appendChild(H), f(m, "add", "mousemove", Ee), c.add(L.mirrorContainer, "gu-unselectable"), te.emit("cloned", H, J, "mirror"));
|
|
2278
|
+
}
|
|
2279
|
+
function St() {
|
|
2280
|
+
if (X = document.createElement("div"), c.add(X, "gu-insertion"), J) {
|
|
2281
|
+
var g = J.getBoundingClientRect();
|
|
2282
|
+
X.style.left = g.left + "px", X.style.top = g.top + "px";
|
|
2283
|
+
}
|
|
2284
|
+
ne = !1, L.mirrorContainer.appendChild(X);
|
|
2285
|
+
}
|
|
2286
|
+
function Tt() {
|
|
2287
|
+
H && (c.rm(L.mirrorContainer, "gu-unselectable"), f(m, "remove", "mousemove", Ee), C(H).removeChild(H), H = null);
|
|
2288
|
+
}
|
|
2289
|
+
function Bt() {
|
|
2290
|
+
X && (C(X).removeChild(X), X = null);
|
|
2291
|
+
}
|
|
2292
|
+
function ut(g, I) {
|
|
2293
|
+
for (var j = I; j !== g && C(j) !== g; )
|
|
2294
|
+
j = C(j);
|
|
2295
|
+
return j === m ? null : j;
|
|
2296
|
+
}
|
|
2297
|
+
function nt(g, I) {
|
|
2298
|
+
if (!I)
|
|
2299
|
+
return ne;
|
|
2300
|
+
var j = g || I && I.lastElementChild;
|
|
2301
|
+
if (!j)
|
|
2302
|
+
return !0;
|
|
2303
|
+
var A = getComputedStyle(g), Q = /^inline/.test(A.getPropertyValue("display")) || /^(left|right)$/.test(A.getPropertyValue("float"));
|
|
2304
|
+
if (Q)
|
|
2305
|
+
return !0;
|
|
2306
|
+
if (I) {
|
|
2307
|
+
var Z = getComputedStyle(I), Ce = Z.getPropertyValue("display");
|
|
2308
|
+
if (/flex$/.test(Ce)) {
|
|
2309
|
+
var ge = Z.getPropertyValue("flex-direction") || "row";
|
|
2310
|
+
if (ge === "row" || ge === "row-reverse")
|
|
2311
|
+
return !kt(I);
|
|
2312
|
+
}
|
|
2313
|
+
return !1;
|
|
2314
|
+
}
|
|
2315
|
+
return !0;
|
|
2316
|
+
}
|
|
2317
|
+
function kt(g) {
|
|
2318
|
+
if (!g.children || !g.children.length)
|
|
2319
|
+
return !1;
|
|
2320
|
+
for (const I of Array.from(g.children)) {
|
|
2321
|
+
const A = (I.className && I.className.split(" ") || []).filter((Q) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Q));
|
|
2322
|
+
if (!A.length)
|
|
2323
|
+
return !1;
|
|
2324
|
+
for (const Q of A) {
|
|
2325
|
+
const Z = Q.slice(Q.lastIndexOf("-") + 1);
|
|
2326
|
+
if (parseInt(Z, 10) !== 12)
|
|
2327
|
+
return !1;
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
return !0;
|
|
2331
|
+
}
|
|
2332
|
+
function Ft(g, I) {
|
|
2333
|
+
const j = I.getBoundingClientRect();
|
|
2334
|
+
if (X.style.left = j.left + "px", X.style.top = j.top + "px", ne) {
|
|
2335
|
+
if (X.style.height = j.height + "px", X.style.width = "4px", g) {
|
|
2336
|
+
const A = g.getBoundingClientRect();
|
|
2337
|
+
A.top !== j.top && (X.style.left = A.right + "px", X.style.top = A.top + "px", X.style.height = A.height + "px");
|
|
2338
|
+
}
|
|
2339
|
+
} else if (X.style.height = "4px", X.style.width = j.width + "px", ee) {
|
|
2340
|
+
const A = ee.getBoundingClientRect();
|
|
2341
|
+
j.top < A.top && (X.style.display = "none");
|
|
2342
|
+
}
|
|
2343
|
+
I === J && J && (X.style.display = "none");
|
|
2344
|
+
}
|
|
2345
|
+
function It(g) {
|
|
2346
|
+
U = null;
|
|
2347
|
+
var I = g.lastElementChild;
|
|
2348
|
+
if (I) {
|
|
2349
|
+
var j = I.getBoundingClientRect();
|
|
2350
|
+
ne ? (X.style.left = j.right + "px", X.style.top = j.top + "px", X.style.height = j.height + "px", X.style.width = "4px") : (X.style.left = j.left + "px", X.style.top = j.bottom + "px", X.style.height = "4px", X.style.width = j.width + "px"), I === J && J && (X.style.display = "none");
|
|
2351
|
+
} else
|
|
2352
|
+
X.style.display = "none";
|
|
2353
|
+
}
|
|
2354
|
+
function Et(g, I) {
|
|
2355
|
+
if (!L.mirrorContainer.contains(g) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (ee = p(g), !ee || !ee.contains(g)))
|
|
2356
|
+
return;
|
|
2357
|
+
const j = document.querySelector(".dgComponentSelected"), A = ee.getBoundingClientRect();
|
|
2358
|
+
if (I - 30 < A.top && ee.scrollTop > 0) {
|
|
2359
|
+
let Q = ee.scrollTop < 10 ? ee.scrollTop : 10;
|
|
2360
|
+
ee.scrollBy(0, -1 * Q), j && ee.contains(j) && (le = le + -1 * Q);
|
|
2361
|
+
}
|
|
2362
|
+
if (I + 30 > A.bottom && ee.scrollTop < ee.scrollHeight - ee.clientHeight) {
|
|
2363
|
+
const Q = ee.scrollHeight - ee.clientHeight - ee.scrollTop;
|
|
2364
|
+
let Z = Q < 10 ? Q : 10;
|
|
2365
|
+
ee.scrollBy(0, Z), j && ee.contains(j) && (le = le + Z);
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
function ct(g, I, j, A) {
|
|
2369
|
+
var Q = L.direction === "horizontal", Z = L.direction === "mixed", Ce = I !== g ? he() : ge();
|
|
2370
|
+
return Ce;
|
|
2371
|
+
function ge() {
|
|
2372
|
+
var ue = g.children.length, ke, be, fe;
|
|
2373
|
+
for (ke = 0; ke < ue; ke++)
|
|
2374
|
+
if (be = g.children[ke], fe = be.getBoundingClientRect(), Q && fe.left + fe.width / 2 > j || !Z && !Q && fe.top + fe.height / 2 > A || Z && fe.left + fe.width > j && fe.top + fe.height > A)
|
|
2375
|
+
return be;
|
|
2376
|
+
return null;
|
|
2377
|
+
}
|
|
2378
|
+
function he() {
|
|
2379
|
+
var ue = I.getBoundingClientRect();
|
|
2380
|
+
if (Z) {
|
|
2381
|
+
var ke = A - ue.top, be = j - ue.left, fe = ue.bottom - A, ot = ue.right - j, rt = Math.min(be, ot, ke, fe), it;
|
|
2382
|
+
return ne ? it = ot < be : it = fe === rt || ot === rt || be === rt, Be(it);
|
|
2383
|
+
}
|
|
2384
|
+
return Be(Q ? j > ue.left + z(ue) / 2 : A > ue.top + N(ue) / 2);
|
|
2385
|
+
}
|
|
2386
|
+
function Be(ue) {
|
|
2387
|
+
return ue ? T(I) : I;
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
function Ot(g, I) {
|
|
2391
|
+
return typeof L.copy == "boolean" ? L.copy : L.copy(g, I);
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
function p(b) {
|
|
2395
|
+
const q = Array.from(window.scrollContainerList);
|
|
2396
|
+
if (q.length === 1) {
|
|
2397
|
+
const H = Array.from(window.scrollContainerList)[0];
|
|
2398
|
+
return document.getElementById(H);
|
|
2399
|
+
}
|
|
2400
|
+
const V = s(q);
|
|
2401
|
+
for (const H of V)
|
|
2402
|
+
if (H.contains(b))
|
|
2403
|
+
return H;
|
|
2404
|
+
return null;
|
|
2405
|
+
}
|
|
2406
|
+
function s(b) {
|
|
2407
|
+
const q = [];
|
|
2408
|
+
return b.forEach((V) => {
|
|
2409
|
+
const H = document.getElementById(V);
|
|
2410
|
+
H && q.push(H);
|
|
2411
|
+
}), q.sort((V, H) => V.contains(H) ? 1 : H.contains(V) ? -1 : 0), q;
|
|
2412
|
+
}
|
|
2413
|
+
function f(b, q, V, H) {
|
|
2414
|
+
var W = {
|
|
2415
|
+
mouseup: "touchend",
|
|
2416
|
+
mousedown: "touchstart",
|
|
2417
|
+
mousemove: "touchmove"
|
|
2418
|
+
}, J = {
|
|
2419
|
+
mouseup: "pointerup",
|
|
2420
|
+
mousedown: "pointerdown",
|
|
2421
|
+
mousemove: "pointermove"
|
|
2422
|
+
}, oe = {
|
|
2423
|
+
mouseup: "MSPointerUp",
|
|
2424
|
+
mousedown: "MSPointerDown",
|
|
2425
|
+
mousemove: "MSPointerMove"
|
|
2426
|
+
};
|
|
2427
|
+
i.navigator.pointerEnabled ? u[q](b, J[V], H) : i.navigator.msPointerEnabled ? u[q](b, oe[V], H) : (u[q](b, W[V], H), u[q](b, V, H));
|
|
2428
|
+
}
|
|
2429
|
+
function v(b) {
|
|
2430
|
+
if (b.touches !== void 0)
|
|
2431
|
+
return b.touches.length;
|
|
2432
|
+
if (b.which !== void 0 && b.which !== 0)
|
|
2433
|
+
return b.which;
|
|
2434
|
+
if (b.buttons !== void 0)
|
|
2435
|
+
return b.buttons;
|
|
2436
|
+
var q = b.button;
|
|
2437
|
+
if (q !== void 0)
|
|
2438
|
+
return q & 1 ? 1 : q & 2 ? 3 : q & 4 ? 2 : 0;
|
|
2439
|
+
}
|
|
2440
|
+
function x(b, q, V) {
|
|
2441
|
+
b = b || {};
|
|
2442
|
+
var H = b.className || "", W;
|
|
2443
|
+
return b.className += " gu-hide", W = l.elementFromPoint(q, V), b.className = H, W;
|
|
2444
|
+
}
|
|
2445
|
+
function k() {
|
|
2446
|
+
return !1;
|
|
2447
|
+
}
|
|
2448
|
+
function E() {
|
|
2449
|
+
return !0;
|
|
2450
|
+
}
|
|
2451
|
+
function z(b) {
|
|
2452
|
+
return b.width || b.right - b.left;
|
|
2453
|
+
}
|
|
2454
|
+
function N(b) {
|
|
2455
|
+
return b.height || b.bottom - b.top;
|
|
2456
|
+
}
|
|
2457
|
+
function C(b) {
|
|
2458
|
+
return b.parentNode === l ? null : b.parentNode;
|
|
2459
|
+
}
|
|
2460
|
+
function y(b) {
|
|
2461
|
+
return b.tagName === "INPUT" || b.tagName === "TEXTAREA" || b.tagName === "SELECT" || S(b);
|
|
2462
|
+
}
|
|
2463
|
+
function S(b) {
|
|
2464
|
+
return !b || b.contentEditable === "false" ? !1 : b.contentEditable === "true" ? !0 : S(C(b));
|
|
2465
|
+
}
|
|
2466
|
+
function T(b) {
|
|
2467
|
+
return b.nextElementSibling || q();
|
|
2468
|
+
function q() {
|
|
2469
|
+
var V = b;
|
|
2470
|
+
do
|
|
2471
|
+
V = V.nextSibling;
|
|
2472
|
+
while (V && V.nodeType !== 1);
|
|
2473
|
+
return V;
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
function F(b) {
|
|
2477
|
+
return b.targetTouches && b.targetTouches.length ? b.targetTouches[0] : b.changedTouches && b.changedTouches.length ? b.changedTouches[0] : b;
|
|
2478
|
+
}
|
|
2479
|
+
function _(b, q) {
|
|
2480
|
+
var V = F(q), H = {
|
|
2481
|
+
pageX: "clientX",
|
|
2482
|
+
// IE8
|
|
2483
|
+
pageY: "clientY"
|
|
2484
|
+
// IE8
|
|
2485
|
+
};
|
|
2486
|
+
return b in H && !(b in V) && H[b] in V && (b = H[b]), V[b];
|
|
2487
|
+
}
|
|
2488
|
+
o.exports = d;
|
|
2489
|
+
}).call(this, typeof De < "u" ? De : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2490
|
+
}, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
|
|
2491
|
+
3: [function(n, o, r) {
|
|
2492
|
+
o.exports = function(a, u) {
|
|
2493
|
+
return Array.prototype.slice.call(a, u);
|
|
2494
|
+
};
|
|
2495
|
+
}, {}],
|
|
2496
|
+
4: [function(n, o, r) {
|
|
2497
|
+
var i = n("ticky");
|
|
2498
|
+
o.exports = function(u, c, l) {
|
|
2499
|
+
u && i(function() {
|
|
2500
|
+
u.apply(l || null, c || []);
|
|
2501
|
+
});
|
|
2502
|
+
};
|
|
2503
|
+
}, { ticky: 10 }],
|
|
2504
|
+
5: [function(n, o, r) {
|
|
2505
|
+
var i = n("atoa"), a = n("./debounce");
|
|
2506
|
+
o.exports = function(c, l) {
|
|
2507
|
+
var m = l || {}, d = {};
|
|
2508
|
+
return c === void 0 && (c = {}), c.on = function(p, s) {
|
|
2509
|
+
return d[p] ? d[p].push(s) : d[p] = [s], c;
|
|
2510
|
+
}, c.once = function(p, s) {
|
|
2511
|
+
return s._once = !0, c.on(p, s), c;
|
|
2512
|
+
}, c.off = function(p, s) {
|
|
2513
|
+
var f = arguments.length;
|
|
2514
|
+
if (f === 1)
|
|
2515
|
+
delete d[p];
|
|
2516
|
+
else if (f === 0)
|
|
2517
|
+
d = {};
|
|
2518
|
+
else {
|
|
2519
|
+
var v = d[p];
|
|
2520
|
+
if (!v)
|
|
2521
|
+
return c;
|
|
2522
|
+
v.splice(v.indexOf(s), 1);
|
|
2523
|
+
}
|
|
2524
|
+
return c;
|
|
2525
|
+
}, c.emit = function() {
|
|
2526
|
+
var p = i(arguments);
|
|
2527
|
+
return c.emitterSnapshot(p.shift()).apply(this, p);
|
|
2528
|
+
}, c.emitterSnapshot = function(p) {
|
|
2529
|
+
var s = (d[p] || []).slice(0);
|
|
2530
|
+
return function() {
|
|
2531
|
+
var f = i(arguments), v = this || c;
|
|
2532
|
+
if (p === "error" && m.throws !== !1 && !s.length)
|
|
2533
|
+
throw f.length === 1 ? f[0] : f;
|
|
2534
|
+
return s.forEach(function(k) {
|
|
2535
|
+
m.async ? a(k, f, v) : k.apply(v, f), k._once && c.off(p, k);
|
|
2536
|
+
}), c;
|
|
2537
|
+
};
|
|
2538
|
+
}, c;
|
|
2539
|
+
};
|
|
2540
|
+
}, { "./debounce": 4, atoa: 3 }],
|
|
2541
|
+
6: [function(n, o, r) {
|
|
2542
|
+
(function(i) {
|
|
2543
|
+
var a = n("custom-event"), u = n("./eventmap"), c = i.document, l = p, m = f, d = [];
|
|
2544
|
+
i.addEventListener || (l = s, m = v), o.exports = {
|
|
2545
|
+
add: l,
|
|
2546
|
+
remove: m,
|
|
2547
|
+
fabricate: x
|
|
2548
|
+
};
|
|
2549
|
+
function p(C, y, S, T) {
|
|
2550
|
+
return C.addEventListener(y, S, T);
|
|
2551
|
+
}
|
|
2552
|
+
function s(C, y, S) {
|
|
2553
|
+
return C.attachEvent("on" + y, E(C, y, S));
|
|
2554
|
+
}
|
|
2555
|
+
function f(C, y, S, T) {
|
|
2556
|
+
return C.removeEventListener(y, S, T);
|
|
2557
|
+
}
|
|
2558
|
+
function v(C, y, S) {
|
|
2559
|
+
var T = z(C, y, S);
|
|
2560
|
+
if (T)
|
|
2561
|
+
return C.detachEvent("on" + y, T);
|
|
2562
|
+
}
|
|
2563
|
+
function x(C, y, S) {
|
|
2564
|
+
var T = u.indexOf(y) === -1 ? _() : F();
|
|
2565
|
+
C.dispatchEvent ? C.dispatchEvent(T) : C.fireEvent("on" + y, T);
|
|
2566
|
+
function F() {
|
|
2567
|
+
var b;
|
|
2568
|
+
return c.createEvent ? (b = c.createEvent("Event"), b.initEvent(y, !0, !0)) : c.createEventObject && (b = c.createEventObject()), b;
|
|
2569
|
+
}
|
|
2570
|
+
function _() {
|
|
2571
|
+
return new a(y, { detail: S });
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
function k(C, y, S) {
|
|
2575
|
+
return function(F) {
|
|
2576
|
+
var _ = F || i.event;
|
|
2577
|
+
_.target = _.target || _.srcElement, _.preventDefault = _.preventDefault || function() {
|
|
2578
|
+
_.returnValue = !1;
|
|
2579
|
+
}, _.stopPropagation = _.stopPropagation || function() {
|
|
2580
|
+
_.cancelBubble = !0;
|
|
2581
|
+
}, _.which = _.which || _.keyCode, S.call(C, _);
|
|
2582
|
+
};
|
|
2583
|
+
}
|
|
2584
|
+
function E(C, y, S) {
|
|
2585
|
+
var T = z(C, y, S) || k(C, y, S);
|
|
2586
|
+
return d.push({
|
|
2587
|
+
wrapper: T,
|
|
2588
|
+
element: C,
|
|
2589
|
+
type: y,
|
|
2590
|
+
fn: S
|
|
2591
|
+
}), T;
|
|
2592
|
+
}
|
|
2593
|
+
function z(C, y, S) {
|
|
2594
|
+
var T = N(C, y, S);
|
|
2595
|
+
if (T) {
|
|
2596
|
+
var F = d[T].wrapper;
|
|
2597
|
+
return d.splice(T, 1), F;
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
function N(C, y, S) {
|
|
2601
|
+
var T, F;
|
|
2602
|
+
for (T = 0; T < d.length; T++)
|
|
2603
|
+
if (F = d[T], F.element === C && F.type === y && F.fn === S)
|
|
2604
|
+
return T;
|
|
2605
|
+
}
|
|
2606
|
+
}).call(this, typeof De < "u" ? De : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2607
|
+
}, { "./eventmap": 7, "custom-event": 8 }],
|
|
2608
|
+
7: [function(n, o, r) {
|
|
2609
|
+
(function(i) {
|
|
2610
|
+
var a = [], u = "", c = /^on/;
|
|
2611
|
+
for (u in i)
|
|
2612
|
+
c.test(u) && a.push(u.slice(2));
|
|
2613
|
+
o.exports = a;
|
|
2614
|
+
}).call(this, typeof De < "u" ? De : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2615
|
+
}, {}],
|
|
2616
|
+
8: [function(n, o, r) {
|
|
2617
|
+
(function(i) {
|
|
2618
|
+
var a = i.CustomEvent;
|
|
2619
|
+
function u() {
|
|
2620
|
+
try {
|
|
2621
|
+
var c = new a("cat", { detail: { foo: "bar" } });
|
|
2622
|
+
return c.type === "cat" && c.detail.foo === "bar";
|
|
2623
|
+
} catch {
|
|
2624
|
+
}
|
|
2625
|
+
return !1;
|
|
2626
|
+
}
|
|
2627
|
+
o.exports = u() ? a : (
|
|
2628
|
+
// IE >= 9
|
|
2629
|
+
typeof document < "u" && typeof document.createEvent == "function" ? function(l, m) {
|
|
2630
|
+
var d = document.createEvent("CustomEvent");
|
|
2631
|
+
return m ? d.initCustomEvent(l, m.bubbles, m.cancelable, m.detail) : d.initCustomEvent(l, !1, !1, void 0), d;
|
|
2632
|
+
} : (
|
|
2633
|
+
// IE <= 8
|
|
2634
|
+
function(l, m) {
|
|
2635
|
+
var d = document.createEventObject();
|
|
2636
|
+
return d.type = l, m ? (d.bubbles = !!m.bubbles, d.cancelable = !!m.cancelable, d.detail = m.detail) : (d.bubbles = !1, d.cancelable = !1, d.detail = void 0), d;
|
|
2637
|
+
}
|
|
2638
|
+
)
|
|
2639
|
+
);
|
|
2640
|
+
}).call(this, typeof De < "u" ? De : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2641
|
+
}, {}],
|
|
2642
|
+
9: [function(n, o, r) {
|
|
2643
|
+
var i = o.exports = {}, a, u;
|
|
2644
|
+
function c() {
|
|
2645
|
+
throw new Error("setTimeout has not been defined");
|
|
2646
|
+
}
|
|
2647
|
+
function l() {
|
|
2648
|
+
throw new Error("clearTimeout has not been defined");
|
|
2649
|
+
}
|
|
2650
|
+
(function() {
|
|
2651
|
+
try {
|
|
2652
|
+
typeof setTimeout == "function" ? a = setTimeout : a = c;
|
|
2653
|
+
} catch {
|
|
2654
|
+
a = c;
|
|
2655
|
+
}
|
|
2656
|
+
try {
|
|
2657
|
+
typeof clearTimeout == "function" ? u = clearTimeout : u = l;
|
|
2658
|
+
} catch {
|
|
2659
|
+
u = l;
|
|
2660
|
+
}
|
|
2661
|
+
})();
|
|
2662
|
+
function m(N) {
|
|
2663
|
+
if (a === setTimeout)
|
|
2664
|
+
return setTimeout(N, 0);
|
|
2665
|
+
if ((a === c || !a) && setTimeout)
|
|
2666
|
+
return a = setTimeout, setTimeout(N, 0);
|
|
2667
|
+
try {
|
|
2668
|
+
return a(N, 0);
|
|
2669
|
+
} catch {
|
|
2670
|
+
try {
|
|
2671
|
+
return a.call(null, N, 0);
|
|
2672
|
+
} catch {
|
|
2673
|
+
return a.call(this, N, 0);
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
function d(N) {
|
|
2678
|
+
if (u === clearTimeout)
|
|
2679
|
+
return clearTimeout(N);
|
|
2680
|
+
if ((u === l || !u) && clearTimeout)
|
|
2681
|
+
return u = clearTimeout, clearTimeout(N);
|
|
2682
|
+
try {
|
|
2683
|
+
return u(N);
|
|
2684
|
+
} catch {
|
|
2685
|
+
try {
|
|
2686
|
+
return u.call(null, N);
|
|
2687
|
+
} catch {
|
|
2688
|
+
return u.call(this, N);
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
var p = [], s = !1, f, v = -1;
|
|
2693
|
+
function x() {
|
|
2694
|
+
!s || !f || (s = !1, f.length ? p = f.concat(p) : v = -1, p.length && k());
|
|
2695
|
+
}
|
|
2696
|
+
function k() {
|
|
2697
|
+
if (!s) {
|
|
2698
|
+
var N = m(x);
|
|
2699
|
+
s = !0;
|
|
2700
|
+
for (var C = p.length; C; ) {
|
|
2701
|
+
for (f = p, p = []; ++v < C; )
|
|
2702
|
+
f && f[v].run();
|
|
2703
|
+
v = -1, C = p.length;
|
|
2704
|
+
}
|
|
2705
|
+
f = null, s = !1, d(N);
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
i.nextTick = function(N) {
|
|
2709
|
+
var C = new Array(arguments.length - 1);
|
|
2710
|
+
if (arguments.length > 1)
|
|
2711
|
+
for (var y = 1; y < arguments.length; y++)
|
|
2712
|
+
C[y - 1] = arguments[y];
|
|
2713
|
+
p.push(new E(N, C)), p.length === 1 && !s && m(k);
|
|
2714
|
+
};
|
|
2715
|
+
function E(N, C) {
|
|
2716
|
+
this.fun = N, this.array = C;
|
|
2717
|
+
}
|
|
2718
|
+
E.prototype.run = function() {
|
|
2719
|
+
this.fun.apply(null, this.array);
|
|
2720
|
+
}, i.title = "browser", i.browser = !0, i.env = {}, i.argv = [], i.version = "", i.versions = {};
|
|
2721
|
+
function z() {
|
|
2722
|
+
}
|
|
2723
|
+
i.on = z, i.addListener = z, i.once = z, i.off = z, i.removeListener = z, i.removeAllListeners = z, i.emit = z, i.prependListener = z, i.prependOnceListener = z, i.listeners = function(N) {
|
|
2724
|
+
return [];
|
|
2725
|
+
}, i.binding = function(N) {
|
|
2726
|
+
throw new Error("process.binding is not supported");
|
|
2727
|
+
}, i.cwd = function() {
|
|
2728
|
+
return "/";
|
|
2729
|
+
}, i.chdir = function(N) {
|
|
2730
|
+
throw new Error("process.chdir is not supported");
|
|
2731
|
+
}, i.umask = function() {
|
|
2732
|
+
return 0;
|
|
2733
|
+
};
|
|
2734
|
+
}, {}],
|
|
2735
|
+
10: [function(n, o, r) {
|
|
2736
|
+
(function(i) {
|
|
2737
|
+
var a = typeof i == "function", u;
|
|
2738
|
+
a ? u = function(c) {
|
|
2739
|
+
i(c);
|
|
2740
|
+
} : u = function(c) {
|
|
2741
|
+
setTimeout(c, 0);
|
|
2742
|
+
}, o.exports = u;
|
|
2743
|
+
}).call(this, n("timers").setImmediate);
|
|
2744
|
+
}, { timers: 11 }],
|
|
2745
|
+
11: [function(n, o, r) {
|
|
2746
|
+
(function(i, a) {
|
|
2747
|
+
var u = n("process/browser.js").nextTick, c = Function.prototype.apply, l = Array.prototype.slice, m = {}, d = 0;
|
|
2748
|
+
r.setTimeout = function() {
|
|
2749
|
+
return new p(c.call(setTimeout, window, arguments), clearTimeout);
|
|
2750
|
+
}, r.setInterval = function() {
|
|
2751
|
+
return new p(c.call(setInterval, window, arguments), clearInterval);
|
|
2752
|
+
}, r.clearTimeout = r.clearInterval = function(s) {
|
|
2753
|
+
s.close();
|
|
2754
|
+
};
|
|
2755
|
+
function p(s, f) {
|
|
2756
|
+
this._id = s, this._clearFn = f;
|
|
2757
|
+
}
|
|
2758
|
+
p.prototype.unref = p.prototype.ref = function() {
|
|
2759
|
+
}, p.prototype.close = function() {
|
|
2760
|
+
this._clearFn.call(window, this._id);
|
|
2761
|
+
}, r.enroll = function(s, f) {
|
|
2762
|
+
clearTimeout(s._idleTimeoutId), s._idleTimeout = f;
|
|
2763
|
+
}, r.unenroll = function(s) {
|
|
2764
|
+
clearTimeout(s._idleTimeoutId), s._idleTimeout = -1;
|
|
2765
|
+
}, r._unrefActive = r.active = function(s) {
|
|
2766
|
+
clearTimeout(s._idleTimeoutId);
|
|
2767
|
+
var f = s._idleTimeout;
|
|
2768
|
+
f >= 0 && (s._idleTimeoutId = setTimeout(function() {
|
|
2769
|
+
s._onTimeout && s._onTimeout();
|
|
2770
|
+
}, f));
|
|
2771
|
+
}, r.setImmediate = typeof i == "function" ? i : function(s) {
|
|
2772
|
+
var f = d++, v = arguments.length < 2 ? !1 : l.call(arguments, 1);
|
|
2773
|
+
return m[f] = !0, u(function() {
|
|
2774
|
+
m[f] && (v ? s.apply(null, v) : s.call(null), r.clearImmediate(f));
|
|
2775
|
+
}), f;
|
|
2776
|
+
}, r.clearImmediate = typeof a == "function" ? a : function(s) {
|
|
2777
|
+
delete m[s];
|
|
2778
|
+
};
|
|
2779
|
+
}).call(this, n("timers").setImmediate, n("timers").clearImmediate);
|
|
2780
|
+
}, { "process/browser.js": 9, timers: 11 }]
|
|
2781
|
+
}, {}, [2])(2);
|
|
2782
|
+
});
|
|
2783
|
+
})(Er);
|
|
2784
|
+
const Or = {
|
|
2785
|
+
showCloseButton: { type: Boolean, default: !0 },
|
|
2786
|
+
position: { type: String, default: "top-center" },
|
|
2787
|
+
timeout: { type: Number, default: 3e3 },
|
|
2788
|
+
theme: { type: String, default: "bootstrap" },
|
|
2789
|
+
left: { type: Number },
|
|
2790
|
+
right: { type: Number },
|
|
2791
|
+
top: { type: Number },
|
|
2792
|
+
bottom: { type: Number },
|
|
2793
|
+
id: { type: String },
|
|
2794
|
+
animate: { type: String, default: "fadeIn" },
|
|
2795
|
+
options: { type: Object },
|
|
2796
|
+
safeHtml: { type: Boolean, default: !0 }
|
|
2797
|
+
}, Mr = {
|
|
2798
|
+
showCloseButton: { type: Boolean, default: !0 },
|
|
2799
|
+
animate: { type: String, default: "fadeIn" },
|
|
2800
|
+
options: { type: Object }
|
|
2801
|
+
}, jt = /* @__PURE__ */ Ge({
|
|
2802
|
+
name: "Toast",
|
|
2803
|
+
props: Mr,
|
|
2804
|
+
emits: ["close", "click"],
|
|
2805
|
+
setup: (e, t) => {
|
|
2806
|
+
const {
|
|
2807
|
+
locale: n,
|
|
2808
|
+
t: o
|
|
2809
|
+
} = Dt(), r = h(e.animate), i = "fadeOut", a = D(() => e.options), u = h(!1), c = D(() => a.value.title && a.value.message), l = D(() => !a.value.title && a.value.message), m = D(() => {
|
|
2810
|
+
const N = {
|
|
2811
|
+
animated: u.value,
|
|
2812
|
+
toast: !0,
|
|
2813
|
+
"toast--only-content": !c.value
|
|
2814
|
+
};
|
|
2815
|
+
return N[e.animate] = !1, N[i] = u.value, N["toasty-type-" + a.value.type] = !0, a.value.theme && (N[a.value.theme] = !0), N;
|
|
2816
|
+
}), d = D(() => {
|
|
2817
|
+
const y = `f-icon-${a.value && a.value.type ? a.value.type.replace("toasty-type-", "") : "default"}`, S = {
|
|
2818
|
+
"f-icon": !0
|
|
2819
|
+
};
|
|
2820
|
+
return S[y] = !0, S;
|
|
2821
|
+
}), p = D(() => a.value.title || a.value.message), s = D(() => e.showCloseButton), f = D(() => !!a.value.buttons || !!t.slots.default), v = D(() => n.value === "en" ? {
|
|
2822
|
+
wordBreak: "keep-all",
|
|
2823
|
+
overflowWrap: "break-word"
|
|
2824
|
+
} : {});
|
|
2825
|
+
function x(N) {
|
|
2826
|
+
N.stopPropagation(), N.preventDefault(), u.value = !1, setTimeout(() => {
|
|
2827
|
+
t.emit("close", a.value);
|
|
2828
|
+
}, 200);
|
|
2829
|
+
}
|
|
2830
|
+
function k(N, C) {
|
|
2831
|
+
}
|
|
2832
|
+
function E(N) {
|
|
2833
|
+
return `f-preten-link ${N.customClass ? N.customClass : ""}`;
|
|
2834
|
+
}
|
|
2835
|
+
xe(r, () => {
|
|
2836
|
+
r.value;
|
|
2837
|
+
});
|
|
2838
|
+
const z = () => {
|
|
2839
|
+
var N;
|
|
2840
|
+
return w(at, null, [w("div", {
|
|
2841
|
+
class: "after-toast-msg text-right"
|
|
2842
|
+
}, [!t.slots.default && ((N = a.value.buttons) == null ? void 0 : N.map((C) => w("span", {
|
|
2843
|
+
class: E(C),
|
|
2844
|
+
onClick: (y) => void 0
|
|
2845
|
+
}, [C.text]))), t.slots.default && t.slots.default()])]);
|
|
2846
|
+
};
|
|
2847
|
+
return () => w("div", {
|
|
2848
|
+
class: m.value,
|
|
2849
|
+
style: "min-height:44px"
|
|
2850
|
+
}, [s.value && w("button", {
|
|
2851
|
+
title: o("messageBox.close"),
|
|
2852
|
+
class: "toast-close f-btn-icon f-bare",
|
|
2853
|
+
onClick: x
|
|
2854
|
+
}, [w("span", {
|
|
2855
|
+
class: "f-icon modal_close"
|
|
2856
|
+
}, null)]), p.value && w("section", {
|
|
2857
|
+
class: "modal-tips"
|
|
2858
|
+
}, [!c.value && w("div", {
|
|
2859
|
+
class: "float-left modal-tips-iconwrap"
|
|
2860
|
+
}, [w("span", {
|
|
2861
|
+
class: d.value
|
|
2862
|
+
}, null)]), w("div", {
|
|
2863
|
+
class: "modal-tips-content"
|
|
2864
|
+
}, [c.value && w(at, null, [w("h5", {
|
|
2865
|
+
class: "toast-title modal-tips-title",
|
|
2866
|
+
innerHTML: a.value.title
|
|
2867
|
+
}, null), w("p", {
|
|
2868
|
+
class: "toast-msg",
|
|
2869
|
+
innerHTML: a.value.message,
|
|
2870
|
+
style: v.value
|
|
2871
|
+
}, null), f.value && z()]), l.value && (a.value.buttons ? w("div", {
|
|
2872
|
+
class: "toast-title-btns-wrapper d-flex"
|
|
2873
|
+
}, [w("h5", {
|
|
2874
|
+
class: "toast-title modal-tips-title only-toast-msg",
|
|
2875
|
+
style: v.value,
|
|
2876
|
+
innerHTML: a.value.message
|
|
2877
|
+
}, null), w("div", {
|
|
2878
|
+
class: "after-toast-title text-right ml-auto"
|
|
2879
|
+
}, [z()])]) : w("h5", {
|
|
2880
|
+
class: "toast-title modal-tips-title only-toast-msg",
|
|
2881
|
+
style: v.value,
|
|
2882
|
+
innerHTML: a.value.message
|
|
2883
|
+
}, null))])])]);
|
|
2884
|
+
}
|
|
2885
|
+
}), ft = /* @__PURE__ */ Ge({
|
|
2886
|
+
name: "Notify",
|
|
2887
|
+
props: Or,
|
|
2888
|
+
emits: ["close", "empty"],
|
|
2889
|
+
setup(e, t) {
|
|
2890
|
+
const n = D(() => ({
|
|
2891
|
+
"farris-notify": !0
|
|
2892
|
+
})), o = {
|
|
2893
|
+
left: 12,
|
|
2894
|
+
right: 12,
|
|
2895
|
+
top: 20,
|
|
2896
|
+
bottom: 12
|
|
2897
|
+
}, r = h(), i = h(e.options), a = h(e.showCloseButton), u = D(() => e.position || "bottom-right"), c = D(() => e.timeout != null ? e.timeout : 3e3), l = D(() => {
|
|
2898
|
+
const p = e.bottom ? e.bottom : o.bottom, s = e.top ? e.top : o.top, f = {
|
|
2899
|
+
transition: "all 0.2s ease",
|
|
2900
|
+
left: u.value.indexOf("left") > -1 ? `${e.left ? e.left : o.left}px` : "",
|
|
2901
|
+
right: u.value.indexOf("right") > -1 ? `${e.right ? e.right : o.right}px` : "",
|
|
2902
|
+
top: u.value.indexOf("top") > -1 ? `${s}px` : "",
|
|
2903
|
+
bottom: u.value.indexOf("bottom") > -1 ? `${p}px` : ""
|
|
2904
|
+
};
|
|
2905
|
+
return u.value.indexOf("center") > -1 && (f.left = "50%", f.marginLeft = "calc(-24rem / 2)", u.value === "center-center" && (f.top = "50%", f.transform = "translate(-50%, -50%)")), f;
|
|
2906
|
+
});
|
|
2907
|
+
function m(p) {
|
|
2908
|
+
t.emit("close");
|
|
2909
|
+
}
|
|
2910
|
+
c.value && setTimeout(() => {
|
|
2911
|
+
m();
|
|
2912
|
+
}, c.value), t.expose({
|
|
2913
|
+
closeToast: m,
|
|
2914
|
+
container: r,
|
|
2915
|
+
notifyPosition: u
|
|
2916
|
+
});
|
|
2917
|
+
function d(p, s) {
|
|
2918
|
+
m();
|
|
2919
|
+
}
|
|
2920
|
+
return () => w("div", {
|
|
2921
|
+
class: n.value,
|
|
2922
|
+
style: l.value,
|
|
2923
|
+
ref: r
|
|
2924
|
+
}, [w(jt, {
|
|
2925
|
+
options: i.value,
|
|
2926
|
+
showCloseButton: a.value,
|
|
2927
|
+
animate: e.animate,
|
|
2928
|
+
onClose: (p) => d(p, i.value)
|
|
2929
|
+
}, null)]);
|
|
2930
|
+
}
|
|
2931
|
+
});
|
|
2932
|
+
class Rr {
|
|
2933
|
+
constructor() {
|
|
2934
|
+
ye(this, "notifyRefs", []);
|
|
2935
|
+
ye(this, "globalConfig", $e({}));
|
|
2936
|
+
}
|
|
2937
|
+
escapeAllHtml(t) {
|
|
2938
|
+
if (typeof t != "string" || !t)
|
|
2939
|
+
return "";
|
|
2940
|
+
const n = document.createElement("div");
|
|
2941
|
+
return n.textContent = t || "", n.innerHTML.replace(/\\n/g, "<br>").replace(/\\t/g, " ").replace(/\\r/g, "");
|
|
2942
|
+
}
|
|
2943
|
+
createNotifyInstance(t) {
|
|
2944
|
+
const n = this, r = Object.assign({
|
|
2945
|
+
timeout: 3e3,
|
|
2946
|
+
position: "bottom-right",
|
|
2947
|
+
showCloseButton: !0,
|
|
2948
|
+
safeHtml: !0
|
|
2949
|
+
}, this.globalConfig, {
|
|
2950
|
+
...t
|
|
2951
|
+
}), i = document.createElement("div");
|
|
2952
|
+
i.style.display = "contents";
|
|
2953
|
+
const a = Pt({
|
|
2954
|
+
setup() {
|
|
2955
|
+
var l;
|
|
2956
|
+
const u = h();
|
|
2957
|
+
function c() {
|
|
2958
|
+
u.value.container.style.transform = "scale(0)", setTimeout(() => {
|
|
2959
|
+
n.updateNotifyPositionForClose(r, u), a.unmount();
|
|
2960
|
+
}, 220);
|
|
2961
|
+
}
|
|
2962
|
+
if (r.position.indexOf("top") > -1) {
|
|
2963
|
+
const m = n.getNotifyInstances(r.position), d = m[m.length - 1];
|
|
2964
|
+
if (d) {
|
|
2965
|
+
const p = d.value.container.getBoundingClientRect();
|
|
2966
|
+
r.top = p.bottom;
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
return r.safeHtml && ((l = r.options) != null && l.message) && (r.options.message = n.escapeAllHtml(r.options.message)), lt(() => {
|
|
2970
|
+
document.body.removeChild(i);
|
|
2971
|
+
}), st(() => {
|
|
2972
|
+
n.updateNotifyPositionForCreate(r, u);
|
|
2973
|
+
}), () => w(Yt, {
|
|
2974
|
+
mode: "out-in",
|
|
2975
|
+
name: "fade",
|
|
2976
|
+
appear: !0
|
|
2977
|
+
}, {
|
|
2978
|
+
default: () => [w(ft, gt({
|
|
2979
|
+
ref: u
|
|
2980
|
+
}, r, {
|
|
2981
|
+
onClose: c
|
|
2982
|
+
}), null)]
|
|
2983
|
+
});
|
|
2984
|
+
}
|
|
2985
|
+
});
|
|
2986
|
+
return a.provide("NotifyService", this), document.body.appendChild(i), a.use(yt.i18n), a.mount(i), a;
|
|
2987
|
+
}
|
|
2988
|
+
getNotifyInstances(t) {
|
|
2989
|
+
return this.notifyRefs.filter((n) => n.value.notifyPosition === t);
|
|
2990
|
+
}
|
|
2991
|
+
updateNotifyPositionForCreate(t, n) {
|
|
2992
|
+
if (this.notifyRefs && this.notifyRefs.length) {
|
|
2993
|
+
const o = window.innerHeight;
|
|
2994
|
+
t.position.indexOf("bottom") > -1 && this.getNotifyInstances(t.position).forEach((r) => {
|
|
2995
|
+
const i = r.value.container.getBoundingClientRect();
|
|
2996
|
+
r.value.container.style.bottom = i.height + o - i.bottom + "px";
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
this.notifyRefs = [...this.notifyRefs, n];
|
|
3000
|
+
}
|
|
3001
|
+
updateNotifyPositionForClose(t, n) {
|
|
3002
|
+
const o = this.notifyRefs.indexOf(n);
|
|
3003
|
+
if (t.position.indexOf("top") > -1) {
|
|
3004
|
+
const r = this.getNotifyInstances(t.position), i = r.indexOf(n);
|
|
3005
|
+
r.slice(i + 1).forEach((a) => {
|
|
3006
|
+
a.value.container.style.top = a.value.container.offsetTop - a.value.container.offsetHeight + "px";
|
|
3007
|
+
});
|
|
3008
|
+
}
|
|
3009
|
+
o > -1 && this.notifyRefs.splice(o, 1);
|
|
3010
|
+
}
|
|
3011
|
+
show(t) {
|
|
3012
|
+
return this.createNotifyInstance(t);
|
|
3013
|
+
}
|
|
3014
|
+
buildNotifyProps(t, n) {
|
|
3015
|
+
let o = "", r = "", i, a, u;
|
|
3016
|
+
typeof n == "string" ? o = n : n && (o = n.message || "", r = n.title || "", a = n.position || null, u = n.showCloseButton != null ? n.showCloseButton : null, i = n.timeout != null ? n.timeout : null);
|
|
3017
|
+
const l = {
|
|
3018
|
+
options: {
|
|
3019
|
+
type: t,
|
|
3020
|
+
message: o,
|
|
3021
|
+
title: r
|
|
3022
|
+
}
|
|
3023
|
+
};
|
|
3024
|
+
return a != null && (l.position = a), u != null && (l.showCloseButton = u), i != null && (l.timeout = i), l;
|
|
3025
|
+
}
|
|
3026
|
+
info(t) {
|
|
3027
|
+
const n = this.buildNotifyProps("info", t);
|
|
3028
|
+
return this.show(n);
|
|
3029
|
+
}
|
|
3030
|
+
success(t) {
|
|
3031
|
+
const n = this.buildNotifyProps("success", t);
|
|
3032
|
+
return this.show(n);
|
|
3033
|
+
}
|
|
3034
|
+
warning(t) {
|
|
3035
|
+
const n = this.buildNotifyProps("warning", t);
|
|
3036
|
+
return this.show(n);
|
|
3037
|
+
}
|
|
3038
|
+
error(t) {
|
|
3039
|
+
const n = this.buildNotifyProps("error", t);
|
|
3040
|
+
return this.show(n);
|
|
3041
|
+
}
|
|
3042
|
+
close(t) {
|
|
3043
|
+
t && t.unmount();
|
|
3044
|
+
}
|
|
3045
|
+
closeAll() {
|
|
3046
|
+
this.notifyRefs.forEach((t) => {
|
|
3047
|
+
t == null || t.value.closeToast();
|
|
3048
|
+
}), this.notifyRefs.length = 0;
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
const jr = Symbol("NOTIFY_SERVICE_TOKEN");
|
|
3052
|
+
ft.install = (e) => {
|
|
3053
|
+
e.component(ft.name, ft), e.component(jt.name, jt);
|
|
3054
|
+
const t = new Rr();
|
|
3055
|
+
e.provide(jr, t), e.provide("FNotifyService", t);
|
|
3056
|
+
};
|
|
3057
|
+
`${yt.getLocaleValue("datagrid.loadingMessage")}`;
|
|
3058
|
+
const Nr = {
|
|
3059
|
+
/** 自定义样式 */
|
|
3060
|
+
customClass: { type: String, default: "" },
|
|
3061
|
+
/** 排序配置 */
|
|
3062
|
+
sort: { type: Object },
|
|
3063
|
+
/** 筛选配置 */
|
|
3064
|
+
filter: { type: Object },
|
|
3065
|
+
/** 自动勾选子节点 */
|
|
3066
|
+
autoCheckChildren: { type: Boolean, default: !1 },
|
|
3067
|
+
/** 列集合 */
|
|
3068
|
+
columns: { type: Array, default: [] },
|
|
3069
|
+
/** 列配置 */
|
|
3070
|
+
columnOption: { type: Object },
|
|
3071
|
+
/** 命令列配置选项 */
|
|
3072
|
+
commandOption: {
|
|
3073
|
+
type: Object,
|
|
3074
|
+
default: {
|
|
3075
|
+
enable: !1,
|
|
3076
|
+
commands: []
|
|
3077
|
+
}
|
|
3078
|
+
},
|
|
3079
|
+
/** 被绑定数据 */
|
|
3080
|
+
data: { type: Array, default: [] },
|
|
3081
|
+
/** 禁用组件 */
|
|
3082
|
+
disabled: { type: Boolean, default: !1 },
|
|
3083
|
+
/** 用于控制节点禁用状态的字段 */
|
|
3084
|
+
disabledField: { type: String, default: "disabled" },
|
|
3085
|
+
/** 用于显示信息的字段 */
|
|
3086
|
+
displayField: { type: String, default: "name" },
|
|
3087
|
+
/** 允许编辑 */
|
|
3088
|
+
editable: { type: Boolean, default: !1 },
|
|
3089
|
+
/** 编辑配置 */
|
|
3090
|
+
editOption: { type: Object, default: { selectOnEditing: !1, editMode: "cell" } },
|
|
3091
|
+
/** 适配父组件尺寸 */
|
|
3092
|
+
fit: { type: Boolean, default: !1 },
|
|
3093
|
+
/** 列标题配置 */
|
|
3094
|
+
header: { type: Object },
|
|
3095
|
+
/** 高度 */
|
|
3096
|
+
height: { type: Number, default: -1 },
|
|
3097
|
+
/** 层级关系配置对象 */
|
|
3098
|
+
hierarchy: {
|
|
3099
|
+
type: Object,
|
|
3100
|
+
default: {
|
|
3101
|
+
cascadeOption: {
|
|
3102
|
+
autoCancelParent: !0,
|
|
3103
|
+
autoCheckChildren: !1,
|
|
3104
|
+
autoCheckParent: !1,
|
|
3105
|
+
selectionRange: "All"
|
|
3106
|
+
},
|
|
3107
|
+
parentIdField: "parent"
|
|
3108
|
+
}
|
|
3109
|
+
},
|
|
3110
|
+
/** DataGrid组件唯一标识 */
|
|
3111
|
+
id: { type: String, default: "" },
|
|
3112
|
+
/** 被绑定数据的标识字段 */
|
|
3113
|
+
idField: { type: String, default: "id", require: !0 },
|
|
3114
|
+
/** async loading data */
|
|
3115
|
+
loadData: { type: Function },
|
|
3116
|
+
// 是否展示 loading
|
|
3117
|
+
loading: {
|
|
3118
|
+
type: Boolean,
|
|
3119
|
+
default: !1
|
|
3120
|
+
},
|
|
3121
|
+
/** 最小高度 */
|
|
3122
|
+
minHeight: { type: Number, default: 300 },
|
|
3123
|
+
/** 最小宽度 */
|
|
3124
|
+
minWidth: { type: Number, default: 400 },
|
|
3125
|
+
/** 新建数据 */
|
|
3126
|
+
newDataItem: {
|
|
3127
|
+
type: Function,
|
|
3128
|
+
default: () => {
|
|
3129
|
+
}
|
|
3130
|
+
},
|
|
3131
|
+
/** 分页配置 */
|
|
3132
|
+
pagination: {
|
|
3133
|
+
type: Object,
|
|
3134
|
+
default: {
|
|
3135
|
+
enable: !1,
|
|
3136
|
+
size: -1
|
|
3137
|
+
}
|
|
3138
|
+
},
|
|
3139
|
+
/** 行号配置 */
|
|
3140
|
+
rowNumber: {
|
|
3141
|
+
type: Object,
|
|
3142
|
+
default: {
|
|
3143
|
+
enable: !0,
|
|
3144
|
+
width: 32,
|
|
3145
|
+
heading: yt.getLocaleValue("datagrid.lineNumberTitle")
|
|
3146
|
+
}
|
|
3147
|
+
},
|
|
3148
|
+
/** 行配置 */
|
|
3149
|
+
rowOption: {
|
|
3150
|
+
type: Object,
|
|
3151
|
+
default: {
|
|
3152
|
+
wrapContent: !1
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
/** 选择配置 */
|
|
3156
|
+
selection: {
|
|
3157
|
+
type: Object,
|
|
3158
|
+
default: {
|
|
3159
|
+
enableSelectRow: !0,
|
|
3160
|
+
multiSelect: !1,
|
|
3161
|
+
multiSelectMode: "DependOnCheck",
|
|
3162
|
+
showCheckbox: !1,
|
|
3163
|
+
showSelectAll: !1,
|
|
3164
|
+
showSelection: !1
|
|
3165
|
+
}
|
|
3166
|
+
},
|
|
3167
|
+
/** 已选数据标识 */
|
|
3168
|
+
selectionValues: { type: Array, default: [] },
|
|
3169
|
+
/** 显示边框 */
|
|
3170
|
+
showBorder: { type: Boolean, default: !1 },
|
|
3171
|
+
/** 显示列头 */
|
|
3172
|
+
showHeader: { type: Boolean, default: !0 },
|
|
3173
|
+
/** 显示横向行分割线 */
|
|
3174
|
+
showHorizontalLines: { type: Boolean, default: !0 },
|
|
3175
|
+
/** 显示节点连接线 */
|
|
3176
|
+
showLines: { type: Boolean, default: !1 },
|
|
3177
|
+
/** 显示配置按钮 */
|
|
3178
|
+
showOptions: { type: Boolean, default: !1 },
|
|
3179
|
+
/** 显示滚动条 */
|
|
3180
|
+
showScrollBar: { type: String, default: "auto" },
|
|
3181
|
+
/** 显示设置按钮 */
|
|
3182
|
+
showSetting: { type: Boolean, default: !1 },
|
|
3183
|
+
/** 显示条纹 */
|
|
3184
|
+
showStripe: { type: Boolean, default: !0 },
|
|
3185
|
+
/** 显示树节点图标 */
|
|
3186
|
+
showTreeNodeIcons: { type: Boolean, default: !1 },
|
|
3187
|
+
/** 显示纵向列分割线 */
|
|
3188
|
+
showVerticallLines: { type: Boolean, default: !1 },
|
|
3189
|
+
/** 树节点图标数据 */
|
|
3190
|
+
treeNodeIconsData: { type: [Object, String], default: {} },
|
|
3191
|
+
/** 宽度 */
|
|
3192
|
+
width: { type: Number, default: -1 },
|
|
3193
|
+
/** 启用虚拟渲染 */
|
|
3194
|
+
virtualized: { type: Boolean, default: !1 },
|
|
3195
|
+
/** 空数据模板 */
|
|
3196
|
+
emptyTemplate: { type: Object },
|
|
3197
|
+
/** 合计配置 */
|
|
3198
|
+
summary: {
|
|
3199
|
+
type: Object,
|
|
3200
|
+
default: {
|
|
3201
|
+
// 默认合计行开启后,后面不展示值,所以默认不开启
|
|
3202
|
+
enable: !1,
|
|
3203
|
+
groupFields: ["numericField1", "numericField2"]
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
};
|
|
3207
|
+
function Pr(e, t, n, o, r, i, a, u, c, l, m, d, p, s, f, v, x) {
|
|
3208
|
+
const {
|
|
3209
|
+
calculateCellPositionInRow: k
|
|
3210
|
+
} = i, {
|
|
3211
|
+
columnContext: E,
|
|
3212
|
+
hasLeftFixedColumn: z,
|
|
3213
|
+
hasRightFixedColumn: N
|
|
3214
|
+
} = a, {
|
|
3215
|
+
gridDataStyle: C,
|
|
3216
|
+
leftFixedGridDataStyle: y,
|
|
3217
|
+
rightFixedGridDataStyle: S
|
|
3218
|
+
} = s, {
|
|
3219
|
+
renderDataRow: T
|
|
3220
|
+
} = Ln(e, t, E, x, u, c, l, m, d, p, s, f, v), F = [T];
|
|
3221
|
+
function _(W, J) {
|
|
3222
|
+
const oe = k(W);
|
|
3223
|
+
return x.value.filter((R) => R.visible !== !1).map((R, O) => F[R.type](R, oe, J, O));
|
|
3224
|
+
}
|
|
3225
|
+
function b() {
|
|
3226
|
+
return w("div", {
|
|
3227
|
+
ref: o,
|
|
3228
|
+
class: "fv-grid-content-left-fixed"
|
|
3229
|
+
}, [w("div", {
|
|
3230
|
+
class: "fv-grid-data",
|
|
3231
|
+
style: y.value
|
|
3232
|
+
}, [_(E.value.leftColumns.filter((W) => W.visible), "left")])]);
|
|
3233
|
+
}
|
|
3234
|
+
function q() {
|
|
3235
|
+
return w("div", {
|
|
3236
|
+
ref: n,
|
|
3237
|
+
class: "fv-grid-content-primary"
|
|
3238
|
+
}, [w("div", {
|
|
3239
|
+
class: "fv-grid-data",
|
|
3240
|
+
style: C.value
|
|
3241
|
+
}, [_(E.value.primaryColumns.filter((W) => W.visible), "primary")])]);
|
|
3242
|
+
}
|
|
3243
|
+
function V() {
|
|
3244
|
+
return w("div", {
|
|
3245
|
+
ref: r,
|
|
3246
|
+
class: "fv-grid-content-right-fixed"
|
|
3247
|
+
}, [w("div", {
|
|
3248
|
+
class: "fv-grid-data",
|
|
3249
|
+
style: S.value
|
|
3250
|
+
}, [_(E.value.rightColumns.filter((W) => W.visible), "right")])]);
|
|
3251
|
+
}
|
|
3252
|
+
function H() {
|
|
3253
|
+
const W = [];
|
|
3254
|
+
return z.value && W.push(b()), W.push(q()), N.value && W.push(V()), W;
|
|
3255
|
+
}
|
|
3256
|
+
return {
|
|
3257
|
+
renderDataArea: H
|
|
3258
|
+
};
|
|
3259
|
+
}
|
|
3260
|
+
const Dr = /* @__PURE__ */ Ge({
|
|
3261
|
+
name: "FTreeGrid",
|
|
3262
|
+
props: Nr,
|
|
3263
|
+
emits: ["selectionChange", "clickRow", "expandNode", "unSelectItem", "dblclickNode", "doubleClickRow", "unSelectItem", "selectItem", "filterChanged", "sortChanged", "selectionUpdate"],
|
|
3264
|
+
setup(e, t) {
|
|
3265
|
+
var Lt, zt;
|
|
3266
|
+
const o = ((Lt = e.rowOption) == null ? void 0 : Lt.height) || 28, r = h(20), i = h(e.columns), a = zn(e), {
|
|
3267
|
+
idField: u
|
|
3268
|
+
} = a, c = h(), l = h(), m = h(), d = h(), p = h(), s = h([]), f = h(!1), v = h(((zt = e.rowOption) == null ? void 0 : zt.wrapContent) || !1), x = An(e, a), k = Vn(e, t), E = _n(e), {
|
|
3269
|
+
collapseField: z
|
|
3270
|
+
} = E, {
|
|
3271
|
+
showLoading: N,
|
|
3272
|
+
renderLoading: C
|
|
3273
|
+
} = qn(e, c), y = Wn(e, /* @__PURE__ */ new Map(), k, E, a), {
|
|
3274
|
+
dataView: S
|
|
3275
|
+
} = y, T = Gn(e, y, a, s, t), {
|
|
3276
|
+
showSelection: F,
|
|
3277
|
+
selectedValues: _
|
|
3278
|
+
} = T, b = Un(e, s, y, a, T, t), q = D(() => e.disabled), V = D(() => e.virtualized ? Math.min(y.dataView.value.length, r.value) : y.dataView.value.length), H = Xn(e, y), {
|
|
3279
|
+
shouldRenderPagination: W
|
|
3280
|
+
} = H, {
|
|
3281
|
+
containerStyleObject: J
|
|
3282
|
+
} = Yn(e), oe = Jn(e), {
|
|
3283
|
+
applyCommands: R
|
|
3284
|
+
} = oe;
|
|
3285
|
+
R(i);
|
|
3286
|
+
const {
|
|
3287
|
+
applyColumnSetting: O,
|
|
3288
|
+
removeColumnSetting: U
|
|
3289
|
+
} = Qn(e);
|
|
3290
|
+
e.showSetting && O(i);
|
|
3291
|
+
const $ = Zn(e, t), K = Kn(e), {
|
|
3292
|
+
applyColumnSorter: me,
|
|
3293
|
+
columnContext: ve,
|
|
3294
|
+
updateColumnRenderContext: X
|
|
3295
|
+
} = $;
|
|
3296
|
+
me(y, K);
|
|
3297
|
+
const ne = eo(e, ve), le = to(e, t, T, a), ee = no(e, t, a, le, s), L = oo(e), te = ro(e, ee, L), He = io(e, y, ee, E, a, L, te), Oe = ao(e, i, y, V, 0, He), {
|
|
3298
|
+
getVisualData: Se
|
|
3299
|
+
} = Oe, Ue = lo(e, ve), Le = so(e, T), {
|
|
3300
|
+
sidebarWidth: Xe
|
|
3301
|
+
} = Le, ie = uo(e, y, s, ve, Oe, V, 0, Xe), {
|
|
3302
|
+
onWheel: et,
|
|
3303
|
+
dataGridWidth: Me,
|
|
3304
|
+
viewPortHeight: Re,
|
|
3305
|
+
viewPortWidth: Te,
|
|
3306
|
+
resetScroll: je,
|
|
3307
|
+
updateVisibleRowsOnLatestVisibleScope: tt
|
|
3308
|
+
} = ie, ze = co(e, ve, l, Te, ne), {
|
|
3309
|
+
calculateColumnsSize: Ie
|
|
3310
|
+
} = ze, Ne = fo(), Ye = po(l, p, y, Ne, ie), Je = mo(e, t, $, y, ne, x, ie), B = D(() => {
|
|
3311
|
+
const P = {
|
|
3312
|
+
"fv-grid": !0,
|
|
3313
|
+
"fv-grid-bordered": e.showBorder,
|
|
3314
|
+
"fv-grid-horizontal-bordered": e.showHorizontalLines,
|
|
3315
|
+
"fv-datagrid-strip": e.showStripe
|
|
3316
|
+
};
|
|
3317
|
+
return En(P, e.customClass);
|
|
3318
|
+
}), Y = D(() => ({
|
|
3319
|
+
"fv-grid-content": !0,
|
|
3320
|
+
"fv-grid-content-hover": f.value,
|
|
3321
|
+
"fv-grid-wrap-content": v.value
|
|
3322
|
+
})), {
|
|
3323
|
+
renderDataArea: ae
|
|
3324
|
+
} = Pr(e, t, m, d, p, Ue, $, y, ee, E, le, T, b, ie, Oe, L, s), {
|
|
3325
|
+
renderGridHeader: se,
|
|
3326
|
+
renderGridColumnResizeOverlay: Ee,
|
|
3327
|
+
shouldShowHeader: bt
|
|
3328
|
+
} = vo(e, t, l, d, p, $, y, Je, Ye, k, Ne, ze, ne, T, Le, K, ie, Te, s), {
|
|
3329
|
+
renderDataGridSidebar: wt
|
|
3330
|
+
} = go(e, le, T, Le, ie), {
|
|
3331
|
+
renderDisableMask: Ct
|
|
3332
|
+
} = yo(), {
|
|
3333
|
+
renderHorizontalScrollbar: xt
|
|
3334
|
+
} = ho(e, l, ie), {
|
|
3335
|
+
renderVerticalScrollbar: St
|
|
3336
|
+
} = bo(e, l, ie);
|
|
3337
|
+
function Tt() {
|
|
3338
|
+
var P, G, ce;
|
|
3339
|
+
if (l.value && l.value.clientHeight > 0 && ((P = l.value) == null ? void 0 : P.clientWidth) > 0) {
|
|
3340
|
+
const pe = Math.ceil(l.value.clientHeight / o);
|
|
3341
|
+
pe > r.value && (r.value = pe, tt()), Re.value = ((G = m.value) == null ? void 0 : G.clientHeight) || 0, Me.value = ((ce = l.value) == null ? void 0 : ce.clientWidth) || 0, Ie();
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
st(() => {
|
|
3345
|
+
l.value && (r.value = Math.max(Math.ceil(l.value.clientHeight / o), r.value), s.value = Se(0, V.value + 0 - 1), Hn(l.value, Tt), Ie(), Ke(() => {
|
|
3346
|
+
l.value && (Me.value = l.value.clientWidth), m.value && (Te.value = m.value.clientWidth, Re.value = m.value.clientHeight);
|
|
3347
|
+
})), N.value && C();
|
|
3348
|
+
}), lt(() => {
|
|
3349
|
+
}), xe(Te, () => {
|
|
3350
|
+
l.value && Ie();
|
|
3351
|
+
});
|
|
3352
|
+
function Bt(P) {
|
|
3353
|
+
y.collapseTo(P), y.reOrderVisibleIndex(), je();
|
|
3354
|
+
}
|
|
3355
|
+
function ut(P) {
|
|
3356
|
+
y.expandTo(P), y.reOrderVisibleIndex(), je();
|
|
3357
|
+
}
|
|
3358
|
+
function nt() {
|
|
3359
|
+
const P = T.getSelectionRow();
|
|
3360
|
+
return P ? P.dataIndex - 1 : -1;
|
|
3361
|
+
}
|
|
3362
|
+
function kt() {
|
|
3363
|
+
const P = nt();
|
|
3364
|
+
y.insertNewDataItem(P), s.value = Se(0, V.value + 0 - 1);
|
|
3365
|
+
}
|
|
3366
|
+
function Ft() {
|
|
3367
|
+
const P = nt();
|
|
3368
|
+
y.insertNewChildDataItem(P), s.value = Se(0, V.value + 0 - 1);
|
|
3369
|
+
}
|
|
3370
|
+
function It(P, G) {
|
|
3371
|
+
const ce = s.value.find((we) => we.raw[u.value] === G), pe = ce ? ce.dataIndex - 1 : -1;
|
|
3372
|
+
y.insertNewChildDataItems(P, pe);
|
|
3373
|
+
}
|
|
3374
|
+
function Et() {
|
|
3375
|
+
const P = nt(), G = b.getNextSelectableHierarchyItemId(P);
|
|
3376
|
+
y.removeHierarchyDataItem(P), s.value = Se(0, V.value + 0 - 1), G && b.selectItemById(G);
|
|
3377
|
+
}
|
|
3378
|
+
function ct(P) {
|
|
3379
|
+
ee.onEditingRow(P);
|
|
3380
|
+
}
|
|
3381
|
+
function Ot(P) {
|
|
3382
|
+
ee.acceptEditingRow(P);
|
|
3383
|
+
}
|
|
3384
|
+
function g(P) {
|
|
3385
|
+
ee.cancelEditingRow(P);
|
|
3386
|
+
}
|
|
3387
|
+
function I(P) {
|
|
3388
|
+
P && (i.value = P, R(i), X(i.value), me(y, K), Ie());
|
|
3389
|
+
}
|
|
3390
|
+
xe(() => e.columns, (P) => {
|
|
3391
|
+
I(P);
|
|
3392
|
+
});
|
|
3393
|
+
function j(P, G) {
|
|
3394
|
+
P && (y.load(P), y.reOrderVisibleIndex(), G != null && G.keepScrollPosition ? ie.scrollTo(ie.offsetY.value) : je());
|
|
3395
|
+
}
|
|
3396
|
+
function A(P) {
|
|
3397
|
+
b.selectItemById(P);
|
|
3398
|
+
}
|
|
3399
|
+
function Q(P) {
|
|
3400
|
+
const G = s.value.find((ce) => ce.raw[a.idField.value] === P);
|
|
3401
|
+
G && le.clickRowItem(G);
|
|
3402
|
+
}
|
|
3403
|
+
function Z(P) {
|
|
3404
|
+
le.activeRowById(P);
|
|
3405
|
+
}
|
|
3406
|
+
function Ce(P) {
|
|
3407
|
+
b.selectItemByIds(P);
|
|
3408
|
+
}
|
|
3409
|
+
function ge() {
|
|
3410
|
+
return T.getSelectedItems();
|
|
3411
|
+
}
|
|
3412
|
+
function he() {
|
|
3413
|
+
T.clearSelection();
|
|
3414
|
+
}
|
|
3415
|
+
const Be = D(() => !s.value || !s.value.length), {
|
|
3416
|
+
renderEmpty: ue
|
|
3417
|
+
} = wo(e, t);
|
|
3418
|
+
function ke() {
|
|
3419
|
+
return T.getSelectionRow();
|
|
3420
|
+
}
|
|
3421
|
+
function be(P) {
|
|
3422
|
+
b.unSelectItemByIds(P);
|
|
3423
|
+
}
|
|
3424
|
+
function fe() {
|
|
3425
|
+
return T.currentSelectedDataId.value;
|
|
3426
|
+
}
|
|
3427
|
+
function ot(P, G, ce) {
|
|
3428
|
+
const pe = S.value.find((we) => we[u.value] === P);
|
|
3429
|
+
if (pe) {
|
|
3430
|
+
if (Object.keys(pe).forEach((de) => {
|
|
3431
|
+
Object.prototype.hasOwnProperty.call(G, de) && (pe[de] = G[de]);
|
|
3432
|
+
}), ce) {
|
|
3433
|
+
const {
|
|
3434
|
+
collapseField: de,
|
|
3435
|
+
disabledField: Ae,
|
|
3436
|
+
checkedField: Ve,
|
|
3437
|
+
visibleField: _e
|
|
3438
|
+
} = ce;
|
|
3439
|
+
de && !Pe(G[de]) && (pe.__fv_collapse__ = G[de]), Ve && !Pe(G[Ve]) && (pe.__fv_checked__ = G[Ve]), Ae && !Pe(G[Ae]) && (pe.__fv_disabled__ = G[Ae]), _e && !Pe(G[_e]) && (pe.__fv_visible__ = G[_e]);
|
|
3440
|
+
}
|
|
3441
|
+
const we = s.value.find((de) => de.raw[u.value] === P), At = s.value.findIndex((de) => de.raw[u.value] === P);
|
|
3442
|
+
if (we) {
|
|
3443
|
+
if (we.raw = pe, Object.keys(we.data).forEach((de) => {
|
|
3444
|
+
we.data[de].updateData(pe);
|
|
3445
|
+
}), ce) {
|
|
3446
|
+
const {
|
|
3447
|
+
collapseField: de,
|
|
3448
|
+
disabledField: Ae,
|
|
3449
|
+
checkedField: Ve,
|
|
3450
|
+
visibleField: _e
|
|
3451
|
+
} = ce;
|
|
3452
|
+
de && !Pe(G[de]) && (we.collapse = G[de]), Ve && !Pe(G[Ve]) && (we.checked = G[Ve]), Ae && !Pe(G[Ae]) && (we.disabled = G[Ae]), _e && !Pe(G[_e]) && (we.visible = G[_e]);
|
|
3453
|
+
}
|
|
3454
|
+
s.value = [...s.value.slice(0, At), we, ...s.value.slice(At + 1)], y.updateSummary();
|
|
3455
|
+
}
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3458
|
+
function rt(P) {
|
|
3459
|
+
return Object.prototype.hasOwnProperty.call(P, "raw") ? y.hasRealChildren(P.raw) : y.hasRealChildren(P);
|
|
3460
|
+
}
|
|
3461
|
+
function it(P) {
|
|
3462
|
+
const G = y.dataView.value.find((ce) => ce[u.value] === P);
|
|
3463
|
+
return G ? G[z.value] : "";
|
|
3464
|
+
}
|
|
3465
|
+
function yn() {
|
|
3466
|
+
return z.value;
|
|
3467
|
+
}
|
|
3468
|
+
xe(() => e.showSetting, (P, G) => {
|
|
3469
|
+
P !== G && (P ? O(i) : U(i), I(i.value));
|
|
3470
|
+
});
|
|
3471
|
+
function hn(P) {
|
|
3472
|
+
return s.value.filter((G) => P.includes(G.raw[e.idField]));
|
|
3473
|
+
}
|
|
3474
|
+
function bn(P) {
|
|
3475
|
+
const G = a.idField.value, ce = s.value.find((pe) => pe.raw[G] === P);
|
|
3476
|
+
ce && le.changeRow(ce);
|
|
3477
|
+
}
|
|
3478
|
+
function wn() {
|
|
3479
|
+
T.keepSelectingOnPaging.value || he(), y.updateVisibleDataSummary(s.value);
|
|
3480
|
+
}
|
|
3481
|
+
t.expose({
|
|
3482
|
+
activeRowById: Z,
|
|
3483
|
+
addNewDataItem: kt,
|
|
3484
|
+
addNewChildDataItem: Ft,
|
|
3485
|
+
addChildrenToNode: It,
|
|
3486
|
+
collapseTo: Bt,
|
|
3487
|
+
expandTo: ut,
|
|
3488
|
+
removeDataItem: Et,
|
|
3489
|
+
editDataItem: ct,
|
|
3490
|
+
acceptDataItem: Ot,
|
|
3491
|
+
cancelDataItem: g,
|
|
3492
|
+
updateColumns: I,
|
|
3493
|
+
updateDataSource: j,
|
|
3494
|
+
selectItemById: A,
|
|
3495
|
+
selectItemByIds: Ce,
|
|
3496
|
+
getSelectedItems: ge,
|
|
3497
|
+
clearSelection: he,
|
|
3498
|
+
getSelectionRow: ke,
|
|
3499
|
+
clickRowItemById: Q,
|
|
3500
|
+
unSelectItemByIds: be,
|
|
3501
|
+
getCurrentRowId: fe,
|
|
3502
|
+
reassignRowData: ot,
|
|
3503
|
+
hasChildren: rt,
|
|
3504
|
+
getCollapseField: yn,
|
|
3505
|
+
getCollapseStatusById: it,
|
|
3506
|
+
getVisibleDataByIds: hn,
|
|
3507
|
+
selectRowById: bn,
|
|
3508
|
+
updateDerivedData: wn
|
|
3509
|
+
});
|
|
3510
|
+
const Cn = D(() => {
|
|
3511
|
+
const P = {};
|
|
3512
|
+
return ie.shouldShowHorizontalScrollbar.value && (P.paddingBottom = "10px"), ie.shouldShowVirticalScrollbar.value && (P.paddingRight = "10px"), P;
|
|
3513
|
+
}), xn = D(() => ({
|
|
3514
|
+
...J.value,
|
|
3515
|
+
borderRadius: "5px"
|
|
3516
|
+
}));
|
|
3517
|
+
Co(e, t, y, ie, H, T);
|
|
3518
|
+
const Sn = D(() => ({
|
|
3519
|
+
"d-flex": !0,
|
|
3520
|
+
"justify-content-between": W.value && F.value,
|
|
3521
|
+
"justify-content-end": W.value && !F.value,
|
|
3522
|
+
"position-relative": !0
|
|
3523
|
+
})), Tn = D(() => ({
|
|
3524
|
+
"d-flex": !0,
|
|
3525
|
+
"align-items-center": !0
|
|
3526
|
+
})), {
|
|
3527
|
+
renderDataGridSummary: Bn
|
|
3528
|
+
} = xo(e, y, $);
|
|
3529
|
+
return () => w("div", {
|
|
3530
|
+
ref: c,
|
|
3531
|
+
class: B.value,
|
|
3532
|
+
style: xn.value,
|
|
3533
|
+
onWheel: et
|
|
3534
|
+
}, [l.value && bt.value && se(), w("div", {
|
|
3535
|
+
ref: l,
|
|
3536
|
+
class: Y.value,
|
|
3537
|
+
onMouseover: () => f.value = !0,
|
|
3538
|
+
onMouseleave: () => f.value = !1,
|
|
3539
|
+
style: Cn.value
|
|
3540
|
+
}, [l.value && wt(s), l.value && ae(), l.value && Be.value && ue(), l.value && xt(), l.value && St()]), l.value && Bn(), F.value && w("div", {
|
|
3541
|
+
class: Sn.value
|
|
3542
|
+
}, [F.value && w("div", {
|
|
3543
|
+
class: Tn.value
|
|
3544
|
+
}, [w("div", null, ["已选:" + _.value.length, Dn(" 条")])])]), Ee(), q.value && Ct()]);
|
|
3545
|
+
}
|
|
3546
|
+
});
|
|
3547
|
+
Gt(Dr);
|
|
3548
|
+
const $r = /* @__PURE__ */ new Map([
|
|
3549
|
+
["appearance", fn]
|
|
3550
|
+
]);
|
|
3551
|
+
function Hr(e, t, n) {
|
|
3552
|
+
return t;
|
|
3553
|
+
}
|
|
3554
|
+
const Lr = "https://json-schema.org/draft/2020-12/schema", zr = "https://farris-design.gitee.io/step.schema.json", Ar = "step", Vr = "A Farris Component", _r = "object", qr = {
|
|
3555
|
+
id: {
|
|
3556
|
+
description: "The unique identifier for step",
|
|
3557
|
+
type: "string"
|
|
3558
|
+
},
|
|
3559
|
+
type: {
|
|
3560
|
+
description: "The type string of step",
|
|
3561
|
+
type: "string",
|
|
3562
|
+
default: "step"
|
|
3563
|
+
},
|
|
3564
|
+
appearance: {
|
|
3565
|
+
description: "",
|
|
3566
|
+
type: "object",
|
|
3567
|
+
properties: {
|
|
3568
|
+
class: {
|
|
3569
|
+
type: "string"
|
|
3570
|
+
},
|
|
3571
|
+
style: {
|
|
3572
|
+
type: "string"
|
|
3573
|
+
}
|
|
3574
|
+
},
|
|
3575
|
+
default: {}
|
|
3576
|
+
},
|
|
3577
|
+
binding: {
|
|
3578
|
+
description: "",
|
|
3579
|
+
type: "object",
|
|
3580
|
+
default: {}
|
|
3581
|
+
},
|
|
3582
|
+
disable: {
|
|
3583
|
+
type: "string",
|
|
3584
|
+
default: !1
|
|
3585
|
+
},
|
|
3586
|
+
editable: {
|
|
3587
|
+
description: "",
|
|
3588
|
+
type: "boolean",
|
|
3589
|
+
default: !0
|
|
3590
|
+
},
|
|
3591
|
+
placeholder: {
|
|
3592
|
+
description: "",
|
|
3593
|
+
type: "string",
|
|
3594
|
+
default: ""
|
|
3595
|
+
},
|
|
3596
|
+
readonly: {
|
|
3597
|
+
description: "",
|
|
3598
|
+
type: "boolean",
|
|
3599
|
+
default: !1
|
|
3600
|
+
},
|
|
3601
|
+
require: {
|
|
3602
|
+
description: "",
|
|
3603
|
+
type: "boolean",
|
|
3604
|
+
default: !1
|
|
3605
|
+
},
|
|
3606
|
+
tabindex: {
|
|
3607
|
+
description: "",
|
|
3608
|
+
type: "number",
|
|
3609
|
+
default: -1
|
|
3610
|
+
},
|
|
3611
|
+
visible: {
|
|
3612
|
+
description: "",
|
|
3613
|
+
type: "boolean",
|
|
3614
|
+
default: !0
|
|
3615
|
+
}
|
|
3616
|
+
}, Wr = [
|
|
3617
|
+
"id",
|
|
3618
|
+
"type"
|
|
3619
|
+
], Gr = {
|
|
3620
|
+
$schema: Lr,
|
|
3621
|
+
$id: zr,
|
|
3622
|
+
title: Ar,
|
|
3623
|
+
description: Vr,
|
|
3624
|
+
type: _r,
|
|
3625
|
+
properties: qr,
|
|
3626
|
+
required: Wr
|
|
3627
|
+
}, Ur = "step", Xr = "A Farris Component", Yr = "object", Jr = {
|
|
3628
|
+
basic: {
|
|
3629
|
+
description: "Basic Infomation",
|
|
3630
|
+
title: "基本信息",
|
|
3631
|
+
properties: {
|
|
3632
|
+
id: {
|
|
3633
|
+
description: "组件标识",
|
|
3634
|
+
title: "标识",
|
|
3635
|
+
type: "string",
|
|
3636
|
+
readonly: !0
|
|
3637
|
+
},
|
|
3638
|
+
type: {
|
|
3639
|
+
description: "组件类型",
|
|
3640
|
+
title: "控件类型",
|
|
3641
|
+
type: "select",
|
|
3642
|
+
editor: {
|
|
3643
|
+
type: "waiting for modification",
|
|
3644
|
+
enum: []
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
}, Qr = {
|
|
3650
|
+
title: Ur,
|
|
3651
|
+
description: Xr,
|
|
3652
|
+
type: Yr,
|
|
3653
|
+
categories: Jr
|
|
3654
|
+
}, Zr = {
|
|
3655
|
+
/** 步骤条方向 */
|
|
3656
|
+
direction: { type: String, default: "horizontal" },
|
|
3657
|
+
/** 是否平铺 */
|
|
3658
|
+
fill: { type: Boolean, default: !1 },
|
|
3659
|
+
/** 竖向步骤条,fill 时需要传递的高度 */
|
|
3660
|
+
height: { type: Number, default: 0 },
|
|
3661
|
+
/** 是否支持点击 */
|
|
3662
|
+
clickable: { type: Boolean, default: !0 },
|
|
3663
|
+
/** 步骤条的具体参数 */
|
|
3664
|
+
steps: {
|
|
3665
|
+
type: Array,
|
|
3666
|
+
default: [
|
|
3667
|
+
{
|
|
3668
|
+
id: "1",
|
|
3669
|
+
title: "审批中(示例)",
|
|
3670
|
+
description: "正在审批"
|
|
3671
|
+
},
|
|
3672
|
+
{
|
|
3673
|
+
id: "2",
|
|
3674
|
+
title: "复核中(示例)",
|
|
3675
|
+
description: "等待复核"
|
|
3676
|
+
}
|
|
3677
|
+
]
|
|
3678
|
+
},
|
|
3679
|
+
/** 当前active步骤的索引 */
|
|
3680
|
+
activeIndex: { type: Number, default: 0 },
|
|
3681
|
+
/** 步骤条点击后事件 */
|
|
3682
|
+
onClick: { type: Function, default: () => {
|
|
3683
|
+
} }
|
|
3684
|
+
};
|
|
3685
|
+
ht(Zr, Gr, $r, Hr, Qr);
|
|
3686
|
+
const Kr = "root-viewmodel";
|
|
3687
|
+
class ei {
|
|
3688
|
+
constructor(t, n) {
|
|
3689
|
+
ye(this, "formSchemaUtils");
|
|
3690
|
+
ye(this, "controlCreatorUtils");
|
|
3691
|
+
ye(this, "designViewModelUtils");
|
|
3692
|
+
this.resolver = t, this.designerHostService = n, this.formSchemaUtils = this.designerHostService.formSchemaUtils, this.controlCreatorUtils = this.designerHostService.controlCreatorUtils, this.designViewModelUtils = this.designerHostService.designViewModelUtils;
|
|
3693
|
+
}
|
|
3694
|
+
createComponent(t) {
|
|
3695
|
+
const n = this.createComponentRefNode(t), o = this.createComponentNode(t), r = this.createViewModeNode(t), i = this.formSchemaUtils.getFormSchema();
|
|
3696
|
+
return i.module.viewmodels.push(r), i.module.components.push(o), this.designViewModelUtils.assembleDesignViewModel(), n;
|
|
3697
|
+
}
|
|
3698
|
+
createComponentRefNode(t) {
|
|
3699
|
+
const n = this.resolver.getSchemaByType("component-ref");
|
|
3700
|
+
return Object.assign(n, {
|
|
3701
|
+
id: `${t.componentId}-component-ref`,
|
|
3702
|
+
component: `${t.componentId}-component`
|
|
3703
|
+
}), n;
|
|
3704
|
+
}
|
|
3705
|
+
createComponentNode(t) {
|
|
3706
|
+
const n = this.resolver.getSchemaByType("component"), o = this.createFormComponentContents(t);
|
|
3707
|
+
return Object.assign(n, {
|
|
3708
|
+
id: `${t.componentId}-component`,
|
|
3709
|
+
viewModel: `${t.componentId}-component-viewmodel`,
|
|
3710
|
+
componentType: t.componentType,
|
|
3711
|
+
appearance: {
|
|
3712
|
+
class: this.getFormComponentClass()
|
|
3713
|
+
},
|
|
3714
|
+
formColumns: t.formColumns,
|
|
3715
|
+
contents: o
|
|
3716
|
+
}), n;
|
|
3717
|
+
}
|
|
3718
|
+
/**
|
|
3719
|
+
* 获取卡片组件层级的class样式
|
|
3720
|
+
*/
|
|
3721
|
+
getFormComponentClass() {
|
|
3722
|
+
const { templateId: t } = this.formSchemaUtils.getFormSchema().module;
|
|
3723
|
+
return t === "double-list-in-tab-template" ? "f-struct-wrapper f-utils-fill-flex-column" : "f-struct-wrapper";
|
|
3724
|
+
}
|
|
3725
|
+
createFormComponentContents(t) {
|
|
3726
|
+
const n = this.resolver.getSchemaByType("section");
|
|
3727
|
+
Object.assign(n, {
|
|
3728
|
+
id: t.componentId + "-form-section",
|
|
3729
|
+
appearance: {
|
|
3730
|
+
class: "f-section-form f-section-in-mainsubcard"
|
|
3731
|
+
},
|
|
3732
|
+
mainTitle: t.componentName
|
|
3733
|
+
});
|
|
3734
|
+
const o = this.resolver.getSchemaByType("response-form"), r = [];
|
|
3735
|
+
Object.assign(o, {
|
|
3736
|
+
id: t.componentId + "-form",
|
|
3737
|
+
appearance: {
|
|
3738
|
+
class: "f-form-layout farris-form farris-form-controls-inline"
|
|
3739
|
+
},
|
|
3740
|
+
contents: r
|
|
3741
|
+
}), n.contents = [o];
|
|
3742
|
+
const { selectedFields: i } = t;
|
|
3743
|
+
i == null || i.forEach((u) => {
|
|
3744
|
+
if (u.$type === Vt.SimpleField) {
|
|
3745
|
+
const c = Rt(u), l = this.resolveControlClassByFormColumns(t), m = this.controlCreatorUtils.setFormFieldProperty(c, "", l);
|
|
3746
|
+
m && r.push(m);
|
|
3747
|
+
}
|
|
3748
|
+
});
|
|
3749
|
+
const { templateId: a } = this.formSchemaUtils.getFormSchema().module;
|
|
3750
|
+
return a === "double-list-in-tab-template" && (n.appearance.class = "f-section-grid f-section-in-main px-0 pt-0", n.fill = !0), [n];
|
|
3751
|
+
}
|
|
3752
|
+
resolveControlClassByFormColumns(t) {
|
|
3753
|
+
let n = "";
|
|
3754
|
+
switch (t.formColumns) {
|
|
3755
|
+
case 1: {
|
|
3756
|
+
n = "col-12";
|
|
3757
|
+
break;
|
|
3758
|
+
}
|
|
3759
|
+
case 2: {
|
|
3760
|
+
n = "col-12 col-md-6 col-xl-6 col-el-6";
|
|
3761
|
+
break;
|
|
3762
|
+
}
|
|
3763
|
+
case 3: {
|
|
3764
|
+
n = "col-12 col-md-6 col-xl-4 col-el-4";
|
|
3765
|
+
break;
|
|
3766
|
+
}
|
|
3767
|
+
case 4: {
|
|
3768
|
+
n = "col-12 col-md-6 col-xl-3 col-el-2";
|
|
3769
|
+
break;
|
|
3770
|
+
}
|
|
3771
|
+
}
|
|
3772
|
+
return n;
|
|
3773
|
+
}
|
|
3774
|
+
/**
|
|
3775
|
+
* 添加viewModel节点
|
|
3776
|
+
*/
|
|
3777
|
+
createViewModeNode(t) {
|
|
3778
|
+
return {
|
|
3779
|
+
id: `${t.componentId}-component-viewmodel`,
|
|
3780
|
+
code: `${t.componentId}-component-viewmodel`,
|
|
3781
|
+
name: t.componentName,
|
|
3782
|
+
bindTo: t.bindTo,
|
|
3783
|
+
parent: Kr,
|
|
3784
|
+
fields: this.assembleViewModelFields(t),
|
|
3785
|
+
commands: [],
|
|
3786
|
+
states: [],
|
|
3787
|
+
enableValidation: !0
|
|
3788
|
+
};
|
|
3789
|
+
}
|
|
3790
|
+
/**
|
|
3791
|
+
* 组装viewModel fields 节点
|
|
3792
|
+
*/
|
|
3793
|
+
assembleViewModelFields(t) {
|
|
3794
|
+
const n = [], { selectedFields: o } = t;
|
|
3795
|
+
return o == null || o.forEach((r) => {
|
|
3796
|
+
if (r.$type === Vt.SimpleField) {
|
|
3797
|
+
let i = "blur";
|
|
3798
|
+
const a = r.type.name;
|
|
3799
|
+
(a === _t.Enum || a === _t.Boolean) && (i = "change"), n.push({
|
|
3800
|
+
type: "Form",
|
|
3801
|
+
id: r.id,
|
|
3802
|
+
fieldName: r.bindingField,
|
|
3803
|
+
groupId: null,
|
|
3804
|
+
groupName: null,
|
|
3805
|
+
updateOn: i,
|
|
3806
|
+
fieldSchema: {}
|
|
3807
|
+
});
|
|
3808
|
+
}
|
|
3809
|
+
}), n;
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
function ti(e, t, n, o) {
|
|
3813
|
+
var i, a, u, c, l, m;
|
|
3814
|
+
const r = n.parentComponentInstance;
|
|
3815
|
+
if (r && o) {
|
|
3816
|
+
const d = (i = r.schema) == null ? void 0 : i.type, s = {
|
|
3817
|
+
componentId: `form-${Math.random().toString(36).slice(2, 6)}`,
|
|
3818
|
+
componentName: ((a = n.bindingSourceContext) == null ? void 0 : a.entityTitle) || ((c = (u = n.bindingSourceContext) == null ? void 0 : u.bindingEntity) == null ? void 0 : c.name) || "标题",
|
|
3819
|
+
componentType: "form",
|
|
3820
|
+
formColumns: d === "splitter-pane" ? 1 : 4,
|
|
3821
|
+
parentContainerId: r.schema.id,
|
|
3822
|
+
bindTo: ((l = n.bindingSourceContext) == null ? void 0 : l.bindTo) || "/",
|
|
3823
|
+
selectedFields: (m = n.bindingSourceContext) == null ? void 0 : m.bindingEntityFields
|
|
3824
|
+
};
|
|
3825
|
+
return new ei(e, o).createComponent(s);
|
|
3826
|
+
} else
|
|
3827
|
+
return t;
|
|
3828
|
+
}
|
|
3829
|
+
function ni(e, t, n) {
|
|
3830
|
+
return t;
|
|
3831
|
+
}
|
|
3832
|
+
const oi = "https://json-schema.org/draft/2020-12/schema", ri = "https://farris-design.gitee.io/response-form.schema.json", ii = "response-form", ai = "A Farris Data Collection Component", li = "object", si = {
|
|
3833
|
+
id: {
|
|
3834
|
+
description: "The unique identifier for a form group",
|
|
3835
|
+
type: "string"
|
|
3836
|
+
},
|
|
3837
|
+
type: {
|
|
3838
|
+
description: "The type string of form group component",
|
|
3839
|
+
type: "string",
|
|
3840
|
+
default: "response-form"
|
|
3841
|
+
},
|
|
3842
|
+
appearance: {
|
|
3843
|
+
description: "",
|
|
3844
|
+
type: "object",
|
|
3845
|
+
properties: {
|
|
3846
|
+
class: {
|
|
3847
|
+
type: "string"
|
|
3848
|
+
},
|
|
3849
|
+
style: {
|
|
3850
|
+
type: "string"
|
|
3851
|
+
}
|
|
3852
|
+
},
|
|
3853
|
+
default: {}
|
|
3854
|
+
},
|
|
3855
|
+
contents: {
|
|
3856
|
+
description: "",
|
|
3857
|
+
type: "array",
|
|
3858
|
+
default: []
|
|
3859
|
+
},
|
|
3860
|
+
visible: {
|
|
3861
|
+
description: "",
|
|
3862
|
+
type: "boolean",
|
|
3863
|
+
default: !0
|
|
3864
|
+
},
|
|
3865
|
+
labelAutoOverflow: {
|
|
3866
|
+
description: "",
|
|
3867
|
+
type: "boolean",
|
|
3868
|
+
default: !1
|
|
3869
|
+
},
|
|
3870
|
+
adaptForLanguage: {
|
|
3871
|
+
description: "",
|
|
3872
|
+
type: "boolean",
|
|
3873
|
+
default: !0
|
|
3874
|
+
}
|
|
3875
|
+
}, ui = [
|
|
3876
|
+
"id",
|
|
3877
|
+
"type",
|
|
3878
|
+
"contents"
|
|
3879
|
+
], ci = {
|
|
3880
|
+
$schema: oi,
|
|
3881
|
+
$id: ri,
|
|
3882
|
+
title: ii,
|
|
3883
|
+
description: ai,
|
|
3884
|
+
type: li,
|
|
3885
|
+
properties: si,
|
|
3886
|
+
required: ui
|
|
3887
|
+
}, di = {
|
|
3888
|
+
customClass: { type: String, default: "" },
|
|
3889
|
+
customStyle: { type: String, defaut: "" },
|
|
3890
|
+
/** 控制是否可见 */
|
|
3891
|
+
visible: { type: Boolean, default: !0 },
|
|
3892
|
+
/** 内部控件布局是否响应国际化 */
|
|
3893
|
+
adaptForLanguage: { type: Boolean, default: !0 }
|
|
3894
|
+
};
|
|
3895
|
+
ht(di, ci, $t, ti);
|
|
3896
|
+
const fi = {
|
|
3897
|
+
id: { type: String, default: "" },
|
|
3898
|
+
/** 筛选组件配置器,具体配置项可查看各组件文档 */
|
|
3899
|
+
editor: { type: Object, default: {} },
|
|
3900
|
+
/** value is uncertain because type is uncertain, default value should not be set */
|
|
3901
|
+
modelValue: { type: [String, Boolean, Array, Number] },
|
|
3902
|
+
/**
|
|
3903
|
+
* 作为内嵌编辑器被创建后默认获得焦点
|
|
3904
|
+
*/
|
|
3905
|
+
focusOnCreated: { type: Boolean, default: !1 },
|
|
3906
|
+
/**
|
|
3907
|
+
* 作为内嵌编辑器被创建后默认选中文本
|
|
3908
|
+
*/
|
|
3909
|
+
selectOnCreated: { type: Boolean, default: !1 }
|
|
3910
|
+
};
|
|
3911
|
+
ht(
|
|
3912
|
+
fi,
|
|
3913
|
+
pn,
|
|
3914
|
+
$t,
|
|
3915
|
+
void 0
|
|
3916
|
+
);
|
|
3917
|
+
const pi = "https://json-schema.org/draft/2020-12/schema", mi = "https://farris-design.gitee.io/grid-field-editor.schema.json", vi = "response-form-layout-setting", gi = "A Farris Data Grid Component", yi = "object", hi = {
|
|
3918
|
+
id: {
|
|
3919
|
+
description: "The unique identifier for a Input Group",
|
|
3920
|
+
type: "string"
|
|
3921
|
+
},
|
|
3922
|
+
type: {
|
|
3923
|
+
description: "The type string of Input Group component",
|
|
3924
|
+
type: "string",
|
|
3925
|
+
default: "response-form-layout-setting"
|
|
3926
|
+
},
|
|
3927
|
+
initialState: {
|
|
3928
|
+
description: "",
|
|
3929
|
+
type: "object"
|
|
3930
|
+
}
|
|
3931
|
+
}, bi = [
|
|
3932
|
+
"id",
|
|
3933
|
+
"type"
|
|
3934
|
+
], wi = {
|
|
3935
|
+
$schema: pi,
|
|
3936
|
+
$id: mi,
|
|
3937
|
+
title: vi,
|
|
3938
|
+
description: gi,
|
|
3939
|
+
type: yi,
|
|
3940
|
+
properties: hi,
|
|
3941
|
+
required: bi
|
|
3942
|
+
}, Ci = {
|
|
3943
|
+
initialState: {
|
|
3944
|
+
type: Object,
|
|
3945
|
+
default: {
|
|
3946
|
+
uniqueColClassInSM: 12,
|
|
3947
|
+
uniqueColClassInMD: 6,
|
|
3948
|
+
uniqueColClassInLG: 3,
|
|
3949
|
+
uniqueColClassInEL: 2
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
};
|
|
3953
|
+
Nt(Ci, wi, wr, ni);
|
|
3954
|
+
const xi = {
|
|
3955
|
+
width: { Type: Number, default: 400 },
|
|
3956
|
+
type: { Type: String, default: "info" },
|
|
3957
|
+
title: { Type: String, default: "" },
|
|
3958
|
+
detail: { Type: String, default: "" },
|
|
3959
|
+
okButtonText: { Type: String, default: "确定" },
|
|
3960
|
+
showOkButton: { Type: Boolean, default: !0 },
|
|
3961
|
+
showCancelButton: { Type: Boolean, default: !0 },
|
|
3962
|
+
cancelButtonText: { Type: String, default: "取消" },
|
|
3963
|
+
exceptionInfo: { Type: Object, default: null },
|
|
3964
|
+
promptEditorType: { Type: String, default: "text-area" },
|
|
3965
|
+
buttons: { type: Object, default: [] }
|
|
3966
|
+
};
|
|
3967
|
+
function Ht() {
|
|
3968
|
+
return new DOMException("The request is not allowed", "NotAllowedError");
|
|
3969
|
+
}
|
|
3970
|
+
async function Si(e) {
|
|
3971
|
+
if (!navigator.clipboard)
|
|
3972
|
+
throw Ht();
|
|
3973
|
+
return navigator.clipboard.writeText(e);
|
|
3974
|
+
}
|
|
3975
|
+
async function Ti(e) {
|
|
3976
|
+
const t = document.createElement("span");
|
|
3977
|
+
t.textContent = e, t.style.whiteSpace = "pre", t.style.webkitUserSelect = "auto", t.style.userSelect = "all", document.body.appendChild(t);
|
|
3978
|
+
const n = window.getSelection(), o = window.document.createRange();
|
|
3979
|
+
n == null || n.removeAllRanges(), o.selectNode(t), n == null || n.addRange(o);
|
|
3980
|
+
let r = !1;
|
|
3981
|
+
try {
|
|
3982
|
+
r = window.document.execCommand("copy");
|
|
3983
|
+
} finally {
|
|
3984
|
+
n == null || n.removeAllRanges(), window.document.body.removeChild(t);
|
|
3985
|
+
}
|
|
3986
|
+
if (!r)
|
|
3987
|
+
throw Ht();
|
|
3988
|
+
}
|
|
3989
|
+
async function Bi(e) {
|
|
3990
|
+
try {
|
|
3991
|
+
await Si(e);
|
|
3992
|
+
} catch (t) {
|
|
3993
|
+
try {
|
|
3994
|
+
await Ti(e);
|
|
3995
|
+
} catch (n) {
|
|
3996
|
+
throw n || t || Ht();
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
function ki() {
|
|
4001
|
+
async function e(t) {
|
|
4002
|
+
await Bi(t);
|
|
4003
|
+
}
|
|
4004
|
+
return { onCopy: e };
|
|
4005
|
+
}
|
|
4006
|
+
function Fi(e, t, n, o) {
|
|
4007
|
+
const r = h(14), i = h(140), a = h(""), u = h(o.value.length), c = D(() => o.value), l = D(() => ({
|
|
4008
|
+
"font-size": `${r.value}px`,
|
|
4009
|
+
height: "100%"
|
|
4010
|
+
}));
|
|
4011
|
+
function m(d) {
|
|
4012
|
+
if (d.currentTarget) {
|
|
4013
|
+
const p = d.currentTarget.value || "";
|
|
4014
|
+
u.value = p.length;
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
4017
|
+
return () => w(at, null, [w("textarea", {
|
|
4018
|
+
title: "promptMessage",
|
|
4019
|
+
name: "promptMessage",
|
|
4020
|
+
class: "form-control",
|
|
4021
|
+
style: l.value,
|
|
4022
|
+
rows: "4",
|
|
4023
|
+
maxlength: i.value,
|
|
4024
|
+
onInput: (d) => m(d)
|
|
4025
|
+
}, [c.value]), w("span", {
|
|
4026
|
+
class: "textarea-wordcount",
|
|
4027
|
+
title: a.value,
|
|
4028
|
+
style: "position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"
|
|
4029
|
+
}, [u.value + " / " + i.value])]);
|
|
4030
|
+
}
|
|
4031
|
+
function Ii(e, t, n, o) {
|
|
4032
|
+
const r = Fi(e, t, n, o), i = /* @__PURE__ */ new Map([["text-area", r]]);
|
|
4033
|
+
function a(u) {
|
|
4034
|
+
return i.get(u) || null;
|
|
4035
|
+
}
|
|
4036
|
+
return { getEditorRender: a };
|
|
4037
|
+
}
|
|
4038
|
+
function Ei() {
|
|
4039
|
+
const e = h(!1), t = h("复制成功");
|
|
4040
|
+
return {
|
|
4041
|
+
feedbackStyle: D(() => {
|
|
4042
|
+
const o = {
|
|
4043
|
+
position: "absolute",
|
|
4044
|
+
left: "50%",
|
|
4045
|
+
top: "50%",
|
|
4046
|
+
"min-width": "100px",
|
|
4047
|
+
height: "40px",
|
|
4048
|
+
background: "#303C53",
|
|
4049
|
+
"line-height": "40px",
|
|
4050
|
+
"text-align": "center",
|
|
4051
|
+
"margin-left": "-30px",
|
|
4052
|
+
"margin-top": "-50px",
|
|
4053
|
+
"border-radius": "10px",
|
|
4054
|
+
"box-shadow": "0px 2px 8px 0px",
|
|
4055
|
+
color: "#fff",
|
|
4056
|
+
transition: "all .3s ease",
|
|
4057
|
+
padding: "0 10px"
|
|
4058
|
+
};
|
|
4059
|
+
return o.opacity = e.value ? "0.8" : "0", o.display = e.value ? "" : "none", o;
|
|
4060
|
+
}),
|
|
4061
|
+
feedbackMessage: t,
|
|
4062
|
+
toShowFeedback: e
|
|
4063
|
+
};
|
|
4064
|
+
}
|
|
4065
|
+
function Oi(e, t) {
|
|
4066
|
+
const n = t.getEditorRender(e.promptEditorType);
|
|
4067
|
+
return () => n && n();
|
|
4068
|
+
}
|
|
4069
|
+
function Mi(e, t) {
|
|
4070
|
+
function n(s) {
|
|
4071
|
+
if (s == null)
|
|
4072
|
+
return 0;
|
|
4073
|
+
let f = 0;
|
|
4074
|
+
for (let v = 0; v < s.length; v++) {
|
|
4075
|
+
const x = s.charCodeAt(v);
|
|
4076
|
+
x >= 0 && x <= 128 ? f++ : f = f + 2;
|
|
4077
|
+
}
|
|
4078
|
+
return f;
|
|
4079
|
+
}
|
|
4080
|
+
function o(s, f) {
|
|
4081
|
+
if (s !== "" && s !== void 0 && s !== null) {
|
|
4082
|
+
s = "" + s;
|
|
4083
|
+
const v = s.length;
|
|
4084
|
+
let x = "", k = 0;
|
|
4085
|
+
for (let E = 0; E < v; E++) {
|
|
4086
|
+
const z = s.charAt(E);
|
|
4087
|
+
if (k++, encodeURI(z).length > 4 && k++, x = x.concat(z), k >= f)
|
|
4088
|
+
return x = x.concat("..."), x;
|
|
4089
|
+
}
|
|
4090
|
+
if (k < f)
|
|
4091
|
+
return s;
|
|
4092
|
+
}
|
|
4093
|
+
return "";
|
|
4094
|
+
}
|
|
4095
|
+
const r = D(() => !!e.value && !!e.value.date), i = D(() => {
|
|
4096
|
+
const s = e.value && e.value.date || "";
|
|
4097
|
+
return `${t.exception.happend} : ${s}`;
|
|
4098
|
+
}), a = D(() => !!e.value && !!e.value.detail), u = D(() => e.value ? n(e.value.detail) > 160 : !1), c = h(!1), l = D(() => c.value ? t.exception.collapse : t.exception.expand), m = D(() => {
|
|
4099
|
+
const s = t.exception.detail + " : " + (e.value && e.value.detail) || "";
|
|
4100
|
+
return c.value ? s : o(s, 160);
|
|
4101
|
+
}), d = D(() => ({
|
|
4102
|
+
position: "absolute",
|
|
4103
|
+
right: 0,
|
|
4104
|
+
bottom: c.value ? 0 : "2px",
|
|
4105
|
+
color: "#2A87FF",
|
|
4106
|
+
cursor: "pointer"
|
|
4107
|
+
}));
|
|
4108
|
+
function p() {
|
|
4109
|
+
c.value = !c.value;
|
|
4110
|
+
}
|
|
4111
|
+
return () => w("div", {
|
|
4112
|
+
class: "toast-msg-detail"
|
|
4113
|
+
}, [r.value && w("div", null, [i.value]), a.value && w("div", {
|
|
4114
|
+
class: "exception_wrap"
|
|
4115
|
+
}, [w("div", {
|
|
4116
|
+
class: "exception_error_msg"
|
|
4117
|
+
}, [w("div", {
|
|
4118
|
+
innerHTML: m.value
|
|
4119
|
+
}, null), u.value && w("span", {
|
|
4120
|
+
style: d.value,
|
|
4121
|
+
onClick: p
|
|
4122
|
+
}, [l.value])])])]);
|
|
4123
|
+
}
|
|
4124
|
+
function Ri(e) {
|
|
4125
|
+
return () => w("p", {
|
|
4126
|
+
class: "toast-msg-detail",
|
|
4127
|
+
innerHTML: e.value
|
|
4128
|
+
}, null);
|
|
4129
|
+
}
|
|
4130
|
+
function ji(e, t, n, o, r) {
|
|
4131
|
+
const i = h(e.exceptionInfo), a = D(() => {
|
|
4132
|
+
const f = t.value === "question" ? "warning" : t.value, v = {
|
|
4133
|
+
"f-icon": !0
|
|
4134
|
+
}, x = `f-icon-${f}`;
|
|
4135
|
+
return v[x] = !0, v;
|
|
4136
|
+
}), u = D(() => n.value || i.value && i.value.message), c = D(() => o.value), l = D(() => !!o.value), m = D(() => !!i.value);
|
|
4137
|
+
function d() {
|
|
4138
|
+
return m.value ? Mi(i, r) : l.value ? Ri(c) : () => null;
|
|
4139
|
+
}
|
|
4140
|
+
const p = d(), s = D(() => r.locale === "en" ? {
|
|
4141
|
+
wordBreak: "keep-all",
|
|
4142
|
+
overflowWrap: "break-word"
|
|
4143
|
+
} : {});
|
|
4144
|
+
return () => w(at, null, [w("div", {
|
|
4145
|
+
class: "float-left modal-tips-iconwrap"
|
|
4146
|
+
}, [w("span", {
|
|
4147
|
+
class: a.value
|
|
4148
|
+
}, null)]), w("div", {
|
|
4149
|
+
class: "modal-tips-content"
|
|
4150
|
+
}, [w("p", {
|
|
4151
|
+
class: "toast-msg-title",
|
|
4152
|
+
innerHTML: u.value,
|
|
4153
|
+
style: s.value
|
|
4154
|
+
}, null), p()])]);
|
|
4155
|
+
}
|
|
4156
|
+
function Ni(e, t, n, o) {
|
|
4157
|
+
const {
|
|
4158
|
+
onCopy: r
|
|
4159
|
+
} = t, {
|
|
4160
|
+
toShowFeedback: i
|
|
4161
|
+
} = n, a = h(o.exception.copySuccess || "复制成功"), u = h(o.exception.copy || "复制详细信息"), c = h(e.exceptionInfo || {
|
|
4162
|
+
date: "",
|
|
4163
|
+
message: "",
|
|
4164
|
+
detail: ""
|
|
4165
|
+
}), l = D(() => c.value && c.value.detail || "");
|
|
4166
|
+
function m(d) {
|
|
4167
|
+
r(l.value).catch((p) => {
|
|
4168
|
+
a.value = o.exception.copyFailed || "复制失败";
|
|
4169
|
+
}).finally(() => {
|
|
4170
|
+
i.value = !0, setTimeout(() => {
|
|
4171
|
+
i.value = !1;
|
|
4172
|
+
}, 700);
|
|
4173
|
+
});
|
|
4174
|
+
}
|
|
4175
|
+
return () => w("span", {
|
|
4176
|
+
style: "width: 100%;color: #2A87FF;padding-left: 37px;"
|
|
4177
|
+
}, [w("span", {
|
|
4178
|
+
onClick: m,
|
|
4179
|
+
style: "cursor: pointer;"
|
|
4180
|
+
}, [u.value])]);
|
|
4181
|
+
}
|
|
4182
|
+
function Pi(e, t, n, o, r) {
|
|
4183
|
+
const i = h(e.type), a = h(e.buttons), u = h(e.exceptionInfo), c = h(r.ok || e.okButtonText), l = h(r.cancel || e.cancelButtonText), m = h(e.showCancelButton), d = h(e.showOkButton), p = D(() => !!(a.value && a.value.length)), s = D(() => u.value && u.value.message && u.value.detail), f = D(() => !(a.value && a.value.length) && (d.value || m.value)), v = Ni(e, n, o, r);
|
|
4184
|
+
c.value === "关闭" ? c.value = r.close : c.value === "知道了" && (c.value = r.exception.roger);
|
|
4185
|
+
function x(E) {
|
|
4186
|
+
i.value === "question" && t.emit("reject"), t.emit("close");
|
|
4187
|
+
}
|
|
4188
|
+
function k(E) {
|
|
4189
|
+
i.value === "question" && t.emit("accept"), t.emit("close");
|
|
4190
|
+
}
|
|
4191
|
+
return () => w("div", {
|
|
4192
|
+
class: "modal-footer"
|
|
4193
|
+
}, [s.value && v(), f.value && m.value && w("button", {
|
|
4194
|
+
type: "button",
|
|
4195
|
+
class: "btn btn-secondary btn-lg",
|
|
4196
|
+
onClick: x
|
|
4197
|
+
}, [l.value]), f.value && d.value && w("button", {
|
|
4198
|
+
type: "button",
|
|
4199
|
+
class: "btn btn-primary btn-lg",
|
|
4200
|
+
onClick: k
|
|
4201
|
+
}, [c.value]), p.value && a.value.length && a.value.map((E) => w("button", {
|
|
4202
|
+
type: "button",
|
|
4203
|
+
onClick: E.handle,
|
|
4204
|
+
class: E.class
|
|
4205
|
+
}, [E.iconClass && w("span", {
|
|
4206
|
+
class: E.iconClass
|
|
4207
|
+
}, null), E.text]))]);
|
|
4208
|
+
}
|
|
4209
|
+
function Di(e) {
|
|
4210
|
+
const { t, locale: n } = Dt();
|
|
4211
|
+
function o(r, i, a) {
|
|
4212
|
+
return i === a ? t(r) : i;
|
|
4213
|
+
}
|
|
4214
|
+
return {
|
|
4215
|
+
yes: o("messageBox.yes") || "是",
|
|
4216
|
+
no: o("messageBox.no") || "否",
|
|
4217
|
+
close: o("messageBox.close") || "关闭",
|
|
4218
|
+
ok: o("messageBox.ok", e.okButtonText, "确定") || "确定",
|
|
4219
|
+
cancel: o("messageBox.cancel", e.cancelButtonText, "取消") || "取消",
|
|
4220
|
+
title: o("messageBox.title") || "系统提示",
|
|
4221
|
+
errorTitle: o("messageBox.errorTitle") || "错误提示",
|
|
4222
|
+
exception: {
|
|
4223
|
+
expand: o("messageBox.exception.expand") || "展开",
|
|
4224
|
+
collapse: o("messageBox.exception.collapse") || "收起",
|
|
4225
|
+
happend: o("messageBox.exception.happend") || "发生时间",
|
|
4226
|
+
detail: o("messageBox.exception.detail") || "详细信息",
|
|
4227
|
+
copy: o("messageBox.exception.copy") || "复制详细信息",
|
|
4228
|
+
copySuccess: o("messageBox.exception.copySuccess") || "复制成功",
|
|
4229
|
+
copyFailed: o("messageBox.exception.copyFailed") || "复制失败",
|
|
4230
|
+
roger: o("messageBox.exception.roger") || "知道了"
|
|
4231
|
+
},
|
|
4232
|
+
locale: n.value
|
|
4233
|
+
};
|
|
4234
|
+
}
|
|
4235
|
+
const pt = /* @__PURE__ */ Ge({
|
|
4236
|
+
name: "FMessageBox",
|
|
4237
|
+
props: xi,
|
|
4238
|
+
emits: ["accept", "reject", "close"],
|
|
4239
|
+
setup(e, t) {
|
|
4240
|
+
const n = Di(e), o = h(e.type), r = h(e.title), i = h(e.detail), a = D(() => {
|
|
4241
|
+
const k = {
|
|
4242
|
+
"modal-tips": !0,
|
|
4243
|
+
"d-flex": !0,
|
|
4244
|
+
"flex-row": !0
|
|
4245
|
+
}, E = `messager-type-${o.value}`;
|
|
4246
|
+
return k[E] = !0, k;
|
|
4247
|
+
}), u = D(() => {
|
|
4248
|
+
const k = {
|
|
4249
|
+
cursor: "default"
|
|
4250
|
+
};
|
|
4251
|
+
return o.value === "prompt" ? k.padding = "0.5rem 0.5rem 1rem 1.5rem" : o.value === "error" && (k.padding = "0.5rem 1.5rem 1rem 1.5rem"), k;
|
|
4252
|
+
}), c = ki(), l = Ii(e, o, r, i), m = Ei(), {
|
|
4253
|
+
feedbackStyle: d,
|
|
4254
|
+
feedbackMessage: p
|
|
4255
|
+
} = m;
|
|
4256
|
+
p.value = n.exception.copySuccess;
|
|
4257
|
+
function s() {
|
|
4258
|
+
return w("div", {
|
|
4259
|
+
style: d.value
|
|
4260
|
+
}, [p.value]);
|
|
4261
|
+
}
|
|
4262
|
+
function f() {
|
|
4263
|
+
switch (o.value) {
|
|
4264
|
+
case "prompt":
|
|
4265
|
+
return Oi(e, l);
|
|
4266
|
+
default:
|
|
4267
|
+
return ji(e, o, r, i, n);
|
|
4268
|
+
}
|
|
4269
|
+
}
|
|
4270
|
+
const v = f(), x = Pi(e, t, c, m, n);
|
|
4271
|
+
return () => w("div", {
|
|
4272
|
+
class: "farris-messager"
|
|
4273
|
+
}, [!e.exceptionInfo && w("div", {
|
|
4274
|
+
style: "height: 30px;width: 100%;position: absolute;",
|
|
4275
|
+
class: "messager-draggable"
|
|
4276
|
+
}, null), w("section", {
|
|
4277
|
+
class: a.value,
|
|
4278
|
+
style: u.value
|
|
4279
|
+
}, [v()]), x(), s()]);
|
|
4280
|
+
}
|
|
4281
|
+
}), Fe = class Fe {
|
|
4282
|
+
static show(t) {
|
|
4283
|
+
const n = $e({
|
|
4284
|
+
...t
|
|
4285
|
+
}), o = !1, r = n.type === "error" || n.type === "prompt", i = n.type === "error" ? "错误提示" : n.type === "prompt" && n.title || "", a = n.acceptCallback || (() => {
|
|
4286
|
+
}), u = n.rejectCallback || (() => {
|
|
4287
|
+
});
|
|
4288
|
+
let c = null, l = new en(Fe.app);
|
|
4289
|
+
const m = () => {
|
|
4290
|
+
c && (c == null || c.destroy(), l = null);
|
|
4291
|
+
};
|
|
4292
|
+
return c = l == null ? void 0 : l.open({
|
|
4293
|
+
class: "modal-message modal-message-type-info",
|
|
4294
|
+
title: i,
|
|
4295
|
+
showButtons: o,
|
|
4296
|
+
showHeader: r,
|
|
4297
|
+
width: n.width || 400,
|
|
4298
|
+
fitContent: !0,
|
|
4299
|
+
showMaxButton: !1,
|
|
4300
|
+
draggable: !0,
|
|
4301
|
+
dragHandle: ".messager-draggable",
|
|
4302
|
+
render: () => w(pt, gt(n, {
|
|
4303
|
+
onAccept: a,
|
|
4304
|
+
onReject: u,
|
|
4305
|
+
onClose: m
|
|
4306
|
+
}), null)
|
|
4307
|
+
}), l == null ? void 0 : l.getCurrentModal();
|
|
4308
|
+
}
|
|
4309
|
+
static info(t, n) {
|
|
4310
|
+
const o = $e({
|
|
4311
|
+
type: "info",
|
|
4312
|
+
title: t,
|
|
4313
|
+
detail: n,
|
|
4314
|
+
okButtonText: "知道了",
|
|
4315
|
+
showCancelButton: !1
|
|
4316
|
+
});
|
|
4317
|
+
Fe.show(o);
|
|
4318
|
+
}
|
|
4319
|
+
static warning(t, n) {
|
|
4320
|
+
const o = $e({
|
|
4321
|
+
type: "warning",
|
|
4322
|
+
title: t,
|
|
4323
|
+
detail: n,
|
|
4324
|
+
okButtonText: "知道了",
|
|
4325
|
+
showCancelButton: !1
|
|
4326
|
+
});
|
|
4327
|
+
Fe.show(o);
|
|
4328
|
+
}
|
|
4329
|
+
static success(t, n) {
|
|
4330
|
+
const o = $e({
|
|
4331
|
+
type: "success",
|
|
4332
|
+
title: t,
|
|
4333
|
+
detail: n,
|
|
4334
|
+
okButtonText: "关闭",
|
|
4335
|
+
showCancelButton: !1
|
|
4336
|
+
});
|
|
4337
|
+
Fe.show(o);
|
|
4338
|
+
}
|
|
4339
|
+
static error(t, n, o) {
|
|
4340
|
+
const r = $e({
|
|
4341
|
+
width: 500,
|
|
4342
|
+
type: "error",
|
|
4343
|
+
okButtonText: "关闭",
|
|
4344
|
+
showCancelButton: !1,
|
|
4345
|
+
exceptionInfo: {
|
|
4346
|
+
date: o,
|
|
4347
|
+
message: t,
|
|
4348
|
+
detail: n
|
|
4349
|
+
}
|
|
4350
|
+
});
|
|
4351
|
+
Fe.show(r);
|
|
4352
|
+
}
|
|
4353
|
+
static prompt(t, n) {
|
|
4354
|
+
const o = $e({
|
|
4355
|
+
type: "prompt",
|
|
4356
|
+
title: t,
|
|
4357
|
+
detail: n,
|
|
4358
|
+
okButtonText: "确定",
|
|
4359
|
+
cancelButtonText: "取消"
|
|
4360
|
+
});
|
|
4361
|
+
Fe.show(o);
|
|
4362
|
+
}
|
|
4363
|
+
static question(t, n, o, r) {
|
|
4364
|
+
const i = $e({
|
|
4365
|
+
type: "question",
|
|
4366
|
+
title: t,
|
|
4367
|
+
detail: n,
|
|
4368
|
+
okButtonText: "确定",
|
|
4369
|
+
cancelButtonText: "取消",
|
|
4370
|
+
acceptCallback: o,
|
|
4371
|
+
rejectCallback: r
|
|
4372
|
+
});
|
|
4373
|
+
Fe.show(i);
|
|
4374
|
+
}
|
|
4375
|
+
};
|
|
4376
|
+
ye(Fe, "app", null);
|
|
4377
|
+
let mt = Fe;
|
|
4378
|
+
pt.install = (e) => {
|
|
4379
|
+
e.component(pt.name, pt), mt.app = e, e.provide("FMessageBoxService", mt);
|
|
4380
|
+
};
|
|
4381
|
+
const mn = Symbol("FModalService");
|
|
4382
|
+
We.install = (e) => {
|
|
4383
|
+
e.component(We.name, We);
|
|
4384
|
+
const t = new en(e);
|
|
4385
|
+
e.provide(mn, t), e.provide("FModalService", t);
|
|
4386
|
+
};
|
|
4387
|
+
We.register = (e, t, n, o) => {
|
|
4388
|
+
e.modal = We, t.modal = Ao, o.modal = { callbackResolver: Vo };
|
|
4389
|
+
};
|
|
4390
|
+
function vn(e, t) {
|
|
4391
|
+
function n() {
|
|
4392
|
+
const o = e.beforeOpen || e.beforeClickButton || null;
|
|
4393
|
+
let r = Promise.resolve(!0);
|
|
4394
|
+
if (o) {
|
|
4395
|
+
const i = o(t.value);
|
|
4396
|
+
if (typeof i > "u")
|
|
4397
|
+
return r;
|
|
4398
|
+
typeof i == "boolean" ? r = Promise.resolve(i) : r = i;
|
|
4399
|
+
}
|
|
4400
|
+
return r;
|
|
4401
|
+
}
|
|
4402
|
+
return { judgeCanOpen: n };
|
|
4403
|
+
}
|
|
4404
|
+
function $i(e, t, n, o, r) {
|
|
4405
|
+
const i = h(e.buttonBehavior), a = h(e.popupOnInput), u = D(() => ({
|
|
4406
|
+
"input-group-append": !0,
|
|
4407
|
+
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
4408
|
+
})), { judgeCanOpen: c } = vn(e, r), l = D(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable), m = Jt(mn, null), d = h();
|
|
4409
|
+
async function p(v) {
|
|
4410
|
+
if (await c() && l.value) {
|
|
4411
|
+
const x = !!t.slots.default;
|
|
4412
|
+
if (i.value === "Modal") {
|
|
4413
|
+
const k = e.modalOptions, E = m == null ? void 0 : m.open({
|
|
4414
|
+
...k,
|
|
4415
|
+
render: () => t.slots.default && t.slots.default()
|
|
4416
|
+
});
|
|
4417
|
+
d.value = E == null ? void 0 : E.modalRef;
|
|
4418
|
+
}
|
|
4419
|
+
i.value === "Overlay" && Io.show({
|
|
4420
|
+
// host: buttonEditRef.value,
|
|
4421
|
+
host: document.body,
|
|
4422
|
+
backgroundColor: "rgba(0,0,0,.15)",
|
|
4423
|
+
render: () => t.slots.default && t.slots.default()
|
|
4424
|
+
}), x && i.value === "Popup" && o.togglePopup(!0), x && a.value && o.hidePopup(), t.emit("clickButton", { origin: v, value: e.modelValue });
|
|
4425
|
+
}
|
|
4426
|
+
}
|
|
4427
|
+
function s(v) {
|
|
4428
|
+
t.emit("mouseEnterIcon", v);
|
|
4429
|
+
}
|
|
4430
|
+
function f(v) {
|
|
4431
|
+
t.emit("mouseLeaveIcon", v);
|
|
4432
|
+
}
|
|
4433
|
+
return {
|
|
4434
|
+
buttonGroupClass: u,
|
|
4435
|
+
onClickButton: p,
|
|
4436
|
+
onMouseEnterButton: s,
|
|
4437
|
+
onMouseLeaveButton: f,
|
|
4438
|
+
modalRef: d
|
|
4439
|
+
};
|
|
4440
|
+
}
|
|
4441
|
+
const Qe = "FarrisVue_PopoverInstancesKey";
|
|
4442
|
+
function Hi(e, t, n, o) {
|
|
4443
|
+
const r = h(), i = h(!1), { judgeCanOpen: a } = vn(e, o);
|
|
4444
|
+
xe(() => r.value, (s, f) => {
|
|
4445
|
+
window[Qe] = window[Qe] || /* @__PURE__ */ new WeakMap(), s ? window[Qe].set(n.value, s) : window[Qe].delete(n.value);
|
|
4446
|
+
});
|
|
4447
|
+
function u() {
|
|
4448
|
+
if (window[Qe]) {
|
|
4449
|
+
const s = window[Qe];
|
|
4450
|
+
document.querySelectorAll(".f-button-edit,.v-popover").forEach((f) => {
|
|
4451
|
+
const v = s.get(f);
|
|
4452
|
+
v && f !== n.value && !n.value.closest(".popover-fitcontent") && v.hide();
|
|
4453
|
+
});
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
function c() {
|
|
4457
|
+
const s = r.value;
|
|
4458
|
+
s && s.show(n.value);
|
|
4459
|
+
}
|
|
4460
|
+
async function l(s = !1) {
|
|
4461
|
+
if (!!t.slots.default) {
|
|
4462
|
+
if (!s && !i.value && !await a())
|
|
4463
|
+
return;
|
|
4464
|
+
i.value = !i.value, await Ke(), c();
|
|
4465
|
+
}
|
|
4466
|
+
}
|
|
4467
|
+
async function m(s = !1) {
|
|
4468
|
+
if (!!t.slots.default) {
|
|
4469
|
+
if (!s && !await a())
|
|
4470
|
+
return;
|
|
4471
|
+
i.value = !0, await Ke(), c();
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
function d() {
|
|
4475
|
+
i.value = !1;
|
|
4476
|
+
}
|
|
4477
|
+
function p() {
|
|
4478
|
+
i.value = !0, Ke(() => {
|
|
4479
|
+
c();
|
|
4480
|
+
});
|
|
4481
|
+
}
|
|
4482
|
+
return { hidePopup: d, showPopup: p, popup: m, shouldPopupContent: i, togglePopup: l, popoverRef: r, closeAllPopover: u };
|
|
4483
|
+
}
|
|
4484
|
+
function Li(e, t, n) {
|
|
4485
|
+
const {
|
|
4486
|
+
buttonGroupClass: o
|
|
4487
|
+
} = n, r = h();
|
|
4488
|
+
return {
|
|
4489
|
+
renderButtonGroup: () => w("div", {
|
|
4490
|
+
id: e.id ? `${e.id}-button-group` : void 0,
|
|
4491
|
+
class: o.value
|
|
4492
|
+
}, [t.slots.buttonContent ? w("span", {
|
|
4493
|
+
class: "input-group-text input-group-append-button"
|
|
4494
|
+
}, [t.slots.buttonContent()]) : e.buttonContent ? w("span", {
|
|
4495
|
+
class: "input-group-text input-group-append-button",
|
|
4496
|
+
innerHTML: e.buttonContent,
|
|
4497
|
+
ref: r
|
|
4498
|
+
}, null) : null]),
|
|
4499
|
+
buttonHandleElement: r
|
|
4500
|
+
};
|
|
4501
|
+
}
|
|
4502
|
+
const vt = /* @__PURE__ */ Ge({
|
|
4503
|
+
name: "FButtonEdit",
|
|
4504
|
+
props: So,
|
|
4505
|
+
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
|
|
4506
|
+
setup(e, t) {
|
|
4507
|
+
const n = h(), o = Jt("design-item-context"), r = $n(n, o), i = h(e.customClass), a = h(e.modelValue), u = Hi(e, t, n, a), c = $i(e, t, n, u, a), l = h(), m = D(() => ({
|
|
4508
|
+
"f-cmp-inputgroup": !0,
|
|
4509
|
+
"input-group": !0,
|
|
4510
|
+
"f-state-disabled": !0,
|
|
4511
|
+
"f-state-editable": !1,
|
|
4512
|
+
"f-state-readonly": !0
|
|
4513
|
+
}));
|
|
4514
|
+
st(() => {
|
|
4515
|
+
n.value.componentInstance = r;
|
|
4516
|
+
}), t.expose(r.value);
|
|
4517
|
+
const d = D(() => {
|
|
4518
|
+
const s = {
|
|
4519
|
+
"f-button-edit": !0,
|
|
4520
|
+
"f-cmp-inputgroup": !0,
|
|
4521
|
+
"f-button-edit-nowrap": !e.wrapText
|
|
4522
|
+
};
|
|
4523
|
+
return i.value && i.value.split(" ").reduce((f, v) => (f[v] = !0, f), s), s;
|
|
4524
|
+
}), {
|
|
4525
|
+
renderButtonGroup: p
|
|
4526
|
+
} = Li(e, t, c);
|
|
4527
|
+
return () => w("div", gt(t.attrs, {
|
|
4528
|
+
ref: n,
|
|
4529
|
+
class: d.value,
|
|
4530
|
+
id: e.id ? e.id : void 0
|
|
4531
|
+
}), [w("div", {
|
|
4532
|
+
class: m.value
|
|
4533
|
+
}, [w("input", {
|
|
4534
|
+
ref: l,
|
|
4535
|
+
class: "form-control",
|
|
4536
|
+
readonly: !0,
|
|
4537
|
+
placeholder: e.placeholder
|
|
4538
|
+
}, null), p()])]);
|
|
4539
|
+
}
|
|
4540
|
+
}), zi = /* @__PURE__ */ new Map([
|
|
4541
|
+
["appearance", Ut]
|
|
4542
|
+
]);
|
|
4543
|
+
function Ai(e, t, n) {
|
|
4544
|
+
return t;
|
|
4545
|
+
}
|
|
4546
|
+
const Vi = "https://json-schema.org/draft/2020-12/schema", _i = "https://farris-design.gitee.io/button-edit.schema.json", qi = "button-edit", Wi = "A Farris Input Component", Gi = "object", Ui = {
|
|
4547
|
+
id: {
|
|
4548
|
+
description: "The unique identifier for a Input Group",
|
|
4549
|
+
type: "string"
|
|
4550
|
+
},
|
|
4551
|
+
type: {
|
|
4552
|
+
description: "The type string of Input Group component",
|
|
4553
|
+
type: "string",
|
|
4554
|
+
default: "button-edit"
|
|
4555
|
+
},
|
|
4556
|
+
appearance: {
|
|
4557
|
+
description: "",
|
|
4558
|
+
type: "object",
|
|
4559
|
+
properties: {
|
|
4560
|
+
class: {
|
|
4561
|
+
type: "string"
|
|
4562
|
+
},
|
|
4563
|
+
style: {
|
|
4564
|
+
type: "string"
|
|
4565
|
+
}
|
|
4566
|
+
},
|
|
4567
|
+
default: {}
|
|
4568
|
+
},
|
|
4569
|
+
binding: {
|
|
4570
|
+
description: "",
|
|
4571
|
+
type: "object",
|
|
4572
|
+
default: {}
|
|
4573
|
+
},
|
|
4574
|
+
disable: {
|
|
4575
|
+
type: "string",
|
|
4576
|
+
default: !1
|
|
4577
|
+
},
|
|
4578
|
+
editable: {
|
|
4579
|
+
description: "",
|
|
4580
|
+
type: "boolean",
|
|
4581
|
+
default: !0
|
|
4582
|
+
},
|
|
4583
|
+
enableLinkLabel: {
|
|
4584
|
+
description: "",
|
|
4585
|
+
type: "boolean",
|
|
4586
|
+
default: !1
|
|
4587
|
+
},
|
|
4588
|
+
label: {
|
|
4589
|
+
description: "",
|
|
4590
|
+
type: "string",
|
|
4591
|
+
default: ""
|
|
4592
|
+
},
|
|
4593
|
+
lableWidth: {
|
|
4594
|
+
description: "",
|
|
4595
|
+
type: "number"
|
|
4596
|
+
},
|
|
4597
|
+
placeholder: {
|
|
4598
|
+
description: "",
|
|
4599
|
+
type: "string",
|
|
4600
|
+
default: ""
|
|
4601
|
+
},
|
|
4602
|
+
forcePlaceholder: {
|
|
4603
|
+
description: "",
|
|
4604
|
+
type: "boolean",
|
|
4605
|
+
default: !1
|
|
4606
|
+
},
|
|
4607
|
+
readonly: {
|
|
4608
|
+
description: "",
|
|
4609
|
+
type: "boolean",
|
|
4610
|
+
default: !1
|
|
4611
|
+
},
|
|
4612
|
+
require: {
|
|
4613
|
+
description: "",
|
|
4614
|
+
type: "boolean",
|
|
4615
|
+
default: !1
|
|
4616
|
+
},
|
|
4617
|
+
tabindex: {
|
|
4618
|
+
description: "",
|
|
4619
|
+
type: "number",
|
|
4620
|
+
default: -1
|
|
4621
|
+
},
|
|
4622
|
+
textAlign: {
|
|
4623
|
+
description: "",
|
|
4624
|
+
type: "string",
|
|
4625
|
+
enum: [
|
|
4626
|
+
"left",
|
|
4627
|
+
"middle",
|
|
4628
|
+
"right"
|
|
4629
|
+
],
|
|
4630
|
+
default: "left"
|
|
4631
|
+
},
|
|
4632
|
+
visible: {
|
|
4633
|
+
description: "",
|
|
4634
|
+
type: "boolean",
|
|
4635
|
+
default: !0
|
|
4636
|
+
},
|
|
4637
|
+
onBlur: {
|
|
4638
|
+
description: "",
|
|
4639
|
+
type: "string",
|
|
4640
|
+
default: ""
|
|
4641
|
+
},
|
|
4642
|
+
onClickLinkLabel: {
|
|
4643
|
+
description: "",
|
|
4644
|
+
type: "sting",
|
|
4645
|
+
default: ""
|
|
4646
|
+
},
|
|
4647
|
+
autoComplete: {
|
|
4648
|
+
description: "",
|
|
4649
|
+
type: "boolean",
|
|
4650
|
+
default: !1
|
|
4651
|
+
},
|
|
4652
|
+
buttonContent: {
|
|
4653
|
+
description: "",
|
|
4654
|
+
type: "string",
|
|
4655
|
+
default: ""
|
|
4656
|
+
},
|
|
4657
|
+
enableClear: {
|
|
4658
|
+
description: "",
|
|
4659
|
+
type: "boolean",
|
|
4660
|
+
default: !0
|
|
4661
|
+
},
|
|
4662
|
+
inputType: {
|
|
4663
|
+
description: "",
|
|
4664
|
+
type: "string",
|
|
4665
|
+
enum: [
|
|
4666
|
+
"text",
|
|
4667
|
+
"tag"
|
|
4668
|
+
],
|
|
4669
|
+
default: "text"
|
|
4670
|
+
},
|
|
4671
|
+
multiSelect: {
|
|
4672
|
+
description: "",
|
|
4673
|
+
type: "boolean",
|
|
4674
|
+
default: !1
|
|
4675
|
+
},
|
|
4676
|
+
popup: {
|
|
4677
|
+
description: "",
|
|
4678
|
+
type: "object",
|
|
4679
|
+
properties: {
|
|
4680
|
+
footerButtons: {
|
|
4681
|
+
type: "array",
|
|
4682
|
+
default: []
|
|
4683
|
+
},
|
|
4684
|
+
height: {
|
|
4685
|
+
type: "number",
|
|
4686
|
+
default: 600
|
|
4687
|
+
},
|
|
4688
|
+
dataMapping: {
|
|
4689
|
+
type: "object"
|
|
4690
|
+
},
|
|
4691
|
+
contents: {
|
|
4692
|
+
type: "array",
|
|
4693
|
+
default: []
|
|
4694
|
+
},
|
|
4695
|
+
showMaxButton: {
|
|
4696
|
+
type: "boolean",
|
|
4697
|
+
default: !0
|
|
4698
|
+
},
|
|
4699
|
+
showCloseButton: {
|
|
4700
|
+
type: "boolean",
|
|
4701
|
+
default: !0
|
|
4702
|
+
},
|
|
4703
|
+
showFooter: {
|
|
4704
|
+
type: "boolean",
|
|
4705
|
+
default: !0
|
|
4706
|
+
},
|
|
4707
|
+
title: {
|
|
4708
|
+
type: "string",
|
|
4709
|
+
default: ""
|
|
4710
|
+
},
|
|
4711
|
+
width: {
|
|
4712
|
+
type: "number",
|
|
4713
|
+
default: 800
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
},
|
|
4717
|
+
popupClass: {
|
|
4718
|
+
description: "",
|
|
4719
|
+
type: "sting",
|
|
4720
|
+
default: ""
|
|
4721
|
+
},
|
|
4722
|
+
separator: {
|
|
4723
|
+
type: "string",
|
|
4724
|
+
default: ","
|
|
4725
|
+
},
|
|
4726
|
+
showButtonWhenDisabled: {
|
|
4727
|
+
description: "",
|
|
4728
|
+
type: "boolean",
|
|
4729
|
+
default: !1
|
|
4730
|
+
},
|
|
4731
|
+
wrapText: {
|
|
4732
|
+
type: "boolean",
|
|
4733
|
+
default: !1
|
|
4734
|
+
},
|
|
4735
|
+
onClear: {
|
|
4736
|
+
description: "",
|
|
4737
|
+
type: "string",
|
|
4738
|
+
default: ""
|
|
4739
|
+
}
|
|
4740
|
+
}, Xi = [
|
|
4741
|
+
"id",
|
|
4742
|
+
"type"
|
|
4743
|
+
], Yi = {
|
|
4744
|
+
$schema: Vi,
|
|
4745
|
+
$id: _i,
|
|
4746
|
+
title: qi,
|
|
4747
|
+
description: Wi,
|
|
4748
|
+
type: Gi,
|
|
4749
|
+
properties: Ui,
|
|
4750
|
+
required: Xi
|
|
4751
|
+
}, Ji = "buttonEdit", Qi = "A Farris Component", Zi = "object", Ki = {
|
|
4752
|
+
basic: {
|
|
4753
|
+
description: "Basic Infomation",
|
|
4754
|
+
title: "基本信息",
|
|
4755
|
+
properties: {
|
|
4756
|
+
id: {
|
|
4757
|
+
description: "组件标识",
|
|
4758
|
+
title: "标识",
|
|
4759
|
+
type: "string",
|
|
4760
|
+
readonly: !0
|
|
4761
|
+
},
|
|
4762
|
+
type: {
|
|
4763
|
+
description: "组件类型",
|
|
4764
|
+
title: "控件类型",
|
|
4765
|
+
type: "select",
|
|
4766
|
+
editor: {
|
|
4767
|
+
type: "waiting for modification",
|
|
4768
|
+
enum: []
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
}
|
|
4772
|
+
},
|
|
4773
|
+
behavior: {
|
|
4774
|
+
description: "Basic Infomation",
|
|
4775
|
+
title: "行为",
|
|
4776
|
+
properties: {
|
|
4777
|
+
editable: {
|
|
4778
|
+
description: "",
|
|
4779
|
+
title: "允许编辑",
|
|
4780
|
+
type: "boolean"
|
|
4781
|
+
},
|
|
4782
|
+
readonly: {
|
|
4783
|
+
description: "",
|
|
4784
|
+
title: "只读",
|
|
4785
|
+
type: "string"
|
|
4786
|
+
},
|
|
4787
|
+
required: {
|
|
4788
|
+
description: "",
|
|
4789
|
+
title: "必填",
|
|
4790
|
+
type: "boolean"
|
|
4791
|
+
},
|
|
4792
|
+
visible: {
|
|
4793
|
+
description: "",
|
|
4794
|
+
title: "可见",
|
|
4795
|
+
type: "boolean"
|
|
4796
|
+
},
|
|
4797
|
+
placeholder: {
|
|
4798
|
+
description: "",
|
|
4799
|
+
title: "提示文本",
|
|
4800
|
+
type: "string"
|
|
4801
|
+
},
|
|
4802
|
+
tabindex: {
|
|
4803
|
+
description: "",
|
|
4804
|
+
title: "tab索引",
|
|
4805
|
+
type: "number"
|
|
4806
|
+
},
|
|
4807
|
+
textAlign: {
|
|
4808
|
+
description: "",
|
|
4809
|
+
title: "对齐方式",
|
|
4810
|
+
type: "enum",
|
|
4811
|
+
editor: {
|
|
4812
|
+
type: "combo-list",
|
|
4813
|
+
textField: "name",
|
|
4814
|
+
valueField: "value",
|
|
4815
|
+
data: [
|
|
4816
|
+
{
|
|
4817
|
+
value: "left",
|
|
4818
|
+
name: "左对齐"
|
|
4819
|
+
},
|
|
4820
|
+
{
|
|
4821
|
+
value: "center",
|
|
4822
|
+
name: "居中"
|
|
4823
|
+
},
|
|
4824
|
+
{
|
|
4825
|
+
value: "right",
|
|
4826
|
+
name: "右对齐"
|
|
4827
|
+
}
|
|
4828
|
+
]
|
|
4829
|
+
}
|
|
4830
|
+
}
|
|
4831
|
+
}
|
|
4832
|
+
}
|
|
4833
|
+
}, ea = {
|
|
4834
|
+
title: Ji,
|
|
4835
|
+
description: Qi,
|
|
4836
|
+
type: Zi,
|
|
4837
|
+
categories: Ki
|
|
4838
|
+
}, gn = Nt(
|
|
4839
|
+
Mn,
|
|
4840
|
+
Yi,
|
|
4841
|
+
zi,
|
|
4842
|
+
Ai,
|
|
4843
|
+
ea
|
|
4844
|
+
);
|
|
4845
|
+
vt.register = (e, t, n, o) => {
|
|
4846
|
+
e["button-edit"] = On, t["button-edit"] = gn;
|
|
4847
|
+
};
|
|
4848
|
+
vt.registerDesigner = (e, t, n) => {
|
|
4849
|
+
e["button-edit"] = vt, t["button-edit"] = gn;
|
|
4850
|
+
};
|
|
4851
|
+
const Al = Gt(vt);
|
|
4852
|
+
export {
|
|
4853
|
+
vt as FButtonEditDesign,
|
|
4854
|
+
Al as default,
|
|
4855
|
+
gn as propsResolver
|
|
4856
|
+
};
|