@sdata/web-vue 3.28.0 → 3.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sd.css +1 -1
- package/dist/sd.min.css +1 -1
- package/es/basic-crud-table/basic-crud-table.vue_vue_type_script_setup_true_lang.js +12 -7
- package/es/index.css +1 -1
- package/es/index.js +3 -3
- package/es/json-form/json-form-component.vue_vue_type_script_setup_true_lang.js +1 -0
- package/es/json-form/types.d.ts +4 -0
- package/es/json-form/types.js +1 -0
- package/es/json-form/utils.js +3 -0
- package/es/sd-vue.js +1 -1
- package/es/upload/context.d.ts +1 -0
- package/es/upload/index.d.ts +15 -0
- package/es/upload/style/index.css +1 -1
- package/es/upload/style/index.scss +1 -1
- package/es/upload/upload-picture-item.js +15 -6
- package/es/upload/upload-progress.js +17 -13
- package/es/upload/upload.d.ts +9 -0
- package/es/upload/upload.js +10 -1
- package/json/vetur-attributes.json +4 -0
- package/json/vetur-tags.json +1 -0
- package/json/web-types.json +9 -1
- package/package.json +1 -1
|
@@ -143,6 +143,7 @@ var basic_crud_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
143
143
|
const toolbarSlotNames = computed(() => getForwardedSlotNames("toolbar__", [
|
|
144
144
|
"default",
|
|
145
145
|
"action_prepend",
|
|
146
|
+
"action_middle",
|
|
146
147
|
"action_append"
|
|
147
148
|
]));
|
|
148
149
|
const tableSlotNames = computed(() => getForwardedSlotNames("table__", ["action_prepend", "action_append"]));
|
|
@@ -412,13 +413,17 @@ var basic_crud_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
412
413
|
onSearch: handleSearch,
|
|
413
414
|
onReset: handleReset
|
|
414
415
|
}), createSlots({
|
|
415
|
-
"action-append": withCtx(() => [
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
416
|
+
"action-append": withCtx(() => [
|
|
417
|
+
renderSlot(_ctx.$slots, "toolbar__action_middle"),
|
|
418
|
+
__props.showCreate ? (openBlock(), createBlock(unref(Button), mergeProps({
|
|
419
|
+
key: 0,
|
|
420
|
+
type: "primary"
|
|
421
|
+
}, __props.createBtn, { onClick: handleCreate }), {
|
|
422
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode(" 新建 ", -1)])]),
|
|
423
|
+
_: 1
|
|
424
|
+
}, 16)) : createCommentVNode("", true),
|
|
425
|
+
renderSlot(_ctx.$slots, "toolbar__action_append")
|
|
426
|
+
]),
|
|
422
427
|
_: 2
|
|
423
428
|
}, [
|
|
424
429
|
_ctx.$slots.toolbar__default ? {
|
package/es/index.css
CHANGED
package/es/index.js
CHANGED
|
@@ -58,6 +58,9 @@ import week_picker_default from "./date-picker/pickers/week-picker.js";
|
|
|
58
58
|
import year_picker_default from "./date-picker/pickers/year-picker.js";
|
|
59
59
|
import range_picker_default from "./date-picker/range-picker.js";
|
|
60
60
|
import DatePicker from "./date-picker/index.js";
|
|
61
|
+
import { defaultInputMaskFormatChars, formatInputMask } from "./input-mask/mask-engine.js";
|
|
62
|
+
import { inputMaskPresets } from "./input-mask/presets.js";
|
|
63
|
+
import InputMask from "./input-mask/index.js";
|
|
61
64
|
import Textarea from "./textarea/index.js";
|
|
62
65
|
import Mention from "./mention/index.js";
|
|
63
66
|
import Rate from "./rate/index.js";
|
|
@@ -107,9 +110,6 @@ import preview_group_default from "./image/preview-group.js";
|
|
|
107
110
|
import Image from "./image/index.js";
|
|
108
111
|
import FilePreviewer from "./file-previewer/index.js";
|
|
109
112
|
import Icon from "./icon-component/index.js";
|
|
110
|
-
import { defaultInputMaskFormatChars, formatInputMask } from "./input-mask/mask-engine.js";
|
|
111
|
-
import { inputMaskPresets } from "./input-mask/presets.js";
|
|
112
|
-
import InputMask from "./input-mask/index.js";
|
|
113
113
|
import KvList from "./kv-list/index.js";
|
|
114
114
|
import content_default from "./layout/content.js";
|
|
115
115
|
import footer_default from "./layout/footer.js";
|
|
@@ -27,6 +27,7 @@ var json_form_component_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
|
|
|
27
27
|
const type = (_props$schema$type2 = props.schema.type) !== null && _props$schema$type2 !== void 0 ? _props$schema$type2 : JSON_FORM_COMPONENT_TYPES.input;
|
|
28
28
|
if ([
|
|
29
29
|
JSON_FORM_COMPONENT_TYPES.input,
|
|
30
|
+
JSON_FORM_COMPONENT_TYPES.inputMask,
|
|
30
31
|
JSON_FORM_COMPONENT_TYPES.inputSearch,
|
|
31
32
|
JSON_FORM_COMPONENT_TYPES.inputNumber,
|
|
32
33
|
JSON_FORM_COMPONENT_TYPES.inputPassword,
|
package/es/json-form/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { DatePickerInstance, RangePickerInstance } from '../date-picker';
|
|
|
6
6
|
import type { FieldRule, FormItemInstance } from '../form';
|
|
7
7
|
import type { GridColInstance, GridRowInstance } from '../grid';
|
|
8
8
|
import type { InputInstance, InputPasswordInstance, InputSearchInstance } from '../input';
|
|
9
|
+
import type { InputMaskInstance } from '../input-mask';
|
|
9
10
|
import type { InputNumberInstance } from '../input-number';
|
|
10
11
|
import type { InputTagInstance } from '../input-tag';
|
|
11
12
|
import type { MentionInstance } from '../mention';
|
|
@@ -31,6 +32,7 @@ export declare const JSON_FORM_COMPONENT_TYPES: {
|
|
|
31
32
|
readonly checkboxGroup: "checkboxGroup";
|
|
32
33
|
readonly datePicker: "datePicker";
|
|
33
34
|
readonly input: "input";
|
|
35
|
+
readonly inputMask: "inputMask";
|
|
34
36
|
readonly inputNumber: "inputNumber";
|
|
35
37
|
readonly inputPassword: "inputPassword";
|
|
36
38
|
readonly inputSearch: "inputSearch";
|
|
@@ -67,6 +69,7 @@ type JsonFormBuiltInComponentPropsMap = {
|
|
|
67
69
|
checkboxGroup: CheckboxGroupInstance['$props'];
|
|
68
70
|
datePicker: DatePickerInstance['$props'];
|
|
69
71
|
input: InputInstance['$props'];
|
|
72
|
+
inputMask: InputMaskInstance['$props'];
|
|
70
73
|
inputNumber: InputNumberInstance['$props'];
|
|
71
74
|
inputPassword: InputPasswordInstance['$props'];
|
|
72
75
|
inputSearch: InputSearchInstance['$props'];
|
|
@@ -94,6 +97,7 @@ type JsonFormBuiltInComponentEventsMap = {
|
|
|
94
97
|
checkboxGroup: CheckboxGroupInstance['$emit'];
|
|
95
98
|
datePicker: DatePickerInstance['$emit'];
|
|
96
99
|
input: InputInstance['$emit'];
|
|
100
|
+
inputMask: InputMaskInstance['$emit'];
|
|
97
101
|
inputNumber: InputNumberInstance['$emit'];
|
|
98
102
|
inputPassword: InputPasswordInstance['$emit'];
|
|
99
103
|
inputSearch: InputSearchInstance['$emit'];
|
package/es/json-form/types.js
CHANGED
package/es/json-form/utils.js
CHANGED
|
@@ -15,6 +15,7 @@ import { JSON_FORM_COMPONENT_TYPES } from "./types.js";
|
|
|
15
15
|
import Cascader from "../cascader/index.js";
|
|
16
16
|
import range_picker_default from "../date-picker/range-picker.js";
|
|
17
17
|
import DatePicker from "../date-picker/index.js";
|
|
18
|
+
import InputMask from "../input-mask/index.js";
|
|
18
19
|
import Textarea from "../textarea/index.js";
|
|
19
20
|
import Mention from "../mention/index.js";
|
|
20
21
|
import Rate from "../rate/index.js";
|
|
@@ -31,6 +32,7 @@ var STRETCH_COMPONENT_TYPES = /* @__PURE__ */ new Set([
|
|
|
31
32
|
JSON_FORM_COMPONENT_TYPES.cascader,
|
|
32
33
|
JSON_FORM_COMPONENT_TYPES.datePicker,
|
|
33
34
|
JSON_FORM_COMPONENT_TYPES.input,
|
|
35
|
+
JSON_FORM_COMPONENT_TYPES.inputMask,
|
|
34
36
|
JSON_FORM_COMPONENT_TYPES.inputNumber,
|
|
35
37
|
JSON_FORM_COMPONENT_TYPES.inputPassword,
|
|
36
38
|
JSON_FORM_COMPONENT_TYPES.inputSearch,
|
|
@@ -50,6 +52,7 @@ var jsonFormBuiltInComponents = {
|
|
|
50
52
|
checkboxGroup: checkbox_group_default,
|
|
51
53
|
datePicker: DatePicker,
|
|
52
54
|
input: Input,
|
|
55
|
+
inputMask: InputMask,
|
|
53
56
|
inputNumber: InputNumber,
|
|
54
57
|
inputPassword: input_password_default,
|
|
55
58
|
inputSearch: input_search_default,
|
package/es/sd-vue.js
CHANGED
|
@@ -56,6 +56,7 @@ import week_picker_default from "./date-picker/pickers/week-picker.js";
|
|
|
56
56
|
import year_picker_default from "./date-picker/pickers/year-picker.js";
|
|
57
57
|
import range_picker_default from "./date-picker/range-picker.js";
|
|
58
58
|
import DatePicker from "./date-picker/index.js";
|
|
59
|
+
import InputMask from "./input-mask/index.js";
|
|
59
60
|
import Textarea from "./textarea/index.js";
|
|
60
61
|
import Mention from "./mention/index.js";
|
|
61
62
|
import Rate from "./rate/index.js";
|
|
@@ -105,7 +106,6 @@ import preview_group_default from "./image/preview-group.js";
|
|
|
105
106
|
import Image from "./image/index.js";
|
|
106
107
|
import FilePreviewer from "./file-previewer/index.js";
|
|
107
108
|
import Icon from "./icon-component/index.js";
|
|
108
|
-
import InputMask from "./input-mask/index.js";
|
|
109
109
|
import KvList from "./kv-list/index.js";
|
|
110
110
|
import content_default from "./layout/content.js";
|
|
111
111
|
import footer_default from "./layout/footer.js";
|
package/es/upload/context.d.ts
CHANGED
package/es/upload/index.d.ts
CHANGED
|
@@ -62,6 +62,10 @@ declare const Upload: {
|
|
|
62
62
|
type: BooleanConstructor;
|
|
63
63
|
default: boolean;
|
|
64
64
|
};
|
|
65
|
+
showStartButton: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
65
69
|
showRetryButton: {
|
|
66
70
|
type: BooleanConstructor;
|
|
67
71
|
default: boolean;
|
|
@@ -155,6 +159,7 @@ declare const Upload: {
|
|
|
155
159
|
autoUpload: boolean;
|
|
156
160
|
showFileList: boolean;
|
|
157
161
|
showRemoveButton: boolean;
|
|
162
|
+
showStartButton: boolean;
|
|
158
163
|
showRetryButton: boolean;
|
|
159
164
|
showCancelButton: boolean;
|
|
160
165
|
showUploadButton: boolean | {
|
|
@@ -231,6 +236,10 @@ declare const Upload: {
|
|
|
231
236
|
type: BooleanConstructor;
|
|
232
237
|
default: boolean;
|
|
233
238
|
};
|
|
239
|
+
showStartButton: {
|
|
240
|
+
type: BooleanConstructor;
|
|
241
|
+
default: boolean;
|
|
242
|
+
};
|
|
234
243
|
showRetryButton: {
|
|
235
244
|
type: BooleanConstructor;
|
|
236
245
|
default: boolean;
|
|
@@ -316,6 +325,7 @@ declare const Upload: {
|
|
|
316
325
|
autoUpload: boolean;
|
|
317
326
|
showFileList: boolean;
|
|
318
327
|
showRemoveButton: boolean;
|
|
328
|
+
showStartButton: boolean;
|
|
319
329
|
showRetryButton: boolean;
|
|
320
330
|
showCancelButton: boolean;
|
|
321
331
|
showUploadButton: boolean | {
|
|
@@ -389,6 +399,10 @@ declare const Upload: {
|
|
|
389
399
|
type: BooleanConstructor;
|
|
390
400
|
default: boolean;
|
|
391
401
|
};
|
|
402
|
+
showStartButton: {
|
|
403
|
+
type: BooleanConstructor;
|
|
404
|
+
default: boolean;
|
|
405
|
+
};
|
|
392
406
|
showRetryButton: {
|
|
393
407
|
type: BooleanConstructor;
|
|
394
408
|
default: boolean;
|
|
@@ -482,6 +496,7 @@ declare const Upload: {
|
|
|
482
496
|
autoUpload: boolean;
|
|
483
497
|
showFileList: boolean;
|
|
484
498
|
showRemoveButton: boolean;
|
|
499
|
+
showStartButton: boolean;
|
|
485
500
|
showRetryButton: boolean;
|
|
486
501
|
showCancelButton: boolean;
|
|
487
502
|
showUploadButton: boolean | {
|
|
@@ -6,6 +6,7 @@ import IconImageClose from "../icon/icon-image-close/index.js";
|
|
|
6
6
|
import IconDelete from "../icon/icon-delete/index.js";
|
|
7
7
|
import { uploadInjectionKey } from "./context.js";
|
|
8
8
|
import IconUpload from "../icon/icon-upload/index.js";
|
|
9
|
+
import IconPlayArrowFill from "../icon/icon-play-arrow-fill/index.js";
|
|
9
10
|
import upload_progress_default from "./upload-progress.js";
|
|
10
11
|
import { Fragment, computed, createVNode, defineComponent, inject, mergeProps } from "vue";
|
|
11
12
|
//#region components/upload/upload-picture-item.tsx
|
|
@@ -33,7 +34,7 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
const renderCard = () => {
|
|
36
|
-
var _uploadCtx$slots$imag, _uploadCtx$slots, _uploadCtx$slots$imag2, _ref, _uploadCtx$slots$erro, _uploadCtx$slots2, _uploadCtx$slots2$err, _uploadCtx$customIcon, _uploadCtx$customIcon2, _ref2, _uploadCtx$slots$prev, _uploadCtx$slots3, _uploadCtx$slots3$pre, _uploadCtx$customIcon3, _uploadCtx$customIcon4, _ref3, _uploadCtx$slots$
|
|
37
|
+
var _uploadCtx$slots$imag, _uploadCtx$slots, _uploadCtx$slots$imag2, _ref, _uploadCtx$slots$erro, _uploadCtx$slots2, _uploadCtx$slots2$err, _uploadCtx$customIcon, _uploadCtx$customIcon2, _ref2, _uploadCtx$slots$prev, _uploadCtx$slots3, _uploadCtx$slots3$pre, _uploadCtx$customIcon3, _uploadCtx$customIcon4, _ref3, _uploadCtx$slots$star, _uploadCtx$slots4, _uploadCtx$slots4$sta, _uploadCtx$customIcon5, _uploadCtx$customIcon6, _ref4, _uploadCtx$slots$retr, _uploadCtx$slots5, _uploadCtx$slots5$ret, _uploadCtx$customIcon7, _uploadCtx$customIcon8, _ref5, _uploadCtx$slots$remo, _uploadCtx$slots6, _uploadCtx$slots6$rem, _uploadCtx$customIcon9, _uploadCtx$customIcon10, _uploadCtx$slots7, _uploadCtx$slots7$ext;
|
|
37
38
|
if (props.file.status === "uploading") return createVNode(upload_progress_default, {
|
|
38
39
|
"file": props.file,
|
|
39
40
|
"listType": "picture-card"
|
|
@@ -41,7 +42,7 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
41
42
|
return createVNode(Fragment, null, [(_uploadCtx$slots$imag = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots$imag2 = (_uploadCtx$slots = uploadCtx.slots).image) === null || _uploadCtx$slots$imag2 === void 0 ? void 0 : _uploadCtx$slots$imag2.call(_uploadCtx$slots, { fileItem: props.file })) !== null && _uploadCtx$slots$imag !== void 0 ? _uploadCtx$slots$imag : createVNode("img", mergeProps({
|
|
42
43
|
"src": props.file.url,
|
|
43
44
|
"alt": props.file.name
|
|
44
|
-
}, (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.imageLoading) ? { loading: uploadCtx.imageLoading } : void 0), null), createVNode("div", { "class": `${itemCls}-mask` }, [props.file.status === "error" &&
|
|
45
|
+
}, (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.imageLoading) ? { loading: uploadCtx.imageLoading } : void 0), null), createVNode("div", { "class": `${itemCls}-mask` }, [props.file.status === "error" && createVNode("div", { "class": `${itemCls}-error-tip` }, [createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-error`] }, [(_ref = (_uploadCtx$slots$erro = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots2$err = (_uploadCtx$slots2 = uploadCtx.slots)["error-icon"]) === null || _uploadCtx$slots2$err === void 0 ? void 0 : _uploadCtx$slots2$err.call(_uploadCtx$slots2)) !== null && _uploadCtx$slots$erro !== void 0 ? _uploadCtx$slots$erro : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon = uploadCtx.customIcon) === null || _uploadCtx$customIcon === void 0 || (_uploadCtx$customIcon2 = _uploadCtx$customIcon.errorIcon) === null || _uploadCtx$customIcon2 === void 0 ? void 0 : _uploadCtx$customIcon2.call(_uploadCtx$customIcon)) !== null && _ref !== void 0 ? _ref : createVNode(IconImageClose, null, null)])]), createVNode("div", { "class": `${itemCls}-operation` }, [
|
|
45
46
|
props.file.status !== "error" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showPreviewButton) && createVNode("span", {
|
|
46
47
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-preview`],
|
|
47
48
|
"role": "button",
|
|
@@ -50,14 +51,22 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
50
51
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onPreview(props.file),
|
|
51
52
|
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onPreview(props.file))
|
|
52
53
|
}, [(_ref2 = (_uploadCtx$slots$prev = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots3$pre = (_uploadCtx$slots3 = uploadCtx.slots)["preview-icon"]) === null || _uploadCtx$slots3$pre === void 0 ? void 0 : _uploadCtx$slots3$pre.call(_uploadCtx$slots3)) !== null && _uploadCtx$slots$prev !== void 0 ? _uploadCtx$slots$prev : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon3 = uploadCtx.customIcon) === null || _uploadCtx$customIcon3 === void 0 || (_uploadCtx$customIcon4 = _uploadCtx$customIcon3.previewIcon) === null || _uploadCtx$customIcon4 === void 0 ? void 0 : _uploadCtx$customIcon4.call(_uploadCtx$customIcon3)) !== null && _ref2 !== void 0 ? _ref2 : createVNode(IconEye, null, null)]),
|
|
53
|
-
|
|
54
|
+
props.file.status === "init" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showStartButton) && createVNode("span", {
|
|
55
|
+
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-start`],
|
|
56
|
+
"role": "button",
|
|
57
|
+
"tabindex": "0",
|
|
58
|
+
"aria-label": t("upload.start"),
|
|
59
|
+
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file),
|
|
60
|
+
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file))
|
|
61
|
+
}, [(_ref3 = (_uploadCtx$slots$star = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots4$sta = (_uploadCtx$slots4 = uploadCtx.slots)["start-icon"]) === null || _uploadCtx$slots4$sta === void 0 ? void 0 : _uploadCtx$slots4$sta.call(_uploadCtx$slots4)) !== null && _uploadCtx$slots$star !== void 0 ? _uploadCtx$slots$star : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon5 = uploadCtx.customIcon) === null || _uploadCtx$customIcon5 === void 0 || (_uploadCtx$customIcon6 = _uploadCtx$customIcon5.startIcon) === null || _uploadCtx$customIcon6 === void 0 ? void 0 : _uploadCtx$customIcon6.call(_uploadCtx$customIcon5)) !== null && _ref3 !== void 0 ? _ref3 : createVNode(IconPlayArrowFill, null, null)]),
|
|
62
|
+
props.file.status === "error" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRetryButton) && createVNode("span", {
|
|
54
63
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-upload`],
|
|
55
64
|
"role": "button",
|
|
56
65
|
"tabindex": "0",
|
|
57
66
|
"aria-label": t("a11y.retryUpload"),
|
|
58
67
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file),
|
|
59
68
|
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file))
|
|
60
|
-
}, [(
|
|
69
|
+
}, [(_ref4 = (_uploadCtx$slots$retr = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots5$ret = (_uploadCtx$slots5 = uploadCtx.slots)["retry-icon"]) === null || _uploadCtx$slots5$ret === void 0 ? void 0 : _uploadCtx$slots5$ret.call(_uploadCtx$slots5)) !== null && _uploadCtx$slots$retr !== void 0 ? _uploadCtx$slots$retr : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon7 = uploadCtx.customIcon) === null || _uploadCtx$customIcon7 === void 0 || (_uploadCtx$customIcon8 = _uploadCtx$customIcon7.retryIcon) === null || _uploadCtx$customIcon8 === void 0 ? void 0 : _uploadCtx$customIcon8.call(_uploadCtx$customIcon7)) !== null && _ref4 !== void 0 ? _ref4 : createVNode(IconUpload, null, null)]),
|
|
61
70
|
!(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.disabled) && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRemoveButton) && createVNode("span", {
|
|
62
71
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-remove`],
|
|
63
72
|
"role": "button",
|
|
@@ -68,8 +77,8 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
68
77
|
var _uploadCtx$onRemove;
|
|
69
78
|
return uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$onRemove = uploadCtx.onRemove) === null || _uploadCtx$onRemove === void 0 ? void 0 : _uploadCtx$onRemove.call(uploadCtx, props.file);
|
|
70
79
|
})
|
|
71
|
-
}, [(
|
|
72
|
-
uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$
|
|
80
|
+
}, [(_ref5 = (_uploadCtx$slots$remo = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots6$rem = (_uploadCtx$slots6 = uploadCtx.slots)["remove-icon"]) === null || _uploadCtx$slots6$rem === void 0 ? void 0 : _uploadCtx$slots6$rem.call(_uploadCtx$slots6)) !== null && _uploadCtx$slots$remo !== void 0 ? _uploadCtx$slots$remo : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon9 = uploadCtx.customIcon) === null || _uploadCtx$customIcon9 === void 0 || (_uploadCtx$customIcon10 = _uploadCtx$customIcon9.removeIcon) === null || _uploadCtx$customIcon10 === void 0 ? void 0 : _uploadCtx$customIcon10.call(_uploadCtx$customIcon9)) !== null && _ref5 !== void 0 ? _ref5 : createVNode(IconDelete, null, null)]),
|
|
81
|
+
uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots7$ext = (_uploadCtx$slots7 = uploadCtx.slots)["extra-button"]) === null || _uploadCtx$slots7$ext === void 0 ? void 0 : _uploadCtx$slots7$ext.call(_uploadCtx$slots7, props.file)
|
|
73
82
|
])])]);
|
|
74
83
|
};
|
|
75
84
|
return () => createVNode("span", { "class": cls.value }, [renderCard()]);
|
|
@@ -28,29 +28,33 @@ var upload_progress_default = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
const uploadCtx = inject(uploadInjectionKey, void 0);
|
|
29
29
|
const renderIcon = () => {
|
|
30
30
|
if (props.file.status === "error") {
|
|
31
|
-
var _uploadCtx$slots$retr, _uploadCtx$slots, _uploadCtx$slots
|
|
31
|
+
var _ref, _uploadCtx$slots$retr, _uploadCtx$slots$retr2, _uploadCtx$slots, _uploadCtx$customIcon, _uploadCtx$customIcon2;
|
|
32
|
+
if (!(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRetryButton)) return null;
|
|
32
33
|
return createVNode("span", {
|
|
33
34
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-upload`],
|
|
34
35
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file)
|
|
35
|
-
}, [(
|
|
36
|
+
}, [(_ref = (_uploadCtx$slots$retr = (_uploadCtx$slots$retr2 = (_uploadCtx$slots = uploadCtx.slots)["retry-icon"]) === null || _uploadCtx$slots$retr2 === void 0 ? void 0 : _uploadCtx$slots$retr2.call(_uploadCtx$slots)) !== null && _uploadCtx$slots$retr !== void 0 ? _uploadCtx$slots$retr : (_uploadCtx$customIcon = uploadCtx.customIcon) === null || _uploadCtx$customIcon === void 0 || (_uploadCtx$customIcon2 = _uploadCtx$customIcon.retryIcon) === null || _uploadCtx$customIcon2 === void 0 ? void 0 : _uploadCtx$customIcon2.call(_uploadCtx$customIcon)) !== null && _ref !== void 0 ? _ref : props.listType === "picture-card" ? createVNode(IconUpload, null, null) : t("upload.retry")]);
|
|
36
37
|
}
|
|
37
38
|
if (props.file.status === "done") {
|
|
38
|
-
var
|
|
39
|
-
return createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-success`] }, [(
|
|
39
|
+
var _ref2, _uploadCtx$slots$succ, _uploadCtx$slots2, _uploadCtx$slots2$suc, _uploadCtx$customIcon3, _uploadCtx$customIcon4;
|
|
40
|
+
return createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-success`] }, [(_ref2 = (_uploadCtx$slots$succ = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots2$suc = (_uploadCtx$slots2 = uploadCtx.slots)["success-icon"]) === null || _uploadCtx$slots2$suc === void 0 ? void 0 : _uploadCtx$slots2$suc.call(_uploadCtx$slots2)) !== null && _uploadCtx$slots$succ !== void 0 ? _uploadCtx$slots$succ : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon3 = uploadCtx.customIcon) === null || _uploadCtx$customIcon3 === void 0 || (_uploadCtx$customIcon4 = _uploadCtx$customIcon3.successIcon) === null || _uploadCtx$customIcon4 === void 0 ? void 0 : _uploadCtx$customIcon4.call(_uploadCtx$customIcon3)) !== null && _ref2 !== void 0 ? _ref2 : createVNode(IconCheck, null, null)]);
|
|
41
|
+
}
|
|
42
|
+
if (props.file.status === "init") {
|
|
43
|
+
if (!(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showStartButton)) return null;
|
|
44
|
+
return createVNode(Tooltip, { "content": t("upload.start") }, { default: () => {
|
|
45
|
+
var _ref3, _uploadCtx$slots$star, _uploadCtx$slots3, _uploadCtx$slots3$sta, _uploadCtx$customIcon5, _uploadCtx$customIcon6;
|
|
46
|
+
return [createVNode("span", {
|
|
47
|
+
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-start`],
|
|
48
|
+
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file)
|
|
49
|
+
}, [(_ref3 = (_uploadCtx$slots$star = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots3$sta = (_uploadCtx$slots3 = uploadCtx.slots)["start-icon"]) === null || _uploadCtx$slots3$sta === void 0 ? void 0 : _uploadCtx$slots3$sta.call(_uploadCtx$slots3)) !== null && _uploadCtx$slots$star !== void 0 ? _uploadCtx$slots$star : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon5 = uploadCtx.customIcon) === null || _uploadCtx$customIcon5 === void 0 || (_uploadCtx$customIcon6 = _uploadCtx$customIcon5.startIcon) === null || _uploadCtx$customIcon6 === void 0 ? void 0 : _uploadCtx$customIcon6.call(_uploadCtx$customIcon5)) !== null && _ref3 !== void 0 ? _ref3 : createVNode(IconPlayArrowFill, null, null)])];
|
|
50
|
+
} });
|
|
40
51
|
}
|
|
41
|
-
if (props.file.status === "init") return createVNode(Tooltip, { "content": t("upload.start") }, { default: () => {
|
|
42
|
-
var _ref2, _uploadCtx$slots$star, _uploadCtx$slots3, _uploadCtx$slots3$sta, _uploadCtx$customIcon5, _uploadCtx$customIcon6;
|
|
43
|
-
return [createVNode("span", {
|
|
44
|
-
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-start`],
|
|
45
|
-
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file)
|
|
46
|
-
}, [(_ref2 = (_uploadCtx$slots$star = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots3$sta = (_uploadCtx$slots3 = uploadCtx.slots)["start-icon"]) === null || _uploadCtx$slots3$sta === void 0 ? void 0 : _uploadCtx$slots3$sta.call(_uploadCtx$slots3)) !== null && _uploadCtx$slots$star !== void 0 ? _uploadCtx$slots$star : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon5 = uploadCtx.customIcon) === null || _uploadCtx$customIcon5 === void 0 || (_uploadCtx$customIcon6 = _uploadCtx$customIcon5.startIcon) === null || _uploadCtx$customIcon6 === void 0 ? void 0 : _uploadCtx$customIcon6.call(_uploadCtx$customIcon5)) !== null && _ref2 !== void 0 ? _ref2 : createVNode(IconPlayArrowFill, null, null)])];
|
|
47
|
-
} });
|
|
48
52
|
return (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showCancelButton) && createVNode(Tooltip, { "content": t("upload.cancel") }, { default: () => {
|
|
49
|
-
var
|
|
53
|
+
var _ref4, _uploadCtx$slots$canc, _uploadCtx$slots4, _uploadCtx$slots4$can, _uploadCtx$customIcon7, _uploadCtx$customIcon8;
|
|
50
54
|
return [createVNode("span", {
|
|
51
55
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-cancel`],
|
|
52
56
|
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onAbort(props.file)
|
|
53
|
-
}, [(
|
|
57
|
+
}, [(_ref4 = (_uploadCtx$slots$canc = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots4$can = (_uploadCtx$slots4 = uploadCtx.slots)["cancel-icon"]) === null || _uploadCtx$slots4$can === void 0 ? void 0 : _uploadCtx$slots4$can.call(_uploadCtx$slots4)) !== null && _uploadCtx$slots$canc !== void 0 ? _uploadCtx$slots$canc : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon7 = uploadCtx.customIcon) === null || _uploadCtx$customIcon7 === void 0 || (_uploadCtx$customIcon8 = _uploadCtx$customIcon7.cancelIcon) === null || _uploadCtx$customIcon8 === void 0 ? void 0 : _uploadCtx$customIcon8.call(_uploadCtx$customIcon7)) !== null && _ref4 !== void 0 ? _ref4 : createVNode(IconPause, null, null)])];
|
|
54
58
|
} });
|
|
55
59
|
};
|
|
56
60
|
const renderProgress = () => {
|
package/es/upload/upload.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
60
60
|
type: BooleanConstructor;
|
|
61
61
|
default: boolean;
|
|
62
62
|
};
|
|
63
|
+
showStartButton: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
63
67
|
showRetryButton: {
|
|
64
68
|
type: BooleanConstructor;
|
|
65
69
|
default: boolean;
|
|
@@ -192,6 +196,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
192
196
|
type: BooleanConstructor;
|
|
193
197
|
default: boolean;
|
|
194
198
|
};
|
|
199
|
+
showStartButton: {
|
|
200
|
+
type: BooleanConstructor;
|
|
201
|
+
default: boolean;
|
|
202
|
+
};
|
|
195
203
|
showRetryButton: {
|
|
196
204
|
type: BooleanConstructor;
|
|
197
205
|
default: boolean;
|
|
@@ -265,6 +273,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
265
273
|
autoUpload: boolean;
|
|
266
274
|
showFileList: boolean;
|
|
267
275
|
showRemoveButton: boolean;
|
|
276
|
+
showStartButton: boolean;
|
|
268
277
|
showRetryButton: boolean;
|
|
269
278
|
showCancelButton: boolean;
|
|
270
279
|
showUploadButton: boolean | {
|
package/es/upload/upload.js
CHANGED
|
@@ -139,6 +139,14 @@ var upload_default = /* @__PURE__ */ defineComponent({
|
|
|
139
139
|
default: true
|
|
140
140
|
},
|
|
141
141
|
/**
|
|
142
|
+
* @zh 是否显示开始按钮
|
|
143
|
+
* @en Whether to display the start button
|
|
144
|
+
*/
|
|
145
|
+
showStartButton: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: true
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
142
150
|
* @zh 是否显示重试按钮
|
|
143
151
|
* @en Whether to display the retry button
|
|
144
152
|
* @version 2.11.0
|
|
@@ -364,7 +372,7 @@ var upload_default = /* @__PURE__ */ defineComponent({
|
|
|
364
372
|
* @version 2.43.0
|
|
365
373
|
*/
|
|
366
374
|
setup(props, { emit, slots }) {
|
|
367
|
-
const { fileList, disabled, listType, customIcon, showRetryButton, showCancelButton, showRemoveButton, showPreviewButton, imageLoading, download, showLink } = toRefs(props);
|
|
375
|
+
const { fileList, disabled, listType, customIcon, showStartButton, showRetryButton, showCancelButton, showRemoveButton, showPreviewButton, imageLoading, download, showLink } = toRefs(props);
|
|
368
376
|
const prefixCls = getPrefixCls("upload");
|
|
369
377
|
const { mergedDisabled, eventHandlers } = useFormItem({ disabled });
|
|
370
378
|
const _fileList = ref([]);
|
|
@@ -545,6 +553,7 @@ var upload_default = /* @__PURE__ */ defineComponent({
|
|
|
545
553
|
listType,
|
|
546
554
|
iconCls: `${prefixCls}-icon`,
|
|
547
555
|
showRemoveButton,
|
|
556
|
+
showStartButton,
|
|
548
557
|
showRetryButton,
|
|
549
558
|
showCancelButton,
|
|
550
559
|
showPreviewButton,
|
|
@@ -4910,6 +4910,10 @@
|
|
|
4910
4910
|
"description": "Whether to display the remove button",
|
|
4911
4911
|
"type": "boolean"
|
|
4912
4912
|
},
|
|
4913
|
+
"sd-upload/show-start-button": {
|
|
4914
|
+
"description": "Whether to display the start button",
|
|
4915
|
+
"type": "boolean"
|
|
4916
|
+
},
|
|
4913
4917
|
"sd-upload/show-retry-button": {
|
|
4914
4918
|
"description": "Whether to display the retry button",
|
|
4915
4919
|
"type": "boolean"
|
package/json/vetur-tags.json
CHANGED
package/json/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@sdata/web-vue",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.29.0",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -11832,6 +11832,14 @@
|
|
|
11832
11832
|
"kind": "expression"
|
|
11833
11833
|
}
|
|
11834
11834
|
},
|
|
11835
|
+
{
|
|
11836
|
+
"name": "show-start-button",
|
|
11837
|
+
"description": "Whether to display the start button",
|
|
11838
|
+
"value": {
|
|
11839
|
+
"type": "boolean",
|
|
11840
|
+
"kind": "expression"
|
|
11841
|
+
}
|
|
11842
|
+
},
|
|
11835
11843
|
{
|
|
11836
11844
|
"name": "show-retry-button",
|
|
11837
11845
|
"description": "Whether to display the retry button",
|