@nutui/nutui 4.1.2 → 4.1.3

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 (60) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +1 -1
  3. package/dist/nutui.es.js +1 -1
  4. package/dist/nutui.js +1918 -1916
  5. package/dist/nutui.umd.js +1 -1
  6. package/dist/packages/_es/ActionSheet.js +1 -1
  7. package/dist/packages/_es/Address.js +1 -1
  8. package/dist/packages/_es/Calendar.js +3 -3
  9. package/dist/packages/_es/CalendarItem.js +1 -1
  10. package/dist/packages/_es/Cascader.js +1 -1
  11. package/dist/packages/_es/Dialog.js +1 -1
  12. package/dist/packages/_es/FixedNav.js +67 -73
  13. package/dist/packages/_es/FormItem.js +1 -3
  14. package/dist/packages/_es/ImagePreview.js +1 -1
  15. package/dist/packages/_es/Input.js +8 -5
  16. package/dist/packages/_es/MenuItem.js +1 -1
  17. package/dist/packages/_es/Notify.js +2 -2
  18. package/dist/packages/_es/NumberKeyboard.js +2 -2
  19. package/dist/packages/_es/Popover.js +2 -2
  20. package/dist/packages/_es/Popup.js +3 -3
  21. package/dist/packages/_es/ShortPassword.js +1 -1
  22. package/dist/packages/_es/Skeleton.js +86 -91
  23. package/dist/packages/_es/Sku.js +1 -1
  24. package/dist/packages/_es/TimeSelect.js +2 -2
  25. package/dist/packages/_es/Tour.js +1 -1
  26. package/dist/packages/_es/{index-3a5098e4.js → index-66fff386.js} +19 -13
  27. package/dist/packages/_es/{index-5ffbc437.js → index-7fe29a2f.js} +96 -101
  28. package/dist/packages/calendar/index.scss +5 -8
  29. package/dist/smartips/web-types.json +2 -2
  30. package/dist/style.css +1 -1
  31. package/dist/styles/themes/default.scss +45 -45
  32. package/dist/styles/themes/jdb.scss +45 -45
  33. package/dist/styles/themes/jddkh.scss +45 -45
  34. package/dist/styles/themes/jdt.scss +45 -45
  35. package/dist/types/__VUE/actionsheet/index.vue.d.ts +13 -13
  36. package/dist/types/__VUE/address/index.vue.d.ts +12 -12
  37. package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
  38. package/dist/types/__VUE/calendaritem/index.vue.d.ts +2 -2
  39. package/dist/types/__VUE/cascader/index.vue.d.ts +12 -12
  40. package/dist/types/__VUE/dialog/index.vue.d.ts +13 -13
  41. package/dist/types/__VUE/fixednav/index.vue.d.ts +6 -4
  42. package/dist/types/__VUE/formitem/index.vue.d.ts +4 -3
  43. package/dist/types/__VUE/image/index.vue.d.ts +1 -1
  44. package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
  45. package/dist/types/__VUE/overlay/index.vue.d.ts +3 -3
  46. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  47. package/dist/types/__VUE/popup/index.vue.d.ts +30 -21
  48. package/dist/types/__VUE/popup/props.d.ts +4 -5
  49. package/dist/types/__VUE/skeleton/index.vue.d.ts +8 -6
  50. package/dist/types/__VUE/sku/index.vue.d.ts +15 -15
  51. package/dist/types/__VUE/swipe/index.vue.d.ts +1 -1
  52. package/dist/types/__VUE/tabbar/index.vue.d.ts +1 -1
  53. package/dist/types/__VUE/tag/index.vue.d.ts +1 -1
  54. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  55. package/dist/types/index.d.ts +1 -1
  56. package/package.json +1 -1
  57. package/dist/types/__VUE/fixednav/common.d.ts +0 -53
  58. package/dist/types/__VUE/formitem/common.d.ts +0 -0
  59. package/dist/types/__VUE/popup/common.d.ts +0 -107
  60. package/dist/types/__VUE/skeleton/common.d.ts +0 -57
@@ -230,7 +230,10 @@ const _sfc_main = create({
230
230
  },
231
231
  emits: ["choose", "update", "close", "select"],
232
232
  setup(props, { emit, slots }) {
233
- const weekdays = translate("weekdays");
233
+ const weekdays = translate("weekdays").map((day, index) => ({
234
+ day,
235
+ weekend: index === 0 || index === 6
236
+ }));
234
237
  const weeks = ref([...weekdays.slice(props.firstDayOfWeek, 7), ...weekdays.slice(0, props.firstDayOfWeek)]);
235
238
  const months = ref(null);
236
239
  const monthsPanel = ref(null);
@@ -301,22 +304,25 @@ const _sfc_main = create({
301
304
  const getCurrDate = (day, month) => {
302
305
  return month.curData[0] + "-" + month.curData[1] + "-" + Utils.getNumTwoBit(+day.day);
303
306
  };
304
- const getClass = (day, month) => {
307
+ const getClass = (day, month, index) => {
308
+ const res = [];
309
+ if (typeof index === "number" && ((index + 1 + props.firstDayOfWeek) % 7 === 0 || (index + props.firstDayOfWeek) % 7 === 0)) {
310
+ res.push("weekend");
311
+ }
305
312
  const currDate = getCurrDate(day, month);
306
313
  const { type } = props;
307
314
  if (day.type == "curr") {
308
315
  if (Utils.isEqual(state.currDate, currDate) || (type == "range" || type == "week") && (isStart(currDate) || isEnd(currDate)) || type == "multiple" && isMultiple(currDate)) {
309
- return `${state.dayPrefix}--active`;
316
+ res.push(`${state.dayPrefix}--active`);
310
317
  } else if (state.propStartDate && Utils.compareDate(currDate, state.propStartDate) || state.propEndDate && Utils.compareDate(state.propEndDate, currDate)) {
311
- return `${state.dayPrefix}--disabled`;
318
+ res.push(`${state.dayPrefix}--disabled`);
312
319
  } 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])) {
313
- return `${state.dayPrefix}--choose`;
314
- } else {
315
- return null;
320
+ res.push(`${state.dayPrefix}--choose`);
316
321
  }
317
322
  } else {
318
- return `${state.dayPrefix}--disabled`;
323
+ res.push(`${state.dayPrefix}--disabled`);
319
324
  }
325
+ return res;
320
326
  };
321
327
  const confirm = () => {
322
328
  const { type } = props;
@@ -335,7 +341,7 @@ const _sfc_main = create({
335
341
  };
336
342
  const chooseDay = (day, month, isFirst = false) => {
337
343
  var _a, _b;
338
- if (getClass(day, month) != `${state.dayPrefix}--disabled`) {
344
+ if (!getClass(day, month).includes(`${state.dayPrefix}--disabled`)) {
339
345
  const { type } = props;
340
346
  let [y, m] = month.curData;
341
347
  let days = [...month.curData];
@@ -710,7 +716,7 @@ const _sfc_main = create({
710
716
  state.translateY = defaultScrollTop;
711
717
  };
712
718
  const isActive = (day, month) => {
713
- return (props.type == "range" || props.type == "week") && day.type == "curr" && getClass(day, month) == "nut-calendar__day--active";
719
+ return (props.type == "range" || props.type == "week") && day.type == "curr" && getClass(day, month).includes("nut-calendar__day--active");
714
720
  };
715
721
  const isStartTip = (day, month) => {
716
722
  return isActive(day, month) && isStart(getCurrDate(day, month));
@@ -865,9 +871,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
865
871
  createElementVNode("view", _hoisted_5, [
866
872
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.weeks, (item, index) => {
867
873
  return openBlock(), createElementBlock("view", {
868
- class: "nut-calendar__weekday",
874
+ class: normalizeClass(["nut-calendar__weekday", { weekend: item.weekend }]),
869
875
  key: index
870
- }, toDisplayString(item), 1);
876
+ }, toDisplayString(item.day), 3);
871
877
  }), 128))
872
878
  ], 512)
873
879
  ]),
@@ -895,7 +901,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
895
901
  (openBlock(true), createElementBlock(Fragment, null, renderList(month.monthData, (day, i) => {
896
902
  return openBlock(), createElementBlock("view", {
897
903
  key: i,
898
- class: normalizeClass(["nut-calendar__day", _ctx.getClass(day, month)]),
904
+ class: normalizeClass(["nut-calendar__day", _ctx.getClass(day, month, i)]),
899
905
  onClick: ($event) => _ctx.chooseDay(day, month)
900
906
  }, [
901
907
  createElementVNode("view", _hoisted_10, [
@@ -17,10 +17,10 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { c as createComponent } from "./component-0fbad28e.js";
21
20
  import { reactive, computed, watch, watchEffect, toRefs, resolveComponent, openBlock, createBlock, Teleport, mergeProps, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, vShow } from "vue";
22
- import Overlay from "./Overlay.js";
23
21
  import { Close } from "@nutui/icons-vue";
22
+ import Overlay from "./Overlay.js";
23
+ import { c as createComponent } from "./component-0fbad28e.js";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
25
25
  const popupProps = {
26
26
  visible: {
@@ -53,7 +53,7 @@ const popupProps = {
53
53
  },
54
54
  style: {
55
55
  type: Object,
56
- default: {}
56
+ default: () => ({})
57
57
  },
58
58
  popClass: {
59
59
  type: String,
@@ -101,110 +101,105 @@ const popupProps = {
101
101
  },
102
102
  overlayStyle: {
103
103
  type: Object,
104
- default: {}
104
+ default: () => ({})
105
105
  }
106
106
  };
107
+ const { componentName, create } = createComponent("popup");
107
108
  const initIndex = 2e3;
108
109
  let _zIndex = initIndex;
109
- const component = (componentName2, components) => {
110
- return {
111
- components,
112
- props: __spreadValues({}, popupProps),
113
- emits: ["click-pop", "click-close-icon", "open", "close", "opened", "closed", "click-overlay", "update:visible"],
114
- setup(props, { emit }) {
115
- const state = reactive({
116
- zIndex: props.zIndex,
117
- showSlot: true,
118
- closed: props.closeable
119
- });
120
- const classes = computed(() => {
121
- const prefixCls = componentName2;
122
- return {
123
- [prefixCls]: true,
124
- ["round"]: props.round,
125
- [`nut-popup--${props.position}`]: true,
126
- [`nut-popup--${props.position}--safebottom`]: props.position === "bottom" && props.safeAreaInsetBottom,
127
- [props.popClass]: true
128
- };
129
- });
130
- const popStyle = computed(() => {
131
- return __spreadValues({
132
- zIndex: state.zIndex,
133
- transitionDuration: `${props.duration}s`
134
- }, props.style);
135
- });
136
- const transitionName = computed(() => {
137
- return props.transition ? props.transition : `nut-popup-slide-${props.position}`;
138
- });
139
- const open = () => {
140
- if (props.zIndex !== initIndex) {
141
- _zIndex = Number(props.zIndex);
142
- }
143
- emit("update:visible", true);
144
- state.zIndex = ++_zIndex;
145
- if (props.destroyOnClose) {
146
- state.showSlot = true;
147
- }
148
- emit("open");
149
- };
150
- const close = () => {
151
- emit("update:visible", false);
152
- emit("close");
153
- if (props.destroyOnClose) {
154
- setTimeout(() => {
155
- state.showSlot = false;
156
- }, +props.duration * 1e3);
157
- }
158
- };
159
- const onClick = (e) => {
160
- emit("click-pop", e);
161
- };
162
- const onClickCloseIcon = (e) => {
163
- e.stopPropagation();
164
- emit("click-close-icon", e);
165
- emit("update:visible", false);
166
- };
167
- const onClickOverlay = (e) => {
168
- emit("click-overlay", e);
169
- if (props.closeOnClickOverlay) {
170
- emit("update:visible", false);
171
- }
172
- };
173
- const onOpened = (el) => {
174
- emit("opened", el);
175
- };
176
- const onClosed = (el) => {
177
- emit("closed", el);
178
- };
179
- watch(
180
- () => props.visible,
181
- () => {
182
- props.visible ? open() : close();
183
- }
184
- );
185
- watchEffect(() => {
186
- state.closed = props.closeable;
187
- });
188
- return __spreadProps(__spreadValues({}, toRefs(state)), {
189
- popStyle,
190
- transitionName,
191
- classes,
192
- onClick,
193
- onClickCloseIcon,
194
- onClickOverlay,
195
- onOpened,
196
- onClosed
197
- });
198
- }
199
- };
200
- };
201
- const { componentName, create } = createComponent("popup");
202
- const _sfc_main = create(
203
- component(componentName, {
110
+ const _sfc_main = create({
111
+ components: {
204
112
  [Overlay.name]: Overlay,
205
113
  Close
206
- })
207
- );
114
+ },
115
+ props: popupProps,
116
+ emits: ["click-pop", "click-close-icon", "open", "close", "opened", "closed", "click-overlay", "update:visible"],
117
+ setup(props, { emit }) {
118
+ const state = reactive({
119
+ zIndex: props.zIndex,
120
+ showSlot: true,
121
+ closed: props.closeable
122
+ });
123
+ const classes = computed(() => {
124
+ const prefixCls = componentName;
125
+ return {
126
+ [prefixCls]: true,
127
+ ["round"]: props.round,
128
+ [`nut-popup--${props.position}`]: true,
129
+ [`nut-popup--${props.position}--safebottom`]: props.position === "bottom" && props.safeAreaInsetBottom,
130
+ [props.popClass]: true
131
+ };
132
+ });
133
+ const popStyle = computed(() => {
134
+ return __spreadValues({
135
+ zIndex: state.zIndex,
136
+ transitionDuration: `${props.duration}s`
137
+ }, props.style);
138
+ });
139
+ const transitionName = computed(() => {
140
+ return props.transition ? props.transition : `nut-popup-slide-${props.position}`;
141
+ });
142
+ const open = () => {
143
+ if (props.zIndex !== initIndex) {
144
+ _zIndex = Number(props.zIndex);
145
+ }
146
+ emit("update:visible", true);
147
+ state.zIndex = ++_zIndex;
148
+ if (props.destroyOnClose) {
149
+ state.showSlot = true;
150
+ }
151
+ emit("open");
152
+ };
153
+ const close = () => {
154
+ emit("update:visible", false);
155
+ emit("close");
156
+ if (props.destroyOnClose) {
157
+ setTimeout(() => {
158
+ state.showSlot = false;
159
+ }, +props.duration * 1e3);
160
+ }
161
+ };
162
+ const onClick = (e) => {
163
+ emit("click-pop", e);
164
+ };
165
+ const onClickCloseIcon = (e) => {
166
+ e.stopPropagation();
167
+ emit("click-close-icon", e);
168
+ emit("update:visible", false);
169
+ };
170
+ const onClickOverlay = (e) => {
171
+ emit("click-overlay", e);
172
+ if (props.closeOnClickOverlay) {
173
+ emit("update:visible", false);
174
+ }
175
+ };
176
+ const onOpened = (el) => {
177
+ emit("opened", el);
178
+ };
179
+ const onClosed = (el) => {
180
+ emit("closed", el);
181
+ };
182
+ watch(
183
+ () => props.visible,
184
+ () => {
185
+ props.visible ? open() : close();
186
+ }
187
+ );
188
+ watchEffect(() => {
189
+ state.closed = props.closeable;
190
+ });
191
+ return __spreadProps(__spreadValues({}, toRefs(state)), {
192
+ popStyle,
193
+ transitionName,
194
+ classes,
195
+ onClick,
196
+ onClickCloseIcon,
197
+ onClickOverlay,
198
+ onOpened,
199
+ onClosed
200
+ });
201
+ }
202
+ });
208
203
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
209
204
  const _component_nut_overlay = resolveComponent("nut-overlay");
210
205
  const _component_Close = resolveComponent("Close");
@@ -85,8 +85,7 @@
85
85
  box-shadow: 0px 4px 10px 0px rgba($color: #000000, $alpha: 0.06);
86
86
 
87
87
  .nut-calendar__weekday {
88
- &:first-of-type,
89
- &:last-of-type {
88
+ &.weekend {
90
89
  color: $calendar-day67-font-color;
91
90
  }
92
91
  }
@@ -140,12 +139,6 @@
140
139
 
141
140
  .nut-calendar__days {
142
141
  overflow: hidden;
143
- .nut-calendar__days-item {
144
- .nut-calendar__day:nth-child(7n + 0),
145
- .nut-calendar__day:nth-child(7n + 1) {
146
- color: $calendar-day67-font-color;
147
- }
148
- }
149
142
  .nut-calendar__day {
150
143
  float: left;
151
144
  width: 14.28%;
@@ -157,6 +150,10 @@
157
150
  flex-direction: column;
158
151
  position: relative;
159
152
 
153
+ &.weekend {
154
+ color: $calendar-day67-font-color;
155
+ }
156
+
160
157
  .nut-calendar__day-tips {
161
158
  position: absolute;
162
159
  width: 100%;
@@ -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.1.2",
5
+ "version": "4.1.3",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "tags": [
@@ -3515,7 +3515,7 @@
3515
3515
  {
3516
3516
  "name": "z-index",
3517
3517
  "default": "-",
3518
- "description": "导航栏 `z-index `",
3518
+ "description": "导航栏 `z-index`",
3519
3519
  "value": {
3520
3520
  "type": "number | string",
3521
3521
  "kind": "expression"