@ouestfrance/sipa-bms-ui 8.14.2 → 8.14.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouestfrance/sipa-bms-ui",
3
- "version": "8.14.2",
3
+ "version": "8.14.3",
4
4
  "author": "Ouest-France BMS",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -40,6 +40,18 @@ Default.args = {
40
40
  modelValue: '',
41
41
  };
42
42
 
43
+ export const Disabled = Template.bind({});
44
+ Disabled.args = {
45
+ label: 'My autocomplete field',
46
+ options: [
47
+ { label: 'titi', value: 'i' },
48
+ { label: 'toto', value: 'o' },
49
+ { label: 'tutu', value: 'u' },
50
+ ],
51
+ modelValue: 'u',
52
+ disabled: true,
53
+ };
54
+
43
55
  export const Loading = Template.bind({});
44
56
  Loading.args = {
45
57
  label: 'My autocomplete field',
@@ -36,10 +36,18 @@ Default.args = {
36
36
 
37
37
  export const WithValue = Template.bind({});
38
38
  WithValue.args = {
39
- modelValue: 'Une valeur',
40
39
  label: 'Label',
41
40
  type: 'html',
42
41
  modelValue: `
43
42
  <div></div>
44
43
  <div></div>`,
45
44
  };
45
+ export const Disabled = Template.bind({});
46
+ Disabled.args = {
47
+ label: 'Label',
48
+ type: 'html',
49
+ disabled: true,
50
+ modelValue: `
51
+ <div></div>
52
+ <div></div>`,
53
+ };
@@ -3,6 +3,7 @@
3
3
  <div class="code-mirror">
4
4
  <Codemirror
5
5
  v-model="input"
6
+ :disabled="disabled"
6
7
  :autofocus="true"
7
8
  :indent-with-tab="true"
8
9
  :tab-size="4"
@@ -204,6 +204,7 @@ watch(
204
204
  --drop-color: var(--bms-grey-25);
205
205
  --drop-border: 1px solid var(--bms-grey-25);
206
206
  color: var(--bms-grey-75);
207
+ pointer-events: none;
207
208
  }
208
209
  .is-error {
209
210
  --drop-color: var(--bms-red-25);
@@ -34,7 +34,7 @@ Default.args = {
34
34
  captions: ['Helping text'],
35
35
  modelValue: '',
36
36
  options: [
37
- { label: 'a', value: 'a' },
37
+ { label: 'azerty', value: 'a' },
38
38
  { label: 'b', value: 'b' },
39
39
  ],
40
40
  };
@@ -75,7 +75,7 @@ Disabled.args = {
75
75
  label: 'My label',
76
76
  modelValue: 'a',
77
77
  options: [
78
- { label: 'a', value: 'a' },
78
+ { label: 'azerty', value: 'a' },
79
79
  { label: 'b', value: 'b' },
80
80
  ],
81
81
  disabled: true,
@@ -14,6 +14,7 @@
14
14
  :value="displayValue"
15
15
  :placeholder="placeholder"
16
16
  :required="required"
17
+ :disabled="disabled"
17
18
  @focus="openDatalist"
18
19
  @click="openDatalist"
19
20
  @keyup.down="openDatalist"
@@ -134,7 +135,6 @@ defineExpose({
134
135
  padding: 0;
135
136
  font: inherit;
136
137
  color: inherit;
137
- height: 24px;
138
138
  line-height: 1;
139
139
  width: 100%;
140
140
  height: 100%;
@@ -43,7 +43,8 @@ WithValue.args = {
43
43
  export const Disabled = Template.bind({});
44
44
  Disabled.args = {
45
45
  label: 'My label',
46
- modelValue: 'Une valeur',
46
+ modelValue:
47
+ 'At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.',
47
48
  disabled: true,
48
49
  };
49
50
 
@@ -94,6 +94,7 @@ defineExpose({
94
94
  &.is-disabled {
95
95
  --field-border-color: var(--bms-grey-25);
96
96
  --textarea-background-color: var(--bms-grey-25);
97
+ cursor: text;
97
98
  }
98
99
  &.is-small {
99
100
  min-height: 56px;
@@ -166,10 +166,12 @@ const setFocus = () => {
166
166
  };
167
167
 
168
168
  const clearInput = () => {
169
- inputText.value = '';
170
- modelValue.value = null;
171
- setFocus();
172
- closeDatalist();
169
+ if (!props.disabled) {
170
+ inputText.value = '';
171
+ modelValue.value = null;
172
+ setFocus();
173
+ closeDatalist();
174
+ }
173
175
  };
174
176
 
175
177
  defineExpose({
@@ -117,9 +117,8 @@ const classes = computed(() => {
117
117
  &.is-disabled {
118
118
  --field-border-color: var(--bms-grey-25);
119
119
  --input-background-color: var(--bms-grey-25);
120
-
121
120
  input {
122
- pointer-events: none;
121
+ cursor: text;
123
122
  }
124
123
  }
125
124