@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,48 +1,166 @@
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, computed as t, onMounted as a, nextTick as l, watch as o, openBlock as u, createElementBlock as r, normalizeClass as n, createElementVNode as s, normalizeStyle as d, toDisplayString as i, createCommentVNode as m } from "vue";
7
- import { c } from "./component.js";
8
- import { _ as g } from "./plugin-vue_export-helper.js";
6
+ import { ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode } 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: p, create: h, translate: f } = c("textarea"), x = h({ props: { modelValue: { type: [String, Number], default: "" }, textAlign: { type: String, default: "" }, limitShow: { type: Boolean, default: false }, maxLength: { type: [String, Number], default: "" }, rows: { type: [String, Number], default: "2" }, placeholder: { type: String, default: "" }, readonly: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, autosize: { type: [Boolean, Object], default: false }, autofocus: { type: Boolean, default: false } }, emits: ["update:modelValue", "change", "blur", "focus"], setup(u2, { emit: r2 }) {
11
- const n2 = e(), s2 = t(() => ({ [p]: true, [`${p}--disabled`]: u2.disabled }));
12
- a(() => {
13
- u2.modelValue && m2(String(u2.modelValue)), u2.autosize && l(i2);
14
- });
15
- const d2 = t(() => ({ textAlign: u2.textAlign })), i2 = () => {
16
- let e2 = n2.value;
17
- e2.style.height = "auto";
18
- let t2 = e2.scrollHeight;
19
- if (typeof u2.autosize == "object") {
20
- const { maxHeight: e3, minHeight: a2 } = u2.autosize;
21
- e3 !== void 0 && (t2 = Math.min(t2, e3)), a2 !== void 0 && (t2 = Math.max(t2, a2));
10
+ const { componentName, create, translate } = createComponent("textarea");
11
+ const _sfc_main = create({
12
+ props: {
13
+ modelValue: {
14
+ type: [String, Number],
15
+ default: ""
16
+ },
17
+ textAlign: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ limitShow: {
22
+ type: Boolean,
23
+ default: false
24
+ },
25
+ maxLength: {
26
+ type: [String, Number],
27
+ default: ""
28
+ },
29
+ rows: {
30
+ type: [String, Number],
31
+ default: "2"
32
+ },
33
+ placeholder: {
34
+ type: String,
35
+ default: ""
36
+ },
37
+ readonly: {
38
+ type: Boolean,
39
+ default: false
40
+ },
41
+ disabled: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ autosize: {
46
+ type: [Boolean, Object],
47
+ default: false
48
+ },
49
+ autofocus: {
50
+ type: Boolean,
51
+ default: false
22
52
  }
23
- t2 && (e2.style.height = t2 + "px");
24
- };
25
- o(() => u2.modelValue, () => {
26
- u2.autosize && l(i2);
27
- });
28
- const m2 = (e2, t2) => {
29
- u2.maxLength && e2.length > Number(u2.maxLength) && (e2 = e2.substring(0, Number(u2.maxLength))), r2("update:modelValue", e2, t2), r2("change", e2, t2);
30
- };
31
- return { textareaRef: n2, classes: s2, styles: d2, change: (e2) => {
32
- const t2 = e2.target;
33
- m2(t2.value, e2);
34
- }, focus: (e2) => {
35
- u2.disabled || u2.readonly || r2("focus", e2);
36
- }, blur: (e2) => {
37
- if (u2.disabled)
38
- return;
39
- if (u2.readonly)
40
- return;
41
- let t2 = e2.target.value;
42
- m2(t2, e2), r2("blur", { value: t2, event: e2 });
43
- }, translate: f };
44
- } }), y = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "autofocus"], b = { key: 0, class: "nut-textarea__limit" };
45
- var v = g(x, [["render", function(e2, t2, a2, l2, o2, c2) {
46
- return u(), r("view", { class: n(e2.classes) }, [s("textarea", { ref: "textareaRef", class: "nut-textarea__textarea", style: d(e2.styles), rows: e2.rows, disabled: e2.disabled, readonly: e2.readonly, value: e2.modelValue, onInput: t2[0] || (t2[0] = (...t3) => e2.change && e2.change(...t3)), onBlur: t2[1] || (t2[1] = (...t3) => e2.blur && e2.blur(...t3)), onFocus: t2[2] || (t2[2] = (...t3) => e2.focus && e2.focus(...t3)), maxlength: e2.maxLength, placeholder: e2.placeholder || e2.translate("placeholder"), autofocus: e2.autofocus }, null, 44, y), e2.limitShow ? (u(), r("view", b, i(e2.modelValue ? e2.modelValue.length : 0) + "/" + i(e2.maxLength), 1)) : m("", true)], 2);
47
- }]]);
48
- export { v as default };
53
+ },
54
+ emits: ["update:modelValue", "change", "blur", "focus"],
55
+ setup(props, { emit }) {
56
+ const textareaRef = ref();
57
+ const classes = computed(() => {
58
+ const prefixCls = componentName;
59
+ return {
60
+ [prefixCls]: true,
61
+ [`${prefixCls}--disabled`]: props.disabled
62
+ };
63
+ });
64
+ onMounted(() => {
65
+ if (props.modelValue) {
66
+ emitChange(String(props.modelValue));
67
+ }
68
+ if (props.autosize) {
69
+ nextTick(getContentHeight);
70
+ }
71
+ });
72
+ const styles = computed(() => {
73
+ return {
74
+ textAlign: props.textAlign
75
+ };
76
+ });
77
+ const getContentHeight = () => {
78
+ let textarea = textareaRef.value;
79
+ textarea.style.height = "auto";
80
+ let height = textarea.scrollHeight;
81
+ if (typeof props.autosize === "object") {
82
+ const { maxHeight, minHeight } = props.autosize;
83
+ if (maxHeight !== void 0) {
84
+ height = Math.min(height, maxHeight);
85
+ }
86
+ if (minHeight !== void 0) {
87
+ height = Math.max(height, minHeight);
88
+ }
89
+ }
90
+ if (height) {
91
+ textarea.style.height = height + "px";
92
+ }
93
+ };
94
+ watch(() => props.modelValue, () => {
95
+ if (props.autosize) {
96
+ nextTick(getContentHeight);
97
+ }
98
+ });
99
+ const emitChange = (value, event) => {
100
+ if (props.maxLength && value.length > Number(props.maxLength)) {
101
+ value = value.substring(0, Number(props.maxLength));
102
+ }
103
+ emit("update:modelValue", value, event);
104
+ emit("change", value, event);
105
+ };
106
+ const change = (event) => {
107
+ const input = event.target;
108
+ emitChange(input.value, event);
109
+ };
110
+ const focus = (event) => {
111
+ if (props.disabled)
112
+ return;
113
+ if (props.readonly)
114
+ return;
115
+ emit("focus", event);
116
+ };
117
+ const blur = (event) => {
118
+ if (props.disabled)
119
+ return;
120
+ if (props.readonly)
121
+ return;
122
+ const input = event.target;
123
+ let value = input.value;
124
+ emitChange(value, event);
125
+ emit("blur", { value, event });
126
+ };
127
+ return {
128
+ textareaRef,
129
+ classes,
130
+ styles,
131
+ change,
132
+ focus,
133
+ blur,
134
+ translate
135
+ };
136
+ }
137
+ });
138
+ const _hoisted_1 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "autofocus"];
139
+ const _hoisted_2 = {
140
+ key: 0,
141
+ class: "nut-textarea__limit"
142
+ };
143
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
144
+ return openBlock(), createElementBlock("view", {
145
+ class: normalizeClass(_ctx.classes)
146
+ }, [
147
+ createElementVNode("textarea", {
148
+ ref: "textareaRef",
149
+ class: "nut-textarea__textarea",
150
+ style: normalizeStyle(_ctx.styles),
151
+ rows: _ctx.rows,
152
+ disabled: _ctx.disabled,
153
+ readonly: _ctx.readonly,
154
+ value: _ctx.modelValue,
155
+ onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
156
+ onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
157
+ onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args)),
158
+ maxlength: _ctx.maxLength,
159
+ placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
160
+ autofocus: _ctx.autofocus
161
+ }, null, 44, _hoisted_1),
162
+ _ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true)
163
+ ], 2);
164
+ }
165
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
166
+ export { index as default };
@@ -1,23 +1,84 @@
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 { inject as e, reactive as t, computed as i, toRefs as r, openBlock as l, createElementBlock as a, normalizeClass as n, createElementVNode as s, Fragment as m, renderList as c, toDisplayString as u } from "vue";
7
- import { c as d } from "./component.js";
8
- import { _ } from "./plugin-vue_export-helper.js";
6
+ import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, toDisplayString } 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: o, create: p } = d("timedetail"), f = p({ name: "timedetail", props: { times: { type: Array, default: () => [] }, detailKey: { type: [Number, String], default: 0 } }, emits: ["select"], setup: (l2, a2) => {
11
- const n2 = e("currentKey"), s2 = e("currentTime"), m2 = t({ currentKey: n2, currentTime: s2 }), c2 = i(() => ({ [o]: true })), u2 = i(() => l2.times.find((e2) => e2.key == m2.currentKey).list);
12
- return { classes: c2, ...r(m2), getClass: (e2) => {
13
- let t2 = m2.currentTime.find((e3) => e3.key == m2.currentKey);
14
- if (t2)
15
- return { "nut-timedetail__detail__list__item": true, "nut-timedetail__detail__list__item--curr": t2.list.filter((t3) => t3 === e2).length > 0 };
16
- }, renderData: u2, handleTime: (e2) => {
17
- a2.emit("select", e2);
18
- } };
19
- } }), y = { class: "nut-timedetail__detail nut-timedetail__detail--moring" }, g = { class: "nut-timedetail__detail__list" }, v = ["onClick"];
20
- var k = _(f, [["render", function(e2, t2, i2, r2, d2, _2) {
21
- return l(), a("view", { class: n(e2.classes) }, [s("view", y, [s("view", g, [(l(true), a(m, null, c(e2.renderData, (t3) => (l(), a("view", { class: n(e2.getClass(t3)), key: t3, onClick: (i3) => e2.handleTime(t3) }, u(t3), 11, v))), 128))])])], 2);
22
- }]]);
23
- export { k as default };
10
+ const { componentName, create } = createComponent("timedetail");
11
+ const _sfc_main = create({
12
+ name: "timedetail",
13
+ props: {
14
+ times: {
15
+ type: Array,
16
+ default: () => {
17
+ return [];
18
+ }
19
+ },
20
+ detailKey: {
21
+ type: [Number, String],
22
+ default: 0
23
+ }
24
+ },
25
+ emits: ["select"],
26
+ setup: (props, context) => {
27
+ const currentKey = inject("currentKey");
28
+ const currentTime = inject("currentTime");
29
+ const state = reactive({
30
+ currentKey,
31
+ currentTime
32
+ });
33
+ const classes = computed(() => {
34
+ const prefixCls = componentName;
35
+ return {
36
+ [prefixCls]: true
37
+ };
38
+ });
39
+ const getClass = (item) => {
40
+ let find = state.currentTime.find((item2) => item2.key == state.currentKey);
41
+ if (find) {
42
+ return {
43
+ "nut-timedetail__detail__list__item": true,
44
+ "nut-timedetail__detail__list__item--curr": find.list.filter((value) => value === item).length > 0
45
+ };
46
+ }
47
+ };
48
+ const renderData = computed(() => {
49
+ return props.times.find((time) => time.key == state.currentKey)["list"];
50
+ });
51
+ const handleTime = (time) => {
52
+ context.emit("select", time);
53
+ };
54
+ return {
55
+ classes,
56
+ ...toRefs(state),
57
+ getClass,
58
+ renderData,
59
+ handleTime
60
+ };
61
+ }
62
+ });
63
+ const _hoisted_1 = { class: "nut-timedetail__detail nut-timedetail__detail--moring" };
64
+ const _hoisted_2 = { class: "nut-timedetail__detail__list" };
65
+ const _hoisted_3 = ["onClick"];
66
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
67
+ return openBlock(), createElementBlock("view", {
68
+ class: normalizeClass(_ctx.classes)
69
+ }, [
70
+ createElementVNode("view", _hoisted_1, [
71
+ createElementVNode("view", _hoisted_2, [
72
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.renderData, (item) => {
73
+ return openBlock(), createElementBlock("view", {
74
+ class: normalizeClass(_ctx.getClass(item)),
75
+ key: item,
76
+ onClick: ($event) => _ctx.handleTime(item)
77
+ }, toDisplayString(item), 11, _hoisted_3);
78
+ }), 128))
79
+ ])
80
+ ])
81
+ ], 2);
82
+ }
83
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
84
+ export { index as default };
@@ -1,19 +1,53 @@
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 { inject as e, reactive as n, computed as t, toRefs as r, openBlock as a, createElementBlock as l, normalizeClass as p, toDisplayString as m } from "vue";
7
- import { c as o } from "./component.js";
8
- import { _ as c } from "./plugin-vue_export-helper.js";
6
+ import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString } 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: s, create: u } = o("timepannel");
11
- var i = c(u({ name: "timepannel", props: { name: { type: String, default: "" }, pannelKey: { type: [Number, String], default: 0 } }, emits: ["change"], setup: (a2, l2) => {
12
- const p2 = e("currentKey"), m2 = n({ currentKey: p2 }), o2 = t(() => ({ [s]: true, "nut-timepannel--curr": m2.currentKey == a2.pannelKey }));
13
- return { ...r(m2), classes: o2, handlePannel: (e2) => {
14
- l2.emit("change", e2);
15
- } };
16
- } }), [["render", function(e2, n2, t2, r2, o2, c2) {
17
- return a(), l("view", { class: p(e2.classes), onClick: n2[0] || (n2[0] = (n3) => e2.handlePannel(e2.pannelKey)) }, m(e2.name), 3);
18
- }]]);
19
- export { i as default };
10
+ const { componentName, create } = createComponent("timepannel");
11
+ const _sfc_main = create({
12
+ name: "timepannel",
13
+ props: {
14
+ name: {
15
+ type: String,
16
+ default: ""
17
+ },
18
+ pannelKey: {
19
+ type: [Number, String],
20
+ default: 0
21
+ }
22
+ },
23
+ emits: ["change"],
24
+ setup: (props, context) => {
25
+ const currentKey = inject("currentKey");
26
+ const state = reactive({
27
+ currentKey
28
+ });
29
+ const classes = computed(() => {
30
+ const prefixCls = componentName;
31
+ return {
32
+ [prefixCls]: true,
33
+ "nut-timepannel--curr": state.currentKey == props.pannelKey
34
+ };
35
+ });
36
+ const handlePannel = (pannelKey) => {
37
+ context.emit("change", pannelKey);
38
+ };
39
+ return {
40
+ ...toRefs(state),
41
+ classes,
42
+ handlePannel
43
+ };
44
+ }
45
+ });
46
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
47
+ return openBlock(), createElementBlock("view", {
48
+ class: normalizeClass(_ctx.classes),
49
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handlePannel(_ctx.pannelKey))
50
+ }, toDisplayString(_ctx.name), 3);
51
+ }
52
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
53
+ export { index as default };
@@ -1,20 +1,117 @@
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, provide as t, resolveComponent as l, openBlock as s, createBlock as o, normalizeStyle as i, withCtx as r, createElementVNode as n, normalizeClass as c, createElementBlock as a, toDisplayString as p, renderSlot as u } from "vue";
7
- import { c as m } from "./component.js";
8
- import { _ as y } from "./plugin-vue_export-helper.js";
6
+ import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, 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: _, create: v, translate: d } = m("timeselect"), f = v({ props: { visible: { type: Boolean, defalut: false }, height: { type: [String], default: "20%" }, title: { type: String, default: "" }, currentKey: { type: [Number, String], default: 0 }, currentTime: { type: Array, default: () => [] }, lockScroll: { type: [Boolean], default: false }, isWrapTeleport: { type: Boolean, default: false } }, emits: ["update:visible", "select"], setup: (l2, s2) => {
11
- const o2 = e(() => ({ [_]: true })), i2 = e(() => ({ width: "100%", height: l2.height })), r2 = e(() => l2.currentKey), n2 = e(() => l2.currentTime);
12
- return t("currentKey", r2), t("currentTime", n2), { classes: o2, popStyle: i2, props: l2, close: () => {
13
- s2.emit("update:visible", false), s2.emit("select", n2.value);
14
- }, translate: d };
15
- } }), k = { class: "nut-timeselect__title" }, b = { class: "nut-timeselect__title__fixed" }, g = { key: 0 }, h = { class: "nut-timeselect__content" }, T = { class: "nut-timeselect__content__pannel" }, w = { class: "nut-timeselect__content__detail" };
16
- var S = y(f, [["render", function(e2, t2, m2, y2, _2, v2) {
17
- const d2 = l("nut-popup");
18
- return s(), o(d2, { position: "bottom", closeable: "", round: "", isWrapTeleport: e2.isWrapTeleport, visible: e2.visible, style: i(e2.popStyle), "lock-scroll": e2.lockScroll, onClickOverlay: e2.close, onClickCloseIcon: e2.close }, { default: r(() => [n("view", { class: c(e2.classes) }, [n("view", k, [n("view", b, [e2.$slots.title ? u(e2.$slots, "title", { key: 1 }) : (s(), a("span", g, p(e2.title || e2.translate("pickupTime")), 1))])]), n("view", h, [n("view", T, [u(e2.$slots, "pannel")]), n("view", w, [u(e2.$slots, "detail")])])], 2)]), _: 3 }, 8, ["isWrapTeleport", "visible", "style", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
19
- }]]);
20
- export { S as default };
10
+ const { componentName, create, translate } = createComponent("timeselect");
11
+ const _sfc_main = create({
12
+ props: {
13
+ visible: {
14
+ type: Boolean,
15
+ defalut: false
16
+ },
17
+ height: {
18
+ type: [String],
19
+ default: "20%"
20
+ },
21
+ title: {
22
+ type: String,
23
+ default: ""
24
+ },
25
+ currentKey: {
26
+ type: [Number, String],
27
+ default: 0
28
+ },
29
+ currentTime: {
30
+ type: Array,
31
+ default: () => {
32
+ return [];
33
+ }
34
+ },
35
+ lockScroll: {
36
+ type: [Boolean],
37
+ default: false
38
+ },
39
+ isWrapTeleport: {
40
+ type: Boolean,
41
+ default: false
42
+ }
43
+ },
44
+ emits: ["update:visible", "select"],
45
+ setup: (props, context) => {
46
+ const classes = computed(() => {
47
+ const prefixCls = componentName;
48
+ return {
49
+ [prefixCls]: true
50
+ };
51
+ });
52
+ const popStyle = computed(() => {
53
+ return {
54
+ width: "100%",
55
+ height: props.height
56
+ };
57
+ });
58
+ const currentKey = computed(() => props.currentKey);
59
+ const currentTime = computed(() => props.currentTime);
60
+ const close = () => {
61
+ context.emit("update:visible", false);
62
+ context.emit("select", currentTime.value);
63
+ };
64
+ provide("currentKey", currentKey);
65
+ provide("currentTime", currentTime);
66
+ return {
67
+ classes,
68
+ popStyle,
69
+ props,
70
+ close,
71
+ translate
72
+ };
73
+ }
74
+ });
75
+ const _hoisted_1 = { class: "nut-timeselect__title" };
76
+ const _hoisted_2 = { class: "nut-timeselect__title__fixed" };
77
+ const _hoisted_3 = { key: 0 };
78
+ const _hoisted_4 = { class: "nut-timeselect__content" };
79
+ const _hoisted_5 = { class: "nut-timeselect__content__pannel" };
80
+ const _hoisted_6 = { class: "nut-timeselect__content__detail" };
81
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
82
+ const _component_nut_popup = resolveComponent("nut-popup");
83
+ return openBlock(), createBlock(_component_nut_popup, {
84
+ position: "bottom",
85
+ closeable: "",
86
+ round: "",
87
+ isWrapTeleport: _ctx.isWrapTeleport,
88
+ visible: _ctx.visible,
89
+ style: normalizeStyle(_ctx.popStyle),
90
+ "lock-scroll": _ctx.lockScroll,
91
+ onClickOverlay: _ctx.close,
92
+ onClickCloseIcon: _ctx.close
93
+ }, {
94
+ default: withCtx(() => [
95
+ createElementVNode("view", {
96
+ class: normalizeClass(_ctx.classes)
97
+ }, [
98
+ createElementVNode("view", _hoisted_1, [
99
+ createElementVNode("view", _hoisted_2, [
100
+ !_ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title || _ctx.translate("pickupTime")), 1)) : renderSlot(_ctx.$slots, "title", { key: 1 })
101
+ ])
102
+ ]),
103
+ createElementVNode("view", _hoisted_4, [
104
+ createElementVNode("view", _hoisted_5, [
105
+ renderSlot(_ctx.$slots, "pannel")
106
+ ]),
107
+ createElementVNode("view", _hoisted_6, [
108
+ renderSlot(_ctx.$slots, "detail")
109
+ ])
110
+ ])
111
+ ], 2)
112
+ ]),
113
+ _: 3
114
+ }, 8, ["isWrapTeleport", "visible", "style", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]);
115
+ }
116
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
117
+ export { index as default };