@nccirtu/tablefy 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/columns/index.esm.js +206 -1578
- package/dist/columns/index.esm.js.map +1 -1
- package/dist/columns/index.js +219 -1591
- package/dist/columns/index.js.map +1 -1
- package/dist/columns/lib/builders/empty-state.d.ts +19 -0
- package/dist/columns/lib/builders/table-schema.d.ts +71 -2
- package/dist/index.esm.js +441 -1600
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +454 -1613
- package/dist/index.js.map +1 -1
- package/dist/lib/builders/empty-state.d.ts +19 -0
- package/dist/lib/builders/table-schema.d.ts +71 -2
- package/package.json +4 -1
package/dist/index.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,35 +5930,35 @@ 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
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
5963
|
DropdownMenuSeparator$1.displayName = SEPARATOR_NAME$1;
|
|
7336
5964
|
var ARROW_NAME$2 = "DropdownMenuArrow";
|
|
@@ -7338,7 +5966,7 @@ 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,
|
|
@@ -7408,7 +6036,7 @@ var Progress$1 = React__namespace.forwardRef(
|
|
|
7408
6036
|
}
|
|
7409
6037
|
const value = isValidValueNumber(valueProp, max) ? valueProp : null;
|
|
7410
6038
|
const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
|
|
7411
|
-
return /* @__PURE__ */
|
|
6039
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7412
6040
|
Primitive.div,
|
|
7413
6041
|
{
|
|
7414
6042
|
"aria-valuemax": max,
|
|
@@ -7431,7 +6059,7 @@ var ProgressIndicator = React__namespace.forwardRef(
|
|
|
7431
6059
|
(props, forwardedRef) => {
|
|
7432
6060
|
const { __scopeProgress, ...indicatorProps } = props;
|
|
7433
6061
|
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
7434
|
-
return /* @__PURE__ */
|
|
6062
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7435
6063
|
Primitive.div,
|
|
7436
6064
|
{
|
|
7437
6065
|
"data-state": getProgressState(context.value, context.max),
|
|
@@ -7522,7 +6150,7 @@ var Select$1 = (props) => {
|
|
|
7522
6150
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
7523
6151
|
const [nativeOptionsSet, setNativeOptionsSet] = React__namespace.useState(/* @__PURE__ */ new Set());
|
|
7524
6152
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
7525
|
-
return /* @__PURE__ */
|
|
6153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7526
6154
|
SelectProvider,
|
|
7527
6155
|
{
|
|
7528
6156
|
required,
|
|
@@ -7542,7 +6170,7 @@ var Select$1 = (props) => {
|
|
|
7542
6170
|
triggerPointerDownPosRef,
|
|
7543
6171
|
disabled,
|
|
7544
6172
|
children: [
|
|
7545
|
-
/* @__PURE__ */
|
|
6173
|
+
/* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7546
6174
|
SelectNativeOptionsProvider,
|
|
7547
6175
|
{
|
|
7548
6176
|
scope: props.__scopeSelect,
|
|
@@ -7559,7 +6187,7 @@ var Select$1 = (props) => {
|
|
|
7559
6187
|
children
|
|
7560
6188
|
}
|
|
7561
6189
|
) }),
|
|
7562
|
-
isFormControl ? /* @__PURE__ */
|
|
6190
|
+
isFormControl ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7563
6191
|
SelectBubbleInput,
|
|
7564
6192
|
{
|
|
7565
6193
|
"aria-hidden": true,
|
|
@@ -7572,7 +6200,7 @@ var Select$1 = (props) => {
|
|
|
7572
6200
|
disabled,
|
|
7573
6201
|
form,
|
|
7574
6202
|
children: [
|
|
7575
|
-
value === void 0 ? /* @__PURE__ */
|
|
6203
|
+
value === void 0 ? /* @__PURE__ */ jsxRuntime.jsx("option", { value: "" }) : null,
|
|
7576
6204
|
Array.from(nativeOptionsSet)
|
|
7577
6205
|
]
|
|
7578
6206
|
},
|
|
@@ -7613,7 +6241,7 @@ var SelectTrigger$1 = React__namespace.forwardRef(
|
|
|
7613
6241
|
};
|
|
7614
6242
|
}
|
|
7615
6243
|
};
|
|
7616
|
-
return /* @__PURE__ */
|
|
6244
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7617
6245
|
Primitive.button,
|
|
7618
6246
|
{
|
|
7619
6247
|
type: "button",
|
|
@@ -7672,13 +6300,13 @@ var SelectValue$1 = React__namespace.forwardRef(
|
|
|
7672
6300
|
useLayoutEffect2(() => {
|
|
7673
6301
|
onValueNodeHasChildrenChange(hasChildren);
|
|
7674
6302
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
7675
|
-
return /* @__PURE__ */
|
|
6303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7676
6304
|
Primitive.span,
|
|
7677
6305
|
{
|
|
7678
6306
|
...valueProps,
|
|
7679
6307
|
ref: composedRefs,
|
|
7680
6308
|
style: { pointerEvents: "none" },
|
|
7681
|
-
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */
|
|
6309
|
+
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: placeholder }) : children
|
|
7682
6310
|
}
|
|
7683
6311
|
);
|
|
7684
6312
|
}
|
|
@@ -7688,13 +6316,13 @@ var ICON_NAME = "SelectIcon";
|
|
|
7688
6316
|
var SelectIcon = React__namespace.forwardRef(
|
|
7689
6317
|
(props, forwardedRef) => {
|
|
7690
6318
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
7691
|
-
return /* @__PURE__ */
|
|
6319
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
|
7692
6320
|
}
|
|
7693
6321
|
);
|
|
7694
6322
|
SelectIcon.displayName = ICON_NAME;
|
|
7695
6323
|
var PORTAL_NAME$1 = "SelectPortal";
|
|
7696
6324
|
var SelectPortal = (props) => {
|
|
7697
|
-
return /* @__PURE__ */
|
|
6325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal$3, { asChild: true, ...props });
|
|
7698
6326
|
};
|
|
7699
6327
|
SelectPortal.displayName = PORTAL_NAME$1;
|
|
7700
6328
|
var CONTENT_NAME$1 = "SelectContent";
|
|
@@ -7708,11 +6336,11 @@ var SelectContent$1 = React__namespace.forwardRef(
|
|
|
7708
6336
|
if (!context.open) {
|
|
7709
6337
|
const frag = fragment;
|
|
7710
6338
|
return frag ? ReactDOM__namespace.createPortal(
|
|
7711
|
-
/* @__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 }) }) }),
|
|
7712
6340
|
frag
|
|
7713
6341
|
) : null;
|
|
7714
6342
|
}
|
|
7715
|
-
return /* @__PURE__ */
|
|
6343
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContentImpl, { ...props, ref: forwardedRef });
|
|
7716
6344
|
}
|
|
7717
6345
|
);
|
|
7718
6346
|
SelectContent$1.displayName = CONTENT_NAME$1;
|
|
@@ -7866,7 +6494,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7866
6494
|
hideWhenDetached,
|
|
7867
6495
|
avoidCollisions
|
|
7868
6496
|
} : {};
|
|
7869
|
-
return /* @__PURE__ */
|
|
6497
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7870
6498
|
SelectContentProvider,
|
|
7871
6499
|
{
|
|
7872
6500
|
scope: __scopeSelect,
|
|
@@ -7882,7 +6510,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7882
6510
|
position,
|
|
7883
6511
|
isPositioned,
|
|
7884
6512
|
searchRef,
|
|
7885
|
-
children: /* @__PURE__ */
|
|
6513
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7886
6514
|
FocusScope,
|
|
7887
6515
|
{
|
|
7888
6516
|
asChild: true,
|
|
@@ -7894,7 +6522,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7894
6522
|
context.trigger?.focus({ preventScroll: true });
|
|
7895
6523
|
event.preventDefault();
|
|
7896
6524
|
}),
|
|
7897
|
-
children: /* @__PURE__ */
|
|
6525
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7898
6526
|
DismissableLayer,
|
|
7899
6527
|
{
|
|
7900
6528
|
asChild: true,
|
|
@@ -7903,7 +6531,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
|
7903
6531
|
onPointerDownOutside,
|
|
7904
6532
|
onFocusOutside: (event) => event.preventDefault(),
|
|
7905
6533
|
onDismiss: () => context.onOpenChange(false),
|
|
7906
|
-
children: /* @__PURE__ */
|
|
6534
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7907
6535
|
SelectPosition,
|
|
7908
6536
|
{
|
|
7909
6537
|
role: "listbox",
|
|
@@ -8079,14 +6707,14 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
|
8079
6707
|
},
|
|
8080
6708
|
[position, focusSelectedItem]
|
|
8081
6709
|
);
|
|
8082
|
-
return /* @__PURE__ */
|
|
6710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8083
6711
|
SelectViewportProvider,
|
|
8084
6712
|
{
|
|
8085
6713
|
scope: __scopeSelect,
|
|
8086
6714
|
contentWrapper,
|
|
8087
6715
|
shouldExpandOnScrollRef,
|
|
8088
6716
|
onScrollButtonChange: handleScrollButtonChange,
|
|
8089
|
-
children: /* @__PURE__ */
|
|
6717
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8090
6718
|
"div",
|
|
8091
6719
|
{
|
|
8092
6720
|
ref: setContentWrapper,
|
|
@@ -8096,7 +6724,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
|
8096
6724
|
position: "fixed",
|
|
8097
6725
|
zIndex: contentZIndex
|
|
8098
6726
|
},
|
|
8099
|
-
children: /* @__PURE__ */
|
|
6727
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8100
6728
|
Primitive.div,
|
|
8101
6729
|
{
|
|
8102
6730
|
...popperProps,
|
|
@@ -8126,7 +6754,7 @@ var SelectPopperPosition = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
8126
6754
|
...popperProps
|
|
8127
6755
|
} = props;
|
|
8128
6756
|
const popperScope = usePopperScope$1(__scopeSelect);
|
|
8129
|
-
return /* @__PURE__ */
|
|
6757
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8130
6758
|
Content,
|
|
8131
6759
|
{
|
|
8132
6760
|
...popperScope,
|
|
@@ -8160,8 +6788,8 @@ var SelectViewport = React__namespace.forwardRef(
|
|
|
8160
6788
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
8161
6789
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
8162
6790
|
const prevScrollTopRef = React__namespace.useRef(0);
|
|
8163
|
-
return /* @__PURE__ */
|
|
8164
|
-
/* @__PURE__ */
|
|
6791
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6792
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8165
6793
|
"style",
|
|
8166
6794
|
{
|
|
8167
6795
|
dangerouslySetInnerHTML: {
|
|
@@ -8170,7 +6798,7 @@ var SelectViewport = React__namespace.forwardRef(
|
|
|
8170
6798
|
nonce
|
|
8171
6799
|
}
|
|
8172
6800
|
),
|
|
8173
|
-
/* @__PURE__ */
|
|
6801
|
+
/* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8174
6802
|
Primitive.div,
|
|
8175
6803
|
{
|
|
8176
6804
|
"data-radix-select-viewport": "",
|
|
@@ -8226,7 +6854,7 @@ var SelectGroup = React__namespace.forwardRef(
|
|
|
8226
6854
|
(props, forwardedRef) => {
|
|
8227
6855
|
const { __scopeSelect, ...groupProps } = props;
|
|
8228
6856
|
const groupId = useId();
|
|
8229
|
-
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 }) });
|
|
8230
6858
|
}
|
|
8231
6859
|
);
|
|
8232
6860
|
SelectGroup.displayName = GROUP_NAME;
|
|
@@ -8235,7 +6863,7 @@ var SelectLabel = React__namespace.forwardRef(
|
|
|
8235
6863
|
(props, forwardedRef) => {
|
|
8236
6864
|
const { __scopeSelect, ...labelProps } = props;
|
|
8237
6865
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
8238
|
-
return /* @__PURE__ */
|
|
6866
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
8239
6867
|
}
|
|
8240
6868
|
);
|
|
8241
6869
|
SelectLabel.displayName = LABEL_NAME;
|
|
@@ -8272,7 +6900,7 @@ var SelectItem$1 = React__namespace.forwardRef(
|
|
|
8272
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."
|
|
8273
6901
|
);
|
|
8274
6902
|
}
|
|
8275
|
-
return /* @__PURE__ */
|
|
6903
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8276
6904
|
SelectItemContextProvider,
|
|
8277
6905
|
{
|
|
8278
6906
|
scope: __scopeSelect,
|
|
@@ -8283,14 +6911,14 @@ var SelectItem$1 = React__namespace.forwardRef(
|
|
|
8283
6911
|
onItemTextChange: React__namespace.useCallback((node) => {
|
|
8284
6912
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
8285
6913
|
}, []),
|
|
8286
|
-
children: /* @__PURE__ */
|
|
6914
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8287
6915
|
Collection.ItemSlot,
|
|
8288
6916
|
{
|
|
8289
6917
|
scope: __scopeSelect,
|
|
8290
6918
|
value,
|
|
8291
6919
|
disabled,
|
|
8292
6920
|
textValue,
|
|
8293
|
-
children: /* @__PURE__ */
|
|
6921
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8294
6922
|
Primitive.div,
|
|
8295
6923
|
{
|
|
8296
6924
|
role: "option",
|
|
@@ -8359,7 +6987,7 @@ var SelectItemText = React__namespace.forwardRef(
|
|
|
8359
6987
|
);
|
|
8360
6988
|
const textContent = itemTextNode?.textContent;
|
|
8361
6989
|
const nativeOption = React__namespace.useMemo(
|
|
8362
|
-
() => /* @__PURE__ */
|
|
6990
|
+
() => /* @__PURE__ */ jsxRuntime.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
|
|
8363
6991
|
[itemContext.disabled, itemContext.value, textContent]
|
|
8364
6992
|
);
|
|
8365
6993
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
@@ -8367,8 +6995,8 @@ var SelectItemText = React__namespace.forwardRef(
|
|
|
8367
6995
|
onNativeOptionAdd(nativeOption);
|
|
8368
6996
|
return () => onNativeOptionRemove(nativeOption);
|
|
8369
6997
|
}, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
|
|
8370
|
-
return /* @__PURE__ */
|
|
8371
|
-
/* @__PURE__ */
|
|
6998
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6999
|
+
/* @__PURE__ */ jsxRuntime.jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
|
|
8372
7000
|
itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM__namespace.createPortal(itemTextProps.children, context.valueNode) : null
|
|
8373
7001
|
] });
|
|
8374
7002
|
}
|
|
@@ -8379,7 +7007,7 @@ var SelectItemIndicator = React__namespace.forwardRef(
|
|
|
8379
7007
|
(props, forwardedRef) => {
|
|
8380
7008
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
8381
7009
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
8382
|
-
return itemContext.isSelected ? /* @__PURE__ */
|
|
7010
|
+
return itemContext.isSelected ? /* @__PURE__ */ jsxRuntime.jsx(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
8383
7011
|
}
|
|
8384
7012
|
);
|
|
8385
7013
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
@@ -8401,7 +7029,7 @@ var SelectScrollUpButton$1 = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
8401
7029
|
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
8402
7030
|
}
|
|
8403
7031
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
8404
|
-
return canScrollUp ? /* @__PURE__ */
|
|
7032
|
+
return canScrollUp ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8405
7033
|
SelectScrollButtonImpl,
|
|
8406
7034
|
{
|
|
8407
7035
|
...props,
|
|
@@ -8435,7 +7063,7 @@ var SelectScrollDownButton$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
8435
7063
|
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
8436
7064
|
}
|
|
8437
7065
|
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
8438
|
-
return canScrollDown ? /* @__PURE__ */
|
|
7066
|
+
return canScrollDown ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8439
7067
|
SelectScrollButtonImpl,
|
|
8440
7068
|
{
|
|
8441
7069
|
...props,
|
|
@@ -8468,7 +7096,7 @@ var SelectScrollButtonImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
8468
7096
|
const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
|
|
8469
7097
|
activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
8470
7098
|
}, [getItems]);
|
|
8471
|
-
return /* @__PURE__ */
|
|
7099
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8472
7100
|
Primitive.div,
|
|
8473
7101
|
{
|
|
8474
7102
|
"aria-hidden": true,
|
|
@@ -8496,7 +7124,7 @@ var SEPARATOR_NAME = "SelectSeparator";
|
|
|
8496
7124
|
var SelectSeparator = React__namespace.forwardRef(
|
|
8497
7125
|
(props, forwardedRef) => {
|
|
8498
7126
|
const { __scopeSelect, ...separatorProps } = props;
|
|
8499
|
-
return /* @__PURE__ */
|
|
7127
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
8500
7128
|
}
|
|
8501
7129
|
);
|
|
8502
7130
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
@@ -8507,7 +7135,7 @@ var SelectArrow = React__namespace.forwardRef(
|
|
|
8507
7135
|
const popperScope = usePopperScope$1(__scopeSelect);
|
|
8508
7136
|
const context = useSelectContext(ARROW_NAME$1, __scopeSelect);
|
|
8509
7137
|
const contentContext = useSelectContentContext(ARROW_NAME$1, __scopeSelect);
|
|
8510
|
-
return context.open && contentContext.position === "popper" ? /* @__PURE__ */
|
|
7138
|
+
return context.open && contentContext.position === "popper" ? /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;
|
|
8511
7139
|
}
|
|
8512
7140
|
);
|
|
8513
7141
|
SelectArrow.displayName = ARROW_NAME$1;
|
|
@@ -8532,7 +7160,7 @@ var SelectBubbleInput = React__namespace.forwardRef(
|
|
|
8532
7160
|
select.dispatchEvent(event);
|
|
8533
7161
|
}
|
|
8534
7162
|
}, [prevValue, value]);
|
|
8535
|
-
return /* @__PURE__ */
|
|
7163
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8536
7164
|
Primitive.select,
|
|
8537
7165
|
{
|
|
8538
7166
|
...props,
|
|
@@ -8623,7 +7251,7 @@ var TooltipProvider$1 = (props) => {
|
|
|
8623
7251
|
const skipDelayTimer = skipDelayTimerRef.current;
|
|
8624
7252
|
return () => window.clearTimeout(skipDelayTimer);
|
|
8625
7253
|
}, []);
|
|
8626
|
-
return /* @__PURE__ */
|
|
7254
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8627
7255
|
TooltipProviderContextProvider,
|
|
8628
7256
|
{
|
|
8629
7257
|
scope: __scopeTooltip,
|
|
@@ -8714,7 +7342,7 @@ var Tooltip$1 = (props) => {
|
|
|
8714
7342
|
}
|
|
8715
7343
|
};
|
|
8716
7344
|
}, []);
|
|
8717
|
-
return /* @__PURE__ */
|
|
7345
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8718
7346
|
TooltipContextProvider,
|
|
8719
7347
|
{
|
|
8720
7348
|
scope: __scopeTooltip,
|
|
@@ -8758,7 +7386,7 @@ var TooltipTrigger$1 = React__namespace.forwardRef(
|
|
|
8758
7386
|
React__namespace.useEffect(() => {
|
|
8759
7387
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
8760
7388
|
}, [handlePointerUp]);
|
|
8761
|
-
return /* @__PURE__ */
|
|
7389
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8762
7390
|
Primitive.button,
|
|
8763
7391
|
{
|
|
8764
7392
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -8800,7 +7428,7 @@ var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
|
|
8800
7428
|
var TooltipPortal = (props) => {
|
|
8801
7429
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
8802
7430
|
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
|
8803
|
-
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 }) }) });
|
|
8804
7432
|
};
|
|
8805
7433
|
TooltipPortal.displayName = PORTAL_NAME;
|
|
8806
7434
|
var CONTENT_NAME = "TooltipContent";
|
|
@@ -8809,7 +7437,7 @@ var TooltipContent$1 = React__namespace.forwardRef(
|
|
|
8809
7437
|
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
|
8810
7438
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
8811
7439
|
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
8812
|
-
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 }) });
|
|
8813
7441
|
}
|
|
8814
7442
|
);
|
|
8815
7443
|
var TooltipContentHoverable = React__namespace.forwardRef((props, forwardedRef) => {
|
|
@@ -8871,7 +7499,7 @@ var TooltipContentHoverable = React__namespace.forwardRef((props, forwardedRef)
|
|
|
8871
7499
|
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
8872
7500
|
}
|
|
8873
7501
|
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
8874
|
-
return /* @__PURE__ */
|
|
7502
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
8875
7503
|
});
|
|
8876
7504
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
8877
7505
|
var Slottable = createSlottable("TooltipContent");
|
|
@@ -8902,7 +7530,7 @@ var TooltipContentImpl = React__namespace.forwardRef(
|
|
|
8902
7530
|
return () => window.removeEventListener("scroll", handleScroll, { capture: true });
|
|
8903
7531
|
}
|
|
8904
7532
|
}, [context.trigger, onClose]);
|
|
8905
|
-
return /* @__PURE__ */
|
|
7533
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8906
7534
|
DismissableLayer,
|
|
8907
7535
|
{
|
|
8908
7536
|
asChild: true,
|
|
@@ -8911,7 +7539,7 @@ var TooltipContentImpl = React__namespace.forwardRef(
|
|
|
8911
7539
|
onPointerDownOutside,
|
|
8912
7540
|
onFocusOutside: (event) => event.preventDefault(),
|
|
8913
7541
|
onDismiss: onClose,
|
|
8914
|
-
children: /* @__PURE__ */
|
|
7542
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8915
7543
|
Content,
|
|
8916
7544
|
{
|
|
8917
7545
|
"data-state": context.stateAttribute,
|
|
@@ -8930,8 +7558,8 @@ var TooltipContentImpl = React__namespace.forwardRef(
|
|
|
8930
7558
|
}
|
|
8931
7559
|
},
|
|
8932
7560
|
children: [
|
|
8933
|
-
/* @__PURE__ */
|
|
8934
|
-
/* @__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 }) })
|
|
8935
7563
|
]
|
|
8936
7564
|
}
|
|
8937
7565
|
)
|
|
@@ -8949,7 +7577,7 @@ var TooltipArrow = React__namespace.forwardRef(
|
|
|
8949
7577
|
ARROW_NAME,
|
|
8950
7578
|
__scopeTooltip
|
|
8951
7579
|
);
|
|
8952
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */
|
|
7580
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
8953
7581
|
}
|
|
8954
7582
|
);
|
|
8955
7583
|
TooltipArrow.displayName = ARROW_NAME;
|
|
@@ -9105,27 +7733,27 @@ const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50
|
|
|
9105
7733
|
});
|
|
9106
7734
|
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
9107
7735
|
const Comp = asChild ? Slot$2 : "button";
|
|
9108
|
-
return (
|
|
7736
|
+
return (jsxRuntime.jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
9109
7737
|
}
|
|
9110
7738
|
|
|
9111
7739
|
function Input({ className, type, ...props }) {
|
|
9112
|
-
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 }));
|
|
9113
7741
|
}
|
|
9114
7742
|
|
|
9115
7743
|
function DropdownMenu({ ...props }) {
|
|
9116
|
-
return
|
|
7744
|
+
return jsxRuntime.jsx(Root2$1, { "data-slot": "dropdown-menu", ...props });
|
|
9117
7745
|
}
|
|
9118
7746
|
function DropdownMenuTrigger({ ...props }) {
|
|
9119
|
-
return (
|
|
7747
|
+
return (jsxRuntime.jsx(Trigger$2, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
9120
7748
|
}
|
|
9121
7749
|
function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
9122
|
-
return (
|
|
7750
|
+
return (jsxRuntime.jsx(Portal2, { children: jsxRuntime.jsx(Content2$2, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, align: align, className: className, ...props }) }));
|
|
9123
7751
|
}
|
|
9124
7752
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
9125
|
-
return (
|
|
7753
|
+
return (jsxRuntime.jsx(Item2, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: className, ...props }));
|
|
9126
7754
|
}
|
|
9127
7755
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
9128
|
-
return (
|
|
7756
|
+
return (jsxRuntime.jsx(Separator2, { "data-slot": "dropdown-menu-separator", className: className, ...props }));
|
|
9129
7757
|
}
|
|
9130
7758
|
|
|
9131
7759
|
function DataTableHeader({ title, description, actions = [], search, searchValue = "", onSearchChange, table, selectedCount = 0, className, }) {
|
|
@@ -9142,22 +7770,22 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9142
7770
|
const renderAction = (action, index) => {
|
|
9143
7771
|
// Dropdown Action
|
|
9144
7772
|
if (action.children && action.children.length > 0) {
|
|
9145
|
-
return (
|
|
9146
|
-
"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));
|
|
9147
7775
|
}
|
|
9148
7776
|
// Link Action
|
|
9149
7777
|
if (action.href) {
|
|
9150
|
-
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));
|
|
9151
7779
|
}
|
|
9152
7780
|
// Normal Button Action
|
|
9153
|
-
return (
|
|
7781
|
+
return (jsxRuntime.jsxs(Button, { variant: action.variant || "outline", size: action.size || "default", disabled: action.disabled || action.loading, onClick: () => {
|
|
9154
7782
|
if (action.bulk && action.bulkOnClick) {
|
|
9155
7783
|
action.bulkOnClick(getSelectedRows());
|
|
9156
7784
|
}
|
|
9157
7785
|
else if (action.onClick) {
|
|
9158
7786
|
action.onClick();
|
|
9159
7787
|
}
|
|
9160
|
-
}, 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));
|
|
9161
7789
|
};
|
|
9162
7790
|
// Kein Header wenn nichts konfiguriert
|
|
9163
7791
|
if (!title &&
|
|
@@ -9166,7 +7794,7 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9166
7794
|
!search?.enabled) {
|
|
9167
7795
|
return null;
|
|
9168
7796
|
}
|
|
9169
|
-
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 &&
|
|
9170
7798
|
bulkActions.map((action, index) => renderAction(action, index)), normalActions.length > 0 &&
|
|
9171
7799
|
normalActions.map((action, index) => renderAction(action, index))] })] }))] }));
|
|
9172
7800
|
}
|
|
@@ -9174,29 +7802,29 @@ function DataTableHeader({ title, description, actions = [], search, searchValue
|
|
|
9174
7802
|
// components/ui/data-table/data-table-empty.tsx
|
|
9175
7803
|
function DataTableEmpty({ config, colSpan, className, }) {
|
|
9176
7804
|
const { icon, imageUrl, title, description, action, variant } = config;
|
|
9177
|
-
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 })] })) }))] }) }) }));
|
|
9178
7806
|
}
|
|
9179
7807
|
|
|
9180
7808
|
function Select({ ...props }) {
|
|
9181
|
-
return
|
|
7809
|
+
return jsxRuntime.jsx(Root2, { "data-slot": "select", ...props });
|
|
9182
7810
|
}
|
|
9183
7811
|
function SelectValue({ ...props }) {
|
|
9184
|
-
return
|
|
7812
|
+
return jsxRuntime.jsx(Value, { "data-slot": "select-value", ...props });
|
|
9185
7813
|
}
|
|
9186
7814
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
9187
|
-
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" }) })] }));
|
|
9188
7816
|
}
|
|
9189
7817
|
function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
|
|
9190
|
-
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, {})] }) }));
|
|
9191
7819
|
}
|
|
9192
7820
|
function SelectItem({ className, children, ...props }) {
|
|
9193
|
-
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 })] }));
|
|
9194
7822
|
}
|
|
9195
7823
|
function SelectScrollUpButton({ className, ...props }) {
|
|
9196
|
-
return (
|
|
7824
|
+
return (jsxRuntime.jsx(ScrollUpButton, { "data-slot": "select-scroll-up-button", className: className, ...props, children: jsxRuntime.jsx(lucideReact.ChevronUpIcon, {}) }));
|
|
9197
7825
|
}
|
|
9198
7826
|
function SelectScrollDownButton({ className, ...props }) {
|
|
9199
|
-
return (
|
|
7827
|
+
return (jsxRuntime.jsx(ScrollDownButton, { "data-slot": "select-scroll-down-button", className: className, ...props, children: jsxRuntime.jsx(lucideReact.ChevronDownIcon, {}) }));
|
|
9200
7828
|
}
|
|
9201
7829
|
|
|
9202
7830
|
// components/ui/data-table/data-table-pagination.tsx
|
|
@@ -9204,24 +7832,196 @@ function DataTablePagination({ table, config, className, }) {
|
|
|
9204
7832
|
if (!config?.enabled)
|
|
9205
7833
|
return null;
|
|
9206
7834
|
const { showPageInfo = true, showPageSizeSelector = true, pageSizeOptions = [10, 20, 30, 50, 100], } = config;
|
|
9207
|
-
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" })] })] })] })] }));
|
|
9208
7836
|
}
|
|
9209
7837
|
|
|
7838
|
+
/**
|
|
7839
|
+
* Header Actions Builder
|
|
7840
|
+
* Fluent API for building header actions
|
|
7841
|
+
*/
|
|
7842
|
+
class HeaderActionsBuilder {
|
|
7843
|
+
actions = [];
|
|
7844
|
+
create(config) {
|
|
7845
|
+
this.actions.push({
|
|
7846
|
+
id: "create",
|
|
7847
|
+
label: config.label,
|
|
7848
|
+
href: config.href,
|
|
7849
|
+
onClick: config.onClick,
|
|
7850
|
+
icon: config.icon,
|
|
7851
|
+
variant: "default",
|
|
7852
|
+
});
|
|
7853
|
+
return this;
|
|
7854
|
+
}
|
|
7855
|
+
export(config) {
|
|
7856
|
+
if (config.formats && config.formats.length > 0) {
|
|
7857
|
+
this.actions.push({
|
|
7858
|
+
id: "export",
|
|
7859
|
+
label: config.label,
|
|
7860
|
+
icon: config.icon,
|
|
7861
|
+
variant: "outline",
|
|
7862
|
+
children: config.formats.map((format, index) => ({
|
|
7863
|
+
id: `export-${index}`,
|
|
7864
|
+
label: format.label,
|
|
7865
|
+
onClick: format.onClick,
|
|
7866
|
+
})),
|
|
7867
|
+
});
|
|
7868
|
+
}
|
|
7869
|
+
else {
|
|
7870
|
+
this.actions.push({
|
|
7871
|
+
id: "export",
|
|
7872
|
+
label: config.label,
|
|
7873
|
+
icon: config.icon,
|
|
7874
|
+
variant: "outline",
|
|
7875
|
+
});
|
|
7876
|
+
}
|
|
7877
|
+
return this;
|
|
7878
|
+
}
|
|
7879
|
+
import(config) {
|
|
7880
|
+
this.actions.push({
|
|
7881
|
+
id: "import",
|
|
7882
|
+
label: config.label,
|
|
7883
|
+
icon: config.icon,
|
|
7884
|
+
onClick: config.onClick,
|
|
7885
|
+
variant: "outline",
|
|
7886
|
+
});
|
|
7887
|
+
return this;
|
|
7888
|
+
}
|
|
7889
|
+
bulkExport(config) {
|
|
7890
|
+
this.actions.push({
|
|
7891
|
+
id: "bulk-export",
|
|
7892
|
+
label: config.label,
|
|
7893
|
+
icon: config.icon,
|
|
7894
|
+
bulk: true,
|
|
7895
|
+
bulkOnClick: config.onExport,
|
|
7896
|
+
variant: "outline",
|
|
7897
|
+
});
|
|
7898
|
+
return this;
|
|
7899
|
+
}
|
|
7900
|
+
bulkDelete(config) {
|
|
7901
|
+
this.actions.push({
|
|
7902
|
+
id: "bulk-delete",
|
|
7903
|
+
label: config.label,
|
|
7904
|
+
icon: config.icon,
|
|
7905
|
+
bulk: true,
|
|
7906
|
+
bulkOnClick: config.onDelete,
|
|
7907
|
+
variant: "destructive",
|
|
7908
|
+
});
|
|
7909
|
+
return this;
|
|
7910
|
+
}
|
|
7911
|
+
custom(action) {
|
|
7912
|
+
this.actions.push(action);
|
|
7913
|
+
return this;
|
|
7914
|
+
}
|
|
7915
|
+
build() {
|
|
7916
|
+
return this.actions;
|
|
7917
|
+
}
|
|
7918
|
+
}
|
|
9210
7919
|
/**
|
|
9211
7920
|
* Table Schema Builder
|
|
9212
|
-
* Fluent API for building table
|
|
7921
|
+
* Fluent API for building complete table configurations
|
|
9213
7922
|
*/
|
|
9214
7923
|
class TableSchema {
|
|
9215
7924
|
columnBuilders = [];
|
|
7925
|
+
config = {};
|
|
9216
7926
|
static make() {
|
|
9217
7927
|
return new TableSchema();
|
|
9218
7928
|
}
|
|
7929
|
+
// Configuration Methods
|
|
7930
|
+
description(text) {
|
|
7931
|
+
this.config.description = text;
|
|
7932
|
+
return this;
|
|
7933
|
+
}
|
|
7934
|
+
title(text) {
|
|
7935
|
+
this.config.title = text;
|
|
7936
|
+
return this;
|
|
7937
|
+
}
|
|
7938
|
+
headerActions(builder) {
|
|
7939
|
+
const actionsBuilder = new HeaderActionsBuilder();
|
|
7940
|
+
this.config.headerActions = builder(actionsBuilder).build();
|
|
7941
|
+
return this;
|
|
7942
|
+
}
|
|
7943
|
+
emptyState(config) {
|
|
7944
|
+
this.config.emptyState = config;
|
|
7945
|
+
return this;
|
|
7946
|
+
}
|
|
7947
|
+
searchEmptyState(config) {
|
|
7948
|
+
this.config.searchEmptyState = config;
|
|
7949
|
+
return this;
|
|
7950
|
+
}
|
|
7951
|
+
filterEmptyState(config) {
|
|
7952
|
+
this.config.filterEmptyState = config;
|
|
7953
|
+
return this;
|
|
7954
|
+
}
|
|
7955
|
+
// Feature Methods
|
|
7956
|
+
searchable(config) {
|
|
7957
|
+
if (typeof config === "boolean") {
|
|
7958
|
+
this.config.search = config ? { enabled: true } : { enabled: false };
|
|
7959
|
+
}
|
|
7960
|
+
else {
|
|
7961
|
+
this.config.search = {
|
|
7962
|
+
enabled: true,
|
|
7963
|
+
placeholder: config?.placeholder,
|
|
7964
|
+
};
|
|
7965
|
+
}
|
|
7966
|
+
return this;
|
|
7967
|
+
}
|
|
7968
|
+
paginated(config) {
|
|
7969
|
+
if (typeof config === "boolean") {
|
|
7970
|
+
this.config.pagination = { enabled: config };
|
|
7971
|
+
}
|
|
7972
|
+
else {
|
|
7973
|
+
this.config.pagination = {
|
|
7974
|
+
enabled: true,
|
|
7975
|
+
pageSize: config?.pageSize,
|
|
7976
|
+
pageSizeOptions: config?.pageSizeOptions,
|
|
7977
|
+
};
|
|
7978
|
+
}
|
|
7979
|
+
return this;
|
|
7980
|
+
}
|
|
7981
|
+
selectable(multiSelect = true) {
|
|
7982
|
+
this.config.enableRowSelection = true;
|
|
7983
|
+
this.config.enableMultiRowSelection = multiSelect;
|
|
7984
|
+
return this;
|
|
7985
|
+
}
|
|
7986
|
+
sortable(defaultSort) {
|
|
7987
|
+
this.config.enableSorting = true;
|
|
7988
|
+
if (defaultSort) {
|
|
7989
|
+
this.config.defaultSort = defaultSort;
|
|
7990
|
+
}
|
|
7991
|
+
return this;
|
|
7992
|
+
}
|
|
7993
|
+
columnVisibility(enabled = true) {
|
|
7994
|
+
this.config.enableColumnVisibility = enabled;
|
|
7995
|
+
return this;
|
|
7996
|
+
}
|
|
7997
|
+
// Styling Methods
|
|
7998
|
+
bordered(enabled = true) {
|
|
7999
|
+
this.config.bordered = enabled;
|
|
8000
|
+
return this;
|
|
8001
|
+
}
|
|
8002
|
+
striped(enabled = true) {
|
|
8003
|
+
this.config.striped = enabled;
|
|
8004
|
+
return this;
|
|
8005
|
+
}
|
|
8006
|
+
hoverable(enabled = true) {
|
|
8007
|
+
this.config.hoverable = enabled;
|
|
8008
|
+
return this;
|
|
8009
|
+
}
|
|
8010
|
+
density(density) {
|
|
8011
|
+
this.config.density = density;
|
|
8012
|
+
return this;
|
|
8013
|
+
}
|
|
8014
|
+
// Columns
|
|
9219
8015
|
columns(...builders) {
|
|
9220
8016
|
this.columnBuilders.push(...builders);
|
|
9221
8017
|
return this;
|
|
9222
8018
|
}
|
|
8019
|
+
// Build
|
|
9223
8020
|
build() {
|
|
9224
|
-
return
|
|
8021
|
+
return {
|
|
8022
|
+
columns: this.columnBuilders.map((builder) => builder.build()),
|
|
8023
|
+
config: this.config,
|
|
8024
|
+
};
|
|
9225
8025
|
}
|
|
9226
8026
|
}
|
|
9227
8027
|
|
|
@@ -9297,6 +8097,47 @@ class EmptyStateBuilder {
|
|
|
9297
8097
|
build() {
|
|
9298
8098
|
return this.config;
|
|
9299
8099
|
}
|
|
8100
|
+
// Static helper methods for quick configuration
|
|
8101
|
+
static noData(config) {
|
|
8102
|
+
return {
|
|
8103
|
+
variant: "default",
|
|
8104
|
+
title: config.title,
|
|
8105
|
+
description: config.description,
|
|
8106
|
+
action: config.createLabel
|
|
8107
|
+
? {
|
|
8108
|
+
label: config.createLabel,
|
|
8109
|
+
href: config.createHref,
|
|
8110
|
+
onClick: config.createOnClick,
|
|
8111
|
+
}
|
|
8112
|
+
: undefined,
|
|
8113
|
+
};
|
|
8114
|
+
}
|
|
8115
|
+
static noSearchResults(config) {
|
|
8116
|
+
return {
|
|
8117
|
+
variant: "search",
|
|
8118
|
+
title: config.title,
|
|
8119
|
+
description: config.description,
|
|
8120
|
+
action: config.clearLabel
|
|
8121
|
+
? {
|
|
8122
|
+
label: config.clearLabel,
|
|
8123
|
+
onClick: config.onClear,
|
|
8124
|
+
}
|
|
8125
|
+
: undefined,
|
|
8126
|
+
};
|
|
8127
|
+
}
|
|
8128
|
+
static noFilterResults(config) {
|
|
8129
|
+
return {
|
|
8130
|
+
variant: "filter",
|
|
8131
|
+
title: config.title,
|
|
8132
|
+
description: config.description,
|
|
8133
|
+
action: config.resetLabel
|
|
8134
|
+
? {
|
|
8135
|
+
label: config.resetLabel,
|
|
8136
|
+
onClick: config.onReset,
|
|
8137
|
+
}
|
|
8138
|
+
: undefined,
|
|
8139
|
+
};
|
|
8140
|
+
}
|
|
9300
8141
|
}
|
|
9301
8142
|
|
|
9302
8143
|
function DataTable({ columns, data, config = {}, className, isLoading = false, isError = false, onRetry, }) {
|
|
@@ -9354,24 +8195,24 @@ function DataTable({ columns, data, config = {}, className, isLoading = false, i
|
|
|
9354
8195
|
};
|
|
9355
8196
|
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
9356
8197
|
const hasRows = table.getRowModel().rows?.length > 0;
|
|
9357
|
-
return (
|
|
8198
|
+
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
|
|
9358
8199
|
? null
|
|
9359
|
-
: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }),
|
|
8200
|
+
: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }), jsxRuntime.jsx(TableBody, { children: isLoading ? (
|
|
9360
8201
|
// Loading State
|
|
9361
|
-
|
|
8202
|
+
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 ? (
|
|
9362
8203
|
// Data Rows
|
|
9363
|
-
table.getRowModel().rows.map((row) => (
|
|
8204
|
+
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)))) : (
|
|
9364
8205
|
// Empty State
|
|
9365
|
-
|
|
8206
|
+
jsxRuntime.jsx(DataTableEmpty, { config: getEmptyState(), colSpan: columns.length })) })] }) }), config.pagination?.enabled && hasRows && (jsxRuntime.jsx(DataTablePagination, { table: table, config: config.pagination }))] }));
|
|
9366
8207
|
}
|
|
9367
8208
|
|
|
9368
8209
|
const DataTableSchema = (props) => {
|
|
9369
|
-
return (
|
|
8210
|
+
return (jsxRuntime.jsx("div", { className: "data-table-schema", children: jsxRuntime.jsx("p", { children: "TableSchema Placeholder" }) }));
|
|
9370
8211
|
};
|
|
9371
8212
|
|
|
9372
8213
|
const AvatarList = ({ items, maxVisible = 5, size = 32, ...props }) => {
|
|
9373
8214
|
const sizeValue = typeof size === "string" ? parseInt(size, 10) || 32 : size;
|
|
9374
|
-
return (
|
|
8215
|
+
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] }))] }));
|
|
9375
8216
|
};
|
|
9376
8217
|
|
|
9377
8218
|
class BaseColumn {
|
|
@@ -9516,7 +8357,7 @@ class AvatarGroupColumn extends BaseColumn {
|
|
|
9516
8357
|
const { accessor, label, maxVisible, size, overlap, showTooltip, nameField, srcField, fallbackField, showNames, maxNames, } = config;
|
|
9517
8358
|
return {
|
|
9518
8359
|
accessorKey: accessor,
|
|
9519
|
-
header: () => (
|
|
8360
|
+
header: () => (jsxRuntime.jsx("span", { className: cn("text-muted-foreground font-medium", this.getAlignmentClass(), this.config.headerClassName), children: label || String(accessor) })),
|
|
9520
8361
|
cell: ({ getValue, row }) => {
|
|
9521
8362
|
const rawValue = getValue();
|
|
9522
8363
|
// Items aus den Daten extrahieren
|
|
@@ -9545,11 +8386,11 @@ class AvatarGroupColumn extends BaseColumn {
|
|
|
9545
8386
|
});
|
|
9546
8387
|
}
|
|
9547
8388
|
if (items.length === 0) {
|
|
9548
|
-
return
|
|
8389
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
9549
8390
|
}
|
|
9550
8391
|
// Konvertiere zu Datenstruktur für AvatarList
|
|
9551
8392
|
const contacts = this.toContactItems(items);
|
|
9552
|
-
return (
|
|
8393
|
+
return (jsxRuntime.jsx("div", { className: cn("flex items-center", this.config.cellClassName), children: jsxRuntime.jsx(AvatarList, { items: contacts.map((contact) => ({
|
|
9553
8394
|
id: contact.id,
|
|
9554
8395
|
src: contact.src,
|
|
9555
8396
|
alt: contact.alt,
|
|
@@ -9581,7 +8422,7 @@ const badgeVariants = cva("inline-flex items-center justify-center rounded-full
|
|
|
9581
8422
|
});
|
|
9582
8423
|
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
9583
8424
|
const Comp = asChild ? Slot$2 : "span";
|
|
9584
|
-
return (
|
|
8425
|
+
return (jsxRuntime.jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
9585
8426
|
}
|
|
9586
8427
|
|
|
9587
8428
|
class BadgeColumn extends BaseColumn {
|
|
@@ -9621,17 +8462,17 @@ class BadgeColumn extends BaseColumn {
|
|
|
9621
8462
|
header: ({ column }) => {
|
|
9622
8463
|
const displayLabel = label || String(accessor);
|
|
9623
8464
|
if (!sortable) {
|
|
9624
|
-
return (
|
|
8465
|
+
return (jsxRuntime.jsx("span", { className: cn("text-muted-foreground font-medium", this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
9625
8466
|
}
|
|
9626
|
-
return (
|
|
8467
|
+
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" })] }));
|
|
9627
8468
|
},
|
|
9628
8469
|
cell: ({ getValue }) => {
|
|
9629
8470
|
const value = String(getValue());
|
|
9630
8471
|
const variantConfig = variants?.[value];
|
|
9631
8472
|
if (!variantConfig) {
|
|
9632
|
-
return (
|
|
8473
|
+
return (jsxRuntime.jsx(Badge, { variant: "outline", className: this.config.cellClassName, children: value }));
|
|
9633
8474
|
}
|
|
9634
|
-
return (
|
|
8475
|
+
return (jsxRuntime.jsxs(Badge, { variant: variantConfig.variant === "success" ||
|
|
9635
8476
|
variantConfig.variant === "warning" ||
|
|
9636
8477
|
variantConfig.variant === "info" ||
|
|
9637
8478
|
variantConfig.variant === "muted"
|
|
@@ -9649,13 +8490,13 @@ const ButtonColumn = (config) => {
|
|
|
9649
8490
|
header: config.header || "Button",
|
|
9650
8491
|
cell: ({ row }) => {
|
|
9651
8492
|
const value = row.getValue(accessorKey);
|
|
9652
|
-
return (
|
|
8493
|
+
return (jsxRuntime.jsx(Button, { onClick: () => config.onClick && config.onClick(row.original), children: value || config.label || "Click" }));
|
|
9653
8494
|
},
|
|
9654
8495
|
};
|
|
9655
8496
|
};
|
|
9656
8497
|
|
|
9657
8498
|
function Checkbox({ className, ...props }) {
|
|
9658
|
-
return (
|
|
8499
|
+
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, {}) }) }));
|
|
9659
8500
|
}
|
|
9660
8501
|
|
|
9661
8502
|
class CheckboxColumn {
|
|
@@ -9665,8 +8506,8 @@ class CheckboxColumn {
|
|
|
9665
8506
|
build() {
|
|
9666
8507
|
return {
|
|
9667
8508
|
id: 'select',
|
|
9668
|
-
header: ({ table }) => (
|
|
9669
|
-
cell: ({ row }) => (
|
|
8509
|
+
header: ({ table }) => (jsxRuntime.jsx(Checkbox, { checked: table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate'), onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value), "aria-label": "Alle ausw\u00E4hlen" })),
|
|
8510
|
+
cell: ({ row }) => (jsxRuntime.jsx(Checkbox, { checked: row.getIsSelected(), onCheckedChange: (value) => row.toggleSelected(!!value), "aria-label": "Zeile ausw\u00E4hlen" })),
|
|
9670
8511
|
enableSorting: false,
|
|
9671
8512
|
enableHiding: false,
|
|
9672
8513
|
};
|
|
@@ -9752,21 +8593,21 @@ class DateColumn extends BaseColumn {
|
|
|
9752
8593
|
header: ({ column }) => {
|
|
9753
8594
|
const displayLabel = label || String(accessor);
|
|
9754
8595
|
if (!sortable) {
|
|
9755
|
-
return (
|
|
8596
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
9756
8597
|
}
|
|
9757
|
-
return (
|
|
8598
|
+
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" })] }));
|
|
9758
8599
|
},
|
|
9759
8600
|
cell: ({ getValue }) => {
|
|
9760
8601
|
const value = getValue();
|
|
9761
8602
|
if (!value) {
|
|
9762
|
-
return
|
|
8603
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
9763
8604
|
}
|
|
9764
8605
|
const date = value instanceof Date ? value : new Date(value);
|
|
9765
8606
|
if (isNaN(date.getTime())) {
|
|
9766
|
-
return
|
|
8607
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Ung\u00FCltiges Datum" });
|
|
9767
8608
|
}
|
|
9768
8609
|
const formatted = this.formatDate(date, format || 'short', locale || 'de-DE');
|
|
9769
|
-
return (
|
|
8610
|
+
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] }));
|
|
9770
8611
|
},
|
|
9771
8612
|
};
|
|
9772
8613
|
}
|
|
@@ -9779,22 +8620,22 @@ const DropdownColumn = (config) => {
|
|
|
9779
8620
|
header: config.header || "Options",
|
|
9780
8621
|
cell: ({ row }) => {
|
|
9781
8622
|
const value = row.getValue(accessorKey);
|
|
9782
|
-
return (
|
|
8623
|
+
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))) })] }));
|
|
9783
8624
|
},
|
|
9784
8625
|
};
|
|
9785
8626
|
};
|
|
9786
8627
|
|
|
9787
8628
|
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
9788
|
-
return (
|
|
8629
|
+
return (jsxRuntime.jsx(Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }));
|
|
9789
8630
|
}
|
|
9790
8631
|
function Tooltip({ ...props }) {
|
|
9791
|
-
return (
|
|
8632
|
+
return (jsxRuntime.jsx(TooltipProvider, { children: jsxRuntime.jsx(Root3, { "data-slot": "tooltip", ...props }) }));
|
|
9792
8633
|
}
|
|
9793
8634
|
function TooltipTrigger({ ...props }) {
|
|
9794
|
-
return
|
|
8635
|
+
return jsxRuntime.jsx(Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
9795
8636
|
}
|
|
9796
8637
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
9797
|
-
return (
|
|
8638
|
+
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)]" })] }) }));
|
|
9798
8639
|
}
|
|
9799
8640
|
|
|
9800
8641
|
class IconColumn extends BaseColumn {
|
|
@@ -9964,34 +8805,34 @@ class IconColumn extends BaseColumn {
|
|
|
9964
8805
|
}
|
|
9965
8806
|
// === ICON HELPERS (inline SVGs um Lucide-Abhängigkeit zu vermeiden) ===
|
|
9966
8807
|
createCheckIcon() {
|
|
9967
|
-
return (
|
|
8808
|
+
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" }) }));
|
|
9968
8809
|
}
|
|
9969
8810
|
createXIcon() {
|
|
9970
|
-
return (
|
|
8811
|
+
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" })] }));
|
|
9971
8812
|
}
|
|
9972
8813
|
createCircleIcon() {
|
|
9973
|
-
return (
|
|
8814
|
+
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" }) }));
|
|
9974
8815
|
}
|
|
9975
8816
|
createArrowUpIcon() {
|
|
9976
|
-
return (
|
|
8817
|
+
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" })] }));
|
|
9977
8818
|
}
|
|
9978
8819
|
createArrowDownIcon() {
|
|
9979
|
-
return (
|
|
8820
|
+
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" })] }));
|
|
9980
8821
|
}
|
|
9981
8822
|
createMinusIcon() {
|
|
9982
|
-
return (
|
|
8823
|
+
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" }) }));
|
|
9983
8824
|
}
|
|
9984
8825
|
createAlertIcon() {
|
|
9985
|
-
return (
|
|
8826
|
+
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" })] }));
|
|
9986
8827
|
}
|
|
9987
8828
|
createShieldCheckIcon() {
|
|
9988
|
-
return (
|
|
8829
|
+
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" })] }));
|
|
9989
8830
|
}
|
|
9990
8831
|
createShieldXIcon() {
|
|
9991
|
-
return (
|
|
8832
|
+
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" })] }));
|
|
9992
8833
|
}
|
|
9993
8834
|
createClockIcon() {
|
|
9994
|
-
return (
|
|
8835
|
+
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" })] }));
|
|
9995
8836
|
}
|
|
9996
8837
|
build() {
|
|
9997
8838
|
const config = this.config;
|
|
@@ -10019,9 +8860,9 @@ class IconColumn extends BaseColumn {
|
|
|
10019
8860
|
header: ({ column }) => {
|
|
10020
8861
|
const displayLabel = label || String(accessor);
|
|
10021
8862
|
if (!sortable) {
|
|
10022
|
-
return (
|
|
8863
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10023
8864
|
}
|
|
10024
|
-
return (
|
|
8865
|
+
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" })] }));
|
|
10025
8866
|
},
|
|
10026
8867
|
cell: ({ getValue }) => {
|
|
10027
8868
|
const value = String(getValue());
|
|
@@ -10033,14 +8874,14 @@ class IconColumn extends BaseColumn {
|
|
|
10033
8874
|
const bgColor = stateConfig?.bgColor;
|
|
10034
8875
|
const tooltip = stateConfig?.tooltip || stateLabel;
|
|
10035
8876
|
if (!icon) {
|
|
10036
|
-
return
|
|
8877
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10037
8878
|
}
|
|
10038
8879
|
// Icon als Element rendern (falls LucideIcon übergeben wurde)
|
|
10039
8880
|
const IconElement = typeof icon === 'function' ? icon : null;
|
|
10040
|
-
const renderedIcon = IconElement ?
|
|
10041
|
-
const iconElement = (
|
|
8881
|
+
const renderedIcon = IconElement ? jsxRuntime.jsx(IconElement, { className: "h-full w-full" }) : icon;
|
|
8882
|
+
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 })] }));
|
|
10042
8883
|
if (showTooltip) {
|
|
10043
|
-
return (
|
|
8884
|
+
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 }) })] }) }));
|
|
10044
8885
|
}
|
|
10045
8886
|
return iconElement;
|
|
10046
8887
|
},
|
|
@@ -10096,11 +8937,11 @@ class ImageColumn extends BaseColumn {
|
|
|
10096
8937
|
};
|
|
10097
8938
|
return {
|
|
10098
8939
|
accessorKey: accessor,
|
|
10099
|
-
header: () =>
|
|
8940
|
+
header: () => jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.config.headerClassName), children: label || '' }),
|
|
10100
8941
|
cell: ({ getValue, row }) => {
|
|
10101
8942
|
const src = getValue();
|
|
10102
8943
|
const altText = alt ? alt(row.original) : 'Bild';
|
|
10103
|
-
return (
|
|
8944
|
+
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) => {
|
|
10104
8945
|
if (fallback) {
|
|
10105
8946
|
e.target.src = fallback;
|
|
10106
8947
|
}
|
|
@@ -10117,7 +8958,7 @@ const InputColumn = (config) => {
|
|
|
10117
8958
|
header: config.header || "Input",
|
|
10118
8959
|
cell: ({ row }) => {
|
|
10119
8960
|
const value = row.getValue(accessorKey);
|
|
10120
|
-
return (
|
|
8961
|
+
return (jsxRuntime.jsx(Input, { value: value || "", onChange: (e) => config.onChange && config.onChange(row.original, e.target.value), placeholder: config.placeholder || "Enter value" }));
|
|
10121
8962
|
},
|
|
10122
8963
|
};
|
|
10123
8964
|
};
|
|
@@ -10190,14 +9031,14 @@ class LinkColumn extends BaseColumn {
|
|
|
10190
9031
|
header: ({ column }) => {
|
|
10191
9032
|
const displayLabel = label || String(accessor);
|
|
10192
9033
|
if (!sortable) {
|
|
10193
|
-
return (
|
|
9034
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10194
9035
|
}
|
|
10195
|
-
return (
|
|
9036
|
+
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" })] }));
|
|
10196
9037
|
},
|
|
10197
9038
|
cell: ({ getValue, row }) => {
|
|
10198
9039
|
const value = getValue();
|
|
10199
9040
|
if (!value) {
|
|
10200
|
-
return
|
|
9041
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10201
9042
|
}
|
|
10202
9043
|
// URL berechnen
|
|
10203
9044
|
const url = typeof href === 'function' ? href(row.original) : href || value;
|
|
@@ -10209,7 +9050,7 @@ class LinkColumn extends BaseColumn {
|
|
|
10209
9050
|
};
|
|
10210
9051
|
// Alignment ohne text-muted-foreground für Links
|
|
10211
9052
|
const alignmentClass = this.config.align === 'center' ? 'text-center' : this.config.align === 'right' ? 'text-right' : 'text-left';
|
|
10212
|
-
return (
|
|
9053
|
+
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" })] }));
|
|
10213
9054
|
},
|
|
10214
9055
|
};
|
|
10215
9056
|
}
|
|
@@ -10260,14 +9101,14 @@ class NumberColumn extends BaseColumn {
|
|
|
10260
9101
|
header: ({ column }) => {
|
|
10261
9102
|
const displayLabel = label || String(accessor);
|
|
10262
9103
|
if (!sortable) {
|
|
10263
|
-
return (
|
|
9104
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10264
9105
|
}
|
|
10265
|
-
return (
|
|
9106
|
+
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" })] }));
|
|
10266
9107
|
},
|
|
10267
9108
|
cell: ({ getValue }) => {
|
|
10268
9109
|
const value = getValue();
|
|
10269
9110
|
if (value === null || value === undefined) {
|
|
10270
|
-
return
|
|
9111
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10271
9112
|
}
|
|
10272
9113
|
let formatted;
|
|
10273
9114
|
if (currency) {
|
|
@@ -10292,14 +9133,14 @@ class NumberColumn extends BaseColumn {
|
|
|
10292
9133
|
}).format(value);
|
|
10293
9134
|
}
|
|
10294
9135
|
const displayValue = `${prefix || ''}${formatted}${suffix || ''}`;
|
|
10295
|
-
return
|
|
9136
|
+
return jsxRuntime.jsx("span", { className: cn('tabular-nums', this.getAlignmentClass(), this.config.cellClassName), children: displayValue });
|
|
10296
9137
|
},
|
|
10297
9138
|
};
|
|
10298
9139
|
}
|
|
10299
9140
|
}
|
|
10300
9141
|
|
|
10301
9142
|
function Progress({ className, value, ...props }) {
|
|
10302
|
-
return (
|
|
9143
|
+
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)}%)` } }) }));
|
|
10303
9144
|
}
|
|
10304
9145
|
|
|
10305
9146
|
class ProgressColumn extends BaseColumn {
|
|
@@ -10399,15 +9240,15 @@ class ProgressColumn extends BaseColumn {
|
|
|
10399
9240
|
header: ({ column }) => {
|
|
10400
9241
|
const displayLabel = label || String(accessor);
|
|
10401
9242
|
if (!sortable) {
|
|
10402
|
-
return (
|
|
9243
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10403
9244
|
}
|
|
10404
|
-
return (
|
|
9245
|
+
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" })] }));
|
|
10405
9246
|
},
|
|
10406
9247
|
cell: ({ getValue }) => {
|
|
10407
9248
|
const value = getValue();
|
|
10408
9249
|
const maxValue = max || 100;
|
|
10409
9250
|
if (value === null || value === undefined) {
|
|
10410
|
-
return
|
|
9251
|
+
return jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
10411
9252
|
}
|
|
10412
9253
|
const percentage = Math.min(100, Math.max(0, (value / maxValue) * 100));
|
|
10413
9254
|
// Farbe berechnen
|
|
@@ -10423,7 +9264,7 @@ class ProgressColumn extends BaseColumn {
|
|
|
10423
9264
|
else if (showPercentage) {
|
|
10424
9265
|
labelText = `${Math.round(percentage)}%`;
|
|
10425
9266
|
}
|
|
10426
|
-
return (
|
|
9267
|
+
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 })] }));
|
|
10427
9268
|
},
|
|
10428
9269
|
};
|
|
10429
9270
|
}
|
|
@@ -10436,7 +9277,7 @@ const SelectColumn = (config) => {
|
|
|
10436
9277
|
header: config.header || "Select",
|
|
10437
9278
|
cell: ({ row }) => {
|
|
10438
9279
|
const value = row.getValue(accessorKey);
|
|
10439
|
-
return (
|
|
9280
|
+
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))) })] }));
|
|
10440
9281
|
},
|
|
10441
9282
|
};
|
|
10442
9283
|
};
|
|
@@ -10496,9 +9337,9 @@ class TextColumn extends BaseColumn {
|
|
|
10496
9337
|
header: ({ column }) => {
|
|
10497
9338
|
const displayLabel = label || String(accessor);
|
|
10498
9339
|
if (!sortable) {
|
|
10499
|
-
return (
|
|
9340
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground font-medium', this.getAlignmentClass(), this.config.headerClassName), children: displayLabel }));
|
|
10500
9341
|
}
|
|
10501
|
-
return (
|
|
9342
|
+
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" })] }));
|
|
10502
9343
|
},
|
|
10503
9344
|
cell: ({ row, getValue }) => {
|
|
10504
9345
|
let value = getValue();
|
|
@@ -10508,11 +9349,11 @@ class TextColumn extends BaseColumn {
|
|
|
10508
9349
|
}
|
|
10509
9350
|
// Placeholder wenn leer
|
|
10510
9351
|
if (value === null || value === undefined || value === '') {
|
|
10511
|
-
return (
|
|
9352
|
+
return (jsxRuntime.jsx("span", { className: cn('text-muted-foreground', this.getAlignmentClass(), this.config.cellClassName), children: placeholder || '—' }));
|
|
10512
9353
|
}
|
|
10513
9354
|
// Prefix/Suffix hinzufügen
|
|
10514
9355
|
const displayValue = `${prefix || ''}${value}${suffix || ''}`;
|
|
10515
|
-
return
|
|
9356
|
+
return jsxRuntime.jsx("span", { className: cn(this.getAlignmentClass(), this.config.cellClassName), children: displayValue });
|
|
10516
9357
|
},
|
|
10517
9358
|
};
|
|
10518
9359
|
}
|
|
@@ -10567,20 +9408,20 @@ class ActionsColumn {
|
|
|
10567
9408
|
const { actions, label, triggerIcon } = this.config;
|
|
10568
9409
|
return {
|
|
10569
9410
|
id: 'actions',
|
|
10570
|
-
header: () =>
|
|
9411
|
+
header: () => jsxRuntime.jsx("span", { className: "sr-only", children: label }),
|
|
10571
9412
|
cell: ({ row }) => {
|
|
10572
9413
|
const data = row.original;
|
|
10573
9414
|
const visibleActions = actions.filter((action) => !action.hidden || !action.hidden(data));
|
|
10574
9415
|
if (visibleActions.length === 0)
|
|
10575
9416
|
return null;
|
|
10576
|
-
return (
|
|
9417
|
+
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: () => {
|
|
10577
9418
|
if (action.href) {
|
|
10578
9419
|
window.location.href = action.href(data);
|
|
10579
9420
|
}
|
|
10580
9421
|
else if (action.onClick) {
|
|
10581
9422
|
action.onClick(data);
|
|
10582
9423
|
}
|
|
10583
|
-
}, children: [action.icon &&
|
|
9424
|
+
}, children: [action.icon && jsxRuntime.jsx("span", { className: "mr-2", children: action.icon }), action.label] }), action.separator && index < visibleActions.length - 1 && jsxRuntime.jsx(DropdownMenuSeparator, {})] }, index))) })] }));
|
|
10584
9425
|
},
|
|
10585
9426
|
};
|
|
10586
9427
|
}
|