@nccirtu/tablefy 0.1.6 → 0.2.0
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/columns/index.esm.js +206 -1578
- package/dist/columns/index.esm.js.map +1 -1
- package/dist/columns/index.js +219 -1591
- package/dist/columns/index.js.map +1 -1
- package/dist/columns/lib/builders/empty-state.d.ts +19 -0
- package/dist/columns/lib/builders/table-schema.d.ts +71 -2
- package/dist/index.esm.js +441 -1600
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +454 -1613
- package/dist/index.js.map +1 -1
- package/dist/lib/builders/empty-state.d.ts +19 -0
- package/dist/lib/builders/table-schema.d.ts +71 -2
- package/package.json +4 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import React__default, { useState, useLayoutEffect } from 'react';
|
|
3
4
|
import { useReactTable, getCoreRowModel, getSortedRowModel, getFilteredRowModel, getPaginationRowModel, flexRender } from '@tanstack/react-table';
|
|
@@ -5,1396 +6,23 @@ import { Search, X, ChevronDown, ChevronDownIcon, CheckIcon, ChevronUpIcon, Chev
|
|
|
5
6
|
import * as ReactDOM from 'react-dom';
|
|
6
7
|
import ReactDOM__default from 'react-dom';
|
|
7
8
|
|
|
8
|
-
var jsxRuntime = {exports: {}};
|
|
9
|
-
|
|
10
|
-
var reactJsxRuntime_production_min = {};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @license React
|
|
14
|
-
* react-jsx-runtime.production.min.js
|
|
15
|
-
*
|
|
16
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the MIT license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
23
|
-
|
|
24
|
-
function requireReactJsxRuntime_production_min () {
|
|
25
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
26
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
27
|
-
var f=React__default,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
28
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
29
|
-
return reactJsxRuntime_production_min;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var reactJsxRuntime_development = {};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-jsx-runtime.development.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
var hasRequiredReactJsxRuntime_development;
|
|
45
|
-
|
|
46
|
-
function requireReactJsxRuntime_development () {
|
|
47
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
48
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
49
|
-
|
|
50
|
-
if (process.env.NODE_ENV !== "production") {
|
|
51
|
-
(function() {
|
|
52
|
-
|
|
53
|
-
var React = React__default;
|
|
54
|
-
|
|
55
|
-
// ATTENTION
|
|
56
|
-
// When adding new symbols to this file,
|
|
57
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
58
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
59
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
60
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
61
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
62
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
63
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
64
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
65
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
66
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
67
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
68
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
69
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
70
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
71
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
72
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
73
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
74
|
-
function getIteratorFn(maybeIterable) {
|
|
75
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
80
|
-
|
|
81
|
-
if (typeof maybeIterator === 'function') {
|
|
82
|
-
return maybeIterator;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
89
|
-
|
|
90
|
-
function error(format) {
|
|
91
|
-
{
|
|
92
|
-
{
|
|
93
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
94
|
-
args[_key2 - 1] = arguments[_key2];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
printWarning('error', format, args);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function printWarning(level, format, args) {
|
|
103
|
-
// When changing this logic, you might want to also
|
|
104
|
-
// update consoleWithStackDev.www.js as well.
|
|
105
|
-
{
|
|
106
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
107
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
108
|
-
|
|
109
|
-
if (stack !== '') {
|
|
110
|
-
format += '%s';
|
|
111
|
-
args = args.concat([stack]);
|
|
112
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var argsWithFormat = args.map(function (item) {
|
|
116
|
-
return String(item);
|
|
117
|
-
}); // Careful: RN currently depends on this prefix
|
|
118
|
-
|
|
119
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
120
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
121
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
122
|
-
|
|
123
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// -----------------------------------------------------------------------------
|
|
128
|
-
|
|
129
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
130
|
-
var enableCacheElement = false;
|
|
131
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
132
|
-
|
|
133
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
134
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
135
|
-
// issues in DEV builds.
|
|
136
|
-
|
|
137
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
138
|
-
|
|
139
|
-
var REACT_MODULE_REFERENCE;
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function isValidElementType(type) {
|
|
146
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
147
|
-
return true;
|
|
148
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
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 ) {
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (typeof type === 'object' && type !== null) {
|
|
156
|
-
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
|
|
157
|
-
// types supported by any Flight configuration anywhere since
|
|
158
|
-
// we don't know which Flight build this will end up being used
|
|
159
|
-
// with.
|
|
160
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
169
|
-
var displayName = outerType.displayName;
|
|
170
|
-
|
|
171
|
-
if (displayName) {
|
|
172
|
-
return displayName;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
176
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
177
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
function getContextName(type) {
|
|
181
|
-
return type.displayName || 'Context';
|
|
182
|
-
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
function getComponentNameFromType(type) {
|
|
186
|
-
if (type == null) {
|
|
187
|
-
// Host root, text node or just invalid type.
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
{
|
|
192
|
-
if (typeof type.tag === 'number') {
|
|
193
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (typeof type === 'function') {
|
|
198
|
-
return type.displayName || type.name || null;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (typeof type === 'string') {
|
|
202
|
-
return type;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
switch (type) {
|
|
206
|
-
case REACT_FRAGMENT_TYPE:
|
|
207
|
-
return 'Fragment';
|
|
208
|
-
|
|
209
|
-
case REACT_PORTAL_TYPE:
|
|
210
|
-
return 'Portal';
|
|
211
|
-
|
|
212
|
-
case REACT_PROFILER_TYPE:
|
|
213
|
-
return 'Profiler';
|
|
214
|
-
|
|
215
|
-
case REACT_STRICT_MODE_TYPE:
|
|
216
|
-
return 'StrictMode';
|
|
217
|
-
|
|
218
|
-
case REACT_SUSPENSE_TYPE:
|
|
219
|
-
return 'Suspense';
|
|
220
|
-
|
|
221
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
222
|
-
return 'SuspenseList';
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (typeof type === 'object') {
|
|
227
|
-
switch (type.$$typeof) {
|
|
228
|
-
case REACT_CONTEXT_TYPE:
|
|
229
|
-
var context = type;
|
|
230
|
-
return getContextName(context) + '.Consumer';
|
|
231
|
-
|
|
232
|
-
case REACT_PROVIDER_TYPE:
|
|
233
|
-
var provider = type;
|
|
234
|
-
return getContextName(provider._context) + '.Provider';
|
|
235
|
-
|
|
236
|
-
case REACT_FORWARD_REF_TYPE:
|
|
237
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
238
|
-
|
|
239
|
-
case REACT_MEMO_TYPE:
|
|
240
|
-
var outerName = type.displayName || null;
|
|
241
|
-
|
|
242
|
-
if (outerName !== null) {
|
|
243
|
-
return outerName;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
247
|
-
|
|
248
|
-
case REACT_LAZY_TYPE:
|
|
249
|
-
{
|
|
250
|
-
var lazyComponent = type;
|
|
251
|
-
var payload = lazyComponent._payload;
|
|
252
|
-
var init = lazyComponent._init;
|
|
253
|
-
|
|
254
|
-
try {
|
|
255
|
-
return getComponentNameFromType(init(payload));
|
|
256
|
-
} catch (x) {
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// eslint-disable-next-line no-fallthrough
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
var assign = Object.assign;
|
|
269
|
-
|
|
270
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
271
|
-
// replaying on render function. This currently only patches the object
|
|
272
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
273
|
-
// We could also eagerly patch the method.
|
|
274
|
-
var disabledDepth = 0;
|
|
275
|
-
var prevLog;
|
|
276
|
-
var prevInfo;
|
|
277
|
-
var prevWarn;
|
|
278
|
-
var prevError;
|
|
279
|
-
var prevGroup;
|
|
280
|
-
var prevGroupCollapsed;
|
|
281
|
-
var prevGroupEnd;
|
|
282
|
-
|
|
283
|
-
function disabledLog() {}
|
|
284
|
-
|
|
285
|
-
disabledLog.__reactDisabledLog = true;
|
|
286
|
-
function disableLogs() {
|
|
287
|
-
{
|
|
288
|
-
if (disabledDepth === 0) {
|
|
289
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
290
|
-
prevLog = console.log;
|
|
291
|
-
prevInfo = console.info;
|
|
292
|
-
prevWarn = console.warn;
|
|
293
|
-
prevError = console.error;
|
|
294
|
-
prevGroup = console.group;
|
|
295
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
296
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
297
|
-
|
|
298
|
-
var props = {
|
|
299
|
-
configurable: true,
|
|
300
|
-
enumerable: true,
|
|
301
|
-
value: disabledLog,
|
|
302
|
-
writable: true
|
|
303
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
304
|
-
|
|
305
|
-
Object.defineProperties(console, {
|
|
306
|
-
info: props,
|
|
307
|
-
log: props,
|
|
308
|
-
warn: props,
|
|
309
|
-
error: props,
|
|
310
|
-
group: props,
|
|
311
|
-
groupCollapsed: props,
|
|
312
|
-
groupEnd: props
|
|
313
|
-
});
|
|
314
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
disabledDepth++;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
function reenableLogs() {
|
|
321
|
-
{
|
|
322
|
-
disabledDepth--;
|
|
323
|
-
|
|
324
|
-
if (disabledDepth === 0) {
|
|
325
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
326
|
-
var props = {
|
|
327
|
-
configurable: true,
|
|
328
|
-
enumerable: true,
|
|
329
|
-
writable: true
|
|
330
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
331
|
-
|
|
332
|
-
Object.defineProperties(console, {
|
|
333
|
-
log: assign({}, props, {
|
|
334
|
-
value: prevLog
|
|
335
|
-
}),
|
|
336
|
-
info: assign({}, props, {
|
|
337
|
-
value: prevInfo
|
|
338
|
-
}),
|
|
339
|
-
warn: assign({}, props, {
|
|
340
|
-
value: prevWarn
|
|
341
|
-
}),
|
|
342
|
-
error: assign({}, props, {
|
|
343
|
-
value: prevError
|
|
344
|
-
}),
|
|
345
|
-
group: assign({}, props, {
|
|
346
|
-
value: prevGroup
|
|
347
|
-
}),
|
|
348
|
-
groupCollapsed: assign({}, props, {
|
|
349
|
-
value: prevGroupCollapsed
|
|
350
|
-
}),
|
|
351
|
-
groupEnd: assign({}, props, {
|
|
352
|
-
value: prevGroupEnd
|
|
353
|
-
})
|
|
354
|
-
});
|
|
355
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
if (disabledDepth < 0) {
|
|
359
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
365
|
-
var prefix;
|
|
366
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
367
|
-
{
|
|
368
|
-
if (prefix === undefined) {
|
|
369
|
-
// Extract the VM specific prefix used by each line.
|
|
370
|
-
try {
|
|
371
|
-
throw Error();
|
|
372
|
-
} catch (x) {
|
|
373
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
374
|
-
prefix = match && match[1] || '';
|
|
375
|
-
}
|
|
376
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
return '\n' + prefix + name;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
var reentry = false;
|
|
383
|
-
var componentFrameCache;
|
|
384
|
-
|
|
385
|
-
{
|
|
386
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
387
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
391
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
392
|
-
if ( !fn || reentry) {
|
|
393
|
-
return '';
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
{
|
|
397
|
-
var frame = componentFrameCache.get(fn);
|
|
398
|
-
|
|
399
|
-
if (frame !== undefined) {
|
|
400
|
-
return frame;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
var control;
|
|
405
|
-
reentry = true;
|
|
406
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
407
|
-
|
|
408
|
-
Error.prepareStackTrace = undefined;
|
|
409
|
-
var previousDispatcher;
|
|
410
|
-
|
|
411
|
-
{
|
|
412
|
-
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
413
|
-
// for warnings.
|
|
414
|
-
|
|
415
|
-
ReactCurrentDispatcher.current = null;
|
|
416
|
-
disableLogs();
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
try {
|
|
420
|
-
// This should throw.
|
|
421
|
-
if (construct) {
|
|
422
|
-
// Something should be setting the props in the constructor.
|
|
423
|
-
var Fake = function () {
|
|
424
|
-
throw Error();
|
|
425
|
-
}; // $FlowFixMe
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
429
|
-
set: function () {
|
|
430
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
431
|
-
// because that won't throw in a non-strict mode function.
|
|
432
|
-
throw Error();
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
|
|
436
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
437
|
-
// We construct a different control for this case to include any extra
|
|
438
|
-
// frames added by the construct call.
|
|
439
|
-
try {
|
|
440
|
-
Reflect.construct(Fake, []);
|
|
441
|
-
} catch (x) {
|
|
442
|
-
control = x;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
Reflect.construct(fn, [], Fake);
|
|
446
|
-
} else {
|
|
447
|
-
try {
|
|
448
|
-
Fake.call();
|
|
449
|
-
} catch (x) {
|
|
450
|
-
control = x;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
fn.call(Fake.prototype);
|
|
454
|
-
}
|
|
455
|
-
} else {
|
|
456
|
-
try {
|
|
457
|
-
throw Error();
|
|
458
|
-
} catch (x) {
|
|
459
|
-
control = x;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
fn();
|
|
463
|
-
}
|
|
464
|
-
} catch (sample) {
|
|
465
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
466
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
467
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
468
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
469
|
-
var sampleLines = sample.stack.split('\n');
|
|
470
|
-
var controlLines = control.stack.split('\n');
|
|
471
|
-
var s = sampleLines.length - 1;
|
|
472
|
-
var c = controlLines.length - 1;
|
|
473
|
-
|
|
474
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
475
|
-
// We expect at least one stack frame to be shared.
|
|
476
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
477
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
478
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
479
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
480
|
-
// the sample somewhere in the control.
|
|
481
|
-
c--;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
485
|
-
// Next we find the first one that isn't the same which should be the
|
|
486
|
-
// frame that called our sample function and the control.
|
|
487
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
488
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
489
|
-
// If we're about to return the first line, and the control is also on the same
|
|
490
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
491
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
492
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
493
|
-
if (s !== 1 || c !== 1) {
|
|
494
|
-
do {
|
|
495
|
-
s--;
|
|
496
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
497
|
-
// The next one that isn't the same should be our match though.
|
|
498
|
-
|
|
499
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
500
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
501
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
502
|
-
// but we have a user-provided "displayName"
|
|
503
|
-
// splice it in to make the stack more readable.
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
507
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
{
|
|
511
|
-
if (typeof fn === 'function') {
|
|
512
|
-
componentFrameCache.set(fn, _frame);
|
|
513
|
-
}
|
|
514
|
-
} // Return the line we found.
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
return _frame;
|
|
518
|
-
}
|
|
519
|
-
} while (s >= 1 && c >= 0);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
} finally {
|
|
527
|
-
reentry = false;
|
|
528
|
-
|
|
529
|
-
{
|
|
530
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
531
|
-
reenableLogs();
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
535
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
539
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
540
|
-
|
|
541
|
-
{
|
|
542
|
-
if (typeof fn === 'function') {
|
|
543
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
return syntheticFrame;
|
|
548
|
-
}
|
|
549
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
550
|
-
{
|
|
551
|
-
return describeNativeComponentFrame(fn, false);
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
function shouldConstruct(Component) {
|
|
556
|
-
var prototype = Component.prototype;
|
|
557
|
-
return !!(prototype && prototype.isReactComponent);
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
561
|
-
|
|
562
|
-
if (type == null) {
|
|
563
|
-
return '';
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
if (typeof type === 'function') {
|
|
567
|
-
{
|
|
568
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
if (typeof type === 'string') {
|
|
573
|
-
return describeBuiltInComponentFrame(type);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
switch (type) {
|
|
577
|
-
case REACT_SUSPENSE_TYPE:
|
|
578
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
579
|
-
|
|
580
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
581
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
if (typeof type === 'object') {
|
|
585
|
-
switch (type.$$typeof) {
|
|
586
|
-
case REACT_FORWARD_REF_TYPE:
|
|
587
|
-
return describeFunctionComponentFrame(type.render);
|
|
588
|
-
|
|
589
|
-
case REACT_MEMO_TYPE:
|
|
590
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
591
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
592
|
-
|
|
593
|
-
case REACT_LAZY_TYPE:
|
|
594
|
-
{
|
|
595
|
-
var lazyComponent = type;
|
|
596
|
-
var payload = lazyComponent._payload;
|
|
597
|
-
var init = lazyComponent._init;
|
|
598
|
-
|
|
599
|
-
try {
|
|
600
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
601
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
602
|
-
} catch (x) {}
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
return '';
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
611
|
-
|
|
612
|
-
var loggedTypeFailures = {};
|
|
613
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
614
|
-
|
|
615
|
-
function setCurrentlyValidatingElement(element) {
|
|
616
|
-
{
|
|
617
|
-
if (element) {
|
|
618
|
-
var owner = element._owner;
|
|
619
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
620
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
621
|
-
} else {
|
|
622
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
628
|
-
{
|
|
629
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
630
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
631
|
-
|
|
632
|
-
for (var typeSpecName in typeSpecs) {
|
|
633
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
634
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
635
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
636
|
-
// After these have been cleaned up, we'll let them throw.
|
|
637
|
-
|
|
638
|
-
try {
|
|
639
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
640
|
-
// behavior as without this statement except with a better message.
|
|
641
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
642
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
643
|
-
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`.');
|
|
644
|
-
err.name = 'Invariant Violation';
|
|
645
|
-
throw err;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
649
|
-
} catch (ex) {
|
|
650
|
-
error$1 = ex;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
654
|
-
setCurrentlyValidatingElement(element);
|
|
655
|
-
|
|
656
|
-
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);
|
|
657
|
-
|
|
658
|
-
setCurrentlyValidatingElement(null);
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
662
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
663
|
-
// same error.
|
|
664
|
-
loggedTypeFailures[error$1.message] = true;
|
|
665
|
-
setCurrentlyValidatingElement(element);
|
|
666
|
-
|
|
667
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
668
|
-
|
|
669
|
-
setCurrentlyValidatingElement(null);
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
677
|
-
|
|
678
|
-
function isArray(a) {
|
|
679
|
-
return isArrayImpl(a);
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
/*
|
|
683
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
684
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
685
|
-
*
|
|
686
|
-
* The functions in this module will throw an easier-to-understand,
|
|
687
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
688
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
689
|
-
* of the `value` object).
|
|
690
|
-
*/
|
|
691
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
692
|
-
function typeName(value) {
|
|
693
|
-
{
|
|
694
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
695
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
696
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
697
|
-
return type;
|
|
698
|
-
}
|
|
699
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
function willCoercionThrow(value) {
|
|
703
|
-
{
|
|
704
|
-
try {
|
|
705
|
-
testStringCoercion(value);
|
|
706
|
-
return false;
|
|
707
|
-
} catch (e) {
|
|
708
|
-
return true;
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
function testStringCoercion(value) {
|
|
714
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
715
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
716
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
717
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
718
|
-
//
|
|
719
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
720
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
721
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
722
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
723
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
724
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
725
|
-
//
|
|
726
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
727
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
728
|
-
//
|
|
729
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
730
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
731
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
732
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
733
|
-
// In most cases, this console output also shows the component and its
|
|
734
|
-
// ancestor components where the exception happened.
|
|
735
|
-
//
|
|
736
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
737
|
-
return '' + value;
|
|
738
|
-
}
|
|
739
|
-
function checkKeyStringCoercion(value) {
|
|
740
|
-
{
|
|
741
|
-
if (willCoercionThrow(value)) {
|
|
742
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
743
|
-
|
|
744
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
750
|
-
var RESERVED_PROPS = {
|
|
751
|
-
key: true,
|
|
752
|
-
ref: true,
|
|
753
|
-
__self: true,
|
|
754
|
-
__source: true
|
|
755
|
-
};
|
|
756
|
-
var specialPropKeyWarningShown;
|
|
757
|
-
var specialPropRefWarningShown;
|
|
758
|
-
var didWarnAboutStringRefs;
|
|
759
|
-
|
|
760
|
-
{
|
|
761
|
-
didWarnAboutStringRefs = {};
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
function hasValidRef(config) {
|
|
765
|
-
{
|
|
766
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
767
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
768
|
-
|
|
769
|
-
if (getter && getter.isReactWarning) {
|
|
770
|
-
return false;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
return config.ref !== undefined;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
function hasValidKey(config) {
|
|
779
|
-
{
|
|
780
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
781
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
782
|
-
|
|
783
|
-
if (getter && getter.isReactWarning) {
|
|
784
|
-
return false;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
return config.key !== undefined;
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
793
|
-
{
|
|
794
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
795
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
796
|
-
|
|
797
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
798
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
799
|
-
|
|
800
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
807
|
-
{
|
|
808
|
-
var warnAboutAccessingKey = function () {
|
|
809
|
-
if (!specialPropKeyWarningShown) {
|
|
810
|
-
specialPropKeyWarningShown = true;
|
|
811
|
-
|
|
812
|
-
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);
|
|
813
|
-
}
|
|
814
|
-
};
|
|
815
|
-
|
|
816
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
817
|
-
Object.defineProperty(props, 'key', {
|
|
818
|
-
get: warnAboutAccessingKey,
|
|
819
|
-
configurable: true
|
|
820
|
-
});
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
825
|
-
{
|
|
826
|
-
var warnAboutAccessingRef = function () {
|
|
827
|
-
if (!specialPropRefWarningShown) {
|
|
828
|
-
specialPropRefWarningShown = true;
|
|
829
|
-
|
|
830
|
-
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);
|
|
831
|
-
}
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
835
|
-
Object.defineProperty(props, 'ref', {
|
|
836
|
-
get: warnAboutAccessingRef,
|
|
837
|
-
configurable: true
|
|
838
|
-
});
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
/**
|
|
842
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
843
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
844
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
845
|
-
* if something is a React Element.
|
|
846
|
-
*
|
|
847
|
-
* @param {*} type
|
|
848
|
-
* @param {*} props
|
|
849
|
-
* @param {*} key
|
|
850
|
-
* @param {string|object} ref
|
|
851
|
-
* @param {*} owner
|
|
852
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
853
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
854
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
855
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
856
|
-
* change in behavior.
|
|
857
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
858
|
-
* indicating filename, line number, and/or other information.
|
|
859
|
-
* @internal
|
|
860
|
-
*/
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
864
|
-
var element = {
|
|
865
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
866
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
867
|
-
// Built-in properties that belong on the element
|
|
868
|
-
type: type,
|
|
869
|
-
key: key,
|
|
870
|
-
ref: ref,
|
|
871
|
-
props: props,
|
|
872
|
-
// Record the component responsible for creating this element.
|
|
873
|
-
_owner: owner
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
{
|
|
877
|
-
// The validation flag is currently mutative. We put it on
|
|
878
|
-
// an external backing store so that we can freeze the whole object.
|
|
879
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
880
|
-
// commonly used development environments.
|
|
881
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
882
|
-
// the validation flag non-enumerable (where possible, which should
|
|
883
|
-
// include every environment we run tests in), so the test framework
|
|
884
|
-
// ignores it.
|
|
885
|
-
|
|
886
|
-
Object.defineProperty(element._store, 'validated', {
|
|
887
|
-
configurable: false,
|
|
888
|
-
enumerable: false,
|
|
889
|
-
writable: true,
|
|
890
|
-
value: false
|
|
891
|
-
}); // self and source are DEV only properties.
|
|
892
|
-
|
|
893
|
-
Object.defineProperty(element, '_self', {
|
|
894
|
-
configurable: false,
|
|
895
|
-
enumerable: false,
|
|
896
|
-
writable: false,
|
|
897
|
-
value: self
|
|
898
|
-
}); // Two elements created in two different places should be considered
|
|
899
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
900
|
-
|
|
901
|
-
Object.defineProperty(element, '_source', {
|
|
902
|
-
configurable: false,
|
|
903
|
-
enumerable: false,
|
|
904
|
-
writable: false,
|
|
905
|
-
value: source
|
|
906
|
-
});
|
|
907
|
-
|
|
908
|
-
if (Object.freeze) {
|
|
909
|
-
Object.freeze(element.props);
|
|
910
|
-
Object.freeze(element);
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
return element;
|
|
915
|
-
};
|
|
916
|
-
/**
|
|
917
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
918
|
-
* @param {*} type
|
|
919
|
-
* @param {object} props
|
|
920
|
-
* @param {string} key
|
|
921
|
-
*/
|
|
922
|
-
|
|
923
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
924
|
-
{
|
|
925
|
-
var propName; // Reserved names are extracted
|
|
926
|
-
|
|
927
|
-
var props = {};
|
|
928
|
-
var key = null;
|
|
929
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
930
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
931
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
932
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
933
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
934
|
-
// key is explicitly declared to be undefined or not.
|
|
935
|
-
|
|
936
|
-
if (maybeKey !== undefined) {
|
|
937
|
-
{
|
|
938
|
-
checkKeyStringCoercion(maybeKey);
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
key = '' + maybeKey;
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
if (hasValidKey(config)) {
|
|
945
|
-
{
|
|
946
|
-
checkKeyStringCoercion(config.key);
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
key = '' + config.key;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
if (hasValidRef(config)) {
|
|
953
|
-
ref = config.ref;
|
|
954
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
955
|
-
} // Remaining properties are added to a new props object
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
for (propName in config) {
|
|
959
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
960
|
-
props[propName] = config[propName];
|
|
961
|
-
}
|
|
962
|
-
} // Resolve default props
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
if (type && type.defaultProps) {
|
|
966
|
-
var defaultProps = type.defaultProps;
|
|
967
|
-
|
|
968
|
-
for (propName in defaultProps) {
|
|
969
|
-
if (props[propName] === undefined) {
|
|
970
|
-
props[propName] = defaultProps[propName];
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
if (key || ref) {
|
|
976
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
977
|
-
|
|
978
|
-
if (key) {
|
|
979
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
if (ref) {
|
|
983
|
-
defineRefPropWarningGetter(props, displayName);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
992
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
993
|
-
|
|
994
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
995
|
-
{
|
|
996
|
-
if (element) {
|
|
997
|
-
var owner = element._owner;
|
|
998
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
999
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1000
|
-
} else {
|
|
1001
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
var propTypesMisspellWarningShown;
|
|
1007
|
-
|
|
1008
|
-
{
|
|
1009
|
-
propTypesMisspellWarningShown = false;
|
|
1010
|
-
}
|
|
1011
|
-
/**
|
|
1012
|
-
* Verifies the object is a ReactElement.
|
|
1013
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1014
|
-
* @param {?object} object
|
|
1015
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
1016
|
-
* @final
|
|
1017
|
-
*/
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
function isValidElement(object) {
|
|
1021
|
-
{
|
|
1022
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
function getDeclarationErrorAddendum() {
|
|
1027
|
-
{
|
|
1028
|
-
if (ReactCurrentOwner$1.current) {
|
|
1029
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1030
|
-
|
|
1031
|
-
if (name) {
|
|
1032
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
return '';
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1041
|
-
{
|
|
1042
|
-
if (source !== undefined) {
|
|
1043
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1044
|
-
var lineNumber = source.lineNumber;
|
|
1045
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
return '';
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
/**
|
|
1052
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1053
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
1054
|
-
* updates.
|
|
1055
|
-
*/
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
var ownerHasKeyUseWarning = {};
|
|
1059
|
-
|
|
1060
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1061
|
-
{
|
|
1062
|
-
var info = getDeclarationErrorAddendum();
|
|
1063
|
-
|
|
1064
|
-
if (!info) {
|
|
1065
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1066
|
-
|
|
1067
|
-
if (parentName) {
|
|
1068
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
return info;
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
/**
|
|
1076
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1077
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1078
|
-
* reordered. All children that haven't already been validated are required to
|
|
1079
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1080
|
-
* will only be shown once.
|
|
1081
|
-
*
|
|
1082
|
-
* @internal
|
|
1083
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1084
|
-
* @param {*} parentType element's parent's type.
|
|
1085
|
-
*/
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
function validateExplicitKey(element, parentType) {
|
|
1089
|
-
{
|
|
1090
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1091
|
-
return;
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
element._store.validated = true;
|
|
1095
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1096
|
-
|
|
1097
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1098
|
-
return;
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1102
|
-
// property, it may be the creator of the child that's responsible for
|
|
1103
|
-
// assigning it a key.
|
|
1104
|
-
|
|
1105
|
-
var childOwner = '';
|
|
1106
|
-
|
|
1107
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1108
|
-
// Give the component that originally created this child.
|
|
1109
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
setCurrentlyValidatingElement$1(element);
|
|
1113
|
-
|
|
1114
|
-
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);
|
|
1115
|
-
|
|
1116
|
-
setCurrentlyValidatingElement$1(null);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
/**
|
|
1120
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1121
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1122
|
-
* with valid key property.
|
|
1123
|
-
*
|
|
1124
|
-
* @internal
|
|
1125
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1126
|
-
* @param {*} parentType node's parent's type.
|
|
1127
|
-
*/
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
function validateChildKeys(node, parentType) {
|
|
1131
|
-
{
|
|
1132
|
-
if (typeof node !== 'object') {
|
|
1133
|
-
return;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
if (isArray(node)) {
|
|
1137
|
-
for (var i = 0; i < node.length; i++) {
|
|
1138
|
-
var child = node[i];
|
|
1139
|
-
|
|
1140
|
-
if (isValidElement(child)) {
|
|
1141
|
-
validateExplicitKey(child, parentType);
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
} else if (isValidElement(node)) {
|
|
1145
|
-
// This element was passed in a valid location.
|
|
1146
|
-
if (node._store) {
|
|
1147
|
-
node._store.validated = true;
|
|
1148
|
-
}
|
|
1149
|
-
} else if (node) {
|
|
1150
|
-
var iteratorFn = getIteratorFn(node);
|
|
1151
|
-
|
|
1152
|
-
if (typeof iteratorFn === 'function') {
|
|
1153
|
-
// Entry iterators used to provide implicit keys,
|
|
1154
|
-
// but now we print a separate warning for them later.
|
|
1155
|
-
if (iteratorFn !== node.entries) {
|
|
1156
|
-
var iterator = iteratorFn.call(node);
|
|
1157
|
-
var step;
|
|
1158
|
-
|
|
1159
|
-
while (!(step = iterator.next()).done) {
|
|
1160
|
-
if (isValidElement(step.value)) {
|
|
1161
|
-
validateExplicitKey(step.value, parentType);
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
/**
|
|
1170
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
1171
|
-
* provided by the type.
|
|
1172
|
-
*
|
|
1173
|
-
* @param {ReactElement} element
|
|
1174
|
-
*/
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
function validatePropTypes(element) {
|
|
1178
|
-
{
|
|
1179
|
-
var type = element.type;
|
|
1180
|
-
|
|
1181
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
1182
|
-
return;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
var propTypes;
|
|
1186
|
-
|
|
1187
|
-
if (typeof type === 'function') {
|
|
1188
|
-
propTypes = type.propTypes;
|
|
1189
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1190
|
-
// Inner props are checked in the reconciler.
|
|
1191
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1192
|
-
propTypes = type.propTypes;
|
|
1193
|
-
} else {
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
if (propTypes) {
|
|
1198
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
1199
|
-
var name = getComponentNameFromType(type);
|
|
1200
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1201
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1202
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1203
|
-
|
|
1204
|
-
var _name = getComponentNameFromType(type);
|
|
1205
|
-
|
|
1206
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1210
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
/**
|
|
1215
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
1216
|
-
* @param {ReactElement} fragment
|
|
1217
|
-
*/
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
function validateFragmentProps(fragment) {
|
|
1221
|
-
{
|
|
1222
|
-
var keys = Object.keys(fragment.props);
|
|
1223
|
-
|
|
1224
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1225
|
-
var key = keys[i];
|
|
1226
|
-
|
|
1227
|
-
if (key !== 'children' && key !== 'key') {
|
|
1228
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1229
|
-
|
|
1230
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1231
|
-
|
|
1232
|
-
setCurrentlyValidatingElement$1(null);
|
|
1233
|
-
break;
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
if (fragment.ref !== null) {
|
|
1238
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1239
|
-
|
|
1240
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1241
|
-
|
|
1242
|
-
setCurrentlyValidatingElement$1(null);
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
var didWarnAboutKeySpread = {};
|
|
1248
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1249
|
-
{
|
|
1250
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1251
|
-
// succeed and there will likely be errors in render.
|
|
1252
|
-
|
|
1253
|
-
if (!validType) {
|
|
1254
|
-
var info = '';
|
|
1255
|
-
|
|
1256
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1257
|
-
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.";
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1261
|
-
|
|
1262
|
-
if (sourceInfo) {
|
|
1263
|
-
info += sourceInfo;
|
|
1264
|
-
} else {
|
|
1265
|
-
info += getDeclarationErrorAddendum();
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
var typeString;
|
|
1269
|
-
|
|
1270
|
-
if (type === null) {
|
|
1271
|
-
typeString = 'null';
|
|
1272
|
-
} else if (isArray(type)) {
|
|
1273
|
-
typeString = 'array';
|
|
1274
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1275
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1276
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1277
|
-
} else {
|
|
1278
|
-
typeString = typeof type;
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
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);
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1285
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1286
|
-
|
|
1287
|
-
if (element == null) {
|
|
1288
|
-
return element;
|
|
1289
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1290
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1291
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
1292
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1293
|
-
// fixed, the key warnings will appear.)
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
if (validType) {
|
|
1297
|
-
var children = props.children;
|
|
1298
|
-
|
|
1299
|
-
if (children !== undefined) {
|
|
1300
|
-
if (isStaticChildren) {
|
|
1301
|
-
if (isArray(children)) {
|
|
1302
|
-
for (var i = 0; i < children.length; i++) {
|
|
1303
|
-
validateChildKeys(children[i], type);
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
if (Object.freeze) {
|
|
1307
|
-
Object.freeze(children);
|
|
1308
|
-
}
|
|
1309
|
-
} else {
|
|
1310
|
-
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.');
|
|
1311
|
-
}
|
|
1312
|
-
} else {
|
|
1313
|
-
validateChildKeys(children, type);
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
{
|
|
1319
|
-
if (hasOwnProperty.call(props, 'key')) {
|
|
1320
|
-
var componentName = getComponentNameFromType(type);
|
|
1321
|
-
var keys = Object.keys(props).filter(function (k) {
|
|
1322
|
-
return k !== 'key';
|
|
1323
|
-
});
|
|
1324
|
-
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
1325
|
-
|
|
1326
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
1327
|
-
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
1328
|
-
|
|
1329
|
-
error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
1330
|
-
|
|
1331
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1337
|
-
validateFragmentProps(element);
|
|
1338
|
-
} else {
|
|
1339
|
-
validatePropTypes(element);
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
return element;
|
|
1343
|
-
}
|
|
1344
|
-
} // These two functions exist to still get child warnings in dev
|
|
1345
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
1346
|
-
// opt-in behavior for better messages but that we won't stop
|
|
1347
|
-
// giving you warnings if you use production apis.
|
|
1348
|
-
|
|
1349
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
1350
|
-
{
|
|
1351
|
-
return jsxWithValidation(type, props, key, true);
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
1355
|
-
{
|
|
1356
|
-
return jsxWithValidation(type, props, key, false);
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1361
|
-
// for now we can ship identical prod functions
|
|
1362
|
-
|
|
1363
|
-
var jsxs = jsxWithValidationStatic ;
|
|
1364
|
-
|
|
1365
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1366
|
-
reactJsxRuntime_development.jsx = jsx;
|
|
1367
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
1368
|
-
})();
|
|
1369
|
-
}
|
|
1370
|
-
return reactJsxRuntime_development;
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1374
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
1375
|
-
} else {
|
|
1376
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
1380
|
-
|
|
1381
9
|
function Table({ className, ...props }) {
|
|
1382
|
-
return (
|
|
10
|
+
return (jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: jsx("table", { "data-slot": "table", className: className, ...props }) }));
|
|
1383
11
|
}
|
|
1384
12
|
function TableHeader({ className, ...props }) {
|
|
1385
|
-
return
|
|
13
|
+
return jsx("thead", { "data-slot": "table-header", className: className, ...props });
|
|
1386
14
|
}
|
|
1387
15
|
function TableBody({ className, ...props }) {
|
|
1388
|
-
return
|
|
16
|
+
return jsx("tbody", { "data-slot": "table-body", className: className, ...props });
|
|
1389
17
|
}
|
|
1390
18
|
function TableRow({ className, ...props }) {
|
|
1391
|
-
return
|
|
19
|
+
return jsx("tr", { "data-slot": "table-row", className: className, ...props });
|
|
1392
20
|
}
|
|
1393
21
|
function TableHead({ className, ...props }) {
|
|
1394
|
-
return
|
|
22
|
+
return jsx("th", { "data-slot": "table-head", className: className, ...props });
|
|
1395
23
|
}
|
|
1396
24
|
function TableCell({ className, ...props }) {
|
|
1397
|
-
return
|
|
25
|
+
return jsx("td", { "data-slot": "table-cell", className: className, ...props });
|
|
1398
26
|
}
|
|
1399
27
|
|
|
1400
28
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
@@ -1498,9 +126,9 @@ function createSlot(ownerName) {
|
|
|
1498
126
|
return child;
|
|
1499
127
|
}
|
|
1500
128
|
});
|
|
1501
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
1502
130
|
}
|
|
1503
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
1504
132
|
});
|
|
1505
133
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
1506
134
|
return Slot2;
|
|
@@ -1527,7 +155,7 @@ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
|
1527
155
|
// @__NO_SIDE_EFFECTS__
|
|
1528
156
|
function createSlottable(ownerName) {
|
|
1529
157
|
const Slottable2 = ({ children }) => {
|
|
1530
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
1531
159
|
};
|
|
1532
160
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
1533
161
|
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
@@ -1602,7 +230,7 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
1602
230
|
if (typeof window !== "undefined") {
|
|
1603
231
|
window[Symbol.for("radix-ui")] = true;
|
|
1604
232
|
}
|
|
1605
|
-
return /* @__PURE__ */
|
|
233
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
1606
234
|
});
|
|
1607
235
|
Node.displayName = `Primitive.${node}`;
|
|
1608
236
|
return { ...primitive, [node]: Node };
|
|
@@ -1628,7 +256,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
1628
256
|
var NAME$1 = "VisuallyHidden";
|
|
1629
257
|
var VisuallyHidden = React.forwardRef(
|
|
1630
258
|
(props, forwardedRef) => {
|
|
1631
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ jsx(
|
|
1632
260
|
Primitive.span,
|
|
1633
261
|
{
|
|
1634
262
|
...props,
|
|
@@ -1652,7 +280,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
1652
280
|
const { scope, children, ...context } = props;
|
|
1653
281
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1654
282
|
const value = React.useMemo(() => context, Object.values(context));
|
|
1655
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
1656
284
|
};
|
|
1657
285
|
Provider.displayName = rootComponentName + "Provider";
|
|
1658
286
|
function useContext2(consumerName, scope) {
|
|
@@ -1711,7 +339,7 @@ function createCollection(name) {
|
|
|
1711
339
|
const { scope, children } = props;
|
|
1712
340
|
const ref = React__default.useRef(null);
|
|
1713
341
|
const itemMap = React__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
1714
|
-
return /* @__PURE__ */
|
|
342
|
+
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
1715
343
|
};
|
|
1716
344
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
1717
345
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
@@ -1721,7 +349,7 @@ function createCollection(name) {
|
|
|
1721
349
|
const { scope, children } = props;
|
|
1722
350
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
1723
351
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
1724
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
1725
353
|
}
|
|
1726
354
|
);
|
|
1727
355
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
@@ -1738,7 +366,7 @@ function createCollection(name) {
|
|
|
1738
366
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
1739
367
|
return () => void context.itemMap.delete(ref);
|
|
1740
368
|
});
|
|
1741
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
1742
370
|
}
|
|
1743
371
|
);
|
|
1744
372
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -2096,7 +724,7 @@ var DismissableLayer = React.forwardRef(
|
|
|
2096
724
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2097
725
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2098
726
|
}, []);
|
|
2099
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ jsx(
|
|
2100
728
|
Primitive.div,
|
|
2101
729
|
{
|
|
2102
730
|
...layerProps,
|
|
@@ -2130,7 +758,7 @@ var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
|
2130
758
|
};
|
|
2131
759
|
}
|
|
2132
760
|
}, [context.branches]);
|
|
2133
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
2134
762
|
});
|
|
2135
763
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
2136
764
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
@@ -2328,7 +956,7 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
|
2328
956
|
},
|
|
2329
957
|
[loop, trapped, focusScope.paused]
|
|
2330
958
|
);
|
|
2331
|
-
return /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
2332
960
|
});
|
|
2333
961
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
2334
962
|
function focusFirst$2(candidates, { select = false } = {}) {
|
|
@@ -2417,7 +1045,7 @@ var Portal$3 = React.forwardRef((props, forwardedRef) => {
|
|
|
2417
1045
|
const [mounted, setMounted] = React.useState(false);
|
|
2418
1046
|
useLayoutEffect2(() => setMounted(true), []);
|
|
2419
1047
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
2420
|
-
return container ? ReactDOM__default.createPortal(/* @__PURE__ */
|
|
1048
|
+
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
2421
1049
|
});
|
|
2422
1050
|
Portal$3.displayName = PORTAL_NAME$4;
|
|
2423
1051
|
|
|
@@ -3441,7 +2069,7 @@ function CheckboxProvider(props) {
|
|
|
3441
2069
|
bubbleInput,
|
|
3442
2070
|
setBubbleInput
|
|
3443
2071
|
};
|
|
3444
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsx(
|
|
3445
2073
|
CheckboxProviderImpl,
|
|
3446
2074
|
{
|
|
3447
2075
|
scope: __scopeCheckbox,
|
|
@@ -3475,7 +2103,7 @@ var CheckboxTrigger = React.forwardRef(
|
|
|
3475
2103
|
return () => form.removeEventListener("reset", reset);
|
|
3476
2104
|
}
|
|
3477
2105
|
}, [control, setChecked]);
|
|
3478
|
-
return /* @__PURE__ */
|
|
2106
|
+
return /* @__PURE__ */ jsx(
|
|
3479
2107
|
Primitive.button,
|
|
3480
2108
|
{
|
|
3481
2109
|
type: "button",
|
|
@@ -3517,7 +2145,7 @@ var Checkbox$1 = React.forwardRef(
|
|
|
3517
2145
|
form,
|
|
3518
2146
|
...checkboxProps
|
|
3519
2147
|
} = props;
|
|
3520
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ jsx(
|
|
3521
2149
|
CheckboxProvider,
|
|
3522
2150
|
{
|
|
3523
2151
|
__scopeCheckbox,
|
|
@@ -3529,8 +2157,8 @@ var Checkbox$1 = React.forwardRef(
|
|
|
3529
2157
|
name,
|
|
3530
2158
|
form,
|
|
3531
2159
|
value,
|
|
3532
|
-
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */
|
|
3533
|
-
/* @__PURE__ */
|
|
2160
|
+
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2161
|
+
/* @__PURE__ */ jsx(
|
|
3534
2162
|
CheckboxTrigger,
|
|
3535
2163
|
{
|
|
3536
2164
|
...checkboxProps,
|
|
@@ -3538,7 +2166,7 @@ var Checkbox$1 = React.forwardRef(
|
|
|
3538
2166
|
__scopeCheckbox
|
|
3539
2167
|
}
|
|
3540
2168
|
),
|
|
3541
|
-
isFormControl && /* @__PURE__ */
|
|
2169
|
+
isFormControl && /* @__PURE__ */ jsx(
|
|
3542
2170
|
CheckboxBubbleInput,
|
|
3543
2171
|
{
|
|
3544
2172
|
__scopeCheckbox
|
|
@@ -3555,11 +2183,11 @@ var CheckboxIndicator = React.forwardRef(
|
|
|
3555
2183
|
(props, forwardedRef) => {
|
|
3556
2184
|
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
3557
2185
|
const context = useCheckboxContext(INDICATOR_NAME$2, __scopeCheckbox);
|
|
3558
|
-
return /* @__PURE__ */
|
|
2186
|
+
return /* @__PURE__ */ jsx(
|
|
3559
2187
|
Presence,
|
|
3560
2188
|
{
|
|
3561
2189
|
present: forceMount || isIndeterminate$1(context.checked) || context.checked === true,
|
|
3562
|
-
children: /* @__PURE__ */
|
|
2190
|
+
children: /* @__PURE__ */ jsx(
|
|
3563
2191
|
Primitive.span,
|
|
3564
2192
|
{
|
|
3565
2193
|
"data-state": getState(context.checked),
|
|
@@ -3611,7 +2239,7 @@ var CheckboxBubbleInput = React.forwardRef(
|
|
|
3611
2239
|
}
|
|
3612
2240
|
}, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
|
|
3613
2241
|
const defaultCheckedRef = React.useRef(isIndeterminate$1(checked) ? false : checked);
|
|
3614
|
-
return /* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ jsx(
|
|
3615
2243
|
Primitive.input,
|
|
3616
2244
|
{
|
|
3617
2245
|
type: "checkbox",
|
|
@@ -5852,7 +4480,7 @@ const arrow = (options, deps) => ({
|
|
|
5852
4480
|
var NAME = "Arrow";
|
|
5853
4481
|
var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
5854
4482
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
5855
|
-
return /* @__PURE__ */
|
|
4483
|
+
return /* @__PURE__ */ jsx(
|
|
5856
4484
|
Primitive.svg,
|
|
5857
4485
|
{
|
|
5858
4486
|
...arrowProps,
|
|
@@ -5861,7 +4489,7 @@ var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
5861
4489
|
height,
|
|
5862
4490
|
viewBox: "0 0 30 10",
|
|
5863
4491
|
preserveAspectRatio: "none",
|
|
5864
|
-
children: props.asChild ? children : /* @__PURE__ */
|
|
4492
|
+
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
5865
4493
|
}
|
|
5866
4494
|
);
|
|
5867
4495
|
});
|
|
@@ -5874,7 +4502,7 @@ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
|
5874
4502
|
var Popper = (props) => {
|
|
5875
4503
|
const { __scopePopper, children } = props;
|
|
5876
4504
|
const [anchor, setAnchor] = React.useState(null);
|
|
5877
|
-
return /* @__PURE__ */
|
|
4505
|
+
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
5878
4506
|
};
|
|
5879
4507
|
Popper.displayName = POPPER_NAME;
|
|
5880
4508
|
var ANCHOR_NAME$1 = "PopperAnchor";
|
|
@@ -5892,7 +4520,7 @@ var PopperAnchor = React.forwardRef(
|
|
|
5892
4520
|
context.onAnchorChange(anchorRef.current);
|
|
5893
4521
|
}
|
|
5894
4522
|
});
|
|
5895
|
-
return virtualRef ? null : /* @__PURE__ */
|
|
4523
|
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
5896
4524
|
}
|
|
5897
4525
|
);
|
|
5898
4526
|
PopperAnchor.displayName = ANCHOR_NAME$1;
|
|
@@ -5985,7 +4613,7 @@ var PopperContent = React.forwardRef(
|
|
|
5985
4613
|
useLayoutEffect2(() => {
|
|
5986
4614
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
5987
4615
|
}, [content]);
|
|
5988
|
-
return /* @__PURE__ */
|
|
4616
|
+
return /* @__PURE__ */ jsx(
|
|
5989
4617
|
"div",
|
|
5990
4618
|
{
|
|
5991
4619
|
ref: refs.setFloating,
|
|
@@ -6009,7 +4637,7 @@ var PopperContent = React.forwardRef(
|
|
|
6009
4637
|
}
|
|
6010
4638
|
},
|
|
6011
4639
|
dir: props.dir,
|
|
6012
|
-
children: /* @__PURE__ */
|
|
4640
|
+
children: /* @__PURE__ */ jsx(
|
|
6013
4641
|
PopperContentProvider,
|
|
6014
4642
|
{
|
|
6015
4643
|
scope: __scopePopper,
|
|
@@ -6018,7 +4646,7 @@ var PopperContent = React.forwardRef(
|
|
|
6018
4646
|
arrowX,
|
|
6019
4647
|
arrowY,
|
|
6020
4648
|
shouldHideArrow: cannotCenterArrow,
|
|
6021
|
-
children: /* @__PURE__ */
|
|
4649
|
+
children: /* @__PURE__ */ jsx(
|
|
6022
4650
|
Primitive.div,
|
|
6023
4651
|
{
|
|
6024
4652
|
"data-side": placedSide,
|
|
@@ -6055,7 +4683,7 @@ var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
|
6055
4683
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
6056
4684
|
// doesn't report size as we'd expect on SVG elements.
|
|
6057
4685
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
6058
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ jsx(
|
|
6059
4687
|
"span",
|
|
6060
4688
|
{
|
|
6061
4689
|
ref: contentContext.onArrowChange,
|
|
@@ -6078,7 +4706,7 @@ var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
|
6078
4706
|
}[contentContext.placedSide],
|
|
6079
4707
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
6080
4708
|
},
|
|
6081
|
-
children: /* @__PURE__ */
|
|
4709
|
+
children: /* @__PURE__ */ jsx(
|
|
6082
4710
|
Root$2,
|
|
6083
4711
|
{
|
|
6084
4712
|
...arrowProps,
|
|
@@ -6149,7 +4777,7 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
6149
4777
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$3);
|
|
6150
4778
|
var RovingFocusGroup = React.forwardRef(
|
|
6151
4779
|
(props, forwardedRef) => {
|
|
6152
|
-
return /* @__PURE__ */
|
|
4780
|
+
return /* @__PURE__ */ jsx(Collection$2.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection$2.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
6153
4781
|
}
|
|
6154
4782
|
);
|
|
6155
4783
|
RovingFocusGroup.displayName = GROUP_NAME$3;
|
|
@@ -6187,7 +4815,7 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
6187
4815
|
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
6188
4816
|
}
|
|
6189
4817
|
}, [handleEntryFocus]);
|
|
6190
|
-
return /* @__PURE__ */
|
|
4818
|
+
return /* @__PURE__ */ jsx(
|
|
6191
4819
|
RovingFocusProvider,
|
|
6192
4820
|
{
|
|
6193
4821
|
scope: __scopeRovingFocusGroup,
|
|
@@ -6208,7 +4836,7 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
6208
4836
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
6209
4837
|
[]
|
|
6210
4838
|
),
|
|
6211
|
-
children: /* @__PURE__ */
|
|
4839
|
+
children: /* @__PURE__ */ jsx(
|
|
6212
4840
|
Primitive.div,
|
|
6213
4841
|
{
|
|
6214
4842
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
@@ -6266,14 +4894,14 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
6266
4894
|
return () => onFocusableItemRemove();
|
|
6267
4895
|
}
|
|
6268
4896
|
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
6269
|
-
return /* @__PURE__ */
|
|
4897
|
+
return /* @__PURE__ */ jsx(
|
|
6270
4898
|
Collection$2.ItemSlot,
|
|
6271
4899
|
{
|
|
6272
4900
|
scope: __scopeRovingFocusGroup,
|
|
6273
4901
|
id,
|
|
6274
4902
|
focusable,
|
|
6275
4903
|
active,
|
|
6276
|
-
children: /* @__PURE__ */
|
|
4904
|
+
children: /* @__PURE__ */ jsx(
|
|
6277
4905
|
Primitive.span,
|
|
6278
4906
|
{
|
|
6279
4907
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
@@ -6392,7 +5020,7 @@ var Menu = (props) => {
|
|
|
6392
5020
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
6393
5021
|
};
|
|
6394
5022
|
}, []);
|
|
6395
|
-
return /* @__PURE__ */
|
|
5023
|
+
return /* @__PURE__ */ jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
6396
5024
|
MenuProvider,
|
|
6397
5025
|
{
|
|
6398
5026
|
scope: __scopeMenu,
|
|
@@ -6400,7 +5028,7 @@ var Menu = (props) => {
|
|
|
6400
5028
|
onOpenChange: handleOpenChange,
|
|
6401
5029
|
content,
|
|
6402
5030
|
onContentChange: setContent,
|
|
6403
|
-
children: /* @__PURE__ */
|
|
5031
|
+
children: /* @__PURE__ */ jsx(
|
|
6404
5032
|
MenuRootProvider,
|
|
6405
5033
|
{
|
|
6406
5034
|
scope: __scopeMenu,
|
|
@@ -6420,7 +5048,7 @@ var MenuAnchor = React.forwardRef(
|
|
|
6420
5048
|
(props, forwardedRef) => {
|
|
6421
5049
|
const { __scopeMenu, ...anchorProps } = props;
|
|
6422
5050
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
6423
|
-
return /* @__PURE__ */
|
|
5051
|
+
return /* @__PURE__ */ jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
6424
5052
|
}
|
|
6425
5053
|
);
|
|
6426
5054
|
MenuAnchor.displayName = ANCHOR_NAME;
|
|
@@ -6431,7 +5059,7 @@ var [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$3, {
|
|
|
6431
5059
|
var MenuPortal = (props) => {
|
|
6432
5060
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
6433
5061
|
const context = useMenuContext(PORTAL_NAME$3, __scopeMenu);
|
|
6434
|
-
return /* @__PURE__ */
|
|
5062
|
+
return /* @__PURE__ */ jsx(PortalProvider$1, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$3, { asChild: true, container, children }) }) });
|
|
6435
5063
|
};
|
|
6436
5064
|
MenuPortal.displayName = PORTAL_NAME$3;
|
|
6437
5065
|
var CONTENT_NAME$3 = "MenuContent";
|
|
@@ -6442,7 +5070,7 @@ var MenuContent = React.forwardRef(
|
|
|
6442
5070
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
6443
5071
|
const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
6444
5072
|
const rootContext = useMenuRootContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
6445
|
-
return /* @__PURE__ */
|
|
5073
|
+
return /* @__PURE__ */ jsx(Collection$1.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection$1.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
6446
5074
|
}
|
|
6447
5075
|
);
|
|
6448
5076
|
var MenuRootContentModal = React.forwardRef(
|
|
@@ -6454,7 +5082,7 @@ var MenuRootContentModal = React.forwardRef(
|
|
|
6454
5082
|
const content = ref.current;
|
|
6455
5083
|
if (content) return hideOthers(content);
|
|
6456
5084
|
}, []);
|
|
6457
|
-
return /* @__PURE__ */
|
|
5085
|
+
return /* @__PURE__ */ jsx(
|
|
6458
5086
|
MenuContentImpl,
|
|
6459
5087
|
{
|
|
6460
5088
|
...props,
|
|
@@ -6474,7 +5102,7 @@ var MenuRootContentModal = React.forwardRef(
|
|
|
6474
5102
|
);
|
|
6475
5103
|
var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
|
|
6476
5104
|
const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
6477
|
-
return /* @__PURE__ */
|
|
5105
|
+
return /* @__PURE__ */ jsx(
|
|
6478
5106
|
MenuContentImpl,
|
|
6479
5107
|
{
|
|
6480
5108
|
...props,
|
|
@@ -6546,7 +5174,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
6546
5174
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
6547
5175
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
6548
5176
|
}, []);
|
|
6549
|
-
return /* @__PURE__ */
|
|
5177
|
+
return /* @__PURE__ */ jsx(
|
|
6550
5178
|
MenuContentProvider,
|
|
6551
5179
|
{
|
|
6552
5180
|
scope: __scopeMenu,
|
|
@@ -6575,7 +5203,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
6575
5203
|
onPointerGraceIntentChange: React.useCallback((intent) => {
|
|
6576
5204
|
pointerGraceIntentRef.current = intent;
|
|
6577
5205
|
}, []),
|
|
6578
|
-
children: /* @__PURE__ */
|
|
5206
|
+
children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
|
|
6579
5207
|
FocusScope,
|
|
6580
5208
|
{
|
|
6581
5209
|
asChild: true,
|
|
@@ -6585,7 +5213,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
6585
5213
|
contentRef.current?.focus({ preventScroll: true });
|
|
6586
5214
|
}),
|
|
6587
5215
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
6588
|
-
children: /* @__PURE__ */
|
|
5216
|
+
children: /* @__PURE__ */ jsx(
|
|
6589
5217
|
DismissableLayer,
|
|
6590
5218
|
{
|
|
6591
5219
|
asChild: true,
|
|
@@ -6595,7 +5223,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
6595
5223
|
onFocusOutside,
|
|
6596
5224
|
onInteractOutside,
|
|
6597
5225
|
onDismiss,
|
|
6598
|
-
children: /* @__PURE__ */
|
|
5226
|
+
children: /* @__PURE__ */ jsx(
|
|
6599
5227
|
Root$1,
|
|
6600
5228
|
{
|
|
6601
5229
|
asChild: true,
|
|
@@ -6609,7 +5237,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
6609
5237
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
6610
5238
|
}),
|
|
6611
5239
|
preventScrollOnEntryFocus: true,
|
|
6612
|
-
children: /* @__PURE__ */
|
|
5240
|
+
children: /* @__PURE__ */ jsx(
|
|
6613
5241
|
Content,
|
|
6614
5242
|
{
|
|
6615
5243
|
role: "menu",
|
|
@@ -6674,7 +5302,7 @@ var GROUP_NAME$2 = "MenuGroup";
|
|
|
6674
5302
|
var MenuGroup = React.forwardRef(
|
|
6675
5303
|
(props, forwardedRef) => {
|
|
6676
5304
|
const { __scopeMenu, ...groupProps } = props;
|
|
6677
|
-
return /* @__PURE__ */
|
|
5305
|
+
return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
6678
5306
|
}
|
|
6679
5307
|
);
|
|
6680
5308
|
MenuGroup.displayName = GROUP_NAME$2;
|
|
@@ -6682,7 +5310,7 @@ var LABEL_NAME$2 = "MenuLabel";
|
|
|
6682
5310
|
var MenuLabel = React.forwardRef(
|
|
6683
5311
|
(props, forwardedRef) => {
|
|
6684
5312
|
const { __scopeMenu, ...labelProps } = props;
|
|
6685
|
-
return /* @__PURE__ */
|
|
5313
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
6686
5314
|
}
|
|
6687
5315
|
);
|
|
6688
5316
|
MenuLabel.displayName = LABEL_NAME$2;
|
|
@@ -6709,7 +5337,7 @@ var MenuItem = React.forwardRef(
|
|
|
6709
5337
|
}
|
|
6710
5338
|
}
|
|
6711
5339
|
};
|
|
6712
|
-
return /* @__PURE__ */
|
|
5340
|
+
return /* @__PURE__ */ jsx(
|
|
6713
5341
|
MenuItemImpl,
|
|
6714
5342
|
{
|
|
6715
5343
|
...itemProps,
|
|
@@ -6751,13 +5379,13 @@ var MenuItemImpl = React.forwardRef(
|
|
|
6751
5379
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
6752
5380
|
}
|
|
6753
5381
|
}, [itemProps.children]);
|
|
6754
|
-
return /* @__PURE__ */
|
|
5382
|
+
return /* @__PURE__ */ jsx(
|
|
6755
5383
|
Collection$1.ItemSlot,
|
|
6756
5384
|
{
|
|
6757
5385
|
scope: __scopeMenu,
|
|
6758
5386
|
disabled,
|
|
6759
5387
|
textValue: textValue ?? textContent,
|
|
6760
|
-
children: /* @__PURE__ */
|
|
5388
|
+
children: /* @__PURE__ */ jsx(Item$1, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(
|
|
6761
5389
|
Primitive.div,
|
|
6762
5390
|
{
|
|
6763
5391
|
role: "menuitem",
|
|
@@ -6796,7 +5424,7 @@ var CHECKBOX_ITEM_NAME$1 = "MenuCheckboxItem";
|
|
|
6796
5424
|
var MenuCheckboxItem = React.forwardRef(
|
|
6797
5425
|
(props, forwardedRef) => {
|
|
6798
5426
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
6799
|
-
return /* @__PURE__ */
|
|
5427
|
+
return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
|
|
6800
5428
|
MenuItem,
|
|
6801
5429
|
{
|
|
6802
5430
|
role: "menuitemcheckbox",
|
|
@@ -6824,7 +5452,7 @@ var MenuRadioGroup = React.forwardRef(
|
|
|
6824
5452
|
(props, forwardedRef) => {
|
|
6825
5453
|
const { value, onValueChange, ...groupProps } = props;
|
|
6826
5454
|
const handleValueChange = useCallbackRef$1(onValueChange);
|
|
6827
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
6828
5456
|
}
|
|
6829
5457
|
);
|
|
6830
5458
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME$1;
|
|
@@ -6834,7 +5462,7 @@ var MenuRadioItem = React.forwardRef(
|
|
|
6834
5462
|
const { value, ...radioItemProps } = props;
|
|
6835
5463
|
const context = useRadioGroupContext(RADIO_ITEM_NAME$1, props.__scopeMenu);
|
|
6836
5464
|
const checked = value === context.value;
|
|
6837
|
-
return /* @__PURE__ */
|
|
5465
|
+
return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
|
|
6838
5466
|
MenuItem,
|
|
6839
5467
|
{
|
|
6840
5468
|
role: "menuitemradio",
|
|
@@ -6861,11 +5489,11 @@ var MenuItemIndicator = React.forwardRef(
|
|
|
6861
5489
|
(props, forwardedRef) => {
|
|
6862
5490
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
6863
5491
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME$1, __scopeMenu);
|
|
6864
|
-
return /* @__PURE__ */
|
|
5492
|
+
return /* @__PURE__ */ jsx(
|
|
6865
5493
|
Presence,
|
|
6866
5494
|
{
|
|
6867
5495
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
6868
|
-
children: /* @__PURE__ */
|
|
5496
|
+
children: /* @__PURE__ */ jsx(
|
|
6869
5497
|
Primitive.span,
|
|
6870
5498
|
{
|
|
6871
5499
|
...itemIndicatorProps,
|
|
@@ -6882,7 +5510,7 @@ var SEPARATOR_NAME$2 = "MenuSeparator";
|
|
|
6882
5510
|
var MenuSeparator = React.forwardRef(
|
|
6883
5511
|
(props, forwardedRef) => {
|
|
6884
5512
|
const { __scopeMenu, ...separatorProps } = props;
|
|
6885
|
-
return /* @__PURE__ */
|
|
5513
|
+
return /* @__PURE__ */ jsx(
|
|
6886
5514
|
Primitive.div,
|
|
6887
5515
|
{
|
|
6888
5516
|
role: "separator",
|
|
@@ -6899,7 +5527,7 @@ var MenuArrow = React.forwardRef(
|
|
|
6899
5527
|
(props, forwardedRef) => {
|
|
6900
5528
|
const { __scopeMenu, ...arrowProps } = props;
|
|
6901
5529
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
6902
|
-
return /* @__PURE__ */
|
|
5530
|
+
return /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
6903
5531
|
}
|
|
6904
5532
|
);
|
|
6905
5533
|
MenuArrow.displayName = ARROW_NAME$3;
|
|
@@ -6927,7 +5555,7 @@ var MenuSubTrigger = React.forwardRef(
|
|
|
6927
5555
|
onPointerGraceIntentChange(null);
|
|
6928
5556
|
};
|
|
6929
5557
|
}, [pointerGraceTimerRef, onPointerGraceIntentChange]);
|
|
6930
|
-
return /* @__PURE__ */
|
|
5558
|
+
return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(
|
|
6931
5559
|
MenuItemImpl,
|
|
6932
5560
|
{
|
|
6933
5561
|
id: subContext.triggerId,
|
|
@@ -7016,7 +5644,7 @@ var MenuSubContent = React.forwardRef(
|
|
|
7016
5644
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
|
|
7017
5645
|
const ref = React.useRef(null);
|
|
7018
5646
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7019
|
-
return /* @__PURE__ */
|
|
5647
|
+
return /* @__PURE__ */ jsx(Collection$1.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection$1.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(
|
|
7020
5648
|
MenuContentImpl,
|
|
7021
5649
|
{
|
|
7022
5650
|
id: subContext.contentId,
|
|
@@ -7150,7 +5778,7 @@ var DropdownMenu$1 = (props) => {
|
|
|
7150
5778
|
onChange: onOpenChange,
|
|
7151
5779
|
caller: DROPDOWN_MENU_NAME
|
|
7152
5780
|
});
|
|
7153
|
-
return /* @__PURE__ */
|
|
5781
|
+
return /* @__PURE__ */ jsx(
|
|
7154
5782
|
DropdownMenuProvider,
|
|
7155
5783
|
{
|
|
7156
5784
|
scope: __scopeDropdownMenu,
|
|
@@ -7161,7 +5789,7 @@ var DropdownMenu$1 = (props) => {
|
|
|
7161
5789
|
onOpenChange: setOpen,
|
|
7162
5790
|
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
7163
5791
|
modal,
|
|
7164
|
-
children: /* @__PURE__ */
|
|
5792
|
+
children: /* @__PURE__ */ jsx(Root3$1, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
7165
5793
|
}
|
|
7166
5794
|
);
|
|
7167
5795
|
};
|
|
@@ -7172,7 +5800,7 @@ var DropdownMenuTrigger$1 = React.forwardRef(
|
|
|
7172
5800
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
7173
5801
|
const context = useDropdownMenuContext(TRIGGER_NAME$2, __scopeDropdownMenu);
|
|
7174
5802
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7175
|
-
return /* @__PURE__ */
|
|
5803
|
+
return /* @__PURE__ */ jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
|
|
7176
5804
|
Primitive.button,
|
|
7177
5805
|
{
|
|
7178
5806
|
type: "button",
|
|
@@ -7206,7 +5834,7 @@ var PORTAL_NAME$2 = "DropdownMenuPortal";
|
|
|
7206
5834
|
var DropdownMenuPortal = (props) => {
|
|
7207
5835
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
7208
5836
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7209
|
-
return /* @__PURE__ */
|
|
5837
|
+
return /* @__PURE__ */ jsx(Portal$2, { ...menuScope, ...portalProps });
|
|
7210
5838
|
};
|
|
7211
5839
|
DropdownMenuPortal.displayName = PORTAL_NAME$2;
|
|
7212
5840
|
var CONTENT_NAME$2 = "DropdownMenuContent";
|
|
@@ -7216,7 +5844,7 @@ var DropdownMenuContent$1 = React.forwardRef(
|
|
|
7216
5844
|
const context = useDropdownMenuContext(CONTENT_NAME$2, __scopeDropdownMenu);
|
|
7217
5845
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7218
5846
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
7219
|
-
return /* @__PURE__ */
|
|
5847
|
+
return /* @__PURE__ */ jsx(
|
|
7220
5848
|
Content2$3,
|
|
7221
5849
|
{
|
|
7222
5850
|
id: context.contentId,
|
|
@@ -7256,7 +5884,7 @@ var DropdownMenuGroup = React.forwardRef(
|
|
|
7256
5884
|
(props, forwardedRef) => {
|
|
7257
5885
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
7258
5886
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7259
|
-
return /* @__PURE__ */
|
|
5887
|
+
return /* @__PURE__ */ jsx(Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
7260
5888
|
}
|
|
7261
5889
|
);
|
|
7262
5890
|
DropdownMenuGroup.displayName = GROUP_NAME$1;
|
|
@@ -7265,7 +5893,7 @@ var DropdownMenuLabel = React.forwardRef(
|
|
|
7265
5893
|
(props, forwardedRef) => {
|
|
7266
5894
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
7267
5895
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7268
|
-
return /* @__PURE__ */
|
|
5896
|
+
return /* @__PURE__ */ jsx(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
7269
5897
|
}
|
|
7270
5898
|
);
|
|
7271
5899
|
DropdownMenuLabel.displayName = LABEL_NAME$1;
|
|
@@ -7274,7 +5902,7 @@ var DropdownMenuItem$1 = React.forwardRef(
|
|
|
7274
5902
|
(props, forwardedRef) => {
|
|
7275
5903
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
7276
5904
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7277
|
-
return /* @__PURE__ */
|
|
5905
|
+
return /* @__PURE__ */ jsx(Item2$1, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
7278
5906
|
}
|
|
7279
5907
|
);
|
|
7280
5908
|
DropdownMenuItem$1.displayName = ITEM_NAME$1;
|
|
@@ -7282,35 +5910,35 @@ var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
|
7282
5910
|
var DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {
|
|
7283
5911
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
7284
5912
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7285
|
-
return /* @__PURE__ */
|
|
5913
|
+
return /* @__PURE__ */ jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
7286
5914
|
});
|
|
7287
5915
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
7288
5916
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
7289
5917
|
var DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {
|
|
7290
5918
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
7291
5919
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7292
|
-
return /* @__PURE__ */
|
|
5920
|
+
return /* @__PURE__ */ jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
7293
5921
|
});
|
|
7294
5922
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
7295
5923
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
7296
5924
|
var DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {
|
|
7297
5925
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
7298
5926
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7299
|
-
return /* @__PURE__ */
|
|
5927
|
+
return /* @__PURE__ */ jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
7300
5928
|
});
|
|
7301
5929
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
7302
5930
|
var INDICATOR_NAME$1 = "DropdownMenuItemIndicator";
|
|
7303
5931
|
var DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
7304
5932
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
7305
5933
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7306
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ jsx(ItemIndicator$1, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
7307
5935
|
});
|
|
7308
5936
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME$1;
|
|
7309
5937
|
var SEPARATOR_NAME$1 = "DropdownMenuSeparator";
|
|
7310
5938
|
var DropdownMenuSeparator$1 = React.forwardRef((props, forwardedRef) => {
|
|
7311
5939
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
7312
5940
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7313
|
-
return /* @__PURE__ */
|
|
5941
|
+
return /* @__PURE__ */ jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
7314
5942
|
});
|
|
7315
5943
|
DropdownMenuSeparator$1.displayName = SEPARATOR_NAME$1;
|
|
7316
5944
|
var ARROW_NAME$2 = "DropdownMenuArrow";
|
|
@@ -7318,7 +5946,7 @@ var DropdownMenuArrow = React.forwardRef(
|
|
|
7318
5946
|
(props, forwardedRef) => {
|
|
7319
5947
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
7320
5948
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7321
|
-
return /* @__PURE__ */
|
|
5949
|
+
return /* @__PURE__ */ jsx(Arrow2$1, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
7322
5950
|
}
|
|
7323
5951
|
);
|
|
7324
5952
|
DropdownMenuArrow.displayName = ARROW_NAME$2;
|
|
@@ -7326,14 +5954,14 @@ var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
|
7326
5954
|
var DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {
|
|
7327
5955
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
7328
5956
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7329
|
-
return /* @__PURE__ */
|
|
5957
|
+
return /* @__PURE__ */ jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
7330
5958
|
});
|
|
7331
5959
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
7332
5960
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
7333
5961
|
var DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {
|
|
7334
5962
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
7335
5963
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7336
|
-
return /* @__PURE__ */
|
|
5964
|
+
return /* @__PURE__ */ jsx(
|
|
7337
5965
|
SubContent,
|
|
7338
5966
|
{
|
|
7339
5967
|
...menuScope,
|
|
@@ -7388,7 +6016,7 @@ var Progress$1 = React.forwardRef(
|
|
|
7388
6016
|
}
|
|
7389
6017
|
const value = isValidValueNumber(valueProp, max) ? valueProp : null;
|
|
7390
6018
|
const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
|
|
7391
|
-
return /* @__PURE__ */
|
|
6019
|
+
return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx(
|
|
7392
6020
|
Primitive.div,
|
|
7393
6021
|
{
|
|
7394
6022
|
"aria-valuemax": max,
|
|
@@ -7411,7 +6039,7 @@ var ProgressIndicator = React.forwardRef(
|
|
|
7411
6039
|
(props, forwardedRef) => {
|
|
7412
6040
|
const { __scopeProgress, ...indicatorProps } = props;
|
|
7413
6041
|
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
7414
|
-
return /* @__PURE__ */
|
|
6042
|
+
return /* @__PURE__ */ jsx(
|
|
7415
6043
|
Primitive.div,
|
|
7416
6044
|
{
|
|
7417
6045
|
"data-state": getProgressState(context.value, context.max),
|
|
@@ -7502,7 +6130,7 @@ var Select$1 = (props) => {
|
|
|
7502
6130
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
7503
6131
|
const [nativeOptionsSet, setNativeOptionsSet] = React.useState(/* @__PURE__ */ new Set());
|
|
7504
6132
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
7505
|
-
return /* @__PURE__ */
|
|
6133
|
+
return /* @__PURE__ */ jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsxs(
|
|
7506
6134
|
SelectProvider,
|
|
7507
6135
|
{
|
|
7508
6136
|
required,
|
|
@@ -7522,7 +6150,7 @@ var Select$1 = (props) => {
|
|
|
7522
6150
|
triggerPointerDownPosRef,
|
|
7523
6151
|
disabled,
|
|
7524
6152
|
children: [
|
|
7525
|
-
/* @__PURE__ */
|
|
6153
|
+
/* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(
|
|
7526
6154
|
SelectNativeOptionsProvider,
|
|
7527
6155
|
{
|
|
7528
6156
|
scope: props.__scopeSelect,
|
|
@@ -7539,7 +6167,7 @@ var Select$1 = (props) => {
|
|
|
7539
6167
|
children
|
|
7540
6168
|
}
|
|
7541
6169
|
) }),
|
|
7542
|
-
isFormControl ? /* @__PURE__ */
|
|
6170
|
+
isFormControl ? /* @__PURE__ */ jsxs(
|
|
7543
6171
|
SelectBubbleInput,
|
|
7544
6172
|
{
|
|
7545
6173
|
"aria-hidden": true,
|
|
@@ -7552,7 +6180,7 @@ var Select$1 = (props) => {
|
|
|
7552
6180
|
disabled,
|
|
7553
6181
|
form,
|
|
7554
6182
|
children: [
|
|
7555
|
-
value === void 0 ? /* @__PURE__ */
|
|
6183
|
+
value === void 0 ? /* @__PURE__ */ jsx("option", { value: "" }) : null,
|
|
7556
6184
|
Array.from(nativeOptionsSet)
|
|
7557
6185
|
]
|
|
7558
6186
|
},
|
|
@@ -7593,7 +6221,7 @@ var SelectTrigger$1 = React.forwardRef(
|
|
|
7593
6221
|
};
|
|
7594
6222
|
}
|
|
7595
6223
|
};
|
|
7596
|
-
return /* @__PURE__ */
|
|
6224
|
+
return /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
|
|
7597
6225
|
Primitive.button,
|
|
7598
6226
|
{
|
|
7599
6227
|
type: "button",
|
|
@@ -7652,13 +6280,13 @@ var SelectValue$1 = React.forwardRef(
|
|
|
7652
6280
|
useLayoutEffect2(() => {
|
|
7653
6281
|
onValueNodeHasChildrenChange(hasChildren);
|
|
7654
6282
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
7655
|
-
return /* @__PURE__ */
|
|
6283
|
+
return /* @__PURE__ */ jsx(
|
|
7656
6284
|
Primitive.span,
|
|
7657
6285
|
{
|
|
7658
6286
|
...valueProps,
|
|
7659
6287
|
ref: composedRefs,
|
|
7660
6288
|
style: { pointerEvents: "none" },
|
|
7661
|
-
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */
|
|
6289
|
+
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx(Fragment, { children: placeholder }) : children
|
|
7662
6290
|
}
|
|
7663
6291
|
);
|
|
7664
6292
|
}
|
|
@@ -7668,13 +6296,13 @@ var ICON_NAME = "SelectIcon";
|
|
|
7668
6296
|
var SelectIcon = React.forwardRef(
|
|
7669
6297
|
(props, forwardedRef) => {
|
|
7670
6298
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
7671
|
-
return /* @__PURE__ */
|
|
6299
|
+
return /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
|
7672
6300
|
}
|
|
7673
6301
|
);
|
|
7674
6302
|
SelectIcon.displayName = ICON_NAME;
|
|
7675
6303
|
var PORTAL_NAME$1 = "SelectPortal";
|
|
7676
6304
|
var SelectPortal = (props) => {
|
|
7677
|
-
return /* @__PURE__ */
|
|
6305
|
+
return /* @__PURE__ */ jsx(Portal$3, { asChild: true, ...props });
|
|
7678
6306
|
};
|
|
7679
6307
|
SelectPortal.displayName = PORTAL_NAME$1;
|
|
7680
6308
|
var CONTENT_NAME$1 = "SelectContent";
|
|
@@ -7688,11 +6316,11 @@ var SelectContent$1 = React.forwardRef(
|
|
|
7688
6316
|
if (!context.open) {
|
|
7689
6317
|
const frag = fragment;
|
|
7690
6318
|
return frag ? ReactDOM.createPortal(
|
|
7691
|
-
/* @__PURE__ */
|
|
6319
|
+
/* @__PURE__ */ jsx(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx("div", { children: props.children }) }) }),
|
|
7692
6320
|
frag
|
|
7693
6321
|
) : null;
|
|
7694
6322
|
}
|
|
7695
|
-
return /* @__PURE__ */
|
|
6323
|
+
return /* @__PURE__ */ jsx(SelectContentImpl, { ...props, ref: forwardedRef });
|
|
7696
6324
|
}
|
|
7697
6325
|
);
|
|
7698
6326
|
SelectContent$1.displayName = CONTENT_NAME$1;
|
|
@@ -7846,7 +6474,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
7846
6474
|
hideWhenDetached,
|
|
7847
6475
|
avoidCollisions
|
|
7848
6476
|
} : {};
|
|
7849
|
-
return /* @__PURE__ */
|
|
6477
|
+
return /* @__PURE__ */ jsx(
|
|
7850
6478
|
SelectContentProvider,
|
|
7851
6479
|
{
|
|
7852
6480
|
scope: __scopeSelect,
|
|
@@ -7862,7 +6490,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
7862
6490
|
position,
|
|
7863
6491
|
isPositioned,
|
|
7864
6492
|
searchRef,
|
|
7865
|
-
children: /* @__PURE__ */
|
|
6493
|
+
children: /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
|
|
7866
6494
|
FocusScope,
|
|
7867
6495
|
{
|
|
7868
6496
|
asChild: true,
|
|
@@ -7874,7 +6502,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
7874
6502
|
context.trigger?.focus({ preventScroll: true });
|
|
7875
6503
|
event.preventDefault();
|
|
7876
6504
|
}),
|
|
7877
|
-
children: /* @__PURE__ */
|
|
6505
|
+
children: /* @__PURE__ */ jsx(
|
|
7878
6506
|
DismissableLayer,
|
|
7879
6507
|
{
|
|
7880
6508
|
asChild: true,
|
|
@@ -7883,7 +6511,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
7883
6511
|
onPointerDownOutside,
|
|
7884
6512
|
onFocusOutside: (event) => event.preventDefault(),
|
|
7885
6513
|
onDismiss: () => context.onOpenChange(false),
|
|
7886
|
-
children: /* @__PURE__ */
|
|
6514
|
+
children: /* @__PURE__ */ jsx(
|
|
7887
6515
|
SelectPosition,
|
|
7888
6516
|
{
|
|
7889
6517
|
role: "listbox",
|
|
@@ -8059,14 +6687,14 @@ var SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => {
|
|
|
8059
6687
|
},
|
|
8060
6688
|
[position, focusSelectedItem]
|
|
8061
6689
|
);
|
|
8062
|
-
return /* @__PURE__ */
|
|
6690
|
+
return /* @__PURE__ */ jsx(
|
|
8063
6691
|
SelectViewportProvider,
|
|
8064
6692
|
{
|
|
8065
6693
|
scope: __scopeSelect,
|
|
8066
6694
|
contentWrapper,
|
|
8067
6695
|
shouldExpandOnScrollRef,
|
|
8068
6696
|
onScrollButtonChange: handleScrollButtonChange,
|
|
8069
|
-
children: /* @__PURE__ */
|
|
6697
|
+
children: /* @__PURE__ */ jsx(
|
|
8070
6698
|
"div",
|
|
8071
6699
|
{
|
|
8072
6700
|
ref: setContentWrapper,
|
|
@@ -8076,7 +6704,7 @@ var SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => {
|
|
|
8076
6704
|
position: "fixed",
|
|
8077
6705
|
zIndex: contentZIndex
|
|
8078
6706
|
},
|
|
8079
|
-
children: /* @__PURE__ */
|
|
6707
|
+
children: /* @__PURE__ */ jsx(
|
|
8080
6708
|
Primitive.div,
|
|
8081
6709
|
{
|
|
8082
6710
|
...popperProps,
|
|
@@ -8106,7 +6734,7 @@ var SelectPopperPosition = React.forwardRef((props, forwardedRef) => {
|
|
|
8106
6734
|
...popperProps
|
|
8107
6735
|
} = props;
|
|
8108
6736
|
const popperScope = usePopperScope$1(__scopeSelect);
|
|
8109
|
-
return /* @__PURE__ */
|
|
6737
|
+
return /* @__PURE__ */ jsx(
|
|
8110
6738
|
Content,
|
|
8111
6739
|
{
|
|
8112
6740
|
...popperScope,
|
|
@@ -8140,8 +6768,8 @@ var SelectViewport = React.forwardRef(
|
|
|
8140
6768
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
8141
6769
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
8142
6770
|
const prevScrollTopRef = React.useRef(0);
|
|
8143
|
-
return /* @__PURE__ */
|
|
8144
|
-
/* @__PURE__ */
|
|
6771
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6772
|
+
/* @__PURE__ */ jsx(
|
|
8145
6773
|
"style",
|
|
8146
6774
|
{
|
|
8147
6775
|
dangerouslySetInnerHTML: {
|
|
@@ -8150,7 +6778,7 @@ var SelectViewport = React.forwardRef(
|
|
|
8150
6778
|
nonce
|
|
8151
6779
|
}
|
|
8152
6780
|
),
|
|
8153
|
-
/* @__PURE__ */
|
|
6781
|
+
/* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(
|
|
8154
6782
|
Primitive.div,
|
|
8155
6783
|
{
|
|
8156
6784
|
"data-radix-select-viewport": "",
|
|
@@ -8206,7 +6834,7 @@ var SelectGroup = React.forwardRef(
|
|
|
8206
6834
|
(props, forwardedRef) => {
|
|
8207
6835
|
const { __scopeSelect, ...groupProps } = props;
|
|
8208
6836
|
const groupId = useId();
|
|
8209
|
-
return /* @__PURE__ */
|
|
6837
|
+
return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
8210
6838
|
}
|
|
8211
6839
|
);
|
|
8212
6840
|
SelectGroup.displayName = GROUP_NAME;
|
|
@@ -8215,7 +6843,7 @@ var SelectLabel = React.forwardRef(
|
|
|
8215
6843
|
(props, forwardedRef) => {
|
|
8216
6844
|
const { __scopeSelect, ...labelProps } = props;
|
|
8217
6845
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
8218
|
-
return /* @__PURE__ */
|
|
6846
|
+
return /* @__PURE__ */ jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
8219
6847
|
}
|
|
8220
6848
|
);
|
|
8221
6849
|
SelectLabel.displayName = LABEL_NAME;
|
|
@@ -8252,7 +6880,7 @@ var SelectItem$1 = React.forwardRef(
|
|
|
8252
6880
|
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
8253
6881
|
);
|
|
8254
6882
|
}
|
|
8255
|
-
return /* @__PURE__ */
|
|
6883
|
+
return /* @__PURE__ */ jsx(
|
|
8256
6884
|
SelectItemContextProvider,
|
|
8257
6885
|
{
|
|
8258
6886
|
scope: __scopeSelect,
|
|
@@ -8263,14 +6891,14 @@ var SelectItem$1 = React.forwardRef(
|
|
|
8263
6891
|
onItemTextChange: React.useCallback((node) => {
|
|
8264
6892
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
8265
6893
|
}, []),
|
|
8266
|
-
children: /* @__PURE__ */
|
|
6894
|
+
children: /* @__PURE__ */ jsx(
|
|
8267
6895
|
Collection.ItemSlot,
|
|
8268
6896
|
{
|
|
8269
6897
|
scope: __scopeSelect,
|
|
8270
6898
|
value,
|
|
8271
6899
|
disabled,
|
|
8272
6900
|
textValue,
|
|
8273
|
-
children: /* @__PURE__ */
|
|
6901
|
+
children: /* @__PURE__ */ jsx(
|
|
8274
6902
|
Primitive.div,
|
|
8275
6903
|
{
|
|
8276
6904
|
role: "option",
|
|
@@ -8339,7 +6967,7 @@ var SelectItemText = React.forwardRef(
|
|
|
8339
6967
|
);
|
|
8340
6968
|
const textContent = itemTextNode?.textContent;
|
|
8341
6969
|
const nativeOption = React.useMemo(
|
|
8342
|
-
() => /* @__PURE__ */
|
|
6970
|
+
() => /* @__PURE__ */ jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
|
|
8343
6971
|
[itemContext.disabled, itemContext.value, textContent]
|
|
8344
6972
|
);
|
|
8345
6973
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
@@ -8347,8 +6975,8 @@ var SelectItemText = React.forwardRef(
|
|
|
8347
6975
|
onNativeOptionAdd(nativeOption);
|
|
8348
6976
|
return () => onNativeOptionRemove(nativeOption);
|
|
8349
6977
|
}, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
|
|
8350
|
-
return /* @__PURE__ */
|
|
8351
|
-
/* @__PURE__ */
|
|
6978
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6979
|
+
/* @__PURE__ */ jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
|
|
8352
6980
|
itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null
|
|
8353
6981
|
] });
|
|
8354
6982
|
}
|
|
@@ -8359,7 +6987,7 @@ var SelectItemIndicator = React.forwardRef(
|
|
|
8359
6987
|
(props, forwardedRef) => {
|
|
8360
6988
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
8361
6989
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
8362
|
-
return itemContext.isSelected ? /* @__PURE__ */
|
|
6990
|
+
return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
8363
6991
|
}
|
|
8364
6992
|
);
|
|
8365
6993
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
@@ -8381,7 +7009,7 @@ var SelectScrollUpButton$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
8381
7009
|
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
8382
7010
|
}
|
|
8383
7011
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
8384
|
-
return canScrollUp ? /* @__PURE__ */
|
|
7012
|
+
return canScrollUp ? /* @__PURE__ */ jsx(
|
|
8385
7013
|
SelectScrollButtonImpl,
|
|
8386
7014
|
{
|
|
8387
7015
|
...props,
|
|
@@ -8415,7 +7043,7 @@ var SelectScrollDownButton$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
8415
7043
|
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
8416
7044
|
}
|
|
8417
7045
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
8418
|
-
return canScrollDown ? /* @__PURE__ */
|
|
7046
|
+
return canScrollDown ? /* @__PURE__ */ jsx(
|
|
8419
7047
|
SelectScrollButtonImpl,
|
|
8420
7048
|
{
|
|
8421
7049
|
...props,
|
|
@@ -8448,7 +7076,7 @@ var SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
8448
7076
|
const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
|
|
8449
7077
|
activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
8450
7078
|
}, [getItems]);
|
|
8451
|
-
return /* @__PURE__ */
|
|
7079
|
+
return /* @__PURE__ */ jsx(
|
|
8452
7080
|
Primitive.div,
|
|
8453
7081
|
{
|
|
8454
7082
|
"aria-hidden": true,
|
|
@@ -8476,7 +7104,7 @@ var SEPARATOR_NAME = "SelectSeparator";
|
|
|
8476
7104
|
var SelectSeparator = React.forwardRef(
|
|
8477
7105
|
(props, forwardedRef) => {
|
|
8478
7106
|
const { __scopeSelect, ...separatorProps } = props;
|
|
8479
|
-
return /* @__PURE__ */
|
|
7107
|
+
return /* @__PURE__ */ jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
8480
7108
|
}
|
|
8481
7109
|
);
|
|
8482
7110
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
@@ -8487,7 +7115,7 @@ var SelectArrow = React.forwardRef(
|
|
|
8487
7115
|
const popperScope = usePopperScope$1(__scopeSelect);
|
|
8488
7116
|
const context = useSelectContext(ARROW_NAME$1, __scopeSelect);
|
|
8489
7117
|
const contentContext = useSelectContentContext(ARROW_NAME$1, __scopeSelect);
|
|
8490
|
-
return context.open && contentContext.position === "popper" ? /* @__PURE__ */
|
|
7118
|
+
return context.open && contentContext.position === "popper" ? /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;
|
|
8491
7119
|
}
|
|
8492
7120
|
);
|
|
8493
7121
|
SelectArrow.displayName = ARROW_NAME$1;
|
|
@@ -8512,7 +7140,7 @@ var SelectBubbleInput = React.forwardRef(
|
|
|
8512
7140
|
select.dispatchEvent(event);
|
|
8513
7141
|
}
|
|
8514
7142
|
}, [prevValue, value]);
|
|
8515
|
-
return /* @__PURE__ */
|
|
7143
|
+
return /* @__PURE__ */ jsx(
|
|
8516
7144
|
Primitive.select,
|
|
8517
7145
|
{
|
|
8518
7146
|
...props,
|
|
@@ -8603,7 +7231,7 @@ var TooltipProvider$1 = (props) => {
|
|
|
8603
7231
|
const skipDelayTimer = skipDelayTimerRef.current;
|
|
8604
7232
|
return () => window.clearTimeout(skipDelayTimer);
|
|
8605
7233
|
}, []);
|
|
8606
|
-
return /* @__PURE__ */
|
|
7234
|
+
return /* @__PURE__ */ jsx(
|
|
8607
7235
|
TooltipProviderContextProvider,
|
|
8608
7236
|
{
|
|
8609
7237
|
scope: __scopeTooltip,
|
|
@@ -8694,7 +7322,7 @@ var Tooltip$1 = (props) => {
|
|
|
8694
7322
|
}
|
|
8695
7323
|
};
|
|
8696
7324
|
}, []);
|
|
8697
|
-
return /* @__PURE__ */
|
|
7325
|
+
return /* @__PURE__ */ jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
8698
7326
|
TooltipContextProvider,
|
|
8699
7327
|
{
|
|
8700
7328
|
scope: __scopeTooltip,
|
|
@@ -8738,7 +7366,7 @@ var TooltipTrigger$1 = React.forwardRef(
|
|
|
8738
7366
|
React.useEffect(() => {
|
|
8739
7367
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
8740
7368
|
}, [handlePointerUp]);
|
|
8741
|
-
return /* @__PURE__ */
|
|
7369
|
+
return /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
|
|
8742
7370
|
Primitive.button,
|
|
8743
7371
|
{
|
|
8744
7372
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -8780,7 +7408,7 @@ var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
|
|
8780
7408
|
var TooltipPortal = (props) => {
|
|
8781
7409
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
8782
7410
|
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
|
8783
|
-
return /* @__PURE__ */
|
|
7411
|
+
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$3, { asChild: true, container, children }) }) });
|
|
8784
7412
|
};
|
|
8785
7413
|
TooltipPortal.displayName = PORTAL_NAME;
|
|
8786
7414
|
var CONTENT_NAME = "TooltipContent";
|
|
@@ -8789,7 +7417,7 @@ var TooltipContent$1 = React.forwardRef(
|
|
|
8789
7417
|
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
|
8790
7418
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
8791
7419
|
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
8792
|
-
return /* @__PURE__ */
|
|
7420
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
8793
7421
|
}
|
|
8794
7422
|
);
|
|
8795
7423
|
var TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {
|
|
@@ -8851,7 +7479,7 @@ var TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {
|
|
|
8851
7479
|
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
8852
7480
|
}
|
|
8853
7481
|
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
8854
|
-
return /* @__PURE__ */
|
|
7482
|
+
return /* @__PURE__ */ jsx(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
8855
7483
|
});
|
|
8856
7484
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
8857
7485
|
var Slottable = createSlottable("TooltipContent");
|
|
@@ -8882,7 +7510,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
8882
7510
|
return () => window.removeEventListener("scroll", handleScroll, { capture: true });
|
|
8883
7511
|
}
|
|
8884
7512
|
}, [context.trigger, onClose]);
|
|
8885
|
-
return /* @__PURE__ */
|
|
7513
|
+
return /* @__PURE__ */ jsx(
|
|
8886
7514
|
DismissableLayer,
|
|
8887
7515
|
{
|
|
8888
7516
|
asChild: true,
|
|
@@ -8891,7 +7519,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
8891
7519
|
onPointerDownOutside,
|
|
8892
7520
|
onFocusOutside: (event) => event.preventDefault(),
|
|
8893
7521
|
onDismiss: onClose,
|
|
8894
|
-
children: /* @__PURE__ */
|
|
7522
|
+
children: /* @__PURE__ */ jsxs(
|
|
8895
7523
|
Content,
|
|
8896
7524
|
{
|
|
8897
7525
|
"data-state": context.stateAttribute,
|
|
@@ -8910,8 +7538,8 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
8910
7538
|
}
|
|
8911
7539
|
},
|
|
8912
7540
|
children: [
|
|
8913
|
-
/* @__PURE__ */
|
|
8914
|
-
/* @__PURE__ */
|
|
7541
|
+
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
7542
|
+
/* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(Root$3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
8915
7543
|
]
|
|
8916
7544
|
}
|
|
8917
7545
|
)
|
|
@@ -8929,7 +7557,7 @@ var TooltipArrow = React.forwardRef(
|
|
|
8929
7557
|
ARROW_NAME,
|
|
8930
7558
|
__scopeTooltip
|
|
8931
7559
|
);
|
|
8932
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */
|
|
7560
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
8933
7561
|
}
|
|
8934
7562
|
);
|
|
8935
7563
|
TooltipArrow.displayName = ARROW_NAME;
|
|
@@ -9085,27 +7713,27 @@ const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50
|
|
|
9085
7713
|
});
|
|
9086
7714
|
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
9087
7715
|
const Comp = asChild ? Slot$2 : "button";
|
|
9088
|
-
return (
|
|
7716
|
+
return (jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
9089
7717
|
}
|
|
9090
7718
|
|
|
9091
7719
|
function Input({ className, type, ...props }) {
|
|
9092
|
-
return (
|
|
7720
|
+
return (jsx("input", { type: type, "data-slot": "input", className: cn("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", className), ...props }));
|
|
9093
7721
|
}
|
|
9094
7722
|
|
|
9095
7723
|
function DropdownMenu({ ...props }) {
|
|
9096
|
-
return
|
|
7724
|
+
return jsx(Root2$1, { "data-slot": "dropdown-menu", ...props });
|
|
9097
7725
|
}
|
|
9098
7726
|
function DropdownMenuTrigger({ ...props }) {
|
|
9099
|
-
return (
|
|
7727
|
+
return (jsx(Trigger$2, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
9100
7728
|
}
|
|
9101
7729
|
function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
9102
|
-
return (
|
|
7730
|
+
return (jsx(Portal2, { children: jsx(Content2$2, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, align: align, className: className, ...props }) }));
|
|
9103
7731
|
}
|
|
9104
7732
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
9105
|
-
return (
|
|
7733
|
+
return (jsx(Item2, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: className, ...props }));
|
|
9106
7734
|
}
|
|
9107
7735
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
9108
|
-
return (
|
|
7736
|
+
return (jsx(Separator2, { "data-slot": "dropdown-menu-separator", className: className, ...props }));
|
|
9109
7737
|
}
|
|
9110
7738
|
|
|
9111
7739
|
function DataTableHeader({ title, description, actions = [], search, searchValue = "", onSearchChange, table, selectedCount = 0, className, }) {
|
|
@@ -9122,22 +7750,22 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9122
7750
|
const renderAction = (action, index) => {
|
|
9123
7751
|
// Dropdown Action
|
|
9124
7752
|
if (action.children && action.children.length > 0) {
|
|
9125
|
-
return (
|
|
9126
|
-
"text-destructive focus:text-destructive"), children: [child.icon &&
|
|
7753
|
+
return (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button, { variant: action.variant || "outline", size: action.size || "default", disabled: action.disabled || action.loading, children: [action.icon, jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label }), jsx(ChevronDown, { className: "ml-2 h-4 w-4" })] }) }), jsx(DropdownMenuContent, { align: "end", children: action.children.map((child, childIndex) => (jsxs(DropdownMenuItem, { onClick: child.onClick, className: cn(child.variant === "destructive" &&
|
|
7754
|
+
"text-destructive focus:text-destructive"), children: [child.icon && jsx("span", { className: "mr-2", children: child.icon }), child.label] }, child.id || childIndex))) })] }, action.id || index));
|
|
9127
7755
|
}
|
|
9128
7756
|
// Link Action
|
|
9129
7757
|
if (action.href) {
|
|
9130
|
-
return (
|
|
7758
|
+
return (jsx(Button, { variant: action.variant || "outline", size: action.size || "default", disabled: action.disabled || action.loading, asChild: true, children: jsxs("a", { href: action.href, children: [action.icon, action.size !== "icon" && (jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label }))] }) }, action.id || index));
|
|
9131
7759
|
}
|
|
9132
7760
|
// Normal Button Action
|
|
9133
|
-
return (
|
|
7761
|
+
return (jsxs(Button, { variant: action.variant || "outline", size: action.size || "default", disabled: action.disabled || action.loading, onClick: () => {
|
|
9134
7762
|
if (action.bulk && action.bulkOnClick) {
|
|
9135
7763
|
action.bulkOnClick(getSelectedRows());
|
|
9136
7764
|
}
|
|
9137
7765
|
else if (action.onClick) {
|
|
9138
7766
|
action.onClick();
|
|
9139
7767
|
}
|
|
9140
|
-
}, children: [action.loading ? (
|
|
7768
|
+
}, children: [action.loading ? (jsxs("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", children: [jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", fill: "none" }), jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] })) : (action.icon), action.size !== "icon" && (jsx("span", { className: cn(action.icon || action.loading ? "ml-2" : ""), children: action.label }))] }, action.id || index));
|
|
9141
7769
|
};
|
|
9142
7770
|
// Kein Header wenn nichts konfiguriert
|
|
9143
7771
|
if (!title &&
|
|
@@ -9146,7 +7774,7 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9146
7774
|
!search?.enabled) {
|
|
9147
7775
|
return null;
|
|
9148
7776
|
}
|
|
9149
|
-
return (
|
|
7777
|
+
return (jsxs("div", { className: cn("flex flex-col gap-4", className), children: [(title || description) && (jsxs("div", { className: "space-y-1", children: [title && (jsx("h2", { className: "text-xl font-semibold tracking-tight", children: title })), description && (jsx("p", { className: "text-sm text-muted-foreground", children: description }))] })), (search?.enabled || normalActions.length > 0 || showBulkActions) && (jsxs("div", { className: "flex items-center justify-between gap-4 mb-4", children: [search?.enabled && (jsxs("div", { className: "relative max-w-sm flex-1", children: [jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), jsx(Input, { placeholder: search.placeholder || "Suchen...", value: searchValue, onChange: (e) => onSearchChange?.(e.target.value), className: "pl-9 pr-9" }), searchValue && (jsx("button", { onClick: () => onSearchChange?.(""), className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground", children: jsx(X, { className: "h-4 w-4" }) }))] })), jsxs("div", { className: "flex items-center gap-2", children: [showBulkActions && (jsxs("span", { className: "text-sm text-muted-foreground", children: [selectedCount, " ausgew\u00E4hlt"] })), showBulkActions &&
|
|
9150
7778
|
bulkActions.map((action, index) => renderAction(action, index)), normalActions.length > 0 &&
|
|
9151
7779
|
normalActions.map((action, index) => renderAction(action, index))] })] }))] }));
|
|
9152
7780
|
}
|
|
@@ -9154,29 +7782,29 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9154
7782
|
// components/ui/data-table/data-table-empty.tsx
|
|
9155
7783
|
function DataTableEmpty({ config, colSpan, className, }) {
|
|
9156
7784
|
const { icon, imageUrl, title, description, action, variant } = config;
|
|
9157
|
-
return (
|
|
7785
|
+
return (jsx("tr", { children: jsx("td", { colSpan: colSpan, className: cn("h-[400px]", className), children: jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-4 text-center p-8", children: [imageUrl ? (jsx("img", { className: "w-24 h-24", src: imageUrl, alt: "Empty State" })) : icon ? (jsx("div", { className: cn("rounded-full p-4", variant === "error" ? "bg-destructive/10" : "bg-muted"), children: icon })) : null, jsxs("div", { className: "w-full flex flex-col items-center justify-center gap-2", children: [jsx("h3", { className: "text-sm font-semibold text-foreground whitespace-normal break-words", children: title }), description && (jsx("p", { className: "text-xs text-muted-foreground font-normal whitespace-normal break-words leading-relaxed", children: description }))] }), action && (jsx(Button, { variant: variant === "error" ? "outline" : "default", onClick: action.onClick, asChild: !!action.href, className: "mt-2", children: action.href ? (jsxs("a", { href: action.href, children: [action.icon, jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label })] })) : (jsxs(Fragment, { children: [action.icon, jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label })] })) }))] }) }) }));
|
|
9158
7786
|
}
|
|
9159
7787
|
|
|
9160
7788
|
function Select({ ...props }) {
|
|
9161
|
-
return
|
|
7789
|
+
return jsx(Root2, { "data-slot": "select", ...props });
|
|
9162
7790
|
}
|
|
9163
7791
|
function SelectValue({ ...props }) {
|
|
9164
|
-
return
|
|
7792
|
+
return jsx(Value, { "data-slot": "select-value", ...props });
|
|
9165
7793
|
}
|
|
9166
7794
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
9167
|
-
return (
|
|
7795
|
+
return (jsxs(Trigger$1, { "data-slot": "select-trigger", "data-size": size, className: className, ...props, children: [children, jsx(Icon, { asChild: true, children: jsx(ChevronDownIcon, { className: "text-muted-foreground size-4 pointer-events-none" }) })] }));
|
|
9168
7796
|
}
|
|
9169
7797
|
function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
|
|
9170
|
-
return (
|
|
7798
|
+
return (jsx(Portal$1, { children: jsxs(Content2$1, { "data-slot": "select-content", "data-align-trigger": position === "item-aligned", className: className, position: position, align: align, ...props, children: [jsx(SelectScrollUpButton, {}), jsx(Viewport, { "data-position": position, className: className, children: children }), jsx(SelectScrollDownButton, {})] }) }));
|
|
9171
7799
|
}
|
|
9172
7800
|
function SelectItem({ className, children, ...props }) {
|
|
9173
|
-
return (
|
|
7801
|
+
return (jsxs(Item, { "data-slot": "select-item", className: className, ...props, children: [jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: jsx(ItemIndicator, { children: jsx(CheckIcon, { className: "pointer-events-none" }) }) }), jsx(ItemText, { children: children })] }));
|
|
9174
7802
|
}
|
|
9175
7803
|
function SelectScrollUpButton({ className, ...props }) {
|
|
9176
|
-
return (
|
|
7804
|
+
return (jsx(ScrollUpButton, { "data-slot": "select-scroll-up-button", className: className, ...props, children: jsx(ChevronUpIcon, {}) }));
|
|
9177
7805
|
}
|
|
9178
7806
|
function SelectScrollDownButton({ className, ...props }) {
|
|
9179
|
-
return (
|
|
7807
|
+
return (jsx(ScrollDownButton, { "data-slot": "select-scroll-down-button", className: className, ...props, children: jsx(ChevronDownIcon, {}) }));
|
|
9180
7808
|
}
|
|
9181
7809
|
|
|
9182
7810
|
// components/ui/data-table/data-table-pagination.tsx
|
|
@@ -9184,24 +7812,196 @@ function DataTablePagination({ table, config, className, }) {
|
|
|
9184
7812
|
if (!config?.enabled)
|
|
9185
7813
|
return null;
|
|
9186
7814
|
const { showPageInfo = true, showPageSizeSelector = true, pageSizeOptions = [10, 20, 30, 50, 100], } = config;
|
|
9187
|
-
return (
|
|
7815
|
+
return (jsxs("div", { className: cn("flex flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center sm:justify-between", className), children: [jsx("div", { className: "text-sm text-muted-foreground", children: table.getFilteredSelectedRowModel().rows.length > 0 ? (jsxs("span", { children: [table.getFilteredSelectedRowModel().rows.length, " von", " ", table.getFilteredRowModel().rows.length, " Zeile(n) ausgew\u00E4hlt"] })) : showPageInfo ? (jsxs("span", { children: [table.getFilteredRowModel().rows.length, " Eintr\u00E4ge"] })) : null }), jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:gap-6", children: [showPageSizeSelector && (jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Zeilen pro Seite" }), jsxs(Select, { value: `${table.getState().pagination.pageSize}`, onValueChange: (value) => table.setPageSize(Number(value)), children: [jsx(SelectTrigger, { className: "h-8 w-[70px]", children: jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }), jsx(SelectContent, { side: "top", children: pageSizeOptions.map((pageSize) => (jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize))) })] })] })), showPageInfo && (jsxs("div", { className: "text-sm text-muted-foreground whitespace-nowrap", children: ["Seite ", table.getState().pagination.pageIndex + 1, " von", " ", table.getPageCount()] })), jsxs("div", { className: "flex items-center gap-1", children: [jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.setPageIndex(0), disabled: !table.getCanPreviousPage(), children: [jsx(ChevronsLeft, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: "Erste Seite" })] }), jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), children: [jsx(ChevronLeft, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: "Vorherige Seite" })] }), jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), children: [jsx(ChevronRight, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: "N\u00E4chste Seite" })] }), jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.setPageIndex(table.getPageCount() - 1), disabled: !table.getCanNextPage(), children: [jsx(ChevronsRight, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: "Letzte Seite" })] })] })] })] }));
|
|
9188
7816
|
}
|
|
9189
7817
|
|
|
7818
|
+
/**
|
|
7819
|
+
* Header Actions Builder
|
|
7820
|
+
* Fluent API for building header actions
|
|
7821
|
+
*/
|
|
7822
|
+
class HeaderActionsBuilder {
|
|
7823
|
+
actions = [];
|
|
7824
|
+
create(config) {
|
|
7825
|
+
this.actions.push({
|
|
7826
|
+
id: "create",
|
|
7827
|
+
label: config.label,
|
|
7828
|
+
href: config.href,
|
|
7829
|
+
onClick: config.onClick,
|
|
7830
|
+
icon: config.icon,
|
|
7831
|
+
variant: "default",
|
|
7832
|
+
});
|
|
7833
|
+
return this;
|
|
7834
|
+
}
|
|
7835
|
+
export(config) {
|
|
7836
|
+
if (config.formats && config.formats.length > 0) {
|
|
7837
|
+
this.actions.push({
|
|
7838
|
+
id: "export",
|
|
7839
|
+
label: config.label,
|
|
7840
|
+
icon: config.icon,
|
|
7841
|
+
variant: "outline",
|
|
7842
|
+
children: config.formats.map((format, index) => ({
|
|
7843
|
+
id: `export-${index}`,
|
|
7844
|
+
label: format.label,
|
|
7845
|
+
onClick: format.onClick,
|
|
7846
|
+
})),
|
|
7847
|
+
});
|
|
7848
|
+
}
|
|
7849
|
+
else {
|
|
7850
|
+
this.actions.push({
|
|
7851
|
+
id: "export",
|
|
7852
|
+
label: config.label,
|
|
7853
|
+
icon: config.icon,
|
|
7854
|
+
variant: "outline",
|
|
7855
|
+
});
|
|
7856
|
+
}
|
|
7857
|
+
return this;
|
|
7858
|
+
}
|
|
7859
|
+
import(config) {
|
|
7860
|
+
this.actions.push({
|
|
7861
|
+
id: "import",
|
|
7862
|
+
label: config.label,
|
|
7863
|
+
icon: config.icon,
|
|
7864
|
+
onClick: config.onClick,
|
|
7865
|
+
variant: "outline",
|
|
7866
|
+
});
|
|
7867
|
+
return this;
|
|
7868
|
+
}
|
|
7869
|
+
bulkExport(config) {
|
|
7870
|
+
this.actions.push({
|
|
7871
|
+
id: "bulk-export",
|
|
7872
|
+
label: config.label,
|
|
7873
|
+
icon: config.icon,
|
|
7874
|
+
bulk: true,
|
|
7875
|
+
bulkOnClick: config.onExport,
|
|
7876
|
+
variant: "outline",
|
|
7877
|
+
});
|
|
7878
|
+
return this;
|
|
7879
|
+
}
|
|
7880
|
+
bulkDelete(config) {
|
|
7881
|
+
this.actions.push({
|
|
7882
|
+
id: "bulk-delete",
|
|
7883
|
+
label: config.label,
|
|
7884
|
+
icon: config.icon,
|
|
7885
|
+
bulk: true,
|
|
7886
|
+
bulkOnClick: config.onDelete,
|
|
7887
|
+
variant: "destructive",
|
|
7888
|
+
});
|
|
7889
|
+
return this;
|
|
7890
|
+
}
|
|
7891
|
+
custom(action) {
|
|
7892
|
+
this.actions.push(action);
|
|
7893
|
+
return this;
|
|
7894
|
+
}
|
|
7895
|
+
build() {
|
|
7896
|
+
return this.actions;
|
|
7897
|
+
}
|
|
7898
|
+
}
|
|
9190
7899
|
/**
|
|
9191
7900
|
* Table Schema Builder
|
|
9192
|
-
* Fluent API for building table
|
|
7901
|
+
* Fluent API for building complete table configurations
|
|
9193
7902
|
*/
|
|
9194
7903
|
class TableSchema {
|
|
9195
7904
|
columnBuilders = [];
|
|
7905
|
+
config = {};
|
|
9196
7906
|
static make() {
|
|
9197
7907
|
return new TableSchema();
|
|
9198
7908
|
}
|
|
7909
|
+
// Configuration Methods
|
|
7910
|
+
description(text) {
|
|
7911
|
+
this.config.description = text;
|
|
7912
|
+
return this;
|
|
7913
|
+
}
|
|
7914
|
+
title(text) {
|
|
7915
|
+
this.config.title = text;
|
|
7916
|
+
return this;
|
|
7917
|
+
}
|
|
7918
|
+
headerActions(builder) {
|
|
7919
|
+
const actionsBuilder = new HeaderActionsBuilder();
|
|
7920
|
+
this.config.headerActions = builder(actionsBuilder).build();
|
|
7921
|
+
return this;
|
|
7922
|
+
}
|
|
7923
|
+
emptyState(config) {
|
|
7924
|
+
this.config.emptyState = config;
|
|
7925
|
+
return this;
|
|
7926
|
+
}
|
|
7927
|
+
searchEmptyState(config) {
|
|
7928
|
+
this.config.searchEmptyState = config;
|
|
7929
|
+
return this;
|
|
7930
|
+
}
|
|
7931
|
+
filterEmptyState(config) {
|
|
7932
|
+
this.config.filterEmptyState = config;
|
|
7933
|
+
return this;
|
|
7934
|
+
}
|
|
7935
|
+
// Feature Methods
|
|
7936
|
+
searchable(config) {
|
|
7937
|
+
if (typeof config === "boolean") {
|
|
7938
|
+
this.config.search = config ? { enabled: true } : { enabled: false };
|
|
7939
|
+
}
|
|
7940
|
+
else {
|
|
7941
|
+
this.config.search = {
|
|
7942
|
+
enabled: true,
|
|
7943
|
+
placeholder: config?.placeholder,
|
|
7944
|
+
};
|
|
7945
|
+
}
|
|
7946
|
+
return this;
|
|
7947
|
+
}
|
|
7948
|
+
paginated(config) {
|
|
7949
|
+
if (typeof config === "boolean") {
|
|
7950
|
+
this.config.pagination = { enabled: config };
|
|
7951
|
+
}
|
|
7952
|
+
else {
|
|
7953
|
+
this.config.pagination = {
|
|
7954
|
+
enabled: true,
|
|
7955
|
+
pageSize: config?.pageSize,
|
|
7956
|
+
pageSizeOptions: config?.pageSizeOptions,
|
|
7957
|
+
};
|
|
7958
|
+
}
|
|
7959
|
+
return this;
|
|
7960
|
+
}
|
|
7961
|
+
selectable(multiSelect = true) {
|
|
7962
|
+
this.config.enableRowSelection = true;
|
|
7963
|
+
this.config.enableMultiRowSelection = multiSelect;
|
|
7964
|
+
return this;
|
|
7965
|
+
}
|
|
7966
|
+
sortable(defaultSort) {
|
|
7967
|
+
this.config.enableSorting = true;
|
|
7968
|
+
if (defaultSort) {
|
|
7969
|
+
this.config.defaultSort = defaultSort;
|
|
7970
|
+
}
|
|
7971
|
+
return this;
|
|
7972
|
+
}
|
|
7973
|
+
columnVisibility(enabled = true) {
|
|
7974
|
+
this.config.enableColumnVisibility = enabled;
|
|
7975
|
+
return this;
|
|
7976
|
+
}
|
|
7977
|
+
// Styling Methods
|
|
7978
|
+
bordered(enabled = true) {
|
|
7979
|
+
this.config.bordered = enabled;
|
|
7980
|
+
return this;
|
|
7981
|
+
}
|
|
7982
|
+
striped(enabled = true) {
|
|
7983
|
+
this.config.striped = enabled;
|
|
7984
|
+
return this;
|
|
7985
|
+
}
|
|
7986
|
+
hoverable(enabled = true) {
|
|
7987
|
+
this.config.hoverable = enabled;
|
|
7988
|
+
return this;
|
|
7989
|
+
}
|
|
7990
|
+
density(density) {
|
|
7991
|
+
this.config.density = density;
|
|
7992
|
+
return this;
|
|
7993
|
+
}
|
|
7994
|
+
// Columns
|
|
9199
7995
|
columns(...builders) {
|
|
9200
7996
|
this.columnBuilders.push(...builders);
|
|
9201
7997
|
return this;
|
|
9202
7998
|
}
|
|
7999
|
+
// Build
|
|
9203
8000
|
build() {
|
|
9204
|
-
return
|
|
8001
|
+
return {
|
|
8002
|
+
columns: this.columnBuilders.map((builder) => builder.build()),
|
|
8003
|
+
config: this.config,
|
|
8004
|
+
};
|
|
9205
8005
|
}
|
|
9206
8006
|
}
|
|
9207
8007
|
|
|
@@ -9277,6 +8077,47 @@ class EmptyStateBuilder {
|
|
|
9277
8077
|
build() {
|
|
9278
8078
|
return this.config;
|
|
9279
8079
|
}
|
|
8080
|
+
// Static helper methods for quick configuration
|
|
8081
|
+
static noData(config) {
|
|
8082
|
+
return {
|
|
8083
|
+
variant: "default",
|
|
8084
|
+
title: config.title,
|
|
8085
|
+
description: config.description,
|
|
8086
|
+
action: config.createLabel
|
|
8087
|
+
? {
|
|
8088
|
+
label: config.createLabel,
|
|
8089
|
+
href: config.createHref,
|
|
8090
|
+
onClick: config.createOnClick,
|
|
8091
|
+
}
|
|
8092
|
+
: undefined,
|
|
8093
|
+
};
|
|
8094
|
+
}
|
|
8095
|
+
static noSearchResults(config) {
|
|
8096
|
+
return {
|
|
8097
|
+
variant: "search",
|
|
8098
|
+
title: config.title,
|
|
8099
|
+
description: config.description,
|
|
8100
|
+
action: config.clearLabel
|
|
8101
|
+
? {
|
|
8102
|
+
label: config.clearLabel,
|
|
8103
|
+
onClick: config.onClear,
|
|
8104
|
+
}
|
|
8105
|
+
: undefined,
|
|
8106
|
+
};
|
|
8107
|
+
}
|
|
8108
|
+
static noFilterResults(config) {
|
|
8109
|
+
return {
|
|
8110
|
+
variant: "filter",
|
|
8111
|
+
title: config.title,
|
|
8112
|
+
description: config.description,
|
|
8113
|
+
action: config.resetLabel
|
|
8114
|
+
? {
|
|
8115
|
+
label: config.resetLabel,
|
|
8116
|
+
onClick: config.onReset,
|
|
8117
|
+
}
|
|
8118
|
+
: undefined,
|
|
8119
|
+
};
|
|
8120
|
+
}
|
|
9280
8121
|
}
|
|
9281
8122
|
|
|
9282
8123
|
function DataTable({ columns, data, config = {}, className, isLoading = false, isError = false, onRetry, }) {
|
|
@@ -9334,24 +8175,24 @@ function DataTable({ columns, data, config = {}, className, isLoading = false, i
|
|
|
9334
8175
|
};
|
|
9335
8176
|
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
9336
8177
|
const hasRows = table.getRowModel().rows?.length > 0;
|
|
9337
|
-
return (
|
|
8178
|
+
return (jsxs("div", { className: cn("flex flex-col", className), children: [jsx(DataTableHeader, { title: config.title, description: config.description, actions: config.headerActions, search: config.search, searchValue: globalFilter, onSearchChange: setGlobalFilter, table: table, selectedCount: selectedCount }), jsx("div", { className: cn("overflow-hidden", config.bordered !== false && "rounded-md border"), children: jsxs(Table, { className: cn(densityClasses[config.density || "default"], config.striped ? "[&_tr:nth-child(even)]:bg-muted/50" : "", config.hoverable !== false && "[&_tr:hover]:bg-muted/50"), children: [jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => (jsx(TableRow, { children: headerGroup.headers.map((header) => (jsx(TableHead, { children: header.isPlaceholder
|
|
9338
8179
|
? null
|
|
9339
|
-
: flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }),
|
|
8180
|
+
: flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }), jsx(TableBody, { children: isLoading ? (
|
|
9340
8181
|
// Loading State
|
|
9341
|
-
|
|
8182
|
+
jsx("tr", { children: jsx("td", { colSpan: columns.length, className: "h-[400px]", children: jsx("div", { className: "flex h-full items-center justify-center", children: jsxs("div", { className: "flex flex-col items-center gap-4", children: [jsxs("svg", { className: "animate-spin h-8 w-8 text-muted-foreground", viewBox: "0 0 24 24", children: [jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", fill: "none" }), jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] }), jsx("span", { className: "text-sm text-muted-foreground", children: "Laden..." })] }) }) }) })) : hasRows ? (
|
|
9342
8183
|
// Data Rows
|
|
9343
|
-
table.getRowModel().rows.map((row) => (
|
|
8184
|
+
table.getRowModel().rows.map((row) => (jsx(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (
|
|
9344
8185
|
// Empty State
|
|
9345
|
-
|
|
8186
|
+
jsx(DataTableEmpty, { config: getEmptyState(), colSpan: columns.length })) })] }) }), config.pagination?.enabled && hasRows && (jsx(DataTablePagination, { table: table, config: config.pagination }))] }));
|
|
9346
8187
|
}
|
|
9347
8188
|
|
|
9348
8189
|
const DataTableSchema = (props) => {
|
|
9349
|
-
return (
|
|
8190
|
+
return (jsx("div", { className: "data-table-schema", children: jsx("p", { children: "TableSchema Placeholder" }) }));
|
|
9350
8191
|
};
|
|
9351
8192
|
|
|
9352
8193
|
const AvatarList = ({ items, maxVisible = 5, size = 32, ...props }) => {
|
|
9353
8194
|
const sizeValue = typeof size === "string" ? parseInt(size, 10) || 32 : size;
|
|
9354
|
-
return (
|
|
8195
|
+
return (jsxs("div", { className: "avatar-list", style: { "--avatar-size": `${sizeValue}px` }, ...props, children: [items.slice(0, maxVisible).map((item) => (jsx("div", { className: "avatar-item", children: item.src ? (jsx("img", { src: item.src, alt: item.alt || "Avatar", style: { width: `${sizeValue}px`, height: `${sizeValue}px` } })) : (jsx("div", { className: "avatar-initials", style: { width: `${sizeValue}px`, height: `${sizeValue}px` }, children: item.initials || "?" })) }, item.id))), items.length > maxVisible && (jsxs("div", { className: "avatar-count", style: { width: `${sizeValue}px`, height: `${sizeValue}px` }, children: ["+", items.length - maxVisible] }))] }));
|
|
9355
8196
|
};
|
|
9356
8197
|
|
|
9357
8198
|
class BaseColumn {
|
|
@@ -9496,7 +8337,7 @@ class AvatarGroupColumn extends BaseColumn {
|
|
|
9496
8337
|
const { accessor, label, maxVisible, size, overlap, showTooltip, nameField, srcField, fallbackField, showNames, maxNames, } = config;
|
|
9497
8338
|
return {
|
|
9498
8339
|
accessorKey: accessor,
|
|
9499
|
-
header: () => (
|
|
8340
|
+
header: () => (jsx("span", { className: cn("text-muted-foreground font-medium", this.getAlignmentClass(), this.config.headerClassName), children: label || String(accessor) })),
|
|
9500
8341
|
cell: ({ getValue, row }) => {
|
|
9501
8342
|
const rawValue = getValue();
|
|
9502
8343
|
// Items aus den Daten extrahieren
|
|
@@ -9525,11 +8366,11 @@ class AvatarGroupColumn extends BaseColumn {
|
|
|
9525
8366
|
});
|
|
9526
8367
|
}
|
|
9527
8368
|
if (items.length === 0) {
|
|
9528
|
-
return
|
|
8369
|
+
return jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
9529
8370
|
}
|
|
9530
8371
|
// Konvertiere zu Datenstruktur für AvatarList
|
|
9531
8372
|
const contacts = this.toContactItems(items);
|
|
9532
|
-
return (
|
|
8373
|
+
return (jsx("div", { className: cn("flex items-center", this.config.cellClassName), children: jsx(AvatarList, { items: contacts.map((contact) => ({
|
|
9533
8374
|
id: contact.id,
|
|
9534
8375
|
src: contact.src,
|
|
9535
8376
|
alt: contact.alt,
|
|
@@ -9561,7 +8402,7 @@ const badgeVariants = cva("inline-flex items-center justify-center rounded-full
|
|
|
9561
8402
|
});
|
|
9562
8403
|
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
9563
8404
|
const Comp = asChild ? Slot$2 : "span";
|
|
9564
|
-
return (
|
|
8405
|
+
return (jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
9565
8406
|
}
|
|
9566
8407
|
|
|
9567
8408
|
class BadgeColumn extends BaseColumn {
|
|
@@ -9601,17 +8442,17 @@ class BadgeColumn extends BaseColumn {
|
|
|
9601
8442
|
header: ({ column }) => {
|
|
9602
8443
|
const displayLabel = label || String(accessor);
|
|
9603
8444
|
if (!sortable) {
|
|
9604
|
-
return (
|
|
8445
|
+
return (jsx("span", { className: cn("text-muted-foreground font-medium", this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
9605
8446
|
}
|
|
9606
|
-
return (
|
|
8447
|
+
return (jsxs(Button, { variant: "table_header", size: "table_header", onClick: () => column.toggleSorting(column.getIsSorted() === "asc"), className: cn("text-muted-foreground font-medium", this.getAlignmentClass(), this.config.headerClassName), children: [displayLabel, jsx(ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
9607
8448
|
},
|
|
9608
8449
|
cell: ({ getValue }) => {
|
|
9609
8450
|
const value = String(getValue());
|
|
9610
8451
|
const variantConfig = variants?.[value];
|
|
9611
8452
|
if (!variantConfig) {
|
|
9612
|
-
return (
|
|
8453
|
+
return (jsx(Badge, { variant: "outline", className: this.config.cellClassName, children: value }));
|
|
9613
8454
|
}
|
|
9614
|
-
return (
|
|
8455
|
+
return (jsxs(Badge, { variant: variantConfig.variant === "success" ||
|
|
9615
8456
|
variantConfig.variant === "warning" ||
|
|
9616
8457
|
variantConfig.variant === "info" ||
|
|
9617
8458
|
variantConfig.variant === "muted"
|
|
@@ -9629,13 +8470,13 @@ const ButtonColumn = (config) => {
|
|
|
9629
8470
|
header: config.header || "Button",
|
|
9630
8471
|
cell: ({ row }) => {
|
|
9631
8472
|
const value = row.getValue(accessorKey);
|
|
9632
|
-
return (
|
|
8473
|
+
return (jsx(Button, { onClick: () => config.onClick && config.onClick(row.original), children: value || config.label || "Click" }));
|
|
9633
8474
|
},
|
|
9634
8475
|
};
|
|
9635
8476
|
};
|
|
9636
8477
|
|
|
9637
8478
|
function Checkbox({ className, ...props }) {
|
|
9638
|
-
return (
|
|
8479
|
+
return (jsx(Checkbox$1, { "data-slot": "checkbox", className: className, ...props, children: jsx(CheckboxIndicator, { "data-slot": "checkbox-indicator", className: "[&>svg]:size-3.5 grid place-content-center text-current transition-none", children: jsx(CheckIcon, {}) }) }));
|
|
9639
8480
|
}
|
|
9640
8481
|
|
|
9641
8482
|
class CheckboxColumn {
|
|
@@ -9645,8 +8486,8 @@ class CheckboxColumn {
|
|
|
9645
8486
|
build() {
|
|
9646
8487
|
return {
|
|
9647
8488
|
id: 'select',
|
|
9648
|
-
header: ({ table }) => (
|
|
9649
|
-
cell: ({ row }) => (
|
|
8489
|
+
header: ({ table }) => (jsx(Checkbox, { checked: table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate'), onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value), "aria-label": "Alle ausw\u00E4hlen" })),
|
|
8490
|
+
cell: ({ row }) => (jsx(Checkbox, { checked: row.getIsSelected(), onCheckedChange: (value) => row.toggleSelected(!!value), "aria-label": "Zeile ausw\u00E4hlen" })),
|
|
9650
8491
|
enableSorting: false,
|
|
9651
8492
|
enableHiding: false,
|
|
9652
8493
|
};
|
|
@@ -9732,21 +8573,21 @@ class DateColumn extends BaseColumn {
|
|
|
9732
8573
|
header: ({ column }) => {
|
|
9733
8574
|
const displayLabel = label || String(accessor);
|
|
9734
8575
|
if (!sortable) {
|
|
9735
|
-
return (
|
|
8576
|
+
return (jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
9736
8577
|
}
|
|
9737
|
-
return (
|
|
8578
|
+
return (jsxs(Button, { variant: "table_header", size: "table_header", onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: [displayLabel, jsx(ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
9738
8579
|
},
|
|
9739
8580
|
cell: ({ getValue }) => {
|
|
9740
8581
|
const value = getValue();
|
|
9741
8582
|
if (!value) {
|
|
9742
|
-
return
|
|
8583
|
+
return jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
9743
8584
|
}
|
|
9744
8585
|
const date = value instanceof Date ? value : new Date(value);
|
|
9745
8586
|
if (isNaN(date.getTime())) {
|
|
9746
|
-
return
|
|
8587
|
+
return jsx("span", { className: "text-muted-foreground", children: "Ung\u00FCltiges Datum" });
|
|
9747
8588
|
}
|
|
9748
8589
|
const formatted = this.formatDate(date, format || 'short', locale || 'de-DE');
|
|
9749
|
-
return (
|
|
8590
|
+
return (jsxs("span", { className: cn('flex items-center gap-2', this.getAlignmentClass(), this.config.cellClassName), children: [showIcon && jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), formatted] }));
|
|
9750
8591
|
},
|
|
9751
8592
|
};
|
|
9752
8593
|
}
|
|
@@ -9759,22 +8600,22 @@ const DropdownColumn = (config) => {
|
|
|
9759
8600
|
header: config.header || "Options",
|
|
9760
8601
|
cell: ({ row }) => {
|
|
9761
8602
|
const value = row.getValue(accessorKey);
|
|
9762
|
-
return (
|
|
8603
|
+
return (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button, { variant: "outline", children: value || "Options" }) }), jsx(DropdownMenuContent, { children: config.options.map((option, index) => (jsx(DropdownMenuItem, { onClick: () => option.onClick && option.onClick(row.original), children: option.label }, index))) })] }));
|
|
9763
8604
|
},
|
|
9764
8605
|
};
|
|
9765
8606
|
};
|
|
9766
8607
|
|
|
9767
8608
|
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
9768
|
-
return (
|
|
8609
|
+
return (jsx(Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }));
|
|
9769
8610
|
}
|
|
9770
8611
|
function Tooltip({ ...props }) {
|
|
9771
|
-
return (
|
|
8612
|
+
return (jsx(TooltipProvider, { children: jsx(Root3, { "data-slot": "tooltip", ...props }) }));
|
|
9772
8613
|
}
|
|
9773
8614
|
function TooltipTrigger({ ...props }) {
|
|
9774
|
-
return
|
|
8615
|
+
return jsx(Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
9775
8616
|
}
|
|
9776
8617
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
9777
|
-
return (
|
|
8618
|
+
return (jsx(Portal, { children: jsxs(Content2, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: className, ...props, children: [children, jsx(Arrow2, { className: "size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%_-_2px)]" })] }) }));
|
|
9778
8619
|
}
|
|
9779
8620
|
|
|
9780
8621
|
class IconColumn extends BaseColumn {
|
|
@@ -9944,34 +8785,34 @@ class IconColumn extends BaseColumn {
|
|
|
9944
8785
|
}
|
|
9945
8786
|
// === ICON HELPERS (inline SVGs um Lucide-Abhängigkeit zu vermeiden) ===
|
|
9946
8787
|
createCheckIcon() {
|
|
9947
|
-
return (
|
|
8788
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: jsx("polyline", { points: "20 6 9 17 4 12" }) }));
|
|
9948
8789
|
}
|
|
9949
8790
|
createXIcon() {
|
|
9950
|
-
return (
|
|
8791
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }));
|
|
9951
8792
|
}
|
|
9952
8793
|
createCircleIcon() {
|
|
9953
|
-
return (
|
|
8794
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: jsx("circle", { cx: "12", cy: "12", r: "6" }) }));
|
|
9954
8795
|
}
|
|
9955
8796
|
createArrowUpIcon() {
|
|
9956
|
-
return (
|
|
8797
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [jsx("line", { x1: "12", y1: "19", x2: "12", y2: "5" }), jsx("polyline", { points: "5 12 12 5 19 12" })] }));
|
|
9957
8798
|
}
|
|
9958
8799
|
createArrowDownIcon() {
|
|
9959
|
-
return (
|
|
8800
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), jsx("polyline", { points: "19 12 12 19 5 12" })] }));
|
|
9960
8801
|
}
|
|
9961
8802
|
createMinusIcon() {
|
|
9962
|
-
return (
|
|
8803
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) }));
|
|
9963
8804
|
}
|
|
9964
8805
|
createAlertIcon() {
|
|
9965
|
-
return (
|
|
8806
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }), jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }));
|
|
9966
8807
|
}
|
|
9967
8808
|
createShieldCheckIcon() {
|
|
9968
|
-
return (
|
|
8809
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }), jsx("polyline", { points: "9 12 11 14 15 10" })] }));
|
|
9969
8810
|
}
|
|
9970
8811
|
createShieldXIcon() {
|
|
9971
|
-
return (
|
|
8812
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }), jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }), jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" })] }));
|
|
9972
8813
|
}
|
|
9973
8814
|
createClockIcon() {
|
|
9974
|
-
return (
|
|
8815
|
+
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-full w-full", children: [jsx("circle", { cx: "12", cy: "12", r: "10" }), jsx("polyline", { points: "12 6 12 12 16 14" })] }));
|
|
9975
8816
|
}
|
|
9976
8817
|
build() {
|
|
9977
8818
|
const config = this.config;
|
|
@@ -9999,9 +8840,9 @@ class IconColumn extends BaseColumn {
|
|
|
9999
8840
|
header: ({ column }) => {
|
|
10000
8841
|
const displayLabel = label || String(accessor);
|
|
10001
8842
|
if (!sortable) {
|
|
10002
|
-
return (
|
|
8843
|
+
return (jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10003
8844
|
}
|
|
10004
|
-
return (
|
|
8845
|
+
return (jsxs(Button, { variant: "table_header", size: "table_header", onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: [displayLabel, jsx(ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10005
8846
|
},
|
|
10006
8847
|
cell: ({ getValue }) => {
|
|
10007
8848
|
const value = String(getValue());
|
|
@@ -10013,14 +8854,14 @@ class IconColumn extends BaseColumn {
|
|
|
10013
8854
|
const bgColor = stateConfig?.bgColor;
|
|
10014
8855
|
const tooltip = stateConfig?.tooltip || stateLabel;
|
|
10015
8856
|
if (!icon) {
|
|
10016
|
-
return
|
|
8857
|
+
return jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10017
8858
|
}
|
|
10018
8859
|
// Icon als Element rendern (falls LucideIcon übergeben wurde)
|
|
10019
8860
|
const IconElement = typeof icon === 'function' ? icon : null;
|
|
10020
|
-
const renderedIcon = IconElement ?
|
|
10021
|
-
const iconElement = (
|
|
8861
|
+
const renderedIcon = IconElement ? jsx(IconElement, { className: "h-full w-full" }) : icon;
|
|
8862
|
+
const iconElement = (jsxs("div", { className: cn('flex items-center gap-2', this.getAlignmentClass(), this.config.cellClassName), children: [withBackground ? (jsx("div", { className: cn('inline-flex items-center justify-center rounded-md', bgSizeClasses[size || 'md'], bgColor || 'bg-blue-50'), children: jsx("div", { className: cn(iconInBgSizeClasses[size || 'md'], color), children: renderedIcon }) })) : (jsx("div", { className: cn(sizeClasses[size || 'md'], color), children: renderedIcon })), showLabel && jsx("span", { className: cn('text-sm', color), children: stateLabel })] }));
|
|
10022
8863
|
if (showTooltip) {
|
|
10023
|
-
return (
|
|
8864
|
+
return (jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: iconElement }), jsx(TooltipContent, { children: jsx("p", { children: tooltip }) })] }) }));
|
|
10024
8865
|
}
|
|
10025
8866
|
return iconElement;
|
|
10026
8867
|
},
|
|
@@ -10076,11 +8917,11 @@ class ImageColumn extends BaseColumn {
|
|
|
10076
8917
|
};
|
|
10077
8918
|
return {
|
|
10078
8919
|
accessorKey: accessor,
|
|
10079
|
-
header: () =>
|
|
8920
|
+
header: () => jsx("span", { className: cn('text-muted-foreground font-medium', this.config.headerClassName), children: label || '' }),
|
|
10080
8921
|
cell: ({ getValue, row }) => {
|
|
10081
8922
|
const src = getValue();
|
|
10082
8923
|
const altText = alt ? alt(row.original) : 'Bild';
|
|
10083
|
-
return (
|
|
8924
|
+
return (jsx("img", { src: src || fallback || '/placeholder.png', alt: altText, className: cn('object-cover', sizeClasses[size || 'md'], roundedClasses[rounded || 'md'], this.config.cellClassName), onError: (e) => {
|
|
10084
8925
|
if (fallback) {
|
|
10085
8926
|
e.target.src = fallback;
|
|
10086
8927
|
}
|
|
@@ -10097,7 +8938,7 @@ const InputColumn = (config) => {
|
|
|
10097
8938
|
header: config.header || "Input",
|
|
10098
8939
|
cell: ({ row }) => {
|
|
10099
8940
|
const value = row.getValue(accessorKey);
|
|
10100
|
-
return (
|
|
8941
|
+
return (jsx(Input, { value: value || "", onChange: (e) => config.onChange && config.onChange(row.original, e.target.value), placeholder: config.placeholder || "Enter value" }));
|
|
10101
8942
|
},
|
|
10102
8943
|
};
|
|
10103
8944
|
};
|
|
@@ -10170,14 +9011,14 @@ class LinkColumn extends BaseColumn {
|
|
|
10170
9011
|
header: ({ column }) => {
|
|
10171
9012
|
const displayLabel = label || String(accessor);
|
|
10172
9013
|
if (!sortable) {
|
|
10173
|
-
return (
|
|
9014
|
+
return (jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10174
9015
|
}
|
|
10175
|
-
return (
|
|
9016
|
+
return (jsxs(Button, { variant: "table_header", size: "table_header", onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: [displayLabel, jsx(ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10176
9017
|
},
|
|
10177
9018
|
cell: ({ getValue, row }) => {
|
|
10178
9019
|
const value = getValue();
|
|
10179
9020
|
if (!value) {
|
|
10180
|
-
return
|
|
9021
|
+
return jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10181
9022
|
}
|
|
10182
9023
|
// URL berechnen
|
|
10183
9024
|
const url = typeof href === 'function' ? href(row.original) : href || value;
|
|
@@ -10189,7 +9030,7 @@ class LinkColumn extends BaseColumn {
|
|
|
10189
9030
|
};
|
|
10190
9031
|
// Alignment ohne text-muted-foreground für Links
|
|
10191
9032
|
const alignmentClass = this.config.align === 'center' ? 'text-center' : this.config.align === 'right' ? 'text-right' : 'text-left';
|
|
10192
|
-
return (
|
|
9033
|
+
return (jsxs("a", { href: url, target: openInNewTab ? '_blank' : undefined, rel: openInNewTab ? 'noopener noreferrer' : undefined, onClick: onClick ? handleClick : undefined, className: cn('inline-flex items-center gap-1.5 text-sm text-blue-500', underlineClasses[underline || 'hover'], 'hover:text-blue-500/80', alignmentClass, this.config.cellClassName), children: [icon, jsx("span", { children: value }), showExternalIcon && jsx(ExternalLink, { className: "text-muted-foreground h-3 w-3" })] }));
|
|
10193
9034
|
},
|
|
10194
9035
|
};
|
|
10195
9036
|
}
|
|
@@ -10240,14 +9081,14 @@ class NumberColumn extends BaseColumn {
|
|
|
10240
9081
|
header: ({ column }) => {
|
|
10241
9082
|
const displayLabel = label || String(accessor);
|
|
10242
9083
|
if (!sortable) {
|
|
10243
|
-
return (
|
|
9084
|
+
return (jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10244
9085
|
}
|
|
10245
|
-
return (
|
|
9086
|
+
return (jsxs(Button, { variant: "table_header", size: "table_header", onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: [displayLabel, jsx(ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10246
9087
|
},
|
|
10247
9088
|
cell: ({ getValue }) => {
|
|
10248
9089
|
const value = getValue();
|
|
10249
9090
|
if (value === null || value === undefined) {
|
|
10250
|
-
return
|
|
9091
|
+
return jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10251
9092
|
}
|
|
10252
9093
|
let formatted;
|
|
10253
9094
|
if (currency) {
|
|
@@ -10272,14 +9113,14 @@ class NumberColumn extends BaseColumn {
|
|
|
10272
9113
|
}).format(value);
|
|
10273
9114
|
}
|
|
10274
9115
|
const displayValue = `${prefix || ''}${formatted}${suffix || ''}`;
|
|
10275
|
-
return
|
|
9116
|
+
return jsx("span", { className: cn('tabular-nums', this.getAlignmentClass(), this.config.cellClassName), children: displayValue });
|
|
10276
9117
|
},
|
|
10277
9118
|
};
|
|
10278
9119
|
}
|
|
10279
9120
|
}
|
|
10280
9121
|
|
|
10281
9122
|
function Progress({ className, value, ...props }) {
|
|
10282
|
-
return (
|
|
9123
|
+
return (jsx(Root, { "data-slot": "progress", className: className, ...props, children: jsx(Indicator, { "data-slot": "progress-indicator", className: "bg-primary size-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) }));
|
|
10283
9124
|
}
|
|
10284
9125
|
|
|
10285
9126
|
class ProgressColumn extends BaseColumn {
|
|
@@ -10379,15 +9220,15 @@ class ProgressColumn extends BaseColumn {
|
|
|
10379
9220
|
header: ({ column }) => {
|
|
10380
9221
|
const displayLabel = label || String(accessor);
|
|
10381
9222
|
if (!sortable) {
|
|
10382
|
-
return (
|
|
9223
|
+
return (jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10383
9224
|
}
|
|
10384
|
-
return (
|
|
9225
|
+
return (jsxs(Button, { variant: "table_header", size: "table_header", onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: [displayLabel, jsx(ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10385
9226
|
},
|
|
10386
9227
|
cell: ({ getValue }) => {
|
|
10387
9228
|
const value = getValue();
|
|
10388
9229
|
const maxValue = max || 100;
|
|
10389
9230
|
if (value === null || value === undefined) {
|
|
10390
|
-
return
|
|
9231
|
+
return jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10391
9232
|
}
|
|
10392
9233
|
const percentage = Math.min(100, Math.max(0, (value / maxValue) * 100));
|
|
10393
9234
|
// Farbe berechnen
|
|
@@ -10403,7 +9244,7 @@ class ProgressColumn extends BaseColumn {
|
|
|
10403
9244
|
else if (showPercentage) {
|
|
10404
9245
|
labelText = `${Math.round(percentage)}%`;
|
|
10405
9246
|
}
|
|
10406
|
-
return (
|
|
9247
|
+
return (jsxs("div", { className: cn('flex min-w-[120px] items-center gap-3', this.config.cellClassName), children: [jsx(Progress, { value: percentage, className: cn('flex-1', sizeClasses[size || 'md'], colorClasses[currentColor]) }), labelText && jsx("span", { className: "text-muted-foreground min-w-[3rem] text-right text-sm tabular-nums", children: labelText })] }));
|
|
10407
9248
|
},
|
|
10408
9249
|
};
|
|
10409
9250
|
}
|
|
@@ -10416,7 +9257,7 @@ const SelectColumn = (config) => {
|
|
|
10416
9257
|
header: config.header || "Select",
|
|
10417
9258
|
cell: ({ row }) => {
|
|
10418
9259
|
const value = row.getValue(accessorKey);
|
|
10419
|
-
return (
|
|
9260
|
+
return (jsxs(Select, { value: value || "", onValueChange: (value) => config.onChange && config.onChange(row.original, value), children: [jsx(SelectTrigger, { children: jsx(SelectValue, { placeholder: config.placeholder || "Select an option" }) }), jsx(SelectContent, { children: config.options.map((option, index) => (jsx(SelectItem, { value: option.value, children: option.label }, index))) })] }));
|
|
10420
9261
|
},
|
|
10421
9262
|
};
|
|
10422
9263
|
};
|
|
@@ -10476,9 +9317,9 @@ class TextColumn extends BaseColumn {
|
|
|
10476
9317
|
header: ({ column }) => {
|
|
10477
9318
|
const displayLabel = label || String(accessor);
|
|
10478
9319
|
if (!sortable) {
|
|
10479
|
-
return (
|
|
9320
|
+
return (jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10480
9321
|
}
|
|
10481
|
-
return (
|
|
9322
|
+
return (jsxs(Button, { variant: "table_header", size: "table_header", onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: [displayLabel, jsx(ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10482
9323
|
},
|
|
10483
9324
|
cell: ({ row, getValue }) => {
|
|
10484
9325
|
let value = getValue();
|
|
@@ -10488,11 +9329,11 @@ class TextColumn extends BaseColumn {
|
|
|
10488
9329
|
}
|
|
10489
9330
|
// Placeholder wenn leer
|
|
10490
9331
|
if (value === null || value === undefined || value === '') {
|
|
10491
|
-
return (
|
|
9332
|
+
return (jsx("span", { className: cn('text-muted-foreground', this.getAlignmentClass(), this.config.cellClassName), children: placeholder || '—' }));
|
|
10492
9333
|
}
|
|
10493
9334
|
// Prefix/Suffix hinzufügen
|
|
10494
9335
|
const displayValue = `${prefix || ''}${value}${suffix || ''}`;
|
|
10495
|
-
return
|
|
9336
|
+
return jsx("span", { className: cn(this.getAlignmentClass(), this.config.cellClassName), children: displayValue });
|
|
10496
9337
|
},
|
|
10497
9338
|
};
|
|
10498
9339
|
}
|
|
@@ -10547,20 +9388,20 @@ class ActionsColumn {
|
|
|
10547
9388
|
const { actions, label, triggerIcon } = this.config;
|
|
10548
9389
|
return {
|
|
10549
9390
|
id: 'actions',
|
|
10550
|
-
header: () =>
|
|
9391
|
+
header: () => jsx("span", { className: "sr-only", children: label }),
|
|
10551
9392
|
cell: ({ row }) => {
|
|
10552
9393
|
const data = row.original;
|
|
10553
9394
|
const visibleActions = actions.filter((action) => !action.hidden || !action.hidden(data));
|
|
10554
9395
|
if (visibleActions.length === 0)
|
|
10555
9396
|
return null;
|
|
10556
|
-
return (
|
|
9397
|
+
return (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button, { variant: "ghost", className: "h-10 w-10 p-0", children: [jsx("span", { className: "sr-only", children: label }), triggerIcon || jsx(MoreHorizontal, { className: "h-8 w-8" })] }) }), jsx(DropdownMenuContent, { align: "end", children: visibleActions.map((action, index) => (jsxs("div", { children: [jsxs(DropdownMenuItem, { disabled: action.disabled?.(data), className: cn(action.variant === 'destructive' && 'text-destructive focus:text-destructive'), onClick: () => {
|
|
10557
9398
|
if (action.href) {
|
|
10558
9399
|
window.location.href = action.href(data);
|
|
10559
9400
|
}
|
|
10560
9401
|
else if (action.onClick) {
|
|
10561
9402
|
action.onClick(data);
|
|
10562
9403
|
}
|
|
10563
|
-
}, children: [action.icon &&
|
|
9404
|
+
}, children: [action.icon && jsx("span", { className: "mr-2", children: action.icon }), action.label] }), action.separator && index < visibleActions.length - 1 && jsx(DropdownMenuSeparator, {})] }, index))) })] }));
|
|
10564
9405
|
},
|
|
10565
9406
|
};
|
|
10566
9407
|
}
|