@dhis2-ui/checkbox 8.15.0-alpha.3 → 8.15.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/package.json +6 -9
- package/types/index.d.ts +0 -120
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/checkbox",
|
|
3
|
-
"version": "8.15.0
|
|
3
|
+
"version": "8.15.0",
|
|
4
4
|
"description": "UI Checkbox",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"main": "./build/cjs/index.js",
|
|
14
14
|
"module": "./build/es/index.js",
|
|
15
15
|
"exports": {
|
|
16
|
-
"types": "./types/index.d.ts",
|
|
17
16
|
"import": "./build/es/index.js",
|
|
18
17
|
"require": "./build/cjs/index.js"
|
|
19
18
|
},
|
|
@@ -33,20 +32,18 @@
|
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
34
|
"@dhis2/prop-types": "^3.1.2",
|
|
36
|
-
"@dhis2-ui/field": "8.15.0
|
|
37
|
-
"@dhis2-ui/required": "8.15.0
|
|
38
|
-
"@dhis2/ui-constants": "8.15.0
|
|
35
|
+
"@dhis2-ui/field": "8.15.0",
|
|
36
|
+
"@dhis2-ui/required": "8.15.0",
|
|
37
|
+
"@dhis2/ui-constants": "8.15.0",
|
|
39
38
|
"classnames": "^2.3.1",
|
|
40
39
|
"prop-types": "^15.7.2"
|
|
41
40
|
},
|
|
42
41
|
"files": [
|
|
43
|
-
"build"
|
|
44
|
-
"types"
|
|
42
|
+
"build"
|
|
45
43
|
],
|
|
46
44
|
"devDependencies": {
|
|
47
45
|
"react": "16.13",
|
|
48
46
|
"react-dom": "16.13",
|
|
49
47
|
"styled-jsx": "^4.0.1"
|
|
50
|
-
}
|
|
51
|
-
"types": "types"
|
|
48
|
+
}
|
|
52
49
|
}
|
package/types/index.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
export interface EventPayload {
|
|
4
|
-
value?: string
|
|
5
|
-
name?: string
|
|
6
|
-
checked: boolean
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type CheckboxEventHandler<Event extends React.SyntheticEvent> = (
|
|
10
|
-
arg0: EventPayload,
|
|
11
|
-
event: Event
|
|
12
|
-
) => void
|
|
13
|
-
|
|
14
|
-
type CheckboxFocusHandler = CheckboxEventHandler<
|
|
15
|
-
React.FocusEvent<HTMLInputElement>
|
|
16
|
-
>
|
|
17
|
-
type CheckboxChangeHandler = CheckboxEventHandler<
|
|
18
|
-
React.ChangeEvent<HTMLInputElement>
|
|
19
|
-
>
|
|
20
|
-
type CheckboxKeyHandler = CheckboxEventHandler<
|
|
21
|
-
React.KeyboardEvent<HTMLInputElement>
|
|
22
|
-
>
|
|
23
|
-
|
|
24
|
-
export interface CheckboxProps {
|
|
25
|
-
checked?: boolean
|
|
26
|
-
className?: string
|
|
27
|
-
dataTest?: string
|
|
28
|
-
dense?: boolean
|
|
29
|
-
disabled?: boolean
|
|
30
|
-
error?: boolean
|
|
31
|
-
indeterminate?: boolean
|
|
32
|
-
initialFocus?: boolean
|
|
33
|
-
label?: React.ReactNode
|
|
34
|
-
name?: string
|
|
35
|
-
tabIndex?: string
|
|
36
|
-
valid?: boolean
|
|
37
|
-
value?: string
|
|
38
|
-
warning?: boolean
|
|
39
|
-
onBlur?: CheckboxFocusHandler
|
|
40
|
-
/**
|
|
41
|
-
* Called with signature `(object, event)`
|
|
42
|
-
*/
|
|
43
|
-
onChange?: CheckboxChangeHandler
|
|
44
|
-
onFocus?: CheckboxFocusHandler
|
|
45
|
-
onKeyDown?: CheckboxKeyHandler
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export class Checkbox extends React.Component<CheckboxProps, any> {
|
|
49
|
-
render(): JSX.Element
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface CheckboxFieldProps {
|
|
53
|
-
checked?: boolean
|
|
54
|
-
className?: string
|
|
55
|
-
dataTest?: string
|
|
56
|
-
/**
|
|
57
|
-
* Smaller dimensions for information-dense layouts
|
|
58
|
-
*/
|
|
59
|
-
dense?: boolean
|
|
60
|
-
/**
|
|
61
|
-
* Disables the checkbox
|
|
62
|
-
*/
|
|
63
|
-
disabled?: boolean
|
|
64
|
-
/**
|
|
65
|
-
* Applies 'error' styling to checkbox and validation text for feedback. Mutually exclusive with `warning` and `valid` props
|
|
66
|
-
*/
|
|
67
|
-
error?: boolean
|
|
68
|
-
/**
|
|
69
|
-
* Useful instructions for the user
|
|
70
|
-
*/
|
|
71
|
-
helpText?: string
|
|
72
|
-
initialFocus?: boolean
|
|
73
|
-
/**
|
|
74
|
-
* Labels the checkbox
|
|
75
|
-
*/
|
|
76
|
-
label?: React.ReactNode
|
|
77
|
-
/**
|
|
78
|
-
* Name associate with the checkbox. Passed in object as argument to event handlers
|
|
79
|
-
*/
|
|
80
|
-
name?: string
|
|
81
|
-
/**
|
|
82
|
-
* Adds an asterisk to indicate this field is required
|
|
83
|
-
*/
|
|
84
|
-
required?: boolean
|
|
85
|
-
tabIndex?: string
|
|
86
|
-
/**
|
|
87
|
-
* Applies 'valid' styling to checkbox and validation text for feedback. Mutually exclusive with `warning` and `error` props
|
|
88
|
-
*/
|
|
89
|
-
valid?: boolean
|
|
90
|
-
/**
|
|
91
|
-
* Adds text below the checkbox to provide validation feedback. Acquires styles from `valid`, `warning` and `error` statuses
|
|
92
|
-
*/
|
|
93
|
-
validationText?: string
|
|
94
|
-
/**
|
|
95
|
-
* Value associated with the checkbox. Passed in object as argument to event handlers
|
|
96
|
-
*/
|
|
97
|
-
value?: string
|
|
98
|
-
/**
|
|
99
|
-
* Applies 'warning' styling to checkbox and validation text for feedback. Mutually exclusive with `valid` and `error` props
|
|
100
|
-
*/
|
|
101
|
-
warning?: boolean
|
|
102
|
-
/**
|
|
103
|
-
* Called with signature `({ name: string, value: string, checked: bool }, event)`
|
|
104
|
-
*/
|
|
105
|
-
onBlur?: CheckboxFocusHandler
|
|
106
|
-
/**
|
|
107
|
-
* Called with signature `({ name: string, value: string, checked: bool }, event)`
|
|
108
|
-
*/
|
|
109
|
-
onChange?: CheckboxChangeHandler
|
|
110
|
-
/**
|
|
111
|
-
* Called with signature `({ name: string, value: string, checked: bool }, event)`
|
|
112
|
-
*/
|
|
113
|
-
onFocus?: CheckboxFocusHandler
|
|
114
|
-
/**
|
|
115
|
-
* Called with signature `({ name: string, value: string, checked: bool }, event)`
|
|
116
|
-
*/
|
|
117
|
-
onKeyDown?: CheckboxKeyHandler
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export const CheckboxField: React.FC<CheckboxFieldProps>
|