@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.1

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.
Files changed (168) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +3 -4
  3. package/dist/nutui.es.js +20412 -4214
  4. package/dist/nutui.umd.js +20518 -4216
  5. package/dist/packages/_es/ActionSheet.js +149 -17
  6. package/dist/packages/_es/Address.js +535 -110
  7. package/dist/packages/_es/AddressList.js +615 -113
  8. package/dist/packages/_es/Animate.js +59 -17
  9. package/dist/packages/_es/Audio.js +257 -53
  10. package/dist/packages/_es/AudioOperate.js +100 -13
  11. package/dist/packages/_es/Avatar.js +162 -38
  12. package/dist/packages/_es/AvatarGroup.js +73 -14
  13. package/dist/packages/_es/BackTop.js +156 -43
  14. package/dist/packages/_es/Badge.js +86 -14
  15. package/dist/packages/_es/Barrage.js +120 -41
  16. package/dist/packages/_es/Button.js +128 -23
  17. package/dist/packages/_es/Calendar.js +246 -30
  18. package/dist/packages/_es/CalendarItem.js +1 -1
  19. package/dist/packages/_es/Card.js +107 -10
  20. package/dist/packages/_es/Cascader.js +496 -147
  21. package/dist/packages/_es/Category.js +58 -15
  22. package/dist/packages/_es/CategoryPane.js +111 -11
  23. package/dist/packages/_es/Cell.js +108 -21
  24. package/dist/packages/_es/CellGroup.js +44 -9
  25. package/dist/packages/_es/Checkbox.js +134 -29
  26. package/dist/packages/_es/CheckboxGroup.js +79 -29
  27. package/dist/packages/_es/CircleProgress.js +150 -28
  28. package/dist/packages/_es/Col.js +56 -14
  29. package/dist/packages/_es/Collapse.js +109 -32
  30. package/dist/packages/_es/CollapseItem.js +253 -59
  31. package/dist/packages/_es/Comment.js +434 -64
  32. package/dist/packages/_es/ConfigProvider.js +20 -8
  33. package/dist/packages/_es/CountDown.js +238 -56
  34. package/dist/packages/_es/CountUp.js +539 -140
  35. package/dist/packages/_es/DatePicker.js +315 -98
  36. package/dist/packages/_es/Dialog.js +289 -60
  37. package/dist/packages/_es/Divider.js +65 -13
  38. package/dist/packages/_es/Drag.js +197 -56
  39. package/dist/packages/_es/Ecard.js +159 -24
  40. package/dist/packages/_es/Elevator.js +255 -58
  41. package/dist/packages/_es/Ellipsis.js +200 -58
  42. package/dist/packages/_es/Empty.js +71 -12
  43. package/dist/packages/_es/FixedNav.js +122 -15
  44. package/dist/packages/_es/Form.js +151 -64
  45. package/dist/packages/_es/FormItem.js +114 -15
  46. package/dist/packages/_es/Grid.js +6 -5
  47. package/dist/packages/_es/GridItem.js +144 -33
  48. package/dist/packages/_es/Icon.js +40 -15
  49. package/dist/packages/_es/Image.js +137 -26
  50. package/dist/packages/_es/ImagePreview.js +547 -76
  51. package/dist/packages/_es/Indicator.js +62 -15
  52. package/dist/packages/_es/InfiniteLoading.js +249 -57
  53. package/dist/packages/_es/Input.js +433 -51
  54. package/dist/packages/_es/InputNumber.js +160 -41
  55. package/dist/packages/_es/Layout.js +5 -4
  56. package/dist/packages/_es/List.js +106 -18
  57. package/dist/packages/_es/Menu.js +168 -44
  58. package/dist/packages/_es/MenuItem.js +173 -37
  59. package/dist/packages/_es/Navbar.js +192 -30
  60. package/dist/packages/_es/NoticeBar.js +380 -74
  61. package/dist/packages/_es/Notify.js +227 -72
  62. package/dist/packages/_es/NumberKeyboard.js +272 -41
  63. package/dist/packages/_es/OldPicker.js +457 -130
  64. package/dist/packages/_es/OverLay.js +98 -24
  65. package/dist/packages/_es/Pagination.js +157 -39
  66. package/dist/packages/_es/Picker.js +454 -129
  67. package/dist/packages/_es/Popover.js +957 -318
  68. package/dist/packages/_es/Popup.js +299 -55
  69. package/dist/packages/_es/Price.js +118 -16
  70. package/dist/packages/_es/Progress.js +146 -14
  71. package/dist/packages/_es/PullRefresh.js +339 -84
  72. package/dist/packages/_es/Radio.js +90 -22
  73. package/dist/packages/_es/RadioGroup.js +37 -8
  74. package/dist/packages/_es/Range.js +408 -83
  75. package/dist/packages/_es/Rate.js +192 -36
  76. package/dist/packages/_es/Row.js +64 -22
  77. package/dist/packages/_es/SearchBar.js +238 -37
  78. package/dist/packages/_es/ShortPassword.js +225 -35
  79. package/dist/packages/_es/SideNavBar.js +81 -24
  80. package/dist/packages/_es/SideNavBarItem.js +46 -11
  81. package/dist/packages/_es/Signature.js +160 -41
  82. package/dist/packages/_es/Skeleton.js +136 -20
  83. package/dist/packages/_es/Sku.js +491 -84
  84. package/dist/packages/_es/Step.js +115 -20
  85. package/dist/packages/_es/Steps.js +53 -18
  86. package/dist/packages/_es/Sticky.js +138 -53
  87. package/dist/packages/_es/SubSideNavBar.js +82 -17
  88. package/dist/packages/_es/Swipe.js +178 -41
  89. package/dist/packages/_es/Swiper.js +433 -121
  90. package/dist/packages/_es/SwiperItem.js +53 -22
  91. package/dist/packages/_es/Switch.js +116 -21
  92. package/dist/packages/_es/TabPane.js +39 -12
  93. package/dist/packages/_es/Tabbar.js +72 -17
  94. package/dist/packages/_es/TabbarItem.js +151 -29
  95. package/dist/packages/_es/Table.js +178 -18
  96. package/dist/packages/_es/Tabs.js +202 -43
  97. package/dist/packages/_es/Tag.js +97 -20
  98. package/dist/packages/_es/TextArea.js +160 -42
  99. package/dist/packages/_es/TimeDetail.js +79 -18
  100. package/dist/packages/_es/TimePannel.js +48 -14
  101. package/dist/packages/_es/TimeSelect.js +112 -15
  102. package/dist/packages/_es/Toast.js +310 -71
  103. package/dist/packages/_es/Uploader.js +455 -104
  104. package/dist/packages/_es/Video.js +332 -74
  105. package/dist/packages/_es/common.js +128 -38
  106. package/dist/packages/_es/component.js +76 -35
  107. package/dist/packages/_es/index.js +6 -5
  108. package/dist/packages/_es/index2.js +30 -9
  109. package/dist/packages/_es/index3.js +8 -6
  110. package/dist/packages/_es/index4.js +64 -13
  111. package/dist/packages/_es/index5.js +780 -164
  112. package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
  113. package/dist/packages/_es/pxCheck.js +5 -3
  114. package/dist/packages/_es/raf.js +15 -8
  115. package/dist/packages/imagepreview/index.scss +6 -1
  116. package/dist/packages/locale/lang/baseLang.js +3 -3
  117. package/dist/packages/locale/lang/en-US.js +105 -5
  118. package/dist/packages/locale/lang/id-ID.js +105 -5
  119. package/dist/packages/locale/lang/index.js +38 -16
  120. package/dist/packages/locale/lang/zh-CN.js +105 -5
  121. package/dist/packages/locale/lang/zh-TW.js +105 -5
  122. package/dist/packages/picker/index.scss +13 -0
  123. package/dist/smartips/attributes.json +8 -0
  124. package/dist/smartips/tags.json +3 -1
  125. package/dist/smartips/web-types.json +19 -1
  126. package/dist/style.css +1 -1
  127. package/dist/style.es.js +1 -1
  128. package/dist/styles/themes/default.scss +49 -49
  129. package/dist/styles/themes/jdb.scss +49 -49
  130. package/dist/styles/themes/jdt.scss +49 -49
  131. package/dist/styles/variables-jdb.scss +4 -1
  132. package/dist/styles/variables-jdt.scss +4 -1
  133. package/dist/styles/variables.scss +1 -1
  134. package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
  135. package/dist/types/__VUE/address/index.vue.d.ts +4 -4
  136. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  137. package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
  138. package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
  139. package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
  140. package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
  141. package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
  142. package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
  143. package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
  144. package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
  146. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
  147. package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
  148. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
  149. package/dist/types/__VUE/input/index.vue.d.ts +2 -2
  150. package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
  151. package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
  152. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
  153. package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
  154. package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
  155. package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
  156. package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
  157. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  158. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  159. package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
  160. package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
  161. package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
  162. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  163. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  164. package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
  165. package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
  166. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  167. package/dist/types/index.d.ts +1 -1
  168. package/package.json +1 -2
@@ -1,77 +1,306 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref as e, onMounted as t, watch as o, computed as l, resolveComponent as s, openBlock as n, createBlock as i, normalizeStyle as a, withCtx as c, createElementVNode as r, normalizeClass as p, createElementBlock as d, renderSlot as u, Fragment as y, createTextVNode as f, toDisplayString as h, createCommentVNode as k, resolveDynamicComponent as m, createVNode as v, render as C, h as g } from "vue";
7
- import { a as O, c as b } from "./component.js";
8
- import S, { popupProps as _ } from "./Popup.js";
9
- import w from "./Button.js";
10
- import { _ as B } from "./plugin-vue_export-helper.js";
6
+ import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, createVNode, render, h } from "vue";
7
+ import { a as isPromise, c as createComponent } from "./component.js";
8
+ import Popup, { popupProps } from "./Popup.js";
9
+ import Button from "./Button.js";
10
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
11
11
  import "../locale/lang";
12
12
  import "./OverLay.js";
13
13
  import "./Icon.js";
14
14
  import "./pxCheck.js";
15
- const { componentName: x, create: j, translate: T } = b("dialog"), D = j({ inheritAttrs: false, components: { [S.name]: S, [w.name]: w }, props: { ..._, closeOnClickOverlay: { type: Boolean, default: false }, title: { type: String, default: "" }, content: { type: [String, Object], default: "" }, noFooter: { type: Boolean, default: false }, noOkBtn: { type: Boolean, default: false }, noCancelBtn: { type: Boolean, default: false }, cancelText: { type: String, default: "" }, okText: { type: String, default: "" }, cancelAutoClose: { type: Boolean, default: true }, textAlign: { type: String, default: "center" }, closeOnPopstate: { type: Boolean, default: false }, footerDirection: { type: String, default: "horizontal" }, customClass: { type: String, default: "" }, popStyle: { type: Object }, beforeClose: { type: Function } }, emits: ["update", "update:visible", "ok", "cancel", "opened", "closed"], setup(s2, { emit: n2 }) {
16
- const i2 = e(s2.visible);
17
- t(() => {
18
- s2.closeOnPopstate && window.addEventListener("popstate", function() {
19
- r2("page");
15
+ const { componentName, create, translate } = createComponent("dialog");
16
+ const _sfc_main = create({
17
+ inheritAttrs: false,
18
+ components: {
19
+ [Popup.name]: Popup,
20
+ [Button.name]: Button
21
+ },
22
+ props: {
23
+ ...popupProps,
24
+ closeOnClickOverlay: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ title: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ content: {
33
+ type: [String, Object],
34
+ default: ""
35
+ },
36
+ noFooter: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ noOkBtn: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ noCancelBtn: {
45
+ type: Boolean,
46
+ default: false
47
+ },
48
+ cancelText: {
49
+ type: String,
50
+ default: ""
51
+ },
52
+ okText: {
53
+ type: String,
54
+ default: ""
55
+ },
56
+ cancelAutoClose: {
57
+ type: Boolean,
58
+ default: true
59
+ },
60
+ textAlign: {
61
+ type: String,
62
+ default: "center"
63
+ },
64
+ closeOnPopstate: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ footerDirection: {
69
+ type: String,
70
+ default: "horizontal"
71
+ },
72
+ customClass: {
73
+ type: String,
74
+ default: ""
75
+ },
76
+ popStyle: {
77
+ type: Object
78
+ },
79
+ beforeClose: {
80
+ type: Function
81
+ }
82
+ },
83
+ emits: ["update", "update:visible", "ok", "cancel", "opened", "closed"],
84
+ setup(props, { emit }) {
85
+ const showPopup = ref(props.visible);
86
+ onMounted(() => {
87
+ if (props.closeOnPopstate) {
88
+ window.addEventListener("popstate", function() {
89
+ closed("page");
90
+ });
91
+ }
20
92
  });
21
- }), o(() => s2.visible, (e2) => {
22
- i2.value = e2, e2 && n2("opened");
23
- });
24
- const a2 = l(() => ({ [x]: true, [s2.customClass]: true })), c2 = (e2) => {
25
- n2("update", e2), n2("update:visible", e2);
26
- }, r2 = (e2) => {
27
- if (s2.beforeClose) {
28
- const t2 = s2.beforeClose(e2);
29
- O(t2) && t2.then((e3) => {
30
- e3 && (c2(false), n2("closed"));
31
- });
32
- } else
33
- c2(false), n2("closed");
34
- };
35
- return { closed: r2, classes: a2, onCancel: () => {
36
- n2("cancel"), s2.cancelAutoClose && r2("cancel");
37
- }, onOk: () => {
38
- n2("ok"), r2("ok");
39
- }, showPopup: i2, translate: T };
40
- } }), P = { key: 0, class: "nut-dialog__header" }, $ = ["innerHTML"];
41
- var A = B(D, [["render", function(e2, t2, o2, l2, v2, C2) {
42
- const g2 = s("nut-button"), O2 = s("nut-popup");
43
- return n(), i(O2, { teleport: e2.teleport, visible: e2.showPopup, "onUpdate:visible": t2[0] || (t2[0] = (t3) => e2.showPopup = t3), "close-on-click-overlay": e2.closeOnClickOverlay, "lock-scroll": e2.lockScroll, "pop-class": e2.popClass, style: a(e2.popStyle), "overlay-class": e2.overlayClass, "overlay-style": e2.overlayStyle, round: "", onClickOverlay: e2.closed, onClickCloseIcon: e2.closed }, { default: c(() => [r("view", { class: p(e2.classes) }, [e2.title ? (n(), d("view", P, [e2.$slots.header ? u(e2.$slots, "header", { key: 0 }) : (n(), d(y, { key: 1 }, [f(h(e2.title), 1)], 64))])) : k("", true), r("view", { class: "nut-dialog__content", style: a({ textAlign: e2.textAlign }) }, [e2.$slots.default ? u(e2.$slots, "default", { key: 0 }) : typeof e2.content == "string" ? (n(), d("view", { key: 1, innerHTML: e2.content }, null, 8, $)) : (n(), i(m(e2.content), { key: 2 }))], 4), e2.noFooter ? k("", true) : (n(), d("view", { key: 1, class: p(["nut-dialog__footer", { [e2.footerDirection]: e2.footerDirection }]) }, [e2.$slots.footer ? u(e2.$slots, "footer", { key: 0 }) : (n(), d(y, { key: 1 }, [e2.noCancelBtn ? k("", true) : (n(), i(g2, { key: 0, size: "small", plain: "", type: "primary", class: "nut-dialog__footer-cancel", onClick: e2.onCancel }, { default: c(() => [f(h(e2.cancelText || e2.translate("cancel")), 1)]), _: 1 }, 8, ["onClick"])), e2.noOkBtn ? k("", true) : (n(), i(g2, { key: 1, size: "small", type: "primary", class: "nut-dialog__footer-ok", onClick: e2.onOk }, { default: c(() => [f(h(e2.okText || e2.translate("confirm")), 1)]), _: 1 }, 8, ["onClick"]))], 64))], 2))], 2)]), _: 3 }, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "pop-class", "style", "overlay-class", "overlay-style", "onClickOverlay", "onClickCloseIcon"]);
44
- }]]);
45
- class z {
93
+ watch(() => props.visible, (value) => {
94
+ showPopup.value = value;
95
+ if (value) {
96
+ emit("opened");
97
+ }
98
+ });
99
+ const classes = computed(() => {
100
+ return {
101
+ [componentName]: true,
102
+ [props.customClass]: true
103
+ };
104
+ });
105
+ const update = (val) => {
106
+ emit("update", val);
107
+ emit("update:visible", val);
108
+ };
109
+ const closed = (action) => {
110
+ if (props.beforeClose) {
111
+ const result = props.beforeClose(action);
112
+ if (isPromise(result)) {
113
+ result.then((bool) => {
114
+ if (bool) {
115
+ update(false);
116
+ emit("closed");
117
+ }
118
+ });
119
+ }
120
+ } else {
121
+ update(false);
122
+ emit("closed");
123
+ }
124
+ };
125
+ const onCancel = () => {
126
+ emit("cancel");
127
+ if (props.cancelAutoClose) {
128
+ closed("cancel");
129
+ }
130
+ };
131
+ const onOk = () => {
132
+ emit("ok");
133
+ closed("ok");
134
+ };
135
+ return {
136
+ closed,
137
+ classes,
138
+ onCancel,
139
+ onOk,
140
+ showPopup,
141
+ translate
142
+ };
143
+ }
144
+ });
145
+ const _hoisted_1 = {
146
+ key: 0,
147
+ class: "nut-dialog__header"
148
+ };
149
+ const _hoisted_2 = ["innerHTML"];
150
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
151
+ const _component_nut_button = resolveComponent("nut-button");
152
+ const _component_nut_popup = resolveComponent("nut-popup");
153
+ return openBlock(), createBlock(_component_nut_popup, {
154
+ teleport: _ctx.teleport,
155
+ visible: _ctx.showPopup,
156
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
157
+ "close-on-click-overlay": _ctx.closeOnClickOverlay,
158
+ "lock-scroll": _ctx.lockScroll,
159
+ "pop-class": _ctx.popClass,
160
+ style: normalizeStyle(_ctx.popStyle),
161
+ "overlay-class": _ctx.overlayClass,
162
+ "overlay-style": _ctx.overlayStyle,
163
+ round: "",
164
+ onClickOverlay: _ctx.closed,
165
+ onClickCloseIcon: _ctx.closed
166
+ }, {
167
+ default: withCtx(() => [
168
+ createElementVNode("view", {
169
+ class: normalizeClass(_ctx.classes)
170
+ }, [
171
+ _ctx.title ? (openBlock(), createElementBlock("view", _hoisted_1, [
172
+ _ctx.$slots.header ? renderSlot(_ctx.$slots, "header", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
173
+ createTextVNode(toDisplayString(_ctx.title), 1)
174
+ ], 64))
175
+ ])) : createCommentVNode("", true),
176
+ createElementVNode("view", {
177
+ class: "nut-dialog__content",
178
+ style: normalizeStyle({ textAlign: _ctx.textAlign })
179
+ }, [
180
+ _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : typeof _ctx.content === "string" ? (openBlock(), createElementBlock("view", {
181
+ key: 1,
182
+ innerHTML: _ctx.content
183
+ }, null, 8, _hoisted_2)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.content), { key: 2 }))
184
+ ], 4),
185
+ !_ctx.noFooter ? (openBlock(), createElementBlock("view", {
186
+ key: 1,
187
+ class: normalizeClass(["nut-dialog__footer", { [_ctx.footerDirection]: _ctx.footerDirection }])
188
+ }, [
189
+ _ctx.$slots.footer ? renderSlot(_ctx.$slots, "footer", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
190
+ !_ctx.noCancelBtn ? (openBlock(), createBlock(_component_nut_button, {
191
+ key: 0,
192
+ size: "small",
193
+ plain: "",
194
+ type: "primary",
195
+ class: "nut-dialog__footer-cancel",
196
+ onClick: _ctx.onCancel
197
+ }, {
198
+ default: withCtx(() => [
199
+ createTextVNode(toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1)
200
+ ]),
201
+ _: 1
202
+ }, 8, ["onClick"])) : createCommentVNode("", true),
203
+ !_ctx.noOkBtn ? (openBlock(), createBlock(_component_nut_button, {
204
+ key: 1,
205
+ size: "small",
206
+ type: "primary",
207
+ class: "nut-dialog__footer-ok",
208
+ onClick: _ctx.onOk
209
+ }, {
210
+ default: withCtx(() => [
211
+ createTextVNode(toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
212
+ ]),
213
+ _: 1
214
+ }, 8, ["onClick"])) : createCommentVNode("", true)
215
+ ], 64))
216
+ ], 2)) : createCommentVNode("", true)
217
+ ], 2)
218
+ ]),
219
+ _: 3
220
+ }, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "pop-class", "style", "overlay-class", "overlay-style", "onClickOverlay", "onClickCloseIcon"]);
221
+ }
222
+ var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
223
+ class DialogOptions {
46
224
  constructor() {
47
- this.title = "", this.content = "", this.cancelText = "", this.okText = "", this.textAlign = "center", this.customClass = "", this.overlayStyle = {}, this.overlayClass = "", this.popStyle = {}, this.popClass = "", this.teleport = "body", this.id = new Date().getTime(), this.footerDirection = "horizontal", this.onUpdate = (e2) => {
48
- }, this.onOk = () => {
49
- }, this.onCancel = () => {
50
- }, this.onOpened = () => {
51
- }, this.onClosed = () => {
52
- }, this.visible = true, this.noFooter = false, this.noOkBtn = false, this.noCancelBtn = false, this.okBtnDisabled = false, this.closeOnPopstate = false, this.lockScroll = false;
225
+ this.title = "";
226
+ this.content = "";
227
+ this.cancelText = "";
228
+ this.okText = "";
229
+ this.textAlign = "center";
230
+ this.customClass = "";
231
+ this.overlayStyle = {};
232
+ this.overlayClass = "";
233
+ this.popStyle = {};
234
+ this.popClass = "";
235
+ this.teleport = "body";
236
+ this.id = new Date().getTime();
237
+ this.footerDirection = "horizontal";
238
+ this.onUpdate = (value) => {
239
+ };
240
+ this.onOk = () => {
241
+ };
242
+ this.onCancel = () => {
243
+ };
244
+ this.onOpened = () => {
245
+ };
246
+ this.onClosed = () => {
247
+ };
248
+ this.visible = true;
249
+ this.noFooter = false;
250
+ this.noOkBtn = false;
251
+ this.noCancelBtn = false;
252
+ this.okBtnDisabled = false;
253
+ this.closeOnPopstate = false;
254
+ this.lockScroll = false;
53
255
  }
54
256
  }
55
- class F {
56
- constructor(e2) {
57
- this.options = new z(), this.close = () => {
58
- }, this.setDefaultOptions = (e3) => {
59
- }, this.resetDefaultOptions = () => {
257
+ class DialogFunction {
258
+ constructor(_options) {
259
+ this.options = new DialogOptions();
260
+ this.close = () => {
261
+ };
262
+ this.setDefaultOptions = (options2) => {
263
+ };
264
+ this.resetDefaultOptions = () => {
265
+ };
266
+ let options = Object.assign(this.options, _options);
267
+ let elWarp = document.body;
268
+ let teleport = options.teleport;
269
+ if (teleport != "body") {
270
+ if (typeof teleport == "string") {
271
+ elWarp = document.querySelector(teleport);
272
+ } else {
273
+ elWarp = options.teleport;
274
+ }
275
+ }
276
+ const root = document.createElement("view");
277
+ root.id = "dialog-" + options.id;
278
+ const Wrapper = {
279
+ setup() {
280
+ options.onUpdate = (val) => {
281
+ if (val == false) {
282
+ elWarp.removeChild(root);
283
+ }
284
+ };
285
+ if (options == null ? void 0 : options.onOpened) {
286
+ options == null ? void 0 : options.onOpened();
287
+ }
288
+ options.teleport = `#${root.id}`;
289
+ return () => {
290
+ return h(Dialog, options);
291
+ };
292
+ }
60
293
  };
61
- let t2 = Object.assign(this.options, e2), o2 = document.body, l2 = t2.teleport;
62
- l2 != "body" && (o2 = typeof l2 == "string" ? document.querySelector(l2) : t2.teleport);
63
- const s2 = document.createElement("view");
64
- s2.id = "dialog-" + t2.id;
65
- const n2 = { setup: () => (t2.onUpdate = (e3) => {
66
- e3 == 0 && o2.removeChild(s2);
67
- }, (t2 == null ? void 0 : t2.onOpened) && (t2 == null ? void 0 : t2.onOpened()), t2.teleport = `#${s2.id}`, () => g(A, t2)) };
68
- this.instance = v(n2), o2.appendChild(s2), C(this.instance, s2);
294
+ this.instance = createVNode(Wrapper);
295
+ elWarp.appendChild(root);
296
+ render(this.instance, root);
69
297
  }
70
298
  }
71
- const L = function(e2) {
72
- return new F(e2);
299
+ const _Dialog = function(options) {
300
+ return new DialogFunction(options);
73
301
  };
74
- L.install = (e2) => {
75
- e2.use(A), e2.config.globalProperties.$dialog = L;
302
+ _Dialog.install = (app) => {
303
+ app.use(Dialog);
304
+ app.config.globalProperties.$dialog = _Dialog;
76
305
  };
77
- export { A as Dialog, z as DialogOptions, L as default };
306
+ export { Dialog, DialogOptions, _Dialog as default };
@@ -1,18 +1,70 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { computed as e, openBlock as t, createElementBlock as o, normalizeClass as n, renderSlot as i } from "vue";
7
- import { c as r } from "./component.js";
8
- import { _ as l } from "./plugin-vue_export-helper.js";
6
+ import { computed, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { componentName: a, create: s } = r("divider");
11
- var c = l(s({ props: { contentPosition: { type: String, default: "center" }, dashed: { type: Boolean, default: false }, hairline: { type: Boolean, default: true }, direction: { type: String, default: "horizontal" } }, components: {}, setup: (t2, o2) => ({ classes: e(() => {
12
- const e2 = a;
13
- let n2 = { [e2]: true }, i2 = {};
14
- return i2 = t2.direction === "horizontal" ? { ...n2, [`${e2}-center`]: o2.slots.default, [`${e2}-left`]: t2.contentPosition === "left", [`${e2}-right`]: t2.contentPosition === "right", [`${e2}-dashed`]: t2.dashed, [`${e2}-hairline`]: t2.hairline } : { ...n2, [`${e2}-vertical`]: t2.direction === "vertical" }, i2;
15
- }) }) }), [["render", function(e2, r2, l2, a2, s2, c2) {
16
- return e2.direction === "horizontal" ? (t(), o("view", { key: 0, class: n(e2.classes) }, [i(e2.$slots, "default")], 2)) : (t(), o("view", { key: 1, class: n(e2.classes) }, null, 2));
17
- }]]);
18
- export { c as default };
10
+ const { componentName, create } = createComponent("divider");
11
+ const _sfc_main = create({
12
+ props: {
13
+ contentPosition: {
14
+ type: String,
15
+ default: "center"
16
+ },
17
+ dashed: {
18
+ type: Boolean,
19
+ default: false
20
+ },
21
+ hairline: {
22
+ type: Boolean,
23
+ default: true
24
+ },
25
+ direction: {
26
+ type: String,
27
+ default: "horizontal"
28
+ }
29
+ },
30
+ components: {},
31
+ setup(props, context) {
32
+ const classes = computed(() => {
33
+ const prefixCls = componentName;
34
+ let defaultClassesObj = {
35
+ [prefixCls]: true
36
+ };
37
+ let classesObj = {};
38
+ if (props.direction === "horizontal") {
39
+ classesObj = {
40
+ ...defaultClassesObj,
41
+ [`${prefixCls}-center`]: context.slots.default,
42
+ [`${prefixCls}-left`]: props.contentPosition === "left",
43
+ [`${prefixCls}-right`]: props.contentPosition === "right",
44
+ [`${prefixCls}-dashed`]: props.dashed,
45
+ [`${prefixCls}-hairline`]: props.hairline
46
+ };
47
+ } else {
48
+ classesObj = {
49
+ ...defaultClassesObj,
50
+ [`${prefixCls}-vertical`]: props.direction === "vertical"
51
+ };
52
+ }
53
+ return classesObj;
54
+ });
55
+ return { classes };
56
+ }
57
+ });
58
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
59
+ return _ctx.direction === "horizontal" ? (openBlock(), createElementBlock("view", {
60
+ key: 0,
61
+ class: normalizeClass(_ctx.classes)
62
+ }, [
63
+ renderSlot(_ctx.$slots, "default")
64
+ ], 2)) : (openBlock(), createElementBlock("view", {
65
+ key: 1,
66
+ class: normalizeClass(_ctx.classes)
67
+ }, null, 2));
68
+ }
69
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
70
+ export { index as default };