sag_components 2.0.0-beta326 → 2.0.0-beta327

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.esm.js CHANGED
@@ -9297,6 +9297,34 @@ const CheckBoxNotCheckedIcon = _ref => {
9297
9297
  }));
9298
9298
  };
9299
9299
 
9300
+ const CheckBoxIndeterminateIcon = ({
9301
+ width = "16",
9302
+ height = "16",
9303
+ color = "#1B30AA"
9304
+ }) => {
9305
+ return /*#__PURE__*/React$1.createElement("svg", {
9306
+ width: width,
9307
+ height: height,
9308
+ viewBox: "0 0 13 13",
9309
+ fill: "none",
9310
+ xmlns: "http://www.w3.org/2000/svg"
9311
+ }, /*#__PURE__*/React$1.createElement("rect", {
9312
+ x: "0.5",
9313
+ y: "0.642578",
9314
+ width: "12.25",
9315
+ height: "12.25",
9316
+ rx: "1.75",
9317
+ fill: color
9318
+ }), /*#__PURE__*/React$1.createElement("rect", {
9319
+ x: "3",
9320
+ y: "5.892578",
9321
+ width: "7.25",
9322
+ height: "2",
9323
+ rx: "1",
9324
+ fill: "white"
9325
+ }));
9326
+ };
9327
+
9300
9328
  /* eslint-disable no-nested-ternary */
9301
9329
  const scrollableStyles$d = `
9302
9330
  overflow-y: auto;
@@ -9535,7 +9563,8 @@ const DropdownMultiNew = ({
9535
9563
  checkBoxColor,
9536
9564
  showLabelOnTop,
9537
9565
  orderBy,
9538
- elementType
9566
+ elementType,
9567
+ showSelectAll = false
9539
9568
  }) => {
9540
9569
  const [isFocused, setIsFocused] = useState(false);
9541
9570
  const [showOptions, setShowOptions] = useState(false);
@@ -9641,6 +9670,22 @@ const DropdownMultiNew = ({
9641
9670
  setIsFocused(true);
9642
9671
  }
9643
9672
  };
9673
+ const allSelected = options?.length > 0 && selectedOptions.length === options.length;
9674
+ const someSelected = selectedOptions.length > 0 && selectedOptions.length < options.length;
9675
+ const handleSelectAllClick = () => {
9676
+ if (disabled) return;
9677
+ if (allSelected || someSelected) {
9678
+ setSelectedOptions([]);
9679
+ onChange({
9680
+ newValue: []
9681
+ });
9682
+ } else {
9683
+ setSelectedOptions(options);
9684
+ onChange({
9685
+ newValue: options
9686
+ });
9687
+ }
9688
+ };
9644
9689
  const handleClearClick = () => {
9645
9690
  if (disabled) return;
9646
9691
  setSelectedOptions([]);
@@ -9776,7 +9821,25 @@ const DropdownMultiNew = ({
9776
9821
  showabove: showAbove,
9777
9822
  disabled: disabled,
9778
9823
  filteredoptions: filteredOptions
9779
- }, filteredOptions.map(option => /*#__PURE__*/React$1.createElement(OptionItem$2, {
9824
+ }, showSelectAll && /*#__PURE__*/React$1.createElement(OptionItem$2, {
9825
+ className: "OptionItem",
9826
+ onClick: handleSelectAllClick,
9827
+ selected: allSelected
9828
+ }, /*#__PURE__*/React$1.createElement(IconContainer$4, {
9829
+ className: "IconContainer"
9830
+ }, allSelected ? /*#__PURE__*/React$1.createElement(CheckBoxCheckedIcon, {
9831
+ width: "14px",
9832
+ height: "14px",
9833
+ color: disabled ? "#888" : checkBoxColor
9834
+ }) : someSelected ? /*#__PURE__*/React$1.createElement(CheckBoxIndeterminateIcon, {
9835
+ width: "14px",
9836
+ height: "14px",
9837
+ color: disabled ? "#888" : checkBoxColor
9838
+ }) : /*#__PURE__*/React$1.createElement(CheckBoxNotCheckedIcon, {
9839
+ width: "14px",
9840
+ height: "14px",
9841
+ color: disabled ? "#888" : "#212121"
9842
+ })), "Select All"), filteredOptions.map(option => /*#__PURE__*/React$1.createElement(OptionItem$2, {
9780
9843
  className: "OptionItem",
9781
9844
  key: option.value,
9782
9845
  onClick: () => toggleOption(option),
@@ -9834,7 +9897,8 @@ const DropdownNew = props => {
9834
9897
  errorMessage = "",
9835
9898
  labelColor = "#066768",
9836
9899
  checkBoxColor = "#229E38",
9837
- xIconShow = true
9900
+ xIconShow = true,
9901
+ showSelectAll = false
9838
9902
  } = props;
9839
9903
  const handleOnChange = event => {
9840
9904
  if (event && event.newValue && event.newValue[0]) {
@@ -9870,7 +9934,8 @@ const DropdownNew = props => {
9870
9934
  onChange: handleOnChange,
9871
9935
  showLabelOnTop: showLabelOnTop,
9872
9936
  orderBy: orderBy,
9873
- elementType: elementType
9937
+ elementType: elementType,
9938
+ showSelectAll: showSelectAll
9874
9939
  }) : /*#__PURE__*/React$1.createElement(DropdownSingleNew, {
9875
9940
  className: "DropdownSingleNew",
9876
9941
  placeHolder: placeHolder,
@@ -10649,24 +10714,23 @@ const QuarterPopupPicker = ({
10649
10714
  };
10650
10715
 
10651
10716
  /* eslint-disable import/no-extraneous-dependencies */
10652
- const QuarterPicker = _ref => {
10653
- let {
10654
- availableQuarters,
10655
- // ["Q1-2024"]
10656
- label,
10657
- onChange,
10658
- borderRadius,
10659
- required,
10660
- width,
10661
- height,
10662
- placeholder,
10663
- disabled,
10664
- borderColor,
10665
- borderColorFocus,
10666
- textColor,
10667
- selectedValue,
10668
- startYear
10669
- } = _ref;
10717
+ const QuarterPicker = ({
10718
+ availableQuarters,
10719
+ // ["Q1-2024"]
10720
+ label,
10721
+ onChange,
10722
+ borderRadius,
10723
+ required,
10724
+ width,
10725
+ height,
10726
+ placeholder,
10727
+ disabled,
10728
+ borderColor,
10729
+ borderColorFocus,
10730
+ textColor,
10731
+ selectedValue,
10732
+ startYear
10733
+ }) => {
10670
10734
  const [isFocused, setIsFocused] = useState(false);
10671
10735
  const [isOpen, setIsOpen] = useState(false);
10672
10736
  const [value, setValue] = useState('');
@@ -11108,23 +11172,22 @@ const MonthPopupPicker = ({
11108
11172
  };
11109
11173
 
11110
11174
  /* eslint-disable import/no-extraneous-dependencies */
11111
- const MonthPicker = _ref => {
11112
- let {
11113
- availableMonths,
11114
- label,
11115
- onChange,
11116
- borderRadius,
11117
- required,
11118
- width,
11119
- height,
11120
- placeholder,
11121
- disabled,
11122
- borderColor,
11123
- borderColorFocus,
11124
- textColor,
11125
- selectedValue,
11126
- startYear
11127
- } = _ref;
11175
+ const MonthPicker = ({
11176
+ availableMonths,
11177
+ label,
11178
+ onChange,
11179
+ borderRadius,
11180
+ required,
11181
+ width,
11182
+ height,
11183
+ placeholder,
11184
+ disabled,
11185
+ borderColor,
11186
+ borderColorFocus,
11187
+ textColor,
11188
+ selectedValue,
11189
+ startYear
11190
+ }) => {
11128
11191
  const [isFocused, setIsFocused] = useState(false);
11129
11192
  const [isOpen, setIsOpen] = useState(false);
11130
11193
  const [value, setValue] = useState('');
@@ -11790,7 +11853,8 @@ const FilterPanel = props => {
11790
11853
  onChange: eventDropdownMulti => onChangeDropdownMultiHandler(eventDropdownMulti, item),
11791
11854
  options: item.dropdownOptions || [],
11792
11855
  width: "100%",
11793
- height: dropdownHeight
11856
+ height: dropdownHeight,
11857
+ showSelectAll: item.showSelectAll
11794
11858
  });
11795
11859
  break;
11796
11860
  case 'datepicker':
@@ -12330,16 +12394,13 @@ const Td$1 = styled.td`
12330
12394
  `;
12331
12395
  const Tr = styled.tr`
12332
12396
  border-bottom: 1px solid #f3f4f6;
12333
- ${_ref => {
12334
- let {
12335
- enableHover,
12336
- selectHoverColor
12337
- } = _ref;
12338
- return enableHover && `&:hover {
12397
+ ${({
12398
+ enableHover,
12399
+ selectHoverColor
12400
+ }) => enableHover && `&:hover {
12339
12401
  background-color: ${selectHoverColor};
12340
12402
  cursor: pointer;
12341
- }`;
12342
- }}
12403
+ }`}
12343
12404
  `;
12344
12405
  const InfoText = styled.div`
12345
12406
  font-weight: 400;
@@ -24241,24 +24302,23 @@ const DeleteIcon = styled.div`
24241
24302
  position: absolute;
24242
24303
  `;
24243
24304
 
24244
- const QuickFilterDropdownSingle = _ref => {
24245
- let {
24246
- label,
24247
- hoverColor,
24248
- options,
24249
- selectedValue,
24250
- placeHolder,
24251
- optionHoverColor = '#edf6ff',
24252
- selectedOptionColor = "#C7E4FF",
24253
- onChange,
24254
- disabled,
24255
- width,
24256
- error,
24257
- errorMessage,
24258
- xIconShow,
24259
- labelColor,
24260
- showLabelOnTop
24261
- } = _ref;
24305
+ const QuickFilterDropdownSingle = ({
24306
+ label,
24307
+ hoverColor,
24308
+ options,
24309
+ selectedValue,
24310
+ placeHolder,
24311
+ optionHoverColor = '#edf6ff',
24312
+ selectedOptionColor = "#C7E4FF",
24313
+ onChange,
24314
+ disabled,
24315
+ width,
24316
+ error,
24317
+ errorMessage,
24318
+ xIconShow,
24319
+ labelColor,
24320
+ showLabelOnTop
24321
+ }) => {
24262
24322
  const [isFocused, setIsFocused] = useState(false);
24263
24323
  const [showOptions, setShowOptions] = useState(false);
24264
24324
  const [inputValue, setInputValue] = useState("");
@@ -24716,27 +24776,26 @@ const IconContainer$2 = styled.div`
24716
24776
  cursor: pointer;
24717
24777
  `;
24718
24778
 
24719
- const QuickFilterDropdownMultiSelection = _ref => {
24720
- let {
24721
- label,
24722
- labelEmptyValue,
24723
- options,
24724
- selectedValue,
24725
- placeHolder,
24726
- onChange,
24727
- required,
24728
- disabled,
24729
- width,
24730
- height,
24731
- error,
24732
- errorMessage,
24733
- labelColor,
24734
- optionHoverColor = '#edf6ff',
24735
- xIconShow,
24736
- checkBoxColor,
24737
- showLabelOnTop,
24738
- dropdownHeight
24739
- } = _ref;
24779
+ const QuickFilterDropdownMultiSelection = ({
24780
+ label,
24781
+ labelEmptyValue,
24782
+ options,
24783
+ selectedValue,
24784
+ placeHolder,
24785
+ onChange,
24786
+ required,
24787
+ disabled,
24788
+ width,
24789
+ height,
24790
+ error,
24791
+ errorMessage,
24792
+ labelColor,
24793
+ optionHoverColor = '#edf6ff',
24794
+ xIconShow,
24795
+ checkBoxColor,
24796
+ showLabelOnTop,
24797
+ dropdownHeight
24798
+ }) => {
24740
24799
  const [isFocused, setIsFocused] = useState(false);
24741
24800
  const [showOptions, setShowOptions] = useState(false);
24742
24801
  const [inputValue, setInputValue] = useState('');
@@ -36287,9 +36346,9 @@ const ToggleSlider = styled.span`
36287
36346
  }
36288
36347
  `;
36289
36348
 
36290
- /**
36291
- * ToggleSwitch component for on/off states.
36292
- * Supports small/large sizes and disabled state.
36349
+ /**
36350
+ * ToggleSwitch component for on/off states.
36351
+ * Supports small/large sizes and disabled state.
36293
36352
  */
36294
36353
  function ToggleSwitch(_ref) {
36295
36354
  let {