barbican-reset 2.43.0 → 2.44.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/BrFormCheckbox/Component.vue +2 -2
- package/components/BrFormCheckboxGroup/Component.vue +4 -3
- package/components/BrFormCheckboxGroup/Demo.vue +12 -9
- package/components/BrFormInput/Component.vue +15 -14
- package/components/BrFormPassword.vue +1 -0
- package/components/BrFormRadio/Component.vue +2 -2
- package/components/BrFormRadioGroup/Component.vue +2 -1
- package/components/BrFormRadioGroup/Demo.vue +2 -2
- package/mixins/inputs.js +13 -13
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@change="(event) => emitInputData(event, 'checkbox')"
|
|
6
6
|
:data-test="dataTest"
|
|
7
7
|
:disabled="disabled"
|
|
8
|
-
:checked="
|
|
8
|
+
:checked="checked"
|
|
9
9
|
:success="success"
|
|
10
10
|
:id="generateID"
|
|
11
11
|
type="checkbox"
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
"dataTest",
|
|
26
26
|
"disabled",
|
|
27
27
|
"success",
|
|
28
|
-
"
|
|
28
|
+
"checked",
|
|
29
29
|
"toggle",
|
|
30
30
|
"table",
|
|
31
31
|
"value",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div role="group" :id="id">
|
|
3
3
|
<br-form-checkbox
|
|
4
|
-
v-for="({ value, text }, index) in options"
|
|
4
|
+
v-for="({ value, checked, text }, index) in options"
|
|
5
5
|
@change="emitCheckboxGroupData"
|
|
6
|
+
:checked="checked"
|
|
6
7
|
:value="value"
|
|
7
|
-
:
|
|
8
|
-
:
|
|
8
|
+
:name="name"
|
|
9
|
+
:key="index">
|
|
9
10
|
{{ text }}
|
|
10
11
|
</br-form-checkbox>
|
|
11
12
|
</div>
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div style="padding: 100px">
|
|
3
3
|
<br-form-checkbox
|
|
4
4
|
@change="({ value }) => (boolean = value)"
|
|
5
5
|
data-test="checkbox-test-data"
|
|
6
6
|
id="checkbox-id"
|
|
7
7
|
:disabled="false"
|
|
8
|
+
:toggle="true"
|
|
8
9
|
:table="false"
|
|
9
10
|
:value="true"
|
|
10
|
-
success
|
|
11
|
+
success
|
|
12
|
+
>
|
|
11
13
|
Lorem ipsum dolor sit amet.
|
|
12
14
|
</br-form-checkbox>
|
|
13
15
|
<br-form-checkbox-group
|
|
@@ -17,9 +19,10 @@
|
|
|
17
19
|
name="checkbox-name"
|
|
18
20
|
id="checkbox-id"
|
|
19
21
|
:options="options"
|
|
20
|
-
:model="model"
|
|
21
|
-
|
|
22
|
-
{{
|
|
22
|
+
:model="model"
|
|
23
|
+
/>
|
|
24
|
+
{{ boolean }}
|
|
25
|
+
{{ model.length ? model : "nothing" }}
|
|
23
26
|
</div>
|
|
24
27
|
</template>
|
|
25
28
|
|
|
@@ -30,10 +33,10 @@ export default {
|
|
|
30
33
|
boolean: false,
|
|
31
34
|
model: [],
|
|
32
35
|
options: [
|
|
33
|
-
{ text:
|
|
34
|
-
{ text:
|
|
36
|
+
{ text: "Orange text", value: "orange", checked: true },
|
|
37
|
+
{ text: "Apple text", value: "apple", checked: false },
|
|
35
38
|
],
|
|
36
|
-
}
|
|
39
|
+
};
|
|
37
40
|
},
|
|
38
|
-
}
|
|
41
|
+
};
|
|
39
42
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<input
|
|
3
|
+
@input="(event) => emitInputData(event, 'input')"
|
|
3
4
|
:autocomplete="autocomplete"
|
|
4
|
-
@input="emitInputData"
|
|
5
5
|
:data-test="dataTest"
|
|
6
6
|
:required="required"
|
|
7
7
|
:disabled="disabled"
|
|
@@ -10,26 +10,27 @@
|
|
|
10
10
|
:type="type"
|
|
11
11
|
:name="name"
|
|
12
12
|
:min="min"
|
|
13
|
-
:max="max"
|
|
13
|
+
:max="max"
|
|
14
|
+
/>
|
|
14
15
|
<label v-if="$slots.default" :for="generateID" ref="label"><slot /></label>
|
|
15
16
|
</template>
|
|
16
17
|
|
|
17
18
|
<script>
|
|
18
|
-
import mixins from
|
|
19
|
+
import mixins from "../../mixins/inputs";
|
|
19
20
|
|
|
20
21
|
export default {
|
|
21
22
|
mixins: [mixins],
|
|
22
23
|
props: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
"autocomplete",
|
|
25
|
+
"dataTest",
|
|
26
|
+
"required",
|
|
27
|
+
"disabled",
|
|
28
|
+
"value",
|
|
29
|
+
"name",
|
|
30
|
+
"type",
|
|
31
|
+
"min",
|
|
32
|
+
"max",
|
|
33
|
+
"id",
|
|
33
34
|
],
|
|
34
|
-
}
|
|
35
|
+
};
|
|
35
36
|
</script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@input="(event) => emitInputData(event, 'radio')"
|
|
5
5
|
:data-test="dataTest"
|
|
6
6
|
:disabled="disabled"
|
|
7
|
-
:checked="
|
|
7
|
+
:checked="checked"
|
|
8
8
|
:id="generateID"
|
|
9
9
|
:value="value"
|
|
10
10
|
type="radio"
|
|
@@ -18,6 +18,6 @@ import mixins from '../../mixins/inputs'
|
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
20
|
mixins: [mixins],
|
|
21
|
-
props: ['id', 'name', 'value', 'disabled', '
|
|
21
|
+
props: ['id', 'name', 'value', 'disabled', 'dataTest', 'checked'],
|
|
22
22
|
}
|
|
23
23
|
</script>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div role="radiogroup" :id="id">
|
|
3
3
|
<br-form-radio
|
|
4
|
-
v-for="({ value, text }, index) in options"
|
|
4
|
+
v-for="({ value, checked, text }, index) in options"
|
|
5
5
|
@change="(event) => $emit('change', event)"
|
|
6
|
+
:checked="checked"
|
|
6
7
|
:value="value"
|
|
7
8
|
:key="index"
|
|
8
9
|
:name="name">
|
|
@@ -13,8 +13,8 @@ export default {
|
|
|
13
13
|
return {
|
|
14
14
|
contactMeSelection: true,
|
|
15
15
|
yesNoOptions: [
|
|
16
|
-
{ text: 'Yes', value: true },
|
|
17
|
-
{ text: 'No', value: false },
|
|
16
|
+
{ text: 'Yes', value: true, checked: true },
|
|
17
|
+
{ text: 'No', value: false, checked: false },
|
|
18
18
|
],
|
|
19
19
|
}
|
|
20
20
|
},
|
package/mixins/inputs.js
CHANGED
|
@@ -5,26 +5,26 @@ export default {
|
|
|
5
5
|
|
|
6
6
|
return this.id ? this.id : random;
|
|
7
7
|
},
|
|
8
|
-
isDefault() {
|
|
9
|
-
return this.default == this.value;
|
|
10
|
-
},
|
|
11
8
|
},
|
|
12
9
|
methods: {
|
|
13
|
-
emitInputData({ target }, name
|
|
10
|
+
emitInputData({ target }, name) {
|
|
14
11
|
let { value, checked } = target;
|
|
12
|
+
|
|
13
|
+
if (this.name) name = this.name;
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let content = this.name ? this.name : name;
|
|
15
|
+
if (this.toggle) value = checked;
|
|
19
16
|
|
|
20
|
-
console.log({
|
|
17
|
+
console.log({ name, value });
|
|
21
18
|
|
|
22
|
-
this.$emit("change", {
|
|
19
|
+
this.$emit("change", { name, value, checked });
|
|
23
20
|
},
|
|
24
|
-
emitCheckboxGroupData(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
emitCheckboxGroupData(option) {
|
|
22
|
+
if (option.checked) {
|
|
23
|
+
delete option.checked;
|
|
24
|
+
this.store.push(option);
|
|
25
|
+
} else this.store = this.store.filter((item) => item.name != option.name);
|
|
26
|
+
|
|
27
|
+
console.log("store: ", this.store);
|
|
28
28
|
|
|
29
29
|
this.$emit("change", this.store);
|
|
30
30
|
},
|
package/package.json
CHANGED