vueless 0.0.102 → 0.0.103

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.102",
3
+ "version": "0.0.103",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -169,7 +169,8 @@ const isShownModal = computed({
169
169
  set: (value) => emit("update:modelValue", value),
170
170
  });
171
171
 
172
- const currentLocale = computed(() => merge(tm("UModalConfirm"), props.config.i18n));
172
+ const i18nGlobal = tm(UModalConfirm);
173
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
173
174
 
174
175
  function closeModal() {
175
176
  isShownModal.value = false;
@@ -218,7 +218,8 @@ const {
218
218
  } = useAttrs(props);
219
219
  const { tm } = useLocale();
220
220
 
221
- const currentLocale = computed(() => merge(tm("UDataList"), props.config.i18n));
221
+ const i18nGlobal = tm(UDataListName);
222
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
222
223
 
223
224
  function onDragMove(event) {
224
225
  const isDisabledNestingItem = event.draggedContext.element.isDisabledNesting;
@@ -427,7 +427,8 @@ const isFooterSticky = computed(
427
427
  isCheckedMoreOneTableItems.value,
428
428
  );
429
429
 
430
- const currentLocale = computed(() => merge(tm("UTable"), props.config.i18n));
430
+ const i18nGlobal = tm(UTable);
431
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
431
432
 
432
433
  const normalizedColumns = computed(() => TableService.normalizeColumns(props.columns));
433
434
 
@@ -242,7 +242,8 @@ const { tm } = useLocale();
242
242
 
243
243
  defineExpose({ pointerSet, pointerBackward, pointerForward, pointerReset, addPointerElement });
244
244
 
245
- const currentLocale = computed(() => merge(tm("UDropdownList"), props.config.i18n));
245
+ const i18nGlobal = tm(UDropdownList);
246
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
246
247
 
247
248
  const addOptionKeyCombination = computed(() => {
248
249
  return isMac ? "(⌘ + Enter)" : "(Ctrl + Enter)";
@@ -348,7 +348,8 @@ const isCurrentView = computed(() => ({
348
348
  year: currentView.value === VIEW.year,
349
349
  }));
350
350
 
351
- const currentLocale = computed(() => merge(tm("UCalendar"), props.config.i18n));
351
+ const i18nGlobal = tm(UCalendar);
352
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
352
353
 
353
354
  const locale = computed(() => {
354
355
  const { months, weekdays } = currentLocale.value;
@@ -370,13 +371,15 @@ const locale = computed(() => {
370
371
  const userFormatLocale = computed(() => {
371
372
  const { months, weekdays } = currentLocale.value;
372
373
 
373
- const monthsLonghand = props.config.i18n?.months?.userFormat
374
- ? months.userFormat
375
- : months.longhand;
374
+ const monthsLonghand =
375
+ Boolean(props.config.i18n?.months?.userFormat) || Boolean(i18nGlobal?.months?.userFormat)
376
+ ? months.userFormat
377
+ : months.longhand;
376
378
 
377
- const weekdaysLonghand = props.config.i18n?.weekdays?.userFormat
378
- ? weekdays.userFormat
379
- : weekdays.longhand;
379
+ const weekdaysLonghand =
380
+ Boolean(props.config.i18n?.weekdays?.userFormat) || Boolean(i18nGlobal?.weekdays?.userFormat)
381
+ ? weekdays.userFormat
382
+ : weekdays.longhand;
380
383
 
381
384
  // formatted locale
382
385
  return {
@@ -259,7 +259,8 @@ function onBlur(event) {
259
259
  function formatUserDate(data) {
260
260
  if (props.dateFormat !== STANDARD_USER_FORMAT) return data;
261
261
 
262
- const currentLocale = merge(tm("UDatePicker"), props.config.i18n);
262
+ const i18nGlobal = tm(UDatePicker);
263
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
263
264
 
264
265
  let prefix = "";
265
266
  const formattedDate = data.charAt(0).toUpperCase() + data.toLowerCase().slice(1);
@@ -273,15 +274,15 @@ function formatUserDate(data) {
273
274
  const isTomorrow = isSameDay(addDays(today, 1), selectedDate);
274
275
 
275
276
  if (isToday) {
276
- prefix = currentLocale.today;
277
+ prefix = currentLocale.value.today;
277
278
  }
278
279
 
279
280
  if (isYesterday) {
280
- prefix = currentLocale.yesterday;
281
+ prefix = currentLocale.value.yesterday;
281
282
  }
282
283
 
283
284
  if (isTomorrow) {
284
- prefix = currentLocale.tomorrow;
285
+ prefix = currentLocale.value.tomorrow;
285
286
  }
286
287
 
287
288
  return prefix ? `${prefix}, ${formattedDateWithoutDay}` : formattedDate;
@@ -432,8 +432,10 @@ const localValue = computed({
432
432
  });
433
433
 
434
434
  const { isMobileBreakpoint } = useBreakpoint();
435
+ const i18nGlobal = tm(UDatePickerRange);
436
+
435
437
  const rangeInputName = computed(() => `rangeInput-${props.id}`);
436
- const currentLocale = computed(() => merge(tm("UDatePickerRange"), props.config.i18n));
438
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
437
439
 
438
440
  const locale = computed(() => {
439
441
  const { months, weekdays } = currentLocale.value;
@@ -455,13 +457,15 @@ const locale = computed(() => {
455
457
  const userFormatLocale = computed(() => {
456
458
  const { months, weekdays } = currentLocale.value;
457
459
 
458
- const monthsLonghand = props.config.i18n?.months?.userFormat
459
- ? months.userFormat
460
- : months.longhand;
460
+ const monthsLonghand =
461
+ Boolean(props.config.i18n?.months?.userFormat) || Boolean(i18nGlobal?.months?.userFormat)
462
+ ? months.userFormat
463
+ : months.longhand;
461
464
 
462
- const weekdaysLonghand = props.config.i18n?.weekdays?.userFormat
463
- ? weekdays.userFormat
464
- : weekdays.longhand;
465
+ const weekdaysLonghand =
466
+ Boolean(props.config.i18n?.weekdays?.userFormat) || Boolean(i18nGlobal?.weekdays?.userFormat)
467
+ ? weekdays.userFormat
468
+ : weekdays.longhand;
465
469
 
466
470
  // formatted locale
467
471
  return {
@@ -184,7 +184,8 @@ const {
184
184
  inputAttrs,
185
185
  } = useAttrs(props);
186
186
 
187
- const currentLocale = computed(() => merge(tm("UInputFile"), props.config.i18n));
187
+ const i18nGlobal = tm(UInputFile);
188
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
188
189
 
189
190
  const currentFiles = computed({
190
191
  get: () => props.modelValue,
@@ -500,7 +500,8 @@ const {
500
500
  dropdownListAttrs,
501
501
  } = useAttrs(props, { isTop, isOpen, selectedLabel });
502
502
 
503
- const currentLocale = computed(() => merge(tm("USelect"), props.config.i18n));
503
+ const i18nGlobal = tm(USelect);
504
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
504
505
 
505
506
  const inputPlaceholder = computed(() => {
506
507
  const message = currentLocale.value.addMore;
@@ -158,7 +158,8 @@ const emit = defineEmits(["update:modelValue"]);
158
158
 
159
159
  const { tm } = useLocale();
160
160
 
161
- const currentLocale = computed(() => merge(tm("USwitch"), props.config.i18n));
161
+ const i18nGlobal = tm(USwitch);
162
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
162
163
 
163
164
  const checkedValue = computed({
164
165
  get: () => props.modelValue,
@@ -142,7 +142,8 @@ const notifyPositionStyles = ref({});
142
142
 
143
143
  const notificationsWrapperRef = ref(null);
144
144
 
145
- const currentLocale = computed(() => merge(tm("UNotify"), props.config.i18n));
145
+ const i18nGlobal = tm(UNotify);
146
+ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
146
147
 
147
148
  onMounted(() => {
148
149
  window.addEventListener("resize", setPosition, { passive: true });
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.102",
4
+ "version": "0.0.103",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",