sag_components 2.0.0-beta152 → 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.js CHANGED
@@ -3109,6 +3109,25 @@ const InfoIcon = _ref => {
3109
3109
  }));
3110
3110
  };
3111
3111
 
3112
+ const UploadIcon = _ref => {
3113
+ let {
3114
+ clicked,
3115
+ color = '#757575',
3116
+ width = '18',
3117
+ height = '18'
3118
+ } = _ref;
3119
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
3120
+ width: width,
3121
+ height: height,
3122
+ viewBox: "0 0 16 16",
3123
+ fill: "none",
3124
+ xmlns: "http://www.w3.org/2000/svg"
3125
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
3126
+ d: "M9.3125 1.65625C9.3125 1.30078 9.58594 1 9.96875 1H14.3164C14.6992 1 14.9727 1.30078 14.9727 1.65625V6.03125C14.9727 6.41406 14.6992 6.6875 14.3164 6.6875C13.9609 6.6875 13.6602 6.41406 13.6602 6.03125V3.24219L7.5625 9.33984C7.31641 9.61328 6.90625 9.61328 6.66016 9.33984C6.38672 9.09375 6.38672 8.68359 6.66016 8.41016L12.7578 2.3125H9.96875C9.58594 2.3125 9.3125 2.03906 9.3125 1.65625ZM2.96875 1.875H6.46875C6.82422 1.875 7.125 2.17578 7.125 2.53125C7.125 2.91406 6.82422 3.1875 6.46875 3.1875H2.96875C2.58594 3.1875 2.3125 3.48828 2.3125 3.84375V13.0312C2.3125 13.4141 2.58594 13.6875 2.96875 13.6875H12.1562C12.5117 13.6875 12.8125 13.4141 12.8125 13.0312V9.53125C12.8125 9.17578 13.0859 8.875 13.4688 8.875C13.8242 8.875 14.125 9.17578 14.125 9.53125V13.0312C14.125 14.125 13.2227 15 12.1562 15H2.96875C1.875 15 1 14.125 1 13.0312V3.84375C1 2.77734 1.875 1.875 2.96875 1.875Z",
3127
+ fill: color
3128
+ }));
3129
+ };
3130
+
3112
3131
  const LinkButton = _ref => {
3113
3132
  let {
3114
3133
  text = '',
@@ -3262,6 +3281,14 @@ const LinkButton = _ref => {
3262
3281
  width: iconWidth,
3263
3282
  color: color
3264
3283
  }));
3284
+ case 'upload':
3285
+ return /*#__PURE__*/React__default["default"].createElement(IconWrapper$4, {
3286
+ className: "UploadIcon"
3287
+ }, /*#__PURE__*/React__default["default"].createElement(UploadIcon, {
3288
+ height: iconHeight,
3289
+ width: iconWidth,
3290
+ color: color
3291
+ }));
3265
3292
  default:
3266
3293
  return '';
3267
3294
  }
@@ -42689,6 +42716,10 @@ const CustomTooltip = styled__default["default"](Tooltip$2)`
42689
42716
  &::before {
42690
42717
  left: 90%;
42691
42718
  }
42719
+ ${props => props.trashIcon && `width: 150px;
42720
+ white-space: normal;
42721
+ max-height: 50px;
42722
+ margin-top: 8px;`}
42692
42723
  }
42693
42724
  `;
42694
42725
  const Container$1 = styled__default["default"].div`
@@ -42706,7 +42737,9 @@ const Trash$1 = styled__default["default"].div`
42706
42737
  height: 24px;
42707
42738
  padding: 0 12px;
42708
42739
  cursor: pointer;
42709
-
42740
+ ${props => props.disabled && `opacity: 0.5;
42741
+ pointer-events: none;
42742
+ user-select: none;`};
42710
42743
  svg {
42711
42744
  pointer-events: none;
42712
42745
  }
@@ -52015,6 +52048,7 @@ const ItemManagerPanel = _ref => {
52015
52048
  linkColor = "#212121",
52016
52049
  backgroundColor = 'white',
52017
52050
  buttonTooltipText = "Please fill out all forms before sending.",
52051
+ trashTooltipText = 'Package cannot be deleted since it has been sent to the vendor as a form.',
52018
52052
  maxVisibleVendors = 12
52019
52053
  } = _ref;
52020
52054
  const [screen, setScreen] = React$1.useState("initial");
@@ -52252,6 +52286,7 @@ const ItemManagerPanel = _ref => {
52252
52286
  headerHeight: headerHeight
52253
52287
  }, /*#__PURE__*/React__default["default"].createElement(VendorList$2, null, itemAndPackage.filter(item => item.packages !== null).map((item, idx) => {
52254
52288
  const packagesLength = item.packages.length;
52289
+ const sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
52255
52290
  return /*#__PURE__*/React__default["default"].createElement(VendorItem$1, {
52256
52291
  key: idx
52257
52292
  }, /*#__PURE__*/React__default["default"].createElement(DotContainer, null, packagesLength === 0 && /*#__PURE__*/React__default["default"].createElement(RedDot, null)), /*#__PURE__*/React__default["default"].createElement(LineContainer, {
@@ -52259,14 +52294,20 @@ const ItemManagerPanel = _ref => {
52259
52294
  handleVendorClick(item);
52260
52295
  }
52261
52296
  }, /*#__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, (() => {
52262
- const sentPackagesLength = item.packages.filter(pkg => hasValidStatus(pkg) && !draftPackages(pkg)).length;
52263
52297
  const noPackagesSent = sentPackagesLength === 0;
52264
52298
  if (noPackagesSent) {
52265
52299
  return `0/${packagesLength} sent`;
52266
52300
  } else {
52267
52301
  return `${sentPackagesLength}/${packagesLength} sent`;
52268
52302
  }
52269
- })())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React__default["default"].createElement(Trash$1, {
52303
+ })())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React__default["default"].createElement(CustomTooltip, {
52304
+ hideTooltip: !sentPackagesLength > 0,
52305
+ content: trashTooltipText,
52306
+ topFactor: 2,
52307
+ direction: "left",
52308
+ trashIcon: true
52309
+ }, /*#__PURE__*/React__default["default"].createElement(Trash$1, {
52310
+ disabled: sentPackagesLength > 0,
52270
52311
  className: "trash-icon",
52271
52312
  onClick: () => {
52272
52313
  onDeleteVendor(item);
@@ -52279,7 +52320,7 @@ const ItemManagerPanel = _ref => {
52279
52320
  xmlns: "http://www.w3.org/2000/svg"
52280
52321
  }, /*#__PURE__*/React__default["default"].createElement("path", {
52281
52322
  d: "M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z"
52282
- }))));
52323
+ })))));
52283
52324
  }))));
52284
52325
  }
52285
52326
  };