@startupjs-ui/rank 0.2.0 → 0.3.1
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 +19 -0
- package/index.d.ts +2 -0
- package/index.tsx +16 -4
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.1](https://github.com/startupjs/startupjs-ui/compare/v0.3.0...v0.3.1) (2026-06-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @startupjs-ui/rank
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.3.0](https://github.com/startupjs/startupjs-ui/compare/v0.2.3...v0.3.0) (2026-05-27)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* [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))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [0.2.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.23...v0.2.0) (2026-05-04)
|
|
7
26
|
|
|
8
27
|
|
package/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export interface RankProps {
|
|
|
16
16
|
readonly?: boolean;
|
|
17
17
|
/** Fired when order changes; receives array of option values */
|
|
18
18
|
onChange?: (value: any[]) => void;
|
|
19
|
+
/** Test identifier */
|
|
20
|
+
testID?: string;
|
|
19
21
|
}
|
|
20
22
|
declare const _default: import("react").ComponentType<RankProps>;
|
|
21
23
|
export default _default;
|
package/index.tsx
CHANGED
|
@@ -26,6 +26,8 @@ export interface RankProps {
|
|
|
26
26
|
readonly?: boolean
|
|
27
27
|
/** Fired when order changes; receives array of option values */
|
|
28
28
|
onChange?: (value: any[]) => void
|
|
29
|
+
/** Test identifier */
|
|
30
|
+
testID?: string
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
function Rank (props: RankProps): ReactNode {
|
|
@@ -46,7 +48,7 @@ function Rank (props: RankProps): ReactNode {
|
|
|
46
48
|
|
|
47
49
|
return pug`
|
|
48
50
|
if readonly
|
|
49
|
-
RankReadonly(value=sortedValue style=style)
|
|
51
|
+
RankReadonly(value=sortedValue style=style testID=props.testID)
|
|
50
52
|
else
|
|
51
53
|
RankInput(...props value=sortedValue)
|
|
52
54
|
`
|
|
@@ -56,12 +58,16 @@ const RankInput = observer(function RankInput ({
|
|
|
56
58
|
value,
|
|
57
59
|
onChange,
|
|
58
60
|
disabled,
|
|
59
|
-
style
|
|
61
|
+
style,
|
|
62
|
+
testID,
|
|
63
|
+
...props
|
|
60
64
|
}: {
|
|
61
65
|
value: any[]
|
|
62
66
|
onChange?: (value: any[]) => void
|
|
63
67
|
disabled?: boolean
|
|
64
68
|
style?: StyleProp<ViewStyle>
|
|
69
|
+
testID?: string
|
|
70
|
+
[key: string]: any
|
|
65
71
|
}): ReactNode {
|
|
66
72
|
const $width: any = $()
|
|
67
73
|
const dropId = useMemo(() => $.id(), [])
|
|
@@ -130,7 +136,9 @@ const RankInput = observer(function RankInput ({
|
|
|
130
136
|
|
|
131
137
|
return pug`
|
|
132
138
|
Div(
|
|
139
|
+
...props
|
|
133
140
|
style=style
|
|
141
|
+
testID=testID
|
|
134
142
|
onLayout=onLayout
|
|
135
143
|
)
|
|
136
144
|
Span.hint(italic) To rank the listed items drag and drop each item
|
|
@@ -143,13 +151,17 @@ const RankInput = observer(function RankInput ({
|
|
|
143
151
|
|
|
144
152
|
const RankReadonly = observer(function RankReadonly ({
|
|
145
153
|
value,
|
|
146
|
-
style
|
|
154
|
+
style,
|
|
155
|
+
testID,
|
|
156
|
+
...props
|
|
147
157
|
}: {
|
|
148
158
|
value: any[]
|
|
149
159
|
style?: StyleProp<ViewStyle>
|
|
160
|
+
testID?: string
|
|
161
|
+
[key: string]: any
|
|
150
162
|
}): ReactNode {
|
|
151
163
|
return pug`
|
|
152
|
-
Div(style=style)
|
|
164
|
+
Div(style=style testID=testID ...props)
|
|
153
165
|
each option, index in value
|
|
154
166
|
Div.readonly(key=index row)
|
|
155
167
|
Div.readonly-index
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/rank",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@startupjs-ui/core": "^0.
|
|
12
|
-
"@startupjs-ui/div": "^0.
|
|
13
|
-
"@startupjs-ui/draggable": "^0.
|
|
14
|
-
"@startupjs-ui/icon": "^0.
|
|
15
|
-
"@startupjs-ui/select": "^0.
|
|
16
|
-
"@startupjs-ui/span": "^0.
|
|
11
|
+
"@startupjs-ui/core": "^0.3.0",
|
|
12
|
+
"@startupjs-ui/div": "^0.3.1",
|
|
13
|
+
"@startupjs-ui/draggable": "^0.3.0",
|
|
14
|
+
"@startupjs-ui/icon": "^0.3.0",
|
|
15
|
+
"@startupjs-ui/select": "^0.3.1",
|
|
16
|
+
"@startupjs-ui/span": "^0.3.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "*",
|
|
20
20
|
"react-native": "*",
|
|
21
21
|
"startupjs": "*"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "60311773bdc83f354c797a272774304502d28c58"
|
|
24
24
|
}
|