ll-plus 2.0.18 → 2.0.19
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/component.mjs +4 -0
- package/es/component.mjs.map +1 -1
- package/es/components/advanced-filtering/index.d.ts +1926 -1680
- package/es/components/advanced-filtering/src/advanced-filtering.d.ts +192 -192
- package/es/components/advanced-filtering/src/advanced-filtering.vue.d.ts +1206 -960
- package/es/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +480 -480
- package/es/components/advanced-filtering/src/components/advanced-filtering-tags.vue.d.ts +240 -240
- package/es/components/button/index.d.ts +246 -0
- package/es/components/button/src/button.vue.d.ts +246 -0
- package/es/components/button/src/button.vue2.mjs +3 -3
- package/es/components/button/src/button.vue2.mjs.map +1 -1
- package/es/components/checkbox/index.d.ts +84 -84
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +84 -84
- package/es/components/drawer/index.d.ts +17 -0
- package/es/components/drawer/index.mjs +3 -0
- package/es/components/drawer/index.mjs.map +1 -1
- package/es/components/drawer/src/components/second-confirmation/index.d.ts +2053 -0
- package/es/components/drawer/src/components/second-confirmation/index.mjs +11 -0
- package/es/components/drawer/src/components/second-confirmation/index.mjs.map +1 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.d.ts +24 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.mjs +39 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.mjs.map +1 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +2045 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.mjs +8 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.mjs.map +1 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue2.mjs +90 -0
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue2.mjs.map +1 -0
- package/es/components/drawer/src/components/second-confirmation/src/use-second-confirmation.d.ts +1 -0
- package/es/components/drawer/src/components/second-confirmation/src/use-second-confirmation.mjs +35 -0
- package/es/components/drawer/src/components/second-confirmation/src/use-second-confirmation.mjs.map +1 -0
- package/es/components/drawer/src/drawer.d.ts +4 -0
- package/es/components/drawer/src/drawer.mjs +25 -0
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +16 -0
- package/es/components/drawer/src/drawer.vue2.mjs +19 -1
- package/es/components/drawer/src/drawer.vue2.mjs.map +1 -1
- package/es/components/form/index.d.ts +240 -240
- package/es/components/form/src/form.d.ts +96 -96
- package/es/components/form/src/form.vue.d.ts +240 -240
- package/es/components/form-item/index.d.ts +24 -24
- package/es/components/form-item/src/form-item.vue.d.ts +24 -24
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +4 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/input/index.d.ts +31 -31
- package/es/components/input/src/input.vue.d.ts +31 -31
- package/es/components/input-number/index.d.ts +2 -2
- package/es/components/input-number/src/input-number.vue.d.ts +2 -2
- package/es/components/modal/index.d.ts +327 -4
- package/es/components/modal/src/modal.vue.d.ts +337 -14
- package/es/components/modal/src/modal.vue2.mjs +5 -4
- package/es/components/modal/src/modal.vue2.mjs.map +1 -1
- package/es/components/textarea/index.d.ts +237 -0
- package/es/components/textarea/index.mjs +10 -0
- package/es/components/textarea/index.mjs.map +1 -0
- package/es/components/textarea/src/textarea.d.ts +4 -0
- package/es/components/textarea/src/textarea.mjs +2 -0
- package/es/components/textarea/src/textarea.mjs.map +1 -0
- package/es/components/textarea/src/textarea.vue.d.ts +230 -0
- package/es/components/textarea/src/textarea.vue.mjs +8 -0
- package/es/components/textarea/src/textarea.vue.mjs.map +1 -0
- package/es/components/textarea/src/textarea.vue2.mjs +34 -0
- package/es/components/textarea/src/textarea.vue2.mjs.map +1 -0
- package/es/components/tree/index.d.ts +2 -2
- package/es/components/tree/src/tree.vue.d.ts +2 -2
- package/es/components/tree-search/index.d.ts +12 -0
- package/es/components/tree-search/src/config/tree-search.d.ts +4 -0
- package/es/components/tree-search/src/tree-search.vue.d.ts +12 -0
- package/es/index.mjs +4 -0
- package/es/index.mjs.map +1 -1
- package/es/utils/number.d.ts +1 -1
- package/index.full.js +297 -78
- package/index.full.min.js +12 -12
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +16 -16
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +296 -81
- package/lib/component.js +36 -32
- package/lib/component.js.map +1 -1
- package/lib/components/advanced-filtering/index.d.ts +1926 -1680
- package/lib/components/advanced-filtering/src/advanced-filtering.d.ts +192 -192
- package/lib/components/advanced-filtering/src/advanced-filtering.vue.d.ts +1206 -960
- package/lib/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +480 -480
- package/lib/components/advanced-filtering/src/components/advanced-filtering-tags.vue.d.ts +240 -240
- package/lib/components/button/index.d.ts +246 -0
- package/lib/components/button/src/button.vue.d.ts +246 -0
- package/lib/components/button/src/button.vue2.js +2 -2
- package/lib/components/button/src/button.vue2.js.map +1 -1
- package/lib/components/checkbox/index.d.ts +84 -84
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +84 -84
- package/lib/components/drawer/index.d.ts +17 -0
- package/lib/components/drawer/index.js +6 -0
- package/lib/components/drawer/index.js.map +1 -1
- package/lib/components/drawer/src/components/second-confirmation/index.d.ts +2053 -0
- package/lib/components/drawer/src/components/second-confirmation/index.js +18 -0
- package/lib/components/drawer/src/components/second-confirmation/index.js.map +1 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.d.ts +24 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.js +41 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.js.map +1 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +2045 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.js +12 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.js.map +1 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.vue2.js +94 -0
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.vue2.js.map +1 -0
- package/lib/components/drawer/src/components/second-confirmation/src/use-second-confirmation.d.ts +1 -0
- package/lib/components/drawer/src/components/second-confirmation/src/use-second-confirmation.js +37 -0
- package/lib/components/drawer/src/components/second-confirmation/src/use-second-confirmation.js.map +1 -0
- package/lib/components/drawer/src/drawer.d.ts +4 -0
- package/lib/components/drawer/src/drawer.js +25 -0
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +16 -0
- package/lib/components/drawer/src/drawer.vue2.js +19 -1
- package/lib/components/drawer/src/drawer.vue2.js.map +1 -1
- package/lib/components/form/index.d.ts +240 -240
- package/lib/components/form/src/form.d.ts +96 -96
- package/lib/components/form/src/form.vue.d.ts +240 -240
- package/lib/components/form-item/index.d.ts +24 -24
- package/lib/components/form-item/src/form-item.vue.d.ts +24 -24
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +59 -51
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/index.d.ts +31 -31
- package/lib/components/input/src/input.vue.d.ts +31 -31
- package/lib/components/input-number/index.d.ts +2 -2
- package/lib/components/input-number/src/input-number.vue.d.ts +2 -2
- package/lib/components/modal/index.d.ts +327 -4
- package/lib/components/modal/src/modal.vue.d.ts +337 -14
- package/lib/components/modal/src/modal.vue2.js +4 -3
- package/lib/components/modal/src/modal.vue2.js.map +1 -1
- package/lib/components/textarea/index.d.ts +237 -0
- package/lib/components/textarea/index.js +15 -0
- package/lib/components/textarea/index.js.map +1 -0
- package/lib/components/textarea/src/textarea.d.ts +4 -0
- package/lib/components/textarea/src/textarea.js +4 -0
- package/lib/components/textarea/src/textarea.js.map +1 -0
- package/lib/components/textarea/src/textarea.vue.d.ts +230 -0
- package/lib/components/textarea/src/textarea.vue.js +12 -0
- package/lib/components/textarea/src/textarea.vue.js.map +1 -0
- package/lib/components/textarea/src/textarea.vue2.js +38 -0
- package/lib/components/textarea/src/textarea.vue2.js.map +1 -0
- package/lib/components/tree/index.d.ts +2 -2
- package/lib/components/tree/src/tree.vue.d.ts +2 -2
- package/lib/components/tree-search/index.d.ts +12 -0
- package/lib/components/tree-search/src/config/tree-search.d.ts +4 -0
- package/lib/components/tree-search/src/tree-search.vue.d.ts +12 -0
- package/lib/index.js +59 -51
- package/lib/index.js.map +1 -1
- package/lib/utils/number.d.ts +1 -1
- package/package.json +1 -1
- package/theme-chalk/css/index.css +1 -1
- package/theme-chalk/css/second-confirmation.css +1 -0
- package/theme-chalk/css/select-single.css +0 -1
- package/theme-chalk/css/textarea.css +1 -0
- package/theme-chalk/fonts/iconfont.js +1 -1
- package/theme-chalk/fonts/iconfont.json +29 -1
- package/types/packages/components/advanced-filtering/index.d.ts +1926 -1680
- package/types/packages/components/advanced-filtering/src/advanced-filtering.d.ts +192 -192
- package/types/packages/components/advanced-filtering/src/advanced-filtering.vue.d.ts +1206 -960
- package/types/packages/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +480 -480
- package/types/packages/components/advanced-filtering/src/components/advanced-filtering-tags.vue.d.ts +240 -240
- package/types/packages/components/button/index.d.ts +246 -0
- package/types/packages/components/button/src/button.vue.d.ts +246 -0
- package/types/packages/components/checkbox/index.d.ts +84 -84
- package/types/packages/components/checkbox/src/checkbox-group.vue.d.ts +84 -84
- package/types/packages/components/drawer/index.d.ts +17 -0
- package/types/packages/components/drawer/src/components/second-confirmation/index.d.ts +2053 -0
- package/types/packages/components/drawer/src/components/second-confirmation/src/second-confirmation.d.ts +24 -0
- package/types/packages/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +2045 -0
- package/types/packages/components/drawer/src/components/second-confirmation/src/use-second-confirmation.d.ts +1 -0
- package/types/packages/components/drawer/src/drawer.d.ts +4 -0
- package/types/packages/components/drawer/src/drawer.vue.d.ts +16 -0
- package/types/packages/components/form/index.d.ts +240 -240
- package/types/packages/components/form/src/form.d.ts +96 -96
- package/types/packages/components/form/src/form.vue.d.ts +240 -240
- package/types/packages/components/form-item/index.d.ts +24 -24
- package/types/packages/components/form-item/src/form-item.vue.d.ts +24 -24
- package/types/packages/components/index.d.ts +1 -0
- package/types/packages/components/input/index.d.ts +31 -31
- package/types/packages/components/input/src/input.vue.d.ts +31 -31
- package/types/packages/components/input-number/index.d.ts +2 -2
- package/types/packages/components/input-number/src/input-number.vue.d.ts +2 -2
- package/types/packages/components/modal/index.d.ts +327 -4
- package/types/packages/components/modal/src/modal.vue.d.ts +337 -14
- package/types/packages/components/textarea/index.d.ts +237 -0
- package/types/packages/components/textarea/src/textarea.d.ts +4 -0
- package/types/packages/components/textarea/src/textarea.vue.d.ts +230 -0
- package/types/packages/components/tree/index.d.ts +2 -2
- package/types/packages/components/tree/src/tree.vue.d.ts +2 -2
- package/types/packages/components/tree-search/index.d.ts +12 -0
- package/types/packages/components/tree-search/src/config/tree-search.d.ts +4 -0
- package/types/packages/components/tree-search/src/tree-search.vue.d.ts +12 -0
- package/types/packages/utils/number.d.ts +1 -1
package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from './second-confirmation.vue2.mjs';
|
|
2
|
+
import _export_sfc from '../../../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
var SecondConfirmation = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "second-confirmation.vue"]]);
|
|
6
|
+
|
|
7
|
+
export { SecondConfirmation as default };
|
|
8
|
+
//# sourceMappingURL=second-confirmation.vue.mjs.map
|
package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"second-confirmation.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue2.mjs
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, normalizeClass, withCtx, renderSlot, createElementVNode, createVNode, normalizeProps, guardReactiveProps, toDisplayString } from 'vue';
|
|
2
|
+
import '../../../../../index.mjs';
|
|
3
|
+
import { theme } from 'ant-design-vue';
|
|
4
|
+
import { secondConfirmationProps } from './second-confirmation.mjs';
|
|
5
|
+
import '../../../../../../utils/index.mjs';
|
|
6
|
+
import { createNamespace } from '../../../../../../utils/create-namespace.mjs';
|
|
7
|
+
import { LlModal } from '../../../../../modal/index.mjs';
|
|
8
|
+
import { LlIcon } from '../../../../../icon/index.mjs';
|
|
9
|
+
|
|
10
|
+
"use strict";
|
|
11
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
...{ name: "LlSecondConfirmation" },
|
|
13
|
+
__name: "second-confirmation",
|
|
14
|
+
props: secondConfirmationProps,
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const bem = createNamespace("second-confirmation");
|
|
17
|
+
const props = __props;
|
|
18
|
+
const warningColor = theme.defaultConfig.token.colorWarning;
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createBlock(unref(LlModal), {
|
|
21
|
+
open: props.open,
|
|
22
|
+
loading: props.loading,
|
|
23
|
+
title: props.title,
|
|
24
|
+
"confirm-text": props.confirmText,
|
|
25
|
+
"cancel-text": props.cancelText,
|
|
26
|
+
width: 500,
|
|
27
|
+
"root-class-name": unref(bem).b(),
|
|
28
|
+
class: normalizeClass("confirm-modal"),
|
|
29
|
+
onCancel: props.onCancel,
|
|
30
|
+
onOk: props.onConfirm
|
|
31
|
+
}, {
|
|
32
|
+
default: withCtx(() => [
|
|
33
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
34
|
+
createElementVNode(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
class: normalizeClass(unref(bem).e("warpper"))
|
|
38
|
+
},
|
|
39
|
+
[
|
|
40
|
+
createElementVNode(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
class: normalizeClass(unref(bem).e("container"))
|
|
44
|
+
},
|
|
45
|
+
[
|
|
46
|
+
createVNode(
|
|
47
|
+
unref(LlIcon),
|
|
48
|
+
normalizeProps(guardReactiveProps(
|
|
49
|
+
props.icon || {
|
|
50
|
+
iconName: "icon-warning",
|
|
51
|
+
color: unref(warningColor),
|
|
52
|
+
class: ["mr-20px"],
|
|
53
|
+
style: { "font-size": "30px" }
|
|
54
|
+
}
|
|
55
|
+
)),
|
|
56
|
+
null,
|
|
57
|
+
16
|
|
58
|
+
/* FULL_PROPS */
|
|
59
|
+
),
|
|
60
|
+
renderSlot(_ctx.$slots, "message", {}, () => [
|
|
61
|
+
createElementVNode(
|
|
62
|
+
"span",
|
|
63
|
+
{
|
|
64
|
+
class: normalizeClass(unref(bem).e("text"))
|
|
65
|
+
},
|
|
66
|
+
toDisplayString(props.message),
|
|
67
|
+
3
|
|
68
|
+
/* TEXT, CLASS */
|
|
69
|
+
)
|
|
70
|
+
])
|
|
71
|
+
],
|
|
72
|
+
2
|
|
73
|
+
/* CLASS */
|
|
74
|
+
),
|
|
75
|
+
renderSlot(_ctx.$slots, "extra")
|
|
76
|
+
],
|
|
77
|
+
2
|
|
78
|
+
/* CLASS */
|
|
79
|
+
)
|
|
80
|
+
])
|
|
81
|
+
]),
|
|
82
|
+
_: 3
|
|
83
|
+
/* FORWARDED */
|
|
84
|
+
}, 8, ["open", "loading", "title", "confirm-text", "cancel-text", "root-class-name", "onCancel", "onOk"]);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export { _sfc_main as default };
|
|
90
|
+
//# sourceMappingURL=second-confirmation.vue2.mjs.map
|
package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue2.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"second-confirmation.vue2.mjs","sources":["../../../../../../../../packages/components/drawer/src/components/second-confirmation/src/second-confirmation.vue"],"sourcesContent":["<template>\n <ll-modal\n :open=\"props.open\"\n :loading=\"props.loading\"\n :title=\"props.title\"\n :confirm-text=\"props.confirmText\"\n :cancel-text=\"props.cancelText\"\n :width=\"500\"\n :root-class-name=\"bem.b()\"\n :class=\"'confirm-modal'\"\n @cancel=\"props.onCancel\"\n @ok=\"props.onConfirm\"\n >\n <slot>\n <div :class=\"bem.e('warpper')\">\n <div :class=\"bem.e('container')\">\n <ll-icon\n v-bind=\"\n props.icon || {\n iconName: 'icon-warning',\n color: warningColor,\n class: ['mr-20px'],\n style: { 'font-size': '30px' }\n }\n \"\n />\n <slot name=\"message\">\n <span :class=\"bem.e('text')\">\n {{ props.message }}\n </span>\n </slot>\n </div>\n <slot name=\"extra\"> </slot>\n </div>\n </slot>\n </ll-modal>\n</template>\n\n<script setup lang=\"ts\">\nimport { LlModal, LlIcon } from '@ll-plus/components'\nimport { theme } from 'ant-design-vue'\nimport { secondConfirmationProps } from './second-confirmation'\nimport { createNamespace } from '@ll-plus/utils'\ndefineOptions({ name: 'LlSecondConfirmation' })\nconst bem = createNamespace('second-confirmation')\nconst props = defineProps(secondConfirmationProps)\n\nconst warningColor = theme.defaultConfig.token.colorWarning\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4CA,IAAM,MAAA,GAAA,GAAM,gBAAgB,qBAAqB,CAAA,CAAA;AACjD,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAM,MAAA,YAAA,GAAe,KAAM,CAAA,aAAA,CAAc,KAAM,CAAA,YAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/es/components/drawer/src/components/second-confirmation/src/use-second-confirmation.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSecondConfirmation: (options: any) => Promise<unknown>;
|
package/es/components/drawer/src/components/second-confirmation/src/use-second-confirmation.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createApp } from 'vue';
|
|
2
|
+
import SecondConfirmation from './second-confirmation.vue.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
const useSecondConfirmation = (options) => {
|
|
6
|
+
const { title, message, confirmText, cancelText, icon = null } = options;
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
const confirmInstance = createApp(SecondConfirmation, {
|
|
9
|
+
open: true,
|
|
10
|
+
title: title || "\u6E29\u99A8\u63D0\u793A",
|
|
11
|
+
message: message || "\u4F60\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539\uFF0C\u786E\u5B9A\u5173\u95ED\uFF1F",
|
|
12
|
+
confirmText,
|
|
13
|
+
cancelText,
|
|
14
|
+
icon,
|
|
15
|
+
onConfirm: () => {
|
|
16
|
+
resolve(true);
|
|
17
|
+
unmount();
|
|
18
|
+
},
|
|
19
|
+
onCancel: () => {
|
|
20
|
+
reject(new Error());
|
|
21
|
+
unmount();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const unmount = () => {
|
|
25
|
+
confirmInstance.unmount();
|
|
26
|
+
document.body.removeChild(parentNode);
|
|
27
|
+
};
|
|
28
|
+
const parentNode = document.createElement("div");
|
|
29
|
+
document.body.appendChild(parentNode);
|
|
30
|
+
confirmInstance.mount(parentNode);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { useSecondConfirmation };
|
|
35
|
+
//# sourceMappingURL=use-second-confirmation.mjs.map
|
package/es/components/drawer/src/components/second-confirmation/src/use-second-confirmation.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-second-confirmation.mjs","sources":["../../../../../../../../packages/components/drawer/src/components/second-confirmation/src/use-second-confirmation.ts"],"sourcesContent":["import { createApp } from 'vue'\nimport SecondConfirmation from './second-confirmation.vue'\nexport const useSecondConfirmation = options => {\n const { title, message, confirmText, cancelText, icon = null } = options\n return new Promise((resolve, reject) => {\n // 实例化组件,createApp第二个参数是props\n const confirmInstance = createApp(SecondConfirmation, {\n open: true,\n title: title || '温馨提示',\n message: message || '你有未保存的更改,确定关闭?',\n confirmText,\n cancelText,\n icon,\n onConfirm: () => {\n resolve(true)\n unmount()\n },\n onCancel: () => {\n reject(new Error())\n unmount()\n }\n })\n\n // 卸载组件\n const unmount = () => {\n confirmInstance.unmount()\n document.body.removeChild(parentNode)\n }\n // 创建一个挂载容器\n const parentNode = document.createElement('div')\n document.body.appendChild(parentNode)\n // 挂载组件\n confirmInstance.mount(parentNode)\n })\n}\n"],"names":[],"mappings":";;;;AAEO,MAAM,wBAAwB,CAAW,OAAA,KAAA;AAC9C,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,aAAa,UAAY,EAAA,IAAA,GAAO,MAAS,GAAA,OAAA,CAAA;AACjE,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAW,KAAA;AAEtC,IAAM,MAAA,eAAA,GAAkB,UAAU,kBAAoB,EAAA;AAAA,MACpD,IAAM,EAAA,IAAA;AAAA,MACN,OAAO,KAAS,IAAA,0BAAA;AAAA,MAChB,SAAS,OAAW,IAAA,sFAAA;AAAA,MACpB,WAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,MAAM;AACf,QAAA,OAAA,CAAQ,IAAI,CAAA,CAAA;AACZ,QAAQ,OAAA,EAAA,CAAA;AAAA,OACV;AAAA,MACA,UAAU,MAAM;AACd,QAAO,MAAA,CAAA,IAAI,OAAO,CAAA,CAAA;AAClB,QAAQ,OAAA,EAAA,CAAA;AAAA,OACV;AAAA,KACD,CAAA,CAAA;AAGD,IAAA,MAAM,UAAU,MAAM;AACpB,MAAA,eAAA,CAAgB,OAAQ,EAAA,CAAA;AACxB,MAAS,QAAA,CAAA,IAAA,CAAK,YAAY,UAAU,CAAA,CAAA;AAAA,KACtC,CAAA;AAEA,IAAM,MAAA,UAAA,GAAa,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA,CAAA;AAC/C,IAAS,QAAA,CAAA,IAAA,CAAK,YAAY,UAAU,CAAA,CAAA;AAEpC,IAAA,eAAA,CAAgB,MAAM,UAAU,CAAA,CAAA;AAAA,GACjC,CAAA,CAAA;AACH;;;;"}
|
|
@@ -15,6 +15,10 @@ export declare const drawerProps: {
|
|
|
15
15
|
readonly cancelText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "取消", boolean>;
|
|
16
16
|
readonly showCancel: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
17
17
|
readonly showFooter: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
18
|
+
readonly useClose: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
19
|
+
readonly cancelConfirm: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
20
|
+
readonly useCancelConfirm: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
21
|
+
readonly cancelConfirmOptions: import("ll-plus/es/utils").EpPropFinalized<ObjectConstructor, unknown, unknown, null, boolean>;
|
|
18
22
|
};
|
|
19
23
|
export declare const drawerEmits: {
|
|
20
24
|
/**
|
|
@@ -58,6 +58,31 @@ const drawerProps = buildProps({
|
|
|
58
58
|
showFooter: {
|
|
59
59
|
type: Boolean,
|
|
60
60
|
default: true
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* @description 区分关闭与取消方法
|
|
64
|
+
*/
|
|
65
|
+
useClose: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* @description 显示取消二次确认
|
|
71
|
+
*/
|
|
72
|
+
cancelConfirm: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: false
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* @description 使用取消二次确认
|
|
78
|
+
*/
|
|
79
|
+
useCancelConfirm: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
cancelConfirmOptions: {
|
|
84
|
+
type: Object,
|
|
85
|
+
default: null
|
|
61
86
|
}
|
|
62
87
|
});
|
|
63
88
|
const drawerEmits = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.mjs","sources":["../../../../../packages/components/drawer/src/drawer.ts"],"sourcesContent":["import { buildProps } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Drawer from './drawer.vue'\nexport const drawerOptions = {\n destroyOnClose: true,\n width: '560px',\n keyboard: false,\n maskClosable: false,\n mask: true\n}\nexport const drawerProps = buildProps({\n /**\n * @description 开启抽屉\n */\n open: {\n type: Boolean,\n default: false\n },\n /**\n * @description 标题\n */\n title: {\n type: String,\n default: '新增'\n },\n /**\n * @description 加载状态\n */\n loading: {\n type: Boolean,\n default: false\n },\n /**\n * @description 确认按钮文字\n */\n confirmText: {\n type: String,\n default: '确认'\n },\n /**\n * @description 取消按钮文字\n */\n cancelText: {\n type: String,\n default: '取消'\n },\n /**\n * @description 显示取消按钮\n */\n showCancel: {\n type: Boolean,\n default: true\n },\n /**\n * @description 显示底部\n */\n showFooter: {\n type: Boolean,\n default: true\n }\n} as const)\n\nexport const drawerEmits = {\n /**\n * @description 点击取消时触发\n */\n cancel: () => true,\n /**\n * @description 点击确认时触发\n */\n confirm: () => true,\n /**\n * @description 抽屉关闭时触发\n */\n close: () => true,\n 'update:open': () => true\n} as const\n\n// props\nexport type DrawerProps = ExtractPropTypes<typeof drawerProps>\n\n// emits\nexport type DrawerEmits = typeof drawerEmits\n\n// instance\nexport type DrawerInstance = InstanceType<typeof Drawer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vB;;;;"}
|
|
1
|
+
{"version":3,"file":"drawer.mjs","sources":["../../../../../packages/components/drawer/src/drawer.ts"],"sourcesContent":["import { buildProps } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Drawer from './drawer.vue'\nexport const drawerOptions = {\n destroyOnClose: true,\n width: '560px',\n keyboard: false,\n maskClosable: false,\n mask: true\n}\nexport const drawerProps = buildProps({\n /**\n * @description 开启抽屉\n */\n open: {\n type: Boolean,\n default: false\n },\n /**\n * @description 标题\n */\n title: {\n type: String,\n default: '新增'\n },\n /**\n * @description 加载状态\n */\n loading: {\n type: Boolean,\n default: false\n },\n /**\n * @description 确认按钮文字\n */\n confirmText: {\n type: String,\n default: '确认'\n },\n /**\n * @description 取消按钮文字\n */\n cancelText: {\n type: String,\n default: '取消'\n },\n /**\n * @description 显示取消按钮\n */\n showCancel: {\n type: Boolean,\n default: true\n },\n /**\n * @description 显示底部\n */\n showFooter: {\n type: Boolean,\n default: true\n },\n /**\n * @description 区分关闭与取消方法\n */\n useClose: {\n type: Boolean,\n default: false\n },\n /**\n * @description 显示取消二次确认\n */\n cancelConfirm: {\n type: Boolean,\n default: false\n },\n /**\n * @description 使用取消二次确认\n */\n useCancelConfirm: {\n type: Boolean,\n default: false\n },\n cancelConfirmOptions: {\n type: Object,\n default: null\n }\n} as const)\n\nexport const drawerEmits = {\n /**\n * @description 点击取消时触发\n */\n cancel: () => true,\n /**\n * @description 点击确认时触发\n */\n confirm: () => true,\n /**\n * @description 抽屉关闭时触发\n */\n close: () => true,\n 'update:open': () => true\n} as const\n\n// props\nexport type DrawerProps = ExtractPropTypes<typeof drawerProps>\n\n// emits\nexport type DrawerEmits = typeof drawerEmits\n\n// instance\nexport type DrawerInstance = InstanceType<typeof Drawer>\n"],"names":[],"mappings":";;;;AAIO,MAAM,aAAgB,GAAA;AAAA,EAC3B,cAAgB,EAAA,IAAA;AAAA,EAChB,KAAO,EAAA,OAAA;AAAA,EACP,QAAU,EAAA,KAAA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AAA;AAAA,IACpB,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AACF,CAAU,EAAA;AAEH,MAAM,WAAc,GAAA;AAAA;AAAA;AAAA;AAAA,EAIzB,QAAQ,MAAM,IAAA;AAAA;AAAA;AAAA;AAAA,EAId,SAAS,MAAM,IAAA;AAAA;AAAA;AAAA;AAAA,EAIf,OAAO,MAAM,IAAA;AAAA,EACb,eAAe,MAAM,IAAA;AACvB;;;;"}
|
|
@@ -6,6 +6,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
readonly cancelText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "取消", boolean>;
|
|
7
7
|
readonly showCancel: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
8
8
|
readonly showFooter: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
9
|
+
readonly useClose: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
10
|
+
readonly cancelConfirm: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
11
|
+
readonly useCancelConfirm: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
12
|
+
readonly cancelConfirmOptions: import("ll-plus/es/utils").EpPropFinalized<ObjectConstructor, unknown, unknown, null, boolean>;
|
|
9
13
|
}, {
|
|
10
14
|
props: import("@vue/shared").LooseRequired<{
|
|
11
15
|
readonly title: string;
|
|
@@ -15,6 +19,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
19
|
readonly confirmText: string;
|
|
16
20
|
readonly cancelText: string;
|
|
17
21
|
readonly showCancel: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
22
|
+
readonly useClose: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
23
|
+
readonly cancelConfirm: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
24
|
+
readonly useCancelConfirm: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
25
|
+
readonly cancelConfirmOptions: Record<string, any>;
|
|
18
26
|
readonly "onUpdate:open"?: (() => any) | undefined;
|
|
19
27
|
readonly onClose?: (() => any) | undefined;
|
|
20
28
|
readonly onConfirm?: (() => any) | undefined;
|
|
@@ -530,6 +538,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
530
538
|
readonly cancelText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "取消", boolean>;
|
|
531
539
|
readonly showCancel: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
532
540
|
readonly showFooter: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
541
|
+
readonly useClose: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
542
|
+
readonly cancelConfirm: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
543
|
+
readonly useCancelConfirm: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
544
|
+
readonly cancelConfirmOptions: import("ll-plus/es/utils").EpPropFinalized<ObjectConstructor, unknown, unknown, null, boolean>;
|
|
533
545
|
}>> & {
|
|
534
546
|
"onUpdate:open"?: (() => any) | undefined;
|
|
535
547
|
onClose?: (() => any) | undefined;
|
|
@@ -543,5 +555,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
543
555
|
readonly confirmText: string;
|
|
544
556
|
readonly cancelText: string;
|
|
545
557
|
readonly showCancel: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
558
|
+
readonly useClose: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
559
|
+
readonly cancelConfirm: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
560
|
+
readonly useCancelConfirm: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
561
|
+
readonly cancelConfirmOptions: Record<string, any>;
|
|
546
562
|
}, {}>;
|
|
547
563
|
export default _default;
|
|
@@ -3,7 +3,9 @@ import { Drawer } from 'ant-design-vue';
|
|
|
3
3
|
import '../../../utils/index.mjs';
|
|
4
4
|
import { omit, throttle } from 'lodash-es';
|
|
5
5
|
import { drawerProps, drawerEmits, drawerOptions } from './drawer.mjs';
|
|
6
|
+
import './components/second-confirmation/index.mjs';
|
|
6
7
|
import { createNamespace } from '../../../utils/create-namespace.mjs';
|
|
8
|
+
import { useSecondConfirmation } from './components/second-confirmation/src/use-second-confirmation.mjs';
|
|
7
9
|
|
|
8
10
|
"use strict";
|
|
9
11
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -24,10 +26,26 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
26
|
...omit({ ...attrs }, [...Object.keys(drawerProps), "rootClassName"])
|
|
25
27
|
}));
|
|
26
28
|
const handleClose = () => {
|
|
27
|
-
|
|
29
|
+
if (props.useClose) {
|
|
30
|
+
emits("close");
|
|
31
|
+
} else {
|
|
32
|
+
handleCancel();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
28
35
|
emits("update:open");
|
|
29
36
|
};
|
|
30
37
|
const handleCancel = () => {
|
|
38
|
+
if (props.useCancelConfirm && props.cancelConfirm) {
|
|
39
|
+
useSecondConfirmation(
|
|
40
|
+
props.cancelConfirmOptions || {
|
|
41
|
+
title: "\u6E29\u99A8\u63D0\u793A",
|
|
42
|
+
message: "\u4F60\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539\uFF0C\u786E\u5B9A\u5173\u95ED\uFF1F"
|
|
43
|
+
}
|
|
44
|
+
).then(async () => {
|
|
45
|
+
emits("cancel");
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
31
49
|
emits("cancel");
|
|
32
50
|
};
|
|
33
51
|
const handleConfirm = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.vue2.mjs","sources":["../../../../../packages/components/drawer/src/drawer.vue"],"sourcesContent":["<template>\n <Drawer\n v-bind=\"getBindValue\"\n :title=\"props.title\"\n :open=\"props.open\"\n :root-class-name=\"bem.b()\"\n @close=\"handleClose\"\n >\n <template #title>\n <slot name=\"title\" />\n </template>\n <template #extra>\n <slot name=\"extra\" />\n </template>\n <div :class=\"bem.e('container')\">\n <div\n ref=\"content\"\n :style=\"{ marginBottom: props.showFooter ? '72px' : 0 }\"\n :class=\"[bem.e('content'), symbolClass]\"\n >\n <slot />\n </div>\n <div\n v-if=\"props.showFooter\"\n :class=\"[bem.e('footer'), hasScroll ? bem.is('has-scroll') : '']\"\n >\n <slot name=\"footer\">\n <div :class=\"bem.e('footer-left')\">\n <slot name=\"footer-left\" />\n </div>\n <div :class=\"bem.e('footer-right')\">\n <slot name=\"footer-right\">\n <ll-button\n v-if=\"showCancel\"\n :class=\"bem.m('cancel')\"\n :label=\"props.cancelText\"\n @click=\"handleCancel\"\n >\n </ll-button>\n <ll-button\n type=\"primary\"\n :loading=\"props.loading\"\n :label=\"props.confirmText\"\n @click=\"handleConfirm\"\n >\n </ll-button>\n </slot>\n </div>\n </slot>\n </div>\n </div>\n </Drawer>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch, nextTick, useAttrs } from 'vue'\nimport { Drawer } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { throttle, omit } from 'lodash-es'\nimport { drawerProps, drawerEmits, drawerOptions } from './drawer'\n\ndefineOptions({ name: 'LlDrawer' })\n\nconst props = defineProps(drawerProps)\n\nconst emits = defineEmits(drawerEmits)\n\nconst attrs = useAttrs()\n\nconst bem = createNamespace('drawer')\n\nconst content = ref<HTMLElement>()\n\nconst hasScroll = ref(false)\n\nconst symbolClass = ref(`ll-darwer-${new Date().getTime()}`)\n\nconst getBindValue = computed(() => ({\n ...drawerOptions,\n ...omit({ ...attrs }, [...Object.keys(drawerProps), 'rootClassName'])\n}))\n\nconst handleClose = (): void => {\n emits('close')\n emits('update:open')\n}\nconst handleCancel = (): void => {\n emits('cancel')\n}\nconst handleConfirm = (): void => {\n emits('confirm')\n}\nconst handleResize = async () => {\n await nextTick()\n const ele = document.getElementsByClassName(symbolClass.value)[0]\n if (ele) {\n setTimeout(() => {\n hasScroll.value = ele.scrollHeight > ele.clientHeight\n }, 0)\n }\n}\nwatch(\n () => props.open,\n val => {\n if (val) {\n handleResize()\n window.addEventListener('resize', throttle(handleResize, 1000))\n } else {\n window.removeEventListener('resize', handleResize)\n }\n }\n)\n</script>\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drawer.vue2.mjs","sources":["../../../../../packages/components/drawer/src/drawer.vue"],"sourcesContent":["<template>\n <Drawer\n v-bind=\"getBindValue\"\n :title=\"props.title\"\n :open=\"props.open\"\n :root-class-name=\"bem.b()\"\n @close=\"handleClose\"\n >\n <template #title>\n <slot name=\"title\" />\n </template>\n <template #extra>\n <slot name=\"extra\" />\n </template>\n <div :class=\"bem.e('container')\">\n <div\n ref=\"content\"\n :style=\"{ marginBottom: props.showFooter ? '72px' : 0 }\"\n :class=\"[bem.e('content'), symbolClass]\"\n >\n <slot />\n </div>\n <div\n v-if=\"props.showFooter\"\n :class=\"[bem.e('footer'), hasScroll ? bem.is('has-scroll') : '']\"\n >\n <slot name=\"footer\">\n <div :class=\"bem.e('footer-left')\">\n <slot name=\"footer-left\" />\n </div>\n <div :class=\"bem.e('footer-right')\">\n <slot name=\"footer-right\">\n <ll-button\n v-if=\"showCancel\"\n :class=\"bem.m('cancel')\"\n :label=\"props.cancelText\"\n @click=\"handleCancel\"\n >\n </ll-button>\n <ll-button\n type=\"primary\"\n :loading=\"props.loading\"\n :label=\"props.confirmText\"\n @click=\"handleConfirm\"\n >\n </ll-button>\n </slot>\n </div>\n </slot>\n </div>\n </div>\n </Drawer>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch, nextTick, useAttrs } from 'vue'\nimport { Drawer } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { throttle, omit } from 'lodash-es'\nimport { drawerProps, drawerEmits, drawerOptions } from './drawer'\nimport { useSecondConfirmation } from './components/second-confirmation'\n\ndefineOptions({ name: 'LlDrawer' })\n\nconst props = defineProps(drawerProps)\n\nconst emits = defineEmits(drawerEmits)\n\nconst attrs = useAttrs()\n\nconst bem = createNamespace('drawer')\n\nconst content = ref<HTMLElement>()\n\nconst hasScroll = ref(false)\n\nconst symbolClass = ref(`ll-darwer-${new Date().getTime()}`)\n\nconst getBindValue = computed(() => ({\n ...drawerOptions,\n ...omit({ ...attrs }, [...Object.keys(drawerProps), 'rootClassName'])\n}))\n\nconst handleClose = (): void => {\n if (props.useClose) {\n emits('close')\n } else {\n handleCancel()\n return\n }\n emits('update:open')\n}\nconst handleCancel = (): void => {\n if (props.useCancelConfirm && props.cancelConfirm) {\n useSecondConfirmation(\n props.cancelConfirmOptions || {\n title: '温馨提示',\n message: '你有未保存的更改,确定关闭?'\n }\n ).then(async () => {\n // 点击保存按钮则关闭弹窗和抽屉\n emits('cancel')\n })\n return\n }\n emits('cancel')\n}\nconst handleConfirm = (): void => {\n emits('confirm')\n}\nconst handleResize = async () => {\n await nextTick()\n const ele = document.getElementsByClassName(symbolClass.value)[0]\n if (ele) {\n setTimeout(() => {\n hasScroll.value = ele.scrollHeight > ele.clientHeight\n }, 0)\n }\n}\nwatch(\n () => props.open,\n val => {\n if (val) {\n handleResize()\n window.addEventListener('resize', throttle(handleResize, 1000))\n } else {\n window.removeEventListener('resize', handleResize)\n }\n }\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgEA,IAAA,MAAM,KAAQ,GAAA,OA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