@attraccess/plugins-frontend-ui 0.0.11 → 1.1.0
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/index.js +4580 -13
- package/lib/components/ResourceSelector/ResourceSelector.d.ts +0 -1
- package/lib/components/Trans/index.d.ts +11 -0
- package/lib/components/attraccess-user/AttraccessUser.d.ts +1 -2
- package/lib/components/datetime-display/DateTimeDisplay.d.ts +0 -1
- package/lib/components/duration-display/DurationDisplay.d.ts +0 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/user-search/UserSearch.d.ts +11 -2
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useFormatDateTime.d.ts +3 -2
- package/lib/hooks/useFormatNumber.d.ts +2 -0
- package/lib/i18n.d.ts +19 -9
- package/package.json +1 -1
- package/index-BHGi6oGT.js +0 -2522
- package/index-BrgOHbDI.js +0 -17953
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TFunction } from '../../i18n';
|
|
3
|
+
interface TransProps {
|
|
4
|
+
count?: number;
|
|
5
|
+
i18nKey: string;
|
|
6
|
+
values?: Record<string, unknown>;
|
|
7
|
+
components?: Record<string, React.ReactNode>;
|
|
8
|
+
t: TFunction;
|
|
9
|
+
}
|
|
10
|
+
export declare function I18nTransComponent(props: TransProps): React.ReactNode[];
|
|
11
|
+
export {};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { AutocompleteProps } from '@heroui/react';
|
|
3
|
+
import { User } from '../../../../../react-query-client/src/index.ts';
|
|
1
4
|
interface UserSearchProps {
|
|
2
5
|
label?: string;
|
|
3
6
|
placeholder?: string;
|
|
4
|
-
onSelectionChange?: (
|
|
7
|
+
onSelectionChange?: (user: User | null) => void;
|
|
8
|
+
autocompleteProps?: {
|
|
9
|
+
size?: AutocompleteProps['size'];
|
|
10
|
+
};
|
|
11
|
+
wrapperProps?: Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
12
|
+
afterAutocomplete?: React.ReactNode;
|
|
13
|
+
afterSelection?: React.ReactNode;
|
|
5
14
|
}
|
|
6
|
-
export declare function UserSearch(props: UserSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function UserSearch(props: Readonly<UserSearchProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
16
|
export {};
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface DateTimeOptions {
|
|
2
2
|
showTime?: boolean;
|
|
3
3
|
showDate?: boolean;
|
|
4
|
+
showSeconds?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare function useDateTimeFormatter(options?: DateTimeOptions): (date?: Date | string | number | null) => string
|
|
6
|
-
export declare function useFormatDateTime(date?: Date | string | number | null, options?: DateTimeOptions): string
|
|
6
|
+
export declare function useDateTimeFormatter(options?: DateTimeOptions): (date?: Date | string | number | null, fallback?: string | React.ReactNode) => string | number | boolean | import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode>;
|
|
7
|
+
export declare function useFormatDateTime(date?: Date | string | number | null, options?: DateTimeOptions): string | number | boolean | import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode>;
|
package/lib/i18n.d.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const i18n: import('i18next').i18n;
|
|
1
|
+
export declare const I18N_LANGUAGE_STORAGE_KEY = "language";
|
|
4
2
|
type TranslationRecord = Record<string, unknown>;
|
|
5
|
-
interface
|
|
6
|
-
|
|
3
|
+
interface TranslationModules<T extends TranslationRecord = TranslationRecord> {
|
|
4
|
+
en: T;
|
|
5
|
+
de: T;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
type Language = keyof TranslationModules;
|
|
8
|
+
interface TranslationState {
|
|
9
|
+
language: Language;
|
|
10
|
+
setLanguage: (language: Language) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare
|
|
12
|
+
export declare const useTranslationState: import('zustand').UseBoundStore<import('zustand').StoreApi<TranslationState>>;
|
|
13
|
+
export type TFunction = (key: string, data?: Record<string, unknown>) => string;
|
|
14
|
+
export type TExists = (key: string) => boolean;
|
|
15
|
+
interface UseTranslationsResponse {
|
|
16
|
+
t: TFunction;
|
|
17
|
+
tExists: TExists;
|
|
18
|
+
language: Language;
|
|
19
|
+
setLanguage: (language: Language) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function useTranslations(translations: TranslationModules): UseTranslationsResponse;
|
|
22
|
+
export declare function detectAndSetLanguage(): void;
|
|
13
23
|
export {};
|