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.js CHANGED
@@ -10357,23 +10357,24 @@ const QuarterPopupPicker = ({
10357
10357
  };
10358
10358
 
10359
10359
  /* eslint-disable import/no-extraneous-dependencies */
10360
- const QuarterPicker = ({
10361
- availableQuarters,
10362
- // ["Q1-2024"]
10363
- label,
10364
- onChange,
10365
- borderRadius,
10366
- required,
10367
- width,
10368
- height,
10369
- placeholder,
10370
- disabled,
10371
- borderColor,
10372
- borderColorFocus,
10373
- textColor,
10374
- selectedValue,
10375
- startYear
10376
- }) => {
10360
+ const QuarterPicker = _ref => {
10361
+ let {
10362
+ availableQuarters,
10363
+ // ["Q1-2024"]
10364
+ label,
10365
+ onChange,
10366
+ borderRadius,
10367
+ required,
10368
+ width,
10369
+ height,
10370
+ placeholder,
10371
+ disabled,
10372
+ borderColor,
10373
+ borderColorFocus,
10374
+ textColor,
10375
+ selectedValue,
10376
+ startYear
10377
+ } = _ref;
10377
10378
  const [isFocused, setIsFocused] = React$1.useState(false);
10378
10379
  const [isOpen, setIsOpen] = React$1.useState(false);
10379
10380
  const [value, setValue] = React$1.useState('');
@@ -10815,22 +10816,23 @@ const MonthPopupPicker = ({
10815
10816
  };
10816
10817
 
10817
10818
  /* eslint-disable import/no-extraneous-dependencies */
10818
- const MonthPicker = ({
10819
- availableMonths,
10820
- label,
10821
- onChange,
10822
- borderRadius,
10823
- required,
10824
- width,
10825
- height,
10826
- placeholder,
10827
- disabled,
10828
- borderColor,
10829
- borderColorFocus,
10830
- textColor,
10831
- selectedValue,
10832
- startYear
10833
- }) => {
10819
+ const MonthPicker = _ref => {
10820
+ let {
10821
+ availableMonths,
10822
+ label,
10823
+ onChange,
10824
+ borderRadius,
10825
+ required,
10826
+ width,
10827
+ height,
10828
+ placeholder,
10829
+ disabled,
10830
+ borderColor,
10831
+ borderColorFocus,
10832
+ textColor,
10833
+ selectedValue,
10834
+ startYear
10835
+ } = _ref;
10834
10836
  const [isFocused, setIsFocused] = React$1.useState(false);
10835
10837
  const [isOpen, setIsOpen] = React$1.useState(false);
10836
10838
  const [value, setValue] = React$1.useState('');
@@ -23941,21 +23943,22 @@ const DeleteIcon = styled__default["default"].div`
23941
23943
  position: absolute;
23942
23944
  `;
23943
23945
 
23944
- const QuickFilterDropdownSingle = ({
23945
- label,
23946
- hoverColor,
23947
- options,
23948
- selectedValue,
23949
- placeHolder,
23950
- onChange,
23951
- disabled,
23952
- width,
23953
- error,
23954
- errorMessage,
23955
- xIconShow,
23956
- labelColor,
23957
- showLabelOnTop
23958
- }) => {
23946
+ const QuickFilterDropdownSingle = _ref => {
23947
+ let {
23948
+ label,
23949
+ hoverColor,
23950
+ options,
23951
+ selectedValue,
23952
+ placeHolder,
23953
+ onChange,
23954
+ disabled,
23955
+ width,
23956
+ error,
23957
+ errorMessage,
23958
+ xIconShow,
23959
+ labelColor,
23960
+ showLabelOnTop
23961
+ } = _ref;
23959
23962
  const [isFocused, setIsFocused] = React$1.useState(false);
23960
23963
  const [showOptions, setShowOptions] = React$1.useState(false);
23961
23964
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24352,23 +24355,24 @@ const IconContainer$2 = styled__default["default"].div`
24352
24355
  cursor: pointer;
24353
24356
  `;
24354
24357
 
24355
- const QuickFilterDropdownMultiSelection = ({
24356
- label,
24357
- labelEmptyValue,
24358
- options,
24359
- selectedValue,
24360
- placeHolder,
24361
- onChange,
24362
- required,
24363
- disabled,
24364
- width,
24365
- error,
24366
- errorMessage,
24367
- labelColor,
24368
- xIconShow,
24369
- checkBoxColor,
24370
- showLabelOnTop
24371
- }) => {
24358
+ const QuickFilterDropdownMultiSelection = _ref => {
24359
+ let {
24360
+ label,
24361
+ labelEmptyValue,
24362
+ options,
24363
+ selectedValue,
24364
+ placeHolder,
24365
+ onChange,
24366
+ required,
24367
+ disabled,
24368
+ width,
24369
+ error,
24370
+ errorMessage,
24371
+ labelColor,
24372
+ xIconShow,
24373
+ checkBoxColor,
24374
+ showLabelOnTop
24375
+ } = _ref;
24372
24376
  const [isFocused, setIsFocused] = React$1.useState(false);
24373
24377
  const [showOptions, setShowOptions] = React$1.useState(false);
24374
24378
  const [inputValue, setInputValue] = React$1.useState('');
@@ -35600,9 +35604,9 @@ const ToggleSlider = styled__default["default"].span`
35600
35604
  }
35601
35605
  `;
35602
35606
 
35603
- /**
35604
- * ToggleSwitch component for on/off states.
35605
- * Supports small/large sizes and disabled state.
35607
+ /**
35608
+ * ToggleSwitch component for on/off states.
35609
+ * Supports small/large sizes and disabled state.
35606
35610
  */
35607
35611
  function ToggleSwitch(_ref) {
35608
35612
  let {
@@ -38375,22 +38379,35 @@ const TagContainer = styled__default["default"].div`
38375
38379
  display: flex;
38376
38380
  flex-wrap: wrap;
38377
38381
  gap: 4px;
38378
- align-items: flex-start;
38382
+ align-items: center; /* Center items vertically */
38383
+ justify-content: flex-start;
38379
38384
  max-width: 100%;
38380
38385
  line-height: 1.5;
38386
+ min-height: 32px; /* Ensure minimum height for centering */
38387
+ `;
38388
+ const TagChipTextWrapper = styled__default["default"].div`
38389
+ padding: 0 8px; /* Add consistent padding on left and right */
38390
+ white-space: nowrap;
38391
+ overflow: hidden;
38392
+ text-overflow: ellipsis;
38393
+ max-width: 100%;
38381
38394
  `;
38382
38395
  const TagChip = styled__default["default"].span`
38383
38396
  display: inline-flex;
38384
38397
  align-items: center;
38385
- padding: 2px 8px;
38398
+ padding: 2px 0px;
38386
38399
  font-size: 12px;
38387
38400
  font-weight: 500;
38388
38401
  border-radius: 9999px; /* Tailwind's rounded-full */
38389
- white-space: nowrap;
38390
38402
  font-family: "Poppins", sans-serif;
38391
38403
  border: 1px solid;
38392
38404
  line-height: 1.3;
38393
38405
 
38406
+ /* Handle min/max width - support minWidth */
38407
+ min-width: ${props => props.$minWidth || "auto"};
38408
+ max-width: ${props => props.$maxWidth || "100px"};
38409
+ width: ${props => props.$minWidth ? props.$minWidth : "auto"};
38410
+
38394
38411
  /* Dynamic colors via CSS custom properties */
38395
38412
  background-color: ${props => props.$backgroundColor || '#F3F4F6'};
38396
38413
  color: ${props => props.$textColor || '#374151'};
@@ -38428,7 +38445,8 @@ const MultiTagWrapper = styled__default["default"].div`
38428
38445
  flex-wrap: wrap;
38429
38446
  gap: 4px;
38430
38447
  max-width: 100%;
38431
- align-items: flex-start;
38448
+ align-items: center; /* Center multiple tags vertically */
38449
+ min-height: 32px; /* Ensure minimum height for centering */
38432
38450
  `;
38433
38451
  const TextareaWrapper = styled__default["default"].div`
38434
38452
  position: relative;
@@ -38920,33 +38938,30 @@ const TableBody = ({
38920
38938
  const maxDisplay = tagConfig.maxDisplay || 3;
38921
38939
  const isMultiple = tagConfig.multiple !== false; // Default to true
38922
38940
 
38923
- // Handle single tag
38924
- if (typeof value === 'string') {
38925
- const colorConfig = colors[value] || defaultColor;
38926
- return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(TagChip, {
38941
+ // Helper function to create a tag chip with proper tooltip
38942
+ const createTagChip = (tagValue, index = 0) => {
38943
+ const colorConfig = colors[tagValue] || defaultColor;
38944
+ const formattedText = formatTagText(tagValue);
38945
+ return /*#__PURE__*/React__default["default"].createElement(TagChip, {
38946
+ key: `${tagValue}-${index}`,
38927
38947
  $backgroundColor: colorConfig.bg,
38928
38948
  $textColor: colorConfig.text,
38929
38949
  $borderColor: colorConfig.border,
38930
38950
  $interactive: false,
38931
- title: value
38932
- }, formatTagText(value)));
38951
+ title: formattedText // Always show full text in tooltip
38952
+ }, /*#__PURE__*/React__default["default"].createElement(TagChipTextWrapper, null, formattedText));
38953
+ };
38954
+
38955
+ // Handle single tag
38956
+ if (typeof value === 'string') {
38957
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, createTagChip(value));
38933
38958
  }
38934
38959
 
38935
38960
  // Handle multiple tags
38936
38961
  if (Array.isArray(value) && isMultiple) {
38937
38962
  const visibleTags = value.slice(0, maxDisplay);
38938
38963
  const remainingCount = value.length - maxDisplay;
38939
- return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
38940
- const colorConfig = colors[tag] || defaultColor;
38941
- return /*#__PURE__*/React__default["default"].createElement(TagChip, {
38942
- key: `${tag}-${index}`,
38943
- $backgroundColor: colorConfig.bg,
38944
- $textColor: colorConfig.text,
38945
- $borderColor: colorConfig.border,
38946
- $interactive: false,
38947
- title: tag
38948
- }, formatTagText(tag));
38949
- }), remainingCount > 0 && /*#__PURE__*/React__default["default"].createElement(TagOverflow, {
38964
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => createTagChip(tag, index)), remainingCount > 0 && /*#__PURE__*/React__default["default"].createElement(TagOverflow, {
38950
38965
  title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
38951
38966
  }, "+", remainingCount)));
38952
38967
  }
@@ -42712,6 +42727,10 @@ const CustomTooltip = styled__default["default"](Tooltip$2)`
42712
42727
  &::before {
42713
42728
  left: 90%;
42714
42729
  }
42730
+ ${props => props.trashIcon && `width: 150px;
42731
+ white-space: normal;
42732
+ max-height: 50px;
42733
+ margin-top: 8px;`}
42715
42734
  }
42716
42735
  `;
42717
42736
  const Container$1 = styled__default["default"].div`
@@ -42729,7 +42748,9 @@ const Trash$1 = styled__default["default"].div`
42729
42748
  height: 24px;
42730
42749
  padding: 0 12px;
42731
42750
  cursor: pointer;
42732
-
42751
+ ${props => props.disabled && `opacity: 0.5;
42752
+ pointer-events: none;
42753
+ user-select: none;`};
42733
42754
  svg {
42734
42755
  pointer-events: none;
42735
42756
  }
@@ -52038,6 +52059,7 @@ const ItemManagerPanel = _ref => {
52038
52059
  linkColor = "#212121",
52039
52060
  backgroundColor = 'white',
52040
52061
  buttonTooltipText = "Please fill out all forms before sending.",
52062
+ trashTooltipText = 'Package cannot be deleted since it has been sent to the vendor as a form.',
52041
52063
  maxVisibleVendors = 12
52042
52064
  } = _ref;
52043
52065
  const [screen, setScreen] = React$1.useState("initial");
@@ -52275,6 +52297,7 @@ const ItemManagerPanel = _ref => {
52275
52297
  headerHeight: headerHeight
52276
52298
  }, /*#__PURE__*/React__default["default"].createElement(VendorList$2, null, itemAndPackage.filter(item => item.packages !== null).map((item, idx) => {
52277
52299
  const packagesLength = item.packages.length;
52300
+ const sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
52278
52301
  return /*#__PURE__*/React__default["default"].createElement(VendorItem$1, {
52279
52302
  key: idx
52280
52303
  }, /*#__PURE__*/React__default["default"].createElement(DotContainer, null, packagesLength === 0 && /*#__PURE__*/React__default["default"].createElement(RedDot, null)), /*#__PURE__*/React__default["default"].createElement(LineContainer, {
@@ -52282,14 +52305,20 @@ const ItemManagerPanel = _ref => {
52282
52305
  handleVendorClick(item);
52283
52306
  }
52284
52307
  }, /*#__PURE__*/React__default["default"].createElement(VendorNameAndPackagesContainer$1, null, /*#__PURE__*/React__default["default"].createElement(VendorName$2, null, item.name), packagesLength === 0 && /*#__PURE__*/React__default["default"].createElement(Subtitle$1, null, "No Packages"), packagesLength > 0 && /*#__PURE__*/React__default["default"].createElement(Subtitle$1, null, (() => {
52285
- const sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
52286
52308
  const noPackagesSent = sentPackagesLength === 0;
52287
52309
  if (noPackagesSent) {
52288
52310
  return `0/${packagesLength} sent`;
52289
52311
  } else {
52290
52312
  return `${sentPackagesLength}/${packagesLength} sent`;
52291
52313
  }
52292
- })())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React__default["default"].createElement(Trash$1, {
52314
+ })())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React__default["default"].createElement(CustomTooltip, {
52315
+ hideTooltip: !sentPackagesLength > 0,
52316
+ content: trashTooltipText,
52317
+ topFactor: 2,
52318
+ direction: "left",
52319
+ trashIcon: true
52320
+ }, /*#__PURE__*/React__default["default"].createElement(Trash$1, {
52321
+ disabled: sentPackagesLength > 0,
52293
52322
  className: "trash-icon",
52294
52323
  onClick: () => {
52295
52324
  onDeleteVendor(item);
@@ -52302,7 +52331,7 @@ const ItemManagerPanel = _ref => {
52302
52331
  xmlns: "http://www.w3.org/2000/svg"
52303
52332
  }, /*#__PURE__*/React__default["default"].createElement("path", {
52304
52333
  d: "M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z"
52305
- }))));
52334
+ })))));
52306
52335
  }))));
52307
52336
  }
52308
52337
  };