@nutui/nutui 4.0.1-beta.2 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/nutui.es.js +10 -17
  3. package/dist/nutui.umd.js +2 -158
  4. package/dist/packages/_es/Address.js +3 -0
  5. package/dist/packages/_es/Audio.js +6 -0
  6. package/dist/packages/_es/AudioOperate.js +1 -0
  7. package/dist/packages/_es/Avatar.js +2 -0
  8. package/dist/packages/_es/AvatarGroup.js +1 -0
  9. package/dist/packages/_es/Badge.js +5 -1
  10. package/dist/packages/_es/Barrage.js +5 -3
  11. package/dist/packages/_es/Calendar.js +7 -2
  12. package/dist/packages/_es/CalendarItem.js +1 -1
  13. package/dist/packages/_es/Cascader.js +2 -0
  14. package/dist/packages/_es/Category.js +2 -0
  15. package/dist/packages/_es/CategoryPane.js +3 -0
  16. package/dist/packages/_es/Cell.js +1 -0
  17. package/dist/packages/_es/Checkbox.js +17 -2
  18. package/dist/packages/_es/CollapseItem.js +1 -0
  19. package/dist/packages/_es/Comment.js +5 -0
  20. package/dist/packages/_es/Countdown.js +8 -0
  21. package/dist/packages/_es/Countup.js +10 -0
  22. package/dist/packages/_es/DatePicker.js +2 -0
  23. package/dist/packages/_es/Dialog.js +3 -0
  24. package/dist/packages/_es/Ellipsis.js +2 -0
  25. package/dist/packages/_es/Empty.js +3 -0
  26. package/dist/packages/_es/Grid.js +1 -1
  27. package/dist/packages/_es/GridItem.js +2 -1
  28. package/dist/packages/_es/ImagePreview.js +1 -0
  29. package/dist/packages/_es/Input.js +20 -12
  30. package/dist/packages/_es/Invoice.js +5 -3
  31. package/dist/packages/_es/Navbar.js +6 -0
  32. package/dist/packages/_es/Noticebar.js +50 -18
  33. package/dist/packages/_es/Notify.js +3 -0
  34. package/dist/packages/_es/Picker.js +2 -0
  35. package/dist/packages/_es/PullRefresh.js +4 -0
  36. package/dist/packages/_es/Radio.js +1 -1
  37. package/dist/packages/_es/RadioGroup.js +1 -1
  38. package/dist/packages/_es/Searchbar.js +1 -0
  39. package/dist/packages/_es/ShortPassword.js +1 -0
  40. package/dist/packages/_es/Signature.js +1 -1
  41. package/dist/packages/_es/Skeleton.js +10 -0
  42. package/dist/packages/_es/Sku.js +14 -0
  43. package/dist/packages/_es/Swiper.js +5 -2
  44. package/dist/packages/_es/TabbarItem.js +5 -0
  45. package/dist/packages/_es/Tabs.js +2 -0
  46. package/dist/packages/_es/Textarea.js +1 -0
  47. package/dist/packages/_es/Toast.js +8 -0
  48. package/dist/packages/_es/Tour.js +1 -0
  49. package/dist/packages/_es/Uploader.js +5 -2
  50. package/dist/packages/_es/Video.js +18 -0
  51. package/dist/packages/_es/{common-05c67d9a.js → common-0c815463.js} +8 -0
  52. package/dist/packages/_es/{index-4f2972bc.js → index-0432a798.js} +147 -32
  53. package/dist/packages/_es/{index.vue_vue_type_script_lang-ee936659.js → index.vue_vue_type_script_lang-0725f0ae.js} +1 -0
  54. package/dist/packages/_es/{index.vue_vue_type_script_lang-8b9f3de5.js → index.vue_vue_type_script_lang-9c679f64.js} +1 -0
  55. package/dist/packages/badge/index.scss +3 -0
  56. package/dist/packages/checkbox/index.scss +41 -0
  57. package/dist/packages/input/index.scss +6 -8
  58. package/dist/packages/noticebar/index.scss +4 -0
  59. package/dist/packages/uploader/index.scss +7 -2
  60. package/dist/resolver/index.d.ts +6 -0
  61. package/dist/resolver/index.js +1 -0
  62. package/dist/resolver/index.mjs +24 -0
  63. package/dist/smartips/web-types.json +20 -2
  64. package/dist/style.css +1 -1
  65. package/dist/styles/themes/default.scss +47 -47
  66. package/dist/styles/themes/jdb.scss +47 -47
  67. package/dist/styles/themes/jddkh.scss +47 -47
  68. package/dist/styles/themes/jdt.scss +47 -47
  69. package/dist/styles/variables-jdb.scss +9 -1
  70. package/dist/styles/variables-jddkh.scss +9 -1
  71. package/dist/styles/variables-jdt.scss +8 -0
  72. package/dist/styles/variables.scss +8 -0
  73. package/dist/types/__VUE/badge/index.vue.d.ts +9 -0
  74. package/dist/types/__VUE/calendaritem/type.d.ts +1 -0
  75. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  76. package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -0
  77. package/dist/types/__VUE/swiper/index.vue.d.ts +8 -1
  78. package/dist/types/index.d.ts +1 -2
  79. package/dist/types/resolver/index.d.ts +6 -0
  80. package/dist/types/utils/date.d.ts +4 -0
  81. package/package.json +6 -7
@@ -4,23 +4,27 @@ import { r as requestAniFrame } from "./raf-729dad54.js";
4
4
  import { u as useExpose } from "./index-79c5dc33.js";
5
5
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
6
6
  const Utils = {
7
+ /**
8
+ * 是否为闫年
9
+ * @return {Boolse} true|false
10
+ */
7
11
  isLeapYear: function(y) {
8
12
  return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;
9
13
  },
14
+ /**
15
+ * 返回星期数
16
+ * @return {String}
17
+ */
10
18
  getWhatDay: function(year, month, day) {
11
19
  const date = new Date(year + "/" + month + "/" + day);
12
20
  const index = date.getDay();
13
- const dayNames = [
14
- "星期日",
15
- "星期一",
16
- "星期二",
17
- "星期三",
18
- "星期四",
19
- "星期五",
20
- "星期六"
21
- ];
21
+ const dayNames = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
22
22
  return dayNames[index];
23
23
  },
24
+ /**
25
+ * 返回星期数
26
+ * @return {Number}
27
+ */
24
28
  getMonthPreDay: function(year, month) {
25
29
  const date = new Date(year + "/" + month + "/01");
26
30
  let day = date.getDay();
@@ -29,30 +33,28 @@ const Utils = {
29
33
  }
30
34
  return day;
31
35
  },
36
+ /**
37
+ * 返回月份天数
38
+ * @return {Number}
39
+ */
32
40
  getMonthDays: function(year, month) {
33
41
  if (/^0/.test(month)) {
34
42
  month = month.split("")[1];
35
43
  }
36
- return [
37
- 0,
38
- 31,
39
- this.isLeapYear(Number(year)) ? 29 : 28,
40
- 31,
41
- 30,
42
- 31,
43
- 30,
44
- 31,
45
- 31,
46
- 30,
47
- 31,
48
- 30,
49
- 31
50
- ][month];
44
+ return [0, 31, this.isLeapYear(Number(year)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
51
45
  },
46
+ /**
47
+ * 补齐数字位数
48
+ * @return {string}
49
+ */
52
50
  getNumTwoBit: function(n) {
53
51
  n = Number(n);
54
52
  return (n > 9 ? "" : "0") + n;
55
53
  },
54
+ /**
55
+ * 日期对象转成字符串
56
+ * @return {string}
57
+ */
56
58
  date2Str: function(date, split) {
57
59
  split = split || "-";
58
60
  const y = date.getFullYear();
@@ -60,6 +62,11 @@ const Utils = {
60
62
  const d = this.getNumTwoBit(date.getDate());
61
63
  return [y, m, d].join(split);
62
64
  },
65
+ /**
66
+ * 返回日期格式字符串
67
+ * @param {Number} 0返回今天的日期、1返回明天的日期,2返回后天得日期,依次类推
68
+ * @return {string} '2014-12-31'
69
+ */
63
70
  getDay: function(i) {
64
71
  i = i || 0;
65
72
  let date = new Date();
@@ -67,6 +74,10 @@ const Utils = {
67
74
  date = new Date(date.getTime() + diff);
68
75
  return this.date2Str(date);
69
76
  },
77
+ /**
78
+ * 时间比较
79
+ * @return {Boolean}
80
+ */
70
81
  compareDate: function(date1, date2) {
71
82
  const startTime = new Date(date1.replace("-", "/").replace("-", "/"));
72
83
  const endTime = new Date(date2.replace("-", "/").replace("-", "/"));
@@ -75,6 +86,10 @@ const Utils = {
75
86
  }
76
87
  return true;
77
88
  },
89
+ /**
90
+ * 时间是否相等
91
+ * @return {Boolean}
92
+ */
78
93
  isEqual: function(date1, date2) {
79
94
  const startTime = new Date(date1).getTime();
80
95
  const endTime = new Date(date2).getTime();
@@ -82,6 +97,51 @@ const Utils = {
82
97
  return true;
83
98
  }
84
99
  return false;
100
+ },
101
+ getMonthWeek: function(year, month, date, firstDayOfWeek = 0) {
102
+ const dateNow = new Date(Number(year), parseInt(month) - 1, Number(date));
103
+ let w = dateNow.getDay();
104
+ let d = dateNow.getDate();
105
+ let remainder = 6 - w;
106
+ if (firstDayOfWeek !== 0) {
107
+ w = w == 0 ? 7 : w;
108
+ remainder = 7 - w;
109
+ }
110
+ return Math.ceil((d + remainder) / 7);
111
+ },
112
+ getYearWeek: function(year, month, date, firstDayOfWeek = 0) {
113
+ const dateNow = new Date(Number(year), parseInt(month) - 1, Number(date));
114
+ const dateFirst = new Date(Number(year), 0, 1);
115
+ const dataNumber = Math.round((dateNow.valueOf() - dateFirst.valueOf()) / 864e5);
116
+ return Math.ceil((dataNumber + (dateFirst.getDay() + 1 - 1)) / 7);
117
+ },
118
+ getWeekDate: function(year, month, date, firstDayOfWeek = 0) {
119
+ const dateNow = new Date(Number(year), parseInt(month) - 1, Number(date));
120
+ const nowTime = dateNow.getTime();
121
+ let day = dateNow.getDay();
122
+ if (firstDayOfWeek === 0) {
123
+ const oneDayTime = 24 * 60 * 60 * 1e3;
124
+ const SundayTime = nowTime - day * oneDayTime;
125
+ const SaturdayTime = nowTime + (6 - day) * oneDayTime;
126
+ const sunday = this.date2Str(new Date(SundayTime));
127
+ const saturday = this.date2Str(new Date(SaturdayTime));
128
+ return [sunday, saturday];
129
+ } else {
130
+ day = day == 0 ? 7 : day;
131
+ const oneDayTime = 24 * 60 * 60 * 1e3;
132
+ const MondayTime = nowTime - (day - 1) * oneDayTime;
133
+ const SundayTime = nowTime + (7 - day) * oneDayTime;
134
+ const monday = this.date2Str(new Date(MondayTime));
135
+ const sunday = this.date2Str(new Date(SundayTime));
136
+ return [monday, sunday];
137
+ }
138
+ },
139
+ formatResultDate: function(date) {
140
+ let days = [...date.split("-")];
141
+ days[2] = Utils.getNumTwoBit(Number(days[2]));
142
+ days[3] = `${days[0]}-${days[1]}-${days[2]}`;
143
+ days[4] = Utils.getWhatDay(+days[0], +days[1], +days[2]);
144
+ return days;
85
145
  }
86
146
  };
87
147
  const { create, translate } = createComponent("calendar-item");
@@ -224,11 +284,11 @@ const _sfc_main = create({
224
284
  const currDate = getCurrDate(day, month);
225
285
  const { type } = props;
226
286
  if (day.type == "curr") {
227
- if (Utils.isEqual(state.currDate, currDate) || type == "range" && (isStart(currDate) || isEnd(currDate)) || type == "multiple" && isMultiple(currDate)) {
287
+ if (Utils.isEqual(state.currDate, currDate) || (type == "range" || type == "week") && (isStart(currDate) || isEnd(currDate)) || type == "multiple" && isMultiple(currDate)) {
228
288
  return `${state.dayPrefix}--active`;
229
289
  } else if (state.propStartDate && Utils.compareDate(currDate, state.propStartDate) || state.propEndDate && Utils.compareDate(state.propEndDate, currDate)) {
230
290
  return `${state.dayPrefix}--disabled`;
231
- } else if (type == "range" && Array.isArray(state.currDate) && Object.values(state.currDate).length == 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
291
+ } else if ((type == "range" || type == "week") && Array.isArray(state.currDate) && Object.values(state.currDate).length == 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
232
292
  return `${state.dayPrefix}--choose`;
233
293
  } else {
234
294
  return null;
@@ -240,8 +300,13 @@ const _sfc_main = create({
240
300
  const confirm = () => {
241
301
  const { type } = props;
242
302
  if (type == "range" && state.chooseData.length == 2 || type != "range") {
243
- let chooseData = state.chooseData.slice(0);
244
- emit("choose", chooseData);
303
+ let selectData = state.chooseData.slice(0);
304
+ if (type == "week") {
305
+ selectData = {
306
+ weekDate: [handleWeekDate(state.chooseData[0]), handleWeekDate(state.chooseData[1])]
307
+ };
308
+ }
309
+ emit("choose", selectData);
245
310
  if (props.poppable) {
246
311
  emit("update");
247
312
  }
@@ -251,6 +316,7 @@ const _sfc_main = create({
251
316
  if (getClass(day, month) != `${state.dayPrefix}--disabled`) {
252
317
  const { type } = props;
253
318
  let days = [...month.curData];
319
+ let [y, m] = month.curData;
254
320
  days[2] = Utils.getNumTwoBit(Number(day.day));
255
321
  days[3] = `${days[0]}-${days[1]}-${days[2]}`;
256
322
  days[4] = Utils.getWhatDay(+days[0], +days[1], +days[2]);
@@ -297,18 +363,46 @@ const _sfc_main = create({
297
363
  state.chooseData = [[...days], ...state.chooseData];
298
364
  }
299
365
  }
366
+ } else if (type == "week") {
367
+ let weekArr = Utils.getWeekDate(y, m, day.day, props.firstDayOfWeek);
368
+ if (state.propStartDate && Utils.compareDate(weekArr[0], state.propStartDate)) {
369
+ weekArr.splice(0, 1, state.propStartDate);
370
+ }
371
+ if (state.propEndDate && Utils.compareDate(state.propEndDate, weekArr[1])) {
372
+ weekArr.splice(1, 1, state.propEndDate);
373
+ }
374
+ state.currDate = weekArr;
375
+ state.chooseData = [Utils.formatResultDate(weekArr[0]), Utils.formatResultDate(weekArr[1])];
300
376
  } else {
301
377
  state.currDate = days[3];
302
378
  state.chooseData = [...days];
303
379
  }
304
380
  if (!isFirst) {
305
- emit("select", state.chooseData);
381
+ let selectData = state.chooseData;
382
+ if (type == "week") {
383
+ selectData = {
384
+ weekDate: [
385
+ handleWeekDate(state.chooseData[0]),
386
+ handleWeekDate(state.chooseData[1])
387
+ ]
388
+ };
389
+ }
390
+ emit("select", selectData);
306
391
  if (props.isAutoBackFill || !props.poppable) {
307
392
  confirm();
308
393
  }
309
394
  }
310
395
  }
311
396
  };
397
+ const handleWeekDate = (weekDate) => {
398
+ let [y, m, d] = weekDate;
399
+ let obj = {
400
+ date: weekDate,
401
+ monthWeekNum: Utils.getMonthWeek(y, m, d, props.firstDayOfWeek),
402
+ yearWeekNum: Utils.getYearWeek(y, m, d, props.firstDayOfWeek)
403
+ };
404
+ return obj;
405
+ };
312
406
  const getCurrData = (type) => {
313
407
  const monthData = type == "prev" ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
314
408
  let year = parseInt(monthData.curData[0]);
@@ -464,6 +558,19 @@ const _sfc_main = create({
464
558
  state.currDate = [...defaultArr];
465
559
  state.defaultData = [...splitDate(defaultArr[0])];
466
560
  }
561
+ } else if (props.type == "week" && Array.isArray(state.currDate)) {
562
+ if (state.currDate.length > 0) {
563
+ let [y, m, d] = splitDate(state.currDate[0]);
564
+ let weekArr = Utils.getWeekDate(y, m, d, props.firstDayOfWeek);
565
+ state.currDate = weekArr;
566
+ if (propStartDate && Utils.compareDate(state.currDate[0], propStartDate)) {
567
+ state.currDate.splice(0, 1, propStartDate);
568
+ }
569
+ if (propEndDate && Utils.compareDate(propEndDate, state.currDate[1])) {
570
+ state.currDate.splice(1, 1, propEndDate);
571
+ }
572
+ state.defaultData = [...splitDate(state.currDate[0]), ...splitDate(state.currDate[1])];
573
+ }
467
574
  } else {
468
575
  if (state.currDate) {
469
576
  if (propStartDate && Utils.compareDate(state.currDate, propStartDate)) {
@@ -481,7 +588,7 @@ const _sfc_main = create({
481
588
  if (item.title == translate("monthTitle", state.defaultData[0], state.defaultData[1])) {
482
589
  current = index;
483
590
  }
484
- if (props.type == "range") {
591
+ if (props.type == "range" || props.type == "week") {
485
592
  if (item.title == translate("monthTitle", state.defaultData[3], state.defaultData[4])) {
486
593
  lastCurrent = index;
487
594
  }
@@ -495,6 +602,8 @@ const _sfc_main = create({
495
602
  if (props.type == "range") {
496
603
  chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
497
604
  chooseDay({ day: state.defaultData[5], type: "curr" }, state.monthsData[lastCurrent], true);
605
+ } else if (props.type == "week") {
606
+ chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
498
607
  } else if (props.type == "multiple") {
499
608
  [...state.currDate].forEach((item) => {
500
609
  let dateArr = splitDate(item);
@@ -554,8 +663,14 @@ const _sfc_main = create({
554
663
  }
555
664
  });
556
665
  };
666
+ const initPosition = () => {
667
+ if (months == null ? void 0 : months.value) {
668
+ months.value.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
669
+ }
670
+ };
557
671
  useExpose({
558
- scrollToDate
672
+ scrollToDate,
673
+ initPosition
559
674
  });
560
675
  const setDefaultRange = (monthsNum, current) => {
561
676
  if (monthsNum >= 3) {
@@ -573,7 +688,7 @@ const _sfc_main = create({
573
688
  state.translateY = defaultScrollTop;
574
689
  };
575
690
  const isActive = (day, month) => {
576
- return props.type == "range" && day.type == "curr" && getClass(day, month) == "nut-calendar__day--active";
691
+ return (props.type == "range" || props.type == "week") && day.type == "curr" && getClass(day, month) == "nut-calendar__day--active";
577
692
  };
578
693
  const isStartTip = (day, month) => {
579
694
  return isActive(day, month) && isStart(getCurrDate(day, month));
@@ -10,6 +10,7 @@ const _sfc_main = create({
10
10
  direction: {
11
11
  type: String,
12
12
  default: "vertical"
13
+ //horizontal
13
14
  },
14
15
  textPosition: {
15
16
  type: String,
@@ -16,6 +16,7 @@ const _sfc_main = create({
16
16
  shape: {
17
17
  type: String,
18
18
  default: "round"
19
+ // button
19
20
  },
20
21
  label: {
21
22
  type: [String, Number, Boolean],
@@ -41,5 +41,8 @@
41
41
  border-radius: $badge-dot-border-radius;
42
42
  padding: $badge-dot-padding;
43
43
  }
44
+ &--bubble {
45
+ border-bottom-left-radius: 0;
46
+ }
44
47
  }
45
48
  }
@@ -6,6 +6,14 @@
6
6
  color: $checkbox-label-disable-color;
7
7
  }
8
8
  }
9
+ &__button {
10
+ background: $dark-background;
11
+ color: $dark-color;
12
+ &--disabled {
13
+ color: $checkbox-label-disable-color;
14
+ border: 1px solid $checkbox-label-disable-color;
15
+ }
16
+ }
9
17
  }
10
18
  }
11
19
  .nut-checkbox {
@@ -18,6 +26,39 @@
18
26
  margin-left: 0;
19
27
  }
20
28
  }
29
+ &__button {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ padding: $checkbox-button-padding;
33
+ font-size: $checkbox-button-font-size;
34
+ background: $checkbox-button-background;
35
+ border-radius: $checkbox-button-border-radius;
36
+ color: $checkbox-label-color;
37
+ box-sizing: border-box;
38
+ border: 1px solid $checkbox-button-border-color;
39
+ &--active {
40
+ background: transparent;
41
+ color: $checkbox-button-font-color-active;
42
+ border: 1px solid $checkbox-button-border-color-active;
43
+ position: relative;
44
+ &::after {
45
+ position: absolute;
46
+ top: 0;
47
+ right: 0;
48
+ bottom: 0;
49
+ left: 0;
50
+ width: 100%;
51
+ height: 100%;
52
+ background-color: $checkbox-button-background-active;
53
+ opacity: 0.05;
54
+ content: '';
55
+ }
56
+ }
57
+ &--disabled {
58
+ color: $checkbox-label-disable-color;
59
+ border: none;
60
+ }
61
+ }
21
62
  &__label {
22
63
  flex: 1;
23
64
  margin-left: $checkbox-label-margin-left;
@@ -77,6 +77,7 @@ textarea {
77
77
  position: relative;
78
78
  width: 100%;
79
79
  display: flex;
80
+ flex: 1;
80
81
  }
81
82
  &-disabled-mask {
82
83
  position: absolute;
@@ -95,17 +96,16 @@ textarea {
95
96
  // margin-top: -50%;
96
97
  // line-height: var(--van-field-word-limit-line-height);
97
98
  }
98
- &-left-icon,
99
- &-right-icon {
99
+ &-left-box,
100
+ &-right-box {
100
101
  display: flex;
101
102
  align-items: center;
102
103
  font-size: 0;
103
104
  }
104
- &-clear,
105
- &-right-icon {
105
+ &-right-box {
106
106
  margin-left: 4px;
107
107
  }
108
- &-left-icon {
108
+ &-left-box {
109
109
  margin-right: 4px;
110
110
  }
111
111
  &-clear-box {
@@ -119,9 +119,7 @@ textarea {
119
119
  height: 16px;
120
120
  color: #c8c9cc;
121
121
  cursor: pointer;
122
- }
123
- .nut-button {
124
- margin-left: 10px;
122
+ margin: 0 4px;
125
123
  }
126
124
  &--required {
127
125
  &::before {
@@ -121,6 +121,10 @@
121
121
  }
122
122
  }
123
123
 
124
+ .nut-noticebar-custom-item {
125
+ position: absolute;
126
+ top: 999999px;
127
+ }
124
128
  .go {
125
129
  margin: $noticebar-righticon-margin;
126
130
  align-self: center;
@@ -117,6 +117,10 @@
117
117
  position: relative;
118
118
  width: $uploader-picture-width;
119
119
  height: $uploader-picture-height;
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: center;
123
+ border-radius: 6px;
120
124
  .close {
121
125
  position: absolute;
122
126
  right: 0;
@@ -141,8 +145,9 @@
141
145
  @include oneline-ellipsis();
142
146
  }
143
147
  &__c {
144
- height: 100%;
145
- width: 100%;
148
+ max-width: 100%;
149
+ max-height: 100%;
150
+ border-radius: 6px;
146
151
  }
147
152
  &__file {
148
153
  height: 100%;
@@ -0,0 +1,6 @@
1
+ import type { ComponentResolver } from 'unplugin-vue-components/types';
2
+ export interface NutUIResolverOptions {
3
+ taro?: boolean;
4
+ autoImport?: boolean;
5
+ }
6
+ export default function NutUIResolver(options?: NutUIResolverOptions): ComponentResolver;
@@ -0,0 +1 @@
1
+ "use strict";const i=["showToast","showNotify","showDialog","showImagePreview"];function u(t,s){const{taro:e=!1,autoImport:r=!1}=s,o=e?"@nutui/nutui-taro":"@nutui/nutui",n=r?t.slice(4):t,c=`${o}/dist/packages/${n.toLowerCase()}/style`;return{name:t,from:o,sideEffects:c}}function a(t={}){return{type:"component",resolve:s=>{const{autoImport:e=!1}=t;if(e&&i.includes(s))return u(s,t);if(s.startsWith("Nut"))return u(s.slice(3),t)}}}module.exports=a;
@@ -0,0 +1,24 @@
1
+ const i = ["showToast", "showNotify", "showDialog", "showImagePreview"];
2
+ function u(t, e) {
3
+ const { taro: o = !1, autoImport: n = !1 } = e, s = o ? "@nutui/nutui-taro" : "@nutui/nutui", r = n ? t.slice(4) : t, c = `${s}/dist/packages/${r.toLowerCase()}/style`;
4
+ return {
5
+ name: t,
6
+ from: s,
7
+ sideEffects: c
8
+ };
9
+ }
10
+ function a(t = {}) {
11
+ return {
12
+ type: "component",
13
+ resolve: (e) => {
14
+ const { autoImport: o = !1 } = t;
15
+ if (o && i.includes(e))
16
+ return u(e, t);
17
+ if (e.startsWith("Nut"))
18
+ return u(e.slice(3), t);
19
+ }
20
+ };
21
+ }
22
+ export {
23
+ a as default
24
+ };
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "NutUI",
5
- "version": "4.0.1-beta.2",
5
+ "version": "4.0.1",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "tags": [
@@ -562,6 +562,15 @@
562
562
  "kind": "expression"
563
563
  }
564
564
  },
565
+ {
566
+ "name": "bubble()",
567
+ "default": "`false`",
568
+ "description": "是否为气泡形状",
569
+ "value": {
570
+ "type": "boolean",
571
+ "kind": "expression"
572
+ }
573
+ },
565
574
  {
566
575
  "name": "hidden",
567
576
  "default": "`false`",
@@ -757,7 +766,7 @@
757
766
  {
758
767
  "name": "type",
759
768
  "default": "'`one`'",
760
- "description": "类型,日期单择`one`,区间选择`range`,日期多选`multiple`",
769
+ "description": "类型,日期单择`one`,区间选择`range`,日期多选`multiple`,周选择`week`(`v4.0.1`)",
761
770
  "value": {
762
771
  "type": "string",
763
772
  "kind": "expression"
@@ -1202,6 +1211,15 @@
1202
1211
  "type": "boolean",
1203
1212
  "kind": "expression"
1204
1213
  }
1214
+ },
1215
+ {
1216
+ "name": "shape",
1217
+ "default": "`round`",
1218
+ "description": "形状,可选值:`button`、`round`",
1219
+ "value": {
1220
+ "type": "string",
1221
+ "kind": "expression"
1222
+ }
1205
1223
  }
1206
1224
  ]
1207
1225
  },