@deppon/deppon-template 2.2.6 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/pro-field/components/DatePicker/FieldDatePicker.vue_vue_type_script_setup_true_lang.vue.js +60 -16
- package/es/pro-field/components/Select/FieldSelect.vue_vue_type_script_setup_true_lang.vue.js +57 -12
- package/es/pro-field/components/TagInput/FieldTagInput.vue_vue_type_script_setup_true_lang.vue.js +118 -56
- package/es/pro-field/components/Text/FieldText.vue.css +12 -2
- package/es/pro-field/components/Text/FieldText.vue_vue_type_script_setup_true_lang.vue.js +104 -27
- package/package.json +6 -6
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import '../../../_virtual/_rollup-plugin-inject-process-env.js';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { ref, computed, openBlock, createElementBlock, Fragment, toDisplayString, createCommentVNode,
|
|
4
|
-
import { ElDatePicker } from '@deppon/deppon-ui';
|
|
3
|
+
import { ref, computed, onMounted, nextTick, onUnmounted, watch, openBlock, createElementBlock, Fragment, toDisplayString, createCommentVNode, createVNode, unref, withCtx, createElementVNode, normalizeClass, mergeProps, renderSlot } from 'vue';
|
|
4
|
+
import { ElTooltip, ElDatePicker } from '@deppon/deppon-ui';
|
|
5
5
|
|
|
6
6
|
var _excluded = ["placeholder", "start-placeholder", "end-placeholder"];
|
|
7
7
|
var _hoisted_1 = {
|
|
8
8
|
key: 0
|
|
9
9
|
};
|
|
10
10
|
var _hoisted_2 = {
|
|
11
|
-
"class": "field-readonly-content"
|
|
12
|
-
};
|
|
13
|
-
var _hoisted_3 = {
|
|
14
11
|
key: 1
|
|
15
12
|
};
|
|
16
|
-
var
|
|
13
|
+
var _hoisted_3 = {
|
|
17
14
|
"class": "field-date-picker-tooltip-wrapper"
|
|
18
15
|
};
|
|
19
|
-
var
|
|
16
|
+
var _hoisted_4 = {
|
|
20
17
|
"class": "field-date-picker-error"
|
|
21
18
|
};
|
|
22
19
|
var script = {
|
|
@@ -89,6 +86,38 @@ var script = {
|
|
|
89
86
|
|
|
90
87
|
// date-picker 引用
|
|
91
88
|
var datePickerRef = ref(null);
|
|
89
|
+
var readonlyRef = ref(null);
|
|
90
|
+
var readonlyOverflow = ref(false);
|
|
91
|
+
var checkReadonlyOverflow = function checkReadonlyOverflow() {
|
|
92
|
+
var el = readonlyRef.value;
|
|
93
|
+
if (!el) {
|
|
94
|
+
readonlyOverflow.value = false;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
readonlyOverflow.value = el.scrollWidth > el.clientWidth;
|
|
98
|
+
};
|
|
99
|
+
var readonlyTooltipContent = computed(function () {
|
|
100
|
+
var _ref2, _displayText$value;
|
|
101
|
+
var v = (_ref2 = (_displayText$value = displayText.value) !== null && _displayText$value !== void 0 ? _displayText$value : props.emptyText) !== null && _ref2 !== void 0 ? _ref2 : '-';
|
|
102
|
+
if (v === null || v === undefined) return '';
|
|
103
|
+
var s = String(v);
|
|
104
|
+
if (!s || s === '-') return '';
|
|
105
|
+
return s;
|
|
106
|
+
});
|
|
107
|
+
onMounted(function () {
|
|
108
|
+
nextTick(checkReadonlyOverflow);
|
|
109
|
+
window.addEventListener('resize', checkReadonlyOverflow);
|
|
110
|
+
});
|
|
111
|
+
onUnmounted(function () {
|
|
112
|
+
window.removeEventListener('resize', checkReadonlyOverflow);
|
|
113
|
+
});
|
|
114
|
+
watch(function () {
|
|
115
|
+
return [props.mode, props.text, props.fieldProps, props.pickerType];
|
|
116
|
+
}, function () {
|
|
117
|
+
return nextTick(checkReadonlyOverflow);
|
|
118
|
+
}, {
|
|
119
|
+
deep: true
|
|
120
|
+
});
|
|
92
121
|
|
|
93
122
|
// 判断是否为日期范围类型
|
|
94
123
|
var isRangeType = computed(function () {
|
|
@@ -149,11 +178,11 @@ var script = {
|
|
|
149
178
|
|
|
150
179
|
// 从 fieldProps 中排除 placeholder 相关属性,避免与单独的属性冲突
|
|
151
180
|
var fieldPropsWithoutPlaceholder = computed(function () {
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var rest = _objectWithoutProperties(
|
|
181
|
+
var _ref3 = props.fieldProps || {};
|
|
182
|
+
_ref3.placeholder;
|
|
183
|
+
_ref3['start-placeholder'];
|
|
184
|
+
_ref3['end-placeholder'];
|
|
185
|
+
var rest = _objectWithoutProperties(_ref3, _excluded);
|
|
157
186
|
return rest;
|
|
158
187
|
});
|
|
159
188
|
var dateValue = computed({
|
|
@@ -195,15 +224,30 @@ var script = {
|
|
|
195
224
|
return props.text || props.emptyText || '-';
|
|
196
225
|
});
|
|
197
226
|
return function (_ctx, _cache) {
|
|
198
|
-
var _props$fieldProps8,
|
|
227
|
+
var _props$fieldProps8, _props$fieldProps9;
|
|
199
228
|
return __props.mode === 'read' ? (openBlock(), createElementBlock(Fragment, {
|
|
200
229
|
key: 0
|
|
201
|
-
}, [(_props$fieldProps8 = __props.fieldProps) !== null && _props$fieldProps8 !== void 0 && _props$fieldProps8.prefix ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.fieldProps.prefix), 1 /* TEXT */)) : createCommentVNode("v-if", true),
|
|
230
|
+
}, [(_props$fieldProps8 = __props.fieldProps) !== null && _props$fieldProps8 !== void 0 && _props$fieldProps8.prefix ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.fieldProps.prefix), 1 /* TEXT */)) : createCommentVNode("v-if", true), createVNode(unref(ElTooltip), {
|
|
231
|
+
content: readonlyTooltipContent.value,
|
|
232
|
+
placement: "top",
|
|
233
|
+
trigger: "click",
|
|
234
|
+
disabled: !readonlyTooltipContent.value || !readonlyOverflow.value
|
|
235
|
+
}, {
|
|
236
|
+
"default": withCtx(function () {
|
|
237
|
+
var _displayText$value2;
|
|
238
|
+
return [createElementVNode("span", {
|
|
239
|
+
ref_key: "readonlyRef",
|
|
240
|
+
ref: readonlyRef,
|
|
241
|
+
"class": "field-readonly-content"
|
|
242
|
+
}, toDisplayString((_displayText$value2 = displayText.value) !== null && _displayText$value2 !== void 0 ? _displayText$value2 : __props.emptyText || '-'), 513 /* TEXT, NEED_PATCH */)];
|
|
243
|
+
}),
|
|
244
|
+
_: 1 /* STABLE */
|
|
245
|
+
}, 8 /* PROPS */, ["content", "disabled"]), (_props$fieldProps9 = __props.fieldProps) !== null && _props$fieldProps9 !== void 0 && _props$fieldProps9.suffix ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.fieldProps.suffix), 1 /* TEXT */)) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */)) : __props.mode === 'edit' || __props.mode === 'update' ? (openBlock(), createElementBlock("div", {
|
|
202
246
|
key: 1,
|
|
203
247
|
"class": normalizeClass(["field-date-picker-wrapper", {
|
|
204
248
|
'has-error': __props.error
|
|
205
249
|
}])
|
|
206
|
-
}, [createElementVNode("div",
|
|
250
|
+
}, [createElementVNode("div", _hoisted_3, [createVNode(unref(ElDatePicker), mergeProps({
|
|
207
251
|
ref_key: "datePickerRef",
|
|
208
252
|
ref: datePickerRef,
|
|
209
253
|
modelValue: dateValue.value,
|
|
@@ -223,7 +267,7 @@ var script = {
|
|
|
223
267
|
key: 0,
|
|
224
268
|
error: __props.error
|
|
225
269
|
}, function () {
|
|
226
|
-
return [createCommentVNode(" 默认错误显示(如果没有提供 error slot) "), createElementVNode("div",
|
|
270
|
+
return [createCommentVNode(" 默认错误显示(如果没有提供 error slot) "), createElementVNode("div", _hoisted_4, toDisplayString(__props.error), 1 /* TEXT */)];
|
|
227
271
|
}) : createCommentVNode("v-if", true)], 2 /* CLASS */)) : createCommentVNode("v-if", true);
|
|
228
272
|
};
|
|
229
273
|
}
|
package/es/pro-field/components/Select/FieldSelect.vue_vue_type_script_setup_true_lang.vue.js
CHANGED
|
@@ -3,8 +3,8 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
4
4
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
5
5
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
6
|
-
import { ref, computed,
|
|
7
|
-
import {
|
|
6
|
+
import { ref, computed, onMounted, nextTick, onUnmounted, watch, shallowRef, openBlock, createElementBlock, Fragment, toDisplayString, createCommentVNode, createVNode, unref, withCtx, createElementVNode, normalizeClass, createBlock, mergeProps, createSlots, withModifiers, createTextVNode, renderList, renderSlot } from 'vue';
|
|
7
|
+
import { ElTooltip, ElCascader, ElCheckbox, ElButton, ElSelect, ElOption } from '@deppon/deppon-ui';
|
|
8
8
|
|
|
9
9
|
var _excluded = ["suffix", "remoteMethod", "query", "total", "pagination"];
|
|
10
10
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
@@ -139,6 +139,38 @@ var script = {
|
|
|
139
139
|
var __emit = _ref.emit;
|
|
140
140
|
var props = __props;
|
|
141
141
|
var emit = __emit;
|
|
142
|
+
var readonlyRef = ref(null);
|
|
143
|
+
var readonlyOverflow = ref(false);
|
|
144
|
+
var checkReadonlyOverflow = function checkReadonlyOverflow() {
|
|
145
|
+
var el = readonlyRef.value;
|
|
146
|
+
if (!el) {
|
|
147
|
+
readonlyOverflow.value = false;
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
readonlyOverflow.value = el.scrollWidth > el.clientWidth;
|
|
151
|
+
};
|
|
152
|
+
var readonlyTooltipContent = computed(function () {
|
|
153
|
+
var _ref2, _displayText$value;
|
|
154
|
+
var v = (_ref2 = (_displayText$value = displayText.value) !== null && _displayText$value !== void 0 ? _displayText$value : props.emptyText) !== null && _ref2 !== void 0 ? _ref2 : '-';
|
|
155
|
+
if (v === null || v === undefined) return '';
|
|
156
|
+
var s = String(v);
|
|
157
|
+
if (!s || s === '-') return '';
|
|
158
|
+
return s;
|
|
159
|
+
});
|
|
160
|
+
onMounted(function () {
|
|
161
|
+
nextTick(checkReadonlyOverflow);
|
|
162
|
+
window.addEventListener('resize', checkReadonlyOverflow);
|
|
163
|
+
});
|
|
164
|
+
onUnmounted(function () {
|
|
165
|
+
window.removeEventListener('resize', checkReadonlyOverflow);
|
|
166
|
+
});
|
|
167
|
+
watch(function () {
|
|
168
|
+
return [props.mode, props.text, props.options, props.fieldProps];
|
|
169
|
+
}, function () {
|
|
170
|
+
return nextTick(checkReadonlyOverflow);
|
|
171
|
+
}, {
|
|
172
|
+
deep: true
|
|
173
|
+
});
|
|
142
174
|
|
|
143
175
|
// Cascader 组件引用
|
|
144
176
|
var cascaderRef = ref(null);
|
|
@@ -2837,15 +2869,28 @@ var script = {
|
|
|
2837
2869
|
return props.text || props.emptyText || '-';
|
|
2838
2870
|
});
|
|
2839
2871
|
return function (_ctx, _cache) {
|
|
2840
|
-
var _props$fieldProps51,
|
|
2872
|
+
var _props$fieldProps51, _props$fieldProps52, _props$fieldProps54, _props$fieldProps55;
|
|
2841
2873
|
return __props.mode === 'read' ? (openBlock(), createElementBlock(Fragment, {
|
|
2842
2874
|
key: 0
|
|
2843
|
-
}, [(_props$fieldProps51 = __props.fieldProps) !== null && _props$fieldProps51 !== void 0 && _props$fieldProps51.prefix && !isEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.fieldProps.prefix), 1 /* TEXT */)) : createCommentVNode("v-if", true),
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
},
|
|
2875
|
+
}, [(_props$fieldProps51 = __props.fieldProps) !== null && _props$fieldProps51 !== void 0 && _props$fieldProps51.prefix && !isEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.fieldProps.prefix), 1 /* TEXT */)) : createCommentVNode("v-if", true), createVNode(unref(ElTooltip), {
|
|
2876
|
+
content: readonlyTooltipContent.value,
|
|
2877
|
+
placement: "top",
|
|
2878
|
+
trigger: "click",
|
|
2879
|
+
disabled: !readonlyTooltipContent.value || !readonlyOverflow.value
|
|
2880
|
+
}, {
|
|
2881
|
+
"default": withCtx(function () {
|
|
2882
|
+
var _displayText$value2;
|
|
2883
|
+
return [createElementVNode("span", {
|
|
2884
|
+
ref_key: "readonlyRef",
|
|
2885
|
+
ref: readonlyRef,
|
|
2886
|
+
"class": normalizeClass({
|
|
2887
|
+
'area-readonly-text': isAreaType.value,
|
|
2888
|
+
'field-readonly-content': true
|
|
2889
|
+
})
|
|
2890
|
+
}, toDisplayString((_displayText$value2 = displayText.value) !== null && _displayText$value2 !== void 0 ? _displayText$value2 : __props.emptyText || '-'), 3 /* TEXT, CLASS */)];
|
|
2891
|
+
}),
|
|
2892
|
+
_: 1 /* STABLE */
|
|
2893
|
+
}, 8 /* PROPS */, ["content", "disabled"]), (_props$fieldProps52 = __props.fieldProps) !== null && _props$fieldProps52 !== void 0 && _props$fieldProps52.suffix && !isEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.fieldProps.suffix), 1 /* TEXT */)) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */)) : __props.mode === 'edit' || __props.mode === 'update' ? (openBlock(), createElementBlock("div", {
|
|
2849
2894
|
key: 1,
|
|
2850
2895
|
"class": normalizeClass(["field-select-wrapper", {
|
|
2851
2896
|
'has-error': __props.error
|
|
@@ -2872,9 +2917,9 @@ var script = {
|
|
|
2872
2917
|
onChange: handleCascaderChange,
|
|
2873
2918
|
onVisibleChange: handleCascaderVisibleChange
|
|
2874
2919
|
}), createSlots({
|
|
2875
|
-
"default": withCtx(function (
|
|
2876
|
-
var node =
|
|
2877
|
-
data =
|
|
2920
|
+
"default": withCtx(function (_ref3) {
|
|
2921
|
+
var node = _ref3.node,
|
|
2922
|
+
data = _ref3.data;
|
|
2878
2923
|
return [createCommentVNode(" 如果提供了 cascaderNodePrefix 插槽,使用插槽内容作为前缀 "), createCommentVNode(" <template v-if=\"$slots.cascaderNodePrefix\">\n <slot name=\"cascaderNodePrefix\" :node=\"node\" :data=\"data\" />\n </template> "), createCommentVNode(" 如果通过 props 配置了 prefix,显示 prefix "), getNodePrefix(node, data) ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(getNodePrefix(node, data)), 1 /* TEXT */)) : createCommentVNode("v-if", true), createCommentVNode(" 如果节点有被禁用的子节点,显示自定义布局 "), data._disabledChildren && data._disabledChildren.length > 0 ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
2879
2924
|
key: 1,
|
|
2880
2925
|
content: getDisabledChildrenTooltip(data._disabledChildren),
|
package/es/pro-field/components/TagInput/FieldTagInput.vue_vue_type_script_setup_true_lang.vue.js
CHANGED
|
@@ -2,8 +2,8 @@ import '../../../_virtual/_rollup-plugin-inject-process-env.js';
|
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
4
4
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
5
|
-
import { ref, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, normalizeClass,
|
|
6
|
-
import { ElInput, ElButton, ElTag } from '@deppon/deppon-ui';
|
|
5
|
+
import { ref, computed, onMounted, nextTick, onUnmounted, watch, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, toDisplayString, createCommentVNode, normalizeClass, withKeys, withModifiers, createTextVNode, TransitionGroup, Fragment, renderList, createBlock } from 'vue';
|
|
6
|
+
import { ElTooltip, ElInput, ElButton, ElTag } from '@deppon/deppon-ui';
|
|
7
7
|
|
|
8
8
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
9
9
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -13,28 +13,25 @@ var _hoisted_1 = {
|
|
|
13
13
|
"class": "field-tag-input-readonly"
|
|
14
14
|
};
|
|
15
15
|
var _hoisted_2 = {
|
|
16
|
-
"class": "field-readonly-content"
|
|
17
|
-
};
|
|
18
|
-
var _hoisted_3 = {
|
|
19
16
|
key: 1,
|
|
20
17
|
"class": "field-tag-input"
|
|
21
18
|
};
|
|
22
|
-
var
|
|
19
|
+
var _hoisted_3 = {
|
|
23
20
|
"class": "tag-input-input-wrap"
|
|
24
21
|
};
|
|
25
|
-
var
|
|
22
|
+
var _hoisted_4 = {
|
|
26
23
|
key: 0,
|
|
27
24
|
"class": "tag-input-tip"
|
|
28
25
|
};
|
|
29
|
-
var
|
|
26
|
+
var _hoisted_5 = {
|
|
30
27
|
key: 0,
|
|
31
28
|
"class": "tag-input-add-error"
|
|
32
29
|
};
|
|
33
|
-
var
|
|
30
|
+
var _hoisted_6 = {
|
|
34
31
|
key: 1,
|
|
35
32
|
"class": "tag-input-list-row"
|
|
36
33
|
};
|
|
37
|
-
var
|
|
34
|
+
var _hoisted_7 = {
|
|
38
35
|
key: 0,
|
|
39
36
|
"class": "tag-input-list-label"
|
|
40
37
|
};
|
|
@@ -72,6 +69,38 @@ var script = {
|
|
|
72
69
|
var removingIndex = ref(-1);
|
|
73
70
|
/** 添加时校验失败的错误信息,在输入框下方展示 */
|
|
74
71
|
var addError = ref('');
|
|
72
|
+
var readonlyRef = ref(null);
|
|
73
|
+
var readonlyOverflow = ref(false);
|
|
74
|
+
var checkReadonlyOverflow = function checkReadonlyOverflow() {
|
|
75
|
+
var el = readonlyRef.value;
|
|
76
|
+
if (!el) {
|
|
77
|
+
readonlyOverflow.value = false;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
readonlyOverflow.value = el.scrollWidth > el.clientWidth;
|
|
81
|
+
};
|
|
82
|
+
var readonlyTooltipContent = computed(function () {
|
|
83
|
+
var _ref2, _displayText$value;
|
|
84
|
+
var v = (_ref2 = (_displayText$value = displayText.value) !== null && _displayText$value !== void 0 ? _displayText$value : props.emptyText) !== null && _ref2 !== void 0 ? _ref2 : '-';
|
|
85
|
+
if (v === null || v === undefined) return '';
|
|
86
|
+
var s = String(v);
|
|
87
|
+
if (!s || s === '-') return '';
|
|
88
|
+
return s;
|
|
89
|
+
});
|
|
90
|
+
onMounted(function () {
|
|
91
|
+
nextTick(checkReadonlyOverflow);
|
|
92
|
+
window.addEventListener('resize', checkReadonlyOverflow);
|
|
93
|
+
});
|
|
94
|
+
onUnmounted(function () {
|
|
95
|
+
window.removeEventListener('resize', checkReadonlyOverflow);
|
|
96
|
+
});
|
|
97
|
+
watch(function () {
|
|
98
|
+
return [props.mode, props.text, props.fieldProps];
|
|
99
|
+
}, function () {
|
|
100
|
+
return nextTick(checkReadonlyOverflow);
|
|
101
|
+
}, {
|
|
102
|
+
deep: true
|
|
103
|
+
});
|
|
75
104
|
var inputPlaceholder = computed(function () {
|
|
76
105
|
var _props$fieldProps$pla, _props$fieldProps;
|
|
77
106
|
return (_props$fieldProps$pla = (_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 ? void 0 : _props$fieldProps.placeholder) !== null && _props$fieldProps$pla !== void 0 ? _props$fieldProps$pla : '请输入';
|
|
@@ -103,8 +132,12 @@ var script = {
|
|
|
103
132
|
|
|
104
133
|
/** 添加时输入框的校验规则:优先 fieldProps.rules(来自 form/column),其次 fieldProps.addRules */
|
|
105
134
|
var addRules = computed(function () {
|
|
106
|
-
var
|
|
107
|
-
return (
|
|
135
|
+
var _ref3, _props$fieldProps$rul, _props$fieldProps8, _props$fieldProps9;
|
|
136
|
+
return (_ref3 = (_props$fieldProps$rul = (_props$fieldProps8 = props.fieldProps) === null || _props$fieldProps8 === void 0 ? void 0 : _props$fieldProps8.rules) !== null && _props$fieldProps$rul !== void 0 ? _props$fieldProps$rul : (_props$fieldProps9 = props.fieldProps) === null || _props$fieldProps9 === void 0 ? void 0 : _props$fieldProps9.addRules) !== null && _ref3 !== void 0 ? _ref3 : [];
|
|
137
|
+
});
|
|
138
|
+
var isDisabled = computed(function () {
|
|
139
|
+
var _props$fieldProps0;
|
|
140
|
+
return ((_props$fieldProps0 = props.fieldProps) === null || _props$fieldProps0 === void 0 ? void 0 : _props$fieldProps0.disabled) === true;
|
|
108
141
|
});
|
|
109
142
|
var tagList = computed(function () {
|
|
110
143
|
var val = props.text;
|
|
@@ -162,40 +195,46 @@ var script = {
|
|
|
162
195
|
}
|
|
163
196
|
function _addItem() {
|
|
164
197
|
_addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
165
|
-
var _inputValue$value, _props$
|
|
198
|
+
var _inputValue$value, _props$fieldProps1;
|
|
166
199
|
var raw, name, list, err, onAdd, result, nextList;
|
|
167
200
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
168
201
|
while (1) switch (_context.prev = _context.next) {
|
|
169
202
|
case 0:
|
|
203
|
+
if (!isDisabled.value) {
|
|
204
|
+
_context.next = 1;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
return _context.abrupt("return");
|
|
208
|
+
case 1:
|
|
170
209
|
addError.value = '';
|
|
171
210
|
raw = (_inputValue$value = inputValue.value) !== null && _inputValue$value !== void 0 ? _inputValue$value : '';
|
|
172
211
|
name = raw.trim();
|
|
173
212
|
list = _toConsumableArray(tagList.value);
|
|
174
213
|
err = validateAddInput(raw, list);
|
|
175
214
|
if (!err) {
|
|
176
|
-
_context.next =
|
|
215
|
+
_context.next = 2;
|
|
177
216
|
break;
|
|
178
217
|
}
|
|
179
218
|
addError.value = err;
|
|
180
219
|
return _context.abrupt("return");
|
|
181
|
-
case
|
|
220
|
+
case 2:
|
|
182
221
|
if (!(list.length >= maxCount.value)) {
|
|
183
|
-
_context.next =
|
|
222
|
+
_context.next = 3;
|
|
184
223
|
break;
|
|
185
224
|
}
|
|
186
225
|
addError.value = "\u6700\u591A\u6DFB\u52A0".concat(maxCount.value, "\u4E2A");
|
|
187
226
|
return _context.abrupt("return");
|
|
188
|
-
case
|
|
189
|
-
onAdd = (_props$
|
|
227
|
+
case 3:
|
|
228
|
+
onAdd = (_props$fieldProps1 = props.fieldProps) === null || _props$fieldProps1 === void 0 ? void 0 : _props$fieldProps1.onAdd;
|
|
190
229
|
if (!(typeof onAdd === 'function')) {
|
|
191
|
-
_context.next =
|
|
230
|
+
_context.next = 9;
|
|
192
231
|
break;
|
|
193
232
|
}
|
|
194
233
|
addLoading.value = true;
|
|
195
|
-
_context.prev =
|
|
196
|
-
_context.next =
|
|
234
|
+
_context.prev = 4;
|
|
235
|
+
_context.next = 5;
|
|
197
236
|
return Promise.resolve(onAdd(name, list));
|
|
198
|
-
case
|
|
237
|
+
case 5:
|
|
199
238
|
result = _context.sent;
|
|
200
239
|
if (Array.isArray(result)) {
|
|
201
240
|
emit('update:text', result);
|
|
@@ -215,18 +254,18 @@ var script = {
|
|
|
215
254
|
return (_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || (_inputRef$value2$focu = _inputRef$value2.focus) === null || _inputRef$value2$focu === void 0 ? void 0 : _inputRef$value2$focu.call(_inputRef$value2);
|
|
216
255
|
});
|
|
217
256
|
}
|
|
218
|
-
_context.next =
|
|
257
|
+
_context.next = 7;
|
|
219
258
|
break;
|
|
220
|
-
case 5:
|
|
221
|
-
_context.prev = 5;
|
|
222
|
-
_context["catch"](3);
|
|
223
259
|
case 6:
|
|
224
260
|
_context.prev = 6;
|
|
225
|
-
|
|
226
|
-
return _context.finish(6);
|
|
261
|
+
_context["catch"](4);
|
|
227
262
|
case 7:
|
|
228
|
-
|
|
263
|
+
_context.prev = 7;
|
|
264
|
+
addLoading.value = false;
|
|
265
|
+
return _context.finish(7);
|
|
229
266
|
case 8:
|
|
267
|
+
return _context.abrupt("return");
|
|
268
|
+
case 9:
|
|
230
269
|
list.push(name);
|
|
231
270
|
emit('update:text', list);
|
|
232
271
|
inputValue.value = '';
|
|
@@ -235,11 +274,11 @@ var script = {
|
|
|
235
274
|
var _inputRef$value3, _inputRef$value3$focu;
|
|
236
275
|
return (_inputRef$value3 = inputRef.value) === null || _inputRef$value3 === void 0 || (_inputRef$value3$focu = _inputRef$value3.focus) === null || _inputRef$value3$focu === void 0 ? void 0 : _inputRef$value3$focu.call(_inputRef$value3);
|
|
237
276
|
});
|
|
238
|
-
case
|
|
277
|
+
case 10:
|
|
239
278
|
case "end":
|
|
240
279
|
return _context.stop();
|
|
241
280
|
}
|
|
242
|
-
}, _callee, null, [[
|
|
281
|
+
}, _callee, null, [[4, 6, 7, 8]]);
|
|
243
282
|
}));
|
|
244
283
|
return _addItem.apply(this, arguments);
|
|
245
284
|
}
|
|
@@ -248,29 +287,35 @@ var script = {
|
|
|
248
287
|
}
|
|
249
288
|
function _removeItem() {
|
|
250
289
|
_removeItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(index) {
|
|
251
|
-
var _props$
|
|
290
|
+
var _props$fieldProps10;
|
|
252
291
|
var list, name, onRemove, result, nextList;
|
|
253
292
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
254
293
|
while (1) switch (_context2.prev = _context2.next) {
|
|
255
294
|
case 0:
|
|
295
|
+
if (!isDisabled.value) {
|
|
296
|
+
_context2.next = 1;
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
return _context2.abrupt("return");
|
|
300
|
+
case 1:
|
|
256
301
|
list = _toConsumableArray(tagList.value);
|
|
257
302
|
name = list[index];
|
|
258
303
|
if (!(name == null)) {
|
|
259
|
-
_context2.next =
|
|
304
|
+
_context2.next = 2;
|
|
260
305
|
break;
|
|
261
306
|
}
|
|
262
307
|
return _context2.abrupt("return");
|
|
263
|
-
case
|
|
264
|
-
onRemove = (_props$
|
|
308
|
+
case 2:
|
|
309
|
+
onRemove = (_props$fieldProps10 = props.fieldProps) === null || _props$fieldProps10 === void 0 ? void 0 : _props$fieldProps10.onRemove;
|
|
265
310
|
if (!(typeof onRemove === 'function')) {
|
|
266
|
-
_context2.next =
|
|
311
|
+
_context2.next = 8;
|
|
267
312
|
break;
|
|
268
313
|
}
|
|
269
314
|
removingIndex.value = index;
|
|
270
|
-
_context2.prev =
|
|
271
|
-
_context2.next =
|
|
315
|
+
_context2.prev = 3;
|
|
316
|
+
_context2.next = 4;
|
|
272
317
|
return Promise.resolve(onRemove(index, name, list));
|
|
273
|
-
case
|
|
318
|
+
case 4:
|
|
274
319
|
result = _context2.sent;
|
|
275
320
|
if (Array.isArray(result)) {
|
|
276
321
|
emit('update:text', result);
|
|
@@ -279,34 +324,48 @@ var script = {
|
|
|
279
324
|
nextList.splice(index, 1);
|
|
280
325
|
emit('update:text', nextList);
|
|
281
326
|
}
|
|
282
|
-
_context2.next =
|
|
327
|
+
_context2.next = 6;
|
|
283
328
|
break;
|
|
284
|
-
case 4:
|
|
285
|
-
_context2.prev = 4;
|
|
286
|
-
_context2["catch"](2);
|
|
287
329
|
case 5:
|
|
288
330
|
_context2.prev = 5;
|
|
289
|
-
|
|
290
|
-
return _context2.finish(5);
|
|
331
|
+
_context2["catch"](3);
|
|
291
332
|
case 6:
|
|
292
|
-
|
|
333
|
+
_context2.prev = 6;
|
|
334
|
+
removingIndex.value = -1;
|
|
335
|
+
return _context2.finish(6);
|
|
293
336
|
case 7:
|
|
337
|
+
return _context2.abrupt("return");
|
|
338
|
+
case 8:
|
|
294
339
|
list.splice(index, 1);
|
|
295
340
|
emit('update:text', list);
|
|
296
|
-
case
|
|
341
|
+
case 9:
|
|
297
342
|
case "end":
|
|
298
343
|
return _context2.stop();
|
|
299
344
|
}
|
|
300
|
-
}, _callee2, null, [[
|
|
345
|
+
}, _callee2, null, [[3, 5, 6, 7]]);
|
|
301
346
|
}));
|
|
302
347
|
return _removeItem.apply(this, arguments);
|
|
303
348
|
}
|
|
304
349
|
return function (_ctx, _cache) {
|
|
305
|
-
return __props.mode === 'read' ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
350
|
+
return __props.mode === 'read' ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ElTooltip), {
|
|
351
|
+
content: readonlyTooltipContent.value,
|
|
352
|
+
placement: "top",
|
|
353
|
+
trigger: "click",
|
|
354
|
+
disabled: !readonlyTooltipContent.value || !readonlyOverflow.value
|
|
355
|
+
}, {
|
|
356
|
+
"default": withCtx(function () {
|
|
357
|
+
return [createElementVNode("span", {
|
|
358
|
+
ref_key: "readonlyRef",
|
|
359
|
+
ref: readonlyRef,
|
|
360
|
+
"class": "field-readonly-content"
|
|
361
|
+
}, toDisplayString(displayText.value), 513 /* TEXT, NEED_PATCH */)];
|
|
362
|
+
}),
|
|
363
|
+
_: 1 /* STABLE */
|
|
364
|
+
}, 8 /* PROPS */, ["content", "disabled"])])) : __props.mode === 'edit' || __props.mode === 'update' ? (openBlock(), createElementBlock("div", _hoisted_2, [createCommentVNode(" 输入 + 添加 区域 "), createElementVNode("div", {
|
|
306
365
|
"class": normalizeClass(["tag-input-input-row", {
|
|
307
366
|
'has-error': addError.value
|
|
308
367
|
}])
|
|
309
|
-
}, [createElementVNode("div",
|
|
368
|
+
}, [createElementVNode("div", _hoisted_3, [createVNode(unref(ElInput), {
|
|
310
369
|
ref_key: "inputRef",
|
|
311
370
|
ref: inputRef,
|
|
312
371
|
modelValue: inputValue.value,
|
|
@@ -314,24 +373,27 @@ var script = {
|
|
|
314
373
|
return inputValue.value = $event;
|
|
315
374
|
}),
|
|
316
375
|
placeholder: inputPlaceholder.value,
|
|
376
|
+
disabled: isDisabled.value,
|
|
317
377
|
clearable: "",
|
|
318
378
|
"class": "tag-input-input",
|
|
319
379
|
onInput: _cache[1] || (_cache[1] = function ($event) {
|
|
320
380
|
return addError.value = '';
|
|
321
381
|
}),
|
|
322
|
-
onKeydown: withKeys(withModifiers(
|
|
323
|
-
|
|
382
|
+
onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(function ($event) {
|
|
383
|
+
return !isDisabled.value && addItem();
|
|
384
|
+
}, ["prevent"]), ["enter"]))
|
|
385
|
+
}, null, 8 /* PROPS */, ["modelValue", "placeholder", "disabled"]), createVNode(unref(ElButton), {
|
|
324
386
|
type: "primary",
|
|
325
387
|
"class": "tag-input-add-btn",
|
|
326
388
|
loading: addLoading.value,
|
|
327
|
-
disabled: addLoading.value,
|
|
389
|
+
disabled: addLoading.value || isDisabled.value,
|
|
328
390
|
onClick: addItem
|
|
329
391
|
}, {
|
|
330
392
|
"default": withCtx(function () {
|
|
331
393
|
return [createTextVNode(toDisplayString(addButtonText.value), 1 /* TEXT */)];
|
|
332
394
|
}),
|
|
333
395
|
_: 1 /* STABLE */
|
|
334
|
-
}, 8 /* PROPS */, ["loading", "disabled"])]), tip.value ? (openBlock(), createElementBlock("span",
|
|
396
|
+
}, 8 /* PROPS */, ["loading", "disabled"])]), tip.value ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(tip.value), 1 /* TEXT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */), addError.value ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(addError.value), 1 /* TEXT */)) : createCommentVNode("v-if", true), createCommentVNode(" 标签列表:有数据时才显示 "), tagList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6, [listLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(listLabel.value) + "(" + toDisplayString(tagList.value.length) + "/" + toDisplayString(maxCount.value) + ") ", 1 /* TEXT */)) : createCommentVNode("v-if", true), createElementVNode("div", {
|
|
335
397
|
"class": normalizeClass(["tag-input-list-content", {
|
|
336
398
|
'is-removing': removingIndex.value >= 0
|
|
337
399
|
}])
|
|
@@ -344,7 +406,7 @@ var script = {
|
|
|
344
406
|
return [(openBlock(true), createElementBlock(Fragment, null, renderList(tagList.value, function (name, idx) {
|
|
345
407
|
return openBlock(), createBlock(unref(ElTag), {
|
|
346
408
|
key: "".concat(idx, "-").concat(name),
|
|
347
|
-
closable:
|
|
409
|
+
closable: !isDisabled.value,
|
|
348
410
|
"class": normalizeClass(["tag-input-tag", {
|
|
349
411
|
'is-removing': removingIndex.value === idx
|
|
350
412
|
}]),
|
|
@@ -356,7 +418,7 @@ var script = {
|
|
|
356
418
|
return [createTextVNode(toDisplayString(name), 1 /* TEXT */)];
|
|
357
419
|
}),
|
|
358
420
|
_: 2 /* DYNAMIC */
|
|
359
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "onClose"]);
|
|
421
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["closable", "class", "onClose"]);
|
|
360
422
|
}), 128 /* KEYED_FRAGMENT */))];
|
|
361
423
|
}),
|
|
362
424
|
_: 1 /* STABLE */
|
|
@@ -6,7 +6,17 @@
|
|
|
6
6
|
width: 100%;
|
|
7
7
|
min-width: 0;
|
|
8
8
|
/* 允许在 flex 父容器内收缩,避免超出列宽 */
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 保留 showOverflowTooltip 时,@deppon/deppon-ui 会给 Input 外层包一层 div,
|
|
11
|
+
* 且带内联 style: width: 100%; display: inline-block; 在 flex-wrap 下会强制换行。
|
|
12
|
+
* 这里在 range 布局中将其改为可伸缩的 flex item,保证两个输入框同一行。
|
|
13
|
+
*/
|
|
14
|
+
/* 错误信息 tooltip 在 flex 下独占一行 */
|
|
15
|
+
}
|
|
16
|
+
.field-text-range div[style*='display: inline-block'][style*='width: 100%'] {
|
|
17
|
+
width: auto !important;
|
|
18
|
+
flex: 1 1 0 !important;
|
|
19
|
+
min-width: 0 !important;
|
|
10
20
|
}
|
|
11
21
|
.field-text-range .range-input-start,
|
|
12
22
|
.field-text-range .range-input-end {
|
|
@@ -28,7 +38,7 @@
|
|
|
28
38
|
font-size: 14px;
|
|
29
39
|
padding: 0 2px;
|
|
30
40
|
}
|
|
31
|
-
.field-text-range .
|
|
41
|
+
.field-text-range .field-text-error {
|
|
32
42
|
flex: 0 0 100%;
|
|
33
43
|
width: 100%;
|
|
34
44
|
}
|
|
@@ -3,8 +3,8 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
6
|
-
import { computed, ref, watch, nextTick, openBlock, createElementBlock, Fragment, createCommentVNode, renderList, createElementVNode, toDisplayString,
|
|
7
|
-
import {
|
|
6
|
+
import { computed, ref, watch, nextTick, onMounted, onUnmounted, openBlock, createElementBlock, Fragment, createCommentVNode, renderList, createElementVNode, toDisplayString, createVNode, unref, withCtx, normalizeClass, withModifiers, createSlots, createBlock, mergeProps, renderSlot } from 'vue';
|
|
7
|
+
import { ElTooltip, ElInput, ElIcon } from '@deppon/deppon-ui';
|
|
8
8
|
import { Warning } from '@deppon/deppon-ui/icons-vue';
|
|
9
9
|
|
|
10
10
|
var _excluded = ["range", "placeholder", "suffix", "prefix"],
|
|
@@ -31,43 +31,34 @@ var _hoisted_6 = {
|
|
|
31
31
|
key: 0
|
|
32
32
|
};
|
|
33
33
|
var _hoisted_7 = {
|
|
34
|
-
"class": "field-readonly-content"
|
|
35
|
-
};
|
|
36
|
-
var _hoisted_8 = {
|
|
37
34
|
key: 1
|
|
38
35
|
};
|
|
39
|
-
var
|
|
36
|
+
var _hoisted_8 = {
|
|
40
37
|
key: 2
|
|
41
38
|
};
|
|
42
|
-
var
|
|
43
|
-
"class": "field-readonly-content"
|
|
44
|
-
};
|
|
45
|
-
var _hoisted_11 = {
|
|
39
|
+
var _hoisted_9 = {
|
|
46
40
|
key: 3
|
|
47
41
|
};
|
|
48
|
-
var
|
|
42
|
+
var _hoisted_10 = {
|
|
49
43
|
key: 0
|
|
50
44
|
};
|
|
51
|
-
var
|
|
52
|
-
"class": "field-readonly-content"
|
|
53
|
-
};
|
|
54
|
-
var _hoisted_14 = {
|
|
45
|
+
var _hoisted_11 = {
|
|
55
46
|
key: 1
|
|
56
47
|
};
|
|
57
|
-
var
|
|
48
|
+
var _hoisted_12 = {
|
|
58
49
|
key: 0,
|
|
59
50
|
"class": "field-text-array"
|
|
60
51
|
};
|
|
61
|
-
var
|
|
52
|
+
var _hoisted_13 = {
|
|
62
53
|
"class": "array-item-input-row"
|
|
63
54
|
};
|
|
64
|
-
var
|
|
55
|
+
var _hoisted_14 = {
|
|
65
56
|
"class": "array-item-label"
|
|
66
57
|
};
|
|
67
|
-
var
|
|
58
|
+
var _hoisted_15 = {
|
|
68
59
|
"class": "array-item-suffix"
|
|
69
60
|
};
|
|
70
|
-
var
|
|
61
|
+
var _hoisted_16 = {
|
|
71
62
|
key: 0,
|
|
72
63
|
"class": "array-item-error"
|
|
73
64
|
};
|
|
@@ -775,6 +766,28 @@ var script = {
|
|
|
775
766
|
var rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
776
767
|
return rest;
|
|
777
768
|
});
|
|
769
|
+
var readonlyRef = ref(null);
|
|
770
|
+
var rangeStartReadonlyRef = ref(null);
|
|
771
|
+
var rangeEndReadonlyRef = ref(null);
|
|
772
|
+
var readonlyOverflow = ref(false);
|
|
773
|
+
var rangeStartOverflow = ref(false);
|
|
774
|
+
var rangeEndOverflow = ref(false);
|
|
775
|
+
var getTextOverflow = function getTextOverflow(el) {
|
|
776
|
+
if (!el) return false;
|
|
777
|
+
return el.scrollWidth > el.clientWidth;
|
|
778
|
+
};
|
|
779
|
+
var checkReadonlyOverflow = function checkReadonlyOverflow() {
|
|
780
|
+
readonlyOverflow.value = getTextOverflow(readonlyRef.value);
|
|
781
|
+
rangeStartOverflow.value = getTextOverflow(rangeStartReadonlyRef.value);
|
|
782
|
+
rangeEndOverflow.value = getTextOverflow(rangeEndReadonlyRef.value);
|
|
783
|
+
};
|
|
784
|
+
onMounted(function () {
|
|
785
|
+
nextTick(checkReadonlyOverflow);
|
|
786
|
+
window.addEventListener('resize', checkReadonlyOverflow);
|
|
787
|
+
});
|
|
788
|
+
onUnmounted(function () {
|
|
789
|
+
window.removeEventListener('resize', checkReadonlyOverflow);
|
|
790
|
+
});
|
|
778
791
|
|
|
779
792
|
// 处理 clear 事件
|
|
780
793
|
var handleClear = function handleClear() {
|
|
@@ -916,6 +929,28 @@ var script = {
|
|
|
916
929
|
}
|
|
917
930
|
return true;
|
|
918
931
|
});
|
|
932
|
+
var readonlyTooltipContent = computed(function () {
|
|
933
|
+
var v = displayText.value;
|
|
934
|
+
if (v === null || v === undefined || v === '' || v === '-') return '';
|
|
935
|
+
return String(v);
|
|
936
|
+
});
|
|
937
|
+
var rangeStartTooltipContent = computed(function () {
|
|
938
|
+
var v = rangeStartDisplay.value;
|
|
939
|
+
if (v === null || v === undefined || v === '' || v === '-') return '';
|
|
940
|
+
return String(v);
|
|
941
|
+
});
|
|
942
|
+
var rangeEndTooltipContent = computed(function () {
|
|
943
|
+
var v = rangeEndDisplay.value;
|
|
944
|
+
if (v === null || v === undefined || v === '' || v === '-') return '';
|
|
945
|
+
return String(v);
|
|
946
|
+
});
|
|
947
|
+
watch(function () {
|
|
948
|
+
return [props.mode, props.text, props.fieldProps];
|
|
949
|
+
}, function () {
|
|
950
|
+
nextTick(checkReadonlyOverflow);
|
|
951
|
+
}, {
|
|
952
|
+
deep: true
|
|
953
|
+
});
|
|
919
954
|
return function (_ctx, _cache) {
|
|
920
955
|
return __props.mode === 'read' ? (openBlock(), createElementBlock(Fragment, {
|
|
921
956
|
key: 0
|
|
@@ -928,13 +963,55 @@ var script = {
|
|
|
928
963
|
}, [createElementVNode("span", _hoisted_2, toDisplayString(item.label || "\u7B2C".concat(index + 1, "\u9879")), 1 /* TEXT */), createElementVNode("span", _hoisted_3, toDisplayString(item.value || __props.emptyText || '-'), 1 /* TEXT */), createElementVNode("span", _hoisted_4, toDisplayString(item.suffix || ''), 1 /* TEXT */)]);
|
|
929
964
|
}), 128 /* KEYED_FRAGMENT */)) : (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(__props.emptyText || '-'), 1 /* TEXT */))])) : isRange.value ? (openBlock(), createElementBlock(Fragment, {
|
|
930
965
|
key: 1
|
|
931
|
-
}, [createCommentVNode(" 范围输入模式下的只读显示 "), rangeStartPrefix.value && !isRangeStartEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(rangeStartPrefix.value), 1 /* TEXT */)) : createCommentVNode("v-if", true),
|
|
966
|
+
}, [createCommentVNode(" 范围输入模式下的只读显示 "), rangeStartPrefix.value && !isRangeStartEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(rangeStartPrefix.value), 1 /* TEXT */)) : createCommentVNode("v-if", true), createVNode(unref(ElTooltip), {
|
|
967
|
+
content: rangeStartTooltipContent.value,
|
|
968
|
+
placement: "top",
|
|
969
|
+
trigger: "click",
|
|
970
|
+
disabled: !rangeStartTooltipContent.value || !rangeStartOverflow.value
|
|
971
|
+
}, {
|
|
972
|
+
"default": withCtx(function () {
|
|
973
|
+
return [createElementVNode("span", {
|
|
974
|
+
ref_key: "rangeStartReadonlyRef",
|
|
975
|
+
ref: rangeStartReadonlyRef,
|
|
976
|
+
"class": "field-readonly-content"
|
|
977
|
+
}, toDisplayString(rangeStartDisplay.value), 513 /* TEXT, NEED_PATCH */)];
|
|
978
|
+
}),
|
|
979
|
+
_: 1 /* STABLE */
|
|
980
|
+
}, 8 /* PROPS */, ["content", "disabled"]), rangeStartSuffix.value && !isRangeStartEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(rangeStartSuffix.value), 1 /* TEXT */)) : createCommentVNode("v-if", true), _cache[6] || (_cache[6] = createElementVNode("span", {
|
|
932
981
|
"class": "range-separator"
|
|
933
|
-
}, "-", -1 /* CACHED */)), rangeEndPrefix.value && !isRangeEndEmpty.value ? (openBlock(), createElementBlock("span",
|
|
982
|
+
}, "-", -1 /* CACHED */)), rangeEndPrefix.value && !isRangeEndEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(rangeEndPrefix.value), 1 /* TEXT */)) : createCommentVNode("v-if", true), createVNode(unref(ElTooltip), {
|
|
983
|
+
content: rangeEndTooltipContent.value,
|
|
984
|
+
placement: "top",
|
|
985
|
+
trigger: "click",
|
|
986
|
+
disabled: !rangeEndTooltipContent.value || !rangeEndOverflow.value
|
|
987
|
+
}, {
|
|
988
|
+
"default": withCtx(function () {
|
|
989
|
+
return [createElementVNode("span", {
|
|
990
|
+
ref_key: "rangeEndReadonlyRef",
|
|
991
|
+
ref: rangeEndReadonlyRef,
|
|
992
|
+
"class": "field-readonly-content"
|
|
993
|
+
}, toDisplayString(rangeEndDisplay.value), 513 /* TEXT, NEED_PATCH */)];
|
|
994
|
+
}),
|
|
995
|
+
_: 1 /* STABLE */
|
|
996
|
+
}, 8 /* PROPS */, ["content", "disabled"]), rangeEndSuffix.value && !isRangeEndEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(rangeEndSuffix.value), 1 /* TEXT */)) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */)) : (openBlock(), createElementBlock(Fragment, {
|
|
934
997
|
key: 2
|
|
935
|
-
}, [createCommentVNode(" 普通输入模式下的只读显示 "), __props.fieldProps && __props.fieldProps.prefix && !isEmpty.value ? (openBlock(), createElementBlock("span",
|
|
998
|
+
}, [createCommentVNode(" 普通输入模式下的只读显示 "), __props.fieldProps && __props.fieldProps.prefix && !isEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(__props.fieldProps.prefix), 1 /* TEXT */)) : createCommentVNode("v-if", true), createVNode(unref(ElTooltip), {
|
|
999
|
+
content: readonlyTooltipContent.value,
|
|
1000
|
+
placement: "top",
|
|
1001
|
+
trigger: "click",
|
|
1002
|
+
disabled: !readonlyTooltipContent.value || !readonlyOverflow.value
|
|
1003
|
+
}, {
|
|
1004
|
+
"default": withCtx(function () {
|
|
1005
|
+
return [createElementVNode("span", {
|
|
1006
|
+
ref_key: "readonlyRef",
|
|
1007
|
+
ref: readonlyRef,
|
|
1008
|
+
"class": "field-readonly-content"
|
|
1009
|
+
}, toDisplayString(displayText.value), 513 /* TEXT, NEED_PATCH */)];
|
|
1010
|
+
}),
|
|
1011
|
+
_: 1 /* STABLE */
|
|
1012
|
+
}, 8 /* PROPS */, ["content", "disabled"]), __props.fieldProps && __props.fieldProps.suffix && !isEmpty.value ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(__props.fieldProps.suffix), 1 /* TEXT */)) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */))], 64 /* STABLE_FRAGMENT */)) : __props.mode === 'edit' || __props.mode === 'update' ? (openBlock(), createElementBlock(Fragment, {
|
|
936
1013
|
key: 1
|
|
937
|
-
}, [createCommentVNode(" 数组文本类型 "), isTextArray.value ? (openBlock(), createElementBlock("div",
|
|
1014
|
+
}, [createCommentVNode(" 数组文本类型 "), isTextArray.value ? (openBlock(), createElementBlock("div", _hoisted_12, [arrayValues.value && arrayValues.value.length > 0 ? (openBlock(true), createElementBlock(Fragment, {
|
|
938
1015
|
key: 0
|
|
939
1016
|
}, renderList(arrayValues.value, function (item, index) {
|
|
940
1017
|
var _props$fieldProps18, _props$fieldProps19;
|
|
@@ -943,7 +1020,7 @@ var script = {
|
|
|
943
1020
|
"class": normalizeClass(["array-item-wrapper", {
|
|
944
1021
|
'has-error': getArrayItemError(index)
|
|
945
1022
|
}])
|
|
946
|
-
}, [createElementVNode("div",
|
|
1023
|
+
}, [createElementVNode("div", _hoisted_13, [createElementVNode("span", _hoisted_14, toDisplayString(item.label || "\u7B2C".concat(index + 1, "\u9879")), 1 /* TEXT */), createVNode(unref(ElInput), {
|
|
947
1024
|
modelValue: item.value,
|
|
948
1025
|
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
949
1026
|
return item.value = $event;
|
|
@@ -965,7 +1042,7 @@ var script = {
|
|
|
965
1042
|
}, [item.suffix ? {
|
|
966
1043
|
name: "suffix",
|
|
967
1044
|
fn: withCtx(function () {
|
|
968
|
-
return [createElementVNode("span",
|
|
1045
|
+
return [createElementVNode("span", _hoisted_15, toDisplayString(item.suffix), 1 /* TEXT */)];
|
|
969
1046
|
}),
|
|
970
1047
|
key: "0"
|
|
971
1048
|
} : undefined]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "onUpdate:modelValue", "type", "size", "placeholder", "disabled", "step", "onWheel"]), createCommentVNode(" warningTooltip 显示在输入框右边 "), getArrayItemWarningTooltip(index) && !getArrayItemError(index) ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
@@ -989,7 +1066,7 @@ var script = {
|
|
|
989
1066
|
})];
|
|
990
1067
|
}),
|
|
991
1068
|
_: 1 /* STABLE */
|
|
992
|
-
}, 8 /* PROPS */, ["content"])) : createCommentVNode("v-if", true)]), createCommentVNode(" 错误信息显示在每个输入框下边 "), getArrayItemError(index) ? (openBlock(), createElementBlock("div",
|
|
1069
|
+
}, 8 /* PROPS */, ["content"])) : createCommentVNode("v-if", true)]), createCommentVNode(" 错误信息显示在每个输入框下边 "), getArrayItemError(index) ? (openBlock(), createElementBlock("div", _hoisted_16, [createVNode(unref(ElTooltip), {
|
|
993
1070
|
content: getArrayItemError(index),
|
|
994
1071
|
placement: "top",
|
|
995
1072
|
disabled: !getArrayItemErrorOverflow(index)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deppon/deppon-template",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "es/index.d.ts",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"less": "^4.2.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@deppon/deppon-assets": "2.2.
|
|
47
|
-
"@deppon/deppon-request": "2.2.
|
|
48
|
-
"@deppon/deppon-router": "2.2.
|
|
49
|
-
"@deppon/deppon-ui": "2.2.
|
|
50
|
-
"@deppon/deppon-utils": "2.2.
|
|
46
|
+
"@deppon/deppon-assets": "2.2.8",
|
|
47
|
+
"@deppon/deppon-request": "2.2.8",
|
|
48
|
+
"@deppon/deppon-router": "2.2.8",
|
|
49
|
+
"@deppon/deppon-ui": "2.2.8",
|
|
50
|
+
"@deppon/deppon-utils": "2.2.8",
|
|
51
51
|
"dayjs": "^1.11.10",
|
|
52
52
|
"lodash-es": "^4.17.21",
|
|
53
53
|
"mitt": "^3.0.1"
|