@rolster/react-components 18.26.24 → 19.0.2
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/cjs/assets/{index-QCv-Uo8R.css → index-DEldF_Je.css} +203 -8
- package/dist/cjs/index.js +618 -1299
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-QCv-Uo8R.css → index-DEldF_Je.css} +203 -8
- package/dist/es/index.js +620 -1303
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Badge/Badge.css +4 -2
- package/dist/esm/components/atoms/Badge/Badge.css.map +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.js +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/organisms/FieldClock/FieldClock.css +71 -0
- package/dist/esm/components/organisms/FieldClock/FieldClock.css.map +1 -0
- package/dist/esm/components/organisms/FieldClock/FieldClock.d.ts +37 -0
- package/dist/esm/components/organisms/FieldClock/FieldClock.js +52 -0
- package/dist/esm/components/organisms/FieldClock/FieldClock.js.map +1 -0
- package/dist/esm/components/organisms/FieldDate/FieldDate.css +2 -2
- package/dist/esm/components/organisms/FieldDate/FieldDate.css.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +5 -5
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.css +5 -2
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.css.map +1 -1
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js +1 -1
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js.map +1 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.css +116 -0
- package/dist/esm/components/organisms/PickerClock/PickerClock.css.map +1 -0
- package/dist/esm/components/organisms/PickerClock/PickerClock.d.ts +13 -0
- package/dist/esm/components/organisms/PickerClock/PickerClock.js +208 -0
- package/dist/esm/components/organisms/PickerClock/PickerClock.js.map +1 -0
- package/dist/esm/components/organisms/PickerDate/PickerDate.css +3 -2
- package/dist/esm/components/organisms/PickerDate/PickerDate.css.map +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.js +11 -13
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.d.ts +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +2 -2
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/controllers/DatatableController.d.ts +1 -1
- package/dist/esm/controllers/DatatableController.js.map +1 -1
- package/dist/esm/controllers/ListController.d.ts +3 -3
- package/dist/esm/controllers/ListController.js +1 -1
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/definitions.d.ts +3 -3
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +9 -10
- package/dist/esm/components/molecules/PickerClock/PickerClock.d.ts +0 -1
- package/dist/esm/components/molecules/PickerClock/PickerClock.js +0 -5
- package/dist/esm/components/molecules/PickerClock/PickerClock.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -10,26 +10,47 @@ var reactForms = require('@rolster/react-forms');
|
|
|
10
10
|
|
|
11
11
|
var jsxRuntime = {exports: {}};
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var reactJsxRuntime_production = {};
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @license React
|
|
17
|
-
* react-jsx-runtime.production.
|
|
17
|
+
* react-jsx-runtime.production.js
|
|
18
18
|
*
|
|
19
|
-
* Copyright (c)
|
|
19
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the MIT license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
function
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
var hasRequiredReactJsxRuntime_production;
|
|
26
|
+
|
|
27
|
+
function requireReactJsxRuntime_production () {
|
|
28
|
+
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
29
|
+
hasRequiredReactJsxRuntime_production = 1;
|
|
30
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
31
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
32
|
+
function jsxProd(type, config, maybeKey) {
|
|
33
|
+
var key = null;
|
|
34
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
35
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
36
|
+
if ("key" in config) {
|
|
37
|
+
maybeKey = {};
|
|
38
|
+
for (var propName in config)
|
|
39
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
40
|
+
} else maybeKey = config;
|
|
41
|
+
config = maybeKey.ref;
|
|
42
|
+
return {
|
|
43
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
44
|
+
type: type,
|
|
45
|
+
key: key,
|
|
46
|
+
ref: void 0 !== config ? config : null,
|
|
47
|
+
props: maybeKey
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
51
|
+
reactJsxRuntime_production.jsx = jsxProd;
|
|
52
|
+
reactJsxRuntime_production.jsxs = jsxProd;
|
|
53
|
+
return reactJsxRuntime_production;
|
|
33
54
|
}
|
|
34
55
|
|
|
35
56
|
var reactJsxRuntime_development = {};
|
|
@@ -38,7 +59,7 @@ var reactJsxRuntime_development = {};
|
|
|
38
59
|
* @license React
|
|
39
60
|
* react-jsx-runtime.development.js
|
|
40
61
|
*
|
|
41
|
-
* Copyright (c)
|
|
62
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
42
63
|
*
|
|
43
64
|
* This source code is licensed under the MIT license found in the
|
|
44
65
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -49,1295 +70,352 @@ var hasRequiredReactJsxRuntime_development;
|
|
|
49
70
|
function requireReactJsxRuntime_development () {
|
|
50
71
|
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
51
72
|
hasRequiredReactJsxRuntime_development = 1;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
75
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
76
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
77
|
-
function getIteratorFn(maybeIterable) {
|
|
78
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
83
|
-
|
|
84
|
-
if (typeof maybeIterator === 'function') {
|
|
85
|
-
return maybeIterator;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
92
|
-
|
|
93
|
-
function error(format) {
|
|
94
|
-
{
|
|
95
|
-
{
|
|
96
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
97
|
-
args[_key2 - 1] = arguments[_key2];
|
|
73
|
+
"production" !== process.env.NODE_ENV &&
|
|
74
|
+
(function () {
|
|
75
|
+
function getComponentNameFromType(type) {
|
|
76
|
+
if (null == type) return null;
|
|
77
|
+
if ("function" === typeof type)
|
|
78
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
79
|
+
? null
|
|
80
|
+
: type.displayName || type.name || null;
|
|
81
|
+
if ("string" === typeof type) return type;
|
|
82
|
+
switch (type) {
|
|
83
|
+
case REACT_FRAGMENT_TYPE:
|
|
84
|
+
return "Fragment";
|
|
85
|
+
case REACT_PROFILER_TYPE:
|
|
86
|
+
return "Profiler";
|
|
87
|
+
case REACT_STRICT_MODE_TYPE:
|
|
88
|
+
return "StrictMode";
|
|
89
|
+
case REACT_SUSPENSE_TYPE:
|
|
90
|
+
return "Suspense";
|
|
91
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
92
|
+
return "SuspenseList";
|
|
93
|
+
case REACT_ACTIVITY_TYPE:
|
|
94
|
+
return "Activity";
|
|
98
95
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var enableCacheElement = false;
|
|
134
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
135
|
-
|
|
136
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
137
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
138
|
-
// issues in DEV builds.
|
|
139
|
-
|
|
140
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
141
|
-
|
|
142
|
-
var REACT_MODULE_REFERENCE;
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function isValidElementType(type) {
|
|
149
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
150
|
-
return true;
|
|
151
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
if (typeof type === 'object' && type !== null) {
|
|
159
|
-
if (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 || // This needs to include all possible module reference object
|
|
160
|
-
// types supported by any Flight configuration anywhere since
|
|
161
|
-
// we don't know which Flight build this will end up being used
|
|
162
|
-
// with.
|
|
163
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
164
|
-
return true;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return false;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
172
|
-
var displayName = outerType.displayName;
|
|
173
|
-
|
|
174
|
-
if (displayName) {
|
|
175
|
-
return displayName;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
179
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
180
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
function getContextName(type) {
|
|
184
|
-
return type.displayName || 'Context';
|
|
185
|
-
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
function getComponentNameFromType(type) {
|
|
189
|
-
if (type == null) {
|
|
190
|
-
// Host root, text node or just invalid type.
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
{
|
|
195
|
-
if (typeof type.tag === 'number') {
|
|
196
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (typeof type === 'function') {
|
|
201
|
-
return type.displayName || type.name || null;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (typeof type === 'string') {
|
|
205
|
-
return type;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
switch (type) {
|
|
209
|
-
case REACT_FRAGMENT_TYPE:
|
|
210
|
-
return 'Fragment';
|
|
211
|
-
|
|
212
|
-
case REACT_PORTAL_TYPE:
|
|
213
|
-
return 'Portal';
|
|
214
|
-
|
|
215
|
-
case REACT_PROFILER_TYPE:
|
|
216
|
-
return 'Profiler';
|
|
217
|
-
|
|
218
|
-
case REACT_STRICT_MODE_TYPE:
|
|
219
|
-
return 'StrictMode';
|
|
220
|
-
|
|
221
|
-
case REACT_SUSPENSE_TYPE:
|
|
222
|
-
return 'Suspense';
|
|
223
|
-
|
|
224
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
225
|
-
return 'SuspenseList';
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if (typeof type === 'object') {
|
|
230
|
-
switch (type.$$typeof) {
|
|
231
|
-
case REACT_CONTEXT_TYPE:
|
|
232
|
-
var context = type;
|
|
233
|
-
return getContextName(context) + '.Consumer';
|
|
234
|
-
|
|
235
|
-
case REACT_PROVIDER_TYPE:
|
|
236
|
-
var provider = type;
|
|
237
|
-
return getContextName(provider._context) + '.Provider';
|
|
238
|
-
|
|
239
|
-
case REACT_FORWARD_REF_TYPE:
|
|
240
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
241
|
-
|
|
242
|
-
case REACT_MEMO_TYPE:
|
|
243
|
-
var outerName = type.displayName || null;
|
|
244
|
-
|
|
245
|
-
if (outerName !== null) {
|
|
246
|
-
return outerName;
|
|
96
|
+
if ("object" === typeof type)
|
|
97
|
+
switch (
|
|
98
|
+
("number" === typeof type.tag &&
|
|
99
|
+
console.error(
|
|
100
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
101
|
+
),
|
|
102
|
+
type.$$typeof)
|
|
103
|
+
) {
|
|
104
|
+
case REACT_PORTAL_TYPE:
|
|
105
|
+
return "Portal";
|
|
106
|
+
case REACT_CONTEXT_TYPE:
|
|
107
|
+
return type.displayName || "Context";
|
|
108
|
+
case REACT_CONSUMER_TYPE:
|
|
109
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
110
|
+
case REACT_FORWARD_REF_TYPE:
|
|
111
|
+
var innerType = type.render;
|
|
112
|
+
type = type.displayName;
|
|
113
|
+
type ||
|
|
114
|
+
((type = innerType.displayName || innerType.name || ""),
|
|
115
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
116
|
+
return type;
|
|
117
|
+
case REACT_MEMO_TYPE:
|
|
118
|
+
return (
|
|
119
|
+
(innerType = type.displayName || null),
|
|
120
|
+
null !== innerType
|
|
121
|
+
? innerType
|
|
122
|
+
: getComponentNameFromType(type.type) || "Memo"
|
|
123
|
+
);
|
|
124
|
+
case REACT_LAZY_TYPE:
|
|
125
|
+
innerType = type._payload;
|
|
126
|
+
type = type._init;
|
|
127
|
+
try {
|
|
128
|
+
return getComponentNameFromType(type(innerType));
|
|
129
|
+
} catch (x) {}
|
|
247
130
|
}
|
|
248
|
-
|
|
249
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
250
|
-
|
|
251
|
-
case REACT_LAZY_TYPE:
|
|
252
|
-
{
|
|
253
|
-
var lazyComponent = type;
|
|
254
|
-
var payload = lazyComponent._payload;
|
|
255
|
-
var init = lazyComponent._init;
|
|
256
|
-
|
|
257
|
-
try {
|
|
258
|
-
return getComponentNameFromType(init(payload));
|
|
259
|
-
} catch (x) {
|
|
260
|
-
return null;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// eslint-disable-next-line no-fallthrough
|
|
131
|
+
return null;
|
|
265
132
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return null;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
var assign = Object.assign;
|
|
272
|
-
|
|
273
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
274
|
-
// replaying on render function. This currently only patches the object
|
|
275
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
276
|
-
// We could also eagerly patch the method.
|
|
277
|
-
var disabledDepth = 0;
|
|
278
|
-
var prevLog;
|
|
279
|
-
var prevInfo;
|
|
280
|
-
var prevWarn;
|
|
281
|
-
var prevError;
|
|
282
|
-
var prevGroup;
|
|
283
|
-
var prevGroupCollapsed;
|
|
284
|
-
var prevGroupEnd;
|
|
285
|
-
|
|
286
|
-
function disabledLog() {}
|
|
287
|
-
|
|
288
|
-
disabledLog.__reactDisabledLog = true;
|
|
289
|
-
function disableLogs() {
|
|
290
|
-
{
|
|
291
|
-
if (disabledDepth === 0) {
|
|
292
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
293
|
-
prevLog = console.log;
|
|
294
|
-
prevInfo = console.info;
|
|
295
|
-
prevWarn = console.warn;
|
|
296
|
-
prevError = console.error;
|
|
297
|
-
prevGroup = console.group;
|
|
298
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
299
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
300
|
-
|
|
301
|
-
var props = {
|
|
302
|
-
configurable: true,
|
|
303
|
-
enumerable: true,
|
|
304
|
-
value: disabledLog,
|
|
305
|
-
writable: true
|
|
306
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
307
|
-
|
|
308
|
-
Object.defineProperties(console, {
|
|
309
|
-
info: props,
|
|
310
|
-
log: props,
|
|
311
|
-
warn: props,
|
|
312
|
-
error: props,
|
|
313
|
-
group: props,
|
|
314
|
-
groupCollapsed: props,
|
|
315
|
-
groupEnd: props
|
|
316
|
-
});
|
|
317
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
disabledDepth++;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function reenableLogs() {
|
|
324
|
-
{
|
|
325
|
-
disabledDepth--;
|
|
326
|
-
|
|
327
|
-
if (disabledDepth === 0) {
|
|
328
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
329
|
-
var props = {
|
|
330
|
-
configurable: true,
|
|
331
|
-
enumerable: true,
|
|
332
|
-
writable: true
|
|
333
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
334
|
-
|
|
335
|
-
Object.defineProperties(console, {
|
|
336
|
-
log: assign({}, props, {
|
|
337
|
-
value: prevLog
|
|
338
|
-
}),
|
|
339
|
-
info: assign({}, props, {
|
|
340
|
-
value: prevInfo
|
|
341
|
-
}),
|
|
342
|
-
warn: assign({}, props, {
|
|
343
|
-
value: prevWarn
|
|
344
|
-
}),
|
|
345
|
-
error: assign({}, props, {
|
|
346
|
-
value: prevError
|
|
347
|
-
}),
|
|
348
|
-
group: assign({}, props, {
|
|
349
|
-
value: prevGroup
|
|
350
|
-
}),
|
|
351
|
-
groupCollapsed: assign({}, props, {
|
|
352
|
-
value: prevGroupCollapsed
|
|
353
|
-
}),
|
|
354
|
-
groupEnd: assign({}, props, {
|
|
355
|
-
value: prevGroupEnd
|
|
356
|
-
})
|
|
357
|
-
});
|
|
358
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
if (disabledDepth < 0) {
|
|
362
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
133
|
+
function testStringCoercion(value) {
|
|
134
|
+
return "" + value;
|
|
363
135
|
}
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
368
|
-
var prefix;
|
|
369
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
370
|
-
{
|
|
371
|
-
if (prefix === undefined) {
|
|
372
|
-
// Extract the VM specific prefix used by each line.
|
|
136
|
+
function checkKeyStringCoercion(value) {
|
|
373
137
|
try {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
138
|
+
testStringCoercion(value);
|
|
139
|
+
var JSCompiler_inline_result = !1;
|
|
140
|
+
} catch (e) {
|
|
141
|
+
JSCompiler_inline_result = true;
|
|
378
142
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
395
|
-
if ( !fn || reentry) {
|
|
396
|
-
return '';
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
{
|
|
400
|
-
var frame = componentFrameCache.get(fn);
|
|
401
|
-
|
|
402
|
-
if (frame !== undefined) {
|
|
403
|
-
return frame;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
var control;
|
|
408
|
-
reentry = true;
|
|
409
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
410
|
-
|
|
411
|
-
Error.prepareStackTrace = undefined;
|
|
412
|
-
var previousDispatcher;
|
|
413
|
-
|
|
414
|
-
{
|
|
415
|
-
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
416
|
-
// for warnings.
|
|
417
|
-
|
|
418
|
-
ReactCurrentDispatcher.current = null;
|
|
419
|
-
disableLogs();
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
try {
|
|
423
|
-
// This should throw.
|
|
424
|
-
if (construct) {
|
|
425
|
-
// Something should be setting the props in the constructor.
|
|
426
|
-
var Fake = function () {
|
|
427
|
-
throw Error();
|
|
428
|
-
}; // $FlowFixMe
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
432
|
-
set: function () {
|
|
433
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
434
|
-
// because that won't throw in a non-strict mode function.
|
|
435
|
-
throw Error();
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
440
|
-
// We construct a different control for this case to include any extra
|
|
441
|
-
// frames added by the construct call.
|
|
442
|
-
try {
|
|
443
|
-
Reflect.construct(Fake, []);
|
|
444
|
-
} catch (x) {
|
|
445
|
-
control = x;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
Reflect.construct(fn, [], Fake);
|
|
449
|
-
} else {
|
|
450
|
-
try {
|
|
451
|
-
Fake.call();
|
|
452
|
-
} catch (x) {
|
|
453
|
-
control = x;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
fn.call(Fake.prototype);
|
|
143
|
+
if (JSCompiler_inline_result) {
|
|
144
|
+
JSCompiler_inline_result = console;
|
|
145
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
146
|
+
var JSCompiler_inline_result$jscomp$0 =
|
|
147
|
+
("function" === typeof Symbol &&
|
|
148
|
+
Symbol.toStringTag &&
|
|
149
|
+
value[Symbol.toStringTag]) ||
|
|
150
|
+
value.constructor.name ||
|
|
151
|
+
"Object";
|
|
152
|
+
JSCompiler_temp_const.call(
|
|
153
|
+
JSCompiler_inline_result,
|
|
154
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
155
|
+
JSCompiler_inline_result$jscomp$0
|
|
156
|
+
);
|
|
157
|
+
return testStringCoercion(value);
|
|
457
158
|
}
|
|
458
|
-
}
|
|
159
|
+
}
|
|
160
|
+
function getTaskName(type) {
|
|
161
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
162
|
+
if (
|
|
163
|
+
"object" === typeof type &&
|
|
164
|
+
null !== type &&
|
|
165
|
+
type.$$typeof === REACT_LAZY_TYPE
|
|
166
|
+
)
|
|
167
|
+
return "<...>";
|
|
459
168
|
try {
|
|
460
|
-
|
|
169
|
+
var name = getComponentNameFromType(type);
|
|
170
|
+
return name ? "<" + name + ">" : "<...>";
|
|
461
171
|
} catch (x) {
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
fn();
|
|
466
|
-
}
|
|
467
|
-
} catch (sample) {
|
|
468
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
469
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
470
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
471
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
472
|
-
var sampleLines = sample.stack.split('\n');
|
|
473
|
-
var controlLines = control.stack.split('\n');
|
|
474
|
-
var s = sampleLines.length - 1;
|
|
475
|
-
var c = controlLines.length - 1;
|
|
476
|
-
|
|
477
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
478
|
-
// We expect at least one stack frame to be shared.
|
|
479
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
480
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
481
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
482
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
483
|
-
// the sample somewhere in the control.
|
|
484
|
-
c--;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
488
|
-
// Next we find the first one that isn't the same which should be the
|
|
489
|
-
// frame that called our sample function and the control.
|
|
490
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
491
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
492
|
-
// If we're about to return the first line, and the control is also on the same
|
|
493
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
494
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
495
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
496
|
-
if (s !== 1 || c !== 1) {
|
|
497
|
-
do {
|
|
498
|
-
s--;
|
|
499
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
500
|
-
// The next one that isn't the same should be our match though.
|
|
501
|
-
|
|
502
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
503
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
504
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
505
|
-
// but we have a user-provided "displayName"
|
|
506
|
-
// splice it in to make the stack more readable.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
510
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
{
|
|
514
|
-
if (typeof fn === 'function') {
|
|
515
|
-
componentFrameCache.set(fn, _frame);
|
|
516
|
-
}
|
|
517
|
-
} // Return the line we found.
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
return _frame;
|
|
521
|
-
}
|
|
522
|
-
} while (s >= 1 && c >= 0);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
break;
|
|
526
|
-
}
|
|
172
|
+
return "<...>";
|
|
527
173
|
}
|
|
528
174
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
{
|
|
533
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
534
|
-
reenableLogs();
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
538
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
542
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
543
|
-
|
|
544
|
-
{
|
|
545
|
-
if (typeof fn === 'function') {
|
|
546
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
175
|
+
function getOwner() {
|
|
176
|
+
var dispatcher = ReactSharedInternals.A;
|
|
177
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
547
178
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
return syntheticFrame;
|
|
551
|
-
}
|
|
552
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
553
|
-
{
|
|
554
|
-
return describeNativeComponentFrame(fn, false);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
function shouldConstruct(Component) {
|
|
559
|
-
var prototype = Component.prototype;
|
|
560
|
-
return !!(prototype && prototype.isReactComponent);
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
564
|
-
|
|
565
|
-
if (type == null) {
|
|
566
|
-
return '';
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
if (typeof type === 'function') {
|
|
570
|
-
{
|
|
571
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
if (typeof type === 'string') {
|
|
576
|
-
return describeBuiltInComponentFrame(type);
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
switch (type) {
|
|
580
|
-
case REACT_SUSPENSE_TYPE:
|
|
581
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
582
|
-
|
|
583
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
584
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
if (typeof type === 'object') {
|
|
588
|
-
switch (type.$$typeof) {
|
|
589
|
-
case REACT_FORWARD_REF_TYPE:
|
|
590
|
-
return describeFunctionComponentFrame(type.render);
|
|
591
|
-
|
|
592
|
-
case REACT_MEMO_TYPE:
|
|
593
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
594
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
595
|
-
|
|
596
|
-
case REACT_LAZY_TYPE:
|
|
597
|
-
{
|
|
598
|
-
var lazyComponent = type;
|
|
599
|
-
var payload = lazyComponent._payload;
|
|
600
|
-
var init = lazyComponent._init;
|
|
601
|
-
|
|
602
|
-
try {
|
|
603
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
604
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
605
|
-
} catch (x) {}
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
return '';
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
614
|
-
|
|
615
|
-
var loggedTypeFailures = {};
|
|
616
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
617
|
-
|
|
618
|
-
function setCurrentlyValidatingElement(element) {
|
|
619
|
-
{
|
|
620
|
-
if (element) {
|
|
621
|
-
var owner = element._owner;
|
|
622
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
623
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
624
|
-
} else {
|
|
625
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
179
|
+
function UnknownOwner() {
|
|
180
|
+
return Error("react-stack-top-frame");
|
|
626
181
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
{
|
|
632
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
633
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
634
|
-
|
|
635
|
-
for (var typeSpecName in typeSpecs) {
|
|
636
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
637
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
638
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
639
|
-
// After these have been cleaned up, we'll let them throw.
|
|
640
|
-
|
|
641
|
-
try {
|
|
642
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
643
|
-
// behavior as without this statement except with a better message.
|
|
644
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
645
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
646
|
-
var err = Error((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`.');
|
|
647
|
-
err.name = 'Invariant Violation';
|
|
648
|
-
throw err;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
652
|
-
} catch (ex) {
|
|
653
|
-
error$1 = ex;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
657
|
-
setCurrentlyValidatingElement(element);
|
|
658
|
-
|
|
659
|
-
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
660
|
-
|
|
661
|
-
setCurrentlyValidatingElement(null);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
665
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
666
|
-
// same error.
|
|
667
|
-
loggedTypeFailures[error$1.message] = true;
|
|
668
|
-
setCurrentlyValidatingElement(element);
|
|
669
|
-
|
|
670
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
671
|
-
|
|
672
|
-
setCurrentlyValidatingElement(null);
|
|
673
|
-
}
|
|
182
|
+
function hasValidKey(config) {
|
|
183
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
184
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
185
|
+
if (getter && getter.isReactWarning) return false;
|
|
674
186
|
}
|
|
187
|
+
return void 0 !== config.key;
|
|
675
188
|
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
/*
|
|
686
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
687
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
688
|
-
*
|
|
689
|
-
* The functions in this module will throw an easier-to-understand,
|
|
690
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
691
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
692
|
-
* of the `value` object).
|
|
693
|
-
*/
|
|
694
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
695
|
-
function typeName(value) {
|
|
696
|
-
{
|
|
697
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
698
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
699
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
700
|
-
return type;
|
|
701
|
-
}
|
|
702
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
function willCoercionThrow(value) {
|
|
706
|
-
{
|
|
707
|
-
try {
|
|
708
|
-
testStringCoercion(value);
|
|
709
|
-
return false;
|
|
710
|
-
} catch (e) {
|
|
711
|
-
return true;
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
function testStringCoercion(value) {
|
|
717
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
718
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
719
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
720
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
721
|
-
//
|
|
722
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
723
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
724
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
725
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
726
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
727
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
728
|
-
//
|
|
729
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
730
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
731
|
-
//
|
|
732
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
733
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
734
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
735
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
736
|
-
// In most cases, this console output also shows the component and its
|
|
737
|
-
// ancestor components where the exception happened.
|
|
738
|
-
//
|
|
739
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
740
|
-
return '' + value;
|
|
741
|
-
}
|
|
742
|
-
function checkKeyStringCoercion(value) {
|
|
743
|
-
{
|
|
744
|
-
if (willCoercionThrow(value)) {
|
|
745
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
746
|
-
|
|
747
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
753
|
-
var RESERVED_PROPS = {
|
|
754
|
-
key: true,
|
|
755
|
-
ref: true,
|
|
756
|
-
__self: true,
|
|
757
|
-
__source: true
|
|
758
|
-
};
|
|
759
|
-
var specialPropKeyWarningShown;
|
|
760
|
-
var specialPropRefWarningShown;
|
|
761
|
-
|
|
762
|
-
function hasValidRef(config) {
|
|
763
|
-
{
|
|
764
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
765
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
766
|
-
|
|
767
|
-
if (getter && getter.isReactWarning) {
|
|
768
|
-
return false;
|
|
189
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
190
|
+
function warnAboutAccessingKey() {
|
|
191
|
+
specialPropKeyWarningShown ||
|
|
192
|
+
((specialPropKeyWarningShown = true),
|
|
193
|
+
console.error(
|
|
194
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
195
|
+
displayName
|
|
196
|
+
));
|
|
769
197
|
}
|
|
198
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
199
|
+
Object.defineProperty(props, "key", {
|
|
200
|
+
get: warnAboutAccessingKey,
|
|
201
|
+
configurable: true
|
|
202
|
+
});
|
|
770
203
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
if (getter && getter.isReactWarning) {
|
|
782
|
-
return false;
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
return config.key !== undefined;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
791
|
-
{
|
|
792
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
797
|
-
{
|
|
798
|
-
var warnAboutAccessingKey = function () {
|
|
799
|
-
if (!specialPropKeyWarningShown) {
|
|
800
|
-
specialPropKeyWarningShown = true;
|
|
801
|
-
|
|
802
|
-
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
|
|
806
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
807
|
-
Object.defineProperty(props, 'key', {
|
|
808
|
-
get: warnAboutAccessingKey,
|
|
809
|
-
configurable: true
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
815
|
-
{
|
|
816
|
-
var warnAboutAccessingRef = function () {
|
|
817
|
-
if (!specialPropRefWarningShown) {
|
|
818
|
-
specialPropRefWarningShown = true;
|
|
819
|
-
|
|
820
|
-
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
821
|
-
}
|
|
822
|
-
};
|
|
823
|
-
|
|
824
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
825
|
-
Object.defineProperty(props, 'ref', {
|
|
826
|
-
get: warnAboutAccessingRef,
|
|
827
|
-
configurable: true
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
833
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
834
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
835
|
-
* if something is a React Element.
|
|
836
|
-
*
|
|
837
|
-
* @param {*} type
|
|
838
|
-
* @param {*} props
|
|
839
|
-
* @param {*} key
|
|
840
|
-
* @param {string|object} ref
|
|
841
|
-
* @param {*} owner
|
|
842
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
843
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
844
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
845
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
846
|
-
* change in behavior.
|
|
847
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
848
|
-
* indicating filename, line number, and/or other information.
|
|
849
|
-
* @internal
|
|
850
|
-
*/
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
854
|
-
var element = {
|
|
855
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
856
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
857
|
-
// Built-in properties that belong on the element
|
|
858
|
-
type: type,
|
|
859
|
-
key: key,
|
|
860
|
-
ref: ref,
|
|
861
|
-
props: props,
|
|
862
|
-
// Record the component responsible for creating this element.
|
|
863
|
-
_owner: owner
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
{
|
|
867
|
-
// The validation flag is currently mutative. We put it on
|
|
868
|
-
// an external backing store so that we can freeze the whole object.
|
|
869
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
870
|
-
// commonly used development environments.
|
|
871
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
872
|
-
// the validation flag non-enumerable (where possible, which should
|
|
873
|
-
// include every environment we run tests in), so the test framework
|
|
874
|
-
// ignores it.
|
|
875
|
-
|
|
876
|
-
Object.defineProperty(element._store, 'validated', {
|
|
877
|
-
configurable: false,
|
|
878
|
-
enumerable: false,
|
|
879
|
-
writable: true,
|
|
880
|
-
value: false
|
|
881
|
-
}); // self and source are DEV only properties.
|
|
882
|
-
|
|
883
|
-
Object.defineProperty(element, '_self', {
|
|
884
|
-
configurable: false,
|
|
885
|
-
enumerable: false,
|
|
886
|
-
writable: false,
|
|
887
|
-
value: self
|
|
888
|
-
}); // Two elements created in two different places should be considered
|
|
889
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
890
|
-
|
|
891
|
-
Object.defineProperty(element, '_source', {
|
|
892
|
-
configurable: false,
|
|
893
|
-
enumerable: false,
|
|
894
|
-
writable: false,
|
|
895
|
-
value: source
|
|
896
|
-
});
|
|
897
|
-
|
|
898
|
-
if (Object.freeze) {
|
|
899
|
-
Object.freeze(element.props);
|
|
900
|
-
Object.freeze(element);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
return element;
|
|
905
|
-
};
|
|
906
|
-
/**
|
|
907
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
908
|
-
* @param {*} type
|
|
909
|
-
* @param {object} props
|
|
910
|
-
* @param {string} key
|
|
911
|
-
*/
|
|
912
|
-
|
|
913
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
914
|
-
{
|
|
915
|
-
var propName; // Reserved names are extracted
|
|
916
|
-
|
|
917
|
-
var props = {};
|
|
918
|
-
var key = null;
|
|
919
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
920
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
921
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
922
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
923
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
924
|
-
// key is explicitly declared to be undefined or not.
|
|
925
|
-
|
|
926
|
-
if (maybeKey !== undefined) {
|
|
927
|
-
{
|
|
928
|
-
checkKeyStringCoercion(maybeKey);
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
key = '' + maybeKey;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
if (hasValidKey(config)) {
|
|
935
|
-
{
|
|
936
|
-
checkKeyStringCoercion(config.key);
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
key = '' + config.key;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
if (hasValidRef(config)) {
|
|
943
|
-
ref = config.ref;
|
|
944
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
945
|
-
} // Remaining properties are added to a new props object
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
for (propName in config) {
|
|
949
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
950
|
-
props[propName] = config[propName];
|
|
951
|
-
}
|
|
952
|
-
} // Resolve default props
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
if (type && type.defaultProps) {
|
|
956
|
-
var defaultProps = type.defaultProps;
|
|
957
|
-
|
|
958
|
-
for (propName in defaultProps) {
|
|
959
|
-
if (props[propName] === undefined) {
|
|
960
|
-
props[propName] = defaultProps[propName];
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
if (key || ref) {
|
|
966
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
967
|
-
|
|
968
|
-
if (key) {
|
|
969
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
if (ref) {
|
|
973
|
-
defineRefPropWarningGetter(props, displayName);
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
982
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
983
|
-
|
|
984
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
985
|
-
{
|
|
986
|
-
if (element) {
|
|
987
|
-
var owner = element._owner;
|
|
988
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
989
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
990
|
-
} else {
|
|
991
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
var propTypesMisspellWarningShown;
|
|
997
|
-
|
|
998
|
-
{
|
|
999
|
-
propTypesMisspellWarningShown = false;
|
|
1000
|
-
}
|
|
1001
|
-
/**
|
|
1002
|
-
* Verifies the object is a ReactElement.
|
|
1003
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1004
|
-
* @param {?object} object
|
|
1005
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
1006
|
-
* @final
|
|
1007
|
-
*/
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
function isValidElement(object) {
|
|
1011
|
-
{
|
|
1012
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
function getDeclarationErrorAddendum() {
|
|
1017
|
-
{
|
|
1018
|
-
if (ReactCurrentOwner$1.current) {
|
|
1019
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1020
|
-
|
|
1021
|
-
if (name) {
|
|
1022
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
return '';
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1031
|
-
{
|
|
1032
|
-
|
|
1033
|
-
return '';
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1038
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
1039
|
-
* updates.
|
|
1040
|
-
*/
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
var ownerHasKeyUseWarning = {};
|
|
1044
|
-
|
|
1045
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1046
|
-
{
|
|
1047
|
-
var info = getDeclarationErrorAddendum();
|
|
1048
|
-
|
|
1049
|
-
if (!info) {
|
|
1050
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1051
|
-
|
|
1052
|
-
if (parentName) {
|
|
1053
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
return info;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
/**
|
|
1061
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1062
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1063
|
-
* reordered. All children that haven't already been validated are required to
|
|
1064
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1065
|
-
* will only be shown once.
|
|
1066
|
-
*
|
|
1067
|
-
* @internal
|
|
1068
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1069
|
-
* @param {*} parentType element's parent's type.
|
|
1070
|
-
*/
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
function validateExplicitKey(element, parentType) {
|
|
1074
|
-
{
|
|
1075
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1076
|
-
return;
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
element._store.validated = true;
|
|
1080
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1081
|
-
|
|
1082
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1083
|
-
return;
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1087
|
-
// property, it may be the creator of the child that's responsible for
|
|
1088
|
-
// assigning it a key.
|
|
1089
|
-
|
|
1090
|
-
var childOwner = '';
|
|
1091
|
-
|
|
1092
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1093
|
-
// Give the component that originally created this child.
|
|
1094
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
setCurrentlyValidatingElement$1(element);
|
|
1098
|
-
|
|
1099
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1100
|
-
|
|
1101
|
-
setCurrentlyValidatingElement$1(null);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
/**
|
|
1105
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1106
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1107
|
-
* with valid key property.
|
|
1108
|
-
*
|
|
1109
|
-
* @internal
|
|
1110
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1111
|
-
* @param {*} parentType node's parent's type.
|
|
1112
|
-
*/
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
function validateChildKeys(node, parentType) {
|
|
1116
|
-
{
|
|
1117
|
-
if (typeof node !== 'object') {
|
|
1118
|
-
return;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
if (isArray(node)) {
|
|
1122
|
-
for (var i = 0; i < node.length; i++) {
|
|
1123
|
-
var child = node[i];
|
|
1124
|
-
|
|
1125
|
-
if (isValidElement(child)) {
|
|
1126
|
-
validateExplicitKey(child, parentType);
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
} else if (isValidElement(node)) {
|
|
1130
|
-
// This element was passed in a valid location.
|
|
1131
|
-
if (node._store) {
|
|
1132
|
-
node._store.validated = true;
|
|
1133
|
-
}
|
|
1134
|
-
} else if (node) {
|
|
1135
|
-
var iteratorFn = getIteratorFn(node);
|
|
1136
|
-
|
|
1137
|
-
if (typeof iteratorFn === 'function') {
|
|
1138
|
-
// Entry iterators used to provide implicit keys,
|
|
1139
|
-
// but now we print a separate warning for them later.
|
|
1140
|
-
if (iteratorFn !== node.entries) {
|
|
1141
|
-
var iterator = iteratorFn.call(node);
|
|
1142
|
-
var step;
|
|
1143
|
-
|
|
1144
|
-
while (!(step = iterator.next()).done) {
|
|
1145
|
-
if (isValidElement(step.value)) {
|
|
1146
|
-
validateExplicitKey(step.value, parentType);
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
/**
|
|
1155
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
1156
|
-
* provided by the type.
|
|
1157
|
-
*
|
|
1158
|
-
* @param {ReactElement} element
|
|
1159
|
-
*/
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
function validatePropTypes(element) {
|
|
1163
|
-
{
|
|
1164
|
-
var type = element.type;
|
|
1165
|
-
|
|
1166
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
1167
|
-
return;
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
var propTypes;
|
|
1171
|
-
|
|
1172
|
-
if (typeof type === 'function') {
|
|
1173
|
-
propTypes = type.propTypes;
|
|
1174
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1175
|
-
// Inner props are checked in the reconciler.
|
|
1176
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1177
|
-
propTypes = type.propTypes;
|
|
1178
|
-
} else {
|
|
1179
|
-
return;
|
|
204
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
205
|
+
var componentName = getComponentNameFromType(this.type);
|
|
206
|
+
didWarnAboutElementRef[componentName] ||
|
|
207
|
+
((didWarnAboutElementRef[componentName] = true),
|
|
208
|
+
console.error(
|
|
209
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
210
|
+
));
|
|
211
|
+
componentName = this.props.ref;
|
|
212
|
+
return void 0 !== componentName ? componentName : null;
|
|
1180
213
|
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
214
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
215
|
+
var refProp = props.ref;
|
|
216
|
+
type = {
|
|
217
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
218
|
+
type: type,
|
|
219
|
+
key: key,
|
|
220
|
+
props: props,
|
|
221
|
+
_owner: owner
|
|
222
|
+
};
|
|
223
|
+
null !== (void 0 !== refProp ? refProp : null)
|
|
224
|
+
? Object.defineProperty(type, "ref", {
|
|
225
|
+
enumerable: false,
|
|
226
|
+
get: elementRefGetterWithDeprecationWarning
|
|
227
|
+
})
|
|
228
|
+
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
229
|
+
type._store = {};
|
|
230
|
+
Object.defineProperty(type._store, "validated", {
|
|
231
|
+
configurable: false,
|
|
232
|
+
enumerable: false,
|
|
233
|
+
writable: true,
|
|
234
|
+
value: 0
|
|
235
|
+
});
|
|
236
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
237
|
+
configurable: false,
|
|
238
|
+
enumerable: false,
|
|
239
|
+
writable: true,
|
|
240
|
+
value: null
|
|
241
|
+
});
|
|
242
|
+
Object.defineProperty(type, "_debugStack", {
|
|
243
|
+
configurable: false,
|
|
244
|
+
enumerable: false,
|
|
245
|
+
writable: true,
|
|
246
|
+
value: debugStack
|
|
247
|
+
});
|
|
248
|
+
Object.defineProperty(type, "_debugTask", {
|
|
249
|
+
configurable: false,
|
|
250
|
+
enumerable: false,
|
|
251
|
+
writable: true,
|
|
252
|
+
value: debugTask
|
|
253
|
+
});
|
|
254
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
255
|
+
return type;
|
|
1196
256
|
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
257
|
+
function jsxDEVImpl(
|
|
258
|
+
type,
|
|
259
|
+
config,
|
|
260
|
+
maybeKey,
|
|
261
|
+
isStaticChildren,
|
|
262
|
+
debugStack,
|
|
263
|
+
debugTask
|
|
264
|
+
) {
|
|
265
|
+
var children = config.children;
|
|
266
|
+
if (void 0 !== children)
|
|
267
|
+
if (isStaticChildren)
|
|
268
|
+
if (isArrayImpl(children)) {
|
|
269
|
+
for (
|
|
270
|
+
isStaticChildren = 0;
|
|
271
|
+
isStaticChildren < children.length;
|
|
272
|
+
isStaticChildren++
|
|
273
|
+
)
|
|
274
|
+
validateChildKeys(children[isStaticChildren]);
|
|
275
|
+
Object.freeze && Object.freeze(children);
|
|
276
|
+
} else
|
|
277
|
+
console.error(
|
|
278
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
279
|
+
);
|
|
280
|
+
else validateChildKeys(children);
|
|
281
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
282
|
+
children = getComponentNameFromType(type);
|
|
283
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
284
|
+
return "key" !== k;
|
|
285
|
+
});
|
|
286
|
+
isStaticChildren =
|
|
287
|
+
0 < keys.length
|
|
288
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
289
|
+
: "{key: someKey}";
|
|
290
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
291
|
+
((keys =
|
|
292
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
293
|
+
console.error(
|
|
294
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
295
|
+
isStaticChildren,
|
|
296
|
+
children,
|
|
297
|
+
keys,
|
|
298
|
+
children
|
|
299
|
+
),
|
|
300
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
1219
301
|
}
|
|
302
|
+
children = null;
|
|
303
|
+
void 0 !== maybeKey &&
|
|
304
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
305
|
+
hasValidKey(config) &&
|
|
306
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
307
|
+
if ("key" in config) {
|
|
308
|
+
maybeKey = {};
|
|
309
|
+
for (var propName in config)
|
|
310
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
311
|
+
} else maybeKey = config;
|
|
312
|
+
children &&
|
|
313
|
+
defineKeyPropWarningGetter(
|
|
314
|
+
maybeKey,
|
|
315
|
+
"function" === typeof type
|
|
316
|
+
? type.displayName || type.name || "Unknown"
|
|
317
|
+
: type
|
|
318
|
+
);
|
|
319
|
+
return ReactElement(
|
|
320
|
+
type,
|
|
321
|
+
children,
|
|
322
|
+
maybeKey,
|
|
323
|
+
getOwner(),
|
|
324
|
+
debugStack,
|
|
325
|
+
debugTask
|
|
326
|
+
);
|
|
1220
327
|
}
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
328
|
+
function validateChildKeys(node) {
|
|
329
|
+
isValidElement(node)
|
|
330
|
+
? node._store && (node._store.validated = 1)
|
|
331
|
+
: "object" === typeof node &&
|
|
332
|
+
null !== node &&
|
|
333
|
+
node.$$typeof === REACT_LAZY_TYPE &&
|
|
334
|
+
("fulfilled" === node._payload.status
|
|
335
|
+
? isValidElement(node._payload.value) &&
|
|
336
|
+
node._payload.value._store &&
|
|
337
|
+
(node._payload.value._store.validated = 1)
|
|
338
|
+
: node._store && (node._store.validated = 1));
|
|
1228
339
|
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
// succeed and there will likely be errors in render.
|
|
1236
|
-
|
|
1237
|
-
if (!validType) {
|
|
1238
|
-
var info = '';
|
|
1239
|
-
|
|
1240
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1241
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
var sourceInfo = getSourceInfoErrorAddendum();
|
|
1245
|
-
|
|
1246
|
-
if (sourceInfo) {
|
|
1247
|
-
info += sourceInfo;
|
|
1248
|
-
} else {
|
|
1249
|
-
info += getDeclarationErrorAddendum();
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
var typeString;
|
|
1253
|
-
|
|
1254
|
-
if (type === null) {
|
|
1255
|
-
typeString = 'null';
|
|
1256
|
-
} else if (isArray(type)) {
|
|
1257
|
-
typeString = 'array';
|
|
1258
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1259
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1260
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1261
|
-
} else {
|
|
1262
|
-
typeString = typeof type;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
340
|
+
function isValidElement(object) {
|
|
341
|
+
return (
|
|
342
|
+
"object" === typeof object &&
|
|
343
|
+
null !== object &&
|
|
344
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
345
|
+
);
|
|
1266
346
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1295
|
-
}
|
|
1296
|
-
} else {
|
|
1297
|
-
validateChildKeys(children, type);
|
|
1298
|
-
}
|
|
347
|
+
var React = require$$0,
|
|
348
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
349
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
350
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
351
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
352
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|
353
|
+
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
354
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
355
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
356
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
357
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
358
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
359
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
360
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
361
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
362
|
+
ReactSharedInternals =
|
|
363
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
364
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
365
|
+
isArrayImpl = Array.isArray,
|
|
366
|
+
createTask = console.createTask
|
|
367
|
+
? console.createTask
|
|
368
|
+
: function () {
|
|
369
|
+
return null;
|
|
370
|
+
};
|
|
371
|
+
React = {
|
|
372
|
+
react_stack_bottom_frame: function (callStackForError) {
|
|
373
|
+
return callStackForError();
|
|
1299
374
|
}
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
375
|
+
};
|
|
376
|
+
var specialPropKeyWarningShown;
|
|
377
|
+
var didWarnAboutElementRef = {};
|
|
378
|
+
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
|
379
|
+
React,
|
|
380
|
+
UnknownOwner
|
|
381
|
+
)();
|
|
382
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
383
|
+
var didWarnAboutKeySpread = {};
|
|
384
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
385
|
+
reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
|
|
386
|
+
var trackActualOwner =
|
|
387
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
388
|
+
return jsxDEVImpl(
|
|
389
|
+
type,
|
|
390
|
+
config,
|
|
391
|
+
maybeKey,
|
|
392
|
+
false,
|
|
393
|
+
trackActualOwner
|
|
394
|
+
? Error("react-stack-top-frame")
|
|
395
|
+
: unknownOwnerDebugStack,
|
|
396
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
397
|
+
);
|
|
398
|
+
};
|
|
399
|
+
reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
|
|
400
|
+
var trackActualOwner =
|
|
401
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
402
|
+
return jsxDEVImpl(
|
|
403
|
+
type,
|
|
404
|
+
config,
|
|
405
|
+
maybeKey,
|
|
406
|
+
true,
|
|
407
|
+
trackActualOwner
|
|
408
|
+
? Error("react-stack-top-frame")
|
|
409
|
+
: unknownOwnerDebugStack,
|
|
410
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
411
|
+
);
|
|
412
|
+
};
|
|
1334
413
|
})();
|
|
1335
|
-
}
|
|
1336
414
|
return reactJsxRuntime_development;
|
|
1337
415
|
}
|
|
1338
416
|
|
|
1339
417
|
if (process.env.NODE_ENV === 'production') {
|
|
1340
|
-
jsxRuntime.exports =
|
|
418
|
+
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
1341
419
|
} else {
|
|
1342
420
|
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1343
421
|
}
|
|
@@ -2054,7 +1132,7 @@ function RlsNavbar({ children, identifier, rlsTheme }) {
|
|
|
2054
1132
|
|
|
2055
1133
|
function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
2056
1134
|
const [template, setTemplate] = require$$0.useState();
|
|
2057
|
-
const controller = require$$0.useRef();
|
|
1135
|
+
const controller = require$$0.useRef(undefined);
|
|
2058
1136
|
const refreshTemplate = require$$0.useCallback((template, suggestions) => {
|
|
2059
1137
|
const { firstPage, lastPage } = template;
|
|
2060
1138
|
onPagination && onPagination({ firstPage, lastPage, suggestions });
|
|
@@ -2693,7 +1771,7 @@ function useListController(props) {
|
|
|
2693
1771
|
});
|
|
2694
1772
|
const changeValueInternal = require$$0.useRef(false);
|
|
2695
1773
|
const position = require$$0.useRef(0);
|
|
2696
|
-
const valueProtected = require$$0.useRef();
|
|
1774
|
+
const valueProtected = require$$0.useRef(undefined);
|
|
2697
1775
|
require$$0.useEffect(() => {
|
|
2698
1776
|
function onCloseSuggestions({ target }) {
|
|
2699
1777
|
!refContent?.current?.contains(target) &&
|
|
@@ -2982,10 +2060,6 @@ function RlsFieldAutocomplete(props) {
|
|
|
2982
2060
|
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2983
2061
|
}
|
|
2984
2062
|
|
|
2985
|
-
const DATE_FORMAT = '{dd}/{mx}/{yy}';
|
|
2986
|
-
const DATE_FORMAT_TITLE = '{dw}, {mx} {dd} de {yy}';
|
|
2987
|
-
const DATE_RANGE_FORMAT = '{dd}/{mx}/{yy}';
|
|
2988
|
-
|
|
2989
2063
|
function RlsModal({ children, className, onAutoClose, visible, rlsTheme }) {
|
|
2990
2064
|
const classNameModal = require$$0.useMemo(() => {
|
|
2991
2065
|
return renderClassStatus('rls-modal', { visible }, className);
|
|
@@ -2996,6 +2070,251 @@ function RlsModal({ children, className, onAutoClose, visible, rlsTheme }) {
|
|
|
2996
2070
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameModal, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
2997
2071
|
}
|
|
2998
2072
|
|
|
2073
|
+
function formatTime(value) {
|
|
2074
|
+
return String(value).padStart(2, '0');
|
|
2075
|
+
}
|
|
2076
|
+
const CLOCK_VALUES = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
2077
|
+
const RADIUS = 48;
|
|
2078
|
+
const DIAL_RADIUS = 60;
|
|
2079
|
+
const TICK_RADIUS = 7;
|
|
2080
|
+
function RlsPickerClockTick({ onValue, selectionIsHours, value }) {
|
|
2081
|
+
const styleTick = require$$0.useMemo(() => {
|
|
2082
|
+
const radian = (value / 6) * Math.PI;
|
|
2083
|
+
const x = Math.sin(radian) * RADIUS;
|
|
2084
|
+
const y = Math.cos(radian) * RADIUS;
|
|
2085
|
+
return {
|
|
2086
|
+
left: `${DIAL_RADIUS + x - TICK_RADIUS - 1}rem`,
|
|
2087
|
+
top: `${DIAL_RADIUS - y - TICK_RADIUS - 1}rem`
|
|
2088
|
+
};
|
|
2089
|
+
}, []);
|
|
2090
|
+
const label = require$$0.useMemo(() => {
|
|
2091
|
+
if (selectionIsHours) {
|
|
2092
|
+
return formatTime(value);
|
|
2093
|
+
}
|
|
2094
|
+
if (value === 12) {
|
|
2095
|
+
return formatTime(0);
|
|
2096
|
+
}
|
|
2097
|
+
return formatTime(value * 5);
|
|
2098
|
+
}, [selectionIsHours]);
|
|
2099
|
+
const onClick = require$$0.useCallback((event) => {
|
|
2100
|
+
event.preventDefault();
|
|
2101
|
+
onValue(value);
|
|
2102
|
+
}, [onValue]);
|
|
2103
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__tick", style: styleTick, onClick: onClick, children: label }));
|
|
2104
|
+
}
|
|
2105
|
+
function RlsPickerClock({ formControl, onListener, rlsTheme, time }) {
|
|
2106
|
+
const timeInitial = require$$0.useMemo(() => {
|
|
2107
|
+
return formControl?.value ?? time ?? dates.Time.now();
|
|
2108
|
+
}, [formControl?.value, time]);
|
|
2109
|
+
const plateElement = require$$0.useRef(null);
|
|
2110
|
+
const lineElement = require$$0.useRef(null);
|
|
2111
|
+
const centerElement = require$$0.useRef(null);
|
|
2112
|
+
const indicatorElement = require$$0.useRef(null);
|
|
2113
|
+
const pointElement = require$$0.useRef(null);
|
|
2114
|
+
const [labels, setLabels] = require$$0.useState({
|
|
2115
|
+
timeActionCancel: reactI18n('dateActionCancel'),
|
|
2116
|
+
timeActionSelect: reactI18n('dateActionSelect')
|
|
2117
|
+
});
|
|
2118
|
+
const [zoneIsPM, setZoneIsPM] = require$$0.useState(timeInitial.hour >= 12);
|
|
2119
|
+
const [hour, setHour] = require$$0.useState(zoneIsPM ? timeInitial.hour - 12 : timeInitial.hour);
|
|
2120
|
+
const [minute, setMinute] = require$$0.useState(timeInitial.minute);
|
|
2121
|
+
const [selectionIsHours, setSelectionIsHours] = require$$0.useState(true);
|
|
2122
|
+
const selectionIsActive = require$$0.useRef(false);
|
|
2123
|
+
const radianUnit = require$$0.useMemo(() => {
|
|
2124
|
+
return Math.PI / (selectionIsHours ? 6 : 30);
|
|
2125
|
+
}, [selectionIsHours]);
|
|
2126
|
+
const hourFormat = require$$0.useMemo(() => {
|
|
2127
|
+
return formatTime(hour === 0 ? 12 : hour);
|
|
2128
|
+
}, [hour]);
|
|
2129
|
+
const minuteFormat = require$$0.useMemo(() => {
|
|
2130
|
+
return formatTime(minute);
|
|
2131
|
+
}, [minute]);
|
|
2132
|
+
const classNameHour = require$$0.useMemo(() => {
|
|
2133
|
+
return renderClassStatus('rls-picker-clock__title__value', {
|
|
2134
|
+
active: selectionIsHours
|
|
2135
|
+
});
|
|
2136
|
+
}, [selectionIsHours]);
|
|
2137
|
+
const classNameMinute = require$$0.useMemo(() => {
|
|
2138
|
+
return renderClassStatus('rls-picker-clock__title__value', {
|
|
2139
|
+
active: !selectionIsHours
|
|
2140
|
+
});
|
|
2141
|
+
}, [selectionIsHours]);
|
|
2142
|
+
const classNameAM = require$$0.useMemo(() => {
|
|
2143
|
+
return renderClassStatus('rls-picker-clock__zone__value', {
|
|
2144
|
+
active: !zoneIsPM
|
|
2145
|
+
});
|
|
2146
|
+
}, [zoneIsPM]);
|
|
2147
|
+
const classNamePM = require$$0.useMemo(() => {
|
|
2148
|
+
return renderClassStatus('rls-picker-clock__zone__value', {
|
|
2149
|
+
active: zoneIsPM
|
|
2150
|
+
});
|
|
2151
|
+
}, [zoneIsPM]);
|
|
2152
|
+
const refreshClockHour = require$$0.useEffectEvent(() => {
|
|
2153
|
+
refreshClock(hour > 12 ? hour - 12 : hour);
|
|
2154
|
+
});
|
|
2155
|
+
const refreshClockMinute = require$$0.useEffectEvent(() => {
|
|
2156
|
+
refreshClock(minute);
|
|
2157
|
+
});
|
|
2158
|
+
require$$0.useEffect(() => {
|
|
2159
|
+
return i18n.i18nSubscribe(() => {
|
|
2160
|
+
setLabels({
|
|
2161
|
+
timeActionCancel: reactI18n('dateActionCancel'),
|
|
2162
|
+
timeActionSelect: reactI18n('dateActionSelect')
|
|
2163
|
+
});
|
|
2164
|
+
});
|
|
2165
|
+
}, []);
|
|
2166
|
+
require$$0.useEffect(() => {
|
|
2167
|
+
selectionIsHours ? refreshClockHour() : refreshClockMinute();
|
|
2168
|
+
}, [selectionIsHours]);
|
|
2169
|
+
const refreshComponent = require$$0.useCallback((clientX, clientY) => {
|
|
2170
|
+
const rectangle = plateElement.current.getBoundingClientRect();
|
|
2171
|
+
const centerX = rectangle.left + rectangle.width / 2;
|
|
2172
|
+
const centerY = rectangle.top + rectangle.height / 2;
|
|
2173
|
+
const positionX = clientX - centerX;
|
|
2174
|
+
const positionY = clientY - centerY;
|
|
2175
|
+
const angle = Math.atan2(-positionX, positionY) + Math.PI;
|
|
2176
|
+
const value = Math.round(angle / radianUnit);
|
|
2177
|
+
refreshClock(value);
|
|
2178
|
+
selectionIsHours ? setHour(value === 0 ? 12 : value) : setMinute(value);
|
|
2179
|
+
}, [selectionIsHours, radianUnit]);
|
|
2180
|
+
const refreshClock = require$$0.useCallback((value) => {
|
|
2181
|
+
const angle = value * radianUnit;
|
|
2182
|
+
const x2 = Math.sin(angle) * (RADIUS - TICK_RADIUS);
|
|
2183
|
+
const y2 = -Math.cos(angle) * (RADIUS - TICK_RADIUS);
|
|
2184
|
+
const cx = Math.sin(angle) * RADIUS;
|
|
2185
|
+
const cy = -Math.cos(angle) * RADIUS;
|
|
2186
|
+
lineElement.current.setAttribute('x2', `${x2 - 1}rem`);
|
|
2187
|
+
lineElement.current.setAttribute('y2', `${y2 - 1}rem`);
|
|
2188
|
+
indicatorElement.current.setAttribute('cx', `${cx - 1}rem`);
|
|
2189
|
+
indicatorElement.current.setAttribute('cy', `${cy - 1}rem`);
|
|
2190
|
+
pointElement.current.setAttribute('cx', `${cx - 1}rem`);
|
|
2191
|
+
pointElement.current.setAttribute('cy', `${cy - 1}rem`);
|
|
2192
|
+
pointElement.current.style.visibility =
|
|
2193
|
+
selectionIsHours || value % 5 === 0 ? 'hidden' : 'visible';
|
|
2194
|
+
}, [selectionIsHours, radianUnit]);
|
|
2195
|
+
const onClickHour = require$$0.useCallback(() => {
|
|
2196
|
+
setSelectionIsHours(true);
|
|
2197
|
+
}, []);
|
|
2198
|
+
const onClickMinute = require$$0.useCallback(() => {
|
|
2199
|
+
setSelectionIsHours(false);
|
|
2200
|
+
}, []);
|
|
2201
|
+
const onClickAM = require$$0.useCallback(() => {
|
|
2202
|
+
setZoneIsPM(false);
|
|
2203
|
+
}, []);
|
|
2204
|
+
const onClickPM = require$$0.useCallback(() => {
|
|
2205
|
+
setZoneIsPM(true);
|
|
2206
|
+
}, []);
|
|
2207
|
+
const onActiveSelection = require$$0.useCallback(() => {
|
|
2208
|
+
selectionIsActive.current = true;
|
|
2209
|
+
}, []);
|
|
2210
|
+
const onMouseSelection = require$$0.useCallback((event) => {
|
|
2211
|
+
if (selectionIsActive.current) {
|
|
2212
|
+
event.preventDefault();
|
|
2213
|
+
refreshComponent(event.clientX, event.clientY);
|
|
2214
|
+
}
|
|
2215
|
+
}, [refreshComponent]);
|
|
2216
|
+
const onTouchSelection = require$$0.useCallback((event) => {
|
|
2217
|
+
const touch = event.touches.item(0);
|
|
2218
|
+
if (selectionIsActive.current && touch) {
|
|
2219
|
+
refreshComponent(touch.clientX, touch.clientY);
|
|
2220
|
+
}
|
|
2221
|
+
}, [refreshComponent]);
|
|
2222
|
+
const onInactiveSelection = require$$0.useCallback(() => {
|
|
2223
|
+
selectionIsActive.current = false;
|
|
2224
|
+
}, []);
|
|
2225
|
+
const onClickValue = require$$0.useCallback((value) => {
|
|
2226
|
+
if (selectionIsHours) {
|
|
2227
|
+
setHour(value);
|
|
2228
|
+
refreshClock(value);
|
|
2229
|
+
}
|
|
2230
|
+
else {
|
|
2231
|
+
const minute = value === 12 ? 0 : value * 5;
|
|
2232
|
+
setMinute(minute);
|
|
2233
|
+
refreshClock(minute);
|
|
2234
|
+
}
|
|
2235
|
+
}, [selectionIsHours]);
|
|
2236
|
+
const onCancel = require$$0.useCallback(() => {
|
|
2237
|
+
onListener?.({ event: components.PickerListenerEvent.Cancel });
|
|
2238
|
+
}, [onListener]);
|
|
2239
|
+
const onCurrentTime = require$$0.useCallback(() => {
|
|
2240
|
+
const currentTime = dates.Time.now();
|
|
2241
|
+
formControl?.setValue(currentTime);
|
|
2242
|
+
setHour(currentTime.hour);
|
|
2243
|
+
setMinute(currentTime.minute);
|
|
2244
|
+
onListener?.({
|
|
2245
|
+
event: components.PickerListenerEvent.Select,
|
|
2246
|
+
value: currentTime
|
|
2247
|
+
});
|
|
2248
|
+
}, [formControl, onListener]);
|
|
2249
|
+
const onSelect = require$$0.useCallback(() => {
|
|
2250
|
+
const hourValue = zoneIsPM
|
|
2251
|
+
? hour !== 12
|
|
2252
|
+
? hour + 12
|
|
2253
|
+
: 12
|
|
2254
|
+
: hour === 12
|
|
2255
|
+
? 0
|
|
2256
|
+
: hour;
|
|
2257
|
+
const timeValue = new dates.Time(hourValue, minute);
|
|
2258
|
+
formControl?.setValue(timeValue);
|
|
2259
|
+
onListener?.({
|
|
2260
|
+
event: components.PickerListenerEvent.Select,
|
|
2261
|
+
value: timeValue
|
|
2262
|
+
});
|
|
2263
|
+
}, [formControl, hour, minute, zoneIsPM, onListener]);
|
|
2264
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__header", children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__title", children: [jsxRuntimeExports.jsx("span", { className: classNameHour, onClick: onClickHour, children: hourFormat }), jsxRuntimeExports.jsx("span", { className: "rls-picker-clock__title__separator", children: ":" }), jsxRuntimeExports.jsx("span", { className: classNameMinute, onClick: onClickMinute, children: minuteFormat })] }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__zone", children: [jsxRuntimeExports.jsx("span", { className: classNameAM, onClick: onClickAM, children: "AM" }), jsxRuntimeExports.jsx("span", { className: classNamePM, onClick: onClickPM, children: "PM" })] })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__body", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__plate", ref: plateElement, onMouseDown: onActiveSelection, onMouseMove: onMouseSelection, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onActiveSelection, onTouchMove: onTouchSelection, onTouchEnd: onInactiveSelection, children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__canvas", children: jsxRuntimeExports.jsx("svg", { width: "120rem", height: "120rem", children: jsxRuntimeExports.jsxs("g", { style: {
|
|
2265
|
+
transform: `translate(${DIAL_RADIUS}rem, ${DIAL_RADIUS}rem)`
|
|
2266
|
+
}, children: [jsxRuntimeExports.jsx("line", { ref: lineElement, className: "rls-picker-clock__canvas__line", x1: "-1", y1: "-1" }), jsxRuntimeExports.jsx("circle", { ref: centerElement, className: "rls-picker-clock__canvas__center", r: "4", cx: "-1", cy: "-1" }), jsxRuntimeExports.jsx("circle", { ref: indicatorElement, className: "rls-picker-clock__canvas__indicator", r: `${TICK_RADIUS}rem` }), jsxRuntimeExports.jsx("circle", { ref: pointElement, className: "rls-picker-clock__canvas__point", r: "3.5" })] }) }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__hours", children: CLOCK_VALUES.map((value) => {
|
|
2267
|
+
return (jsxRuntimeExports.jsx(RlsPickerClockTick, { value: value, selectionIsHours: selectionIsHours, onValue: onClickValue }, value));
|
|
2268
|
+
}) })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__footer", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.timeActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "timer", onClick: onCurrentTime }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.timeActionSelect }) })] })] }));
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
function RlsFieldClock({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, time, value: valueInitial }) {
|
|
2272
|
+
const [value, setValue] = require$$0.useState(formControl?.value ?? valueInitial);
|
|
2273
|
+
const [modalIsVisible, setModalIsVisible] = require$$0.useState(false);
|
|
2274
|
+
const _disabled = require$$0.useMemo(() => {
|
|
2275
|
+
return formControl?.disabled || disabled;
|
|
2276
|
+
}, [formControl?.disabled, disabled]);
|
|
2277
|
+
const className = require$$0.useMemo(() => {
|
|
2278
|
+
return renderClassStatus('rls-field-box', {
|
|
2279
|
+
disabled: _disabled,
|
|
2280
|
+
readonly: readOnly
|
|
2281
|
+
});
|
|
2282
|
+
}, [_disabled, readOnly]);
|
|
2283
|
+
const { icon, valueInput } = require$$0.useMemo(() => {
|
|
2284
|
+
return {
|
|
2285
|
+
icon: value ? 'trash-2' : 'timer',
|
|
2286
|
+
valueInput: value?.normalizeMeridiemFormat || ''
|
|
2287
|
+
};
|
|
2288
|
+
}, [value]);
|
|
2289
|
+
const onClickInput = require$$0.useCallback(() => {
|
|
2290
|
+
!readOnly && setModalIsVisible(true);
|
|
2291
|
+
}, [readOnly]);
|
|
2292
|
+
const onChange = require$$0.useCallback((value) => {
|
|
2293
|
+
setValue(value);
|
|
2294
|
+
onValue?.(value);
|
|
2295
|
+
}, [onValue]);
|
|
2296
|
+
const onClickAction = require$$0.useCallback(() => {
|
|
2297
|
+
if (value) {
|
|
2298
|
+
formControl?.setValue(valueInitial);
|
|
2299
|
+
formControl?.touch();
|
|
2300
|
+
onChange(valueInitial);
|
|
2301
|
+
}
|
|
2302
|
+
else {
|
|
2303
|
+
setModalIsVisible(true);
|
|
2304
|
+
}
|
|
2305
|
+
}, [value, formControl, valueInitial, onChange]);
|
|
2306
|
+
const onListener = require$$0.useCallback(({ event, value }) => {
|
|
2307
|
+
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2308
|
+
formControl?.touch();
|
|
2309
|
+
setModalIsVisible(false);
|
|
2310
|
+
}, [formControl, onChange]);
|
|
2311
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date__control", type: "text", value: valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: _disabled }), !readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-date__action", onClick: onClickAction, disabled: _disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-field-clock-modal", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerClock, { formControl: formControl, time: time, disabled: _disabled, onListener: onListener }) })] }));
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
const DATE_FORMAT = '{dd}/{mx}/{yy}';
|
|
2315
|
+
const DATE_FORMAT_TITLE = '{dw}, {mx} {dd} de {yy}';
|
|
2316
|
+
const DATE_RANGE_FORMAT = '{dd}/{mx}/{yy}';
|
|
2317
|
+
|
|
2999
2318
|
function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
3000
2319
|
const today = require$$0.useRef(new Date()); // Initial current date in component
|
|
3001
2320
|
const _date = require$$0.useMemo(() => {
|
|
@@ -3048,33 +2367,31 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
3048
2367
|
type === 'month' ? setVisibility('MONTH') : setVisibility('YEAR');
|
|
3049
2368
|
}, []);
|
|
3050
2369
|
const onCancel = require$$0.useCallback(() => {
|
|
3051
|
-
onListener
|
|
2370
|
+
onListener?.({ event: components.PickerListenerEvent.Cancel });
|
|
3052
2371
|
}, [onListener]);
|
|
3053
2372
|
const onToday = require$$0.useCallback(() => {
|
|
3054
2373
|
yearControl.setValue(today.current.getFullYear());
|
|
3055
2374
|
dayControl.setValue(today.current.getDate());
|
|
3056
2375
|
monthControl.setValue(today.current.getMonth());
|
|
3057
2376
|
formControl?.setValue(today.current);
|
|
3058
|
-
onListener
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
}, [today.current, formControl, onListener]);
|
|
2377
|
+
onListener?.({
|
|
2378
|
+
event: components.PickerListenerEvent.Now,
|
|
2379
|
+
value: today.current
|
|
2380
|
+
});
|
|
2381
|
+
}, [formControl, onListener]);
|
|
3064
2382
|
const onSelect = require$$0.useCallback(() => {
|
|
3065
2383
|
formControl?.setValue(value);
|
|
3066
|
-
onListener
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
});
|
|
2384
|
+
onListener?.({
|
|
2385
|
+
event: components.PickerListenerEvent.Select,
|
|
2386
|
+
value
|
|
2387
|
+
});
|
|
3071
2388
|
}, [formControl, value, onListener]);
|
|
3072
2389
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDay, { formControl: dayControl, date: _date, month: monthControl.value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, date: _date, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, date: _date, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), !automatic && (jsxRuntimeExports.jsx("div", { className: "rls-picker-date__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "calendar", onClick: onToday, disabled: itIsDisabledToday }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.dateActionSelect }) })] }) }))] }));
|
|
3073
2390
|
}
|
|
3074
2391
|
|
|
3075
|
-
function RlsFieldDate({ children, date, disabled, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value:
|
|
2392
|
+
function RlsFieldDate({ children, date, disabled, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3076
2393
|
const today = require$$0.useRef(new Date()); // Initial current date in component
|
|
3077
|
-
const [value, setValue] = require$$0.useState(formControl?.value ??
|
|
2394
|
+
const [value, setValue] = require$$0.useState(formControl?.value ?? valueInitial);
|
|
3078
2395
|
const [modalIsVisible, setModalIsVisible] = require$$0.useState(false);
|
|
3079
2396
|
const _disabled = require$$0.useMemo(() => {
|
|
3080
2397
|
return formControl?.disabled || disabled;
|
|
@@ -3109,14 +2426,14 @@ function RlsFieldDate({ children, date, disabled, formControl, format, identifie
|
|
|
3109
2426
|
}, [onValue]);
|
|
3110
2427
|
const onClickAction = require$$0.useCallback(() => {
|
|
3111
2428
|
if (value) {
|
|
3112
|
-
formControl?.setValue(
|
|
2429
|
+
formControl?.setValue(valueInitial);
|
|
3113
2430
|
formControl?.touch();
|
|
3114
|
-
onChange(
|
|
2431
|
+
onChange(valueInitial);
|
|
3115
2432
|
}
|
|
3116
2433
|
else {
|
|
3117
2434
|
setModalIsVisible(true);
|
|
3118
2435
|
}
|
|
3119
|
-
}, [value, formControl,
|
|
2436
|
+
}, [value, formControl, valueInitial, onChange]);
|
|
3120
2437
|
const onListener = require$$0.useCallback(({ event, value }) => {
|
|
3121
2438
|
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
3122
2439
|
formControl?.touch();
|
|
@@ -3131,8 +2448,8 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
3131
2448
|
return `${minFormat} - ${maxFormat}`;
|
|
3132
2449
|
}
|
|
3133
2450
|
|
|
3134
|
-
function RlsPickerDateRange({ automatic, date:
|
|
3135
|
-
const _date = require$$0.useMemo(() => dates.normalizeMinTime(
|
|
2451
|
+
function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
2452
|
+
const _date = require$$0.useMemo(() => dates.normalizeMinTime(datePicker ?? new Date()), [datePicker]);
|
|
3136
2453
|
const _range = require$$0.useMemo(() => formControl?.value ?? dates.DateRange.now(), [formControl?.value]);
|
|
3137
2454
|
const yearControl = reactForms.useReactControl(_date.getFullYear());
|
|
3138
2455
|
const monthControl = reactForms.useReactControl(_date.getMonth());
|
|
@@ -3564,7 +2881,7 @@ function RlsImageEditor(props) {
|
|
|
3564
2881
|
const refCanvas = require$$0.useRef(null);
|
|
3565
2882
|
const refPicture = require$$0.useRef(null);
|
|
3566
2883
|
const image = require$$0.useRef(new Image());
|
|
3567
|
-
const originalImage = require$$0.useRef();
|
|
2884
|
+
const originalImage = require$$0.useRef(undefined);
|
|
3568
2885
|
const ratio = require$$0.useMemo(() => {
|
|
3569
2886
|
return props.ratio || '1:1';
|
|
3570
2887
|
}, [props.ratio]);
|
|
@@ -3853,7 +3170,7 @@ function RlsSnackbar({ content, onClose, icon, rlsTheme, title, visible }) {
|
|
|
3853
3170
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
|
|
3854
3171
|
}
|
|
3855
3172
|
function useSnackbar() {
|
|
3856
|
-
const timeoutId = require$$0.useRef();
|
|
3173
|
+
const timeoutId = require$$0.useRef(undefined);
|
|
3857
3174
|
const duration = require$$0.useRef(4000);
|
|
3858
3175
|
const [state, setState] = require$$0.useState({
|
|
3859
3176
|
config: {},
|
|
@@ -3967,6 +3284,7 @@ exports.RlsDatatableTitle = RlsDatatableTitle;
|
|
|
3967
3284
|
exports.RlsDatatableTotals = RlsDatatableTotals;
|
|
3968
3285
|
exports.RlsFieldAutocomplete = RlsFieldAutocomplete;
|
|
3969
3286
|
exports.RlsFieldAutocompleteTemplate = RlsFieldAutocompleteTemplate;
|
|
3287
|
+
exports.RlsFieldClock = RlsFieldClock;
|
|
3970
3288
|
exports.RlsFieldDate = RlsFieldDate;
|
|
3971
3289
|
exports.RlsFieldDateRange = RlsFieldDateRange;
|
|
3972
3290
|
exports.RlsFieldDecimal = RlsFieldDecimal;
|
|
@@ -4001,6 +3319,7 @@ exports.RlsModal = RlsModal;
|
|
|
4001
3319
|
exports.RlsModalSheet = RlsModalSheet;
|
|
4002
3320
|
exports.RlsNavbar = RlsNavbar;
|
|
4003
3321
|
exports.RlsPagination = RlsPagination;
|
|
3322
|
+
exports.RlsPickerClock = RlsPickerClock;
|
|
4004
3323
|
exports.RlsPickerDate = RlsPickerDate;
|
|
4005
3324
|
exports.RlsPickerDateRange = RlsPickerDateRange;
|
|
4006
3325
|
exports.RlsPickerDay = RlsPickerDay;
|