@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/legacy/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(); } }
|
|
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)`
|
|
@@ -9016,40 +8980,40 @@ var SavedViewsButton = ({
|
|
|
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,7 +9072,7 @@ 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
|
var _a, _b;
|
|
9088
9078
|
if (!props.item) {
|
|
@@ -9106,8 +9096,10 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9106
9096
|
event.stopPropagation();
|
|
9107
9097
|
(_a = props.onUpdate) == null ? void 0 : _a.call(props, props.item);
|
|
9108
9098
|
};
|
|
9109
|
-
const { showToast } = (0,
|
|
9110
|
-
const i18n = (0,
|
|
9099
|
+
const { showToast } = _toastalert.useToastAlertContext.call(void 0, );
|
|
9100
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
9101
|
+
const transport = useOptionalSavedViewsTransport();
|
|
9102
|
+
const canShareViaUrl = (transport == null ? void 0 : transport.supportsUrlSharing) !== false;
|
|
9111
9103
|
const copyShareLink = async (event) => {
|
|
9112
9104
|
event.stopPropagation();
|
|
9113
9105
|
try {
|
|
@@ -9130,18 +9122,18 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9130
9122
|
label: i18n.t("savedViews.actions.delete")
|
|
9131
9123
|
}
|
|
9132
9124
|
];
|
|
9133
|
-
const preventEventBubbleToNotTriggerViewSelectEvent =
|
|
9125
|
+
const preventEventBubbleToNotTriggerViewSelectEvent = React17.useCallback(
|
|
9134
9126
|
(e) => {
|
|
9135
9127
|
e.stopPropagation();
|
|
9136
9128
|
},
|
|
9137
9129
|
[]
|
|
9138
9130
|
);
|
|
9139
9131
|
const hasUpdateButton = props.item.view_level !== "default" && props.canUpdate;
|
|
9140
|
-
const hasCopyShareLinkButton = props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9132
|
+
const hasCopyShareLinkButton = canShareViaUrl && props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9141
9133
|
const hasClearTemporaryButton = props.item.id === "temporary";
|
|
9142
9134
|
const hasOverflowMenu = props.item.view_level !== "default" && props.canEditOrDelete;
|
|
9143
9135
|
const hasActions = hasUpdateButton || hasCopyShareLinkButton || hasClearTemporaryButton || hasOverflowMenu;
|
|
9144
|
-
return /* @__PURE__ */
|
|
9136
|
+
return /* @__PURE__ */ React17.createElement(
|
|
9145
9137
|
Container2,
|
|
9146
9138
|
{
|
|
9147
9139
|
"aria-selected": Boolean(props.selected),
|
|
@@ -9153,7 +9145,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9153
9145
|
"data-testid": "saved-view-collection-menu-item",
|
|
9154
9146
|
onKeyDown: preventEventBubbleToNotTriggerViewSelectEvent
|
|
9155
9147
|
},
|
|
9156
|
-
/* @__PURE__ */
|
|
9148
|
+
/* @__PURE__ */ React17.createElement(
|
|
9157
9149
|
"span",
|
|
9158
9150
|
{
|
|
9159
9151
|
"data-testid": "saved-view-display-name",
|
|
@@ -9161,8 +9153,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9161
9153
|
},
|
|
9162
9154
|
props.item.name
|
|
9163
9155
|
),
|
|
9164
|
-
hasActions && /* @__PURE__ */
|
|
9165
|
-
|
|
9156
|
+
hasActions && /* @__PURE__ */ React17.createElement(RowActionsBox, null, /* @__PURE__ */ React17.createElement(_corereact.Box, { justifyContent: "space-between" }, hasUpdateButton && /* @__PURE__ */ React17.createElement(
|
|
9157
|
+
_corereact.Button,
|
|
9166
9158
|
{
|
|
9167
9159
|
onClick: updateItem,
|
|
9168
9160
|
variant: "secondary",
|
|
@@ -9172,8 +9164,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9172
9164
|
loading: props.isUpdateProcessing
|
|
9173
9165
|
},
|
|
9174
9166
|
i18n.t("savedViews.actions.update")
|
|
9175
|
-
), hasCopyShareLinkButton && /* @__PURE__ */
|
|
9176
|
-
|
|
9167
|
+
), hasCopyShareLinkButton && /* @__PURE__ */ React17.createElement(
|
|
9168
|
+
_corereact.Button,
|
|
9177
9169
|
{
|
|
9178
9170
|
onClick: copyShareLink,
|
|
9179
9171
|
variant: "tertiary",
|
|
@@ -9181,9 +9173,9 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9181
9173
|
"aria-label": i18n.t("savedViews.actions.copyShareLink"),
|
|
9182
9174
|
"data-testid": "copy-share-link-button"
|
|
9183
9175
|
},
|
|
9184
|
-
/* @__PURE__ */
|
|
9185
|
-
), hasClearTemporaryButton && /* @__PURE__ */
|
|
9186
|
-
|
|
9176
|
+
/* @__PURE__ */ React17.createElement(IconWrapper, null, /* @__PURE__ */ React17.createElement(Link_default, { size: "sm" }))
|
|
9177
|
+
), hasClearTemporaryButton && /* @__PURE__ */ React17.createElement(
|
|
9178
|
+
_corereact.Button,
|
|
9187
9179
|
{
|
|
9188
9180
|
onClick: (e) => {
|
|
9189
9181
|
var _a;
|
|
@@ -9196,9 +9188,9 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9196
9188
|
title: i18n.t("savedViews.actions.clearTemporary"),
|
|
9197
9189
|
"data-testid": "clear-temporary-view-button"
|
|
9198
9190
|
},
|
|
9199
|
-
/* @__PURE__ */
|
|
9200
|
-
)), /* @__PURE__ */
|
|
9201
|
-
|
|
9191
|
+
/* @__PURE__ */ React17.createElement(IconWrapper, null, /* @__PURE__ */ React17.createElement(Clear_default, { size: "sm" }))
|
|
9192
|
+
)), /* @__PURE__ */ React17.createElement(_corereact.Box, null, hasOverflowMenu && /* @__PURE__ */ React17.createElement(
|
|
9193
|
+
_corereact.DropdownFlyout,
|
|
9202
9194
|
{
|
|
9203
9195
|
"data-testid": "saved-view-overflow-button",
|
|
9204
9196
|
options: flyoutMenuOptions,
|
|
@@ -9213,26 +9205,20 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9213
9205
|
};
|
|
9214
9206
|
|
|
9215
9207
|
// src/components/panels/ExpandedPanel.tsx
|
|
9216
|
-
|
|
9217
|
-
var ExpandedPanel = pt(
|
|
9208
|
+
|
|
9209
|
+
var ExpandedPanel = pt(_corereact.Panel)`
|
|
9218
9210
|
width: ${({ provider }) => provider === "data-table" ? "316px" : "100%"};
|
|
9219
9211
|
height: 100%;
|
|
9220
9212
|
border-radius: 4px 0 0 4px;
|
|
9221
9213
|
`;
|
|
9222
9214
|
|
|
9223
9215
|
// src/components/panels/PanelContent.tsx
|
|
9224
|
-
var import_core_react8 = require("@procore/core-react");
|
|
9225
|
-
var import_toast_alert2 = require("@procore/toast-alert");
|
|
9226
|
-
var import_react10 = __toESM(require("react"));
|
|
9227
9216
|
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
var import_react_query2 = require("@tanstack/react-query");
|
|
9217
|
+
|
|
9218
|
+
|
|
9231
9219
|
|
|
9232
9220
|
// src/utils/api/queriesHandler.ts
|
|
9233
|
-
|
|
9234
|
-
var import_react_query = require("@tanstack/react-query");
|
|
9235
|
-
var import_core_react5 = require("@procore/core-react");
|
|
9221
|
+
|
|
9236
9222
|
var getBasePath = (companyId, projectId) => {
|
|
9237
9223
|
if (projectId) {
|
|
9238
9224
|
return `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views`;
|
|
@@ -9241,22 +9227,39 @@ var getBasePath = (companyId, projectId) => {
|
|
|
9241
9227
|
};
|
|
9242
9228
|
var useApiRequest = (props, method, mutationKey) => {
|
|
9243
9229
|
const { projectId, companyId, domain, tableName } = props;
|
|
9244
|
-
const
|
|
9245
|
-
const
|
|
9230
|
+
const transport = useSavedViewsTransport();
|
|
9231
|
+
const http = transport.useHttp();
|
|
9232
|
+
const cacheControl = transport.useCacheControl();
|
|
9233
|
+
const { locale } = _corereact.useI18nContext.call(void 0, );
|
|
9246
9234
|
const basePath = getBasePath(companyId, projectId);
|
|
9247
|
-
const queryKey = [
|
|
9248
|
-
|
|
9235
|
+
const queryKey = [
|
|
9236
|
+
"savedViews",
|
|
9237
|
+
domain,
|
|
9238
|
+
tableName,
|
|
9239
|
+
companyId,
|
|
9240
|
+
projectId
|
|
9241
|
+
];
|
|
9242
|
+
return transport.useMutationAdapter({
|
|
9249
9243
|
mutationKey,
|
|
9250
9244
|
mutationFn: async (savedView) => {
|
|
9251
|
-
let url =
|
|
9252
|
-
|
|
9245
|
+
let url = basePath;
|
|
9246
|
+
let body = { ...savedView };
|
|
9247
|
+
if (method === "DELETE") {
|
|
9253
9248
|
url = `${basePath}/${savedView.share_token}?permissions_domain=${domain}`;
|
|
9249
|
+
} else if (method === "PUT") {
|
|
9250
|
+
url = `${basePath}/${savedView.share_token}`;
|
|
9251
|
+
body = { ...savedView, permissions_domain: domain };
|
|
9254
9252
|
} else {
|
|
9255
|
-
|
|
9253
|
+
body = {
|
|
9254
|
+
...savedView,
|
|
9255
|
+
table_name: tableName,
|
|
9256
|
+
permissions_domain: domain
|
|
9257
|
+
};
|
|
9256
9258
|
}
|
|
9257
|
-
const response = await (
|
|
9259
|
+
const response = await http({
|
|
9258
9260
|
method,
|
|
9259
|
-
|
|
9261
|
+
url,
|
|
9262
|
+
body: JSON.stringify(body),
|
|
9260
9263
|
headers: {
|
|
9261
9264
|
"Content-Type": "application/json",
|
|
9262
9265
|
"Accept-Language": locale
|
|
@@ -9269,23 +9272,19 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
9269
9272
|
},
|
|
9270
9273
|
onSuccess: (savedView) => {
|
|
9271
9274
|
if (method === "DELETE" || method === "POST") {
|
|
9272
|
-
|
|
9273
|
-
queryKey
|
|
9274
|
-
});
|
|
9275
|
+
cacheControl.invalidate(queryKey);
|
|
9275
9276
|
return;
|
|
9276
9277
|
} else {
|
|
9277
|
-
const oldData =
|
|
9278
|
+
const oldData = cacheControl.getData(queryKey);
|
|
9278
9279
|
const oldView = oldData == null ? void 0 : oldData.find(
|
|
9279
9280
|
(item) => item.share_token === savedView.share_token
|
|
9280
9281
|
);
|
|
9281
9282
|
if ((oldView == null ? void 0 : oldView.name) !== savedView.name) {
|
|
9282
|
-
|
|
9283
|
-
queryKey
|
|
9284
|
-
});
|
|
9283
|
+
cacheControl.invalidate(queryKey);
|
|
9285
9284
|
return;
|
|
9286
9285
|
}
|
|
9287
9286
|
}
|
|
9288
|
-
|
|
9287
|
+
cacheControl.setData(queryKey, (oldData) => {
|
|
9289
9288
|
if (!oldData) return [savedView];
|
|
9290
9289
|
return oldData.map(
|
|
9291
9290
|
(item) => item.share_token === savedView.share_token ? savedView : item
|
|
@@ -9314,13 +9313,17 @@ var getBasePath2 = (companyId, projectId) => {
|
|
|
9314
9313
|
};
|
|
9315
9314
|
var useSavedViewsQuery = (props) => {
|
|
9316
9315
|
const { projectId, companyId, domain, tableName } = props;
|
|
9316
|
+
const transport = useSavedViewsTransport();
|
|
9317
|
+
const http = transport.useHttp();
|
|
9317
9318
|
const basePath = getBasePath2(companyId, projectId);
|
|
9318
9319
|
const url = `${basePath}?table_name=${tableName}&permissions_domain=${domain}`;
|
|
9319
|
-
return
|
|
9320
|
+
return transport.useQueryAdapter({
|
|
9320
9321
|
queryKey: ["savedViews", domain, tableName, companyId, projectId],
|
|
9321
9322
|
queryFn: async () => {
|
|
9322
9323
|
const getUrl = `${url}&per_page=${PAGE_SIZE}`;
|
|
9323
|
-
const response = await (
|
|
9324
|
+
const response = await http({
|
|
9325
|
+
method: "GET",
|
|
9326
|
+
url: getUrl,
|
|
9324
9327
|
priority: "low"
|
|
9325
9328
|
});
|
|
9326
9329
|
return response.data;
|
|
@@ -9329,12 +9332,16 @@ var useSavedViewsQuery = (props) => {
|
|
|
9329
9332
|
};
|
|
9330
9333
|
var useSavedViewsPermissions = (props) => {
|
|
9331
9334
|
const { projectId, companyId, domain } = props;
|
|
9335
|
+
const transport = useSavedViewsTransport();
|
|
9336
|
+
const http = transport.useHttp();
|
|
9332
9337
|
const basePath = getBasePath2(companyId, projectId);
|
|
9333
9338
|
const url = `${basePath}/permissions?permissions_domain=${domain}`;
|
|
9334
|
-
return
|
|
9339
|
+
return transport.useQueryAdapter({
|
|
9335
9340
|
queryKey: ["savedViewsConfig", domain, companyId, projectId],
|
|
9336
9341
|
queryFn: async () => {
|
|
9337
|
-
const response = await (
|
|
9342
|
+
const response = await http({
|
|
9343
|
+
method: "GET",
|
|
9344
|
+
url,
|
|
9338
9345
|
priority: "low"
|
|
9339
9346
|
});
|
|
9340
9347
|
return response.data;
|
|
@@ -9358,13 +9365,17 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
|
|
|
9358
9365
|
]);
|
|
9359
9366
|
var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
9360
9367
|
const { projectId, companyId, domain } = queryInput;
|
|
9368
|
+
const transport = useSavedViewsTransport();
|
|
9369
|
+
const http = transport.useHttp();
|
|
9361
9370
|
const basePath = getBasePath2(companyId, projectId);
|
|
9362
|
-
return
|
|
9371
|
+
return transport.useQueryAdapter({
|
|
9363
9372
|
enabled: enabled && Boolean(savedViewToken),
|
|
9364
9373
|
queryKey: ["savedView", savedViewToken, companyId, projectId],
|
|
9365
9374
|
queryFn: async () => {
|
|
9366
9375
|
const url = `${basePath}/${savedViewToken}?permissions_domain=${domain}`;
|
|
9367
|
-
const response = await (
|
|
9376
|
+
const response = await http({
|
|
9377
|
+
method: "GET",
|
|
9378
|
+
url,
|
|
9368
9379
|
priority: "low"
|
|
9369
9380
|
});
|
|
9370
9381
|
return response.data;
|
|
@@ -9373,14 +9384,14 @@ var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
|
9373
9384
|
};
|
|
9374
9385
|
|
|
9375
9386
|
// src/components/panels/PanelContentUtils.ts
|
|
9376
|
-
var import_lodash = __toESM(require_lodash());
|
|
9387
|
+
var import_lodash = _chunkQGM4M3NIjs.__toESM.call(void 0, require_lodash());
|
|
9377
9388
|
|
|
9378
9389
|
// src/components/adapters/smart-grid/SmartGridUtils.ts
|
|
9379
9390
|
function getSmartGridConfig(api) {
|
|
9380
9391
|
const columnState = api.getColumnState();
|
|
9381
9392
|
const columnGroupState = api.getColumnGroupState();
|
|
9382
9393
|
const rowGroupState = api.getRowGroupColumns().map((col) => col.getColId());
|
|
9383
|
-
const rowHeight = api.getGridOption("rowHeight")
|
|
9394
|
+
const rowHeight = _nullishCoalesce(api.getGridOption("rowHeight"), () => ( api.getSizesForCurrentTheme().rowHeight));
|
|
9384
9395
|
const filterState = api.getFilterModel();
|
|
9385
9396
|
return {
|
|
9386
9397
|
columnState,
|
|
@@ -9451,7 +9462,7 @@ var updateTableConfig = (view, tableApi, provider) => {
|
|
|
9451
9462
|
const tableConfig = view.table_config;
|
|
9452
9463
|
if (tableConfig) {
|
|
9453
9464
|
const currentTableConfig = (_a = dataTableApi == null ? void 0 : dataTableApi.getTableConfiguration) == null ? void 0 : _a.call(dataTableApi);
|
|
9454
|
-
const rowHeight = (tableConfig == null ? void 0 : tableConfig.rowHeight)
|
|
9465
|
+
const rowHeight = _nullishCoalesce((tableConfig == null ? void 0 : tableConfig.rowHeight), () => ( (currentTableConfig == null ? void 0 : currentTableConfig.rowHeight)));
|
|
9455
9466
|
const hasServerFilters = Boolean((_b = currentTableConfig == null ? void 0 : currentTableConfig.serverFilters) == null ? void 0 : _b.length) || Boolean((_c = tableConfig == null ? void 0 : tableConfig.serverFilters) == null ? void 0 : _c.length);
|
|
9456
9467
|
const usesServerSideFiltering = hasServerFilters;
|
|
9457
9468
|
if (rowHeight !== void 0) {
|
|
@@ -9585,10 +9596,10 @@ var hasPermissionForViewLevel = (viewLevel, permissions) => {
|
|
|
9585
9596
|
};
|
|
9586
9597
|
|
|
9587
9598
|
// src/components/panels/useGroups.ts
|
|
9588
|
-
|
|
9599
|
+
|
|
9589
9600
|
var useGroups = (isProjectLevelTool) => {
|
|
9590
9601
|
const viewLevels = getViewLevels(isProjectLevelTool);
|
|
9591
|
-
const [groups, setGroups] = (0,
|
|
9602
|
+
const [groups, setGroups] = _react.useState.call(void 0,
|
|
9592
9603
|
Object.fromEntries(viewLevels.map((level) => [level, true]))
|
|
9593
9604
|
);
|
|
9594
9605
|
const toggleGroup = (group) => {
|
|
@@ -9598,26 +9609,32 @@ var useGroups = (isProjectLevelTool) => {
|
|
|
9598
9609
|
};
|
|
9599
9610
|
|
|
9600
9611
|
// src/components/panels/ViewLevelHeader.tsx
|
|
9601
|
-
|
|
9602
|
-
|
|
9612
|
+
|
|
9613
|
+
|
|
9614
|
+
|
|
9615
|
+
|
|
9616
|
+
|
|
9617
|
+
|
|
9618
|
+
|
|
9619
|
+
|
|
9603
9620
|
var groupIcon = (group) => {
|
|
9604
9621
|
switch (group) {
|
|
9605
9622
|
case "personal":
|
|
9606
|
-
return /* @__PURE__ */
|
|
9623
|
+
return /* @__PURE__ */ React.default.createElement(Person_default, null);
|
|
9607
9624
|
case "project":
|
|
9608
|
-
return /* @__PURE__ */
|
|
9625
|
+
return /* @__PURE__ */ React.default.createElement(Excavator_default, null);
|
|
9609
9626
|
case "company":
|
|
9610
|
-
return /* @__PURE__ */
|
|
9627
|
+
return /* @__PURE__ */ React.default.createElement(Building_default, null);
|
|
9611
9628
|
}
|
|
9612
9629
|
};
|
|
9613
|
-
var StyledButton = pt(
|
|
9630
|
+
var StyledButton = pt(_corereact.Button)`
|
|
9614
9631
|
&:hover {
|
|
9615
|
-
background-color: ${
|
|
9632
|
+
background-color: ${_corereact.colors.gray98};
|
|
9616
9633
|
}
|
|
9617
9634
|
`;
|
|
9618
9635
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9619
|
-
const I18n = (0,
|
|
9620
|
-
return /* @__PURE__ */
|
|
9636
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9637
|
+
return /* @__PURE__ */ React.default.createElement(_corereact.Box, { style: { width: "100%" } }, /* @__PURE__ */ React.default.createElement(
|
|
9621
9638
|
StyledButton,
|
|
9622
9639
|
{
|
|
9623
9640
|
block: true,
|
|
@@ -9630,19 +9647,19 @@ var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
|
9630
9647
|
onClick: () => toggleGroup(group),
|
|
9631
9648
|
"aria-controls": `saved-views-collections-${group}`,
|
|
9632
9649
|
"aria-expanded": expanded,
|
|
9633
|
-
icon: expanded ? /* @__PURE__ */
|
|
9650
|
+
icon: expanded ? /* @__PURE__ */ React.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React.default.createElement(ChevronRight_default, { size: "sm" })
|
|
9634
9651
|
},
|
|
9635
9652
|
groupIcon(group),
|
|
9636
|
-
/* @__PURE__ */
|
|
9653
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9637
9654
|
));
|
|
9638
9655
|
};
|
|
9639
9656
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9640
9657
|
|
|
9641
9658
|
// src/utils/hooks/useScrollToRef.ts
|
|
9642
|
-
|
|
9659
|
+
|
|
9643
9660
|
var useScrollToRef = (dependency) => {
|
|
9644
|
-
const ref = (0,
|
|
9645
|
-
(0,
|
|
9661
|
+
const ref = _react.useRef.call(void 0, null);
|
|
9662
|
+
_react.useEffect.call(void 0, () => {
|
|
9646
9663
|
if (ref.current) {
|
|
9647
9664
|
ref.current.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
9648
9665
|
}
|
|
@@ -9651,41 +9668,46 @@ var useScrollToRef = (dependency) => {
|
|
|
9651
9668
|
};
|
|
9652
9669
|
|
|
9653
9670
|
// src/components/panels/PanelContent.styles.ts
|
|
9654
|
-
|
|
9655
|
-
|
|
9671
|
+
|
|
9672
|
+
|
|
9673
|
+
|
|
9674
|
+
|
|
9675
|
+
|
|
9676
|
+
|
|
9677
|
+
var Row = pt(_corereact.MenuImperative.Item)`
|
|
9656
9678
|
width: 100%;
|
|
9657
9679
|
padding-left: 35px;
|
|
9658
9680
|
padding-right: 4px;
|
|
9659
|
-
background-color: ${({ selected }) => selected ?
|
|
9681
|
+
background-color: ${({ selected }) => selected ? _corereact.colors.blue96 : "transparent"};
|
|
9660
9682
|
|
|
9661
9683
|
&:hover {
|
|
9662
|
-
background-color: ${({ selected }) => selected ?
|
|
9684
|
+
background-color: ${({ selected }) => selected ? _corereact.colors.blue96 : _corereact.colors.gray98};
|
|
9663
9685
|
}
|
|
9664
9686
|
`;
|
|
9665
|
-
var Panel2 = pt(
|
|
9687
|
+
var Panel2 = pt(_corereact.DetailPage.Card)`
|
|
9666
9688
|
margin: 0;
|
|
9667
9689
|
height: 100%;
|
|
9668
|
-
padding-top: ${
|
|
9690
|
+
padding-top: ${_corereact.spacing.sm}px;
|
|
9669
9691
|
box-shadow: none;
|
|
9670
9692
|
`;
|
|
9671
9693
|
|
|
9672
9694
|
// src/components/panels/PanelContent.tsx
|
|
9673
|
-
var StyledMenuImperative = pt(
|
|
9695
|
+
var StyledMenuImperative = pt(_corereact.MenuImperative)`
|
|
9674
9696
|
div[role='listbox'] {
|
|
9675
9697
|
padding: 0;
|
|
9676
9698
|
}
|
|
9677
9699
|
`;
|
|
9678
9700
|
var PanelContent = (props) => {
|
|
9679
9701
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9680
|
-
const { showToast } = (0,
|
|
9681
|
-
const I18n = (0,
|
|
9702
|
+
const { showToast } = _toastalert.useToastAlertContext.call(void 0, );
|
|
9703
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9682
9704
|
const { data: savedViewsFromQuery, error: savedViewsError } = useSavedViewsQuery(props.queryInput);
|
|
9683
9705
|
const updateMutation = useUpdateSavedView(queryInput);
|
|
9684
9706
|
const { mutate: updateSavedView } = updateMutation;
|
|
9685
|
-
const isUpdateLoading =
|
|
9686
|
-
const savedViews = props.savedViews
|
|
9687
|
-
const errorToastRef =
|
|
9688
|
-
|
|
9707
|
+
const isUpdateLoading = updateMutation.isPending;
|
|
9708
|
+
const savedViews = _nullishCoalesce(props.savedViews, () => ( savedViewsFromQuery));
|
|
9709
|
+
const errorToastRef = React.default.useRef(null);
|
|
9710
|
+
React.default.useEffect(() => {
|
|
9689
9711
|
if (savedViewsError && savedViewsError !== errorToastRef.current) {
|
|
9690
9712
|
showToast.error(I18n.t("savedViews.errors.fetch"));
|
|
9691
9713
|
errorToastRef.current = savedViewsError;
|
|
@@ -9715,7 +9737,7 @@ var PanelContent = (props) => {
|
|
|
9715
9737
|
}
|
|
9716
9738
|
});
|
|
9717
9739
|
};
|
|
9718
|
-
return /* @__PURE__ */
|
|
9740
|
+
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(
|
|
9719
9741
|
StyledMenuImperative,
|
|
9720
9742
|
{
|
|
9721
9743
|
role: "listbox",
|
|
@@ -9725,7 +9747,7 @@ var PanelContent = (props) => {
|
|
|
9725
9747
|
}
|
|
9726
9748
|
}
|
|
9727
9749
|
},
|
|
9728
|
-
/* @__PURE__ */
|
|
9750
|
+
/* @__PURE__ */ React.default.createElement(_corereact.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ React.default.createElement(
|
|
9729
9751
|
Row,
|
|
9730
9752
|
{
|
|
9731
9753
|
key: temporaryView.id,
|
|
@@ -9734,7 +9756,7 @@ var PanelContent = (props) => {
|
|
|
9734
9756
|
"aria-current": isTemporarySelected ? "true" : void 0,
|
|
9735
9757
|
ref: isTemporarySelected ? selectedRowRef : null
|
|
9736
9758
|
},
|
|
9737
|
-
/* @__PURE__ */
|
|
9759
|
+
/* @__PURE__ */ React.default.createElement(
|
|
9738
9760
|
SavedViewCollectionMenuItem,
|
|
9739
9761
|
{
|
|
9740
9762
|
item: temporaryView,
|
|
@@ -9744,7 +9766,7 @@ var PanelContent = (props) => {
|
|
|
9744
9766
|
)
|
|
9745
9767
|
), presetViews.map((presetView) => {
|
|
9746
9768
|
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
9747
|
-
return /* @__PURE__ */
|
|
9769
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
9748
9770
|
Row,
|
|
9749
9771
|
{
|
|
9750
9772
|
key: presetView.id,
|
|
@@ -9753,7 +9775,7 @@ var PanelContent = (props) => {
|
|
|
9753
9775
|
"aria-current": isSelected ? "true" : void 0,
|
|
9754
9776
|
ref: isSelected ? selectedRowRef : null
|
|
9755
9777
|
},
|
|
9756
|
-
/* @__PURE__ */
|
|
9778
|
+
/* @__PURE__ */ React.default.createElement(
|
|
9757
9779
|
SavedViewCollectionMenuItem,
|
|
9758
9780
|
{
|
|
9759
9781
|
item: presetView,
|
|
@@ -9767,14 +9789,14 @@ var PanelContent = (props) => {
|
|
|
9767
9789
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
9768
9790
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
9769
9791
|
) : [];
|
|
9770
|
-
return /* @__PURE__ */
|
|
9792
|
+
return /* @__PURE__ */ React.default.createElement(React.default.Fragment, { key: level }, /* @__PURE__ */ React.default.createElement(
|
|
9771
9793
|
ViewLevelHeader_default,
|
|
9772
9794
|
{
|
|
9773
9795
|
group: level,
|
|
9774
9796
|
toggleGroup,
|
|
9775
9797
|
expanded: isExpanded
|
|
9776
9798
|
}
|
|
9777
|
-
), isExpanded && views.length > 0 && /* @__PURE__ */
|
|
9799
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ React.default.createElement(
|
|
9778
9800
|
StyledMenuImperative,
|
|
9779
9801
|
{
|
|
9780
9802
|
id: `saved-views-collections-${level}`,
|
|
@@ -9785,7 +9807,7 @@ var PanelContent = (props) => {
|
|
|
9785
9807
|
}
|
|
9786
9808
|
}
|
|
9787
9809
|
},
|
|
9788
|
-
/* @__PURE__ */
|
|
9810
|
+
/* @__PURE__ */ React.default.createElement(_corereact.MenuImperative.Options, null, views.map((view) => {
|
|
9789
9811
|
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === view.id;
|
|
9790
9812
|
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
9791
9813
|
view.view_level,
|
|
@@ -9797,7 +9819,7 @@ var PanelContent = (props) => {
|
|
|
9797
9819
|
props.provider
|
|
9798
9820
|
);
|
|
9799
9821
|
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
9800
|
-
return /* @__PURE__ */
|
|
9822
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
9801
9823
|
Row,
|
|
9802
9824
|
{
|
|
9803
9825
|
key: view.id,
|
|
@@ -9806,7 +9828,7 @@ var PanelContent = (props) => {
|
|
|
9806
9828
|
"aria-current": isSelected ? "true" : void 0,
|
|
9807
9829
|
ref: isSelected ? selectedRowRef : null
|
|
9808
9830
|
},
|
|
9809
|
-
/* @__PURE__ */
|
|
9831
|
+
/* @__PURE__ */ React.default.createElement(
|
|
9810
9832
|
SavedViewCollectionMenuItem,
|
|
9811
9833
|
{
|
|
9812
9834
|
item: view,
|
|
@@ -9828,22 +9850,34 @@ var PanelContent = (props) => {
|
|
|
9828
9850
|
};
|
|
9829
9851
|
|
|
9830
9852
|
// src/components/saved-views/SavedViews.tsx
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9853
|
+
|
|
9854
|
+
|
|
9855
|
+
|
|
9856
|
+
|
|
9857
|
+
|
|
9858
|
+
|
|
9859
|
+
|
|
9860
|
+
|
|
9861
|
+
|
|
9862
|
+
|
|
9835
9863
|
|
|
9836
9864
|
// src/components/modals/DeleteConfirmationModal.tsx
|
|
9837
|
-
|
|
9838
|
-
|
|
9865
|
+
|
|
9866
|
+
|
|
9867
|
+
|
|
9868
|
+
|
|
9869
|
+
|
|
9870
|
+
|
|
9871
|
+
|
|
9872
|
+
|
|
9839
9873
|
var SavedViewsDeleteConfirmationModalShared = ({
|
|
9840
9874
|
onCancel,
|
|
9841
9875
|
onDelete,
|
|
9842
9876
|
open
|
|
9843
9877
|
}) => {
|
|
9844
|
-
const i18n = (0,
|
|
9845
|
-
return /* @__PURE__ */
|
|
9846
|
-
|
|
9878
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
9879
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
9880
|
+
_corereact.ConfirmModal,
|
|
9847
9881
|
{
|
|
9848
9882
|
"data-testid": "delete-confirmation-modal",
|
|
9849
9883
|
open,
|
|
@@ -9852,18 +9886,29 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
9852
9886
|
onClose: onCancel,
|
|
9853
9887
|
style: { overflowWrap: "anywhere" }
|
|
9854
9888
|
},
|
|
9855
|
-
/* @__PURE__ */
|
|
9856
|
-
/* @__PURE__ */
|
|
9889
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Modal.Body, null, /* @__PURE__ */ React.default.createElement(_corereact.P, null, i18n.t("savedViews.modal.delete.description"))),
|
|
9890
|
+
/* @__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"))))
|
|
9857
9891
|
);
|
|
9858
9892
|
};
|
|
9859
9893
|
|
|
9860
9894
|
// src/components/modals/form-modal/FormModal.tsx
|
|
9861
|
-
|
|
9895
|
+
|
|
9862
9896
|
|
|
9863
9897
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9898
|
+
|
|
9899
|
+
|
|
9900
|
+
|
|
9901
|
+
|
|
9902
|
+
|
|
9903
|
+
|
|
9904
|
+
|
|
9905
|
+
|
|
9906
|
+
|
|
9907
|
+
|
|
9908
|
+
|
|
9909
|
+
|
|
9910
|
+
|
|
9911
|
+
var _yup = require('yup'); var yup = _interopRequireWildcard(_yup); var yup2 = _interopRequireWildcard(_yup);
|
|
9867
9912
|
|
|
9868
9913
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
9869
9914
|
var getViewLevelOptions = (permissions, i18n, isProjectLevelTool = true) => {
|
|
@@ -9898,24 +9943,24 @@ function extractMessage(error, I18n) {
|
|
|
9898
9943
|
}
|
|
9899
9944
|
|
|
9900
9945
|
// src/components/modals/form-modal/NameInputField.tsx
|
|
9901
|
-
|
|
9902
|
-
|
|
9946
|
+
|
|
9947
|
+
|
|
9903
9948
|
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
9904
9949
|
var NameInputField = ({
|
|
9905
9950
|
error,
|
|
9906
9951
|
onResetMutations
|
|
9907
9952
|
}) => {
|
|
9908
|
-
const I18n = (0,
|
|
9953
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9909
9954
|
const label = I18n.t("savedViews.modal.fields.name");
|
|
9910
|
-
const { errors: formErrors, submitCount } = (0,
|
|
9911
|
-
|
|
9955
|
+
const { errors: formErrors, submitCount } = _corereact.useFormContext.call(void 0, );
|
|
9956
|
+
React21.useEffect(() => {
|
|
9912
9957
|
var _a;
|
|
9913
9958
|
if (submitCount > 0 && (formErrors == null ? void 0 : formErrors.name)) {
|
|
9914
9959
|
(_a = document.getElementById(NAME_INPUT_ID)) == null ? void 0 : _a.focus();
|
|
9915
9960
|
}
|
|
9916
9961
|
}, [formErrors == null ? void 0 : formErrors.name, submitCount]);
|
|
9917
|
-
return /* @__PURE__ */
|
|
9918
|
-
|
|
9962
|
+
return /* @__PURE__ */ React21.createElement(
|
|
9963
|
+
_corereact.Form.Text,
|
|
9919
9964
|
{
|
|
9920
9965
|
id: NAME_INPUT_ID,
|
|
9921
9966
|
name: "name",
|
|
@@ -9947,7 +9992,7 @@ var FormModalBase = ({
|
|
|
9947
9992
|
setOpenEditCreateModal,
|
|
9948
9993
|
onSelect
|
|
9949
9994
|
}) => {
|
|
9950
|
-
const I18n = (0,
|
|
9995
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
9951
9996
|
const NAME_MAX_LENGTH = 150;
|
|
9952
9997
|
const {
|
|
9953
9998
|
mutate: createSavedView,
|
|
@@ -10006,8 +10051,8 @@ var FormModalBase = ({
|
|
|
10006
10051
|
I18n,
|
|
10007
10052
|
isProjectLevelTool
|
|
10008
10053
|
);
|
|
10009
|
-
return /* @__PURE__ */
|
|
10010
|
-
|
|
10054
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10055
|
+
_corereact.Modal,
|
|
10011
10056
|
{
|
|
10012
10057
|
howToClose: ["x", "scrim"],
|
|
10013
10058
|
onClose,
|
|
@@ -10015,8 +10060,8 @@ var FormModalBase = ({
|
|
|
10015
10060
|
width: "md",
|
|
10016
10061
|
"data-testid": "create-update-modal"
|
|
10017
10062
|
},
|
|
10018
|
-
/* @__PURE__ */
|
|
10019
|
-
|
|
10063
|
+
/* @__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(
|
|
10064
|
+
_corereact.Form,
|
|
10020
10065
|
{
|
|
10021
10066
|
initialValues: {
|
|
10022
10067
|
name: initialName,
|
|
@@ -10041,26 +10086,26 @@ var FormModalBase = ({
|
|
|
10041
10086
|
onReset: onCancel,
|
|
10042
10087
|
validateOnChange: true
|
|
10043
10088
|
},
|
|
10044
|
-
/* @__PURE__ */
|
|
10045
|
-
|
|
10089
|
+
/* @__PURE__ */ React22.createElement(_corereact.Form.Form, { name: header }, /* @__PURE__ */ React22.createElement(
|
|
10090
|
+
_corereact.Modal.Body,
|
|
10046
10091
|
{
|
|
10047
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10092
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: _corereact.spacing.lg }
|
|
10048
10093
|
},
|
|
10049
|
-
errors && /* @__PURE__ */
|
|
10050
|
-
/* @__PURE__ */
|
|
10094
|
+
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, (errors == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10095
|
+
/* @__PURE__ */ React22.createElement(_corereact.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10051
10096
|
NameInputField,
|
|
10052
10097
|
{
|
|
10053
10098
|
error: errors == null ? void 0 : errors.name,
|
|
10054
10099
|
onResetMutations: resetMutations
|
|
10055
10100
|
}
|
|
10056
10101
|
)),
|
|
10057
|
-
/* @__PURE__ */
|
|
10058
|
-
|
|
10102
|
+
/* @__PURE__ */ React22.createElement(
|
|
10103
|
+
_corereact.Form.Row,
|
|
10059
10104
|
{
|
|
10060
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10105
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? _corereact.spacing.xl : _corereact.spacing.none }
|
|
10061
10106
|
},
|
|
10062
|
-
/* @__PURE__ */
|
|
10063
|
-
|
|
10107
|
+
/* @__PURE__ */ React22.createElement(
|
|
10108
|
+
_corereact.Form.TextArea,
|
|
10064
10109
|
{
|
|
10065
10110
|
name: "description",
|
|
10066
10111
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10070,8 +10115,8 @@ var FormModalBase = ({
|
|
|
10070
10115
|
}
|
|
10071
10116
|
)
|
|
10072
10117
|
),
|
|
10073
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10074
|
-
|
|
10118
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React22.createElement(_corereact.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10119
|
+
_corereact.Form.Select,
|
|
10075
10120
|
{
|
|
10076
10121
|
name: "view_level",
|
|
10077
10122
|
options: viewLevelOptions,
|
|
@@ -10080,9 +10125,9 @@ var FormModalBase = ({
|
|
|
10080
10125
|
onSearch: false,
|
|
10081
10126
|
onClear: false
|
|
10082
10127
|
}
|
|
10083
|
-
)) : /* @__PURE__ */
|
|
10084
|
-
), /* @__PURE__ */
|
|
10085
|
-
|
|
10128
|
+
)) : /* @__PURE__ */ React22.createElement(React22.Fragment, null)
|
|
10129
|
+
), /* @__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(
|
|
10130
|
+
_corereact.Button,
|
|
10086
10131
|
{
|
|
10087
10132
|
"data-testid": "create-update-modal-button",
|
|
10088
10133
|
type: "submit",
|
|
@@ -10097,7 +10142,7 @@ var FormModalBase = ({
|
|
|
10097
10142
|
};
|
|
10098
10143
|
|
|
10099
10144
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10100
|
-
|
|
10145
|
+
|
|
10101
10146
|
var FormModal = ({
|
|
10102
10147
|
open,
|
|
10103
10148
|
mode,
|
|
@@ -10110,8 +10155,8 @@ var FormModal = ({
|
|
|
10110
10155
|
onSelect,
|
|
10111
10156
|
defaultView
|
|
10112
10157
|
}) => {
|
|
10113
|
-
const i18n = (0,
|
|
10114
|
-
return /* @__PURE__ */
|
|
10158
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
10159
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
10115
10160
|
FormModalBase,
|
|
10116
10161
|
{
|
|
10117
10162
|
open,
|
|
@@ -10132,9 +10177,21 @@ var FormModal = ({
|
|
|
10132
10177
|
};
|
|
10133
10178
|
|
|
10134
10179
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10180
|
+
|
|
10181
|
+
|
|
10182
|
+
|
|
10183
|
+
|
|
10184
|
+
|
|
10185
|
+
|
|
10186
|
+
|
|
10187
|
+
|
|
10188
|
+
|
|
10189
|
+
|
|
10190
|
+
|
|
10191
|
+
|
|
10192
|
+
|
|
10193
|
+
|
|
10194
|
+
|
|
10138
10195
|
var SharedViewFormModal = ({
|
|
10139
10196
|
open,
|
|
10140
10197
|
fetchedView,
|
|
@@ -10145,7 +10202,7 @@ var SharedViewFormModal = ({
|
|
|
10145
10202
|
isCreating,
|
|
10146
10203
|
resetCreateError
|
|
10147
10204
|
}) => {
|
|
10148
|
-
const I18n = (0,
|
|
10205
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
10149
10206
|
const NAME_MAX_LENGTH = 150;
|
|
10150
10207
|
const errors = extractMessage(createError, I18n);
|
|
10151
10208
|
const handleNameChange = () => {
|
|
@@ -10156,8 +10213,8 @@ var SharedViewFormModal = ({
|
|
|
10156
10213
|
const handleOnSubmit = (data) => {
|
|
10157
10214
|
onCreateView(data.name, data.description);
|
|
10158
10215
|
};
|
|
10159
|
-
return /* @__PURE__ */
|
|
10160
|
-
|
|
10216
|
+
return /* @__PURE__ */ React24.createElement(
|
|
10217
|
+
_corereact.Modal,
|
|
10161
10218
|
{
|
|
10162
10219
|
"data-testid": "shared-view-form-modal",
|
|
10163
10220
|
open,
|
|
@@ -10165,40 +10222,40 @@ var SharedViewFormModal = ({
|
|
|
10165
10222
|
onClose,
|
|
10166
10223
|
style: { width: "540px" }
|
|
10167
10224
|
},
|
|
10168
|
-
/* @__PURE__ */
|
|
10169
|
-
|
|
10225
|
+
/* @__PURE__ */ React24.createElement(
|
|
10226
|
+
_corereact.Modal.Header,
|
|
10170
10227
|
{
|
|
10171
10228
|
onClose,
|
|
10172
10229
|
style: {
|
|
10173
|
-
paddingTop:
|
|
10174
|
-
paddingBottom:
|
|
10175
|
-
paddingLeft:
|
|
10176
|
-
paddingRight:
|
|
10230
|
+
paddingTop: _corereact.spacing.lg,
|
|
10231
|
+
paddingBottom: _corereact.spacing.xs,
|
|
10232
|
+
paddingLeft: _corereact.spacing.xl,
|
|
10233
|
+
paddingRight: _corereact.spacing.xl
|
|
10177
10234
|
}
|
|
10178
10235
|
},
|
|
10179
|
-
/* @__PURE__ */
|
|
10236
|
+
/* @__PURE__ */ React24.createElement(_corereact.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10180
10237
|
),
|
|
10181
|
-
/* @__PURE__ */
|
|
10182
|
-
|
|
10238
|
+
/* @__PURE__ */ React24.createElement(
|
|
10239
|
+
_corereact.P,
|
|
10183
10240
|
{
|
|
10184
10241
|
style: {
|
|
10185
|
-
paddingLeft:
|
|
10186
|
-
paddingRight:
|
|
10187
|
-
paddingBottom:
|
|
10188
|
-
paddingTop:
|
|
10242
|
+
paddingLeft: _corereact.spacing.xl,
|
|
10243
|
+
paddingRight: _corereact.spacing.xl,
|
|
10244
|
+
paddingBottom: _corereact.spacing.lg,
|
|
10245
|
+
paddingTop: _corereact.spacing.none,
|
|
10189
10246
|
margin: 0,
|
|
10190
|
-
color:
|
|
10247
|
+
color: _corereact.colors.gray45,
|
|
10191
10248
|
whiteSpace: "pre-line"
|
|
10192
10249
|
}
|
|
10193
10250
|
},
|
|
10194
10251
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10195
10252
|
),
|
|
10196
|
-
/* @__PURE__ */
|
|
10197
|
-
|
|
10253
|
+
/* @__PURE__ */ React24.createElement(
|
|
10254
|
+
_corereact.Form,
|
|
10198
10255
|
{
|
|
10199
10256
|
initialValues: {
|
|
10200
10257
|
name: fetchedView.name,
|
|
10201
|
-
description: fetchedView.description
|
|
10258
|
+
description: _nullishCoalesce(fetchedView.description, () => ( ""))
|
|
10202
10259
|
},
|
|
10203
10260
|
view: "create",
|
|
10204
10261
|
validationSchema: yup2.object().shape({
|
|
@@ -10212,32 +10269,32 @@ var SharedViewFormModal = ({
|
|
|
10212
10269
|
onSubmit: handleOnSubmit,
|
|
10213
10270
|
validateOnChange: true
|
|
10214
10271
|
},
|
|
10215
|
-
/* @__PURE__ */
|
|
10216
|
-
|
|
10272
|
+
/* @__PURE__ */ React24.createElement(_corereact.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React24.createElement(
|
|
10273
|
+
_corereact.Modal.Body,
|
|
10217
10274
|
{
|
|
10218
10275
|
style: {
|
|
10219
|
-
paddingTop:
|
|
10276
|
+
paddingTop: _corereact.spacing.lg,
|
|
10220
10277
|
paddingBottom: 0,
|
|
10221
|
-
borderTop: `1px solid ${
|
|
10278
|
+
borderTop: `1px solid ${_corereact.colors.gray85}`
|
|
10222
10279
|
}
|
|
10223
10280
|
},
|
|
10224
|
-
errors && /* @__PURE__ */
|
|
10281
|
+
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", {
|
|
10225
10282
|
mode: "create"
|
|
10226
|
-
})), /* @__PURE__ */
|
|
10227
|
-
/* @__PURE__ */
|
|
10283
|
+
})), /* @__PURE__ */ React24.createElement(_corereact.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10284
|
+
/* @__PURE__ */ React24.createElement(_corereact.Form.Row, null, /* @__PURE__ */ React24.createElement(
|
|
10228
10285
|
NameInputField,
|
|
10229
10286
|
{
|
|
10230
10287
|
error: errors == null ? void 0 : errors.name,
|
|
10231
10288
|
onResetMutations: handleNameChange
|
|
10232
10289
|
}
|
|
10233
10290
|
)),
|
|
10234
|
-
/* @__PURE__ */
|
|
10235
|
-
|
|
10291
|
+
/* @__PURE__ */ React24.createElement(
|
|
10292
|
+
_corereact.Form.Row,
|
|
10236
10293
|
{
|
|
10237
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10294
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? _corereact.spacing.xl : _corereact.spacing.none }
|
|
10238
10295
|
},
|
|
10239
|
-
/* @__PURE__ */
|
|
10240
|
-
|
|
10296
|
+
/* @__PURE__ */ React24.createElement(
|
|
10297
|
+
_corereact.Form.TextArea,
|
|
10241
10298
|
{
|
|
10242
10299
|
name: "description",
|
|
10243
10300
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10247,8 +10304,8 @@ var SharedViewFormModal = ({
|
|
|
10247
10304
|
}
|
|
10248
10305
|
)
|
|
10249
10306
|
)
|
|
10250
|
-
), /* @__PURE__ */
|
|
10251
|
-
|
|
10307
|
+
), /* @__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(
|
|
10308
|
+
_corereact.Button,
|
|
10252
10309
|
{
|
|
10253
10310
|
variant: "secondary",
|
|
10254
10311
|
onClick: onCreateTemporaryView,
|
|
@@ -10256,8 +10313,8 @@ var SharedViewFormModal = ({
|
|
|
10256
10313
|
disabled: isCreating
|
|
10257
10314
|
},
|
|
10258
10315
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10259
|
-
), /* @__PURE__ */
|
|
10260
|
-
|
|
10316
|
+
), /* @__PURE__ */ React24.createElement(
|
|
10317
|
+
_corereact.Button,
|
|
10261
10318
|
{
|
|
10262
10319
|
type: "submit",
|
|
10263
10320
|
variant: "primary",
|
|
@@ -10272,9 +10329,8 @@ var SharedViewFormModal = ({
|
|
|
10272
10329
|
};
|
|
10273
10330
|
|
|
10274
10331
|
// src/utils/hooks/useViewSelection.ts
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
var import_core_react14 = require("@procore/core-react");
|
|
10332
|
+
|
|
10333
|
+
|
|
10278
10334
|
|
|
10279
10335
|
// src/utils/viewStorage.ts
|
|
10280
10336
|
var ViewStorage = {
|
|
@@ -10289,7 +10345,7 @@ var ViewStorage = {
|
|
|
10289
10345
|
if (!parsed) return defaultView;
|
|
10290
10346
|
const isTableConfigOnly = !parsed.id && !parsed.share_token;
|
|
10291
10347
|
return isTableConfigOnly ? { ...defaultView, table_config: parsed } : parsed;
|
|
10292
|
-
} catch {
|
|
10348
|
+
} catch (e7) {
|
|
10293
10349
|
return defaultView;
|
|
10294
10350
|
}
|
|
10295
10351
|
},
|
|
@@ -10299,13 +10355,13 @@ var ViewStorage = {
|
|
|
10299
10355
|
};
|
|
10300
10356
|
|
|
10301
10357
|
// src/utils/hooks/useLatest.ts
|
|
10302
|
-
|
|
10358
|
+
|
|
10303
10359
|
var useLatest = (callback) => {
|
|
10304
|
-
const ref = (0,
|
|
10305
|
-
(0,
|
|
10360
|
+
const ref = _react.useRef.call(void 0, callback);
|
|
10361
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
10306
10362
|
ref.current = callback;
|
|
10307
10363
|
});
|
|
10308
|
-
return (0,
|
|
10364
|
+
return _react.useCallback.call(void 0, (...args) => ref.current(...args), []);
|
|
10309
10365
|
};
|
|
10310
10366
|
|
|
10311
10367
|
// src/utils/hooks/useViewSelection.ts
|
|
@@ -10318,69 +10374,51 @@ var areRowGroupStatesEqual = (a2, b2) => {
|
|
|
10318
10374
|
if (a2.length !== b2.length) return false;
|
|
10319
10375
|
return a2.every((val, idx) => val === b2[idx]);
|
|
10320
10376
|
};
|
|
10321
|
-
var
|
|
10322
|
-
if (view.id === "default"
|
|
10323
|
-
|
|
10324
|
-
}
|
|
10377
|
+
var getViewTokenForView = (view) => {
|
|
10378
|
+
if (view.id === "default") return "default";
|
|
10379
|
+
if (view.id === "temporary") return "temporary";
|
|
10325
10380
|
return view.share_token;
|
|
10326
10381
|
};
|
|
10327
|
-
var setSavedViewParam = (token2, setSearchParams) => {
|
|
10328
|
-
setSearchParams(
|
|
10329
|
-
(currentParams) => {
|
|
10330
|
-
const updatedParams = new URLSearchParams(currentParams);
|
|
10331
|
-
updatedParams.set("saved-view", token2);
|
|
10332
|
-
return updatedParams;
|
|
10333
|
-
},
|
|
10334
|
-
{ replace: true }
|
|
10335
|
-
);
|
|
10336
|
-
};
|
|
10337
10382
|
var checkIsViewSelected = (selectedView, viewId) => {
|
|
10338
10383
|
return (selectedView == null ? void 0 : selectedView.share_token) === viewId || (selectedView == null ? void 0 : selectedView.id) === viewId;
|
|
10339
10384
|
};
|
|
10340
10385
|
var findViewByToken = (views, token2) => {
|
|
10341
10386
|
return views.find((view) => view.share_token === token2);
|
|
10342
10387
|
};
|
|
10343
|
-
var setViewInUrl = (view, setSearchParams) => {
|
|
10344
|
-
setSavedViewParam(getViewToken(view), setSearchParams);
|
|
10345
|
-
};
|
|
10346
|
-
var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
10347
|
-
if (previousParam && !currentParam) {
|
|
10348
|
-
setSavedViewParam(previousParam, setSearchParams);
|
|
10349
|
-
}
|
|
10350
|
-
};
|
|
10351
10388
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, tableConfig) => {
|
|
10352
|
-
const I18n = (0,
|
|
10353
|
-
const
|
|
10389
|
+
const I18n = _corereact.useI18nContext.call(void 0, );
|
|
10390
|
+
const transport = useSavedViewsTransport();
|
|
10391
|
+
const urlAdapter = transport.useUrlAdapter();
|
|
10392
|
+
const projectIdSegment = _nullishCoalesce(config.projectId, () => ( "company"));
|
|
10354
10393
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10355
10394
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
10356
|
-
const
|
|
10357
|
-
const
|
|
10358
|
-
const
|
|
10359
|
-
const [selectedSavedView, setSelectedSavedView] = (0, import_react14.useState)(() => {
|
|
10395
|
+
const previousSavedViewParamRef = _react.useRef.call(void 0, null);
|
|
10396
|
+
const intendedTokenRef = _react.useRef.call(void 0, null);
|
|
10397
|
+
const [selectedSavedView, setSelectedSavedView] = _react.useState.call(void 0, () => {
|
|
10360
10398
|
const stored = ViewStorage.load(storageKey, config.defaultView);
|
|
10361
|
-
return stored
|
|
10399
|
+
return _nullishCoalesce(stored, () => ( config.defaultView));
|
|
10362
10400
|
});
|
|
10363
|
-
const [temporaryView, setTemporaryView] = (0,
|
|
10401
|
+
const [temporaryView, setTemporaryView] = _react.useState.call(void 0, () => {
|
|
10364
10402
|
const loaded = ViewStorage.load(temporaryStorageKey, config.defaultView);
|
|
10365
10403
|
return loaded && (loaded.id === "temporary" || loaded.view_level === "temporary") ? loaded : null;
|
|
10366
10404
|
});
|
|
10367
|
-
const persistViewToStorageAndUrl = (0,
|
|
10405
|
+
const persistViewToStorageAndUrl = _react.useCallback.call(void 0,
|
|
10368
10406
|
(view) => {
|
|
10369
10407
|
ViewStorage.save(storageKey, view);
|
|
10370
|
-
intendedTokenRef.current =
|
|
10371
|
-
|
|
10408
|
+
intendedTokenRef.current = getViewTokenForView(view);
|
|
10409
|
+
urlAdapter.setViewToken(getViewTokenForView(view));
|
|
10372
10410
|
},
|
|
10373
|
-
[storageKey,
|
|
10411
|
+
[storageKey, urlAdapter]
|
|
10374
10412
|
);
|
|
10375
|
-
const baseViews = (0,
|
|
10376
|
-
() => [...savedViews
|
|
10413
|
+
const baseViews = _react.useMemo.call(void 0,
|
|
10414
|
+
() => [..._nullishCoalesce(savedViews, () => ( [])), ..._nullishCoalesce(presetViews, () => ( []))],
|
|
10377
10415
|
[savedViews, presetViews]
|
|
10378
10416
|
);
|
|
10379
|
-
const allViews = (0,
|
|
10417
|
+
const allViews = _react.useMemo.call(void 0,
|
|
10380
10418
|
() => temporaryView ? [...baseViews, temporaryView] : baseViews,
|
|
10381
10419
|
[baseViews, temporaryView]
|
|
10382
10420
|
);
|
|
10383
|
-
const selectView = (0,
|
|
10421
|
+
const selectView = _react.useCallback.call(void 0,
|
|
10384
10422
|
(view) => {
|
|
10385
10423
|
const viewToSelect = config.onSelect({ item: view });
|
|
10386
10424
|
setSelectedSavedView(viewToSelect);
|
|
@@ -10389,7 +10427,7 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10389
10427
|
},
|
|
10390
10428
|
[config, persistViewToStorageAndUrl]
|
|
10391
10429
|
);
|
|
10392
|
-
const createTemporaryView = (0,
|
|
10430
|
+
const createTemporaryView = _react.useCallback.call(void 0,
|
|
10393
10431
|
(fetchedView) => {
|
|
10394
10432
|
const tempView = {
|
|
10395
10433
|
...fetchedView,
|
|
@@ -10404,12 +10442,12 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10404
10442
|
},
|
|
10405
10443
|
[temporaryStorageKey, selectView]
|
|
10406
10444
|
);
|
|
10407
|
-
const clearTemporaryView = (0,
|
|
10445
|
+
const clearTemporaryView = _react.useCallback.call(void 0, () => {
|
|
10408
10446
|
ViewStorage.remove(temporaryStorageKey);
|
|
10409
10447
|
setTemporaryView(null);
|
|
10410
10448
|
selectView(config.defaultView);
|
|
10411
10449
|
}, [temporaryStorageKey, config.defaultView, selectView]);
|
|
10412
|
-
const isViewAlreadySelected = (0,
|
|
10450
|
+
const isViewAlreadySelected = _react.useCallback.call(void 0,
|
|
10413
10451
|
(viewId) => checkIsViewSelected(selectedSavedView, viewId),
|
|
10414
10452
|
[selectedSavedView]
|
|
10415
10453
|
);
|
|
@@ -10424,36 +10462,34 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10424
10462
|
openSharedViewModal(viewId);
|
|
10425
10463
|
}
|
|
10426
10464
|
});
|
|
10427
|
-
|
|
10428
|
-
|
|
10465
|
+
const savedViewIdFromUrl = urlAdapter.getViewToken();
|
|
10466
|
+
_react.useEffect.call(void 0, () => {
|
|
10429
10467
|
const intendedToken = intendedTokenRef.current;
|
|
10430
|
-
if (intendedToken !== null &&
|
|
10431
|
-
|
|
10468
|
+
if (intendedToken !== null && savedViewIdFromUrl !== intendedToken) {
|
|
10469
|
+
urlAdapter.setViewToken(intendedToken);
|
|
10432
10470
|
return;
|
|
10433
10471
|
}
|
|
10434
|
-
if (intendedToken !== null &&
|
|
10472
|
+
if (intendedToken !== null && savedViewIdFromUrl === intendedToken) {
|
|
10435
10473
|
intendedTokenRef.current = null;
|
|
10436
10474
|
}
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
if (savedViewId) {
|
|
10443
|
-
previousSavedViewParamRef.current = savedViewId;
|
|
10475
|
+
if (previousSavedViewParamRef.current && !savedViewIdFromUrl) {
|
|
10476
|
+
urlAdapter.setViewToken(previousSavedViewParamRef.current);
|
|
10477
|
+
}
|
|
10478
|
+
if (savedViewIdFromUrl) {
|
|
10479
|
+
previousSavedViewParamRef.current = savedViewIdFromUrl;
|
|
10444
10480
|
}
|
|
10445
|
-
if (
|
|
10446
|
-
handleSavedViewFromUrl(
|
|
10481
|
+
if (savedViewIdFromUrl && savedViews) {
|
|
10482
|
+
handleSavedViewFromUrl(savedViewIdFromUrl);
|
|
10447
10483
|
}
|
|
10448
|
-
}, [
|
|
10449
|
-
const previousRowGroupStateRef = (0,
|
|
10484
|
+
}, [savedViewIdFromUrl, handleSavedViewFromUrl, allViews.length, urlAdapter]);
|
|
10485
|
+
const previousRowGroupStateRef = _react.useRef.call(void 0,
|
|
10450
10486
|
isSmartGridConfig(tableConfig) ? tableConfig.rowGroupState : void 0
|
|
10451
10487
|
);
|
|
10452
|
-
const selectedViewRef = (0,
|
|
10488
|
+
const selectedViewRef = _react.useRef.call(void 0, selectedSavedView);
|
|
10453
10489
|
selectedViewRef.current = selectedSavedView;
|
|
10454
|
-
const defaultViewRef = (0,
|
|
10490
|
+
const defaultViewRef = _react.useRef.call(void 0, config.defaultView);
|
|
10455
10491
|
defaultViewRef.current = config.defaultView;
|
|
10456
|
-
(0,
|
|
10492
|
+
_react.useEffect.call(void 0, () => {
|
|
10457
10493
|
var _a;
|
|
10458
10494
|
if (!isSmartGridConfig(tableConfig) || !(presetViews == null ? void 0 : presetViews.length)) return;
|
|
10459
10495
|
const currentView = selectedViewRef.current;
|
|
@@ -10494,13 +10530,13 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10494
10530
|
};
|
|
10495
10531
|
|
|
10496
10532
|
// src/components/saved-views/FocusScopeToggle.tsx
|
|
10497
|
-
var
|
|
10498
|
-
|
|
10533
|
+
var _focus = require('@react-aria/focus');
|
|
10534
|
+
|
|
10499
10535
|
var useFocusScopeToggle = (isOpen) => {
|
|
10500
|
-
const focusManager = (0,
|
|
10501
|
-
const triggerRef = (0,
|
|
10502
|
-
const firstFocusedElementRef = (0,
|
|
10503
|
-
(0,
|
|
10536
|
+
const focusManager = _focus.useFocusManager.call(void 0, );
|
|
10537
|
+
const triggerRef = _react.useRef.call(void 0, null);
|
|
10538
|
+
const firstFocusedElementRef = _react.useRef.call(void 0, null);
|
|
10539
|
+
_react.useEffect.call(void 0, () => {
|
|
10504
10540
|
var _a, _b;
|
|
10505
10541
|
const handleKeyDown = (event) => {
|
|
10506
10542
|
var _a2;
|
|
@@ -10543,11 +10579,27 @@ var FocusScopeToggle = ({ isOpen }) => {
|
|
|
10543
10579
|
};
|
|
10544
10580
|
|
|
10545
10581
|
// src/components/saved-views/SavedViews.tsx
|
|
10546
|
-
|
|
10582
|
+
|
|
10583
|
+
|
|
10584
|
+
// src/transport/default-lazy.ts
|
|
10585
|
+
var cached;
|
|
10586
|
+
var inFlight;
|
|
10587
|
+
var getCachedDefaultTransport = () => cached;
|
|
10588
|
+
var loadDefaultTransport = () => {
|
|
10589
|
+
if (cached) return Promise.resolve(cached);
|
|
10590
|
+
if (inFlight) return inFlight;
|
|
10591
|
+
inFlight = Promise.resolve().then(() => _interopRequireWildcard(require("./transport/default.js"))).then((mod) => {
|
|
10592
|
+
cached = mod.defaultTransport;
|
|
10593
|
+
inFlight = void 0;
|
|
10594
|
+
return mod.defaultTransport;
|
|
10595
|
+
});
|
|
10596
|
+
return inFlight;
|
|
10597
|
+
};
|
|
10598
|
+
|
|
10599
|
+
// src/components/saved-views/SavedViews.tsx
|
|
10547
10600
|
var StyledPanel = pt.div`
|
|
10548
10601
|
border: ${({ provider }) => provider === "data-table" ? "1px solid #d6dadc" : "none"};
|
|
10549
10602
|
`;
|
|
10550
|
-
var queryClient = new import_react_query3.QueryClient();
|
|
10551
10603
|
var SavedViewsContent = (props) => {
|
|
10552
10604
|
var _a;
|
|
10553
10605
|
const { projectId, companyId } = props;
|
|
@@ -10559,15 +10611,15 @@ var SavedViewsContent = (props) => {
|
|
|
10559
10611
|
};
|
|
10560
10612
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
10561
10613
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
10562
|
-
const { showToast } = (0,
|
|
10563
|
-
const i18n = (0,
|
|
10564
|
-
const [activeModal, setActiveModal] = (0,
|
|
10565
|
-
const [modalData, setModalData] = (0,
|
|
10614
|
+
const { showToast } = _toastalert.useToastAlertContext.call(void 0, );
|
|
10615
|
+
const i18n = _corereact.useI18nContext.call(void 0, );
|
|
10616
|
+
const [activeModal, setActiveModal] = _react.useState.call(void 0, null);
|
|
10617
|
+
const [modalData, setModalData] = _react.useState.call(void 0, null);
|
|
10566
10618
|
const openModal = (type, data) => {
|
|
10567
10619
|
setActiveModal(type);
|
|
10568
|
-
setModalData(data
|
|
10620
|
+
setModalData(_nullishCoalesce(data, () => ( null)));
|
|
10569
10621
|
};
|
|
10570
|
-
const closeModal = (0,
|
|
10622
|
+
const closeModal = _react.useCallback.call(void 0, () => {
|
|
10571
10623
|
setActiveModal(null);
|
|
10572
10624
|
setModalData(null);
|
|
10573
10625
|
}, []);
|
|
@@ -10597,7 +10649,7 @@ var SavedViewsContent = (props) => {
|
|
|
10597
10649
|
props.tableConfig
|
|
10598
10650
|
);
|
|
10599
10651
|
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
10600
|
-
(modalData == null ? void 0 : modalData.viewId)
|
|
10652
|
+
_nullishCoalesce((modalData == null ? void 0 : modalData.viewId), () => ( null)),
|
|
10601
10653
|
queryInput,
|
|
10602
10654
|
Boolean(modalData == null ? void 0 : modalData.viewId)
|
|
10603
10655
|
);
|
|
@@ -10607,16 +10659,16 @@ var SavedViewsContent = (props) => {
|
|
|
10607
10659
|
error: createError,
|
|
10608
10660
|
reset: resetCreateError
|
|
10609
10661
|
} = useCreateSavedView(queryInput);
|
|
10610
|
-
(0,
|
|
10662
|
+
_react.useEffect.call(void 0, () => {
|
|
10611
10663
|
if (fetchError) {
|
|
10612
10664
|
showToast.error(i18n.t("savedViews.errors.notFound"));
|
|
10613
|
-
selectView(selectedView
|
|
10665
|
+
selectView(_nullishCoalesce(selectedView, () => ( props.defaultView)));
|
|
10614
10666
|
closeModal();
|
|
10615
10667
|
}
|
|
10616
10668
|
}, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
|
|
10617
10669
|
const setSelectedViewInContext = (_a = useSavedViewsSelection()) == null ? void 0 : _a.setSelectedView;
|
|
10618
|
-
(0,
|
|
10619
|
-
setSelectedViewInContext == null ? void 0 : setSelectedViewInContext(selectedView
|
|
10670
|
+
_react.useEffect.call(void 0, () => {
|
|
10671
|
+
setSelectedViewInContext == null ? void 0 : setSelectedViewInContext(_nullishCoalesce(selectedView, () => ( null)));
|
|
10620
10672
|
}, [selectedView, setSelectedViewInContext]);
|
|
10621
10673
|
const viewSharedViewTemporarily = () => {
|
|
10622
10674
|
if (fetchedView) {
|
|
@@ -10645,7 +10697,7 @@ var SavedViewsContent = (props) => {
|
|
|
10645
10697
|
}
|
|
10646
10698
|
};
|
|
10647
10699
|
const selectCurrentViewAndCloseModal = () => {
|
|
10648
|
-
selectView(selectedView
|
|
10700
|
+
selectView(_nullishCoalesce(selectedView, () => ( props.defaultView)));
|
|
10649
10701
|
closeModal();
|
|
10650
10702
|
};
|
|
10651
10703
|
const deleteSelectedView = () => {
|
|
@@ -10659,19 +10711,19 @@ var SavedViewsContent = (props) => {
|
|
|
10659
10711
|
deleteSelectedView();
|
|
10660
10712
|
closeModal();
|
|
10661
10713
|
};
|
|
10662
|
-
return /* @__PURE__ */
|
|
10714
|
+
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(
|
|
10663
10715
|
ExpandedPanel,
|
|
10664
10716
|
{
|
|
10665
10717
|
"data-testid": "saved-view-expanded-panel",
|
|
10666
10718
|
provider: props.provider
|
|
10667
10719
|
},
|
|
10668
|
-
/* @__PURE__ */
|
|
10669
|
-
|
|
10720
|
+
/* @__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(
|
|
10721
|
+
_corereact.Tooltip,
|
|
10670
10722
|
{
|
|
10671
10723
|
showDelay: 200,
|
|
10672
|
-
overlay: /* @__PURE__ */
|
|
10724
|
+
overlay: /* @__PURE__ */ React.default.createElement(_corereact.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10673
10725
|
},
|
|
10674
|
-
/* @__PURE__ */
|
|
10726
|
+
/* @__PURE__ */ React.default.createElement(
|
|
10675
10727
|
Help_default,
|
|
10676
10728
|
{
|
|
10677
10729
|
tabIndex: 0,
|
|
@@ -10679,16 +10731,16 @@ var SavedViewsContent = (props) => {
|
|
|
10679
10731
|
"aria-label": i18n.t("savedViews.tooltip")
|
|
10680
10732
|
}
|
|
10681
10733
|
)
|
|
10682
|
-
))), /* @__PURE__ */
|
|
10683
|
-
|
|
10734
|
+
))), /* @__PURE__ */ React.default.createElement(
|
|
10735
|
+
_corereact.Tooltip,
|
|
10684
10736
|
{
|
|
10685
10737
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10686
10738
|
showDelay: 1e3
|
|
10687
10739
|
},
|
|
10688
|
-
/* @__PURE__ */
|
|
10689
|
-
|
|
10740
|
+
/* @__PURE__ */ React.default.createElement(
|
|
10741
|
+
_corereact.Button,
|
|
10690
10742
|
{
|
|
10691
|
-
icon: /* @__PURE__ */
|
|
10743
|
+
icon: /* @__PURE__ */ React.default.createElement(Plus_default, null),
|
|
10692
10744
|
variant: "secondary",
|
|
10693
10745
|
"data-testid": "expanded-panel-create-button",
|
|
10694
10746
|
onClick: () => openModal("create" /* CREATE */),
|
|
@@ -10697,7 +10749,7 @@ var SavedViewsContent = (props) => {
|
|
|
10697
10749
|
i18n.t("savedViews.actions.create")
|
|
10698
10750
|
)
|
|
10699
10751
|
)),
|
|
10700
|
-
/* @__PURE__ */
|
|
10752
|
+
/* @__PURE__ */ React.default.createElement(_corereact.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ React.default.createElement(
|
|
10701
10753
|
PanelContent,
|
|
10702
10754
|
{
|
|
10703
10755
|
onSelect: ({ item }) => selectView(item),
|
|
@@ -10714,7 +10766,7 @@ var SavedViewsContent = (props) => {
|
|
|
10714
10766
|
onClearTemporary: clearTemporaryView
|
|
10715
10767
|
}
|
|
10716
10768
|
))
|
|
10717
|
-
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */
|
|
10769
|
+
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ React.default.createElement(
|
|
10718
10770
|
FormModal,
|
|
10719
10771
|
{
|
|
10720
10772
|
open: true,
|
|
@@ -10728,14 +10780,14 @@ var SavedViewsContent = (props) => {
|
|
|
10728
10780
|
setOpenEditCreateModal: closeModal,
|
|
10729
10781
|
defaultView: props.defaultView
|
|
10730
10782
|
}
|
|
10731
|
-
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */
|
|
10783
|
+
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */ React.default.createElement(
|
|
10732
10784
|
SavedViewsDeleteConfirmationModalShared,
|
|
10733
10785
|
{
|
|
10734
10786
|
open: true,
|
|
10735
10787
|
onDelete: confirmDeleteAndCloseModal,
|
|
10736
10788
|
onCancel: closeModal
|
|
10737
10789
|
}
|
|
10738
|
-
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */
|
|
10790
|
+
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ React.default.createElement(
|
|
10739
10791
|
SharedViewFormModal,
|
|
10740
10792
|
{
|
|
10741
10793
|
open: true,
|
|
@@ -10750,14 +10802,34 @@ var SavedViewsContent = (props) => {
|
|
|
10750
10802
|
)));
|
|
10751
10803
|
};
|
|
10752
10804
|
var SavedViews = (props) => {
|
|
10753
|
-
|
|
10805
|
+
const [resolvedDefault, setResolvedDefault] = _react.useState.call(void 0, () => props.transport ? void 0 : getCachedDefaultTransport());
|
|
10806
|
+
const [transportLoadError, setTransportLoadError] = _react.useState.call(void 0, void 0);
|
|
10807
|
+
_react.useEffect.call(void 0, () => {
|
|
10808
|
+
if (props.transport || resolvedDefault) return;
|
|
10809
|
+
let cancelled = false;
|
|
10810
|
+
void loadDefaultTransport().then((transport2) => {
|
|
10811
|
+
if (!cancelled) setResolvedDefault(transport2);
|
|
10812
|
+
}).catch((err) => {
|
|
10813
|
+
if (!cancelled) setTransportLoadError(err);
|
|
10814
|
+
});
|
|
10815
|
+
return () => {
|
|
10816
|
+
cancelled = true;
|
|
10817
|
+
};
|
|
10818
|
+
}, [props.transport, resolvedDefault]);
|
|
10819
|
+
const transport = _nullishCoalesce(props.transport, () => ( resolvedDefault));
|
|
10820
|
+
if (!transport) {
|
|
10821
|
+
if (transportLoadError) throw transportLoadError;
|
|
10822
|
+
return null;
|
|
10823
|
+
}
|
|
10824
|
+
const { CacheProvider } = transport;
|
|
10825
|
+
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 })))));
|
|
10754
10826
|
};
|
|
10755
10827
|
|
|
10756
10828
|
// src/components/adapters/smart-grid/SmartGridSavedViews.tsx
|
|
10757
|
-
|
|
10829
|
+
|
|
10758
10830
|
|
|
10759
10831
|
// src/components/adapters/smart-grid/SmartGridDefaultSavedView.tsx
|
|
10760
|
-
|
|
10832
|
+
|
|
10761
10833
|
var DEFAULT_COLUMN_STATE = {
|
|
10762
10834
|
hide: false,
|
|
10763
10835
|
pinned: null,
|
|
@@ -10773,13 +10845,13 @@ var DEFAULT_COLUMN_STATE = {
|
|
|
10773
10845
|
};
|
|
10774
10846
|
var getColumnStateFromDefs = (columnDefs) => {
|
|
10775
10847
|
return columnDefs.map((colDef) => {
|
|
10776
|
-
const field = colDef.field
|
|
10848
|
+
const field = _nullishCoalesce(colDef.field, () => ( colDef.colId));
|
|
10777
10849
|
if (!field) return null;
|
|
10778
10850
|
return {
|
|
10779
10851
|
colId: field,
|
|
10780
|
-
hide: colDef.hide
|
|
10781
|
-
pinned: colDef.pinned
|
|
10782
|
-
width: colDef.width
|
|
10852
|
+
hide: _nullishCoalesce(colDef.hide, () => ( false)),
|
|
10853
|
+
pinned: _nullishCoalesce(colDef.pinned, () => ( null)),
|
|
10854
|
+
width: _nullishCoalesce(_nullishCoalesce(colDef.width, () => ( colDef.minWidth)), () => ( DEFAULT_COLUMN_STATE.width)),
|
|
10783
10855
|
sort: null,
|
|
10784
10856
|
sortIndex: null,
|
|
10785
10857
|
pivot: false,
|
|
@@ -10787,25 +10859,25 @@ var getColumnStateFromDefs = (columnDefs) => {
|
|
|
10787
10859
|
aggFunc: null,
|
|
10788
10860
|
rowGroup: false,
|
|
10789
10861
|
rowGroupIndex: null,
|
|
10790
|
-
flex: colDef.flex
|
|
10862
|
+
flex: _nullishCoalesce(colDef.flex, () => ( null))
|
|
10791
10863
|
};
|
|
10792
10864
|
}).filter((col) => col !== null);
|
|
10793
10865
|
};
|
|
10794
10866
|
var extractDefaultView = (gridApi, receivedConfig) => {
|
|
10795
10867
|
var _a, _b;
|
|
10796
|
-
const columnDefs = gridApi.getColumnDefs()
|
|
10868
|
+
const columnDefs = _nullishCoalesce(gridApi.getColumnDefs(), () => ( []));
|
|
10797
10869
|
const defaultColumnState = ((_a = receivedConfig == null ? void 0 : receivedConfig.columnState) == null ? void 0 : _a.length) ? receivedConfig.columnState : getColumnStateFromDefs(columnDefs);
|
|
10798
10870
|
const result = {
|
|
10799
10871
|
columnState: defaultColumnState,
|
|
10800
|
-
columnGroupState: (receivedConfig == null ? void 0 : receivedConfig.columnGroupState)
|
|
10801
|
-
rowGroupState: (receivedConfig == null ? void 0 : receivedConfig.rowGroupState)
|
|
10802
|
-
filterState: (receivedConfig == null ? void 0 : receivedConfig.filterState)
|
|
10803
|
-
rowHeight: (receivedConfig == null ? void 0 : receivedConfig.rowHeight)
|
|
10872
|
+
columnGroupState: _nullishCoalesce((receivedConfig == null ? void 0 : receivedConfig.columnGroupState), () => ( [])),
|
|
10873
|
+
rowGroupState: _nullishCoalesce((receivedConfig == null ? void 0 : receivedConfig.rowGroupState), () => ( [])),
|
|
10874
|
+
filterState: _nullishCoalesce((receivedConfig == null ? void 0 : receivedConfig.filterState), () => ( {})),
|
|
10875
|
+
rowHeight: _nullishCoalesce((receivedConfig == null ? void 0 : receivedConfig.rowHeight), () => ( ((_b = gridApi.getSizesForCurrentTheme()) == null ? void 0 : _b.rowHeight)))
|
|
10804
10876
|
};
|
|
10805
10877
|
return result;
|
|
10806
10878
|
};
|
|
10807
10879
|
var useNormalizedDefaultViews = (defaultViews, gridApi) => {
|
|
10808
|
-
return (0,
|
|
10880
|
+
return _react.useMemo.call(void 0, () => {
|
|
10809
10881
|
if (!gridApi)
|
|
10810
10882
|
return defaultViews.map((view) => ({ ...view, share_token: view.id }));
|
|
10811
10883
|
return defaultViews.map((view) => ({
|
|
@@ -10817,7 +10889,7 @@ var useNormalizedDefaultViews = (defaultViews, gridApi) => {
|
|
|
10817
10889
|
};
|
|
10818
10890
|
|
|
10819
10891
|
// src/components/adapters/smart-grid/useSmartGridConfig.ts
|
|
10820
|
-
|
|
10892
|
+
|
|
10821
10893
|
var GRID_STATE_EVENTS = [
|
|
10822
10894
|
"sortChanged",
|
|
10823
10895
|
"filterOpened",
|
|
@@ -10833,10 +10905,10 @@ var GRID_STATE_EVENTS = [
|
|
|
10833
10905
|
"gridReady"
|
|
10834
10906
|
];
|
|
10835
10907
|
var useSmartGridConfig = (gridApi) => {
|
|
10836
|
-
const [config, setConfig] = (0,
|
|
10908
|
+
const [config, setConfig] = _react.useState.call(void 0,
|
|
10837
10909
|
() => getSmartGridConfig(gridApi)
|
|
10838
10910
|
);
|
|
10839
|
-
(0,
|
|
10911
|
+
_react.useEffect.call(void 0, () => {
|
|
10840
10912
|
if (!gridApi) return;
|
|
10841
10913
|
const updateConfig = () => {
|
|
10842
10914
|
setConfig(getSmartGridConfig(gridApi));
|
|
@@ -10854,14 +10926,14 @@ var useSmartGridConfig = (gridApi) => {
|
|
|
10854
10926
|
};
|
|
10855
10927
|
|
|
10856
10928
|
// src/components/adapters/smart-grid/useSavedViewsPanelOpen.ts
|
|
10857
|
-
|
|
10929
|
+
|
|
10858
10930
|
var SAVED_VIEWS_PANEL_ID = "savedViews";
|
|
10859
10931
|
var useSavedViewsPanelOpen = (gridApi) => {
|
|
10860
10932
|
var _a;
|
|
10861
|
-
const [isOpen, setIsOpen] = (0,
|
|
10933
|
+
const [isOpen, setIsOpen] = _react.useState.call(void 0,
|
|
10862
10934
|
((_a = gridApi.getOpenedToolPanel) == null ? void 0 : _a.call(gridApi)) === SAVED_VIEWS_PANEL_ID
|
|
10863
10935
|
);
|
|
10864
|
-
(0,
|
|
10936
|
+
_react.useEffect.call(void 0, () => {
|
|
10865
10937
|
var _a2;
|
|
10866
10938
|
const syncOpenState = () => {
|
|
10867
10939
|
var _a3;
|
|
@@ -10883,8 +10955,8 @@ var SmartGridSavedViews = (props) => {
|
|
|
10883
10955
|
const { config: tableConfig, setConfig: setTableConfig } = useSmartGridConfig(gridApi);
|
|
10884
10956
|
const isPanelOpen = useSavedViewsPanelOpen(gridApi);
|
|
10885
10957
|
const presetViews = useNormalizedDefaultViews(props.defaultViews, gridApi);
|
|
10886
|
-
const defaultView = presetViews.find((view) => view.id === "default")
|
|
10887
|
-
const onSelect = (0,
|
|
10958
|
+
const defaultView = _nullishCoalesce(presetViews.find((view) => view.id === "default"), () => ( presetViews[0]));
|
|
10959
|
+
const onSelect = _react.useCallback.call(void 0,
|
|
10888
10960
|
({ item }) => {
|
|
10889
10961
|
var _a;
|
|
10890
10962
|
if (!gridApi) return item;
|
|
@@ -10893,7 +10965,7 @@ var SmartGridSavedViews = (props) => {
|
|
|
10893
10965
|
updateTableConfig(item, gridApi, "smart-grid");
|
|
10894
10966
|
setTableConfig({
|
|
10895
10967
|
...item.table_config,
|
|
10896
|
-
filterState: ((_a = gridApi.getFilterModel) == null ? void 0 : _a.call(gridApi))
|
|
10968
|
+
filterState: _nullishCoalesce(((_a = gridApi.getFilterModel) == null ? void 0 : _a.call(gridApi)), () => ( {}))
|
|
10897
10969
|
});
|
|
10898
10970
|
return item;
|
|
10899
10971
|
}
|
|
@@ -10906,13 +10978,13 @@ var SmartGridSavedViews = (props) => {
|
|
|
10906
10978
|
};
|
|
10907
10979
|
updateTableConfig(updatedView, gridApi, "smart-grid");
|
|
10908
10980
|
const updatedConfig = updatedView.table_config;
|
|
10909
|
-
gridApi.setFilterModel(updatedConfig.filterState
|
|
10981
|
+
gridApi.setFilterModel(_nullishCoalesce(updatedConfig.filterState, () => ( {})));
|
|
10910
10982
|
setTableConfig(updatedConfig);
|
|
10911
10983
|
return updatedView;
|
|
10912
10984
|
},
|
|
10913
10985
|
[gridApi, tableConfig, setTableConfig]
|
|
10914
10986
|
);
|
|
10915
|
-
return /* @__PURE__ */
|
|
10987
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
10916
10988
|
SavedViews,
|
|
10917
10989
|
{
|
|
10918
10990
|
onSelect,
|
|
@@ -10925,16 +10997,22 @@ var SmartGridSavedViews = (props) => {
|
|
|
10925
10997
|
presetViews,
|
|
10926
10998
|
tableName: props.tableName,
|
|
10927
10999
|
tableConfig,
|
|
10928
|
-
isPanelOpen
|
|
11000
|
+
isPanelOpen,
|
|
11001
|
+
transport: props.transport
|
|
10929
11002
|
}
|
|
10930
11003
|
);
|
|
10931
11004
|
};
|
|
10932
11005
|
|
|
10933
11006
|
// src/components/adapters/data-table/DataTableSavedViews.tsx
|
|
10934
|
-
|
|
11007
|
+
|
|
11008
|
+
|
|
11009
|
+
|
|
11010
|
+
|
|
11011
|
+
|
|
11012
|
+
|
|
10935
11013
|
|
|
10936
11014
|
// src/components/adapters/data-table/DataTableDefaultSavedView.tsx
|
|
10937
|
-
|
|
11015
|
+
|
|
10938
11016
|
var DEFAULT_COLUMN_STATE2 = {
|
|
10939
11017
|
hidden: false,
|
|
10940
11018
|
pinned: null,
|
|
@@ -10955,13 +11033,13 @@ var getColumnState = (columnDefinitions) => {
|
|
|
10955
11033
|
}
|
|
10956
11034
|
return {
|
|
10957
11035
|
field: column2.field,
|
|
10958
|
-
hidden: column2.hidden
|
|
10959
|
-
pinned: column2.pinned
|
|
11036
|
+
hidden: _nullishCoalesce(column2.hidden, () => ( false)),
|
|
11037
|
+
pinned: _nullishCoalesce(column2.pinned, () => ( null)),
|
|
10960
11038
|
rowGroup: false,
|
|
10961
11039
|
rowGroupIndex: null,
|
|
10962
11040
|
sort: null,
|
|
10963
11041
|
sortIndex: null,
|
|
10964
|
-
width: (column2.minWidth
|
|
11042
|
+
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
|
|
10965
11043
|
};
|
|
10966
11044
|
});
|
|
10967
11045
|
};
|
|
@@ -10970,19 +11048,19 @@ var extractDefaultView2 = (columnDefinitions, receivedConfigFromTool) => {
|
|
|
10970
11048
|
const defaultColumnState = getColumnState(columnDefinitions);
|
|
10971
11049
|
const result = {
|
|
10972
11050
|
columnState: ((_a = receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.columnState) == null ? void 0 : _a.length) ? receivedConfigFromTool.columnState : defaultColumnState,
|
|
10973
|
-
serverFilters: (receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.serverFilters)
|
|
10974
|
-
columnGroupState: (receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.columnGroupState)
|
|
10975
|
-
filters: (receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.filters)
|
|
11051
|
+
serverFilters: _nullishCoalesce((receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.serverFilters), () => ( [])),
|
|
11052
|
+
columnGroupState: _nullishCoalesce((receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.columnGroupState), () => ( [])),
|
|
11053
|
+
filters: _nullishCoalesce((receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.filters), () => ( {})),
|
|
10976
11054
|
groupRowState: {
|
|
10977
|
-
expandedRoutes: ((_b = receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.groupRowState) == null ? void 0 : _b.expandedRoutes)
|
|
10978
|
-
collapsedRoutes: ((_c = receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.groupRowState) == null ? void 0 : _c.collapsedRoutes)
|
|
11055
|
+
expandedRoutes: _nullishCoalesce(((_b = receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.groupRowState) == null ? void 0 : _b.expandedRoutes), () => ( [])),
|
|
11056
|
+
collapsedRoutes: _nullishCoalesce(((_c = receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.groupRowState) == null ? void 0 : _c.collapsedRoutes), () => ( []))
|
|
10979
11057
|
},
|
|
10980
|
-
rowHeight: (receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.rowHeight)
|
|
11058
|
+
rowHeight: _nullishCoalesce((receivedConfigFromTool == null ? void 0 : receivedConfigFromTool.rowHeight), () => ( MEDIUM_ROW_HEIGHT))
|
|
10981
11059
|
};
|
|
10982
11060
|
return result;
|
|
10983
11061
|
};
|
|
10984
11062
|
var useNormalizedDefaultViews2 = (defaultViews, columnDefinitions) => {
|
|
10985
|
-
return (0,
|
|
11063
|
+
return _react.useMemo.call(void 0,
|
|
10986
11064
|
() => defaultViews.map((view) => ({
|
|
10987
11065
|
...view,
|
|
10988
11066
|
share_token: view.id,
|
|
@@ -10993,26 +11071,26 @@ var useNormalizedDefaultViews2 = (defaultViews, columnDefinitions) => {
|
|
|
10993
11071
|
};
|
|
10994
11072
|
|
|
10995
11073
|
// src/components/adapters/data-table/DataTableSavedViews.tsx
|
|
10996
|
-
var DataTableSavedViews = (0,
|
|
11074
|
+
var DataTableSavedViews = _react.forwardRef.call(void 0, (props, ref) => {
|
|
10997
11075
|
const { tableApi, userId, projectId, companyId } = props;
|
|
10998
11076
|
const presetViews = useNormalizedDefaultViews2(
|
|
10999
11077
|
props.defaultViews,
|
|
11000
11078
|
props.columnDefinitions
|
|
11001
11079
|
);
|
|
11002
|
-
const defaultView = presetViews.find((view) => view.id === "default")
|
|
11003
|
-
const [internalTableConfig, setInternalTableConfig] = (0,
|
|
11080
|
+
const defaultView = _nullishCoalesce(presetViews.find((view) => view.id === "default"), () => ( presetViews[0]));
|
|
11081
|
+
const [internalTableConfig, setInternalTableConfig] = _react.useState.call(void 0,
|
|
11004
11082
|
ViewStorage.load(props.stickyViewsKey, defaultView).table_config
|
|
11005
11083
|
);
|
|
11006
|
-
(0,
|
|
11084
|
+
_react.useImperativeHandle.call(void 0, ref, () => ({
|
|
11007
11085
|
setTableConfig: (newConfig) => {
|
|
11008
11086
|
setInternalTableConfig(newConfig);
|
|
11009
11087
|
}
|
|
11010
11088
|
}));
|
|
11011
|
-
const onSelect = (0,
|
|
11089
|
+
const onSelect = _react.useCallback.call(void 0,
|
|
11012
11090
|
({ item }) => {
|
|
11013
11091
|
var _a;
|
|
11014
11092
|
const isPresetView = item.view_level === "default";
|
|
11015
|
-
const syncReferenceConfig = ((_a = tableApi == null ? void 0 : tableApi.getTableConfiguration) == null ? void 0 : _a.call(tableApi))
|
|
11093
|
+
const syncReferenceConfig = _nullishCoalesce(((_a = tableApi == null ? void 0 : tableApi.getTableConfiguration) == null ? void 0 : _a.call(tableApi)), () => ( defaultView.table_config));
|
|
11016
11094
|
const syncedConfig = isPresetView ? item.table_config : customAndConfigSync(
|
|
11017
11095
|
item.table_config,
|
|
11018
11096
|
syncReferenceConfig
|
|
@@ -11032,7 +11110,7 @@ var DataTableSavedViews = (0, import_react22.forwardRef)((props, ref) => {
|
|
|
11032
11110
|
if (!internalTableConfig) {
|
|
11033
11111
|
return null;
|
|
11034
11112
|
}
|
|
11035
|
-
return /* @__PURE__ */
|
|
11113
|
+
return /* @__PURE__ */ React.default.createElement(
|
|
11036
11114
|
SavedViews,
|
|
11037
11115
|
{
|
|
11038
11116
|
onSelect,
|
|
@@ -11044,26 +11122,26 @@ var DataTableSavedViews = (0, import_react22.forwardRef)((props, ref) => {
|
|
|
11044
11122
|
defaultView,
|
|
11045
11123
|
presetViews,
|
|
11046
11124
|
tableName: props.tableName,
|
|
11047
|
-
tableConfig: internalTableConfig
|
|
11125
|
+
tableConfig: internalTableConfig,
|
|
11126
|
+
transport: props.transport
|
|
11048
11127
|
}
|
|
11049
11128
|
);
|
|
11050
11129
|
});
|
|
11051
11130
|
DataTableSavedViews.displayName = "DataTableSavedViews";
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
});
|
|
11131
|
+
|
|
11132
|
+
|
|
11133
|
+
|
|
11134
|
+
|
|
11135
|
+
|
|
11136
|
+
|
|
11137
|
+
|
|
11138
|
+
|
|
11139
|
+
|
|
11140
|
+
|
|
11141
|
+
|
|
11142
|
+
|
|
11143
|
+
|
|
11144
|
+
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;
|
|
11067
11145
|
/*! Bundled license information:
|
|
11068
11146
|
|
|
11069
11147
|
lodash/lodash.js:
|