ele-admin-plus 1.2.1-beta.4 → 1.2.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ele-app/style/overwrite/date-picker/index.scss +13 -11
- package/es/ele-cropper/components/cropper-tools.js +2 -2
- package/es/ele-data-table/components/table-columns.js +12 -2
- package/es/ele-data-table/index.d.ts +122 -0
- package/es/ele-data-table/style/index.scss +0 -4
- package/es/ele-data-table/types.d.ts +3 -0
- package/es/ele-drawer/index.d.ts +1 -0
- package/es/ele-drawer/index.js +8 -2
- package/es/ele-dropdown/components/dropdown-menu-item.d.ts +39 -0
- package/es/ele-dropdown/components/dropdown-menu-item.js +132 -0
- package/es/ele-dropdown/components/dropdown-menus.d.ts +44 -0
- package/es/ele-dropdown/components/dropdown-menus.js +111 -0
- package/es/ele-dropdown/components/pro-dropdown.d.ts +2 -1
- package/es/ele-dropdown/components/pro-dropdown.js +64 -63
- package/es/ele-dropdown/index.d.ts +9 -7
- package/es/ele-dropdown/index.js +3 -1
- package/es/ele-dropdown/style/index.scss +52 -1
- package/es/ele-dropdown/types.d.ts +2 -0
- package/es/ele-popconfirm/index.js +31 -24
- package/es/ele-pro-layout/index.js +7 -2
- package/es/ele-pro-table/components/table-tools.d.ts +2 -3
- package/es/ele-pro-table/components/table-tools.js +22 -13
- package/es/ele-pro-table/index.d.ts +2 -6
- package/es/ele-tabs/index.js +1 -1
- package/es/style/themes/default.scss +4 -2
- package/lib/ele-app/style/overwrite/date-picker/index.scss +13 -11
- package/lib/ele-cropper/components/cropper-tools.cjs +1 -1
- package/lib/ele-data-table/components/table-columns.cjs +11 -1
- package/lib/ele-data-table/index.d.ts +122 -0
- package/lib/ele-data-table/style/index.scss +0 -4
- package/lib/ele-data-table/types.d.ts +3 -0
- package/lib/ele-drawer/index.cjs +8 -2
- package/lib/ele-drawer/index.d.ts +1 -0
- package/lib/ele-dropdown/components/dropdown-menu-item.cjs +131 -0
- package/lib/ele-dropdown/components/dropdown-menu-item.d.ts +39 -0
- package/lib/ele-dropdown/components/dropdown-menus.cjs +110 -0
- package/lib/ele-dropdown/components/dropdown-menus.d.ts +44 -0
- package/lib/ele-dropdown/components/pro-dropdown.cjs +62 -61
- package/lib/ele-dropdown/components/pro-dropdown.d.ts +2 -1
- package/lib/ele-dropdown/index.cjs +2 -0
- package/lib/ele-dropdown/index.d.ts +9 -7
- package/lib/ele-dropdown/style/index.scss +52 -1
- package/lib/ele-dropdown/types.d.ts +2 -0
- package/lib/ele-popconfirm/index.cjs +31 -24
- package/lib/ele-pro-layout/index.cjs +6 -1
- package/lib/ele-pro-table/components/table-tools.cjs +21 -12
- package/lib/ele-pro-table/components/table-tools.d.ts +2 -3
- package/lib/ele-pro-table/index.d.ts +2 -6
- package/lib/ele-tabs/index.cjs +1 -1
- package/lib/style/themes/default.scss +4 -2
- package/package.json +9 -9
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
.el-month-table td {
|
|
245
245
|
width: auto;
|
|
246
246
|
|
|
247
|
-
.
|
|
247
|
+
.el-date-table-cell__text {
|
|
248
248
|
color: eleVar('datepicker', 'color');
|
|
249
249
|
width: eleVar('datepicker', 'year-width');
|
|
250
250
|
height: eleVar('datepicker', 'year-height');
|
|
@@ -261,18 +261,18 @@
|
|
|
261
261
|
transform: none;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
&.today .
|
|
264
|
+
&.today .el-date-table-cell__text {
|
|
265
265
|
color: eleVar('datepicker', 'today-color');
|
|
266
266
|
font-weight: eleVar('datepicker', 'today-weight');
|
|
267
267
|
border: eleVar('datepicker', 'today-border');
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
.
|
|
270
|
+
.el-date-table-cell__text:hover {
|
|
271
271
|
color: eleVar('datepicker', 'hover-color');
|
|
272
272
|
background: eleVar('datepicker', 'hover-bg');
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
&.current:not(.disabled) .
|
|
275
|
+
&.current:not(.disabled) .el-date-table-cell__text {
|
|
276
276
|
color: eleVar('datepicker', 'active-color');
|
|
277
277
|
background: eleVar('datepicker', 'active-bg');
|
|
278
278
|
}
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
background: eleVar('datepicker', 'disabled-bg');
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
.
|
|
298
|
+
.el-date-table-cell__text {
|
|
299
299
|
color: eleVar('datepicker', 'disabled-color');
|
|
300
300
|
background: none;
|
|
301
301
|
}
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
background: eleVar('datepicker', 'disabled-bg');
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
.
|
|
322
|
+
.el-date-table-cell__text {
|
|
323
323
|
color: eleVar('datepicker', 'disabled-color');
|
|
324
324
|
background: none;
|
|
325
325
|
}
|
|
@@ -444,7 +444,8 @@
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
// 月范围
|
|
447
|
-
.el-month-table td
|
|
447
|
+
.el-month-table td,
|
|
448
|
+
.el-year-table td {
|
|
448
449
|
&.start-date > div {
|
|
449
450
|
border-top-left-radius: eleVar('datepicker', 'year-radius');
|
|
450
451
|
border-bottom-left-radius: eleVar('datepicker', 'year-radius');
|
|
@@ -465,18 +466,19 @@
|
|
|
465
466
|
}
|
|
466
467
|
}
|
|
467
468
|
|
|
468
|
-
&.in-range .
|
|
469
|
+
&.in-range .el-date-table-cell__text:hover {
|
|
469
470
|
background: none;
|
|
470
471
|
}
|
|
471
472
|
|
|
472
|
-
&.in-range.start-date:not(.disabled) .
|
|
473
|
-
&.in-range.end-date:not(.disabled) .
|
|
473
|
+
&.in-range.start-date:not(.disabled) .el-date-table-cell__text,
|
|
474
|
+
&.in-range.end-date:not(.disabled) .el-date-table-cell__text {
|
|
474
475
|
color: eleVar('datepicker', 'active-color');
|
|
475
476
|
background: eleVar('datepicker', 'active-bg');
|
|
476
477
|
}
|
|
477
478
|
}
|
|
478
479
|
|
|
479
|
-
.el-month-table
|
|
480
|
+
.el-month-table,
|
|
481
|
+
.el-year-table {
|
|
480
482
|
border-collapse: separate;
|
|
481
483
|
border-spacing: 0;
|
|
482
484
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, shallowRef, watch, resolveComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, withCtx, createVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, mergeProps } from "vue";
|
|
1
|
+
import { defineComponent, ref, shallowRef, watch, markRaw, resolveComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, withCtx, createVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, mergeProps } from "vue";
|
|
2
2
|
import { ElButtonGroup, ElButton, ElUpload } from "element-plus";
|
|
3
3
|
import { ZoomInOutlined, ZoomOutOutlined, ArrowLeftOutlined, ArrowRightOutlined, ArrowUpOutlined, ArrowDownOutlined, UndoOutlined, ReloadOutlined, SwapOutlined, SortOutlined, SyncOutlined, UploadOutlined, CheckOutlined } from "../../icons";
|
|
4
4
|
import { useTimer } from "../../utils/hook";
|
|
@@ -116,7 +116,7 @@ const _sfc_main = defineComponent({
|
|
|
116
116
|
return {
|
|
117
117
|
key: i + "-" + j + name,
|
|
118
118
|
name,
|
|
119
|
-
icon: TOOL_ICONS[name],
|
|
119
|
+
icon: markRaw(TOOL_ICONS[name]),
|
|
120
120
|
className: `ele-cropper-${name}`
|
|
121
121
|
};
|
|
122
122
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, mergeProps, withCtx, createElementVNode, renderSlot, createTextVNode, toDisplayString, createSlots, createCommentVNode } from "vue";
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, mergeProps, withCtx, createElementVNode, renderSlot, createTextVNode, toDisplayString, createSlots, createCommentVNode, createVNode, resolveDynamicComponent } from "vue";
|
|
2
2
|
import { ElTableColumn } from "element-plus";
|
|
3
|
+
import { FilterFilled } from "../../icons";
|
|
3
4
|
import { omit } from "../../utils/core";
|
|
4
5
|
import { getCellClass, getFilterPopperClass, getTooltipProps } from "../util";
|
|
5
6
|
const _sfc_main = defineComponent({
|
|
6
7
|
name: "TableColumns",
|
|
7
|
-
components: { ElTableColumn },
|
|
8
|
+
components: { ElTableColumn, FilterFilled },
|
|
8
9
|
props: {
|
|
9
10
|
/** 列配置 */
|
|
10
11
|
columns: Array,
|
|
@@ -34,6 +35,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
34
35
|
const _hoisted_1 = ["title"];
|
|
35
36
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
36
37
|
const _component_TableColumns = resolveComponent("TableColumns", true);
|
|
38
|
+
const _component_FilterFilled = resolveComponent("FilterFilled");
|
|
37
39
|
const _component_ElTableColumn = resolveComponent("ElTableColumn");
|
|
38
40
|
return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (col) => {
|
|
39
41
|
return openBlock(), createBlock(_component_ElTableColumn, mergeProps(
|
|
@@ -104,6 +106,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
104
106
|
})
|
|
105
107
|
]), 1032, ["columns", "pageIndex", "slotNormalize", "globalTooltip"])) : createCommentVNode("", true)
|
|
106
108
|
]),
|
|
109
|
+
"filter-icon": withCtx((slotProps) => [
|
|
110
|
+
!col.filterIcon ? (openBlock(), createBlock(_component_FilterFilled, { key: 0 })) : typeof col.filterIcon === "string" ? renderSlot(_ctx.$slots, col.filterIcon, mergeProps({
|
|
111
|
+
key: 1,
|
|
112
|
+
ref_for: true
|
|
113
|
+
}, slotProps || {}), () => [
|
|
114
|
+
createVNode(_component_FilterFilled)
|
|
115
|
+
]) : (openBlock(), createBlock(resolveDynamicComponent(col.filterIcon), { key: 2 }))
|
|
116
|
+
]),
|
|
107
117
|
_: 2
|
|
108
118
|
}, 1040, ["index", "className", "columnKey", "filterClassName", "showOverflowTooltip"]);
|
|
109
119
|
}), 128);
|
|
@@ -129,6 +129,128 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
129
129
|
uid?: string | undefined;
|
|
130
130
|
slot?: string | undefined;
|
|
131
131
|
headerSlot?: string | undefined;
|
|
132
|
+
filterIcon?: string | import('vue').FunctionalComponent<any, {}, any, {}> | {
|
|
133
|
+
new (...args: any[]): any;
|
|
134
|
+
__isFragment?: never;
|
|
135
|
+
__isTeleport?: never;
|
|
136
|
+
__isSuspense?: never;
|
|
137
|
+
} | {
|
|
138
|
+
[x: string]: any;
|
|
139
|
+
setup?: ((this: void, props: import('@vue/shared').LooseRequired<any>, ctx: {
|
|
140
|
+
attrs: {
|
|
141
|
+
[x: string]: unknown;
|
|
142
|
+
};
|
|
143
|
+
slots: Readonly<{
|
|
144
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
emit: ((event: unknown, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
|
147
|
+
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
148
|
+
}) => any) | undefined;
|
|
149
|
+
name?: string | undefined;
|
|
150
|
+
template?: (string | object) | undefined;
|
|
151
|
+
render?: Function | undefined;
|
|
152
|
+
components?: Record<string, import('vue').Component> | undefined;
|
|
153
|
+
directives?: Record<string, import('vue').Directive> | undefined;
|
|
154
|
+
inheritAttrs?: boolean | undefined;
|
|
155
|
+
emits?: any;
|
|
156
|
+
slots?: {} | undefined;
|
|
157
|
+
expose?: string[] | undefined;
|
|
158
|
+
serverPrefetch?: (() => void | Promise<any>) | undefined;
|
|
159
|
+
compilerOptions?: {
|
|
160
|
+
isCustomElement?: ((tag: string) => boolean) | undefined;
|
|
161
|
+
whitespace?: ("preserve" | "condense") | undefined;
|
|
162
|
+
comments?: boolean | undefined;
|
|
163
|
+
delimiters?: [string, string] | undefined;
|
|
164
|
+
} | undefined;
|
|
165
|
+
call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
|
|
166
|
+
__isFragment?: never | undefined;
|
|
167
|
+
__isTeleport?: never | undefined;
|
|
168
|
+
__isSuspense?: never | undefined;
|
|
169
|
+
__defaults?: any;
|
|
170
|
+
compatConfig?: {
|
|
171
|
+
GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
|
|
172
|
+
GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
|
|
173
|
+
GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
|
|
174
|
+
GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
|
|
175
|
+
GLOBAL_SET?: boolean | "suppress-warning" | undefined;
|
|
176
|
+
GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
|
|
177
|
+
GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
|
|
178
|
+
GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
|
|
179
|
+
CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
|
|
180
|
+
CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
|
|
181
|
+
CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
|
|
182
|
+
CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
|
|
183
|
+
CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
|
|
184
|
+
CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
|
|
185
|
+
CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
|
|
186
|
+
INSTANCE_SET?: boolean | "suppress-warning" | undefined;
|
|
187
|
+
INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
|
|
188
|
+
INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
|
|
189
|
+
INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
|
|
190
|
+
INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
|
|
191
|
+
INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
|
|
192
|
+
INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
|
|
193
|
+
INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
|
|
194
|
+
INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
|
|
195
|
+
OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
|
|
196
|
+
OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
|
|
197
|
+
OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
|
|
198
|
+
OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
|
|
199
|
+
WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
|
|
200
|
+
PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
|
|
201
|
+
V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
|
|
202
|
+
CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
|
|
203
|
+
ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
|
|
204
|
+
ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
|
|
205
|
+
TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
|
|
206
|
+
TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
|
|
207
|
+
COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
|
|
208
|
+
COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
|
|
209
|
+
COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
|
|
210
|
+
RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
|
|
211
|
+
FILTERS?: boolean | "suppress-warning" | undefined;
|
|
212
|
+
PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
|
|
213
|
+
MODE?: (2 | 3 | ((comp: import('vue').Component | null) => 2 | 3)) | undefined;
|
|
214
|
+
} | undefined;
|
|
215
|
+
data?: ((this: any, vm: any) => any) | undefined;
|
|
216
|
+
computed?: import('vue').ComputedOptions | undefined;
|
|
217
|
+
methods?: import('vue').MethodOptions | undefined;
|
|
218
|
+
watch?: {
|
|
219
|
+
[x: string]: (string | import('vue').WatchCallback<any, any> | ({
|
|
220
|
+
handler: import('vue').WatchCallback | string;
|
|
221
|
+
} & import('vue').WatchOptions<boolean>)) | (string | import('vue').WatchCallback<any, any> | ({
|
|
222
|
+
handler: import('vue').WatchCallback | string;
|
|
223
|
+
} & import('vue').WatchOptions<boolean>))[];
|
|
224
|
+
} | undefined;
|
|
225
|
+
provide?: import('vue').ComponentProvideOptions | undefined;
|
|
226
|
+
inject?: {} | string[] | undefined;
|
|
227
|
+
filters?: Record<string, Function> | undefined;
|
|
228
|
+
mixins?: any[] | undefined;
|
|
229
|
+
extends?: any;
|
|
230
|
+
beforeCreate?: (() => void) | undefined;
|
|
231
|
+
created?: (() => void) | undefined;
|
|
232
|
+
beforeMount?: (() => void) | undefined;
|
|
233
|
+
mounted?: (() => void) | undefined;
|
|
234
|
+
beforeUpdate?: (() => void) | undefined;
|
|
235
|
+
updated?: (() => void) | undefined;
|
|
236
|
+
activated?: (() => void) | undefined;
|
|
237
|
+
deactivated?: (() => void) | undefined;
|
|
238
|
+
beforeDestroy?: (() => void) | undefined;
|
|
239
|
+
beforeUnmount?: (() => void) | undefined;
|
|
240
|
+
destroyed?: (() => void) | undefined;
|
|
241
|
+
unmounted?: (() => void) | undefined;
|
|
242
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | undefined;
|
|
243
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | undefined;
|
|
244
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | undefined;
|
|
245
|
+
delimiters?: [string, string] | undefined;
|
|
246
|
+
__differentiator?: string | number | symbol | undefined;
|
|
247
|
+
__isBuiltIn?: boolean | undefined;
|
|
248
|
+
__file?: string | undefined;
|
|
249
|
+
__name?: string | undefined;
|
|
250
|
+
beforeRouteEnter?: (import('vue-router').TypesConfig extends Record<"beforeRouteEnter", infer T> ? T : import('vue-router').NavigationGuardWithThis<undefined>) | undefined;
|
|
251
|
+
beforeRouteUpdate?: (import('vue-router').TypesConfig extends Record<"beforeRouteUpdate", infer T> ? T : import('vue-router').NavigationGuard) | undefined;
|
|
252
|
+
beforeRouteLeave?: (import('vue-router').TypesConfig extends Record<"beforeRouteLeave", infer T> ? T : import('vue-router').NavigationGuard) | undefined;
|
|
253
|
+
} | undefined;
|
|
132
254
|
hideInTable?: boolean | undefined;
|
|
133
255
|
hideInSetting?: boolean | undefined;
|
|
134
256
|
hideInExport?: boolean | undefined;
|
|
@@ -189,10 +189,6 @@
|
|
|
189
189
|
color: eleVar('table', 'icon-color');
|
|
190
190
|
font-size: eleVar('table', 'filter-size');
|
|
191
191
|
transition: (color $transition-base, font-size $transition-base);
|
|
192
|
-
|
|
193
|
-
& > svg > path {
|
|
194
|
-
#{'d'}: path($icon-filter-path);
|
|
195
|
-
}
|
|
196
192
|
}
|
|
197
193
|
|
|
198
194
|
&:hover {
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
ElEmptyProps
|
|
7
7
|
} from '../ele-app/el';
|
|
8
8
|
import type { EleTooltipProps } from '../ele-app/plus';
|
|
9
|
+
import type { UserComponent } from '../ele-app/types';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* 数据唯一键
|
|
@@ -36,6 +37,8 @@ export interface Column extends Omit<TableColumn, 'filterPlacement'> {
|
|
|
36
37
|
slot?: string;
|
|
37
38
|
/** 表头插槽名称 */
|
|
38
39
|
headerSlot?: string;
|
|
40
|
+
/** 自定义筛选图标 */
|
|
41
|
+
filterIcon?: UserComponent;
|
|
39
42
|
/** 是否隐藏 */
|
|
40
43
|
hideInTable?: boolean;
|
|
41
44
|
/** 是否不显示在列配置中 */
|
package/es/ele-drawer/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
66
66
|
drawerRef: import('vue').Ref<ElDrawerInstance>;
|
|
67
67
|
drawerClass: import('vue').ComputedRef<string>;
|
|
68
68
|
teleportTo: import('vue').ComputedRef<string | Element>;
|
|
69
|
+
teleportDisabled: import('vue').ComputedRef<boolean>;
|
|
69
70
|
handleClose: () => void;
|
|
70
71
|
updateModelValue: (value: boolean) => void;
|
|
71
72
|
handleDrawerOpen: () => void;
|
package/es/ele-drawer/index.js
CHANGED
|
@@ -34,10 +34,15 @@ const _sfc_main = defineComponent({
|
|
|
34
34
|
return getModalContainer(
|
|
35
35
|
props.inner,
|
|
36
36
|
false,
|
|
37
|
-
|
|
37
|
+
props.appendTo,
|
|
38
38
|
layoutState.modalsEl
|
|
39
39
|
);
|
|
40
40
|
});
|
|
41
|
+
const teleportDisabled = computed(() => {
|
|
42
|
+
const appendTo = props.appendTo || "body";
|
|
43
|
+
const disabled = appendTo === "body" ? !props.appendToBody : false;
|
|
44
|
+
return props.inner ? false : disabled;
|
|
45
|
+
});
|
|
41
46
|
const handleClose = () => {
|
|
42
47
|
if (drawerRef.value && drawerRef.value.handleClose) {
|
|
43
48
|
drawerRef.value.handleClose();
|
|
@@ -74,6 +79,7 @@ const _sfc_main = defineComponent({
|
|
|
74
79
|
drawerRef,
|
|
75
80
|
drawerClass,
|
|
76
81
|
teleportTo,
|
|
82
|
+
teleportDisabled,
|
|
77
83
|
handleClose,
|
|
78
84
|
updateModelValue,
|
|
79
85
|
handleDrawerOpen,
|
|
@@ -100,7 +106,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
100
106
|
const _component_ElDrawer = resolveComponent("ElDrawer");
|
|
101
107
|
return openBlock(), createBlock(Teleport, {
|
|
102
108
|
to: _ctx.teleportTo,
|
|
103
|
-
disabled: _ctx.
|
|
109
|
+
disabled: _ctx.teleportDisabled
|
|
104
110
|
}, [
|
|
105
111
|
createVNode(_component_ElDrawer, mergeProps(_ctx.$attrs, {
|
|
106
112
|
ref: "drawerRef",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ElIconProps } from '../../ele-app/el';
|
|
3
|
+
import { DropdownItem } from '../types';
|
|
4
|
+
|
|
5
|
+
declare const _default: import('vue').DefineComponent<{
|
|
6
|
+
/** 菜单项数据 */
|
|
7
|
+
item: {
|
|
8
|
+
type: PropType<DropdownItem>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
/** 选中的菜单 */
|
|
12
|
+
selected: PropType<DropdownItem["command"]>;
|
|
13
|
+
/** 自定义图标属性 */
|
|
14
|
+
iconProps: PropType<ElIconProps>;
|
|
15
|
+
}, {
|
|
16
|
+
itemRef: import('vue').Ref<HTMLDivElement | null>;
|
|
17
|
+
subMenuRef: import('vue').Ref<HTMLDivElement | null>;
|
|
18
|
+
placement: import('vue').Ref<"rightEnd" | "leftStart" | "leftEnd" | undefined>;
|
|
19
|
+
handleItemClick: () => void;
|
|
20
|
+
handleItemMouseenter: () => void;
|
|
21
|
+
handleWrapperContext: (e: MouseEvent) => void;
|
|
22
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
|
+
itemClick: (_item: DropdownItem) => true;
|
|
24
|
+
wrapperContext: (_e: MouseEvent) => true;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
26
|
+
/** 菜单项数据 */
|
|
27
|
+
item: {
|
|
28
|
+
type: PropType<DropdownItem>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
/** 选中的菜单 */
|
|
32
|
+
selected: PropType<DropdownItem["command"]>;
|
|
33
|
+
/** 自定义图标属性 */
|
|
34
|
+
iconProps: PropType<ElIconProps>;
|
|
35
|
+
}>> & {
|
|
36
|
+
onItemClick?: ((_item: DropdownItem) => any) | undefined;
|
|
37
|
+
onWrapperContext?: ((_e: MouseEvent) => any) | undefined;
|
|
38
|
+
}, {}, {}>;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, createElementVNode, normalizeClass, withModifiers, renderSlot, createBlock, normalizeProps, mergeProps, withCtx, resolveDynamicComponent, normalizeStyle, toDisplayString, createVNode } from "vue";
|
|
2
|
+
import { ElIcon } from "element-plus";
|
|
3
|
+
import { ArrowRight } from "../../icons";
|
|
4
|
+
const _sfc_main = defineComponent({
|
|
5
|
+
name: "DropdownMenuItem",
|
|
6
|
+
components: { ElIcon, ArrowRight },
|
|
7
|
+
props: {
|
|
8
|
+
/** 菜单项数据 */
|
|
9
|
+
item: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
/** 选中的菜单 */
|
|
14
|
+
selected: [String, Number, Object],
|
|
15
|
+
/** 自定义图标属性 */
|
|
16
|
+
iconProps: Object
|
|
17
|
+
},
|
|
18
|
+
emits: {
|
|
19
|
+
itemClick: (_item) => true,
|
|
20
|
+
wrapperContext: (_e) => true
|
|
21
|
+
},
|
|
22
|
+
setup(props, { emit }) {
|
|
23
|
+
const itemRef = ref(null);
|
|
24
|
+
const subMenuRef = ref(null);
|
|
25
|
+
const placement = ref();
|
|
26
|
+
const handleItemClick = () => {
|
|
27
|
+
if (props.item.disabled) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
emit("itemClick", props.item);
|
|
31
|
+
};
|
|
32
|
+
const handleItemMouseenter = () => {
|
|
33
|
+
const subMenuEl = subMenuRef.value;
|
|
34
|
+
if (!subMenuEl || !itemRef.value) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const rect = itemRef.value.getBoundingClientRect();
|
|
38
|
+
const rightOver = rect.right + subMenuEl.offsetWidth > window.innerWidth;
|
|
39
|
+
const bottomOver = rect.top + subMenuEl.offsetHeight > window.innerHeight;
|
|
40
|
+
if (rightOver && bottomOver) {
|
|
41
|
+
placement.value = "leftEnd";
|
|
42
|
+
} else if (rightOver) {
|
|
43
|
+
placement.value = "leftStart";
|
|
44
|
+
} else if (bottomOver) {
|
|
45
|
+
placement.value = "rightEnd";
|
|
46
|
+
} else {
|
|
47
|
+
placement.value = void 0;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const handleWrapperContext = (e) => {
|
|
51
|
+
emit("wrapperContext", e);
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
itemRef,
|
|
55
|
+
subMenuRef,
|
|
56
|
+
placement,
|
|
57
|
+
handleItemClick,
|
|
58
|
+
handleItemMouseenter,
|
|
59
|
+
handleWrapperContext
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const _export_sfc = (sfc, props) => {
|
|
64
|
+
const target = sfc.__vccOpts || sfc;
|
|
65
|
+
for (const [key, val] of props) {
|
|
66
|
+
target[key] = val;
|
|
67
|
+
}
|
|
68
|
+
return target;
|
|
69
|
+
};
|
|
70
|
+
const _hoisted_1 = {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "ele-dropdown-menu-divider"
|
|
73
|
+
};
|
|
74
|
+
const _hoisted_2 = { key: 1 };
|
|
75
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
76
|
+
const _component_ElIcon = resolveComponent("ElIcon");
|
|
77
|
+
const _component_ArrowRight = resolveComponent("ArrowRight");
|
|
78
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
79
|
+
_ctx.item.divided ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true),
|
|
80
|
+
createElementVNode("div", {
|
|
81
|
+
ref: "itemRef",
|
|
82
|
+
class: normalizeClass([
|
|
83
|
+
"ele-dropdown-menu-item",
|
|
84
|
+
{ "is-disabled": !!_ctx.item.disabled },
|
|
85
|
+
{ "is-active": _ctx.selected === _ctx.item.command },
|
|
86
|
+
{ "is-danger": !!_ctx.item.danger }
|
|
87
|
+
]),
|
|
88
|
+
onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleItemClick && _ctx.handleItemClick(...args), ["stop"])),
|
|
89
|
+
onMouseenter: _cache[3] || (_cache[3] = (...args) => _ctx.handleItemMouseenter && _ctx.handleItemMouseenter(...args))
|
|
90
|
+
}, [
|
|
91
|
+
_ctx.item.slot && _ctx.item.slot !== "default" && _ctx.item.slot !== "subMenus" && _ctx.$slots[_ctx.item.slot] ? renderSlot(_ctx.$slots, _ctx.item.slot, {
|
|
92
|
+
key: 0,
|
|
93
|
+
item: _ctx.item
|
|
94
|
+
}) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
95
|
+
_ctx.item.icon ? (openBlock(), createBlock(_component_ElIcon, normalizeProps(mergeProps({ key: 0 }, { ..._ctx.iconProps || {}, ..._ctx.item.iconProps || {} })), {
|
|
96
|
+
default: withCtx(() => [
|
|
97
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.item.icon), {
|
|
98
|
+
style: normalizeStyle(_ctx.item.iconStyle)
|
|
99
|
+
}, null, 8, ["style"]))
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
}, 16)) : createCommentVNode("", true),
|
|
103
|
+
_ctx.item.title ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.item.title), 1)) : createCommentVNode("", true)
|
|
104
|
+
], 64)),
|
|
105
|
+
_ctx.item.children && _ctx.item.children.length ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
106
|
+
createVNode(_component_ElIcon, { class: "ele-dropdown-menu-item-arrow" }, {
|
|
107
|
+
default: withCtx(() => [
|
|
108
|
+
createVNode(_component_ArrowRight)
|
|
109
|
+
]),
|
|
110
|
+
_: 1
|
|
111
|
+
}),
|
|
112
|
+
createElementVNode("div", {
|
|
113
|
+
ref: "subMenuRef",
|
|
114
|
+
class: normalizeClass(["ele-dropdown-wrapper is-sub-menu", [
|
|
115
|
+
{ "is-right-end": _ctx.placement === "rightEnd" },
|
|
116
|
+
{ "is-left-start": _ctx.placement === "leftStart" },
|
|
117
|
+
{ "is-left-end": _ctx.placement === "leftEnd" }
|
|
118
|
+
]]),
|
|
119
|
+
onContextmenu: _cache[0] || (_cache[0] = (...args) => _ctx.handleWrapperContext && _ctx.handleWrapperContext(...args)),
|
|
120
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
121
|
+
}, ["stop"]))
|
|
122
|
+
}, [
|
|
123
|
+
renderSlot(_ctx.$slots, "subMenus")
|
|
124
|
+
], 34)
|
|
125
|
+
], 64)) : createCommentVNode("", true)
|
|
126
|
+
], 34)
|
|
127
|
+
], 64);
|
|
128
|
+
}
|
|
129
|
+
const dropdownMenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
130
|
+
export {
|
|
131
|
+
dropdownMenuItem as default
|
|
132
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ElIconProps, ElButtonProps } from '../../ele-app/el';
|
|
3
|
+
import { StyleValue } from '../../ele-app/types';
|
|
4
|
+
import { DropdownItem } from '../types';
|
|
5
|
+
|
|
6
|
+
declare const _default: import('vue').DefineComponent<{
|
|
7
|
+
/** 下拉菜单数据 */
|
|
8
|
+
items: {
|
|
9
|
+
type: PropType<DropdownItem[]>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
/** 选中的菜单 */
|
|
13
|
+
selected: PropType<DropdownItem["command"]>;
|
|
14
|
+
/** 自定义下拉菜单样式 */
|
|
15
|
+
menuStyle: PropType<StyleValue>;
|
|
16
|
+
/** 自定义图标属性 */
|
|
17
|
+
iconProps: PropType<ElIconProps>;
|
|
18
|
+
/** 尺寸 */
|
|
19
|
+
size: PropType<ElButtonProps["size"]>;
|
|
20
|
+
}, {
|
|
21
|
+
handleItemClick: (item: DropdownItem) => void;
|
|
22
|
+
handleWrapperContext: (e: MouseEvent) => void;
|
|
23
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
itemClick: (_item: DropdownItem) => true;
|
|
25
|
+
wrapperContext: (_e: MouseEvent) => true;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
27
|
+
/** 下拉菜单数据 */
|
|
28
|
+
items: {
|
|
29
|
+
type: PropType<DropdownItem[]>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
/** 选中的菜单 */
|
|
33
|
+
selected: PropType<DropdownItem["command"]>;
|
|
34
|
+
/** 自定义下拉菜单样式 */
|
|
35
|
+
menuStyle: PropType<StyleValue>;
|
|
36
|
+
/** 自定义图标属性 */
|
|
37
|
+
iconProps: PropType<ElIconProps>;
|
|
38
|
+
/** 尺寸 */
|
|
39
|
+
size: PropType<ElButtonProps["size"]>;
|
|
40
|
+
}>> & {
|
|
41
|
+
onItemClick?: ((_item: DropdownItem) => any) | undefined;
|
|
42
|
+
onWrapperContext?: ((_e: MouseEvent) => any) | undefined;
|
|
43
|
+
}, {}, {}>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, Fragment, renderList, createBlock, createSlots, withCtx, renderSlot, mergeProps, createVNode } from "vue";
|
|
2
|
+
import DropdownMenuItem from "./dropdown-menu-item";
|
|
3
|
+
const _sfc_main = defineComponent({
|
|
4
|
+
name: "DropdownMenus",
|
|
5
|
+
components: { DropdownMenuItem },
|
|
6
|
+
props: {
|
|
7
|
+
/** 下拉菜单数据 */
|
|
8
|
+
items: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
/** 选中的菜单 */
|
|
13
|
+
selected: [String, Number, Object],
|
|
14
|
+
/** 自定义下拉菜单样式 */
|
|
15
|
+
menuStyle: Object,
|
|
16
|
+
/** 自定义图标属性 */
|
|
17
|
+
iconProps: Object,
|
|
18
|
+
/** 尺寸 */
|
|
19
|
+
size: String
|
|
20
|
+
},
|
|
21
|
+
emits: {
|
|
22
|
+
itemClick: (_item) => true,
|
|
23
|
+
wrapperContext: (_e) => true
|
|
24
|
+
},
|
|
25
|
+
setup(_props, { emit }) {
|
|
26
|
+
const handleItemClick = (item) => {
|
|
27
|
+
if (item.disabled) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
emit("itemClick", item);
|
|
31
|
+
};
|
|
32
|
+
const handleWrapperContext = (e) => {
|
|
33
|
+
emit("wrapperContext", e);
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
handleItemClick,
|
|
37
|
+
handleWrapperContext
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const _export_sfc = (sfc, props) => {
|
|
42
|
+
const target = sfc.__vccOpts || sfc;
|
|
43
|
+
for (const [key, val] of props) {
|
|
44
|
+
target[key] = val;
|
|
45
|
+
}
|
|
46
|
+
return target;
|
|
47
|
+
};
|
|
48
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
49
|
+
const _component_DropdownMenus = resolveComponent("DropdownMenus", true);
|
|
50
|
+
const _component_DropdownMenuItem = resolveComponent("DropdownMenuItem");
|
|
51
|
+
return openBlock(), createElementBlock("div", {
|
|
52
|
+
class: normalizeClass([
|
|
53
|
+
"ele-dropdown-menu",
|
|
54
|
+
{ "is-small": _ctx.size === "small" },
|
|
55
|
+
{ "is-large": _ctx.size === "large" }
|
|
56
|
+
]),
|
|
57
|
+
style: normalizeStyle(_ctx.menuStyle)
|
|
58
|
+
}, [
|
|
59
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item) => {
|
|
60
|
+
return openBlock(), createBlock(_component_DropdownMenuItem, {
|
|
61
|
+
key: item.key == null ? JSON.stringify(item.command) : item.key,
|
|
62
|
+
item,
|
|
63
|
+
selected: _ctx.selected,
|
|
64
|
+
iconProps: _ctx.iconProps,
|
|
65
|
+
onItemClick: _ctx.handleItemClick,
|
|
66
|
+
onWrapperContext: _ctx.handleWrapperContext
|
|
67
|
+
}, createSlots({ _: 2 }, [
|
|
68
|
+
renderList(Object.keys(_ctx.$slots).filter(
|
|
69
|
+
(k) => "default" !== k && "subMenus" !== k
|
|
70
|
+
), (name) => {
|
|
71
|
+
return {
|
|
72
|
+
name,
|
|
73
|
+
fn: withCtx((slotProps) => [
|
|
74
|
+
renderSlot(_ctx.$slots, name, mergeProps({ ref_for: true }, slotProps || {}))
|
|
75
|
+
])
|
|
76
|
+
};
|
|
77
|
+
}),
|
|
78
|
+
item.children && item.children.length ? {
|
|
79
|
+
name: "subMenus",
|
|
80
|
+
fn: withCtx(() => [
|
|
81
|
+
createVNode(_component_DropdownMenus, {
|
|
82
|
+
items: item.children,
|
|
83
|
+
selected: _ctx.selected,
|
|
84
|
+
menuStyle: _ctx.menuStyle,
|
|
85
|
+
iconProps: _ctx.iconProps,
|
|
86
|
+
size: _ctx.size,
|
|
87
|
+
onItemClick: _ctx.handleItemClick,
|
|
88
|
+
onWrapperContext: _ctx.handleWrapperContext
|
|
89
|
+
}, createSlots({ _: 2 }, [
|
|
90
|
+
renderList(Object.keys(_ctx.$slots).filter(
|
|
91
|
+
(k) => "default" !== k && "subMenus" !== k
|
|
92
|
+
), (name) => {
|
|
93
|
+
return {
|
|
94
|
+
name,
|
|
95
|
+
fn: withCtx((slotProps) => [
|
|
96
|
+
renderSlot(_ctx.$slots, name, mergeProps({ ref_for: true }, slotProps || {}))
|
|
97
|
+
])
|
|
98
|
+
};
|
|
99
|
+
})
|
|
100
|
+
]), 1032, ["items", "selected", "menuStyle", "iconProps", "size", "onItemClick", "onWrapperContext"])
|
|
101
|
+
]),
|
|
102
|
+
key: "0"
|
|
103
|
+
} : void 0
|
|
104
|
+
]), 1032, ["item", "selected", "iconProps", "onItemClick", "onWrapperContext"]);
|
|
105
|
+
}), 128))
|
|
106
|
+
], 6);
|
|
107
|
+
}
|
|
108
|
+
const dropdownMenus = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
109
|
+
export {
|
|
110
|
+
dropdownMenus as default
|
|
111
|
+
};
|