Skip to content
This repository was archived by the owner on Dec 6, 2021. It is now read-only.

Commit 6a3c0c9

Browse files
authored
Merge pull request #93 from b2nil/dev
for release alpha.20
2 parents ac6efda + fbc03b1 commit 6a3c0c9

File tree

62 files changed

+1165
-781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1165
-781
lines changed

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,32 +80,32 @@
8080
"lodash-es": "^4.17.15"
8181
},
8282
"peerDependencies": {
83-
"@tarojs/components": "^3.1.4",
84-
"@tarojs/taro": "^3.1.4",
85-
"vue": "^3.0.6"
83+
"@tarojs/components": "^3.2.1",
84+
"@tarojs/taro": "^3.2.1",
85+
"vue": "^3.0.10"
8686
},
8787
"devDependencies": {
8888
"@babel/core": "^7.8.0",
8989
"@babel/runtime": "^7.7.7",
9090
"@rollup/plugin-json": "^4.1.0",
9191
"@rollup/plugin-node-resolve": "^9.0.0",
92-
"@tarojs/components": "^3.1.4",
93-
"@tarojs/mini-runner": "^3.1.4",
94-
"@tarojs/runtime": "^3.1.4",
95-
"@tarojs/taro": "^3.1.4",
96-
"@tarojs/webpack-runner": "^3.1.4",
92+
"@tarojs/components": "^3.2.1",
93+
"@tarojs/mini-runner": "^3.2.1",
94+
"@tarojs/runtime": "^3.2.1",
95+
"@tarojs/taro": "^3.2.1",
96+
"@tarojs/webpack-runner": "^3.2.1",
9797
"@types/jest": "^26.0.17",
9898
"@types/lodash-es": "^4.17.3",
9999
"@types/webpack-env": "^1.13.6",
100100
"@typescript-eslint/eslint-plugin": "^2.x",
101101
"@typescript-eslint/parser": "^2.x",
102102
"@vue/babel-plugin-jsx": "^1.0.0-rc.4",
103-
"@vue/compiler-sfc": "^3.0.6",
103+
"@vue/compiler-sfc": "^3.0.10",
104104
"@vue/test-utils": "2.0.0-rc.0",
105105
"babel-preset-taro": "^3.0.5",
106106
"cross-env": "^7.0.2",
107107
"csstype": "^2.6.11",
108-
"esbuild": "^0.9.0",
108+
"esbuild": "^0.11.0",
109109
"eslint": "^6.8.0",
110110
"eslint-config-taro": "^3.0.5",
111111
"eslint-plugin-vue": "^7.0.0-alpha.6",
@@ -116,14 +116,15 @@
116116
"rollup": "^2.29.0",
117117
"rollup-plugin-copy": "^3.3.0",
118118
"rollup-plugin-sass": "^1.2.2",
119-
"rollup-plugin-typescript2": "^0.27.2",
119+
"rollup-plugin-typescript2": "0.30.0",
120120
"shelljs": "^0.8.4",
121121
"stylelint": "^9.3.0",
122122
"tiny-glob": "^0.2.8",
123123
"ts-jest": "^26.4.4",
124124
"ts-loader": "^8.0.2",
125-
"typescript": "^3.7.0",
126-
"vue": "^3.0.6",
125+
"tslib": "^2.1.0",
126+
"typescript": "^4.2.0",
127+
"vue": "^3.0.10",
127128
"vue-jest": "^5.0.0-alpha.7",
128129
"vue-loader": "^16.1.0",
129130
"webpack-bundle-analyzer": "^4.2.0"

src/components/accordion/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const AtAccordion = defineComponent({
2929
type: String,
3030
default: ''
3131
},
32-
onClick: Function as PropType<AtAccordionProps['onClick']>
32+
onClick: Function as unknown as PropType<AtAccordionProps['onClick']>
3333
},
3434

3535
setup(props: AtAccordionProps, { attrs, slots }) {

src/components/action-sheet/body/item/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const AtActionSheetItem = defineComponent({
77
name: "AtActionSheetItem",
88

99
props: {
10-
onClick: Function as PropType<(event?: CommonEvent) => void>
10+
onClick: Function as unknown as PropType<(event?: CommonEvent) => void>
1111
},
1212

1313
setup(props: AtActionSheetItemProps, { attrs, slots }) {

src/components/action-sheet/footer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const AtActionSheetFooter = defineComponent({
66
name: "AtActionSheetFooter",
77

88
props: {
9-
onClick: Function as PropType<AtActionSheetFooterProps['onClick']>
9+
onClick: Function as unknown as PropType<AtActionSheetFooterProps['onClick']>
1010
},
1111

1212
setup(props: AtActionSheetFooterProps, { attrs, slots }) {

src/components/action-sheet/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const AtActionSheet = defineComponent({
2323
type: String,
2424
default: ''
2525
},
26-
onClose: Function as PropType<(event?: CommonEvent) => void>,
27-
onCancel: Function as PropType<(event?: CommonEvent) => void>
26+
onClose: Function as unknown as PropType<(event?: CommonEvent) => void>,
27+
onCancel: Function as unknown as PropType<(event?: CommonEvent) => void>
2828
},
2929

3030
setup(props: AtActionSheetProps, { attrs, slots }) {

src/components/button/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const AtButton = defineComponent({
3737
full: Boolean,
3838
loading: Boolean,
3939
disabled: Boolean,
40-
onClick: Function as PropType<AtButtonProps['onClick']>,
40+
onClick: Function as unknown as PropType<AtButtonProps['onClick']>,
4141

4242
// Taro Button Props
4343
formType: {
@@ -74,14 +74,14 @@ const AtButton = defineComponent({
7474
scope: String as PropType<AtButtonProps['scope']>, // alipay scope
7575

7676
// Taro Button Events
77-
onGetUserInfo: Function as PropType<AtButtonProps['onGetUserInfo']>,
78-
onGetAuthorize: Function as PropType<AtButtonProps['onGetAuthorize']>, // Alipay auth
79-
onContact: Function as PropType<AtButtonProps['onContact']>,
80-
onGetPhoneNumber: Function as PropType<AtButtonProps['onGetPhoneNumber']>,
81-
onGetRealnameAuthInfo: Function as PropType<AtButtonProps['onGetRealnameAuthInfo']>,
82-
onError: Function as PropType<AtButtonProps['onError']>,
83-
onOpenSetting: Function as PropType<AtButtonProps['onOpenSetting']>,
84-
onLaunchapp: Function as PropType<AtButtonProps['onLaunchapp']>,
77+
onGetUserInfo: Function as unknown as PropType<AtButtonProps['onGetUserInfo']>,
78+
onGetAuthorize: Function as unknown as PropType<AtButtonProps['onGetAuthorize']>, // Alipay auth
79+
onContact: Function as unknown as PropType<AtButtonProps['onContact']>,
80+
onGetPhoneNumber: Function as unknown as PropType<AtButtonProps['onGetPhoneNumber']>,
81+
onGetRealnameAuthInfo: Function as unknown as PropType<AtButtonProps['onGetRealnameAuthInfo']>,
82+
onError: Function as unknown as PropType<AtButtonProps['onError']>,
83+
onOpenSetting: Function as unknown as PropType<AtButtonProps['onOpenSetting']>,
84+
onLaunchapp: Function as unknown as PropType<AtButtonProps['onLaunchapp']>,
8585
},
8686

8787
setup(props: AtButtonProps, { attrs, slots }) {

src/components/calendar/__tests__/calendar.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ describe('AtCalendar', () => {
9090
today.setDate(today.getDate() - 28)
9191
const prevM = new Date(today).toISOString().substring(0, 10)
9292
const wrapper = mountFactory(AtCalendar, undefined, { marks: [{ value: prevM }] })
93-
expect(wrapper.findAll('.mark').length).toBe(1)
93+
expect(wrapper.findAll('.flex__item:not(.flex__item--blur) .mark').length).toBe(1)
9494
await wrapper.setProps({ marks: [{ value: `${dString}-21` }, { value: prevM }, { value: `${dString}-23` }] })
9595
wrapper.vm.$nextTick()
96-
expect(wrapper.findAll('.mark').length).toBe(3)
96+
expect(wrapper.findAll('.flex__item:not(.flex__item--blur) .mark').length).toBe(3)
9797
})
9898

9999
it('should render minDate and maxDate', () => {

src/components/calendar/body/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ const AtCalendarBody = defineComponent({
5757
default: () => []
5858
},
5959
onDayClick: {
60-
type: Function as PropType<AtCalendarBodyProps['onDayClick']>,
60+
type: Function as unknown as PropType<AtCalendarBodyProps['onDayClick']>,
6161
default: () => () => { }
6262
},
6363
onLongClick: {
64-
type: Function as PropType<AtCalendarBodyProps['onLongClick']>,
64+
type: Function as unknown as PropType<AtCalendarBodyProps['onLongClick']>,
6565
default: () => () => { }
6666
},
6767
onSwipeMonth: {
68-
type: Function as PropType<AtCalendarBodyProps['onSwipeMonth']>,
68+
type: Function as unknown as PropType<AtCalendarBodyProps['onSwipeMonth']>,
6969
default: () => () => { }
7070
},
7171
},

src/components/calendar/common/plugins.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export function handleActive(
2121
const dayjsStart = start ? dayjs(start) : dayjsEnd
2222

2323
item.isSelected =
24-
_value.isSame(dayjsEnd) ||
25-
_value.isSame(dayjsStart) ||
26-
(_value.isAfter(dayjsStart) && _value.isBefore(dayjsEnd))
24+
_value!.isSame(dayjsEnd) ||
25+
_value!.isSame(dayjsStart) ||
26+
(_value!.isAfter(dayjsStart) && _value!.isBefore(dayjsEnd))
2727

28-
item.isSelectedHead = _value.isSame(dayjsStart)
29-
item.isSelectedTail = _value.isSame(dayjsEnd)
28+
item.isSelectedHead = _value!.isSame(dayjsStart)
29+
item.isSelectedTail = _value!.isSame(dayjsEnd)
3030

31-
item.isToday = _value.diff(dayjs(Date.now()).startOf('day'), 'day') === 0
31+
item.isToday = _value!.diff(dayjs(Date.now()).startOf('day'), 'day') === 0
3232

3333
return item
3434
}
@@ -44,7 +44,7 @@ export function handleMarks(
4444
const markList = marks.filter(mark =>
4545
dayjs(mark.value)
4646
.startOf('day')
47-
.isSame(_value)
47+
.isSame(_value!)
4848
)
4949

5050
item.marks = markList.slice(0, 1)
@@ -96,8 +96,8 @@ export function handleDisabled(
9696
const dayjsMaxDate = dayjs(maxDate)
9797

9898
item.isDisabled =
99-
!!(minDate && _value.isBefore(dayjsMinDate)) ||
100-
!!(maxDate && _value.isAfter(dayjsMaxDate))
99+
!!(minDate && _value!.isBefore(dayjsMinDate)) ||
100+
!!(maxDate && _value!.isAfter(dayjsMaxDate))
101101

102102
return item
103103
}
@@ -114,7 +114,7 @@ export function handleValid(
114114
const isInclude = validDates.some(date =>
115115
dayjs(date.value)
116116
.startOf('day')
117-
.isSame(_value)
117+
.isSame(_value!)
118118
)
119119

120120
item.isDisabled = !isInclude

src/components/calendar/controller/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const AtCalendarController = defineComponent({
1111
props: {
1212
generateDate: {
1313
type: [String, Number] as PropType<AtCalendarControllerProps["generateDate"]>,
14-
default: Date.now(),
15-
required: true
14+
default: Date.now()
1615
},
1716
minDate: [String, Number, Date] as PropType<AtCalendarControllerProps["minDate"]>,
1817
maxDate: [String, Number, Date] as PropType<AtCalendarControllerProps["maxDate"]>,
@@ -21,9 +20,9 @@ const AtCalendarController = defineComponent({
2120
type: String as PropType<AtCalendarControllerProps["monthFormat"]>,
2221
default: 'YYYY年MM月'
2322
},
24-
onPreMonth: Function as PropType<AtCalendarControllerProps["onPreMonth"]>,
25-
onNextMonth: Function as PropType<AtCalendarControllerProps["onNextMonth"]>,
26-
onSelectDate: Function as PropType<AtCalendarControllerProps["onSelectDate"]>
23+
onPreMonth: Function as unknown as PropType<AtCalendarControllerProps["onPreMonth"]>,
24+
onNextMonth: Function as unknown as PropType<AtCalendarControllerProps["onNextMonth"]>,
25+
onSelectDate: Function as unknown as PropType<AtCalendarControllerProps["onSelectDate"]>
2726
},
2827

2928
setup(props: AtCalendarControllerProps) {

0 commit comments

Comments
 (0)