vueless 0.0.585 → 0.0.586
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/types.ts +8 -16
- package/ui.button/storybook/stories.ts +1 -1
- package/ui.container-accordion/UAccordion.vue +2 -2
- package/ui.container-accordion/config.ts +1 -1
- package/ui.container-card/UCard.vue +2 -2
- package/ui.container-card/config.ts +1 -1
- package/ui.container-modal/UModal.vue +4 -5
- package/ui.container-modal/config.ts +1 -1
- package/ui.form-calendar/UCalendar.vue +1 -2
- package/ui.form-checkbox/types.ts +1 -0
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +8 -9
- package/ui.form-checkbox-multi-state/types.ts +3 -2
- package/ui.form-date-picker/UDatePicker.vue +11 -6
- package/ui.form-date-picker/config.ts +2 -2
- package/ui.form-date-picker-range/UDatePickerRange.vue +3 -3
- package/ui.form-date-picker-range/config.ts +4 -1
- package/ui.form-date-picker-range/useUserFormat.ts +1 -1
- package/ui.loader/ULoader.vue +2 -2
- package/ui.loader-overlay/ULoaderOverlay.vue +2 -2
- package/ui.text-notify/UNotify.vue +1 -2
- package/ui.text-notify/storybook/stories.ts +5 -4
- package/utils/ui.ts +4 -26
- package/web-types.json +2 -2
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -226,20 +226,17 @@ export interface Components {
|
|
|
226
226
|
UDataList: Partial<typeof UDataListConfig>;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
export type Component = {
|
|
230
|
-
i18n?: UnknownObject;
|
|
231
|
-
defaults?: Defaults;
|
|
232
|
-
safelist?: (string: string) => TailwindSafelist[];
|
|
233
|
-
strategy?: Strategies;
|
|
234
|
-
transition?: Transition;
|
|
235
|
-
safelistColors?: BrandColors[];
|
|
236
|
-
} & (CVA & NestedComponent);
|
|
237
|
-
|
|
238
229
|
/* Make all config keys optional and allow to have string and object values. */
|
|
239
230
|
export type ComponentConfig<T> = Partial<{
|
|
240
|
-
[K in keyof T]:
|
|
231
|
+
[K in keyof T]: K extends string
|
|
232
|
+
? K extends `${string}transition${string}` | `${string}Transition${string}`
|
|
233
|
+
? Transition
|
|
234
|
+
: K extends "i18n"
|
|
235
|
+
? T[K]
|
|
236
|
+
: T[K] | string | UnknownObject
|
|
237
|
+
: never;
|
|
241
238
|
}> &
|
|
242
|
-
|
|
239
|
+
NestedComponent;
|
|
243
240
|
|
|
244
241
|
export interface NestedComponent {
|
|
245
242
|
[key: string]: Record<string, string | UnknownObject> | string;
|
|
@@ -305,11 +302,6 @@ export interface CreateVuelessOptions {
|
|
|
305
302
|
i18n?: LocaleOptions;
|
|
306
303
|
}
|
|
307
304
|
|
|
308
|
-
export interface TailwindSafelist {
|
|
309
|
-
pattern: string;
|
|
310
|
-
variants?: string[];
|
|
311
|
-
}
|
|
312
|
-
|
|
313
305
|
export interface TailwindColorShades {
|
|
314
306
|
50: string;
|
|
315
307
|
100: string;
|
|
@@ -75,7 +75,7 @@ const EnumVariantTemplate: StoryFn<UButtonArgs> = (args: UButtonArgs, { argTypes
|
|
|
75
75
|
`,
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
const ColorTemplate: StoryFn<UButtonArgs> = (args, { argTypes }) => ({
|
|
78
|
+
const ColorTemplate: StoryFn<UButtonArgs> = (args: UButtonArgs, { argTypes }) => ({
|
|
79
79
|
components: { UButton, URow, UCol },
|
|
80
80
|
setup() {
|
|
81
81
|
const variantOptions = (argTypes.variant as StoryArgType)?.options ?? [];
|
|
@@ -63,7 +63,7 @@ const {
|
|
|
63
63
|
bodyAttrs,
|
|
64
64
|
titleAttrs,
|
|
65
65
|
toggleIconAttrs,
|
|
66
|
-
|
|
66
|
+
accordionDividerAttrs,
|
|
67
67
|
} = useUI<Config>(defaultConfig, mutatedProps);
|
|
68
68
|
</script>
|
|
69
69
|
|
|
@@ -86,6 +86,6 @@ const {
|
|
|
86
86
|
<div :id="`description-${elementId}`" v-bind="descriptionAttrs" v-text="description" />
|
|
87
87
|
</div>
|
|
88
88
|
|
|
89
|
-
<UDivider :size="dividerSize" v-bind="
|
|
89
|
+
<UDivider :size="dividerSize" v-bind="accordionDividerAttrs" />
|
|
90
90
|
</div>
|
|
91
91
|
</template>
|
|
@@ -39,7 +39,7 @@ const isShownFooter = computed(() => {
|
|
|
39
39
|
const {
|
|
40
40
|
wrapperAttrs,
|
|
41
41
|
titleAttrs,
|
|
42
|
-
|
|
42
|
+
cardDividerAttrs,
|
|
43
43
|
headerAttrs,
|
|
44
44
|
headerLeftAttrs,
|
|
45
45
|
headerLeftFallbackAttrs,
|
|
@@ -77,7 +77,7 @@ const {
|
|
|
77
77
|
<slot />
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
|
-
<UDivider v-if="isShownFooter" padding="none" v-bind="
|
|
80
|
+
<UDivider v-if="isShownFooter" padding="none" v-bind="cardDividerAttrs" />
|
|
81
81
|
|
|
82
82
|
<div v-if="isShownFooter" v-bind="footerAttrs">
|
|
83
83
|
<!-- @slot Use it to add something to the left side of the footer. -->
|
|
@@ -14,7 +14,6 @@ import defaultConfig from "./config.ts";
|
|
|
14
14
|
import { UModal } from "./constants.ts";
|
|
15
15
|
|
|
16
16
|
import type { Props, Config } from "./types.ts";
|
|
17
|
-
import type { Transition } from "../types.ts";
|
|
18
17
|
|
|
19
18
|
defineOptions({ inheritAttrs: false });
|
|
20
19
|
|
|
@@ -117,7 +116,7 @@ const {
|
|
|
117
116
|
backLinkAttrs,
|
|
118
117
|
backLinkIconAttrs,
|
|
119
118
|
closeIconAttrs,
|
|
120
|
-
|
|
119
|
+
modalDividerAttrs,
|
|
121
120
|
dividerSpacingAttrs,
|
|
122
121
|
overlayAttrs,
|
|
123
122
|
wrapperAttrs,
|
|
@@ -135,11 +134,11 @@ const {
|
|
|
135
134
|
</script>
|
|
136
135
|
|
|
137
136
|
<template>
|
|
138
|
-
<Transition v-bind="config.overlayTransition
|
|
137
|
+
<Transition v-bind="config.overlayTransition">
|
|
139
138
|
<div v-if="isShownModal" v-bind="overlayAttrs" />
|
|
140
139
|
</Transition>
|
|
141
140
|
|
|
142
|
-
<Transition v-bind="config.wrapperTransition
|
|
141
|
+
<Transition v-bind="config.wrapperTransition">
|
|
143
142
|
<div
|
|
144
143
|
v-if="isShownModal"
|
|
145
144
|
:id="elementId"
|
|
@@ -220,7 +219,7 @@ const {
|
|
|
220
219
|
<UDivider v-if="!isExistFooter || !noDivider" no-border v-bind="dividerSpacingAttrs" />
|
|
221
220
|
|
|
222
221
|
<template v-if="isExistFooter">
|
|
223
|
-
<UDivider v-if="!noDivider" variant="dark" padding="none" v-bind="
|
|
222
|
+
<UDivider v-if="!noDivider" variant="dark" padding="none" v-bind="modalDividerAttrs" />
|
|
224
223
|
|
|
225
224
|
<div v-bind="footerAttrs">
|
|
226
225
|
<div v-if="hasSlotContent($slots['footer-left'])" v-bind="footerLeftAttrs">
|
|
@@ -28,7 +28,7 @@ export default /*tw*/ {
|
|
|
28
28
|
headerRight: "",
|
|
29
29
|
closeIcon: "{UIcon}",
|
|
30
30
|
body: "space-y-4 px-4 md:px-8 text-sm",
|
|
31
|
-
|
|
31
|
+
modalDivider: "{UDivider}",
|
|
32
32
|
dividerSpacing: "{UDivider}",
|
|
33
33
|
footer: "flex justify-between px-4 md:px-8 py-8 max-md:flex-col max-md:gap-4",
|
|
34
34
|
footerLeft: "flex flex-col md:flex-row space-y-4 md:space-x-4 md:space-y-0 w-full",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts" generic="TModelValue extends DateValue">
|
|
2
|
-
import { computed, ref, watch, useTemplateRef } from "vue";
|
|
2
|
+
import { computed, ref, watch, useTemplateRef, nextTick } from "vue";
|
|
3
3
|
import { merge } from "lodash-es";
|
|
4
4
|
|
|
5
5
|
import useUI from "../composables/useUI.ts";
|
|
@@ -47,7 +47,6 @@ import type { ComponentExposed } from "../types.ts";
|
|
|
47
47
|
import DayView from "./UCalendarDayView.vue";
|
|
48
48
|
import MonthView from "./UCalendarMonthView.vue";
|
|
49
49
|
import YearView from "./UCalendarYearView.vue";
|
|
50
|
-
import { nextTick } from "process";
|
|
51
50
|
|
|
52
51
|
type DefaultLocale = typeof defaultConfig.i18n;
|
|
53
52
|
|
|
@@ -12,7 +12,7 @@ import { UCheckboxMultiState } from "./constants.ts";
|
|
|
12
12
|
|
|
13
13
|
import type { Props, Config } from "./types.ts";
|
|
14
14
|
import type { UCheckboxOption, Config as UCheckboxConfig } from "../ui.form-checkbox/types.ts";
|
|
15
|
-
import type {
|
|
15
|
+
import type { KeyAttrsWithConfig, UnknownObject } from "../types.ts";
|
|
16
16
|
|
|
17
17
|
defineOptions({ inheritAttrs: false });
|
|
18
18
|
|
|
@@ -34,7 +34,7 @@ const index = ref(0);
|
|
|
34
34
|
const isChecked = ref(false);
|
|
35
35
|
|
|
36
36
|
const selected = computed<UCheckboxOption>(() => {
|
|
37
|
-
return props.options[index.value]
|
|
37
|
+
return props.options[index.value];
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
watchEffect(setIndex);
|
|
@@ -69,14 +69,13 @@ function onClickCheckbox() {
|
|
|
69
69
|
const { multiStateCheckboxAttrs: checkboxAttrs } = useUI<Config>(defaultConfig);
|
|
70
70
|
|
|
71
71
|
const multiStateCheckboxAttrs = computed(() => {
|
|
72
|
-
const clonedCheckboxAttrs = cloneDeep(checkboxAttrs.value) as
|
|
73
|
-
config: ComponentConfig<UCheckboxConfig>;
|
|
74
|
-
};
|
|
72
|
+
const clonedCheckboxAttrs = cloneDeep(checkboxAttrs.value) as KeyAttrsWithConfig<UCheckboxConfig>;
|
|
75
73
|
|
|
76
|
-
if (selected.value.icon) {
|
|
77
|
-
clonedCheckboxAttrs.config.defaults =
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
if (selected.value.icon && clonedCheckboxAttrs.config) {
|
|
75
|
+
clonedCheckboxAttrs.config.defaults = {
|
|
76
|
+
...((clonedCheckboxAttrs.config.defaults || {}) as UnknownObject),
|
|
77
|
+
checkedIcon: selected.value.icon,
|
|
78
|
+
};
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
return clonedCheckboxAttrs;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import defaultConfig from "./config.ts";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentConfig } from "../types.ts";
|
|
4
|
+
import type { UCheckboxOption } from "../ui.form-checkbox/types.ts";
|
|
4
5
|
|
|
5
6
|
export type Config = typeof defaultConfig;
|
|
6
7
|
|
|
@@ -13,7 +14,7 @@ export interface Props {
|
|
|
13
14
|
/**
|
|
14
15
|
* Checkbox state options.
|
|
15
16
|
*/
|
|
16
|
-
options?:
|
|
17
|
+
options?: UCheckboxOption[];
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Checkbox name.
|
|
@@ -24,7 +24,7 @@ import { vClickOutside } from "../directives";
|
|
|
24
24
|
|
|
25
25
|
import type { ComputedRef } from "vue";
|
|
26
26
|
import type { UDatePickerProps, Config, Locale } from "./types.ts";
|
|
27
|
-
import type { ComponentExposed
|
|
27
|
+
import type { ComponentExposed } from "../types.ts";
|
|
28
28
|
import type { Config as UCalendarConfig } from "../ui.form-calendar/types.ts";
|
|
29
29
|
import type { DateLocale } from "../ui.form-calendar/utilFormatting.ts";
|
|
30
30
|
|
|
@@ -255,12 +255,17 @@ const mutatedProps = computed(() => ({
|
|
|
255
255
|
description: Boolean(props.description),
|
|
256
256
|
}));
|
|
257
257
|
|
|
258
|
-
const {
|
|
259
|
-
|
|
258
|
+
const {
|
|
259
|
+
config,
|
|
260
|
+
datepickerInputAttrs,
|
|
261
|
+
datepickerInputActiveAttrs,
|
|
262
|
+
datepickerCalendarAttrs,
|
|
263
|
+
wrapperAttrs,
|
|
264
|
+
} = useUI<Config>(defaultConfig, mutatedProps);
|
|
260
265
|
|
|
261
266
|
/* Merging DatePicker's i18n translations into Calendar's i18n translations. */
|
|
262
267
|
watchEffect(() => {
|
|
263
|
-
const calendarConfig =
|
|
268
|
+
const calendarConfig = datepickerCalendarAttrs.value.config as unknown as UCalendarConfig;
|
|
264
269
|
|
|
265
270
|
if (!calendarConfig?.i18n || props.config?.i18n) {
|
|
266
271
|
calendarConfig.i18n = merge(calendarConfig.i18n, config.value.i18n);
|
|
@@ -323,7 +328,7 @@ watchEffect(() => {
|
|
|
323
328
|
</template>
|
|
324
329
|
</UInput>
|
|
325
330
|
|
|
326
|
-
<Transition v-bind="config.
|
|
331
|
+
<Transition v-bind="config.datepickerCalendarTransition">
|
|
327
332
|
<UCalendar
|
|
328
333
|
v-show="isShownCalendar"
|
|
329
334
|
ref="calendar"
|
|
@@ -338,7 +343,7 @@ watchEffect(() => {
|
|
|
338
343
|
:user-date-time-format="userDateTimeFormat"
|
|
339
344
|
:max-date="maxDate"
|
|
340
345
|
:min-date="minDate"
|
|
341
|
-
v-bind="
|
|
346
|
+
v-bind="datepickerCalendarAttrs"
|
|
342
347
|
@keydown.esc="deactivate"
|
|
343
348
|
@user-date-change="onUserFormatDateChange"
|
|
344
349
|
@input="onInput"
|
|
@@ -12,7 +12,7 @@ export default /*tw*/ {
|
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
datepickerCalendarCalendar: {
|
|
16
16
|
base: "{UCalendar} absolute mb-3 z-40",
|
|
17
17
|
variants: {
|
|
18
18
|
openDirectionX: {
|
|
@@ -28,7 +28,7 @@ export default /*tw*/ {
|
|
|
28
28
|
},
|
|
29
29
|
compoundVariants: [{ description: false, error: false, class: "mt-2" }],
|
|
30
30
|
},
|
|
31
|
-
|
|
31
|
+
datepickerCalendarTransition: {
|
|
32
32
|
enterFromClass: "opacity-0 scale-95",
|
|
33
33
|
enterActiveClass: "transition transform ease-out duration-100",
|
|
34
34
|
enterToClass: "opacity-100 scale-100",
|
|
@@ -543,7 +543,7 @@ const mutatedProps = computed(() => ({
|
|
|
543
543
|
const {
|
|
544
544
|
config,
|
|
545
545
|
wrapperAttrs,
|
|
546
|
-
|
|
546
|
+
datepickerCalendarAttrs,
|
|
547
547
|
datepickerInputAttrs,
|
|
548
548
|
menuAttrs,
|
|
549
549
|
buttonWrapperAttrs,
|
|
@@ -570,7 +570,7 @@ const {
|
|
|
570
570
|
|
|
571
571
|
/* Merging DatePickerRange's i18n translations into Calendar's i18n translations. */
|
|
572
572
|
watchEffect(() => {
|
|
573
|
-
const calendarConfig =
|
|
573
|
+
const calendarConfig = datepickerCalendarAttrs.value.config as unknown as UCalendarConfig;
|
|
574
574
|
|
|
575
575
|
if (!calendarConfig.i18n || props.config?.i18n) {
|
|
576
576
|
calendarConfig.i18n = merge(calendarConfig.i18n, config.value.i18n);
|
|
@@ -722,7 +722,7 @@ watchEffect(() => {
|
|
|
722
722
|
v-model="calendarValue"
|
|
723
723
|
:min-date="minDate"
|
|
724
724
|
:max-date="maxDate"
|
|
725
|
-
v-bind="
|
|
725
|
+
v-bind="datepickerCalendarAttrs"
|
|
726
726
|
:date-format="dateFormat"
|
|
727
727
|
range
|
|
728
728
|
@mouseenter="onMouseoverCalendar"
|
|
@@ -110,7 +110,7 @@ export default /*tw*/ {
|
|
|
110
110
|
`,
|
|
111
111
|
},
|
|
112
112
|
rangeInputError: "text-xs font-normal leading-none mt-2 text-center text-red-500",
|
|
113
|
-
|
|
113
|
+
datepickerCalendar: {
|
|
114
114
|
base: "{UCalendar}",
|
|
115
115
|
wrapper: "p-0 pt-2 w-full border-none shadow-none rounded-none",
|
|
116
116
|
navigation: "pb-0 mb-0 border-none",
|
|
@@ -127,6 +127,9 @@ export default /*tw*/ {
|
|
|
127
127
|
notCorrectDayNumber: "Wrong day in month.",
|
|
128
128
|
fromDateGraterThanSecond: "The 'from' date should be less than the 'to' date.",
|
|
129
129
|
toDateSmallerThanFirst: "The 'to' date should be greater than the 'from' date.",
|
|
130
|
+
today: "Today,",
|
|
131
|
+
yesterday: "Yesterday,",
|
|
132
|
+
tomorrow: "Tomorrow,",
|
|
130
133
|
weekdays: {
|
|
131
134
|
shorthand: {
|
|
132
135
|
sunday: "Sun",
|
|
@@ -12,7 +12,7 @@ export function useUserFormat(
|
|
|
12
12
|
userFormatLocale: Ref<SortedLocale>,
|
|
13
13
|
dateFormat: string,
|
|
14
14
|
isPeriod: Ref<IsPeriod>,
|
|
15
|
-
locale: Ref<SortedLocale
|
|
15
|
+
locale: Ref<SortedLocale>,
|
|
16
16
|
userDateFormat: string,
|
|
17
17
|
) {
|
|
18
18
|
const userFormatDate = computed(() => {
|
package/ui.loader/ULoader.vue
CHANGED
|
@@ -17,11 +17,11 @@ withDefaults(defineProps<Props>(), {
|
|
|
17
17
|
* Get element / nested component attributes for each config token ✨
|
|
18
18
|
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
19
19
|
*/
|
|
20
|
-
const { loaderAttrs, ellipseAttrs
|
|
20
|
+
const { config, loaderAttrs, ellipseAttrs } = useUI<Config>(defaultConfig);
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<template>
|
|
24
|
-
<Transition v-bind="config
|
|
24
|
+
<Transition v-bind="config.transition">
|
|
25
25
|
<div v-if="loading" v-bind="loaderAttrs" :data-test="dataTest">
|
|
26
26
|
<!-- @slot Use it to add something instead of the default loader. -->
|
|
27
27
|
<slot>
|
|
@@ -47,11 +47,11 @@ const showLoader = computed(() => {
|
|
|
47
47
|
* Get element / nested component attributes for each config token ✨
|
|
48
48
|
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
49
49
|
*/
|
|
50
|
-
const { overlayAttrs, nestedLoaderAttrs
|
|
50
|
+
const { config, overlayAttrs, nestedLoaderAttrs } = useUI<Config>(defaultConfig);
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
53
|
<template>
|
|
54
|
-
<Transition v-bind="config
|
|
54
|
+
<Transition v-bind="config.transition">
|
|
55
55
|
<div v-if="showLoader" v-bind="overlayAttrs">
|
|
56
56
|
<!-- @slot Use it to add something instead of the default loader. -->
|
|
57
57
|
<slot>
|
|
@@ -12,7 +12,6 @@ import { UNotify, NotificationType, NotificationPosition } from "./constants.ts"
|
|
|
12
12
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
13
13
|
|
|
14
14
|
import type { Props, Config, NotifyEvent, Notification, NotificationsWrapperRef } from "./types.ts";
|
|
15
|
-
import type { Transition } from "../types.ts";
|
|
16
15
|
|
|
17
16
|
defineOptions({ inheritAttrs: false });
|
|
18
17
|
|
|
@@ -145,7 +144,7 @@ const {
|
|
|
145
144
|
ref="notificationsWrapperRef"
|
|
146
145
|
:style="notifyPositionStyles"
|
|
147
146
|
tag="div"
|
|
148
|
-
v-bind="{ ...
|
|
147
|
+
v-bind="{ ...config.transitionGroup, ...wrapperAttrs }"
|
|
149
148
|
:data-test="dataTest"
|
|
150
149
|
>
|
|
151
150
|
<div
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "../../utils/storybook.ts";
|
|
7
7
|
|
|
8
8
|
import { notify } from "../utilNotify.js";
|
|
9
|
+
import { NotificationType } from "../constants.ts";
|
|
9
10
|
|
|
10
11
|
import UNotify from "../../ui.text-notify/UNotify.vue";
|
|
11
12
|
import UButton from "../../ui.button/UButton.vue";
|
|
@@ -40,7 +41,7 @@ const DefaultTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
|
|
|
40
41
|
setup() {
|
|
41
42
|
function onClick() {
|
|
42
43
|
notify({
|
|
43
|
-
type:
|
|
44
|
+
type: NotificationType.Success,
|
|
44
45
|
label: "Hurray!",
|
|
45
46
|
description: "The file successfully downloaded.",
|
|
46
47
|
});
|
|
@@ -62,7 +63,7 @@ const TypesTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
|
|
|
62
63
|
components: { UNotify, UButton, UCol },
|
|
63
64
|
setup() {
|
|
64
65
|
function onClick(type: string) {
|
|
65
|
-
if (type ===
|
|
66
|
+
if (type === NotificationType.Success) {
|
|
66
67
|
notify({
|
|
67
68
|
type,
|
|
68
69
|
label: "Hurray!",
|
|
@@ -70,7 +71,7 @@ const TypesTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
|
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
if (type ===
|
|
74
|
+
if (type === NotificationType.Warning) {
|
|
74
75
|
notify({
|
|
75
76
|
type,
|
|
76
77
|
label: "Be aware!",
|
|
@@ -78,7 +79,7 @@ const TypesTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
|
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
if (type ===
|
|
82
|
+
if (type === NotificationType.Error) {
|
|
82
83
|
notify({
|
|
83
84
|
type,
|
|
84
85
|
label: "Ooops!",
|
package/utils/ui.ts
CHANGED
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
} from "../constants.js";
|
|
14
14
|
|
|
15
15
|
import type {
|
|
16
|
-
BrandColors,
|
|
17
16
|
Config,
|
|
18
|
-
ComponentNames,
|
|
19
|
-
Component,
|
|
20
17
|
Defaults,
|
|
21
18
|
Strategies,
|
|
19
|
+
BrandColors,
|
|
20
|
+
UnknownObject,
|
|
21
|
+
ComponentNames,
|
|
22
22
|
} from "../types.ts";
|
|
23
23
|
|
|
24
24
|
interface MergedConfigOptions {
|
|
@@ -94,33 +94,11 @@ export const cva = ({ base = "", variants = {}, compoundVariants = [], defaultVa
|
|
|
94
94
|
defaultVariants,
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
/**
|
|
98
|
-
* @deprecated
|
|
99
|
-
* TODO: remove if after all components migration into getDefaults()
|
|
100
|
-
* Return default values for component props, icons, etc..
|
|
101
|
-
*/
|
|
102
|
-
export function getDefault<T>(defaultConfig: Component, name: ComponentNames) {
|
|
103
|
-
const componentDefaults = cloneDeep(defaultConfig.defaults) || {};
|
|
104
|
-
const globalDefaults = cloneDeep(vuelessConfig.component?.[name]?.defaults) || {};
|
|
105
|
-
|
|
106
|
-
const defaults = merge(componentDefaults, globalDefaults) as T & Defaults;
|
|
107
|
-
|
|
108
|
-
if (defaults.color) {
|
|
109
|
-
defaults.color = getColor(defaults.color as BrandColors);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
...defaults,
|
|
114
|
-
dataTest: "",
|
|
115
|
-
config: () => ({}),
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
97
|
/**
|
|
120
98
|
* Return default values for component props, icons, etc..
|
|
121
99
|
*/
|
|
122
100
|
export function getDefaults<Props, Config>(defaultConfig: Config, name: ComponentNames) {
|
|
123
|
-
const componentDefaults = cloneDeep((defaultConfig as
|
|
101
|
+
const componentDefaults = cloneDeep((defaultConfig as UnknownObject).defaults) || {};
|
|
124
102
|
const globalDefaults = cloneDeep(vuelessConfig.component?.[name]?.defaults) || {};
|
|
125
103
|
|
|
126
104
|
const defaults = merge(componentDefaults, globalDefaults) as Props & Defaults;
|
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.586",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -2182,7 +2182,7 @@
|
|
|
2182
2182
|
"required": false,
|
|
2183
2183
|
"description": "Checkbox state options.",
|
|
2184
2184
|
"enum": [
|
|
2185
|
-
"
|
|
2185
|
+
"UCheckboxOption"
|
|
2186
2186
|
],
|
|
2187
2187
|
"value": {
|
|
2188
2188
|
"kind": "expression",
|