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