pixel-react 1.13.99 → 1.14.1

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.
Files changed (44) hide show
  1. package/lib/ComponentProps/TreeNodeProps.d.ts +3 -0
  2. package/lib/components/Editor/DynamicWidthToolTip.d.ts +6 -0
  3. package/lib/components/Editor/DynamicWidthToolTip.js +63 -0
  4. package/lib/components/Editor/DynamicWidthToolTip.js.map +1 -0
  5. package/lib/components/Editor/Editor.js +2 -2
  6. package/lib/components/Editor/Editor.js.map +1 -1
  7. package/lib/components/Editor/VariableDropdown.js +41 -17
  8. package/lib/components/Editor/VariableDropdown.js.map +1 -1
  9. package/lib/components/Editor/constants.js +2 -2
  10. package/lib/components/Editor/constants.js.map +1 -1
  11. package/lib/components/FileDropzone/FileDropzone.js +4 -3
  12. package/lib/components/FileDropzone/FileDropzone.js.map +1 -1
  13. package/lib/components/FileDropzone/types.d.ts +2 -0
  14. package/lib/components/MachineInputField/MachineInputField.js +4 -4
  15. package/lib/components/MachineInputField/MachineInputField.js.map +1 -1
  16. package/lib/components/NLPInput/NlpInput.d.ts +1 -1
  17. package/lib/components/NLPInput/NlpInput.js +4 -2
  18. package/lib/components/NLPInput/NlpInput.js.map +1 -1
  19. package/lib/components/NLPInput/components/ChipsFolder/ChipsAccordion.js +3 -2
  20. package/lib/components/NLPInput/components/ChipsFolder/ChipsAccordion.js.map +1 -1
  21. package/lib/components/NLPInput/components/NlpDropDown/NlpDropdown.js +1 -1
  22. package/lib/components/NLPInput/components/NlpDropDown/NlpDropdown.js.map +1 -1
  23. package/lib/components/NLPInput/types.d.ts +2 -0
  24. package/lib/components/PhoneInput/PhoneInput.js +11 -7
  25. package/lib/components/PhoneInput/PhoneInput.js.map +1 -1
  26. package/lib/components/PhoneInput/types.d.ts +1 -0
  27. package/lib/components/TableTreeFn/Components/TableHead.d.ts +1 -1
  28. package/lib/components/TableTreeFn/Components/TableHead.js +8 -10
  29. package/lib/components/TableTreeFn/Components/TableHead.js.map +1 -1
  30. package/lib/components/TableTreeFn/TableTreeFn.js +2 -1
  31. package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
  32. package/lib/hooks/useFileDropzone.js +15 -12
  33. package/lib/hooks/useFileDropzone.js.map +1 -1
  34. package/lib/index.cjs +158 -72
  35. package/lib/index.cjs.map +1 -1
  36. package/lib/index.d.ts +8 -1
  37. package/lib/node_modules/js-beautify/js/src/css/beautifier.js +1 -1
  38. package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
  39. package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
  40. package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
  41. package/lib/styles.css +1 -1
  42. package/lib/styles.css.map +1 -1
  43. package/lib/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -10536,9 +10536,9 @@ const useFileDropzone = options => {
10536
10536
  invalidFileMessage,
10537
10537
  fileExistMessage,
10538
10538
  validateMIMEType = false,
10539
- isApiResponseError,
10540
10539
  selectedFile,
10541
- setSelectedFile
10540
+ setSelectedFile,
10541
+ handleReplaceFile
10542
10542
  } = options;
10543
10543
  const file = !selectedFile ? [] : [selectedFile];
10544
10544
  const [files, setFiles] = React.useState({
@@ -10562,13 +10562,13 @@ const useFileDropzone = options => {
10562
10562
  }
10563
10563
  const extensionWithPeriod = getExtensionWithPeriod(file).toLowerCase();
10564
10564
  if (validateMIMEType) {
10565
- if (!validateFileMIMEType(file, extensionWithPeriod) || isApiResponseError) {
10565
+ if (!validateFileMIMEType(file, extensionWithPeriod)) {
10566
10566
  errors.push({
10567
10567
  message: invalidFileMessage ? invalidFileMessage : 'Unsupported File Format',
10568
10568
  code: 'file-invalid-type'
10569
10569
  });
10570
10570
  }
10571
- } else if (accept && !accept.includes(extensionWithPeriod) || isApiResponseError) {
10571
+ } else if (accept && !accept.includes(extensionWithPeriod)) {
10572
10572
  errors.push({
10573
10573
  message: invalidFileMessage ? invalidFileMessage : 'Unsupported File Format',
10574
10574
  code: 'file-invalid-type'
@@ -10582,27 +10582,30 @@ const useFileDropzone = options => {
10582
10582
  });
10583
10583
  }
10584
10584
  return errors;
10585
- }, [accept, maxSize, files, maxSizeErrorMessage, invalidFileMessage, fileExistMessage]);
10585
+ }, [accept, maxSize, files, maxSizeErrorMessage, invalidFileMessage, fileExistMessage, validateMIMEType]);
10586
10586
  const replaceFile = React.useCallback((fileToReplace, newFile) => {
10587
10587
  if (fileToReplace.name === newFile.name && fileToReplace.size === newFile.size) {
10588
10588
  return;
10589
10589
  }
10590
+ if (handleReplaceFile) handleReplaceFile();
10590
10591
  const errors = validateFile(newFile);
10592
+ const isValid = checkEmpty(errors);
10591
10593
  setFiles(prevFiles => {
10592
- const updatedAccepted = prevFiles.accepted.filter(file => file.name !== fileToReplace.name);
10593
- const updatedRejected = prevFiles.rejected.filter(rejection => rejection.file.name !== fileToReplace.name);
10594
- if (!checkEmpty(errors) && newFile && setSelectedFile) {
10594
+ const updatedAccepted = prevFiles.accepted.filter(file => file.name !== fileToReplace.name || file.size !== fileToReplace.size);
10595
+ const updatedRejected = prevFiles.rejected.filter(rejection => rejection.file.name !== fileToReplace.name || rejection.file.size !== fileToReplace.size);
10596
+ // If valid, update selectedFile too
10597
+ if (isValid && setSelectedFile) {
10595
10598
  setSelectedFile([...updatedAccepted, newFile]);
10596
10599
  }
10597
10600
  return {
10598
- accepted: !checkEmpty(errors) ? updatedAccepted : [...updatedAccepted, newFile],
10599
- rejected: !checkEmpty(errors) ? [...updatedRejected, {
10601
+ accepted: isValid ? [...updatedAccepted, newFile] : updatedAccepted,
10602
+ rejected: isValid ? updatedRejected : [...updatedRejected, {
10600
10603
  file: newFile,
10601
10604
  errors
10602
- }] : updatedRejected
10605
+ }]
10603
10606
  };
10604
10607
  });
10605
- }, [validateFile]);
10608
+ }, [validateFile, setSelectedFile]);
10606
10609
  const handleReplaceClick = React.useCallback(fileToReplace => {
10607
10610
  const input = document.createElement('input');
10608
10611
  input.type = 'file';
@@ -11122,7 +11125,8 @@ const FileDropzone = ({
11122
11125
  onUploadFile,
11123
11126
  fileInputRef,
11124
11127
  showNoFilesUploadedMessage = false,
11125
- noFileUploadedText = 'No files are uploaded'
11128
+ noFileUploadedText = 'No files are uploaded',
11129
+ handleReplaceFile
11126
11130
  }) => {
11127
11131
  const {
11128
11132
  getRootProps,
@@ -11142,9 +11146,9 @@ const FileDropzone = ({
11142
11146
  invalidFileMessage,
11143
11147
  fileExistMessage,
11144
11148
  validateMIMEType,
11145
- isApiResponseError,
11146
11149
  selectedFile,
11147
- setSelectedFile
11150
+ setSelectedFile,
11151
+ handleReplaceFile
11148
11152
  // onDrop: (accepted, rejected, event) => {}, //onDrop function to handle dropped or selected files explicitly.
11149
11153
  });
11150
11154
  React.useEffect(() => {
@@ -34302,7 +34306,7 @@ const NlpDropdown = ({
34302
34306
  } else {
34303
34307
  dropdownContainerHeight = options.length * optionHeight + 2 * dropDownWrapperPadding;
34304
34308
  }
34305
- if (fromBottom > dropdownContainerHeight + margin) {
34309
+ if (fromBottom > dropdownContainerHeight + margin + 80) {
34306
34310
  return {
34307
34311
  left: positionX,
34308
34312
  top: positionY,
@@ -34616,7 +34620,8 @@ const ChipsAccordion = /*#__PURE__*/React.forwardRef(({
34616
34620
  chipOptionList,
34617
34621
  selectedChips,
34618
34622
  optionZIndex = 0,
34619
- inputRef
34623
+ inputRef,
34624
+ ChipsAccordionWidth
34620
34625
  }, ref) => {
34621
34626
  const [filterData, setFilterData] = React.useState([]);
34622
34627
  const [isExpanded, setIsExpanded] = React.useState(false);
@@ -34705,7 +34710,7 @@ const ChipsAccordion = /*#__PURE__*/React.forwardRef(({
34705
34710
  top: positionChipContainer.top,
34706
34711
  zIndex: optionZIndex + 100,
34707
34712
  transform: expandDirection === 'up' ? 'translateY(calc(-100% + 33px))' : 'none',
34708
- width: '27.8%',
34713
+ width: ChipsAccordionWidth,
34709
34714
  position: 'absolute'
34710
34715
  },
34711
34716
  ref: localRef,
@@ -34844,7 +34849,8 @@ const NlpInput = ({
34844
34849
  loadMoreOptions = () => {},
34845
34850
  isWebservice = true,
34846
34851
  closeInputOnOutsideClick = () => {},
34847
- tooltipText = 'Help'
34852
+ tooltipText = 'Help',
34853
+ ChipsAccordionWidth = '27.8%'
34848
34854
  }) => {
34849
34855
  const initialState = {
34850
34856
  isInputFocused: false,
@@ -35115,7 +35121,8 @@ const NlpInput = ({
35115
35121
  selectedChips: selectedChips,
35116
35122
  optionZIndex: optionZIndex,
35117
35123
  ref: ChipRef,
35118
- inputRef: InputRef
35124
+ inputRef: InputRef,
35125
+ ChipsAccordionWidth: ChipsAccordionWidth
35119
35126
  })
35120
35127
  })]
35121
35128
  });
@@ -35247,15 +35254,15 @@ const MachineInputField = ({
35247
35254
  color: "var(--ff-machine-input-field-text-color)",
35248
35255
  children: isTextTruncated(label, 10) ? truncateText(label, 10) : label
35249
35256
  })
35250
- }), isManualScript && !checkEmpty(version) && jsxRuntime.jsxs(Tooltip, {
35257
+ }), isManualScript && !checkEmpty(version) && jsxRuntime.jsx(Tooltip, {
35251
35258
  title: version,
35252
- children: ["\u00A0 \u00A0", jsxRuntime.jsx(Typography, {
35259
+ children: jsxRuntime.jsxs(Typography, {
35253
35260
  className: classNames('ff-machine-text', {
35254
35261
  'ff-machine-text-reverse': contentReverse
35255
35262
  }),
35256
35263
  color: "var(--ff-machine-input-field-text-color)",
35257
- children: isTextTruncated(version ?? '', 10) ? truncateText(version ?? '', 10) : version
35258
- })]
35264
+ children: [' ', "-", ' ', isTextTruncated(version ?? '', 10) ? truncateText(version ?? '', 10) : version]
35265
+ })
35259
35266
  })]
35260
35267
  }, type))
35261
35268
  })]
@@ -43762,15 +43769,70 @@ const StatusCard = ({
43762
43769
  });
43763
43770
  };
43764
43771
 
43772
+ const DynamicWidthTooltip = ({
43773
+ option
43774
+ }) => {
43775
+ const textRef = React.useRef(null);
43776
+ const [isTruncated, setIsTruncated] = React.useState(false);
43777
+ React.useEffect(() => {
43778
+ const el = textRef.current;
43779
+ if (!el) return;
43780
+ const checkTruncation = () => {
43781
+ setIsTruncated(el.scrollWidth > el.clientWidth);
43782
+ };
43783
+ const raf = requestAnimationFrame(checkTruncation);
43784
+ window.addEventListener('resize', checkTruncation);
43785
+ return () => {
43786
+ cancelAnimationFrame(raf);
43787
+ window.removeEventListener('resize', checkTruncation);
43788
+ };
43789
+ }, [option]);
43790
+ const VARIABLE_ICON_MAP = {
43791
+ LOCAL: 'local_variable_icon',
43792
+ GLOBAL: 'global_variable_icon',
43793
+ PROJECT_ENVIRONMENT: 'project_env_variable_icon'
43794
+ };
43795
+ const getVariableIcon = option => {
43796
+ if (!option) return '';
43797
+ const variableId = option._id || option.id;
43798
+ if (variableId?.startsWith('PARAMETER')) return 'step_group_parameter';
43799
+ if (option.type === 'LOCAL' && option?.parentVariableType === 'STEPGROUP') return 'step_group_variable';
43800
+ if (option.type === '_startforloop') return 'for_loop_variable';
43801
+ if (option.type === 'DATAPROVIDER') return 'data_provider_variable';
43802
+ return VARIABLE_ICON_MAP[option.type || ''] || '';
43803
+ };
43804
+ return jsxRuntime.jsxs("div", {
43805
+ style: {
43806
+ width: '-webkit-fill-available'
43807
+ },
43808
+ className: "ff-variable-option ff-variable-data",
43809
+ children: [jsxRuntime.jsx(Tooltip, {
43810
+ title: isTruncated ? option.name : '',
43811
+ style: {
43812
+ width: 'calc(100% - 32px)'
43813
+ },
43814
+ children: jsxRuntime.jsx("span", {
43815
+ ref: textRef,
43816
+ className: "ff-truncated_text",
43817
+ children: option.name
43818
+ })
43819
+ }), jsxRuntime.jsx(Icon, {
43820
+ name: getVariableIcon(option),
43821
+ height: 16,
43822
+ width: 16,
43823
+ hoverEffect: true
43824
+ })]
43825
+ });
43826
+ };
43827
+
43765
43828
  const VariableDropdown = ({
43766
43829
  optionsList = [],
43767
43830
  onSelectVariable,
43768
43831
  dropdownPosition,
43769
43832
  position = 'relative',
43770
- width = '300px',
43833
+ width,
43771
43834
  height = '100px',
43772
- zIndex = 9999,
43773
- truncateTextValue = 34
43835
+ zIndex = 9999
43774
43836
  }) => {
43775
43837
  const VARIABLE_ICON_MAP = {
43776
43838
  LOCAL: 'local_variable_icon',
@@ -43786,6 +43848,18 @@ const VariableDropdown = ({
43786
43848
  if (option.type === 'DATAPROVIDER') return 'data_provider_variable';
43787
43849
  return VARIABLE_ICON_MAP[option.type || ''] || '';
43788
43850
  };
43851
+ const getDisplayText = option => {
43852
+ if (option?.type === '_startforloop') return `FLV_for:${option?.name}`;
43853
+ if (option?.type === 'DATAPROVIDER') return `${option?.dpName}:${option?.varname}`;
43854
+ return option?.name;
43855
+ };
43856
+ function getNumericValue(value) {
43857
+ if (value.endsWith('px')) {
43858
+ const num = parseInt(value.slice(0, -2), 10);
43859
+ return isNaN(num) ? 212 : num - 66;
43860
+ }
43861
+ return 212;
43862
+ }
43789
43863
  return jsxRuntime.jsx("div", {
43790
43864
  className: classNames('ff-variable-dropdown', position),
43791
43865
  style: dropdownPosition ? {
@@ -43800,19 +43874,30 @@ const VariableDropdown = ({
43800
43874
  zIndex
43801
43875
  },
43802
43876
  children: !checkEmpty(optionsList) ? optionsList?.map(option => {
43803
- return jsxRuntime.jsxs("div", {
43804
- className: "ff-variable-option",
43877
+ return jsxRuntime.jsx("div", {
43878
+ className: width.endsWith('px') ? 'ff-variable-option' : ' ff-variable-data',
43805
43879
  onMouseDown: () => onSelectVariable(option),
43806
- children: [jsxRuntime.jsx(Typography, {
43807
- as: "span",
43808
- fontSize: 14,
43809
- children: truncateText(option?.type === '_startforloop' ? `FLV_for:${option?.name}` : option?.type === 'DATAPROVIDER' ? option?.dpName + ':' + option?.varname : option?.name, truncateTextValue)
43810
- }), jsxRuntime.jsx(Icon, {
43811
- name: getVariableIcon(option),
43812
- height: 16,
43813
- width: 16,
43814
- hoverEffect: true
43815
- })]
43880
+ children: width.endsWith('px') ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
43881
+ children: [jsxRuntime.jsx(Tooltip, {
43882
+ title: isTextTruncated(getDisplayText(option), getNumericValue(width), 'pixel') ? getDisplayText(option) : '',
43883
+ style: {
43884
+ width: `${getNumericValue(width)}px`
43885
+ },
43886
+ children: jsxRuntime.jsx(Typography, {
43887
+ as: "span",
43888
+ fontSize: 14,
43889
+ className: "ff-truncated_text",
43890
+ children: getDisplayText(option)
43891
+ })
43892
+ }), jsxRuntime.jsx(Icon, {
43893
+ name: getVariableIcon(option),
43894
+ height: 16,
43895
+ width: 16,
43896
+ hoverEffect: true
43897
+ })]
43898
+ }) : jsxRuntime.jsx(DynamicWidthTooltip, {
43899
+ option: option
43900
+ })
43816
43901
  }, option?.id);
43817
43902
  }) : jsxRuntime.jsx("div", {
43818
43903
  className: "ff-variable-option",
@@ -46763,6 +46848,19 @@ const SessionDropdown = ({
46763
46848
  });
46764
46849
  };
46765
46850
 
46851
+ const formatCellData = (content, maxLength) => {
46852
+ if (typeof content === 'string') {
46853
+ return truncateText(content, maxLength);
46854
+ }
46855
+ if (/*#__PURE__*/React.isValidElement(content)) {
46856
+ return /*#__PURE__*/React.cloneElement(content, {}, formatCellData(content.props.children, maxLength));
46857
+ }
46858
+ if (Array.isArray(content)) {
46859
+ return content.map(child => formatCellData(child, maxLength));
46860
+ }
46861
+ return content;
46862
+ };
46863
+
46766
46864
  const TableHead = /*#__PURE__*/React.memo(({
46767
46865
  columnsData,
46768
46866
  rootNode,
@@ -46771,7 +46869,8 @@ const TableHead = /*#__PURE__*/React.memo(({
46771
46869
  selectedNode,
46772
46870
  tableHeaderBgColor,
46773
46871
  hideOnDisable,
46774
- transparentHeader
46872
+ transparentHeader,
46873
+ scriptLengthTruncate = 25
46775
46874
  }) => {
46776
46875
  // const hasDefaultValues = useMemo(
46777
46876
  // () => columnsData.some(({ defaultValue }) => !!defaultValue),
@@ -46815,16 +46914,11 @@ const TableHead = /*#__PURE__*/React.memo(({
46815
46914
  value: rootNode.node.key,
46816
46915
  onChange: e => onCheckBoxChange(e, rootNode.node),
46817
46916
  disabled: rootNode.node.isDisabled
46818
- }), jsxRuntime.jsxs("span", {
46917
+ }), jsxRuntime.jsx("span", {
46819
46918
  className: "tree-table-td-content-text",
46820
- children: [jsxRuntime.jsx("span", {
46821
- children: rootNode.node[col.accessor]
46822
- }), rootNode.cell && index === 0 && jsxRuntime.jsx("span", {
46823
- className: "table-tree-root-cell",
46824
- children: (() => {
46825
- return rootNode.cell(rootNode.node);
46826
- })()
46827
- })]
46919
+ children: jsxRuntime.jsx("span", {
46920
+ children: formatCellData(prepareData(rootNode.node, col), scriptLengthTruncate)
46921
+ })
46828
46922
  }), rootNode.actions && index === 0 && isMounted && rootNodeRowRef.current && jsxRuntime.jsx("div", {
46829
46923
  className: "table-tree-row-action",
46830
46924
  children: (() => {
@@ -46936,19 +47030,6 @@ const addNewRow = (treeData, newNode, rootNode) => {
46936
47030
  return addLastChild(updatedTreeData);
46937
47031
  };
46938
47032
 
46939
- const formatCellData = (content, maxLength) => {
46940
- if (typeof content === 'string') {
46941
- return truncateText(content, maxLength);
46942
- }
46943
- if (/*#__PURE__*/React.isValidElement(content)) {
46944
- return /*#__PURE__*/React.cloneElement(content, {}, formatCellData(content.props.children, maxLength));
46945
- }
46946
- if (Array.isArray(content)) {
46947
- return content.map(child => formatCellData(child, maxLength));
46948
- }
46949
- return content;
46950
- };
46951
-
46952
47033
  const renderSpaces = (level, parentSiblings = [], isLast, isContainer) => {
46953
47034
  let siblingsArray = parentSiblings;
46954
47035
  let isLastNode = isLast;
@@ -47455,7 +47536,8 @@ const TableTreeFn = /*#__PURE__*/React.forwardRef(({
47455
47536
  selectedNode: selectedNode,
47456
47537
  tableHeaderBgColor: tableHeaderBgColor,
47457
47538
  hideOnDisable: hideOnDisable,
47458
- transparentHeader: transparentHeader
47539
+ transparentHeader: transparentHeader,
47540
+ scriptLengthTruncate: scriptLengthTruncate
47459
47541
  }), jsxRuntime.jsx(TableBody, {
47460
47542
  flattenedTreeData: addLastChild(treeData),
47461
47543
  rootNode: rootNode?.node,
@@ -59215,7 +59297,7 @@ const Editor = /*#__PURE__*/React.forwardRef(({
59215
59297
  jslint_happy: true,
59216
59298
  end_with_newline: true,
59217
59299
  wrap_line_length: 0,
59218
- comma_first: true,
59300
+ comma_first: false,
59219
59301
  e4x: true,
59220
59302
  indent_empty_lines: true
59221
59303
  });
@@ -59233,7 +59315,7 @@ const Editor = /*#__PURE__*/React.forwardRef(({
59233
59315
  jslint_happy: true,
59234
59316
  end_with_newline: true,
59235
59317
  wrap_line_length: 0,
59236
- comma_first: true,
59318
+ comma_first: false,
59237
59319
  e4x: true,
59238
59320
  indent_empty_lines: true
59239
59321
  });
@@ -74906,7 +74988,8 @@ const PhoneInputField = ({
74906
74988
  isValid: initialIsValid = true,
74907
74989
  isVerified = false,
74908
74990
  isVerifyDisplay = false,
74909
- onVerifyClick = () => {}
74991
+ onVerifyClick = () => {},
74992
+ onValidationChange = () => {}
74910
74993
  }) => {
74911
74994
  const [phone, setPhone] = React.useState(initialValue);
74912
74995
  const [isFocused, setIsFocused] = React.useState(false);
@@ -74921,6 +75004,13 @@ const PhoneInputField = ({
74921
75004
  setPhone(formattedPhone);
74922
75005
  }
74923
75006
  }, [initialValue]);
75007
+ const validatePhoneNumber = phoneNumber => {
75008
+ const isPhoneValid = isValidPhoneNumber(phoneNumber);
75009
+ const isOnlyCountryCode = !!phoneNumber && phoneNumber.replace(/[^\d]/g, '').length <= 3;
75010
+ const isValidNumber = isPhoneValid || isOnlyCountryCode;
75011
+ setIsValid(isValidNumber);
75012
+ onValidationChange(isValidNumber);
75013
+ };
74924
75014
  const handlePhoneChange = (phone, countryData) => {
74925
75015
  const newCountryCode = countryData?.countryCode?.toLowerCase();
74926
75016
  const cleanedPhone = phone.replace(/[^0-9+]/g, '');
@@ -74937,9 +75027,7 @@ const PhoneInputField = ({
74937
75027
  }
74938
75028
  setPhone(formattedPhone);
74939
75029
  onChange(formattedPhone);
74940
- const isPhoneValid = isValidPhoneNumber(formattedPhone);
74941
- const isOnlyCountryCode = phone && phone.replace(/[^\d]/g, '').length <= 3;
74942
- setIsValid(isPhoneValid || isOnlyCountryCode);
75030
+ validatePhoneNumber(formattedPhone);
74943
75031
  };
74944
75032
  const handleFocus = event => {
74945
75033
  setIsFocused(true);
@@ -74948,9 +75036,7 @@ const PhoneInputField = ({
74948
75036
  const handleBlur = event => {
74949
75037
  setIsFocused(false);
74950
75038
  if (onBlur) onBlur(event);
74951
- const isOnlyCountryCode = phone && phone.replace(/[^\d]/g, '').length <= 3;
74952
- const isPhoneValid = isValidPhoneNumber(phone);
74953
- setIsValid(isPhoneValid || isOnlyCountryCode);
75039
+ validatePhoneNumber(phone);
74954
75040
  };
74955
75041
  return jsxRuntime.jsxs("div", {
74956
75042
  id: id,