@startupjs-ui/date-time-picker 0.2.0-alpha.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/components/Calendar/Days/index.tsx +8 -4
- package/components/Calendar/index.tsx +5 -1
- package/index.d.ts +2 -2
- package/index.tsx +11 -2
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.3.0](https://github.com/startupjs/startupjs-ui/compare/v0.2.3...v0.3.0) (2026-05-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* [BREAKING] [0.3] improve accessibility props for E2E tests. Support testID everywhere ([#31](https://github.com/startupjs/startupjs-ui/issues/31)) ([882588c](https://github.com/startupjs/startupjs-ui/commit/882588ca37d5e1fd14b5717b5697cf9ed47042e4))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [0.2.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.23...v0.2.0) (2026-05-04)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* [v0.2] add accessibility features to most components, which also dramatically improves E2E testability ([#22](https://github.com/startupjs/startupjs-ui/issues/22)) ([b563e2f](https://github.com/startupjs/startupjs-ui/commit/b563e2fa498a8a83bd5abc7836d120f6d2381e3f))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [0.2.0-alpha.2](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.1...v0.2.0-alpha.2) (2026-04-20)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @startupjs-ui/date-time-picker
|
|
@@ -61,6 +61,7 @@ function Days ({
|
|
|
61
61
|
month: currentDay.month(),
|
|
62
62
|
day: currentDay.date(),
|
|
63
63
|
value: +currentDay,
|
|
64
|
+
ariaLabel: currentDay.format('MMMM D, YYYY'),
|
|
64
65
|
testID: `${currentDay.format('MM')}-` +
|
|
65
66
|
`${currentDay.format('DD')}-${currentDay.format('YYYY')}`
|
|
66
67
|
})
|
|
@@ -101,18 +102,20 @@ function Days ({
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
return pug`
|
|
104
|
-
Div.row(row)
|
|
105
|
+
Div.row(key='week-header' row role='row')
|
|
105
106
|
for shortDayName in weekdaysShort
|
|
106
|
-
Div.cell(key=shortDayName)
|
|
107
|
-
Span.shortName(bold)= shortDayName
|
|
107
|
+
Div.cell(key=shortDayName role='columnheader')
|
|
108
|
+
Span.shortName(key='shortName-' + shortDayName bold)= shortDayName
|
|
108
109
|
|
|
109
110
|
for week, weekIndex in matrixMonthDays
|
|
110
111
|
// noop to prevent eslint error about missing 'week'. TODO: implement eslint disable comments support in pug
|
|
111
112
|
- (week => {})(week)
|
|
112
|
-
Div.row(key='week-' + weekIndex row)
|
|
113
|
+
Div.row(key='week-' + weekIndex row role='row')
|
|
113
114
|
for day, dayIndex in matrixMonthDays[weekIndex]
|
|
114
115
|
Div.cell(
|
|
115
116
|
key=weekIndex + '-' + dayIndex
|
|
117
|
+
role='gridcell'
|
|
118
|
+
aria-label=day.ariaLabel
|
|
116
119
|
styleName={
|
|
117
120
|
isActive: !range && moment.tz(day.value, timezone).isSame(date, 'd'),
|
|
118
121
|
isActiveRangeStart: range && moment.tz(day.value, timezone).isSame(range[0], 'd'),
|
|
@@ -124,6 +127,7 @@ function Days ({
|
|
|
124
127
|
onPress=() => _onChangeDay(day)
|
|
125
128
|
)
|
|
126
129
|
Span.label(
|
|
130
|
+
key='day-label-' + weekIndex + '-' + dayIndex
|
|
127
131
|
bold=getLabelActive(day.value)
|
|
128
132
|
styleName={
|
|
129
133
|
isMute: !moment.tz(day.value, timezone).isSame(uiDate, 'M'),
|
|
@@ -32,7 +32,11 @@ function Calendar ({
|
|
|
32
32
|
const $uiDate = $(+moment(date).seconds(0).milliseconds(0))
|
|
33
33
|
|
|
34
34
|
return pug`
|
|
35
|
-
Div(
|
|
35
|
+
Div(
|
|
36
|
+
testID=testID
|
|
37
|
+
role='grid'
|
|
38
|
+
aria-label='Calendar'
|
|
39
|
+
)
|
|
36
40
|
Header(
|
|
37
41
|
uiDate=$uiDate.get()
|
|
38
42
|
exactLocale=exactLocale
|
package/index.d.ts
CHANGED
|
@@ -55,9 +55,9 @@ export interface DateTimePickerProps extends Omit<UITextInputProps, 'value' | 'o
|
|
|
55
55
|
visible?: boolean;
|
|
56
56
|
/** Scoped model controlling visibility */
|
|
57
57
|
$visible?: any;
|
|
58
|
-
/** Test identifier for the input */
|
|
58
|
+
/** Test identifier for the input; on tablet/web the anchored popover also gets `{testID}-popover` when set */
|
|
59
59
|
testID?: string;
|
|
60
|
-
/** Test identifier for calendar root */
|
|
60
|
+
/** Test identifier for calendar root; if `testID` is unset, the popover uses `{calendarTestID}-popover` when set */
|
|
61
61
|
calendarTestID?: string;
|
|
62
62
|
/** Called when user presses input (native) */
|
|
63
63
|
onPressIn?: (...args: any[]) => void;
|
package/index.tsx
CHANGED
|
@@ -72,9 +72,9 @@ export interface DateTimePickerProps extends Omit<UITextInputProps, 'value' | 'o
|
|
|
72
72
|
visible?: boolean
|
|
73
73
|
/** Scoped model controlling visibility */
|
|
74
74
|
$visible?: any
|
|
75
|
-
/** Test identifier for the input */
|
|
75
|
+
/** Test identifier for the input; on tablet/web the anchored popover also gets `{testID}-popover` when set */
|
|
76
76
|
testID?: string
|
|
77
|
-
/** Test identifier for calendar root */
|
|
77
|
+
/** Test identifier for calendar root; if `testID` is unset, the popover uses `{calendarTestID}-popover` when set */
|
|
78
78
|
calendarTestID?: string
|
|
79
79
|
/** Called when user presses input (native) */
|
|
80
80
|
onPressIn?: (...args: any[]) => void
|
|
@@ -312,6 +312,7 @@ function DateTimePicker ({
|
|
|
312
312
|
if (Platform.OS === 'web') {
|
|
313
313
|
inputProps.editable = false
|
|
314
314
|
inputProps.onFocus = _onPressIn
|
|
315
|
+
if (textInput) inputProps['aria-valuetext'] = textInput
|
|
315
316
|
}
|
|
316
317
|
|
|
317
318
|
if (Platform.OS === 'android') {
|
|
@@ -436,6 +437,13 @@ function DateTimePicker ({
|
|
|
436
437
|
`
|
|
437
438
|
}
|
|
438
439
|
|
|
440
|
+
const abstractPopoverTestID =
|
|
441
|
+
testID != null && String(testID) !== ''
|
|
442
|
+
? `${String(testID)}-popover`
|
|
443
|
+
: calendarTestID != null && String(calendarTestID) !== ''
|
|
444
|
+
? `${String(calendarTestID)}-popover`
|
|
445
|
+
: undefined
|
|
446
|
+
|
|
439
447
|
return pug`
|
|
440
448
|
// Android datetimepicker rendered inside its own modal
|
|
441
449
|
if Platform.OS === 'android'
|
|
@@ -447,6 +455,7 @@ function DateTimePicker ({
|
|
|
447
455
|
visible=visible
|
|
448
456
|
anchorRef=inputRef
|
|
449
457
|
renderWrapper=renderWrapper
|
|
458
|
+
testID=abstractPopoverTestID
|
|
450
459
|
)= renderPopoverContent()
|
|
451
460
|
else
|
|
452
461
|
= caption
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/date-time-picker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
12
12
|
"@react-native-community/datetimepicker": "^8.4.4",
|
|
13
|
-
"@startupjs-ui/abstract-popover": "^0.
|
|
14
|
-
"@startupjs-ui/button": "^0.
|
|
15
|
-
"@startupjs-ui/core": "^0.
|
|
16
|
-
"@startupjs-ui/div": "^0.
|
|
17
|
-
"@startupjs-ui/divider": "^0.
|
|
18
|
-
"@startupjs-ui/drawer": "^0.
|
|
19
|
-
"@startupjs-ui/flat-list": "^0.
|
|
20
|
-
"@startupjs-ui/icon": "^0.
|
|
21
|
-
"@startupjs-ui/popover": "^0.
|
|
22
|
-
"@startupjs-ui/span": "^0.
|
|
23
|
-
"@startupjs-ui/text-input": "^0.
|
|
13
|
+
"@startupjs-ui/abstract-popover": "^0.3.0",
|
|
14
|
+
"@startupjs-ui/button": "^0.3.0",
|
|
15
|
+
"@startupjs-ui/core": "^0.3.0",
|
|
16
|
+
"@startupjs-ui/div": "^0.3.0",
|
|
17
|
+
"@startupjs-ui/divider": "^0.3.0",
|
|
18
|
+
"@startupjs-ui/drawer": "^0.3.0",
|
|
19
|
+
"@startupjs-ui/flat-list": "^0.3.0",
|
|
20
|
+
"@startupjs-ui/icon": "^0.3.0",
|
|
21
|
+
"@startupjs-ui/popover": "^0.3.0",
|
|
22
|
+
"@startupjs-ui/span": "^0.3.0",
|
|
23
|
+
"@startupjs-ui/text-input": "^0.3.0",
|
|
24
24
|
"moment-timezone": "^0.5.31",
|
|
25
25
|
"react-native-safe-area-context": "^5.6.0"
|
|
26
26
|
},
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"react-native": "*",
|
|
30
30
|
"startupjs": "*"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "8d212b47680af1dfe582f9759b38724b46488e25"
|
|
33
33
|
}
|