@luminix/mui-cms 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/tipos.md DELETED
@@ -1,248 +0,0 @@
1
- # Referência de tipos
2
-
3
- Todos os tipos abaixo são exportados de `@luminix/mui-cms`.
4
-
5
- ---
6
-
7
- ## Ações
8
-
9
- ### StaticAction
10
-
11
- ```ts
12
- type StaticAction = {
13
- key?: string;
14
- label: string;
15
- icon?: React.ReactNode;
16
- callback: (e: ActionCallbackEvent) => void;
17
- };
18
- ```
19
-
20
- ### InstanceAction
21
-
22
- ```ts
23
- type InstanceAction = {
24
- key?: string;
25
- label: string;
26
- icon?: React.ReactNode;
27
- callback: (e: InstanceActionCallbackEvent) => void;
28
- };
29
- ```
30
-
31
- ### MassAction
32
-
33
- ```ts
34
- type MassAction = {
35
- key: string; // obrigatório
36
- label: string;
37
- callback: (e: MassActionCallbackEvent) => void;
38
- };
39
- ```
40
-
41
- ### ActionCallbackEvent
42
-
43
- ```ts
44
- type ActionCallbackEvent = {
45
- navigate: (path: string) => void;
46
- refresh: () => void;
47
- notify: NotifyFunction;
48
- dialog: DialogFunction;
49
- t: TFunction; // i18next
50
- };
51
- ```
52
-
53
- ### InstanceActionCallbackEvent
54
-
55
- ```ts
56
- type InstanceActionCallbackEvent = ActionCallbackEvent & {
57
- item: ModelType;
58
- };
59
- ```
60
-
61
- ### MassActionCallbackEvent
62
-
63
- ```ts
64
- type MassActionCallbackEvent = ActionCallbackEvent & {
65
- selected: Collection<ModelType>;
66
- };
67
- ```
68
-
69
- ---
70
-
71
- ## Tabela
72
-
73
- ### Column
74
-
75
- Estende `TableCellProps` do MUI:
76
-
77
- ```ts
78
- type Column = TableCellProps & {
79
- key: string;
80
- label: string;
81
- sortable?: boolean;
82
- };
83
- ```
84
-
85
- ---
86
-
87
- ## Rotas
88
-
89
- ### RouteObject
90
-
91
- Re-exportado de `react-router-dom`. Use para tipar rotas adicionadas via redutor `cmsRoutes`:
92
-
93
- ```ts
94
- import type { RouteObject } from '@luminix/mui-cms';
95
- ```
96
-
97
- ---
98
-
99
- ## Configuração
100
-
101
- ### CmsConfig
102
-
103
- ```ts
104
- type CmsConfig = {
105
- layout?: {
106
- breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
107
- drawer?: {
108
- width?: number;
109
- };
110
- appBar?: {
111
- height?: number;
112
- color?: string;
113
- };
114
- };
115
- };
116
- ```
117
-
118
- ### LogoutButtonProps
119
-
120
- Props recebidas pelo componente `Layout.Drawer.LogoutButton`. Relevante ao substituir o componente via redutor `componentMap`.
121
-
122
- ```ts
123
- type LogoutButtonProps = {
124
- collapsed?: boolean; // true quando o drawer está recolhido no desktop
125
- };
126
- ```
127
-
128
- ---
129
-
130
- ## Componente LuminixCms
131
-
132
- ### LuminixCmsProps
133
-
134
- ```ts
135
- type LuminixCmsProps = Partial<LuminixProviderProps> & {
136
- theme?: ThemeOptions; // MUI ThemeOptions
137
- themeArgs?: object[]; // argumentos adicionais para createTheme()
138
- };
139
- ```
140
-
141
- `LuminixProviderProps` vem de `@luminix/react`. Consulte a documentação desse pacote para ver as props herdadas.
142
-
143
- ---
144
-
145
- ## Filtros
146
-
147
- ### FilterColumn
148
-
149
- Representa uma coluna disponível para filtragem:
150
-
151
- ```ts
152
- type FilterColumn = {
153
- key: string;
154
- label: string;
155
- type: string; // tipo do atributo (int, date, text, autocomplete, ...)
156
- nullable: boolean;
157
- is_relation: boolean;
158
- };
159
- ```
160
-
161
- ### FilteredColumn
162
-
163
- Estado de uma linha ativa no painel de filtros:
164
-
165
- ```ts
166
- type FilteredColumn = {
167
- key: string;
168
- type: string;
169
- operator: string;
170
- value: unknown;
171
- };
172
- ```
173
-
174
- ---
175
-
176
- ## Notificações
177
-
178
- ### NotifyFunction
179
-
180
- ```ts
181
- type NotifyFunction = (notification: string | Notification) => void;
182
- ```
183
-
184
- ### Notification
185
-
186
- ```ts
187
- type Notification = {
188
- message: React.ReactNode;
189
- severity?: 'success' | 'error' | 'warning' | 'info';
190
- title?: React.ReactNode;
191
- actions?: NotificationAction[];
192
- };
193
-
194
- type NotificationAction = {
195
- label: React.ReactNode;
196
- callback: () => void;
197
- };
198
- ```
199
-
200
- ---
201
-
202
- ## Diálogos
203
-
204
- ### DialogFunction
205
-
206
- ```ts
207
- type DialogFunction = (message: string | DialogMessage) => Promise<boolean | string>;
208
- ```
209
-
210
- ### DialogMessage
211
-
212
- ```ts
213
- type DialogMessage = {
214
- title?: React.ReactNode;
215
- message: React.ReactNode;
216
- type?: 'alert' | 'confirm' | 'prompt';
217
- dismissable?: boolean;
218
- confirmText?: string;
219
- cancelText?: string;
220
- defaultValue?: string;
221
- dialogProps?: Partial<DialogProps>;
222
- textFieldProps?: Partial<TextFieldProps>;
223
- };
224
- ```
225
-
226
- ---
227
-
228
- ## Menu
229
-
230
- ### MenuItem
231
-
232
- ```ts
233
- type MenuItem = {
234
- key: string;
235
- text: string;
236
- to?: string;
237
- icon?: React.ReactNode;
238
- children?: MenuItem[];
239
- };
240
- ```
241
-
242
- ---
243
-
244
- ## Próximos passos
245
-
246
- - [Ações](acoes.md) — como usar esses tipos na prática
247
- - [Extensibilidade](extensibilidade.md) — redutores e customizações
248
- - [Volta ao índice](index.md)
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "useDefineForClassFields": true,
5
- "lib": ["ES2020", "DOM", "DOM.Iterable", "ES2021.String"],
6
- "module": "ESNext",
7
- "skipLibCheck": true,
8
-
9
- /* Bundler mode */
10
- "moduleResolution": "bundler",
11
- "allowImportingTsExtensions": true,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "noEmit": true,
15
- "jsx": "react-jsx",
16
-
17
- /* Linting */
18
- "strict": true,
19
- "noUnusedLocals": true,
20
- "noUnusedParameters": true,
21
- "noFallthroughCasesInSwitch": true
22
- },
23
- "include": ["src"],
24
- "exclude": ["src/__tests__"],
25
- "references": [{ "path": "./tsconfig.node.json" }]
26
- }
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true,
8
- "strict": true
9
- },
10
- "include": ["vite.config.ts"]
11
- }
@@ -1,16 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "skipLibCheck": true,
5
- "moduleResolution": "bundler",
6
- "noUnusedLocals": false,
7
- "noUnusedParameters": false,
8
- "types": [
9
- "vite/client",
10
- "vitest/globals",
11
- "@testing-library/jest-dom"
12
- ]
13
- },
14
- "include": ["src"],
15
- "exclude": []
16
- }
package/vitest.config.ts DELETED
@@ -1,22 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
- import { resolve } from 'path';
3
-
4
- export default defineConfig({
5
- resolve: {
6
- alias: {
7
- '@luminix/react': resolve(__dirname, 'node_modules/@luminix/react/dist/react.js'),
8
- '@luminix/core': resolve(__dirname, 'node_modules/@luminix/core/dist/core.js'),
9
- '@luminix/support': resolve(__dirname, 'node_modules/@luminix/support/dist/support.js'),
10
- },
11
- },
12
- test: {
13
- environment: 'jsdom',
14
- globals: true,
15
- setupFiles: ['./src/__tests__/setup.ts'],
16
- coverage: {
17
- provider: 'v8',
18
- include: ['src/**/*.{ts,tsx}'],
19
- exclude: ['src/__tests__/**', 'src/**/*.d.ts', 'src/main.tsx'],
20
- },
21
- },
22
- });