@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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 14.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a5a4cc3a2: Add ServerSideNumberFilterRenderer and ServerSideMultiNumberFilterRenderer to enable numerical filtering in the SSRM data table.
8
+
9
+ ### Patch Changes
10
+
11
+ - fc9d13662: Fire onTableConfigChange when Reset Columns is invoked
12
+
3
13
  ## 14.23.2
4
14
 
5
15
  ### Patch Changes
@@ -55292,6 +55292,17 @@ function transformServerSideRequestObj(request, filtersState, searchValue) {
55292
55292
  )
55293
55293
  };
55294
55294
  }
55295
+ function isNumberFilterCondition(item) {
55296
+ return item && [
55297
+ "lessThan",
55298
+ "greaterThan",
55299
+ "isEqual",
55300
+ "inRange",
55301
+ "greaterThanOrEqual",
55302
+ "lessThanOrEqual",
55303
+ "no_value"
55304
+ ].includes(item.type);
55305
+ }
55295
55306
  var transformFilterValue = (value, field, formatter) => {
55296
55307
  const formattedValue = formatter == null ? void 0 : formatter(value, field);
55297
55308
  if (formattedValue)
@@ -55300,6 +55311,33 @@ var transformFilterValue = (value, field, formatter) => {
55300
55311
  return dateFns.formatISO(value.date, { representation: "date" });
55301
55312
  return value.toString();
55302
55313
  };
55314
+ function buildNumberFilterParams(filters) {
55315
+ return filters.reduce((acc, filter, idx) => {
55316
+ const singleExpr = mapFilterToQueryParam(filter);
55317
+ if (idx === 0)
55318
+ return singleExpr;
55319
+ const separator = filter.operator === "or" ? "|" : ",";
55320
+ return acc + separator + singleExpr;
55321
+ }, "");
55322
+ }
55323
+ function mapFilterToQueryParam(filter) {
55324
+ const operatorMap = {
55325
+ lessThan: "lt",
55326
+ lessThanOrEqual: "lte",
55327
+ greaterThan: "gt",
55328
+ greaterThanOrEqual: "gte",
55329
+ isEqual: "eq",
55330
+ inRange: "range",
55331
+ no_value: "null"
55332
+ };
55333
+ if (filter.type === "inRange") {
55334
+ return `range:${filter.value}-${filter.valueTo}`;
55335
+ }
55336
+ if (filter.type === "no_value") {
55337
+ return "null";
55338
+ }
55339
+ return operatorMap[filter.type] ? `${operatorMap[filter.type]}:${filter.value}` : String(filter.value ?? "");
55340
+ }
55303
55341
  function getServerSideParams(request, filtersState, searchValue, options = {}) {
55304
55342
  var _a;
55305
55343
  const params = new URLSearchParams();
@@ -55324,10 +55362,17 @@ function getServerSideParams(request, filtersState, searchValue, options = {}) {
55324
55362
  if (options.filters !== false) {
55325
55363
  const formatter = options.filterValueFormatter;
55326
55364
  filtersState.forEach((filter) => {
55327
- const value = filter.selected.length === 1 ? transformFilterValue(filter.selected[0], filter.field, formatter) : `[${filter.selected.map(
55328
- (value2) => transformFilterValue(value2, filter.field, formatter)
55329
- )}]`;
55330
- params.set(`filters[${filter.field}]`, value);
55365
+ const isNumericCondition = filter.selected.every(isNumberFilterCondition);
55366
+ const hasCustomFormatter = typeof formatter === "function";
55367
+ if (isNumericCondition && filter.selected.length > 0 && !hasCustomFormatter) {
55368
+ const numericExpr = buildNumberFilterParams(filter.selected);
55369
+ params.set(`filters[${filter.field}]`, numericExpr);
55370
+ } else {
55371
+ const value = filter.selected.length === 1 ? transformFilterValue(filter.selected[0], filter.field, formatter) : `[${filter.selected.map(
55372
+ (val) => transformFilterValue(val, filter.field, formatter)
55373
+ )}]`;
55374
+ params.set(`filters[${filter.field}]`, value);
55375
+ }
55331
55376
  });
55332
55377
  request.groupKeys.forEach((groupKey, index) => {
55333
55378
  params.set(`filters[${request.rowGroupCols[index].field}]`, groupKey);
@@ -56531,6 +56576,7 @@ var getMainMenuItems = (props, I18n) => {
56531
56576
  value: "resetColumns",
56532
56577
  action() {
56533
56578
  props.columnApi.resetColumnState();
56579
+ props.onTableConfigChange();
56534
56580
  }
56535
56581
  };
56536
56582
  const rowUngroup = {
@@ -105210,6 +105256,12 @@ var de_DE_default = {
105210
105256
  less_than_equal_to: "Ist kleiner als oder gleich",
105211
105257
  no_value: "Kein Wert"
105212
105258
  }
105259
+ },
105260
+ multiSelectQuickFilter: {
105261
+ ariaLabel: "Schnell-Filter: mehrere Optionen ausw\xE4hlen"
105262
+ },
105263
+ singleSelectQuickFilter: {
105264
+ ariaLabel: "Schnell-Filter: eine Option ausw\xE4hlen"
105213
105265
  }
105214
105266
  },
105215
105267
  loading: {
@@ -105296,6 +105348,9 @@ var de_DE_default = {
105296
105348
  groupCell: {
105297
105349
  expand: "Gruppe erweitern",
105298
105350
  collapse: "Gruppe ausblenden"
105351
+ },
105352
+ rowCheckbox: {
105353
+ ariaLabel: "Zeile ausw\xE4hlen"
105299
105354
  }
105300
105355
  }
105301
105356
  };
@@ -105361,6 +105416,12 @@ var en_AU_default = {
105361
105416
  less_than_equal_to: "Is less than or equal to",
105362
105417
  no_value: "No value"
105363
105418
  }
105419
+ },
105420
+ multiSelectQuickFilter: {
105421
+ ariaLabel: "Quick filter: Select multiple options"
105422
+ },
105423
+ singleSelectQuickFilter: {
105424
+ ariaLabel: "Quick filter: Select an option"
105364
105425
  }
105365
105426
  },
105366
105427
  loading: {
@@ -105447,6 +105508,9 @@ var en_AU_default = {
105447
105508
  groupCell: {
105448
105509
  expand: "Expand group",
105449
105510
  collapse: "Collapse group"
105511
+ },
105512
+ rowCheckbox: {
105513
+ ariaLabel: "Select row"
105450
105514
  }
105451
105515
  }
105452
105516
  };
@@ -105512,6 +105576,12 @@ var en_CA_default = {
105512
105576
  less_than_equal_to: "Is less than or equal to",
105513
105577
  no_value: "No value"
105514
105578
  }
105579
+ },
105580
+ multiSelectQuickFilter: {
105581
+ ariaLabel: "Quick filter: Select multiple options"
105582
+ },
105583
+ singleSelectQuickFilter: {
105584
+ ariaLabel: "Quick filter: Select an option"
105515
105585
  }
105516
105586
  },
105517
105587
  loading: {
@@ -105598,6 +105668,9 @@ var en_CA_default = {
105598
105668
  groupCell: {
105599
105669
  expand: "Expand group",
105600
105670
  collapse: "Collapse group"
105671
+ },
105672
+ rowCheckbox: {
105673
+ ariaLabel: "Select row"
105601
105674
  }
105602
105675
  }
105603
105676
  };
@@ -105663,6 +105736,12 @@ var en_GB_default = {
105663
105736
  less_than_equal_to: "Is less than or equal to",
105664
105737
  no_value: "No value"
105665
105738
  }
105739
+ },
105740
+ multiSelectQuickFilter: {
105741
+ ariaLabel: "Quick filter: Select multiple options"
105742
+ },
105743
+ singleSelectQuickFilter: {
105744
+ ariaLabel: "Quick filter: Select an option"
105666
105745
  }
105667
105746
  },
105668
105747
  loading: {
@@ -105749,6 +105828,9 @@ var en_GB_default = {
105749
105828
  groupCell: {
105750
105829
  expand: "Expand group",
105751
105830
  collapse: "Collapse group"
105831
+ },
105832
+ rowCheckbox: {
105833
+ ariaLabel: "Select row"
105752
105834
  }
105753
105835
  }
105754
105836
  };
@@ -105974,6 +106056,12 @@ var es_ES_default = {
105974
106056
  less_than_equal_to: "Es menor o igual que",
105975
106057
  no_value: "Ning\xFAn valor"
105976
106058
  }
106059
+ },
106060
+ multiSelectQuickFilter: {
106061
+ ariaLabel: "Filtro r\xE1pido: seleccionar varias opciones"
106062
+ },
106063
+ singleSelectQuickFilter: {
106064
+ ariaLabel: "Filtro r\xE1pido: seleccionar una opci\xF3n"
105977
106065
  }
105978
106066
  },
105979
106067
  loading: {
@@ -106060,6 +106148,9 @@ var es_ES_default = {
106060
106148
  groupCell: {
106061
106149
  expand: "Expandir grupo",
106062
106150
  collapse: "Contraer grupo"
106151
+ },
106152
+ rowCheckbox: {
106153
+ ariaLabel: "Seleccionar fila"
106063
106154
  }
106064
106155
  }
106065
106156
  };
@@ -106125,6 +106216,12 @@ var es_default = {
106125
106216
  less_than_equal_to: "Es menor o igual a",
106126
106217
  no_value: "Ning\xFAn valor"
106127
106218
  }
106219
+ },
106220
+ multiSelectQuickFilter: {
106221
+ ariaLabel: "Filtro r\xE1pido: Seleccione varias opciones"
106222
+ },
106223
+ singleSelectQuickFilter: {
106224
+ ariaLabel: "Filtro r\xE1pido: Seleccione una opci\xF3n"
106128
106225
  }
106129
106226
  },
106130
106227
  loading: {
@@ -106211,6 +106308,9 @@ var es_default = {
106211
106308
  groupCell: {
106212
106309
  expand: "Expandir grupo",
106213
106310
  collapse: "Colapsar grupo"
106311
+ },
106312
+ rowCheckbox: {
106313
+ ariaLabel: "Seleccionar fila"
106214
106314
  }
106215
106315
  }
106216
106316
  };
@@ -106276,6 +106376,12 @@ var fr_CA_default = {
106276
106376
  less_than_equal_to: "Est inf\xE9rieur ou \xE9gal \xE0",
106277
106377
  no_value: "Aucune valeur"
106278
106378
  }
106379
+ },
106380
+ multiSelectQuickFilter: {
106381
+ ariaLabel: "Filtre rapide\xA0: s\xE9lectionner plusieurs options"
106382
+ },
106383
+ singleSelectQuickFilter: {
106384
+ ariaLabel: "Filtre rapide\xA0: s\xE9lectionner une option"
106279
106385
  }
106280
106386
  },
106281
106387
  loading: {
@@ -106362,6 +106468,9 @@ var fr_CA_default = {
106362
106468
  groupCell: {
106363
106469
  expand: "D\xE9velopper le groupe",
106364
106470
  collapse: "R\xE9duire le groupe"
106471
+ },
106472
+ rowCheckbox: {
106473
+ ariaLabel: "S\xE9lectionner une ligne"
106365
106474
  }
106366
106475
  }
106367
106476
  };
@@ -106427,6 +106536,12 @@ var fr_FR_default = {
106427
106536
  less_than_equal_to: "Est inf\xE9rieure ou \xE9gale \xE0",
106428
106537
  no_value: "Aucune valeur"
106429
106538
  }
106539
+ },
106540
+ multiSelectQuickFilter: {
106541
+ ariaLabel: "Filtre rapide : s\xE9lectionnez plusieurs options"
106542
+ },
106543
+ singleSelectQuickFilter: {
106544
+ ariaLabel: "Filtre rapide : s\xE9lectionnez une option"
106430
106545
  }
106431
106546
  },
106432
106547
  loading: {
@@ -106513,6 +106628,9 @@ var fr_FR_default = {
106513
106628
  groupCell: {
106514
106629
  expand: "D\xE9velopper le groupe",
106515
106630
  collapse: "R\xE9duire le groupe"
106631
+ },
106632
+ rowCheckbox: {
106633
+ ariaLabel: "S\xE9lectionner une ligne"
106516
106634
  }
106517
106635
  }
106518
106636
  };
@@ -106578,6 +106696,12 @@ var is_IS_default = {
106578
106696
  less_than_equal_to: "Er minna en e\xF0a jafnt",
106579
106697
  no_value: "Ekkert gildi"
106580
106698
  }
106699
+ },
106700
+ multiSelectQuickFilter: {
106701
+ ariaLabel: "Flj\xF3tleg s\xEDa: Veldu marga valkosti"
106702
+ },
106703
+ singleSelectQuickFilter: {
106704
+ ariaLabel: "Hra\xF0s\xEDa: Veldu valkost"
106581
106705
  }
106582
106706
  },
106583
106707
  loading: {
@@ -106664,6 +106788,9 @@ var is_IS_default = {
106664
106788
  groupCell: {
106665
106789
  expand: "St\xE6kka h\xF3pinn",
106666
106790
  collapse: "Hrunh\xF3pur"
106791
+ },
106792
+ rowCheckbox: {
106793
+ ariaLabel: "Veldu R\xF6\xF0"
106667
106794
  }
106668
106795
  }
106669
106796
  };
@@ -106729,6 +106856,12 @@ var ja_JP_default = {
106729
106856
  less_than_equal_to: "\u4EE5\u4E0B\u3067\u3059",
106730
106857
  no_value: "\u5024\u304C\u3042\u308A\u307E\u305B\u3093"
106731
106858
  }
106859
+ },
106860
+ multiSelectQuickFilter: {
106861
+ ariaLabel: "\u30AF\u30A4\u30C3\u30AF\u30D5\u30A3\u30EB\u30BF\u30FC: \u8907\u6570\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E"
106862
+ },
106863
+ singleSelectQuickFilter: {
106864
+ ariaLabel: "\u30AF\u30A4\u30C3\u30AF\u30D5\u30A3\u30EB\u30BF\u30FC: \u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E"
106732
106865
  }
106733
106866
  },
106734
106867
  loading: {
@@ -106815,6 +106948,9 @@ var ja_JP_default = {
106815
106948
  groupCell: {
106816
106949
  expand: "\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B\u3059\u308B",
106817
106950
  collapse: "\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080"
106951
+ },
106952
+ rowCheckbox: {
106953
+ ariaLabel: "\u884C\u3092\u9078\u629E"
106818
106954
  }
106819
106955
  }
106820
106956
  };
@@ -106846,7 +106982,7 @@ var pl_PL_default = {
106846
106982
  bulkEdit: "Edycja masowa",
106847
106983
  cancel: "Anuluj",
106848
106984
  editValues: "Edytuj warto\u015Bci",
106849
- error: "Przepraszamy, nie mo\u017Cna zaktualizowa\u0107 pozycji.Spr\xF3buj ponownie.",
106985
+ error: "Przepraszamy, nie mo\u017Cna zaktualizowa\u0107 pozycji. Spr\xF3buj ponownie.",
106850
106986
  placeholderForField: "Wprowad\u017A %{fieldName}",
106851
106987
  selection: "Wybrano %{count} %{number}",
106852
106988
  success: "Pozycje zosta\u0142y pomy\u015Blnie zaktualizowane.",
@@ -106880,6 +107016,12 @@ var pl_PL_default = {
106880
107016
  less_than_equal_to: "mniej ni\u017C lub r\xF3wne",
106881
107017
  no_value: "brak warto\u015Bci"
106882
107018
  }
107019
+ },
107020
+ multiSelectQuickFilter: {
107021
+ ariaLabel: "Szybki filtr: wybierz wiele opcji"
107022
+ },
107023
+ singleSelectQuickFilter: {
107024
+ ariaLabel: "Szybki filtr: wybierz opcj\u0119"
106883
107025
  }
106884
107026
  },
106885
107027
  loading: {
@@ -106966,6 +107108,9 @@ var pl_PL_default = {
106966
107108
  groupCell: {
106967
107109
  expand: "Rozwi\u0144 grup\u0119",
106968
107110
  collapse: "Zwi\u0144 grup\u0119"
107111
+ },
107112
+ rowCheckbox: {
107113
+ ariaLabel: "Wybierz wiersz"
106969
107114
  }
106970
107115
  }
106971
107116
  };
@@ -107191,6 +107336,12 @@ var pt_BR_default = {
107191
107336
  less_than_equal_to: "\xC9 Menor Que ou Igual a",
107192
107337
  no_value: "Nenhum Valor"
107193
107338
  }
107339
+ },
107340
+ multiSelectQuickFilter: {
107341
+ ariaLabel: "Filtro r\xE1pido: Selecione v\xE1rias op\xE7\xF5es"
107342
+ },
107343
+ singleSelectQuickFilter: {
107344
+ ariaLabel: "Filtro r\xE1pido: Selecione uma op\xE7\xE3o"
107194
107345
  }
107195
107346
  },
107196
107347
  loading: {
@@ -107277,6 +107428,9 @@ var pt_BR_default = {
107277
107428
  groupCell: {
107278
107429
  expand: "Expandir grupo",
107279
107430
  collapse: "Recolher grupo"
107431
+ },
107432
+ rowCheckbox: {
107433
+ ariaLabel: "Selecionar Linha"
107280
107434
  }
107281
107435
  }
107282
107436
  };
@@ -107342,6 +107496,12 @@ var th_TH_default = {
107342
107496
  less_than_equal_to: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",
107343
107497
  no_value: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32"
107344
107498
  }
107499
+ },
107500
+ multiSelectQuickFilter: {
107501
+ 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"
107502
+ },
107503
+ singleSelectQuickFilter: {
107504
+ 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"
107345
107505
  }
107346
107506
  },
107347
107507
  loading: {
@@ -107428,6 +107588,9 @@ var th_TH_default = {
107428
107588
  groupCell: {
107429
107589
  expand: "\u0E02\u0E22\u0E32\u0E22\u0E01\u0E25\u0E38\u0E48\u0E21",
107430
107590
  collapse: "\u0E01\u0E32\u0E23\u0E22\u0E38\u0E1A\u0E01\u0E25\u0E38\u0E48\u0E21"
107591
+ },
107592
+ rowCheckbox: {
107593
+ ariaLabel: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27"
107431
107594
  }
107432
107595
  }
107433
107596
  };
@@ -107493,6 +107656,12 @@ var zh_SG_default = {
107493
107656
  less_than_equal_to: "\u5C0F\u4E8E\u6216\u7B49\u4E8E",
107494
107657
  no_value: "\u65E0\u503C"
107495
107658
  }
107659
+ },
107660
+ multiSelectQuickFilter: {
107661
+ ariaLabel: "\u5FEB\u901F\u7B5B\u9009\uFF1A\u9009\u62E9\u591A\u4E2A\u9009\u9879"
107662
+ },
107663
+ singleSelectQuickFilter: {
107664
+ ariaLabel: "\u5FEB\u901F\u7B5B\u9009\uFF1A\u9009\u62E9\u4E00\u4E2A\u9009\u9879"
107496
107665
  }
107497
107666
  },
107498
107667
  loading: {
@@ -107579,6 +107748,9 @@ var zh_SG_default = {
107579
107748
  groupCell: {
107580
107749
  expand: "\u5C55\u5F00\u7EC4",
107581
107750
  collapse: "\u6298\u53E0\u7EC4"
107751
+ },
107752
+ rowCheckbox: {
107753
+ ariaLabel: "\u9009\u62E9\u884C"
107582
107754
  }
107583
107755
  }
107584
107756
  };