@nccirtu/tablefy 0.1.5 → 0.1.7
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.d.ts +15 -11
- 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/index.d.ts +15 -11
- package/dist/index.esm.js +526 -1588
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +552 -1599
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -1,1420 +1,48 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
3
4
|
var React = require('react');
|
|
4
5
|
var reactTable = require('@tanstack/react-table');
|
|
5
6
|
var lucideReact = require('lucide-react');
|
|
6
7
|
var ReactDOM = require('react-dom');
|
|
7
8
|
|
|
8
9
|
function _interopNamespaceDefault(e) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
17
20
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
26
27
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
|
|
27
28
|
|
|
28
|
-
var jsxRuntime = {exports: {}};
|
|
29
|
-
|
|
30
|
-
var reactJsxRuntime_production_min = {};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @license React
|
|
34
|
-
* react-jsx-runtime.production.min.js
|
|
35
|
-
*
|
|
36
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the MIT license found in the
|
|
39
|
-
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
43
|
-
|
|
44
|
-
function requireReactJsxRuntime_production_min () {
|
|
45
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
46
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
47
|
-
var f=React,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};
|
|
48
|
-
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;
|
|
49
|
-
return reactJsxRuntime_production_min;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var reactJsxRuntime_development = {};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @license React
|
|
56
|
-
* react-jsx-runtime.development.js
|
|
57
|
-
*
|
|
58
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the MIT license found in the
|
|
61
|
-
* LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
var hasRequiredReactJsxRuntime_development;
|
|
65
|
-
|
|
66
|
-
function requireReactJsxRuntime_development () {
|
|
67
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
68
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
69
|
-
|
|
70
|
-
if (process.env.NODE_ENV !== "production") {
|
|
71
|
-
(function() {
|
|
72
|
-
|
|
73
|
-
var React$1 = React;
|
|
74
|
-
|
|
75
|
-
// ATTENTION
|
|
76
|
-
// When adding new symbols to this file,
|
|
77
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
78
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
79
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
80
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
81
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
82
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
83
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
84
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
85
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
86
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
87
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
88
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
89
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
90
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
91
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
92
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
93
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
94
|
-
function getIteratorFn(maybeIterable) {
|
|
95
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
100
|
-
|
|
101
|
-
if (typeof maybeIterator === 'function') {
|
|
102
|
-
return maybeIterator;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
109
|
-
|
|
110
|
-
function error(format) {
|
|
111
|
-
{
|
|
112
|
-
{
|
|
113
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
114
|
-
args[_key2 - 1] = arguments[_key2];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
printWarning('error', format, args);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function printWarning(level, format, args) {
|
|
123
|
-
// When changing this logic, you might want to also
|
|
124
|
-
// update consoleWithStackDev.www.js as well.
|
|
125
|
-
{
|
|
126
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
127
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
128
|
-
|
|
129
|
-
if (stack !== '') {
|
|
130
|
-
format += '%s';
|
|
131
|
-
args = args.concat([stack]);
|
|
132
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var argsWithFormat = args.map(function (item) {
|
|
136
|
-
return String(item);
|
|
137
|
-
}); // Careful: RN currently depends on this prefix
|
|
138
|
-
|
|
139
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
140
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
141
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
142
|
-
|
|
143
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// -----------------------------------------------------------------------------
|
|
148
|
-
|
|
149
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
150
|
-
var enableCacheElement = false;
|
|
151
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
152
|
-
|
|
153
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
154
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
155
|
-
// issues in DEV builds.
|
|
156
|
-
|
|
157
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
158
|
-
|
|
159
|
-
var REACT_MODULE_REFERENCE;
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function isValidElementType(type) {
|
|
166
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
167
|
-
return true;
|
|
168
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
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 ) {
|
|
172
|
-
return true;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
if (typeof type === 'object' && type !== null) {
|
|
176
|
-
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
|
|
177
|
-
// types supported by any Flight configuration anywhere since
|
|
178
|
-
// we don't know which Flight build this will end up being used
|
|
179
|
-
// with.
|
|
180
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
189
|
-
var displayName = outerType.displayName;
|
|
190
|
-
|
|
191
|
-
if (displayName) {
|
|
192
|
-
return displayName;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
196
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
197
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
function getContextName(type) {
|
|
201
|
-
return type.displayName || 'Context';
|
|
202
|
-
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
function getComponentNameFromType(type) {
|
|
206
|
-
if (type == null) {
|
|
207
|
-
// Host root, text node or just invalid type.
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
{
|
|
212
|
-
if (typeof type.tag === 'number') {
|
|
213
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (typeof type === 'function') {
|
|
218
|
-
return type.displayName || type.name || null;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (typeof type === 'string') {
|
|
222
|
-
return type;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
switch (type) {
|
|
226
|
-
case REACT_FRAGMENT_TYPE:
|
|
227
|
-
return 'Fragment';
|
|
228
|
-
|
|
229
|
-
case REACT_PORTAL_TYPE:
|
|
230
|
-
return 'Portal';
|
|
231
|
-
|
|
232
|
-
case REACT_PROFILER_TYPE:
|
|
233
|
-
return 'Profiler';
|
|
234
|
-
|
|
235
|
-
case REACT_STRICT_MODE_TYPE:
|
|
236
|
-
return 'StrictMode';
|
|
237
|
-
|
|
238
|
-
case REACT_SUSPENSE_TYPE:
|
|
239
|
-
return 'Suspense';
|
|
240
|
-
|
|
241
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
242
|
-
return 'SuspenseList';
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (typeof type === 'object') {
|
|
247
|
-
switch (type.$$typeof) {
|
|
248
|
-
case REACT_CONTEXT_TYPE:
|
|
249
|
-
var context = type;
|
|
250
|
-
return getContextName(context) + '.Consumer';
|
|
251
|
-
|
|
252
|
-
case REACT_PROVIDER_TYPE:
|
|
253
|
-
var provider = type;
|
|
254
|
-
return getContextName(provider._context) + '.Provider';
|
|
255
|
-
|
|
256
|
-
case REACT_FORWARD_REF_TYPE:
|
|
257
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
258
|
-
|
|
259
|
-
case REACT_MEMO_TYPE:
|
|
260
|
-
var outerName = type.displayName || null;
|
|
261
|
-
|
|
262
|
-
if (outerName !== null) {
|
|
263
|
-
return outerName;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
267
|
-
|
|
268
|
-
case REACT_LAZY_TYPE:
|
|
269
|
-
{
|
|
270
|
-
var lazyComponent = type;
|
|
271
|
-
var payload = lazyComponent._payload;
|
|
272
|
-
var init = lazyComponent._init;
|
|
273
|
-
|
|
274
|
-
try {
|
|
275
|
-
return getComponentNameFromType(init(payload));
|
|
276
|
-
} catch (x) {
|
|
277
|
-
return null;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// eslint-disable-next-line no-fallthrough
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
return null;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
var assign = Object.assign;
|
|
289
|
-
|
|
290
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
291
|
-
// replaying on render function. This currently only patches the object
|
|
292
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
293
|
-
// We could also eagerly patch the method.
|
|
294
|
-
var disabledDepth = 0;
|
|
295
|
-
var prevLog;
|
|
296
|
-
var prevInfo;
|
|
297
|
-
var prevWarn;
|
|
298
|
-
var prevError;
|
|
299
|
-
var prevGroup;
|
|
300
|
-
var prevGroupCollapsed;
|
|
301
|
-
var prevGroupEnd;
|
|
302
|
-
|
|
303
|
-
function disabledLog() {}
|
|
304
|
-
|
|
305
|
-
disabledLog.__reactDisabledLog = true;
|
|
306
|
-
function disableLogs() {
|
|
307
|
-
{
|
|
308
|
-
if (disabledDepth === 0) {
|
|
309
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
310
|
-
prevLog = console.log;
|
|
311
|
-
prevInfo = console.info;
|
|
312
|
-
prevWarn = console.warn;
|
|
313
|
-
prevError = console.error;
|
|
314
|
-
prevGroup = console.group;
|
|
315
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
316
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
317
|
-
|
|
318
|
-
var props = {
|
|
319
|
-
configurable: true,
|
|
320
|
-
enumerable: true,
|
|
321
|
-
value: disabledLog,
|
|
322
|
-
writable: true
|
|
323
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
324
|
-
|
|
325
|
-
Object.defineProperties(console, {
|
|
326
|
-
info: props,
|
|
327
|
-
log: props,
|
|
328
|
-
warn: props,
|
|
329
|
-
error: props,
|
|
330
|
-
group: props,
|
|
331
|
-
groupCollapsed: props,
|
|
332
|
-
groupEnd: props
|
|
333
|
-
});
|
|
334
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
disabledDepth++;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
function reenableLogs() {
|
|
341
|
-
{
|
|
342
|
-
disabledDepth--;
|
|
343
|
-
|
|
344
|
-
if (disabledDepth === 0) {
|
|
345
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
346
|
-
var props = {
|
|
347
|
-
configurable: true,
|
|
348
|
-
enumerable: true,
|
|
349
|
-
writable: true
|
|
350
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
351
|
-
|
|
352
|
-
Object.defineProperties(console, {
|
|
353
|
-
log: assign({}, props, {
|
|
354
|
-
value: prevLog
|
|
355
|
-
}),
|
|
356
|
-
info: assign({}, props, {
|
|
357
|
-
value: prevInfo
|
|
358
|
-
}),
|
|
359
|
-
warn: assign({}, props, {
|
|
360
|
-
value: prevWarn
|
|
361
|
-
}),
|
|
362
|
-
error: assign({}, props, {
|
|
363
|
-
value: prevError
|
|
364
|
-
}),
|
|
365
|
-
group: assign({}, props, {
|
|
366
|
-
value: prevGroup
|
|
367
|
-
}),
|
|
368
|
-
groupCollapsed: assign({}, props, {
|
|
369
|
-
value: prevGroupCollapsed
|
|
370
|
-
}),
|
|
371
|
-
groupEnd: assign({}, props, {
|
|
372
|
-
value: prevGroupEnd
|
|
373
|
-
})
|
|
374
|
-
});
|
|
375
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
if (disabledDepth < 0) {
|
|
379
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
385
|
-
var prefix;
|
|
386
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
387
|
-
{
|
|
388
|
-
if (prefix === undefined) {
|
|
389
|
-
// Extract the VM specific prefix used by each line.
|
|
390
|
-
try {
|
|
391
|
-
throw Error();
|
|
392
|
-
} catch (x) {
|
|
393
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
394
|
-
prefix = match && match[1] || '';
|
|
395
|
-
}
|
|
396
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
return '\n' + prefix + name;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
var reentry = false;
|
|
403
|
-
var componentFrameCache;
|
|
404
|
-
|
|
405
|
-
{
|
|
406
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
407
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
411
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
412
|
-
if ( !fn || reentry) {
|
|
413
|
-
return '';
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
{
|
|
417
|
-
var frame = componentFrameCache.get(fn);
|
|
418
|
-
|
|
419
|
-
if (frame !== undefined) {
|
|
420
|
-
return frame;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
var control;
|
|
425
|
-
reentry = true;
|
|
426
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
427
|
-
|
|
428
|
-
Error.prepareStackTrace = undefined;
|
|
429
|
-
var previousDispatcher;
|
|
430
|
-
|
|
431
|
-
{
|
|
432
|
-
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
433
|
-
// for warnings.
|
|
434
|
-
|
|
435
|
-
ReactCurrentDispatcher.current = null;
|
|
436
|
-
disableLogs();
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
try {
|
|
440
|
-
// This should throw.
|
|
441
|
-
if (construct) {
|
|
442
|
-
// Something should be setting the props in the constructor.
|
|
443
|
-
var Fake = function () {
|
|
444
|
-
throw Error();
|
|
445
|
-
}; // $FlowFixMe
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
449
|
-
set: function () {
|
|
450
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
451
|
-
// because that won't throw in a non-strict mode function.
|
|
452
|
-
throw Error();
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
|
|
456
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
457
|
-
// We construct a different control for this case to include any extra
|
|
458
|
-
// frames added by the construct call.
|
|
459
|
-
try {
|
|
460
|
-
Reflect.construct(Fake, []);
|
|
461
|
-
} catch (x) {
|
|
462
|
-
control = x;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
Reflect.construct(fn, [], Fake);
|
|
466
|
-
} else {
|
|
467
|
-
try {
|
|
468
|
-
Fake.call();
|
|
469
|
-
} catch (x) {
|
|
470
|
-
control = x;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
fn.call(Fake.prototype);
|
|
474
|
-
}
|
|
475
|
-
} else {
|
|
476
|
-
try {
|
|
477
|
-
throw Error();
|
|
478
|
-
} catch (x) {
|
|
479
|
-
control = x;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
fn();
|
|
483
|
-
}
|
|
484
|
-
} catch (sample) {
|
|
485
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
486
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
487
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
488
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
489
|
-
var sampleLines = sample.stack.split('\n');
|
|
490
|
-
var controlLines = control.stack.split('\n');
|
|
491
|
-
var s = sampleLines.length - 1;
|
|
492
|
-
var c = controlLines.length - 1;
|
|
493
|
-
|
|
494
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
495
|
-
// We expect at least one stack frame to be shared.
|
|
496
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
497
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
498
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
499
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
500
|
-
// the sample somewhere in the control.
|
|
501
|
-
c--;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
505
|
-
// Next we find the first one that isn't the same which should be the
|
|
506
|
-
// frame that called our sample function and the control.
|
|
507
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
508
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
509
|
-
// If we're about to return the first line, and the control is also on the same
|
|
510
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
511
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
512
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
513
|
-
if (s !== 1 || c !== 1) {
|
|
514
|
-
do {
|
|
515
|
-
s--;
|
|
516
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
517
|
-
// The next one that isn't the same should be our match though.
|
|
518
|
-
|
|
519
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
520
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
521
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
522
|
-
// but we have a user-provided "displayName"
|
|
523
|
-
// splice it in to make the stack more readable.
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
527
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
{
|
|
531
|
-
if (typeof fn === 'function') {
|
|
532
|
-
componentFrameCache.set(fn, _frame);
|
|
533
|
-
}
|
|
534
|
-
} // Return the line we found.
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
return _frame;
|
|
538
|
-
}
|
|
539
|
-
} while (s >= 1 && c >= 0);
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
break;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
} finally {
|
|
547
|
-
reentry = false;
|
|
548
|
-
|
|
549
|
-
{
|
|
550
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
551
|
-
reenableLogs();
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
555
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
559
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
560
|
-
|
|
561
|
-
{
|
|
562
|
-
if (typeof fn === 'function') {
|
|
563
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
return syntheticFrame;
|
|
568
|
-
}
|
|
569
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
570
|
-
{
|
|
571
|
-
return describeNativeComponentFrame(fn, false);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
function shouldConstruct(Component) {
|
|
576
|
-
var prototype = Component.prototype;
|
|
577
|
-
return !!(prototype && prototype.isReactComponent);
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
581
|
-
|
|
582
|
-
if (type == null) {
|
|
583
|
-
return '';
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
if (typeof type === 'function') {
|
|
587
|
-
{
|
|
588
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
if (typeof type === 'string') {
|
|
593
|
-
return describeBuiltInComponentFrame(type);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
switch (type) {
|
|
597
|
-
case REACT_SUSPENSE_TYPE:
|
|
598
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
599
|
-
|
|
600
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
601
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
if (typeof type === 'object') {
|
|
605
|
-
switch (type.$$typeof) {
|
|
606
|
-
case REACT_FORWARD_REF_TYPE:
|
|
607
|
-
return describeFunctionComponentFrame(type.render);
|
|
608
|
-
|
|
609
|
-
case REACT_MEMO_TYPE:
|
|
610
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
611
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
612
|
-
|
|
613
|
-
case REACT_LAZY_TYPE:
|
|
614
|
-
{
|
|
615
|
-
var lazyComponent = type;
|
|
616
|
-
var payload = lazyComponent._payload;
|
|
617
|
-
var init = lazyComponent._init;
|
|
618
|
-
|
|
619
|
-
try {
|
|
620
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
621
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
622
|
-
} catch (x) {}
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
return '';
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
631
|
-
|
|
632
|
-
var loggedTypeFailures = {};
|
|
633
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
634
|
-
|
|
635
|
-
function setCurrentlyValidatingElement(element) {
|
|
636
|
-
{
|
|
637
|
-
if (element) {
|
|
638
|
-
var owner = element._owner;
|
|
639
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
640
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
641
|
-
} else {
|
|
642
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
648
|
-
{
|
|
649
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
650
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
651
|
-
|
|
652
|
-
for (var typeSpecName in typeSpecs) {
|
|
653
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
654
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
655
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
656
|
-
// After these have been cleaned up, we'll let them throw.
|
|
657
|
-
|
|
658
|
-
try {
|
|
659
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
660
|
-
// behavior as without this statement except with a better message.
|
|
661
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
662
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
663
|
-
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`.');
|
|
664
|
-
err.name = 'Invariant Violation';
|
|
665
|
-
throw err;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
669
|
-
} catch (ex) {
|
|
670
|
-
error$1 = ex;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
674
|
-
setCurrentlyValidatingElement(element);
|
|
675
|
-
|
|
676
|
-
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);
|
|
677
|
-
|
|
678
|
-
setCurrentlyValidatingElement(null);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
682
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
683
|
-
// same error.
|
|
684
|
-
loggedTypeFailures[error$1.message] = true;
|
|
685
|
-
setCurrentlyValidatingElement(element);
|
|
686
|
-
|
|
687
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
688
|
-
|
|
689
|
-
setCurrentlyValidatingElement(null);
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
697
|
-
|
|
698
|
-
function isArray(a) {
|
|
699
|
-
return isArrayImpl(a);
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
/*
|
|
703
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
704
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
705
|
-
*
|
|
706
|
-
* The functions in this module will throw an easier-to-understand,
|
|
707
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
708
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
709
|
-
* of the `value` object).
|
|
710
|
-
*/
|
|
711
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
712
|
-
function typeName(value) {
|
|
713
|
-
{
|
|
714
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
715
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
716
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
717
|
-
return type;
|
|
718
|
-
}
|
|
719
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
function willCoercionThrow(value) {
|
|
723
|
-
{
|
|
724
|
-
try {
|
|
725
|
-
testStringCoercion(value);
|
|
726
|
-
return false;
|
|
727
|
-
} catch (e) {
|
|
728
|
-
return true;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
function testStringCoercion(value) {
|
|
734
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
735
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
736
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
737
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
738
|
-
//
|
|
739
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
740
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
741
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
742
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
743
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
744
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
745
|
-
//
|
|
746
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
747
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
748
|
-
//
|
|
749
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
750
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
751
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
752
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
753
|
-
// In most cases, this console output also shows the component and its
|
|
754
|
-
// ancestor components where the exception happened.
|
|
755
|
-
//
|
|
756
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
757
|
-
return '' + value;
|
|
758
|
-
}
|
|
759
|
-
function checkKeyStringCoercion(value) {
|
|
760
|
-
{
|
|
761
|
-
if (willCoercionThrow(value)) {
|
|
762
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
763
|
-
|
|
764
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
770
|
-
var RESERVED_PROPS = {
|
|
771
|
-
key: true,
|
|
772
|
-
ref: true,
|
|
773
|
-
__self: true,
|
|
774
|
-
__source: true
|
|
775
|
-
};
|
|
776
|
-
var specialPropKeyWarningShown;
|
|
777
|
-
var specialPropRefWarningShown;
|
|
778
|
-
var didWarnAboutStringRefs;
|
|
779
|
-
|
|
780
|
-
{
|
|
781
|
-
didWarnAboutStringRefs = {};
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
function hasValidRef(config) {
|
|
785
|
-
{
|
|
786
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
787
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
788
|
-
|
|
789
|
-
if (getter && getter.isReactWarning) {
|
|
790
|
-
return false;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
return config.ref !== undefined;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
function hasValidKey(config) {
|
|
799
|
-
{
|
|
800
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
801
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
802
|
-
|
|
803
|
-
if (getter && getter.isReactWarning) {
|
|
804
|
-
return false;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
return config.key !== undefined;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
813
|
-
{
|
|
814
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
815
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
816
|
-
|
|
817
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
818
|
-
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);
|
|
819
|
-
|
|
820
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
827
|
-
{
|
|
828
|
-
var warnAboutAccessingKey = function () {
|
|
829
|
-
if (!specialPropKeyWarningShown) {
|
|
830
|
-
specialPropKeyWarningShown = true;
|
|
831
|
-
|
|
832
|
-
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);
|
|
833
|
-
}
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
837
|
-
Object.defineProperty(props, 'key', {
|
|
838
|
-
get: warnAboutAccessingKey,
|
|
839
|
-
configurable: true
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
845
|
-
{
|
|
846
|
-
var warnAboutAccessingRef = function () {
|
|
847
|
-
if (!specialPropRefWarningShown) {
|
|
848
|
-
specialPropRefWarningShown = true;
|
|
849
|
-
|
|
850
|
-
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);
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
855
|
-
Object.defineProperty(props, 'ref', {
|
|
856
|
-
get: warnAboutAccessingRef,
|
|
857
|
-
configurable: true
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
863
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
864
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
865
|
-
* if something is a React Element.
|
|
866
|
-
*
|
|
867
|
-
* @param {*} type
|
|
868
|
-
* @param {*} props
|
|
869
|
-
* @param {*} key
|
|
870
|
-
* @param {string|object} ref
|
|
871
|
-
* @param {*} owner
|
|
872
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
873
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
874
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
875
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
876
|
-
* change in behavior.
|
|
877
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
878
|
-
* indicating filename, line number, and/or other information.
|
|
879
|
-
* @internal
|
|
880
|
-
*/
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
884
|
-
var element = {
|
|
885
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
886
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
887
|
-
// Built-in properties that belong on the element
|
|
888
|
-
type: type,
|
|
889
|
-
key: key,
|
|
890
|
-
ref: ref,
|
|
891
|
-
props: props,
|
|
892
|
-
// Record the component responsible for creating this element.
|
|
893
|
-
_owner: owner
|
|
894
|
-
};
|
|
895
|
-
|
|
896
|
-
{
|
|
897
|
-
// The validation flag is currently mutative. We put it on
|
|
898
|
-
// an external backing store so that we can freeze the whole object.
|
|
899
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
900
|
-
// commonly used development environments.
|
|
901
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
902
|
-
// the validation flag non-enumerable (where possible, which should
|
|
903
|
-
// include every environment we run tests in), so the test framework
|
|
904
|
-
// ignores it.
|
|
905
|
-
|
|
906
|
-
Object.defineProperty(element._store, 'validated', {
|
|
907
|
-
configurable: false,
|
|
908
|
-
enumerable: false,
|
|
909
|
-
writable: true,
|
|
910
|
-
value: false
|
|
911
|
-
}); // self and source are DEV only properties.
|
|
912
|
-
|
|
913
|
-
Object.defineProperty(element, '_self', {
|
|
914
|
-
configurable: false,
|
|
915
|
-
enumerable: false,
|
|
916
|
-
writable: false,
|
|
917
|
-
value: self
|
|
918
|
-
}); // Two elements created in two different places should be considered
|
|
919
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
920
|
-
|
|
921
|
-
Object.defineProperty(element, '_source', {
|
|
922
|
-
configurable: false,
|
|
923
|
-
enumerable: false,
|
|
924
|
-
writable: false,
|
|
925
|
-
value: source
|
|
926
|
-
});
|
|
927
|
-
|
|
928
|
-
if (Object.freeze) {
|
|
929
|
-
Object.freeze(element.props);
|
|
930
|
-
Object.freeze(element);
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
return element;
|
|
935
|
-
};
|
|
936
|
-
/**
|
|
937
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
938
|
-
* @param {*} type
|
|
939
|
-
* @param {object} props
|
|
940
|
-
* @param {string} key
|
|
941
|
-
*/
|
|
942
|
-
|
|
943
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
944
|
-
{
|
|
945
|
-
var propName; // Reserved names are extracted
|
|
946
|
-
|
|
947
|
-
var props = {};
|
|
948
|
-
var key = null;
|
|
949
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
950
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
951
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
952
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
953
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
954
|
-
// key is explicitly declared to be undefined or not.
|
|
955
|
-
|
|
956
|
-
if (maybeKey !== undefined) {
|
|
957
|
-
{
|
|
958
|
-
checkKeyStringCoercion(maybeKey);
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
key = '' + maybeKey;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
if (hasValidKey(config)) {
|
|
965
|
-
{
|
|
966
|
-
checkKeyStringCoercion(config.key);
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
key = '' + config.key;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
if (hasValidRef(config)) {
|
|
973
|
-
ref = config.ref;
|
|
974
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
975
|
-
} // Remaining properties are added to a new props object
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
for (propName in config) {
|
|
979
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
980
|
-
props[propName] = config[propName];
|
|
981
|
-
}
|
|
982
|
-
} // Resolve default props
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
if (type && type.defaultProps) {
|
|
986
|
-
var defaultProps = type.defaultProps;
|
|
987
|
-
|
|
988
|
-
for (propName in defaultProps) {
|
|
989
|
-
if (props[propName] === undefined) {
|
|
990
|
-
props[propName] = defaultProps[propName];
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
if (key || ref) {
|
|
996
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
997
|
-
|
|
998
|
-
if (key) {
|
|
999
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
if (ref) {
|
|
1003
|
-
defineRefPropWarningGetter(props, displayName);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
1012
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1013
|
-
|
|
1014
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
1015
|
-
{
|
|
1016
|
-
if (element) {
|
|
1017
|
-
var owner = element._owner;
|
|
1018
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1019
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1020
|
-
} else {
|
|
1021
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
var propTypesMisspellWarningShown;
|
|
1027
|
-
|
|
1028
|
-
{
|
|
1029
|
-
propTypesMisspellWarningShown = false;
|
|
1030
|
-
}
|
|
1031
|
-
/**
|
|
1032
|
-
* Verifies the object is a ReactElement.
|
|
1033
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1034
|
-
* @param {?object} object
|
|
1035
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
1036
|
-
* @final
|
|
1037
|
-
*/
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
function isValidElement(object) {
|
|
1041
|
-
{
|
|
1042
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
function getDeclarationErrorAddendum() {
|
|
1047
|
-
{
|
|
1048
|
-
if (ReactCurrentOwner$1.current) {
|
|
1049
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1050
|
-
|
|
1051
|
-
if (name) {
|
|
1052
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
return '';
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1061
|
-
{
|
|
1062
|
-
if (source !== undefined) {
|
|
1063
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1064
|
-
var lineNumber = source.lineNumber;
|
|
1065
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
return '';
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
/**
|
|
1072
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1073
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
1074
|
-
* updates.
|
|
1075
|
-
*/
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
var ownerHasKeyUseWarning = {};
|
|
1079
|
-
|
|
1080
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1081
|
-
{
|
|
1082
|
-
var info = getDeclarationErrorAddendum();
|
|
1083
|
-
|
|
1084
|
-
if (!info) {
|
|
1085
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1086
|
-
|
|
1087
|
-
if (parentName) {
|
|
1088
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
return info;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
/**
|
|
1096
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1097
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1098
|
-
* reordered. All children that haven't already been validated are required to
|
|
1099
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1100
|
-
* will only be shown once.
|
|
1101
|
-
*
|
|
1102
|
-
* @internal
|
|
1103
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1104
|
-
* @param {*} parentType element's parent's type.
|
|
1105
|
-
*/
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
function validateExplicitKey(element, parentType) {
|
|
1109
|
-
{
|
|
1110
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1111
|
-
return;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
element._store.validated = true;
|
|
1115
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1116
|
-
|
|
1117
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1118
|
-
return;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1122
|
-
// property, it may be the creator of the child that's responsible for
|
|
1123
|
-
// assigning it a key.
|
|
1124
|
-
|
|
1125
|
-
var childOwner = '';
|
|
1126
|
-
|
|
1127
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1128
|
-
// Give the component that originally created this child.
|
|
1129
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
setCurrentlyValidatingElement$1(element);
|
|
1133
|
-
|
|
1134
|
-
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);
|
|
1135
|
-
|
|
1136
|
-
setCurrentlyValidatingElement$1(null);
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
/**
|
|
1140
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1141
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1142
|
-
* with valid key property.
|
|
1143
|
-
*
|
|
1144
|
-
* @internal
|
|
1145
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1146
|
-
* @param {*} parentType node's parent's type.
|
|
1147
|
-
*/
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
function validateChildKeys(node, parentType) {
|
|
1151
|
-
{
|
|
1152
|
-
if (typeof node !== 'object') {
|
|
1153
|
-
return;
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
if (isArray(node)) {
|
|
1157
|
-
for (var i = 0; i < node.length; i++) {
|
|
1158
|
-
var child = node[i];
|
|
1159
|
-
|
|
1160
|
-
if (isValidElement(child)) {
|
|
1161
|
-
validateExplicitKey(child, parentType);
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
} else if (isValidElement(node)) {
|
|
1165
|
-
// This element was passed in a valid location.
|
|
1166
|
-
if (node._store) {
|
|
1167
|
-
node._store.validated = true;
|
|
1168
|
-
}
|
|
1169
|
-
} else if (node) {
|
|
1170
|
-
var iteratorFn = getIteratorFn(node);
|
|
1171
|
-
|
|
1172
|
-
if (typeof iteratorFn === 'function') {
|
|
1173
|
-
// Entry iterators used to provide implicit keys,
|
|
1174
|
-
// but now we print a separate warning for them later.
|
|
1175
|
-
if (iteratorFn !== node.entries) {
|
|
1176
|
-
var iterator = iteratorFn.call(node);
|
|
1177
|
-
var step;
|
|
1178
|
-
|
|
1179
|
-
while (!(step = iterator.next()).done) {
|
|
1180
|
-
if (isValidElement(step.value)) {
|
|
1181
|
-
validateExplicitKey(step.value, parentType);
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
1191
|
-
* provided by the type.
|
|
1192
|
-
*
|
|
1193
|
-
* @param {ReactElement} element
|
|
1194
|
-
*/
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
function validatePropTypes(element) {
|
|
1198
|
-
{
|
|
1199
|
-
var type = element.type;
|
|
1200
|
-
|
|
1201
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
1202
|
-
return;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
var propTypes;
|
|
1206
|
-
|
|
1207
|
-
if (typeof type === 'function') {
|
|
1208
|
-
propTypes = type.propTypes;
|
|
1209
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1210
|
-
// Inner props are checked in the reconciler.
|
|
1211
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1212
|
-
propTypes = type.propTypes;
|
|
1213
|
-
} else {
|
|
1214
|
-
return;
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
if (propTypes) {
|
|
1218
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
1219
|
-
var name = getComponentNameFromType(type);
|
|
1220
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1221
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1222
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1223
|
-
|
|
1224
|
-
var _name = getComponentNameFromType(type);
|
|
1225
|
-
|
|
1226
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1230
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
/**
|
|
1235
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
1236
|
-
* @param {ReactElement} fragment
|
|
1237
|
-
*/
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
function validateFragmentProps(fragment) {
|
|
1241
|
-
{
|
|
1242
|
-
var keys = Object.keys(fragment.props);
|
|
1243
|
-
|
|
1244
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1245
|
-
var key = keys[i];
|
|
1246
|
-
|
|
1247
|
-
if (key !== 'children' && key !== 'key') {
|
|
1248
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1249
|
-
|
|
1250
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1251
|
-
|
|
1252
|
-
setCurrentlyValidatingElement$1(null);
|
|
1253
|
-
break;
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
if (fragment.ref !== null) {
|
|
1258
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1259
|
-
|
|
1260
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1261
|
-
|
|
1262
|
-
setCurrentlyValidatingElement$1(null);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
var didWarnAboutKeySpread = {};
|
|
1268
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1269
|
-
{
|
|
1270
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1271
|
-
// succeed and there will likely be errors in render.
|
|
1272
|
-
|
|
1273
|
-
if (!validType) {
|
|
1274
|
-
var info = '';
|
|
1275
|
-
|
|
1276
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1277
|
-
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.";
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1281
|
-
|
|
1282
|
-
if (sourceInfo) {
|
|
1283
|
-
info += sourceInfo;
|
|
1284
|
-
} else {
|
|
1285
|
-
info += getDeclarationErrorAddendum();
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
var typeString;
|
|
1289
|
-
|
|
1290
|
-
if (type === null) {
|
|
1291
|
-
typeString = 'null';
|
|
1292
|
-
} else if (isArray(type)) {
|
|
1293
|
-
typeString = 'array';
|
|
1294
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1295
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1296
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1297
|
-
} else {
|
|
1298
|
-
typeString = typeof type;
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
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);
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1305
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1306
|
-
|
|
1307
|
-
if (element == null) {
|
|
1308
|
-
return element;
|
|
1309
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1310
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1311
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
1312
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1313
|
-
// fixed, the key warnings will appear.)
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
if (validType) {
|
|
1317
|
-
var children = props.children;
|
|
1318
|
-
|
|
1319
|
-
if (children !== undefined) {
|
|
1320
|
-
if (isStaticChildren) {
|
|
1321
|
-
if (isArray(children)) {
|
|
1322
|
-
for (var i = 0; i < children.length; i++) {
|
|
1323
|
-
validateChildKeys(children[i], type);
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
if (Object.freeze) {
|
|
1327
|
-
Object.freeze(children);
|
|
1328
|
-
}
|
|
1329
|
-
} else {
|
|
1330
|
-
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.');
|
|
1331
|
-
}
|
|
1332
|
-
} else {
|
|
1333
|
-
validateChildKeys(children, type);
|
|
1334
|
-
}
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
{
|
|
1339
|
-
if (hasOwnProperty.call(props, 'key')) {
|
|
1340
|
-
var componentName = getComponentNameFromType(type);
|
|
1341
|
-
var keys = Object.keys(props).filter(function (k) {
|
|
1342
|
-
return k !== 'key';
|
|
1343
|
-
});
|
|
1344
|
-
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
1345
|
-
|
|
1346
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
1347
|
-
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
1348
|
-
|
|
1349
|
-
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);
|
|
1350
|
-
|
|
1351
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1357
|
-
validateFragmentProps(element);
|
|
1358
|
-
} else {
|
|
1359
|
-
validatePropTypes(element);
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
return element;
|
|
1363
|
-
}
|
|
1364
|
-
} // These two functions exist to still get child warnings in dev
|
|
1365
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
1366
|
-
// opt-in behavior for better messages but that we won't stop
|
|
1367
|
-
// giving you warnings if you use production apis.
|
|
1368
|
-
|
|
1369
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
1370
|
-
{
|
|
1371
|
-
return jsxWithValidation(type, props, key, true);
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
1375
|
-
{
|
|
1376
|
-
return jsxWithValidation(type, props, key, false);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1381
|
-
// for now we can ship identical prod functions
|
|
1382
|
-
|
|
1383
|
-
var jsxs = jsxWithValidationStatic ;
|
|
1384
|
-
|
|
1385
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1386
|
-
reactJsxRuntime_development.jsx = jsx;
|
|
1387
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
1388
|
-
})();
|
|
1389
|
-
}
|
|
1390
|
-
return reactJsxRuntime_development;
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1394
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
1395
|
-
} else {
|
|
1396
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
1400
|
-
|
|
1401
29
|
function Table({ className, ...props }) {
|
|
1402
|
-
return (
|
|
30
|
+
return (jsxRuntime.jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: jsxRuntime.jsx("table", { "data-slot": "table", className: className, ...props }) }));
|
|
1403
31
|
}
|
|
1404
32
|
function TableHeader({ className, ...props }) {
|
|
1405
|
-
return
|
|
33
|
+
return jsxRuntime.jsx("thead", { "data-slot": "table-header", className: className, ...props });
|
|
1406
34
|
}
|
|
1407
35
|
function TableBody({ className, ...props }) {
|
|
1408
|
-
return
|
|
36
|
+
return jsxRuntime.jsx("tbody", { "data-slot": "table-body", className: className, ...props });
|
|
1409
37
|
}
|
|
1410
38
|
function TableRow({ className, ...props }) {
|
|
1411
|
-
return
|
|
39
|
+
return jsxRuntime.jsx("tr", { "data-slot": "table-row", className: className, ...props });
|
|
1412
40
|
}
|
|
1413
41
|
function TableHead({ className, ...props }) {
|
|
1414
|
-
return
|
|
42
|
+
return jsxRuntime.jsx("th", { "data-slot": "table-head", className: className, ...props });
|
|
1415
43
|
}
|
|
1416
44
|
function TableCell({ className, ...props }) {
|
|
1417
|
-
return
|
|
45
|
+
return jsxRuntime.jsx("td", { "data-slot": "table-cell", className: className, ...props });
|
|
1418
46
|
}
|
|
1419
47
|
|
|
1420
48
|
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}
|
|
@@ -1518,9 +146,9 @@ function createSlot(ownerName) {
|
|
|
1518
146
|
return child;
|
|
1519
147
|
}
|
|
1520
148
|
});
|
|
1521
|
-
return /* @__PURE__ */
|
|
149
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React__namespace.isValidElement(newElement) ? React__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
1522
150
|
}
|
|
1523
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
1524
152
|
});
|
|
1525
153
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
1526
154
|
return Slot2;
|
|
@@ -1547,7 +175,7 @@ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
|
1547
175
|
// @__NO_SIDE_EFFECTS__
|
|
1548
176
|
function createSlottable(ownerName) {
|
|
1549
177
|
const Slottable2 = ({ children }) => {
|
|
1550
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
1551
179
|
};
|
|
1552
180
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
1553
181
|
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
@@ -1622,7 +250,7 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
1622
250
|
if (typeof window !== "undefined") {
|
|
1623
251
|
window[Symbol.for("radix-ui")] = true;
|
|
1624
252
|
}
|
|
1625
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
1626
254
|
});
|
|
1627
255
|
Node.displayName = `Primitive.${node}`;
|
|
1628
256
|
return { ...primitive, [node]: Node };
|
|
@@ -1648,7 +276,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
1648
276
|
var NAME$1 = "VisuallyHidden";
|
|
1649
277
|
var VisuallyHidden = React__namespace.forwardRef(
|
|
1650
278
|
(props, forwardedRef) => {
|
|
1651
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1652
280
|
Primitive.span,
|
|
1653
281
|
{
|
|
1654
282
|
...props,
|
|
@@ -1672,7 +300,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
1672
300
|
const { scope, children, ...context } = props;
|
|
1673
301
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1674
302
|
const value = React__namespace.useMemo(() => context, Object.values(context));
|
|
1675
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
1676
304
|
};
|
|
1677
305
|
Provider.displayName = rootComponentName + "Provider";
|
|
1678
306
|
function useContext2(consumerName, scope) {
|
|
@@ -1731,7 +359,7 @@ function createCollection(name) {
|
|
|
1731
359
|
const { scope, children } = props;
|
|
1732
360
|
const ref = React.useRef(null);
|
|
1733
361
|
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
1734
|
-
return /* @__PURE__ */
|
|
362
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
1735
363
|
};
|
|
1736
364
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
1737
365
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
@@ -1741,7 +369,7 @@ function createCollection(name) {
|
|
|
1741
369
|
const { scope, children } = props;
|
|
1742
370
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
1743
371
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
1744
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
1745
373
|
}
|
|
1746
374
|
);
|
|
1747
375
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
@@ -1758,7 +386,7 @@ function createCollection(name) {
|
|
|
1758
386
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
1759
387
|
return () => void context.itemMap.delete(ref);
|
|
1760
388
|
});
|
|
1761
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
1762
390
|
}
|
|
1763
391
|
);
|
|
1764
392
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -2116,7 +744,7 @@ var DismissableLayer = React__namespace.forwardRef(
|
|
|
2116
744
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2117
745
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2118
746
|
}, []);
|
|
2119
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2120
748
|
Primitive.div,
|
|
2121
749
|
{
|
|
2122
750
|
...layerProps,
|
|
@@ -2150,7 +778,7 @@ var DismissableLayerBranch = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
2150
778
|
};
|
|
2151
779
|
}
|
|
2152
780
|
}, [context.branches]);
|
|
2153
|
-
return /* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
2154
782
|
});
|
|
2155
783
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
2156
784
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
@@ -2348,7 +976,7 @@ var FocusScope = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
2348
976
|
},
|
|
2349
977
|
[loop, trapped, focusScope.paused]
|
|
2350
978
|
);
|
|
2351
|
-
return /* @__PURE__ */
|
|
979
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
2352
980
|
});
|
|
2353
981
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
2354
982
|
function focusFirst$2(candidates, { select = false } = {}) {
|
|
@@ -2437,7 +1065,7 @@ var Portal$3 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
2437
1065
|
const [mounted, setMounted] = React__namespace.useState(false);
|
|
2438
1066
|
useLayoutEffect2(() => setMounted(true), []);
|
|
2439
1067
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
2440
|
-
return container ? ReactDOM.createPortal(/* @__PURE__ */
|
|
1068
|
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
2441
1069
|
});
|
|
2442
1070
|
Portal$3.displayName = PORTAL_NAME$4;
|
|
2443
1071
|
|
|
@@ -3461,7 +2089,7 @@ function CheckboxProvider(props) {
|
|
|
3461
2089
|
bubbleInput,
|
|
3462
2090
|
setBubbleInput
|
|
3463
2091
|
};
|
|
3464
|
-
return /* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3465
2093
|
CheckboxProviderImpl,
|
|
3466
2094
|
{
|
|
3467
2095
|
scope: __scopeCheckbox,
|
|
@@ -3495,7 +2123,7 @@ var CheckboxTrigger = React__namespace.forwardRef(
|
|
|
3495
2123
|
return () => form.removeEventListener("reset", reset);
|
|
3496
2124
|
}
|
|
3497
2125
|
}, [control, setChecked]);
|
|
3498
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3499
2127
|
Primitive.button,
|
|
3500
2128
|
{
|
|
3501
2129
|
type: "button",
|
|
@@ -3537,7 +2165,7 @@ var Checkbox$1 = React__namespace.forwardRef(
|
|
|
3537
2165
|
form,
|
|
3538
2166
|
...checkboxProps
|
|
3539
2167
|
} = props;
|
|
3540
|
-
return /* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3541
2169
|
CheckboxProvider,
|
|
3542
2170
|
{
|
|
3543
2171
|
__scopeCheckbox,
|
|
@@ -3549,8 +2177,8 @@ var Checkbox$1 = React__namespace.forwardRef(
|
|
|
3549
2177
|
name,
|
|
3550
2178
|
form,
|
|
3551
2179
|
value,
|
|
3552
|
-
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */
|
|
3553
|
-
/* @__PURE__ */
|
|
2180
|
+
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2181
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3554
2182
|
CheckboxTrigger,
|
|
3555
2183
|
{
|
|
3556
2184
|
...checkboxProps,
|
|
@@ -3558,7 +2186,7 @@ var Checkbox$1 = React__namespace.forwardRef(
|
|
|
3558
2186
|
__scopeCheckbox
|
|
3559
2187
|
}
|
|
3560
2188
|
),
|
|
3561
|
-
isFormControl && /* @__PURE__ */
|
|
2189
|
+
isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3562
2190
|
CheckboxBubbleInput,
|
|
3563
2191
|
{
|
|
3564
2192
|
__scopeCheckbox
|
|
@@ -3575,11 +2203,11 @@ var CheckboxIndicator = React__namespace.forwardRef(
|
|
|
3575
2203
|
(props, forwardedRef) => {
|
|
3576
2204
|
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
3577
2205
|
const context = useCheckboxContext(INDICATOR_NAME$2, __scopeCheckbox);
|
|
3578
|
-
return /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3579
2207
|
Presence,
|
|
3580
2208
|
{
|
|
3581
2209
|
present: forceMount || isIndeterminate$1(context.checked) || context.checked === true,
|
|
3582
|
-
children: /* @__PURE__ */
|
|
2210
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3583
2211
|
Primitive.span,
|
|
3584
2212
|
{
|
|
3585
2213
|
"data-state": getState(context.checked),
|
|
@@ -3631,7 +2259,7 @@ var CheckboxBubbleInput = React__namespace.forwardRef(
|
|
|
3631
2259
|
}
|
|
3632
2260
|
}, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
|
|
3633
2261
|
const defaultCheckedRef = React__namespace.useRef(isIndeterminate$1(checked) ? false : checked);
|
|
3634
|
-
return /* @__PURE__ */
|
|
2262
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3635
2263
|
Primitive.input,
|
|
3636
2264
|
{
|
|
3637
2265
|
type: "checkbox",
|
|
@@ -5872,7 +4500,7 @@ const arrow = (options, deps) => ({
|
|
|
5872
4500
|
var NAME = "Arrow";
|
|
5873
4501
|
var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
5874
4502
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
5875
|
-
return /* @__PURE__ */
|
|
4503
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5876
4504
|
Primitive.svg,
|
|
5877
4505
|
{
|
|
5878
4506
|
...arrowProps,
|
|
@@ -5881,7 +4509,7 @@ var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
5881
4509
|
height,
|
|
5882
4510
|
viewBox: "0 0 30 10",
|
|
5883
4511
|
preserveAspectRatio: "none",
|
|
5884
|
-
children: props.asChild ? children : /* @__PURE__ */
|
|
4512
|
+
children: props.asChild ? children : /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
5885
4513
|
}
|
|
5886
4514
|
);
|
|
5887
4515
|
});
|
|
@@ -5894,7 +4522,7 @@ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
|
5894
4522
|
var Popper = (props) => {
|
|
5895
4523
|
const { __scopePopper, children } = props;
|
|
5896
4524
|
const [anchor, setAnchor] = React__namespace.useState(null);
|
|
5897
|
-
return /* @__PURE__ */
|
|
4525
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
5898
4526
|
};
|
|
5899
4527
|
Popper.displayName = POPPER_NAME;
|
|
5900
4528
|
var ANCHOR_NAME$1 = "PopperAnchor";
|
|
@@ -5912,7 +4540,7 @@ var PopperAnchor = React__namespace.forwardRef(
|
|
|
5912
4540
|
context.onAnchorChange(anchorRef.current);
|
|
5913
4541
|
}
|
|
5914
4542
|
});
|
|
5915
|
-
return virtualRef ? null : /* @__PURE__ */
|
|
4543
|
+
return virtualRef ? null : /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
5916
4544
|
}
|
|
5917
4545
|
);
|
|
5918
4546
|
PopperAnchor.displayName = ANCHOR_NAME$1;
|
|
@@ -6005,7 +4633,7 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
6005
4633
|
useLayoutEffect2(() => {
|
|
6006
4634
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
6007
4635
|
}, [content]);
|
|
6008
|
-
return /* @__PURE__ */
|
|
4636
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6009
4637
|
"div",
|
|
6010
4638
|
{
|
|
6011
4639
|
ref: refs.setFloating,
|
|
@@ -6029,7 +4657,7 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
6029
4657
|
}
|
|
6030
4658
|
},
|
|
6031
4659
|
dir: props.dir,
|
|
6032
|
-
children: /* @__PURE__ */
|
|
4660
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6033
4661
|
PopperContentProvider,
|
|
6034
4662
|
{
|
|
6035
4663
|
scope: __scopePopper,
|
|
@@ -6038,7 +4666,7 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
6038
4666
|
arrowX,
|
|
6039
4667
|
arrowY,
|
|
6040
4668
|
shouldHideArrow: cannotCenterArrow,
|
|
6041
|
-
children: /* @__PURE__ */
|
|
4669
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6042
4670
|
Primitive.div,
|
|
6043
4671
|
{
|
|
6044
4672
|
"data-side": placedSide,
|
|
@@ -6075,7 +4703,7 @@ var PopperArrow = React__namespace.forwardRef(function PopperArrow2(props, forwa
|
|
|
6075
4703
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
6076
4704
|
// doesn't report size as we'd expect on SVG elements.
|
|
6077
4705
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
6078
|
-
/* @__PURE__ */
|
|
4706
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6079
4707
|
"span",
|
|
6080
4708
|
{
|
|
6081
4709
|
ref: contentContext.onArrowChange,
|
|
@@ -6098,7 +4726,7 @@ var PopperArrow = React__namespace.forwardRef(function PopperArrow2(props, forwa
|
|
|
6098
4726
|
}[contentContext.placedSide],
|
|
6099
4727
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
6100
4728
|
},
|
|
6101
|
-
children: /* @__PURE__ */
|
|
4729
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6102
4730
|
Root$2,
|
|
6103
4731
|
{
|
|
6104
4732
|
...arrowProps,
|
|
@@ -6169,7 +4797,7 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
6169
4797
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$3);
|
|
6170
4798
|
var RovingFocusGroup = React__namespace.forwardRef(
|
|
6171
4799
|
(props, forwardedRef) => {
|
|
6172
|
-
return /* @__PURE__ */
|
|
4800
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$2.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$2.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
6173
4801
|
}
|
|
6174
4802
|
);
|
|
6175
4803
|
RovingFocusGroup.displayName = GROUP_NAME$3;
|
|
@@ -6207,7 +4835,7 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
6207
4835
|
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
6208
4836
|
}
|
|
6209
4837
|
}, [handleEntryFocus]);
|
|
6210
|
-
return /* @__PURE__ */
|
|
4838
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6211
4839
|
RovingFocusProvider,
|
|
6212
4840
|
{
|
|
6213
4841
|
scope: __scopeRovingFocusGroup,
|
|
@@ -6228,7 +4856,7 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
6228
4856
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
6229
4857
|
[]
|
|
6230
4858
|
),
|
|
6231
|
-
children: /* @__PURE__ */
|
|
4859
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6232
4860
|
Primitive.div,
|
|
6233
4861
|
{
|
|
6234
4862
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
@@ -6286,14 +4914,14 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
6286
4914
|
return () => onFocusableItemRemove();
|
|
6287
4915
|
}
|
|
6288
4916
|
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
6289
|
-
return /* @__PURE__ */
|
|
4917
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6290
4918
|
Collection$2.ItemSlot,
|
|
6291
4919
|
{
|
|
6292
4920
|
scope: __scopeRovingFocusGroup,
|
|
6293
4921
|
id,
|
|
6294
4922
|
focusable,
|
|
6295
4923
|
active,
|
|
6296
|
-
children: /* @__PURE__ */
|
|
4924
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6297
4925
|
Primitive.span,
|
|
6298
4926
|
{
|
|
6299
4927
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
@@ -6412,7 +5040,7 @@ var Menu = (props) => {
|
|
|
6412
5040
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
6413
5041
|
};
|
|
6414
5042
|
}, []);
|
|
6415
|
-
return /* @__PURE__ */
|
|
5043
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6416
5044
|
MenuProvider,
|
|
6417
5045
|
{
|
|
6418
5046
|
scope: __scopeMenu,
|
|
@@ -6420,7 +5048,7 @@ var Menu = (props) => {
|
|
|
6420
5048
|
onOpenChange: handleOpenChange,
|
|
6421
5049
|
content,
|
|
6422
5050
|
onContentChange: setContent,
|
|
6423
|
-
children: /* @__PURE__ */
|
|
5051
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6424
5052
|
MenuRootProvider,
|
|
6425
5053
|
{
|
|
6426
5054
|
scope: __scopeMenu,
|
|
@@ -6440,7 +5068,7 @@ var MenuAnchor = React__namespace.forwardRef(
|
|
|
6440
5068
|
(props, forwardedRef) => {
|
|
6441
5069
|
const { __scopeMenu, ...anchorProps } = props;
|
|
6442
5070
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
6443
|
-
return /* @__PURE__ */
|
|
5071
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
6444
5072
|
}
|
|
6445
5073
|
);
|
|
6446
5074
|
MenuAnchor.displayName = ANCHOR_NAME;
|
|
@@ -6451,7 +5079,7 @@ var [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$3, {
|
|
|
6451
5079
|
var MenuPortal = (props) => {
|
|
6452
5080
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
6453
5081
|
const context = useMenuContext(PORTAL_NAME$3, __scopeMenu);
|
|
6454
|
-
return /* @__PURE__ */
|
|
5082
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider$1, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Portal$3, { asChild: true, container, children }) }) });
|
|
6455
5083
|
};
|
|
6456
5084
|
MenuPortal.displayName = PORTAL_NAME$3;
|
|
6457
5085
|
var CONTENT_NAME$3 = "MenuContent";
|
|
@@ -6462,7 +5090,7 @@ var MenuContent = React__namespace.forwardRef(
|
|
|
6462
5090
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
6463
5091
|
const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
6464
5092
|
const rootContext = useMenuRootContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
6465
|
-
return /* @__PURE__ */
|
|
5093
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
6466
5094
|
}
|
|
6467
5095
|
);
|
|
6468
5096
|
var MenuRootContentModal = React__namespace.forwardRef(
|
|
@@ -6474,7 +5102,7 @@ var MenuRootContentModal = React__namespace.forwardRef(
|
|
|
6474
5102
|
const content = ref.current;
|
|
6475
5103
|
if (content) return hideOthers(content);
|
|
6476
5104
|
}, []);
|
|
6477
|
-
return /* @__PURE__ */
|
|
5105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6478
5106
|
MenuContentImpl,
|
|
6479
5107
|
{
|
|
6480
5108
|
...props,
|
|
@@ -6494,7 +5122,7 @@ var MenuRootContentModal = React__namespace.forwardRef(
|
|
|
6494
5122
|
);
|
|
6495
5123
|
var MenuRootContentNonModal = React__namespace.forwardRef((props, forwardedRef) => {
|
|
6496
5124
|
const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
6497
|
-
return /* @__PURE__ */
|
|
5125
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6498
5126
|
MenuContentImpl,
|
|
6499
5127
|
{
|
|
6500
5128
|
...props,
|
|
@@ -6566,7 +5194,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
6566
5194
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
6567
5195
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
6568
5196
|
}, []);
|
|
6569
|
-
return /* @__PURE__ */
|
|
5197
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6570
5198
|
MenuContentProvider,
|
|
6571
5199
|
{
|
|
6572
5200
|
scope: __scopeMenu,
|
|
@@ -6595,7 +5223,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
6595
5223
|
onPointerGraceIntentChange: React__namespace.useCallback((intent) => {
|
|
6596
5224
|
pointerGraceIntentRef.current = intent;
|
|
6597
5225
|
}, []),
|
|
6598
|
-
children: /* @__PURE__ */
|
|
5226
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6599
5227
|
FocusScope,
|
|
6600
5228
|
{
|
|
6601
5229
|
asChild: true,
|
|
@@ -6605,7 +5233,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
6605
5233
|
contentRef.current?.focus({ preventScroll: true });
|
|
6606
5234
|
}),
|
|
6607
5235
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
6608
|
-
children: /* @__PURE__ */
|
|
5236
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6609
5237
|
DismissableLayer,
|
|
6610
5238
|
{
|
|
6611
5239
|
asChild: true,
|
|
@@ -6615,7 +5243,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
6615
5243
|
onFocusOutside,
|
|
6616
5244
|
onInteractOutside,
|
|
6617
5245
|
onDismiss,
|
|
6618
|
-
children: /* @__PURE__ */
|
|
5246
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6619
5247
|
Root$1,
|
|
6620
5248
|
{
|
|
6621
5249
|
asChild: true,
|
|
@@ -6629,7 +5257,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
6629
5257
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
6630
5258
|
}),
|
|
6631
5259
|
preventScrollOnEntryFocus: true,
|
|
6632
|
-
children: /* @__PURE__ */
|
|
5260
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6633
5261
|
Content,
|
|
6634
5262
|
{
|
|
6635
5263
|
role: "menu",
|
|
@@ -6694,7 +5322,7 @@ var GROUP_NAME$2 = "MenuGroup";
|
|
|
6694
5322
|
var MenuGroup = React__namespace.forwardRef(
|
|
6695
5323
|
(props, forwardedRef) => {
|
|
6696
5324
|
const { __scopeMenu, ...groupProps } = props;
|
|
6697
|
-
return /* @__PURE__ */
|
|
5325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
6698
5326
|
}
|
|
6699
5327
|
);
|
|
6700
5328
|
MenuGroup.displayName = GROUP_NAME$2;
|
|
@@ -6702,7 +5330,7 @@ var LABEL_NAME$2 = "MenuLabel";
|
|
|
6702
5330
|
var MenuLabel = React__namespace.forwardRef(
|
|
6703
5331
|
(props, forwardedRef) => {
|
|
6704
5332
|
const { __scopeMenu, ...labelProps } = props;
|
|
6705
|
-
return /* @__PURE__ */
|
|
5333
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
6706
5334
|
}
|
|
6707
5335
|
);
|
|
6708
5336
|
MenuLabel.displayName = LABEL_NAME$2;
|
|
@@ -6729,7 +5357,7 @@ var MenuItem = React__namespace.forwardRef(
|
|
|
6729
5357
|
}
|
|
6730
5358
|
}
|
|
6731
5359
|
};
|
|
6732
|
-
return /* @__PURE__ */
|
|
5360
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6733
5361
|
MenuItemImpl,
|
|
6734
5362
|
{
|
|
6735
5363
|
...itemProps,
|
|
@@ -6771,13 +5399,13 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
6771
5399
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
6772
5400
|
}
|
|
6773
5401
|
}, [itemProps.children]);
|
|
6774
|
-
return /* @__PURE__ */
|
|
5402
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6775
5403
|
Collection$1.ItemSlot,
|
|
6776
5404
|
{
|
|
6777
5405
|
scope: __scopeMenu,
|
|
6778
5406
|
disabled,
|
|
6779
5407
|
textValue: textValue ?? textContent,
|
|
6780
|
-
children: /* @__PURE__ */
|
|
5408
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Item$1, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6781
5409
|
Primitive.div,
|
|
6782
5410
|
{
|
|
6783
5411
|
role: "menuitem",
|
|
@@ -6816,7 +5444,7 @@ var CHECKBOX_ITEM_NAME$1 = "MenuCheckboxItem";
|
|
|
6816
5444
|
var MenuCheckboxItem = React__namespace.forwardRef(
|
|
6817
5445
|
(props, forwardedRef) => {
|
|
6818
5446
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
6819
|
-
return /* @__PURE__ */
|
|
5447
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6820
5448
|
MenuItem,
|
|
6821
5449
|
{
|
|
6822
5450
|
role: "menuitemcheckbox",
|
|
@@ -6844,7 +5472,7 @@ var MenuRadioGroup = React__namespace.forwardRef(
|
|
|
6844
5472
|
(props, forwardedRef) => {
|
|
6845
5473
|
const { value, onValueChange, ...groupProps } = props;
|
|
6846
5474
|
const handleValueChange = useCallbackRef$1(onValueChange);
|
|
6847
|
-
return /* @__PURE__ */
|
|
5475
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsxRuntime.jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
6848
5476
|
}
|
|
6849
5477
|
);
|
|
6850
5478
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME$1;
|
|
@@ -6854,7 +5482,7 @@ var MenuRadioItem = React__namespace.forwardRef(
|
|
|
6854
5482
|
const { value, ...radioItemProps } = props;
|
|
6855
5483
|
const context = useRadioGroupContext(RADIO_ITEM_NAME$1, props.__scopeMenu);
|
|
6856
5484
|
const checked = value === context.value;
|
|
6857
|
-
return /* @__PURE__ */
|
|
5485
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6858
5486
|
MenuItem,
|
|
6859
5487
|
{
|
|
6860
5488
|
role: "menuitemradio",
|
|
@@ -6881,11 +5509,11 @@ var MenuItemIndicator = React__namespace.forwardRef(
|
|
|
6881
5509
|
(props, forwardedRef) => {
|
|
6882
5510
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
6883
5511
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME$1, __scopeMenu);
|
|
6884
|
-
return /* @__PURE__ */
|
|
5512
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6885
5513
|
Presence,
|
|
6886
5514
|
{
|
|
6887
5515
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
6888
|
-
children: /* @__PURE__ */
|
|
5516
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6889
5517
|
Primitive.span,
|
|
6890
5518
|
{
|
|
6891
5519
|
...itemIndicatorProps,
|
|
@@ -6902,7 +5530,7 @@ var SEPARATOR_NAME$2 = "MenuSeparator";
|
|
|
6902
5530
|
var MenuSeparator = React__namespace.forwardRef(
|
|
6903
5531
|
(props, forwardedRef) => {
|
|
6904
5532
|
const { __scopeMenu, ...separatorProps } = props;
|
|
6905
|
-
return /* @__PURE__ */
|
|
5533
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6906
5534
|
Primitive.div,
|
|
6907
5535
|
{
|
|
6908
5536
|
role: "separator",
|
|
@@ -6919,7 +5547,7 @@ var MenuArrow = React__namespace.forwardRef(
|
|
|
6919
5547
|
(props, forwardedRef) => {
|
|
6920
5548
|
const { __scopeMenu, ...arrowProps } = props;
|
|
6921
5549
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
6922
|
-
return /* @__PURE__ */
|
|
5550
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
6923
5551
|
}
|
|
6924
5552
|
);
|
|
6925
5553
|
MenuArrow.displayName = ARROW_NAME$3;
|
|
@@ -6947,7 +5575,7 @@ var MenuSubTrigger = React__namespace.forwardRef(
|
|
|
6947
5575
|
onPointerGraceIntentChange(null);
|
|
6948
5576
|
};
|
|
6949
5577
|
}, [pointerGraceTimerRef, onPointerGraceIntentChange]);
|
|
6950
|
-
return /* @__PURE__ */
|
|
5578
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6951
5579
|
MenuItemImpl,
|
|
6952
5580
|
{
|
|
6953
5581
|
id: subContext.triggerId,
|
|
@@ -7036,7 +5664,7 @@ var MenuSubContent = React__namespace.forwardRef(
|
|
|
7036
5664
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
|
|
7037
5665
|
const ref = React__namespace.useRef(null);
|
|
7038
5666
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7039
|
-
return /* @__PURE__ */
|
|
5667
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7040
5668
|
MenuContentImpl,
|
|
7041
5669
|
{
|
|
7042
5670
|
id: subContext.contentId,
|
|
@@ -7170,7 +5798,7 @@ var DropdownMenu$1 = (props) => {
|
|
|
7170
5798
|
onChange: onOpenChange,
|
|
7171
5799
|
caller: DROPDOWN_MENU_NAME
|
|
7172
5800
|
});
|
|
7173
|
-
return /* @__PURE__ */
|
|
5801
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7174
5802
|
DropdownMenuProvider,
|
|
7175
5803
|
{
|
|
7176
5804
|
scope: __scopeDropdownMenu,
|
|
@@ -7181,7 +5809,7 @@ var DropdownMenu$1 = (props) => {
|
|
|
7181
5809
|
onOpenChange: setOpen,
|
|
7182
5810
|
onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
7183
5811
|
modal,
|
|
7184
|
-
children: /* @__PURE__ */
|
|
5812
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Root3$1, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
7185
5813
|
}
|
|
7186
5814
|
);
|
|
7187
5815
|
};
|
|
@@ -7192,7 +5820,7 @@ var DropdownMenuTrigger$1 = React__namespace.forwardRef(
|
|
|
7192
5820
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
7193
5821
|
const context = useDropdownMenuContext(TRIGGER_NAME$2, __scopeDropdownMenu);
|
|
7194
5822
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7195
|
-
return /* @__PURE__ */
|
|
5823
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7196
5824
|
Primitive.button,
|
|
7197
5825
|
{
|
|
7198
5826
|
type: "button",
|
|
@@ -7226,7 +5854,7 @@ var PORTAL_NAME$2 = "DropdownMenuPortal";
|
|
|
7226
5854
|
var DropdownMenuPortal = (props) => {
|
|
7227
5855
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
7228
5856
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7229
|
-
return /* @__PURE__ */
|
|
5857
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal$2, { ...menuScope, ...portalProps });
|
|
7230
5858
|
};
|
|
7231
5859
|
DropdownMenuPortal.displayName = PORTAL_NAME$2;
|
|
7232
5860
|
var CONTENT_NAME$2 = "DropdownMenuContent";
|
|
@@ -7236,7 +5864,7 @@ var DropdownMenuContent$1 = React__namespace.forwardRef(
|
|
|
7236
5864
|
const context = useDropdownMenuContext(CONTENT_NAME$2, __scopeDropdownMenu);
|
|
7237
5865
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7238
5866
|
const hasInteractedOutsideRef = React__namespace.useRef(false);
|
|
7239
|
-
return /* @__PURE__ */
|
|
5867
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7240
5868
|
Content2$3,
|
|
7241
5869
|
{
|
|
7242
5870
|
id: context.contentId,
|
|
@@ -7276,7 +5904,7 @@ var DropdownMenuGroup = React__namespace.forwardRef(
|
|
|
7276
5904
|
(props, forwardedRef) => {
|
|
7277
5905
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
7278
5906
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7279
|
-
return /* @__PURE__ */
|
|
5907
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
7280
5908
|
}
|
|
7281
5909
|
);
|
|
7282
5910
|
DropdownMenuGroup.displayName = GROUP_NAME$1;
|
|
@@ -7285,7 +5913,7 @@ var DropdownMenuLabel = React__namespace.forwardRef(
|
|
|
7285
5913
|
(props, forwardedRef) => {
|
|
7286
5914
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
7287
5915
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7288
|
-
return /* @__PURE__ */
|
|
5916
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
7289
5917
|
}
|
|
7290
5918
|
);
|
|
7291
5919
|
DropdownMenuLabel.displayName = LABEL_NAME$1;
|
|
@@ -7294,7 +5922,7 @@ var DropdownMenuItem$1 = React__namespace.forwardRef(
|
|
|
7294
5922
|
(props, forwardedRef) => {
|
|
7295
5923
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
7296
5924
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7297
|
-
return /* @__PURE__ */
|
|
5925
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item2$1, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
7298
5926
|
}
|
|
7299
5927
|
);
|
|
7300
5928
|
DropdownMenuItem$1.displayName = ITEM_NAME$1;
|
|
@@ -7302,43 +5930,43 @@ var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
|
7302
5930
|
var DropdownMenuCheckboxItem = React__namespace.forwardRef((props, forwardedRef) => {
|
|
7303
5931
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
7304
5932
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7305
|
-
return /* @__PURE__ */
|
|
5933
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
7306
5934
|
});
|
|
7307
5935
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
7308
5936
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
7309
5937
|
var DropdownMenuRadioGroup = React__namespace.forwardRef((props, forwardedRef) => {
|
|
7310
5938
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
7311
5939
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7312
|
-
return /* @__PURE__ */
|
|
5940
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
7313
5941
|
});
|
|
7314
5942
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
7315
5943
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
7316
5944
|
var DropdownMenuRadioItem = React__namespace.forwardRef((props, forwardedRef) => {
|
|
7317
5945
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
7318
5946
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7319
|
-
return /* @__PURE__ */
|
|
5947
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
7320
5948
|
});
|
|
7321
5949
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
7322
5950
|
var INDICATOR_NAME$1 = "DropdownMenuItemIndicator";
|
|
7323
5951
|
var DropdownMenuItemIndicator = React__namespace.forwardRef((props, forwardedRef) => {
|
|
7324
5952
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
7325
5953
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7326
|
-
return /* @__PURE__ */
|
|
5954
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator$1, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
7327
5955
|
});
|
|
7328
5956
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME$1;
|
|
7329
5957
|
var SEPARATOR_NAME$1 = "DropdownMenuSeparator";
|
|
7330
|
-
var DropdownMenuSeparator = React__namespace.forwardRef((props, forwardedRef) => {
|
|
5958
|
+
var DropdownMenuSeparator$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
7331
5959
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
7332
5960
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7333
|
-
return /* @__PURE__ */
|
|
5961
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
7334
5962
|
});
|
|
7335
|
-
DropdownMenuSeparator.displayName = SEPARATOR_NAME$1;
|
|
5963
|
+
DropdownMenuSeparator$1.displayName = SEPARATOR_NAME$1;
|
|
7336
5964
|
var ARROW_NAME$2 = "DropdownMenuArrow";
|
|
7337
5965
|
var DropdownMenuArrow = React__namespace.forwardRef(
|
|
7338
5966
|
(props, forwardedRef) => {
|
|
7339
5967
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
7340
5968
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7341
|
-
return /* @__PURE__ */
|
|
5969
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Arrow2$1, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
7342
5970
|
}
|
|
7343
5971
|
);
|
|
7344
5972
|
DropdownMenuArrow.displayName = ARROW_NAME$2;
|
|
@@ -7346,14 +5974,14 @@ var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
|
7346
5974
|
var DropdownMenuSubTrigger = React__namespace.forwardRef((props, forwardedRef) => {
|
|
7347
5975
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
7348
5976
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7349
|
-
return /* @__PURE__ */
|
|
5977
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
7350
5978
|
});
|
|
7351
5979
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
7352
5980
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
7353
5981
|
var DropdownMenuSubContent = React__namespace.forwardRef((props, forwardedRef) => {
|
|
7354
5982
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
7355
5983
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7356
|
-
return /* @__PURE__ */
|
|
5984
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7357
5985
|
SubContent,
|
|
7358
5986
|
{
|
|
7359
5987
|
...menuScope,
|
|
@@ -7379,6 +6007,7 @@ var Trigger$2 = DropdownMenuTrigger$1;
|
|
|
7379
6007
|
var Portal2 = DropdownMenuPortal;
|
|
7380
6008
|
var Content2$2 = DropdownMenuContent$1;
|
|
7381
6009
|
var Item2 = DropdownMenuItem$1;
|
|
6010
|
+
var Separator2 = DropdownMenuSeparator$1;
|
|
7382
6011
|
|
|
7383
6012
|
// packages/core/number/src/number.ts
|
|
7384
6013
|
function clamp(value, [min, max]) {
|
|
@@ -7407,7 +6036,7 @@ var Progress$1 = React__namespace.forwardRef(
|
|
|
7407
6036
|
}
|
|
7408
6037
|
const value = isValidValueNumber(valueProp, max) ? valueProp : null;
|
|
7409
6038
|
const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
|
|
7410
|
-
return /* @__PURE__ */
|
|
6039
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7411
6040
|
Primitive.div,
|
|
7412
6041
|
{
|
|
7413
6042
|
"aria-valuemax": max,
|
|
@@ -7430,7 +6059,7 @@ var ProgressIndicator = React__namespace.forwardRef(
|
|
|
7430
6059
|
(props, forwardedRef) => {
|
|
7431
6060
|
const { __scopeProgress, ...indicatorProps } = props;
|
|
7432
6061
|
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
7433
|
-
return /* @__PURE__ */
|
|
6062
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7434
6063
|
Primitive.div,
|
|
7435
6064
|
{
|
|
7436
6065
|
"data-state": getProgressState(context.value, context.max),
|
|
@@ -7521,7 +6150,7 @@ var Select$1 = (props) => {
|
|
|
7521
6150
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
7522
6151
|
const [nativeOptionsSet, setNativeOptionsSet] = React__namespace.useState(/* @__PURE__ */ new Set());
|
|
7523
6152
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
7524
|
-
return /* @__PURE__ */
|
|
6153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7525
6154
|
SelectProvider,
|
|
7526
6155
|
{
|
|
7527
6156
|
required,
|
|
@@ -7541,7 +6170,7 @@ var Select$1 = (props) => {
|
|
|
7541
6170
|
triggerPointerDownPosRef,
|
|
7542
6171
|
disabled,
|
|
7543
6172
|
children: [
|
|
7544
|
-
/* @__PURE__ */
|
|
6173
|
+
/* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7545
6174
|
SelectNativeOptionsProvider,
|
|
7546
6175
|
{
|
|
7547
6176
|
scope: props.__scopeSelect,
|
|
@@ -7558,7 +6187,7 @@ var Select$1 = (props) => {
|
|
|
7558
6187
|
children
|
|
7559
6188
|
}
|
|
7560
6189
|
) }),
|
|
7561
|
-
isFormControl ? /* @__PURE__ */
|
|
6190
|
+
isFormControl ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7562
6191
|
SelectBubbleInput,
|
|
7563
6192
|
{
|
|
7564
6193
|
"aria-hidden": true,
|
|
@@ -7571,7 +6200,7 @@ var Select$1 = (props) => {
|
|
|
7571
6200
|
disabled,
|
|
7572
6201
|
form,
|
|
7573
6202
|
children: [
|
|
7574
|
-
value === void 0 ? /* @__PURE__ */
|
|
6203
|
+
value === void 0 ? /* @__PURE__ */ jsxRuntime.jsx("option", { value: "" }) : null,
|
|
7575
6204
|
Array.from(nativeOptionsSet)
|
|
7576
6205
|
]
|
|
7577
6206
|
},
|
|
@@ -7612,7 +6241,7 @@ var SelectTrigger$1 = React__namespace.forwardRef(
|
|
|
7612
6241
|
};
|
|
7613
6242
|
}
|
|
7614
6243
|
};
|
|
7615
|
-
return /* @__PURE__ */
|
|
6244
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7616
6245
|
Primitive.button,
|
|
7617
6246
|
{
|
|
7618
6247
|
type: "button",
|
|
@@ -7671,13 +6300,13 @@ var SelectValue$1 = React__namespace.forwardRef(
|
|
|
7671
6300
|
useLayoutEffect2(() => {
|
|
7672
6301
|
onValueNodeHasChildrenChange(hasChildren);
|
|
7673
6302
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
7674
|
-
return /* @__PURE__ */
|
|
6303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7675
6304
|
Primitive.span,
|
|
7676
6305
|
{
|
|
7677
6306
|
...valueProps,
|
|
7678
6307
|
ref: composedRefs,
|
|
7679
6308
|
style: { pointerEvents: "none" },
|
|
7680
|
-
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */
|
|
6309
|
+
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: placeholder }) : children
|
|
7681
6310
|
}
|
|
7682
6311
|
);
|
|
7683
6312
|
}
|
|
@@ -7687,13 +6316,13 @@ var ICON_NAME = "SelectIcon";
|
|
|
7687
6316
|
var SelectIcon = React__namespace.forwardRef(
|
|
7688
6317
|
(props, forwardedRef) => {
|
|
7689
6318
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
7690
|
-
return /* @__PURE__ */
|
|
6319
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
|
7691
6320
|
}
|
|
7692
6321
|
);
|
|
7693
6322
|
SelectIcon.displayName = ICON_NAME;
|
|
7694
6323
|
var PORTAL_NAME$1 = "SelectPortal";
|
|
7695
6324
|
var SelectPortal = (props) => {
|
|
7696
|
-
return /* @__PURE__ */
|
|
6325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal$3, { asChild: true, ...props });
|
|
7697
6326
|
};
|
|
7698
6327
|
SelectPortal.displayName = PORTAL_NAME$1;
|
|
7699
6328
|
var CONTENT_NAME$1 = "SelectContent";
|
|
@@ -7707,11 +6336,11 @@ var SelectContent$1 = React__namespace.forwardRef(
|
|
|
7707
6336
|
if (!context.open) {
|
|
7708
6337
|
const frag = fragment;
|
|
7709
6338
|
return frag ? ReactDOM__namespace.createPortal(
|
|
7710
|
-
/* @__PURE__ */
|
|
6339
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: props.children }) }) }),
|
|
7711
6340
|
frag
|
|
7712
6341
|
) : null;
|
|
7713
6342
|
}
|
|
7714
|
-
return /* @__PURE__ */
|
|
6343
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContentImpl, { ...props, ref: forwardedRef });
|
|
7715
6344
|
}
|
|
7716
6345
|
);
|
|
7717
6346
|
SelectContent$1.displayName = CONTENT_NAME$1;
|
|
@@ -7865,7 +6494,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7865
6494
|
hideWhenDetached,
|
|
7866
6495
|
avoidCollisions
|
|
7867
6496
|
} : {};
|
|
7868
|
-
return /* @__PURE__ */
|
|
6497
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7869
6498
|
SelectContentProvider,
|
|
7870
6499
|
{
|
|
7871
6500
|
scope: __scopeSelect,
|
|
@@ -7881,7 +6510,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7881
6510
|
position,
|
|
7882
6511
|
isPositioned,
|
|
7883
6512
|
searchRef,
|
|
7884
|
-
children: /* @__PURE__ */
|
|
6513
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7885
6514
|
FocusScope,
|
|
7886
6515
|
{
|
|
7887
6516
|
asChild: true,
|
|
@@ -7893,7 +6522,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7893
6522
|
context.trigger?.focus({ preventScroll: true });
|
|
7894
6523
|
event.preventDefault();
|
|
7895
6524
|
}),
|
|
7896
|
-
children: /* @__PURE__ */
|
|
6525
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7897
6526
|
DismissableLayer,
|
|
7898
6527
|
{
|
|
7899
6528
|
asChild: true,
|
|
@@ -7902,7 +6531,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7902
6531
|
onPointerDownOutside,
|
|
7903
6532
|
onFocusOutside: (event) => event.preventDefault(),
|
|
7904
6533
|
onDismiss: () => context.onOpenChange(false),
|
|
7905
|
-
children: /* @__PURE__ */
|
|
6534
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7906
6535
|
SelectPosition,
|
|
7907
6536
|
{
|
|
7908
6537
|
role: "listbox",
|
|
@@ -8078,14 +6707,14 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
|
8078
6707
|
},
|
|
8079
6708
|
[position, focusSelectedItem]
|
|
8080
6709
|
);
|
|
8081
|
-
return /* @__PURE__ */
|
|
6710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8082
6711
|
SelectViewportProvider,
|
|
8083
6712
|
{
|
|
8084
6713
|
scope: __scopeSelect,
|
|
8085
6714
|
contentWrapper,
|
|
8086
6715
|
shouldExpandOnScrollRef,
|
|
8087
6716
|
onScrollButtonChange: handleScrollButtonChange,
|
|
8088
|
-
children: /* @__PURE__ */
|
|
6717
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8089
6718
|
"div",
|
|
8090
6719
|
{
|
|
8091
6720
|
ref: setContentWrapper,
|
|
@@ -8095,7 +6724,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
|
8095
6724
|
position: "fixed",
|
|
8096
6725
|
zIndex: contentZIndex
|
|
8097
6726
|
},
|
|
8098
|
-
children: /* @__PURE__ */
|
|
6727
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8099
6728
|
Primitive.div,
|
|
8100
6729
|
{
|
|
8101
6730
|
...popperProps,
|
|
@@ -8125,7 +6754,7 @@ var SelectPopperPosition = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
8125
6754
|
...popperProps
|
|
8126
6755
|
} = props;
|
|
8127
6756
|
const popperScope = usePopperScope$1(__scopeSelect);
|
|
8128
|
-
return /* @__PURE__ */
|
|
6757
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8129
6758
|
Content,
|
|
8130
6759
|
{
|
|
8131
6760
|
...popperScope,
|
|
@@ -8159,8 +6788,8 @@ var SelectViewport = React__namespace.forwardRef(
|
|
|
8159
6788
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
8160
6789
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
8161
6790
|
const prevScrollTopRef = React__namespace.useRef(0);
|
|
8162
|
-
return /* @__PURE__ */
|
|
8163
|
-
/* @__PURE__ */
|
|
6791
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6792
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8164
6793
|
"style",
|
|
8165
6794
|
{
|
|
8166
6795
|
dangerouslySetInnerHTML: {
|
|
@@ -8169,7 +6798,7 @@ var SelectViewport = React__namespace.forwardRef(
|
|
|
8169
6798
|
nonce
|
|
8170
6799
|
}
|
|
8171
6800
|
),
|
|
8172
|
-
/* @__PURE__ */
|
|
6801
|
+
/* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8173
6802
|
Primitive.div,
|
|
8174
6803
|
{
|
|
8175
6804
|
"data-radix-select-viewport": "",
|
|
@@ -8225,7 +6854,7 @@ var SelectGroup = React__namespace.forwardRef(
|
|
|
8225
6854
|
(props, forwardedRef) => {
|
|
8226
6855
|
const { __scopeSelect, ...groupProps } = props;
|
|
8227
6856
|
const groupId = useId();
|
|
8228
|
-
return /* @__PURE__ */
|
|
6857
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
8229
6858
|
}
|
|
8230
6859
|
);
|
|
8231
6860
|
SelectGroup.displayName = GROUP_NAME;
|
|
@@ -8234,7 +6863,7 @@ var SelectLabel = React__namespace.forwardRef(
|
|
|
8234
6863
|
(props, forwardedRef) => {
|
|
8235
6864
|
const { __scopeSelect, ...labelProps } = props;
|
|
8236
6865
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
8237
|
-
return /* @__PURE__ */
|
|
6866
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
8238
6867
|
}
|
|
8239
6868
|
);
|
|
8240
6869
|
SelectLabel.displayName = LABEL_NAME;
|
|
@@ -8271,7 +6900,7 @@ var SelectItem$1 = React__namespace.forwardRef(
|
|
|
8271
6900
|
"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."
|
|
8272
6901
|
);
|
|
8273
6902
|
}
|
|
8274
|
-
return /* @__PURE__ */
|
|
6903
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8275
6904
|
SelectItemContextProvider,
|
|
8276
6905
|
{
|
|
8277
6906
|
scope: __scopeSelect,
|
|
@@ -8282,14 +6911,14 @@ var SelectItem$1 = React__namespace.forwardRef(
|
|
|
8282
6911
|
onItemTextChange: React__namespace.useCallback((node) => {
|
|
8283
6912
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
8284
6913
|
}, []),
|
|
8285
|
-
children: /* @__PURE__ */
|
|
6914
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8286
6915
|
Collection.ItemSlot,
|
|
8287
6916
|
{
|
|
8288
6917
|
scope: __scopeSelect,
|
|
8289
6918
|
value,
|
|
8290
6919
|
disabled,
|
|
8291
6920
|
textValue,
|
|
8292
|
-
children: /* @__PURE__ */
|
|
6921
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8293
6922
|
Primitive.div,
|
|
8294
6923
|
{
|
|
8295
6924
|
role: "option",
|
|
@@ -8358,7 +6987,7 @@ var SelectItemText = React__namespace.forwardRef(
|
|
|
8358
6987
|
);
|
|
8359
6988
|
const textContent = itemTextNode?.textContent;
|
|
8360
6989
|
const nativeOption = React__namespace.useMemo(
|
|
8361
|
-
() => /* @__PURE__ */
|
|
6990
|
+
() => /* @__PURE__ */ jsxRuntime.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
|
|
8362
6991
|
[itemContext.disabled, itemContext.value, textContent]
|
|
8363
6992
|
);
|
|
8364
6993
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
@@ -8366,8 +6995,8 @@ var SelectItemText = React__namespace.forwardRef(
|
|
|
8366
6995
|
onNativeOptionAdd(nativeOption);
|
|
8367
6996
|
return () => onNativeOptionRemove(nativeOption);
|
|
8368
6997
|
}, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
|
|
8369
|
-
return /* @__PURE__ */
|
|
8370
|
-
/* @__PURE__ */
|
|
6998
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6999
|
+
/* @__PURE__ */ jsxRuntime.jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
|
|
8371
7000
|
itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM__namespace.createPortal(itemTextProps.children, context.valueNode) : null
|
|
8372
7001
|
] });
|
|
8373
7002
|
}
|
|
@@ -8378,7 +7007,7 @@ var SelectItemIndicator = React__namespace.forwardRef(
|
|
|
8378
7007
|
(props, forwardedRef) => {
|
|
8379
7008
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
8380
7009
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
8381
|
-
return itemContext.isSelected ? /* @__PURE__ */
|
|
7010
|
+
return itemContext.isSelected ? /* @__PURE__ */ jsxRuntime.jsx(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
8382
7011
|
}
|
|
8383
7012
|
);
|
|
8384
7013
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
@@ -8400,7 +7029,7 @@ var SelectScrollUpButton$1 = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
8400
7029
|
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
8401
7030
|
}
|
|
8402
7031
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
8403
|
-
return canScrollUp ? /* @__PURE__ */
|
|
7032
|
+
return canScrollUp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8404
7033
|
SelectScrollButtonImpl,
|
|
8405
7034
|
{
|
|
8406
7035
|
...props,
|
|
@@ -8434,7 +7063,7 @@ var SelectScrollDownButton$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
8434
7063
|
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
8435
7064
|
}
|
|
8436
7065
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
8437
|
-
return canScrollDown ? /* @__PURE__ */
|
|
7066
|
+
return canScrollDown ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8438
7067
|
SelectScrollButtonImpl,
|
|
8439
7068
|
{
|
|
8440
7069
|
...props,
|
|
@@ -8467,7 +7096,7 @@ var SelectScrollButtonImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
8467
7096
|
const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
|
|
8468
7097
|
activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
8469
7098
|
}, [getItems]);
|
|
8470
|
-
return /* @__PURE__ */
|
|
7099
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8471
7100
|
Primitive.div,
|
|
8472
7101
|
{
|
|
8473
7102
|
"aria-hidden": true,
|
|
@@ -8495,7 +7124,7 @@ var SEPARATOR_NAME = "SelectSeparator";
|
|
|
8495
7124
|
var SelectSeparator = React__namespace.forwardRef(
|
|
8496
7125
|
(props, forwardedRef) => {
|
|
8497
7126
|
const { __scopeSelect, ...separatorProps } = props;
|
|
8498
|
-
return /* @__PURE__ */
|
|
7127
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
8499
7128
|
}
|
|
8500
7129
|
);
|
|
8501
7130
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
@@ -8506,7 +7135,7 @@ var SelectArrow = React__namespace.forwardRef(
|
|
|
8506
7135
|
const popperScope = usePopperScope$1(__scopeSelect);
|
|
8507
7136
|
const context = useSelectContext(ARROW_NAME$1, __scopeSelect);
|
|
8508
7137
|
const contentContext = useSelectContentContext(ARROW_NAME$1, __scopeSelect);
|
|
8509
|
-
return context.open && contentContext.position === "popper" ? /* @__PURE__ */
|
|
7138
|
+
return context.open && contentContext.position === "popper" ? /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;
|
|
8510
7139
|
}
|
|
8511
7140
|
);
|
|
8512
7141
|
SelectArrow.displayName = ARROW_NAME$1;
|
|
@@ -8531,7 +7160,7 @@ var SelectBubbleInput = React__namespace.forwardRef(
|
|
|
8531
7160
|
select.dispatchEvent(event);
|
|
8532
7161
|
}
|
|
8533
7162
|
}, [prevValue, value]);
|
|
8534
|
-
return /* @__PURE__ */
|
|
7163
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8535
7164
|
Primitive.select,
|
|
8536
7165
|
{
|
|
8537
7166
|
...props,
|
|
@@ -8622,7 +7251,7 @@ var TooltipProvider$1 = (props) => {
|
|
|
8622
7251
|
const skipDelayTimer = skipDelayTimerRef.current;
|
|
8623
7252
|
return () => window.clearTimeout(skipDelayTimer);
|
|
8624
7253
|
}, []);
|
|
8625
|
-
return /* @__PURE__ */
|
|
7254
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8626
7255
|
TooltipProviderContextProvider,
|
|
8627
7256
|
{
|
|
8628
7257
|
scope: __scopeTooltip,
|
|
@@ -8713,7 +7342,7 @@ var Tooltip$1 = (props) => {
|
|
|
8713
7342
|
}
|
|
8714
7343
|
};
|
|
8715
7344
|
}, []);
|
|
8716
|
-
return /* @__PURE__ */
|
|
7345
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8717
7346
|
TooltipContextProvider,
|
|
8718
7347
|
{
|
|
8719
7348
|
scope: __scopeTooltip,
|
|
@@ -8757,7 +7386,7 @@ var TooltipTrigger$1 = React__namespace.forwardRef(
|
|
|
8757
7386
|
React__namespace.useEffect(() => {
|
|
8758
7387
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
8759
7388
|
}, [handlePointerUp]);
|
|
8760
|
-
return /* @__PURE__ */
|
|
7389
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8761
7390
|
Primitive.button,
|
|
8762
7391
|
{
|
|
8763
7392
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -8799,7 +7428,7 @@ var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
|
|
8799
7428
|
var TooltipPortal = (props) => {
|
|
8800
7429
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
8801
7430
|
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
|
8802
|
-
return /* @__PURE__ */
|
|
7431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Portal$3, { asChild: true, container, children }) }) });
|
|
8803
7432
|
};
|
|
8804
7433
|
TooltipPortal.displayName = PORTAL_NAME;
|
|
8805
7434
|
var CONTENT_NAME = "TooltipContent";
|
|
@@ -8808,7 +7437,7 @@ var TooltipContent$1 = React__namespace.forwardRef(
|
|
|
8808
7437
|
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
|
8809
7438
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
8810
7439
|
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
8811
|
-
return /* @__PURE__ */
|
|
7440
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsxRuntime.jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
8812
7441
|
}
|
|
8813
7442
|
);
|
|
8814
7443
|
var TooltipContentHoverable = React__namespace.forwardRef((props, forwardedRef) => {
|
|
@@ -8870,7 +7499,7 @@ var TooltipContentHoverable = React__namespace.forwardRef((props, forwardedRef)
|
|
|
8870
7499
|
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
8871
7500
|
}
|
|
8872
7501
|
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
8873
|
-
return /* @__PURE__ */
|
|
7502
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
8874
7503
|
});
|
|
8875
7504
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
8876
7505
|
var Slottable = createSlottable("TooltipContent");
|
|
@@ -8901,7 +7530,7 @@ var TooltipContentImpl = React__namespace.forwardRef(
|
|
|
8901
7530
|
return () => window.removeEventListener("scroll", handleScroll, { capture: true });
|
|
8902
7531
|
}
|
|
8903
7532
|
}, [context.trigger, onClose]);
|
|
8904
|
-
return /* @__PURE__ */
|
|
7533
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8905
7534
|
DismissableLayer,
|
|
8906
7535
|
{
|
|
8907
7536
|
asChild: true,
|
|
@@ -8910,7 +7539,7 @@ var TooltipContentImpl = React__namespace.forwardRef(
|
|
|
8910
7539
|
onPointerDownOutside,
|
|
8911
7540
|
onFocusOutside: (event) => event.preventDefault(),
|
|
8912
7541
|
onDismiss: onClose,
|
|
8913
|
-
children: /* @__PURE__ */
|
|
7542
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8914
7543
|
Content,
|
|
8915
7544
|
{
|
|
8916
7545
|
"data-state": context.stateAttribute,
|
|
@@ -8929,8 +7558,8 @@ var TooltipContentImpl = React__namespace.forwardRef(
|
|
|
8929
7558
|
}
|
|
8930
7559
|
},
|
|
8931
7560
|
children: [
|
|
8932
|
-
/* @__PURE__ */
|
|
8933
|
-
/* @__PURE__ */
|
|
7561
|
+
/* @__PURE__ */ jsxRuntime.jsx(Slottable, { children }),
|
|
7562
|
+
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntime.jsx(Root$3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
8934
7563
|
]
|
|
8935
7564
|
}
|
|
8936
7565
|
)
|
|
@@ -8948,7 +7577,7 @@ var TooltipArrow = React__namespace.forwardRef(
|
|
|
8948
7577
|
ARROW_NAME,
|
|
8949
7578
|
__scopeTooltip
|
|
8950
7579
|
);
|
|
8951
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */
|
|
7580
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
8952
7581
|
}
|
|
8953
7582
|
);
|
|
8954
7583
|
TooltipArrow.displayName = ARROW_NAME;
|
|
@@ -9104,24 +7733,27 @@ const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50
|
|
|
9104
7733
|
});
|
|
9105
7734
|
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
9106
7735
|
const Comp = asChild ? Slot$2 : "button";
|
|
9107
|
-
return (
|
|
7736
|
+
return (jsxRuntime.jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
9108
7737
|
}
|
|
9109
7738
|
|
|
9110
7739
|
function Input({ className, type, ...props }) {
|
|
9111
|
-
return (
|
|
7740
|
+
return (jsxRuntime.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 }));
|
|
9112
7741
|
}
|
|
9113
7742
|
|
|
9114
7743
|
function DropdownMenu({ ...props }) {
|
|
9115
|
-
return
|
|
7744
|
+
return jsxRuntime.jsx(Root2$1, { "data-slot": "dropdown-menu", ...props });
|
|
9116
7745
|
}
|
|
9117
7746
|
function DropdownMenuTrigger({ ...props }) {
|
|
9118
|
-
return (
|
|
7747
|
+
return (jsxRuntime.jsx(Trigger$2, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
9119
7748
|
}
|
|
9120
7749
|
function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
9121
|
-
return (
|
|
7750
|
+
return (jsxRuntime.jsx(Portal2, { children: jsxRuntime.jsx(Content2$2, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, align: align, className: className, ...props }) }));
|
|
9122
7751
|
}
|
|
9123
7752
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
9124
|
-
return (
|
|
7753
|
+
return (jsxRuntime.jsx(Item2, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: className, ...props }));
|
|
7754
|
+
}
|
|
7755
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
7756
|
+
return (jsxRuntime.jsx(Separator2, { "data-slot": "dropdown-menu-separator", className: className, ...props }));
|
|
9125
7757
|
}
|
|
9126
7758
|
|
|
9127
7759
|
function DataTableHeader({ title, description, actions = [], search, searchValue = "", onSearchChange, table, selectedCount = 0, className, }) {
|
|
@@ -9138,22 +7770,22 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9138
7770
|
const renderAction = (action, index) => {
|
|
9139
7771
|
// Dropdown Action
|
|
9140
7772
|
if (action.children && action.children.length > 0) {
|
|
9141
|
-
return (
|
|
9142
|
-
"text-destructive focus:text-destructive"), children: [child.icon &&
|
|
7773
|
+
return (jsxRuntime.jsxs(DropdownMenu, { children: [jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: jsxRuntime.jsxs(Button, { variant: action.variant || "outline", size: action.size || "default", disabled: action.disabled || action.loading, children: [action.icon, jsxRuntime.jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label }), jsxRuntime.jsx(lucideReact.ChevronDown, { className: "ml-2 h-4 w-4" })] }) }), jsxRuntime.jsx(DropdownMenuContent, { align: "end", children: action.children.map((child, childIndex) => (jsxRuntime.jsxs(DropdownMenuItem, { onClick: child.onClick, className: cn(child.variant === "destructive" &&
|
|
7774
|
+
"text-destructive focus:text-destructive"), children: [child.icon && jsxRuntime.jsx("span", { className: "mr-2", children: child.icon }), child.label] }, child.id || childIndex))) })] }, action.id || index));
|
|
9143
7775
|
}
|
|
9144
7776
|
// Link Action
|
|
9145
7777
|
if (action.href) {
|
|
9146
|
-
return (
|
|
7778
|
+
return (jsxRuntime.jsx(Button, { variant: action.variant || "outline", size: action.size || "default", disabled: action.disabled || action.loading, asChild: true, children: jsxRuntime.jsxs("a", { href: action.href, children: [action.icon, action.size !== "icon" && (jsxRuntime.jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label }))] }) }, action.id || index));
|
|
9147
7779
|
}
|
|
9148
7780
|
// Normal Button Action
|
|
9149
|
-
return (
|
|
7781
|
+
return (jsxRuntime.jsxs(Button, { variant: action.variant || "outline", size: action.size || "default", disabled: action.disabled || action.loading, onClick: () => {
|
|
9150
7782
|
if (action.bulk && action.bulkOnClick) {
|
|
9151
7783
|
action.bulkOnClick(getSelectedRows());
|
|
9152
7784
|
}
|
|
9153
7785
|
else if (action.onClick) {
|
|
9154
7786
|
action.onClick();
|
|
9155
7787
|
}
|
|
9156
|
-
}, children: [action.loading ? (
|
|
7788
|
+
}, children: [action.loading ? (jsxRuntime.jsxs("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", children: [jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", fill: "none" }), jsxRuntime.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" && (jsxRuntime.jsx("span", { className: cn(action.icon || action.loading ? "ml-2" : ""), children: action.label }))] }, action.id || index));
|
|
9157
7789
|
};
|
|
9158
7790
|
// Kein Header wenn nichts konfiguriert
|
|
9159
7791
|
if (!title &&
|
|
@@ -9162,7 +7794,7 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9162
7794
|
!search?.enabled) {
|
|
9163
7795
|
return null;
|
|
9164
7796
|
}
|
|
9165
|
-
return (
|
|
7797
|
+
return (jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-4", className), children: [(title || description) && (jsxRuntime.jsxs("div", { className: "space-y-1", children: [title && (jsxRuntime.jsx("h2", { className: "text-xl font-semibold tracking-tight", children: title })), description && (jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description }))] })), (search?.enabled || normalActions.length > 0 || showBulkActions) && (jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-4 mb-4", children: [search?.enabled && (jsxRuntime.jsxs("div", { className: "relative max-w-sm flex-1", children: [jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), jsxRuntime.jsx(Input, { placeholder: search.placeholder || "Suchen...", value: searchValue, onChange: (e) => onSearchChange?.(e.target.value), className: "pl-9 pr-9" }), searchValue && (jsxRuntime.jsx("button", { onClick: () => onSearchChange?.(""), className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground", children: jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }) }))] })), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [showBulkActions && (jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground", children: [selectedCount, " ausgew\u00E4hlt"] })), showBulkActions &&
|
|
9166
7798
|
bulkActions.map((action, index) => renderAction(action, index)), normalActions.length > 0 &&
|
|
9167
7799
|
normalActions.map((action, index) => renderAction(action, index))] })] }))] }));
|
|
9168
7800
|
}
|
|
@@ -9170,29 +7802,29 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9170
7802
|
// components/ui/data-table/data-table-empty.tsx
|
|
9171
7803
|
function DataTableEmpty({ config, colSpan, className, }) {
|
|
9172
7804
|
const { icon, imageUrl, title, description, action, variant } = config;
|
|
9173
|
-
return (
|
|
7805
|
+
return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: colSpan, className: cn("h-[400px]", className), children: jsxRuntime.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-4 text-center p-8", children: [imageUrl ? (jsxRuntime.jsx("img", { className: "w-24 h-24", src: imageUrl, alt: "Empty State" })) : icon ? (jsxRuntime.jsx("div", { className: cn("rounded-full p-4", variant === "error" ? "bg-destructive/10" : "bg-muted"), children: icon })) : null, jsxRuntime.jsxs("div", { className: "w-full flex flex-col items-center justify-center gap-2", children: [jsxRuntime.jsx("h3", { className: "text-sm font-semibold text-foreground whitespace-normal break-words", children: title }), description && (jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-normal whitespace-normal break-words leading-relaxed", children: description }))] }), action && (jsxRuntime.jsx(Button, { variant: variant === "error" ? "outline" : "default", onClick: action.onClick, asChild: !!action.href, className: "mt-2", children: action.href ? (jsxRuntime.jsxs("a", { href: action.href, children: [action.icon, jsxRuntime.jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [action.icon, jsxRuntime.jsx("span", { className: cn(action.icon ? "ml-2" : ""), children: action.label })] })) }))] }) }) }));
|
|
9174
7806
|
}
|
|
9175
7807
|
|
|
9176
7808
|
function Select({ ...props }) {
|
|
9177
|
-
return
|
|
7809
|
+
return jsxRuntime.jsx(Root2, { "data-slot": "select", ...props });
|
|
9178
7810
|
}
|
|
9179
7811
|
function SelectValue({ ...props }) {
|
|
9180
|
-
return
|
|
7812
|
+
return jsxRuntime.jsx(Value, { "data-slot": "select-value", ...props });
|
|
9181
7813
|
}
|
|
9182
7814
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
9183
|
-
return (
|
|
7815
|
+
return (jsxRuntime.jsxs(Trigger$1, { "data-slot": "select-trigger", "data-size": size, className: className, ...props, children: [children, jsxRuntime.jsx(Icon, { asChild: true, children: jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "text-muted-foreground size-4 pointer-events-none" }) })] }));
|
|
9184
7816
|
}
|
|
9185
7817
|
function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
|
|
9186
|
-
return (
|
|
7818
|
+
return (jsxRuntime.jsx(Portal$1, { children: jsxRuntime.jsxs(Content2$1, { "data-slot": "select-content", "data-align-trigger": position === "item-aligned", className: className, position: position, align: align, ...props, children: [jsxRuntime.jsx(SelectScrollUpButton, {}), jsxRuntime.jsx(Viewport, { "data-position": position, className: className, children: children }), jsxRuntime.jsx(SelectScrollDownButton, {})] }) }));
|
|
9187
7819
|
}
|
|
9188
7820
|
function SelectItem({ className, children, ...props }) {
|
|
9189
|
-
return (
|
|
7821
|
+
return (jsxRuntime.jsxs(Item, { "data-slot": "select-item", className: className, ...props, children: [jsxRuntime.jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: jsxRuntime.jsx(ItemIndicator, { children: jsxRuntime.jsx(lucideReact.CheckIcon, { className: "pointer-events-none" }) }) }), jsxRuntime.jsx(ItemText, { children: children })] }));
|
|
9190
7822
|
}
|
|
9191
7823
|
function SelectScrollUpButton({ className, ...props }) {
|
|
9192
|
-
return (
|
|
7824
|
+
return (jsxRuntime.jsx(ScrollUpButton, { "data-slot": "select-scroll-up-button", className: className, ...props, children: jsxRuntime.jsx(lucideReact.ChevronUpIcon, {}) }));
|
|
9193
7825
|
}
|
|
9194
7826
|
function SelectScrollDownButton({ className, ...props }) {
|
|
9195
|
-
return (
|
|
7827
|
+
return (jsxRuntime.jsx(ScrollDownButton, { "data-slot": "select-scroll-down-button", className: className, ...props, children: jsxRuntime.jsx(lucideReact.ChevronDownIcon, {}) }));
|
|
9196
7828
|
}
|
|
9197
7829
|
|
|
9198
7830
|
// components/ui/data-table/data-table-pagination.tsx
|
|
@@ -9200,7 +7832,7 @@ function DataTablePagination({ table, config, className, }) {
|
|
|
9200
7832
|
if (!config?.enabled)
|
|
9201
7833
|
return null;
|
|
9202
7834
|
const { showPageInfo = true, showPageSizeSelector = true, pageSizeOptions = [10, 20, 30, 50, 100], } = config;
|
|
9203
|
-
return (
|
|
7835
|
+
return (jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center sm:justify-between", className), children: [jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: table.getFilteredSelectedRowModel().rows.length > 0 ? (jsxRuntime.jsxs("span", { children: [table.getFilteredSelectedRowModel().rows.length, " von", " ", table.getFilteredRowModel().rows.length, " Zeile(n) ausgew\u00E4hlt"] })) : showPageInfo ? (jsxRuntime.jsxs("span", { children: [table.getFilteredRowModel().rows.length, " Eintr\u00E4ge"] })) : null }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:gap-6", children: [showPageSizeSelector && (jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Zeilen pro Seite" }), jsxRuntime.jsxs(Select, { value: `${table.getState().pagination.pageSize}`, onValueChange: (value) => table.setPageSize(Number(value)), children: [jsxRuntime.jsx(SelectTrigger, { className: "h-8 w-[70px]", children: jsxRuntime.jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }), jsxRuntime.jsx(SelectContent, { side: "top", children: pageSizeOptions.map((pageSize) => (jsxRuntime.jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize))) })] })] })), showPageInfo && (jsxRuntime.jsxs("div", { className: "text-sm text-muted-foreground whitespace-nowrap", children: ["Seite ", table.getState().pagination.pageIndex + 1, " von", " ", table.getPageCount()] })), jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [jsxRuntime.jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.setPageIndex(0), disabled: !table.getCanPreviousPage(), children: [jsxRuntime.jsx(lucideReact.ChevronsLeft, { className: "h-4 w-4" }), jsxRuntime.jsx("span", { className: "sr-only", children: "Erste Seite" })] }), jsxRuntime.jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), children: [jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }), jsxRuntime.jsx("span", { className: "sr-only", children: "Vorherige Seite" })] }), jsxRuntime.jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), children: [jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" }), jsxRuntime.jsx("span", { className: "sr-only", children: "N\u00E4chste Seite" })] }), jsxRuntime.jsxs(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.setPageIndex(table.getPageCount() - 1), disabled: !table.getCanNextPage(), children: [jsxRuntime.jsx(lucideReact.ChevronsRight, { className: "h-4 w-4" }), jsxRuntime.jsx("span", { className: "sr-only", children: "Letzte Seite" })] })] })] })] }));
|
|
9204
7836
|
}
|
|
9205
7837
|
|
|
9206
7838
|
/**
|
|
@@ -9350,24 +7982,24 @@ function DataTable({ columns, data, config = {}, className, isLoading = false, i
|
|
|
9350
7982
|
};
|
|
9351
7983
|
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
9352
7984
|
const hasRows = table.getRowModel().rows?.length > 0;
|
|
9353
|
-
return (
|
|
7985
|
+
return (jsxRuntime.jsxs("div", { className: cn("flex flex-col", className), children: [jsxRuntime.jsx(DataTableHeader, { title: config.title, description: config.description, actions: config.headerActions, search: config.search, searchValue: globalFilter, onSearchChange: setGlobalFilter, table: table, selectedCount: selectedCount }), jsxRuntime.jsx("div", { className: cn("overflow-hidden", config.bordered !== false && "rounded-md border"), children: jsxRuntime.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: [jsxRuntime.jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => (jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header) => (jsxRuntime.jsx(TableHead, { children: header.isPlaceholder
|
|
9354
7986
|
? null
|
|
9355
|
-
: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }),
|
|
7987
|
+
: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }), jsxRuntime.jsx(TableBody, { children: isLoading ? (
|
|
9356
7988
|
// Loading State
|
|
9357
|
-
|
|
7989
|
+
jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: columns.length, className: "h-[400px]", children: jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-4", children: [jsxRuntime.jsxs("svg", { className: "animate-spin h-8 w-8 text-muted-foreground", viewBox: "0 0 24 24", children: [jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", fill: "none" }), jsxRuntime.jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] }), jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Laden..." })] }) }) }) })) : hasRows ? (
|
|
9358
7990
|
// Data Rows
|
|
9359
|
-
table.getRowModel().rows.map((row) => (
|
|
7991
|
+
table.getRowModel().rows.map((row) => (jsxRuntime.jsx(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (jsxRuntime.jsx(TableCell, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (
|
|
9360
7992
|
// Empty State
|
|
9361
|
-
|
|
7993
|
+
jsxRuntime.jsx(DataTableEmpty, { config: getEmptyState(), colSpan: columns.length })) })] }) }), config.pagination?.enabled && hasRows && (jsxRuntime.jsx(DataTablePagination, { table: table, config: config.pagination }))] }));
|
|
9362
7994
|
}
|
|
9363
7995
|
|
|
9364
7996
|
const DataTableSchema = (props) => {
|
|
9365
|
-
return (
|
|
7997
|
+
return (jsxRuntime.jsx("div", { className: "data-table-schema", children: jsxRuntime.jsx("p", { children: "TableSchema Placeholder" }) }));
|
|
9366
7998
|
};
|
|
9367
7999
|
|
|
9368
8000
|
const AvatarList = ({ items, maxVisible = 5, size = 32, ...props }) => {
|
|
9369
8001
|
const sizeValue = typeof size === "string" ? parseInt(size, 10) || 32 : size;
|
|
9370
|
-
return (
|
|
8002
|
+
return (jsxRuntime.jsxs("div", { className: "avatar-list", style: { "--avatar-size": `${sizeValue}px` }, ...props, children: [items.slice(0, maxVisible).map((item) => (jsxRuntime.jsx("div", { className: "avatar-item", children: item.src ? (jsxRuntime.jsx("img", { src: item.src, alt: item.alt || "Avatar", style: { width: `${sizeValue}px`, height: `${sizeValue}px` } })) : (jsxRuntime.jsx("div", { className: "avatar-initials", style: { width: `${sizeValue}px`, height: `${sizeValue}px` }, children: item.initials || "?" })) }, item.id))), items.length > maxVisible && (jsxRuntime.jsxs("div", { className: "avatar-count", style: { width: `${sizeValue}px`, height: `${sizeValue}px` }, children: ["+", items.length - maxVisible] }))] }));
|
|
9371
8003
|
};
|
|
9372
8004
|
|
|
9373
8005
|
class BaseColumn {
|
|
@@ -9512,7 +8144,7 @@ class AvatarGroupColumn extends BaseColumn {
|
|
|
9512
8144
|
const { accessor, label, maxVisible, size, overlap, showTooltip, nameField, srcField, fallbackField, showNames, maxNames, } = config;
|
|
9513
8145
|
return {
|
|
9514
8146
|
accessorKey: accessor,
|
|
9515
|
-
header: () => (
|
|
8147
|
+
header: () => (jsxRuntime.jsx("span", { className: cn("text-muted-foreground font-medium", this.getAlignmentClass(), this.config.headerClassName), children: label || String(accessor) })),
|
|
9516
8148
|
cell: ({ getValue, row }) => {
|
|
9517
8149
|
const rawValue = getValue();
|
|
9518
8150
|
// Items aus den Daten extrahieren
|
|
@@ -9541,11 +8173,11 @@ class AvatarGroupColumn extends BaseColumn {
|
|
|
9541
8173
|
});
|
|
9542
8174
|
}
|
|
9543
8175
|
if (items.length === 0) {
|
|
9544
|
-
return
|
|
8176
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
9545
8177
|
}
|
|
9546
8178
|
// Konvertiere zu Datenstruktur für AvatarList
|
|
9547
8179
|
const contacts = this.toContactItems(items);
|
|
9548
|
-
return (
|
|
8180
|
+
return (jsxRuntime.jsx("div", { className: cn("flex items-center", this.config.cellClassName), children: jsxRuntime.jsx(AvatarList, { items: contacts.map((contact) => ({
|
|
9549
8181
|
id: contact.id,
|
|
9550
8182
|
src: contact.src,
|
|
9551
8183
|
alt: contact.alt,
|
|
@@ -9577,7 +8209,7 @@ const badgeVariants = cva("inline-flex items-center justify-center rounded-full
|
|
|
9577
8209
|
});
|
|
9578
8210
|
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
9579
8211
|
const Comp = asChild ? Slot$2 : "span";
|
|
9580
|
-
return (
|
|
8212
|
+
return (jsxRuntime.jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
9581
8213
|
}
|
|
9582
8214
|
|
|
9583
8215
|
class BadgeColumn extends BaseColumn {
|
|
@@ -9617,17 +8249,17 @@ class BadgeColumn extends BaseColumn {
|
|
|
9617
8249
|
header: ({ column }) => {
|
|
9618
8250
|
const displayLabel = label || String(accessor);
|
|
9619
8251
|
if (!sortable) {
|
|
9620
|
-
return (
|
|
8252
|
+
return (jsxRuntime.jsx("span", { className: cn("text-muted-foreground font-medium", this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
9621
8253
|
}
|
|
9622
|
-
return (
|
|
8254
|
+
return (jsxRuntime.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, jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
9623
8255
|
},
|
|
9624
8256
|
cell: ({ getValue }) => {
|
|
9625
8257
|
const value = String(getValue());
|
|
9626
8258
|
const variantConfig = variants?.[value];
|
|
9627
8259
|
if (!variantConfig) {
|
|
9628
|
-
return (
|
|
8260
|
+
return (jsxRuntime.jsx(Badge, { variant: "outline", className: this.config.cellClassName, children: value }));
|
|
9629
8261
|
}
|
|
9630
|
-
return (
|
|
8262
|
+
return (jsxRuntime.jsxs(Badge, { variant: variantConfig.variant === "success" ||
|
|
9631
8263
|
variantConfig.variant === "warning" ||
|
|
9632
8264
|
variantConfig.variant === "info" ||
|
|
9633
8265
|
variantConfig.variant === "muted"
|
|
@@ -9645,13 +8277,13 @@ const ButtonColumn = (config) => {
|
|
|
9645
8277
|
header: config.header || "Button",
|
|
9646
8278
|
cell: ({ row }) => {
|
|
9647
8279
|
const value = row.getValue(accessorKey);
|
|
9648
|
-
return (
|
|
8280
|
+
return (jsxRuntime.jsx(Button, { onClick: () => config.onClick && config.onClick(row.original), children: value || config.label || "Click" }));
|
|
9649
8281
|
},
|
|
9650
8282
|
};
|
|
9651
8283
|
};
|
|
9652
8284
|
|
|
9653
8285
|
function Checkbox({ className, ...props }) {
|
|
9654
|
-
return (
|
|
8286
|
+
return (jsxRuntime.jsx(Checkbox$1, { "data-slot": "checkbox", className: className, ...props, children: jsxRuntime.jsx(CheckboxIndicator, { "data-slot": "checkbox-indicator", className: "[&>svg]:size-3.5 grid place-content-center text-current transition-none", children: jsxRuntime.jsx(lucideReact.CheckIcon, {}) }) }));
|
|
9655
8287
|
}
|
|
9656
8288
|
|
|
9657
8289
|
class CheckboxColumn {
|
|
@@ -9661,8 +8293,8 @@ class CheckboxColumn {
|
|
|
9661
8293
|
build() {
|
|
9662
8294
|
return {
|
|
9663
8295
|
id: 'select',
|
|
9664
|
-
header: ({ table }) => (
|
|
9665
|
-
cell: ({ row }) => (
|
|
8296
|
+
header: ({ table }) => (jsxRuntime.jsx(Checkbox, { checked: table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate'), onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value), "aria-label": "Alle ausw\u00E4hlen" })),
|
|
8297
|
+
cell: ({ row }) => (jsxRuntime.jsx(Checkbox, { checked: row.getIsSelected(), onCheckedChange: (value) => row.toggleSelected(!!value), "aria-label": "Zeile ausw\u00E4hlen" })),
|
|
9666
8298
|
enableSorting: false,
|
|
9667
8299
|
enableHiding: false,
|
|
9668
8300
|
};
|
|
@@ -9748,21 +8380,21 @@ class DateColumn extends BaseColumn {
|
|
|
9748
8380
|
header: ({ column }) => {
|
|
9749
8381
|
const displayLabel = label || String(accessor);
|
|
9750
8382
|
if (!sortable) {
|
|
9751
|
-
return (
|
|
8383
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
9752
8384
|
}
|
|
9753
|
-
return (
|
|
8385
|
+
return (jsxRuntime.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, jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
9754
8386
|
},
|
|
9755
8387
|
cell: ({ getValue }) => {
|
|
9756
8388
|
const value = getValue();
|
|
9757
8389
|
if (!value) {
|
|
9758
|
-
return
|
|
8390
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
9759
8391
|
}
|
|
9760
8392
|
const date = value instanceof Date ? value : new Date(value);
|
|
9761
8393
|
if (isNaN(date.getTime())) {
|
|
9762
|
-
return
|
|
8394
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Ung\u00FCltiges Datum" });
|
|
9763
8395
|
}
|
|
9764
8396
|
const formatted = this.formatDate(date, format || 'short', locale || 'de-DE');
|
|
9765
|
-
return (
|
|
8397
|
+
return (jsxRuntime.jsxs("span", { className: cn('flex items-center gap-2', this.getAlignmentClass(), this.config.cellClassName), children: [showIcon && jsxRuntime.jsx(lucideReact.Calendar, { className: "text-muted-foreground h-4 w-4" }), formatted] }));
|
|
9766
8398
|
},
|
|
9767
8399
|
};
|
|
9768
8400
|
}
|
|
@@ -9775,22 +8407,22 @@ const DropdownColumn = (config) => {
|
|
|
9775
8407
|
header: config.header || "Options",
|
|
9776
8408
|
cell: ({ row }) => {
|
|
9777
8409
|
const value = row.getValue(accessorKey);
|
|
9778
|
-
return (
|
|
8410
|
+
return (jsxRuntime.jsxs(DropdownMenu, { children: [jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "outline", children: value || "Options" }) }), jsxRuntime.jsx(DropdownMenuContent, { children: config.options.map((option, index) => (jsxRuntime.jsx(DropdownMenuItem, { onClick: () => option.onClick && option.onClick(row.original), children: option.label }, index))) })] }));
|
|
9779
8411
|
},
|
|
9780
8412
|
};
|
|
9781
8413
|
};
|
|
9782
8414
|
|
|
9783
8415
|
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
9784
|
-
return (
|
|
8416
|
+
return (jsxRuntime.jsx(Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }));
|
|
9785
8417
|
}
|
|
9786
8418
|
function Tooltip({ ...props }) {
|
|
9787
|
-
return (
|
|
8419
|
+
return (jsxRuntime.jsx(TooltipProvider, { children: jsxRuntime.jsx(Root3, { "data-slot": "tooltip", ...props }) }));
|
|
9788
8420
|
}
|
|
9789
8421
|
function TooltipTrigger({ ...props }) {
|
|
9790
|
-
return
|
|
8422
|
+
return jsxRuntime.jsx(Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
9791
8423
|
}
|
|
9792
8424
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
9793
|
-
return (
|
|
8425
|
+
return (jsxRuntime.jsx(Portal, { children: jsxRuntime.jsxs(Content2, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: className, ...props, children: [children, jsxRuntime.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)]" })] }) }));
|
|
9794
8426
|
}
|
|
9795
8427
|
|
|
9796
8428
|
class IconColumn extends BaseColumn {
|
|
@@ -9960,34 +8592,34 @@ class IconColumn extends BaseColumn {
|
|
|
9960
8592
|
}
|
|
9961
8593
|
// === ICON HELPERS (inline SVGs um Lucide-Abhängigkeit zu vermeiden) ===
|
|
9962
8594
|
createCheckIcon() {
|
|
9963
|
-
return (
|
|
8595
|
+
return (jsxRuntime.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: jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" }) }));
|
|
9964
8596
|
}
|
|
9965
8597
|
createXIcon() {
|
|
9966
|
-
return (
|
|
8598
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), jsxRuntime.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }));
|
|
9967
8599
|
}
|
|
9968
8600
|
createCircleIcon() {
|
|
9969
|
-
return (
|
|
8601
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "6" }) }));
|
|
9970
8602
|
}
|
|
9971
8603
|
createArrowUpIcon() {
|
|
9972
|
-
return (
|
|
8604
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("line", { x1: "12", y1: "19", x2: "12", y2: "5" }), jsxRuntime.jsx("polyline", { points: "5 12 12 5 19 12" })] }));
|
|
9973
8605
|
}
|
|
9974
8606
|
createArrowDownIcon() {
|
|
9975
|
-
return (
|
|
8607
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), jsxRuntime.jsx("polyline", { points: "19 12 12 19 5 12" })] }));
|
|
9976
8608
|
}
|
|
9977
8609
|
createMinusIcon() {
|
|
9978
|
-
return (
|
|
8610
|
+
return (jsxRuntime.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: jsxRuntime.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) }));
|
|
9979
8611
|
}
|
|
9980
8612
|
createAlertIcon() {
|
|
9981
|
-
return (
|
|
8613
|
+
return (jsxRuntime.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: [jsxRuntime.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" }), jsxRuntime.jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), jsxRuntime.jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }));
|
|
9982
8614
|
}
|
|
9983
8615
|
createShieldCheckIcon() {
|
|
9984
|
-
return (
|
|
8616
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }), jsxRuntime.jsx("polyline", { points: "9 12 11 14 15 10" })] }));
|
|
9985
8617
|
}
|
|
9986
8618
|
createShieldXIcon() {
|
|
9987
|
-
return (
|
|
8619
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }), jsxRuntime.jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }), jsxRuntime.jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" })] }));
|
|
9988
8620
|
}
|
|
9989
8621
|
createClockIcon() {
|
|
9990
|
-
return (
|
|
8622
|
+
return (jsxRuntime.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: [jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }), jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })] }));
|
|
9991
8623
|
}
|
|
9992
8624
|
build() {
|
|
9993
8625
|
const config = this.config;
|
|
@@ -10015,9 +8647,9 @@ class IconColumn extends BaseColumn {
|
|
|
10015
8647
|
header: ({ column }) => {
|
|
10016
8648
|
const displayLabel = label || String(accessor);
|
|
10017
8649
|
if (!sortable) {
|
|
10018
|
-
return (
|
|
8650
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10019
8651
|
}
|
|
10020
|
-
return (
|
|
8652
|
+
return (jsxRuntime.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, jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10021
8653
|
},
|
|
10022
8654
|
cell: ({ getValue }) => {
|
|
10023
8655
|
const value = String(getValue());
|
|
@@ -10029,14 +8661,14 @@ class IconColumn extends BaseColumn {
|
|
|
10029
8661
|
const bgColor = stateConfig?.bgColor;
|
|
10030
8662
|
const tooltip = stateConfig?.tooltip || stateLabel;
|
|
10031
8663
|
if (!icon) {
|
|
10032
|
-
return
|
|
8664
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10033
8665
|
}
|
|
10034
8666
|
// Icon als Element rendern (falls LucideIcon übergeben wurde)
|
|
10035
8667
|
const IconElement = typeof icon === 'function' ? icon : null;
|
|
10036
|
-
const renderedIcon = IconElement ?
|
|
10037
|
-
const iconElement = (
|
|
8668
|
+
const renderedIcon = IconElement ? jsxRuntime.jsx(IconElement, { className: "h-full w-full" }) : icon;
|
|
8669
|
+
const iconElement = (jsxRuntime.jsxs("div", { className: cn('flex items-center gap-2', this.getAlignmentClass(), this.config.cellClassName), children: [withBackground ? (jsxRuntime.jsx("div", { className: cn('inline-flex items-center justify-center rounded-md', bgSizeClasses[size || 'md'], bgColor || 'bg-blue-50'), children: jsxRuntime.jsx("div", { className: cn(iconInBgSizeClasses[size || 'md'], color), children: renderedIcon }) })) : (jsxRuntime.jsx("div", { className: cn(sizeClasses[size || 'md'], color), children: renderedIcon })), showLabel && jsxRuntime.jsx("span", { className: cn('text-sm', color), children: stateLabel })] }));
|
|
10038
8670
|
if (showTooltip) {
|
|
10039
|
-
return (
|
|
8671
|
+
return (jsxRuntime.jsx(TooltipProvider, { children: jsxRuntime.jsxs(Tooltip, { children: [jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: iconElement }), jsxRuntime.jsx(TooltipContent, { children: jsxRuntime.jsx("p", { children: tooltip }) })] }) }));
|
|
10040
8672
|
}
|
|
10041
8673
|
return iconElement;
|
|
10042
8674
|
},
|
|
@@ -10044,6 +8676,68 @@ class IconColumn extends BaseColumn {
|
|
|
10044
8676
|
}
|
|
10045
8677
|
}
|
|
10046
8678
|
|
|
8679
|
+
class ImageColumn extends BaseColumn {
|
|
8680
|
+
constructor(accessor) {
|
|
8681
|
+
super(accessor);
|
|
8682
|
+
this.config.size = 'md';
|
|
8683
|
+
this.config.rounded = 'md';
|
|
8684
|
+
}
|
|
8685
|
+
static make(accessor) {
|
|
8686
|
+
return new ImageColumn(accessor);
|
|
8687
|
+
}
|
|
8688
|
+
size(size) {
|
|
8689
|
+
this.config.size = size;
|
|
8690
|
+
return this;
|
|
8691
|
+
}
|
|
8692
|
+
rounded(rounded) {
|
|
8693
|
+
this.config.rounded = rounded;
|
|
8694
|
+
return this;
|
|
8695
|
+
}
|
|
8696
|
+
circular() {
|
|
8697
|
+
return this.rounded('full');
|
|
8698
|
+
}
|
|
8699
|
+
square() {
|
|
8700
|
+
return this.rounded('none');
|
|
8701
|
+
}
|
|
8702
|
+
fallback(url) {
|
|
8703
|
+
this.config.fallback = url;
|
|
8704
|
+
return this;
|
|
8705
|
+
}
|
|
8706
|
+
alt(fn) {
|
|
8707
|
+
this.config.alt = fn;
|
|
8708
|
+
return this;
|
|
8709
|
+
}
|
|
8710
|
+
build() {
|
|
8711
|
+
const config = this.config;
|
|
8712
|
+
const { accessor, label, size, rounded, fallback, alt } = config;
|
|
8713
|
+
const sizeClasses = {
|
|
8714
|
+
sm: 'h-8 w-8',
|
|
8715
|
+
md: 'h-10 w-10',
|
|
8716
|
+
lg: 'h-12 w-12',
|
|
8717
|
+
};
|
|
8718
|
+
const roundedClasses = {
|
|
8719
|
+
none: 'rounded-none',
|
|
8720
|
+
sm: 'rounded-sm',
|
|
8721
|
+
md: 'rounded-md',
|
|
8722
|
+
lg: 'rounded-lg',
|
|
8723
|
+
full: 'rounded-full',
|
|
8724
|
+
};
|
|
8725
|
+
return {
|
|
8726
|
+
accessorKey: accessor,
|
|
8727
|
+
header: () => jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.config.headerClassName), children: label || '' }),
|
|
8728
|
+
cell: ({ getValue, row }) => {
|
|
8729
|
+
const src = getValue();
|
|
8730
|
+
const altText = alt ? alt(row.original) : 'Bild';
|
|
8731
|
+
return (jsxRuntime.jsx("img", { src: src || fallback || '/placeholder.png', alt: altText, className: cn('object-cover', sizeClasses[size || 'md'], roundedClasses[rounded || 'md'], this.config.cellClassName), onError: (e) => {
|
|
8732
|
+
if (fallback) {
|
|
8733
|
+
e.target.src = fallback;
|
|
8734
|
+
}
|
|
8735
|
+
} }));
|
|
8736
|
+
},
|
|
8737
|
+
};
|
|
8738
|
+
}
|
|
8739
|
+
}
|
|
8740
|
+
|
|
10047
8741
|
const InputColumn = (config) => {
|
|
10048
8742
|
const accessorKey = config.accessorKey || "input";
|
|
10049
8743
|
return {
|
|
@@ -10051,13 +8745,189 @@ const InputColumn = (config) => {
|
|
|
10051
8745
|
header: config.header || "Input",
|
|
10052
8746
|
cell: ({ row }) => {
|
|
10053
8747
|
const value = row.getValue(accessorKey);
|
|
10054
|
-
return (
|
|
8748
|
+
return (jsxRuntime.jsx(Input, { value: value || "", onChange: (e) => config.onChange && config.onChange(row.original, e.target.value), placeholder: config.placeholder || "Enter value" }));
|
|
10055
8749
|
},
|
|
10056
8750
|
};
|
|
10057
8751
|
};
|
|
10058
8752
|
|
|
8753
|
+
class LinkColumn extends BaseColumn {
|
|
8754
|
+
constructor(accessor) {
|
|
8755
|
+
super(accessor);
|
|
8756
|
+
const config = this.config;
|
|
8757
|
+
config.external = false;
|
|
8758
|
+
config.showExternalIcon = false;
|
|
8759
|
+
config.underline = 'hover';
|
|
8760
|
+
config.openInNewTab = false;
|
|
8761
|
+
}
|
|
8762
|
+
static make(accessor) {
|
|
8763
|
+
return new LinkColumn(accessor);
|
|
8764
|
+
}
|
|
8765
|
+
// URL setzen (statisch oder dynamisch)
|
|
8766
|
+
href(href) {
|
|
8767
|
+
this.config.href = href;
|
|
8768
|
+
return this;
|
|
8769
|
+
}
|
|
8770
|
+
// URL aus einem anderen Feld nehmen
|
|
8771
|
+
urlFromField(field) {
|
|
8772
|
+
this.config.href = (row) => String(row[field]);
|
|
8773
|
+
return this;
|
|
8774
|
+
}
|
|
8775
|
+
// Externer Link (zeigt Icon)
|
|
8776
|
+
external(external = true) {
|
|
8777
|
+
const config = this.config;
|
|
8778
|
+
config.external = external;
|
|
8779
|
+
config.showExternalIcon = external;
|
|
8780
|
+
config.openInNewTab = external;
|
|
8781
|
+
return this;
|
|
8782
|
+
}
|
|
8783
|
+
// Icon vor dem Text
|
|
8784
|
+
icon(icon) {
|
|
8785
|
+
this.config.icon = icon;
|
|
8786
|
+
return this;
|
|
8787
|
+
}
|
|
8788
|
+
// External-Icon anzeigen
|
|
8789
|
+
showExternalIcon(show = true) {
|
|
8790
|
+
this.config.showExternalIcon = show;
|
|
8791
|
+
return this;
|
|
8792
|
+
}
|
|
8793
|
+
// Unterstreichung
|
|
8794
|
+
underline(style) {
|
|
8795
|
+
this.config.underline = style;
|
|
8796
|
+
return this;
|
|
8797
|
+
}
|
|
8798
|
+
// In neuem Tab öffnen
|
|
8799
|
+
openInNewTab(open = true) {
|
|
8800
|
+
this.config.openInNewTab = open;
|
|
8801
|
+
return this;
|
|
8802
|
+
}
|
|
8803
|
+
// Click-Handler (für programmatische Navigation)
|
|
8804
|
+
onClick(handler) {
|
|
8805
|
+
this.config.onClick = handler;
|
|
8806
|
+
return this;
|
|
8807
|
+
}
|
|
8808
|
+
build() {
|
|
8809
|
+
const config = this.config;
|
|
8810
|
+
const { accessor, label, sortable, href, icon, showExternalIcon, underline, openInNewTab, onClick } = config;
|
|
8811
|
+
const underlineClasses = {
|
|
8812
|
+
always: 'underline',
|
|
8813
|
+
hover: 'hover:underline',
|
|
8814
|
+
never: 'no-underline',
|
|
8815
|
+
};
|
|
8816
|
+
return {
|
|
8817
|
+
accessorKey: accessor,
|
|
8818
|
+
header: ({ column }) => {
|
|
8819
|
+
const displayLabel = label || String(accessor);
|
|
8820
|
+
if (!sortable) {
|
|
8821
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
8822
|
+
}
|
|
8823
|
+
return (jsxRuntime.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, jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
8824
|
+
},
|
|
8825
|
+
cell: ({ getValue, row }) => {
|
|
8826
|
+
const value = getValue();
|
|
8827
|
+
if (!value) {
|
|
8828
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
8829
|
+
}
|
|
8830
|
+
// URL berechnen
|
|
8831
|
+
const url = typeof href === 'function' ? href(row.original) : href || value;
|
|
8832
|
+
const handleClick = (e) => {
|
|
8833
|
+
if (onClick) {
|
|
8834
|
+
e.preventDefault();
|
|
8835
|
+
onClick(row.original);
|
|
8836
|
+
}
|
|
8837
|
+
};
|
|
8838
|
+
// Alignment ohne text-muted-foreground für Links
|
|
8839
|
+
const alignmentClass = this.config.align === 'center' ? 'text-center' : this.config.align === 'right' ? 'text-right' : 'text-left';
|
|
8840
|
+
return (jsxRuntime.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, jsxRuntime.jsx("span", { children: value }), showExternalIcon && jsxRuntime.jsx(lucideReact.ExternalLink, { className: "text-muted-foreground h-3 w-3" })] }));
|
|
8841
|
+
},
|
|
8842
|
+
};
|
|
8843
|
+
}
|
|
8844
|
+
}
|
|
8845
|
+
|
|
8846
|
+
class NumberColumn extends BaseColumn {
|
|
8847
|
+
constructor(accessor) {
|
|
8848
|
+
super(accessor);
|
|
8849
|
+
this.config.align = 'right'; // Zahlen standardmäßig rechtsbündig
|
|
8850
|
+
this.config.decimals = 0;
|
|
8851
|
+
this.config.locale = 'de-DE';
|
|
8852
|
+
}
|
|
8853
|
+
static make(accessor) {
|
|
8854
|
+
return new NumberColumn(accessor);
|
|
8855
|
+
}
|
|
8856
|
+
decimals(decimals) {
|
|
8857
|
+
this.config.decimals = decimals;
|
|
8858
|
+
return this;
|
|
8859
|
+
}
|
|
8860
|
+
locale(locale) {
|
|
8861
|
+
this.config.locale = locale;
|
|
8862
|
+
return this;
|
|
8863
|
+
}
|
|
8864
|
+
// Währungsformatierung
|
|
8865
|
+
money(currency = 'EUR') {
|
|
8866
|
+
this.config.currency = currency;
|
|
8867
|
+
this.config.decimals = 2;
|
|
8868
|
+
return this;
|
|
8869
|
+
}
|
|
8870
|
+
// Prozentformatierung
|
|
8871
|
+
percent() {
|
|
8872
|
+
this.config.percent = true;
|
|
8873
|
+
return this;
|
|
8874
|
+
}
|
|
8875
|
+
prefix(prefix) {
|
|
8876
|
+
this.config.prefix = prefix;
|
|
8877
|
+
return this;
|
|
8878
|
+
}
|
|
8879
|
+
suffix(suffix) {
|
|
8880
|
+
this.config.suffix = suffix;
|
|
8881
|
+
return this;
|
|
8882
|
+
}
|
|
8883
|
+
build() {
|
|
8884
|
+
const config = this.config;
|
|
8885
|
+
const { accessor, label, sortable, decimals, locale, currency, percent, prefix, suffix } = config;
|
|
8886
|
+
return {
|
|
8887
|
+
accessorKey: accessor,
|
|
8888
|
+
header: ({ column }) => {
|
|
8889
|
+
const displayLabel = label || String(accessor);
|
|
8890
|
+
if (!sortable) {
|
|
8891
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
8892
|
+
}
|
|
8893
|
+
return (jsxRuntime.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, jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
8894
|
+
},
|
|
8895
|
+
cell: ({ getValue }) => {
|
|
8896
|
+
const value = getValue();
|
|
8897
|
+
if (value === null || value === undefined) {
|
|
8898
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
8899
|
+
}
|
|
8900
|
+
let formatted;
|
|
8901
|
+
if (currency) {
|
|
8902
|
+
formatted = new Intl.NumberFormat(locale, {
|
|
8903
|
+
style: 'currency',
|
|
8904
|
+
currency,
|
|
8905
|
+
minimumFractionDigits: decimals,
|
|
8906
|
+
maximumFractionDigits: decimals,
|
|
8907
|
+
}).format(value);
|
|
8908
|
+
}
|
|
8909
|
+
else if (percent) {
|
|
8910
|
+
formatted = new Intl.NumberFormat(locale, {
|
|
8911
|
+
style: 'percent',
|
|
8912
|
+
minimumFractionDigits: decimals,
|
|
8913
|
+
maximumFractionDigits: decimals,
|
|
8914
|
+
}).format(value / 100);
|
|
8915
|
+
}
|
|
8916
|
+
else {
|
|
8917
|
+
formatted = new Intl.NumberFormat(locale, {
|
|
8918
|
+
minimumFractionDigits: decimals,
|
|
8919
|
+
maximumFractionDigits: decimals,
|
|
8920
|
+
}).format(value);
|
|
8921
|
+
}
|
|
8922
|
+
const displayValue = `${prefix || ''}${formatted}${suffix || ''}`;
|
|
8923
|
+
return jsxRuntime.jsx("span", { className: cn('tabular-nums', this.getAlignmentClass(), this.config.cellClassName), children: displayValue });
|
|
8924
|
+
},
|
|
8925
|
+
};
|
|
8926
|
+
}
|
|
8927
|
+
}
|
|
8928
|
+
|
|
10059
8929
|
function Progress({ className, value, ...props }) {
|
|
10060
|
-
return (
|
|
8930
|
+
return (jsxRuntime.jsx(Root, { "data-slot": "progress", className: className, ...props, children: jsxRuntime.jsx(Indicator, { "data-slot": "progress-indicator", className: "bg-primary size-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) }));
|
|
10061
8931
|
}
|
|
10062
8932
|
|
|
10063
8933
|
class ProgressColumn extends BaseColumn {
|
|
@@ -10157,15 +9027,15 @@ class ProgressColumn extends BaseColumn {
|
|
|
10157
9027
|
header: ({ column }) => {
|
|
10158
9028
|
const displayLabel = label || String(accessor);
|
|
10159
9029
|
if (!sortable) {
|
|
10160
|
-
return (
|
|
9030
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10161
9031
|
}
|
|
10162
|
-
return (
|
|
9032
|
+
return (jsxRuntime.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, jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10163
9033
|
},
|
|
10164
9034
|
cell: ({ getValue }) => {
|
|
10165
9035
|
const value = getValue();
|
|
10166
9036
|
const maxValue = max || 100;
|
|
10167
9037
|
if (value === null || value === undefined) {
|
|
10168
|
-
return
|
|
9038
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10169
9039
|
}
|
|
10170
9040
|
const percentage = Math.min(100, Math.max(0, (value / maxValue) * 100));
|
|
10171
9041
|
// Farbe berechnen
|
|
@@ -10181,7 +9051,7 @@ class ProgressColumn extends BaseColumn {
|
|
|
10181
9051
|
else if (showPercentage) {
|
|
10182
9052
|
labelText = `${Math.round(percentage)}%`;
|
|
10183
9053
|
}
|
|
10184
|
-
return (
|
|
9054
|
+
return (jsxRuntime.jsxs("div", { className: cn('flex min-w-[120px] items-center gap-3', this.config.cellClassName), children: [jsxRuntime.jsx(Progress, { value: percentage, className: cn('flex-1', sizeClasses[size || 'md'], colorClasses[currentColor]) }), labelText && jsxRuntime.jsx("span", { className: "text-muted-foreground min-w-[3rem] text-right text-sm tabular-nums", children: labelText })] }));
|
|
10185
9055
|
},
|
|
10186
9056
|
};
|
|
10187
9057
|
}
|
|
@@ -10194,7 +9064,7 @@ const SelectColumn = (config) => {
|
|
|
10194
9064
|
header: config.header || "Select",
|
|
10195
9065
|
cell: ({ row }) => {
|
|
10196
9066
|
const value = row.getValue(accessorKey);
|
|
10197
|
-
return (
|
|
9067
|
+
return (jsxRuntime.jsxs(Select, { value: value || "", onValueChange: (value) => config.onChange && config.onChange(row.original, value), children: [jsxRuntime.jsx(SelectTrigger, { children: jsxRuntime.jsx(SelectValue, { placeholder: config.placeholder || "Select an option" }) }), jsxRuntime.jsx(SelectContent, { children: config.options.map((option, index) => (jsxRuntime.jsx(SelectItem, { value: option.value, children: option.label }, index))) })] }));
|
|
10198
9068
|
},
|
|
10199
9069
|
};
|
|
10200
9070
|
};
|
|
@@ -10254,9 +9124,9 @@ class TextColumn extends BaseColumn {
|
|
|
10254
9124
|
header: ({ column }) => {
|
|
10255
9125
|
const displayLabel = label || String(accessor);
|
|
10256
9126
|
if (!sortable) {
|
|
10257
|
-
return (
|
|
9127
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10258
9128
|
}
|
|
10259
|
-
return (
|
|
9129
|
+
return (jsxRuntime.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, jsxRuntime.jsx(lucideReact.ArrowUpDown, { className: "ml-2 h-4 w-4" })] }));
|
|
10260
9130
|
},
|
|
10261
9131
|
cell: ({ row, getValue }) => {
|
|
10262
9132
|
let value = getValue();
|
|
@@ -10266,20 +9136,103 @@ class TextColumn extends BaseColumn {
|
|
|
10266
9136
|
}
|
|
10267
9137
|
// Placeholder wenn leer
|
|
10268
9138
|
if (value === null || value === undefined || value === '') {
|
|
10269
|
-
return (
|
|
9139
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground', this.getAlignmentClass(), this.config.cellClassName), children: placeholder || '—' }));
|
|
10270
9140
|
}
|
|
10271
9141
|
// Prefix/Suffix hinzufügen
|
|
10272
9142
|
const displayValue = `${prefix || ''}${value}${suffix || ''}`;
|
|
10273
|
-
return
|
|
9143
|
+
return jsxRuntime.jsx("span", { className: cn(this.getAlignmentClass(), this.config.cellClassName), children: displayValue });
|
|
9144
|
+
},
|
|
9145
|
+
};
|
|
9146
|
+
}
|
|
9147
|
+
}
|
|
9148
|
+
|
|
9149
|
+
class ActionsColumn {
|
|
9150
|
+
config = {
|
|
9151
|
+
actions: [],
|
|
9152
|
+
label: 'Aktionen',
|
|
9153
|
+
};
|
|
9154
|
+
static make() {
|
|
9155
|
+
return new ActionsColumn();
|
|
9156
|
+
}
|
|
9157
|
+
label(label) {
|
|
9158
|
+
this.config.label = label;
|
|
9159
|
+
return this;
|
|
9160
|
+
}
|
|
9161
|
+
triggerIcon(icon) {
|
|
9162
|
+
this.config.triggerIcon = icon;
|
|
9163
|
+
return this;
|
|
9164
|
+
}
|
|
9165
|
+
// Action hinzufügen
|
|
9166
|
+
action(action) {
|
|
9167
|
+
this.config.actions.push(action);
|
|
9168
|
+
return this;
|
|
9169
|
+
}
|
|
9170
|
+
// Shortcuts für gängige Actions
|
|
9171
|
+
view(onClick) {
|
|
9172
|
+
return this.action({ label: 'Anzeigen', onClick });
|
|
9173
|
+
}
|
|
9174
|
+
edit(onClick) {
|
|
9175
|
+
return this.action({ label: 'Bearbeiten', onClick });
|
|
9176
|
+
}
|
|
9177
|
+
delete(onClick) {
|
|
9178
|
+
return this.action({
|
|
9179
|
+
label: 'Löschen',
|
|
9180
|
+
onClick,
|
|
9181
|
+
variant: 'destructive',
|
|
9182
|
+
separator: true,
|
|
9183
|
+
});
|
|
9184
|
+
}
|
|
9185
|
+
link(label, href) {
|
|
9186
|
+
return this.action({ label, href });
|
|
9187
|
+
}
|
|
9188
|
+
separator() {
|
|
9189
|
+
if (this.config.actions.length > 0) {
|
|
9190
|
+
this.config.actions[this.config.actions.length - 1].separator = true;
|
|
9191
|
+
}
|
|
9192
|
+
return this;
|
|
9193
|
+
}
|
|
9194
|
+
build() {
|
|
9195
|
+
const { actions, label, triggerIcon } = this.config;
|
|
9196
|
+
return {
|
|
9197
|
+
id: 'actions',
|
|
9198
|
+
header: () => jsxRuntime.jsx("span", { className: "sr-only", children: label }),
|
|
9199
|
+
cell: ({ row }) => {
|
|
9200
|
+
const data = row.original;
|
|
9201
|
+
const visibleActions = actions.filter((action) => !action.hidden || !action.hidden(data));
|
|
9202
|
+
if (visibleActions.length === 0)
|
|
9203
|
+
return null;
|
|
9204
|
+
return (jsxRuntime.jsxs(DropdownMenu, { children: [jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: jsxRuntime.jsxs(Button, { variant: "ghost", className: "h-10 w-10 p-0", children: [jsxRuntime.jsx("span", { className: "sr-only", children: label }), triggerIcon || jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-8 w-8" })] }) }), jsxRuntime.jsx(DropdownMenuContent, { align: "end", children: visibleActions.map((action, index) => (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(DropdownMenuItem, { disabled: action.disabled?.(data), className: cn(action.variant === 'destructive' && 'text-destructive focus:text-destructive'), onClick: () => {
|
|
9205
|
+
if (action.href) {
|
|
9206
|
+
window.location.href = action.href(data);
|
|
9207
|
+
}
|
|
9208
|
+
else if (action.onClick) {
|
|
9209
|
+
action.onClick(data);
|
|
9210
|
+
}
|
|
9211
|
+
}, children: [action.icon && jsxRuntime.jsx("span", { className: "mr-2", children: action.icon }), action.label] }), action.separator && index < visibleActions.length - 1 && jsxRuntime.jsx(DropdownMenuSeparator, {})] }, index))) })] }));
|
|
10274
9212
|
},
|
|
10275
9213
|
};
|
|
10276
9214
|
}
|
|
10277
9215
|
}
|
|
10278
9216
|
|
|
9217
|
+
exports.ActionsColumn = ActionsColumn;
|
|
9218
|
+
exports.AvatarGroupColumn = AvatarGroupColumn;
|
|
9219
|
+
exports.BadgeColumn = BadgeColumn;
|
|
9220
|
+
exports.ButtonColumn = ButtonColumn;
|
|
9221
|
+
exports.CheckboxColumn = CheckboxColumn;
|
|
10279
9222
|
exports.DataTable = DataTable;
|
|
10280
9223
|
exports.DataTableSchema = DataTableSchema;
|
|
9224
|
+
exports.DateColumn = DateColumn;
|
|
9225
|
+
exports.DropdownColumn = DropdownColumn;
|
|
10281
9226
|
exports.EmptyStateBuilder = EmptyStateBuilder;
|
|
9227
|
+
exports.IconColumn = IconColumn;
|
|
9228
|
+
exports.ImageColumn = ImageColumn;
|
|
9229
|
+
exports.InputColumn = InputColumn;
|
|
9230
|
+
exports.LinkColumn = LinkColumn;
|
|
9231
|
+
exports.NumberColumn = NumberColumn;
|
|
9232
|
+
exports.ProgressColumn = ProgressColumn;
|
|
9233
|
+
exports.SelectColumn = SelectColumn;
|
|
10282
9234
|
exports.TableSchema = TableSchema;
|
|
9235
|
+
exports.TextColumn = TextColumn;
|
|
10283
9236
|
exports.avatarGroupColumn = AvatarGroupColumn;
|
|
10284
9237
|
exports.badgeColumn = BadgeColumn;
|
|
10285
9238
|
exports.buttonColumn = ButtonColumn;
|