@banyan_cloud/roots 2.0.42 → 2.0.43
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/esm/index.js +201 -206
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/components/buttons/baseButton/types/index.d.ts +1 -1
- package/dist/esm/src/components/codeSnippet/CodeSnippet.d.ts +2 -13
- package/dist/esm/src/components/codeSnippet/index.d.ts +1 -1
- package/dist/esm/src/components/codeSnippet/types/index.d.ts +29 -0
- package/dist/esm/src/components/icons/Clock/Clock.d.ts +5 -3
- package/dist/esm/src/components/icons/Clock/index.d.ts +1 -1
- package/dist/esm/src/components/input/textField/TextField.d.ts +3 -7
- package/dist/esm/src/components/popover/Popover.d.ts +10 -8
- package/dist/esm/src/components/popper/Popper.d.ts +4 -2
- package/dist/esm/src/components/table/types/index.d.ts +1 -0
- package/package.json +2 -1
package/dist/esm/index.js
CHANGED
|
@@ -4156,7 +4156,7 @@ var BaseButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4156
4156
|
if (blurOnClick) {
|
|
4157
4157
|
event.currentTarget.blur();
|
|
4158
4158
|
}
|
|
4159
|
-
_onClick === null || _onClick === void 0
|
|
4159
|
+
void (_onClick === null || _onClick === void 0 ? void 0 : _onClick(event));
|
|
4160
4160
|
}
|
|
4161
4161
|
},
|
|
4162
4162
|
RootDOM: 'button'
|
|
@@ -5232,34 +5232,38 @@ var Chevron = function Chevron(props) {
|
|
|
5232
5232
|
};
|
|
5233
5233
|
|
|
5234
5234
|
var Clock = function Clock(_ref) {
|
|
5235
|
-
var className = _ref.className
|
|
5236
|
-
|
|
5235
|
+
var className = _ref.className,
|
|
5236
|
+
width = _ref.width,
|
|
5237
|
+
height = _ref.height;
|
|
5238
|
+
return jsxs("svg", {
|
|
5237
5239
|
className: className,
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5240
|
+
width: width,
|
|
5241
|
+
height: height,
|
|
5242
|
+
viewBox: '0 0 24 24',
|
|
5243
|
+
fill: 'none',
|
|
5244
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
5245
|
+
children: [jsxs("g", {
|
|
5246
|
+
clipPath: 'url(#clip0_5056_4832)',
|
|
5247
|
+
children: [jsx("path", {
|
|
5248
|
+
d: 'M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z',
|
|
5249
|
+
stroke: '#333333',
|
|
5250
|
+
strokeWidth: '2',
|
|
5251
|
+
strokeLinecap: 'round',
|
|
5252
|
+
strokeLinejoin: 'round'
|
|
5253
|
+
}), jsx("path", {
|
|
5254
|
+
d: 'M12 7V12L15 15',
|
|
5255
|
+
stroke: '#333333',
|
|
5256
|
+
strokeWidth: '2',
|
|
5257
|
+
strokeLinecap: 'round',
|
|
5258
|
+
strokeLinejoin: 'round'
|
|
5255
5259
|
})]
|
|
5256
|
-
}),
|
|
5257
|
-
children:
|
|
5258
|
-
id:
|
|
5259
|
-
children:
|
|
5260
|
-
width:
|
|
5261
|
-
height:
|
|
5262
|
-
fill:
|
|
5260
|
+
}), jsx("defs", {
|
|
5261
|
+
children: jsx("clipPath", {
|
|
5262
|
+
id: 'clip0_5056_4832',
|
|
5263
|
+
children: jsx("rect", {
|
|
5264
|
+
width: '24',
|
|
5265
|
+
height: '24',
|
|
5266
|
+
fill: 'white'
|
|
5263
5267
|
})
|
|
5264
5268
|
})
|
|
5265
5269
|
})]
|
|
@@ -5957,7 +5961,7 @@ var Tick = function Tick(props) {
|
|
|
5957
5961
|
return jsxs("svg", {
|
|
5958
5962
|
className: className,
|
|
5959
5963
|
viewBox: '0 0 13 12',
|
|
5960
|
-
fill: '
|
|
5964
|
+
fill: 'green',
|
|
5961
5965
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
5962
5966
|
children: [jsx("g", {
|
|
5963
5967
|
clipPath: 'url(#clip0_638_154)',
|
|
@@ -10360,7 +10364,10 @@ var Popper = function Popper(_ref) {
|
|
|
10360
10364
|
_ref$className = _ref.className,
|
|
10361
10365
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
10362
10366
|
_ref$transparent = _ref.transparent,
|
|
10363
|
-
transparent = _ref$transparent === void 0 ? true : _ref$transparent
|
|
10367
|
+
transparent = _ref$transparent === void 0 ? true : _ref$transparent,
|
|
10368
|
+
lockScroll = _ref.lockScroll,
|
|
10369
|
+
_ref$withOverlay = _ref.withOverlay,
|
|
10370
|
+
withOverlay = _ref$withOverlay === void 0 ? true : _ref$withOverlay;
|
|
10364
10371
|
var id = useId$1();
|
|
10365
10372
|
var portalId = "".concat(wrapperId).concat(id);
|
|
10366
10373
|
useEffect(function () {
|
|
@@ -10371,14 +10378,18 @@ var Popper = function Popper(_ref) {
|
|
|
10371
10378
|
}
|
|
10372
10379
|
};
|
|
10373
10380
|
}, [portalId]);
|
|
10381
|
+
var resolvedLock = lockScroll !== null && lockScroll !== void 0 ? lockScroll : withOverlay;
|
|
10374
10382
|
return jsx(FloatingPortal, {
|
|
10375
10383
|
id: portalId,
|
|
10376
10384
|
children: jsx(AnimatePresence, {
|
|
10377
|
-
children: open && jsx(FloatingOverlay, {
|
|
10378
|
-
lockScroll:
|
|
10385
|
+
children: open && (withOverlay ? jsx(FloatingOverlay, {
|
|
10386
|
+
lockScroll: resolvedLock,
|
|
10379
10387
|
className: classes(modules_fe46b225.backdrop, transparent ? modules_fe46b225.transparent : '', backdrop ? '' : modules_fe46b225['hide-backdrop'], className),
|
|
10380
10388
|
children: children
|
|
10381
|
-
})
|
|
10389
|
+
}) : jsx("div", {
|
|
10390
|
+
className: className,
|
|
10391
|
+
children: children
|
|
10392
|
+
}))
|
|
10382
10393
|
})
|
|
10383
10394
|
});
|
|
10384
10395
|
};
|
|
@@ -10463,8 +10474,7 @@ var Alert = function Alert(_ref, ref) {
|
|
|
10463
10474
|
switch (type) {
|
|
10464
10475
|
case 'info':
|
|
10465
10476
|
Icon = jsx(AlertIcon.Info, {
|
|
10466
|
-
className: modules_3a764ea3.icon
|
|
10467
|
-
v2: true
|
|
10477
|
+
className: modules_3a764ea3.icon
|
|
10468
10478
|
});
|
|
10469
10479
|
break;
|
|
10470
10480
|
case 'error':
|
|
@@ -10474,20 +10484,17 @@ var Alert = function Alert(_ref, ref) {
|
|
|
10474
10484
|
break;
|
|
10475
10485
|
case 'warning':
|
|
10476
10486
|
Icon = jsx(AlertIcon.Warning, {
|
|
10477
|
-
className: modules_3a764ea3.icon
|
|
10478
|
-
v2: true
|
|
10487
|
+
className: modules_3a764ea3.icon
|
|
10479
10488
|
});
|
|
10480
10489
|
break;
|
|
10481
10490
|
case 'success':
|
|
10482
10491
|
Icon = jsx(AlertIcon.Success, {
|
|
10483
|
-
className: modules_3a764ea3.icon
|
|
10484
|
-
v2: true
|
|
10492
|
+
className: modules_3a764ea3.icon
|
|
10485
10493
|
});
|
|
10486
10494
|
break;
|
|
10487
10495
|
case 'danger':
|
|
10488
10496
|
Icon = jsx(AlertIcon.Danger, {
|
|
10489
|
-
className: modules_3a764ea3.icon
|
|
10490
|
-
v2: true
|
|
10497
|
+
className: modules_3a764ea3.icon
|
|
10491
10498
|
});
|
|
10492
10499
|
break;
|
|
10493
10500
|
default:
|
|
@@ -10549,7 +10556,8 @@ var Alert = function Alert(_ref, ref) {
|
|
|
10549
10556
|
return jsx(Popper, {
|
|
10550
10557
|
open: open,
|
|
10551
10558
|
className: modules_3a764ea3.popper,
|
|
10552
|
-
|
|
10559
|
+
wrapperId: 'alert-popper',
|
|
10560
|
+
lockScroll: false,
|
|
10553
10561
|
children: jsxs("div", _objectSpread2(_objectSpread2({}, getFloatingProps({
|
|
10554
10562
|
ref: floating,
|
|
10555
10563
|
className: classes(modules_3a764ea3.root, modules_3a764ea3[type], shadow ? modules_3a764ea3.shadow : '', modules_3a764ea3["position-".concat(position)], className)
|
|
@@ -10607,7 +10615,6 @@ var resolveOffset = function resolveOffset(user) {
|
|
|
10607
10615
|
}, user);
|
|
10608
10616
|
};
|
|
10609
10617
|
var Popover = function Popover(_ref) {
|
|
10610
|
-
var _middlewareOptions$fl;
|
|
10611
10618
|
var children = _ref.children,
|
|
10612
10619
|
anchorEl = _ref.anchorEl,
|
|
10613
10620
|
open = _ref.open,
|
|
@@ -10615,20 +10622,24 @@ var Popover = function Popover(_ref) {
|
|
|
10615
10622
|
className = _ref.className,
|
|
10616
10623
|
_ref$transparent = _ref.transparent,
|
|
10617
10624
|
transparent = _ref$transparent === void 0 ? true : _ref$transparent,
|
|
10618
|
-
|
|
10619
|
-
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
10625
|
+
onClose = _ref.onClose,
|
|
10620
10626
|
_ref$placement = _ref.placement,
|
|
10621
10627
|
placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
|
|
10622
10628
|
_ref$theme = _ref.theme,
|
|
10623
10629
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
10624
|
-
middlewareOptions = _ref.middlewareOptions
|
|
10630
|
+
middlewareOptions = _ref.middlewareOptions,
|
|
10631
|
+
lockScroll = _ref.lockScroll,
|
|
10632
|
+
_ref$withOverlay = _ref.withOverlay,
|
|
10633
|
+
withOverlay = _ref$withOverlay === void 0 ? true : _ref$withOverlay;
|
|
10625
10634
|
var offsetArg = resolveOffset(middlewareOptions === null || middlewareOptions === void 0 ? void 0 : middlewareOptions.offset);
|
|
10626
10635
|
var flipArg = _objectSpread2({
|
|
10627
10636
|
padding: 8
|
|
10628
|
-
},
|
|
10629
|
-
var _useFloating = useFloating({
|
|
10630
|
-
open: open
|
|
10631
|
-
|
|
10637
|
+
}, middlewareOptions !== null && middlewareOptions !== void 0 && middlewareOptions.flip && _typeof$1(middlewareOptions.flip) === 'object' ? _objectSpread2({}, middlewareOptions.flip) : {});
|
|
10638
|
+
var _useFloating = useFloating(_objectSpread2(_objectSpread2(_objectSpread2({}, open && {
|
|
10639
|
+
open: open
|
|
10640
|
+
}), setOpen && {
|
|
10641
|
+
onOpenChange: setOpen
|
|
10642
|
+
}), {}, {
|
|
10632
10643
|
placement: placement,
|
|
10633
10644
|
whileElementsMounted: autoUpdate,
|
|
10634
10645
|
middleware: [offset(offsetArg), shift(middlewareOptions === null || middlewareOptions === void 0 ? void 0 : middlewareOptions.shift), flip(flipArg), size({
|
|
@@ -10637,14 +10648,14 @@ var Popover = function Popover(_ref) {
|
|
|
10637
10648
|
availableHeight = _ref2.availableHeight,
|
|
10638
10649
|
elements = _ref2.elements;
|
|
10639
10650
|
Object.assign(elements.floating.style, {
|
|
10640
|
-
width: "".concat(rects.reference.width, "px"),
|
|
10651
|
+
width: "".concat(rects.reference.width.toString(), "px"),
|
|
10641
10652
|
minWidth: 'fit-content',
|
|
10642
|
-
maxHeight: "".concat(availableHeight, "px")
|
|
10653
|
+
maxHeight: "".concat(availableHeight.toString(), "px")
|
|
10643
10654
|
});
|
|
10644
10655
|
},
|
|
10645
10656
|
padding: 8
|
|
10646
10657
|
})]
|
|
10647
|
-
}),
|
|
10658
|
+
})),
|
|
10648
10659
|
x = _useFloating.x,
|
|
10649
10660
|
y = _useFloating.y,
|
|
10650
10661
|
reference = _useFloating.reference,
|
|
@@ -10654,7 +10665,7 @@ var Popover = function Popover(_ref) {
|
|
|
10654
10665
|
var _useInteractions = useInteractions([useDismiss(context)]),
|
|
10655
10666
|
getFloatingProps = _useInteractions.getFloatingProps;
|
|
10656
10667
|
useEffect(function () {
|
|
10657
|
-
if (!open) onClose();
|
|
10668
|
+
if (!open) onClose === null || onClose === void 0 || onClose();
|
|
10658
10669
|
}, [open, onClose]);
|
|
10659
10670
|
useLayoutEffect(function () {
|
|
10660
10671
|
reference(anchorEl);
|
|
@@ -10663,6 +10674,8 @@ var Popover = function Popover(_ref) {
|
|
|
10663
10674
|
open: open,
|
|
10664
10675
|
wrapperId: 'popover',
|
|
10665
10676
|
transparent: transparent,
|
|
10677
|
+
lockScroll: lockScroll,
|
|
10678
|
+
withOverlay: withOverlay,
|
|
10666
10679
|
children: jsx("div", _objectSpread2(_objectSpread2({}, getFloatingProps({
|
|
10667
10680
|
ref: floating,
|
|
10668
10681
|
style: {
|
|
@@ -10795,32 +10808,27 @@ var Callout = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
10795
10808
|
switch (type) {
|
|
10796
10809
|
case 'info':
|
|
10797
10810
|
Icon = jsx(AlertIcon.Info, {
|
|
10798
|
-
className: modules_b6de2704.icon
|
|
10799
|
-
v2: true
|
|
10811
|
+
className: modules_b6de2704.icon
|
|
10800
10812
|
});
|
|
10801
10813
|
break;
|
|
10802
10814
|
case 'error':
|
|
10803
10815
|
Icon = jsx(AlertIcon.Error, {
|
|
10804
|
-
className: modules_b6de2704.icon
|
|
10805
|
-
v2: true
|
|
10816
|
+
className: modules_b6de2704.icon
|
|
10806
10817
|
});
|
|
10807
10818
|
break;
|
|
10808
10819
|
case 'warning':
|
|
10809
10820
|
Icon = jsx(AlertIcon.Warning, {
|
|
10810
|
-
className: modules_b6de2704.icon
|
|
10811
|
-
v2: true
|
|
10821
|
+
className: modules_b6de2704.icon
|
|
10812
10822
|
});
|
|
10813
10823
|
break;
|
|
10814
10824
|
case 'success':
|
|
10815
10825
|
Icon = jsx(AlertIcon.Success, {
|
|
10816
|
-
className: modules_b6de2704.icon
|
|
10817
|
-
v2: true
|
|
10826
|
+
className: modules_b6de2704.icon
|
|
10818
10827
|
});
|
|
10819
10828
|
break;
|
|
10820
10829
|
case 'danger':
|
|
10821
10830
|
Icon = jsx(AlertIcon.Danger, {
|
|
10822
|
-
className: modules_b6de2704.icon
|
|
10823
|
-
v2: true
|
|
10831
|
+
className: modules_b6de2704.icon
|
|
10824
10832
|
});
|
|
10825
10833
|
break;
|
|
10826
10834
|
default:
|
|
@@ -15674,104 +15682,108 @@ var BasePieChart = function BasePieChart(props) {
|
|
|
15674
15682
|
});
|
|
15675
15683
|
};
|
|
15676
15684
|
|
|
15677
|
-
var css$O = ".
|
|
15678
|
-
var modules_c548043f = {"root":"
|
|
15685
|
+
var css$O = ".CodeSnippet_module_root__292230a0 {\n padding: 0.5rem, 1rem;\n position: relative;\n}\n.CodeSnippet_module_root__292230a0 .CodeSnippet_module_code__292230a0 {\n font-family: monospace;\n font-size: 1rem;\n}\n.CodeSnippet_module_root__292230a0 .CodeSnippet_module_copy__292230a0 {\n visibility: hidden;\n position: absolute;\n padding: 0 !important;\n width: 2.25rem;\n height: 2.25rem;\n right: 1rem;\n top: 1rem;\n background-color: transparent !important;\n}\n.CodeSnippet_module_root__292230a0 .CodeSnippet_module_copy__292230a0 [data-elem=title] {\n box-shadow: 0px 0px 0.125rem 0px rgba(0, 0, 0, 0.35);\n border-radius: 0.25rem;\n padding: 0.35rem;\n}\n.CodeSnippet_module_root__292230a0 .CodeSnippet_module_copy__292230a0 [data-elem=title] > span {\n display: inline-flex;\n}\n.CodeSnippet_module_root__292230a0:hover .CodeSnippet_module_copy__292230a0 {\n visibility: visible;\n position: absolute;\n right: 1rem;\n top: 1rem;\n}\n.CodeSnippet_module_root__292230a0:hover .CodeSnippet_module_copy__292230a0 .CodeSnippet_module_icon__292230a0 {\n width: 1.25rem;\n height: 1.25rem;\n fill: rgba(0, 0, 0, 0.75);\n}\n\n.CodeSnippet_module_tick__292230a0 {\n width: 1.25rem;\n height: 1.25rem;\n}";
|
|
15686
|
+
var modules_c548043f = {"root":"CodeSnippet_module_root__292230a0","code":"CodeSnippet_module_code__292230a0","copy":"CodeSnippet_module_copy__292230a0","icon":"CodeSnippet_module_icon__292230a0","tick":"CodeSnippet_module_tick__292230a0"};
|
|
15679
15687
|
n(css$O,{});
|
|
15680
15688
|
|
|
15689
|
+
var MotionSpan = motion.span;
|
|
15690
|
+
var copyIconProps = {
|
|
15691
|
+
initial: {
|
|
15692
|
+
opacity: 0,
|
|
15693
|
+
y: 5
|
|
15694
|
+
},
|
|
15695
|
+
animate: {
|
|
15696
|
+
opacity: 1,
|
|
15697
|
+
y: 0
|
|
15698
|
+
},
|
|
15699
|
+
exit: {
|
|
15700
|
+
opacity: 0,
|
|
15701
|
+
y: -5
|
|
15702
|
+
},
|
|
15703
|
+
transition: {
|
|
15704
|
+
duration: 0.2
|
|
15705
|
+
}
|
|
15706
|
+
};
|
|
15707
|
+
var tickIconProps = {
|
|
15708
|
+
initial: {
|
|
15709
|
+
scale: 0,
|
|
15710
|
+
opacity: 0
|
|
15711
|
+
},
|
|
15712
|
+
animate: {
|
|
15713
|
+
scale: 1.2,
|
|
15714
|
+
opacity: 1
|
|
15715
|
+
},
|
|
15716
|
+
exit: {
|
|
15717
|
+
scale: 0,
|
|
15718
|
+
opacity: 0
|
|
15719
|
+
},
|
|
15720
|
+
transition: {
|
|
15721
|
+
type: 'spring',
|
|
15722
|
+
stiffness: 400,
|
|
15723
|
+
damping: 15
|
|
15724
|
+
}
|
|
15725
|
+
};
|
|
15726
|
+
var CopyButton = function CopyButton(_ref) {
|
|
15727
|
+
var code = _ref.code;
|
|
15728
|
+
var _useState = useState(false),
|
|
15729
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15730
|
+
copied = _useState2[0],
|
|
15731
|
+
setCopied = _useState2[1];
|
|
15732
|
+
var onCopy = /*#__PURE__*/function () {
|
|
15733
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
15734
|
+
return _regenerator().w(function (_context) {
|
|
15735
|
+
while (1) switch (_context.n) {
|
|
15736
|
+
case 0:
|
|
15737
|
+
setCopied(true);
|
|
15738
|
+
_context.n = 1;
|
|
15739
|
+
return navigator.clipboard.writeText(code);
|
|
15740
|
+
case 1:
|
|
15741
|
+
setTimeout(function () {
|
|
15742
|
+
setCopied(false);
|
|
15743
|
+
}, 1000);
|
|
15744
|
+
case 2:
|
|
15745
|
+
return _context.a(2);
|
|
15746
|
+
}
|
|
15747
|
+
}, _callee);
|
|
15748
|
+
}));
|
|
15749
|
+
return function onCopy() {
|
|
15750
|
+
return _ref2.apply(this, arguments);
|
|
15751
|
+
};
|
|
15752
|
+
}();
|
|
15753
|
+
return jsx(Button, {
|
|
15754
|
+
title: jsx(AnimatePresence, {
|
|
15755
|
+
mode: 'popLayout',
|
|
15756
|
+
initial: false,
|
|
15757
|
+
children: !copied ? jsx(MotionSpan, _objectSpread2(_objectSpread2({
|
|
15758
|
+
title: 'Copy'
|
|
15759
|
+
}, copyIconProps), {}, {
|
|
15760
|
+
children: jsx(Copy, {
|
|
15761
|
+
className: modules_c548043f.icon
|
|
15762
|
+
})
|
|
15763
|
+
}), 'copy') : jsx(MotionSpan, _objectSpread2(_objectSpread2({}, tickIconProps), {}, {
|
|
15764
|
+
className: 'flex items-center',
|
|
15765
|
+
children: jsx(Tick, {
|
|
15766
|
+
className: modules_c548043f.tick
|
|
15767
|
+
})
|
|
15768
|
+
}), 'tick')
|
|
15769
|
+
}),
|
|
15770
|
+
className: modules_c548043f.copy,
|
|
15771
|
+
onClick: onCopy
|
|
15772
|
+
});
|
|
15773
|
+
};
|
|
15681
15774
|
var CodeSnippet = function CodeSnippet(props) {
|
|
15682
|
-
var copy = props.copy,
|
|
15775
|
+
var _props$copy = props.copy,
|
|
15776
|
+
copy = _props$copy === void 0 ? false : _props$copy,
|
|
15683
15777
|
_props$code = props.code,
|
|
15684
15778
|
code = _props$code === void 0 ? '{}' : _props$code,
|
|
15685
15779
|
_props$language = props.language,
|
|
15686
15780
|
language = _props$language === void 0 ? 'json' : _props$language,
|
|
15687
|
-
|
|
15781
|
+
_props$showLineNumber = props.showLineNumbers,
|
|
15782
|
+
showLineNumbers = _props$showLineNumber === void 0 ? false : _props$showLineNumber,
|
|
15688
15783
|
_props$theme = props.theme,
|
|
15689
15784
|
theme = _props$theme === void 0 ? 'light' : _props$theme,
|
|
15690
15785
|
_props$className = props.className,
|
|
15691
|
-
className = _props$className === void 0 ? '' : _props$className
|
|
15692
|
-
_props$onClick = props.onClick,
|
|
15693
|
-
_onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
15694
|
-
parentKeyToSelect = props.parentKeyToSelect;
|
|
15695
|
-
var _useState = useState(null),
|
|
15696
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
15697
|
-
parentNode = _useState2[0],
|
|
15698
|
-
setParentNode = _useState2[1];
|
|
15699
|
-
var alertRef = useRef(Alert$1);
|
|
15700
|
-
var onCopy = function onCopy() {
|
|
15701
|
-
var _alertRef$current;
|
|
15702
|
-
navigator.clipboard.writeText(code);
|
|
15703
|
-
(_alertRef$current = alertRef.current) === null || _alertRef$current === void 0 || _alertRef$current.alert({
|
|
15704
|
-
title: "".concat(language === null || language === void 0 ? void 0 : language.toUpperCase()),
|
|
15705
|
-
description: 'The code has been copied to the clipboard',
|
|
15706
|
-
type: 'info',
|
|
15707
|
-
icon: function icon(args) {
|
|
15708
|
-
return /*#__PURE__*/jsx(Copy, _objectSpread2({}, args));
|
|
15709
|
-
}
|
|
15710
|
-
});
|
|
15711
|
-
};
|
|
15712
|
-
function findKeyPath(obj, targetKey) {
|
|
15713
|
-
var currentPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
15714
|
-
var keys = Object.keys(obj);
|
|
15715
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
15716
|
-
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
|
|
15717
|
-
var key = _keys[_i];
|
|
15718
|
-
var newPath = currentPath ? "".concat(currentPath, "/").concat(key) : key;
|
|
15719
|
-
if (key === targetKey) {
|
|
15720
|
-
// Display the full path of the key from the object
|
|
15721
|
-
return newPath;
|
|
15722
|
-
}
|
|
15723
|
-
if (parentKeyToSelect && !currentPath) {
|
|
15724
|
-
var nestedPath = findKeyPath(obj[parentKeyToSelect], targetKey, parentKeyToSelect);
|
|
15725
|
-
if (nestedPath) {
|
|
15726
|
-
return nestedPath;
|
|
15727
|
-
}
|
|
15728
|
-
}
|
|
15729
|
-
if (obj[key] && _typeof$1(obj[key]) === 'object') {
|
|
15730
|
-
// Recursively search nested keys
|
|
15731
|
-
var _nestedPath = findKeyPath(obj[key], targetKey, newPath);
|
|
15732
|
-
if (_nestedPath) {
|
|
15733
|
-
return _nestedPath;
|
|
15734
|
-
}
|
|
15735
|
-
}
|
|
15736
|
-
}
|
|
15737
|
-
return '';
|
|
15738
|
-
}
|
|
15739
|
-
var handleCodeClick = function handleCodeClick(event) {
|
|
15740
|
-
var _event$target$childre;
|
|
15741
|
-
var hasNoChildren = ((_event$target$childre = event.target.children) === null || _event$target$childre === void 0 ? void 0 : _event$target$childre.length) === 0;
|
|
15742
|
-
if (language === 'json' && hasNoChildren) {
|
|
15743
|
-
try {
|
|
15744
|
-
var parsedCode = JSON.parse(code);
|
|
15745
|
-
var clickedKey = event.target.textContent.replace(/"/g, '').trim();
|
|
15746
|
-
|
|
15747
|
-
// Check for a direct match in top-level keys
|
|
15748
|
-
var matchingKey = Object.keys(parsedCode).find(function (key) {
|
|
15749
|
-
return String(parsedCode[key]) === clickedKey;
|
|
15750
|
-
});
|
|
15751
|
-
if (matchingKey) {
|
|
15752
|
-
return matchingKey;
|
|
15753
|
-
}
|
|
15754
|
-
// Check for nested keys
|
|
15755
|
-
var keyPath = findKeyPath(parsedCode, clickedKey);
|
|
15756
|
-
if (keyPath) {
|
|
15757
|
-
event.target.parentNode.style.backgroundColor = theme === 'light' ? '#333' : 'white';
|
|
15758
|
-
if (parentNode) {
|
|
15759
|
-
parentNode.style.backgroundColor = '';
|
|
15760
|
-
if (event.target.parentNode === parentNode) {
|
|
15761
|
-
setParentNode(null);
|
|
15762
|
-
return null;
|
|
15763
|
-
}
|
|
15764
|
-
}
|
|
15765
|
-
setParentNode(event.target.parentNode);
|
|
15766
|
-
return keyPath;
|
|
15767
|
-
}
|
|
15768
|
-
return clickedKey;
|
|
15769
|
-
} catch (error) {
|
|
15770
|
-
return error;
|
|
15771
|
-
}
|
|
15772
|
-
}
|
|
15773
|
-
return null;
|
|
15774
|
-
};
|
|
15786
|
+
className = _props$className === void 0 ? '' : _props$className;
|
|
15775
15787
|
var syntaxHighlighterProps = {
|
|
15776
15788
|
showLineNumbers: showLineNumbers,
|
|
15777
15789
|
language: language,
|
|
@@ -15780,38 +15792,17 @@ var CodeSnippet = function CodeSnippet(props) {
|
|
|
15780
15792
|
codeTagProps: {
|
|
15781
15793
|
className: classes(modules_c548043f.code, className)
|
|
15782
15794
|
},
|
|
15783
|
-
style: theme === 'light' ? coldarkCold : coldarkDark
|
|
15784
|
-
onClick: function onClick(event) {
|
|
15785
|
-
return _onClick(event, handleCodeClick);
|
|
15786
|
-
}
|
|
15795
|
+
style: theme === 'light' ? coldarkCold : coldarkDark
|
|
15787
15796
|
};
|
|
15788
|
-
return
|
|
15789
|
-
|
|
15790
|
-
|
|
15791
|
-
children:
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
className: modules_c548043f.copy,
|
|
15795
|
-
onClick: onCopy,
|
|
15796
|
-
children: /*#__PURE__*/jsx(Copy, {
|
|
15797
|
-
className: classes(modules_c548043f.icon)
|
|
15798
|
-
})
|
|
15799
|
-
})]
|
|
15800
|
-
}), /*#__PURE__*/jsx(Alert$1, {
|
|
15801
|
-
ref: alertRef
|
|
15797
|
+
return jsxs("div", {
|
|
15798
|
+
className: modules_c548043f.root,
|
|
15799
|
+
children: [jsx(Prism, _objectSpread2(_objectSpread2({}, syntaxHighlighterProps), {}, {
|
|
15800
|
+
children: code
|
|
15801
|
+
})), copy && jsx(CopyButton, {
|
|
15802
|
+
code: code
|
|
15802
15803
|
})]
|
|
15803
15804
|
});
|
|
15804
15805
|
};
|
|
15805
|
-
CodeSnippet.propTypes = {
|
|
15806
|
-
copy: propTypesExports.bool,
|
|
15807
|
-
code: propTypesExports.string,
|
|
15808
|
-
language: propTypesExports.string,
|
|
15809
|
-
showLineNumbers: propTypesExports.bool,
|
|
15810
|
-
theme: propTypesExports.string,
|
|
15811
|
-
className: propTypesExports.string,
|
|
15812
|
-
onClick: propTypesExports.func,
|
|
15813
|
-
parentKeyToSelect: propTypesExports.string
|
|
15814
|
-
};
|
|
15815
15806
|
|
|
15816
15807
|
var useOutsideClickListener = function useOutsideClickListener(callback, ref) {
|
|
15817
15808
|
useEffect(function () {
|
|
@@ -18212,6 +18203,7 @@ var Tooltip = /*#__PURE__*/forwardRef(function (props, propRef) {
|
|
|
18212
18203
|
children: [clonedChildren, jsx(Popper, {
|
|
18213
18204
|
open: open && content != null,
|
|
18214
18205
|
backdrop: false,
|
|
18206
|
+
lockScroll: false,
|
|
18215
18207
|
wrapperId: 'tooltip',
|
|
18216
18208
|
children: jsxs(motion.div, _objectSpread2(_objectSpread2({}, getFloatingProps({
|
|
18217
18209
|
ref: floating,
|
|
@@ -18278,7 +18270,6 @@ var TextField = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
18278
18270
|
feedback = props.feedback,
|
|
18279
18271
|
maxLength = props.maxLength,
|
|
18280
18272
|
onKeyDown = props.onKeyDown,
|
|
18281
|
-
autocomplete = props.autocomplete,
|
|
18282
18273
|
autocompleteOptions = props.autocompleteOptions;
|
|
18283
18274
|
var _useRef = useRef(value !== undefined),
|
|
18284
18275
|
isControlled = _useRef.current;
|
|
@@ -18290,21 +18281,17 @@ var TextField = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
18290
18281
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
18291
18282
|
inputType = _useState4[0],
|
|
18292
18283
|
setInputType = _useState4[1];
|
|
18293
|
-
var _useState5 = useState(
|
|
18284
|
+
var _useState5 = useState(false),
|
|
18294
18285
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
var
|
|
18298
|
-
|
|
18299
|
-
|
|
18300
|
-
|
|
18301
|
-
autocompleteOptions === null || autocompleteOptions === void 0 || (_autocompleteOptions$3 = autocompleteOptions.setOpen) === null || _autocompleteOptions$3 === void 0 || _autocompleteOptions$3.call(autocompleteOptions, !!shouldOpen);
|
|
18302
|
-
}
|
|
18303
|
-
};
|
|
18286
|
+
showAutocompleteOptions = _useState6[0],
|
|
18287
|
+
setShowAutocompleteOptions = _useState6[1];
|
|
18288
|
+
var _useState7 = useState(null),
|
|
18289
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
18290
|
+
anchorEl = _useState8[0],
|
|
18291
|
+
setAnchorEl = _useState8[1];
|
|
18304
18292
|
var handleChange = function handleChange(event) {
|
|
18305
18293
|
var _inputHelper = inputHelper(event),
|
|
18306
18294
|
fieldValue = _inputHelper.fieldValue;
|
|
18307
|
-
checkAndOpenAutocomplete(fieldValue);
|
|
18308
18295
|
if (isControlled) {
|
|
18309
18296
|
onChange === null || onChange === void 0 || onChange(event, fieldValue);
|
|
18310
18297
|
} else {
|
|
@@ -18345,11 +18332,9 @@ var TextField = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
18345
18332
|
type: 'button',
|
|
18346
18333
|
leftComponent: function leftComponent() {
|
|
18347
18334
|
return inputType === 'password' ? jsx(HidePassword, {
|
|
18348
|
-
className: classes(modules_c1d23762.icon, feedback !== null && feedback !== void 0 && feedback.error ? modules_c1d23762.error : '')
|
|
18349
|
-
position: 'left'
|
|
18335
|
+
className: classes(modules_c1d23762.icon, feedback !== null && feedback !== void 0 && feedback.error ? modules_c1d23762.error : '')
|
|
18350
18336
|
}) : jsx(ViewPasswordIcon, {
|
|
18351
|
-
className: classes(modules_c1d23762.icon, feedback !== null && feedback !== void 0 && feedback.error ? modules_c1d23762.error : '')
|
|
18352
|
-
position: 'left'
|
|
18337
|
+
className: classes(modules_c1d23762.icon, feedback !== null && feedback !== void 0 && feedback.error ? modules_c1d23762.error : '')
|
|
18353
18338
|
});
|
|
18354
18339
|
},
|
|
18355
18340
|
onClick: function onClick() {
|
|
@@ -18388,6 +18373,10 @@ var TextField = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
18388
18373
|
}
|
|
18389
18374
|
return RightComponent ? jsx(RightComponent, {}) : null;
|
|
18390
18375
|
};
|
|
18376
|
+
var handleOnBlur = function handleOnBlur() {
|
|
18377
|
+
onBlur === null || onBlur === void 0 || onBlur();
|
|
18378
|
+
setShowAutocompleteOptions(false);
|
|
18379
|
+
};
|
|
18391
18380
|
var inputValue = isControlled ? String(value !== null && value !== void 0 ? value : '') : uncontrolledValue;
|
|
18392
18381
|
var commonProps = _objectSpread2({
|
|
18393
18382
|
id: id,
|
|
@@ -18395,10 +18384,10 @@ var TextField = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
18395
18384
|
disabled: disabled,
|
|
18396
18385
|
placeholder: placeholder,
|
|
18397
18386
|
onFocus: function onFocus() {
|
|
18398
|
-
checkAndOpenAutocomplete(inputValue);
|
|
18399
18387
|
_onFocus === null || _onFocus === void 0 || _onFocus();
|
|
18388
|
+
setShowAutocompleteOptions(true);
|
|
18400
18389
|
},
|
|
18401
|
-
onBlur:
|
|
18390
|
+
onBlur: handleOnBlur,
|
|
18402
18391
|
onKeyDown: onKeyDown,
|
|
18403
18392
|
required: required,
|
|
18404
18393
|
'data-elem': 'input',
|
|
@@ -18430,12 +18419,13 @@ var TextField = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
|
18430
18419
|
}, (RightComponent !== null && RightComponent !== void 0 ? RightComponent : type === 'password' || feedback) && {
|
|
18431
18420
|
component3: getRightComponent()
|
|
18432
18421
|
}))]
|
|
18433
|
-
}),
|
|
18422
|
+
}), autocompleteOptions && jsx(Popover, {
|
|
18434
18423
|
anchorEl: anchorEl,
|
|
18435
|
-
open:
|
|
18436
|
-
|
|
18437
|
-
|
|
18438
|
-
|
|
18424
|
+
open: showAutocompleteOptions,
|
|
18425
|
+
placement: autocompleteOptions.placement,
|
|
18426
|
+
middlewareOptions: autocompleteOptions.middlewareOptions,
|
|
18427
|
+
withOverlay: false,
|
|
18428
|
+
lockScroll: false,
|
|
18439
18429
|
children: AutocompletePopover && jsx(AutocompletePopover, {
|
|
18440
18430
|
name: name,
|
|
18441
18431
|
value: value
|
|
@@ -21583,7 +21573,7 @@ var TableCell = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
21583
21573
|
var isCentered = (style === null || style === void 0 ? void 0 : style.justifyContent) === 'center';
|
|
21584
21574
|
return jsx(BaseCell, {
|
|
21585
21575
|
ref: ref,
|
|
21586
|
-
className: classes(modules_7ba8d001.root, modules_7ba8d001["".concat(type, "-cell")], modules_7ba8d001["sticky-".concat(String(sticky))], sort && modules_7ba8d001.sortable, isCentered && modules_7ba8d001.centered, className),
|
|
21576
|
+
className: classes(modules_7ba8d001.root, modules_7ba8d001["".concat(type, "-cell")], modules_7ba8d001["sticky-".concat(String(sticky))], type === 'header' && sort && modules_7ba8d001.sortable, isCentered && modules_7ba8d001.centered, className),
|
|
21587
21577
|
attrs: _objectSpread2({
|
|
21588
21578
|
style: style
|
|
21589
21579
|
}, attrs),
|
|
@@ -21662,9 +21652,14 @@ var TableRow = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
21662
21652
|
var cellContent = null;
|
|
21663
21653
|
if (type === 'header') {
|
|
21664
21654
|
cellContent = item.title;
|
|
21665
|
-
}
|
|
21666
|
-
|
|
21667
|
-
|
|
21655
|
+
}
|
|
21656
|
+
if (type === 'body') {
|
|
21657
|
+
if (item.formatter) {
|
|
21658
|
+
cellContent = item.formatter(datum[item.id], _index, datum);
|
|
21659
|
+
} else {
|
|
21660
|
+
var _datum$item$id;
|
|
21661
|
+
cellContent = (_datum$item$id = datum[item.id]) !== null && _datum$item$id !== void 0 ? _datum$item$id : item.fallbackValue;
|
|
21662
|
+
}
|
|
21668
21663
|
}
|
|
21669
21664
|
var cellProps = _objectSpread2(_objectSpread2({}, props), item);
|
|
21670
21665
|
var getCustomCell = customCells === null || customCells === void 0 ? void 0 : customCells[type];
|