vueless 0.0.483 → 0.0.484
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/adatper.locale/vueless.ts +3 -3
- package/composables/useUI.ts +2 -1
- package/package.json +1 -1
- package/types.ts +10 -3
- package/ui.form-calendar/UCalendar.vue +310 -370
- package/ui.form-calendar/UCalendarDayView.vue +211 -257
- package/ui.form-calendar/UCalendarMonthView.vue +120 -164
- package/ui.form-calendar/UCalendarYearView.vue +118 -164
- package/ui.form-calendar/{config.js → config.ts} +0 -2
- package/ui.form-calendar/{constants.js → constants.ts} +35 -16
- package/ui.form-calendar/storybook/Docs.mdx +2 -3
- package/ui.form-calendar/storybook/{stories.js → stories.ts} +12 -4
- package/ui.form-calendar/types.ts +91 -0
- package/ui.form-calendar/{useAttrs.js → useAttrs.ts} +5 -2
- package/ui.form-calendar/{utilCalendar.js → utilCalendar.ts} +50 -53
- package/ui.form-calendar/{utilDate.js → utilDate.ts} +44 -37
- package/ui.form-calendar/utilFormatting.ts +178 -0
- package/ui.text-badge/useAttrs.ts +2 -2
- package/ui.text-block/useAttrs.ts +1 -3
- package/web-types.json +177 -50
- package/ui.form-calendar/utilFormatting.js +0 -180
- package/ui.form-date-picker/storybook/Docs.mdx +0 -53
- package/ui.form-date-picker/storybook/stories.js +0 -185
- package/ui.form-date-picker-range/storybook/Docs.mdx +0 -16
- package/ui.form-date-picker-range/storybook/stories.js +0 -216
|
@@ -24,7 +24,7 @@ export interface LocaleInstance {
|
|
|
24
24
|
fallback: Ref<string>;
|
|
25
25
|
t: (key: string, ...params: unknown[]) => string;
|
|
26
26
|
n: (value: number) => string;
|
|
27
|
-
tm: (key: string
|
|
27
|
+
tm: <TMassages>(key: string) => Partial<TMassages>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const FALLBACK_LOCALE_CODE = "en";
|
|
@@ -86,7 +86,7 @@ function createTranslateMessageFunction(
|
|
|
86
86
|
fallback: Ref<string>,
|
|
87
87
|
messages: Ref<LocaleMessages>,
|
|
88
88
|
) {
|
|
89
|
-
return (key: string) => {
|
|
89
|
+
return <TMassages>(key: string): Partial<TMassages> => {
|
|
90
90
|
const currentLocale = current.value && messages.value[current.value];
|
|
91
91
|
const fallbackLocale = fallback.value && messages.value[fallback.value];
|
|
92
92
|
|
|
@@ -100,7 +100,7 @@ function createTranslateMessageFunction(
|
|
|
100
100
|
str = getObjectValueByPath(fallbackLocale, key, null);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
return
|
|
103
|
+
return str as TMassages;
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
|
package/composables/useUI.ts
CHANGED
|
@@ -32,6 +32,7 @@ import type {
|
|
|
32
32
|
CVA,
|
|
33
33
|
KeyAttrs,
|
|
34
34
|
KeysToExtend,
|
|
35
|
+
ExtendedKeyClasses,
|
|
35
36
|
} from "../types.ts";
|
|
36
37
|
|
|
37
38
|
interface MergedConfigOptions {
|
|
@@ -113,7 +114,7 @@ export default function useUI<T>(
|
|
|
113
114
|
* – value: reactive string of extendingKey classes.
|
|
114
115
|
*/
|
|
115
116
|
function getExtendingKeysClasses(extendingKeys: string[], mutatedProps = {}) {
|
|
116
|
-
const extendingClasses:
|
|
117
|
+
const extendingClasses: ExtendedKeyClasses = {};
|
|
117
118
|
|
|
118
119
|
for (const key of extendingKeys) {
|
|
119
120
|
extendingClasses[key] = getClasses(key, mutatedProps);
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -4,13 +4,18 @@ import { hasSlotContent } from "./composables/useUI.ts";
|
|
|
4
4
|
import UTextDefaultConfig from "./ui.text-block/config.ts";
|
|
5
5
|
import UButtonDefaultConfig from "./ui.button/config.ts";
|
|
6
6
|
import UBadgeDefaultConfig from "./ui.text-badge/config.ts";
|
|
7
|
+
import UCalendarDefaultConfig from "./ui.form-calendar/config.ts";
|
|
7
8
|
|
|
8
|
-
import type { ComputedRef, MaybeRef } from "vue";
|
|
9
|
+
import type { ComputedRef, MaybeRef, Ref } from "vue";
|
|
9
10
|
import type { Props } from "tippy.js";
|
|
10
11
|
import type { LocaleOptions } from "./adatper.locale/vueless.ts";
|
|
11
12
|
|
|
12
13
|
export type TemplateRefElement = MaybeRef<HTMLElement | HTMLElement[] | null>;
|
|
13
14
|
|
|
15
|
+
export interface ExtendedKeyClasses {
|
|
16
|
+
[key: string]: Ref<string>;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
export interface ThemeConfig {
|
|
15
20
|
/**
|
|
16
21
|
* Components brand (primary) color.
|
|
@@ -109,6 +114,7 @@ export interface Components {
|
|
|
109
114
|
UText?: Partial<typeof UTextDefaultConfig>;
|
|
110
115
|
UButton?: Partial<typeof UButtonDefaultConfig>;
|
|
111
116
|
UBadge?: Partial<typeof UBadgeDefaultConfig>;
|
|
117
|
+
UCalendar?: Partial<typeof UCalendarDefaultConfig>;
|
|
112
118
|
}
|
|
113
119
|
|
|
114
120
|
export interface Directives {
|
|
@@ -162,9 +168,10 @@ export interface VueAttrs {
|
|
|
162
168
|
value?: string;
|
|
163
169
|
}
|
|
164
170
|
|
|
165
|
-
export interface UseAttrs {
|
|
171
|
+
export interface UseAttrs<TConfig> {
|
|
166
172
|
hasSlotContent: typeof hasSlotContent;
|
|
167
|
-
|
|
173
|
+
config: Ref<TConfig | undefined>;
|
|
174
|
+
[key: string]: Ref<TConfig | undefined> | typeof hasSlotContent;
|
|
168
175
|
}
|
|
169
176
|
|
|
170
177
|
export interface KeyAttrs extends VueAttrs {
|