@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,42 +1,198 @@
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 { c as e } from "./component.js";
7
- import { ref as o, computed as a, resolveComponent as t, openBlock as l, createElementBlock as n, normalizeClass as c, Fragment as i, renderList as r, normalizeStyle as s, createVNode as u, createBlock as f, createCommentVNode as m } from "vue";
8
- import { p as d } from "./pxCheck.js";
9
- import { u as p } from "./index4.js";
10
- import { _ as h } from "./plugin-vue_export-helper.js";
6
+ import { c as createComponent } from "./component.js";
7
+ import { ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, normalizeStyle, createVNode, createBlock, createCommentVNode } from "vue";
8
+ import { p as pxCheck } from "./pxCheck.js";
9
+ import { u as useTouch } from "./index4.js";
10
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
11
11
  import "../locale/lang";
12
- const { componentName: C } = e("rate"), k = ((e2 = true) => ({ props: { count: { type: [String, Number], default: 5 }, modelValue: { type: [String, Number], default: 0 }, iconSize: { type: [String, Number], default: 18 }, activeColor: { type: String, default: "" }, voidColor: { type: String, default: "" }, uncheckedIcon: { type: String, default: "star-n" }, checkedIcon: { type: String, default: "star-fill-n" }, readonly: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, allowHalf: { type: Boolean, default: false }, touchable: { type: Boolean, default: true }, spacing: { type: [String, Number], default: 14 }, classPrefix: { type: String, default: "nut-icon" }, fontClassName: { type: String, default: "nutui-iconfont" } }, emits: ["update:modelValue", "change"], setup(t2, { emit: l2 }) {
13
- const n2 = o([]), c2 = a(() => ({ [C]: true })), i2 = (e3) => {
14
- l2("update:modelValue", e3), l2("change", e3);
15
- }, r2 = p(), s2 = { onTouchStart(e3) {
16
- t2.touchable && r2.start(e3);
17
- }, onTouchMove(o2) {
18
- t2.touchable && e2 && (r2.move(o2), r2.isHorizontal() && n2.value && (o2.preventDefault(), i2(((e3, o3, a2) => {
19
- let t3 = 0;
20
- for (let l3 = o3.value.length - 1; l3 >= 0; l3--) {
21
- const n3 = o3.value[l3];
22
- if (e3 > n3.offsetLeft) {
23
- t3 = a2 ? l3 + (e3 > n3.offsetLeft + n3.clientWidth / 2 ? 1 : 0.5) : l3 + 1;
24
- break;
25
- }
12
+ const { componentName } = createComponent("rate");
13
+ const useComponent = (touchable = true) => {
14
+ return {
15
+ props: {
16
+ count: {
17
+ type: [String, Number],
18
+ default: 5
19
+ },
20
+ modelValue: {
21
+ type: [String, Number],
22
+ default: 0
23
+ },
24
+ iconSize: {
25
+ type: [String, Number],
26
+ default: 18
27
+ },
28
+ activeColor: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ voidColor: {
33
+ type: String,
34
+ default: ""
35
+ },
36
+ uncheckedIcon: {
37
+ type: String,
38
+ default: "star-n"
39
+ },
40
+ checkedIcon: {
41
+ type: String,
42
+ default: "star-fill-n"
43
+ },
44
+ readonly: {
45
+ type: Boolean,
46
+ default: false
47
+ },
48
+ disabled: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ allowHalf: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ touchable: {
57
+ type: Boolean,
58
+ default: true
59
+ },
60
+ spacing: {
61
+ type: [String, Number],
62
+ default: 14
63
+ },
64
+ classPrefix: {
65
+ type: String,
66
+ default: "nut-icon"
67
+ },
68
+ fontClassName: {
69
+ type: String,
70
+ default: "nutui-iconfont"
26
71
  }
27
- return t3;
28
- })(r2.moveX.value, n2, t2.allowHalf))));
29
- } }, u2 = Math.random().toString(36).slice(-8);
30
- return { classes: c2, ...s2, onClick: (e3, o2) => {
31
- if (t2.disabled || t2.readonly)
32
- return;
33
- let a2 = 0;
34
- o2 === 1 && t2.modelValue === o2 || (a2 = o2, t2.allowHalf && e3 == 2 && (a2 -= 0.5)), i2(a2);
35
- }, pxCheck: d, rateRefs: n2, refRandomId: u2 };
36
- } }))(), v = ["id"];
37
- const { create: g } = e("rate");
38
- var y = h(g(k), [["render", function(e2, o2, a2, d2, p2, h2) {
39
- const C2 = t("nut-icon");
40
- return l(), n("view", { class: c(e2.classes), onTouchstart: o2[0] || (o2[0] = (...o3) => e2.onTouchStart && e2.onTouchStart(...o3)), onTouchmove: o2[1] || (o2[1] = (...o3) => e2.onTouchMove && e2.onTouchMove(...o3)) }, [(l(true), n(i, null, r(Number(e2.count), (o3) => (l(), n("view", { class: "nut-rate-item", key: o3, ref: "rateRefs", id: "rateRefs-" + e2.refRandomId + o3, style: s({ marginRight: e2.pxCheck(e2.spacing) }) }, [u(C2, { size: e2.iconSize, class: c(["nut-rate-item__icon", { "nut-rate-item__icon--disabled": e2.disabled || o3 > e2.modelValue }]), onClick: (a3) => e2.onClick(1, o3), color: o3 <= e2.modelValue ? e2.activeColor : e2.voidColor, "font-class-name": e2.fontClassName, "class-prefix": e2.classPrefix, name: o3 <= e2.modelValue ? e2.checkedIcon : e2.uncheckedIcon }, null, 8, ["size", "onClick", "class", "color", "font-class-name", "class-prefix", "name"]), e2.allowHalf && Number(e2.modelValue) + 1 > o3 ? (l(), f(C2, { key: 0, class: "nut-rate-item__icon nut-rate-item__icon--half", onClick: (a3) => e2.onClick(2, o3), "font-class-name": e2.fontClassName, "class-prefix": e2.classPrefix, color: o3 <= Number(e2.modelValue) + 1 ? e2.activeColor : e2.voidColor, size: e2.iconSize, name: e2.checkedIcon }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : e2.allowHalf && Number(e2.modelValue) + 1 < o3 ? (l(), f(C2, { key: 1, class: "nut-rate-item__icon nut-rate-item__icon--disabled nut-rate-item__icon--half", onClick: (a3) => e2.onClick(2, o3), "font-class-name": e2.fontClassName, "class-prefix": e2.classPrefix, color: e2.voidColor, size: e2.iconSize, name: e2.uncheckedIcon }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : m("", true)], 12, v))), 128))], 34);
41
- }]]);
42
- export { y as default };
72
+ },
73
+ emits: ["update:modelValue", "change"],
74
+ setup(props, { emit }) {
75
+ const rateRefs = ref([]);
76
+ const classes = computed(() => {
77
+ const prefixCls = componentName;
78
+ return {
79
+ [prefixCls]: true
80
+ };
81
+ });
82
+ const updateVal = (value) => {
83
+ emit("update:modelValue", value);
84
+ emit("change", value);
85
+ };
86
+ const onClick = (e, index2) => {
87
+ if (props.disabled || props.readonly)
88
+ return;
89
+ let value = 0;
90
+ if (index2 === 1 && props.modelValue === index2)
91
+ ;
92
+ else {
93
+ value = index2;
94
+ if (props.allowHalf && e == 2) {
95
+ value -= 0.5;
96
+ }
97
+ }
98
+ updateVal(value);
99
+ };
100
+ const getScoreByPosition = (x, rateRefs2, allowHalf) => {
101
+ let v = 0;
102
+ for (let index2 = rateRefs2.value.length - 1; index2 >= 0; index2--) {
103
+ const item = rateRefs2.value[index2];
104
+ if (x > item.offsetLeft) {
105
+ if (allowHalf) {
106
+ v = index2 + (x > item.offsetLeft + item.clientWidth / 2 ? 1 : 0.5);
107
+ } else {
108
+ v = index2 + 1;
109
+ }
110
+ break;
111
+ }
112
+ }
113
+ return v;
114
+ };
115
+ const touch = useTouch();
116
+ const touchMethods = {
117
+ onTouchStart(event) {
118
+ if (!props.touchable)
119
+ return;
120
+ touch.start(event);
121
+ },
122
+ onTouchMove(event) {
123
+ if (!props.touchable || !touchable)
124
+ return;
125
+ touch.move(event);
126
+ if (touch.isHorizontal()) {
127
+ if (rateRefs.value) {
128
+ event.preventDefault();
129
+ updateVal(getScoreByPosition(touch.moveX.value, rateRefs, props.allowHalf));
130
+ }
131
+ }
132
+ }
133
+ };
134
+ const refRandomId = Math.random().toString(36).slice(-8);
135
+ return {
136
+ classes,
137
+ ...touchMethods,
138
+ onClick,
139
+ pxCheck,
140
+ rateRefs,
141
+ refRandomId
142
+ };
143
+ }
144
+ };
145
+ };
146
+ const component = useComponent();
147
+ const _hoisted_1 = ["id"];
148
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
149
+ const _component_nut_icon = resolveComponent("nut-icon");
150
+ return openBlock(), createElementBlock("view", {
151
+ class: normalizeClass(_ctx.classes),
152
+ onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
153
+ onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args))
154
+ }, [
155
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Number(_ctx.count), (n) => {
156
+ return openBlock(), createElementBlock("view", {
157
+ class: "nut-rate-item",
158
+ key: n,
159
+ ref: "rateRefs",
160
+ id: "rateRefs-" + _ctx.refRandomId + n,
161
+ style: normalizeStyle({ marginRight: _ctx.pxCheck(_ctx.spacing) })
162
+ }, [
163
+ createVNode(_component_nut_icon, {
164
+ size: _ctx.iconSize,
165
+ class: normalizeClass(["nut-rate-item__icon", { "nut-rate-item__icon--disabled": _ctx.disabled || n > _ctx.modelValue }]),
166
+ onClick: ($event) => _ctx.onClick(1, n),
167
+ color: n <= _ctx.modelValue ? _ctx.activeColor : _ctx.voidColor,
168
+ "font-class-name": _ctx.fontClassName,
169
+ "class-prefix": _ctx.classPrefix,
170
+ name: n <= _ctx.modelValue ? _ctx.checkedIcon : _ctx.uncheckedIcon
171
+ }, null, 8, ["size", "onClick", "class", "color", "font-class-name", "class-prefix", "name"]),
172
+ _ctx.allowHalf && Number(_ctx.modelValue) + 1 > n ? (openBlock(), createBlock(_component_nut_icon, {
173
+ key: 0,
174
+ class: "nut-rate-item__icon nut-rate-item__icon--half",
175
+ onClick: ($event) => _ctx.onClick(2, n),
176
+ "font-class-name": _ctx.fontClassName,
177
+ "class-prefix": _ctx.classPrefix,
178
+ color: n <= Number(_ctx.modelValue) + 1 ? _ctx.activeColor : _ctx.voidColor,
179
+ size: _ctx.iconSize,
180
+ name: _ctx.checkedIcon
181
+ }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : _ctx.allowHalf && Number(_ctx.modelValue) + 1 < n ? (openBlock(), createBlock(_component_nut_icon, {
182
+ key: 1,
183
+ class: "nut-rate-item__icon nut-rate-item__icon--disabled nut-rate-item__icon--half",
184
+ onClick: ($event) => _ctx.onClick(2, n),
185
+ "font-class-name": _ctx.fontClassName,
186
+ "class-prefix": _ctx.classPrefix,
187
+ color: _ctx.voidColor,
188
+ size: _ctx.iconSize,
189
+ name: _ctx.uncheckedIcon
190
+ }, null, 8, ["onClick", "font-class-name", "class-prefix", "color", "size", "name"])) : createCommentVNode("", true)
191
+ ], 12, _hoisted_1);
192
+ }), 128))
193
+ ], 34);
194
+ }
195
+ const { create } = createComponent("rate");
196
+ const _sfc_main = create(component);
197
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
198
+ export { index as default };
@@ -1,27 +1,69 @@
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 { provide as t, openBlock as e, createElementBlock as r, normalizeClass as n, renderSlot as l } from "vue";
7
- import { c as a } from "./component.js";
8
- import { _ as o } from "./plugin-vue_export-helper.js";
6
+ import { provide, 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: i, create: s } = a("row");
11
- var p = o(s({ props: { type: { type: String, default: "" }, gutter: { type: [String, Number], default: "" }, justify: { type: String, default: "start" }, align: { type: String, default: "flex-start" }, flexWrap: { type: String, default: "nowrap" } }, emits: ["click"], setup(e2, { emit: r2 }) {
12
- const n2 = i;
13
- t("gutter", e2.gutter);
14
- const l2 = (t2, e3) => t2 ? e3 ? `nut-row-${t2}-${e3}` : "" : `nut-row-${e3}`;
15
- return { getClasses: () => `
16
- ${l2("", e2.type)}
17
- ${l2("justify", e2.justify)}
18
- ${l2("align", e2.align)}
19
- ${l2("flex", e2.flexWrap)}
20
- ${n2}
21
- `, handleClick: (t2) => {
22
- t2.stopPropagation(), r2("click", t2);
23
- } };
24
- } }), [["render", function(t2, a2, o2, i2, s2, p2) {
25
- return e(), r("view", { class: n(t2.getClasses()), onClick: a2[0] || (a2[0] = (...e2) => t2.handleClick && t2.handleClick(...e2)) }, [l(t2.$slots, "default")], 2);
26
- }]]);
27
- export { p as default };
10
+ const { componentName, create } = createComponent("row");
11
+ const _sfc_main = create({
12
+ props: {
13
+ type: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ gutter: {
18
+ type: [String, Number],
19
+ default: ""
20
+ },
21
+ justify: {
22
+ type: String,
23
+ default: "start"
24
+ },
25
+ align: {
26
+ type: String,
27
+ default: "flex-start"
28
+ },
29
+ flexWrap: {
30
+ type: String,
31
+ default: "nowrap"
32
+ }
33
+ },
34
+ emits: ["click"],
35
+ setup(props, { emit }) {
36
+ const prefixCls = componentName;
37
+ provide("gutter", props.gutter);
38
+ const getClass = (prefix, type) => {
39
+ return prefix ? type ? `nut-row-${prefix}-${type}` : "" : `nut-row-${type}`;
40
+ };
41
+ const getClasses = () => {
42
+ return `
43
+ ${getClass("", props.type)}
44
+ ${getClass("justify", props.justify)}
45
+ ${getClass("align", props.align)}
46
+ ${getClass("flex", props.flexWrap)}
47
+ ${prefixCls}
48
+ `;
49
+ };
50
+ const handleClick = (evt) => {
51
+ evt.stopPropagation();
52
+ emit("click", evt);
53
+ };
54
+ return {
55
+ getClasses,
56
+ handleClick
57
+ };
58
+ }
59
+ });
60
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
61
+ return openBlock(), createElementBlock("view", {
62
+ class: normalizeClass(_ctx.getClasses()),
63
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
64
+ }, [
65
+ renderSlot(_ctx.$slots, "default")
66
+ ], 2);
67
+ }
68
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
69
+ export { index as default };
@@ -1,42 +1,243 @@
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 { reactive as e, computed as a, ref as l, onMounted as t, toRefs as r, resolveComponent as n, openBlock as c, createElementBlock as u, normalizeStyle as i, toDisplayString as o, createCommentVNode as s, renderSlot as h, createElementVNode as p, withModifiers as d, withDirectives as g, createVNode as b, vShow as m } from "vue";
7
- import { c as f } from "./component.js";
8
- import { _ as y } from "./plugin-vue_export-helper.js";
6
+ import { reactive, computed, ref, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createElementVNode, withModifiers, withDirectives, createVNode, vShow } 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 { create: k, translate: v } = f("searchbar"), _ = k({ props: { modelValue: { type: [String, Number], default: "" }, inputType: { type: String, default: "textarea" }, label: { type: String, default: "" }, maxLength: { type: [String, Number], default: "9999" }, placeholder: { type: String, default: "" }, clearable: { type: Boolean, default: true }, background: { type: String, default: "" }, inputBackground: { type: String, default: "" }, autofocus: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, readonly: { type: Boolean, default: false }, inputAlign: { type: String, default: "left" } }, emits: ["change", "update:modelValue", "blur", "focus", "clear", "search", "click-input", "click-left-icon", "click-right-icon"], setup(n2, { emit: c2 }) {
11
- const u2 = e({ active: false }), i2 = a(() => ({ background: n2.background })), o2 = a(() => ({ background: n2.inputBackground })), s2 = a(() => ({ "text-align": n2.inputAlign })), h2 = l(null);
12
- return t(() => {
13
- n2.autofocus && h2.value.focus();
14
- }), { inputsearch: h2, ...r(u2), valueChange: (e2) => {
15
- let a2 = e2.target.value;
16
- n2.maxLength && a2.length > Number(n2.maxLength) && (a2 = a2.slice(0, Number(n2.maxLength))), c2("update:modelValue", a2, e2), c2("change", a2, e2);
17
- }, valueFocus: (e2) => {
18
- let a2 = e2.target.value;
19
- u2.active = true, c2("focus", a2, e2);
20
- }, valueBlur: (e2) => {
21
- setTimeout(() => {
22
- u2.active = false;
23
- }, 0);
24
- let a2 = e2.target.value;
25
- n2.maxLength && a2.length > Number(n2.maxLength) && (a2 = a2.slice(0, Number(n2.maxLength))), c2("blur", a2, e2);
26
- }, handleClear: (e2) => {
27
- c2("update:modelValue", "", e2), c2("change", "", e2), c2("clear", "");
28
- }, handleSubmit: () => {
29
- c2("search", n2.modelValue);
30
- }, searchbarStyle: i2, inputSearchbarStyle: o2, translate: v, clickInput: (e2) => {
31
- c2("click-input", e2);
32
- }, leftIconClick: (e2) => {
33
- c2("click-left-icon", n2.modelValue, e2);
34
- }, rightIconClick: (e2) => {
35
- c2("click-right-icon", n2.modelValue, e2);
36
- }, styleSearchbar: s2 };
37
- } }), S = { key: 0, class: "nut-searchbar__search-label" }, C = { key: 1, class: "nut-searchbar__search-icon nut-searchbar__left-search-icon" }, x = { class: "nut-searchbar__input-inner" }, B = ["type", "maxlength", "placeholder", "value", "disabled", "readonly"], I = { key: 2, class: "nut-searchbar__search-icon nut-searchbar__right-search-icon" };
38
- var V = y(_, [["render", function(e2, a2, l2, t2, r2, f2) {
39
- const y2 = n("nut-icon");
40
- return c(), u("view", { class: "nut-searchbar", style: i(e2.searchbarStyle) }, [e2.label ? (c(), u("span", S, o(e2.label), 1)) : s("", true), e2.$slots.leftout ? (c(), u("view", C, [h(e2.$slots, "leftout")])) : s("", true), p("view", { class: "nut-searchbar__search-input", style: i(e2.inputSearchbarStyle) }, [e2.$slots.leftin ? (c(), u("view", { key: 0, class: "nut-searchbar__search-icon nut-searchbar__iptleft-search-icon", onClick: a2[0] || (a2[0] = (...a3) => e2.leftIconClick && e2.leftIconClick(...a3)) }, [h(e2.$slots, "leftin")])) : s("", true), p("view", x, [p("form", { action: "#", onSubmit: a2[5] || (a2[5] = d((...a3) => e2.handleSubmit && e2.handleSubmit(...a3), ["prevent"])) }, [p("input", { ref: "inputsearch", class: "nut-searchbar__input-bar", type: e2.inputType, maxlength: e2.maxLength, placeholder: e2.placeholder || e2.translate("placeholder"), value: e2.modelValue, disabled: e2.disabled, readonly: e2.readonly, onClick: a2[1] || (a2[1] = (...a3) => e2.clickInput && e2.clickInput(...a3)), onInput: a2[2] || (a2[2] = (...a3) => e2.valueChange && e2.valueChange(...a3)), onFocus: a2[3] || (a2[3] = (...a3) => e2.valueFocus && e2.valueFocus(...a3)), onBlur: a2[4] || (a2[4] = (...a3) => e2.valueBlur && e2.valueBlur(...a3)), style: i(e2.styleSearchbar) }, null, 44, B)], 32), e2.clearable ? g((c(), u("view", { key: 0, onClick: a2[6] || (a2[6] = (...a3) => e2.handleClear && e2.handleClear(...a3)), class: "nut-searchbar__input-clear" }, [b(y2, { name: "circle-close", size: "12", color: "#555" })], 512)), [[m, e2.modelValue.length > 0]]) : s("", true)]), e2.$slots.rightin ? (c(), u("view", { key: 1, class: "nut-searchbar__search-icon nut-searchbar__iptright-sarch-icon", onClick: a2[7] || (a2[7] = (...a3) => e2.rightIconClick && e2.rightIconClick(...a3)) }, [h(e2.$slots, "rightin")])) : s("", true)], 4), e2.$slots.rightout ? (c(), u("view", I, [h(e2.$slots, "rightout")])) : s("", true)], 4);
41
- }]]);
42
- export { V as default };
10
+ const { create, translate } = createComponent("searchbar");
11
+ const _sfc_main = create({
12
+ props: {
13
+ modelValue: {
14
+ type: [String, Number],
15
+ default: ""
16
+ },
17
+ inputType: {
18
+ type: String,
19
+ default: "textarea"
20
+ },
21
+ label: {
22
+ type: String,
23
+ default: ""
24
+ },
25
+ maxLength: {
26
+ type: [String, Number],
27
+ default: "9999"
28
+ },
29
+ placeholder: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ clearable: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ background: {
38
+ type: String,
39
+ default: ""
40
+ },
41
+ inputBackground: {
42
+ type: String,
43
+ default: ""
44
+ },
45
+ autofocus: {
46
+ type: Boolean,
47
+ default: false
48
+ },
49
+ disabled: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ readonly: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ inputAlign: {
58
+ type: String,
59
+ default: "left"
60
+ }
61
+ },
62
+ emits: [
63
+ "change",
64
+ "update:modelValue",
65
+ "blur",
66
+ "focus",
67
+ "clear",
68
+ "search",
69
+ "click-input",
70
+ "click-left-icon",
71
+ "click-right-icon"
72
+ ],
73
+ setup(props, { emit }) {
74
+ const state = reactive({
75
+ active: false
76
+ });
77
+ const searchbarStyle = computed(() => {
78
+ return {
79
+ background: props.background
80
+ };
81
+ });
82
+ const inputSearchbarStyle = computed(() => {
83
+ return {
84
+ background: props.inputBackground
85
+ };
86
+ });
87
+ const valueChange = (event) => {
88
+ const input = event.target;
89
+ let val = input.value;
90
+ if (props.maxLength && val.length > Number(props.maxLength)) {
91
+ val = val.slice(0, Number(props.maxLength));
92
+ }
93
+ emit("update:modelValue", val, event);
94
+ emit("change", val, event);
95
+ };
96
+ const valueFocus = (event) => {
97
+ const input = event.target;
98
+ let value = input.value;
99
+ state.active = true;
100
+ emit("focus", value, event);
101
+ };
102
+ const valueBlur = (event) => {
103
+ setTimeout(() => {
104
+ state.active = false;
105
+ }, 0);
106
+ const input = event.target;
107
+ let value = input.value;
108
+ if (props.maxLength && value.length > Number(props.maxLength)) {
109
+ value = value.slice(0, Number(props.maxLength));
110
+ }
111
+ emit("blur", value, event);
112
+ };
113
+ const handleClear = (event) => {
114
+ emit("update:modelValue", "", event);
115
+ emit("change", "", event);
116
+ emit("clear", "");
117
+ };
118
+ const handleSubmit = () => {
119
+ emit("search", props.modelValue);
120
+ };
121
+ const clickInput = (event) => {
122
+ emit("click-input", event);
123
+ };
124
+ const leftIconClick = (event) => {
125
+ emit("click-left-icon", props.modelValue, event);
126
+ };
127
+ const rightIconClick = (event) => {
128
+ emit("click-right-icon", props.modelValue, event);
129
+ };
130
+ const styleSearchbar = computed(() => {
131
+ return {
132
+ "text-align": props.inputAlign
133
+ };
134
+ });
135
+ const inputsearch = ref(null);
136
+ onMounted(() => {
137
+ if (props.autofocus) {
138
+ inputsearch.value.focus();
139
+ }
140
+ });
141
+ return {
142
+ inputsearch,
143
+ ...toRefs(state),
144
+ valueChange,
145
+ valueFocus,
146
+ valueBlur,
147
+ handleClear,
148
+ handleSubmit,
149
+ searchbarStyle,
150
+ inputSearchbarStyle,
151
+ translate,
152
+ clickInput,
153
+ leftIconClick,
154
+ rightIconClick,
155
+ styleSearchbar
156
+ };
157
+ }
158
+ });
159
+ const _hoisted_1 = {
160
+ key: 0,
161
+ class: "nut-searchbar__search-label"
162
+ };
163
+ const _hoisted_2 = {
164
+ key: 1,
165
+ class: "nut-searchbar__search-icon nut-searchbar__left-search-icon"
166
+ };
167
+ const _hoisted_3 = { class: "nut-searchbar__input-inner" };
168
+ const _hoisted_4 = ["type", "maxlength", "placeholder", "value", "disabled", "readonly"];
169
+ const _hoisted_5 = {
170
+ key: 2,
171
+ class: "nut-searchbar__search-icon nut-searchbar__right-search-icon"
172
+ };
173
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
174
+ const _component_nut_icon = resolveComponent("nut-icon");
175
+ return openBlock(), createElementBlock("view", {
176
+ class: "nut-searchbar",
177
+ style: normalizeStyle(_ctx.searchbarStyle)
178
+ }, [
179
+ _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
180
+ _ctx.$slots.leftout ? (openBlock(), createElementBlock("view", _hoisted_2, [
181
+ renderSlot(_ctx.$slots, "leftout")
182
+ ])) : createCommentVNode("", true),
183
+ createElementVNode("view", {
184
+ class: "nut-searchbar__search-input",
185
+ style: normalizeStyle(_ctx.inputSearchbarStyle)
186
+ }, [
187
+ _ctx.$slots.leftin ? (openBlock(), createElementBlock("view", {
188
+ key: 0,
189
+ class: "nut-searchbar__search-icon nut-searchbar__iptleft-search-icon",
190
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.leftIconClick && _ctx.leftIconClick(...args))
191
+ }, [
192
+ renderSlot(_ctx.$slots, "leftin")
193
+ ])) : createCommentVNode("", true),
194
+ createElementVNode("view", _hoisted_3, [
195
+ createElementVNode("form", {
196
+ action: "#",
197
+ onSubmit: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.handleSubmit && _ctx.handleSubmit(...args), ["prevent"]))
198
+ }, [
199
+ createElementVNode("input", {
200
+ ref: "inputsearch",
201
+ class: "nut-searchbar__input-bar",
202
+ type: _ctx.inputType,
203
+ maxlength: _ctx.maxLength,
204
+ placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
205
+ value: _ctx.modelValue,
206
+ disabled: _ctx.disabled,
207
+ readonly: _ctx.readonly,
208
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.clickInput && _ctx.clickInput(...args)),
209
+ onInput: _cache[2] || (_cache[2] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
210
+ onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
211
+ onBlur: _cache[4] || (_cache[4] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args)),
212
+ style: normalizeStyle(_ctx.styleSearchbar)
213
+ }, null, 44, _hoisted_4)
214
+ ], 32),
215
+ _ctx.clearable ? withDirectives((openBlock(), createElementBlock("view", {
216
+ key: 0,
217
+ onClick: _cache[6] || (_cache[6] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
218
+ class: "nut-searchbar__input-clear"
219
+ }, [
220
+ createVNode(_component_nut_icon, {
221
+ name: "circle-close",
222
+ size: "12",
223
+ color: "#555"
224
+ })
225
+ ], 512)), [
226
+ [vShow, _ctx.modelValue.length > 0]
227
+ ]) : createCommentVNode("", true)
228
+ ]),
229
+ _ctx.$slots.rightin ? (openBlock(), createElementBlock("view", {
230
+ key: 1,
231
+ class: "nut-searchbar__search-icon nut-searchbar__iptright-sarch-icon",
232
+ onClick: _cache[7] || (_cache[7] = (...args) => _ctx.rightIconClick && _ctx.rightIconClick(...args))
233
+ }, [
234
+ renderSlot(_ctx.$slots, "rightin")
235
+ ])) : createCommentVNode("", true)
236
+ ], 4),
237
+ _ctx.$slots.rightout ? (openBlock(), createElementBlock("view", _hoisted_5, [
238
+ renderSlot(_ctx.$slots, "rightout")
239
+ ])) : createCommentVNode("", true)
240
+ ], 4);
241
+ }
242
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
243
+ export { index as default };