@ballistix.digital/react-components 8.0.0 → 8.1.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 +40 -82
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +39 -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: [
|
|
@@ -5598,63 +5600,33 @@ var $dbcba7ef8eeead3b$export$8649d02bd537ff66 = function(dates) {
|
|
|
5598
5600
|
https://github.com/onesine/react-tailwindcss-datepicker
|
|
5599
5601
|
*/ var $0255f3e4133715cf$var$base = {
|
|
5600
5602
|
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
5603
|
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'
|
|
5604
|
+
input: 'w-full inline-flex'
|
|
5612
5605
|
};
|
|
5613
5606
|
var $0255f3e4133715cf$var$leading = {
|
|
5614
5607
|
input: 'pl-10'
|
|
5615
5608
|
};
|
|
5616
5609
|
var $0255f3e4133715cf$var$trailing = {};
|
|
5617
5610
|
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'
|
|
5611
|
+
input: 'rounded-md border-gray-200 shadow-xs focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300'
|
|
5624
5612
|
};
|
|
5625
5613
|
var $0255f3e4133715cf$var$inset = {
|
|
5626
5614
|
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'
|
|
5615
|
+
input: 'border-0 ring-0! p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0'
|
|
5631
5616
|
};
|
|
5632
5617
|
var $0255f3e4133715cf$var$overlapping = {
|
|
5633
5618
|
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'
|
|
5619
|
+
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
5620
|
};
|
|
5640
5621
|
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'
|
|
5622
|
+
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
5623
|
};
|
|
5647
5624
|
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'
|
|
5625
|
+
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
5626
|
};
|
|
5653
5627
|
var $0255f3e4133715cf$var$invalid = {
|
|
5654
5628
|
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'
|
|
5629
|
+
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
5630
|
};
|
|
5659
5631
|
var $0255f3e4133715cf$var$disabled = {
|
|
5660
5632
|
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 +5655,22 @@ var $0255f3e4133715cf$export$2e2bcd8739ae039 = $0255f3e4133715cf$var$styles;
|
|
|
5683
5655
|
|
|
5684
5656
|
|
|
5685
5657
|
|
|
5658
|
+
|
|
5659
|
+
|
|
5686
5660
|
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) {
|
|
5661
|
+
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
5662
|
return isEmpty ? (0, $iA2ta$reactjsxruntime.jsx)((0, $2125901b4a9afff9$export$2e2bcd8739ae039), {
|
|
5690
5663
|
accessor: "calendar"
|
|
5691
5664
|
}) : (0, $iA2ta$reactjsxruntime.jsx)((0, $2125901b4a9afff9$export$2e2bcd8739ae039), {
|
|
5692
5665
|
accessor: "xmark",
|
|
5693
5666
|
className: "text-black"
|
|
5694
5667
|
});
|
|
5695
|
-
} :
|
|
5668
|
+
} : _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
5669
|
var isValid = error === undefined;
|
|
5697
|
-
var
|
|
5670
|
+
var _o = (0, $iA2ta$react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : {
|
|
5698
5671
|
startDate: null,
|
|
5699
5672
|
endDate: null
|
|
5700
|
-
}), state =
|
|
5673
|
+
}), state = _o[0], setState = _o[1];
|
|
5701
5674
|
var $datepickerInputRef = (0, $iA2ta$react.useRef)(null);
|
|
5702
5675
|
var handleValueChange = (0, $iA2ta$react.useCallback)(function(newValue) {
|
|
5703
5676
|
setState(newValue);
|
|
@@ -5714,15 +5687,14 @@ var $7d3977a96c400c32$var$DateRangeMenu = function(props) {
|
|
|
5714
5687
|
]);
|
|
5715
5688
|
var handleGenerateStyle = function() {
|
|
5716
5689
|
var result = (0, $f0c671820c340322$export$e2d2075c69d9100d)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).base);
|
|
5717
|
-
var keys = (0, $27f90b0cff19565d$export$be5d6ab3c5b84767)((0, $0255f3e4133715cf$export$2e2bcd8739ae039).base);
|
|
5690
|
+
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
5691
|
keys.forEach(function(key) {
|
|
5719
5692
|
(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
5693
|
});
|
|
5721
5694
|
return result;
|
|
5722
5695
|
};
|
|
5723
5696
|
var styles = handleGenerateStyle();
|
|
5724
|
-
var inputDataCy = "form-
|
|
5725
|
-
var errorDataCy = "form-date-error-".concat(name);
|
|
5697
|
+
var inputDataCy = "form-input-".concat(name);
|
|
5726
5698
|
// listen to value changes.
|
|
5727
5699
|
(0, $iA2ta$react.useEffect)(function() {
|
|
5728
5700
|
setState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : {
|
|
@@ -5768,22 +5740,14 @@ var $7d3977a96c400c32$var$DateRangeMenu = function(props) {
|
|
|
5768
5740
|
return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
5769
5741
|
className: styles.container,
|
|
5770
5742
|
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
|
-
]
|
|
5743
|
+
(0, $iA2ta$reactjsxruntime.jsx)((0, $9314e0aa7f1e874e$export$2e2bcd8739ae039), {
|
|
5744
|
+
name: name,
|
|
5745
|
+
type: type,
|
|
5746
|
+
label: label,
|
|
5747
|
+
description: description,
|
|
5748
|
+
required: required,
|
|
5749
|
+
isRequired: isRequired,
|
|
5750
|
+
styles: styles
|
|
5787
5751
|
}),
|
|
5788
5752
|
(0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
5789
5753
|
className: styles.inputWrapper,
|
|
@@ -5814,19 +5778,13 @@ var $7d3977a96c400c32$var$DateRangeMenu = function(props) {
|
|
|
5814
5778
|
inputClassName: styles.input,
|
|
5815
5779
|
startWeekOn: startWeekOn
|
|
5816
5780
|
}),
|
|
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
|
-
]
|
|
5781
|
+
(0, $iA2ta$reactjsxruntime.jsx)((0, $dfbd7d015eae4218$export$2e2bcd8739ae039), {
|
|
5782
|
+
isHidden: isSolo,
|
|
5783
|
+
name: name,
|
|
5784
|
+
error: error,
|
|
5785
|
+
isTouched: isTouched,
|
|
5786
|
+
hint: hint,
|
|
5787
|
+
styles: styles
|
|
5830
5788
|
})
|
|
5831
5789
|
]
|
|
5832
5790
|
})
|
|
@@ -6261,7 +6219,7 @@ var $341e1fbf5ffaef7b$export$2e2bcd8739ae039 = $341e1fbf5ffaef7b$var$Switch;
|
|
|
6261
6219
|
var $8d406a8542925512$var$base = {
|
|
6262
6220
|
container: '',
|
|
6263
6221
|
head: 'flex justify-between',
|
|
6264
|
-
body: 'relative rounded-md
|
|
6222
|
+
body: 'relative rounded-md my-2 cursor-pointer',
|
|
6265
6223
|
foot: '',
|
|
6266
6224
|
label: 'block font-medium text-gray-900',
|
|
6267
6225
|
hint: 'text-xs text-gray-500',
|