@pivotfinancialtechnologies/admin-frontend-blueprint-template 0.0.2-dev.8
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/README.md +73 -0
- package/dist/components/Data/BooleanTag/BooleanTag.d.ts +7 -0
- package/dist/components/Data/Datatable/Datatable.d.ts +25 -0
- package/dist/components/Data/Datatable/TableCellTag.d.ts +11 -0
- package/dist/components/Data/Datatable/TableCopyMenu.d.ts +9 -0
- package/dist/components/Data/Pagination.d.ts +22 -0
- package/dist/components/Data/SimpleDatatable/SimpleDatatable.d.ts +21 -0
- package/dist/components/Data/SimpleHTMLDatatable/SimpleHTMLDatatable.d.ts +14 -0
- package/dist/components/Data/utils.d.ts +5 -0
- package/dist/components/Dialog/ConfirmationDialog.d.ts +3 -0
- package/dist/components/Security/AuthRoute.d.ts +6 -0
- package/dist/components/Security/PermissionVisibility.d.ts +8 -0
- package/dist/components/Security/UnAuthRoute.d.ts +5 -0
- package/dist/components/Select/SelectItem.d.ts +17 -0
- package/dist/components/Select/SelectMultipleItems.d.ts +17 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4537 -0
- package/dist/index.umd.cjs +14 -0
- package/dist/layouts/ThemeSwitch/ThemeSwitch.d.ts +2 -0
- package/dist/layouts/TopBarNavLayout/TopBarNavLayout.d.ts +6 -0
- package/dist/layouts/Topbar/Topbar.d.ts +8 -0
- package/dist/layouts/index.d.ts +3 -0
- package/dist/utils/copy.d.ts +2 -0
- package/dist/utils/formatters.d.ts +7 -0
- package/dist/utils/http.d.ts +4 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/theme.d.ts +4 -0
- package/dist/utils/toast.d.ts +2 -0
- package/dist/utils/useUrlForm.d.ts +4 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Page, PageRequest } from '../Pagination.ts';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { Intent } from '@blueprintjs/core';
|
|
4
|
+
import { ColumnProps } from '@blueprintjs/table';
|
|
5
|
+
export interface DataTableColumnProps<T> extends ColumnProps {
|
|
6
|
+
visible: boolean;
|
|
7
|
+
key: string;
|
|
8
|
+
sortKey?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
disableSort?: boolean;
|
|
11
|
+
customCellRenderer?: (row: T) => React.JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
interface DataTableProps<T> {
|
|
14
|
+
columns: DataTableColumnProps<T>[];
|
|
15
|
+
request: PageRequest;
|
|
16
|
+
data?: Page<T>;
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
onRequestChange: (request: PageRequest) => void;
|
|
19
|
+
onDoubleClick?: (row: T) => void;
|
|
20
|
+
getIntent?: (row: T) => Intent;
|
|
21
|
+
actionButtons?: React.JSX.Element;
|
|
22
|
+
resetKey?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const Datatable: <T>({ columns, request, data, isLoading, onRequestChange, actionButtons, getIntent, onDoubleClick, resetKey, }: DataTableProps<T>) => React.JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Intent } from '@blueprintjs/core';
|
|
2
|
+
export interface TableCellTagProps {
|
|
3
|
+
value?: boolean;
|
|
4
|
+
trueText?: string;
|
|
5
|
+
falseText?: string;
|
|
6
|
+
trueIntent: Intent;
|
|
7
|
+
falseIntent: Intent;
|
|
8
|
+
round?: boolean;
|
|
9
|
+
minimal?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const TableCellTag: ({ value, trueText, falseText, trueIntent, falseIntent, round, minimal, }: TableCellTagProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MenuContext } from '@blueprintjs/table';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
import { SimpleDataTableColumnProps } from '../SimpleDatatable/SimpleDatatable.tsx';
|
|
4
|
+
import { DataTableColumnProps } from './Datatable.tsx';
|
|
5
|
+
export interface CopyMenuProps<T> {
|
|
6
|
+
label: string;
|
|
7
|
+
copyContent: (value: T) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare const createTableCopyMenu: <T>(menu: MenuContext, columns: SimpleDataTableColumnProps<T>[] | DataTableColumnProps<T>[], data: T[], extraMenus?: CopyMenuProps<T>[]) => JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface Page<T> {
|
|
2
|
+
content: T[];
|
|
3
|
+
last: boolean;
|
|
4
|
+
totalElements: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
size: number;
|
|
7
|
+
number: number;
|
|
8
|
+
numberOfElements: number;
|
|
9
|
+
first: boolean;
|
|
10
|
+
error: string;
|
|
11
|
+
}
|
|
12
|
+
export type SortDirection = 'asc' | 'desc';
|
|
13
|
+
export interface Sort {
|
|
14
|
+
field: string;
|
|
15
|
+
direction: SortDirection;
|
|
16
|
+
}
|
|
17
|
+
export declare class PageRequest {
|
|
18
|
+
sort?: Sort[];
|
|
19
|
+
page: number;
|
|
20
|
+
pageSize: number;
|
|
21
|
+
constructor(page: number, pageSize: number, sort?: Sort[]);
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ColumnProps } from '@blueprintjs/table';
|
|
3
|
+
import { Intent } from '@blueprintjs/core';
|
|
4
|
+
import { CopyMenuProps } from '../Datatable/TableCopyMenu.tsx';
|
|
5
|
+
export interface SimpleDataTableColumnProps<T> extends ColumnProps {
|
|
6
|
+
key: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
customCellRenderer?: (row: T) => React.JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export interface SimpleDataTableProps<T> {
|
|
12
|
+
columns: SimpleDataTableColumnProps<T>[];
|
|
13
|
+
data?: T[] | null;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
actionButtons?: React.JSX.Element;
|
|
16
|
+
onRowClick?: (row: T) => void;
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
getIntent?: (row: T) => Intent;
|
|
19
|
+
extraCopyMenus?: CopyMenuProps<T>[];
|
|
20
|
+
}
|
|
21
|
+
export declare const SimpleDatatable: <T>({ columns, data, actionButtons, isLoading, getIntent, pageSize: initialPageSize, extraCopyMenus, }: SimpleDataTableProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Intent } from '@blueprintjs/core';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface SimpleHTMLDataTableColumnProps<T> {
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
customCellRenderer?: (row: T) => React.JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
export interface SimpleHTMLDatatableProps<T> {
|
|
10
|
+
columns: SimpleHTMLDataTableColumnProps<T>[];
|
|
11
|
+
data?: T[] | null;
|
|
12
|
+
getIntent?: (row: T) => Intent;
|
|
13
|
+
}
|
|
14
|
+
export declare const SimpleHTMLDatatable: <T>({ columns, data, getIntent }: SimpleHTMLDatatableProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PermissionVisibilityProps {
|
|
3
|
+
requiredPermissions: string[];
|
|
4
|
+
gainPermissions: string[];
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
fallback?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const PermissionVisibility: ({ requiredPermissions, gainPermissions, children, fallback, }: PermissionVisibilityProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Intent, Props } from '@blueprintjs/core';
|
|
2
|
+
import { Key, ReactNode } from 'react';
|
|
3
|
+
export interface SelectItemProps<Item, Value> extends Props {
|
|
4
|
+
items?: Item[];
|
|
5
|
+
selectedValue?: Value;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
getValueByItem: (item: Item) => Value;
|
|
9
|
+
getItemByValue: (value: Value) => Item;
|
|
10
|
+
onSelect: (item?: Item) => void;
|
|
11
|
+
renderSelected: (item?: Item) => ReactNode;
|
|
12
|
+
renderMenuText: (item: Item) => ReactNode;
|
|
13
|
+
renderMenuLabel?: (item: Item) => ReactNode;
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
intent?: Intent;
|
|
16
|
+
}
|
|
17
|
+
export declare const SelectItem: <Item, Value extends Key>({ selectedValue, items, required, disabled, onSelect, renderSelected, renderMenuText, getValueByItem, getItemByValue, renderMenuLabel, onBlur, intent, }: SelectItemProps<Item, Value>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Props } from '@blueprintjs/core';
|
|
2
|
+
import { Key, ReactNode } from 'react';
|
|
3
|
+
export interface SelectMultipleItemsProps<Item, Value> extends Props {
|
|
4
|
+
items?: Item[];
|
|
5
|
+
selectedValues?: Value[];
|
|
6
|
+
required?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
getValueByItem: (item: Item) => Value;
|
|
9
|
+
getItemByValue: (value: Value) => Item;
|
|
10
|
+
renderSelected: (item?: Item) => ReactNode;
|
|
11
|
+
renderMenuText: (item: Item) => ReactNode;
|
|
12
|
+
renderMenuLabel?: (item: Item) => ReactNode;
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
onSelect: (item: Item) => void;
|
|
15
|
+
onRemove: (item: Item) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const SelectMultipleItems: <Item, Value extends Key>({ items, selectedValues, required, disabled, getValueByItem, getItemByValue, renderSelected, renderMenuText, renderMenuLabel, onBlur, onSelect, onRemove, }: SelectMultipleItemsProps<Item, Value>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './Data/Pagination.ts';
|
|
2
|
+
export * from './Data/BooleanTag/BooleanTag';
|
|
3
|
+
export * from './Data/Datatable/Datatable.tsx';
|
|
4
|
+
export * from './Data/Datatable/TableCellTag.tsx';
|
|
5
|
+
export * from './Data/Datatable/TableCopyMenu.tsx';
|
|
6
|
+
export * from './Data/SimpleDatatable/SimpleDatatable.tsx';
|
|
7
|
+
export * from './Data/SimpleHTMLDatatable/SimpleHTMLDatatable.tsx';
|
|
8
|
+
export * from './Dialog/ConfirmationDialog.tsx';
|
|
9
|
+
export * from './Select/SelectItem.tsx';
|
|
10
|
+
export * from './Select/SelectMultipleItems.tsx';
|
|
11
|
+
export * from './Security/AuthRoute.tsx';
|
|
12
|
+
export * from './Security/UnAuthRoute.tsx';
|
|
13
|
+
export * from './Security/PermissionVisibility.tsx';
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.table-form-actions{display:flex}.table-actions{flex-shrink:0;align-self:flex-end;align-items:center;padding:10px 0;gap:10px;display:flex}.columns-visibility-menu{gap:10px;display:flex}.table-form{flex:1}.table-content{height:520px;overflow-y:auto;overflow-x:hidden}.table-pagination{display:flex;justify-content:space-between;align-items:center;margin:10px;padding-top:20px}.rows-select-container{display:flex;align-items:center}.rows-select-container span{margin-right:10px}.pagination-page-info{margin:0 10px}.simple-html-datatable{--table-border-color: rgba(129, 129, 129, .45);font-size:12px;border-collapse:collapse;border:1px solid var(--table-border-color)}.simple-html-datatable th,.simple-html-datatable td{padding:4px 8px;border-bottom:1px solid var(--table-border-color);border-right:1px solid var(--table-border-color)}.bp5-intent-primary{background-color:#2d72d21a;color:#2d72d2}.bp5-intent-warning{background-color:#ffe5641a;color:#d9822b}.bp5-intent-danger{background-color:#ff4d4f1a;color:#f45e5e}.custom-navbar{display:flex;width:100%;justify-content:space-between}.nav-button{box-shadow:none!important}.nav-button:hover{background:#ffffff1a!important}
|
package/dist/index.d.ts
ADDED