datasync-dynamic-form 1.1.17 → 1.1.19
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.mts +155 -0
- package/dist/index.d.ts +155 -0
- package/dist/index.js +3415 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3401 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +13 -6
- package/dist/components/DsDynamicForm.js +0 -816
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3401 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
var __async = (__this, __arguments, generator) => {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
var fulfilled = (value) => {
|
|
29
|
+
try {
|
|
30
|
+
step(generator.next(value));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
reject(e);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var rejected = (value) => {
|
|
36
|
+
try {
|
|
37
|
+
step(generator.throw(value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
43
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
48
|
+
var require_react_is_production_min = __commonJS({
|
|
49
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
50
|
+
"use strict";
|
|
51
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
|
52
|
+
var c = b ? Symbol.for("react.element") : 60103;
|
|
53
|
+
var d = b ? Symbol.for("react.portal") : 60106;
|
|
54
|
+
var e = b ? Symbol.for("react.fragment") : 60107;
|
|
55
|
+
var f = b ? Symbol.for("react.strict_mode") : 60108;
|
|
56
|
+
var g = b ? Symbol.for("react.profiler") : 60114;
|
|
57
|
+
var h = b ? Symbol.for("react.provider") : 60109;
|
|
58
|
+
var k = b ? Symbol.for("react.context") : 60110;
|
|
59
|
+
var l = b ? Symbol.for("react.async_mode") : 60111;
|
|
60
|
+
var m = b ? Symbol.for("react.concurrent_mode") : 60111;
|
|
61
|
+
var n = b ? Symbol.for("react.forward_ref") : 60112;
|
|
62
|
+
var p = b ? Symbol.for("react.suspense") : 60113;
|
|
63
|
+
var q = b ? Symbol.for("react.suspense_list") : 60120;
|
|
64
|
+
var r = b ? Symbol.for("react.memo") : 60115;
|
|
65
|
+
var t = b ? Symbol.for("react.lazy") : 60116;
|
|
66
|
+
var v = b ? Symbol.for("react.block") : 60121;
|
|
67
|
+
var w = b ? Symbol.for("react.fundamental") : 60117;
|
|
68
|
+
var x = b ? Symbol.for("react.responder") : 60118;
|
|
69
|
+
var y = b ? Symbol.for("react.scope") : 60119;
|
|
70
|
+
function z(a) {
|
|
71
|
+
if ("object" === typeof a && null !== a) {
|
|
72
|
+
var u = a.$$typeof;
|
|
73
|
+
switch (u) {
|
|
74
|
+
case c:
|
|
75
|
+
switch (a = a.type, a) {
|
|
76
|
+
case l:
|
|
77
|
+
case m:
|
|
78
|
+
case e:
|
|
79
|
+
case g:
|
|
80
|
+
case f:
|
|
81
|
+
case p:
|
|
82
|
+
return a;
|
|
83
|
+
default:
|
|
84
|
+
switch (a = a && a.$$typeof, a) {
|
|
85
|
+
case k:
|
|
86
|
+
case n:
|
|
87
|
+
case t:
|
|
88
|
+
case r:
|
|
89
|
+
case h:
|
|
90
|
+
return a;
|
|
91
|
+
default:
|
|
92
|
+
return u;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
case d:
|
|
96
|
+
return u;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function A(a) {
|
|
101
|
+
return z(a) === m;
|
|
102
|
+
}
|
|
103
|
+
exports.AsyncMode = l;
|
|
104
|
+
exports.ConcurrentMode = m;
|
|
105
|
+
exports.ContextConsumer = k;
|
|
106
|
+
exports.ContextProvider = h;
|
|
107
|
+
exports.Element = c;
|
|
108
|
+
exports.ForwardRef = n;
|
|
109
|
+
exports.Fragment = e;
|
|
110
|
+
exports.Lazy = t;
|
|
111
|
+
exports.Memo = r;
|
|
112
|
+
exports.Portal = d;
|
|
113
|
+
exports.Profiler = g;
|
|
114
|
+
exports.StrictMode = f;
|
|
115
|
+
exports.Suspense = p;
|
|
116
|
+
exports.isAsyncMode = function(a) {
|
|
117
|
+
return A(a) || z(a) === l;
|
|
118
|
+
};
|
|
119
|
+
exports.isConcurrentMode = A;
|
|
120
|
+
exports.isContextConsumer = function(a) {
|
|
121
|
+
return z(a) === k;
|
|
122
|
+
};
|
|
123
|
+
exports.isContextProvider = function(a) {
|
|
124
|
+
return z(a) === h;
|
|
125
|
+
};
|
|
126
|
+
exports.isElement = function(a) {
|
|
127
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
128
|
+
};
|
|
129
|
+
exports.isForwardRef = function(a) {
|
|
130
|
+
return z(a) === n;
|
|
131
|
+
};
|
|
132
|
+
exports.isFragment = function(a) {
|
|
133
|
+
return z(a) === e;
|
|
134
|
+
};
|
|
135
|
+
exports.isLazy = function(a) {
|
|
136
|
+
return z(a) === t;
|
|
137
|
+
};
|
|
138
|
+
exports.isMemo = function(a) {
|
|
139
|
+
return z(a) === r;
|
|
140
|
+
};
|
|
141
|
+
exports.isPortal = function(a) {
|
|
142
|
+
return z(a) === d;
|
|
143
|
+
};
|
|
144
|
+
exports.isProfiler = function(a) {
|
|
145
|
+
return z(a) === g;
|
|
146
|
+
};
|
|
147
|
+
exports.isStrictMode = function(a) {
|
|
148
|
+
return z(a) === f;
|
|
149
|
+
};
|
|
150
|
+
exports.isSuspense = function(a) {
|
|
151
|
+
return z(a) === p;
|
|
152
|
+
};
|
|
153
|
+
exports.isValidElementType = function(a) {
|
|
154
|
+
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 === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
155
|
+
};
|
|
156
|
+
exports.typeOf = z;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
161
|
+
var require_react_is_development = __commonJS({
|
|
162
|
+
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
163
|
+
"use strict";
|
|
164
|
+
if (process.env.NODE_ENV !== "production") {
|
|
165
|
+
(function() {
|
|
166
|
+
"use strict";
|
|
167
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
168
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
169
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
170
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
171
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
172
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
173
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
174
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
175
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
176
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
177
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
178
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
179
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
180
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
181
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
182
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
183
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
184
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
185
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
186
|
+
function isValidElementType(type) {
|
|
187
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
188
|
+
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);
|
|
189
|
+
}
|
|
190
|
+
function typeOf(object) {
|
|
191
|
+
if (typeof object === "object" && object !== null) {
|
|
192
|
+
var $$typeof = object.$$typeof;
|
|
193
|
+
switch ($$typeof) {
|
|
194
|
+
case REACT_ELEMENT_TYPE:
|
|
195
|
+
var type = object.type;
|
|
196
|
+
switch (type) {
|
|
197
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
198
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
199
|
+
case REACT_FRAGMENT_TYPE:
|
|
200
|
+
case REACT_PROFILER_TYPE:
|
|
201
|
+
case REACT_STRICT_MODE_TYPE:
|
|
202
|
+
case REACT_SUSPENSE_TYPE:
|
|
203
|
+
return type;
|
|
204
|
+
default:
|
|
205
|
+
var $$typeofType = type && type.$$typeof;
|
|
206
|
+
switch ($$typeofType) {
|
|
207
|
+
case REACT_CONTEXT_TYPE:
|
|
208
|
+
case REACT_FORWARD_REF_TYPE:
|
|
209
|
+
case REACT_LAZY_TYPE:
|
|
210
|
+
case REACT_MEMO_TYPE:
|
|
211
|
+
case REACT_PROVIDER_TYPE:
|
|
212
|
+
return $$typeofType;
|
|
213
|
+
default:
|
|
214
|
+
return $$typeof;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
case REACT_PORTAL_TYPE:
|
|
218
|
+
return $$typeof;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return void 0;
|
|
222
|
+
}
|
|
223
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
224
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
225
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
226
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
227
|
+
var Element2 = REACT_ELEMENT_TYPE;
|
|
228
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
229
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
230
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
231
|
+
var Memo = REACT_MEMO_TYPE;
|
|
232
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
233
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
234
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
235
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
236
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
237
|
+
function isAsyncMode(object) {
|
|
238
|
+
{
|
|
239
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
240
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
241
|
+
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.");
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
245
|
+
}
|
|
246
|
+
function isConcurrentMode(object) {
|
|
247
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
248
|
+
}
|
|
249
|
+
function isContextConsumer(object) {
|
|
250
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
251
|
+
}
|
|
252
|
+
function isContextProvider(object) {
|
|
253
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
254
|
+
}
|
|
255
|
+
function isElement(object) {
|
|
256
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
257
|
+
}
|
|
258
|
+
function isForwardRef(object) {
|
|
259
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
260
|
+
}
|
|
261
|
+
function isFragment(object) {
|
|
262
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
263
|
+
}
|
|
264
|
+
function isLazy(object) {
|
|
265
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
266
|
+
}
|
|
267
|
+
function isMemo(object) {
|
|
268
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
269
|
+
}
|
|
270
|
+
function isPortal(object) {
|
|
271
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
272
|
+
}
|
|
273
|
+
function isProfiler(object) {
|
|
274
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
275
|
+
}
|
|
276
|
+
function isStrictMode(object) {
|
|
277
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
278
|
+
}
|
|
279
|
+
function isSuspense(object) {
|
|
280
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
281
|
+
}
|
|
282
|
+
exports.AsyncMode = AsyncMode;
|
|
283
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
284
|
+
exports.ContextConsumer = ContextConsumer;
|
|
285
|
+
exports.ContextProvider = ContextProvider;
|
|
286
|
+
exports.Element = Element2;
|
|
287
|
+
exports.ForwardRef = ForwardRef;
|
|
288
|
+
exports.Fragment = Fragment2;
|
|
289
|
+
exports.Lazy = Lazy;
|
|
290
|
+
exports.Memo = Memo;
|
|
291
|
+
exports.Portal = Portal;
|
|
292
|
+
exports.Profiler = Profiler;
|
|
293
|
+
exports.StrictMode = StrictMode;
|
|
294
|
+
exports.Suspense = Suspense;
|
|
295
|
+
exports.isAsyncMode = isAsyncMode;
|
|
296
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
297
|
+
exports.isContextConsumer = isContextConsumer;
|
|
298
|
+
exports.isContextProvider = isContextProvider;
|
|
299
|
+
exports.isElement = isElement;
|
|
300
|
+
exports.isForwardRef = isForwardRef;
|
|
301
|
+
exports.isFragment = isFragment;
|
|
302
|
+
exports.isLazy = isLazy;
|
|
303
|
+
exports.isMemo = isMemo;
|
|
304
|
+
exports.isPortal = isPortal;
|
|
305
|
+
exports.isProfiler = isProfiler;
|
|
306
|
+
exports.isStrictMode = isStrictMode;
|
|
307
|
+
exports.isSuspense = isSuspense;
|
|
308
|
+
exports.isValidElementType = isValidElementType;
|
|
309
|
+
exports.typeOf = typeOf;
|
|
310
|
+
})();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// node_modules/prop-types/node_modules/react-is/index.js
|
|
316
|
+
var require_react_is = __commonJS({
|
|
317
|
+
"node_modules/prop-types/node_modules/react-is/index.js"(exports, module) {
|
|
318
|
+
"use strict";
|
|
319
|
+
if (process.env.NODE_ENV === "production") {
|
|
320
|
+
module.exports = require_react_is_production_min();
|
|
321
|
+
} else {
|
|
322
|
+
module.exports = require_react_is_development();
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
// node_modules/object-assign/index.js
|
|
328
|
+
var require_object_assign = __commonJS({
|
|
329
|
+
"node_modules/object-assign/index.js"(exports, module) {
|
|
330
|
+
"use strict";
|
|
331
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
332
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
333
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
334
|
+
function toObject(val) {
|
|
335
|
+
if (val === null || val === void 0) {
|
|
336
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
337
|
+
}
|
|
338
|
+
return Object(val);
|
|
339
|
+
}
|
|
340
|
+
function shouldUseNative() {
|
|
341
|
+
try {
|
|
342
|
+
if (!Object.assign) {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
var test1 = new String("abc");
|
|
346
|
+
test1[5] = "de";
|
|
347
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
var test2 = {};
|
|
351
|
+
for (var i = 0; i < 10; i++) {
|
|
352
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
353
|
+
}
|
|
354
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
355
|
+
return test2[n];
|
|
356
|
+
});
|
|
357
|
+
if (order2.join("") !== "0123456789") {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
var test3 = {};
|
|
361
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
362
|
+
test3[letter] = letter;
|
|
363
|
+
});
|
|
364
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
return true;
|
|
368
|
+
} catch (err) {
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
373
|
+
var from;
|
|
374
|
+
var to = toObject(target);
|
|
375
|
+
var symbols;
|
|
376
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
377
|
+
from = Object(arguments[s]);
|
|
378
|
+
for (var key in from) {
|
|
379
|
+
if (hasOwnProperty.call(from, key)) {
|
|
380
|
+
to[key] = from[key];
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (getOwnPropertySymbols) {
|
|
384
|
+
symbols = getOwnPropertySymbols(from);
|
|
385
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
386
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
387
|
+
to[symbols[i]] = from[symbols[i]];
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return to;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
398
|
+
var require_ReactPropTypesSecret = __commonJS({
|
|
399
|
+
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
|
|
400
|
+
"use strict";
|
|
401
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
402
|
+
module.exports = ReactPropTypesSecret;
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
// node_modules/prop-types/lib/has.js
|
|
407
|
+
var require_has = __commonJS({
|
|
408
|
+
"node_modules/prop-types/lib/has.js"(exports, module) {
|
|
409
|
+
"use strict";
|
|
410
|
+
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
// node_modules/prop-types/checkPropTypes.js
|
|
415
|
+
var require_checkPropTypes = __commonJS({
|
|
416
|
+
"node_modules/prop-types/checkPropTypes.js"(exports, module) {
|
|
417
|
+
"use strict";
|
|
418
|
+
var printWarning = function() {
|
|
419
|
+
};
|
|
420
|
+
if (process.env.NODE_ENV !== "production") {
|
|
421
|
+
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
422
|
+
loggedTypeFailures = {};
|
|
423
|
+
has = require_has();
|
|
424
|
+
printWarning = function(text) {
|
|
425
|
+
var message = "Warning: " + text;
|
|
426
|
+
if (typeof console !== "undefined") {
|
|
427
|
+
console.error(message);
|
|
428
|
+
}
|
|
429
|
+
try {
|
|
430
|
+
throw new Error(message);
|
|
431
|
+
} catch (x) {
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
var ReactPropTypesSecret;
|
|
436
|
+
var loggedTypeFailures;
|
|
437
|
+
var has;
|
|
438
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
439
|
+
if (process.env.NODE_ENV !== "production") {
|
|
440
|
+
for (var typeSpecName in typeSpecs) {
|
|
441
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
442
|
+
var error;
|
|
443
|
+
try {
|
|
444
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
445
|
+
var err = Error(
|
|
446
|
+
(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`."
|
|
447
|
+
);
|
|
448
|
+
err.name = "Invariant Violation";
|
|
449
|
+
throw err;
|
|
450
|
+
}
|
|
451
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
452
|
+
} catch (ex) {
|
|
453
|
+
error = ex;
|
|
454
|
+
}
|
|
455
|
+
if (error && !(error instanceof Error)) {
|
|
456
|
+
printWarning(
|
|
457
|
+
(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)."
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
461
|
+
loggedTypeFailures[error.message] = true;
|
|
462
|
+
var stack = getStack ? getStack() : "";
|
|
463
|
+
printWarning(
|
|
464
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
checkPropTypes.resetWarningCache = function() {
|
|
472
|
+
if (process.env.NODE_ENV !== "production") {
|
|
473
|
+
loggedTypeFailures = {};
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
module.exports = checkPropTypes;
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
481
|
+
var require_factoryWithTypeCheckers = __commonJS({
|
|
482
|
+
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
|
|
483
|
+
"use strict";
|
|
484
|
+
var ReactIs = require_react_is();
|
|
485
|
+
var assign = require_object_assign();
|
|
486
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
487
|
+
var has = require_has();
|
|
488
|
+
var checkPropTypes = require_checkPropTypes();
|
|
489
|
+
var printWarning = function() {
|
|
490
|
+
};
|
|
491
|
+
if (process.env.NODE_ENV !== "production") {
|
|
492
|
+
printWarning = function(text) {
|
|
493
|
+
var message = "Warning: " + text;
|
|
494
|
+
if (typeof console !== "undefined") {
|
|
495
|
+
console.error(message);
|
|
496
|
+
}
|
|
497
|
+
try {
|
|
498
|
+
throw new Error(message);
|
|
499
|
+
} catch (x) {
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
function emptyFunctionThatReturnsNull() {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
507
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
508
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
509
|
+
function getIteratorFn(maybeIterable) {
|
|
510
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
511
|
+
if (typeof iteratorFn === "function") {
|
|
512
|
+
return iteratorFn;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
516
|
+
var ReactPropTypes = {
|
|
517
|
+
array: createPrimitiveTypeChecker("array"),
|
|
518
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
519
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
520
|
+
func: createPrimitiveTypeChecker("function"),
|
|
521
|
+
number: createPrimitiveTypeChecker("number"),
|
|
522
|
+
object: createPrimitiveTypeChecker("object"),
|
|
523
|
+
string: createPrimitiveTypeChecker("string"),
|
|
524
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
525
|
+
any: createAnyTypeChecker(),
|
|
526
|
+
arrayOf: createArrayOfTypeChecker,
|
|
527
|
+
element: createElementTypeChecker(),
|
|
528
|
+
elementType: createElementTypeTypeChecker(),
|
|
529
|
+
instanceOf: createInstanceTypeChecker,
|
|
530
|
+
node: createNodeChecker(),
|
|
531
|
+
objectOf: createObjectOfTypeChecker,
|
|
532
|
+
oneOf: createEnumTypeChecker,
|
|
533
|
+
oneOfType: createUnionTypeChecker,
|
|
534
|
+
shape: createShapeTypeChecker,
|
|
535
|
+
exact: createStrictShapeTypeChecker
|
|
536
|
+
};
|
|
537
|
+
function is(x, y) {
|
|
538
|
+
if (x === y) {
|
|
539
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
540
|
+
} else {
|
|
541
|
+
return x !== x && y !== y;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
function PropTypeError(message, data) {
|
|
545
|
+
this.message = message;
|
|
546
|
+
this.data = data && typeof data === "object" ? data : {};
|
|
547
|
+
this.stack = "";
|
|
548
|
+
}
|
|
549
|
+
PropTypeError.prototype = Error.prototype;
|
|
550
|
+
function createChainableTypeChecker(validate) {
|
|
551
|
+
if (process.env.NODE_ENV !== "production") {
|
|
552
|
+
var manualPropTypeCallCache = {};
|
|
553
|
+
var manualPropTypeWarningCount = 0;
|
|
554
|
+
}
|
|
555
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
556
|
+
componentName = componentName || ANONYMOUS;
|
|
557
|
+
propFullName = propFullName || propName;
|
|
558
|
+
if (secret !== ReactPropTypesSecret) {
|
|
559
|
+
if (throwOnDirectAccess) {
|
|
560
|
+
var err = new Error(
|
|
561
|
+
"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"
|
|
562
|
+
);
|
|
563
|
+
err.name = "Invariant Violation";
|
|
564
|
+
throw err;
|
|
565
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
566
|
+
var cacheKey = componentName + ":" + propName;
|
|
567
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
568
|
+
manualPropTypeWarningCount < 3) {
|
|
569
|
+
printWarning(
|
|
570
|
+
"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."
|
|
571
|
+
);
|
|
572
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
573
|
+
manualPropTypeWarningCount++;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
if (props[propName] == null) {
|
|
578
|
+
if (isRequired) {
|
|
579
|
+
if (props[propName] === null) {
|
|
580
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
581
|
+
}
|
|
582
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
583
|
+
}
|
|
584
|
+
return null;
|
|
585
|
+
} else {
|
|
586
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
590
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
591
|
+
return chainedCheckType;
|
|
592
|
+
}
|
|
593
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
594
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
595
|
+
var propValue = props[propName];
|
|
596
|
+
var propType = getPropType(propValue);
|
|
597
|
+
if (propType !== expectedType) {
|
|
598
|
+
var preciseType = getPreciseType(propValue);
|
|
599
|
+
return new PropTypeError(
|
|
600
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
601
|
+
{ expectedType }
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
return null;
|
|
605
|
+
}
|
|
606
|
+
return createChainableTypeChecker(validate);
|
|
607
|
+
}
|
|
608
|
+
function createAnyTypeChecker() {
|
|
609
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
610
|
+
}
|
|
611
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
612
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
613
|
+
if (typeof typeChecker !== "function") {
|
|
614
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
615
|
+
}
|
|
616
|
+
var propValue = props[propName];
|
|
617
|
+
if (!Array.isArray(propValue)) {
|
|
618
|
+
var propType = getPropType(propValue);
|
|
619
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
620
|
+
}
|
|
621
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
622
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
623
|
+
if (error instanceof Error) {
|
|
624
|
+
return error;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
return createChainableTypeChecker(validate);
|
|
630
|
+
}
|
|
631
|
+
function createElementTypeChecker() {
|
|
632
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
633
|
+
var propValue = props[propName];
|
|
634
|
+
if (!isValidElement(propValue)) {
|
|
635
|
+
var propType = getPropType(propValue);
|
|
636
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
637
|
+
}
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
return createChainableTypeChecker(validate);
|
|
641
|
+
}
|
|
642
|
+
function createElementTypeTypeChecker() {
|
|
643
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
644
|
+
var propValue = props[propName];
|
|
645
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
646
|
+
var propType = getPropType(propValue);
|
|
647
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
648
|
+
}
|
|
649
|
+
return null;
|
|
650
|
+
}
|
|
651
|
+
return createChainableTypeChecker(validate);
|
|
652
|
+
}
|
|
653
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
654
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
655
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
656
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
657
|
+
var actualClassName = getClassName(props[propName]);
|
|
658
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
659
|
+
}
|
|
660
|
+
return null;
|
|
661
|
+
}
|
|
662
|
+
return createChainableTypeChecker(validate);
|
|
663
|
+
}
|
|
664
|
+
function createEnumTypeChecker(expectedValues) {
|
|
665
|
+
if (!Array.isArray(expectedValues)) {
|
|
666
|
+
if (process.env.NODE_ENV !== "production") {
|
|
667
|
+
if (arguments.length > 1) {
|
|
668
|
+
printWarning(
|
|
669
|
+
"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])."
|
|
670
|
+
);
|
|
671
|
+
} else {
|
|
672
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return emptyFunctionThatReturnsNull;
|
|
676
|
+
}
|
|
677
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
678
|
+
var propValue = props[propName];
|
|
679
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
680
|
+
if (is(propValue, expectedValues[i])) {
|
|
681
|
+
return null;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
685
|
+
var type = getPreciseType(value);
|
|
686
|
+
if (type === "symbol") {
|
|
687
|
+
return String(value);
|
|
688
|
+
}
|
|
689
|
+
return value;
|
|
690
|
+
});
|
|
691
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
692
|
+
}
|
|
693
|
+
return createChainableTypeChecker(validate);
|
|
694
|
+
}
|
|
695
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
696
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
697
|
+
if (typeof typeChecker !== "function") {
|
|
698
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
699
|
+
}
|
|
700
|
+
var propValue = props[propName];
|
|
701
|
+
var propType = getPropType(propValue);
|
|
702
|
+
if (propType !== "object") {
|
|
703
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
704
|
+
}
|
|
705
|
+
for (var key in propValue) {
|
|
706
|
+
if (has(propValue, key)) {
|
|
707
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
708
|
+
if (error instanceof Error) {
|
|
709
|
+
return error;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return null;
|
|
714
|
+
}
|
|
715
|
+
return createChainableTypeChecker(validate);
|
|
716
|
+
}
|
|
717
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
718
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
719
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
720
|
+
return emptyFunctionThatReturnsNull;
|
|
721
|
+
}
|
|
722
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
723
|
+
var checker = arrayOfTypeCheckers[i];
|
|
724
|
+
if (typeof checker !== "function") {
|
|
725
|
+
printWarning(
|
|
726
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
727
|
+
);
|
|
728
|
+
return emptyFunctionThatReturnsNull;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
732
|
+
var expectedTypes = [];
|
|
733
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
734
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
735
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
736
|
+
if (checkerResult == null) {
|
|
737
|
+
return null;
|
|
738
|
+
}
|
|
739
|
+
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
740
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
744
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
745
|
+
}
|
|
746
|
+
return createChainableTypeChecker(validate);
|
|
747
|
+
}
|
|
748
|
+
function createNodeChecker() {
|
|
749
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
750
|
+
if (!isNode(props[propName])) {
|
|
751
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
752
|
+
}
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
return createChainableTypeChecker(validate);
|
|
756
|
+
}
|
|
757
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
758
|
+
return new PropTypeError(
|
|
759
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
760
|
+
);
|
|
761
|
+
}
|
|
762
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
763
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
764
|
+
var propValue = props[propName];
|
|
765
|
+
var propType = getPropType(propValue);
|
|
766
|
+
if (propType !== "object") {
|
|
767
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
768
|
+
}
|
|
769
|
+
for (var key in shapeTypes) {
|
|
770
|
+
var checker = shapeTypes[key];
|
|
771
|
+
if (typeof checker !== "function") {
|
|
772
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
773
|
+
}
|
|
774
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
775
|
+
if (error) {
|
|
776
|
+
return error;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
return null;
|
|
780
|
+
}
|
|
781
|
+
return createChainableTypeChecker(validate);
|
|
782
|
+
}
|
|
783
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
784
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
785
|
+
var propValue = props[propName];
|
|
786
|
+
var propType = getPropType(propValue);
|
|
787
|
+
if (propType !== "object") {
|
|
788
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
789
|
+
}
|
|
790
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
791
|
+
for (var key in allKeys) {
|
|
792
|
+
var checker = shapeTypes[key];
|
|
793
|
+
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
794
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
795
|
+
}
|
|
796
|
+
if (!checker) {
|
|
797
|
+
return new PropTypeError(
|
|
798
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
799
|
+
);
|
|
800
|
+
}
|
|
801
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
802
|
+
if (error) {
|
|
803
|
+
return error;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return null;
|
|
807
|
+
}
|
|
808
|
+
return createChainableTypeChecker(validate);
|
|
809
|
+
}
|
|
810
|
+
function isNode(propValue) {
|
|
811
|
+
switch (typeof propValue) {
|
|
812
|
+
case "number":
|
|
813
|
+
case "string":
|
|
814
|
+
case "undefined":
|
|
815
|
+
return true;
|
|
816
|
+
case "boolean":
|
|
817
|
+
return !propValue;
|
|
818
|
+
case "object":
|
|
819
|
+
if (Array.isArray(propValue)) {
|
|
820
|
+
return propValue.every(isNode);
|
|
821
|
+
}
|
|
822
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
823
|
+
return true;
|
|
824
|
+
}
|
|
825
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
826
|
+
if (iteratorFn) {
|
|
827
|
+
var iterator = iteratorFn.call(propValue);
|
|
828
|
+
var step;
|
|
829
|
+
if (iteratorFn !== propValue.entries) {
|
|
830
|
+
while (!(step = iterator.next()).done) {
|
|
831
|
+
if (!isNode(step.value)) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
} else {
|
|
836
|
+
while (!(step = iterator.next()).done) {
|
|
837
|
+
var entry = step.value;
|
|
838
|
+
if (entry) {
|
|
839
|
+
if (!isNode(entry[1])) {
|
|
840
|
+
return false;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
} else {
|
|
846
|
+
return false;
|
|
847
|
+
}
|
|
848
|
+
return true;
|
|
849
|
+
default:
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
function isSymbol(propType, propValue) {
|
|
854
|
+
if (propType === "symbol") {
|
|
855
|
+
return true;
|
|
856
|
+
}
|
|
857
|
+
if (!propValue) {
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
861
|
+
return true;
|
|
862
|
+
}
|
|
863
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
864
|
+
return true;
|
|
865
|
+
}
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
function getPropType(propValue) {
|
|
869
|
+
var propType = typeof propValue;
|
|
870
|
+
if (Array.isArray(propValue)) {
|
|
871
|
+
return "array";
|
|
872
|
+
}
|
|
873
|
+
if (propValue instanceof RegExp) {
|
|
874
|
+
return "object";
|
|
875
|
+
}
|
|
876
|
+
if (isSymbol(propType, propValue)) {
|
|
877
|
+
return "symbol";
|
|
878
|
+
}
|
|
879
|
+
return propType;
|
|
880
|
+
}
|
|
881
|
+
function getPreciseType(propValue) {
|
|
882
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
883
|
+
return "" + propValue;
|
|
884
|
+
}
|
|
885
|
+
var propType = getPropType(propValue);
|
|
886
|
+
if (propType === "object") {
|
|
887
|
+
if (propValue instanceof Date) {
|
|
888
|
+
return "date";
|
|
889
|
+
} else if (propValue instanceof RegExp) {
|
|
890
|
+
return "regexp";
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
return propType;
|
|
894
|
+
}
|
|
895
|
+
function getPostfixForTypeWarning(value) {
|
|
896
|
+
var type = getPreciseType(value);
|
|
897
|
+
switch (type) {
|
|
898
|
+
case "array":
|
|
899
|
+
case "object":
|
|
900
|
+
return "an " + type;
|
|
901
|
+
case "boolean":
|
|
902
|
+
case "date":
|
|
903
|
+
case "regexp":
|
|
904
|
+
return "a " + type;
|
|
905
|
+
default:
|
|
906
|
+
return type;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
function getClassName(propValue) {
|
|
910
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
911
|
+
return ANONYMOUS;
|
|
912
|
+
}
|
|
913
|
+
return propValue.constructor.name;
|
|
914
|
+
}
|
|
915
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
916
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
917
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
918
|
+
return ReactPropTypes;
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
|
|
923
|
+
// node_modules/prop-types/factoryWithThrowingShims.js
|
|
924
|
+
var require_factoryWithThrowingShims = __commonJS({
|
|
925
|
+
"node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
|
|
926
|
+
"use strict";
|
|
927
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
928
|
+
function emptyFunction() {
|
|
929
|
+
}
|
|
930
|
+
function emptyFunctionWithReset() {
|
|
931
|
+
}
|
|
932
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
933
|
+
module.exports = function() {
|
|
934
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
935
|
+
if (secret === ReactPropTypesSecret) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
var err = new Error(
|
|
939
|
+
"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"
|
|
940
|
+
);
|
|
941
|
+
err.name = "Invariant Violation";
|
|
942
|
+
throw err;
|
|
943
|
+
}
|
|
944
|
+
;
|
|
945
|
+
shim.isRequired = shim;
|
|
946
|
+
function getShim() {
|
|
947
|
+
return shim;
|
|
948
|
+
}
|
|
949
|
+
;
|
|
950
|
+
var ReactPropTypes = {
|
|
951
|
+
array: shim,
|
|
952
|
+
bigint: shim,
|
|
953
|
+
bool: shim,
|
|
954
|
+
func: shim,
|
|
955
|
+
number: shim,
|
|
956
|
+
object: shim,
|
|
957
|
+
string: shim,
|
|
958
|
+
symbol: shim,
|
|
959
|
+
any: shim,
|
|
960
|
+
arrayOf: getShim,
|
|
961
|
+
element: shim,
|
|
962
|
+
elementType: shim,
|
|
963
|
+
instanceOf: getShim,
|
|
964
|
+
node: shim,
|
|
965
|
+
objectOf: getShim,
|
|
966
|
+
oneOf: getShim,
|
|
967
|
+
oneOfType: getShim,
|
|
968
|
+
shape: getShim,
|
|
969
|
+
exact: getShim,
|
|
970
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
971
|
+
resetWarningCache: emptyFunction
|
|
972
|
+
};
|
|
973
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
974
|
+
return ReactPropTypes;
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
|
|
979
|
+
// node_modules/prop-types/index.js
|
|
980
|
+
var require_prop_types = __commonJS({
|
|
981
|
+
"node_modules/prop-types/index.js"(exports, module) {
|
|
982
|
+
"use strict";
|
|
983
|
+
if (process.env.NODE_ENV !== "production") {
|
|
984
|
+
ReactIs = require_react_is();
|
|
985
|
+
throwOnDirectAccess = true;
|
|
986
|
+
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
987
|
+
} else {
|
|
988
|
+
module.exports = require_factoryWithThrowingShims()();
|
|
989
|
+
}
|
|
990
|
+
var ReactIs;
|
|
991
|
+
var throwOnDirectAccess;
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
// node_modules/classnames/index.js
|
|
996
|
+
var require_classnames = __commonJS({
|
|
997
|
+
"node_modules/classnames/index.js"(exports, module) {
|
|
998
|
+
"use strict";
|
|
999
|
+
(function() {
|
|
1000
|
+
"use strict";
|
|
1001
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1002
|
+
function classNames11() {
|
|
1003
|
+
var classes = "";
|
|
1004
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1005
|
+
var arg = arguments[i];
|
|
1006
|
+
if (arg) {
|
|
1007
|
+
classes = appendClass(classes, parseValue(arg));
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return classes;
|
|
1011
|
+
}
|
|
1012
|
+
function parseValue(arg) {
|
|
1013
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
1014
|
+
return arg;
|
|
1015
|
+
}
|
|
1016
|
+
if (typeof arg !== "object") {
|
|
1017
|
+
return "";
|
|
1018
|
+
}
|
|
1019
|
+
if (Array.isArray(arg)) {
|
|
1020
|
+
return classNames11.apply(null, arg);
|
|
1021
|
+
}
|
|
1022
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
1023
|
+
return arg.toString();
|
|
1024
|
+
}
|
|
1025
|
+
var classes = "";
|
|
1026
|
+
for (var key in arg) {
|
|
1027
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1028
|
+
classes = appendClass(classes, key);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
return classes;
|
|
1032
|
+
}
|
|
1033
|
+
function appendClass(value, newClass) {
|
|
1034
|
+
if (!newClass) {
|
|
1035
|
+
return value;
|
|
1036
|
+
}
|
|
1037
|
+
if (value) {
|
|
1038
|
+
return value + " " + newClass;
|
|
1039
|
+
}
|
|
1040
|
+
return value + newClass;
|
|
1041
|
+
}
|
|
1042
|
+
if (typeof module !== "undefined" && module.exports) {
|
|
1043
|
+
classNames11.default = classNames11;
|
|
1044
|
+
module.exports = classNames11;
|
|
1045
|
+
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
1046
|
+
define("classnames", [], function() {
|
|
1047
|
+
return classNames11;
|
|
1048
|
+
});
|
|
1049
|
+
} else {
|
|
1050
|
+
window.classNames = classNames11;
|
|
1051
|
+
}
|
|
1052
|
+
})();
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
|
|
1056
|
+
// src/components/DsDynamicForm.tsx
|
|
1057
|
+
import { Component } from "react";
|
|
1058
|
+
import Multiselect from "multiselect-react-dropdown";
|
|
1059
|
+
import { SaveDataTierToDatasync } from "datasync-core";
|
|
1060
|
+
import { CTimeStamp, WScrollTo, Randomize } from "datasync-common-library";
|
|
1061
|
+
import { DsBlob } from "datasync-blob";
|
|
1062
|
+
|
|
1063
|
+
// node_modules/reactstrap/esm/utils.js
|
|
1064
|
+
var import_prop_types = __toESM(require_prop_types());
|
|
1065
|
+
function _typeof(obj) {
|
|
1066
|
+
"@babel/helpers - typeof";
|
|
1067
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
1068
|
+
return typeof obj2;
|
|
1069
|
+
} : function(obj2) {
|
|
1070
|
+
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
1071
|
+
}, _typeof(obj);
|
|
1072
|
+
}
|
|
1073
|
+
var globalCssModule;
|
|
1074
|
+
function mapToCssModules() {
|
|
1075
|
+
var className = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
1076
|
+
var cssModule = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : globalCssModule;
|
|
1077
|
+
if (!cssModule) return className;
|
|
1078
|
+
return className.split(" ").map(function(c) {
|
|
1079
|
+
return cssModule[c] || c;
|
|
1080
|
+
}).join(" ");
|
|
1081
|
+
}
|
|
1082
|
+
function omit(obj, omitKeys) {
|
|
1083
|
+
var result = {};
|
|
1084
|
+
Object.keys(obj).forEach(function(key) {
|
|
1085
|
+
if (omitKeys.indexOf(key) === -1) {
|
|
1086
|
+
result[key] = obj[key];
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
return result;
|
|
1090
|
+
}
|
|
1091
|
+
var warned = {};
|
|
1092
|
+
function warnOnce(message) {
|
|
1093
|
+
if (!warned[message]) {
|
|
1094
|
+
if (typeof console !== "undefined") {
|
|
1095
|
+
console.error(message);
|
|
1096
|
+
}
|
|
1097
|
+
warned[message] = true;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
function deprecated(propType, explanation) {
|
|
1101
|
+
return function validate(props, propName, componentName) {
|
|
1102
|
+
if (props[propName] !== null && typeof props[propName] !== "undefined") {
|
|
1103
|
+
warnOnce('"'.concat(propName, '" property of "').concat(componentName, '" has been deprecated.\n').concat(explanation));
|
|
1104
|
+
}
|
|
1105
|
+
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
1106
|
+
rest[_key - 3] = arguments[_key];
|
|
1107
|
+
}
|
|
1108
|
+
return propType.apply(void 0, [props, propName, componentName].concat(rest));
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
var Element = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && window.Element || function() {
|
|
1112
|
+
};
|
|
1113
|
+
function DOMElement(props, propName, componentName) {
|
|
1114
|
+
if (!(props[propName] instanceof Element)) {
|
|
1115
|
+
return new Error("Invalid prop `" + propName + "` supplied to `" + componentName + "`. Expected prop to be an instance of Element. Validation failed.");
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
var targetPropType = import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.func, DOMElement, import_prop_types.default.shape({
|
|
1119
|
+
current: import_prop_types.default.any
|
|
1120
|
+
})]);
|
|
1121
|
+
var tagPropType = import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.string, import_prop_types.default.shape({
|
|
1122
|
+
$$typeof: import_prop_types.default.symbol,
|
|
1123
|
+
render: import_prop_types.default.func
|
|
1124
|
+
}), import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.string, import_prop_types.default.shape({
|
|
1125
|
+
$$typeof: import_prop_types.default.symbol,
|
|
1126
|
+
render: import_prop_types.default.func
|
|
1127
|
+
})]))]);
|
|
1128
|
+
var keyCodes = {
|
|
1129
|
+
esc: 27,
|
|
1130
|
+
space: 32,
|
|
1131
|
+
enter: 13,
|
|
1132
|
+
tab: 9,
|
|
1133
|
+
up: 38,
|
|
1134
|
+
down: 40,
|
|
1135
|
+
home: 36,
|
|
1136
|
+
end: 35,
|
|
1137
|
+
n: 78,
|
|
1138
|
+
p: 80
|
|
1139
|
+
};
|
|
1140
|
+
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
1141
|
+
function isObject(value) {
|
|
1142
|
+
var type = _typeof(value);
|
|
1143
|
+
return value != null && (type === "object" || type === "function");
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
// node_modules/reactstrap/esm/Row.js
|
|
1147
|
+
var import_prop_types2 = __toESM(require_prop_types());
|
|
1148
|
+
var import_classnames = __toESM(require_classnames());
|
|
1149
|
+
import React from "react";
|
|
1150
|
+
var _excluded = ["className", "cssModule", "noGutters", "tag", "widths"];
|
|
1151
|
+
function _extends() {
|
|
1152
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
1153
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1154
|
+
var source = arguments[i];
|
|
1155
|
+
for (var key in source) {
|
|
1156
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1157
|
+
target[key] = source[key];
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
return target;
|
|
1162
|
+
};
|
|
1163
|
+
return _extends.apply(this, arguments);
|
|
1164
|
+
}
|
|
1165
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1166
|
+
if (source == null) return {};
|
|
1167
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
1168
|
+
var key, i;
|
|
1169
|
+
if (Object.getOwnPropertySymbols) {
|
|
1170
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1171
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1172
|
+
key = sourceSymbolKeys[i];
|
|
1173
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1174
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1175
|
+
target[key] = source[key];
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
return target;
|
|
1179
|
+
}
|
|
1180
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1181
|
+
if (source == null) return {};
|
|
1182
|
+
var target = {};
|
|
1183
|
+
var sourceKeys = Object.keys(source);
|
|
1184
|
+
var key, i;
|
|
1185
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1186
|
+
key = sourceKeys[i];
|
|
1187
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1188
|
+
target[key] = source[key];
|
|
1189
|
+
}
|
|
1190
|
+
return target;
|
|
1191
|
+
}
|
|
1192
|
+
var rowColWidths = ["xs", "sm", "md", "lg", "xl", "xxl"];
|
|
1193
|
+
var rowColsPropType = import_prop_types2.default.oneOfType([import_prop_types2.default.number, import_prop_types2.default.string]);
|
|
1194
|
+
var propTypes = {
|
|
1195
|
+
tag: tagPropType,
|
|
1196
|
+
noGutters: deprecated(import_prop_types2.default.bool, "Please use Bootstrap 5 gutter utility classes. https://getbootstrap.com/docs/5.0/layout/gutters/"),
|
|
1197
|
+
className: import_prop_types2.default.string,
|
|
1198
|
+
cssModule: import_prop_types2.default.object,
|
|
1199
|
+
xs: rowColsPropType,
|
|
1200
|
+
sm: rowColsPropType,
|
|
1201
|
+
md: rowColsPropType,
|
|
1202
|
+
lg: rowColsPropType,
|
|
1203
|
+
xl: rowColsPropType,
|
|
1204
|
+
xxl: rowColsPropType,
|
|
1205
|
+
widths: import_prop_types2.default.array
|
|
1206
|
+
};
|
|
1207
|
+
function Row(props) {
|
|
1208
|
+
var className = props.className, cssModule = props.cssModule, noGutters = props.noGutters, _props$tag = props.tag, Tag = _props$tag === void 0 ? "div" : _props$tag, _props$widths = props.widths, widths = _props$widths === void 0 ? rowColWidths : _props$widths, attributes = _objectWithoutProperties(props, _excluded);
|
|
1209
|
+
var colClasses = [];
|
|
1210
|
+
widths.forEach(function(colWidth, i) {
|
|
1211
|
+
var colSize = props[colWidth];
|
|
1212
|
+
delete attributes[colWidth];
|
|
1213
|
+
if (!colSize) {
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
var isXs = !i;
|
|
1217
|
+
colClasses.push(isXs ? "row-cols-".concat(colSize) : "row-cols-".concat(colWidth, "-").concat(colSize));
|
|
1218
|
+
});
|
|
1219
|
+
var classes = mapToCssModules((0, import_classnames.default)(className, noGutters ? "gx-0" : null, "row", colClasses), cssModule);
|
|
1220
|
+
return /* @__PURE__ */ React.createElement(Tag, _extends({}, attributes, {
|
|
1221
|
+
className: classes
|
|
1222
|
+
}));
|
|
1223
|
+
}
|
|
1224
|
+
Row.propTypes = propTypes;
|
|
1225
|
+
var Row_default = Row;
|
|
1226
|
+
|
|
1227
|
+
// node_modules/reactstrap/esm/Col.js
|
|
1228
|
+
var import_prop_types3 = __toESM(require_prop_types());
|
|
1229
|
+
var import_classnames2 = __toESM(require_classnames());
|
|
1230
|
+
import React2 from "react";
|
|
1231
|
+
var _excluded2 = ["className", "cssModule", "widths", "tag"];
|
|
1232
|
+
function _extends2() {
|
|
1233
|
+
_extends2 = Object.assign ? Object.assign.bind() : function(target) {
|
|
1234
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1235
|
+
var source = arguments[i];
|
|
1236
|
+
for (var key in source) {
|
|
1237
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1238
|
+
target[key] = source[key];
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
return target;
|
|
1243
|
+
};
|
|
1244
|
+
return _extends2.apply(this, arguments);
|
|
1245
|
+
}
|
|
1246
|
+
function _objectWithoutProperties2(source, excluded) {
|
|
1247
|
+
if (source == null) return {};
|
|
1248
|
+
var target = _objectWithoutPropertiesLoose2(source, excluded);
|
|
1249
|
+
var key, i;
|
|
1250
|
+
if (Object.getOwnPropertySymbols) {
|
|
1251
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1252
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1253
|
+
key = sourceSymbolKeys[i];
|
|
1254
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1255
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1256
|
+
target[key] = source[key];
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
return target;
|
|
1260
|
+
}
|
|
1261
|
+
function _objectWithoutPropertiesLoose2(source, excluded) {
|
|
1262
|
+
if (source == null) return {};
|
|
1263
|
+
var target = {};
|
|
1264
|
+
var sourceKeys = Object.keys(source);
|
|
1265
|
+
var key, i;
|
|
1266
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1267
|
+
key = sourceKeys[i];
|
|
1268
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1269
|
+
target[key] = source[key];
|
|
1270
|
+
}
|
|
1271
|
+
return target;
|
|
1272
|
+
}
|
|
1273
|
+
function _defineProperty(obj, key, value) {
|
|
1274
|
+
if (key in obj) {
|
|
1275
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1276
|
+
} else {
|
|
1277
|
+
obj[key] = value;
|
|
1278
|
+
}
|
|
1279
|
+
return obj;
|
|
1280
|
+
}
|
|
1281
|
+
var colWidths = ["xs", "sm", "md", "lg", "xl", "xxl"];
|
|
1282
|
+
var stringOrNumberProp = import_prop_types3.default.oneOfType([import_prop_types3.default.number, import_prop_types3.default.string]);
|
|
1283
|
+
var columnProps = import_prop_types3.default.oneOfType([import_prop_types3.default.bool, import_prop_types3.default.number, import_prop_types3.default.string, import_prop_types3.default.shape({
|
|
1284
|
+
size: import_prop_types3.default.oneOfType([import_prop_types3.default.bool, import_prop_types3.default.number, import_prop_types3.default.string]),
|
|
1285
|
+
order: stringOrNumberProp,
|
|
1286
|
+
offset: stringOrNumberProp
|
|
1287
|
+
})]);
|
|
1288
|
+
var propTypes2 = {
|
|
1289
|
+
tag: tagPropType,
|
|
1290
|
+
xs: columnProps,
|
|
1291
|
+
sm: columnProps,
|
|
1292
|
+
md: columnProps,
|
|
1293
|
+
lg: columnProps,
|
|
1294
|
+
xl: columnProps,
|
|
1295
|
+
xxl: columnProps,
|
|
1296
|
+
className: import_prop_types3.default.string,
|
|
1297
|
+
cssModule: import_prop_types3.default.object,
|
|
1298
|
+
widths: import_prop_types3.default.array
|
|
1299
|
+
};
|
|
1300
|
+
var getColumnSizeClass = function getColumnSizeClass2(isXs, colWidth, colSize) {
|
|
1301
|
+
if (colSize === true || colSize === "") {
|
|
1302
|
+
return isXs ? "col" : "col-".concat(colWidth);
|
|
1303
|
+
}
|
|
1304
|
+
if (colSize === "auto") {
|
|
1305
|
+
return isXs ? "col-auto" : "col-".concat(colWidth, "-auto");
|
|
1306
|
+
}
|
|
1307
|
+
return isXs ? "col-".concat(colSize) : "col-".concat(colWidth, "-").concat(colSize);
|
|
1308
|
+
};
|
|
1309
|
+
var getColumnClasses = function getColumnClasses2(attributes, cssModule) {
|
|
1310
|
+
var widths = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : colWidths;
|
|
1311
|
+
var modifiedAttributes = attributes;
|
|
1312
|
+
var colClasses = [];
|
|
1313
|
+
widths.forEach(function(colWidth, i) {
|
|
1314
|
+
var columnProp = modifiedAttributes[colWidth];
|
|
1315
|
+
delete modifiedAttributes[colWidth];
|
|
1316
|
+
if (!columnProp && columnProp !== "") {
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
var isXs = !i;
|
|
1320
|
+
if (isObject(columnProp)) {
|
|
1321
|
+
var _classNames;
|
|
1322
|
+
var colSizeInterfix = isXs ? "-" : "-".concat(colWidth, "-");
|
|
1323
|
+
var colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
|
|
1324
|
+
colClasses.push(mapToCssModules((0, import_classnames2.default)((_classNames = {}, _defineProperty(_classNames, colClass, columnProp.size || columnProp.size === ""), _defineProperty(_classNames, "order".concat(colSizeInterfix).concat(columnProp.order), columnProp.order || columnProp.order === 0), _defineProperty(_classNames, "offset".concat(colSizeInterfix).concat(columnProp.offset), columnProp.offset || columnProp.offset === 0), _classNames)), cssModule));
|
|
1325
|
+
} else {
|
|
1326
|
+
var _colClass = getColumnSizeClass(isXs, colWidth, columnProp);
|
|
1327
|
+
colClasses.push(_colClass);
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
return {
|
|
1331
|
+
colClasses,
|
|
1332
|
+
modifiedAttributes
|
|
1333
|
+
};
|
|
1334
|
+
};
|
|
1335
|
+
function Col(props) {
|
|
1336
|
+
var className = props.className, cssModule = props.cssModule, _props$widths = props.widths, widths = _props$widths === void 0 ? colWidths : _props$widths, _props$tag = props.tag, Tag = _props$tag === void 0 ? "div" : _props$tag, attributes = _objectWithoutProperties2(props, _excluded2);
|
|
1337
|
+
var _getColumnClasses = getColumnClasses(attributes, cssModule, widths), modifiedAttributes = _getColumnClasses.modifiedAttributes, colClasses = _getColumnClasses.colClasses;
|
|
1338
|
+
if (!colClasses.length) {
|
|
1339
|
+
colClasses.push("col");
|
|
1340
|
+
}
|
|
1341
|
+
var classes = mapToCssModules((0, import_classnames2.default)(className, colClasses), cssModule);
|
|
1342
|
+
return /* @__PURE__ */ React2.createElement(Tag, _extends2({}, modifiedAttributes, {
|
|
1343
|
+
className: classes
|
|
1344
|
+
}));
|
|
1345
|
+
}
|
|
1346
|
+
Col.propTypes = propTypes2;
|
|
1347
|
+
var Col_default = Col;
|
|
1348
|
+
|
|
1349
|
+
// node_modules/reactstrap/esm/Button.js
|
|
1350
|
+
var import_prop_types5 = __toESM(require_prop_types());
|
|
1351
|
+
var import_classnames4 = __toESM(require_classnames());
|
|
1352
|
+
import React4, { useCallback } from "react";
|
|
1353
|
+
|
|
1354
|
+
// node_modules/reactstrap/esm/CloseButton.js
|
|
1355
|
+
var import_prop_types4 = __toESM(require_prop_types());
|
|
1356
|
+
var import_classnames3 = __toESM(require_classnames());
|
|
1357
|
+
import React3 from "react";
|
|
1358
|
+
var _excluded3 = ["className", "cssModule", "variant", "innerRef"];
|
|
1359
|
+
function _extends3() {
|
|
1360
|
+
_extends3 = Object.assign ? Object.assign.bind() : function(target) {
|
|
1361
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1362
|
+
var source = arguments[i];
|
|
1363
|
+
for (var key in source) {
|
|
1364
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1365
|
+
target[key] = source[key];
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
return target;
|
|
1370
|
+
};
|
|
1371
|
+
return _extends3.apply(this, arguments);
|
|
1372
|
+
}
|
|
1373
|
+
function ownKeys(object, enumerableOnly) {
|
|
1374
|
+
var keys = Object.keys(object);
|
|
1375
|
+
if (Object.getOwnPropertySymbols) {
|
|
1376
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
1377
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
1378
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1379
|
+
})), keys.push.apply(keys, symbols);
|
|
1380
|
+
}
|
|
1381
|
+
return keys;
|
|
1382
|
+
}
|
|
1383
|
+
function _objectSpread(target) {
|
|
1384
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1385
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
1386
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
1387
|
+
_defineProperty2(target, key, source[key]);
|
|
1388
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
1389
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
return target;
|
|
1393
|
+
}
|
|
1394
|
+
function _defineProperty2(obj, key, value) {
|
|
1395
|
+
if (key in obj) {
|
|
1396
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1397
|
+
} else {
|
|
1398
|
+
obj[key] = value;
|
|
1399
|
+
}
|
|
1400
|
+
return obj;
|
|
1401
|
+
}
|
|
1402
|
+
function _objectWithoutProperties3(source, excluded) {
|
|
1403
|
+
if (source == null) return {};
|
|
1404
|
+
var target = _objectWithoutPropertiesLoose3(source, excluded);
|
|
1405
|
+
var key, i;
|
|
1406
|
+
if (Object.getOwnPropertySymbols) {
|
|
1407
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1408
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1409
|
+
key = sourceSymbolKeys[i];
|
|
1410
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1411
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1412
|
+
target[key] = source[key];
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
return target;
|
|
1416
|
+
}
|
|
1417
|
+
function _objectWithoutPropertiesLoose3(source, excluded) {
|
|
1418
|
+
if (source == null) return {};
|
|
1419
|
+
var target = {};
|
|
1420
|
+
var sourceKeys = Object.keys(source);
|
|
1421
|
+
var key, i;
|
|
1422
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1423
|
+
key = sourceKeys[i];
|
|
1424
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1425
|
+
target[key] = source[key];
|
|
1426
|
+
}
|
|
1427
|
+
return target;
|
|
1428
|
+
}
|
|
1429
|
+
var propTypes3 = {
|
|
1430
|
+
/** Disable the button if needed */
|
|
1431
|
+
active: import_prop_types4.default.bool,
|
|
1432
|
+
/** Aria label */
|
|
1433
|
+
"aria-label": import_prop_types4.default.string,
|
|
1434
|
+
/** Function to be triggered on click */
|
|
1435
|
+
onClick: import_prop_types4.default.func,
|
|
1436
|
+
/** Change the variant to white */
|
|
1437
|
+
variant: import_prop_types4.default.oneOf(["white"]),
|
|
1438
|
+
className: import_prop_types4.default.string,
|
|
1439
|
+
cssModule: import_prop_types4.default.object,
|
|
1440
|
+
innerRef: import_prop_types4.default.oneOfType([import_prop_types4.default.object, import_prop_types4.default.string, import_prop_types4.default.func])
|
|
1441
|
+
};
|
|
1442
|
+
function CloseButton(props) {
|
|
1443
|
+
var className = props.className, cssModule = props.cssModule, variant = props.variant, innerRef = props.innerRef, attributes = _objectWithoutProperties3(props, _excluded3);
|
|
1444
|
+
var classes = mapToCssModules((0, import_classnames3.default)(className, "btn-close", variant && "btn-close-".concat(variant)));
|
|
1445
|
+
return /* @__PURE__ */ React3.createElement("button", _extends3({
|
|
1446
|
+
ref: innerRef,
|
|
1447
|
+
type: "button",
|
|
1448
|
+
className: classes
|
|
1449
|
+
}, _objectSpread({
|
|
1450
|
+
"aria-label": "close"
|
|
1451
|
+
}, attributes)));
|
|
1452
|
+
}
|
|
1453
|
+
CloseButton.propTypes = propTypes3;
|
|
1454
|
+
var CloseButton_default = CloseButton;
|
|
1455
|
+
|
|
1456
|
+
// node_modules/reactstrap/esm/Button.js
|
|
1457
|
+
var _excluded4 = ["active", "aria-label", "block", "className", "close", "cssModule", "color", "outline", "size", "tag", "innerRef"];
|
|
1458
|
+
function _extends4() {
|
|
1459
|
+
_extends4 = Object.assign ? Object.assign.bind() : function(target) {
|
|
1460
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1461
|
+
var source = arguments[i];
|
|
1462
|
+
for (var key in source) {
|
|
1463
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1464
|
+
target[key] = source[key];
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
return target;
|
|
1469
|
+
};
|
|
1470
|
+
return _extends4.apply(this, arguments);
|
|
1471
|
+
}
|
|
1472
|
+
function _objectWithoutProperties4(source, excluded) {
|
|
1473
|
+
if (source == null) return {};
|
|
1474
|
+
var target = _objectWithoutPropertiesLoose4(source, excluded);
|
|
1475
|
+
var key, i;
|
|
1476
|
+
if (Object.getOwnPropertySymbols) {
|
|
1477
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1478
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1479
|
+
key = sourceSymbolKeys[i];
|
|
1480
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1481
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1482
|
+
target[key] = source[key];
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
return target;
|
|
1486
|
+
}
|
|
1487
|
+
function _objectWithoutPropertiesLoose4(source, excluded) {
|
|
1488
|
+
if (source == null) return {};
|
|
1489
|
+
var target = {};
|
|
1490
|
+
var sourceKeys = Object.keys(source);
|
|
1491
|
+
var key, i;
|
|
1492
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1493
|
+
key = sourceKeys[i];
|
|
1494
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1495
|
+
target[key] = source[key];
|
|
1496
|
+
}
|
|
1497
|
+
return target;
|
|
1498
|
+
}
|
|
1499
|
+
var propTypes4 = {
|
|
1500
|
+
/** Manually set the visual state of the button to active */
|
|
1501
|
+
active: import_prop_types5.default.bool,
|
|
1502
|
+
/** Aria label */
|
|
1503
|
+
"aria-label": import_prop_types5.default.string,
|
|
1504
|
+
block: import_prop_types5.default.bool,
|
|
1505
|
+
/** Pass children so this component can wrap them */
|
|
1506
|
+
children: import_prop_types5.default.node,
|
|
1507
|
+
/** Add custom class */
|
|
1508
|
+
className: import_prop_types5.default.string,
|
|
1509
|
+
/** Change existing className with a new className */
|
|
1510
|
+
cssModule: import_prop_types5.default.object,
|
|
1511
|
+
/** Use the button as a close button */
|
|
1512
|
+
close: import_prop_types5.default.bool,
|
|
1513
|
+
/** Change color of Button to one of the available colors */
|
|
1514
|
+
color: import_prop_types5.default.string,
|
|
1515
|
+
/** Disables the button */
|
|
1516
|
+
disabled: import_prop_types5.default.bool,
|
|
1517
|
+
innerRef: import_prop_types5.default.oneOfType([import_prop_types5.default.object, import_prop_types5.default.func, import_prop_types5.default.string]),
|
|
1518
|
+
/** Function to be triggered on click */
|
|
1519
|
+
onClick: import_prop_types5.default.func,
|
|
1520
|
+
/** Adds outline to the button */
|
|
1521
|
+
outline: import_prop_types5.default.bool,
|
|
1522
|
+
/** Make the button bigger or smaller */
|
|
1523
|
+
size: import_prop_types5.default.string,
|
|
1524
|
+
/** Set a custom element for this component */
|
|
1525
|
+
tag: tagPropType
|
|
1526
|
+
};
|
|
1527
|
+
function Button(props) {
|
|
1528
|
+
var onClick = useCallback(function(e) {
|
|
1529
|
+
if (props.disabled) {
|
|
1530
|
+
e.preventDefault();
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
if (props.onClick) {
|
|
1534
|
+
return props.onClick(e);
|
|
1535
|
+
}
|
|
1536
|
+
}, [props.onClick, props.disabled]);
|
|
1537
|
+
var active = props.active, ariaLabel = props["aria-label"], block = props.block, className = props.className, close = props.close, cssModule = props.cssModule, _props$color = props.color, color = _props$color === void 0 ? "secondary" : _props$color, outline = props.outline, size = props.size, _props$tag = props.tag, Tag = _props$tag === void 0 ? "button" : _props$tag, innerRef = props.innerRef, attributes = _objectWithoutProperties4(props, _excluded4);
|
|
1538
|
+
if (close) {
|
|
1539
|
+
return /* @__PURE__ */ React4.createElement(CloseButton_default, attributes);
|
|
1540
|
+
}
|
|
1541
|
+
var btnOutlineColor = "btn".concat(outline ? "-outline" : "", "-").concat(color);
|
|
1542
|
+
var classes = mapToCssModules((0, import_classnames4.default)(className, "btn", btnOutlineColor, size ? "btn-".concat(size) : false, block ? "d-block w-100" : false, {
|
|
1543
|
+
active,
|
|
1544
|
+
disabled: props.disabled
|
|
1545
|
+
}), cssModule);
|
|
1546
|
+
if (attributes.href && Tag === "button") {
|
|
1547
|
+
Tag = "a";
|
|
1548
|
+
}
|
|
1549
|
+
return /* @__PURE__ */ React4.createElement(Tag, _extends4({
|
|
1550
|
+
type: Tag === "button" && attributes.onClick ? "button" : void 0
|
|
1551
|
+
}, attributes, {
|
|
1552
|
+
className: classes,
|
|
1553
|
+
ref: innerRef,
|
|
1554
|
+
onClick,
|
|
1555
|
+
"aria-label": ariaLabel
|
|
1556
|
+
}));
|
|
1557
|
+
}
|
|
1558
|
+
Button.propTypes = propTypes4;
|
|
1559
|
+
var Button_default = Button;
|
|
1560
|
+
|
|
1561
|
+
// node_modules/reactstrap/esm/Dropdown.js
|
|
1562
|
+
var import_prop_types6 = __toESM(require_prop_types());
|
|
1563
|
+
import React8 from "react";
|
|
1564
|
+
|
|
1565
|
+
// node_modules/react-popper/lib/esm/Manager.js
|
|
1566
|
+
import * as React5 from "react";
|
|
1567
|
+
var ManagerReferenceNodeContext = React5.createContext();
|
|
1568
|
+
var ManagerReferenceNodeSetterContext = React5.createContext();
|
|
1569
|
+
function Manager(_ref) {
|
|
1570
|
+
var children = _ref.children;
|
|
1571
|
+
var _React$useState = React5.useState(null), referenceNode = _React$useState[0], setReferenceNode = _React$useState[1];
|
|
1572
|
+
var hasUnmounted = React5.useRef(false);
|
|
1573
|
+
React5.useEffect(function() {
|
|
1574
|
+
return function() {
|
|
1575
|
+
hasUnmounted.current = true;
|
|
1576
|
+
};
|
|
1577
|
+
}, []);
|
|
1578
|
+
var handleSetReferenceNode = React5.useCallback(function(node) {
|
|
1579
|
+
if (!hasUnmounted.current) {
|
|
1580
|
+
setReferenceNode(node);
|
|
1581
|
+
}
|
|
1582
|
+
}, []);
|
|
1583
|
+
return /* @__PURE__ */ React5.createElement(ManagerReferenceNodeContext.Provider, {
|
|
1584
|
+
value: referenceNode
|
|
1585
|
+
}, /* @__PURE__ */ React5.createElement(ManagerReferenceNodeSetterContext.Provider, {
|
|
1586
|
+
value: handleSetReferenceNode
|
|
1587
|
+
}, children));
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
// node_modules/reactstrap/esm/Dropdown.js
|
|
1591
|
+
var import_classnames5 = __toESM(require_classnames());
|
|
1592
|
+
|
|
1593
|
+
// node_modules/reactstrap/esm/DropdownContext.js
|
|
1594
|
+
import React6 from "react";
|
|
1595
|
+
var DropdownContext = /* @__PURE__ */ React6.createContext({});
|
|
1596
|
+
|
|
1597
|
+
// node_modules/reactstrap/esm/InputGroupContext.js
|
|
1598
|
+
import React7 from "react";
|
|
1599
|
+
var InputGroupContext = /* @__PURE__ */ React7.createContext({});
|
|
1600
|
+
|
|
1601
|
+
// node_modules/reactstrap/esm/Dropdown.js
|
|
1602
|
+
function _typeof2(obj) {
|
|
1603
|
+
"@babel/helpers - typeof";
|
|
1604
|
+
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
1605
|
+
return typeof obj2;
|
|
1606
|
+
} : function(obj2) {
|
|
1607
|
+
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
1608
|
+
}, _typeof2(obj);
|
|
1609
|
+
}
|
|
1610
|
+
var _excluded5 = ["className", "cssModule", "direction", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "tag", "menuRole"];
|
|
1611
|
+
function _extends5() {
|
|
1612
|
+
_extends5 = Object.assign ? Object.assign.bind() : function(target) {
|
|
1613
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1614
|
+
var source = arguments[i];
|
|
1615
|
+
for (var key in source) {
|
|
1616
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1617
|
+
target[key] = source[key];
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
return target;
|
|
1622
|
+
};
|
|
1623
|
+
return _extends5.apply(this, arguments);
|
|
1624
|
+
}
|
|
1625
|
+
function _defineProperty3(obj, key, value) {
|
|
1626
|
+
if (key in obj) {
|
|
1627
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1628
|
+
} else {
|
|
1629
|
+
obj[key] = value;
|
|
1630
|
+
}
|
|
1631
|
+
return obj;
|
|
1632
|
+
}
|
|
1633
|
+
function _objectWithoutProperties5(source, excluded) {
|
|
1634
|
+
if (source == null) return {};
|
|
1635
|
+
var target = _objectWithoutPropertiesLoose5(source, excluded);
|
|
1636
|
+
var key, i;
|
|
1637
|
+
if (Object.getOwnPropertySymbols) {
|
|
1638
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1639
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1640
|
+
key = sourceSymbolKeys[i];
|
|
1641
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1642
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1643
|
+
target[key] = source[key];
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
return target;
|
|
1647
|
+
}
|
|
1648
|
+
function _objectWithoutPropertiesLoose5(source, excluded) {
|
|
1649
|
+
if (source == null) return {};
|
|
1650
|
+
var target = {};
|
|
1651
|
+
var sourceKeys = Object.keys(source);
|
|
1652
|
+
var key, i;
|
|
1653
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1654
|
+
key = sourceKeys[i];
|
|
1655
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1656
|
+
target[key] = source[key];
|
|
1657
|
+
}
|
|
1658
|
+
return target;
|
|
1659
|
+
}
|
|
1660
|
+
function _classCallCheck(instance, Constructor) {
|
|
1661
|
+
if (!(instance instanceof Constructor)) {
|
|
1662
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
function _defineProperties(target, props) {
|
|
1666
|
+
for (var i = 0; i < props.length; i++) {
|
|
1667
|
+
var descriptor = props[i];
|
|
1668
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
1669
|
+
descriptor.configurable = true;
|
|
1670
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
1671
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
1675
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
1676
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
1677
|
+
Object.defineProperty(Constructor, "prototype", { writable: false });
|
|
1678
|
+
return Constructor;
|
|
1679
|
+
}
|
|
1680
|
+
function _inherits(subClass, superClass) {
|
|
1681
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
1682
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
1683
|
+
}
|
|
1684
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
1685
|
+
Object.defineProperty(subClass, "prototype", { writable: false });
|
|
1686
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
1687
|
+
}
|
|
1688
|
+
function _setPrototypeOf(o, p) {
|
|
1689
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o2, p2) {
|
|
1690
|
+
o2.__proto__ = p2;
|
|
1691
|
+
return o2;
|
|
1692
|
+
};
|
|
1693
|
+
return _setPrototypeOf(o, p);
|
|
1694
|
+
}
|
|
1695
|
+
function _createSuper(Derived) {
|
|
1696
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
1697
|
+
return function _createSuperInternal() {
|
|
1698
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
1699
|
+
if (hasNativeReflectConstruct) {
|
|
1700
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
1701
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
1702
|
+
} else {
|
|
1703
|
+
result = Super.apply(this, arguments);
|
|
1704
|
+
}
|
|
1705
|
+
return _possibleConstructorReturn(this, result);
|
|
1706
|
+
};
|
|
1707
|
+
}
|
|
1708
|
+
function _possibleConstructorReturn(self, call) {
|
|
1709
|
+
if (call && (_typeof2(call) === "object" || typeof call === "function")) {
|
|
1710
|
+
return call;
|
|
1711
|
+
} else if (call !== void 0) {
|
|
1712
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1713
|
+
}
|
|
1714
|
+
return _assertThisInitialized(self);
|
|
1715
|
+
}
|
|
1716
|
+
function _assertThisInitialized(self) {
|
|
1717
|
+
if (self === void 0) {
|
|
1718
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1719
|
+
}
|
|
1720
|
+
return self;
|
|
1721
|
+
}
|
|
1722
|
+
function _isNativeReflectConstruct() {
|
|
1723
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
1724
|
+
if (Reflect.construct.sham) return false;
|
|
1725
|
+
if (typeof Proxy === "function") return true;
|
|
1726
|
+
try {
|
|
1727
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
1728
|
+
}));
|
|
1729
|
+
return true;
|
|
1730
|
+
} catch (e) {
|
|
1731
|
+
return false;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
function _getPrototypeOf(o) {
|
|
1735
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o2) {
|
|
1736
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
1737
|
+
};
|
|
1738
|
+
return _getPrototypeOf(o);
|
|
1739
|
+
}
|
|
1740
|
+
var propTypes5 = {
|
|
1741
|
+
a11y: import_prop_types6.default.bool,
|
|
1742
|
+
disabled: import_prop_types6.default.bool,
|
|
1743
|
+
direction: import_prop_types6.default.oneOf(["up", "down", "start", "end", "left", "right"]),
|
|
1744
|
+
group: import_prop_types6.default.bool,
|
|
1745
|
+
isOpen: import_prop_types6.default.bool,
|
|
1746
|
+
nav: import_prop_types6.default.bool,
|
|
1747
|
+
active: import_prop_types6.default.bool,
|
|
1748
|
+
size: import_prop_types6.default.string,
|
|
1749
|
+
tag: tagPropType,
|
|
1750
|
+
toggle: import_prop_types6.default.func,
|
|
1751
|
+
children: import_prop_types6.default.node,
|
|
1752
|
+
className: import_prop_types6.default.string,
|
|
1753
|
+
cssModule: import_prop_types6.default.object,
|
|
1754
|
+
dropup: import_prop_types6.default.bool,
|
|
1755
|
+
inNavbar: import_prop_types6.default.bool,
|
|
1756
|
+
setActiveFromChild: import_prop_types6.default.bool,
|
|
1757
|
+
menuRole: import_prop_types6.default.oneOf(["listbox", "menu"])
|
|
1758
|
+
};
|
|
1759
|
+
var defaultProps = {
|
|
1760
|
+
a11y: true,
|
|
1761
|
+
isOpen: false,
|
|
1762
|
+
direction: "down",
|
|
1763
|
+
nav: false,
|
|
1764
|
+
active: false,
|
|
1765
|
+
inNavbar: false,
|
|
1766
|
+
setActiveFromChild: false
|
|
1767
|
+
};
|
|
1768
|
+
var preventDefaultKeys = [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down, keyCodes.end, keyCodes.home];
|
|
1769
|
+
var Dropdown = /* @__PURE__ */ function(_React$Component) {
|
|
1770
|
+
_inherits(Dropdown2, _React$Component);
|
|
1771
|
+
var _super = _createSuper(Dropdown2);
|
|
1772
|
+
function Dropdown2(props) {
|
|
1773
|
+
var _this;
|
|
1774
|
+
_classCallCheck(this, Dropdown2);
|
|
1775
|
+
_this = _super.call(this, props);
|
|
1776
|
+
_this.addEvents = _this.addEvents.bind(_assertThisInitialized(_this));
|
|
1777
|
+
_this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
|
|
1778
|
+
_this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
|
|
1779
|
+
_this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_this));
|
|
1780
|
+
_this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
|
|
1781
|
+
_this.handleMenuRef = _this.handleMenuRef.bind(_assertThisInitialized(_this));
|
|
1782
|
+
_this.handleToggleRef = _this.handleToggleRef.bind(_assertThisInitialized(_this));
|
|
1783
|
+
_this.containerRef = /* @__PURE__ */ React8.createRef();
|
|
1784
|
+
_this.menuRef = /* @__PURE__ */ React8.createRef();
|
|
1785
|
+
_this.toggleRef = /* @__PURE__ */ React8.createRef();
|
|
1786
|
+
return _this;
|
|
1787
|
+
}
|
|
1788
|
+
_createClass(Dropdown2, [{
|
|
1789
|
+
key: "componentDidMount",
|
|
1790
|
+
value: function componentDidMount() {
|
|
1791
|
+
this.handleProps();
|
|
1792
|
+
}
|
|
1793
|
+
}, {
|
|
1794
|
+
key: "componentDidUpdate",
|
|
1795
|
+
value: function componentDidUpdate(prevProps) {
|
|
1796
|
+
if (this.props.isOpen !== prevProps.isOpen) {
|
|
1797
|
+
this.handleProps();
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
}, {
|
|
1801
|
+
key: "componentWillUnmount",
|
|
1802
|
+
value: function componentWillUnmount() {
|
|
1803
|
+
this.removeEvents();
|
|
1804
|
+
}
|
|
1805
|
+
}, {
|
|
1806
|
+
key: "handleMenuRef",
|
|
1807
|
+
value: function handleMenuRef(menuRef) {
|
|
1808
|
+
this.menuRef.current = menuRef;
|
|
1809
|
+
}
|
|
1810
|
+
}, {
|
|
1811
|
+
key: "handleToggleRef",
|
|
1812
|
+
value: function handleToggleRef(toggleRef) {
|
|
1813
|
+
this.toggleRef.current = toggleRef;
|
|
1814
|
+
}
|
|
1815
|
+
}, {
|
|
1816
|
+
key: "handleDocumentClick",
|
|
1817
|
+
value: function handleDocumentClick(e) {
|
|
1818
|
+
if (e && (e.which === 3 || e.type === "keyup" && e.which !== keyCodes.tab)) return;
|
|
1819
|
+
var container = this.getContainer();
|
|
1820
|
+
var menu = this.getMenu();
|
|
1821
|
+
var toggle = this.getToggle();
|
|
1822
|
+
if (!toggle) {
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
var targetIsToggle = toggle.contains(e.target);
|
|
1826
|
+
var clickIsInMenu = menu && menu.contains(e.target) && menu !== e.target;
|
|
1827
|
+
var clickIsInInput = false;
|
|
1828
|
+
if (container) {
|
|
1829
|
+
clickIsInInput = container.classList.contains("input-group") && container.classList.contains("dropdown") && e.target.tagName === "INPUT";
|
|
1830
|
+
}
|
|
1831
|
+
if ((targetIsToggle && !clickIsInInput || clickIsInMenu) && (e.type !== "keyup" || e.which === keyCodes.tab)) {
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
this.toggle(e);
|
|
1835
|
+
}
|
|
1836
|
+
}, {
|
|
1837
|
+
key: "handleKeyDown",
|
|
1838
|
+
value: function handleKeyDown(e) {
|
|
1839
|
+
var _this2 = this;
|
|
1840
|
+
var isTargetMenuItem = e.target.getAttribute("role") === "menuitem" || e.target.getAttribute("role") === "option";
|
|
1841
|
+
var isTargetMenuCtrl = this.getMenuCtrl() === e.target;
|
|
1842
|
+
var isTab = keyCodes.tab === e.which;
|
|
1843
|
+
if (/input|textarea/i.test(e.target.tagName) || isTab && !this.props.a11y || isTab && !(isTargetMenuItem || isTargetMenuCtrl)) {
|
|
1844
|
+
return;
|
|
1845
|
+
}
|
|
1846
|
+
if (preventDefaultKeys.indexOf(e.which) !== -1 || e.which >= 48 && e.which <= 90) {
|
|
1847
|
+
e.preventDefault();
|
|
1848
|
+
}
|
|
1849
|
+
if (this.props.disabled) return;
|
|
1850
|
+
if (isTargetMenuCtrl) {
|
|
1851
|
+
if ([keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
|
|
1852
|
+
if (!this.props.isOpen) {
|
|
1853
|
+
this.toggle(e);
|
|
1854
|
+
}
|
|
1855
|
+
setTimeout(function() {
|
|
1856
|
+
var _this2$getMenuItems$;
|
|
1857
|
+
return (_this2$getMenuItems$ = _this2.getMenuItems()[0]) === null || _this2$getMenuItems$ === void 0 ? void 0 : _this2$getMenuItems$.focus();
|
|
1858
|
+
});
|
|
1859
|
+
} else if (this.props.isOpen && isTab) {
|
|
1860
|
+
var _this$getMenuItems$;
|
|
1861
|
+
e.preventDefault();
|
|
1862
|
+
(_this$getMenuItems$ = this.getMenuItems()[0]) === null || _this$getMenuItems$ === void 0 ? void 0 : _this$getMenuItems$.focus();
|
|
1863
|
+
} else if (this.props.isOpen && e.which === keyCodes.esc) {
|
|
1864
|
+
this.toggle(e);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
if (this.props.isOpen && isTargetMenuItem) {
|
|
1868
|
+
if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
|
|
1869
|
+
this.toggle(e);
|
|
1870
|
+
this.getMenuCtrl().focus();
|
|
1871
|
+
} else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
|
|
1872
|
+
e.target.click();
|
|
1873
|
+
this.getMenuCtrl().focus();
|
|
1874
|
+
} else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
|
|
1875
|
+
var $menuitems = this.getMenuItems();
|
|
1876
|
+
var index = $menuitems.indexOf(e.target);
|
|
1877
|
+
if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
|
|
1878
|
+
index = index !== 0 ? index - 1 : $menuitems.length - 1;
|
|
1879
|
+
} else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
|
|
1880
|
+
index = index === $menuitems.length - 1 ? 0 : index + 1;
|
|
1881
|
+
}
|
|
1882
|
+
$menuitems[index].focus();
|
|
1883
|
+
} else if (keyCodes.end === e.which) {
|
|
1884
|
+
var _$menuitems = this.getMenuItems();
|
|
1885
|
+
_$menuitems[_$menuitems.length - 1].focus();
|
|
1886
|
+
} else if (keyCodes.home === e.which) {
|
|
1887
|
+
var _$menuitems2 = this.getMenuItems();
|
|
1888
|
+
_$menuitems2[0].focus();
|
|
1889
|
+
} else if (e.which >= 48 && e.which <= 90) {
|
|
1890
|
+
var _$menuitems3 = this.getMenuItems();
|
|
1891
|
+
var charPressed = String.fromCharCode(e.which).toLowerCase();
|
|
1892
|
+
for (var i = 0; i < _$menuitems3.length; i += 1) {
|
|
1893
|
+
var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
|
|
1894
|
+
if (firstLetter === charPressed) {
|
|
1895
|
+
_$menuitems3[i].focus();
|
|
1896
|
+
break;
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
}, {
|
|
1903
|
+
key: "handleProps",
|
|
1904
|
+
value: function handleProps() {
|
|
1905
|
+
if (this.props.isOpen) {
|
|
1906
|
+
this.addEvents();
|
|
1907
|
+
} else {
|
|
1908
|
+
this.removeEvents();
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
}, {
|
|
1912
|
+
key: "getContextValue",
|
|
1913
|
+
value: function getContextValue() {
|
|
1914
|
+
return {
|
|
1915
|
+
toggle: this.toggle,
|
|
1916
|
+
isOpen: this.props.isOpen,
|
|
1917
|
+
direction: this.props.direction === "down" && this.props.dropup ? "up" : this.props.direction,
|
|
1918
|
+
inNavbar: this.props.inNavbar,
|
|
1919
|
+
disabled: this.props.disabled,
|
|
1920
|
+
// Callback that should be called by DropdownMenu to provide a ref to
|
|
1921
|
+
// a HTML tag that's used for the DropdownMenu
|
|
1922
|
+
onMenuRef: this.handleMenuRef,
|
|
1923
|
+
onToggleRef: this.handleToggleRef,
|
|
1924
|
+
menuRole: this.props.menuRole
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
}, {
|
|
1928
|
+
key: "getContainer",
|
|
1929
|
+
value: function getContainer() {
|
|
1930
|
+
return this.containerRef.current;
|
|
1931
|
+
}
|
|
1932
|
+
}, {
|
|
1933
|
+
key: "getMenu",
|
|
1934
|
+
value: function getMenu() {
|
|
1935
|
+
return this.menuRef.current;
|
|
1936
|
+
}
|
|
1937
|
+
}, {
|
|
1938
|
+
key: "getToggle",
|
|
1939
|
+
value: function getToggle() {
|
|
1940
|
+
return this.toggleRef.current;
|
|
1941
|
+
}
|
|
1942
|
+
}, {
|
|
1943
|
+
key: "getMenuCtrl",
|
|
1944
|
+
value: function getMenuCtrl() {
|
|
1945
|
+
if (this._$menuCtrl) return this._$menuCtrl;
|
|
1946
|
+
this._$menuCtrl = this.getToggle();
|
|
1947
|
+
return this._$menuCtrl;
|
|
1948
|
+
}
|
|
1949
|
+
}, {
|
|
1950
|
+
key: "getItemType",
|
|
1951
|
+
value: function getItemType() {
|
|
1952
|
+
if (this.props.menuRole === "listbox") {
|
|
1953
|
+
return "option";
|
|
1954
|
+
}
|
|
1955
|
+
return "menuitem";
|
|
1956
|
+
}
|
|
1957
|
+
}, {
|
|
1958
|
+
key: "getMenuItems",
|
|
1959
|
+
value: function getMenuItems() {
|
|
1960
|
+
var menuContainer = this.getMenu() || this.getContainer();
|
|
1961
|
+
return [].slice.call(menuContainer.querySelectorAll('[role="'.concat(this.getItemType(), '"]')));
|
|
1962
|
+
}
|
|
1963
|
+
}, {
|
|
1964
|
+
key: "addEvents",
|
|
1965
|
+
value: function addEvents() {
|
|
1966
|
+
var _this3 = this;
|
|
1967
|
+
["click", "touchstart", "keyup"].forEach(function(event) {
|
|
1968
|
+
return document.addEventListener(event, _this3.handleDocumentClick, true);
|
|
1969
|
+
});
|
|
1970
|
+
}
|
|
1971
|
+
}, {
|
|
1972
|
+
key: "removeEvents",
|
|
1973
|
+
value: function removeEvents() {
|
|
1974
|
+
var _this4 = this;
|
|
1975
|
+
["click", "touchstart", "keyup"].forEach(function(event) {
|
|
1976
|
+
return document.removeEventListener(event, _this4.handleDocumentClick, true);
|
|
1977
|
+
});
|
|
1978
|
+
}
|
|
1979
|
+
}, {
|
|
1980
|
+
key: "toggle",
|
|
1981
|
+
value: function toggle(e) {
|
|
1982
|
+
if (this.props.disabled) {
|
|
1983
|
+
return e && e.preventDefault();
|
|
1984
|
+
}
|
|
1985
|
+
return this.props.toggle(e);
|
|
1986
|
+
}
|
|
1987
|
+
}, {
|
|
1988
|
+
key: "render",
|
|
1989
|
+
value: function render() {
|
|
1990
|
+
var _classNames, _this5 = this;
|
|
1991
|
+
var _omit = omit(this.props, ["toggle", "disabled", "inNavbar", "a11y"]), className = _omit.className, cssModule = _omit.cssModule, direction = _omit.direction, isOpen = _omit.isOpen, group = _omit.group, size = _omit.size, nav = _omit.nav, setActiveFromChild = _omit.setActiveFromChild, active = _omit.active, tag = _omit.tag, menuRole = _omit.menuRole, attrs = _objectWithoutProperties5(_omit, _excluded5);
|
|
1992
|
+
var Tag = tag || (nav ? "li" : "div");
|
|
1993
|
+
var subItemIsActive = false;
|
|
1994
|
+
if (setActiveFromChild) {
|
|
1995
|
+
React8.Children.map(this.props.children[1].props.children, function(dropdownItem) {
|
|
1996
|
+
if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
var classes = mapToCssModules((0, import_classnames5.default)(className, nav && active ? "active" : false, setActiveFromChild && subItemIsActive ? "active" : false, (_classNames = {
|
|
2000
|
+
"btn-group": group
|
|
2001
|
+
}, _defineProperty3(_classNames, "btn-group-".concat(size), !!size), _defineProperty3(_classNames, "dropdown", !group), _defineProperty3(_classNames, "dropup", direction === "up"), _defineProperty3(_classNames, "dropstart", direction === "start" || direction === "left"), _defineProperty3(_classNames, "dropend", direction === "end" || direction === "right"), _defineProperty3(_classNames, "show", isOpen), _defineProperty3(_classNames, "nav-item", nav), _classNames)), cssModule);
|
|
2002
|
+
if (this.context.insideInputGroup) {
|
|
2003
|
+
return /* @__PURE__ */ React8.createElement(DropdownContext.Provider, {
|
|
2004
|
+
value: this.getContextValue()
|
|
2005
|
+
}, /* @__PURE__ */ React8.createElement(Manager, null, React8.Children.map(this.props.children, function(child) {
|
|
2006
|
+
return /* @__PURE__ */ React8.cloneElement(child, {
|
|
2007
|
+
onKeyDown: _this5.handleKeyDown
|
|
2008
|
+
});
|
|
2009
|
+
})));
|
|
2010
|
+
}
|
|
2011
|
+
return /* @__PURE__ */ React8.createElement(DropdownContext.Provider, {
|
|
2012
|
+
value: this.getContextValue()
|
|
2013
|
+
}, /* @__PURE__ */ React8.createElement(Manager, null, /* @__PURE__ */ React8.createElement(Tag, _extends5({}, attrs, _defineProperty3({}, typeof Tag === "string" ? "ref" : "innerRef", this.containerRef), {
|
|
2014
|
+
onKeyDown: this.handleKeyDown,
|
|
2015
|
+
className: classes
|
|
2016
|
+
}))));
|
|
2017
|
+
}
|
|
2018
|
+
}]);
|
|
2019
|
+
return Dropdown2;
|
|
2020
|
+
}(React8.Component);
|
|
2021
|
+
Dropdown.propTypes = propTypes5;
|
|
2022
|
+
Dropdown.defaultProps = defaultProps;
|
|
2023
|
+
Dropdown.contextType = InputGroupContext;
|
|
2024
|
+
var Dropdown_default = Dropdown;
|
|
2025
|
+
|
|
2026
|
+
// node_modules/reactstrap/esm/FormGroup.js
|
|
2027
|
+
var import_prop_types7 = __toESM(require_prop_types());
|
|
2028
|
+
var import_classnames6 = __toESM(require_classnames());
|
|
2029
|
+
import React9 from "react";
|
|
2030
|
+
var _excluded6 = ["className", "cssModule", "row", "disabled", "check", "inline", "floating", "noMargin", "tag", "switch"];
|
|
2031
|
+
function _extends6() {
|
|
2032
|
+
_extends6 = Object.assign ? Object.assign.bind() : function(target) {
|
|
2033
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2034
|
+
var source = arguments[i];
|
|
2035
|
+
for (var key in source) {
|
|
2036
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2037
|
+
target[key] = source[key];
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
return target;
|
|
2042
|
+
};
|
|
2043
|
+
return _extends6.apply(this, arguments);
|
|
2044
|
+
}
|
|
2045
|
+
function _objectWithoutProperties6(source, excluded) {
|
|
2046
|
+
if (source == null) return {};
|
|
2047
|
+
var target = _objectWithoutPropertiesLoose6(source, excluded);
|
|
2048
|
+
var key, i;
|
|
2049
|
+
if (Object.getOwnPropertySymbols) {
|
|
2050
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2051
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
2052
|
+
key = sourceSymbolKeys[i];
|
|
2053
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2054
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2055
|
+
target[key] = source[key];
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
return target;
|
|
2059
|
+
}
|
|
2060
|
+
function _objectWithoutPropertiesLoose6(source, excluded) {
|
|
2061
|
+
if (source == null) return {};
|
|
2062
|
+
var target = {};
|
|
2063
|
+
var sourceKeys = Object.keys(source);
|
|
2064
|
+
var key, i;
|
|
2065
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2066
|
+
key = sourceKeys[i];
|
|
2067
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2068
|
+
target[key] = source[key];
|
|
2069
|
+
}
|
|
2070
|
+
return target;
|
|
2071
|
+
}
|
|
2072
|
+
var propTypes6 = {
|
|
2073
|
+
children: import_prop_types7.default.node,
|
|
2074
|
+
row: import_prop_types7.default.bool,
|
|
2075
|
+
check: import_prop_types7.default.bool,
|
|
2076
|
+
"switch": import_prop_types7.default.bool,
|
|
2077
|
+
inline: import_prop_types7.default.bool,
|
|
2078
|
+
floating: import_prop_types7.default.bool,
|
|
2079
|
+
noMargin: import_prop_types7.default.bool,
|
|
2080
|
+
disabled: import_prop_types7.default.bool,
|
|
2081
|
+
tag: tagPropType,
|
|
2082
|
+
className: import_prop_types7.default.string,
|
|
2083
|
+
cssModule: import_prop_types7.default.object
|
|
2084
|
+
};
|
|
2085
|
+
function FormGroup(props) {
|
|
2086
|
+
var className = props.className, cssModule = props.cssModule, row = props.row, disabled = props.disabled, check = props.check, inline = props.inline, floating = props.floating, noMargin = props.noMargin, _props$tag = props.tag, Tag = _props$tag === void 0 ? "div" : _props$tag, switchProp = props["switch"], attributes = _objectWithoutProperties6(props, _excluded6);
|
|
2087
|
+
var formCheck = check || switchProp;
|
|
2088
|
+
var classes = mapToCssModules((0, import_classnames6.default)(className, row ? "row" : false, formCheck ? "form-check" : false, switchProp ? "form-switch" : false, formCheck || noMargin ? false : "mb-3", formCheck && inline ? "form-check-inline" : false, formCheck && disabled ? "disabled" : false, floating && "form-floating"), cssModule);
|
|
2089
|
+
if (Tag === "fieldset") {
|
|
2090
|
+
attributes.disabled = disabled;
|
|
2091
|
+
}
|
|
2092
|
+
return /* @__PURE__ */ React9.createElement(Tag, _extends6({}, attributes, {
|
|
2093
|
+
className: classes
|
|
2094
|
+
}));
|
|
2095
|
+
}
|
|
2096
|
+
FormGroup.propTypes = propTypes6;
|
|
2097
|
+
var FormGroup_default = FormGroup;
|
|
2098
|
+
|
|
2099
|
+
// node_modules/reactstrap/esm/Input.js
|
|
2100
|
+
var import_prop_types8 = __toESM(require_prop_types());
|
|
2101
|
+
var import_classnames7 = __toESM(require_classnames());
|
|
2102
|
+
import React10 from "react";
|
|
2103
|
+
function _typeof3(obj) {
|
|
2104
|
+
"@babel/helpers - typeof";
|
|
2105
|
+
return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
2106
|
+
return typeof obj2;
|
|
2107
|
+
} : function(obj2) {
|
|
2108
|
+
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
2109
|
+
}, _typeof3(obj);
|
|
2110
|
+
}
|
|
2111
|
+
var _excluded7 = ["className", "cssModule", "type", "bsSize", "valid", "invalid", "tag", "addon", "plaintext", "innerRef"];
|
|
2112
|
+
function _extends7() {
|
|
2113
|
+
_extends7 = Object.assign ? Object.assign.bind() : function(target) {
|
|
2114
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2115
|
+
var source = arguments[i];
|
|
2116
|
+
for (var key in source) {
|
|
2117
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2118
|
+
target[key] = source[key];
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
return target;
|
|
2123
|
+
};
|
|
2124
|
+
return _extends7.apply(this, arguments);
|
|
2125
|
+
}
|
|
2126
|
+
function _objectWithoutProperties7(source, excluded) {
|
|
2127
|
+
if (source == null) return {};
|
|
2128
|
+
var target = _objectWithoutPropertiesLoose7(source, excluded);
|
|
2129
|
+
var key, i;
|
|
2130
|
+
if (Object.getOwnPropertySymbols) {
|
|
2131
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2132
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
2133
|
+
key = sourceSymbolKeys[i];
|
|
2134
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2135
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2136
|
+
target[key] = source[key];
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
return target;
|
|
2140
|
+
}
|
|
2141
|
+
function _objectWithoutPropertiesLoose7(source, excluded) {
|
|
2142
|
+
if (source == null) return {};
|
|
2143
|
+
var target = {};
|
|
2144
|
+
var sourceKeys = Object.keys(source);
|
|
2145
|
+
var key, i;
|
|
2146
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2147
|
+
key = sourceKeys[i];
|
|
2148
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2149
|
+
target[key] = source[key];
|
|
2150
|
+
}
|
|
2151
|
+
return target;
|
|
2152
|
+
}
|
|
2153
|
+
function _classCallCheck2(instance, Constructor) {
|
|
2154
|
+
if (!(instance instanceof Constructor)) {
|
|
2155
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
function _defineProperties2(target, props) {
|
|
2159
|
+
for (var i = 0; i < props.length; i++) {
|
|
2160
|
+
var descriptor = props[i];
|
|
2161
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
2162
|
+
descriptor.configurable = true;
|
|
2163
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
2164
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
function _createClass2(Constructor, protoProps, staticProps) {
|
|
2168
|
+
if (protoProps) _defineProperties2(Constructor.prototype, protoProps);
|
|
2169
|
+
if (staticProps) _defineProperties2(Constructor, staticProps);
|
|
2170
|
+
Object.defineProperty(Constructor, "prototype", { writable: false });
|
|
2171
|
+
return Constructor;
|
|
2172
|
+
}
|
|
2173
|
+
function _inherits2(subClass, superClass) {
|
|
2174
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
2175
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
2176
|
+
}
|
|
2177
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
2178
|
+
Object.defineProperty(subClass, "prototype", { writable: false });
|
|
2179
|
+
if (superClass) _setPrototypeOf2(subClass, superClass);
|
|
2180
|
+
}
|
|
2181
|
+
function _setPrototypeOf2(o, p) {
|
|
2182
|
+
_setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o2, p2) {
|
|
2183
|
+
o2.__proto__ = p2;
|
|
2184
|
+
return o2;
|
|
2185
|
+
};
|
|
2186
|
+
return _setPrototypeOf2(o, p);
|
|
2187
|
+
}
|
|
2188
|
+
function _createSuper2(Derived) {
|
|
2189
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
|
|
2190
|
+
return function _createSuperInternal() {
|
|
2191
|
+
var Super = _getPrototypeOf2(Derived), result;
|
|
2192
|
+
if (hasNativeReflectConstruct) {
|
|
2193
|
+
var NewTarget = _getPrototypeOf2(this).constructor;
|
|
2194
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
2195
|
+
} else {
|
|
2196
|
+
result = Super.apply(this, arguments);
|
|
2197
|
+
}
|
|
2198
|
+
return _possibleConstructorReturn2(this, result);
|
|
2199
|
+
};
|
|
2200
|
+
}
|
|
2201
|
+
function _possibleConstructorReturn2(self, call) {
|
|
2202
|
+
if (call && (_typeof3(call) === "object" || typeof call === "function")) {
|
|
2203
|
+
return call;
|
|
2204
|
+
} else if (call !== void 0) {
|
|
2205
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
2206
|
+
}
|
|
2207
|
+
return _assertThisInitialized2(self);
|
|
2208
|
+
}
|
|
2209
|
+
function _assertThisInitialized2(self) {
|
|
2210
|
+
if (self === void 0) {
|
|
2211
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2212
|
+
}
|
|
2213
|
+
return self;
|
|
2214
|
+
}
|
|
2215
|
+
function _isNativeReflectConstruct2() {
|
|
2216
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
2217
|
+
if (Reflect.construct.sham) return false;
|
|
2218
|
+
if (typeof Proxy === "function") return true;
|
|
2219
|
+
try {
|
|
2220
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2221
|
+
}));
|
|
2222
|
+
return true;
|
|
2223
|
+
} catch (e) {
|
|
2224
|
+
return false;
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
function _getPrototypeOf2(o) {
|
|
2228
|
+
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o2) {
|
|
2229
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
2230
|
+
};
|
|
2231
|
+
return _getPrototypeOf2(o);
|
|
2232
|
+
}
|
|
2233
|
+
var propTypes7 = {
|
|
2234
|
+
children: import_prop_types8.default.node,
|
|
2235
|
+
type: import_prop_types8.default.string,
|
|
2236
|
+
size: import_prop_types8.default.oneOfType([import_prop_types8.default.number, import_prop_types8.default.string]),
|
|
2237
|
+
bsSize: import_prop_types8.default.string,
|
|
2238
|
+
valid: import_prop_types8.default.bool,
|
|
2239
|
+
invalid: import_prop_types8.default.bool,
|
|
2240
|
+
tag: tagPropType,
|
|
2241
|
+
innerRef: import_prop_types8.default.oneOfType([import_prop_types8.default.object, import_prop_types8.default.func, import_prop_types8.default.string]),
|
|
2242
|
+
plaintext: import_prop_types8.default.bool,
|
|
2243
|
+
addon: import_prop_types8.default.bool,
|
|
2244
|
+
className: import_prop_types8.default.string,
|
|
2245
|
+
cssModule: import_prop_types8.default.object
|
|
2246
|
+
};
|
|
2247
|
+
var Input = /* @__PURE__ */ function(_React$Component) {
|
|
2248
|
+
_inherits2(Input2, _React$Component);
|
|
2249
|
+
var _super = _createSuper2(Input2);
|
|
2250
|
+
function Input2(props) {
|
|
2251
|
+
var _this;
|
|
2252
|
+
_classCallCheck2(this, Input2);
|
|
2253
|
+
_this = _super.call(this, props);
|
|
2254
|
+
_this.getRef = _this.getRef.bind(_assertThisInitialized2(_this));
|
|
2255
|
+
_this.focus = _this.focus.bind(_assertThisInitialized2(_this));
|
|
2256
|
+
return _this;
|
|
2257
|
+
}
|
|
2258
|
+
_createClass2(Input2, [{
|
|
2259
|
+
key: "getRef",
|
|
2260
|
+
value: function getRef(ref) {
|
|
2261
|
+
if (this.props.innerRef) {
|
|
2262
|
+
this.props.innerRef(ref);
|
|
2263
|
+
}
|
|
2264
|
+
this.ref = ref;
|
|
2265
|
+
}
|
|
2266
|
+
}, {
|
|
2267
|
+
key: "focus",
|
|
2268
|
+
value: function focus() {
|
|
2269
|
+
if (this.ref) {
|
|
2270
|
+
this.ref.focus();
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
}, {
|
|
2274
|
+
key: "render",
|
|
2275
|
+
value: function render() {
|
|
2276
|
+
var _this$props = this.props, className = _this$props.className, cssModule = _this$props.cssModule, _this$props$type = _this$props.type, type = _this$props$type === void 0 ? "text" : _this$props$type, bsSize = _this$props.bsSize, valid = _this$props.valid, invalid = _this$props.invalid, tag = _this$props.tag, addon = _this$props.addon, plaintext = _this$props.plaintext, innerRef = _this$props.innerRef, attributes = _objectWithoutProperties7(_this$props, _excluded7);
|
|
2277
|
+
var checkInput = ["switch", "radio", "checkbox"].indexOf(type) > -1;
|
|
2278
|
+
var isNotaNumber = /\D/g;
|
|
2279
|
+
var textareaInput = type === "textarea";
|
|
2280
|
+
var selectInput = type === "select";
|
|
2281
|
+
var rangeInput = type === "range";
|
|
2282
|
+
var Tag = tag || (selectInput || textareaInput ? type : "input");
|
|
2283
|
+
var formControlClass = "form-control";
|
|
2284
|
+
if (plaintext) {
|
|
2285
|
+
formControlClass = "".concat(formControlClass, "-plaintext");
|
|
2286
|
+
Tag = tag || "input";
|
|
2287
|
+
} else if (rangeInput) {
|
|
2288
|
+
formControlClass = "form-range";
|
|
2289
|
+
} else if (selectInput) {
|
|
2290
|
+
formControlClass = "form-select";
|
|
2291
|
+
} else if (checkInput) {
|
|
2292
|
+
if (addon) {
|
|
2293
|
+
formControlClass = null;
|
|
2294
|
+
} else {
|
|
2295
|
+
formControlClass = "form-check-input";
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
if (attributes.size && isNotaNumber.test(attributes.size)) {
|
|
2299
|
+
warnOnce(`Please use the prop "bsSize" instead of the "size" to bootstrap's input sizing.`);
|
|
2300
|
+
bsSize = attributes.size;
|
|
2301
|
+
delete attributes.size;
|
|
2302
|
+
}
|
|
2303
|
+
var classes = mapToCssModules((0, import_classnames7.default)(className, invalid && "is-invalid", valid && "is-valid", bsSize ? selectInput ? "form-select-".concat(bsSize) : "form-control-".concat(bsSize) : false, formControlClass), cssModule);
|
|
2304
|
+
if (Tag === "input" || tag && typeof tag === "function") {
|
|
2305
|
+
attributes.type = type === "switch" ? "checkbox" : type;
|
|
2306
|
+
}
|
|
2307
|
+
if (attributes.children && !(plaintext || type === "select" || typeof Tag !== "string" || Tag === "select")) {
|
|
2308
|
+
warnOnce('Input with a type of "'.concat(type, '" cannot have children. Please use "value"/"defaultValue" instead.'));
|
|
2309
|
+
delete attributes.children;
|
|
2310
|
+
}
|
|
2311
|
+
return /* @__PURE__ */ React10.createElement(Tag, _extends7({}, attributes, {
|
|
2312
|
+
ref: innerRef,
|
|
2313
|
+
className: classes,
|
|
2314
|
+
"aria-invalid": invalid
|
|
2315
|
+
}));
|
|
2316
|
+
}
|
|
2317
|
+
}]);
|
|
2318
|
+
return Input2;
|
|
2319
|
+
}(React10.Component);
|
|
2320
|
+
Input.propTypes = propTypes7;
|
|
2321
|
+
var Input_default = Input;
|
|
2322
|
+
|
|
2323
|
+
// node_modules/reactstrap/esm/InputGroup.js
|
|
2324
|
+
var import_prop_types9 = __toESM(require_prop_types());
|
|
2325
|
+
var import_classnames8 = __toESM(require_classnames());
|
|
2326
|
+
import React11 from "react";
|
|
2327
|
+
var _excluded8 = ["className", "cssModule", "tag", "type", "size"];
|
|
2328
|
+
function _extends8() {
|
|
2329
|
+
_extends8 = Object.assign ? Object.assign.bind() : function(target) {
|
|
2330
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2331
|
+
var source = arguments[i];
|
|
2332
|
+
for (var key in source) {
|
|
2333
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2334
|
+
target[key] = source[key];
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
return target;
|
|
2339
|
+
};
|
|
2340
|
+
return _extends8.apply(this, arguments);
|
|
2341
|
+
}
|
|
2342
|
+
function _objectWithoutProperties8(source, excluded) {
|
|
2343
|
+
if (source == null) return {};
|
|
2344
|
+
var target = _objectWithoutPropertiesLoose8(source, excluded);
|
|
2345
|
+
var key, i;
|
|
2346
|
+
if (Object.getOwnPropertySymbols) {
|
|
2347
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2348
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
2349
|
+
key = sourceSymbolKeys[i];
|
|
2350
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2351
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2352
|
+
target[key] = source[key];
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
return target;
|
|
2356
|
+
}
|
|
2357
|
+
function _objectWithoutPropertiesLoose8(source, excluded) {
|
|
2358
|
+
if (source == null) return {};
|
|
2359
|
+
var target = {};
|
|
2360
|
+
var sourceKeys = Object.keys(source);
|
|
2361
|
+
var key, i;
|
|
2362
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2363
|
+
key = sourceKeys[i];
|
|
2364
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2365
|
+
target[key] = source[key];
|
|
2366
|
+
}
|
|
2367
|
+
return target;
|
|
2368
|
+
}
|
|
2369
|
+
var propTypes8 = {
|
|
2370
|
+
/** Add custom class */
|
|
2371
|
+
className: import_prop_types9.default.string,
|
|
2372
|
+
/** Change underlying component's CSS base class name */
|
|
2373
|
+
cssModule: import_prop_types9.default.object,
|
|
2374
|
+
/** Sets size of InputGroup */
|
|
2375
|
+
size: import_prop_types9.default.string,
|
|
2376
|
+
/** Set a custom element for this component */
|
|
2377
|
+
tag: tagPropType,
|
|
2378
|
+
type: import_prop_types9.default.string
|
|
2379
|
+
};
|
|
2380
|
+
function InputGroup(props) {
|
|
2381
|
+
var className = props.className, cssModule = props.cssModule, _props$tag = props.tag, Tag = _props$tag === void 0 ? "div" : _props$tag, type = props.type, size = props.size, attributes = _objectWithoutProperties8(props, _excluded8);
|
|
2382
|
+
var classes = mapToCssModules((0, import_classnames8.default)(className, "input-group", size ? "input-group-".concat(size) : null), cssModule);
|
|
2383
|
+
if (props.type === "dropdown") {
|
|
2384
|
+
return /* @__PURE__ */ React11.createElement(Dropdown_default, _extends8({}, attributes, {
|
|
2385
|
+
className: classes
|
|
2386
|
+
}));
|
|
2387
|
+
}
|
|
2388
|
+
return /* @__PURE__ */ React11.createElement(InputGroupContext.Provider, {
|
|
2389
|
+
value: {
|
|
2390
|
+
insideInputGroup: true
|
|
2391
|
+
}
|
|
2392
|
+
}, /* @__PURE__ */ React11.createElement(Tag, _extends8({}, attributes, {
|
|
2393
|
+
className: classes
|
|
2394
|
+
})));
|
|
2395
|
+
}
|
|
2396
|
+
InputGroup.propTypes = propTypes8;
|
|
2397
|
+
var InputGroup_default = InputGroup;
|
|
2398
|
+
|
|
2399
|
+
// node_modules/reactstrap/esm/InputGroupText.js
|
|
2400
|
+
var import_prop_types10 = __toESM(require_prop_types());
|
|
2401
|
+
var import_classnames9 = __toESM(require_classnames());
|
|
2402
|
+
import React12 from "react";
|
|
2403
|
+
var _excluded9 = ["className", "cssModule", "tag"];
|
|
2404
|
+
function _extends9() {
|
|
2405
|
+
_extends9 = Object.assign ? Object.assign.bind() : function(target) {
|
|
2406
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2407
|
+
var source = arguments[i];
|
|
2408
|
+
for (var key in source) {
|
|
2409
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2410
|
+
target[key] = source[key];
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
return target;
|
|
2415
|
+
};
|
|
2416
|
+
return _extends9.apply(this, arguments);
|
|
2417
|
+
}
|
|
2418
|
+
function _objectWithoutProperties9(source, excluded) {
|
|
2419
|
+
if (source == null) return {};
|
|
2420
|
+
var target = _objectWithoutPropertiesLoose9(source, excluded);
|
|
2421
|
+
var key, i;
|
|
2422
|
+
if (Object.getOwnPropertySymbols) {
|
|
2423
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2424
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
2425
|
+
key = sourceSymbolKeys[i];
|
|
2426
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2427
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2428
|
+
target[key] = source[key];
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
return target;
|
|
2432
|
+
}
|
|
2433
|
+
function _objectWithoutPropertiesLoose9(source, excluded) {
|
|
2434
|
+
if (source == null) return {};
|
|
2435
|
+
var target = {};
|
|
2436
|
+
var sourceKeys = Object.keys(source);
|
|
2437
|
+
var key, i;
|
|
2438
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2439
|
+
key = sourceKeys[i];
|
|
2440
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2441
|
+
target[key] = source[key];
|
|
2442
|
+
}
|
|
2443
|
+
return target;
|
|
2444
|
+
}
|
|
2445
|
+
var propTypes9 = {
|
|
2446
|
+
/** Add custom class */
|
|
2447
|
+
className: import_prop_types10.default.string,
|
|
2448
|
+
/** Change underlying component's CSS base class name */
|
|
2449
|
+
cssModule: import_prop_types10.default.object,
|
|
2450
|
+
/** Set a custom element for this component */
|
|
2451
|
+
tag: tagPropType
|
|
2452
|
+
};
|
|
2453
|
+
function InputGroupText(props) {
|
|
2454
|
+
var className = props.className, cssModule = props.cssModule, _props$tag = props.tag, Tag = _props$tag === void 0 ? "span" : _props$tag, attributes = _objectWithoutProperties9(props, _excluded9);
|
|
2455
|
+
var classes = mapToCssModules((0, import_classnames9.default)(className, "input-group-text"), cssModule);
|
|
2456
|
+
return /* @__PURE__ */ React12.createElement(Tag, _extends9({}, attributes, {
|
|
2457
|
+
className: classes
|
|
2458
|
+
}));
|
|
2459
|
+
}
|
|
2460
|
+
InputGroupText.propTypes = propTypes9;
|
|
2461
|
+
var InputGroupText_default = InputGroupText;
|
|
2462
|
+
|
|
2463
|
+
// node_modules/reactstrap/esm/Label.js
|
|
2464
|
+
var import_prop_types11 = __toESM(require_prop_types());
|
|
2465
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
2466
|
+
import React13 from "react";
|
|
2467
|
+
var _excluded10 = ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"];
|
|
2468
|
+
function _extends10() {
|
|
2469
|
+
_extends10 = Object.assign ? Object.assign.bind() : function(target) {
|
|
2470
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2471
|
+
var source = arguments[i];
|
|
2472
|
+
for (var key in source) {
|
|
2473
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2474
|
+
target[key] = source[key];
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
return target;
|
|
2479
|
+
};
|
|
2480
|
+
return _extends10.apply(this, arguments);
|
|
2481
|
+
}
|
|
2482
|
+
function _defineProperty4(obj, key, value) {
|
|
2483
|
+
if (key in obj) {
|
|
2484
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
2485
|
+
} else {
|
|
2486
|
+
obj[key] = value;
|
|
2487
|
+
}
|
|
2488
|
+
return obj;
|
|
2489
|
+
}
|
|
2490
|
+
function _objectWithoutProperties10(source, excluded) {
|
|
2491
|
+
if (source == null) return {};
|
|
2492
|
+
var target = _objectWithoutPropertiesLoose10(source, excluded);
|
|
2493
|
+
var key, i;
|
|
2494
|
+
if (Object.getOwnPropertySymbols) {
|
|
2495
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2496
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
2497
|
+
key = sourceSymbolKeys[i];
|
|
2498
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2499
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2500
|
+
target[key] = source[key];
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
return target;
|
|
2504
|
+
}
|
|
2505
|
+
function _objectWithoutPropertiesLoose10(source, excluded) {
|
|
2506
|
+
if (source == null) return {};
|
|
2507
|
+
var target = {};
|
|
2508
|
+
var sourceKeys = Object.keys(source);
|
|
2509
|
+
var key, i;
|
|
2510
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2511
|
+
key = sourceKeys[i];
|
|
2512
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2513
|
+
target[key] = source[key];
|
|
2514
|
+
}
|
|
2515
|
+
return target;
|
|
2516
|
+
}
|
|
2517
|
+
var colWidths2 = ["xs", "sm", "md", "lg", "xl", "xxl"];
|
|
2518
|
+
var stringOrNumberProp2 = import_prop_types11.default.oneOfType([import_prop_types11.default.number, import_prop_types11.default.string]);
|
|
2519
|
+
var columnProps2 = import_prop_types11.default.oneOfType([import_prop_types11.default.bool, import_prop_types11.default.string, import_prop_types11.default.number, import_prop_types11.default.shape({
|
|
2520
|
+
size: stringOrNumberProp2,
|
|
2521
|
+
order: stringOrNumberProp2,
|
|
2522
|
+
offset: stringOrNumberProp2
|
|
2523
|
+
})]);
|
|
2524
|
+
var propTypes10 = {
|
|
2525
|
+
children: import_prop_types11.default.node,
|
|
2526
|
+
hidden: import_prop_types11.default.bool,
|
|
2527
|
+
check: import_prop_types11.default.bool,
|
|
2528
|
+
size: import_prop_types11.default.string,
|
|
2529
|
+
"for": import_prop_types11.default.string,
|
|
2530
|
+
tag: tagPropType,
|
|
2531
|
+
className: import_prop_types11.default.string,
|
|
2532
|
+
cssModule: import_prop_types11.default.object,
|
|
2533
|
+
xs: columnProps2,
|
|
2534
|
+
sm: columnProps2,
|
|
2535
|
+
md: columnProps2,
|
|
2536
|
+
lg: columnProps2,
|
|
2537
|
+
xl: columnProps2,
|
|
2538
|
+
xxl: columnProps2,
|
|
2539
|
+
widths: import_prop_types11.default.array
|
|
2540
|
+
};
|
|
2541
|
+
var getColumnSizeClass3 = function getColumnSizeClass4(isXs, colWidth, colSize) {
|
|
2542
|
+
if (colSize === true || colSize === "") {
|
|
2543
|
+
return isXs ? "col" : "col-".concat(colWidth);
|
|
2544
|
+
}
|
|
2545
|
+
if (colSize === "auto") {
|
|
2546
|
+
return isXs ? "col-auto" : "col-".concat(colWidth, "-auto");
|
|
2547
|
+
}
|
|
2548
|
+
return isXs ? "col-".concat(colSize) : "col-".concat(colWidth, "-").concat(colSize);
|
|
2549
|
+
};
|
|
2550
|
+
function Label(props) {
|
|
2551
|
+
var className = props.className, cssModule = props.cssModule, hidden = props.hidden, _props$widths = props.widths, widths = _props$widths === void 0 ? colWidths2 : _props$widths, _props$tag = props.tag, Tag = _props$tag === void 0 ? "label" : _props$tag, check = props.check, size = props.size, htmlFor = props["for"], attributes = _objectWithoutProperties10(props, _excluded10);
|
|
2552
|
+
var colClasses = [];
|
|
2553
|
+
widths.forEach(function(colWidth, i) {
|
|
2554
|
+
var columnProp = props[colWidth];
|
|
2555
|
+
delete attributes[colWidth];
|
|
2556
|
+
if (!columnProp && columnProp !== "") {
|
|
2557
|
+
return;
|
|
2558
|
+
}
|
|
2559
|
+
var isXs = !i;
|
|
2560
|
+
var colClass;
|
|
2561
|
+
if (isObject(columnProp)) {
|
|
2562
|
+
var _classNames;
|
|
2563
|
+
var colSizeInterfix = isXs ? "-" : "-".concat(colWidth, "-");
|
|
2564
|
+
colClass = getColumnSizeClass3(isXs, colWidth, columnProp.size);
|
|
2565
|
+
colClasses.push(mapToCssModules((0, import_classnames10.default)((_classNames = {}, _defineProperty4(_classNames, colClass, columnProp.size || columnProp.size === ""), _defineProperty4(_classNames, "order".concat(colSizeInterfix).concat(columnProp.order), columnProp.order || columnProp.order === 0), _defineProperty4(_classNames, "offset".concat(colSizeInterfix).concat(columnProp.offset), columnProp.offset || columnProp.offset === 0), _classNames))), cssModule);
|
|
2566
|
+
} else {
|
|
2567
|
+
colClass = getColumnSizeClass3(isXs, colWidth, columnProp);
|
|
2568
|
+
colClasses.push(colClass);
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
var colFormLabel = size || colClasses.length;
|
|
2572
|
+
var formLabel = !(check || colFormLabel);
|
|
2573
|
+
var classes = mapToCssModules((0, import_classnames10.default)(className, hidden ? "visually-hidden" : false, check ? "form-check-label" : false, size ? "col-form-label-".concat(size) : false, colClasses, colFormLabel ? "col-form-label" : false, formLabel ? "form-label" : false), cssModule);
|
|
2574
|
+
return /* @__PURE__ */ React13.createElement(Tag, _extends10({
|
|
2575
|
+
htmlFor
|
|
2576
|
+
}, attributes, {
|
|
2577
|
+
className: classes
|
|
2578
|
+
}));
|
|
2579
|
+
}
|
|
2580
|
+
Label.propTypes = propTypes10;
|
|
2581
|
+
var Label_default = Label;
|
|
2582
|
+
|
|
2583
|
+
// src/components/DsDynamicForm.tsx
|
|
2584
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2585
|
+
var debugging = true;
|
|
2586
|
+
var globals = {
|
|
2587
|
+
parameters: {
|
|
2588
|
+
debugging,
|
|
2589
|
+
local: true,
|
|
2590
|
+
production: false,
|
|
2591
|
+
use_navigate: false,
|
|
2592
|
+
save_failed_alert: false,
|
|
2593
|
+
form_version: "1.0",
|
|
2594
|
+
form_modified_version: 2
|
|
2595
|
+
}
|
|
2596
|
+
};
|
|
2597
|
+
var DsDynamicForm = class extends Component {
|
|
2598
|
+
constructor(props) {
|
|
2599
|
+
super(props);
|
|
2600
|
+
this.componentDidMount = () => {
|
|
2601
|
+
if (this.props.form) {
|
|
2602
|
+
this.clearForm();
|
|
2603
|
+
}
|
|
2604
|
+
};
|
|
2605
|
+
/**
|
|
2606
|
+
* Prototype : clearForm
|
|
2607
|
+
*/
|
|
2608
|
+
this.clearForm = () => {
|
|
2609
|
+
this.setState(
|
|
2610
|
+
{ fieldError: {}, form: { Rows: [] }, captcha1: Randomize(0, 5), captcha2: Randomize(0, 5) },
|
|
2611
|
+
//Clear forced
|
|
2612
|
+
() => {
|
|
2613
|
+
this.setState({ form: this.props.form || { Rows: [] }, fieldError: {} });
|
|
2614
|
+
}
|
|
2615
|
+
);
|
|
2616
|
+
let duplicate_data_tier = this.props.data_blob && this.props.data_blob.data_tier ? JSON.parse(JSON.stringify(this.props.data_blob.data_tier)) : {};
|
|
2617
|
+
this.local_data_blob = { data_tier: {} };
|
|
2618
|
+
if (this.props.foreign_keys && typeof this.props.foreign_keys !== "object")
|
|
2619
|
+
throw new Error("foreign_keys must be a json object !");
|
|
2620
|
+
this.local_data_blob.data_tier = Object.assign(this.props.foreign_keys ? this.props.foreign_keys : {}, duplicate_data_tier);
|
|
2621
|
+
if (globals.parameters.debugging)
|
|
2622
|
+
console.log("clearForm->this.local_data_blob.data_tier =>", this.local_data_blob.data_tier);
|
|
2623
|
+
};
|
|
2624
|
+
this.getFieldData = (fieldName) => {
|
|
2625
|
+
let nextFieldData = this.local_data_blob.data_tier[fieldName] ? this.local_data_blob.data_tier[fieldName] : "";
|
|
2626
|
+
return nextFieldData;
|
|
2627
|
+
};
|
|
2628
|
+
this.setFieldData = (fieldName, value) => {
|
|
2629
|
+
try {
|
|
2630
|
+
if (globals.parameters.debugging)
|
|
2631
|
+
console.log("setFieldData:fieldName ->", fieldName, " value ->", value);
|
|
2632
|
+
let duplicate_data_tier = JSON.parse(JSON.stringify(this.local_data_blob.data_tier));
|
|
2633
|
+
duplicate_data_tier[fieldName] = value;
|
|
2634
|
+
this.local_data_blob.data_tier = duplicate_data_tier;
|
|
2635
|
+
} catch (error) {
|
|
2636
|
+
alert(error);
|
|
2637
|
+
}
|
|
2638
|
+
if (this.props.onFormChange)
|
|
2639
|
+
this.props.onFormChange(this.local_data_blob.data_tier);
|
|
2640
|
+
};
|
|
2641
|
+
this.setFieldError = (pFieldObject, value) => {
|
|
2642
|
+
try {
|
|
2643
|
+
let nextFieldError = this.state.fieldError || {};
|
|
2644
|
+
nextFieldError[pFieldObject.name] = value;
|
|
2645
|
+
this.setState({ fieldError: nextFieldError });
|
|
2646
|
+
WScrollTo(pFieldObject.name);
|
|
2647
|
+
} catch (e) {
|
|
2648
|
+
console.error(`Error caught on ${e}`);
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2651
|
+
this.getFieldError = (pFieldObject) => {
|
|
2652
|
+
try {
|
|
2653
|
+
if (globals.parameters.debugging)
|
|
2654
|
+
console.log(`getFieldError(${JSON.stringify(pFieldObject)}) -> ${this.state.fieldError}`);
|
|
2655
|
+
let dbg = this.state.fieldError && this.state.fieldError[pFieldObject.name] ? this.state.fieldError[pFieldObject.name] : "";
|
|
2656
|
+
return `${dbg}`;
|
|
2657
|
+
} catch (e) {
|
|
2658
|
+
console.error(`getFieldError raises -> ${e}`);
|
|
2659
|
+
return ``;
|
|
2660
|
+
}
|
|
2661
|
+
};
|
|
2662
|
+
this._error_label = (field) => {
|
|
2663
|
+
return /* @__PURE__ */ jsx("label", { className: "dynamic-form-error", children: this.getFieldError(field) });
|
|
2664
|
+
};
|
|
2665
|
+
this.getFieldLabelTitle = (pFieldObject) => {
|
|
2666
|
+
return /* @__PURE__ */ jsxs("h6", { id: pFieldObject.name, children: [
|
|
2667
|
+
pFieldObject.title ? pFieldObject.title : pFieldObject.placeholder,
|
|
2668
|
+
pFieldObject.required && !this.props.read_only && /* @__PURE__ */ jsx("span", { className: "icon-danger", children: "*" })
|
|
2669
|
+
] });
|
|
2670
|
+
};
|
|
2671
|
+
this.getCaptchaFieldLabelTitle = (pFieldObject) => {
|
|
2672
|
+
return /* @__PURE__ */ jsxs("h6", { id: pFieldObject.name, children: [
|
|
2673
|
+
`${this.state.captcha1} + ${this.state.captcha2}`,
|
|
2674
|
+
pFieldObject.required && /* @__PURE__ */ jsx("span", { className: "icon-danger", children: "*" })
|
|
2675
|
+
] });
|
|
2676
|
+
};
|
|
2677
|
+
this.getFieldPrompt = (pFieldObject) => {
|
|
2678
|
+
return pFieldObject.placeholder ? pFieldObject.placeholder : pFieldObject.title || "";
|
|
2679
|
+
};
|
|
2680
|
+
this._numeric_field_with_add_on = (field, fa_symbol) => {
|
|
2681
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2682
|
+
this.getFieldLabelTitle(field),
|
|
2683
|
+
/* @__PURE__ */ jsxs(InputGroup_default, { className: "border-input", children: [
|
|
2684
|
+
/* @__PURE__ */ jsx(
|
|
2685
|
+
Input_default,
|
|
2686
|
+
{
|
|
2687
|
+
readOnly: this.props.read_only ? this.props.read_only : false,
|
|
2688
|
+
type: field.input_type,
|
|
2689
|
+
value: this.getFieldData(field.name),
|
|
2690
|
+
placeholder: field.placeholder,
|
|
2691
|
+
autoComplete: "on",
|
|
2692
|
+
id: field.name,
|
|
2693
|
+
name: field.name,
|
|
2694
|
+
onChange: (e) => {
|
|
2695
|
+
e.preventDefault();
|
|
2696
|
+
this.dynamicInputNumericChangeHandler({ event: e, fieldObject: field });
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
),
|
|
2700
|
+
fa_symbol && /* @__PURE__ */ jsx("div", { className: "input-group-append", children: /* @__PURE__ */ jsx(InputGroupText_default, { children: /* @__PURE__ */ jsx("i", { className: `fa ${fa_symbol}` }) }) })
|
|
2701
|
+
] }),
|
|
2702
|
+
this._error_label(field)
|
|
2703
|
+
] });
|
|
2704
|
+
};
|
|
2705
|
+
this._captcha_field = (field, fa_symbol) => {
|
|
2706
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2707
|
+
this.getCaptchaFieldLabelTitle(field),
|
|
2708
|
+
/* @__PURE__ */ jsx(InputGroup_default, { className: "border-input", children: /* @__PURE__ */ jsx(
|
|
2709
|
+
Input_default,
|
|
2710
|
+
{
|
|
2711
|
+
readOnly: this.props.read_only ? this.props.read_only : false,
|
|
2712
|
+
type: field.input_type,
|
|
2713
|
+
value: this.getFieldData(field.name),
|
|
2714
|
+
placeholder: field.placeholder,
|
|
2715
|
+
autoComplete: "on",
|
|
2716
|
+
id: field.name,
|
|
2717
|
+
name: field.name,
|
|
2718
|
+
onChange: (e) => {
|
|
2719
|
+
e.preventDefault();
|
|
2720
|
+
this.dynamicInputNumericChangeHandler({ event: e, fieldObject: field });
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
) }),
|
|
2724
|
+
this._error_label(field)
|
|
2725
|
+
] });
|
|
2726
|
+
};
|
|
2727
|
+
this._text_field = (field) => {
|
|
2728
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2729
|
+
this.getFieldLabelTitle(field),
|
|
2730
|
+
/* @__PURE__ */ jsx(
|
|
2731
|
+
Input_default,
|
|
2732
|
+
{
|
|
2733
|
+
readOnly: this.props.read_only ? this.props.read_only : false,
|
|
2734
|
+
type: field.input_type,
|
|
2735
|
+
value: this.getFieldData(field.name),
|
|
2736
|
+
placeholder: field.placeholder,
|
|
2737
|
+
autoComplete: "off",
|
|
2738
|
+
onChange: (e) => {
|
|
2739
|
+
e.preventDefault();
|
|
2740
|
+
this.dynamicInputTextChangeHandler({ event: e, fieldObject: field });
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
),
|
|
2744
|
+
this._error_label(field)
|
|
2745
|
+
] });
|
|
2746
|
+
};
|
|
2747
|
+
this._email_field = (field) => {
|
|
2748
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2749
|
+
this.getFieldLabelTitle(field),
|
|
2750
|
+
/* @__PURE__ */ jsx(
|
|
2751
|
+
Input_default,
|
|
2752
|
+
{
|
|
2753
|
+
readOnly: this.props.read_only ? this.props.read_only : false,
|
|
2754
|
+
type: field.input_type,
|
|
2755
|
+
value: this.getFieldData(field.name),
|
|
2756
|
+
placeholder: field.placeholder,
|
|
2757
|
+
pattern: "[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$",
|
|
2758
|
+
autoComplete: "on",
|
|
2759
|
+
id: field.name,
|
|
2760
|
+
name: field.name,
|
|
2761
|
+
onChange: (e) => {
|
|
2762
|
+
e.preventDefault();
|
|
2763
|
+
this.dynamicInputTextChangeHandler({ event: e, fieldObject: field });
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
),
|
|
2767
|
+
this._error_label(field)
|
|
2768
|
+
] });
|
|
2769
|
+
};
|
|
2770
|
+
this._memo_field = (field) => {
|
|
2771
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2772
|
+
this.getFieldLabelTitle(field),
|
|
2773
|
+
/* @__PURE__ */ jsx(
|
|
2774
|
+
"textarea",
|
|
2775
|
+
{
|
|
2776
|
+
className: "form-control",
|
|
2777
|
+
readOnly: this.props.read_only ? this.props.read_only : false,
|
|
2778
|
+
value: this.getFieldData(field.name),
|
|
2779
|
+
placeholder: field.placeholder,
|
|
2780
|
+
rows: field.rows,
|
|
2781
|
+
onChange: (e) => {
|
|
2782
|
+
e.preventDefault();
|
|
2783
|
+
this.dynamicInputTextChangeHandler({ event: e, fieldObject: field });
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
),
|
|
2787
|
+
this._error_label(field)
|
|
2788
|
+
] });
|
|
2789
|
+
};
|
|
2790
|
+
this._combo_field = (field) => {
|
|
2791
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2792
|
+
this.getFieldLabelTitle(field),
|
|
2793
|
+
/* @__PURE__ */ jsx(
|
|
2794
|
+
Multiselect,
|
|
2795
|
+
{
|
|
2796
|
+
showArrow: true,
|
|
2797
|
+
options: field.combo_list || [],
|
|
2798
|
+
isObject: false,
|
|
2799
|
+
displayValue: "key",
|
|
2800
|
+
selectedValues: this.getFieldData(field.name) ? this.getFieldData(field.name).split(";") : [],
|
|
2801
|
+
placeholder: field.placeholder,
|
|
2802
|
+
emptyRecordMsg: "",
|
|
2803
|
+
onSelect: (selectedList, selectedItem) => {
|
|
2804
|
+
this.setFieldData(field.name, selectedList.join(";"));
|
|
2805
|
+
},
|
|
2806
|
+
onRemove: (selectedList, selectedItem) => {
|
|
2807
|
+
this.setFieldData(field.name, selectedList.join(";"));
|
|
2808
|
+
},
|
|
2809
|
+
disable: this.props.read_only,
|
|
2810
|
+
singleSelect: true
|
|
2811
|
+
}
|
|
2812
|
+
),
|
|
2813
|
+
this._error_label(field)
|
|
2814
|
+
] });
|
|
2815
|
+
};
|
|
2816
|
+
this._multi_field = (field) => {
|
|
2817
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2818
|
+
this.getFieldLabelTitle(field),
|
|
2819
|
+
/* @__PURE__ */ jsx(
|
|
2820
|
+
Multiselect,
|
|
2821
|
+
{
|
|
2822
|
+
showArrow: true,
|
|
2823
|
+
options: field.combo_list || [],
|
|
2824
|
+
isObject: false,
|
|
2825
|
+
displayValue: "key",
|
|
2826
|
+
selectedValues: this.getFieldData(field.name) ? this.getFieldData(field.name).split(";") : [],
|
|
2827
|
+
placeholder: field.placeholder,
|
|
2828
|
+
emptyRecordMsg: "",
|
|
2829
|
+
onSelect: (selectedList, selectedItem) => {
|
|
2830
|
+
this.setFieldData(field.name, selectedList.join(";"));
|
|
2831
|
+
},
|
|
2832
|
+
onRemove: (selectedList, selectedItem) => {
|
|
2833
|
+
this.setFieldData(field.name, selectedList.join(";"));
|
|
2834
|
+
},
|
|
2835
|
+
disable: this.props.read_only,
|
|
2836
|
+
singleSelect: false
|
|
2837
|
+
}
|
|
2838
|
+
),
|
|
2839
|
+
this._error_label(field)
|
|
2840
|
+
] });
|
|
2841
|
+
};
|
|
2842
|
+
this._date_field = (field) => {
|
|
2843
|
+
return /* @__PURE__ */ jsxs("div", { className: "date-div", children: [
|
|
2844
|
+
this.getFieldLabelTitle(field),
|
|
2845
|
+
/* @__PURE__ */ jsxs("div", { className: "date-day-month-year-container-div", children: [
|
|
2846
|
+
/* @__PURE__ */ jsx("div", { className: "date-day-div", children: /* @__PURE__ */ jsx(
|
|
2847
|
+
Multiselect,
|
|
2848
|
+
{
|
|
2849
|
+
showArrow: true,
|
|
2850
|
+
options: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"],
|
|
2851
|
+
isObject: false,
|
|
2852
|
+
displayValue: "key",
|
|
2853
|
+
selectedValues: this.getFieldData(field.name_hour || "") ? this.getFieldData(field.name_hour || "").split(";") : [],
|
|
2854
|
+
placeholder: field.placeholder,
|
|
2855
|
+
emptyRecordMsg: "",
|
|
2856
|
+
onSelect: (selectedList, selectedItem) => {
|
|
2857
|
+
this.handle_date_picker({ fieldObject: field, sub_field_name: field.name_day || "", value: selectedList.join(";") });
|
|
2858
|
+
},
|
|
2859
|
+
onRemove: (selectedList, selectedItem) => {
|
|
2860
|
+
this.handle_date_picker({ fieldObject: field, sub_field_name: field.name_day || "", value: selectedList.join(";") });
|
|
2861
|
+
},
|
|
2862
|
+
disable: this.props.read_only,
|
|
2863
|
+
singleSelect: true
|
|
2864
|
+
}
|
|
2865
|
+
) }),
|
|
2866
|
+
/* @__PURE__ */ jsx("div", { className: "date-month-div", children: /* @__PURE__ */ jsx(
|
|
2867
|
+
Multiselect,
|
|
2868
|
+
{
|
|
2869
|
+
showArrow: false,
|
|
2870
|
+
options: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
|
|
2871
|
+
isObject: false,
|
|
2872
|
+
displayValue: "key",
|
|
2873
|
+
selectedValues: this.getFieldData(field.name_min || "") ? this.getFieldData(field.name_min || "").split(";") : [],
|
|
2874
|
+
placeholder: field.placeholder,
|
|
2875
|
+
emptyRecordMsg: "",
|
|
2876
|
+
onSelect: (selectedList, selectedItem) => {
|
|
2877
|
+
this.handle_date_picker({ fieldObject: field, sub_field_name: field.name_month || "", value: selectedList.join(";") });
|
|
2878
|
+
},
|
|
2879
|
+
onRemove: (selectedList, selectedItem) => {
|
|
2880
|
+
this.handle_date_picker({ fieldObject: field, sub_field_name: field.name_month || "", value: selectedList.join(";") });
|
|
2881
|
+
},
|
|
2882
|
+
disable: this.props.read_only,
|
|
2883
|
+
singleSelect: true
|
|
2884
|
+
}
|
|
2885
|
+
) }),
|
|
2886
|
+
/* @__PURE__ */ jsx("div", { className: "date-year-div", children: /* @__PURE__ */ jsx(
|
|
2887
|
+
Multiselect,
|
|
2888
|
+
{
|
|
2889
|
+
showArrow: false,
|
|
2890
|
+
options: ["2025", "2026", "2027", "2028", "2030"],
|
|
2891
|
+
isObject: false,
|
|
2892
|
+
displayValue: "key",
|
|
2893
|
+
selectedValues: this.getFieldData(field.name_min || "") ? this.getFieldData(field.name_min || "").split(";") : [],
|
|
2894
|
+
placeholder: field.placeholder,
|
|
2895
|
+
emptyRecordMsg: "",
|
|
2896
|
+
onSelect: (selectedList, selectedItem) => {
|
|
2897
|
+
this.handle_date_picker({ fieldObject: field, sub_field_name: field.name_year || "", value: selectedList.join(";") });
|
|
2898
|
+
},
|
|
2899
|
+
onRemove: (selectedList, selectedItem) => {
|
|
2900
|
+
this.handle_date_picker({ fieldObject: field, sub_field_name: field.name_year || "", value: selectedList.join(";") });
|
|
2901
|
+
},
|
|
2902
|
+
disable: this.props.read_only,
|
|
2903
|
+
singleSelect: true
|
|
2904
|
+
}
|
|
2905
|
+
) })
|
|
2906
|
+
] }),
|
|
2907
|
+
this._error_label(field)
|
|
2908
|
+
] });
|
|
2909
|
+
};
|
|
2910
|
+
this._time_field = (field) => {
|
|
2911
|
+
return /* @__PURE__ */ jsxs("div", { className: "time-div", children: [
|
|
2912
|
+
this.getFieldLabelTitle(field),
|
|
2913
|
+
/* @__PURE__ */ jsxs("div", { className: "time-hour-and-min-container-div", children: [
|
|
2914
|
+
/* @__PURE__ */ jsx("div", { className: "time-hour-div", children: /* @__PURE__ */ jsx(
|
|
2915
|
+
Multiselect,
|
|
2916
|
+
{
|
|
2917
|
+
showArrow: true,
|
|
2918
|
+
options: ["07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22"],
|
|
2919
|
+
isObject: false,
|
|
2920
|
+
displayValue: "key",
|
|
2921
|
+
selectedValues: this.getFieldData(field.name_hour || "") ? this.getFieldData(field.name_hour || "").split(";") : [],
|
|
2922
|
+
placeholder: field.placeholder,
|
|
2923
|
+
emptyRecordMsg: "",
|
|
2924
|
+
onSelect: (selectedList, selectedItem) => {
|
|
2925
|
+
this.handle_time_picker({ fieldObject: field, sub_field_name: field.name_hour || "", value: selectedList.join(";") });
|
|
2926
|
+
},
|
|
2927
|
+
onRemove: (selectedList, selectedItem) => {
|
|
2928
|
+
this.handle_time_picker({ fieldObject: field, sub_field_name: field.name_hour || "", value: selectedList.join(";") });
|
|
2929
|
+
},
|
|
2930
|
+
disable: this.props.read_only,
|
|
2931
|
+
singleSelect: true
|
|
2932
|
+
}
|
|
2933
|
+
) }),
|
|
2934
|
+
/* @__PURE__ */ jsx("div", { className: "time-min-div", children: /* @__PURE__ */ jsx(
|
|
2935
|
+
Multiselect,
|
|
2936
|
+
{
|
|
2937
|
+
showArrow: false,
|
|
2938
|
+
options: ["00", "15", "20", "25", "30", "35", "40", "45", "50", "55"],
|
|
2939
|
+
isObject: false,
|
|
2940
|
+
displayValue: "key",
|
|
2941
|
+
selectedValues: this.getFieldData(field.name_min || "") ? this.getFieldData(field.name_min || "").split(";") : [],
|
|
2942
|
+
placeholder: field.placeholder,
|
|
2943
|
+
emptyRecordMsg: "",
|
|
2944
|
+
onSelect: (selectedList, selectedItem) => {
|
|
2945
|
+
this.handle_time_picker({ fieldObject: field, sub_field_name: field.name_min || "", value: selectedList.join(";") });
|
|
2946
|
+
},
|
|
2947
|
+
onRemove: (selectedList, selectedItem) => {
|
|
2948
|
+
this.handle_time_picker({ fieldObject: field, sub_field_name: field.name_min || "", value: selectedList.join(";") });
|
|
2949
|
+
},
|
|
2950
|
+
disable: this.props.read_only,
|
|
2951
|
+
singleSelect: true
|
|
2952
|
+
}
|
|
2953
|
+
) })
|
|
2954
|
+
] }),
|
|
2955
|
+
this._error_label(field)
|
|
2956
|
+
] });
|
|
2957
|
+
};
|
|
2958
|
+
this.saveFormToDatasyncProcess = () => {
|
|
2959
|
+
let hasDataGuid = this.props.datasync_object && this.props.datasync_object.data_guid ? true : false;
|
|
2960
|
+
SaveDataTierToDatasync(
|
|
2961
|
+
this.props.datasync_url || "",
|
|
2962
|
+
hasDataGuid ? this.props.datasync_object.data_guid : null,
|
|
2963
|
+
//data_guid
|
|
2964
|
+
this.local_data_blob,
|
|
2965
|
+
//p_o_data_blob,
|
|
2966
|
+
this.props.company_guid || "",
|
|
2967
|
+
//p_s_company_guid,
|
|
2968
|
+
this.props.table_guid || "",
|
|
2969
|
+
//p_s_table_guid,
|
|
2970
|
+
hasDataGuid ? this.props.datasync_object.createstamp : CTimeStamp(),
|
|
2971
|
+
//p_dt_createstamp,
|
|
2972
|
+
hasDataGuid ? CTimeStamp() : null,
|
|
2973
|
+
//p_dt_updatestamp,
|
|
2974
|
+
null,
|
|
2975
|
+
//p_dt_deletestamp,
|
|
2976
|
+
this.onFormSavedLocalHandler,
|
|
2977
|
+
this.onFormUpdatedLocalHandler,
|
|
2978
|
+
this.onFormFailedLocalHandler,
|
|
2979
|
+
null
|
|
2980
|
+
);
|
|
2981
|
+
};
|
|
2982
|
+
/** Form Handlers */
|
|
2983
|
+
this.onClickSubmitFormHandler = (event) => __async(this, null, function* () {
|
|
2984
|
+
try {
|
|
2985
|
+
if (event)
|
|
2986
|
+
event.preventDefault();
|
|
2987
|
+
let canSubmit = true;
|
|
2988
|
+
let iRow = 0;
|
|
2989
|
+
while (iRow < this.state.form.Rows.length && canSubmit) {
|
|
2990
|
+
let iCol = 0;
|
|
2991
|
+
while (iCol < this.state.form.Rows[iRow].Cols.length && canSubmit) {
|
|
2992
|
+
let ii = 0;
|
|
2993
|
+
while (ii < this.state.form.Rows[iRow].Cols[iCol].Fields.length && (canSubmit && (canSubmit = this.checkValidation(this.state.form.Rows[iRow].Cols[iCol].Fields[ii])))) {
|
|
2994
|
+
ii++;
|
|
2995
|
+
}
|
|
2996
|
+
iCol++;
|
|
2997
|
+
}
|
|
2998
|
+
iRow++;
|
|
2999
|
+
}
|
|
3000
|
+
if (!canSubmit) {
|
|
3001
|
+
let err_message = "Le formulaire comporte des erreurs !";
|
|
3002
|
+
if (this.props.onFormFailed)
|
|
3003
|
+
this.props.onFormFailed(err_message);
|
|
3004
|
+
else
|
|
3005
|
+
alert(`${err_message}`);
|
|
3006
|
+
return false;
|
|
3007
|
+
}
|
|
3008
|
+
if (this.props.onFormSubmit) {
|
|
3009
|
+
if (globals.parameters.debugging)
|
|
3010
|
+
alert("onFormSubmit => filter log with AsyncDebug:: prefixe");
|
|
3011
|
+
this.props.onFormSubmit(this.local_data_blob);
|
|
3012
|
+
} else {
|
|
3013
|
+
this.saveFormToDatasyncProcess();
|
|
3014
|
+
}
|
|
3015
|
+
return true;
|
|
3016
|
+
} catch (error) {
|
|
3017
|
+
console.error(`onClickSubmitFormHandler raises "${error}"`);
|
|
3018
|
+
return false;
|
|
3019
|
+
}
|
|
3020
|
+
});
|
|
3021
|
+
this.onFormSavedLocalHandler = (blob) => {
|
|
3022
|
+
if (this.props.onFormSaved)
|
|
3023
|
+
this.props.onFormSaved(blob);
|
|
3024
|
+
else
|
|
3025
|
+
console.error("DynamicForm3Tiers2.onFormSaved props is not defined !");
|
|
3026
|
+
if (this.props.clearOnSave) this.clearForm();
|
|
3027
|
+
if (this.props.onTerminated) this.props.onTerminated();
|
|
3028
|
+
};
|
|
3029
|
+
this.onFormUpdatedLocalHandler = (blob) => {
|
|
3030
|
+
try {
|
|
3031
|
+
if (this.props.onFormUpdated)
|
|
3032
|
+
this.props.onFormUpdated(blob);
|
|
3033
|
+
else
|
|
3034
|
+
console.error("DynamicForm3Tiers2.onFormUpdated props is not defined !");
|
|
3035
|
+
if (this.props.clearOnUpdate) this.clearForm();
|
|
3036
|
+
if (this.props.onTerminated) this.props.onTerminated();
|
|
3037
|
+
} catch (error) {
|
|
3038
|
+
console.error(`onFormUpdatedLocalHandler raises "${error}"`);
|
|
3039
|
+
}
|
|
3040
|
+
};
|
|
3041
|
+
this.onFormFailedLocalHandler = (err) => {
|
|
3042
|
+
if (this.props.onFormFailed)
|
|
3043
|
+
this.props.onFormFailed(err);
|
|
3044
|
+
else {
|
|
3045
|
+
console.error("DynamicForm3Tiers2.onFormFailed props is not defined !");
|
|
3046
|
+
alert("Erreur de sauvegarde !!!");
|
|
3047
|
+
}
|
|
3048
|
+
};
|
|
3049
|
+
this.checkValidation = (pFieldObject) => {
|
|
3050
|
+
let min = pFieldObject.min_length || 0;
|
|
3051
|
+
let max = pFieldObject.max_length || 0;
|
|
3052
|
+
let fieldValue = this.getFieldData(pFieldObject.name);
|
|
3053
|
+
let nextErrors = [];
|
|
3054
|
+
if (pFieldObject.required && fieldValue.trim().length <= 0)
|
|
3055
|
+
nextErrors.push(`obligatoire`);
|
|
3056
|
+
if (min > 0 && pFieldObject.required && fieldValue.trim().length < min)
|
|
3057
|
+
nextErrors.push(`trop court.`);
|
|
3058
|
+
if (pFieldObject.input_type.toLowerCase() == "captcha") {
|
|
3059
|
+
if (parseInt(fieldValue) !== (this.state.captcha1 || 0) + (this.state.captcha2 || 0))
|
|
3060
|
+
nextErrors.push(`calcul faux !`);
|
|
3061
|
+
}
|
|
3062
|
+
if (pFieldObject.input_type.toLowerCase() == "email") {
|
|
3063
|
+
if (!fieldValue.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i))
|
|
3064
|
+
nextErrors.push(`Format de mail incorrect !`);
|
|
3065
|
+
}
|
|
3066
|
+
if (pFieldObject.input_type.toLowerCase() == "date") {
|
|
3067
|
+
if (!fieldValue.match(/^(\d{2}\/\d{2}\/\d{4})$/i))
|
|
3068
|
+
nextErrors.push(`Format de date incorrect !`);
|
|
3069
|
+
}
|
|
3070
|
+
if (max > 0 && fieldValue.trim().length > max)
|
|
3071
|
+
nextErrors.push(`trop long, ${fieldValue.trim().length - max} caract\xE8res en trop.`);
|
|
3072
|
+
if (globals.parameters.debugging) {
|
|
3073
|
+
console.log(`pFieldObject.name->`, JSON.stringify(pFieldObject.name));
|
|
3074
|
+
console.log(`nextErrors->`, JSON.stringify(nextErrors));
|
|
3075
|
+
console.log(`-----------`);
|
|
3076
|
+
}
|
|
3077
|
+
this.setFieldError(pFieldObject, nextErrors.join("/"));
|
|
3078
|
+
return nextErrors.length === 0;
|
|
3079
|
+
};
|
|
3080
|
+
this.dynamicInputTextChangeHandler = (eventObject) => {
|
|
3081
|
+
if (eventObject && eventObject.event)
|
|
3082
|
+
eventObject.event.preventDefault();
|
|
3083
|
+
this.setFieldData(eventObject.fieldObject.name, eventObject.event.target.value);
|
|
3084
|
+
this.checkValidation(eventObject.fieldObject);
|
|
3085
|
+
};
|
|
3086
|
+
this.dynamicInputNumericChangeHandler = (eventObject) => {
|
|
3087
|
+
if (eventObject && eventObject.event)
|
|
3088
|
+
eventObject.event.preventDefault();
|
|
3089
|
+
if (eventObject.event.target.value.length == 0 || !isNaN(Number(eventObject.event.target.value)) && !isNaN(parseFloat(eventObject.event.target.value)))
|
|
3090
|
+
this.setFieldData(eventObject.fieldObject.name, eventObject.event.target.value);
|
|
3091
|
+
else {
|
|
3092
|
+
if (globals.parameters.debugging)
|
|
3093
|
+
console.error(`Value rejected -> ${eventObject.event.target.value}`);
|
|
3094
|
+
}
|
|
3095
|
+
this.checkValidation(eventObject.fieldObject);
|
|
3096
|
+
};
|
|
3097
|
+
this.convertDate = (p_o_day_month_year) => {
|
|
3098
|
+
function pad(s) {
|
|
3099
|
+
return s < 10 ? "0" + s : s.toString();
|
|
3100
|
+
}
|
|
3101
|
+
return {
|
|
3102
|
+
asString: [pad(p_o_day_month_year.day), pad(p_o_day_month_year.month), p_o_day_month_year.year].join("/"),
|
|
3103
|
+
asDate: {
|
|
3104
|
+
day: p_o_day_month_year.day,
|
|
3105
|
+
month: p_o_day_month_year.month,
|
|
3106
|
+
year: p_o_day_month_year.year
|
|
3107
|
+
}
|
|
3108
|
+
};
|
|
3109
|
+
};
|
|
3110
|
+
this.OLD_handle_date_picker = (eventObject) => {
|
|
3111
|
+
let p_oDate = eventObject.selection;
|
|
3112
|
+
let dateConvertedObject = this.convertDate({ day: p_oDate.getDate(), month: 1 + p_oDate.getMonth(), year: p_oDate.getFullYear() });
|
|
3113
|
+
this.setFieldData(eventObject.fieldObject.name, dateConvertedObject.asString);
|
|
3114
|
+
this.setFieldData(eventObject.fieldObject.name_day || "", dateConvertedObject.asDate.day.toString());
|
|
3115
|
+
this.setFieldData(eventObject.fieldObject.name_month || "", dateConvertedObject.asDate.month.toString());
|
|
3116
|
+
this.setFieldData(eventObject.fieldObject.name_year || "", dateConvertedObject.asDate.year.toString());
|
|
3117
|
+
this.checkValidation(eventObject.fieldObject);
|
|
3118
|
+
};
|
|
3119
|
+
this.handle_date_picker = (eventObject) => {
|
|
3120
|
+
this.setFieldData(eventObject.sub_field_name, eventObject.value);
|
|
3121
|
+
this.setFieldData(
|
|
3122
|
+
eventObject.fieldObject.name,
|
|
3123
|
+
this.getFieldData(eventObject.fieldObject.name_day || "") + "/" + this.getFieldData(eventObject.fieldObject.name_month || "") + "/" + this.getFieldData(eventObject.fieldObject.name_year || "")
|
|
3124
|
+
);
|
|
3125
|
+
this.checkValidation(eventObject.fieldObject);
|
|
3126
|
+
};
|
|
3127
|
+
this.handle_time_picker = (eventObject) => {
|
|
3128
|
+
this.setFieldData(eventObject.sub_field_name, eventObject.value);
|
|
3129
|
+
this.setFieldData(eventObject.fieldObject.name, this.getFieldData(eventObject.fieldObject.name_hour || "") + ":" + this.getFieldData(eventObject.fieldObject.name_min || ""));
|
|
3130
|
+
this.checkValidation(eventObject.fieldObject);
|
|
3131
|
+
};
|
|
3132
|
+
this._rowRendering = (row) => {
|
|
3133
|
+
try {
|
|
3134
|
+
return /* @__PURE__ */ jsx(Row_default, { children: row.Cols.map(
|
|
3135
|
+
(col, ii) => {
|
|
3136
|
+
return this._colRendering(col);
|
|
3137
|
+
}
|
|
3138
|
+
) });
|
|
3139
|
+
} catch (err) {
|
|
3140
|
+
return /* @__PURE__ */ jsxs(Col_default, { children: [
|
|
3141
|
+
"Error ",
|
|
3142
|
+
err.message
|
|
3143
|
+
] });
|
|
3144
|
+
}
|
|
3145
|
+
};
|
|
3146
|
+
this._colRendering = (col) => {
|
|
3147
|
+
try {
|
|
3148
|
+
return /* @__PURE__ */ jsx(Col_default, { children: col.Fields.map(
|
|
3149
|
+
(field, ii) => {
|
|
3150
|
+
return this._fieldRendering(field, ii);
|
|
3151
|
+
}
|
|
3152
|
+
) });
|
|
3153
|
+
} catch (err) {
|
|
3154
|
+
return /* @__PURE__ */ jsxs(Col_default, { children: [
|
|
3155
|
+
"Error ",
|
|
3156
|
+
err.message
|
|
3157
|
+
] });
|
|
3158
|
+
}
|
|
3159
|
+
};
|
|
3160
|
+
this._fieldRendering = (field, ii) => {
|
|
3161
|
+
try {
|
|
3162
|
+
if (this.props.read_only && (this.getFieldData(field.name) == null || !this.getFieldData(field.name) || this.getFieldData(field.name).trim().length == 0))
|
|
3163
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
3164
|
+
if (field.hidden && !this.props.show_hidden)
|
|
3165
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
3166
|
+
switch (field.input_type.toLowerCase()) {
|
|
3167
|
+
/** Dynamic fields */
|
|
3168
|
+
case "checkbox-DISABLED":
|
|
3169
|
+
return /* @__PURE__ */ jsx(FormGroup_default, { check: true, children: /* @__PURE__ */ jsxs(Label_default, { check: true, children: [
|
|
3170
|
+
/* @__PURE__ */ jsx(Input_default, { defaultValue: "", type: "checkbox", readOnly: this.props.read_only ? this.props.read_only : false }),
|
|
3171
|
+
field.placeholder,
|
|
3172
|
+
/* @__PURE__ */ jsx("span", { className: "form-check-sign" })
|
|
3173
|
+
] }) });
|
|
3174
|
+
case "checkbox":
|
|
3175
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
3176
|
+
this.getFieldLabelTitle(field),
|
|
3177
|
+
/* @__PURE__ */ jsx(
|
|
3178
|
+
Multiselect,
|
|
3179
|
+
{
|
|
3180
|
+
showArrow: true,
|
|
3181
|
+
options: ["Oui", "Non"],
|
|
3182
|
+
isObject: false,
|
|
3183
|
+
displayValue: "key",
|
|
3184
|
+
selectedValues: this.getFieldData(field.name) ? this.getFieldData(field.name).split(";") : [],
|
|
3185
|
+
placeholder: field.placeholder,
|
|
3186
|
+
emptyRecordMsg: "",
|
|
3187
|
+
onSelect: (selectedList, selectedItem) => {
|
|
3188
|
+
this.setFieldData(field.name, selectedList.join(";"));
|
|
3189
|
+
},
|
|
3190
|
+
onRemove: (selectedList, selectedItem) => {
|
|
3191
|
+
this.setFieldData(field.name, selectedList.join(";"));
|
|
3192
|
+
},
|
|
3193
|
+
disable: this.props.read_only,
|
|
3194
|
+
singleSelect: true
|
|
3195
|
+
}
|
|
3196
|
+
),
|
|
3197
|
+
this._error_label(field)
|
|
3198
|
+
] });
|
|
3199
|
+
case "blob":
|
|
3200
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3201
|
+
this.getFieldLabelTitle(field),
|
|
3202
|
+
/* @__PURE__ */ jsxs("div", { className: "col-md-10", children: [
|
|
3203
|
+
/* @__PURE__ */ jsx(
|
|
3204
|
+
DsBlob,
|
|
3205
|
+
{
|
|
3206
|
+
readOnly: this.props.read_only ? this.props.read_only : false,
|
|
3207
|
+
Caption: `${this.getFieldPrompt(field)} ...`,
|
|
3208
|
+
data: this.getFieldData(field.name),
|
|
3209
|
+
uploadPicture: (UploadFile) => {
|
|
3210
|
+
this.setFieldData(field.name, UploadFile.data);
|
|
3211
|
+
this.checkValidation(field);
|
|
3212
|
+
},
|
|
3213
|
+
pictureStyle: "pic",
|
|
3214
|
+
buttonStyle: "btn btn-secondary",
|
|
3215
|
+
width: field.width ? field.width : void 0,
|
|
3216
|
+
height: field.height ? field.height : void 0,
|
|
3217
|
+
maxWidth: field.maxWidth ? field.maxWidth : void 0,
|
|
3218
|
+
maxHeight: field.maxHeight ? field.maxHeight : void 0,
|
|
3219
|
+
reduceImage: field.reduceImage ? field.reduceImage : void 0
|
|
3220
|
+
}
|
|
3221
|
+
),
|
|
3222
|
+
this._error_label(field)
|
|
3223
|
+
] })
|
|
3224
|
+
] });
|
|
3225
|
+
case "email":
|
|
3226
|
+
return this._email_field(field);
|
|
3227
|
+
case "text":
|
|
3228
|
+
return this._text_field(field);
|
|
3229
|
+
case "memo":
|
|
3230
|
+
return this._memo_field(field);
|
|
3231
|
+
case "combo":
|
|
3232
|
+
case "radio":
|
|
3233
|
+
return this._combo_field(field);
|
|
3234
|
+
case "multi":
|
|
3235
|
+
return this._multi_field(field);
|
|
3236
|
+
case "date":
|
|
3237
|
+
if (!field.name_day) field.name_day = "__day";
|
|
3238
|
+
if (!field.name_month) field.name_month = "__month";
|
|
3239
|
+
if (!field.name_year) field.name_year = "__year";
|
|
3240
|
+
return this._date_field(field);
|
|
3241
|
+
case "time":
|
|
3242
|
+
if (!field.name_hour) field.name_hour = "__hour";
|
|
3243
|
+
if (!field.name_min) field.name_min = "__min";
|
|
3244
|
+
return this._time_field(field);
|
|
3245
|
+
case "numeric":
|
|
3246
|
+
return this._numeric_field_with_add_on(field, "*");
|
|
3247
|
+
case "amount":
|
|
3248
|
+
return this._numeric_field_with_add_on(field, "fa-euro");
|
|
3249
|
+
case "percent":
|
|
3250
|
+
return this._numeric_field_with_add_on(field, "%");
|
|
3251
|
+
case "captcha":
|
|
3252
|
+
return this._captcha_field(field);
|
|
3253
|
+
default:
|
|
3254
|
+
console.error("alert incorrect field type");
|
|
3255
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
3256
|
+
}
|
|
3257
|
+
} catch (error) {
|
|
3258
|
+
console.error(`_fieldRendering raises "${error}"`);
|
|
3259
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
3260
|
+
}
|
|
3261
|
+
};
|
|
3262
|
+
this._cancelButton = () => {
|
|
3263
|
+
let buttonIsHidden = this.props.read_only || this.props.buttons_options && this.props.buttons_options.cancel_button_hidden ? true : false;
|
|
3264
|
+
let buttonCaption = this.props.buttons_options && this.props.buttons_options.cancel_button_caption ? this.props.buttons_options.cancel_button_caption : "Annuler";
|
|
3265
|
+
if (buttonIsHidden) return /* @__PURE__ */ jsx(Fragment, {});
|
|
3266
|
+
else {
|
|
3267
|
+
return /* @__PURE__ */ jsx(Col_default, { md: "4", sm: "4", children: /* @__PURE__ */ jsx(
|
|
3268
|
+
Button_default,
|
|
3269
|
+
{
|
|
3270
|
+
block: true,
|
|
3271
|
+
className: "btn-round",
|
|
3272
|
+
color: "danger",
|
|
3273
|
+
outline: true,
|
|
3274
|
+
type: "reset",
|
|
3275
|
+
onClick: () => {
|
|
3276
|
+
this.clearForm();
|
|
3277
|
+
},
|
|
3278
|
+
children: buttonCaption
|
|
3279
|
+
}
|
|
3280
|
+
) });
|
|
3281
|
+
}
|
|
3282
|
+
};
|
|
3283
|
+
this._submitButton = () => {
|
|
3284
|
+
let buttonIsHidden = this.props.read_only || this.props.buttons_options && this.props.buttons_options.submit_button_hidden ? true : false;
|
|
3285
|
+
let buttonCaption = this.props.buttons_options && this.props.buttons_options.submit_button_caption ? this.props.buttons_options.submit_button_caption : "Soumettre";
|
|
3286
|
+
if (buttonIsHidden) return /* @__PURE__ */ jsx(Fragment, {});
|
|
3287
|
+
else {
|
|
3288
|
+
return /* @__PURE__ */ jsx(Col_default, { md: "4", sm: "4", children: /* @__PURE__ */ jsx(
|
|
3289
|
+
Button_default,
|
|
3290
|
+
{
|
|
3291
|
+
block: true,
|
|
3292
|
+
className: "btn-round",
|
|
3293
|
+
color: "danger",
|
|
3294
|
+
outline: true,
|
|
3295
|
+
type: "submit",
|
|
3296
|
+
onClick: () => {
|
|
3297
|
+
this.onClickSubmitFormHandler();
|
|
3298
|
+
},
|
|
3299
|
+
children: buttonCaption
|
|
3300
|
+
}
|
|
3301
|
+
) });
|
|
3302
|
+
}
|
|
3303
|
+
};
|
|
3304
|
+
this.render = () => {
|
|
3305
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3306
|
+
!this.state.form && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { children: "Form loading..." }) }),
|
|
3307
|
+
/* @__PURE__ */ jsx("form", { children: this.state.form && this.state.form.Rows && this.state.form.Rows.map(
|
|
3308
|
+
(row) => {
|
|
3309
|
+
return this._rowRendering(row);
|
|
3310
|
+
}
|
|
3311
|
+
) }),
|
|
3312
|
+
/* @__PURE__ */ jsxs(Row_default, { className: "buttons-row", children: [
|
|
3313
|
+
this._cancelButton(),
|
|
3314
|
+
this._submitButton(),
|
|
3315
|
+
this.props.custom_button_caption && /* @__PURE__ */ jsx(Col_default, { md: "4", sm: "4", children: /* @__PURE__ */ jsx(
|
|
3316
|
+
Button_default,
|
|
3317
|
+
{
|
|
3318
|
+
block: true,
|
|
3319
|
+
className: "btn-round",
|
|
3320
|
+
color: "primary",
|
|
3321
|
+
type: "submit",
|
|
3322
|
+
onClick: (e) => {
|
|
3323
|
+
if (this.props.custom_button_handler) this.props.custom_button_handler(this.state.form);
|
|
3324
|
+
else console.error("custom_button_handler unset !");
|
|
3325
|
+
},
|
|
3326
|
+
children: this.props.custom_button_caption
|
|
3327
|
+
}
|
|
3328
|
+
) }),
|
|
3329
|
+
this.props.custom_button_caption2 && /* @__PURE__ */ jsx(Col_default, { md: "4", sm: "4", children: /* @__PURE__ */ jsx(
|
|
3330
|
+
Button_default,
|
|
3331
|
+
{
|
|
3332
|
+
block: true,
|
|
3333
|
+
className: "btn-round",
|
|
3334
|
+
color: "primary",
|
|
3335
|
+
type: "submit",
|
|
3336
|
+
onClick: (e) => {
|
|
3337
|
+
if (this.props.custom_button_handler2) this.props.custom_button_handler2(this.state.form);
|
|
3338
|
+
else console.error("custom_button_handler2 unset !");
|
|
3339
|
+
},
|
|
3340
|
+
children: this.props.custom_button_caption2
|
|
3341
|
+
}
|
|
3342
|
+
) })
|
|
3343
|
+
] })
|
|
3344
|
+
] });
|
|
3345
|
+
};
|
|
3346
|
+
if (globals.parameters.debugging) {
|
|
3347
|
+
console.log("30:DynamicForm3Tiers2::this.props.data_blob", this.props.data_blob);
|
|
3348
|
+
console.log("30DynamicForm3Tiers::this.props.form", this.props.form);
|
|
3349
|
+
}
|
|
3350
|
+
this.state = { form: { Rows: [] } };
|
|
3351
|
+
this.local_data_blob = { data_tier: {} };
|
|
3352
|
+
}
|
|
3353
|
+
componentDidUpdate(prevProps) {
|
|
3354
|
+
if (this.props.form !== prevProps.form) {
|
|
3355
|
+
this.clearForm();
|
|
3356
|
+
}
|
|
3357
|
+
if (this.props.data_blob !== prevProps.data_blob) {
|
|
3358
|
+
this.clearForm();
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
};
|
|
3362
|
+
export {
|
|
3363
|
+
DsDynamicForm
|
|
3364
|
+
};
|
|
3365
|
+
/*! Bundled license information:
|
|
3366
|
+
|
|
3367
|
+
react-is/cjs/react-is.production.min.js:
|
|
3368
|
+
(** @license React v16.13.1
|
|
3369
|
+
* react-is.production.min.js
|
|
3370
|
+
*
|
|
3371
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3372
|
+
*
|
|
3373
|
+
* This source code is licensed under the MIT license found in the
|
|
3374
|
+
* LICENSE file in the root directory of this source tree.
|
|
3375
|
+
*)
|
|
3376
|
+
|
|
3377
|
+
react-is/cjs/react-is.development.js:
|
|
3378
|
+
(** @license React v16.13.1
|
|
3379
|
+
* react-is.development.js
|
|
3380
|
+
*
|
|
3381
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3382
|
+
*
|
|
3383
|
+
* This source code is licensed under the MIT license found in the
|
|
3384
|
+
* LICENSE file in the root directory of this source tree.
|
|
3385
|
+
*)
|
|
3386
|
+
|
|
3387
|
+
object-assign/index.js:
|
|
3388
|
+
(*
|
|
3389
|
+
object-assign
|
|
3390
|
+
(c) Sindre Sorhus
|
|
3391
|
+
@license MIT
|
|
3392
|
+
*)
|
|
3393
|
+
|
|
3394
|
+
classnames/index.js:
|
|
3395
|
+
(*!
|
|
3396
|
+
Copyright (c) 2018 Jed Watson.
|
|
3397
|
+
Licensed under the MIT License (MIT), see
|
|
3398
|
+
http://jedwatson.github.io/classnames
|
|
3399
|
+
*)
|
|
3400
|
+
*/
|
|
3401
|
+
//# sourceMappingURL=index.mjs.map
|