@ballistix.digital/react-components 8.0.0 → 8.0.1-rc-78.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 +4 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +43 -82
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +42 -81
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1435,7 +1435,7 @@ var $3369f7d596d23d58$export$2e2bcd8739ae039 = $3369f7d596d23d58$var$styles;
|
|
|
1435
1435
|
|
|
1436
1436
|
|
|
1437
1437
|
var $dfbd7d015eae4218$var$InputFooter = function(props) {
|
|
1438
|
-
var name = props.name, hint = props.hint, error = props.error, isTouched = props.isTouched, stylesOverrides = props.styles,
|
|
1438
|
+
var name = props.name, hint = props.hint, error = props.error, isTouched = props.isTouched, _a = props.isHidden, isHidden = _a === void 0 ? false : _a, stylesOverrides = props.styles, _b = props.type, type = _b === void 0 ? 'normal' : _b;
|
|
1439
1439
|
var errorDataCy = "form-input-error-".concat(name);
|
|
1440
1440
|
var handleGenerateStyle = function() {
|
|
1441
1441
|
var result = (0, $f0c671820c340322$export$e2d2075c69d9100d)((0, $3369f7d596d23d58$export$2e2bcd8739ae039).base);
|
|
@@ -1459,7 +1459,7 @@ var $dfbd7d015eae4218$var$InputFooter = function(props) {
|
|
|
1459
1459
|
isTouched
|
|
1460
1460
|
]);
|
|
1461
1461
|
var errorElement = (0, $iA2ta$react.useMemo)(function() {
|
|
1462
|
-
if (!error) return null;
|
|
1462
|
+
if (!error || !isTouched) return null;
|
|
1463
1463
|
return (0, $iA2ta$reactjsxruntime.jsx)("p", {
|
|
1464
1464
|
className: styles.error,
|
|
1465
1465
|
"data-cy": errorDataCy,
|
|
@@ -1468,8 +1468,10 @@ var $dfbd7d015eae4218$var$InputFooter = function(props) {
|
|
|
1468
1468
|
}, [
|
|
1469
1469
|
error,
|
|
1470
1470
|
styles.error,
|
|
1471
|
-
errorDataCy
|
|
1471
|
+
errorDataCy,
|
|
1472
|
+
isTouched
|
|
1472
1473
|
]);
|
|
1474
|
+
if (isHidden && (0, $iA2ta$lodash.isNil)(errorElement) && (0, $iA2ta$lodash.isNil)(hintElement)) return null;
|
|
1473
1475
|
return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
1474
1476
|
className: styles.foot,
|
|
1475
1477
|
children: [
|
|
@@ -1497,7 +1499,7 @@ var $65bb4d593718fcda$var$base = {
|
|
|
1497
1499
|
label: '',
|
|
1498
1500
|
required: '',
|
|
1499
1501
|
optional: 'ml-auto text-xs text-gray-500',
|
|
1500
|
-
description: 'text-xs'
|
|
1502
|
+
description: 'text-xs font-light'
|
|
1501
1503
|
}
|
|
1502
1504
|
};
|
|
1503
1505
|
var $65bb4d593718fcda$var$normal = {
|
|
@@ -1573,7 +1575,7 @@ var $9314e0aa7f1e874e$var$InputHeader = function(props) {
|
|
|
1573
1575
|
styles.header.optional
|
|
1574
1576
|
]);
|
|
1575
1577
|
var labelElement = (0, $iA2ta$react.useMemo)(function() {
|
|
1576
|
-
if (!label && (0, $iA2ta$lodash.
|
|
1578
|
+
if (!label && (0, $iA2ta$lodash.isNil)(requiredLabel)) return null;
|
|
1577
1579
|
return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
1578
1580
|
className: styles.header.labelWrapper,
|
|
1579
1581
|
children: [
|
|
@@ -1602,7 +1604,7 @@ var $9314e0aa7f1e874e$var$InputHeader = function(props) {
|
|
|
1602
1604
|
description,
|
|
1603
1605
|
styles.header.description
|
|
1604
1606
|
]);
|
|
1605
|
-
if ((0, $iA2ta$lodash.
|
|
1607
|
+
if ((0, $iA2ta$lodash.isNil)(labelElement) && (0, $iA2ta$lodash.isNil)(descriptionElement)) return null;
|
|
1606
1608
|
return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
1607
1609
|
className: styles.header.container,
|
|
1608
1610
|
children: [
|
|
@@ -3966,10 +3968,13 @@ var $51d5596368acf759$var$TableList2 = function(props) {
|
|
|
3966
3968
|
onClick: function() {
|
|
3967
3969
|
return onRowClick && onRowClick(row);
|
|
3968
3970
|
},
|
|
3971
|
+
"data-row-id": row.id,
|
|
3969
3972
|
className: (0, $622cd2936b18c771$export$4370d69198e9314a)(styles.body.table.body.row, ((_a = config.options) === null || _a === void 0 ? void 0 : _a.isStriped) && index % 2 === 0 && styles.body.table.body.striped),
|
|
3970
3973
|
children: (0, $iA2ta$lodash.map)(row.getVisibleCells(), function(cell) {
|
|
3971
3974
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3972
3975
|
return (0, $iA2ta$reactjsxruntime.jsx)("td", {
|
|
3976
|
+
"data-column-id": cell.column.id,
|
|
3977
|
+
"data-row-id": row.id,
|
|
3973
3978
|
className: (0, $622cd2936b18c771$export$4370d69198e9314a)(styles.body.table.body.cell, ((_a = config === null || config === void 0 ? void 0 : config.options) === null || _a === void 0 ? void 0 : _a.hasStickyHeader) && index !== ((_c = (_b = table === null || table === void 0 ? void 0 : table.getState()) === null || _b === void 0 ? void 0 : _b.pagination) === null || _c === void 0 ? void 0 : _c.pageSize) - 1 && styles.body.table.body.sticky, cell.column.getIsPinned() && styles.body.table.body.column.pinned.cell),
|
|
3974
3979
|
style: $51d5596368acf759$var$__assign({
|
|
3975
3980
|
width: cell.column.getSize()
|
|
@@ -5598,63 +5603,33 @@ var $dbcba7ef8eeead3b$export$8649d02bd537ff66 = function(dates) {
|
|
|
5598
5603
|
https://github.com/onesine/react-tailwindcss-datepicker
|
|
5599
5604
|
*/ var $0255f3e4133715cf$var$base = {
|
|
5600
5605
|
container: '',
|
|
5601
|
-
head: 'flex justify-between',
|
|
5602
|
-
body: 'relative rounded-md',
|
|
5603
|
-
foot: '',
|
|
5604
|
-
label: 'block font-medium text-gray-900',
|
|
5605
|
-
hint: 'text-xs text-gray-500',
|
|
5606
|
-
leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
|
|
5607
5606
|
inputWrapper: '',
|
|
5608
|
-
input: 'w-full inline-flex'
|
|
5609
|
-
trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
|
|
5610
|
-
description: 'text-gray-400 text-xs mt-1',
|
|
5611
|
-
error: 'text-red-500 text-xs ml-5 mt-1'
|
|
5607
|
+
input: 'w-full inline-flex'
|
|
5612
5608
|
};
|
|
5613
5609
|
var $0255f3e4133715cf$var$leading = {
|
|
5614
5610
|
input: 'pl-10'
|
|
5615
5611
|
};
|
|
5616
5612
|
var $0255f3e4133715cf$var$trailing = {};
|
|
5617
5613
|
var $0255f3e4133715cf$var$normal = {
|
|
5618
|
-
|
|
5619
|
-
hint: 'leading-6',
|
|
5620
|
-
leading: 'pl-3',
|
|
5621
|
-
input: 'rounded-md border-gray-200 shadow-xs focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
|
|
5622
|
-
trailing: 'pr-3',
|
|
5623
|
-
description: 'mt-2 text-sm'
|
|
5614
|
+
input: 'rounded-md border-gray-200 shadow-xs focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300'
|
|
5624
5615
|
};
|
|
5625
5616
|
var $0255f3e4133715cf$var$inset = {
|
|
5626
5617
|
container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-xs ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
|
|
5627
|
-
|
|
5628
|
-
hint: 'text-xs',
|
|
5629
|
-
input: 'border-0 ring-0! p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
5630
|
-
description: 'hidden'
|
|
5618
|
+
input: 'border-0 ring-0! p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0'
|
|
5631
5619
|
};
|
|
5632
5620
|
var $0255f3e4133715cf$var$overlapping = {
|
|
5633
5621
|
container: 'relative',
|
|
5634
|
-
|
|
5635
|
-
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
5636
|
-
hint: 'text-xs mr-4 bg-white px-1',
|
|
5637
|
-
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
5638
|
-
description: 'hidden'
|
|
5622
|
+
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6'
|
|
5639
5623
|
};
|
|
5640
5624
|
var $0255f3e4133715cf$var$pill = {
|
|
5641
|
-
|
|
5642
|
-
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
5643
|
-
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
5644
|
-
trailing: 'pr-2',
|
|
5645
|
-
description: 'text-xs'
|
|
5625
|
+
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6'
|
|
5646
5626
|
};
|
|
5647
5627
|
var $0255f3e4133715cf$var$floored = {
|
|
5648
|
-
|
|
5649
|
-
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
5650
|
-
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
|
|
5651
|
-
description: 'text-xs mt-2'
|
|
5628
|
+
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0'
|
|
5652
5629
|
};
|
|
5653
5630
|
var $0255f3e4133715cf$var$invalid = {
|
|
5654
5631
|
container: 'ring-red-500!',
|
|
5655
|
-
input:
|
|
5656
|
-
'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 pr-10',
|
|
5657
|
-
description: 'text-sm text-red-600'
|
|
5632
|
+
input: 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 pr-10'
|
|
5658
5633
|
};
|
|
5659
5634
|
var $0255f3e4133715cf$var$disabled = {
|
|
5660
5635
|
input: 'block w-full rounded-md border-0 text-gray-900 shadow-xs ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200'
|
|
@@ -5683,21 +5658,22 @@ var $0255f3e4133715cf$export$2e2bcd8739ae039 = $0255f3e4133715cf$var$styles;
|
|
|
5683
5658
|
|
|
5684
5659
|
|
|
5685
5660
|
|
|
5661
|
+
|
|
5662
|
+
|
|
5686
5663
|
var $7d3977a96c400c32$var$DateRangeMenu = function(props) {
|
|
5687
|
-
var _a
|
|
5688
|
-
var _b = props.name, name = _b === void 0 ? 'date-menu-form' : _b, _c = props.size, size = _c === void 0 ? 'compact' : _c, label = props.label, _d = props.i18n, i18n = _d === void 0 ? 'en' : _d, description = props.description, placeholder = props.placeholder, separator = props.separator, startFrom = props.startFrom, _e = props.displayFormat, displayFormat = _e === void 0 ? 'DD.MM.YYYY' : _e, _f = props.direction, direction = _f === void 0 ? 'down' : _f, minDate = props.minDate, maxDate = props.maxDate, _g = props.startWeekOn, startWeekOn = _g === void 0 ? 'mon' : _g, _h = props.icon, icon = _h === void 0 ? function(isEmpty) {
|
|
5664
|
+
var _a = props.name, name = _a === void 0 ? 'date-menu-form' : _a, _b = props.size, size = _b === void 0 ? 'compact' : _b, label = props.label, _c = props.i18n, i18n = _c === void 0 ? 'en' : _c, description = props.description, hint = props.hint, placeholder = props.placeholder, separator = props.separator, startFrom = props.startFrom, _d = props.displayFormat, displayFormat = _d === void 0 ? 'DD.MM.YYYY' : _d, _e = props.direction, direction = _e === void 0 ? 'down' : _e, minDate = props.minDate, maxDate = props.maxDate, _f = props.startWeekOn, startWeekOn = _f === void 0 ? 'mon' : _f, _g = props.icon, icon = _g === void 0 ? function(isEmpty) {
|
|
5689
5665
|
return isEmpty ? (0, $iA2ta$reactjsxruntime.jsx)((0, $2125901b4a9afff9$export$2e2bcd8739ae039), {
|
|
5690
5666
|
accessor: "calendar"
|
|
5691
5667
|
}) : (0, $iA2ta$reactjsxruntime.jsx)((0, $2125901b4a9afff9$export$2e2bcd8739ae039), {
|
|
5692
5668
|
accessor: "xmark",
|
|
5693
5669
|
className: "text-black"
|
|
5694
5670
|
});
|
|
5695
|
-
} :
|
|
5671
|
+
} : _g, required = props.required, defaultValue = props.value, error = props.error, _h = props.type, type = _h === void 0 ? 'normal' : _h, _j = props.isRequired, isRequired = _j === void 0 ? false : _j, _k = props.isTouched, isTouched = _k === void 0 ? false : _k, isDisabled = props.isDisabled, _l = props.isSolo, isSolo = _l === void 0 ? false : _l, _m = props.isRanged, isRanged = _m === void 0 ? true : _m, onChange = props.onChange, onClear = props.onClear, onBlur = props.onBlur, onClick = props.onClick, stylesOverrides = props.styles;
|
|
5696
5672
|
var isValid = error === undefined;
|
|
5697
|
-
var
|
|
5673
|
+
var _o = (0, $iA2ta$react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : {
|
|
5698
5674
|
startDate: null,
|
|
5699
5675
|
endDate: null
|
|
5700
|
-
}), state =
|
|
5676
|
+
}), state = _o[0], setState = _o[1];
|
|
5701
5677
|
var $datepickerInputRef = (0, $iA2ta$react.useRef)(null);
|
|
5702
5678
|
var handleValueChange = (0, $iA2ta$react.useCallback)(function(newValue) {
|
|
5703
5679
|
setState(newValue);
|
|
@@ -5714,15 +5690,14 @@ var $7d3977a96c400c32$var$DateRangeMenu = function(props) {
|
|
|
5714
5690
|
]);
|
|
5715
5691
|
var handleGenerateStyle = function() {
|
|
5716
5692
|
var result = (0, $f0c671820c340322$export$e2d2075c69d9100d)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).base);
|
|
5717
|
-
var keys = (0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).base);
|
|
5693
|
+
var keys = (0, $iA2ta$lodash.concat)((0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).base), (0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $3369f7d596d23d58$export$2e2bcd8739ae039).base), (0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $65bb4d593718fcda$export$2e2bcd8739ae039).base));
|
|
5718
5694
|
keys.forEach(function(key) {
|
|
5719
5695
|
(0, $iA2ta$lodash.set)(result, key, (0, $622cd2936b18c771$export$4370d69198e9314a)((0, $iA2ta$lodash.get)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).base, key), type && (0, $iA2ta$lodash.get)((0, $0255f3e4133715cf$export$2e2bcd8739ae039)[type], key), isTouched === true && !isValid && (0, $iA2ta$lodash.get)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).invalid, key), isDisabled && (0, $iA2ta$lodash.get)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).disabled, key), (0, $iA2ta$lodash.get)(stylesOverrides, key)));
|
|
5720
5696
|
});
|
|
5721
5697
|
return result;
|
|
5722
5698
|
};
|
|
5723
5699
|
var styles = handleGenerateStyle();
|
|
5724
|
-
var inputDataCy = "form-
|
|
5725
|
-
var errorDataCy = "form-date-error-".concat(name);
|
|
5700
|
+
var inputDataCy = "form-input-".concat(name);
|
|
5726
5701
|
// listen to value changes.
|
|
5727
5702
|
(0, $iA2ta$react.useEffect)(function() {
|
|
5728
5703
|
setState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : {
|
|
@@ -5768,22 +5743,14 @@ var $7d3977a96c400c32$var$DateRangeMenu = function(props) {
|
|
|
5768
5743
|
return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
5769
5744
|
className: styles.container,
|
|
5770
5745
|
children: [
|
|
5771
|
-
(0, $iA2ta$reactjsxruntime.
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
!required && !isRequired && typeof label === 'string' && (0, $iA2ta$reactjsxruntime.jsx)("span", {
|
|
5780
|
-
className: styles.hint,
|
|
5781
|
-
children: "Optional"
|
|
5782
|
-
}),
|
|
5783
|
-
required && required({
|
|
5784
|
-
isRequired: isRequired
|
|
5785
|
-
})
|
|
5786
|
-
]
|
|
5746
|
+
(0, $iA2ta$reactjsxruntime.jsx)((0, $9314e0aa7f1e874e$export$2e2bcd8739ae039), {
|
|
5747
|
+
name: name,
|
|
5748
|
+
type: type,
|
|
5749
|
+
label: label,
|
|
5750
|
+
description: description,
|
|
5751
|
+
required: required,
|
|
5752
|
+
isRequired: isRequired,
|
|
5753
|
+
styles: styles
|
|
5787
5754
|
}),
|
|
5788
5755
|
(0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
5789
5756
|
className: styles.inputWrapper,
|
|
@@ -5814,19 +5781,13 @@ var $7d3977a96c400c32$var$DateRangeMenu = function(props) {
|
|
|
5814
5781
|
inputClassName: styles.input,
|
|
5815
5782
|
startWeekOn: startWeekOn
|
|
5816
5783
|
}),
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
error && isTouched && (0, $iA2ta$reactjsxruntime.jsx)("p", {
|
|
5825
|
-
className: styles.error,
|
|
5826
|
-
"data-cy": errorDataCy,
|
|
5827
|
-
children: typeof error === 'string' ? error : (_a = error === null || error === void 0 ? void 0 : error.startDate) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.endDate
|
|
5828
|
-
})
|
|
5829
|
-
]
|
|
5784
|
+
(0, $iA2ta$reactjsxruntime.jsx)((0, $dfbd7d015eae4218$export$2e2bcd8739ae039), {
|
|
5785
|
+
isHidden: isSolo,
|
|
5786
|
+
name: name,
|
|
5787
|
+
error: error,
|
|
5788
|
+
isTouched: isTouched,
|
|
5789
|
+
hint: hint,
|
|
5790
|
+
styles: styles
|
|
5830
5791
|
})
|
|
5831
5792
|
]
|
|
5832
5793
|
})
|
|
@@ -6261,7 +6222,7 @@ var $341e1fbf5ffaef7b$export$2e2bcd8739ae039 = $341e1fbf5ffaef7b$var$Switch;
|
|
|
6261
6222
|
var $8d406a8542925512$var$base = {
|
|
6262
6223
|
container: '',
|
|
6263
6224
|
head: 'flex justify-between',
|
|
6264
|
-
body: 'relative rounded-md
|
|
6225
|
+
body: 'relative rounded-md my-2 cursor-pointer',
|
|
6265
6226
|
foot: '',
|
|
6266
6227
|
label: 'block font-medium text-gray-900',
|
|
6267
6228
|
hint: 'text-xs text-gray-500',
|