@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.
@@ -7982,31 +7982,15 @@ var styles_default = {
7982
7982
  "spin": "_spin_if78k_1"
7983
7983
  };
7984
7984
 
7985
- // src/utils/getCellValueTypographyProps.ts
7986
- function getCellValueTypographyProps(typographyProps) {
7987
- return {
7988
- intent: "small",
7989
- ...typographyProps ?? {}
7990
- };
7991
- }
7992
-
7993
7985
  // src/CellRenderers/BooleanCell.tsx
7994
7986
  var cx = classnames.bind(styles_default);
7995
- var InternalBooleanCellRenderer = ({ columnDefinition, isGroup, value }) => {
7987
+ var InternalBooleanCellRenderer = ({ isGroup, value, typographyProps }) => {
7996
7988
  const I18n = useI18nContext();
7997
7989
  const internalValue = value ? I18n.t("dataTable.cells.booleanCell.options.yes") : I18n.t("dataTable.cells.booleanCell.options.no");
7998
7990
  if (isGroup) {
7999
7991
  return null;
8000
7992
  }
8001
- return /* @__PURE__ */ React80.createElement(
8002
- Typography,
8003
- {
8004
- ...getCellValueTypographyProps(
8005
- columnDefinition.cellRendererParams?.typographyProps
8006
- )
8007
- },
8008
- internalValue
8009
- );
7993
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps }, internalValue);
8010
7994
  };
8011
7995
  var BooleanCellRenderer = withDataTableRenderer(
8012
7996
  InternalBooleanCellRenderer,
@@ -8047,12 +8031,13 @@ var BooleanCellEditor = withDataTableEditor(
8047
8031
  var Renderer = ({
8048
8032
  columnDefinition,
8049
8033
  rowPinned,
8034
+ buttons,
8050
8035
  ...props
8051
8036
  }) => {
8052
8037
  if (rowPinned) {
8053
8038
  return null;
8054
8039
  }
8055
- return /* @__PURE__ */ React80.createElement(FlexList, { justifyContent: "center", alignItems: "center", size: "xs" }, columnDefinition.cellRendererParams.buttons.map((Button6) => /* @__PURE__ */ React80.createElement(
8040
+ return /* @__PURE__ */ React80.createElement(FlexList, { justifyContent: "center", alignItems: "center", size: "xs" }, buttons.map((Button6) => /* @__PURE__ */ React80.createElement(
8056
8041
  Button6,
8057
8042
  {
8058
8043
  key: Button6.displayName,
@@ -8154,10 +8139,12 @@ function ContactItem({
8154
8139
 
8155
8140
  // src/CellRenderers/CompanyCell.tsx
8156
8141
  var Renderer2 = ({
8157
- columnDefinition,
8158
8142
  rowHeight,
8159
8143
  isGroup,
8160
- value
8144
+ value,
8145
+ getCompanyName,
8146
+ getImageURL,
8147
+ typographyProps
8161
8148
  }) => {
8162
8149
  const [showAvatar, setShowAvatar] = React80.useState(false);
8163
8150
  React80.useEffect(() => {
@@ -8166,18 +8153,9 @@ var Renderer2 = ({
8166
8153
  if (value === void 0 || value === null) {
8167
8154
  return null;
8168
8155
  }
8169
- const companyName = isGroup ? value : columnDefinition.cellRendererParams?.getCompanyName?.(value) ?? value.name;
8170
- const imageURL = columnDefinition.cellRendererParams?.getImageURL?.(value);
8171
- return isGroup ? /* @__PURE__ */ React80.createElement(
8172
- Typography,
8173
- {
8174
- ...getCellValueTypographyProps(
8175
- columnDefinition.cellRendererParams?.typographyProps
8176
- ),
8177
- weight: "semibold"
8178
- },
8179
- companyName
8180
- ) : /* @__PURE__ */ React80.createElement(
8156
+ const companyName = isGroup ? value : getCompanyName?.(value) ?? value.name;
8157
+ const imageURL = getImageURL?.(value);
8158
+ return isGroup ? /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, weight: "semibold" }, companyName) : /* @__PURE__ */ React80.createElement(
8181
8159
  ContactItem,
8182
8160
  {
8183
8161
  imageUrl: showAvatar ? imageURL : void 0,
@@ -8212,28 +8190,19 @@ var Renderer3 = ({
8212
8190
  columnDefinition,
8213
8191
  isGroup,
8214
8192
  rowPinned,
8215
- value
8193
+ value,
8194
+ typographyProps,
8195
+ formatConfig,
8196
+ inputProps
8216
8197
  }) => {
8217
8198
  const I18n = useI18nContext();
8218
- const internalValue = value !== void 0 && formatCurrency(
8219
- value?.toString(),
8220
- columnDefinition.cellRendererParams?.formatConfig
8221
- ) || void 0;
8199
+ const internalValue = value !== void 0 && formatCurrency(value?.toString(), formatConfig) || void 0;
8222
8200
  if (isEmptyValue(value)) {
8223
8201
  if (isGroup) {
8224
8202
  return null;
8225
8203
  }
8226
8204
  if (columnDefinition.editable) {
8227
- return /* @__PURE__ */ React80.createElement(
8228
- Typography,
8229
- {
8230
- ...getCellValueTypographyProps(
8231
- columnDefinition.cellRendererParams?.typographyProps
8232
- ),
8233
- className: cx3("input-placeholder")
8234
- },
8235
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder")
8236
- );
8205
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx3("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder"));
8237
8206
  }
8238
8207
  }
8239
8208
  if (isGroup) {
@@ -8250,10 +8219,8 @@ var Renderer3 = ({
8250
8219
  return /* @__PURE__ */ React80.createElement(
8251
8220
  Typography,
8252
8221
  {
8253
- ...getCellValueTypographyProps(
8254
- columnDefinition.cellRendererParams?.typographyProps
8255
- ),
8256
- weight: rowPinned ? "bold" : columnDefinition.cellRendererParams?.typographyProps?.weight,
8222
+ ...typographyProps,
8223
+ weight: rowPinned ? "bold" : typographyProps?.weight,
8257
8224
  className: cx3("tabular-nums")
8258
8225
  },
8259
8226
  internalValue
@@ -8261,7 +8228,14 @@ var Renderer3 = ({
8261
8228
  };
8262
8229
  var CurrencyCellRenderer = withDataTableRenderer(Renderer3, "input");
8263
8230
  var Editor = React80.forwardRef(
8264
- ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
8231
+ ({
8232
+ columnDefinition,
8233
+ eventKey,
8234
+ stopEditing,
8235
+ value,
8236
+ formatConfig,
8237
+ inputProps
8238
+ }, ref) => {
8265
8239
  const I18n = useI18nContext();
8266
8240
  if (isEmptyValue(value) && !columnDefinition.editable) {
8267
8241
  return null;
@@ -8270,19 +8244,20 @@ var Editor = React80.forwardRef(
8270
8244
  stopEditing(ensureIsHTMLElement(event.relatedTarget));
8271
8245
  }
8272
8246
  const defaultValue = eventKey ? value : formatNumber(value, {
8273
- ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
8247
+ ...formatConfig || columnDefinition.cellRendererParams?.formatConfig,
8248
+ //TODO remove usage of columnDefinition.cellRendererParams in next major version
8274
8249
  symbol: void 0,
8275
8250
  symbolAfterValue: void 0
8276
8251
  });
8277
8252
  return /* @__PURE__ */ React80.createElement(
8278
8253
  Input,
8279
8254
  {
8280
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder"),
8255
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.currencyCell.placeholder"),
8281
8256
  defaultValue,
8282
8257
  onBlur,
8283
8258
  ref,
8284
8259
  className: cx3("input-cell", "input-cell--right-aligned"),
8285
- ...columnDefinition.cellEditorParams?.inputProps || {}
8260
+ ...inputProps
8286
8261
  }
8287
8262
  );
8288
8263
  }
@@ -8694,6 +8669,14 @@ var DateFilterTokenText = ({
8694
8669
  };
8695
8670
  var DateFilterRenderer_default = DateFilterRenderer;
8696
8671
 
8672
+ // src/utils/getCellValueTypographyProps.ts
8673
+ function getCellValueTypographyProps(typographyProps) {
8674
+ return {
8675
+ intent: "small",
8676
+ ...typographyProps
8677
+ };
8678
+ }
8679
+
8697
8680
  // src/CellRenderers/DateCell.tsx
8698
8681
  var cx4 = classnames.bind(styles_default);
8699
8682
  function getDateObject(date) {
@@ -8780,36 +8763,32 @@ function getDateObject2(date) {
8780
8763
  return date;
8781
8764
  }
8782
8765
  var DateTimeCellValue = ({
8783
- columnDefinition,
8784
8766
  isGroup,
8785
- value
8767
+ value,
8768
+ typographyProps,
8769
+ dateFormatType
8786
8770
  }) => {
8787
8771
  const { format: format3 } = useDateTime();
8788
8772
  if (isGroup || isEmptyValue(value)) {
8789
8773
  return null;
8790
8774
  }
8791
8775
  const parsedValue = getDateObject2(value);
8792
- const internalValue = parsedValue ? format3(
8793
- parsedValue,
8794
- columnDefinition.cellRendererParams?.dateFormatType || "abbr-weekday-abbr-date-at-time"
8795
- ) : void 0;
8796
- const typographyProps = getCellValueTypographyProps(
8797
- columnDefinition.cellRendererParams?.typographyProps
8798
- );
8776
+ const internalValue = parsedValue ? format3(parsedValue, dateFormatType || "abbr-weekday-abbr-date-at-time") : void 0;
8799
8777
  return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps }, internalValue);
8800
8778
  };
8801
8779
  var Renderer5 = (props) => {
8802
- return /* @__PURE__ */ React80.createElement(
8803
- OptionalDateTimeProvider,
8804
- {
8805
- timeZone: props.columnDefinition?.cellRendererParams?.timeZone
8806
- },
8807
- /* @__PURE__ */ React80.createElement(DateTimeCellValue, { ...props })
8808
- );
8780
+ return /* @__PURE__ */ React80.createElement(OptionalDateTimeProvider, { timeZone: props.timeZone }, /* @__PURE__ */ React80.createElement(DateTimeCellValue, { ...props }));
8809
8781
  };
8810
8782
  var DateTimeCellRenderer = withDataTableRenderer(Renderer5, "date");
8811
8783
  var Editor3 = React80.forwardRef(
8812
- ({ columnDefinition, setDataValue, stopEditing, value }, ref) => {
8784
+ ({
8785
+ columnDefinition,
8786
+ setDataValue,
8787
+ stopEditing,
8788
+ value,
8789
+ timeZone,
8790
+ disabledDate
8791
+ }, ref) => {
8813
8792
  function afterHide(event) {
8814
8793
  stopEditing(ensureIsHTMLElement(event?.target));
8815
8794
  }
@@ -8820,23 +8799,17 @@ var Editor3 = React80.forwardRef(
8820
8799
  setDataValue(columnDefinition.field, void 0);
8821
8800
  }
8822
8801
  }
8823
- return /* @__PURE__ */ React80.createElement(
8824
- OptionalDateTimeProvider,
8802
+ return /* @__PURE__ */ React80.createElement(OptionalDateTimeProvider, { timeZone }, /* @__PURE__ */ React80.createElement(
8803
+ DateSelect,
8825
8804
  {
8826
- timeZone: columnDefinition.cellEditorParams?.timeZone
8827
- },
8828
- /* @__PURE__ */ React80.createElement(
8829
- DateSelect,
8830
- {
8831
- afterHide,
8832
- className: cx5("input-cell"),
8833
- disabledDate: columnDefinition.cellEditorParams?.disabledDate,
8834
- onChange,
8835
- ref,
8836
- value: getDateObject2(value)
8837
- }
8838
- )
8839
- );
8805
+ afterHide,
8806
+ className: cx5("input-cell"),
8807
+ disabledDate,
8808
+ onChange,
8809
+ ref,
8810
+ value: getDateObject2(value)
8811
+ }
8812
+ ));
8840
8813
  }
8841
8814
  );
8842
8815
  var DateTimeCellEditor = withDataTableEditor(Editor3, "date");
@@ -52362,15 +52335,21 @@ globalObj.MouseEvent = typeof MouseEvent === "undefined" ? {} : MouseEvent;
52362
52335
  var GroupCellRenderer2 = GroupCellRenderer;
52363
52336
  var cx6 = classnames.bind(truncation_default);
52364
52337
  var MIN_LINK_WIDTH = 48;
52365
- var InternalLinkCellRenderer = ({ columnDefinition, isGroup, data, rowHeight, value }) => {
52338
+ var InternalLinkCellRenderer = ({
52339
+ columnDefinition,
52340
+ isGroup,
52341
+ data,
52342
+ rowHeight,
52343
+ value,
52344
+ typographyProps,
52345
+ isExternalLink,
52346
+ getURL
52347
+ }) => {
52366
52348
  const [isLinkWidthBelowMin, setIsLinkWidthBelowMin] = useState(false);
52367
52349
  const linkRef = useRef(null);
52368
52350
  const internalValue = value ? columnDefinition.getStringFormattedValue?.(value) : "";
52369
- const typographyProps = getCellValueTypographyProps(
52370
- columnDefinition.cellRendererParams?.typographyProps
52371
- );
52372
52351
  const className = cx6(
52373
- columnDefinition.cellRendererParams?.typographyProps?.className,
52352
+ typographyProps?.className,
52374
52353
  "textCell",
52375
52354
  "truncatingText",
52376
52355
  {
@@ -52388,8 +52367,7 @@ var InternalLinkCellRenderer = ({ columnDefinition, isGroup, data, rowHeight, va
52388
52367
  setIsLinkWidthBelowMin(width < MIN_LINK_WIDTH);
52389
52368
  }
52390
52369
  }, [internalValue]);
52391
- const isExternalLink = columnDefinition.cellRendererParams.isExternalLink ?? false;
52392
- const URL = columnDefinition.cellRendererParams.getURL(value, data);
52370
+ const URL = getURL(value, data);
52393
52371
  const extendClickableAreaClassNames = isLinkWidthBelowMin ? cx6("extendClickableArea", {
52394
52372
  "extendClickableArea--rowHeightSm": rowHeight === rowSize.sm
52395
52373
  }) : "";
@@ -52419,23 +52397,22 @@ var LinkCellRenderer = withDataTableRenderer(
52419
52397
  "input"
52420
52398
  );
52421
52399
  var cx7 = classnames.bind(styles_default);
52422
- var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value }) => {
52400
+ var InternalNumberCellRenderer = ({
52401
+ columnDefinition,
52402
+ rowPinned,
52403
+ isGroup,
52404
+ value,
52405
+ typographyProps,
52406
+ inputProps,
52407
+ formatConfig
52408
+ }) => {
52423
52409
  const I18n = useI18nContext();
52424
52410
  if (isEmptyValue(value)) {
52425
52411
  if (isGroup) {
52426
52412
  return null;
52427
52413
  }
52428
52414
  if (columnDefinition.editable) {
52429
- return /* @__PURE__ */ React80.createElement(
52430
- Typography,
52431
- {
52432
- ...getCellValueTypographyProps(
52433
- columnDefinition.cellRendererParams?.typographyProps
52434
- ),
52435
- className: cx7("input-placeholder")
52436
- },
52437
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder")
52438
- );
52415
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx7("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder"));
52439
52416
  }
52440
52417
  return /* @__PURE__ */ React80.createElement(React80.Fragment, null);
52441
52418
  }
@@ -52444,7 +52421,7 @@ var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value
52444
52421
  minDecimalPrecision: 0,
52445
52422
  shouldUseGtk: true,
52446
52423
  symbol: "",
52447
- ...columnDefinition.cellRendererParams?.formatConfig
52424
+ ...formatConfig
52448
52425
  });
52449
52426
  if (isGroup) {
52450
52427
  return /* @__PURE__ */ React80.createElement(Typography, { intent: "small", weight: "semibold" }, internalValue);
@@ -52452,10 +52429,8 @@ var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value
52452
52429
  return /* @__PURE__ */ React80.createElement(
52453
52430
  Typography,
52454
52431
  {
52455
- ...getCellValueTypographyProps(
52456
- columnDefinition.cellRendererParams?.typographyProps
52457
- ),
52458
- weight: rowPinned ? "bold" : columnDefinition.cellRendererParams?.typographyProps?.weight
52432
+ ...typographyProps,
52433
+ weight: rowPinned ? "bold" : typographyProps?.weight
52459
52434
  },
52460
52435
  internalValue
52461
52436
  );
@@ -52464,7 +52439,7 @@ var NumberCellRenderer = withDataTableRenderer(
52464
52439
  InternalNumberCellRenderer,
52465
52440
  "input"
52466
52441
  );
52467
- var InternalNumberCellEditor = React80.forwardRef(({ columnDefinition, stopEditing, value }, ref) => {
52442
+ var InternalNumberCellEditor = React80.forwardRef(({ columnDefinition, stopEditing, value, inputProps }, ref) => {
52468
52443
  const I18n = useI18nContext();
52469
52444
  if (isEmptyValue(value) && !columnDefinition.editable) {
52470
52445
  return null;
@@ -52475,13 +52450,13 @@ var InternalNumberCellEditor = React80.forwardRef(({ columnDefinition, stopEditi
52475
52450
  return /* @__PURE__ */ React80.createElement(
52476
52451
  Input,
52477
52452
  {
52478
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder"),
52453
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.numberCell.placeholder"),
52479
52454
  type: "number",
52480
52455
  defaultValue: value,
52481
52456
  onBlur,
52482
52457
  ref,
52483
52458
  className: cx7("input-cell", "input-cell--right-aligned"),
52484
- ...columnDefinition.cellEditorParams?.inputProps || {}
52459
+ ...inputProps
52485
52460
  }
52486
52461
  );
52487
52462
  });
@@ -52562,35 +52537,41 @@ var defaultAvatarStackItemFilter = (person) => !!person || !!person.id;
52562
52537
  var Renderer6 = ({
52563
52538
  columnDefinition,
52564
52539
  rowHeight,
52565
- value
52540
+ value,
52541
+ getValue: getValue2,
52542
+ getCompanyName: getCompanyNameParam,
52543
+ getPersonName: getPersonNameParam,
52544
+ getInitials,
52545
+ getImageURL,
52546
+ typographyProps
52566
52547
  }) => {
52567
52548
  const [fullCellView, setFullCellView] = React80.useState(false);
52568
52549
  const getPeople = React80.useCallback(() => {
52569
- return columnDefinition.cellRendererParams?.getValue?.(value) || value || [];
52570
- }, [columnDefinition.cellRendererParams?.getValue, value]);
52550
+ return getValue2?.(value) || value || [];
52551
+ }, [getValue2, value]);
52571
52552
  const getCompanyName = React80.useCallback(
52572
52553
  (person) => {
52573
- return columnDefinition.cellRendererParams?.getCompanyName?.(person) ?? person.company ?? "";
52554
+ return getCompanyNameParam?.(person) ?? person.company ?? "";
52574
52555
  },
52575
- [columnDefinition.cellRendererParams?.getCompanyName]
52556
+ [getCompanyNameParam]
52576
52557
  );
52577
52558
  const getPersonName = React80.useCallback(
52578
52559
  (person) => {
52579
- return columnDefinition.cellRendererParams?.getPersonName?.(person) ?? person.name ?? "";
52560
+ return getPersonNameParam?.(person) ?? person.name ?? "";
52580
52561
  },
52581
- [columnDefinition.cellRendererParams?.getPersonName]
52562
+ [getPersonNameParam]
52582
52563
  );
52583
52564
  const getPersonImageUrl = React80.useCallback(
52584
52565
  (person) => {
52585
- return columnDefinition.cellRendererParams?.getImageURL?.(person) ?? "";
52566
+ return getImageURL?.(person) ?? "";
52586
52567
  },
52587
- [columnDefinition.cellRendererParams?.getImageURL]
52568
+ [getImageURL]
52588
52569
  );
52589
52570
  const getPersonInitials = React80.useCallback(
52590
52571
  (person) => {
52591
- return columnDefinition.cellRendererParams?.getInitials?.(person) ?? "";
52572
+ return getInitials?.(person) ?? "";
52592
52573
  },
52593
- [columnDefinition.cellRendererParams?.getInitials]
52574
+ [getInitials]
52594
52575
  );
52595
52576
  const getPersonNameWithCompany = React80.useCallback(
52596
52577
  (person) => {
@@ -52618,9 +52599,6 @@ var Renderer6 = ({
52618
52599
  }
52619
52600
  return avatarWidth * avatarCount;
52620
52601
  }, [getPeople, rowHeight]);
52621
- const typographyProps = getCellValueTypographyProps(
52622
- columnDefinition.cellRendererParams?.typographyProps
52623
- );
52624
52602
  const people = getPeople();
52625
52603
  if (isEmptyValue(value) || people.length === 0) {
52626
52604
  return null;
@@ -52729,7 +52707,10 @@ var Renderer7 = ({
52729
52707
  columnDefinition,
52730
52708
  isGroup,
52731
52709
  rowPinned,
52732
- value
52710
+ value,
52711
+ typographyProps,
52712
+ inputProps,
52713
+ formatConfig
52733
52714
  }) => {
52734
52715
  const I18n = useI18nContext();
52735
52716
  if (isEmptyValue(value)) {
@@ -52737,22 +52718,10 @@ var Renderer7 = ({
52737
52718
  return null;
52738
52719
  }
52739
52720
  if (columnDefinition.editable) {
52740
- return /* @__PURE__ */ React80.createElement(
52741
- Typography,
52742
- {
52743
- ...getCellValueTypographyProps(
52744
- columnDefinition.cellRendererParams?.typographyProps
52745
- ),
52746
- className: cx9("input-placeholder")
52747
- },
52748
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder")
52749
- );
52721
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx9("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder"));
52750
52722
  }
52751
52723
  }
52752
- const internalValue = formatPercentage(
52753
- value?.toString() ?? "",
52754
- columnDefinition.cellRendererParams?.formatConfig
52755
- );
52724
+ const internalValue = formatPercentage(value?.toString() ?? "", formatConfig);
52756
52725
  if (isGroup) {
52757
52726
  return /* @__PURE__ */ React80.createElement(
52758
52727
  Typography,
@@ -52767,48 +52736,60 @@ var Renderer7 = ({
52767
52736
  return /* @__PURE__ */ React80.createElement(
52768
52737
  Typography,
52769
52738
  {
52770
- ...getCellValueTypographyProps(
52771
- columnDefinition.cellRendererParams?.typographyProps
52772
- ),
52773
- weight: rowPinned ? "bold" : columnDefinition.cellRendererParams?.typographyProps?.weight,
52739
+ ...typographyProps,
52740
+ weight: rowPinned ? "bold" : typographyProps?.weight,
52774
52741
  className: cx9("tabular-nums")
52775
52742
  },
52776
52743
  internalValue
52777
52744
  );
52778
52745
  };
52779
52746
  var PercentCellRenderer = withDataTableRenderer(Renderer7, "input");
52780
- var Editor4 = React80.forwardRef(({ columnDefinition, eventKey, stopEditing, value }, ref) => {
52781
- const I18n = useI18nContext();
52782
- function onBlur(event) {
52783
- stopEditing(ensureIsHTMLElement(event.relatedTarget));
52784
- }
52785
- if (isEmptyValue(value) && !columnDefinition.editable) {
52786
- return null;
52787
- }
52788
- const defaultValue = eventKey ? value : formatNumber(value, {
52789
- ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
52790
- symbol: void 0,
52791
- symbolAfterValue: void 0
52792
- });
52793
- return /* @__PURE__ */ React80.createElement(
52794
- Input,
52795
- {
52796
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder"),
52797
- className: cx9("input-cell", "input-cell--right-aligned"),
52798
- defaultValue,
52799
- onBlur,
52800
- ref,
52801
- style: { textAlign: "right" },
52802
- ...columnDefinition.cellEditorParams?.inputProps || {}
52747
+ var Editor4 = React80.forwardRef(
52748
+ ({
52749
+ columnDefinition,
52750
+ eventKey,
52751
+ stopEditing,
52752
+ value,
52753
+ formatConfig,
52754
+ inputProps
52755
+ }, ref) => {
52756
+ const I18n = useI18nContext();
52757
+ function onBlur(event) {
52758
+ stopEditing(ensureIsHTMLElement(event.relatedTarget));
52803
52759
  }
52804
- );
52805
- });
52760
+ if (isEmptyValue(value) && !columnDefinition.editable) {
52761
+ return null;
52762
+ }
52763
+ const defaultValue = eventKey ? value : formatNumber(value, {
52764
+ ...formatConfig || columnDefinition.cellRendererParams?.formatConfig,
52765
+ //TODO remove usage of columnDefinition.cellRendererParams in next major version
52766
+ symbol: void 0,
52767
+ symbolAfterValue: void 0
52768
+ });
52769
+ return /* @__PURE__ */ React80.createElement(
52770
+ Input,
52771
+ {
52772
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.percentCell.placeholder"),
52773
+ className: cx9("input-cell", "input-cell--right-aligned"),
52774
+ defaultValue,
52775
+ onBlur,
52776
+ ref,
52777
+ style: { textAlign: "right" },
52778
+ ...inputProps
52779
+ }
52780
+ );
52781
+ }
52782
+ );
52806
52783
  var PercentCellEditor = withDataTableEditor(Editor4, "input");
52807
52784
  var Renderer8 = ({
52808
- columnDefinition,
52809
52785
  rowHeight,
52810
52786
  isGroup,
52811
- value
52787
+ value,
52788
+ getPersonName,
52789
+ getCompanyName,
52790
+ getImageURL,
52791
+ getInitials,
52792
+ typographyProps
52812
52793
  }) => {
52813
52794
  const [showAvatar, setShowAvatar] = React80.useState(false);
52814
52795
  React80.useEffect(() => {
@@ -52817,13 +52798,10 @@ var Renderer8 = ({
52817
52798
  if (value === void 0 || value === null) {
52818
52799
  return null;
52819
52800
  }
52820
- const name = columnDefinition.cellRendererParams?.getPersonName?.(value);
52821
- const companyName = columnDefinition.cellRendererParams?.getCompanyName?.(value);
52822
- const imageURL = columnDefinition.cellRendererParams?.getImageURL?.(value);
52823
- const initials = columnDefinition.cellRendererParams?.getInitials?.(value);
52824
- const typographyProps = getCellValueTypographyProps(
52825
- columnDefinition.cellRendererParams?.typographyProps
52826
- );
52801
+ const name = getPersonName?.(value);
52802
+ const companyName = getCompanyName?.(value);
52803
+ const imageURL = getImageURL?.(value);
52804
+ const initials = getInitials?.(value);
52827
52805
  if (isGroup) {
52828
52806
  return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, weight: "semibold" }, name);
52829
52807
  }
@@ -52847,34 +52825,25 @@ var Renderer9 = ({
52847
52825
  columnDefinition,
52848
52826
  isGroup,
52849
52827
  value,
52850
- rowPinned
52828
+ rowPinned,
52829
+ getColor,
52830
+ displayAsPill,
52831
+ typographyProps,
52832
+ placeholder
52851
52833
  }) => {
52852
- const { getColor, displayAsPill } = columnDefinition.cellRendererParams;
52853
52834
  const I18n = useI18nContext();
52854
52835
  if (isEmptyValue(value)) {
52855
52836
  if (isGroup) {
52856
52837
  return null;
52857
52838
  }
52858
52839
  if (columnDefinition.editable) {
52859
- return /* @__PURE__ */ React80.createElement(
52860
- Typography,
52861
- {
52862
- ...getCellValueTypographyProps(
52863
- columnDefinition.cellRendererParams?.typographyProps
52864
- ),
52865
- className: cx10("input-placeholder")
52866
- },
52867
- columnDefinition.cellEditorParams?.placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52868
- label: columnDefinition.headerName
52869
- })
52870
- );
52840
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx10("input-placeholder") }, placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52841
+ label: columnDefinition.headerName
52842
+ }));
52871
52843
  }
52872
52844
  return null;
52873
52845
  }
52874
52846
  const label = columnDefinition.getStringFormattedValue?.(value) || value;
52875
- const typographyProps = getCellValueTypographyProps(
52876
- columnDefinition.cellRendererParams?.typographyProps
52877
- );
52878
52847
  if ((isGroup || rowPinned && columnDefinition.aggFunc) && !displayAsPill) {
52879
52848
  return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, weight: "semibold" }, label);
52880
52849
  }
@@ -52882,7 +52851,18 @@ var Renderer9 = ({
52882
52851
  };
52883
52852
  var PillCellRenderer = withDataTableRenderer(Renderer9, "select");
52884
52853
  var Editor5 = React80.forwardRef(
52885
- ({ columnDefinition, data, setDataValue, stopEditing, value }, ref) => {
52854
+ ({
52855
+ columnDefinition,
52856
+ data,
52857
+ setDataValue,
52858
+ stopEditing,
52859
+ value,
52860
+ selectOptions,
52861
+ getId: getIdParam,
52862
+ placeholder,
52863
+ getColor,
52864
+ clearable
52865
+ }, ref) => {
52886
52866
  const [options, setOptions] = React80.useState([]);
52887
52867
  const [loading, setLoading] = React80.useState(false);
52888
52868
  const I18n = useI18nContext();
@@ -52890,7 +52870,6 @@ var Editor5 = React80.forwardRef(
52890
52870
  stopEditing();
52891
52871
  }
52892
52872
  async function beforeShow() {
52893
- const selectOptions = columnDefinition.cellEditorParams?.selectOptions || [];
52894
52873
  if (Array.isArray(selectOptions)) {
52895
52874
  setOptions(selectOptions);
52896
52875
  } else {
@@ -52907,7 +52886,7 @@ var Editor5 = React80.forwardRef(
52907
52886
  setDataValue(columnDefinition.field, null);
52908
52887
  }
52909
52888
  function getId3(item) {
52910
- return columnDefinition.cellEditorParams?.getId?.(item) ?? item;
52889
+ return getIdParam?.(item) ?? item;
52911
52890
  }
52912
52891
  function getLabel3(item) {
52913
52892
  const unformattedLabel = columnDefinition.getStringFormattedValue?.(item) || "";
@@ -52916,17 +52895,17 @@ var Editor5 = React80.forwardRef(
52916
52895
  return /* @__PURE__ */ React80.createElement(
52917
52896
  PillSelect,
52918
52897
  {
52919
- placeholder: columnDefinition.cellEditorParams?.placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52898
+ placeholder: placeholder || I18n.t("dataTable.cells.pillCell.placeholder", {
52920
52899
  label: columnDefinition.headerName
52921
52900
  }),
52922
52901
  afterHide,
52923
52902
  beforeShow,
52924
52903
  block: true,
52925
- getColor: columnDefinition.cellEditorParams?.getColor ?? columnDefinition.cellRendererParams.getColor,
52904
+ getColor,
52926
52905
  getId: getId3,
52927
52906
  getLabel: getLabel3,
52928
52907
  loading,
52929
- onClear: columnDefinition.cellEditorParams?.clearable ? onClear : void 0,
52908
+ onClear: clearable ? onClear : void 0,
52930
52909
  onSelect,
52931
52910
  options,
52932
52911
  ref,
@@ -52971,13 +52950,12 @@ function useSearch(data, onSearchFunction) {
52971
52950
  setSearchResultOptions
52972
52951
  };
52973
52952
  }
52974
- function useSelectOptions(columnDefinition, data) {
52953
+ function useSelectOptions(selectOptions, data) {
52975
52954
  const [options, setOptions] = React80.useState([]);
52976
52955
  const [loading, setLoading] = React80.useState(false);
52977
52956
  const [totalOptions, setTotalOptions] = React80.useState(0);
52978
52957
  const fetchOptions = async (offset4) => {
52979
52958
  setLoading(true);
52980
- const selectOptions = columnDefinition.cellEditorParams?.selectOptions || [];
52981
52959
  let newOptions = [];
52982
52960
  let total = 0;
52983
52961
  if (typeof selectOptions === "function") {
@@ -53009,7 +52987,9 @@ var cx11 = classnames.bind({ ...styles_default, ...truncation_default });
53009
52987
  var Renderer10 = ({
53010
52988
  columnDefinition,
53011
52989
  isGroup,
53012
- value
52990
+ value,
52991
+ typographyProps,
52992
+ placeholder
53013
52993
  }) => {
53014
52994
  const I18n = useI18nContext();
53015
52995
  if (isEmptyValue(value)) {
@@ -53017,24 +52997,12 @@ var Renderer10 = ({
53017
52997
  return null;
53018
52998
  }
53019
52999
  if (columnDefinition.editable) {
53020
- return /* @__PURE__ */ React80.createElement(
53021
- Typography,
53022
- {
53023
- ...getCellValueTypographyProps(
53024
- columnDefinition.cellRendererParams?.typographyProps
53025
- ),
53026
- className: cx11("truncatingText")
53027
- },
53028
- columnDefinition.cellEditorParams?.placeholder || I18n.t("dataTable.cells.selectCell.placeholder", {
53029
- label: columnDefinition.headerName
53030
- })
53031
- );
53000
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx11("truncatingText") }, placeholder || I18n.t("dataTable.cells.selectCell.placeholder", {
53001
+ label: columnDefinition.headerName
53002
+ }));
53032
53003
  }
53033
53004
  }
53034
53005
  const internalValue = columnDefinition.getStringFormattedValue?.(value);
53035
- const typographyProps = getCellValueTypographyProps(
53036
- columnDefinition.cellRendererParams?.typographyProps
53037
- );
53038
53006
  if (isGroup) {
53039
53007
  return /* @__PURE__ */ React80.createElement(
53040
53008
  Typography,
@@ -53050,14 +53018,25 @@ var Renderer10 = ({
53050
53018
  };
53051
53019
  var SelectCellRenderer = withDataTableRenderer(Renderer10, "select");
53052
53020
  var Editor6 = React80.forwardRef(
53053
- ({ columnDefinition, data, setDataValue, stopEditing, value }, ref) => {
53021
+ ({
53022
+ columnDefinition,
53023
+ data,
53024
+ setDataValue,
53025
+ stopEditing,
53026
+ value,
53027
+ clearable,
53028
+ selectOptions,
53029
+ onSearch: onSearchParam,
53030
+ getId: getIdParam,
53031
+ getOptionLabel: getOptionLabelParam
53032
+ }, ref) => {
53054
53033
  const { options, loading, totalOptions, fetchOptions } = useSelectOptions(
53055
- columnDefinition,
53034
+ selectOptions,
53056
53035
  data
53057
53036
  );
53058
53037
  const { onSearch, searchResultOptions, isSearching } = useSearch(
53059
53038
  data,
53060
- columnDefinition.cellEditorParams?.onSearch
53039
+ onSearchParam
53061
53040
  );
53062
53041
  function onSelect(selection) {
53063
53042
  if (selection.item !== value) {
@@ -53080,13 +53059,13 @@ var Editor6 = React80.forwardRef(
53080
53059
  }
53081
53060
  }, 500);
53082
53061
  function getId3(val) {
53083
- return columnDefinition.cellEditorParams?.getId?.(val) ?? val;
53062
+ return getIdParam?.(val) ?? val;
53084
53063
  }
53085
53064
  function getLabel3(val) {
53086
53065
  return columnDefinition.getStringFormattedValue?.(val);
53087
53066
  }
53088
53067
  function getOptionLabel(option) {
53089
- return columnDefinition.cellEditorParams?.getOptionLabel?.(option) || getLabel3(option);
53068
+ return getOptionLabelParam?.(option) || getLabel3(option);
53090
53069
  }
53091
53070
  return /* @__PURE__ */ React80.createElement(
53092
53071
  Select,
@@ -53098,7 +53077,7 @@ var Editor6 = React80.forwardRef(
53098
53077
  loading: isSearching || loading,
53099
53078
  onSearch,
53100
53079
  onSelect,
53101
- onClear: columnDefinition.cellEditorParams?.clearable ? onClear : void 0,
53080
+ onClear: clearable ? onClear : void 0,
53102
53081
  onScrollBottom,
53103
53082
  ref,
53104
53083
  className: cx11("input-cell", "truncatingText")
@@ -53122,27 +53101,20 @@ var Renderer11 = ({
53122
53101
  rowHeight,
53123
53102
  node,
53124
53103
  isGroup,
53125
- value
53104
+ value,
53105
+ typographyProps,
53106
+ inputProps
53126
53107
  }) => {
53127
53108
  const I18n = useI18nContext();
53128
53109
  if (isEmptyValue(value) && columnDefinition.editable) {
53129
53110
  if (isGroup) {
53130
53111
  return null;
53131
53112
  }
53132
- return /* @__PURE__ */ React80.createElement(
53133
- Typography,
53134
- {
53135
- ...getCellValueTypographyProps(
53136
- columnDefinition.cellRendererParams?.typographyProps
53137
- ),
53138
- className: cx12("input-placeholder")
53139
- },
53140
- columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53141
- );
53113
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx12("input-placeholder") }, inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"));
53142
53114
  }
53143
53115
  const internalValue = columnDefinition.getStringFormattedValue?.(value) ?? value;
53144
53116
  const className = cx12(
53145
- columnDefinition.cellRendererParams?.typographyProps?.className,
53117
+ typographyProps?.className,
53146
53118
  "textCell",
53147
53119
  "truncatingText",
53148
53120
  {
@@ -53150,9 +53122,6 @@ var Renderer11 = ({
53150
53122
  "truncatingText--lg": rowHeight === rowSize.lg
53151
53123
  }
53152
53124
  );
53153
- const typographyProps = getCellValueTypographyProps(
53154
- columnDefinition.cellRendererParams?.typographyProps
53155
- );
53156
53125
  if (isGroup) {
53157
53126
  const fontWeight = node?.footer ? "regular" : "semibold";
53158
53127
  return /* @__PURE__ */ React80.createElement(
@@ -53170,7 +53139,7 @@ var Renderer11 = ({
53170
53139
  };
53171
53140
  var TextCellRenderer = withDataTableRenderer(Renderer11, "input");
53172
53141
  var Editor7 = React80.forwardRef(
53173
- ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53142
+ ({ columnDefinition, eventKey, stopEditing, value, inputProps }, ref) => {
53174
53143
  function onBlur(event) {
53175
53144
  stopEditing(ensureIsHTMLElement(event.relatedTarget));
53176
53145
  }
@@ -53179,12 +53148,12 @@ var Editor7 = React80.forwardRef(
53179
53148
  return /* @__PURE__ */ React80.createElement(
53180
53149
  Input,
53181
53150
  {
53182
- placeholder: columnDefinition.cellEditorParams?.inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"),
53183
53151
  className: cx12("input-cell"),
53184
53152
  defaultValue: internalValue,
53185
53153
  onBlur,
53186
53154
  ref,
53187
- ...columnDefinition.cellEditorParams?.inputProps || {}
53155
+ ...inputProps,
53156
+ placeholder: inputProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53188
53157
  }
53189
53158
  );
53190
53159
  }
@@ -53204,28 +53173,18 @@ var Renderer12 = ({
53204
53173
  columnDefinition,
53205
53174
  node,
53206
53175
  isGroup,
53207
- value
53176
+ value,
53177
+ typographyProps,
53178
+ textAreaProps
53208
53179
  }) => {
53209
53180
  const I18n = useI18nContext();
53210
53181
  if (isEmptyValue(value) && columnDefinition.editable) {
53211
53182
  if (isGroup) {
53212
53183
  return null;
53213
53184
  }
53214
- return /* @__PURE__ */ React80.createElement(
53215
- Typography,
53216
- {
53217
- ...getCellValueTypographyProps(
53218
- columnDefinition.cellRendererParams?.typographyProps
53219
- ),
53220
- className: cx13("input-placeholder")
53221
- },
53222
- columnDefinition.cellEditorParams?.textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53223
- );
53185
+ return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx13("input-placeholder") }, textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"));
53224
53186
  }
53225
53187
  const internalValue = columnDefinition.getStringFormattedValue?.(value) ?? value;
53226
- const typographyProps = getCellValueTypographyProps(
53227
- columnDefinition.cellRendererParams?.typographyProps
53228
- );
53229
53188
  if (isGroup) {
53230
53189
  const fontWeight = node?.footer ? "regular" : "semibold";
53231
53190
  return /* @__PURE__ */ React80.createElement(
@@ -53241,7 +53200,7 @@ var Renderer12 = ({
53241
53200
  return /* @__PURE__ */ React80.createElement(Typography, { ...typographyProps, className: cx13("textarea-cell", "text") }, internalValue);
53242
53201
  };
53243
53202
  var Editor8 = React80.forwardRef(
53244
- ({ columnDefinition, stopEditing, value }, ref) => {
53203
+ ({ columnDefinition, stopEditing, value, textAreaProps }, ref) => {
53245
53204
  function onBlur(event) {
53246
53205
  stopEditing(ensureIsHTMLElement(event.relatedTarget));
53247
53206
  }
@@ -53250,14 +53209,14 @@ var Editor8 = React80.forwardRef(
53250
53209
  return /* @__PURE__ */ React80.createElement(
53251
53210
  TextArea,
53252
53211
  {
53253
- placeholder: columnDefinition.cellEditorParams?.textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder"),
53254
53212
  className: cx13("textarea-cell", "editor-text"),
53255
53213
  defaultValue: internalValue,
53256
53214
  onBlur,
53257
53215
  ref,
53258
53216
  resize: "none",
53259
53217
  style: { lineHeight: "16px" },
53260
- ...columnDefinition.cellEditorParams?.textAreaProps || {}
53218
+ ...textAreaProps,
53219
+ placeholder: textAreaProps?.placeholder || I18n.t("dataTable.cells.textCell.placeholder")
53261
53220
  }
53262
53221
  );
53263
53222
  }
@@ -55609,11 +55568,8 @@ function getRowActions(actions, rowProps) {
55609
55568
  return actions;
55610
55569
  }
55611
55570
  var InternalRowActionsCellRenderer = (props) => {
55612
- const actions = getRowActions(
55613
- props.columnDefinition.cellRendererParams.actions,
55614
- props
55615
- );
55616
- if (props.rowPinned || props.columnDefinition.cellRendererParams.hideActionsOnGroupedRow && props.isGroup || actions.length === 0) {
55571
+ const actions = getRowActions(props.actions, props);
55572
+ if (props.rowPinned || props.hideActionsOnGroupedRow && props.isGroup || actions.length === 0) {
55617
55573
  return null;
55618
55574
  }
55619
55575
  return /* @__PURE__ */ React80.createElement(
@@ -55879,7 +55835,8 @@ var DataTableCellRenderer = ({
55879
55835
  node,
55880
55836
  editorType,
55881
55837
  value,
55882
- setValue
55838
+ setValue,
55839
+ ...props
55883
55840
  }) => {
55884
55841
  const { columnApi } = useInternalTableContext();
55885
55842
  const columnDefinition = transformToColumnDefinition(colDef);
@@ -55909,10 +55866,11 @@ var DataTableCellRenderer = ({
55909
55866
  parentData: context?.parentData,
55910
55867
  parentId: context?.parentId,
55911
55868
  rowHeight,
55912
- rowIndex: node.rowIndex,
55913
55869
  rowPinned: node.rowPinned,
55914
55870
  tableApi: tableRef?.current,
55915
- value
55871
+ value,
55872
+ ...props,
55873
+ typographyProps: getCellValueTypographyProps(props.typographyProps)
55916
55874
  };
55917
55875
  const hasValue = value !== void 0 && value !== null && value !== "";
55918
55876
  const isSelectCellComponent = columnDefinition.cellRendererSelector?.({
@@ -55992,7 +55950,8 @@ var DataTableCellEditor = React80.forwardRef(
55992
55950
  node,
55993
55951
  parseValue,
55994
55952
  stopEditing,
55995
- value
55953
+ value,
55954
+ ...props
55996
55955
  }, ref) => {
55997
55956
  const startingValue = getStartingValue(eventKey, editorType, value);
55998
55957
  const [currentValue, setCurrentValue] = useState(startingValue);
@@ -56099,7 +56058,7 @@ var DataTableCellEditor = React80.forwardRef(
56099
56058
  setCurrentValue(newValue);
56100
56059
  },
56101
56060
  stopEditing: (relatedTarget) => {
56102
- const isRelatedTargetOutsideTable = relatedTarget?.closest('[data-qa="data-table-table') === null;
56061
+ const isRelatedTargetOutsideTable = relatedTarget?.closest('[data-qa="data-table-table"]') === null;
56103
56062
  stopEditing(isRelatedTargetOutsideTable);
56104
56063
  if (isRelatedTargetOutsideTable) {
56105
56064
  api.clearFocusedCell();
@@ -56108,7 +56067,8 @@ var DataTableCellEditor = React80.forwardRef(
56108
56067
  },
56109
56068
  tableApi: tableRef?.current,
56110
56069
  value: currentValue,
56111
- ref: handleRefs(editorType)
56070
+ ref: handleRefs(editorType),
56071
+ ...props
56112
56072
  }
56113
56073
  )
56114
56074
  );
@@ -57185,7 +57145,17 @@ function getLabel2(func, option) {
57185
57145
  function getId2(func, option) {
57186
57146
  return func?.(option) ?? option?.id ?? option;
57187
57147
  }
57188
- var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) => {
57148
+ var InternalMultiSelectCellRenderer = ({
57149
+ columnDefinition,
57150
+ rowHeight,
57151
+ value,
57152
+ getValue: getValueParam,
57153
+ enablePlaceholder: enablePlaceholderParam,
57154
+ placeholder: placeholderParam,
57155
+ typographyProps,
57156
+ getLabel: getLabelParam,
57157
+ getId: getIdParam
57158
+ }) => {
57189
57159
  const I18n = useI18nContext();
57190
57160
  const ref = React80.useRef();
57191
57161
  React80.useLayoutEffect(() => {
@@ -57194,20 +57164,14 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
57194
57164
  if (value === void 0 || value === null) {
57195
57165
  return null;
57196
57166
  }
57197
- const options = getValue(
57198
- columnDefinition.cellRendererParams?.getValue,
57199
- value,
57200
- emptyArray
57201
- );
57202
- const enablePlaceholder = (columnDefinition.cellRendererParams?.enablePlaceholder && columnDefinition.editable) ?? false;
57203
- const placeholder = columnDefinition.cellRendererParams?.placeholder ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
57167
+ const options = getValue(getValueParam, value, emptyArray);
57168
+ const enablePlaceholder = (enablePlaceholderParam && columnDefinition.editable) ?? false;
57169
+ const placeholder = placeholderParam ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
57204
57170
  return /* @__PURE__ */ React80.createElement(
57205
57171
  Typography,
57206
57172
  {
57207
57173
  as: "ol",
57208
- ...getCellValueTypographyProps(
57209
- columnDefinition.cellRendererParams?.typographyProps
57210
- ),
57174
+ ...typographyProps,
57211
57175
  className: cx16("inlineListItems", "truncatingText", {
57212
57176
  "truncatingText--md": rowHeight === rowSize.md,
57213
57177
  "truncatingText--lg": rowHeight === rowSize.lg
@@ -57215,14 +57179,8 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
57215
57179
  ref
57216
57180
  },
57217
57181
  options.length ? options.map((option, idx, arr) => {
57218
- const label = getLabel2(
57219
- columnDefinition.cellRendererParams?.getLabel,
57220
- option
57221
- );
57222
- const optionId = getId2(
57223
- columnDefinition.cellRendererParams?.getId,
57224
- option
57225
- );
57182
+ const label = getLabel2(getLabelParam, option);
57183
+ const optionId = getId2(getIdParam, option);
57226
57184
  const key = `${label}_${optionId}_idx_${idx}`;
57227
57185
  return /* @__PURE__ */ React80.createElement(React80.Fragment, { key }, /* @__PURE__ */ React80.createElement("li", null, label, idx !== arr.length - 1 ? commaToken : null));
57228
57186
  }) : enablePlaceholder ? /* @__PURE__ */ React80.createElement("li", { style: { color: colors.gray45 } }, placeholder) : null
@@ -57232,63 +57190,80 @@ var MultiSelectCellRenderer = withDataTableRenderer(
57232
57190
  InternalMultiSelectCellRenderer,
57233
57191
  "select"
57234
57192
  );
57235
- var MultiSelectEditor = React80.forwardRef(({ columnDefinition, value = [], setDataValue, data, stopEditing }, ref) => {
57236
- const [selectedValue, setSelectedValue] = React80.useState(value);
57237
- const { options, loading, totalOptions, fetchOptions } = useSelectOptions(
57193
+ var MultiSelectEditor = React80.forwardRef(
57194
+ ({
57238
57195
  columnDefinition,
57239
- data
57240
- );
57241
- const { onSearch: editorOnSearch } = columnDefinition.cellEditorParams || {};
57242
- const shouldSearch = options.length < totalOptions && !!editorOnSearch;
57243
- const { onSearch, searchResultOptions, setSearchResultOptions, isSearching } = useSearch(data, shouldSearch ? editorOnSearch : void 0);
57244
- async function beforeShow() {
57245
- if (options.length === 0) {
57246
- await fetchOptions();
57196
+ value = [],
57197
+ setDataValue,
57198
+ data,
57199
+ stopEditing,
57200
+ selectOptions,
57201
+ placeholder,
57202
+ onSearch: editorOnSearch,
57203
+ getLabel: getLabelParam,
57204
+ getId: getIdParam
57205
+ }, ref) => {
57206
+ const [selectedValue, setSelectedValue] = React80.useState(value);
57207
+ const { options, loading, totalOptions, fetchOptions } = useSelectOptions(
57208
+ selectOptions,
57209
+ data
57210
+ );
57211
+ const shouldSearch = options.length < totalOptions && !!editorOnSearch;
57212
+ const {
57213
+ onSearch,
57214
+ searchResultOptions,
57215
+ setSearchResultOptions,
57216
+ isSearching
57217
+ } = useSearch(data, shouldSearch ? editorOnSearch : void 0);
57218
+ async function beforeShow() {
57219
+ if (options.length === 0) {
57220
+ await fetchOptions();
57221
+ }
57222
+ return true;
57247
57223
  }
57248
- return true;
57249
- }
57250
- const onScrollBottom = debounce5(async () => {
57251
- if (!searchResultOptions && options.length < totalOptions) {
57252
- const nextOffset = options.length;
57253
- await fetchOptions(nextOffset);
57224
+ const onScrollBottom = debounce5(async () => {
57225
+ if (!searchResultOptions && options.length < totalOptions) {
57226
+ const nextOffset = options.length;
57227
+ await fetchOptions(nextOffset);
57228
+ }
57229
+ }, 500);
57230
+ function onChange(value2) {
57231
+ setSelectedValue(value2);
57232
+ setDataValue(columnDefinition.field, value2);
57233
+ if (searchResultOptions) {
57234
+ setSearchResultOptions(void 0);
57235
+ }
57254
57236
  }
57255
- }, 500);
57256
- function onChange(value2) {
57257
- setSelectedValue(value2);
57258
- setDataValue(columnDefinition.field, value2);
57259
- if (searchResultOptions) {
57260
- setSearchResultOptions(void 0);
57237
+ function getLabel3(func, option) {
57238
+ return func?.(option) ?? option?.label ?? option?.name ?? option;
57261
57239
  }
57262
- }
57263
- function getLabel3(func, option) {
57264
- return func?.(option) ?? option?.label ?? option?.name ?? option;
57265
- }
57266
- function getId3(func, option) {
57267
- return func?.(option) ?? option?.id ?? option;
57268
- }
57269
- return /* @__PURE__ */ React80.createElement(
57270
- MultiSelect,
57271
- {
57272
- beforeShow,
57273
- afterHide: () => stopEditing(),
57274
- block: true,
57275
- loading: isSearching || loading,
57276
- getId: (option) => {
57277
- return getId3(columnDefinition.cellEditorParams?.getId, option);
57278
- },
57279
- getLabel: (option) => {
57280
- return getLabel3(columnDefinition.cellEditorParams?.getLabel, option);
57281
- },
57282
- placeholder: columnDefinition.cellEditorParams?.placeholder,
57283
- onScrollBottom,
57284
- onSearch,
57285
- onChange,
57286
- options: searchResultOptions || options,
57287
- value: selectedValue,
57288
- ref
57240
+ function getId3(func, option) {
57241
+ return func?.(option) ?? option?.id ?? option;
57289
57242
  }
57290
- );
57291
- });
57243
+ return /* @__PURE__ */ React80.createElement(
57244
+ MultiSelect,
57245
+ {
57246
+ beforeShow,
57247
+ afterHide: () => stopEditing(),
57248
+ block: true,
57249
+ loading: isSearching || loading,
57250
+ getId: (option) => {
57251
+ return getId3(getIdParam, option);
57252
+ },
57253
+ getLabel: (option) => {
57254
+ return getLabel3(getLabelParam, option);
57255
+ },
57256
+ placeholder,
57257
+ onScrollBottom,
57258
+ onSearch,
57259
+ onChange,
57260
+ options: searchResultOptions || options,
57261
+ value: selectedValue,
57262
+ ref
57263
+ }
57264
+ );
57265
+ }
57266
+ );
57292
57267
  var MultiSelectCellEditor = withDataTableEditor(
57293
57268
  MultiSelectEditor,
57294
57269
  "select"