@procore/data-table 14.12.2 → 14.13.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,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 14.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 03bf2b82b: Add Polish support
8
+
3
9
  ## 14.12.2
4
10
 
5
11
  ### Patch Changes
@@ -12818,8 +12818,8 @@ var GridOptionsValidator = class GridOptionsValidator2 {
12818
12818
  enterMovesDownAfterEdit: { version: "30", newProp: "enterNavigatesVerticallyAfterEdit", copyToNewProp: true }
12819
12819
  };
12820
12820
  }
12821
- pickOneWarning(prop1, prop2) {
12822
- console.warn(`AG Grid: ${prop1} and ${prop2} do not work with each other, you need to pick one.`);
12821
+ pickOneWarning(prop1, prop22) {
12822
+ console.warn(`AG Grid: ${prop1} and ${prop22} do not work with each other, you need to pick one.`);
12823
12823
  }
12824
12824
  init() {
12825
12825
  this.checkForDeprecated();
@@ -12841,7 +12841,7 @@ var GridOptionsValidator = class GridOptionsValidator2 {
12841
12841
  this.pickOneWarning("groupRemoveSingleChildren", "groupHideOpenParents");
12842
12842
  }
12843
12843
  if (this.gridOptionsService.isRowModelType("serverSide")) {
12844
- const msg = (prop, alt) => `AG Grid: '${prop}' is not supported on the Server-Side Row Model.` + (alt ? ` Please use ${alt} instead.` : "");
12844
+ const msg = (prop3, alt) => `AG Grid: '${prop3}' is not supported on the Server-Side Row Model.` + (alt ? ` Please use ${alt} instead.` : "");
12845
12845
  if (this.gridOptionsService.exists("groupDefaultExpanded")) {
12846
12846
  console.warn(msg("groupDefaultExpanded", "isServerSideGroupOpenByDefault callback"));
12847
12847
  }
@@ -12857,7 +12857,7 @@ var GridOptionsValidator = class GridOptionsValidator2 {
12857
12857
  } else if (this.gridOptionsService.is("enableRangeHandle") || this.gridOptionsService.is("enableFillHandle")) {
12858
12858
  console.warn("AG Grid: 'enableRangeHandle' or 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");
12859
12859
  }
12860
- const validateRegistered = (prop, module) => this.gridOptionsService.exists(prop) && ModuleRegistry.__assertRegistered(module, prop, this.gridOptionsService.getGridId());
12860
+ const validateRegistered = (prop3, module) => this.gridOptionsService.exists(prop3) && ModuleRegistry.__assertRegistered(module, prop3, this.gridOptionsService.getGridId());
12861
12861
  validateRegistered("sideBar", ModuleNames.SideBarModule);
12862
12862
  validateRegistered("statusBar", ModuleNames.StatusBarModule);
12863
12863
  validateRegistered("enableCharts", ModuleNames.GridChartsModule);
@@ -52181,15 +52181,15 @@ var DataTypeService = class DataTypeService2 extends BeanStub {
52181
52181
  ["valueGetter", void 0],
52182
52182
  ["valueParser", void 0],
52183
52183
  ["refData", void 0]
52184
- ].some(([prop, comparisonValue]) => this.doesColDefPropPreventInference(colDef, propsToCheckForInference, prop, comparisonValue));
52184
+ ].some(([prop3, comparisonValue]) => this.doesColDefPropPreventInference(colDef, propsToCheckForInference, prop3, comparisonValue));
52185
52185
  }
52186
- doesColDefPropPreventInference(colDef, checkProps, prop, comparisonValue) {
52187
- if (!checkProps[prop]) {
52186
+ doesColDefPropPreventInference(colDef, checkProps, prop3, comparisonValue) {
52187
+ if (!checkProps[prop3]) {
52188
52188
  return false;
52189
52189
  }
52190
- const value = colDef[prop];
52190
+ const value = colDef[prop3];
52191
52191
  if (value === null) {
52192
- checkProps[prop] = false;
52192
+ checkProps[prop3] = false;
52193
52193
  return false;
52194
52194
  } else {
52195
52195
  return comparisonValue === void 0 ? !!value : value === comparisonValue;
@@ -53877,6 +53877,7 @@ var LocationFilterOverlay = React76__default.default.forwardRef(
53877
53877
  enableSublocations,
53878
53878
  selectState,
53879
53879
  options,
53880
+ disabledOptions,
53880
53881
  columnDefinition,
53881
53882
  value
53882
53883
  }, ref) => {
@@ -53898,6 +53899,7 @@ var LocationFilterOverlay = React76__default.default.forwardRef(
53898
53899
  return onSelectAll();
53899
53900
  }
53900
53901
  if (selection.item.id === includeSublocationOption.id) {
53902
+ _onSelect(selection);
53901
53903
  return onSelectSublocations();
53902
53904
  }
53903
53905
  return _onSelect(selection);
@@ -53968,8 +53970,9 @@ var LocationFilterOverlay = React76__default.default.forwardRef(
53968
53970
  {
53969
53971
  key: getId3(item),
53970
53972
  item,
53971
- selected: value.map(({ id }) => id).includes(getId3(item)),
53972
- suggested: i === 0
53973
+ selected: value.map(({ id }) => id).includes(getId3(item)) || disabledOptions.map(({ id }) => id).includes(getId3(item)),
53974
+ suggested: i === 0,
53975
+ disabled: disabledOptions.map(({ id }) => id).includes(getId3(item))
53973
53976
  },
53974
53977
  getLabel3(item)
53975
53978
  );
@@ -54000,10 +54003,23 @@ var ServerSideLocationFilterRenderer = React76__default.default.forwardRef(
54000
54003
  const [selectState, setSelectState] = React76__default.default.useState(
54001
54004
  determineSelectedState(value)
54002
54005
  );
54006
+ const [disabledValues, setDisabledValues] = React76__default.default.useState([]);
54003
54007
  const [enableSublocations, setEnableSublocations] = React76__default.default.useState(false);
54004
54008
  const onSelectSublocations = React76__default.default.useCallback(() => {
54009
+ if (enableSublocations) {
54010
+ setDisabledValues([]);
54011
+ } else {
54012
+ const newDisabledValues = [];
54013
+ value.forEach((location) => {
54014
+ newDisabledValues.push(...findSublocations(location));
54015
+ });
54016
+ const uniqDisabledValues = ramda.uniqBy(ramda.prop("id"), newDisabledValues).filter(
54017
+ ({ id }) => !selectedValueIds.includes(id)
54018
+ );
54019
+ setDisabledValues(uniqDisabledValues);
54020
+ }
54005
54021
  setEnableSublocations(!enableSublocations);
54006
- }, [enableSublocations]);
54022
+ }, [enableSublocations, value, selectedValueIds, options]);
54007
54023
  const I18n = coreReact.useI18nContext();
54008
54024
  const selectRef = React76__default.default.useRef(null);
54009
54025
  const onSelectAll = React76__default.default.useCallback(() => {
@@ -54019,17 +54035,47 @@ var ServerSideLocationFilterRenderer = React76__default.default.forwardRef(
54019
54035
  }
54020
54036
  }, [options, selectState, selectedValueIds]);
54021
54037
  const onSelect = (selection) => {
54022
- if (selection.item.id === "select_all" || selection.item.id === "include_sublocations") {
54038
+ if (selection.item.id === "select_all") {
54023
54039
  return;
54024
54040
  }
54025
- let newSelections = selectedValueIds.includes(getId3(selection.item)) ? removeSelections(selection.item, value) : [
54026
- ...value,
54027
- ...handleSelectSublocations(selection.item),
54028
- selection.item
54029
- ];
54041
+ if (selection.item.id === "include_sublocations") {
54042
+ return onChange(
54043
+ value.map((item) => ({
54044
+ ...item,
54045
+ sublocations: enableSublocations ? [] : findSublocations(item)
54046
+ }))
54047
+ );
54048
+ }
54049
+ let newSelections = [];
54050
+ if (selectedValueIds.includes(getId3(selection.item))) {
54051
+ newSelections = removeSelections(selection.item, value);
54052
+ } else {
54053
+ newSelections = [...value, selection.item];
54054
+ const sublocationsToDisable = handleSelectSublocations(selection.item);
54055
+ const newDisabledValues = [
54056
+ ...disabledValues,
54057
+ ...sublocationsToDisable.filter(
54058
+ ({ id }) => !selectedValueIds.includes(id)
54059
+ )
54060
+ ];
54061
+ setDisabledValues(newDisabledValues);
54062
+ }
54030
54063
  setSelectState(determineSelectedState(newSelections));
54031
54064
  setSelectedValueIds(newSelections.map(({ id }) => id));
54032
- onChange(newSelections);
54065
+ onChange(
54066
+ newSelections.map((item) => ({
54067
+ ...item,
54068
+ sublocations: handleSelectSublocations(item)
54069
+ }))
54070
+ );
54071
+ };
54072
+ const findSublocations = (selected) => {
54073
+ return options.filter((option) => {
54074
+ return ramda.startsWith(
54075
+ `${getLabel3(selected).toLowerCase()} > `,
54076
+ getLabel3(option).toLowerCase()
54077
+ );
54078
+ });
54033
54079
  };
54034
54080
  const handleSelectSublocations = (selected) => {
54035
54081
  if (enableSublocations) {
@@ -54047,14 +54093,16 @@ var ServerSideLocationFilterRenderer = React76__default.default.forwardRef(
54047
54093
  const removeSelections = React76__default.default.useCallback(
54048
54094
  function(selection, selected) {
54049
54095
  const sublocations = handleSelectSublocations(selection);
54050
- return enableSublocations ? selected.filter(
54051
- (item) => ![
54052
- ...sublocations.map(({ id }) => id),
54053
- getId3(selection)
54054
- ].includes(item.id)
54055
- ) : selected.filter((item) => getId3(item) !== getId3(selection));
54096
+ const disabledValueIds = disabledValues.map(({ id }) => id);
54097
+ const sublocationsToRemoveFromDisabledIds = sublocations.filter(({ id }) => disabledValueIds.includes(id)).map(({ id }) => id);
54098
+ setDisabledValues(
54099
+ disabledValues.filter(
54100
+ ({ id }) => !sublocationsToRemoveFromDisabledIds.includes(id)
54101
+ )
54102
+ );
54103
+ return selected.filter((item) => getId3(item) !== getId3(selection));
54056
54104
  },
54057
- [enableSublocations]
54105
+ [enableSublocations, disabledValues]
54058
54106
  );
54059
54107
  React76__default.default.useEffect(() => {
54060
54108
  setSelectState(determineSelectedState(value));
@@ -54065,6 +54113,7 @@ var ServerSideLocationFilterRenderer = React76__default.default.forwardRef(
54065
54113
  columnDefinition,
54066
54114
  value,
54067
54115
  options,
54116
+ disabledOptions: disabledValues,
54068
54117
  enableSublocations,
54069
54118
  getId: getId3,
54070
54119
  getLabel: getLabel3,
@@ -79810,6 +79859,11 @@ var ja_JP_default = {
79810
79859
  }
79811
79860
  };
79812
79861
 
79862
+ // src/locales/pl-PL.json
79863
+ var pl_PL_default = {
79864
+ dataTable: {}
79865
+ };
79866
+
79813
79867
  // src/locales/pseudo.json
79814
79868
  var pseudo_default = {
79815
79869
  dataTable: {
@@ -80426,7 +80480,8 @@ var translations = {
80426
80480
  pseudo: pseudo_default,
80427
80481
  "pt-BR": pt_BR_default,
80428
80482
  "th-TH": th_TH_default,
80429
- "zh-SG": zh_SG_default
80483
+ "zh-SG": zh_SG_default,
80484
+ "pl-PL": pl_PL_default
80430
80485
  };
80431
80486
  var PRINCE_XML_DPI = 96;
80432
80487
  var DEFAULT_PAGE_MARGIN = 40;
@@ -83854,6 +83909,7 @@ var LocationQuickFilterOverlay = React76__default.default.forwardRef(
83854
83909
  enableSublocations,
83855
83910
  selectState,
83856
83911
  options,
83912
+ disabledOptions,
83857
83913
  columnDefinition,
83858
83914
  value
83859
83915
  }, ref) => {
@@ -83881,6 +83937,7 @@ var LocationQuickFilterOverlay = React76__default.default.forwardRef(
83881
83937
  return onSelectAll();
83882
83938
  }
83883
83939
  if (selection.item.id === includeSublocationOption.id) {
83940
+ _onSelect(selection);
83884
83941
  return onSelectSublocations();
83885
83942
  }
83886
83943
  return _onSelect(selection);
@@ -83951,8 +84008,9 @@ var LocationQuickFilterOverlay = React76__default.default.forwardRef(
83951
84008
  {
83952
84009
  key: getId3(item),
83953
84010
  item,
83954
- selected: value.map(({ id }) => id).includes(getId3(item)),
83955
- suggested: i === 0
84011
+ selected: value.map(({ id }) => id).includes(getId3(item)) || disabledOptions.map(({ id }) => id).includes(getId3(item)),
84012
+ suggested: i === 0,
84013
+ disabled: disabledOptions.map(({ id }) => id).includes(getId3(item))
83956
84014
  },
83957
84015
  getLabel3(item)
83958
84016
  );
@@ -83999,10 +84057,23 @@ var LocationQuickFilterRenderer = ({
83999
84057
  const [selectState, setSelectState] = React76__default.default.useState(
84000
84058
  determineSelectedState(value)
84001
84059
  );
84060
+ const [disabledValues, setDisabledValues] = React76__default.default.useState([]);
84002
84061
  const [enableSublocations, setEnableSublocations] = React76__default.default.useState(false);
84003
84062
  const onSelectSublocations = React76__default.default.useCallback(() => {
84063
+ if (enableSublocations) {
84064
+ setDisabledValues([]);
84065
+ } else {
84066
+ const newDisabledValues = [];
84067
+ value.forEach((location) => {
84068
+ newDisabledValues.push(...findSublocations(location));
84069
+ });
84070
+ const uniqDisabledValues = ramda.uniqBy(ramda.prop("id"), newDisabledValues).filter(
84071
+ ({ id }) => !selectedValueIds.includes(id)
84072
+ );
84073
+ setDisabledValues(uniqDisabledValues);
84074
+ }
84004
84075
  setEnableSublocations(!enableSublocations);
84005
- }, [enableSublocations]);
84076
+ }, [enableSublocations, value, selectedValueIds, options]);
84006
84077
  const onSelectAll = React76__default.default.useCallback(() => {
84007
84078
  if (selectState === "none" || selectState === "partial") {
84008
84079
  setSelectState("all");
@@ -84016,22 +84087,51 @@ var LocationQuickFilterRenderer = ({
84016
84087
  }
84017
84088
  }, [options, selectState, selectedValueIds]);
84018
84089
  const onSelect = (selection) => {
84019
- if (selection.item.id === "select_all" || selection.item.id === "include_sublocations") {
84090
+ if (selection.item.id === "select_all") {
84020
84091
  return;
84021
84092
  }
84022
- let newSelections = selectedValueIds.includes(getId3(selection.item)) ? removeSelections(selection.item, value) : [...value, ...handleSelectSublocations(selection.item), selection.item];
84093
+ if (selection.item.id === "include_sublocations") {
84094
+ return onChange(
84095
+ value.map((item) => ({
84096
+ ...item,
84097
+ sublocations: enableSublocations ? [] : findSublocations(item)
84098
+ }))
84099
+ );
84100
+ }
84101
+ let newSelections = [];
84102
+ if (selectedValueIds.includes(getId3(selection.item))) {
84103
+ newSelections = removeSelections(selection.item, value);
84104
+ } else {
84105
+ newSelections = [...value, selection.item];
84106
+ const sublocationsToDisable = handleSelectSublocations(selection.item);
84107
+ const newDisabledValues = [
84108
+ ...disabledValues,
84109
+ ...sublocationsToDisable.filter(
84110
+ ({ id }) => !selectedValueIds.includes(id)
84111
+ )
84112
+ ];
84113
+ setDisabledValues(newDisabledValues);
84114
+ }
84023
84115
  setSelectState(determineSelectedState(newSelections));
84024
84116
  setSelectedValueIds(newSelections.map(({ id }) => id));
84025
- onChange(newSelections);
84117
+ onChange(
84118
+ newSelections.map((item) => ({
84119
+ ...item,
84120
+ sublocations: handleSelectSublocations(item)
84121
+ }))
84122
+ );
84123
+ };
84124
+ const findSublocations = (selected) => {
84125
+ return options.filter((option) => {
84126
+ return ramda.startsWith(
84127
+ `${getLabel3(selected).toLowerCase()} > `,
84128
+ getLabel3(option).toLowerCase()
84129
+ );
84130
+ });
84026
84131
  };
84027
84132
  const handleSelectSublocations = (selected) => {
84028
84133
  if (enableSublocations) {
84029
- const filteredOptions = options.filter((option) => {
84030
- return ramda.startsWith(
84031
- `${getLabel3(selected).toLowerCase()} > `,
84032
- getLabel3(option).toLowerCase()
84033
- );
84034
- });
84134
+ const filteredOptions = findSublocations(selected);
84035
84135
  return filteredOptions;
84036
84136
  } else {
84037
84137
  return [];
@@ -84040,13 +84140,16 @@ var LocationQuickFilterRenderer = ({
84040
84140
  const removeSelections = React76__default.default.useCallback(
84041
84141
  function(selection, selected) {
84042
84142
  const sublocations = handleSelectSublocations(selection);
84043
- return enableSublocations ? selected.filter(
84044
- (item) => ![...sublocations.map(({ id }) => id), getId3(selection)].includes(
84045
- item.id
84143
+ const disabledValueIds = disabledValues.map(({ id }) => id);
84144
+ const sublocationsToRemoveFromDisabledIds = sublocations.filter(({ id }) => disabledValueIds.includes(id)).map(({ id }) => id);
84145
+ setDisabledValues(
84146
+ disabledValues.filter(
84147
+ ({ id }) => !sublocationsToRemoveFromDisabledIds.includes(id)
84046
84148
  )
84047
- ) : selected.filter((item) => getId3(item) !== getId3(selection));
84149
+ );
84150
+ return selected.filter((item) => getId3(item) !== getId3(selection));
84048
84151
  },
84049
- [enableSublocations]
84152
+ [enableSublocations, disabledValues]
84050
84153
  );
84051
84154
  React76__default.default.useEffect(() => {
84052
84155
  setSelectState(determineSelectedState(value));
@@ -84061,6 +84164,7 @@ var LocationQuickFilterRenderer = ({
84061
84164
  selectState,
84062
84165
  value,
84063
84166
  options,
84167
+ disabledOptions: disabledValues,
84064
84168
  getId: getId3,
84065
84169
  getLabel: getLabel3,
84066
84170
  loading,
@@ -1175,6 +1175,7 @@ interface LocationOption {
1175
1175
  label?: string;
1176
1176
  name?: string;
1177
1177
  id: string | number;
1178
+ sublocations?: Omit<LocationOption, 'sublocations'>[];
1178
1179
  }
1179
1180
  declare const LocationFilterRenderer: (props: LocationFilterProps) => React__default.JSX.Element | null;
1180
1181
 
@@ -1175,6 +1175,7 @@ interface LocationOption {
1175
1175
  label?: string;
1176
1176
  name?: string;
1177
1177
  id: string | number;
1178
+ sublocations?: Omit<LocationOption, 'sublocations'>[];
1178
1179
  }
1179
1180
  declare const LocationFilterRenderer: (props: LocationFilterProps) => React__default.JSX.Element | null;
1180
1181