@dashadmin/dash-components 1.3.24 → 1.3.26
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/components/AuditLog/AuditLog.js +345 -1
- package/dist/components/AuditLog/index.js +4 -1
- package/dist/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.js +630 -3
- package/dist/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.js +53 -1
- package/dist/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.js +647 -3
- package/dist/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.js +53 -1
- package/dist/components/Json/Json.js +235 -1
- package/dist/components/JsonColorSelector/JsonColorSelector.js +1172 -1
- package/dist/components/JsonColorSelector/JsonColorSelectorEnhanced.js +863 -2
- package/dist/components/JsonColorSelector/JsonCssVarValues.js +738 -1
- package/dist/components/JsonColorSelector/components/ColorEditDialog.js +426 -1
- package/dist/components/JsonColorSelector/components/ColorPaletteItem.js +75 -1
- package/dist/components/JsonColorSelector/components/ImageColorExtractor.js +283 -1
- package/dist/components/JsonColorSelector/helpers/functions.js +101 -1
- package/dist/components/JsonColorSelector/useAsyncColorThief.js +105 -1
- package/dist/components/ListActive/ListActive.js +126 -1
- package/dist/components/ListActive/ListBoolean.js +124 -1
- package/dist/components/NotificationPreferences/NotificationPreferences.js +317 -1
- package/dist/components/NotificationPreferences/index.js +7 -1
- package/dist/components/SearchableSelects/RASearchableSelect.js +236 -1
- package/dist/components/SearchableSelects/RASearchableSelectCheckboxes.js +479 -1
- package/dist/components/SearchableSelects/RASearchableSelectChips.js +465 -1
- package/dist/components/SearchableSelects/RASearchableSelectChipsRecordContext.js +295 -1
- package/dist/components/SearchableSelects/SearchableSelect.js +202 -1
- package/dist/components/SearchableSelects/SearchableSelectCheckboxes.js +290 -1
- package/dist/components/SortableDataGrid/SortableDataGrid.js +72 -1
- package/dist/components/SortableDataGrid/SortableDataGridBody.js +167 -1
- package/dist/components/SortableDataGrid/SortableDataGridHeader.js +109 -1
- package/dist/components/SortableDataGrid/SortableDataGridRow.js +283 -1
- package/dist/components/Upload/SingleImageUploader.js +40 -1
- package/dist/components/custom/PackageCopyMethod.js +78 -1
- package/dist/components/custom/PackageRadioButtonGroup.js +45 -1
- package/dist/components/dialog/Basic.js +8 -1
- package/dist/components/dialog/Correct.js +14 -1
- package/dist/components/dialog/Error.js +14 -1
- package/dist/components/dialog/Info.js +14 -1
- package/dist/components/dialog/InfoV2.js +21 -1
- package/dist/components/dialog/NotFound.js +14 -1
- package/dist/components/dialog/QuickSearch.js +117 -1
- package/dist/components/notifications/NotificationsCenter.js +597 -1
- package/dist/components/notifications/index.js +24 -1
- package/dist/components/tables/PaginationComponent.js +36 -1
- package/dist/components/theme/AppLoadingFallback.js +38 -2
- package/dist/components/theme/ErrorBoundary.js +52 -1
- package/dist/components/theme/InitialLoader.js +13 -1
- package/dist/components/theme/NotFound.js +136 -1
- package/dist/components/theme/NotResults.js +38 -1
- package/dist/hooks/useDraggable.js +6 -1
- package/dist/hooks/useNotifications.js +8 -1
- package/dist/hooks/useQuickSearch.js +26 -1
- package/dist/index.js +66 -5567
- package/dist/utils/setNativeValue.js +17 -1
- package/package.json +149 -132
- package/src/components/AuditLog/AuditLog.tsx +476 -0
- package/src/components/AuditLog/index.ts +2 -0
- package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +917 -0
- package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +39 -0
- package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +916 -0
- package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +44 -0
- package/src/components/Json/Json.tsx +312 -0
- package/src/components/JsonColorSelector/JsonColorSelector.tsx +1435 -0
- package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +1029 -0
- package/src/components/JsonColorSelector/JsonCssVarValues.tsx +863 -0
- package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +491 -0
- package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +80 -0
- package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +328 -0
- package/src/components/JsonColorSelector/helpers/functions.tsx +123 -0
- package/src/components/JsonColorSelector/interfaces/interfaces.tsx +22 -0
- package/src/components/JsonColorSelector/useAsyncColorThief.tsx +97 -0
- package/src/components/ListActive/ListActive.tsx +106 -0
- package/src/components/ListActive/ListBoolean.tsx +96 -0
- package/src/components/NotificationPreferences/NotificationPreferences.tsx +463 -0
- package/src/components/NotificationPreferences/index.tsx +2 -0
- package/src/components/SearchableSelects/RASearchableSelect.tsx +300 -0
- package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +604 -0
- package/src/components/SearchableSelects/RASearchableSelectChips.tsx +558 -0
- package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +362 -0
- package/src/components/SearchableSelects/SearchableSelect.tsx +321 -0
- package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +355 -0
- package/src/components/SortableDataGrid/SortableDataGrid.tsx +56 -0
- package/src/components/SortableDataGrid/SortableDataGridBody.tsx +175 -0
- package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +171 -0
- package/src/components/SortableDataGrid/SortableDataGridRow.tsx +247 -0
- package/src/components/Upload/SingleImageUploader.tsx +55 -0
- package/src/components/custom/PackageCopyMethod.tsx +109 -0
- package/src/components/custom/PackageRadioButtonGroup.tsx +47 -0
- package/src/components/dialog/Basic.tsx +11 -0
- package/src/components/dialog/Correct.tsx +16 -0
- package/src/components/dialog/Error.tsx +15 -0
- package/src/components/dialog/Info.tsx +15 -0
- package/src/components/dialog/InfoV2.tsx +35 -0
- package/src/components/dialog/NotFound.tsx +18 -0
- package/src/components/dialog/QuickSearch.tsx +115 -0
- package/src/components/notifications/NotificationsCenter.tsx +792 -0
- package/src/components/notifications/index.ts +42 -0
- package/src/components/tables/PaginationComponent.tsx +17 -0
- package/src/components/theme/AppLoadingFallback.tsx +42 -0
- package/src/components/theme/ErrorBoundary.tsx +57 -0
- package/src/components/theme/InitialLoader.tsx +16 -0
- package/src/components/theme/NotFound.tsx +124 -0
- package/src/components/theme/NotResults.tsx +54 -0
- package/src/hooks/useDraggable.ts +11 -0
- package/src/hooks/useNotifications.ts +14 -0
- package/src/hooks/useQuickSearch.tsx +29 -0
- package/src/index.tsx +77 -0
- package/src/utils/setNativeValue.tsx +23 -0
- package/dist/color-thief-CTwGFhOB.js +0 -272
- /package/{dist → src}/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -0
- /package/{dist → src}/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -0
- /package/{dist → src}/components/SortableDataGrid/README.md +0 -0
- /package/{dist → src}/styles/index.less +0 -0
|
@@ -1 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
|
+
const AutocompleteCheckBoxArrayInput = (_a) => {
|
|
34
|
+
var _b = _a, {
|
|
35
|
+
defaultValue
|
|
36
|
+
} = _b, props = __objRest(_b, [
|
|
37
|
+
"defaultValue"
|
|
38
|
+
]);
|
|
39
|
+
return (
|
|
40
|
+
/* @ts-ignore Expected */
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
AutocompleteCheckBoxInput,
|
|
43
|
+
__spreadProps(__spreadValues({}, props), {
|
|
44
|
+
multiple: true,
|
|
45
|
+
defaultValue: defaultValue != null ? defaultValue : []
|
|
46
|
+
})
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
var AutocompleteCheckBoxArrayInput_default = AutocompleteCheckBoxArrayInput;
|
|
51
|
+
export {
|
|
52
|
+
AutocompleteCheckBoxArrayInput_default as default
|
|
53
|
+
};
|
|
@@ -1 +1,235 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { useRecordContext } from "react-admin";
|
|
22
|
+
import { useFormContext } from "react-hook-form";
|
|
23
|
+
import {
|
|
24
|
+
Box,
|
|
25
|
+
Button,
|
|
26
|
+
IconButton,
|
|
27
|
+
TextField,
|
|
28
|
+
Typography,
|
|
29
|
+
Table,
|
|
30
|
+
TableBody,
|
|
31
|
+
TableCell,
|
|
32
|
+
TableContainer,
|
|
33
|
+
TableHead,
|
|
34
|
+
TableRow,
|
|
35
|
+
Paper
|
|
36
|
+
} from "@mui/material";
|
|
37
|
+
import DeleteIcon from "@mui/icons-material/Delete";
|
|
38
|
+
import AddIcon from "@mui/icons-material/Add";
|
|
39
|
+
import { useState, useEffect } from "react";
|
|
40
|
+
const JsonEdit = (props) => {
|
|
41
|
+
const { method, attribute, resourceConfig } = props;
|
|
42
|
+
const record = useRecordContext();
|
|
43
|
+
const { setValue, getValues } = useFormContext();
|
|
44
|
+
const attributePath = attribute.attribute;
|
|
45
|
+
const isNestedSetting = attributePath.startsWith("settings.");
|
|
46
|
+
const settingsPath = isNestedSetting ? attributePath.split(".").slice(1).join(".") : attributePath;
|
|
47
|
+
const [pairs, setPairs] = useState([]);
|
|
48
|
+
const [keyError, setKeyError] = useState({});
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
let initialValue = {};
|
|
51
|
+
if (isNestedSetting && (record == null ? void 0 : record.settings)) {
|
|
52
|
+
const settings = record.settings || {};
|
|
53
|
+
initialValue = getNestedValue(settings, settingsPath) || {};
|
|
54
|
+
} else if (record == null ? void 0 : record[attributePath]) {
|
|
55
|
+
initialValue = record[attributePath] || {};
|
|
56
|
+
}
|
|
57
|
+
const initialPairs = Object.entries(initialValue).map(([key, value]) => ({
|
|
58
|
+
key,
|
|
59
|
+
value: typeof value === "object" ? JSON.stringify(value) : String(value),
|
|
60
|
+
id: generateId()
|
|
61
|
+
}));
|
|
62
|
+
setPairs(initialPairs);
|
|
63
|
+
}, [record, attributePath]);
|
|
64
|
+
const getNestedValue = (obj, path) => {
|
|
65
|
+
if (!path) return obj;
|
|
66
|
+
const keys = path.split(".");
|
|
67
|
+
return keys.reduce((o, key) => o && o[key] !== void 0 ? o[key] : {}, obj);
|
|
68
|
+
};
|
|
69
|
+
const setNestedValue = (obj, path, value) => {
|
|
70
|
+
if (!path) return value;
|
|
71
|
+
const keys = path.split(".");
|
|
72
|
+
const lastKey = keys.pop();
|
|
73
|
+
const lastObj = keys.reduce((o, key) => {
|
|
74
|
+
if (o[key] === void 0) o[key] = {};
|
|
75
|
+
return o[key];
|
|
76
|
+
}, obj);
|
|
77
|
+
if (lastKey) {
|
|
78
|
+
lastObj[lastKey] = value;
|
|
79
|
+
}
|
|
80
|
+
return obj;
|
|
81
|
+
};
|
|
82
|
+
const generateId = () => {
|
|
83
|
+
return Math.random().toString(36).substring(2, 11);
|
|
84
|
+
};
|
|
85
|
+
const addPair = () => {
|
|
86
|
+
setPairs([...pairs, { key: "", value: "", id: generateId() }]);
|
|
87
|
+
};
|
|
88
|
+
const removePair = (id) => {
|
|
89
|
+
setPairs(pairs.filter((pair) => pair.id !== id));
|
|
90
|
+
updateFormValue(pairs.filter((pair) => pair.id !== id));
|
|
91
|
+
};
|
|
92
|
+
const handleKeyChange = (id, newKey) => {
|
|
93
|
+
const isDuplicate = pairs.some((pair) => pair.id !== id && pair.key === newKey);
|
|
94
|
+
if (isDuplicate) {
|
|
95
|
+
setKeyError(__spreadProps(__spreadValues({}, keyError), { [id]: "Duplicate key" }));
|
|
96
|
+
} else {
|
|
97
|
+
setKeyError(__spreadProps(__spreadValues({}, keyError), { [id]: "" }));
|
|
98
|
+
}
|
|
99
|
+
const updatedPairs = pairs.map(
|
|
100
|
+
(pair) => pair.id === id ? __spreadProps(__spreadValues({}, pair), { key: newKey }) : pair
|
|
101
|
+
);
|
|
102
|
+
setPairs(updatedPairs);
|
|
103
|
+
updateFormValue(updatedPairs);
|
|
104
|
+
};
|
|
105
|
+
const handleValueChange = (id, newValue) => {
|
|
106
|
+
const updatedPairs = pairs.map(
|
|
107
|
+
(pair) => pair.id === id ? __spreadProps(__spreadValues({}, pair), { value: newValue }) : pair
|
|
108
|
+
);
|
|
109
|
+
setPairs(updatedPairs);
|
|
110
|
+
updateFormValue(updatedPairs);
|
|
111
|
+
};
|
|
112
|
+
const updateFormValue = (currentPairs) => {
|
|
113
|
+
const obj = currentPairs.reduce((acc, pair) => {
|
|
114
|
+
if (pair.key.trim()) {
|
|
115
|
+
let parsedValue = pair.value;
|
|
116
|
+
try {
|
|
117
|
+
if (pair.value.trim().startsWith("{") || pair.value.trim().startsWith("[") || pair.value.trim() === "true" || pair.value.trim() === "false" || !isNaN(Number(pair.value.trim()))) {
|
|
118
|
+
parsedValue = JSON.parse(pair.value);
|
|
119
|
+
}
|
|
120
|
+
} catch (e) {
|
|
121
|
+
}
|
|
122
|
+
acc[pair.key] = parsedValue;
|
|
123
|
+
}
|
|
124
|
+
return acc;
|
|
125
|
+
}, {});
|
|
126
|
+
if (isNestedSetting) {
|
|
127
|
+
const currentSettings = getValues("settings") || {};
|
|
128
|
+
const updatedSettings = setNestedValue(__spreadValues({}, currentSettings), settingsPath, obj);
|
|
129
|
+
setValue("settings", updatedSettings, { shouldDirty: true });
|
|
130
|
+
} else {
|
|
131
|
+
setValue(attributePath, obj, { shouldDirty: true });
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { mt: 1, mb: 2 }, children: [
|
|
135
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, children: attribute.label || "Settings Editor" }),
|
|
136
|
+
/* @__PURE__ */ jsx(TableContainer, { component: Paper, sx: { mb: 2 }, children: /* @__PURE__ */ jsxs(Table, { size: "small", children: [
|
|
137
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
138
|
+
/* @__PURE__ */ jsx(TableCell, { width: "40%", children: "Key" }),
|
|
139
|
+
/* @__PURE__ */ jsx(TableCell, { width: "50%", children: "Value" }),
|
|
140
|
+
/* @__PURE__ */ jsx(TableCell, { width: "10%", align: "center", children: "Actions" })
|
|
141
|
+
] }) }),
|
|
142
|
+
/* @__PURE__ */ jsx(TableBody, { children: pairs.map((pair) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
143
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(
|
|
144
|
+
TextField,
|
|
145
|
+
{
|
|
146
|
+
fullWidth: true,
|
|
147
|
+
size: "small",
|
|
148
|
+
value: pair.key,
|
|
149
|
+
onChange: (e) => handleKeyChange(pair.id, e.target.value),
|
|
150
|
+
error: !!keyError[pair.id],
|
|
151
|
+
helperText: keyError[pair.id]
|
|
152
|
+
}
|
|
153
|
+
) }),
|
|
154
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(
|
|
155
|
+
TextField,
|
|
156
|
+
{
|
|
157
|
+
fullWidth: true,
|
|
158
|
+
size: "small",
|
|
159
|
+
value: pair.value,
|
|
160
|
+
onChange: (e) => handleValueChange(pair.id, e.target.value)
|
|
161
|
+
}
|
|
162
|
+
) }),
|
|
163
|
+
/* @__PURE__ */ jsx(TableCell, { align: "center", children: /* @__PURE__ */ jsx(
|
|
164
|
+
IconButton,
|
|
165
|
+
{
|
|
166
|
+
size: "small",
|
|
167
|
+
onClick: () => removePair(pair.id),
|
|
168
|
+
color: "error",
|
|
169
|
+
children: /* @__PURE__ */ jsx(DeleteIcon, { fontSize: "small" })
|
|
170
|
+
}
|
|
171
|
+
) })
|
|
172
|
+
] }, pair.id)) })
|
|
173
|
+
] }) }),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
Button,
|
|
176
|
+
{
|
|
177
|
+
startIcon: /* @__PURE__ */ jsx(AddIcon, {}),
|
|
178
|
+
variant: "outlined",
|
|
179
|
+
size: "small",
|
|
180
|
+
onClick: addPair,
|
|
181
|
+
children: "+"
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
] });
|
|
185
|
+
};
|
|
186
|
+
const JsonView = (props) => {
|
|
187
|
+
const { attribute } = props;
|
|
188
|
+
const record = useRecordContext();
|
|
189
|
+
const attributePath = attribute.attribute;
|
|
190
|
+
const isNestedSetting = attributePath.startsWith("settings.");
|
|
191
|
+
const settingsPath = isNestedSetting ? attributePath.split(".").slice(1).join(".") : attributePath;
|
|
192
|
+
let displayValue = {};
|
|
193
|
+
if (isNestedSetting && (record == null ? void 0 : record.settings)) {
|
|
194
|
+
const settings = record.settings || {};
|
|
195
|
+
if (settingsPath) {
|
|
196
|
+
const keys = settingsPath.split(".");
|
|
197
|
+
displayValue = keys.reduce((o, key) => o && o[key] !== void 0 ? o[key] : {}, settings);
|
|
198
|
+
} else {
|
|
199
|
+
displayValue = settings;
|
|
200
|
+
}
|
|
201
|
+
} else if (record == null ? void 0 : record[attributePath]) {
|
|
202
|
+
displayValue = record[attributePath];
|
|
203
|
+
}
|
|
204
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { mt: 1, mb: 2 }, children: [
|
|
205
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, children: attribute.label || "Settings" }),
|
|
206
|
+
Object.keys(displayValue).length > 0 ? /* @__PURE__ */ jsx(TableContainer, { component: Paper, children: /* @__PURE__ */ jsxs(Table, { size: "small", children: [
|
|
207
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
208
|
+
/* @__PURE__ */ jsx(TableCell, { width: "40%", children: "Key" }),
|
|
209
|
+
/* @__PURE__ */ jsx(TableCell, { width: "60%", children: "Value" })
|
|
210
|
+
] }) }),
|
|
211
|
+
/* @__PURE__ */ jsx(TableBody, { children: Object.entries(displayValue).map(([key, value]) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
212
|
+
/* @__PURE__ */ jsx(TableCell, { children: key }),
|
|
213
|
+
/* @__PURE__ */ jsx(TableCell, { children: typeof value === "object" ? JSON.stringify(value) : String(value) })
|
|
214
|
+
] }, key)) })
|
|
215
|
+
] }) }) : /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: "No settings configured" })
|
|
216
|
+
] });
|
|
217
|
+
};
|
|
218
|
+
const Json = ({ method, attribute, resourceConfig }) => {
|
|
219
|
+
switch (method) {
|
|
220
|
+
case "edit":
|
|
221
|
+
return /* @__PURE__ */ jsx(JsonEdit, { attribute, method, resourceConfig });
|
|
222
|
+
case "create":
|
|
223
|
+
return /* @__PURE__ */ jsx(JsonEdit, { attribute, method, resourceConfig });
|
|
224
|
+
case "view":
|
|
225
|
+
return /* @__PURE__ */ jsx(JsonView, { attribute, method, resourceConfig });
|
|
226
|
+
default:
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var Json_default = Json;
|
|
231
|
+
export {
|
|
232
|
+
JsonEdit,
|
|
233
|
+
JsonView,
|
|
234
|
+
Json_default as default
|
|
235
|
+
};
|