sag_components 2.0.0-beta153 → 2.0.0-beta155

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 {
@@ -38365,22 +38369,35 @@ const TagContainer = styled.div`
38365
38369
  display: flex;
38366
38370
  flex-wrap: wrap;
38367
38371
  gap: 4px;
38368
- align-items: flex-start;
38372
+ align-items: center; /* Center items vertically */
38373
+ justify-content: flex-start;
38369
38374
  max-width: 100%;
38370
38375
  line-height: 1.5;
38376
+ min-height: 32px; /* Ensure minimum height for centering */
38377
+ `;
38378
+ const TagChipTextWrapper = styled.div`
38379
+ padding: 0 8px; /* Add consistent padding on left and right */
38380
+ white-space: nowrap;
38381
+ overflow: hidden;
38382
+ text-overflow: ellipsis;
38383
+ max-width: 100%;
38371
38384
  `;
38372
38385
  const TagChip = styled.span`
38373
38386
  display: inline-flex;
38374
38387
  align-items: center;
38375
- padding: 2px 8px;
38388
+ padding: 2px 0px;
38376
38389
  font-size: 12px;
38377
38390
  font-weight: 500;
38378
38391
  border-radius: 9999px; /* Tailwind's rounded-full */
38379
- white-space: nowrap;
38380
38392
  font-family: "Poppins", sans-serif;
38381
38393
  border: 1px solid;
38382
38394
  line-height: 1.3;
38383
38395
 
38396
+ /* Handle min/max width - support minWidth */
38397
+ min-width: ${props => props.$minWidth || "auto"};
38398
+ max-width: ${props => props.$maxWidth || "100px"};
38399
+ width: ${props => props.$minWidth ? props.$minWidth : "auto"};
38400
+
38384
38401
  /* Dynamic colors via CSS custom properties */
38385
38402
  background-color: ${props => props.$backgroundColor || '#F3F4F6'};
38386
38403
  color: ${props => props.$textColor || '#374151'};
@@ -38418,7 +38435,8 @@ const MultiTagWrapper = styled.div`
38418
38435
  flex-wrap: wrap;
38419
38436
  gap: 4px;
38420
38437
  max-width: 100%;
38421
- align-items: flex-start;
38438
+ align-items: center; /* Center multiple tags vertically */
38439
+ min-height: 32px; /* Ensure minimum height for centering */
38422
38440
  `;
38423
38441
  const TextareaWrapper = styled.div`
38424
38442
  position: relative;
@@ -38910,33 +38928,30 @@ const TableBody = ({
38910
38928
  const maxDisplay = tagConfig.maxDisplay || 3;
38911
38929
  const isMultiple = tagConfig.multiple !== false; // Default to true
38912
38930
 
38913
- // Handle single tag
38914
- if (typeof value === 'string') {
38915
- const colorConfig = colors[value] || defaultColor;
38916
- return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(TagChip, {
38931
+ // Helper function to create a tag chip with proper tooltip
38932
+ const createTagChip = (tagValue, index = 0) => {
38933
+ const colorConfig = colors[tagValue] || defaultColor;
38934
+ const formattedText = formatTagText(tagValue);
38935
+ return /*#__PURE__*/React$1.createElement(TagChip, {
38936
+ key: `${tagValue}-${index}`,
38917
38937
  $backgroundColor: colorConfig.bg,
38918
38938
  $textColor: colorConfig.text,
38919
38939
  $borderColor: colorConfig.border,
38920
38940
  $interactive: false,
38921
- title: value
38922
- }, formatTagText(value)));
38941
+ title: formattedText // Always show full text in tooltip
38942
+ }, /*#__PURE__*/React$1.createElement(TagChipTextWrapper, null, formattedText));
38943
+ };
38944
+
38945
+ // Handle single tag
38946
+ if (typeof value === 'string') {
38947
+ return /*#__PURE__*/React$1.createElement(TagContainer, null, createTagChip(value));
38923
38948
  }
38924
38949
 
38925
38950
  // Handle multiple tags
38926
38951
  if (Array.isArray(value) && isMultiple) {
38927
38952
  const visibleTags = value.slice(0, maxDisplay);
38928
38953
  const remainingCount = value.length - maxDisplay;
38929
- return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
38930
- const colorConfig = colors[tag] || defaultColor;
38931
- return /*#__PURE__*/React$1.createElement(TagChip, {
38932
- key: `${tag}-${index}`,
38933
- $backgroundColor: colorConfig.bg,
38934
- $textColor: colorConfig.text,
38935
- $borderColor: colorConfig.border,
38936
- $interactive: false,
38937
- title: tag
38938
- }, formatTagText(tag));
38939
- }), remainingCount > 0 && /*#__PURE__*/React$1.createElement(TagOverflow, {
38954
+ return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => createTagChip(tag, index)), remainingCount > 0 && /*#__PURE__*/React$1.createElement(TagOverflow, {
38940
38955
  title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
38941
38956
  }, "+", remainingCount)));
38942
38957
  }
@@ -42702,6 +42717,10 @@ const CustomTooltip = styled(Tooltip$2)`
42702
42717
  &::before {
42703
42718
  left: 90%;
42704
42719
  }
42720
+ ${props => props.trashIcon && `width: 150px;
42721
+ white-space: normal;
42722
+ max-height: 50px;
42723
+ margin-top: 8px;`}
42705
42724
  }
42706
42725
  `;
42707
42726
  const Container$1 = styled.div`
@@ -42719,7 +42738,9 @@ const Trash$1 = styled.div`
42719
42738
  height: 24px;
42720
42739
  padding: 0 12px;
42721
42740
  cursor: pointer;
42722
-
42741
+ ${props => props.disabled && `opacity: 0.5;
42742
+ pointer-events: none;
42743
+ user-select: none;`};
42723
42744
  svg {
42724
42745
  pointer-events: none;
42725
42746
  }
@@ -52028,6 +52049,7 @@ const ItemManagerPanel = _ref => {
52028
52049
  linkColor = "#212121",
52029
52050
  backgroundColor = 'white',
52030
52051
  buttonTooltipText = "Please fill out all forms before sending.",
52052
+ trashTooltipText = 'Package cannot be deleted since it has been sent to the vendor as a form.',
52031
52053
  maxVisibleVendors = 12
52032
52054
  } = _ref;
52033
52055
  const [screen, setScreen] = useState("initial");
@@ -52265,6 +52287,7 @@ const ItemManagerPanel = _ref => {
52265
52287
  headerHeight: headerHeight
52266
52288
  }, /*#__PURE__*/React$1.createElement(VendorList$2, null, itemAndPackage.filter(item => item.packages !== null).map((item, idx) => {
52267
52289
  const packagesLength = item.packages.length;
52290
+ const sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
52268
52291
  return /*#__PURE__*/React$1.createElement(VendorItem$1, {
52269
52292
  key: idx
52270
52293
  }, /*#__PURE__*/React$1.createElement(DotContainer, null, packagesLength === 0 && /*#__PURE__*/React$1.createElement(RedDot, null)), /*#__PURE__*/React$1.createElement(LineContainer, {
@@ -52272,14 +52295,20 @@ const ItemManagerPanel = _ref => {
52272
52295
  handleVendorClick(item);
52273
52296
  }
52274
52297
  }, /*#__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
52298
  const noPackagesSent = sentPackagesLength === 0;
52277
52299
  if (noPackagesSent) {
52278
52300
  return `0/${packagesLength} sent`;
52279
52301
  } else {
52280
52302
  return `${sentPackagesLength}/${packagesLength} sent`;
52281
52303
  }
52282
- })())), /*#__PURE__*/React$1.createElement(VendorChevron$1, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React$1.createElement(Trash$1, {
52304
+ })())), /*#__PURE__*/React$1.createElement(VendorChevron$1, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React$1.createElement(CustomTooltip, {
52305
+ hideTooltip: !sentPackagesLength > 0,
52306
+ content: trashTooltipText,
52307
+ topFactor: 2,
52308
+ direction: "left",
52309
+ trashIcon: true
52310
+ }, /*#__PURE__*/React$1.createElement(Trash$1, {
52311
+ disabled: sentPackagesLength > 0,
52283
52312
  className: "trash-icon",
52284
52313
  onClick: () => {
52285
52314
  onDeleteVendor(item);
@@ -52292,7 +52321,7 @@ const ItemManagerPanel = _ref => {
52292
52321
  xmlns: "http://www.w3.org/2000/svg"
52293
52322
  }, /*#__PURE__*/React$1.createElement("path", {
52294
52323
  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
- }))));
52324
+ })))));
52296
52325
  }))));
52297
52326
  }
52298
52327
  };