@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.
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 +139 -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
@@ -1,473 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/components/ClearButton/ClearButton.tsx
2
- var _material = require('@mui/material');
3
- var _jsxruntime = require('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__ */ _jsxruntime.jsx.call(void 0,
17
- _material.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
- var _lab = require('@mui/lab');
31
-
32
- var _FilterAlt = require('@mui/icons-material/FilterAlt'); var _FilterAlt2 = _interopRequireDefault(_FilterAlt);
33
-
34
- var FilterButton = ({
35
- isSubmitting,
36
- show,
37
- title,
38
- icon,
39
- sx,
40
- iconSx
41
- }) => {
42
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
43
- _lab.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__ */ _jsxruntime.jsx.call(void 0, _material.Badge, { color: "error", variant: "standard", children: icon ? icon : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FilterAlt2.default, { width: "20", height: "20", sx: iconSx }) }),
57
- children: _optionalChain([title, 'optionalAccess', _ => _.trim, 'call', _2 => _2()]) === "" || !title ? "Filter" : title
58
- }
59
- );
60
- };
61
- var FilterButton_default = FilterButton;
62
-
63
- // src/components/FilterWrapper/FilterWrapper.tsx
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
- var _ManageSearch = require('@mui/icons-material/ManageSearch'); var _ManageSearch2 = _interopRequireDefault(_ManageSearch);
75
-
76
- var FilterWrapper = ({
77
- children,
78
- title,
79
- filterCount,
80
- cardSx,
81
- textSx,
82
- icon,
83
- iconSx,
84
- showCount
85
- }) => {
86
- const theme = _material.useTheme.call(void 0, );
87
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
88
- _material.Card,
89
- {
90
- sx: {
91
- position: "relative",
92
- borderRadius: "0px",
93
- mb: 2,
94
- ...cardSx
95
- },
96
- children: [
97
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
98
- _material.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__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
111
- icon ? icon : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
112
- _ManageSearch2.default,
113
- {
114
- sx: {
115
- height: "2.5rem",
116
- color: theme.palette.primary.main,
117
- ...iconSx
118
- }
119
- }
120
- ),
121
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
122
- _material.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__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {})
134
- ]
135
- }
136
- )
137
- ] })
138
- }
139
- ),
140
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, {}),
141
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.CardContent, { sx: { py: 2 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { container: true, spacing: 2, children }) })
142
- ]
143
- }
144
- );
145
- };
146
- var FilterWrapper_default = FilterWrapper;
147
-
148
- // src/components/FormWrapper/FormWrapper.tsx
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
- var FormWrapper = ({
160
- children,
161
- title,
162
- editMode,
163
- cardSx,
164
- textSx,
165
- icon,
166
- actionButton
167
- }) => {
168
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
169
- _material.Card,
170
- {
171
- sx: {
172
- position: "relative",
173
- borderRadius: "0px",
174
- ...cardSx
175
- },
176
- children: [
177
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
178
- _material.CardHeader,
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__ */ _jsxruntime.jsxs.call(void 0,
190
- _material.Box,
191
- {
192
- sx: {
193
- display: "flex",
194
- alignItems: "center",
195
- justifyContent: "space-between"
196
- },
197
- children: [
198
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
199
- _nullishCoalesce(icon, () => ( icon)),
200
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, { color: "primary", sx: textSx, children: title })
201
- ] }),
202
- actionButton
203
- ]
204
- }
205
- )
206
- }
207
- ),
208
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, { sx: { mt: 0 } }),
209
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { container: true, spacing: 2, children }) })
210
- ]
211
- }
212
- );
213
- };
214
- var FormWrapper_default = FormWrapper;
215
-
216
- // src/components/LabelText/LabelText.tsx
217
-
218
-
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__ */ _jsxruntime.jsxs.call(void 0,
235
- _material.Grid2,
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__ */ _jsxruntime.jsxs.call(void 0,
245
- _material.Grid2,
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__ */ _jsxruntime.jsx.call(void 0,
261
- _material.Grid2,
262
- {
263
- size: size.valueSize,
264
- sx: { padding: "5px", display: "flex", flexWrap: "wrap" },
265
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Tooltip, { title: value, arrow: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
266
- _material.Typography,
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
-
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
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 = _material.useTheme.call(void 0, );
316
- if (!show) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
317
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
318
- _material.Card,
319
- {
320
- sx: {
321
- position: "relative",
322
- borderRadius: "0px",
323
- ...cardSx
324
- },
325
- children: [
326
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
327
- _material.CardHeader,
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__ */ _jsxruntime.jsxs.call(void 0,
340
- _material.Box,
341
- {
342
- sx: {
343
- display: "flex",
344
- alignItems: "center",
345
- justifyContent: "space-between"
346
- },
347
- children: [
348
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
349
- icon ? icon : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
350
- _ManageSearch2.default,
351
- {
352
- sx: {
353
- height: "2.5rem",
354
- color: theme.palette.primary.main,
355
- ...iconSx
356
- }
357
- }
358
- ),
359
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
360
- _material.Typography,
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__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {})
371
- ]
372
- }
373
- )
374
- ] }),
375
- actionButton
376
- ]
377
- }
378
- )
379
- }
380
- ),
381
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Divider, {}),
382
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.CardContent, { sx: { pt: 0 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { container: true, spacing: 2, children }) })
383
- ]
384
- }
385
- );
386
- };
387
- var ListWrapper_default = ListWrapper;
388
-
389
- // src/components/SimpleToolbar/SimpleToolbar.tsx
390
-
391
-
392
-
393
-
394
-
395
-
396
- var _xdatagrid = require('@mui/x-data-grid');
397
-
398
-
399
- var SimpleToolbar = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _xdatagrid.GridToolbarContainer, { children: [
400
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
401
- _xdatagrid.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__ */ _jsxruntime.jsx.call(void 0, _material.Box, { sx: { flexGrow: 1 } }),
417
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xdatagrid.GridToolbarColumnsButton, {}),
418
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xdatagrid.GridToolbarFilterButton, {}),
419
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _xdatagrid.GridToolbarExport, {})
420
- ] });
421
- var SimpleToolbar_default = SimpleToolbar;
422
-
423
- // src/components/SimpleButton/SimpleButton.tsx
424
-
425
-
426
- var SimpleButton = function SelectMultiElement(props) {
427
- const { show, ...rest } = props;
428
- if (!!show) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
429
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Button, { ...rest });
430
- };
431
- var SimpleButton_default = SimpleButton;
432
-
433
- // src/components/AuthorizedView/AuthorizedView.tsx
434
-
435
- var AuthorizedView = ({ children, show }) => {
436
- if (!show) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
437
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
438
- };
439
- var AuthorizedView_default = AuthorizedView;
440
-
441
- // src/components/CancelButton/CancelButton.tsx
442
-
443
-
444
- var CancelButton = ({
445
- isSubmitting,
446
- handleCancel,
447
- sx
448
- }) => {
449
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
450
- _material.Button,
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
-
463
-
464
-
465
-
466
-
467
-
468
-
469
-
470
-
471
-
472
-
473
- exports.ClearButton_default = ClearButton_default; exports.FilterButton_default = FilterButton_default; exports.FilterWrapper_default = FilterWrapper_default; exports.FormWrapper_default = FormWrapper_default; exports.LabelText_default = LabelText_default; exports.ListWrapper_default = ListWrapper_default; exports.SimpleToolbar_default = SimpleToolbar_default; exports.SimpleButton_default = SimpleButton_default; exports.AuthorizedView_default = AuthorizedView_default; exports.CancelButton_default = CancelButton_default;