nuance-ui 0.1.39 → 0.1.41
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/dist/module.json +1 -1
- package/dist/runtime/components/calendar/calendar.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/calendar.vue +1 -1
- package/dist/runtime/components/calendar/calendar.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/model.d.ts +4 -0
- package/dist/runtime/components/date-time-picker.d.vue.ts +18 -6
- package/dist/runtime/components/date-time-picker.vue +6 -1
- package/dist/runtime/components/date-time-picker.vue.d.ts +18 -6
- package/dist/runtime/components/index.d.ts +1 -0
- package/dist/runtime/components/index.js +1 -0
- package/dist/runtime/components/input/date-picker.d.vue.ts +11 -4
- package/dist/runtime/components/input/date-picker.vue +7 -3
- package/dist/runtime/components/input/date-picker.vue.d.ts +11 -4
- package/dist/runtime/components/nav-link/nav-link.d.vue.ts +3 -1
- package/dist/runtime/components/nav-link/nav-link.vue +15 -13
- package/dist/runtime/components/nav-link/nav-link.vue.d.ts +3 -1
- package/dist/runtime/components/time-picker/lib/use-time-picker.js +5 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -24,7 +24,7 @@ declare const __VLS_export: <T extends SelectionMode = "single">(__VLS_props: No
|
|
|
24
24
|
level?: CalendarLevel;
|
|
25
25
|
value?: DateSelection<T>;
|
|
26
26
|
}) & {
|
|
27
|
-
onSelect?: ((
|
|
27
|
+
onSelect?: ((date: DateSelection<T>) => any) | undefined;
|
|
28
28
|
onNext?: (() => any) | undefined;
|
|
29
29
|
onPrev?: (() => any) | undefined;
|
|
30
30
|
onLevel?: (() => any) | undefined;
|
|
@@ -53,7 +53,7 @@ declare const __VLS_export: <T extends SelectionMode = "single">(__VLS_props: No
|
|
|
53
53
|
} & {
|
|
54
54
|
day?: (props: {}) => any;
|
|
55
55
|
};
|
|
56
|
-
emit: (((evt: "select",
|
|
56
|
+
emit: (((evt: "select", date: DateSelection<T>) => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "level") => void)) & (((event: "update:date", value: DateInput) => void) & ((event: "update:level", value: CalendarLevel) => void) & ((event: "update:value", value: DateSelection<T> | undefined) => void));
|
|
57
57
|
}>) => import("vue").VNode & {
|
|
58
58
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
59
59
|
};
|
|
@@ -23,7 +23,7 @@ const props = defineProps({
|
|
|
23
23
|
readonly: { type: Boolean, required: false, default: false },
|
|
24
24
|
config: { type: Object, required: false }
|
|
25
25
|
});
|
|
26
|
-
defineEmits(["
|
|
26
|
+
defineEmits(["select", "prev", "level", "next"]);
|
|
27
27
|
const date = defineModel("date", { type: [Date, String], ...{ default: /* @__PURE__ */ new Date() } });
|
|
28
28
|
const level = defineModel("level", { type: String, ...{ default: ({ minLevel }) => minLevel } });
|
|
29
29
|
const select = defineModel("value", { type: null });
|
|
@@ -24,7 +24,7 @@ declare const __VLS_export: <T extends SelectionMode = "single">(__VLS_props: No
|
|
|
24
24
|
level?: CalendarLevel;
|
|
25
25
|
value?: DateSelection<T>;
|
|
26
26
|
}) & {
|
|
27
|
-
onSelect?: ((
|
|
27
|
+
onSelect?: ((date: DateSelection<T>) => any) | undefined;
|
|
28
28
|
onNext?: (() => any) | undefined;
|
|
29
29
|
onPrev?: (() => any) | undefined;
|
|
30
30
|
onLevel?: (() => any) | undefined;
|
|
@@ -53,7 +53,7 @@ declare const __VLS_export: <T extends SelectionMode = "single">(__VLS_props: No
|
|
|
53
53
|
} & {
|
|
54
54
|
day?: (props: {}) => any;
|
|
55
55
|
};
|
|
56
|
-
emit: (((evt: "select",
|
|
56
|
+
emit: (((evt: "select", date: DateSelection<T>) => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "level") => void)) & (((event: "update:date", value: DateInput) => void) & ((event: "update:level", value: CalendarLevel) => void) & ((event: "update:value", value: DateSelection<T> | undefined) => void));
|
|
57
57
|
}>) => import("vue").VNode & {
|
|
58
58
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
59
59
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FormatOptions } from '@formkit/tempo';
|
|
2
|
+
import type { CalendarHeaderEmits } from './ui/core/index.js';
|
|
2
3
|
/**
|
|
3
4
|
* `@formkit/tempo` config
|
|
4
5
|
*/
|
|
@@ -8,3 +9,6 @@ export type SelectionMode = 'single' | 'range' | 'week' | 'multiple';
|
|
|
8
9
|
/** ISO string value */
|
|
9
10
|
export type Selection = string | null;
|
|
10
11
|
export type DateSelection<T extends SelectionMode = 'single'> = T extends 'single' ? Selection : T extends 'range' ? [Selection, Selection] : T extends 'week' ? [Selection, Selection] : T extends 'multiple' ? Selection[] : never;
|
|
12
|
+
export interface CalendarEmits<T extends SelectionMode = 'single'> extends CalendarHeaderEmits {
|
|
13
|
+
select: [date: DateSelection<T>];
|
|
14
|
+
}
|
|
@@ -20,22 +20,34 @@ type __VLS_ModelProps = {
|
|
|
20
20
|
modelValue?: string | Date;
|
|
21
21
|
};
|
|
22
22
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
23
|
-
declare var
|
|
23
|
+
declare var __VLS_24: {}, __VLS_32: {}, __VLS_43: {}, __VLS_46: {}, __VLS_49: {};
|
|
24
24
|
type __VLS_Slots = {} & {
|
|
25
|
-
leftSection?: (props: typeof
|
|
25
|
+
leftSection?: (props: typeof __VLS_24) => any;
|
|
26
26
|
} & {
|
|
27
|
-
rightSection?: (props: typeof
|
|
27
|
+
rightSection?: (props: typeof __VLS_32) => any;
|
|
28
28
|
} & {
|
|
29
|
-
label?: (props: typeof
|
|
29
|
+
label?: (props: typeof __VLS_43) => any;
|
|
30
30
|
} & {
|
|
31
|
-
error?: (props: typeof
|
|
31
|
+
error?: (props: typeof __VLS_46) => any;
|
|
32
32
|
} & {
|
|
33
|
-
description?: (props: typeof
|
|
33
|
+
description?: (props: typeof __VLS_49) => any;
|
|
34
34
|
};
|
|
35
35
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
select: (date: import("./calendar/index.js").Selection) => any;
|
|
37
|
+
close: () => any;
|
|
38
|
+
next: () => any;
|
|
36
39
|
"update:modelValue": (value: string | Date | undefined) => any;
|
|
40
|
+
prev: () => any;
|
|
41
|
+
level: () => any;
|
|
42
|
+
open: () => any;
|
|
37
43
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
44
|
+
onSelect?: ((date: import("./calendar/index.js").Selection) => any) | undefined;
|
|
45
|
+
onClose?: (() => any) | undefined;
|
|
46
|
+
onNext?: (() => any) | undefined;
|
|
38
47
|
"onUpdate:modelValue"?: ((value: string | Date | undefined) => any) | undefined;
|
|
48
|
+
onPrev?: (() => any) | undefined;
|
|
49
|
+
onLevel?: (() => any) | undefined;
|
|
50
|
+
onOpen?: (() => any) | undefined;
|
|
39
51
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
52
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
53
|
declare const _default: typeof __VLS_export;
|
|
@@ -41,6 +41,7 @@ const {
|
|
|
41
41
|
disabled: { type: Boolean, required: false },
|
|
42
42
|
withSeconds: { type: Boolean, required: false }
|
|
43
43
|
});
|
|
44
|
+
defineEmits(["open", "close", "select", "prev", "level", "next"]);
|
|
44
45
|
const model = defineModel({ type: [String, Date] });
|
|
45
46
|
const date = computed({
|
|
46
47
|
get: () => model.value ? format(model.value, "YYYY-MM-DD") : "",
|
|
@@ -88,7 +89,7 @@ const isClearable = computed(() => clearable && !props.disabled && !props.readon
|
|
|
88
89
|
</script>
|
|
89
90
|
|
|
90
91
|
<template>
|
|
91
|
-
<Popover>
|
|
92
|
+
<Popover @open='$emit("open")' @close='$emit("close")'>
|
|
92
93
|
<PopoverTarget>
|
|
93
94
|
<ButtonInput v-bind='props' :right-section-p-e>
|
|
94
95
|
<template #leftSection>
|
|
@@ -131,6 +132,10 @@ const isClearable = computed(() => clearable && !props.disabled && !props.readon
|
|
|
131
132
|
<Calendar
|
|
132
133
|
v-model:value='date'
|
|
133
134
|
v-bind='calendarProps'
|
|
135
|
+
@next='$emit("next")'
|
|
136
|
+
@prev='$emit("prev")'
|
|
137
|
+
@level='$emit("level")'
|
|
138
|
+
@select='(d) => $emit("select", d)'
|
|
134
139
|
/>
|
|
135
140
|
<TimePicker
|
|
136
141
|
v-model='time'
|
|
@@ -20,22 +20,34 @@ type __VLS_ModelProps = {
|
|
|
20
20
|
modelValue?: string | Date;
|
|
21
21
|
};
|
|
22
22
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
23
|
-
declare var
|
|
23
|
+
declare var __VLS_24: {}, __VLS_32: {}, __VLS_43: {}, __VLS_46: {}, __VLS_49: {};
|
|
24
24
|
type __VLS_Slots = {} & {
|
|
25
|
-
leftSection?: (props: typeof
|
|
25
|
+
leftSection?: (props: typeof __VLS_24) => any;
|
|
26
26
|
} & {
|
|
27
|
-
rightSection?: (props: typeof
|
|
27
|
+
rightSection?: (props: typeof __VLS_32) => any;
|
|
28
28
|
} & {
|
|
29
|
-
label?: (props: typeof
|
|
29
|
+
label?: (props: typeof __VLS_43) => any;
|
|
30
30
|
} & {
|
|
31
|
-
error?: (props: typeof
|
|
31
|
+
error?: (props: typeof __VLS_46) => any;
|
|
32
32
|
} & {
|
|
33
|
-
description?: (props: typeof
|
|
33
|
+
description?: (props: typeof __VLS_49) => any;
|
|
34
34
|
};
|
|
35
35
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
select: (date: import("./calendar/index.js").Selection) => any;
|
|
37
|
+
close: () => any;
|
|
38
|
+
next: () => any;
|
|
36
39
|
"update:modelValue": (value: string | Date | undefined) => any;
|
|
40
|
+
prev: () => any;
|
|
41
|
+
level: () => any;
|
|
42
|
+
open: () => any;
|
|
37
43
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
44
|
+
onSelect?: ((date: import("./calendar/index.js").Selection) => any) | undefined;
|
|
45
|
+
onClose?: (() => any) | undefined;
|
|
46
|
+
onNext?: (() => any) | undefined;
|
|
38
47
|
"onUpdate:modelValue"?: ((value: string | Date | undefined) => any) | undefined;
|
|
48
|
+
onPrev?: (() => any) | undefined;
|
|
49
|
+
onLevel?: (() => any) | undefined;
|
|
50
|
+
onOpen?: (() => any) | undefined;
|
|
39
51
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
52
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
53
|
declare const _default: typeof __VLS_export;
|
|
@@ -30,6 +30,7 @@ export * from './table/index.js';
|
|
|
30
30
|
export * from './tabs/index.js';
|
|
31
31
|
export * from './text.vue.js';
|
|
32
32
|
export * from './textarea.vue.js';
|
|
33
|
+
export * from './time-picker/index.js';
|
|
33
34
|
export * from './title.vue.js';
|
|
34
35
|
export * from './transition/index.js';
|
|
35
36
|
export * from './tree/index.js';
|
|
@@ -28,6 +28,7 @@ export * from "./table/index.js";
|
|
|
28
28
|
export * from "./tabs/index.js";
|
|
29
29
|
export * from "./text.vue";
|
|
30
30
|
export * from "./textarea.vue";
|
|
31
|
+
export * from "./time-picker/index.js";
|
|
31
32
|
export * from "./title.vue";
|
|
32
33
|
export * from "./transition/index.js";
|
|
33
34
|
export * from "./tree/index.js";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Format } from '@formkit/tempo';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DateSelection, SelectionMode } from '../calendar/index.js';
|
|
3
3
|
import type { CalendarProps } from '../calendar/calendar.vue.js';
|
|
4
4
|
import type { ButtonInputProps } from './ui/button-input.vue.js';
|
|
5
5
|
/**
|
|
6
6
|
* - presets
|
|
7
|
+
* - value type DateSelection
|
|
7
8
|
*/
|
|
8
9
|
export interface DatePickerProps<Mode extends SelectionMode> extends CalendarProps<Mode>, ButtonInputProps {
|
|
9
10
|
/** Tempo format for value */
|
|
@@ -12,9 +13,15 @@ export interface DatePickerProps<Mode extends SelectionMode> extends CalendarPro
|
|
|
12
13
|
declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
13
14
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<(DatePickerProps<Mode> & {
|
|
14
15
|
/** ISO string(s) */
|
|
15
|
-
modelValue?:
|
|
16
|
+
modelValue?: DateSelection<Mode>;
|
|
16
17
|
}) & {
|
|
17
|
-
|
|
18
|
+
onSelect?: ((date: DateSelection<Mode>) => any) | undefined;
|
|
19
|
+
onClose?: (() => any) | undefined;
|
|
20
|
+
onNext?: (() => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: DateSelection<Mode> | undefined) => any) | undefined;
|
|
22
|
+
onPrev?: (() => any) | undefined;
|
|
23
|
+
onLevel?: (() => any) | undefined;
|
|
24
|
+
onOpen?: (() => any) | undefined;
|
|
18
25
|
}> & (typeof globalThis extends {
|
|
19
26
|
__VLS_PROPS_FALLBACK: infer P;
|
|
20
27
|
} ? P : {});
|
|
@@ -31,7 +38,7 @@ declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullabl
|
|
|
31
38
|
} & {
|
|
32
39
|
description?: (props: {}) => any;
|
|
33
40
|
};
|
|
34
|
-
emit: (event: "update:modelValue", value:
|
|
41
|
+
emit: (((evt: "select", date: DateSelection<Mode>) => void) & ((evt: "close") => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "level") => void) & ((evt: "open") => void)) & ((event: "update:modelValue", value: DateSelection<Mode> | undefined) => void);
|
|
35
42
|
}>) => import("vue").VNode & {
|
|
36
43
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
37
44
|
};
|
|
@@ -64,7 +64,8 @@ const {
|
|
|
64
64
|
rightSectionPE: { type: null, required: false },
|
|
65
65
|
classes: { type: Object, required: false }
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
defineEmits(["open", "close", "select", "prev", "level", "next"]);
|
|
68
|
+
const model = defineModel({ type: null });
|
|
68
69
|
const config = useDatesConfig(cfg);
|
|
69
70
|
const formatValue = (date) => format({ date, format: valueFormat, ...config });
|
|
70
71
|
const visible = computed(() => {
|
|
@@ -92,7 +93,7 @@ const visible = computed(() => {
|
|
|
92
93
|
</script>
|
|
93
94
|
|
|
94
95
|
<template>
|
|
95
|
-
<Popover>
|
|
96
|
+
<Popover @open='$emit("open")' @close='$emit("close")'>
|
|
96
97
|
<PopoverTarget>
|
|
97
98
|
<ButtonInput v-bind='props' :multiline='mode === "multiple"'>
|
|
98
99
|
<template #leftSection>
|
|
@@ -120,7 +121,7 @@ const visible = computed(() => {
|
|
|
120
121
|
color='gray'
|
|
121
122
|
size='xs'
|
|
122
123
|
@click.stop.prevent='() => {
|
|
123
|
-
model = model
|
|
124
|
+
model = model?.filter((_, _ix) => _ix !== ix);
|
|
124
125
|
}'
|
|
125
126
|
/>
|
|
126
127
|
</template>
|
|
@@ -160,6 +161,9 @@ const visible = computed(() => {
|
|
|
160
161
|
:weekday-format
|
|
161
162
|
:with-week-numbers
|
|
162
163
|
:config
|
|
164
|
+
@prev='$emit("prev")'
|
|
165
|
+
@next='$emit("next")'
|
|
166
|
+
@select='(d) => $emit("select", d)'
|
|
163
167
|
/>
|
|
164
168
|
</PopoverDropdown>
|
|
165
169
|
</Popover>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Format } from '@formkit/tempo';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DateSelection, SelectionMode } from '../calendar/index.js';
|
|
3
3
|
import type { CalendarProps } from '../calendar/calendar.vue.js';
|
|
4
4
|
import type { ButtonInputProps } from './ui/button-input.vue.js';
|
|
5
5
|
/**
|
|
6
6
|
* - presets
|
|
7
|
+
* - value type DateSelection
|
|
7
8
|
*/
|
|
8
9
|
export interface DatePickerProps<Mode extends SelectionMode> extends CalendarProps<Mode>, ButtonInputProps {
|
|
9
10
|
/** Tempo format for value */
|
|
@@ -12,9 +13,15 @@ export interface DatePickerProps<Mode extends SelectionMode> extends CalendarPro
|
|
|
12
13
|
declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
13
14
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<(DatePickerProps<Mode> & {
|
|
14
15
|
/** ISO string(s) */
|
|
15
|
-
modelValue?:
|
|
16
|
+
modelValue?: DateSelection<Mode>;
|
|
16
17
|
}) & {
|
|
17
|
-
|
|
18
|
+
onSelect?: ((date: DateSelection<Mode>) => any) | undefined;
|
|
19
|
+
onClose?: (() => any) | undefined;
|
|
20
|
+
onNext?: (() => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: DateSelection<Mode> | undefined) => any) | undefined;
|
|
22
|
+
onPrev?: (() => any) | undefined;
|
|
23
|
+
onLevel?: (() => any) | undefined;
|
|
24
|
+
onOpen?: (() => any) | undefined;
|
|
18
25
|
}> & (typeof globalThis extends {
|
|
19
26
|
__VLS_PROPS_FALLBACK: infer P;
|
|
20
27
|
} ? P : {});
|
|
@@ -31,7 +38,7 @@ declare const __VLS_export: <Mode extends SelectionMode>(__VLS_props: NonNullabl
|
|
|
31
38
|
} & {
|
|
32
39
|
description?: (props: {}) => any;
|
|
33
40
|
};
|
|
34
|
-
emit: (event: "update:modelValue", value:
|
|
41
|
+
emit: (((evt: "select", date: DateSelection<Mode>) => void) & ((evt: "close") => void) & ((evt: "next") => void) & ((evt: "prev") => void) & ((evt: "level") => void) & ((evt: "open") => void)) & ((event: "update:modelValue", value: DateSelection<Mode> | undefined) => void);
|
|
35
42
|
}>) => import("vue").VNode & {
|
|
36
43
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
37
44
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NuanceColor } from '@nui/types';
|
|
1
|
+
import type { NuanceColor, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { NuxtLinkProps } from 'nuxt/app';
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
4
|
export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
@@ -8,6 +8,8 @@ export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'cu
|
|
|
8
8
|
active?: boolean;
|
|
9
9
|
/** Key of `theme.colors` of any valid CSS color to control active styles @default `theme.primaryColor` */
|
|
10
10
|
color?: NuanceColor;
|
|
11
|
+
/** Spacing between left/right section and content */
|
|
12
|
+
spacing?: NuanceSpacing;
|
|
11
13
|
/** If set, label and description do not wrap to the next line @default `false` */
|
|
12
14
|
noWrap?: boolean;
|
|
13
15
|
/** If set, disabled styles will be added to the root element @default `false` */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useStyleResolver } from "@nui/composals";
|
|
3
|
-
import { createVariantColorResolver } from "@nui/utils";
|
|
3
|
+
import { createVariantColorResolver, getSize } from "@nui/utils";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import Box from "../box.vue";
|
|
6
6
|
import UnstyledButton from "../button/unstyled-button.vue";
|
|
@@ -9,6 +9,7 @@ const props = defineProps({
|
|
|
9
9
|
description: { type: String, required: false },
|
|
10
10
|
active: { type: Boolean, required: false },
|
|
11
11
|
color: { type: null, required: false },
|
|
12
|
+
spacing: { type: [String, Number], required: false },
|
|
12
13
|
noWrap: { type: Boolean, required: false },
|
|
13
14
|
disabled: { type: Boolean, required: false },
|
|
14
15
|
variant: { type: String, required: false },
|
|
@@ -38,7 +39,8 @@ const {
|
|
|
38
39
|
variant = "filled",
|
|
39
40
|
color,
|
|
40
41
|
noWrap,
|
|
41
|
-
description
|
|
42
|
+
description,
|
|
43
|
+
spacing
|
|
42
44
|
}
|
|
43
45
|
} = pickLinkProps(props);
|
|
44
46
|
const style = computed(() => useStyleResolver((theme) => {
|
|
@@ -46,7 +48,8 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
46
48
|
return {
|
|
47
49
|
"--nl-bg": variant ? background : void 0,
|
|
48
50
|
"--nl-hover": variant ? hover : void 0,
|
|
49
|
-
"--nl-color": variant ? text : void 0
|
|
51
|
+
"--nl-color": variant ? text : void 0,
|
|
52
|
+
"--nl-spacing": getSize(spacing, "nl-spacing")
|
|
50
53
|
};
|
|
51
54
|
}));
|
|
52
55
|
</script>
|
|
@@ -88,13 +91,21 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
88
91
|
|
|
89
92
|
<style module lang="postcss">
|
|
90
93
|
.root {
|
|
94
|
+
--nl-spacing-xs: .25rem;
|
|
95
|
+
--nl-spacing-sm: .5rem;
|
|
96
|
+
--nl-spacing-md: .75rem;
|
|
97
|
+
--nl-spacing-lg: 1rem;
|
|
98
|
+
--nl-spacing-xl: 1.25rem;
|
|
99
|
+
|
|
91
100
|
--nl-bg: var(--color-primary-light);
|
|
92
101
|
--nl-hover: var(--color-primary-light-hover);
|
|
93
102
|
--nl-color: var(--color-primary-light-color);
|
|
103
|
+
--nl-spacing: var(--nl-spacing-xs);
|
|
94
104
|
|
|
95
105
|
user-select: none;
|
|
96
106
|
|
|
97
107
|
display: flex;
|
|
108
|
+
gap: var(--nl-spacing);
|
|
98
109
|
align-items: center;
|
|
99
110
|
|
|
100
111
|
width: 100%;
|
|
@@ -140,18 +151,10 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
140
151
|
|
|
141
152
|
transition: transform 150ms ease;
|
|
142
153
|
|
|
143
|
-
|
|
154
|
+
&>svg {
|
|
144
155
|
display: block;
|
|
145
156
|
}
|
|
146
157
|
|
|
147
|
-
&:where([data-position='left']) {
|
|
148
|
-
margin-inline-end: var(--spacing-sm);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
&:where([data-position='right']) {
|
|
152
|
-
margin-inline-start: var(--spacing-sm);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
158
|
&:where([data-rotate]) {
|
|
156
159
|
transform: rotate(90deg);
|
|
157
160
|
}
|
|
@@ -174,7 +177,6 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
174
177
|
|
|
175
178
|
.description {
|
|
176
179
|
overflow: hidden;
|
|
177
|
-
display: block;
|
|
178
180
|
|
|
179
181
|
font-size: var(--font-size-xs);
|
|
180
182
|
color: var(--description-color, var(--color-dimmed));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NuanceColor } from '@nui/types';
|
|
1
|
+
import type { NuanceColor, NuanceSpacing } from '@nui/types';
|
|
2
2
|
import type { NuxtLinkProps } from 'nuxt/app';
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
4
|
export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'custom'> {
|
|
@@ -8,6 +8,8 @@ export interface NavLinkProps extends BoxProps, Omit<NuxtLinkProps, 'href' | 'cu
|
|
|
8
8
|
active?: boolean;
|
|
9
9
|
/** Key of `theme.colors` of any valid CSS color to control active styles @default `theme.primaryColor` */
|
|
10
10
|
color?: NuanceColor;
|
|
11
|
+
/** Spacing between left/right section and content */
|
|
12
|
+
spacing?: NuanceSpacing;
|
|
11
13
|
/** If set, label and description do not wrap to the next line @default `false` */
|
|
12
14
|
noWrap?: boolean;
|
|
13
15
|
/** If set, disabled styles will be added to the root element @default `false` */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { iso8601, format as lFormat } from "@formkit/tempo";
|
|
1
2
|
import { unrefElement } from "@vueuse/core";
|
|
2
3
|
import { computed, ref, shallowRef, watch } from "vue";
|
|
3
4
|
import { clampTime } from "./clamp-time.js";
|
|
@@ -18,7 +19,10 @@ export function useTimePicker({
|
|
|
18
19
|
seconds: null,
|
|
19
20
|
amPm: null
|
|
20
21
|
});
|
|
21
|
-
const parsed = computed(() =>
|
|
22
|
+
const parsed = computed(() => {
|
|
23
|
+
const time = iso8601(model.value) ? lFormat(model.value, "HH:mm:ss") : model.value ?? "";
|
|
24
|
+
return getParsedTime({ time, format, amPmLabels });
|
|
25
|
+
});
|
|
22
26
|
watch(parsed, (v) => intermediate.value = v, { immediate: true });
|
|
23
27
|
const updateModel = (field, value) => {
|
|
24
28
|
intermediate.value = { ...intermediate.value, [field]: value };
|