sag_components 2.0.0-beta153 → 2.0.0-beta154

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 CHANGED
@@ -1509,7 +1509,7 @@ declare function RangePop(props: any): react_jsx_runtime.JSX.Element;
1509
1509
 
1510
1510
  declare function SearchInput(props: any): react_jsx_runtime.JSX.Element;
1511
1511
 
1512
- declare function ItemManagerPanel({ width, height, disableSection, onSendForms, editMode, disabledSendForms, AllFormsSent, itemAndPackage, setItemAndPackage, linkColor, backgroundColor, buttonTooltipText, maxVisibleVendors }: {
1512
+ declare function ItemManagerPanel({ width, height, disableSection, onSendForms, editMode, disabledSendForms, AllFormsSent, itemAndPackage, setItemAndPackage, linkColor, backgroundColor, buttonTooltipText, trashTooltipText, maxVisibleVendors }: {
1513
1513
  width?: string;
1514
1514
  height?: string;
1515
1515
  disableSection?: boolean;
@@ -1522,6 +1522,7 @@ declare function ItemManagerPanel({ width, height, disableSection, onSendForms,
1522
1522
  linkColor?: string;
1523
1523
  backgroundColor?: string;
1524
1524
  buttonTooltipText?: string;
1525
+ trashTooltipText?: string;
1525
1526
  maxVisibleVendors?: number;
1526
1527
  }): react_jsx_runtime.JSX.Element;
1527
1528
 
package/dist/index.esm.js CHANGED
@@ -10347,23 +10347,24 @@ const QuarterPopupPicker = ({
10347
10347
  };
10348
10348
 
10349
10349
  /* eslint-disable import/no-extraneous-dependencies */
10350
- const QuarterPicker = ({
10351
- availableQuarters,
10352
- // ["Q1-2024"]
10353
- label,
10354
- onChange,
10355
- borderRadius,
10356
- required,
10357
- width,
10358
- height,
10359
- placeholder,
10360
- disabled,
10361
- borderColor,
10362
- borderColorFocus,
10363
- textColor,
10364
- selectedValue,
10365
- startYear
10366
- }) => {
10350
+ const QuarterPicker = _ref => {
10351
+ let {
10352
+ availableQuarters,
10353
+ // ["Q1-2024"]
10354
+ label,
10355
+ onChange,
10356
+ borderRadius,
10357
+ required,
10358
+ width,
10359
+ height,
10360
+ placeholder,
10361
+ disabled,
10362
+ borderColor,
10363
+ borderColorFocus,
10364
+ textColor,
10365
+ selectedValue,
10366
+ startYear
10367
+ } = _ref;
10367
10368
  const [isFocused, setIsFocused] = useState(false);
10368
10369
  const [isOpen, setIsOpen] = useState(false);
10369
10370
  const [value, setValue] = useState('');
@@ -10805,22 +10806,23 @@ const MonthPopupPicker = ({
10805
10806
  };
10806
10807
 
10807
10808
  /* eslint-disable import/no-extraneous-dependencies */
10808
- const MonthPicker = ({
10809
- availableMonths,
10810
- label,
10811
- onChange,
10812
- borderRadius,
10813
- required,
10814
- width,
10815
- height,
10816
- placeholder,
10817
- disabled,
10818
- borderColor,
10819
- borderColorFocus,
10820
- textColor,
10821
- selectedValue,
10822
- startYear
10823
- }) => {
10809
+ const MonthPicker = _ref => {
10810
+ let {
10811
+ availableMonths,
10812
+ label,
10813
+ onChange,
10814
+ borderRadius,
10815
+ required,
10816
+ width,
10817
+ height,
10818
+ placeholder,
10819
+ disabled,
10820
+ borderColor,
10821
+ borderColorFocus,
10822
+ textColor,
10823
+ selectedValue,
10824
+ startYear
10825
+ } = _ref;
10824
10826
  const [isFocused, setIsFocused] = useState(false);
10825
10827
  const [isOpen, setIsOpen] = useState(false);
10826
10828
  const [value, setValue] = useState('');
@@ -23931,21 +23933,22 @@ const DeleteIcon = styled.div`
23931
23933
  position: absolute;
23932
23934
  `;
23933
23935
 
23934
- const QuickFilterDropdownSingle = ({
23935
- label,
23936
- hoverColor,
23937
- options,
23938
- selectedValue,
23939
- placeHolder,
23940
- onChange,
23941
- disabled,
23942
- width,
23943
- error,
23944
- errorMessage,
23945
- xIconShow,
23946
- labelColor,
23947
- showLabelOnTop
23948
- }) => {
23936
+ const QuickFilterDropdownSingle = _ref => {
23937
+ let {
23938
+ label,
23939
+ hoverColor,
23940
+ options,
23941
+ selectedValue,
23942
+ placeHolder,
23943
+ onChange,
23944
+ disabled,
23945
+ width,
23946
+ error,
23947
+ errorMessage,
23948
+ xIconShow,
23949
+ labelColor,
23950
+ showLabelOnTop
23951
+ } = _ref;
23949
23952
  const [isFocused, setIsFocused] = useState(false);
23950
23953
  const [showOptions, setShowOptions] = useState(false);
23951
23954
  const [inputValue, setInputValue] = useState("");
@@ -24342,23 +24345,24 @@ const IconContainer$2 = styled.div`
24342
24345
  cursor: pointer;
24343
24346
  `;
24344
24347
 
24345
- const QuickFilterDropdownMultiSelection = ({
24346
- label,
24347
- labelEmptyValue,
24348
- options,
24349
- selectedValue,
24350
- placeHolder,
24351
- onChange,
24352
- required,
24353
- disabled,
24354
- width,
24355
- error,
24356
- errorMessage,
24357
- labelColor,
24358
- xIconShow,
24359
- checkBoxColor,
24360
- showLabelOnTop
24361
- }) => {
24348
+ const QuickFilterDropdownMultiSelection = _ref => {
24349
+ let {
24350
+ label,
24351
+ labelEmptyValue,
24352
+ options,
24353
+ selectedValue,
24354
+ placeHolder,
24355
+ onChange,
24356
+ required,
24357
+ disabled,
24358
+ width,
24359
+ error,
24360
+ errorMessage,
24361
+ labelColor,
24362
+ xIconShow,
24363
+ checkBoxColor,
24364
+ showLabelOnTop
24365
+ } = _ref;
24362
24366
  const [isFocused, setIsFocused] = useState(false);
24363
24367
  const [showOptions, setShowOptions] = useState(false);
24364
24368
  const [inputValue, setInputValue] = useState('');
@@ -35590,9 +35594,9 @@ const ToggleSlider = styled.span`
35590
35594
  }
35591
35595
  `;
35592
35596
 
35593
- /**
35594
- * ToggleSwitch component for on/off states.
35595
- * Supports small/large sizes and disabled state.
35597
+ /**
35598
+ * ToggleSwitch component for on/off states.
35599
+ * Supports small/large sizes and disabled state.
35596
35600
  */
35597
35601
  function ToggleSwitch(_ref) {
35598
35602
  let {
@@ -42702,6 +42706,10 @@ const CustomTooltip = styled(Tooltip$2)`
42702
42706
  &::before {
42703
42707
  left: 90%;
42704
42708
  }
42709
+ ${props => props.trashIcon && `width: 150px;
42710
+ white-space: normal;
42711
+ max-height: 50px;
42712
+ margin-top: 8px;`}
42705
42713
  }
42706
42714
  `;
42707
42715
  const Container$1 = styled.div`
@@ -42719,7 +42727,9 @@ const Trash$1 = styled.div`
42719
42727
  height: 24px;
42720
42728
  padding: 0 12px;
42721
42729
  cursor: pointer;
42722
-
42730
+ ${props => props.disabled && `opacity: 0.5;
42731
+ pointer-events: none;
42732
+ user-select: none;`};
42723
42733
  svg {
42724
42734
  pointer-events: none;
42725
42735
  }
@@ -52028,6 +52038,7 @@ const ItemManagerPanel = _ref => {
52028
52038
  linkColor = "#212121",
52029
52039
  backgroundColor = 'white',
52030
52040
  buttonTooltipText = "Please fill out all forms before sending.",
52041
+ trashTooltipText = 'Package cannot be deleted since it has been sent to the vendor as a form.',
52031
52042
  maxVisibleVendors = 12
52032
52043
  } = _ref;
52033
52044
  const [screen, setScreen] = useState("initial");
@@ -52265,6 +52276,7 @@ const ItemManagerPanel = _ref => {
52265
52276
  headerHeight: headerHeight
52266
52277
  }, /*#__PURE__*/React$1.createElement(VendorList$2, null, itemAndPackage.filter(item => item.packages !== null).map((item, idx) => {
52267
52278
  const packagesLength = item.packages.length;
52279
+ const sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
52268
52280
  return /*#__PURE__*/React$1.createElement(VendorItem$1, {
52269
52281
  key: idx
52270
52282
  }, /*#__PURE__*/React$1.createElement(DotContainer, null, packagesLength === 0 && /*#__PURE__*/React$1.createElement(RedDot, null)), /*#__PURE__*/React$1.createElement(LineContainer, {
@@ -52272,14 +52284,20 @@ const ItemManagerPanel = _ref => {
52272
52284
  handleVendorClick(item);
52273
52285
  }
52274
52286
  }, /*#__PURE__*/React$1.createElement(VendorNameAndPackagesContainer$1, null, /*#__PURE__*/React$1.createElement(VendorName$2, null, item.name), packagesLength === 0 && /*#__PURE__*/React$1.createElement(Subtitle$1, null, "No Packages"), packagesLength > 0 && /*#__PURE__*/React$1.createElement(Subtitle$1, null, (() => {
52275
- const sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
52276
52287
  const noPackagesSent = sentPackagesLength === 0;
52277
52288
  if (noPackagesSent) {
52278
52289
  return `0/${packagesLength} sent`;
52279
52290
  } else {
52280
52291
  return `${sentPackagesLength}/${packagesLength} sent`;
52281
52292
  }
52282
- })())), /*#__PURE__*/React$1.createElement(VendorChevron$1, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React$1.createElement(Trash$1, {
52293
+ })())), /*#__PURE__*/React$1.createElement(VendorChevron$1, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React$1.createElement(CustomTooltip, {
52294
+ hideTooltip: !sentPackagesLength > 0,
52295
+ content: trashTooltipText,
52296
+ topFactor: 2,
52297
+ direction: "left",
52298
+ trashIcon: true
52299
+ }, /*#__PURE__*/React$1.createElement(Trash$1, {
52300
+ disabled: sentPackagesLength > 0,
52283
52301
  className: "trash-icon",
52284
52302
  onClick: () => {
52285
52303
  onDeleteVendor(item);
@@ -52292,7 +52310,7 @@ const ItemManagerPanel = _ref => {
52292
52310
  xmlns: "http://www.w3.org/2000/svg"
52293
52311
  }, /*#__PURE__*/React$1.createElement("path", {
52294
52312
  d: "M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z"
52295
- }))));
52313
+ })))));
52296
52314
  }))));
52297
52315
  }
52298
52316
  };