@nutui/nutui 3.1.17 → 3.1.19-beta.0

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 (155) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +1 -1
  3. package/README.md +7 -1
  4. package/dist/nutui.d.ts +3 -1
  5. package/dist/nutui.es.js +2335 -1280
  6. package/dist/nutui.umd.js +2350 -1293
  7. package/dist/packages/_es/ActionSheet.js +8 -3
  8. package/dist/packages/_es/Address.js +17 -11
  9. package/dist/packages/_es/Audio.js +2 -2
  10. package/dist/packages/_es/AudioOperate.js +125 -0
  11. package/dist/packages/_es/Avatar.js +2 -2
  12. package/dist/packages/_es/BackTop.js +7 -4
  13. package/dist/packages/_es/Badge.js +2 -2
  14. package/dist/packages/_es/Barrage.js +2 -2
  15. package/dist/packages/_es/Button.js +2 -2
  16. package/dist/packages/_es/Calendar.js +10 -687
  17. package/dist/packages/_es/CalendarItem.js +10 -0
  18. package/dist/packages/_es/Card.js +2 -2
  19. package/dist/packages/_es/Cascader.js +2 -2
  20. package/dist/packages/_es/Cell.js +25 -18
  21. package/dist/packages/_es/CellGroup.js +2 -2
  22. package/dist/packages/_es/Checkbox.js +4 -4
  23. package/dist/packages/_es/CheckboxGroup.js +4 -4
  24. package/dist/packages/_es/CircleProgress.js +2 -2
  25. package/dist/packages/_es/Col.js +2 -2
  26. package/dist/packages/_es/Collapse.js +2 -2
  27. package/dist/packages/_es/CollapseItem.js +31 -19
  28. package/dist/packages/_es/CountDown.js +4 -2
  29. package/dist/packages/_es/CountUp.js +25 -16
  30. package/dist/packages/_es/DatePicker.js +83 -47
  31. package/dist/packages/_es/Dialog.js +7 -5
  32. package/dist/packages/_es/Divider.js +2 -2
  33. package/dist/packages/_es/Drag.js +4 -4
  34. package/dist/packages/_es/Elevator.js +3 -3
  35. package/dist/packages/_es/Empty.js +2 -2
  36. package/dist/packages/_es/FixedNav.js +2 -2
  37. package/dist/packages/_es/Form.js +8 -6
  38. package/dist/packages/_es/FormItem.js +9 -6
  39. package/dist/packages/_es/Grid.js +2 -2
  40. package/dist/packages/_es/GridItem.js +3 -3
  41. package/dist/packages/_es/Icon.js +2 -2
  42. package/dist/packages/_es/ImagePreview.js +11 -6
  43. package/dist/packages/_es/Indicator.js +2 -2
  44. package/dist/packages/_es/InfiniteLoading.js +2 -2
  45. package/dist/packages/_es/Input.js +290 -66
  46. package/dist/packages/_es/InputNumber.js +2 -2
  47. package/dist/packages/_es/Layout.js +2 -2
  48. package/dist/packages/_es/List.js +124 -0
  49. package/dist/packages/_es/Menu.js +3 -3
  50. package/dist/packages/_es/MenuItem.js +4 -4
  51. package/dist/packages/_es/Navbar.js +31 -66
  52. package/dist/packages/_es/NoticeBar.js +41 -22
  53. package/dist/packages/_es/Notify.js +9 -5
  54. package/dist/packages/_es/NumberKeyboard.js +9 -4
  55. package/dist/packages/_es/OldPicker.js +484 -0
  56. package/dist/packages/_es/OverLay.js +2 -2
  57. package/dist/packages/_es/Pagination.js +2 -2
  58. package/dist/packages/_es/Picker.js +164 -157
  59. package/dist/packages/_es/Popover.js +7 -4
  60. package/dist/packages/_es/Popup.js +4 -4
  61. package/dist/packages/_es/Price.js +2 -2
  62. package/dist/packages/_es/Progress.js +14 -22
  63. package/dist/packages/_es/PullRefresh.js +363 -0
  64. package/dist/packages/_es/Radio.js +3 -3
  65. package/dist/packages/_es/RadioGroup.js +2 -2
  66. package/dist/packages/_es/Range.js +131 -21
  67. package/dist/packages/_es/Rate.js +2 -2
  68. package/dist/packages/_es/Row.js +2 -2
  69. package/dist/packages/_es/SearchBar.js +2 -2
  70. package/dist/packages/_es/ShortPassword.js +9 -4
  71. package/dist/packages/_es/SideNavBar.js +2 -2
  72. package/dist/packages/_es/SideNavBarItem.js +2 -2
  73. package/dist/packages/_es/Signature.js +25 -6
  74. package/dist/packages/_es/Skeleton.js +2 -2
  75. package/dist/packages/_es/Sku.js +31 -13
  76. package/dist/packages/_es/Step.js +28 -12
  77. package/dist/packages/_es/Steps.js +8 -3
  78. package/dist/packages/_es/Sticky.js +3 -3
  79. package/dist/packages/_es/SubSideNavBar.js +2 -2
  80. package/dist/packages/_es/Swipe.js +3 -3
  81. package/dist/packages/_es/Swiper.js +3 -3
  82. package/dist/packages/_es/SwiperItem.js +3 -3
  83. package/dist/packages/_es/Switch.js +2 -2
  84. package/dist/packages/_es/TabPane.js +2 -2
  85. package/dist/packages/_es/Tabbar.js +2 -2
  86. package/dist/packages/_es/TabbarItem.js +23 -8
  87. package/dist/packages/_es/Table.js +2 -2
  88. package/dist/packages/_es/Tabs.js +8 -5
  89. package/dist/packages/_es/Tag.js +11 -5
  90. package/dist/packages/_es/TextArea.js +38 -6
  91. package/dist/packages/_es/TimeDetail.js +2 -2
  92. package/dist/packages/_es/TimePannel.js +2 -2
  93. package/dist/packages/_es/TimeSelect.js +8 -3
  94. package/dist/packages/_es/Toast.js +16 -9
  95. package/dist/packages/_es/Uploader.js +2 -4
  96. package/dist/packages/_es/Video.js +12 -8
  97. package/dist/packages/_es/common.js +2 -2
  98. package/dist/packages/_es/component.js +2 -2
  99. package/dist/packages/_es/index.js +6 -8
  100. package/dist/packages/_es/index2.js +9 -32
  101. package/dist/packages/_es/index3.js +29 -57
  102. package/dist/packages/_es/index4.js +64 -0
  103. package/dist/packages/_es/index5.js +687 -0
  104. package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
  105. package/dist/packages/_es/pxCheck.js +2 -2
  106. package/dist/packages/_es/raf.js +2 -2
  107. package/dist/packages/_es/util.js +2 -2
  108. package/dist/packages/actionsheet/index.scss +7 -6
  109. package/dist/packages/badge/index.scss +11 -13
  110. package/dist/packages/button/index.scss +6 -5
  111. package/dist/packages/calendar/index.scss +9 -4
  112. package/dist/packages/calendaritem/index.scss +0 -207
  113. package/dist/packages/cell/index.scss +9 -9
  114. package/dist/packages/cellgroup/index.scss +1 -1
  115. package/dist/packages/checkbox/index.scss +4 -3
  116. package/dist/packages/collapseitem/index.scss +21 -11
  117. package/dist/packages/countdown/index.scss +3 -1
  118. package/dist/packages/divider/index.scss +8 -8
  119. package/dist/packages/elevator/index.scss +36 -36
  120. package/dist/packages/formitem/index.scss +15 -8
  121. package/dist/packages/indicator/index.scss +1 -1
  122. package/dist/packages/input/index.scss +70 -24
  123. package/dist/packages/inputnumber/index.scss +4 -2
  124. package/dist/packages/list/index.scss +24 -0
  125. package/dist/packages/menu/index.scss +3 -3
  126. package/dist/packages/navbar/index.scss +30 -8
  127. package/dist/packages/noticebar/index.scss +10 -5
  128. package/dist/packages/notify/index.scss +10 -0
  129. package/dist/packages/numberkeyboard/index.scss +22 -21
  130. package/dist/packages/oldpicker/index.scss +131 -0
  131. package/dist/packages/picker/index.scss +38 -32
  132. package/dist/packages/progress/index.scss +24 -19
  133. package/dist/packages/radio/index.scss +7 -6
  134. package/dist/packages/range/index.scss +113 -6
  135. package/dist/packages/searchbar/index.scss +7 -7
  136. package/dist/packages/sidenavbaritem/index.scss +5 -5
  137. package/dist/packages/step/index.scss +29 -29
  138. package/dist/packages/subsidenavbar/index.scss +10 -8
  139. package/dist/packages/swiper/index.scss +4 -4
  140. package/dist/packages/switch/index.scss +8 -8
  141. package/dist/packages/tabbar/index.scss +3 -2
  142. package/dist/packages/tabbaritem/index.scss +19 -3
  143. package/dist/packages/tabs/index.scss +1 -0
  144. package/dist/packages/timedetail/index.scss +13 -13
  145. package/dist/packages/timepannel/index.scss +7 -7
  146. package/dist/packages/timeselect/index.scss +3 -3
  147. package/dist/packages/toast/index.scss +8 -7
  148. package/dist/packages/uploader/index.scss +4 -4
  149. package/dist/style.css +1 -1
  150. package/dist/styles/themes/default.scss +43 -41
  151. package/dist/styles/themes/jdt.scss +91 -0
  152. package/dist/styles/variables-jdt.scss +728 -0
  153. package/dist/styles/variables.scss +322 -38
  154. package/package.json +3 -2
  155. package/dist/styles/themes/jdd.scss +0 -2
@@ -18,46 +18,35 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, toRaw, resolveComponent, createVNode, withCtx } from "vue";
25
+ import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
+ import popup, { popupProps } from "./Popup.js";
27
28
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
- import Popup, { popupProps } from "./Popup.js";
29
29
  import "./OverLay.js";
30
30
  import "./Icon.js";
31
31
  import "./pxCheck.js";
32
- const commonProps = {
33
- listData: {
34
- type: Array,
35
- default: () => {
36
- return [];
37
- }
38
- },
39
- readonly: {
40
- type: Boolean,
41
- default: false
42
- },
43
- defaultIndex: {
44
- type: [Number, String],
45
- default: 0
46
- },
47
- itemHeight: {
48
- type: [Number, String],
49
- default: 35
50
- }
51
- };
52
32
  const { create: create$1 } = createComponent("picker-column");
53
33
  const _sfc_main$1 = create$1({
54
- props: __spreadValues({
55
- dataType: String,
34
+ props: {
35
+ value: [String, Number],
36
+ columnsType: String,
56
37
  itemShow: {
57
38
  type: Boolean,
58
39
  default: false
40
+ },
41
+ column: {
42
+ type: Array,
43
+ default: () => []
44
+ },
45
+ readonly: {
46
+ type: Boolean,
47
+ default: false
59
48
  }
60
- }, commonProps),
49
+ },
61
50
  emits: ["click", "change"],
62
51
  setup(props, { emit }) {
63
52
  const wrapper = ref();
@@ -67,7 +56,8 @@ const _sfc_main$1 = create$1({
67
56
  endY: 0,
68
57
  startTime: 0,
69
58
  endTime: 0,
70
- lastY: 0
59
+ lastY: 0,
60
+ lastTime: 0
71
61
  },
72
62
  currIndex: 1,
73
63
  transformY: 0,
@@ -113,7 +103,7 @@ const _sfc_main$1 = create$1({
113
103
  event.preventDefault();
114
104
  let changedTouches = event.changedTouches[0];
115
105
  state.touchParams.lastY = changedTouches.pageY;
116
- state.touchParams.lastTime = event.timestamp || Date.now();
106
+ state.touchParams.lastTime = event.timeStamp || Date.now();
117
107
  let move = state.touchParams.lastY - state.touchParams.startY;
118
108
  let moveTime = state.touchParams.lastTime - state.touchParams.startTime;
119
109
  if (moveTime <= 300) {
@@ -150,8 +140,8 @@ const _sfc_main$1 = create$1({
150
140
  if (updateMove > 0) {
151
141
  updateMove = 0;
152
142
  }
153
- if (updateMove < -(props.listData.values.length - 1) * state.lineSpacing) {
154
- updateMove = -(props.listData.values.length - 1) * state.lineSpacing;
143
+ if (updateMove < -(props.column.length - 1) * state.lineSpacing) {
144
+ updateMove = -(props.column.length - 1) * state.lineSpacing;
155
145
  }
156
146
  let endMove = Math.round(updateMove / state.lineSpacing) * state.lineSpacing;
157
147
  let deg = `${(Math.abs(Math.round(endMove / state.lineSpacing)) + 1) * state.rotation}deg`;
@@ -173,25 +163,22 @@ const _sfc_main$1 = create$1({
173
163
  }
174
164
  };
175
165
  const setChooseValue = () => {
176
- emit("change", state.currIndex - 1);
166
+ emit("change", props.column[state.currIndex - 1]);
177
167
  };
178
168
  const modifyStatus = (type) => {
179
- let index = props.defaultIndex;
169
+ const { column: column2 } = props;
170
+ let index = column2.findIndex((columnItem) => columnItem.value == props.value);
180
171
  state.currIndex = index === -1 ? 1 : index + 1;
181
172
  let move = index === -1 ? 0 : index * state.lineSpacing;
182
173
  type && setChooseValue();
183
174
  setMove(-move);
184
175
  };
185
- watch(() => props.listData, (val) => {
176
+ watch(() => props.column, (val) => {
186
177
  state.transformY = 0;
187
178
  modifyStatus(false);
188
179
  }, {
189
180
  deep: true
190
181
  });
191
- watch(() => props.defaultIndex, (val) => {
192
- state.transformY = 0;
193
- modifyStatus(false);
194
- });
195
182
  onMounted(() => {
196
183
  modifyStatus(true);
197
184
  });
@@ -206,7 +193,8 @@ const _sfc_main$1 = create$1({
206
193
  onTouchMove,
207
194
  onTouchEnd,
208
195
  touchRollerStyle,
209
- touchListStyle
196
+ touchListStyle,
197
+ setMove
210
198
  });
211
199
  }
212
200
  });
@@ -227,12 +215,12 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
227
215
  ref: "roller",
228
216
  style: normalizeStyle(_ctx.touchRollerStyle)
229
217
  }, [
230
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index) => {
218
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
231
219
  return openBlock(), createElementBlock("view", {
232
220
  class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
233
221
  style: normalizeStyle(_ctx.setRollerStyle(index + 1)),
234
- key: item.label ? item.label : index
235
- }, toDisplayString(_ctx.dataType === "cascade" ? item.text : item), 7);
222
+ key: item.value ? item.value : index
223
+ }, toDisplayString(item.text), 7);
236
224
  }), 128))
237
225
  ], 4),
238
226
  createElementVNode("view", _hoisted_1$1, [
@@ -241,25 +229,29 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
241
229
  ref: "list",
242
230
  style: normalizeStyle(_ctx.touchListStyle)
243
231
  }, [
244
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index) => {
232
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
245
233
  return openBlock(), createElementBlock("view", {
246
- class: "nut-picker-item nut-picker-item-ref",
247
- key: item.label ? item.label : index
248
- }, toDisplayString(_ctx.dataType === "cascade" ? item.text : item), 1);
234
+ class: normalizeClass(["nut-picker-item", "nut-picker-item-ref", item.className]),
235
+ key: item.value ? item.value : index
236
+ }, toDisplayString(item.text), 3);
249
237
  }), 128)),
250
- _ctx.listData && _ctx.listData.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
238
+ _ctx.column && _ctx.column.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
251
239
  ], 4)
252
240
  ])
253
241
  ], 32);
254
242
  }
255
243
  var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
256
- const { create, componentName } = createComponent("picker");
244
+ const { componentName, create } = createComponent("picker");
257
245
  const _sfc_main = create({
258
246
  components: {
259
247
  [column.name]: column,
260
- [Popup.name]: Popup
248
+ [popup.name]: popup
261
249
  },
262
- props: __spreadValues(__spreadProps(__spreadValues({}, popupProps), {
250
+ props: __spreadProps(__spreadValues({}, popupProps), {
251
+ modelValue: {
252
+ type: Array,
253
+ default: () => []
254
+ },
263
255
  title: {
264
256
  type: String,
265
257
  default: ""
@@ -271,143 +263,158 @@ const _sfc_main = create({
271
263
  okText: {
272
264
  type: String,
273
265
  default: "\u786E\u5B9A"
266
+ },
267
+ columns: {
268
+ type: Array,
269
+ default: () => {
270
+ return [];
271
+ }
272
+ },
273
+ readonly: {
274
+ type: Boolean,
275
+ default: false
274
276
  }
275
- }), commonProps),
276
- emits: ["close", "change", "confirm", "update:visible"],
277
+ }),
278
+ emits: ["close", "change", "confirm", "update:visible", "update:modelValue"],
277
279
  setup(props, { emit }) {
278
- const childrenKey = "children";
279
- const valuesKey = "values";
280
280
  const state = reactive({
281
281
  show: false,
282
- formattedColumns: props.listData,
283
- defaultIndex: props.defaultIndex
282
+ formattedColumns: props.columns
284
283
  });
285
- let _defaultIndex = props.defaultIndex;
286
- let defaultIndexList = [];
284
+ let defaultValues = ref(props.modelValue);
287
285
  const classes = computed(() => {
288
286
  const prefixCls = componentName;
289
287
  return {
290
288
  [prefixCls]: true
291
289
  };
292
290
  });
293
- const dataType = computed(() => {
291
+ const selectedOptions = computed(() => {
292
+ let optins = [];
293
+ columnsList.value.map((column2, index) => {
294
+ let currOptions = [];
295
+ currOptions = column2.filter((item) => item.value == defaultValues.value[index]);
296
+ optins.push(currOptions[0]);
297
+ });
298
+ return optins;
299
+ });
300
+ const columnsType = computed(() => {
294
301
  const firstColumn = state.formattedColumns[0];
295
- if (typeof firstColumn === "object") {
296
- if (firstColumn[childrenKey]) {
302
+ if (firstColumn) {
303
+ if (Array.isArray(firstColumn)) {
304
+ return "multiple";
305
+ }
306
+ if ("children" in firstColumn) {
297
307
  return "cascade";
298
- } else if (firstColumn == null ? void 0 : firstColumn[valuesKey]) {
299
- addDefaultIndexList(props.listData);
300
- return "multipleColumns";
301
308
  }
302
309
  }
303
- return "text";
310
+ return "single";
304
311
  });
305
- const columnList = computed(() => {
306
- if (dataType.value === "text") {
307
- return [{ values: state.formattedColumns, defaultIndex: state.defaultIndex }];
308
- } else if (dataType.value === "multipleColumns") {
309
- return state.formattedColumns;
310
- } else if (dataType.value === "cascade") {
311
- return formatCascade(state.formattedColumns, state.defaultIndex);
312
+ const columnsList = computed(() => {
313
+ switch (columnsType.value) {
314
+ case "multiple":
315
+ return state.formattedColumns;
316
+ case "cascade":
317
+ return formatCascade(state.formattedColumns, defaultValues.value);
318
+ default:
319
+ return [state.formattedColumns];
312
320
  }
313
- return state.formattedColumns;
314
321
  });
315
- const addDefaultIndexList = (listData) => {
316
- defaultIndexList = [];
317
- listData.forEach((res) => {
318
- defaultIndexList.push(res.defaultIndex || 0);
319
- });
320
- };
321
- const formatCascade = (listData, defaultIndex) => {
322
+ const formatCascade = (columns, defaultValues2) => {
322
323
  const formatted = [];
323
- let children = listData;
324
- children.defaultIndex = defaultIndex;
325
- while (children) {
326
- formatted.push({
327
- values: children,
328
- defaultIndex: children.defaultIndex || 0
329
- });
330
- children = children == null ? void 0 : children[children.defaultIndex || 0].children;
324
+ let cursor = {
325
+ text: "",
326
+ value: "",
327
+ children: columns
328
+ };
329
+ let columnIndex = 0;
330
+ while (cursor && cursor.children) {
331
+ const options = cursor.children;
332
+ const value = defaultValues2[columnIndex];
333
+ let index = options.findIndex((columnItem) => columnItem.value == value);
334
+ if (index == -1)
335
+ index = 0;
336
+ cursor = cursor.children[index];
337
+ columnIndex++;
338
+ formatted.push(options);
331
339
  }
332
- addDefaultIndexList(formatted);
333
340
  return formatted;
334
341
  };
335
- const getCascadeData = (listData, defaultIndex) => {
336
- var _a;
337
- let arr = listData;
338
- arr.defaultIndex = defaultIndex;
339
- const dataList = [];
340
- while (arr) {
341
- const item = arr[(_a = arr.defaultIndex) != null ? _a : 0];
342
- dataList.push(item.text);
343
- arr = item.children;
344
- }
345
- return dataList;
346
- };
347
342
  const close = () => {
348
343
  emit("close");
349
344
  emit("update:visible", false);
350
345
  };
351
- const changeHandler = (columnIndex, dataIndex) => {
352
- if (dataType.value === "cascade") {
353
- let cursor = state.formattedColumns;
354
- if (columnIndex === 0) {
355
- state.defaultIndex = dataIndex;
356
- }
357
- let i = 0;
358
- while (cursor) {
359
- if (i === columnIndex) {
360
- cursor.defaultIndex = dataIndex;
361
- } else if (i > columnIndex) {
362
- cursor.defaultIndex = 0;
346
+ const changeHandler = (columnIndex, option) => {
347
+ if (option && Object.keys(option).length) {
348
+ if (columnsType.value === "cascade") {
349
+ defaultValues.value[columnIndex] = option.value ? option.value : "";
350
+ let index = columnIndex;
351
+ let cursor = option;
352
+ while (cursor && cursor.children) {
353
+ defaultValues.value[index + 1] = cursor.children[0].value;
354
+ index++;
355
+ cursor = cursor.children[0];
363
356
  }
364
- cursor = cursor[cursor.defaultIndex || 0].children;
365
- i++;
357
+ } else {
358
+ defaultValues.value[columnIndex] = option.value ? option.value : "";
366
359
  }
367
- } else if (dataType.value === "text") {
368
- _defaultIndex = dataIndex;
369
- } else if (dataType.value === "multipleColumns") {
370
- defaultIndexList[columnIndex] = dataIndex;
371
- const val = defaultIndexList.map((res, i) => toRaw(state.formattedColumns)[i].values[res]);
372
- emit("change", val, columnIndex, dataIndex);
360
+ emit("change", {
361
+ columnIndex,
362
+ selectedValue: defaultValues.value,
363
+ selectedOptions: selectedOptions.value
364
+ });
373
365
  }
374
366
  };
375
- const confirm = () => {
376
- if (dataType.value === "text") {
377
- state.defaultIndex = _defaultIndex;
378
- emit("confirm", state.formattedColumns[_defaultIndex]);
379
- } else if (dataType.value === "multipleColumns") {
380
- for (let i = 0; i < defaultIndexList.length; i++) {
381
- state.formattedColumns[i].defaultIndex = defaultIndexList[i];
382
- }
383
- const checkedArr = toRaw(state.formattedColumns).map((res) => res.values && res.values[res.defaultIndex]);
384
- emit("confirm", checkedArr);
385
- } else if (dataType.value === "cascade") {
386
- emit("confirm", getCascadeData(toRaw(state.formattedColumns), state.defaultIndex));
387
- }
367
+ const confirmHandler = () => {
368
+ emit("confirm", {
369
+ selectedValue: defaultValues.value,
370
+ selectedOptions: selectedOptions.value
371
+ });
388
372
  emit("update:visible", false);
389
373
  };
374
+ onMounted(() => {
375
+ if (props.visible)
376
+ state.show = props.visible;
377
+ });
378
+ onBeforeUnmount(() => {
379
+ if (props.visible)
380
+ state.show = false;
381
+ });
382
+ watch(() => props.modelValue, (newValues) => {
383
+ const isSameValue = JSON.stringify(newValues) === JSON.stringify(defaultValues.value);
384
+ if (!isSameValue) {
385
+ defaultValues.value = newValues;
386
+ }
387
+ }, { deep: true });
388
+ watch(defaultValues, (newValues) => {
389
+ const isSameValue = JSON.stringify(newValues) === JSON.stringify(props.modelValue);
390
+ if (!isSameValue) {
391
+ emit("update:modelValue", newValues);
392
+ }
393
+ }, { immediate: true });
390
394
  watch(() => props.visible, (val) => {
391
395
  state.show = val;
392
396
  });
393
- watch(() => props.listData, (val) => {
394
- state.formattedColumns = val;
397
+ watch(() => props.columns, (val) => {
398
+ if (val.length)
399
+ state.formattedColumns = val;
395
400
  });
396
401
  return __spreadProps(__spreadValues({
397
402
  classes
398
403
  }, toRefs(state)), {
399
404
  column,
400
- dataType,
401
- columnList,
405
+ columnsType,
406
+ columnsList,
402
407
  close,
403
408
  changeHandler,
404
- confirm
409
+ confirmHandler,
410
+ defaultValues
405
411
  });
406
412
  }
407
413
  });
408
414
  const _hoisted_1 = { class: "nut-picker__bar" };
409
- const _hoisted_2 = { class: "nut-picker__column" };
410
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker__hairline" }, null, -1);
415
+ const _hoisted_2 = { class: "nut-picker__title" };
416
+ const _hoisted_3 = { class: "nut-picker__column" };
417
+ const _hoisted_4 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker__hairline" }, null, -1);
411
418
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
412
419
  const _component_nut_picker_column = resolveComponent("nut-picker-column");
413
420
  const _component_nut_popup = resolveComponent("nut-popup");
@@ -422,44 +429,44 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
422
429
  "lock-scroll": _ctx.lockScroll,
423
430
  "close-on-click-overlay": _ctx.closeOnClickOverlay,
424
431
  onClose: _ctx.close,
425
- round: true
432
+ round: true,
433
+ isWrapTeleport: _ctx.isWrapTeleport
426
434
  }, {
427
435
  default: withCtx(() => [
428
436
  createElementVNode("view", _hoisted_1, [
429
437
  createElementVNode("view", {
430
- class: "nut-picker__left nut-picker__button",
438
+ class: "nut-picker__cancel nut-picker__left nut-picker__button",
431
439
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
432
440
  }, toDisplayString(_ctx.cancelText), 1),
433
- createElementVNode("view", null, toDisplayString(_ctx.title), 1),
441
+ createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
434
442
  createElementVNode("view", {
435
- class: "nut-picker__button",
436
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
443
+ class: "nut-picker__confirm nut-picker__right nut-picker__button",
444
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
437
445
  }, toDisplayString(_ctx.okText), 1)
438
446
  ]),
439
- createElementVNode("view", _hoisted_2, [
440
- _hoisted_3,
441
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnList, (item, columnIndex) => {
447
+ createElementVNode("view", _hoisted_3, [
448
+ _hoisted_4,
449
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnsList, (column2, columnIndex) => {
442
450
  return openBlock(), createElementBlock("view", {
443
451
  class: "nut-picker__columnitem",
444
452
  key: columnIndex
445
453
  }, [
446
454
  createVNode(_component_nut_picker_column, {
447
455
  itemShow: _ctx.show,
448
- "list-data": item,
456
+ column: column2,
449
457
  readonly: _ctx.readonly,
450
- "default-index": item.defaultIndex,
451
- "visible-item-count": _ctx.visibleItemCount,
452
- "data-type": _ctx.dataType,
453
- onChange: (dataIndex) => {
454
- _ctx.changeHandler(columnIndex, dataIndex);
458
+ columnsType: _ctx.columnsType,
459
+ value: _ctx.defaultValues[columnIndex],
460
+ onChange: (option) => {
461
+ _ctx.changeHandler(columnIndex, option);
455
462
  }
456
- }, null, 8, ["itemShow", "list-data", "readonly", "default-index", "visible-item-count", "data-type", "onChange"])
463
+ }, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "onChange"])
457
464
  ]);
458
465
  }), 128))
459
466
  ])
460
467
  ]),
461
468
  _: 1
462
- }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose"])
469
+ }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "isWrapTeleport"])
463
470
  ], 2);
464
471
  }
465
472
  var picker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
@@ -18,13 +18,13 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { ref, reactive, toRefs, computed, onMounted, watch, resolveComponent, openBlock, createElementBlock, withModifiers, normalizeClass, createElementVNode, renderSlot, Fragment, normalizeStyle, renderList, createVNode, createCommentVNode, toDisplayString } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
- import Popup, { popupProps } from "./Popup.js";
27
+ import popup, { popupProps } from "./Popup.js";
28
28
  import Button from "./Button.js";
29
29
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
30
  import "./OverLay.js";
@@ -34,7 +34,7 @@ const { componentName, create } = createComponent("popover");
34
34
  const _sfc_main = create({
35
35
  inheritAttrs: false,
36
36
  components: {
37
- [Popup.name]: Popup,
37
+ [popup.name]: popup,
38
38
  [Button.name]: Button
39
39
  },
40
40
  props: __spreadProps(__spreadValues({}, popupProps), {
@@ -138,6 +138,9 @@ const _sfc_main = create({
138
138
  emit("update:visible", false);
139
139
  };
140
140
  const chooseItem = (item, index2) => {
141
+ if (item.disabled) {
142
+ return;
143
+ }
141
144
  emit("choose", item, index2);
142
145
  };
143
146
  return {
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock, createBlock, Teleport, normalizeClass, normalizeStyle, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, renderSlot, createElementBlock, vShow } from "vue";
@@ -307,5 +307,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
307
307
  }, 8, ["name", "onAfterEnter", "onAfterLeave"])
308
308
  ]));
309
309
  }
310
- var Popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
311
- export { Popup as default, popupProps };
310
+ var popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
311
+ export { popup as default, popupProps };
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, createBlock } from "vue";
6
+ import { ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, createBlock } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  const { create } = createComponent("progress");
@@ -42,6 +42,10 @@ const _sfc_main = create({
42
42
  tyep: String,
43
43
  default: ""
44
44
  },
45
+ textBackground: {
46
+ tyep: String,
47
+ default: ""
48
+ },
45
49
  iconName: {
46
50
  type: String,
47
51
  default: "checked"
@@ -59,7 +63,6 @@ const _sfc_main = create({
59
63
  const height = ref(props.strokeWidth + "px");
60
64
  const progressOuter = ref();
61
65
  const insideText = ref();
62
- const left = ref();
63
66
  const bgStyle = computed(() => {
64
67
  return {
65
68
  width: props.percentage + "%",
@@ -71,30 +74,14 @@ const _sfc_main = create({
71
74
  color: props.textColor || ""
72
75
  };
73
76
  });
74
- const slideLeft = (values) => {
75
- if (props.textInside) {
76
- let offsetWidth = progressOuter.value.offsetWidth;
77
- let percentageWidth = progressOuter.value.offsetWidth * Number(values) * 0.01;
78
- let insideTextWidth = insideText.value.offsetWidth;
79
- left.value = percentageWidth - 5 + "px";
80
- if (offsetWidth == percentageWidth) {
81
- left.value = percentageWidth - insideTextWidth + "px";
82
- }
83
- }
84
- };
85
- watch(() => props.percentage, (values) => {
86
- slideLeft(values);
87
- });
88
77
  onMounted(() => {
89
- slideLeft(props.percentage);
90
78
  });
91
79
  return {
92
80
  height,
93
81
  bgStyle,
94
82
  textStyle,
95
83
  progressOuter,
96
- insideText,
97
- left
84
+ insideText
98
85
  };
99
86
  }
100
87
  });
@@ -115,7 +102,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
115
102
  key: 0,
116
103
  class: "nut-progress-text nut-progress-insidetext",
117
104
  ref: "insideText",
118
- style: normalizeStyle({ lineHeight: _ctx.height, left: _ctx.left })
105
+ style: normalizeStyle({
106
+ lineHeight: _ctx.height,
107
+ left: `${_ctx.percentage}%`,
108
+ transform: `translate(-${+_ctx.percentage}%,-50%)`,
109
+ background: _ctx.textBackground || _ctx.strokeColor
110
+ })
119
111
  }, [
120
112
  createElementVNode("span", {
121
113
  style: normalizeStyle(_ctx.textStyle)