@attraccess/plugins-frontend-ui 0.0.16 → 1.5.2
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 +4956 -13
- package/lib/components/ResourceSelector/ResourceSelector.d.ts +2 -2
- 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 +22 -9
- package/package.json +5 -2
- package/index-BHGi6oGT.js +0 -2522
- package/index-BrgOHbDI.js +0 -17953
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
2
|
interface Props {
|
|
4
3
|
selection: number[];
|
|
5
4
|
onSelectionChange: (selection: number[]) => void;
|
|
5
|
+
multiple?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const ListboxWrapper: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function ResourceSelector(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function ResourceSelector(props: Readonly<Props>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -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 | bigint | boolean | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined>;
|
|
7
|
+
export declare function useFormatDateTime(date?: Date | string | number | null, options?: DateTimeOptions): string | number | bigint | boolean | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined>;
|
package/lib/i18n.d.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
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
|
+
interface TExistsOptions {
|
|
15
|
+
succeedIfKeyIsObject?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type TExists = (key: string, options?: TExistsOptions) => boolean;
|
|
18
|
+
interface UseTranslationsResponse {
|
|
19
|
+
t: TFunction;
|
|
20
|
+
tExists: TExists;
|
|
21
|
+
language: Language;
|
|
22
|
+
setLanguage: (language: Language) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function useTranslations(translations: TranslationModules): UseTranslationsResponse;
|
|
25
|
+
export declare function detectAndSetLanguage(): void;
|
|
13
26
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attraccess/plugins-frontend-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -18,5 +18,8 @@
|
|
|
18
18
|
"index*.js",
|
|
19
19
|
"index.d.ts",
|
|
20
20
|
"lib"
|
|
21
|
-
]
|
|
21
|
+
],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"babel-plugin-react-compiler": "^1.0.0"
|
|
24
|
+
}
|
|
22
25
|
}
|