@ouestfrance/sipa-bms-ui 8.3.0 → 8.5.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 (81) hide show
  1. package/dist/components/form/BmsAutocomplete.vue.d.ts +3 -9
  2. package/dist/components/form/BmsInputBooleanCheckbox.vue.d.ts +3 -9
  3. package/dist/components/form/BmsInputCheckboxCaption.vue.d.ts +1 -1
  4. package/dist/components/form/BmsInputCheckboxGroup.vue.d.ts +4 -11
  5. package/dist/components/form/BmsInputCode.vue.d.ts +4 -11
  6. package/dist/components/form/BmsInputFile.vue.d.ts +2 -9
  7. package/dist/components/form/BmsInputRadioCaptionGroup.vue.d.ts +2 -9
  8. package/dist/components/form/BmsInputRadioGroup.vue.d.ts +2 -9
  9. package/dist/components/form/BmsInputText.vue.d.ts +10 -12
  10. package/dist/components/form/BmsInputToggle.vue.d.ts +5 -6
  11. package/dist/components/form/BmsMultiSelect.vue.d.ts +3 -9
  12. package/dist/components/form/BmsSearch.vue.d.ts +11 -5
  13. package/dist/components/form/BmsSelect.vue.d.ts +3 -8
  14. package/dist/components/form/BmsTag.vue.d.ts +1 -0
  15. package/dist/components/form/BmsTextArea.vue.d.ts +2 -9
  16. package/dist/components/form/RawAutocomplete.vue.d.ts +10 -11
  17. package/dist/components/form/RawInputText.vue.d.ts +3 -5
  18. package/dist/components/layout/BmsCard.vue.d.ts +3 -0
  19. package/dist/components/navigation/BmsFixedMenu.vue.d.ts +17 -0
  20. package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +11 -5
  21. package/dist/components/table/BmsTableFilters.vue.d.ts +11 -5
  22. package/dist/index.d.ts +2 -1
  23. package/dist/mockServiceWorker.js +1 -1
  24. package/dist/plugins/field/FieldComponent.vue.d.ts +3 -11
  25. package/dist/plugins/field/FieldDatalist.vue.d.ts +2 -0
  26. package/dist/plugins/field/field-component.model.d.ts +11 -0
  27. package/dist/sipa-bms-ui.css +201 -147
  28. package/dist/sipa-bms-ui.es.js +4855 -3921
  29. package/dist/sipa-bms-ui.es.js.map +1 -1
  30. package/dist/sipa-bms-ui.umd.js +4861 -3926
  31. package/dist/sipa-bms-ui.umd.js.map +1 -1
  32. package/package.json +20 -24
  33. package/src/components/form/BmsAutocomplete.stories.js +10 -0
  34. package/src/components/form/BmsAutocomplete.vue +4 -9
  35. package/src/components/form/BmsBetweenInput.vue +1 -10
  36. package/src/components/form/BmsFilePicker.stories.js +0 -7
  37. package/src/components/form/BmsInputBooleanCheckbox.stories.js +6 -0
  38. package/src/components/form/BmsInputBooleanCheckbox.vue +3 -16
  39. package/src/components/form/BmsInputCheckboxCaptionGroup.vue +1 -9
  40. package/src/components/form/BmsInputCheckboxGroup.vue +3 -18
  41. package/src/components/form/BmsInputCode.stories.js +2 -0
  42. package/src/components/form/BmsInputCode.vue +3 -18
  43. package/src/components/form/BmsInputDateTime.stories.js +2 -0
  44. package/src/components/form/BmsInputFile.stories.js +4 -1
  45. package/src/components/form/BmsInputFile.vue +5 -20
  46. package/src/components/form/BmsInputNumber.stories.js +5 -0
  47. package/src/components/form/BmsInputRadioCaptionGroup.vue +3 -18
  48. package/src/components/form/BmsInputRadioGroup.stories.js +12 -0
  49. package/src/components/form/BmsInputRadioGroup.vue +4 -19
  50. package/src/components/form/BmsInputText.spec.ts +1 -1
  51. package/src/components/form/BmsInputText.stories.js +5 -0
  52. package/src/components/form/BmsInputText.vue +5 -19
  53. package/src/components/form/BmsInputToggle.stories.js +3 -0
  54. package/src/components/form/BmsInputToggle.vue +13 -15
  55. package/src/components/form/BmsMultiSelect.stories.js +10 -1
  56. package/src/components/form/BmsMultiSelect.vue +5 -17
  57. package/src/components/form/BmsSearch.stories.js +2 -0
  58. package/src/components/form/BmsSelect.stories.js +4 -1
  59. package/src/components/form/BmsSelect.vue +7 -20
  60. package/src/components/form/BmsTag.stories.js +9 -0
  61. package/src/components/form/BmsTag.vue +9 -6
  62. package/src/components/form/BmsTextArea.stories.js +3 -2
  63. package/src/components/form/BmsTextArea.vue +12 -21
  64. package/src/components/form/RawAutocomplete.spec.ts +30 -10
  65. package/src/components/form/RawAutocomplete.vue +8 -18
  66. package/src/components/form/RawInputText.vue +11 -9
  67. package/src/components/form/UiBmsInputCheckbox.stories.js +10 -0
  68. package/src/components/layout/BmsCard.stories.js +14 -0
  69. package/src/components/layout/BmsCard.vue +14 -2
  70. package/src/components/navigation/BmsFixedMenu.stories.js +113 -0
  71. package/src/components/navigation/BmsFixedMenu.vue +70 -0
  72. package/src/components/navigation/BmsMenuNav.vue +5 -1
  73. package/src/components/table/UiBmsTableRow.vue +4 -4
  74. package/src/index.ts +3 -0
  75. package/src/plugins/field/FieldComponent.stories.js +8 -1
  76. package/src/plugins/field/FieldComponent.vue +29 -15
  77. package/src/plugins/field/FieldDatalist.stories.js +2 -0
  78. package/src/plugins/field/FieldDatalist.vue +12 -2
  79. package/src/plugins/field/field-component.model.ts +12 -0
  80. package/src/showroom/pages/autocomplete.vue +7 -4
  81. package/src/showroom/pages/forms.vue +28 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouestfrance/sipa-bms-ui",
3
- "version": "8.3.0",
3
+ "version": "8.5.0",
4
4
  "author": "Ouest-France BMS",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -36,54 +36,53 @@
36
36
  "@commitlint/config-conventional": "19.8.1",
37
37
  "@formkit/vue": "1.6.9",
38
38
  "@mdx-js/react": "3.1.0",
39
- "@storybook/addon-actions": "^8.6.14",
40
- "@storybook/addon-docs": "9.0.17",
41
- "@storybook/addon-links": "9.0.17",
42
- "@storybook/vue3-vite": "9.0.17",
39
+ "@storybook/addon-docs": "9.1.3",
40
+ "@storybook/addon-links": "9.1.3",
41
+ "@storybook/vue3-vite": "9.1.3",
43
42
  "@types/lodash": "4.17.20",
44
43
  "@types/uuid": "10.0.0",
45
- "@vitejs/plugin-vue": "6.0.0",
44
+ "@vitejs/plugin-vue": "6.0.1",
46
45
  "@vue/test-utils": "2.4.6",
47
- "@vueuse/core": "13.5.0",
46
+ "@vueuse/core": "13.7.0",
48
47
  "@vueuse/motion": "^3.0.0",
49
- "axios": "1.10.0",
48
+ "axios": "1.11.0",
50
49
  "blob-util": "^2.0.2",
51
- "chromatic": "13.1.2",
50
+ "chromatic": "13.1.3",
52
51
  "codemirror": "6.0.2",
53
52
  "cors": "^2.8.5",
54
53
  "cross-env": "^10.0.0",
55
- "cy2": "4.0.9",
56
- "cypress": "14.5.2",
54
+ "cy2": "^4.0.0",
55
+ "cypress": "15.0.0",
57
56
  "express": "^5.0.0",
58
57
  "husky": "9.1.7",
59
58
  "jsdom": "26.1.0",
60
59
  "keycloak-js": "26.1.2",
61
- "lint-staged": "16.1.2",
60
+ "lint-staged": "16.1.5",
62
61
  "lodash": "4.17.21",
63
- "lucide-vue-next": "0.525.0",
62
+ "lucide-vue-next": "0.541.0",
64
63
  "msw-storybook-addon": "^2.0.3",
65
64
  "normalize.css": "8.0.1",
66
65
  "path": "0.12.7",
67
66
  "prettier": "3.6.2",
68
- "sass": "1.89.2",
67
+ "sass": "1.90.0",
69
68
  "semantic-release": "24.2.7",
70
- "start-server-and-test": "2.0.12",
71
- "storybook": "9.0.17",
72
- "storybook-addon-pseudo-states": "9.0.17",
73
- "storybook-vue3-router": "^5.0.0",
69
+ "start-server-and-test": "2.0.13",
70
+ "storybook": "9.1.3",
71
+ "storybook-addon-pseudo-states": "9.1.3",
72
+ "storybook-vue3-router": "^6.0.2",
74
73
  "typescript": "5.2.2",
75
74
  "uuid": "11.1.0",
76
- "vite": "7.0.5",
75
+ "vite": "7.1.3",
77
76
  "vite-plugin-dts": "^4.1.0",
78
77
  "vite-plugin-mkcert": "1.17.8",
79
78
  "vite-plugin-pages": "0.33.1",
80
79
  "vite-svg-loader": "5.1.0",
81
80
  "vitest": "3.2.4",
82
- "vue": "3.5.17",
81
+ "vue": "3.5.19",
83
82
  "vue-codemirror": "6.1.1",
84
83
  "vue-loader": "17.4.2",
85
84
  "vue-router": "4.5.1",
86
- "vue-tsc": "3.0.3"
85
+ "vue-tsc": "3.0.6"
87
86
  },
88
87
  "files": [
89
88
  "dist",
@@ -119,8 +118,5 @@
119
118
  },
120
119
  "dependencies": {
121
120
  "msw": "^2.3.1"
122
- },
123
- "overrides": {
124
- "storybook": "$storybook"
125
121
  }
126
122
  }
@@ -22,12 +22,16 @@ const Template = (args) => ({
22
22
  return { args };
23
23
  },
24
24
  template: `
25
+ <div style="display:flex; gap:1em">
25
26
  <BmsAutocomplete v-bind="args" />
27
+ <BmsAutocomplete v-bind="{...args, small:true}"/>
28
+ </div>
26
29
  `,
27
30
  });
28
31
 
29
32
  export const Default = Template.bind({});
30
33
  Default.args = {
34
+ label: 'My autocomplete field',
31
35
  options: [
32
36
  { label: 'titi', value: 'i' },
33
37
  { label: 'toto', value: 'o' },
@@ -35,8 +39,10 @@ Default.args = {
35
39
  ],
36
40
  modelValue: '',
37
41
  };
42
+
38
43
  export const WithStringArray = Template.bind({});
39
44
  WithStringArray.args = {
45
+ label: 'My autocomplete field',
40
46
  options: ['titi', 'toto', 'tutu'],
41
47
  modelValue: '',
42
48
  open: true,
@@ -44,6 +50,7 @@ WithStringArray.args = {
44
50
 
45
51
  export const WithValue = Template.bind({});
46
52
  WithValue.args = {
53
+ label: 'My autocomplete field',
47
54
  options: [
48
55
  { label: 'titi', value: 'i' },
49
56
  { label: 'toto', value: 'o' },
@@ -55,6 +62,7 @@ WithValue.args = {
55
62
  export const Opened = Template.bind({});
56
63
  Opened.parameters = { pseudo: { focus: 'input' } };
57
64
  Opened.args = {
65
+ label: 'My autocomplete field',
58
66
  options: [
59
67
  { label: 'titi', value: 'i' },
60
68
  { label: 'toto', value: 'o' },
@@ -65,6 +73,7 @@ Opened.args = {
65
73
  };
66
74
  export const IconsWithValue = Template.bind({});
67
75
  IconsWithValue.args = {
76
+ label: 'My autocomplete field',
68
77
  options: [
69
78
  { label: 'titi', value: 'i', icon: Heart },
70
79
  { label: 'toto', value: 'o', icon: Cat },
@@ -76,6 +85,7 @@ IconsWithValue.args = {
76
85
  export const IconsOpened = Template.bind({});
77
86
  IconsOpened.parameters = { pseudo: { focus: 'input' } };
78
87
  IconsOpened.args = {
88
+ label: 'My autocomplete field',
79
89
  options: [
80
90
  { label: 'titi', value: 'i', icon: Heart },
81
91
  { label: 'toto', value: 'o', icon: Cat },
@@ -12,6 +12,7 @@
12
12
  :helperText="helperText"
13
13
  :placeholder="placeholder"
14
14
  :can-add-new-option="canAddNewOption"
15
+ :small="small"
15
16
  @select="(option: any) => emits('select', option)"
16
17
  @add-new-option="(newOption: string) => emits('addNewOption', newOption)"
17
18
  >
@@ -41,19 +42,13 @@
41
42
  <script setup lang="ts">
42
43
  import { computed } from 'vue';
43
44
  import RawAutocomplete from './RawAutocomplete.vue';
44
- import { Caption, InputOption } from '@/models';
45
+ import { InputOption } from '@/models';
46
+ import { FieldComponentProps } from '@/plugins/field/field-component.model';
45
47
 
46
- export interface Props {
48
+ export interface Props extends FieldComponentProps {
47
49
  options: string[] | InputOption[];
48
50
  modelValue?: string;
49
- label?: string;
50
- required?: boolean;
51
- optional?: boolean;
52
- disabled?: boolean;
53
- helperText?: string;
54
51
  placeholder?: string;
55
- captions?: string[] | Caption[];
56
- errors?: string[] | Caption[];
57
52
  open?: boolean;
58
53
  canAddNewOption?: boolean;
59
54
  }
@@ -1,14 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="allErrors"
5
- :captions="captions"
6
- :required="required"
7
- :optional="optional"
8
- :helperText="helperText"
9
- :disabled="disabled"
10
- class="field-between"
11
- >
2
+ <field v-bind="$props" :errors="allErrors" class="field-between">
12
3
  <RawInputText
13
4
  :type="inputType"
14
5
  :modelValue="valueFrom"
@@ -1,6 +1,5 @@
1
1
  import BmsFilePicker from '@/components/form/BmsFilePicker.vue';
2
2
 
3
- // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
3
  import template from '@/documentation/template_field_dependency.mdx';
5
4
 
6
5
  export default {
@@ -11,7 +10,6 @@ export default {
11
10
  },
12
11
  title: 'Composants/form/FilePicker',
13
12
  component: BmsFilePicker,
14
- // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
15
13
  argTypes: {
16
14
  limit: {
17
15
  control: { type: 'number' },
@@ -20,24 +18,19 @@ export default {
20
18
  },
21
19
  };
22
20
 
23
- // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
24
21
  const Template = (args) => ({
25
- // Components used in your story `template` are defined in the `components` object
26
22
  components: {
27
23
  BmsFilePicker,
28
24
  },
29
- // The story's `args` need to be mapped into the template through the `setup()` method
30
25
  setup() {
31
26
  return { args };
32
27
  },
33
- // And then the `args` are bound to your component with `v-bind="args"`
34
28
  template: `
35
29
  <BmsFilePicker v-bind="args" />
36
30
  `,
37
31
  });
38
32
 
39
33
  export const Empty = Template.bind({});
40
- // More on args: https://storybook.js.org/docs/vue/writing-stories/args
41
34
  Empty.args = {};
42
35
 
43
36
  export const WithFiles = Template.bind({});
@@ -30,6 +30,12 @@ const Template = (args) => ({
30
30
  </template>
31
31
  </BmsInputBooleanCheckbox>
32
32
  Valeur de mon champ : {{ curentValue }}
33
+ <br/>
34
+ <BmsInputBooleanCheckbox v-bind="{...args, small:true}" v-model="curentValue">
35
+ <template v-if="args.labelSlot" #label>
36
+ <span v-html='args.labelSlot'/>
37
+ </template>
38
+ </BmsInputBooleanCheckbox>
33
39
  </div>
34
40
  `,
35
41
  });
@@ -1,12 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="errors"
5
- :required="required"
6
- :helperText="helperText"
7
- :captions="captions"
8
- :disabled="disabled"
9
- >
2
+ <field v-bind="$props">
10
3
  <UiBmsInputCheckbox
11
4
  class="field-checkbox"
12
5
  :modelValue="modelValue"
@@ -26,19 +19,13 @@
26
19
 
27
20
  <script lang="ts" setup>
28
21
  import { onMounted } from 'vue';
29
- import { Caption } from '@/models/caption.model';
30
22
  import UiBmsInputCheckbox from '@/components/form/UiBmsInputCheckbox.vue';
23
+ import { FieldComponentProps } from '@/plugins/field/field-component.model';
31
24
 
32
- export interface Props {
25
+ export interface Props extends FieldComponentProps {
33
26
  modelValue: any;
34
27
  labelValue: string;
35
28
  name: string;
36
- label?: string;
37
- disabled?: boolean;
38
- helperText?: string;
39
- captions?: string[] | Caption[];
40
- errors?: string[] | Caption[];
41
- required?: boolean;
42
29
  }
43
30
 
44
31
  const props = withDefaults(defineProps<Props>(), {
@@ -1,13 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="errors"
5
- :captions="captions"
6
- :required="required"
7
- :optional="optional"
8
- :helperText="helperText"
9
- :disabled="disabled"
10
- >
2
+ <field v-bind="$props">
11
3
  <span class="input-checkbox-group-caption-wrapper" :class="align">
12
4
  <BmsInputCheckboxCaption
13
5
  v-for="option in options"
@@ -1,13 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="errors"
5
- :captions="captions"
6
- :required="required"
7
- :optional="optional"
8
- :helperText="helperText"
9
- :disabled="disabled"
10
- >
2
+ <field v-bind="$props">
11
3
  <span class="input-checkbox-group-wrapper" :class="align">
12
4
  <UiBmsInputCheckbox
13
5
  v-for="option in computedValues"
@@ -28,19 +20,12 @@
28
20
  import { computed, ComputedRef, ref, Ref } from 'vue';
29
21
  import { v4 as uuid } from 'uuid';
30
22
  import { type BmsInputCheckboxGroupOption } from '@/models';
31
- import { Caption } from '@/models/caption.model';
32
23
  import UiBmsInputCheckbox from './UiBmsInputCheckbox.vue';
24
+ import { FieldComponentProps } from '@/plugins/field/field-component.model';
33
25
 
34
- export interface Props {
26
+ export interface Props extends FieldComponentProps {
35
27
  values: string[] | BmsInputCheckboxGroupOption[];
36
28
  modelValue: any[];
37
- label?: string;
38
- required?: boolean;
39
- optional?: boolean;
40
- disabled?: boolean;
41
- helperText?: string;
42
- captions?: string[] | Caption[];
43
- errors?: string[] | Caption[];
44
29
  align?: 'row' | 'column';
45
30
  }
46
31
 
@@ -21,6 +21,8 @@ const Template = (args) => ({
21
21
  },
22
22
  template: `
23
23
  <BmsInputCode v-bind="args"/>
24
+ <br/>
25
+ <BmsInputCode v-bind="{...args, small:true}"/>
24
26
  `,
25
27
  });
26
28
 
@@ -1,13 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="errors"
5
- :captions="captions"
6
- :required="required"
7
- :optional="optional"
8
- :helperText="helperText"
9
- :disabled="disabled"
10
- >
2
+ <field v-bind="$props">
11
3
  <div class="code-mirror">
12
4
  <Codemirror
13
5
  v-model="input"
@@ -21,23 +13,16 @@
21
13
  </template>
22
14
 
23
15
  <script setup lang="ts">
24
- import { Caption } from '@/models';
16
+ import { FieldComponentProps } from '@/plugins/field/field-component.model';
25
17
  import { html } from '@codemirror/lang-html';
26
18
  import { json, jsonParseLinter } from '@codemirror/lang-json';
27
19
  import { linter, lintGutter } from '@codemirror/lint';
28
20
  import { computed } from 'vue';
29
21
  import { Codemirror } from 'vue-codemirror';
30
22
 
31
- export interface Props {
23
+ export interface Props extends FieldComponentProps {
32
24
  type: 'html' | 'json';
33
25
  modelValue: string;
34
- label?: string;
35
- required?: boolean;
36
- optional?: boolean;
37
- disabled?: boolean;
38
- helperText?: string;
39
- captions?: string[] | Caption[];
40
- errors?: string[] | Caption[];
41
26
  }
42
27
 
43
28
  const props = withDefaults(defineProps<Props>(), {
@@ -22,6 +22,8 @@ const Template = (args) => ({
22
22
  },
23
23
  template: `
24
24
  <BmsInputDateTime v-bind="args" />
25
+ <br/>
26
+ <BmsInputDateTime v-bind="{...args, small:true}"/>
25
27
  `,
26
28
  });
27
29
 
@@ -21,7 +21,10 @@ const Template = (args) => ({
21
21
  components: {
22
22
  BmsInputFile,
23
23
  },
24
- template: `<BmsInputFile v-bind="args"/>`,
24
+ template: `
25
+ <BmsInputFile v-bind="args"/>
26
+ <br/>
27
+ <BmsInputFile v-bind="{...args, small:true}"/>`,
25
28
  });
26
29
 
27
30
  export const Empty = Template.bind({});
@@ -1,14 +1,5 @@
1
1
  <template>
2
- <field
3
- class="file-upload"
4
- :label="label"
5
- :disabled="disabled"
6
- :errors="errors"
7
- :captions="captions"
8
- :required="required"
9
- :optional="optional"
10
- :helperText="helperText"
11
- >
2
+ <field class="file-upload" v-bind="$props">
12
3
  <div
13
4
  v-if="!modelValue || !modelValue.length"
14
5
  class="file-upload__drop-area"
@@ -67,18 +58,12 @@ import BmsIconButton from '../button/BmsIconButton.vue';
67
58
  import { isFileImage, getImageFromFile } from '@/helpers/file.helper';
68
59
  import { Caption } from '@/models/caption.model';
69
60
  import { StatusType } from '@/models';
61
+ import { FieldComponentProps } from '@/plugins/field/field-component.model';
70
62
 
71
- interface Props {
72
- label: string;
63
+ interface Props extends FieldComponentProps {
73
64
  modelValue: File[];
74
65
  limit?: number;
75
- disabled?: boolean;
76
- required?: boolean;
77
- optional?: boolean;
78
- helperText?: string;
79
66
  placeholder?: string;
80
- captions?: string[] | Caption[];
81
- errors?: string[] | Caption[];
82
67
  wide?: boolean;
83
68
  accept?: string;
84
69
  }
@@ -227,8 +212,8 @@ watch(
227
212
 
228
213
  &__drop-area {
229
214
  display: block;
230
- padding: 4em 1em;
231
- margin: 1em 0;
215
+ padding: calc(4 * var(--field-padding)) var(--field-padding);
216
+ // margin: var(--field-margin);
232
217
  text-align: center;
233
218
  border-radius: var(--bms-border-radius);
234
219
  border: var(--drop-border);
@@ -28,6 +28,11 @@ const Template = (args) => ({
28
28
  <template v-if="args.iconStart" #icon-start><BookOpen/></template>
29
29
  <template v-if="args.iconEnd" #icon-end><CloudLightning/></template>
30
30
  </BmsInputNumber>
31
+ <br/>
32
+ <BmsInputNumber v-bind="{...args, small:true}">
33
+ <template v-if="args.iconStart" #icon-start><BookOpen/></template>
34
+ <template v-if="args.iconEnd" #icon-end><CloudLightning/></template>
35
+ </BmsInputNumber>
31
36
  `,
32
37
  });
33
38
 
@@ -1,13 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="errors"
5
- :captions="captions"
6
- :required="required"
7
- :optional="optional"
8
- :helperText="helperText"
9
- :disabled="disabled"
10
- >
2
+ <field v-bind="$props">
11
3
  <span class="input-radio-group-caption-wrapper" :class="align">
12
4
  <slot>
13
5
  <BmsInputRadioCaption
@@ -31,18 +23,11 @@ import { Ref, computed, ref } from 'vue';
31
23
  import BmsInputRadioCaption from './BmsInputRadioCaption.vue';
32
24
  import { v4 as uuid } from 'uuid';
33
25
  import { BmsInputRadioCaptionGroupOption } from '@/models';
34
- import { Caption } from '@/models/caption.model';
26
+ import { FieldComponentProps } from '@/plugins/field/field-component.model';
35
27
 
36
- export interface Props {
28
+ export interface Props extends FieldComponentProps {
37
29
  options?: BmsInputRadioCaptionGroupOption[];
38
30
  modelValue: any;
39
- label?: string;
40
- required?: boolean;
41
- optional?: boolean;
42
- disabled?: boolean;
43
- helperText?: string;
44
- captions?: string[] | Caption[];
45
- errors?: string[] | Caption[];
46
31
  align?: 'row' | 'column';
47
32
  }
48
33
 
@@ -48,6 +48,18 @@ DefaultRow.args = {
48
48
  label: 'This is a field label',
49
49
  };
50
50
 
51
+ export const Small = Template.bind({});
52
+ Small.args = {
53
+ small: true,
54
+ values: [
55
+ { value: 'tata', label: 'Tata' },
56
+ { value: 'titi', label: 'Titi' },
57
+ { value: 'toto', label: 'Toto' },
58
+ { value: 'tutu', label: 'Tutu' },
59
+ ],
60
+ modelValue: '',
61
+ label: 'This is a field label',
62
+ };
51
63
  export const DefaultColumn = Template.bind({});
52
64
  DefaultColumn.args = {
53
65
  values: ['tata', 'titi', 'toto', 'tutu'],
@@ -1,13 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="errors"
5
- :captions="captions"
6
- :required="required"
7
- :optional="optional"
8
- :helperText="helperText"
9
- :disabled="disabled"
10
- >
2
+ <field v-bind="$props">
11
3
  <span class="input-radio-group-wrapper" :class="align">
12
4
  <slot>
13
5
  <BmsInputRadio
@@ -31,18 +23,11 @@ import { computed, ComputedRef, ref, Ref } from 'vue';
31
23
  import BmsInputRadio from './BmsInputRadio.vue';
32
24
  import { v4 as uuid } from 'uuid';
33
25
  import { BmsInputRadioGroupOption } from '@/models';
34
- import { Caption } from '@/models/caption.model';
26
+ import { FieldComponentProps } from '@/plugins/field/field-component.model';
35
27
 
36
- export interface Props {
28
+ export interface Props extends FieldComponentProps {
37
29
  values?: string[] | BmsInputRadioGroupOption[];
38
30
  modelValue: any;
39
- label?: string;
40
- required?: boolean;
41
- optional?: boolean;
42
- disabled?: boolean;
43
- helperText?: string;
44
- captions?: string[] | Caption[];
45
- errors?: string[] | Caption[];
46
31
  align?: 'row' | 'column';
47
32
  }
48
33
 
@@ -83,7 +68,7 @@ const computedValues: ComputedRef<BmsInputRadioGroupOption[]> = computed(() => {
83
68
  .input-radio-group-wrapper {
84
69
  display: flex;
85
70
  gap: 1em;
86
- margin: 0.5em 0;
71
+ margin: var(--field-margin);
87
72
  flex-direction: row;
88
73
 
89
74
  &.column {
@@ -1,5 +1,5 @@
1
1
  import { field } from '@/plugins/field';
2
- import BmsInputText, { Props } from './BmsInputText.vue';
2
+ import BmsInputText, { type Props } from './BmsInputText.vue';
3
3
  import { mount } from '@vue/test-utils';
4
4
  import { nextTick } from 'vue';
5
5
 
@@ -27,6 +27,11 @@ const Template = (args) => ({
27
27
  <template v-if="args.iconStart" #icon-start><BookOpen/></template>
28
28
  <template v-if="args.iconEnd" #icon-end><CloudLightning/></template>
29
29
  </BmsInputText>
30
+ <br/>
31
+ <BmsInputText v-bind="{...args, small:true}">
32
+ <template v-if="args.iconStart" #icon-start><BookOpen/></template>
33
+ <template v-if="args.iconEnd" #icon-end><CloudLightning/></template>
34
+ </BmsInputText>
30
35
  `,
31
36
  });
32
37
 
@@ -1,13 +1,5 @@
1
1
  <template>
2
- <field
3
- :label="label"
4
- :errors="errors"
5
- :captions="captions"
6
- :required="required"
7
- :optional="optional"
8
- :helperText="helperText"
9
- :disabled="disabled"
10
- >
2
+ <field v-bind="$props">
11
3
  <RawInputText
12
4
  ref="input"
13
5
  :type="inputType"
@@ -17,6 +9,7 @@
17
9
  :disabled="disabled"
18
10
  :errors="errors"
19
11
  :hasDate="false"
12
+ :small="small"
20
13
  @blur="$emits('blur')"
21
14
  @input="onInput"
22
15
  @keyup="onInput"
@@ -32,26 +25,19 @@
32
25
  </template>
33
26
 
34
27
  <script lang="ts" setup>
35
- import { Ref, ref } from 'vue';
36
- import { Caption } from '@/models/caption.model';
28
+ import { type Ref, ref } from 'vue';
37
29
  import RawInputText from '@/components/form/RawInputText.vue';
38
30
  import { InputType } from '@/models';
31
+ import type { FieldComponentProps } from '@/plugins/field/field-component.model';
39
32
 
40
- export interface Props {
33
+ export interface Props extends FieldComponentProps {
41
34
  inputType?:
42
35
  | InputType.TEXT
43
36
  | InputType.NUMBER
44
37
  | InputType.DATE
45
38
  | InputType.DATETIME;
46
39
  modelValue: string | number;
47
- label?: string;
48
- required?: boolean;
49
- optional?: boolean;
50
- disabled?: boolean;
51
- helperText?: string;
52
40
  placeholder?: string;
53
- captions?: string[] | Caption[];
54
- errors?: string[] | Caption[];
55
41
  }
56
42
 
57
43
  const props = withDefaults(defineProps<Props>(), {
@@ -24,6 +24,9 @@ const Template = (args) => ({
24
24
  template: `
25
25
  <BmsInputToggle v-bind="{...args}" v-model="curentValue"/>
26
26
  Valeur de mon toggle : {{ curentValue }}
27
+ <br/>
28
+ <BmsInputToggle v-bind="{...args, small:true}" v-model="curentValue"/>
29
+ Valeur de mon toggle : {{ curentValue }}
27
30
  `,
28
31
  });
29
32