dso-toolkit 38.0.0 → 39.0.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/components/Componenten/rich-content/rich-content.njk +1 -0
- package/components/Componenten/shopping-cart/shopping-cart.config.yml +12 -0
- package/components/Componenten/shopping-cart/shopping-cart.filters.js +0 -3
- package/components/Componenten/shopping-cart/shopping-cart.njk +12 -8
- package/components/Voorbeelden/20-Toepassingen/10-Aanvragen/activiteiten.config.yml +1 -0
- package/components/Voorbeelden/20-Toepassingen/50-Stelselcatalogus/Begrippen.njk +3 -1
- package/dist/library/@dso-toolkit/core/cjs/dso-badge.cjs.entry.js +1 -1
- package/dist/library/@dso-toolkit/core/cjs/dso-dropdown-menu.cjs.entry.js +11 -28
- package/dist/library/@dso-toolkit/core/cjs/dso-map-controls.cjs.entry.js +1 -1
- package/dist/library/@dso-toolkit/core/cjs/dso-ozon-content.cjs.entry.js +21 -2
- package/dist/library/@dso-toolkit/core/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/library/@dso-toolkit/core/cjs/dso-viewer-grid.cjs.entry.js +5 -1
- package/dist/library/@dso-toolkit/core/cjs/loader.cjs.js +1 -1
- package/dist/library/@dso-toolkit/core/collection/components/badge/badge.css +1 -1
- package/dist/library/@dso-toolkit/core/collection/components/dropdown-menu/dropdown-menu.js +12 -30
- package/dist/library/@dso-toolkit/core/collection/components/image-overlay/image-overlay.template.js +1 -1
- package/dist/library/@dso-toolkit/core/collection/components/map-controls/map-controls.css +1 -1
- package/dist/library/@dso-toolkit/core/collection/components/ozon-content/ozon-content.css +14 -0
- package/dist/library/@dso-toolkit/core/collection/components/ozon-content/ozon-content.js +58 -2
- package/dist/library/@dso-toolkit/core/collection/components/ozon-content/ozon-content.template.js +4 -1
- package/dist/library/@dso-toolkit/core/collection/components/selectable/selectable.template.js +1 -1
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/example-pages/viewer-grid-document-header.example-template.js +171 -0
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/example-pages/viewer-grid-document-item.example-template.js +56 -0
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/example-pages/viewer-grid-filterblok.example-template.js +60 -0
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/example-pages/viewer-grid-tiles.example-template.js +17 -0
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/templates/viewer-grid.template.js +20 -0
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/viewer-grid.js +27 -1
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/viewer-grid.stories.js +21 -283
- package/dist/library/@dso-toolkit/core/custom-elements/index.js +40 -35
- package/dist/library/@dso-toolkit/core/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-49938275.entry.js +1 -0
- package/dist/{toolkit/core/packages/core/dist/dso-toolkit/p-6ec616ee.entry.js → library/@dso-toolkit/core/dso-toolkit/p-60679db4.entry.js} +1 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/{p-1894c7ae.entry.js → p-7796687c.entry.js} +1 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-7f41f2a1.entry.js +1 -0
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-a8cf15cf.entry.js +1 -0
- package/dist/library/@dso-toolkit/core/esm/dso-badge.entry.js +1 -1
- package/dist/library/@dso-toolkit/core/esm/dso-dropdown-menu.entry.js +12 -29
- package/dist/library/@dso-toolkit/core/esm/dso-map-controls.entry.js +1 -1
- package/dist/library/@dso-toolkit/core/esm/dso-ozon-content.entry.js +22 -3
- package/dist/library/@dso-toolkit/core/esm/dso-toolkit.js +1 -1
- package/dist/library/@dso-toolkit/core/esm/dso-viewer-grid.entry.js +5 -1
- package/dist/library/@dso-toolkit/core/esm/loader.js +1 -1
- package/dist/library/@dso-toolkit/core/types/components/dropdown-menu/dropdown-menu.d.ts +0 -3
- package/dist/library/@dso-toolkit/core/types/components/ozon-content/ozon-content.d.ts +14 -1
- package/dist/library/@dso-toolkit/core/types/components/ozon-content/ozon-content.interfaces.d.ts +3 -0
- package/dist/library/@dso-toolkit/core/types/components/ozon-content/ozon-content.template.d.ts +1 -1
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/example-pages/viewer-grid-document-header.example-template.d.ts +2 -0
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/example-pages/viewer-grid-document-item.example-template.d.ts +1 -0
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/example-pages/viewer-grid-filterblok.example-template.d.ts +1 -0
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/example-pages/viewer-grid-tiles.example-template.d.ts +2 -0
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/templates/viewer-grid.template.d.ts +3 -0
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/viewer-grid.d.ts +5 -2
- package/dist/library/@dso-toolkit/core/types/components.d.ts +22 -2
- package/dist/library/components/detail/activiteiten.html +2 -0
- package/dist/library/components/detail/begrippen.html +9 -4
- package/dist/library/components/detail/form--autocomplete.html +1 -1
- package/dist/library/components/detail/form--form-horizontal.html +1 -1
- package/dist/library/components/detail/form--form-vertical.html +1 -1
- package/dist/library/components/detail/form--multi-page.html +1 -1
- package/dist/library/components/detail/form--sections.html +1 -1
- package/dist/library/components/detail/form--simple-form.html +1 -1
- package/dist/library/components/detail/form--single-page.html +1 -1
- package/dist/library/components/detail/form.html +1 -1
- package/dist/library/components/detail/rich-content.html +2 -0
- package/dist/library/components/detail/shopping-cart--default.html +13 -8
- package/dist/library/components/detail/shopping-cart--items-collapsed.html +14 -8
- package/dist/library/components/detail/shopping-cart--items-edit.html +14 -8
- package/dist/library/components/detail/shopping-cart--items-expanded.html +14 -8
- package/dist/library/components/detail/shopping-cart--items-non-collapsable.html +1614 -0
- package/dist/library/components/detail/shopping-cart--subitems-hidden-summary.html +13 -8
- package/dist/library/components/detail/shopping-cart--subitems-with-warning.html +15 -9
- package/dist/library/components/detail/shopping-cart--subitems.html +14 -8
- package/dist/library/components/detail/shopping-cart.html +119 -9
- package/dist/library/components/preview/activiteiten.html +1 -0
- package/dist/library/components/preview/begrippen.html +3 -1
- package/dist/library/components/preview/rich-content.html +2 -0
- package/dist/library/components/preview/shopping-cart--items-collapsed.html +3 -2
- package/dist/library/components/preview/shopping-cart--items-edit.html +3 -2
- package/dist/library/components/preview/shopping-cart--items-expanded.html +3 -2
- package/dist/library/components/preview/shopping-cart--items-non-collapsable.html +112 -0
- package/dist/library/components/preview/shopping-cart--subitems-with-warning.html +3 -2
- package/dist/library/components/preview/shopping-cart--subitems.html +3 -2
- package/dist/library/components/preview/shopping-cart.html +118 -10
- package/dist/library/components/render/activiteiten.html +3 -2
- package/dist/library/components/render/begrippen.html +3 -1
- package/dist/library/components/render/rich-content.html +1 -0
- package/dist/library/components/render/shopping-cart--items-collapsed.html +3 -2
- package/dist/library/components/render/shopping-cart--items-edit.html +3 -2
- package/dist/library/components/render/shopping-cart--items-expanded.html +3 -2
- package/dist/library/components/render/shopping-cart--items-non-collapsable.html +96 -0
- package/dist/library/components/render/shopping-cart--subitems-with-warning.html +3 -2
- package/dist/library/components/render/shopping-cart--subitems.html +3 -2
- package/dist/library/components/render/shopping-cart.html +118 -10
- package/dist/library/styles/dso.css +69 -30
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-49938275.entry.js +1 -0
- package/dist/{library/@dso-toolkit/core/dso-toolkit/p-6ec616ee.entry.js → toolkit/core/packages/core/dist/dso-toolkit/p-60679db4.entry.js} +1 -1
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/{p-1894c7ae.entry.js → p-7796687c.entry.js} +1 -1
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-7f41f2a1.entry.js +1 -0
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-a8cf15cf.entry.js +1 -0
- package/dist/toolkit/styles/dso.css +69 -30
- package/hydrate/index.js +41 -34
- package/libs/@dso-toolkit/css/src/components/form/form-groups/checkboxes/form-group-checkboxes.scss +19 -0
- package/libs/@dso-toolkit/css/src/components/form/form-groups/radios/form-group-radios.scss +33 -0
- package/libs/@dso-toolkit/css/src/components/form/form.scss +2 -0
- package/libs/@dso-toolkit/css/src/components/shopping-cart/shopping-cart.scss +8 -3
- package/libs/@dso-toolkit/sources/package.json +5 -5
- package/libs/@dso-toolkit/sources/src/components/badge/badge.scss +1 -1
- package/libs/@dso-toolkit/sources/src/components/form/content/checkboxes.content.ts +13 -0
- package/libs/@dso-toolkit/sources/src/components/form/content/radios.content.ts +13 -0
- package/libs/@dso-toolkit/sources/src/components/form/form-groups/checkboxes/form-group-checkboxes.args.ts +138 -0
- package/libs/@dso-toolkit/sources/src/components/form/form-groups/radios/form-group-radios.args.ts +138 -0
- package/libs/@dso-toolkit/sources/src/components/form/form.models.ts +2 -0
- package/libs/@dso-toolkit/sources/src/components/form/form.stories.ts +38 -5
- package/libs/@dso-toolkit/sources/src/components/form/models/form-group-checkboxes.model.ts +8 -0
- package/libs/@dso-toolkit/sources/src/components/form/models/form-group-radios.model.ts +8 -0
- package/libs/@dso-toolkit/sources/src/components/form/models/form-group.base-model.ts +0 -1
- package/libs/@dso-toolkit/sources/src/components/form/models/form-group.model.ts +3 -1
- package/libs/@dso-toolkit/sources/src/components/ozon-content/ozon-content.args.ts +13 -0
- package/libs/@dso-toolkit/sources/src/components/ozon-content/ozon-content.content.ts +2 -1
- package/libs/@dso-toolkit/sources/src/components/ozon-content/ozon-content.models.ts +3 -1
- package/libs/@dso-toolkit/sources/src/components/ozon-content/ozon-content.stories.ts +2 -1
- package/libs/@dso-toolkit/sources/src/components/search-bar/search-bar.args.ts +98 -0
- package/libs/@dso-toolkit/sources/src/components/search-bar/search-bar.models.ts +14 -0
- package/libs/@dso-toolkit/sources/src/components/search-bar/search-bar.stories.ts +141 -0
- package/libs/@dso-toolkit/sources/src/components/selectable/selectable.models.ts +1 -1
- package/libs/@dso-toolkit/sources/src/components/shopping-cart/shopping-cart.args.ts +7 -0
- package/libs/@dso-toolkit/sources/src/components/shopping-cart/shopping-cart.models.ts +1 -0
- package/libs/@dso-toolkit/sources/src/components/shopping-cart/shopping-cart.stories.ts +33 -0
- package/libs/@dso-toolkit/sources/src/components/viewer-grid/viewer-grid.args.ts +32 -48
- package/libs/@dso-toolkit/sources/src/components/viewer-grid/viewer-grid.models.ts +25 -47
- package/libs/@dso-toolkit/sources/src/components/viewer-grid/viewer-grid.stories.ts +67 -34
- package/libs/@dso-toolkit/sources/src/index.ts +2 -0
- package/libs/@dso-toolkit/sources/src/styling/global/a.scss +1 -42
- package/libs/@dso-toolkit/sources/src/styling/global/body.scss +1 -0
- package/libs/@dso-toolkit/sources/src/styling/global/dl.scss +4 -5
- package/libs/@dso-toolkit/sources/src/styling/mixins/anchor.scss +51 -0
- package/libs/@dso-toolkit/sources/src/styling/mixins.scss +1 -0
- package/package.json +3 -3
- package/reference/render/begrippen.html +5 -3
- package/reference/render/rich-content.html +1 -0
- package/reference/render/shopping-cart--items-non-collapsable.html +52 -0
- package/reference/render/shopping-cart--subitems-with-warning.html +1 -1
- package/src/styles/components/_form.scss +1 -21
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/viewer-grid-document-header.template.js +0 -39
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/viewer-grid-document-list-item.template.js +0 -19
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/viewer-grid-filterblok.template.js +0 -28
- package/dist/library/@dso-toolkit/core/collection/components/viewer-grid/viewer-grid.template.js +0 -28
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-0e535c2b.entry.js +0 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-1a3db1cd.entry.js +0 -1
- package/dist/library/@dso-toolkit/core/dso-toolkit/p-723ef97b.entry.js +0 -1
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/viewer-grid-document-header.template.d.ts +0 -3
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/viewer-grid-document-list-item.template.d.ts +0 -3
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/viewer-grid-filterblok.template.d.ts +0 -3
- package/dist/library/@dso-toolkit/core/types/components/viewer-grid/viewer-grid.template.d.ts +0 -3
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-0e535c2b.entry.js +0 -1
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-1a3db1cd.entry.js +0 -1
- package/dist/toolkit/core/packages/core/dist/dso-toolkit/p-723ef97b.entry.js +0 -1
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@storybook/client-api": "6.
|
|
19
|
+
"@storybook/client-api": "6.5.9",
|
|
20
20
|
"concurrently": "^7.1.0",
|
|
21
21
|
"escape-string-regexp": "^5.0.0",
|
|
22
22
|
"microbundle": "^0.14.2",
|
|
23
|
-
"react": "^
|
|
24
|
-
"react-dom": "^
|
|
23
|
+
"react": "^18.2.0",
|
|
24
|
+
"react-dom": "^18.2.0",
|
|
25
25
|
"rimraf": "^3.0.2",
|
|
26
26
|
"uuid": "^8.3.2"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@storybook/addon-actions": "6.
|
|
30
|
-
"@storybook/addons": "6.
|
|
29
|
+
"@storybook/addon-actions": "6.5.9",
|
|
30
|
+
"@storybook/addons": "6.5.9"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormGroupCheckboxesArgs } from '../form-groups/checkboxes/form-group-checkboxes.args';
|
|
2
|
+
|
|
3
|
+
export const checkboxesContent: Omit<FormGroupCheckboxesArgs, 'infoButtonHandler' | 'infoCloseHandler'> = {
|
|
4
|
+
id: 'mijn-id',
|
|
5
|
+
label: 'Checkboxes',
|
|
6
|
+
required: false,
|
|
7
|
+
disabled: false,
|
|
8
|
+
infoButtonLabel: 'Toelichting bij veld',
|
|
9
|
+
infoActive: false,
|
|
10
|
+
infoText: '<div class="dso-rich-content"><p>Rich text</p></div>',
|
|
11
|
+
infoFixed: false,
|
|
12
|
+
errorText: 'Maak een keuze'
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormGroupRadiosArgs } from '../form-groups/radios/form-group-radios.args';
|
|
2
|
+
|
|
3
|
+
export const radiosContent: Omit<FormGroupRadiosArgs, 'infoButtonHandler' | 'infoCloseHandler'> = {
|
|
4
|
+
id: 'mijn-id',
|
|
5
|
+
label: 'Radios',
|
|
6
|
+
required: false,
|
|
7
|
+
disabled: false,
|
|
8
|
+
infoButtonLabel: 'Toelichting bij veld',
|
|
9
|
+
infoActive: false,
|
|
10
|
+
infoText: '<div class="dso-rich-content"><p>Rich text</p></div>',
|
|
11
|
+
infoFixed: false,
|
|
12
|
+
errorText: 'Maak een keuze'
|
|
13
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { HandlerFunction } from '@storybook/addon-actions';
|
|
2
|
+
import { ArgTypes, noControl } from '../../../../stories-helpers';
|
|
3
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
+
|
|
5
|
+
import { FormGroupCheckboxes } from '../../form.models';
|
|
6
|
+
|
|
7
|
+
import { Selectable } from '../../../selectable/selectable.models';
|
|
8
|
+
|
|
9
|
+
export interface FormGroupCheckboxesArgs {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
state?: 'invalid' | 'valid';
|
|
13
|
+
required: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
errorText?: string;
|
|
16
|
+
helpText?: string;
|
|
17
|
+
infoButtonHandler: HandlerFunction;
|
|
18
|
+
infoButtonLabel: string;
|
|
19
|
+
infoActive: boolean;
|
|
20
|
+
infoText: string;
|
|
21
|
+
infoCloseHandler: HandlerFunction;
|
|
22
|
+
infoFixed: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const formGroupCheckboxesArgTypes: ArgTypes<FormGroupCheckboxesArgs> = {
|
|
26
|
+
id: {
|
|
27
|
+
control: {
|
|
28
|
+
type: 'text'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'text'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
state: {
|
|
37
|
+
options: [undefined, 'invalid', 'valid'],
|
|
38
|
+
control: {
|
|
39
|
+
type: 'select'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
control: {
|
|
44
|
+
type: 'boolean'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
control: {
|
|
49
|
+
type: 'boolean'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
errorText: {
|
|
53
|
+
control: {
|
|
54
|
+
type: 'text'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
helpText: {
|
|
58
|
+
control: {
|
|
59
|
+
type: 'text'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
infoActive: {
|
|
63
|
+
control: {
|
|
64
|
+
type: 'boolean'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
infoButtonHandler: {
|
|
68
|
+
...noControl,
|
|
69
|
+
action: 'infoButton click'
|
|
70
|
+
},
|
|
71
|
+
infoButtonLabel: {
|
|
72
|
+
control: {
|
|
73
|
+
type: 'text'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
infoText: {
|
|
77
|
+
control: {
|
|
78
|
+
type: 'text'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
infoCloseHandler: {
|
|
82
|
+
...noControl,
|
|
83
|
+
action: 'info close click'
|
|
84
|
+
},
|
|
85
|
+
infoFixed: {
|
|
86
|
+
control: {
|
|
87
|
+
type: 'boolean'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export function formGroupCheckboxesArgsMapper(a: FormGroupCheckboxesArgs): FormGroupCheckboxes<any> {
|
|
93
|
+
return {
|
|
94
|
+
group: 'checkboxes',
|
|
95
|
+
id: a.id,
|
|
96
|
+
label: a.label,
|
|
97
|
+
required: a.required,
|
|
98
|
+
disabled: a.disabled,
|
|
99
|
+
state: a.state,
|
|
100
|
+
errorText: a.errorText,
|
|
101
|
+
helpText: a.helpText,
|
|
102
|
+
selectables: [
|
|
103
|
+
{
|
|
104
|
+
id: uuidv4(),
|
|
105
|
+
value: 'optie-1',
|
|
106
|
+
type: 'checkbox',
|
|
107
|
+
label: 'een'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: uuidv4(),
|
|
111
|
+
value: 'optie-2',
|
|
112
|
+
type: 'checkbox',
|
|
113
|
+
label: 'twee'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: uuidv4(),
|
|
117
|
+
value: 'opties-3',
|
|
118
|
+
type: 'checkbox',
|
|
119
|
+
label: 'drie'
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
infoButton: a.infoButtonLabel && a.infoText
|
|
123
|
+
? {
|
|
124
|
+
onClick: a.infoButtonHandler,
|
|
125
|
+
active: a.infoActive,
|
|
126
|
+
label: a.infoButtonLabel
|
|
127
|
+
}
|
|
128
|
+
: undefined,
|
|
129
|
+
info: a.infoButtonLabel && a.infoText
|
|
130
|
+
? {
|
|
131
|
+
active: a.infoActive,
|
|
132
|
+
fixed: a.infoFixed,
|
|
133
|
+
onClose: a.infoCloseHandler,
|
|
134
|
+
richContent: a.infoText
|
|
135
|
+
}
|
|
136
|
+
: undefined
|
|
137
|
+
};
|
|
138
|
+
}
|
package/libs/@dso-toolkit/sources/src/components/form/form-groups/radios/form-group-radios.args.ts
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { HandlerFunction } from '@storybook/addon-actions';
|
|
2
|
+
import { ArgTypes, noControl } from '../../../../stories-helpers';
|
|
3
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
+
|
|
5
|
+
import { FormGroupRadios } from '../../form.models';
|
|
6
|
+
|
|
7
|
+
import { Selectable } from '../../../selectable/selectable.models';
|
|
8
|
+
|
|
9
|
+
export interface FormGroupRadiosArgs {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
state?: 'invalid' | 'valid';
|
|
13
|
+
required: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
errorText?: string;
|
|
16
|
+
helpText?: string;
|
|
17
|
+
infoButtonHandler: HandlerFunction;
|
|
18
|
+
infoButtonLabel: string;
|
|
19
|
+
infoActive: boolean;
|
|
20
|
+
infoText: string;
|
|
21
|
+
infoCloseHandler: HandlerFunction;
|
|
22
|
+
infoFixed: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const formGroupRadiosArgTypes: ArgTypes<FormGroupRadiosArgs> = {
|
|
26
|
+
id: {
|
|
27
|
+
control: {
|
|
28
|
+
type: 'text'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'text'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
state: {
|
|
37
|
+
options: [undefined, 'invalid', 'valid'],
|
|
38
|
+
control: {
|
|
39
|
+
type: 'select'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
control: {
|
|
44
|
+
type: 'boolean'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
control: {
|
|
49
|
+
type: 'boolean'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
errorText: {
|
|
53
|
+
control: {
|
|
54
|
+
type: 'text'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
helpText: {
|
|
58
|
+
control: {
|
|
59
|
+
type: 'text'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
infoActive: {
|
|
63
|
+
control: {
|
|
64
|
+
type: 'boolean'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
infoButtonHandler: {
|
|
68
|
+
...noControl,
|
|
69
|
+
action: 'infoButton click'
|
|
70
|
+
},
|
|
71
|
+
infoButtonLabel: {
|
|
72
|
+
control: {
|
|
73
|
+
type: 'text'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
infoText: {
|
|
77
|
+
control: {
|
|
78
|
+
type: 'text'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
infoCloseHandler: {
|
|
82
|
+
...noControl,
|
|
83
|
+
action: 'info close click'
|
|
84
|
+
},
|
|
85
|
+
infoFixed: {
|
|
86
|
+
control: {
|
|
87
|
+
type: 'boolean'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export function formGroupRadiosArgsMapper(a: FormGroupRadiosArgs): FormGroupRadios<any> {
|
|
93
|
+
return {
|
|
94
|
+
group: 'radios',
|
|
95
|
+
id: a.id,
|
|
96
|
+
label: a.label,
|
|
97
|
+
required: a.required,
|
|
98
|
+
disabled: a.disabled,
|
|
99
|
+
state: a.state,
|
|
100
|
+
errorText: a.errorText,
|
|
101
|
+
helpText: a.helpText,
|
|
102
|
+
selectables: [
|
|
103
|
+
{
|
|
104
|
+
id: uuidv4(),
|
|
105
|
+
value: 'optie-1',
|
|
106
|
+
type: 'radio',
|
|
107
|
+
label: 'een'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: uuidv4(),
|
|
111
|
+
value: 'optie-2',
|
|
112
|
+
type: 'radio',
|
|
113
|
+
label: 'twee'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: uuidv4(),
|
|
117
|
+
value: 'opties-3',
|
|
118
|
+
type: 'radio',
|
|
119
|
+
label: 'drie'
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
infoButton: a.infoButtonLabel && a.infoText
|
|
123
|
+
? {
|
|
124
|
+
onClick: a.infoButtonHandler,
|
|
125
|
+
active: a.infoActive,
|
|
126
|
+
label: a.infoButtonLabel
|
|
127
|
+
}
|
|
128
|
+
: undefined,
|
|
129
|
+
info: a.infoButtonLabel && a.infoText
|
|
130
|
+
? {
|
|
131
|
+
active: a.infoActive,
|
|
132
|
+
fixed: a.infoFixed,
|
|
133
|
+
onClose: a.infoCloseHandler,
|
|
134
|
+
richContent: a.infoText
|
|
135
|
+
}
|
|
136
|
+
: undefined
|
|
137
|
+
};
|
|
138
|
+
}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
+
import { DecoratorFunction } from '@storybook/addons';
|
|
2
|
+
|
|
1
3
|
import { bindTemplate, StorybookParameters, } from '../../stories-helpers';
|
|
2
4
|
|
|
3
5
|
import { formArgsMapper, formArgTypes } from './form.args';
|
|
4
|
-
|
|
5
|
-
import { Form, FormGroupInput, FormGroupInputDate } from './form.models';
|
|
6
|
-
import { formGroupInputArgsMapper, formGroupInputArgTypes } from './form-groups/input/form-group-input.args';
|
|
6
|
+
|
|
7
7
|
import { inputContent } from './content/input.content';
|
|
8
|
-
import {
|
|
8
|
+
import { checkboxesContent } from './content/checkboxes.content';
|
|
9
|
+
import { radiosContent } from './content/radios.content';
|
|
10
|
+
import { Form, FormGroupCheckboxes, FormGroupInput, FormGroupRadios, FormGroupInputDate } from './form.models';
|
|
11
|
+
import { formGroupCheckboxesArgsMapper, formGroupCheckboxesArgTypes } from './form-groups/checkboxes/form-group-checkboxes.args';
|
|
12
|
+
import { formGroupInputArgsMapper, formGroupInputArgTypes } from './form-groups/input/form-group-input.args';
|
|
13
|
+
import { formGroupRadiosArgsMapper, formGroupRadiosArgTypes } from './form-groups/radios/form-group-radios.args';
|
|
9
14
|
|
|
10
15
|
export interface FormParameters<TemplateFnReturnType> {
|
|
11
16
|
formTemplate: (form: Form<TemplateFnReturnType>) => TemplateFnReturnType;
|
|
12
17
|
formGroupDecorator: DecoratorFunction<TemplateFnReturnType>;
|
|
18
|
+
formGroupCheckboxesTemplate: (formGroupCheckboxes: FormGroupCheckboxes<TemplateFnReturnType>) => TemplateFnReturnType;
|
|
13
19
|
formGroupInputTemplate: (formGroupInput: FormGroupInput<TemplateFnReturnType> | FormGroupInputDate<TemplateFnReturnType>) => TemplateFnReturnType;
|
|
20
|
+
formGroupRadiosTemplate: (formGroupRadios: FormGroupRadios<TemplateFnReturnType>) => TemplateFnReturnType;
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
export function storiesOfForm<TemplateFnReturnType>(
|
|
@@ -22,7 +29,9 @@ export function storiesOfForm<TemplateFnReturnType>(
|
|
|
22
29
|
{
|
|
23
30
|
formTemplate,
|
|
24
31
|
formGroupDecorator,
|
|
25
|
-
|
|
32
|
+
formGroupCheckboxesTemplate,
|
|
33
|
+
formGroupInputTemplate,
|
|
34
|
+
formGroupRadiosTemplate
|
|
26
35
|
}: FormParameters<TemplateFnReturnType>
|
|
27
36
|
) {
|
|
28
37
|
storiesOf('Form/form', mainModule)
|
|
@@ -46,4 +55,28 @@ export function storiesOfForm<TemplateFnReturnType>(
|
|
|
46
55
|
.addDecorator(formGroupDecorator)
|
|
47
56
|
.add('input', bindTemplate(formGroupInputArgsMapper, formGroupInputTemplate)
|
|
48
57
|
);
|
|
58
|
+
|
|
59
|
+
storiesOf('Form/groups/checkboxes', mainModule)
|
|
60
|
+
.addParameters({
|
|
61
|
+
argTypes: formGroupCheckboxesArgTypes,
|
|
62
|
+
args: checkboxesContent,
|
|
63
|
+
docs: {
|
|
64
|
+
page: readme
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
.addDecorator(formGroupDecorator)
|
|
68
|
+
.add('checkboxes', bindTemplate(formGroupCheckboxesArgsMapper, formGroupCheckboxesTemplate)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
storiesOf('Form/groups/radios', mainModule)
|
|
72
|
+
.addParameters({
|
|
73
|
+
argTypes: formGroupRadiosArgTypes,
|
|
74
|
+
args: radiosContent,
|
|
75
|
+
docs: {
|
|
76
|
+
page: readme
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
.addDecorator(formGroupDecorator)
|
|
80
|
+
.add('radios', bindTemplate(formGroupRadiosArgsMapper, formGroupRadiosTemplate)
|
|
81
|
+
);
|
|
49
82
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Selectable } from '../../selectable/selectable.models';
|
|
2
|
+
|
|
3
|
+
import { FormGroupBase } from './form-group.base-model';
|
|
4
|
+
|
|
5
|
+
export interface FormGroupCheckboxes<TemplateFnReturnType> extends FormGroupBase<TemplateFnReturnType> {
|
|
6
|
+
group: 'checkboxes',
|
|
7
|
+
selectables: Selectable<TemplateFnReturnType>[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Selectable } from '../../selectable/selectable.models';
|
|
2
|
+
|
|
3
|
+
import { FormGroupBase } from './form-group.base-model';
|
|
4
|
+
|
|
5
|
+
export interface FormGroupRadios<TemplateFnReturnType> extends FormGroupBase<TemplateFnReturnType> {
|
|
6
|
+
group: 'radios',
|
|
7
|
+
selectables: Selectable<TemplateFnReturnType>[];
|
|
8
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FormGroupRadios } from './form-group-radios.model';
|
|
2
|
+
import { FormGroupCheckboxes } from './form-group-checkboxes.model';
|
|
1
3
|
import { FormGroupInput, FormGroupInputDate } from './form-group-input.model';
|
|
2
4
|
|
|
3
|
-
export type FormGroup<TemplateFnReturnType> = FormGroupInput<TemplateFnReturnType> | FormGroupInputDate<TemplateFnReturnType>;
|
|
5
|
+
export type FormGroup<TemplateFnReturnType> = FormGroupCheckboxes<TemplateFnReturnType> | FormGroupInput<TemplateFnReturnType> | FormGroupInputDate<TemplateFnReturnType> | FormGroupRadios<TemplateFnReturnType>;
|
|
@@ -6,8 +6,10 @@ import { OzonContent } from "./ozon-content.models";
|
|
|
6
6
|
export interface OzonContentArgs {
|
|
7
7
|
content: string;
|
|
8
8
|
inline: boolean;
|
|
9
|
+
interactive: boolean;
|
|
9
10
|
deleted: boolean;
|
|
10
11
|
onAnchorClick: HandlerFunction;
|
|
12
|
+
onClick: HandlerFunction;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export const ozonContentArgTypes: ArgTypes<OzonContentArgs> = {
|
|
@@ -21,6 +23,11 @@ export const ozonContentArgTypes: ArgTypes<OzonContentArgs> = {
|
|
|
21
23
|
type: 'boolean'
|
|
22
24
|
}
|
|
23
25
|
},
|
|
26
|
+
interactive: {
|
|
27
|
+
control: {
|
|
28
|
+
type: 'boolean'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
24
31
|
deleted: {
|
|
25
32
|
control: {
|
|
26
33
|
type: 'boolean'
|
|
@@ -30,13 +37,19 @@ export const ozonContentArgTypes: ArgTypes<OzonContentArgs> = {
|
|
|
30
37
|
...noControl,
|
|
31
38
|
action: "anchorClick",
|
|
32
39
|
},
|
|
40
|
+
onClick: {
|
|
41
|
+
...noControl,
|
|
42
|
+
action: 'onClick'
|
|
43
|
+
}
|
|
33
44
|
};
|
|
34
45
|
|
|
35
46
|
export function ozonContentArgsMapper(a: OzonContentArgs): OzonContent {
|
|
36
47
|
return {
|
|
37
48
|
content: a.content,
|
|
38
49
|
inline: a.inline,
|
|
50
|
+
interactive: a.interactive,
|
|
39
51
|
deleted: a.deleted,
|
|
40
52
|
onAnchorClick: (e: any) => a.onAnchorClick(e.detail),
|
|
53
|
+
onClick: a.onClick
|
|
41
54
|
};
|
|
42
55
|
}
|
|
@@ -29,9 +29,10 @@ export function storiesOfOzonContent<TemplateFnReturnType>(
|
|
|
29
29
|
|
|
30
30
|
content.forEach((story) => {
|
|
31
31
|
stories.add(story.title, template, {
|
|
32
|
-
args: componentArgs<Omit<OzonContentArgs, 'onAnchorClick'>>({
|
|
32
|
+
args: componentArgs<Omit<OzonContentArgs, 'onAnchorClick' | 'onClick'>>({
|
|
33
33
|
content: story.content,
|
|
34
34
|
inline: false,
|
|
35
|
+
interactive: false,
|
|
35
36
|
deleted: false,
|
|
36
37
|
...story.args
|
|
37
38
|
}),
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ArgTypes } from '../../stories-helpers';
|
|
2
|
+
|
|
3
|
+
import { SearchBar } from './search-bar.models';
|
|
4
|
+
|
|
5
|
+
export interface SearchBarArgs {
|
|
6
|
+
label: string;
|
|
7
|
+
id: string;
|
|
8
|
+
icon: boolean;
|
|
9
|
+
hiddenLabel: boolean;
|
|
10
|
+
invalid: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
buttonLabel: string;
|
|
14
|
+
hideSearchButton: boolean;
|
|
15
|
+
resultsMessage?: string;
|
|
16
|
+
resultsHidden: boolean;
|
|
17
|
+
ariaDescribedBy?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const searchBarArgTypes: ArgTypes<SearchBarArgs> = {
|
|
21
|
+
label: {
|
|
22
|
+
control: {
|
|
23
|
+
type: 'text'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
id: {
|
|
27
|
+
control: {
|
|
28
|
+
type: 'text'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
icon: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'boolean'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
hiddenLabel: {
|
|
37
|
+
control: {
|
|
38
|
+
type: 'boolean'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
invalid: {
|
|
42
|
+
control: {
|
|
43
|
+
type: 'boolean'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
placeholder: {
|
|
47
|
+
control: {
|
|
48
|
+
type: 'text'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
value: {
|
|
52
|
+
control: {
|
|
53
|
+
type: 'text'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
buttonLabel: {
|
|
57
|
+
control: {
|
|
58
|
+
type: 'text'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
hideSearchButton: {
|
|
62
|
+
control: {
|
|
63
|
+
type: 'boolean'
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
resultsMessage: {
|
|
67
|
+
control: {
|
|
68
|
+
type: 'text'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
resultsHidden: {
|
|
72
|
+
control: {
|
|
73
|
+
type: 'boolean'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
ariaDescribedBy: {
|
|
77
|
+
control: {
|
|
78
|
+
type: 'text'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export function searchBarArgsMapper(a: SearchBarArgs): SearchBar {
|
|
84
|
+
return {
|
|
85
|
+
label: a.label,
|
|
86
|
+
id: a.id,
|
|
87
|
+
icon: a.icon,
|
|
88
|
+
hiddenLabel: a.hiddenLabel,
|
|
89
|
+
invalid: a.invalid,
|
|
90
|
+
placeholder: a.placeholder,
|
|
91
|
+
value: a.value,
|
|
92
|
+
buttonLabel: a.buttonLabel,
|
|
93
|
+
hideSearchButton: a.hideSearchButton,
|
|
94
|
+
resultsMessage: a.resultsMessage,
|
|
95
|
+
resultsHidden: a.resultsHidden,
|
|
96
|
+
ariaDescribedBy: a.ariaDescribedBy,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SearchBar {
|
|
2
|
+
label: string;
|
|
3
|
+
id: string;
|
|
4
|
+
icon: boolean;
|
|
5
|
+
hiddenLabel: boolean;
|
|
6
|
+
invalid: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
buttonLabel: string;
|
|
10
|
+
hideSearchButton: boolean;
|
|
11
|
+
resultsMessage?: string;
|
|
12
|
+
resultsHidden: boolean;
|
|
13
|
+
ariaDescribedBy?: string;
|
|
14
|
+
}
|