@mingto/mt-ui 1.1.47 → 1.1.49
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 +140 -104
- package/dist/icon/assets/font/iconfont.json.d.ts +2207 -2207
- package/dist/image/index.d.ts +1 -18
- package/dist/image/src/image.d.ts +0 -7
- package/dist/image/src/image.vue.d.ts +2 -15
- package/dist/index.es.js +66 -84
- package/dist/index.umd.js +66 -84
- package/dist/message/index.d.ts +1 -1
- package/dist/message/src/message.d.ts +5 -5
- package/dist/poster/src/method.d.ts +4 -1
- package/dist/style.css +1277 -1284
- package/dist/tab/index.d.ts +3 -3
- package/dist/tab/src/tab.d.ts +1 -1
- package/dist/tab/src/tab.vue.d.ts +1 -1
- package/package.json +2 -2
package/dist/image/index.d.ts
CHANGED
|
@@ -27,10 +27,6 @@ export declare const MtImage: {
|
|
|
27
27
|
readonly type: BooleanConstructor;
|
|
28
28
|
readonly default: false;
|
|
29
29
|
};
|
|
30
|
-
readonly lazy: {
|
|
31
|
-
readonly type: BooleanConstructor;
|
|
32
|
-
readonly default: false;
|
|
33
|
-
};
|
|
34
30
|
}>> & Readonly<{
|
|
35
31
|
onError?: (() => any) | undefined;
|
|
36
32
|
onLoad?: (() => any) | undefined;
|
|
@@ -44,10 +40,7 @@ export declare const MtImage: {
|
|
|
44
40
|
readonly fit: "none" | "fill" | "contain" | "cover" | "scale-down";
|
|
45
41
|
readonly position: string;
|
|
46
42
|
readonly draggable: boolean;
|
|
47
|
-
|
|
48
|
-
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
49
|
-
imageRef: HTMLDivElement;
|
|
50
|
-
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
43
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
51
44
|
P: {};
|
|
52
45
|
B: {};
|
|
53
46
|
D: {};
|
|
@@ -82,10 +75,6 @@ export declare const MtImage: {
|
|
|
82
75
|
readonly type: BooleanConstructor;
|
|
83
76
|
readonly default: false;
|
|
84
77
|
};
|
|
85
|
-
readonly lazy: {
|
|
86
|
-
readonly type: BooleanConstructor;
|
|
87
|
-
readonly default: false;
|
|
88
|
-
};
|
|
89
78
|
}>> & Readonly<{
|
|
90
79
|
onError?: (() => any) | undefined;
|
|
91
80
|
onLoad?: (() => any) | undefined;
|
|
@@ -96,7 +85,6 @@ export declare const MtImage: {
|
|
|
96
85
|
readonly fit: "none" | "fill" | "contain" | "cover" | "scale-down";
|
|
97
86
|
readonly position: string;
|
|
98
87
|
readonly draggable: boolean;
|
|
99
|
-
readonly lazy: boolean;
|
|
100
88
|
}>;
|
|
101
89
|
__isFragment?: never;
|
|
102
90
|
__isTeleport?: never;
|
|
@@ -129,10 +117,6 @@ export declare const MtImage: {
|
|
|
129
117
|
readonly type: BooleanConstructor;
|
|
130
118
|
readonly default: false;
|
|
131
119
|
};
|
|
132
|
-
readonly lazy: {
|
|
133
|
-
readonly type: BooleanConstructor;
|
|
134
|
-
readonly default: false;
|
|
135
|
-
};
|
|
136
120
|
}>> & Readonly<{
|
|
137
121
|
onError?: (() => any) | undefined;
|
|
138
122
|
onLoad?: (() => any) | undefined;
|
|
@@ -146,7 +130,6 @@ export declare const MtImage: {
|
|
|
146
130
|
readonly fit: "none" | "fill" | "contain" | "cover" | "scale-down";
|
|
147
131
|
readonly position: string;
|
|
148
132
|
readonly draggable: boolean;
|
|
149
|
-
readonly lazy: boolean;
|
|
150
133
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
151
134
|
$slots: Readonly<{
|
|
152
135
|
error?: () => import('vue').VNode[];
|
|
@@ -45,13 +45,6 @@ declare const imageProps: {
|
|
|
45
45
|
readonly type: BooleanConstructor;
|
|
46
46
|
readonly default: false;
|
|
47
47
|
};
|
|
48
|
-
/**
|
|
49
|
-
* 懒加载
|
|
50
|
-
*/
|
|
51
|
-
readonly lazy: {
|
|
52
|
-
readonly type: BooleanConstructor;
|
|
53
|
-
readonly default: false;
|
|
54
|
-
};
|
|
55
48
|
};
|
|
56
49
|
export type ImageProps = ExtractPropTypes<typeof imageProps>;
|
|
57
50
|
export { imageProps };
|
|
@@ -6,9 +6,7 @@ declare function __VLS_template(): {
|
|
|
6
6
|
}> & {
|
|
7
7
|
error?: () => VNode[];
|
|
8
8
|
};
|
|
9
|
-
refs: {
|
|
10
|
-
imageRef: HTMLDivElement;
|
|
11
|
-
};
|
|
9
|
+
refs: {};
|
|
12
10
|
rootEl: HTMLDivElement;
|
|
13
11
|
};
|
|
14
12
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -40,10 +38,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
40
38
|
readonly type: BooleanConstructor;
|
|
41
39
|
readonly default: false;
|
|
42
40
|
};
|
|
43
|
-
readonly lazy: {
|
|
44
|
-
readonly type: BooleanConstructor;
|
|
45
|
-
readonly default: false;
|
|
46
|
-
};
|
|
47
41
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
48
42
|
error: () => any;
|
|
49
43
|
load: () => any;
|
|
@@ -75,10 +69,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
75
69
|
readonly type: BooleanConstructor;
|
|
76
70
|
readonly default: false;
|
|
77
71
|
};
|
|
78
|
-
readonly lazy: {
|
|
79
|
-
readonly type: BooleanConstructor;
|
|
80
|
-
readonly default: false;
|
|
81
|
-
};
|
|
82
72
|
}>> & Readonly<{
|
|
83
73
|
onError?: (() => any) | undefined;
|
|
84
74
|
onLoad?: (() => any) | undefined;
|
|
@@ -89,10 +79,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
89
79
|
readonly fit: "none" | "fill" | "contain" | "cover" | "scale-down";
|
|
90
80
|
readonly position: string;
|
|
91
81
|
readonly draggable: boolean;
|
|
92
|
-
|
|
93
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
94
|
-
imageRef: HTMLDivElement;
|
|
95
|
-
}, HTMLDivElement>;
|
|
82
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
96
83
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
97
84
|
export default _default;
|
|
98
85
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
package/dist/index.es.js
CHANGED
|
@@ -7204,13 +7204,6 @@ var imageProps = {
|
|
|
7204
7204
|
draggable: {
|
|
7205
7205
|
type: Boolean,
|
|
7206
7206
|
default: false
|
|
7207
|
-
},
|
|
7208
|
-
/**
|
|
7209
|
-
* 懒加载
|
|
7210
|
-
*/
|
|
7211
|
-
lazy: {
|
|
7212
|
-
type: Boolean,
|
|
7213
|
-
default: false
|
|
7214
7207
|
}
|
|
7215
7208
|
};
|
|
7216
7209
|
//#endregion
|
|
@@ -7231,16 +7224,16 @@ var MtImage = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
7231
7224
|
return [ns.b()];
|
|
7232
7225
|
});
|
|
7233
7226
|
const imageStyles = computed(() => {
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7227
|
+
const styles = {};
|
|
7228
|
+
Object.assign(styles, ns.cssVarBlock({
|
|
7229
|
+
...props.width ? { width: convertValueToViewportWidth(props.width) } : {},
|
|
7230
|
+
...props.height ? { height: convertValueToViewportWidth(props.height) } : {}
|
|
7231
|
+
}));
|
|
7232
|
+
return styles;
|
|
7238
7233
|
});
|
|
7239
7234
|
const hasLoadError = ref(false);
|
|
7240
7235
|
const isLoading = ref(true);
|
|
7241
7236
|
const imageSrc = ref("");
|
|
7242
|
-
const observer = ref(null);
|
|
7243
|
-
const imageRef = ref(null);
|
|
7244
7237
|
function loadImage() {
|
|
7245
7238
|
if (!props.src) {
|
|
7246
7239
|
isLoading.value = false;
|
|
@@ -7261,35 +7254,14 @@ var MtImage = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
7261
7254
|
hasLoadError.value = true;
|
|
7262
7255
|
emits("error");
|
|
7263
7256
|
}
|
|
7264
|
-
function initObserver() {
|
|
7265
|
-
if (!imageRef.value) return;
|
|
7266
|
-
observer.value = new IntersectionObserver((entries) => {
|
|
7267
|
-
entries.forEach((entry) => {
|
|
7268
|
-
if (entry.isIntersecting && !isLoading.value) {
|
|
7269
|
-
loadImage();
|
|
7270
|
-
observer.value?.unobserve(imageRef.value);
|
|
7271
|
-
}
|
|
7272
|
-
});
|
|
7273
|
-
}, { threshold: .1 });
|
|
7274
|
-
observer.value.observe(imageRef.value);
|
|
7275
|
-
}
|
|
7276
|
-
function handleImageChange() {
|
|
7277
|
-
if (props.lazy) initObserver();
|
|
7278
|
-
else loadImage();
|
|
7279
|
-
}
|
|
7280
7257
|
watch(() => props.src, () => {
|
|
7281
|
-
|
|
7258
|
+
loadImage();
|
|
7282
7259
|
});
|
|
7283
7260
|
onMounted(() => {
|
|
7284
|
-
|
|
7285
|
-
});
|
|
7286
|
-
onUnmounted(() => {
|
|
7287
|
-
observer.value?.disconnect();
|
|
7261
|
+
loadImage();
|
|
7288
7262
|
});
|
|
7289
7263
|
return (_ctx, _cache) => {
|
|
7290
7264
|
return openBlock(), createElementBlock("div", {
|
|
7291
|
-
ref_key: "imageRef",
|
|
7292
|
-
ref: imageRef,
|
|
7293
7265
|
class: normalizeClass(imageClasses.value),
|
|
7294
7266
|
style: normalizeStyle(imageStyles.value)
|
|
7295
7267
|
}, [
|
|
@@ -10317,8 +10289,12 @@ var MtPopover = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
10317
10289
|
*/
|
|
10318
10290
|
var posterComponent = defineComponent({
|
|
10319
10291
|
inheritAttrs: false,
|
|
10292
|
+
props: { dialogEvents: {
|
|
10293
|
+
type: Object,
|
|
10294
|
+
default: () => ({})
|
|
10295
|
+
} },
|
|
10320
10296
|
emits: ["close"],
|
|
10321
|
-
setup(
|
|
10297
|
+
setup(props, { slots, emit, attrs, expose }) {
|
|
10322
10298
|
/**
|
|
10323
10299
|
* 控制弹窗显示状态的响应式变量。
|
|
10324
10300
|
*/
|
|
@@ -10350,6 +10326,7 @@ var posterComponent = defineComponent({
|
|
|
10350
10326
|
return () => createVNode(MtDialog, {
|
|
10351
10327
|
modelValue: visible.value,
|
|
10352
10328
|
...attrs,
|
|
10329
|
+
...props.dialogEvents,
|
|
10353
10330
|
"onUpdate:modelValue": handleUpdateModelValue,
|
|
10354
10331
|
"onClosed": handleClosed,
|
|
10355
10332
|
"ref": dialogRef
|
|
@@ -10405,10 +10382,14 @@ function Poster(options) {
|
|
|
10405
10382
|
/**
|
|
10406
10383
|
* 合并弹窗组件的事件处理函数。
|
|
10407
10384
|
*/
|
|
10408
|
-
const dialogEvents = {
|
|
10409
|
-
options
|
|
10410
|
-
|
|
10411
|
-
|
|
10385
|
+
const dialogEvents = {
|
|
10386
|
+
...options.dialogEvents,
|
|
10387
|
+
onClose() {
|
|
10388
|
+
options.dialogEvents?.onClose?.();
|
|
10389
|
+
options?.events?.onClose?.();
|
|
10390
|
+
render(null, container);
|
|
10391
|
+
}
|
|
10392
|
+
};
|
|
10412
10393
|
document.body.appendChild(container);
|
|
10413
10394
|
/**
|
|
10414
10395
|
* 动态加载内容组件并渲染弹窗。
|
|
@@ -10421,7 +10402,7 @@ function Poster(options) {
|
|
|
10421
10402
|
});
|
|
10422
10403
|
dialogVNode = createVNode(posterComponent, {
|
|
10423
10404
|
...dialogProps,
|
|
10424
|
-
|
|
10405
|
+
dialogEvents
|
|
10425
10406
|
}, { default: () => contentVNode });
|
|
10426
10407
|
render(dialogVNode, container);
|
|
10427
10408
|
});
|
|
@@ -19514,8 +19495,7 @@ var MtTabs = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
19514
19495
|
const emits = __emit;
|
|
19515
19496
|
const ns = useNamespace("tabs");
|
|
19516
19497
|
const tabsRef = ref();
|
|
19517
|
-
const
|
|
19518
|
-
const lineStyles = ref({});
|
|
19498
|
+
const mounted = ref(false);
|
|
19519
19499
|
const currentTabName = computed({
|
|
19520
19500
|
get() {
|
|
19521
19501
|
return props.modelValue;
|
|
@@ -19530,50 +19510,40 @@ var MtTabs = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
19530
19510
|
onChange,
|
|
19531
19511
|
type: props.type
|
|
19532
19512
|
});
|
|
19533
|
-
|
|
19534
|
-
if (!tabsRef.value) return null;
|
|
19535
|
-
for (let index = 0; index < children.length; index++) {
|
|
19536
|
-
const child = children[index];
|
|
19537
|
-
if (!child.exposed || !isTabContext(child.exposed) || !child.exposed.isActive.value) continue;
|
|
19538
|
-
return tabsRef.value.querySelector(`#tab-${index}`);
|
|
19539
|
-
}
|
|
19540
|
-
return null;
|
|
19541
|
-
}
|
|
19542
|
-
async function updateActiveStyles() {
|
|
19543
|
-
await nextTick();
|
|
19544
|
-
const $el = getActiveTabElement();
|
|
19545
|
-
if (!$el) {
|
|
19546
|
-
barStyles.value = {};
|
|
19547
|
-
lineStyles.value = {};
|
|
19548
|
-
return;
|
|
19549
|
-
}
|
|
19550
|
-
barStyles.value = {
|
|
19551
|
-
width: `${$el.clientWidth}px`,
|
|
19552
|
-
left: `${$el.offsetLeft}px`
|
|
19553
|
-
};
|
|
19513
|
+
const barStyles = computed(() => {
|
|
19554
19514
|
const styles = {};
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
|
|
19515
|
+
if (tabsRef.value) children.forEach((child, index) => {
|
|
19516
|
+
const $el = tabsRef.value.querySelector(`#tab-${index}`);
|
|
19517
|
+
if (!$el) return;
|
|
19518
|
+
if (!child.exposed || !isTabContext(child.exposed) || !unref(child.exposed.isActive)) return;
|
|
19519
|
+
styles.width = `${$el.clientWidth}px`;
|
|
19520
|
+
styles.left = `${$el.offsetLeft}px`;
|
|
19521
|
+
});
|
|
19522
|
+
return styles;
|
|
19523
|
+
});
|
|
19524
|
+
const lineStyles = computed(() => {
|
|
19525
|
+
const styles = {};
|
|
19526
|
+
if (tabsRef.value) children.forEach((child, index) => {
|
|
19527
|
+
const $el = tabsRef.value.querySelector(`#tab-${index}`);
|
|
19528
|
+
if (!$el) return;
|
|
19529
|
+
if (!child.exposed || !isTabContext(child.exposed) || !unref(child.exposed.isActive)) return;
|
|
19530
|
+
const tabStyles = window.getComputedStyle($el);
|
|
19531
|
+
const paddingLeft = beParsedAsNumber(tabStyles.paddingLeft);
|
|
19532
|
+
const paddingRight = beParsedAsNumber(tabStyles.paddingRight);
|
|
19533
|
+
styles.width = `${Math.max($el.clientWidth - paddingLeft - paddingRight, 0)}px`;
|
|
19534
|
+
styles.left = `${$el.offsetLeft + paddingLeft}px`;
|
|
19535
|
+
});
|
|
19536
|
+
return styles;
|
|
19537
|
+
});
|
|
19560
19538
|
const tabsClasses = computed(() => {
|
|
19561
19539
|
return [ns.b(), ns.m(props.type)];
|
|
19562
19540
|
});
|
|
19563
19541
|
function onChange(tabName) {
|
|
19564
19542
|
currentTabName.value = tabName;
|
|
19565
19543
|
}
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
props.type
|
|
19570
|
-
], updateActiveStyles, { flush: "post" });
|
|
19571
|
-
onMounted(() => {
|
|
19572
|
-
updateActiveStyles();
|
|
19573
|
-
window.addEventListener("resize", updateActiveStyles);
|
|
19574
|
-
});
|
|
19575
|
-
onBeforeUnmount(() => {
|
|
19576
|
-
window.removeEventListener("resize", updateActiveStyles);
|
|
19544
|
+
onMounted(async () => {
|
|
19545
|
+
await nextTick();
|
|
19546
|
+
mounted.value = true;
|
|
19577
19547
|
});
|
|
19578
19548
|
return (_ctx, _cache) => {
|
|
19579
19549
|
return openBlock(), createElementBlock("div", {
|
|
@@ -19586,12 +19556,12 @@ var MtTabs = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
19586
19556
|
class: normalizeClass(unref(ns).e("active-bar")),
|
|
19587
19557
|
style: normalizeStyle(barStyles.value)
|
|
19588
19558
|
}, null, 6)) : createCommentVNode("", true),
|
|
19589
|
-
|
|
19559
|
+
renderSlot(_ctx.$slots, "default"),
|
|
19560
|
+
props.type === "line" ? (openBlock(), createElementBlock("span", {
|
|
19590
19561
|
key: 1,
|
|
19591
19562
|
class: normalizeClass(unref(ns).e("active-line")),
|
|
19592
19563
|
style: normalizeStyle(lineStyles.value)
|
|
19593
|
-
}, null, 6)) : createCommentVNode("", true)
|
|
19594
|
-
renderSlot(_ctx.$slots, "default")
|
|
19564
|
+
}, null, 6)) : createCommentVNode("", true)
|
|
19595
19565
|
], 2);
|
|
19596
19566
|
};
|
|
19597
19567
|
}
|
|
@@ -19738,6 +19708,12 @@ var MtTooltip = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
19738
19708
|
disabled: props.disabled,
|
|
19739
19709
|
visible: props.visible,
|
|
19740
19710
|
offset: props.offset,
|
|
19711
|
+
"show-arrow": props["visible-arrow"],
|
|
19712
|
+
"popper-options": props["popper-options"],
|
|
19713
|
+
"show-after": props["show-after"],
|
|
19714
|
+
"hide-after": props["hide-after"],
|
|
19715
|
+
"auto-close": props["auto-close"],
|
|
19716
|
+
"popper-class": props["popper-class"],
|
|
19741
19717
|
enterable: props.enterable,
|
|
19742
19718
|
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => emits("update:visible", $event))
|
|
19743
19719
|
}), createSlots({ _: 2 }, [unref(slots).default ? {
|
|
@@ -19757,6 +19733,12 @@ var MtTooltip = withInstall$1(/* @__PURE__ */ defineComponent({
|
|
|
19757
19733
|
"disabled",
|
|
19758
19734
|
"visible",
|
|
19759
19735
|
"offset",
|
|
19736
|
+
"show-arrow",
|
|
19737
|
+
"popper-options",
|
|
19738
|
+
"show-after",
|
|
19739
|
+
"hide-after",
|
|
19740
|
+
"auto-close",
|
|
19741
|
+
"popper-class",
|
|
19760
19742
|
"enterable"
|
|
19761
19743
|
]);
|
|
19762
19744
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -7235,13 +7235,6 @@
|
|
|
7235
7235
|
draggable: {
|
|
7236
7236
|
type: Boolean,
|
|
7237
7237
|
default: false
|
|
7238
|
-
},
|
|
7239
|
-
/**
|
|
7240
|
-
* 懒加载
|
|
7241
|
-
*/
|
|
7242
|
-
lazy: {
|
|
7243
|
-
type: Boolean,
|
|
7244
|
-
default: false
|
|
7245
7238
|
}
|
|
7246
7239
|
};
|
|
7247
7240
|
//#endregion
|
|
@@ -7262,16 +7255,16 @@
|
|
|
7262
7255
|
return [ns.b()];
|
|
7263
7256
|
});
|
|
7264
7257
|
const imageStyles = (0, vue.computed)(() => {
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7258
|
+
const styles = {};
|
|
7259
|
+
Object.assign(styles, ns.cssVarBlock({
|
|
7260
|
+
...props.width ? { width: convertValueToViewportWidth(props.width) } : {},
|
|
7261
|
+
...props.height ? { height: convertValueToViewportWidth(props.height) } : {}
|
|
7262
|
+
}));
|
|
7263
|
+
return styles;
|
|
7269
7264
|
});
|
|
7270
7265
|
const hasLoadError = (0, vue.ref)(false);
|
|
7271
7266
|
const isLoading = (0, vue.ref)(true);
|
|
7272
7267
|
const imageSrc = (0, vue.ref)("");
|
|
7273
|
-
const observer = (0, vue.ref)(null);
|
|
7274
|
-
const imageRef = (0, vue.ref)(null);
|
|
7275
7268
|
function loadImage() {
|
|
7276
7269
|
if (!props.src) {
|
|
7277
7270
|
isLoading.value = false;
|
|
@@ -7292,35 +7285,14 @@
|
|
|
7292
7285
|
hasLoadError.value = true;
|
|
7293
7286
|
emits("error");
|
|
7294
7287
|
}
|
|
7295
|
-
function initObserver() {
|
|
7296
|
-
if (!imageRef.value) return;
|
|
7297
|
-
observer.value = new IntersectionObserver((entries) => {
|
|
7298
|
-
entries.forEach((entry) => {
|
|
7299
|
-
if (entry.isIntersecting && !isLoading.value) {
|
|
7300
|
-
loadImage();
|
|
7301
|
-
observer.value?.unobserve(imageRef.value);
|
|
7302
|
-
}
|
|
7303
|
-
});
|
|
7304
|
-
}, { threshold: .1 });
|
|
7305
|
-
observer.value.observe(imageRef.value);
|
|
7306
|
-
}
|
|
7307
|
-
function handleImageChange() {
|
|
7308
|
-
if (props.lazy) initObserver();
|
|
7309
|
-
else loadImage();
|
|
7310
|
-
}
|
|
7311
7288
|
(0, vue.watch)(() => props.src, () => {
|
|
7312
|
-
|
|
7289
|
+
loadImage();
|
|
7313
7290
|
});
|
|
7314
7291
|
(0, vue.onMounted)(() => {
|
|
7315
|
-
|
|
7316
|
-
});
|
|
7317
|
-
(0, vue.onUnmounted)(() => {
|
|
7318
|
-
observer.value?.disconnect();
|
|
7292
|
+
loadImage();
|
|
7319
7293
|
});
|
|
7320
7294
|
return (_ctx, _cache) => {
|
|
7321
7295
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
7322
|
-
ref_key: "imageRef",
|
|
7323
|
-
ref: imageRef,
|
|
7324
7296
|
class: (0, vue.normalizeClass)(imageClasses.value),
|
|
7325
7297
|
style: (0, vue.normalizeStyle)(imageStyles.value)
|
|
7326
7298
|
}, [
|
|
@@ -10376,8 +10348,12 @@
|
|
|
10376
10348
|
*/
|
|
10377
10349
|
var posterComponent = (0, vue.defineComponent)({
|
|
10378
10350
|
inheritAttrs: false,
|
|
10351
|
+
props: { dialogEvents: {
|
|
10352
|
+
type: Object,
|
|
10353
|
+
default: () => ({})
|
|
10354
|
+
} },
|
|
10379
10355
|
emits: ["close"],
|
|
10380
|
-
setup(
|
|
10356
|
+
setup(props, { slots, emit, attrs, expose }) {
|
|
10381
10357
|
/**
|
|
10382
10358
|
* 控制弹窗显示状态的响应式变量。
|
|
10383
10359
|
*/
|
|
@@ -10409,6 +10385,7 @@
|
|
|
10409
10385
|
return () => (0, vue.createVNode)(MtDialog, {
|
|
10410
10386
|
modelValue: visible.value,
|
|
10411
10387
|
...attrs,
|
|
10388
|
+
...props.dialogEvents,
|
|
10412
10389
|
"onUpdate:modelValue": handleUpdateModelValue,
|
|
10413
10390
|
"onClosed": handleClosed,
|
|
10414
10391
|
"ref": dialogRef
|
|
@@ -10464,10 +10441,14 @@
|
|
|
10464
10441
|
/**
|
|
10465
10442
|
* 合并弹窗组件的事件处理函数。
|
|
10466
10443
|
*/
|
|
10467
|
-
const dialogEvents = {
|
|
10468
|
-
options
|
|
10469
|
-
(
|
|
10470
|
-
|
|
10444
|
+
const dialogEvents = {
|
|
10445
|
+
...options.dialogEvents,
|
|
10446
|
+
onClose() {
|
|
10447
|
+
options.dialogEvents?.onClose?.();
|
|
10448
|
+
options?.events?.onClose?.();
|
|
10449
|
+
(0, vue.render)(null, container);
|
|
10450
|
+
}
|
|
10451
|
+
};
|
|
10471
10452
|
document.body.appendChild(container);
|
|
10472
10453
|
/**
|
|
10473
10454
|
* 动态加载内容组件并渲染弹窗。
|
|
@@ -10480,7 +10461,7 @@
|
|
|
10480
10461
|
});
|
|
10481
10462
|
dialogVNode = (0, vue.createVNode)(posterComponent, {
|
|
10482
10463
|
...dialogProps,
|
|
10483
|
-
|
|
10464
|
+
dialogEvents
|
|
10484
10465
|
}, { default: () => contentVNode });
|
|
10485
10466
|
(0, vue.render)(dialogVNode, container);
|
|
10486
10467
|
});
|
|
@@ -19588,8 +19569,7 @@ triggerRef });
|
|
|
19588
19569
|
const emits = __emit;
|
|
19589
19570
|
const ns = useNamespace("tabs");
|
|
19590
19571
|
const tabsRef = (0, vue.ref)();
|
|
19591
|
-
const
|
|
19592
|
-
const lineStyles = (0, vue.ref)({});
|
|
19572
|
+
const mounted = (0, vue.ref)(false);
|
|
19593
19573
|
const currentTabName = (0, vue.computed)({
|
|
19594
19574
|
get() {
|
|
19595
19575
|
return props.modelValue;
|
|
@@ -19604,50 +19584,40 @@ triggerRef });
|
|
|
19604
19584
|
onChange,
|
|
19605
19585
|
type: props.type
|
|
19606
19586
|
});
|
|
19607
|
-
|
|
19608
|
-
if (!tabsRef.value) return null;
|
|
19609
|
-
for (let index = 0; index < children.length; index++) {
|
|
19610
|
-
const child = children[index];
|
|
19611
|
-
if (!child.exposed || !isTabContext(child.exposed) || !child.exposed.isActive.value) continue;
|
|
19612
|
-
return tabsRef.value.querySelector(`#tab-${index}`);
|
|
19613
|
-
}
|
|
19614
|
-
return null;
|
|
19615
|
-
}
|
|
19616
|
-
async function updateActiveStyles() {
|
|
19617
|
-
await (0, vue.nextTick)();
|
|
19618
|
-
const $el = getActiveTabElement();
|
|
19619
|
-
if (!$el) {
|
|
19620
|
-
barStyles.value = {};
|
|
19621
|
-
lineStyles.value = {};
|
|
19622
|
-
return;
|
|
19623
|
-
}
|
|
19624
|
-
barStyles.value = {
|
|
19625
|
-
width: `${$el.clientWidth}px`,
|
|
19626
|
-
left: `${$el.offsetLeft}px`
|
|
19627
|
-
};
|
|
19587
|
+
const barStyles = (0, vue.computed)(() => {
|
|
19628
19588
|
const styles = {};
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19633
|
-
|
|
19589
|
+
if (tabsRef.value) children.forEach((child, index) => {
|
|
19590
|
+
const $el = tabsRef.value.querySelector(`#tab-${index}`);
|
|
19591
|
+
if (!$el) return;
|
|
19592
|
+
if (!child.exposed || !isTabContext(child.exposed) || !(0, vue.unref)(child.exposed.isActive)) return;
|
|
19593
|
+
styles.width = `${$el.clientWidth}px`;
|
|
19594
|
+
styles.left = `${$el.offsetLeft}px`;
|
|
19595
|
+
});
|
|
19596
|
+
return styles;
|
|
19597
|
+
});
|
|
19598
|
+
const lineStyles = (0, vue.computed)(() => {
|
|
19599
|
+
const styles = {};
|
|
19600
|
+
if (tabsRef.value) children.forEach((child, index) => {
|
|
19601
|
+
const $el = tabsRef.value.querySelector(`#tab-${index}`);
|
|
19602
|
+
if (!$el) return;
|
|
19603
|
+
if (!child.exposed || !isTabContext(child.exposed) || !(0, vue.unref)(child.exposed.isActive)) return;
|
|
19604
|
+
const tabStyles = window.getComputedStyle($el);
|
|
19605
|
+
const paddingLeft = (0, _mingto_tools.beParsedAsNumber)(tabStyles.paddingLeft);
|
|
19606
|
+
const paddingRight = (0, _mingto_tools.beParsedAsNumber)(tabStyles.paddingRight);
|
|
19607
|
+
styles.width = `${Math.max($el.clientWidth - paddingLeft - paddingRight, 0)}px`;
|
|
19608
|
+
styles.left = `${$el.offsetLeft + paddingLeft}px`;
|
|
19609
|
+
});
|
|
19610
|
+
return styles;
|
|
19611
|
+
});
|
|
19634
19612
|
const tabsClasses = (0, vue.computed)(() => {
|
|
19635
19613
|
return [ns.b(), ns.m(props.type)];
|
|
19636
19614
|
});
|
|
19637
19615
|
function onChange(tabName) {
|
|
19638
19616
|
currentTabName.value = tabName;
|
|
19639
19617
|
}
|
|
19640
|
-
(0, vue.
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
props.type
|
|
19644
|
-
], updateActiveStyles, { flush: "post" });
|
|
19645
|
-
(0, vue.onMounted)(() => {
|
|
19646
|
-
updateActiveStyles();
|
|
19647
|
-
window.addEventListener("resize", updateActiveStyles);
|
|
19648
|
-
});
|
|
19649
|
-
(0, vue.onBeforeUnmount)(() => {
|
|
19650
|
-
window.removeEventListener("resize", updateActiveStyles);
|
|
19618
|
+
(0, vue.onMounted)(async () => {
|
|
19619
|
+
await (0, vue.nextTick)();
|
|
19620
|
+
mounted.value = true;
|
|
19651
19621
|
});
|
|
19652
19622
|
return (_ctx, _cache) => {
|
|
19653
19623
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
@@ -19660,12 +19630,12 @@ triggerRef });
|
|
|
19660
19630
|
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("active-bar")),
|
|
19661
19631
|
style: (0, vue.normalizeStyle)(barStyles.value)
|
|
19662
19632
|
}, null, 6)) : (0, vue.createCommentVNode)("", true),
|
|
19663
|
-
|
|
19633
|
+
(0, vue.renderSlot)(_ctx.$slots, "default"),
|
|
19634
|
+
props.type === "line" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
19664
19635
|
key: 1,
|
|
19665
19636
|
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("active-line")),
|
|
19666
19637
|
style: (0, vue.normalizeStyle)(lineStyles.value)
|
|
19667
|
-
}, null, 6)) : (0, vue.createCommentVNode)("", true)
|
|
19668
|
-
(0, vue.renderSlot)(_ctx.$slots, "default")
|
|
19638
|
+
}, null, 6)) : (0, vue.createCommentVNode)("", true)
|
|
19669
19639
|
], 2);
|
|
19670
19640
|
};
|
|
19671
19641
|
}
|
|
@@ -19816,6 +19786,12 @@ triggerRef });
|
|
|
19816
19786
|
disabled: props.disabled,
|
|
19817
19787
|
visible: props.visible,
|
|
19818
19788
|
offset: props.offset,
|
|
19789
|
+
"show-arrow": props["visible-arrow"],
|
|
19790
|
+
"popper-options": props["popper-options"],
|
|
19791
|
+
"show-after": props["show-after"],
|
|
19792
|
+
"hide-after": props["hide-after"],
|
|
19793
|
+
"auto-close": props["auto-close"],
|
|
19794
|
+
"popper-class": props["popper-class"],
|
|
19819
19795
|
enterable: props.enterable,
|
|
19820
19796
|
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => emits("update:visible", $event))
|
|
19821
19797
|
}), (0, vue.createSlots)({ _: 2 }, [(0, vue.unref)(slots).default ? {
|
|
@@ -19835,6 +19811,12 @@ triggerRef });
|
|
|
19835
19811
|
"disabled",
|
|
19836
19812
|
"visible",
|
|
19837
19813
|
"offset",
|
|
19814
|
+
"show-arrow",
|
|
19815
|
+
"popper-options",
|
|
19816
|
+
"show-after",
|
|
19817
|
+
"hide-after",
|
|
19818
|
+
"auto-close",
|
|
19819
|
+
"popper-class",
|
|
19838
19820
|
"enterable"
|
|
19839
19821
|
]);
|
|
19840
19822
|
};
|
package/dist/message/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const MtMessage: ((options: import('./src/message').MessageParamsNormalized | import('./src/message').MessageParamsNormalized["message"]) =>
|
|
1
|
+
export declare const MtMessage: ((options: import('./src/message').MessageParamsNormalized | import('./src/message').MessageParamsNormalized["message"]) => import('./src/message').MessageHandler) & Record<"error" | "success" | "warning", (options: import('./src/message').MessageParamsNormalized | import('./src/message').MessageParamsNormalized["message"]) => import('./src/message').MessageHandler> & {
|
|
2
2
|
closeAll: (type?: import('./src/message').MessageTypes) => void;
|
|
3
3
|
} & import('vue').Plugin;
|
|
4
4
|
export default MtMessage;
|
|
@@ -56,14 +56,14 @@ declare const messageProps: {
|
|
|
56
56
|
};
|
|
57
57
|
type MessageProps = ExtractPropTypes<typeof messageProps>;
|
|
58
58
|
type MessageInstance = InstanceType<typeof MessageConstructor>;
|
|
59
|
-
type MessageFunction = {
|
|
60
|
-
(options: MessageParamsNormalized | MessageParamsNormalized['message']): void;
|
|
61
|
-
} & Record<MessageTypes, (options: MessageParamsNormalized | MessageParamsNormalized['message']) => void> & {
|
|
62
|
-
closeAll: (type?: MessageTypes) => void;
|
|
63
|
-
};
|
|
64
59
|
interface MessageHandler {
|
|
65
60
|
close: () => void;
|
|
66
61
|
}
|
|
62
|
+
type MessageFunction = {
|
|
63
|
+
(options: MessageParamsNormalized | MessageParamsNormalized['message']): MessageHandler;
|
|
64
|
+
} & Record<MessageTypes, (options: MessageParamsNormalized | MessageParamsNormalized['message']) => MessageHandler> & {
|
|
65
|
+
closeAll: (type?: MessageTypes) => void;
|
|
66
|
+
};
|
|
67
67
|
type MessageParamsNormalized = Partial<Omit<MessageProps, 'id'>> & Pick<MessageProps, 'message'>;
|
|
68
68
|
export type { MessageFunction, MessageHandler, MessageInstance, MessageParamsNormalized, MessageProps, MessageTypes, };
|
|
69
69
|
export { messageProps, messageTypes, };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
2
|
import { DialogProps } from '../../dialog';
|
|
3
|
+
type DialogEvents = {
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* PosterOptions 接口定义了 Poster 函数的参数结构。
|
|
5
8
|
*/
|
|
@@ -25,7 +28,7 @@ interface PosterOptions {
|
|
|
25
28
|
/**
|
|
26
29
|
* 传递给弹窗组件的事件处理函数。
|
|
27
30
|
*/
|
|
28
|
-
dialogEvents?:
|
|
31
|
+
dialogEvents?: DialogEvents;
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
31
34
|
* PosterReturn 接口定义了 Poster 函数的返回值结构。
|