vueless 0.0.101 → 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 +1 -1
- package/ui.container-modal-confirm/index.vue +2 -1
- package/ui.data-list/index.vue +2 -1
- package/ui.data-table/index.vue +2 -1
- package/ui.dropdown-list/index.vue +2 -1
- package/ui.form-calendar/index.vue +10 -7
- package/ui.form-date-picker/index.vue +5 -4
- package/ui.form-date-picker-range/index.vue +11 -7
- package/ui.form-input-file/composables/attrs.composable.js +6 -6
- package/ui.form-input-file/configs/default.config.js +7 -7
- package/ui.form-input-file/index.vue +15 -11
- package/ui.form-select/index.vue +2 -1
- package/ui.form-switch/index.vue +2 -1
- package/ui.notify/index.vue +2 -1
- package/web-types.json +2 -2
package/package.json
CHANGED
|
@@ -169,7 +169,8 @@ const isShownModal = computed({
|
|
|
169
169
|
set: (value) => emit("update:modelValue", value),
|
|
170
170
|
});
|
|
171
171
|
|
|
172
|
-
const
|
|
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;
|
package/ui.data-list/index.vue
CHANGED
|
@@ -218,7 +218,8 @@ const {
|
|
|
218
218
|
} = useAttrs(props);
|
|
219
219
|
const { tm } = useLocale();
|
|
220
220
|
|
|
221
|
-
const
|
|
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;
|
package/ui.data-table/index.vue
CHANGED
|
@@ -427,7 +427,8 @@ const isFooterSticky = computed(
|
|
|
427
427
|
isCheckedMoreOneTableItems.value,
|
|
428
428
|
);
|
|
429
429
|
|
|
430
|
-
const
|
|
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
|
|
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
|
|
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 =
|
|
374
|
-
|
|
375
|
-
|
|
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 =
|
|
378
|
-
|
|
379
|
-
|
|
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
|
|
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(
|
|
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 =
|
|
459
|
-
|
|
460
|
-
|
|
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 =
|
|
463
|
-
|
|
464
|
-
|
|
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 {
|
|
@@ -45,9 +45,9 @@ export function useAttrs(props) {
|
|
|
45
45
|
classes: placeholderClasses,
|
|
46
46
|
isComponent: true,
|
|
47
47
|
});
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
48
|
+
const placeholderIconAttrs = getAttrs("placeholderIcon", { isComponent: true });
|
|
49
|
+
const clearIconAttrs = getAttrs("clearIcon", { isComponent: true });
|
|
50
|
+
const chooseFileIconNameAttrs = getAttrs("chooseFileIconName", { isComponent: true });
|
|
51
51
|
const inputAttrs = getAttrs("input");
|
|
52
52
|
|
|
53
53
|
return {
|
|
@@ -59,9 +59,9 @@ export function useAttrs(props) {
|
|
|
59
59
|
descriptionAttrs,
|
|
60
60
|
buttonWrapperAttrs,
|
|
61
61
|
placeholderWrapperAttrs,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
placeholderIconAttrs,
|
|
63
|
+
clearIconAttrs,
|
|
64
|
+
chooseFileIconNameAttrs,
|
|
65
65
|
placeholderAttrs,
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -38,13 +38,13 @@ export default /*tw*/ {
|
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
|
-
iconPlaceholderName: "attach_file",
|
|
42
|
-
iconPlaceholder: "-rotate-45",
|
|
43
41
|
button: "hover:cursor-pointer",
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
placeholderIcon: "-rotate-45",
|
|
43
|
+
placeholderIconName: "attach_file",
|
|
44
|
+
chooseFileIcon: "",
|
|
45
|
+
chooseFileIconName: "upload_file",
|
|
46
|
+
clearIcon: "",
|
|
47
|
+
clearIconName: "close",
|
|
48
48
|
dropzoneWrapperHover: "border-gray-400 bg-gray-50",
|
|
49
49
|
dropzoneWrapperError: "hover:border-red-400 border-red-300",
|
|
50
50
|
input: "sr-only pointer-events-none size-0 opacity-0",
|
|
@@ -57,7 +57,7 @@ export default /*tw*/ {
|
|
|
57
57
|
defaultVariants: {
|
|
58
58
|
size: "md",
|
|
59
59
|
labelAlign: "topInside",
|
|
60
|
-
allowedFileTypes: [
|
|
60
|
+
allowedFileTypes: [],
|
|
61
61
|
maxFileSize: 100,
|
|
62
62
|
},
|
|
63
63
|
};
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
pill
|
|
10
10
|
internal
|
|
11
11
|
:size="nestedComponentSize"
|
|
12
|
-
:name="config.
|
|
13
|
-
v-bind="
|
|
12
|
+
:name="config.placeholderIconName"
|
|
13
|
+
v-bind="placeholderIconAttrs"
|
|
14
14
|
/>
|
|
15
15
|
<span v-bind="placeholderAttrs" v-text="placeholder" />
|
|
16
16
|
</div>
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
<UIcon
|
|
31
31
|
internal
|
|
32
32
|
:size="nestedComponentSize"
|
|
33
|
-
:name="config.
|
|
34
|
-
v-bind="
|
|
33
|
+
:name="config.chooseFileIconName"
|
|
34
|
+
v-bind="chooseFileIconAttrs"
|
|
35
35
|
/>
|
|
36
36
|
</template>
|
|
37
37
|
</UButton>
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
interactive
|
|
51
51
|
internal
|
|
52
52
|
:size="nestedComponentSize"
|
|
53
|
-
:name="config.
|
|
53
|
+
:name="config.clearIconName"
|
|
54
54
|
pill
|
|
55
|
-
v-bind="
|
|
55
|
+
v-bind="clearIconAttrs"
|
|
56
56
|
@click="onClickResetFiles"
|
|
57
57
|
/>
|
|
58
58
|
</div>
|
|
@@ -177,14 +177,15 @@ const {
|
|
|
177
177
|
descriptionAttrs,
|
|
178
178
|
buttonWrapperAttrs,
|
|
179
179
|
placeholderWrapperAttrs,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
placeholderIconAttrs,
|
|
181
|
+
clearIconAttrs,
|
|
182
|
+
chooseFileIconAttrs,
|
|
183
183
|
placeholderAttrs,
|
|
184
184
|
inputAttrs,
|
|
185
185
|
} = useAttrs(props);
|
|
186
186
|
|
|
187
|
-
const
|
|
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,
|
|
@@ -231,7 +232,10 @@ onBeforeUnmount(() => {
|
|
|
231
232
|
function validate(file) {
|
|
232
233
|
const targetFileSize = getFileMbSize(file);
|
|
233
234
|
|
|
234
|
-
const isValidType = extensionNames.value.
|
|
235
|
+
const isValidType = extensionNames.value.length
|
|
236
|
+
? extensionNames.value.some((item) => file.type.includes(item))
|
|
237
|
+
: true;
|
|
238
|
+
|
|
235
239
|
const isValidSize = targetFileSize <= props.maxFileSize;
|
|
236
240
|
|
|
237
241
|
if (!isValidSize) {
|
package/ui.form-select/index.vue
CHANGED
|
@@ -500,7 +500,8 @@ const {
|
|
|
500
500
|
dropdownListAttrs,
|
|
501
501
|
} = useAttrs(props, { isTop, isOpen, selectedLabel });
|
|
502
502
|
|
|
503
|
-
const
|
|
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;
|
package/ui.form-switch/index.vue
CHANGED
|
@@ -158,7 +158,8 @@ const emit = defineEmits(["update:modelValue"]);
|
|
|
158
158
|
|
|
159
159
|
const { tm } = useLocale();
|
|
160
160
|
|
|
161
|
-
const
|
|
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,
|
package/ui.notify/index.vue
CHANGED
|
@@ -142,7 +142,8 @@ const notifyPositionStyles = ref({});
|
|
|
142
142
|
|
|
143
143
|
const notificationsWrapperRef = ref(null);
|
|
144
144
|
|
|
145
|
-
const
|
|
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.
|
|
4
|
+
"version": "0.0.103",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -3492,7 +3492,7 @@
|
|
|
3492
3492
|
"kind": "expression",
|
|
3493
3493
|
"type": "array"
|
|
3494
3494
|
},
|
|
3495
|
-
"default": "
|
|
3495
|
+
"default": ""
|
|
3496
3496
|
},
|
|
3497
3497
|
{
|
|
3498
3498
|
"name": "size",
|