@starasia/admin 1.2.4 → 1.3.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/dist/components/AdvanceFilterBar/AdvanceFilterBar.d.ts +4 -0
- package/dist/components/AdvanceFilterBar/FilterDrawer.d.ts +61 -0
- package/dist/components/AdvanceFilterBar/index.d.ts +5 -0
- package/dist/components/AdvanceFilterBar/types.d.ts +53 -0
- package/dist/components/AdvanceFilterBar/utils.d.ts +31 -0
- package/dist/components/AppLayout/index.d.ts +38 -0
- package/dist/components/ModuleSwitcherModal/index.d.ts +15 -0
- package/dist/components/SidebarHeaderSlot/index.d.ts +31 -0
- package/dist/components/TableSection/components/ColumnFilterDropdown.d.ts +9 -0
- package/dist/components/TableSection/components/DataTable.d.ts +4 -0
- package/dist/components/TableSection/components/Footer.d.ts +4 -0
- package/dist/components/TableSection/components/Header.d.ts +19 -0
- package/dist/components/TableSection/components/TableSection.d.ts +4 -0
- package/dist/components/TableSection/components/Wrapper.d.ts +4 -0
- package/dist/components/TableSection/index.d.ts +7 -0
- package/dist/components/TableSection/types.d.ts +90 -0
- package/dist/components/index.d.ts +5 -4
- package/dist/entries/App/context.d.ts +12 -10
- package/dist/entries/App/hooks.d.ts +1 -1
- package/dist/entries/App/index.d.ts +9 -11
- package/dist/hooks/useDynamicTitle.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +5274 -4920
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/menu.d.ts +29 -0
- package/package.json +1 -1
- package/dist/components/ContentLayout/index.d.ts +0 -10
- package/dist/components/ContentLayoutV2/index.d.ts +0 -10
- package/dist/components/DashboardLayout/index.d.ts +0 -34
- package/dist/components/Header/MenuSelectButton.d.ts +0 -16
- package/dist/components/Header/MobileBottomDrawer.d.ts +0 -9
- package/dist/components/Header/PhotoProfile.d.ts +0 -11
- package/dist/components/Header/hooks.d.ts +0 -4
- package/dist/components/Header/index.d.ts +0 -37
- package/dist/components/HeaderV2/components/PhotoProfile.d.ts +0 -11
- package/dist/components/HeaderV2/components/UserProfile.d.ts +0 -9
- package/dist/components/HeaderV2/hooks.d.ts +0 -4
- package/dist/components/HeaderV2/index.d.ts +0 -6
- package/dist/components/Sidebar/components/Group.d.ts +0 -9
- package/dist/components/Sidebar/components/Item.d.ts +0 -13
- package/dist/components/Sidebar/components/Provider.d.ts +0 -5
- package/dist/components/Sidebar/components/Wrapper.d.ts +0 -10
- package/dist/components/Sidebar/context.d.ts +0 -32
- package/dist/components/Sidebar/hooks.d.ts +0 -4
- package/dist/components/Sidebar/index.d.ts +0 -15
- package/dist/components/Sidebar/types.d.ts +0 -18
- package/dist/components/SidebarV2/components/Group.d.ts +0 -7
- package/dist/components/SidebarV2/components/Item.d.ts +0 -7
- package/dist/components/SidebarV2/components/Wrapper.d.ts +0 -7
- package/dist/components/SidebarV2/index.d.ts +0 -7
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdvanceFilterBarProps } from './types';
|
|
3
|
+
|
|
4
|
+
export declare const AdvanceFilterBar: ({ searchKey, statusKey, searchPlaceholder, searchHighlightPlaceholder, extendedFilter, showSearchFilter, showStatusFilter, filterKey, pageKey, customWidthSearch, handleOnReset, filterConfigs, buttonToggleProps, position, titleSearchLabel, withTitleLabels }: AdvanceFilterBarProps) => React.JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IDateProps } from '@starasia/date';
|
|
3
|
+
import { IDropdown } from '@starasia/dropdown';
|
|
4
|
+
|
|
5
|
+
interface RadioFilterConfig {
|
|
6
|
+
type: 'radio';
|
|
7
|
+
title: string;
|
|
8
|
+
name: string;
|
|
9
|
+
radioList: {
|
|
10
|
+
id: number;
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
}[];
|
|
15
|
+
show?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface DropdownFilterConfig {
|
|
18
|
+
type: 'dropdown';
|
|
19
|
+
title: string;
|
|
20
|
+
name: string;
|
|
21
|
+
dropdownLists?: IDropdown['dropdownLists'];
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
onSearch?: (v: string) => void;
|
|
24
|
+
search?: string;
|
|
25
|
+
searchable?: boolean;
|
|
26
|
+
onClickContainer?: () => void;
|
|
27
|
+
show?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface DropdownMultipleFilterConfig {
|
|
30
|
+
type: 'dropdown-multiple';
|
|
31
|
+
title: string;
|
|
32
|
+
name: string;
|
|
33
|
+
dropdownLists?: {
|
|
34
|
+
label: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}[];
|
|
37
|
+
isLoading?: boolean;
|
|
38
|
+
onClickContainer?: () => void;
|
|
39
|
+
show?: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface DateRangeFilterConfig {
|
|
42
|
+
type: 'date-range';
|
|
43
|
+
title: string;
|
|
44
|
+
name: string;
|
|
45
|
+
}
|
|
46
|
+
interface DateFilterConfig {
|
|
47
|
+
type: 'date';
|
|
48
|
+
title: string;
|
|
49
|
+
name: string;
|
|
50
|
+
filter: IDateProps['filter'];
|
|
51
|
+
}
|
|
52
|
+
export type FilterConfig = RadioFilterConfig | DropdownFilterConfig | DropdownMultipleFilterConfig | DateRangeFilterConfig | DateFilterConfig;
|
|
53
|
+
interface FilterDrawerProps {
|
|
54
|
+
isOpen?: boolean;
|
|
55
|
+
onClose: () => void;
|
|
56
|
+
filterKey?: string;
|
|
57
|
+
pageKey?: string;
|
|
58
|
+
filters?: FilterConfig[];
|
|
59
|
+
}
|
|
60
|
+
export declare const FilterDrawer: ({ isOpen, onClose, filterKey, pageKey, filters }: FilterDrawerProps) => React.JSX.Element;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AdvanceFilterBar } from './AdvanceFilterBar';
|
|
2
|
+
export { FilterDrawer } from './FilterDrawer';
|
|
3
|
+
export type { FilterConfig } from './FilterDrawer';
|
|
4
|
+
export type { AdvanceFilterBarProps, TableFilterBarProps, ChangeHandler, ExtendedFilter, GetValuesFilterProps } from './types';
|
|
5
|
+
export { handleChangeFilter, getValueSearch, getValuesFilter, getValueDropdownMultipleFilter, getValueRadioFilter, getDateRangeFilterValue, getDateFilterValue, isFilterActive, resolveDropdownValueToString, resolveRadioValueToString, resolveDateRangeValueToString, resolveDateValueToString } from './utils';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { SetURLSearchParams } from 'react-router';
|
|
2
|
+
import { FilterConfig } from './FilterDrawer';
|
|
3
|
+
import { IconName } from '@starasia/icon';
|
|
4
|
+
|
|
5
|
+
export interface TableFilterBarProps {
|
|
6
|
+
titleSearchLabel?: string;
|
|
7
|
+
searchKey?: string;
|
|
8
|
+
statusKey?: string;
|
|
9
|
+
searchPlaceholder?: string;
|
|
10
|
+
searchHighlightPlaceholder?: string;
|
|
11
|
+
withSearchParam?: boolean;
|
|
12
|
+
extendedFilter?: ExtendedFilter[];
|
|
13
|
+
showStatusFilter?: boolean;
|
|
14
|
+
showSearchFilter?: boolean;
|
|
15
|
+
filterKey?: string;
|
|
16
|
+
pageKey?: string;
|
|
17
|
+
handleOnReset?: () => void;
|
|
18
|
+
customWidthSearch?: string;
|
|
19
|
+
withTitleLabels?: boolean;
|
|
20
|
+
position?: 'left' | 'right';
|
|
21
|
+
}
|
|
22
|
+
export interface AdvanceFilterBarProps extends Omit<TableFilterBarProps, 'withSearchParam'> {
|
|
23
|
+
filterConfigs?: FilterConfig[];
|
|
24
|
+
buttonToggleProps?: {
|
|
25
|
+
isShowLabel?: boolean;
|
|
26
|
+
icon?: IconName;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
type InputType = 'search' | 'dropdown' | 'date-range' | 'advanced-date-range' | 'radio' | 'dropdown-multiple' | 'date';
|
|
30
|
+
export type ChangeHandler = (params: {
|
|
31
|
+
value: any;
|
|
32
|
+
name?: string;
|
|
33
|
+
type?: InputType;
|
|
34
|
+
withSearchParam?: boolean;
|
|
35
|
+
setSearchParams: SetURLSearchParams;
|
|
36
|
+
searchQueries: Record<string, string>;
|
|
37
|
+
dropdownSearchKey?: string;
|
|
38
|
+
filterKey?: string;
|
|
39
|
+
pageKey?: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
export type ExtendedFilter = {
|
|
42
|
+
minWidth?: string;
|
|
43
|
+
title: string;
|
|
44
|
+
content: React.ReactNode;
|
|
45
|
+
onClickContainer?: () => void;
|
|
46
|
+
};
|
|
47
|
+
export type GetValuesFilterProps = {
|
|
48
|
+
searchParams: URLSearchParams;
|
|
49
|
+
filterKey?: string;
|
|
50
|
+
name: string;
|
|
51
|
+
get: 'value' | 'label';
|
|
52
|
+
};
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IDateRange } from '@starasia/date';
|
|
2
|
+
import { IDropdown } from '@starasia/dropdown';
|
|
3
|
+
import { ChangeHandler, GetValuesFilterProps } from './types';
|
|
4
|
+
|
|
5
|
+
export declare const resolveDropdownValueToString: (value: IDropdown["defaultValue"]) => string;
|
|
6
|
+
export declare const resolveRadioValueToString: (value: {
|
|
7
|
+
id: number;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}) => string;
|
|
11
|
+
export declare const resolveDateRangeValueToString: (value: IDateRange) => string;
|
|
12
|
+
export declare const resolveDateValueToString: (value: Date) => string;
|
|
13
|
+
export declare const handleChangeFilter: ChangeHandler;
|
|
14
|
+
export declare const getValuesFilter: ({ name, filterKey, searchParams, get }: GetValuesFilterProps) => any;
|
|
15
|
+
export declare const getValueDropdownMultipleFilter: ({ name, filterKey, searchParams, get }: Omit<GetValuesFilterProps, "get"> & {
|
|
16
|
+
get: "value" | "label" | "array";
|
|
17
|
+
}) => any;
|
|
18
|
+
export declare const getValueRadioFilter: ({ name, filterKey, searchParams, get }: Omit<GetValuesFilterProps, "get"> & {
|
|
19
|
+
get: "value" | "label" | "id";
|
|
20
|
+
}) => any;
|
|
21
|
+
export declare const getValueSearch: (name: string, searchParams: URLSearchParams, filterKey?: string) => any;
|
|
22
|
+
export declare const getDateRangeFilterValue: ({ name, filterKey, searchParams }: GetValuesFilterProps) => {
|
|
23
|
+
start: string;
|
|
24
|
+
end: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const getDateFilterValue: ({ name, filterKey, searchParams }: GetValuesFilterProps) => Date | undefined;
|
|
27
|
+
export declare const isFilterActive: (searchParams: URLSearchParams, { filterKey, perPageKey, pageKey }: {
|
|
28
|
+
filterKey?: string;
|
|
29
|
+
perPageKey?: string;
|
|
30
|
+
pageKey?: string;
|
|
31
|
+
}) => boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface AppLayoutProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
profile?: {
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
};
|
|
9
|
+
isLoadingProfile?: boolean;
|
|
10
|
+
onLogout: () => void;
|
|
11
|
+
headerRight?: ReactNode;
|
|
12
|
+
isLoggingOut?: boolean;
|
|
13
|
+
loadingComponent?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Content untuk sidebar header slot (dibawah logo)
|
|
16
|
+
* Dapat berupa: Organization Menu, User Switcher, Custom Component, atau kombinasinya
|
|
17
|
+
*/
|
|
18
|
+
sidebarHeaderContent?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Show/hide module switcher control in header (and its modal)
|
|
21
|
+
*/
|
|
22
|
+
showModuleSwitcher?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* AppLayout - Main application layout component based on workspace pattern
|
|
26
|
+
* Features:
|
|
27
|
+
* - Responsive sidebar with collapse/expand (mobile: full-width + overlay)
|
|
28
|
+
* - Accordion menu items with auto-expansion
|
|
29
|
+
* - Sidebar scroll position persistence
|
|
30
|
+
* - Module switcher modal with localStorage
|
|
31
|
+
* - Settings shortcuts dropdown
|
|
32
|
+
* - User profile & logout dialog
|
|
33
|
+
* - Mobile hamburger menu
|
|
34
|
+
* - Loading overlay support
|
|
35
|
+
* - Embed mode for iframes
|
|
36
|
+
*/
|
|
37
|
+
export declare function AppLayout({ children, headerRight, profile, isLoadingProfile, onLogout, isLoggingOut, loadingComponent, sidebarHeaderContent, showModuleSwitcher, }: AppLayoutProps): React.JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SidebarMenus } from '../../types';
|
|
3
|
+
|
|
4
|
+
export interface ModuleSwitcherModalProps {
|
|
5
|
+
isShow: boolean;
|
|
6
|
+
onHide: () => void;
|
|
7
|
+
menus: SidebarMenus;
|
|
8
|
+
selectedGroupId: number | null;
|
|
9
|
+
onSelect: (id: number | null) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* ModuleSwitcherModal - Module/namespace selector for the application
|
|
13
|
+
* Shows grid of available modules that can be selected to filter sidebar menus
|
|
14
|
+
*/
|
|
15
|
+
export declare function ModuleSwitcherModal({ isShow, onHide, menus, selectedGroupId, onSelect, }: ModuleSwitcherModalProps): React.JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SidebarHeaderSlotProps {
|
|
4
|
+
/**
|
|
5
|
+
* Collapsed state from sidebar
|
|
6
|
+
*/
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Content to display below logo - dapat berupa:
|
|
10
|
+
* - Organization menu
|
|
11
|
+
* - User switcher
|
|
12
|
+
* - Custom component
|
|
13
|
+
* - Atau kombinasi dari beberapa komponen
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* SidebarHeaderSlot - Flexible slot area dibawah logo sidebar
|
|
19
|
+
* Digunakan untuk menempatkan komponen apapun yang relevan dengan sidebar header
|
|
20
|
+
*
|
|
21
|
+
* Contoh penggunaan:
|
|
22
|
+
* <SidebarHeaderSlot collapsed={sidebarCollapsed}>
|
|
23
|
+
* <OrganizationMenu />
|
|
24
|
+
* </SidebarHeaderSlot>
|
|
25
|
+
*
|
|
26
|
+
* atau:
|
|
27
|
+
* <SidebarHeaderSlot collapsed={sidebarCollapsed}>
|
|
28
|
+
* <UserSwitcher />
|
|
29
|
+
* </SidebarHeaderSlot>
|
|
30
|
+
*/
|
|
31
|
+
export declare function SidebarHeaderSlot({ collapsed, children, }: SidebarHeaderSlotProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ColumnFilter } from '../types';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
filter: ColumnFilter;
|
|
6
|
+
columnTitle: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ColumnFilterDropdown: ({ filter, columnTitle }: Props) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseRecord, DataTableProps } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare const DataTable: <T extends BaseRecord>({ columns, records, handleDetail, handleUpdate, handleDelete, isLoading, visibleHandleDelete, visibleHandleUpdate, visibleHandleDetail, showHeadBorder, scrollParentRef, frozenCount, onFrozenCountChange, customActions, actionsOrder, customEmptyState }: DataTableProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { AdvanceFilterBarProps } from '../../AdvanceFilterBar/types';
|
|
3
|
+
import { ButtonProps } from '@starasia/button';
|
|
4
|
+
import { IconName } from '@starasia/icon';
|
|
5
|
+
|
|
6
|
+
interface ActionProps {
|
|
7
|
+
title?: string | ReactNode;
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
buttonProps?: ButtonProps;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export type TableHeaderProps = {
|
|
13
|
+
action?: ActionProps[] | React.ReactNode;
|
|
14
|
+
advanceFilter?: AdvanceFilterBarProps;
|
|
15
|
+
show?: boolean;
|
|
16
|
+
showFilter?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const TableHeader: ({ action, advanceFilter, showFilter }: TableHeaderProps) => React.JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { TableSection } from './components/TableSection';
|
|
2
|
+
export { TableWrapper } from './components/Wrapper';
|
|
3
|
+
export { TableHeader } from './components/Header';
|
|
4
|
+
export { TableFooter } from './components/Footer';
|
|
5
|
+
export { DataTable } from './components/DataTable';
|
|
6
|
+
export { ColumnFilterDropdown } from './components/ColumnFilterDropdown';
|
|
7
|
+
export type { TableSectionProps, BaseRecord, Column, ColumnFilter, DataTableProps, WrapperProps, TableHeaderProps, TableFooterProps } from './types';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { BoxProps } from '@starasia/box';
|
|
2
|
+
import { ButtonProps } from '@starasia/button';
|
|
3
|
+
import { IconName } from '@starasia/icon';
|
|
4
|
+
import { AdvanceFilterBarProps } from '../AdvanceFilterBar';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
export interface BaseRecord {
|
|
8
|
+
id: number | string;
|
|
9
|
+
}
|
|
10
|
+
type Accessor<T> = keyof T | ((record: T) => React.ReactNode) | string;
|
|
11
|
+
export interface ColumnFilter {
|
|
12
|
+
options: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
selectedValues: string[];
|
|
17
|
+
onFilterChange: (values: string[]) => void;
|
|
18
|
+
isLoadingOptions?: boolean;
|
|
19
|
+
position?: 'left' | 'right';
|
|
20
|
+
hideSearch?: boolean;
|
|
21
|
+
onOpen?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export interface Column<T> {
|
|
24
|
+
accessor?: Accessor<T>;
|
|
25
|
+
title: string;
|
|
26
|
+
textAlign?: 'text-left' | 'text-center' | 'text-right';
|
|
27
|
+
render?: (record: T, colIndex: number, records: T[]) => React.ReactNode;
|
|
28
|
+
bgColor?: (record: T, colIndex: number, records: T[]) => string;
|
|
29
|
+
showBorderLeft?: boolean;
|
|
30
|
+
showBorderRight?: boolean;
|
|
31
|
+
width?: string;
|
|
32
|
+
filter?: ColumnFilter;
|
|
33
|
+
}
|
|
34
|
+
export interface DataTableProps<T extends BaseRecord> {
|
|
35
|
+
columns: Column<T>[];
|
|
36
|
+
records?: T[];
|
|
37
|
+
handleDetail?: (id: number | string, item: T) => void;
|
|
38
|
+
handleUpdate?: (item: T) => void;
|
|
39
|
+
handleDelete?: (id: number | string, record: T) => void;
|
|
40
|
+
visibleHandleDelete?: (item: T) => boolean;
|
|
41
|
+
visibleHandleUpdate?: (item: T) => boolean;
|
|
42
|
+
visibleHandleDetail?: (item: T) => boolean;
|
|
43
|
+
pagination?: Pagination;
|
|
44
|
+
showHeadBorder?: boolean;
|
|
45
|
+
perPageKey?: string;
|
|
46
|
+
pageKey?: string;
|
|
47
|
+
isLoading?: boolean;
|
|
48
|
+
scrollParentRef?: React.RefObject<HTMLDivElement>;
|
|
49
|
+
defaultPerPage?: number;
|
|
50
|
+
showPagination?: boolean;
|
|
51
|
+
customEmptyState?: React.ReactNode;
|
|
52
|
+
enableFreezeColumns?: boolean;
|
|
53
|
+
defaultFrozenCount?: number;
|
|
54
|
+
frozenCount?: number;
|
|
55
|
+
onFrozenCountChange?: (count: number) => void;
|
|
56
|
+
customActions?: (record: T) => React.ReactNode;
|
|
57
|
+
actionsOrder?: Array<'detail' | 'update' | 'delete' | 'custom'>;
|
|
58
|
+
}
|
|
59
|
+
export type WrapperProps = {
|
|
60
|
+
children: React.ReactNode;
|
|
61
|
+
borderRadius?: BoxProps['borderRadius'];
|
|
62
|
+
};
|
|
63
|
+
interface ActionProps {
|
|
64
|
+
title?: string | ReactNode;
|
|
65
|
+
icon?: IconName;
|
|
66
|
+
buttonProps?: ButtonProps;
|
|
67
|
+
onClick?: () => void;
|
|
68
|
+
}
|
|
69
|
+
export type TableHeaderProps = {
|
|
70
|
+
action?: ActionProps[] | React.ReactNode;
|
|
71
|
+
advanceFilter?: AdvanceFilterBarProps;
|
|
72
|
+
show?: boolean;
|
|
73
|
+
showFilter?: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type TableFooterProps = {
|
|
76
|
+
pageKey?: string;
|
|
77
|
+
perPageKey?: string;
|
|
78
|
+
pagination?: Pagination;
|
|
79
|
+
defaultPerPage?: number;
|
|
80
|
+
showPagination?: boolean;
|
|
81
|
+
showFooter?: boolean;
|
|
82
|
+
totalData?: number;
|
|
83
|
+
};
|
|
84
|
+
export type TableSectionProps<T extends BaseRecord> = {
|
|
85
|
+
headerProps?: TableHeaderProps;
|
|
86
|
+
wrapperProps?: Omit<WrapperProps, 'children'>;
|
|
87
|
+
dataTableProps?: DataTableProps<T>;
|
|
88
|
+
footerProps?: Pick<TableFooterProps, 'showFooter' | 'totalData'>;
|
|
89
|
+
};
|
|
90
|
+
export {};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
export * from './AppLayout';
|
|
2
|
+
export * from './SidebarHeaderSlot';
|
|
3
|
+
export * from './ModuleSwitcherModal';
|
|
1
4
|
export * from './AuthLayout';
|
|
2
|
-
export * from './ContentLayout';
|
|
3
|
-
export * from './DashboardLayout';
|
|
4
|
-
export * from './Header';
|
|
5
5
|
export * from './HorizontalField';
|
|
6
6
|
export * from './ModalDialog';
|
|
7
7
|
export * from './PageLayout';
|
|
8
8
|
export * from './Pressable';
|
|
9
9
|
export * from './RightDrawer';
|
|
10
10
|
export * from './Section';
|
|
11
|
-
export * from './Sidebar';
|
|
12
11
|
export * from './ActionMenu';
|
|
13
12
|
export * from './AdvanceFilter';
|
|
13
|
+
export * from './AdvanceFilterBar';
|
|
14
|
+
export * from './TableSection';
|
|
14
15
|
export * from './EachUtils';
|
|
15
16
|
export * from './DecisionWrapper';
|
|
16
17
|
export * from './SwitchApps';
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MenuSelectButtonProps } from '../../components/Header/MenuSelectButton';
|
|
1
|
+
import { SidebarMenuItem, SidebarMenus } from '../../types';
|
|
3
2
|
|
|
4
3
|
export interface AppContextValue {
|
|
5
4
|
menus: SidebarMenus;
|
|
6
5
|
menuBottom?: SidebarMenuItem[];
|
|
7
|
-
userData:
|
|
8
|
-
|
|
6
|
+
userData: {
|
|
7
|
+
name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
photoURL?: string;
|
|
10
|
+
} | null;
|
|
11
|
+
setUserData: (value: {
|
|
12
|
+
name: string;
|
|
13
|
+
email: string;
|
|
14
|
+
photoURL?: string;
|
|
15
|
+
}) => void;
|
|
9
16
|
logo: string;
|
|
10
|
-
|
|
11
|
-
headerButtonsLeft?: HeaderButtonProps[];
|
|
12
|
-
menuSelectButtons?: MenuSelectButtonProps[];
|
|
13
|
-
menuSelectCustom?: React.ReactNode;
|
|
14
|
-
bottomDrawerContent?: React.ReactNode;
|
|
15
|
-
variant?: "default" | "simple";
|
|
17
|
+
appName: string;
|
|
16
18
|
}
|
|
17
19
|
export declare const AppContext: import('react').Context<AppContextValue>;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SidebarMenuItem, SidebarMenus } from '../../types';
|
|
3
3
|
import { ThemeObject } from '@starasia/theme';
|
|
4
|
-
import { MenuSelectButtonProps } from '../../components/Header/MenuSelectButton';
|
|
5
4
|
|
|
6
5
|
interface AppProps extends PropsWithChildren {
|
|
7
6
|
router: React.ReactNode;
|
|
8
7
|
menus: SidebarMenus;
|
|
9
8
|
menuBottom?: SidebarMenuItem[];
|
|
10
9
|
logo: string;
|
|
10
|
+
appName?: string;
|
|
11
11
|
theme?: ThemeObject;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
bottomDrawerContent?: React.ReactNode;
|
|
18
|
-
variant?: "default" | "simple";
|
|
12
|
+
initialUserData?: {
|
|
13
|
+
name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
photoURL?: string;
|
|
16
|
+
} | null;
|
|
19
17
|
}
|
|
20
|
-
export declare const AppComponent: ({ router, menus, menuBottom, logo, initialUserData, theme,
|
|
21
|
-
export declare const App: React.MemoExoticComponent<({ router, menus, menuBottom, logo, initialUserData, theme,
|
|
18
|
+
export declare const AppComponent: ({ router, menus, menuBottom, logo, appName, initialUserData, theme, }: AppProps) => React.JSX.Element;
|
|
19
|
+
export declare const App: React.MemoExoticComponent<({ router, menus, menuBottom, logo, appName, initialUserData, theme, }: AppProps) => React.JSX.Element>;
|
|
22
20
|
export * from './hooks';
|
|
23
21
|
export * from './context';
|