@ouestfrance/sipa-bms-ui 8.18.0 → 8.20.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.
Files changed (41) hide show
  1. package/dist/components/form/BmsInputText.vue.d.ts +1 -0
  2. package/dist/components/form/BmsSearch.vue.d.ts +3 -1
  3. package/dist/components/layout/BmsSplitWindow.vue.d.ts +1 -0
  4. package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +3 -1
  5. package/dist/components/table/BmsTableFilters.vue.d.ts +3 -1
  6. package/dist/sipa-bms-ui.css +23 -9
  7. package/dist/sipa-bms-ui.es.js +19 -11
  8. package/dist/sipa-bms-ui.es.js.map +1 -1
  9. package/dist/sipa-bms-ui.umd.js +19 -11
  10. package/dist/sipa-bms-ui.umd.js.map +1 -1
  11. package/package.json +2 -1
  12. package/src/components/button/BmsButton.stories.js +14 -22
  13. package/src/components/button/BmsIconButton.stories.js +14 -8
  14. package/src/components/button/UiButton.stories.js +31 -0
  15. package/src/components/feedback/BmsCircularProgress.stories.js +0 -7
  16. package/src/components/feedback/BmsLoader.stories.js +0 -6
  17. package/src/components/feedback/BmsTooltip.stories.js +1 -0
  18. package/src/components/feedback/UiTooltip.stories.js +1 -0
  19. package/src/components/form/BmsAutocomplete.stories.js +11 -1
  20. package/src/components/form/BmsBetweenInput.stories.js +17 -1
  21. package/src/components/form/BmsFilePicker.stories.js +3 -1
  22. package/src/components/form/BmsInputBooleanCheckbox.stories.js +9 -0
  23. package/src/components/form/BmsInputCheckboxCaption.stories.js +16 -0
  24. package/src/components/form/BmsInputCheckboxCaptionGroup.stories.js +21 -1
  25. package/src/components/form/BmsInputText.vue +1 -0
  26. package/src/components/form/UiBmsInputCheckbox.stories.js +1 -0
  27. package/src/components/form/UiBmsSwitch.stories.js +1 -5
  28. package/src/components/layout/BmsForm_retrocompat.stories.js +1 -0
  29. package/src/components/layout/BmsSplitWindow.vue +38 -10
  30. package/src/components/navigation/BmsBreadcrumb.stories.js +0 -18
  31. package/src/components/navigation/BmsMenu.stories.js +4 -4
  32. package/src/components/navigation/BmsMenuNav.stories.js +4 -3
  33. package/src/components/navigation/UiMenuItem.stories.js +53 -2
  34. package/src/components/navigation/UiTab.stories.js +1 -0
  35. package/src/components/navigation/UiTenantSwitcher.stories.js +1 -0
  36. package/src/components/table/BmsEmptyScreen.stories.js +0 -7
  37. package/src/components/table/UiBmsTable.stories.js +1 -0
  38. package/src/components/table/UiFilterButton.stories.js +3 -8
  39. package/src/components/utils/BmsRelativeTime.stories.js +0 -6
  40. package/src/components/feedback/Notification.stories.js +0 -37
  41. package/src/components/navigation/UiMenuItemStatus.stories.js +0 -64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouestfrance/sipa-bms-ui",
3
- "version": "8.18.0",
3
+ "version": "8.20.0",
4
4
  "author": "Ouest-France BMS",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -70,6 +70,7 @@
70
70
  "start-server-and-test": "2.1.3",
71
71
  "storybook": "10.0.8",
72
72
  "storybook-addon-pseudo-states": "10.0.8",
73
+ "storybook-addon-tag-badges": "^3.0.2",
73
74
  "storybook-vue3-router": "^7.0.0",
74
75
  "typescript": "5.2.2",
75
76
  "uuid": "13.0.0",
@@ -5,6 +5,7 @@ import { StatusType } from '@/models';
5
5
  export default {
6
6
  title: 'Composants/button/Button',
7
7
  component: BmsButton,
8
+ tags: ['with_useable_code'],
8
9
  argTypes: {
9
10
  type: {
10
11
  control: { type: 'select' },
@@ -62,49 +63,40 @@ const Template = (args) => ({
62
63
  `,
63
64
  });
64
65
 
66
+ const WITH_DEFAULT_SLOT = {
67
+ start: '<Heart/>',
68
+ default: 'Mon texte',
69
+ end: '<Wand/>',
70
+ };
71
+
65
72
  export const Primary = Template.bind({});
66
73
  Primary.args = {
67
74
  type: 'primary',
75
+ ...WITH_DEFAULT_SLOT,
68
76
  };
69
77
 
70
78
  export const PrimaryDanger = Template.bind({});
71
79
  PrimaryDanger.args = {
80
+ ...WITH_DEFAULT_SLOT,
72
81
  type: 'primary',
73
82
  mode: StatusType.Danger,
74
83
  };
75
84
 
76
85
  export const Secondary = Template.bind({});
77
86
  Secondary.args = {
87
+ ...WITH_DEFAULT_SLOT,
78
88
  type: 'secondary',
79
89
  };
80
90
 
81
91
  export const Tertiary = Template.bind({});
82
92
  Tertiary.args = {
93
+ ...WITH_DEFAULT_SLOT,
83
94
  type: 'tertiary',
84
95
  };
85
96
 
86
- const TemplateSmall = (args) => ({
87
- components: {
88
- BmsButton,
89
- ArrowRight,
90
- ArrowLeft,
91
- Camera,
92
- Heart,
93
- Wand,
94
- },
95
- setup() {
96
- return { args };
97
- },
98
- template: `
99
- <BmsButton v-bind="args">Save me</BmsButton>
100
- <br/>
101
- <br/>
102
- <BmsButton v-bind="args" small>Save me</BmsButton>
103
-
104
- `,
105
- });
106
-
107
- export const Small = TemplateSmall.bind({});
97
+ export const Small = Template.bind({});
108
98
  Small.args = {
99
+ ...WITH_DEFAULT_SLOT,
109
100
  type: 'primary',
101
+ small: true,
110
102
  };
@@ -1,11 +1,16 @@
1
- import { Heart } from 'lucide-vue-next';
1
+ import { SquarePen } from 'lucide-vue-next';
2
2
  import BmsIconButton from './BmsIconButton.vue';
3
3
  import { StatusType } from '@/models';
4
4
  import { vueRouter } from 'storybook-vue3-router';
5
5
 
6
+ const WITH_DEFAULT_SLOT = {
7
+ default: '<SquarePen/>',
8
+ };
9
+
6
10
  export default {
7
11
  title: 'Composants/button/IconButton',
8
12
  component: BmsIconButton,
13
+ tags: ['with_useable_code'],
9
14
  decorators: [
10
15
  vueRouter([
11
16
  {
@@ -26,21 +31,21 @@ export default {
26
31
  const Template = (args) => ({
27
32
  components: {
28
33
  BmsIconButton,
29
- Heart,
34
+ SquarePen,
30
35
  },
31
36
  setup() {
32
37
  return { args };
33
38
  },
34
39
  template: `
35
40
  <br><b>default</b>
36
- <BmsIconButton v-bind="args"><Heart/></BmsIconButton>
41
+ <BmsIconButton v-bind="args"><SquarePen/></BmsIconButton>
37
42
  <br>
38
43
  <br> <b>:hover</b>
39
- <BmsIconButton v-bind="args" class="_hover"><Heart/></BmsIconButton>
44
+ <BmsIconButton v-bind="args" class="_hover"><SquarePen/></BmsIconButton>
40
45
 
41
46
  <br>
42
47
  <br> <b>Small</b>
43
- <BmsIconButton v-bind="args" small><Heart/></BmsIconButton>
48
+ <BmsIconButton v-bind="args" small><SquarePen/></BmsIconButton>
44
49
 
45
50
 
46
51
  <br> <b>BmsIconButton must be on same alignment (using BmsLink and native button html tag)</b>
@@ -48,7 +53,7 @@ const Template = (args) => ({
48
53
  tooltip-text="BmsIconButton with BmsLink"
49
54
  to="/toto"
50
55
  >
51
- <Heart/>
56
+ <SquarePen/>
52
57
  </BmsIconButton>
53
58
  <BmsIconButton
54
59
  tooltip-text="BmsIconButton with button html tag"
@@ -59,13 +64,14 @@ const Template = (args) => ({
59
64
  });
60
65
 
61
66
  export const IconButton = Template.bind({});
62
- IconButton.args = {};
67
+ IconButton.args = { ...WITH_DEFAULT_SLOT };
63
68
 
64
69
  export const IconButtonWithTargetLink = Template.bind({});
65
70
  IconButtonWithTargetLink.args = {
66
71
  target: '_blank',
67
72
  to: { name: 'firstRoute' },
73
+ ...WITH_DEFAULT_SLOT,
68
74
  };
69
75
 
70
76
  export const DangerIconButton = Template.bind({});
71
- DangerIconButton.args = { mode: StatusType.Danger };
77
+ DangerIconButton.args = { mode: StatusType.Danger, ...WITH_DEFAULT_SLOT };
@@ -18,6 +18,7 @@ export default {
18
18
  page: template,
19
19
  },
20
20
  },
21
+ tags: ['code-only'],
21
22
  title: 'Composants/button/UiButton',
22
23
  component: UiButton,
23
24
  argTypes: {
@@ -119,20 +120,50 @@ const TemplateIcon = ({ mode }) => ({
119
120
 
120
121
  export const IconButton = TemplateIcon.bind({});
121
122
  IconButton.args = {};
123
+ IconButton.parameters = {
124
+ docs: {
125
+ // 👇 Disable Code panel for this specific story
126
+ codePanel: false,
127
+ },
128
+ };
122
129
 
123
130
  export const IconButtonWithRouterArg = Template.bind({});
124
131
  IconButtonWithRouterArg.args = { to: { name: 'route' } };
132
+ IconButtonWithRouterArg.parameters = {
133
+ docs: {
134
+ // 👇 Disable Code panel for this specific story
135
+ codePanel: false,
136
+ },
137
+ };
125
138
 
126
139
  export const Error = Template.bind({});
127
140
  Error.args = {
128
141
  color: StatusType.Danger,
129
142
  };
143
+ Error.parameters = {
144
+ docs: {
145
+ // 👇 Disable Code panel for this specific story
146
+ codePanel: false,
147
+ },
148
+ };
130
149
 
131
150
  export const PrimaryUI = Template.bind({});
132
151
  PrimaryUI.args = {};
152
+ PrimaryUI.parameters = {
153
+ docs: {
154
+ // 👇 Disable Code panel for this specific story
155
+ codePanel: false,
156
+ },
157
+ };
133
158
 
134
159
  export const SecondaryUI = Template.bind({});
135
160
  SecondaryUI.args = {
136
161
  color: StatusType.Default,
137
162
  mode: 'outline',
138
163
  };
164
+ SecondaryUI.parameters = {
165
+ docs: {
166
+ // 👇 Disable Code panel for this specific story
167
+ codePanel: false,
168
+ },
169
+ };
@@ -1,10 +1,8 @@
1
1
  import BmsCircularProgress from '@/components/feedback/BmsCircularProgress.vue';
2
2
 
3
- // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
3
  export default {
5
4
  title: 'Composants/feedback/CircularProgress',
6
5
  component: BmsCircularProgress,
7
- // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
6
  argTypes: {
9
7
  progress: {
10
8
  control: { type: 'number' },
@@ -12,24 +10,19 @@ export default {
12
10
  },
13
11
  };
14
12
 
15
- // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
16
13
  const Template = (args) => ({
17
- // Components used in your story `template` are defined in the `components` object
18
14
  components: {
19
15
  BmsCircularProgress,
20
16
  },
21
- // The story's `args` need to be mapped into the template through the `setup()` method
22
17
  setup() {
23
18
  return { args };
24
19
  },
25
- // And then the `args` are bound to your component with `v-bind="args"`
26
20
  template: `
27
21
  <BmsCircularProgress v-bind="args" />
28
22
  `,
29
23
  });
30
24
 
31
25
  export const NoProgress = Template.bind({});
32
- // More on args: https://storybook.js.org/docs/vue/writing-stories/args
33
26
  NoProgress.args = {
34
27
  progress: 0,
35
28
  };
@@ -1,22 +1,17 @@
1
1
  import BmsLoader from '@/components/feedback/BmsLoader.vue';
2
2
 
3
- // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
3
  export default {
5
4
  title: 'Composants/feedback/Loader',
6
5
  component: BmsLoader,
7
6
  };
8
7
 
9
- // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
10
8
  const Template = (args) => ({
11
- // Components used in your story `template` are defined in the `components` object
12
9
  components: {
13
10
  BmsLoader,
14
11
  },
15
- // The story's `args` need to be mapped into the template through the `setup()` method
16
12
  setup() {
17
13
  return { args };
18
14
  },
19
- // And then the `args` are bound to your component with `v-bind="args"`
20
15
  template: `
21
16
  <BmsLoader v-bind="args">
22
17
  This is content
@@ -25,7 +20,6 @@ const Template = (args) => ({
25
20
  });
26
21
 
27
22
  export const Primary = Template.bind({});
28
- // More on args: https://storybook.js.org/docs/vue/writing-stories/args
29
23
  Primary.args = {
30
24
  size: 64,
31
25
  };
@@ -60,5 +60,6 @@ const TemplateSlot = (args) => ({
60
60
  });
61
61
  export const WithSlot = TemplateSlot.bind({});
62
62
  WithSlot.args = {};
63
+
63
64
  export const WithTooltipText = TemplateSlot.bind({});
64
65
  WithTooltipText.args = { tooltipText: 'this is my tooltip' };
@@ -7,6 +7,7 @@ export default {
7
7
  page: template,
8
8
  },
9
9
  },
10
+ tags: ['code-only'],
10
11
  title: 'Composants/feedback/UiTooltip',
11
12
  component: UiTooltip,
12
13
  };
@@ -2,6 +2,7 @@ import BmsAutocomplete from '@/components/form/BmsAutocomplete.vue';
2
2
  import { Cat, Heart, Wheat } from 'lucide-vue-next';
3
3
 
4
4
  import template from '@/documentation/template_field_dependency.mdx';
5
+ import { DEFAULT_FIELD_INPUT } from '../../../.storybook/constants';
5
6
 
6
7
  export default {
7
8
  parameters: {
@@ -9,7 +10,8 @@ export default {
9
10
  page: template,
10
11
  },
11
12
  },
12
- title: 'Composants/form/AutocompleteTextIcon',
13
+ tags: ['with_useable_code'],
14
+ title: 'Composants/form/Autocomplete',
13
15
  component: BmsAutocomplete,
14
16
  argTypes: {},
15
17
  };
@@ -31,6 +33,7 @@ const Template = (args) => ({
31
33
 
32
34
  export const Default = Template.bind({});
33
35
  Default.args = {
36
+ ...DEFAULT_FIELD_INPUT,
34
37
  label: 'My autocomplete field',
35
38
  options: [
36
39
  { label: 'titi', value: 'i' },
@@ -42,6 +45,7 @@ Default.args = {
42
45
 
43
46
  export const Disabled = Template.bind({});
44
47
  Disabled.args = {
48
+ ...DEFAULT_FIELD_INPUT,
45
49
  label: 'My autocomplete field',
46
50
  options: [
47
51
  { label: 'titi', value: 'i' },
@@ -54,6 +58,7 @@ Disabled.args = {
54
58
 
55
59
  export const Loading = Template.bind({});
56
60
  Loading.args = {
61
+ ...DEFAULT_FIELD_INPUT,
57
62
  label: 'My autocomplete field',
58
63
  loading: true,
59
64
  options: [
@@ -66,6 +71,7 @@ Loading.args = {
66
71
 
67
72
  export const WithStringArray = Template.bind({});
68
73
  WithStringArray.args = {
74
+ ...DEFAULT_FIELD_INPUT,
69
75
  label: 'My autocomplete field',
70
76
  options: ['titi', 'toto', 'tutu'],
71
77
  modelValue: '',
@@ -74,6 +80,7 @@ WithStringArray.args = {
74
80
 
75
81
  export const WithValue = Template.bind({});
76
82
  WithValue.args = {
83
+ ...DEFAULT_FIELD_INPUT,
77
84
  label: 'My autocomplete field',
78
85
  options: [
79
86
  { label: 'titi', value: 'i' },
@@ -86,6 +93,7 @@ WithValue.args = {
86
93
  export const Opened = Template.bind({});
87
94
  Opened.parameters = { pseudo: { focus: 'input' } };
88
95
  Opened.args = {
96
+ ...DEFAULT_FIELD_INPUT,
89
97
  label: 'My autocomplete field',
90
98
  options: [
91
99
  { label: 'titi', value: 'i' },
@@ -97,6 +105,7 @@ Opened.args = {
97
105
  };
98
106
  export const IconsWithValue = Template.bind({});
99
107
  IconsWithValue.args = {
108
+ ...DEFAULT_FIELD_INPUT,
100
109
  label: 'My autocomplete field',
101
110
  options: [
102
111
  { label: 'titi', value: 'i', icon: Heart },
@@ -109,6 +118,7 @@ IconsWithValue.args = {
109
118
  export const IconsOpened = Template.bind({});
110
119
  IconsOpened.parameters = { pseudo: { focus: 'input' } };
111
120
  IconsOpened.args = {
121
+ ...DEFAULT_FIELD_INPUT,
112
122
  label: 'My autocomplete field',
113
123
  options: [
114
124
  { label: 'titi', value: 'i', icon: Heart },
@@ -1,6 +1,6 @@
1
1
  import { BookOpen, CloudLightning } from 'lucide-vue-next';
2
2
  import BmsBetweenInput from './BmsBetweenInput.vue';
3
- import { StatusType, InputType } from '../../models';
3
+ import { InputType, StatusType } from '../../models';
4
4
 
5
5
  import template from '@/documentation/template_field_dependency.mdx';
6
6
 
@@ -11,6 +11,7 @@ export default {
11
11
  },
12
12
  },
13
13
  title: 'Composants/form/BetweenInput',
14
+ tags: ['with_useable_code'],
14
15
  component: BmsBetweenInput,
15
16
  };
16
17
 
@@ -32,8 +33,20 @@ const Template = (args) => ({
32
33
  `,
33
34
  });
34
35
 
36
+ const DEFAULT_BEETWEEN_INPUT = {
37
+ inputType: InputType.NUMBER,
38
+ label: 'My label',
39
+ required: false,
40
+ optional: false,
41
+ disabled: false,
42
+ helperText: 'help me !',
43
+ captions: [],
44
+ errors: [],
45
+ };
46
+
35
47
  export const Default = Template.bind({});
36
48
  Default.args = {
49
+ ...DEFAULT_BEETWEEN_INPUT,
37
50
  label: 'My label',
38
51
  placeholderFrom: 'Placeholder From',
39
52
  placeholderTo: 'Placeholder To',
@@ -42,6 +55,7 @@ Default.args = {
42
55
 
43
56
  export const WithDate = Template.bind({});
44
57
  WithDate.args = {
58
+ ...DEFAULT_BEETWEEN_INPUT,
45
59
  inputType: InputType.DATETIME,
46
60
  label: 'My label',
47
61
  placeholderFrom: 'Placeholder From',
@@ -51,6 +65,7 @@ WithDate.args = {
51
65
 
52
66
  export const WithBadPresetValueDate = Template.bind({});
53
67
  WithBadPresetValueDate.args = {
68
+ ...DEFAULT_BEETWEEN_INPUT,
54
69
  inputType: InputType.DATETIME,
55
70
  label: 'My label',
56
71
  placeholderFrom: 'Placeholder From',
@@ -62,6 +77,7 @@ WithBadPresetValueDate.args = {
62
77
 
63
78
  export const WithErrors = Template.bind({});
64
79
  WithErrors.args = {
80
+ ...DEFAULT_BEETWEEN_INPUT,
65
81
  label: 'My label',
66
82
  placeholderFrom: 'Placeholder From',
67
83
  placeholderTo: 'Placeholder To',
@@ -9,6 +9,7 @@ export default {
9
9
  },
10
10
  },
11
11
  title: 'Composants/form/FilePicker',
12
+ tags: ['with_useable_code'],
12
13
  component: BmsFilePicker,
13
14
  argTypes: {
14
15
  limit: {
@@ -31,10 +32,11 @@ const Template = (args) => ({
31
32
  });
32
33
 
33
34
  export const Empty = Template.bind({});
34
- Empty.args = {};
35
+ Empty.args = { modelValue: [], limit: 5 };
35
36
 
36
37
  export const WithFiles = Template.bind({});
37
38
  WithFiles.args = {
39
+ limit: 5,
38
40
  modelValue: [
39
41
  {
40
42
  name: 'Name of a file',
@@ -3,6 +3,7 @@ import { ref } from 'vue';
3
3
  import { StatusType } from '@/models';
4
4
 
5
5
  import template from '@/documentation/template_field_dependency.mdx';
6
+ import { DEFAULT_FIELD_INPUT } from '../../../.storybook/constants';
6
7
 
7
8
  export default {
8
9
  parameters: {
@@ -10,6 +11,7 @@ export default {
10
11
  page: template,
11
12
  },
12
13
  },
14
+ tags: ['with_useable_code'],
13
15
  title: 'Composants/form/InputBooleanCheckbox',
14
16
  component: BmsInputBooleanCheckbox,
15
17
  };
@@ -42,12 +44,14 @@ const Template = (args) => ({
42
44
 
43
45
  export const Default = Template.bind({});
44
46
  Default.args = {
47
+ ...DEFAULT_FIELD_INPUT,
45
48
  labelValue: 'check me !',
46
49
  name: 'myCheckboxName',
47
50
  };
48
51
 
49
52
  export const WithNotBooleanModelValue = Template.bind({});
50
53
  WithNotBooleanModelValue.args = {
54
+ ...DEFAULT_FIELD_INPUT,
51
55
  modelValue: 'COCHEEEEEEEE',
52
56
  labelValue: 'check me !',
53
57
  name: 'myCheckboxName',
@@ -55,6 +59,7 @@ WithNotBooleanModelValue.args = {
55
59
 
56
60
  export const DefaultWithCheckedValue = Template.bind({});
57
61
  DefaultWithCheckedValue.args = {
62
+ ...DEFAULT_FIELD_INPUT,
58
63
  modelValue: true,
59
64
  labelValue: 'check me !',
60
65
  name: 'myCheckboxName',
@@ -62,6 +67,7 @@ DefaultWithCheckedValue.args = {
62
67
 
63
68
  export const WithLabel = Template.bind({});
64
69
  WithLabel.args = {
70
+ ...DEFAULT_FIELD_INPUT,
65
71
  label: 'My label',
66
72
  labelValue: 'check me !',
67
73
  modelValue: false,
@@ -70,6 +76,7 @@ WithLabel.args = {
70
76
 
71
77
  export const WithLabelAsSlot = Template.bind({});
72
78
  WithLabelAsSlot.args = {
79
+ ...DEFAULT_FIELD_INPUT,
73
80
  name: 'myCheckboxName',
74
81
  labelValue: 'check me !',
75
82
  modelValue: false,
@@ -78,6 +85,7 @@ WithLabelAsSlot.args = {
78
85
 
79
86
  export const Disabled = Template.bind({});
80
87
  Disabled.args = {
88
+ ...DEFAULT_FIELD_INPUT,
81
89
  name: 'myCheckboxName',
82
90
  labelValue: 'check me !',
83
91
  label: 'My label',
@@ -87,6 +95,7 @@ Disabled.args = {
87
95
 
88
96
  export const Error = Template.bind({});
89
97
  Error.args = {
98
+ ...DEFAULT_FIELD_INPUT,
90
99
  name: 'myCheckboxName',
91
100
  labelValue: 'check me !',
92
101
  label: 'My label',
@@ -9,6 +9,7 @@ export default {
9
9
  page: template,
10
10
  },
11
11
  },
12
+ tags: ['with_useable_code'],
12
13
  title: 'Composants/form/InputCheckboxCaption',
13
14
  component: BmsInputCheckboxCaption,
14
15
  };
@@ -38,8 +39,18 @@ const Template = (args) => ({
38
39
  `,
39
40
  });
40
41
 
42
+ const DEFAULT_CHECKBOXCAPTION_INPUT = {
43
+ label: 'Mon texte',
44
+ options: [],
45
+ required: false,
46
+ disabled: false,
47
+ captions: [],
48
+ errors: [],
49
+ };
50
+
41
51
  export const Default = Template.bind({});
42
52
  Default.args = {
53
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
43
54
  modelValue: null,
44
55
  label: 'MyLabel',
45
56
  name: 'myInput',
@@ -47,6 +58,7 @@ Default.args = {
47
58
 
48
59
  export const WithLabelAsSlot = Template.bind({});
49
60
  WithLabelAsSlot.args = {
61
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
50
62
  modelValue: null,
51
63
  labelSlot: 'This is a slotted value',
52
64
  name: 'myInput',
@@ -54,6 +66,7 @@ WithLabelAsSlot.args = {
54
66
 
55
67
  export const WithCaptions = Template.bind({});
56
68
  WithCaptions.args = {
69
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
57
70
  label: 'My label',
58
71
  modelValue: null,
59
72
  captions: ['Caption form my label 1', 'Caption form my label 2'],
@@ -62,6 +75,7 @@ WithCaptions.args = {
62
75
 
63
76
  export const WithCaptionMode = Template.bind({});
64
77
  WithCaptionMode.args = {
78
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
65
79
  label: 'My label',
66
80
  modelValue: null,
67
81
  captions: [
@@ -75,6 +89,7 @@ WithCaptionMode.args = {
75
89
 
76
90
  export const Disabled = Template.bind({});
77
91
  Disabled.args = {
92
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
78
93
  label: 'My label',
79
94
  modelValue: null,
80
95
  disabled: true,
@@ -84,6 +99,7 @@ Disabled.args = {
84
99
 
85
100
  export const Error = Template.bind({});
86
101
  Error.args = {
102
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
87
103
  label: 'My label',
88
104
  modelValue: null,
89
105
  errors: ['Error 1', 'Error 2'],
@@ -11,6 +11,7 @@ export default {
11
11
  page: template,
12
12
  },
13
13
  },
14
+ tags: ['with_useable_code'],
14
15
  title: 'Composants/form/InputCheckboxCaptionGroup',
15
16
  component: BmsInputCheckboxCaptionGroup,
16
17
  };
@@ -30,8 +31,21 @@ const Template = (args) => ({
30
31
  `,
31
32
  });
32
33
 
34
+ const DEFAULT_CHECKBOXCAPTION_INPUT = {
35
+ options: [],
36
+ required: false,
37
+ optional: false,
38
+ disabled: false,
39
+ helperText: 'help me !',
40
+ captions: [],
41
+ errors: [],
42
+ align: 'right',
43
+ };
44
+
33
45
  export const DefaultRow = Template.bind({});
34
46
  DefaultRow.args = {
47
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
48
+ label: 'This is a field label',
35
49
  options: [
36
50
  { value: 'tata', label: 'Tata', captions: ['Caption for tata'] },
37
51
  { value: 'titi', label: 'Titi', captions: ['Caption for titi'] },
@@ -43,11 +57,11 @@ DefaultRow.args = {
43
57
  { label: 'Caption for group', mode: StatusType.Success },
44
58
  ],
45
59
  modelValue: [],
46
- label: 'This is a field label',
47
60
  };
48
61
 
49
62
  export const DefaultColumn = Template.bind({});
50
63
  DefaultColumn.args = {
64
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
51
65
  options: [
52
66
  { value: 'tata', captions: ['Caption for tata'] },
53
67
  { value: 'titi', captions: ['Caption for titi'] },
@@ -61,6 +75,7 @@ DefaultColumn.args = {
61
75
 
62
76
  export const WithCaptionMode = Template.bind({});
63
77
  WithCaptionMode.args = {
78
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
64
79
  options: [
65
80
  {
66
81
  value: 'tata',
@@ -89,6 +104,7 @@ WithCaptionMode.args = {
89
104
 
90
105
  export const DefaultSelected = Template.bind({});
91
106
  DefaultSelected.args = {
107
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
92
108
  options: [
93
109
  { value: 'tata', captions: ['Caption for tata'] },
94
110
  { value: 'titi', captions: ['Caption for titi'] },
@@ -101,6 +117,7 @@ DefaultSelected.args = {
101
117
 
102
118
  export const FullHelp = Template.bind({});
103
119
  FullHelp.args = {
120
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
104
121
  options: [
105
122
  { value: 'tata', captions: ['Caption for tata'] },
106
123
  { value: 'titi', captions: ['Caption for titi'] },
@@ -115,6 +132,7 @@ FullHelp.args = {
115
132
 
116
133
  export const Disabled = Template.bind({});
117
134
  Disabled.args = {
135
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
118
136
  options: [
119
137
  { value: 'tata', captions: ['Caption for tata'] },
120
138
  { value: 'titi', captions: ['Caption for titi'] },
@@ -128,6 +146,7 @@ Disabled.args = {
128
146
 
129
147
  export const Required = Template.bind({});
130
148
  Required.args = {
149
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
131
150
  options: [
132
151
  { value: 'tata', captions: ['Caption for tata'] },
133
152
  { value: 'titi', captions: ['Caption for titi'] },
@@ -141,6 +160,7 @@ Required.args = {
141
160
 
142
161
  export const Errors = Template.bind({});
143
162
  Errors.args = {
163
+ ...DEFAULT_CHECKBOXCAPTION_INPUT,
144
164
  options: [
145
165
  { value: 'tata', captions: ['Caption for tata'] },
146
166
  { value: 'titi', captions: ['Caption for titi'] },
@@ -53,6 +53,7 @@ const props = withDefaults(defineProps<Props>(), {
53
53
  label: '',
54
54
  required: false,
55
55
  disabled: false,
56
+ small: false,
56
57
  });
57
58
 
58
59
  const input: Ref<HTMLElement | null> = ref(null);