@procore/saved-views 6.1.0 → 6.2.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/dist/legacy/adapters/hub-data-loader.d.mts +22 -0
- package/dist/legacy/adapters/hub-data-loader.d.ts +22 -0
- package/dist/legacy/adapters/hub-data-loader.js +273 -0
- package/dist/legacy/adapters/hub-data-loader.mjs +273 -0
- package/dist/legacy/chunk-6DZX6EAA.mjs +37 -0
- package/dist/legacy/chunk-QGM4M3NI.js +37 -0
- package/dist/legacy/index.d.mts +13 -2
- package/dist/legacy/index.d.ts +13 -2
- package/dist/legacy/index.js +549 -471
- package/dist/legacy/index.mjs +223 -192
- package/dist/legacy/transport/default.d.mts +15 -0
- package/dist/legacy/transport/default.d.ts +15 -0
- package/dist/legacy/transport/default.js +104 -0
- package/dist/legacy/transport/default.mjs +104 -0
- package/dist/legacy/types-BWhJ-on3.d.mts +109 -0
- package/dist/legacy/types-BWhJ-on3.d.ts +109 -0
- package/dist/modern/adapters/hub-data-loader.d.mts +22 -0
- package/dist/modern/adapters/hub-data-loader.d.ts +22 -0
- package/dist/modern/adapters/hub-data-loader.js +270 -0
- package/dist/modern/adapters/hub-data-loader.mjs +270 -0
- package/dist/modern/chunk-6DZX6EAA.mjs +37 -0
- package/dist/modern/chunk-QGM4M3NI.js +37 -0
- package/dist/modern/index.d.mts +13 -2
- package/dist/modern/index.d.ts +13 -2
- package/dist/modern/index.js +606 -528
- package/dist/modern/index.mjs +223 -192
- package/dist/modern/transport/default.d.mts +15 -0
- package/dist/modern/transport/default.d.ts +15 -0
- package/dist/modern/transport/default.js +104 -0
- package/dist/modern/transport/default.mjs +104 -0
- package/dist/modern/types-BWhJ-on3.d.mts +109 -0
- package/dist/modern/types-BWhJ-on3.d.ts +109 -0
- package/package.json +35 -2
package/dist/modern/index.js
CHANGED
|
@@ -1,38 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from2, except, desc) => {
|
|
16
|
-
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from2))
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkQGM4M3NIjs = require('./chunk-QGM4M3NI.js');
|
|
32
6
|
|
|
33
7
|
// node_modules/lodash/lodash.js
|
|
34
|
-
var require_lodash = __commonJS({
|
|
35
|
-
"node_modules/lodash/lodash.js"(
|
|
8
|
+
var require_lodash = _chunkQGM4M3NIjs.__commonJS.call(void 0, {
|
|
9
|
+
"node_modules/lodash/lodash.js"(exports, module) {
|
|
36
10
|
"use strict";
|
|
37
11
|
(function() {
|
|
38
12
|
var undefined2;
|
|
@@ -361,8 +335,8 @@ var require_lodash = __commonJS({
|
|
|
361
335
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
362
336
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
363
337
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
364
|
-
var freeExports = typeof
|
|
365
|
-
var freeModule = freeExports && typeof
|
|
338
|
+
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
339
|
+
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
366
340
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
367
341
|
var freeProcess = moduleExports && freeGlobal.process;
|
|
368
342
|
var nodeUtil = (function() {
|
|
@@ -738,7 +712,7 @@ var require_lodash = __commonJS({
|
|
|
738
712
|
var reIsNative = RegExp2(
|
|
739
713
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
740
714
|
);
|
|
741
|
-
var
|
|
715
|
+
var Buffer = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2;
|
|
742
716
|
var defineProperty = (function() {
|
|
743
717
|
try {
|
|
744
718
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -748,7 +722,7 @@ var require_lodash = __commonJS({
|
|
|
748
722
|
}
|
|
749
723
|
})();
|
|
750
724
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
751
|
-
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer =
|
|
725
|
+
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
752
726
|
var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
753
727
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
754
728
|
var realNames = {};
|
|
@@ -2060,7 +2034,7 @@ var require_lodash = __commonJS({
|
|
|
2060
2034
|
}
|
|
2061
2035
|
function cloneArrayBuffer(arrayBuffer) {
|
|
2062
2036
|
var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2063
|
-
new
|
|
2037
|
+
new Uint8Array(result2).set(new Uint8Array(arrayBuffer));
|
|
2064
2038
|
return result2;
|
|
2065
2039
|
}
|
|
2066
2040
|
function cloneDataView(dataView, isDeep) {
|
|
@@ -2664,7 +2638,7 @@ var require_lodash = __commonJS({
|
|
|
2664
2638
|
object3 = object3.buffer;
|
|
2665
2639
|
other = other.buffer;
|
|
2666
2640
|
case arrayBufferTag:
|
|
2667
|
-
if (object3.byteLength != other.byteLength || !equalFunc(new
|
|
2641
|
+
if (object3.byteLength != other.byteLength || !equalFunc(new Uint8Array(object3), new Uint8Array(other))) {
|
|
2668
2642
|
return false;
|
|
2669
2643
|
}
|
|
2670
2644
|
return true;
|
|
@@ -5527,30 +5501,14 @@ var require_lodash = __commonJS({
|
|
|
5527
5501
|
} else {
|
|
5528
5502
|
root._ = _3;
|
|
5529
5503
|
}
|
|
5530
|
-
}).call(
|
|
5504
|
+
}).call(exports);
|
|
5531
5505
|
}
|
|
5532
5506
|
});
|
|
5533
5507
|
|
|
5534
|
-
// src/index.ts
|
|
5535
|
-
var index_exports = {};
|
|
5536
|
-
__export(index_exports, {
|
|
5537
|
-
DataTableSavedViews: () => DataTableSavedViews,
|
|
5538
|
-
ExpandedPanel: () => ExpandedPanel,
|
|
5539
|
-
FormModal: () => FormModal,
|
|
5540
|
-
PanelContent: () => PanelContent,
|
|
5541
|
-
SavedViewCollectionMenuItem: () => SavedViewCollectionMenuItem,
|
|
5542
|
-
SavedViews: () => SavedViews,
|
|
5543
|
-
SavedViewsDeleteConfirmationModalShared: () => SavedViewsDeleteConfirmationModalShared,
|
|
5544
|
-
SavedViewsSelectionProvider: () => SavedViewsSelectionProvider,
|
|
5545
|
-
SmartGridSavedViews: () => SmartGridSavedViews,
|
|
5546
|
-
getTranslations: () => getTranslations,
|
|
5547
|
-
useSavedViewsPanel: () => useSavedViewsPanel_default,
|
|
5548
|
-
useSavedViewsSelection: () => useSavedViewsSelection
|
|
5549
|
-
});
|
|
5550
|
-
module.exports = __toCommonJS(index_exports);
|
|
5551
|
-
|
|
5552
5508
|
// src/utils/translations/translations.ts
|
|
5553
|
-
|
|
5509
|
+
|
|
5510
|
+
|
|
5511
|
+
var _globalizationtoolkit = require('@procore/globalization-toolkit');
|
|
5554
5512
|
|
|
5555
5513
|
// src/locales/de-DE.json
|
|
5556
5514
|
var de_DE_default = {
|
|
@@ -7227,15 +7185,15 @@ var supportedLocales = {
|
|
|
7227
7185
|
};
|
|
7228
7186
|
function getTranslations(envLocale) {
|
|
7229
7187
|
return Object.fromEntries(
|
|
7230
|
-
(0,
|
|
7188
|
+
_globalizationtoolkit.getFallbackLocaleList.call(void 0, envLocale).map((locale) => [
|
|
7231
7189
|
locale,
|
|
7232
|
-
supportedLocales[locale]
|
|
7190
|
+
_nullishCoalesce(supportedLocales[locale], () => ( {}))
|
|
7233
7191
|
])
|
|
7234
7192
|
);
|
|
7235
7193
|
}
|
|
7236
7194
|
|
|
7237
7195
|
// src/components/buttons/useSavedViewsPanel.tsx
|
|
7238
|
-
var
|
|
7196
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react); var React6 = _interopRequireWildcard(_react); var React7 = _interopRequireWildcard(_react); var React8 = _interopRequireWildcard(_react); var React9 = _interopRequireWildcard(_react); var React10 = _interopRequireWildcard(_react); var React11 = _interopRequireWildcard(_react); var React17 = _interopRequireWildcard(_react); var React22 = _interopRequireWildcard(_react); var React21 = _interopRequireWildcard(_react); var React24 = _interopRequireWildcard(_react);
|
|
7239
7197
|
|
|
7240
7198
|
// ../../node_modules/tslib/tslib.es6.mjs
|
|
7241
7199
|
var __assign = function() {
|
|
@@ -7270,7 +7228,7 @@ function __spreadArray(to, from2, pack) {
|
|
|
7270
7228
|
}
|
|
7271
7229
|
|
|
7272
7230
|
// ../../node_modules/@procore/core-icons/dist/Icon.js
|
|
7273
|
-
|
|
7231
|
+
|
|
7274
7232
|
function getSize(size) {
|
|
7275
7233
|
if (size === "sm") {
|
|
7276
7234
|
return 16;
|
|
@@ -7289,7 +7247,7 @@ function Icon(_a) {
|
|
|
7289
7247
|
}
|
|
7290
7248
|
|
|
7291
7249
|
// ../../node_modules/@procore/core-icons/dist/icons/Building.js
|
|
7292
|
-
|
|
7250
|
+
|
|
7293
7251
|
var Building = React2.forwardRef(function Building2(props, ref) {
|
|
7294
7252
|
return React2.createElement(
|
|
7295
7253
|
Icon,
|
|
@@ -7305,7 +7263,7 @@ Building.displayName = "Building";
|
|
|
7305
7263
|
var Building_default = Building;
|
|
7306
7264
|
|
|
7307
7265
|
// ../../node_modules/@procore/core-icons/dist/icons/ChevronDown.js
|
|
7308
|
-
|
|
7266
|
+
|
|
7309
7267
|
var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
7310
7268
|
return React3.createElement(
|
|
7311
7269
|
Icon,
|
|
@@ -7321,7 +7279,7 @@ ChevronDown.displayName = "ChevronDown";
|
|
|
7321
7279
|
var ChevronDown_default = ChevronDown;
|
|
7322
7280
|
|
|
7323
7281
|
// ../../node_modules/@procore/core-icons/dist/icons/ChevronRight.js
|
|
7324
|
-
|
|
7282
|
+
|
|
7325
7283
|
var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
7326
7284
|
return React4.createElement(
|
|
7327
7285
|
Icon,
|
|
@@ -7337,7 +7295,7 @@ ChevronRight.displayName = "ChevronRight";
|
|
|
7337
7295
|
var ChevronRight_default = ChevronRight;
|
|
7338
7296
|
|
|
7339
7297
|
// ../../node_modules/@procore/core-icons/dist/icons/Clear.js
|
|
7340
|
-
|
|
7298
|
+
|
|
7341
7299
|
var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
7342
7300
|
return React5.createElement(
|
|
7343
7301
|
Icon,
|
|
@@ -7353,7 +7311,7 @@ Clear.displayName = "Clear";
|
|
|
7353
7311
|
var Clear_default = Clear;
|
|
7354
7312
|
|
|
7355
7313
|
// ../../node_modules/@procore/core-icons/dist/icons/Excavator.js
|
|
7356
|
-
|
|
7314
|
+
|
|
7357
7315
|
var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
7358
7316
|
return React6.createElement(
|
|
7359
7317
|
Icon,
|
|
@@ -7370,7 +7328,7 @@ Excavator.displayName = "Excavator";
|
|
|
7370
7328
|
var Excavator_default = Excavator;
|
|
7371
7329
|
|
|
7372
7330
|
// ../../node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
|
|
7373
|
-
|
|
7331
|
+
|
|
7374
7332
|
var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
7375
7333
|
return React7.createElement(
|
|
7376
7334
|
Icon,
|
|
@@ -7388,7 +7346,7 @@ ExpandSidebar.displayName = "ExpandSidebar";
|
|
|
7388
7346
|
var ExpandSidebar_default = ExpandSidebar;
|
|
7389
7347
|
|
|
7390
7348
|
// ../../node_modules/@procore/core-icons/dist/icons/Help.js
|
|
7391
|
-
|
|
7349
|
+
|
|
7392
7350
|
var Help = React8.forwardRef(function Help2(props, ref) {
|
|
7393
7351
|
return React8.createElement(
|
|
7394
7352
|
Icon,
|
|
@@ -7404,7 +7362,7 @@ Help.displayName = "Help";
|
|
|
7404
7362
|
var Help_default = Help;
|
|
7405
7363
|
|
|
7406
7364
|
// ../../node_modules/@procore/core-icons/dist/icons/Link.js
|
|
7407
|
-
|
|
7365
|
+
|
|
7408
7366
|
var Link = React9.forwardRef(function Link2(props, ref) {
|
|
7409
7367
|
return React9.createElement(
|
|
7410
7368
|
Icon,
|
|
@@ -7421,7 +7379,7 @@ Link.displayName = "Link";
|
|
|
7421
7379
|
var Link_default = Link;
|
|
7422
7380
|
|
|
7423
7381
|
// ../../node_modules/@procore/core-icons/dist/icons/Person.js
|
|
7424
|
-
|
|
7382
|
+
|
|
7425
7383
|
var Person = React10.forwardRef(function Person2(props, ref) {
|
|
7426
7384
|
return React10.createElement(
|
|
7427
7385
|
Icon,
|
|
@@ -7437,7 +7395,7 @@ Person.displayName = "Person";
|
|
|
7437
7395
|
var Person_default = Person;
|
|
7438
7396
|
|
|
7439
7397
|
// ../../node_modules/@procore/core-icons/dist/icons/Plus.js
|
|
7440
|
-
|
|
7398
|
+
|
|
7441
7399
|
var Plus = React11.forwardRef(function Plus2(props, ref) {
|
|
7442
7400
|
return React11.createElement(
|
|
7443
7401
|
Icon,
|
|
@@ -7453,8 +7411,8 @@ Plus.displayName = "Plus";
|
|
|
7453
7411
|
var Plus_default = Plus;
|
|
7454
7412
|
|
|
7455
7413
|
// src/components/buttons/SavedViewsButton.tsx
|
|
7456
|
-
var
|
|
7457
|
-
|
|
7414
|
+
var _corereact = require('@procore/core-react');
|
|
7415
|
+
|
|
7458
7416
|
|
|
7459
7417
|
// ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
7460
7418
|
function memoize(fn) {
|
|
@@ -7475,7 +7433,7 @@ var isPropValid = /* @__PURE__ */ memoize(
|
|
|
7475
7433
|
);
|
|
7476
7434
|
|
|
7477
7435
|
// ../../node_modules/styled-components/dist/styled-components.esm.js
|
|
7478
|
-
|
|
7436
|
+
|
|
7479
7437
|
|
|
7480
7438
|
// ../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
|
|
7481
7439
|
var unitlessKeys = {
|
|
@@ -8155,7 +8113,7 @@ var u = "data-styled-version";
|
|
|
8155
8113
|
var l = "6.3.12";
|
|
8156
8114
|
var p = "/*!sc*/\n";
|
|
8157
8115
|
var d = "undefined" != typeof window && "undefined" != typeof document;
|
|
8158
|
-
var h = void 0 ===
|
|
8116
|
+
var h = void 0 === React.default.createContext;
|
|
8159
8117
|
var f = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env && void 0 !== process.env.REACT_APP_SC_DISABLE_SPEEDY && "" !== process.env.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== process.env.REACT_APP_SC_DISABLE_SPEEDY && process.env.REACT_APP_SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env && void 0 !== process.env.SC_DISABLE_SPEEDY && "" !== process.env.SC_DISABLE_SPEEDY ? "false" !== process.env.SC_DISABLE_SPEEDY && process.env.SC_DISABLE_SPEEDY : "production" !== process.env.NODE_ENV);
|
|
8160
8118
|
var y = "production" !== process.env.NODE_ENV ? { 1: "Cannot create styled-component for component: %s.\n\n", 2: "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n", 3: "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n", 4: "The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n", 5: "The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n", 6: "Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n", 7: 'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n', 8: 'ThemeProvider: Please make your "theme" prop an object.\n\n', 9: "Missing document `<head>`\n\n", 10: "Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n", 11: "_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n", 12: "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n", 13: "%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n", 14: 'ThemeProvider: "theme" prop is required.\n\n', 15: "A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n", 16: "Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n", 17: "CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n", 18: "ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`" } : {};
|
|
8161
8119
|
function v() {
|
|
@@ -8194,7 +8152,7 @@ var I = function(t, n) {
|
|
|
8194
8152
|
console.error = function(t2) {
|
|
8195
8153
|
for (var n2 = [], r2 = 1; r2 < arguments.length; r2++) n2[r2 - 1] = arguments[r2];
|
|
8196
8154
|
_.test(t2) ? (a2 = false, A.delete(s)) : i.apply(void 0, __spreadArray([t2], n2, false));
|
|
8197
|
-
}, "function" == typeof
|
|
8155
|
+
}, "function" == typeof React.default.useState && React.default.useState(null), a2 && !A.has(s) && (console.warn(s), A.add(s));
|
|
8198
8156
|
} catch (e) {
|
|
8199
8157
|
_.test(e.message) && A.delete(s);
|
|
8200
8158
|
} finally {
|
|
@@ -8679,33 +8637,33 @@ var Ue = h ? { Provider: function(e) {
|
|
|
8679
8637
|
return e.children;
|
|
8680
8638
|
}, Consumer: function(e) {
|
|
8681
8639
|
return (0, e.children)(He);
|
|
8682
|
-
} } :
|
|
8640
|
+
} } : React.default.createContext(He);
|
|
8683
8641
|
var Je = Ue.Consumer;
|
|
8684
8642
|
var Xe = h ? { Provider: function(e) {
|
|
8685
8643
|
return e.children;
|
|
8686
8644
|
}, Consumer: function(e) {
|
|
8687
8645
|
return (0, e.children)(void 0);
|
|
8688
|
-
} } :
|
|
8646
|
+
} } : React.default.createContext(void 0);
|
|
8689
8647
|
function Ze() {
|
|
8690
|
-
return h ? He :
|
|
8648
|
+
return h ? He : React.default.useContext(Ue);
|
|
8691
8649
|
}
|
|
8692
8650
|
function Ke(e) {
|
|
8693
|
-
if (h || !
|
|
8694
|
-
var t = Ze().styleSheet, n =
|
|
8651
|
+
if (h || !React.default.useMemo) return e.children;
|
|
8652
|
+
var t = Ze().styleSheet, n = React.default.useMemo(function() {
|
|
8695
8653
|
var n2 = t;
|
|
8696
8654
|
return e.sheet ? n2 = e.sheet : e.target && (n2 = n2.reconstructWithOptions({ target: e.target }, false)), e.disableCSSOMInjection && (n2 = n2.reconstructWithOptions({ useCSSOMInjection: false })), n2;
|
|
8697
|
-
}, [e.disableCSSOMInjection, e.sheet, e.target, t]), o2 =
|
|
8655
|
+
}, [e.disableCSSOMInjection, e.sheet, e.target, t]), o2 = React.default.useMemo(function() {
|
|
8698
8656
|
return Ye({ options: { namespace: e.namespace, prefix: e.enableVendorPrefixes }, plugins: e.stylisPlugins });
|
|
8699
|
-
}, [e.enableVendorPrefixes, e.namespace, e.stylisPlugins]), s =
|
|
8657
|
+
}, [e.enableVendorPrefixes, e.namespace, e.stylisPlugins]), s = React.default.useMemo(function() {
|
|
8700
8658
|
return { shouldForwardProp: e.shouldForwardProp, styleSheet: n, stylis: o2 };
|
|
8701
8659
|
}, [e.shouldForwardProp, n, o2]);
|
|
8702
|
-
return
|
|
8660
|
+
return React.default.createElement(Ue.Provider, { value: s }, React.default.createElement(Xe.Provider, { value: o2 }, e.children));
|
|
8703
8661
|
}
|
|
8704
8662
|
var Qe = h ? { Provider: function(e) {
|
|
8705
8663
|
return e.children;
|
|
8706
8664
|
}, Consumer: function(e) {
|
|
8707
8665
|
return (0, e.children)(void 0);
|
|
8708
|
-
} } :
|
|
8666
|
+
} } : React.default.createContext(void 0);
|
|
8709
8667
|
var et = Qe.Consumer;
|
|
8710
8668
|
var rt = {};
|
|
8711
8669
|
var ot = /* @__PURE__ */ new Set();
|
|
@@ -8730,8 +8688,8 @@ function st(s, i, a2) {
|
|
|
8730
8688
|
var _3 = new Fe(a2, S2, c2 ? u2.componentStyle : void 0);
|
|
8731
8689
|
function A2(s2, i2) {
|
|
8732
8690
|
return (function(s3, i3, a3) {
|
|
8733
|
-
var c3 = s3.attrs, u3 = s3.componentStyle, l2 = s3.defaultProps, p3 = s3.foldedComponentIds, d3 = s3.styledComponentId, f3 = s3.target, m2 = h ? void 0 :
|
|
8734
|
-
"production" !== process.env.NODE_ENV &&
|
|
8691
|
+
var c3 = s3.attrs, u3 = s3.componentStyle, l2 = s3.defaultProps, p3 = s3.foldedComponentIds, d3 = s3.styledComponentId, f3 = s3.target, m2 = h ? void 0 : React.default.useContext(Qe), y3 = Ze(), v3 = s3.shouldForwardProp || y3.shouldForwardProp;
|
|
8692
|
+
"production" !== process.env.NODE_ENV && React.default.useDebugValue && React.default.useDebugValue(d3);
|
|
8735
8693
|
var g3 = D(i3, m2, l2) || (h ? void 0 : O), S3 = (function(e, n, r2) {
|
|
8736
8694
|
for (var o2, s4 = __assign(__assign({}, n), { className: void 0, theme: r2 }), i4 = 0; i4 < e.length; i4 += 1) {
|
|
8737
8695
|
var a4 = se(o2 = e[i4]) ? o2(s4) : o2;
|
|
@@ -8742,12 +8700,12 @@ function st(s, i, a2) {
|
|
|
8742
8700
|
for (var N3 in S3) void 0 === S3[N3] || "$" === N3[0] || "as" === N3 || "theme" === N3 && S3.theme === g3 || ("forwardedAs" === N3 ? b3.as = S3.forwardedAs : v3 && !v3(N3, w3) || (b3[N3] = S3[N3], v3 || "development" !== process.env.NODE_ENV || isPropValid(N3) || ot.has(N3) || !T.has(w3) || (ot.add(N3), console.warn('styled-components: it looks like an unknown prop "'.concat(N3, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
|
|
8743
8701
|
var E3 = (function(e, t) {
|
|
8744
8702
|
var n = Ze(), o2 = e.generateAndInjectStyles(t, n.styleSheet, n.stylis);
|
|
8745
|
-
return "production" !== process.env.NODE_ENV &&
|
|
8703
|
+
return "production" !== process.env.NODE_ENV && React.default.useDebugValue && React.default.useDebugValue(o2.className), o2;
|
|
8746
8704
|
})(u3, S3), _4 = E3.className;
|
|
8747
8705
|
"production" !== process.env.NODE_ENV && s3.warnTooManyClasses && s3.warnTooManyClasses(_4);
|
|
8748
8706
|
var A3 = ae(p3, d3);
|
|
8749
8707
|
_4 && (A3 += " " + _4), S3.className && (A3 += " " + S3.className), b3[$(w3) && !T.has(w3) ? "class" : "className"] = A3, a3 && (b3.ref = a3);
|
|
8750
|
-
var I2 = (0,
|
|
8708
|
+
var I2 = _react.createElement.call(void 0, w3, b3);
|
|
8751
8709
|
if (h) {
|
|
8752
8710
|
for (var P4 = [], R3 = u3, x2 = function() {
|
|
8753
8711
|
var e = y3.styleSheet.getTag().getGroup(C(R3.componentId));
|
|
@@ -8755,17 +8713,17 @@ function st(s, i, a2) {
|
|
|
8755
8713
|
var t = "", n = y3.styleSheet.names.get(R3.componentId);
|
|
8756
8714
|
n && n.forEach(function(e2) {
|
|
8757
8715
|
t && (t += "_"), t += e2;
|
|
8758
|
-
}), P4.push(
|
|
8716
|
+
}), P4.push(React.default.createElement("style", { key: "sc-".concat(R3.componentId), precedence: "styled-components", href: "sc-".concat(R3.componentId, "-").concat(t), children: e }));
|
|
8759
8717
|
}
|
|
8760
8718
|
R3 = R3.baseStyle;
|
|
8761
8719
|
}; R3; ) x2();
|
|
8762
|
-
if (P4.length) return P4.reverse(),
|
|
8720
|
+
if (P4.length) return P4.reverse(), React.default.createElement.apply(React.default, __spreadArray(__spreadArray([React.default.Fragment, null], P4, false), [I2], false));
|
|
8763
8721
|
}
|
|
8764
8722
|
return I2;
|
|
8765
8723
|
})(R2, s2, i2);
|
|
8766
8724
|
}
|
|
8767
8725
|
A2.displayName = g2;
|
|
8768
|
-
var R2 =
|
|
8726
|
+
var R2 = React.default.forwardRef(A2);
|
|
8769
8727
|
return R2.attrs = w2, R2.componentStyle = _3, R2.displayName = g2, R2.shouldForwardProp = b2, R2.foldedComponentIds = c2 ? ae(u2.foldedComponentIds, u2.styledComponentId) : "", R2.styledComponentId = S2, R2.target = c2 ? u2.target : s, Object.defineProperty(R2, "defaultProps", { get: function() {
|
|
8770
8728
|
return this._foldedDefaultProps;
|
|
8771
8729
|
}, set: function(e) {
|
|
@@ -8868,18 +8826,18 @@ var St = (function() {
|
|
|
8868
8826
|
var o2 = e2.instance.toString();
|
|
8869
8827
|
if (!o2) return [];
|
|
8870
8828
|
var s = ((n = {})[a] = "", n[u] = l, n.dangerouslySetInnerHTML = { __html: o2 }, n), i = we();
|
|
8871
|
-
return i && (s.nonce = i), [
|
|
8829
|
+
return i && (s.nonce = i), [React.default.createElement("style", __assign({}, s, { key: "sc-0-0" }))];
|
|
8872
8830
|
}, this.seal = function() {
|
|
8873
8831
|
e2.sealed = true;
|
|
8874
8832
|
}, this.instance = new Ie({ isServer: true }), this.sealed = false;
|
|
8875
8833
|
}
|
|
8876
8834
|
return e.prototype.collectStyles = function(e2) {
|
|
8877
8835
|
if (this.sealed) throw g(2);
|
|
8878
|
-
return
|
|
8836
|
+
return React.default.createElement(Ke, { sheet: this.instance }, e2);
|
|
8879
8837
|
}, e.prototype.interleaveWithNodeStream = function(e2) {
|
|
8880
8838
|
if (this.sealed) throw g(2);
|
|
8881
8839
|
this.seal();
|
|
8882
|
-
var t =
|
|
8840
|
+
var t = _chunkQGM4M3NIjs.__require.call(void 0, "stream").Transform, n = this.instance, r2 = this._emitSheetCSS, o2 = new t({ transform: function(e3, t2, o3) {
|
|
8883
8841
|
var s2 = e3.toString(), i = r2();
|
|
8884
8842
|
if (n.clearTag(), gt.test(s2)) {
|
|
8885
8843
|
var a2 = s2.indexOf(">") + 1, c2 = s2.slice(0, a2), u2 = s2.slice(a2);
|
|
@@ -8902,8 +8860,8 @@ var bt = "__sc-".concat(a, "__");
|
|
|
8902
8860
|
"production" !== process.env.NODE_ENV && "test" !== process.env.NODE_ENV && "undefined" != typeof window && (window[bt] || (window[bt] = 0), 1 === window[bt] && console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info."), window[bt] += 1);
|
|
8903
8861
|
|
|
8904
8862
|
// src/components/EnvironmentI18nProvider.tsx
|
|
8905
|
-
|
|
8906
|
-
|
|
8863
|
+
|
|
8864
|
+
|
|
8907
8865
|
|
|
8908
8866
|
// src/utils/translations/translationCache.ts
|
|
8909
8867
|
var CACHE_KEY_PREFIX = "sg-saved-views-translations";
|
|
@@ -8915,26 +8873,26 @@ function readCache(locale) {
|
|
|
8915
8873
|
const raw = localStorage.getItem(cacheKey(locale));
|
|
8916
8874
|
if (!raw) return null;
|
|
8917
8875
|
return JSON.parse(raw);
|
|
8918
|
-
} catch {
|
|
8876
|
+
} catch (e5) {
|
|
8919
8877
|
return null;
|
|
8920
8878
|
}
|
|
8921
8879
|
}
|
|
8922
8880
|
function writeCache(locale, translations) {
|
|
8923
8881
|
try {
|
|
8924
8882
|
localStorage.setItem(cacheKey(locale), JSON.stringify(translations));
|
|
8925
|
-
} catch {
|
|
8883
|
+
} catch (e6) {
|
|
8926
8884
|
}
|
|
8927
8885
|
}
|
|
8928
8886
|
|
|
8929
8887
|
// src/components/EnvironmentI18nProvider.tsx
|
|
8930
|
-
var
|
|
8888
|
+
var _cdntranslations = require('@procore/cdn-translations');
|
|
8931
8889
|
var useCDNTranslations = () => {
|
|
8932
|
-
const i18n = (0,
|
|
8933
|
-
const cachedTranslations = (0,
|
|
8890
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
8891
|
+
const cachedTranslations = _react.useMemo.call(void 0,
|
|
8934
8892
|
() => readCache(i18n.locale),
|
|
8935
8893
|
[i18n.locale]
|
|
8936
8894
|
);
|
|
8937
|
-
const cdnTranslations = (0,
|
|
8895
|
+
const cdnTranslations = _cdntranslations.useRequestTranslations.call(void 0,
|
|
8938
8896
|
{
|
|
8939
8897
|
type: "file",
|
|
8940
8898
|
locale: i18n.locale,
|
|
@@ -8948,7 +8906,7 @@ var useCDNTranslations = () => {
|
|
|
8948
8906
|
enableCDN: i18n.enableCDN
|
|
8949
8907
|
}
|
|
8950
8908
|
);
|
|
8951
|
-
(0,
|
|
8909
|
+
_react.useEffect.call(void 0, () => {
|
|
8952
8910
|
if (cdnTranslations.status === "resolved" && cdnTranslations.translations) {
|
|
8953
8911
|
writeCache(
|
|
8954
8912
|
i18n.locale,
|
|
@@ -8956,35 +8914,41 @@ var useCDNTranslations = () => {
|
|
|
8956
8914
|
);
|
|
8957
8915
|
}
|
|
8958
8916
|
}, [cdnTranslations.status, cdnTranslations.translations, i18n.locale]);
|
|
8959
|
-
const translationsToUse = cdnTranslations.status === "resolved" ? cdnTranslations.translations : cachedTranslations
|
|
8960
|
-
return (0,
|
|
8917
|
+
const translationsToUse = cdnTranslations.status === "resolved" ? cdnTranslations.translations : _nullishCoalesce(cachedTranslations, () => ( getTranslations(i18n.locale)));
|
|
8918
|
+
return _corereact.useI18n.call(void 0, {
|
|
8961
8919
|
translations: translationsToUse,
|
|
8962
8920
|
locale: i18n.locale
|
|
8963
8921
|
});
|
|
8964
8922
|
};
|
|
8965
8923
|
var EnvironmentI18nProvider = ({ children }) => {
|
|
8966
8924
|
const i18n = useCDNTranslations();
|
|
8967
|
-
return /* @__PURE__ */
|
|
8925
|
+
return /* @__PURE__ */ React.default.createElement(_corereact.I18nContext.Provider, { value: i18n }, children);
|
|
8968
8926
|
};
|
|
8969
8927
|
|
|
8970
8928
|
// src/components/buttons/SavedViewsSelectionContext.tsx
|
|
8971
|
-
|
|
8972
|
-
|
|
8929
|
+
|
|
8930
|
+
|
|
8931
|
+
|
|
8932
|
+
|
|
8933
|
+
|
|
8934
|
+
|
|
8935
|
+
|
|
8936
|
+
var SavedViewsSelectionContext = _react.createContext.call(void 0, null);
|
|
8973
8937
|
var SavedViewsSelectionProvider = ({
|
|
8974
8938
|
children
|
|
8975
8939
|
}) => {
|
|
8976
|
-
const [selectedView, setSelectedView] = (0,
|
|
8977
|
-
const updateSelectedView = (0,
|
|
8940
|
+
const [selectedView, setSelectedView] = _react.useState.call(void 0, null);
|
|
8941
|
+
const updateSelectedView = _react.useCallback.call(void 0,
|
|
8978
8942
|
(view) => setSelectedView(view),
|
|
8979
8943
|
[]
|
|
8980
8944
|
);
|
|
8981
|
-
const value = (0,
|
|
8945
|
+
const value = _react.useMemo.call(void 0,
|
|
8982
8946
|
() => ({ selectedView, setSelectedView: updateSelectedView }),
|
|
8983
8947
|
[selectedView, updateSelectedView]
|
|
8984
8948
|
);
|
|
8985
|
-
return /* @__PURE__ */
|
|
8949
|
+
return /* @__PURE__ */ React.default.createElement(SavedViewsSelectionContext.Provider, { value }, children);
|
|
8986
8950
|
};
|
|
8987
|
-
var useSavedViewsSelection = () => (0,
|
|
8951
|
+
var useSavedViewsSelection = () => _react.useContext.call(void 0, SavedViewsSelectionContext);
|
|
8988
8952
|
|
|
8989
8953
|
// src/components/buttons/SavedViewsButton.tsx
|
|
8990
8954
|
var StyledIcon = pt(ExpandSidebar_default)`
|
|
@@ -9009,47 +8973,47 @@ var SavedViewsButton = ({
|
|
|
9009
8973
|
}) => {
|
|
9010
8974
|
const I18n = useCDNTranslations();
|
|
9011
8975
|
const selection = useSavedViewsSelection();
|
|
9012
|
-
const activeView = selection
|
|
9013
|
-
const activeName = activeView
|
|
9014
|
-
const activeType = activeView
|
|
8976
|
+
const activeView = _optionalChain([selection, 'optionalAccess', _2 => _2.selectedView]);
|
|
8977
|
+
const activeName = _optionalChain([activeView, 'optionalAccess', _5 => _5.name]);
|
|
8978
|
+
const activeType = _optionalChain([activeView, 'optionalAccess', _6 => _6.view_level]) ? I18n.t(`savedViews.button.viewLevel.${activeView.view_level}`) : "";
|
|
9015
8979
|
const label = activeName ? I18n.t("savedViews.button.titleWithView", {
|
|
9016
8980
|
name: activeName,
|
|
9017
8981
|
type: activeType
|
|
9018
8982
|
}) : I18n.t("savedViews.button.title");
|
|
9019
|
-
const button = /* @__PURE__ */
|
|
9020
|
-
|
|
8983
|
+
const button = /* @__PURE__ */ React.default.createElement(
|
|
8984
|
+
_corereact.ToggleButton,
|
|
9021
8985
|
{
|
|
9022
8986
|
selected: isOpen,
|
|
9023
8987
|
onClick: handleClick,
|
|
9024
|
-
icon: /* @__PURE__ */
|
|
8988
|
+
icon: /* @__PURE__ */ React.default.createElement(StyledIcon, { left: isOpen }),
|
|
9025
8989
|
"data-testid": "saved-views-button",
|
|
9026
8990
|
"aria-controls": "saved-views-panel",
|
|
9027
8991
|
"aria-label": label
|
|
9028
8992
|
},
|
|
9029
|
-
/* @__PURE__ */
|
|
8993
|
+
/* @__PURE__ */ React.default.createElement(Label, null, label)
|
|
9030
8994
|
);
|
|
9031
|
-
return /* @__PURE__ */
|
|
9032
|
-
|
|
8995
|
+
return /* @__PURE__ */ React.default.createElement(Container, null, activeName ? /* @__PURE__ */ React.default.createElement(
|
|
8996
|
+
_corereact.Tooltip,
|
|
9033
8997
|
{
|
|
9034
8998
|
showDelay: 500,
|
|
9035
|
-
overlay: /* @__PURE__ */
|
|
8999
|
+
overlay: /* @__PURE__ */ React.default.createElement(_corereact.Tooltip.Content, null, label)
|
|
9036
9000
|
},
|
|
9037
9001
|
button
|
|
9038
9002
|
) : button);
|
|
9039
9003
|
};
|
|
9040
9004
|
|
|
9041
9005
|
// src/components/buttons/useSavedViewsPanel.tsx
|
|
9042
|
-
|
|
9006
|
+
|
|
9043
9007
|
var useSavedViewsPanel = (domain, tableName) => {
|
|
9044
9008
|
const key = (domain2, tableName2) => `savedViewsPanel-${domain2}-${tableName2}`;
|
|
9045
|
-
const [isOpen, setIsOpen] = (0,
|
|
9009
|
+
const [isOpen, setIsOpen] = _react.useState.call(void 0,
|
|
9046
9010
|
localStorage.getItem(key(domain, tableName)) === null || localStorage.getItem(key(domain, tableName)) === "true"
|
|
9047
9011
|
);
|
|
9048
9012
|
const handleClick = () => {
|
|
9049
9013
|
setIsOpen(!isOpen);
|
|
9050
9014
|
localStorage.setItem(key(domain, tableName), JSON.stringify(!isOpen));
|
|
9051
9015
|
};
|
|
9052
|
-
const Button7 = () => /* @__PURE__ */
|
|
9016
|
+
const Button7 = () => /* @__PURE__ */ React.default.createElement(SavedViewsButton, { handleClick, isOpen });
|
|
9053
9017
|
return {
|
|
9054
9018
|
isOpen,
|
|
9055
9019
|
SavedViewsButton: Button7,
|
|
@@ -9059,10 +9023,36 @@ var useSavedViewsPanel = (domain, tableName) => {
|
|
|
9059
9023
|
var useSavedViewsPanel_default = useSavedViewsPanel;
|
|
9060
9024
|
|
|
9061
9025
|
// src/components/menu-items/SavedViewsCollectionsMenuItem.tsx
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9026
|
+
|
|
9027
|
+
|
|
9028
|
+
|
|
9029
|
+
|
|
9030
|
+
|
|
9031
|
+
|
|
9032
|
+
|
|
9033
|
+
|
|
9034
|
+
var _toastalert = require('@procore/toast-alert');
|
|
9035
|
+
|
|
9036
|
+
// src/transport/context.tsx
|
|
9037
|
+
|
|
9038
|
+
var SavedViewsTransportContext = _react.createContext.call(void 0, void 0);
|
|
9039
|
+
var SavedViewsTransportProvider = ({
|
|
9040
|
+
transport,
|
|
9041
|
+
children
|
|
9042
|
+
}) => /* @__PURE__ */ React.default.createElement(SavedViewsTransportContext.Provider, { value: transport }, children);
|
|
9043
|
+
var useSavedViewsTransport = () => {
|
|
9044
|
+
const transport = _react.useContext.call(void 0, SavedViewsTransportContext);
|
|
9045
|
+
if (!transport) {
|
|
9046
|
+
throw new Error(
|
|
9047
|
+
"useSavedViewsTransport must be used inside <SavedViews> (or a SavedViewsTransportProvider). This usually means a hook is being called outside the saved-views component tree."
|
|
9048
|
+
);
|
|
9049
|
+
}
|
|
9050
|
+
return transport;
|
|
9051
|
+
};
|
|
9052
|
+
var useOptionalSavedViewsTransport = () => _react.useContext.call(void 0, SavedViewsTransportContext);
|
|
9053
|
+
|
|
9054
|
+
// src/components/menu-items/SavedViewsCollectionsMenuItem.tsx
|
|
9055
|
+
var RowActionsBox = pt(_corereact.Flex)`
|
|
9066
9056
|
justify-content: center;
|
|
9067
9057
|
align-items: center;
|
|
9068
9058
|
|
|
@@ -9070,7 +9060,7 @@ var RowActionsBox = pt(import_core_react3.Flex)`
|
|
|
9070
9060
|
margin-right: 8px;
|
|
9071
9061
|
}
|
|
9072
9062
|
`;
|
|
9073
|
-
var Container2 = pt(
|
|
9063
|
+
var Container2 = pt(_corereact.Flex)`
|
|
9074
9064
|
overflow-wrap: anywhere;
|
|
9075
9065
|
min-height: 24px;
|
|
9076
9066
|
|
|
@@ -9082,17 +9072,17 @@ var IconWrapper = pt.span`
|
|
|
9082
9072
|
justify-content: center;
|
|
9083
9073
|
`;
|
|
9084
9074
|
var SavedViewCollectionMenuItem = (props) => {
|
|
9085
|
-
const onClick =
|
|
9075
|
+
const onClick = React17.useCallback(
|
|
9086
9076
|
(a2) => {
|
|
9087
9077
|
if (!props.item) {
|
|
9088
9078
|
return;
|
|
9089
9079
|
}
|
|
9090
9080
|
switch (a2.value) {
|
|
9091
9081
|
case "editNameDesc":
|
|
9092
|
-
props.onEdit
|
|
9082
|
+
_optionalChain([props, 'access', _7 => _7.onEdit, 'optionalCall', _8 => _8({ savedView: props.item })]);
|
|
9093
9083
|
break;
|
|
9094
9084
|
case "delete":
|
|
9095
|
-
props.onDelete
|
|
9085
|
+
_optionalChain([props, 'access', _9 => _9.onDelete, 'optionalCall', _10 => _10({ savedView: props.item })]);
|
|
9096
9086
|
break;
|
|
9097
9087
|
default:
|
|
9098
9088
|
break;
|
|
@@ -9102,10 +9092,12 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9102
9092
|
);
|
|
9103
9093
|
const updateItem = (event) => {
|
|
9104
9094
|
event.stopPropagation();
|
|
9105
|
-
props.onUpdate
|
|
9095
|
+
_optionalChain([props, 'access', _11 => _11.onUpdate, 'optionalCall', _12 => _12(props.item)]);
|
|
9106
9096
|
};
|
|
9107
|
-
const { showToast } = (0,
|
|
9108
|
-
const i18n = (0,
|
|
9097
|
+
const { showToast } = _toastalert.useToastAlertContext.call(void 0, );
|
|
9098
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
9099
|
+
const transport = useOptionalSavedViewsTransport();
|
|
9100
|
+
const canShareViaUrl = _optionalChain([transport, 'optionalAccess', _13 => _13.supportsUrlSharing]) !== false;
|
|
9109
9101
|
const copyShareLink = async (event) => {
|
|
9110
9102
|
event.stopPropagation();
|
|
9111
9103
|
try {
|
|
@@ -9128,18 +9120,18 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9128
9120
|
label: i18n.t("savedViews.actions.delete")
|
|
9129
9121
|
}
|
|
9130
9122
|
];
|
|
9131
|
-
const preventEventBubbleToNotTriggerViewSelectEvent =
|
|
9123
|
+
const preventEventBubbleToNotTriggerViewSelectEvent = React17.useCallback(
|
|
9132
9124
|
(e) => {
|
|
9133
9125
|
e.stopPropagation();
|
|
9134
9126
|
},
|
|
9135
9127
|
[]
|
|
9136
9128
|
);
|
|
9137
9129
|
const hasUpdateButton = props.item.view_level !== "default" && props.canUpdate;
|
|
9138
|
-
const hasCopyShareLinkButton = props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9130
|
+
const hasCopyShareLinkButton = canShareViaUrl && props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9139
9131
|
const hasClearTemporaryButton = props.item.id === "temporary";
|
|
9140
9132
|
const hasOverflowMenu = props.item.view_level !== "default" && props.canEditOrDelete;
|
|
9141
9133
|
const hasActions = hasUpdateButton || hasCopyShareLinkButton || hasClearTemporaryButton || hasOverflowMenu;
|
|
9142
|
-
return /* @__PURE__ */
|
|
9134
|
+
return /* @__PURE__ */ React17.createElement(
|
|
9143
9135
|
Container2,
|
|
9144
9136
|
{
|
|
9145
9137
|
"aria-selected": Boolean(props.selected),
|
|
@@ -9151,7 +9143,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9151
9143
|
"data-testid": "saved-view-collection-menu-item",
|
|
9152
9144
|
onKeyDown: preventEventBubbleToNotTriggerViewSelectEvent
|
|
9153
9145
|
},
|
|
9154
|
-
/* @__PURE__ */
|
|
9146
|
+
/* @__PURE__ */ React17.createElement(
|
|
9155
9147
|
"span",
|
|
9156
9148
|
{
|
|
9157
9149
|
"data-testid": "saved-view-display-name",
|
|
@@ -9159,8 +9151,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9159
9151
|
},
|
|
9160
9152
|
props.item.name
|
|
9161
9153
|
),
|
|
9162
|
-
hasActions && /* @__PURE__ */
|
|
9163
|
-
|
|
9154
|
+
hasActions && /* @__PURE__ */ React17.createElement(RowActionsBox, null, /* @__PURE__ */ React17.createElement(_corereact.Box, { justifyContent: "space-between" }, hasUpdateButton && /* @__PURE__ */ React17.createElement(
|
|
9155
|
+
_corereact.Button,
|
|
9164
9156
|
{
|
|
9165
9157
|
onClick: updateItem,
|
|
9166
9158
|
variant: "secondary",
|
|
@@ -9170,8 +9162,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9170
9162
|
loading: props.isUpdateProcessing
|
|
9171
9163
|
},
|
|
9172
9164
|
i18n.t("savedViews.actions.update")
|
|
9173
|
-
), hasCopyShareLinkButton && /* @__PURE__ */
|
|
9174
|
-
|
|
9165
|
+
), hasCopyShareLinkButton && /* @__PURE__ */ React17.createElement(
|
|
9166
|
+
_corereact.Button,
|
|
9175
9167
|
{
|
|
9176
9168
|
onClick: copyShareLink,
|
|
9177
9169
|
variant: "tertiary",
|
|
@@ -9179,13 +9171,13 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9179
9171
|
"aria-label": i18n.t("savedViews.actions.copyShareLink"),
|
|
9180
9172
|
"data-testid": "copy-share-link-button"
|
|
9181
9173
|
},
|
|
9182
|
-
/* @__PURE__ */
|
|
9183
|
-
), hasClearTemporaryButton && /* @__PURE__ */
|
|
9184
|
-
|
|
9174
|
+
/* @__PURE__ */ React17.createElement(IconWrapper, null, /* @__PURE__ */ React17.createElement(Link_default, { size: "sm" }))
|
|
9175
|
+
), hasClearTemporaryButton && /* @__PURE__ */ React17.createElement(
|
|
9176
|
+
_corereact.Button,
|
|
9185
9177
|
{
|
|
9186
9178
|
onClick: (e) => {
|
|
9187
9179
|
e.stopPropagation();
|
|
9188
|
-
props.onClearTemporary
|
|
9180
|
+
_optionalChain([props, 'access', _14 => _14.onClearTemporary, 'optionalCall', _15 => _15()]);
|
|
9189
9181
|
},
|
|
9190
9182
|
variant: "tertiary",
|
|
9191
9183
|
size: "sm",
|
|
@@ -9193,9 +9185,9 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9193
9185
|
title: i18n.t("savedViews.actions.clearTemporary"),
|
|
9194
9186
|
"data-testid": "clear-temporary-view-button"
|
|
9195
9187
|
},
|
|
9196
|
-
/* @__PURE__ */
|
|
9197
|
-
)), /* @__PURE__ */
|
|
9198
|
-
|
|
9188
|
+
/* @__PURE__ */ React17.createElement(IconWrapper, null, /* @__PURE__ */ React17.createElement(Clear_default, { size: "sm" }))
|
|
9189
|
+
)), /* @__PURE__ */ React17.createElement(_corereact.Box, null, hasOverflowMenu && /* @__PURE__ */ React17.createElement(
|
|
9190
|
+
_corereact.DropdownFlyout,
|
|
9199
9191
|
{
|
|
9200
9192
|
"data-testid": "saved-view-overflow-button",
|
|
9201
9193
|
options: flyoutMenuOptions,
|
|
@@ -9210,26 +9202,20 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9210
9202
|
};
|
|
9211
9203
|
|
|
9212
9204
|
// src/components/panels/ExpandedPanel.tsx
|
|
9213
|
-
|
|
9214
|
-
var ExpandedPanel = pt(
|
|
9205
|
+
|
|
9206
|
+
var ExpandedPanel = pt(_corereact.Panel)`
|
|
9215
9207
|
width: ${({ provider }) => provider === "data-table" ? "316px" : "100%"};
|
|
9216
9208
|
height: 100%;
|
|
9217
9209
|
border-radius: 4px 0 0 4px;
|
|
9218
9210
|
`;
|
|
9219
9211
|
|
|
9220
9212
|
// src/components/panels/PanelContent.tsx
|
|
9221
|
-
var import_core_react8 = require("@procore/core-react");
|
|
9222
|
-
var import_toast_alert2 = require("@procore/toast-alert");
|
|
9223
|
-
var import_react10 = __toESM(require("react"));
|
|
9224
9213
|
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
var import_react_query2 = require("@tanstack/react-query");
|
|
9214
|
+
|
|
9215
|
+
|
|
9228
9216
|
|
|
9229
9217
|
// src/utils/api/queriesHandler.ts
|
|
9230
|
-
|
|
9231
|
-
var import_react_query = require("@tanstack/react-query");
|
|
9232
|
-
var import_core_react5 = require("@procore/core-react");
|
|
9218
|
+
|
|
9233
9219
|
var getBasePath = (companyId, projectId) => {
|
|
9234
9220
|
if (projectId) {
|
|
9235
9221
|
return `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views`;
|
|
@@ -9238,22 +9224,39 @@ var getBasePath = (companyId, projectId) => {
|
|
|
9238
9224
|
};
|
|
9239
9225
|
var useApiRequest = (props, method, mutationKey) => {
|
|
9240
9226
|
const { projectId, companyId, domain, tableName } = props;
|
|
9241
|
-
const
|
|
9242
|
-
const
|
|
9227
|
+
const transport = useSavedViewsTransport();
|
|
9228
|
+
const http = transport.useHttp();
|
|
9229
|
+
const cacheControl = transport.useCacheControl();
|
|
9230
|
+
const { locale } = _corereact.useI18nContext.call(void 0, );
|
|
9243
9231
|
const basePath = getBasePath(companyId, projectId);
|
|
9244
|
-
const queryKey = [
|
|
9245
|
-
|
|
9232
|
+
const queryKey = [
|
|
9233
|
+
"savedViews",
|
|
9234
|
+
domain,
|
|
9235
|
+
tableName,
|
|
9236
|
+
companyId,
|
|
9237
|
+
projectId
|
|
9238
|
+
];
|
|
9239
|
+
return transport.useMutationAdapter({
|
|
9246
9240
|
mutationKey,
|
|
9247
9241
|
mutationFn: async (savedView) => {
|
|
9248
|
-
let url =
|
|
9249
|
-
|
|
9242
|
+
let url = basePath;
|
|
9243
|
+
let body = { ...savedView };
|
|
9244
|
+
if (method === "DELETE") {
|
|
9250
9245
|
url = `${basePath}/${savedView.share_token}?permissions_domain=${domain}`;
|
|
9246
|
+
} else if (method === "PUT") {
|
|
9247
|
+
url = `${basePath}/${savedView.share_token}`;
|
|
9248
|
+
body = { ...savedView, permissions_domain: domain };
|
|
9251
9249
|
} else {
|
|
9252
|
-
|
|
9250
|
+
body = {
|
|
9251
|
+
...savedView,
|
|
9252
|
+
table_name: tableName,
|
|
9253
|
+
permissions_domain: domain
|
|
9254
|
+
};
|
|
9253
9255
|
}
|
|
9254
|
-
const response = await (
|
|
9256
|
+
const response = await http({
|
|
9255
9257
|
method,
|
|
9256
|
-
|
|
9258
|
+
url,
|
|
9259
|
+
body: JSON.stringify(body),
|
|
9257
9260
|
headers: {
|
|
9258
9261
|
"Content-Type": "application/json",
|
|
9259
9262
|
"Accept-Language": locale
|
|
@@ -9266,23 +9269,19 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
9266
9269
|
},
|
|
9267
9270
|
onSuccess: (savedView) => {
|
|
9268
9271
|
if (method === "DELETE" || method === "POST") {
|
|
9269
|
-
|
|
9270
|
-
queryKey
|
|
9271
|
-
});
|
|
9272
|
+
cacheControl.invalidate(queryKey);
|
|
9272
9273
|
return;
|
|
9273
9274
|
} else {
|
|
9274
|
-
const oldData =
|
|
9275
|
-
const oldView = oldData
|
|
9275
|
+
const oldData = cacheControl.getData(queryKey);
|
|
9276
|
+
const oldView = _optionalChain([oldData, 'optionalAccess', _16 => _16.find, 'call', _17 => _17(
|
|
9276
9277
|
(item) => item.share_token === savedView.share_token
|
|
9277
|
-
);
|
|
9278
|
-
if (oldView
|
|
9279
|
-
|
|
9280
|
-
queryKey
|
|
9281
|
-
});
|
|
9278
|
+
)]);
|
|
9279
|
+
if (_optionalChain([oldView, 'optionalAccess', _18 => _18.name]) !== savedView.name) {
|
|
9280
|
+
cacheControl.invalidate(queryKey);
|
|
9282
9281
|
return;
|
|
9283
9282
|
}
|
|
9284
9283
|
}
|
|
9285
|
-
|
|
9284
|
+
cacheControl.setData(queryKey, (oldData) => {
|
|
9286
9285
|
if (!oldData) return [savedView];
|
|
9287
9286
|
return oldData.map(
|
|
9288
9287
|
(item) => item.share_token === savedView.share_token ? savedView : item
|
|
@@ -9311,13 +9310,17 @@ var getBasePath2 = (companyId, projectId) => {
|
|
|
9311
9310
|
};
|
|
9312
9311
|
var useSavedViewsQuery = (props) => {
|
|
9313
9312
|
const { projectId, companyId, domain, tableName } = props;
|
|
9313
|
+
const transport = useSavedViewsTransport();
|
|
9314
|
+
const http = transport.useHttp();
|
|
9314
9315
|
const basePath = getBasePath2(companyId, projectId);
|
|
9315
9316
|
const url = `${basePath}?table_name=${tableName}&permissions_domain=${domain}`;
|
|
9316
|
-
return
|
|
9317
|
+
return transport.useQueryAdapter({
|
|
9317
9318
|
queryKey: ["savedViews", domain, tableName, companyId, projectId],
|
|
9318
9319
|
queryFn: async () => {
|
|
9319
9320
|
const getUrl = `${url}&per_page=${PAGE_SIZE}`;
|
|
9320
|
-
const response = await (
|
|
9321
|
+
const response = await http({
|
|
9322
|
+
method: "GET",
|
|
9323
|
+
url: getUrl,
|
|
9321
9324
|
priority: "low"
|
|
9322
9325
|
});
|
|
9323
9326
|
return response.data;
|
|
@@ -9326,12 +9329,16 @@ var useSavedViewsQuery = (props) => {
|
|
|
9326
9329
|
};
|
|
9327
9330
|
var useSavedViewsPermissions = (props) => {
|
|
9328
9331
|
const { projectId, companyId, domain } = props;
|
|
9332
|
+
const transport = useSavedViewsTransport();
|
|
9333
|
+
const http = transport.useHttp();
|
|
9329
9334
|
const basePath = getBasePath2(companyId, projectId);
|
|
9330
9335
|
const url = `${basePath}/permissions?permissions_domain=${domain}`;
|
|
9331
|
-
return
|
|
9336
|
+
return transport.useQueryAdapter({
|
|
9332
9337
|
queryKey: ["savedViewsConfig", domain, companyId, projectId],
|
|
9333
9338
|
queryFn: async () => {
|
|
9334
|
-
const response = await (
|
|
9339
|
+
const response = await http({
|
|
9340
|
+
method: "GET",
|
|
9341
|
+
url,
|
|
9335
9342
|
priority: "low"
|
|
9336
9343
|
});
|
|
9337
9344
|
return response.data;
|
|
@@ -9355,13 +9362,17 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
|
|
|
9355
9362
|
]);
|
|
9356
9363
|
var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
9357
9364
|
const { projectId, companyId, domain } = queryInput;
|
|
9365
|
+
const transport = useSavedViewsTransport();
|
|
9366
|
+
const http = transport.useHttp();
|
|
9358
9367
|
const basePath = getBasePath2(companyId, projectId);
|
|
9359
|
-
return
|
|
9368
|
+
return transport.useQueryAdapter({
|
|
9360
9369
|
enabled: enabled && Boolean(savedViewToken),
|
|
9361
9370
|
queryKey: ["savedView", savedViewToken, companyId, projectId],
|
|
9362
9371
|
queryFn: async () => {
|
|
9363
9372
|
const url = `${basePath}/${savedViewToken}?permissions_domain=${domain}`;
|
|
9364
|
-
const response = await (
|
|
9373
|
+
const response = await http({
|
|
9374
|
+
method: "GET",
|
|
9375
|
+
url,
|
|
9365
9376
|
priority: "low"
|
|
9366
9377
|
});
|
|
9367
9378
|
return response.data;
|
|
@@ -9370,14 +9381,14 @@ var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
|
9370
9381
|
};
|
|
9371
9382
|
|
|
9372
9383
|
// src/components/panels/PanelContentUtils.ts
|
|
9373
|
-
var import_lodash = __toESM(require_lodash());
|
|
9384
|
+
var import_lodash = _chunkQGM4M3NIjs.__toESM.call(void 0, require_lodash());
|
|
9374
9385
|
|
|
9375
9386
|
// src/components/adapters/smart-grid/SmartGridUtils.ts
|
|
9376
9387
|
function getSmartGridConfig(api) {
|
|
9377
9388
|
const columnState = api.getColumnState();
|
|
9378
9389
|
const columnGroupState = api.getColumnGroupState();
|
|
9379
9390
|
const rowGroupState = api.getRowGroupColumns().map((col) => col.getColId());
|
|
9380
|
-
const rowHeight = api.getGridOption("rowHeight")
|
|
9391
|
+
const rowHeight = _nullishCoalesce(api.getGridOption("rowHeight"), () => ( api.getSizesForCurrentTheme().rowHeight));
|
|
9381
9392
|
const filterState = api.getFilterModel();
|
|
9382
9393
|
return {
|
|
9383
9394
|
columnState,
|
|
@@ -9402,8 +9413,8 @@ function setSmartGridConfig(api, config) {
|
|
|
9402
9413
|
// src/components/saved-views/SavedViewsUtils.ts
|
|
9403
9414
|
var customAndConfigSync = (viewTableConfig, defaultTableConfig) => {
|
|
9404
9415
|
if (!viewTableConfig && !defaultTableConfig) return void 0;
|
|
9405
|
-
if (!viewTableConfig
|
|
9406
|
-
if (!defaultTableConfig
|
|
9416
|
+
if (!_optionalChain([viewTableConfig, 'optionalAccess', _19 => _19.columnState])) return defaultTableConfig;
|
|
9417
|
+
if (!_optionalChain([defaultTableConfig, 'optionalAccess', _20 => _20.columnState])) return viewTableConfig;
|
|
9407
9418
|
const viewColumns = viewTableConfig.columnState;
|
|
9408
9419
|
const defaultViewColumns = defaultTableConfig.columnState;
|
|
9409
9420
|
if (!Array.isArray(viewColumns) || !Array.isArray(defaultViewColumns))
|
|
@@ -9446,20 +9457,20 @@ var updateTableConfig = (view, tableApi, provider) => {
|
|
|
9446
9457
|
const dataTableApi = tableApi;
|
|
9447
9458
|
const tableConfig = view.table_config;
|
|
9448
9459
|
if (tableConfig) {
|
|
9449
|
-
const currentTableConfig = dataTableApi
|
|
9450
|
-
const rowHeight = tableConfig
|
|
9451
|
-
const hasServerFilters = Boolean(currentTableConfig
|
|
9460
|
+
const currentTableConfig = _optionalChain([dataTableApi, 'optionalAccess', _21 => _21.getTableConfiguration, 'optionalCall', _22 => _22()]);
|
|
9461
|
+
const rowHeight = _nullishCoalesce(_optionalChain([tableConfig, 'optionalAccess', _23 => _23.rowHeight]), () => ( _optionalChain([currentTableConfig, 'optionalAccess', _24 => _24.rowHeight])));
|
|
9462
|
+
const hasServerFilters = Boolean(_optionalChain([currentTableConfig, 'optionalAccess', _25 => _25.serverFilters, 'optionalAccess', _26 => _26.length])) || Boolean(_optionalChain([tableConfig, 'optionalAccess', _27 => _27.serverFilters, 'optionalAccess', _28 => _28.length]));
|
|
9452
9463
|
const usesServerSideFiltering = hasServerFilters;
|
|
9453
9464
|
if (rowHeight !== void 0) {
|
|
9454
|
-
dataTableApi
|
|
9465
|
+
_optionalChain([dataTableApi, 'optionalAccess', _29 => _29.setRowHeight, 'call', _30 => _30(rowHeight)]);
|
|
9455
9466
|
}
|
|
9456
9467
|
if (usesServerSideFiltering) {
|
|
9457
|
-
dataTableApi
|
|
9468
|
+
_optionalChain([dataTableApi, 'optionalAccess', _31 => _31.setTableConfiguration, 'call', _32 => _32({
|
|
9458
9469
|
...tableConfig,
|
|
9459
9470
|
filters: void 0
|
|
9460
|
-
});
|
|
9471
|
+
})]);
|
|
9461
9472
|
} else {
|
|
9462
|
-
dataTableApi
|
|
9473
|
+
_optionalChain([dataTableApi, 'optionalAccess', _33 => _33.setTableConfiguration, 'call', _34 => _34(tableConfig)]);
|
|
9463
9474
|
}
|
|
9464
9475
|
}
|
|
9465
9476
|
}
|
|
@@ -9526,7 +9537,7 @@ var cleanObject = (table_config, provider) => {
|
|
|
9526
9537
|
};
|
|
9527
9538
|
} else {
|
|
9528
9539
|
const dataTableConfig = table_config;
|
|
9529
|
-
if (!dataTableConfig
|
|
9540
|
+
if (!_optionalChain([dataTableConfig, 'optionalAccess', _35 => _35.serverFilters])) return table_config;
|
|
9530
9541
|
const orderedColumns = getOrderedVisibleColumns(
|
|
9531
9542
|
dataTableConfig.columnState,
|
|
9532
9543
|
"field"
|
|
@@ -9543,7 +9554,7 @@ var cleanObject = (table_config, provider) => {
|
|
|
9543
9554
|
}
|
|
9544
9555
|
};
|
|
9545
9556
|
var normalizeForComparison = (config) => {
|
|
9546
|
-
if (!config
|
|
9557
|
+
if (!_optionalChain([config, 'optionalAccess', _36 => _36.columnState])) return config;
|
|
9547
9558
|
return {
|
|
9548
9559
|
...config,
|
|
9549
9560
|
columnState: config.columnState.map((col) => {
|
|
@@ -9572,19 +9583,19 @@ var hasPermissionForViewLevel = (viewLevel, permissions) => {
|
|
|
9572
9583
|
case "personal":
|
|
9573
9584
|
return true;
|
|
9574
9585
|
case "project":
|
|
9575
|
-
return permissions
|
|
9586
|
+
return _optionalChain([permissions, 'optionalAccess', _37 => _37.can_create_project_saved_views]);
|
|
9576
9587
|
case "company":
|
|
9577
|
-
return permissions
|
|
9588
|
+
return _optionalChain([permissions, 'optionalAccess', _38 => _38.can_create_company_saved_views]);
|
|
9578
9589
|
default:
|
|
9579
9590
|
return false;
|
|
9580
9591
|
}
|
|
9581
9592
|
};
|
|
9582
9593
|
|
|
9583
9594
|
// src/components/panels/useGroups.ts
|
|
9584
|
-
|
|
9595
|
+
|
|
9585
9596
|
var useGroups = (isProjectLevelTool) => {
|
|
9586
9597
|
const viewLevels = getViewLevels(isProjectLevelTool);
|
|
9587
|
-
const [groups, setGroups] = (0,
|
|
9598
|
+
const [groups, setGroups] = _react.useState.call(void 0,
|
|
9588
9599
|
Object.fromEntries(viewLevels.map((level) => [level, true]))
|
|
9589
9600
|
);
|
|
9590
9601
|
const toggleGroup = (group) => {
|
|
@@ -9594,26 +9605,32 @@ var useGroups = (isProjectLevelTool) => {
|
|
|
9594
9605
|
};
|
|
9595
9606
|
|
|
9596
9607
|
// src/components/panels/ViewLevelHeader.tsx
|
|
9597
|
-
|
|
9598
|
-
|
|
9608
|
+
|
|
9609
|
+
|
|
9610
|
+
|
|
9611
|
+
|
|
9612
|
+
|
|
9613
|
+
|
|
9614
|
+
|
|
9615
|
+
|
|
9599
9616
|
var groupIcon = (group) => {
|
|
9600
9617
|
switch (group) {
|
|
9601
9618
|
case "personal":
|
|
9602
|
-
return /* @__PURE__ */
|
|
9619
|
+
return /* @__PURE__ */ React.default.createElement(Person_default, null);
|
|
9603
9620
|
case "project":
|
|
9604
|
-
return /* @__PURE__ */
|
|
9621
|
+
return /* @__PURE__ */ React.default.createElement(Excavator_default, null);
|
|
9605
9622
|
case "company":
|
|
9606
|
-
return /* @__PURE__ */
|
|
9623
|
+
return /* @__PURE__ */ React.default.createElement(Building_default, null);
|
|
9607
9624
|
}
|
|
9608
9625
|
};
|
|
9609
|
-
var StyledButton = pt(
|
|
9626
|
+
var StyledButton = pt(_corereact.Button)`
|
|
9610
9627
|
&:hover {
|
|
9611
|
-
background-color: ${
|
|
9628
|
+
background-color: ${_corereact.colors.gray98};
|
|
9612
9629
|
}
|
|
9613
9630
|
`;
|
|
9614
9631
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9615
|
-
const I18n = (0,
|
|
9616
|
-
return /* @__PURE__ */
|
|
9632
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9633
|
+
return /* @__PURE__ */ React.default.createElement(_corereact.Box, { style: { width: "100%" } }, /* @__PURE__ */ React.default.createElement(
|
|
9617
9634
|
StyledButton,
|
|
9618
9635
|
{
|
|
9619
9636
|
block: true,
|
|
@@ -9626,19 +9643,19 @@ var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
|
9626
9643
|
onClick: () => toggleGroup(group),
|
|
9627
9644
|
"aria-controls": `saved-views-collections-${group}`,
|
|
9628
9645
|
"aria-expanded": expanded,
|
|
9629
|
-
icon: expanded ? /* @__PURE__ */
|
|
9646
|
+
icon: expanded ? /* @__PURE__ */ React.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React.default.createElement(ChevronRight_default, { size: "sm" })
|
|
9630
9647
|
},
|
|
9631
9648
|
groupIcon(group),
|
|
9632
|
-
/* @__PURE__ */
|
|
9649
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9633
9650
|
));
|
|
9634
9651
|
};
|
|
9635
9652
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9636
9653
|
|
|
9637
9654
|
// src/utils/hooks/useScrollToRef.ts
|
|
9638
|
-
|
|
9655
|
+
|
|
9639
9656
|
var useScrollToRef = (dependency) => {
|
|
9640
|
-
const ref = (0,
|
|
9641
|
-
(0,
|
|
9657
|
+
const ref = _react.useRef.call(void 0, null);
|
|
9658
|
+
_react.useEffect.call(void 0, () => {
|
|
9642
9659
|
if (ref.current) {
|
|
9643
9660
|
ref.current.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
9644
9661
|
}
|
|
@@ -9647,41 +9664,46 @@ var useScrollToRef = (dependency) => {
|
|
|
9647
9664
|
};
|
|
9648
9665
|
|
|
9649
9666
|
// src/components/panels/PanelContent.styles.ts
|
|
9650
|
-
|
|
9651
|
-
|
|
9667
|
+
|
|
9668
|
+
|
|
9669
|
+
|
|
9670
|
+
|
|
9671
|
+
|
|
9672
|
+
|
|
9673
|
+
var Row = pt(_corereact.MenuImperative.Item)`
|
|
9652
9674
|
width: 100%;
|
|
9653
9675
|
padding-left: 35px;
|
|
9654
9676
|
padding-right: 4px;
|
|
9655
|
-
background-color: ${({ selected }) => selected ?
|
|
9677
|
+
background-color: ${({ selected }) => selected ? _corereact.colors.blue96 : "transparent"};
|
|
9656
9678
|
|
|
9657
9679
|
&:hover {
|
|
9658
|
-
background-color: ${({ selected }) => selected ?
|
|
9680
|
+
background-color: ${({ selected }) => selected ? _corereact.colors.blue96 : _corereact.colors.gray98};
|
|
9659
9681
|
}
|
|
9660
9682
|
`;
|
|
9661
|
-
var Panel2 = pt(
|
|
9683
|
+
var Panel2 = pt(_corereact.DetailPage.Card)`
|
|
9662
9684
|
margin: 0;
|
|
9663
9685
|
height: 100%;
|
|
9664
|
-
padding-top: ${
|
|
9686
|
+
padding-top: ${_corereact.spacing.sm}px;
|
|
9665
9687
|
box-shadow: none;
|
|
9666
9688
|
`;
|
|
9667
9689
|
|
|
9668
9690
|
// src/components/panels/PanelContent.tsx
|
|
9669
|
-
var StyledMenuImperative = pt(
|
|
9691
|
+
var StyledMenuImperative = pt(_corereact.MenuImperative)`
|
|
9670
9692
|
div[role='listbox'] {
|
|
9671
9693
|
padding: 0;
|
|
9672
9694
|
}
|
|
9673
9695
|
`;
|
|
9674
9696
|
var PanelContent = (props) => {
|
|
9675
9697
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9676
|
-
const { showToast } = (0,
|
|
9677
|
-
const I18n = (0,
|
|
9698
|
+
const { showToast } = _toastalert.useToastAlertContext.call(void 0, );
|
|
9699
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9678
9700
|
const { data: savedViewsFromQuery, error: savedViewsError } = useSavedViewsQuery(props.queryInput);
|
|
9679
9701
|
const updateMutation = useUpdateSavedView(queryInput);
|
|
9680
9702
|
const { mutate: updateSavedView } = updateMutation;
|
|
9681
|
-
const isUpdateLoading =
|
|
9682
|
-
const savedViews = props.savedViews
|
|
9683
|
-
const errorToastRef =
|
|
9684
|
-
|
|
9703
|
+
const isUpdateLoading = updateMutation.isPending;
|
|
9704
|
+
const savedViews = _nullishCoalesce(props.savedViews, () => ( savedViewsFromQuery));
|
|
9705
|
+
const errorToastRef = React.default.useRef(null);
|
|
9706
|
+
React.default.useEffect(() => {
|
|
9685
9707
|
if (savedViewsError && savedViewsError !== errorToastRef.current) {
|
|
9686
9708
|
showToast.error(I18n.t("savedViews.errors.fetch"));
|
|
9687
9709
|
errorToastRef.current = savedViewsError;
|
|
@@ -9689,8 +9711,8 @@ var PanelContent = (props) => {
|
|
|
9689
9711
|
}, [savedViewsError, showToast, I18n]);
|
|
9690
9712
|
const { data: permissions } = useSavedViewsPermissions(props.queryInput);
|
|
9691
9713
|
const selectedRowRef = useScrollToRef(savedViews);
|
|
9692
|
-
const isTemporarySelected = selectedSavedView
|
|
9693
|
-
const temporaryView = savedViews
|
|
9714
|
+
const isTemporarySelected = _optionalChain([selectedSavedView, 'optionalAccess', _39 => _39.id]) === "temporary";
|
|
9715
|
+
const temporaryView = _optionalChain([savedViews, 'optionalAccess', _40 => _40.find, 'call', _41 => _41((view) => view.id === "temporary")]);
|
|
9694
9716
|
const presetViews = props.presetViews || [props.defaultView];
|
|
9695
9717
|
const isProjectLevelTool = !!queryInput.projectId;
|
|
9696
9718
|
const viewLevels = getViewLevels(isProjectLevelTool);
|
|
@@ -9711,17 +9733,17 @@ var PanelContent = (props) => {
|
|
|
9711
9733
|
}
|
|
9712
9734
|
});
|
|
9713
9735
|
};
|
|
9714
|
-
return /* @__PURE__ */
|
|
9736
|
+
return /* @__PURE__ */ React.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ React.default.createElement(_corereact.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, (temporaryView || presetViews) && /* @__PURE__ */ React.default.createElement(
|
|
9715
9737
|
StyledMenuImperative,
|
|
9716
9738
|
{
|
|
9717
9739
|
role: "listbox",
|
|
9718
9740
|
onSelect: (selection) => {
|
|
9719
|
-
if (selectedSavedView
|
|
9741
|
+
if (_optionalChain([selectedSavedView, 'optionalAccess', _42 => _42.id]) !== selection.item.id) {
|
|
9720
9742
|
props.onSelect({ item: selection.item });
|
|
9721
9743
|
}
|
|
9722
9744
|
}
|
|
9723
9745
|
},
|
|
9724
|
-
/* @__PURE__ */
|
|
9746
|
+
/* @__PURE__ */ React.default.createElement(_corereact.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ React.default.createElement(
|
|
9725
9747
|
Row,
|
|
9726
9748
|
{
|
|
9727
9749
|
key: temporaryView.id,
|
|
@@ -9730,7 +9752,7 @@ var PanelContent = (props) => {
|
|
|
9730
9752
|
"aria-current": isTemporarySelected ? "true" : void 0,
|
|
9731
9753
|
ref: isTemporarySelected ? selectedRowRef : null
|
|
9732
9754
|
},
|
|
9733
|
-
/* @__PURE__ */
|
|
9755
|
+
/* @__PURE__ */ React.default.createElement(
|
|
9734
9756
|
SavedViewCollectionMenuItem,
|
|
9735
9757
|
{
|
|
9736
9758
|
item: temporaryView,
|
|
@@ -9739,8 +9761,8 @@ var PanelContent = (props) => {
|
|
|
9739
9761
|
}
|
|
9740
9762
|
)
|
|
9741
9763
|
), presetViews.map((presetView) => {
|
|
9742
|
-
const isSelected = selectedSavedView
|
|
9743
|
-
return /* @__PURE__ */
|
|
9764
|
+
const isSelected = _optionalChain([selectedSavedView, 'optionalAccess', _43 => _43.id]) === presetView.id;
|
|
9765
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
9744
9766
|
Row,
|
|
9745
9767
|
{
|
|
9746
9768
|
key: presetView.id,
|
|
@@ -9749,7 +9771,7 @@ var PanelContent = (props) => {
|
|
|
9749
9771
|
"aria-current": isSelected ? "true" : void 0,
|
|
9750
9772
|
ref: isSelected ? selectedRowRef : null
|
|
9751
9773
|
},
|
|
9752
|
-
/* @__PURE__ */
|
|
9774
|
+
/* @__PURE__ */ React.default.createElement(
|
|
9753
9775
|
SavedViewCollectionMenuItem,
|
|
9754
9776
|
{
|
|
9755
9777
|
item: presetView,
|
|
@@ -9763,26 +9785,26 @@ var PanelContent = (props) => {
|
|
|
9763
9785
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
9764
9786
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
9765
9787
|
) : [];
|
|
9766
|
-
return /* @__PURE__ */
|
|
9788
|
+
return /* @__PURE__ */ React.default.createElement(React.default.Fragment, { key: level }, /* @__PURE__ */ React.default.createElement(
|
|
9767
9789
|
ViewLevelHeader_default,
|
|
9768
9790
|
{
|
|
9769
9791
|
group: level,
|
|
9770
9792
|
toggleGroup,
|
|
9771
9793
|
expanded: isExpanded
|
|
9772
9794
|
}
|
|
9773
|
-
), isExpanded && views.length > 0 && /* @__PURE__ */
|
|
9795
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ React.default.createElement(
|
|
9774
9796
|
StyledMenuImperative,
|
|
9775
9797
|
{
|
|
9776
9798
|
id: `saved-views-collections-${level}`,
|
|
9777
9799
|
role: "listbox",
|
|
9778
9800
|
onSelect: (selection) => {
|
|
9779
|
-
if (selectedSavedView
|
|
9801
|
+
if (_optionalChain([selectedSavedView, 'optionalAccess', _44 => _44.id]) !== selection.item.id) {
|
|
9780
9802
|
props.onSelect({ item: selection.item });
|
|
9781
9803
|
}
|
|
9782
9804
|
}
|
|
9783
9805
|
},
|
|
9784
|
-
/* @__PURE__ */
|
|
9785
|
-
const isSelected = selectedSavedView
|
|
9806
|
+
/* @__PURE__ */ React.default.createElement(_corereact.MenuImperative.Options, null, views.map((view) => {
|
|
9807
|
+
const isSelected = _optionalChain([selectedSavedView, 'optionalAccess', _45 => _45.id]) === view.id;
|
|
9786
9808
|
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
9787
9809
|
view.view_level,
|
|
9788
9810
|
permissions
|
|
@@ -9793,7 +9815,7 @@ var PanelContent = (props) => {
|
|
|
9793
9815
|
props.provider
|
|
9794
9816
|
);
|
|
9795
9817
|
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
9796
|
-
return /* @__PURE__ */
|
|
9818
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
9797
9819
|
Row,
|
|
9798
9820
|
{
|
|
9799
9821
|
key: view.id,
|
|
@@ -9802,7 +9824,7 @@ var PanelContent = (props) => {
|
|
|
9802
9824
|
"aria-current": isSelected ? "true" : void 0,
|
|
9803
9825
|
ref: isSelected ? selectedRowRef : null
|
|
9804
9826
|
},
|
|
9805
|
-
/* @__PURE__ */
|
|
9827
|
+
/* @__PURE__ */ React.default.createElement(
|
|
9806
9828
|
SavedViewCollectionMenuItem,
|
|
9807
9829
|
{
|
|
9808
9830
|
item: view,
|
|
@@ -9824,22 +9846,34 @@ var PanelContent = (props) => {
|
|
|
9824
9846
|
};
|
|
9825
9847
|
|
|
9826
9848
|
// src/components/saved-views/SavedViews.tsx
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9849
|
+
|
|
9850
|
+
|
|
9851
|
+
|
|
9852
|
+
|
|
9853
|
+
|
|
9854
|
+
|
|
9855
|
+
|
|
9856
|
+
|
|
9857
|
+
|
|
9858
|
+
|
|
9831
9859
|
|
|
9832
9860
|
// src/components/modals/DeleteConfirmationModal.tsx
|
|
9833
|
-
|
|
9834
|
-
|
|
9861
|
+
|
|
9862
|
+
|
|
9863
|
+
|
|
9864
|
+
|
|
9865
|
+
|
|
9866
|
+
|
|
9867
|
+
|
|
9868
|
+
|
|
9835
9869
|
var SavedViewsDeleteConfirmationModalShared = ({
|
|
9836
9870
|
onCancel,
|
|
9837
9871
|
onDelete,
|
|
9838
9872
|
open
|
|
9839
9873
|
}) => {
|
|
9840
|
-
const i18n = (0,
|
|
9841
|
-
return /* @__PURE__ */
|
|
9842
|
-
|
|
9874
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
9875
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
9876
|
+
_corereact.ConfirmModal,
|
|
9843
9877
|
{
|
|
9844
9878
|
"data-testid": "delete-confirmation-modal",
|
|
9845
9879
|
open,
|
|
@@ -9848,26 +9882,37 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
9848
9882
|
onClose: onCancel,
|
|
9849
9883
|
style: { overflowWrap: "anywhere" }
|
|
9850
9884
|
},
|
|
9851
|
-
/* @__PURE__ */
|
|
9852
|
-
/* @__PURE__ */
|
|
9885
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Modal.Body, null, /* @__PURE__ */ React.default.createElement(_corereact.P, null, i18n.t("savedViews.modal.delete.description"))),
|
|
9886
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Modal.Footer, null, /* @__PURE__ */ React.default.createElement(_corereact.Modal.FooterButtons, null, /* @__PURE__ */ React.default.createElement(_corereact.Button, { variant: "secondary", onClick: onCancel }, i18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React.default.createElement(_corereact.Button, { variant: "primary", onClick: onDelete }, i18n.t("savedViews.actions.delete"))))
|
|
9853
9887
|
);
|
|
9854
9888
|
};
|
|
9855
9889
|
|
|
9856
9890
|
// src/components/modals/form-modal/FormModal.tsx
|
|
9857
|
-
|
|
9891
|
+
|
|
9858
9892
|
|
|
9859
9893
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9894
|
+
|
|
9895
|
+
|
|
9896
|
+
|
|
9897
|
+
|
|
9898
|
+
|
|
9899
|
+
|
|
9900
|
+
|
|
9901
|
+
|
|
9902
|
+
|
|
9903
|
+
|
|
9904
|
+
|
|
9905
|
+
|
|
9906
|
+
|
|
9907
|
+
var _yup = require('yup'); var yup = _interopRequireWildcard(_yup); var yup2 = _interopRequireWildcard(_yup);
|
|
9863
9908
|
|
|
9864
9909
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
9865
9910
|
var getViewLevelOptions = (permissions, i18n, isProjectLevelTool = true) => {
|
|
9866
9911
|
const options = ["personal"];
|
|
9867
|
-
if (isProjectLevelTool && permissions
|
|
9912
|
+
if (isProjectLevelTool && _optionalChain([permissions, 'optionalAccess', _46 => _46.can_create_project_saved_views])) {
|
|
9868
9913
|
options.push("project");
|
|
9869
9914
|
}
|
|
9870
|
-
if (permissions
|
|
9915
|
+
if (_optionalChain([permissions, 'optionalAccess', _47 => _47.can_create_company_saved_views])) options.push("company");
|
|
9871
9916
|
return options.map((option) => ({
|
|
9872
9917
|
label: i18n.t(`savedViews.modal.fields.viewLevels.${option}`),
|
|
9873
9918
|
id: option
|
|
@@ -9894,23 +9939,23 @@ function extractMessage(error, I18n) {
|
|
|
9894
9939
|
}
|
|
9895
9940
|
|
|
9896
9941
|
// src/components/modals/form-modal/NameInputField.tsx
|
|
9897
|
-
|
|
9898
|
-
|
|
9942
|
+
|
|
9943
|
+
|
|
9899
9944
|
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
9900
9945
|
var NameInputField = ({
|
|
9901
9946
|
error,
|
|
9902
9947
|
onResetMutations
|
|
9903
9948
|
}) => {
|
|
9904
|
-
const I18n = (0,
|
|
9949
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9905
9950
|
const label = I18n.t("savedViews.modal.fields.name");
|
|
9906
|
-
const { errors: formErrors, submitCount } = (0,
|
|
9907
|
-
|
|
9908
|
-
if (submitCount > 0 && formErrors
|
|
9909
|
-
document.getElementById(NAME_INPUT_ID)
|
|
9951
|
+
const { errors: formErrors, submitCount } = _corereact.useFormContext.call(void 0, );
|
|
9952
|
+
React21.useEffect(() => {
|
|
9953
|
+
if (submitCount > 0 && _optionalChain([formErrors, 'optionalAccess', _48 => _48.name])) {
|
|
9954
|
+
_optionalChain([document, 'access', _49 => _49.getElementById, 'call', _50 => _50(NAME_INPUT_ID), 'optionalAccess', _51 => _51.focus, 'call', _52 => _52()]);
|
|
9910
9955
|
}
|
|
9911
|
-
}, [formErrors
|
|
9912
|
-
return /* @__PURE__ */
|
|
9913
|
-
|
|
9956
|
+
}, [_optionalChain([formErrors, 'optionalAccess', _53 => _53.name]), submitCount]);
|
|
9957
|
+
return /* @__PURE__ */ React21.createElement(
|
|
9958
|
+
_corereact.Form.Text,
|
|
9914
9959
|
{
|
|
9915
9960
|
id: NAME_INPUT_ID,
|
|
9916
9961
|
name: "name",
|
|
@@ -9942,7 +9987,7 @@ var FormModalBase = ({
|
|
|
9942
9987
|
setOpenEditCreateModal,
|
|
9943
9988
|
onSelect
|
|
9944
9989
|
}) => {
|
|
9945
|
-
const I18n = (0,
|
|
9990
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9946
9991
|
const NAME_MAX_LENGTH = 150;
|
|
9947
9992
|
const {
|
|
9948
9993
|
mutate: createSavedView,
|
|
@@ -10001,8 +10046,8 @@ var FormModalBase = ({
|
|
|
10001
10046
|
I18n,
|
|
10002
10047
|
isProjectLevelTool
|
|
10003
10048
|
);
|
|
10004
|
-
return /* @__PURE__ */
|
|
10005
|
-
|
|
10049
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10050
|
+
_corereact.Modal,
|
|
10006
10051
|
{
|
|
10007
10052
|
howToClose: ["x", "scrim"],
|
|
10008
10053
|
onClose,
|
|
@@ -10010,8 +10055,8 @@ var FormModalBase = ({
|
|
|
10010
10055
|
width: "md",
|
|
10011
10056
|
"data-testid": "create-update-modal"
|
|
10012
10057
|
},
|
|
10013
|
-
/* @__PURE__ */
|
|
10014
|
-
|
|
10058
|
+
/* @__PURE__ */ React22.createElement(ScrollContainer, null, /* @__PURE__ */ React22.createElement(_corereact.Modal.Header, { style: { borderBottom: `1px solid ${_corereact.colors.gray85}` } }, /* @__PURE__ */ React22.createElement(_corereact.Modal.Heading, null, header)), /* @__PURE__ */ React22.createElement(
|
|
10059
|
+
_corereact.Form,
|
|
10015
10060
|
{
|
|
10016
10061
|
initialValues: {
|
|
10017
10062
|
name: initialName,
|
|
@@ -10036,26 +10081,26 @@ var FormModalBase = ({
|
|
|
10036
10081
|
onReset: onCancel,
|
|
10037
10082
|
validateOnChange: true
|
|
10038
10083
|
},
|
|
10039
|
-
/* @__PURE__ */
|
|
10040
|
-
|
|
10084
|
+
/* @__PURE__ */ React22.createElement(_corereact.Form.Form, { name: header }, /* @__PURE__ */ React22.createElement(
|
|
10085
|
+
_corereact.Modal.Body,
|
|
10041
10086
|
{
|
|
10042
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10087
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: _corereact.spacing.lg }
|
|
10043
10088
|
},
|
|
10044
|
-
errors && /* @__PURE__ */
|
|
10045
|
-
/* @__PURE__ */
|
|
10089
|
+
errors && /* @__PURE__ */ React22.createElement(_corereact.ErrorBanner, { style: { marginBottom: _corereact.spacing.xl } }, /* @__PURE__ */ React22.createElement(_corereact.Banner.Content, null, /* @__PURE__ */ React22.createElement(_corereact.Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React22.createElement(_corereact.Banner.Body, null, _optionalChain([errors, 'optionalAccess', _54 => _54.form]) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10090
|
+
/* @__PURE__ */ React22.createElement(_corereact.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10046
10091
|
NameInputField,
|
|
10047
10092
|
{
|
|
10048
|
-
error: errors
|
|
10093
|
+
error: _optionalChain([errors, 'optionalAccess', _55 => _55.name]),
|
|
10049
10094
|
onResetMutations: resetMutations
|
|
10050
10095
|
}
|
|
10051
10096
|
)),
|
|
10052
|
-
/* @__PURE__ */
|
|
10053
|
-
|
|
10097
|
+
/* @__PURE__ */ React22.createElement(
|
|
10098
|
+
_corereact.Form.Row,
|
|
10054
10099
|
{
|
|
10055
|
-
style: { marginTop: errors
|
|
10100
|
+
style: { marginTop: _optionalChain([errors, 'optionalAccess', _56 => _56.name]) ? _corereact.spacing.xl : _corereact.spacing.none }
|
|
10056
10101
|
},
|
|
10057
|
-
/* @__PURE__ */
|
|
10058
|
-
|
|
10102
|
+
/* @__PURE__ */ React22.createElement(
|
|
10103
|
+
_corereact.Form.TextArea,
|
|
10059
10104
|
{
|
|
10060
10105
|
name: "description",
|
|
10061
10106
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10065,8 +10110,8 @@ var FormModalBase = ({
|
|
|
10065
10110
|
}
|
|
10066
10111
|
)
|
|
10067
10112
|
),
|
|
10068
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10069
|
-
|
|
10113
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React22.createElement(_corereact.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10114
|
+
_corereact.Form.Select,
|
|
10070
10115
|
{
|
|
10071
10116
|
name: "view_level",
|
|
10072
10117
|
options: viewLevelOptions,
|
|
@@ -10075,9 +10120,9 @@ var FormModalBase = ({
|
|
|
10075
10120
|
onSearch: false,
|
|
10076
10121
|
onClear: false
|
|
10077
10122
|
}
|
|
10078
|
-
)) : /* @__PURE__ */
|
|
10079
|
-
), /* @__PURE__ */
|
|
10080
|
-
|
|
10123
|
+
)) : /* @__PURE__ */ React22.createElement(React22.Fragment, null)
|
|
10124
|
+
), /* @__PURE__ */ React22.createElement(_corereact.Modal.Footer, { style: { borderTop: `1px solid ${_corereact.colors.gray85}` } }, /* @__PURE__ */ React22.createElement(_corereact.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React22.createElement(_corereact.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React22.createElement(_corereact.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React22.createElement(_corereact.Modal.FooterButtons, null, /* @__PURE__ */ React22.createElement(_corereact.Button, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React22.createElement(
|
|
10125
|
+
_corereact.Button,
|
|
10081
10126
|
{
|
|
10082
10127
|
"data-testid": "create-update-modal-button",
|
|
10083
10128
|
type: "submit",
|
|
@@ -10092,7 +10137,7 @@ var FormModalBase = ({
|
|
|
10092
10137
|
};
|
|
10093
10138
|
|
|
10094
10139
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10095
|
-
|
|
10140
|
+
|
|
10096
10141
|
var FormModal = ({
|
|
10097
10142
|
open,
|
|
10098
10143
|
mode,
|
|
@@ -10105,16 +10150,16 @@ var FormModal = ({
|
|
|
10105
10150
|
onSelect,
|
|
10106
10151
|
defaultView
|
|
10107
10152
|
}) => {
|
|
10108
|
-
const i18n = (0,
|
|
10109
|
-
return /* @__PURE__ */
|
|
10153
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
10154
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
10110
10155
|
FormModalBase,
|
|
10111
10156
|
{
|
|
10112
10157
|
open,
|
|
10113
10158
|
mode,
|
|
10114
10159
|
onCancel,
|
|
10115
10160
|
header: mode === "update" ? i18n.t("savedViews.modal.edit.title") : i18n.t("savedViews.modal.create.title"),
|
|
10116
|
-
initialName: mode === "update" ? selectedSavedView
|
|
10117
|
-
initialDesc: mode === "update" ? selectedSavedView
|
|
10161
|
+
initialName: mode === "update" ? _optionalChain([selectedSavedView, 'optionalAccess', _57 => _57.name]) || "" : "",
|
|
10162
|
+
initialDesc: mode === "update" ? _optionalChain([selectedSavedView, 'optionalAccess', _58 => _58.description]) || "" : "",
|
|
10118
10163
|
queryInput,
|
|
10119
10164
|
tableConfig,
|
|
10120
10165
|
tableName,
|
|
@@ -10127,9 +10172,21 @@ var FormModal = ({
|
|
|
10127
10172
|
};
|
|
10128
10173
|
|
|
10129
10174
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10175
|
+
|
|
10176
|
+
|
|
10177
|
+
|
|
10178
|
+
|
|
10179
|
+
|
|
10180
|
+
|
|
10181
|
+
|
|
10182
|
+
|
|
10183
|
+
|
|
10184
|
+
|
|
10185
|
+
|
|
10186
|
+
|
|
10187
|
+
|
|
10188
|
+
|
|
10189
|
+
|
|
10133
10190
|
var SharedViewFormModal = ({
|
|
10134
10191
|
open,
|
|
10135
10192
|
fetchedView,
|
|
@@ -10140,7 +10197,7 @@ var SharedViewFormModal = ({
|
|
|
10140
10197
|
isCreating,
|
|
10141
10198
|
resetCreateError
|
|
10142
10199
|
}) => {
|
|
10143
|
-
const I18n = (0,
|
|
10200
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
10144
10201
|
const NAME_MAX_LENGTH = 150;
|
|
10145
10202
|
const errors = extractMessage(createError, I18n);
|
|
10146
10203
|
const handleNameChange = () => {
|
|
@@ -10151,8 +10208,8 @@ var SharedViewFormModal = ({
|
|
|
10151
10208
|
const handleOnSubmit = (data) => {
|
|
10152
10209
|
onCreateView(data.name, data.description);
|
|
10153
10210
|
};
|
|
10154
|
-
return /* @__PURE__ */
|
|
10155
|
-
|
|
10211
|
+
return /* @__PURE__ */ React24.createElement(
|
|
10212
|
+
_corereact.Modal,
|
|
10156
10213
|
{
|
|
10157
10214
|
"data-testid": "shared-view-form-modal",
|
|
10158
10215
|
open,
|
|
@@ -10160,40 +10217,40 @@ var SharedViewFormModal = ({
|
|
|
10160
10217
|
onClose,
|
|
10161
10218
|
style: { width: "540px" }
|
|
10162
10219
|
},
|
|
10163
|
-
/* @__PURE__ */
|
|
10164
|
-
|
|
10220
|
+
/* @__PURE__ */ React24.createElement(
|
|
10221
|
+
_corereact.Modal.Header,
|
|
10165
10222
|
{
|
|
10166
10223
|
onClose,
|
|
10167
10224
|
style: {
|
|
10168
|
-
paddingTop:
|
|
10169
|
-
paddingBottom:
|
|
10170
|
-
paddingLeft:
|
|
10171
|
-
paddingRight:
|
|
10225
|
+
paddingTop: _corereact.spacing.lg,
|
|
10226
|
+
paddingBottom: _corereact.spacing.xs,
|
|
10227
|
+
paddingLeft: _corereact.spacing.xl,
|
|
10228
|
+
paddingRight: _corereact.spacing.xl
|
|
10172
10229
|
}
|
|
10173
10230
|
},
|
|
10174
|
-
/* @__PURE__ */
|
|
10231
|
+
/* @__PURE__ */ React24.createElement(_corereact.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10175
10232
|
),
|
|
10176
|
-
/* @__PURE__ */
|
|
10177
|
-
|
|
10233
|
+
/* @__PURE__ */ React24.createElement(
|
|
10234
|
+
_corereact.P,
|
|
10178
10235
|
{
|
|
10179
10236
|
style: {
|
|
10180
|
-
paddingLeft:
|
|
10181
|
-
paddingRight:
|
|
10182
|
-
paddingBottom:
|
|
10183
|
-
paddingTop:
|
|
10237
|
+
paddingLeft: _corereact.spacing.xl,
|
|
10238
|
+
paddingRight: _corereact.spacing.xl,
|
|
10239
|
+
paddingBottom: _corereact.spacing.lg,
|
|
10240
|
+
paddingTop: _corereact.spacing.none,
|
|
10184
10241
|
margin: 0,
|
|
10185
|
-
color:
|
|
10242
|
+
color: _corereact.colors.gray45,
|
|
10186
10243
|
whiteSpace: "pre-line"
|
|
10187
10244
|
}
|
|
10188
10245
|
},
|
|
10189
10246
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10190
10247
|
),
|
|
10191
|
-
/* @__PURE__ */
|
|
10192
|
-
|
|
10248
|
+
/* @__PURE__ */ React24.createElement(
|
|
10249
|
+
_corereact.Form,
|
|
10193
10250
|
{
|
|
10194
10251
|
initialValues: {
|
|
10195
10252
|
name: fetchedView.name,
|
|
10196
|
-
description: fetchedView.description
|
|
10253
|
+
description: _nullishCoalesce(fetchedView.description, () => ( ""))
|
|
10197
10254
|
},
|
|
10198
10255
|
view: "create",
|
|
10199
10256
|
validationSchema: yup2.object().shape({
|
|
@@ -10207,32 +10264,32 @@ var SharedViewFormModal = ({
|
|
|
10207
10264
|
onSubmit: handleOnSubmit,
|
|
10208
10265
|
validateOnChange: true
|
|
10209
10266
|
},
|
|
10210
|
-
/* @__PURE__ */
|
|
10211
|
-
|
|
10267
|
+
/* @__PURE__ */ React24.createElement(_corereact.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React24.createElement(
|
|
10268
|
+
_corereact.Modal.Body,
|
|
10212
10269
|
{
|
|
10213
10270
|
style: {
|
|
10214
|
-
paddingTop:
|
|
10271
|
+
paddingTop: _corereact.spacing.lg,
|
|
10215
10272
|
paddingBottom: 0,
|
|
10216
|
-
borderTop: `1px solid ${
|
|
10273
|
+
borderTop: `1px solid ${_corereact.colors.gray85}`
|
|
10217
10274
|
}
|
|
10218
10275
|
},
|
|
10219
|
-
errors && /* @__PURE__ */
|
|
10276
|
+
errors && /* @__PURE__ */ React24.createElement(_corereact.ErrorBanner, { style: { marginBottom: _corereact.spacing.xl } }, /* @__PURE__ */ React24.createElement(_corereact.Banner.Content, null, /* @__PURE__ */ React24.createElement(_corereact.Banner.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
10220
10277
|
mode: "create"
|
|
10221
|
-
})), /* @__PURE__ */
|
|
10222
|
-
/* @__PURE__ */
|
|
10278
|
+
})), /* @__PURE__ */ React24.createElement(_corereact.Banner.Body, null, _optionalChain([errors, 'optionalAccess', _59 => _59.form]) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10279
|
+
/* @__PURE__ */ React24.createElement(_corereact.Form.Row, null, /* @__PURE__ */ React24.createElement(
|
|
10223
10280
|
NameInputField,
|
|
10224
10281
|
{
|
|
10225
|
-
error: errors
|
|
10282
|
+
error: _optionalChain([errors, 'optionalAccess', _60 => _60.name]),
|
|
10226
10283
|
onResetMutations: handleNameChange
|
|
10227
10284
|
}
|
|
10228
10285
|
)),
|
|
10229
|
-
/* @__PURE__ */
|
|
10230
|
-
|
|
10286
|
+
/* @__PURE__ */ React24.createElement(
|
|
10287
|
+
_corereact.Form.Row,
|
|
10231
10288
|
{
|
|
10232
|
-
style: { marginTop: errors
|
|
10289
|
+
style: { marginTop: _optionalChain([errors, 'optionalAccess', _61 => _61.name]) ? _corereact.spacing.xl : _corereact.spacing.none }
|
|
10233
10290
|
},
|
|
10234
|
-
/* @__PURE__ */
|
|
10235
|
-
|
|
10291
|
+
/* @__PURE__ */ React24.createElement(
|
|
10292
|
+
_corereact.Form.TextArea,
|
|
10236
10293
|
{
|
|
10237
10294
|
name: "description",
|
|
10238
10295
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10242,8 +10299,8 @@ var SharedViewFormModal = ({
|
|
|
10242
10299
|
}
|
|
10243
10300
|
)
|
|
10244
10301
|
)
|
|
10245
|
-
), /* @__PURE__ */
|
|
10246
|
-
|
|
10302
|
+
), /* @__PURE__ */ React24.createElement(_corereact.Modal.Footer, { style: { borderTop: `1px solid ${_corereact.colors.gray85}` } }, /* @__PURE__ */ React24.createElement(_corereact.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React24.createElement(_corereact.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React24.createElement(_corereact.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React24.createElement(_corereact.Modal.FooterButtons, null, /* @__PURE__ */ React24.createElement(
|
|
10303
|
+
_corereact.Button,
|
|
10247
10304
|
{
|
|
10248
10305
|
variant: "secondary",
|
|
10249
10306
|
onClick: onCreateTemporaryView,
|
|
@@ -10251,8 +10308,8 @@ var SharedViewFormModal = ({
|
|
|
10251
10308
|
disabled: isCreating
|
|
10252
10309
|
},
|
|
10253
10310
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10254
|
-
), /* @__PURE__ */
|
|
10255
|
-
|
|
10311
|
+
), /* @__PURE__ */ React24.createElement(
|
|
10312
|
+
_corereact.Button,
|
|
10256
10313
|
{
|
|
10257
10314
|
type: "submit",
|
|
10258
10315
|
variant: "primary",
|
|
@@ -10267,9 +10324,8 @@ var SharedViewFormModal = ({
|
|
|
10267
10324
|
};
|
|
10268
10325
|
|
|
10269
10326
|
// src/utils/hooks/useViewSelection.ts
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
var import_core_react14 = require("@procore/core-react");
|
|
10327
|
+
|
|
10328
|
+
|
|
10273
10329
|
|
|
10274
10330
|
// src/utils/viewStorage.ts
|
|
10275
10331
|
var ViewStorage = {
|
|
@@ -10284,7 +10340,7 @@ var ViewStorage = {
|
|
|
10284
10340
|
if (!parsed) return defaultView;
|
|
10285
10341
|
const isTableConfigOnly = !parsed.id && !parsed.share_token;
|
|
10286
10342
|
return isTableConfigOnly ? { ...defaultView, table_config: parsed } : parsed;
|
|
10287
|
-
} catch {
|
|
10343
|
+
} catch (e7) {
|
|
10288
10344
|
return defaultView;
|
|
10289
10345
|
}
|
|
10290
10346
|
},
|
|
@@ -10294,13 +10350,13 @@ var ViewStorage = {
|
|
|
10294
10350
|
};
|
|
10295
10351
|
|
|
10296
10352
|
// src/utils/hooks/useLatest.ts
|
|
10297
|
-
|
|
10353
|
+
|
|
10298
10354
|
var useLatest = (callback) => {
|
|
10299
|
-
const ref = (0,
|
|
10300
|
-
(0,
|
|
10355
|
+
const ref = _react.useRef.call(void 0, callback);
|
|
10356
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
10301
10357
|
ref.current = callback;
|
|
10302
10358
|
});
|
|
10303
|
-
return (0,
|
|
10359
|
+
return _react.useCallback.call(void 0, (...args) => ref.current(...args), []);
|
|
10304
10360
|
};
|
|
10305
10361
|
|
|
10306
10362
|
// src/utils/hooks/useViewSelection.ts
|
|
@@ -10313,69 +10369,51 @@ var areRowGroupStatesEqual = (a2, b2) => {
|
|
|
10313
10369
|
if (a2.length !== b2.length) return false;
|
|
10314
10370
|
return a2.every((val, idx) => val === b2[idx]);
|
|
10315
10371
|
};
|
|
10316
|
-
var
|
|
10317
|
-
if (view.id === "default"
|
|
10318
|
-
|
|
10319
|
-
}
|
|
10372
|
+
var getViewTokenForView = (view) => {
|
|
10373
|
+
if (view.id === "default") return "default";
|
|
10374
|
+
if (view.id === "temporary") return "temporary";
|
|
10320
10375
|
return view.share_token;
|
|
10321
10376
|
};
|
|
10322
|
-
var setSavedViewParam = (token2, setSearchParams) => {
|
|
10323
|
-
setSearchParams(
|
|
10324
|
-
(currentParams) => {
|
|
10325
|
-
const updatedParams = new URLSearchParams(currentParams);
|
|
10326
|
-
updatedParams.set("saved-view", token2);
|
|
10327
|
-
return updatedParams;
|
|
10328
|
-
},
|
|
10329
|
-
{ replace: true }
|
|
10330
|
-
);
|
|
10331
|
-
};
|
|
10332
10377
|
var checkIsViewSelected = (selectedView, viewId) => {
|
|
10333
|
-
return selectedView
|
|
10378
|
+
return _optionalChain([selectedView, 'optionalAccess', _62 => _62.share_token]) === viewId || _optionalChain([selectedView, 'optionalAccess', _63 => _63.id]) === viewId;
|
|
10334
10379
|
};
|
|
10335
10380
|
var findViewByToken = (views, token2) => {
|
|
10336
10381
|
return views.find((view) => view.share_token === token2);
|
|
10337
10382
|
};
|
|
10338
|
-
var setViewInUrl = (view, setSearchParams) => {
|
|
10339
|
-
setSavedViewParam(getViewToken(view), setSearchParams);
|
|
10340
|
-
};
|
|
10341
|
-
var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
10342
|
-
if (previousParam && !currentParam) {
|
|
10343
|
-
setSavedViewParam(previousParam, setSearchParams);
|
|
10344
|
-
}
|
|
10345
|
-
};
|
|
10346
10383
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, tableConfig) => {
|
|
10347
|
-
const I18n = (0,
|
|
10348
|
-
const
|
|
10384
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
10385
|
+
const transport = useSavedViewsTransport();
|
|
10386
|
+
const urlAdapter = transport.useUrlAdapter();
|
|
10387
|
+
const projectIdSegment = _nullishCoalesce(config.projectId, () => ( "company"));
|
|
10349
10388
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10350
10389
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
10351
|
-
const
|
|
10352
|
-
const
|
|
10353
|
-
const
|
|
10354
|
-
const [selectedSavedView, setSelectedSavedView] = (0, import_react14.useState)(() => {
|
|
10390
|
+
const previousSavedViewParamRef = _react.useRef.call(void 0, null);
|
|
10391
|
+
const intendedTokenRef = _react.useRef.call(void 0, null);
|
|
10392
|
+
const [selectedSavedView, setSelectedSavedView] = _react.useState.call(void 0, () => {
|
|
10355
10393
|
const stored = ViewStorage.load(storageKey, config.defaultView);
|
|
10356
|
-
return stored
|
|
10394
|
+
return _nullishCoalesce(stored, () => ( config.defaultView));
|
|
10357
10395
|
});
|
|
10358
|
-
const [temporaryView, setTemporaryView] = (0,
|
|
10396
|
+
const [temporaryView, setTemporaryView] = _react.useState.call(void 0, () => {
|
|
10359
10397
|
const loaded = ViewStorage.load(temporaryStorageKey, config.defaultView);
|
|
10360
10398
|
return loaded && (loaded.id === "temporary" || loaded.view_level === "temporary") ? loaded : null;
|
|
10361
10399
|
});
|
|
10362
|
-
const persistViewToStorageAndUrl = (0,
|
|
10400
|
+
const persistViewToStorageAndUrl = _react.useCallback.call(void 0,
|
|
10363
10401
|
(view) => {
|
|
10364
10402
|
ViewStorage.save(storageKey, view);
|
|
10365
|
-
intendedTokenRef.current =
|
|
10366
|
-
|
|
10403
|
+
intendedTokenRef.current = getViewTokenForView(view);
|
|
10404
|
+
urlAdapter.setViewToken(getViewTokenForView(view));
|
|
10367
10405
|
},
|
|
10368
|
-
[storageKey,
|
|
10406
|
+
[storageKey, urlAdapter]
|
|
10369
10407
|
);
|
|
10370
|
-
const baseViews = (0,
|
|
10371
|
-
() => [...savedViews
|
|
10408
|
+
const baseViews = _react.useMemo.call(void 0,
|
|
10409
|
+
() => [..._nullishCoalesce(savedViews, () => ( [])), ..._nullishCoalesce(presetViews, () => ( []))],
|
|
10372
10410
|
[savedViews, presetViews]
|
|
10373
10411
|
);
|
|
10374
|
-
const allViews = (0,
|
|
10412
|
+
const allViews = _react.useMemo.call(void 0,
|
|
10375
10413
|
() => temporaryView ? [...baseViews, temporaryView] : baseViews,
|
|
10376
10414
|
[baseViews, temporaryView]
|
|
10377
10415
|
);
|
|
10378
|
-
const selectView = (0,
|
|
10416
|
+
const selectView = _react.useCallback.call(void 0,
|
|
10379
10417
|
(view) => {
|
|
10380
10418
|
const viewToSelect = config.onSelect({ item: view });
|
|
10381
10419
|
setSelectedSavedView(viewToSelect);
|
|
@@ -10384,7 +10422,7 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10384
10422
|
},
|
|
10385
10423
|
[config, persistViewToStorageAndUrl]
|
|
10386
10424
|
);
|
|
10387
|
-
const createTemporaryView = (0,
|
|
10425
|
+
const createTemporaryView = _react.useCallback.call(void 0,
|
|
10388
10426
|
(fetchedView) => {
|
|
10389
10427
|
const tempView = {
|
|
10390
10428
|
...fetchedView,
|
|
@@ -10399,12 +10437,12 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10399
10437
|
},
|
|
10400
10438
|
[temporaryStorageKey, selectView]
|
|
10401
10439
|
);
|
|
10402
|
-
const clearTemporaryView = (0,
|
|
10440
|
+
const clearTemporaryView = _react.useCallback.call(void 0, () => {
|
|
10403
10441
|
ViewStorage.remove(temporaryStorageKey);
|
|
10404
10442
|
setTemporaryView(null);
|
|
10405
10443
|
selectView(config.defaultView);
|
|
10406
10444
|
}, [temporaryStorageKey, config.defaultView, selectView]);
|
|
10407
|
-
const isViewAlreadySelected = (0,
|
|
10445
|
+
const isViewAlreadySelected = _react.useCallback.call(void 0,
|
|
10408
10446
|
(viewId) => checkIsViewSelected(selectedSavedView, viewId),
|
|
10409
10447
|
[selectedSavedView]
|
|
10410
10448
|
);
|
|
@@ -10419,37 +10457,35 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10419
10457
|
openSharedViewModal(viewId);
|
|
10420
10458
|
}
|
|
10421
10459
|
});
|
|
10422
|
-
|
|
10423
|
-
|
|
10460
|
+
const savedViewIdFromUrl = urlAdapter.getViewToken();
|
|
10461
|
+
_react.useEffect.call(void 0, () => {
|
|
10424
10462
|
const intendedToken = intendedTokenRef.current;
|
|
10425
|
-
if (intendedToken !== null &&
|
|
10426
|
-
|
|
10463
|
+
if (intendedToken !== null && savedViewIdFromUrl !== intendedToken) {
|
|
10464
|
+
urlAdapter.setViewToken(intendedToken);
|
|
10427
10465
|
return;
|
|
10428
10466
|
}
|
|
10429
|
-
if (intendedToken !== null &&
|
|
10467
|
+
if (intendedToken !== null && savedViewIdFromUrl === intendedToken) {
|
|
10430
10468
|
intendedTokenRef.current = null;
|
|
10431
10469
|
}
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
if (savedViewId) {
|
|
10438
|
-
previousSavedViewParamRef.current = savedViewId;
|
|
10470
|
+
if (previousSavedViewParamRef.current && !savedViewIdFromUrl) {
|
|
10471
|
+
urlAdapter.setViewToken(previousSavedViewParamRef.current);
|
|
10472
|
+
}
|
|
10473
|
+
if (savedViewIdFromUrl) {
|
|
10474
|
+
previousSavedViewParamRef.current = savedViewIdFromUrl;
|
|
10439
10475
|
}
|
|
10440
|
-
if (
|
|
10441
|
-
handleSavedViewFromUrl(
|
|
10476
|
+
if (savedViewIdFromUrl && savedViews) {
|
|
10477
|
+
handleSavedViewFromUrl(savedViewIdFromUrl);
|
|
10442
10478
|
}
|
|
10443
|
-
}, [
|
|
10444
|
-
const previousRowGroupStateRef = (0,
|
|
10479
|
+
}, [savedViewIdFromUrl, handleSavedViewFromUrl, allViews.length, urlAdapter]);
|
|
10480
|
+
const previousRowGroupStateRef = _react.useRef.call(void 0,
|
|
10445
10481
|
isSmartGridConfig(tableConfig) ? tableConfig.rowGroupState : void 0
|
|
10446
10482
|
);
|
|
10447
|
-
const selectedViewRef = (0,
|
|
10483
|
+
const selectedViewRef = _react.useRef.call(void 0, selectedSavedView);
|
|
10448
10484
|
selectedViewRef.current = selectedSavedView;
|
|
10449
|
-
const defaultViewRef = (0,
|
|
10485
|
+
const defaultViewRef = _react.useRef.call(void 0, config.defaultView);
|
|
10450
10486
|
defaultViewRef.current = config.defaultView;
|
|
10451
|
-
(0,
|
|
10452
|
-
if (!isSmartGridConfig(tableConfig) || !presetViews
|
|
10487
|
+
_react.useEffect.call(void 0, () => {
|
|
10488
|
+
if (!isSmartGridConfig(tableConfig) || !_optionalChain([presetViews, 'optionalAccess', _64 => _64.length])) return;
|
|
10453
10489
|
const currentView = selectedViewRef.current;
|
|
10454
10490
|
const isPresetSelected = !currentView || currentView.view_level === "default";
|
|
10455
10491
|
if (!isPresetSelected) return;
|
|
@@ -10465,14 +10501,14 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10465
10501
|
const matchingPreset = presetViews.find((preset) => {
|
|
10466
10502
|
const presetConfig = isSmartGridConfig(preset.table_config) ? preset.table_config : void 0;
|
|
10467
10503
|
return areRowGroupStatesEqual(
|
|
10468
|
-
presetConfig
|
|
10504
|
+
_optionalChain([presetConfig, 'optionalAccess', _65 => _65.rowGroupState]),
|
|
10469
10505
|
currentRowGroupState
|
|
10470
10506
|
);
|
|
10471
10507
|
});
|
|
10472
|
-
if (matchingPreset && matchingPreset.id !== selectedViewRef.current
|
|
10508
|
+
if (matchingPreset && matchingPreset.id !== _optionalChain([selectedViewRef, 'access', _66 => _66.current, 'optionalAccess', _67 => _67.id])) {
|
|
10473
10509
|
setSelectedSavedView(matchingPreset);
|
|
10474
10510
|
persistViewToStorageAndUrl(matchingPreset);
|
|
10475
|
-
} else if (!matchingPreset && currentView
|
|
10511
|
+
} else if (!matchingPreset && _optionalChain([currentView, 'optionalAccess', _68 => _68.id]) !== defaultViewRef.current.id) {
|
|
10476
10512
|
setSelectedSavedView(defaultViewRef.current);
|
|
10477
10513
|
persistViewToStorageAndUrl(defaultViewRef.current);
|
|
10478
10514
|
}
|
|
@@ -10488,13 +10524,13 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10488
10524
|
};
|
|
10489
10525
|
|
|
10490
10526
|
// src/components/saved-views/FocusScopeToggle.tsx
|
|
10491
|
-
var
|
|
10492
|
-
|
|
10527
|
+
var _focus = require('@react-aria/focus');
|
|
10528
|
+
|
|
10493
10529
|
var useFocusScopeToggle = (isOpen) => {
|
|
10494
|
-
const focusManager = (0,
|
|
10495
|
-
const triggerRef = (0,
|
|
10496
|
-
const firstFocusedElementRef = (0,
|
|
10497
|
-
(0,
|
|
10530
|
+
const focusManager = _focus.useFocusManager.call(void 0, );
|
|
10531
|
+
const triggerRef = _react.useRef.call(void 0, null);
|
|
10532
|
+
const firstFocusedElementRef = _react.useRef.call(void 0, null);
|
|
10533
|
+
_react.useEffect.call(void 0, () => {
|
|
10498
10534
|
const handleKeyDown = (event) => {
|
|
10499
10535
|
if (!event.shiftKey || event.key !== "Tab") {
|
|
10500
10536
|
return;
|
|
@@ -10503,28 +10539,28 @@ var useFocusScopeToggle = (isOpen) => {
|
|
|
10503
10539
|
return;
|
|
10504
10540
|
}
|
|
10505
10541
|
event.preventDefault();
|
|
10506
|
-
triggerRef.current
|
|
10542
|
+
_optionalChain([triggerRef, 'access', _69 => _69.current, 'optionalAccess', _70 => _70.focus, 'call', _71 => _71()]);
|
|
10507
10543
|
};
|
|
10508
10544
|
if (isOpen) {
|
|
10509
10545
|
triggerRef.current = document.activeElement;
|
|
10510
|
-
focusManager
|
|
10546
|
+
_optionalChain([focusManager, 'optionalAccess', _72 => _72.focusFirst, 'call', _73 => _73({ tabbable: true })]);
|
|
10511
10547
|
firstFocusedElementRef.current = document.activeElement;
|
|
10512
|
-
firstFocusedElementRef.current
|
|
10548
|
+
_optionalChain([firstFocusedElementRef, 'access', _74 => _74.current, 'optionalAccess', _75 => _75.addEventListener, 'call', _76 => _76(
|
|
10513
10549
|
"keydown",
|
|
10514
10550
|
handleKeyDown
|
|
10515
|
-
);
|
|
10551
|
+
)]);
|
|
10516
10552
|
} else {
|
|
10517
10553
|
firstFocusedElementRef.current = null;
|
|
10518
10554
|
const activeElement = document.activeElement;
|
|
10519
10555
|
if (!activeElement || activeElement === document.body) {
|
|
10520
|
-
triggerRef.current
|
|
10556
|
+
_optionalChain([triggerRef, 'access', _77 => _77.current, 'optionalAccess', _78 => _78.focus, 'call', _79 => _79()]);
|
|
10521
10557
|
}
|
|
10522
10558
|
}
|
|
10523
10559
|
return () => {
|
|
10524
|
-
firstFocusedElementRef.current
|
|
10560
|
+
_optionalChain([firstFocusedElementRef, 'access', _80 => _80.current, 'optionalAccess', _81 => _81.removeEventListener, 'call', _82 => _82(
|
|
10525
10561
|
"keydown",
|
|
10526
10562
|
handleKeyDown
|
|
10527
|
-
);
|
|
10563
|
+
)]);
|
|
10528
10564
|
};
|
|
10529
10565
|
}, [isOpen, focusManager]);
|
|
10530
10566
|
};
|
|
@@ -10534,11 +10570,27 @@ var FocusScopeToggle = ({ isOpen }) => {
|
|
|
10534
10570
|
};
|
|
10535
10571
|
|
|
10536
10572
|
// src/components/saved-views/SavedViews.tsx
|
|
10537
|
-
|
|
10573
|
+
|
|
10574
|
+
|
|
10575
|
+
// src/transport/default-lazy.ts
|
|
10576
|
+
var cached;
|
|
10577
|
+
var inFlight;
|
|
10578
|
+
var getCachedDefaultTransport = () => cached;
|
|
10579
|
+
var loadDefaultTransport = () => {
|
|
10580
|
+
if (cached) return Promise.resolve(cached);
|
|
10581
|
+
if (inFlight) return inFlight;
|
|
10582
|
+
inFlight = Promise.resolve().then(() => _interopRequireWildcard(require("./transport/default.js"))).then((mod) => {
|
|
10583
|
+
cached = mod.defaultTransport;
|
|
10584
|
+
inFlight = void 0;
|
|
10585
|
+
return mod.defaultTransport;
|
|
10586
|
+
});
|
|
10587
|
+
return inFlight;
|
|
10588
|
+
};
|
|
10589
|
+
|
|
10590
|
+
// src/components/saved-views/SavedViews.tsx
|
|
10538
10591
|
var StyledPanel = pt.div`
|
|
10539
10592
|
border: ${({ provider }) => provider === "data-table" ? "1px solid #d6dadc" : "none"};
|
|
10540
10593
|
`;
|
|
10541
|
-
var queryClient = new import_react_query3.QueryClient();
|
|
10542
10594
|
var SavedViewsContent = (props) => {
|
|
10543
10595
|
const { projectId, companyId } = props;
|
|
10544
10596
|
const queryInput = {
|
|
@@ -10549,15 +10601,15 @@ var SavedViewsContent = (props) => {
|
|
|
10549
10601
|
};
|
|
10550
10602
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
10551
10603
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
10552
|
-
const { showToast } = (0,
|
|
10553
|
-
const i18n = (0,
|
|
10554
|
-
const [activeModal, setActiveModal] = (0,
|
|
10555
|
-
const [modalData, setModalData] = (0,
|
|
10604
|
+
const { showToast } = _toastalert.useToastAlertContext.call(void 0, );
|
|
10605
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
10606
|
+
const [activeModal, setActiveModal] = _react.useState.call(void 0, null);
|
|
10607
|
+
const [modalData, setModalData] = _react.useState.call(void 0, null);
|
|
10556
10608
|
const openModal = (type, data) => {
|
|
10557
10609
|
setActiveModal(type);
|
|
10558
|
-
setModalData(data
|
|
10610
|
+
setModalData(_nullishCoalesce(data, () => ( null)));
|
|
10559
10611
|
};
|
|
10560
|
-
const closeModal = (0,
|
|
10612
|
+
const closeModal = _react.useCallback.call(void 0, () => {
|
|
10561
10613
|
setActiveModal(null);
|
|
10562
10614
|
setModalData(null);
|
|
10563
10615
|
}, []);
|
|
@@ -10587,9 +10639,9 @@ var SavedViewsContent = (props) => {
|
|
|
10587
10639
|
props.tableConfig
|
|
10588
10640
|
);
|
|
10589
10641
|
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
10590
|
-
modalData
|
|
10642
|
+
_nullishCoalesce(_optionalChain([modalData, 'optionalAccess', _83 => _83.viewId]), () => ( null)),
|
|
10591
10643
|
queryInput,
|
|
10592
|
-
Boolean(modalData
|
|
10644
|
+
Boolean(_optionalChain([modalData, 'optionalAccess', _84 => _84.viewId]))
|
|
10593
10645
|
);
|
|
10594
10646
|
const {
|
|
10595
10647
|
mutate: createSavedView,
|
|
@@ -10597,16 +10649,16 @@ var SavedViewsContent = (props) => {
|
|
|
10597
10649
|
error: createError,
|
|
10598
10650
|
reset: resetCreateError
|
|
10599
10651
|
} = useCreateSavedView(queryInput);
|
|
10600
|
-
(0,
|
|
10652
|
+
_react.useEffect.call(void 0, () => {
|
|
10601
10653
|
if (fetchError) {
|
|
10602
10654
|
showToast.error(i18n.t("savedViews.errors.notFound"));
|
|
10603
|
-
selectView(selectedView
|
|
10655
|
+
selectView(_nullishCoalesce(selectedView, () => ( props.defaultView)));
|
|
10604
10656
|
closeModal();
|
|
10605
10657
|
}
|
|
10606
10658
|
}, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
|
|
10607
|
-
const setSelectedViewInContext = useSavedViewsSelection()
|
|
10608
|
-
(0,
|
|
10609
|
-
setSelectedViewInContext
|
|
10659
|
+
const setSelectedViewInContext = _optionalChain([useSavedViewsSelection, 'call', _85 => _85(), 'optionalAccess', _86 => _86.setSelectedView]);
|
|
10660
|
+
_react.useEffect.call(void 0, () => {
|
|
10661
|
+
_optionalChain([setSelectedViewInContext, 'optionalCall', _87 => _87(_nullishCoalesce(selectedView, () => ( null)))]);
|
|
10610
10662
|
}, [selectedView, setSelectedViewInContext]);
|
|
10611
10663
|
const viewSharedViewTemporarily = () => {
|
|
10612
10664
|
if (fetchedView) {
|
|
@@ -10635,7 +10687,7 @@ var SavedViewsContent = (props) => {
|
|
|
10635
10687
|
}
|
|
10636
10688
|
};
|
|
10637
10689
|
const selectCurrentViewAndCloseModal = () => {
|
|
10638
|
-
selectView(selectedView
|
|
10690
|
+
selectView(_nullishCoalesce(selectedView, () => ( props.defaultView)));
|
|
10639
10691
|
closeModal();
|
|
10640
10692
|
};
|
|
10641
10693
|
const deleteSelectedView = () => {
|
|
@@ -10649,19 +10701,19 @@ var SavedViewsContent = (props) => {
|
|
|
10649
10701
|
deleteSelectedView();
|
|
10650
10702
|
closeModal();
|
|
10651
10703
|
};
|
|
10652
|
-
return /* @__PURE__ */
|
|
10704
|
+
return /* @__PURE__ */ React.default.createElement(_focus.FocusScope, { contain: false }, /* @__PURE__ */ React.default.createElement(StyledPanel, { id: "saved-views-panel", provider: props.provider }, /* @__PURE__ */ React.default.createElement(FocusScopeToggle, { isOpen: _nullishCoalesce(props.isPanelOpen, () => ( true)) }), /* @__PURE__ */ React.default.createElement(
|
|
10653
10705
|
ExpandedPanel,
|
|
10654
10706
|
{
|
|
10655
10707
|
"data-testid": "saved-view-expanded-panel",
|
|
10656
10708
|
provider: props.provider
|
|
10657
10709
|
},
|
|
10658
|
-
/* @__PURE__ */
|
|
10659
|
-
|
|
10710
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Panel.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ React.default.createElement(_corereact.Panel.Title, null, /* @__PURE__ */ React.default.createElement(_corereact.Flex, { alignItems: "center" }, /* @__PURE__ */ React.default.createElement(_corereact.Box, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ React.default.createElement(
|
|
10711
|
+
_corereact.Tooltip,
|
|
10660
10712
|
{
|
|
10661
10713
|
showDelay: 200,
|
|
10662
|
-
overlay: /* @__PURE__ */
|
|
10714
|
+
overlay: /* @__PURE__ */ React.default.createElement(_corereact.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10663
10715
|
},
|
|
10664
|
-
/* @__PURE__ */
|
|
10716
|
+
/* @__PURE__ */ React.default.createElement(
|
|
10665
10717
|
Help_default,
|
|
10666
10718
|
{
|
|
10667
10719
|
tabIndex: 0,
|
|
@@ -10669,16 +10721,16 @@ var SavedViewsContent = (props) => {
|
|
|
10669
10721
|
"aria-label": i18n.t("savedViews.tooltip")
|
|
10670
10722
|
}
|
|
10671
10723
|
)
|
|
10672
|
-
))), /* @__PURE__ */
|
|
10673
|
-
|
|
10724
|
+
))), /* @__PURE__ */ React.default.createElement(
|
|
10725
|
+
_corereact.Tooltip,
|
|
10674
10726
|
{
|
|
10675
10727
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10676
10728
|
showDelay: 1e3
|
|
10677
10729
|
},
|
|
10678
|
-
/* @__PURE__ */
|
|
10679
|
-
|
|
10730
|
+
/* @__PURE__ */ React.default.createElement(
|
|
10731
|
+
_corereact.Button,
|
|
10680
10732
|
{
|
|
10681
|
-
icon: /* @__PURE__ */
|
|
10733
|
+
icon: /* @__PURE__ */ React.default.createElement(Plus_default, null),
|
|
10682
10734
|
variant: "secondary",
|
|
10683
10735
|
"data-testid": "expanded-panel-create-button",
|
|
10684
10736
|
onClick: () => openModal("create" /* CREATE */),
|
|
@@ -10687,7 +10739,7 @@ var SavedViewsContent = (props) => {
|
|
|
10687
10739
|
i18n.t("savedViews.actions.create")
|
|
10688
10740
|
)
|
|
10689
10741
|
)),
|
|
10690
|
-
/* @__PURE__ */
|
|
10742
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ React.default.createElement(
|
|
10691
10743
|
PanelContent,
|
|
10692
10744
|
{
|
|
10693
10745
|
onSelect: ({ item }) => selectView(item),
|
|
@@ -10704,7 +10756,7 @@ var SavedViewsContent = (props) => {
|
|
|
10704
10756
|
onClearTemporary: clearTemporaryView
|
|
10705
10757
|
}
|
|
10706
10758
|
))
|
|
10707
|
-
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */
|
|
10759
|
+
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ React.default.createElement(
|
|
10708
10760
|
FormModal,
|
|
10709
10761
|
{
|
|
10710
10762
|
open: true,
|
|
@@ -10718,14 +10770,14 @@ var SavedViewsContent = (props) => {
|
|
|
10718
10770
|
setOpenEditCreateModal: closeModal,
|
|
10719
10771
|
defaultView: props.defaultView
|
|
10720
10772
|
}
|
|
10721
|
-
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */
|
|
10773
|
+
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */ React.default.createElement(
|
|
10722
10774
|
SavedViewsDeleteConfirmationModalShared,
|
|
10723
10775
|
{
|
|
10724
10776
|
open: true,
|
|
10725
10777
|
onDelete: confirmDeleteAndCloseModal,
|
|
10726
10778
|
onCancel: closeModal
|
|
10727
10779
|
}
|
|
10728
|
-
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */
|
|
10780
|
+
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ React.default.createElement(
|
|
10729
10781
|
SharedViewFormModal,
|
|
10730
10782
|
{
|
|
10731
10783
|
open: true,
|
|
@@ -10740,14 +10792,34 @@ var SavedViewsContent = (props) => {
|
|
|
10740
10792
|
)));
|
|
10741
10793
|
};
|
|
10742
10794
|
var SavedViews = (props) => {
|
|
10743
|
-
|
|
10795
|
+
const [resolvedDefault, setResolvedDefault] = _react.useState.call(void 0, () => props.transport ? void 0 : getCachedDefaultTransport());
|
|
10796
|
+
const [transportLoadError, setTransportLoadError] = _react.useState.call(void 0, void 0);
|
|
10797
|
+
_react.useEffect.call(void 0, () => {
|
|
10798
|
+
if (props.transport || resolvedDefault) return;
|
|
10799
|
+
let cancelled = false;
|
|
10800
|
+
void loadDefaultTransport().then((transport2) => {
|
|
10801
|
+
if (!cancelled) setResolvedDefault(transport2);
|
|
10802
|
+
}).catch((err) => {
|
|
10803
|
+
if (!cancelled) setTransportLoadError(err);
|
|
10804
|
+
});
|
|
10805
|
+
return () => {
|
|
10806
|
+
cancelled = true;
|
|
10807
|
+
};
|
|
10808
|
+
}, [props.transport, resolvedDefault]);
|
|
10809
|
+
const transport = _nullishCoalesce(props.transport, () => ( resolvedDefault));
|
|
10810
|
+
if (!transport) {
|
|
10811
|
+
if (transportLoadError) throw transportLoadError;
|
|
10812
|
+
return null;
|
|
10813
|
+
}
|
|
10814
|
+
const { CacheProvider } = transport;
|
|
10815
|
+
return /* @__PURE__ */ React.default.createElement(EnvironmentI18nProvider, null, /* @__PURE__ */ React.default.createElement(SavedViewsTransportProvider, { transport }, /* @__PURE__ */ React.default.createElement(CacheProvider, null, /* @__PURE__ */ React.default.createElement(_toastalert.ToastAlertProvider, null, /* @__PURE__ */ React.default.createElement(SavedViewsContent, { ...props })))));
|
|
10744
10816
|
};
|
|
10745
10817
|
|
|
10746
10818
|
// src/components/adapters/smart-grid/SmartGridSavedViews.tsx
|
|
10747
|
-
|
|
10819
|
+
|
|
10748
10820
|
|
|
10749
10821
|
// src/components/adapters/smart-grid/SmartGridDefaultSavedView.tsx
|
|
10750
|
-
|
|
10822
|
+
|
|
10751
10823
|
var DEFAULT_COLUMN_STATE = {
|
|
10752
10824
|
hide: false,
|
|
10753
10825
|
pinned: null,
|
|
@@ -10763,13 +10835,13 @@ var DEFAULT_COLUMN_STATE = {
|
|
|
10763
10835
|
};
|
|
10764
10836
|
var getColumnStateFromDefs = (columnDefs) => {
|
|
10765
10837
|
return columnDefs.map((colDef) => {
|
|
10766
|
-
const field = colDef.field
|
|
10838
|
+
const field = _nullishCoalesce(colDef.field, () => ( colDef.colId));
|
|
10767
10839
|
if (!field) return null;
|
|
10768
10840
|
return {
|
|
10769
10841
|
colId: field,
|
|
10770
|
-
hide: colDef.hide
|
|
10771
|
-
pinned: colDef.pinned
|
|
10772
|
-
width: colDef.width
|
|
10842
|
+
hide: _nullishCoalesce(colDef.hide, () => ( false)),
|
|
10843
|
+
pinned: _nullishCoalesce(colDef.pinned, () => ( null)),
|
|
10844
|
+
width: _nullishCoalesce(_nullishCoalesce(colDef.width, () => ( colDef.minWidth)), () => ( DEFAULT_COLUMN_STATE.width)),
|
|
10773
10845
|
sort: null,
|
|
10774
10846
|
sortIndex: null,
|
|
10775
10847
|
pivot: false,
|
|
@@ -10777,24 +10849,24 @@ var getColumnStateFromDefs = (columnDefs) => {
|
|
|
10777
10849
|
aggFunc: null,
|
|
10778
10850
|
rowGroup: false,
|
|
10779
10851
|
rowGroupIndex: null,
|
|
10780
|
-
flex: colDef.flex
|
|
10852
|
+
flex: _nullishCoalesce(colDef.flex, () => ( null))
|
|
10781
10853
|
};
|
|
10782
10854
|
}).filter((col) => col !== null);
|
|
10783
10855
|
};
|
|
10784
10856
|
var extractDefaultView = (gridApi, receivedConfig) => {
|
|
10785
|
-
const columnDefs = gridApi.getColumnDefs()
|
|
10786
|
-
const defaultColumnState = receivedConfig
|
|
10857
|
+
const columnDefs = _nullishCoalesce(gridApi.getColumnDefs(), () => ( []));
|
|
10858
|
+
const defaultColumnState = _optionalChain([receivedConfig, 'optionalAccess', _88 => _88.columnState, 'optionalAccess', _89 => _89.length]) ? receivedConfig.columnState : getColumnStateFromDefs(columnDefs);
|
|
10787
10859
|
const result = {
|
|
10788
10860
|
columnState: defaultColumnState,
|
|
10789
|
-
columnGroupState: receivedConfig
|
|
10790
|
-
rowGroupState: receivedConfig
|
|
10791
|
-
filterState: receivedConfig
|
|
10792
|
-
rowHeight: receivedConfig
|
|
10861
|
+
columnGroupState: _nullishCoalesce(_optionalChain([receivedConfig, 'optionalAccess', _90 => _90.columnGroupState]), () => ( [])),
|
|
10862
|
+
rowGroupState: _nullishCoalesce(_optionalChain([receivedConfig, 'optionalAccess', _91 => _91.rowGroupState]), () => ( [])),
|
|
10863
|
+
filterState: _nullishCoalesce(_optionalChain([receivedConfig, 'optionalAccess', _92 => _92.filterState]), () => ( {})),
|
|
10864
|
+
rowHeight: _nullishCoalesce(_optionalChain([receivedConfig, 'optionalAccess', _93 => _93.rowHeight]), () => ( _optionalChain([gridApi, 'access', _94 => _94.getSizesForCurrentTheme, 'call', _95 => _95(), 'optionalAccess', _96 => _96.rowHeight])))
|
|
10793
10865
|
};
|
|
10794
10866
|
return result;
|
|
10795
10867
|
};
|
|
10796
10868
|
var useNormalizedDefaultViews = (defaultViews, gridApi) => {
|
|
10797
|
-
return (0,
|
|
10869
|
+
return _react.useMemo.call(void 0, () => {
|
|
10798
10870
|
if (!gridApi)
|
|
10799
10871
|
return defaultViews.map((view) => ({ ...view, share_token: view.id }));
|
|
10800
10872
|
return defaultViews.map((view) => ({
|
|
@@ -10806,7 +10878,7 @@ var useNormalizedDefaultViews = (defaultViews, gridApi) => {
|
|
|
10806
10878
|
};
|
|
10807
10879
|
|
|
10808
10880
|
// src/components/adapters/smart-grid/useSmartGridConfig.ts
|
|
10809
|
-
|
|
10881
|
+
|
|
10810
10882
|
var GRID_STATE_EVENTS = [
|
|
10811
10883
|
"sortChanged",
|
|
10812
10884
|
"filterOpened",
|
|
@@ -10822,10 +10894,10 @@ var GRID_STATE_EVENTS = [
|
|
|
10822
10894
|
"gridReady"
|
|
10823
10895
|
];
|
|
10824
10896
|
var useSmartGridConfig = (gridApi) => {
|
|
10825
|
-
const [config, setConfig] = (0,
|
|
10897
|
+
const [config, setConfig] = _react.useState.call(void 0,
|
|
10826
10898
|
() => getSmartGridConfig(gridApi)
|
|
10827
10899
|
);
|
|
10828
|
-
(0,
|
|
10900
|
+
_react.useEffect.call(void 0, () => {
|
|
10829
10901
|
if (!gridApi) return;
|
|
10830
10902
|
const updateConfig = () => {
|
|
10831
10903
|
setConfig(getSmartGridConfig(gridApi));
|
|
@@ -10843,20 +10915,20 @@ var useSmartGridConfig = (gridApi) => {
|
|
|
10843
10915
|
};
|
|
10844
10916
|
|
|
10845
10917
|
// src/components/adapters/smart-grid/useSavedViewsPanelOpen.ts
|
|
10846
|
-
|
|
10918
|
+
|
|
10847
10919
|
var SAVED_VIEWS_PANEL_ID = "savedViews";
|
|
10848
10920
|
var useSavedViewsPanelOpen = (gridApi) => {
|
|
10849
|
-
const [isOpen, setIsOpen] = (0,
|
|
10850
|
-
gridApi.getOpenedToolPanel
|
|
10921
|
+
const [isOpen, setIsOpen] = _react.useState.call(void 0,
|
|
10922
|
+
_optionalChain([gridApi, 'access', _97 => _97.getOpenedToolPanel, 'optionalCall', _98 => _98()]) === SAVED_VIEWS_PANEL_ID
|
|
10851
10923
|
);
|
|
10852
|
-
(0,
|
|
10924
|
+
_react.useEffect.call(void 0, () => {
|
|
10853
10925
|
const syncOpenState = () => {
|
|
10854
|
-
setIsOpen(gridApi.getOpenedToolPanel
|
|
10926
|
+
setIsOpen(_optionalChain([gridApi, 'access', _99 => _99.getOpenedToolPanel, 'optionalCall', _100 => _100()]) === SAVED_VIEWS_PANEL_ID);
|
|
10855
10927
|
};
|
|
10856
10928
|
syncOpenState();
|
|
10857
|
-
gridApi.addEventListener
|
|
10929
|
+
_optionalChain([gridApi, 'access', _101 => _101.addEventListener, 'optionalCall', _102 => _102("toolPanelVisibleChanged", syncOpenState)]);
|
|
10858
10930
|
return () => {
|
|
10859
|
-
gridApi.removeEventListener
|
|
10931
|
+
_optionalChain([gridApi, 'access', _103 => _103.removeEventListener, 'optionalCall', _104 => _104("toolPanelVisibleChanged", syncOpenState)]);
|
|
10860
10932
|
};
|
|
10861
10933
|
}, [gridApi]);
|
|
10862
10934
|
return isOpen;
|
|
@@ -10868,8 +10940,8 @@ var SmartGridSavedViews = (props) => {
|
|
|
10868
10940
|
const { config: tableConfig, setConfig: setTableConfig } = useSmartGridConfig(gridApi);
|
|
10869
10941
|
const isPanelOpen = useSavedViewsPanelOpen(gridApi);
|
|
10870
10942
|
const presetViews = useNormalizedDefaultViews(props.defaultViews, gridApi);
|
|
10871
|
-
const defaultView = presetViews.find((view) => view.id === "default")
|
|
10872
|
-
const onSelect = (0,
|
|
10943
|
+
const defaultView = _nullishCoalesce(presetViews.find((view) => view.id === "default"), () => ( presetViews[0]));
|
|
10944
|
+
const onSelect = _react.useCallback.call(void 0,
|
|
10873
10945
|
({ item }) => {
|
|
10874
10946
|
if (!gridApi) return item;
|
|
10875
10947
|
const isPresetView = item.view_level === "default";
|
|
@@ -10877,7 +10949,7 @@ var SmartGridSavedViews = (props) => {
|
|
|
10877
10949
|
updateTableConfig(item, gridApi, "smart-grid");
|
|
10878
10950
|
setTableConfig({
|
|
10879
10951
|
...item.table_config,
|
|
10880
|
-
filterState: gridApi.getFilterModel
|
|
10952
|
+
filterState: _nullishCoalesce(_optionalChain([gridApi, 'access', _105 => _105.getFilterModel, 'optionalCall', _106 => _106()]), () => ( {}))
|
|
10881
10953
|
});
|
|
10882
10954
|
return item;
|
|
10883
10955
|
}
|
|
@@ -10890,13 +10962,13 @@ var SmartGridSavedViews = (props) => {
|
|
|
10890
10962
|
};
|
|
10891
10963
|
updateTableConfig(updatedView, gridApi, "smart-grid");
|
|
10892
10964
|
const updatedConfig = updatedView.table_config;
|
|
10893
|
-
gridApi.setFilterModel(updatedConfig.filterState
|
|
10965
|
+
gridApi.setFilterModel(_nullishCoalesce(updatedConfig.filterState, () => ( {})));
|
|
10894
10966
|
setTableConfig(updatedConfig);
|
|
10895
10967
|
return updatedView;
|
|
10896
10968
|
},
|
|
10897
10969
|
[gridApi, tableConfig, setTableConfig]
|
|
10898
10970
|
);
|
|
10899
|
-
return /* @__PURE__ */
|
|
10971
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
10900
10972
|
SavedViews,
|
|
10901
10973
|
{
|
|
10902
10974
|
onSelect,
|
|
@@ -10909,16 +10981,22 @@ var SmartGridSavedViews = (props) => {
|
|
|
10909
10981
|
presetViews,
|
|
10910
10982
|
tableName: props.tableName,
|
|
10911
10983
|
tableConfig,
|
|
10912
|
-
isPanelOpen
|
|
10984
|
+
isPanelOpen,
|
|
10985
|
+
transport: props.transport
|
|
10913
10986
|
}
|
|
10914
10987
|
);
|
|
10915
10988
|
};
|
|
10916
10989
|
|
|
10917
10990
|
// src/components/adapters/data-table/DataTableSavedViews.tsx
|
|
10918
|
-
|
|
10991
|
+
|
|
10992
|
+
|
|
10993
|
+
|
|
10994
|
+
|
|
10995
|
+
|
|
10996
|
+
|
|
10919
10997
|
|
|
10920
10998
|
// src/components/adapters/data-table/DataTableDefaultSavedView.tsx
|
|
10921
|
-
|
|
10999
|
+
|
|
10922
11000
|
var DEFAULT_COLUMN_STATE2 = {
|
|
10923
11001
|
hidden: false,
|
|
10924
11002
|
pinned: null,
|
|
@@ -10939,33 +11017,33 @@ var getColumnState = (columnDefinitions) => {
|
|
|
10939
11017
|
}
|
|
10940
11018
|
return {
|
|
10941
11019
|
field: column2.field,
|
|
10942
|
-
hidden: column2.hidden
|
|
10943
|
-
pinned: column2.pinned
|
|
11020
|
+
hidden: _nullishCoalesce(column2.hidden, () => ( false)),
|
|
11021
|
+
pinned: _nullishCoalesce(column2.pinned, () => ( null)),
|
|
10944
11022
|
rowGroup: false,
|
|
10945
11023
|
rowGroupIndex: null,
|
|
10946
11024
|
sort: null,
|
|
10947
11025
|
sortIndex: null,
|
|
10948
|
-
width: (column2.minWidth
|
|
11026
|
+
width: (_nullishCoalesce(column2.minWidth, () => ( DEFAULT_COLUMN_STATE2.width))) > DEFAULT_COLUMN_STATE2.width ? _nullishCoalesce(column2.minWidth, () => ( DEFAULT_COLUMN_STATE2.width)) : (_nullishCoalesce(column2.maxWidth, () => ( DEFAULT_COLUMN_STATE2.width))) < DEFAULT_COLUMN_STATE2.width ? _nullishCoalesce(column2.maxWidth, () => ( DEFAULT_COLUMN_STATE2.width)) : DEFAULT_COLUMN_STATE2.width
|
|
10949
11027
|
};
|
|
10950
11028
|
});
|
|
10951
11029
|
};
|
|
10952
11030
|
var extractDefaultView2 = (columnDefinitions, receivedConfigFromTool) => {
|
|
10953
11031
|
const defaultColumnState = getColumnState(columnDefinitions);
|
|
10954
11032
|
const result = {
|
|
10955
|
-
columnState: receivedConfigFromTool
|
|
10956
|
-
serverFilters: receivedConfigFromTool
|
|
10957
|
-
columnGroupState: receivedConfigFromTool
|
|
10958
|
-
filters: receivedConfigFromTool
|
|
11033
|
+
columnState: _optionalChain([receivedConfigFromTool, 'optionalAccess', _107 => _107.columnState, 'optionalAccess', _108 => _108.length]) ? receivedConfigFromTool.columnState : defaultColumnState,
|
|
11034
|
+
serverFilters: _nullishCoalesce(_optionalChain([receivedConfigFromTool, 'optionalAccess', _109 => _109.serverFilters]), () => ( [])),
|
|
11035
|
+
columnGroupState: _nullishCoalesce(_optionalChain([receivedConfigFromTool, 'optionalAccess', _110 => _110.columnGroupState]), () => ( [])),
|
|
11036
|
+
filters: _nullishCoalesce(_optionalChain([receivedConfigFromTool, 'optionalAccess', _111 => _111.filters]), () => ( {})),
|
|
10959
11037
|
groupRowState: {
|
|
10960
|
-
expandedRoutes: receivedConfigFromTool
|
|
10961
|
-
collapsedRoutes: receivedConfigFromTool
|
|
11038
|
+
expandedRoutes: _nullishCoalesce(_optionalChain([receivedConfigFromTool, 'optionalAccess', _112 => _112.groupRowState, 'optionalAccess', _113 => _113.expandedRoutes]), () => ( [])),
|
|
11039
|
+
collapsedRoutes: _nullishCoalesce(_optionalChain([receivedConfigFromTool, 'optionalAccess', _114 => _114.groupRowState, 'optionalAccess', _115 => _115.collapsedRoutes]), () => ( []))
|
|
10962
11040
|
},
|
|
10963
|
-
rowHeight: receivedConfigFromTool
|
|
11041
|
+
rowHeight: _nullishCoalesce(_optionalChain([receivedConfigFromTool, 'optionalAccess', _116 => _116.rowHeight]), () => ( MEDIUM_ROW_HEIGHT))
|
|
10964
11042
|
};
|
|
10965
11043
|
return result;
|
|
10966
11044
|
};
|
|
10967
11045
|
var useNormalizedDefaultViews2 = (defaultViews, columnDefinitions) => {
|
|
10968
|
-
return (0,
|
|
11046
|
+
return _react.useMemo.call(void 0,
|
|
10969
11047
|
() => defaultViews.map((view) => ({
|
|
10970
11048
|
...view,
|
|
10971
11049
|
share_token: view.id,
|
|
@@ -10976,25 +11054,25 @@ var useNormalizedDefaultViews2 = (defaultViews, columnDefinitions) => {
|
|
|
10976
11054
|
};
|
|
10977
11055
|
|
|
10978
11056
|
// src/components/adapters/data-table/DataTableSavedViews.tsx
|
|
10979
|
-
var DataTableSavedViews = (0,
|
|
11057
|
+
var DataTableSavedViews = _react.forwardRef.call(void 0, (props, ref) => {
|
|
10980
11058
|
const { tableApi, userId, projectId, companyId } = props;
|
|
10981
11059
|
const presetViews = useNormalizedDefaultViews2(
|
|
10982
11060
|
props.defaultViews,
|
|
10983
11061
|
props.columnDefinitions
|
|
10984
11062
|
);
|
|
10985
|
-
const defaultView = presetViews.find((view) => view.id === "default")
|
|
10986
|
-
const [internalTableConfig, setInternalTableConfig] = (0,
|
|
11063
|
+
const defaultView = _nullishCoalesce(presetViews.find((view) => view.id === "default"), () => ( presetViews[0]));
|
|
11064
|
+
const [internalTableConfig, setInternalTableConfig] = _react.useState.call(void 0,
|
|
10987
11065
|
ViewStorage.load(props.stickyViewsKey, defaultView).table_config
|
|
10988
11066
|
);
|
|
10989
|
-
(0,
|
|
11067
|
+
_react.useImperativeHandle.call(void 0, ref, () => ({
|
|
10990
11068
|
setTableConfig: (newConfig) => {
|
|
10991
11069
|
setInternalTableConfig(newConfig);
|
|
10992
11070
|
}
|
|
10993
11071
|
}));
|
|
10994
|
-
const onSelect = (0,
|
|
11072
|
+
const onSelect = _react.useCallback.call(void 0,
|
|
10995
11073
|
({ item }) => {
|
|
10996
11074
|
const isPresetView = item.view_level === "default";
|
|
10997
|
-
const syncReferenceConfig = tableApi
|
|
11075
|
+
const syncReferenceConfig = _nullishCoalesce(_optionalChain([tableApi, 'optionalAccess', _117 => _117.getTableConfiguration, 'optionalCall', _118 => _118()]), () => ( defaultView.table_config));
|
|
10998
11076
|
const syncedConfig = isPresetView ? item.table_config : customAndConfigSync(
|
|
10999
11077
|
item.table_config,
|
|
11000
11078
|
syncReferenceConfig
|
|
@@ -11014,7 +11092,7 @@ var DataTableSavedViews = (0, import_react22.forwardRef)((props, ref) => {
|
|
|
11014
11092
|
if (!internalTableConfig) {
|
|
11015
11093
|
return null;
|
|
11016
11094
|
}
|
|
11017
|
-
return /* @__PURE__ */
|
|
11095
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
11018
11096
|
SavedViews,
|
|
11019
11097
|
{
|
|
11020
11098
|
onSelect,
|
|
@@ -11026,26 +11104,26 @@ var DataTableSavedViews = (0, import_react22.forwardRef)((props, ref) => {
|
|
|
11026
11104
|
defaultView,
|
|
11027
11105
|
presetViews,
|
|
11028
11106
|
tableName: props.tableName,
|
|
11029
|
-
tableConfig: internalTableConfig
|
|
11107
|
+
tableConfig: internalTableConfig,
|
|
11108
|
+
transport: props.transport
|
|
11030
11109
|
}
|
|
11031
11110
|
);
|
|
11032
11111
|
});
|
|
11033
11112
|
DataTableSavedViews.displayName = "DataTableSavedViews";
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
});
|
|
11113
|
+
|
|
11114
|
+
|
|
11115
|
+
|
|
11116
|
+
|
|
11117
|
+
|
|
11118
|
+
|
|
11119
|
+
|
|
11120
|
+
|
|
11121
|
+
|
|
11122
|
+
|
|
11123
|
+
|
|
11124
|
+
|
|
11125
|
+
|
|
11126
|
+
exports.DataTableSavedViews = DataTableSavedViews; exports.ExpandedPanel = ExpandedPanel; exports.FormModal = FormModal; exports.PanelContent = PanelContent; exports.SavedViewCollectionMenuItem = SavedViewCollectionMenuItem; exports.SavedViews = SavedViews; exports.SavedViewsDeleteConfirmationModalShared = SavedViewsDeleteConfirmationModalShared; exports.SavedViewsSelectionProvider = SavedViewsSelectionProvider; exports.SmartGridSavedViews = SmartGridSavedViews; exports.getTranslations = getTranslations; exports.useSavedViewsPanel = useSavedViewsPanel_default; exports.useSavedViewsSelection = useSavedViewsSelection;
|
|
11049
11127
|
/*! Bundled license information:
|
|
11050
11128
|
|
|
11051
11129
|
lodash/lodash.js:
|