yc-pro-components 0.0.18 → 0.0.19
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/components/check-card/index.d.ts +61 -61
- package/es/components/check-card/src/index.vue.d.ts +4 -4
- package/es/components/check-card-group/index.d.ts +43 -43
- package/es/components/check-card-group/src/index.vue.d.ts +3 -3
- package/es/components/date-picker/index.d.ts +10 -10
- package/es/components/date-picker/src/index.vue.d.ts +2 -2
- package/es/components/dialog/index.d.ts +26 -26
- package/es/components/dialog/src/index.vue.d.ts +2 -2
- package/es/components/dialog-form/index.d.ts +31 -31
- package/es/components/dialog-form/src/index.vue.d.ts +9 -9
- package/es/components/display-item/index.d.ts +41 -41
- package/es/components/display-item/src/index.vue.d.ts +22 -22
- package/es/components/display-item/src/index.vue2.mjs +18 -5
- package/es/components/drawer-form/index.d.ts +50 -50
- package/es/components/drawer-form/src/index.vue.d.ts +10 -10
- package/es/components/form/index.d.ts +45 -45
- package/es/components/form/src/form-content.vue.d.ts +22 -20
- package/es/components/form/src/index.vue.d.ts +17 -17
- package/es/components/form-item/index.d.ts +42 -42
- package/es/components/form-item/src/index.vue.d.ts +12 -12
- package/es/components/header/index.d.ts +19 -19
- package/es/components/header/src/index.vue.d.ts +1 -1
- package/es/components/input-tag/index.d.ts +20 -20
- package/es/components/input-tag/src/index.vue.d.ts +8 -8
- package/es/components/layout/index.d.ts +30 -30
- package/es/components/layout/src/index.vue.d.ts +10 -10
- package/es/components/page/index.d.ts +519 -455
- package/es/components/page/src/index.vue.d.ts +198 -203
- package/es/components/page/src/index.vue2.mjs +4 -2
- package/es/components/pagination/index.d.ts +42 -42
- package/es/components/pagination/src/index.vue.d.ts +3 -3
- package/es/components/radio/index.d.ts +35 -35
- package/es/components/radio/src/index.vue.d.ts +27 -27
- package/es/components/render/index.d.ts +3 -3
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/search/index.d.ts +154 -154
- package/es/components/search/src/index.vue.d.ts +50 -50
- package/es/components/sidebar/index.d.ts +15 -15
- package/es/components/sidebar/src/index.vue.d.ts +5 -5
- package/es/components/steps-form/index.d.ts +23 -23
- package/es/components/steps-form/src/index.vue.d.ts +2 -2
- package/es/components/table/index.d.ts +73 -54
- package/es/components/table/src/index.vue.d.ts +21 -18
- package/es/components/table/src/index.vue2.mjs +4 -2
- package/es/components/table/src/table-column-drag-sort.vue.d.ts +18 -18
- package/es/components/table/src/table-column.vue.d.ts +37 -37
- package/es/components/table/src/type.d.ts +9 -0
- package/es/components/utils/index.d.ts +2 -2
- package/es/components/yc-dialog/index.d.ts +24 -24
- package/es/components/yc-download-dialog/index.d.ts +19 -19
- package/es/components/yc-download-dialog/src/index.vue.d.ts +1 -1
- package/es/components/yc-form-container-header/index.d.ts +12 -12
- package/es/components/yc-more-actions/index.d.ts +46 -46
- package/es/components/yc-more-actions/src/index.vue.d.ts +3 -3
- package/es/components/yc-plus-page/src/index.vue.d.ts +424 -364
- package/es/components/yc-segmented/index.d.ts +2 -2
- package/es/components/yc-segmented/src/index.d.ts +2 -2
- package/es/components/yc-select-v2/src/index.vue.d.ts +3 -3
- package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/es/components/yc-tabs-with-filter/index.d.ts +16 -16
- package/es/components/yc-text/src/index.vue.d.ts +2 -2
- package/es/constants/form.d.ts +5 -0
- package/es/constants/form.mjs +2 -1
- package/es/constants/index.mjs +1 -1
- package/es/hooks/usePlusFormReset.d.ts +208 -208
- package/es/index.mjs +1 -1
- package/es/types/plus.d.ts +29 -0
- package/index.js +26 -7
- package/index.min.js +7 -7
- package/index.min.mjs +7 -7
- package/index.mjs +26 -8
- package/lib/components/check-card/index.d.ts +61 -61
- package/lib/components/check-card/src/index.vue.d.ts +4 -4
- package/lib/components/check-card-group/index.d.ts +43 -43
- package/lib/components/check-card-group/src/index.vue.d.ts +3 -3
- package/lib/components/date-picker/index.d.ts +10 -10
- package/lib/components/date-picker/src/index.vue.d.ts +2 -2
- package/lib/components/dialog/index.d.ts +26 -26
- package/lib/components/dialog/src/index.vue.d.ts +2 -2
- package/lib/components/dialog-form/index.d.ts +31 -31
- package/lib/components/dialog-form/src/index.vue.d.ts +9 -9
- package/lib/components/display-item/index.d.ts +41 -41
- package/lib/components/display-item/src/index.vue.d.ts +22 -22
- package/lib/components/display-item/src/index.vue2.js +16 -3
- package/lib/components/drawer-form/index.d.ts +50 -50
- package/lib/components/drawer-form/src/index.vue.d.ts +10 -10
- package/lib/components/form/index.d.ts +45 -45
- package/lib/components/form/src/form-content.vue.d.ts +22 -20
- package/lib/components/form/src/index.vue.d.ts +17 -17
- package/lib/components/form-item/index.d.ts +42 -42
- package/lib/components/form-item/src/index.vue.d.ts +12 -12
- package/lib/components/header/index.d.ts +19 -19
- package/lib/components/header/src/index.vue.d.ts +1 -1
- package/lib/components/input-tag/index.d.ts +20 -20
- package/lib/components/input-tag/src/index.vue.d.ts +8 -8
- package/lib/components/layout/index.d.ts +30 -30
- package/lib/components/layout/src/index.vue.d.ts +10 -10
- package/lib/components/page/index.d.ts +519 -455
- package/lib/components/page/src/index.vue.d.ts +198 -203
- package/lib/components/page/src/index.vue2.js +4 -2
- package/lib/components/pagination/index.d.ts +42 -42
- package/lib/components/pagination/src/index.vue.d.ts +3 -3
- package/lib/components/radio/index.d.ts +35 -35
- package/lib/components/radio/src/index.vue.d.ts +27 -27
- package/lib/components/render/index.d.ts +3 -3
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/search/index.d.ts +154 -154
- package/lib/components/search/src/index.vue.d.ts +50 -50
- package/lib/components/sidebar/index.d.ts +15 -15
- package/lib/components/sidebar/src/index.vue.d.ts +5 -5
- package/lib/components/steps-form/index.d.ts +23 -23
- package/lib/components/steps-form/src/index.vue.d.ts +2 -2
- package/lib/components/table/index.d.ts +73 -54
- package/lib/components/table/src/index.vue.d.ts +21 -18
- package/lib/components/table/src/index.vue2.js +3 -1
- package/lib/components/table/src/table-column-drag-sort.vue.d.ts +18 -18
- package/lib/components/table/src/table-column.vue.d.ts +37 -37
- package/lib/components/table/src/type.d.ts +9 -0
- package/lib/components/utils/index.d.ts +2 -2
- package/lib/components/yc-dialog/index.d.ts +24 -24
- package/lib/components/yc-download-dialog/index.d.ts +19 -19
- package/lib/components/yc-download-dialog/src/index.vue.d.ts +1 -1
- package/lib/components/yc-form-container-header/index.d.ts +12 -12
- package/lib/components/yc-more-actions/index.d.ts +46 -46
- package/lib/components/yc-more-actions/src/index.vue.d.ts +3 -3
- package/lib/components/yc-plus-page/src/index.vue.d.ts +424 -364
- package/lib/components/yc-segmented/index.d.ts +2 -2
- package/lib/components/yc-segmented/src/index.d.ts +2 -2
- package/lib/components/yc-select-v2/src/index.vue.d.ts +3 -3
- package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/lib/components/yc-tabs-with-filter/index.d.ts +16 -16
- package/lib/components/yc-text/src/index.vue.d.ts +2 -2
- package/lib/constants/form.d.ts +5 -0
- package/lib/constants/form.js +2 -0
- package/lib/constants/index.js +1 -0
- package/lib/hooks/usePlusFormReset.d.ts +208 -208
- package/lib/index.js +1 -0
- package/lib/types/plus.d.ts +29 -0
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export { usePlusFormReset } from './hooks/usePlusFormReset.mjs';
|
|
|
9
9
|
export { useSelectWithPagination } from './hooks/useSelectWithPagination.mjs';
|
|
10
10
|
export { useDictInjection } from './hooks/useDictInjection.mjs';
|
|
11
11
|
export { DefaultPageInfo, DefaultPageSizeList } from './constants/page.mjs';
|
|
12
|
-
export { DatePickerValueIsArrayList, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList } from './constants/form.mjs';
|
|
12
|
+
export { DatePickerValueIsArrayList, TableColumnsEmptyTextInjectionKey, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList } from './constants/form.mjs';
|
|
13
13
|
export { selectValueTypeList } from './constants/display-item.mjs';
|
|
14
14
|
export { DictStoreInjectionKey } from './constants/dict.mjs';
|
|
15
15
|
export { version } from './version.mjs';
|
package/es/types/plus.d.ts
CHANGED
|
@@ -272,6 +272,35 @@ export interface CommonType {
|
|
|
272
272
|
* 多级表头
|
|
273
273
|
*/
|
|
274
274
|
children?: PlusColumn[];
|
|
275
|
+
/**
|
|
276
|
+
* 字段值为空时显示的文本
|
|
277
|
+
* @version v0.2.0
|
|
278
|
+
* @default "-"
|
|
279
|
+
* @desc 当字段值为 null、undefined 或空字符串时,显示此文本
|
|
280
|
+
* @desc 仅对未定义 render/renderHTML 的字段生效
|
|
281
|
+
* @desc 如果不希望处理空值,可以设置为空字符串 emptyText: ""
|
|
282
|
+
* @example
|
|
283
|
+
* ```ts
|
|
284
|
+
* const columns: PlusColumn[] = [
|
|
285
|
+
* {
|
|
286
|
+
* label: '姓名',
|
|
287
|
+
* prop: 'name'
|
|
288
|
+
* // 默认空值显示 "-"
|
|
289
|
+
* },
|
|
290
|
+
* {
|
|
291
|
+
* label: '备注',
|
|
292
|
+
* prop: 'remark',
|
|
293
|
+
* emptyText: '暂无' // 自定义空值显示为 "暂无"
|
|
294
|
+
* },
|
|
295
|
+
* {
|
|
296
|
+
* label: '数量',
|
|
297
|
+
* prop: 'count',
|
|
298
|
+
* emptyText: '' // 空值显示空字符串(不处理)
|
|
299
|
+
* }
|
|
300
|
+
* ]
|
|
301
|
+
* ```
|
|
302
|
+
*/
|
|
303
|
+
emptyText?: string;
|
|
275
304
|
/**
|
|
276
305
|
* 自动字典注入
|
|
277
306
|
* @version v0.2.0
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! yc-pro-components v0.0.
|
|
1
|
+
/*! yc-pro-components v0.0.19 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
|
|
@@ -4779,6 +4779,7 @@
|
|
|
4779
4779
|
const TableFormRefInjectionKey = Symbol("tableFormRefInjectionKey");
|
|
4780
4780
|
const TableFormFieldRefInjectionKey = Symbol("tableFormFieldRefInjectionKey");
|
|
4781
4781
|
const TableFormRowInfoInjectionKey = Symbol("tableFormRowInfoInjectionKey");
|
|
4782
|
+
const TableColumnsEmptyTextInjectionKey = Symbol("tableColumnsEmptyTextInjectionKey");
|
|
4782
4783
|
const DatePickerValueIsArrayList = ["datetimerange", "daterange", "monthrange"];
|
|
4783
4784
|
const ValueIsNumberList = ["rate", "input-number", "slider"];
|
|
4784
4785
|
const ValueIsBooleanList = ["switch"];
|
|
@@ -17163,16 +17164,18 @@
|
|
|
17163
17164
|
const value = props.column.valueType === "link" ? props.column.linkText || displayValue.value : displayValue.value;
|
|
17164
17165
|
if (!selectValueTypeList.includes(props.column.valueType) && !isEdit.value) {
|
|
17165
17166
|
if (props.column.formatter && isFunction(props.column.formatter)) {
|
|
17166
|
-
|
|
17167
|
+
const formattedValue = props.column.formatter(value, renderParams.value);
|
|
17168
|
+
return handleEmptyValue(formattedValue);
|
|
17167
17169
|
}
|
|
17168
17170
|
if (displayComponent.value.format && isFunction(displayComponent.value.format)) {
|
|
17169
|
-
|
|
17171
|
+
const formattedValue = displayComponent.value.format(
|
|
17170
17172
|
value,
|
|
17171
17173
|
customFieldProps.value.format || customFieldProps.value.valueFormat
|
|
17172
17174
|
);
|
|
17175
|
+
return handleEmptyValue(formattedValue);
|
|
17173
17176
|
}
|
|
17174
17177
|
}
|
|
17175
|
-
return value;
|
|
17178
|
+
return handleEmptyValue(value);
|
|
17176
17179
|
});
|
|
17177
17180
|
const modelValues = vue.computed({
|
|
17178
17181
|
get() {
|
|
@@ -17204,6 +17207,17 @@
|
|
|
17204
17207
|
column: { ...props.rest.column, ...props.column }
|
|
17205
17208
|
}));
|
|
17206
17209
|
vue.provide(TableFormRowInfoInjectionKey, tableRowInfo);
|
|
17210
|
+
const injectedColumnsEmptyText = vue.inject(TableColumnsEmptyTextInjectionKey, vue.computed(() => "-"));
|
|
17211
|
+
const handleEmptyValue = (value) => {
|
|
17212
|
+
var _a;
|
|
17213
|
+
if (value === null || value === void 0 || value === "") {
|
|
17214
|
+
if (props.column.emptyText !== void 0) {
|
|
17215
|
+
return props.column.emptyText;
|
|
17216
|
+
}
|
|
17217
|
+
return (_a = injectedColumnsEmptyText.value) != null ? _a : "-";
|
|
17218
|
+
}
|
|
17219
|
+
return value;
|
|
17220
|
+
};
|
|
17207
17221
|
const imageUrl = vue.computed(() => {
|
|
17208
17222
|
const option = formatterValue.value;
|
|
17209
17223
|
if (option && isString(option)) {
|
|
@@ -18708,7 +18722,8 @@
|
|
|
18708
18722
|
indexContentStyle: { type: [Object, Function], default: () => ({}) },
|
|
18709
18723
|
editable: { type: [Boolean, String], default: false },
|
|
18710
18724
|
adaptive: { type: [Boolean, Object], default: false },
|
|
18711
|
-
filterTableHeaderOverflowLabelLength: {}
|
|
18725
|
+
filterTableHeaderOverflowLabelLength: {},
|
|
18726
|
+
columnsEmptyText: { default: "-" }
|
|
18712
18727
|
},
|
|
18713
18728
|
emits: ["paginationChange", "clickAction", "clickActionConfirmCancel", "dragSortEnd", "formChange", "refresh", "edited", "cell-click", "cell-dblclick", "filterTableHeader", "radioChange"],
|
|
18714
18729
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -18740,6 +18755,7 @@
|
|
|
18740
18755
|
vue.provide(TableFormRefInjectionKey, formRefs);
|
|
18741
18756
|
const formFieldRefs = vue.shallowRef({});
|
|
18742
18757
|
vue.provide(TableFormFieldRefInjectionKey, formFieldRefs);
|
|
18758
|
+
vue.provide(TableColumnsEmptyTextInjectionKey, vue.computed(() => props.columnsEmptyText));
|
|
18743
18759
|
vue.watch(
|
|
18744
18760
|
() => props.columns,
|
|
18745
18761
|
(val) => {
|
|
@@ -19954,7 +19970,8 @@
|
|
|
19954
19970
|
page: "page",
|
|
19955
19971
|
pageSize: "pageSize"
|
|
19956
19972
|
}) },
|
|
19957
|
-
searchSlot: { type: Boolean, default: false }
|
|
19973
|
+
searchSlot: { type: Boolean, default: false },
|
|
19974
|
+
columnsEmptyText: { default: "-" }
|
|
19958
19975
|
},
|
|
19959
19976
|
emits: ["search", "reset", "paginationChange", "requestError", "requestComplete"],
|
|
19960
19977
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -20143,6 +20160,7 @@
|
|
|
20143
20160
|
"table-data": vue.unref(tableData),
|
|
20144
20161
|
"loading-status": vue.unref(loadingStatus),
|
|
20145
20162
|
columns: _ctx.columns,
|
|
20163
|
+
"columns-empty-text": _ctx.columnsEmptyText,
|
|
20146
20164
|
pagination: _ctx.pagination === false ? void 0 : {
|
|
20147
20165
|
..._ctx.pagination,
|
|
20148
20166
|
total: vue.unref(total),
|
|
@@ -20198,7 +20216,7 @@
|
|
|
20198
20216
|
])
|
|
20199
20217
|
};
|
|
20200
20218
|
})
|
|
20201
|
-
]), 1040, ["table-data", "loading-status", "columns", "pagination"])
|
|
20219
|
+
]), 1040, ["table-data", "loading-status", "columns", "columns-empty-text", "pagination"])
|
|
20202
20220
|
]),
|
|
20203
20221
|
_: 3
|
|
20204
20222
|
/* FORWARDED */
|
|
@@ -59893,6 +59911,7 @@
|
|
|
59893
59911
|
exports.ReboundCountTo = YcReboundCountTo;
|
|
59894
59912
|
exports.SIZE_MAP = SIZE_MAP;
|
|
59895
59913
|
exports.STATUS_CONFIG_MAP = STATUS_CONFIG_MAP;
|
|
59914
|
+
exports.TableColumnsEmptyTextInjectionKey = TableColumnsEmptyTextInjectionKey;
|
|
59896
59915
|
exports.TableFormFieldRefInjectionKey = TableFormFieldRefInjectionKey;
|
|
59897
59916
|
exports.TableFormRefInjectionKey = TableFormRefInjectionKey;
|
|
59898
59917
|
exports.TableFormRowInfoInjectionKey = TableFormRowInfoInjectionKey;
|