@nutui/nutui 4.0.12-beta.1 → 4.0.12
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/dist/nutui.es.js +1 -1
- package/dist/nutui.js +1 -1
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +50 -50
- package/dist/styles/themes/jdb.scss +50 -50
- package/dist/styles/themes/jddkh.scss +50 -50
- package/dist/styles/themes/jdt.scss +50 -50
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
|
@@ -1,36 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, nextTick, h } from "vue";
|
|
25
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
26
|
+
import { f as funInterceptor } from "./Interceptor-956b24fc.js";
|
|
27
|
+
import { P as Popup, p as popupProps } from "./index-da0a7662.js";
|
|
28
|
+
import Button from "./Button.js";
|
|
29
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
30
|
+
import Overlay from "./Overlay.js";
|
|
21
31
|
import "../locale/lang";
|
|
22
|
-
import { C as
|
|
32
|
+
import { C as CreateComponent } from "./mountComponent-8b24c346.js";
|
|
23
33
|
import "@nutui/icons-vue";
|
|
24
|
-
const { componentName
|
|
25
|
-
|
|
34
|
+
const { componentName, create, translate } = createComponent("dialog");
|
|
35
|
+
const _sfc_main = create({
|
|
36
|
+
inheritAttrs: false,
|
|
26
37
|
components: {
|
|
27
|
-
[
|
|
28
|
-
[
|
|
38
|
+
[Popup.name]: Popup,
|
|
39
|
+
[Button.name]: Button
|
|
29
40
|
},
|
|
30
|
-
props:
|
|
41
|
+
props: __spreadProps(__spreadValues({}, popupProps), {
|
|
31
42
|
closeOnClickOverlay: {
|
|
32
43
|
type: Boolean,
|
|
33
|
-
default:
|
|
44
|
+
default: true
|
|
34
45
|
},
|
|
35
46
|
title: {
|
|
36
47
|
type: String,
|
|
@@ -42,15 +53,15 @@ const { componentName: Y, create: Z, translate: _ } = G("dialog"), x = Z({
|
|
|
42
53
|
},
|
|
43
54
|
noFooter: {
|
|
44
55
|
type: Boolean,
|
|
45
|
-
default:
|
|
56
|
+
default: false
|
|
46
57
|
},
|
|
47
58
|
noOkBtn: {
|
|
48
59
|
type: Boolean,
|
|
49
|
-
default:
|
|
60
|
+
default: false
|
|
50
61
|
},
|
|
51
62
|
noCancelBtn: {
|
|
52
63
|
type: Boolean,
|
|
53
|
-
default:
|
|
64
|
+
default: false
|
|
54
65
|
},
|
|
55
66
|
cancelText: {
|
|
56
67
|
type: String,
|
|
@@ -62,7 +73,7 @@ const { componentName: Y, create: Z, translate: _ } = G("dialog"), x = Z({
|
|
|
62
73
|
},
|
|
63
74
|
cancelAutoClose: {
|
|
64
75
|
type: Boolean,
|
|
65
|
-
default:
|
|
76
|
+
default: true
|
|
66
77
|
},
|
|
67
78
|
textAlign: {
|
|
68
79
|
type: String,
|
|
@@ -70,7 +81,7 @@ const { componentName: Y, create: Z, translate: _ } = G("dialog"), x = Z({
|
|
|
70
81
|
},
|
|
71
82
|
closeOnPopstate: {
|
|
72
83
|
type: Boolean,
|
|
73
|
-
default:
|
|
84
|
+
default: false
|
|
74
85
|
},
|
|
75
86
|
footerDirection: {
|
|
76
87
|
type: String,
|
|
@@ -87,186 +98,227 @@ const { componentName: Y, create: Z, translate: _ } = G("dialog"), x = Z({
|
|
|
87
98
|
beforeClose: Function
|
|
88
99
|
}),
|
|
89
100
|
emits: ["update", "update:visible", "ok", "cancel", "opened", "closed"],
|
|
90
|
-
setup(
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
setup(props, { emit }) {
|
|
102
|
+
const showPopup = ref(props.visible);
|
|
103
|
+
onMounted(() => {
|
|
104
|
+
if (props.closeOnPopstate) {
|
|
105
|
+
window.addEventListener("popstate", function() {
|
|
106
|
+
closed("page");
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
watch(
|
|
111
|
+
() => props.visible,
|
|
112
|
+
(value) => {
|
|
113
|
+
showPopup.value = value;
|
|
114
|
+
if (value) {
|
|
115
|
+
emit("opened");
|
|
116
|
+
}
|
|
100
117
|
}
|
|
101
118
|
);
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
const classes = computed(() => {
|
|
120
|
+
return {
|
|
121
|
+
[componentName]: true,
|
|
122
|
+
[props.customClass]: true
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
const update = (val) => {
|
|
126
|
+
emit("update", val);
|
|
127
|
+
emit("update:visible", val);
|
|
128
|
+
};
|
|
129
|
+
const closed = (action) => {
|
|
130
|
+
funInterceptor(props.beforeClose, {
|
|
131
|
+
args: [action],
|
|
110
132
|
done: () => {
|
|
111
|
-
|
|
133
|
+
showPopup.value = false;
|
|
134
|
+
update(false);
|
|
135
|
+
emit("closed");
|
|
112
136
|
}
|
|
113
137
|
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
138
|
+
};
|
|
139
|
+
const onCancel = () => {
|
|
140
|
+
emit("cancel");
|
|
141
|
+
if (props.cancelAutoClose) {
|
|
142
|
+
showPopup.value = false;
|
|
143
|
+
closed("cancel");
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const onOk = () => {
|
|
147
|
+
emit("ok");
|
|
148
|
+
closed("ok");
|
|
149
|
+
};
|
|
150
|
+
const onClickOverlay = () => {
|
|
151
|
+
if (props.closeOnClickOverlay) {
|
|
152
|
+
closed("");
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const contentStyle = computed(() => {
|
|
156
|
+
return {
|
|
157
|
+
textAlign: props.textAlign
|
|
158
|
+
};
|
|
159
|
+
});
|
|
123
160
|
return {
|
|
124
|
-
closed
|
|
125
|
-
classes
|
|
126
|
-
onCancel
|
|
127
|
-
onOk
|
|
128
|
-
showPopup
|
|
129
|
-
onClickOverlay
|
|
130
|
-
contentStyle
|
|
131
|
-
translate
|
|
161
|
+
closed,
|
|
162
|
+
classes,
|
|
163
|
+
onCancel,
|
|
164
|
+
onOk,
|
|
165
|
+
showPopup,
|
|
166
|
+
onClickOverlay,
|
|
167
|
+
contentStyle,
|
|
168
|
+
translate
|
|
132
169
|
};
|
|
133
170
|
}
|
|
134
|
-
})
|
|
171
|
+
});
|
|
172
|
+
const _hoisted_1 = {
|
|
135
173
|
key: 0,
|
|
136
174
|
class: "nut-dialog__header"
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
|
|
175
|
+
};
|
|
176
|
+
const _hoisted_2 = ["innerHTML"];
|
|
177
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
178
|
+
const _component_nut_button = resolveComponent("nut-button");
|
|
179
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
180
|
+
return openBlock(), createBlock(_component_nut_popup, {
|
|
181
|
+
teleport: _ctx.teleport,
|
|
182
|
+
visible: _ctx.showPopup,
|
|
183
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
|
|
184
|
+
"close-on-click-overlay": false,
|
|
185
|
+
"lock-scroll": _ctx.lockScroll,
|
|
186
|
+
"pop-class": _ctx.popClass,
|
|
187
|
+
"overlay-class": _ctx.overlayClass,
|
|
188
|
+
"overlay-style": _ctx.overlayStyle,
|
|
189
|
+
style: normalizeStyle(_ctx.popStyle),
|
|
150
190
|
round: "",
|
|
151
|
-
onClickOverlay:
|
|
152
|
-
onClickCloseIcon:
|
|
191
|
+
onClickOverlay: _ctx.onClickOverlay,
|
|
192
|
+
onClickCloseIcon: _ctx.closed
|
|
153
193
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
|
|
156
|
-
class:
|
|
194
|
+
default: withCtx(() => [
|
|
195
|
+
createElementVNode("view", {
|
|
196
|
+
class: normalizeClass(_ctx.classes)
|
|
157
197
|
}, [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
198
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
199
|
+
_ctx.$slots.header ? renderSlot(_ctx.$slots, "header", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
200
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
161
201
|
], 64))
|
|
162
|
-
])) :
|
|
163
|
-
|
|
202
|
+
])) : createCommentVNode("", true),
|
|
203
|
+
createElementVNode("view", {
|
|
164
204
|
class: "nut-dialog__content",
|
|
165
|
-
style:
|
|
205
|
+
style: normalizeStyle(_ctx.contentStyle)
|
|
166
206
|
}, [
|
|
167
|
-
|
|
207
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : typeof _ctx.content === "string" ? (openBlock(), createElementBlock("view", {
|
|
168
208
|
key: 1,
|
|
169
|
-
innerHTML:
|
|
170
|
-
}, null, 8,
|
|
209
|
+
innerHTML: _ctx.content
|
|
210
|
+
}, null, 8, _hoisted_2)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.content), { key: 2 }))
|
|
171
211
|
], 4),
|
|
172
|
-
|
|
212
|
+
!_ctx.noFooter ? (openBlock(), createElementBlock("view", {
|
|
173
213
|
key: 1,
|
|
174
|
-
class:
|
|
214
|
+
class: normalizeClass(["nut-dialog__footer", { [_ctx.footerDirection]: _ctx.footerDirection }])
|
|
175
215
|
}, [
|
|
176
|
-
|
|
177
|
-
|
|
216
|
+
_ctx.$slots.footer ? renderSlot(_ctx.$slots, "footer", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
217
|
+
!_ctx.noCancelBtn ? (openBlock(), createBlock(_component_nut_button, {
|
|
178
218
|
key: 0,
|
|
179
219
|
size: "small",
|
|
180
220
|
plain: "",
|
|
181
221
|
type: "primary",
|
|
182
222
|
class: "nut-dialog__footer-cancel",
|
|
183
|
-
onClick:
|
|
223
|
+
onClick: _ctx.onCancel
|
|
184
224
|
}, {
|
|
185
|
-
default:
|
|
186
|
-
|
|
225
|
+
default: withCtx(() => [
|
|
226
|
+
createTextVNode(toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1)
|
|
187
227
|
]),
|
|
188
228
|
_: 1
|
|
189
|
-
}, 8, ["onClick"])),
|
|
190
|
-
|
|
229
|
+
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
230
|
+
!_ctx.noOkBtn ? (openBlock(), createBlock(_component_nut_button, {
|
|
191
231
|
key: 1,
|
|
192
232
|
size: "small",
|
|
193
233
|
type: "primary",
|
|
194
234
|
class: "nut-dialog__footer-ok",
|
|
195
|
-
onClick:
|
|
235
|
+
onClick: _ctx.onOk
|
|
196
236
|
}, {
|
|
197
|
-
default:
|
|
198
|
-
|
|
237
|
+
default: withCtx(() => [
|
|
238
|
+
createTextVNode(toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
|
|
199
239
|
]),
|
|
200
240
|
_: 1
|
|
201
|
-
}, 8, ["onClick"]))
|
|
241
|
+
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
202
242
|
], 64))
|
|
203
|
-
], 2))
|
|
243
|
+
], 2)) : createCommentVNode("", true)
|
|
204
244
|
], 2)
|
|
205
245
|
]),
|
|
206
246
|
_: 3
|
|
207
247
|
}, 8, ["teleport", "visible", "lock-scroll", "pop-class", "overlay-class", "overlay-style", "style", "onClickOverlay", "onClickCloseIcon"]);
|
|
208
248
|
}
|
|
209
|
-
const
|
|
210
|
-
class
|
|
249
|
+
const Dialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
250
|
+
class DialogOptions {
|
|
211
251
|
constructor() {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
252
|
+
__publicField(this, "title", "");
|
|
253
|
+
__publicField(this, "content", "");
|
|
254
|
+
__publicField(this, "cancelText", "");
|
|
255
|
+
__publicField(this, "okText", "");
|
|
256
|
+
__publicField(this, "textAlign", "center");
|
|
257
|
+
__publicField(this, "customClass", "");
|
|
258
|
+
__publicField(this, "overlayStyle", {});
|
|
259
|
+
__publicField(this, "overlayClass", "");
|
|
260
|
+
__publicField(this, "popStyle", {});
|
|
261
|
+
__publicField(this, "popClass", "");
|
|
262
|
+
__publicField(this, "teleport", "body");
|
|
263
|
+
__publicField(this, "id", (/* @__PURE__ */ new Date()).getTime());
|
|
264
|
+
__publicField(this, "footerDirection", "horizontal");
|
|
225
265
|
//使用横纵方向 可选值 horizontal、vertical
|
|
226
266
|
// function
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
267
|
+
__publicField(this, "onUpdate");
|
|
268
|
+
__publicField(this, "onOk");
|
|
269
|
+
__publicField(this, "onCancel");
|
|
270
|
+
__publicField(this, "onOpened");
|
|
271
|
+
__publicField(this, "onClosed");
|
|
272
|
+
__publicField(this, "beforeClose");
|
|
273
|
+
__publicField(this, "visible", true);
|
|
274
|
+
__publicField(this, "noFooter", false);
|
|
275
|
+
__publicField(this, "noOkBtn", false);
|
|
276
|
+
__publicField(this, "noCancelBtn", false);
|
|
277
|
+
__publicField(this, "okBtnDisabled", false);
|
|
278
|
+
__publicField(this, "closeOnPopstate", false);
|
|
279
|
+
__publicField(this, "closeOnClickOverlay", true);
|
|
280
|
+
__publicField(this, "lockScroll", true);
|
|
241
281
|
}
|
|
242
282
|
}
|
|
243
|
-
class
|
|
244
|
-
constructor(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const
|
|
283
|
+
class DialogFunction {
|
|
284
|
+
constructor(_options) {
|
|
285
|
+
__publicField(this, "options", new DialogOptions());
|
|
286
|
+
__publicField(this, "instance");
|
|
287
|
+
const options = Object.assign(this.options, _options);
|
|
288
|
+
const { unmount } = CreateComponent(options, {
|
|
248
289
|
name: "dialog",
|
|
249
|
-
components: [
|
|
250
|
-
wrapper: (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
290
|
+
components: [Popup, Button, Overlay],
|
|
291
|
+
wrapper: (elWrap, root) => {
|
|
292
|
+
return {
|
|
293
|
+
setup() {
|
|
294
|
+
options.onUpdate = (val) => {
|
|
295
|
+
if (val === false) {
|
|
296
|
+
nextTick(() => {
|
|
297
|
+
unmount();
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
if (options == null ? void 0 : options.onOpened) {
|
|
302
|
+
options == null ? void 0 : options.onOpened();
|
|
303
|
+
}
|
|
304
|
+
options.teleport = `#${root.id}`;
|
|
305
|
+
return () => {
|
|
306
|
+
return h(Dialog, options);
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
259
311
|
});
|
|
260
312
|
}
|
|
261
313
|
}
|
|
262
|
-
const
|
|
263
|
-
return new
|
|
314
|
+
const showDialog = function(options) {
|
|
315
|
+
return new DialogFunction(options);
|
|
264
316
|
};
|
|
265
|
-
|
|
266
|
-
|
|
317
|
+
showDialog.install = (app) => {
|
|
318
|
+
app.use(Dialog);
|
|
267
319
|
};
|
|
268
320
|
export {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
321
|
+
DialogOptions,
|
|
322
|
+
Dialog as default,
|
|
323
|
+
showDialog
|
|
272
324
|
};
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { computed, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
21
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
16
23
|
import "../locale/lang";
|
|
17
|
-
const { componentName
|
|
24
|
+
const { componentName, create } = createComponent("divider");
|
|
25
|
+
const _sfc_main = create({
|
|
18
26
|
props: {
|
|
19
27
|
contentPosition: {
|
|
20
28
|
type: String,
|
|
@@ -22,11 +30,11 @@ const { componentName: z, create: B } = g("divider"), C = B({
|
|
|
22
30
|
},
|
|
23
31
|
dashed: {
|
|
24
32
|
type: Boolean,
|
|
25
|
-
default:
|
|
33
|
+
default: false
|
|
26
34
|
},
|
|
27
35
|
hairline: {
|
|
28
36
|
type: Boolean,
|
|
29
|
-
default:
|
|
37
|
+
default: true
|
|
30
38
|
},
|
|
31
39
|
direction: {
|
|
32
40
|
type: String,
|
|
@@ -34,36 +42,43 @@ const { componentName: z, create: B } = g("divider"), C = B({
|
|
|
34
42
|
}
|
|
35
43
|
},
|
|
36
44
|
components: {},
|
|
37
|
-
setup(
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
let
|
|
41
|
-
[
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
setup(props, context) {
|
|
46
|
+
const classes = computed(() => {
|
|
47
|
+
const prefixCls = componentName;
|
|
48
|
+
let defaultClassesObj = {
|
|
49
|
+
[prefixCls]: true
|
|
50
|
+
};
|
|
51
|
+
let classesObj = {};
|
|
52
|
+
if (props.direction === "horizontal") {
|
|
53
|
+
classesObj = __spreadProps(__spreadValues({}, defaultClassesObj), {
|
|
54
|
+
[`${prefixCls}-center`]: context.slots.default,
|
|
55
|
+
[`${prefixCls}-left`]: props.contentPosition === "left",
|
|
56
|
+
[`${prefixCls}-right`]: props.contentPosition === "right",
|
|
57
|
+
[`${prefixCls}-dashed`]: props.dashed,
|
|
58
|
+
[`${prefixCls}-hairline`]: props.hairline
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
classesObj = __spreadProps(__spreadValues({}, defaultClassesObj), {
|
|
62
|
+
[`${prefixCls}-vertical`]: props.direction === "vertical"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return classesObj;
|
|
66
|
+
});
|
|
67
|
+
return { classes };
|
|
53
68
|
}
|
|
54
69
|
});
|
|
55
|
-
function
|
|
56
|
-
return
|
|
70
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
71
|
+
return _ctx.direction === "horizontal" ? (openBlock(), createElementBlock("view", {
|
|
57
72
|
key: 0,
|
|
58
|
-
class:
|
|
73
|
+
class: normalizeClass(_ctx.classes)
|
|
59
74
|
}, [
|
|
60
|
-
|
|
61
|
-
], 2)) : (
|
|
75
|
+
renderSlot(_ctx.$slots, "default")
|
|
76
|
+
], 2)) : (openBlock(), createElementBlock("view", {
|
|
62
77
|
key: 1,
|
|
63
|
-
class:
|
|
78
|
+
class: normalizeClass(_ctx.classes)
|
|
64
79
|
}, null, 2));
|
|
65
80
|
}
|
|
66
|
-
const
|
|
81
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
67
82
|
export {
|
|
68
|
-
|
|
83
|
+
index as default
|
|
69
84
|
};
|