@gnwebsoft/ui 2.17.0
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/dist/chunk-2JFL7TS5.mjs +0 -0
- package/dist/chunk-2LTU3GNL.mjs +217 -0
- package/dist/chunk-6JZ35VQJ.js +19 -0
- package/dist/chunk-7M2VOCYN.js +1 -0
- package/dist/chunk-D3X5GWIG.mjs +63 -0
- package/dist/chunk-DFFDICTB.js +63 -0
- package/dist/chunk-GFSTK7KN.mjs +19 -0
- package/dist/chunk-IJXNDCK2.mjs +0 -0
- package/dist/chunk-JCZNO267.mjs +1288 -0
- package/dist/chunk-PCTIEZLN.js +217 -0
- package/dist/chunk-SK6Y2YH6.js +1 -0
- package/dist/chunk-XMOYASC5.js +1288 -0
- package/dist/components/index.d.mts +31 -0
- package/dist/components/index.d.ts +31 -0
- package/dist/components/index.js +14 -0
- package/dist/components/index.mjs +14 -0
- package/dist/hooks/index.d.mts +17 -0
- package/dist/hooks/index.d.ts +17 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.mjs +7 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +36 -0
- package/dist/index.mjs +36 -0
- package/dist/types/index.d.mts +21 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/utils/index.d.mts +16 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/index.mjs +14 -0
- package/dist/wrappers/index.d.mts +215 -0
- package/dist/wrappers/index.d.ts +215 -0
- package/dist/wrappers/index.js +8 -0
- package/dist/wrappers/index.mjs +8 -0
- package/package.json +91 -0
|
File without changes
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// src/components/ClearButton/index.tsx
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
// src/components/FilterButton/FilterButton.tsx
|
|
5
|
+
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
6
|
+
var FilterButton = ({ isSubmitting }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx2(Fragment2, {});
|
|
8
|
+
};
|
|
9
|
+
var FilterButton_default = FilterButton;
|
|
10
|
+
|
|
11
|
+
// src/components/FormWrapper/FormWrapper.tsx
|
|
12
|
+
import {
|
|
13
|
+
Card,
|
|
14
|
+
CardContent,
|
|
15
|
+
CardHeader,
|
|
16
|
+
Divider,
|
|
17
|
+
Grid2,
|
|
18
|
+
Typography
|
|
19
|
+
} from "@mui/material";
|
|
20
|
+
import { Fragment as Fragment3, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var FormWrapper = ({
|
|
22
|
+
children,
|
|
23
|
+
title,
|
|
24
|
+
editMode,
|
|
25
|
+
breadCrumb
|
|
26
|
+
}) => {
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment3, { children: [
|
|
28
|
+
breadCrumb ? breadCrumb : /* @__PURE__ */ jsx3(Fragment3, {}),
|
|
29
|
+
/* @__PURE__ */ jsxs(
|
|
30
|
+
Card,
|
|
31
|
+
{
|
|
32
|
+
sx: {
|
|
33
|
+
position: "relative",
|
|
34
|
+
borderRadius: "0px"
|
|
35
|
+
},
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx3(
|
|
38
|
+
CardHeader,
|
|
39
|
+
{
|
|
40
|
+
sx: {
|
|
41
|
+
display: "flex",
|
|
42
|
+
flexWrap: "wrap",
|
|
43
|
+
p: "1rem",
|
|
44
|
+
".MuiCardHeader-action": {
|
|
45
|
+
margin: 0,
|
|
46
|
+
alignSelf: "center"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
title: title ?? /* @__PURE__ */ jsx3(Typography, { variant: "h5", children: editMode ? `Create ${title}` : `Edit ${title}` })
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsx3(Divider, { sx: { mt: 0 } }),
|
|
53
|
+
/* @__PURE__ */ jsx3(CardContent, { children: /* @__PURE__ */ jsx3(Grid2, { container: true, spacing: 3, children }) })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] });
|
|
58
|
+
};
|
|
59
|
+
var FormWrapper_default = FormWrapper;
|
|
60
|
+
|
|
61
|
+
// src/components/LabelText/LabelText.tsx
|
|
62
|
+
import { Grid2 as Grid22, Tooltip, Typography as Typography2 } from "@mui/material";
|
|
63
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
64
|
+
var LabelText = ({ label, value }) => /* @__PURE__ */ jsxs2(
|
|
65
|
+
Grid22,
|
|
66
|
+
{
|
|
67
|
+
size: { xs: 12, sm: 6, md: 6 },
|
|
68
|
+
sx: {
|
|
69
|
+
display: "flex",
|
|
70
|
+
flexDirection: { xs: "column", sm: "row", md: "row" },
|
|
71
|
+
"&:hover": { bgcolor: "#efefef", overflow: "hidden" }
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsxs2(
|
|
75
|
+
Grid22,
|
|
76
|
+
{
|
|
77
|
+
size: { xs: 6, sm: 7, md: 6 },
|
|
78
|
+
sx: {
|
|
79
|
+
padding: "5px",
|
|
80
|
+
fontSize: "14px",
|
|
81
|
+
textAlign: { xs: "left", sm: "right", md: "right" }
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
label,
|
|
85
|
+
" :"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx4(
|
|
90
|
+
Grid22,
|
|
91
|
+
{
|
|
92
|
+
size: { xs: 12, sm: 5, md: 6 },
|
|
93
|
+
sx: { padding: "5px", display: "flex", flexWrap: "wrap" },
|
|
94
|
+
children: /* @__PURE__ */ jsx4(Tooltip, { title: value, arrow: true, children: /* @__PURE__ */ jsx4(
|
|
95
|
+
Typography2,
|
|
96
|
+
{
|
|
97
|
+
color: "#3598dc",
|
|
98
|
+
fontSize: "14px",
|
|
99
|
+
sx: {
|
|
100
|
+
wordBreak: "break-word",
|
|
101
|
+
overflow: "hidden",
|
|
102
|
+
display: "-webkit-box",
|
|
103
|
+
textOverflow: "ellipsis",
|
|
104
|
+
WebkitLineClamp: 2,
|
|
105
|
+
WebkitBoxOrient: "vertical"
|
|
106
|
+
},
|
|
107
|
+
children: value ? value : "-"
|
|
108
|
+
}
|
|
109
|
+
) })
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
var LabelText_default = LabelText;
|
|
116
|
+
|
|
117
|
+
// src/components/ListWrapper/ListWrapper.tsx
|
|
118
|
+
import {
|
|
119
|
+
Box,
|
|
120
|
+
Card as Card2,
|
|
121
|
+
CardContent as CardContent2,
|
|
122
|
+
CardHeader as CardHeader2,
|
|
123
|
+
Divider as Divider2,
|
|
124
|
+
Grid2 as Grid23,
|
|
125
|
+
Typography as Typography3
|
|
126
|
+
} from "@mui/material";
|
|
127
|
+
import ManageSearchIcon from "@mui/icons-material/ManageSearch";
|
|
128
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
129
|
+
var ListWrapper = ({ children, title, count }) => {
|
|
130
|
+
return /* @__PURE__ */ jsxs3(
|
|
131
|
+
Card2,
|
|
132
|
+
{
|
|
133
|
+
sx: {
|
|
134
|
+
position: "relative",
|
|
135
|
+
borderRadius: "0px"
|
|
136
|
+
},
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ jsx5(
|
|
139
|
+
CardHeader2,
|
|
140
|
+
{
|
|
141
|
+
sx: {
|
|
142
|
+
display: "flex",
|
|
143
|
+
flexWrap: "wrap",
|
|
144
|
+
p: "1rem",
|
|
145
|
+
".MuiCardHeader-action": {
|
|
146
|
+
margin: 0,
|
|
147
|
+
alignSelf: "center"
|
|
148
|
+
},
|
|
149
|
+
alignItems: "center"
|
|
150
|
+
},
|
|
151
|
+
title: /* @__PURE__ */ jsxs3(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
152
|
+
/* @__PURE__ */ jsx5(ManageSearchIcon, { sx: { color: "#4db3a2", height: "2.5rem" } }),
|
|
153
|
+
/* @__PURE__ */ jsx5(
|
|
154
|
+
Typography3,
|
|
155
|
+
{
|
|
156
|
+
variant: "h5",
|
|
157
|
+
sx: { color: "#4db3a2", fontWeight: "bold" },
|
|
158
|
+
children: `${title} (${count ? count : 0})`
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] })
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsx5(Divider2, {}),
|
|
165
|
+
/* @__PURE__ */ jsx5(CardContent2, { sx: { pt: 0 }, children: /* @__PURE__ */ jsx5(Grid23, { container: true, spacing: 2, children }) })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
var ListWrapper_default = ListWrapper;
|
|
171
|
+
|
|
172
|
+
// src/components/SimpleToolbar/SimpleToolbar.tsx
|
|
173
|
+
import {
|
|
174
|
+
GridToolbarContainer,
|
|
175
|
+
GridToolbarColumnsButton,
|
|
176
|
+
GridToolbarExport,
|
|
177
|
+
GridToolbarFilterButton,
|
|
178
|
+
GridToolbarQuickFilter
|
|
179
|
+
} from "@mui/x-data-grid";
|
|
180
|
+
import { Box as Box2 } from "@mui/material";
|
|
181
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
182
|
+
var SimpleToolbar = () => /* @__PURE__ */ jsxs4(GridToolbarContainer, { children: [
|
|
183
|
+
/* @__PURE__ */ jsx6(
|
|
184
|
+
GridToolbarQuickFilter,
|
|
185
|
+
{
|
|
186
|
+
sx: {
|
|
187
|
+
"& .MuiInputBase-root": {
|
|
188
|
+
borderRadius: "8px",
|
|
189
|
+
padding: "6px 10px",
|
|
190
|
+
backgroundColor: "#f6f7f8"
|
|
191
|
+
},
|
|
192
|
+
"& input": {
|
|
193
|
+
fontSize: "14px",
|
|
194
|
+
color: "#333"
|
|
195
|
+
},
|
|
196
|
+
borderRadius: "8px",
|
|
197
|
+
".css-hzgntl-MuiOutlinedInput-notchedOutline": {
|
|
198
|
+
borderRadius: "8px",
|
|
199
|
+
border: "1px solid #efefef !important"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
/* @__PURE__ */ jsx6(Box2, { sx: { flexGrow: 1 } }),
|
|
205
|
+
/* @__PURE__ */ jsx6(GridToolbarColumnsButton, {}),
|
|
206
|
+
/* @__PURE__ */ jsx6(GridToolbarFilterButton, {}),
|
|
207
|
+
/* @__PURE__ */ jsx6(GridToolbarExport, {})
|
|
208
|
+
] });
|
|
209
|
+
var SimpleToolbar_default = SimpleToolbar;
|
|
210
|
+
|
|
211
|
+
export {
|
|
212
|
+
FilterButton_default,
|
|
213
|
+
FormWrapper_default,
|
|
214
|
+
LabelText_default,
|
|
215
|
+
ListWrapper_default,
|
|
216
|
+
SimpleToolbar_default
|
|
217
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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/hooks/useTransform/index.ts
|
|
2
|
+
function useTransform(options) {
|
|
3
|
+
const value = typeof _optionalChain([options, 'access', _ => _.transform, 'optionalAccess', _2 => _2.input]) === "function" ? options.transform.input(options.value) : options.value;
|
|
4
|
+
const onChange = (...event) => {
|
|
5
|
+
if (typeof _optionalChain([options, 'access', _3 => _3.transform, 'optionalAccess', _4 => _4.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
|
+
|
|
18
|
+
|
|
19
|
+
exports.useTransform = useTransform;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/utils/flattenObjectKeys.ts
|
|
2
|
+
var isNested = (obj) => typeof obj === "object" && obj !== null;
|
|
3
|
+
var isArray = (obj) => Array.isArray(obj);
|
|
4
|
+
var flattenObjectKeys = (obj, prefix = "") => {
|
|
5
|
+
if (!isNested(obj)) {
|
|
6
|
+
return {
|
|
7
|
+
[prefix]: obj
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return Object.keys(obj).reduce((acc, key) => {
|
|
11
|
+
const currentPrefix = prefix.length ? `${prefix}.` : "";
|
|
12
|
+
if (isNested(obj[key]) && Object.keys(obj[key]).length) {
|
|
13
|
+
if (isArray(obj[key]) && obj[key].length) {
|
|
14
|
+
obj[key].forEach((item, index) => {
|
|
15
|
+
Object.assign(
|
|
16
|
+
acc,
|
|
17
|
+
flattenObjectKeys(item, `${currentPrefix + key}.${index}`)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
Object.assign(acc, flattenObjectKeys(obj[key], currentPrefix + key));
|
|
22
|
+
}
|
|
23
|
+
acc[currentPrefix + key] = obj[key];
|
|
24
|
+
} else {
|
|
25
|
+
acc[currentPrefix + key] = obj[key];
|
|
26
|
+
}
|
|
27
|
+
return acc;
|
|
28
|
+
}, {});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/utils/getTimezone.ts
|
|
32
|
+
function getTimezone(adapter, value) {
|
|
33
|
+
return value == null || !adapter.utils.isValid(value) ? null : adapter.utils.getTimezone(value);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/utils/propertyExists.ts
|
|
37
|
+
function propertyExists(obj, prop) {
|
|
38
|
+
return typeof obj === "object" && obj !== null && Object.prototype.hasOwnProperty.call(obj, prop);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/utils/readValueAsDate.ts
|
|
42
|
+
function readValueAsDate(adapter, value) {
|
|
43
|
+
if (typeof value === "string") {
|
|
44
|
+
if (value === "") {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return adapter.utils.date(value);
|
|
48
|
+
}
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/utils/removeLeadingTrailingSlashes.ts
|
|
53
|
+
var removeLeadingTrailingSlashes = (route) => {
|
|
54
|
+
return route.replace(/^\/|\/$/g, "");
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
flattenObjectKeys,
|
|
59
|
+
getTimezone,
|
|
60
|
+
propertyExists,
|
|
61
|
+
readValueAsDate,
|
|
62
|
+
removeLeadingTrailingSlashes
|
|
63
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/flattenObjectKeys.ts
|
|
2
|
+
var isNested = (obj) => typeof obj === "object" && obj !== null;
|
|
3
|
+
var isArray = (obj) => Array.isArray(obj);
|
|
4
|
+
var flattenObjectKeys = (obj, prefix = "") => {
|
|
5
|
+
if (!isNested(obj)) {
|
|
6
|
+
return {
|
|
7
|
+
[prefix]: obj
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return Object.keys(obj).reduce((acc, key) => {
|
|
11
|
+
const currentPrefix = prefix.length ? `${prefix}.` : "";
|
|
12
|
+
if (isNested(obj[key]) && Object.keys(obj[key]).length) {
|
|
13
|
+
if (isArray(obj[key]) && obj[key].length) {
|
|
14
|
+
obj[key].forEach((item, index) => {
|
|
15
|
+
Object.assign(
|
|
16
|
+
acc,
|
|
17
|
+
flattenObjectKeys(item, `${currentPrefix + key}.${index}`)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
Object.assign(acc, flattenObjectKeys(obj[key], currentPrefix + key));
|
|
22
|
+
}
|
|
23
|
+
acc[currentPrefix + key] = obj[key];
|
|
24
|
+
} else {
|
|
25
|
+
acc[currentPrefix + key] = obj[key];
|
|
26
|
+
}
|
|
27
|
+
return acc;
|
|
28
|
+
}, {});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/utils/getTimezone.ts
|
|
32
|
+
function getTimezone(adapter, value) {
|
|
33
|
+
return value == null || !adapter.utils.isValid(value) ? null : adapter.utils.getTimezone(value);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/utils/propertyExists.ts
|
|
37
|
+
function propertyExists(obj, prop) {
|
|
38
|
+
return typeof obj === "object" && obj !== null && Object.prototype.hasOwnProperty.call(obj, prop);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/utils/readValueAsDate.ts
|
|
42
|
+
function readValueAsDate(adapter, value) {
|
|
43
|
+
if (typeof value === "string") {
|
|
44
|
+
if (value === "") {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return adapter.utils.date(value);
|
|
48
|
+
}
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/utils/removeLeadingTrailingSlashes.ts
|
|
53
|
+
var removeLeadingTrailingSlashes = (route) => {
|
|
54
|
+
return route.replace(/^\/|\/$/g, "");
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
exports.flattenObjectKeys = flattenObjectKeys; exports.getTimezone = getTimezone; exports.propertyExists = propertyExists; exports.readValueAsDate = readValueAsDate; exports.removeLeadingTrailingSlashes = removeLeadingTrailingSlashes;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
File without changes
|