@ya-accelerators/nextjs-framework 0.0.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/@types/general.d.ts +1 -0
- package/@types/image.d.ts +8 -0
- package/@types/next-auth.d.ts +18 -0
- package/dist/env.client.d.ts +3 -0
- package/dist/env.client.js +9 -0
- package/dist/env.client.js.map +1 -0
- package/dist/env.d.ts +6 -0
- package/dist/env.js +18 -0
- package/dist/env.js.map +1 -0
- package/dist/hooks/date/index.d.ts +11 -0
- package/dist/hooks/date/index.js +14 -0
- package/dist/hooks/date/index.js.map +1 -0
- package/dist/hooks/dispatch/index.d.ts +9 -0
- package/dist/hooks/dispatch/index.jsx +25 -0
- package/dist/hooks/dispatch/index.jsx.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/loading/index.d.ts +10 -0
- package/dist/hooks/loading/index.jsx +22 -0
- package/dist/hooks/loading/index.jsx.map +1 -0
- package/dist/hooks/localStorage/index.d.ts +1 -0
- package/dist/hooks/localStorage/index.js +53 -0
- package/dist/hooks/localStorage/index.js.map +1 -0
- package/dist/hooks/modal/index.d.ts +26 -0
- package/dist/hooks/modal/index.jsx +63 -0
- package/dist/hooks/modal/index.jsx.map +1 -0
- package/dist/hooks/toast/index.d.ts +15 -0
- package/dist/hooks/toast/index.jsx +39 -0
- package/dist/hooks/toast/index.jsx.map +1 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.js +40 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/strings/en-US.json +18 -0
- package/dist/i18n/strings/ja-JP.json +37 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cookie/index.d.ts +9 -0
- package/dist/lib/cookie/index.js +66 -0
- package/dist/lib/cookie/index.js.map +1 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/next-auth/index.d.ts +2 -0
- package/dist/lib/next-auth/index.js +62 -0
- package/dist/lib/next-auth/index.js.map +1 -0
- package/dist/lib/s3/index.d.ts +2 -0
- package/dist/lib/s3/index.js +17 -0
- package/dist/lib/s3/index.js.map +1 -0
- package/dist/lib/trpc/index.d.ts +8 -0
- package/dist/lib/trpc/index.js +32 -0
- package/dist/lib/trpc/index.js.map +1 -0
- package/dist/styles/globals.css +26 -0
- package/dist/styles/tailwind.config.d.ts +577 -0
- package/dist/styles/tailwind.config.js +671 -0
- package/dist/styles/tailwind.config.js.map +1 -0
- package/dist/styles/tailwind.config.ts +672 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/ui/component/button/base.d.ts +27 -0
- package/dist/ui/component/button/base.jsx +54 -0
- package/dist/ui/component/button/base.jsx.map +1 -0
- package/dist/ui/component/button/colored/index.d.ts +11 -0
- package/dist/ui/component/button/colored/index.jsx +7 -0
- package/dist/ui/component/button/colored/index.jsx.map +1 -0
- package/dist/ui/component/button/image/index.d.ts +4 -0
- package/dist/ui/component/button/image/index.jsx +5 -0
- package/dist/ui/component/button/image/index.jsx.map +1 -0
- package/dist/ui/component/button/index.d.ts +18 -0
- package/dist/ui/component/button/index.jsx +25 -0
- package/dist/ui/component/button/index.jsx.map +1 -0
- package/dist/ui/component/button/text/index.d.ts +11 -0
- package/dist/ui/component/button/text/index.jsx +8 -0
- package/dist/ui/component/button/text/index.jsx.map +1 -0
- package/dist/ui/component/card/index.d.ts +12 -0
- package/dist/ui/component/card/index.jsx +20 -0
- package/dist/ui/component/card/index.jsx.map +1 -0
- package/dist/ui/component/icon/index.d.ts +7 -0
- package/dist/ui/component/icon/index.jsx +3 -0
- package/dist/ui/component/icon/index.jsx.map +1 -0
- package/dist/ui/component/index.d.ts +95 -0
- package/dist/ui/component/index.js +15 -0
- package/dist/ui/component/index.js.map +1 -0
- package/dist/ui/component/loading/index.d.ts +5 -0
- package/dist/ui/component/loading/index.jsx +27 -0
- package/dist/ui/component/loading/index.jsx.map +1 -0
- package/dist/ui/component/ssr/index.d.ts +5 -0
- package/dist/ui/component/ssr/index.jsx +11 -0
- package/dist/ui/component/ssr/index.jsx.map +1 -0
- package/dist/ui/component/typography/H1/index.d.ts +7 -0
- package/dist/ui/component/typography/H1/index.jsx +13 -0
- package/dist/ui/component/typography/H1/index.jsx.map +1 -0
- package/dist/ui/component/typography/H2/index.d.ts +7 -0
- package/dist/ui/component/typography/H2/index.jsx +13 -0
- package/dist/ui/component/typography/H2/index.jsx.map +1 -0
- package/dist/ui/component/typography/H3/index.d.ts +7 -0
- package/dist/ui/component/typography/H3/index.jsx +13 -0
- package/dist/ui/component/typography/H3/index.jsx.map +1 -0
- package/dist/ui/component/typography/H4/index.d.ts +7 -0
- package/dist/ui/component/typography/H4/index.jsx +13 -0
- package/dist/ui/component/typography/H4/index.jsx.map +1 -0
- package/dist/ui/component/typography/H5/index.d.ts +7 -0
- package/dist/ui/component/typography/H5/index.jsx +13 -0
- package/dist/ui/component/typography/H5/index.jsx.map +1 -0
- package/dist/ui/component/typography/H6/index.d.ts +7 -0
- package/dist/ui/component/typography/H6/index.jsx +13 -0
- package/dist/ui/component/typography/H6/index.jsx.map +1 -0
- package/dist/ui/component/typography/Label/index.d.ts +7 -0
- package/dist/ui/component/typography/Label/index.jsx +13 -0
- package/dist/ui/component/typography/Label/index.jsx.map +1 -0
- package/dist/ui/component/typography/LinkText/index.d.ts +8 -0
- package/dist/ui/component/typography/LinkText/index.jsx +14 -0
- package/dist/ui/component/typography/LinkText/index.jsx.map +1 -0
- package/dist/ui/component/typography/P/index.d.ts +7 -0
- package/dist/ui/component/typography/P/index.jsx +13 -0
- package/dist/ui/component/typography/P/index.jsx.map +1 -0
- package/dist/ui/component/typography/Pre/index.d.ts +7 -0
- package/dist/ui/component/typography/Pre/index.jsx +13 -0
- package/dist/ui/component/typography/Pre/index.jsx.map +1 -0
- package/dist/ui/component/typography/index.d.ts +54 -0
- package/dist/ui/component/typography/index.jsx +23 -0
- package/dist/ui/component/typography/index.jsx.map +1 -0
- package/dist/ui/composite/button/index.d.ts +8 -0
- package/dist/ui/composite/button/index.jsx +45 -0
- package/dist/ui/composite/button/index.jsx.map +1 -0
- package/dist/ui/composite/dropdown/index.d.ts +12 -0
- package/dist/ui/composite/dropdown/index.jsx +102 -0
- package/dist/ui/composite/dropdown/index.jsx.map +1 -0
- package/dist/ui/composite/index.d.ts +342 -0
- package/dist/ui/composite/index.js +13 -0
- package/dist/ui/composite/index.js.map +1 -0
- package/dist/ui/composite/input/address/index.d.ts +33 -0
- package/dist/ui/composite/input/address/index.jsx +132 -0
- package/dist/ui/composite/input/address/index.jsx.map +1 -0
- package/dist/ui/composite/input/address/map.d.ts +64 -0
- package/dist/ui/composite/input/address/map.jsx +111 -0
- package/dist/ui/composite/input/address/map.jsx.map +1 -0
- package/dist/ui/composite/input/address/utils.d.ts +23 -0
- package/dist/ui/composite/input/address/utils.js +63 -0
- package/dist/ui/composite/input/address/utils.js.map +1 -0
- package/dist/ui/composite/input/checkbox/index.d.ts +22 -0
- package/dist/ui/composite/input/checkbox/index.jsx +38 -0
- package/dist/ui/composite/input/checkbox/index.jsx.map +1 -0
- package/dist/ui/composite/input/datePicker/index.d.ts +19 -0
- package/dist/ui/composite/input/datePicker/index.jsx +100 -0
- package/dist/ui/composite/input/datePicker/index.jsx.map +1 -0
- package/dist/ui/composite/input/dateRange/index.d.ts +14 -0
- package/dist/ui/composite/input/dateRange/index.jsx +46 -0
- package/dist/ui/composite/input/dateRange/index.jsx.map +1 -0
- package/dist/ui/composite/input/dateTimePicker/index.d.ts +15 -0
- package/dist/ui/composite/input/dateTimePicker/index.jsx +74 -0
- package/dist/ui/composite/input/dateTimePicker/index.jsx.map +1 -0
- package/dist/ui/composite/input/dateTimeRange/index.d.ts +14 -0
- package/dist/ui/composite/input/dateTimeRange/index.jsx +88 -0
- package/dist/ui/composite/input/dateTimeRange/index.jsx.map +1 -0
- package/dist/ui/composite/input/index.d.ts +216 -0
- package/dist/ui/composite/input/index.js +35 -0
- package/dist/ui/composite/input/index.js.map +1 -0
- package/dist/ui/composite/input/list/index.d.ts +20 -0
- package/dist/ui/composite/input/list/index.jsx +30 -0
- package/dist/ui/composite/input/list/index.jsx.map +1 -0
- package/dist/ui/composite/input/radio/index.d.ts +14 -0
- package/dist/ui/composite/input/radio/index.jsx +34 -0
- package/dist/ui/composite/input/radio/index.jsx.map +1 -0
- package/dist/ui/composite/input/search/index.d.ts +5 -0
- package/dist/ui/composite/input/search/index.jsx +38 -0
- package/dist/ui/composite/input/search/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/ClearIndicator/index.d.ts +4 -0
- package/dist/ui/composite/input/select/ClearIndicator/index.jsx +8 -0
- package/dist/ui/composite/input/select/ClearIndicator/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Control/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Control/index.jsx +23 -0
- package/dist/ui/composite/input/select/Control/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/DropdownIndicator/index.d.ts +4 -0
- package/dist/ui/composite/input/select/DropdownIndicator/index.jsx +8 -0
- package/dist/ui/composite/input/select/DropdownIndicator/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/GroupHeading/index.d.ts +4 -0
- package/dist/ui/composite/input/select/GroupHeading/index.jsx +9 -0
- package/dist/ui/composite/input/select/GroupHeading/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Input/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Input/index.jsx +7 -0
- package/dist/ui/composite/input/select/Input/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Menu/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Menu/index.jsx +19 -0
- package/dist/ui/composite/input/select/Menu/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/MultiValue/index.d.ts +4 -0
- package/dist/ui/composite/input/select/MultiValue/index.jsx +15 -0
- package/dist/ui/composite/input/select/MultiValue/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Option/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Option/index.jsx +79 -0
- package/dist/ui/composite/input/select/Option/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/Placeholder/index.d.ts +4 -0
- package/dist/ui/composite/input/select/Placeholder/index.jsx +7 -0
- package/dist/ui/composite/input/select/Placeholder/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/SelectContainer/index.d.ts +4 -0
- package/dist/ui/composite/input/select/SelectContainer/index.jsx +40 -0
- package/dist/ui/composite/input/select/SelectContainer/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/SingleValue/index.d.ts +4 -0
- package/dist/ui/composite/input/select/SingleValue/index.jsx +17 -0
- package/dist/ui/composite/input/select/SingleValue/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/index.d.ts +37 -0
- package/dist/ui/composite/input/select/index.jsx +242 -0
- package/dist/ui/composite/input/select/index.jsx.map +1 -0
- package/dist/ui/composite/input/select/types.d.ts +16 -0
- package/dist/ui/composite/input/select/types.js +6 -0
- package/dist/ui/composite/input/select/types.js.map +1 -0
- package/dist/ui/composite/input/text/index.d.ts +15 -0
- package/dist/ui/composite/input/text/index.jsx +40 -0
- package/dist/ui/composite/input/text/index.jsx.map +1 -0
- package/dist/ui/composite/input/textarea/index.d.ts +11 -0
- package/dist/ui/composite/input/textarea/index.jsx +62 -0
- package/dist/ui/composite/input/textarea/index.jsx.map +1 -0
- package/dist/ui/composite/input/timePicker/index.d.ts +13 -0
- package/dist/ui/composite/input/timePicker/index.jsx +36 -0
- package/dist/ui/composite/input/timePicker/index.jsx.map +1 -0
- package/dist/ui/composite/input/timeRange/index.d.ts +16 -0
- package/dist/ui/composite/input/timeRange/index.jsx +54 -0
- package/dist/ui/composite/input/timeRange/index.jsx.map +1 -0
- package/dist/ui/composite/input/weekDaysSelector/index.d.ts +11 -0
- package/dist/ui/composite/input/weekDaysSelector/index.jsx +39 -0
- package/dist/ui/composite/input/weekDaysSelector/index.jsx.map +1 -0
- package/dist/ui/composite/input/weekdayPicker/index.d.ts +13 -0
- package/dist/ui/composite/input/weekdayPicker/index.jsx +49 -0
- package/dist/ui/composite/input/weekdayPicker/index.jsx.map +1 -0
- package/dist/ui/composite/label/index.d.ts +11 -0
- package/dist/ui/composite/label/index.jsx +18 -0
- package/dist/ui/composite/label/index.jsx.map +1 -0
- package/dist/ui/composite/pageTitle/index.d.ts +18 -0
- package/dist/ui/composite/pageTitle/index.jsx +62 -0
- package/dist/ui/composite/pageTitle/index.jsx.map +1 -0
- package/dist/ui/functional/index.d.ts +10 -0
- package/dist/ui/functional/index.js +9 -0
- package/dist/ui/functional/index.js.map +1 -0
- package/dist/ui/functional/notFound/index.d.ts +1 -0
- package/dist/ui/functional/notFound/index.jsx +13 -0
- package/dist/ui/functional/notFound/index.jsx.map +1 -0
- package/dist/ui/functional/signInForm/index.d.ts +4 -0
- package/dist/ui/functional/signInForm/index.jsx +45 -0
- package/dist/ui/functional/signInForm/index.jsx.map +1 -0
- package/dist/ui/functional/signOutForm/index.d.ts +3 -0
- package/dist/ui/functional/signOutForm/index.jsx +29 -0
- package/dist/ui/functional/signOutForm/index.jsx.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +7 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout/app/component.d.ts +59 -0
- package/dist/ui/layout/app/component.jsx +224 -0
- package/dist/ui/layout/app/component.jsx.map +1 -0
- package/dist/ui/layout/app/content/index.d.ts +9 -0
- package/dist/ui/layout/app/content/index.jsx +18 -0
- package/dist/ui/layout/app/content/index.jsx.map +1 -0
- package/dist/ui/layout/app/index.d.ts +18 -0
- package/dist/ui/layout/app/index.jsx +40 -0
- package/dist/ui/layout/app/index.jsx.map +1 -0
- package/dist/ui/layout/form/index.d.ts +68 -0
- package/dist/ui/layout/form/index.jsx +558 -0
- package/dist/ui/layout/form/index.jsx.map +1 -0
- package/dist/ui/layout/index.d.ts +356 -0
- package/dist/ui/layout/index.js +19 -0
- package/dist/ui/layout/index.js.map +1 -0
- package/dist/ui/layout/modal/index.d.ts +7 -0
- package/dist/ui/layout/modal/index.jsx +11 -0
- package/dist/ui/layout/modal/index.jsx.map +1 -0
- package/dist/ui/layout/object/index.d.ts +30 -0
- package/dist/ui/layout/object/index.jsx +145 -0
- package/dist/ui/layout/object/index.jsx.map +1 -0
- package/dist/ui/layout/root/index.d.ts +10 -0
- package/dist/ui/layout/root/index.jsx +31 -0
- package/dist/ui/layout/root/index.jsx.map +1 -0
- package/dist/ui/layout/root/provider/index.d.ts +7 -0
- package/dist/ui/layout/root/provider/index.jsx +26 -0
- package/dist/ui/layout/root/provider/index.jsx.map +1 -0
- package/dist/ui/layout/tab/component.d.ts +4 -0
- package/dist/ui/layout/tab/component.jsx +16 -0
- package/dist/ui/layout/tab/component.jsx.map +1 -0
- package/dist/ui/layout/tab/content/index.d.ts +8 -0
- package/dist/ui/layout/tab/content/index.jsx +8 -0
- package/dist/ui/layout/tab/content/index.jsx.map +1 -0
- package/dist/ui/layout/tab/index.d.ts +11 -0
- package/dist/ui/layout/tab/index.jsx +25 -0
- package/dist/ui/layout/tab/index.jsx.map +1 -0
- package/dist/ui/layout/table/index.d.ts +33 -0
- package/dist/ui/layout/table/index.jsx +283 -0
- package/dist/ui/layout/table/index.jsx.map +1 -0
- package/dist/ui/layout/toast/index.d.ts +7 -0
- package/dist/ui/layout/toast/index.jsx +18 -0
- package/dist/ui/layout/toast/index.jsx.map +1 -0
- package/dist/ui/theme/border/index.d.ts +28 -0
- package/dist/ui/theme/border/index.js +67 -0
- package/dist/ui/theme/border/index.js.map +1 -0
- package/dist/ui/theme/color/index.d.ts +32 -0
- package/dist/ui/theme/color/index.js +106 -0
- package/dist/ui/theme/color/index.js.map +1 -0
- package/dist/ui/theme/index.d.ts +4 -0
- package/dist/ui/theme/index.js +5 -0
- package/dist/ui/theme/index.js.map +1 -0
- package/dist/ui/theme/rounded/index.d.ts +9 -0
- package/dist/ui/theme/rounded/index.js +14 -0
- package/dist/ui/theme/rounded/index.js.map +1 -0
- package/dist/ui/theme/size/index.d.ts +15 -0
- package/dist/ui/theme/size/index.js +55 -0
- package/dist/ui/theme/size/index.js.map +1 -0
- package/dist/ui/types/index.d.ts +113 -0
- package/dist/ui/types/index.js +33 -0
- package/dist/ui/types/index.js.map +1 -0
- package/dist/util/client.d.ts +2 -0
- package/dist/util/client.js +4 -0
- package/dist/util/client.js.map +1 -0
- package/dist/util/date/impl.d.ts +7 -0
- package/dist/util/date/impl.js +22 -0
- package/dist/util/date/impl.js.map +1 -0
- package/dist/util/date/index.d.ts +17 -0
- package/dist/util/date/index.js +16 -0
- package/dist/util/date/index.js.map +1 -0
- package/dist/util/index.d.ts +17 -0
- package/dist/util/index.js +143 -0
- package/dist/util/index.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import * as form from './form';
|
|
2
|
+
import * as table from './table';
|
|
3
|
+
export declare const Layout: {
|
|
4
|
+
Toast: ({ color, onClickClose, children, ...props }: {
|
|
5
|
+
color: import("..").ColorTypes;
|
|
6
|
+
onClickClose: () => void;
|
|
7
|
+
} & import("react").ComponentProps<({ border, shadow, selected, rounded, className, children, onClick, style, }: {
|
|
8
|
+
border?: boolean;
|
|
9
|
+
shadow?: boolean;
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
rounded?: import("..").Rounded;
|
|
12
|
+
className?: string;
|
|
13
|
+
children: import("react").ReactNode;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}) => import("react").JSX.Element>) => import("react").JSX.Element;
|
|
17
|
+
DataTable: <TData extends {
|
|
18
|
+
id: import("@dnd-kit/core").UniqueIdentifier;
|
|
19
|
+
href?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}, TValue>({ className, rounded, addtionalHeader, showTableHeader, headerBackgroundColor, headerTextColor, columns, emptyMessage, data: tmp, pagination, sort, rowSelect, }: {
|
|
22
|
+
className?: string;
|
|
23
|
+
rounded?: import("..").Rounded;
|
|
24
|
+
addtionalHeader?: import("react").ReactNode;
|
|
25
|
+
showTableHeader?: boolean;
|
|
26
|
+
headerBackgroundColor?: import("..").ColorTypes;
|
|
27
|
+
headerTextColor?: import("..").TextColorTypes;
|
|
28
|
+
columns: import("@tanstack/react-table").ColumnDef<TData, TValue>[];
|
|
29
|
+
emptyMessage?: import("react").ReactNode;
|
|
30
|
+
data: TData[];
|
|
31
|
+
pagination?: {
|
|
32
|
+
count: number;
|
|
33
|
+
page: number;
|
|
34
|
+
onPageSelected?: (page: number) => void;
|
|
35
|
+
};
|
|
36
|
+
sort?: {
|
|
37
|
+
isRouterSortEnabled: boolean;
|
|
38
|
+
orderBy?: Record<string, "asc" | "desc">[];
|
|
39
|
+
excludeHeaders?: string[];
|
|
40
|
+
dndEnabled?: boolean;
|
|
41
|
+
onSorted?: (data: TData[]) => void;
|
|
42
|
+
};
|
|
43
|
+
rowSelect?: (data: TData) => void;
|
|
44
|
+
}) => import("react").JSX.Element;
|
|
45
|
+
Tab: ({ items, title, children, className, contentClassName, }: {
|
|
46
|
+
items: import("react").ComponentProps<typeof import("./tab/component").TabItem>[];
|
|
47
|
+
title?: import("react").ComponentProps<({ routes, title, actions, back, keepRoutesSpace, showTitle, className, }: {
|
|
48
|
+
routes?: {
|
|
49
|
+
label: string;
|
|
50
|
+
href: string;
|
|
51
|
+
}[];
|
|
52
|
+
title: string;
|
|
53
|
+
actions?: {
|
|
54
|
+
path: string;
|
|
55
|
+
button?: import("react").ComponentProps<typeof import("../composite/button").Button>;
|
|
56
|
+
content?: import("react").ReactNode;
|
|
57
|
+
}[];
|
|
58
|
+
back?: boolean;
|
|
59
|
+
keepRoutesSpace?: boolean;
|
|
60
|
+
showTitle?: boolean;
|
|
61
|
+
className?: string;
|
|
62
|
+
}) => import("react").JSX.Element>;
|
|
63
|
+
children: import("react").ReactNode;
|
|
64
|
+
className?: string;
|
|
65
|
+
contentClassName?: string;
|
|
66
|
+
}) => import("react").JSX.Element;
|
|
67
|
+
TabContent: ({ title, children, className, contentClassName, }: {
|
|
68
|
+
title?: Omit<import("react").ComponentProps<({ routes, title, actions, back, keepRoutesSpace, showTitle, className, }: {
|
|
69
|
+
routes?: {
|
|
70
|
+
label: string;
|
|
71
|
+
href: string;
|
|
72
|
+
}[];
|
|
73
|
+
title: string;
|
|
74
|
+
actions?: {
|
|
75
|
+
path: string;
|
|
76
|
+
button?: import("react").ComponentProps<typeof import("../composite/button").Button>;
|
|
77
|
+
content?: import("react").ReactNode;
|
|
78
|
+
}[];
|
|
79
|
+
back?: boolean;
|
|
80
|
+
keepRoutesSpace?: boolean;
|
|
81
|
+
showTitle?: boolean;
|
|
82
|
+
className?: string;
|
|
83
|
+
}) => import("react").JSX.Element>, "keepRoutesSpace">;
|
|
84
|
+
children: import("react").ReactNode;
|
|
85
|
+
className?: string;
|
|
86
|
+
contentClassName?: string;
|
|
87
|
+
}) => import("react").JSX.Element;
|
|
88
|
+
Root: ({ children, htmlClassName, bodyClassName, bodyStyle, minWidth, overrideTheme, loaderColor, }: {
|
|
89
|
+
children: import("react").ReactNode;
|
|
90
|
+
htmlClassName?: string;
|
|
91
|
+
bodyClassName?: string;
|
|
92
|
+
bodyStyle?: import("react").CSSProperties;
|
|
93
|
+
minWidth: number;
|
|
94
|
+
overrideTheme?: "light" | "dark";
|
|
95
|
+
loaderColor: string;
|
|
96
|
+
}) => Promise<import("react").JSX.Element>;
|
|
97
|
+
ObjectView: <T extends Record<string, unknown>>({ name, obj, layout, overrides, additionals, className, itemOrientation, itemClassName, labelWidth, container, }: {
|
|
98
|
+
name: string;
|
|
99
|
+
obj: T;
|
|
100
|
+
layout?: (keyof T)[][] | undefined;
|
|
101
|
+
overrides?: { [K in keyof T]?: Partial<Omit<{
|
|
102
|
+
key: string;
|
|
103
|
+
label?: string;
|
|
104
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
105
|
+
}, "key">> | undefined; } | undefined;
|
|
106
|
+
additionals?: {
|
|
107
|
+
key: string;
|
|
108
|
+
label?: string;
|
|
109
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
110
|
+
}[] | {
|
|
111
|
+
key: string;
|
|
112
|
+
label?: string;
|
|
113
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
114
|
+
}[][] | ((false | {
|
|
115
|
+
key: string;
|
|
116
|
+
label?: string;
|
|
117
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
118
|
+
} | undefined)[] | (false | {
|
|
119
|
+
key: string;
|
|
120
|
+
label?: string;
|
|
121
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
122
|
+
} | undefined)[][] | false | undefined)[];
|
|
123
|
+
className?: string;
|
|
124
|
+
} & {
|
|
125
|
+
itemOrientation?: "horizontal" | "vertical";
|
|
126
|
+
itemClassName?: string;
|
|
127
|
+
labelWidth?: number;
|
|
128
|
+
container?: boolean;
|
|
129
|
+
}) => import("react").JSX.Element;
|
|
130
|
+
ObjectTable: <T extends Record<string, unknown>>({ name, obj, layout, overrides, additionals, firstColumnSize, ...restProps }: {
|
|
131
|
+
name: string;
|
|
132
|
+
obj: T;
|
|
133
|
+
layout?: (keyof T)[][] | undefined;
|
|
134
|
+
overrides?: { [K in keyof T]?: Partial<Omit<{
|
|
135
|
+
key: string;
|
|
136
|
+
label?: string;
|
|
137
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
138
|
+
}, "key">> | undefined; } | undefined;
|
|
139
|
+
additionals?: {
|
|
140
|
+
key: string;
|
|
141
|
+
label?: string;
|
|
142
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
143
|
+
}[] | {
|
|
144
|
+
key: string;
|
|
145
|
+
label?: string;
|
|
146
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
147
|
+
}[][] | ((false | {
|
|
148
|
+
key: string;
|
|
149
|
+
label?: string;
|
|
150
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
151
|
+
} | undefined)[] | (false | {
|
|
152
|
+
key: string;
|
|
153
|
+
label?: string;
|
|
154
|
+
value?: string | number | boolean | null | import("react").ReactNode;
|
|
155
|
+
} | undefined)[][] | false | undefined)[];
|
|
156
|
+
className?: string;
|
|
157
|
+
} & Omit<import("react").ComponentProps<typeof table.DataTable>, "data" | "columns"> & {
|
|
158
|
+
firstColumnSize?: number;
|
|
159
|
+
}) => import("react").JSX.Element;
|
|
160
|
+
Modal: ({ showCloseButton, onClickClose, id, className, children, ...props }: {
|
|
161
|
+
showCloseButton?: boolean;
|
|
162
|
+
onClickClose?: (id?: string) => void;
|
|
163
|
+
id?: string;
|
|
164
|
+
} & import("react").ComponentProps<({ border, shadow, selected, rounded, className, children, onClick, style, }: {
|
|
165
|
+
border?: boolean;
|
|
166
|
+
shadow?: boolean;
|
|
167
|
+
selected?: boolean;
|
|
168
|
+
rounded?: import("..").Rounded;
|
|
169
|
+
className?: string;
|
|
170
|
+
children: import("react").ReactNode;
|
|
171
|
+
onClick?: () => void;
|
|
172
|
+
style?: React.CSSProperties;
|
|
173
|
+
}) => import("react").JSX.Element>) => import("react").JSX.Element;
|
|
174
|
+
Form: <T, U>({ singlePage, name, title, actions, items, submitButton, cancelButton, disabled, className, rounded, container, }: {
|
|
175
|
+
singlePage?: boolean;
|
|
176
|
+
name: string;
|
|
177
|
+
title?: string;
|
|
178
|
+
actions: {
|
|
179
|
+
validate?: (data: T) => Promise<void>;
|
|
180
|
+
confirm?: Omit<import("../..").ModalProps, "rounded" | "actions">;
|
|
181
|
+
submit: (data: T) => Promise<U>;
|
|
182
|
+
onSuccess?: {
|
|
183
|
+
toast?: string;
|
|
184
|
+
} & ({
|
|
185
|
+
replace: string;
|
|
186
|
+
} | {
|
|
187
|
+
back: true;
|
|
188
|
+
} | {
|
|
189
|
+
callback?: ((result?: U | undefined) => void) | undefined;
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
items: ((false | import("..").FormItem | undefined)[] | (false | import("..").FormItem | undefined)[][] | false | undefined)[];
|
|
193
|
+
submitButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
194
|
+
variant: "colored";
|
|
195
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
196
|
+
variant: "text";
|
|
197
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
198
|
+
variant: "image";
|
|
199
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
200
|
+
cancelButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
201
|
+
variant: "colored";
|
|
202
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
203
|
+
variant: "text";
|
|
204
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
205
|
+
variant: "image";
|
|
206
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
207
|
+
disabled?: boolean;
|
|
208
|
+
className?: string;
|
|
209
|
+
rounded?: import("..").Rounded;
|
|
210
|
+
container?: boolean;
|
|
211
|
+
}) => import("react").JSX.Element;
|
|
212
|
+
PagedForm: <T, U>({ rounded, title, actions, submitButton, cancelButton, disabled, className, pages, }: {
|
|
213
|
+
rounded?: import("..").Rounded;
|
|
214
|
+
title?: string;
|
|
215
|
+
actions: {
|
|
216
|
+
submit: (data: T) => Promise<U>;
|
|
217
|
+
confirm?: Omit<import("../..").ModalProps, "rounded" | "actions">;
|
|
218
|
+
onSuccess?: {
|
|
219
|
+
toast?: string;
|
|
220
|
+
} & ({
|
|
221
|
+
replace: string;
|
|
222
|
+
} | {
|
|
223
|
+
back: true;
|
|
224
|
+
} | {
|
|
225
|
+
callback?: ((result?: U | undefined) => void) | undefined;
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
submitButton: import("react").ComponentProps<({ variant, ...props }: ({
|
|
229
|
+
variant: "colored";
|
|
230
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
231
|
+
variant: "text";
|
|
232
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
233
|
+
variant: "image";
|
|
234
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
235
|
+
cancelButton: import("react").ComponentProps<({ variant, ...props }: ({
|
|
236
|
+
variant: "colored";
|
|
237
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
238
|
+
variant: "text";
|
|
239
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
240
|
+
variant: "image";
|
|
241
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
242
|
+
disabled?: boolean;
|
|
243
|
+
className?: string;
|
|
244
|
+
pages: {
|
|
245
|
+
name: string;
|
|
246
|
+
title?: string;
|
|
247
|
+
items: Pick<import("react").ComponentProps<typeof form.Form>, "items">["items"];
|
|
248
|
+
validate?: (data: never) => Promise<void>;
|
|
249
|
+
}[];
|
|
250
|
+
}) => import("react").JSX.Element;
|
|
251
|
+
ActionForm: <T, U, Items extends readonly {
|
|
252
|
+
name: string;
|
|
253
|
+
}[]>({ items, layout, overrides, additionals, submitButton, ...props }: {
|
|
254
|
+
items: Items;
|
|
255
|
+
layout?: Items[number]["name"][][] | undefined;
|
|
256
|
+
overrides?: { [K in Items[number]["name"]]?: (Partial<Omit<import("..").FormElement, "name" | "required">> | Partial<Omit<import("..").FormInputHidden, "name" | "required">> | Partial<Omit<import("..").FormInputText, "name" | "required">> | Partial<Omit<import("..").FormInputTextArea, "name" | "required">> | Partial<Omit<import("..").FormInputSelect, "name" | "required">> | Partial<Omit<import("..").FormInputCheckbox, "name" | "required">> | Partial<Omit<import("..").FormInputRadio, "name" | "required">> | Partial<Omit<import("..").FormInputWeekday, "name" | "required">> | Partial<Omit<import("..").FormInputWeekdays, "name" | "required">> | Partial<Omit<import("..").FormInputDate, "name" | "required">> | Partial<Omit<import("..").FormInputDateRange, "name" | "required">> | Partial<Omit<import("..").FormInputTime, "name" | "required">> | Partial<Omit<import("..").FormInputTimeRange, "name" | "required">> | Partial<Omit<import("..").FormInputDateTime, "name" | "required">> | Partial<Omit<import("..").FormInputDateTimeRange, "name" | "required">> | Partial<Omit<import("..").FormInputList, "name" | "required">> | Partial<Omit<import("..").FormInputAddress, "name" | "required">>) | import("..").FormItem[] | import("..").FormItem[][] | undefined; } | undefined;
|
|
257
|
+
additionals?: import("..").FormItem[] | import("..").FormItem[][] | ((false | import("..").FormItem | undefined)[] | (false | import("..").FormItem | undefined)[][] | false | undefined)[];
|
|
258
|
+
submitButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
259
|
+
variant: "colored";
|
|
260
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
261
|
+
variant: "text";
|
|
262
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
263
|
+
variant: "image";
|
|
264
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
265
|
+
} & Omit<{
|
|
266
|
+
singlePage?: boolean;
|
|
267
|
+
name: string;
|
|
268
|
+
title?: string;
|
|
269
|
+
actions: {
|
|
270
|
+
validate?: ((data: T) => Promise<void>) | undefined;
|
|
271
|
+
confirm?: Omit<import("../..").ModalProps, "rounded" | "actions">;
|
|
272
|
+
submit: (data: T) => Promise<U>;
|
|
273
|
+
onSuccess?: ({
|
|
274
|
+
toast?: string;
|
|
275
|
+
} & ({
|
|
276
|
+
replace: string;
|
|
277
|
+
} | {
|
|
278
|
+
back: true;
|
|
279
|
+
} | {
|
|
280
|
+
callback?: ((result?: U | undefined) => void) | undefined;
|
|
281
|
+
})) | undefined;
|
|
282
|
+
};
|
|
283
|
+
items: ((false | import("..").FormItem | undefined)[] | (false | import("..").FormItem | undefined)[][] | false | undefined)[];
|
|
284
|
+
submitButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
285
|
+
variant: "colored";
|
|
286
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
287
|
+
variant: "text";
|
|
288
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
289
|
+
variant: "image";
|
|
290
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
291
|
+
cancelButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
292
|
+
variant: "colored";
|
|
293
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
294
|
+
variant: "text";
|
|
295
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
296
|
+
variant: "image";
|
|
297
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
298
|
+
disabled?: boolean;
|
|
299
|
+
className?: string;
|
|
300
|
+
rounded?: import("..").Rounded;
|
|
301
|
+
container?: boolean;
|
|
302
|
+
}, "items">) => import("react").JSX.Element;
|
|
303
|
+
AppContent: ({ title, children, className, contentClassName, }: {
|
|
304
|
+
title?: import("react").ComponentProps<({ routes, title, actions, back, keepRoutesSpace, showTitle, className, }: {
|
|
305
|
+
routes?: {
|
|
306
|
+
label: string;
|
|
307
|
+
href: string;
|
|
308
|
+
}[];
|
|
309
|
+
title: string;
|
|
310
|
+
actions?: {
|
|
311
|
+
path: string;
|
|
312
|
+
button?: import("react").ComponentProps<typeof import("../composite/button").Button>;
|
|
313
|
+
content?: import("react").ReactNode;
|
|
314
|
+
}[];
|
|
315
|
+
back?: boolean;
|
|
316
|
+
keepRoutesSpace?: boolean;
|
|
317
|
+
showTitle?: boolean;
|
|
318
|
+
className?: string;
|
|
319
|
+
}) => import("react").JSX.Element>;
|
|
320
|
+
children: import("react").ReactNode;
|
|
321
|
+
className?: string;
|
|
322
|
+
contentClassName?: string;
|
|
323
|
+
}) => import("react").JSX.Element;
|
|
324
|
+
App: ({ header, sidemenu, globalmenu, children, }: {
|
|
325
|
+
header?: {
|
|
326
|
+
divider?: boolean;
|
|
327
|
+
leading?: import("react").ReactNode;
|
|
328
|
+
leadingButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
329
|
+
variant: "colored";
|
|
330
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
331
|
+
variant: "text";
|
|
332
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
333
|
+
variant: "image";
|
|
334
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
335
|
+
center?: import("react").ReactNode;
|
|
336
|
+
centerButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
337
|
+
variant: "colored";
|
|
338
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
339
|
+
variant: "text";
|
|
340
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
341
|
+
variant: "image";
|
|
342
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
343
|
+
trailling?: import("react").ReactNode;
|
|
344
|
+
traillingButton?: import("react").ComponentProps<({ variant, ...props }: ({
|
|
345
|
+
variant: "colored";
|
|
346
|
+
} & import("react").ComponentProps<typeof import("../component/button/colored").Colored>) | ({
|
|
347
|
+
variant: "text";
|
|
348
|
+
} & import("react").ComponentProps<typeof import("../component/button/text").Text>) | ({
|
|
349
|
+
variant: "image";
|
|
350
|
+
} & import("react").ComponentProps<typeof import("../component/button/image").Imaged>)) => import("react").JSX.Element>;
|
|
351
|
+
};
|
|
352
|
+
globalmenu?: import("react").ComponentProps<typeof import("./app/component").GlobalMenu>;
|
|
353
|
+
sidemenu?: import("react").ComponentProps<typeof import("./app/component").SideMenu>;
|
|
354
|
+
children: import("react").ReactNode;
|
|
355
|
+
}) => import("react").JSX.Element;
|
|
356
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as app from './app';
|
|
2
|
+
import * as form from './form';
|
|
3
|
+
import * as modal from './modal';
|
|
4
|
+
import * as object from './object';
|
|
5
|
+
import * as root from './root';
|
|
6
|
+
import * as tab from './tab';
|
|
7
|
+
import * as table from './table';
|
|
8
|
+
import * as toast from './toast';
|
|
9
|
+
export const Layout = {
|
|
10
|
+
...app,
|
|
11
|
+
...form,
|
|
12
|
+
...modal,
|
|
13
|
+
...object,
|
|
14
|
+
...root,
|
|
15
|
+
...tab,
|
|
16
|
+
...table,
|
|
17
|
+
...toast,
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAA;AAC5B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAA;AAC5B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAEhC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,GAAG,GAAG;IACN,GAAG,IAAI;IACP,GAAG,KAAK;IACR,GAAG,MAAM;IACT,GAAG,IAAI;IACP,GAAG,GAAG;IACN,GAAG,KAAK;IACR,GAAG,KAAK;CACT,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { Component } from '../../component';
|
|
3
|
+
export declare const Modal: ({ showCloseButton, onClickClose, id, className, children, ...props }: {
|
|
4
|
+
showCloseButton?: boolean;
|
|
5
|
+
onClickClose?: (id?: string) => void;
|
|
6
|
+
id?: string;
|
|
7
|
+
} & ComponentProps<typeof Component.Card>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { Component } from '../../component';
|
|
5
|
+
export const Modal = ({ showCloseButton = true, onClickClose, id, className, children, ...props }) => (<Component.Card className={classNames('relative flex max-h-[80%] max-w-[90%] min-w-[300px] flex-col p-0! overflow-y-scroll', className)} {...props}>
|
|
6
|
+
<div className='gap-base flex size-full flex-col p-base'>{children}</div>
|
|
7
|
+
{showCloseButton && (<div className='p-base absolute inset-x-0 top-0 flex justify-end'>
|
|
8
|
+
<Component.Button variant='text' container={true} size='xl' icon={CloseIcon} onClick={() => onClickClose?.(id)}/>
|
|
9
|
+
</div>)}
|
|
10
|
+
</Component.Card>);
|
|
11
|
+
//# sourceMappingURL=index.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../../../src/ui/layout/modal/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,SAAS,MAAM,2BAA2B,CAAA;AACjD,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,eAAe,GAAG,IAAI,EACtB,YAAY,EACZ,EAAE,EACF,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EAGT,EAAE,EAAE,CAAC,CACJ,CAAC,SAAS,CAAC,IAAI,CACb,SAAS,CAAC,CAAC,UAAU,CACnB,qFAAqF,EACrF,SAAS,CACV,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;IAAA,CAAC,GAAG,CAAC,SAAS,CAAC,yCAAyC,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CACxE;IAAA,CAAC,eAAe,IAAI,CAClB,CAAC,GAAG,CAAC,SAAS,CAAC,kDAAkD,CAC/D;QAAA,CAAC,SAAS,CAAC,MAAM,CACf,OAAO,CAAC,MAAM,CACd,SAAS,CAAC,CAAC,IAAI,CAAC,CAChB,IAAI,CAAC,IAAI,CACT,IAAI,CAAC,CAAC,SAAS,CAAC,CAChB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,EAEtC;MAAA,EAAE,GAAG,CAAC,CACP,CACH;EAAA,EAAE,SAAS,CAAC,IAAI,CAAC,CAClB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { DataTable } from '../table';
|
|
3
|
+
type ObjectItem = {
|
|
4
|
+
key: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string | number | boolean | null | ReactNode;
|
|
7
|
+
};
|
|
8
|
+
type ReceveItemType = ObjectItem | false | undefined;
|
|
9
|
+
type ObjectItemOverride = Partial<Omit<ObjectItem, 'key'>>;
|
|
10
|
+
type ObjectBaseProps<T extends Record<string, unknown>> = {
|
|
11
|
+
name: string;
|
|
12
|
+
obj: T;
|
|
13
|
+
layout?: (keyof T)[][];
|
|
14
|
+
overrides?: {
|
|
15
|
+
[K in keyof T]?: ObjectItemOverride;
|
|
16
|
+
};
|
|
17
|
+
additionals?: ObjectItem[] | ObjectItem[][] | (ReceveItemType[] | ReceveItemType[][] | false | undefined)[];
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
type ObjectViewProps<T extends Record<string, unknown>> = ObjectBaseProps<T> & {
|
|
21
|
+
itemOrientation?: 'horizontal' | 'vertical';
|
|
22
|
+
itemClassName?: string;
|
|
23
|
+
labelWidth?: number;
|
|
24
|
+
container?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const ObjectView: <T extends Record<string, unknown>>({ name, obj, layout, overrides, additionals, className, itemOrientation, itemClassName, labelWidth, container, }: ObjectViewProps<T>) => import("react").JSX.Element;
|
|
27
|
+
export declare const ObjectTable: <T extends Record<string, unknown>>({ name, obj, layout, overrides, additionals, firstColumnSize, ...restProps }: ObjectBaseProps<T> & Omit<ComponentProps<typeof DataTable>, "data" | "columns"> & {
|
|
28
|
+
firstColumnSize?: number;
|
|
29
|
+
}) => import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
import { Component } from '../../component';
|
|
5
|
+
import { TextColorTypes } from '../../theme';
|
|
6
|
+
import { DataTable } from '../table';
|
|
7
|
+
export const ObjectView = ({ name, obj, layout, overrides, additionals, className, itemOrientation = 'vertical', itemClassName, labelWidth, container = true, }) => {
|
|
8
|
+
const actualItems = Object.keys(obj).map((key) => ({
|
|
9
|
+
key,
|
|
10
|
+
}));
|
|
11
|
+
// Create item map
|
|
12
|
+
const itemMap = actualItems.reduce((acc, item) => {
|
|
13
|
+
acc[item.key] = item;
|
|
14
|
+
return acc;
|
|
15
|
+
}, {});
|
|
16
|
+
// Apply layout or default to single column
|
|
17
|
+
const rows = layout ?? actualItems.map((item) => [item.key]);
|
|
18
|
+
// Resolve items with overrides
|
|
19
|
+
const resolvedItems = rows.map((row) => {
|
|
20
|
+
const rowItems = row.map((key) => {
|
|
21
|
+
const baseItem = itemMap[key];
|
|
22
|
+
const override = overrides?.[key];
|
|
23
|
+
const applyOverride = (overrideItem) => {
|
|
24
|
+
const merged = {
|
|
25
|
+
...baseItem,
|
|
26
|
+
...overrideItem,
|
|
27
|
+
};
|
|
28
|
+
merged.key = baseItem.key;
|
|
29
|
+
return merged;
|
|
30
|
+
};
|
|
31
|
+
if (override && baseItem) {
|
|
32
|
+
return [[applyOverride(override)]];
|
|
33
|
+
}
|
|
34
|
+
return [[baseItem]];
|
|
35
|
+
});
|
|
36
|
+
const maxDepth = Math.max(...rowItems.map((items) => items.length), 1);
|
|
37
|
+
return Array.from({ length: maxDepth }, (_, depth) => {
|
|
38
|
+
return rowItems.flatMap((items) => {
|
|
39
|
+
return items[depth] || [];
|
|
40
|
+
});
|
|
41
|
+
}).filter((row) => row.length > 0);
|
|
42
|
+
});
|
|
43
|
+
const normalizedAdditionals = additionals
|
|
44
|
+
? Array.isArray(additionals) && additionals.length > 0 && !Array.isArray(additionals[0])
|
|
45
|
+
? [additionals]
|
|
46
|
+
: Array.isArray(additionals) &&
|
|
47
|
+
additionals.length > 0 &&
|
|
48
|
+
Array.isArray(additionals[0]) &&
|
|
49
|
+
!Array.isArray(additionals[0][0])
|
|
50
|
+
? additionals
|
|
51
|
+
: additionals
|
|
52
|
+
: [];
|
|
53
|
+
const allItems = [...resolvedItems, ...normalizedAdditionals];
|
|
54
|
+
return (<div className={classNames('flex flex-col gap-md', className)}>
|
|
55
|
+
{allItems
|
|
56
|
+
.filter((x) => x !== false && x !== undefined)
|
|
57
|
+
.map((item, i) => (<div key={i}>
|
|
58
|
+
{item
|
|
59
|
+
.filter((x) => x !== false && x !== undefined)
|
|
60
|
+
.map((x, j) => (<div key={`${i}-${j}`} className='flex w-full items-start'>
|
|
61
|
+
{Array.isArray(x)
|
|
62
|
+
? x
|
|
63
|
+
.filter((y) => y !== false && y !== undefined)
|
|
64
|
+
.map((y, k) => (<RenderItem key={`${i}-${j}-${k}`} objName={name} item={y} obj={obj} orientation={itemOrientation} className={itemClassName} labelWidth={labelWidth} container={container}/>))
|
|
65
|
+
: x && (<RenderItem key={`${i}-${j}`} objName={name} item={x} obj={obj} orientation={itemOrientation} className={itemClassName} labelWidth={labelWidth} container={container}/>)}
|
|
66
|
+
</div>))}
|
|
67
|
+
</div>))}
|
|
68
|
+
</div>);
|
|
69
|
+
};
|
|
70
|
+
const RenderItem = ({ objName, item, obj, orientation, className, labelWidth, container, }) => {
|
|
71
|
+
const value = item.value ?? obj[item.key];
|
|
72
|
+
const isReactNode = typeof value === 'object' && value !== undefined && value !== null && '$$typeof' in value;
|
|
73
|
+
return (<div className={classNames('flex w-full', orientation === 'horizontal' ? 'flex-row' : 'flex-col', className)}>
|
|
74
|
+
<Component.Typography.P color={TextColorTypes.sub} style={{ width: labelWidth }} container={container} className='text-sm'>
|
|
75
|
+
{item.label || `${objName}.${item.key}`}
|
|
76
|
+
</Component.Typography.P>
|
|
77
|
+
{isReactNode ? (<div>{value}</div>) : (<Component.Typography.P color={TextColorTypes.main} container={container}>
|
|
78
|
+
{value === undefined || value === null ? '-' : String(value)}
|
|
79
|
+
</Component.Typography.P>)}
|
|
80
|
+
</div>);
|
|
81
|
+
};
|
|
82
|
+
export const ObjectTable = ({ name, obj, layout, overrides, additionals, firstColumnSize, ...restProps }) => {
|
|
83
|
+
const t = useTranslations();
|
|
84
|
+
const actualItems = Object.keys(obj).map((key) => ({
|
|
85
|
+
key,
|
|
86
|
+
}));
|
|
87
|
+
// Apply layout or default to single column
|
|
88
|
+
const rows = layout ?? actualItems.map((item) => [item.key]);
|
|
89
|
+
// Resolve items with overrides
|
|
90
|
+
const resolvedItems = rows
|
|
91
|
+
.flatMap((row) => {
|
|
92
|
+
return row.map((key) => {
|
|
93
|
+
const baseItem = actualItems.find((item) => item.key === key);
|
|
94
|
+
const override = overrides?.[key];
|
|
95
|
+
if (override && baseItem) {
|
|
96
|
+
const merged = {
|
|
97
|
+
...baseItem,
|
|
98
|
+
...override,
|
|
99
|
+
};
|
|
100
|
+
merged.key = baseItem.key;
|
|
101
|
+
return merged;
|
|
102
|
+
}
|
|
103
|
+
return baseItem;
|
|
104
|
+
});
|
|
105
|
+
})
|
|
106
|
+
.filter((item) => item !== undefined);
|
|
107
|
+
const normalizedAdditionals = additionals
|
|
108
|
+
? Array.isArray(additionals) && additionals.length > 0 && !Array.isArray(additionals[0])
|
|
109
|
+
? additionals
|
|
110
|
+
: Array.isArray(additionals) &&
|
|
111
|
+
additionals.length > 0 &&
|
|
112
|
+
Array.isArray(additionals[0]) &&
|
|
113
|
+
!Array.isArray(additionals[0][0])
|
|
114
|
+
? additionals.flat()
|
|
115
|
+
: []
|
|
116
|
+
: [];
|
|
117
|
+
const allItems = [...resolvedItems, ...normalizedAdditionals];
|
|
118
|
+
const items = allItems.map((item) => {
|
|
119
|
+
const value = item.value ?? obj[item.key];
|
|
120
|
+
return {
|
|
121
|
+
id: item.key,
|
|
122
|
+
key: item.key,
|
|
123
|
+
label: item.label,
|
|
124
|
+
value: value === undefined || value === null ? null : value,
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
return (<DataTable showTableHeader={false} columns={[
|
|
128
|
+
{
|
|
129
|
+
accessorKey: 'key',
|
|
130
|
+
header: 'key',
|
|
131
|
+
size: firstColumnSize,
|
|
132
|
+
cell: ({ row }) => t(row.original.label || `${name}.${row.original.key}`),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
accessorKey: 'value',
|
|
136
|
+
header: 'value',
|
|
137
|
+
cell: ({ row }) => {
|
|
138
|
+
const value = row.original.value;
|
|
139
|
+
const isReactNode = typeof value === 'object' && value !== undefined && value !== null && '$$typeof' in value;
|
|
140
|
+
return isReactNode ? (<div>{value}</div>) : (<>{value === undefined || value === null ? '-' : String(value)}</>);
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
]} data={items} {...restProps}/>);
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=index.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../../../src/ui/layout/object/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAGZ,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aA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,WAAW,CAAC,CAAC,CAAC,CACnB,CAAC,GAAG,CAAC,CAAC,KAAkB,CAAC,EAAE,GAAG,CAAC,CAChC,CAAC,CAAC,CAAC,CACF,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CACnE,CAAA;gBACH,CAAC;aACF;SACF,CAAC,CACF,IAAI,CAAC,CAAC,KAAK,CAAC,CACZ,IAAI,SAAS,CAAC,EACd,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export declare const Root: ({ children, htmlClassName, bodyClassName, bodyStyle, minWidth, overrideTheme, loaderColor, }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
htmlClassName?: string;
|
|
5
|
+
bodyClassName?: string;
|
|
6
|
+
bodyStyle?: CSSProperties;
|
|
7
|
+
minWidth: number;
|
|
8
|
+
overrideTheme?: "light" | "dark";
|
|
9
|
+
loaderColor: string;
|
|
10
|
+
}) => Promise<import("react").JSX.Element>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { CookiesProvider } from 'next-client-cookies/server';
|
|
5
|
+
import NextTopLoader from 'nextjs-toploader';
|
|
6
|
+
import { getCookieValue } from '../../../lib/cookie';
|
|
7
|
+
import { getBackgroundColorTypeClassName, getTextColorTypeClassName, TextColorTypes } from '../../theme';
|
|
8
|
+
import { Provider } from './provider';
|
|
9
|
+
export const Root = async ({ children, htmlClassName, bodyClassName, bodyStyle, minWidth, overrideTheme, loaderColor, }) => {
|
|
10
|
+
const mode = (await getCookieValue('theme')) ?? overrideTheme ?? '';
|
|
11
|
+
const { getLocale, getMessages } = await import('next-intl/server');
|
|
12
|
+
const locale = await getLocale();
|
|
13
|
+
const messages = await getMessages();
|
|
14
|
+
return (<html className={classNames('size-full', htmlClassName)} lang={locale}>
|
|
15
|
+
<body className={classNames(getTextColorTypeClassName(TextColorTypes.main, false), getBackgroundColorTypeClassName('default'), 'size-full min-h-screen', bodyClassName)} style={{
|
|
16
|
+
...bodyStyle,
|
|
17
|
+
minWidth,
|
|
18
|
+
}}>
|
|
19
|
+
<AppRouterCacheProvider>
|
|
20
|
+
<NextTopLoader showSpinner={false} color={loaderColor}/>
|
|
21
|
+
<input type='hidden' name='color-scheme' value={mode}/>
|
|
22
|
+
<CookiesProvider>
|
|
23
|
+
<Provider locale={locale} messages={messages}>
|
|
24
|
+
{children}
|
|
25
|
+
</Provider>
|
|
26
|
+
</CookiesProvider>
|
|
27
|
+
</AppRouterCacheProvider>
|
|
28
|
+
</body>
|
|
29
|
+
</html>);
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../../../src/ui/layout/root/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACxG,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EAAE,EACzB,QAAQ,EACR,aAAa,EACb,aAAa,EACb,SAAS,EACT,QAAQ,EACR,aAAa,EACb,WA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