@ballistix.digital/react-components 9.8.2-rc-388.0 → 9.8.3-rc-392.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/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +76 -81
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +76 -81
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4407,6 +4407,7 @@ var $4439474512e19952$export$2e2bcd8739ae039 = $4439474512e19952$var$PagePaginat
|
|
|
4407
4407
|
|
|
4408
4408
|
|
|
4409
4409
|
|
|
4410
|
+
|
|
4410
4411
|
const $9420756208be2d43$var$defaultStyles = {
|
|
4411
4412
|
container: '',
|
|
4412
4413
|
list: {
|
|
@@ -4418,9 +4419,11 @@ const $9420756208be2d43$var$defaultStyles = {
|
|
|
4418
4419
|
navigation: 'border-b border-gray-200 -mb-px flex space-x-8'
|
|
4419
4420
|
},
|
|
4420
4421
|
tab: {
|
|
4421
|
-
base: 'cursor-pointer',
|
|
4422
|
+
base: 'cursor-pointer flex items-center',
|
|
4422
4423
|
active: '',
|
|
4423
|
-
inactive: ''
|
|
4424
|
+
inactive: '',
|
|
4425
|
+
loading: 'opacity-50 text-gray-300! cursor-default!',
|
|
4426
|
+
disabled: 'opacity-80 text-gray-300! cursor-not-allowed!'
|
|
4424
4427
|
}
|
|
4425
4428
|
};
|
|
4426
4429
|
const $9420756208be2d43$var$underline = {
|
|
@@ -4453,18 +4456,20 @@ const $9420756208be2d43$var$styles = {
|
|
|
4453
4456
|
var $9420756208be2d43$export$2e2bcd8739ae039 = $9420756208be2d43$var$styles;
|
|
4454
4457
|
|
|
4455
4458
|
|
|
4456
|
-
const $06795e94e474e27d$var$
|
|
4457
|
-
const { children: children, styles: stylesOverrides } = props;
|
|
4458
|
-
const [active, setActive] = (0, $iA2ta$react.useState)('');
|
|
4459
|
-
const handleGenerateStyle = ()=>{
|
|
4459
|
+
const $06795e94e474e27d$var$useGeneratedStyles = (stylesOverrides, variant)=>(0, $iA2ta$react.useMemo)(()=>{
|
|
4460
4460
|
const result = (0, $f0c671820c340322$export$e2d2075c69d9100d)((0, $9420756208be2d43$export$2e2bcd8739ae039).base);
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
(0, $iA2ta$lodash.set)(result, key, (0, $622cd2936b18c771$export$4370d69198e9314a)((0, $iA2ta$lodash.get)((0, $9420756208be2d43$export$2e2bcd8739ae039).base, key), (0, $iA2ta$lodash.get)(stylesOverrides, key)));
|
|
4461
|
+
(0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $9420756208be2d43$export$2e2bcd8739ae039).base).forEach((key)=>{
|
|
4462
|
+
(0, $iA2ta$lodash.set)(result, key, (0, $622cd2936b18c771$export$4370d69198e9314a)((0, $iA2ta$lodash.get)((0, $9420756208be2d43$export$2e2bcd8739ae039).base, key), variant ? (0, $iA2ta$lodash.get)((0, $9420756208be2d43$export$2e2bcd8739ae039)[variant], key) : undefined, (0, $iA2ta$lodash.get)(stylesOverrides, key)));
|
|
4464
4463
|
});
|
|
4465
4464
|
return result;
|
|
4466
|
-
}
|
|
4467
|
-
|
|
4465
|
+
}, [
|
|
4466
|
+
stylesOverrides,
|
|
4467
|
+
variant
|
|
4468
|
+
]);
|
|
4469
|
+
const $06795e94e474e27d$var$Container = (props)=>{
|
|
4470
|
+
const { children: children, styles: stylesOverrides } = props;
|
|
4471
|
+
const [active, setActive] = (0, $iA2ta$react.useState)('');
|
|
4472
|
+
const styles = $06795e94e474e27d$var$useGeneratedStyles(stylesOverrides);
|
|
4468
4473
|
return (0, $iA2ta$reactjsxruntime.jsx)("div", {
|
|
4469
4474
|
className: styles.container,
|
|
4470
4475
|
children: children({
|
|
@@ -4475,45 +4480,40 @@ const $06795e94e474e27d$var$Container = (props)=>{
|
|
|
4475
4480
|
};
|
|
4476
4481
|
const $06795e94e474e27d$var$List = (props)=>{
|
|
4477
4482
|
const { name: name, children: children, active: active, setActive: setActive, styles: stylesOverrides } = props;
|
|
4478
|
-
const
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
if (tab?.props.isDisabled) return;
|
|
4491
|
-
if (tab?.props.href) window.location.href = tab.props.href;
|
|
4492
|
-
else if (tab?.props.onClick) setActive && setActive(tab?.props.accessor);
|
|
4483
|
+
const styles = $06795e94e474e27d$var$useGeneratedStyles(stylesOverrides);
|
|
4484
|
+
const tabs = (0, $iA2ta$react.useMemo)(()=>children, [
|
|
4485
|
+
children
|
|
4486
|
+
]);
|
|
4487
|
+
const handleChangeSelect = (0, $iA2ta$react.useCallback)((event)=>{
|
|
4488
|
+
const tab = (0, $iA2ta$lodash.find)(tabs, [
|
|
4489
|
+
'props.accessor',
|
|
4490
|
+
event.currentTarget.value
|
|
4491
|
+
]);
|
|
4492
|
+
if (!tab || tab.props.isDisabled) return;
|
|
4493
|
+
if (tab.props.href) window.location.href = tab.props.href;
|
|
4494
|
+
else if (tab.props.onClick) setActive?.(tab.props.accessor);
|
|
4493
4495
|
}, [
|
|
4494
|
-
|
|
4496
|
+
tabs,
|
|
4495
4497
|
setActive
|
|
4496
4498
|
]);
|
|
4497
4499
|
(0, $iA2ta$react.useEffect)(()=>{
|
|
4498
|
-
let tab;
|
|
4499
|
-
const tabs = (0, $iA2ta$react.Children).map(children, (child)=>child);
|
|
4500
4500
|
const initialTab = (0, $iA2ta$lodash.find)(tabs, [
|
|
4501
4501
|
'props.isInitial',
|
|
4502
4502
|
true
|
|
4503
|
-
]);
|
|
4504
|
-
if (
|
|
4505
|
-
else tab = tabs[0];
|
|
4506
|
-
setActive && setActive(tab?.props?.accessor);
|
|
4503
|
+
]) ?? tabs[0];
|
|
4504
|
+
if (setActive) setActive(initialTab?.props.accessor);
|
|
4507
4505
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4508
4506
|
}, []);
|
|
4509
|
-
const
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4507
|
+
const selectedAccessor = (0, $iA2ta$react.useMemo)(()=>{
|
|
4508
|
+
const current = (0, $iA2ta$lodash.find)(tabs, [
|
|
4509
|
+
'props.isCurrent',
|
|
4510
|
+
true
|
|
4511
|
+
]);
|
|
4512
|
+
return current?.props.href ? current.props.accessor : active;
|
|
4513
|
+
}, [
|
|
4514
|
+
tabs,
|
|
4515
|
+
active
|
|
4516
|
+
]);
|
|
4517
4517
|
return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
4518
4518
|
className: styles.list.container,
|
|
4519
4519
|
children: [
|
|
@@ -4528,17 +4528,14 @@ const $06795e94e474e27d$var$List = (props)=>{
|
|
|
4528
4528
|
(0, $iA2ta$reactjsxruntime.jsx)("select", {
|
|
4529
4529
|
id: name,
|
|
4530
4530
|
name: name,
|
|
4531
|
-
value:
|
|
4531
|
+
value: selectedAccessor,
|
|
4532
4532
|
className: styles.list.select,
|
|
4533
4533
|
onChange: handleChangeSelect,
|
|
4534
|
-
children: (0, $iA2ta$
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
children: child.props.label
|
|
4540
|
-
}, child?.props?.accessor);
|
|
4541
|
-
})
|
|
4534
|
+
children: (0, $iA2ta$lodash.map)((0, $iA2ta$lodash.filter)(tabs, (tab)=>!tab.props.isHidden), (tab)=>(0, $iA2ta$reactjsxruntime.jsx)("option", {
|
|
4535
|
+
value: tab.props.accessor,
|
|
4536
|
+
disabled: tab.props.isDisabled,
|
|
4537
|
+
children: tab.props.label
|
|
4538
|
+
}, tab.props.accessor))
|
|
4542
4539
|
})
|
|
4543
4540
|
]
|
|
4544
4541
|
}),
|
|
@@ -4553,47 +4550,45 @@ const $06795e94e474e27d$var$List = (props)=>{
|
|
|
4553
4550
|
});
|
|
4554
4551
|
};
|
|
4555
4552
|
const $06795e94e474e27d$var$Item = (props)=>{
|
|
4556
|
-
const { label: label, icon: icon, as: LinkComponent = 'a', type: type = 'underline', href: href, isCurrent: isCurrent, onClick: onClick, styles: stylesOverrides, isLoading: isLoading, isHidden: isHidden, isDisabled: isDisabled = false } = props;
|
|
4557
|
-
|
|
4558
|
-
const
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
(0, $iA2ta$lodash.set)(result, key, (0, $622cd2936b18c771$export$4370d69198e9314a)((0, $iA2ta$lodash.get)((0, $9420756208be2d43$export$2e2bcd8739ae039).base, key), type && (0, $iA2ta$lodash.get)((0, $9420756208be2d43$export$2e2bcd8739ae039)[type], key), (0, $iA2ta$lodash.get)(stylesOverrides, key)));
|
|
4563
|
-
});
|
|
4564
|
-
return result;
|
|
4565
|
-
};
|
|
4566
|
-
const styles = handleGenerateStyle();
|
|
4567
|
-
const handleClickLink = (e)=>{
|
|
4568
|
-
if (isDisabled || isLoading) {
|
|
4569
|
-
e.preventDefault();
|
|
4553
|
+
const { label: label, icon: icon, as: LinkComponent = 'a', type: type = 'underline', href: href, isCurrent: isCurrent, onClick: onClick, styles: stylesOverrides, isLoading: isLoading, isHidden: isHidden, isDisabled: isDisabled = false, tooltipConfig: { content: tooltipContent, placement: tooltipPlacement } = {} } = props;
|
|
4554
|
+
const styles = $06795e94e474e27d$var$useGeneratedStyles(stylesOverrides, type);
|
|
4555
|
+
const isInteractive = !isDisabled && !isLoading;
|
|
4556
|
+
const handleClick = (0, $iA2ta$react.useCallback)((event)=>{
|
|
4557
|
+
if (!isInteractive) {
|
|
4558
|
+
if (href) event.preventDefault();
|
|
4570
4559
|
return;
|
|
4571
4560
|
}
|
|
4572
|
-
|
|
4573
|
-
}
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
onClick
|
|
4577
|
-
|
|
4578
|
-
if (
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
className: (0, $622cd2936b18c771$export$4370d69198e9314a)(styles.tab.base, isCurrent ? styles.tab.active : styles.tab.inactive, isLoading && 'opacity-30 text-gray-300! cursor-default!', isLoading && styles.tab.inactive, isDisabled && 'opacity-30 text-gray-300! cursor-not-allowed! pointer-events-none', isDisabled && styles.tab.inactive),
|
|
4582
|
-
onClick: handleClickLink,
|
|
4561
|
+
onClick?.(event);
|
|
4562
|
+
}, [
|
|
4563
|
+
isInteractive,
|
|
4564
|
+
href,
|
|
4565
|
+
onClick
|
|
4566
|
+
]);
|
|
4567
|
+
if (isHidden) return null;
|
|
4568
|
+
const className = (0, $622cd2936b18c771$export$4370d69198e9314a)(styles.tab.base, isCurrent ? styles.tab.active : styles.tab.inactive, isLoading && styles.tab.loading, isLoading && styles.tab.inactive, isDisabled && styles.tab.disabled, isDisabled && styles.tab.inactive);
|
|
4569
|
+
const content = (0, $iA2ta$reactjsxruntime.jsxs)((0, $iA2ta$reactjsxruntime.Fragment), {
|
|
4583
4570
|
children: [
|
|
4584
4571
|
icon,
|
|
4585
4572
|
label
|
|
4586
4573
|
]
|
|
4587
4574
|
});
|
|
4588
|
-
|
|
4589
|
-
|
|
4575
|
+
const tab = href && LinkComponent ? (0, $iA2ta$reactjsxruntime.jsx)(LinkComponent, {
|
|
4576
|
+
href: href,
|
|
4590
4577
|
"aria-disabled": isDisabled,
|
|
4578
|
+
className: className,
|
|
4591
4579
|
onClick: handleClick,
|
|
4592
|
-
children:
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4580
|
+
children: content
|
|
4581
|
+
}) : (0, $iA2ta$reactjsxruntime.jsx)("div", {
|
|
4582
|
+
"aria-disabled": isDisabled,
|
|
4583
|
+
className: className,
|
|
4584
|
+
onClick: handleClick,
|
|
4585
|
+
children: content
|
|
4596
4586
|
});
|
|
4587
|
+
return tooltipContent ? (0, $iA2ta$reactjsxruntime.jsx)((0, $861db172649fba92$export$2e2bcd8739ae039), {
|
|
4588
|
+
content: tooltipContent,
|
|
4589
|
+
placement: tooltipPlacement,
|
|
4590
|
+
children: tab
|
|
4591
|
+
}) : tab;
|
|
4597
4592
|
};
|
|
4598
4593
|
const $06795e94e474e27d$var$View = (props)=>{
|
|
4599
4594
|
const { children: children } = props;
|