@innovaccer/design-system 2.17.0 → 2.19.0

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
@@ -1,8 +1,8 @@
1
1
 
2
2
  /**
3
- * Generated on: 1690223583277
3
+ * Generated on: 1692978951414
4
4
  * Package: @innovaccer/design-system
5
- * Version: v2.17.0
5
+ * Version: v2.19.0
6
6
  * License: MIT
7
7
  * Docs: https://innovaccer.github.io/design-system
8
8
  */
@@ -2269,12 +2269,13 @@
2269
2269
  _onKeyDown = _a.onKeyDown,
2270
2270
  _b = _a.role,
2271
2271
  role = _b === void 0 ? 'button' : _b,
2272
- rest = __rest(_a, ["onClick", "onKeyDown", "role"]);
2272
+ tabIndex = _a.tabIndex,
2273
+ rest = __rest(_a, ["onClick", "onKeyDown", "role", "tabIndex"]);
2273
2274
 
2274
2275
  return __assign({}, onClick ? {
2275
2276
  onClick: onClick,
2276
2277
  role: role,
2277
- tabIndex: 0,
2278
+ tabIndex: tabIndex || 0,
2278
2279
  'aria-label': rest['aria-label'],
2279
2280
  onKeyDown: function onKeyDown(e) {
2280
2281
  if (_onKeyDown) {
@@ -2294,6 +2295,7 @@
2294
2295
  }
2295
2296
  } : {
2296
2297
  role: role,
2298
+ tabIndex: tabIndex,
2297
2299
  'aria-label': rest['aria-label']
2298
2300
  });
2299
2301
  };
@@ -2396,7 +2398,8 @@
2396
2398
  className = props.className,
2397
2399
  selected = props.selected,
2398
2400
  onClose = props.onClose,
2399
- onClick = props.onClick;
2401
+ onClick = props.onClick,
2402
+ labelPrefix = props.labelPrefix;
2400
2403
  var baseProps = extractBaseProps(props);
2401
2404
 
2402
2405
  var iconClass = function iconClass(align) {
@@ -2430,11 +2433,16 @@
2430
2433
 
2431
2434
  var renderLabel = function renderLabel() {
2432
2435
  if (typeof label === 'string') {
2433
- return /*#__PURE__*/React__namespace.createElement(Text, {
2436
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, labelPrefix && /*#__PURE__*/React__namespace.createElement(Text, {
2437
+ "data-test": "DesignSystem-GenericChip--LabelPrefix",
2438
+ weight: "medium",
2439
+ color: textColor,
2440
+ className: "Chip-text mr-3"
2441
+ }, labelPrefix), /*#__PURE__*/React__namespace.createElement(Text, {
2434
2442
  "data-test": "DesignSystem-GenericChip--Text",
2435
2443
  color: textColor,
2436
2444
  className: "Chip-text"
2437
- }, label);
2445
+ }, label));
2438
2446
  }
2439
2447
 
2440
2448
  return label;
@@ -2478,7 +2486,8 @@
2478
2486
  onClose = props.onClose,
2479
2487
  onClick = props.onClick,
2480
2488
  name = props.name,
2481
- className = props.className;
2489
+ className = props.className,
2490
+ labelPrefix = props.labelPrefix;
2482
2491
  var baseProps = extractBaseProps(props);
2483
2492
 
2484
2493
  var onCloseHandler = function onCloseHandler() {
@@ -2505,7 +2514,8 @@
2505
2514
  className: chipClass,
2506
2515
  onClose: onCloseHandler,
2507
2516
  onClick: onClickHandler,
2508
- name: name
2517
+ name: name,
2518
+ labelPrefix: labelPrefix
2509
2519
  }));
2510
2520
  };
2511
2521
  Chip.displayName = 'Chip';
@@ -2990,7 +3000,8 @@
2990
3000
  showTodayDate = _b === void 0 ? true : _b,
2991
3001
  _c = _a.children,
2992
3002
  children = _c === void 0 ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null) : _c,
2993
- rest = __rest(_a, ["date", "open", "position", "inputFormat", "outputFormat", "inputOptions", "validators", "withInput", "disabledBefore", "disabledAfter", "onDateChange", "closeOnSelect", "size", "showTodayDate", "children"]);
3003
+ view = _a.view,
3004
+ rest = __rest(_a, ["date", "open", "position", "inputFormat", "outputFormat", "inputOptions", "validators", "withInput", "disabledBefore", "disabledAfter", "onDateChange", "closeOnSelect", "size", "showTodayDate", "children", "view"]);
2994
3005
 
2995
3006
  var date = this.state.date;
2996
3007
  var months = config.months;
@@ -3014,16 +3025,23 @@
3014
3025
  return !isTodayDateDisabled;
3015
3026
  };
3016
3027
 
3028
+ var todayChipClass = classNames__default["default"]({
3029
+ 'd-flex justify-content-center': true,
3030
+ 'pb-5': size === 'small',
3031
+ 'pb-6': size === 'large',
3032
+ 'pt-3': size === 'large' && view === 'year'
3033
+ });
3017
3034
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
3018
3035
  className: "d-flex"
3019
3036
  }, children, /*#__PURE__*/React__namespace.createElement(Calendar, __assign({}, rest, {
3020
3037
  size: size,
3021
3038
  date: currDate,
3039
+ view: view,
3022
3040
  disabledBefore: dateDisabledBefore,
3023
3041
  disabledAfter: dateDisabledAfter,
3024
3042
  onDateChange: this.onDateChangeHandler
3025
3043
  }))), showTodayDate && /*#__PURE__*/React__namespace.createElement("div", {
3026
- className: "d-flex justify-content-center pb-6",
3044
+ className: todayChipClass,
3027
3045
  "data-test": "DesignSystem-Select--TodaysDate-wrapper"
3028
3046
  }, /*#__PURE__*/React__namespace.createElement(Chip, {
3029
3047
  label: "Today, " + todayMonthAndDate,
@@ -3618,7 +3636,8 @@
3618
3636
  showDuration = props.showDuration,
3619
3637
  noResultMessage = props.noResultMessage,
3620
3638
  disabledSlotList = props.disabledSlotList,
3621
- fetchTimeOptions = props.fetchTimeOptions;
3639
+ fetchTimeOptions = props.fetchTimeOptions,
3640
+ error = props.error;
3622
3641
 
3623
3642
  var _a = React__namespace.useState(0),
3624
3643
  tabIndex = _a[0],
@@ -3710,7 +3729,8 @@
3710
3729
  staticLimit: dropdownOptionList.length,
3711
3730
  onPopperToggle: function onPopperToggle() {
3712
3731
  setOpenPopover(!openPopover);
3713
- }
3732
+ },
3733
+ error: error
3714
3734
  });
3715
3735
  };
3716
3736
  TimePickerWithSearch.defaultProps = {
@@ -3725,7 +3745,8 @@
3725
3745
  inputFormat = props.inputFormat,
3726
3746
  outputFormat = props.outputFormat,
3727
3747
  onTimeChange = props.onTimeChange,
3728
- timeProp = props.time;
3748
+ timeProp = props.time,
3749
+ error = props.error;
3729
3750
 
3730
3751
  var _a = React__namespace.useState(timeProp),
3731
3752
  time$1 = _a[0],
@@ -3794,6 +3815,7 @@
3794
3815
  onChange: onChangeHandler,
3795
3816
  onClear: onClearHandler,
3796
3817
  onBlur: onBlurHandler,
3818
+ error: error,
3797
3819
  id: "parent-TimePicker"
3798
3820
  }));
3799
3821
  };
@@ -6299,6 +6321,7 @@
6299
6321
  'd-flex flex-column flex-grow-1': true
6300
6322
  }, className);
6301
6323
  }, [className]);
6324
+ var isValueEqualPlaceholder = value === defaultPlaceholderValue;
6302
6325
  return /*#__PURE__*/React__namespace.createElement("div", {
6303
6326
  className: classes,
6304
6327
  "data-test": "DesignSystem-InputMask--Wrapper"
@@ -6308,7 +6331,7 @@
6308
6331
  required: required,
6309
6332
  onFocus: onFocusHandler,
6310
6333
  onChange: onChangeHandler,
6311
- onClear: onClearHandler,
6334
+ onClear: !isValueEqualPlaceholder ? onClearHandler : undefined,
6312
6335
  onBlur: onBlurHandler,
6313
6336
  onPaste: onPasteHandler,
6314
6337
  autoComplete: 'off',
@@ -6388,7 +6411,7 @@
6388
6411
  "data-test": "DesignSystem-Label--Text",
6389
6412
  className: classes,
6390
6413
  componentType: "label"
6391
- }, rest), children), renderInfo(required, optional), info && renderIndicator(info));
6414
+ }, rest), children, renderInfo(required, optional), info && renderIndicator(info)));
6392
6415
  };
6393
6416
  Label.displayName = 'Label';
6394
6417
 
@@ -8488,7 +8511,7 @@
8488
8511
  }, [value]);
8489
8512
  var ChipInputClass = classNames__default["default"]((_a = {
8490
8513
  ChipInput: true
8491
- }, _a['ChipInput--disabled'] = disabled, _a['ChipInput--withChips'] = chips.length > 0, _a), className);
8514
+ }, _a['ChipInput--disabled'] = disabled, _a['ChipInput--withChips'] = chips && chips.length > 0, _a), className);
8492
8515
 
8493
8516
  var onUpdateChips = function onUpdateChips(updatedChips) {
8494
8517
  if (onChange) onChange(updatedChips);
@@ -8574,7 +8597,7 @@
8574
8597
  type: type,
8575
8598
  disabled: disabled,
8576
8599
  key: index,
8577
- className: "my-2 mx-2",
8600
+ className: "my-3 mx-2",
8578
8601
  onClick: function onClick() {
8579
8602
  return _onClick && _onClick(chip, index);
8580
8603
  },
@@ -8583,11 +8606,15 @@
8583
8606
  }
8584
8607
  }, rest));
8585
8608
  });
8586
- return /*#__PURE__*/React__namespace.createElement("div", __assign({
8609
+ return /*#__PURE__*/React__namespace.createElement("div", {
8610
+ "data-test": "DesignSystem-ChipInput--Border",
8611
+ className: "ChipInput-border"
8612
+ }, /*#__PURE__*/React__namespace.createElement("div", __assign({
8587
8613
  "data-test": "DesignSystem-ChipInput"
8588
8614
  }, baseProps, {
8589
8615
  className: ChipInputClass,
8590
- onClick: onClickHandler
8616
+ onClick: onClickHandler,
8617
+ tabIndex: disabled ? -1 : 0
8591
8618
  }), /*#__PURE__*/React__namespace.createElement("div", {
8592
8619
  className: "ChipInput-wrapper"
8593
8620
  }, chips && chips.length > 0 && chipComponents, /*#__PURE__*/React__namespace.createElement("input", {
@@ -8595,7 +8622,7 @@
8595
8622
  ref: inputRef,
8596
8623
  className: "ChipInput-input",
8597
8624
  autoFocus: autoFocus,
8598
- placeholder: placeholder,
8625
+ placeholder: chips && chips.length > 0 ? '' : placeholder,
8599
8626
  disabled: disabled,
8600
8627
  value: inputValue,
8601
8628
  onBlur: onBlur,
@@ -8605,10 +8632,11 @@
8605
8632
  })), chips.length > 0 && /*#__PURE__*/React__namespace.createElement(Icon, {
8606
8633
  "data-test": "DesignSystem-ChipInput--Icon",
8607
8634
  name: "close",
8608
- appearance: "subtle",
8635
+ appearance: disabled ? 'disabled' : 'subtle',
8609
8636
  className: "ChipInput-icon",
8610
- onClick: onDeleteAllHandler
8611
- }));
8637
+ onClick: onDeleteAllHandler,
8638
+ tabIndex: disabled ? -1 : 0
8639
+ })));
8612
8640
  };
8613
8641
  ChipInput.displayName = 'ChipInput';
8614
8642
  ChipInput.defaultProps = {
@@ -10520,15 +10548,10 @@
10520
10548
  position: "right",
10521
10549
  className: "px-6 py-6 d-flex align-items-center",
10522
10550
  on: "hover"
10523
- }, /*#__PURE__*/React__namespace.createElement(Icon, {
10524
- name: "error",
10525
- appearance: 'alert',
10526
- className: "mr-4"
10527
- }), /*#__PURE__*/React__namespace.createElement(Text, {
10528
- "data-test": "DesignSystem-EditableInput--ErrorPopper",
10529
- appearance: "destructive",
10530
- weight: "medium"
10531
- }, errorMessage)) : inputComponent;
10551
+ }, /*#__PURE__*/React__namespace.createElement(InlineMessage, {
10552
+ appearance: "alert",
10553
+ description: errorMessage
10554
+ })) : inputComponent;
10532
10555
  }
10533
10556
 
10534
10557
  return /*#__PURE__*/React__namespace.createElement("div", {
@@ -13426,22 +13449,6 @@
13426
13449
  }));
13427
13450
  var GridProvider = context.Provider;
13428
13451
 
13429
- var GridNestedRow = function GridNestedRow(props) {
13430
- var context$1 = React__namespace.useContext(context);
13431
- var schema = context$1.schema,
13432
- loading = context$1.loading,
13433
- nestedRowRenderer = context$1.nestedRowRenderer;
13434
- var data = props.data,
13435
- rowIndex = props.rowIndex;
13436
- if (nestedRowRenderer) return nestedRowRenderer({
13437
- data: data,
13438
- schema: schema,
13439
- loading: loading,
13440
- rowIndex: rowIndex
13441
- });
13442
- return null;
13443
- };
13444
-
13445
13452
  var HeaderCell = function HeaderCell(props) {
13446
13453
  var context$1 = React__namespace.useContext(context);
13447
13454
  var schema = props.schema,
@@ -13626,7 +13633,8 @@
13626
13633
  schema = props.schema,
13627
13634
  expandedState = props.expandedState,
13628
13635
  rowIndex = props.rowIndex,
13629
- colIndex = props.colIndex;
13636
+ colIndex = props.colIndex,
13637
+ nestedRowData = props.nestedRowData;
13630
13638
  var size = context$1.size,
13631
13639
  loading = context$1.loading,
13632
13640
  nestedRows = context$1.nestedRows;
@@ -13641,20 +13649,15 @@
13641
13649
  loading: loading,
13642
13650
  expanded: expanded
13643
13651
  };
13644
- var nestedProps = {
13645
- data: data,
13646
- rowIndex: rowIndex
13647
- };
13648
- var isNestedRowDisabled = !GridNestedRow(nestedProps);
13649
13652
  return /*#__PURE__*/React__namespace.createElement("div", {
13650
13653
  className: "Grid-cellContent"
13651
- }, colIndex === 0 && nestedRows && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, !isNestedRowDisabled ? /*#__PURE__*/React__namespace.createElement(Icon, {
13654
+ }, colIndex === 0 && nestedRows && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, nestedRowData ? /*#__PURE__*/React__namespace.createElement(Icon, {
13652
13655
  className: 'Grid-nestedRowTrigger',
13653
13656
  name: expanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
13654
13657
  size: 20,
13655
13658
  appearance: 'default',
13656
13659
  onClick: function onClick(e) {
13657
- if (!isNestedRowDisabled) {
13660
+ if (nestedRowData) {
13658
13661
  e.stopPropagation();
13659
13662
  setExpanded(!expanded);
13660
13663
  }
@@ -13680,7 +13683,8 @@
13680
13683
  onMenuChange = _a.onMenuChange,
13681
13684
  onFilterChange = _a.onFilterChange,
13682
13685
  updateColumnSchema = _a.updateColumnSchema,
13683
- reorderColumn = _a.reorderColumn;
13686
+ reorderColumn = _a.reorderColumn,
13687
+ nestedRowData = _a.nestedRowData;
13684
13688
  var draggable = context$1.draggable,
13685
13689
  separator = context$1.separator,
13686
13690
  nestedRows = context$1.nestedRows,
@@ -13778,7 +13782,8 @@
13778
13782
  colIndex: colIndex,
13779
13783
  data: data,
13780
13784
  schema: schema,
13781
- expandedState: expandedState
13785
+ expandedState: expandedState,
13786
+ nestedRowData: nestedRowData
13782
13787
  }));
13783
13788
  };
13784
13789
 
@@ -13854,6 +13859,24 @@
13854
13859
  }, renderSchema(leftPinnedSchema, !!leftPinnedSchema.length, 'left'), renderSchema(unpinnedSchema, !leftPinnedSchema.length && !!unpinnedSchema.length), renderSchema(rightPinnedSchema, false, 'right')));
13855
13860
  };
13856
13861
 
13862
+ var GridNestedRow = function GridNestedRow(props) {
13863
+ var context$1 = React__namespace.useContext(context);
13864
+ var schema = context$1.schema,
13865
+ loading = context$1.loading,
13866
+ nestedRowRenderer = context$1.nestedRowRenderer;
13867
+ var data = props.data,
13868
+ rowIndex = props.rowIndex,
13869
+ expanded = props.expanded;
13870
+ if (nestedRowRenderer) return nestedRowRenderer({
13871
+ data: data,
13872
+ schema: schema,
13873
+ loading: loading,
13874
+ rowIndex: rowIndex,
13875
+ expanded: expanded
13876
+ });
13877
+ return null;
13878
+ };
13879
+
13857
13880
  var GridRow = function GridRow(props) {
13858
13881
  var context$1 = React__namespace.useContext(context);
13859
13882
  var type = context$1.type,
@@ -13895,6 +13918,12 @@
13895
13918
  var unpinnedSchema = schema.filter(function (s) {
13896
13919
  return !s.hidden && !s.pinned;
13897
13920
  });
13921
+ var nestedProps = {
13922
+ data: data,
13923
+ rowIndex: rI,
13924
+ expanded: expanded
13925
+ };
13926
+ var nestedRowData = GridNestedRow(nestedProps);
13898
13927
 
13899
13928
  var renderCheckbox = function renderCheckbox(show) {
13900
13929
  if (!show || !withCheckbox) return null;
@@ -13932,7 +13961,8 @@
13932
13961
  firstCell: !index,
13933
13962
  schema: s,
13934
13963
  data: data,
13935
- expandedState: [expanded, setExpanded]
13964
+ expandedState: [expanded, setExpanded],
13965
+ nestedRowData: nestedRowData
13936
13966
  });
13937
13967
  }));
13938
13968
  }
@@ -13952,10 +13982,7 @@
13952
13982
  ref: rowRef
13953
13983
  }, renderSchema(leftPinnedSchema, !!leftPinnedSchema.length, 'left'), renderSchema(unpinnedSchema, !leftPinnedSchema.length && !!unpinnedSchema.length), renderSchema(rightPinnedSchema, false, 'right')), nestedRows && expanded && /*#__PURE__*/React__namespace.createElement("div", {
13954
13984
  className: "Grid-nestedRow"
13955
- }, /*#__PURE__*/React__namespace.createElement(GridNestedRow, {
13956
- data: data,
13957
- rowIndex: rI
13958
- })));
13985
+ }, nestedRowData));
13959
13986
  };
13960
13987
  GridRow.defaultProps = {
13961
13988
  data: {}
@@ -16132,7 +16159,7 @@
16132
16159
  iconAlign: 'left'
16133
16160
  };
16134
16161
 
16135
- var version = "2.17.0";
16162
+ var version = "2.19.0";
16136
16163
 
16137
16164
  exports.Avatar = Avatar;
16138
16165
  exports.AvatarGroup = AvatarGroup;