@dashadmin/dash-components 1.3.25 → 1.3.28
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 +35 -0
- 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 +148 -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,283 @@
|
|
|
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
|
+
var __async = (__this, __arguments, generator) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
var fulfilled = (value) => {
|
|
35
|
+
try {
|
|
36
|
+
step(generator.next(value));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
reject(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var rejected = (value) => {
|
|
42
|
+
try {
|
|
43
|
+
step(generator.throw(value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
53
|
+
import React, {
|
|
54
|
+
isValidElement,
|
|
55
|
+
cloneElement,
|
|
56
|
+
createElement,
|
|
57
|
+
useState,
|
|
58
|
+
useEffect,
|
|
59
|
+
useCallback,
|
|
60
|
+
memo
|
|
61
|
+
} from "react";
|
|
62
|
+
import { isElement } from "react-is";
|
|
63
|
+
import clsx from "clsx";
|
|
64
|
+
import { TableCell, TableRow, Checkbox } from "@mui/material";
|
|
65
|
+
import {
|
|
66
|
+
RecordContextProvider,
|
|
67
|
+
shallowEqual,
|
|
68
|
+
useExpanded,
|
|
69
|
+
useResourceContext,
|
|
70
|
+
useTranslate,
|
|
71
|
+
useCreatePath,
|
|
72
|
+
useRecordContext
|
|
73
|
+
} from "react-admin";
|
|
74
|
+
import { useNavigate } from "react-router-dom";
|
|
75
|
+
import {
|
|
76
|
+
DatagridCell,
|
|
77
|
+
DatagridClasses,
|
|
78
|
+
DatagridRow,
|
|
79
|
+
ExpandRowButton,
|
|
80
|
+
useDatagridContext
|
|
81
|
+
} from "react-admin";
|
|
82
|
+
import MenuIcon from "@mui/icons-material/Menu";
|
|
83
|
+
const computeNbColumns = (expand, children, hasBulkActions) => expand ? 1 + // show expand button
|
|
84
|
+
(hasBulkActions ? 1 : 0) + // checkbox column
|
|
85
|
+
React.Children.toArray(children).filter((child) => !!child).length : 0;
|
|
86
|
+
const SortableDatagridRow = React.forwardRef(
|
|
87
|
+
(props, ref) => {
|
|
88
|
+
const _a = props, {
|
|
89
|
+
children,
|
|
90
|
+
className,
|
|
91
|
+
expand,
|
|
92
|
+
hasBulkActions = false,
|
|
93
|
+
hover = true,
|
|
94
|
+
id,
|
|
95
|
+
onToggleItem,
|
|
96
|
+
record: recordOverride,
|
|
97
|
+
rowClick,
|
|
98
|
+
selected = false,
|
|
99
|
+
style,
|
|
100
|
+
selectable = true
|
|
101
|
+
} = _a, rest = __objRest(_a, [
|
|
102
|
+
"children",
|
|
103
|
+
"className",
|
|
104
|
+
"expand",
|
|
105
|
+
"hasBulkActions",
|
|
106
|
+
"hover",
|
|
107
|
+
"id",
|
|
108
|
+
"onToggleItem",
|
|
109
|
+
"record",
|
|
110
|
+
"rowClick",
|
|
111
|
+
"selected",
|
|
112
|
+
"style",
|
|
113
|
+
"selectable"
|
|
114
|
+
]);
|
|
115
|
+
const context = useDatagridContext();
|
|
116
|
+
const translate = useTranslate();
|
|
117
|
+
const record = useRecordContext(props);
|
|
118
|
+
const expandable = (!context || !context.isRowExpandable || context.isRowExpandable(record)) && expand;
|
|
119
|
+
const resource = useResourceContext(props);
|
|
120
|
+
const createPath = useCreatePath();
|
|
121
|
+
const [expanded, toggleExpanded] = useExpanded(
|
|
122
|
+
resource,
|
|
123
|
+
id,
|
|
124
|
+
context && context.expandSingle
|
|
125
|
+
);
|
|
126
|
+
const [nbColumns, setNbColumns] = useState(
|
|
127
|
+
() => computeNbColumns(expandable, children, hasBulkActions)
|
|
128
|
+
);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
const newNbColumns = computeNbColumns(
|
|
131
|
+
expandable,
|
|
132
|
+
children,
|
|
133
|
+
hasBulkActions
|
|
134
|
+
);
|
|
135
|
+
if (newNbColumns !== nbColumns) {
|
|
136
|
+
setNbColumns(newNbColumns);
|
|
137
|
+
}
|
|
138
|
+
}, [expandable, nbColumns, children, hasBulkActions]);
|
|
139
|
+
const navigate = useNavigate();
|
|
140
|
+
const handleToggleExpand = useCallback(
|
|
141
|
+
(event) => {
|
|
142
|
+
toggleExpanded();
|
|
143
|
+
event.stopPropagation();
|
|
144
|
+
},
|
|
145
|
+
[toggleExpanded]
|
|
146
|
+
);
|
|
147
|
+
const handleToggleSelection = useCallback(
|
|
148
|
+
(event) => {
|
|
149
|
+
if (!selectable) return;
|
|
150
|
+
onToggleItem(id, event);
|
|
151
|
+
event.stopPropagation();
|
|
152
|
+
},
|
|
153
|
+
[id, onToggleItem, selectable]
|
|
154
|
+
);
|
|
155
|
+
const handleClick = useCallback(
|
|
156
|
+
(event) => __async(null, null, function* () {
|
|
157
|
+
event.persist();
|
|
158
|
+
const type = typeof rowClick === "function" ? yield rowClick(id, resource, record) : rowClick;
|
|
159
|
+
if (type === false || type === null) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (["edit", "show"].includes(type)) {
|
|
163
|
+
navigate(createPath({ resource, id, type }));
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (type === "expand") {
|
|
167
|
+
handleToggleExpand(event);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (type === "toggleSelection") {
|
|
171
|
+
handleToggleSelection(event);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
navigate(type);
|
|
175
|
+
}),
|
|
176
|
+
[
|
|
177
|
+
rowClick,
|
|
178
|
+
id,
|
|
179
|
+
resource,
|
|
180
|
+
record,
|
|
181
|
+
navigate,
|
|
182
|
+
createPath,
|
|
183
|
+
handleToggleExpand,
|
|
184
|
+
handleToggleSelection
|
|
185
|
+
]
|
|
186
|
+
);
|
|
187
|
+
return /* @__PURE__ */ jsxs(RecordContextProvider, { value: record, children: [
|
|
188
|
+
/* @__PURE__ */ jsxs(
|
|
189
|
+
TableRow,
|
|
190
|
+
__spreadProps(__spreadValues({
|
|
191
|
+
ref,
|
|
192
|
+
className: clsx(className, {
|
|
193
|
+
[DatagridClasses.expandable]: expandable,
|
|
194
|
+
[DatagridClasses.selectable]: selectable,
|
|
195
|
+
[DatagridClasses.clickableRow]: typeof rowClick === "function" ? true : rowClick
|
|
196
|
+
}),
|
|
197
|
+
style,
|
|
198
|
+
hover,
|
|
199
|
+
onClick: handleClick
|
|
200
|
+
}, rest), {
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(MenuIcon, { sx: { cursor: "pointer" }, className: "handle" }) }, "drag"),
|
|
203
|
+
expand && /* @__PURE__ */ jsx(
|
|
204
|
+
TableCell,
|
|
205
|
+
{
|
|
206
|
+
padding: "none",
|
|
207
|
+
className: DatagridClasses.expandIconCell,
|
|
208
|
+
children: expandable && /* @__PURE__ */ jsx(
|
|
209
|
+
ExpandRowButton,
|
|
210
|
+
{
|
|
211
|
+
className: clsx(DatagridClasses.expandIcon, {
|
|
212
|
+
[DatagridClasses.expanded]: expanded
|
|
213
|
+
}),
|
|
214
|
+
expanded,
|
|
215
|
+
onClick: handleToggleExpand,
|
|
216
|
+
expandContentId: `${id}-expand`
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
hasBulkActions && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox", children: /* @__PURE__ */ jsx(
|
|
222
|
+
Checkbox,
|
|
223
|
+
{
|
|
224
|
+
"aria-label": translate("ra.action.select_row", {
|
|
225
|
+
_: "Select this row"
|
|
226
|
+
}),
|
|
227
|
+
color: "primary",
|
|
228
|
+
className: `select-item ${DatagridClasses.checkbox}`,
|
|
229
|
+
checked: selectable && selected,
|
|
230
|
+
onClick: handleToggleSelection,
|
|
231
|
+
disabled: !selectable
|
|
232
|
+
}
|
|
233
|
+
) }),
|
|
234
|
+
React.Children.map(
|
|
235
|
+
children,
|
|
236
|
+
(field, index) => isValidElement(field) ? /* @__PURE__ */ jsx(
|
|
237
|
+
DatagridCell,
|
|
238
|
+
__spreadValues({
|
|
239
|
+
className: clsx(
|
|
240
|
+
`column-${field.props.source}`,
|
|
241
|
+
DatagridClasses.rowCell
|
|
242
|
+
),
|
|
243
|
+
record
|
|
244
|
+
}, { field, resource }),
|
|
245
|
+
`${id}-${field.props.source || index}`
|
|
246
|
+
) : null
|
|
247
|
+
)
|
|
248
|
+
]
|
|
249
|
+
}),
|
|
250
|
+
id
|
|
251
|
+
),
|
|
252
|
+
expandable && expanded && /* @__PURE__ */ jsx(
|
|
253
|
+
TableRow,
|
|
254
|
+
{
|
|
255
|
+
id: `${id}-expand`,
|
|
256
|
+
className: DatagridClasses.expandedPanel,
|
|
257
|
+
children: /* @__PURE__ */ jsx(TableCell, { colSpan: nbColumns, children: isElement(expand) ? cloneElement(expand, {
|
|
258
|
+
record,
|
|
259
|
+
resource,
|
|
260
|
+
id: String(id)
|
|
261
|
+
}) : createElement(expand, {
|
|
262
|
+
record,
|
|
263
|
+
resource,
|
|
264
|
+
id: String(id)
|
|
265
|
+
}) })
|
|
266
|
+
},
|
|
267
|
+
`${id}-expand`
|
|
268
|
+
)
|
|
269
|
+
] });
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
const areEqual = (prevProps, nextProps) => {
|
|
273
|
+
const _a = prevProps, { children: _1, expand: _2 } = _a, prevPropsWithoutChildren = __objRest(_a, ["children", "expand"]);
|
|
274
|
+
const _b = nextProps, { children: _3, expand: _4 } = _b, nextPropsWithoutChildren = __objRest(_b, ["children", "expand"]);
|
|
275
|
+
return shallowEqual(prevPropsWithoutChildren, nextPropsWithoutChildren);
|
|
276
|
+
};
|
|
277
|
+
const PureDatagridRow = memo(DatagridRow, areEqual);
|
|
278
|
+
PureDatagridRow.displayName = "PureDatagridRow";
|
|
279
|
+
var SortableDataGridRow_default = SortableDatagridRow;
|
|
280
|
+
export {
|
|
281
|
+
PureDatagridRow,
|
|
282
|
+
SortableDataGridRow_default as default
|
|
283
|
+
};
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Upload } from "@mui/icons-material";
|
|
5
|
+
const SingleImageUploader = (props) => {
|
|
6
|
+
const { classNamePrefix = "default", currentUrl = "single-image-uploader", onChange } = props;
|
|
7
|
+
const [localFile, setLocalFile] = useState(null);
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", { className: `single-image-uploader ${classNamePrefix}-img`, children: [
|
|
9
|
+
localFile || currentUrl ? /* @__PURE__ */ jsx("img", { src: localFile || currentUrl, alt: "" }) : /* @__PURE__ */ jsx("div", { className: `${classNamePrefix}-icon` }),
|
|
10
|
+
/* @__PURE__ */ jsxs(
|
|
11
|
+
IconButton,
|
|
12
|
+
{
|
|
13
|
+
"aria-label": "upload image",
|
|
14
|
+
component: "label",
|
|
15
|
+
className: `${classNamePrefix}-edit`,
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Upload, { style: { opacity: "0.6" } }),
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
"input",
|
|
20
|
+
{
|
|
21
|
+
hidden: true,
|
|
22
|
+
accept: "image/*",
|
|
23
|
+
type: "file",
|
|
24
|
+
onChange: (e) => {
|
|
25
|
+
setLocalFile(URL.createObjectURL(e.target.files[0]));
|
|
26
|
+
if (onChange) {
|
|
27
|
+
onChange(e.target.files[0]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] });
|
|
36
|
+
};
|
|
37
|
+
var SingleImageUploader_default = SingleImageUploader;
|
|
38
|
+
export {
|
|
39
|
+
SingleImageUploader_default as default
|
|
40
|
+
};
|
|
@@ -1 +1,78 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
RadioGroup,
|
|
4
|
+
ListItem,
|
|
5
|
+
ListItemText,
|
|
6
|
+
Button,
|
|
7
|
+
List
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import { useState, useEffect } from "react";
|
|
10
|
+
const PackageCopyMethod = (props) => {
|
|
11
|
+
const {
|
|
12
|
+
onChange,
|
|
13
|
+
defaultCopyMethod,
|
|
14
|
+
dialog,
|
|
15
|
+
sendPackage,
|
|
16
|
+
resetExtraPayloadFlagsAfterSubmit,
|
|
17
|
+
getValues,
|
|
18
|
+
setValue
|
|
19
|
+
} = props;
|
|
20
|
+
const [selectedCopyMethod, setSelectedCopyMethod] = useState();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (onChange) {
|
|
23
|
+
onChange(selectedCopyMethod);
|
|
24
|
+
}
|
|
25
|
+
}, [selectedCopyMethod]);
|
|
26
|
+
const selectCopyMethod = (copy_method) => {
|
|
27
|
+
setValue("copy_method", copy_method);
|
|
28
|
+
setSelectedCopyMethod(copy_method);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
RadioGroup,
|
|
32
|
+
{
|
|
33
|
+
"aria-labelledby": "copy-method-selection-label",
|
|
34
|
+
defaultValue: defaultCopyMethod,
|
|
35
|
+
name: "copy-method-selection",
|
|
36
|
+
children: /* @__PURE__ */ jsxs(List, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(ListItem, { children: /* @__PURE__ */ jsx(
|
|
38
|
+
ListItemText,
|
|
39
|
+
{
|
|
40
|
+
primary: /* @__PURE__ */ jsx(
|
|
41
|
+
Button,
|
|
42
|
+
{
|
|
43
|
+
onClick: () => {
|
|
44
|
+
selectCopyMethod(1);
|
|
45
|
+
sendPackage(getValues());
|
|
46
|
+
resetExtraPayloadFlagsAfterSubmit();
|
|
47
|
+
dialog(null);
|
|
48
|
+
},
|
|
49
|
+
children: "Ingresar Nuevamente"
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
) }, "copy_method_1"),
|
|
54
|
+
/* @__PURE__ */ jsx(ListItem, { children: /* @__PURE__ */ jsx(
|
|
55
|
+
ListItemText,
|
|
56
|
+
{
|
|
57
|
+
primary: /* @__PURE__ */ jsx(
|
|
58
|
+
Button,
|
|
59
|
+
{
|
|
60
|
+
onClick: () => {
|
|
61
|
+
selectCopyMethod(2);
|
|
62
|
+
sendPackage(getValues());
|
|
63
|
+
resetExtraPayloadFlagsAfterSubmit();
|
|
64
|
+
dialog(null);
|
|
65
|
+
},
|
|
66
|
+
children: "Duplicado"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
) }, "copy_method_2")
|
|
71
|
+
] })
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
var PackageCopyMethod_default = PackageCopyMethod;
|
|
76
|
+
export {
|
|
77
|
+
PackageCopyMethod_default as default
|
|
78
|
+
};
|
|
@@ -1 +1,45 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RadioGroup, ListItem, ListItemText, Radio, List } from "@mui/material";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
const PackagesRadioButtonsGroup = (props) => {
|
|
5
|
+
const { packages, onChange } = props;
|
|
6
|
+
const [value, setValue] = useState(null);
|
|
7
|
+
const handleChange = (event) => {
|
|
8
|
+
setValue(event.target.value);
|
|
9
|
+
if (onChange) {
|
|
10
|
+
onChange(event.target.value);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
RadioGroup,
|
|
15
|
+
{
|
|
16
|
+
"aria-labelledby": "package-selection-label",
|
|
17
|
+
name: "package-selection",
|
|
18
|
+
children: /* @__PURE__ */ jsx(List, { children: packages.map((p, index) => {
|
|
19
|
+
return /* @__PURE__ */ jsxs(ListItem, { children: [
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
Radio,
|
|
22
|
+
{
|
|
23
|
+
checked: value === p.id.toString(),
|
|
24
|
+
onChange: handleChange,
|
|
25
|
+
value: p.id,
|
|
26
|
+
name: "package-selection",
|
|
27
|
+
inputProps: { "aria-label": p.id.toString() }
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
ListItemText,
|
|
32
|
+
{
|
|
33
|
+
primary: p.id,
|
|
34
|
+
secondary: `Internal Id: ${p.internal_id}, Direcci\xF3n: ${p.delivery_address}`
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] }, index);
|
|
38
|
+
}) })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
var PackageRadioButtonGroup_default = PackagesRadioButtonsGroup;
|
|
43
|
+
export {
|
|
44
|
+
PackageRadioButtonGroup_default as default
|
|
45
|
+
};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const DialogBasic = () => {
|
|
3
|
+
return /* @__PURE__ */ jsx("span", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ante est, hendrerit quis bibendum eget, sodales vitae libero. Mauris a dolor vel neque euismod tempor." });
|
|
4
|
+
};
|
|
5
|
+
var Basic_default = DialogBasic;
|
|
6
|
+
export {
|
|
7
|
+
Basic_default as default
|
|
8
|
+
};
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import{Fragment
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const DialogCorrect = () => {
|
|
3
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: "Paquete ingresado correctamente" }) }),
|
|
5
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
6
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra libero vitae cursus gravida,",
|
|
7
|
+
" "
|
|
8
|
+
] })
|
|
9
|
+
] });
|
|
10
|
+
};
|
|
11
|
+
var Correct_default = DialogCorrect;
|
|
12
|
+
export {
|
|
13
|
+
Correct_default as default
|
|
14
|
+
};
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import{Fragment
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const DialogError = () => {
|
|
3
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: "El paquete no pudo ser ingresado" }) }),
|
|
5
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
6
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra libero vitae cursus gravida,",
|
|
7
|
+
" "
|
|
8
|
+
] })
|
|
9
|
+
] });
|
|
10
|
+
};
|
|
11
|
+
var Error_default = DialogError;
|
|
12
|
+
export {
|
|
13
|
+
Error_default as default
|
|
14
|
+
};
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import{Fragment
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const DialogInfo = () => {
|
|
3
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: "Despachos realizados" }) }),
|
|
5
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
6
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra libero vitae cursus gravida,",
|
|
7
|
+
" "
|
|
8
|
+
] })
|
|
9
|
+
] });
|
|
10
|
+
};
|
|
11
|
+
var Info_default = DialogInfo;
|
|
12
|
+
export {
|
|
13
|
+
Info_default as default
|
|
14
|
+
};
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
import{Fragment
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
const DialogInfoV2 = () => {
|
|
4
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: "Paquete egresado" }) }),
|
|
6
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { style: { color: "#9A65E0" }, children: "Fecha y hora: 12/02/2023 12:23:43" }) }),
|
|
7
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { style: { color: "#9A65E0" }, children: "Estado: En dep\xF3sito" }) }),
|
|
8
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
9
|
+
/* @__PURE__ */ jsx(Button, { className: "btn-width-lg", children: "Egresar nuevamente" }),
|
|
10
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
11
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
12
|
+
/* @__PURE__ */ jsx(Button, { className: "btn-width-lg", children: "Duplicado" }),
|
|
13
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
14
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
15
|
+
/* @__PURE__ */ jsx(Button, { className: "btn-width-lg", children: "Cerrar" })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
var InfoV2_default = DialogInfoV2;
|
|
19
|
+
export {
|
|
20
|
+
InfoV2_default as default
|
|
21
|
+
};
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import{Fragment
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@mui/material";
|
|
3
|
+
const DialogNotFound = () => {
|
|
4
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: "Lo sentimos" }) }),
|
|
6
|
+
/* @__PURE__ */ jsx("p", { children: "No se ha encontrado lo solicitado" }),
|
|
7
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
8
|
+
/* @__PURE__ */ jsx(Button, { className: "btn-width-md", children: "Aceptar" })
|
|
9
|
+
] });
|
|
10
|
+
};
|
|
11
|
+
var NotFound_default = DialogNotFound;
|
|
12
|
+
export {
|
|
13
|
+
NotFound_default as default
|
|
14
|
+
};
|