uview-plus 3.3.67 → 3.3.68

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.
package/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 3.3.68(2025-02-12)
2
+ fix: 修复weekText类型
3
+
4
+ feat: 日历增加单选与多选指定禁止选中的日期功能
5
+
6
+ fix: NumberBox删除数字时取值有误 #613
7
+
1
8
  ## 3.3.67(2025-02-11)
2
9
  feat: navbar支持返回全局拦截器配置
3
10
 
@@ -38,6 +38,8 @@ export default {
38
38
  allowSameDay: false,
39
39
  round: 0,
40
40
  monthNum: 3,
41
- weekText: ['一', '二', '三', '四', '五', '六', '日']
41
+ weekText: ['一', '二', '三', '四', '五', '六', '日'],
42
+ forbidDays: [],
43
+ forbidDaysToast: '该日期已禁用',
42
44
  }
43
45
  }
@@ -49,7 +49,7 @@
49
49
  },
50
50
  // 星期文本
51
51
  weekText: {
52
- type: Boolean,
52
+ type: Array,
53
53
  default: () => {
54
54
  return ['一', '二', '三', '四', '五', '六', '日']
55
55
  }
@@ -12,11 +12,11 @@
12
12
  :class="[item1.selected && 'u-calendar-month__days__day__select--selected']">
13
13
  <view class="u-calendar-month__days__day__select" :style="[daySelectStyle(index, index1, item1)]">
14
14
  <text class="u-calendar-month__days__day__select__info"
15
- :class="[item1.disabled && 'u-calendar-month__days__day__select__info--disabled']"
15
+ :class="[(item1.disabled || isForbid(item1) ) ? 'u-calendar-month__days__day__select__info--disabled' : '']"
16
16
  :style="[textStyle(item1)]">{{ item1.day }}</text>
17
17
  <text v-if="getBottomInfo(index, index1, item1)"
18
18
  class="u-calendar-month__days__day__select__buttom-info"
19
- :class="[item1.disabled && 'u-calendar-month__days__day__select__buttom-info--disabled']"
19
+ :class="[(item1.disabled || isForbid(item1) ) ? 'u-calendar-month__days__day__select__buttom-info--disabled' : '']"
20
20
  :style="[textStyle(item1)]">{{ getBottomInfo(index, index1, item1) }}</text>
21
21
  <text v-if="item1.dot" class="u-calendar-month__days__day__select__dot"></text>
22
22
  </view>
@@ -126,6 +126,14 @@
126
126
  allowSameDay: {
127
127
  type: Boolean,
128
128
  default: false
129
+ },
130
+ forbidDays: {
131
+ type: Array,
132
+ default: () => []
133
+ },
134
+ forbidDaysToast: {
135
+ type: String,
136
+ default: ''
129
137
  }
130
138
  },
131
139
  data() {
@@ -167,7 +175,7 @@
167
175
  style.marginLeft = addUnit(week * dayWidth, 'px')
168
176
  }
169
177
  if (this.mode === 'range') {
170
- // 之所以需要这么写,是因为DCloud公司的iOS客户端的开发者能力有限导致的bug
178
+ // 之所以需要这么写,是因为DCloud公司的iOS客户端导致的bug
171
179
  style.paddingLeft = 0
172
180
  style.paddingRight = 0
173
181
  style.paddingBottom = 0
@@ -297,6 +305,13 @@
297
305
  })
298
306
  })
299
307
  },
308
+ isForbid(item) {
309
+ let date = dayjs(item.date).format("YYYY-MM-DD")
310
+ if (this.mode !== 'range' && this.forbidDays.includes(date)) {
311
+ return true
312
+ }
313
+ return false
314
+ },
300
315
  // 判断两个日期是否相等
301
316
  dateSame(date1, date2) {
302
317
  return dayjs(date1).isSame(dayjs(date2))
@@ -362,6 +377,12 @@
362
377
  this.item = item
363
378
  const date = dayjs(item.date).format("YYYY-MM-DD")
364
379
  if (item.disabled) return
380
+ if (this.isForbid(item)) {
381
+ uni.showToast({
382
+ title: this.forbidDaysToast
383
+ })
384
+ return
385
+ }
365
386
  // 对上一次选择的日期数组进行深度克隆
366
387
  let selected = deepClone(this.selected)
367
388
  if (this.mode === 'single') {
@@ -147,6 +147,14 @@ export const props = defineMixin({
147
147
  weekText: {
148
148
  type: Array,
149
149
  default: defProps.calendar.weekText
150
- }
150
+ },
151
+ forbidDays: {
152
+ type: Array,
153
+ default: defProps.calendar.forbidDays
154
+ },
155
+ forbidDaysToast:{
156
+ type: String,
157
+ default: defProps.calendar.forbidDaysToast
158
+ },
151
159
  }
152
160
  })
@@ -42,6 +42,8 @@
42
42
  :rangePrompt="rangePrompt"
43
43
  :showRangePrompt="showRangePrompt"
44
44
  :allowSameDay="allowSameDay"
45
+ :forbidDays="forbidDays"
46
+ :forbidDaysToast="forbidDaysToast"
45
47
  ref="month"
46
48
  @monthSelected="monthSelected"
47
49
  @updateMonthTop="updateMonthTop"
@@ -313,6 +313,8 @@
313
313
  // 为空返回
314
314
  if (value === '') return
315
315
  let formatted = this.filter(value)
316
+ // https://github.com/ijry/uview-plus/issues/613
317
+ this.emitChange(value);
316
318
  // 最大允许的小数长度
317
319
  if (this.decimalLength !== null && formatted.indexOf('.') !== -1) {
318
320
  const pair = formatted.split('.');
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
5
- "version": "3.3.67",
5
+ "version": "3.3.68",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",