sag_components 2.0.0-beta326 → 2.0.0-beta328

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
@@ -9307,6 +9307,34 @@ const CheckBoxNotCheckedIcon = _ref => {
9307
9307
  }));
9308
9308
  };
9309
9309
 
9310
+ const CheckBoxIndeterminateIcon = ({
9311
+ width = "16",
9312
+ height = "16",
9313
+ color = "#1B30AA"
9314
+ }) => {
9315
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
9316
+ width: width,
9317
+ height: height,
9318
+ viewBox: "0 0 13 13",
9319
+ fill: "none",
9320
+ xmlns: "http://www.w3.org/2000/svg"
9321
+ }, /*#__PURE__*/React__default["default"].createElement("rect", {
9322
+ x: "0.5",
9323
+ y: "0.642578",
9324
+ width: "12.25",
9325
+ height: "12.25",
9326
+ rx: "1.75",
9327
+ fill: color
9328
+ }), /*#__PURE__*/React__default["default"].createElement("rect", {
9329
+ x: "3",
9330
+ y: "5.892578",
9331
+ width: "7.25",
9332
+ height: "2",
9333
+ rx: "1",
9334
+ fill: "white"
9335
+ }));
9336
+ };
9337
+
9310
9338
  /* eslint-disable no-nested-ternary */
9311
9339
  const scrollableStyles$d = `
9312
9340
  overflow-y: auto;
@@ -9545,7 +9573,8 @@ const DropdownMultiNew = ({
9545
9573
  checkBoxColor,
9546
9574
  showLabelOnTop,
9547
9575
  orderBy,
9548
- elementType
9576
+ elementType,
9577
+ showSelectAll = false
9549
9578
  }) => {
9550
9579
  const [isFocused, setIsFocused] = React$1.useState(false);
9551
9580
  const [showOptions, setShowOptions] = React$1.useState(false);
@@ -9651,6 +9680,22 @@ const DropdownMultiNew = ({
9651
9680
  setIsFocused(true);
9652
9681
  }
9653
9682
  };
9683
+ const allSelected = options?.length > 0 && selectedOptions.length === options.length;
9684
+ const someSelected = selectedOptions.length > 0 && selectedOptions.length < options.length;
9685
+ const handleSelectAllClick = () => {
9686
+ if (disabled) return;
9687
+ if (allSelected || someSelected) {
9688
+ setSelectedOptions([]);
9689
+ onChange({
9690
+ newValue: []
9691
+ });
9692
+ } else {
9693
+ setSelectedOptions(options);
9694
+ onChange({
9695
+ newValue: options
9696
+ });
9697
+ }
9698
+ };
9654
9699
  const handleClearClick = () => {
9655
9700
  if (disabled) return;
9656
9701
  setSelectedOptions([]);
@@ -9786,7 +9831,25 @@ const DropdownMultiNew = ({
9786
9831
  showabove: showAbove,
9787
9832
  disabled: disabled,
9788
9833
  filteredoptions: filteredOptions
9789
- }, filteredOptions.map(option => /*#__PURE__*/React__default["default"].createElement(OptionItem$2, {
9834
+ }, showSelectAll && /*#__PURE__*/React__default["default"].createElement(OptionItem$2, {
9835
+ className: "OptionItem",
9836
+ onClick: handleSelectAllClick,
9837
+ selected: allSelected
9838
+ }, /*#__PURE__*/React__default["default"].createElement(IconContainer$4, {
9839
+ className: "IconContainer"
9840
+ }, allSelected ? /*#__PURE__*/React__default["default"].createElement(CheckBoxCheckedIcon, {
9841
+ width: "14px",
9842
+ height: "14px",
9843
+ color: disabled ? "#888" : checkBoxColor
9844
+ }) : someSelected ? /*#__PURE__*/React__default["default"].createElement(CheckBoxIndeterminateIcon, {
9845
+ width: "14px",
9846
+ height: "14px",
9847
+ color: disabled ? "#888" : checkBoxColor
9848
+ }) : /*#__PURE__*/React__default["default"].createElement(CheckBoxNotCheckedIcon, {
9849
+ width: "14px",
9850
+ height: "14px",
9851
+ color: disabled ? "#888" : "#212121"
9852
+ })), "Select All"), filteredOptions.map(option => /*#__PURE__*/React__default["default"].createElement(OptionItem$2, {
9790
9853
  className: "OptionItem",
9791
9854
  key: option.value,
9792
9855
  onClick: () => toggleOption(option),
@@ -9844,7 +9907,8 @@ const DropdownNew = props => {
9844
9907
  errorMessage = "",
9845
9908
  labelColor = "#066768",
9846
9909
  checkBoxColor = "#229E38",
9847
- xIconShow = true
9910
+ xIconShow = true,
9911
+ showSelectAll = false
9848
9912
  } = props;
9849
9913
  const handleOnChange = event => {
9850
9914
  if (event && event.newValue && event.newValue[0]) {
@@ -9880,7 +9944,8 @@ const DropdownNew = props => {
9880
9944
  onChange: handleOnChange,
9881
9945
  showLabelOnTop: showLabelOnTop,
9882
9946
  orderBy: orderBy,
9883
- elementType: elementType
9947
+ elementType: elementType,
9948
+ showSelectAll: showSelectAll
9884
9949
  }) : /*#__PURE__*/React__default["default"].createElement(DropdownSingleNew, {
9885
9950
  className: "DropdownSingleNew",
9886
9951
  placeHolder: placeHolder,
@@ -10659,24 +10724,23 @@ const QuarterPopupPicker = ({
10659
10724
  };
10660
10725
 
10661
10726
  /* eslint-disable import/no-extraneous-dependencies */
10662
- const QuarterPicker = _ref => {
10663
- let {
10664
- availableQuarters,
10665
- // ["Q1-2024"]
10666
- label,
10667
- onChange,
10668
- borderRadius,
10669
- required,
10670
- width,
10671
- height,
10672
- placeholder,
10673
- disabled,
10674
- borderColor,
10675
- borderColorFocus,
10676
- textColor,
10677
- selectedValue,
10678
- startYear
10679
- } = _ref;
10727
+ const QuarterPicker = ({
10728
+ availableQuarters,
10729
+ // ["Q1-2024"]
10730
+ label,
10731
+ onChange,
10732
+ borderRadius,
10733
+ required,
10734
+ width,
10735
+ height,
10736
+ placeholder,
10737
+ disabled,
10738
+ borderColor,
10739
+ borderColorFocus,
10740
+ textColor,
10741
+ selectedValue,
10742
+ startYear
10743
+ }) => {
10680
10744
  const [isFocused, setIsFocused] = React$1.useState(false);
10681
10745
  const [isOpen, setIsOpen] = React$1.useState(false);
10682
10746
  const [value, setValue] = React$1.useState('');
@@ -11118,23 +11182,22 @@ const MonthPopupPicker = ({
11118
11182
  };
11119
11183
 
11120
11184
  /* eslint-disable import/no-extraneous-dependencies */
11121
- const MonthPicker = _ref => {
11122
- let {
11123
- availableMonths,
11124
- label,
11125
- onChange,
11126
- borderRadius,
11127
- required,
11128
- width,
11129
- height,
11130
- placeholder,
11131
- disabled,
11132
- borderColor,
11133
- borderColorFocus,
11134
- textColor,
11135
- selectedValue,
11136
- startYear
11137
- } = _ref;
11185
+ const MonthPicker = ({
11186
+ availableMonths,
11187
+ label,
11188
+ onChange,
11189
+ borderRadius,
11190
+ required,
11191
+ width,
11192
+ height,
11193
+ placeholder,
11194
+ disabled,
11195
+ borderColor,
11196
+ borderColorFocus,
11197
+ textColor,
11198
+ selectedValue,
11199
+ startYear
11200
+ }) => {
11138
11201
  const [isFocused, setIsFocused] = React$1.useState(false);
11139
11202
  const [isOpen, setIsOpen] = React$1.useState(false);
11140
11203
  const [value, setValue] = React$1.useState('');
@@ -11800,7 +11863,8 @@ const FilterPanel = props => {
11800
11863
  onChange: eventDropdownMulti => onChangeDropdownMultiHandler(eventDropdownMulti, item),
11801
11864
  options: item.dropdownOptions || [],
11802
11865
  width: "100%",
11803
- height: dropdownHeight
11866
+ height: dropdownHeight,
11867
+ showSelectAll: item.showSelectAll
11804
11868
  });
11805
11869
  break;
11806
11870
  case 'datepicker':
@@ -11984,6 +12048,7 @@ FilterPanel.propTypes = {
11984
12048
  placeHolder: PropTypes.string,
11985
12049
  xIconShow: PropTypes.bool,
11986
12050
  label: PropTypes.string,
12051
+ showSelectAll: PropTypes.bool,
11987
12052
  labelEmptyValue: PropTypes.string,
11988
12053
  name: PropTypes.string,
11989
12054
  periodPickerSelectedValue: PropTypes.string,
@@ -24251,24 +24316,23 @@ const DeleteIcon = styled__default["default"].div`
24251
24316
  position: absolute;
24252
24317
  `;
24253
24318
 
24254
- const QuickFilterDropdownSingle = _ref => {
24255
- let {
24256
- label,
24257
- hoverColor,
24258
- options,
24259
- selectedValue,
24260
- placeHolder,
24261
- optionHoverColor = '#edf6ff',
24262
- selectedOptionColor = "#C7E4FF",
24263
- onChange,
24264
- disabled,
24265
- width,
24266
- error,
24267
- errorMessage,
24268
- xIconShow,
24269
- labelColor,
24270
- showLabelOnTop
24271
- } = _ref;
24319
+ const QuickFilterDropdownSingle = ({
24320
+ label,
24321
+ hoverColor,
24322
+ options,
24323
+ selectedValue,
24324
+ placeHolder,
24325
+ optionHoverColor = '#edf6ff',
24326
+ selectedOptionColor = "#C7E4FF",
24327
+ onChange,
24328
+ disabled,
24329
+ width,
24330
+ error,
24331
+ errorMessage,
24332
+ xIconShow,
24333
+ labelColor,
24334
+ showLabelOnTop
24335
+ }) => {
24272
24336
  const [isFocused, setIsFocused] = React$1.useState(false);
24273
24337
  const [showOptions, setShowOptions] = React$1.useState(false);
24274
24338
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24726,27 +24790,26 @@ const IconContainer$2 = styled__default["default"].div`
24726
24790
  cursor: pointer;
24727
24791
  `;
24728
24792
 
24729
- const QuickFilterDropdownMultiSelection = _ref => {
24730
- let {
24731
- label,
24732
- labelEmptyValue,
24733
- options,
24734
- selectedValue,
24735
- placeHolder,
24736
- onChange,
24737
- required,
24738
- disabled,
24739
- width,
24740
- height,
24741
- error,
24742
- errorMessage,
24743
- labelColor,
24744
- optionHoverColor = '#edf6ff',
24745
- xIconShow,
24746
- checkBoxColor,
24747
- showLabelOnTop,
24748
- dropdownHeight
24749
- } = _ref;
24793
+ const QuickFilterDropdownMultiSelection = ({
24794
+ label,
24795
+ labelEmptyValue,
24796
+ options,
24797
+ selectedValue,
24798
+ placeHolder,
24799
+ onChange,
24800
+ required,
24801
+ disabled,
24802
+ width,
24803
+ height,
24804
+ error,
24805
+ errorMessage,
24806
+ labelColor,
24807
+ optionHoverColor = '#edf6ff',
24808
+ xIconShow,
24809
+ checkBoxColor,
24810
+ showLabelOnTop,
24811
+ dropdownHeight
24812
+ }) => {
24750
24813
  const [isFocused, setIsFocused] = React$1.useState(false);
24751
24814
  const [showOptions, setShowOptions] = React$1.useState(false);
24752
24815
  const [inputValue, setInputValue] = React$1.useState('');
@@ -36297,9 +36360,9 @@ const ToggleSlider = styled__default["default"].span`
36297
36360
  }
36298
36361
  `;
36299
36362
 
36300
- /**
36301
- * ToggleSwitch component for on/off states.
36302
- * Supports small/large sizes and disabled state.
36363
+ /**
36364
+ * ToggleSwitch component for on/off states.
36365
+ * Supports small/large sizes and disabled state.
36303
36366
  */
36304
36367
  function ToggleSwitch(_ref) {
36305
36368
  let {