@bluemarble/bm-components 0.0.90 → 0.0.92
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/{index.d.ts → index.d.mts} +4 -5
- package/dist/index.mjs +4203 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +23 -14
- package/dist/esm/index.js +0 -15369
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/Autocomplete/index.d.ts +0 -27
- package/dist/esm/types/components/BaseGrid/Pagination/index.d.ts +0 -12
- package/dist/esm/types/components/BaseGrid/index.d.ts +0 -37
- package/dist/esm/types/components/BaseGrid/styles.d.ts +0 -26
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -19
- package/dist/esm/types/components/Dialog/index.d.ts +0 -16
- package/dist/esm/types/components/EditableGrid/GridCell.d.ts +0 -24
- package/dist/esm/types/components/EditableGrid/GridInput/index.d.ts +0 -16
- package/dist/esm/types/components/EditableGrid/GridInputAutocomplete/index.d.ts +0 -11
- package/dist/esm/types/components/EditableGrid/GridInputText/index.d.ts +0 -3
- package/dist/esm/types/components/EditableGrid/GridSelect/index.d.ts +0 -10
- package/dist/esm/types/components/EditableGrid/NewRow/index.d.ts +0 -13
- package/dist/esm/types/components/EditableGrid/index.d.ts +0 -52
- package/dist/esm/types/components/Grid/AutoCreatedRows.d.ts +0 -9
- package/dist/esm/types/components/Grid/EditableTableCell/DefaultInput.d.ts +0 -17
- package/dist/esm/types/components/Grid/EditableTableCell/InputMask.d.ts +0 -8
- package/dist/esm/types/components/Grid/EditableTableCell/index.d.ts +0 -24
- package/dist/esm/types/components/Grid/Filters.d.ts +0 -13
- package/dist/esm/types/components/Grid/Grid.d.ts +0 -33
- package/dist/esm/types/components/Grid/Header.d.ts +0 -11
- package/dist/esm/types/components/Grid/Td.d.ts +0 -3
- package/dist/esm/types/components/Grid/Tr.d.ts +0 -13
- package/dist/esm/types/components/Grid/index.d.ts +0 -6
- package/dist/esm/types/components/Grid/utils.d.ts +0 -5
- package/dist/esm/types/components/Input/index.d.ts +0 -12
- package/dist/esm/types/components/InputMask/index.d.ts +0 -14
- package/dist/esm/types/components/LargeButton/index.d.ts +0 -9
- package/dist/esm/types/components/Modal/index.d.ts +0 -8
- package/dist/esm/types/components/Radio/index.d.ts +0 -23
- package/dist/esm/types/components/Select/index.d.ts +0 -18
- package/dist/esm/types/components/Switch/index.d.ts +0 -19
- package/dist/esm/types/components/TabPanel/index.d.ts +0 -11
- package/dist/esm/types/components/hooks/useEditableGrid.d.ts +0 -23
- package/dist/esm/types/components/hooks/useEvent.d.ts +0 -1
- package/dist/esm/types/components/hooks/useFilter.d.ts +0 -17
- package/dist/esm/types/components/hooks/useGrid.d.ts +0 -30
- package/dist/esm/types/components/hooks/useLoading.d.ts +0 -4
- package/dist/esm/types/components/index.d.ts +0 -18
- package/dist/esm/types/components/utils/GetInputLabel.d.ts +0 -4
- package/dist/esm/types/components/utils/getObjectValue.d.ts +0 -1
- package/dist/esm/types/index.d.ts +0 -1
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,4203 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
37
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
48
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
49
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
50
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
51
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
52
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
53
|
+
mod
|
|
54
|
+
));
|
|
55
|
+
|
|
56
|
+
// node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
57
|
+
var require_react_is_production_min = __commonJS({
|
|
58
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
59
|
+
"use strict";
|
|
60
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
|
61
|
+
var c = b ? Symbol.for("react.element") : 60103;
|
|
62
|
+
var d = b ? Symbol.for("react.portal") : 60106;
|
|
63
|
+
var e = b ? Symbol.for("react.fragment") : 60107;
|
|
64
|
+
var f = b ? Symbol.for("react.strict_mode") : 60108;
|
|
65
|
+
var g = b ? Symbol.for("react.profiler") : 60114;
|
|
66
|
+
var h = b ? Symbol.for("react.provider") : 60109;
|
|
67
|
+
var k = b ? Symbol.for("react.context") : 60110;
|
|
68
|
+
var l = b ? Symbol.for("react.async_mode") : 60111;
|
|
69
|
+
var m = b ? Symbol.for("react.concurrent_mode") : 60111;
|
|
70
|
+
var n = b ? Symbol.for("react.forward_ref") : 60112;
|
|
71
|
+
var p = b ? Symbol.for("react.suspense") : 60113;
|
|
72
|
+
var q = b ? Symbol.for("react.suspense_list") : 60120;
|
|
73
|
+
var r2 = b ? Symbol.for("react.memo") : 60115;
|
|
74
|
+
var t = b ? Symbol.for("react.lazy") : 60116;
|
|
75
|
+
var v = b ? Symbol.for("react.block") : 60121;
|
|
76
|
+
var w = b ? Symbol.for("react.fundamental") : 60117;
|
|
77
|
+
var x = b ? Symbol.for("react.responder") : 60118;
|
|
78
|
+
var y = b ? Symbol.for("react.scope") : 60119;
|
|
79
|
+
function z(a) {
|
|
80
|
+
if ("object" === typeof a && null !== a) {
|
|
81
|
+
var u = a.$$typeof;
|
|
82
|
+
switch (u) {
|
|
83
|
+
case c:
|
|
84
|
+
switch (a = a.type, a) {
|
|
85
|
+
case l:
|
|
86
|
+
case m:
|
|
87
|
+
case e:
|
|
88
|
+
case g:
|
|
89
|
+
case f:
|
|
90
|
+
case p:
|
|
91
|
+
return a;
|
|
92
|
+
default:
|
|
93
|
+
switch (a = a && a.$$typeof, a) {
|
|
94
|
+
case k:
|
|
95
|
+
case n:
|
|
96
|
+
case t:
|
|
97
|
+
case r2:
|
|
98
|
+
case h:
|
|
99
|
+
return a;
|
|
100
|
+
default:
|
|
101
|
+
return u;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
case d:
|
|
105
|
+
return u;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function A(a) {
|
|
110
|
+
return z(a) === m;
|
|
111
|
+
}
|
|
112
|
+
exports.AsyncMode = l;
|
|
113
|
+
exports.ConcurrentMode = m;
|
|
114
|
+
exports.ContextConsumer = k;
|
|
115
|
+
exports.ContextProvider = h;
|
|
116
|
+
exports.Element = c;
|
|
117
|
+
exports.ForwardRef = n;
|
|
118
|
+
exports.Fragment = e;
|
|
119
|
+
exports.Lazy = t;
|
|
120
|
+
exports.Memo = r2;
|
|
121
|
+
exports.Portal = d;
|
|
122
|
+
exports.Profiler = g;
|
|
123
|
+
exports.StrictMode = f;
|
|
124
|
+
exports.Suspense = p;
|
|
125
|
+
exports.isAsyncMode = function(a) {
|
|
126
|
+
return A(a) || z(a) === l;
|
|
127
|
+
};
|
|
128
|
+
exports.isConcurrentMode = A;
|
|
129
|
+
exports.isContextConsumer = function(a) {
|
|
130
|
+
return z(a) === k;
|
|
131
|
+
};
|
|
132
|
+
exports.isContextProvider = function(a) {
|
|
133
|
+
return z(a) === h;
|
|
134
|
+
};
|
|
135
|
+
exports.isElement = function(a) {
|
|
136
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
137
|
+
};
|
|
138
|
+
exports.isForwardRef = function(a) {
|
|
139
|
+
return z(a) === n;
|
|
140
|
+
};
|
|
141
|
+
exports.isFragment = function(a) {
|
|
142
|
+
return z(a) === e;
|
|
143
|
+
};
|
|
144
|
+
exports.isLazy = function(a) {
|
|
145
|
+
return z(a) === t;
|
|
146
|
+
};
|
|
147
|
+
exports.isMemo = function(a) {
|
|
148
|
+
return z(a) === r2;
|
|
149
|
+
};
|
|
150
|
+
exports.isPortal = function(a) {
|
|
151
|
+
return z(a) === d;
|
|
152
|
+
};
|
|
153
|
+
exports.isProfiler = function(a) {
|
|
154
|
+
return z(a) === g;
|
|
155
|
+
};
|
|
156
|
+
exports.isStrictMode = function(a) {
|
|
157
|
+
return z(a) === f;
|
|
158
|
+
};
|
|
159
|
+
exports.isSuspense = function(a) {
|
|
160
|
+
return z(a) === p;
|
|
161
|
+
};
|
|
162
|
+
exports.isValidElementType = function(a) {
|
|
163
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r2 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
164
|
+
};
|
|
165
|
+
exports.typeOf = z;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
170
|
+
var require_react_is_development = __commonJS({
|
|
171
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
172
|
+
"use strict";
|
|
173
|
+
if (process.env.NODE_ENV !== "production") {
|
|
174
|
+
(function() {
|
|
175
|
+
"use strict";
|
|
176
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
177
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
178
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
179
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
180
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
181
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
182
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
183
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
184
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
185
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
186
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
187
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
188
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
189
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
190
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
191
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
192
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
193
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
194
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
195
|
+
function isValidElementType(type) {
|
|
196
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
197
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
198
|
+
}
|
|
199
|
+
function typeOf(object) {
|
|
200
|
+
if (typeof object === "object" && object !== null) {
|
|
201
|
+
var $$typeof = object.$$typeof;
|
|
202
|
+
switch ($$typeof) {
|
|
203
|
+
case REACT_ELEMENT_TYPE:
|
|
204
|
+
var type = object.type;
|
|
205
|
+
switch (type) {
|
|
206
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
207
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
208
|
+
case REACT_FRAGMENT_TYPE:
|
|
209
|
+
case REACT_PROFILER_TYPE:
|
|
210
|
+
case REACT_STRICT_MODE_TYPE:
|
|
211
|
+
case REACT_SUSPENSE_TYPE:
|
|
212
|
+
return type;
|
|
213
|
+
default:
|
|
214
|
+
var $$typeofType = type && type.$$typeof;
|
|
215
|
+
switch ($$typeofType) {
|
|
216
|
+
case REACT_CONTEXT_TYPE:
|
|
217
|
+
case REACT_FORWARD_REF_TYPE:
|
|
218
|
+
case REACT_LAZY_TYPE:
|
|
219
|
+
case REACT_MEMO_TYPE:
|
|
220
|
+
case REACT_PROVIDER_TYPE:
|
|
221
|
+
return $$typeofType;
|
|
222
|
+
default:
|
|
223
|
+
return $$typeof;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
case REACT_PORTAL_TYPE:
|
|
227
|
+
return $$typeof;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return void 0;
|
|
231
|
+
}
|
|
232
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
233
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
234
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
235
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
236
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
237
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
238
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
239
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
240
|
+
var Memo = REACT_MEMO_TYPE;
|
|
241
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
242
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
243
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
244
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
245
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
246
|
+
function isAsyncMode(object) {
|
|
247
|
+
{
|
|
248
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
249
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
250
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
254
|
+
}
|
|
255
|
+
function isConcurrentMode(object) {
|
|
256
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
257
|
+
}
|
|
258
|
+
function isContextConsumer(object) {
|
|
259
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
260
|
+
}
|
|
261
|
+
function isContextProvider(object) {
|
|
262
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
263
|
+
}
|
|
264
|
+
function isElement(object) {
|
|
265
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
266
|
+
}
|
|
267
|
+
function isForwardRef(object) {
|
|
268
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
269
|
+
}
|
|
270
|
+
function isFragment(object) {
|
|
271
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
272
|
+
}
|
|
273
|
+
function isLazy(object) {
|
|
274
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
275
|
+
}
|
|
276
|
+
function isMemo(object) {
|
|
277
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
278
|
+
}
|
|
279
|
+
function isPortal(object) {
|
|
280
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
281
|
+
}
|
|
282
|
+
function isProfiler(object) {
|
|
283
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
284
|
+
}
|
|
285
|
+
function isStrictMode(object) {
|
|
286
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
287
|
+
}
|
|
288
|
+
function isSuspense(object) {
|
|
289
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
290
|
+
}
|
|
291
|
+
exports.AsyncMode = AsyncMode;
|
|
292
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
293
|
+
exports.ContextConsumer = ContextConsumer;
|
|
294
|
+
exports.ContextProvider = ContextProvider;
|
|
295
|
+
exports.Element = Element;
|
|
296
|
+
exports.ForwardRef = ForwardRef;
|
|
297
|
+
exports.Fragment = Fragment;
|
|
298
|
+
exports.Lazy = Lazy;
|
|
299
|
+
exports.Memo = Memo;
|
|
300
|
+
exports.Portal = Portal;
|
|
301
|
+
exports.Profiler = Profiler;
|
|
302
|
+
exports.StrictMode = StrictMode;
|
|
303
|
+
exports.Suspense = Suspense;
|
|
304
|
+
exports.isAsyncMode = isAsyncMode;
|
|
305
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
306
|
+
exports.isContextConsumer = isContextConsumer;
|
|
307
|
+
exports.isContextProvider = isContextProvider;
|
|
308
|
+
exports.isElement = isElement;
|
|
309
|
+
exports.isForwardRef = isForwardRef;
|
|
310
|
+
exports.isFragment = isFragment;
|
|
311
|
+
exports.isLazy = isLazy;
|
|
312
|
+
exports.isMemo = isMemo;
|
|
313
|
+
exports.isPortal = isPortal;
|
|
314
|
+
exports.isProfiler = isProfiler;
|
|
315
|
+
exports.isStrictMode = isStrictMode;
|
|
316
|
+
exports.isSuspense = isSuspense;
|
|
317
|
+
exports.isValidElementType = isValidElementType;
|
|
318
|
+
exports.typeOf = typeOf;
|
|
319
|
+
})();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// node_modules/prop-types/node_modules/react-is/index.js
|
|
325
|
+
var require_react_is = __commonJS({
|
|
326
|
+
"node_modules/prop-types/node_modules/react-is/index.js"(exports, module) {
|
|
327
|
+
"use strict";
|
|
328
|
+
if (process.env.NODE_ENV === "production") {
|
|
329
|
+
module.exports = require_react_is_production_min();
|
|
330
|
+
} else {
|
|
331
|
+
module.exports = require_react_is_development();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
// node_modules/object-assign/index.js
|
|
337
|
+
var require_object_assign = __commonJS({
|
|
338
|
+
"node_modules/object-assign/index.js"(exports, module) {
|
|
339
|
+
"use strict";
|
|
340
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
341
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
342
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
343
|
+
function toObject(val) {
|
|
344
|
+
if (val === null || val === void 0) {
|
|
345
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
346
|
+
}
|
|
347
|
+
return Object(val);
|
|
348
|
+
}
|
|
349
|
+
function shouldUseNative() {
|
|
350
|
+
try {
|
|
351
|
+
if (!Object.assign) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
var test1 = new String("abc");
|
|
355
|
+
test1[5] = "de";
|
|
356
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
var test2 = {};
|
|
360
|
+
for (var i = 0; i < 10; i++) {
|
|
361
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
362
|
+
}
|
|
363
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
364
|
+
return test2[n];
|
|
365
|
+
});
|
|
366
|
+
if (order2.join("") !== "0123456789") {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
var test3 = {};
|
|
370
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
371
|
+
test3[letter] = letter;
|
|
372
|
+
});
|
|
373
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
return true;
|
|
377
|
+
} catch (err) {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
382
|
+
var from;
|
|
383
|
+
var to = toObject(target);
|
|
384
|
+
var symbols;
|
|
385
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
386
|
+
from = Object(arguments[s]);
|
|
387
|
+
for (var key in from) {
|
|
388
|
+
if (hasOwnProperty.call(from, key)) {
|
|
389
|
+
to[key] = from[key];
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
if (getOwnPropertySymbols) {
|
|
393
|
+
symbols = getOwnPropertySymbols(from);
|
|
394
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
395
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
396
|
+
to[symbols[i]] = from[symbols[i]];
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return to;
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
407
|
+
var require_ReactPropTypesSecret = __commonJS({
|
|
408
|
+
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
|
|
409
|
+
"use strict";
|
|
410
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
411
|
+
module.exports = ReactPropTypesSecret;
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
// node_modules/prop-types/lib/has.js
|
|
416
|
+
var require_has = __commonJS({
|
|
417
|
+
"node_modules/prop-types/lib/has.js"(exports, module) {
|
|
418
|
+
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// node_modules/prop-types/checkPropTypes.js
|
|
423
|
+
var require_checkPropTypes = __commonJS({
|
|
424
|
+
"node_modules/prop-types/checkPropTypes.js"(exports, module) {
|
|
425
|
+
"use strict";
|
|
426
|
+
var printWarning = function() {
|
|
427
|
+
};
|
|
428
|
+
if (process.env.NODE_ENV !== "production") {
|
|
429
|
+
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
430
|
+
loggedTypeFailures = {};
|
|
431
|
+
has = require_has();
|
|
432
|
+
printWarning = function(text) {
|
|
433
|
+
var message = "Warning: " + text;
|
|
434
|
+
if (typeof console !== "undefined") {
|
|
435
|
+
console.error(message);
|
|
436
|
+
}
|
|
437
|
+
try {
|
|
438
|
+
throw new Error(message);
|
|
439
|
+
} catch (x) {
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
var ReactPropTypesSecret;
|
|
444
|
+
var loggedTypeFailures;
|
|
445
|
+
var has;
|
|
446
|
+
function checkPropTypes(typeSpecs, values2, location, componentName, getStack) {
|
|
447
|
+
if (process.env.NODE_ENV !== "production") {
|
|
448
|
+
for (var typeSpecName in typeSpecs) {
|
|
449
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
450
|
+
var error;
|
|
451
|
+
try {
|
|
452
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
453
|
+
var err = Error(
|
|
454
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
455
|
+
);
|
|
456
|
+
err.name = "Invariant Violation";
|
|
457
|
+
throw err;
|
|
458
|
+
}
|
|
459
|
+
error = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
460
|
+
} catch (ex) {
|
|
461
|
+
error = ex;
|
|
462
|
+
}
|
|
463
|
+
if (error && !(error instanceof Error)) {
|
|
464
|
+
printWarning(
|
|
465
|
+
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
469
|
+
loggedTypeFailures[error.message] = true;
|
|
470
|
+
var stack = getStack ? getStack() : "";
|
|
471
|
+
printWarning(
|
|
472
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
checkPropTypes.resetWarningCache = function() {
|
|
480
|
+
if (process.env.NODE_ENV !== "production") {
|
|
481
|
+
loggedTypeFailures = {};
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
module.exports = checkPropTypes;
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
489
|
+
var require_factoryWithTypeCheckers = __commonJS({
|
|
490
|
+
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
|
|
491
|
+
"use strict";
|
|
492
|
+
var ReactIs = require_react_is();
|
|
493
|
+
var assign = require_object_assign();
|
|
494
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
495
|
+
var has = require_has();
|
|
496
|
+
var checkPropTypes = require_checkPropTypes();
|
|
497
|
+
var printWarning = function() {
|
|
498
|
+
};
|
|
499
|
+
if (process.env.NODE_ENV !== "production") {
|
|
500
|
+
printWarning = function(text) {
|
|
501
|
+
var message = "Warning: " + text;
|
|
502
|
+
if (typeof console !== "undefined") {
|
|
503
|
+
console.error(message);
|
|
504
|
+
}
|
|
505
|
+
try {
|
|
506
|
+
throw new Error(message);
|
|
507
|
+
} catch (x) {
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
function emptyFunctionThatReturnsNull() {
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
515
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
516
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
517
|
+
function getIteratorFn(maybeIterable) {
|
|
518
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
519
|
+
if (typeof iteratorFn === "function") {
|
|
520
|
+
return iteratorFn;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
524
|
+
var ReactPropTypes = {
|
|
525
|
+
array: createPrimitiveTypeChecker("array"),
|
|
526
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
527
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
528
|
+
func: createPrimitiveTypeChecker("function"),
|
|
529
|
+
number: createPrimitiveTypeChecker("number"),
|
|
530
|
+
object: createPrimitiveTypeChecker("object"),
|
|
531
|
+
string: createPrimitiveTypeChecker("string"),
|
|
532
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
533
|
+
any: createAnyTypeChecker(),
|
|
534
|
+
arrayOf: createArrayOfTypeChecker,
|
|
535
|
+
element: createElementTypeChecker(),
|
|
536
|
+
elementType: createElementTypeTypeChecker(),
|
|
537
|
+
instanceOf: createInstanceTypeChecker,
|
|
538
|
+
node: createNodeChecker(),
|
|
539
|
+
objectOf: createObjectOfTypeChecker,
|
|
540
|
+
oneOf: createEnumTypeChecker,
|
|
541
|
+
oneOfType: createUnionTypeChecker,
|
|
542
|
+
shape: createShapeTypeChecker,
|
|
543
|
+
exact: createStrictShapeTypeChecker
|
|
544
|
+
};
|
|
545
|
+
function is(x, y) {
|
|
546
|
+
if (x === y) {
|
|
547
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
548
|
+
} else {
|
|
549
|
+
return x !== x && y !== y;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
function PropTypeError(message, data) {
|
|
553
|
+
this.message = message;
|
|
554
|
+
this.data = data && typeof data === "object" ? data : {};
|
|
555
|
+
this.stack = "";
|
|
556
|
+
}
|
|
557
|
+
PropTypeError.prototype = Error.prototype;
|
|
558
|
+
function createChainableTypeChecker(validate) {
|
|
559
|
+
if (process.env.NODE_ENV !== "production") {
|
|
560
|
+
var manualPropTypeCallCache = {};
|
|
561
|
+
var manualPropTypeWarningCount = 0;
|
|
562
|
+
}
|
|
563
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
564
|
+
componentName = componentName || ANONYMOUS;
|
|
565
|
+
propFullName = propFullName || propName;
|
|
566
|
+
if (secret !== ReactPropTypesSecret) {
|
|
567
|
+
if (throwOnDirectAccess) {
|
|
568
|
+
var err = new Error(
|
|
569
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
570
|
+
);
|
|
571
|
+
err.name = "Invariant Violation";
|
|
572
|
+
throw err;
|
|
573
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
574
|
+
var cacheKey = componentName + ":" + propName;
|
|
575
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
576
|
+
manualPropTypeWarningCount < 3) {
|
|
577
|
+
printWarning(
|
|
578
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
579
|
+
);
|
|
580
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
581
|
+
manualPropTypeWarningCount++;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
if (props[propName] == null) {
|
|
586
|
+
if (isRequired) {
|
|
587
|
+
if (props[propName] === null) {
|
|
588
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
589
|
+
}
|
|
590
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
591
|
+
}
|
|
592
|
+
return null;
|
|
593
|
+
} else {
|
|
594
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
598
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
599
|
+
return chainedCheckType;
|
|
600
|
+
}
|
|
601
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
602
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
603
|
+
var propValue = props[propName];
|
|
604
|
+
var propType = getPropType(propValue);
|
|
605
|
+
if (propType !== expectedType) {
|
|
606
|
+
var preciseType = getPreciseType(propValue);
|
|
607
|
+
return new PropTypeError(
|
|
608
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
609
|
+
{ expectedType }
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
return createChainableTypeChecker(validate);
|
|
615
|
+
}
|
|
616
|
+
function createAnyTypeChecker() {
|
|
617
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
618
|
+
}
|
|
619
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
620
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
621
|
+
if (typeof typeChecker !== "function") {
|
|
622
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
623
|
+
}
|
|
624
|
+
var propValue = props[propName];
|
|
625
|
+
if (!Array.isArray(propValue)) {
|
|
626
|
+
var propType = getPropType(propValue);
|
|
627
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
628
|
+
}
|
|
629
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
630
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
631
|
+
if (error instanceof Error) {
|
|
632
|
+
return error;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
return createChainableTypeChecker(validate);
|
|
638
|
+
}
|
|
639
|
+
function createElementTypeChecker() {
|
|
640
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
641
|
+
var propValue = props[propName];
|
|
642
|
+
if (!isValidElement(propValue)) {
|
|
643
|
+
var propType = getPropType(propValue);
|
|
644
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
645
|
+
}
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
return createChainableTypeChecker(validate);
|
|
649
|
+
}
|
|
650
|
+
function createElementTypeTypeChecker() {
|
|
651
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
652
|
+
var propValue = props[propName];
|
|
653
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
654
|
+
var propType = getPropType(propValue);
|
|
655
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
656
|
+
}
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
return createChainableTypeChecker(validate);
|
|
660
|
+
}
|
|
661
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
662
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
663
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
664
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
665
|
+
var actualClassName = getClassName(props[propName]);
|
|
666
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
667
|
+
}
|
|
668
|
+
return null;
|
|
669
|
+
}
|
|
670
|
+
return createChainableTypeChecker(validate);
|
|
671
|
+
}
|
|
672
|
+
function createEnumTypeChecker(expectedValues) {
|
|
673
|
+
if (!Array.isArray(expectedValues)) {
|
|
674
|
+
if (process.env.NODE_ENV !== "production") {
|
|
675
|
+
if (arguments.length > 1) {
|
|
676
|
+
printWarning(
|
|
677
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
678
|
+
);
|
|
679
|
+
} else {
|
|
680
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return emptyFunctionThatReturnsNull;
|
|
684
|
+
}
|
|
685
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
686
|
+
var propValue = props[propName];
|
|
687
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
688
|
+
if (is(propValue, expectedValues[i])) {
|
|
689
|
+
return null;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
693
|
+
var type = getPreciseType(value);
|
|
694
|
+
if (type === "symbol") {
|
|
695
|
+
return String(value);
|
|
696
|
+
}
|
|
697
|
+
return value;
|
|
698
|
+
});
|
|
699
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
700
|
+
}
|
|
701
|
+
return createChainableTypeChecker(validate);
|
|
702
|
+
}
|
|
703
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
704
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
705
|
+
if (typeof typeChecker !== "function") {
|
|
706
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
707
|
+
}
|
|
708
|
+
var propValue = props[propName];
|
|
709
|
+
var propType = getPropType(propValue);
|
|
710
|
+
if (propType !== "object") {
|
|
711
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
712
|
+
}
|
|
713
|
+
for (var key in propValue) {
|
|
714
|
+
if (has(propValue, key)) {
|
|
715
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
716
|
+
if (error instanceof Error) {
|
|
717
|
+
return error;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
return null;
|
|
722
|
+
}
|
|
723
|
+
return createChainableTypeChecker(validate);
|
|
724
|
+
}
|
|
725
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
726
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
727
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
728
|
+
return emptyFunctionThatReturnsNull;
|
|
729
|
+
}
|
|
730
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
731
|
+
var checker = arrayOfTypeCheckers[i];
|
|
732
|
+
if (typeof checker !== "function") {
|
|
733
|
+
printWarning(
|
|
734
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
735
|
+
);
|
|
736
|
+
return emptyFunctionThatReturnsNull;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
740
|
+
var expectedTypes = [];
|
|
741
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
742
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
743
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
744
|
+
if (checkerResult == null) {
|
|
745
|
+
return null;
|
|
746
|
+
}
|
|
747
|
+
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
748
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
752
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
753
|
+
}
|
|
754
|
+
return createChainableTypeChecker(validate);
|
|
755
|
+
}
|
|
756
|
+
function createNodeChecker() {
|
|
757
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
758
|
+
if (!isNode(props[propName])) {
|
|
759
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
760
|
+
}
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
763
|
+
return createChainableTypeChecker(validate);
|
|
764
|
+
}
|
|
765
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
766
|
+
return new PropTypeError(
|
|
767
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
771
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
772
|
+
var propValue = props[propName];
|
|
773
|
+
var propType = getPropType(propValue);
|
|
774
|
+
if (propType !== "object") {
|
|
775
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
776
|
+
}
|
|
777
|
+
for (var key in shapeTypes) {
|
|
778
|
+
var checker = shapeTypes[key];
|
|
779
|
+
if (typeof checker !== "function") {
|
|
780
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
781
|
+
}
|
|
782
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
783
|
+
if (error) {
|
|
784
|
+
return error;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
return null;
|
|
788
|
+
}
|
|
789
|
+
return createChainableTypeChecker(validate);
|
|
790
|
+
}
|
|
791
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
792
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
793
|
+
var propValue = props[propName];
|
|
794
|
+
var propType = getPropType(propValue);
|
|
795
|
+
if (propType !== "object") {
|
|
796
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
797
|
+
}
|
|
798
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
799
|
+
for (var key in allKeys) {
|
|
800
|
+
var checker = shapeTypes[key];
|
|
801
|
+
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
802
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
803
|
+
}
|
|
804
|
+
if (!checker) {
|
|
805
|
+
return new PropTypeError(
|
|
806
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
810
|
+
if (error) {
|
|
811
|
+
return error;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return null;
|
|
815
|
+
}
|
|
816
|
+
return createChainableTypeChecker(validate);
|
|
817
|
+
}
|
|
818
|
+
function isNode(propValue) {
|
|
819
|
+
switch (typeof propValue) {
|
|
820
|
+
case "number":
|
|
821
|
+
case "string":
|
|
822
|
+
case "undefined":
|
|
823
|
+
return true;
|
|
824
|
+
case "boolean":
|
|
825
|
+
return !propValue;
|
|
826
|
+
case "object":
|
|
827
|
+
if (Array.isArray(propValue)) {
|
|
828
|
+
return propValue.every(isNode);
|
|
829
|
+
}
|
|
830
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
831
|
+
return true;
|
|
832
|
+
}
|
|
833
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
834
|
+
if (iteratorFn) {
|
|
835
|
+
var iterator = iteratorFn.call(propValue);
|
|
836
|
+
var step;
|
|
837
|
+
if (iteratorFn !== propValue.entries) {
|
|
838
|
+
while (!(step = iterator.next()).done) {
|
|
839
|
+
if (!isNode(step.value)) {
|
|
840
|
+
return false;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
} else {
|
|
844
|
+
while (!(step = iterator.next()).done) {
|
|
845
|
+
var entry = step.value;
|
|
846
|
+
if (entry) {
|
|
847
|
+
if (!isNode(entry[1])) {
|
|
848
|
+
return false;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
} else {
|
|
854
|
+
return false;
|
|
855
|
+
}
|
|
856
|
+
return true;
|
|
857
|
+
default:
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
function isSymbol(propType, propValue) {
|
|
862
|
+
if (propType === "symbol") {
|
|
863
|
+
return true;
|
|
864
|
+
}
|
|
865
|
+
if (!propValue) {
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
869
|
+
return true;
|
|
870
|
+
}
|
|
871
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
872
|
+
return true;
|
|
873
|
+
}
|
|
874
|
+
return false;
|
|
875
|
+
}
|
|
876
|
+
function getPropType(propValue) {
|
|
877
|
+
var propType = typeof propValue;
|
|
878
|
+
if (Array.isArray(propValue)) {
|
|
879
|
+
return "array";
|
|
880
|
+
}
|
|
881
|
+
if (propValue instanceof RegExp) {
|
|
882
|
+
return "object";
|
|
883
|
+
}
|
|
884
|
+
if (isSymbol(propType, propValue)) {
|
|
885
|
+
return "symbol";
|
|
886
|
+
}
|
|
887
|
+
return propType;
|
|
888
|
+
}
|
|
889
|
+
function getPreciseType(propValue) {
|
|
890
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
891
|
+
return "" + propValue;
|
|
892
|
+
}
|
|
893
|
+
var propType = getPropType(propValue);
|
|
894
|
+
if (propType === "object") {
|
|
895
|
+
if (propValue instanceof Date) {
|
|
896
|
+
return "date";
|
|
897
|
+
} else if (propValue instanceof RegExp) {
|
|
898
|
+
return "regexp";
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
return propType;
|
|
902
|
+
}
|
|
903
|
+
function getPostfixForTypeWarning(value) {
|
|
904
|
+
var type = getPreciseType(value);
|
|
905
|
+
switch (type) {
|
|
906
|
+
case "array":
|
|
907
|
+
case "object":
|
|
908
|
+
return "an " + type;
|
|
909
|
+
case "boolean":
|
|
910
|
+
case "date":
|
|
911
|
+
case "regexp":
|
|
912
|
+
return "a " + type;
|
|
913
|
+
default:
|
|
914
|
+
return type;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
function getClassName(propValue) {
|
|
918
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
919
|
+
return ANONYMOUS;
|
|
920
|
+
}
|
|
921
|
+
return propValue.constructor.name;
|
|
922
|
+
}
|
|
923
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
924
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
925
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
926
|
+
return ReactPropTypes;
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
// node_modules/prop-types/factoryWithThrowingShims.js
|
|
932
|
+
var require_factoryWithThrowingShims = __commonJS({
|
|
933
|
+
"node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
|
|
934
|
+
"use strict";
|
|
935
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
936
|
+
function emptyFunction() {
|
|
937
|
+
}
|
|
938
|
+
function emptyFunctionWithReset() {
|
|
939
|
+
}
|
|
940
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
941
|
+
module.exports = function() {
|
|
942
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
943
|
+
if (secret === ReactPropTypesSecret) {
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
var err = new Error(
|
|
947
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
948
|
+
);
|
|
949
|
+
err.name = "Invariant Violation";
|
|
950
|
+
throw err;
|
|
951
|
+
}
|
|
952
|
+
;
|
|
953
|
+
shim.isRequired = shim;
|
|
954
|
+
function getShim() {
|
|
955
|
+
return shim;
|
|
956
|
+
}
|
|
957
|
+
;
|
|
958
|
+
var ReactPropTypes = {
|
|
959
|
+
array: shim,
|
|
960
|
+
bigint: shim,
|
|
961
|
+
bool: shim,
|
|
962
|
+
func: shim,
|
|
963
|
+
number: shim,
|
|
964
|
+
object: shim,
|
|
965
|
+
string: shim,
|
|
966
|
+
symbol: shim,
|
|
967
|
+
any: shim,
|
|
968
|
+
arrayOf: getShim,
|
|
969
|
+
element: shim,
|
|
970
|
+
elementType: shim,
|
|
971
|
+
instanceOf: getShim,
|
|
972
|
+
node: shim,
|
|
973
|
+
objectOf: getShim,
|
|
974
|
+
oneOf: getShim,
|
|
975
|
+
oneOfType: getShim,
|
|
976
|
+
shape: getShim,
|
|
977
|
+
exact: getShim,
|
|
978
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
979
|
+
resetWarningCache: emptyFunction
|
|
980
|
+
};
|
|
981
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
982
|
+
return ReactPropTypes;
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
// node_modules/prop-types/index.js
|
|
988
|
+
var require_prop_types = __commonJS({
|
|
989
|
+
"node_modules/prop-types/index.js"(exports, module) {
|
|
990
|
+
if (process.env.NODE_ENV !== "production") {
|
|
991
|
+
ReactIs = require_react_is();
|
|
992
|
+
throwOnDirectAccess = true;
|
|
993
|
+
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
994
|
+
} else {
|
|
995
|
+
module.exports = require_factoryWithThrowingShims()();
|
|
996
|
+
}
|
|
997
|
+
var ReactIs;
|
|
998
|
+
var throwOnDirectAccess;
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
|
|
1002
|
+
// src/components/Grid/Grid.tsx
|
|
1003
|
+
import React9, {
|
|
1004
|
+
useEffect,
|
|
1005
|
+
useMemo,
|
|
1006
|
+
useRef,
|
|
1007
|
+
useState
|
|
1008
|
+
} from "react";
|
|
1009
|
+
import {
|
|
1010
|
+
Autocomplete,
|
|
1011
|
+
Box as Box2,
|
|
1012
|
+
Button,
|
|
1013
|
+
IconButton as IconButton2,
|
|
1014
|
+
LinearProgress,
|
|
1015
|
+
Paper,
|
|
1016
|
+
Popover,
|
|
1017
|
+
Table,
|
|
1018
|
+
TableBody,
|
|
1019
|
+
TableContainer,
|
|
1020
|
+
TablePagination,
|
|
1021
|
+
TextField,
|
|
1022
|
+
Typography
|
|
1023
|
+
} from "@mui/material";
|
|
1024
|
+
|
|
1025
|
+
// src/components/Grid/Header.tsx
|
|
1026
|
+
import React from "react";
|
|
1027
|
+
import { TableCell, TableHead, TableRow, TableSortLabel } from "@mui/material";
|
|
1028
|
+
var GridHeader = ({
|
|
1029
|
+
setOrder,
|
|
1030
|
+
setOrderBy,
|
|
1031
|
+
order,
|
|
1032
|
+
orderBy,
|
|
1033
|
+
titles = []
|
|
1034
|
+
}) => {
|
|
1035
|
+
function onRequestSort(title) {
|
|
1036
|
+
if (title !== orderBy) {
|
|
1037
|
+
setOrderBy(title);
|
|
1038
|
+
return setOrder("desc");
|
|
1039
|
+
}
|
|
1040
|
+
switch (order) {
|
|
1041
|
+
case "desc":
|
|
1042
|
+
setOrder("asc");
|
|
1043
|
+
setOrderBy(title);
|
|
1044
|
+
break;
|
|
1045
|
+
case "asc":
|
|
1046
|
+
setOrder(void 0);
|
|
1047
|
+
setOrderBy("");
|
|
1048
|
+
break;
|
|
1049
|
+
default:
|
|
1050
|
+
setOrder("desc");
|
|
1051
|
+
setOrderBy(title);
|
|
1052
|
+
break;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
return /* @__PURE__ */ React.createElement(TableHead, null, /* @__PURE__ */ React.createElement(TableRow, { sx: { backgroundColor: "background.default" } }, titles.map((title) => {
|
|
1056
|
+
return /* @__PURE__ */ React.createElement(
|
|
1057
|
+
TableCell,
|
|
1058
|
+
{
|
|
1059
|
+
key: title.name,
|
|
1060
|
+
sortDirection: orderBy === title.name ? order : false,
|
|
1061
|
+
sx: __spreadValues({ fontWeight: "bold" }, title.sx)
|
|
1062
|
+
},
|
|
1063
|
+
/* @__PURE__ */ React.createElement(
|
|
1064
|
+
TableSortLabel,
|
|
1065
|
+
{
|
|
1066
|
+
onClick: () => onRequestSort(title.name),
|
|
1067
|
+
active: orderBy === title.name,
|
|
1068
|
+
direction: orderBy === title.name ? order : "asc",
|
|
1069
|
+
sx: {
|
|
1070
|
+
position: "relative",
|
|
1071
|
+
svg: { position: "absolute", right: "27px" }
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
title.label
|
|
1075
|
+
)
|
|
1076
|
+
);
|
|
1077
|
+
})));
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
// src/components/Grid/Filters.tsx
|
|
1081
|
+
import React5 from "react";
|
|
1082
|
+
|
|
1083
|
+
// node_modules/@babel/runtime/helpers/esm/extends.js
|
|
1084
|
+
function _extends() {
|
|
1085
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
1086
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1087
|
+
var source = arguments[i];
|
|
1088
|
+
for (var key in source) {
|
|
1089
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1090
|
+
target[key] = source[key];
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
return target;
|
|
1095
|
+
};
|
|
1096
|
+
return _extends.apply(this, arguments);
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// node_modules/@mui/utils/esm/deepmerge.js
|
|
1100
|
+
function isPlainObject(item) {
|
|
1101
|
+
return item !== null && typeof item === "object" && item.constructor === Object;
|
|
1102
|
+
}
|
|
1103
|
+
function deepmerge(target, source, options = {
|
|
1104
|
+
clone: true
|
|
1105
|
+
}) {
|
|
1106
|
+
const output = options.clone ? _extends({}, target) : target;
|
|
1107
|
+
if (isPlainObject(target) && isPlainObject(source)) {
|
|
1108
|
+
Object.keys(source).forEach((key) => {
|
|
1109
|
+
if (key === "__proto__") {
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
1113
|
+
output[key] = deepmerge(target[key], source[key], options);
|
|
1114
|
+
} else {
|
|
1115
|
+
output[key] = source[key];
|
|
1116
|
+
}
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
return output;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
// node_modules/@mui/utils/esm/formatMuiErrorMessage.js
|
|
1123
|
+
function formatMuiErrorMessage(code) {
|
|
1124
|
+
let url = "https://mui.com/production-error/?code=" + code;
|
|
1125
|
+
for (let i = 1; i < arguments.length; i += 1) {
|
|
1126
|
+
url += "&args[]=" + encodeURIComponent(arguments[i]);
|
|
1127
|
+
}
|
|
1128
|
+
return "Minified MUI error #" + code + "; visit " + url + " for the full message.";
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
// node_modules/@mui/utils/esm/capitalize.js
|
|
1132
|
+
function capitalize(string) {
|
|
1133
|
+
if (typeof string !== "string") {
|
|
1134
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`capitalize(string)\` expects a string argument.` : formatMuiErrorMessage(7));
|
|
1135
|
+
}
|
|
1136
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
// node_modules/@mui/styled-engine/index.js
|
|
1140
|
+
import emStyled from "@emotion/styled";
|
|
1141
|
+
import { ThemeContext, keyframes, css } from "@emotion/react";
|
|
1142
|
+
function styled(tag, options) {
|
|
1143
|
+
const stylesFactory = emStyled(tag, options);
|
|
1144
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1145
|
+
return (...styles2) => {
|
|
1146
|
+
const component = typeof tag === "string" ? `"${tag}"` : "component";
|
|
1147
|
+
if (styles2.length === 0) {
|
|
1148
|
+
console.error([`MUI: Seems like you called \`styled(${component})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n"));
|
|
1149
|
+
} else if (styles2.some((style3) => style3 === void 0)) {
|
|
1150
|
+
console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);
|
|
1151
|
+
}
|
|
1152
|
+
return stylesFactory(...styles2);
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
return stylesFactory;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// node_modules/@mui/system/esm/responsivePropType.js
|
|
1159
|
+
var import_prop_types = __toESM(require_prop_types());
|
|
1160
|
+
var responsivePropType = process.env.NODE_ENV !== "production" ? import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.string, import_prop_types.default.object, import_prop_types.default.array]) : {};
|
|
1161
|
+
var responsivePropType_default = responsivePropType;
|
|
1162
|
+
|
|
1163
|
+
// node_modules/@mui/system/esm/merge.js
|
|
1164
|
+
function merge(acc, item) {
|
|
1165
|
+
if (!item) {
|
|
1166
|
+
return acc;
|
|
1167
|
+
}
|
|
1168
|
+
return deepmerge(acc, item, {
|
|
1169
|
+
clone: false
|
|
1170
|
+
// No need to clone deep, it's way faster.
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
var merge_default = merge;
|
|
1174
|
+
|
|
1175
|
+
// node_modules/@mui/system/esm/breakpoints.js
|
|
1176
|
+
var values = {
|
|
1177
|
+
xs: 0,
|
|
1178
|
+
// phone
|
|
1179
|
+
sm: 600,
|
|
1180
|
+
// tablet
|
|
1181
|
+
md: 900,
|
|
1182
|
+
// small laptop
|
|
1183
|
+
lg: 1200,
|
|
1184
|
+
// desktop
|
|
1185
|
+
xl: 1536
|
|
1186
|
+
// large screen
|
|
1187
|
+
};
|
|
1188
|
+
var defaultBreakpoints = {
|
|
1189
|
+
// Sorted ASC by size. That's important.
|
|
1190
|
+
// It can't be configured as it's used statically for propTypes.
|
|
1191
|
+
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
1192
|
+
up: (key) => `@media (min-width:${values[key]}px)`
|
|
1193
|
+
};
|
|
1194
|
+
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
1195
|
+
const theme = props.theme || {};
|
|
1196
|
+
if (Array.isArray(propValue)) {
|
|
1197
|
+
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
1198
|
+
return propValue.reduce((acc, item, index) => {
|
|
1199
|
+
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
|
1200
|
+
return acc;
|
|
1201
|
+
}, {});
|
|
1202
|
+
}
|
|
1203
|
+
if (typeof propValue === "object") {
|
|
1204
|
+
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
1205
|
+
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
1206
|
+
if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {
|
|
1207
|
+
const mediaKey = themeBreakpoints.up(breakpoint);
|
|
1208
|
+
acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
1209
|
+
} else {
|
|
1210
|
+
const cssKey = breakpoint;
|
|
1211
|
+
acc[cssKey] = propValue[cssKey];
|
|
1212
|
+
}
|
|
1213
|
+
return acc;
|
|
1214
|
+
}, {});
|
|
1215
|
+
}
|
|
1216
|
+
const output = styleFromPropValue(propValue);
|
|
1217
|
+
return output;
|
|
1218
|
+
}
|
|
1219
|
+
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
1220
|
+
var _breakpointsInput$key;
|
|
1221
|
+
const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
1222
|
+
const breakpointStyleKey = breakpointsInput.up(key);
|
|
1223
|
+
acc[breakpointStyleKey] = {};
|
|
1224
|
+
return acc;
|
|
1225
|
+
}, {});
|
|
1226
|
+
return breakpointsInOrder || {};
|
|
1227
|
+
}
|
|
1228
|
+
function removeUnusedBreakpoints(breakpointKeys, style3) {
|
|
1229
|
+
return breakpointKeys.reduce((acc, key) => {
|
|
1230
|
+
const breakpointOutput = acc[key];
|
|
1231
|
+
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
1232
|
+
if (isBreakpointUnused) {
|
|
1233
|
+
delete acc[key];
|
|
1234
|
+
}
|
|
1235
|
+
return acc;
|
|
1236
|
+
}, style3);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
// node_modules/@mui/system/esm/style.js
|
|
1240
|
+
function getPath(obj, path, checkVars = true) {
|
|
1241
|
+
if (!path || typeof path !== "string") {
|
|
1242
|
+
return null;
|
|
1243
|
+
}
|
|
1244
|
+
if (obj && obj.vars && checkVars) {
|
|
1245
|
+
const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
1246
|
+
if (val != null) {
|
|
1247
|
+
return val;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
return path.split(".").reduce((acc, item) => {
|
|
1251
|
+
if (acc && acc[item] != null) {
|
|
1252
|
+
return acc[item];
|
|
1253
|
+
}
|
|
1254
|
+
return null;
|
|
1255
|
+
}, obj);
|
|
1256
|
+
}
|
|
1257
|
+
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
1258
|
+
let value;
|
|
1259
|
+
if (typeof themeMapping === "function") {
|
|
1260
|
+
value = themeMapping(propValueFinal);
|
|
1261
|
+
} else if (Array.isArray(themeMapping)) {
|
|
1262
|
+
value = themeMapping[propValueFinal] || userValue;
|
|
1263
|
+
} else {
|
|
1264
|
+
value = getPath(themeMapping, propValueFinal) || userValue;
|
|
1265
|
+
}
|
|
1266
|
+
if (transform) {
|
|
1267
|
+
value = transform(value, userValue, themeMapping);
|
|
1268
|
+
}
|
|
1269
|
+
return value;
|
|
1270
|
+
}
|
|
1271
|
+
function style(options) {
|
|
1272
|
+
const {
|
|
1273
|
+
prop,
|
|
1274
|
+
cssProperty = options.prop,
|
|
1275
|
+
themeKey,
|
|
1276
|
+
transform
|
|
1277
|
+
} = options;
|
|
1278
|
+
const fn = (props) => {
|
|
1279
|
+
if (props[prop] == null) {
|
|
1280
|
+
return null;
|
|
1281
|
+
}
|
|
1282
|
+
const propValue = props[prop];
|
|
1283
|
+
const theme = props.theme;
|
|
1284
|
+
const themeMapping = getPath(theme, themeKey) || {};
|
|
1285
|
+
const styleFromPropValue = (propValueFinal) => {
|
|
1286
|
+
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
1287
|
+
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
1288
|
+
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
1289
|
+
}
|
|
1290
|
+
if (cssProperty === false) {
|
|
1291
|
+
return value;
|
|
1292
|
+
}
|
|
1293
|
+
return {
|
|
1294
|
+
[cssProperty]: value
|
|
1295
|
+
};
|
|
1296
|
+
};
|
|
1297
|
+
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
1298
|
+
};
|
|
1299
|
+
fn.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1300
|
+
[prop]: responsivePropType_default
|
|
1301
|
+
} : {};
|
|
1302
|
+
fn.filterProps = [prop];
|
|
1303
|
+
return fn;
|
|
1304
|
+
}
|
|
1305
|
+
var style_default = style;
|
|
1306
|
+
|
|
1307
|
+
// node_modules/@mui/system/esm/compose.js
|
|
1308
|
+
function compose(...styles2) {
|
|
1309
|
+
const handlers = styles2.reduce((acc, style3) => {
|
|
1310
|
+
style3.filterProps.forEach((prop) => {
|
|
1311
|
+
acc[prop] = style3;
|
|
1312
|
+
});
|
|
1313
|
+
return acc;
|
|
1314
|
+
}, {});
|
|
1315
|
+
const fn = (props) => {
|
|
1316
|
+
return Object.keys(props).reduce((acc, prop) => {
|
|
1317
|
+
if (handlers[prop]) {
|
|
1318
|
+
return merge_default(acc, handlers[prop](props));
|
|
1319
|
+
}
|
|
1320
|
+
return acc;
|
|
1321
|
+
}, {});
|
|
1322
|
+
};
|
|
1323
|
+
fn.propTypes = process.env.NODE_ENV !== "production" ? styles2.reduce((acc, style3) => Object.assign(acc, style3.propTypes), {}) : {};
|
|
1324
|
+
fn.filterProps = styles2.reduce((acc, style3) => acc.concat(style3.filterProps), []);
|
|
1325
|
+
return fn;
|
|
1326
|
+
}
|
|
1327
|
+
var compose_default = compose;
|
|
1328
|
+
|
|
1329
|
+
// node_modules/@mui/system/esm/memoize.js
|
|
1330
|
+
function memoize(fn) {
|
|
1331
|
+
const cache = {};
|
|
1332
|
+
return (arg) => {
|
|
1333
|
+
if (cache[arg] === void 0) {
|
|
1334
|
+
cache[arg] = fn(arg);
|
|
1335
|
+
}
|
|
1336
|
+
return cache[arg];
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
// node_modules/@mui/system/esm/spacing.js
|
|
1341
|
+
var properties = {
|
|
1342
|
+
m: "margin",
|
|
1343
|
+
p: "padding"
|
|
1344
|
+
};
|
|
1345
|
+
var directions = {
|
|
1346
|
+
t: "Top",
|
|
1347
|
+
r: "Right",
|
|
1348
|
+
b: "Bottom",
|
|
1349
|
+
l: "Left",
|
|
1350
|
+
x: ["Left", "Right"],
|
|
1351
|
+
y: ["Top", "Bottom"]
|
|
1352
|
+
};
|
|
1353
|
+
var aliases = {
|
|
1354
|
+
marginX: "mx",
|
|
1355
|
+
marginY: "my",
|
|
1356
|
+
paddingX: "px",
|
|
1357
|
+
paddingY: "py"
|
|
1358
|
+
};
|
|
1359
|
+
var getCssProperties = memoize((prop) => {
|
|
1360
|
+
if (prop.length > 2) {
|
|
1361
|
+
if (aliases[prop]) {
|
|
1362
|
+
prop = aliases[prop];
|
|
1363
|
+
} else {
|
|
1364
|
+
return [prop];
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
const [a, b] = prop.split("");
|
|
1368
|
+
const property = properties[a];
|
|
1369
|
+
const direction = directions[b] || "";
|
|
1370
|
+
return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
|
|
1371
|
+
});
|
|
1372
|
+
var marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
|
|
1373
|
+
var paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
|
|
1374
|
+
var spacingKeys = [...marginKeys, ...paddingKeys];
|
|
1375
|
+
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
1376
|
+
var _getPath;
|
|
1377
|
+
const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
|
|
1378
|
+
if (typeof themeSpacing === "number") {
|
|
1379
|
+
return (abs) => {
|
|
1380
|
+
if (typeof abs === "string") {
|
|
1381
|
+
return abs;
|
|
1382
|
+
}
|
|
1383
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1384
|
+
if (typeof abs !== "number") {
|
|
1385
|
+
console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
return themeSpacing * abs;
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
1391
|
+
if (Array.isArray(themeSpacing)) {
|
|
1392
|
+
return (abs) => {
|
|
1393
|
+
if (typeof abs === "string") {
|
|
1394
|
+
return abs;
|
|
1395
|
+
}
|
|
1396
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1397
|
+
if (!Number.isInteger(abs)) {
|
|
1398
|
+
console.error([`MUI: The \`theme.${themeKey}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${themeKey}\` as a number.`].join("\n"));
|
|
1399
|
+
} else if (abs > themeSpacing.length - 1) {
|
|
1400
|
+
console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join("\n"));
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
return themeSpacing[abs];
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
if (typeof themeSpacing === "function") {
|
|
1407
|
+
return themeSpacing;
|
|
1408
|
+
}
|
|
1409
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1410
|
+
console.error([`MUI: The \`theme.${themeKey}\` value (${themeSpacing}) is invalid.`, "It should be a number, an array or a function."].join("\n"));
|
|
1411
|
+
}
|
|
1412
|
+
return () => void 0;
|
|
1413
|
+
}
|
|
1414
|
+
function createUnarySpacing(theme) {
|
|
1415
|
+
return createUnaryUnit(theme, "spacing", 8, "spacing");
|
|
1416
|
+
}
|
|
1417
|
+
function getValue(transformer, propValue) {
|
|
1418
|
+
if (typeof propValue === "string" || propValue == null) {
|
|
1419
|
+
return propValue;
|
|
1420
|
+
}
|
|
1421
|
+
const abs = Math.abs(propValue);
|
|
1422
|
+
const transformed = transformer(abs);
|
|
1423
|
+
if (propValue >= 0) {
|
|
1424
|
+
return transformed;
|
|
1425
|
+
}
|
|
1426
|
+
if (typeof transformed === "number") {
|
|
1427
|
+
return -transformed;
|
|
1428
|
+
}
|
|
1429
|
+
return `-${transformed}`;
|
|
1430
|
+
}
|
|
1431
|
+
function getStyleFromPropValue(cssProperties, transformer) {
|
|
1432
|
+
return (propValue) => cssProperties.reduce((acc, cssProperty) => {
|
|
1433
|
+
acc[cssProperty] = getValue(transformer, propValue);
|
|
1434
|
+
return acc;
|
|
1435
|
+
}, {});
|
|
1436
|
+
}
|
|
1437
|
+
function resolveCssProperty(props, keys, prop, transformer) {
|
|
1438
|
+
if (keys.indexOf(prop) === -1) {
|
|
1439
|
+
return null;
|
|
1440
|
+
}
|
|
1441
|
+
const cssProperties = getCssProperties(prop);
|
|
1442
|
+
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
1443
|
+
const propValue = props[prop];
|
|
1444
|
+
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
1445
|
+
}
|
|
1446
|
+
function style2(props, keys) {
|
|
1447
|
+
const transformer = createUnarySpacing(props.theme);
|
|
1448
|
+
return Object.keys(props).map((prop) => resolveCssProperty(props, keys, prop, transformer)).reduce(merge_default, {});
|
|
1449
|
+
}
|
|
1450
|
+
function margin(props) {
|
|
1451
|
+
return style2(props, marginKeys);
|
|
1452
|
+
}
|
|
1453
|
+
margin.propTypes = process.env.NODE_ENV !== "production" ? marginKeys.reduce((obj, key) => {
|
|
1454
|
+
obj[key] = responsivePropType_default;
|
|
1455
|
+
return obj;
|
|
1456
|
+
}, {}) : {};
|
|
1457
|
+
margin.filterProps = marginKeys;
|
|
1458
|
+
function padding(props) {
|
|
1459
|
+
return style2(props, paddingKeys);
|
|
1460
|
+
}
|
|
1461
|
+
padding.propTypes = process.env.NODE_ENV !== "production" ? paddingKeys.reduce((obj, key) => {
|
|
1462
|
+
obj[key] = responsivePropType_default;
|
|
1463
|
+
return obj;
|
|
1464
|
+
}, {}) : {};
|
|
1465
|
+
padding.filterProps = paddingKeys;
|
|
1466
|
+
function spacing(props) {
|
|
1467
|
+
return style2(props, spacingKeys);
|
|
1468
|
+
}
|
|
1469
|
+
spacing.propTypes = process.env.NODE_ENV !== "production" ? spacingKeys.reduce((obj, key) => {
|
|
1470
|
+
obj[key] = responsivePropType_default;
|
|
1471
|
+
return obj;
|
|
1472
|
+
}, {}) : {};
|
|
1473
|
+
spacing.filterProps = spacingKeys;
|
|
1474
|
+
|
|
1475
|
+
// node_modules/@mui/system/esm/borders.js
|
|
1476
|
+
function borderTransform(value) {
|
|
1477
|
+
if (typeof value !== "number") {
|
|
1478
|
+
return value;
|
|
1479
|
+
}
|
|
1480
|
+
return `${value}px solid`;
|
|
1481
|
+
}
|
|
1482
|
+
var border = style_default({
|
|
1483
|
+
prop: "border",
|
|
1484
|
+
themeKey: "borders",
|
|
1485
|
+
transform: borderTransform
|
|
1486
|
+
});
|
|
1487
|
+
var borderTop = style_default({
|
|
1488
|
+
prop: "borderTop",
|
|
1489
|
+
themeKey: "borders",
|
|
1490
|
+
transform: borderTransform
|
|
1491
|
+
});
|
|
1492
|
+
var borderRight = style_default({
|
|
1493
|
+
prop: "borderRight",
|
|
1494
|
+
themeKey: "borders",
|
|
1495
|
+
transform: borderTransform
|
|
1496
|
+
});
|
|
1497
|
+
var borderBottom = style_default({
|
|
1498
|
+
prop: "borderBottom",
|
|
1499
|
+
themeKey: "borders",
|
|
1500
|
+
transform: borderTransform
|
|
1501
|
+
});
|
|
1502
|
+
var borderLeft = style_default({
|
|
1503
|
+
prop: "borderLeft",
|
|
1504
|
+
themeKey: "borders",
|
|
1505
|
+
transform: borderTransform
|
|
1506
|
+
});
|
|
1507
|
+
var borderColor = style_default({
|
|
1508
|
+
prop: "borderColor",
|
|
1509
|
+
themeKey: "palette"
|
|
1510
|
+
});
|
|
1511
|
+
var borderTopColor = style_default({
|
|
1512
|
+
prop: "borderTopColor",
|
|
1513
|
+
themeKey: "palette"
|
|
1514
|
+
});
|
|
1515
|
+
var borderRightColor = style_default({
|
|
1516
|
+
prop: "borderRightColor",
|
|
1517
|
+
themeKey: "palette"
|
|
1518
|
+
});
|
|
1519
|
+
var borderBottomColor = style_default({
|
|
1520
|
+
prop: "borderBottomColor",
|
|
1521
|
+
themeKey: "palette"
|
|
1522
|
+
});
|
|
1523
|
+
var borderLeftColor = style_default({
|
|
1524
|
+
prop: "borderLeftColor",
|
|
1525
|
+
themeKey: "palette"
|
|
1526
|
+
});
|
|
1527
|
+
var borderRadius = (props) => {
|
|
1528
|
+
if (props.borderRadius !== void 0 && props.borderRadius !== null) {
|
|
1529
|
+
const transformer = createUnaryUnit(props.theme, "shape.borderRadius", 4, "borderRadius");
|
|
1530
|
+
const styleFromPropValue = (propValue) => ({
|
|
1531
|
+
borderRadius: getValue(transformer, propValue)
|
|
1532
|
+
});
|
|
1533
|
+
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
1534
|
+
}
|
|
1535
|
+
return null;
|
|
1536
|
+
};
|
|
1537
|
+
borderRadius.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1538
|
+
borderRadius: responsivePropType_default
|
|
1539
|
+
} : {};
|
|
1540
|
+
borderRadius.filterProps = ["borderRadius"];
|
|
1541
|
+
var borders = compose_default(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);
|
|
1542
|
+
|
|
1543
|
+
// node_modules/@mui/system/esm/cssGrid.js
|
|
1544
|
+
var gap = (props) => {
|
|
1545
|
+
if (props.gap !== void 0 && props.gap !== null) {
|
|
1546
|
+
const transformer = createUnaryUnit(props.theme, "spacing", 8, "gap");
|
|
1547
|
+
const styleFromPropValue = (propValue) => ({
|
|
1548
|
+
gap: getValue(transformer, propValue)
|
|
1549
|
+
});
|
|
1550
|
+
return handleBreakpoints(props, props.gap, styleFromPropValue);
|
|
1551
|
+
}
|
|
1552
|
+
return null;
|
|
1553
|
+
};
|
|
1554
|
+
gap.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1555
|
+
gap: responsivePropType_default
|
|
1556
|
+
} : {};
|
|
1557
|
+
gap.filterProps = ["gap"];
|
|
1558
|
+
var columnGap = (props) => {
|
|
1559
|
+
if (props.columnGap !== void 0 && props.columnGap !== null) {
|
|
1560
|
+
const transformer = createUnaryUnit(props.theme, "spacing", 8, "columnGap");
|
|
1561
|
+
const styleFromPropValue = (propValue) => ({
|
|
1562
|
+
columnGap: getValue(transformer, propValue)
|
|
1563
|
+
});
|
|
1564
|
+
return handleBreakpoints(props, props.columnGap, styleFromPropValue);
|
|
1565
|
+
}
|
|
1566
|
+
return null;
|
|
1567
|
+
};
|
|
1568
|
+
columnGap.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1569
|
+
columnGap: responsivePropType_default
|
|
1570
|
+
} : {};
|
|
1571
|
+
columnGap.filterProps = ["columnGap"];
|
|
1572
|
+
var rowGap = (props) => {
|
|
1573
|
+
if (props.rowGap !== void 0 && props.rowGap !== null) {
|
|
1574
|
+
const transformer = createUnaryUnit(props.theme, "spacing", 8, "rowGap");
|
|
1575
|
+
const styleFromPropValue = (propValue) => ({
|
|
1576
|
+
rowGap: getValue(transformer, propValue)
|
|
1577
|
+
});
|
|
1578
|
+
return handleBreakpoints(props, props.rowGap, styleFromPropValue);
|
|
1579
|
+
}
|
|
1580
|
+
return null;
|
|
1581
|
+
};
|
|
1582
|
+
rowGap.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1583
|
+
rowGap: responsivePropType_default
|
|
1584
|
+
} : {};
|
|
1585
|
+
rowGap.filterProps = ["rowGap"];
|
|
1586
|
+
var gridColumn = style_default({
|
|
1587
|
+
prop: "gridColumn"
|
|
1588
|
+
});
|
|
1589
|
+
var gridRow = style_default({
|
|
1590
|
+
prop: "gridRow"
|
|
1591
|
+
});
|
|
1592
|
+
var gridAutoFlow = style_default({
|
|
1593
|
+
prop: "gridAutoFlow"
|
|
1594
|
+
});
|
|
1595
|
+
var gridAutoColumns = style_default({
|
|
1596
|
+
prop: "gridAutoColumns"
|
|
1597
|
+
});
|
|
1598
|
+
var gridAutoRows = style_default({
|
|
1599
|
+
prop: "gridAutoRows"
|
|
1600
|
+
});
|
|
1601
|
+
var gridTemplateColumns = style_default({
|
|
1602
|
+
prop: "gridTemplateColumns"
|
|
1603
|
+
});
|
|
1604
|
+
var gridTemplateRows = style_default({
|
|
1605
|
+
prop: "gridTemplateRows"
|
|
1606
|
+
});
|
|
1607
|
+
var gridTemplateAreas = style_default({
|
|
1608
|
+
prop: "gridTemplateAreas"
|
|
1609
|
+
});
|
|
1610
|
+
var gridArea = style_default({
|
|
1611
|
+
prop: "gridArea"
|
|
1612
|
+
});
|
|
1613
|
+
var grid = compose_default(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
1614
|
+
|
|
1615
|
+
// node_modules/@mui/system/esm/palette.js
|
|
1616
|
+
function paletteTransform(value, userValue) {
|
|
1617
|
+
if (userValue === "grey") {
|
|
1618
|
+
return userValue;
|
|
1619
|
+
}
|
|
1620
|
+
return value;
|
|
1621
|
+
}
|
|
1622
|
+
var color = style_default({
|
|
1623
|
+
prop: "color",
|
|
1624
|
+
themeKey: "palette",
|
|
1625
|
+
transform: paletteTransform
|
|
1626
|
+
});
|
|
1627
|
+
var bgcolor = style_default({
|
|
1628
|
+
prop: "bgcolor",
|
|
1629
|
+
cssProperty: "backgroundColor",
|
|
1630
|
+
themeKey: "palette",
|
|
1631
|
+
transform: paletteTransform
|
|
1632
|
+
});
|
|
1633
|
+
var backgroundColor = style_default({
|
|
1634
|
+
prop: "backgroundColor",
|
|
1635
|
+
themeKey: "palette",
|
|
1636
|
+
transform: paletteTransform
|
|
1637
|
+
});
|
|
1638
|
+
var palette = compose_default(color, bgcolor, backgroundColor);
|
|
1639
|
+
|
|
1640
|
+
// node_modules/@mui/system/esm/sizing.js
|
|
1641
|
+
function sizingTransform(value) {
|
|
1642
|
+
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
1643
|
+
}
|
|
1644
|
+
var width = style_default({
|
|
1645
|
+
prop: "width",
|
|
1646
|
+
transform: sizingTransform
|
|
1647
|
+
});
|
|
1648
|
+
var maxWidth = (props) => {
|
|
1649
|
+
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
1650
|
+
const styleFromPropValue = (propValue) => {
|
|
1651
|
+
var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;
|
|
1652
|
+
const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || values[propValue];
|
|
1653
|
+
return {
|
|
1654
|
+
maxWidth: breakpoint || sizingTransform(propValue)
|
|
1655
|
+
};
|
|
1656
|
+
};
|
|
1657
|
+
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
1658
|
+
}
|
|
1659
|
+
return null;
|
|
1660
|
+
};
|
|
1661
|
+
maxWidth.filterProps = ["maxWidth"];
|
|
1662
|
+
var minWidth = style_default({
|
|
1663
|
+
prop: "minWidth",
|
|
1664
|
+
transform: sizingTransform
|
|
1665
|
+
});
|
|
1666
|
+
var height = style_default({
|
|
1667
|
+
prop: "height",
|
|
1668
|
+
transform: sizingTransform
|
|
1669
|
+
});
|
|
1670
|
+
var maxHeight = style_default({
|
|
1671
|
+
prop: "maxHeight",
|
|
1672
|
+
transform: sizingTransform
|
|
1673
|
+
});
|
|
1674
|
+
var minHeight = style_default({
|
|
1675
|
+
prop: "minHeight",
|
|
1676
|
+
transform: sizingTransform
|
|
1677
|
+
});
|
|
1678
|
+
var sizeWidth = style_default({
|
|
1679
|
+
prop: "size",
|
|
1680
|
+
cssProperty: "width",
|
|
1681
|
+
transform: sizingTransform
|
|
1682
|
+
});
|
|
1683
|
+
var sizeHeight = style_default({
|
|
1684
|
+
prop: "size",
|
|
1685
|
+
cssProperty: "height",
|
|
1686
|
+
transform: sizingTransform
|
|
1687
|
+
});
|
|
1688
|
+
var boxSizing = style_default({
|
|
1689
|
+
prop: "boxSizing"
|
|
1690
|
+
});
|
|
1691
|
+
var sizing = compose_default(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
1692
|
+
|
|
1693
|
+
// node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js
|
|
1694
|
+
var defaultSxConfig = {
|
|
1695
|
+
// borders
|
|
1696
|
+
border: {
|
|
1697
|
+
themeKey: "borders",
|
|
1698
|
+
transform: borderTransform
|
|
1699
|
+
},
|
|
1700
|
+
borderTop: {
|
|
1701
|
+
themeKey: "borders",
|
|
1702
|
+
transform: borderTransform
|
|
1703
|
+
},
|
|
1704
|
+
borderRight: {
|
|
1705
|
+
themeKey: "borders",
|
|
1706
|
+
transform: borderTransform
|
|
1707
|
+
},
|
|
1708
|
+
borderBottom: {
|
|
1709
|
+
themeKey: "borders",
|
|
1710
|
+
transform: borderTransform
|
|
1711
|
+
},
|
|
1712
|
+
borderLeft: {
|
|
1713
|
+
themeKey: "borders",
|
|
1714
|
+
transform: borderTransform
|
|
1715
|
+
},
|
|
1716
|
+
borderColor: {
|
|
1717
|
+
themeKey: "palette"
|
|
1718
|
+
},
|
|
1719
|
+
borderTopColor: {
|
|
1720
|
+
themeKey: "palette"
|
|
1721
|
+
},
|
|
1722
|
+
borderRightColor: {
|
|
1723
|
+
themeKey: "palette"
|
|
1724
|
+
},
|
|
1725
|
+
borderBottomColor: {
|
|
1726
|
+
themeKey: "palette"
|
|
1727
|
+
},
|
|
1728
|
+
borderLeftColor: {
|
|
1729
|
+
themeKey: "palette"
|
|
1730
|
+
},
|
|
1731
|
+
borderRadius: {
|
|
1732
|
+
themeKey: "shape.borderRadius",
|
|
1733
|
+
style: borderRadius
|
|
1734
|
+
},
|
|
1735
|
+
// palette
|
|
1736
|
+
color: {
|
|
1737
|
+
themeKey: "palette",
|
|
1738
|
+
transform: paletteTransform
|
|
1739
|
+
},
|
|
1740
|
+
bgcolor: {
|
|
1741
|
+
themeKey: "palette",
|
|
1742
|
+
cssProperty: "backgroundColor",
|
|
1743
|
+
transform: paletteTransform
|
|
1744
|
+
},
|
|
1745
|
+
backgroundColor: {
|
|
1746
|
+
themeKey: "palette",
|
|
1747
|
+
transform: paletteTransform
|
|
1748
|
+
},
|
|
1749
|
+
// spacing
|
|
1750
|
+
p: {
|
|
1751
|
+
style: padding
|
|
1752
|
+
},
|
|
1753
|
+
pt: {
|
|
1754
|
+
style: padding
|
|
1755
|
+
},
|
|
1756
|
+
pr: {
|
|
1757
|
+
style: padding
|
|
1758
|
+
},
|
|
1759
|
+
pb: {
|
|
1760
|
+
style: padding
|
|
1761
|
+
},
|
|
1762
|
+
pl: {
|
|
1763
|
+
style: padding
|
|
1764
|
+
},
|
|
1765
|
+
px: {
|
|
1766
|
+
style: padding
|
|
1767
|
+
},
|
|
1768
|
+
py: {
|
|
1769
|
+
style: padding
|
|
1770
|
+
},
|
|
1771
|
+
padding: {
|
|
1772
|
+
style: padding
|
|
1773
|
+
},
|
|
1774
|
+
paddingTop: {
|
|
1775
|
+
style: padding
|
|
1776
|
+
},
|
|
1777
|
+
paddingRight: {
|
|
1778
|
+
style: padding
|
|
1779
|
+
},
|
|
1780
|
+
paddingBottom: {
|
|
1781
|
+
style: padding
|
|
1782
|
+
},
|
|
1783
|
+
paddingLeft: {
|
|
1784
|
+
style: padding
|
|
1785
|
+
},
|
|
1786
|
+
paddingX: {
|
|
1787
|
+
style: padding
|
|
1788
|
+
},
|
|
1789
|
+
paddingY: {
|
|
1790
|
+
style: padding
|
|
1791
|
+
},
|
|
1792
|
+
paddingInline: {
|
|
1793
|
+
style: padding
|
|
1794
|
+
},
|
|
1795
|
+
paddingInlineStart: {
|
|
1796
|
+
style: padding
|
|
1797
|
+
},
|
|
1798
|
+
paddingInlineEnd: {
|
|
1799
|
+
style: padding
|
|
1800
|
+
},
|
|
1801
|
+
paddingBlock: {
|
|
1802
|
+
style: padding
|
|
1803
|
+
},
|
|
1804
|
+
paddingBlockStart: {
|
|
1805
|
+
style: padding
|
|
1806
|
+
},
|
|
1807
|
+
paddingBlockEnd: {
|
|
1808
|
+
style: padding
|
|
1809
|
+
},
|
|
1810
|
+
m: {
|
|
1811
|
+
style: margin
|
|
1812
|
+
},
|
|
1813
|
+
mt: {
|
|
1814
|
+
style: margin
|
|
1815
|
+
},
|
|
1816
|
+
mr: {
|
|
1817
|
+
style: margin
|
|
1818
|
+
},
|
|
1819
|
+
mb: {
|
|
1820
|
+
style: margin
|
|
1821
|
+
},
|
|
1822
|
+
ml: {
|
|
1823
|
+
style: margin
|
|
1824
|
+
},
|
|
1825
|
+
mx: {
|
|
1826
|
+
style: margin
|
|
1827
|
+
},
|
|
1828
|
+
my: {
|
|
1829
|
+
style: margin
|
|
1830
|
+
},
|
|
1831
|
+
margin: {
|
|
1832
|
+
style: margin
|
|
1833
|
+
},
|
|
1834
|
+
marginTop: {
|
|
1835
|
+
style: margin
|
|
1836
|
+
},
|
|
1837
|
+
marginRight: {
|
|
1838
|
+
style: margin
|
|
1839
|
+
},
|
|
1840
|
+
marginBottom: {
|
|
1841
|
+
style: margin
|
|
1842
|
+
},
|
|
1843
|
+
marginLeft: {
|
|
1844
|
+
style: margin
|
|
1845
|
+
},
|
|
1846
|
+
marginX: {
|
|
1847
|
+
style: margin
|
|
1848
|
+
},
|
|
1849
|
+
marginY: {
|
|
1850
|
+
style: margin
|
|
1851
|
+
},
|
|
1852
|
+
marginInline: {
|
|
1853
|
+
style: margin
|
|
1854
|
+
},
|
|
1855
|
+
marginInlineStart: {
|
|
1856
|
+
style: margin
|
|
1857
|
+
},
|
|
1858
|
+
marginInlineEnd: {
|
|
1859
|
+
style: margin
|
|
1860
|
+
},
|
|
1861
|
+
marginBlock: {
|
|
1862
|
+
style: margin
|
|
1863
|
+
},
|
|
1864
|
+
marginBlockStart: {
|
|
1865
|
+
style: margin
|
|
1866
|
+
},
|
|
1867
|
+
marginBlockEnd: {
|
|
1868
|
+
style: margin
|
|
1869
|
+
},
|
|
1870
|
+
// display
|
|
1871
|
+
displayPrint: {
|
|
1872
|
+
cssProperty: false,
|
|
1873
|
+
transform: (value) => ({
|
|
1874
|
+
"@media print": {
|
|
1875
|
+
display: value
|
|
1876
|
+
}
|
|
1877
|
+
})
|
|
1878
|
+
},
|
|
1879
|
+
display: {},
|
|
1880
|
+
overflow: {},
|
|
1881
|
+
textOverflow: {},
|
|
1882
|
+
visibility: {},
|
|
1883
|
+
whiteSpace: {},
|
|
1884
|
+
// flexbox
|
|
1885
|
+
flexBasis: {},
|
|
1886
|
+
flexDirection: {},
|
|
1887
|
+
flexWrap: {},
|
|
1888
|
+
justifyContent: {},
|
|
1889
|
+
alignItems: {},
|
|
1890
|
+
alignContent: {},
|
|
1891
|
+
order: {},
|
|
1892
|
+
flex: {},
|
|
1893
|
+
flexGrow: {},
|
|
1894
|
+
flexShrink: {},
|
|
1895
|
+
alignSelf: {},
|
|
1896
|
+
justifyItems: {},
|
|
1897
|
+
justifySelf: {},
|
|
1898
|
+
// grid
|
|
1899
|
+
gap: {
|
|
1900
|
+
style: gap
|
|
1901
|
+
},
|
|
1902
|
+
rowGap: {
|
|
1903
|
+
style: rowGap
|
|
1904
|
+
},
|
|
1905
|
+
columnGap: {
|
|
1906
|
+
style: columnGap
|
|
1907
|
+
},
|
|
1908
|
+
gridColumn: {},
|
|
1909
|
+
gridRow: {},
|
|
1910
|
+
gridAutoFlow: {},
|
|
1911
|
+
gridAutoColumns: {},
|
|
1912
|
+
gridAutoRows: {},
|
|
1913
|
+
gridTemplateColumns: {},
|
|
1914
|
+
gridTemplateRows: {},
|
|
1915
|
+
gridTemplateAreas: {},
|
|
1916
|
+
gridArea: {},
|
|
1917
|
+
// positions
|
|
1918
|
+
position: {},
|
|
1919
|
+
zIndex: {
|
|
1920
|
+
themeKey: "zIndex"
|
|
1921
|
+
},
|
|
1922
|
+
top: {},
|
|
1923
|
+
right: {},
|
|
1924
|
+
bottom: {},
|
|
1925
|
+
left: {},
|
|
1926
|
+
// shadows
|
|
1927
|
+
boxShadow: {
|
|
1928
|
+
themeKey: "shadows"
|
|
1929
|
+
},
|
|
1930
|
+
// sizing
|
|
1931
|
+
width: {
|
|
1932
|
+
transform: sizingTransform
|
|
1933
|
+
},
|
|
1934
|
+
maxWidth: {
|
|
1935
|
+
style: maxWidth
|
|
1936
|
+
},
|
|
1937
|
+
minWidth: {
|
|
1938
|
+
transform: sizingTransform
|
|
1939
|
+
},
|
|
1940
|
+
height: {
|
|
1941
|
+
transform: sizingTransform
|
|
1942
|
+
},
|
|
1943
|
+
maxHeight: {
|
|
1944
|
+
transform: sizingTransform
|
|
1945
|
+
},
|
|
1946
|
+
minHeight: {
|
|
1947
|
+
transform: sizingTransform
|
|
1948
|
+
},
|
|
1949
|
+
boxSizing: {},
|
|
1950
|
+
// typography
|
|
1951
|
+
fontFamily: {
|
|
1952
|
+
themeKey: "typography"
|
|
1953
|
+
},
|
|
1954
|
+
fontSize: {
|
|
1955
|
+
themeKey: "typography"
|
|
1956
|
+
},
|
|
1957
|
+
fontStyle: {
|
|
1958
|
+
themeKey: "typography"
|
|
1959
|
+
},
|
|
1960
|
+
fontWeight: {
|
|
1961
|
+
themeKey: "typography"
|
|
1962
|
+
},
|
|
1963
|
+
letterSpacing: {},
|
|
1964
|
+
textTransform: {},
|
|
1965
|
+
lineHeight: {},
|
|
1966
|
+
textAlign: {},
|
|
1967
|
+
typography: {
|
|
1968
|
+
cssProperty: false,
|
|
1969
|
+
themeKey: "typography"
|
|
1970
|
+
}
|
|
1971
|
+
};
|
|
1972
|
+
var defaultSxConfig_default = defaultSxConfig;
|
|
1973
|
+
|
|
1974
|
+
// node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js
|
|
1975
|
+
function objectsHaveSameKeys(...objects) {
|
|
1976
|
+
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
1977
|
+
const union = new Set(allKeys);
|
|
1978
|
+
return objects.every((object) => union.size === Object.keys(object).length);
|
|
1979
|
+
}
|
|
1980
|
+
function callIfFn(maybeFn, arg) {
|
|
1981
|
+
return typeof maybeFn === "function" ? maybeFn(arg) : maybeFn;
|
|
1982
|
+
}
|
|
1983
|
+
function unstable_createStyleFunctionSx() {
|
|
1984
|
+
function getThemeValue(prop, val, theme, config) {
|
|
1985
|
+
const props = {
|
|
1986
|
+
[prop]: val,
|
|
1987
|
+
theme
|
|
1988
|
+
};
|
|
1989
|
+
const options = config[prop];
|
|
1990
|
+
if (!options) {
|
|
1991
|
+
return {
|
|
1992
|
+
[prop]: val
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
const {
|
|
1996
|
+
cssProperty = prop,
|
|
1997
|
+
themeKey,
|
|
1998
|
+
transform,
|
|
1999
|
+
style: style3
|
|
2000
|
+
} = options;
|
|
2001
|
+
if (val == null) {
|
|
2002
|
+
return null;
|
|
2003
|
+
}
|
|
2004
|
+
const themeMapping = getPath(theme, themeKey) || {};
|
|
2005
|
+
if (style3) {
|
|
2006
|
+
return style3(props);
|
|
2007
|
+
}
|
|
2008
|
+
const styleFromPropValue = (propValueFinal) => {
|
|
2009
|
+
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
2010
|
+
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
2011
|
+
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
2012
|
+
}
|
|
2013
|
+
if (cssProperty === false) {
|
|
2014
|
+
return value;
|
|
2015
|
+
}
|
|
2016
|
+
return {
|
|
2017
|
+
[cssProperty]: value
|
|
2018
|
+
};
|
|
2019
|
+
};
|
|
2020
|
+
return handleBreakpoints(props, val, styleFromPropValue);
|
|
2021
|
+
}
|
|
2022
|
+
function styleFunctionSx2(props) {
|
|
2023
|
+
var _theme$unstable_sxCon;
|
|
2024
|
+
const {
|
|
2025
|
+
sx,
|
|
2026
|
+
theme = {}
|
|
2027
|
+
} = props || {};
|
|
2028
|
+
if (!sx) {
|
|
2029
|
+
return null;
|
|
2030
|
+
}
|
|
2031
|
+
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig_default;
|
|
2032
|
+
function traverse(sxInput) {
|
|
2033
|
+
let sxObject = sxInput;
|
|
2034
|
+
if (typeof sxInput === "function") {
|
|
2035
|
+
sxObject = sxInput(theme);
|
|
2036
|
+
} else if (typeof sxInput !== "object") {
|
|
2037
|
+
return sxInput;
|
|
2038
|
+
}
|
|
2039
|
+
if (!sxObject) {
|
|
2040
|
+
return null;
|
|
2041
|
+
}
|
|
2042
|
+
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
2043
|
+
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
2044
|
+
let css2 = emptyBreakpoints;
|
|
2045
|
+
Object.keys(sxObject).forEach((styleKey) => {
|
|
2046
|
+
const value = callIfFn(sxObject[styleKey], theme);
|
|
2047
|
+
if (value !== null && value !== void 0) {
|
|
2048
|
+
if (typeof value === "object") {
|
|
2049
|
+
if (config[styleKey]) {
|
|
2050
|
+
css2 = merge_default(css2, getThemeValue(styleKey, value, theme, config));
|
|
2051
|
+
} else {
|
|
2052
|
+
const breakpointsValues = handleBreakpoints({
|
|
2053
|
+
theme
|
|
2054
|
+
}, value, (x) => ({
|
|
2055
|
+
[styleKey]: x
|
|
2056
|
+
}));
|
|
2057
|
+
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
2058
|
+
css2[styleKey] = styleFunctionSx2({
|
|
2059
|
+
sx: value,
|
|
2060
|
+
theme
|
|
2061
|
+
});
|
|
2062
|
+
} else {
|
|
2063
|
+
css2 = merge_default(css2, breakpointsValues);
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
} else {
|
|
2067
|
+
css2 = merge_default(css2, getThemeValue(styleKey, value, theme, config));
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
});
|
|
2071
|
+
return removeUnusedBreakpoints(breakpointsKeys, css2);
|
|
2072
|
+
}
|
|
2073
|
+
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
2074
|
+
}
|
|
2075
|
+
return styleFunctionSx2;
|
|
2076
|
+
}
|
|
2077
|
+
var styleFunctionSx = unstable_createStyleFunctionSx();
|
|
2078
|
+
styleFunctionSx.filterProps = ["sx"];
|
|
2079
|
+
var styleFunctionSx_default = styleFunctionSx;
|
|
2080
|
+
|
|
2081
|
+
// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
2082
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2083
|
+
if (source == null)
|
|
2084
|
+
return {};
|
|
2085
|
+
var target = {};
|
|
2086
|
+
var sourceKeys = Object.keys(source);
|
|
2087
|
+
var key, i;
|
|
2088
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2089
|
+
key = sourceKeys[i];
|
|
2090
|
+
if (excluded.indexOf(key) >= 0)
|
|
2091
|
+
continue;
|
|
2092
|
+
target[key] = source[key];
|
|
2093
|
+
}
|
|
2094
|
+
return target;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
// node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js
|
|
2098
|
+
var _excluded = ["sx"];
|
|
2099
|
+
var splitProps = (props) => {
|
|
2100
|
+
var _props$theme$unstable, _props$theme;
|
|
2101
|
+
const result = {
|
|
2102
|
+
systemProps: {},
|
|
2103
|
+
otherProps: {}
|
|
2104
|
+
};
|
|
2105
|
+
const config = (_props$theme$unstable = props == null ? void 0 : (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig_default;
|
|
2106
|
+
Object.keys(props).forEach((prop) => {
|
|
2107
|
+
if (config[prop]) {
|
|
2108
|
+
result.systemProps[prop] = props[prop];
|
|
2109
|
+
} else {
|
|
2110
|
+
result.otherProps[prop] = props[prop];
|
|
2111
|
+
}
|
|
2112
|
+
});
|
|
2113
|
+
return result;
|
|
2114
|
+
};
|
|
2115
|
+
function extendSxProp(props) {
|
|
2116
|
+
const {
|
|
2117
|
+
sx: inSx
|
|
2118
|
+
} = props, other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
2119
|
+
const {
|
|
2120
|
+
systemProps,
|
|
2121
|
+
otherProps
|
|
2122
|
+
} = splitProps(other);
|
|
2123
|
+
let finalSx;
|
|
2124
|
+
if (Array.isArray(inSx)) {
|
|
2125
|
+
finalSx = [systemProps, ...inSx];
|
|
2126
|
+
} else if (typeof inSx === "function") {
|
|
2127
|
+
finalSx = (...args) => {
|
|
2128
|
+
const result = inSx(...args);
|
|
2129
|
+
if (!isPlainObject(result)) {
|
|
2130
|
+
return systemProps;
|
|
2131
|
+
}
|
|
2132
|
+
return _extends({}, systemProps, result);
|
|
2133
|
+
};
|
|
2134
|
+
} else {
|
|
2135
|
+
finalSx = _extends({}, systemProps, inSx);
|
|
2136
|
+
}
|
|
2137
|
+
return _extends({}, otherProps, {
|
|
2138
|
+
sx: finalSx
|
|
2139
|
+
});
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
// node_modules/@mui/system/esm/Box/Box.js
|
|
2143
|
+
var import_prop_types2 = __toESM(require_prop_types());
|
|
2144
|
+
|
|
2145
|
+
// node_modules/@mui/system/esm/createBox.js
|
|
2146
|
+
import * as React4 from "react";
|
|
2147
|
+
|
|
2148
|
+
// node_modules/clsx/dist/clsx.m.js
|
|
2149
|
+
function r(e) {
|
|
2150
|
+
var t, f, n = "";
|
|
2151
|
+
if ("string" == typeof e || "number" == typeof e)
|
|
2152
|
+
n += e;
|
|
2153
|
+
else if ("object" == typeof e)
|
|
2154
|
+
if (Array.isArray(e))
|
|
2155
|
+
for (t = 0; t < e.length; t++)
|
|
2156
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
2157
|
+
else
|
|
2158
|
+
for (t in e)
|
|
2159
|
+
e[t] && (n && (n += " "), n += t);
|
|
2160
|
+
return n;
|
|
2161
|
+
}
|
|
2162
|
+
function clsx() {
|
|
2163
|
+
for (var e, t, f = 0, n = ""; f < arguments.length; )
|
|
2164
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
2165
|
+
return n;
|
|
2166
|
+
}
|
|
2167
|
+
var clsx_m_default = clsx;
|
|
2168
|
+
|
|
2169
|
+
// node_modules/@mui/system/esm/createTheme/createBreakpoints.js
|
|
2170
|
+
var _excluded2 = ["values", "unit", "step"];
|
|
2171
|
+
var sortBreakpointsValues = (values2) => {
|
|
2172
|
+
const breakpointsAsArray = Object.keys(values2).map((key) => ({
|
|
2173
|
+
key,
|
|
2174
|
+
val: values2[key]
|
|
2175
|
+
})) || [];
|
|
2176
|
+
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
2177
|
+
return breakpointsAsArray.reduce((acc, obj) => {
|
|
2178
|
+
return _extends({}, acc, {
|
|
2179
|
+
[obj.key]: obj.val
|
|
2180
|
+
});
|
|
2181
|
+
}, {});
|
|
2182
|
+
};
|
|
2183
|
+
function createBreakpoints(breakpoints) {
|
|
2184
|
+
const {
|
|
2185
|
+
// The breakpoint **start** at this value.
|
|
2186
|
+
// For instance with the first breakpoint xs: [xs, sm).
|
|
2187
|
+
values: values2 = {
|
|
2188
|
+
xs: 0,
|
|
2189
|
+
// phone
|
|
2190
|
+
sm: 600,
|
|
2191
|
+
// tablet
|
|
2192
|
+
md: 900,
|
|
2193
|
+
// small laptop
|
|
2194
|
+
lg: 1200,
|
|
2195
|
+
// desktop
|
|
2196
|
+
xl: 1536
|
|
2197
|
+
// large screen
|
|
2198
|
+
},
|
|
2199
|
+
unit = "px",
|
|
2200
|
+
step = 5
|
|
2201
|
+
} = breakpoints, other = _objectWithoutPropertiesLoose(breakpoints, _excluded2);
|
|
2202
|
+
const sortedValues = sortBreakpointsValues(values2);
|
|
2203
|
+
const keys = Object.keys(sortedValues);
|
|
2204
|
+
function up(key) {
|
|
2205
|
+
const value = typeof values2[key] === "number" ? values2[key] : key;
|
|
2206
|
+
return `@media (min-width:${value}${unit})`;
|
|
2207
|
+
}
|
|
2208
|
+
function down(key) {
|
|
2209
|
+
const value = typeof values2[key] === "number" ? values2[key] : key;
|
|
2210
|
+
return `@media (max-width:${value - step / 100}${unit})`;
|
|
2211
|
+
}
|
|
2212
|
+
function between(start, end) {
|
|
2213
|
+
const endIndex = keys.indexOf(end);
|
|
2214
|
+
return `@media (min-width:${typeof values2[start] === "number" ? values2[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values2[keys[endIndex]] === "number" ? values2[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
2215
|
+
}
|
|
2216
|
+
function only(key) {
|
|
2217
|
+
if (keys.indexOf(key) + 1 < keys.length) {
|
|
2218
|
+
return between(key, keys[keys.indexOf(key) + 1]);
|
|
2219
|
+
}
|
|
2220
|
+
return up(key);
|
|
2221
|
+
}
|
|
2222
|
+
function not(key) {
|
|
2223
|
+
const keyIndex = keys.indexOf(key);
|
|
2224
|
+
if (keyIndex === 0) {
|
|
2225
|
+
return up(keys[1]);
|
|
2226
|
+
}
|
|
2227
|
+
if (keyIndex === keys.length - 1) {
|
|
2228
|
+
return down(keys[keyIndex]);
|
|
2229
|
+
}
|
|
2230
|
+
return between(key, keys[keys.indexOf(key) + 1]).replace("@media", "@media not all and");
|
|
2231
|
+
}
|
|
2232
|
+
return _extends({
|
|
2233
|
+
keys,
|
|
2234
|
+
values: sortedValues,
|
|
2235
|
+
up,
|
|
2236
|
+
down,
|
|
2237
|
+
between,
|
|
2238
|
+
only,
|
|
2239
|
+
not,
|
|
2240
|
+
unit
|
|
2241
|
+
}, other);
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
// node_modules/@mui/system/esm/createTheme/shape.js
|
|
2245
|
+
var shape = {
|
|
2246
|
+
borderRadius: 4
|
|
2247
|
+
};
|
|
2248
|
+
var shape_default = shape;
|
|
2249
|
+
|
|
2250
|
+
// node_modules/@mui/system/esm/createTheme/createSpacing.js
|
|
2251
|
+
function createSpacing(spacingInput = 8) {
|
|
2252
|
+
if (spacingInput.mui) {
|
|
2253
|
+
return spacingInput;
|
|
2254
|
+
}
|
|
2255
|
+
const transform = createUnarySpacing({
|
|
2256
|
+
spacing: spacingInput
|
|
2257
|
+
});
|
|
2258
|
+
const spacing2 = (...argsInput) => {
|
|
2259
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2260
|
+
if (!(argsInput.length <= 4)) {
|
|
2261
|
+
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
2265
|
+
return args.map((argument) => {
|
|
2266
|
+
const output = transform(argument);
|
|
2267
|
+
return typeof output === "number" ? `${output}px` : output;
|
|
2268
|
+
}).join(" ");
|
|
2269
|
+
};
|
|
2270
|
+
spacing2.mui = true;
|
|
2271
|
+
return spacing2;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
// node_modules/@mui/system/esm/createTheme/createTheme.js
|
|
2275
|
+
var _excluded3 = ["breakpoints", "palette", "spacing", "shape"];
|
|
2276
|
+
function createTheme(options = {}, ...args) {
|
|
2277
|
+
const {
|
|
2278
|
+
breakpoints: breakpointsInput = {},
|
|
2279
|
+
palette: paletteInput = {},
|
|
2280
|
+
spacing: spacingInput,
|
|
2281
|
+
shape: shapeInput = {}
|
|
2282
|
+
} = options, other = _objectWithoutPropertiesLoose(options, _excluded3);
|
|
2283
|
+
const breakpoints = createBreakpoints(breakpointsInput);
|
|
2284
|
+
const spacing2 = createSpacing(spacingInput);
|
|
2285
|
+
let muiTheme = deepmerge({
|
|
2286
|
+
breakpoints,
|
|
2287
|
+
direction: "ltr",
|
|
2288
|
+
components: {},
|
|
2289
|
+
// Inject component definitions.
|
|
2290
|
+
palette: _extends({
|
|
2291
|
+
mode: "light"
|
|
2292
|
+
}, paletteInput),
|
|
2293
|
+
spacing: spacing2,
|
|
2294
|
+
shape: _extends({}, shape_default, shapeInput)
|
|
2295
|
+
}, other);
|
|
2296
|
+
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
2297
|
+
muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig_default, other == null ? void 0 : other.unstable_sxConfig);
|
|
2298
|
+
muiTheme.unstable_sx = function sx(props) {
|
|
2299
|
+
return styleFunctionSx_default({
|
|
2300
|
+
sx: props,
|
|
2301
|
+
theme: this
|
|
2302
|
+
});
|
|
2303
|
+
};
|
|
2304
|
+
return muiTheme;
|
|
2305
|
+
}
|
|
2306
|
+
var createTheme_default = createTheme;
|
|
2307
|
+
|
|
2308
|
+
// node_modules/@mui/private-theming/useTheme/ThemeContext.js
|
|
2309
|
+
import * as React2 from "react";
|
|
2310
|
+
var ThemeContext2 = /* @__PURE__ */ React2.createContext(null);
|
|
2311
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2312
|
+
ThemeContext2.displayName = "ThemeContext";
|
|
2313
|
+
}
|
|
2314
|
+
var ThemeContext_default = ThemeContext2;
|
|
2315
|
+
|
|
2316
|
+
// node_modules/@mui/private-theming/useTheme/useTheme.js
|
|
2317
|
+
import * as React3 from "react";
|
|
2318
|
+
function useTheme() {
|
|
2319
|
+
const theme = React3.useContext(ThemeContext_default);
|
|
2320
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2321
|
+
React3.useDebugValue(theme);
|
|
2322
|
+
}
|
|
2323
|
+
return theme;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
// node_modules/@mui/system/esm/useThemeWithoutDefault.js
|
|
2327
|
+
function isObjectEmpty(obj) {
|
|
2328
|
+
return Object.keys(obj).length === 0;
|
|
2329
|
+
}
|
|
2330
|
+
function useTheme2(defaultTheme = null) {
|
|
2331
|
+
const contextTheme = useTheme();
|
|
2332
|
+
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
2333
|
+
}
|
|
2334
|
+
var useThemeWithoutDefault_default = useTheme2;
|
|
2335
|
+
|
|
2336
|
+
// node_modules/@mui/system/esm/useTheme.js
|
|
2337
|
+
var systemDefaultTheme = createTheme_default();
|
|
2338
|
+
function useTheme3(defaultTheme = systemDefaultTheme) {
|
|
2339
|
+
return useThemeWithoutDefault_default(defaultTheme);
|
|
2340
|
+
}
|
|
2341
|
+
var useTheme_default = useTheme3;
|
|
2342
|
+
|
|
2343
|
+
// node_modules/@mui/system/esm/createBox.js
|
|
2344
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2345
|
+
var _excluded4 = ["className", "component"];
|
|
2346
|
+
function createBox(options = {}) {
|
|
2347
|
+
const {
|
|
2348
|
+
defaultTheme,
|
|
2349
|
+
defaultClassName = "MuiBox-root",
|
|
2350
|
+
generateClassName
|
|
2351
|
+
} = options;
|
|
2352
|
+
const BoxRoot = styled("div", {
|
|
2353
|
+
shouldForwardProp: (prop) => prop !== "theme" && prop !== "sx" && prop !== "as"
|
|
2354
|
+
})(styleFunctionSx_default);
|
|
2355
|
+
const Box6 = /* @__PURE__ */ React4.forwardRef(function Box7(inProps, ref) {
|
|
2356
|
+
const theme = useTheme_default(defaultTheme);
|
|
2357
|
+
const _extendSxProp = extendSxProp(inProps), {
|
|
2358
|
+
className,
|
|
2359
|
+
component = "div"
|
|
2360
|
+
} = _extendSxProp, other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded4);
|
|
2361
|
+
return /* @__PURE__ */ _jsx(BoxRoot, _extends({
|
|
2362
|
+
as: component,
|
|
2363
|
+
ref,
|
|
2364
|
+
className: clsx_m_default(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
|
|
2365
|
+
theme
|
|
2366
|
+
}, other));
|
|
2367
|
+
});
|
|
2368
|
+
return Box6;
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
// node_modules/@mui/system/esm/Box/Box.js
|
|
2372
|
+
var Box = createBox();
|
|
2373
|
+
process.env.NODE_ENV !== "production" ? Box.propTypes = {
|
|
2374
|
+
// ----------------------------- Warning --------------------------------
|
|
2375
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2376
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
2377
|
+
// ----------------------------------------------------------------------
|
|
2378
|
+
/**
|
|
2379
|
+
* @ignore
|
|
2380
|
+
*/
|
|
2381
|
+
children: import_prop_types2.default.node,
|
|
2382
|
+
/**
|
|
2383
|
+
* The component used for the root node.
|
|
2384
|
+
* Either a string to use a HTML element or a component.
|
|
2385
|
+
*/
|
|
2386
|
+
component: import_prop_types2.default.elementType,
|
|
2387
|
+
/**
|
|
2388
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2389
|
+
*/
|
|
2390
|
+
sx: import_prop_types2.default.oneOfType([import_prop_types2.default.arrayOf(import_prop_types2.default.oneOfType([import_prop_types2.default.func, import_prop_types2.default.object, import_prop_types2.default.bool])), import_prop_types2.default.func, import_prop_types2.default.object])
|
|
2391
|
+
} : void 0;
|
|
2392
|
+
var Box_default = Box;
|
|
2393
|
+
|
|
2394
|
+
// src/components/Grid/Filters.tsx
|
|
2395
|
+
import { MdFilterList, MdSearch } from "react-icons/md";
|
|
2396
|
+
import { Chip, IconButton, Tooltip } from "@mui/material";
|
|
2397
|
+
var FiltersBar = ({
|
|
2398
|
+
customButtons,
|
|
2399
|
+
selectedFilters,
|
|
2400
|
+
handleCloseFilter,
|
|
2401
|
+
noFilterButtons,
|
|
2402
|
+
searchAnchorEl,
|
|
2403
|
+
setOpenSearch,
|
|
2404
|
+
setAnchorEl,
|
|
2405
|
+
noFilters
|
|
2406
|
+
}) => {
|
|
2407
|
+
return /* @__PURE__ */ React5.createElement(
|
|
2408
|
+
Box_default,
|
|
2409
|
+
{
|
|
2410
|
+
sx: {
|
|
2411
|
+
display: "flex",
|
|
2412
|
+
justifyContent: "space-between",
|
|
2413
|
+
alignItems: "center",
|
|
2414
|
+
width: "100%"
|
|
2415
|
+
}
|
|
2416
|
+
},
|
|
2417
|
+
!noFilters && /* @__PURE__ */ React5.createElement(Box_default, { sx: { pl: 1 } }, selectedFilters.map((item, index) => {
|
|
2418
|
+
return /* @__PURE__ */ React5.createElement(
|
|
2419
|
+
Chip,
|
|
2420
|
+
{
|
|
2421
|
+
key: index,
|
|
2422
|
+
label: item.value,
|
|
2423
|
+
onDelete: () => handleCloseFilter(item)
|
|
2424
|
+
}
|
|
2425
|
+
);
|
|
2426
|
+
})),
|
|
2427
|
+
/* @__PURE__ */ React5.createElement(Box_default, { ref: searchAnchorEl, sx: { minHeight: 30, width: "100%" } }, customButtons, !noFilterButtons && /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(Tooltip, { title: "Buscar" }, /* @__PURE__ */ React5.createElement(IconButton, { onClick: () => setOpenSearch(true) }, /* @__PURE__ */ React5.createElement(MdSearch, { size: 8 * 3 }))), /* @__PURE__ */ React5.createElement(Tooltip, { title: "Filtrar" }, /* @__PURE__ */ React5.createElement(
|
|
2428
|
+
IconButton,
|
|
2429
|
+
{
|
|
2430
|
+
sx: { position: "relative" },
|
|
2431
|
+
onClick: ({ currentTarget }) => setAnchorEl(currentTarget)
|
|
2432
|
+
},
|
|
2433
|
+
/* @__PURE__ */ React5.createElement(MdFilterList, { size: 8 * 3 })
|
|
2434
|
+
))))
|
|
2435
|
+
);
|
|
2436
|
+
};
|
|
2437
|
+
|
|
2438
|
+
// src/components/Grid/Grid.tsx
|
|
2439
|
+
import { MdClose } from "react-icons/md";
|
|
2440
|
+
|
|
2441
|
+
// src/components/Grid/utils.ts
|
|
2442
|
+
function filterData(filters, defaultData) {
|
|
2443
|
+
if (filters.length === 0)
|
|
2444
|
+
return defaultData.current;
|
|
2445
|
+
const filteredArray = defaultData.current.slice(0).filter((item) => {
|
|
2446
|
+
let satisfiedFilter = 0;
|
|
2447
|
+
filters.forEach((sub) => {
|
|
2448
|
+
let currentValue = getPropertyValue(item, sub.column);
|
|
2449
|
+
if (sub.transformer)
|
|
2450
|
+
currentValue = sub.transformer(currentValue);
|
|
2451
|
+
if (String(currentValue) === String(sub.value))
|
|
2452
|
+
satisfiedFilter += 1;
|
|
2453
|
+
});
|
|
2454
|
+
if (satisfiedFilter === filters.length)
|
|
2455
|
+
return true;
|
|
2456
|
+
return false;
|
|
2457
|
+
});
|
|
2458
|
+
return filteredArray;
|
|
2459
|
+
}
|
|
2460
|
+
function getPropertyValue(obj, property) {
|
|
2461
|
+
return String(property.split(".").reduce((o, k) => o && o[k], obj));
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
// src/components/Grid/AutoCreatedRows.tsx
|
|
2465
|
+
import React8 from "react";
|
|
2466
|
+
|
|
2467
|
+
// src/components/Grid/Td.tsx
|
|
2468
|
+
import React6, { memo } from "react";
|
|
2469
|
+
import { TableCell as TableCell2 } from "@mui/material";
|
|
2470
|
+
var CustomTableCell = (_a) => {
|
|
2471
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
2472
|
+
return /* @__PURE__ */ React6.createElement(TableCell2, __spreadValues({}, props), children);
|
|
2473
|
+
};
|
|
2474
|
+
var Td = memo(CustomTableCell);
|
|
2475
|
+
|
|
2476
|
+
// src/components/Grid/Tr.tsx
|
|
2477
|
+
import React7, { memo as memo2 } from "react";
|
|
2478
|
+
import { TableRow as TableRow2 } from "@mui/material";
|
|
2479
|
+
var CustomTableRow = (props) => {
|
|
2480
|
+
const _a = props, { children, sx, striped = true, bordered = void 0 } = _a, rest = __objRest(_a, ["children", "sx", "striped", "bordered"]);
|
|
2481
|
+
return /* @__PURE__ */ React7.createElement(
|
|
2482
|
+
TableRow2,
|
|
2483
|
+
__spreadValues({
|
|
2484
|
+
sx: __spreadValues({
|
|
2485
|
+
"&:nth-of-type(even)": { bgcolor: striped ? "action.selected" : "" }
|
|
2486
|
+
}, sx)
|
|
2487
|
+
}, rest),
|
|
2488
|
+
React7.Children.map(
|
|
2489
|
+
children,
|
|
2490
|
+
(child) => React7.cloneElement(child, {
|
|
2491
|
+
bordered
|
|
2492
|
+
})
|
|
2493
|
+
)
|
|
2494
|
+
);
|
|
2495
|
+
};
|
|
2496
|
+
var Tr = memo2(CustomTableRow);
|
|
2497
|
+
|
|
2498
|
+
// src/components/Grid/AutoCreatedRows.tsx
|
|
2499
|
+
var AutoCreatedRows = ({
|
|
2500
|
+
tableData,
|
|
2501
|
+
columns,
|
|
2502
|
+
primaryKey
|
|
2503
|
+
}) => {
|
|
2504
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, tableData.map((row) => /* @__PURE__ */ React8.createElement(Tr, { key: row[primaryKey] }, columns.map((column) => {
|
|
2505
|
+
const cellValue = column.transformer ? column.transformer(row[column.name]) : row[column.name];
|
|
2506
|
+
return /* @__PURE__ */ React8.createElement(Td, { key: column.name }, cellValue);
|
|
2507
|
+
}))));
|
|
2508
|
+
};
|
|
2509
|
+
|
|
2510
|
+
// src/components/Grid/Grid.tsx
|
|
2511
|
+
var Grid = (props) => {
|
|
2512
|
+
const {
|
|
2513
|
+
columnTitles,
|
|
2514
|
+
isLoading,
|
|
2515
|
+
footer,
|
|
2516
|
+
noFilterButtons = false,
|
|
2517
|
+
selectedFilters,
|
|
2518
|
+
customButtons,
|
|
2519
|
+
setSelectedFilters,
|
|
2520
|
+
defaultData,
|
|
2521
|
+
setTableData,
|
|
2522
|
+
updateFilters,
|
|
2523
|
+
tableData,
|
|
2524
|
+
rowOptions = [60, 100, 150],
|
|
2525
|
+
noPagination,
|
|
2526
|
+
primaryKey,
|
|
2527
|
+
noFilters
|
|
2528
|
+
} = props;
|
|
2529
|
+
const [order, setOrder] = useState(void 0);
|
|
2530
|
+
const [orderBy, setOrderBy] = useState("");
|
|
2531
|
+
const [page, setPage] = useState(0);
|
|
2532
|
+
const [rowsPerPage, setRowsPerPage] = useState(rowOptions[0]);
|
|
2533
|
+
const [selectedTitle, setSelectedTitle] = useState(
|
|
2534
|
+
void 0
|
|
2535
|
+
);
|
|
2536
|
+
const [selectedFilterValue, setSelectedFilterValue] = useState(void 0);
|
|
2537
|
+
const [valuesToFilter, setValuesToFilter] = useState([]);
|
|
2538
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
2539
|
+
const [searchText, setSearchText] = useState("");
|
|
2540
|
+
const [openSearch, setOpenSearch] = useState(false);
|
|
2541
|
+
const searchAnchorEl = useRef(null);
|
|
2542
|
+
const countRows = useMemo(() => {
|
|
2543
|
+
if (searchText.length > 0) {
|
|
2544
|
+
const array = handleFilterBySearch(searchText);
|
|
2545
|
+
return array.length;
|
|
2546
|
+
} else {
|
|
2547
|
+
return defaultData.length;
|
|
2548
|
+
}
|
|
2549
|
+
}, [searchText, tableData]);
|
|
2550
|
+
const handleChangeRowsPerPage = ({
|
|
2551
|
+
target
|
|
2552
|
+
}) => {
|
|
2553
|
+
setRowsPerPage(parseInt(target.value));
|
|
2554
|
+
const maxPage = Math.floor(countRows / rowsPerPage);
|
|
2555
|
+
if (page > maxPage)
|
|
2556
|
+
setPage(maxPage);
|
|
2557
|
+
};
|
|
2558
|
+
function handleSort(data) {
|
|
2559
|
+
const sortable = data.slice(0);
|
|
2560
|
+
if (order === void 0)
|
|
2561
|
+
return sortable;
|
|
2562
|
+
sortable.sort((a, b) => {
|
|
2563
|
+
const x = a[orderBy];
|
|
2564
|
+
const y = b[orderBy];
|
|
2565
|
+
return x < y ? -1 : x > y ? 1 : 0;
|
|
2566
|
+
});
|
|
2567
|
+
return order === "asc" ? sortable : sortable.reverse();
|
|
2568
|
+
}
|
|
2569
|
+
function handleAddFilter() {
|
|
2570
|
+
const [column] = columnTitles.filter((item) => item.label === selectedTitle);
|
|
2571
|
+
const newFilter = {
|
|
2572
|
+
column: column.name,
|
|
2573
|
+
value: selectedFilterValue || "",
|
|
2574
|
+
transformer: column.transformer
|
|
2575
|
+
};
|
|
2576
|
+
const filterAlreadyExists = selectedFilters.some(
|
|
2577
|
+
(filter) => filter.column === column.name && filter.value === selectedFilterValue
|
|
2578
|
+
);
|
|
2579
|
+
if (filterAlreadyExists)
|
|
2580
|
+
return;
|
|
2581
|
+
setSelectedFilters([...selectedFilters, newFilter]);
|
|
2582
|
+
}
|
|
2583
|
+
function handleCloseFilter(item) {
|
|
2584
|
+
const filterToDelete = selectedFilters.find(
|
|
2585
|
+
(filter) => filter.column === item.column && filter.value === item.value
|
|
2586
|
+
);
|
|
2587
|
+
if (!filterToDelete)
|
|
2588
|
+
return;
|
|
2589
|
+
const filteredSelectedFilters = selectedFilters.filter(
|
|
2590
|
+
(_, index) => selectedFilters.indexOf(filterToDelete) !== index
|
|
2591
|
+
);
|
|
2592
|
+
setSelectedFilters([...filteredSelectedFilters]);
|
|
2593
|
+
}
|
|
2594
|
+
function handleFilterBySearch(text) {
|
|
2595
|
+
const newArray = defaultData.filter((item) => {
|
|
2596
|
+
for (const [, value] of Object.entries(item)) {
|
|
2597
|
+
if (`${value}`.toLocaleLowerCase().includes(text.toLocaleLowerCase()))
|
|
2598
|
+
return true;
|
|
2599
|
+
}
|
|
2600
|
+
return false;
|
|
2601
|
+
});
|
|
2602
|
+
return newArray;
|
|
2603
|
+
}
|
|
2604
|
+
useEffect(() => {
|
|
2605
|
+
const maxPage = Math.floor(countRows / rowsPerPage);
|
|
2606
|
+
if (page > maxPage)
|
|
2607
|
+
setPage(maxPage - 1);
|
|
2608
|
+
}, [countRows]);
|
|
2609
|
+
useEffect(() => {
|
|
2610
|
+
if (order) {
|
|
2611
|
+
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2612
|
+
const sortedArray = handleSort(newArray);
|
|
2613
|
+
const data = sortedArray.slice(
|
|
2614
|
+
page * rowsPerPage,
|
|
2615
|
+
page * rowsPerPage + rowsPerPage
|
|
2616
|
+
);
|
|
2617
|
+
setTableData(data);
|
|
2618
|
+
} else {
|
|
2619
|
+
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2620
|
+
const data = newArray.slice(
|
|
2621
|
+
page * rowsPerPage,
|
|
2622
|
+
page * rowsPerPage + rowsPerPage
|
|
2623
|
+
);
|
|
2624
|
+
setTableData(data);
|
|
2625
|
+
}
|
|
2626
|
+
}, [defaultData]);
|
|
2627
|
+
useEffect(() => {
|
|
2628
|
+
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2629
|
+
const sortedArray = handleSort(newArray);
|
|
2630
|
+
const paginatedArray = sortedArray.slice(
|
|
2631
|
+
page * rowsPerPage,
|
|
2632
|
+
page * rowsPerPage + rowsPerPage
|
|
2633
|
+
);
|
|
2634
|
+
setTableData(paginatedArray);
|
|
2635
|
+
}, [order, orderBy]);
|
|
2636
|
+
useEffect(() => {
|
|
2637
|
+
if (order) {
|
|
2638
|
+
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2639
|
+
const sortedArray = handleSort(newArray);
|
|
2640
|
+
const dados = sortedArray.slice(
|
|
2641
|
+
page * rowsPerPage,
|
|
2642
|
+
page * rowsPerPage + rowsPerPage
|
|
2643
|
+
);
|
|
2644
|
+
setTableData(dados);
|
|
2645
|
+
} else {
|
|
2646
|
+
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2647
|
+
const dados = newArray.slice(
|
|
2648
|
+
page * rowsPerPage,
|
|
2649
|
+
page * rowsPerPage + rowsPerPage
|
|
2650
|
+
);
|
|
2651
|
+
setTableData(dados);
|
|
2652
|
+
}
|
|
2653
|
+
}, [page, rowsPerPage]);
|
|
2654
|
+
useEffect(() => {
|
|
2655
|
+
setValuesToFilter([]);
|
|
2656
|
+
setSelectedFilterValue(void 0);
|
|
2657
|
+
if (selectedTitle) {
|
|
2658
|
+
const values2 = [];
|
|
2659
|
+
const [prop] = columnTitles.filter((item) => item.label === selectedTitle);
|
|
2660
|
+
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2661
|
+
newArray.forEach((item) => {
|
|
2662
|
+
const value = prop.transformer ? prop.transformer(getPropertyValue(item, prop.name)) : String(getPropertyValue(item, prop.name));
|
|
2663
|
+
if (!values2.includes(value))
|
|
2664
|
+
values2.push(value);
|
|
2665
|
+
});
|
|
2666
|
+
setValuesToFilter(values2);
|
|
2667
|
+
}
|
|
2668
|
+
}, [selectedTitle]);
|
|
2669
|
+
useEffect(() => {
|
|
2670
|
+
if (order) {
|
|
2671
|
+
const newArray = handleFilterBySearch(searchText);
|
|
2672
|
+
const sortedArray = handleSort(newArray);
|
|
2673
|
+
const dados = sortedArray.slice(
|
|
2674
|
+
page * rowsPerPage,
|
|
2675
|
+
page * rowsPerPage + rowsPerPage
|
|
2676
|
+
);
|
|
2677
|
+
setTableData(dados);
|
|
2678
|
+
} else {
|
|
2679
|
+
const newArray = handleFilterBySearch(searchText);
|
|
2680
|
+
const dados = newArray.slice(
|
|
2681
|
+
page * rowsPerPage,
|
|
2682
|
+
page * rowsPerPage + rowsPerPage
|
|
2683
|
+
);
|
|
2684
|
+
setTableData(dados);
|
|
2685
|
+
}
|
|
2686
|
+
}, [searchText]);
|
|
2687
|
+
useEffect(() => {
|
|
2688
|
+
updateFilters(selectedFilters);
|
|
2689
|
+
}, [selectedFilters]);
|
|
2690
|
+
return /* @__PURE__ */ React9.createElement(Paper, null, isLoading && /* @__PURE__ */ React9.createElement(LinearProgress, null), /* @__PURE__ */ React9.createElement(
|
|
2691
|
+
FiltersBar,
|
|
2692
|
+
{
|
|
2693
|
+
setAnchorEl,
|
|
2694
|
+
setOpenSearch,
|
|
2695
|
+
searchAnchorEl,
|
|
2696
|
+
noFilters,
|
|
2697
|
+
noFilterButtons,
|
|
2698
|
+
selectedFilters,
|
|
2699
|
+
customButtons,
|
|
2700
|
+
handleCloseFilter
|
|
2701
|
+
}
|
|
2702
|
+
), /* @__PURE__ */ React9.createElement(TableContainer, null, /* @__PURE__ */ React9.createElement(Table, { size: "small" }, /* @__PURE__ */ React9.createElement(
|
|
2703
|
+
GridHeader,
|
|
2704
|
+
{
|
|
2705
|
+
titles: columnTitles,
|
|
2706
|
+
order,
|
|
2707
|
+
orderBy,
|
|
2708
|
+
setOrder,
|
|
2709
|
+
setOrderBy
|
|
2710
|
+
}
|
|
2711
|
+
), /* @__PURE__ */ React9.createElement(TableBody, null, props.children ? props.children : primaryKey ? /* @__PURE__ */ React9.createElement(
|
|
2712
|
+
AutoCreatedRows,
|
|
2713
|
+
{
|
|
2714
|
+
tableData,
|
|
2715
|
+
columns: columnTitles,
|
|
2716
|
+
primaryKey
|
|
2717
|
+
}
|
|
2718
|
+
) : null, footer))), !noPagination && /* @__PURE__ */ React9.createElement(
|
|
2719
|
+
TablePagination,
|
|
2720
|
+
{
|
|
2721
|
+
page,
|
|
2722
|
+
component: "div",
|
|
2723
|
+
rowsPerPage,
|
|
2724
|
+
labelRowsPerPage: "Linhas por p\xE1gina",
|
|
2725
|
+
rowsPerPageOptions: rowOptions,
|
|
2726
|
+
count: countRows,
|
|
2727
|
+
labelDisplayedRows: ({ page: page2 }) => `${page2 + 1} de ${Math.floor(countRows / rowsPerPage) + 1}`,
|
|
2728
|
+
onPageChange: (_, newPage) => {
|
|
2729
|
+
setPage(newPage);
|
|
2730
|
+
},
|
|
2731
|
+
onRowsPerPageChange: handleChangeRowsPerPage
|
|
2732
|
+
}
|
|
2733
|
+
), /* @__PURE__ */ React9.createElement(
|
|
2734
|
+
Popover,
|
|
2735
|
+
{
|
|
2736
|
+
anchorEl,
|
|
2737
|
+
open: !!anchorEl,
|
|
2738
|
+
onClose: () => setAnchorEl(null),
|
|
2739
|
+
anchorOrigin: {
|
|
2740
|
+
vertical: "top",
|
|
2741
|
+
horizontal: "right"
|
|
2742
|
+
},
|
|
2743
|
+
transformOrigin: {
|
|
2744
|
+
vertical: "top",
|
|
2745
|
+
horizontal: "right"
|
|
2746
|
+
}
|
|
2747
|
+
},
|
|
2748
|
+
/* @__PURE__ */ React9.createElement(Box2, { sx: { minWidth: 300, padding: 2 } }, /* @__PURE__ */ React9.createElement(Typography, { fontWeight: "bold", variant: "body2" }, "Filtrar por:"), /* @__PURE__ */ React9.createElement(
|
|
2749
|
+
Autocomplete,
|
|
2750
|
+
{
|
|
2751
|
+
value: selectedTitle || "",
|
|
2752
|
+
onChange: ({ target }) => {
|
|
2753
|
+
!target.innerHTML.includes("path") ? setSelectedTitle(target.innerHTML) : setSelectedTitle(void 0);
|
|
2754
|
+
},
|
|
2755
|
+
options: columnTitles.map((title) => title.label),
|
|
2756
|
+
renderInput: (params) => /* @__PURE__ */ React9.createElement(
|
|
2757
|
+
TextField,
|
|
2758
|
+
__spreadProps(__spreadValues({
|
|
2759
|
+
variant: "standard",
|
|
2760
|
+
margin: "dense"
|
|
2761
|
+
}, params), {
|
|
2762
|
+
label: "Coluna"
|
|
2763
|
+
})
|
|
2764
|
+
)
|
|
2765
|
+
}
|
|
2766
|
+
), /* @__PURE__ */ React9.createElement(
|
|
2767
|
+
Autocomplete,
|
|
2768
|
+
{
|
|
2769
|
+
value: selectedFilterValue || "",
|
|
2770
|
+
onChange: ({ target }) => {
|
|
2771
|
+
!target.innerHTML.includes("path") ? setSelectedFilterValue(target.innerHTML) : setSelectedFilterValue(void 0);
|
|
2772
|
+
},
|
|
2773
|
+
disabled: valuesToFilter.length < 1,
|
|
2774
|
+
options: valuesToFilter.map((title) => title),
|
|
2775
|
+
renderInput: (params) => /* @__PURE__ */ React9.createElement(
|
|
2776
|
+
TextField,
|
|
2777
|
+
__spreadProps(__spreadValues({
|
|
2778
|
+
variant: "standard",
|
|
2779
|
+
margin: "dense"
|
|
2780
|
+
}, params), {
|
|
2781
|
+
label: "Valor"
|
|
2782
|
+
})
|
|
2783
|
+
)
|
|
2784
|
+
}
|
|
2785
|
+
), /* @__PURE__ */ React9.createElement(Box2, { sx: { py: 1 } }), /* @__PURE__ */ React9.createElement(
|
|
2786
|
+
Button,
|
|
2787
|
+
{
|
|
2788
|
+
disabled: !selectedFilterValue,
|
|
2789
|
+
onClick: handleAddFilter,
|
|
2790
|
+
fullWidth: true
|
|
2791
|
+
},
|
|
2792
|
+
"Adicionar filtro"
|
|
2793
|
+
))
|
|
2794
|
+
), /* @__PURE__ */ React9.createElement(
|
|
2795
|
+
Popover,
|
|
2796
|
+
{
|
|
2797
|
+
anchorEl: searchAnchorEl.current,
|
|
2798
|
+
open: openSearch,
|
|
2799
|
+
onClose: () => setOpenSearch(false),
|
|
2800
|
+
anchorOrigin: {
|
|
2801
|
+
vertical: "top",
|
|
2802
|
+
horizontal: "left"
|
|
2803
|
+
},
|
|
2804
|
+
transformOrigin: {
|
|
2805
|
+
vertical: "top",
|
|
2806
|
+
horizontal: "left"
|
|
2807
|
+
}
|
|
2808
|
+
},
|
|
2809
|
+
/* @__PURE__ */ React9.createElement(
|
|
2810
|
+
Box2,
|
|
2811
|
+
{
|
|
2812
|
+
sx: {
|
|
2813
|
+
minWidth: 300,
|
|
2814
|
+
px: 2,
|
|
2815
|
+
pb: 1,
|
|
2816
|
+
display: "grid",
|
|
2817
|
+
gridTemplateColumns: "1fr 30px",
|
|
2818
|
+
alignItems: "flex-end"
|
|
2819
|
+
}
|
|
2820
|
+
},
|
|
2821
|
+
/* @__PURE__ */ React9.createElement(
|
|
2822
|
+
TextField,
|
|
2823
|
+
{
|
|
2824
|
+
variant: "standard",
|
|
2825
|
+
margin: "dense",
|
|
2826
|
+
label: "Buscar",
|
|
2827
|
+
value: searchText,
|
|
2828
|
+
onChange: ({ currentTarget }) => setSearchText(currentTarget.value)
|
|
2829
|
+
}
|
|
2830
|
+
),
|
|
2831
|
+
/* @__PURE__ */ React9.createElement(Box2, null, /* @__PURE__ */ React9.createElement(
|
|
2832
|
+
IconButton2,
|
|
2833
|
+
{
|
|
2834
|
+
onClick: () => {
|
|
2835
|
+
setSearchText("");
|
|
2836
|
+
setOpenSearch(false);
|
|
2837
|
+
}
|
|
2838
|
+
},
|
|
2839
|
+
/* @__PURE__ */ React9.createElement(MdClose, { size: 8 * 3 })
|
|
2840
|
+
))
|
|
2841
|
+
)
|
|
2842
|
+
));
|
|
2843
|
+
};
|
|
2844
|
+
var Grid_default = Grid;
|
|
2845
|
+
|
|
2846
|
+
// src/components/Grid/EditableTableCell/index.tsx
|
|
2847
|
+
import { TableCell as TableCell3 } from "@mui/material";
|
|
2848
|
+
import React12, { useState as useState2 } from "react";
|
|
2849
|
+
|
|
2850
|
+
// src/components/Grid/EditableTableCell/DefaultInput.tsx
|
|
2851
|
+
import React10 from "react";
|
|
2852
|
+
import { TextField as TextField2 } from "@mui/material";
|
|
2853
|
+
import moment from "moment";
|
|
2854
|
+
var DefaultInput = (allProps) => {
|
|
2855
|
+
var _a;
|
|
2856
|
+
const {
|
|
2857
|
+
TextFieldProps: TextFieldProps3,
|
|
2858
|
+
onSave,
|
|
2859
|
+
name,
|
|
2860
|
+
onUpdateValue,
|
|
2861
|
+
rowData,
|
|
2862
|
+
type = "text",
|
|
2863
|
+
fullWidth = true,
|
|
2864
|
+
isEditing,
|
|
2865
|
+
formatInputDefautvalue,
|
|
2866
|
+
setIsEditing,
|
|
2867
|
+
handleCancelEditing
|
|
2868
|
+
} = allProps;
|
|
2869
|
+
const formatDefaultValue = (value) => {
|
|
2870
|
+
if (formatInputDefautvalue)
|
|
2871
|
+
return formatInputDefautvalue(value);
|
|
2872
|
+
switch (type) {
|
|
2873
|
+
case "date":
|
|
2874
|
+
return moment(value).format("YYYY-MM-DD");
|
|
2875
|
+
case "datetime-local":
|
|
2876
|
+
return moment(value).format("YYYY-MM-DDTHH:mm:ss");
|
|
2877
|
+
default:
|
|
2878
|
+
return String(value);
|
|
2879
|
+
}
|
|
2880
|
+
};
|
|
2881
|
+
const handleSave = (event) => {
|
|
2882
|
+
var _a2, _b, _c;
|
|
2883
|
+
onUpdateValue(String((_a2 = event.target) == null ? void 0 : _a2.value));
|
|
2884
|
+
setIsEditing(false);
|
|
2885
|
+
const response = {
|
|
2886
|
+
name,
|
|
2887
|
+
event,
|
|
2888
|
+
value: (_b = event.target) == null ? void 0 : _b.value,
|
|
2889
|
+
data: __spreadProps(__spreadValues({}, rowData), { [name]: (_c = event.target) == null ? void 0 : _c.value })
|
|
2890
|
+
};
|
|
2891
|
+
onSave(response);
|
|
2892
|
+
};
|
|
2893
|
+
const onKeyDown = (ev) => {
|
|
2894
|
+
if (ev.code === "Enter")
|
|
2895
|
+
handleSave(ev);
|
|
2896
|
+
if (ev.code === "Escape")
|
|
2897
|
+
handleCancelEditing();
|
|
2898
|
+
};
|
|
2899
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2900
|
+
TextField2,
|
|
2901
|
+
__spreadValues({
|
|
2902
|
+
name,
|
|
2903
|
+
focused: isEditing,
|
|
2904
|
+
onBlur: (ev) => handleSave(ev),
|
|
2905
|
+
autoFocus: true,
|
|
2906
|
+
type,
|
|
2907
|
+
size: "small",
|
|
2908
|
+
defaultValue: formatDefaultValue(rowData == null ? void 0 : rowData[name]),
|
|
2909
|
+
sx: __spreadValues({
|
|
2910
|
+
width: fullWidth ? "100%" : "intial"
|
|
2911
|
+
}, TextFieldProps3 == null ? void 0 : TextFieldProps3.sx),
|
|
2912
|
+
inputProps: {
|
|
2913
|
+
style: {
|
|
2914
|
+
paddingBottom: 6,
|
|
2915
|
+
paddingTop: 6
|
|
2916
|
+
},
|
|
2917
|
+
onKeyDown
|
|
2918
|
+
},
|
|
2919
|
+
InputProps: __spreadProps(__spreadValues({}, TextFieldProps3 == null ? void 0 : TextFieldProps3.InputProps), {
|
|
2920
|
+
sx: __spreadValues({
|
|
2921
|
+
fontSize: 14,
|
|
2922
|
+
pl: 0.2
|
|
2923
|
+
}, (_a = TextFieldProps3 == null ? void 0 : TextFieldProps3.InputProps) == null ? void 0 : _a.sx)
|
|
2924
|
+
})
|
|
2925
|
+
}, TextFieldProps3)
|
|
2926
|
+
);
|
|
2927
|
+
};
|
|
2928
|
+
|
|
2929
|
+
// src/components/Grid/EditableTableCell/InputMask.tsx
|
|
2930
|
+
import { useIMask } from "react-imask";
|
|
2931
|
+
import React11, { useEffect as useEffect2 } from "react";
|
|
2932
|
+
import { TextField as TextField3 } from "@mui/material";
|
|
2933
|
+
var InputMask = (allProps) => {
|
|
2934
|
+
var _a;
|
|
2935
|
+
const {
|
|
2936
|
+
TextFieldProps: TextFieldProps3,
|
|
2937
|
+
onSave,
|
|
2938
|
+
name,
|
|
2939
|
+
rowData,
|
|
2940
|
+
mask,
|
|
2941
|
+
fullWidth = true,
|
|
2942
|
+
isEditing,
|
|
2943
|
+
handleCancelEditing,
|
|
2944
|
+
setIsEditing
|
|
2945
|
+
} = allProps;
|
|
2946
|
+
const { ref, unmaskedValue, setValue } = useIMask(
|
|
2947
|
+
mask
|
|
2948
|
+
);
|
|
2949
|
+
const handleSave = (event) => {
|
|
2950
|
+
var _a2, _b, _c;
|
|
2951
|
+
setIsEditing(false);
|
|
2952
|
+
setValue(String((_a2 = event.target) == null ? void 0 : _a2.value));
|
|
2953
|
+
const response = {
|
|
2954
|
+
name,
|
|
2955
|
+
event,
|
|
2956
|
+
value: (_b = event.target) == null ? void 0 : _b.value,
|
|
2957
|
+
unmaskedValue,
|
|
2958
|
+
data: __spreadProps(__spreadValues({}, rowData), { [name]: (_c = event.target) == null ? void 0 : _c.value })
|
|
2959
|
+
};
|
|
2960
|
+
onSave(response);
|
|
2961
|
+
};
|
|
2962
|
+
const onKeyDown = (ev) => {
|
|
2963
|
+
if (ev.code === "Enter")
|
|
2964
|
+
handleSave(ev);
|
|
2965
|
+
if (ev.code === "Escape")
|
|
2966
|
+
handleCancelEditing();
|
|
2967
|
+
};
|
|
2968
|
+
useEffect2(() => {
|
|
2969
|
+
if (rowData == null ? void 0 : rowData[name])
|
|
2970
|
+
setValue(String(rowData == null ? void 0 : rowData[name]));
|
|
2971
|
+
}, [rowData == null ? void 0 : rowData[name]]);
|
|
2972
|
+
return /* @__PURE__ */ React11.createElement(
|
|
2973
|
+
TextField3,
|
|
2974
|
+
__spreadValues({
|
|
2975
|
+
inputRef: ref,
|
|
2976
|
+
name,
|
|
2977
|
+
focused: isEditing,
|
|
2978
|
+
onBlur: (ev) => handleSave(ev),
|
|
2979
|
+
autoFocus: true,
|
|
2980
|
+
size: "small",
|
|
2981
|
+
sx: __spreadValues({
|
|
2982
|
+
width: fullWidth ? "100%" : "intial"
|
|
2983
|
+
}, TextFieldProps3 == null ? void 0 : TextFieldProps3.sx),
|
|
2984
|
+
inputProps: {
|
|
2985
|
+
style: {
|
|
2986
|
+
paddingBottom: 6,
|
|
2987
|
+
paddingTop: 6
|
|
2988
|
+
},
|
|
2989
|
+
onKeyDown
|
|
2990
|
+
},
|
|
2991
|
+
InputProps: __spreadProps(__spreadValues({}, TextFieldProps3 == null ? void 0 : TextFieldProps3.InputProps), {
|
|
2992
|
+
sx: __spreadValues({
|
|
2993
|
+
fontSize: 14,
|
|
2994
|
+
pl: 0.2
|
|
2995
|
+
}, (_a = TextFieldProps3 == null ? void 0 : TextFieldProps3.InputProps) == null ? void 0 : _a.sx)
|
|
2996
|
+
})
|
|
2997
|
+
}, TextFieldProps3)
|
|
2998
|
+
);
|
|
2999
|
+
};
|
|
3000
|
+
|
|
3001
|
+
// src/components/Grid/EditableTableCell/index.tsx
|
|
3002
|
+
var EditableTableCell = (allProps) => {
|
|
3003
|
+
const _a = allProps, {
|
|
3004
|
+
TextFieldProps: TextFieldProps3,
|
|
3005
|
+
onSave = () => {
|
|
3006
|
+
},
|
|
3007
|
+
onCancel,
|
|
3008
|
+
name,
|
|
3009
|
+
rowData = {},
|
|
3010
|
+
mask,
|
|
3011
|
+
fullWidth = true,
|
|
3012
|
+
formatCellValue = (value2) => value2,
|
|
3013
|
+
formatInputDefautvalue,
|
|
3014
|
+
bordered,
|
|
3015
|
+
type,
|
|
3016
|
+
rowIndex
|
|
3017
|
+
} = _a, props = __objRest(_a, [
|
|
3018
|
+
"TextFieldProps",
|
|
3019
|
+
"onSave",
|
|
3020
|
+
"onCancel",
|
|
3021
|
+
"name",
|
|
3022
|
+
"rowData",
|
|
3023
|
+
"mask",
|
|
3024
|
+
"fullWidth",
|
|
3025
|
+
"formatCellValue",
|
|
3026
|
+
"formatInputDefautvalue",
|
|
3027
|
+
"bordered",
|
|
3028
|
+
"type",
|
|
3029
|
+
"rowIndex"
|
|
3030
|
+
]);
|
|
3031
|
+
const [isEditing, setIsEditing] = useState2(false);
|
|
3032
|
+
const [value, setValue] = useState2(rowData == null ? void 0 : rowData[name]);
|
|
3033
|
+
const handleCancelEditing = () => {
|
|
3034
|
+
setIsEditing(false);
|
|
3035
|
+
if (onCancel)
|
|
3036
|
+
onCancel();
|
|
3037
|
+
};
|
|
3038
|
+
return /* @__PURE__ */ React12.createElement(
|
|
3039
|
+
TableCell3,
|
|
3040
|
+
__spreadProps(__spreadValues({}, props), {
|
|
3041
|
+
sx: __spreadProps(__spreadValues({}, (props || {}).sx), {
|
|
3042
|
+
p: isEditing ? 0 : "intial",
|
|
3043
|
+
border: bordered ? "1px solid" : "initial",
|
|
3044
|
+
borderColor: "divider"
|
|
3045
|
+
}),
|
|
3046
|
+
onDoubleClick: () => setIsEditing(true)
|
|
3047
|
+
}),
|
|
3048
|
+
isEditing ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, mask ? /* @__PURE__ */ React12.createElement(
|
|
3049
|
+
InputMask,
|
|
3050
|
+
{
|
|
3051
|
+
mask,
|
|
3052
|
+
isEditing,
|
|
3053
|
+
setIsEditing,
|
|
3054
|
+
name,
|
|
3055
|
+
rowData,
|
|
3056
|
+
onSave: (_b) => {
|
|
3057
|
+
var _c = _b, { value: value2 } = _c, rest = __objRest(_c, ["value"]);
|
|
3058
|
+
setValue(value2);
|
|
3059
|
+
onSave(__spreadValues({ value: value2 }, rest));
|
|
3060
|
+
},
|
|
3061
|
+
handleCancelEditing,
|
|
3062
|
+
formatInputDefautvalue
|
|
3063
|
+
}
|
|
3064
|
+
) : /* @__PURE__ */ React12.createElement(
|
|
3065
|
+
DefaultInput,
|
|
3066
|
+
{
|
|
3067
|
+
onUpdateValue: (newValue) => {
|
|
3068
|
+
setValue(newValue);
|
|
3069
|
+
},
|
|
3070
|
+
isEditing,
|
|
3071
|
+
name,
|
|
3072
|
+
rowData,
|
|
3073
|
+
onSave,
|
|
3074
|
+
handleCancelEditing,
|
|
3075
|
+
setIsEditing,
|
|
3076
|
+
formatInputDefautvalue,
|
|
3077
|
+
type
|
|
3078
|
+
}
|
|
3079
|
+
)) : /* @__PURE__ */ React12.createElement(React12.Fragment, null, formatCellValue(value))
|
|
3080
|
+
);
|
|
3081
|
+
};
|
|
3082
|
+
|
|
3083
|
+
// src/components/Input/index.tsx
|
|
3084
|
+
import React13 from "react";
|
|
3085
|
+
import { TextField as TextField4 } from "@mui/material";
|
|
3086
|
+
import { Field } from "formik";
|
|
3087
|
+
var Input = (_a) => {
|
|
3088
|
+
var _b = _a, { withFormik = true } = _b, rest = __objRest(_b, ["withFormik"]);
|
|
3089
|
+
if (withFormik)
|
|
3090
|
+
return /* @__PURE__ */ React13.createElement(FormikInput, __spreadValues({}, rest));
|
|
3091
|
+
else
|
|
3092
|
+
return /* @__PURE__ */ React13.createElement(BaseInput, __spreadValues({}, rest));
|
|
3093
|
+
};
|
|
3094
|
+
var BaseInput = (props) => {
|
|
3095
|
+
return /* @__PURE__ */ React13.createElement(TextField4, __spreadValues({ fullWidth: true }, props));
|
|
3096
|
+
};
|
|
3097
|
+
var FormikInput = (_a) => {
|
|
3098
|
+
var _b = _a, { name, shrink } = _b, rest = __objRest(_b, ["name", "shrink"]);
|
|
3099
|
+
return /* @__PURE__ */ React13.createElement(Field, { name }, (_a2) => {
|
|
3100
|
+
var _b2 = _a2, { field: _c } = _b2, _d = _c, { value } = _d, field = __objRest(_d, ["value"]), { meta: { error } } = _b2;
|
|
3101
|
+
return /* @__PURE__ */ React13.createElement(
|
|
3102
|
+
BaseInput,
|
|
3103
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
3104
|
+
defaultValue: value,
|
|
3105
|
+
error: Boolean(error),
|
|
3106
|
+
helperText: error
|
|
3107
|
+
}, field), rest), {
|
|
3108
|
+
InputLabelProps: __spreadValues({ shrink }, rest.InputLabelProps)
|
|
3109
|
+
})
|
|
3110
|
+
);
|
|
3111
|
+
});
|
|
3112
|
+
};
|
|
3113
|
+
|
|
3114
|
+
// src/components/InputMask/index.tsx
|
|
3115
|
+
import React14, { useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
3116
|
+
import { useIMask as useIMask2 } from "react-imask";
|
|
3117
|
+
import { Field as Field2 } from "formik";
|
|
3118
|
+
function InputMask2(_a) {
|
|
3119
|
+
var _b = _a, { withFormik = true } = _b, rest = __objRest(_b, ["withFormik"]);
|
|
3120
|
+
if (withFormik)
|
|
3121
|
+
return /* @__PURE__ */ React14.createElement(FormikInputMask, __spreadValues({}, rest));
|
|
3122
|
+
else
|
|
3123
|
+
return /* @__PURE__ */ React14.createElement(BaseInputMask, __spreadValues({}, rest));
|
|
3124
|
+
}
|
|
3125
|
+
var BaseInputMask = (_a) => {
|
|
3126
|
+
var _b = _a, {
|
|
3127
|
+
mask,
|
|
3128
|
+
defaultValue,
|
|
3129
|
+
onChangeValue,
|
|
3130
|
+
value: controlledValue
|
|
3131
|
+
} = _b, rest = __objRest(_b, [
|
|
3132
|
+
"mask",
|
|
3133
|
+
"defaultValue",
|
|
3134
|
+
"onChangeValue",
|
|
3135
|
+
"value"
|
|
3136
|
+
]);
|
|
3137
|
+
const { ref, value, setValue, maskRef, unmaskedValue } = useIMask2(
|
|
3138
|
+
mask,
|
|
3139
|
+
{
|
|
3140
|
+
onComplete: (...params) => {
|
|
3141
|
+
if (onChangeValue)
|
|
3142
|
+
onChangeValue(params[0], unmaskedValue);
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
);
|
|
3146
|
+
useEffect3(() => {
|
|
3147
|
+
if (!value)
|
|
3148
|
+
setValue(String(defaultValue));
|
|
3149
|
+
maskRef.current.value = String(defaultValue);
|
|
3150
|
+
}, [defaultValue]);
|
|
3151
|
+
useEffect3(() => {
|
|
3152
|
+
setValue(controlledValue);
|
|
3153
|
+
maskRef.current.value = controlledValue;
|
|
3154
|
+
}, [controlledValue]);
|
|
3155
|
+
return /* @__PURE__ */ React14.createElement(BaseInput, __spreadValues({ inputRef: ref }, rest));
|
|
3156
|
+
};
|
|
3157
|
+
function FormikInputMask(_a) {
|
|
3158
|
+
var _b = _a, {
|
|
3159
|
+
mask,
|
|
3160
|
+
defaultValue,
|
|
3161
|
+
name
|
|
3162
|
+
} = _b, rest = __objRest(_b, [
|
|
3163
|
+
"mask",
|
|
3164
|
+
"defaultValue",
|
|
3165
|
+
"name"
|
|
3166
|
+
]);
|
|
3167
|
+
const { ref, value, unmaskedValue, maskRef, setValue } = useIMask2(
|
|
3168
|
+
mask
|
|
3169
|
+
);
|
|
3170
|
+
const initialValue = useRef2();
|
|
3171
|
+
const formikSaveFunction = useRef2();
|
|
3172
|
+
useEffect3(() => {
|
|
3173
|
+
if (!value && defaultValue) {
|
|
3174
|
+
setValue(String(defaultValue));
|
|
3175
|
+
maskRef.current.value = String(defaultValue);
|
|
3176
|
+
} else if (initialValue.current) {
|
|
3177
|
+
setValue(String(initialValue.current));
|
|
3178
|
+
maskRef.current.value = String(initialValue.current);
|
|
3179
|
+
}
|
|
3180
|
+
}, [defaultValue]);
|
|
3181
|
+
useEffect3(() => {
|
|
3182
|
+
if (formikSaveFunction.current)
|
|
3183
|
+
formikSaveFunction.current(name, unmaskedValue);
|
|
3184
|
+
}, [value]);
|
|
3185
|
+
return /* @__PURE__ */ React14.createElement(Field2, { name }, (_a2) => {
|
|
3186
|
+
var _b2 = _a2, {
|
|
3187
|
+
field: _c
|
|
3188
|
+
} = _b2, _d = _c, { value: value2 } = _d, field = __objRest(_d, ["value"]), {
|
|
3189
|
+
meta: { error },
|
|
3190
|
+
form: { setFieldValue }
|
|
3191
|
+
} = _b2;
|
|
3192
|
+
initialValue.current = value2;
|
|
3193
|
+
formikSaveFunction.current = setFieldValue;
|
|
3194
|
+
return /* @__PURE__ */ React14.createElement(
|
|
3195
|
+
BaseInput,
|
|
3196
|
+
__spreadProps(__spreadValues(__spreadValues({}, rest), field), {
|
|
3197
|
+
inputRef: ref,
|
|
3198
|
+
error: Boolean(error),
|
|
3199
|
+
helperText: error
|
|
3200
|
+
})
|
|
3201
|
+
);
|
|
3202
|
+
});
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3205
|
+
// src/components/Select/index.tsx
|
|
3206
|
+
import React15 from "react";
|
|
3207
|
+
import {
|
|
3208
|
+
FormControl,
|
|
3209
|
+
FormHelperText,
|
|
3210
|
+
InputLabel,
|
|
3211
|
+
Select as MuiSelect
|
|
3212
|
+
} from "@mui/material";
|
|
3213
|
+
import { useField } from "formik";
|
|
3214
|
+
var CustomInputLabel = InputLabel;
|
|
3215
|
+
var Select = (_a) => {
|
|
3216
|
+
var _b = _a, { withFormik = true } = _b, rest = __objRest(_b, ["withFormik"]);
|
|
3217
|
+
if (withFormik)
|
|
3218
|
+
return /* @__PURE__ */ React15.createElement(FormikSelect, __spreadValues({}, rest));
|
|
3219
|
+
else
|
|
3220
|
+
return /* @__PURE__ */ React15.createElement(BaseSelect, __spreadValues({}, rest));
|
|
3221
|
+
};
|
|
3222
|
+
var BaseSelect = (_a) => {
|
|
3223
|
+
var _b = _a, {
|
|
3224
|
+
name,
|
|
3225
|
+
label,
|
|
3226
|
+
children,
|
|
3227
|
+
FormControlProps: FormControlProps2,
|
|
3228
|
+
InputLabelProps: InputLabelProps2
|
|
3229
|
+
} = _b, rest = __objRest(_b, [
|
|
3230
|
+
"name",
|
|
3231
|
+
"label",
|
|
3232
|
+
"children",
|
|
3233
|
+
"FormControlProps",
|
|
3234
|
+
"InputLabelProps"
|
|
3235
|
+
]);
|
|
3236
|
+
return /* @__PURE__ */ React15.createElement(FormControl, __spreadValues({ fullWidth: true }, FormControlProps2), /* @__PURE__ */ React15.createElement(CustomInputLabel, __spreadValues({}, InputLabelProps2), label), /* @__PURE__ */ React15.createElement(
|
|
3237
|
+
MuiSelect,
|
|
3238
|
+
__spreadValues({
|
|
3239
|
+
name,
|
|
3240
|
+
inputProps: {
|
|
3241
|
+
name
|
|
3242
|
+
},
|
|
3243
|
+
label
|
|
3244
|
+
}, rest),
|
|
3245
|
+
children
|
|
3246
|
+
));
|
|
3247
|
+
};
|
|
3248
|
+
var FormikSelect = (_a) => {
|
|
3249
|
+
var _b = _a, {
|
|
3250
|
+
name,
|
|
3251
|
+
label,
|
|
3252
|
+
children,
|
|
3253
|
+
FormControlProps: FormControlProps2,
|
|
3254
|
+
InputLabelProps: InputLabelProps2,
|
|
3255
|
+
helperText
|
|
3256
|
+
} = _b, rest = __objRest(_b, [
|
|
3257
|
+
"name",
|
|
3258
|
+
"label",
|
|
3259
|
+
"children",
|
|
3260
|
+
"FormControlProps",
|
|
3261
|
+
"InputLabelProps",
|
|
3262
|
+
"helperText"
|
|
3263
|
+
]);
|
|
3264
|
+
const [_a2, ..._b2] = useField({ name }), _c = _a2, { value } = _c, field = __objRest(_c, ["value"]), [meta, { setValue }] = _b2;
|
|
3265
|
+
const onChange = (_, { props: { value: value2 } }) => {
|
|
3266
|
+
setValue(value2);
|
|
3267
|
+
};
|
|
3268
|
+
return /* @__PURE__ */ React15.createElement(FormControl, __spreadProps(__spreadValues({ fullWidth: true }, FormControlProps2), { error: Boolean(meta == null ? void 0 : meta.error) }), /* @__PURE__ */ React15.createElement(CustomInputLabel, __spreadValues({}, InputLabelProps2), label), /* @__PURE__ */ React15.createElement(
|
|
3269
|
+
MuiSelect,
|
|
3270
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
3271
|
+
inputProps: {
|
|
3272
|
+
name
|
|
3273
|
+
},
|
|
3274
|
+
label
|
|
3275
|
+
}, rest), field), {
|
|
3276
|
+
defaultValue: value,
|
|
3277
|
+
onChange
|
|
3278
|
+
}),
|
|
3279
|
+
children
|
|
3280
|
+
), /* @__PURE__ */ React15.createElement(FormHelperText, null, helperText || (meta == null ? void 0 : meta.error)));
|
|
3281
|
+
};
|
|
3282
|
+
|
|
3283
|
+
// src/components/Autocomplete/index.tsx
|
|
3284
|
+
import React16, { useMemo as useMemo2 } from "react";
|
|
3285
|
+
import { useField as useField2 } from "formik";
|
|
3286
|
+
import {
|
|
3287
|
+
Autocomplete as MuiAutocomplete,
|
|
3288
|
+
TextField as TextField5
|
|
3289
|
+
} from "@mui/material";
|
|
3290
|
+
function Autocomplete2(_a) {
|
|
3291
|
+
var _b = _a, {
|
|
3292
|
+
withFormik = true,
|
|
3293
|
+
name,
|
|
3294
|
+
getOptionValue
|
|
3295
|
+
} = _b, rest = __objRest(_b, [
|
|
3296
|
+
"withFormik",
|
|
3297
|
+
"name",
|
|
3298
|
+
"getOptionValue"
|
|
3299
|
+
]);
|
|
3300
|
+
if (withFormik) {
|
|
3301
|
+
return /* @__PURE__ */ React16.createElement(
|
|
3302
|
+
FormikAutocomplete,
|
|
3303
|
+
__spreadValues({
|
|
3304
|
+
name,
|
|
3305
|
+
getOptionValue
|
|
3306
|
+
}, rest)
|
|
3307
|
+
);
|
|
3308
|
+
} else
|
|
3309
|
+
return /* @__PURE__ */ React16.createElement(BaseInput2, __spreadValues({}, rest));
|
|
3310
|
+
}
|
|
3311
|
+
function BaseInput2(props) {
|
|
3312
|
+
return /* @__PURE__ */ React16.createElement(
|
|
3313
|
+
MuiAutocomplete,
|
|
3314
|
+
__spreadValues({
|
|
3315
|
+
fullWidth: true,
|
|
3316
|
+
renderInput: (params) => /* @__PURE__ */ React16.createElement(TextField5, __spreadValues({ label: props.label }, params))
|
|
3317
|
+
}, props)
|
|
3318
|
+
);
|
|
3319
|
+
}
|
|
3320
|
+
function FormikAutocomplete(_a) {
|
|
3321
|
+
var _b = _a, {
|
|
3322
|
+
getOptionValue,
|
|
3323
|
+
option
|
|
3324
|
+
} = _b, props = __objRest(_b, [
|
|
3325
|
+
"getOptionValue",
|
|
3326
|
+
"option"
|
|
3327
|
+
]);
|
|
3328
|
+
const [_a2, ..._b2] = useField2({
|
|
3329
|
+
name: props.name
|
|
3330
|
+
}), _c = _a2, { value: defaultValue } = _c, field = __objRest(_c, ["value"]), [meta, { setValue }] = _b2;
|
|
3331
|
+
const defaultOption = useMemo2(() => {
|
|
3332
|
+
const key = option == null ? void 0 : option.key;
|
|
3333
|
+
if (key)
|
|
3334
|
+
return props.options.find((option2) => option2[key] === defaultValue);
|
|
3335
|
+
else
|
|
3336
|
+
return props.options.find(
|
|
3337
|
+
(option2) => Object.values(option2)[0] === defaultValue
|
|
3338
|
+
);
|
|
3339
|
+
}, []);
|
|
3340
|
+
const onChange = (_, newValue) => {
|
|
3341
|
+
const value = option == null ? void 0 : option.value;
|
|
3342
|
+
if (getOptionValue) {
|
|
3343
|
+
setValue(getOptionValue(newValue));
|
|
3344
|
+
} else if (value) {
|
|
3345
|
+
setValue(newValue[value]);
|
|
3346
|
+
} else
|
|
3347
|
+
setValue(newValue);
|
|
3348
|
+
};
|
|
3349
|
+
const getOptionLabel = (item) => {
|
|
3350
|
+
if (props == null ? void 0 : props.getOptionLabel)
|
|
3351
|
+
return props.getOptionLabel(item);
|
|
3352
|
+
else if (option == null ? void 0 : option.label)
|
|
3353
|
+
return String(item[option.label]);
|
|
3354
|
+
return "[getOptionLabel] error";
|
|
3355
|
+
};
|
|
3356
|
+
const isOptionEqualToValue = (a, b) => {
|
|
3357
|
+
const key = option == null ? void 0 : option.key;
|
|
3358
|
+
if (props == null ? void 0 : props.isOptionEqualToValue)
|
|
3359
|
+
return props.isOptionEqualToValue(a, b);
|
|
3360
|
+
else if (key)
|
|
3361
|
+
return a[key] === b[key];
|
|
3362
|
+
return Object.values(a)[0] === Object.values(b)[0];
|
|
3363
|
+
};
|
|
3364
|
+
return /* @__PURE__ */ React16.createElement(
|
|
3365
|
+
MuiAutocomplete,
|
|
3366
|
+
__spreadValues({
|
|
3367
|
+
getOptionLabel,
|
|
3368
|
+
renderInput: (params) => /* @__PURE__ */ React16.createElement(
|
|
3369
|
+
TextField5,
|
|
3370
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
3371
|
+
error: Boolean(meta == null ? void 0 : meta.error),
|
|
3372
|
+
helperText: meta == null ? void 0 : meta.error
|
|
3373
|
+
}, params), field), {
|
|
3374
|
+
label: props.label
|
|
3375
|
+
})
|
|
3376
|
+
),
|
|
3377
|
+
defaultValue: defaultOption,
|
|
3378
|
+
onChange,
|
|
3379
|
+
isOptionEqualToValue
|
|
3380
|
+
}, props)
|
|
3381
|
+
);
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
// src/components/Checkbox/index.tsx
|
|
3385
|
+
import React17 from "react";
|
|
3386
|
+
import {
|
|
3387
|
+
Checkbox as MuiCheckbox,
|
|
3388
|
+
FormControlLabel
|
|
3389
|
+
} from "@mui/material";
|
|
3390
|
+
import { useField as useField3 } from "formik";
|
|
3391
|
+
var Checkbox = (_a) => {
|
|
3392
|
+
var _b = _a, {
|
|
3393
|
+
withFormik = true,
|
|
3394
|
+
name
|
|
3395
|
+
} = _b, props = __objRest(_b, [
|
|
3396
|
+
"withFormik",
|
|
3397
|
+
"name"
|
|
3398
|
+
]);
|
|
3399
|
+
if (withFormik && name)
|
|
3400
|
+
return /* @__PURE__ */ React17.createElement(FormikCheckbox, __spreadValues({ name }, props));
|
|
3401
|
+
else
|
|
3402
|
+
return /* @__PURE__ */ React17.createElement(BaseCheckbox, __spreadValues({}, props));
|
|
3403
|
+
};
|
|
3404
|
+
var BaseCheckbox = (_a) => {
|
|
3405
|
+
var _b = _a, {
|
|
3406
|
+
label,
|
|
3407
|
+
FormControlLabelProps: FormControlLabelProps3
|
|
3408
|
+
} = _b, props = __objRest(_b, [
|
|
3409
|
+
"label",
|
|
3410
|
+
"FormControlLabelProps"
|
|
3411
|
+
]);
|
|
3412
|
+
return /* @__PURE__ */ React17.createElement(
|
|
3413
|
+
FormControlLabel,
|
|
3414
|
+
__spreadValues({
|
|
3415
|
+
label,
|
|
3416
|
+
control: /* @__PURE__ */ React17.createElement(MuiCheckbox, __spreadValues({}, props))
|
|
3417
|
+
}, FormControlLabelProps3)
|
|
3418
|
+
);
|
|
3419
|
+
};
|
|
3420
|
+
var FormikCheckbox = (_a) => {
|
|
3421
|
+
var _b = _a, {
|
|
3422
|
+
label,
|
|
3423
|
+
name,
|
|
3424
|
+
FormControlLabelProps: FormControlLabelProps3
|
|
3425
|
+
} = _b, props = __objRest(_b, [
|
|
3426
|
+
"label",
|
|
3427
|
+
"name",
|
|
3428
|
+
"FormControlLabelProps"
|
|
3429
|
+
]);
|
|
3430
|
+
const [_a2, ..._b2] = useField3({
|
|
3431
|
+
name
|
|
3432
|
+
}), _c = _a2, { value } = _c, field = __objRest(_c, ["value"]), [, { setValue }] = _b2;
|
|
3433
|
+
const onChange = (_, value2) => {
|
|
3434
|
+
setValue(value2);
|
|
3435
|
+
};
|
|
3436
|
+
return /* @__PURE__ */ React17.createElement(
|
|
3437
|
+
FormControlLabel,
|
|
3438
|
+
__spreadValues(__spreadProps(__spreadValues({
|
|
3439
|
+
label,
|
|
3440
|
+
control: /* @__PURE__ */ React17.createElement(MuiCheckbox, __spreadProps(__spreadValues({}, props), { defaultChecked: Boolean(value) }))
|
|
3441
|
+
}, field), {
|
|
3442
|
+
onChange
|
|
3443
|
+
}), FormControlLabelProps3)
|
|
3444
|
+
);
|
|
3445
|
+
};
|
|
3446
|
+
|
|
3447
|
+
// src/components/Switch/index.tsx
|
|
3448
|
+
import React18 from "react";
|
|
3449
|
+
import {
|
|
3450
|
+
Switch as MuiSwitch,
|
|
3451
|
+
FormControlLabel as FormControlLabel2
|
|
3452
|
+
} from "@mui/material";
|
|
3453
|
+
import { useField as useField4 } from "formik";
|
|
3454
|
+
var Switch = (_a) => {
|
|
3455
|
+
var _b = _a, { withFormik = true, name } = _b, props = __objRest(_b, ["withFormik", "name"]);
|
|
3456
|
+
if (withFormik && name)
|
|
3457
|
+
return /* @__PURE__ */ React18.createElement(FormikSwitch, __spreadValues({ name }, props));
|
|
3458
|
+
else
|
|
3459
|
+
return /* @__PURE__ */ React18.createElement(BaseSwitch, __spreadValues({}, props));
|
|
3460
|
+
};
|
|
3461
|
+
var BaseSwitch = (_a) => {
|
|
3462
|
+
var _b = _a, {
|
|
3463
|
+
label,
|
|
3464
|
+
FormControlLabelProps: FormControlLabelProps3
|
|
3465
|
+
} = _b, props = __objRest(_b, [
|
|
3466
|
+
"label",
|
|
3467
|
+
"FormControlLabelProps"
|
|
3468
|
+
]);
|
|
3469
|
+
return /* @__PURE__ */ React18.createElement(
|
|
3470
|
+
FormControlLabel2,
|
|
3471
|
+
__spreadValues({
|
|
3472
|
+
label,
|
|
3473
|
+
control: /* @__PURE__ */ React18.createElement(MuiSwitch, __spreadValues({}, props))
|
|
3474
|
+
}, FormControlLabelProps3)
|
|
3475
|
+
);
|
|
3476
|
+
};
|
|
3477
|
+
var FormikSwitch = (_a) => {
|
|
3478
|
+
var _b = _a, {
|
|
3479
|
+
label,
|
|
3480
|
+
name,
|
|
3481
|
+
FormControlLabelProps: FormControlLabelProps3
|
|
3482
|
+
} = _b, props = __objRest(_b, [
|
|
3483
|
+
"label",
|
|
3484
|
+
"name",
|
|
3485
|
+
"FormControlLabelProps"
|
|
3486
|
+
]);
|
|
3487
|
+
const [_a2, ..._b2] = useField4({
|
|
3488
|
+
name
|
|
3489
|
+
}), _c = _a2, { value, onChange: unused } = _c, field = __objRest(_c, ["value", "onChange"]), [, { setValue }] = _b2;
|
|
3490
|
+
const onChange = (_, value2) => {
|
|
3491
|
+
setValue(value2);
|
|
3492
|
+
};
|
|
3493
|
+
return /* @__PURE__ */ React18.createElement(
|
|
3494
|
+
FormControlLabel2,
|
|
3495
|
+
__spreadValues(__spreadValues({
|
|
3496
|
+
label,
|
|
3497
|
+
onChange,
|
|
3498
|
+
control: /* @__PURE__ */ React18.createElement(MuiSwitch, __spreadValues({ defaultChecked: value }, props))
|
|
3499
|
+
}, field), FormControlLabelProps3)
|
|
3500
|
+
);
|
|
3501
|
+
};
|
|
3502
|
+
|
|
3503
|
+
// src/components/Radio/index.tsx
|
|
3504
|
+
import React19 from "react";
|
|
3505
|
+
import {
|
|
3506
|
+
FormControl as FormControl2,
|
|
3507
|
+
FormControlLabel as FormControlLabel3,
|
|
3508
|
+
FormLabel,
|
|
3509
|
+
Radio as MuiRadio,
|
|
3510
|
+
RadioGroup
|
|
3511
|
+
} from "@mui/material";
|
|
3512
|
+
import { Field as Field3 } from "formik";
|
|
3513
|
+
var Radio = (_a) => {
|
|
3514
|
+
var _b = _a, {
|
|
3515
|
+
name,
|
|
3516
|
+
withFormik = true
|
|
3517
|
+
} = _b, rest = __objRest(_b, [
|
|
3518
|
+
"name",
|
|
3519
|
+
"withFormik"
|
|
3520
|
+
]);
|
|
3521
|
+
if (withFormik && name)
|
|
3522
|
+
return /* @__PURE__ */ React19.createElement(FormikRadio, __spreadValues({ name }, rest));
|
|
3523
|
+
else
|
|
3524
|
+
return /* @__PURE__ */ React19.createElement(BaseRadio, __spreadValues({}, rest));
|
|
3525
|
+
};
|
|
3526
|
+
var BaseRadio = (_a) => {
|
|
3527
|
+
var _b = _a, {
|
|
3528
|
+
label,
|
|
3529
|
+
options
|
|
3530
|
+
} = _b, rest = __objRest(_b, [
|
|
3531
|
+
"label",
|
|
3532
|
+
"options"
|
|
3533
|
+
]);
|
|
3534
|
+
return /* @__PURE__ */ React19.createElement(FormControl2, null, label && /* @__PURE__ */ React19.createElement(FormLabel, null, label), /* @__PURE__ */ React19.createElement(RadioGroup, __spreadValues({}, rest), options.map((option) => /* @__PURE__ */ React19.createElement(
|
|
3535
|
+
FormControlLabel3,
|
|
3536
|
+
{
|
|
3537
|
+
key: String(option.value),
|
|
3538
|
+
value: option.value,
|
|
3539
|
+
label: option.label,
|
|
3540
|
+
control: /* @__PURE__ */ React19.createElement(MuiRadio, null)
|
|
3541
|
+
}
|
|
3542
|
+
))));
|
|
3543
|
+
};
|
|
3544
|
+
var FormikRadio = (_a) => {
|
|
3545
|
+
var _b = _a, {
|
|
3546
|
+
label,
|
|
3547
|
+
name,
|
|
3548
|
+
options
|
|
3549
|
+
} = _b, rest = __objRest(_b, [
|
|
3550
|
+
"label",
|
|
3551
|
+
"name",
|
|
3552
|
+
"options"
|
|
3553
|
+
]);
|
|
3554
|
+
const onChange = (setFieldValue, value) => {
|
|
3555
|
+
setFieldValue(name, value);
|
|
3556
|
+
};
|
|
3557
|
+
return /* @__PURE__ */ React19.createElement(Field3, null, ({ field: { value }, form: { setFieldValue } }) => /* @__PURE__ */ React19.createElement(FormControl2, null, label && /* @__PURE__ */ React19.createElement(FormLabel, null, label), /* @__PURE__ */ React19.createElement(
|
|
3558
|
+
RadioGroup,
|
|
3559
|
+
__spreadValues({
|
|
3560
|
+
defaultValue: value,
|
|
3561
|
+
onChange: (_, value2) => onChange(setFieldValue, value2)
|
|
3562
|
+
}, rest),
|
|
3563
|
+
options.map((option) => /* @__PURE__ */ React19.createElement(
|
|
3564
|
+
FormControlLabel3,
|
|
3565
|
+
{
|
|
3566
|
+
key: String(option.value),
|
|
3567
|
+
value: option.value,
|
|
3568
|
+
label: option.label,
|
|
3569
|
+
control: /* @__PURE__ */ React19.createElement(MuiRadio, null)
|
|
3570
|
+
}
|
|
3571
|
+
))
|
|
3572
|
+
)));
|
|
3573
|
+
};
|
|
3574
|
+
|
|
3575
|
+
// src/components/LargeButton/index.tsx
|
|
3576
|
+
import React20 from "react";
|
|
3577
|
+
import {
|
|
3578
|
+
Button as Button2,
|
|
3579
|
+
CircularProgress
|
|
3580
|
+
} from "@mui/material";
|
|
3581
|
+
var LargeButton = (_a) => {
|
|
3582
|
+
var _b = _a, {
|
|
3583
|
+
loading,
|
|
3584
|
+
children,
|
|
3585
|
+
CircularProgressProps: CircularProgressProps2,
|
|
3586
|
+
sx
|
|
3587
|
+
} = _b, rest = __objRest(_b, [
|
|
3588
|
+
"loading",
|
|
3589
|
+
"children",
|
|
3590
|
+
"CircularProgressProps",
|
|
3591
|
+
"sx"
|
|
3592
|
+
]);
|
|
3593
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3594
|
+
Button2,
|
|
3595
|
+
__spreadValues({
|
|
3596
|
+
variant: "contained",
|
|
3597
|
+
fullWidth: true,
|
|
3598
|
+
sx: __spreadValues({ fontWeight: "bold" }, sx),
|
|
3599
|
+
disabled: rest.disabled || loading
|
|
3600
|
+
}, rest),
|
|
3601
|
+
loading ? /* @__PURE__ */ React20.createElement(
|
|
3602
|
+
CircularProgress,
|
|
3603
|
+
__spreadValues({
|
|
3604
|
+
size: 25,
|
|
3605
|
+
color: "inherit"
|
|
3606
|
+
}, CircularProgressProps2)
|
|
3607
|
+
) : children
|
|
3608
|
+
);
|
|
3609
|
+
};
|
|
3610
|
+
|
|
3611
|
+
// src/components/TabPanel/index.tsx
|
|
3612
|
+
import React21 from "react";
|
|
3613
|
+
function getTabProps(index) {
|
|
3614
|
+
return {
|
|
3615
|
+
id: `tab-${index}`,
|
|
3616
|
+
"aria-controls": `tabpanel-${index}`
|
|
3617
|
+
};
|
|
3618
|
+
}
|
|
3619
|
+
var TabPanel = (props) => {
|
|
3620
|
+
const _a = props, { children, value, index } = _a, other = __objRest(_a, ["children", "value", "index"]);
|
|
3621
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3622
|
+
"div",
|
|
3623
|
+
__spreadValues({
|
|
3624
|
+
role: "tabpanel",
|
|
3625
|
+
hidden: value !== index,
|
|
3626
|
+
id: `tabpanel-${index}`,
|
|
3627
|
+
"aria-labelledby": `tab-${index}`
|
|
3628
|
+
}, other),
|
|
3629
|
+
value === index && /* @__PURE__ */ React21.createElement(React21.Fragment, null, children)
|
|
3630
|
+
);
|
|
3631
|
+
};
|
|
3632
|
+
|
|
3633
|
+
// src/components/BaseGrid/index.tsx
|
|
3634
|
+
import React23 from "react";
|
|
3635
|
+
import {
|
|
3636
|
+
LinearProgress as LinearProgress2,
|
|
3637
|
+
Paper as Paper2,
|
|
3638
|
+
Table as Table2,
|
|
3639
|
+
TableBody as TableBody2,
|
|
3640
|
+
TableCell as TableCell4,
|
|
3641
|
+
TableHead as TableHead2,
|
|
3642
|
+
TableRow as TableRow3,
|
|
3643
|
+
TableSortLabel as TableSortLabel2
|
|
3644
|
+
} from "@mui/material";
|
|
3645
|
+
|
|
3646
|
+
// src/components/BaseGrid/Pagination/index.tsx
|
|
3647
|
+
import React22 from "react";
|
|
3648
|
+
import {
|
|
3649
|
+
Box as Box3,
|
|
3650
|
+
IconButton as IconButton3,
|
|
3651
|
+
MenuItem,
|
|
3652
|
+
Select as Select2,
|
|
3653
|
+
Stack,
|
|
3654
|
+
Typography as Typography2
|
|
3655
|
+
} from "@mui/material";
|
|
3656
|
+
import { MdArrowForwardIos, MdArrowBackIosNew } from "react-icons/md";
|
|
3657
|
+
var GridPagination = ({
|
|
3658
|
+
currentPage,
|
|
3659
|
+
totalNumberOfPages,
|
|
3660
|
+
onPageChange,
|
|
3661
|
+
rowsPerPageOptions,
|
|
3662
|
+
setRowsPerPage,
|
|
3663
|
+
rowsPerPage,
|
|
3664
|
+
dense
|
|
3665
|
+
}) => {
|
|
3666
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3667
|
+
Stack,
|
|
3668
|
+
{
|
|
3669
|
+
direction: "row",
|
|
3670
|
+
justifyContent: "space-between",
|
|
3671
|
+
alignItems: "center",
|
|
3672
|
+
width: "100%",
|
|
3673
|
+
py: dense ? 0.5 : 1
|
|
3674
|
+
},
|
|
3675
|
+
/* @__PURE__ */ React22.createElement(Box3, null),
|
|
3676
|
+
/* @__PURE__ */ React22.createElement(Stack, { direction: "row", alignItems: "center" }, /* @__PURE__ */ React22.createElement(
|
|
3677
|
+
Select2,
|
|
3678
|
+
{
|
|
3679
|
+
variant: "standard",
|
|
3680
|
+
size: "small",
|
|
3681
|
+
margin: "dense",
|
|
3682
|
+
sx: { width: 60, mr: 2, textAlign: "center", fontSize: 13 },
|
|
3683
|
+
value: rowsPerPage,
|
|
3684
|
+
onChange: ({ target }) => setRowsPerPage(parseInt(target.value))
|
|
3685
|
+
},
|
|
3686
|
+
rowsPerPageOptions.map((option) => /* @__PURE__ */ React22.createElement(MenuItem, { key: option, value: option }, option))
|
|
3687
|
+
), /* @__PURE__ */ React22.createElement(Typography2, { variant: "body2" }, currentPage + 1, " de ", totalNumberOfPages + 1), /* @__PURE__ */ React22.createElement(
|
|
3688
|
+
IconButton3,
|
|
3689
|
+
{
|
|
3690
|
+
size: "small",
|
|
3691
|
+
disabled: currentPage === 0,
|
|
3692
|
+
onClick: () => onPageChange(currentPage - 1)
|
|
3693
|
+
},
|
|
3694
|
+
/* @__PURE__ */ React22.createElement(MdArrowBackIosNew, { size: 8 * 2 })
|
|
3695
|
+
), /* @__PURE__ */ React22.createElement(
|
|
3696
|
+
IconButton3,
|
|
3697
|
+
{
|
|
3698
|
+
size: "small",
|
|
3699
|
+
disabled: currentPage === totalNumberOfPages,
|
|
3700
|
+
onClick: () => onPageChange(currentPage + 1)
|
|
3701
|
+
},
|
|
3702
|
+
/* @__PURE__ */ React22.createElement(MdArrowForwardIos, { size: 8 * 2 })
|
|
3703
|
+
))
|
|
3704
|
+
);
|
|
3705
|
+
};
|
|
3706
|
+
|
|
3707
|
+
// src/components/BaseGrid/styles.ts
|
|
3708
|
+
var styles = {
|
|
3709
|
+
rowGap: function(dense) {
|
|
3710
|
+
return {
|
|
3711
|
+
py: dense ? 0.23 : 0.7
|
|
3712
|
+
};
|
|
3713
|
+
},
|
|
3714
|
+
bordered: function(active) {
|
|
3715
|
+
if (!active)
|
|
3716
|
+
return {};
|
|
3717
|
+
return {
|
|
3718
|
+
"tr td:not(:last-child), tr th:not(:last-child)": {
|
|
3719
|
+
borderRight: "1px solid",
|
|
3720
|
+
borderColor: "divider"
|
|
3721
|
+
}
|
|
3722
|
+
};
|
|
3723
|
+
},
|
|
3724
|
+
striped: function(active) {
|
|
3725
|
+
if (!active)
|
|
3726
|
+
return {};
|
|
3727
|
+
return {
|
|
3728
|
+
"tr:nth-of-type(even)": {
|
|
3729
|
+
transition: "background-color ease 200ms",
|
|
3730
|
+
bgcolor: "divider"
|
|
3731
|
+
}
|
|
3732
|
+
};
|
|
3733
|
+
},
|
|
3734
|
+
lastRowBorder: function(active) {
|
|
3735
|
+
return {
|
|
3736
|
+
"tbody tr:last-child td": {
|
|
3737
|
+
borderBottomWidth: active ? 0 : 1
|
|
3738
|
+
}
|
|
3739
|
+
};
|
|
3740
|
+
}
|
|
3741
|
+
};
|
|
3742
|
+
|
|
3743
|
+
// src/components/BaseGrid/index.tsx
|
|
3744
|
+
function BaseGrid({
|
|
3745
|
+
columns,
|
|
3746
|
+
children,
|
|
3747
|
+
paperProps,
|
|
3748
|
+
tableBodyProps,
|
|
3749
|
+
tableHeadProps,
|
|
3750
|
+
tableProps,
|
|
3751
|
+
sortedDirection,
|
|
3752
|
+
sortedBy,
|
|
3753
|
+
onSortBy,
|
|
3754
|
+
dense = true,
|
|
3755
|
+
striped,
|
|
3756
|
+
bordered,
|
|
3757
|
+
currentPage,
|
|
3758
|
+
totalNumberOfPages,
|
|
3759
|
+
onPageChange,
|
|
3760
|
+
rowsPerPage,
|
|
3761
|
+
setRowsPerPage,
|
|
3762
|
+
rowsPerPageOptions,
|
|
3763
|
+
hideFooter,
|
|
3764
|
+
prependColumn,
|
|
3765
|
+
appendColumn,
|
|
3766
|
+
isLoading
|
|
3767
|
+
}) {
|
|
3768
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3769
|
+
Paper2,
|
|
3770
|
+
__spreadProps(__spreadValues({}, paperProps), {
|
|
3771
|
+
sx: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, styles.rowGap(dense)), styles.bordered(bordered)), styles.striped(striped)), styles.lastRowBorder(hideFooter)), paperProps == null ? void 0 : paperProps.sx)
|
|
3772
|
+
}),
|
|
3773
|
+
/* @__PURE__ */ React23.createElement(
|
|
3774
|
+
Table2,
|
|
3775
|
+
__spreadProps(__spreadValues({
|
|
3776
|
+
size: "small",
|
|
3777
|
+
stickyHeader: true
|
|
3778
|
+
}, tableProps), {
|
|
3779
|
+
sx: __spreadValues({}, tableProps == null ? void 0 : tableProps.sx)
|
|
3780
|
+
}),
|
|
3781
|
+
/* @__PURE__ */ React23.createElement(TableHead2, __spreadValues({}, tableHeadProps), /* @__PURE__ */ React23.createElement(TableRow3, null, prependColumn, columns.map((column) => /* @__PURE__ */ React23.createElement(
|
|
3782
|
+
TableCell4,
|
|
3783
|
+
{
|
|
3784
|
+
key: column.name,
|
|
3785
|
+
padding: dense ? "none" : "normal",
|
|
3786
|
+
sx: __spreadValues({
|
|
3787
|
+
pl: 2
|
|
3788
|
+
}, column == null ? void 0 : column.sx)
|
|
3789
|
+
},
|
|
3790
|
+
column.children ? column.children : /* @__PURE__ */ React23.createElement(
|
|
3791
|
+
TableSortLabel2,
|
|
3792
|
+
{
|
|
3793
|
+
active: sortedBy === column.name,
|
|
3794
|
+
direction: sortedDirection,
|
|
3795
|
+
onClick: () => onSortBy(column.name),
|
|
3796
|
+
disabled: column.canSort === false
|
|
3797
|
+
},
|
|
3798
|
+
column.label
|
|
3799
|
+
)
|
|
3800
|
+
)), appendColumn), isLoading && /* @__PURE__ */ React23.createElement(TableRow3, null, /* @__PURE__ */ React23.createElement(TableCell4, { colSpan: columns.length, sx: { p: 0, border: "none" } }, /* @__PURE__ */ React23.createElement(LinearProgress2, null)))),
|
|
3801
|
+
/* @__PURE__ */ React23.createElement(TableBody2, __spreadValues({}, tableBodyProps), children)
|
|
3802
|
+
),
|
|
3803
|
+
!hideFooter && /* @__PURE__ */ React23.createElement(
|
|
3804
|
+
GridPagination,
|
|
3805
|
+
{
|
|
3806
|
+
rowsPerPageOptions,
|
|
3807
|
+
currentPage,
|
|
3808
|
+
totalNumberOfPages,
|
|
3809
|
+
onPageChange,
|
|
3810
|
+
setRowsPerPage,
|
|
3811
|
+
rowsPerPage,
|
|
3812
|
+
dense
|
|
3813
|
+
}
|
|
3814
|
+
)
|
|
3815
|
+
);
|
|
3816
|
+
}
|
|
3817
|
+
|
|
3818
|
+
// src/components/hooks/useGrid.ts
|
|
3819
|
+
import { useMemo as useMemo3, useState as useState4 } from "react";
|
|
3820
|
+
|
|
3821
|
+
// src/components/utils/getObjectValue.ts
|
|
3822
|
+
function getObjectValue(obj) {
|
|
3823
|
+
return (prop) => prop.split(".").reduce((o, k) => o[k], obj);
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
// src/components/hooks/useFilter.ts
|
|
3827
|
+
import moment2 from "moment";
|
|
3828
|
+
import { useState as useState3 } from "react";
|
|
3829
|
+
function useFilter() {
|
|
3830
|
+
const [selectedFilters, setSelectedFilters] = useState3([]);
|
|
3831
|
+
const filterBy = (newFilter) => {
|
|
3832
|
+
const propToCompare = newFilter.id ? "id" : "prop";
|
|
3833
|
+
function removeRepeatedFilters(filter) {
|
|
3834
|
+
return filter[propToCompare] !== newFilter[propToCompare];
|
|
3835
|
+
}
|
|
3836
|
+
setSelectedFilters((filters) => [
|
|
3837
|
+
...filters.filter(removeRepeatedFilters),
|
|
3838
|
+
newFilter
|
|
3839
|
+
]);
|
|
3840
|
+
};
|
|
3841
|
+
const removeFilter = (prop, isId) => {
|
|
3842
|
+
const propToCompare = isId ? "id" : "prop";
|
|
3843
|
+
setSelectedFilters(
|
|
3844
|
+
selectedFilters.filter((filter) => filter[propToCompare] !== prop)
|
|
3845
|
+
);
|
|
3846
|
+
};
|
|
3847
|
+
function clearAllFilters() {
|
|
3848
|
+
setSelectedFilters([]);
|
|
3849
|
+
}
|
|
3850
|
+
return {
|
|
3851
|
+
filters: selectedFilters,
|
|
3852
|
+
filterBy,
|
|
3853
|
+
removeFilter,
|
|
3854
|
+
createFilter,
|
|
3855
|
+
clearAllFilters
|
|
3856
|
+
};
|
|
3857
|
+
}
|
|
3858
|
+
function isDate(date) {
|
|
3859
|
+
if (date instanceof Date)
|
|
3860
|
+
return true;
|
|
3861
|
+
else if (String(date).endsWith("Z"))
|
|
3862
|
+
return true;
|
|
3863
|
+
return false;
|
|
3864
|
+
}
|
|
3865
|
+
function compareFilter(item, filter) {
|
|
3866
|
+
const itemValue = getObjectValue(item)(filter.prop);
|
|
3867
|
+
switch (filter.compareType) {
|
|
3868
|
+
case "equal":
|
|
3869
|
+
return itemValue === filter.value;
|
|
3870
|
+
case "notEqual":
|
|
3871
|
+
return itemValue !== filter.value;
|
|
3872
|
+
case "in":
|
|
3873
|
+
return filter.value.includes(itemValue);
|
|
3874
|
+
case "notIn":
|
|
3875
|
+
return !filter.value.includes(itemValue);
|
|
3876
|
+
case "gte":
|
|
3877
|
+
return isDate(itemValue) ? moment2(String(itemValue)).isSameOrAfter(filter.value) : itemValue >= filter.value;
|
|
3878
|
+
case "gt":
|
|
3879
|
+
return isDate(itemValue) ? moment2(String(itemValue)).isAfter(filter.value) : itemValue > filter.value;
|
|
3880
|
+
case "lte":
|
|
3881
|
+
return isDate(itemValue) ? moment2(String(itemValue)).isSameOrBefore(filter.value) : itemValue <= filter.value;
|
|
3882
|
+
case "lt":
|
|
3883
|
+
return isDate(itemValue) ? moment2(String(itemValue)).isBefore(filter.value) : itemValue < filter.value;
|
|
3884
|
+
}
|
|
3885
|
+
}
|
|
3886
|
+
function createFilter(filters) {
|
|
3887
|
+
function apply(item) {
|
|
3888
|
+
const satisfiedFilters = filters.reduce((acc, filter) => {
|
|
3889
|
+
if (compareFilter(item, filter))
|
|
3890
|
+
acc += 1;
|
|
3891
|
+
return acc;
|
|
3892
|
+
}, 0);
|
|
3893
|
+
return satisfiedFilters === filters.length;
|
|
3894
|
+
}
|
|
3895
|
+
return {
|
|
3896
|
+
apply
|
|
3897
|
+
};
|
|
3898
|
+
}
|
|
3899
|
+
|
|
3900
|
+
// src/components/hooks/useGrid.ts
|
|
3901
|
+
function useGrid({
|
|
3902
|
+
columns,
|
|
3903
|
+
filters = [],
|
|
3904
|
+
search,
|
|
3905
|
+
rowsPerPageOptions = [30, 60, 100]
|
|
3906
|
+
}) {
|
|
3907
|
+
const [defaultData, setDefaultData] = useState4([]);
|
|
3908
|
+
const [sortedBy, setSortedBy] = useState4("");
|
|
3909
|
+
const [sortedDirection, setSortedDirection] = useState4("desc");
|
|
3910
|
+
const [currentPage, setCurrentPage] = useState4(0);
|
|
3911
|
+
const [rowsPerPage, setRowsPerPage] = useState4(rowsPerPageOptions[0]);
|
|
3912
|
+
const toggleSortedDirection = () => {
|
|
3913
|
+
if (sortedDirection === "desc")
|
|
3914
|
+
setSortedDirection("asc");
|
|
3915
|
+
if (sortedDirection === "asc")
|
|
3916
|
+
setSortedDirection("desc");
|
|
3917
|
+
};
|
|
3918
|
+
function setSort(prop, direction) {
|
|
3919
|
+
setSortedBy(prop);
|
|
3920
|
+
setSortedDirection(direction);
|
|
3921
|
+
}
|
|
3922
|
+
const onSortBy = (prop) => {
|
|
3923
|
+
if (!prop)
|
|
3924
|
+
return;
|
|
3925
|
+
if (prop === sortedBy) {
|
|
3926
|
+
if (sortedDirection === "asc") {
|
|
3927
|
+
toggleSortedDirection();
|
|
3928
|
+
setSortedBy("");
|
|
3929
|
+
} else
|
|
3930
|
+
toggleSortedDirection();
|
|
3931
|
+
} else {
|
|
3932
|
+
setSortedDirection("desc");
|
|
3933
|
+
setSortedBy(prop);
|
|
3934
|
+
}
|
|
3935
|
+
};
|
|
3936
|
+
const set = (data) => {
|
|
3937
|
+
setDefaultData(data);
|
|
3938
|
+
};
|
|
3939
|
+
function sortData(data) {
|
|
3940
|
+
if (sortedBy) {
|
|
3941
|
+
return data.sort((a, b) => {
|
|
3942
|
+
const rowValue = (row) => getObjectValue(row)(sortedBy);
|
|
3943
|
+
const compare = rowValue(b) > rowValue(a);
|
|
3944
|
+
if (sortedDirection === "desc")
|
|
3945
|
+
return compare ? 1 : -1;
|
|
3946
|
+
return compare ? -1 : 1;
|
|
3947
|
+
});
|
|
3948
|
+
} else
|
|
3949
|
+
return data;
|
|
3950
|
+
}
|
|
3951
|
+
const onPageChange = (pageNumber) => {
|
|
3952
|
+
if (pageNumber < 0)
|
|
3953
|
+
return;
|
|
3954
|
+
if (pageNumber > totalNumberOfPages)
|
|
3955
|
+
return;
|
|
3956
|
+
setCurrentPage(pageNumber);
|
|
3957
|
+
};
|
|
3958
|
+
const onChangeRowsPerPage = (rows) => {
|
|
3959
|
+
let totalNumberOfPages2 = Math.round(filteredData.length / rows) - 1;
|
|
3960
|
+
totalNumberOfPages2 = totalNumberOfPages2 <= 0 ? 0 : 1;
|
|
3961
|
+
if (currentPage > totalNumberOfPages2)
|
|
3962
|
+
setCurrentPage(totalNumberOfPages2);
|
|
3963
|
+
setRowsPerPage(rows);
|
|
3964
|
+
};
|
|
3965
|
+
const filteredData = useMemo3(() => {
|
|
3966
|
+
let newData = defaultData.slice(0);
|
|
3967
|
+
if (search && search.value !== "") {
|
|
3968
|
+
const searchBy = createSearch(search);
|
|
3969
|
+
newData = newData.filter(searchBy);
|
|
3970
|
+
}
|
|
3971
|
+
const newFilter = createFilter(filters);
|
|
3972
|
+
return newData.filter(newFilter.apply);
|
|
3973
|
+
}, [defaultData, filters, search]);
|
|
3974
|
+
const displayData = useMemo3(() => {
|
|
3975
|
+
const sortedData = sortData(filteredData);
|
|
3976
|
+
const startPage = currentPage * rowsPerPage;
|
|
3977
|
+
const endPage = startPage + rowsPerPage;
|
|
3978
|
+
return sortedData.slice(startPage, endPage);
|
|
3979
|
+
}, [sortedBy, sortedDirection, filteredData, currentPage, rowsPerPage]);
|
|
3980
|
+
const totalNumberOfPages = Math.ceil(filteredData.length / rowsPerPage) - 1;
|
|
3981
|
+
return {
|
|
3982
|
+
data: displayData,
|
|
3983
|
+
set,
|
|
3984
|
+
onSortBy,
|
|
3985
|
+
sortedBy,
|
|
3986
|
+
defaultData,
|
|
3987
|
+
sortedDirection,
|
|
3988
|
+
columns,
|
|
3989
|
+
currentPage,
|
|
3990
|
+
totalNumberOfPages: totalNumberOfPages < 0 ? 0 : totalNumberOfPages,
|
|
3991
|
+
onPageChange,
|
|
3992
|
+
setRowsPerPage: onChangeRowsPerPage,
|
|
3993
|
+
rowsPerPageOptions,
|
|
3994
|
+
rowsPerPage,
|
|
3995
|
+
setSort
|
|
3996
|
+
};
|
|
3997
|
+
}
|
|
3998
|
+
function searchKeysForValue(row, compare) {
|
|
3999
|
+
const rowKeys = Object.keys(row);
|
|
4000
|
+
let match = false;
|
|
4001
|
+
const isNumberOrString = (value) => ["number", "string"].includes(typeof value);
|
|
4002
|
+
for (const key of rowKeys) {
|
|
4003
|
+
const objValue = row[key];
|
|
4004
|
+
if (objValue) {
|
|
4005
|
+
if (Array.isArray(objValue))
|
|
4006
|
+
match = objValue.some(
|
|
4007
|
+
(obj) => isNumberOrString(obj) ? compare(obj) : searchKeysForValue(obj, compare)
|
|
4008
|
+
);
|
|
4009
|
+
else if (typeof objValue === "object")
|
|
4010
|
+
match = searchKeysForValue(objValue, compare);
|
|
4011
|
+
else
|
|
4012
|
+
match = compare(row[key]);
|
|
4013
|
+
if (match)
|
|
4014
|
+
return match;
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
4017
|
+
return match;
|
|
4018
|
+
}
|
|
4019
|
+
function createSearch(options) {
|
|
4020
|
+
const searchValue = options.caseSensitive ? options.value : String(options.value).toLowerCase();
|
|
4021
|
+
function compare(objValue) {
|
|
4022
|
+
const value = options.caseSensitive ? String(objValue) : String(objValue).toLowerCase();
|
|
4023
|
+
if (options.exact)
|
|
4024
|
+
return value === searchValue;
|
|
4025
|
+
return value.includes(searchValue);
|
|
4026
|
+
}
|
|
4027
|
+
return (row) => {
|
|
4028
|
+
const match = searchKeysForValue(row, compare);
|
|
4029
|
+
return match;
|
|
4030
|
+
};
|
|
4031
|
+
}
|
|
4032
|
+
|
|
4033
|
+
// src/components/hooks/useEvent.ts
|
|
4034
|
+
import { useEffect as useEffect5 } from "react";
|
|
4035
|
+
function useEvent(event, handler, passive = false) {
|
|
4036
|
+
useEffect5(() => {
|
|
4037
|
+
window.addEventListener(event, handler, passive);
|
|
4038
|
+
return function cleanup() {
|
|
4039
|
+
window.removeEventListener(event, handler);
|
|
4040
|
+
};
|
|
4041
|
+
});
|
|
4042
|
+
}
|
|
4043
|
+
|
|
4044
|
+
// src/components/hooks/useLoading.ts
|
|
4045
|
+
import { useState as useState5 } from "react";
|
|
4046
|
+
function useLoading() {
|
|
4047
|
+
const [state, setState] = useState5([]);
|
|
4048
|
+
const isLoading = (prop) => state.includes(prop);
|
|
4049
|
+
const setLoading = (prop, remove) => {
|
|
4050
|
+
if (remove)
|
|
4051
|
+
setState((prevState) => prevState.filter((state2) => state2 !== prop));
|
|
4052
|
+
else
|
|
4053
|
+
setState((prevState) => [...prevState, prop]);
|
|
4054
|
+
};
|
|
4055
|
+
return { isLoading, setLoading };
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
// src/components/Modal/index.tsx
|
|
4059
|
+
import React25 from "react";
|
|
4060
|
+
import {
|
|
4061
|
+
Box as Box4,
|
|
4062
|
+
Modal as MuiModal
|
|
4063
|
+
} from "@mui/material";
|
|
4064
|
+
var Modal = (_a) => {
|
|
4065
|
+
var _b = _a, { open, onClose } = _b, rest = __objRest(_b, ["open", "onClose"]);
|
|
4066
|
+
return /* @__PURE__ */ React25.createElement(MuiModal, __spreadValues({ open, onClose, disableEnforceFocus: true }, rest), /* @__PURE__ */ React25.createElement(
|
|
4067
|
+
Box4,
|
|
4068
|
+
{
|
|
4069
|
+
sx: {
|
|
4070
|
+
outline: "none",
|
|
4071
|
+
backgroundColor: "white",
|
|
4072
|
+
position: "absolute",
|
|
4073
|
+
top: "50%",
|
|
4074
|
+
left: "50%",
|
|
4075
|
+
transform: "translate(-50%, -50%)",
|
|
4076
|
+
borderRadius: 1
|
|
4077
|
+
}
|
|
4078
|
+
},
|
|
4079
|
+
/* @__PURE__ */ React25.createElement(React25.Fragment, null, rest.children)
|
|
4080
|
+
));
|
|
4081
|
+
};
|
|
4082
|
+
|
|
4083
|
+
// src/components/utils/GetInputLabel.ts
|
|
4084
|
+
function GetInputLabel(columns) {
|
|
4085
|
+
return (columnName) => {
|
|
4086
|
+
const column = columns.find((column2) => column2.name === columnName);
|
|
4087
|
+
return { label: column.label, name: column.name };
|
|
4088
|
+
};
|
|
4089
|
+
}
|
|
4090
|
+
|
|
4091
|
+
// src/components/Dialog/index.tsx
|
|
4092
|
+
import React26 from "react";
|
|
4093
|
+
import {
|
|
4094
|
+
Box as Box5,
|
|
4095
|
+
Dialog as DefaultDialog,
|
|
4096
|
+
DialogContentText,
|
|
4097
|
+
DialogActions,
|
|
4098
|
+
DialogTitle,
|
|
4099
|
+
Button as Button3,
|
|
4100
|
+
CircularProgress as CircularProgress2
|
|
4101
|
+
} from "@mui/material";
|
|
4102
|
+
var Dialog = (_a) => {
|
|
4103
|
+
var _b = _a, {
|
|
4104
|
+
open,
|
|
4105
|
+
title,
|
|
4106
|
+
loading,
|
|
4107
|
+
body,
|
|
4108
|
+
options
|
|
4109
|
+
} = _b, rest = __objRest(_b, [
|
|
4110
|
+
"open",
|
|
4111
|
+
"title",
|
|
4112
|
+
"loading",
|
|
4113
|
+
"body",
|
|
4114
|
+
"options"
|
|
4115
|
+
]);
|
|
4116
|
+
return /* @__PURE__ */ React26.createElement(DefaultDialog, __spreadValues({ open }, rest), /* @__PURE__ */ React26.createElement(Box5, { sx: { p: 2 } }, /* @__PURE__ */ React26.createElement(DialogTitle, { sx: { fontWeight: "bold" } }, title), /* @__PURE__ */ React26.createElement(DialogContentText, { sx: { px: "10px", textAlign: "center", mb: 2 } }, body), /* @__PURE__ */ React26.createElement(DialogActions, null, options.map((option, index) => {
|
|
4117
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4118
|
+
Button3,
|
|
4119
|
+
{
|
|
4120
|
+
key: index,
|
|
4121
|
+
onClick: () => option.cb(option.label),
|
|
4122
|
+
variant: option.focus ? "contained" : "text",
|
|
4123
|
+
sx: {
|
|
4124
|
+
fontWeight: option.focus ? "bold" : "normal",
|
|
4125
|
+
color: option.focus ? "#fff" : "primary.main"
|
|
4126
|
+
},
|
|
4127
|
+
disableElevation: true,
|
|
4128
|
+
disabled: loading
|
|
4129
|
+
},
|
|
4130
|
+
loading && option.focus ? /* @__PURE__ */ React26.createElement(CircularProgress2, { size: 25, color: "inherit" }) : /* @__PURE__ */ React26.createElement(React26.Fragment, null, option.label)
|
|
4131
|
+
);
|
|
4132
|
+
}))));
|
|
4133
|
+
};
|
|
4134
|
+
export {
|
|
4135
|
+
Autocomplete2 as Autocomplete,
|
|
4136
|
+
BaseGrid,
|
|
4137
|
+
Checkbox,
|
|
4138
|
+
Dialog,
|
|
4139
|
+
EditableTableCell,
|
|
4140
|
+
GetInputLabel,
|
|
4141
|
+
Grid_default as Grid,
|
|
4142
|
+
Input,
|
|
4143
|
+
InputMask2 as InputMask,
|
|
4144
|
+
LargeButton,
|
|
4145
|
+
Modal,
|
|
4146
|
+
Radio,
|
|
4147
|
+
Select,
|
|
4148
|
+
Switch,
|
|
4149
|
+
TabPanel,
|
|
4150
|
+
Td,
|
|
4151
|
+
Tr,
|
|
4152
|
+
createFilter,
|
|
4153
|
+
filterData,
|
|
4154
|
+
getTabProps,
|
|
4155
|
+
useEvent,
|
|
4156
|
+
useFilter,
|
|
4157
|
+
useGrid,
|
|
4158
|
+
useLoading
|
|
4159
|
+
};
|
|
4160
|
+
/*! Bundled license information:
|
|
4161
|
+
|
|
4162
|
+
react-is/cjs/react-is.production.min.js:
|
|
4163
|
+
(** @license React v16.13.1
|
|
4164
|
+
* react-is.production.min.js
|
|
4165
|
+
*
|
|
4166
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4167
|
+
*
|
|
4168
|
+
* This source code is licensed under the MIT license found in the
|
|
4169
|
+
* LICENSE file in the root directory of this source tree.
|
|
4170
|
+
*)
|
|
4171
|
+
|
|
4172
|
+
react-is/cjs/react-is.development.js:
|
|
4173
|
+
(** @license React v16.13.1
|
|
4174
|
+
* react-is.development.js
|
|
4175
|
+
*
|
|
4176
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4177
|
+
*
|
|
4178
|
+
* This source code is licensed under the MIT license found in the
|
|
4179
|
+
* LICENSE file in the root directory of this source tree.
|
|
4180
|
+
*)
|
|
4181
|
+
|
|
4182
|
+
object-assign/index.js:
|
|
4183
|
+
(*
|
|
4184
|
+
object-assign
|
|
4185
|
+
(c) Sindre Sorhus
|
|
4186
|
+
@license MIT
|
|
4187
|
+
*)
|
|
4188
|
+
|
|
4189
|
+
@mui/styled-engine/index.js:
|
|
4190
|
+
(** @license MUI v5.11.0
|
|
4191
|
+
*
|
|
4192
|
+
* This source code is licensed under the MIT license found in the
|
|
4193
|
+
* LICENSE file in the root directory of this source tree.
|
|
4194
|
+
*)
|
|
4195
|
+
|
|
4196
|
+
@mui/private-theming/index.js:
|
|
4197
|
+
(** @license MUI v5.11.1
|
|
4198
|
+
*
|
|
4199
|
+
* This source code is licensed under the MIT license found in the
|
|
4200
|
+
* LICENSE file in the root directory of this source tree.
|
|
4201
|
+
*)
|
|
4202
|
+
*/
|
|
4203
|
+
//# sourceMappingURL=index.mjs.map
|