pixel-react 1.13.62 → 1.13.64

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 (54) hide show
  1. package/lib/_virtual/index10.js +2 -2
  2. package/lib/_virtual/index11.js +2 -2
  3. package/lib/_virtual/index9.js +2 -2
  4. package/lib/components/CreateVariable/CreateVariableSlider.js +18 -2
  5. package/lib/components/CreateVariable/CreateVariableSlider.js.map +1 -1
  6. package/lib/components/EditLabel/EditLabel.js +25 -0
  7. package/lib/components/EditLabel/EditLabel.js.map +1 -1
  8. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js +4 -6
  9. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js.map +1 -1
  10. package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.d.ts +1 -1
  11. package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.js +4 -3
  12. package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.js.map +1 -1
  13. package/lib/components/MediaPreview/MediaPreview.js +43 -12
  14. package/lib/components/MediaPreview/MediaPreview.js.map +1 -1
  15. package/lib/components/PhoneInput/PhoneInput.js +21 -6
  16. package/lib/components/PhoneInput/PhoneInput.js.map +1 -1
  17. package/lib/components/PhoneInput/types.d.ts +6 -0
  18. package/lib/components/Search/Search.js +1 -1
  19. package/lib/components/Search/Search.js.map +1 -1
  20. package/lib/components/Select/Select.js +1 -1
  21. package/lib/components/Select/Select.js.map +1 -1
  22. package/lib/components/Table/Table.d.ts +1 -1
  23. package/lib/components/Table/Table.js +5 -1
  24. package/lib/components/Table/Table.js.map +1 -1
  25. package/lib/components/Table/Types.d.ts +4 -0
  26. package/lib/components/variableSuggestionInputDropDown/VariableSuggestionInputDropDown.js +28 -21
  27. package/lib/components/variableSuggestionInputDropDown/VariableSuggestionInputDropDown.js.map +1 -1
  28. package/lib/components/variableSuggestionInputDropDown/types.d.ts +4 -0
  29. package/lib/hooks/useConditionalLock.d.ts +2 -0
  30. package/lib/hooks/useConditionalLock.js +19 -0
  31. package/lib/hooks/useConditionalLock.js.map +1 -0
  32. package/lib/index.cjs +166 -49
  33. package/lib/index.cjs.map +1 -1
  34. package/lib/index.d.ts +14 -2
  35. package/lib/index.js +2 -1
  36. package/lib/index.js.map +1 -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/index.js +1 -1
  39. package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
  40. package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
  41. package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
  42. package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
  43. package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
  44. package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
  45. package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
  46. package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
  47. package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
  48. package/lib/styles.css +1 -1
  49. package/lib/styles.css.map +1 -1
  50. package/lib/tsconfig.tsbuildinfo +1 -1
  51. package/lib/validations/regex.d.ts +2 -1
  52. package/lib/validations/regex.js +4 -1
  53. package/lib/validations/regex.js.map +1 -1
  54. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -2484,6 +2484,7 @@ const FILE_NAME_REGEX = /\.([^.@]+)$/;
2484
2484
  const ELEMENTS_TRAILING_SPACE_REGEX = /^\S.*\S$/;
2485
2485
  const ELEMENTS_WHITE_SPACE_REGEX = /.*\S.*/;
2486
2486
  const PARAMETER_ALPHANUMERIC_REGEX = /^[-_A-Za-z0-9 ]*$|^[-_A-Za-z0-9 ][A-Za-z0-9 ]*[-_A-Za-z-_]$/;
2487
+ const ALPHANUMERIC_PARENTHESIS_REGEX = /^[-_A-Za-z0-9 ()]*$|^[-_A-Za-z0-9 ()][A-Za-z0-9 ()]*[-_A-Za-z-()]$/;
2487
2488
  const STRIP_NEW_LINES_REGEX = /\n/g;
2488
2489
  //Regular expression to convert lower camel case by excluding spaces
2489
2490
  const CAMEL_CASE_REGEX = /(?:^\w|[A-Z]|\b\w|\s+)/g;
@@ -2530,6 +2531,8 @@ const LINK_VALIDATION_REGEX = /^(https?:\/\/)?((?!.*\.\.)[\da-z.-]+)\.([\da-z.-]
2530
2531
  // Alphanumeric Validation with specific Order including special characters (- , _ , ( , ) )
2531
2532
  const ALPHA_NUM_EXTENDED_REGEX = /^[a-zA-Z0-9 _\-()]+$/;
2532
2533
  // Alphanumeric string allowing only dot(.) as special character
2534
+ const ALPHANUMERIC_WITH_DOT_REGEX = /^[A-Za-z0-9.]+$/;
2535
+ // Alphanumeric string allowing only dot(.) as special character
2533
2536
  const EXCEL_SPACING_REGEX = /[\n\t"]/;
2534
2537
 
2535
2538
  const Dropdown$2 = /*#__PURE__*/React.forwardRef(({
@@ -4438,7 +4441,7 @@ const Select$1 = ({
4438
4441
  'ff-select-labels__active': searchedText
4439
4442
  }),
4440
4443
  fontSize: searchedText || showDropdownOptions ? 10 : 12,
4441
- lineHeight: searchedText || showDropdownOptions ? '10px' : '12px',
4444
+ lineHeight: searchedText || showDropdownOptions && '12px',
4442
4445
  required: required,
4443
4446
  style: {
4444
4447
  maxWidth: `calc(${selectWidth} - 40px)`
@@ -9839,7 +9842,8 @@ const Table$1 = ({
9839
9842
  columnSticky = false,
9840
9843
  tableRef = null,
9841
9844
  isRowCheckBoxDisable,
9842
- isRowDisabled = true
9845
+ isRowDisabled = true,
9846
+ tableHeaderZindex = 99
9843
9847
  }) => {
9844
9848
  const observerRef = React.useRef(null);
9845
9849
  React.useEffect(() => {
@@ -9922,6 +9926,9 @@ const Table$1 = ({
9922
9926
  className: classNames({
9923
9927
  'ff-fixed-header': withFixedHeader
9924
9928
  }, tableHeadClass),
9929
+ style: {
9930
+ zIndex: tableHeaderZindex
9931
+ },
9925
9932
  children: jsxRuntime.jsx("tr", {
9926
9933
  children: columns.map((column, index) => jsxRuntime.jsxs("th", {
9927
9934
  className: classNames(`${headerType !== 'default' ? `${headerType}-bg` : ''}`, `${headerTextColor && `${headerTextColor}-color`}`, {
@@ -16604,6 +16611,31 @@ const EditLabel = ({
16604
16611
  return '';
16605
16612
  }
16606
16613
  };
16614
+ const getScrollableParent = element => {
16615
+ if (!element) return window;
16616
+ let parent = element.parentElement;
16617
+ while (parent) {
16618
+ const overflowY = window.getComputedStyle(parent).overflowY;
16619
+ if (overflowY === 'auto' || overflowY === 'scroll') {
16620
+ return parent;
16621
+ }
16622
+ parent = parent.parentElement;
16623
+ }
16624
+ return window;
16625
+ };
16626
+ React.useEffect(() => {
16627
+ if (!containerRef.current) return;
16628
+ const scrollableParent = getScrollableParent(containerRef.current);
16629
+ const handleScroll = () => {
16630
+ handleCancel();
16631
+ };
16632
+ scrollableParent.addEventListener('scroll', handleScroll, {
16633
+ passive: true
16634
+ });
16635
+ return () => {
16636
+ scrollableParent.removeEventListener('scroll', handleScroll);
16637
+ };
16638
+ }, []);
16607
16639
  React.useEffect(() => {
16608
16640
  if (value) {
16609
16641
  setText(value);
@@ -17522,7 +17554,7 @@ const Search = ({
17522
17554
  onClose,
17523
17555
  onExpand,
17524
17556
  showClose = true,
17525
- helperText = 'Minimum 3 characters are required',
17557
+ helperText = 'Minimum 3 characters required',
17526
17558
  showToaster = true,
17527
17559
  minLength = 3,
17528
17560
  isAISearch = false,
@@ -36171,8 +36203,9 @@ const fontFamilyList = [{
36171
36203
  value: 'monospace'
36172
36204
  }];
36173
36205
  const fontSizeList = [5, 6, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 32, 36, 40, 48, 56, 72];
36174
- const allowTextType = inputType => {
36175
- return inputType !== 'dropDown' && inputType !== 'file';
36206
+ const isPasteAllowed = currentCell => {
36207
+ const inputType = currentCell?.inputType?.type ?? 'text';
36208
+ return !['dropDown', 'file'].includes(inputType) && !currentCell?.readOnly;
36176
36209
  };
36177
36210
 
36178
36211
  const FORMULA_VALUE_PREFIX = '=';
@@ -37828,7 +37861,7 @@ function reducer(state, action) {
37828
37861
  let newData = state.cut && state.copied ? unset(state.copied.start, state.model.data) : state.model.data;
37829
37862
  const commit = [];
37830
37863
  for (const point of selectedRange || []) {
37831
- const currentCell = get(point, state.model.data);
37864
+ const currentCell = get(point, state.model.data) || null;
37832
37865
  const updateWithStyle = {
37833
37866
  ...currentCell,
37834
37867
  value: cell?.value
@@ -37837,8 +37870,7 @@ function reducer(state, action) {
37837
37870
  prevCell: currentCell || EmptyCell,
37838
37871
  nextCell: EmptyCell
37839
37872
  });
37840
- const inputType = currentCell?.inputType?.type ?? 'text';
37841
- if (allowTextType(inputType)) {
37873
+ if (isPasteAllowed(currentCell)) {
37842
37874
  newData = set(point, updateWithStyle, newData);
37843
37875
  }
37844
37876
  }
@@ -37892,8 +37924,7 @@ function reducer(state, action) {
37892
37924
  prevCell: currentCell,
37893
37925
  nextCell: cell || null
37894
37926
  }];
37895
- const inputType = currentCell?.inputType?.type ?? 'text';
37896
- if (allowTextType(inputType)) {
37927
+ if (isPasteAllowed(currentCell)) {
37897
37928
  acc.data = set(nextPoint, {
37898
37929
  ...currentCell,
37899
37930
  value: cell?.value ?? ''
@@ -42801,6 +42832,7 @@ const VariableSuggestionInputDropDown = /*#__PURE__*/React.forwardRef(({
42801
42832
  symbol = '$',
42802
42833
  type = 'text',
42803
42834
  clearIcon = true,
42835
+ inputTitle = '',
42804
42836
  ...props
42805
42837
  }, ref) => {
42806
42838
  const [showDropdown, setShowDropdown] = React.useState(false);
@@ -42957,28 +42989,34 @@ const VariableSuggestionInputDropDown = /*#__PURE__*/React.forwardRef(({
42957
42989
  children: [jsxRuntime.jsxs("div", {
42958
42990
  className: "ff-add-variable-input",
42959
42991
  ref: containerRef,
42960
- children: [jsxRuntime.jsx(Input$1, {
42961
- ...props,
42962
- name: "add_variable",
42963
- ref: inputRef,
42964
- type: type,
42965
- value: value,
42966
- onChange: onChange,
42967
- onPaste: () => {
42968
- setShowCreateVariableIcon(true);
42992
+ children: [jsxRuntime.jsx(Tooltip, {
42993
+ title: inputTitle,
42994
+ style: {
42995
+ width: '100%'
42969
42996
  },
42970
- variant: "primary",
42971
- label: label,
42972
- placeholder: placeholder,
42973
- onClick: handleClick,
42974
- onKeyUp: handleKeyUp,
42975
- onFocus: () => setIsFocused(true),
42976
- onBlur: e => handleBlur(e),
42977
- autoComplete: autoComplete,
42978
- helperText: helperText,
42979
- error: error,
42980
- required: required,
42981
- ...formProps
42997
+ children: jsxRuntime.jsx(Input$1, {
42998
+ ...props,
42999
+ name: "add_variable",
43000
+ ref: inputRef,
43001
+ type: type,
43002
+ value: value,
43003
+ onChange: onChange,
43004
+ onPaste: () => {
43005
+ setShowCreateVariableIcon(true);
43006
+ },
43007
+ variant: "primary",
43008
+ label: label,
43009
+ placeholder: placeholder,
43010
+ onClick: handleClick,
43011
+ onKeyUp: handleKeyUp,
43012
+ onFocus: () => setIsFocused(true),
43013
+ onBlur: e => handleBlur(e),
43014
+ autoComplete: autoComplete,
43015
+ helperText: helperText,
43016
+ error: error,
43017
+ required: required,
43018
+ ...formProps
43019
+ })
42982
43020
  }), !checkEmpty(value) && !isOnlyHash && jsxRuntime.jsxs("div", {
42983
43021
  className: "ff-variable-icon-container",
42984
43022
  children: [clearIcon && jsxRuntime.jsx(Tooltip, {
@@ -43047,6 +43085,18 @@ const CreateVariableSlider = ({
43047
43085
  const [helperText, setHelperText] = React.useState('');
43048
43086
  const [hashInputValue, setHashInputValue] = React.useState();
43049
43087
  const [isSubmitting, setIsSubmitting] = React.useState(false);
43088
+ const [initialValues, setInitialValues] = React.useState({
43089
+ name: '',
43090
+ value: ''
43091
+ });
43092
+ React.useEffect(() => {
43093
+ if (isOpen && mode === 'edit') {
43094
+ setInitialValues({
43095
+ name: variableName,
43096
+ value: variableValue
43097
+ });
43098
+ }
43099
+ }, []);
43050
43100
  const getVariableNameError = value => {
43051
43101
  if (!value || value.length === 0) {
43052
43102
  return 'Variable Name is required';
@@ -43084,6 +43134,10 @@ const CreateVariableSlider = ({
43084
43134
  const isValid = isNonEmpty && matchesPattern && noWhitespaceEdges && lengthValid;
43085
43135
  return isValid;
43086
43136
  }
43137
+ const hasChanges = React.useMemo(() => {
43138
+ if (mode !== 'edit') return true;
43139
+ return variableName !== initialValues.name || variableValue !== initialValues.value;
43140
+ }, [mode, variableName, variableValue, initialValues]);
43087
43141
  const FooterContent = () => {
43088
43142
  return jsxRuntime.jsxs("div", {
43089
43143
  className: "ff-create-slider-footer",
@@ -43101,7 +43155,7 @@ const CreateVariableSlider = ({
43101
43155
  handleSubmit();
43102
43156
  }
43103
43157
  },
43104
- disabled: !isVariableNameValid(variableName) || isSubmitting
43158
+ disabled: !isVariableNameValid(variableName) || isSubmitting || mode === 'edit' && !hasChanges
43105
43159
  })]
43106
43160
  });
43107
43161
  };
@@ -43528,6 +43582,7 @@ const MediaPreview = ({
43528
43582
  isDisabled = false
43529
43583
  }) => {
43530
43584
  const [isModalOpen, setIsModalOpen] = React.useState(false);
43585
+ const videoRef = React.useRef(null);
43531
43586
  const handleExpand = () => {
43532
43587
  setIsModalOpen(true);
43533
43588
  onExpandClick && onExpandClick(fileId);
@@ -43544,6 +43599,20 @@ const MediaPreview = ({
43544
43599
  setIsModalOpen(true);
43545
43600
  }
43546
43601
  }, [previewOnly]);
43602
+ React.useEffect(() => {
43603
+ if (isModalOpen) {
43604
+ setTimeout(() => {
43605
+ if (videoRef.current) {
43606
+ const playPromise = videoRef.current.play();
43607
+ if (playPromise !== undefined) {
43608
+ playPromise.catch(error => {
43609
+ console.error('Autoplay failed:', error);
43610
+ });
43611
+ }
43612
+ }
43613
+ }, 300);
43614
+ }
43615
+ }, [isModalOpen]);
43547
43616
  return jsxRuntime.jsxs("div", {
43548
43617
  children: [!previewOnly && (isMediaIcon ? jsxRuntime.jsx(Icon, {
43549
43618
  name: iconName,
@@ -43572,16 +43641,30 @@ const MediaPreview = ({
43572
43641
  className: "media-wrapper",
43573
43642
  children: [jsxRuntime.jsxs("div", {
43574
43643
  className: "ff-expand-icons",
43575
- children: [jsxRuntime.jsx(Icon, {
43576
- name: "download_file_icon",
43577
- onClick: handleDownload,
43578
- color: "var(--icons-default-color)",
43579
- className: "header-icons"
43580
- }), jsxRuntime.jsx(Icon, {
43581
- name: "close",
43582
- onClick: handleClose,
43583
- color: "var(--icons-default-color)",
43584
- className: "header-icons"
43644
+ children: [jsxRuntime.jsx(Tooltip, {
43645
+ title: "Download File",
43646
+ children: jsxRuntime.jsx(Icon, {
43647
+ name: "download_file_icon",
43648
+ onClick: handleDownload,
43649
+ color: "var(--icons-default-color)",
43650
+ className: "header-icons"
43651
+ })
43652
+ }), jsxRuntime.jsx(Tooltip, {
43653
+ title: "Expand",
43654
+ children: jsxRuntime.jsx(Icon, {
43655
+ name: "expand",
43656
+ onClick: handleExpand,
43657
+ color: "var(--icons-default-color)",
43658
+ className: "header-icons"
43659
+ })
43660
+ }), jsxRuntime.jsx(Tooltip, {
43661
+ title: "close",
43662
+ children: jsxRuntime.jsx(Icon, {
43663
+ name: "close",
43664
+ onClick: handleClose,
43665
+ color: "var(--icons-default-color)",
43666
+ className: "header-icons"
43667
+ })
43585
43668
  })]
43586
43669
  }), mediaType === 'image' && jsxRuntime.jsx("img", {
43587
43670
  src: MediaSrc,
@@ -43592,7 +43675,8 @@ const MediaPreview = ({
43592
43675
  src: MediaSrc,
43593
43676
  controls: true,
43594
43677
  controlsList: "nodownload",
43595
- className: "ff-video-preview"
43678
+ className: "ff-video-preview",
43679
+ ref: videoRef
43596
43680
  })]
43597
43681
  })
43598
43682
  })]
@@ -59361,6 +59445,21 @@ const Comments = ({
59361
59445
  });
59362
59446
  };
59363
59447
 
59448
+ function useConditionalLock(fn, unlockCondition) {
59449
+ const isLocked = React.useRef(false);
59450
+ React.useEffect(() => {
59451
+ if (unlockCondition) {
59452
+ isLocked.current = false;
59453
+ }
59454
+ }, [unlockCondition]);
59455
+ return React.useCallback((...args) => {
59456
+ if (!isLocked.current) {
59457
+ fn(...args);
59458
+ isLocked.current = true;
59459
+ }
59460
+ }, [fn]);
59461
+ }
59462
+
59364
59463
  const PopUpModal = ({
59365
59464
  isOpen,
59366
59465
  onClose,
@@ -72397,6 +72496,7 @@ const PhoneInputField = ({
72397
72496
  const [phone, setPhone] = React.useState(initialValue);
72398
72497
  const [isFocused, setIsFocused] = React.useState(false);
72399
72498
  const [isValid, setIsValid] = React.useState(initialIsValid);
72499
+ const [selectedCountry, setSelectedCountry] = React.useState(country);
72400
72500
  React.useEffect(() => {
72401
72501
  if (initialValue) {
72402
72502
  let formattedPhone = initialValue;
@@ -72406,12 +72506,25 @@ const PhoneInputField = ({
72406
72506
  setPhone(formattedPhone);
72407
72507
  }
72408
72508
  }, [initialValue]);
72409
- const handlePhoneChange = phone => {
72509
+ const handlePhoneChange = (phone, countryData) => {
72510
+ const newCountryCode = countryData?.countryCode?.toLowerCase();
72410
72511
  const cleanedPhone = phone.replace(/[^0-9+]/g, '');
72411
- setPhone(cleanedPhone);
72412
- onChange(cleanedPhone);
72413
- const isPhoneValid = isValidPhoneNumber(cleanedPhone);
72414
- setIsValid(isPhoneValid);
72512
+ if (selectedCountry?.toLowerCase() !== newCountryCode) {
72513
+ setPhone(countryData?.dialCode);
72514
+ onChange(countryData?.dialCode);
72515
+ setSelectedCountry(newCountryCode);
72516
+ setIsValid(true);
72517
+ return;
72518
+ }
72519
+ let formattedPhone = cleanedPhone;
72520
+ if (!formattedPhone.startsWith('+')) {
72521
+ formattedPhone = `+${formattedPhone}`;
72522
+ }
72523
+ setPhone(formattedPhone);
72524
+ onChange(formattedPhone);
72525
+ const isPhoneValid = isValidPhoneNumber(formattedPhone);
72526
+ const isOnlyCountryCode = phone && phone.replace(/[^\d]/g, '').length <= 3;
72527
+ setIsValid(isPhoneValid || isOnlyCountryCode);
72415
72528
  };
72416
72529
  const handleFocus = event => {
72417
72530
  setIsFocused(true);
@@ -72420,8 +72533,9 @@ const PhoneInputField = ({
72420
72533
  const handleBlur = event => {
72421
72534
  setIsFocused(false);
72422
72535
  if (onBlur) onBlur(event);
72536
+ const isOnlyCountryCode = phone && phone.replace(/[^\d]/g, '').length <= 3;
72423
72537
  const isPhoneValid = isValidPhoneNumber(phone);
72424
- setIsValid(isPhoneValid);
72538
+ setIsValid(isPhoneValid || isOnlyCountryCode);
72425
72539
  };
72426
72540
  return jsxRuntime.jsxs("div", {
72427
72541
  id: id,
@@ -109990,7 +110104,9 @@ const ScriptGenerationLoader = ({
109990
110104
 
109991
110105
  exports.AADHAAR_REGEX = AADHAAR_REGEX;
109992
110106
  exports.ALPHABET_ONLY_REGEX = ALPHABET_ONLY_REGEX;
110107
+ exports.ALPHANUMERIC_PARENTHESIS_REGEX = ALPHANUMERIC_PARENTHESIS_REGEX;
109993
110108
  exports.ALPHANUMERIC_REGEX = ALPHANUMERIC_REGEX;
110109
+ exports.ALPHANUMERIC_WITH_DOT_REGEX = ALPHANUMERIC_WITH_DOT_REGEX;
109994
110110
  exports.ALPHANUMERIC_WITH_ROUND_BRACES_REGEX = ALPHANUMERIC_WITH_ROUND_BRACES_REGEX;
109995
110111
  exports.ALPHA_NUM_EXTENDED_REGEX = ALPHA_NUM_EXTENDED_REGEX;
109996
110112
  exports.ALPHA_NUM_REGEX = ALPHA_NUM_REGEX;
@@ -110227,6 +110343,7 @@ exports.truncateText = truncateText;
110227
110343
  exports.updateTreeState = updateTreeState;
110228
110344
  exports.useBeforeUnload = useBeforeUnload;
110229
110345
  exports.useClickOutside = useClickOutside;
110346
+ exports.useConditionalLock = useConditionalLock;
110230
110347
  exports.useFileDropzone = useFileDropzone;
110231
110348
  exports.useKeyboardActions = useKeyboardActions;
110232
110349
  exports.useTheme = useTheme;