@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.
Files changed (111) hide show
  1. package/dist/components/AuditLog/AuditLog.js +345 -1
  2. package/dist/components/AuditLog/index.js +4 -1
  3. package/dist/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.js +630 -3
  4. package/dist/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.js +53 -1
  5. package/dist/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.js +647 -3
  6. package/dist/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.js +53 -1
  7. package/dist/components/Json/Json.js +235 -1
  8. package/dist/components/JsonColorSelector/JsonColorSelector.js +1172 -1
  9. package/dist/components/JsonColorSelector/JsonColorSelectorEnhanced.js +863 -2
  10. package/dist/components/JsonColorSelector/JsonCssVarValues.js +738 -1
  11. package/dist/components/JsonColorSelector/components/ColorEditDialog.js +426 -1
  12. package/dist/components/JsonColorSelector/components/ColorPaletteItem.js +75 -1
  13. package/dist/components/JsonColorSelector/components/ImageColorExtractor.js +283 -1
  14. package/dist/components/JsonColorSelector/helpers/functions.js +101 -1
  15. package/dist/components/JsonColorSelector/useAsyncColorThief.js +105 -1
  16. package/dist/components/ListActive/ListActive.js +126 -1
  17. package/dist/components/ListActive/ListBoolean.js +124 -1
  18. package/dist/components/NotificationPreferences/NotificationPreferences.js +317 -1
  19. package/dist/components/NotificationPreferences/index.js +7 -1
  20. package/dist/components/SearchableSelects/RASearchableSelect.js +236 -1
  21. package/dist/components/SearchableSelects/RASearchableSelectCheckboxes.js +479 -1
  22. package/dist/components/SearchableSelects/RASearchableSelectChips.js +465 -1
  23. package/dist/components/SearchableSelects/RASearchableSelectChipsRecordContext.js +295 -1
  24. package/dist/components/SearchableSelects/SearchableSelect.js +202 -1
  25. package/dist/components/SearchableSelects/SearchableSelectCheckboxes.js +290 -1
  26. package/dist/components/SortableDataGrid/SortableDataGrid.js +72 -1
  27. package/dist/components/SortableDataGrid/SortableDataGridBody.js +167 -1
  28. package/dist/components/SortableDataGrid/SortableDataGridHeader.js +109 -1
  29. package/dist/components/SortableDataGrid/SortableDataGridRow.js +283 -1
  30. package/dist/components/Upload/SingleImageUploader.js +40 -1
  31. package/dist/components/custom/PackageCopyMethod.js +78 -1
  32. package/dist/components/custom/PackageRadioButtonGroup.js +45 -1
  33. package/dist/components/dialog/Basic.js +8 -1
  34. package/dist/components/dialog/Correct.js +14 -1
  35. package/dist/components/dialog/Error.js +14 -1
  36. package/dist/components/dialog/Info.js +14 -1
  37. package/dist/components/dialog/InfoV2.js +21 -1
  38. package/dist/components/dialog/NotFound.js +14 -1
  39. package/dist/components/dialog/QuickSearch.js +117 -1
  40. package/dist/components/notifications/NotificationsCenter.js +597 -1
  41. package/dist/components/notifications/index.js +24 -1
  42. package/dist/components/tables/PaginationComponent.js +36 -1
  43. package/dist/components/theme/AppLoadingFallback.js +38 -2
  44. package/dist/components/theme/ErrorBoundary.js +52 -1
  45. package/dist/components/theme/InitialLoader.js +13 -1
  46. package/dist/components/theme/NotFound.js +136 -1
  47. package/dist/components/theme/NotResults.js +38 -1
  48. package/dist/hooks/useDraggable.js +6 -1
  49. package/dist/hooks/useNotifications.js +8 -1
  50. package/dist/hooks/useQuickSearch.js +26 -1
  51. package/dist/index.js +66 -5567
  52. package/dist/utils/setNativeValue.js +17 -1
  53. package/package.json +149 -132
  54. package/src/components/AuditLog/AuditLog.tsx +476 -0
  55. package/src/components/AuditLog/index.ts +2 -0
  56. package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +917 -0
  57. package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +39 -0
  58. package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +916 -0
  59. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +44 -0
  60. package/src/components/Json/Json.tsx +312 -0
  61. package/src/components/JsonColorSelector/JsonColorSelector.tsx +1435 -0
  62. package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +1029 -0
  63. package/src/components/JsonColorSelector/JsonCssVarValues.tsx +863 -0
  64. package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +491 -0
  65. package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +80 -0
  66. package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +328 -0
  67. package/src/components/JsonColorSelector/helpers/functions.tsx +123 -0
  68. package/src/components/JsonColorSelector/interfaces/interfaces.tsx +22 -0
  69. package/src/components/JsonColorSelector/useAsyncColorThief.tsx +97 -0
  70. package/src/components/ListActive/ListActive.tsx +106 -0
  71. package/src/components/ListActive/ListBoolean.tsx +96 -0
  72. package/src/components/NotificationPreferences/NotificationPreferences.tsx +463 -0
  73. package/src/components/NotificationPreferences/index.tsx +2 -0
  74. package/src/components/SearchableSelects/RASearchableSelect.tsx +300 -0
  75. package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +604 -0
  76. package/src/components/SearchableSelects/RASearchableSelectChips.tsx +558 -0
  77. package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +362 -0
  78. package/src/components/SearchableSelects/SearchableSelect.tsx +321 -0
  79. package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +355 -0
  80. package/src/components/SortableDataGrid/SortableDataGrid.tsx +56 -0
  81. package/src/components/SortableDataGrid/SortableDataGridBody.tsx +175 -0
  82. package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +171 -0
  83. package/src/components/SortableDataGrid/SortableDataGridRow.tsx +247 -0
  84. package/src/components/Upload/SingleImageUploader.tsx +55 -0
  85. package/src/components/custom/PackageCopyMethod.tsx +109 -0
  86. package/src/components/custom/PackageRadioButtonGroup.tsx +47 -0
  87. package/src/components/dialog/Basic.tsx +11 -0
  88. package/src/components/dialog/Correct.tsx +16 -0
  89. package/src/components/dialog/Error.tsx +15 -0
  90. package/src/components/dialog/Info.tsx +15 -0
  91. package/src/components/dialog/InfoV2.tsx +35 -0
  92. package/src/components/dialog/NotFound.tsx +18 -0
  93. package/src/components/dialog/QuickSearch.tsx +115 -0
  94. package/src/components/notifications/NotificationsCenter.tsx +792 -0
  95. package/src/components/notifications/index.ts +42 -0
  96. package/src/components/tables/PaginationComponent.tsx +17 -0
  97. package/src/components/theme/AppLoadingFallback.tsx +42 -0
  98. package/src/components/theme/ErrorBoundary.tsx +57 -0
  99. package/src/components/theme/InitialLoader.tsx +16 -0
  100. package/src/components/theme/NotFound.tsx +124 -0
  101. package/src/components/theme/NotResults.tsx +54 -0
  102. package/src/hooks/useDraggable.ts +11 -0
  103. package/src/hooks/useNotifications.ts +14 -0
  104. package/src/hooks/useQuickSearch.tsx +29 -0
  105. package/src/index.tsx +77 -0
  106. package/src/utils/setNativeValue.tsx +23 -0
  107. package/dist/color-thief-CTwGFhOB.js +0 -272
  108. /package/{dist → src}/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -0
  109. /package/{dist → src}/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -0
  110. /package/{dist → src}/components/SortableDataGrid/README.md +0 -0
  111. /package/{dist → src}/styles/index.less +0 -0
@@ -1 +1,283 @@
1
- import{jsx as n,jsxs as _}from"react/jsx-runtime";import y,{isValidElement as M,cloneElement as O,createElement as V,useState as z,useEffect as G,useCallback as E,memo as H}from"react";import{isElement as J}from"react-is";import N from"clsx";import{TableCell as b,TableRow as $,Checkbox as K}from"@mui/material";import{RecordContextProvider as L,shallowEqual as Q,useExpanded as U,useResourceContext as X,useTranslate as Y,useCreatePath as Z,useRecordContext as j}from"react-admin";import{useNavigate as ee}from"react-router-dom";import{DatagridCell as ae,DatagridClasses as t,DatagridRow as oe,ExpandRowButton as te,useDatagridContext as ne}from"react-admin";import re from"@mui/icons-material/Menu";const v=(r,u,l)=>r?1+(l?1:0)+y.Children.toArray(u).filter(g=>!!g).length:0,le=y.forwardRef((r,u)=>{const{children:l,className:g,expand:s,hasBulkActions:m=!1,hover:P=!0,id:a,onToggleItem:T,record:de,rowClick:i,selected:I=!1,style:q,selectable:x=!0,...A}=r,C=ne(),B=Y(),c=j(r),p=(!C||!C.isRowExpandable||C.isRowExpandable(c))&&s,d=X(r),D=Z(),[h,S]=U(d,a,C&&C.expandSingle),[f,F]=z(()=>v(p,l,m));G(()=>{const e=v(p,l,m);e!==f&&F(e)},[p,f,l,m]);const w=ee(),R=E(e=>{S(),e.stopPropagation()},[S]),k=E(e=>{x&&(T(a,e),e.stopPropagation())},[a,T,x]),W=E(async e=>{e.persist();const o=typeof i=="function"?await i(a,d,c):i;if(!(o===!1||o===null)){if(["edit","show"].includes(o)){w(D({resource:d,id:a,type:o}));return}if(o==="expand"){R(e);return}if(o==="toggleSelection"){k(e);return}w(o)}},[i,a,d,c,w,D,R,k]);return _(L,{value:c,children:[_($,{ref:u,className:N(g,{[t.expandable]:p,[t.selectable]:x,[t.clickableRow]:typeof i=="function"?!0:i}),style:q,hover:P,onClick:W,...A,children:[n(b,{children:n(re,{sx:{cursor:"pointer"},className:"handle"})},"drag"),s&&n(b,{padding:"none",className:t.expandIconCell,children:p&&n(te,{className:N(t.expandIcon,{[t.expanded]:h}),expanded:h,onClick:R,expandContentId:`${a}-expand`})}),m&&n(b,{padding:"checkbox",children:n(K,{"aria-label":B("ra.action.select_row",{_:"Select this row"}),color:"primary",className:`select-item ${t.checkbox}`,checked:x&&I,onClick:k,disabled:!x})}),y.Children.map(l,(e,o)=>M(e)?n(ae,{className:N(`column-${e.props.source}`,t.rowCell),record:c,field:e,resource:d},`${a}-${e.props.source||o}`):null)]},a),p&&h&&n($,{id:`${a}-expand`,className:t.expandedPanel,children:n(b,{colSpan:f,children:J(s)?O(s,{record:c,resource:d,id:String(a)}):V(s,{record:c,resource:d,id:String(a)})})},`${a}-expand`)]})}),se=(r,u)=>{const{children:l,expand:g,...s}=r,{children:m,expand:P,...a}=u;return Q(s,a)},ce=H(oe,se);ce.displayName="PureDatagridRow";var we=le;export{ce as PureDatagridRow,we as default};
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 as e,jsxs as r}from"react/jsx-runtime";import{IconButton as m}from"@mui/material";import{useState as s}from"react";import{Upload as g}from"@mui/icons-material";const p=n=>{const{classNamePrefix:a="default",currentUrl:l="single-image-uploader",onChange:i}=n,[t,c]=s(null);return r("div",{className:`single-image-uploader ${a}-img`,children:[t||l?e("img",{src:t||l,alt:""}):e("div",{className:`${a}-icon`}),r(m,{"aria-label":"upload image",component:"label",className:`${a}-edit`,children:[e(g,{style:{opacity:"0.6"}}),e("input",{hidden:!0,accept:"image/*",type:"file",onChange:o=>{c(URL.createObjectURL(o.target.files[0])),i&&i(o.target.files[0])}})]})]})};var C=p;export{C as default};
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 as e,jsxs as I}from"react/jsx-runtime";import{RadioGroup as f,ListItem as m,ListItemText as p,Button as n,List as h}from"@mui/material";import{useState as C,useEffect as P}from"react";const k=u=>{const{onChange:o,defaultCopyMethod:c,dialog:t,sendPackage:a,resetExtraPayloadFlagsAfterSubmit:l,getValues:d,setValue:y}=u,[r,g]=C();P(()=>{o&&o(r)},[r]);const s=i=>{y("copy_method",i),g(i)};return e(f,{"aria-labelledby":"copy-method-selection-label",defaultValue:c,name:"copy-method-selection",children:I(h,{children:[e(m,{children:e(p,{primary:e(n,{onClick:()=>{s(1),a(d()),l(),t(null)},children:"Ingresar Nuevamente"})})},"copy_method_1"),e(m,{children:e(p,{primary:e(n,{onClick:()=>{s(2),a(d()),l(),t(null)},children:"Duplicado"})})},"copy_method_2")]})})};var G=k;export{G as default};
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 as e,jsxs as I}from"react/jsx-runtime";import{RadioGroup as c,ListItem as d,ListItemText as g,Radio as u,List as p}from"@mui/material";import{useState as k}from"react";const m=o=>{const{packages:i,onChange:t}=o,[n,r]=k(null),s=a=>{r(a.target.value),t&&t(a.target.value)};return e(c,{"aria-labelledby":"package-selection-label",name:"package-selection",children:e(p,{children:i.map((a,l)=>I(d,{children:[e(u,{checked:n===a.id.toString(),onChange:s,value:a.id,name:"package-selection",inputProps:{"aria-label":a.id.toString()}}),e(g,{primary:a.id,secondary:`Internal Id: ${a.internal_id}, Direcci\xF3n: ${a.delivery_address}`})]},l))})})};var P=m;export{P as default};
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 as i}from"react/jsx-runtime";const e=()=>i("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."});var o=e;export{o as default};
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 as o,jsx as e,jsxs as r}from"react/jsx-runtime";const t=()=>r(o,{children:[e("p",{children:e("strong",{children:"Paquete ingresado correctamente"})}),r("p",{children:["Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra libero vitae cursus gravida,"," "]})]});var a=t;export{a as default};
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 as t,jsx as r,jsxs as e}from"react/jsx-runtime";const o=()=>e(t,{children:[r("p",{children:r("strong",{children:"El paquete no pudo ser ingresado"})}),e("p",{children:["Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra libero vitae cursus gravida,"," "]})]});var a=o;export{a as default};
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 as r,jsx as e,jsxs as o}from"react/jsx-runtime";const a=()=>o(r,{children:[e("p",{children:e("strong",{children:"Despachos realizados"})}),o("p",{children:["Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra libero vitae cursus gravida,"," "]})]});var s=a;export{s as default};
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 as n,jsx as t,jsxs as s}from"react/jsx-runtime";import o from"@mui/material/Button";const r=()=>s(n,{children:[t("p",{children:t("strong",{children:"Paquete egresado"})}),t("p",{children:t("strong",{style:{color:"#9A65E0"},children:"Fecha y hora: 12/02/2023 12:23:43"})}),t("p",{children:t("strong",{style:{color:"#9A65E0"},children:"Estado: En dep\xF3sito"})}),t("br",{}),t(o,{className:"btn-width-lg",children:"Egresar nuevamente"}),t("br",{}),t("br",{}),t(o,{className:"btn-width-lg",children:"Duplicado"}),t("br",{}),t("br",{}),t(o,{className:"btn-width-lg",children:"Cerrar"})]});var a=r;export{a as default};
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 as r,jsx as o,jsxs as s}from"react/jsx-runtime";import{Button as t}from"@mui/material";const n=()=>s(r,{children:[o("p",{children:o("strong",{children:"Lo sentimos"})}),o("p",{children:"No se ha encontrado lo solicitado"}),o("br",{}),o(t,{className:"btn-width-md",children:"Aceptar"})]});var p=n;export{p as default};
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
+ };