vueless 0.0.46 → 0.0.48

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": "vueless",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -148,6 +148,7 @@
148
148
 
149
149
  <script setup>
150
150
  import { computed, onMounted, ref, watch } from "vue";
151
+ import { merge } from "lodash-es";
151
152
 
152
153
  import UIcon from "../ui.image-icon";
153
154
  import UButton from "../ui.button";
@@ -344,40 +345,40 @@ const isCurrentView = computed(() => ({
344
345
  year: currentView.value === VIEW.year,
345
346
  }));
346
347
 
348
+ const currentLocale = computed(() => merge(props.config.i18n, tm("UCalendar")));
349
+
347
350
  const locale = computed(() => {
348
- const currentLocale = props.config.i18n || tm("UCalendar");
351
+ const { months, weekdays } = currentLocale.value;
349
352
 
350
- const formattedLocale = {
351
- ...currentLocale,
353
+ // formatted locale
354
+ return {
355
+ ...currentLocale.value,
352
356
  months: {
353
- shorthand: getSortedLocale(currentLocale.months.shorthand, LOCALE_TYPE.month),
354
- longhand: getSortedLocale(currentLocale.months.longhand, LOCALE_TYPE.month),
357
+ shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
358
+ longhand: getSortedLocale(months.longhand, LOCALE_TYPE.month),
355
359
  },
356
360
  weekdays: {
357
- shorthand: getSortedLocale(currentLocale.weekdays.shorthand, LOCALE_TYPE.day),
358
- longhand: getSortedLocale(currentLocale.weekdays.longhand, LOCALE_TYPE.day),
361
+ shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
362
+ longhand: getSortedLocale(weekdays.longhand, LOCALE_TYPE.day),
359
363
  },
360
364
  };
361
-
362
- return formattedLocale;
363
365
  });
364
366
 
365
367
  const userFormatLocale = computed(() => {
366
- const currentLocale = props.config.i18n || tm("UCalendar");
368
+ const { months, weekdays } = currentLocale.value;
367
369
 
368
- const formattedLocale = {
370
+ // formatted locale
371
+ return {
369
372
  ...currentLocale,
370
373
  months: {
371
- shorthand: getSortedLocale(currentLocale.months.shorthand, LOCALE_TYPE.month),
372
- longhand: getSortedLocale(currentLocale.months.userFormat, LOCALE_TYPE.month),
374
+ shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
375
+ longhand: getSortedLocale(months.userFormat || months.longhand, LOCALE_TYPE.month),
373
376
  },
374
377
  weekdays: {
375
- shorthand: getSortedLocale(currentLocale.weekdays.shorthand, LOCALE_TYPE.day),
376
- longhand: getSortedLocale(currentLocale.weekdays.userFormat, LOCALE_TYPE.day),
378
+ shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
379
+ longhand: getSortedLocale(weekdays.userFormat || weekdays.longhand, LOCALE_TYPE.day),
377
380
  },
378
381
  };
379
-
380
- return formattedLocale;
381
382
  });
382
383
 
383
384
  const isTimepickerEnabled = computed(() => {
@@ -180,6 +180,7 @@
180
180
  <script setup>
181
181
  import { computed, watch, ref, nextTick } from "vue";
182
182
  import { useStore } from "vuex";
183
+ import { merge } from "lodash-es";
183
184
 
184
185
  import UIcon from "../ui.image-icon";
185
186
  import UInput from "../ui.form-input";
@@ -413,42 +414,41 @@ const localValue = computed({
413
414
  });
414
415
 
415
416
  const isMobileDevice = computed(() => store.getters["breakpoint/isMobileDevice"]);
416
-
417
417
  const rangeInputName = computed(() => `rangeInput-${props.id}`);
418
+ const currentLocale = computed(() => merge(props.config.i18n, tm("UDatePickerRange")));
418
419
 
419
420
  const locale = computed(() => {
420
- const currentLocale = props.config.i18n || tm("UDatePickerRange");
421
- const formattedLocale = {
422
- ...currentLocale,
421
+ const { months, weekdays } = currentLocale.value;
422
+
423
+ // formatted locale
424
+ return {
425
+ ...currentLocale.value,
423
426
  months: {
424
- shorthand: getSortedLocale(currentLocale.months.shorthand, LOCALE_TYPE.month),
425
- longhand: getSortedLocale(currentLocale.months.longhand, LOCALE_TYPE.month),
427
+ shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
428
+ longhand: getSortedLocale(months.longhand, LOCALE_TYPE.month),
426
429
  },
427
430
  weekdays: {
428
- shorthand: getSortedLocale(currentLocale.weekdays.shorthand, LOCALE_TYPE.day),
429
- longhand: getSortedLocale(currentLocale.weekdays.longhand, LOCALE_TYPE.day),
431
+ shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
432
+ longhand: getSortedLocale(weekdays.longhand, LOCALE_TYPE.day),
430
433
  },
431
434
  };
432
-
433
- return formattedLocale;
434
435
  });
435
436
 
436
437
  const userFormatLocale = computed(() => {
437
- const currentLocale = props.config.i18n || tm("UDatePickerRange");
438
+ const { months, weekdays } = currentLocale.value;
438
439
 
439
- const formattedLocale = {
440
+ // formatted locale
441
+ return {
440
442
  ...currentLocale,
441
443
  months: {
442
- shorthand: getSortedLocale(currentLocale.months.shorthand, LOCALE_TYPE.month),
443
- longhand: getSortedLocale(currentLocale.months.userFormat, LOCALE_TYPE.month),
444
+ shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
445
+ longhand: getSortedLocale(months.userFormat || months.longhand, LOCALE_TYPE.month),
444
446
  },
445
447
  weekdays: {
446
- shorthand: getSortedLocale(currentLocale.weekdays.shorthand, LOCALE_TYPE.day),
447
- longhand: getSortedLocale(currentLocale.weekdays.userFormat, LOCALE_TYPE.day),
448
+ shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
449
+ longhand: getSortedLocale(weekdays.userFormat || weekdays.longhand, LOCALE_TYPE.day),
448
450
  },
449
451
  };
450
-
451
- return formattedLocale;
452
452
  });
453
453
 
454
454
  const periods = computed(() => [
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.46",
4
+ "version": "0.0.48",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",