vueless 0.0.47 → 0.0.49

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.47",
3
+ "version": "0.0.49",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -345,7 +345,7 @@ const isCurrentView = computed(() => ({
345
345
  year: currentView.value === VIEW.year,
346
346
  }));
347
347
 
348
- const currentLocale = computed(() => merge(props.config.i18n, tm("UCalendar")));
348
+ const currentLocale = computed(() => merge(tm("UCalendar"), props.config.i18n));
349
349
 
350
350
  const locale = computed(() => {
351
351
  const { months, weekdays } = currentLocale.value;
@@ -367,16 +367,24 @@ const locale = computed(() => {
367
367
  const userFormatLocale = computed(() => {
368
368
  const { months, weekdays } = currentLocale.value;
369
369
 
370
+ const monthsLonghand = props.config.i18n?.months?.userFormat
371
+ ? months.userFormat
372
+ : months.longhand;
373
+
374
+ const weekdaysLonghand = props.config.i18n?.weekdays?.userFormat
375
+ ? weekdays.userFormat
376
+ : weekdays.longhand;
377
+
370
378
  // formatted locale
371
379
  return {
372
380
  ...currentLocale,
373
381
  months: {
374
382
  shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
375
- longhand: getSortedLocale(months.userFormat || months.longhand, LOCALE_TYPE.month),
383
+ longhand: getSortedLocale(monthsLonghand, LOCALE_TYPE.month),
376
384
  },
377
385
  weekdays: {
378
386
  shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
379
- longhand: getSortedLocale(weekdays.userFormat || weekdays.longhand, LOCALE_TYPE.day),
387
+ longhand: getSortedLocale(weekdaysLonghand, LOCALE_TYPE.day),
380
388
  },
381
389
  };
382
390
  });
@@ -53,6 +53,7 @@
53
53
 
54
54
  <script setup>
55
55
  import { computed, nextTick, ref } from "vue";
56
+ import { merge } from "lodash-es";
56
57
 
57
58
  import UInput from "../ui.form-input";
58
59
  import UCalendar from "../ui.form-calendar";
@@ -258,7 +259,7 @@ function onBlur(event) {
258
259
  function formatUserDate(data) {
259
260
  if (props.dateFormat !== STANDARD_USER_FORMAT) return data;
260
261
 
261
- const currentLocale = props.config.i18n || tm("UDatePicker");
262
+ const currentLocale = merge(tm("UDatePicker"), props.config.i18n);
262
263
 
263
264
  let prefix = "";
264
265
  const formattedDate = data.charAt(0).toUpperCase() + data.toLowerCase().slice(1);
@@ -415,7 +415,7 @@ const localValue = computed({
415
415
 
416
416
  const isMobileDevice = computed(() => store.getters["breakpoint/isMobileDevice"]);
417
417
  const rangeInputName = computed(() => `rangeInput-${props.id}`);
418
- const currentLocale = computed(() => merge(props.config.i18n, tm("UDatePickerRange")));
418
+ const currentLocale = computed(() => merge(tm("UDatePickerRange"), props.config.i18n));
419
419
 
420
420
  const locale = computed(() => {
421
421
  const { months, weekdays } = currentLocale.value;
@@ -437,16 +437,24 @@ const locale = computed(() => {
437
437
  const userFormatLocale = computed(() => {
438
438
  const { months, weekdays } = currentLocale.value;
439
439
 
440
+ const monthsLonghand = props.config.i18n?.months?.userFormat
441
+ ? months.userFormat
442
+ : months.longhand;
443
+
444
+ const weekdaysLonghand = props.config.i18n?.weekdays?.userFormat
445
+ ? weekdays.userFormat
446
+ : weekdays.longhand;
447
+
440
448
  // formatted locale
441
449
  return {
442
450
  ...currentLocale,
443
451
  months: {
444
452
  shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
445
- longhand: getSortedLocale(months.userFormat || months.longhand, LOCALE_TYPE.month),
453
+ longhand: getSortedLocale(monthsLonghand, LOCALE_TYPE.month),
446
454
  },
447
455
  weekdays: {
448
456
  shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
449
- longhand: getSortedLocale(weekdays.userFormat || weekdays.longhand, LOCALE_TYPE.day),
457
+ longhand: getSortedLocale(weekdaysLonghand, LOCALE_TYPE.day),
450
458
  },
451
459
  };
452
460
  });
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.47",
4
+ "version": "0.0.49",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",