sard-uniapp 1.19.1 → 1.19.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.
- package/CHANGELOG.md +30 -0
- package/components/accordion/README.md +91 -0
- package/components/accordion/accordion.vue +7 -0
- package/components/accordion-item/accordion-item.vue +9 -0
- package/components/action-sheet/README.md +85 -0
- package/components/action-sheet/action-sheet.vue +15 -0
- package/components/action-sheet/variables.scss +1 -1
- package/components/alert/README.md +74 -0
- package/components/alert/alert.vue +10 -0
- package/components/avatar/README.md +86 -0
- package/components/avatar/avatar.vue +8 -0
- package/components/back-top/README.md +134 -0
- package/components/back-top/back-top.vue +9 -0
- package/components/badge/README.md +95 -0
- package/components/badge/badge.vue +11 -0
- package/components/button/README.md +162 -0
- package/components/button/button.vue +46 -0
- package/components/calendar/README.md +94 -0
- package/components/calendar/calendar.vue +21 -2
- package/components/calendar-input/README.md +65 -0
- package/components/calendar-input/calendar-input.d.ts +3 -2
- package/components/calendar-input/calendar-input.vue +32 -0
- package/components/calendar-input/common.d.ts +2 -0
- package/components/calendar-popout/README.md +100 -0
- package/components/calendar-popout/calendar-popout.d.ts +12 -2
- package/components/calendar-popout/calendar-popout.vue +32 -1
- package/components/calendar-popout/common.d.ts +2 -0
- package/components/card/README.md +82 -0
- package/components/card/card.vue +9 -0
- package/components/cascader/README.md +117 -0
- package/components/cascader/cascader.vue +13 -0
- package/components/cascader-input/README.md +51 -0
- package/components/cascader-input/cascader-input.d.ts +2 -1
- package/components/cascader-input/cascader-input.vue +32 -6
- package/components/cascader-input/common.d.ts +2 -0
- package/components/cascader-input/common.js +1 -0
- package/components/cascader-popout/README.md +53 -0
- package/components/cascader-popout/cascader-popout.d.ts +1 -1
- package/components/cascader-popout/cascader-popout.vue +21 -2
- package/components/check-icon/variables.scss +1 -1
- package/components/checkbox/README.md +185 -0
- package/components/checkbox/checkbox.vue +17 -0
- package/components/checkbox/variables.scss +1 -1
- package/components/checkbox-group/checkbox-group.vue +15 -0
- package/components/checkbox-input/README.md +44 -0
- package/components/checkbox-input/checkbox-input.d.ts +1 -0
- package/components/checkbox-input/checkbox-input.vue +25 -2
- package/components/checkbox-input/common.d.ts +2 -0
- package/components/checkbox-input/common.js +5 -1
- package/components/checkbox-popout/README.md +52 -0
- package/components/checkbox-popout/checkbox-popout.vue +19 -0
- package/components/col/col.vue +7 -0
- package/components/collapse/README.md +45 -0
- package/components/collapse/collapse.vue +3 -0
- package/components/config/index.d.ts +46 -1
- package/components/config/index.js +37 -0
- package/components/count-down/README.md +97 -0
- package/components/count-down/count-down.vue +8 -0
- package/components/count-to/README.md +61 -0
- package/components/count-to/count-to.vue +7 -0
- package/components/crop-image/README.md +86 -0
- package/components/crop-image/crop-image.vue +15 -0
- package/components/datetime-picker/README.md +136 -0
- package/components/datetime-picker/datetime-picker.vue +14 -0
- package/components/datetime-picker-input/README.md +82 -0
- package/components/datetime-picker-input/common.d.ts +2 -0
- package/components/datetime-picker-input/common.js +1 -0
- package/components/datetime-picker-input/datetime-picker-input.d.ts +2 -1
- package/components/datetime-picker-input/datetime-picker-input.vue +26 -0
- package/components/datetime-picker-popout/README.md +77 -0
- package/components/datetime-picker-popout/datetime-picker-popout.d.ts +1 -1
- package/components/datetime-picker-popout/datetime-picker-popout.vue +21 -2
- package/components/datetime-range-picker/README.md +49 -0
- package/components/datetime-range-picker/datetime-range-picker.vue +15 -0
- package/components/datetime-range-picker-input/README.md +58 -0
- package/components/datetime-range-picker-input/common.d.ts +2 -0
- package/components/datetime-range-picker-input/common.js +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +27 -0
- package/components/datetime-range-picker-popout/README.md +53 -0
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +22 -2
- package/components/dialog/README.md +192 -0
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.vue +33 -0
- package/components/dialog-agent/dialog-agent.d.ts +1 -1
- package/components/dialog-agent/dialog-agent.vue +21 -0
- package/components/divider/README.md +80 -0
- package/components/divider/divider.vue +8 -0
- package/components/dropdown/README.md +168 -0
- package/components/dropdown/common.d.ts +7 -0
- package/components/dropdown/common.js +1 -0
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/dropdown.vue +16 -1
- package/components/dropdown/variables.scss +1 -1
- package/components/dropdown-item/dropdown-item.vue +51 -4
- package/components/empty/README.md +71 -0
- package/components/empty/empty.vue +8 -0
- package/components/empty/variables.scss +1 -1
- package/components/fab/README.md +111 -0
- package/components/fab/fab.vue +18 -0
- package/components/floating-bubble/README.md +70 -0
- package/components/floating-bubble/floating-bubble.vue +11 -0
- package/components/floating-panel/README.md +78 -0
- package/components/floating-panel/floating-panel.vue +11 -0
- package/components/form/README.md +308 -0
- package/components/form/form.vue +19 -0
- package/components/form-item/form-item.vue +17 -0
- package/components/grid/README.md +140 -0
- package/components/grid/grid.vue +11 -0
- package/components/grid-item/grid-item.vue +15 -0
- package/components/icon/README.md +118 -0
- package/components/icon/common.d.ts +2 -0
- package/components/icon/icon.d.ts +1 -0
- package/components/icon/icon.vue +18 -3
- package/components/indexes/README.md +83 -0
- package/components/indexes/indexes.vue +7 -0
- package/components/indexes-anchor/indexes-anchor.vue +5 -0
- package/components/input/README.md +170 -0
- package/components/input/common.d.ts +1 -0
- package/components/input/index.scss +0 -20
- package/components/input/input.vue +71 -17
- package/components/input/variables.scss +2 -2
- package/components/keyboard/README.md +82 -0
- package/components/keyboard/keyboard.vue +7 -0
- package/components/layout/README.md +89 -0
- package/components/list/README.md +118 -0
- package/components/list/list.vue +8 -0
- package/components/list-item/list-item.vue +15 -0
- package/components/load-more/README.md +75 -0
- package/components/load-more/load-more.vue +11 -0
- package/components/loading/README.md +89 -0
- package/components/loading/loading.vue +13 -0
- package/components/lucky-draw/README.md +174 -0
- package/components/marquee/README.md +65 -0
- package/components/marquee/marquee.vue +7 -0
- package/components/menu/_README.md +61 -0
- package/components/navbar/README.md +123 -0
- package/components/navbar/navbar.vue +11 -0
- package/components/navbar-item/navbar-item.vue +10 -0
- package/components/notice-bar/README.md +135 -0
- package/components/notice-bar/notice-bar.vue +17 -0
- package/components/notify/README.md +118 -0
- package/components/notify/notify.vue +11 -0
- package/components/notify-agent/notify-agent.vue +12 -0
- package/components/overlay/README.md +56 -0
- package/components/overlay/overlay.vue +10 -0
- package/components/pagination/README.md +80 -0
- package/components/pagination/pagination.vue +15 -0
- package/components/password-input/README.md +87 -0
- package/components/password-input/password-input.vue +17 -0
- package/components/picker/README.md +115 -0
- package/components/picker/common.d.ts +1 -1
- package/components/picker/common.js +18 -6
- package/components/picker/picker.vue +40 -15
- package/components/picker-input/README.md +51 -0
- package/components/picker-input/common.d.ts +2 -0
- package/components/picker-input/common.js +2 -0
- package/components/picker-input/picker-input.d.ts +2 -1
- package/components/picker-input/picker-input.vue +24 -2
- package/components/picker-popout/README.md +51 -0
- package/components/picker-popout/picker-popout.d.ts +1 -1
- package/components/picker-popout/picker-popout.vue +24 -4
- package/components/popout/README.md +111 -0
- package/components/popout/common.d.ts +1 -0
- package/components/popout/popout.d.ts +1 -1
- package/components/popout/popout.vue +30 -0
- package/components/popout-input/README.md +55 -0
- package/components/popout-input/popout-input.vue +16 -0
- package/components/popout-input/variables.scss +1 -1
- package/components/popover/README.md +191 -0
- package/components/popover/popover.vue +15 -0
- package/components/popover-reference/popover-reference.vue +5 -0
- package/components/popup/README.md +67 -0
- package/components/popup/popup.vue +20 -0
- package/components/progress-bar/README.md +90 -0
- package/components/progress-bar/progress-bar.vue +13 -0
- package/components/progress-circle/README.md +75 -0
- package/components/progress-circle/progress-circle.vue +10 -0
- package/components/pull-down-refresh/README.md +100 -0
- package/components/pull-down-refresh/pull-down-refresh.d.ts +1 -1
- package/components/pull-down-refresh/pull-down-refresh.vue +11 -0
- package/components/qrcode/README.md +103 -0
- package/components/qrcode/common.d.ts +2 -0
- package/components/qrcode/qrcode.vue +71 -61
- package/components/radio/README.md +172 -0
- package/components/radio/radio.vue +13 -0
- package/components/radio/variables.scss +1 -1
- package/components/radio-group/radio-group.vue +16 -0
- package/components/radio-input/README.md +44 -0
- package/components/radio-input/common.d.ts +3 -1
- package/components/radio-input/common.js +5 -1
- package/components/radio-input/radio-input.d.ts +1 -0
- package/components/radio-input/radio-input.vue +26 -2
- package/components/radio-popout/README.md +52 -0
- package/components/radio-popout/common.d.ts +1 -1
- package/components/radio-popout/radio-popout.vue +20 -0
- package/components/rate/README.md +106 -0
- package/components/rate/rate.d.ts +1 -1
- package/components/rate/rate.vue +22 -0
- package/components/rate/variables.scss +1 -1
- package/components/result/README.md +66 -0
- package/components/result/result.vue +10 -0
- package/components/row/row.vue +7 -0
- package/components/scroll-spy/README.md +70 -0
- package/components/scroll-spy/scroll-spy.vue +13 -0
- package/components/search/README.md +117 -0
- package/components/search/search.vue +25 -0
- package/components/search/variables.scss +1 -1
- package/components/share-sheet/README.md +94 -0
- package/components/share-sheet/share-sheet.vue +20 -0
- package/components/share-sheet/variables.scss +1 -1
- package/components/sidebar/README.md +118 -0
- package/components/sidebar/sidebar.vue +10 -0
- package/components/sidebar-item/sidebar-item.vue +8 -0
- package/components/signature/README.md +99 -0
- package/components/signature/signature.vue +20 -0
- package/components/skeleton/README.md +128 -0
- package/components/skeleton/skeleton.vue +12 -0
- package/components/skeleton-avatar/skeleton-avatar.vue +9 -0
- package/components/skeleton-block/skeleton-block.vue +8 -0
- package/components/skeleton-paragraph/skeleton-paragraph.vue +9 -0
- package/components/skeleton-title/skeleton-title.vue +8 -0
- package/components/slider/README.md +140 -0
- package/components/slider/slider.vue +29 -0
- package/components/space/README.md +82 -0
- package/components/space/space.vue +9 -0
- package/components/status-bar/README.md +72 -0
- package/components/status-bar/status-bar.vue +6 -0
- package/components/step/step.vue +9 -1
- package/components/stepper/README.md +94 -0
- package/components/stepper/stepper.vue +24 -0
- package/components/stepper/variables.scss +1 -1
- package/components/steps/README.md +142 -0
- package/components/steps/steps.vue +15 -0
- package/components/style/README.md +20 -0
- package/components/style/variables-dark.scss +10 -6
- package/components/style/variables.scss +17 -11
- package/components/swipe-action/README.md +82 -0
- package/components/swipe-action/swipe-action.vue +7 -0
- package/components/swiper-dot/README.md +45 -0
- package/components/swiper-dot/swiper-dot.vue +9 -0
- package/components/switch/README.md +89 -0
- package/components/switch/switch.vue +18 -0
- package/components/tab/tab.vue +8 -0
- package/components/tabbar/README.md +111 -0
- package/components/tabbar/tabbar.vue +12 -0
- package/components/tabbar-item/tabbar-item.vue +12 -0
- package/components/tabbar-pit/README.md +41 -0
- package/components/tabbar-pit/tabbar-pit.vue +5 -0
- package/components/table/README.md +162 -0
- package/components/table/table.vue +7 -0
- package/components/table-cell/table-cell.vue +7 -0
- package/components/table-row/table-row.vue +5 -0
- package/components/tabs/README.md +113 -0
- package/components/tabs/tabs.vue +10 -0
- package/components/tag/README.md +96 -0
- package/components/tag/common.d.ts +1 -1
- package/components/tag/index.scss +5 -1
- package/components/tag/tag.vue +16 -2
- package/components/timeline/README.md +66 -0
- package/components/timeline/timeline.vue +4 -0
- package/components/timeline/variables.scss +1 -1
- package/components/timeline-item/timeline-item.vue +9 -0
- package/components/toast/README.md +111 -0
- package/components/toast/toast.vue +11 -0
- package/components/toast-agent/toast-agent.vue +11 -0
- package/components/tree/README.md +208 -0
- package/components/tree/tree.vue +21 -0
- package/components/tree/variables.scss +3 -3
- package/components/upload/README.md +154 -0
- package/components/upload/common.d.ts +1 -0
- package/components/upload/upload.d.ts +1 -1
- package/components/upload/upload.vue +67 -26
- package/package.json +74 -45
- package/use/useFormPopout.d.ts +1 -1
- package/use/useFormPopout.js +4 -1
- package/use/usePopoutInput.d.ts +2 -1
- package/use/usePopoutInput.js +7 -4
|
@@ -19,6 +19,16 @@ import { useTransition } from "../../use";
|
|
|
19
19
|
import {
|
|
20
20
|
defaultOverlayProps
|
|
21
21
|
} from "./common";
|
|
22
|
+
/**
|
|
23
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
24
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
25
|
+
* @property {boolean} visible 控制显隐,默认值:-。
|
|
26
|
+
* @property {number | string} zIndex 设置层级,默认值:-。
|
|
27
|
+
* @property {number} duration 透明度过渡持续时间,默认值:300。
|
|
28
|
+
* @property {string} background 自定义遮罩层的背景色,默认值:-。
|
|
29
|
+
* @property {boolean} transparent 透明遮罩,默认值:false。
|
|
30
|
+
* @event {(event: any) => void} click 点击遮罩时触发
|
|
31
|
+
*/
|
|
22
32
|
export default _defineComponent({
|
|
23
33
|
...{
|
|
24
34
|
options: {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Pagination
|
|
4
|
+
subtitle: 分页
|
|
5
|
+
group: 导航组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
用于分割长列表,每次加载一页数据。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Pagination from 'sard-uniapp/components/pagination/pagination.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
设置 `total` 属性后便会渲染出页码。
|
|
23
|
+
|
|
24
|
+
@code('${DEMO_PATH}/pagination/demo/Basic.vue')
|
|
25
|
+
|
|
26
|
+
### 显示省略号
|
|
27
|
+
|
|
28
|
+
设置 `ellipsis` 会显示省略号,默认点击省略号会向前或向后 5 页。
|
|
29
|
+
|
|
30
|
+
@code('${DEMO_PATH}/pagination/demo/Ellipsis.vue')
|
|
31
|
+
|
|
32
|
+
### 简单分页
|
|
33
|
+
|
|
34
|
+
设置 `type="simple"` 属性可以隐藏具体的页码。
|
|
35
|
+
|
|
36
|
+
@code('${DEMO_PATH}/pagination/demo/Simple.vue')
|
|
37
|
+
|
|
38
|
+
### 自定义
|
|
39
|
+
|
|
40
|
+
自定义前后按钮内容。
|
|
41
|
+
|
|
42
|
+
@code('${DEMO_PATH}/pagination/demo/Custom.vue')
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
### PaginationProps
|
|
47
|
+
|
|
48
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
49
|
+
| ------------------- | ---------------------- | ------------------- | ------- |
|
|
50
|
+
| root-class | 组件根元素类名 | string | - |
|
|
51
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
52
|
+
| total | 总记录数 | number | 0 |
|
|
53
|
+
| page-size | 每页记录数 | number | 10 |
|
|
54
|
+
| current (v-model) | 当前页码 | number | - |
|
|
55
|
+
| page-count | 总页数,默认自动计算 | number | - |
|
|
56
|
+
| page-button-count | 显示的页码按钮个数 | number | 5 |
|
|
57
|
+
| hide-on-single-page | 只有一页时是否隐藏分页 | boolean | false |
|
|
58
|
+
| type | 分页类型 | 'simple' \| 'multi' | 'multi' |
|
|
59
|
+
| ellipsis | 是否显示省略号 | boolean | false |
|
|
60
|
+
| multi-count | 点击省略号跳转的页数 | number | 5 |
|
|
61
|
+
|
|
62
|
+
### PaginationSlots
|
|
63
|
+
|
|
64
|
+
| 插槽 | 描述 | 属性 |
|
|
65
|
+
| ---- | -------------------- | ---- |
|
|
66
|
+
| prev | 自定义上一页按钮内容 | - |
|
|
67
|
+
| next | 自定义下一页按钮内容 | - |
|
|
68
|
+
|
|
69
|
+
### PaginationEmits
|
|
70
|
+
|
|
71
|
+
| 事件 | 描述 | 类型 |
|
|
72
|
+
| ------------------------- | -------------- | ---------------------- |
|
|
73
|
+
| update:current | 页码改变时触发 | (page: number) => void |
|
|
74
|
+
| change <sup>1.12.2+</sup> | 页码改变时触发 | (page: number) => void |
|
|
75
|
+
|
|
76
|
+
## 主题定制
|
|
77
|
+
|
|
78
|
+
### CSS 变量
|
|
79
|
+
|
|
80
|
+
@code('./variables.scss#variables')
|
|
@@ -55,6 +55,21 @@ import {
|
|
|
55
55
|
getPageRange,
|
|
56
56
|
defaultPaginationProps
|
|
57
57
|
} from "./common";
|
|
58
|
+
/**
|
|
59
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
60
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
61
|
+
* @property {number} total 总记录数,默认值:0。
|
|
62
|
+
* @property {number} pageSize 每页记录数,默认值:10。
|
|
63
|
+
* @property {number} current 当前页码,默认值:-。
|
|
64
|
+
* @property {number} pageCount 总页数,默认自动计算,默认值:-。
|
|
65
|
+
* @property {number} pageButtonCount 显示的页码按钮个数,默认值:5。
|
|
66
|
+
* @property {boolean} hideOnSinglePage 只有一页时是否隐藏分页,默认值:false。
|
|
67
|
+
* @property {'simple' | 'multi'} type 分页类型,默认值:'multi'。
|
|
68
|
+
* @property {boolean} ellipsis 是否显示省略号,默认值:false。
|
|
69
|
+
* @property {number} multiCount 点击省略号跳转的页数,默认值:5。
|
|
70
|
+
* @event {(page: number) => void} update 页码改变时触发
|
|
71
|
+
* @event {(page: number) => void} change 页码改变时触发
|
|
72
|
+
*/
|
|
58
73
|
export default _defineComponent({
|
|
59
74
|
...{
|
|
60
75
|
options: {
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: PasswordInput
|
|
4
|
+
subtitle: 密码输入框
|
|
5
|
+
group: 表单组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
用于输入密码、验证码等场景可结合数字键盘组件或原生键盘使用。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import PasswordInput from 'sard-uniapp/components/password-input/password-input.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
默认可以输入 6 个字符。
|
|
23
|
+
|
|
24
|
+
@code('${DEMO_PATH}/password-input/demo/Basic.vue')
|
|
25
|
+
|
|
26
|
+
### 下划线类型
|
|
27
|
+
|
|
28
|
+
`type` 属性可以设置为 `underline` 显示为下划线类型。
|
|
29
|
+
|
|
30
|
+
@code('${DEMO_PATH}/password-input/demo/Underline.vue')
|
|
31
|
+
|
|
32
|
+
### 间距
|
|
33
|
+
|
|
34
|
+
通过 `gap` 属性来设置格子之间的间距。
|
|
35
|
+
|
|
36
|
+
@code('${DEMO_PATH}/password-input/demo/Gap.vue')
|
|
37
|
+
|
|
38
|
+
### 明文显示
|
|
39
|
+
|
|
40
|
+
设置 `plainText` 属性可以明文展示输入的内容,适用于短信验证码等场景。
|
|
41
|
+
|
|
42
|
+
@code('${DEMO_PATH}/password-input/demo/PlainText.vue')
|
|
43
|
+
|
|
44
|
+
### 只读和禁用
|
|
45
|
+
|
|
46
|
+
只读和禁用后不可以操作。
|
|
47
|
+
|
|
48
|
+
@code('${DEMO_PATH}/password-input/demo/DisabledReadOnly.vue')
|
|
49
|
+
|
|
50
|
+
### 使用自定义键盘
|
|
51
|
+
|
|
52
|
+
设置 `customKeyboard` 属性可以使用自定义键盘输入,如果 `focused` 属性为真则会显示聚焦状态。
|
|
53
|
+
|
|
54
|
+
@code('${DEMO_PATH}/password-input/demo/CustomKeyboard.vue')
|
|
55
|
+
|
|
56
|
+
## API
|
|
57
|
+
|
|
58
|
+
### PasswordInputProps
|
|
59
|
+
|
|
60
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
61
|
+
| --------------------- | ------------------ | ----------------------- | -------- |
|
|
62
|
+
| root-class | 组件根元素类名 | string | - |
|
|
63
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
64
|
+
| model-value (v-model) | 密码输入框值 | string | - |
|
|
65
|
+
| length | 密码长度 | number | 6 |
|
|
66
|
+
| type | 密码输入框类型 | 'border' \| 'underline' | 'border' |
|
|
67
|
+
| gap | 密码输入框项间距 | number \| string | - |
|
|
68
|
+
| plain-text | 是否明文显示 | boolean | false |
|
|
69
|
+
| focused (v-model) | 是否获取焦点 | boolean | false |
|
|
70
|
+
| custom-keyboard | 是否使用自定义键盘 | boolean | false |
|
|
71
|
+
| disabled | 禁用状态 | boolean | false |
|
|
72
|
+
| readonly | 只读状态 | boolean | false |
|
|
73
|
+
| validate-event | 是否触发表单验证 | boolean | true |
|
|
74
|
+
|
|
75
|
+
### PasswordInputEmits
|
|
76
|
+
|
|
77
|
+
| 事件 | 描述 | 类型 |
|
|
78
|
+
| ------------------------ | --------------------- | -------------------------- |
|
|
79
|
+
| update:model-value | 输入框值改变时触发 | (value: string) => void |
|
|
80
|
+
| change <sup>1.9.2+</sup> | 输入框值改变时触发 | (value: string) => void |
|
|
81
|
+
| updat:focused | 输入框聚焦/失焦时触发 | (focused: boolean) => void |
|
|
82
|
+
|
|
83
|
+
## 主题定制
|
|
84
|
+
|
|
85
|
+
### CSS 变量
|
|
86
|
+
|
|
87
|
+
@code('./variables.scss#variables')
|
|
@@ -40,6 +40,23 @@ import { useFormContext, useFormItemContext } from "../form/common";
|
|
|
40
40
|
import {
|
|
41
41
|
defaultPasswordInputProps
|
|
42
42
|
} from "./common";
|
|
43
|
+
/**
|
|
44
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
45
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
46
|
+
* @property {string} modelValue 密码输入框值,默认值:-。
|
|
47
|
+
* @property {number} length 密码长度,默认值:6。
|
|
48
|
+
* @property {'border' | 'underline'} type 密码输入框类型,默认值:'border'。
|
|
49
|
+
* @property {number | string} gap 密码输入框项间距,默认值:-。
|
|
50
|
+
* @property {boolean} plainText 是否明文显示,默认值:false。
|
|
51
|
+
* @property {boolean} focused 是否获取焦点,默认值:false。
|
|
52
|
+
* @property {boolean} customKeyboard 是否使用自定义键盘,默认值:false。
|
|
53
|
+
* @property {boolean} disabled 禁用状态,默认值:false。
|
|
54
|
+
* @property {boolean} readonly 只读状态,默认值:false。
|
|
55
|
+
* @property {boolean} validateEvent 是否触发表单验证,默认值:true。
|
|
56
|
+
* @event {(value: string) => void} update 输入框值改变时触发
|
|
57
|
+
* @event {(value: string) => void} change 输入框值改变时触发
|
|
58
|
+
* @event {(focused: boolean) => void} updat 输入框聚焦/失焦时触发
|
|
59
|
+
*/
|
|
43
60
|
export default _defineComponent({
|
|
44
61
|
...{
|
|
45
62
|
options: {
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Picker
|
|
4
|
+
subtitle: 选择器
|
|
5
|
+
group: 表单组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
一个或多个可滚动列表选择器。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Picker from 'sard-uniapp/components/picker/picker.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
通过 `v-model` 绑定当前值,通过 `columns` 配置选项数据。
|
|
23
|
+
|
|
24
|
+
@code('${DEMO_PATH}/picker/demo/Basic.vue')
|
|
25
|
+
|
|
26
|
+
### 对象类型
|
|
27
|
+
|
|
28
|
+
列的每一项可以为一个对象,使用 `optionKeys` 属性可以指定对象中哪个属性值为选中的值,哪个属性值为要显示的标签。
|
|
29
|
+
|
|
30
|
+
@code('${DEMO_PATH}/picker/demo/ObjectOption.vue')
|
|
31
|
+
|
|
32
|
+
### 多列
|
|
33
|
+
|
|
34
|
+
当 `columns` 属性值为一个二维数组时会显示为多列。
|
|
35
|
+
|
|
36
|
+
@code('${DEMO_PATH}/picker/demo/Multiple.vue')
|
|
37
|
+
|
|
38
|
+
### 对象类型多列
|
|
39
|
+
|
|
40
|
+
`columns` 属性值为对象类型的二维数组。
|
|
41
|
+
|
|
42
|
+
@code('${DEMO_PATH}/picker/demo/ObjectMultiple.vue')
|
|
43
|
+
|
|
44
|
+
### 级联选择
|
|
45
|
+
|
|
46
|
+
当 `columns` 第一个元素为对象且其 `children` 属性值为数组时会被当作级联选择。
|
|
47
|
+
|
|
48
|
+
@code('${DEMO_PATH}/picker/demo/Cascaded.vue')
|
|
49
|
+
|
|
50
|
+
### 插槽
|
|
51
|
+
|
|
52
|
+
可通过 `custom` 插槽自定义每一个选项的内容。
|
|
53
|
+
|
|
54
|
+
@info
|
|
55
|
+
|
|
56
|
+
因小程序不支持循环中的插槽,因此循环逻辑要自行实现;
|
|
57
|
+
|
|
58
|
+
因 `picker-view-column` 要为 `picker-view` 的直接子元素,因此要把 `picker-view` 提取出来,要自行绑定属性和事件。
|
|
59
|
+
|
|
60
|
+
@endinfo
|
|
61
|
+
|
|
62
|
+
@code('${DEMO_PATH}/picker/demo/Slot.vue')
|
|
63
|
+
|
|
64
|
+
## API
|
|
65
|
+
|
|
66
|
+
### PickerProps
|
|
67
|
+
|
|
68
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
69
|
+
| ---------------- | -------------------------------------------------- | ---------------------------------- | ------------------------------------------------------ |
|
|
70
|
+
| root-class | 组件根元素类名 | string | - |
|
|
71
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
72
|
+
| columns | 配置每一列的数据 | PickerOption[] \| PickerOption[][] | [] |
|
|
73
|
+
| option-keys | 自定义 `columns` 结构中的字段 | PickerOptionKeys | {label: 'label', value: 'value', children: 'children'} |
|
|
74
|
+
| model-value | 选中项的值 | any | - |
|
|
75
|
+
| immediate-change | 是否在手指松开时立即触发 `update:model-value` 事件 | boolean | false |
|
|
76
|
+
|
|
77
|
+
### PickerSlots
|
|
78
|
+
|
|
79
|
+
| 插槽 | 描述 | 属性 |
|
|
80
|
+
| ----------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| custom <sup>1.17+</sup> | 自定义选项的内容 | { columns: any[][]; value: number[]; pickerViewClass: string; maskClass: string; indicatorClass: string; onChange: (event: any) => void;} |
|
|
82
|
+
|
|
83
|
+
### PickerEmits
|
|
84
|
+
|
|
85
|
+
| 事件 | 描述 | 类型 |
|
|
86
|
+
| ------------------------ | -------------------- | ------------------------------------------------------------------------ |
|
|
87
|
+
| update:model-value | 选中的选项改变时触发 | (value: any, selectedOptions: PickerOption[], indexes: number[]) => void |
|
|
88
|
+
| change <sup>1.9.2+</sup> | 选中的选项改变时触发 | (value: any, selectedOptions: PickerOption[], indexes: number[]) => void |
|
|
89
|
+
|
|
90
|
+
### PickerOption
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
type PickerOption =
|
|
94
|
+
| {
|
|
95
|
+
[key: PropertyKey]: any
|
|
96
|
+
}
|
|
97
|
+
| number
|
|
98
|
+
| string
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### PickerOptionKeys
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
interface PickerOptionKeys {
|
|
105
|
+
label?: string
|
|
106
|
+
value?: string
|
|
107
|
+
children?: string
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 主题定制
|
|
112
|
+
|
|
113
|
+
### CSS 变量
|
|
114
|
+
|
|
115
|
+
@code('./variables.scss#variables')
|
|
@@ -47,4 +47,4 @@ export declare function getOptionsByIndexes(indexes: number[], columns: PickerOp
|
|
|
47
47
|
export declare function getCascaderValidIndexes(indexes: number[], columns: PickerOption[] | PickerOption[][], optionKeys: Required<PickerOptionKeys>): number[];
|
|
48
48
|
export declare function getMaySingleValueByOptions(options: PickerOption[], optionKeys: Required<PickerOptionKeys>, columns: PickerOption[] | PickerOption[][]): string | number | (string | number)[];
|
|
49
49
|
export declare function getIndexesByValue(value: any[], columns: PickerOption[] | PickerOption[][], optionKeys: Required<PickerOptionKeys>): number[];
|
|
50
|
-
export declare function getInitialValue(columns: PickerOption[] | PickerOption[][], optionKeys: Required<PickerOptionKeys>): string | number | (
|
|
50
|
+
export declare function getInitialValue(columns: PickerOption[] | PickerOption[][], optionKeys: Required<PickerOptionKeys>): (string | number | (PickerOption | PickerOption[])[])[];
|
|
@@ -91,20 +91,32 @@ export function getIndexesByValue(value, columns, optionKeys) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
export function getInitialValue(columns, optionKeys) {
|
|
94
|
-
function recurse(columns) {
|
|
94
|
+
function recurse(columns, options) {
|
|
95
95
|
const option = columns[0];
|
|
96
|
+
options.push(option);
|
|
96
97
|
const nextColumn = option?.[optionKeys.children];
|
|
97
98
|
if (Array.isArray(nextColumn) && nextColumn.length > 0) {
|
|
98
|
-
return recurse(nextColumn);
|
|
99
|
+
return recurse(nextColumn, options);
|
|
99
100
|
}
|
|
100
101
|
return option;
|
|
101
102
|
}
|
|
102
103
|
switch (getColumnsType(columns, optionKeys)) {
|
|
103
104
|
case 'single':
|
|
104
|
-
return
|
|
105
|
+
return [
|
|
106
|
+
getValueOrLabelByOption(columns[0], optionKeys.value),
|
|
107
|
+
[columns[0]],
|
|
108
|
+
];
|
|
105
109
|
case 'multi':
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
return [
|
|
111
|
+
columns.map((column) => getValueOrLabelByOption(column[0], optionKeys.value)),
|
|
112
|
+
columns.map((column) => column[0]),
|
|
113
|
+
];
|
|
114
|
+
case 'cascader': {
|
|
115
|
+
const options = [];
|
|
116
|
+
return [
|
|
117
|
+
getValueOrLabelByOption(recurse(columns, options), optionKeys.value),
|
|
118
|
+
options,
|
|
119
|
+
];
|
|
120
|
+
}
|
|
109
121
|
}
|
|
110
122
|
}
|
|
@@ -38,8 +38,8 @@ import {
|
|
|
38
38
|
nestedToMulti,
|
|
39
39
|
toArray,
|
|
40
40
|
arrayEqual,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
isNumber,
|
|
42
|
+
isEmptyBinding
|
|
43
43
|
} from "../../utils";
|
|
44
44
|
import {
|
|
45
45
|
defaultOptionKeys,
|
|
@@ -52,6 +52,16 @@ import {
|
|
|
52
52
|
defaultPickerProps
|
|
53
53
|
} from "./common";
|
|
54
54
|
import SarPickerItem from "../picker-item/picker-item.vue";
|
|
55
|
+
/**
|
|
56
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
57
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
58
|
+
* @property {PickerOption[] | PickerOption[][]} columns 配置每一列的数据,默认值:[]。
|
|
59
|
+
* @property {PickerOptionKeys} optionKeys 自定义 `columns` 结构中的字段,默认值:{label: 'label', value: 'value', children: 'children'}。
|
|
60
|
+
* @property {any} modelValue 选中项的值,默认值:-。
|
|
61
|
+
* @property {boolean} immediateChange 是否在手指松开时立即触发 `update:model-value` 事件,默认值:false。
|
|
62
|
+
* @event {(value: any, selectedOptions: PickerOption[], indexes: number[]) => void} update 选中的选项改变时触发
|
|
63
|
+
* @event {(value: any, selectedOptions: PickerOption[], indexes: number[]) => void} change 选中的选项改变时触发
|
|
64
|
+
*/
|
|
55
65
|
export default _defineComponent({
|
|
56
66
|
components: {
|
|
57
67
|
SarPickerItem,
|
|
@@ -92,18 +102,21 @@ export default _defineComponent({
|
|
|
92
102
|
}
|
|
93
103
|
);
|
|
94
104
|
const columnIndexes = ref([]);
|
|
105
|
+
const updateColumnIndexes = () => {
|
|
106
|
+
const indexes = getIndexesByValue(
|
|
107
|
+
toArray(innerValue.value),
|
|
108
|
+
props.columns,
|
|
109
|
+
fieldKeys.value
|
|
110
|
+
);
|
|
111
|
+
if (!arrayEqual(indexes, columnIndexes.value)) {
|
|
112
|
+
columnIndexes.value = indexes;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
95
115
|
watch(
|
|
96
116
|
[innerValue, () => props.columns, fieldKeys],
|
|
97
117
|
() => {
|
|
98
|
-
if (!
|
|
99
|
-
|
|
100
|
-
toArray(innerValue.value),
|
|
101
|
-
props.columns,
|
|
102
|
-
fieldKeys.value
|
|
103
|
-
);
|
|
104
|
-
if (!arrayEqual(indexes, columnIndexes.value)) {
|
|
105
|
-
columnIndexes.value = indexes;
|
|
106
|
-
}
|
|
118
|
+
if (!isEmptyBinding(innerValue.value)) {
|
|
119
|
+
updateColumnIndexes();
|
|
107
120
|
}
|
|
108
121
|
},
|
|
109
122
|
{
|
|
@@ -114,7 +127,7 @@ export default _defineComponent({
|
|
|
114
127
|
let indexes = event.detail.value;
|
|
115
128
|
if (indexes.some((index) => index === Infinity)) {
|
|
116
129
|
nextTick(() => {
|
|
117
|
-
columnIndexes.value =
|
|
130
|
+
columnIndexes.value = isEmptyBinding(innerValue.value) ? columnIndexes.value.map(() => 0) : [...columnIndexes.value];
|
|
118
131
|
});
|
|
119
132
|
return;
|
|
120
133
|
}
|
|
@@ -173,11 +186,23 @@ export default _defineComponent({
|
|
|
173
186
|
}
|
|
174
187
|
};
|
|
175
188
|
const renderedColumns = ref(getRenderedColumns());
|
|
189
|
+
const updateRenderedColumns = () => {
|
|
190
|
+
renderedColumns.value = getRenderedColumns();
|
|
191
|
+
};
|
|
176
192
|
watch(
|
|
177
193
|
[() => props.columns, innerValue],
|
|
178
194
|
([newColumns, newValue], [oldColumns, oldValue]) => {
|
|
179
|
-
if (newColumns !== oldColumns || newValue !== oldValue && columnsType.value === "cascader" && !
|
|
180
|
-
|
|
195
|
+
if (newColumns !== oldColumns || newValue !== oldValue && columnsType.value === "cascader" && !isEmptyBinding(newValue) && (!Array.isArray(newValue) || newValue.length > 0)) {
|
|
196
|
+
updateRenderedColumns();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
watch(
|
|
201
|
+
() => props.modelValue,
|
|
202
|
+
() => {
|
|
203
|
+
if (isEmptyBinding(props.modelValue)) {
|
|
204
|
+
updateColumnIndexes();
|
|
205
|
+
updateRenderedColumns();
|
|
181
206
|
}
|
|
182
207
|
}
|
|
183
208
|
);
|
|
@@ -193,7 +218,7 @@ export default _defineComponent({
|
|
|
193
218
|
const pickerViewClass = bem.e("picker-view");
|
|
194
219
|
const indicatorClass = bem.e("indicator");
|
|
195
220
|
const maskClass = bem.e("mask");
|
|
196
|
-
const __returned__ = { props, emit, bem, fieldKeys, columnsType, innerValue, columnIndexes, onChange, getRenderedColumns, renderedColumns, getLabelByOption, pickerClass, pickerStyle, pickerViewClass, indicatorClass, maskClass, get isNumber() {
|
|
221
|
+
const __returned__ = { props, emit, bem, fieldKeys, columnsType, innerValue, columnIndexes, updateColumnIndexes, onChange, getRenderedColumns, renderedColumns, updateRenderedColumns, getLabelByOption, pickerClass, pickerStyle, pickerViewClass, indicatorClass, maskClass, get isNumber() {
|
|
197
222
|
return isNumber;
|
|
198
223
|
}, SarPickerItem };
|
|
199
224
|
return __returned__;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: PickerInput
|
|
4
|
+
subtitle: 选择器输入框
|
|
5
|
+
group: 表单组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
组合了选择器弹出框、输入框组件,实现了便捷快速的选择功能。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import PickerInput from 'sard-uniapp/components/picker-input/picker-input.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
使用 `v-model` 绑定当前值,通过 `title` 和 `placeholder` 属性设置弹出框标题和输入框占位文本。
|
|
23
|
+
|
|
24
|
+
在点击输入框后会显示包裹选择器的弹出框。
|
|
25
|
+
|
|
26
|
+
@code('${DEMO_PATH}/picker-input/demo/Basic.vue')
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### PickerInputProps
|
|
31
|
+
|
|
32
|
+
继承 [`PickerPopoutProps`](./picker-popout#PickerPopoutProps) 并有以下额外属性:
|
|
33
|
+
|
|
34
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
35
|
+
| --------------------------------- | ---------------------- | ---------- | --------------- |
|
|
36
|
+
| root-class | 弹出式输入框根元素类名 | string | - |
|
|
37
|
+
| root-style | 弹出式输入框根元素样式 | StyleValue | - |
|
|
38
|
+
| disabled | 禁用状态 | boolean | false |
|
|
39
|
+
| readonly | 只读状态 | boolean | false |
|
|
40
|
+
| loading | 加载状态 | boolean | false |
|
|
41
|
+
| clearable | 是否显示清空按钮 | boolean | false |
|
|
42
|
+
| placeholder | 输入框占位符内容 | string | - |
|
|
43
|
+
| value-on-clear <sup>1.19.2+</sup> | 设置点击清除按钮后的值 | () => any | () => undefined |
|
|
44
|
+
|
|
45
|
+
### PickerSlots
|
|
46
|
+
|
|
47
|
+
继承 [`PickerPopoutSlots`](./picker-popout#PickerPopoutSlots)
|
|
48
|
+
|
|
49
|
+
### PickerInputEmits
|
|
50
|
+
|
|
51
|
+
继承 [`PickerPopoutEmits`](./picker-popout#PickerPopoutEmits) 并有以下额外属性:
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type PopoutInputProps } from '../popout-input/common';
|
|
2
2
|
import { type PickerPopoutSlots, type PickerPopoutEmits, type PickerPopoutProps } from '../picker-popout/common';
|
|
3
3
|
export interface PickerInputProps extends PickerPopoutProps, Omit<PopoutInputProps, 'modelValue'> {
|
|
4
|
+
valueOnClear?: () => any;
|
|
4
5
|
}
|
|
5
6
|
export declare const defaultPickerInputProps: () => {
|
|
7
|
+
valueOnClear: PickerInputProps["valueOnClear"];
|
|
6
8
|
validateEvent: boolean;
|
|
7
9
|
columns: () => never[];
|
|
8
10
|
immediateChange: boolean;
|
|
@@ -10,8 +10,9 @@ declare const __VLS_component: import("vue").DefineComponent<PickerInputProps, {
|
|
|
10
10
|
onChange?: ((value: any) => any) | undefined;
|
|
11
11
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
|
-
|
|
13
|
+
valueOnClear: () => any;
|
|
14
14
|
validateEvent: boolean;
|
|
15
|
+
columns: PickerOption[] | PickerOption[][];
|
|
15
16
|
immediateChange: boolean;
|
|
16
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
18
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
@@ -60,11 +60,32 @@ import {
|
|
|
60
60
|
getOptionsByIndexes,
|
|
61
61
|
getValueOrLabelByOption
|
|
62
62
|
} from "../picker/common";
|
|
63
|
-
import {
|
|
63
|
+
import { isEmptyBinding, toArray } from "../../utils";
|
|
64
64
|
import { usePopoutInput } from "../../use";
|
|
65
65
|
import {
|
|
66
66
|
defaultPickerInputProps
|
|
67
67
|
} from "./common";
|
|
68
|
+
/**
|
|
69
|
+
* @property {string} rootClass 弹出式输入框根元素类名,默认值:-。
|
|
70
|
+
* @property {StyleValue} rootStyle 弹出式输入框根元素样式,默认值:-。
|
|
71
|
+
* @property {PickerOption[] | PickerOption[][]} columns 配置每一列的数据,默认值:[]。
|
|
72
|
+
* @property {PickerOptionKeys} optionKeys 自定义 `columns` 结构中的字段,默认值:{label: 'label', value: 'value', children: 'children'}。
|
|
73
|
+
* @property {any} modelValue 选中项的值,默认值:-。
|
|
74
|
+
* @property {boolean} immediateChange 是否在手指松开时立即触发 `update:model-value` 事件,默认值:false。
|
|
75
|
+
* @property {string} popoutClass 弹窗框根元素类名,默认值:-。
|
|
76
|
+
* @property {StyleValue} popoutStyle 弹窗框根元素样式,默认值:-。
|
|
77
|
+
* @property {boolean} visible 是否显示弹出框,默认值:-。
|
|
78
|
+
* @property {string} title 弹出框标题,默认值:-。
|
|
79
|
+
* @property {boolean} validateEvent 是否触发表单验证,默认值:true。
|
|
80
|
+
* @property {boolean} disabled 禁用状态,默认值:false。
|
|
81
|
+
* @property {boolean} readonly 只读状态,默认值:false。
|
|
82
|
+
* @property {boolean} loading 加载状态,默认值:false。
|
|
83
|
+
* @property {boolean} clearable 是否显示清空按钮,默认值:false。
|
|
84
|
+
* @property {string} placeholder 输入框占位符内容,默认值:-。
|
|
85
|
+
* @property {() => any} valueOnClear 设置点击清除按钮后的值,默认值:() => undefined。
|
|
86
|
+
* @event {(visible: boolean) => void} update 弹出框显隐时触发
|
|
87
|
+
* @event {(value: any) => void} change 选择器输入组件值改变时触发
|
|
88
|
+
*/
|
|
68
89
|
export default _defineComponent({
|
|
69
90
|
components: {
|
|
70
91
|
SarPopoutInput,
|
|
@@ -78,6 +99,7 @@ export default _defineComponent({
|
|
|
78
99
|
},
|
|
79
100
|
__name: "picker-input",
|
|
80
101
|
props: _mergeDefaults({
|
|
102
|
+
valueOnClear: { type: Function, required: false },
|
|
81
103
|
visible: { type: Boolean, required: false },
|
|
82
104
|
title: { type: String, required: false },
|
|
83
105
|
validateEvent: { type: Boolean, required: false },
|
|
@@ -115,7 +137,7 @@ export default _defineComponent({
|
|
|
115
137
|
return labels.join("/");
|
|
116
138
|
}
|
|
117
139
|
function getInputValue() {
|
|
118
|
-
if (
|
|
140
|
+
if (isEmptyBinding(innerValue.value)) {
|
|
119
141
|
return "";
|
|
120
142
|
}
|
|
121
143
|
return getOutletText(props.columns, fieldKeys.value, innerValue.value);
|