@gnwebsoft/ui 3.0.0 → 3.0.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.
Files changed (74) hide show
  1. package/README.md +688 -0
  2. package/dist/chunk-4H3AFH7A.js +505 -0
  3. package/dist/chunk-DE62KYFK.js +122 -0
  4. package/dist/chunk-DEPJRTVT.js +1 -0
  5. package/dist/chunk-EBRUE2WR.cjs +493 -0
  6. package/dist/chunk-FD57PCAC.cjs +1 -0
  7. package/dist/chunk-H3GQLELL.js +2025 -0
  8. package/dist/chunk-MVPLBJRK.cjs +1 -0
  9. package/dist/chunk-OJF67RNM.js +1 -0
  10. package/dist/chunk-OT7COE7R.cjs +2025 -0
  11. package/dist/chunk-R2YK4LTT.cjs +122 -0
  12. package/dist/chunk-U6SDYCWF.js +493 -0
  13. package/dist/chunk-ZC7FGYL2.cjs +505 -0
  14. package/dist/components/index.cjs +25 -0
  15. package/dist/components/index.d.cts +752 -0
  16. package/dist/components/index.d.ts +664 -15
  17. package/dist/components/index.js +25 -24
  18. package/dist/enhanced-z-I7EHVS.d.cts +134 -0
  19. package/dist/enhanced-z-I7EHVS.d.ts +134 -0
  20. package/dist/hooks/index.cjs +12 -0
  21. package/dist/hooks/index.d.cts +95 -0
  22. package/dist/hooks/index.d.ts +82 -4
  23. package/dist/hooks/index.js +12 -7
  24. package/dist/index.cjs +127 -0
  25. package/dist/index.d.cts +14 -0
  26. package/dist/index.d.ts +4 -8
  27. package/dist/index.js +127 -58
  28. package/dist/types/index.cjs +2 -0
  29. package/dist/types/index.d.cts +241 -0
  30. package/dist/types/index.d.ts +212 -15
  31. package/dist/types/index.js +2 -1
  32. package/dist/utils/index.cjs +45 -0
  33. package/dist/utils/index.d.cts +366 -0
  34. package/dist/utils/index.d.ts +317 -10
  35. package/dist/utils/index.js +45 -22
  36. package/dist/wrappers/index.cjs +54 -0
  37. package/dist/wrappers/index.d.cts +1684 -0
  38. package/dist/wrappers/index.d.ts +1601 -118
  39. package/dist/wrappers/index.js +54 -8
  40. package/package.json +139 -92
  41. package/dist/AsyncSelectPayload-Cz4bgak0.d.mts +0 -10
  42. package/dist/AsyncSelectPayload-Cz4bgak0.d.ts +0 -10
  43. package/dist/OptionItem-oN6XnOTJ.d.mts +0 -14
  44. package/dist/OptionItem-oN6XnOTJ.d.ts +0 -14
  45. package/dist/chunk-2JFL7TS5.mjs +0 -0
  46. package/dist/chunk-5HOGPCEO.mjs +0 -1427
  47. package/dist/chunk-6BGQA4BQ.js +0 -1
  48. package/dist/chunk-6JZ35VQJ.js +0 -19
  49. package/dist/chunk-6NOXJGU2.js +0 -1427
  50. package/dist/chunk-7M2VOCYN.js +0 -1
  51. package/dist/chunk-BWQUYXUW.mjs +0 -1634
  52. package/dist/chunk-D3J7MWAU.js +0 -1634
  53. package/dist/chunk-EVPUCTZA.mjs +0 -0
  54. package/dist/chunk-FSU3H777.mjs +0 -473
  55. package/dist/chunk-GFSTK7KN.mjs +0 -19
  56. package/dist/chunk-I7EIUZKK.js +0 -332
  57. package/dist/chunk-JKUOV3MN.js +0 -473
  58. package/dist/chunk-RQS44YC7.mjs +0 -332
  59. package/dist/components/index.d.mts +0 -103
  60. package/dist/components/index.mjs +0 -24
  61. package/dist/hooks/index.d.mts +0 -17
  62. package/dist/hooks/index.mjs +0 -7
  63. package/dist/index.d.mts +0 -18
  64. package/dist/index.mjs +0 -58
  65. package/dist/types/index.d.mts +0 -44
  66. package/dist/types/index.mjs +0 -1
  67. package/dist/utils/index.d.mts +0 -59
  68. package/dist/utils/index.mjs +0 -22
  69. package/dist/wrappers/index.d.mts +0 -201
  70. package/dist/wrappers/index.mjs +0 -8
  71. package/dist/wrappers2/index.d.mts +0 -247
  72. package/dist/wrappers2/index.d.ts +0 -247
  73. package/dist/wrappers2/index.js +0 -8
  74. package/dist/wrappers2/index.mjs +0 -8
@@ -1,332 +0,0 @@
1
- // src/utils/api.ts
2
- var makeRequest = async (url, options = {}) => {
3
- const response = await fetch(url, options);
4
- if (response.ok) {
5
- const apiData = await response.json();
6
- return {
7
- apiData,
8
- status: response.status
9
- };
10
- } else if (response.status === 404) {
11
- const apiData = await response.json();
12
- const data = {
13
- status: response.status,
14
- title: apiData.title
15
- };
16
- return data;
17
- }
18
- const apiResponse = await response.json();
19
- return apiResponse;
20
- };
21
- var api = class {
22
- static async filter(url, postModel) {
23
- const alteredOptions = {
24
- headers: {
25
- "Content-Type": "application/json",
26
- Authorization: `Bearer ${localStorage.getItem("serviceToken")}`
27
- },
28
- body: JSON.stringify({ ...postModel, ...postModel.filterModel }),
29
- method: "POST"
30
- };
31
- const apiResponse = await makeRequest(url, alteredOptions);
32
- return apiResponse;
33
- }
34
- static async post(url, body = {}) {
35
- const alteredOptions = {
36
- headers: {
37
- "Content-Type": "application/json",
38
- Authorization: `Bearer ${localStorage.getItem("serviceToken")}`
39
- },
40
- body: JSON.stringify(body),
41
- method: "POST"
42
- };
43
- const apiResponse = await makeRequest(url, alteredOptions);
44
- return apiResponse;
45
- }
46
- static async get(url) {
47
- const alteredOptions = {
48
- headers: {
49
- "Content-Type": "application/json",
50
- Authorization: `Bearer ${localStorage.getItem("serviceToken")}`
51
- },
52
- method: "GET"
53
- };
54
- const data = await makeRequest(url, alteredOptions);
55
- return data;
56
- }
57
- static async delete(url) {
58
- const alteredOptions = {
59
- headers: {
60
- "Content-Type": "application/json",
61
- Authorization: `Bearer ${localStorage.getItem("serviceToken")}`
62
- },
63
- method: "DELETE"
64
- };
65
- const data = await makeRequest(url, alteredOptions);
66
- return data;
67
- }
68
- static async put(url, body = {}) {
69
- const alteredOptions = {
70
- headers: {
71
- "Content-Type": "application/json",
72
- Authorization: `Bearer ${localStorage.getItem("serviceToken")}`
73
- },
74
- body: JSON.stringify(body),
75
- method: "PUT"
76
- };
77
- const apiResponse = await makeRequest(url, alteredOptions);
78
- return apiResponse;
79
- }
80
- static async fetch(url, options = {}) {
81
- const alteredOptions = {
82
- headers: {
83
- "Content-Type": "application/json",
84
- Authorization: `Bearer ${localStorage.getItem("serviceToken")}`
85
- },
86
- ...options
87
- };
88
- const result = await fetch(url, alteredOptions);
89
- return result;
90
- }
91
- static async tempFetch(url, options = {}) {
92
- const alteredOptions = {
93
- headers: {
94
- "Content-Type": "application/json"
95
- },
96
- ...options
97
- };
98
- const apiResponse = await makeRequest(url, alteredOptions);
99
- return apiResponse;
100
- }
101
- static async upload(url, formData) {
102
- const alteredOptions = {
103
- headers: {
104
- Authorization: `Bearer ${localStorage.getItem("serviceToken")}`
105
- },
106
- body: formData,
107
- method: "POST"
108
- };
109
- const apiResponse = await makeRequest(url, alteredOptions);
110
- return apiResponse;
111
- }
112
- };
113
-
114
- // src/utils/api2.ts
115
- var makeRequest2 = async (url, options = {}) => {
116
- const response = await fetch(url, options);
117
- if (response.ok) {
118
- const apiData = await response.json();
119
- return {
120
- apiData,
121
- status: response.status
122
- };
123
- } else if (response.status === 404) {
124
- const apiData = await response.json();
125
- const data = {
126
- status: response.status,
127
- title: apiData.title
128
- };
129
- return data;
130
- }
131
- const apiResponse = await response.json();
132
- return apiResponse;
133
- };
134
- var api2 = class {
135
- static async filter(url, postModel) {
136
- const alteredOptions = {
137
- headers: {
138
- "Content-Type": "application/json",
139
- Authorization: `Bearer ${sessionStorage.getItem("serviceToken")}`
140
- },
141
- body: JSON.stringify({ ...postModel, ...postModel.filterModel }),
142
- method: "POST"
143
- };
144
- const apiResponse = await makeRequest2(url, alteredOptions);
145
- return apiResponse;
146
- }
147
- static async post(url, body = {}) {
148
- const alteredOptions = {
149
- headers: {
150
- "Content-Type": "application/json",
151
- Authorization: `Bearer ${sessionStorage.getItem("serviceToken")}`
152
- },
153
- body: JSON.stringify(body),
154
- method: "POST"
155
- };
156
- const apiResponse = await makeRequest2(url, alteredOptions);
157
- return apiResponse;
158
- }
159
- static async get(url) {
160
- const alteredOptions = {
161
- headers: {
162
- "Content-Type": "application/json",
163
- Authorization: `Bearer ${sessionStorage.getItem("serviceToken")}`
164
- },
165
- method: "GET"
166
- };
167
- const data = await makeRequest2(url, alteredOptions);
168
- return data;
169
- }
170
- static async delete(url) {
171
- const alteredOptions = {
172
- headers: {
173
- "Content-Type": "application/json",
174
- Authorization: `Bearer ${sessionStorage.getItem("serviceToken")}`
175
- },
176
- method: "DELETE"
177
- };
178
- const data = await makeRequest2(url, alteredOptions);
179
- return data;
180
- }
181
- static async put(url, body = {}) {
182
- const alteredOptions = {
183
- headers: {
184
- "Content-Type": "application/json",
185
- Authorization: `Bearer ${sessionStorage.getItem("serviceToken")}`
186
- },
187
- body: JSON.stringify(body),
188
- method: "PUT"
189
- };
190
- const apiResponse = await makeRequest2(url, alteredOptions);
191
- return apiResponse;
192
- }
193
- static async fetch(url, options = {}) {
194
- const alteredOptions = {
195
- headers: {
196
- "Content-Type": "application/json",
197
- Authorization: `Bearer ${sessionStorage.getItem("serviceToken")}`
198
- },
199
- ...options
200
- };
201
- const result = await fetch(url, alteredOptions);
202
- return result;
203
- }
204
- static async tempFetch(url, options = {}) {
205
- const alteredOptions = {
206
- headers: {
207
- "Content-Type": "application/json"
208
- },
209
- ...options
210
- };
211
- const apiResponse = await makeRequest2(url, alteredOptions);
212
- return apiResponse;
213
- }
214
- static async upload(url, formData) {
215
- const alteredOptions = {
216
- headers: {
217
- Authorization: `Bearer ${sessionStorage.getItem("serviceToken")}`
218
- },
219
- body: formData,
220
- method: "POST"
221
- };
222
- const apiResponse = await makeRequest2(url, alteredOptions);
223
- return apiResponse;
224
- }
225
- };
226
-
227
- // src/utils/flattenObjectKeys.ts
228
- var isNested = (obj) => typeof obj === "object" && obj !== null;
229
- var isArray = (obj) => Array.isArray(obj);
230
- var flattenObjectKeys = (obj, prefix = "") => {
231
- if (!isNested(obj)) {
232
- return {
233
- [prefix]: obj
234
- };
235
- }
236
- return Object.keys(obj).reduce((acc, key) => {
237
- const currentPrefix = prefix.length ? `${prefix}.` : "";
238
- if (isNested(obj[key]) && Object.keys(obj[key]).length) {
239
- if (isArray(obj[key]) && obj[key].length) {
240
- obj[key].forEach((item, index) => {
241
- Object.assign(
242
- acc,
243
- flattenObjectKeys(item, `${currentPrefix + key}.${index}`)
244
- );
245
- });
246
- } else {
247
- Object.assign(acc, flattenObjectKeys(obj[key], currentPrefix + key));
248
- }
249
- acc[currentPrefix + key] = obj[key];
250
- } else {
251
- acc[currentPrefix + key] = obj[key];
252
- }
253
- return acc;
254
- }, {});
255
- };
256
-
257
- // src/utils/getTimezone.ts
258
- function getTimezone(adapter, value) {
259
- return value == null || !adapter.utils.isValid(value) ? null : adapter.utils.getTimezone(value);
260
- }
261
-
262
- // src/utils/handleServerErrors.ts
263
- var handleServerErrors = function handleServerErrors2(args) {
264
- const { errors, setError } = args;
265
- for (const key in errors) {
266
- const isKeyInVariables = Object.keys(flattenObjectKeys(errors)).includes(
267
- key
268
- );
269
- if (!isKeyInVariables) {
270
- continue;
271
- }
272
- const fieldError = errors[key];
273
- let errorMessage = "";
274
- if (Array.isArray(fieldError)) {
275
- errorMessage = fieldError.join(" ");
276
- }
277
- if (typeof fieldError === "string") {
278
- errorMessage = fieldError;
279
- }
280
- if (typeof fieldError === "boolean" && fieldError) {
281
- errorMessage = "Field is not valid.";
282
- }
283
- setError(key, {
284
- message: errorMessage
285
- });
286
- }
287
- };
288
-
289
- // src/utils/propertyExists.ts
290
- function propertyExists(obj, prop) {
291
- return typeof obj === "object" && obj !== null && Object.prototype.hasOwnProperty.call(obj, prop);
292
- }
293
-
294
- // src/utils/readValueAsDate.ts
295
- function readValueAsDate(adapter, value) {
296
- if (typeof value === "string") {
297
- if (value === "") {
298
- return null;
299
- }
300
- return adapter.utils.date(value);
301
- }
302
- return value;
303
- }
304
-
305
- // src/utils/removeLeadingTrailingSlashes.ts
306
- var removeLeadingTrailingSlashes = (route) => {
307
- return route.replace(/^\/|\/$/g, "");
308
- };
309
-
310
- // src/utils/schemaTools.ts
311
- import dayjs from "dayjs";
312
- import { z } from "zod";
313
- var schemaTools = {
314
- date: ({ message }) => z.coerce.string().transform((c) => c === "null" || c === "undefined" ? null : c).refine((c) => !!c, { message }).refine((c) => !!c ? dayjs(c).isValid() : true, {
315
- message: message ? message : "Invalid date"
316
- }),
317
- nullableDate: ({ message } = {}) => z.coerce.string().transform((c) => c === "null" ? null : c).transform((c) => c === "undefined" ? null : c).refine((c) => !c && c != null ? dayjs(c).isValid() : true, {
318
- message: message ? message : "Invalid date"
319
- })
320
- };
321
-
322
- export {
323
- api,
324
- api2,
325
- flattenObjectKeys,
326
- getTimezone,
327
- handleServerErrors,
328
- propertyExists,
329
- readValueAsDate,
330
- removeLeadingTrailingSlashes,
331
- schemaTools
332
- };
@@ -1,103 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { SxProps, ButtonTypeMap } from '@mui/material';
3
- import { PropsWithChildren, ReactNode } from 'react';
4
- import { OverrideProps } from '@mui/material/OverridableComponent';
5
-
6
- type ClearButtonProps = {
7
- isSubmitting: boolean;
8
- handleClear: () => void;
9
- sx?: SxProps;
10
- storeKey?: string;
11
- };
12
- declare const ClearButton: ({ isSubmitting, handleClear, sx, storeKey, }: ClearButtonProps) => react_jsx_runtime.JSX.Element;
13
-
14
- type FilterButtonProps = {
15
- isSubmitting: boolean;
16
- show?: boolean;
17
- title?: string;
18
- icon?: React.ReactNode;
19
- sx?: SxProps;
20
- iconSx?: SxProps;
21
- };
22
- declare const FilterButton: ({ isSubmitting, show, title, icon, sx, iconSx, }: FilterButtonProps) => react_jsx_runtime.JSX.Element;
23
-
24
- type FilterWrapperProps = PropsWithChildren<{
25
- title?: string;
26
- filterCount?: number;
27
- cardSx?: SxProps;
28
- textSx?: SxProps;
29
- icon?: ReactNode;
30
- iconSx?: SxProps;
31
- showCount?: boolean;
32
- }>;
33
- declare const FilterWrapper: ({ children, title, filterCount, cardSx, textSx, icon, iconSx, showCount, }: FilterWrapperProps) => react_jsx_runtime.JSX.Element;
34
-
35
- type FormWrapper = PropsWithChildren<{
36
- title: string;
37
- editMode?: boolean;
38
- icon?: ReactNode;
39
- cardSx?: SxProps;
40
- textSx?: SxProps;
41
- actionButton?: ReactNode;
42
- }>;
43
- declare const FormWrapper: ({ children, title, editMode, cardSx, textSx, icon, actionButton, }: FormWrapper) => react_jsx_runtime.JSX.Element;
44
-
45
- type LabelTextProps = {
46
- label: string;
47
- value: React.ReactNode;
48
- gridSize?: {
49
- labelSize: {
50
- xs: number;
51
- sm: number;
52
- md: number;
53
- };
54
- valueSize: {
55
- xs: number;
56
- sm: number;
57
- md: number;
58
- };
59
- };
60
- containerSize?: {
61
- xs: number;
62
- sm: number;
63
- md: number;
64
- };
65
- labelSx?: SxProps;
66
- valueSx?: SxProps;
67
- };
68
- declare const LabelText: ({ label, value, gridSize, containerSize, labelSx, valueSx, }: LabelTextProps) => react_jsx_runtime.JSX.Element;
69
-
70
- type ListWrapperProps = PropsWithChildren<{
71
- title?: string;
72
- count?: number;
73
- show?: boolean;
74
- actionButton?: ReactNode;
75
- cardSx?: SxProps;
76
- textSx?: SxProps;
77
- icon?: ReactNode;
78
- showCount?: boolean;
79
- iconSx?: SxProps;
80
- }>;
81
- declare const ListWrapper: ({ children, title, count, show, actionButton, cardSx, textSx, icon, iconSx, showCount, }: ListWrapperProps) => react_jsx_runtime.JSX.Element;
82
-
83
- declare const SimpleToolbar: () => react_jsx_runtime.JSX.Element;
84
-
85
- type SimpleButtonProps<RootComponent extends React.ElementType = ButtonTypeMap["defaultComponent"], AdditionalProps = {}> = OverrideProps<ButtonTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
86
- component?: React.ElementType;
87
- show?: boolean;
88
- };
89
- declare const SimpleButton: (props: SimpleButtonProps) => react_jsx_runtime.JSX.Element;
90
-
91
- type AuthorizedViewProps = PropsWithChildren & {
92
- show: boolean;
93
- };
94
- declare const AuthorizedView: ({ children, show }: AuthorizedViewProps) => react_jsx_runtime.JSX.Element;
95
-
96
- type CancelButtonProps = {
97
- isSubmitting: boolean;
98
- handleCancel: () => void;
99
- sx?: SxProps;
100
- };
101
- declare const CancelButton: ({ isSubmitting, handleCancel, sx, }: CancelButtonProps) => react_jsx_runtime.JSX.Element;
102
-
103
- export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar };
@@ -1,24 +0,0 @@
1
- import {
2
- AuthorizedView_default,
3
- CancelButton_default,
4
- ClearButton_default,
5
- FilterButton_default,
6
- FilterWrapper_default,
7
- FormWrapper_default,
8
- LabelText_default,
9
- ListWrapper_default,
10
- SimpleButton_default,
11
- SimpleToolbar_default
12
- } from "../chunk-FSU3H777.mjs";
13
- export {
14
- AuthorizedView_default as AuthorizedView,
15
- CancelButton_default as CancelButton,
16
- ClearButton_default as ClearButton,
17
- FilterButton_default as FilterButton,
18
- FilterWrapper_default as FilterWrapper,
19
- FormWrapper_default as FormWrapper,
20
- LabelText_default as LabelText,
21
- ListWrapper_default as ListWrapper,
22
- SimpleButton_default as SimpleButton,
23
- SimpleToolbar_default as SimpleToolbar
24
- };
@@ -1,17 +0,0 @@
1
- import { FieldValues, FieldPath, UseControllerReturn, PathValue } from 'react-hook-form';
2
-
3
- type UseTransformOptions<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue = unknown> = {
4
- value: UseControllerReturn<TFieldValues, TName>["field"]["value"];
5
- onChange: UseControllerReturn<TFieldValues, TName>["field"]["onChange"];
6
- transform?: {
7
- input?: (value: PathValue<TFieldValues, TName>) => TValue;
8
- output?: (...event: any[]) => PathValue<TFieldValues, TName>;
9
- };
10
- };
11
- type UseTransformReturn<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue = unknown> = {
12
- value: TValue;
13
- onChange: UseControllerReturn<TFieldValues, TName>["field"]["onChange"];
14
- };
15
- declare function useTransform<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue = unknown>(options: UseTransformOptions<TFieldValues, TName, TValue>): UseTransformReturn<TFieldValues, TName, TValue>;
16
-
17
- export { type UseTransformOptions, type UseTransformReturn, useTransform };
@@ -1,7 +0,0 @@
1
- import "../chunk-2JFL7TS5.mjs";
2
- import {
3
- useTransform
4
- } from "../chunk-GFSTK7KN.mjs";
5
- export {
6
- useTransform
7
- };
package/dist/index.d.mts DELETED
@@ -1,18 +0,0 @@
1
- export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar } from './components/index.mjs';
2
- export { UseTransformOptions, UseTransformReturn, useTransform } from './hooks/index.mjs';
3
- export { ApiResponse, ListResponse, OperationResponse, PostModel, ValidationErrors, ValueLabel } from './types/index.mjs';
4
- export { api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools } from './utils/index.mjs';
5
- export { Field } from './wrappers/index.mjs';
6
- export { Field2 } from './wrappers2/index.mjs';
7
- export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-Cz4bgak0.mjs';
8
- export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-oN6XnOTJ.mjs';
9
- import 'react/jsx-runtime';
10
- import '@mui/material';
11
- import 'react';
12
- import '@mui/material/OverridableComponent';
13
- import 'react-hook-form';
14
- import '@mui/x-data-grid';
15
- import '@mui/x-date-pickers';
16
- import '@mui/x-date-pickers/internals';
17
- import 'zod';
18
- import '@mui/x-date-pickers/models';
package/dist/index.mjs DELETED
@@ -1,58 +0,0 @@
1
- import {
2
- AuthorizedView_default,
3
- CancelButton_default,
4
- ClearButton_default,
5
- FilterButton_default,
6
- FilterWrapper_default,
7
- FormWrapper_default,
8
- LabelText_default,
9
- ListWrapper_default,
10
- SimpleButton_default,
11
- SimpleToolbar_default
12
- } from "./chunk-FSU3H777.mjs";
13
- import "./chunk-2JFL7TS5.mjs";
14
- import "./chunk-EVPUCTZA.mjs";
15
- import {
16
- Field_default as Field_default2
17
- } from "./chunk-5HOGPCEO.mjs";
18
- import {
19
- Field_default
20
- } from "./chunk-BWQUYXUW.mjs";
21
- import {
22
- useTransform
23
- } from "./chunk-GFSTK7KN.mjs";
24
- import {
25
- api,
26
- api2,
27
- flattenObjectKeys,
28
- getTimezone,
29
- handleServerErrors,
30
- propertyExists,
31
- readValueAsDate,
32
- removeLeadingTrailingSlashes,
33
- schemaTools
34
- } from "./chunk-RQS44YC7.mjs";
35
- export {
36
- AuthorizedView_default as AuthorizedView,
37
- CancelButton_default as CancelButton,
38
- ClearButton_default as ClearButton,
39
- Field_default as Field,
40
- Field_default2 as Field2,
41
- FilterButton_default as FilterButton,
42
- FilterWrapper_default as FilterWrapper,
43
- FormWrapper_default as FormWrapper,
44
- LabelText_default as LabelText,
45
- ListWrapper_default as ListWrapper,
46
- SimpleButton_default as SimpleButton,
47
- SimpleToolbar_default as SimpleToolbar,
48
- api,
49
- api2,
50
- flattenObjectKeys,
51
- getTimezone,
52
- handleServerErrors,
53
- propertyExists,
54
- readValueAsDate,
55
- removeLeadingTrailingSlashes,
56
- schemaTools,
57
- useTransform
58
- };
@@ -1,44 +0,0 @@
1
- import { GridSortModel } from '@mui/x-data-grid';
2
- export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.mjs';
3
- export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-oN6XnOTJ.mjs';
4
-
5
- type ValidationErrors = {
6
- [field: string]: string | string[] | boolean | {
7
- key: string;
8
- message: string;
9
- };
10
- };
11
-
12
- type ApiResponse<TModel> = {
13
- type?: string;
14
- title?: string;
15
- status?: number;
16
- traceId?: string;
17
- errors?: ValidationErrors;
18
- modelErrors?: boolean;
19
- apiData?: TModel;
20
- };
21
-
22
- type OperationResponse = {
23
- id?: number;
24
- rowsAffected: number;
25
- };
26
-
27
- type PostModel<TFilterModel> = {
28
- filterModel?: TFilterModel;
29
- pageOffset: number;
30
- pageSize: number;
31
- sortField: string | null;
32
- sortOrder: "asc" | "desc" | null | undefined;
33
- sortModel?: GridSortModel;
34
- };
35
- type ListResponse<TGridModel> = {
36
- Data: TGridModel[];
37
- Total: number;
38
- };
39
- type ValueLabel = {
40
- Value: number | string;
41
- Label: string;
42
- };
43
-
44
- export type { ApiResponse, ListResponse, OperationResponse, PostModel, ValidationErrors, ValueLabel };
@@ -1 +0,0 @@
1
- import "../chunk-EVPUCTZA.mjs";
@@ -1,59 +0,0 @@
1
- import { PostModel, ApiResponse, ListResponse, ValidationErrors } from '../types/index.mjs';
2
- import { PickerValidDate } from '@mui/x-date-pickers';
3
- import { useLocalizationContext } from '@mui/x-date-pickers/internals';
4
- import { FieldValues, UseFormSetError } from 'react-hook-form';
5
- import { z } from 'zod';
6
- import '@mui/x-data-grid';
7
- import '../AsyncSelectPayload-Cz4bgak0.mjs';
8
- import '../OptionItem-oN6XnOTJ.mjs';
9
-
10
- declare class api {
11
- static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
12
- static post<T>(url: string, body?: any): Promise<ApiResponse<T>>;
13
- static get<T>(url: string): Promise<ApiResponse<T>>;
14
- static delete<T>(url: string): Promise<ApiResponse<T>>;
15
- static put<T>(url: string, body?: any): Promise<ApiResponse<T>>;
16
- static fetch(url: string, options?: any): Promise<Response>;
17
- static tempFetch<T>(url: string, options?: any): Promise<ApiResponse<T>>;
18
- static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
19
- }
20
-
21
- declare class api2 {
22
- static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
23
- static post<T>(url: string, body?: any): Promise<ApiResponse<T>>;
24
- static get<T>(url: string): Promise<ApiResponse<T>>;
25
- static delete<T>(url: string): Promise<ApiResponse<T>>;
26
- static put<T>(url: string, body?: any): Promise<ApiResponse<T>>;
27
- static fetch(url: string, options?: any): Promise<Response>;
28
- static tempFetch<T>(url: string, options?: any): Promise<ApiResponse<T>>;
29
- static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
30
- }
31
-
32
- declare const flattenObjectKeys: (obj: any, prefix?: string) => {
33
- [x: string]: any;
34
- };
35
-
36
- declare function getTimezone<TDate extends PickerValidDate>(adapter: ReturnType<typeof useLocalizationContext>, value: TDate): string | null;
37
-
38
- type HandleServerErrorsType<TFieldValues extends FieldValues = FieldValues> = {
39
- errors?: ValidationErrors;
40
- setError: UseFormSetError<TFieldValues>;
41
- };
42
- declare const handleServerErrors: <TFieldValues extends FieldValues = FieldValues>(args: HandleServerErrorsType<TFieldValues>) => void;
43
-
44
- declare function propertyExists<X, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
45
-
46
- declare function readValueAsDate<TDate extends PickerValidDate>(adapter: ReturnType<typeof useLocalizationContext>, value: string | null | TDate): TDate | null;
47
-
48
- declare const removeLeadingTrailingSlashes: (route: string) => string;
49
-
50
- declare const schemaTools: {
51
- date: ({ message }: {
52
- message?: string;
53
- }) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string | null, string>, string | null, string>, string | null, string>;
54
- nullableDate: ({ message }?: {
55
- message?: string | null;
56
- }) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string | null, string>, string | null, string>, string | null, string>;
57
- };
58
-
59
- export { api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools };
@@ -1,22 +0,0 @@
1
- import {
2
- api,
3
- api2,
4
- flattenObjectKeys,
5
- getTimezone,
6
- handleServerErrors,
7
- propertyExists,
8
- readValueAsDate,
9
- removeLeadingTrailingSlashes,
10
- schemaTools
11
- } from "../chunk-RQS44YC7.mjs";
12
- export {
13
- api,
14
- api2,
15
- flattenObjectKeys,
16
- getTimezone,
17
- handleServerErrors,
18
- propertyExists,
19
- readValueAsDate,
20
- removeLeadingTrailingSlashes,
21
- schemaTools
22
- };