inertia-bootstrap-forms 2.1.10 → 2.1.12

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": "inertia-bootstrap-forms",
3
- "version": "2.1.10",
3
+ "version": "2.1.12",
4
4
  "description": "Create bootstrap forms with inertia and twitter bootstrap",
5
5
  "main": "dist/inertia-bootstrap-forms.cjs.js",
6
6
  "module": "dist/inertia-bootstrap-forms.es.js",
@@ -62,7 +62,7 @@ export default defineComponent({
62
62
  })
63
63
  </script>
64
64
  <template>
65
- <label class="form-check-toggle" :class="{'form-check-toggle--active': (selectedValue || []).includes(value)}" :for="inputID">
65
+ <label class="form-check-toggle" :class="{'form-check-toggle--active': (selectedValue || []).includes(value), 'is-invalid': form?.errors[name]}" :for="inputID">
66
66
  <input
67
67
  :name="name + (group ? '_' + group?.name + '-'+group?.groupID : '')"
68
68
  :id="inputID"
@@ -98,6 +98,10 @@ export default defineComponent({
98
98
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
99
99
  }
100
100
 
101
+ .form-check-toggle.is-invalid {
102
+ border-color: var(--bs-form-invalid-border-color);
103
+ }
104
+
101
105
  .form-check-toggle.form-check-toggle--active,
102
106
  .form-check-toggle:has(input:checked){
103
107
  background-color: var(--bs-warning-bg-subtle, #ffda6a);
@@ -110,4 +114,8 @@ export default defineComponent({
110
114
  top: 0;
111
115
  right: 0;
112
116
  }
117
+
118
+ .form-check-toggle .form-check-input {
119
+ margin-right: 5px;
120
+ }
113
121
  </style>
package/src/OTPInput.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import {computed, inject, defineComponent, defineEmits, watch} from "vue";
2
+ import {computed, inject, defineComponent} from "vue";
3
3
 
4
4
  export default defineComponent({
5
5
  props: {
@@ -30,8 +30,6 @@ export default defineComponent({
30
30
 
31
31
  },
32
32
  setup(props) {
33
- const emits = defineEmits(['completed'])
34
-
35
33
  let form = inject('form', {
36
34
  errors: {},
37
35
  getID(name) {
@@ -53,12 +51,6 @@ export default defineComponent({
53
51
  }
54
52
  });
55
53
 
56
- watch(modelValue, (value) => {
57
- if (value && value.length >= props.maxLength) {
58
- emits('completed', value)
59
- }
60
- });
61
-
62
54
  return {modelValue, form, group};
63
55
  },
64
56
  })