element-pe 1.0.5 → 1.0.6
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +632 -1287
- package/dist/index.full.min.js +9 -10
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +7 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +630 -1289
- package/es/component.d.ts +24 -2
- package/es/components/affix/index.js +1 -1
- package/es/components/autocomplete/index.d.ts +4 -4
- package/es/components/autocomplete/src/index.vue.d.ts +2 -2
- package/es/components/carousel/index.d.ts +2 -2
- package/es/components/carousel/src/main.vue.d.ts +2 -2
- package/es/components/cascader/index.d.ts +2 -2
- package/es/components/cascader/src/index.vue.d.ts +1 -1
- package/es/components/checkbox/index.d.ts +6 -6
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
- package/es/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/es/components/color-picker/index.d.ts +2 -2
- package/es/components/color-picker/src/components/alpha-slider.vue.d.ts +1 -1
- package/es/components/color-picker/src/components/hue-slider.vue.d.ts +1 -1
- package/es/components/color-picker/src/index.vue.d.ts +1 -1
- package/es/components/descriptions/index.d.ts +8 -8
- package/es/components/descriptions/src/description-item.d.ts +2 -2
- package/es/components/descriptions/src/descriptions-cell.d.ts +1 -1
- package/es/components/descriptions/src/index.vue.d.ts +4 -4
- package/es/components/drawer/index.d.ts +6 -6
- package/es/components/drawer/src/index.vue.d.ts +3 -3
- package/es/components/dropdown/index.d.ts +2 -2
- package/es/components/dropdown/src/dropdown.vue.d.ts +2 -2
- package/es/components/form/index.js +2 -2
- package/es/components/icon/index.d.ts +1 -1
- package/es/components/icon/src/icon.vue.d.ts +1 -1
- package/es/components/image/index.d.ts +3 -3
- package/es/components/image/index.js +2 -3
- package/es/components/image/src/image.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +3 -3
- package/es/components/image-viewer/index.d.ts +28 -104
- package/es/components/image-viewer/index.js +60 -61
- package/es/components/image-viewer/src/image-viewer.d.ts +14 -0
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +55 -0
- package/es/components/input/index.d.ts +116 -360
- package/es/components/input/index.js +216 -209
- package/es/components/input/src/calc-textarea-height.d.ts +6 -0
- package/es/components/input/src/input.d.ts +46 -0
- package/es/components/input/src/input.vue.d.ts +162 -0
- package/es/components/input-number/index.d.ts +2 -2
- package/es/components/input-number/src/index.vue.d.ts +1 -1
- package/es/components/menu/index.d.ts +7 -3
- package/es/components/menu/index.js +8 -3
- package/es/components/menu/src/menu.d.ts +8 -3
- package/es/components/pagination/index.d.ts +2 -2
- package/es/components/pagination/src/pagination.d.ts +2 -2
- package/es/components/progress/index.js +0 -1
- package/es/components/radio/index.d.ts +2 -2
- package/es/components/radio/src/radio.vue.d.ts +2 -2
- package/es/components/rate/index.js +1 -1
- package/es/components/row/index.d.ts +4 -4
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/scrollbar/index.d.ts +4 -4
- package/es/components/scrollbar/src/index.vue.d.ts +2 -2
- package/es/components/select/index.d.ts +3 -3
- package/es/components/select/src/select.vue.d.ts +3 -3
- package/es/components/select-v2/index.d.ts +6 -6
- package/es/components/select-v2/index.js +2 -0
- package/es/components/select-v2/src/select.vue.d.ts +3 -3
- package/es/components/slider/index.d.ts +4 -4
- package/es/components/slider/src/button.vue.d.ts +2 -2
- package/es/components/slider/src/index.vue.d.ts +2 -2
- package/es/components/space/index.d.ts +2 -2
- package/es/components/space/src/space.d.ts +2 -2
- package/es/components/steps/index.d.ts +2 -2
- package/es/components/steps/src/index.vue.d.ts +2 -2
- package/es/components/table/index.d.ts +4 -4
- package/es/components/table/index.js +17 -9
- package/es/components/table/src/table.vue.d.ts +4 -4
- package/es/components/tag/index.d.ts +1 -1
- package/es/components/tag/src/tag.vue.d.ts +1 -1
- package/es/components/timeline/index.d.ts +4 -4
- package/es/components/timeline/src/item.vue.d.ts +2 -2
- package/es/components/tree/index.js +1 -1
- package/es/components/tree-v2/index.d.ts +1 -1
- package/es/components/tree-v2/index.js +2 -24
- package/es/components/tree-v2/src/tree.vue.d.ts +1 -1
- package/es/components/upload/index.d.ts +4 -4
- package/es/components/upload/src/index.vue.d.ts +2 -2
- package/es/components/upload/src/upload.vue.d.ts +2 -2
- package/es/components/virtual-list/src/builders/build-grid.d.ts +3 -3
- package/es/components/virtual-list/src/builders/build-list.d.ts +4 -4
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +3 -3
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +4 -4
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +3 -3
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +4 -4
- package/es/components/virtual-list/src/components/scrollbar.d.ts +1 -1
- package/es/utils/dom.d.ts +5 -5
- package/es/utils/dom.js +29 -36
- package/es/utils/props.d.ts +2 -2
- package/es/utils/props.js +15 -7
- package/es/utils/util.d.ts +2 -2
- package/es/utils/util.js +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/component.d.ts +24 -2
- package/lib/components/affix/index.js +1 -1
- package/lib/components/autocomplete/index.d.ts +4 -4
- package/lib/components/autocomplete/src/index.vue.d.ts +2 -2
- package/lib/components/carousel/index.d.ts +2 -2
- package/lib/components/carousel/src/main.vue.d.ts +2 -2
- package/lib/components/cascader/index.d.ts +2 -2
- package/lib/components/cascader/src/index.vue.d.ts +1 -1
- package/lib/components/checkbox/index.d.ts +6 -6
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/lib/components/color-picker/index.d.ts +2 -2
- package/lib/components/color-picker/src/components/alpha-slider.vue.d.ts +1 -1
- package/lib/components/color-picker/src/components/hue-slider.vue.d.ts +1 -1
- package/lib/components/color-picker/src/index.vue.d.ts +1 -1
- package/lib/components/descriptions/index.d.ts +8 -8
- package/lib/components/descriptions/src/description-item.d.ts +2 -2
- package/lib/components/descriptions/src/descriptions-cell.d.ts +1 -1
- package/lib/components/descriptions/src/index.vue.d.ts +4 -4
- package/lib/components/drawer/index.d.ts +6 -6
- package/lib/components/drawer/src/index.vue.d.ts +3 -3
- package/lib/components/dropdown/index.d.ts +2 -2
- package/lib/components/dropdown/src/dropdown.vue.d.ts +2 -2
- package/lib/components/form/index.js +2 -2
- package/lib/components/icon/index.d.ts +1 -1
- package/lib/components/icon/src/icon.vue.d.ts +1 -1
- package/lib/components/image/index.d.ts +3 -3
- package/lib/components/image/index.js +2 -3
- package/lib/components/image/src/image.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +3 -3
- package/lib/components/image-viewer/index.d.ts +28 -104
- package/lib/components/image-viewer/index.js +61 -60
- package/lib/components/image-viewer/src/image-viewer.d.ts +14 -0
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +55 -0
- package/lib/components/input/index.d.ts +116 -360
- package/lib/components/input/index.js +215 -206
- package/lib/components/input/src/calc-textarea-height.d.ts +6 -0
- package/lib/components/input/src/input.d.ts +46 -0
- package/lib/components/input/src/input.vue.d.ts +162 -0
- package/lib/components/input-number/index.d.ts +2 -2
- package/lib/components/input-number/src/index.vue.d.ts +1 -1
- package/lib/components/menu/index.d.ts +7 -3
- package/lib/components/menu/index.js +8 -3
- package/lib/components/menu/src/menu.d.ts +8 -3
- package/lib/components/pagination/index.d.ts +2 -2
- package/lib/components/pagination/src/pagination.d.ts +2 -2
- package/lib/components/progress/index.js +0 -1
- package/lib/components/radio/index.d.ts +2 -2
- package/lib/components/radio/src/radio.vue.d.ts +2 -2
- package/lib/components/rate/index.js +1 -1
- package/lib/components/row/index.d.ts +4 -4
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/scrollbar/index.d.ts +4 -4
- package/lib/components/scrollbar/src/index.vue.d.ts +2 -2
- package/lib/components/select/index.d.ts +3 -3
- package/lib/components/select/src/select.vue.d.ts +3 -3
- package/lib/components/select-v2/index.d.ts +6 -6
- package/lib/components/select-v2/index.js +2 -0
- package/lib/components/select-v2/src/select.vue.d.ts +3 -3
- package/lib/components/slider/index.d.ts +4 -4
- package/lib/components/slider/src/button.vue.d.ts +2 -2
- package/lib/components/slider/src/index.vue.d.ts +2 -2
- package/lib/components/space/index.d.ts +2 -2
- package/lib/components/space/src/space.d.ts +2 -2
- package/lib/components/steps/index.d.ts +2 -2
- package/lib/components/steps/src/index.vue.d.ts +2 -2
- package/lib/components/table/index.d.ts +4 -4
- package/lib/components/table/index.js +17 -9
- package/lib/components/table/src/table.vue.d.ts +4 -4
- package/lib/components/tag/index.d.ts +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +1 -1
- package/lib/components/timeline/index.d.ts +4 -4
- package/lib/components/timeline/src/item.vue.d.ts +2 -2
- package/lib/components/tree/index.js +1 -1
- package/lib/components/tree-v2/index.d.ts +1 -1
- package/lib/components/tree-v2/index.js +2 -24
- package/lib/components/tree-v2/src/tree.vue.d.ts +1 -1
- package/lib/components/upload/index.d.ts +4 -4
- package/lib/components/upload/src/index.vue.d.ts +2 -2
- package/lib/components/upload/src/upload.vue.d.ts +2 -2
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +3 -3
- package/lib/components/virtual-list/src/builders/build-list.d.ts +4 -4
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +3 -3
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +4 -4
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +3 -3
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +4 -4
- package/lib/components/virtual-list/src/components/scrollbar.d.ts +1 -1
- package/lib/utils/dom.d.ts +5 -5
- package/lib/utils/dom.js +29 -36
- package/lib/utils/props.d.ts +2 -2
- package/lib/utils/props.js +15 -7
- package/lib/utils/util.d.ts +2 -2
- package/lib/utils/util.js +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -2
- package/packages/components/affix/src/affix.vue +1 -1
- package/packages/components/color-picker/src/index.vue +1 -1
- package/packages/components/form/__tests__/form.spec.ts +1 -1
- package/packages/components/form/src/form-item.vue +2 -2
- package/packages/components/image/src/image.ts +3 -3
- package/packages/components/image/src/image.vue +1 -1
- package/packages/components/image-viewer/__tests__/image-viewer.spec.ts +1 -1
- package/packages/components/image-viewer/index.ts +5 -10
- package/packages/components/image-viewer/src/image-viewer.ts +32 -0
- package/packages/components/image-viewer/src/{index.vue → image-viewer.vue} +73 -82
- package/packages/components/input/__tests__/input.spec.ts +7 -7
- package/packages/components/input/index.ts +5 -10
- package/packages/components/input/src/{calcTextareaHeight.ts → calc-textarea-height.ts} +9 -7
- package/packages/components/input/src/input.ts +100 -0
- package/packages/components/input/src/{index.vue → input.vue} +135 -239
- package/packages/components/menu/src/menu.ts +10 -3
- package/packages/components/progress/src/index.vue +0 -1
- package/packages/components/rate/src/index.vue +1 -1
- package/packages/components/select-v2/src/useSelect.ts +2 -0
- package/packages/components/space/__tests__/space.spec.ts +1 -1
- package/packages/components/switch/__tests__/switch.spec.ts +1 -1
- package/packages/components/table/src/store/tree.ts +18 -3
- package/packages/components/table/src/table-body/render-helper.ts +1 -1
- package/packages/components/table/src/table-column/index.ts +4 -1
- package/packages/components/table/src/table-layout.ts +2 -2
- package/packages/components/table/src/util.ts +1 -1
- package/packages/components/tree/src/model/node.ts +1 -1
- package/packages/element-plus/package.json +3 -2
- package/packages/element-plus/version.ts +1 -1
- package/packages/theme-chalk/package.json +1 -2
- package/packages/theme-chalk/src/message-box.scss +1 -0
- package/packages/utils/dist/es/dom.d.ts +5 -5
- package/packages/utils/dist/es/dom.js +29 -36
- package/packages/utils/dist/es/props.d.ts +2 -2
- package/packages/utils/dist/es/props.js +15 -7
- package/packages/utils/dist/es/util.d.ts +2 -2
- package/packages/utils/dist/es/util.js +3 -3
- package/packages/utils/dist/lib/dom.d.ts +5 -5
- package/packages/utils/dist/lib/dom.js +29 -36
- package/packages/utils/dist/lib/props.d.ts +2 -2
- package/packages/utils/dist/lib/props.js +15 -7
- package/packages/utils/dist/lib/util.d.ts +2 -2
- package/packages/utils/dist/lib/util.js +2 -2
- package/packages/utils/dom.ts +34 -41
- package/packages/utils/props.ts +27 -11
- package/packages/utils/tests/dom.spec.ts +183 -0
- package/packages/utils/util.ts +8 -9
- package/tags.json +1 -1
- package/theme-chalk/el-message-box.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/message-box.scss +1 -0
- package/web-types.json +1 -1
- package/es/components/image-viewer/src/index.vue.d.ts +0 -67
- package/es/components/input/src/calcTextareaHeight.d.ts +0 -6
- package/es/components/input/src/index.vue.d.ts +0 -197
- package/lib/components/image-viewer/src/index.vue.d.ts +0 -67
- package/lib/components/input/src/calcTextareaHeight.d.ts +0 -6
- package/lib/components/input/src/index.vue.d.ts +0 -197
|
@@ -223,9 +223,9 @@ declare const _Upload: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
223
223
|
name: string;
|
|
224
224
|
onChange: import("./src/upload.type").FileHandler<void>;
|
|
225
225
|
disabled: boolean;
|
|
226
|
-
data: Record<string, any>;
|
|
227
226
|
drag: boolean;
|
|
228
227
|
multiple: boolean;
|
|
228
|
+
data: Record<string, any>;
|
|
229
229
|
onError: import("./src/upload.type").FileResultHandler<Error>;
|
|
230
230
|
onProgress: import("./src/upload.type").FileResultHandler<ProgressEvent<EventTarget>>;
|
|
231
231
|
action: string;
|
|
@@ -250,9 +250,9 @@ declare const _Upload: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
250
250
|
name: string;
|
|
251
251
|
onChange: import("./src/upload.type").FileHandler<void>;
|
|
252
252
|
disabled: boolean;
|
|
253
|
-
data: Record<string, any>;
|
|
254
253
|
drag: boolean;
|
|
255
254
|
multiple: boolean;
|
|
255
|
+
data: Record<string, any>;
|
|
256
256
|
onError: import("./src/upload.type").FileResultHandler<Error>;
|
|
257
257
|
onProgress: import("./src/upload.type").FileResultHandler<ProgressEvent<EventTarget>>;
|
|
258
258
|
headers: Headers;
|
|
@@ -497,9 +497,9 @@ export declare const ElUpload: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
497
497
|
name: string;
|
|
498
498
|
onChange: import("./src/upload.type").FileHandler<void>;
|
|
499
499
|
disabled: boolean;
|
|
500
|
-
data: Record<string, any>;
|
|
501
500
|
drag: boolean;
|
|
502
501
|
multiple: boolean;
|
|
502
|
+
data: Record<string, any>;
|
|
503
503
|
onError: import("./src/upload.type").FileResultHandler<Error>;
|
|
504
504
|
onProgress: import("./src/upload.type").FileResultHandler<ProgressEvent<EventTarget>>;
|
|
505
505
|
action: string;
|
|
@@ -524,9 +524,9 @@ export declare const ElUpload: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
524
524
|
name: string;
|
|
525
525
|
onChange: import("./src/upload.type").FileHandler<void>;
|
|
526
526
|
disabled: boolean;
|
|
527
|
-
data: Record<string, any>;
|
|
528
527
|
drag: boolean;
|
|
529
528
|
multiple: boolean;
|
|
529
|
+
data: Record<string, any>;
|
|
530
530
|
onError: import("./src/upload.type").FileResultHandler<Error>;
|
|
531
531
|
onProgress: import("./src/upload.type").FileResultHandler<ProgressEvent<EventTarget>>;
|
|
532
532
|
headers: Headers;
|
|
@@ -172,9 +172,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
172
172
|
name: string;
|
|
173
173
|
onChange: FileHandler<void>;
|
|
174
174
|
disabled: boolean;
|
|
175
|
-
data: Record<string, any>;
|
|
176
175
|
drag: boolean;
|
|
177
176
|
multiple: boolean;
|
|
177
|
+
data: Record<string, any>;
|
|
178
178
|
onError: FileResultHandler<Error>;
|
|
179
179
|
onProgress: FileResultHandler<ProgressEvent<EventTarget>>;
|
|
180
180
|
action: string;
|
|
@@ -199,9 +199,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
199
199
|
name: string;
|
|
200
200
|
onChange: FileHandler<void>;
|
|
201
201
|
disabled: boolean;
|
|
202
|
-
data: Record<string, any>;
|
|
203
202
|
drag: boolean;
|
|
204
203
|
multiple: boolean;
|
|
204
|
+
data: Record<string, any>;
|
|
205
205
|
onError: FileResultHandler<Error>;
|
|
206
206
|
onProgress: FileResultHandler<ProgressEvent<EventTarget>>;
|
|
207
207
|
headers: Headers;
|
|
@@ -206,9 +206,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
206
206
|
type: string;
|
|
207
207
|
name: string;
|
|
208
208
|
disabled: boolean;
|
|
209
|
-
data: Record<string, any>;
|
|
210
209
|
drag: boolean;
|
|
211
210
|
multiple: Nullable<boolean>;
|
|
211
|
+
data: Record<string, any>;
|
|
212
212
|
onError: AjaxEventListener;
|
|
213
213
|
onProgress: AjaxEventListener;
|
|
214
214
|
action: string;
|
|
@@ -231,9 +231,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
231
231
|
type: string;
|
|
232
232
|
name: string;
|
|
233
233
|
disabled: boolean;
|
|
234
|
-
data: Record<string, any>;
|
|
235
234
|
drag: boolean;
|
|
236
235
|
multiple: Nullable<boolean>;
|
|
236
|
+
data: Record<string, any>;
|
|
237
237
|
onError: AjaxEventListener;
|
|
238
238
|
onProgress: AjaxEventListener;
|
|
239
239
|
headers: Nullable<Partial<Headers>>;
|
|
@@ -49,10 +49,10 @@ declare const createGrid: ({ name, clearCache, getColumnPosition, getColumnStart
|
|
|
49
49
|
} & {
|
|
50
50
|
height: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
51
51
|
width: import("../../../../utils/props").BuildPropType<readonly [NumberConstructor, StringConstructor], unknown, unknown>;
|
|
52
|
-
|
|
52
|
+
columnWidth: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<number | import("../types").ItemSize>, never, never>;
|
|
53
53
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
54
|
+
data: any[];
|
|
54
55
|
className: string;
|
|
55
|
-
columnWidth: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<number | import("../types").ItemSize>, never, never>;
|
|
56
56
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
57
57
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
58
58
|
innerElement: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, ObjectConstructor], unknown, unknown>;
|
|
@@ -73,8 +73,8 @@ declare const createGrid: ({ name, clearCache, getColumnPosition, getColumnStart
|
|
|
73
73
|
"onItem-rendered"?: ((...args: any[]) => any) | undefined;
|
|
74
74
|
}, {
|
|
75
75
|
style: StyleValue;
|
|
76
|
-
data: any[];
|
|
77
76
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
77
|
+
data: any[];
|
|
78
78
|
className: string;
|
|
79
79
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
80
80
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
@@ -70,9 +70,9 @@ declare const createList: ({ name, getOffset, getItemSize, getItemOffset, getEst
|
|
|
70
70
|
} & {
|
|
71
71
|
height: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
72
72
|
width: import("../../../../utils/props").BuildPropType<readonly [NumberConstructor, StringConstructor], unknown, unknown>;
|
|
73
|
-
data: any[];
|
|
74
|
-
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
75
73
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
74
|
+
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
75
|
+
data: any[];
|
|
76
76
|
className: string;
|
|
77
77
|
total: number;
|
|
78
78
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
@@ -90,9 +90,9 @@ declare const createList: ({ name, getOffset, getItemSize, getItemOffset, getEst
|
|
|
90
90
|
"onItem-rendered"?: ((...args: any[]) => any) | undefined;
|
|
91
91
|
}, {
|
|
92
92
|
style: import("../../../../utils/types").StyleValue;
|
|
93
|
-
data: any[];
|
|
94
|
-
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
95
93
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
94
|
+
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
95
|
+
data: any[];
|
|
96
96
|
className: string;
|
|
97
97
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
98
98
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
@@ -46,10 +46,10 @@ declare const FixedSizeGrid: import("vue").DefineComponent<{
|
|
|
46
46
|
} & {
|
|
47
47
|
height: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
48
48
|
width: import("../../../../utils/props").BuildPropType<readonly [NumberConstructor, StringConstructor], unknown, unknown>;
|
|
49
|
-
|
|
49
|
+
columnWidth: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<number | ItemSize>, never, never>;
|
|
50
50
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
51
|
+
data: any[];
|
|
51
52
|
className: string;
|
|
52
|
-
columnWidth: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<number | ItemSize>, never, never>;
|
|
53
53
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
54
54
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
55
55
|
innerElement: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, ObjectConstructor], unknown, unknown>;
|
|
@@ -70,8 +70,8 @@ declare const FixedSizeGrid: import("vue").DefineComponent<{
|
|
|
70
70
|
"onItem-rendered"?: ((...args: any[]) => any) | undefined;
|
|
71
71
|
}, {
|
|
72
72
|
style: import("../../../../utils/types").StyleValue;
|
|
73
|
-
data: any[];
|
|
74
73
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
74
|
+
data: any[];
|
|
75
75
|
className: string;
|
|
76
76
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
77
77
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
@@ -68,9 +68,9 @@ declare const DynamicSizeList: import("vue").DefineComponent<{
|
|
|
68
68
|
} & {
|
|
69
69
|
height: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
70
70
|
width: import("../../../../utils/props").BuildPropType<readonly [NumberConstructor, StringConstructor], unknown, unknown>;
|
|
71
|
-
data: any[];
|
|
72
|
-
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
73
71
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
72
|
+
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
73
|
+
data: any[];
|
|
74
74
|
className: string;
|
|
75
75
|
total: number;
|
|
76
76
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
@@ -88,9 +88,9 @@ declare const DynamicSizeList: import("vue").DefineComponent<{
|
|
|
88
88
|
"onItem-rendered"?: ((...args: any[]) => any) | undefined;
|
|
89
89
|
}, {
|
|
90
90
|
style: import("../../../../utils/types").StyleValue;
|
|
91
|
-
data: any[];
|
|
92
|
-
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
93
91
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
92
|
+
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
93
|
+
data: any[];
|
|
94
94
|
className: string;
|
|
95
95
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
96
96
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
@@ -45,10 +45,10 @@ declare const FixedSizeGrid: import("vue").DefineComponent<{
|
|
|
45
45
|
} & {
|
|
46
46
|
height: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
47
47
|
width: import("../../../../utils/props").BuildPropType<readonly [NumberConstructor, StringConstructor], unknown, unknown>;
|
|
48
|
-
|
|
48
|
+
columnWidth: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<number | import("../types").ItemSize>, never, never>;
|
|
49
49
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
50
|
+
data: any[];
|
|
50
51
|
className: string;
|
|
51
|
-
columnWidth: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<number | import("../types").ItemSize>, never, never>;
|
|
52
52
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
53
53
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
54
54
|
innerElement: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, ObjectConstructor], unknown, unknown>;
|
|
@@ -69,8 +69,8 @@ declare const FixedSizeGrid: import("vue").DefineComponent<{
|
|
|
69
69
|
"onItem-rendered"?: ((...args: any[]) => any) | undefined;
|
|
70
70
|
}, {
|
|
71
71
|
style: import("../../../../utils/types").StyleValue;
|
|
72
|
-
data: any[];
|
|
73
72
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
73
|
+
data: any[];
|
|
74
74
|
className: string;
|
|
75
75
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
76
76
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
@@ -67,9 +67,9 @@ declare const FixedSizeList: import("vue").DefineComponent<{
|
|
|
67
67
|
} & {
|
|
68
68
|
height: import("../../../../utils/props").BuildPropType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
69
69
|
width: import("../../../../utils/props").BuildPropType<readonly [NumberConstructor, StringConstructor], unknown, unknown>;
|
|
70
|
-
data: any[];
|
|
71
|
-
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
72
70
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
71
|
+
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
72
|
+
data: any[];
|
|
73
73
|
className: string;
|
|
74
74
|
total: number;
|
|
75
75
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
@@ -87,9 +87,9 @@ declare const FixedSizeList: import("vue").DefineComponent<{
|
|
|
87
87
|
"onItem-rendered"?: ((...args: any[]) => any) | undefined;
|
|
88
88
|
}, {
|
|
89
89
|
style: import("../../../../utils/types").StyleValue;
|
|
90
|
-
data: any[];
|
|
91
|
-
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
92
90
|
direction: import("../../../../utils/props").BuildPropType<StringConstructor, "ltr" | "rtl", never>;
|
|
91
|
+
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
92
|
+
data: any[];
|
|
93
93
|
className: string;
|
|
94
94
|
perfMode: import("../../../../utils/props").BuildPropType<BooleanConstructor, unknown, unknown>;
|
|
95
95
|
containerElement: import("../../../../utils/props").BuildPropType<import("../../../../utils/props").PropWrapper<string | Element>, unknown, unknown>;
|
|
@@ -16,8 +16,8 @@ declare const ScrollBar: import("vue").DefineComponent<{
|
|
|
16
16
|
readonly visible?: unknown;
|
|
17
17
|
} & {
|
|
18
18
|
visible: boolean;
|
|
19
|
-
ratio: number;
|
|
20
19
|
layout: import("../../../../utils/props").BuildPropType<StringConstructor, "horizontal" | "vertical", never>;
|
|
20
|
+
ratio: number;
|
|
21
21
|
total: number;
|
|
22
22
|
clientSize: number;
|
|
23
23
|
scrollFrom: number;
|
package/lib/utils/dom.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import type { Nullable } from './types';
|
|
|
3
3
|
export declare const on: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
|
|
4
4
|
export declare const off: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
|
|
5
5
|
export declare const once: (el: HTMLElement, event: string, fn: EventListener) => void;
|
|
6
|
-
export declare function hasClass(el: HTMLElement, cls: string): boolean;
|
|
7
|
-
export declare function addClass(el: HTMLElement, cls: string): void;
|
|
8
|
-
export declare function removeClass(el: HTMLElement, cls: string): void;
|
|
6
|
+
export declare function hasClass(el: HTMLElement | Element, cls: string): boolean;
|
|
7
|
+
export declare function addClass(el: HTMLElement | Element, cls: string): void;
|
|
8
|
+
export declare function removeClass(el: HTMLElement | Element, cls: string): void;
|
|
9
9
|
export declare const getStyle: (element: HTMLElement, styleName: string) => string;
|
|
10
10
|
export declare function setStyle(element: HTMLElement, styleName: CSSProperties | string, value?: string): void;
|
|
11
11
|
export declare function removeStyle(element: HTMLElement, style: CSSProperties | string): void;
|
|
12
|
-
export declare const isScroll: (el: HTMLElement, isVertical?: Nullable<boolean>) => RegExpMatchArray;
|
|
13
|
-
export declare const getScrollContainer: (el: HTMLElement, isVertical?: Nullable<boolean>) => Window | HTMLElement;
|
|
12
|
+
export declare const isScroll: (el: HTMLElement, isVertical?: Nullable<boolean>) => RegExpMatchArray | null;
|
|
13
|
+
export declare const getScrollContainer: (el: HTMLElement, isVertical?: Nullable<boolean>) => Window | HTMLElement | undefined;
|
|
14
14
|
export declare const isInContainer: (el: Element | undefined, container: Element | Window | undefined) => boolean;
|
|
15
15
|
export declare const getOffsetTop: (el: HTMLElement) => number;
|
|
16
16
|
export declare const getOffsetTopDistance: (el: HTMLElement, containerEl: HTMLElement) => number;
|
package/lib/utils/dom.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.stop = exports.getOffsetTopDistance = exports.getOffsetTop = exports.isInContainer = exports.getScrollContainer = exports.isScroll = exports.removeStyle = exports.setStyle = exports.getStyle = exports.removeClass = exports.addClass = exports.hasClass = exports.once = exports.off = exports.on = void 0;
|
|
7
7
|
const isServer_1 = __importDefault(require("./isServer"));
|
|
8
8
|
const util_1 = require("./util");
|
|
9
|
-
const
|
|
10
|
-
return (s || '').
|
|
9
|
+
const trimArr = function (s) {
|
|
10
|
+
return (s || '').split(' ').filter((item) => !!item.trim());
|
|
11
11
|
};
|
|
12
12
|
const on = function (element, event, handler, useCapture = false) {
|
|
13
13
|
if (element && event && handler) {
|
|
@@ -40,57 +40,50 @@ function hasClass(el, cls) {
|
|
|
40
40
|
return el.classList.contains(cls);
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
|
|
43
|
+
const className = el.getAttribute('class') || '';
|
|
44
|
+
return className.split(' ').includes(cls);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
exports.hasClass = hasClass;
|
|
47
48
|
function addClass(el, cls) {
|
|
48
49
|
if (!el)
|
|
49
50
|
return;
|
|
50
|
-
let
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
el.classList.add(clsName);
|
|
58
|
-
}
|
|
59
|
-
else if (!hasClass(el, clsName)) {
|
|
60
|
-
curClass += ` ${clsName}`;
|
|
61
|
-
}
|
|
51
|
+
let className = el.getAttribute('class') || '';
|
|
52
|
+
const curClass = trimArr(className);
|
|
53
|
+
const classes = (cls || '')
|
|
54
|
+
.split(' ')
|
|
55
|
+
.filter((item) => !curClass.includes(item) && !!item.trim());
|
|
56
|
+
if (el.classList) {
|
|
57
|
+
el.classList.add(...classes);
|
|
62
58
|
}
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
else {
|
|
60
|
+
className += ` ${classes.join(' ')}`;
|
|
61
|
+
el.setAttribute('class', className);
|
|
65
62
|
}
|
|
66
63
|
}
|
|
67
64
|
exports.addClass = addClass;
|
|
68
65
|
function removeClass(el, cls) {
|
|
69
66
|
if (!el || !cls)
|
|
70
67
|
return;
|
|
71
|
-
const classes = cls
|
|
72
|
-
let curClass =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
continue;
|
|
77
|
-
if (el.classList) {
|
|
78
|
-
el.classList.remove(clsName);
|
|
79
|
-
}
|
|
80
|
-
else if (hasClass(el, clsName)) {
|
|
81
|
-
curClass = curClass.replace(` ${clsName} `, ' ');
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (!el.classList) {
|
|
85
|
-
el.className = trim(curClass);
|
|
68
|
+
const classes = trimArr(cls);
|
|
69
|
+
let curClass = el.getAttribute('class') || '';
|
|
70
|
+
if (el.classList) {
|
|
71
|
+
el.classList.remove(...classes);
|
|
72
|
+
return;
|
|
86
73
|
}
|
|
74
|
+
classes.forEach((item) => {
|
|
75
|
+
curClass = curClass.replace(` ${item} `, ' ');
|
|
76
|
+
});
|
|
77
|
+
const className = trimArr(curClass).join(' ');
|
|
78
|
+
el.setAttribute('class', className);
|
|
87
79
|
}
|
|
88
80
|
exports.removeClass = removeClass;
|
|
89
81
|
const getStyle = function (element, styleName) {
|
|
82
|
+
var _a;
|
|
90
83
|
if (isServer_1.default)
|
|
91
|
-
return;
|
|
84
|
+
return '';
|
|
92
85
|
if (!element || !styleName)
|
|
93
|
-
return
|
|
86
|
+
return '';
|
|
94
87
|
styleName = (0, util_1.camelize)(styleName);
|
|
95
88
|
if (styleName === 'float') {
|
|
96
89
|
styleName = 'cssFloat';
|
|
@@ -99,7 +92,7 @@ const getStyle = function (element, styleName) {
|
|
|
99
92
|
const style = element.style[styleName];
|
|
100
93
|
if (style)
|
|
101
94
|
return style;
|
|
102
|
-
const computed = document.defaultView.getComputedStyle(element, '');
|
|
95
|
+
const computed = (_a = document.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(element, '');
|
|
103
96
|
return computed ? computed[styleName] : '';
|
|
104
97
|
}
|
|
105
98
|
catch (e) {
|
|
@@ -136,7 +129,7 @@ function removeStyle(element, style) {
|
|
|
136
129
|
exports.removeStyle = removeStyle;
|
|
137
130
|
const isScroll = (el, isVertical) => {
|
|
138
131
|
if (isServer_1.default)
|
|
139
|
-
return;
|
|
132
|
+
return null;
|
|
140
133
|
const determinedDirection = isVertical === null || isVertical === undefined;
|
|
141
134
|
const overflow = determinedDirection
|
|
142
135
|
? (0, exports.getStyle)(el, 'overflow')
|
package/lib/utils/props.d.ts
CHANGED
|
@@ -39,13 +39,13 @@ export declare type BuildPropReturn<T, D, R, V, C> = {
|
|
|
39
39
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
40
40
|
[propKey]: true;
|
|
41
41
|
} & BuildPropDefault<BuildPropType<T, V, C>, IfUnknown<D, never>, IfUnknown<R, false>>;
|
|
42
|
-
export declare function buildProp<T = never, D extends BuildPropType<T, V, C> = never, R extends boolean = false, V = never, C = never>(option: BuildPropOption<T, D, R, V, C
|
|
42
|
+
export declare function buildProp<T = never, D extends BuildPropType<T, V, C> = never, R extends boolean = false, V = never, C = never>(option: BuildPropOption<T, D, R, V, C>, key?: string): BuildPropReturn<T, D, R, V, C>;
|
|
43
43
|
declare type NativePropType = [
|
|
44
44
|
((...args: any) => any) | {
|
|
45
45
|
new (...args: any): any;
|
|
46
46
|
} | undefined | null
|
|
47
47
|
];
|
|
48
|
-
export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(
|
|
48
|
+
export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(props: O) => { [K_1 in keyof O]: O[K_1] extends {
|
|
49
49
|
[propKey]: boolean;
|
|
50
50
|
} ? O[K_1] : [O[K_1]] extends NativePropType ? O[K_1] : O[K_1] extends BuildPropOption<infer T_1, infer _D, infer R_1, infer V_1, infer C_1> ? BuildPropReturn<T_1, O[K_1]["default"], R_1, V_1, C_1> : never; };
|
|
51
51
|
export declare const definePropType: <T>(val: any) => PropWrapper<T>;
|
package/lib/utils/props.js
CHANGED
|
@@ -4,13 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.componentSize = exports.mutable = exports.keyOf = exports.definePropType = exports.buildProps = exports.buildProp = exports.propKey = void 0;
|
|
7
|
+
const vue_1 = require("vue");
|
|
7
8
|
const shared_1 = require("@vue/shared");
|
|
8
|
-
const
|
|
9
|
-
const error_1 = require("./error");
|
|
9
|
+
const fromPairs_1 = __importDefault(require("lodash/fromPairs"));
|
|
10
10
|
const wrapperKey = Symbol();
|
|
11
11
|
exports.propKey = Symbol();
|
|
12
|
-
function buildProp(option) {
|
|
13
|
-
var _a;
|
|
12
|
+
function buildProp(option, key) {
|
|
14
13
|
if (!(0, shared_1.isObject)(option) || !!option[exports.propKey])
|
|
15
14
|
return option;
|
|
16
15
|
const { values, required, default: defaultValue, type, validator } = option;
|
|
@@ -25,13 +24,19 @@ function buildProp(option) {
|
|
|
25
24
|
if (validator)
|
|
26
25
|
valid || (valid = validator(val));
|
|
27
26
|
if (!valid && allowedValues.length > 0) {
|
|
28
|
-
|
|
27
|
+
const allowValuesText = [...new Set(allowedValues)]
|
|
28
|
+
.map((value) => JSON.stringify(value))
|
|
29
|
+
.join(', ');
|
|
30
|
+
(0, vue_1.warn)(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ''}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
|
|
29
31
|
}
|
|
30
32
|
return valid;
|
|
31
33
|
}
|
|
32
34
|
: undefined;
|
|
33
35
|
return {
|
|
34
|
-
type:
|
|
36
|
+
type: typeof type === 'object' &&
|
|
37
|
+
Object.getOwnPropertySymbols(type).includes(wrapperKey)
|
|
38
|
+
? type[wrapperKey]
|
|
39
|
+
: type,
|
|
35
40
|
required: !!required,
|
|
36
41
|
default: defaultValue,
|
|
37
42
|
validator: _validator,
|
|
@@ -39,7 +44,10 @@ function buildProp(option) {
|
|
|
39
44
|
};
|
|
40
45
|
}
|
|
41
46
|
exports.buildProp = buildProp;
|
|
42
|
-
const buildProps = (
|
|
47
|
+
const buildProps = (props) => (0, fromPairs_1.default)(Object.entries(props).map(([key, option]) => [
|
|
48
|
+
key,
|
|
49
|
+
buildProp(option, key),
|
|
50
|
+
]));
|
|
43
51
|
exports.buildProps = buildProps;
|
|
44
52
|
const definePropType = (val) => ({ [wrapperKey]: val });
|
|
45
53
|
exports.definePropType = definePropType;
|
package/lib/utils/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { camelize, capitalize, extend, hasOwn, isArray, isObject, isString, looseEqual } from '@vue/shared';
|
|
2
2
|
import type { ComponentPublicInstance, CSSProperties, Ref } from 'vue';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TimeoutHandle, Nullable } from './types';
|
|
4
4
|
export declare const SCOPE = "Util";
|
|
5
5
|
export declare function toObject<T>(arr: Array<T>): Record<string, T>;
|
|
6
6
|
export declare const getValueByPath: (obj: any, paths?: string) => unknown;
|
|
@@ -20,7 +20,7 @@ export { hasOwn, isObject, isArray, isString, capitalize, camelize, looseEqual,
|
|
|
20
20
|
export declare const isBool: (val: unknown) => val is boolean;
|
|
21
21
|
export declare const isNumber: (val: unknown) => val is number;
|
|
22
22
|
export declare const isHTMLElement: (val: unknown) => boolean;
|
|
23
|
-
export declare function rafThrottle<T extends
|
|
23
|
+
export declare function rafThrottle<T extends (...args: any) => any>(fn: T): T;
|
|
24
24
|
export declare const clearTimer: (timer: Ref<TimeoutHandle>) => void;
|
|
25
25
|
export declare function getRandomInt(max: number): number;
|
|
26
26
|
export declare function isUndefined(val: any): val is undefined;
|
package/lib/utils/util.js
CHANGED
|
@@ -57,7 +57,7 @@ function getPropByPath(obj, path, strict) {
|
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
if (strict) {
|
|
60
|
-
|
|
60
|
+
(0, error_1.throwError)(exports.SCOPE, 'Please transfer a valid prop path to form item!');
|
|
61
61
|
}
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
@@ -117,7 +117,7 @@ function rafThrottle(fn) {
|
|
|
117
117
|
return;
|
|
118
118
|
locked = true;
|
|
119
119
|
window.requestAnimationFrame(() => {
|
|
120
|
-
|
|
120
|
+
Reflect.apply(fn, this, args);
|
|
121
121
|
locked = false;
|
|
122
122
|
});
|
|
123
123
|
};
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.5";
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "element-pe",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A Component Library for Vue 3",
|
|
5
5
|
"homepage": "https://element-plus.org/",
|
|
6
6
|
"keywords": [
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"vue": "^3.2.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@
|
|
38
|
+
"@element-plus/icons": "^0.0.11",
|
|
39
|
+
"@popperjs/core": "^2.10.2",
|
|
39
40
|
"@vueuse/core": "~6.1.0",
|
|
40
41
|
"async-validator": "^4.0.3",
|
|
41
42
|
"dayjs": "^1.10.7",
|
|
@@ -121,7 +121,7 @@ export default defineComponent({
|
|
|
121
121
|
target.value =
|
|
122
122
|
document.querySelector<HTMLElement>(props.target) ?? undefined
|
|
123
123
|
if (!target.value) {
|
|
124
|
-
throw new Error(`
|
|
124
|
+
throw new Error(`Target is not existed: ${props.target}`)
|
|
125
125
|
}
|
|
126
126
|
} else {
|
|
127
127
|
target.value = document.documentElement
|
|
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'
|
|
|
3
3
|
import installStyle from '@element-plus/test-utils/style-plugin'
|
|
4
4
|
import Checkbox from '@element-plus/components/checkbox/src/checkbox.vue'
|
|
5
5
|
import CheckboxGroup from '@element-plus/components/checkbox/src/checkbox-group.vue'
|
|
6
|
-
import Input from '@element-plus/components/input
|
|
6
|
+
import Input from '@element-plus/components/input'
|
|
7
7
|
import Form from '../src/form.vue'
|
|
8
8
|
import FormItem from '../src/form-item.vue'
|
|
9
9
|
import type { VueWrapper } from '@vue/test-utils'
|
|
@@ -151,7 +151,7 @@ export default defineComponent({
|
|
|
151
151
|
const labelStyle = computed(() => {
|
|
152
152
|
const ret: CSSProperties = {}
|
|
153
153
|
if (elForm.labelPosition === 'top') return ret
|
|
154
|
-
const labelWidth = addUnit(props.labelWidth
|
|
154
|
+
const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)
|
|
155
155
|
if (labelWidth) {
|
|
156
156
|
ret.width = labelWidth
|
|
157
157
|
}
|
|
@@ -165,7 +165,7 @@ export default defineComponent({
|
|
|
165
165
|
if (!props.label && !props.labelWidth && isNested.value) {
|
|
166
166
|
return ret
|
|
167
167
|
}
|
|
168
|
-
const labelWidth = addUnit(props.labelWidth
|
|
168
|
+
const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)
|
|
169
169
|
if (!props.label && !slots.label) {
|
|
170
170
|
ret.marginLeft = labelWidth
|
|
171
171
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isBoolean } from '@vueuse/shared'
|
|
2
1
|
import { buildProps, definePropType, mutable } from '@element-plus/utils/props'
|
|
2
|
+
import { isNumber } from '@element-plus/utils/util'
|
|
3
3
|
|
|
4
4
|
import type { ExtractPropTypes } from 'vue'
|
|
5
5
|
|
|
@@ -36,13 +36,13 @@ export const imageProps = buildProps({
|
|
|
36
36
|
type: Number,
|
|
37
37
|
default: 2000,
|
|
38
38
|
},
|
|
39
|
-
widget: String
|
|
39
|
+
widget: String,
|
|
40
40
|
} as const)
|
|
41
41
|
export type ImageProps = ExtractPropTypes<typeof imageProps>
|
|
42
42
|
|
|
43
43
|
export const imageEmits = {
|
|
44
44
|
error: (evt: Event) => evt instanceof Event,
|
|
45
|
-
switch: (val:
|
|
45
|
+
switch: (val: number) => isNumber(val),
|
|
46
46
|
close: () => true,
|
|
47
47
|
}
|
|
48
48
|
export type ImageEmits = typeof imageEmits
|
|
@@ -2,7 +2,7 @@ import { nextTick } from 'vue'
|
|
|
2
2
|
|
|
3
3
|
import { IMAGE_SUCCESS } from '@element-plus/test-utils/mock'
|
|
4
4
|
import makeMount from '@element-plus/test-utils/make-mount'
|
|
5
|
-
import ImageViewer from '../src/
|
|
5
|
+
import ImageViewer from '../src/image-viewer.vue'
|
|
6
6
|
|
|
7
7
|
const mount = makeMount(ImageViewer, {
|
|
8
8
|
props: {
|