@nutui/nutui 3.1.12-beta.1 → 3.1.14

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 (131) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +139 -37
  3. package/dist/nutui.d.ts +9 -2
  4. package/dist/nutui.es.js +4830 -2950
  5. package/dist/nutui.umd.js +4910 -2953
  6. package/dist/packages/_es/ActionSheet.js +12 -13
  7. package/dist/packages/_es/Address.js +64 -77
  8. package/dist/packages/_es/Avatar.js +5 -4
  9. package/dist/packages/_es/BackTop.js +109 -72
  10. package/dist/packages/_es/Badge.js +5 -4
  11. package/dist/packages/_es/Barrage.js +57 -63
  12. package/dist/packages/_es/Button.js +6 -5
  13. package/dist/packages/_es/Calendar.js +18 -27
  14. package/dist/packages/_es/Card.js +8 -7
  15. package/dist/packages/_es/Cascader.js +547 -0
  16. package/dist/packages/_es/Cell.js +13 -5
  17. package/dist/packages/_es/CellGroup.js +14 -7
  18. package/dist/packages/_es/Checkbox.js +3 -3
  19. package/dist/packages/_es/CheckboxGroup.js +4 -9
  20. package/dist/packages/_es/CircleProgress.js +46 -142
  21. package/dist/packages/_es/Col.js +5 -4
  22. package/dist/packages/_es/Collapse.js +10 -35
  23. package/dist/packages/_es/CollapseItem.js +35 -80
  24. package/dist/packages/_es/CountDown.js +7 -10
  25. package/dist/packages/_es/CountUp.js +33 -34
  26. package/dist/packages/_es/DatePicker.js +219 -451
  27. package/dist/packages/_es/Dialog.js +98 -46
  28. package/dist/packages/_es/Divider.js +6 -5
  29. package/dist/packages/_es/Drag.js +50 -76
  30. package/dist/packages/_es/Elevator.js +53 -81
  31. package/dist/packages/_es/Empty.js +74 -0
  32. package/dist/packages/_es/FixedNav.js +9 -8
  33. package/dist/packages/_es/Form.js +23 -9
  34. package/dist/packages/_es/FormItem.js +5 -4
  35. package/dist/packages/_es/Grid.js +12 -0
  36. package/dist/packages/_es/GridItem.js +149 -0
  37. package/dist/packages/_es/Icon.js +40 -6
  38. package/dist/packages/_es/ImagePreview.js +158 -44
  39. package/dist/packages/_es/Indicator.js +66 -0
  40. package/dist/packages/_es/InfiniteLoading.js +109 -95
  41. package/dist/packages/_es/Input.js +21 -22
  42. package/dist/packages/_es/InputNumber.js +18 -24
  43. package/dist/packages/_es/Layout.js +2 -2
  44. package/dist/packages/_es/Menu.js +14 -16
  45. package/dist/packages/_es/MenuItem.js +11 -9
  46. package/dist/packages/_es/Navbar.js +7 -7
  47. package/dist/packages/_es/NoticeBar.js +31 -46
  48. package/dist/packages/_es/Notify.js +166 -30
  49. package/dist/packages/_es/NumberKeyboard.js +7 -9
  50. package/dist/packages/_es/OverLay.js +29 -22
  51. package/dist/packages/_es/Pagination.js +9 -8
  52. package/dist/packages/_es/Picker.js +447 -61
  53. package/dist/packages/_es/Popover.js +34 -161
  54. package/dist/packages/_es/Popup.js +77 -17
  55. package/dist/packages/_es/Price.js +7 -18
  56. package/dist/packages/_es/Progress.js +12 -23
  57. package/dist/packages/_es/Radio.js +3 -3
  58. package/dist/packages/_es/RadioGroup.js +2 -2
  59. package/dist/packages/_es/Range.js +31 -38
  60. package/dist/packages/_es/Rate.js +35 -17
  61. package/dist/packages/_es/Row.js +5 -4
  62. package/dist/packages/_es/SearchBar.js +5 -7
  63. package/dist/packages/_es/ShortPassword.js +59 -89
  64. package/dist/packages/_es/Signature.js +71 -70
  65. package/dist/packages/_es/Skeleton.js +138 -0
  66. package/dist/packages/_es/Sku.js +43 -53
  67. package/dist/packages/_es/Step.js +8 -10
  68. package/dist/packages/_es/Steps.js +2 -2
  69. package/dist/packages/_es/Swipe.js +28 -43
  70. package/dist/packages/_es/Swiper.js +418 -17
  71. package/dist/packages/_es/SwiperItem.js +39 -14
  72. package/dist/packages/_es/Switch.js +47 -16
  73. package/dist/packages/_es/TabPane.js +5 -4
  74. package/dist/packages/_es/Tabbar.js +5 -4
  75. package/dist/packages/_es/TabbarItem.js +9 -8
  76. package/dist/packages/_es/Table.js +191 -0
  77. package/dist/packages/_es/Tabs.js +21 -23
  78. package/dist/packages/_es/Tag.js +6 -5
  79. package/dist/packages/_es/TextArea.js +12 -16
  80. package/dist/packages/_es/TimeDetail.js +5 -7
  81. package/dist/packages/_es/TimePannel.js +5 -7
  82. package/dist/packages/_es/TimeSelect.js +7 -12
  83. package/dist/packages/_es/Toast.js +178 -46
  84. package/dist/packages/_es/Uploader.js +149 -109
  85. package/dist/packages/_es/Video.js +405 -0
  86. package/dist/packages/_es/common.js +136 -0
  87. package/dist/packages/_es/component.js +1 -1
  88. package/dist/packages/_es/index.js +7 -58
  89. package/dist/packages/_es/index2.js +58 -43
  90. package/dist/packages/_es/index3.js +28 -411
  91. package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
  92. package/dist/packages/_es/pxCheck.js +1 -1
  93. package/dist/packages/_es/raf.js +1 -1
  94. package/dist/packages/_es/util.js +1 -1
  95. package/dist/packages/cascader/index.scss +81 -0
  96. package/dist/packages/cellgroup/index.scss +9 -0
  97. package/dist/packages/dialog/index.scss +17 -0
  98. package/dist/packages/drag/index.scss +4 -0
  99. package/dist/packages/empty/index.scss +33 -0
  100. package/dist/packages/fixednav/index.scss +6 -1
  101. package/dist/packages/formitem/index.scss +4 -1
  102. package/dist/packages/grid/index.scss +10 -0
  103. package/dist/packages/griditem/index.scss +92 -0
  104. package/dist/packages/icon/index.scss +2 -1
  105. package/dist/packages/indicator/index.scss +48 -0
  106. package/dist/packages/numberkeyboard/index.scss +1 -1
  107. package/dist/packages/popover/index.scss +2 -2
  108. package/dist/packages/rate/index.scss +1 -0
  109. package/dist/packages/skeleton/index.scss +57 -0
  110. package/dist/packages/table/index.scss +81 -0
  111. package/dist/packages/tabs/index.scss +16 -0
  112. package/dist/packages/textarea/index.scss +1 -0
  113. package/dist/packages/timedetail/index.scss +1 -2
  114. package/dist/packages/timeselect/index.scss +3 -0
  115. package/dist/packages/toast/index.scss +6 -0
  116. package/dist/style.css +1 -1
  117. package/dist/style.es.js +2 -1
  118. package/dist/styles/font/config.json +2 -1
  119. package/dist/styles/font/demo_index.html +26 -3
  120. package/dist/styles/font/iconfont.css +7 -3
  121. package/dist/styles/font/iconfont.js +31 -32
  122. package/dist/styles/font/iconfont.json +7 -0
  123. package/dist/styles/font/iconfont.ttf +0 -0
  124. package/dist/styles/font/iconfont.woff +0 -0
  125. package/dist/styles/font/iconfont.woff2 +0 -0
  126. package/dist/styles/themes/default.scss +40 -33
  127. package/dist/styles/variables.scss +54 -1
  128. package/package.json +2 -3
  129. package/dist/packages/_es/commonProps.js +0 -30
  130. package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +0 -44
  131. package/dist/packages/_es/use-lock-scroll.js +0 -23
@@ -17,19 +17,16 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __require = typeof require !== "undefined" ? require : (x) => {
21
- throw new Error('Dynamic require of "' + x + '" is not supported');
22
- };
23
20
  /*!
24
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
25
22
  * (c) 2021 @jdf2e.
26
23
  * Released under the MIT License.
27
24
  */
28
- import { ref, reactive, computed, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, normalizeStyle, withCtx, Fragment, renderList, createElementVNode, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
25
+ import { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
29
26
  import { c as createComponent } from "./component.js";
30
- import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
27
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
31
28
  const { componentName, create } = createComponent("elevator");
32
- var _sfc_main = create({
29
+ const _sfc_main = create({
33
30
  props: {
34
31
  height: {
35
32
  type: [Number, String],
@@ -49,7 +46,7 @@ var _sfc_main = create({
49
46
  emits: ["click-item", "click-index"],
50
47
  setup(props, context) {
51
48
  const spaceHeight = 23;
52
- const listview = ref();
49
+ const listview = ref(null);
53
50
  const state = reactive({
54
51
  anchorIndex: 0,
55
52
  listHeight: [],
@@ -59,10 +56,7 @@ var _sfc_main = create({
59
56
  y2: 0
60
57
  },
61
58
  scrollStart: false,
62
- currentIndex: 0,
63
- query: Taro.createSelectorQuery(),
64
- scrollTop: 0,
65
- storageListHeight: []
59
+ currentIndex: 0
66
60
  });
67
61
  const classes = computed(() => {
68
62
  const prefixCls = componentName;
@@ -81,11 +75,9 @@ var _sfc_main = create({
81
75
  y2: 0
82
76
  };
83
77
  };
84
- const getData = (el) => {
85
- if (!el.dataset.index) {
86
- return "0";
87
- }
88
- return el.dataset.index;
78
+ const getData = (el, name) => {
79
+ const prefix = "data-";
80
+ return el.getAttribute(prefix + name);
89
81
  };
90
82
  const setListGroup = (el) => {
91
83
  nextTick(() => {
@@ -97,38 +89,35 @@ var _sfc_main = create({
97
89
  const calculateHeight = () => {
98
90
  let height = 0;
99
91
  state.listHeight.push(height);
100
- state.storageListHeight.push(height);
101
92
  for (let i = 0; i < state.listGroup.length; i++) {
102
- state.query.selectAll(`.elevator__item__${i}`).boundingClientRect();
103
- state.query.exec((res) => {
104
- height += res[i][0].height;
105
- state.listHeight.push(height);
106
- state.storageListHeight.push(height);
107
- });
93
+ let item = state.listGroup[i];
94
+ height += item.clientHeight;
95
+ state.listHeight.push(height);
108
96
  }
109
97
  };
110
- const scrollTo = (index) => {
111
- if (!index && index !== 0) {
98
+ const scrollTo = (index2) => {
99
+ if (!index2 && index2 !== 0) {
112
100
  return;
113
101
  }
114
102
  if (!state.listHeight.length) {
115
- state.listHeight = state.storageListHeight.slice();
103
+ calculateHeight();
116
104
  }
117
- if (index < 0)
118
- index = 0;
119
- if (index > state.listHeight.length - 2)
120
- index = state.listHeight.length - 2;
121
- state.currentIndex = index;
122
- state.scrollTop = state.listHeight[index];
105
+ if (index2 < 0)
106
+ index2 = 0;
107
+ if (index2 > state.listHeight.length - 2)
108
+ index2 = state.listHeight.length - 2;
109
+ state.currentIndex = index2;
110
+ listview.value.scrollTo(0, state.listHeight[index2]);
123
111
  };
124
112
  const touchStart = (e) => {
125
113
  state.scrollStart = true;
126
- let index = getData(e.target);
114
+ let index2 = getData(e.target, "index");
127
115
  let firstTouch = e.touches[0];
128
116
  state.touchState.y1 = firstTouch.pageY;
129
- state.anchorIndex = +index;
130
- state.currentIndex = +index;
131
- scrollTo(+index);
117
+ state.anchorIndex = +index2;
118
+ state.currentIndex = +index2;
119
+ console.log(state.currentIndex);
120
+ scrollTo(+index2);
132
121
  };
133
122
  const touchMove = (e) => {
134
123
  let firstTouch = e.touches[0];
@@ -146,18 +135,6 @@ var _sfc_main = create({
146
135
  const handleClickIndex = (key) => {
147
136
  context.emit("click-index", key);
148
137
  };
149
- onMounted(() => {
150
- Taro.nextTick(() => {
151
- calculateHeight();
152
- });
153
- if (Taro.getEnv() === "WEB") {
154
- calculateHeight();
155
- } else {
156
- eventCenter.once(getCurrentInstance().router.onReady, () => {
157
- calculateHeight();
158
- });
159
- }
160
- });
161
138
  return __spreadProps(__spreadValues({
162
139
  classes
163
140
  }, toRefs(state)), {
@@ -176,39 +153,34 @@ const _hoisted_2 = ["onClick", "innerHTML"];
176
153
  const _hoisted_3 = { class: "nut-elevator__bars__inner" };
177
154
  const _hoisted_4 = ["data-index", "onClick"];
178
155
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
179
- const _component_scroll_view = resolveComponent("scroll-view");
180
156
  return openBlock(), createElementBlock("view", {
181
157
  class: normalizeClass(_ctx.classes)
182
158
  }, [
183
- createVNode(_component_scroll_view, {
184
- class: "nut-elevator__list scrollview",
185
- "scroll-top": _ctx.scrollTop,
186
- "scroll-y": true,
159
+ createElementVNode("view", {
160
+ class: "nut-elevator__list",
187
161
  ref: "listview",
188
162
  style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
189
- }, {
190
- default: withCtx(() => [
191
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
192
- return openBlock(), createElementBlock("view", {
193
- class: normalizeClass(["nut-elevator__list__item", `elevator__item__${index}`]),
194
- key: item[_ctx.acceptKey],
195
- ref: _ctx.setListGroup
196
- }, [
197
- createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
198
- (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
199
- return openBlock(), createElementBlock("view", {
200
- class: "nut-elevator__list__item__name",
201
- key: subitem["id"],
202
- onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem),
203
- innerHTML: subitem.name
204
- }, null, 8, _hoisted_2);
205
- }), 128))
206
- ], 2);
207
- }), 128))
208
- ]),
209
- _: 1
210
- }, 8, ["scroll-top", "style"]),
211
- _ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
163
+ }, [
164
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item) => {
165
+ return openBlock(), createElementBlock("view", {
166
+ class: "nut-elevator__list__item",
167
+ key: item[_ctx.acceptKey],
168
+ ref_for: true,
169
+ ref: _ctx.setListGroup
170
+ }, [
171
+ createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
172
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
173
+ return openBlock(), createElementBlock("view", {
174
+ class: "nut-elevator__list__item__name",
175
+ key: subitem["id"],
176
+ onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem),
177
+ innerHTML: subitem.name
178
+ }, null, 8, _hoisted_2);
179
+ }), 128))
180
+ ]);
181
+ }), 128))
182
+ ], 4),
183
+ _ctx.indexList.length ? withDirectives((openBlock(), createElementBlock("view", {
212
184
  key: 0,
213
185
  class: "nut-elevator__code--current"
214
186
  }, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 513)), [
@@ -221,10 +193,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
221
193
  onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
222
194
  }, [
223
195
  createElementVNode("view", _hoisted_3, [
224
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
196
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index2) => {
225
197
  return openBlock(), createElementBlock("view", {
226
198
  class: "nut-elevator__bars__inner__item",
227
- "data-index": index,
199
+ "data-index": index2,
228
200
  key: item[_ctx.acceptKey],
229
201
  onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
230
202
  }, toDisplayString(item[_ctx.acceptKey]), 9, _hoisted_4);
@@ -233,5 +205,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
233
205
  ], 32)
234
206
  ], 2);
235
207
  }
236
- _sfc_main.render = _sfc_render;
237
- export { _sfc_main as default };
208
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
209
+ export { index as default };
@@ -0,0 +1,74 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { toRefs, computed, openBlock, createElementBlock, createElementVNode, normalizeStyle, renderSlot, Fragment, createCommentVNode, toDisplayString } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
+ const { componentName, create } = createComponent("empty");
10
+ const defaultStatus = {
11
+ empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
12
+ error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
13
+ network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
14
+ };
15
+ const _sfc_main = create({
16
+ props: {
17
+ image: {
18
+ type: String,
19
+ default: "empty"
20
+ },
21
+ imageSize: {
22
+ type: [Number, String],
23
+ default: ""
24
+ },
25
+ description: {
26
+ type: String,
27
+ default: "\u65E0\u5185\u5BB9"
28
+ }
29
+ },
30
+ setup(props) {
31
+ const { image, imageSize } = toRefs(props);
32
+ const imgStyle = computed(() => {
33
+ if (!imageSize.value) {
34
+ return "";
35
+ }
36
+ if (typeof imageSize.value === "number") {
37
+ return `width:${imageSize.value}px;height:${imageSize.value}px`;
38
+ }
39
+ return `width:${imageSize.value};height:${imageSize.value}`;
40
+ });
41
+ const isHttpUrl = image.value.startsWith("https://") || image.value.startsWith("http://") || image.value.startsWith("//");
42
+ const imageUrl = isHttpUrl ? image.value : defaultStatus[image.value];
43
+ return {
44
+ imageUrl,
45
+ imgStyle
46
+ };
47
+ }
48
+ });
49
+ const _hoisted_1 = { class: "nut-empty" };
50
+ const _hoisted_2 = ["src"];
51
+ const _hoisted_3 = {
52
+ key: 1,
53
+ class: "nut-empty-description"
54
+ };
55
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
56
+ return openBlock(), createElementBlock("view", _hoisted_1, [
57
+ createElementVNode("view", {
58
+ class: "nut-empty-image",
59
+ style: normalizeStyle(_ctx.imgStyle)
60
+ }, [
61
+ _ctx.$slots.image ? renderSlot(_ctx.$slots, "image", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
62
+ _ctx.imageUrl ? (openBlock(), createElementBlock("img", {
63
+ key: 0,
64
+ class: "img",
65
+ src: _ctx.imageUrl
66
+ }, null, 8, _hoisted_2)) : createCommentVNode("", true)
67
+ ], 64))
68
+ ], 4),
69
+ _ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.description), 1)),
70
+ _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("", true)
71
+ ]);
72
+ }
73
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
74
+ export { index as default };
@@ -1,15 +1,16 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, renderSlot, createElementVNode, Fragment, renderList, toDisplayString, createVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import _sfc_main$1 from "./OverLay.js";
8
+ import overlay from "./OverLay.js";
9
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  const { componentName, create } = createComponent("fixednav");
10
- var _sfc_main = create({
11
+ const _sfc_main = create({
11
12
  components: {
12
- [_sfc_main$1.name]: _sfc_main$1
13
+ [overlay.name]: overlay
13
14
  },
14
15
  props: {
15
16
  visible: {
@@ -93,11 +94,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
93
94
  }, null, 8, ["visible"])) : createCommentVNode("", true),
94
95
  renderSlot(_ctx.$slots, "list", {}, () => [
95
96
  createElementVNode("view", _hoisted_1, [
96
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index) => {
97
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index2) => {
97
98
  return openBlock(), createElementBlock("view", {
98
99
  class: "nut-fixednav__list-item",
99
100
  onClick: ($event) => _ctx.selected(item, $event),
100
- key: item.id || index
101
+ key: item.id || index2
101
102
  }, [
102
103
  createElementVNode("img", {
103
104
  src: item.icon
@@ -122,5 +123,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
122
123
  ])
123
124
  ], 6);
124
125
  }
125
- _sfc_main.render = _sfc_render;
126
- export { _sfc_main as default };
126
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
127
+ export { index as default };
@@ -1,11 +1,12 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { c as createComponent } from "./component.js";
7
7
  import { i as isPromise } from "./util.js";
8
8
  import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, renderSlot } from "vue";
9
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  const component = {
10
11
  props: {
11
12
  modelValue: {
@@ -31,8 +32,8 @@ const component = {
31
32
  }, { immediate: true });
32
33
  const findFormItem = (vnodes) => {
33
34
  let task = [];
34
- vnodes.forEach((vnode, index) => {
35
- var _a, _b;
35
+ vnodes.forEach((vnode, index2) => {
36
+ var _a, _b, _c;
36
37
  let type = vnode.type;
37
38
  type = type.name || type;
38
39
  if (type == "nut-form-item") {
@@ -40,6 +41,8 @@ const component = {
40
41
  prop: (_a = vnode.props) == null ? void 0 : _a["prop"],
41
42
  rules: ((_b = vnode.props) == null ? void 0 : _b["rules"]) || []
42
43
  });
44
+ } else if ((_c = vnode.children) == null ? void 0 : _c.length) {
45
+ task = task.concat(findFormItem(vnode.children));
43
46
  }
44
47
  });
45
48
  return task;
@@ -58,7 +61,10 @@ const component = {
58
61
  resolve(errorMsg);
59
62
  });
60
63
  };
61
- const value = props.modelValue[prop];
64
+ const getPropByPath = (obj, keyPath) => {
65
+ return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
66
+ };
67
+ let value = getPropByPath(props.modelValue, prop);
62
68
  tipMessage({ prop, message: "" });
63
69
  while (rules.length) {
64
70
  const { required, validator, regex, message } = rules.shift();
@@ -93,11 +99,19 @@ const component = {
93
99
  }
94
100
  return Promise.resolve(true);
95
101
  };
96
- const validate = () => {
102
+ const validate = (customProp = "") => {
97
103
  return new Promise((resolve, reject) => {
98
104
  let task = findFormItem(slots.default());
99
105
  let errors = task.map((item) => {
100
- return checkRule(item);
106
+ if (customProp) {
107
+ if (customProp == item.prop) {
108
+ return checkRule(item);
109
+ } else {
110
+ return Promise.resolve(true);
111
+ }
112
+ } else {
113
+ return checkRule(item);
114
+ }
101
115
  });
102
116
  Promise.all(errors).then((errorRes) => {
103
117
  errorRes = errorRes.filter((item) => item != true);
@@ -118,7 +132,7 @@ const component = {
118
132
  }
119
133
  };
120
134
  const { create } = createComponent("form");
121
- var _sfc_main = create(component);
135
+ const _sfc_main = create(component);
122
136
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
123
137
  const _component_nut_cell_group = resolveComponent("nut-cell-group");
124
138
  return openBlock(), createElementBlock("form", {
@@ -133,5 +147,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
133
147
  })
134
148
  ], 32);
135
149
  }
136
- _sfc_main.render = _sfc_render;
137
- export { _sfc_main as default };
150
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
151
+ export { index as default };
@@ -1,13 +1,14 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { p as pxCheck } from "./pxCheck.js";
7
7
  import { inject, computed, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from "vue";
8
8
  import { c as createComponent } from "./component.js";
9
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  const { componentName, create } = createComponent("form-item");
10
- var _sfc_main = create({
11
+ const _sfc_main = create({
11
12
  inheritAttrs: false,
12
13
  props: {
13
14
  prop: {
@@ -105,5 +106,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
105
106
  _: 3
106
107
  }, 8, ["class"]);
107
108
  }
108
- _sfc_main.render = _sfc_render;
109
- export { _sfc_main as default };
109
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
110
+ export { index as default };
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { c as createComponent } from "./component.js";
7
+ import { c as component } from "./common.js";
8
+ import "vue";
9
+ import "./pxCheck.js";
10
+ const { create } = createComponent("grid");
11
+ const _sfc_main = create(component);
12
+ export { _sfc_main as default };
@@ -0,0 +1,149 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { inject, getCurrentInstance, onUnmounted, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, createBlock, toDisplayString } from "vue";
7
+ import { useRouter } from "vue-router";
8
+ import { c as createComponent } from "./component.js";
9
+ import { p as pxCheck } from "./pxCheck.js";
10
+ import { G as GRID_KEY } from "./common.js";
11
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
12
+ function useInject(key) {
13
+ const parent = inject(key, null);
14
+ if (parent) {
15
+ const instance = getCurrentInstance();
16
+ const { add, remove, internalChildren } = parent;
17
+ add(instance);
18
+ onUnmounted(() => remove(instance));
19
+ const index2 = computed(() => internalChildren.indexOf(instance));
20
+ return {
21
+ parent,
22
+ index: index2
23
+ };
24
+ }
25
+ return {
26
+ parent: null,
27
+ index: ref(-1)
28
+ };
29
+ }
30
+ const { create, componentName } = createComponent("grid-item");
31
+ const _sfc_main = create({
32
+ props: {
33
+ text: {
34
+ type: String
35
+ },
36
+ icon: {
37
+ type: String
38
+ },
39
+ iconSize: {
40
+ type: [Number, String]
41
+ },
42
+ iconColor: {
43
+ type: String
44
+ },
45
+ to: {
46
+ type: [String, Object]
47
+ },
48
+ url: {
49
+ type: String,
50
+ default: ""
51
+ },
52
+ replace: {
53
+ type: Boolean,
54
+ default: false
55
+ }
56
+ },
57
+ emits: ["click"],
58
+ setup(props, { emit }) {
59
+ const Parent = useInject(GRID_KEY);
60
+ if (!Parent.parent)
61
+ return;
62
+ const index2 = Parent.index;
63
+ const parent = Parent.parent.props;
64
+ const rootClass = computed(() => {
65
+ const prefixCls = componentName;
66
+ return {
67
+ [prefixCls]: true
68
+ };
69
+ });
70
+ const rootStyle = computed(() => {
71
+ const style = {
72
+ flexBasis: `${100 / +parent.columnNum}%`
73
+ };
74
+ if (parent.square) {
75
+ style.paddingTop = `${100 / +parent.columnNum}%`;
76
+ } else if (parent.gutter) {
77
+ style.paddingRight = pxCheck(parent.gutter);
78
+ if (index2.value >= parent.columnNum) {
79
+ style.marginTop = pxCheck(parent.gutter);
80
+ }
81
+ }
82
+ return style;
83
+ });
84
+ const contentClass = computed(() => {
85
+ const prefixCls = `${componentName}__content`;
86
+ return {
87
+ [`${prefixCls}`]: true,
88
+ [`${prefixCls}--border`]: parent.border,
89
+ [`${prefixCls}--surround`]: parent.border && parent.gutter,
90
+ [`${prefixCls}--center`]: parent.center,
91
+ [`${prefixCls}--square`]: parent.square,
92
+ [`${prefixCls}--reverse`]: parent.reverse,
93
+ [`${prefixCls}--${parent.direction}`]: !!parent.direction,
94
+ [`${prefixCls}--clickable`]: parent.clickable || props.to || props.url
95
+ };
96
+ });
97
+ const iconProps = computed(() => {
98
+ return {
99
+ name: props.icon,
100
+ size: props.iconSize || parent.iconSize,
101
+ color: props.iconColor || parent.iconColor
102
+ };
103
+ });
104
+ const router = useRouter();
105
+ const handleClick = (event) => {
106
+ emit("click", event);
107
+ if (props.to && router) {
108
+ router[props.replace ? "replace" : "push"](props.to);
109
+ } else if (props.url) {
110
+ props.replace ? location.replace(props.url) : location.href = props.url;
111
+ }
112
+ };
113
+ return {
114
+ rootClass,
115
+ rootStyle,
116
+ contentClass,
117
+ iconProps,
118
+ handleClick
119
+ };
120
+ }
121
+ });
122
+ const _hoisted_1 = {
123
+ key: 3,
124
+ class: "nut-grid-item__text"
125
+ };
126
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
127
+ const _component_nut_icon = resolveComponent("nut-icon");
128
+ return openBlock(), createElementBlock("view", {
129
+ class: normalizeClass(_ctx.rootClass),
130
+ style: normalizeStyle(_ctx.rootStyle),
131
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
132
+ }, [
133
+ createElementVNode("view", {
134
+ class: normalizeClass(_ctx.contentClass)
135
+ }, [
136
+ _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
137
+ _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 0 }) : (openBlock(), createBlock(_component_nut_icon, {
138
+ key: 1,
139
+ name: _ctx.iconProps.name,
140
+ size: _ctx.iconProps.size,
141
+ color: _ctx.iconProps.color
142
+ }, null, 8, ["name", "size", "color"])),
143
+ _ctx.$slots.text ? renderSlot(_ctx.$slots, "text", { key: 2 }) : (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.text), 1))
144
+ ], 64))
145
+ ], 2)
146
+ ], 6);
147
+ }
148
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
149
+ export { index as default };
@@ -1,10 +1,44 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { _ as _sfc_main } from "./index.taro.vue_vue&type=script&lang.js";
7
- export { _ as default } from "./index.taro.vue_vue&type=script&lang.js";
8
- import "vue";
9
- import "./component.js";
10
- import "./pxCheck.js";
6
+ import { h } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { p as pxCheck } from "./pxCheck.js";
9
+ const { componentName, create } = createComponent("icon");
10
+ const _sfc_main = create({
11
+ props: {
12
+ name: { type: String, default: "" },
13
+ size: { type: [String, Number], default: "" },
14
+ classPrefix: { type: String, default: "nut-icon" },
15
+ fontClassName: { type: String, default: "nutui-iconfont" },
16
+ color: { type: String, default: "" },
17
+ tag: { type: String, default: "i" }
18
+ },
19
+ emits: ["click"],
20
+ setup(props, { emit, slots }) {
21
+ const handleClick = (event) => {
22
+ emit("click", event);
23
+ };
24
+ const isImage = () => {
25
+ return props.name ? props.name.indexOf("/") !== -1 : false;
26
+ };
27
+ return () => {
28
+ var _a;
29
+ const _isImage = isImage();
30
+ return h(_isImage ? "img" : props.tag, {
31
+ class: _isImage ? `${componentName}__img` : `${props.fontClassName} ${componentName} ${props.classPrefix}-${props.name}`,
32
+ style: {
33
+ color: props.color,
34
+ fontSize: pxCheck(props.size),
35
+ width: pxCheck(props.size),
36
+ height: pxCheck(props.size)
37
+ },
38
+ onClick: handleClick,
39
+ src: _isImage ? props.name : ""
40
+ }, (_a = slots.default) == null ? void 0 : _a.call(slots));
41
+ };
42
+ }
43
+ });
44
+ export { _sfc_main as default };