itrm-components 1.0.14 → 1.0.16
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 +50 -50
- package/dist/index.d.ts +251 -0
- package/dist/index.es.js +92370 -290
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +29478 -11
- package/dist/index.umd.js.map +1 -1
- package/dist/itrm-components.css +1 -1
- package/package.json +51 -47
package/README.md
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
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/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
-
|
|
10
|
-
## Expanding the ESLint configuration
|
|
11
|
-
|
|
12
|
-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
13
|
-
|
|
14
|
-
- Configure the top-level `parserOptions` property like this:
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
export default tseslint.config({
|
|
18
|
-
languageOptions: {
|
|
19
|
-
// other options...
|
|
20
|
-
parserOptions: {
|
|
21
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
22
|
-
tsconfigRootDir: import.meta.dirname,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
|
|
29
|
-
- Optionally add `...tseslint.configs.stylisticTypeChecked`
|
|
30
|
-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
|
|
31
|
-
|
|
32
|
-
```js
|
|
33
|
-
// eslint.config.js
|
|
34
|
-
import react from 'eslint-plugin-react'
|
|
35
|
-
|
|
36
|
-
export default tseslint.config({
|
|
37
|
-
// Set the react version
|
|
38
|
-
settings: { react: { version: '18.3' } },
|
|
39
|
-
plugins: {
|
|
40
|
-
// Add the react plugin
|
|
41
|
-
react,
|
|
42
|
-
},
|
|
43
|
-
rules: {
|
|
44
|
-
// other rules...
|
|
45
|
-
// Enable its recommended rules
|
|
46
|
-
...react.configs.recommended.rules,
|
|
47
|
-
...react.configs['jsx-runtime'].rules,
|
|
48
|
-
},
|
|
49
|
-
})
|
|
50
|
-
```
|
|
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/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## Expanding the ESLint configuration
|
|
11
|
+
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
13
|
+
|
|
14
|
+
- Configure the top-level `parserOptions` property like this:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
export default tseslint.config({
|
|
18
|
+
languageOptions: {
|
|
19
|
+
// other options...
|
|
20
|
+
parserOptions: {
|
|
21
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
22
|
+
tsconfigRootDir: import.meta.dirname,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
|
|
29
|
+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
|
|
30
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
// eslint.config.js
|
|
34
|
+
import react from 'eslint-plugin-react'
|
|
35
|
+
|
|
36
|
+
export default tseslint.config({
|
|
37
|
+
// Set the react version
|
|
38
|
+
settings: { react: { version: '18.3' } },
|
|
39
|
+
plugins: {
|
|
40
|
+
// Add the react plugin
|
|
41
|
+
react,
|
|
42
|
+
},
|
|
43
|
+
rules: {
|
|
44
|
+
// other rules...
|
|
45
|
+
// Enable its recommended rules
|
|
46
|
+
...react.configs.recommended.rules,
|
|
47
|
+
...react.configs['jsx-runtime'].rules,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,249 @@
|
|
|
1
|
+
import { ActionCreatorWithPayload } from '@reduxjs/toolkit';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
1
4
|
import { default as default_2 } from 'react';
|
|
5
|
+
import { EnhancedStore } from '@reduxjs/toolkit';
|
|
6
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
7
|
import { ReactNode } from 'react';
|
|
8
|
+
import { StoreEnhancer } from '@reduxjs/toolkit';
|
|
9
|
+
import { ThunkDispatch } from '@reduxjs/toolkit';
|
|
10
|
+
import { Tuple } from '@reduxjs/toolkit';
|
|
11
|
+
import { UnknownAction } from '@reduxjs/toolkit';
|
|
12
|
+
|
|
13
|
+
export declare interface AlertContextType {
|
|
14
|
+
showAlert: (variant: "success" | "danger" | "warning", message: ReactNode) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare interface AlertContextType_2 {
|
|
18
|
+
showAlert: (variant: "success" | "danger" | "warning", message: ReactNode) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare type AlertProps = {
|
|
22
|
+
variant: "success" | "danger" | "warning";
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export declare const AlertProvider: ({ children }: {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}) => JSX.Element;
|
|
29
|
+
|
|
30
|
+
export declare function dateFormat(timestamp: string | number): string;
|
|
31
|
+
|
|
32
|
+
export declare function dateTimeFormat(timestamp: string | number): string;
|
|
33
|
+
|
|
34
|
+
export declare function dollarFormat(value: number): string;
|
|
35
|
+
|
|
36
|
+
export declare interface IconComponentProps {
|
|
37
|
+
icon: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare function listFormat(value: string): string;
|
|
41
|
+
|
|
42
|
+
export declare function numberFormat(value: number): string;
|
|
43
|
+
|
|
44
|
+
export declare function percentageFormat(value: number): string;
|
|
45
|
+
|
|
46
|
+
export declare function requestAll(url: string, instance: AxiosInstance): Promise<any[]>;
|
|
47
|
+
|
|
48
|
+
export declare function round(value: number, decimals: number): number;
|
|
49
|
+
|
|
50
|
+
export declare const setRefreshTrigger: ActionCreatorWithPayload< {
|
|
51
|
+
key: string;
|
|
52
|
+
value: boolean;
|
|
53
|
+
}, "tables/setRefreshTrigger">;
|
|
54
|
+
|
|
55
|
+
export declare const StandardTable: React.FC<StandardTableProps>;
|
|
56
|
+
|
|
57
|
+
export declare interface StandardTableCaption {
|
|
58
|
+
title: boolean;
|
|
59
|
+
size: boolean;
|
|
60
|
+
buttons?: StandarTableCaptionButton[];
|
|
61
|
+
selector?: StandarTableSelector;
|
|
62
|
+
filterNavs?: {
|
|
63
|
+
filterOptions: any;
|
|
64
|
+
setFilter: any;
|
|
65
|
+
selectedFilter: any;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare interface StandardTableColumn {
|
|
70
|
+
tittle: string;
|
|
71
|
+
key: string;
|
|
72
|
+
filter?: {
|
|
73
|
+
icon?: string;
|
|
74
|
+
options: StandarTableFilterOption[];
|
|
75
|
+
};
|
|
76
|
+
class?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare interface StandardTableConfig {
|
|
80
|
+
columns: StandardTableColumn[];
|
|
81
|
+
optionsColumn?: StandardTableOptionsColumn;
|
|
82
|
+
data: {
|
|
83
|
+
[key: string]: StandardTableRowValue;
|
|
84
|
+
}[];
|
|
85
|
+
filters: [{
|
|
86
|
+
keyQuery: string;
|
|
87
|
+
value: string;
|
|
88
|
+
}] | [{}];
|
|
89
|
+
refreshTrigger: boolean;
|
|
90
|
+
selectedItems?: StandardTableSelectedItems;
|
|
91
|
+
download?: StandardTableDownload;
|
|
92
|
+
pagination: StandardTablePaginationProps;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare interface StandardTableDataProps {
|
|
96
|
+
automaticManagement: boolean;
|
|
97
|
+
urlConfig?: {
|
|
98
|
+
url: string;
|
|
99
|
+
formatItems: (items: any) => any;
|
|
100
|
+
headers?: AxiosRequestConfig;
|
|
101
|
+
};
|
|
102
|
+
items?: {
|
|
103
|
+
[key: string]: StandardTableRowValue;
|
|
104
|
+
}[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare interface StandardTableDownload {
|
|
108
|
+
onclick: (items: {
|
|
109
|
+
[key: string]: StandardTableRowValue;
|
|
110
|
+
}[]) => void;
|
|
111
|
+
enableSelectedItemsDownloading: boolean;
|
|
112
|
+
label: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export declare interface StandardTableEvent {
|
|
116
|
+
item?: StandardTableRowValue;
|
|
117
|
+
table: StandardTableConfig;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export declare interface StandardTableOptionsColumn {
|
|
121
|
+
tittle: string;
|
|
122
|
+
filter?: (item: any, option: StandardTableOptionsColumnOption) => boolean;
|
|
123
|
+
options: StandardTableOptionsColumnOption[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare interface StandardTableOptionsColumnOption {
|
|
127
|
+
icon: string;
|
|
128
|
+
label?: string;
|
|
129
|
+
class?: string;
|
|
130
|
+
onclick: (item?: any) => void;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export declare interface StandardTablePaginationProps {
|
|
134
|
+
total: number;
|
|
135
|
+
pages: number;
|
|
136
|
+
pageSize: number;
|
|
137
|
+
currentPage: number;
|
|
138
|
+
setCurrentPage: default_2.Dispatch<default_2.SetStateAction<number>>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export declare interface StandardTableProps {
|
|
142
|
+
columns: StandardTableColumn[];
|
|
143
|
+
optionsColumn?: StandardTableOptionsColumn;
|
|
144
|
+
data: StandardTableDataProps;
|
|
145
|
+
pageSize: number;
|
|
146
|
+
tableName: string;
|
|
147
|
+
theme: StandardTableTheme;
|
|
148
|
+
selectionEnabled?: StandardTableSelectionEnabled;
|
|
149
|
+
caption?: StandardTableCaption;
|
|
150
|
+
download?: StandardTableDownload;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export declare interface StandardTableRowValue {
|
|
154
|
+
value: string | number;
|
|
155
|
+
class?: string;
|
|
156
|
+
format?: StandardTableRowValueFormat;
|
|
157
|
+
color?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export declare enum StandardTableRowValueFormat {
|
|
161
|
+
DATE = "date",
|
|
162
|
+
TIME = "time",
|
|
163
|
+
DATETIME = "datetime",
|
|
164
|
+
NUMBER = "number",
|
|
165
|
+
DOLLAR = "dollar",
|
|
166
|
+
PERCENTAGE = "percentage",
|
|
167
|
+
LIST = "list"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export declare interface StandardTableSelectedItems {
|
|
171
|
+
enabled: boolean;
|
|
172
|
+
tittleButton: string;
|
|
173
|
+
items: {
|
|
174
|
+
[key: string]: StandardTableRowValue;
|
|
175
|
+
}[];
|
|
176
|
+
sortBy?: {
|
|
177
|
+
key: string;
|
|
178
|
+
order: 'asc' | 'desc';
|
|
179
|
+
};
|
|
180
|
+
manageSelectedItems?: (items?: any) => void;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export declare interface StandardTableSelectionEnabled {
|
|
184
|
+
enabled: boolean;
|
|
185
|
+
manageSelectedItems: (items?: any) => void;
|
|
186
|
+
titleButton: string;
|
|
187
|
+
sortBy?: {
|
|
188
|
+
key: string;
|
|
189
|
+
order: 'asc' | 'desc';
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export declare interface StandardTableStore {
|
|
194
|
+
tables: {
|
|
195
|
+
[key: string]: StandardTableConfig;
|
|
196
|
+
};
|
|
197
|
+
update: (key: string, value: StandardTableConfig) => void;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export declare interface StandardTableTheme {
|
|
201
|
+
default?: 'dark' | 'light';
|
|
202
|
+
class?: string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export declare interface StandarTableCaptionButton {
|
|
206
|
+
icon?: default_2.ReactNode;
|
|
207
|
+
label?: string;
|
|
208
|
+
onclick: () => void;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export declare interface StandarTableFilterOption {
|
|
212
|
+
keyQuery: string;
|
|
213
|
+
value: string | number;
|
|
214
|
+
label: string;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export declare interface StandarTableSelector {
|
|
218
|
+
options: StandarTableSelectorOption[];
|
|
219
|
+
onChange: (value: StandarTableSelectorOption) => void;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export declare interface StandarTableSelectorOption {
|
|
223
|
+
label: string;
|
|
224
|
+
value: string | number;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export declare const store: EnhancedStore<{
|
|
228
|
+
tables: TableState;
|
|
229
|
+
}, UnknownAction, Tuple<[
|
|
230
|
+
StoreEnhancer<{
|
|
231
|
+
dispatch: ThunkDispatch<{
|
|
232
|
+
tables: TableState;
|
|
233
|
+
}, undefined, UnknownAction>;
|
|
234
|
+
}>,
|
|
235
|
+
StoreEnhancer
|
|
236
|
+
]>>;
|
|
237
|
+
|
|
238
|
+
export declare interface TableState {
|
|
239
|
+
tables: {
|
|
240
|
+
[key: string]: StandardTableConfig & {
|
|
241
|
+
refreshTrigger?: boolean;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export declare function timeFormat(timestamp: string | number): string;
|
|
3
247
|
|
|
4
248
|
export declare const Tooltip: default_2.FC<TooltipProps>;
|
|
5
249
|
|
|
@@ -8,4 +252,11 @@ declare interface TooltipProps {
|
|
|
8
252
|
content: string;
|
|
9
253
|
}
|
|
10
254
|
|
|
255
|
+
export declare const useAlert: () => AlertContextType_2;
|
|
256
|
+
|
|
11
257
|
export { }
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
declare module '@tabler/icons-react' {
|
|
261
|
+
const IconName: any;
|
|
262
|
+
}
|