js-kompo-utils 1.0.41 → 1.0.43
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.
|
@@ -52,9 +52,10 @@
|
|
|
52
52
|
|
|
53
53
|
<script>
|
|
54
54
|
import Field from 'vue-kompo/js/form/mixins/Field'
|
|
55
|
+
import UsesKompoLocale from './mixins/UsesKompoLocale.js'
|
|
55
56
|
|
|
56
57
|
export default {
|
|
57
|
-
mixins: [Field],
|
|
58
|
+
mixins: [Field, UsesKompoLocale],
|
|
58
59
|
data() {
|
|
59
60
|
return {
|
|
60
61
|
firstValue: '',
|
|
@@ -70,7 +71,6 @@ export default {
|
|
|
70
71
|
computed: {
|
|
71
72
|
$_mode() { return this.$_config('mode') || 'day-month' },
|
|
72
73
|
$_separator() { return this.$_config('separator') || '-' },
|
|
73
|
-
$_locale() { return this.$_config('kompo_locale') || 'en' },
|
|
74
74
|
$_yearStart() { return this.$_config('yearStart') || new Date().getFullYear() - 10 },
|
|
75
75
|
$_yearEnd() { return this.$_config('yearEnd') || new Date().getFullYear() + 10 },
|
|
76
76
|
|
|
@@ -266,11 +266,13 @@ export default {
|
|
|
266
266
|
|
|
267
267
|
.vlDateMonthDay-select-wrapper {
|
|
268
268
|
position: relative;
|
|
269
|
-
flex: 1;
|
|
269
|
+
flex: 1 1 auto;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
/* Sized by its longest option, then stretched to the room left: a month name is never clipped. */
|
|
272
273
|
.vlDateMonthDay-select {
|
|
273
|
-
width:
|
|
274
|
+
width: auto;
|
|
275
|
+
min-width: 100%;
|
|
274
276
|
appearance: none;
|
|
275
277
|
-webkit-appearance: none;
|
|
276
278
|
background-color: transparent;
|
|
@@ -18,15 +18,16 @@
|
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
20
|
import Field from 'vue-kompo/js/form/mixins/Field'
|
|
21
|
+
import UsesKompoLocale from './mixins/UsesKompoLocale.js'
|
|
21
22
|
|
|
22
|
-
import flatPickr from 'vue-flatpickr-component';
|
|
23
|
+
import flatPickr from 'vue-flatpickr-component';
|
|
23
24
|
import 'flatpickr/dist/flatpickr.css';
|
|
24
25
|
import 'flatpickr/dist/themes/airbnb.css';
|
|
25
26
|
|
|
26
27
|
import { French } from "flatpickr/dist/l10n/fr.js"
|
|
27
28
|
|
|
28
29
|
export default {
|
|
29
|
-
mixins: [Field],
|
|
30
|
+
mixins: [Field, UsesKompoLocale],
|
|
30
31
|
components: { flatPickr },
|
|
31
32
|
data() {
|
|
32
33
|
return {
|
|
@@ -46,7 +47,6 @@ export default {
|
|
|
46
47
|
computed: {
|
|
47
48
|
$_mode() { return this.$_config('mode') || 'day-month' },
|
|
48
49
|
$_separator() { return this.$_config('separator') || '-' },
|
|
49
|
-
$_locale() { return this.$_config('kompo_locale') },
|
|
50
50
|
$_placeholder() { return this.$_config('placeholder') || this.defaultPlaceholder },
|
|
51
51
|
$_yearStart() { return this.$_config('yearStart') || new Date().getFullYear() - 10 },
|
|
52
52
|
$_yearEnd() { return this.$_config('yearEnd') || new Date().getFullYear() + 10 },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Locale for month names, calendars, editors: the element's kompo_locale config (Kompo's passLocale()),
|
|
2
|
+
// else the page language, else English.
|
|
3
|
+
export default {
|
|
4
|
+
computed: {
|
|
5
|
+
$_locale() {
|
|
6
|
+
return this.$_config('kompo_locale') || (document.documentElement.lang || '').slice(0, 2) || 'en';
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
};
|