@element-plus/nightly 0.0.20211230 → 0.0.20211231
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/README.md +0 -8
- package/dist/index.css +1 -1
- package/dist/index.full.js +5147 -5163
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +5148 -5164
- package/es/components/button/index.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +1 -1
- package/es/components/cascader/index.d.ts +6 -6
- package/es/components/cascader/src/index.vue.d.ts +3 -3
- package/es/components/checkbox/index.d.ts +4 -4
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +1 -1
- package/es/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/es/components/checkbox/src/useCheckbox.d.ts +2 -2
- package/es/components/color-picker/index.d.ts +2 -2
- package/es/components/color-picker/src/index.vue.d.ts +1 -1
- package/es/components/config-provider/index.d.ts +7 -3
- package/es/components/config-provider/index.mjs +1 -1
- package/es/components/config-provider/index.mjs.map +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +26 -1
- package/es/components/config-provider/src/config-provider.mjs +28 -4
- package/es/components/config-provider/src/config-provider.mjs.map +1 -1
- package/es/components/date-picker/index.d.ts +6 -6
- package/es/components/date-picker/src/date-picker.d.ts +3 -3
- package/es/components/descriptions/index.d.ts +1 -1
- package/es/components/descriptions/src/descriptions-cell.mjs +12 -3
- package/es/components/descriptions/src/descriptions-cell.mjs.map +1 -1
- package/es/components/descriptions/src/index.vue.d.ts +1 -1
- package/es/components/descriptions/src/index.vue_vue_type_script_lang.mjs +7 -2
- package/es/components/descriptions/src/index.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/descriptions/src/index.vue_vue_type_template_id_788d3854_lang.mjs +14 -17
- package/es/components/descriptions/src/index.vue_vue_type_template_id_788d3854_lang.mjs.map +1 -1
- package/es/components/dialog/index.d.ts +2 -2
- package/es/components/dialog/src/dialog.vue.d.ts +2 -2
- package/es/components/dialog/src/use-dialog.mjs +1 -1
- package/es/components/dialog/src/use-dialog.mjs.map +1 -1
- package/es/components/drawer/index.d.ts +2 -2
- package/es/components/drawer/src/drawer.vue.d.ts +2 -2
- package/es/components/dropdown/index.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +1 -1
- package/es/components/image/index.d.ts +2 -2
- package/es/components/image/src/image.vue.d.ts +2 -2
- package/es/components/input/index.d.ts +1 -1
- package/es/components/input/src/input.vue.d.ts +1 -1
- package/es/components/input-number/index.d.ts +3 -3
- package/es/components/input-number/src/input-number.vue.d.ts +3 -3
- package/es/components/loading/src/service.mjs +1 -1
- package/es/components/loading/src/service.mjs.map +1 -1
- package/es/components/message/src/message-method.mjs +1 -1
- package/es/components/message/src/message-method.mjs.map +1 -1
- package/es/components/message-box/src/index.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/message-box/src/index.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/message-box/src/index.vue_vue_type_template_id_7035e868_lang.mjs.map +1 -1
- package/es/components/notification/src/notification.vue.d.ts +2 -2
- package/es/components/notification/src/notify.mjs +1 -1
- package/es/components/notification/src/notify.mjs.map +1 -1
- package/es/components/overlay/index.d.ts +1 -1
- package/es/components/overlay/src/overlay.d.ts +1 -1
- package/es/components/popover/src/usePopover.mjs +1 -1
- package/es/components/popover/src/usePopover.mjs.map +1 -1
- package/es/components/popper/src/use-popper/index.mjs +1 -1
- package/es/components/popper/src/use-popper/index.mjs.map +1 -1
- package/es/components/radio/index.d.ts +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +1 -1
- package/es/components/radio/src/radio.d.ts +1 -1
- package/es/components/radio/src/radio.vue.d.ts +1 -1
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/src/select.vue.d.ts +1 -1
- package/es/components/select/src/useSelect.d.ts +1 -1
- package/es/components/select-v2/index.d.ts +2 -2
- package/es/components/select-v2/src/select.vue.d.ts +1 -1
- package/es/components/select-v2/src/useSelect.d.ts +1 -1
- package/es/components/table/index.d.ts +1 -1
- package/es/components/table/src/table/style-helper.d.ts +1 -1
- package/es/components/table/src/table.vue.d.ts +1 -1
- package/es/components/table/src/util.mjs +1 -1
- package/es/components/table/src/util.mjs.map +1 -1
- package/es/components/teleport/index.d.ts +1 -1
- package/es/components/teleport/src/teleport.vue.d.ts +1 -1
- package/es/components/time-picker/index.d.ts +6 -6
- package/es/components/time-picker/src/common/picker.vue.d.ts +4 -4
- package/es/components/time-picker/src/common/props.d.ts +1 -1
- package/es/components/time-picker/src/common/props.mjs +1 -1
- package/es/components/time-picker/src/common/props.mjs.map +1 -1
- package/es/components/time-picker/src/time-picker.d.ts +3 -3
- package/es/defaults.d.ts +1 -1
- package/es/hooks/use-common-props/index.d.ts +1 -1
- package/es/hooks/use-common-props/index.mjs +1 -3
- package/es/hooks/use-common-props/index.mjs.map +1 -1
- package/es/hooks/use-global-config/index.mjs +4 -2
- package/es/hooks/use-global-config/index.mjs.map +1 -1
- package/es/hooks/use-popper/index.mjs +1 -1
- package/es/hooks/use-popper/index.mjs.map +1 -1
- package/es/index.d.ts +3 -2
- package/es/index.mjs.map +1 -1
- package/es/make-installer.d.ts +1 -2
- package/es/make-installer.mjs +4 -18
- package/es/make-installer.mjs.map +1 -1
- package/es/utils/popup-manager.d.ts +5 -3
- package/es/utils/popup-manager.mjs +21 -25
- package/es/utils/popup-manager.mjs.map +1 -1
- package/es/utils/util.d.ts +1 -8
- package/es/utils/util.mjs +2 -10
- package/es/utils/util.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/global.d.ts +13 -0
- package/lib/components/button/index.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +1 -1
- package/lib/components/cascader/index.d.ts +6 -6
- package/lib/components/cascader/src/index.vue.d.ts +3 -3
- package/lib/components/checkbox/index.d.ts +4 -4
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/lib/components/checkbox/src/useCheckbox.d.ts +2 -2
- package/lib/components/color-picker/index.d.ts +2 -2
- package/lib/components/color-picker/src/index.vue.d.ts +1 -1
- package/lib/components/config-provider/index.d.ts +7 -3
- package/lib/components/config-provider/index.js +1 -2
- package/lib/components/config-provider/index.js.map +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +26 -1
- package/lib/components/config-provider/src/config-provider.js +27 -2
- package/lib/components/config-provider/src/config-provider.js.map +1 -1
- package/lib/components/date-picker/index.d.ts +6 -6
- package/lib/components/date-picker/src/date-picker.d.ts +3 -3
- package/lib/components/descriptions/index.d.ts +1 -1
- package/lib/components/descriptions/src/descriptions-cell.js +12 -3
- package/lib/components/descriptions/src/descriptions-cell.js.map +1 -1
- package/lib/components/descriptions/src/index.vue.d.ts +1 -1
- package/lib/components/descriptions/src/index.vue_vue_type_script_lang.js +6 -1
- package/lib/components/descriptions/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/descriptions/src/index.vue_vue_type_template_id_788d3854_lang.js +13 -16
- package/lib/components/descriptions/src/index.vue_vue_type_template_id_788d3854_lang.js.map +1 -1
- package/lib/components/dialog/index.d.ts +2 -2
- package/lib/components/dialog/src/dialog.vue.d.ts +2 -2
- package/lib/components/dialog/src/use-dialog.js +2 -2
- package/lib/components/dialog/src/use-dialog.js.map +1 -1
- package/lib/components/drawer/index.d.ts +2 -2
- package/lib/components/drawer/src/drawer.vue.d.ts +2 -2
- package/lib/components/dropdown/index.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +1 -1
- package/lib/components/image/index.d.ts +2 -2
- package/lib/components/image/src/image.vue.d.ts +2 -2
- package/lib/components/input/index.d.ts +1 -1
- package/lib/components/input/src/input.vue.d.ts +1 -1
- package/lib/components/input-number/index.d.ts +3 -3
- package/lib/components/input-number/src/input-number.vue.d.ts +3 -3
- package/lib/components/loading/src/service.js +1 -1
- package/lib/components/loading/src/service.js.map +1 -1
- package/lib/components/message/src/message-method.js +1 -1
- package/lib/components/message/src/message-method.js.map +1 -1
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js +2 -2
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/message-box/src/index.vue_vue_type_template_id_7035e868_lang.js.map +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +2 -2
- package/lib/components/notification/src/notify.js +1 -1
- package/lib/components/notification/src/notify.js.map +1 -1
- package/lib/components/overlay/index.d.ts +1 -1
- package/lib/components/overlay/src/overlay.d.ts +1 -1
- package/lib/components/popover/src/usePopover.js +2 -2
- package/lib/components/popover/src/usePopover.js.map +1 -1
- package/lib/components/popper/src/use-popper/index.js +2 -2
- package/lib/components/popper/src/use-popper/index.js.map +1 -1
- package/lib/components/radio/index.d.ts +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +1 -1
- package/lib/components/radio/src/radio.d.ts +1 -1
- package/lib/components/radio/src/radio.vue.d.ts +1 -1
- package/lib/components/select/index.d.ts +1 -1
- package/lib/components/select/src/select.vue.d.ts +1 -1
- package/lib/components/select/src/useSelect.d.ts +1 -1
- package/lib/components/select-v2/index.d.ts +2 -2
- package/lib/components/select-v2/src/select.vue.d.ts +1 -1
- package/lib/components/select-v2/src/useSelect.d.ts +1 -1
- package/lib/components/table/index.d.ts +1 -1
- package/lib/components/table/src/table/style-helper.d.ts +1 -1
- package/lib/components/table/src/table.vue.d.ts +1 -1
- package/lib/components/table/src/util.js +1 -1
- package/lib/components/table/src/util.js.map +1 -1
- package/lib/components/teleport/index.d.ts +1 -1
- package/lib/components/teleport/src/teleport.vue.d.ts +1 -1
- package/lib/components/time-picker/index.d.ts +6 -6
- package/lib/components/time-picker/src/common/picker.vue.d.ts +4 -4
- package/lib/components/time-picker/src/common/props.d.ts +1 -1
- package/lib/components/time-picker/src/common/props.js +1 -1
- package/lib/components/time-picker/src/common/props.js.map +1 -1
- package/lib/components/time-picker/src/time-picker.d.ts +3 -3
- package/lib/defaults.d.ts +1 -1
- package/lib/hooks/use-common-props/index.d.ts +1 -1
- package/lib/hooks/use-common-props/index.js +1 -3
- package/lib/hooks/use-common-props/index.js.map +1 -1
- package/lib/hooks/use-global-config/index.js +3 -1
- package/lib/hooks/use-global-config/index.js.map +1 -1
- package/lib/hooks/use-popper/index.js +2 -2
- package/lib/hooks/use-popper/index.js.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.js.map +1 -1
- package/lib/make-installer.d.ts +1 -2
- package/lib/make-installer.js +4 -18
- package/lib/make-installer.js.map +1 -1
- package/lib/utils/popup-manager.d.ts +5 -3
- package/lib/utils/popup-manager.js +21 -25
- package/lib/utils/popup-manager.js.map +1 -1
- package/lib/utils/util.d.ts +1 -8
- package/lib/utils/util.js +5 -13
- package/lib/utils/util.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/theme-chalk/el-button.css +1 -1
- package/theme-chalk/el-cascader-panel.css +1 -1
- package/theme-chalk/el-checkbox-button.css +1 -1
- package/theme-chalk/el-descriptions-item.css +1 -1
- package/theme-chalk/el-descriptions.css +1 -1
- package/theme-chalk/el-form.css +1 -1
- package/theme-chalk/el-input-number.css +1 -1
- package/theme-chalk/el-radio-button.css +1 -1
- package/theme-chalk/el-radio.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/cascader-panel.scss +1 -1
- package/theme-chalk/src/common/var.scss +2 -4
- package/theme-chalk/src/descriptions-item.scss +56 -2
- package/theme-chalk/src/descriptions.scss +75 -27
- package/theme-chalk/src/form.scss +2 -1
- package/theme-chalk/src/input-number.scss +13 -4
- package/theme-chalk/src/radio-button.scss +4 -4
- package/theme-chalk/src/radio.scss +1 -1
- package/web-types.json +1 -1
- package/es/components/config-provider/src/index.d.ts +0 -19
- package/es/components/config-provider/src/index.mjs +0 -22
- package/es/components/config-provider/src/index.mjs.map +0 -1
- package/es/utils/config.d.ts +0 -9
- package/es/utils/config.mjs +0 -10
- package/es/utils/config.mjs.map +0 -1
- package/lib/components/config-provider/src/index.d.ts +0 -19
- package/lib/components/config-provider/src/index.js +0 -26
- package/lib/components/config-provider/src/index.js.map +0 -1
- package/lib/utils/config.d.ts +0 -9
- package/lib/utils/config.js +0 -15
- package/lib/utils/config.js.map +0 -1
|
@@ -67,7 +67,7 @@ declare const _TimePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
67
67
|
default: () => {};
|
|
68
68
|
};
|
|
69
69
|
modelValue: {
|
|
70
|
-
type: import("vue").PropType<string | Date | (number | Date)[]>;
|
|
70
|
+
type: import("vue").PropType<string | number | Date | (string | number | Date)[]>;
|
|
71
71
|
default: string;
|
|
72
72
|
};
|
|
73
73
|
rangeSeparator: {
|
|
@@ -148,7 +148,7 @@ declare const _TimePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
148
148
|
type: string;
|
|
149
149
|
disabled: boolean;
|
|
150
150
|
name: string | unknown[];
|
|
151
|
-
modelValue: string | Date | (number | Date)[];
|
|
151
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
152
152
|
editable: boolean;
|
|
153
153
|
popperClass: string;
|
|
154
154
|
popperOptions: Partial<import("@popperjs/core").Options>;
|
|
@@ -183,7 +183,7 @@ declare const _TimePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
183
183
|
type: string;
|
|
184
184
|
disabled: boolean;
|
|
185
185
|
name: string | unknown[];
|
|
186
|
-
modelValue: string | Date | (number | Date)[];
|
|
186
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
187
187
|
editable: boolean;
|
|
188
188
|
popperClass: string;
|
|
189
189
|
popperOptions: Partial<import("@popperjs/core").Options>;
|
|
@@ -264,7 +264,7 @@ export declare const ElTimePicker: SFCWithInstall<import("vue").DefineComponent<
|
|
|
264
264
|
default: () => {};
|
|
265
265
|
};
|
|
266
266
|
modelValue: {
|
|
267
|
-
type: import("vue").PropType<string | Date | (number | Date)[]>;
|
|
267
|
+
type: import("vue").PropType<string | number | Date | (string | number | Date)[]>;
|
|
268
268
|
default: string;
|
|
269
269
|
};
|
|
270
270
|
rangeSeparator: {
|
|
@@ -345,7 +345,7 @@ export declare const ElTimePicker: SFCWithInstall<import("vue").DefineComponent<
|
|
|
345
345
|
type: string;
|
|
346
346
|
disabled: boolean;
|
|
347
347
|
name: string | unknown[];
|
|
348
|
-
modelValue: string | Date | (number | Date)[];
|
|
348
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
349
349
|
editable: boolean;
|
|
350
350
|
popperClass: string;
|
|
351
351
|
popperOptions: Partial<import("@popperjs/core").Options>;
|
|
@@ -380,7 +380,7 @@ export declare const ElTimePicker: SFCWithInstall<import("vue").DefineComponent<
|
|
|
380
380
|
type: string;
|
|
381
381
|
disabled: boolean;
|
|
382
382
|
name: string | unknown[];
|
|
383
|
-
modelValue: string | Date | (number | Date)[];
|
|
383
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
384
384
|
editable: boolean;
|
|
385
385
|
popperClass: string;
|
|
386
386
|
popperOptions: Partial<import("@popperjs/core").Options>;
|
|
@@ -71,7 +71,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
71
71
|
default: () => {};
|
|
72
72
|
};
|
|
73
73
|
modelValue: {
|
|
74
|
-
type: import("vue").PropType<string | Date | (number | Date)[]>;
|
|
74
|
+
type: import("vue").PropType<string | number | Date | (string | number | Date)[]>;
|
|
75
75
|
default: string;
|
|
76
76
|
};
|
|
77
77
|
rangeSeparator: {
|
|
@@ -131,7 +131,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
131
131
|
handleKeydown: (event: any) => void;
|
|
132
132
|
popperPaneRef: import("vue").ComputedRef<any>;
|
|
133
133
|
onClickOutside: () => void;
|
|
134
|
-
pickerSize: import("vue").ComputedRef<
|
|
134
|
+
pickerSize: import("vue").ComputedRef<import("../../../../utils/types").ComponentSize>;
|
|
135
135
|
isRangeInput: import("vue").ComputedRef<boolean>;
|
|
136
136
|
onMouseLeave: () => void;
|
|
137
137
|
onMouseEnter: () => void;
|
|
@@ -187,7 +187,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
187
187
|
type: string;
|
|
188
188
|
disabled: boolean;
|
|
189
189
|
name: string | unknown[];
|
|
190
|
-
modelValue: string | Date | (number | Date)[];
|
|
190
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
191
191
|
editable: boolean;
|
|
192
192
|
popperClass: string;
|
|
193
193
|
popperOptions: Partial<Options>;
|
|
@@ -226,7 +226,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
226
226
|
type: string;
|
|
227
227
|
disabled: boolean;
|
|
228
228
|
name: string | unknown[];
|
|
229
|
-
modelValue: string | Date | (number | Date)[];
|
|
229
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
230
230
|
editable: boolean;
|
|
231
231
|
popperClass: string;
|
|
232
232
|
popperOptions: Partial<Options>;
|
|
@@ -60,7 +60,7 @@ export declare const timePickerDefaultProps: {
|
|
|
60
60
|
default: () => {};
|
|
61
61
|
};
|
|
62
62
|
modelValue: {
|
|
63
|
-
type: PropType<string | Date | (number | Date)[]>;
|
|
63
|
+
type: PropType<string | number | Date | (string | number | Date)[]>;
|
|
64
64
|
default: string;
|
|
65
65
|
};
|
|
66
66
|
rangeSeparator: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.mjs","sources":["../../../../../../../packages/components/time-picker/src/common/props.ts"],"sourcesContent":["import { isValidComponentSize } from '@element-plus/utils/validators'\nimport { CircleClose } from '@element-plus/icons-vue'\n\nimport type { PropType, Component } from 'vue'\nimport type { Options } from '@popperjs/core'\nimport type { ComponentSize } from '@element-plus/utils/types'\n\nexport const timePickerDefaultProps = {\n id: {\n type: [Array, String],\n },\n name: {\n type: [Array, String],\n default: '',\n },\n popperClass: {\n type: String,\n default: '',\n },\n format: {\n type: String,\n },\n valueFormat: {\n type: String as PropType<string>,\n },\n type: {\n type: String,\n default: '',\n },\n clearable: {\n type: Boolean,\n default: true,\n },\n clearIcon: {\n type: [String, Object] as PropType<string | Component>,\n default: CircleClose,\n },\n editable: {\n type: Boolean,\n default: true,\n },\n prefixIcon: {\n type: [String, Object] as PropType<string | Component>,\n default: '',\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n readonly: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n placeholder: {\n type: String,\n default: '',\n },\n popperOptions: {\n type: Object as PropType<Partial<Options>>,\n default: () => ({}),\n },\n modelValue: {\n type: [Date, Array, String] as PropType
|
|
1
|
+
{"version":3,"file":"props.mjs","sources":["../../../../../../../packages/components/time-picker/src/common/props.ts"],"sourcesContent":["import { isValidComponentSize } from '@element-plus/utils/validators'\nimport { CircleClose } from '@element-plus/icons-vue'\n\nimport type { PropType, Component } from 'vue'\nimport type { Options } from '@popperjs/core'\nimport type { ComponentSize } from '@element-plus/utils/types'\n\nexport const timePickerDefaultProps = {\n id: {\n type: [Array, String],\n },\n name: {\n type: [Array, String],\n default: '',\n },\n popperClass: {\n type: String,\n default: '',\n },\n format: {\n type: String,\n },\n valueFormat: {\n type: String as PropType<string>,\n },\n type: {\n type: String,\n default: '',\n },\n clearable: {\n type: Boolean,\n default: true,\n },\n clearIcon: {\n type: [String, Object] as PropType<string | Component>,\n default: CircleClose,\n },\n editable: {\n type: Boolean,\n default: true,\n },\n prefixIcon: {\n type: [String, Object] as PropType<string | Component>,\n default: '',\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n readonly: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n placeholder: {\n type: String,\n default: '',\n },\n popperOptions: {\n type: Object as PropType<Partial<Options>>,\n default: () => ({}),\n },\n modelValue: {\n type: [Date, Array, String, Number] as PropType<\n number | string | Date | (number | string | Date)[]\n >,\n default: '',\n },\n rangeSeparator: {\n type: String,\n default: '-',\n },\n startPlaceholder: String,\n endPlaceholder: String,\n defaultValue: {\n type: [Date, Array] as PropType<Date | Date[]>,\n },\n defaultTime: {\n type: [Date, Array] as PropType<Date | Date[]>,\n },\n isRange: {\n type: Boolean,\n default: false,\n },\n disabledHours: {\n type: Function,\n },\n disabledMinutes: {\n type: Function,\n },\n disabledSeconds: {\n type: Function,\n },\n disabledDate: {\n type: Function,\n },\n cellClassName: {\n type: Function,\n },\n shortcuts: {\n type: Array,\n default: () => [],\n },\n arrowControl: {\n type: Boolean,\n default: false,\n },\n validateEvent: {\n type: Boolean,\n default: true,\n },\n unlinkPanels: Boolean,\n}\n"],"names":[],"mappings":";;;AAEY,MAAC,sBAAsB,GAAG;AACtC,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACzB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,WAAW;AACxB,GAAG;AACH,EAAE,QA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AO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,KAAK;AACf,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,YAAY,EAAE,OAAO;AACvB;;;;"}
|
|
@@ -61,7 +61,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
61
61
|
default: () => {};
|
|
62
62
|
};
|
|
63
63
|
modelValue: {
|
|
64
|
-
type: import("vue").PropType<string | Date | (number | Date)[]>;
|
|
64
|
+
type: import("vue").PropType<string | number | Date | (string | number | Date)[]>;
|
|
65
65
|
default: string;
|
|
66
66
|
};
|
|
67
67
|
rangeSeparator: {
|
|
@@ -142,7 +142,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
142
142
|
type: string;
|
|
143
143
|
disabled: boolean;
|
|
144
144
|
name: string | unknown[];
|
|
145
|
-
modelValue: string | Date | (number | Date)[];
|
|
145
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
146
146
|
editable: boolean;
|
|
147
147
|
popperClass: string;
|
|
148
148
|
popperOptions: Partial<import("@popperjs/core").Options>;
|
|
@@ -177,7 +177,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
177
177
|
type: string;
|
|
178
178
|
disabled: boolean;
|
|
179
179
|
name: string | unknown[];
|
|
180
|
-
modelValue: string | Date | (number | Date)[];
|
|
180
|
+
modelValue: string | number | Date | (string | number | Date)[];
|
|
181
181
|
editable: boolean;
|
|
182
182
|
popperClass: string;
|
|
183
183
|
popperOptions: Partial<import("@popperjs/core").Options>;
|
package/es/defaults.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentSize } from 'element-plus/es/utils/types';
|
|
2
2
|
import type { MaybeRef } from '@vueuse/core';
|
|
3
3
|
export declare const useSizeProp: import("element-plus/es/utils/props").BuildPropReturn<StringConstructor, "", false, "" | "small" | "default" | "large", never>;
|
|
4
|
-
export declare const useSize: (fallback?: MaybeRef<ComponentSize |
|
|
4
|
+
export declare const useSize: (fallback?: MaybeRef<ComponentSize | undefined>, ignore?: Partial<Record<'prop' | 'form' | 'formItem' | 'global', boolean>>) => import("vue").ComputedRef<ComponentSize>;
|
|
5
5
|
export declare const useDisabled: (fallback?: MaybeRef<boolean | undefined>) => import("vue").ComputedRef<boolean>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ref, inject, computed, unref } from 'vue';
|
|
2
|
-
import { useGlobalConfig as useGlobalConfig$1 } from '../../utils/util.mjs';
|
|
3
2
|
import '../../tokens/index.mjs';
|
|
4
3
|
import { buildProp, componentSize } from '../../utils/props.mjs';
|
|
5
4
|
import { useProp } from '../use-prop/index.mjs';
|
|
@@ -15,10 +14,9 @@ const useSize = (fallback, ignore = {}) => {
|
|
|
15
14
|
const emptyRef = ref(void 0);
|
|
16
15
|
const size = ignore.prop ? emptyRef : useProp("size");
|
|
17
16
|
const globalConfig = ignore.global ? emptyRef : useGlobalConfig("size");
|
|
18
|
-
const globalConfigLegacy = ignore.global ? { size: void 0 } : useGlobalConfig$1();
|
|
19
17
|
const form = ignore.form ? { size: void 0 } : inject(elFormKey, void 0);
|
|
20
18
|
const formItem = ignore.formItem ? { size: void 0 } : inject(elFormItemKey, void 0);
|
|
21
|
-
return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value ||
|
|
19
|
+
return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value || "default");
|
|
22
20
|
};
|
|
23
21
|
const useDisabled = (fallback) => {
|
|
24
22
|
const disabled = useProp("disabled");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-common-props/index.ts"],"sourcesContent":["import { ref, unref, inject, computed } from 'vue'\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-common-props/index.ts"],"sourcesContent":["import { ref, unref, inject, computed } from 'vue'\nimport { elFormItemKey, elFormKey } from '@element-plus/tokens'\nimport { buildProp, componentSize } from '@element-plus/utils/props'\nimport { useProp } from '../use-prop'\nimport { useGlobalConfig } from '../use-global-config'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type { MaybeRef } from '@vueuse/core'\n\nexport const useSizeProp = buildProp({\n type: String,\n values: ['', ...componentSize],\n default: '',\n} as const)\n\nexport const useSize = (\n fallback?: MaybeRef<ComponentSize | undefined>,\n ignore: Partial<Record<'prop' | 'form' | 'formItem' | 'global', boolean>> = {}\n) => {\n const emptyRef = ref(undefined)\n\n const size = ignore.prop ? emptyRef : useProp<ComponentSize>('size')\n const globalConfig = ignore.global ? emptyRef : useGlobalConfig('size')\n const form = ignore.form ? { size: undefined } : inject(elFormKey, undefined)\n const formItem = ignore.formItem\n ? { size: undefined }\n : inject(elFormItemKey, undefined)\n\n return computed(\n (): ComponentSize =>\n size.value ||\n unref(fallback) ||\n formItem?.size ||\n form?.size ||\n globalConfig.value ||\n 'default'\n )\n}\n\nexport const useDisabled = (fallback?: MaybeRef<boolean | undefined>) => {\n const disabled = useProp<boolean>('disabled')\n const form = inject(elFormKey, undefined)\n return computed(\n () => disabled.value || unref(fallback) || form?.disabled || false\n )\n}\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,WAAW,GAAG,SAAS,CAAC;AACrC,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,aAAa,CAAC;AAChC,EAAE,OAAO,EAAE,EAAE;AACb,CAAC,EAAE;AACS,MAAC,OAAO,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,KAAK;AAClD,EAAE,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/B,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACxD,EAAE,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAC1E,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;AAC1E,EAAE,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;AACtF,EAAE,OAAO,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;AAChL,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,QAAQ,KAAK;AACzC,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACvC,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;AACzC,EAAE,OAAO,QAAQ,CAAC,MAAM,QAAQ,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC;AAC/G;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { inject, toRef } from 'vue';
|
|
1
|
+
import { inject, toRef, ref } from 'vue';
|
|
2
2
|
import '../../tokens/index.mjs';
|
|
3
|
+
import '../../utils/util.mjs';
|
|
3
4
|
import { configProviderContextKey } from '../../tokens/config-provider.mjs';
|
|
5
|
+
import { isObject, hasOwn } from '@vue/shared';
|
|
4
6
|
|
|
5
7
|
function useGlobalConfig(key) {
|
|
6
8
|
const config = inject(configProviderContextKey, {});
|
|
7
9
|
if (key) {
|
|
8
|
-
return toRef(config, key);
|
|
10
|
+
return isObject(config) && hasOwn(config, key) ? toRef(config, key) : ref(void 0);
|
|
9
11
|
} else {
|
|
10
12
|
return config;
|
|
11
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-global-config/index.ts"],"sourcesContent":["import { inject, toRef } from 'vue'\nimport { configProviderContextKey } from '@element-plus/tokens'\nimport type { Ref } from 'vue'\nimport type { ConfigProviderContext } from '@element-plus/tokens'\n\nexport function useGlobalConfig<K extends keyof ConfigProviderContext>(\n key: K\n): Ref<ConfigProviderContext[K]>\nexport function useGlobalConfig(): ConfigProviderContext\nexport function useGlobalConfig(key?: keyof ConfigProviderContext) {\n const config = inject(configProviderContextKey, {})\n if (key) {\n return toRef(config, key)\n } else {\n return config\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-global-config/index.ts"],"sourcesContent":["import { inject, ref, toRef } from 'vue'\nimport { configProviderContextKey } from '@element-plus/tokens'\nimport { hasOwn, isObject } from '@element-plus/utils/util'\nimport type { Ref } from 'vue'\nimport type { ConfigProviderContext } from '@element-plus/tokens'\n\nexport function useGlobalConfig<K extends keyof ConfigProviderContext>(\n key: K\n): Ref<ConfigProviderContext[K]>\nexport function useGlobalConfig(): ConfigProviderContext\nexport function useGlobalConfig(key?: keyof ConfigProviderContext) {\n const config = inject(configProviderContextKey, {})\n if (key) {\n return isObject(config) && hasOwn(config, key)\n ? toRef(config, key)\n : ref(undefined)\n } else {\n return config\n }\n}\n"],"names":[],"mappings":";;;;;;AAGO,SAAS,eAAe,CAAC,GAAG,EAAE;AACrC,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;AACtD,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,GAAG,MAAM;AACT,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH;;;;"}
|
|
@@ -5,7 +5,7 @@ import '../../directives/index.mjs';
|
|
|
5
5
|
import { generateId, isHTMLElement, refAttacher } from '../../utils/util.mjs';
|
|
6
6
|
import { getFirstValidNode } from '../../utils/vnode.mjs';
|
|
7
7
|
import { stop } from '../../utils/dom.mjs';
|
|
8
|
-
import PopupManager from '../../utils/popup-manager.mjs';
|
|
8
|
+
import { PopupManager } from '../../utils/popup-manager.mjs';
|
|
9
9
|
import { throwError } from '../../utils/error.mjs';
|
|
10
10
|
import { useTeleport } from '../use-teleport/index.mjs';
|
|
11
11
|
import { useTimeout } from '../use-timeout/index.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-popper/index.ts"],"sourcesContent":["import {\n cloneVNode,\n computed,\n Fragment,\n getCurrentInstance,\n h,\n nextTick,\n toDisplayString,\n toRef,\n Transition,\n ref,\n renderSlot,\n withDirectives,\n} from 'vue'\nimport { NOOP } from '@vue/shared'\nimport { createPopper } from '@popperjs/core'\nimport { ClickOutside } from '@element-plus/directives'\nimport {\n generateId,\n isHTMLElement,\n isString,\n refAttacher,\n} from '@element-plus/utils/util'\nimport { getFirstValidNode } from '@element-plus/utils/vnode'\nimport { stop } from '@element-plus/utils/dom'\nimport PopupManager from '@element-plus/utils/popup-manager'\nimport { throwError } from '@element-plus/utils/error'\n\nimport { useTeleport } from '../use-teleport'\nimport { useTimeout } from '../use-timeout'\nimport { useModelToggle } from '../use-model-toggle'\nimport { useTransitionFallthrough } from '../use-transition-fallthrough'\nimport { defaultPopperOptions, defaultModifiers } from './use-popper-options'\nimport { useTargetEvents, DEFAULT_TRIGGER } from './use-target-events'\n\nimport type {\n CSSProperties,\n ComponentPublicInstance,\n ExtractPropTypes,\n PropType,\n} from 'vue'\nimport type {\n Instance as PopperInstance,\n StrictModifiers,\n} from '@popperjs/core'\nimport type { RefElement, Nullable } from '@element-plus/utils/types'\nimport type { Trigger } from './use-target-events'\n\nexport type PopperEffect = 'light' | 'dark'\nexport type Offset = [number, number] | number\n\ntype ElementType = ComponentPublicInstance | HTMLElement\n\nexport const DARK_EFFECT = 'dark'\nexport const LIGHT_EFFECT = 'light'\n\nexport const usePopperControlProps = {\n appendToBody: {\n type: Boolean,\n default: true,\n },\n arrowOffset: {\n type: Number,\n },\n popperOptions: defaultPopperOptions,\n popperClass: {\n type: String,\n default: '',\n },\n}\n\nexport const usePopperProps = {\n ...usePopperControlProps,\n // the arrow size is an equailateral triangle with 10px side length, the 3rd side length ~ 14.1px\n // adding a offset to the ceil of 4.1 should be 5 this resolves the problem of arrow overflowing out of popper.\n autoClose: {\n type: Number,\n default: 0,\n },\n content: {\n type: String,\n default: '',\n },\n class: String,\n style: Object,\n hideAfter: {\n type: Number,\n default: 200,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n effect: {\n type: String as PropType<PopperEffect>,\n default: DARK_EFFECT,\n },\n enterable: {\n type: Boolean,\n default: true,\n },\n manualMode: {\n type: Boolean,\n default: false,\n },\n showAfter: {\n type: Number,\n default: 0,\n },\n pure: {\n type: Boolean,\n default: false,\n },\n showArrow: {\n type: Boolean,\n default: true,\n },\n transition: {\n type: String,\n default: 'el-fade-in-linear',\n },\n trigger: {\n type: [String, Array] as PropType<Trigger>,\n default: DEFAULT_TRIGGER,\n },\n visible: {\n type: Boolean,\n default: undefined,\n },\n stopPopperMouseEvent: {\n type: Boolean,\n default: true,\n },\n}\n\nexport const usePopperHook = () => {\n const vm = getCurrentInstance()!\n const props: ExtractPropTypes<typeof usePopperProps> = vm.proxy?.$props as any\n const { slots } = vm\n\n const arrowRef = ref<RefElement>(null)\n const triggerRef = ref<ElementType>(null)\n const popperRef = ref<RefElement>(null)\n\n const popperStyle = ref<CSSProperties>({ zIndex: PopupManager.nextZIndex() })\n const visible = ref(false)\n const isManual = computed(\n () => props.manualMode || props.trigger === 'manual'\n )\n\n const popperId = `el-popper-${generateId()}`\n let popperInstance: Nullable<PopperInstance> = null\n\n const { renderTeleport, showTeleport, hideTeleport } = useTeleport(\n popupRenderer,\n toRef(props, 'appendToBody')\n )\n\n const { show, hide } = useModelToggle({\n indicator: visible,\n onShow,\n onHide,\n })\n\n const { registerTimeout, cancelTimeout } = useTimeout()\n\n // event handlers\n\n function onShow() {\n popperStyle.value.zIndex = PopupManager.nextZIndex()\n nextTick(initializePopper)\n }\n\n function onHide() {\n hideTeleport()\n nextTick(detachPopper)\n }\n\n /**\n * The calling mechanism here is:\n * when the visibility gets changed, let's say we change it to true\n * the delayShow gets called which initializes a global root node for the popper content\n * to insert in, then it register a timer for calling the show method, which changes the flag to\n * true, then calls onShow method.\n * So the order of invocation is: delayedShow -> timer(show) -> set the indicator to true -> onShow\n */\n\n function delayShow() {\n if (isManual.value || props.disabled) return\n // renders out the teleport element root.\n showTeleport()\n registerTimeout(show, props.showAfter)\n }\n\n function delayHide() {\n if (isManual.value) return\n registerTimeout(hide, props.hideAfter)\n }\n\n function onToggle() {\n if (visible.value) {\n delayShow()\n } else {\n delayHide()\n }\n }\n\n function detachPopper() {\n popperInstance?.destroy?.()\n popperInstance = null\n }\n\n function onPopperMouseEnter() {\n // if trigger is click, user won't be able to close popper when\n // user tries to move the mouse over popper contents\n if (props.enterable && props.trigger !== 'click') {\n cancelTimeout()\n }\n }\n\n function onPopperMouseLeave() {\n const { trigger } = props\n const shouldPrevent =\n (isString(trigger) && (trigger === 'click' || trigger === 'focus')) ||\n // we'd like to test array type trigger here, but the only case we need to cover is trigger === 'click' or\n // trigger === 'focus', because that when trigger is string\n // trigger.length === 1 and trigger[0] === 5 chars string is mutually exclusive.\n // so there will be no need to test if trigger is array type.\n (trigger.length === 1 &&\n (trigger[0] === 'click' || trigger[0] === 'focus'))\n if (shouldPrevent) return\n delayHide()\n }\n\n function initializePopper() {\n if (!visible.value || popperInstance !== null) {\n return\n }\n const unwrappedTrigger = triggerRef.value\n const $el = isHTMLElement(unwrappedTrigger)\n ? unwrappedTrigger\n : (unwrappedTrigger as ComponentPublicInstance).$el\n\n popperInstance = createPopper($el, popperRef.value, buildPopperOptions())\n popperInstance.update()\n }\n\n function buildPopperOptions() {\n const modifiers = [...defaultModifiers, ...props.popperOptions.modifiers]\n\n if (props.showArrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n padding: props.arrowOffset || 5,\n element: arrowRef.value,\n },\n } as StrictModifiers)\n }\n\n return {\n ...props.popperOptions,\n modifiers,\n }\n }\n\n const { onAfterEnter, onAfterLeave, onBeforeEnter, onBeforeLeave } =\n useTransitionFallthrough()\n\n const events = useTargetEvents(delayShow, delayHide, onToggle)\n\n const arrowRefAttacher = refAttacher(arrowRef)\n const popperRefAttacher = refAttacher(popperRef)\n const triggerRefAttacher = refAttacher(triggerRef)\n\n // renderers\n function popupRenderer() {\n const mouseUpAndDown = props.stopPopperMouseEvent ? stop : NOOP\n return h(\n Transition as any,\n {\n name: props.transition,\n onAfterEnter,\n onAfterLeave,\n onBeforeEnter,\n onBeforeLeave,\n },\n {\n default: () => () =>\n visible.value\n ? h(\n 'div',\n {\n 'aria-hidden': false,\n class: [\n props.popperClass,\n 'el-popper',\n `is-${props.effect}`,\n props.pure ? 'is-pure' : '',\n ],\n style: popperStyle.value,\n id: popperId,\n ref: popperRefAttacher,\n role: 'tooltip',\n onMouseenter: onPopperMouseEnter,\n onMouseleave: onPopperMouseLeave,\n onClick: stop,\n onMousedown: mouseUpAndDown,\n onMouseup: mouseUpAndDown,\n },\n [\n renderSlot(slots, 'default', {}, () => [\n toDisplayString(props.content),\n ]),\n arrowRenderer(),\n ]\n )\n : null,\n }\n )\n }\n\n function arrowRenderer() {\n return props.showArrow\n ? h(\n 'div',\n {\n ref: arrowRefAttacher,\n class: 'el-popper__arrow',\n 'data-popper-arrow': '',\n },\n null\n )\n : null\n }\n\n function triggerRenderer(triggerProps) {\n const trigger = slots.trigger?.()\n const firstElement = getFirstValidNode(trigger, 1)\n if (!firstElement)\n throwError('renderTrigger', 'trigger expects single rooted node')\n return cloneVNode(firstElement, triggerProps, true)\n }\n\n function render() {\n const trigger = triggerRenderer({\n 'aria-describedby': popperId,\n class: props.class,\n style: props.style,\n ref: triggerRefAttacher,\n ...events,\n })\n return h(Fragment, null, [\n isManual.value\n ? trigger\n : withDirectives(trigger, [[ClickOutside, delayHide]]),\n renderTeleport(),\n ])\n }\n\n return {\n render,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAiCY,MAAC,WAAW,GAAG,OAAO;AACtB,MAAC,YAAY,GAAG,QAAQ;AACxB,MAAC,qBAAqB,GAAG;AACrC,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB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AAS,eAAe,CAAC,YAAY,EAAE;AACzC,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,MAAM,OAAO,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7E,IAAI,MAAM,YAAY,GAAG,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACvD,IAAI,IAAI,CAAC,YAAY;AACrB,MAAM,UAAU,CAAC,eAAe,EAAE,oCAAoC,CAAC,CAAC;AACxE,IAAI,OAAO,UAAU,CAAC,YAAY,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;AACxD,GAAG;AACH,EAAE,SAAS,MAAM,GAAG;AACpB,IAAI,MAAM,OAAO,GAAG,eAAe,CAAC;AACpC,MAAM,kBAAkB,EAAE,QAAQ;AAClC,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK;AACxB,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK;AACxB,MAAM,GAAG,EAAE,kBAAkB;AAC7B,MAAM,GAAG,MAAM;AACf,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE;AAC7B,MAAM,QAAQ,CAAC,KAAK,GAAG,OAAO,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;AACrF,MAAM,cAAc,EAAE;AACtB,KAAK,CAAC,CAAC;AACP,GAAG;AACH,EAAE,OAAO;AACT,IAAI,MAAM;AACV,GAAG,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-popper/index.ts"],"sourcesContent":["import {\n cloneVNode,\n computed,\n Fragment,\n getCurrentInstance,\n h,\n nextTick,\n toDisplayString,\n toRef,\n Transition,\n ref,\n renderSlot,\n withDirectives,\n} from 'vue'\nimport { NOOP } from '@vue/shared'\nimport { createPopper } from '@popperjs/core'\nimport { ClickOutside } from '@element-plus/directives'\nimport {\n generateId,\n isHTMLElement,\n isString,\n refAttacher,\n} from '@element-plus/utils/util'\nimport { getFirstValidNode } from '@element-plus/utils/vnode'\nimport { stop } from '@element-plus/utils/dom'\nimport { PopupManager } from '@element-plus/utils/popup-manager'\nimport { throwError } from '@element-plus/utils/error'\n\nimport { useTeleport } from '../use-teleport'\nimport { useTimeout } from '../use-timeout'\nimport { useModelToggle } from '../use-model-toggle'\nimport { useTransitionFallthrough } from '../use-transition-fallthrough'\nimport { defaultPopperOptions, defaultModifiers } from './use-popper-options'\nimport { useTargetEvents, DEFAULT_TRIGGER } from './use-target-events'\n\nimport type {\n CSSProperties,\n ComponentPublicInstance,\n ExtractPropTypes,\n PropType,\n} from 'vue'\nimport type {\n Instance as PopperInstance,\n StrictModifiers,\n} from '@popperjs/core'\nimport type { RefElement, Nullable } from '@element-plus/utils/types'\nimport type { Trigger } from './use-target-events'\n\nexport type PopperEffect = 'light' | 'dark'\nexport type Offset = [number, number] | number\n\ntype ElementType = ComponentPublicInstance | HTMLElement\n\nexport const DARK_EFFECT = 'dark'\nexport const LIGHT_EFFECT = 'light'\n\nexport const usePopperControlProps = {\n appendToBody: {\n type: Boolean,\n default: true,\n },\n arrowOffset: {\n type: Number,\n },\n popperOptions: defaultPopperOptions,\n popperClass: {\n type: String,\n default: '',\n },\n}\n\nexport const usePopperProps = {\n ...usePopperControlProps,\n // the arrow size is an equailateral triangle with 10px side length, the 3rd side length ~ 14.1px\n // adding a offset to the ceil of 4.1 should be 5 this resolves the problem of arrow overflowing out of popper.\n autoClose: {\n type: Number,\n default: 0,\n },\n content: {\n type: String,\n default: '',\n },\n class: String,\n style: Object,\n hideAfter: {\n type: Number,\n default: 200,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n effect: {\n type: String as PropType<PopperEffect>,\n default: DARK_EFFECT,\n },\n enterable: {\n type: Boolean,\n default: true,\n },\n manualMode: {\n type: Boolean,\n default: false,\n },\n showAfter: {\n type: Number,\n default: 0,\n },\n pure: {\n type: Boolean,\n default: false,\n },\n showArrow: {\n type: Boolean,\n default: true,\n },\n transition: {\n type: String,\n default: 'el-fade-in-linear',\n },\n trigger: {\n type: [String, Array] as PropType<Trigger>,\n default: DEFAULT_TRIGGER,\n },\n visible: {\n type: Boolean,\n default: undefined,\n },\n stopPopperMouseEvent: {\n type: Boolean,\n default: true,\n },\n}\n\nexport const usePopperHook = () => {\n const vm = getCurrentInstance()!\n const props: ExtractPropTypes<typeof usePopperProps> = vm.proxy?.$props as any\n const { slots } = vm\n\n const arrowRef = ref<RefElement>(null)\n const triggerRef = ref<ElementType>(null)\n const popperRef = ref<RefElement>(null)\n\n const popperStyle = ref<CSSProperties>({ zIndex: PopupManager.nextZIndex() })\n const visible = ref(false)\n const isManual = computed(\n () => props.manualMode || props.trigger === 'manual'\n )\n\n const popperId = `el-popper-${generateId()}`\n let popperInstance: Nullable<PopperInstance> = null\n\n const { renderTeleport, showTeleport, hideTeleport } = useTeleport(\n popupRenderer,\n toRef(props, 'appendToBody')\n )\n\n const { show, hide } = useModelToggle({\n indicator: visible,\n onShow,\n onHide,\n })\n\n const { registerTimeout, cancelTimeout } = useTimeout()\n\n // event handlers\n\n function onShow() {\n popperStyle.value.zIndex = PopupManager.nextZIndex()\n nextTick(initializePopper)\n }\n\n function onHide() {\n hideTeleport()\n nextTick(detachPopper)\n }\n\n /**\n * The calling mechanism here is:\n * when the visibility gets changed, let's say we change it to true\n * the delayShow gets called which initializes a global root node for the popper content\n * to insert in, then it register a timer for calling the show method, which changes the flag to\n * true, then calls onShow method.\n * So the order of invocation is: delayedShow -> timer(show) -> set the indicator to true -> onShow\n */\n\n function delayShow() {\n if (isManual.value || props.disabled) return\n // renders out the teleport element root.\n showTeleport()\n registerTimeout(show, props.showAfter)\n }\n\n function delayHide() {\n if (isManual.value) return\n registerTimeout(hide, props.hideAfter)\n }\n\n function onToggle() {\n if (visible.value) {\n delayShow()\n } else {\n delayHide()\n }\n }\n\n function detachPopper() {\n popperInstance?.destroy?.()\n popperInstance = null\n }\n\n function onPopperMouseEnter() {\n // if trigger is click, user won't be able to close popper when\n // user tries to move the mouse over popper contents\n if (props.enterable && props.trigger !== 'click') {\n cancelTimeout()\n }\n }\n\n function onPopperMouseLeave() {\n const { trigger } = props\n const shouldPrevent =\n (isString(trigger) && (trigger === 'click' || trigger === 'focus')) ||\n // we'd like to test array type trigger here, but the only case we need to cover is trigger === 'click' or\n // trigger === 'focus', because that when trigger is string\n // trigger.length === 1 and trigger[0] === 5 chars string is mutually exclusive.\n // so there will be no need to test if trigger is array type.\n (trigger.length === 1 &&\n (trigger[0] === 'click' || trigger[0] === 'focus'))\n if (shouldPrevent) return\n delayHide()\n }\n\n function initializePopper() {\n if (!visible.value || popperInstance !== null) {\n return\n }\n const unwrappedTrigger = triggerRef.value\n const $el = isHTMLElement(unwrappedTrigger)\n ? unwrappedTrigger\n : (unwrappedTrigger as ComponentPublicInstance).$el\n\n popperInstance = createPopper($el, popperRef.value, buildPopperOptions())\n popperInstance.update()\n }\n\n function buildPopperOptions() {\n const modifiers = [...defaultModifiers, ...props.popperOptions.modifiers]\n\n if (props.showArrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n padding: props.arrowOffset || 5,\n element: arrowRef.value,\n },\n } as StrictModifiers)\n }\n\n return {\n ...props.popperOptions,\n modifiers,\n }\n }\n\n const { onAfterEnter, onAfterLeave, onBeforeEnter, onBeforeLeave } =\n useTransitionFallthrough()\n\n const events = useTargetEvents(delayShow, delayHide, onToggle)\n\n const arrowRefAttacher = refAttacher(arrowRef)\n const popperRefAttacher = refAttacher(popperRef)\n const triggerRefAttacher = refAttacher(triggerRef)\n\n // renderers\n function popupRenderer() {\n const mouseUpAndDown = props.stopPopperMouseEvent ? stop : NOOP\n return h(\n Transition as any,\n {\n name: props.transition,\n onAfterEnter,\n onAfterLeave,\n onBeforeEnter,\n onBeforeLeave,\n },\n {\n default: () => () =>\n visible.value\n ? h(\n 'div',\n {\n 'aria-hidden': false,\n class: [\n props.popperClass,\n 'el-popper',\n `is-${props.effect}`,\n props.pure ? 'is-pure' : '',\n ],\n style: popperStyle.value,\n id: popperId,\n ref: popperRefAttacher,\n role: 'tooltip',\n onMouseenter: onPopperMouseEnter,\n onMouseleave: onPopperMouseLeave,\n onClick: stop,\n onMousedown: mouseUpAndDown,\n onMouseup: mouseUpAndDown,\n },\n [\n renderSlot(slots, 'default', {}, () => [\n toDisplayString(props.content),\n ]),\n arrowRenderer(),\n ]\n )\n : null,\n }\n )\n }\n\n function arrowRenderer() {\n return props.showArrow\n ? h(\n 'div',\n {\n ref: arrowRefAttacher,\n class: 'el-popper__arrow',\n 'data-popper-arrow': '',\n },\n null\n )\n : null\n }\n\n function triggerRenderer(triggerProps) {\n const trigger = slots.trigger?.()\n const firstElement = getFirstValidNode(trigger, 1)\n if (!firstElement)\n throwError('renderTrigger', 'trigger expects single rooted node')\n return cloneVNode(firstElement, triggerProps, true)\n }\n\n function render() {\n const trigger = triggerRenderer({\n 'aria-describedby': popperId,\n class: props.class,\n style: props.style,\n ref: triggerRefAttacher,\n ...events,\n })\n return h(Fragment, null, [\n isManual.value\n ? trigger\n : withDirectives(trigger, [[ClickOutside, delayHide]]),\n renderTeleport(),\n ])\n }\n\n return {\n render,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAiCY,MAAC,WAAW,GAAG,OAAO;AACtB,MAAC,YAAY,GAAG,QAAQ;AACxB,MAAC,qBAAqB,GAAG;AACrC,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,aAAa,EAAE,oBAAoB;AACrC,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;A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,GAAG,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACvD,IAAI,IAAI,CAAC,YAAY;AACrB,MAAM,UAAU,CAAC,eAAe,EAAE,oCAAoC,CAAC,CAAC;AACxE,IAAI,OAAO,UAAU,CAAC,YAAY,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;AACxD,GAAG;AACH,EAAE,SAAS,MAAM,GAAG;AACpB,IAAI,MAAM,OAAO,GAAG,eAAe,CAAC;AACpC,MAAM,kBAAkB,EAAE,QAAQ;AAClC,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK;AACxB,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK;AACxB,MAAM,GAAG,EAAE,kBAAkB;AAC7B,MAAM,GAAG,MAAM;AACf,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE;AAC7B,MAAM,QAAQ,CAAC,KAAK,GAAG,OAAO,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;AACrF,MAAM,cAAc,EAAE;AACtB,KAAK,CAAC,CAAC;AACP,GAAG;AACH,EAAE,OAAO;AACT,IAAI,MAAM;AACV,GAAG,CAAC;AACJ;;;;"}
|
package/es/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import installer from './defaults';
|
|
1
2
|
export * from 'element-plus/es/components';
|
|
2
3
|
export * from 'element-plus/es/directives';
|
|
3
4
|
export * from 'element-plus/es/hooks';
|
|
4
5
|
export * from 'element-plus/es/tokens';
|
|
5
6
|
export { makeInstaller } from './make-installer';
|
|
6
|
-
export
|
|
7
|
-
export declare const install: (app: import("vue").App<any>, opts: import("./utils/config").InstallOptions) => void;
|
|
7
|
+
export declare const install: (app: import("vue").App<any>) => void;
|
|
8
8
|
export declare const version: string;
|
|
9
|
+
export default installer;
|
package/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
|
package/es/make-installer.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { App, Plugin } from 'vue';
|
|
2
|
-
import type { InstallOptions } from 'element-plus/es/utils/config';
|
|
3
2
|
export declare const makeInstaller: (components?: Plugin[]) => {
|
|
4
3
|
version: string;
|
|
5
|
-
install: (app: App
|
|
4
|
+
install: (app: App) => void;
|
|
6
5
|
};
|
package/es/make-installer.mjs
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import { setConfig } from './utils/config.mjs';
|
|
2
|
-
import './hooks/index.mjs';
|
|
3
1
|
import { version } from './version.mjs';
|
|
4
|
-
import { localeProviderMaker, localeContextKey } from './hooks/use-locale/index.mjs';
|
|
5
2
|
|
|
3
|
+
const INSTALLED_KEY = Symbol("INSTALLED_KEY");
|
|
6
4
|
const makeInstaller = (components = []) => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const defaultInstallOpt = {
|
|
10
|
-
size: "",
|
|
11
|
-
zIndex: 2e3
|
|
12
|
-
};
|
|
13
|
-
const option = Object.assign(defaultInstallOpt, opts);
|
|
14
|
-
if (apps.includes(app))
|
|
5
|
+
const install = (app) => {
|
|
6
|
+
if (app[INSTALLED_KEY])
|
|
15
7
|
return;
|
|
16
|
-
|
|
8
|
+
app[INSTALLED_KEY] = true;
|
|
17
9
|
components.forEach((c) => app.use(c));
|
|
18
|
-
if (option.locale) {
|
|
19
|
-
const localeProvides = localeProviderMaker(opts.locale);
|
|
20
|
-
app.provide(localeContextKey, localeProvides);
|
|
21
|
-
}
|
|
22
|
-
app.config.globalProperties.$ELEMENT = option;
|
|
23
|
-
setConfig(option);
|
|
24
10
|
};
|
|
25
11
|
return {
|
|
26
12
|
version,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-installer.mjs","sources":["../../../packages/element-plus/make-installer.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"make-installer.mjs","sources":["../../../packages/element-plus/make-installer.ts"],"sourcesContent":["import { version } from './version'\nimport type { App, Plugin } from 'vue'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nexport const makeInstaller = (components: Plugin[] = []) => {\n const install = (app: App) => {\n if (app[INSTALLED_KEY]) return\n\n app[INSTALLED_KEY] = true\n components.forEach((c) => app.use(c))\n }\n\n return {\n version,\n install,\n }\n}\n"],"names":[],"mappings":";;AACA,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAClC,MAAC,aAAa,GAAG,CAAC,UAAU,GAAG,EAAE,KAAK;AAClD,EAAE,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK;AAC3B,IAAI,IAAI,GAAG,CAAC,aAAa,CAAC;AAC1B,MAAM,OAAO;AACb,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;AAC9B,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -11,9 +11,11 @@ declare type StackFrame = {
|
|
|
11
11
|
zIndex: number;
|
|
12
12
|
modalClass: string;
|
|
13
13
|
};
|
|
14
|
-
interface
|
|
14
|
+
interface PopupManager {
|
|
15
15
|
getInstance: (id: string) => Instance;
|
|
16
16
|
zIndex: number;
|
|
17
|
+
globalInitialZIndex: number;
|
|
18
|
+
getInitialZIndex: () => number;
|
|
17
19
|
modalDom?: HTMLElement;
|
|
18
20
|
modalFade: boolean;
|
|
19
21
|
modalStack: StackFrame[];
|
|
@@ -24,5 +26,5 @@ interface IPopupManager {
|
|
|
24
26
|
openModal: (id: string, zIndex: number, dom: HTMLElement, modalClass: string, modalFade: boolean) => void;
|
|
25
27
|
closeModal: (id: string) => void;
|
|
26
28
|
}
|
|
27
|
-
declare const PopupManager:
|
|
28
|
-
export
|
|
29
|
+
export declare const PopupManager: PopupManager;
|
|
30
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { getCurrentInstance } from 'vue';
|
|
1
2
|
import { isClient } from '@vueuse/core';
|
|
2
|
-
import
|
|
3
|
+
import '../hooks/index.mjs';
|
|
3
4
|
import { on, addClass, removeClass } from './dom.mjs';
|
|
4
5
|
import { EVENT_CODE } from './aria.mjs';
|
|
6
|
+
import { useGlobalConfig } from '../hooks/use-global-config/index.mjs';
|
|
5
7
|
|
|
6
8
|
const onTouchMove = (e) => {
|
|
7
9
|
e.preventDefault();
|
|
@@ -11,10 +13,9 @@ const onModalClick = () => {
|
|
|
11
13
|
PopupManager == null ? void 0 : PopupManager.doOnModalClick();
|
|
12
14
|
};
|
|
13
15
|
let hasModal = false;
|
|
14
|
-
let zIndex;
|
|
15
16
|
const getModal = function() {
|
|
16
17
|
if (!isClient)
|
|
17
|
-
return;
|
|
18
|
+
return void 0;
|
|
18
19
|
let modalDom = PopupManager.modalDom;
|
|
19
20
|
if (modalDom) {
|
|
20
21
|
hasModal = true;
|
|
@@ -31,7 +32,14 @@ const instances = {};
|
|
|
31
32
|
const PopupManager = {
|
|
32
33
|
modalFade: true,
|
|
33
34
|
modalDom: void 0,
|
|
34
|
-
|
|
35
|
+
globalInitialZIndex: 2e3,
|
|
36
|
+
zIndex: 0,
|
|
37
|
+
getInitialZIndex() {
|
|
38
|
+
var _a;
|
|
39
|
+
if (!getCurrentInstance())
|
|
40
|
+
return this.globalInitialZIndex;
|
|
41
|
+
return (_a = useGlobalConfig("zIndex").value) != null ? _a : this.globalInitialZIndex;
|
|
42
|
+
},
|
|
35
43
|
getInstance(id) {
|
|
36
44
|
return instances[id];
|
|
37
45
|
},
|
|
@@ -47,7 +55,7 @@ const PopupManager = {
|
|
|
47
55
|
}
|
|
48
56
|
},
|
|
49
57
|
nextZIndex() {
|
|
50
|
-
return ++
|
|
58
|
+
return this.getInitialZIndex() + ++this.zIndex;
|
|
51
59
|
},
|
|
52
60
|
modalStack: [],
|
|
53
61
|
doOnModalClick() {
|
|
@@ -59,10 +67,10 @@ const PopupManager = {
|
|
|
59
67
|
instance.close();
|
|
60
68
|
}
|
|
61
69
|
},
|
|
62
|
-
openModal(id,
|
|
70
|
+
openModal(id, zIndex, dom, modalClass, modalFade) {
|
|
63
71
|
if (!isClient)
|
|
64
72
|
return;
|
|
65
|
-
if (!id ||
|
|
73
|
+
if (!id || zIndex === void 0)
|
|
66
74
|
return;
|
|
67
75
|
this.modalFade = modalFade;
|
|
68
76
|
const modalStack = this.modalStack;
|
|
@@ -89,12 +97,12 @@ const PopupManager = {
|
|
|
89
97
|
} else {
|
|
90
98
|
document.body.appendChild(modalDom);
|
|
91
99
|
}
|
|
92
|
-
if (
|
|
93
|
-
modalDom.style.zIndex = String(
|
|
100
|
+
if (zIndex) {
|
|
101
|
+
modalDom.style.zIndex = String(zIndex);
|
|
94
102
|
}
|
|
95
103
|
modalDom.tabIndex = 0;
|
|
96
104
|
modalDom.style.display = "";
|
|
97
|
-
this.modalStack.push({ id, zIndex
|
|
105
|
+
this.modalStack.push({ id, zIndex, modalClass });
|
|
98
106
|
},
|
|
99
107
|
closeModal(id) {
|
|
100
108
|
const modalStack = this.modalStack;
|
|
@@ -108,7 +116,7 @@ const PopupManager = {
|
|
|
108
116
|
}
|
|
109
117
|
modalStack.pop();
|
|
110
118
|
if (modalStack.length > 0) {
|
|
111
|
-
modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex
|
|
119
|
+
modalDom.style.zIndex = `${modalStack[modalStack.length - 1].zIndex}`;
|
|
112
120
|
}
|
|
113
121
|
} else {
|
|
114
122
|
for (let i = modalStack.length - 1; i >= 0; i--) {
|
|
@@ -135,18 +143,6 @@ const PopupManager = {
|
|
|
135
143
|
}
|
|
136
144
|
}
|
|
137
145
|
};
|
|
138
|
-
Object.defineProperty(PopupManager, "zIndex", {
|
|
139
|
-
configurable: true,
|
|
140
|
-
get() {
|
|
141
|
-
if (zIndex === void 0) {
|
|
142
|
-
zIndex = getConfig("zIndex") || 2e3;
|
|
143
|
-
}
|
|
144
|
-
return zIndex;
|
|
145
|
-
},
|
|
146
|
-
set(value) {
|
|
147
|
-
zIndex = value;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
146
|
const getTopPopup = function() {
|
|
151
147
|
if (!isClient)
|
|
152
148
|
return;
|
|
@@ -159,7 +155,7 @@ const getTopPopup = function() {
|
|
|
159
155
|
}
|
|
160
156
|
};
|
|
161
157
|
if (isClient) {
|
|
162
|
-
|
|
158
|
+
window.addEventListener("keydown", function(event) {
|
|
163
159
|
if (event.code === EVENT_CODE.esc) {
|
|
164
160
|
const topPopup = getTopPopup();
|
|
165
161
|
if (topPopup && topPopup.closeOnPressEscape.value) {
|
|
@@ -169,5 +165,5 @@ if (isClient) {
|
|
|
169
165
|
});
|
|
170
166
|
}
|
|
171
167
|
|
|
172
|
-
export { PopupManager
|
|
168
|
+
export { PopupManager };
|
|
173
169
|
//# sourceMappingURL=popup-manager.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup-manager.mjs","sources":["../../../../packages/utils/popup-manager.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport * as configs from './config'\nimport { addClass, removeClass, on } from './dom'\nimport { EVENT_CODE } from './aria'\n\nimport type { Ref } from 'vue'\ninterface Instance {\n closeOnClickModal: Ref<boolean>\n closeOnPressEscape: Ref<boolean>\n close: () => void\n handleClose?: () => void\n handleAction?: (action: string) => void\n}\n\ntype StackFrame = { id: string; zIndex: number; modalClass: string }\n\ninterface IPopupManager {\n getInstance: (id: string) => Instance\n zIndex: number\n modalDom?: HTMLElement\n modalFade: boolean\n modalStack: StackFrame[]\n nextZIndex: () => number\n register: (id: string, instance: Instance) => void\n deregister: (id: string) => void\n doOnModalClick: () => void\n openModal: (\n id: string,\n zIndex: number,\n dom: HTMLElement,\n modalClass: string,\n modalFade: boolean\n ) => void\n closeModal: (id: string) => void\n}\n\nconst onTouchMove = (e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n}\n\nconst onModalClick = () => {\n PopupManager?.doOnModalClick()\n}\n\nlet hasModal = false\nlet zIndex: number\n\nconst getModal = function (): HTMLElement {\n if (!isClient) return\n let modalDom = PopupManager.modalDom\n if (modalDom) {\n hasModal = true\n } else {\n hasModal = false\n modalDom = document.createElement('div')\n PopupManager.modalDom = modalDom\n\n on(modalDom, 'touchmove', onTouchMove)\n on(modalDom, 'click', onModalClick)\n }\n\n return modalDom\n}\n\nconst instances = {}\n\nconst PopupManager: IPopupManager = {\n modalFade: true,\n modalDom: undefined,\n zIndex,\n\n getInstance(id) {\n return instances[id]\n },\n\n register(id, instance) {\n if (id && instance) {\n instances[id] = instance\n }\n },\n\n deregister(id) {\n if (id) {\n instances[id] = null\n delete instances[id]\n }\n },\n\n nextZIndex() {\n return ++PopupManager.zIndex\n },\n\n modalStack: [],\n\n doOnModalClick() {\n const topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1]\n if (!topItem) return\n\n const instance = PopupManager.getInstance(topItem.id)\n if (instance && instance.closeOnClickModal.value) {\n instance.close()\n }\n },\n\n openModal(id, zIndex, dom, modalClass, modalFade) {\n if (!isClient) return\n if (!id || zIndex === undefined) return\n this.modalFade = modalFade\n\n const modalStack = this.modalStack\n\n for (let i = 0, j = modalStack.length; i < j; i++) {\n const item = modalStack[i]\n if (item.id === id) {\n return\n }\n }\n\n const modalDom = getModal()\n\n addClass(modalDom, 'v-modal')\n if (this.modalFade && !hasModal) {\n addClass(modalDom, 'v-modal-enter')\n }\n if (modalClass) {\n const classArr = modalClass.trim().split(/\\s+/)\n classArr.forEach((item) => addClass(modalDom, item))\n }\n setTimeout(() => {\n removeClass(modalDom, 'v-modal-enter')\n }, 200)\n\n if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {\n dom.parentNode.appendChild(modalDom)\n } else {\n document.body.appendChild(modalDom)\n }\n\n if (zIndex) {\n modalDom.style.zIndex = String(zIndex)\n }\n modalDom.tabIndex = 0\n modalDom.style.display = ''\n\n this.modalStack.push({ id, zIndex, modalClass })\n },\n\n closeModal(id) {\n const modalStack = this.modalStack\n const modalDom = getModal()\n\n if (modalStack.length > 0) {\n const topItem = modalStack[modalStack.length - 1]\n if (topItem.id === id) {\n if (topItem.modalClass) {\n const classArr = topItem.modalClass.trim().split(/\\s+/)\n classArr.forEach((item) => removeClass(modalDom, item))\n }\n\n modalStack.pop()\n if (modalStack.length > 0) {\n modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex\n }\n } else {\n for (let i = modalStack.length - 1; i >= 0; i--) {\n if (modalStack[i].id === id) {\n modalStack.splice(i, 1)\n break\n }\n }\n }\n }\n\n if (modalStack.length === 0) {\n if (this.modalFade) {\n addClass(modalDom, 'v-modal-leave')\n }\n setTimeout(() => {\n if (modalStack.length === 0) {\n if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom)\n modalDom.style.display = 'none'\n // off(modalDom, 'touchmove', onTouchMove)\n // off(modalDom, 'click', onModalClick)\n PopupManager.modalDom = undefined\n }\n removeClass(modalDom, 'v-modal-leave')\n }, 200)\n }\n },\n}\n\nObject.defineProperty(PopupManager, 'zIndex', {\n configurable: true,\n get() {\n if (zIndex === undefined) {\n zIndex = (configs.getConfig('zIndex') as number) || 2000\n }\n return zIndex\n },\n set(value) {\n zIndex = value\n },\n})\n\nconst getTopPopup = function () {\n if (!isClient) return\n if (PopupManager.modalStack.length > 0) {\n const topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1]\n if (!topPopup) return\n const instance = PopupManager.getInstance(topPopup.id)\n\n return instance\n }\n}\n\nif (isClient) {\n // handle `esc` key when the popup is shown\n on(window, 'keydown', function (event: KeyboardEvent) {\n if (event.code === EVENT_CODE.esc) {\n const topPopup = getTopPopup()\n\n if (topPopup && topPopup.closeOnPressEscape.value) {\n topPopup.handleClose\n ? topPopup.handleClose()\n : topPopup.handleAction\n ? topPopup.handleAction('cancel')\n : topPopup.close()\n }\n }\n })\n}\n\nexport default PopupManager\n"],"names":["configs.getConfig"],"mappings":";;;;;AAIA,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK;AAC3B,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC;AACrB,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AACtB,CAAC,CAAC;AACF,MAAM,YAAY,GAAG,MAAM;AAC3B,EAAE,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;AAChE,CAAC,CAAC;AACF,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,IAAI,MAAM,CAAC;AACX,MAAM,QAAQ,GAAG,WAAW;AAC5B,EAAE,IAAI,CAAC,QAAQ;AACf,IAAI,OAAO;AACX,EAAE,IAAI,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;AACvC,EA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G,WAAW,EAAE,CAAC;AACrC,MAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE;AACzD,QAAQ,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnI,OAAO;AACP,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
|
|
1
|
+
{"version":3,"file":"popup-manager.mjs","sources":["../../../../packages/utils/popup-manager.ts"],"sourcesContent":["import { getCurrentInstance } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { useGlobalConfig } from '@element-plus/hooks'\nimport { addClass, removeClass, on } from './dom'\nimport { EVENT_CODE } from './aria'\nimport type { Ref } from 'vue'\n\ninterface Instance {\n closeOnClickModal: Ref<boolean>\n closeOnPressEscape: Ref<boolean>\n close: () => void\n handleClose?: () => void\n handleAction?: (action: string) => void\n}\n\ntype StackFrame = { id: string; zIndex: number; modalClass: string }\n\ninterface PopupManager {\n getInstance: (id: string) => Instance\n zIndex: number\n globalInitialZIndex: number\n getInitialZIndex: () => number\n modalDom?: HTMLElement\n modalFade: boolean\n modalStack: StackFrame[]\n nextZIndex: () => number\n register: (id: string, instance: Instance) => void\n deregister: (id: string) => void\n doOnModalClick: () => void\n openModal: (\n id: string,\n zIndex: number,\n dom: HTMLElement,\n modalClass: string,\n modalFade: boolean\n ) => void\n closeModal: (id: string) => void\n}\n\nconst onTouchMove = (e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n}\n\nconst onModalClick = () => {\n PopupManager?.doOnModalClick()\n}\n\nlet hasModal = false\n\nconst getModal = function (): HTMLElement {\n if (!isClient) return undefined as any\n let modalDom = PopupManager.modalDom\n if (modalDom) {\n hasModal = true\n } else {\n hasModal = false\n modalDom = document.createElement('div')\n PopupManager.modalDom = modalDom\n\n on(modalDom, 'touchmove', onTouchMove)\n on(modalDom, 'click', onModalClick)\n }\n\n return modalDom\n}\n\nconst instances = {}\n\nexport const PopupManager: PopupManager = {\n modalFade: true,\n modalDom: undefined,\n globalInitialZIndex: 2000,\n zIndex: 0,\n\n getInitialZIndex() {\n if (!getCurrentInstance()) return this.globalInitialZIndex\n return useGlobalConfig('zIndex').value ?? this.globalInitialZIndex\n },\n\n getInstance(id) {\n return instances[id]\n },\n\n register(id, instance) {\n if (id && instance) {\n instances[id] = instance\n }\n },\n\n deregister(id) {\n if (id) {\n instances[id] = null\n delete instances[id]\n }\n },\n\n nextZIndex() {\n return this.getInitialZIndex() + ++this.zIndex\n },\n\n modalStack: [],\n\n doOnModalClick() {\n const topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1]\n if (!topItem) return\n\n const instance = PopupManager.getInstance(topItem.id)\n if (instance && instance.closeOnClickModal.value) {\n instance.close()\n }\n },\n\n openModal(id, zIndex, dom, modalClass, modalFade) {\n if (!isClient) return\n if (!id || zIndex === undefined) return\n this.modalFade = modalFade\n\n const modalStack = this.modalStack\n\n for (let i = 0, j = modalStack.length; i < j; i++) {\n const item = modalStack[i]\n if (item.id === id) {\n return\n }\n }\n\n const modalDom = getModal()\n\n addClass(modalDom, 'v-modal')\n if (this.modalFade && !hasModal) {\n addClass(modalDom, 'v-modal-enter')\n }\n if (modalClass) {\n const classArr = modalClass.trim().split(/\\s+/)\n classArr.forEach((item) => addClass(modalDom, item))\n }\n setTimeout(() => {\n removeClass(modalDom, 'v-modal-enter')\n }, 200)\n\n if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {\n dom.parentNode.appendChild(modalDom)\n } else {\n document.body.appendChild(modalDom)\n }\n\n if (zIndex) {\n modalDom.style.zIndex = String(zIndex)\n }\n modalDom.tabIndex = 0\n modalDom.style.display = ''\n\n this.modalStack.push({ id, zIndex, modalClass })\n },\n\n closeModal(id) {\n const modalStack = this.modalStack\n const modalDom = getModal()\n\n if (modalStack.length > 0) {\n const topItem = modalStack[modalStack.length - 1]\n if (topItem.id === id) {\n if (topItem.modalClass) {\n const classArr = topItem.modalClass.trim().split(/\\s+/)\n classArr.forEach((item) => removeClass(modalDom, item))\n }\n\n modalStack.pop()\n if (modalStack.length > 0) {\n modalDom.style.zIndex = `${modalStack[modalStack.length - 1].zIndex}`\n }\n } else {\n for (let i = modalStack.length - 1; i >= 0; i--) {\n if (modalStack[i].id === id) {\n modalStack.splice(i, 1)\n break\n }\n }\n }\n }\n\n if (modalStack.length === 0) {\n if (this.modalFade) {\n addClass(modalDom, 'v-modal-leave')\n }\n setTimeout(() => {\n if (modalStack.length === 0) {\n if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom)\n modalDom.style.display = 'none'\n // off(modalDom, 'touchmove', onTouchMove)\n // off(modalDom, 'click', onModalClick)\n PopupManager.modalDom = undefined\n }\n removeClass(modalDom, 'v-modal-leave')\n }, 200)\n }\n },\n}\n\nconst getTopPopup = function () {\n if (!isClient) return\n if (PopupManager.modalStack.length > 0) {\n const topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1]\n if (!topPopup) return\n const instance = PopupManager.getInstance(topPopup.id)\n\n return instance\n }\n}\n\nif (isClient) {\n // handle `esc` key when the popup is shown\n window.addEventListener('keydown', function (event: KeyboardEvent) {\n if (event.code === EVENT_CODE.esc) {\n const topPopup = getTopPopup()\n\n if (topPopup && topPopup.closeOnPressEscape.value) {\n topPopup.handleClose\n ? topPopup.handleClose()\n : topPopup.handleAction\n ? topPopup.handleAction('cancel')\n : topPopup.close()\n }\n }\n })\n}\n"],"names":[],"mappings":";;;;;;;AAKA,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK;AAC3B,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC;AACrB,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AACtB,CAAC,CAAC;AACF,MAAM,YAAY,GAAG,MAAM;AAC3B,EAAE,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,YAAY,CAAC,cAAc,E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