@tdesign/uniapp 0.7.0 → 0.7.2
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/dist/action-sheet/README.en-US.md +1 -1
- package/dist/action-sheet/README.md +1 -1
- package/dist/action-sheet/action-sheet.vue +27 -12
- package/dist/action-sheet/computed.js +14 -0
- package/dist/action-sheet/type.ts +2 -2
- package/dist/avatar/avatar.vue +6 -6
- package/dist/avatar-group/avatar-group.vue +1 -3
- package/dist/back-top/back-top.vue +13 -15
- package/dist/badge/badge.vue +1 -3
- package/dist/button/README.en-US.md +5 -2
- package/dist/button/README.md +5 -2
- package/dist/button/button.vue +18 -14
- package/dist/button/props.ts +14 -0
- package/dist/button/type.ts +14 -0
- package/dist/calendar/README.en-US.md +1 -0
- package/dist/calendar/README.md +1 -0
- package/dist/calendar/calendar-header.vue +1 -3
- package/dist/calendar/calendar.vue +28 -19
- package/dist/calendar/props.ts +5 -0
- package/dist/calendar/template.vue +1 -3
- package/dist/calendar/type.ts +6 -0
- package/dist/cascader/cascader.vue +9 -7
- package/dist/cell/cell.vue +51 -35
- package/dist/cell-group/cell-group.vue +1 -3
- package/dist/check-tag/check-tag.vue +12 -15
- package/dist/checkbox/checkbox.vue +13 -15
- package/dist/col/col.vue +1 -3
- package/dist/collapse/collapse.vue +1 -3
- package/dist/collapse-panel/collapse-panel.vue +1 -3
- package/dist/color-picker/color-picker.vue +2 -4
- package/dist/color-picker/template.vue +1 -3
- package/dist/common/src/instantiationDecorator.js +14 -0
- package/dist/common/style/theme/index.css +42 -90
- package/dist/count-down/count-down.vue +2 -4
- package/dist/date-time-picker/date-time-picker.vue +1 -3
- package/dist/dialog/dialog.vue +67 -69
- package/dist/divider/divider.vue +1 -3
- package/dist/draggable/draggable.vue +1 -3
- package/dist/drawer/drawer.vue +1 -3
- package/dist/dropdown-item/dropdown-item.vue +1 -3
- package/dist/dropdown-menu/dropdown-menu.vue +12 -14
- package/dist/empty/empty.vue +1 -3
- package/dist/fab/fab.vue +1 -3
- package/dist/footer/footer.vue +1 -3
- package/dist/form/form.vue +1 -3
- package/dist/form-item/form-item.css +16 -11
- package/dist/form-item/form-item.vue +2 -7
- package/dist/grid/grid.vue +1 -3
- package/dist/grid-item/grid-item.vue +3 -5
- package/dist/guide/content.vue +1 -3
- package/dist/guide/guide.vue +25 -40
- package/dist/icon/icon.vue +2 -4
- package/dist/image/image.vue +1 -3
- package/dist/image-viewer/image-viewer.vue +27 -30
- package/dist/indexes/indexes.vue +13 -15
- package/dist/indexes-anchor/indexes-anchor.vue +1 -3
- package/dist/input/input.vue +31 -31
- package/dist/link/link.vue +25 -26
- package/dist/loading/loading.vue +2 -2
- package/dist/message/index.d.ts +1 -1
- package/dist/message/message.interface.ts +2 -1
- package/dist/message-item/message-item.vue +34 -36
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/navbar/navbar.vue +46 -33
- package/dist/notice-bar/notice-bar.vue +24 -26
- package/dist/overlay/overlay.vue +5 -7
- package/dist/picker/picker.vue +3 -4
- package/dist/picker-item/picker-item.vue +2 -4
- package/dist/popover/popover.vue +1 -3
- package/dist/popup/popup.vue +2 -4
- package/dist/progress/progress.vue +1 -3
- package/dist/pull-down-refresh/pull-down-refresh.vue +13 -15
- package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +1 -3
- package/dist/qrcode/components/qrcode-status/qrcode-status.vue +1 -3
- package/dist/qrcode/qrcode.vue +1 -3
- package/dist/radio/radio.vue +20 -22
- package/dist/rate/rate.vue +1 -3
- package/dist/result/result.vue +13 -15
- package/dist/row/row.vue +1 -3
- package/dist/search/README.en-US.md +1 -1
- package/dist/search/README.md +1 -1
- package/dist/search/search.vue +22 -10
- package/dist/search/type.ts +1 -1
- package/dist/side-bar/side-bar.vue +1 -3
- package/dist/side-bar-item/side-bar-item.vue +12 -15
- package/dist/skeleton/skeleton.vue +2 -4
- package/dist/slider/slider.vue +18 -20
- package/dist/step-item/step-item.vue +1 -3
- package/dist/stepper/stepper.vue +1 -3
- package/dist/steps/steps.vue +1 -2
- package/dist/sticky/sticky.vue +1 -3
- package/dist/swipe-cell/swipe-cell.vue +2 -5
- package/dist/swiper/swiper.vue +1 -3
- package/dist/swiper-nav/swiper-nav.vue +1 -3
- package/dist/switch/switch.vue +1 -3
- package/dist/tab-bar/tab-bar.vue +2 -1
- package/dist/tab-bar-item/tab-bar-item.vue +22 -25
- package/dist/tab-panel/tab-panel.vue +1 -3
- package/dist/tabs/tabs.vue +1 -2
- package/dist/tag/tag.vue +23 -26
- package/dist/textarea/textarea.vue +1 -3
- package/dist/toast/toast.vue +12 -14
- package/dist/transition/transition.vue +1 -3
- package/dist/tree-select/tree-select.vue +6 -9
- package/dist/upload/props.ts +1 -1
- package/dist/upload/upload.vue +1 -3
- package/dist/watermark/watermark.vue +1 -2
- package/package.json +3 -1
- package/dist/.eslintrc.js +0 -30
- package/dist/tsconfig.eslint.json +0 -13
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
<t-popup
|
|
4
4
|
v-if="usePopup"
|
|
5
5
|
:visible="visible"
|
|
6
|
-
:using-custom-navbar="usingCustomNavbar"
|
|
7
|
-
:custom-navbar-height="customNavbarHeight"
|
|
8
6
|
placement="bottom"
|
|
7
|
+
:show-overlay="isShowOverlay(popupProps && popupProps.showOverlay, true)"
|
|
8
|
+
:using-custom-navbar="usingCustomNavbar || (popupProps && popupProps.usingCustomNavbar)"
|
|
9
|
+
:custom-navbar-height="coalesce(customNavbarHeight, popupProps && popupProps.usingCustomNavbar)"
|
|
10
|
+
:z-index="(popupProps && popupProps.zIndex)"
|
|
11
|
+
:overlay-props="(popupProps && popupProps.overlayProps) || defaultOverlayProps"
|
|
9
12
|
@visible-change="onVisibleChange"
|
|
10
13
|
>
|
|
11
14
|
<CalendarTemplate
|
|
@@ -153,6 +156,8 @@ export default uniComponent({
|
|
|
153
156
|
dataVisible: this.visible,
|
|
154
157
|
dataValue: coalesce(this.value, this.defaultValue),
|
|
155
158
|
days: [],
|
|
159
|
+
|
|
160
|
+
defaultOverlayProps: {},
|
|
156
161
|
};
|
|
157
162
|
},
|
|
158
163
|
watch: {
|
|
@@ -253,6 +258,8 @@ export default uniComponent({
|
|
|
253
258
|
}
|
|
254
259
|
},
|
|
255
260
|
methods: {
|
|
261
|
+
coalesce,
|
|
262
|
+
|
|
256
263
|
getMonthTitle,
|
|
257
264
|
getDateLabel,
|
|
258
265
|
isDateSelected,
|
|
@@ -291,23 +298,23 @@ export default uniComponent({
|
|
|
291
298
|
},
|
|
292
299
|
|
|
293
300
|
updateActionButton(value) {
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
const
|
|
301
|
+
const iMin = this.getCurrentYearAndMonth(this.base.minDate);
|
|
302
|
+
const iMax = this.getCurrentYearAndMonth(this.base.maxDate);
|
|
303
|
+
const iValue = this.getCurrentYearAndMonth(value);
|
|
297
304
|
|
|
298
|
-
const
|
|
299
|
-
const
|
|
300
|
-
const
|
|
305
|
+
const iMinTimestamp = new Date(iMin.year, iMin.month, 1).getTime();
|
|
306
|
+
const iMaxTimestamp = new Date(iMax.year, iMax.month, 1).getTime();
|
|
307
|
+
const iDateValue = new Date(iValue.year, iValue.month, 1);
|
|
301
308
|
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
const
|
|
305
|
-
const
|
|
309
|
+
const iPrevYearTimestamp = getPrevYear(iDateValue).getTime();
|
|
310
|
+
const iPrevMonthTimestamp = getPrevMonth(iDateValue).getTime();
|
|
311
|
+
const iNextMonthTimestamp = getNextMonth(iDateValue).getTime();
|
|
312
|
+
const iNextYearTimestamp = getNextYear(iDateValue).getTime();
|
|
306
313
|
|
|
307
|
-
const preYearBtnDisable =
|
|
308
|
-
const prevMonthBtnDisable =
|
|
309
|
-
const nextYearBtnDisable =
|
|
310
|
-
const nextMonthBtnDisable =
|
|
314
|
+
const preYearBtnDisable = iPrevYearTimestamp < iMinTimestamp || iPrevMonthTimestamp < iMinTimestamp;
|
|
315
|
+
const prevMonthBtnDisable = iPrevMonthTimestamp < iMinTimestamp;
|
|
316
|
+
const nextYearBtnDisable = iNextMonthTimestamp > iMaxTimestamp || iNextYearTimestamp > iMaxTimestamp;
|
|
317
|
+
const nextMonthBtnDisable = iNextMonthTimestamp > iMaxTimestamp;
|
|
311
318
|
|
|
312
319
|
this.actionButtons = {
|
|
313
320
|
preYearBtnDisable,
|
|
@@ -440,12 +447,14 @@ export default uniComponent({
|
|
|
440
447
|
maxDate && (this.base.maxDate = maxDate);
|
|
441
448
|
this.calcMonths();
|
|
442
449
|
},
|
|
450
|
+
|
|
451
|
+
isShowOverlay(value, defaultValue) {
|
|
452
|
+
return tools.isBoolean(value) ? value : defaultValue;
|
|
453
|
+
},
|
|
443
454
|
},
|
|
444
455
|
});
|
|
445
456
|
</script>
|
|
446
|
-
<style scoped>
|
|
447
|
-
@import './calendar.css';
|
|
448
|
-
</style>
|
|
457
|
+
<style scoped src="./calendar.css"></style>
|
|
449
458
|
<style scoped>
|
|
450
459
|
.t-calendar-switch-mode--none > .t-calendar__months {
|
|
451
460
|
/* support mp-alipay */
|
package/dist/calendar/props.ts
CHANGED
|
@@ -39,6 +39,11 @@ export default {
|
|
|
39
39
|
minDate: {
|
|
40
40
|
type: Number,
|
|
41
41
|
},
|
|
42
|
+
/** 透传 Popup 组件全部属性 */
|
|
43
|
+
popupProps: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => ({}),
|
|
46
|
+
},
|
|
42
47
|
/** 是否只读,只读状态下不能选择日期 */
|
|
43
48
|
readonly: Boolean,
|
|
44
49
|
/** 切换模式。 `none` 表示平铺展示所有月份; `month` 表示支持按月切换, `year-month` 表示既按年切换,也支持按月切换 */
|
package/dist/calendar/type.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* */
|
|
6
6
|
|
|
7
7
|
import type { TdButtonProps as ButtonProps } from '../button/type';
|
|
8
|
+
import type { TdPopupProps as PopupProps } from '../popup/type';
|
|
8
9
|
|
|
9
10
|
export interface TdCalendarProps {
|
|
10
11
|
/**
|
|
@@ -43,6 +44,11 @@ export interface TdCalendarProps {
|
|
|
43
44
|
* 最小可选的日期,不传则默认今天
|
|
44
45
|
*/
|
|
45
46
|
minDate?: number;
|
|
47
|
+
/**
|
|
48
|
+
* 透传 Popup 组件全部属性
|
|
49
|
+
* @default {}
|
|
50
|
+
*/
|
|
51
|
+
popupProps?: PopupProps;
|
|
46
52
|
/**
|
|
47
53
|
* 是否只读,只读状态下不能选择日期
|
|
48
54
|
*/
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
scroll-y
|
|
107
107
|
:scroll-top="scrollTopList[index]"
|
|
108
108
|
type="list"
|
|
109
|
-
:style="'height: ' +
|
|
109
|
+
:style="'height: ' + optionsHeight + 'px'"
|
|
110
110
|
>
|
|
111
111
|
<view :class="'cascader-radio-group-' + index">
|
|
112
112
|
<TRadioGroup
|
|
@@ -199,7 +199,7 @@ export default uniComponent({
|
|
|
199
199
|
selectedValue: [],
|
|
200
200
|
scrollTopList: [],
|
|
201
201
|
steps: [],
|
|
202
|
-
|
|
202
|
+
optionsHeight: 0,
|
|
203
203
|
tools,
|
|
204
204
|
|
|
205
205
|
dataVisible: this.visible,
|
|
@@ -258,6 +258,7 @@ export default uniComponent({
|
|
|
258
258
|
this.initWithValue();
|
|
259
259
|
},
|
|
260
260
|
immediate: true,
|
|
261
|
+
deep: true,
|
|
261
262
|
},
|
|
262
263
|
|
|
263
264
|
options: {
|
|
@@ -330,7 +331,7 @@ export default uniComponent({
|
|
|
330
331
|
},
|
|
331
332
|
updateOptionsHeight(steps) {
|
|
332
333
|
const { contentHeight, stepsInitHeight, stepHeight, subTitlesHeight } = this.state;
|
|
333
|
-
this.
|
|
334
|
+
this.optionsHeight = contentHeight - stepsInitHeight - subTitlesHeight - (steps - 1) * stepHeight;
|
|
334
335
|
},
|
|
335
336
|
|
|
336
337
|
async initOptionsHeight(steps) {
|
|
@@ -358,7 +359,7 @@ export default uniComponent({
|
|
|
358
359
|
}
|
|
359
360
|
|
|
360
361
|
const optionsInitHeight = this.state.contentHeight - this.state.subTitlesHeight;
|
|
361
|
-
this.
|
|
362
|
+
this.optionsHeight = theme === 'step'
|
|
362
363
|
? optionsInitHeight - this.state.stepsInitHeight - (steps - 1) * this.state.stepHeight
|
|
363
364
|
: optionsInitHeight - this.state.tabsHeight;
|
|
364
365
|
},
|
|
@@ -503,6 +504,9 @@ export default uniComponent({
|
|
|
503
504
|
|
|
504
505
|
this.hide('finish');
|
|
505
506
|
}
|
|
507
|
+
// #ifdef VUE2
|
|
508
|
+
this.$set(this, 'selectedIndexes', JSON.parse(JSON.stringify(selectedIndexes)));
|
|
509
|
+
// #endif
|
|
506
510
|
},
|
|
507
511
|
triggerChange() {
|
|
508
512
|
const { items, selectedValue, selectedIndexes } = this;
|
|
@@ -514,6 +518,4 @@ export default uniComponent({
|
|
|
514
518
|
},
|
|
515
519
|
});
|
|
516
520
|
</script>
|
|
517
|
-
<style scoped>
|
|
518
|
-
@import './cascader.css';
|
|
519
|
-
</style>
|
|
521
|
+
<style scoped src="./cascader.css"></style>
|
package/dist/cell/cell.vue
CHANGED
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
>
|
|
14
14
|
<view :class="classPrefix + '__left ' + tClassLeft">
|
|
15
15
|
<block
|
|
16
|
-
v-if="
|
|
16
|
+
v-if="iLeftIcon"
|
|
17
17
|
name="icon"
|
|
18
18
|
>
|
|
19
19
|
<t-icon
|
|
20
20
|
:custom-style="leftIconCustomStyle"
|
|
21
21
|
:t-class="classPrefix + '__left-icon ' + tClassLeftIcon"
|
|
22
|
-
:name="
|
|
23
|
-
:size="
|
|
24
|
-
:color="
|
|
22
|
+
:name="iLeftIcon.name"
|
|
23
|
+
:size="iLeftIcon.size"
|
|
24
|
+
:color="iLeftIcon.color"
|
|
25
25
|
:aria-hidden="true"
|
|
26
|
-
:aria-label="
|
|
27
|
-
:aria-role="
|
|
26
|
+
:aria-label="iLeftIcon.ariaLabel"
|
|
27
|
+
:aria-role="iLeftIcon.ariaRole"
|
|
28
28
|
@click="'handleClose' || ''"
|
|
29
29
|
/>
|
|
30
30
|
</block>
|
|
@@ -93,31 +93,31 @@
|
|
|
93
93
|
]"
|
|
94
94
|
>
|
|
95
95
|
<t-icon
|
|
96
|
-
v-if="
|
|
96
|
+
v-if="rightArrow"
|
|
97
97
|
:custom-style="rightArrowCustomStyle"
|
|
98
98
|
:t-class=" classPrefix + '__right-icon ' + tClassRightIcon"
|
|
99
|
-
:name="
|
|
100
|
-
:size="
|
|
101
|
-
:color="
|
|
99
|
+
:name="rightArrow.name || ''"
|
|
100
|
+
:size="rightArrow.size"
|
|
101
|
+
:color="rightArrow.color"
|
|
102
102
|
:aria-hidden="true"
|
|
103
|
-
:aria-label="
|
|
104
|
-
:aria-role="
|
|
103
|
+
:aria-label="rightArrow.ariaLabel"
|
|
104
|
+
:aria-role="rightArrow.ariaRole"
|
|
105
105
|
@click="'handleClose' || ''"
|
|
106
106
|
/>
|
|
107
107
|
<block v-else>
|
|
108
108
|
<block
|
|
109
|
-
v-if="
|
|
109
|
+
v-if="iRightIcon"
|
|
110
110
|
name="icon"
|
|
111
111
|
>
|
|
112
112
|
<t-icon
|
|
113
113
|
:custom-style="rightIconCustomStyle"
|
|
114
114
|
:t-class=" classPrefix + '__right-icon ' + tClassRightIcon"
|
|
115
|
-
:name="
|
|
116
|
-
:size="
|
|
117
|
-
:color="
|
|
115
|
+
:name="iRightIcon.name"
|
|
116
|
+
:size="iRightIcon.size"
|
|
117
|
+
:color="iRightIcon.color || ''"
|
|
118
118
|
:aria-hidden="true"
|
|
119
|
-
:aria-label="
|
|
120
|
-
:aria-role="
|
|
119
|
+
:aria-label="iRightIcon.ariaLabel"
|
|
120
|
+
:aria-role="iRightIcon.ariaRole"
|
|
121
121
|
@click="'handleClose' || ''"
|
|
122
122
|
/>
|
|
123
123
|
</block>
|
|
@@ -132,7 +132,7 @@ import TImage from '../image/image';
|
|
|
132
132
|
import { uniComponent } from '../common/src/index';
|
|
133
133
|
import { prefix } from '../common/config';
|
|
134
134
|
import props from './props';
|
|
135
|
-
import { calcIcon } from '../common/utils';
|
|
135
|
+
import { calcIcon, addUnit } from '../common/utils';
|
|
136
136
|
import tools from '../common/utils.wxs';
|
|
137
137
|
|
|
138
138
|
import { ChildrenMixin, RELATION_MAP } from '../common/relation';
|
|
@@ -177,9 +177,9 @@ export default uniComponent({
|
|
|
177
177
|
return {
|
|
178
178
|
prefix,
|
|
179
179
|
classPrefix: name,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
rightArrow: null,
|
|
181
|
+
iRightIcon: null,
|
|
182
|
+
iLeftIcon: null,
|
|
183
183
|
isLastChild: false,
|
|
184
184
|
tools,
|
|
185
185
|
};
|
|
@@ -187,25 +187,43 @@ export default uniComponent({
|
|
|
187
187
|
computed: {
|
|
188
188
|
rightArrowCustomStyle() {
|
|
189
189
|
return tools._style([
|
|
190
|
-
|
|
190
|
+
{
|
|
191
|
+
color: this.rightArrow.color
|
|
192
|
+
? this.rightArrow.color
|
|
193
|
+
: COMMON_RIGHT_ICON_STYLE.color,
|
|
194
|
+
fontSize: this.rightArrow.size
|
|
195
|
+
? addUnit(this.rightArrow.size)
|
|
196
|
+
: COMMON_RIGHT_ICON_STYLE.fontSize,
|
|
197
|
+
},
|
|
191
198
|
this.rightIconStyle || '',
|
|
192
|
-
this.
|
|
199
|
+
this.rightArrow.style || '',
|
|
193
200
|
]);
|
|
194
201
|
},
|
|
195
202
|
rightIconCustomStyle() {
|
|
196
203
|
return tools._style([
|
|
197
|
-
|
|
204
|
+
{
|
|
205
|
+
color: this.iRightIcon.color
|
|
206
|
+
? this.iRightIcon.color
|
|
207
|
+
: COMMON_RIGHT_ICON_STYLE.color,
|
|
208
|
+
fontSize: this.iRightIcon.size
|
|
209
|
+
? addUnit(this.iRightIcon.size)
|
|
210
|
+
: COMMON_RIGHT_ICON_STYLE.fontSize,
|
|
211
|
+
},
|
|
198
212
|
this.rightIconStyle || '',
|
|
199
|
-
this.
|
|
213
|
+
this.iRightIcon.style || '',
|
|
200
214
|
]);
|
|
201
215
|
},
|
|
202
216
|
leftIconCustomStyle() {
|
|
203
217
|
return tools._style([
|
|
204
218
|
{
|
|
205
|
-
color:
|
|
206
|
-
|
|
219
|
+
color: this.iLeftIcon.color
|
|
220
|
+
? this.iLeftIcon.color
|
|
221
|
+
: 'var(--td-cell-left-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)))',
|
|
222
|
+
fontSize: this.iLeftIcon.size
|
|
223
|
+
? addUnit(this.iLeftIcon.size)
|
|
224
|
+
: 'var(--td-cell-left-icon-font-size, 24px)',
|
|
207
225
|
},
|
|
208
|
-
this.
|
|
226
|
+
this.iLeftIcon.style || '',
|
|
209
227
|
]);
|
|
210
228
|
},
|
|
211
229
|
leftImageCustomStyle() {
|
|
@@ -218,19 +236,19 @@ export default uniComponent({
|
|
|
218
236
|
watch: {
|
|
219
237
|
leftIcon: {
|
|
220
238
|
handler(e) {
|
|
221
|
-
this.setIcon('
|
|
239
|
+
this.setIcon('iLeftIcon', e, '');
|
|
222
240
|
},
|
|
223
241
|
immediate: true,
|
|
224
242
|
},
|
|
225
243
|
rightIcon: {
|
|
226
244
|
handler(e) {
|
|
227
|
-
this.setIcon('
|
|
245
|
+
this.setIcon('iRightIcon', e, '');
|
|
228
246
|
},
|
|
229
247
|
immediate: true,
|
|
230
248
|
},
|
|
231
249
|
arrow: {
|
|
232
250
|
handler(e) {
|
|
233
|
-
this.setIcon('
|
|
251
|
+
this.setIcon('rightArrow', e, 'chevron-right');
|
|
234
252
|
},
|
|
235
253
|
immediate: true,
|
|
236
254
|
},
|
|
@@ -255,6 +273,4 @@ export default uniComponent({
|
|
|
255
273
|
},
|
|
256
274
|
});
|
|
257
275
|
</script>
|
|
258
|
-
<style scoped>
|
|
259
|
-
@import './cell.css';
|
|
260
|
-
</style>
|
|
276
|
+
<style scoped src="./cell.css"></style>
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
:class="classPrefix + '__icon'"
|
|
10
10
|
>
|
|
11
11
|
<block
|
|
12
|
-
v-if="
|
|
12
|
+
v-if="innerIcon"
|
|
13
13
|
name="icon"
|
|
14
14
|
>
|
|
15
15
|
<t-icon
|
|
16
|
-
:custom-style="
|
|
16
|
+
:custom-style="innerIcon.style || ''"
|
|
17
17
|
:t-class="prefix + '-icon'"
|
|
18
|
-
:prefix="
|
|
19
|
-
:name="
|
|
20
|
-
:size="
|
|
21
|
-
:color="
|
|
22
|
-
:aria-hidden="!!
|
|
23
|
-
:aria-label="
|
|
24
|
-
:aria-role="
|
|
18
|
+
:prefix="innerIcon.prefix"
|
|
19
|
+
:name="innerIcon.name"
|
|
20
|
+
:size="innerIcon.size"
|
|
21
|
+
:color="innerIcon.color"
|
|
22
|
+
:aria-hidden="!!innerIcon.ariaHidden"
|
|
23
|
+
:aria-label="innerIcon.ariaLabel"
|
|
24
|
+
:aria-role="innerIcon.ariaRole"
|
|
25
25
|
/>
|
|
26
26
|
</block>
|
|
27
27
|
<slot name="icon" />
|
|
@@ -84,7 +84,7 @@ export default uniComponent({
|
|
|
84
84
|
classPrefix: name,
|
|
85
85
|
className: '',
|
|
86
86
|
tools,
|
|
87
|
-
|
|
87
|
+
innerIcon: null,
|
|
88
88
|
|
|
89
89
|
dataChecked: coalesce(this.checked, this.defaultChecked),
|
|
90
90
|
};
|
|
@@ -95,7 +95,7 @@ export default uniComponent({
|
|
|
95
95
|
dataChecked: 'setClass',
|
|
96
96
|
icon: {
|
|
97
97
|
handler(e) {
|
|
98
|
-
this.
|
|
98
|
+
this.innerIcon = calcIcon(e);
|
|
99
99
|
},
|
|
100
100
|
immediate: true,
|
|
101
101
|
},
|
|
@@ -143,7 +143,4 @@ export default uniComponent({
|
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
</script>
|
|
146
|
-
<style scoped>
|
|
147
|
-
@import './check-tag.css';
|
|
148
|
-
|
|
149
|
-
</style>
|
|
146
|
+
<style scoped src="./check-tag.css"></style>
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<view
|
|
3
3
|
:id="tId"
|
|
4
4
|
:style="tools._style([customStyle])"
|
|
5
|
-
:class="tools.cls(classPrefix, [placement, theme, ['checked', dataChecked], ['block', block], ['disabled',
|
|
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
|
-
:aria-disabled="
|
|
8
|
+
:aria-disabled="iDisabled ? true : false"
|
|
9
9
|
@click.stop="handleTap"
|
|
10
10
|
>
|
|
11
11
|
<view
|
|
12
12
|
v-if="theme == 'default'"
|
|
13
|
-
:class="tools.cls(classPrefix + '__icon', [placement, ['checked', dataChecked], ['disabled',
|
|
13
|
+
:class="tools.cls(classPrefix + '__icon', [placement, ['checked', dataChecked], ['disabled', iDisabled]]) + ' ' + tClassIcon"
|
|
14
14
|
>
|
|
15
15
|
<slot
|
|
16
16
|
v-if="icon === 'slot'"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
/>
|
|
39
39
|
<view
|
|
40
40
|
v-else-if="!dataChecked && (icon == 'circle' || icon == 'rectangle')"
|
|
41
|
-
:class="tools.cls(classPrefix + '__icon-' + icon, [['disabled',
|
|
41
|
+
:class="tools.cls(classPrefix + '__icon-' + icon, [['disabled', iDisabled]])"
|
|
42
42
|
/>
|
|
43
43
|
<view
|
|
44
44
|
v-if="!dataChecked && icon == 'line'"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<view
|
|
55
55
|
:class="
|
|
56
56
|
tools.cls(classPrefix + '__title', [
|
|
57
|
-
['disabled',
|
|
57
|
+
['disabled', iDisabled],
|
|
58
58
|
['checked', dataChecked]
|
|
59
59
|
]) +
|
|
60
60
|
' ' +
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<slot name="label" />
|
|
70
70
|
</view>
|
|
71
71
|
<view
|
|
72
|
-
:class="tools.cls(classPrefix + '__description', [['disabled',
|
|
72
|
+
:class="tools.cls(classPrefix + '__description', [['disabled', iDisabled]]) + ' ' + tClassContent"
|
|
73
73
|
:style="'-webkit-line-clamp:' + maxContentRow"
|
|
74
74
|
>
|
|
75
75
|
<block v-if="content">
|
|
@@ -132,7 +132,7 @@ export default uniComponent({
|
|
|
132
132
|
return {
|
|
133
133
|
prefix,
|
|
134
134
|
classPrefix: name,
|
|
135
|
-
|
|
135
|
+
iDisabled: false,
|
|
136
136
|
tools,
|
|
137
137
|
|
|
138
138
|
dataBorderless: this.borderless,
|
|
@@ -166,7 +166,7 @@ export default uniComponent({
|
|
|
166
166
|
},
|
|
167
167
|
disabled: {
|
|
168
168
|
handler(v) {
|
|
169
|
-
this.
|
|
169
|
+
this.iDisabled = v;
|
|
170
170
|
},
|
|
171
171
|
immediate: true,
|
|
172
172
|
},
|
|
@@ -183,7 +183,7 @@ export default uniComponent({
|
|
|
183
183
|
const valueSet = new Set(value);
|
|
184
184
|
const checkedFromParent = valueSet.has(this.value);
|
|
185
185
|
const data = {
|
|
186
|
-
|
|
186
|
+
iDisabled: this.disabled == null ? disabled : this.disabled,
|
|
187
187
|
};
|
|
188
188
|
|
|
189
189
|
data.dataBorderless = !!(coalesce(this.borderless, borderless));
|
|
@@ -210,10 +210,10 @@ export default uniComponent({
|
|
|
210
210
|
});
|
|
211
211
|
},
|
|
212
212
|
handleTap(e) {
|
|
213
|
-
const {
|
|
213
|
+
const { iDisabled, readonly, contentDisabled } = this;
|
|
214
214
|
const { target } = e.currentTarget.dataset;
|
|
215
215
|
|
|
216
|
-
if (
|
|
216
|
+
if (iDisabled || readonly || (target === 'text' && contentDisabled)) return;
|
|
217
217
|
|
|
218
218
|
const { value, label, checkAll, dataIndeterminate } = this;
|
|
219
219
|
const checked = !this.dataChecked;
|
|
@@ -228,11 +228,9 @@ export default uniComponent({
|
|
|
228
228
|
},
|
|
229
229
|
|
|
230
230
|
setDisabled(disabled) {
|
|
231
|
-
this.
|
|
231
|
+
this.iDisabled = this.disabled || disabled;
|
|
232
232
|
},
|
|
233
233
|
},
|
|
234
234
|
});
|
|
235
235
|
</script>
|
|
236
|
-
<style scoped>
|
|
237
|
-
@import './checkbox.css';
|
|
238
|
-
</style>
|
|
236
|
+
<style scoped src="./checkbox.css"></style>
|
package/dist/col/col.vue
CHANGED
|
@@ -234,7 +234,7 @@ export default uniComponent({
|
|
|
234
234
|
}, 33);
|
|
235
235
|
this.debouncedUpdateEleRect = debounce(e => this.updateEleRect(e), 150);
|
|
236
236
|
},
|
|
237
|
-
|
|
237
|
+
beforeUnmount() {
|
|
238
238
|
clearTimeout(this.timer);
|
|
239
239
|
},
|
|
240
240
|
methods: {
|
|
@@ -496,6 +496,4 @@ export default uniComponent({
|
|
|
496
496
|
});
|
|
497
497
|
|
|
498
498
|
</script>
|
|
499
|
-
<style scoped>
|
|
500
|
-
@import './color-picker.css';
|
|
501
|
-
</style>
|
|
499
|
+
<style scoped src="./color-picker.css"></style>
|
|
@@ -80,6 +80,12 @@ export const toComponent = function (options) {
|
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
// #ifdef Vue2
|
|
84
|
+
if (options.beforeUnmount) {
|
|
85
|
+
options.beforeDestroy = options.beforeUnmount;
|
|
86
|
+
}
|
|
87
|
+
// #endif
|
|
88
|
+
|
|
83
89
|
options.methods._trigger = function (evtName, detail, opts) {
|
|
84
90
|
const target = controlledProps.find(item => item.event === evtName);
|
|
85
91
|
|
|
@@ -171,10 +177,18 @@ function filterProps(props, controlledProps) {
|
|
|
171
177
|
|| unControlledKeys.indexOf(key) > -1
|
|
172
178
|
) {
|
|
173
179
|
const newType = Array.isArray(curType) ? curType : [curType];
|
|
180
|
+
// #ifdef VUE3
|
|
174
181
|
newProps[key] = {
|
|
175
182
|
type: [null, ...newType],
|
|
176
183
|
default: null,
|
|
177
184
|
};
|
|
185
|
+
// #endif
|
|
186
|
+
// #ifdef VUE2
|
|
187
|
+
newProps[key] = {
|
|
188
|
+
type: [...newType],
|
|
189
|
+
default: null,
|
|
190
|
+
};
|
|
191
|
+
// #endif
|
|
178
192
|
} else if (
|
|
179
193
|
[Boolean, String].indexOf(props[key].type) > -1
|
|
180
194
|
&& props[key].default === undefined
|