@ouestfrance/sipa-bms-ui 8.4.0 → 8.5.1
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/components/form/BmsAutocomplete.vue.d.ts +3 -9
- package/dist/components/form/BmsInputBooleanCheckbox.vue.d.ts +3 -9
- package/dist/components/form/BmsInputCheckboxCaption.vue.d.ts +1 -1
- package/dist/components/form/BmsInputCheckboxGroup.vue.d.ts +4 -11
- package/dist/components/form/BmsInputCode.vue.d.ts +4 -11
- package/dist/components/form/BmsInputFile.vue.d.ts +2 -9
- package/dist/components/form/BmsInputRadioCaptionGroup.vue.d.ts +2 -9
- package/dist/components/form/BmsInputRadioGroup.vue.d.ts +2 -9
- package/dist/components/form/BmsInputText.vue.d.ts +10 -12
- package/dist/components/form/BmsInputToggle.vue.d.ts +5 -6
- package/dist/components/form/BmsMultiSelect.vue.d.ts +3 -9
- package/dist/components/form/BmsSearch.vue.d.ts +11 -5
- package/dist/components/form/BmsSelect.vue.d.ts +3 -8
- package/dist/components/form/BmsTag.vue.d.ts +1 -0
- package/dist/components/form/BmsTextArea.vue.d.ts +2 -9
- package/dist/components/form/RawAutocomplete.vue.d.ts +10 -11
- package/dist/components/form/RawInputText.vue.d.ts +3 -5
- package/dist/components/navigation/UiTenantSwitcher.vue.d.ts +11 -5
- package/dist/components/table/BmsTableFilters.vue.d.ts +11 -5
- package/dist/mockServiceWorker.js +1 -1
- package/dist/plugins/field/FieldComponent.vue.d.ts +3 -11
- package/dist/plugins/field/FieldDatalist.vue.d.ts +2 -0
- package/dist/plugins/field/field-component.model.d.ts +11 -0
- package/dist/sipa-bms-ui.css +132 -114
- package/dist/sipa-bms-ui.es.js +3255 -3100
- package/dist/sipa-bms-ui.es.js.map +1 -1
- package/dist/sipa-bms-ui.umd.js +3255 -3100
- package/dist/sipa-bms-ui.umd.js.map +1 -1
- package/package.json +16 -16
- package/src/components/form/BmsAutocomplete.stories.js +10 -0
- package/src/components/form/BmsAutocomplete.vue +4 -9
- package/src/components/form/BmsBetweenInput.vue +1 -10
- package/src/components/form/BmsFilePicker.stories.js +0 -7
- package/src/components/form/BmsInputBooleanCheckbox.stories.js +6 -0
- package/src/components/form/BmsInputBooleanCheckbox.vue +3 -22
- package/src/components/form/BmsInputCheckboxCaptionGroup.vue +1 -10
- package/src/components/form/BmsInputCheckboxGroup.vue +3 -19
- package/src/components/form/BmsInputCode.stories.js +2 -0
- package/src/components/form/BmsInputCode.vue +3 -18
- package/src/components/form/BmsInputDateTime.stories.js +2 -0
- package/src/components/form/BmsInputFile.stories.js +4 -1
- package/src/components/form/BmsInputFile.vue +5 -20
- package/src/components/form/BmsInputNumber.stories.js +5 -0
- package/src/components/form/BmsInputRadioCaptionGroup.vue +3 -19
- package/src/components/form/BmsInputRadioGroup.stories.js +12 -0
- package/src/components/form/BmsInputRadioGroup.vue +3 -19
- package/src/components/form/BmsInputText.spec.ts +1 -1
- package/src/components/form/BmsInputText.stories.js +5 -0
- package/src/components/form/BmsInputText.vue +5 -19
- package/src/components/form/BmsInputToggle.stories.js +3 -0
- package/src/components/form/BmsInputToggle.vue +13 -15
- package/src/components/form/BmsMultiSelect.stories.js +10 -1
- package/src/components/form/BmsMultiSelect.vue +5 -17
- package/src/components/form/BmsSearch.stories.js +2 -0
- package/src/components/form/BmsSelect.stories.js +4 -1
- package/src/components/form/BmsSelect.vue +7 -20
- package/src/components/form/BmsTag.stories.js +9 -0
- package/src/components/form/BmsTag.vue +9 -6
- package/src/components/form/BmsTextArea.stories.js +3 -2
- package/src/components/form/BmsTextArea.vue +12 -21
- package/src/components/form/RawAutocomplete.vue +5 -18
- package/src/components/form/RawInputText.vue +11 -9
- package/src/components/form/UiBmsInputCheckbox.stories.js +10 -0
- package/src/plugins/field/FieldComponent.stories.js +8 -1
- package/src/plugins/field/FieldComponent.vue +29 -15
- package/src/plugins/field/FieldDatalist.stories.js +2 -0
- package/src/plugins/field/FieldDatalist.vue +12 -2
- package/src/plugins/field/field-component.model.ts +12 -0
- 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
|
+
"version": "8.5.1",
|
|
4
4
|
"author": "Ouest-France BMS",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"scripts": {
|
|
@@ -35,54 +35,54 @@
|
|
|
35
35
|
"@commitlint/cli": "19.8.1",
|
|
36
36
|
"@commitlint/config-conventional": "19.8.1",
|
|
37
37
|
"@formkit/vue": "1.6.9",
|
|
38
|
-
"@mdx-js/react": "3.1.
|
|
39
|
-
"@storybook/addon-docs": "9.1.
|
|
40
|
-
"@storybook/addon-links": "9.1.
|
|
41
|
-
"@storybook/vue3-vite": "9.1.
|
|
38
|
+
"@mdx-js/react": "3.1.1",
|
|
39
|
+
"@storybook/addon-docs": "9.1.3",
|
|
40
|
+
"@storybook/addon-links": "9.1.3",
|
|
41
|
+
"@storybook/vue3-vite": "9.1.3",
|
|
42
42
|
"@types/lodash": "4.17.20",
|
|
43
43
|
"@types/uuid": "10.0.0",
|
|
44
44
|
"@vitejs/plugin-vue": "6.0.1",
|
|
45
45
|
"@vue/test-utils": "2.4.6",
|
|
46
|
-
"@vueuse/core": "13.
|
|
46
|
+
"@vueuse/core": "13.8.0",
|
|
47
47
|
"@vueuse/motion": "^3.0.0",
|
|
48
48
|
"axios": "1.11.0",
|
|
49
49
|
"blob-util": "^2.0.2",
|
|
50
|
-
"chromatic": "13.1.
|
|
50
|
+
"chromatic": "13.1.4",
|
|
51
51
|
"codemirror": "6.0.2",
|
|
52
52
|
"cors": "^2.8.5",
|
|
53
53
|
"cross-env": "^10.0.0",
|
|
54
54
|
"cy2": "^4.0.0",
|
|
55
|
-
"cypress": "
|
|
55
|
+
"cypress": "15.0.0",
|
|
56
56
|
"express": "^5.0.0",
|
|
57
57
|
"husky": "9.1.7",
|
|
58
58
|
"jsdom": "26.1.0",
|
|
59
59
|
"keycloak-js": "26.1.2",
|
|
60
|
-
"lint-staged": "16.1.
|
|
60
|
+
"lint-staged": "16.1.5",
|
|
61
61
|
"lodash": "4.17.21",
|
|
62
|
-
"lucide-vue-next": "0.
|
|
62
|
+
"lucide-vue-next": "0.542.0",
|
|
63
63
|
"msw-storybook-addon": "^2.0.3",
|
|
64
64
|
"normalize.css": "8.0.1",
|
|
65
65
|
"path": "0.12.7",
|
|
66
66
|
"prettier": "3.6.2",
|
|
67
|
-
"sass": "1.
|
|
67
|
+
"sass": "1.91.0",
|
|
68
68
|
"semantic-release": "24.2.7",
|
|
69
69
|
"start-server-and-test": "2.0.13",
|
|
70
|
-
"storybook": "9.1.
|
|
71
|
-
"storybook-addon-pseudo-states": "9.1.
|
|
70
|
+
"storybook": "9.1.3",
|
|
71
|
+
"storybook-addon-pseudo-states": "9.1.3",
|
|
72
72
|
"storybook-vue3-router": "^6.0.2",
|
|
73
73
|
"typescript": "5.2.2",
|
|
74
74
|
"uuid": "11.1.0",
|
|
75
|
-
"vite": "7.
|
|
75
|
+
"vite": "7.1.3",
|
|
76
76
|
"vite-plugin-dts": "^4.1.0",
|
|
77
77
|
"vite-plugin-mkcert": "1.17.8",
|
|
78
78
|
"vite-plugin-pages": "0.33.1",
|
|
79
79
|
"vite-svg-loader": "5.1.0",
|
|
80
80
|
"vitest": "3.2.4",
|
|
81
|
-
"vue": "3.5.
|
|
81
|
+
"vue": "3.5.20",
|
|
82
82
|
"vue-codemirror": "6.1.1",
|
|
83
83
|
"vue-loader": "17.4.2",
|
|
84
84
|
"vue-router": "4.5.1",
|
|
85
|
-
"vue-tsc": "3.0.
|
|
85
|
+
"vue-tsc": "3.0.6"
|
|
86
86
|
},
|
|
87
87
|
"files": [
|
|
88
88
|
"dist",
|
|
@@ -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 {
|
|
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>(), {
|
|
@@ -62,9 +49,3 @@ onMounted(() => {
|
|
|
62
49
|
}
|
|
63
50
|
});
|
|
64
51
|
</script>
|
|
65
|
-
|
|
66
|
-
<style lang="scss" scoped>
|
|
67
|
-
.field-checkbox {
|
|
68
|
-
padding: 0.5em 0;
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
@@ -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"
|
|
@@ -71,7 +63,6 @@ const inputValue = computed({
|
|
|
71
63
|
.input-checkbox-group-caption-wrapper {
|
|
72
64
|
display: flex;
|
|
73
65
|
gap: 1em;
|
|
74
|
-
margin: 0.5em 0;
|
|
75
66
|
flex-direction: row;
|
|
76
67
|
|
|
77
68
|
&.column {
|
|
@@ -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
|
|
|
@@ -84,7 +69,6 @@ const computedValues: ComputedRef<BmsInputCheckboxGroupOption[]> = computed(
|
|
|
84
69
|
.input-checkbox-group-wrapper {
|
|
85
70
|
display: flex;
|
|
86
71
|
gap: 1em;
|
|
87
|
-
margin: 0.5em 0;
|
|
88
72
|
flex-direction: row;
|
|
89
73
|
|
|
90
74
|
&.column {
|
|
@@ -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 {
|
|
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>(), {
|
|
@@ -21,7 +21,10 @@ const Template = (args) => ({
|
|
|
21
21
|
components: {
|
|
22
22
|
BmsInputFile,
|
|
23
23
|
},
|
|
24
|
-
template:
|
|
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:
|
|
231
|
-
margin:
|
|
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 {
|
|
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
|
|
|
@@ -71,7 +56,6 @@ const inputValue = computed({
|
|
|
71
56
|
.input-radio-group-caption-wrapper {
|
|
72
57
|
display: flex;
|
|
73
58
|
gap: 1em;
|
|
74
|
-
margin: 0.5em 0;
|
|
75
59
|
flex-direction: row;
|
|
76
60
|
|
|
77
61
|
&.column {
|
|
@@ -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 {
|
|
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,6 @@ const computedValues: ComputedRef<BmsInputRadioGroupOption[]> = computed(() => {
|
|
|
83
68
|
.input-radio-group-wrapper {
|
|
84
69
|
display: flex;
|
|
85
70
|
gap: 1em;
|
|
86
|
-
margin: 0.5em 0;
|
|
87
71
|
flex-direction: row;
|
|
88
72
|
|
|
89
73
|
&.column {
|
|
@@ -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>(), {
|