@gnwebsoft/ui 3.0.1 → 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.
- package/README.md +688 -0
- package/dist/chunk-4H3AFH7A.js +505 -0
- package/dist/chunk-DE62KYFK.js +122 -0
- package/dist/chunk-DEPJRTVT.js +1 -0
- package/dist/chunk-EBRUE2WR.cjs +493 -0
- package/dist/chunk-FD57PCAC.cjs +1 -0
- package/dist/chunk-H3GQLELL.js +2025 -0
- package/dist/chunk-MVPLBJRK.cjs +1 -0
- package/dist/chunk-OJF67RNM.js +1 -0
- package/dist/chunk-OT7COE7R.cjs +2025 -0
- package/dist/chunk-R2YK4LTT.cjs +122 -0
- package/dist/chunk-U6SDYCWF.js +493 -0
- package/dist/chunk-ZC7FGYL2.cjs +505 -0
- package/dist/components/index.cjs +25 -0
- package/dist/components/index.d.cts +752 -0
- package/dist/components/index.d.ts +664 -15
- package/dist/components/index.js +25 -24
- package/dist/enhanced-z-I7EHVS.d.cts +134 -0
- package/dist/enhanced-z-I7EHVS.d.ts +134 -0
- package/dist/hooks/index.cjs +12 -0
- package/dist/hooks/index.d.cts +95 -0
- package/dist/hooks/index.d.ts +82 -4
- package/dist/hooks/index.js +12 -7
- package/dist/index.cjs +127 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +127 -54
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +241 -0
- package/dist/types/index.d.ts +205 -20
- package/dist/types/index.js +2 -1
- package/dist/utils/index.cjs +45 -0
- package/dist/utils/index.d.cts +366 -0
- package/dist/utils/index.d.ts +317 -9
- package/dist/utils/index.js +45 -22
- package/dist/wrappers/index.cjs +54 -0
- package/dist/wrappers/index.d.cts +1684 -0
- package/dist/wrappers/index.d.ts +1601 -118
- package/dist/wrappers/index.js +54 -8
- package/package.json +139 -88
- package/dist/AsyncSelectPayload-Cz4bgak0.d.mts +0 -10
- package/dist/AsyncSelectPayload-Cz4bgak0.d.ts +0 -10
- package/dist/chunk-2JFL7TS5.mjs +0 -0
- package/dist/chunk-6BGQA4BQ.js +0 -1
- package/dist/chunk-6JZ35VQJ.js +0 -19
- package/dist/chunk-7M2VOCYN.js +0 -1
- package/dist/chunk-BWQUYXUW.mjs +0 -1634
- package/dist/chunk-D3J7MWAU.js +0 -1634
- package/dist/chunk-EVPUCTZA.mjs +0 -0
- package/dist/chunk-FSU3H777.mjs +0 -473
- package/dist/chunk-GFSTK7KN.mjs +0 -19
- package/dist/chunk-I7EIUZKK.js +0 -332
- package/dist/chunk-JKUOV3MN.js +0 -473
- package/dist/chunk-RQS44YC7.mjs +0 -332
- package/dist/components/index.d.mts +0 -103
- package/dist/components/index.mjs +0 -24
- package/dist/hooks/index.d.mts +0 -17
- package/dist/hooks/index.mjs +0 -7
- package/dist/index.d.mts +0 -16
- package/dist/index.mjs +0 -54
- package/dist/types/index.d.mts +0 -56
- package/dist/types/index.mjs +0 -1
- package/dist/utils/index.d.mts +0 -58
- package/dist/utils/index.mjs +0 -22
- package/dist/wrappers/index.d.mts +0 -201
- package/dist/wrappers/index.mjs +0 -8
package/dist/chunk-RQS44YC7.mjs
DELETED
|
@@ -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
|
-
};
|
package/dist/hooks/index.d.mts
DELETED
|
@@ -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 };
|
package/dist/hooks/index.mjs
DELETED
package/dist/index.d.mts
DELETED
|
@@ -1,16 +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, AsyncMultiSelectPayload, ListResponse, OperationResponse, OptionItem, OptionItem2, 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 { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-Cz4bgak0.mjs';
|
|
7
|
-
import 'react/jsx-runtime';
|
|
8
|
-
import '@mui/material';
|
|
9
|
-
import 'react';
|
|
10
|
-
import '@mui/material/OverridableComponent';
|
|
11
|
-
import 'react-hook-form';
|
|
12
|
-
import '@mui/x-data-grid';
|
|
13
|
-
import '@mui/x-date-pickers';
|
|
14
|
-
import '@mui/x-date-pickers/internals';
|
|
15
|
-
import 'zod';
|
|
16
|
-
import '@mui/x-date-pickers/models';
|
package/dist/index.mjs
DELETED
|
@@ -1,54 +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
|
|
17
|
-
} from "./chunk-BWQUYXUW.mjs";
|
|
18
|
-
import {
|
|
19
|
-
useTransform
|
|
20
|
-
} from "./chunk-GFSTK7KN.mjs";
|
|
21
|
-
import {
|
|
22
|
-
api,
|
|
23
|
-
api2,
|
|
24
|
-
flattenObjectKeys,
|
|
25
|
-
getTimezone,
|
|
26
|
-
handleServerErrors,
|
|
27
|
-
propertyExists,
|
|
28
|
-
readValueAsDate,
|
|
29
|
-
removeLeadingTrailingSlashes,
|
|
30
|
-
schemaTools
|
|
31
|
-
} from "./chunk-RQS44YC7.mjs";
|
|
32
|
-
export {
|
|
33
|
-
AuthorizedView_default as AuthorizedView,
|
|
34
|
-
CancelButton_default as CancelButton,
|
|
35
|
-
ClearButton_default as ClearButton,
|
|
36
|
-
Field_default as Field,
|
|
37
|
-
FilterButton_default as FilterButton,
|
|
38
|
-
FilterWrapper_default as FilterWrapper,
|
|
39
|
-
FormWrapper_default as FormWrapper,
|
|
40
|
-
LabelText_default as LabelText,
|
|
41
|
-
ListWrapper_default as ListWrapper,
|
|
42
|
-
SimpleButton_default as SimpleButton,
|
|
43
|
-
SimpleToolbar_default as SimpleToolbar,
|
|
44
|
-
api,
|
|
45
|
-
api2,
|
|
46
|
-
flattenObjectKeys,
|
|
47
|
-
getTimezone,
|
|
48
|
-
handleServerErrors,
|
|
49
|
-
propertyExists,
|
|
50
|
-
readValueAsDate,
|
|
51
|
-
removeLeadingTrailingSlashes,
|
|
52
|
-
schemaTools,
|
|
53
|
-
useTransform
|
|
54
|
-
};
|
package/dist/types/index.d.mts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { GridSortModel } from '@mui/x-data-grid';
|
|
2
|
-
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.mjs';
|
|
3
|
-
|
|
4
|
-
type ValidationErrors = {
|
|
5
|
-
[field: string]: string | string[] | boolean | {
|
|
6
|
-
key: string;
|
|
7
|
-
message: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
type ApiResponse<TModel> = {
|
|
12
|
-
type?: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
status?: number;
|
|
15
|
-
traceId?: string;
|
|
16
|
-
errors?: ValidationErrors;
|
|
17
|
-
modelErrors?: boolean;
|
|
18
|
-
apiData?: TModel;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type OptionItem = {
|
|
22
|
-
Label: string;
|
|
23
|
-
Value: string;
|
|
24
|
-
};
|
|
25
|
-
type AsyncMultiSelectPayload = {
|
|
26
|
-
query: string | null;
|
|
27
|
-
initialValues?: string[] | number[] | null;
|
|
28
|
-
};
|
|
29
|
-
type OptionItem2 = {
|
|
30
|
-
Label: string;
|
|
31
|
-
Value: number | string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
type OperationResponse = {
|
|
35
|
-
id?: number;
|
|
36
|
-
rowsAffected: number;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
type PostModel<TFilterModel> = {
|
|
40
|
-
filterModel?: TFilterModel;
|
|
41
|
-
pageOffset: number;
|
|
42
|
-
pageSize: number;
|
|
43
|
-
sortField: string | null;
|
|
44
|
-
sortOrder: "asc" | "desc" | null | undefined;
|
|
45
|
-
sortModel?: GridSortModel;
|
|
46
|
-
};
|
|
47
|
-
type ListResponse<TGridModel> = {
|
|
48
|
-
Data: TGridModel[];
|
|
49
|
-
Total: number;
|
|
50
|
-
};
|
|
51
|
-
type ValueLabel = {
|
|
52
|
-
Value: number | string;
|
|
53
|
-
Label: string;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type { ApiResponse, AsyncMultiSelectPayload, ListResponse, OperationResponse, OptionItem, OptionItem2, PostModel, ValidationErrors, ValueLabel };
|
package/dist/types/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../chunk-EVPUCTZA.mjs";
|
package/dist/utils/index.d.mts
DELETED
|
@@ -1,58 +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
|
-
|
|
9
|
-
declare class api {
|
|
10
|
-
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
|
11
|
-
static post<T>(url: string, body?: any): Promise<ApiResponse<T>>;
|
|
12
|
-
static get<T>(url: string): Promise<ApiResponse<T>>;
|
|
13
|
-
static delete<T>(url: string): Promise<ApiResponse<T>>;
|
|
14
|
-
static put<T>(url: string, body?: any): Promise<ApiResponse<T>>;
|
|
15
|
-
static fetch(url: string, options?: any): Promise<Response>;
|
|
16
|
-
static tempFetch<T>(url: string, options?: any): Promise<ApiResponse<T>>;
|
|
17
|
-
static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare class api2 {
|
|
21
|
-
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
|
22
|
-
static post<T>(url: string, body?: any): Promise<ApiResponse<T>>;
|
|
23
|
-
static get<T>(url: string): Promise<ApiResponse<T>>;
|
|
24
|
-
static delete<T>(url: string): Promise<ApiResponse<T>>;
|
|
25
|
-
static put<T>(url: string, body?: any): Promise<ApiResponse<T>>;
|
|
26
|
-
static fetch(url: string, options?: any): Promise<Response>;
|
|
27
|
-
static tempFetch<T>(url: string, options?: any): Promise<ApiResponse<T>>;
|
|
28
|
-
static upload<T>(url: string, formData: FormData): Promise<ApiResponse<T>>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare const flattenObjectKeys: (obj: any, prefix?: string) => {
|
|
32
|
-
[x: string]: any;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
declare function getTimezone<TDate extends PickerValidDate>(adapter: ReturnType<typeof useLocalizationContext>, value: TDate): string | null;
|
|
36
|
-
|
|
37
|
-
type HandleServerErrorsType<TFieldValues extends FieldValues = FieldValues> = {
|
|
38
|
-
errors?: ValidationErrors;
|
|
39
|
-
setError: UseFormSetError<TFieldValues>;
|
|
40
|
-
};
|
|
41
|
-
declare const handleServerErrors: <TFieldValues extends FieldValues = FieldValues>(args: HandleServerErrorsType<TFieldValues>) => void;
|
|
42
|
-
|
|
43
|
-
declare function propertyExists<X, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
|
44
|
-
|
|
45
|
-
declare function readValueAsDate<TDate extends PickerValidDate>(adapter: ReturnType<typeof useLocalizationContext>, value: string | null | TDate): TDate | null;
|
|
46
|
-
|
|
47
|
-
declare const removeLeadingTrailingSlashes: (route: string) => string;
|
|
48
|
-
|
|
49
|
-
declare const schemaTools: {
|
|
50
|
-
date: ({ message }: {
|
|
51
|
-
message?: string;
|
|
52
|
-
}) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string | null, string>, string | null, string>, string | null, string>;
|
|
53
|
-
nullableDate: ({ message }?: {
|
|
54
|
-
message?: string | null;
|
|
55
|
-
}) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string | null, string>, string | null, string>, string | null, string>;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export { api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools };
|