@procore/saved-views 1.1.0-alpha.3 → 1.1.0-alpha.5
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/dist/legacy/index.js +295 -195
- package/dist/legacy/index.mjs +322 -223
- package/dist/modern/index.js +294 -195
- package/dist/modern/index.mjs +321 -223
- package/package.json +3 -2
package/dist/legacy/index.js
CHANGED
|
@@ -109,7 +109,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
109
109
|
var E2 = n2;
|
|
110
110
|
var F2 = c2;
|
|
111
111
|
var G2 = f2;
|
|
112
|
-
var
|
|
112
|
+
var H2 = e2;
|
|
113
113
|
var I = l2;
|
|
114
114
|
exports.ContextConsumer = h;
|
|
115
115
|
exports.ContextProvider = z2;
|
|
@@ -120,7 +120,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
120
120
|
exports.Memo = E2;
|
|
121
121
|
exports.Portal = F2;
|
|
122
122
|
exports.Profiler = G2;
|
|
123
|
-
exports.StrictMode =
|
|
123
|
+
exports.StrictMode = H2;
|
|
124
124
|
exports.Suspense = I;
|
|
125
125
|
exports.isAsyncMode = function() {
|
|
126
126
|
return false;
|
|
@@ -7881,7 +7881,7 @@ function __rest(s2, e2) {
|
|
|
7881
7881
|
return t2;
|
|
7882
7882
|
}
|
|
7883
7883
|
|
|
7884
|
-
//
|
|
7884
|
+
// node_modules/@procore/core-icons/dist/Icon.js
|
|
7885
7885
|
var React = __toESM(require("react"));
|
|
7886
7886
|
function getSize(size) {
|
|
7887
7887
|
if (size === "sm") {
|
|
@@ -7900,7 +7900,7 @@ function Icon(_a) {
|
|
|
7900
7900
|
return React.isValidElement(children) ? React.cloneElement(children, __assign(__assign({ "aria-hidden": true, "data-qa": "ci-".concat(props.name) }, props), { width: getSize(props.size), height: getSize(props.size), focusable: false, style: __assign(__assign({}, props.style), { flex: "0 0 auto" }) })) : null;
|
|
7901
7901
|
}
|
|
7902
7902
|
|
|
7903
|
-
//
|
|
7903
|
+
// node_modules/@procore/core-icons/dist/icons/Building.js
|
|
7904
7904
|
var React2 = __toESM(require("react"));
|
|
7905
7905
|
var Building = React2.forwardRef(function Building2(props, ref) {
|
|
7906
7906
|
return React2.createElement(
|
|
@@ -7916,7 +7916,7 @@ var Building = React2.forwardRef(function Building2(props, ref) {
|
|
|
7916
7916
|
Building.displayName = "Building";
|
|
7917
7917
|
var Building_default = Building;
|
|
7918
7918
|
|
|
7919
|
-
//
|
|
7919
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronDown.js
|
|
7920
7920
|
var React3 = __toESM(require("react"));
|
|
7921
7921
|
var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
7922
7922
|
return React3.createElement(
|
|
@@ -7932,7 +7932,7 @@ var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
|
7932
7932
|
ChevronDown.displayName = "ChevronDown";
|
|
7933
7933
|
var ChevronDown_default = ChevronDown;
|
|
7934
7934
|
|
|
7935
|
-
//
|
|
7935
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronRight.js
|
|
7936
7936
|
var React4 = __toESM(require("react"));
|
|
7937
7937
|
var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
7938
7938
|
return React4.createElement(
|
|
@@ -7948,7 +7948,7 @@ var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
|
7948
7948
|
ChevronRight.displayName = "ChevronRight";
|
|
7949
7949
|
var ChevronRight_default = ChevronRight;
|
|
7950
7950
|
|
|
7951
|
-
//
|
|
7951
|
+
// node_modules/@procore/core-icons/dist/icons/Clear.js
|
|
7952
7952
|
var React5 = __toESM(require("react"));
|
|
7953
7953
|
var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
7954
7954
|
return React5.createElement(
|
|
@@ -7964,7 +7964,7 @@ var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
|
7964
7964
|
Clear.displayName = "Clear";
|
|
7965
7965
|
var Clear_default = Clear;
|
|
7966
7966
|
|
|
7967
|
-
//
|
|
7967
|
+
// node_modules/@procore/core-icons/dist/icons/Excavator.js
|
|
7968
7968
|
var React6 = __toESM(require("react"));
|
|
7969
7969
|
var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
7970
7970
|
return React6.createElement(
|
|
@@ -7981,7 +7981,7 @@ var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
|
7981
7981
|
Excavator.displayName = "Excavator";
|
|
7982
7982
|
var Excavator_default = Excavator;
|
|
7983
7983
|
|
|
7984
|
-
//
|
|
7984
|
+
// node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
|
|
7985
7985
|
var React7 = __toESM(require("react"));
|
|
7986
7986
|
var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
7987
7987
|
return React7.createElement(
|
|
@@ -7999,7 +7999,7 @@ var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
|
7999
7999
|
ExpandSidebar.displayName = "ExpandSidebar";
|
|
8000
8000
|
var ExpandSidebar_default = ExpandSidebar;
|
|
8001
8001
|
|
|
8002
|
-
//
|
|
8002
|
+
// node_modules/@procore/core-icons/dist/icons/Help.js
|
|
8003
8003
|
var React8 = __toESM(require("react"));
|
|
8004
8004
|
var Help = React8.forwardRef(function Help2(props, ref) {
|
|
8005
8005
|
return React8.createElement(
|
|
@@ -8015,7 +8015,7 @@ var Help = React8.forwardRef(function Help2(props, ref) {
|
|
|
8015
8015
|
Help.displayName = "Help";
|
|
8016
8016
|
var Help_default = Help;
|
|
8017
8017
|
|
|
8018
|
-
//
|
|
8018
|
+
// node_modules/@procore/core-icons/dist/icons/Link.js
|
|
8019
8019
|
var React9 = __toESM(require("react"));
|
|
8020
8020
|
var Link = React9.forwardRef(function Link2(props, ref) {
|
|
8021
8021
|
return React9.createElement(
|
|
@@ -8032,7 +8032,7 @@ var Link = React9.forwardRef(function Link2(props, ref) {
|
|
|
8032
8032
|
Link.displayName = "Link";
|
|
8033
8033
|
var Link_default = Link;
|
|
8034
8034
|
|
|
8035
|
-
//
|
|
8035
|
+
// node_modules/@procore/core-icons/dist/icons/Person.js
|
|
8036
8036
|
var React10 = __toESM(require("react"));
|
|
8037
8037
|
var Person = React10.forwardRef(function Person2(props, ref) {
|
|
8038
8038
|
return React10.createElement(
|
|
@@ -8048,7 +8048,7 @@ var Person = React10.forwardRef(function Person2(props, ref) {
|
|
|
8048
8048
|
Person.displayName = "Person";
|
|
8049
8049
|
var Person_default = Person;
|
|
8050
8050
|
|
|
8051
|
-
//
|
|
8051
|
+
// node_modules/@procore/core-icons/dist/icons/Plus.js
|
|
8052
8052
|
var React11 = __toESM(require("react"));
|
|
8053
8053
|
var Plus = React11.forwardRef(function Plus2(props, ref) {
|
|
8054
8054
|
return React11.createElement(
|
|
@@ -8161,7 +8161,7 @@ function stylis_min(W2) {
|
|
|
8161
8161
|
}
|
|
8162
8162
|
k2 = M2(c2, r2, k2, g2, a2 + 1);
|
|
8163
8163
|
t2 = k2.length;
|
|
8164
|
-
0 < A2 && (r2 = X2(O2, f2, I), C2 =
|
|
8164
|
+
0 < A2 && (r2 = X2(O2, f2, I), C2 = H2(3, k2, r2, c2, D2, z2, t2, g2, a2, h), f2 = r2.join(""), void 0 !== C2 && 0 === (t2 = (k2 = C2.trim()).length) && (g2 = 0, k2 = ""));
|
|
8165
8165
|
if (0 < t2)
|
|
8166
8166
|
switch (g2) {
|
|
8167
8167
|
case 115:
|
|
@@ -8194,7 +8194,7 @@ function stylis_min(W2) {
|
|
|
8194
8194
|
case 59:
|
|
8195
8195
|
f2 = (0 < r2 ? f2.replace(N, "") : f2).trim();
|
|
8196
8196
|
if (1 < (t2 = f2.length))
|
|
8197
|
-
switch (0 === u2 && (q2 = f2.charCodeAt(0), 45 === q2 || 96 < q2 && 123 > q2) && (t2 = (f2 = f2.replace(" ", ":")).length), 0 < A2 && void 0 !== (C2 =
|
|
8197
|
+
switch (0 === u2 && (q2 = f2.charCodeAt(0), 45 === q2 || 96 < q2 && 123 > q2) && (t2 = (f2 = f2.replace(" ", ":")).length), 0 < A2 && void 0 !== (C2 = H2(1, f2, c2, d, D2, z2, p.length, h, a2, h)) && 0 === (t2 = (f2 = C2.trim()).length) && (f2 = "\0\0"), q2 = f2.charCodeAt(0), g2 = f2.charCodeAt(1), q2) {
|
|
8198
8198
|
case 0:
|
|
8199
8199
|
break;
|
|
8200
8200
|
case 64:
|
|
@@ -8214,7 +8214,7 @@ function stylis_min(W2) {
|
|
|
8214
8214
|
case 13:
|
|
8215
8215
|
case 10:
|
|
8216
8216
|
47 === b2 ? b2 = 0 : 0 === 1 + q2 && 107 !== h && 0 < f2.length && (r2 = 1, f2 += "\0");
|
|
8217
|
-
0 < A2 * Y2 &&
|
|
8217
|
+
0 < A2 * Y2 && H2(0, f2, c2, d, D2, z2, p.length, h, a2, h);
|
|
8218
8218
|
z2 = 1;
|
|
8219
8219
|
D2++;
|
|
8220
8220
|
break;
|
|
@@ -8323,7 +8323,7 @@ function stylis_min(W2) {
|
|
|
8323
8323
|
t2 = p.length;
|
|
8324
8324
|
if (0 < t2) {
|
|
8325
8325
|
r2 = c2;
|
|
8326
|
-
if (0 < A2 && (C2 =
|
|
8326
|
+
if (0 < A2 && (C2 = H2(2, p, r2, d, D2, z2, t2, h, a2, h), void 0 !== C2 && 0 === (p = C2).length))
|
|
8327
8327
|
return G3 + p + F3;
|
|
8328
8328
|
p = r2.join(",") + "{" + p + "}";
|
|
8329
8329
|
if (0 !== w2 * E2) {
|
|
@@ -8500,7 +8500,7 @@ function stylis_min(W2) {
|
|
|
8500
8500
|
var e2 = P4(c2, c2.charCodeAt(0), c2.charCodeAt(1), c2.charCodeAt(2));
|
|
8501
8501
|
return e2 !== c2 + ";" ? e2.replace(oa, " or ($1)").substring(4) : "(" + c2 + ")";
|
|
8502
8502
|
}
|
|
8503
|
-
function
|
|
8503
|
+
function H2(d, c2, e2, h, a2, m2, b2, v2, n2, q2) {
|
|
8504
8504
|
for (var g2 = 0, x2 = c2, w3; g2 < A2; ++g2) {
|
|
8505
8505
|
switch (w3 = S2[g2].call(B2, d, x2, e2, h, a2, m2, b2, v2, n2, q2)) {
|
|
8506
8506
|
case void 0:
|
|
@@ -8544,11 +8544,11 @@ function stylis_min(W2) {
|
|
|
8544
8544
|
V2 = e2;
|
|
8545
8545
|
e2 = [V2];
|
|
8546
8546
|
if (0 < A2) {
|
|
8547
|
-
var h =
|
|
8547
|
+
var h = H2(-1, c2, e2, e2, D2, z2, 0, 0, 0, 0);
|
|
8548
8548
|
void 0 !== h && "string" === typeof h && (c2 = h);
|
|
8549
8549
|
}
|
|
8550
8550
|
var a2 = M2(O2, e2, c2, 0, 0);
|
|
8551
|
-
0 < A2 && (h =
|
|
8551
|
+
0 < A2 && (h = H2(-2, a2, e2, e2, D2, z2, a2.length, 0, 0, 0), void 0 !== h && (a2 = h));
|
|
8552
8552
|
V2 = "";
|
|
8553
8553
|
E2 = 0;
|
|
8554
8554
|
z2 = D2 = 1;
|
|
@@ -9356,8 +9356,8 @@ var useSavedViewsPanel = (domain, tableName) => {
|
|
|
9356
9356
|
setIsOpen(!isOpen);
|
|
9357
9357
|
localStorage.setItem(key(domain, tableName), JSON.stringify(!isOpen));
|
|
9358
9358
|
};
|
|
9359
|
-
const
|
|
9360
|
-
return { isOpen, SavedViewsButton:
|
|
9359
|
+
const Button8 = () => /* @__PURE__ */ import_react5.default.createElement(SavedViewsButton, { handleClick, isOpen });
|
|
9360
|
+
return { isOpen, SavedViewsButton: Button8 };
|
|
9361
9361
|
};
|
|
9362
9362
|
var useSavedViewsPanel_default = useSavedViewsPanel;
|
|
9363
9363
|
|
|
@@ -9433,6 +9433,17 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9433
9433
|
label: i18n.t("savedViews.actions.delete")
|
|
9434
9434
|
}
|
|
9435
9435
|
];
|
|
9436
|
+
const preventEventBubbleToNotTriggerViewSelectEvent = React15.useCallback(
|
|
9437
|
+
(e2) => {
|
|
9438
|
+
e2.stopPropagation();
|
|
9439
|
+
},
|
|
9440
|
+
[]
|
|
9441
|
+
);
|
|
9442
|
+
const hasUpdateButton = props.item.view_level !== "default" && props.canUpdate;
|
|
9443
|
+
const hasCopyShareLinkButton = props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9444
|
+
const hasClearTemporaryButton = props.item.id === "temporary";
|
|
9445
|
+
const hasOverflowMenu = props.item.view_level !== "default" && props.canEditOrDelete;
|
|
9446
|
+
const hasActions = hasUpdateButton || hasCopyShareLinkButton || hasClearTemporaryButton || hasOverflowMenu;
|
|
9436
9447
|
return /* @__PURE__ */ React15.createElement(
|
|
9437
9448
|
Container2,
|
|
9438
9449
|
{
|
|
@@ -9442,7 +9453,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9442
9453
|
"aria-label": i18n.t("savedViews.ariaLabels.menuItem", {
|
|
9443
9454
|
name: props.item.name
|
|
9444
9455
|
}),
|
|
9445
|
-
"data-testid": "saved-view-collection-menu-item"
|
|
9456
|
+
"data-testid": "saved-view-collection-menu-item",
|
|
9457
|
+
onKeyDown: preventEventBubbleToNotTriggerViewSelectEvent
|
|
9446
9458
|
},
|
|
9447
9459
|
/* @__PURE__ */ React15.createElement(
|
|
9448
9460
|
"span",
|
|
@@ -9452,7 +9464,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9452
9464
|
},
|
|
9453
9465
|
props.item.name
|
|
9454
9466
|
),
|
|
9455
|
-
/* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" },
|
|
9467
|
+
hasActions && /* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" }, hasUpdateButton && /* @__PURE__ */ React15.createElement(
|
|
9456
9468
|
import_core_react3.Button,
|
|
9457
9469
|
{
|
|
9458
9470
|
onClick: updateItem,
|
|
@@ -9463,7 +9475,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9463
9475
|
loading: props.isUpdateProcessing
|
|
9464
9476
|
},
|
|
9465
9477
|
i18n.t("savedViews.actions.update")
|
|
9466
|
-
)
|
|
9478
|
+
), hasCopyShareLinkButton && /* @__PURE__ */ React15.createElement(
|
|
9467
9479
|
import_core_react3.Button,
|
|
9468
9480
|
{
|
|
9469
9481
|
onClick: copyShareLink,
|
|
@@ -9473,7 +9485,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9473
9485
|
"data-testid": "copy-share-link-button"
|
|
9474
9486
|
},
|
|
9475
9487
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Link_default, { size: "sm" }))
|
|
9476
|
-
)
|
|
9488
|
+
), hasClearTemporaryButton && /* @__PURE__ */ React15.createElement(
|
|
9477
9489
|
import_core_react3.Button,
|
|
9478
9490
|
{
|
|
9479
9491
|
onClick: (e2) => {
|
|
@@ -9488,7 +9500,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9488
9500
|
"data-testid": "clear-temporary-view-button"
|
|
9489
9501
|
},
|
|
9490
9502
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" }))
|
|
9491
|
-
))
|
|
9503
|
+
)), /* @__PURE__ */ React15.createElement(import_core_react3.Box, null, hasOverflowMenu && /* @__PURE__ */ React15.createElement(
|
|
9492
9504
|
import_core_react3.DropdownFlyout,
|
|
9493
9505
|
{
|
|
9494
9506
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -9499,7 +9511,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9499
9511
|
variant: "tertiary",
|
|
9500
9512
|
disabled: props.isUpdateProcessing
|
|
9501
9513
|
}
|
|
9502
|
-
)))
|
|
9514
|
+
)))
|
|
9503
9515
|
);
|
|
9504
9516
|
};
|
|
9505
9517
|
|
|
@@ -9779,18 +9791,40 @@ var getOrderedVisibleColumns = (columns, idKey) => {
|
|
|
9779
9791
|
});
|
|
9780
9792
|
return [leftAction, ...middleColumns, rightAction].filter(Boolean);
|
|
9781
9793
|
};
|
|
9794
|
+
var SMART_GRID_COLUMN_COMPARE_KEYS = [
|
|
9795
|
+
"colId",
|
|
9796
|
+
"hide",
|
|
9797
|
+
"width",
|
|
9798
|
+
"sort",
|
|
9799
|
+
"sortIndex",
|
|
9800
|
+
"pinned",
|
|
9801
|
+
"rowGroup",
|
|
9802
|
+
"rowGroupIndex",
|
|
9803
|
+
"pivot",
|
|
9804
|
+
"pivotIndex"
|
|
9805
|
+
];
|
|
9806
|
+
var DATA_TABLE_COLUMN_COMPARE_KEYS = [
|
|
9807
|
+
"field",
|
|
9808
|
+
"hidden",
|
|
9809
|
+
"width",
|
|
9810
|
+
"sort",
|
|
9811
|
+
"sortIndex",
|
|
9812
|
+
"pinned",
|
|
9813
|
+
"rowGroup",
|
|
9814
|
+
"rowGroupIndex"
|
|
9815
|
+
];
|
|
9782
9816
|
var cleanObject = (table_config, provider) => {
|
|
9783
9817
|
if (provider === "smart-grid") {
|
|
9784
9818
|
const smartGridConfig = table_config;
|
|
9785
|
-
if (!smartGridConfig.filterState)
|
|
9786
|
-
return table_config;
|
|
9787
9819
|
const orderedColumns = getOrderedVisibleColumns(
|
|
9788
9820
|
smartGridConfig.columnState,
|
|
9789
9821
|
"colId"
|
|
9790
9822
|
);
|
|
9791
9823
|
return {
|
|
9792
9824
|
...smartGridConfig,
|
|
9793
|
-
columnState: orderedColumns
|
|
9825
|
+
columnState: orderedColumns.map(
|
|
9826
|
+
(col) => import_lodash.default.pick(col, SMART_GRID_COLUMN_COMPARE_KEYS)
|
|
9827
|
+
)
|
|
9794
9828
|
};
|
|
9795
9829
|
} else {
|
|
9796
9830
|
const dataTableConfig = table_config;
|
|
@@ -9802,7 +9836,9 @@ var cleanObject = (table_config, provider) => {
|
|
|
9802
9836
|
);
|
|
9803
9837
|
return {
|
|
9804
9838
|
...dataTableConfig,
|
|
9805
|
-
columnState: orderedColumns
|
|
9839
|
+
columnState: orderedColumns.map(
|
|
9840
|
+
(col) => import_lodash.default.pick(col, DATA_TABLE_COLUMN_COMPARE_KEYS)
|
|
9841
|
+
),
|
|
9806
9842
|
serverFilters: dataTableConfig.serverFilters.map(
|
|
9807
9843
|
(filter) => import_lodash.default.omit(filter, "filterRenderer")
|
|
9808
9844
|
)
|
|
@@ -9875,27 +9911,31 @@ var groupIcon = (group) => {
|
|
|
9875
9911
|
return /* @__PURE__ */ import_react7.default.createElement(Building_default, null);
|
|
9876
9912
|
}
|
|
9877
9913
|
};
|
|
9878
|
-
var
|
|
9879
|
-
width: 100%;
|
|
9914
|
+
var StyledButton2 = styled_components_esm_default(import_core_react6.Button)`
|
|
9880
9915
|
&:hover {
|
|
9881
9916
|
background-color: ${import_core_react6.colors.gray98};
|
|
9882
9917
|
}
|
|
9883
9918
|
`;
|
|
9884
9919
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9885
9920
|
const I18n = (0, import_core_react6.useI18nContext)();
|
|
9886
|
-
return /* @__PURE__ */ import_react7.default.createElement(
|
|
9887
|
-
|
|
9921
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_core_react6.Box, { style: { width: "100%" } }, /* @__PURE__ */ import_react7.default.createElement(
|
|
9922
|
+
StyledButton2,
|
|
9888
9923
|
{
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9924
|
+
block: true,
|
|
9925
|
+
style: {
|
|
9926
|
+
justifyContent: "start",
|
|
9927
|
+
height: "40px"
|
|
9928
|
+
},
|
|
9929
|
+
variant: "tertiary",
|
|
9930
|
+
size: "sm",
|
|
9931
|
+
onClick: () => toggleGroup(group),
|
|
9932
|
+
"aria-controls": `saved-views-collections-${group}`,
|
|
9933
|
+
"aria-expanded": expanded,
|
|
9934
|
+
icon: expanded ? /* @__PURE__ */ import_react7.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react7.default.createElement(ChevronRight_default, { size: "sm" })
|
|
9894
9935
|
},
|
|
9895
|
-
expanded ? /* @__PURE__ */ import_react7.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react7.default.createElement(ChevronRight_default, { size: "sm" }),
|
|
9896
9936
|
groupIcon(group),
|
|
9897
9937
|
/* @__PURE__ */ import_react7.default.createElement(import_core_react6.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9898
|
-
);
|
|
9938
|
+
));
|
|
9899
9939
|
};
|
|
9900
9940
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9901
9941
|
|
|
@@ -9913,7 +9953,7 @@ var useScrollToRef = (dependency) => {
|
|
|
9913
9953
|
|
|
9914
9954
|
// src/components/panels/PanelContent.styles.ts
|
|
9915
9955
|
var import_core_react7 = require("@procore/core-react");
|
|
9916
|
-
var Row = styled_components_esm_default(import_core_react7.
|
|
9956
|
+
var Row = styled_components_esm_default(import_core_react7.MenuImperative.Item)`
|
|
9917
9957
|
width: 100%;
|
|
9918
9958
|
padding-left: 35px;
|
|
9919
9959
|
padding-right: 4px;
|
|
@@ -9931,6 +9971,11 @@ var Panel2 = styled_components_esm_default(import_core_react7.DetailPage.Card)`
|
|
|
9931
9971
|
`;
|
|
9932
9972
|
|
|
9933
9973
|
// src/components/panels/PanelContent.tsx
|
|
9974
|
+
var StyledMenuImperative = styled_components_esm_default(import_core_react8.MenuImperative)`
|
|
9975
|
+
div[role='listbox'] {
|
|
9976
|
+
padding: 0;
|
|
9977
|
+
}
|
|
9978
|
+
`;
|
|
9934
9979
|
var PanelContent = (props) => {
|
|
9935
9980
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9936
9981
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
@@ -9971,40 +10016,52 @@ var PanelContent = (props) => {
|
|
|
9971
10016
|
}
|
|
9972
10017
|
});
|
|
9973
10018
|
};
|
|
9974
|
-
return /* @__PURE__ */ import_react9.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ import_react9.default.createElement(import_core_react8.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
9975
|
-
|
|
10019
|
+
return /* @__PURE__ */ import_react9.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ import_react9.default.createElement(import_core_react8.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, (temporaryView || presetViews) && /* @__PURE__ */ import_react9.default.createElement(
|
|
10020
|
+
StyledMenuImperative,
|
|
9976
10021
|
{
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
10022
|
+
role: "listbox",
|
|
10023
|
+
onSelect: (selection) => {
|
|
10024
|
+
if ((selectedSavedView == null ? void 0 : selectedSavedView.id) !== selection.item.id) {
|
|
10025
|
+
props.onSelect({ item: selection.item });
|
|
10026
|
+
}
|
|
10027
|
+
}
|
|
9980
10028
|
},
|
|
9981
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
9982
|
-
|
|
10029
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react8.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
10030
|
+
Row,
|
|
9983
10031
|
{
|
|
10032
|
+
key: temporaryView.id,
|
|
9984
10033
|
item: temporaryView,
|
|
9985
10034
|
selected: isTemporarySelected,
|
|
9986
|
-
|
|
9987
|
-
}
|
|
9988
|
-
)
|
|
9989
|
-
), presetViews.map((presetView) => {
|
|
9990
|
-
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
9991
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9992
|
-
Row,
|
|
9993
|
-
{
|
|
9994
|
-
key: presetView.id,
|
|
9995
|
-
selected: isSelected,
|
|
9996
|
-
onClick: () => props.onSelect({ item: presetView }),
|
|
9997
|
-
ref: isSelected ? selectedRowRef : null
|
|
10035
|
+
ref: isTemporarySelected ? selectedRowRef : null
|
|
9998
10036
|
},
|
|
9999
10037
|
/* @__PURE__ */ import_react9.default.createElement(
|
|
10000
10038
|
SavedViewCollectionMenuItem,
|
|
10001
10039
|
{
|
|
10002
|
-
item:
|
|
10003
|
-
selected:
|
|
10040
|
+
item: temporaryView,
|
|
10041
|
+
selected: isTemporarySelected,
|
|
10042
|
+
onClearTemporary: props.onClearTemporary
|
|
10004
10043
|
}
|
|
10005
10044
|
)
|
|
10006
|
-
)
|
|
10007
|
-
|
|
10045
|
+
), presetViews.map((presetView) => {
|
|
10046
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
10047
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10048
|
+
Row,
|
|
10049
|
+
{
|
|
10050
|
+
key: presetView.id,
|
|
10051
|
+
item: presetView,
|
|
10052
|
+
selected: isSelected,
|
|
10053
|
+
ref: isSelected ? selectedRowRef : null
|
|
10054
|
+
},
|
|
10055
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
10056
|
+
SavedViewCollectionMenuItem,
|
|
10057
|
+
{
|
|
10058
|
+
item: presetView,
|
|
10059
|
+
selected: isSelected
|
|
10060
|
+
}
|
|
10061
|
+
)
|
|
10062
|
+
);
|
|
10063
|
+
}))
|
|
10064
|
+
), viewLevels.map((level) => {
|
|
10008
10065
|
const isExpanded = groups[level];
|
|
10009
10066
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
10010
10067
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
@@ -10016,48 +10073,60 @@ var PanelContent = (props) => {
|
|
|
10016
10073
|
toggleGroup,
|
|
10017
10074
|
expanded: isExpanded
|
|
10018
10075
|
}
|
|
10019
|
-
), views.
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10076
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ import_react9.default.createElement(
|
|
10077
|
+
StyledMenuImperative,
|
|
10078
|
+
{
|
|
10079
|
+
id: `saved-views-collections-${level}`,
|
|
10080
|
+
role: "listbox",
|
|
10081
|
+
onSelect: (selection) => {
|
|
10082
|
+
if ((selectedSavedView == null ? void 0 : selectedSavedView.id) !== selection.item.id) {
|
|
10083
|
+
props.onSelect({ item: selection.item });
|
|
10084
|
+
}
|
|
10085
|
+
}
|
|
10086
|
+
},
|
|
10087
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react8.MenuImperative.Options, null, views.map((view) => {
|
|
10088
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === view.id;
|
|
10089
|
+
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
10090
|
+
view.view_level,
|
|
10091
|
+
permissions
|
|
10092
|
+
) && !isEqual(
|
|
10093
|
+
view.table_config,
|
|
10094
|
+
tableConfig,
|
|
10095
|
+
props.defaultView.table_config,
|
|
10096
|
+
props.provider
|
|
10097
|
+
);
|
|
10098
|
+
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
10099
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10100
|
+
Row,
|
|
10041
10101
|
{
|
|
10042
|
-
item: view,
|
|
10043
10102
|
key: view.id,
|
|
10103
|
+
item: view,
|
|
10044
10104
|
selected: isSelected,
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10105
|
+
ref: isSelected ? selectedRowRef : null
|
|
10106
|
+
},
|
|
10107
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
10108
|
+
SavedViewCollectionMenuItem,
|
|
10109
|
+
{
|
|
10110
|
+
item: view,
|
|
10111
|
+
key: view.id,
|
|
10112
|
+
selected: isSelected,
|
|
10113
|
+
canUpdate,
|
|
10114
|
+
canEditOrDelete,
|
|
10115
|
+
onUpdate: (data) => onUpdate(data),
|
|
10116
|
+
isUpdateProcessing: isUpdateLoading,
|
|
10117
|
+
onEdit: () => props.openModal("update" /* UPDATE */),
|
|
10118
|
+
onDelete: props.onDelete,
|
|
10119
|
+
permissions
|
|
10120
|
+
}
|
|
10121
|
+
)
|
|
10122
|
+
);
|
|
10123
|
+
}))
|
|
10124
|
+
));
|
|
10056
10125
|
})));
|
|
10057
10126
|
};
|
|
10058
10127
|
|
|
10059
10128
|
// src/components/saved-views/SavedViews.tsx
|
|
10060
|
-
var
|
|
10129
|
+
var import_core_react15 = require("@procore/core-react");
|
|
10061
10130
|
var import_react13 = __toESM(require("react"));
|
|
10062
10131
|
var import_react_query3 = require("@tanstack/react-query");
|
|
10063
10132
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
@@ -10090,8 +10159,8 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
10090
10159
|
var import_react11 = __toESM(require("react"));
|
|
10091
10160
|
|
|
10092
10161
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10093
|
-
var
|
|
10094
|
-
var
|
|
10162
|
+
var import_core_react11 = require("@procore/core-react");
|
|
10163
|
+
var React20 = __toESM(require("react"));
|
|
10095
10164
|
var yup = __toESM(require("yup"));
|
|
10096
10165
|
|
|
10097
10166
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -10128,6 +10197,37 @@ function extractMessage(error, I18n) {
|
|
|
10128
10197
|
return { form: I18n.t("savedViews.modal.errors.unknown") };
|
|
10129
10198
|
}
|
|
10130
10199
|
|
|
10200
|
+
// src/components/modals/form-modal/NameInputField.tsx
|
|
10201
|
+
var import_core_react10 = require("@procore/core-react");
|
|
10202
|
+
var React19 = __toESM(require("react"));
|
|
10203
|
+
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
10204
|
+
var NameInputField = ({
|
|
10205
|
+
error,
|
|
10206
|
+
onResetMutations
|
|
10207
|
+
}) => {
|
|
10208
|
+
const I18n = (0, import_core_react10.useI18nContext)();
|
|
10209
|
+
const label = I18n.t("savedViews.modal.fields.name");
|
|
10210
|
+
const { errors: formErrors, submitCount } = (0, import_core_react10.useFormContext)();
|
|
10211
|
+
React19.useEffect(() => {
|
|
10212
|
+
var _a;
|
|
10213
|
+
if (submitCount > 0 && (formErrors == null ? void 0 : formErrors.name)) {
|
|
10214
|
+
(_a = document.getElementById(NAME_INPUT_ID)) == null ? void 0 : _a.focus();
|
|
10215
|
+
}
|
|
10216
|
+
}, [formErrors == null ? void 0 : formErrors.name, submitCount]);
|
|
10217
|
+
return /* @__PURE__ */ React19.createElement(
|
|
10218
|
+
import_core_react10.Form.Text,
|
|
10219
|
+
{
|
|
10220
|
+
id: NAME_INPUT_ID,
|
|
10221
|
+
name: "name",
|
|
10222
|
+
error,
|
|
10223
|
+
placeholder: label,
|
|
10224
|
+
label,
|
|
10225
|
+
colWidth: 12,
|
|
10226
|
+
onChange: onResetMutations
|
|
10227
|
+
}
|
|
10228
|
+
);
|
|
10229
|
+
};
|
|
10230
|
+
|
|
10131
10231
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10132
10232
|
var ScrollContainer = styled_components_esm_default("div")`
|
|
10133
10233
|
overflow: auto;
|
|
@@ -10147,7 +10247,7 @@ var FormModalBase = ({
|
|
|
10147
10247
|
setOpenEditCreateModal,
|
|
10148
10248
|
onSelect
|
|
10149
10249
|
}) => {
|
|
10150
|
-
const I18n = (0,
|
|
10250
|
+
const I18n = (0, import_core_react11.useI18nContext)();
|
|
10151
10251
|
const NAME_MAX_LENGTH = 150;
|
|
10152
10252
|
const {
|
|
10153
10253
|
mutate: createSavedView,
|
|
@@ -10206,24 +10306,17 @@ var FormModalBase = ({
|
|
|
10206
10306
|
I18n,
|
|
10207
10307
|
isProjectLevelTool
|
|
10208
10308
|
);
|
|
10209
|
-
return /* @__PURE__ */
|
|
10210
|
-
|
|
10309
|
+
return /* @__PURE__ */ React20.createElement(
|
|
10310
|
+
import_core_react11.Modal,
|
|
10211
10311
|
{
|
|
10212
|
-
"
|
|
10213
|
-
|
|
10312
|
+
howToClose: ["x", "scrim"],
|
|
10313
|
+
onClose,
|
|
10214
10314
|
open,
|
|
10215
|
-
|
|
10315
|
+
width: "md",
|
|
10216
10316
|
"data-testid": "create-update-modal"
|
|
10217
10317
|
},
|
|
10218
|
-
/* @__PURE__ */
|
|
10219
|
-
|
|
10220
|
-
{
|
|
10221
|
-
onClose,
|
|
10222
|
-
style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` }
|
|
10223
|
-
},
|
|
10224
|
-
/* @__PURE__ */ React19.createElement(import_core_react10.H2, null, header)
|
|
10225
|
-
), /* @__PURE__ */ React19.createElement(
|
|
10226
|
-
import_core_react10.Form,
|
|
10318
|
+
/* @__PURE__ */ React20.createElement(ScrollContainer, null, /* @__PURE__ */ React20.createElement(import_core_react11.Modal.Header, { style: { borderBottom: `1px solid ${import_core_react11.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react11.Modal.Heading, null, header)), /* @__PURE__ */ React20.createElement(
|
|
10319
|
+
import_core_react11.Form,
|
|
10227
10320
|
{
|
|
10228
10321
|
initialValues: {
|
|
10229
10322
|
name: initialName,
|
|
@@ -10248,30 +10341,26 @@ var FormModalBase = ({
|
|
|
10248
10341
|
onReset: onCancel,
|
|
10249
10342
|
validateOnChange: true
|
|
10250
10343
|
},
|
|
10251
|
-
/* @__PURE__ */
|
|
10252
|
-
|
|
10344
|
+
/* @__PURE__ */ React20.createElement(import_core_react11.Form.Form, { name: header }, /* @__PURE__ */ React20.createElement(
|
|
10345
|
+
import_core_react11.Modal.Body,
|
|
10253
10346
|
{
|
|
10254
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10347
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react11.spacing.lg }
|
|
10255
10348
|
},
|
|
10256
|
-
errors && /* @__PURE__ */
|
|
10257
|
-
/* @__PURE__ */
|
|
10258
|
-
|
|
10349
|
+
errors && /* @__PURE__ */ React20.createElement(import_core_react11.ErrorBanner, { style: { marginBottom: import_core_react11.spacing.xl } }, /* @__PURE__ */ React20.createElement(import_core_react11.Banner.Content, null, /* @__PURE__ */ React20.createElement(import_core_react11.Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React20.createElement(import_core_react11.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10350
|
+
/* @__PURE__ */ React20.createElement(import_core_react11.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10351
|
+
NameInputField,
|
|
10259
10352
|
{
|
|
10260
|
-
name: "name",
|
|
10261
10353
|
error: errors == null ? void 0 : errors.name,
|
|
10262
|
-
|
|
10263
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10264
|
-
colWidth: 12,
|
|
10265
|
-
onChange: () => resetMutations()
|
|
10354
|
+
onResetMutations: resetMutations
|
|
10266
10355
|
}
|
|
10267
10356
|
)),
|
|
10268
|
-
/* @__PURE__ */
|
|
10269
|
-
|
|
10357
|
+
/* @__PURE__ */ React20.createElement(
|
|
10358
|
+
import_core_react11.Form.Row,
|
|
10270
10359
|
{
|
|
10271
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10360
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react11.spacing.xl : import_core_react11.spacing.none }
|
|
10272
10361
|
},
|
|
10273
|
-
/* @__PURE__ */
|
|
10274
|
-
|
|
10362
|
+
/* @__PURE__ */ React20.createElement(
|
|
10363
|
+
import_core_react11.Form.TextArea,
|
|
10275
10364
|
{
|
|
10276
10365
|
name: "description",
|
|
10277
10366
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10281,8 +10370,8 @@ var FormModalBase = ({
|
|
|
10281
10370
|
}
|
|
10282
10371
|
)
|
|
10283
10372
|
),
|
|
10284
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10285
|
-
|
|
10373
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React20.createElement(import_core_react11.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10374
|
+
import_core_react11.Form.Select,
|
|
10286
10375
|
{
|
|
10287
10376
|
name: "view_level",
|
|
10288
10377
|
options: viewLevelOptions,
|
|
@@ -10291,9 +10380,9 @@ var FormModalBase = ({
|
|
|
10291
10380
|
onSearch: false,
|
|
10292
10381
|
onClear: false
|
|
10293
10382
|
}
|
|
10294
|
-
)) : /* @__PURE__ */
|
|
10295
|
-
), /* @__PURE__ */
|
|
10296
|
-
|
|
10383
|
+
)) : /* @__PURE__ */ React20.createElement(React20.Fragment, null)
|
|
10384
|
+
), /* @__PURE__ */ React20.createElement(import_core_react11.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react11.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react11.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React20.createElement(import_core_react11.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React20.createElement(import_core_react11.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React20.createElement(import_core_react11.Modal.FooterButtons, null, /* @__PURE__ */ React20.createElement(import_core_react11.Button, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React20.createElement(
|
|
10385
|
+
import_core_react11.Button,
|
|
10297
10386
|
{
|
|
10298
10387
|
"data-testid": "create-update-modal-button",
|
|
10299
10388
|
type: "submit",
|
|
@@ -10308,7 +10397,7 @@ var FormModalBase = ({
|
|
|
10308
10397
|
};
|
|
10309
10398
|
|
|
10310
10399
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10311
|
-
var
|
|
10400
|
+
var import_core_react12 = require("@procore/core-react");
|
|
10312
10401
|
var FormModal = ({
|
|
10313
10402
|
open,
|
|
10314
10403
|
mode,
|
|
@@ -10321,7 +10410,7 @@ var FormModal = ({
|
|
|
10321
10410
|
onSelect,
|
|
10322
10411
|
defaultView
|
|
10323
10412
|
}) => {
|
|
10324
|
-
const i18n = (0,
|
|
10413
|
+
const i18n = (0, import_core_react12.useI18nContext)();
|
|
10325
10414
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
10326
10415
|
FormModalBase,
|
|
10327
10416
|
{
|
|
@@ -10343,8 +10432,8 @@ var FormModal = ({
|
|
|
10343
10432
|
};
|
|
10344
10433
|
|
|
10345
10434
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10346
|
-
var
|
|
10347
|
-
var
|
|
10435
|
+
var import_core_react13 = require("@procore/core-react");
|
|
10436
|
+
var React22 = __toESM(require("react"));
|
|
10348
10437
|
var yup2 = __toESM(require("yup"));
|
|
10349
10438
|
var SharedViewFormModal = ({
|
|
10350
10439
|
open,
|
|
@@ -10356,7 +10445,7 @@ var SharedViewFormModal = ({
|
|
|
10356
10445
|
isCreating,
|
|
10357
10446
|
resetCreateError
|
|
10358
10447
|
}) => {
|
|
10359
|
-
const I18n = (0,
|
|
10448
|
+
const I18n = (0, import_core_react13.useI18nContext)();
|
|
10360
10449
|
const NAME_MAX_LENGTH = 150;
|
|
10361
10450
|
const errors = extractMessage(createError, I18n);
|
|
10362
10451
|
const handleNameChange = () => {
|
|
@@ -10367,44 +10456,45 @@ var SharedViewFormModal = ({
|
|
|
10367
10456
|
const handleOnSubmit = (data) => {
|
|
10368
10457
|
onCreateView(data.name, data.description);
|
|
10369
10458
|
};
|
|
10370
|
-
return /* @__PURE__ */
|
|
10371
|
-
|
|
10459
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10460
|
+
import_core_react13.Modal,
|
|
10372
10461
|
{
|
|
10373
10462
|
"data-testid": "shared-view-form-modal",
|
|
10374
10463
|
open,
|
|
10375
|
-
|
|
10464
|
+
howToClose: ["x", "scrim"],
|
|
10465
|
+
onClose,
|
|
10376
10466
|
style: { width: "540px" }
|
|
10377
10467
|
},
|
|
10378
|
-
/* @__PURE__ */
|
|
10379
|
-
|
|
10468
|
+
/* @__PURE__ */ React22.createElement(
|
|
10469
|
+
import_core_react13.Modal.Header,
|
|
10380
10470
|
{
|
|
10381
10471
|
onClose,
|
|
10382
10472
|
style: {
|
|
10383
|
-
paddingTop:
|
|
10384
|
-
paddingBottom:
|
|
10385
|
-
paddingLeft:
|
|
10386
|
-
paddingRight:
|
|
10473
|
+
paddingTop: import_core_react13.spacing.lg,
|
|
10474
|
+
paddingBottom: import_core_react13.spacing.xs,
|
|
10475
|
+
paddingLeft: import_core_react13.spacing.xl,
|
|
10476
|
+
paddingRight: import_core_react13.spacing.xl
|
|
10387
10477
|
}
|
|
10388
10478
|
},
|
|
10389
|
-
I18n.t("savedViews.modal.create.title")
|
|
10479
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10390
10480
|
),
|
|
10391
|
-
/* @__PURE__ */
|
|
10392
|
-
|
|
10481
|
+
/* @__PURE__ */ React22.createElement(
|
|
10482
|
+
import_core_react13.P,
|
|
10393
10483
|
{
|
|
10394
10484
|
style: {
|
|
10395
|
-
paddingLeft:
|
|
10396
|
-
paddingRight:
|
|
10397
|
-
paddingBottom:
|
|
10398
|
-
paddingTop:
|
|
10485
|
+
paddingLeft: import_core_react13.spacing.xl,
|
|
10486
|
+
paddingRight: import_core_react13.spacing.xl,
|
|
10487
|
+
paddingBottom: import_core_react13.spacing.lg,
|
|
10488
|
+
paddingTop: import_core_react13.spacing.none,
|
|
10399
10489
|
margin: 0,
|
|
10400
|
-
color:
|
|
10490
|
+
color: import_core_react13.colors.gray45,
|
|
10401
10491
|
whiteSpace: "pre-line"
|
|
10402
10492
|
}
|
|
10403
10493
|
},
|
|
10404
10494
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10405
10495
|
),
|
|
10406
|
-
/* @__PURE__ */
|
|
10407
|
-
|
|
10496
|
+
/* @__PURE__ */ React22.createElement(
|
|
10497
|
+
import_core_react13.Form,
|
|
10408
10498
|
{
|
|
10409
10499
|
initialValues: {
|
|
10410
10500
|
name: fetchedView.name,
|
|
@@ -10422,36 +10512,32 @@ var SharedViewFormModal = ({
|
|
|
10422
10512
|
onSubmit: handleOnSubmit,
|
|
10423
10513
|
validateOnChange: true
|
|
10424
10514
|
},
|
|
10425
|
-
/* @__PURE__ */
|
|
10426
|
-
|
|
10515
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React22.createElement(
|
|
10516
|
+
import_core_react13.Modal.Body,
|
|
10427
10517
|
{
|
|
10428
10518
|
style: {
|
|
10429
|
-
paddingTop:
|
|
10519
|
+
paddingTop: import_core_react13.spacing.lg,
|
|
10430
10520
|
paddingBottom: 0,
|
|
10431
|
-
borderTop: `1px solid ${
|
|
10521
|
+
borderTop: `1px solid ${import_core_react13.colors.gray85}`
|
|
10432
10522
|
}
|
|
10433
10523
|
},
|
|
10434
|
-
errors && /* @__PURE__ */
|
|
10524
|
+
errors && /* @__PURE__ */ React22.createElement(import_core_react13.ErrorBanner, { style: { marginBottom: import_core_react13.spacing.xl } }, /* @__PURE__ */ React22.createElement(import_core_react13.Banner.Content, null, /* @__PURE__ */ React22.createElement(import_core_react13.Banner.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
10435
10525
|
mode: "create"
|
|
10436
|
-
})), /* @__PURE__ */
|
|
10437
|
-
/* @__PURE__ */
|
|
10438
|
-
|
|
10526
|
+
})), /* @__PURE__ */ React22.createElement(import_core_react13.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10527
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10528
|
+
NameInputField,
|
|
10439
10529
|
{
|
|
10440
|
-
name: "name",
|
|
10441
10530
|
error: errors == null ? void 0 : errors.name,
|
|
10442
|
-
|
|
10443
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10444
|
-
colWidth: 12,
|
|
10445
|
-
onChange: handleNameChange
|
|
10531
|
+
onResetMutations: handleNameChange
|
|
10446
10532
|
}
|
|
10447
10533
|
)),
|
|
10448
|
-
/* @__PURE__ */
|
|
10449
|
-
|
|
10534
|
+
/* @__PURE__ */ React22.createElement(
|
|
10535
|
+
import_core_react13.Form.Row,
|
|
10450
10536
|
{
|
|
10451
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10537
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react13.spacing.xl : import_core_react13.spacing.none }
|
|
10452
10538
|
},
|
|
10453
|
-
/* @__PURE__ */
|
|
10454
|
-
|
|
10539
|
+
/* @__PURE__ */ React22.createElement(
|
|
10540
|
+
import_core_react13.Form.TextArea,
|
|
10455
10541
|
{
|
|
10456
10542
|
name: "description",
|
|
10457
10543
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10461,8 +10547,8 @@ var SharedViewFormModal = ({
|
|
|
10461
10547
|
}
|
|
10462
10548
|
)
|
|
10463
10549
|
)
|
|
10464
|
-
), /* @__PURE__ */
|
|
10465
|
-
|
|
10550
|
+
), /* @__PURE__ */ React22.createElement(import_core_react13.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react13.colors.gray85}` } }, /* @__PURE__ */ React22.createElement(import_core_react13.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_core_react13.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React22.createElement(import_core_react13.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React22.createElement(import_core_react13.Modal.FooterButtons, null, /* @__PURE__ */ React22.createElement(
|
|
10551
|
+
import_core_react13.Button,
|
|
10466
10552
|
{
|
|
10467
10553
|
variant: "secondary",
|
|
10468
10554
|
onClick: onCreateTemporaryView,
|
|
@@ -10470,8 +10556,8 @@ var SharedViewFormModal = ({
|
|
|
10470
10556
|
disabled: isCreating
|
|
10471
10557
|
},
|
|
10472
10558
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10473
|
-
), /* @__PURE__ */
|
|
10474
|
-
|
|
10559
|
+
), /* @__PURE__ */ React22.createElement(
|
|
10560
|
+
import_core_react13.Button,
|
|
10475
10561
|
{
|
|
10476
10562
|
type: "submit",
|
|
10477
10563
|
variant: "primary",
|
|
@@ -10488,7 +10574,7 @@ var SharedViewFormModal = ({
|
|
|
10488
10574
|
// src/utils/hooks/useViewSelection.ts
|
|
10489
10575
|
var import_react12 = require("react");
|
|
10490
10576
|
var import_react_router_dom = require("react-router-dom");
|
|
10491
|
-
var
|
|
10577
|
+
var import_core_react14 = require("@procore/core-react");
|
|
10492
10578
|
|
|
10493
10579
|
// src/utils/viewStorage.ts
|
|
10494
10580
|
var ViewStorage = {
|
|
@@ -10551,7 +10637,7 @@ var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
|
10551
10637
|
}
|
|
10552
10638
|
};
|
|
10553
10639
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal) => {
|
|
10554
|
-
const I18n = (0,
|
|
10640
|
+
const I18n = (0, import_core_react14.useI18nContext)();
|
|
10555
10641
|
const projectIdSegment = config.projectId ?? "company";
|
|
10556
10642
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10557
10643
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
@@ -10667,7 +10753,7 @@ var SavedViewsContent = (props) => {
|
|
|
10667
10753
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
10668
10754
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
10669
10755
|
const { showToast } = (0, import_toast_alert3.useToastAlertContext)();
|
|
10670
|
-
const i18n = (0,
|
|
10756
|
+
const i18n = (0, import_core_react15.useI18nContext)();
|
|
10671
10757
|
const [activeModal, setActiveModal] = (0, import_react13.useState)(null);
|
|
10672
10758
|
const [modalData, setModalData] = (0, import_react13.useState)(null);
|
|
10673
10759
|
const openModal = (type, data) => {
|
|
@@ -10767,14 +10853,28 @@ var SavedViewsContent = (props) => {
|
|
|
10767
10853
|
"data-testid": "saved-view-expanded-panel",
|
|
10768
10854
|
provider: props.provider
|
|
10769
10855
|
},
|
|
10770
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10771
|
-
|
|
10856
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Title, null, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Flex, { alignItems: "center" }, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Box, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ import_react13.default.createElement(
|
|
10857
|
+
import_core_react15.Tooltip,
|
|
10858
|
+
{
|
|
10859
|
+
showDelay: 200,
|
|
10860
|
+
overlay: /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10861
|
+
},
|
|
10862
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10863
|
+
Help_default,
|
|
10864
|
+
{
|
|
10865
|
+
tabIndex: 0,
|
|
10866
|
+
size: "sm",
|
|
10867
|
+
"aria-label": i18n.t("savedViews.tooltip")
|
|
10868
|
+
}
|
|
10869
|
+
)
|
|
10870
|
+
))), /* @__PURE__ */ import_react13.default.createElement(
|
|
10871
|
+
import_core_react15.Tooltip,
|
|
10772
10872
|
{
|
|
10773
10873
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10774
10874
|
showDelay: 1e3
|
|
10775
10875
|
},
|
|
10776
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10777
|
-
|
|
10876
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10877
|
+
import_core_react15.Button,
|
|
10778
10878
|
{
|
|
10779
10879
|
icon: /* @__PURE__ */ import_react13.default.createElement(Plus_default, null),
|
|
10780
10880
|
variant: "secondary",
|
|
@@ -10783,9 +10883,9 @@ var SavedViewsContent = (props) => {
|
|
|
10783
10883
|
"aria-label": i18n.t("savedViews.actions.create")
|
|
10784
10884
|
},
|
|
10785
10885
|
i18n.t("savedViews.actions.create")
|
|
10786
|
-
)
|
|
10886
|
+
)
|
|
10787
10887
|
)),
|
|
10788
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10888
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react13.default.createElement(
|
|
10789
10889
|
PanelContent,
|
|
10790
10890
|
{
|
|
10791
10891
|
onSelect: ({ item }) => selectView(item),
|