@procore/data-table 14.23.2 → 14.24.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.
@@ -55209,6 +55209,17 @@ function transformServerSideRequestObj(request, filtersState, searchValue) {
55209
55209
  )
55210
55210
  };
55211
55211
  }
55212
+ function isNumberFilterCondition(item) {
55213
+ return item && [
55214
+ "lessThan",
55215
+ "greaterThan",
55216
+ "isEqual",
55217
+ "inRange",
55218
+ "greaterThanOrEqual",
55219
+ "lessThanOrEqual",
55220
+ "no_value"
55221
+ ].includes(item.type);
55222
+ }
55212
55223
  var transformFilterValue = (value, field, formatter) => {
55213
55224
  const formattedValue = formatter?.(value, field);
55214
55225
  if (formattedValue)
@@ -55217,6 +55228,33 @@ var transformFilterValue = (value, field, formatter) => {
55217
55228
  return formatISO(value.date, { representation: "date" });
55218
55229
  return value.toString();
55219
55230
  };
55231
+ function buildNumberFilterParams(filters) {
55232
+ return filters.reduce((acc, filter, idx) => {
55233
+ const singleExpr = mapFilterToQueryParam(filter);
55234
+ if (idx === 0)
55235
+ return singleExpr;
55236
+ const separator = filter.operator === "or" ? "|" : ",";
55237
+ return acc + separator + singleExpr;
55238
+ }, "");
55239
+ }
55240
+ function mapFilterToQueryParam(filter) {
55241
+ const operatorMap = {
55242
+ lessThan: "lt",
55243
+ lessThanOrEqual: "lte",
55244
+ greaterThan: "gt",
55245
+ greaterThanOrEqual: "gte",
55246
+ isEqual: "eq",
55247
+ inRange: "range",
55248
+ no_value: "null"
55249
+ };
55250
+ if (filter.type === "inRange") {
55251
+ return `range:${filter.value}-${filter.valueTo}`;
55252
+ }
55253
+ if (filter.type === "no_value") {
55254
+ return "null";
55255
+ }
55256
+ return operatorMap[filter.type] ? `${operatorMap[filter.type]}:${filter.value}` : String(filter.value ?? "");
55257
+ }
55220
55258
  function getServerSideParams(request, filtersState, searchValue, options = {}) {
55221
55259
  const params = new URLSearchParams();
55222
55260
  if (options.pagination !== false) {
@@ -55240,10 +55278,17 @@ function getServerSideParams(request, filtersState, searchValue, options = {}) {
55240
55278
  if (options.filters !== false) {
55241
55279
  const formatter = options.filterValueFormatter;
55242
55280
  filtersState.forEach((filter) => {
55243
- const value = filter.selected.length === 1 ? transformFilterValue(filter.selected[0], filter.field, formatter) : `[${filter.selected.map(
55244
- (value2) => transformFilterValue(value2, filter.field, formatter)
55245
- )}]`;
55246
- params.set(`filters[${filter.field}]`, value);
55281
+ const isNumericCondition = filter.selected.every(isNumberFilterCondition);
55282
+ const hasCustomFormatter = typeof formatter === "function";
55283
+ if (isNumericCondition && filter.selected.length > 0 && !hasCustomFormatter) {
55284
+ const numericExpr = buildNumberFilterParams(filter.selected);
55285
+ params.set(`filters[${filter.field}]`, numericExpr);
55286
+ } else {
55287
+ const value = filter.selected.length === 1 ? transformFilterValue(filter.selected[0], filter.field, formatter) : `[${filter.selected.map(
55288
+ (val) => transformFilterValue(val, filter.field, formatter)
55289
+ )}]`;
55290
+ params.set(`filters[${filter.field}]`, value);
55291
+ }
55247
55292
  });
55248
55293
  request.groupKeys.forEach((groupKey, index) => {
55249
55294
  params.set(`filters[${request.rowGroupCols[index].field}]`, groupKey);
@@ -56423,6 +56468,7 @@ var getMainMenuItems = (props, I18n) => {
56423
56468
  value: "resetColumns",
56424
56469
  action() {
56425
56470
  props.columnApi.resetColumnState();
56471
+ props.onTableConfigChange();
56426
56472
  }
56427
56473
  };
56428
56474
  const rowUngroup = {
@@ -105034,6 +105080,12 @@ var de_DE_default = {
105034
105080
  less_than_equal_to: "Ist kleiner als oder gleich",
105035
105081
  no_value: "Kein Wert"
105036
105082
  }
105083
+ },
105084
+ multiSelectQuickFilter: {
105085
+ ariaLabel: "Schnell-Filter: mehrere Optionen ausw\xE4hlen"
105086
+ },
105087
+ singleSelectQuickFilter: {
105088
+ ariaLabel: "Schnell-Filter: eine Option ausw\xE4hlen"
105037
105089
  }
105038
105090
  },
105039
105091
  loading: {
@@ -105120,6 +105172,9 @@ var de_DE_default = {
105120
105172
  groupCell: {
105121
105173
  expand: "Gruppe erweitern",
105122
105174
  collapse: "Gruppe ausblenden"
105175
+ },
105176
+ rowCheckbox: {
105177
+ ariaLabel: "Zeile ausw\xE4hlen"
105123
105178
  }
105124
105179
  }
105125
105180
  };
@@ -105185,6 +105240,12 @@ var en_AU_default = {
105185
105240
  less_than_equal_to: "Is less than or equal to",
105186
105241
  no_value: "No value"
105187
105242
  }
105243
+ },
105244
+ multiSelectQuickFilter: {
105245
+ ariaLabel: "Quick filter: Select multiple options"
105246
+ },
105247
+ singleSelectQuickFilter: {
105248
+ ariaLabel: "Quick filter: Select an option"
105188
105249
  }
105189
105250
  },
105190
105251
  loading: {
@@ -105271,6 +105332,9 @@ var en_AU_default = {
105271
105332
  groupCell: {
105272
105333
  expand: "Expand group",
105273
105334
  collapse: "Collapse group"
105335
+ },
105336
+ rowCheckbox: {
105337
+ ariaLabel: "Select row"
105274
105338
  }
105275
105339
  }
105276
105340
  };
@@ -105336,6 +105400,12 @@ var en_CA_default = {
105336
105400
  less_than_equal_to: "Is less than or equal to",
105337
105401
  no_value: "No value"
105338
105402
  }
105403
+ },
105404
+ multiSelectQuickFilter: {
105405
+ ariaLabel: "Quick filter: Select multiple options"
105406
+ },
105407
+ singleSelectQuickFilter: {
105408
+ ariaLabel: "Quick filter: Select an option"
105339
105409
  }
105340
105410
  },
105341
105411
  loading: {
@@ -105422,6 +105492,9 @@ var en_CA_default = {
105422
105492
  groupCell: {
105423
105493
  expand: "Expand group",
105424
105494
  collapse: "Collapse group"
105495
+ },
105496
+ rowCheckbox: {
105497
+ ariaLabel: "Select row"
105425
105498
  }
105426
105499
  }
105427
105500
  };
@@ -105487,6 +105560,12 @@ var en_GB_default = {
105487
105560
  less_than_equal_to: "Is less than or equal to",
105488
105561
  no_value: "No value"
105489
105562
  }
105563
+ },
105564
+ multiSelectQuickFilter: {
105565
+ ariaLabel: "Quick filter: Select multiple options"
105566
+ },
105567
+ singleSelectQuickFilter: {
105568
+ ariaLabel: "Quick filter: Select an option"
105490
105569
  }
105491
105570
  },
105492
105571
  loading: {
@@ -105573,6 +105652,9 @@ var en_GB_default = {
105573
105652
  groupCell: {
105574
105653
  expand: "Expand group",
105575
105654
  collapse: "Collapse group"
105655
+ },
105656
+ rowCheckbox: {
105657
+ ariaLabel: "Select row"
105576
105658
  }
105577
105659
  }
105578
105660
  };
@@ -105798,6 +105880,12 @@ var es_ES_default = {
105798
105880
  less_than_equal_to: "Es menor o igual que",
105799
105881
  no_value: "Ning\xFAn valor"
105800
105882
  }
105883
+ },
105884
+ multiSelectQuickFilter: {
105885
+ ariaLabel: "Filtro r\xE1pido: seleccionar varias opciones"
105886
+ },
105887
+ singleSelectQuickFilter: {
105888
+ ariaLabel: "Filtro r\xE1pido: seleccionar una opci\xF3n"
105801
105889
  }
105802
105890
  },
105803
105891
  loading: {
@@ -105884,6 +105972,9 @@ var es_ES_default = {
105884
105972
  groupCell: {
105885
105973
  expand: "Expandir grupo",
105886
105974
  collapse: "Contraer grupo"
105975
+ },
105976
+ rowCheckbox: {
105977
+ ariaLabel: "Seleccionar fila"
105887
105978
  }
105888
105979
  }
105889
105980
  };
@@ -105949,6 +106040,12 @@ var es_default = {
105949
106040
  less_than_equal_to: "Es menor o igual a",
105950
106041
  no_value: "Ning\xFAn valor"
105951
106042
  }
106043
+ },
106044
+ multiSelectQuickFilter: {
106045
+ ariaLabel: "Filtro r\xE1pido: Seleccione varias opciones"
106046
+ },
106047
+ singleSelectQuickFilter: {
106048
+ ariaLabel: "Filtro r\xE1pido: Seleccione una opci\xF3n"
105952
106049
  }
105953
106050
  },
105954
106051
  loading: {
@@ -106035,6 +106132,9 @@ var es_default = {
106035
106132
  groupCell: {
106036
106133
  expand: "Expandir grupo",
106037
106134
  collapse: "Colapsar grupo"
106135
+ },
106136
+ rowCheckbox: {
106137
+ ariaLabel: "Seleccionar fila"
106038
106138
  }
106039
106139
  }
106040
106140
  };
@@ -106100,6 +106200,12 @@ var fr_CA_default = {
106100
106200
  less_than_equal_to: "Est inf\xE9rieur ou \xE9gal \xE0",
106101
106201
  no_value: "Aucune valeur"
106102
106202
  }
106203
+ },
106204
+ multiSelectQuickFilter: {
106205
+ ariaLabel: "Filtre rapide\xA0: s\xE9lectionner plusieurs options"
106206
+ },
106207
+ singleSelectQuickFilter: {
106208
+ ariaLabel: "Filtre rapide\xA0: s\xE9lectionner une option"
106103
106209
  }
106104
106210
  },
106105
106211
  loading: {
@@ -106186,6 +106292,9 @@ var fr_CA_default = {
106186
106292
  groupCell: {
106187
106293
  expand: "D\xE9velopper le groupe",
106188
106294
  collapse: "R\xE9duire le groupe"
106295
+ },
106296
+ rowCheckbox: {
106297
+ ariaLabel: "S\xE9lectionner une ligne"
106189
106298
  }
106190
106299
  }
106191
106300
  };
@@ -106251,6 +106360,12 @@ var fr_FR_default = {
106251
106360
  less_than_equal_to: "Est inf\xE9rieure ou \xE9gale \xE0",
106252
106361
  no_value: "Aucune valeur"
106253
106362
  }
106363
+ },
106364
+ multiSelectQuickFilter: {
106365
+ ariaLabel: "Filtre rapide : s\xE9lectionnez plusieurs options"
106366
+ },
106367
+ singleSelectQuickFilter: {
106368
+ ariaLabel: "Filtre rapide : s\xE9lectionnez une option"
106254
106369
  }
106255
106370
  },
106256
106371
  loading: {
@@ -106337,6 +106452,9 @@ var fr_FR_default = {
106337
106452
  groupCell: {
106338
106453
  expand: "D\xE9velopper le groupe",
106339
106454
  collapse: "R\xE9duire le groupe"
106455
+ },
106456
+ rowCheckbox: {
106457
+ ariaLabel: "S\xE9lectionner une ligne"
106340
106458
  }
106341
106459
  }
106342
106460
  };
@@ -106402,6 +106520,12 @@ var is_IS_default = {
106402
106520
  less_than_equal_to: "Er minna en e\xF0a jafnt",
106403
106521
  no_value: "Ekkert gildi"
106404
106522
  }
106523
+ },
106524
+ multiSelectQuickFilter: {
106525
+ ariaLabel: "Flj\xF3tleg s\xEDa: Veldu marga valkosti"
106526
+ },
106527
+ singleSelectQuickFilter: {
106528
+ ariaLabel: "Hra\xF0s\xEDa: Veldu valkost"
106405
106529
  }
106406
106530
  },
106407
106531
  loading: {
@@ -106488,6 +106612,9 @@ var is_IS_default = {
106488
106612
  groupCell: {
106489
106613
  expand: "St\xE6kka h\xF3pinn",
106490
106614
  collapse: "Hrunh\xF3pur"
106615
+ },
106616
+ rowCheckbox: {
106617
+ ariaLabel: "Veldu R\xF6\xF0"
106491
106618
  }
106492
106619
  }
106493
106620
  };
@@ -106553,6 +106680,12 @@ var ja_JP_default = {
106553
106680
  less_than_equal_to: "\u4EE5\u4E0B\u3067\u3059",
106554
106681
  no_value: "\u5024\u304C\u3042\u308A\u307E\u305B\u3093"
106555
106682
  }
106683
+ },
106684
+ multiSelectQuickFilter: {
106685
+ ariaLabel: "\u30AF\u30A4\u30C3\u30AF\u30D5\u30A3\u30EB\u30BF\u30FC: \u8907\u6570\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E"
106686
+ },
106687
+ singleSelectQuickFilter: {
106688
+ ariaLabel: "\u30AF\u30A4\u30C3\u30AF\u30D5\u30A3\u30EB\u30BF\u30FC: \u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E"
106556
106689
  }
106557
106690
  },
106558
106691
  loading: {
@@ -106639,6 +106772,9 @@ var ja_JP_default = {
106639
106772
  groupCell: {
106640
106773
  expand: "\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B\u3059\u308B",
106641
106774
  collapse: "\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080"
106775
+ },
106776
+ rowCheckbox: {
106777
+ ariaLabel: "\u884C\u3092\u9078\u629E"
106642
106778
  }
106643
106779
  }
106644
106780
  };
@@ -106670,7 +106806,7 @@ var pl_PL_default = {
106670
106806
  bulkEdit: "Edycja masowa",
106671
106807
  cancel: "Anuluj",
106672
106808
  editValues: "Edytuj warto\u015Bci",
106673
- error: "Przepraszamy, nie mo\u017Cna zaktualizowa\u0107 pozycji.Spr\xF3buj ponownie.",
106809
+ error: "Przepraszamy, nie mo\u017Cna zaktualizowa\u0107 pozycji. Spr\xF3buj ponownie.",
106674
106810
  placeholderForField: "Wprowad\u017A %{fieldName}",
106675
106811
  selection: "Wybrano %{count} %{number}",
106676
106812
  success: "Pozycje zosta\u0142y pomy\u015Blnie zaktualizowane.",
@@ -106704,6 +106840,12 @@ var pl_PL_default = {
106704
106840
  less_than_equal_to: "mniej ni\u017C lub r\xF3wne",
106705
106841
  no_value: "brak warto\u015Bci"
106706
106842
  }
106843
+ },
106844
+ multiSelectQuickFilter: {
106845
+ ariaLabel: "Szybki filtr: wybierz wiele opcji"
106846
+ },
106847
+ singleSelectQuickFilter: {
106848
+ ariaLabel: "Szybki filtr: wybierz opcj\u0119"
106707
106849
  }
106708
106850
  },
106709
106851
  loading: {
@@ -106790,6 +106932,9 @@ var pl_PL_default = {
106790
106932
  groupCell: {
106791
106933
  expand: "Rozwi\u0144 grup\u0119",
106792
106934
  collapse: "Zwi\u0144 grup\u0119"
106935
+ },
106936
+ rowCheckbox: {
106937
+ ariaLabel: "Wybierz wiersz"
106793
106938
  }
106794
106939
  }
106795
106940
  };
@@ -107015,6 +107160,12 @@ var pt_BR_default = {
107015
107160
  less_than_equal_to: "\xC9 Menor Que ou Igual a",
107016
107161
  no_value: "Nenhum Valor"
107017
107162
  }
107163
+ },
107164
+ multiSelectQuickFilter: {
107165
+ ariaLabel: "Filtro r\xE1pido: Selecione v\xE1rias op\xE7\xF5es"
107166
+ },
107167
+ singleSelectQuickFilter: {
107168
+ ariaLabel: "Filtro r\xE1pido: Selecione uma op\xE7\xE3o"
107018
107169
  }
107019
107170
  },
107020
107171
  loading: {
@@ -107101,6 +107252,9 @@ var pt_BR_default = {
107101
107252
  groupCell: {
107102
107253
  expand: "Expandir grupo",
107103
107254
  collapse: "Recolher grupo"
107255
+ },
107256
+ rowCheckbox: {
107257
+ ariaLabel: "Selecionar Linha"
107104
107258
  }
107105
107259
  }
107106
107260
  };
@@ -107166,6 +107320,12 @@ var th_TH_default = {
107166
107320
  less_than_equal_to: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",
107167
107321
  no_value: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32"
107168
107322
  }
107323
+ },
107324
+ multiSelectQuickFilter: {
107325
+ ariaLabel: "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E14\u0E48\u0E27\u0E19: \u0E40\u0E25\u0E37\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2B\u0E25\u0E32\u0E22\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"
107326
+ },
107327
+ singleSelectQuickFilter: {
107328
+ ariaLabel: "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E14\u0E48\u0E27\u0E19: \u0E40\u0E25\u0E37\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01"
107169
107329
  }
107170
107330
  },
107171
107331
  loading: {
@@ -107252,6 +107412,9 @@ var th_TH_default = {
107252
107412
  groupCell: {
107253
107413
  expand: "\u0E02\u0E22\u0E32\u0E22\u0E01\u0E25\u0E38\u0E48\u0E21",
107254
107414
  collapse: "\u0E01\u0E32\u0E23\u0E22\u0E38\u0E1A\u0E01\u0E25\u0E38\u0E48\u0E21"
107415
+ },
107416
+ rowCheckbox: {
107417
+ ariaLabel: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27"
107255
107418
  }
107256
107419
  }
107257
107420
  };
@@ -107317,6 +107480,12 @@ var zh_SG_default = {
107317
107480
  less_than_equal_to: "\u5C0F\u4E8E\u6216\u7B49\u4E8E",
107318
107481
  no_value: "\u65E0\u503C"
107319
107482
  }
107483
+ },
107484
+ multiSelectQuickFilter: {
107485
+ ariaLabel: "\u5FEB\u901F\u7B5B\u9009\uFF1A\u9009\u62E9\u591A\u4E2A\u9009\u9879"
107486
+ },
107487
+ singleSelectQuickFilter: {
107488
+ ariaLabel: "\u5FEB\u901F\u7B5B\u9009\uFF1A\u9009\u62E9\u4E00\u4E2A\u9009\u9879"
107320
107489
  }
107321
107490
  },
107322
107491
  loading: {
@@ -107403,6 +107572,9 @@ var zh_SG_default = {
107403
107572
  groupCell: {
107404
107573
  expand: "\u5C55\u5F00\u7EC4",
107405
107574
  collapse: "\u6298\u53E0\u7EC4"
107575
+ },
107576
+ rowCheckbox: {
107577
+ ariaLabel: "\u9009\u62E9\u884C"
107406
107578
  }
107407
107579
  }
107408
107580
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/data-table",
3
- "version": "14.23.2",
3
+ "version": "14.24.0",
4
4
  "description": "Complex data grid built on top of ag-grid, with DST components and styles.",
5
5
  "type": "module",
6
6
  "main": "dist/legacy/index.cjs",
@@ -112,7 +112,7 @@
112
112
  "@procore/core-css": "10.17.0",
113
113
  "@procore/core-icons": "12.3.0",
114
114
  "@procore/core-prettier": "10.2.0",
115
- "@procore/core-react": "12.17.2",
115
+ "@procore/core-react": "12.17.3",
116
116
  "@procore/eslint-config": "10.0.0",
117
117
  "@procore/globalization-toolkit": "3.1.0",
118
118
  "@procore/labs-financials-utils": "3.0.1",