sard-uniapp 1.19.5 → 1.20.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.
- package/CHANGELOG.md +22 -0
- package/README.md +1 -1
- package/components/calendar/README.md +20 -20
- package/components/calendar/calendar.vue +1 -1
- package/components/calendar-input/README.md +10 -10
- package/components/calendar-input/calendar-input.vue +2 -2
- package/components/calendar-month/calendar-month.vue +17 -21
- package/components/calendar-popout/calendar-popout.vue +1 -1
- package/components/card/README.md +16 -8
- package/components/card/card.vue +7 -1
- package/components/card/common.d.ts +2 -0
- package/components/card/index.scss +30 -2
- package/components/card/variables.scss +16 -1
- package/components/checkbox/common.d.ts +1 -0
- package/components/checkbox/common.js +1 -0
- package/components/checkbox-input/checkbox-input.vue +9 -0
- package/components/checkbox-popout/README.md +27 -6
- package/components/checkbox-popout/checkbox-popout.vue +113 -47
- package/components/checkbox-popout/common.d.ts +3 -0
- package/components/checkbox-popout/index.scss +16 -0
- package/components/config/index.d.ts +6 -0
- package/components/config/index.js +6 -0
- package/components/datetime-picker/README.md +1 -71
- package/components/datetime-picker/common.d.ts +1 -0
- package/components/datetime-picker/common.js +21 -8
- package/components/datetime-picker/datetime-picker.vue +3 -3
- package/components/datetime-picker-input/README.md +10 -10
- package/components/datetime-picker-input/datetime-picker-input.vue +2 -2
- package/components/datetime-picker-popout/datetime-picker-popout.vue +1 -1
- package/components/datetime-range-picker/datetime-range-picker.vue +12 -10
- package/components/datetime-range-picker-input/README.md +10 -10
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +2 -2
- package/components/datetime-range-picker-popout/README.md +0 -6
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +11 -8
- package/components/floating-bubble/floating-bubble.vue +3 -3
- package/components/form/README.md +19 -19
- package/components/form/form.vue +1 -1
- package/components/icon/icon.d.ts +1 -1
- package/components/indexes/README.md +4 -0
- package/components/indexes-nav/indexes-nav.vue +2 -2
- package/components/keyboard/common.d.ts +1 -2
- package/components/keyboard/common.js +2 -11
- package/components/keyboard/keyboard.d.ts +2 -2
- package/components/list-item/index.scss +4 -0
- package/components/locale/lang/en-US.d.ts +4 -0
- package/components/locale/lang/en-US.js +4 -0
- package/components/locale/lang/zh-CN.d.ts +4 -0
- package/components/locale/lang/zh-CN.js +4 -0
- package/components/marquee/README.md +8 -2
- package/components/marquee/marquee.vue +9 -1
- package/components/notice-bar/README.md +8 -2
- package/components/notice-bar/notice-bar.vue +14 -8
- package/components/notify/notify.d.ts +1 -1
- package/components/notify-agent/notify-agent.d.ts +1 -1
- package/components/pagination/pagination.vue +2 -2
- package/components/popover/utils.js +4 -4
- package/components/pull-down-refresh/common.d.ts +1 -1
- package/components/radio/common.d.ts +1 -0
- package/components/radio/common.js +1 -0
- package/components/radio-input/radio-input.vue +6 -0
- package/components/radio-popout/README.md +20 -6
- package/components/radio-popout/common.d.ts +2 -0
- package/components/radio-popout/index.scss +4 -0
- package/components/radio-popout/radio-popout.vue +91 -45
- package/components/read-more/README.md +82 -0
- package/components/read-more/common.d.ts +24 -0
- package/components/read-more/common.js +2 -0
- package/components/read-more/index.d.ts +1 -0
- package/components/read-more/index.js +1 -0
- package/components/read-more/index.scss +41 -0
- package/components/read-more/read-more.d.ts +20 -0
- package/components/read-more/read-more.vue +168 -0
- package/components/read-more/variables.scss +12 -0
- package/components/resize-sensor/README.md +55 -0
- package/components/resize-sensor/common.d.ts +19 -0
- package/components/resize-sensor/common.js +2 -0
- package/components/resize-sensor/index.d.ts +1 -0
- package/components/resize-sensor/index.js +1 -0
- package/components/resize-sensor/index.scss +33 -0
- package/components/resize-sensor/resize-sensor.d.ts +16 -0
- package/components/resize-sensor/resize-sensor.vue +152 -0
- package/components/scroll-list/README.md +79 -0
- package/components/scroll-list/common.d.ts +23 -0
- package/components/scroll-list/common.js +1 -0
- package/components/scroll-list/index.d.ts +1 -0
- package/components/scroll-list/index.js +1 -0
- package/components/scroll-list/index.scss +35 -0
- package/components/scroll-list/scroll-list.d.ts +20 -0
- package/components/scroll-list/scroll-list.vue +158 -0
- package/components/scroll-list/variables.scss +11 -0
- package/components/sidebar/README.md +8 -8
- package/components/sidebar/sidebar.vue +1 -1
- package/components/slider/slider.vue +4 -4
- package/components/stepper/stepper.vue +2 -2
- package/components/sticky/README.md +92 -0
- package/components/sticky/common.d.ts +15 -0
- package/components/sticky/common.js +1 -0
- package/components/sticky/index.d.ts +1 -0
- package/components/sticky/index.js +1 -0
- package/components/sticky/index.scss +18 -0
- package/components/sticky/sticky.d.ts +10 -0
- package/components/sticky/sticky.vue +190 -0
- package/components/sticky-box/common.d.ts +19 -0
- package/components/sticky-box/common.js +1 -0
- package/components/sticky-box/index.d.ts +1 -0
- package/components/sticky-box/index.js +1 -0
- package/components/sticky-box/index.scss +19 -0
- package/components/sticky-box/sticky-box.d.ts +10 -0
- package/components/sticky-box/sticky-box.vue +82 -0
- package/components/style/mixins/border.scss +101 -38
- package/components/style/variables-dark.scss +4 -0
- package/components/style/variables.scss +8 -0
- package/components/table/table.vue +2 -1
- package/components/table-fixation/table-fixation.vue +2 -1
- package/components/toast/toast.d.ts +1 -1
- package/components/toast-agent/toast-agent.d.ts +1 -1
- package/components/tree/tree.d.ts +1 -1
- package/components/tree-node/tree-node.vue +2 -2
- package/components/upload/README.md +23 -15
- package/components/upload/common.d.ts +6 -4
- package/components/upload/upload.d.ts +2 -0
- package/components/upload/upload.vue +51 -13
- package/components/upload/utils.d.ts +1 -0
- package/components/upload/utils.js +2 -0
- package/components/upload-preview/index.scss +1 -0
- package/components/upload-preview/upload-preview.d.ts +6 -4
- package/components/upload-preview/upload-preview.vue +17 -24
- package/global.d.ts +5 -0
- package/index.d.ts +5 -0
- package/index.js +5 -0
- package/index.scss +2 -0
- package/package.json +4 -2
- package/use/index.d.ts +4 -0
- package/use/index.js +4 -0
- package/use/useIndeterminate.d.ts +10 -0
- package/use/useIndeterminate.js +27 -0
- package/use/useIntersectionObserver.d.ts +16 -0
- package/use/useIntersectionObserver.js +52 -0
- package/use/useSimulatedClick.js +2 -2
- package/use/useSimulatedPress.js +2 -2
- package/use/useSingleTask.d.ts +6 -0
- package/use/useSingleTask.js +40 -0
- package/use/useWindowResize.d.ts +4 -0
- package/use/useWindowResize.js +15 -0
- package/utils/array.d.ts +28 -0
- package/utils/array.js +90 -0
- package/utils/common.d.ts +3 -0
- package/utils/common.js +1 -0
- package/utils/date.d.ts +84 -11
- package/utils/date.js +120 -63
- package/utils/dom.js +2 -0
- package/utils/geometry.d.ts +56 -38
- package/utils/geometry.js +56 -30
- package/utils/index.d.ts +8 -1
- package/utils/index.js +8 -1
- package/utils/is.d.ts +12 -0
- package/utils/is.js +16 -0
- package/utils/number.d.ts +24 -0
- package/utils/number.js +37 -0
- package/utils/object.d.ts +29 -0
- package/utils/object.js +139 -0
- package/utils/persist.d.ts +15 -0
- package/utils/persist.js +89 -0
- package/utils/physics.d.ts +34 -0
- package/utils/physics.js +66 -0
- package/utils/request.d.ts +227 -0
- package/utils/request.js +249 -0
- package/utils/router.d.ts +47 -0
- package/utils/router.js +115 -0
- package/utils/string.d.ts +46 -0
- package/utils/string.js +134 -0
- package/utils/url-query.d.ts +19 -0
- package/utils/url-query.js +95 -0
- package/utils/utils.d.ts +0 -166
- package/utils/utils.js +0 -441
- package/utils/case.d.ts +0 -4
- package/utils/case.js +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
# [1.20.0](https://github.com/sutras/sard-uniapp/compare/v1.19.5...v1.20.0) (2025-07-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* card 组件新增边框相关css变量 ([b838d88](https://github.com/sutras/sard-uniapp/commit/b838d88930f8200a5ed832e888a11cc8f5942233))
|
|
7
|
+
* checkbox-popout 新增搜索和全选功能 ([9457fdd](https://github.com/sutras/sard-uniapp/commit/9457fdd7476f5a6f82a43239c55f8d968ebfd4c9))
|
|
8
|
+
* radio-popout 组件新增搜索功能 ([fade336](https://github.com/sutras/sard-uniapp/commit/fade336615fe9402dd4ff81bff8900ef915cb314))
|
|
9
|
+
* upload h5 显示真实文件名 ([635805f](https://github.com/sutras/sard-uniapp/commit/635805fec8df90411f190c6a1345f59c47af16e9))
|
|
10
|
+
* upload 组件新增 item-click 事件 ([cc01b3f](https://github.com/sutras/sard-uniapp/commit/cc01b3f9283dadae8def7b14d0d65cad40ebc3c9))
|
|
11
|
+
* 修复slider在支付宝端点击问题 ([76e9fd4](https://github.com/sutras/sard-uniapp/commit/76e9fd4fe75515b2ec3cf4ceed08fec87ff1388b))
|
|
12
|
+
* 扩大 DatetimeRangePickerPopout 绑定值的适应性范围,允许绑定空数组 ([087aa7f](https://github.com/sutras/sard-uniapp/commit/087aa7f3fe2a07cba8333a96ef5842426f26e81b))
|
|
13
|
+
* 新增 case 相关工具函数 ([1c3acaa](https://github.com/sutras/sard-uniapp/commit/1c3acaac5a0a95eb57dd7632055843cd9fe6401c))
|
|
14
|
+
* 新增 read-more 组件 ([12637b8](https://github.com/sutras/sard-uniapp/commit/12637b897649fb641eff6672df7c79db9128ab69))
|
|
15
|
+
* 新增 ResizeSensor 组件 ([7f8697e](https://github.com/sutras/sard-uniapp/commit/7f8697ee1f26dcd5cc55ed3e83c1c40664febc64))
|
|
16
|
+
* 新增 ScrollList 组件 ([dacce49](https://github.com/sutras/sard-uniapp/commit/dacce49043332f3a6c143228c23bb92f2285211a))
|
|
17
|
+
* 新增 sticky 和 sticky-box 组件 ([e99ef87](https://github.com/sutras/sard-uniapp/commit/e99ef87c4918b1f84142755c19c7e306abaccfb6))
|
|
18
|
+
* 新增工程化相关工具 ([09fc190](https://github.com/sutras/sard-uniapp/commit/09fc190a66da6a83cf1b3dd2919ca6132ba6e354))
|
|
19
|
+
* 新增日期相关工具 ([51807f4](https://github.com/sutras/sard-uniapp/commit/51807f4a190b5ee3525146c5d7384cc178109796))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
1
23
|
## [1.19.5](https://github.com/sutras/sard-uniapp/compare/v1.19.4...v1.19.5) (2025-06-22)
|
|
2
24
|
|
|
3
25
|
|
package/README.md
CHANGED
|
@@ -31,26 +31,26 @@ import Calendar from 'sard-uniapp/components/calendar/calendar.vue'
|
|
|
31
31
|
|
|
32
32
|
### CalendarProps
|
|
33
33
|
|
|
34
|
-
| 属性 | 描述 | 类型
|
|
35
|
-
| ---------------------------------- | -------------------------------------------------------------------- |
|
|
36
|
-
| root-class | 组件根元素类名 | string
|
|
37
|
-
| root-style | 组件根元素样式 | StyleValue
|
|
38
|
-
| type | 日历类型 | CalendarType
|
|
39
|
-
| model-value | 选中的日期,单选时为当个日期,多选时为日期数组,范围时为两个日期数组 | Date \| Date[] \| string \| string[]
|
|
40
|
-
| min | 可选择的最小日期 | Date
|
|
41
|
-
| max | 可选择的最大日期 | Date
|
|
42
|
-
| current-date | 当前展示月份的日期 | Date
|
|
43
|
-
| disabled-date | 指定禁选日期,返回 `true` 表示禁选 | (date: Date) => boolean
|
|
44
|
-
| max-days | 最多可选天数,用于多选和范围 | number
|
|
45
|
-
| over-max-days | 超出最多可选天数时触发 | () => void
|
|
46
|
-
| week-starts-on | 指定一周以周几开始,`0` 表示周日,`1-6` 分别表示周一至周六 | number
|
|
47
|
-
| formatter | 通过修改 `CalendarDay` 对象属性值,来自定义日期的文案和样式 | (day: CalendarDay) => void
|
|
48
|
-
| allow-same-day | 范围选择中,是否允许起始和结束为同一天 | boolean
|
|
49
|
-
| several-months | 是否显示多个月 | boolean
|
|
50
|
-
| value-format <sup>1.10+</sup> | 绑定值的格式,不指定则绑定值为 Date 对象 | string [详见特殊符号](../
|
|
51
|
-
| start-date-text <sup>1.19.4+</sup> | 开始日期文字 | string
|
|
52
|
-
| end-date-text <sup>1.19.4+</sup> | 结束日期文字 | string
|
|
53
|
-
| same-date-text <sup>1.19.4+</sup> | 选择同一天日期文字 | string
|
|
34
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
35
|
+
| ---------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------- | ----------------------------------------------- |
|
|
36
|
+
| root-class | 组件根元素类名 | string | - |
|
|
37
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
38
|
+
| type | 日历类型 | CalendarType | 'single' |
|
|
39
|
+
| model-value | 选中的日期,单选时为当个日期,多选时为日期数组,范围时为两个日期数组 | Date \| Date[] \| string \| string[] | - |
|
|
40
|
+
| min | 可选择的最小日期 | Date | 前十年,或者当前月(设置了 `several-months`) |
|
|
41
|
+
| max | 可选择的最大日期 | Date | 后十年,或者三个月后(设置了 `several-months`) |
|
|
42
|
+
| current-date | 当前展示月份的日期 | Date | - |
|
|
43
|
+
| disabled-date | 指定禁选日期,返回 `true` 表示禁选 | (date: Date) => boolean | - |
|
|
44
|
+
| max-days | 最多可选天数,用于多选和范围 | number | Number.MAX_SAFE_INTEGER |
|
|
45
|
+
| over-max-days | 超出最多可选天数时触发 | () => void | - |
|
|
46
|
+
| week-starts-on | 指定一周以周几开始,`0` 表示周日,`1-6` 分别表示周一至周六 | number | 0 |
|
|
47
|
+
| formatter | 通过修改 `CalendarDay` 对象属性值,来自定义日期的文案和样式 | (day: CalendarDay) => void | - |
|
|
48
|
+
| allow-same-day | 范围选择中,是否允许起始和结束为同一天 | boolean | false |
|
|
49
|
+
| several-months | 是否显示多个月 | boolean | false |
|
|
50
|
+
| value-format <sup>1.10+</sup> | 绑定值的格式,不指定则绑定值为 Date 对象 | string [详见特殊符号](../utilities/date#日期格式特殊符号) | - |
|
|
51
|
+
| start-date-text <sup>1.19.4+</sup> | 开始日期文字 | string | '开始' |
|
|
52
|
+
| end-date-text <sup>1.19.4+</sup> | 结束日期文字 | string | '结束' |
|
|
53
|
+
| same-date-text <sup>1.19.4+</sup> | 选择同一天日期文字 | string | '开始/结束' |
|
|
54
54
|
|
|
55
55
|
### CalendarEmits
|
|
56
56
|
|
|
@@ -146,7 +146,7 @@ import SarDatetimePicker from "../datetime-picker/datetime-picker.vue";
|
|
|
146
146
|
* @property {(day: CalendarDay) => void} formatter 通过修改 `CalendarDay` 对象属性值,来自定义日期的文案和样式,默认值:-。
|
|
147
147
|
* @property {boolean} allowSameDay 范围选择中,是否允许起始和结束为同一天,默认值:false。
|
|
148
148
|
* @property {boolean} severalMonths 是否显示多个月,默认值:false。
|
|
149
|
-
* @property {string [详见特殊符号](../
|
|
149
|
+
* @property {string [详见特殊符号](../utilities/date#日期格式特殊符号)} valueFormat 绑定值的格式,不指定则绑定值为 Date 对象,默认值:-。
|
|
150
150
|
* @property {string} startDateText 开始日期文字,默认值:'开始'。
|
|
151
151
|
* @property {string} endDateText 结束日期文字,默认值:'结束'。
|
|
152
152
|
* @property {string} sameDateText 选择同一天日期文字,默认值:'开始/结束'。
|
|
@@ -49,16 +49,16 @@ import CalendarInput from 'sard-uniapp/components/calendar-input/calendar-input.
|
|
|
49
49
|
|
|
50
50
|
继承 [`CalendarPopoutProps`](./calendar-popout#CalendarPopoutProps) 并有以下额外属性:
|
|
51
51
|
|
|
52
|
-
| 属性 | 描述 | 类型
|
|
53
|
-
| --------------------------------- | ---------------------- |
|
|
54
|
-
| root-class | 弹出式输入框根元素类名 | string
|
|
55
|
-
| root-style | 弹出式输入框根元素样式 | StyleValue
|
|
56
|
-
| disabled | 禁用状态 | boolean
|
|
57
|
-
| readonly | 只读状态 | boolean
|
|
58
|
-
| clearable | 是否显示清空按钮 | boolean
|
|
59
|
-
| placeholder | 输入框占位符内容 | string
|
|
60
|
-
| outlet-format <sup>1.10+</sup> | 输出到输入框的日期格式 | string [详见特殊符号](../
|
|
61
|
-
| value-on-clear <sup>1.19.2+</sup> | 设置点击清除按钮后的值 | () => any
|
|
52
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
53
|
+
| --------------------------------- | ---------------------- | --------------------------------------------------------- | --------------- |
|
|
54
|
+
| root-class | 弹出式输入框根元素类名 | string | - |
|
|
55
|
+
| root-style | 弹出式输入框根元素样式 | StyleValue | - |
|
|
56
|
+
| disabled | 禁用状态 | boolean | false |
|
|
57
|
+
| readonly | 只读状态 | boolean | false |
|
|
58
|
+
| clearable | 是否显示清空按钮 | boolean | false |
|
|
59
|
+
| placeholder | 输入框占位符内容 | string | - |
|
|
60
|
+
| outlet-format <sup>1.10+</sup> | 输出到输入框的日期格式 | string [详见特殊符号](../utilities/date#日期格式特殊符号) | 'YYYY-MM-DD' |
|
|
61
|
+
| value-on-clear <sup>1.19.2+</sup> | 设置点击清除按钮后的值 | () => any | () => undefined |
|
|
62
62
|
|
|
63
63
|
### CalendarInputEmits
|
|
64
64
|
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
* @property {(day: CalendarDay) => void} formatter 通过修改 `CalendarDay` 对象属性值,来自定义日期的文案和样式,默认值:-。
|
|
65
65
|
* @property {boolean} allowSameDay 范围选择中,是否允许起始和结束为同一天,默认值:false。
|
|
66
66
|
* @property {boolean} severalMonths 是否显示多个月,默认值:false。
|
|
67
|
-
* @property {string [详见特殊符号](../
|
|
67
|
+
* @property {string [详见特殊符号](../utilities/date#日期格式特殊符号)} valueFormat 绑定值的格式,不指定则绑定值为 Date 对象,默认值:-。
|
|
68
68
|
* @property {string} startDateText 开始日期文字,默认值:'开始'。
|
|
69
69
|
* @property {string} endDateText 结束日期文字,默认值:'结束'。
|
|
70
70
|
* @property {string} sameDateText 选择同一天日期文字,默认值:'开始/结束'。
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
* @property {boolean} readonly 只读状态,默认值:false。
|
|
79
79
|
* @property {boolean} clearable 是否显示清空按钮,默认值:false。
|
|
80
80
|
* @property {string} placeholder 输入框占位符内容,默认值:-。
|
|
81
|
-
* @property {string [详见特殊符号](../
|
|
81
|
+
* @property {string [详见特殊符号](../utilities/date#日期格式特殊符号)} outletFormat 输出到输入框的日期格式,默认值:'YYYY-MM-DD'。
|
|
82
82
|
* @property {() => any} valueOnClear 设置点击清除按钮后的值,默认值:() => undefined。
|
|
83
83
|
* @event {(visible: boolean) => void} update 弹出框显隐时触发
|
|
84
84
|
* @event {(value: Date | Date[] | string | string[] | undefined) => void} change 日历组件值改变时触发
|
|
@@ -34,11 +34,10 @@
|
|
|
34
34
|
import { defineComponent as _defineComponent } from "vue";
|
|
35
35
|
import { computed } from "vue";
|
|
36
36
|
import {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
getPadEndDays,
|
|
37
|
+
getDaysInMonth,
|
|
38
|
+
getDaysBeforeFirstDay,
|
|
39
|
+
getPrevMonthTailDays,
|
|
40
|
+
getNextMonthHeadDays,
|
|
42
41
|
toDateNumber,
|
|
43
42
|
stringifyStyle,
|
|
44
43
|
classNames
|
|
@@ -75,33 +74,30 @@ export default _defineComponent({
|
|
|
75
74
|
const props = __props;
|
|
76
75
|
const emit = __emit;
|
|
77
76
|
const days = computed(() => {
|
|
78
|
-
return
|
|
77
|
+
return getDaysInMonth(props.year, props.month);
|
|
79
78
|
});
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
getWeekOfMonthStart(props.year, props.month + 1),
|
|
83
|
-
props.weekStartsOn
|
|
84
|
-
);
|
|
79
|
+
const daysBefore = computed(() => {
|
|
80
|
+
return getDaysBeforeFirstDay(props.year, props.month, props.weekStartsOn);
|
|
85
81
|
});
|
|
86
82
|
const allDays = computed(() => {
|
|
87
83
|
const currentDays = Array(days.value).fill(0).map((_, i) => new Date(props.year, props.month, i + 1));
|
|
88
84
|
if (props.severalMonths) {
|
|
89
85
|
return currentDays;
|
|
90
86
|
}
|
|
91
|
-
const
|
|
87
|
+
const prevMonthTailDays = getPrevMonthTailDays(
|
|
92
88
|
props.year,
|
|
93
|
-
props.month
|
|
94
|
-
|
|
89
|
+
props.month,
|
|
90
|
+
props.weekStartsOn
|
|
95
91
|
);
|
|
96
|
-
const
|
|
92
|
+
const nextMonthHeadDays = getNextMonthHeadDays(
|
|
97
93
|
props.year,
|
|
98
|
-
props.month
|
|
99
|
-
|
|
94
|
+
props.month,
|
|
95
|
+
props.weekStartsOn
|
|
100
96
|
);
|
|
101
|
-
return [...
|
|
97
|
+
return [...prevMonthTailDays, ...currentDays, ...nextMonthHeadDays];
|
|
102
98
|
});
|
|
103
99
|
function withinMonth(i) {
|
|
104
|
-
return props.severalMonths ? true : i >=
|
|
100
|
+
return props.severalMonths ? true : i >= daysBefore.value && i < daysBefore.value + days.value;
|
|
105
101
|
}
|
|
106
102
|
const types = {
|
|
107
103
|
same: "same",
|
|
@@ -145,7 +141,7 @@ export default _defineComponent({
|
|
|
145
141
|
return {
|
|
146
142
|
day,
|
|
147
143
|
style: stringifyStyle(day.style, {
|
|
148
|
-
marginLeft: props.severalMonths && i === 0 ?
|
|
144
|
+
marginLeft: props.severalMonths && i === 0 ? daysBefore.value / 7 * 100 + "%" : null
|
|
149
145
|
}),
|
|
150
146
|
className: classNames(
|
|
151
147
|
props.bem.e("day"),
|
|
@@ -163,7 +159,7 @@ export default _defineComponent({
|
|
|
163
159
|
emit("day-click", day.date);
|
|
164
160
|
}
|
|
165
161
|
};
|
|
166
|
-
const __returned__ = { props, emit, days,
|
|
162
|
+
const __returned__ = { props, emit, days, daysBefore, allDays, withinMonth, types, daysInfo, onDayClick };
|
|
167
163
|
return __returned__;
|
|
168
164
|
}
|
|
169
165
|
});
|
|
@@ -63,7 +63,7 @@ import { useFormPopout } from "../../use";
|
|
|
63
63
|
* @property {(day: CalendarDay) => void} formatter 通过修改 `CalendarDay` 对象属性值,来自定义日期的文案和样式,默认值:-。
|
|
64
64
|
* @property {boolean} allowSameDay 范围选择中,是否允许起始和结束为同一天,默认值:false。
|
|
65
65
|
* @property {boolean} severalMonths 是否显示多个月,默认值:false。
|
|
66
|
-
* @property {string [详见特殊符号](../
|
|
66
|
+
* @property {string [详见特殊符号](../utilities/date#日期格式特殊符号)} valueFormat 绑定值的格式,不指定则绑定值为 Date 对象,默认值:-。
|
|
67
67
|
* @property {string} startDateText 开始日期文字,默认值:'开始'。
|
|
68
68
|
* @property {string} endDateText 结束日期文字,默认值:'结束'。
|
|
69
69
|
* @property {string} sameDateText 选择同一天日期文字,默认值:'开始/结束'。
|
|
@@ -47,18 +47,26 @@ import Card from 'sard-uniapp/components/card/card.vue'
|
|
|
47
47
|
|
|
48
48
|
@code('${DEMO_PATH}/card/demo/Hover.vue')
|
|
49
49
|
|
|
50
|
+
### 自定义样式
|
|
51
|
+
|
|
52
|
+
可以通过 css 变量自定义卡片样式。
|
|
53
|
+
|
|
54
|
+
@code('${DEMO_PATH}/card/demo/Style.vue')
|
|
55
|
+
|
|
50
56
|
## API
|
|
51
57
|
|
|
52
58
|
### CardProps
|
|
53
59
|
|
|
54
|
-
| 属性
|
|
55
|
-
|
|
|
56
|
-
| root-class
|
|
57
|
-
| root-style
|
|
58
|
-
| title
|
|
59
|
-
| extra
|
|
60
|
-
| footer
|
|
61
|
-
| hover <sup>1.12.3+</sup>
|
|
60
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
61
|
+
| ----------------------------------- | ---------------- | ---------- | ------ |
|
|
62
|
+
| root-class | 组件根元素类名 | string | - |
|
|
63
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
64
|
+
| title | 头部左边内容 | string | - |
|
|
65
|
+
| extra | 头部右边内容 | string | - |
|
|
66
|
+
| footer | 底部内容 | string | - |
|
|
67
|
+
| hover <sup>1.12.3+</sup> | 是否开启点击反馈 | boolean | false |
|
|
68
|
+
| hide-header-border <sup>1.20+</sup> | 是否隐藏头部边框 | boolean | false |
|
|
69
|
+
| hide-footer-border <sup>1.20+</sup> | 是否隐藏底部边框 | boolean | false |
|
|
62
70
|
|
|
63
71
|
### CardSlots
|
|
64
72
|
|
package/components/card/card.vue
CHANGED
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
* @property {string} extra 头部右边内容,默认值:-。
|
|
34
34
|
* @property {string} footer 底部内容,默认值:-。
|
|
35
35
|
* @property {boolean} hover 是否开启点击反馈,默认值:false。
|
|
36
|
+
* @property {boolean} hideHeaderBorder 是否隐藏头部边框,默认值:false。
|
|
37
|
+
* @property {boolean} hideFooterBorder 是否隐藏底部边框,默认值:false。
|
|
36
38
|
* @event {(event: any) => void} click 点击卡片时触发
|
|
37
39
|
*/
|
|
38
40
|
export default _defineComponent({
|
|
@@ -49,7 +51,9 @@ export default _defineComponent({
|
|
|
49
51
|
title: { type: String, required: false },
|
|
50
52
|
extra: { type: String, required: false },
|
|
51
53
|
footer: { type: String, required: false },
|
|
52
|
-
hover: { type: Boolean, required: false }
|
|
54
|
+
hover: { type: Boolean, required: false },
|
|
55
|
+
hideHeaderBorder: { type: Boolean, required: false },
|
|
56
|
+
hideFooterBorder: { type: Boolean, required: false }
|
|
53
57
|
},
|
|
54
58
|
emits: ["click"],
|
|
55
59
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -73,6 +77,8 @@ export default _defineComponent({
|
|
|
73
77
|
bem.m("hover", props.hover),
|
|
74
78
|
bem.m("headless", headless.value),
|
|
75
79
|
bem.m("footless", footless.value),
|
|
80
|
+
bem.m("head-borderless", props.hideHeaderBorder),
|
|
81
|
+
bem.m("foot-borderless", props.hideFooterBorder),
|
|
76
82
|
props.rootClass
|
|
77
83
|
);
|
|
78
84
|
});
|
|
@@ -23,7 +23,13 @@
|
|
|
23
23
|
padding: var(--sar-card-header-padding-y) var(--sar-card-header-padding-x);
|
|
24
24
|
|
|
25
25
|
&::after {
|
|
26
|
-
@include border-bottom(
|
|
26
|
+
@include border-bottom(
|
|
27
|
+
var(--sar-card-header-border-color, var(--sar-card-border-color)),
|
|
28
|
+
var(--sar-card-header-border-style, var(--sar-card-border-style)),
|
|
29
|
+
var(--sar-card-header-border-width, var(--sar-card-border-width))
|
|
30
|
+
);
|
|
31
|
+
left: var(--sar-card-border-left);
|
|
32
|
+
right: var(--sar-card-border-right);
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
35
|
|
|
@@ -46,7 +52,29 @@
|
|
|
46
52
|
@include universal;
|
|
47
53
|
padding: var(--sar-card-footer-padding-y) var(--sar-card-footer-padding-x);
|
|
48
54
|
&::before {
|
|
49
|
-
@include border-top(
|
|
55
|
+
@include border-top(
|
|
56
|
+
var(--sar-card-footer-border-color, var(--sar-card-border-color)),
|
|
57
|
+
var(--sar-card-footer-border-style, var(--sar-card-border-style)),
|
|
58
|
+
var(--sar-card-footer-border-width, var(--sar-card-border-width))
|
|
59
|
+
);
|
|
60
|
+
left: var(--sar-card-border-left);
|
|
61
|
+
right: var(--sar-card-border-right);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@include m(head-borderless) {
|
|
66
|
+
@include e(header) {
|
|
67
|
+
&::after {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@include m(foot-borderless) {
|
|
74
|
+
@include e(footer) {
|
|
75
|
+
&::before {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
50
78
|
}
|
|
51
79
|
}
|
|
52
80
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
page,
|
|
3
3
|
.sar-portal {
|
|
4
4
|
--sar-card-border-radius: var(--sar-rounded-lg);
|
|
5
|
-
--sar-card-border-color: var(--sar-border-color);
|
|
6
5
|
--sar-card-bg: var(--sar-emphasis-bg);
|
|
7
6
|
--sar-card-active-bg: var(--sar-active-bg);
|
|
8
7
|
|
|
@@ -17,5 +16,21 @@ page,
|
|
|
17
16
|
|
|
18
17
|
--sar-card-footer-padding-y: 20rpx;
|
|
19
18
|
--sar-card-footer-padding-x: 32rpx;
|
|
19
|
+
|
|
20
|
+
--sar-card-border-color: var(--sar-border-color);
|
|
21
|
+
|
|
22
|
+
// 1.20+
|
|
23
|
+
--sar-card-border-style: var(--sar-border-style);
|
|
24
|
+
--sar-card-border-width: var(--sar-border-width);
|
|
25
|
+
--sar-card-border-left: 0px;
|
|
26
|
+
--sar-card-border-right: 0px;
|
|
27
|
+
|
|
28
|
+
// 可覆盖 1.20+
|
|
29
|
+
// --sar-card-header-border-color: var(--sar-card-border-color);
|
|
30
|
+
// --sar-card-header-border-style: var(--sar-card-border-style);
|
|
31
|
+
// --sar-card-header-border-width: var(--sar-card-border-width);
|
|
32
|
+
// --sar-card-footer-border-color: var(--sar-card-border-color);
|
|
33
|
+
// --sar-card-footer-border-style: var(--sar-card-border-style);
|
|
34
|
+
// --sar-card-footer-border-width: var(--sar-card-border-width);
|
|
20
35
|
}
|
|
21
36
|
// #endvariables
|
|
@@ -3,6 +3,7 @@ export const defaultCheckboxProps = defaultConfig.checkbox;
|
|
|
3
3
|
export const defaultOptionKeys = {
|
|
4
4
|
label: 'label',
|
|
5
5
|
value: 'value',
|
|
6
|
+
disabled: 'disabled',
|
|
6
7
|
};
|
|
7
8
|
export const defaultCheckboxGroupProps = defaultConfig.checkboxGroup;
|
|
8
9
|
export const checkboxContextSymbol = Symbol('checkbox-context');
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
:options="options"
|
|
25
25
|
:option-keys="optionKeys"
|
|
26
26
|
:validate-event="validateEvent"
|
|
27
|
+
:show-check-all="showCheckAll"
|
|
28
|
+
:searchable="searchable"
|
|
29
|
+
:filter-placeholder="filterPlaceholder"
|
|
27
30
|
@change="onChange"
|
|
28
31
|
/>
|
|
29
32
|
</sar-popout-input>
|
|
@@ -58,6 +61,9 @@ import { usePopoutInput } from "../../use";
|
|
|
58
61
|
* @property {StyleValue} popoutStyle 弹窗框根元素样式,默认值:-。
|
|
59
62
|
* @property {boolean} visible 是否显示弹出框,默认值:-。
|
|
60
63
|
* @property {string} title 弹出框标题,默认值:-。
|
|
64
|
+
* @property {boolean} showCheckAll 是否显示全选,默认值:false。
|
|
65
|
+
* @property {boolean} searchable 是否可搜索,默认值:false。
|
|
66
|
+
* @property {string} filterPlaceholder 搜索输入框占位符内容,默认值:-。
|
|
61
67
|
* @property {boolean} clearable 是否显示清空按钮,默认值:false。
|
|
62
68
|
* @property {string} placeholder 输入框占位符内容,默认值:-。
|
|
63
69
|
* @property {() => any} valueOnClear 设置点击清除按钮后的值,默认值:() => undefined。
|
|
@@ -82,6 +88,9 @@ export default _defineComponent({
|
|
|
82
88
|
title: { type: String, required: false },
|
|
83
89
|
popoutClass: { type: String, required: false },
|
|
84
90
|
popoutStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
91
|
+
showCheckAll: { type: Boolean, required: false },
|
|
92
|
+
searchable: { type: Boolean, required: false },
|
|
93
|
+
filterPlaceholder: { type: String, required: false },
|
|
85
94
|
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
86
95
|
rootClass: { type: String, required: false },
|
|
87
96
|
modelValue: { type: Array, required: false },
|
|
@@ -24,18 +24,39 @@ import CheckboxPopout from 'sard-uniapp/components/checkbox-popout/checkbox-popo
|
|
|
24
24
|
|
|
25
25
|
@code('${DEMO_PATH}/checkbox-popout/demo/Basic.vue')
|
|
26
26
|
|
|
27
|
+
### 全选 <sup>1.20+</sup>
|
|
28
|
+
|
|
29
|
+
使用 `show-check-all` 显示全选框,可用于快速选择所有或取消选择。
|
|
30
|
+
|
|
31
|
+
@code('${DEMO_PATH}/checkbox-popout/demo/CheckAll.vue')
|
|
32
|
+
|
|
33
|
+
### 禁用选项 <sup>1.20+</sup>
|
|
34
|
+
|
|
35
|
+
设置了 `disabled` 的选项可禁止选择。
|
|
36
|
+
|
|
37
|
+
@code('${DEMO_PATH}/checkbox-popout/demo/Disabled.vue')
|
|
38
|
+
|
|
39
|
+
### 可搜索的 <sup>1.20+</sup>
|
|
40
|
+
|
|
41
|
+
使用 `searchable` 显示搜索框,可用于过滤选项列表。
|
|
42
|
+
|
|
43
|
+
@code('${DEMO_PATH}/checkbox-popout/demo/Search.vue')
|
|
44
|
+
|
|
27
45
|
## API
|
|
28
46
|
|
|
29
47
|
### CheckboxPopoutProps
|
|
30
48
|
|
|
31
49
|
继承 [`CheckboxGroupProps`](./checkbox#CheckboxGroupProps) 并有以下额外属性:
|
|
32
50
|
|
|
33
|
-
| 属性
|
|
34
|
-
|
|
|
35
|
-
| popout-class
|
|
36
|
-
| popout-style
|
|
37
|
-
| visible (v-model)
|
|
38
|
-
| title
|
|
51
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
52
|
+
| ----------------------------------- | -------------------- | ---------- | ------ |
|
|
53
|
+
| popout-class | 弹窗框根元素类名 | string | - |
|
|
54
|
+
| popout-style | 弹窗框根元素样式 | StyleValue | - |
|
|
55
|
+
| visible (v-model) | 是否显示弹出框 | boolean | - |
|
|
56
|
+
| title | 弹出框标题 | string | - |
|
|
57
|
+
| show-check-all <sup>1.20+</sup> | 是否显示全选 | boolean | false |
|
|
58
|
+
| searchable <sup>1.20+</sup> | 是否可搜索 | boolean | false |
|
|
59
|
+
| filter-placeholder <sup>1.20+</sup> | 搜索输入框占位符内容 | string | - |
|
|
39
60
|
|
|
40
61
|
### CheckboxPopoutEmits
|
|
41
62
|
|