@true-engineering/true-react-common-ui-kit 3.11.0 → 3.12.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/README.md +10 -0
- package/dist/components/Checkbox/Checkbox.d.ts +8 -7
- package/dist/components/Checkbox/Checkbox.stories.d.ts +8 -5
- package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +57 -126
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +57 -126
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +40 -14
- package/src/components/Checkbox/Checkbox.styles.ts +4 -2
- package/src/components/Checkbox/Checkbox.tsx +21 -25
- package/src/components/Icon/icons-list.ts +5 -13
- package/src/components/MultiSelectList/MultiSelectList.tsx +9 -6
|
@@ -4589,7 +4589,7 @@
|
|
|
4589
4589
|
]
|
|
4590
4590
|
}
|
|
4591
4591
|
];
|
|
4592
|
-
function _array_like_to_array$
|
|
4592
|
+
function _array_like_to_array$r(arr, len) {
|
|
4593
4593
|
if (len == null || len > arr.length)
|
|
4594
4594
|
len = arr.length;
|
|
4595
4595
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
@@ -4598,7 +4598,7 @@
|
|
|
4598
4598
|
}
|
|
4599
4599
|
function _array_without_holes$8(arr) {
|
|
4600
4600
|
if (Array.isArray(arr))
|
|
4601
|
-
return _array_like_to_array$
|
|
4601
|
+
return _array_like_to_array$r(arr);
|
|
4602
4602
|
}
|
|
4603
4603
|
function _iterable_to_array$8(iter) {
|
|
4604
4604
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
@@ -4608,20 +4608,20 @@
|
|
|
4608
4608
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4609
4609
|
}
|
|
4610
4610
|
function _to_consumable_array$8(arr) {
|
|
4611
|
-
return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$
|
|
4611
|
+
return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$r(arr) || _non_iterable_spread$8();
|
|
4612
4612
|
}
|
|
4613
|
-
function _unsupported_iterable_to_array$
|
|
4613
|
+
function _unsupported_iterable_to_array$r(o, minLen) {
|
|
4614
4614
|
if (!o)
|
|
4615
4615
|
return;
|
|
4616
4616
|
if (typeof o === "string")
|
|
4617
|
-
return _array_like_to_array$
|
|
4617
|
+
return _array_like_to_array$r(o, minLen);
|
|
4618
4618
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4619
4619
|
if (n === "Object" && o.constructor)
|
|
4620
4620
|
n = o.constructor.name;
|
|
4621
4621
|
if (n === "Map" || n === "Set")
|
|
4622
4622
|
return Array.from(n);
|
|
4623
4623
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
4624
|
-
return _array_like_to_array$
|
|
4624
|
+
return _array_like_to_array$r(o, minLen);
|
|
4625
4625
|
}
|
|
4626
4626
|
var findCountryByCode = function(countryCode) {
|
|
4627
4627
|
var countriesList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : phoneInfo;
|
|
@@ -4704,18 +4704,18 @@
|
|
|
4704
4704
|
}
|
|
4705
4705
|
return mask;
|
|
4706
4706
|
};
|
|
4707
|
-
function _array_like_to_array$
|
|
4707
|
+
function _array_like_to_array$q(arr, len) {
|
|
4708
4708
|
if (len == null || len > arr.length)
|
|
4709
4709
|
len = arr.length;
|
|
4710
4710
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
4711
4711
|
arr2[i] = arr[i];
|
|
4712
4712
|
return arr2;
|
|
4713
4713
|
}
|
|
4714
|
-
function _array_with_holes$
|
|
4714
|
+
function _array_with_holes$p(arr) {
|
|
4715
4715
|
if (Array.isArray(arr))
|
|
4716
4716
|
return arr;
|
|
4717
4717
|
}
|
|
4718
|
-
function _iterable_to_array_limit$
|
|
4718
|
+
function _iterable_to_array_limit$p(arr, i) {
|
|
4719
4719
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4720
4720
|
if (_i == null)
|
|
4721
4721
|
return;
|
|
@@ -4743,24 +4743,24 @@
|
|
|
4743
4743
|
}
|
|
4744
4744
|
return _arr;
|
|
4745
4745
|
}
|
|
4746
|
-
function _non_iterable_rest$
|
|
4746
|
+
function _non_iterable_rest$p() {
|
|
4747
4747
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4748
4748
|
}
|
|
4749
|
-
function _sliced_to_array$
|
|
4750
|
-
return _array_with_holes$
|
|
4749
|
+
function _sliced_to_array$p(arr, i) {
|
|
4750
|
+
return _array_with_holes$p(arr) || _iterable_to_array_limit$p(arr, i) || _unsupported_iterable_to_array$q(arr, i) || _non_iterable_rest$p();
|
|
4751
4751
|
}
|
|
4752
|
-
function _unsupported_iterable_to_array$
|
|
4752
|
+
function _unsupported_iterable_to_array$q(o, minLen) {
|
|
4753
4753
|
if (!o)
|
|
4754
4754
|
return;
|
|
4755
4755
|
if (typeof o === "string")
|
|
4756
|
-
return _array_like_to_array$
|
|
4756
|
+
return _array_like_to_array$q(o, minLen);
|
|
4757
4757
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4758
4758
|
if (n === "Object" && o.constructor)
|
|
4759
4759
|
n = o.constructor.name;
|
|
4760
4760
|
if (n === "Map" || n === "Set")
|
|
4761
4761
|
return Array.from(n);
|
|
4762
4762
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
4763
|
-
return _array_like_to_array$
|
|
4763
|
+
return _array_like_to_array$q(o, minLen);
|
|
4764
4764
|
}
|
|
4765
4765
|
var rgba = hexToRgba;
|
|
4766
4766
|
var transformToKebab = function(string) {
|
|
@@ -4883,7 +4883,7 @@
|
|
|
4883
4883
|
var addDataAttributes = function() {
|
|
4884
4884
|
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4885
4885
|
return Object.fromEntries(Object.entries(data).map(function(param) {
|
|
4886
|
-
var _param = _sliced_to_array$
|
|
4886
|
+
var _param = _sliced_to_array$p(param, 2), key = _param[0], value = _param[1];
|
|
4887
4887
|
return trueReactPlatformHelpers.isString(value) && trueReactPlatformHelpers.isStringNotEmpty(value) || trueReactPlatformHelpers.isNotEmpty(value) ? [
|
|
4888
4888
|
"data-".concat(transformToKebab(key)),
|
|
4889
4889
|
value
|
|
@@ -6409,7 +6409,7 @@
|
|
|
6409
6409
|
}, [enabled, referenceElement, popperElement]);
|
|
6410
6410
|
return popperState;
|
|
6411
6411
|
}
|
|
6412
|
-
function _array_like_to_array$
|
|
6412
|
+
function _array_like_to_array$p(arr, len) {
|
|
6413
6413
|
if (len == null || len > arr.length)
|
|
6414
6414
|
len = arr.length;
|
|
6415
6415
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
@@ -6418,7 +6418,7 @@
|
|
|
6418
6418
|
}
|
|
6419
6419
|
function _array_without_holes$7(arr) {
|
|
6420
6420
|
if (Array.isArray(arr))
|
|
6421
|
-
return _array_like_to_array$
|
|
6421
|
+
return _array_like_to_array$p(arr);
|
|
6422
6422
|
}
|
|
6423
6423
|
function _define_property$_(obj, key, value) {
|
|
6424
6424
|
if (key in obj) {
|
|
@@ -6456,20 +6456,20 @@
|
|
|
6456
6456
|
return target;
|
|
6457
6457
|
}
|
|
6458
6458
|
function _to_consumable_array$7(arr) {
|
|
6459
|
-
return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$
|
|
6459
|
+
return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$p(arr) || _non_iterable_spread$7();
|
|
6460
6460
|
}
|
|
6461
|
-
function _unsupported_iterable_to_array$
|
|
6461
|
+
function _unsupported_iterable_to_array$p(o, minLen) {
|
|
6462
6462
|
if (!o)
|
|
6463
6463
|
return;
|
|
6464
6464
|
if (typeof o === "string")
|
|
6465
|
-
return _array_like_to_array$
|
|
6465
|
+
return _array_like_to_array$p(o, minLen);
|
|
6466
6466
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
6467
6467
|
if (n === "Object" && o.constructor)
|
|
6468
6468
|
n = o.constructor.name;
|
|
6469
6469
|
if (n === "Map" || n === "Set")
|
|
6470
6470
|
return Array.from(n);
|
|
6471
6471
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
6472
|
-
return _array_like_to_array$
|
|
6472
|
+
return _array_like_to_array$p(o, minLen);
|
|
6473
6473
|
}
|
|
6474
6474
|
var useDropdown = function(param) {
|
|
6475
6475
|
var isOpen = param.isOpen, onDropdownClose = param.onDropdownClose, referenceElement = param.referenceElement, dropdownElement = param.dropdownElement, options = param.options, _param_dependenciesForPositionUpdating = param.dependenciesForPositionUpdating, dependenciesForPositionUpdating = _param_dependenciesForPositionUpdating === void 0 ? [] : _param_dependenciesForPositionUpdating;
|
|
@@ -6811,10 +6811,11 @@
|
|
|
6811
6811
|
check: {
|
|
6812
6812
|
paths: [
|
|
6813
6813
|
{
|
|
6814
|
-
d: "
|
|
6814
|
+
d: "m7.5 13.086 7.793-7.793a1 1 0 1 1 1.414 1.414l-8.5 8.5a1 1 0 0 1-1.414 0l-3.5-3.5a1 1 0 1 1 1.414-1.414L7.5 13.086Z"
|
|
6815
6815
|
}
|
|
6816
6816
|
]
|
|
6817
6817
|
},
|
|
6818
|
+
/** @deprecated */
|
|
6818
6819
|
"check-big": {
|
|
6819
6820
|
paths: [
|
|
6820
6821
|
{
|
|
@@ -6826,17 +6827,8 @@
|
|
|
6826
6827
|
viewBox: "0 0 20 20",
|
|
6827
6828
|
paths: [
|
|
6828
6829
|
{
|
|
6829
|
-
d: "
|
|
6830
|
-
|
|
6831
|
-
strokeLinecap: "round",
|
|
6832
|
-
stroke: "currentColor",
|
|
6833
|
-
fill: "none"
|
|
6834
|
-
},
|
|
6835
|
-
{
|
|
6836
|
-
d: "M10.2071 13.2929L9.5 12.5858L8.08579 14L8.79289 14.7071L10.2071 13.2929ZM18.2071 7.70711C18.5976 7.31658 18.5976 6.68342 18.2071 6.29289C17.8166 5.90237 17.1834 5.90237 16.7929 6.29289L18.2071 7.70711ZM9.92929 14.4293L10.6364 13.7222L9.92929 14.4293ZM10.0707 14.4293L9.3636 13.7222L10.0707 14.4293ZM8.79289 14.7071L9.22218 15.1364L10.6364 13.7222L10.2071 13.2929L8.79289 14.7071ZM10.7778 15.1364L18.2071 7.70711L16.7929 6.29289L9.3636 13.7222L10.7778 15.1364ZM9.22218 15.1364C9.65176 15.566 10.3482 15.566 10.7778 15.1364L9.3636 13.7222C9.71508 13.3707 10.2849 13.3707 10.6364 13.7222L9.22218 15.1364Z",
|
|
6837
|
-
fill: "currentColor",
|
|
6838
|
-
stroke: "none",
|
|
6839
|
-
fillRule: void 0
|
|
6830
|
+
d: "M14.207 6.707a1 1 0 0 0-1.414-1.414L6 12.086 3.707 9.793a1 1 0 0 0-1.414 1.414l2.93 2.93a1.1 1.1 0 0 0 1.555 0l7.43-7.43Zm4 1a1 1 0 0 0-1.414-1.414L10 13.086l-.5-.5L8.086 14l1.136 1.136a1.1 1.1 0 0 0 1.556 0l7.43-7.429Z",
|
|
6831
|
+
fillRule: "evenodd"
|
|
6840
6832
|
}
|
|
6841
6833
|
]
|
|
6842
6834
|
},
|
|
@@ -7154,7 +7146,7 @@
|
|
|
7154
7146
|
minus: {
|
|
7155
7147
|
paths: [
|
|
7156
7148
|
{
|
|
7157
|
-
d: "M16
|
|
7149
|
+
d: "M16 11H4a1 1 0 1 1 0-2h12a1 1 0 1 1 0 2Z"
|
|
7158
7150
|
}
|
|
7159
7151
|
]
|
|
7160
7152
|
},
|
|
@@ -8031,14 +8023,14 @@
|
|
|
8031
8023
|
height: 32
|
|
8032
8024
|
}
|
|
8033
8025
|
}, animations.slideUp));
|
|
8034
|
-
function _array_like_to_array$
|
|
8026
|
+
function _array_like_to_array$o(arr, len) {
|
|
8035
8027
|
if (len == null || len > arr.length)
|
|
8036
8028
|
len = arr.length;
|
|
8037
8029
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
8038
8030
|
arr2[i] = arr[i];
|
|
8039
8031
|
return arr2;
|
|
8040
8032
|
}
|
|
8041
|
-
function _array_with_holes$
|
|
8033
|
+
function _array_with_holes$o(arr) {
|
|
8042
8034
|
if (Array.isArray(arr))
|
|
8043
8035
|
return arr;
|
|
8044
8036
|
}
|
|
@@ -8055,7 +8047,7 @@
|
|
|
8055
8047
|
}
|
|
8056
8048
|
return obj;
|
|
8057
8049
|
}
|
|
8058
|
-
function _iterable_to_array_limit$
|
|
8050
|
+
function _iterable_to_array_limit$o(arr, i) {
|
|
8059
8051
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
8060
8052
|
if (_i == null)
|
|
8061
8053
|
return;
|
|
@@ -8083,7 +8075,7 @@
|
|
|
8083
8075
|
}
|
|
8084
8076
|
return _arr;
|
|
8085
8077
|
}
|
|
8086
|
-
function _non_iterable_rest$
|
|
8078
|
+
function _non_iterable_rest$o() {
|
|
8087
8079
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8088
8080
|
}
|
|
8089
8081
|
function _object_spread$S(target) {
|
|
@@ -8125,21 +8117,21 @@
|
|
|
8125
8117
|
}
|
|
8126
8118
|
return target;
|
|
8127
8119
|
}
|
|
8128
|
-
function _sliced_to_array$
|
|
8129
|
-
return _array_with_holes$
|
|
8120
|
+
function _sliced_to_array$o(arr, i) {
|
|
8121
|
+
return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$o(arr, i) || _non_iterable_rest$o();
|
|
8130
8122
|
}
|
|
8131
|
-
function _unsupported_iterable_to_array$
|
|
8123
|
+
function _unsupported_iterable_to_array$o(o, minLen) {
|
|
8132
8124
|
if (!o)
|
|
8133
8125
|
return;
|
|
8134
8126
|
if (typeof o === "string")
|
|
8135
|
-
return _array_like_to_array$
|
|
8127
|
+
return _array_like_to_array$o(o, minLen);
|
|
8136
8128
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
8137
8129
|
if (n === "Object" && o.constructor)
|
|
8138
8130
|
n = o.constructor.name;
|
|
8139
8131
|
if (n === "Map" || n === "Set")
|
|
8140
8132
|
return Array.from(n);
|
|
8141
8133
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
8142
|
-
return _array_like_to_array$
|
|
8134
|
+
return _array_like_to_array$o(o, minLen);
|
|
8143
8135
|
}
|
|
8144
8136
|
var AccountInfo = function(param) {
|
|
8145
8137
|
var data = param.data, testId = param.testId, avatar = param.avatar, tweakStyles = param.tweakStyles, accountName = param.accountName, options = param.options;
|
|
@@ -8153,7 +8145,7 @@
|
|
|
8153
8145
|
});
|
|
8154
8146
|
var nameRef = React.useRef(null);
|
|
8155
8147
|
var dropdownRef = React.useRef(null);
|
|
8156
|
-
var _useState = _sliced_to_array$
|
|
8148
|
+
var _useState = _sliced_to_array$o(React.useState(false), 2), isMenuOpen = _useState[0], setIsMenuOpen = _useState[1];
|
|
8157
8149
|
var toggleMenu = function(event) {
|
|
8158
8150
|
event.stopPropagation();
|
|
8159
8151
|
setIsMenuOpen(function(v) {
|
|
@@ -8819,6 +8811,8 @@
|
|
|
8819
8811
|
gap: 14,
|
|
8820
8812
|
width: "fit-content"
|
|
8821
8813
|
},
|
|
8814
|
+
checked: {},
|
|
8815
|
+
invalid: {},
|
|
8822
8816
|
disabled: {
|
|
8823
8817
|
cursor: "default",
|
|
8824
8818
|
pointerEvents: "none"
|
|
@@ -8843,22 +8837,10 @@
|
|
|
8843
8837
|
justifyContent: "center",
|
|
8844
8838
|
boxSizing: "border-box"
|
|
8845
8839
|
},
|
|
8846
|
-
checked: {},
|
|
8847
8840
|
labelPositionLeft: {
|
|
8848
8841
|
flexDirection: "row-reverse"
|
|
8849
8842
|
}
|
|
8850
8843
|
});
|
|
8851
|
-
function _array_like_to_array$o(arr, len) {
|
|
8852
|
-
if (len == null || len > arr.length)
|
|
8853
|
-
len = arr.length;
|
|
8854
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
8855
|
-
arr2[i] = arr[i];
|
|
8856
|
-
return arr2;
|
|
8857
|
-
}
|
|
8858
|
-
function _array_with_holes$o(arr) {
|
|
8859
|
-
if (Array.isArray(arr))
|
|
8860
|
-
return arr;
|
|
8861
|
-
}
|
|
8862
8844
|
function _define_property$P(obj, key, value) {
|
|
8863
8845
|
if (key in obj) {
|
|
8864
8846
|
Object.defineProperty(obj, key, {
|
|
@@ -8872,37 +8854,6 @@
|
|
|
8872
8854
|
}
|
|
8873
8855
|
return obj;
|
|
8874
8856
|
}
|
|
8875
|
-
function _iterable_to_array_limit$o(arr, i) {
|
|
8876
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
8877
|
-
if (_i == null)
|
|
8878
|
-
return;
|
|
8879
|
-
var _arr = [];
|
|
8880
|
-
var _n = true;
|
|
8881
|
-
var _d = false;
|
|
8882
|
-
var _s, _e;
|
|
8883
|
-
try {
|
|
8884
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
8885
|
-
_arr.push(_s.value);
|
|
8886
|
-
if (i && _arr.length === i)
|
|
8887
|
-
break;
|
|
8888
|
-
}
|
|
8889
|
-
} catch (err) {
|
|
8890
|
-
_d = true;
|
|
8891
|
-
_e = err;
|
|
8892
|
-
} finally {
|
|
8893
|
-
try {
|
|
8894
|
-
if (!_n && _i["return"] != null)
|
|
8895
|
-
_i["return"]();
|
|
8896
|
-
} finally {
|
|
8897
|
-
if (_d)
|
|
8898
|
-
throw _e;
|
|
8899
|
-
}
|
|
8900
|
-
}
|
|
8901
|
-
return _arr;
|
|
8902
|
-
}
|
|
8903
|
-
function _non_iterable_rest$o() {
|
|
8904
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8905
|
-
}
|
|
8906
8857
|
function _object_spread$O(target) {
|
|
8907
8858
|
for (var i = 1; i < arguments.length; i++) {
|
|
8908
8859
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -8942,50 +8893,27 @@
|
|
|
8942
8893
|
}
|
|
8943
8894
|
return target;
|
|
8944
8895
|
}
|
|
8945
|
-
function _sliced_to_array$o(arr, i) {
|
|
8946
|
-
return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$o(arr, i) || _non_iterable_rest$o();
|
|
8947
|
-
}
|
|
8948
|
-
function _unsupported_iterable_to_array$o(o, minLen) {
|
|
8949
|
-
if (!o)
|
|
8950
|
-
return;
|
|
8951
|
-
if (typeof o === "string")
|
|
8952
|
-
return _array_like_to_array$o(o, minLen);
|
|
8953
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
8954
|
-
if (n === "Object" && o.constructor)
|
|
8955
|
-
n = o.constructor.name;
|
|
8956
|
-
if (n === "Map" || n === "Set")
|
|
8957
|
-
return Array.from(n);
|
|
8958
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
8959
|
-
return _array_like_to_array$o(o, minLen);
|
|
8960
|
-
}
|
|
8961
8896
|
function Checkbox(param) {
|
|
8962
|
-
var children = param.children,
|
|
8897
|
+
var value = param.value, children = param.children, _param_isChecked = param.isChecked, isChecked = _param_isChecked === void 0 ? false : _param_isChecked, _param_isSemiChecked = param.isSemiChecked, isSemiChecked = _param_isSemiChecked === void 0 ? false : _param_isSemiChecked, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isReadonly = param.isReadonly, isReadonly = _param_isReadonly === void 0 ? false : _param_isReadonly, _param_labelPosition = param.labelPosition, labelPosition = _param_labelPosition === void 0 ? "right" : _param_labelPosition, data = param.data, testId = param.testId, tweakStyles = param.tweakStyles, onSelect = param.onSelect;
|
|
8963
8898
|
var classes = useStyles$K({
|
|
8964
8899
|
theme: tweakStyles
|
|
8965
8900
|
});
|
|
8966
|
-
var _useState = _sliced_to_array$o(React.useState(false), 2), isSelected = _useState[0], setIsSelected = _useState[1];
|
|
8967
8901
|
var hasAction = !isDisabled && !isReadonly;
|
|
8902
|
+
var isSelected = isChecked || isSemiChecked;
|
|
8968
8903
|
var onToggle = function(event) {
|
|
8969
|
-
|
|
8970
|
-
onSelect({
|
|
8904
|
+
return onSelect === null || onSelect === void 0 ? void 0 : onSelect({
|
|
8971
8905
|
value,
|
|
8972
|
-
isSelected:
|
|
8906
|
+
isSelected: !isSelected
|
|
8973
8907
|
}, event);
|
|
8974
|
-
setIsSelected(isSelectedNext);
|
|
8975
8908
|
};
|
|
8976
|
-
React.useEffect(function() {
|
|
8977
|
-
setIsSelected(isChecked);
|
|
8978
|
-
}, [
|
|
8979
|
-
isChecked
|
|
8980
|
-
]);
|
|
8981
8909
|
var _obj;
|
|
8982
8910
|
return /* @__PURE__ */ jsxs("label", _object_spread_props$G(_object_spread$O({
|
|
8983
|
-
className: clsx(classes.root, (_obj = {}, _define_property$P(_obj, classes.disabled, isDisabled), _define_property$P(_obj, classes.labelPositionLeft, labelPosition === "left"), _obj))
|
|
8911
|
+
className: clsx(classes.root, (_obj = {}, _define_property$P(_obj, classes.checked, isSelected), _define_property$P(_obj, classes.invalid, isInvalid), _define_property$P(_obj, classes.disabled, isDisabled), _define_property$P(_obj, classes.labelPositionLeft, labelPosition === "left"), _obj))
|
|
8984
8912
|
}, trueReactPlatformHelpers.addDataTestId(testId), addDataAttributes(data)), {
|
|
8985
8913
|
children: [
|
|
8986
8914
|
/* @__PURE__ */ jsx("input", _object_spread$O({
|
|
8987
|
-
type: "checkbox",
|
|
8988
8915
|
className: classes.input,
|
|
8916
|
+
type: "checkbox",
|
|
8989
8917
|
checked: isSelected,
|
|
8990
8918
|
disabled: isDisabled,
|
|
8991
8919
|
readOnly: isReadonly
|
|
@@ -8994,8 +8922,8 @@
|
|
|
8994
8922
|
onKeyDown: trueReactPlatformHelpers.getSelectKeyHandler(onToggle)
|
|
8995
8923
|
})),
|
|
8996
8924
|
/* @__PURE__ */ jsx("div", {
|
|
8997
|
-
className:
|
|
8998
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
8925
|
+
className: classes.check,
|
|
8926
|
+
children: isSelected && /* @__PURE__ */ jsx(Icon, {
|
|
8999
8927
|
type: isSemiChecked ? "minus" : "check"
|
|
9000
8928
|
})
|
|
9001
8929
|
}),
|
|
@@ -14158,13 +14086,16 @@
|
|
|
14158
14086
|
var handleClear = function() {
|
|
14159
14087
|
onChange(void 0);
|
|
14160
14088
|
};
|
|
14161
|
-
var onSelect = function(
|
|
14162
|
-
var
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14089
|
+
var onSelect = function(param2) {
|
|
14090
|
+
var checkboxValue = param2.value, isSelected = param2.isSelected;
|
|
14091
|
+
if (trueReactPlatformHelpers.isNotEmpty(checkboxValue)) {
|
|
14092
|
+
var _chosenValues_filter;
|
|
14093
|
+
handleSelectValue(isSelected ? _to_consumable_array$5(chosenValues !== null && chosenValues !== void 0 ? chosenValues : []).concat([
|
|
14094
|
+
checkboxValue
|
|
14095
|
+
]) : (_chosenValues_filter = chosenValues === null || chosenValues === void 0 ? void 0 : chosenValues.filter(function(v) {
|
|
14096
|
+
return getValueId(v) !== getValueId(checkboxValue);
|
|
14097
|
+
})) !== null && _chosenValues_filter !== void 0 ? _chosenValues_filter : []);
|
|
14098
|
+
}
|
|
14168
14099
|
};
|
|
14169
14100
|
var handleKeyDown = function(event) {
|
|
14170
14101
|
if (event.code === "Escape") {
|