@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.
@@ -55223,6 +55223,17 @@ function transformServerSideRequestObj(request, filtersState, searchValue) {
55223
55223
  )
55224
55224
  };
55225
55225
  }
55226
+ function isNumberFilterCondition(item) {
55227
+ return item && [
55228
+ "lessThan",
55229
+ "greaterThan",
55230
+ "isEqual",
55231
+ "inRange",
55232
+ "greaterThanOrEqual",
55233
+ "lessThanOrEqual",
55234
+ "no_value"
55235
+ ].includes(item.type);
55236
+ }
55226
55237
  var transformFilterValue = (value, field, formatter) => {
55227
55238
  const formattedValue = formatter?.(value, field);
55228
55239
  if (formattedValue)
@@ -55231,6 +55242,33 @@ var transformFilterValue = (value, field, formatter) => {
55231
55242
  return dateFns.formatISO(value.date, { representation: "date" });
55232
55243
  return value.toString();
55233
55244
  };
55245
+ function buildNumberFilterParams(filters) {
55246
+ return filters.reduce((acc, filter, idx) => {
55247
+ const singleExpr = mapFilterToQueryParam(filter);
55248
+ if (idx === 0)
55249
+ return singleExpr;
55250
+ const separator = filter.operator === "or" ? "|" : ",";
55251
+ return acc + separator + singleExpr;
55252
+ }, "");
55253
+ }
55254
+ function mapFilterToQueryParam(filter) {
55255
+ const operatorMap = {
55256
+ lessThan: "lt",
55257
+ lessThanOrEqual: "lte",
55258
+ greaterThan: "gt",
55259
+ greaterThanOrEqual: "gte",
55260
+ isEqual: "eq",
55261
+ inRange: "range",
55262
+ no_value: "null"
55263
+ };
55264
+ if (filter.type === "inRange") {
55265
+ return `range:${filter.value}-${filter.valueTo}`;
55266
+ }
55267
+ if (filter.type === "no_value") {
55268
+ return "null";
55269
+ }
55270
+ return operatorMap[filter.type] ? `${operatorMap[filter.type]}:${filter.value}` : String(filter.value ?? "");
55271
+ }
55234
55272
  function getServerSideParams(request, filtersState, searchValue, options = {}) {
55235
55273
  const params = new URLSearchParams();
55236
55274
  if (options.pagination !== false) {
@@ -55254,10 +55292,17 @@ function getServerSideParams(request, filtersState, searchValue, options = {}) {
55254
55292
  if (options.filters !== false) {
55255
55293
  const formatter = options.filterValueFormatter;
55256
55294
  filtersState.forEach((filter) => {
55257
- const value = filter.selected.length === 1 ? transformFilterValue(filter.selected[0], filter.field, formatter) : `[${filter.selected.map(
55258
- (value2) => transformFilterValue(value2, filter.field, formatter)
55259
- )}]`;
55260
- params.set(`filters[${filter.field}]`, value);
55295
+ const isNumericCondition = filter.selected.every(isNumberFilterCondition);
55296
+ const hasCustomFormatter = typeof formatter === "function";
55297
+ if (isNumericCondition && filter.selected.length > 0 && !hasCustomFormatter) {
55298
+ const numericExpr = buildNumberFilterParams(filter.selected);
55299
+ params.set(`filters[${filter.field}]`, numericExpr);
55300
+ } else {
55301
+ const value = filter.selected.length === 1 ? transformFilterValue(filter.selected[0], filter.field, formatter) : `[${filter.selected.map(
55302
+ (val) => transformFilterValue(val, filter.field, formatter)
55303
+ )}]`;
55304
+ params.set(`filters[${filter.field}]`, value);
55305
+ }
55261
55306
  });
55262
55307
  request.groupKeys.forEach((groupKey, index) => {
55263
55308
  params.set(`filters[${request.rowGroupCols[index].field}]`, groupKey);
@@ -56437,6 +56482,7 @@ var getMainMenuItems = (props, I18n) => {
56437
56482
  value: "resetColumns",
56438
56483
  action() {
56439
56484
  props.columnApi.resetColumnState();
56485
+ props.onTableConfigChange();
56440
56486
  }
56441
56487
  };
56442
56488
  const rowUngroup = {
@@ -105048,6 +105094,12 @@ var de_DE_default = {
105048
105094
  less_than_equal_to: "Ist kleiner als oder gleich",
105049
105095
  no_value: "Kein Wert"
105050
105096
  }
105097
+ },
105098
+ multiSelectQuickFilter: {
105099
+ ariaLabel: "Schnell-Filter: mehrere Optionen ausw\xE4hlen"
105100
+ },
105101
+ singleSelectQuickFilter: {
105102
+ ariaLabel: "Schnell-Filter: eine Option ausw\xE4hlen"
105051
105103
  }
105052
105104
  },
105053
105105
  loading: {
@@ -105134,6 +105186,9 @@ var de_DE_default = {
105134
105186
  groupCell: {
105135
105187
  expand: "Gruppe erweitern",
105136
105188
  collapse: "Gruppe ausblenden"
105189
+ },
105190
+ rowCheckbox: {
105191
+ ariaLabel: "Zeile ausw\xE4hlen"
105137
105192
  }
105138
105193
  }
105139
105194
  };
@@ -105199,6 +105254,12 @@ var en_AU_default = {
105199
105254
  less_than_equal_to: "Is less than or equal to",
105200
105255
  no_value: "No value"
105201
105256
  }
105257
+ },
105258
+ multiSelectQuickFilter: {
105259
+ ariaLabel: "Quick filter: Select multiple options"
105260
+ },
105261
+ singleSelectQuickFilter: {
105262
+ ariaLabel: "Quick filter: Select an option"
105202
105263
  }
105203
105264
  },
105204
105265
  loading: {
@@ -105285,6 +105346,9 @@ var en_AU_default = {
105285
105346
  groupCell: {
105286
105347
  expand: "Expand group",
105287
105348
  collapse: "Collapse group"
105349
+ },
105350
+ rowCheckbox: {
105351
+ ariaLabel: "Select row"
105288
105352
  }
105289
105353
  }
105290
105354
  };
@@ -105350,6 +105414,12 @@ var en_CA_default = {
105350
105414
  less_than_equal_to: "Is less than or equal to",
105351
105415
  no_value: "No value"
105352
105416
  }
105417
+ },
105418
+ multiSelectQuickFilter: {
105419
+ ariaLabel: "Quick filter: Select multiple options"
105420
+ },
105421
+ singleSelectQuickFilter: {
105422
+ ariaLabel: "Quick filter: Select an option"
105353
105423
  }
105354
105424
  },
105355
105425
  loading: {
@@ -105436,6 +105506,9 @@ var en_CA_default = {
105436
105506
  groupCell: {
105437
105507
  expand: "Expand group",
105438
105508
  collapse: "Collapse group"
105509
+ },
105510
+ rowCheckbox: {
105511
+ ariaLabel: "Select row"
105439
105512
  }
105440
105513
  }
105441
105514
  };
@@ -105501,6 +105574,12 @@ var en_GB_default = {
105501
105574
  less_than_equal_to: "Is less than or equal to",
105502
105575
  no_value: "No value"
105503
105576
  }
105577
+ },
105578
+ multiSelectQuickFilter: {
105579
+ ariaLabel: "Quick filter: Select multiple options"
105580
+ },
105581
+ singleSelectQuickFilter: {
105582
+ ariaLabel: "Quick filter: Select an option"
105504
105583
  }
105505
105584
  },
105506
105585
  loading: {
@@ -105587,6 +105666,9 @@ var en_GB_default = {
105587
105666
  groupCell: {
105588
105667
  expand: "Expand group",
105589
105668
  collapse: "Collapse group"
105669
+ },
105670
+ rowCheckbox: {
105671
+ ariaLabel: "Select row"
105590
105672
  }
105591
105673
  }
105592
105674
  };
@@ -105812,6 +105894,12 @@ var es_ES_default = {
105812
105894
  less_than_equal_to: "Es menor o igual que",
105813
105895
  no_value: "Ning\xFAn valor"
105814
105896
  }
105897
+ },
105898
+ multiSelectQuickFilter: {
105899
+ ariaLabel: "Filtro r\xE1pido: seleccionar varias opciones"
105900
+ },
105901
+ singleSelectQuickFilter: {
105902
+ ariaLabel: "Filtro r\xE1pido: seleccionar una opci\xF3n"
105815
105903
  }
105816
105904
  },
105817
105905
  loading: {
@@ -105898,6 +105986,9 @@ var es_ES_default = {
105898
105986
  groupCell: {
105899
105987
  expand: "Expandir grupo",
105900
105988
  collapse: "Contraer grupo"
105989
+ },
105990
+ rowCheckbox: {
105991
+ ariaLabel: "Seleccionar fila"
105901
105992
  }
105902
105993
  }
105903
105994
  };
@@ -105963,6 +106054,12 @@ var es_default = {
105963
106054
  less_than_equal_to: "Es menor o igual a",
105964
106055
  no_value: "Ning\xFAn valor"
105965
106056
  }
106057
+ },
106058
+ multiSelectQuickFilter: {
106059
+ ariaLabel: "Filtro r\xE1pido: Seleccione varias opciones"
106060
+ },
106061
+ singleSelectQuickFilter: {
106062
+ ariaLabel: "Filtro r\xE1pido: Seleccione una opci\xF3n"
105966
106063
  }
105967
106064
  },
105968
106065
  loading: {
@@ -106049,6 +106146,9 @@ var es_default = {
106049
106146
  groupCell: {
106050
106147
  expand: "Expandir grupo",
106051
106148
  collapse: "Colapsar grupo"
106149
+ },
106150
+ rowCheckbox: {
106151
+ ariaLabel: "Seleccionar fila"
106052
106152
  }
106053
106153
  }
106054
106154
  };
@@ -106114,6 +106214,12 @@ var fr_CA_default = {
106114
106214
  less_than_equal_to: "Est inf\xE9rieur ou \xE9gal \xE0",
106115
106215
  no_value: "Aucune valeur"
106116
106216
  }
106217
+ },
106218
+ multiSelectQuickFilter: {
106219
+ ariaLabel: "Filtre rapide\xA0: s\xE9lectionner plusieurs options"
106220
+ },
106221
+ singleSelectQuickFilter: {
106222
+ ariaLabel: "Filtre rapide\xA0: s\xE9lectionner une option"
106117
106223
  }
106118
106224
  },
106119
106225
  loading: {
@@ -106200,6 +106306,9 @@ var fr_CA_default = {
106200
106306
  groupCell: {
106201
106307
  expand: "D\xE9velopper le groupe",
106202
106308
  collapse: "R\xE9duire le groupe"
106309
+ },
106310
+ rowCheckbox: {
106311
+ ariaLabel: "S\xE9lectionner une ligne"
106203
106312
  }
106204
106313
  }
106205
106314
  };
@@ -106265,6 +106374,12 @@ var fr_FR_default = {
106265
106374
  less_than_equal_to: "Est inf\xE9rieure ou \xE9gale \xE0",
106266
106375
  no_value: "Aucune valeur"
106267
106376
  }
106377
+ },
106378
+ multiSelectQuickFilter: {
106379
+ ariaLabel: "Filtre rapide : s\xE9lectionnez plusieurs options"
106380
+ },
106381
+ singleSelectQuickFilter: {
106382
+ ariaLabel: "Filtre rapide : s\xE9lectionnez une option"
106268
106383
  }
106269
106384
  },
106270
106385
  loading: {
@@ -106351,6 +106466,9 @@ var fr_FR_default = {
106351
106466
  groupCell: {
106352
106467
  expand: "D\xE9velopper le groupe",
106353
106468
  collapse: "R\xE9duire le groupe"
106469
+ },
106470
+ rowCheckbox: {
106471
+ ariaLabel: "S\xE9lectionner une ligne"
106354
106472
  }
106355
106473
  }
106356
106474
  };
@@ -106416,6 +106534,12 @@ var is_IS_default = {
106416
106534
  less_than_equal_to: "Er minna en e\xF0a jafnt",
106417
106535
  no_value: "Ekkert gildi"
106418
106536
  }
106537
+ },
106538
+ multiSelectQuickFilter: {
106539
+ ariaLabel: "Flj\xF3tleg s\xEDa: Veldu marga valkosti"
106540
+ },
106541
+ singleSelectQuickFilter: {
106542
+ ariaLabel: "Hra\xF0s\xEDa: Veldu valkost"
106419
106543
  }
106420
106544
  },
106421
106545
  loading: {
@@ -106502,6 +106626,9 @@ var is_IS_default = {
106502
106626
  groupCell: {
106503
106627
  expand: "St\xE6kka h\xF3pinn",
106504
106628
  collapse: "Hrunh\xF3pur"
106629
+ },
106630
+ rowCheckbox: {
106631
+ ariaLabel: "Veldu R\xF6\xF0"
106505
106632
  }
106506
106633
  }
106507
106634
  };
@@ -106567,6 +106694,12 @@ var ja_JP_default = {
106567
106694
  less_than_equal_to: "\u4EE5\u4E0B\u3067\u3059",
106568
106695
  no_value: "\u5024\u304C\u3042\u308A\u307E\u305B\u3093"
106569
106696
  }
106697
+ },
106698
+ multiSelectQuickFilter: {
106699
+ ariaLabel: "\u30AF\u30A4\u30C3\u30AF\u30D5\u30A3\u30EB\u30BF\u30FC: \u8907\u6570\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E"
106700
+ },
106701
+ singleSelectQuickFilter: {
106702
+ ariaLabel: "\u30AF\u30A4\u30C3\u30AF\u30D5\u30A3\u30EB\u30BF\u30FC: \u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E"
106570
106703
  }
106571
106704
  },
106572
106705
  loading: {
@@ -106653,6 +106786,9 @@ var ja_JP_default = {
106653
106786
  groupCell: {
106654
106787
  expand: "\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B\u3059\u308B",
106655
106788
  collapse: "\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080"
106789
+ },
106790
+ rowCheckbox: {
106791
+ ariaLabel: "\u884C\u3092\u9078\u629E"
106656
106792
  }
106657
106793
  }
106658
106794
  };
@@ -106684,7 +106820,7 @@ var pl_PL_default = {
106684
106820
  bulkEdit: "Edycja masowa",
106685
106821
  cancel: "Anuluj",
106686
106822
  editValues: "Edytuj warto\u015Bci",
106687
- error: "Przepraszamy, nie mo\u017Cna zaktualizowa\u0107 pozycji.Spr\xF3buj ponownie.",
106823
+ error: "Przepraszamy, nie mo\u017Cna zaktualizowa\u0107 pozycji. Spr\xF3buj ponownie.",
106688
106824
  placeholderForField: "Wprowad\u017A %{fieldName}",
106689
106825
  selection: "Wybrano %{count} %{number}",
106690
106826
  success: "Pozycje zosta\u0142y pomy\u015Blnie zaktualizowane.",
@@ -106718,6 +106854,12 @@ var pl_PL_default = {
106718
106854
  less_than_equal_to: "mniej ni\u017C lub r\xF3wne",
106719
106855
  no_value: "brak warto\u015Bci"
106720
106856
  }
106857
+ },
106858
+ multiSelectQuickFilter: {
106859
+ ariaLabel: "Szybki filtr: wybierz wiele opcji"
106860
+ },
106861
+ singleSelectQuickFilter: {
106862
+ ariaLabel: "Szybki filtr: wybierz opcj\u0119"
106721
106863
  }
106722
106864
  },
106723
106865
  loading: {
@@ -106804,6 +106946,9 @@ var pl_PL_default = {
106804
106946
  groupCell: {
106805
106947
  expand: "Rozwi\u0144 grup\u0119",
106806
106948
  collapse: "Zwi\u0144 grup\u0119"
106949
+ },
106950
+ rowCheckbox: {
106951
+ ariaLabel: "Wybierz wiersz"
106807
106952
  }
106808
106953
  }
106809
106954
  };
@@ -107029,6 +107174,12 @@ var pt_BR_default = {
107029
107174
  less_than_equal_to: "\xC9 Menor Que ou Igual a",
107030
107175
  no_value: "Nenhum Valor"
107031
107176
  }
107177
+ },
107178
+ multiSelectQuickFilter: {
107179
+ ariaLabel: "Filtro r\xE1pido: Selecione v\xE1rias op\xE7\xF5es"
107180
+ },
107181
+ singleSelectQuickFilter: {
107182
+ ariaLabel: "Filtro r\xE1pido: Selecione uma op\xE7\xE3o"
107032
107183
  }
107033
107184
  },
107034
107185
  loading: {
@@ -107115,6 +107266,9 @@ var pt_BR_default = {
107115
107266
  groupCell: {
107116
107267
  expand: "Expandir grupo",
107117
107268
  collapse: "Recolher grupo"
107269
+ },
107270
+ rowCheckbox: {
107271
+ ariaLabel: "Selecionar Linha"
107118
107272
  }
107119
107273
  }
107120
107274
  };
@@ -107180,6 +107334,12 @@ var th_TH_default = {
107180
107334
  less_than_equal_to: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",
107181
107335
  no_value: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32"
107182
107336
  }
107337
+ },
107338
+ multiSelectQuickFilter: {
107339
+ 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"
107340
+ },
107341
+ singleSelectQuickFilter: {
107342
+ 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"
107183
107343
  }
107184
107344
  },
107185
107345
  loading: {
@@ -107266,6 +107426,9 @@ var th_TH_default = {
107266
107426
  groupCell: {
107267
107427
  expand: "\u0E02\u0E22\u0E32\u0E22\u0E01\u0E25\u0E38\u0E48\u0E21",
107268
107428
  collapse: "\u0E01\u0E32\u0E23\u0E22\u0E38\u0E1A\u0E01\u0E25\u0E38\u0E48\u0E21"
107429
+ },
107430
+ rowCheckbox: {
107431
+ ariaLabel: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27"
107269
107432
  }
107270
107433
  }
107271
107434
  };
@@ -107331,6 +107494,12 @@ var zh_SG_default = {
107331
107494
  less_than_equal_to: "\u5C0F\u4E8E\u6216\u7B49\u4E8E",
107332
107495
  no_value: "\u65E0\u503C"
107333
107496
  }
107497
+ },
107498
+ multiSelectQuickFilter: {
107499
+ ariaLabel: "\u5FEB\u901F\u7B5B\u9009\uFF1A\u9009\u62E9\u591A\u4E2A\u9009\u9879"
107500
+ },
107501
+ singleSelectQuickFilter: {
107502
+ ariaLabel: "\u5FEB\u901F\u7B5B\u9009\uFF1A\u9009\u62E9\u4E00\u4E2A\u9009\u9879"
107334
107503
  }
107335
107504
  },
107336
107505
  loading: {
@@ -107417,6 +107586,9 @@ var zh_SG_default = {
107417
107586
  groupCell: {
107418
107587
  expand: "\u5C55\u5F00\u7EC4",
107419
107588
  collapse: "\u6298\u53E0\u7EC4"
107589
+ },
107590
+ rowCheckbox: {
107591
+ ariaLabel: "\u9009\u62E9\u884C"
107420
107592
  }
107421
107593
  }
107422
107594
  };