@procore/data-table 14.32.0 → 14.33.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.
@@ -7995,31 +7995,15 @@ var styles_default = {
7995
7995
  "spin": "_spin_if78k_1"
7996
7996
  };
7997
7997
 
7998
- // src/utils/getCellValueTypographyProps.ts
7999
- function getCellValueTypographyProps(typographyProps) {
8000
- return {
8001
- intent: "small",
8002
- ...typographyProps ?? {}
8003
- };
8004
- }
8005
-
8006
7998
  // src/CellRenderers/BooleanCell.tsx
8007
7999
  var cx = classnames__default.default.bind(styles_default);
8008
- var InternalBooleanCellRenderer = ({ columnDefinition, isGroup, value }) => {
8000
+ var InternalBooleanCellRenderer = ({ isGroup, value, typographyProps }) => {
8009
8001
  const I18n = coreReact.useI18nContext();
8010
8002
  const internalValue = value ? I18n.t("dataTable.cells.booleanCell.options.yes") : I18n.t("dataTable.cells.booleanCell.options.no");
8011
8003
  if (isGroup) {
8012
8004
  return null;
8013
8005
  }
8014
- return /* @__PURE__ */ React80__default.default.createElement(
8015
- coreReact.Typography,
8016
- {
8017
- ...getCellValueTypographyProps(
8018
- columnDefinition.cellRendererParams?.typographyProps
8019
- )
8020
- },
8021
- internalValue
8022
- );
8006
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps }, internalValue);
8023
8007
  };
8024
8008
  var BooleanCellRenderer = withDataTableRenderer(
8025
8009
  InternalBooleanCellRenderer,
@@ -8060,12 +8044,13 @@ var BooleanCellEditor = withDataTableEditor(
8060
8044
  var Renderer = ({
8061
8045
  columnDefinition,
8062
8046
  rowPinned,
8047
+ buttons,
8063
8048
  ...props
8064
8049
  }) => {
8065
8050
  if (rowPinned) {
8066
8051
  return null;
8067
8052
  }
8068
- return /* @__PURE__ */ React80__default.default.createElement(coreReact.FlexList, { justifyContent: "center", alignItems: "center", size: "xs" }, columnDefinition.cellRendererParams.buttons.map((Button6) => /* @__PURE__ */ React80__default.default.createElement(
8053
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.FlexList, { justifyContent: "center", alignItems: "center", size: "xs" }, buttons.map((Button6) => /* @__PURE__ */ React80__default.default.createElement(
8069
8054
  Button6,
8070
8055
  {
8071
8056
  key: Button6.displayName,
@@ -8167,10 +8152,12 @@ function ContactItem({
8167
8152
 
8168
8153
  // src/CellRenderers/CompanyCell.tsx
8169
8154
  var Renderer2 = ({
8170
- columnDefinition,
8171
8155
  rowHeight,
8172
8156
  isGroup,
8173
- value
8157
+ value,
8158
+ getCompanyName,
8159
+ getImageURL,
8160
+ typographyProps
8174
8161
  }) => {
8175
8162
  const [showAvatar, setShowAvatar] = React80__default.default.useState(false);
8176
8163
  React80__default.default.useEffect(() => {
@@ -8179,18 +8166,9 @@ var Renderer2 = ({
8179
8166
  if (value === void 0 || value === null) {
8180
8167
  return null;
8181
8168
  }
8182
- const companyName = isGroup ? value : columnDefinition.cellRendererParams?.getCompanyName?.(value) ?? value.name;
8183
- const imageURL = columnDefinition.cellRendererParams?.getImageURL?.(value);
8184
- return isGroup ? /* @__PURE__ */ React80__default.default.createElement(
8185
- coreReact.Typography,
8186
- {
8187
- ...getCellValueTypographyProps(
8188
- columnDefinition.cellRendererParams?.typographyProps
8189
- ),
8190
- weight: "semibold"
8191
- },
8192
- companyName
8193
- ) : /* @__PURE__ */ React80__default.default.createElement(
8169
+ const companyName = isGroup ? value : getCompanyName?.(value) ?? value.name;
8170
+ const imageURL = getImageURL?.(value);
8171
+ return isGroup ? /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, weight: "semibold" }, companyName) : /* @__PURE__ */ React80__default.default.createElement(
8194
8172
  ContactItem,
8195
8173
  {
8196
8174
  imageUrl: showAvatar ? imageURL : void 0,
@@ -8225,28 +8203,19 @@ var Renderer3 = ({
8225
8203
  columnDefinition,
8226
8204
  isGroup,
8227
8205
  rowPinned,
8228
- value
8206
+ value,
8207
+ typographyProps,
8208
+ formatConfig,
8209
+ inputProps
8229
8210
  }) => {
8230
8211
  const I18n = coreReact.useI18nContext();
8231
- const internalValue = value !== void 0 && labsFinancialsUtils.formatCurrency(
8232
- value?.toString(),
8233
- columnDefinition.cellRendererParams?.formatConfig
8234
- ) || void 0;
8212
+ const internalValue = value !== void 0 && labsFinancialsUtils.formatCurrency(value?.toString(), formatConfig) || void 0;
8235
8213
  if (isEmptyValue(value)) {
8236
8214
  if (isGroup) {
8237
8215
  return null;
8238
8216
  }
8239
8217
  if (columnDefinition.editable) {
8240
- return /* @__PURE__ */ React80__default.default.createElement(
8241
- coreReact.Typography,
8242
- {
8243
- ...getCellValueTypographyProps(
8244
- columnDefinition.cellRendererParams?.typographyProps
8245
- ),
8246
- className: cx3("input-placeholder")
8247
- },
8248
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder")
8249
- );
8218
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx3("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder"));
8250
8219
  }
8251
8220
  }
8252
8221
  if (isGroup) {
@@ -8263,10 +8232,8 @@ var Renderer3 = ({
8263
8232
  return /* @__PURE__ */ React80__default.default.createElement(
8264
8233
  coreReact.Typography,
8265
8234
  {
8266
- ...getCellValueTypographyProps(
8267
- columnDefinition.cellRendererParams?.typographyProps
8268
- ),
8269
- weight: rowPinned ? "bold" : columnDefinition.cellRendererParams?.typographyProps?.weight,
8235
+ ...typographyProps,
8236
+ weight: rowPinned ? "bold" : typographyProps?.weight,
8270
8237
  className: cx3("tabular-nums")
8271
8238
  },
8272
8239
  internalValue
@@ -8274,7 +8241,14 @@ var Renderer3 = ({
8274
8241
  };
8275
8242
  var CurrencyCellRenderer = withDataTableRenderer(Renderer3, "input");
8276
8243
  var Editor = React80__default.default.forwardRef(
8277
- ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
8244
+ ({
8245
+ columnDefinition,
8246
+ eventKey,
8247
+ stopEditing,
8248
+ value,
8249
+ formatConfig,
8250
+ inputProps
8251
+ }, ref) => {
8278
8252
  const I18n = coreReact.useI18nContext();
8279
8253
  if (isEmptyValue(value) && !columnDefinition.editable) {
8280
8254
  return null;
@@ -8283,19 +8257,20 @@ var Editor = React80__default.default.forwardRef(
8283
8257
  stopEditing(ensureIsHTMLElement(event.relatedTarget));
8284
8258
  }
8285
8259
  const defaultValue = eventKey ? value : labsFinancialsUtils.formatNumber(value, {
8286
- ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
8260
+ ...formatConfig || columnDefinition.cellRendererParams?.formatConfig,
8261
+ //TODO remove usage of columnDefinition.cellRendererParams in next major version
8287
8262
  symbol: void 0,
8288
8263
  symbolAfterValue: void 0
8289
8264
  });
8290
8265
  return /* @__PURE__ */ React80__default.default.createElement(
8291
8266
  coreReact.Input,
8292
8267
  {
8293
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder"),
8268
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder"),
8294
8269
  defaultValue,
8295
8270
  onBlur,
8296
8271
  ref,
8297
8272
  className: cx3("input-cell", "input-cell--right-aligned"),
8298
- ...columnDefinition.cellEditorParams?.inputProps || {}
8273
+ ...inputProps
8299
8274
  }
8300
8275
  );
8301
8276
  }
@@ -8707,6 +8682,14 @@ var DateFilterTokenText = ({
8707
8682
  };
8708
8683
  var DateFilterRenderer_default = DateFilterRenderer;
8709
8684
 
8685
+ // src/utils/getCellValueTypographyProps.ts
8686
+ function getCellValueTypographyProps(typographyProps) {
8687
+ return {
8688
+ intent: "small",
8689
+ ...typographyProps
8690
+ };
8691
+ }
8692
+
8710
8693
  // src/CellRenderers/DateCell.tsx
8711
8694
  var cx4 = classnames__default.default.bind(styles_default);
8712
8695
  function getDateObject(date) {
@@ -8793,36 +8776,32 @@ function getDateObject2(date) {
8793
8776
  return date;
8794
8777
  }
8795
8778
  var DateTimeCellValue = ({
8796
- columnDefinition,
8797
8779
  isGroup,
8798
- value
8780
+ value,
8781
+ typographyProps,
8782
+ dateFormatType
8799
8783
  }) => {
8800
8784
  const { format: format3 } = coreReact.useDateTime();
8801
8785
  if (isGroup || isEmptyValue(value)) {
8802
8786
  return null;
8803
8787
  }
8804
8788
  const parsedValue = getDateObject2(value);
8805
- const internalValue = parsedValue ? format3(
8806
- parsedValue,
8807
- columnDefinition.cellRendererParams?.dateFormatType || "abbr-weekday-abbr-date-at-time"
8808
- ) : void 0;
8809
- const typographyProps = getCellValueTypographyProps(
8810
- columnDefinition.cellRendererParams?.typographyProps
8811
- );
8789
+ const internalValue = parsedValue ? format3(parsedValue, dateFormatType || "abbr-weekday-abbr-date-at-time") : void 0;
8812
8790
  return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps }, internalValue);
8813
8791
  };
8814
8792
  var Renderer5 = (props) => {
8815
- return /* @__PURE__ */ React80__default.default.createElement(
8816
- OptionalDateTimeProvider,
8817
- {
8818
- timeZone: props.columnDefinition?.cellRendererParams?.timeZone
8819
- },
8820
- /* @__PURE__ */ React80__default.default.createElement(DateTimeCellValue, { ...props })
8821
- );
8793
+ return /* @__PURE__ */ React80__default.default.createElement(OptionalDateTimeProvider, { timeZone: props.timeZone }, /* @__PURE__ */ React80__default.default.createElement(DateTimeCellValue, { ...props }));
8822
8794
  };
8823
8795
  var DateTimeCellRenderer = withDataTableRenderer(Renderer5, "date");
8824
8796
  var Editor3 = React80__default.default.forwardRef(
8825
- ({ columnDefinition, setDataValue, stopEditing, value }, ref) => {
8797
+ ({
8798
+ columnDefinition,
8799
+ setDataValue,
8800
+ stopEditing,
8801
+ value,
8802
+ timeZone,
8803
+ disabledDate
8804
+ }, ref) => {
8826
8805
  function afterHide(event) {
8827
8806
  stopEditing(ensureIsHTMLElement(event?.target));
8828
8807
  }
@@ -8833,23 +8812,17 @@ var Editor3 = React80__default.default.forwardRef(
8833
8812
  setDataValue(columnDefinition.field, void 0);
8834
8813
  }
8835
8814
  }
8836
- return /* @__PURE__ */ React80__default.default.createElement(
8837
- OptionalDateTimeProvider,
8815
+ return /* @__PURE__ */ React80__default.default.createElement(OptionalDateTimeProvider, { timeZone }, /* @__PURE__ */ React80__default.default.createElement(
8816
+ coreReact.DateSelect,
8838
8817
  {
8839
- timeZone: columnDefinition.cellEditorParams?.timeZone
8840
- },
8841
- /* @__PURE__ */ React80__default.default.createElement(
8842
- coreReact.DateSelect,
8843
- {
8844
- afterHide,
8845
- className: cx5("input-cell"),
8846
- disabledDate: columnDefinition.cellEditorParams?.disabledDate,
8847
- onChange,
8848
- ref,
8849
- value: getDateObject2(value)
8850
- }
8851
- )
8852
- );
8818
+ afterHide,
8819
+ className: cx5("input-cell"),
8820
+ disabledDate,
8821
+ onChange,
8822
+ ref,
8823
+ value: getDateObject2(value)
8824
+ }
8825
+ ));
8853
8826
  }
8854
8827
  );
8855
8828
  var DateTimeCellEditor = withDataTableEditor(Editor3, "date");
@@ -52375,15 +52348,21 @@ globalObj.MouseEvent = typeof MouseEvent === "undefined" ? {} : MouseEvent;
52375
52348
  var GroupCellRenderer2 = GroupCellRenderer;
52376
52349
  var cx6 = classnames__default.default.bind(truncation_default);
52377
52350
  var MIN_LINK_WIDTH = 48;
52378
- var InternalLinkCellRenderer = ({ columnDefinition, isGroup, data, rowHeight, value }) => {
52351
+ var InternalLinkCellRenderer = ({
52352
+ columnDefinition,
52353
+ isGroup,
52354
+ data,
52355
+ rowHeight,
52356
+ value,
52357
+ typographyProps,
52358
+ isExternalLink,
52359
+ getURL
52360
+ }) => {
52379
52361
  const [isLinkWidthBelowMin, setIsLinkWidthBelowMin] = React80.useState(false);
52380
52362
  const linkRef = React80.useRef(null);
52381
52363
  const internalValue = value ? columnDefinition.getStringFormattedValue?.(value) : "";
52382
- const typographyProps = getCellValueTypographyProps(
52383
- columnDefinition.cellRendererParams?.typographyProps
52384
- );
52385
52364
  const className = cx6(
52386
- columnDefinition.cellRendererParams?.typographyProps?.className,
52365
+ typographyProps?.className,
52387
52366
  "textCell",
52388
52367
  "truncatingText",
52389
52368
  {
@@ -52401,8 +52380,7 @@ var InternalLinkCellRenderer = ({ columnDefinition, isGroup, data, rowHeight, va
52401
52380
  setIsLinkWidthBelowMin(width < MIN_LINK_WIDTH);
52402
52381
  }
52403
52382
  }, [internalValue]);
52404
- const isExternalLink = columnDefinition.cellRendererParams.isExternalLink ?? false;
52405
- const URL = columnDefinition.cellRendererParams.getURL(value, data);
52383
+ const URL = getURL(value, data);
52406
52384
  const extendClickableAreaClassNames = isLinkWidthBelowMin ? cx6("extendClickableArea", {
52407
52385
  "extendClickableArea--rowHeightSm": rowHeight === rowSize.sm
52408
52386
  }) : "";
@@ -52432,23 +52410,22 @@ var LinkCellRenderer = withDataTableRenderer(
52432
52410
  "input"
52433
52411
  );
52434
52412
  var cx7 = classnames__default.default.bind(styles_default);
52435
- var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value }) => {
52413
+ var InternalNumberCellRenderer = ({
52414
+ columnDefinition,
52415
+ rowPinned,
52416
+ isGroup,
52417
+ value,
52418
+ typographyProps,
52419
+ inputProps,
52420
+ formatConfig
52421
+ }) => {
52436
52422
  const I18n = coreReact.useI18nContext();
52437
52423
  if (isEmptyValue(value)) {
52438
52424
  if (isGroup) {
52439
52425
  return null;
52440
52426
  }
52441
52427
  if (columnDefinition.editable) {
52442
- return /* @__PURE__ */ React80__default.default.createElement(
52443
- coreReact.Typography,
52444
- {
52445
- ...getCellValueTypographyProps(
52446
- columnDefinition.cellRendererParams?.typographyProps
52447
- ),
52448
- className: cx7("input-placeholder")
52449
- },
52450
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder")
52451
- );
52428
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx7("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder"));
52452
52429
  }
52453
52430
  return /* @__PURE__ */ React80__default.default.createElement(React80__default.default.Fragment, null);
52454
52431
  }
@@ -52457,7 +52434,7 @@ var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value
52457
52434
  minDecimalPrecision: 0,
52458
52435
  shouldUseGtk: true,
52459
52436
  symbol: "",
52460
- ...columnDefinition.cellRendererParams?.formatConfig
52437
+ ...formatConfig
52461
52438
  });
52462
52439
  if (isGroup) {
52463
52440
  return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { intent: "small", weight: "semibold" }, internalValue);
@@ -52465,10 +52442,8 @@ var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value
52465
52442
  return /* @__PURE__ */ React80__default.default.createElement(
52466
52443
  coreReact.Typography,
52467
52444
  {
52468
- ...getCellValueTypographyProps(
52469
- columnDefinition.cellRendererParams?.typographyProps
52470
- ),
52471
- weight: rowPinned ? "bold" : columnDefinition.cellRendererParams?.typographyProps?.weight
52445
+ ...typographyProps,
52446
+ weight: rowPinned ? "bold" : typographyProps?.weight
52472
52447
  },
52473
52448
  internalValue
52474
52449
  );
@@ -52477,7 +52452,7 @@ var NumberCellRenderer = withDataTableRenderer(
52477
52452
  InternalNumberCellRenderer,
52478
52453
  "input"
52479
52454
  );
52480
- var InternalNumberCellEditor = React80__default.default.forwardRef(({ columnDefinition, stopEditing, value }, ref) => {
52455
+ var InternalNumberCellEditor = React80__default.default.forwardRef(({ columnDefinition, stopEditing, value, inputProps }, ref) => {
52481
52456
  const I18n = coreReact.useI18nContext();
52482
52457
  if (isEmptyValue(value) && !columnDefinition.editable) {
52483
52458
  return null;
@@ -52488,13 +52463,13 @@ var InternalNumberCellEditor = React80__default.default.forwardRef(({ columnDefi
52488
52463
  return /* @__PURE__ */ React80__default.default.createElement(
52489
52464
  coreReact.Input,
52490
52465
  {
52491
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder"),
52466
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder"),
52492
52467
  type: "number",
52493
52468
  defaultValue: value,
52494
52469
  onBlur,
52495
52470
  ref,
52496
52471
  className: cx7("input-cell", "input-cell--right-aligned"),
52497
- ...columnDefinition.cellEditorParams?.inputProps || {}
52472
+ ...inputProps
52498
52473
  }
52499
52474
  );
52500
52475
  });
@@ -52575,35 +52550,41 @@ var defaultAvatarStackItemFilter = (person) => !!person || !!person.id;
52575
52550
  var Renderer6 = ({
52576
52551
  columnDefinition,
52577
52552
  rowHeight,
52578
- value
52553
+ value,
52554
+ getValue: getValue2,
52555
+ getCompanyName: getCompanyNameParam,
52556
+ getPersonName: getPersonNameParam,
52557
+ getInitials,
52558
+ getImageURL,
52559
+ typographyProps
52579
52560
  }) => {
52580
52561
  const [fullCellView, setFullCellView] = React80__default.default.useState(false);
52581
52562
  const getPeople = React80__default.default.useCallback(() => {
52582
- return columnDefinition.cellRendererParams?.getValue?.(value) || value || [];
52583
- }, [columnDefinition.cellRendererParams?.getValue, value]);
52563
+ return getValue2?.(value) || value || [];
52564
+ }, [getValue2, value]);
52584
52565
  const getCompanyName = React80__default.default.useCallback(
52585
52566
  (person) => {
52586
- return columnDefinition.cellRendererParams?.getCompanyName?.(person) ?? person.company ?? "";
52567
+ return getCompanyNameParam?.(person) ?? person.company ?? "";
52587
52568
  },
52588
- [columnDefinition.cellRendererParams?.getCompanyName]
52569
+ [getCompanyNameParam]
52589
52570
  );
52590
52571
  const getPersonName = React80__default.default.useCallback(
52591
52572
  (person) => {
52592
- return columnDefinition.cellRendererParams?.getPersonName?.(person) ?? person.name ?? "";
52573
+ return getPersonNameParam?.(person) ?? person.name ?? "";
52593
52574
  },
52594
- [columnDefinition.cellRendererParams?.getPersonName]
52575
+ [getPersonNameParam]
52595
52576
  );
52596
52577
  const getPersonImageUrl = React80__default.default.useCallback(
52597
52578
  (person) => {
52598
- return columnDefinition.cellRendererParams?.getImageURL?.(person) ?? "";
52579
+ return getImageURL?.(person) ?? "";
52599
52580
  },
52600
- [columnDefinition.cellRendererParams?.getImageURL]
52581
+ [getImageURL]
52601
52582
  );
52602
52583
  const getPersonInitials = React80__default.default.useCallback(
52603
52584
  (person) => {
52604
- return columnDefinition.cellRendererParams?.getInitials?.(person) ?? "";
52585
+ return getInitials?.(person) ?? "";
52605
52586
  },
52606
- [columnDefinition.cellRendererParams?.getInitials]
52587
+ [getInitials]
52607
52588
  );
52608
52589
  const getPersonNameWithCompany = React80__default.default.useCallback(
52609
52590
  (person) => {
@@ -52631,9 +52612,6 @@ var Renderer6 = ({
52631
52612
  }
52632
52613
  return avatarWidth * avatarCount;
52633
52614
  }, [getPeople, rowHeight]);
52634
- const typographyProps = getCellValueTypographyProps(
52635
- columnDefinition.cellRendererParams?.typographyProps
52636
- );
52637
52615
  const people = getPeople();
52638
52616
  if (isEmptyValue(value) || people.length === 0) {
52639
52617
  return null;
@@ -52742,7 +52720,10 @@ var Renderer7 = ({
52742
52720
  columnDefinition,
52743
52721
  isGroup,
52744
52722
  rowPinned,
52745
- value
52723
+ value,
52724
+ typographyProps,
52725
+ inputProps,
52726
+ formatConfig
52746
52727
  }) => {
52747
52728
  const I18n = coreReact.useI18nContext();
52748
52729
  if (isEmptyValue(value)) {
@@ -52750,22 +52731,10 @@ var Renderer7 = ({
52750
52731
  return null;
52751
52732
  }
52752
52733
  if (columnDefinition.editable) {
52753
- return /* @__PURE__ */ React80__default.default.createElement(
52754
- coreReact.Typography,
52755
- {
52756
- ...getCellValueTypographyProps(
52757
- columnDefinition.cellRendererParams?.typographyProps
52758
- ),
52759
- className: cx9("input-placeholder")
52760
- },
52761
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder")
52762
- );
52734
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx9("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder"));
52763
52735
  }
52764
52736
  }
52765
- const internalValue = labsFinancialsUtils.formatPercentage(
52766
- value?.toString() ?? "",
52767
- columnDefinition.cellRendererParams?.formatConfig
52768
- );
52737
+ const internalValue = labsFinancialsUtils.formatPercentage(value?.toString() ?? "", formatConfig);
52769
52738
  if (isGroup) {
52770
52739
  return /* @__PURE__ */ React80__default.default.createElement(
52771
52740
  coreReact.Typography,
@@ -52780,48 +52749,60 @@ var Renderer7 = ({
52780
52749
  return /* @__PURE__ */ React80__default.default.createElement(
52781
52750
  coreReact.Typography,
52782
52751
  {
52783
- ...getCellValueTypographyProps(
52784
- columnDefinition.cellRendererParams?.typographyProps
52785
- ),
52786
- weight: rowPinned ? "bold" : columnDefinition.cellRendererParams?.typographyProps?.weight,
52752
+ ...typographyProps,
52753
+ weight: rowPinned ? "bold" : typographyProps?.weight,
52787
52754
  className: cx9("tabular-nums")
52788
52755
  },
52789
52756
  internalValue
52790
52757
  );
52791
52758
  };
52792
52759
  var PercentCellRenderer = withDataTableRenderer(Renderer7, "input");
52793
- var Editor4 = React80__default.default.forwardRef(({ columnDefinition, eventKey, stopEditing, value }, ref) => {
52794
- const I18n = coreReact.useI18nContext();
52795
- function onBlur(event) {
52796
- stopEditing(ensureIsHTMLElement(event.relatedTarget));
52797
- }
52798
- if (isEmptyValue(value) && !columnDefinition.editable) {
52799
- return null;
52800
- }
52801
- const defaultValue = eventKey ? value : labsFinancialsUtils.formatNumber(value, {
52802
- ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
52803
- symbol: void 0,
52804
- symbolAfterValue: void 0
52805
- });
52806
- return /* @__PURE__ */ React80__default.default.createElement(
52807
- coreReact.Input,
52808
- {
52809
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder"),
52810
- className: cx9("input-cell", "input-cell--right-aligned"),
52811
- defaultValue,
52812
- onBlur,
52813
- ref,
52814
- style: { textAlign: "right" },
52815
- ...columnDefinition.cellEditorParams?.inputProps || {}
52760
+ var Editor4 = React80__default.default.forwardRef(
52761
+ ({
52762
+ columnDefinition,
52763
+ eventKey,
52764
+ stopEditing,
52765
+ value,
52766
+ formatConfig,
52767
+ inputProps
52768
+ }, ref) => {
52769
+ const I18n = coreReact.useI18nContext();
52770
+ function onBlur(event) {
52771
+ stopEditing(ensureIsHTMLElement(event.relatedTarget));
52816
52772
  }
52817
- );
52818
- });
52773
+ if (isEmptyValue(value) && !columnDefinition.editable) {
52774
+ return null;
52775
+ }
52776
+ const defaultValue = eventKey ? value : labsFinancialsUtils.formatNumber(value, {
52777
+ ...formatConfig || columnDefinition.cellRendererParams?.formatConfig,
52778
+ //TODO remove usage of columnDefinition.cellRendererParams in next major version
52779
+ symbol: void 0,
52780
+ symbolAfterValue: void 0
52781
+ });
52782
+ return /* @__PURE__ */ React80__default.default.createElement(
52783
+ coreReact.Input,
52784
+ {
52785
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder"),
52786
+ className: cx9("input-cell", "input-cell--right-aligned"),
52787
+ defaultValue,
52788
+ onBlur,
52789
+ ref,
52790
+ style: { textAlign: "right" },
52791
+ ...inputProps
52792
+ }
52793
+ );
52794
+ }
52795
+ );
52819
52796
  var PercentCellEditor = withDataTableEditor(Editor4, "input");
52820
52797
  var Renderer8 = ({
52821
- columnDefinition,
52822
52798
  rowHeight,
52823
52799
  isGroup,
52824
- value
52800
+ value,
52801
+ getPersonName,
52802
+ getCompanyName,
52803
+ getImageURL,
52804
+ getInitials,
52805
+ typographyProps
52825
52806
  }) => {
52826
52807
  const [showAvatar, setShowAvatar] = React80__default.default.useState(false);
52827
52808
  React80__default.default.useEffect(() => {
@@ -52830,13 +52811,10 @@ var Renderer8 = ({
52830
52811
  if (value === void 0 || value === null) {
52831
52812
  return null;
52832
52813
  }
52833
- const name = columnDefinition.cellRendererParams?.getPersonName?.(value);
52834
- const companyName = columnDefinition.cellRendererParams?.getCompanyName?.(value);
52835
- const imageURL = columnDefinition.cellRendererParams?.getImageURL?.(value);
52836
- const initials = columnDefinition.cellRendererParams?.getInitials?.(value);
52837
- const typographyProps = getCellValueTypographyProps(
52838
- columnDefinition.cellRendererParams?.typographyProps
52839
- );
52814
+ const name = getPersonName?.(value);
52815
+ const companyName = getCompanyName?.(value);
52816
+ const imageURL = getImageURL?.(value);
52817
+ const initials = getInitials?.(value);
52840
52818
  if (isGroup) {
52841
52819
  return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, weight: "semibold" }, name);
52842
52820
  }
@@ -52860,34 +52838,25 @@ var Renderer9 = ({
52860
52838
  columnDefinition,
52861
52839
  isGroup,
52862
52840
  value,
52863
- rowPinned
52841
+ rowPinned,
52842
+ getColor,
52843
+ displayAsPill,
52844
+ typographyProps,
52845
+ placeholder
52864
52846
  }) => {
52865
- const { getColor, displayAsPill } = columnDefinition.cellRendererParams;
52866
52847
  const I18n = coreReact.useI18nContext();
52867
52848
  if (isEmptyValue(value)) {
52868
52849
  if (isGroup) {
52869
52850
  return null;
52870
52851
  }
52871
52852
  if (columnDefinition.editable) {
52872
- return /* @__PURE__ */ React80__default.default.createElement(
52873
- coreReact.Typography,
52874
- {
52875
- ...getCellValueTypographyProps(
52876
- columnDefinition.cellRendererParams?.typographyProps
52877
- ),
52878
- className: cx10("input-placeholder")
52879
- },
52880
- columnDefinition.cellEditorParams?.placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52881
- label: columnDefinition.headerName
52882
- })
52883
- );
52853
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx10("input-placeholder") }, placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52854
+ label: columnDefinition.headerName
52855
+ }));
52884
52856
  }
52885
52857
  return null;
52886
52858
  }
52887
52859
  const label = columnDefinition.getStringFormattedValue?.(value) || value;
52888
- const typographyProps = getCellValueTypographyProps(
52889
- columnDefinition.cellRendererParams?.typographyProps
52890
- );
52891
52860
  if ((isGroup || rowPinned && columnDefinition.aggFunc) && !displayAsPill) {
52892
52861
  return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, weight: "semibold" }, label);
52893
52862
  }
@@ -52895,7 +52864,18 @@ var Renderer9 = ({
52895
52864
  };
52896
52865
  var PillCellRenderer = withDataTableRenderer(Renderer9, "select");
52897
52866
  var Editor5 = React80__default.default.forwardRef(
52898
- ({ columnDefinition, data, setDataValue, stopEditing, value }, ref) => {
52867
+ ({
52868
+ columnDefinition,
52869
+ data,
52870
+ setDataValue,
52871
+ stopEditing,
52872
+ value,
52873
+ selectOptions,
52874
+ getId: getIdParam,
52875
+ placeholder,
52876
+ getColor,
52877
+ clearable
52878
+ }, ref) => {
52899
52879
  const [options, setOptions] = React80__default.default.useState([]);
52900
52880
  const [loading, setLoading] = React80__default.default.useState(false);
52901
52881
  const I18n = coreReact.useI18nContext();
@@ -52903,7 +52883,6 @@ var Editor5 = React80__default.default.forwardRef(
52903
52883
  stopEditing();
52904
52884
  }
52905
52885
  async function beforeShow() {
52906
- const selectOptions = columnDefinition.cellEditorParams?.selectOptions || [];
52907
52886
  if (Array.isArray(selectOptions)) {
52908
52887
  setOptions(selectOptions);
52909
52888
  } else {
@@ -52920,7 +52899,7 @@ var Editor5 = React80__default.default.forwardRef(
52920
52899
  setDataValue(columnDefinition.field, null);
52921
52900
  }
52922
52901
  function getId3(item) {
52923
- return columnDefinition.cellEditorParams?.getId?.(item) ?? item;
52902
+ return getIdParam?.(item) ?? item;
52924
52903
  }
52925
52904
  function getLabel3(item) {
52926
52905
  const unformattedLabel = columnDefinition.getStringFormattedValue?.(item) || "";
@@ -52929,17 +52908,17 @@ var Editor5 = React80__default.default.forwardRef(
52929
52908
  return /* @__PURE__ */ React80__default.default.createElement(
52930
52909
  coreReact.PillSelect,
52931
52910
  {
52932
- placeholder: columnDefinition.cellEditorParams?.placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52911
+ placeholder: placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52933
52912
  label: columnDefinition.headerName
52934
52913
  }),
52935
52914
  afterHide,
52936
52915
  beforeShow,
52937
52916
  block: true,
52938
- getColor: columnDefinition.cellEditorParams?.getColor ?? columnDefinition.cellRendererParams.getColor,
52917
+ getColor,
52939
52918
  getId: getId3,
52940
52919
  getLabel: getLabel3,
52941
52920
  loading,
52942
- onClear: columnDefinition.cellEditorParams?.clearable ? onClear : void 0,
52921
+ onClear: clearable ? onClear : void 0,
52943
52922
  onSelect,
52944
52923
  options,
52945
52924
  ref,
@@ -52984,13 +52963,12 @@ function useSearch(data, onSearchFunction) {
52984
52963
  setSearchResultOptions
52985
52964
  };
52986
52965
  }
52987
- function useSelectOptions(columnDefinition, data) {
52966
+ function useSelectOptions(selectOptions, data) {
52988
52967
  const [options, setOptions] = React80__default.default.useState([]);
52989
52968
  const [loading, setLoading] = React80__default.default.useState(false);
52990
52969
  const [totalOptions, setTotalOptions] = React80__default.default.useState(0);
52991
52970
  const fetchOptions = async (offset4) => {
52992
52971
  setLoading(true);
52993
- const selectOptions = columnDefinition.cellEditorParams?.selectOptions || [];
52994
52972
  let newOptions = [];
52995
52973
  let total = 0;
52996
52974
  if (typeof selectOptions === "function") {
@@ -53022,7 +53000,9 @@ var cx11 = classnames__default.default.bind({ ...styles_default, ...truncation_d
53022
53000
  var Renderer10 = ({
53023
53001
  columnDefinition,
53024
53002
  isGroup,
53025
- value
53003
+ value,
53004
+ typographyProps,
53005
+ placeholder
53026
53006
  }) => {
53027
53007
  const I18n = coreReact.useI18nContext();
53028
53008
  if (isEmptyValue(value)) {
@@ -53030,24 +53010,12 @@ var Renderer10 = ({
53030
53010
  return null;
53031
53011
  }
53032
53012
  if (columnDefinition.editable) {
53033
- return /* @__PURE__ */ React80__default.default.createElement(
53034
- coreReact.Typography,
53035
- {
53036
- ...getCellValueTypographyProps(
53037
- columnDefinition.cellRendererParams?.typographyProps
53038
- ),
53039
- className: cx11("truncatingText")
53040
- },
53041
- columnDefinition.cellEditorParams?.placeholder || I18n.t("dataTable.cells.selectCell.placeholder", {
53042
- label: columnDefinition.headerName
53043
- })
53044
- );
53013
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx11("truncatingText") }, placeholder || I18n.t("dataTable.cells.selectCell.placeholder", {
53014
+ label: columnDefinition.headerName
53015
+ }));
53045
53016
  }
53046
53017
  }
53047
53018
  const internalValue = columnDefinition.getStringFormattedValue?.(value);
53048
- const typographyProps = getCellValueTypographyProps(
53049
- columnDefinition.cellRendererParams?.typographyProps
53050
- );
53051
53019
  if (isGroup) {
53052
53020
  return /* @__PURE__ */ React80__default.default.createElement(
53053
53021
  coreReact.Typography,
@@ -53063,14 +53031,25 @@ var Renderer10 = ({
53063
53031
  };
53064
53032
  var SelectCellRenderer = withDataTableRenderer(Renderer10, "select");
53065
53033
  var Editor6 = React80__default.default.forwardRef(
53066
- ({ columnDefinition, data, setDataValue, stopEditing, value }, ref) => {
53034
+ ({
53035
+ columnDefinition,
53036
+ data,
53037
+ setDataValue,
53038
+ stopEditing,
53039
+ value,
53040
+ clearable,
53041
+ selectOptions,
53042
+ onSearch: onSearchParam,
53043
+ getId: getIdParam,
53044
+ getOptionLabel: getOptionLabelParam
53045
+ }, ref) => {
53067
53046
  const { options, loading, totalOptions, fetchOptions } = useSelectOptions(
53068
- columnDefinition,
53047
+ selectOptions,
53069
53048
  data
53070
53049
  );
53071
53050
  const { onSearch, searchResultOptions, isSearching } = useSearch(
53072
53051
  data,
53073
- columnDefinition.cellEditorParams?.onSearch
53052
+ onSearchParam
53074
53053
  );
53075
53054
  function onSelect(selection) {
53076
53055
  if (selection.item !== value) {
@@ -53093,13 +53072,13 @@ var Editor6 = React80__default.default.forwardRef(
53093
53072
  }
53094
53073
  }, 500);
53095
53074
  function getId3(val) {
53096
- return columnDefinition.cellEditorParams?.getId?.(val) ?? val;
53075
+ return getIdParam?.(val) ?? val;
53097
53076
  }
53098
53077
  function getLabel3(val) {
53099
53078
  return columnDefinition.getStringFormattedValue?.(val);
53100
53079
  }
53101
53080
  function getOptionLabel(option) {
53102
- return columnDefinition.cellEditorParams?.getOptionLabel?.(option) || getLabel3(option);
53081
+ return getOptionLabelParam?.(option) || getLabel3(option);
53103
53082
  }
53104
53083
  return /* @__PURE__ */ React80__default.default.createElement(
53105
53084
  coreReact.Select,
@@ -53111,7 +53090,7 @@ var Editor6 = React80__default.default.forwardRef(
53111
53090
  loading: isSearching || loading,
53112
53091
  onSearch,
53113
53092
  onSelect,
53114
- onClear: columnDefinition.cellEditorParams?.clearable ? onClear : void 0,
53093
+ onClear: clearable ? onClear : void 0,
53115
53094
  onScrollBottom,
53116
53095
  ref,
53117
53096
  className: cx11("input-cell", "truncatingText")
@@ -53135,27 +53114,20 @@ var Renderer11 = ({
53135
53114
  rowHeight,
53136
53115
  node,
53137
53116
  isGroup,
53138
- value
53117
+ value,
53118
+ typographyProps,
53119
+ inputProps
53139
53120
  }) => {
53140
53121
  const I18n = coreReact.useI18nContext();
53141
53122
  if (isEmptyValue(value) && columnDefinition.editable) {
53142
53123
  if (isGroup) {
53143
53124
  return null;
53144
53125
  }
53145
- return /* @__PURE__ */ React80__default.default.createElement(
53146
- coreReact.Typography,
53147
- {
53148
- ...getCellValueTypographyProps(
53149
- columnDefinition.cellRendererParams?.typographyProps
53150
- ),
53151
- className: cx12("input-placeholder")
53152
- },
53153
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53154
- );
53126
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx12("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"));
53155
53127
  }
53156
53128
  const internalValue = columnDefinition.getStringFormattedValue?.(value) ?? value;
53157
53129
  const className = cx12(
53158
- columnDefinition.cellRendererParams?.typographyProps?.className,
53130
+ typographyProps?.className,
53159
53131
  "textCell",
53160
53132
  "truncatingText",
53161
53133
  {
@@ -53163,9 +53135,6 @@ var Renderer11 = ({
53163
53135
  "truncatingText--lg": rowHeight === rowSize.lg
53164
53136
  }
53165
53137
  );
53166
- const typographyProps = getCellValueTypographyProps(
53167
- columnDefinition.cellRendererParams?.typographyProps
53168
- );
53169
53138
  if (isGroup) {
53170
53139
  const fontWeight = node?.footer ? "regular" : "semibold";
53171
53140
  return /* @__PURE__ */ React80__default.default.createElement(
@@ -53183,7 +53152,7 @@ var Renderer11 = ({
53183
53152
  };
53184
53153
  var TextCellRenderer = withDataTableRenderer(Renderer11, "input");
53185
53154
  var Editor7 = React80__default.default.forwardRef(
53186
- ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53155
+ ({ columnDefinition, eventKey, stopEditing, value, inputProps }, ref) => {
53187
53156
  function onBlur(event) {
53188
53157
  stopEditing(ensureIsHTMLElement(event.relatedTarget));
53189
53158
  }
@@ -53192,12 +53161,12 @@ var Editor7 = React80__default.default.forwardRef(
53192
53161
  return /* @__PURE__ */ React80__default.default.createElement(
53193
53162
  coreReact.Input,
53194
53163
  {
53195
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"),
53196
53164
  className: cx12("input-cell"),
53197
53165
  defaultValue: internalValue,
53198
53166
  onBlur,
53199
53167
  ref,
53200
- ...columnDefinition.cellEditorParams?.inputProps || {}
53168
+ ...inputProps,
53169
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53201
53170
  }
53202
53171
  );
53203
53172
  }
@@ -53217,28 +53186,18 @@ var Renderer12 = ({
53217
53186
  columnDefinition,
53218
53187
  node,
53219
53188
  isGroup,
53220
- value
53189
+ value,
53190
+ typographyProps,
53191
+ textAreaProps
53221
53192
  }) => {
53222
53193
  const I18n = coreReact.useI18nContext();
53223
53194
  if (isEmptyValue(value) && columnDefinition.editable) {
53224
53195
  if (isGroup) {
53225
53196
  return null;
53226
53197
  }
53227
- return /* @__PURE__ */ React80__default.default.createElement(
53228
- coreReact.Typography,
53229
- {
53230
- ...getCellValueTypographyProps(
53231
- columnDefinition.cellRendererParams?.typographyProps
53232
- ),
53233
- className: cx13("input-placeholder")
53234
- },
53235
- columnDefinition.cellEditorParams?.textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53236
- );
53198
+ return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx13("input-placeholder") }, textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"));
53237
53199
  }
53238
53200
  const internalValue = columnDefinition.getStringFormattedValue?.(value) ?? value;
53239
- const typographyProps = getCellValueTypographyProps(
53240
- columnDefinition.cellRendererParams?.typographyProps
53241
- );
53242
53201
  if (isGroup) {
53243
53202
  const fontWeight = node?.footer ? "regular" : "semibold";
53244
53203
  return /* @__PURE__ */ React80__default.default.createElement(
@@ -53254,7 +53213,7 @@ var Renderer12 = ({
53254
53213
  return /* @__PURE__ */ React80__default.default.createElement(coreReact.Typography, { ...typographyProps, className: cx13("textarea-cell", "text") }, internalValue);
53255
53214
  };
53256
53215
  var Editor8 = React80__default.default.forwardRef(
53257
- ({ columnDefinition, stopEditing, value }, ref) => {
53216
+ ({ columnDefinition, stopEditing, value, textAreaProps }, ref) => {
53258
53217
  function onBlur(event) {
53259
53218
  stopEditing(ensureIsHTMLElement(event.relatedTarget));
53260
53219
  }
@@ -53263,14 +53222,14 @@ var Editor8 = React80__default.default.forwardRef(
53263
53222
  return /* @__PURE__ */ React80__default.default.createElement(
53264
53223
  coreReact.TextArea,
53265
53224
  {
53266
- placeholder: columnDefinition.cellEditorParams?.textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"),
53267
53225
  className: cx13("textarea-cell", "editor-text"),
53268
53226
  defaultValue: internalValue,
53269
53227
  onBlur,
53270
53228
  ref,
53271
53229
  resize: "none",
53272
53230
  style: { lineHeight: "16px" },
53273
- ...columnDefinition.cellEditorParams?.textAreaProps || {}
53231
+ ...textAreaProps,
53232
+ placeholder: textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53274
53233
  }
53275
53234
  );
53276
53235
  }
@@ -55622,11 +55581,8 @@ function getRowActions(actions, rowProps) {
55622
55581
  return actions;
55623
55582
  }
55624
55583
  var InternalRowActionsCellRenderer = (props) => {
55625
- const actions = getRowActions(
55626
- props.columnDefinition.cellRendererParams.actions,
55627
- props
55628
- );
55629
- if (props.rowPinned || props.columnDefinition.cellRendererParams.hideActionsOnGroupedRow && props.isGroup || actions.length === 0) {
55584
+ const actions = getRowActions(props.actions, props);
55585
+ if (props.rowPinned || props.hideActionsOnGroupedRow && props.isGroup || actions.length === 0) {
55630
55586
  return null;
55631
55587
  }
55632
55588
  return /* @__PURE__ */ React80__default.default.createElement(
@@ -55892,7 +55848,8 @@ var DataTableCellRenderer = ({
55892
55848
  node,
55893
55849
  editorType,
55894
55850
  value,
55895
- setValue
55851
+ setValue,
55852
+ ...props
55896
55853
  }) => {
55897
55854
  const { columnApi } = useInternalTableContext();
55898
55855
  const columnDefinition = transformToColumnDefinition(colDef);
@@ -55922,10 +55879,11 @@ var DataTableCellRenderer = ({
55922
55879
  parentData: context?.parentData,
55923
55880
  parentId: context?.parentId,
55924
55881
  rowHeight,
55925
- rowIndex: node.rowIndex,
55926
55882
  rowPinned: node.rowPinned,
55927
55883
  tableApi: tableRef?.current,
55928
- value
55884
+ value,
55885
+ ...props,
55886
+ typographyProps: getCellValueTypographyProps(props.typographyProps)
55929
55887
  };
55930
55888
  const hasValue = value !== void 0 && value !== null && value !== "";
55931
55889
  const isSelectCellComponent = columnDefinition.cellRendererSelector?.({
@@ -56005,7 +55963,8 @@ var DataTableCellEditor = React80__default.default.forwardRef(
56005
55963
  node,
56006
55964
  parseValue,
56007
55965
  stopEditing,
56008
- value
55966
+ value,
55967
+ ...props
56009
55968
  }, ref) => {
56010
55969
  const startingValue = getStartingValue(eventKey, editorType, value);
56011
55970
  const [currentValue, setCurrentValue] = React80.useState(startingValue);
@@ -56112,7 +56071,7 @@ var DataTableCellEditor = React80__default.default.forwardRef(
56112
56071
  setCurrentValue(newValue);
56113
56072
  },
56114
56073
  stopEditing: (relatedTarget) => {
56115
- const isRelatedTargetOutsideTable = relatedTarget?.closest('[data-qa="data-table-table') === null;
56074
+ const isRelatedTargetOutsideTable = relatedTarget?.closest('[data-qa="data-table-table"]') === null;
56116
56075
  stopEditing(isRelatedTargetOutsideTable);
56117
56076
  if (isRelatedTargetOutsideTable) {
56118
56077
  api.clearFocusedCell();
@@ -56121,7 +56080,8 @@ var DataTableCellEditor = React80__default.default.forwardRef(
56121
56080
  },
56122
56081
  tableApi: tableRef?.current,
56123
56082
  value: currentValue,
56124
- ref: handleRefs(editorType)
56083
+ ref: handleRefs(editorType),
56084
+ ...props
56125
56085
  }
56126
56086
  )
56127
56087
  );
@@ -57198,7 +57158,17 @@ function getLabel2(func, option) {
57198
57158
  function getId2(func, option) {
57199
57159
  return func?.(option) ?? option?.id ?? option;
57200
57160
  }
57201
- var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) => {
57161
+ var InternalMultiSelectCellRenderer = ({
57162
+ columnDefinition,
57163
+ rowHeight,
57164
+ value,
57165
+ getValue: getValueParam,
57166
+ enablePlaceholder: enablePlaceholderParam,
57167
+ placeholder: placeholderParam,
57168
+ typographyProps,
57169
+ getLabel: getLabelParam,
57170
+ getId: getIdParam
57171
+ }) => {
57202
57172
  const I18n = coreReact.useI18nContext();
57203
57173
  const ref = React80__default.default.useRef();
57204
57174
  React80__default.default.useLayoutEffect(() => {
@@ -57207,20 +57177,14 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
57207
57177
  if (value === void 0 || value === null) {
57208
57178
  return null;
57209
57179
  }
57210
- const options = getValue(
57211
- columnDefinition.cellRendererParams?.getValue,
57212
- value,
57213
- emptyArray
57214
- );
57215
- const enablePlaceholder = (columnDefinition.cellRendererParams?.enablePlaceholder && columnDefinition.editable) ?? false;
57216
- const placeholder = columnDefinition.cellRendererParams?.placeholder ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
57180
+ const options = getValue(getValueParam, value, emptyArray);
57181
+ const enablePlaceholder = (enablePlaceholderParam && columnDefinition.editable) ?? false;
57182
+ const placeholder = placeholderParam ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
57217
57183
  return /* @__PURE__ */ React80__default.default.createElement(
57218
57184
  coreReact.Typography,
57219
57185
  {
57220
57186
  as: "ol",
57221
- ...getCellValueTypographyProps(
57222
- columnDefinition.cellRendererParams?.typographyProps
57223
- ),
57187
+ ...typographyProps,
57224
57188
  className: cx16("inlineListItems", "truncatingText", {
57225
57189
  "truncatingText--md": rowHeight === rowSize.md,
57226
57190
  "truncatingText--lg": rowHeight === rowSize.lg
@@ -57228,14 +57192,8 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
57228
57192
  ref
57229
57193
  },
57230
57194
  options.length ? options.map((option, idx, arr) => {
57231
- const label = getLabel2(
57232
- columnDefinition.cellRendererParams?.getLabel,
57233
- option
57234
- );
57235
- const optionId = getId2(
57236
- columnDefinition.cellRendererParams?.getId,
57237
- option
57238
- );
57195
+ const label = getLabel2(getLabelParam, option);
57196
+ const optionId = getId2(getIdParam, option);
57239
57197
  const key = `${label}_${optionId}_idx_${idx}`;
57240
57198
  return /* @__PURE__ */ React80__default.default.createElement(React80__default.default.Fragment, { key }, /* @__PURE__ */ React80__default.default.createElement("li", null, label, idx !== arr.length - 1 ? commaToken : null));
57241
57199
  }) : enablePlaceholder ? /* @__PURE__ */ React80__default.default.createElement("li", { style: { color: coreReact.colors.gray45 } }, placeholder) : null
@@ -57245,63 +57203,80 @@ var MultiSelectCellRenderer = withDataTableRenderer(
57245
57203
  InternalMultiSelectCellRenderer,
57246
57204
  "select"
57247
57205
  );
57248
- var MultiSelectEditor = React80__default.default.forwardRef(({ columnDefinition, value = [], setDataValue, data, stopEditing }, ref) => {
57249
- const [selectedValue, setSelectedValue] = React80__default.default.useState(value);
57250
- const { options, loading, totalOptions, fetchOptions } = useSelectOptions(
57206
+ var MultiSelectEditor = React80__default.default.forwardRef(
57207
+ ({
57251
57208
  columnDefinition,
57252
- data
57253
- );
57254
- const { onSearch: editorOnSearch } = columnDefinition.cellEditorParams || {};
57255
- const shouldSearch = options.length < totalOptions && !!editorOnSearch;
57256
- const { onSearch, searchResultOptions, setSearchResultOptions, isSearching } = useSearch(data, shouldSearch ? editorOnSearch : void 0);
57257
- async function beforeShow() {
57258
- if (options.length === 0) {
57259
- await fetchOptions();
57209
+ value = [],
57210
+ setDataValue,
57211
+ data,
57212
+ stopEditing,
57213
+ selectOptions,
57214
+ placeholder,
57215
+ onSearch: editorOnSearch,
57216
+ getLabel: getLabelParam,
57217
+ getId: getIdParam
57218
+ }, ref) => {
57219
+ const [selectedValue, setSelectedValue] = React80__default.default.useState(value);
57220
+ const { options, loading, totalOptions, fetchOptions } = useSelectOptions(
57221
+ selectOptions,
57222
+ data
57223
+ );
57224
+ const shouldSearch = options.length < totalOptions && !!editorOnSearch;
57225
+ const {
57226
+ onSearch,
57227
+ searchResultOptions,
57228
+ setSearchResultOptions,
57229
+ isSearching
57230
+ } = useSearch(data, shouldSearch ? editorOnSearch : void 0);
57231
+ async function beforeShow() {
57232
+ if (options.length === 0) {
57233
+ await fetchOptions();
57234
+ }
57235
+ return true;
57260
57236
  }
57261
- return true;
57262
- }
57263
- const onScrollBottom = debounce5__default.default(async () => {
57264
- if (!searchResultOptions && options.length < totalOptions) {
57265
- const nextOffset = options.length;
57266
- await fetchOptions(nextOffset);
57237
+ const onScrollBottom = debounce5__default.default(async () => {
57238
+ if (!searchResultOptions && options.length < totalOptions) {
57239
+ const nextOffset = options.length;
57240
+ await fetchOptions(nextOffset);
57241
+ }
57242
+ }, 500);
57243
+ function onChange(value2) {
57244
+ setSelectedValue(value2);
57245
+ setDataValue(columnDefinition.field, value2);
57246
+ if (searchResultOptions) {
57247
+ setSearchResultOptions(void 0);
57248
+ }
57267
57249
  }
57268
- }, 500);
57269
- function onChange(value2) {
57270
- setSelectedValue(value2);
57271
- setDataValue(columnDefinition.field, value2);
57272
- if (searchResultOptions) {
57273
- setSearchResultOptions(void 0);
57250
+ function getLabel3(func, option) {
57251
+ return func?.(option) ?? option?.label ?? option?.name ?? option;
57274
57252
  }
57275
- }
57276
- function getLabel3(func, option) {
57277
- return func?.(option) ?? option?.label ?? option?.name ?? option;
57278
- }
57279
- function getId3(func, option) {
57280
- return func?.(option) ?? option?.id ?? option;
57281
- }
57282
- return /* @__PURE__ */ React80__default.default.createElement(
57283
- coreReact.MultiSelect,
57284
- {
57285
- beforeShow,
57286
- afterHide: () => stopEditing(),
57287
- block: true,
57288
- loading: isSearching || loading,
57289
- getId: (option) => {
57290
- return getId3(columnDefinition.cellEditorParams?.getId, option);
57291
- },
57292
- getLabel: (option) => {
57293
- return getLabel3(columnDefinition.cellEditorParams?.getLabel, option);
57294
- },
57295
- placeholder: columnDefinition.cellEditorParams?.placeholder,
57296
- onScrollBottom,
57297
- onSearch,
57298
- onChange,
57299
- options: searchResultOptions || options,
57300
- value: selectedValue,
57301
- ref
57253
+ function getId3(func, option) {
57254
+ return func?.(option) ?? option?.id ?? option;
57302
57255
  }
57303
- );
57304
- });
57256
+ return /* @__PURE__ */ React80__default.default.createElement(
57257
+ coreReact.MultiSelect,
57258
+ {
57259
+ beforeShow,
57260
+ afterHide: () => stopEditing(),
57261
+ block: true,
57262
+ loading: isSearching || loading,
57263
+ getId: (option) => {
57264
+ return getId3(getIdParam, option);
57265
+ },
57266
+ getLabel: (option) => {
57267
+ return getLabel3(getLabelParam, option);
57268
+ },
57269
+ placeholder,
57270
+ onScrollBottom,
57271
+ onSearch,
57272
+ onChange,
57273
+ options: searchResultOptions || options,
57274
+ value: selectedValue,
57275
+ ref
57276
+ }
57277
+ );
57278
+ }
57279
+ );
57305
57280
  var MultiSelectCellEditor = withDataTableEditor(
57306
57281
  MultiSelectEditor,
57307
57282
  "select"