@gnwebsoft/ui 3.0.1 → 3.0.4

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 (66) 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 -6
  27. package/dist/index.js +127 -54
  28. package/dist/types/index.cjs +2 -0
  29. package/dist/types/index.d.cts +241 -0
  30. package/dist/types/index.d.ts +205 -20
  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 -9
  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 +145 -88
  41. package/dist/AsyncSelectPayload-Cz4bgak0.d.mts +0 -10
  42. package/dist/AsyncSelectPayload-Cz4bgak0.d.ts +0 -10
  43. package/dist/chunk-2JFL7TS5.mjs +0 -0
  44. package/dist/chunk-6BGQA4BQ.js +0 -1
  45. package/dist/chunk-6JZ35VQJ.js +0 -19
  46. package/dist/chunk-7M2VOCYN.js +0 -1
  47. package/dist/chunk-BWQUYXUW.mjs +0 -1634
  48. package/dist/chunk-D3J7MWAU.js +0 -1634
  49. package/dist/chunk-EVPUCTZA.mjs +0 -0
  50. package/dist/chunk-FSU3H777.mjs +0 -473
  51. package/dist/chunk-GFSTK7KN.mjs +0 -19
  52. package/dist/chunk-I7EIUZKK.js +0 -332
  53. package/dist/chunk-JKUOV3MN.js +0 -473
  54. package/dist/chunk-RQS44YC7.mjs +0 -332
  55. package/dist/components/index.d.mts +0 -103
  56. package/dist/components/index.mjs +0 -24
  57. package/dist/hooks/index.d.mts +0 -17
  58. package/dist/hooks/index.mjs +0 -7
  59. package/dist/index.d.mts +0 -16
  60. package/dist/index.mjs +0 -54
  61. package/dist/types/index.d.mts +0 -56
  62. package/dist/types/index.mjs +0 -1
  63. package/dist/utils/index.d.mts +0 -58
  64. package/dist/utils/index.mjs +0 -22
  65. package/dist/wrappers/index.d.mts +0 -201
  66. package/dist/wrappers/index.mjs +0 -8
File without changes
@@ -1,473 +0,0 @@
1
- // src/components/ClearButton/ClearButton.tsx
2
- import { Button } from "@mui/material";
3
- import { jsx } from "react/jsx-runtime";
4
- var ClearButton = ({
5
- isSubmitting,
6
- handleClear,
7
- sx,
8
- storeKey
9
- }) => {
10
- const onClick = () => {
11
- handleClear();
12
- if (storeKey != null) {
13
- localStorage.removeItem(storeKey);
14
- }
15
- };
16
- return /* @__PURE__ */ jsx(
17
- Button,
18
- {
19
- variant: "outlined",
20
- onClick,
21
- disabled: isSubmitting,
22
- sx,
23
- children: "Clear"
24
- }
25
- );
26
- };
27
- var ClearButton_default = ClearButton;
28
-
29
- // src/components/FilterButton/FilterButton.tsx
30
- import { LoadingButton } from "@mui/lab";
31
- import { Badge } from "@mui/material";
32
- import FilterAltIcon from "@mui/icons-material/FilterAlt";
33
- import { jsx as jsx2 } from "react/jsx-runtime";
34
- var FilterButton = ({
35
- isSubmitting,
36
- show,
37
- title,
38
- icon,
39
- sx,
40
- iconSx
41
- }) => {
42
- return /* @__PURE__ */ jsx2(
43
- LoadingButton,
44
- {
45
- type: "submit",
46
- variant: "contained",
47
- loading: isSubmitting,
48
- disabled: !show,
49
- disableRipple: true,
50
- color: "primary",
51
- sx: {
52
- display: "flex",
53
- alignItems: "center",
54
- ...sx
55
- },
56
- startIcon: /* @__PURE__ */ jsx2(Badge, { color: "error", variant: "standard", children: icon ? icon : /* @__PURE__ */ jsx2(FilterAltIcon, { width: "20", height: "20", sx: iconSx }) }),
57
- children: title?.trim() === "" || !title ? "Filter" : title
58
- }
59
- );
60
- };
61
- var FilterButton_default = FilterButton;
62
-
63
- // src/components/FilterWrapper/FilterWrapper.tsx
64
- import {
65
- Box,
66
- Card,
67
- CardContent,
68
- CardHeader,
69
- Divider,
70
- Grid2,
71
- Typography,
72
- useTheme as useTheme2
73
- } from "@mui/material";
74
- import ManageSearchIcon from "@mui/icons-material/ManageSearch";
75
- import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
76
- var FilterWrapper = ({
77
- children,
78
- title,
79
- filterCount,
80
- cardSx,
81
- textSx,
82
- icon,
83
- iconSx,
84
- showCount
85
- }) => {
86
- const theme = useTheme2();
87
- return /* @__PURE__ */ jsxs(
88
- Card,
89
- {
90
- sx: {
91
- position: "relative",
92
- borderRadius: "0px",
93
- mb: 2,
94
- ...cardSx
95
- },
96
- children: [
97
- /* @__PURE__ */ jsx3(
98
- CardHeader,
99
- {
100
- sx: {
101
- display: "flex",
102
- flexWrap: "wrap",
103
- p: "1rem",
104
- ".MuiCardHeader-action": {
105
- margin: 0,
106
- alignSelf: "center"
107
- },
108
- alignItems: "center"
109
- },
110
- title: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
111
- icon ? icon : /* @__PURE__ */ jsx3(
112
- ManageSearchIcon,
113
- {
114
- sx: {
115
- height: "2.5rem",
116
- color: theme.palette.primary.main,
117
- ...iconSx
118
- }
119
- }
120
- ),
121
- /* @__PURE__ */ jsxs(
122
- Typography,
123
- {
124
- variant: "h5",
125
- sx: {
126
- fontWeight: "bold",
127
- color: theme.palette.primary.main,
128
- ...textSx
129
- },
130
- children: [
131
- title ? title : "Filter",
132
- " ",
133
- showCount ? `(${filterCount ? filterCount : 0})` : /* @__PURE__ */ jsx3(Fragment, {})
134
- ]
135
- }
136
- )
137
- ] })
138
- }
139
- ),
140
- /* @__PURE__ */ jsx3(Divider, {}),
141
- /* @__PURE__ */ jsx3(CardContent, { sx: { py: 2 }, children: /* @__PURE__ */ jsx3(Grid2, { container: true, spacing: 2, children }) })
142
- ]
143
- }
144
- );
145
- };
146
- var FilterWrapper_default = FilterWrapper;
147
-
148
- // src/components/FormWrapper/FormWrapper.tsx
149
- import {
150
- Box as Box2,
151
- Card as Card2,
152
- CardContent as CardContent2,
153
- CardHeader as CardHeader2,
154
- Divider as Divider2,
155
- Grid2 as Grid22,
156
- Typography as Typography2
157
- } from "@mui/material";
158
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
159
- var FormWrapper = ({
160
- children,
161
- title,
162
- editMode,
163
- cardSx,
164
- textSx,
165
- icon,
166
- actionButton
167
- }) => {
168
- return /* @__PURE__ */ jsxs2(
169
- Card2,
170
- {
171
- sx: {
172
- position: "relative",
173
- borderRadius: "0px",
174
- ...cardSx
175
- },
176
- children: [
177
- /* @__PURE__ */ jsx4(
178
- CardHeader2,
179
- {
180
- sx: {
181
- display: "flex",
182
- flexWrap: "wrap",
183
- p: "1rem",
184
- ".MuiCardHeader-action": {
185
- margin: 0,
186
- alignSelf: "center"
187
- }
188
- },
189
- title: /* @__PURE__ */ jsxs2(
190
- Box2,
191
- {
192
- sx: {
193
- display: "flex",
194
- alignItems: "center",
195
- justifyContent: "space-between"
196
- },
197
- children: [
198
- /* @__PURE__ */ jsxs2(Box2, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
199
- icon ?? icon,
200
- /* @__PURE__ */ jsx4(Typography2, { color: "primary", sx: textSx, children: title })
201
- ] }),
202
- actionButton
203
- ]
204
- }
205
- )
206
- }
207
- ),
208
- /* @__PURE__ */ jsx4(Divider2, { sx: { mt: 0 } }),
209
- /* @__PURE__ */ jsx4(CardContent2, { children: /* @__PURE__ */ jsx4(Grid22, { container: true, spacing: 2, children }) })
210
- ]
211
- }
212
- );
213
- };
214
- var FormWrapper_default = FormWrapper;
215
-
216
- // src/components/LabelText/LabelText.tsx
217
- import { Grid2 as Grid23, Tooltip, Typography as Typography3 } from "@mui/material";
218
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
219
- var LabelText = ({
220
- label,
221
- value,
222
- gridSize,
223
- containerSize,
224
- labelSx,
225
- valueSx
226
- }) => {
227
- const defaultGridSize = {
228
- labelSize: { xs: 6, sm: 6, md: 6 },
229
- valueSize: { xs: 12, sm: 6, md: 6 }
230
- };
231
- const defaultContainerSize = { xs: 12, sm: 6, md: 6 };
232
- const size = gridSize || defaultGridSize;
233
- const container = containerSize || defaultContainerSize;
234
- return /* @__PURE__ */ jsxs3(
235
- Grid23,
236
- {
237
- size: container,
238
- sx: {
239
- display: "flex",
240
- flexDirection: { xs: "column", sm: "row", md: "row" },
241
- "&:hover": { bgcolor: "#efefef", overflow: "hidden" }
242
- },
243
- children: [
244
- /* @__PURE__ */ jsxs3(
245
- Grid23,
246
- {
247
- size: size.labelSize,
248
- sx: {
249
- padding: "5px",
250
- fontSize: "14px",
251
- textAlign: { xs: "left", sm: "right", md: "right" },
252
- ...labelSx
253
- },
254
- children: [
255
- label,
256
- " :"
257
- ]
258
- }
259
- ),
260
- /* @__PURE__ */ jsx5(
261
- Grid23,
262
- {
263
- size: size.valueSize,
264
- sx: { padding: "5px", display: "flex", flexWrap: "wrap" },
265
- children: /* @__PURE__ */ jsx5(Tooltip, { title: value, arrow: true, children: /* @__PURE__ */ jsx5(
266
- Typography3,
267
- {
268
- sx: {
269
- fontSize: "14px",
270
- wordBreak: "break-word",
271
- overflow: "hidden",
272
- display: "-webkit-box",
273
- textOverflow: "ellipsis",
274
- WebkitLineClamp: 2,
275
- WebkitBoxOrient: "vertical",
276
- ...valueSx,
277
- color: "#078dee"
278
- },
279
- children: value ? value : "-"
280
- }
281
- ) })
282
- }
283
- )
284
- ]
285
- }
286
- );
287
- };
288
- var LabelText_default = LabelText;
289
-
290
- // src/components/ListWrapper/ListWrapper.tsx
291
- import {
292
- Box as Box3,
293
- Card as Card3,
294
- CardContent as CardContent3,
295
- CardHeader as CardHeader3,
296
- Divider as Divider3,
297
- Grid2 as Grid24,
298
- Typography as Typography4,
299
- useTheme as useTheme3
300
- } from "@mui/material";
301
- import ManageSearchIcon2 from "@mui/icons-material/ManageSearch";
302
- import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
303
- var ListWrapper = ({
304
- children,
305
- title,
306
- count,
307
- show = true,
308
- actionButton,
309
- cardSx,
310
- textSx,
311
- icon,
312
- iconSx,
313
- showCount = true
314
- }) => {
315
- const theme = useTheme3();
316
- if (!show) return /* @__PURE__ */ jsx6(Fragment2, {});
317
- return /* @__PURE__ */ jsxs4(
318
- Card3,
319
- {
320
- sx: {
321
- position: "relative",
322
- borderRadius: "0px",
323
- ...cardSx
324
- },
325
- children: [
326
- /* @__PURE__ */ jsx6(
327
- CardHeader3,
328
- {
329
- sx: {
330
- display: "flex",
331
- flexWrap: "wrap",
332
- p: "1rem",
333
- ".MuiCardHeader-action": {
334
- margin: 0,
335
- alignSelf: "center"
336
- },
337
- alignItems: "center"
338
- },
339
- title: /* @__PURE__ */ jsxs4(
340
- Box3,
341
- {
342
- sx: {
343
- display: "flex",
344
- alignItems: "center",
345
- justifyContent: "space-between"
346
- },
347
- children: [
348
- /* @__PURE__ */ jsxs4(Box3, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
349
- icon ? icon : /* @__PURE__ */ jsx6(
350
- ManageSearchIcon2,
351
- {
352
- sx: {
353
- height: "2.5rem",
354
- color: theme.palette.primary.main,
355
- ...iconSx
356
- }
357
- }
358
- ),
359
- /* @__PURE__ */ jsxs4(
360
- Typography4,
361
- {
362
- variant: "h5",
363
- sx: {
364
- fontWeight: "bold",
365
- color: theme.palette.primary.main,
366
- ...textSx
367
- },
368
- children: [
369
- title ? title : "List",
370
- showCount ? `(${count ? count : 0})` : /* @__PURE__ */ jsx6(Fragment2, {})
371
- ]
372
- }
373
- )
374
- ] }),
375
- actionButton
376
- ]
377
- }
378
- )
379
- }
380
- ),
381
- /* @__PURE__ */ jsx6(Divider3, {}),
382
- /* @__PURE__ */ jsx6(CardContent3, { sx: { pt: 0 }, children: /* @__PURE__ */ jsx6(Grid24, { container: true, spacing: 2, children }) })
383
- ]
384
- }
385
- );
386
- };
387
- var ListWrapper_default = ListWrapper;
388
-
389
- // src/components/SimpleToolbar/SimpleToolbar.tsx
390
- import {
391
- GridToolbarContainer,
392
- GridToolbarColumnsButton,
393
- GridToolbarExport,
394
- GridToolbarFilterButton,
395
- GridToolbarQuickFilter
396
- } from "@mui/x-data-grid";
397
- import { Box as Box4 } from "@mui/material";
398
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
399
- var SimpleToolbar = () => /* @__PURE__ */ jsxs5(GridToolbarContainer, { children: [
400
- /* @__PURE__ */ jsx7(
401
- GridToolbarQuickFilter,
402
- {
403
- sx: {
404
- "& .MuiInputBase-root": {
405
- borderRadius: "8px",
406
- padding: "6px 10px"
407
- },
408
- "& input": {
409
- fontSize: "14px",
410
- color: "#333"
411
- },
412
- borderRadius: "8px"
413
- }
414
- }
415
- ),
416
- /* @__PURE__ */ jsx7(Box4, { sx: { flexGrow: 1 } }),
417
- /* @__PURE__ */ jsx7(GridToolbarColumnsButton, {}),
418
- /* @__PURE__ */ jsx7(GridToolbarFilterButton, {}),
419
- /* @__PURE__ */ jsx7(GridToolbarExport, {})
420
- ] });
421
- var SimpleToolbar_default = SimpleToolbar;
422
-
423
- // src/components/SimpleButton/SimpleButton.tsx
424
- import { Button as Button2 } from "@mui/material";
425
- import { Fragment as Fragment3, jsx as jsx8 } from "react/jsx-runtime";
426
- var SimpleButton = function SelectMultiElement(props) {
427
- const { show, ...rest } = props;
428
- if (!!show) return /* @__PURE__ */ jsx8(Fragment3, {});
429
- return /* @__PURE__ */ jsx8(Button2, { ...rest });
430
- };
431
- var SimpleButton_default = SimpleButton;
432
-
433
- // src/components/AuthorizedView/AuthorizedView.tsx
434
- import { Fragment as Fragment4, jsx as jsx9 } from "react/jsx-runtime";
435
- var AuthorizedView = ({ children, show }) => {
436
- if (!show) return /* @__PURE__ */ jsx9(Fragment4, {});
437
- return /* @__PURE__ */ jsx9(Fragment4, { children });
438
- };
439
- var AuthorizedView_default = AuthorizedView;
440
-
441
- // src/components/CancelButton/CancelButton.tsx
442
- import { Button as Button3 } from "@mui/material";
443
- import { jsx as jsx10 } from "react/jsx-runtime";
444
- var CancelButton = ({
445
- isSubmitting,
446
- handleCancel,
447
- sx
448
- }) => {
449
- return /* @__PURE__ */ jsx10(
450
- Button3,
451
- {
452
- variant: "outlined",
453
- onClick: handleCancel,
454
- disabled: isSubmitting,
455
- sx,
456
- children: "Cancel"
457
- }
458
- );
459
- };
460
- var CancelButton_default = CancelButton;
461
-
462
- export {
463
- ClearButton_default,
464
- FilterButton_default,
465
- FilterWrapper_default,
466
- FormWrapper_default,
467
- LabelText_default,
468
- ListWrapper_default,
469
- SimpleToolbar_default,
470
- SimpleButton_default,
471
- AuthorizedView_default,
472
- CancelButton_default
473
- };
@@ -1,19 +0,0 @@
1
- // src/hooks/useTransform/index.ts
2
- function useTransform(options) {
3
- const value = typeof options.transform?.input === "function" ? options.transform.input(options.value) : options.value;
4
- const onChange = (...event) => {
5
- if (typeof options.transform?.output === "function") {
6
- options.onChange(options.transform.output(...event));
7
- } else {
8
- options.onChange(...event);
9
- }
10
- };
11
- return {
12
- value,
13
- onChange
14
- };
15
- }
16
-
17
- export {
18
- useTransform
19
- };