@nutui/nutui 3.1.18-beta.0 → 3.1.18

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 (143) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +1 -1
  3. package/README.md +6 -0
  4. package/dist/nutui.d.ts +3 -1
  5. package/dist/nutui.es.js +2230 -1192
  6. package/dist/nutui.umd.js +2240 -1201
  7. package/dist/packages/_es/ActionSheet.js +2 -2
  8. package/dist/packages/_es/Address.js +17 -11
  9. package/dist/packages/_es/Audio.js +2 -2
  10. package/dist/packages/_es/Avatar.js +2 -2
  11. package/dist/packages/_es/BackTop.js +5 -2
  12. package/dist/packages/_es/Badge.js +2 -2
  13. package/dist/packages/_es/Barrage.js +2 -2
  14. package/dist/packages/_es/Button.js +2 -2
  15. package/dist/packages/_es/Calendar.js +15 -16
  16. package/dist/packages/_es/Card.js +2 -2
  17. package/dist/packages/_es/Cascader.js +2 -2
  18. package/dist/packages/_es/Cell.js +24 -17
  19. package/dist/packages/_es/CellGroup.js +2 -2
  20. package/dist/packages/_es/Checkbox.js +4 -4
  21. package/dist/packages/_es/CheckboxGroup.js +3 -3
  22. package/dist/packages/_es/CircleProgress.js +2 -2
  23. package/dist/packages/_es/Col.js +2 -2
  24. package/dist/packages/_es/Collapse.js +2 -2
  25. package/dist/packages/_es/CollapseItem.js +28 -18
  26. package/dist/packages/_es/CountDown.js +4 -2
  27. package/dist/packages/_es/CountUp.js +25 -16
  28. package/dist/packages/_es/DatePicker.js +83 -47
  29. package/dist/packages/_es/Dialog.js +5 -3
  30. package/dist/packages/_es/Divider.js +2 -2
  31. package/dist/packages/_es/Drag.js +4 -4
  32. package/dist/packages/_es/Elevator.js +2 -2
  33. package/dist/packages/_es/Empty.js +2 -2
  34. package/dist/packages/_es/FixedNav.js +2 -2
  35. package/dist/packages/_es/Form.js +8 -6
  36. package/dist/packages/_es/FormItem.js +9 -6
  37. package/dist/packages/_es/Grid.js +2 -2
  38. package/dist/packages/_es/GridItem.js +2 -2
  39. package/dist/packages/_es/Icon.js +2 -2
  40. package/dist/packages/_es/ImagePreview.js +2 -2
  41. package/dist/packages/_es/Indicator.js +2 -2
  42. package/dist/packages/_es/InfiniteLoading.js +2 -2
  43. package/dist/packages/_es/Input.js +290 -66
  44. package/dist/packages/_es/InputNumber.js +2 -2
  45. package/dist/packages/_es/Layout.js +2 -2
  46. package/dist/packages/_es/List.js +124 -0
  47. package/dist/packages/_es/Menu.js +2 -2
  48. package/dist/packages/_es/MenuItem.js +2 -2
  49. package/dist/packages/_es/Navbar.js +16 -10
  50. package/dist/packages/_es/NoticeBar.js +6 -5
  51. package/dist/packages/_es/Notify.js +7 -3
  52. package/dist/packages/_es/NumberKeyboard.js +9 -4
  53. package/dist/packages/_es/OverLay.js +2 -2
  54. package/dist/packages/_es/Pagination.js +2 -2
  55. package/dist/packages/_es/Picker.js +163 -157
  56. package/dist/packages/_es/Popover.js +2 -2
  57. package/dist/packages/_es/Popup.js +2 -2
  58. package/dist/packages/_es/Price.js +2 -2
  59. package/dist/packages/_es/Progress.js +14 -22
  60. package/dist/packages/_es/Radio.js +3 -3
  61. package/dist/packages/_es/RadioGroup.js +2 -2
  62. package/dist/packages/_es/Range.js +129 -19
  63. package/dist/packages/_es/Rate.js +2 -2
  64. package/dist/packages/_es/Row.js +2 -2
  65. package/dist/packages/_es/SearchBar.js +2 -2
  66. package/dist/packages/_es/ShortPassword.js +2 -2
  67. package/dist/packages/_es/SideNavBar.js +2 -2
  68. package/dist/packages/_es/SideNavBarItem.js +2 -2
  69. package/dist/packages/_es/Signature.js +25 -6
  70. package/dist/packages/_es/Skeleton.js +2 -2
  71. package/dist/packages/_es/Sku.js +31 -13
  72. package/dist/packages/_es/Step.js +28 -12
  73. package/dist/packages/_es/Steps.js +8 -3
  74. package/dist/packages/_es/Sticky.js +2 -2
  75. package/dist/packages/_es/SubSideNavBar.js +2 -2
  76. package/dist/packages/_es/Swipe.js +2 -2
  77. package/dist/packages/_es/Swiper.js +2 -2
  78. package/dist/packages/_es/SwiperItem.js +2 -2
  79. package/dist/packages/_es/Switch.js +2 -2
  80. package/dist/packages/_es/TabPane.js +2 -2
  81. package/dist/packages/_es/Tabbar.js +2 -2
  82. package/dist/packages/_es/TabbarItem.js +17 -6
  83. package/dist/packages/_es/Table.js +2 -2
  84. package/dist/packages/_es/Tabs.js +8 -5
  85. package/dist/packages/_es/Tag.js +11 -5
  86. package/dist/packages/_es/TextArea.js +38 -6
  87. package/dist/packages/_es/TimeDetail.js +2 -2
  88. package/dist/packages/_es/TimePannel.js +2 -2
  89. package/dist/packages/_es/TimeSelect.js +2 -2
  90. package/dist/packages/_es/Toast.js +2 -2
  91. package/dist/packages/_es/Uploader.js +2 -4
  92. package/dist/packages/_es/Video.js +12 -8
  93. package/dist/packages/_es/common.js +2 -2
  94. package/dist/packages/_es/component.js +2 -2
  95. package/dist/packages/_es/index.js +2 -2
  96. package/dist/packages/_es/index2.js +2 -2
  97. package/dist/packages/_es/index3.js +2 -2
  98. package/dist/packages/_es/index4.js +2 -2
  99. package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
  100. package/dist/packages/_es/pxCheck.js +2 -2
  101. package/dist/packages/_es/raf.js +2 -2
  102. package/dist/packages/_es/util.js +2 -2
  103. package/dist/packages/badge/index.scss +11 -13
  104. package/dist/packages/button/index.scss +1 -0
  105. package/dist/packages/calendar/index.scss +9 -4
  106. package/dist/packages/calendaritem/index.scss +0 -207
  107. package/dist/packages/cell/index.scss +6 -6
  108. package/dist/packages/checkbox/index.scss +4 -3
  109. package/dist/packages/collapseitem/index.scss +21 -11
  110. package/dist/packages/countdown/index.scss +3 -1
  111. package/dist/packages/divider/index.scss +8 -8
  112. package/dist/packages/elevator/index.scss +36 -36
  113. package/dist/packages/formitem/index.scss +15 -8
  114. package/dist/packages/indicator/index.scss +1 -1
  115. package/dist/packages/input/index.scss +70 -24
  116. package/dist/packages/inputnumber/index.scss +4 -2
  117. package/dist/packages/list/index.scss +24 -0
  118. package/dist/packages/menu/index.scss +3 -3
  119. package/dist/packages/navbar/index.scss +28 -8
  120. package/dist/packages/noticebar/index.scss +7 -8
  121. package/dist/packages/notify/index.scss +9 -0
  122. package/dist/packages/numberkeyboard/index.scss +22 -21
  123. package/dist/packages/oldpicker/index.scss +131 -0
  124. package/dist/packages/picker/index.scss +38 -32
  125. package/dist/packages/progress/index.scss +6 -5
  126. package/dist/packages/radio/index.scss +7 -6
  127. package/dist/packages/range/index.scss +109 -2
  128. package/dist/packages/searchbar/index.scss +7 -7
  129. package/dist/packages/sidenavbaritem/index.scss +5 -5
  130. package/dist/packages/step/index.scss +29 -29
  131. package/dist/packages/subsidenavbar/index.scss +10 -8
  132. package/dist/packages/tabbaritem/index.scss +15 -0
  133. package/dist/packages/timedetail/index.scss +13 -13
  134. package/dist/packages/timepannel/index.scss +7 -7
  135. package/dist/packages/timeselect/index.scss +3 -3
  136. package/dist/packages/uploader/index.scss +4 -4
  137. package/dist/style.css +1 -1
  138. package/dist/styles/themes/default.scss +39 -37
  139. package/dist/styles/themes/jdt.scss +91 -0
  140. package/dist/styles/variables-jdt.scss +727 -0
  141. package/dist/styles/variables.scss +250 -44
  142. package/package.json +2 -1
  143. package/dist/styles/themes/jdd.scss +0 -2
@@ -18,11 +18,11 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { getCurrentInstance, reactive, watch, nextTick, onMounted, onUnmounted, toRefs, openBlock, createElementBlock, Fragment, normalizeStyle, renderList, createCommentVNode, toDisplayString, createTextVNode } from "vue";
25
+ import { getCurrentInstance, ref, reactive, watch, nextTick, onMounted, onUnmounted, toRefs, openBlock, createElementBlock, Fragment, normalizeStyle, renderList, createCommentVNode, toDisplayString, createTextVNode } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
27
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
28
  function useExtend(apis) {
@@ -98,7 +98,7 @@ const _sfc_main = create({
98
98
  type: Number,
99
99
  default: 0
100
100
  },
101
- machineTrunMore: {
101
+ machineTurnMore: {
102
102
  type: Number,
103
103
  default: 0
104
104
  }
@@ -106,6 +106,11 @@ const _sfc_main = create({
106
106
  components: {},
107
107
  emits: ["click", "scroll-end"],
108
108
  setup(props, { emit }) {
109
+ const runNumberImg = ref(null);
110
+ const numberItemRef = ref([]);
111
+ const setRef = (el) => {
112
+ numberItemRef.value.push(el);
113
+ };
109
114
  const data = reactive({
110
115
  valFlag: false,
111
116
  current: 0,
@@ -200,21 +205,23 @@ const _sfc_main = create({
200
205
  let countTimer = setInterval(() => {
201
206
  if (initNum > endNum) {
202
207
  if (data.current <= endNum || data.current <= speed) {
203
- data.current = Number(endNum.toFixed(toFixed));
208
+ data.current = endNum.toFixed(toFixed);
204
209
  clearInterval(countTimer);
205
210
  emit("scroll-end");
206
211
  data.valFlag = false;
207
212
  } else {
208
- data.current = Number((parseFloat(String(data.current)) - parseFloat(String(speed))).toFixed(toFixed));
213
+ let num = parseFloat(String(data.current)) - parseFloat(String(speed));
214
+ data.current = num.toFixed(toFixed);
209
215
  }
210
216
  } else {
211
217
  if (data.current >= endNum) {
212
- data.current = Number(endNum.toFixed(toFixed));
218
+ data.current = endNum.toFixed(toFixed);
213
219
  clearInterval(countTimer);
214
220
  emit("scroll-end");
215
221
  data.valFlag = false;
216
222
  } else {
217
- data.current = Number((parseFloat(String(data.current)) + parseFloat(String(speed))).toFixed(toFixed));
223
+ let num = parseFloat(String(data.current)) + parseFloat(String(speed));
224
+ data.current = num.toFixed(toFixed);
218
225
  }
219
226
  }
220
227
  }, props.during);
@@ -295,8 +302,7 @@ const _sfc_main = create({
295
302
  if (data.sortFlag == "equal") {
296
303
  return false;
297
304
  }
298
- let refsDom = document.getElementsByClassName("numberItem");
299
- let element = refsDom[data.num_total_len - 1];
305
+ let element = numberItemRef.value[data.num_total_len - 1];
300
306
  runTurn(element);
301
307
  });
302
308
  } else {
@@ -359,8 +365,7 @@ const _sfc_main = create({
359
365
  Math.pow(10, data.pointNum);
360
366
  }
361
367
  nextTick(() => {
362
- let f = document.getElementsByClassName("run-number-img")[0];
363
- f.addEventListener("webkitTransitionEnd", () => {
368
+ runNumberImg.value.addEventListener("webkitTransitionEnd", () => {
364
369
  emit("scroll-end");
365
370
  data.valFlag = false;
366
371
  });
@@ -376,14 +381,14 @@ const _sfc_main = create({
376
381
  }
377
382
  };
378
383
  const machineLuck = () => {
379
- const machineTrunMoreNum = props.machineTrunMore < 0 ? 0 : props.machineTrunMore;
384
+ const machineTurnMoreNum = props.machineTurnMore < 0 ? 0 : props.machineTurnMore;
380
385
  let distance = props.numHeight * props.machinePrizeNum;
381
386
  if (data.prizeLevelTrun < 0) {
382
387
  generateRandom();
383
388
  }
384
389
  for (let i = 0; i < props.machineNum; i++) {
385
390
  setTimeout(() => {
386
- let turn = distance * (i + 1 + parseFloat(String(machineTrunMoreNum)));
391
+ let turn = distance * (i + 1 + parseFloat(String(machineTurnMoreNum)));
387
392
  if (data.prizeYPrev.length != 0) {
388
393
  data.prizeY[i] = data.prizeYPrev[i];
389
394
  }
@@ -443,6 +448,8 @@ const _sfc_main = create({
443
448
  data.timer = null;
444
449
  });
445
450
  return __spreadProps(__spreadValues(__spreadValues({}, toRefs(data)), toRefs(reactive(props))), {
451
+ runNumberImg,
452
+ setRef,
446
453
  topNumber,
447
454
  turnNumber
448
455
  });
@@ -474,6 +481,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
474
481
  }), 128))
475
482
  ], 4)) : (openBlock(), createElementBlock("view", {
476
483
  key: 1,
484
+ ref: "runNumberImg",
477
485
  class: "run-number-img",
478
486
  style: normalizeStyle({ height: _ctx.numHeight + "px" })
479
487
  }, [
@@ -486,7 +494,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
486
494
  height: _ctx.numHeight + "px",
487
495
  left: _ctx.numWidth * (index2 > _ctx.num_total_len - _ctx.pointNum - 1 ? index2 == _ctx.num_total_len - _ctx.pointNum ? index2 * 1.5 : index2 * 1.3 : index2) + "px",
488
496
  backgroundImage: "url(" + _ctx.customBgImg + ")",
489
- backgroundPosition: "0 " + -(String(_ctx.relNum)[index2] * _ctx.numHeight + _ctx.customSpacNum * String(_ctx.relNum)[index2]) + "px",
497
+ backgroundPositionX: "0",
498
+ backgroundPositionY: -(String(_ctx.relNum)[index2] * _ctx.numHeight + _ctx.customSpacNum * String(_ctx.relNum)[index2]) + "px",
490
499
  transition: "all linear " + _ctx.during / 10 + "ms"
491
500
  })
492
501
  }, null, 4);
@@ -515,7 +524,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
515
524
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val, index2) => {
516
525
  return openBlock(), createElementBlock("view", {
517
526
  ref_for: true,
518
- ref: "numberItem",
527
+ ref: _ctx.setRef,
519
528
  class: "numberItem",
520
529
  key: val,
521
530
  style: normalizeStyle({
@@ -18,18 +18,25 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { reactive, computed, onMounted, watch, toRefs, resolveComponent, openBlock, createBlock } from "vue";
25
+ import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock } from "vue";
26
26
  import picker from "./Picker.js";
27
+ import { popupProps } from "./Popup.js";
27
28
  import { c as createComponent } from "./component.js";
28
29
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
29
- import "./Popup.js";
30
30
  import "./OverLay.js";
31
31
  import "./Icon.js";
32
32
  import "./pxCheck.js";
33
+ function padZero(num, targetLength = 2) {
34
+ let str = num + "";
35
+ while (str.length < targetLength) {
36
+ str = "0" + str;
37
+ }
38
+ return str;
39
+ }
33
40
  const { componentName, create } = createComponent("datepicker");
34
41
  const currentYear = new Date().getFullYear();
35
42
  function isDate(val) {
@@ -47,23 +54,27 @@ const _sfc_main = create({
47
54
  components: {
48
55
  [picker.name]: picker
49
56
  },
50
- props: {
57
+ props: __spreadProps(__spreadValues({}, popupProps), {
51
58
  modelValue: null,
52
- visible: {
53
- type: Boolean,
54
- default: false
55
- },
56
59
  title: {
57
60
  type: String,
58
61
  default: ""
59
62
  },
63
+ okText: {
64
+ type: String,
65
+ default: "\u786E\u5B9A"
66
+ },
67
+ cancelText: {
68
+ type: String,
69
+ default: "\u53D6\u6D88"
70
+ },
60
71
  type: {
61
72
  type: String,
62
73
  default: "date"
63
74
  },
64
75
  isShowChinese: {
65
76
  type: Boolean,
66
- default: true
77
+ default: false
67
78
  },
68
79
  minuteStep: {
69
80
  type: Number,
@@ -78,14 +89,20 @@ const _sfc_main = create({
78
89
  type: Date,
79
90
  default: () => new Date(currentYear + 10, 11, 31),
80
91
  validator: isDate
81
- }
82
- },
83
- emits: ["click", "update:visible", "confirm"],
92
+ },
93
+ formatter: {
94
+ type: Function,
95
+ default: null
96
+ },
97
+ filter: Function
98
+ }),
99
+ emits: ["click", "update:visible", "change", "confirm", "update:moduleValue"],
84
100
  setup(props, { emit }) {
85
101
  const state = reactive({
86
102
  show: false,
87
103
  currentDate: new Date(),
88
- title: props.title
104
+ title: props.title,
105
+ selectedValue: []
89
106
  });
90
107
  const formatValue = (value) => {
91
108
  if (!isDate(value)) {
@@ -102,12 +119,12 @@ const _sfc_main = create({
102
119
  const boundary = props[`${type}Date`];
103
120
  const year = boundary.getFullYear();
104
121
  let month = 1;
105
- let date = 1;
122
+ let day = 1;
106
123
  let hour = 0;
107
124
  let minute = 0;
108
125
  if (type === "max") {
109
126
  month = 12;
110
- date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
127
+ day = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
111
128
  hour = 23;
112
129
  minute = 59;
113
130
  }
@@ -115,8 +132,8 @@ const _sfc_main = create({
115
132
  if (value.getFullYear() === year) {
116
133
  month = boundary.getMonth() + 1;
117
134
  if (value.getMonth() + 1 === month) {
118
- date = boundary.getDate();
119
- if (value.getDate() === date) {
135
+ day = boundary.getDate();
136
+ if (value.getDate() === day) {
120
137
  hour = boundary.getHours();
121
138
  if (value.getHours() === hour) {
122
139
  minute = boundary.getMinutes();
@@ -127,15 +144,15 @@ const _sfc_main = create({
127
144
  return {
128
145
  [`${type}Year`]: year,
129
146
  [`${type}Month`]: month,
130
- [`${type}Date`]: date,
147
+ [`${type}Day`]: day,
131
148
  [`${type}Hour`]: hour,
132
149
  [`${type}Minute`]: minute,
133
150
  [`${type}Seconds`]: seconds
134
151
  };
135
152
  };
136
153
  const ranges = computed(() => {
137
- const { maxYear, maxDate, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", state.currentDate);
138
- const { minYear, minDate, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", state.currentDate);
154
+ const { maxYear, maxDay, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", state.currentDate);
155
+ const { minYear, minDay, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", state.currentDate);
139
156
  let result = [
140
157
  {
141
158
  type: "year",
@@ -147,7 +164,7 @@ const _sfc_main = create({
147
164
  },
148
165
  {
149
166
  type: "day",
150
- range: [minDate, maxDate]
167
+ range: [minDay, maxDay]
151
168
  },
152
169
  {
153
170
  type: "hour",
@@ -172,6 +189,9 @@ const _sfc_main = create({
172
189
  case "time":
173
190
  result = result.slice(3, 6);
174
191
  break;
192
+ case "year-month":
193
+ result = result.slice(0, 2);
194
+ break;
175
195
  case "month-day":
176
196
  result = result.slice(1, 3);
177
197
  break;
@@ -181,32 +201,45 @@ const _sfc_main = create({
181
201
  }
182
202
  return result;
183
203
  });
184
- const changeHandler = (val) => {
204
+ const columns = computed(() => {
205
+ const val = ranges.value.map((res, columnIndex) => {
206
+ return generateValue(res.range[0], res.range[1], getDateIndex(res.type), res.type, columnIndex);
207
+ });
208
+ return val;
209
+ });
210
+ const changeHandler = ({
211
+ columnIndex,
212
+ selectedValue,
213
+ selectedOptions
214
+ }) => {
185
215
  if (["date", "datetime"].includes(props.type)) {
186
216
  let formatDate = [];
187
- if (props.isShowChinese) {
188
- formatDate = val.map((res) => {
189
- return Number(res.slice(0, res.length - 1));
190
- });
191
- } else {
192
- formatDate = val;
193
- }
217
+ formatDate = selectedValue;
194
218
  if (props.type === "date") {
195
219
  state.currentDate = formatValue(new Date(formatDate[0], formatDate[1] - 1, Math.min(formatDate[2], getMonthEndDay(formatDate[0], formatDate[1]))));
196
220
  } else if (props.type === "datetime") {
197
221
  state.currentDate = formatValue(new Date(formatDate[0], formatDate[1] - 1, Math.min(formatDate[2], getMonthEndDay(formatDate[0], formatDate[1])), formatDate[3], formatDate[4]));
198
222
  }
199
223
  }
224
+ emit("change", { columnIndex, selectedValue, selectedOptions });
225
+ };
226
+ const formatterOption = (type, value) => {
227
+ const { filter, formatter, isShowChinese } = props;
228
+ let fOption = null;
229
+ if (formatter) {
230
+ fOption = formatter(type, { text: padZero(value, 2), value: padZero(value, 2) });
231
+ } else {
232
+ const padMin = padZero(value, 2);
233
+ const fatter = isShowChinese ? zhCNType[type] : "";
234
+ fOption = { text: padMin + fatter, value: padMin };
235
+ }
236
+ return fOption;
200
237
  };
201
- const generateValue = (min, max, val, type) => {
238
+ const generateValue = (min, max, val, type, columnIndex) => {
202
239
  const arr = [];
203
240
  let index2 = 0;
204
241
  while (min <= max) {
205
- if (props.isShowChinese) {
206
- arr.push(min + zhCNType[type]);
207
- } else {
208
- arr.push(min);
209
- }
242
+ arr.push(formatterOption(type, min));
210
243
  if (type === "minute") {
211
244
  min += props.minuteStep;
212
245
  } else {
@@ -216,7 +249,8 @@ const _sfc_main = create({
216
249
  index2++;
217
250
  }
218
251
  }
219
- return { values: arr, defaultIndex: index2 };
252
+ state.selectedValue[columnIndex] = arr[index2].value;
253
+ return props.filter ? props.filter(type, arr) : arr;
220
254
  };
221
255
  const getDateIndex = (type) => {
222
256
  if (type === "year") {
@@ -234,12 +268,6 @@ const _sfc_main = create({
234
268
  }
235
269
  return 0;
236
270
  };
237
- const columns = computed(() => {
238
- const val = ranges.value.map((res) => {
239
- return generateValue(res.range[0], res.range[1], getDateIndex(res.type), res.type);
240
- });
241
- return val;
242
- });
243
271
  const closeHandler = () => {
244
272
  emit("update:visible", false);
245
273
  };
@@ -247,9 +275,12 @@ const _sfc_main = create({
247
275
  emit("update:visible", false);
248
276
  emit("confirm", val);
249
277
  };
250
- onMounted(() => {
278
+ onBeforeMount(() => {
251
279
  state.currentDate = formatValue(props.modelValue);
252
280
  });
281
+ watch(() => props.modelValue, (value) => {
282
+ state.currentDate = formatValue(value);
283
+ });
253
284
  watch(() => props.title, (val) => {
254
285
  state.title = val;
255
286
  });
@@ -267,13 +298,18 @@ const _sfc_main = create({
267
298
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
268
299
  const _component_nut_picker = resolveComponent("nut-picker");
269
300
  return openBlock(), createBlock(_component_nut_picker, {
301
+ modelValue: _ctx.selectedValue,
302
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.selectedValue = $event),
270
303
  visible: _ctx.show,
304
+ okText: _ctx.okText,
305
+ cancelText: _ctx.cancelText,
271
306
  onClose: _ctx.closeHandler,
272
- "list-data": _ctx.columns,
307
+ columns: _ctx.columns,
273
308
  onChange: _ctx.changeHandler,
274
309
  title: _ctx.title,
275
- onConfirm: _ctx.confirm
276
- }, null, 8, ["visible", "onClose", "list-data", "onChange", "title", "onConfirm"]);
310
+ onConfirm: _ctx.confirm,
311
+ isWrapTeleport: _ctx.isWrapTeleport
312
+ }, null, 8, ["modelValue", "visible", "okText", "cancelText", "onClose", "columns", "onChange", "title", "onConfirm", "isWrapTeleport"]);
277
313
  }
278
314
  var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
279
315
  export { index as default };
@@ -22,8 +22,8 @@ var __publicField = (obj, key, value) => {
22
22
  return value;
23
23
  };
24
24
  /*!
25
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
26
- * (c) 2021 @jdf2e.
25
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
26
+ * (c) 2022 @jdf2e.
27
27
  * Released under the MIT License.
28
28
  */
29
29
  import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle, createVNode, render, h } from "vue";
@@ -223,6 +223,8 @@ class DialogOptions {
223
223
  __publicField(this, "okText", "\u786E\u5B9A");
224
224
  __publicField(this, "textAlign", "center");
225
225
  __publicField(this, "teleport", "body");
226
+ __publicField(this, "id", new Date().getTime());
227
+ __publicField(this, "footerDirection", "horizontal");
226
228
  __publicField(this, "onUpdate", (value) => {
227
229
  });
228
230
  __publicField(this, "onOk", () => {
@@ -262,7 +264,7 @@ class DialogFunction {
262
264
  }
263
265
  }
264
266
  const root = document.createElement("view");
265
- root.id = "dialog-" + new Date().getTime();
267
+ root.id = "dialog-" + options.id;
266
268
  const Wrapper = {
267
269
  setup() {
268
270
  options.onUpdate = (val) => {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { computed, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
@@ -62,8 +62,8 @@ const _sfc_main = create({
62
62
  const domElem = document.documentElement;
63
63
  state.elWidth = myDrag.value.offsetWidth;
64
64
  state.elHeight = myDrag.value.offsetHeight;
65
- state.screenWidth = domElem.clientWidth;
66
- state.screenHeight = domElem.clientHeight;
65
+ state.screenWidth = domElem.clientWidth || 375;
66
+ state.screenHeight = domElem.clientHeight || 667;
67
67
  }
68
68
  function goLeft(target) {
69
69
  if (state.boundary.left) {
@@ -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.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { toRefs, computed, openBlock, createElementBlock, createElementVNode, normalizeStyle, renderSlot, Fragment, createCommentVNode, toDisplayString } from "vue";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @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";
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @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
- import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, renderSlot } from "vue";
8
+ import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, withModifiers, createVNode, withCtx, renderSlot } from "vue";
9
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
10
  const component = {
11
11
  props: {
@@ -69,8 +69,9 @@ const component = {
69
69
  }
70
70
  let value = getPropByPath(props.modelValue, prop || "");
71
71
  tipMessage({ prop, message: "" });
72
- while (rules.length) {
73
- const { required, validator, regex, message } = rules.shift();
72
+ let _rules = [...rules];
73
+ while (_rules.length) {
74
+ const { required, validator, regex, message } = _rules.shift();
74
75
  const errorMsg = { prop, message };
75
76
  if (required) {
76
77
  if (!value) {
@@ -140,7 +141,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
140
141
  const _component_nut_cell_group = resolveComponent("nut-cell-group");
141
142
  return openBlock(), createElementBlock("form", {
142
143
  class: "nut-form",
143
- onSubmit: _cache[0] || (_cache[0] = (...args) => _ctx.onSubmit && _ctx.onSubmit(...args))
144
+ action: "#",
145
+ onSubmit: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.onSubmit && _ctx.onSubmit(...args), ["prevent"]))
144
146
  }, [
145
147
  createVNode(_component_nut_cell_group, null, {
146
148
  default: withCtx(() => [
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { p as pxCheck } from "./pxCheck.js";
7
- import { inject, computed, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from "vue";
7
+ import { inject, provide, computed, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from "vue";
8
8
  import { c as createComponent } from "./component.js";
9
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
10
  const { componentName, create } = createComponent("form-item");
@@ -43,21 +43,24 @@ const _sfc_main = create({
43
43
  },
44
44
  labelAlign: {
45
45
  type: String,
46
- default: "left"
46
+ default: ""
47
47
  },
48
48
  errorMessageAlign: {
49
49
  type: String,
50
- default: "left"
50
+ default: ""
51
51
  },
52
52
  bodyAlign: {
53
53
  type: String,
54
- default: "left"
54
+ default: ""
55
55
  }
56
56
  },
57
57
  components: {},
58
58
  emits: [""],
59
59
  setup(props, { emit }) {
60
60
  const parent = inject("formErrorTip");
61
+ provide("form", {
62
+ props
63
+ });
61
64
  const labelStyle = computed(() => {
62
65
  return {
63
66
  width: pxCheck(props.labelWidth),
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { c as createComponent } from "./component.js";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { inject, getCurrentInstance, onUnmounted, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, createBlock, toDisplayString } from "vue";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { h } from "vue";
@@ -22,8 +22,8 @@ var __publicField = (obj, key, value) => {
22
22
  return value;
23
23
  };
24
24
  /*!
25
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
26
- * (c) 2021 @jdf2e.
25
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
26
+ * (c) 2022 @jdf2e.
27
27
  * Released under the MIT License.
28
28
  */
29
29
  import { toRefs, reactive, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withModifiers, createElementBlock, Fragment, renderList, createVNode, createCommentVNode, toDisplayString, render, h } from "vue";
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
3
- * (c) 2021 @jdf2e.
2
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
3
+ * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { toRefs, computed, openBlock, createElementBlock, normalizeClass, Fragment, renderList, toDisplayString } from "vue";
@@ -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.18-beta.0 Tue Mar 08 2022 10:41:31 GMT+0800 (中国标准时间)
22
- * (c) 2021 @jdf2e.
21
+ * @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
22
+ * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { reactive, computed, onMounted, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, toDisplayString, renderSlot, createCommentVNode } from "vue";