inertia-bootstrap-forms 1.0.106 → 1.0.107
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/choices-KiM-I_0P.js +2955 -0
- package/dist/{index-CzuJpZl2.js → index-C_I7ELMu.js} +1 -1
- package/dist/index-F5QAAKil.js +6823 -0
- package/dist/inertia-bootstrap-forms.es.js +1 -1
- package/dist/inertia-bootstrap-forms.umd.js +8 -8
- package/dist/range-slider-pips-DTDOg3Q9.js +3506 -0
- package/package.json +1 -1
- package/src/RangeSliderInput.vue +19 -26
- package/src/Select2Input.vue +13 -8
- package/dist/index-NKheQ5p3.js +0 -13277
package/package.json
CHANGED
package/src/RangeSliderInput.vue
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import {computed, defineComponent, inject} from 'vue';
|
|
3
|
-
import RangeSlider from 'svelte-range-slider-pips';
|
|
4
3
|
|
|
5
4
|
export default defineComponent({
|
|
6
5
|
emits: ['update:modelValue', 'change'],
|
|
@@ -68,31 +67,25 @@ export default defineComponent({
|
|
|
68
67
|
},
|
|
69
68
|
methods: {},
|
|
70
69
|
mounted() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
_this.$emit('change', e);
|
|
91
|
-
|
|
92
|
-
const value = _this.range ? e.detail?.values : e.detail?.value;
|
|
93
|
-
_this.modelValue = value;
|
|
94
|
-
_this.$emit('update:modelValue', value);
|
|
95
|
-
});
|
|
70
|
+
import('svelte-range-slider-pips').then(({ default: RangeSlider }) => {
|
|
71
|
+
let _this = this
|
|
72
|
+
this.rangeSliderEn = new RangeSlider({
|
|
73
|
+
target: this.$refs.rangeSliderEl,
|
|
74
|
+
props: {
|
|
75
|
+
values: this.modelValue,
|
|
76
|
+
pips: true,
|
|
77
|
+
// ... بقیه props
|
|
78
|
+
min: this.min || null,
|
|
79
|
+
max: this.max || null,
|
|
80
|
+
...this.options,
|
|
81
|
+
}
|
|
82
|
+
}).$on('change', function (e) {
|
|
83
|
+
_this.$emit('change', e)
|
|
84
|
+
const value = _this.range ? e.detail?.values : e.detail?.value
|
|
85
|
+
_this.modelValue = value
|
|
86
|
+
_this.$emit('update:modelValue', value)
|
|
87
|
+
})
|
|
88
|
+
})
|
|
96
89
|
},
|
|
97
90
|
beforeUnmount() {
|
|
98
91
|
},
|
package/src/Select2Input.vue
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import './css/from-select.scss';
|
|
3
|
-
import Choices from 'choices.js';
|
|
4
3
|
import {computed, defineComponent, inject} from "vue";
|
|
5
4
|
|
|
6
5
|
export default defineComponent({
|
|
@@ -115,11 +114,17 @@ export default defineComponent({
|
|
|
115
114
|
return (this.getKeyFromItem(item)) === this.modelValue?.toString()
|
|
116
115
|
},
|
|
117
116
|
init() {
|
|
117
|
+
if (!this.ChoicesClass) return
|
|
118
|
+
|
|
118
119
|
if (this.choices) {
|
|
119
120
|
this.destroy();
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
this.
|
|
123
|
+
if (this.locale === 'en' && document.dir === 'rtl') {
|
|
124
|
+
this.currentLocale = 'fa';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.choices = new this.ChoicesClass(this.$refs.input, {
|
|
123
128
|
searchEnabled: (this.searchEnabled || !!this.search?.url),
|
|
124
129
|
searchChoices: (this.searchEnabled && !this.search?.url),
|
|
125
130
|
removeItemButton: true,
|
|
@@ -135,7 +140,7 @@ export default defineComponent({
|
|
|
135
140
|
},
|
|
136
141
|
destroy() {
|
|
137
142
|
this.$refs.input.removeEventListener('search', this.searchHandle);
|
|
138
|
-
this.choices
|
|
143
|
+
this.choices?.destroy();
|
|
139
144
|
},
|
|
140
145
|
searchHandle(event) {
|
|
141
146
|
this.$emit('search', event)
|
|
@@ -192,17 +197,17 @@ export default defineComponent({
|
|
|
192
197
|
}
|
|
193
198
|
},
|
|
194
199
|
mounted() {
|
|
195
|
-
|
|
196
|
-
this.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
this.init()
|
|
200
|
+
import('choices.js').then(({ default: Choices }) => {
|
|
201
|
+
this.ChoicesClass = Choices
|
|
202
|
+
this.init()
|
|
203
|
+
})
|
|
200
204
|
},
|
|
201
205
|
beforeUnmount() {
|
|
202
206
|
this.destroy()
|
|
203
207
|
},
|
|
204
208
|
data() {
|
|
205
209
|
return {
|
|
210
|
+
ChoicesClass: null,
|
|
206
211
|
choices: null,
|
|
207
212
|
loading: false,
|
|
208
213
|
searchDebounceTimer: null,
|