@pareto-engineering/design-system 4.0.0-alpha.63 → 4.0.0-alpha.65
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/dist/cjs/f/FormInput/FormInput.js +13 -43
- package/dist/cjs/f/common/Label/Label.js +3 -18
- package/dist/cjs/f/common/Label/styles.scss +0 -5
- package/dist/cjs/f/common/index.js +1 -21
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +10 -20
- package/dist/cjs/f/fields/Checkbox/styles.scss +7 -5
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +8 -21
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +8 -33
- package/dist/cjs/f/fields/EditorInput/styles.scss +92 -90
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +10 -20
- package/dist/cjs/f/fields/LinkInput/styles.scss +52 -51
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +2 -26
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +0 -24
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +10 -17
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +13 -19
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +11 -4
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +11 -33
- package/dist/cjs/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +9 -33
- package/dist/cjs/f/fields/SelectInput/styles.scss +5 -2
- package/dist/cjs/f/fields/TextInput/TextInput.js +15 -37
- package/dist/cjs/f/fields/TextInput/styles.scss +37 -30
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +11 -35
- package/dist/cjs/f/fields/TextareaInput/styles.scss +30 -27
- package/dist/cjs/f/fields/index.js +1 -26
- package/dist/es/f/FormInput/FormInput.js +3 -33
- package/dist/es/f/common/Description/Description.js +1 -1
- package/dist/es/f/common/Label/Label.js +4 -20
- package/dist/es/f/common/Label/styles.scss +0 -5
- package/dist/es/f/common/index.js +1 -3
- package/dist/es/f/fields/Checkbox/Checkbox.js +11 -20
- package/dist/es/f/fields/Checkbox/styles.scss +7 -5
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +9 -22
- package/dist/es/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/es/f/fields/EditorInput/EditorInput.js +9 -34
- package/dist/es/f/fields/EditorInput/styles.scss +92 -90
- package/dist/es/f/fields/LinkInput/LinkInput.js +11 -19
- package/dist/es/f/fields/LinkInput/styles.scss +52 -51
- package/dist/es/f/fields/QueryChoices/QueryChoices.js +2 -26
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +1 -25
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +11 -18
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +14 -20
- package/dist/es/f/fields/QueryCombobox/styles.scss +11 -4
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +12 -35
- package/dist/es/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/es/f/fields/SelectInput/SelectInput.js +10 -34
- package/dist/es/f/fields/SelectInput/styles.scss +5 -2
- package/dist/es/f/fields/TextInput/TextInput.js +16 -36
- package/dist/es/f/fields/TextInput/styles.scss +37 -30
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +11 -35
- package/dist/es/f/fields/TextareaInput/styles.scss +30 -27
- package/dist/es/f/fields/index.js +1 -2
- package/package.json +3 -3
- package/src/stories/f/Checkbox.stories.jsx +13 -21
- package/src/stories/f/ChoicesInput.stories.jsx +12 -27
- package/src/stories/f/EditorInput.stories.jsx +7 -14
- package/src/stories/f/LinkInput.stories.jsx +15 -22
- package/src/stories/f/QueryChoices.stories.jsx +12 -19
- package/src/stories/f/QueryCombobox.stories.jsx +16 -24
- package/src/stories/f/QuerySelect.stories.jsx +12 -19
- package/src/stories/f/RatingsInput.stories.jsx +7 -14
- package/src/stories/f/SelectInput.stories.jsx +12 -19
- package/src/stories/f/TextInput.stories.jsx +16 -23
- package/src/stories/f/TextareaInput.stories.jsx +7 -14
- package/src/ui/f/FormInput/FormInput.jsx +12 -57
- package/src/ui/f/common/Description/Description.jsx +2 -2
- package/src/ui/f/common/Label/Label.jsx +2 -20
- package/src/ui/f/common/Label/styles.scss +0 -5
- package/src/ui/f/common/index.js +0 -2
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +22 -33
- package/src/ui/f/fields/Checkbox/styles.scss +7 -5
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +43 -57
- package/src/ui/f/fields/ChoicesInput/styles.scss +44 -41
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +13 -40
- package/src/ui/f/fields/EditorInput/styles.scss +92 -90
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +35 -44
- package/src/ui/f/fields/LinkInput/styles.scss +52 -51
- package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +0 -28
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +2 -30
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +32 -41
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +55 -62
- package/src/ui/f/fields/QueryCombobox/styles.scss +11 -4
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +0 -8
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +16 -46
- package/src/ui/f/fields/RatingsInput/styles.scss +5 -1
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +28 -58
- package/src/ui/f/fields/SelectInput/styles.scss +5 -2
- package/src/ui/f/fields/TextInput/TextInput.jsx +24 -49
- package/src/ui/f/fields/TextInput/styles.scss +37 -30
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +28 -57
- package/src/ui/f/fields/TextareaInput/styles.scss +30 -27
- package/src/ui/f/fields/index.js +0 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +609 -8434
- package/dist/cjs/f/common/InputWrapper/InputWrapper.js +0 -73
- package/dist/cjs/f/common/InputWrapper/index.js +0 -13
- package/dist/cjs/f/common/InputWrapper/styles.scss +0 -13
- package/dist/cjs/f/common/V2/Description/Description.js +0 -76
- package/dist/cjs/f/common/V2/Description/index.js +0 -13
- package/dist/cjs/f/common/V2/Description/styles.scss +0 -10
- package/dist/cjs/f/common/V2/Label/Label.js +0 -84
- package/dist/cjs/f/common/V2/Label/index.js +0 -13
- package/dist/cjs/f/common/V2/Label/styles.scss +0 -9
- package/dist/cjs/f/common/V2/index.js +0 -19
- package/dist/cjs/f/fields/V2/Checkbox/Checkbox.js +0 -122
- package/dist/cjs/f/fields/V2/Checkbox/index.js +0 -13
- package/dist/cjs/f/fields/V2/Checkbox/styles.scss +0 -16
- package/dist/cjs/f/fields/V2/ChoicesInput/ChoicesInput.js +0 -154
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/Choice.js +0 -104
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/index.js +0 -13
- package/dist/cjs/f/fields/V2/ChoicesInput/common/index.js +0 -12
- package/dist/cjs/f/fields/V2/ChoicesInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/ChoicesInput/styles.scss +0 -79
- package/dist/cjs/f/fields/V2/EditorInput/EditorInput.js +0 -197
- package/dist/cjs/f/fields/V2/EditorInput/common/Toolbar.js +0 -257
- package/dist/cjs/f/fields/V2/EditorInput/common/TreeViewPlugin.js +0 -18
- package/dist/cjs/f/fields/V2/EditorInput/common/index.js +0 -20
- package/dist/cjs/f/fields/V2/EditorInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/EditorInput/styles.scss +0 -149
- package/dist/cjs/f/fields/V2/LinkInput/LinkInput.js +0 -156
- package/dist/cjs/f/fields/V2/LinkInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/LinkInput/styles.scss +0 -90
- package/dist/cjs/f/fields/V2/QueryChoices/QueryChoices.js +0 -137
- package/dist/cjs/f/fields/V2/QueryChoices/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/QueryCombobox.js +0 -229
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +0 -236
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/Menu.js +0 -83
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +0 -300
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/common/index.js +0 -26
- package/dist/cjs/f/fields/V2/QueryCombobox/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/styles.scss +0 -127
- package/dist/cjs/f/fields/V2/QuerySelect/QuerySelect.js +0 -198
- package/dist/cjs/f/fields/V2/QuerySelect/index.js +0 -13
- package/dist/cjs/f/fields/V2/RatingsInput/RatingsInput.js +0 -130
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/Rating.js +0 -117
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/index.js +0 -13
- package/dist/cjs/f/fields/V2/RatingsInput/common/index.js +0 -12
- package/dist/cjs/f/fields/V2/RatingsInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/RatingsInput/styles.scss +0 -48
- package/dist/cjs/f/fields/V2/SelectInput/SelectInput.js +0 -154
- package/dist/cjs/f/fields/V2/SelectInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/SelectInput/styles.scss +0 -87
- package/dist/cjs/f/fields/V2/TextInput/TextInput.js +0 -155
- package/dist/cjs/f/fields/V2/TextInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/TextInput/styles.scss +0 -78
- package/dist/cjs/f/fields/V2/TextareaInput/TextareaInput.js +0 -152
- package/dist/cjs/f/fields/V2/TextareaInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/TextareaInput/styles.scss +0 -53
- package/dist/cjs/f/fields/V2/index.js +0 -82
- package/dist/es/f/common/InputWrapper/InputWrapper.js +0 -61
- package/dist/es/f/common/InputWrapper/index.js +0 -2
- package/dist/es/f/common/InputWrapper/styles.scss +0 -13
- package/dist/es/f/common/V2/Description/Description.js +0 -68
- package/dist/es/f/common/V2/Description/index.js +0 -2
- package/dist/es/f/common/V2/Description/styles.scss +0 -10
- package/dist/es/f/common/V2/Label/Label.js +0 -76
- package/dist/es/f/common/V2/Label/index.js +0 -2
- package/dist/es/f/common/V2/Label/styles.scss +0 -9
- package/dist/es/f/common/V2/index.js +0 -2
- package/dist/es/f/fields/V2/Checkbox/Checkbox.js +0 -114
- package/dist/es/f/fields/V2/Checkbox/index.js +0 -2
- package/dist/es/f/fields/V2/Checkbox/styles.scss +0 -16
- package/dist/es/f/fields/V2/ChoicesInput/ChoicesInput.js +0 -148
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/Choice.js +0 -97
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/index.js +0 -2
- package/dist/es/f/fields/V2/ChoicesInput/common/index.js +0 -1
- package/dist/es/f/fields/V2/ChoicesInput/index.js +0 -2
- package/dist/es/f/fields/V2/ChoicesInput/styles.scss +0 -79
- package/dist/es/f/fields/V2/EditorInput/EditorInput.js +0 -192
- package/dist/es/f/fields/V2/EditorInput/common/Toolbar.js +0 -246
- package/dist/es/f/fields/V2/EditorInput/common/TreeViewPlugin.js +0 -11
- package/dist/es/f/fields/V2/EditorInput/common/index.js +0 -2
- package/dist/es/f/fields/V2/EditorInput/index.js +0 -2
- package/dist/es/f/fields/V2/EditorInput/styles.scss +0 -149
- package/dist/es/f/fields/V2/LinkInput/LinkInput.js +0 -148
- package/dist/es/f/fields/V2/LinkInput/index.js +0 -2
- package/dist/es/f/fields/V2/LinkInput/styles.scss +0 -90
- package/dist/es/f/fields/V2/QueryChoices/QueryChoices.js +0 -126
- package/dist/es/f/fields/V2/QueryChoices/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/QueryCombobox.js +0 -221
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +0 -229
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/Menu.js +0 -73
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +0 -293
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/common/index.js +0 -3
- package/dist/es/f/fields/V2/QueryCombobox/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/styles.scss +0 -127
- package/dist/es/f/fields/V2/QuerySelect/QuerySelect.js +0 -186
- package/dist/es/f/fields/V2/QuerySelect/index.js +0 -2
- package/dist/es/f/fields/V2/RatingsInput/RatingsInput.js +0 -124
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/Rating.js +0 -109
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/index.js +0 -2
- package/dist/es/f/fields/V2/RatingsInput/common/index.js +0 -1
- package/dist/es/f/fields/V2/RatingsInput/index.js +0 -2
- package/dist/es/f/fields/V2/RatingsInput/styles.scss +0 -48
- package/dist/es/f/fields/V2/SelectInput/SelectInput.js +0 -146
- package/dist/es/f/fields/V2/SelectInput/index.js +0 -2
- package/dist/es/f/fields/V2/SelectInput/styles.scss +0 -87
- package/dist/es/f/fields/V2/TextInput/TextInput.js +0 -147
- package/dist/es/f/fields/V2/TextInput/index.js +0 -2
- package/dist/es/f/fields/V2/TextInput/styles.scss +0 -78
- package/dist/es/f/fields/V2/TextareaInput/TextareaInput.js +0 -146
- package/dist/es/f/fields/V2/TextareaInput/index.js +0 -2
- package/dist/es/f/fields/V2/TextareaInput/styles.scss +0 -53
- package/dist/es/f/fields/V2/index.js +0 -11
- package/src/stories/f/v2/Checkbox.stories.jsx +0 -102
- package/src/stories/f/v2/ChoicesInput.stories.jsx +0 -139
- package/src/stories/f/v2/EditorInput.stories.jsx +0 -81
- package/src/stories/f/v2/LinkInput.stories.jsx +0 -93
- package/src/stories/f/v2/QueryChoices.stories.jsx +0 -144
- package/src/stories/f/v2/QueryCombobox.stories.jsx +0 -301
- package/src/stories/f/v2/QuerySelect.stories.jsx +0 -150
- package/src/stories/f/v2/RatingsInput.stories.jsx +0 -77
- package/src/stories/f/v2/SelectInput.stories.jsx +0 -95
- package/src/stories/f/v2/TextInput.stories.jsx +0 -120
- package/src/stories/f/v2/TextareaInput.stories.jsx +0 -107
- package/src/stories/f/v2/__generated__/FormInputAllTaskStatusesQuery.graphql.js +0 -122
- package/src/stories/f/v2/__generated__/FormInputAllTeamsQuery.graphql.js +0 -139
- package/src/stories/f/v2/__generated__/QueryChoicesAllTaskStatusesQuery.graphql.js +0 -122
- package/src/stories/f/v2/__generated__/QueryComboboxAllTeamsQuery.graphql.js +0 -139
- package/src/stories/f/v2/__generated__/QuerySelectAllTaskStatusesQuery.graphql.js +0 -122
- package/src/ui/f/common/InputWrapper/InputWrapper.jsx +0 -83
- package/src/ui/f/common/InputWrapper/index.js +0 -2
- package/src/ui/f/common/InputWrapper/styles.scss +0 -13
- package/src/ui/f/common/V2/Description/Description.jsx +0 -94
- package/src/ui/f/common/V2/Description/index.js +0 -2
- package/src/ui/f/common/V2/Description/styles.scss +0 -10
- package/src/ui/f/common/V2/Label/Label.jsx +0 -102
- package/src/ui/f/common/V2/Label/index.js +0 -2
- package/src/ui/f/common/V2/Label/styles.scss +0 -9
- package/src/ui/f/common/V2/index.js +0 -2
- package/src/ui/f/fields/V2/Checkbox/Checkbox.jsx +0 -146
- package/src/ui/f/fields/V2/Checkbox/index.js +0 -2
- package/src/ui/f/fields/V2/Checkbox/styles.scss +0 -16
- package/src/ui/f/fields/V2/ChoicesInput/ChoicesInput.jsx +0 -183
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/Choice.jsx +0 -125
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/index.js +0 -2
- package/src/ui/f/fields/V2/ChoicesInput/common/index.js +0 -1
- package/src/ui/f/fields/V2/ChoicesInput/index.js +0 -2
- package/src/ui/f/fields/V2/ChoicesInput/styles.scss +0 -79
- package/src/ui/f/fields/V2/EditorInput/EditorInput.jsx +0 -244
- package/src/ui/f/fields/V2/EditorInput/common/Toolbar.jsx +0 -356
- package/src/ui/f/fields/V2/EditorInput/common/TreeViewPlugin.jsx +0 -16
- package/src/ui/f/fields/V2/EditorInput/common/index.jsx +0 -2
- package/src/ui/f/fields/V2/EditorInput/index.js +0 -2
- package/src/ui/f/fields/V2/EditorInput/styles.scss +0 -149
- package/src/ui/f/fields/V2/LinkInput/LinkInput.jsx +0 -187
- package/src/ui/f/fields/V2/LinkInput/index.js +0 -2
- package/src/ui/f/fields/V2/LinkInput/styles.scss +0 -90
- package/src/ui/f/fields/V2/QueryChoices/QueryChoices.jsx +0 -153
- package/src/ui/f/fields/V2/QueryChoices/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/QueryCombobox.jsx +0 -254
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/Combobox.jsx +0 -276
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/Menu.jsx +0 -103
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +0 -362
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/common/index.js +0 -3
- package/src/ui/f/fields/V2/QueryCombobox/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/styles.scss +0 -127
- package/src/ui/f/fields/V2/QuerySelect/QuerySelect.jsx +0 -220
- package/src/ui/f/fields/V2/QuerySelect/index.js +0 -2
- package/src/ui/f/fields/V2/RatingsInput/RatingsInput.jsx +0 -152
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/Rating.jsx +0 -142
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/index.js +0 -2
- package/src/ui/f/fields/V2/RatingsInput/common/index.js +0 -1
- package/src/ui/f/fields/V2/RatingsInput/index.js +0 -2
- package/src/ui/f/fields/V2/RatingsInput/styles.scss +0 -48
- package/src/ui/f/fields/V2/SelectInput/SelectInput.jsx +0 -187
- package/src/ui/f/fields/V2/SelectInput/index.js +0 -2
- package/src/ui/f/fields/V2/SelectInput/styles.scss +0 -87
- package/src/ui/f/fields/V2/TextInput/TextInput.jsx +0 -192
- package/src/ui/f/fields/V2/TextInput/index.js +0 -2
- package/src/ui/f/fields/V2/TextInput/styles.scss +0 -78
- package/src/ui/f/fields/V2/TextareaInput/TextareaInput.jsx +0 -180
- package/src/ui/f/fields/V2/TextareaInput/index.js +0 -2
- package/src/ui/f/fields/V2/TextareaInput/styles.scss +0 -53
- package/src/ui/f/fields/V2/index.js +0 -11
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import { Formik, Form, useField } from 'formik'
|
|
5
|
-
|
|
6
|
-
import { Button, FormDebugger, QueryComboboxV2 } from 'ui'
|
|
7
|
-
|
|
8
|
-
import { fruits } from '../../utils/testData'
|
|
9
|
-
|
|
10
|
-
import generateNodeId from '../../utils/generateNodeId'
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
RelayEnvironmentProvider,
|
|
14
|
-
mockRelayOperation,
|
|
15
|
-
// environment,
|
|
16
|
-
} from '../../utils/relay'
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
title :'f/fields/V2/QueryComboboxV2',
|
|
20
|
-
component :QueryComboboxV2,
|
|
21
|
-
subcomponents:{
|
|
22
|
-
// Item:QueryComboboxV2.Item
|
|
23
|
-
},
|
|
24
|
-
decorators:[
|
|
25
|
-
(storyfn) => (
|
|
26
|
-
<RelayEnvironmentProvider>
|
|
27
|
-
{ storyfn() }
|
|
28
|
-
</RelayEnvironmentProvider>
|
|
29
|
-
),
|
|
30
|
-
],
|
|
31
|
-
argTypes:{
|
|
32
|
-
disabled :{ control: 'boolean' },
|
|
33
|
-
type :{ control: 'text' },
|
|
34
|
-
name :{ control: 'text' },
|
|
35
|
-
color :{ control: 'text' },
|
|
36
|
-
label :{ control: 'text' },
|
|
37
|
-
labelColor:{ control: 'text' },
|
|
38
|
-
multiple :{ control: 'boolean' },
|
|
39
|
-
optional :{ control: 'boolean' },
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const allTeamsMockData = {
|
|
44
|
-
PageInfo() {
|
|
45
|
-
return {
|
|
46
|
-
hasNextPage :true,
|
|
47
|
-
hasPreviousPage:true,
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
TeamNodeConnection:(args) => {
|
|
51
|
-
const edges = fruits.map((fruit) => ({
|
|
52
|
-
node:{
|
|
53
|
-
id :generateNodeId('TeamNode'),
|
|
54
|
-
name:fruit,
|
|
55
|
-
},
|
|
56
|
-
}))
|
|
57
|
-
|
|
58
|
-
// eslint-disable-next-line camelcase
|
|
59
|
-
const { name_Icontains } = args?.args || {}
|
|
60
|
-
|
|
61
|
-
return ({
|
|
62
|
-
pageInfo:{
|
|
63
|
-
hasNextPage :true,
|
|
64
|
-
hasPreviousPage:true,
|
|
65
|
-
},
|
|
66
|
-
// eslint-disable-next-line camelcase
|
|
67
|
-
edges:name_Icontains?.trim()
|
|
68
|
-
? edges.filter(({ node }) => node.name
|
|
69
|
-
.toLowerCase()
|
|
70
|
-
.includes(name_Icontains.toLowerCase()))
|
|
71
|
-
: [],
|
|
72
|
-
})
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const FETCH_TEAMS_QUERY = graphql`
|
|
77
|
-
query QueryComboboxAllTeamsQuery($name_Icontains: String) {
|
|
78
|
-
allTeams(name_Icontains: $name_Icontains) {
|
|
79
|
-
edges {
|
|
80
|
-
node {
|
|
81
|
-
id
|
|
82
|
-
name
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
`
|
|
88
|
-
|
|
89
|
-
// eslint-disable-next-line react/prop-types
|
|
90
|
-
const ResolvedTemplate = ({ defaultFormikState, ...otherProps }) => {
|
|
91
|
-
mockRelayOperation(allTeamsMockData)
|
|
92
|
-
mockRelayOperation(allTeamsMockData)
|
|
93
|
-
mockRelayOperation(allTeamsMockData)
|
|
94
|
-
|
|
95
|
-
const { multiple } = otherProps
|
|
96
|
-
|
|
97
|
-
const Content = () => {
|
|
98
|
-
const name = multiple ? 'teams' : 'team'
|
|
99
|
-
|
|
100
|
-
const [, meta, helpers] = useField(name)
|
|
101
|
-
|
|
102
|
-
const { value } = meta
|
|
103
|
-
|
|
104
|
-
const { setValue } = helpers
|
|
105
|
-
|
|
106
|
-
const updateFormikState = () => {
|
|
107
|
-
if (multiple) {
|
|
108
|
-
setValue([
|
|
109
|
-
...(value || []),
|
|
110
|
-
{
|
|
111
|
-
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNk',
|
|
112
|
-
label:'Matomoko',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNp',
|
|
116
|
-
label:'Chungwa',
|
|
117
|
-
},
|
|
118
|
-
])
|
|
119
|
-
} else {
|
|
120
|
-
setValue({
|
|
121
|
-
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNk',
|
|
122
|
-
label:'Kafagoho',
|
|
123
|
-
})
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<div
|
|
129
|
-
style={{
|
|
130
|
-
display :'flex',
|
|
131
|
-
flexDirection:'column',
|
|
132
|
-
gap :'1rem',
|
|
133
|
-
}}
|
|
134
|
-
>
|
|
135
|
-
<QueryComboboxV2
|
|
136
|
-
label="Search for a team"
|
|
137
|
-
optionsKeyMap={{
|
|
138
|
-
value :'id',
|
|
139
|
-
getLabel:(node) => node.name,
|
|
140
|
-
}}
|
|
141
|
-
query={{
|
|
142
|
-
graphql :FETCH_TEAMS_QUERY,
|
|
143
|
-
accessor:'allTeams',
|
|
144
|
-
}}
|
|
145
|
-
name={name}
|
|
146
|
-
searchVariable="name_Icontains"
|
|
147
|
-
{...otherProps}
|
|
148
|
-
/>
|
|
149
|
-
<div>
|
|
150
|
-
<FormDebugger />
|
|
151
|
-
<Button
|
|
152
|
-
onClick={updateFormikState}
|
|
153
|
-
>
|
|
154
|
-
{multiple ? 'Add formik values' : 'Replace formik value'}
|
|
155
|
-
</Button>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
let initialValues = defaultFormikState
|
|
162
|
-
|
|
163
|
-
if (!defaultFormikState && multiple) {
|
|
164
|
-
initialValues = []
|
|
165
|
-
} else if (!defaultFormikState && !multiple) {
|
|
166
|
-
initialValues = {}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return (
|
|
170
|
-
<Formik
|
|
171
|
-
initialValues={initialValues}
|
|
172
|
-
>
|
|
173
|
-
<Form>
|
|
174
|
-
<Content />
|
|
175
|
-
</Form>
|
|
176
|
-
</Formik>
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export const Optional = ResolvedTemplate.bind({})
|
|
181
|
-
Optional.args = {
|
|
182
|
-
optional:true,
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export const WithPlaceholder = ResolvedTemplate.bind({})
|
|
186
|
-
WithPlaceholder.args = {
|
|
187
|
-
placeholder:'Search for a team',
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export const WithPromptToCreateNewOption = ResolvedTemplate.bind({})
|
|
191
|
-
WithPromptToCreateNewOption.args = {
|
|
192
|
-
placeholder :'Search for a team',
|
|
193
|
-
promptCreateNewOption:true,
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export const SingleSelect = ResolvedTemplate.bind({})
|
|
197
|
-
SingleSelect.args = {
|
|
198
|
-
multiple:false,
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export const SingleSelectWithDefaultFormikState = ResolvedTemplate.bind({})
|
|
202
|
-
SingleSelectWithDefaultFormikState.args = {
|
|
203
|
-
multiple :false,
|
|
204
|
-
defaultFormikState:{
|
|
205
|
-
team:{
|
|
206
|
-
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
207
|
-
label:'Apple',
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export const MultipleSelect = ResolvedTemplate.bind({})
|
|
213
|
-
MultipleSelect.args = {
|
|
214
|
-
multiple :true,
|
|
215
|
-
defaultFormikState:{ teams: [] },
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export const MultipleSelectWithPromptForNewOptions = ResolvedTemplate.bind({})
|
|
219
|
-
MultipleSelectWithPromptForNewOptions.args = {
|
|
220
|
-
multiple :true,
|
|
221
|
-
promptCreateNewOption:true,
|
|
222
|
-
defaultFormikState :{ teams: [] },
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export const MultipleSelectWithDefaultFormikState = ResolvedTemplate.bind({})
|
|
226
|
-
MultipleSelectWithDefaultFormikState.args = {
|
|
227
|
-
multiple :true,
|
|
228
|
-
defaultFormikState:{
|
|
229
|
-
teams:[
|
|
230
|
-
{
|
|
231
|
-
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
232
|
-
label:'Apple',
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
value:'VGVhbU5vZGU6MDA0N2U4MzktODY0Zi00N2U5LTg3ZjgtZGUwMmM2Yzg1YWJm',
|
|
236
|
-
label:'Pear',
|
|
237
|
-
},
|
|
238
|
-
],
|
|
239
|
-
},
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// eslint-disable-next-line react/prop-types
|
|
243
|
-
// const RejectedTemplate = ({ multiple }) => {
|
|
244
|
-
// const Content = () => {
|
|
245
|
-
// environment.mock.queuePendingOperation(
|
|
246
|
-
// FETCH_TEAMS_QUERY,
|
|
247
|
-
// { name_Icontains: 'a' },
|
|
248
|
-
// )
|
|
249
|
-
|
|
250
|
-
// environment.mock.rejectMostRecentOperation('An error has occured while fetching the teams')
|
|
251
|
-
|
|
252
|
-
// const name = multiple ? 'teams' : 'team'
|
|
253
|
-
|
|
254
|
-
// const [, meta, helpers] = useField(name)
|
|
255
|
-
|
|
256
|
-
// const { setValue, setError } = helpers
|
|
257
|
-
|
|
258
|
-
// const { error } = meta
|
|
259
|
-
|
|
260
|
-
// return (
|
|
261
|
-
// <>
|
|
262
|
-
// <QueryCombobox
|
|
263
|
-
// query={FETCH_TEAMS_QUERY}
|
|
264
|
-
// label="Search for a team"
|
|
265
|
-
// optionsKeyMap={{
|
|
266
|
-
// value:'id',
|
|
267
|
-
// label:'name',
|
|
268
|
-
// }}
|
|
269
|
-
// error={error}
|
|
270
|
-
// setValue={setValue}
|
|
271
|
-
// setError={setError}
|
|
272
|
-
// name={name}
|
|
273
|
-
// multiple={multiple}
|
|
274
|
-
// graphQlNode="allTeams"
|
|
275
|
-
// searchVariable="name_Icontains"
|
|
276
|
-
// />
|
|
277
|
-
// <FormDebugger />
|
|
278
|
-
// </>
|
|
279
|
-
// )
|
|
280
|
-
// }
|
|
281
|
-
|
|
282
|
-
// return (
|
|
283
|
-
// <Formik
|
|
284
|
-
// initialValues={{ team: '' }}
|
|
285
|
-
// >
|
|
286
|
-
// <Form>
|
|
287
|
-
// <Content />
|
|
288
|
-
// </Form>
|
|
289
|
-
// </Formik>
|
|
290
|
-
// )
|
|
291
|
-
// }
|
|
292
|
-
|
|
293
|
-
// export const SingleSelectWithError = RejectedTemplate.bind({})
|
|
294
|
-
// SingleSelectWithError.args = {
|
|
295
|
-
// multiple:false,
|
|
296
|
-
// }
|
|
297
|
-
|
|
298
|
-
// export const MultipleSelectWithError = RejectedTemplate.bind({})
|
|
299
|
-
// MultipleSelectWithError.args = {
|
|
300
|
-
// multiple:true,
|
|
301
|
-
// }
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import { QuerySelectV2, FormDebugger } from 'ui'
|
|
5
|
-
|
|
6
|
-
import { Formik, Form } from 'formik'
|
|
7
|
-
|
|
8
|
-
import generateNodeId from '../../utils/generateNodeId'
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
RelayEnvironmentProvider,
|
|
12
|
-
mockRelayOperation,
|
|
13
|
-
environment,
|
|
14
|
-
} from '../../utils/relay'
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
title :'f/fields/V2/QuerySelectV2',
|
|
18
|
-
component :QuerySelectV2,
|
|
19
|
-
subcomponents:{
|
|
20
|
-
// Item:QuerySelectV2.Item
|
|
21
|
-
},
|
|
22
|
-
decorators:[
|
|
23
|
-
// storyfn => <div className="">{ storyfn() }</div>,
|
|
24
|
-
(storyfn) => (
|
|
25
|
-
<RelayEnvironmentProvider>
|
|
26
|
-
{ storyfn() }
|
|
27
|
-
</RelayEnvironmentProvider>
|
|
28
|
-
),
|
|
29
|
-
],
|
|
30
|
-
argTypes:{
|
|
31
|
-
color :{ control: 'text' },
|
|
32
|
-
label :{ control: 'text' },
|
|
33
|
-
labelColor:{ control: 'text' },
|
|
34
|
-
isLoading :{ control: 'boolean' },
|
|
35
|
-
optional :{ control: 'boolean' },
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
const statuses = [
|
|
39
|
-
'Backlog',
|
|
40
|
-
'In Review',
|
|
41
|
-
'In Progress',
|
|
42
|
-
'Requested',
|
|
43
|
-
'Blocked',
|
|
44
|
-
'Completed',
|
|
45
|
-
]
|
|
46
|
-
const allTaskStatusesMockData = {
|
|
47
|
-
PageInfo() {
|
|
48
|
-
return {
|
|
49
|
-
hasNextPage :true,
|
|
50
|
-
hasPreviousPage:true,
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
TaskStatusNodeConnection:() => ({
|
|
54
|
-
pageInfo:{
|
|
55
|
-
hasNextPage :true,
|
|
56
|
-
hasPreviousPage:true,
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
edges:statuses.map((status) => ({
|
|
60
|
-
node:{
|
|
61
|
-
id:generateNodeId('TaskStatusNode'),
|
|
62
|
-
status,
|
|
63
|
-
},
|
|
64
|
-
})),
|
|
65
|
-
}),
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const FETCH_ALL_TASK_STATUSES = graphql`
|
|
69
|
-
query QuerySelectAllTaskStatusesQuery {
|
|
70
|
-
allTaskStatuses {
|
|
71
|
-
edges {
|
|
72
|
-
node {
|
|
73
|
-
id
|
|
74
|
-
status
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
`
|
|
80
|
-
|
|
81
|
-
// eslint-disable-next-line react/prop-types
|
|
82
|
-
const Template = ({ isLoading, defaultFormikState, ...args }) => {
|
|
83
|
-
if (isLoading) {
|
|
84
|
-
setTimeout(() => {
|
|
85
|
-
mockRelayOperation(allTaskStatusesMockData)
|
|
86
|
-
environment.mock.queuePendingOperation(
|
|
87
|
-
FETCH_ALL_TASK_STATUSES,
|
|
88
|
-
)
|
|
89
|
-
}, 500)
|
|
90
|
-
} else {
|
|
91
|
-
mockRelayOperation(allTaskStatusesMockData)
|
|
92
|
-
environment.mock.queuePendingOperation(
|
|
93
|
-
FETCH_ALL_TASK_STATUSES,
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const Content = () => (
|
|
98
|
-
<div
|
|
99
|
-
style={{
|
|
100
|
-
display :'flex',
|
|
101
|
-
flexDirection:'column',
|
|
102
|
-
gap :'1rem',
|
|
103
|
-
}}
|
|
104
|
-
>
|
|
105
|
-
<QuerySelectV2
|
|
106
|
-
name="status"
|
|
107
|
-
label="Select Task Status"
|
|
108
|
-
query={{
|
|
109
|
-
graphql :FETCH_ALL_TASK_STATUSES,
|
|
110
|
-
accessor:'allTaskStatuses',
|
|
111
|
-
}}
|
|
112
|
-
optionsKeyMap={{
|
|
113
|
-
value :'id',
|
|
114
|
-
getLabel:(node) => node.status,
|
|
115
|
-
}}
|
|
116
|
-
{...args}
|
|
117
|
-
/>
|
|
118
|
-
<FormDebugger />
|
|
119
|
-
</div>
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
const initialValues = defaultFormikState ?? { status: '' }
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<Formik
|
|
126
|
-
initialValues={initialValues}
|
|
127
|
-
>
|
|
128
|
-
<Form>
|
|
129
|
-
<Content />
|
|
130
|
-
</Form>
|
|
131
|
-
</Formik>
|
|
132
|
-
)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export const Base = Template.bind({})
|
|
136
|
-
export const WithDefaultValue = Template.bind({})
|
|
137
|
-
WithDefaultValue.args = {
|
|
138
|
-
defaultFormikState:{
|
|
139
|
-
status:'VGFza1N0YXR1c05vZGU6NGRiYjNlMmItMGIxYy00ZjIxLTk0MmUtZTNjZGQwMjdiNjU3',
|
|
140
|
-
},
|
|
141
|
-
}
|
|
142
|
-
export const LoadingOptions = Template.bind({})
|
|
143
|
-
LoadingOptions.args = {
|
|
144
|
-
isLoading:true,
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export const Optional = Template.bind({})
|
|
148
|
-
Optional.args = {
|
|
149
|
-
optional:true,
|
|
150
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import { Formik, Form } from 'formik'
|
|
5
|
-
|
|
6
|
-
import { RatingsInputV2, FormDebugger } from 'ui'
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title :'f/fields/V2/RatingsInputV2',
|
|
10
|
-
component :RatingsInputV2,
|
|
11
|
-
subcomponents:{
|
|
12
|
-
// Item:RatingsInputV2.Item
|
|
13
|
-
},
|
|
14
|
-
decorators:[
|
|
15
|
-
(storyfn) => (
|
|
16
|
-
<Formik
|
|
17
|
-
initialValues={{ ratings: '' }}
|
|
18
|
-
>
|
|
19
|
-
<Form>
|
|
20
|
-
{ storyfn() }
|
|
21
|
-
</Form>
|
|
22
|
-
</Formik>
|
|
23
|
-
),
|
|
24
|
-
],
|
|
25
|
-
argTypes:{
|
|
26
|
-
// backgroundColor:{ control: 'color' },
|
|
27
|
-
ratingCount :{ control: 'number' },
|
|
28
|
-
name :{ control: 'text' },
|
|
29
|
-
label :{ control: 'text' },
|
|
30
|
-
labelColor :{ control: 'text' },
|
|
31
|
-
showRatingValue :{ control: 'boolean' },
|
|
32
|
-
displayRatingsLabel:{ control: 'boolean' },
|
|
33
|
-
labelMax :{ control: 'text' },
|
|
34
|
-
labelMin :{ control: 'text' },
|
|
35
|
-
optional :{ control: 'boolean' },
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const Template = (args) => (
|
|
40
|
-
<div
|
|
41
|
-
style={{
|
|
42
|
-
display :'flex',
|
|
43
|
-
flexDirection:'column',
|
|
44
|
-
gap :'1rem',
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
<RatingsInputV2 {...args} />
|
|
48
|
-
<FormDebugger />
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
export const Base = Template.bind({})
|
|
53
|
-
Base.args = {
|
|
54
|
-
ratingCount:5,
|
|
55
|
-
name :'ratings',
|
|
56
|
-
label :'Your Rating',
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const Optional = Template.bind({})
|
|
60
|
-
Optional.args = {
|
|
61
|
-
...Base.args,
|
|
62
|
-
optional:true,
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const Numbers = Template.bind({})
|
|
66
|
-
Numbers.args = {
|
|
67
|
-
...Base.args,
|
|
68
|
-
showRatingValue:true,
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const Labels = Template.bind({})
|
|
72
|
-
Labels.args = {
|
|
73
|
-
...Numbers.args,
|
|
74
|
-
labelMax :'very satisfied.',
|
|
75
|
-
labelMin :'not satisfied.',
|
|
76
|
-
displayRatingsLabel:true,
|
|
77
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import { Formik, Form } from 'formik'
|
|
4
|
-
|
|
5
|
-
import { SelectInputV2, FormDebugger } from 'ui'
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title :'f/fields/V2/SelectInputV2',
|
|
9
|
-
component :SelectInputV2,
|
|
10
|
-
subcomponents:{
|
|
11
|
-
// Item:SelectInputV2.Item
|
|
12
|
-
},
|
|
13
|
-
decorators:[
|
|
14
|
-
(storyfn) => (
|
|
15
|
-
<Formik
|
|
16
|
-
initialValues={{ workType: '' }}
|
|
17
|
-
>
|
|
18
|
-
<Form>
|
|
19
|
-
{ storyfn() }
|
|
20
|
-
</Form>
|
|
21
|
-
</Formik>
|
|
22
|
-
),
|
|
23
|
-
],
|
|
24
|
-
argTypes:{
|
|
25
|
-
color :{ control: 'text' },
|
|
26
|
-
label :{ control: 'text' },
|
|
27
|
-
labelColor:{ control: 'text' },
|
|
28
|
-
disabled :{ control: 'boolean' },
|
|
29
|
-
optional :{ control: 'boolean' },
|
|
30
|
-
},
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const Template = (args) => (
|
|
34
|
-
<div
|
|
35
|
-
style={{
|
|
36
|
-
display :'flex',
|
|
37
|
-
flexDirection:'column',
|
|
38
|
-
gap :'1rem',
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<SelectInputV2 {...args} />
|
|
42
|
-
<FormDebugger />
|
|
43
|
-
</div>
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
export const Base = Template.bind({})
|
|
47
|
-
Base.args = {
|
|
48
|
-
name :'workType',
|
|
49
|
-
label :'Work Type',
|
|
50
|
-
options:[
|
|
51
|
-
{ value: '', label: 'Select an option', disabled: true },
|
|
52
|
-
{ value: 'Work', label: 'Work' },
|
|
53
|
-
{ value: 'Managing', label: 'Managing' },
|
|
54
|
-
{ value: 'Training', label: 'Training' },
|
|
55
|
-
],
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const Optional = Template.bind({})
|
|
59
|
-
Optional.args = {
|
|
60
|
-
...Base.args,
|
|
61
|
-
optional:true,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const StringAndObjects = Template.bind({})
|
|
65
|
-
StringAndObjects.args = {
|
|
66
|
-
...Base.args,
|
|
67
|
-
options:[...Base.args.options, 'Option1', 'Option2', 'Option3'],
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const requiredInput = (inputValue) => {
|
|
71
|
-
let error = ''
|
|
72
|
-
|
|
73
|
-
if (!inputValue || !inputValue?.length === 0) {
|
|
74
|
-
error = 'This information is required'
|
|
75
|
-
}
|
|
76
|
-
return error
|
|
77
|
-
}
|
|
78
|
-
export const Required = Template.bind({})
|
|
79
|
-
Required.args = {
|
|
80
|
-
...Base.args,
|
|
81
|
-
validate:requiredInput,
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export const DisabledSelectInput = Template.bind({})
|
|
85
|
-
DisabledSelectInput.args = {
|
|
86
|
-
...Base.args,
|
|
87
|
-
disabled:true,
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export const DisabledWithDescriptionSelectInput = Template.bind({})
|
|
91
|
-
DisabledWithDescriptionSelectInput.args = {
|
|
92
|
-
...Base.args,
|
|
93
|
-
disabled :true,
|
|
94
|
-
description:'This is a description',
|
|
95
|
-
}
|