@procore/data-table 14.27.1 → 14.28.0-cdn.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 +12 -0
- package/dist/legacy/index.cjs +61 -36
- package/dist/legacy/index.d.cts +5 -2
- package/dist/legacy/index.d.ts +5 -2
- package/dist/legacy/index.js +61 -36
- package/dist/modern/index.cjs +59 -32
- package/dist/modern/index.d.cts +5 -2
- package/dist/modern/index.d.ts +5 -2
- package/dist/modern/index.js +59 -32
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 15.0.0-cdn.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3f72970: Add placeholder implementation for MultiSelectCellRenderer component
|
|
8
|
+
- 8baa7c3: Update I18nprovider and DataTable to have the option to pull translations from the CDN
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [8baa7c3]
|
|
13
|
+
- @procore/core-react@12.21.0-cdn.0
|
|
14
|
+
|
|
3
15
|
## 14.27.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/legacy/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ var labsFinancialsUtils = require('@procore/labs-financials-utils');
|
|
|
12
12
|
var styled4 = require('styled-components');
|
|
13
13
|
var format = require('@procore/labs-financials-utils/dist/format');
|
|
14
14
|
var ulid$1 = require('ulid');
|
|
15
|
+
var cdnTranslations = require('@procore/cdn-translations');
|
|
15
16
|
var toastAlert = require('@procore/toast-alert');
|
|
16
17
|
var ReactDOM = require('react-dom');
|
|
17
18
|
var server = require('react-dom/server');
|
|
@@ -57937,7 +57938,8 @@ function getId2(func, option) {
|
|
|
57937
57938
|
return (func == null ? void 0 : func(option)) ?? (option == null ? void 0 : option.id) ?? option;
|
|
57938
57939
|
}
|
|
57939
57940
|
var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) => {
|
|
57940
|
-
var _a, _b;
|
|
57941
|
+
var _a, _b, _c, _d;
|
|
57942
|
+
const I18n = coreReact.useI18nContext();
|
|
57941
57943
|
const ref = React80__default.default.useRef();
|
|
57942
57944
|
React80__default.default.useLayoutEffect(() => {
|
|
57943
57945
|
var _a2, _b2;
|
|
@@ -57946,12 +57948,19 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57946
57948
|
if (value === void 0 || value === null) {
|
|
57947
57949
|
return null;
|
|
57948
57950
|
}
|
|
57951
|
+
const options = getValue(
|
|
57952
|
+
(_a = columnDefinition.cellRendererParams) == null ? void 0 : _a.getValue,
|
|
57953
|
+
value,
|
|
57954
|
+
emptyArray
|
|
57955
|
+
);
|
|
57956
|
+
const enablePlaceholder = (((_b = columnDefinition.cellRendererParams) == null ? void 0 : _b.enablePlaceholder) && columnDefinition.editable) ?? false;
|
|
57957
|
+
const placeholder = ((_c = columnDefinition.cellRendererParams) == null ? void 0 : _c.placeholder) ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
|
|
57949
57958
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
57950
57959
|
coreReact.Typography,
|
|
57951
57960
|
{
|
|
57952
57961
|
as: "ol",
|
|
57953
57962
|
...getCellValueTypographyProps(
|
|
57954
|
-
(
|
|
57963
|
+
(_d = columnDefinition.cellRendererParams) == null ? void 0 : _d.typographyProps
|
|
57955
57964
|
),
|
|
57956
57965
|
className: cx16("inlineListItems", "truncatingText", {
|
|
57957
57966
|
"truncatingText--md": rowHeight === rowSize.md,
|
|
@@ -57959,29 +57968,19 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57959
57968
|
}),
|
|
57960
57969
|
ref
|
|
57961
57970
|
},
|
|
57962
|
-
|
|
57963
|
-
|
|
57964
|
-
|
|
57965
|
-
|
|
57966
|
-
|
|
57967
|
-
var _a2, _b2, _c;
|
|
57968
|
-
return /* @__PURE__ */ React80__default.default.createElement(
|
|
57969
|
-
React80__default.default.Fragment,
|
|
57970
|
-
{
|
|
57971
|
-
key: (
|
|
57972
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
57973
|
-
`${getLabel2(
|
|
57974
|
-
(_a2 = columnDefinition.cellRendererParams) == null ? void 0 : _a2.getLabel,
|
|
57975
|
-
option
|
|
57976
|
-
)}_${getId2(
|
|
57977
|
-
(_b2 = columnDefinition.cellRendererParams) == null ? void 0 : _b2.getId,
|
|
57978
|
-
option
|
|
57979
|
-
)}_idx_${idx}`
|
|
57980
|
-
)
|
|
57981
|
-
},
|
|
57982
|
-
/* @__PURE__ */ React80__default.default.createElement("li", null, getLabel2((_c = columnDefinition.cellRendererParams) == null ? void 0 : _c.getLabel, option), idx !== arr.length - 1 ? commaToken : null)
|
|
57971
|
+
options.length ? options.map((option, idx, arr) => {
|
|
57972
|
+
var _a2, _b2;
|
|
57973
|
+
const label = getLabel2(
|
|
57974
|
+
(_a2 = columnDefinition.cellRendererParams) == null ? void 0 : _a2.getLabel,
|
|
57975
|
+
option
|
|
57983
57976
|
);
|
|
57984
|
-
|
|
57977
|
+
const optionId = getId2(
|
|
57978
|
+
(_b2 = columnDefinition.cellRendererParams) == null ? void 0 : _b2.getId,
|
|
57979
|
+
option
|
|
57980
|
+
);
|
|
57981
|
+
const key = `${label}_${optionId}_idx_${idx}`;
|
|
57982
|
+
return /* @__PURE__ */ React80__default.default.createElement(React80__default.default.Fragment, { key }, /* @__PURE__ */ React80__default.default.createElement("li", null, label, idx !== arr.length - 1 ? commaToken : null));
|
|
57983
|
+
}) : enablePlaceholder ? /* @__PURE__ */ React80__default.default.createElement("li", { style: { color: coreReact.colors.gray45 } }, placeholder) : null
|
|
57985
57984
|
);
|
|
57986
57985
|
};
|
|
57987
57986
|
var MultiSelectCellRenderer = withDataTableRenderer(
|
|
@@ -80057,17 +80056,17 @@ var Shape = class _Shape extends Node2 {
|
|
|
80057
80056
|
let linearGradientMatch;
|
|
80058
80057
|
if ((fill === null || fill === void 0 ? void 0 : fill.startsWith("linear-gradient")) && (linearGradientMatch = LINEAR_GRADIENT_REGEXP.exec(fill))) {
|
|
80059
80058
|
const angle = parseFloat(linearGradientMatch[1]);
|
|
80060
|
-
const
|
|
80059
|
+
const colors9 = [];
|
|
80061
80060
|
const colorsPart = linearGradientMatch[2];
|
|
80062
80061
|
const colorRegex = /(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;
|
|
80063
80062
|
let c;
|
|
80064
80063
|
while (c = colorRegex.exec(colorsPart)) {
|
|
80065
|
-
|
|
80064
|
+
colors9.push(c[0]);
|
|
80066
80065
|
}
|
|
80067
80066
|
this.gradient = new LinearGradient();
|
|
80068
80067
|
this.gradient.angle = angle;
|
|
80069
|
-
this.gradient.stops =
|
|
80070
|
-
const offset4 = index / (
|
|
80068
|
+
this.gradient.stops = colors9.map((color, index) => {
|
|
80069
|
+
const offset4 = index / (colors9.length - 1);
|
|
80071
80070
|
return { offset: offset4, color };
|
|
80072
80071
|
});
|
|
80073
80072
|
} else {
|
|
@@ -106412,6 +106411,9 @@ var en_default = {
|
|
|
106412
106411
|
selectCell: {
|
|
106413
106412
|
placeholder: "Select {{label}}"
|
|
106414
106413
|
},
|
|
106414
|
+
multiSelectCell: {
|
|
106415
|
+
placeholder: "Select Values"
|
|
106416
|
+
},
|
|
106415
106417
|
booleanCell: {
|
|
106416
106418
|
options: {
|
|
106417
106419
|
yes: "Yes",
|
|
@@ -107716,6 +107718,9 @@ var pseudo_default = {
|
|
|
107716
107718
|
selectCell: {
|
|
107717
107719
|
placeholder: "[\u015E\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 {{\u0140\u0227\u0180\u1E17\u0140}}}}}]"
|
|
107718
107720
|
},
|
|
107721
|
+
multiSelectCell: {
|
|
107722
|
+
placeholder: "[\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 \u1E7C\u0227\u0140\u016D\u1E17\u015F\u015F\u015F]"
|
|
107723
|
+
},
|
|
107719
107724
|
booleanCell: {
|
|
107720
107725
|
options: {
|
|
107721
107726
|
yes: "[\u1E8E\u1E17\u015F]",
|
|
@@ -109227,7 +109232,8 @@ var DataTable = ({
|
|
|
109227
109232
|
showExpandCollapseAllToggle,
|
|
109228
109233
|
translations: translations2 = {},
|
|
109229
109234
|
enableCellTextSelection,
|
|
109230
|
-
localStoragePersistenceKey
|
|
109235
|
+
localStoragePersistenceKey,
|
|
109236
|
+
enableCDN
|
|
109231
109237
|
}) => {
|
|
109232
109238
|
const initialTableConfig = localStoragePersistenceKey && webSdkStorage.storage.local.getItem(localStoragePersistenceKey) || _initialTableConfig;
|
|
109233
109239
|
const onServerSideDataRequestRef = React80__default.default.useRef(onServerSideDataRequest);
|
|
@@ -109239,14 +109245,29 @@ var DataTable = ({
|
|
|
109239
109245
|
);
|
|
109240
109246
|
const contextPanel = useContextPanel();
|
|
109241
109247
|
const clientI18n = coreReact.useI18nContext();
|
|
109248
|
+
const isCDNEnabled = enableCDN ?? (clientI18n == null ? void 0 : clientI18n.enableCDN) ?? false;
|
|
109249
|
+
const cdnTranslations$1 = cdnTranslations.useRequestTranslations(
|
|
109250
|
+
{
|
|
109251
|
+
locale: clientI18n.locale,
|
|
109252
|
+
type: "file",
|
|
109253
|
+
absolute_file_path: (locale) => `core/packages/data-table/src/locales/${locale}.json`
|
|
109254
|
+
},
|
|
109255
|
+
{ en: translations.en },
|
|
109256
|
+
{
|
|
109257
|
+
translations,
|
|
109258
|
+
enableCDN: isCDNEnabled
|
|
109259
|
+
}
|
|
109260
|
+
);
|
|
109242
109261
|
const internalI18n = coreReact.useI18n({
|
|
109243
|
-
|
|
109262
|
+
locale: clientI18n.locale,
|
|
109244
109263
|
translations: ramda.mergeDeepLeft(
|
|
109245
109264
|
ramda.mergeDeepLeft(clientI18n.translations, {
|
|
109246
109265
|
[clientI18n.locale]: translations2
|
|
109247
109266
|
}),
|
|
109248
|
-
translations
|
|
109249
|
-
)
|
|
109267
|
+
cdnTranslations$1.translations
|
|
109268
|
+
),
|
|
109269
|
+
requestedTranslations: cdnTranslations$1,
|
|
109270
|
+
enableCDN: isCDNEnabled
|
|
109250
109271
|
});
|
|
109251
109272
|
const rowSelectionRef = React80__default.default.useRef({
|
|
109252
109273
|
affectedRows: {},
|
|
@@ -112482,7 +112503,8 @@ var ClientSideDataTable = ({
|
|
|
112482
112503
|
onTableConfigChange,
|
|
112483
112504
|
translations: translations2 = {},
|
|
112484
112505
|
enableCellTextSelection,
|
|
112485
|
-
localStoragePersistenceKey
|
|
112506
|
+
localStoragePersistenceKey,
|
|
112507
|
+
enableCDN
|
|
112486
112508
|
}) => {
|
|
112487
112509
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
112488
112510
|
DataTable,
|
|
@@ -112500,7 +112522,8 @@ var ClientSideDataTable = ({
|
|
|
112500
112522
|
translations: translations2,
|
|
112501
112523
|
localStoragePersistenceKey,
|
|
112502
112524
|
customBulkEditorFields,
|
|
112503
|
-
enableCellTextSelection
|
|
112525
|
+
enableCellTextSelection,
|
|
112526
|
+
enableCDN
|
|
112504
112527
|
},
|
|
112505
112528
|
children
|
|
112506
112529
|
);
|
|
@@ -116961,7 +116984,8 @@ var ServerSideDataTable = ({
|
|
|
116961
116984
|
enableCellTextSelection,
|
|
116962
116985
|
showExpandCollapseAllToggle,
|
|
116963
116986
|
translations: translations2 = {},
|
|
116964
|
-
localStoragePersistenceKey
|
|
116987
|
+
localStoragePersistenceKey,
|
|
116988
|
+
enableCDN
|
|
116965
116989
|
}) => {
|
|
116966
116990
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
116967
116991
|
DataTable,
|
|
@@ -116980,7 +117004,8 @@ var ServerSideDataTable = ({
|
|
|
116980
117004
|
translations: translations2,
|
|
116981
117005
|
customBulkEditorFields,
|
|
116982
117006
|
enableCellTextSelection,
|
|
116983
|
-
localStoragePersistenceKey
|
|
117007
|
+
localStoragePersistenceKey,
|
|
117008
|
+
enableCDN
|
|
116984
117009
|
},
|
|
116985
117010
|
children
|
|
116986
117011
|
);
|
package/dist/legacy/index.d.cts
CHANGED
|
@@ -316,6 +316,8 @@ interface MultiSelectCellRendererParams<TValue, OptionValue> {
|
|
|
316
316
|
getLabel?: (cellValue: OptionValue) => string;
|
|
317
317
|
getValue?: (cellValue: TValue) => OptionValue[];
|
|
318
318
|
typographyProps?: TypographyProps;
|
|
319
|
+
placeholder?: string;
|
|
320
|
+
enablePlaceholder?: boolean;
|
|
319
321
|
}
|
|
320
322
|
type OnSearchParams$1 = {
|
|
321
323
|
data: MultiSelectCellEditorProps['data'];
|
|
@@ -1146,6 +1148,7 @@ interface DataTableProps {
|
|
|
1146
1148
|
showExpandCollapseAllToggle?: boolean;
|
|
1147
1149
|
translations?: DataTableTranslations;
|
|
1148
1150
|
enableCellTextSelection?: boolean;
|
|
1151
|
+
enableCDN?: boolean;
|
|
1149
1152
|
}
|
|
1150
1153
|
interface ClientSideDataTableProps extends Omit<DataTableProps, 'onServerSideDataRequest' | 'showExpandCollapseAllToggle'> {
|
|
1151
1154
|
}
|
|
@@ -1435,7 +1438,7 @@ interface BulkActionProps {
|
|
|
1435
1438
|
style?: React__default.CSSProperties;
|
|
1436
1439
|
}
|
|
1437
1440
|
|
|
1438
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1441
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1439
1442
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1440
1443
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1441
1444
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1472,7 +1475,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1472
1475
|
|
|
1473
1476
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1474
1477
|
|
|
1475
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1478
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1476
1479
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1477
1480
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1478
1481
|
ConfigPanelButton: React__default.FC<{}>;
|
package/dist/legacy/index.d.ts
CHANGED
|
@@ -316,6 +316,8 @@ interface MultiSelectCellRendererParams<TValue, OptionValue> {
|
|
|
316
316
|
getLabel?: (cellValue: OptionValue) => string;
|
|
317
317
|
getValue?: (cellValue: TValue) => OptionValue[];
|
|
318
318
|
typographyProps?: TypographyProps;
|
|
319
|
+
placeholder?: string;
|
|
320
|
+
enablePlaceholder?: boolean;
|
|
319
321
|
}
|
|
320
322
|
type OnSearchParams$1 = {
|
|
321
323
|
data: MultiSelectCellEditorProps['data'];
|
|
@@ -1146,6 +1148,7 @@ interface DataTableProps {
|
|
|
1146
1148
|
showExpandCollapseAllToggle?: boolean;
|
|
1147
1149
|
translations?: DataTableTranslations;
|
|
1148
1150
|
enableCellTextSelection?: boolean;
|
|
1151
|
+
enableCDN?: boolean;
|
|
1149
1152
|
}
|
|
1150
1153
|
interface ClientSideDataTableProps extends Omit<DataTableProps, 'onServerSideDataRequest' | 'showExpandCollapseAllToggle'> {
|
|
1151
1154
|
}
|
|
@@ -1435,7 +1438,7 @@ interface BulkActionProps {
|
|
|
1435
1438
|
style?: React__default.CSSProperties;
|
|
1436
1439
|
}
|
|
1437
1440
|
|
|
1438
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1441
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1439
1442
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1440
1443
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1441
1444
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1472,7 +1475,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1472
1475
|
|
|
1473
1476
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1474
1477
|
|
|
1475
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1478
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1476
1479
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1477
1480
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1478
1481
|
ConfigPanelButton: React__default.FC<{}>;
|
package/dist/legacy/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { formatNumber, formatCurrency, formatPercentage } from '@procore/labs-fi
|
|
|
10
10
|
import styled4, { css as css$1 } from 'styled-components';
|
|
11
11
|
import { format } from '@procore/labs-financials-utils/dist/format';
|
|
12
12
|
import { detectPrng, factory } from 'ulid';
|
|
13
|
+
import { useRequestTranslations } from '@procore/cdn-translations';
|
|
13
14
|
import { useToastAlertContext, ToastAlertProvider } from '@procore/toast-alert';
|
|
14
15
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
15
16
|
import { renderToString, renderToStaticMarkup } from 'react-dom/server';
|
|
@@ -57924,7 +57925,8 @@ function getId2(func, option) {
|
|
|
57924
57925
|
return (func == null ? void 0 : func(option)) ?? (option == null ? void 0 : option.id) ?? option;
|
|
57925
57926
|
}
|
|
57926
57927
|
var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) => {
|
|
57927
|
-
var _a, _b;
|
|
57928
|
+
var _a, _b, _c, _d;
|
|
57929
|
+
const I18n = useI18nContext();
|
|
57928
57930
|
const ref = React80.useRef();
|
|
57929
57931
|
React80.useLayoutEffect(() => {
|
|
57930
57932
|
var _a2, _b2;
|
|
@@ -57933,12 +57935,19 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57933
57935
|
if (value === void 0 || value === null) {
|
|
57934
57936
|
return null;
|
|
57935
57937
|
}
|
|
57938
|
+
const options = getValue(
|
|
57939
|
+
(_a = columnDefinition.cellRendererParams) == null ? void 0 : _a.getValue,
|
|
57940
|
+
value,
|
|
57941
|
+
emptyArray
|
|
57942
|
+
);
|
|
57943
|
+
const enablePlaceholder = (((_b = columnDefinition.cellRendererParams) == null ? void 0 : _b.enablePlaceholder) && columnDefinition.editable) ?? false;
|
|
57944
|
+
const placeholder = ((_c = columnDefinition.cellRendererParams) == null ? void 0 : _c.placeholder) ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
|
|
57936
57945
|
return /* @__PURE__ */ React80.createElement(
|
|
57937
57946
|
Typography,
|
|
57938
57947
|
{
|
|
57939
57948
|
as: "ol",
|
|
57940
57949
|
...getCellValueTypographyProps(
|
|
57941
|
-
(
|
|
57950
|
+
(_d = columnDefinition.cellRendererParams) == null ? void 0 : _d.typographyProps
|
|
57942
57951
|
),
|
|
57943
57952
|
className: cx16("inlineListItems", "truncatingText", {
|
|
57944
57953
|
"truncatingText--md": rowHeight === rowSize.md,
|
|
@@ -57946,29 +57955,19 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57946
57955
|
}),
|
|
57947
57956
|
ref
|
|
57948
57957
|
},
|
|
57949
|
-
|
|
57950
|
-
|
|
57951
|
-
|
|
57952
|
-
|
|
57953
|
-
|
|
57954
|
-
var _a2, _b2, _c;
|
|
57955
|
-
return /* @__PURE__ */ React80.createElement(
|
|
57956
|
-
React80.Fragment,
|
|
57957
|
-
{
|
|
57958
|
-
key: (
|
|
57959
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
57960
|
-
`${getLabel2(
|
|
57961
|
-
(_a2 = columnDefinition.cellRendererParams) == null ? void 0 : _a2.getLabel,
|
|
57962
|
-
option
|
|
57963
|
-
)}_${getId2(
|
|
57964
|
-
(_b2 = columnDefinition.cellRendererParams) == null ? void 0 : _b2.getId,
|
|
57965
|
-
option
|
|
57966
|
-
)}_idx_${idx}`
|
|
57967
|
-
)
|
|
57968
|
-
},
|
|
57969
|
-
/* @__PURE__ */ React80.createElement("li", null, getLabel2((_c = columnDefinition.cellRendererParams) == null ? void 0 : _c.getLabel, option), idx !== arr.length - 1 ? commaToken : null)
|
|
57958
|
+
options.length ? options.map((option, idx, arr) => {
|
|
57959
|
+
var _a2, _b2;
|
|
57960
|
+
const label = getLabel2(
|
|
57961
|
+
(_a2 = columnDefinition.cellRendererParams) == null ? void 0 : _a2.getLabel,
|
|
57962
|
+
option
|
|
57970
57963
|
);
|
|
57971
|
-
|
|
57964
|
+
const optionId = getId2(
|
|
57965
|
+
(_b2 = columnDefinition.cellRendererParams) == null ? void 0 : _b2.getId,
|
|
57966
|
+
option
|
|
57967
|
+
);
|
|
57968
|
+
const key = `${label}_${optionId}_idx_${idx}`;
|
|
57969
|
+
return /* @__PURE__ */ React80.createElement(React80.Fragment, { key }, /* @__PURE__ */ React80.createElement("li", null, label, idx !== arr.length - 1 ? commaToken : null));
|
|
57970
|
+
}) : enablePlaceholder ? /* @__PURE__ */ React80.createElement("li", { style: { color: colors.gray45 } }, placeholder) : null
|
|
57972
57971
|
);
|
|
57973
57972
|
};
|
|
57974
57973
|
var MultiSelectCellRenderer = withDataTableRenderer(
|
|
@@ -80044,17 +80043,17 @@ var Shape = class _Shape extends Node2 {
|
|
|
80044
80043
|
let linearGradientMatch;
|
|
80045
80044
|
if ((fill === null || fill === void 0 ? void 0 : fill.startsWith("linear-gradient")) && (linearGradientMatch = LINEAR_GRADIENT_REGEXP.exec(fill))) {
|
|
80046
80045
|
const angle = parseFloat(linearGradientMatch[1]);
|
|
80047
|
-
const
|
|
80046
|
+
const colors9 = [];
|
|
80048
80047
|
const colorsPart = linearGradientMatch[2];
|
|
80049
80048
|
const colorRegex = /(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;
|
|
80050
80049
|
let c;
|
|
80051
80050
|
while (c = colorRegex.exec(colorsPart)) {
|
|
80052
|
-
|
|
80051
|
+
colors9.push(c[0]);
|
|
80053
80052
|
}
|
|
80054
80053
|
this.gradient = new LinearGradient();
|
|
80055
80054
|
this.gradient.angle = angle;
|
|
80056
|
-
this.gradient.stops =
|
|
80057
|
-
const offset4 = index / (
|
|
80055
|
+
this.gradient.stops = colors9.map((color, index) => {
|
|
80056
|
+
const offset4 = index / (colors9.length - 1);
|
|
80058
80057
|
return { offset: offset4, color };
|
|
80059
80058
|
});
|
|
80060
80059
|
} else {
|
|
@@ -106399,6 +106398,9 @@ var en_default = {
|
|
|
106399
106398
|
selectCell: {
|
|
106400
106399
|
placeholder: "Select {{label}}"
|
|
106401
106400
|
},
|
|
106401
|
+
multiSelectCell: {
|
|
106402
|
+
placeholder: "Select Values"
|
|
106403
|
+
},
|
|
106402
106404
|
booleanCell: {
|
|
106403
106405
|
options: {
|
|
106404
106406
|
yes: "Yes",
|
|
@@ -107703,6 +107705,9 @@ var pseudo_default = {
|
|
|
107703
107705
|
selectCell: {
|
|
107704
107706
|
placeholder: "[\u015E\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 {{\u0140\u0227\u0180\u1E17\u0140}}}}}]"
|
|
107705
107707
|
},
|
|
107708
|
+
multiSelectCell: {
|
|
107709
|
+
placeholder: "[\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 \u1E7C\u0227\u0140\u016D\u1E17\u015F\u015F\u015F]"
|
|
107710
|
+
},
|
|
107706
107711
|
booleanCell: {
|
|
107707
107712
|
options: {
|
|
107708
107713
|
yes: "[\u1E8E\u1E17\u015F]",
|
|
@@ -109214,7 +109219,8 @@ var DataTable = ({
|
|
|
109214
109219
|
showExpandCollapseAllToggle,
|
|
109215
109220
|
translations: translations2 = {},
|
|
109216
109221
|
enableCellTextSelection,
|
|
109217
|
-
localStoragePersistenceKey
|
|
109222
|
+
localStoragePersistenceKey,
|
|
109223
|
+
enableCDN
|
|
109218
109224
|
}) => {
|
|
109219
109225
|
const initialTableConfig = localStoragePersistenceKey && storage.local.getItem(localStoragePersistenceKey) || _initialTableConfig;
|
|
109220
109226
|
const onServerSideDataRequestRef = React80.useRef(onServerSideDataRequest);
|
|
@@ -109226,14 +109232,29 @@ var DataTable = ({
|
|
|
109226
109232
|
);
|
|
109227
109233
|
const contextPanel = useContextPanel();
|
|
109228
109234
|
const clientI18n = useI18nContext();
|
|
109235
|
+
const isCDNEnabled = enableCDN ?? (clientI18n == null ? void 0 : clientI18n.enableCDN) ?? false;
|
|
109236
|
+
const cdnTranslations = useRequestTranslations(
|
|
109237
|
+
{
|
|
109238
|
+
locale: clientI18n.locale,
|
|
109239
|
+
type: "file",
|
|
109240
|
+
absolute_file_path: (locale) => `core/packages/data-table/src/locales/${locale}.json`
|
|
109241
|
+
},
|
|
109242
|
+
{ en: translations.en },
|
|
109243
|
+
{
|
|
109244
|
+
translations,
|
|
109245
|
+
enableCDN: isCDNEnabled
|
|
109246
|
+
}
|
|
109247
|
+
);
|
|
109229
109248
|
const internalI18n = useI18n({
|
|
109230
|
-
|
|
109249
|
+
locale: clientI18n.locale,
|
|
109231
109250
|
translations: mergeDeepLeft(
|
|
109232
109251
|
mergeDeepLeft(clientI18n.translations, {
|
|
109233
109252
|
[clientI18n.locale]: translations2
|
|
109234
109253
|
}),
|
|
109235
|
-
translations
|
|
109236
|
-
)
|
|
109254
|
+
cdnTranslations.translations
|
|
109255
|
+
),
|
|
109256
|
+
requestedTranslations: cdnTranslations,
|
|
109257
|
+
enableCDN: isCDNEnabled
|
|
109237
109258
|
});
|
|
109238
109259
|
const rowSelectionRef = React80.useRef({
|
|
109239
109260
|
affectedRows: {},
|
|
@@ -112469,7 +112490,8 @@ var ClientSideDataTable = ({
|
|
|
112469
112490
|
onTableConfigChange,
|
|
112470
112491
|
translations: translations2 = {},
|
|
112471
112492
|
enableCellTextSelection,
|
|
112472
|
-
localStoragePersistenceKey
|
|
112493
|
+
localStoragePersistenceKey,
|
|
112494
|
+
enableCDN
|
|
112473
112495
|
}) => {
|
|
112474
112496
|
return /* @__PURE__ */ React80.createElement(
|
|
112475
112497
|
DataTable,
|
|
@@ -112487,7 +112509,8 @@ var ClientSideDataTable = ({
|
|
|
112487
112509
|
translations: translations2,
|
|
112488
112510
|
localStoragePersistenceKey,
|
|
112489
112511
|
customBulkEditorFields,
|
|
112490
|
-
enableCellTextSelection
|
|
112512
|
+
enableCellTextSelection,
|
|
112513
|
+
enableCDN
|
|
112491
112514
|
},
|
|
112492
112515
|
children
|
|
112493
112516
|
);
|
|
@@ -116948,7 +116971,8 @@ var ServerSideDataTable = ({
|
|
|
116948
116971
|
enableCellTextSelection,
|
|
116949
116972
|
showExpandCollapseAllToggle,
|
|
116950
116973
|
translations: translations2 = {},
|
|
116951
|
-
localStoragePersistenceKey
|
|
116974
|
+
localStoragePersistenceKey,
|
|
116975
|
+
enableCDN
|
|
116952
116976
|
}) => {
|
|
116953
116977
|
return /* @__PURE__ */ React80.createElement(
|
|
116954
116978
|
DataTable,
|
|
@@ -116967,7 +116991,8 @@ var ServerSideDataTable = ({
|
|
|
116967
116991
|
translations: translations2,
|
|
116968
116992
|
customBulkEditorFields,
|
|
116969
116993
|
enableCellTextSelection,
|
|
116970
|
-
localStoragePersistenceKey
|
|
116994
|
+
localStoragePersistenceKey,
|
|
116995
|
+
enableCDN
|
|
116971
116996
|
},
|
|
116972
116997
|
children
|
|
116973
116998
|
);
|
package/dist/modern/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ var labsFinancialsUtils = require('@procore/labs-financials-utils');
|
|
|
12
12
|
var styled4 = require('styled-components');
|
|
13
13
|
var format = require('@procore/labs-financials-utils/dist/format');
|
|
14
14
|
var ulid$1 = require('ulid');
|
|
15
|
+
var cdnTranslations = require('@procore/cdn-translations');
|
|
15
16
|
var toastAlert = require('@procore/toast-alert');
|
|
16
17
|
var ReactDOM = require('react-dom');
|
|
17
18
|
var server = require('react-dom/server');
|
|
@@ -57825,6 +57826,7 @@ function getId2(func, option) {
|
|
|
57825
57826
|
return func?.(option) ?? option?.id ?? option;
|
|
57826
57827
|
}
|
|
57827
57828
|
var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) => {
|
|
57829
|
+
const I18n = coreReact.useI18nContext();
|
|
57828
57830
|
const ref = React80__default.default.useRef();
|
|
57829
57831
|
React80__default.default.useLayoutEffect(() => {
|
|
57830
57832
|
ref?.current?.setAttribute("title", ref?.current?.innerText);
|
|
@@ -57832,6 +57834,13 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57832
57834
|
if (value === void 0 || value === null) {
|
|
57833
57835
|
return null;
|
|
57834
57836
|
}
|
|
57837
|
+
const options = getValue(
|
|
57838
|
+
columnDefinition.cellRendererParams?.getValue,
|
|
57839
|
+
value,
|
|
57840
|
+
emptyArray
|
|
57841
|
+
);
|
|
57842
|
+
const enablePlaceholder = (columnDefinition.cellRendererParams?.enablePlaceholder && columnDefinition.editable) ?? false;
|
|
57843
|
+
const placeholder = columnDefinition.cellRendererParams?.placeholder ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
|
|
57835
57844
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
57836
57845
|
coreReact.Typography,
|
|
57837
57846
|
{
|
|
@@ -57845,26 +57854,18 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57845
57854
|
}),
|
|
57846
57855
|
ref
|
|
57847
57856
|
},
|
|
57848
|
-
|
|
57849
|
-
|
|
57850
|
-
|
|
57851
|
-
|
|
57852
|
-
|
|
57853
|
-
|
|
57854
|
-
|
|
57855
|
-
|
|
57856
|
-
|
|
57857
|
-
|
|
57858
|
-
|
|
57859
|
-
|
|
57860
|
-
)}_${getId2(
|
|
57861
|
-
columnDefinition.cellRendererParams?.getId,
|
|
57862
|
-
option
|
|
57863
|
-
)}_idx_${idx}`
|
|
57864
|
-
)
|
|
57865
|
-
},
|
|
57866
|
-
/* @__PURE__ */ React80__default.default.createElement("li", null, getLabel2(columnDefinition.cellRendererParams?.getLabel, option), idx !== arr.length - 1 ? commaToken : null)
|
|
57867
|
-
))
|
|
57857
|
+
options.length ? options.map((option, idx, arr) => {
|
|
57858
|
+
const label = getLabel2(
|
|
57859
|
+
columnDefinition.cellRendererParams?.getLabel,
|
|
57860
|
+
option
|
|
57861
|
+
);
|
|
57862
|
+
const optionId = getId2(
|
|
57863
|
+
columnDefinition.cellRendererParams?.getId,
|
|
57864
|
+
option
|
|
57865
|
+
);
|
|
57866
|
+
const key = `${label}_${optionId}_idx_${idx}`;
|
|
57867
|
+
return /* @__PURE__ */ React80__default.default.createElement(React80__default.default.Fragment, { key }, /* @__PURE__ */ React80__default.default.createElement("li", null, label, idx !== arr.length - 1 ? commaToken : null));
|
|
57868
|
+
}) : enablePlaceholder ? /* @__PURE__ */ React80__default.default.createElement("li", { style: { color: coreReact.colors.gray45 } }, placeholder) : null
|
|
57868
57869
|
);
|
|
57869
57870
|
};
|
|
57870
57871
|
var MultiSelectCellRenderer = withDataTableRenderer(
|
|
@@ -79924,17 +79925,17 @@ var Shape = class _Shape extends Node2 {
|
|
|
79924
79925
|
let linearGradientMatch;
|
|
79925
79926
|
if ((fill === null || fill === void 0 ? void 0 : fill.startsWith("linear-gradient")) && (linearGradientMatch = LINEAR_GRADIENT_REGEXP.exec(fill))) {
|
|
79926
79927
|
const angle = parseFloat(linearGradientMatch[1]);
|
|
79927
|
-
const
|
|
79928
|
+
const colors9 = [];
|
|
79928
79929
|
const colorsPart = linearGradientMatch[2];
|
|
79929
79930
|
const colorRegex = /(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;
|
|
79930
79931
|
let c;
|
|
79931
79932
|
while (c = colorRegex.exec(colorsPart)) {
|
|
79932
|
-
|
|
79933
|
+
colors9.push(c[0]);
|
|
79933
79934
|
}
|
|
79934
79935
|
this.gradient = new LinearGradient();
|
|
79935
79936
|
this.gradient.angle = angle;
|
|
79936
|
-
this.gradient.stops =
|
|
79937
|
-
const offset4 = index / (
|
|
79937
|
+
this.gradient.stops = colors9.map((color, index) => {
|
|
79938
|
+
const offset4 = index / (colors9.length - 1);
|
|
79938
79939
|
return { offset: offset4, color };
|
|
79939
79940
|
});
|
|
79940
79941
|
} else {
|
|
@@ -106244,6 +106245,9 @@ var en_default = {
|
|
|
106244
106245
|
selectCell: {
|
|
106245
106246
|
placeholder: "Select {{label}}"
|
|
106246
106247
|
},
|
|
106248
|
+
multiSelectCell: {
|
|
106249
|
+
placeholder: "Select Values"
|
|
106250
|
+
},
|
|
106247
106251
|
booleanCell: {
|
|
106248
106252
|
options: {
|
|
106249
106253
|
yes: "Yes",
|
|
@@ -107548,6 +107552,9 @@ var pseudo_default = {
|
|
|
107548
107552
|
selectCell: {
|
|
107549
107553
|
placeholder: "[\u015E\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 {{\u0140\u0227\u0180\u1E17\u0140}}}}}]"
|
|
107550
107554
|
},
|
|
107555
|
+
multiSelectCell: {
|
|
107556
|
+
placeholder: "[\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 \u1E7C\u0227\u0140\u016D\u1E17\u015F\u015F\u015F]"
|
|
107557
|
+
},
|
|
107551
107558
|
booleanCell: {
|
|
107552
107559
|
options: {
|
|
107553
107560
|
yes: "[\u1E8E\u1E17\u015F]",
|
|
@@ -109045,7 +109052,8 @@ var DataTable = ({
|
|
|
109045
109052
|
showExpandCollapseAllToggle,
|
|
109046
109053
|
translations: translations2 = {},
|
|
109047
109054
|
enableCellTextSelection,
|
|
109048
|
-
localStoragePersistenceKey
|
|
109055
|
+
localStoragePersistenceKey,
|
|
109056
|
+
enableCDN
|
|
109049
109057
|
}) => {
|
|
109050
109058
|
const initialTableConfig = localStoragePersistenceKey && webSdkStorage.storage.local.getItem(localStoragePersistenceKey) || _initialTableConfig;
|
|
109051
109059
|
const onServerSideDataRequestRef = React80__default.default.useRef(onServerSideDataRequest);
|
|
@@ -109057,14 +109065,29 @@ var DataTable = ({
|
|
|
109057
109065
|
);
|
|
109058
109066
|
const contextPanel = useContextPanel();
|
|
109059
109067
|
const clientI18n = coreReact.useI18nContext();
|
|
109068
|
+
const isCDNEnabled = enableCDN ?? clientI18n?.enableCDN ?? false;
|
|
109069
|
+
const cdnTranslations$1 = cdnTranslations.useRequestTranslations(
|
|
109070
|
+
{
|
|
109071
|
+
locale: clientI18n.locale,
|
|
109072
|
+
type: "file",
|
|
109073
|
+
absolute_file_path: (locale) => `core/packages/data-table/src/locales/${locale}.json`
|
|
109074
|
+
},
|
|
109075
|
+
{ en: translations.en },
|
|
109076
|
+
{
|
|
109077
|
+
translations,
|
|
109078
|
+
enableCDN: isCDNEnabled
|
|
109079
|
+
}
|
|
109080
|
+
);
|
|
109060
109081
|
const internalI18n = coreReact.useI18n({
|
|
109061
|
-
|
|
109082
|
+
locale: clientI18n.locale,
|
|
109062
109083
|
translations: ramda.mergeDeepLeft(
|
|
109063
109084
|
ramda.mergeDeepLeft(clientI18n.translations, {
|
|
109064
109085
|
[clientI18n.locale]: translations2
|
|
109065
109086
|
}),
|
|
109066
|
-
translations
|
|
109067
|
-
)
|
|
109087
|
+
cdnTranslations$1.translations
|
|
109088
|
+
),
|
|
109089
|
+
requestedTranslations: cdnTranslations$1,
|
|
109090
|
+
enableCDN: isCDNEnabled
|
|
109068
109091
|
});
|
|
109069
109092
|
const rowSelectionRef = React80__default.default.useRef({
|
|
109070
109093
|
affectedRows: {},
|
|
@@ -112218,7 +112241,8 @@ var ClientSideDataTable = ({
|
|
|
112218
112241
|
onTableConfigChange,
|
|
112219
112242
|
translations: translations2 = {},
|
|
112220
112243
|
enableCellTextSelection,
|
|
112221
|
-
localStoragePersistenceKey
|
|
112244
|
+
localStoragePersistenceKey,
|
|
112245
|
+
enableCDN
|
|
112222
112246
|
}) => {
|
|
112223
112247
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
112224
112248
|
DataTable,
|
|
@@ -112236,7 +112260,8 @@ var ClientSideDataTable = ({
|
|
|
112236
112260
|
translations: translations2,
|
|
112237
112261
|
localStoragePersistenceKey,
|
|
112238
112262
|
customBulkEditorFields,
|
|
112239
|
-
enableCellTextSelection
|
|
112263
|
+
enableCellTextSelection,
|
|
112264
|
+
enableCDN
|
|
112240
112265
|
},
|
|
112241
112266
|
children
|
|
112242
112267
|
);
|
|
@@ -116696,7 +116721,8 @@ var ServerSideDataTable = ({
|
|
|
116696
116721
|
enableCellTextSelection,
|
|
116697
116722
|
showExpandCollapseAllToggle,
|
|
116698
116723
|
translations: translations2 = {},
|
|
116699
|
-
localStoragePersistenceKey
|
|
116724
|
+
localStoragePersistenceKey,
|
|
116725
|
+
enableCDN
|
|
116700
116726
|
}) => {
|
|
116701
116727
|
return /* @__PURE__ */ React80__default.default.createElement(
|
|
116702
116728
|
DataTable,
|
|
@@ -116715,7 +116741,8 @@ var ServerSideDataTable = ({
|
|
|
116715
116741
|
translations: translations2,
|
|
116716
116742
|
customBulkEditorFields,
|
|
116717
116743
|
enableCellTextSelection,
|
|
116718
|
-
localStoragePersistenceKey
|
|
116744
|
+
localStoragePersistenceKey,
|
|
116745
|
+
enableCDN
|
|
116719
116746
|
},
|
|
116720
116747
|
children
|
|
116721
116748
|
);
|
package/dist/modern/index.d.cts
CHANGED
|
@@ -316,6 +316,8 @@ interface MultiSelectCellRendererParams<TValue, OptionValue> {
|
|
|
316
316
|
getLabel?: (cellValue: OptionValue) => string;
|
|
317
317
|
getValue?: (cellValue: TValue) => OptionValue[];
|
|
318
318
|
typographyProps?: TypographyProps;
|
|
319
|
+
placeholder?: string;
|
|
320
|
+
enablePlaceholder?: boolean;
|
|
319
321
|
}
|
|
320
322
|
type OnSearchParams$1 = {
|
|
321
323
|
data: MultiSelectCellEditorProps['data'];
|
|
@@ -1146,6 +1148,7 @@ interface DataTableProps {
|
|
|
1146
1148
|
showExpandCollapseAllToggle?: boolean;
|
|
1147
1149
|
translations?: DataTableTranslations;
|
|
1148
1150
|
enableCellTextSelection?: boolean;
|
|
1151
|
+
enableCDN?: boolean;
|
|
1149
1152
|
}
|
|
1150
1153
|
interface ClientSideDataTableProps extends Omit<DataTableProps, 'onServerSideDataRequest' | 'showExpandCollapseAllToggle'> {
|
|
1151
1154
|
}
|
|
@@ -1435,7 +1438,7 @@ interface BulkActionProps {
|
|
|
1435
1438
|
style?: React__default.CSSProperties;
|
|
1436
1439
|
}
|
|
1437
1440
|
|
|
1438
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1441
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1439
1442
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1440
1443
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1441
1444
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1472,7 +1475,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1472
1475
|
|
|
1473
1476
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1474
1477
|
|
|
1475
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1478
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1476
1479
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1477
1480
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1478
1481
|
ConfigPanelButton: React__default.FC<{}>;
|
package/dist/modern/index.d.ts
CHANGED
|
@@ -316,6 +316,8 @@ interface MultiSelectCellRendererParams<TValue, OptionValue> {
|
|
|
316
316
|
getLabel?: (cellValue: OptionValue) => string;
|
|
317
317
|
getValue?: (cellValue: TValue) => OptionValue[];
|
|
318
318
|
typographyProps?: TypographyProps;
|
|
319
|
+
placeholder?: string;
|
|
320
|
+
enablePlaceholder?: boolean;
|
|
319
321
|
}
|
|
320
322
|
type OnSearchParams$1 = {
|
|
321
323
|
data: MultiSelectCellEditorProps['data'];
|
|
@@ -1146,6 +1148,7 @@ interface DataTableProps {
|
|
|
1146
1148
|
showExpandCollapseAllToggle?: boolean;
|
|
1147
1149
|
translations?: DataTableTranslations;
|
|
1148
1150
|
enableCellTextSelection?: boolean;
|
|
1151
|
+
enableCDN?: boolean;
|
|
1149
1152
|
}
|
|
1150
1153
|
interface ClientSideDataTableProps extends Omit<DataTableProps, 'onServerSideDataRequest' | 'showExpandCollapseAllToggle'> {
|
|
1151
1154
|
}
|
|
@@ -1435,7 +1438,7 @@ interface BulkActionProps {
|
|
|
1435
1438
|
style?: React__default.CSSProperties;
|
|
1436
1439
|
}
|
|
1437
1440
|
|
|
1438
|
-
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1441
|
+
declare const _default$1: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onTableConfigChange, translations, enableCellTextSelection, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<ClientSideDataTableProps>) => React__default.JSX.Element) & {
|
|
1439
1442
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1440
1443
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1441
1444
|
ConfigPanelButton: React__default.FC<{}>;
|
|
@@ -1472,7 +1475,7 @@ declare const MultiSelectQuickFilterRenderer: (props: FilterProps<any[]>) => Rea
|
|
|
1472
1475
|
|
|
1473
1476
|
declare const SingleSelectQuickFilterRenderer: (props: FilterProps<any[]>) => React__default.JSX.Element;
|
|
1474
1477
|
|
|
1475
|
-
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1478
|
+
declare const _default: (({ analytics, children, columnDefinitions: _columnDefinitions, customBulkEditorFields, enableDynamicRowHeight, enableGroupEditAndValidation, filterGroups, getRowId, initialTableConfig: _initialTableConfig, onBulkEditUpdate, onServerSideDataRequest, onTableConfigChange, enableCellTextSelection, showExpandCollapseAllToggle, translations, localStoragePersistenceKey, enableCDN, }: React__default.PropsWithChildren<DataTableProps>) => React__default.JSX.Element) & {
|
|
1476
1479
|
BulkActions: React__default.FunctionComponent<React__default.PropsWithChildren<BulkActionProps>>;
|
|
1477
1480
|
BulkEditActionButton: React__default.FunctionComponent<ActionButtonProps>;
|
|
1478
1481
|
ConfigPanelButton: React__default.FC<{}>;
|
package/dist/modern/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { formatNumber, formatCurrency, formatPercentage } from '@procore/labs-fi
|
|
|
10
10
|
import styled4, { css as css$1 } from 'styled-components';
|
|
11
11
|
import { format } from '@procore/labs-financials-utils/dist/format';
|
|
12
12
|
import { detectPrng, factory } from 'ulid';
|
|
13
|
+
import { useRequestTranslations } from '@procore/cdn-translations';
|
|
13
14
|
import { useToastAlertContext, ToastAlertProvider } from '@procore/toast-alert';
|
|
14
15
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
15
16
|
import { renderToString, renderToStaticMarkup } from 'react-dom/server';
|
|
@@ -57812,6 +57813,7 @@ function getId2(func, option) {
|
|
|
57812
57813
|
return func?.(option) ?? option?.id ?? option;
|
|
57813
57814
|
}
|
|
57814
57815
|
var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) => {
|
|
57816
|
+
const I18n = useI18nContext();
|
|
57815
57817
|
const ref = React80.useRef();
|
|
57816
57818
|
React80.useLayoutEffect(() => {
|
|
57817
57819
|
ref?.current?.setAttribute("title", ref?.current?.innerText);
|
|
@@ -57819,6 +57821,13 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57819
57821
|
if (value === void 0 || value === null) {
|
|
57820
57822
|
return null;
|
|
57821
57823
|
}
|
|
57824
|
+
const options = getValue(
|
|
57825
|
+
columnDefinition.cellRendererParams?.getValue,
|
|
57826
|
+
value,
|
|
57827
|
+
emptyArray
|
|
57828
|
+
);
|
|
57829
|
+
const enablePlaceholder = (columnDefinition.cellRendererParams?.enablePlaceholder && columnDefinition.editable) ?? false;
|
|
57830
|
+
const placeholder = columnDefinition.cellRendererParams?.placeholder ?? I18n.t("dataTable.cells.multiSelectCell.placeholder");
|
|
57822
57831
|
return /* @__PURE__ */ React80.createElement(
|
|
57823
57832
|
Typography,
|
|
57824
57833
|
{
|
|
@@ -57832,26 +57841,18 @@ var InternalMultiSelectCellRenderer = ({ columnDefinition, rowHeight, value }) =
|
|
|
57832
57841
|
}),
|
|
57833
57842
|
ref
|
|
57834
57843
|
},
|
|
57835
|
-
|
|
57836
|
-
|
|
57837
|
-
|
|
57838
|
-
|
|
57839
|
-
|
|
57840
|
-
|
|
57841
|
-
|
|
57842
|
-
|
|
57843
|
-
|
|
57844
|
-
|
|
57845
|
-
|
|
57846
|
-
|
|
57847
|
-
)}_${getId2(
|
|
57848
|
-
columnDefinition.cellRendererParams?.getId,
|
|
57849
|
-
option
|
|
57850
|
-
)}_idx_${idx}`
|
|
57851
|
-
)
|
|
57852
|
-
},
|
|
57853
|
-
/* @__PURE__ */ React80.createElement("li", null, getLabel2(columnDefinition.cellRendererParams?.getLabel, option), idx !== arr.length - 1 ? commaToken : null)
|
|
57854
|
-
))
|
|
57844
|
+
options.length ? options.map((option, idx, arr) => {
|
|
57845
|
+
const label = getLabel2(
|
|
57846
|
+
columnDefinition.cellRendererParams?.getLabel,
|
|
57847
|
+
option
|
|
57848
|
+
);
|
|
57849
|
+
const optionId = getId2(
|
|
57850
|
+
columnDefinition.cellRendererParams?.getId,
|
|
57851
|
+
option
|
|
57852
|
+
);
|
|
57853
|
+
const key = `${label}_${optionId}_idx_${idx}`;
|
|
57854
|
+
return /* @__PURE__ */ React80.createElement(React80.Fragment, { key }, /* @__PURE__ */ React80.createElement("li", null, label, idx !== arr.length - 1 ? commaToken : null));
|
|
57855
|
+
}) : enablePlaceholder ? /* @__PURE__ */ React80.createElement("li", { style: { color: colors.gray45 } }, placeholder) : null
|
|
57855
57856
|
);
|
|
57856
57857
|
};
|
|
57857
57858
|
var MultiSelectCellRenderer = withDataTableRenderer(
|
|
@@ -79911,17 +79912,17 @@ var Shape = class _Shape extends Node2 {
|
|
|
79911
79912
|
let linearGradientMatch;
|
|
79912
79913
|
if ((fill === null || fill === void 0 ? void 0 : fill.startsWith("linear-gradient")) && (linearGradientMatch = LINEAR_GRADIENT_REGEXP.exec(fill))) {
|
|
79913
79914
|
const angle = parseFloat(linearGradientMatch[1]);
|
|
79914
|
-
const
|
|
79915
|
+
const colors9 = [];
|
|
79915
79916
|
const colorsPart = linearGradientMatch[2];
|
|
79916
79917
|
const colorRegex = /(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;
|
|
79917
79918
|
let c;
|
|
79918
79919
|
while (c = colorRegex.exec(colorsPart)) {
|
|
79919
|
-
|
|
79920
|
+
colors9.push(c[0]);
|
|
79920
79921
|
}
|
|
79921
79922
|
this.gradient = new LinearGradient();
|
|
79922
79923
|
this.gradient.angle = angle;
|
|
79923
|
-
this.gradient.stops =
|
|
79924
|
-
const offset4 = index / (
|
|
79924
|
+
this.gradient.stops = colors9.map((color, index) => {
|
|
79925
|
+
const offset4 = index / (colors9.length - 1);
|
|
79925
79926
|
return { offset: offset4, color };
|
|
79926
79927
|
});
|
|
79927
79928
|
} else {
|
|
@@ -106231,6 +106232,9 @@ var en_default = {
|
|
|
106231
106232
|
selectCell: {
|
|
106232
106233
|
placeholder: "Select {{label}}"
|
|
106233
106234
|
},
|
|
106235
|
+
multiSelectCell: {
|
|
106236
|
+
placeholder: "Select Values"
|
|
106237
|
+
},
|
|
106234
106238
|
booleanCell: {
|
|
106235
106239
|
options: {
|
|
106236
106240
|
yes: "Yes",
|
|
@@ -107535,6 +107539,9 @@ var pseudo_default = {
|
|
|
107535
107539
|
selectCell: {
|
|
107536
107540
|
placeholder: "[\u015E\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 {{\u0140\u0227\u0180\u1E17\u0140}}}}}]"
|
|
107537
107541
|
},
|
|
107542
|
+
multiSelectCell: {
|
|
107543
|
+
placeholder: "[\u015E\u015E\u015E\u1E17\u0140\u1E17\u0188\u0167 \xB7 \u1E7C\u0227\u0140\u016D\u1E17\u015F\u015F\u015F]"
|
|
107544
|
+
},
|
|
107538
107545
|
booleanCell: {
|
|
107539
107546
|
options: {
|
|
107540
107547
|
yes: "[\u1E8E\u1E17\u015F]",
|
|
@@ -109032,7 +109039,8 @@ var DataTable = ({
|
|
|
109032
109039
|
showExpandCollapseAllToggle,
|
|
109033
109040
|
translations: translations2 = {},
|
|
109034
109041
|
enableCellTextSelection,
|
|
109035
|
-
localStoragePersistenceKey
|
|
109042
|
+
localStoragePersistenceKey,
|
|
109043
|
+
enableCDN
|
|
109036
109044
|
}) => {
|
|
109037
109045
|
const initialTableConfig = localStoragePersistenceKey && storage.local.getItem(localStoragePersistenceKey) || _initialTableConfig;
|
|
109038
109046
|
const onServerSideDataRequestRef = React80.useRef(onServerSideDataRequest);
|
|
@@ -109044,14 +109052,29 @@ var DataTable = ({
|
|
|
109044
109052
|
);
|
|
109045
109053
|
const contextPanel = useContextPanel();
|
|
109046
109054
|
const clientI18n = useI18nContext();
|
|
109055
|
+
const isCDNEnabled = enableCDN ?? clientI18n?.enableCDN ?? false;
|
|
109056
|
+
const cdnTranslations = useRequestTranslations(
|
|
109057
|
+
{
|
|
109058
|
+
locale: clientI18n.locale,
|
|
109059
|
+
type: "file",
|
|
109060
|
+
absolute_file_path: (locale) => `core/packages/data-table/src/locales/${locale}.json`
|
|
109061
|
+
},
|
|
109062
|
+
{ en: translations.en },
|
|
109063
|
+
{
|
|
109064
|
+
translations,
|
|
109065
|
+
enableCDN: isCDNEnabled
|
|
109066
|
+
}
|
|
109067
|
+
);
|
|
109047
109068
|
const internalI18n = useI18n({
|
|
109048
|
-
|
|
109069
|
+
locale: clientI18n.locale,
|
|
109049
109070
|
translations: mergeDeepLeft(
|
|
109050
109071
|
mergeDeepLeft(clientI18n.translations, {
|
|
109051
109072
|
[clientI18n.locale]: translations2
|
|
109052
109073
|
}),
|
|
109053
|
-
translations
|
|
109054
|
-
)
|
|
109074
|
+
cdnTranslations.translations
|
|
109075
|
+
),
|
|
109076
|
+
requestedTranslations: cdnTranslations,
|
|
109077
|
+
enableCDN: isCDNEnabled
|
|
109055
109078
|
});
|
|
109056
109079
|
const rowSelectionRef = React80.useRef({
|
|
109057
109080
|
affectedRows: {},
|
|
@@ -112205,7 +112228,8 @@ var ClientSideDataTable = ({
|
|
|
112205
112228
|
onTableConfigChange,
|
|
112206
112229
|
translations: translations2 = {},
|
|
112207
112230
|
enableCellTextSelection,
|
|
112208
|
-
localStoragePersistenceKey
|
|
112231
|
+
localStoragePersistenceKey,
|
|
112232
|
+
enableCDN
|
|
112209
112233
|
}) => {
|
|
112210
112234
|
return /* @__PURE__ */ React80.createElement(
|
|
112211
112235
|
DataTable,
|
|
@@ -112223,7 +112247,8 @@ var ClientSideDataTable = ({
|
|
|
112223
112247
|
translations: translations2,
|
|
112224
112248
|
localStoragePersistenceKey,
|
|
112225
112249
|
customBulkEditorFields,
|
|
112226
|
-
enableCellTextSelection
|
|
112250
|
+
enableCellTextSelection,
|
|
112251
|
+
enableCDN
|
|
112227
112252
|
},
|
|
112228
112253
|
children
|
|
112229
112254
|
);
|
|
@@ -116683,7 +116708,8 @@ var ServerSideDataTable = ({
|
|
|
116683
116708
|
enableCellTextSelection,
|
|
116684
116709
|
showExpandCollapseAllToggle,
|
|
116685
116710
|
translations: translations2 = {},
|
|
116686
|
-
localStoragePersistenceKey
|
|
116711
|
+
localStoragePersistenceKey,
|
|
116712
|
+
enableCDN
|
|
116687
116713
|
}) => {
|
|
116688
116714
|
return /* @__PURE__ */ React80.createElement(
|
|
116689
116715
|
DataTable,
|
|
@@ -116702,7 +116728,8 @@ var ServerSideDataTable = ({
|
|
|
116702
116728
|
translations: translations2,
|
|
116703
116729
|
customBulkEditorFields,
|
|
116704
116730
|
enableCellTextSelection,
|
|
116705
|
-
localStoragePersistenceKey
|
|
116731
|
+
localStoragePersistenceKey,
|
|
116732
|
+
enableCDN
|
|
116706
116733
|
},
|
|
116707
116734
|
children
|
|
116708
116735
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procore/data-table",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.28.0-cdn.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",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"styled-components": ">= 5.1.1 < 6"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
+
"@procore/cdn-translations": "0.0.5",
|
|
82
83
|
"@procore/error-pages": "0.2.1",
|
|
83
84
|
"@procore/labs-datetime-select": "0.1.1",
|
|
84
85
|
"@procore/labs-group-by-select": "4.0.0",
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
"@procore/core-css": "10.17.0",
|
|
114
115
|
"@procore/core-icons": "12.6.0",
|
|
115
116
|
"@procore/core-prettier": "10.2.0",
|
|
116
|
-
"@procore/core-react": "12.
|
|
117
|
+
"@procore/core-react": "12.21.0-cdn.0",
|
|
117
118
|
"@procore/eslint-config": "10.0.0",
|
|
118
119
|
"@procore/globalization-toolkit": "3.1.0",
|
|
119
120
|
"@procore/labs-financials-utils": "4.3.1",
|