@tdesign/uniapp 0.7.2 → 0.8.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 +31 -0
- package/README.md +32 -2
- package/dist/action-sheet/README.md +1 -1
- package/dist/action-sheet/action-sheet.vue +158 -150
- package/dist/action-sheet/props.ts +2 -2
- package/dist/action-sheet/type.ts +1 -1
- package/dist/avatar/avatar.vue +89 -87
- package/dist/avatar-group/avatar-group.vue +69 -67
- package/dist/back-top/back-top.vue +60 -58
- package/dist/badge/badge.vue +69 -59
- package/dist/button/button.vue +121 -116
- package/dist/button/props.ts +2 -2
- package/dist/button/type.ts +1 -1
- package/dist/calendar/calendar-header.vue +4 -4
- package/dist/calendar/calendar.vue +308 -297
- package/dist/calendar/template.vue +1 -1
- package/dist/cascader/README.en-US.md +2 -1
- package/dist/cascader/README.md +2 -1
- package/dist/cascader/cascader.vue +340 -328
- package/dist/cascader/props.ts +6 -1
- package/dist/cascader/type.ts +6 -0
- package/dist/cell/cell.vue +127 -121
- package/dist/cell-group/cell-group.vue +32 -30
- package/dist/check-tag/check-tag.vue +73 -71
- package/dist/checkbox/README.en-US.md +6 -6
- package/dist/checkbox/README.md +5 -5
- package/dist/checkbox/checkbox.vue +127 -127
- package/dist/checkbox/props.ts +6 -6
- package/dist/checkbox/type.ts +6 -4
- package/dist/checkbox-group/checkbox-group.vue +175 -173
- package/dist/checkbox-group/props.ts +6 -6
- package/dist/checkbox-group/type.ts +6 -4
- package/dist/col/col.vue +26 -24
- package/dist/collapse/collapse.vue +83 -81
- package/dist/collapse-panel/collapse-panel.vue +121 -119
- package/dist/collapse-panel/props.ts +4 -4
- package/dist/collapse-panel/type.ts +2 -2
- package/dist/color-picker/README.md +1 -1
- package/dist/color-picker/color-picker.vue +324 -322
- package/dist/color-picker/props.ts +2 -2
- package/dist/color-picker/template.vue +14 -10
- package/dist/common/common.ts +1 -0
- package/dist/common/style/theme/index.css +57 -61
- package/dist/common/utils.js +7 -2
- package/dist/common/validator.js +172 -0
- package/dist/config-provider/README.en-US.md +184 -0
- package/dist/config-provider/README.md +234 -0
- package/dist/config-provider/config-provider.vue +105 -0
- package/dist/config-provider/config-store.js +70 -0
- package/dist/config-provider/props.ts +16 -0
- package/dist/config-provider/reactive-state.js +39 -0
- package/dist/config-provider/type.ts +401 -0
- package/dist/config-provider/use-config.js +29 -0
- package/dist/config-provider/utils.js +29 -0
- package/dist/count-down/count-down.vue +98 -97
- package/dist/date-time-picker/date-time-picker.vue +410 -395
- package/dist/demo/demo.vue +1 -0
- package/dist/dialog/dialog.vue +176 -173
- package/dist/divider/divider.vue +38 -36
- package/dist/draggable/draggable.vue +60 -58
- package/dist/drawer/README.md +1 -1
- package/dist/drawer/drawer.vue +48 -46
- package/dist/dropdown-item/dropdown-item.vue +209 -207
- package/dist/dropdown-item/props.ts +4 -4
- package/dist/dropdown-item/type.ts +3 -3
- package/dist/dropdown-menu/dropdown-menu.vue +93 -99
- package/dist/empty/empty.vue +43 -42
- package/dist/fab/fab.vue +88 -86
- package/dist/footer/footer.vue +36 -34
- package/dist/form/README.en-US.md +17 -24
- package/dist/form/README.md +18 -25
- package/dist/form/form.css +1 -166
- package/dist/form/form.vue +251 -236
- package/dist/form/props.ts +2 -21
- package/dist/form/type.ts +7 -70
- package/dist/form-item/README.en-US.md +4 -5
- package/dist/form-item/README.md +4 -5
- package/dist/form-item/form-item.css +69 -96
- package/dist/form-item/form-item.vue +315 -336
- package/dist/form-item/form-model.ts +125 -173
- package/dist/form-item/props.ts +4 -17
- package/dist/form-item/type.ts +43 -1
- package/dist/grid/grid.vue +53 -51
- package/dist/grid-item/grid-item.vue +121 -119
- package/dist/guide/README.md +1 -1
- package/dist/guide/guide.vue +281 -277
- package/dist/icon/README.md +2 -4
- package/dist/icon/icon.vue +78 -76
- package/dist/image/README.md +1 -1
- package/dist/image/image.vue +103 -101
- package/dist/image-viewer/image-viewer.vue +160 -158
- package/dist/image-viewer/props.ts +2 -2
- package/dist/image-viewer/type.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/indexes/indexes.vue +264 -267
- package/dist/indexes-anchor/indexes-anchor.vue +41 -41
- package/dist/input/input.vue +192 -192
- package/dist/input/props.ts +6 -6
- package/dist/input/type.ts +3 -3
- package/dist/link/link.vue +73 -71
- package/dist/loading/loading.vue +59 -59
- package/dist/locale/ar_KW.ts +157 -0
- package/dist/locale/en_US.ts +146 -0
- package/dist/locale/it_IT.ts +145 -0
- package/dist/locale/ja_JP.ts +132 -0
- package/dist/locale/ko_KR.ts +132 -0
- package/dist/locale/ru_RU.ts +157 -0
- package/dist/locale/zh_CN.ts +133 -0
- package/dist/locale/zh_TW.ts +132 -0
- package/dist/message/message.vue +181 -173
- package/dist/message/props.ts +2 -2
- package/dist/message/type.ts +1 -1
- package/dist/message-item/message-item.vue +192 -184
- package/dist/mixins/using-config.js +39 -0
- package/dist/navbar/navbar.vue +201 -199
- package/dist/notice-bar/notice-bar.vue +175 -171
- package/dist/notice-bar/props.ts +2 -2
- package/dist/notice-bar/type.ts +1 -1
- package/dist/npm/dayjs/esm/locale/ar.js +81 -0
- package/dist/npm/dayjs/esm/locale/it.js +39 -0
- package/dist/overlay/overlay.vue +50 -48
- package/dist/picker/picker.vue +168 -161
- package/dist/picker-item/picker-item.vue +269 -269
- package/dist/popover/README.md +1 -1
- package/dist/popover/popover.vue +262 -261
- package/dist/popover/props.ts +4 -4
- package/dist/popover/type.ts +2 -2
- package/dist/popup/popup.vue +46 -45
- package/dist/progress/README.md +1 -1
- package/dist/progress/progress.vue +76 -76
- package/dist/pull-down-refresh/props.ts +2 -2
- package/dist/pull-down-refresh/pull-down-refresh.vue +240 -234
- package/dist/pull-down-refresh/type.ts +1 -1
- package/dist/qrcode/README.md +1 -1
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +340 -338
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +6 -6
- package/dist/qrcode/qrcode.vue +93 -87
- package/dist/radio/props.ts +6 -6
- package/dist/radio/radio.vue +118 -120
- package/dist/radio/type.ts +3 -3
- package/dist/radio-group/props.ts +4 -4
- package/dist/radio-group/radio-group.vue +136 -134
- package/dist/radio-group/type.ts +4 -4
- package/dist/rate/computed.js +2 -2
- package/dist/rate/props.ts +4 -4
- package/dist/rate/rate.vue +155 -154
- package/dist/rate/type.ts +2 -2
- package/dist/result/result.vue +41 -39
- package/dist/row/row.vue +38 -36
- package/dist/scroll-view/scroll-view.vue +24 -22
- package/dist/search/props.ts +2 -2
- package/dist/search/search.vue +127 -125
- package/dist/search/type.ts +1 -1
- package/dist/side-bar/side-bar.vue +57 -55
- package/dist/side-bar-item/side-bar-item.vue +86 -86
- package/dist/skeleton/skeleton.vue +126 -124
- package/dist/slider/README.md +1 -1
- package/dist/slider/props.ts +2 -2
- package/dist/slider/slider.vue +457 -457
- package/dist/slider/type.ts +1 -1
- package/dist/step-item/step-item.vue +77 -75
- package/dist/stepper/props.ts +2 -2
- package/dist/stepper/stepper.vue +168 -149
- package/dist/stepper/type.ts +1 -1
- package/dist/steps/props.ts +2 -2
- package/dist/steps/steps.vue +83 -81
- package/dist/steps/type.ts +1 -1
- package/dist/sticky/sticky.vue +104 -102
- package/dist/swipe-cell/swipe-cell.vue +91 -89
- package/dist/swiper/README.md +1 -1
- package/dist/swiper/swiper.vue +91 -89
- package/dist/swiper-nav/swiper-nav.vue +38 -36
- package/dist/switch/props.ts +2 -2
- package/dist/switch/switch.vue +62 -62
- package/dist/switch/type.ts +1 -1
- package/dist/tab-bar/tab-bar.vue +88 -86
- package/dist/tab-bar-item/tab-bar-item.vue +85 -82
- package/dist/tab-panel/tab-panel.vue +66 -64
- package/dist/tabs/tabs.vue +294 -287
- package/dist/tag/tag.vue +79 -77
- package/dist/textarea/props.ts +6 -6
- package/dist/textarea/textarea.vue +127 -126
- package/dist/textarea/type.ts +3 -3
- package/dist/toast/toast.vue +107 -106
- package/dist/transition/transition.vue +30 -28
- package/dist/tree-select/tree-select.vue +151 -151
- package/dist/types/config-provider.d.ts +7 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/popover.d.ts +7 -0
- package/dist/upload/README.en-US.md +13 -14
- package/dist/upload/README.md +11 -12
- package/dist/upload/props.ts +2 -4
- package/dist/upload/type.ts +12 -11
- package/dist/upload/upload.css +1 -1
- package/dist/upload/upload.vue +672 -512
- package/dist/watermark/watermark.vue +151 -149
- package/global.d.ts +2 -0
- package/package.json +16 -2
- package/dist/form/form-item-props.ts +0 -56
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
3
|
:id="tId"
|
|
4
|
-
:style="tools._style([customStyle])"
|
|
5
|
-
:class="tools.cls(classPrefix, [placement, theme, ['checked', dataChecked], ['block', block], ['disabled', iDisabled]]) + ' ' + tClass"
|
|
4
|
+
:style="'' + tools._style([customStyle])"
|
|
5
|
+
:class="'' + tools.cls(classPrefix, [placement, theme, ['checked', dataChecked], ['block', block], ['disabled', iDisabled]]) + ' ' + tClass"
|
|
6
6
|
aria-role="checkbox"
|
|
7
7
|
:aria-checked="dataChecked ? (dataIndeterminate ? 'mixed' : true) : false"
|
|
8
8
|
:aria-disabled="iDisabled ? true : false"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
>
|
|
11
11
|
<view
|
|
12
12
|
v-if="theme == 'default'"
|
|
13
|
-
:class="tools.cls(classPrefix + '__icon', [placement, ['checked', dataChecked], ['disabled', iDisabled]]) + ' ' + tClassIcon"
|
|
13
|
+
:class="'' + tools.cls(classPrefix + '__icon', [placement, ['checked', dataChecked], ['disabled', iDisabled]]) + ' ' + tClassIcon"
|
|
14
14
|
>
|
|
15
15
|
<slot
|
|
16
16
|
v-if="icon === 'slot'"
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
<t-icon
|
|
30
30
|
v-if="dataChecked && (icon == 'circle' || icon == 'rectangle')"
|
|
31
31
|
:name="dataIndeterminate ? 'minus-' + icon + '-filled' : 'check-' + icon + '-filled'"
|
|
32
|
-
:class="tools.cls(classPrefix + '__icon-wrapper', [])"
|
|
32
|
+
:class="'' + tools.cls(classPrefix + '__icon-wrapper', [])"
|
|
33
33
|
/>
|
|
34
34
|
<t-icon
|
|
35
35
|
v-if="dataChecked && icon == 'line'"
|
|
36
36
|
:name="dataIndeterminate ? 'minus-' + icon + '-filled' : 'check'"
|
|
37
|
-
:class="tools.cls(classPrefix + '__icon-wrapper', [])"
|
|
37
|
+
:class="'' + tools.cls(classPrefix + '__icon-wrapper', [])"
|
|
38
38
|
/>
|
|
39
39
|
<view
|
|
40
40
|
v-else-if="!dataChecked && (icon == 'circle' || icon == 'rectangle')"
|
|
41
|
-
:class="tools.cls(classPrefix + '__icon-' + icon, [['disabled', iDisabled]])"
|
|
41
|
+
:class="'' + tools.cls(classPrefix + '__icon-' + icon, [['disabled', iDisabled]])"
|
|
42
42
|
/>
|
|
43
43
|
<view
|
|
44
44
|
v-if="!dataChecked && icon == 'line'"
|
|
@@ -52,14 +52,12 @@
|
|
|
52
52
|
@click.stop="handleTap"
|
|
53
53
|
>
|
|
54
54
|
<view
|
|
55
|
-
:class="
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
tClassLabel
|
|
62
|
-
"
|
|
55
|
+
:class="'' + tools.cls(classPrefix + '__title', [
|
|
56
|
+
['disabled', iDisabled],
|
|
57
|
+
['checked', dataChecked]
|
|
58
|
+
]) +
|
|
59
|
+
' ' +
|
|
60
|
+
tClassLabel"
|
|
63
61
|
:style="'-webkit-line-clamp:' + maxLabelRow"
|
|
64
62
|
>
|
|
65
63
|
<block v-if="label">
|
|
@@ -69,7 +67,7 @@
|
|
|
69
67
|
<slot name="label" />
|
|
70
68
|
</view>
|
|
71
69
|
<view
|
|
72
|
-
:class="tools.cls(classPrefix + '__description', [['disabled', iDisabled]]) + ' ' + tClassContent"
|
|
70
|
+
:class="'' + tools.cls(classPrefix + '__description', [['disabled', iDisabled]]) + ' ' + tClassContent"
|
|
73
71
|
:style="'-webkit-line-clamp:' + maxContentRow"
|
|
74
72
|
>
|
|
75
73
|
<block v-if="content">
|
|
@@ -80,7 +78,7 @@
|
|
|
80
78
|
</view>
|
|
81
79
|
<view
|
|
82
80
|
v-if="theme == 'default' && !dataBorderless"
|
|
83
|
-
:class="tools.cls(classPrefix + '__border', [placement]) + ' ' + tClassBorder"
|
|
81
|
+
:class="'' + tools.cls(classPrefix + '__border', [placement]) + ' ' + tClassBorder"
|
|
84
82
|
/>
|
|
85
83
|
</view>
|
|
86
84
|
</template>
|
|
@@ -96,141 +94,143 @@ import { ChildrenMixin, RELATION_MAP } from '../common/relation';
|
|
|
96
94
|
|
|
97
95
|
const name = `${prefix}-checkbox`;
|
|
98
96
|
|
|
99
|
-
export default
|
|
100
|
-
name,
|
|
101
|
-
options: {
|
|
102
|
-
styleIsolation: 'shared',
|
|
103
|
-
},
|
|
104
|
-
controlledProps: [
|
|
105
|
-
{
|
|
106
|
-
key: 'checked',
|
|
107
|
-
event: 'change',
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
externalClasses: [
|
|
111
|
-
`${prefix}-class`,
|
|
112
|
-
`${prefix}-class-label`,
|
|
113
|
-
`${prefix}-class-icon`,
|
|
114
|
-
`${prefix}-class-content`,
|
|
115
|
-
`${prefix}-class-border`,
|
|
116
|
-
],
|
|
117
|
-
mixins: [ChildrenMixin(RELATION_MAP.Checkbox)],
|
|
97
|
+
export default {
|
|
118
98
|
components: {
|
|
119
99
|
TIcon,
|
|
120
100
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
default: 'default',
|
|
101
|
+
...uniComponent({
|
|
102
|
+
name,
|
|
103
|
+
options: {
|
|
104
|
+
styleIsolation: 'shared',
|
|
126
105
|
},
|
|
127
|
-
|
|
128
|
-
|
|
106
|
+
controlledProps: [
|
|
107
|
+
{
|
|
108
|
+
key: 'checked',
|
|
109
|
+
event: 'change',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
externalClasses: [
|
|
113
|
+
`${prefix}-class`,
|
|
114
|
+
`${prefix}-class-label`,
|
|
115
|
+
`${prefix}-class-icon`,
|
|
116
|
+
`${prefix}-class-content`,
|
|
117
|
+
`${prefix}-class-border`,
|
|
118
|
+
],
|
|
119
|
+
mixins: [ChildrenMixin(RELATION_MAP.Checkbox)],
|
|
120
|
+
props: {
|
|
121
|
+
...props,
|
|
122
|
+
theme: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: 'default',
|
|
125
|
+
},
|
|
126
|
+
tId: {
|
|
127
|
+
type: String,
|
|
128
|
+
},
|
|
129
129
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
tools,
|
|
130
|
+
data() {
|
|
131
|
+
return {
|
|
132
|
+
prefix,
|
|
133
|
+
classPrefix: name,
|
|
134
|
+
iDisabled: false,
|
|
135
|
+
tools,
|
|
137
136
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
computed: {
|
|
144
|
-
isIsolated() {
|
|
145
|
-
return this.relationKey === ISOLATED_RELATION_KEY;
|
|
137
|
+
dataBorderless: this.borderless,
|
|
138
|
+
dataIndeterminate: this.indeterminate,
|
|
139
|
+
dataChecked: coalesce(this.checked, this.defaultChecked),
|
|
140
|
+
};
|
|
146
141
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
handler(v) {
|
|
151
|
-
this.dataBorderless = v;
|
|
142
|
+
computed: {
|
|
143
|
+
isIsolated() {
|
|
144
|
+
return this.relationKey === ISOLATED_RELATION_KEY;
|
|
152
145
|
},
|
|
153
|
-
immediate: true,
|
|
154
146
|
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
watch: {
|
|
148
|
+
borderless: {
|
|
149
|
+
handler(v) {
|
|
150
|
+
this.dataBorderless = v;
|
|
151
|
+
},
|
|
152
|
+
immediate: true,
|
|
158
153
|
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
154
|
+
indeterminate: {
|
|
155
|
+
handler(v) {
|
|
156
|
+
this.dataIndeterminate = v;
|
|
157
|
+
},
|
|
158
|
+
immediate: true,
|
|
164
159
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
checked: {
|
|
161
|
+
handler(v) {
|
|
162
|
+
this.dataChecked = v;
|
|
163
|
+
},
|
|
164
|
+
immediate: true,
|
|
165
|
+
},
|
|
166
|
+
disabled: {
|
|
167
|
+
handler(v) {
|
|
168
|
+
this.iDisabled = v;
|
|
169
|
+
},
|
|
170
|
+
immediate: true,
|
|
170
171
|
},
|
|
171
|
-
immediate: true,
|
|
172
172
|
},
|
|
173
|
-
|
|
174
|
-
mounted() {
|
|
173
|
+
mounted() {
|
|
175
174
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
},
|
|
176
|
+
methods: {
|
|
177
|
+
innerAfterLinked() {
|
|
178
|
+
if (this.isIsolated) return;
|
|
179
|
+
const parent = this[RELATION_MAP.Checkbox];
|
|
180
|
+
const { value, disabled, borderless } = parent;
|
|
181
|
+
const { dataValue, checked, checkAll, item, dataIndeterminate } = this;
|
|
182
|
+
const valueSet = new Set(value);
|
|
183
|
+
const checkedFromParent = valueSet.has(this.value);
|
|
184
|
+
const data = {
|
|
185
|
+
iDisabled: this.disabled == null ? disabled : this.disabled,
|
|
186
|
+
};
|
|
188
187
|
|
|
189
|
-
|
|
188
|
+
data.dataBorderless = !!(coalesce(this.borderless, borderless));
|
|
190
189
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
190
|
+
data.dataChecked = this.dataChecked || checkedFromParent;
|
|
191
|
+
if (this.dataChecked) {
|
|
192
|
+
parent.updateValue({
|
|
193
|
+
value: dataValue,
|
|
194
|
+
checked,
|
|
195
|
+
checkAll,
|
|
196
|
+
item,
|
|
197
|
+
indeterminate: dataIndeterminate,
|
|
198
|
+
trigger: 'init',
|
|
199
|
+
});
|
|
200
|
+
}
|
|
202
201
|
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
if (this.checkAll) {
|
|
203
|
+
data.dataChecked = valueSet.size > 0;
|
|
205
204
|
// data.indeterminate =
|
|
206
|
-
|
|
205
|
+
}
|
|
207
206
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
207
|
+
Object.keys(data).forEach((key) => {
|
|
208
|
+
this[key] = data[key];
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
handleTap(e) {
|
|
212
|
+
const { iDisabled, readonly, contentDisabled } = this;
|
|
213
|
+
const { target } = e.currentTarget.dataset;
|
|
215
214
|
|
|
216
|
-
|
|
215
|
+
if (iDisabled || readonly || (target === 'text' && contentDisabled)) return;
|
|
217
216
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
const { value, label, checkAll, dataIndeterminate } = this;
|
|
218
|
+
const checked = !this.dataChecked;
|
|
219
|
+
const parent = this[RELATION_MAP.Checkbox];
|
|
221
220
|
|
|
222
221
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
222
|
+
if (parent && !this.isIsolated) {
|
|
223
|
+
parent.updateValue({ value, checkAll, indeterminate: dataIndeterminate, checked, item: { label, value, checked } });
|
|
224
|
+
} else {
|
|
225
|
+
this._trigger('change', { context: { value, label }, checked });
|
|
226
|
+
}
|
|
227
|
+
},
|
|
229
228
|
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
setDisabled(disabled) {
|
|
230
|
+
this.iDisabled = this.disabled || disabled;
|
|
231
|
+
},
|
|
232
232
|
},
|
|
233
|
-
},
|
|
234
|
-
}
|
|
233
|
+
}),
|
|
234
|
+
};
|
|
235
235
|
</script>
|
|
236
236
|
<style scoped src="./checkbox.css"></style>
|
package/dist/checkbox/props.ts
CHANGED
|
@@ -13,8 +13,8 @@ export default {
|
|
|
13
13
|
},
|
|
14
14
|
/** 是否开启无边框模式 */
|
|
15
15
|
borderless: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default:
|
|
16
|
+
type: [Boolean, null],
|
|
17
|
+
default: null as TdCheckboxProps['borderless'],
|
|
18
18
|
},
|
|
19
19
|
/** 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 */
|
|
20
20
|
checkAll: Boolean,
|
|
@@ -30,8 +30,8 @@ export default {
|
|
|
30
30
|
contentDisabled: Boolean,
|
|
31
31
|
/** 是否禁用组件。如果父组件存在 CheckboxGroup,默认值由 CheckboxGroup.disabled 控制。优先级:Checkbox.disabled > CheckboxGroup.disabled > Form.disabled */
|
|
32
32
|
disabled: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default:
|
|
33
|
+
type: [Boolean, null],
|
|
34
|
+
default: null as TdCheckboxProps['disabled'],
|
|
35
35
|
},
|
|
36
36
|
/** 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标,半选中态图标]`。使用 String 时,值为 circle 表示填充圆形图标、值为 line 表示描边型图标、值为 rectangle 表示填充矩形图标 */
|
|
37
37
|
icon: {
|
|
@@ -70,8 +70,8 @@ export default {
|
|
|
70
70
|
},
|
|
71
71
|
/** 只读状态 */
|
|
72
72
|
readonly: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default:
|
|
73
|
+
type: [Boolean, null],
|
|
74
|
+
default: null as TdCheckboxProps['readonly'],
|
|
75
75
|
},
|
|
76
76
|
/** -1 时代表独立,不再寻找 parent,用于头条小程序 */
|
|
77
77
|
relationKey: {
|
package/dist/checkbox/type.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface TdCheckboxProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* 是否开启无边框模式
|
|
15
15
|
*/
|
|
16
|
-
borderless?: boolean;
|
|
16
|
+
borderless?: boolean | null;
|
|
17
17
|
/**
|
|
18
18
|
* 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用
|
|
19
19
|
* @default false
|
|
@@ -38,12 +38,12 @@ export interface TdCheckboxProps {
|
|
|
38
38
|
/**
|
|
39
39
|
* 是否禁用组件。如果父组件存在 CheckboxGroup,默认值由 CheckboxGroup.disabled 控制。优先级:Checkbox.disabled > CheckboxGroup.disabled > Form.disabled
|
|
40
40
|
*/
|
|
41
|
-
disabled?: boolean;
|
|
41
|
+
disabled?: boolean | null;
|
|
42
42
|
/**
|
|
43
43
|
* 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标,半选中态图标]`。使用 String 时,值为 circle 表示填充圆形图标、值为 line 表示描边型图标、值为 rectangle 表示填充矩形图标
|
|
44
44
|
* @default 'circle'
|
|
45
45
|
*/
|
|
46
|
-
icon?:
|
|
46
|
+
icon?: CheckboxIconType;
|
|
47
47
|
/**
|
|
48
48
|
* 是否为半选
|
|
49
49
|
* @default false
|
|
@@ -76,7 +76,7 @@ export interface TdCheckboxProps {
|
|
|
76
76
|
/**
|
|
77
77
|
* 只读状态
|
|
78
78
|
*/
|
|
79
|
-
readonly?: boolean;
|
|
79
|
+
readonly?: boolean | null;
|
|
80
80
|
/**
|
|
81
81
|
* -1 时代表独立,不再寻找 parent,用于头条小程序
|
|
82
82
|
* @default ''
|
|
@@ -94,3 +94,5 @@ export interface TdCheckboxProps {
|
|
|
94
94
|
context: { value: boolean | number | string; label: boolean | number | string };
|
|
95
95
|
}) => void;
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
export type CheckboxIconType = 'circle' | 'line' | 'rectangle' | string[];
|