tp-react-elements-dev 0.0.0 → 0.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.js CHANGED
@@ -40745,7 +40745,8 @@ function MultiSelectV1({ props }) {
40745
40745
  return array.some((item) => item === value);
40746
40746
  }
40747
40747
  React$1.useEffect(() => {
40748
- if ((fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.split(",").length) !== filterOptions.length) {
40748
+ var _a;
40749
+ if (((_a = fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.split(",")) === null || _a === void 0 ? void 0 : _a.length) !== (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.length)) {
40749
40750
  setSelectAll(false);
40750
40751
  }
40751
40752
  else {
@@ -40776,8 +40777,8 @@ function MultiSelectV1({ props }) {
40776
40777
  var _a, _b;
40777
40778
  return (jsxRuntimeExports.jsx(Tooltip, Object.assign({ title: ((_a = extractValuesToArray(fieldValue)) === null || _a === void 0 ? void 0 : _a.length) >
40778
40779
  3 &&
40779
- ((_b = extractValuesToArray(fieldValue)) === null || _b === void 0 ? void 0 : _b.join(", ")) }, { children: selected.length > 3
40780
- ? selected.length + ` Selected`
40780
+ ((_b = extractValuesToArray(fieldValue)) === null || _b === void 0 ? void 0 : _b.join(", ")) }, { children: (selected === null || selected === void 0 ? void 0 : selected.length) > 3
40781
+ ? (selected === null || selected === void 0 ? void 0 : selected.length) + ` Selected`
40781
40782
  : selected === null || selected === void 0 ? void 0 : selected.join(", ") })));
40782
40783
  }, MenuProps: MenuProps, autoFocus: false }, { children: [jsxRuntimeExports.jsx(Box, Object.assign({ sx: {
40783
40784
  width: "100%",
@@ -40787,7 +40788,7 @@ function MultiSelectV1({ props }) {
40787
40788
  zIndex: 2,
40788
40789
  height: "33px",
40789
40790
  background: "#fff",
40790
- display: options.length === 0 ? "none" : undefined,
40791
+ display: (options === null || options === void 0 ? void 0 : options.length) === 0 ? "none" : undefined,
40791
40792
  } }, { children: jsxRuntimeExports.jsx(TextField, { inputRef: textfieldRef, autoFocus: true, value: searchText, sx: {
40792
40793
  width: "100%",
40793
40794
  }, placeholder: "Search...", onChange: (e) => {
@@ -40796,13 +40797,13 @@ function MultiSelectV1({ props }) {
40796
40797
  if (e.key !== "Escape") {
40797
40798
  e.stopPropagation();
40798
40799
  }
40799
- } }) })), jsxRuntimeExports.jsxs(MenuItem, Object.assign({ disabled: filterOptions.length === 0, onChange: (e) => setSelectAll(!selectAll), sx: { zIndex: 0, fontSize: "5px !important", display: options.length === 0 ? 'none' : '' } }, { children: [jsxRuntimeExports.jsx(Checkbox, { checked: selectAll, onChange: (e) => {
40800
+ } }) })), jsxRuntimeExports.jsxs(MenuItem, Object.assign({ disabled: (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.length) === 0, onChange: (e) => setSelectAll(!selectAll), sx: { zIndex: 0, fontSize: "5px !important", display: (options === null || options === void 0 ? void 0 : options.length) === 0 ? 'none' : '' } }, { children: [jsxRuntimeExports.jsx(Checkbox, { checked: selectAll, onChange: (e) => {
40800
40801
  setSelectAll(!selectAll);
40801
40802
  const selectChanged = !selectAll;
40802
40803
  if (!selectChanged) {
40803
40804
  props.setValue(props.item.name, "");
40804
40805
  }
40805
- } }), jsxRuntimeExports.jsx(ListItemText, { primary: "Select All", sx: { fontSize: "5px" } })] })), filterOptions.length !== 0 ? (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.map((name) => {
40806
+ } }), jsxRuntimeExports.jsx(ListItemText, { primary: "Select All", sx: { fontSize: "5px" } })] })), (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.length) !== 0 ? (filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.map((name) => {
40806
40807
  var _a;
40807
40808
  return (jsxRuntimeExports.jsxs(MenuItem, Object.assign({ value: name, sx: { zIndex: 0, fontSize: "5px !important" } }, { children: [jsxRuntimeExports.jsx(Checkbox, { checked: ((_a = extractValuesToArray(fieldValue)) === null || _a === void 0 ? void 0 : _a.indexOf(name)) > -1, size: "small" }), jsxRuntimeExports.jsx(ListItemText, { primary: name, sx: { fontSize: "5px" } })] }), name));
40808
40809
  })) : (jsxRuntimeExports.jsx(MenuItem, Object.assign({ disabled: true, value: "NA" }, { children: "No data Found" }), "NA"))] })), jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name, render: ({ message }) => (jsxRuntimeExports.jsx(ErrorMessageComponent, { children: message })) })] })) }));