@orangelogic/orange-dam-content-browser-sdk 2.3.6 → 2.3.7-table-view-beta-2
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/build/GlobalConfigContext.d.ts +3 -0
- package/build/OrangeDAMContentBrowserSDK.min.js +782 -326
- package/build/api/asset/asset.d.ts +2 -1
- package/build/components/content-browser/content-browser.d.ts +37 -2
- package/build/components/content-browser-asset-card/content-browser-asset-card.d.ts +17 -1
- package/build/components/content-browser-control-bar/content-browser-control-bar.d.ts +1 -0
- package/build/components/content-browser-control-view/content-browser-control-view.d.ts +5 -2
- package/build/components/content-browser-format-dialog/content-browser-format-dialog.d.ts +27 -1
- package/build/components/content-browser-grid/content-browser-grid.d.ts +5 -1
- package/build/components/content-browser-grid/scroll-anchor-controller.d.ts +12 -1
- package/build/components/content-browser-table/content-browser-table.d.ts +178 -0
- package/build/components/content-browser-table/content-browser-table.styles.d.ts +2 -0
- package/build/content-browser.mjs +1725 -474
- package/build/events/cx-content-browser-control-view-change.d.ts +2 -2
- package/build/events/cx-content-browser-request-change.d.ts +2 -2
- package/build/events/cx-content-browser-table-column-resize.d.ts +16 -0
- package/build/events/index.d.ts +1 -0
- package/build/index.d.ts +29 -2
- package/build/index.html +4 -0
- package/build/index.mjs +1694 -425
- package/build/tools/fetch-and-merge-assets.d.ts +10 -1
- package/build/types/asset.d.ts +5 -0
- package/build/types/content-browser.d.ts +53 -0
- package/package.json +1 -1
|
@@ -109,7 +109,7 @@ var __yieldStar = (value) => {
|
|
|
109
109
|
}, "return" in obj && method("return"), it;
|
|
110
110
|
};
|
|
111
111
|
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
|
|
112
|
-
var _a, _b, _c, _d, _e, _f, _host, _getContainer, _getItemIndexById, _itemSelector, _anchor, _columnCount, _itemHeight, _pendingRestoreFrames, _restoreSequence, _lastGetDataParameters, _lastMappedAvailableExtensions, _lastData, _hasFetchedOnce;
|
|
112
|
+
var _a, _b, _c, _d, _e, _f, _host, _getContainer, _getContentOffset, _getItemIndexById, _getLayoutSource, _itemSelector, _anchor, _columnCount, _itemHeight, _pendingRestoreFrames, _restoreSequence, _lastGetDataParameters, _lastMappedAvailableExtensions, _lastData, _hasFetchedOnce;
|
|
113
113
|
import CxDrawer from "@orangelogic/design-system/components/drawer";
|
|
114
114
|
import CxFolderSelect from "@orangelogic/design-system/components/folder-select";
|
|
115
115
|
import CxIcon from "@orangelogic/design-system/components/icon";
|
|
@@ -1165,13 +1165,13 @@ var camelCase = createCompounder(function(result, word, index) {
|
|
|
1165
1165
|
word = word.toLowerCase();
|
|
1166
1166
|
return result + (index ? capitalize(word) : word);
|
|
1167
1167
|
});
|
|
1168
|
-
var __defProp$
|
|
1169
|
-
var __decorateClass$
|
|
1168
|
+
var __defProp$i = Object.defineProperty;
|
|
1169
|
+
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
1170
1170
|
var result = void 0;
|
|
1171
1171
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
1172
1172
|
if (decorator = decorators[i4])
|
|
1173
1173
|
result = decorator(target, key, result) || result;
|
|
1174
|
-
if (result) __defProp$
|
|
1174
|
+
if (result) __defProp$i(target, key, result);
|
|
1175
1175
|
return result;
|
|
1176
1176
|
};
|
|
1177
1177
|
const _CortexElement = class _CortexElement extends i$4 {
|
|
@@ -1298,16 +1298,16 @@ const _CortexElement = class _CortexElement extends i$4 {
|
|
|
1298
1298
|
_CortexElement.version = "1";
|
|
1299
1299
|
_CortexElement.dependencies = {};
|
|
1300
1300
|
let CortexElement = _CortexElement;
|
|
1301
|
-
__decorateClass$
|
|
1301
|
+
__decorateClass$i([
|
|
1302
1302
|
n$6()
|
|
1303
1303
|
], CortexElement.prototype, "dir");
|
|
1304
|
-
__decorateClass$
|
|
1304
|
+
__decorateClass$i([
|
|
1305
1305
|
n$6()
|
|
1306
1306
|
], CortexElement.prototype, "lang");
|
|
1307
|
-
__decorateClass$
|
|
1307
|
+
__decorateClass$i([
|
|
1308
1308
|
n$6()
|
|
1309
1309
|
], CortexElement.prototype, "theme");
|
|
1310
|
-
__decorateClass$
|
|
1310
|
+
__decorateClass$i([
|
|
1311
1311
|
n$6({ attribute: "pre-render", type: Boolean })
|
|
1312
1312
|
], CortexElement.prototype, "preRender");
|
|
1313
1313
|
function rescueElementPrototype(element) {
|
|
@@ -5748,7 +5748,7 @@ function watch(propertyName, options) {
|
|
|
5748
5748
|
};
|
|
5749
5749
|
};
|
|
5750
5750
|
}
|
|
5751
|
-
const styles$
|
|
5751
|
+
const styles$f = i$7`
|
|
5752
5752
|
:host {
|
|
5753
5753
|
display: contents;
|
|
5754
5754
|
}
|
|
@@ -5837,14 +5837,14 @@ const styles$e = i$7`
|
|
|
5837
5837
|
display: block;
|
|
5838
5838
|
}
|
|
5839
5839
|
`;
|
|
5840
|
-
var __defProp$
|
|
5841
|
-
var __getOwnPropDesc$
|
|
5842
|
-
var __decorateClass$
|
|
5843
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5840
|
+
var __defProp$h = Object.defineProperty;
|
|
5841
|
+
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
5842
|
+
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
5843
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
5844
5844
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
5845
5845
|
if (decorator = decorators[i4])
|
|
5846
5846
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5847
|
-
if (kind && result) __defProp$
|
|
5847
|
+
if (kind && result) __defProp$h(target, key, result);
|
|
5848
5848
|
return result;
|
|
5849
5849
|
};
|
|
5850
5850
|
const LIBRARY_FOLDER_TITLE = "Library";
|
|
@@ -6107,7 +6107,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
6107
6107
|
`;
|
|
6108
6108
|
}
|
|
6109
6109
|
};
|
|
6110
|
-
CxContentBrowserBrowser.styles = [componentStyles, styles$
|
|
6110
|
+
CxContentBrowserBrowser.styles = [componentStyles, styles$f];
|
|
6111
6111
|
CxContentBrowserBrowser.dependencies = {
|
|
6112
6112
|
"cx-drawer": CxDrawer,
|
|
6113
6113
|
"cx-folder-select": CxFolderSelect,
|
|
@@ -6117,67 +6117,67 @@ CxContentBrowserBrowser.dependencies = {
|
|
|
6117
6117
|
"cx-tooltip": CxTooltip,
|
|
6118
6118
|
"cx-typography": CxTypography
|
|
6119
6119
|
};
|
|
6120
|
-
__decorateClass$
|
|
6120
|
+
__decorateClass$h([
|
|
6121
6121
|
e$7(".drawer-trigger")
|
|
6122
6122
|
], CxContentBrowserBrowser.prototype, "trigger", 2);
|
|
6123
|
-
__decorateClass$
|
|
6123
|
+
__decorateClass$h([
|
|
6124
6124
|
e$7(".content-browser-browser")
|
|
6125
6125
|
], CxContentBrowserBrowser.prototype, "drawer", 2);
|
|
6126
|
-
__decorateClass$
|
|
6126
|
+
__decorateClass$h([
|
|
6127
6127
|
n$6({ attribute: "folder-id", type: String })
|
|
6128
6128
|
], CxContentBrowserBrowser.prototype, "folderId", 2);
|
|
6129
|
-
__decorateClass$
|
|
6129
|
+
__decorateClass$h([
|
|
6130
6130
|
n$6({ attribute: "folder-title", type: String })
|
|
6131
6131
|
], CxContentBrowserBrowser.prototype, "folderTitle", 2);
|
|
6132
|
-
__decorateClass$
|
|
6132
|
+
__decorateClass$h([
|
|
6133
6133
|
n$6({ attribute: "allowed-folders", type: Array })
|
|
6134
6134
|
], CxContentBrowserBrowser.prototype, "allowedFolders", 2);
|
|
6135
|
-
__decorateClass$
|
|
6135
|
+
__decorateClass$h([
|
|
6136
6136
|
n$6({ attribute: "can-pin", type: Boolean })
|
|
6137
6137
|
], CxContentBrowserBrowser.prototype, "canPin", 2);
|
|
6138
|
-
__decorateClass$
|
|
6138
|
+
__decorateClass$h([
|
|
6139
6139
|
n$6({ attribute: "collection-path", type: String })
|
|
6140
6140
|
], CxContentBrowserBrowser.prototype, "collectionPath", 2);
|
|
6141
|
-
__decorateClass$
|
|
6141
|
+
__decorateClass$h([
|
|
6142
6142
|
n$6({ attribute: "favorite-folder-id", type: String })
|
|
6143
6143
|
], CxContentBrowserBrowser.prototype, "favoriteFolderId", 2);
|
|
6144
|
-
__decorateClass$
|
|
6144
|
+
__decorateClass$h([
|
|
6145
6145
|
n$6({ attribute: "show-collections", type: Boolean })
|
|
6146
6146
|
], CxContentBrowserBrowser.prototype, "showCollections", 2);
|
|
6147
|
-
__decorateClass$
|
|
6147
|
+
__decorateClass$h([
|
|
6148
6148
|
n$6({ attribute: "show-favorite-folder", type: Boolean })
|
|
6149
6149
|
], CxContentBrowserBrowser.prototype, "showFavoriteFolder", 2);
|
|
6150
|
-
__decorateClass$
|
|
6150
|
+
__decorateClass$h([
|
|
6151
6151
|
n$6({ attribute: "force-overlay", type: Boolean })
|
|
6152
6152
|
], CxContentBrowserBrowser.prototype, "forceOverlay", 2);
|
|
6153
|
-
__decorateClass$
|
|
6153
|
+
__decorateClass$h([
|
|
6154
6154
|
n$6({ attribute: "see-thru", type: Boolean })
|
|
6155
6155
|
], CxContentBrowserBrowser.prototype, "seeThru", 2);
|
|
6156
|
-
__decorateClass$
|
|
6156
|
+
__decorateClass$h([
|
|
6157
6157
|
n$6({ attribute: "min-query-length", type: Number })
|
|
6158
6158
|
], CxContentBrowserBrowser.prototype, "minQueryLength", 2);
|
|
6159
|
-
__decorateClass$
|
|
6159
|
+
__decorateClass$h([
|
|
6160
6160
|
n$6({ attribute: "token", type: String })
|
|
6161
6161
|
], CxContentBrowserBrowser.prototype, "token", 2);
|
|
6162
|
-
__decorateClass$
|
|
6162
|
+
__decorateClass$h([
|
|
6163
6163
|
n$6({ attribute: "base-url", type: String })
|
|
6164
6164
|
], CxContentBrowserBrowser.prototype, "baseUrl", 2);
|
|
6165
|
-
__decorateClass$
|
|
6165
|
+
__decorateClass$h([
|
|
6166
6166
|
n$6({ attribute: "use-site-session", type: Boolean })
|
|
6167
6167
|
], CxContentBrowserBrowser.prototype, "useSiteSession", 2);
|
|
6168
|
-
__decorateClass$
|
|
6168
|
+
__decorateClass$h([
|
|
6169
6169
|
r$6()
|
|
6170
6170
|
], CxContentBrowserBrowser.prototype, "searchTerm", 2);
|
|
6171
|
-
__decorateClass$
|
|
6171
|
+
__decorateClass$h([
|
|
6172
6172
|
r$6()
|
|
6173
6173
|
], CxContentBrowserBrowser.prototype, "isPersistent", 2);
|
|
6174
|
-
__decorateClass$
|
|
6174
|
+
__decorateClass$h([
|
|
6175
6175
|
r$6()
|
|
6176
6176
|
], CxContentBrowserBrowser.prototype, "collectionsOpen", 2);
|
|
6177
|
-
__decorateClass$
|
|
6177
|
+
__decorateClass$h([
|
|
6178
6178
|
watch("forceOverlay", { waitUntilFirstUpdate: true })
|
|
6179
6179
|
], CxContentBrowserBrowser.prototype, "handleForceOverlayChange", 1);
|
|
6180
|
-
CxContentBrowserBrowser = __decorateClass$
|
|
6180
|
+
CxContentBrowserBrowser = __decorateClass$h([
|
|
6181
6181
|
customElement("cx-content-browser-browser")
|
|
6182
6182
|
], CxContentBrowserBrowser);
|
|
6183
6183
|
/**
|
|
@@ -6308,6 +6308,7 @@ var GridView = /* @__PURE__ */ ((GridView2) => {
|
|
|
6308
6308
|
GridView2["Small"] = "small";
|
|
6309
6309
|
return GridView2;
|
|
6310
6310
|
})(GridView || {});
|
|
6311
|
+
const TABLE_VIEW = "table";
|
|
6311
6312
|
const ASSET_SIZE = {
|
|
6312
6313
|
[
|
|
6313
6314
|
"small"
|
|
@@ -6340,19 +6341,40 @@ var TransformationAction = /* @__PURE__ */ ((TransformationAction2) => {
|
|
|
6340
6341
|
TransformationAction2["Rotate"] = "Rotate";
|
|
6341
6342
|
return TransformationAction2;
|
|
6342
6343
|
})(TransformationAction || {});
|
|
6344
|
+
const autoSelectFormatConverter = {
|
|
6345
|
+
fromAttribute: (value) => {
|
|
6346
|
+
if (value === null) {
|
|
6347
|
+
return false;
|
|
6348
|
+
}
|
|
6349
|
+
const normalized = value.trim();
|
|
6350
|
+
if (normalized === "" || normalized.toLowerCase() === "true") {
|
|
6351
|
+
return true;
|
|
6352
|
+
}
|
|
6353
|
+
if (normalized.toLowerCase() === "false") {
|
|
6354
|
+
return false;
|
|
6355
|
+
}
|
|
6356
|
+
return normalized;
|
|
6357
|
+
},
|
|
6358
|
+
toAttribute: (value) => {
|
|
6359
|
+
return value === false ? null : String(value);
|
|
6360
|
+
}
|
|
6361
|
+
};
|
|
6362
|
+
function isAutoSelectFormatActive(value) {
|
|
6363
|
+
return value === true || typeof value === "string" && value.trim() !== "";
|
|
6364
|
+
}
|
|
6343
6365
|
var ContentBrowserFormatDialogVariant = /* @__PURE__ */ ((ContentBrowserFormatDialogVariant2) => {
|
|
6344
6366
|
ContentBrowserFormatDialogVariant2["Dialog"] = "dialog";
|
|
6345
6367
|
ContentBrowserFormatDialogVariant2["Drawer"] = "drawer";
|
|
6346
6368
|
return ContentBrowserFormatDialogVariant2;
|
|
6347
6369
|
})(ContentBrowserFormatDialogVariant || {});
|
|
6348
|
-
var __defProp$
|
|
6349
|
-
var __getOwnPropDesc$
|
|
6350
|
-
var __decorateClass$
|
|
6351
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6370
|
+
var __defProp$g = Object.defineProperty;
|
|
6371
|
+
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
6372
|
+
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
6373
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
6352
6374
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
6353
6375
|
if (decorator = decorators[i4])
|
|
6354
6376
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6355
|
-
if (kind && result) __defProp$
|
|
6377
|
+
if (kind && result) __defProp$g(target, key, result);
|
|
6356
6378
|
return result;
|
|
6357
6379
|
};
|
|
6358
6380
|
let CxContentBrowserControlFilterFacet = class extends CortexElement {
|
|
@@ -6488,37 +6510,37 @@ CxContentBrowserControlFilterFacet.dependencies = {
|
|
|
6488
6510
|
"cx-typography": CxTypography
|
|
6489
6511
|
};
|
|
6490
6512
|
CxContentBrowserControlFilterFacet.itemsPerPage = 10;
|
|
6491
|
-
__decorateClass$
|
|
6513
|
+
__decorateClass$g([
|
|
6492
6514
|
n$6({ attribute: "loading", reflect: false, type: Boolean })
|
|
6493
6515
|
], CxContentBrowserControlFilterFacet.prototype, "loading", 2);
|
|
6494
|
-
__decorateClass$
|
|
6516
|
+
__decorateClass$g([
|
|
6495
6517
|
n$6({ attribute: "display-name", reflect: false, type: String })
|
|
6496
6518
|
], CxContentBrowserControlFilterFacet.prototype, "displayName", 2);
|
|
6497
|
-
__decorateClass$
|
|
6519
|
+
__decorateClass$g([
|
|
6498
6520
|
n$6({ attribute: "type", reflect: true, type: String })
|
|
6499
6521
|
], CxContentBrowserControlFilterFacet.prototype, "type", 2);
|
|
6500
|
-
__decorateClass$
|
|
6522
|
+
__decorateClass$g([
|
|
6501
6523
|
n$6({ attribute: "values", reflect: false, type: Array })
|
|
6502
6524
|
], CxContentBrowserControlFilterFacet.prototype, "values", 2);
|
|
6503
|
-
__decorateClass$
|
|
6525
|
+
__decorateClass$g([
|
|
6504
6526
|
n$6({ attribute: "collections", reflect: false, type: Array })
|
|
6505
6527
|
], CxContentBrowserControlFilterFacet.prototype, "collections", 2);
|
|
6506
|
-
__decorateClass$
|
|
6528
|
+
__decorateClass$g([
|
|
6507
6529
|
r$6()
|
|
6508
6530
|
], CxContentBrowserControlFilterFacet.prototype, "mappedSubtypes", 2);
|
|
6509
|
-
__decorateClass$
|
|
6531
|
+
__decorateClass$g([
|
|
6510
6532
|
r$6()
|
|
6511
6533
|
], CxContentBrowserControlFilterFacet.prototype, "mappedDisplayNames", 2);
|
|
6512
|
-
__decorateClass$
|
|
6534
|
+
__decorateClass$g([
|
|
6513
6535
|
r$6()
|
|
6514
6536
|
], CxContentBrowserControlFilterFacet.prototype, "page", 2);
|
|
6515
|
-
__decorateClass$
|
|
6537
|
+
__decorateClass$g([
|
|
6516
6538
|
watch("values")
|
|
6517
6539
|
], CxContentBrowserControlFilterFacet.prototype, "handleValuesChange", 1);
|
|
6518
|
-
CxContentBrowserControlFilterFacet = __decorateClass$
|
|
6540
|
+
CxContentBrowserControlFilterFacet = __decorateClass$g([
|
|
6519
6541
|
customElement("cx-content-browser-control-filter-facet")
|
|
6520
6542
|
], CxContentBrowserControlFilterFacet);
|
|
6521
|
-
const styles$
|
|
6543
|
+
const styles$e = i$7`
|
|
6522
6544
|
:host {
|
|
6523
6545
|
--details-width: min(240px, 90dvw);
|
|
6524
6546
|
|
|
@@ -6543,14 +6565,14 @@ const styles$d = i$7`
|
|
|
6543
6565
|
border-left-width: 0px;
|
|
6544
6566
|
}
|
|
6545
6567
|
`;
|
|
6546
|
-
var __defProp$
|
|
6547
|
-
var __getOwnPropDesc$
|
|
6548
|
-
var __decorateClass$
|
|
6549
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6568
|
+
var __defProp$f = Object.defineProperty;
|
|
6569
|
+
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
6570
|
+
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
6571
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
|
|
6550
6572
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
6551
6573
|
if (decorator = decorators[i4])
|
|
6552
6574
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6553
|
-
if (kind && result) __defProp$
|
|
6575
|
+
if (kind && result) __defProp$f(target, key, result);
|
|
6554
6576
|
return result;
|
|
6555
6577
|
};
|
|
6556
6578
|
let CxContentBrowserControlFilter = class extends CortexElement {
|
|
@@ -6775,7 +6797,7 @@ let CxContentBrowserControlFilter = class extends CortexElement {
|
|
|
6775
6797
|
`;
|
|
6776
6798
|
}
|
|
6777
6799
|
};
|
|
6778
|
-
CxContentBrowserControlFilter.styles = [componentStyles, styles$
|
|
6800
|
+
CxContentBrowserControlFilter.styles = [componentStyles, styles$e];
|
|
6779
6801
|
CxContentBrowserControlFilter.dependencies = {
|
|
6780
6802
|
"cx-badge": CxBadge,
|
|
6781
6803
|
"cx-button": CxButton,
|
|
@@ -6796,52 +6818,52 @@ CxContentBrowserControlFilter.dependencies = {
|
|
|
6796
6818
|
"cx-tooltip": CxTooltip,
|
|
6797
6819
|
"cx-typography": CxTypography
|
|
6798
6820
|
};
|
|
6799
|
-
__decorateClass$
|
|
6821
|
+
__decorateClass$f([
|
|
6800
6822
|
n$6({ attribute: "facets", reflect: false, type: Array })
|
|
6801
6823
|
], CxContentBrowserControlFilter.prototype, "facets", 2);
|
|
6802
|
-
__decorateClass$
|
|
6824
|
+
__decorateClass$f([
|
|
6803
6825
|
n$6({ attribute: "available-facets", reflect: false, type: Array })
|
|
6804
6826
|
], CxContentBrowserControlFilter.prototype, "availableFacets", 2);
|
|
6805
|
-
__decorateClass$
|
|
6827
|
+
__decorateClass$f([
|
|
6806
6828
|
n$6({ attribute: "selected-facets", reflect: false, type: Object })
|
|
6807
6829
|
], CxContentBrowserControlFilter.prototype, "selectedFacets", 2);
|
|
6808
|
-
__decorateClass$
|
|
6830
|
+
__decorateClass$f([
|
|
6809
6831
|
n$6({ attribute: "loading", reflect: false, type: Boolean })
|
|
6810
6832
|
], CxContentBrowserControlFilter.prototype, "loading", 2);
|
|
6811
|
-
__decorateClass$
|
|
6833
|
+
__decorateClass$f([
|
|
6812
6834
|
n$6({ attribute: "newly-changed-option", reflect: false, type: Object })
|
|
6813
6835
|
], CxContentBrowserControlFilter.prototype, "newlyChangedOption", 2);
|
|
6814
|
-
__decorateClass$
|
|
6836
|
+
__decorateClass$f([
|
|
6815
6837
|
n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
|
|
6816
6838
|
], CxContentBrowserControlFilter.prototype, "isMobile", 2);
|
|
6817
|
-
__decorateClass$
|
|
6839
|
+
__decorateClass$f([
|
|
6818
6840
|
r$6()
|
|
6819
6841
|
], CxContentBrowserControlFilter.prototype, "appliedFiltersCount", 2);
|
|
6820
|
-
__decorateClass$
|
|
6842
|
+
__decorateClass$f([
|
|
6821
6843
|
r$6()
|
|
6822
6844
|
], CxContentBrowserControlFilter.prototype, "mappedDisplayNames", 2);
|
|
6823
|
-
__decorateClass$
|
|
6845
|
+
__decorateClass$f([
|
|
6824
6846
|
watch("facets")
|
|
6825
6847
|
], CxContentBrowserControlFilter.prototype, "handleFacetsChange", 1);
|
|
6826
|
-
__decorateClass$
|
|
6848
|
+
__decorateClass$f([
|
|
6827
6849
|
watch("selectedFacets")
|
|
6828
6850
|
], CxContentBrowserControlFilter.prototype, "handleSelectedFacetsChange", 1);
|
|
6829
|
-
CxContentBrowserControlFilter = __decorateClass$
|
|
6851
|
+
CxContentBrowserControlFilter = __decorateClass$f([
|
|
6830
6852
|
customElement("cx-content-browser-control-filter")
|
|
6831
6853
|
], CxContentBrowserControlFilter);
|
|
6832
|
-
const styles$
|
|
6854
|
+
const styles$d = i$7`
|
|
6833
6855
|
:host {
|
|
6834
6856
|
display: contents;
|
|
6835
6857
|
}
|
|
6836
6858
|
`;
|
|
6837
|
-
var __defProp$
|
|
6838
|
-
var __getOwnPropDesc$
|
|
6839
|
-
var __decorateClass$
|
|
6840
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6859
|
+
var __defProp$e = Object.defineProperty;
|
|
6860
|
+
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
6861
|
+
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
6862
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
6841
6863
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
6842
6864
|
if (decorator = decorators[i4])
|
|
6843
6865
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6844
|
-
if (kind && result) __defProp$
|
|
6866
|
+
if (kind && result) __defProp$e(target, key, result);
|
|
6845
6867
|
return result;
|
|
6846
6868
|
};
|
|
6847
6869
|
let CxContentBrowserControlSort = class extends CortexElement {
|
|
@@ -6980,7 +7002,7 @@ let CxContentBrowserControlSort = class extends CortexElement {
|
|
|
6980
7002
|
`;
|
|
6981
7003
|
}
|
|
6982
7004
|
};
|
|
6983
|
-
CxContentBrowserControlSort.styles = [componentStyles, styles$
|
|
7005
|
+
CxContentBrowserControlSort.styles = [componentStyles, styles$d];
|
|
6984
7006
|
CxContentBrowserControlSort.dependencies = {
|
|
6985
7007
|
"cx-divider": CxDivider,
|
|
6986
7008
|
"cx-dropdown": CxDropdown,
|
|
@@ -6991,40 +7013,40 @@ CxContentBrowserControlSort.dependencies = {
|
|
|
6991
7013
|
"cx-spinner": CxSpinner,
|
|
6992
7014
|
"cx-tooltip": CxTooltip
|
|
6993
7015
|
};
|
|
6994
|
-
__decorateClass$
|
|
7016
|
+
__decorateClass$e([
|
|
6995
7017
|
n$6({ attribute: "sort-order-name", reflect: true, type: String })
|
|
6996
7018
|
], CxContentBrowserControlSort.prototype, "sortOrderName", 2);
|
|
6997
|
-
__decorateClass$
|
|
7019
|
+
__decorateClass$e([
|
|
6998
7020
|
n$6({ attribute: "sort-direction", reflect: true, type: String })
|
|
6999
7021
|
], CxContentBrowserControlSort.prototype, "sortDirection", 2);
|
|
7000
|
-
__decorateClass$
|
|
7022
|
+
__decorateClass$e([
|
|
7001
7023
|
n$6({ attribute: "sort-orders", reflect: false, type: Array })
|
|
7002
7024
|
], CxContentBrowserControlSort.prototype, "sortOrders", 2);
|
|
7003
|
-
__decorateClass$
|
|
7025
|
+
__decorateClass$e([
|
|
7004
7026
|
n$6({ attribute: "loading", reflect: true, type: Boolean })
|
|
7005
7027
|
], CxContentBrowserControlSort.prototype, "loading", 2);
|
|
7006
|
-
__decorateClass$
|
|
7028
|
+
__decorateClass$e([
|
|
7007
7029
|
n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
|
|
7008
7030
|
], CxContentBrowserControlSort.prototype, "isMobile", 2);
|
|
7009
|
-
__decorateClass$
|
|
7031
|
+
__decorateClass$e([
|
|
7010
7032
|
n$6({ attribute: "newly-changed-option", reflect: false, type: Object })
|
|
7011
7033
|
], CxContentBrowserControlSort.prototype, "newlyChangedOption", 2);
|
|
7012
|
-
__decorateClass$
|
|
7034
|
+
__decorateClass$e([
|
|
7013
7035
|
r$6()
|
|
7014
7036
|
], CxContentBrowserControlSort.prototype, "mappedSortDirections", 2);
|
|
7015
|
-
__decorateClass$
|
|
7037
|
+
__decorateClass$e([
|
|
7016
7038
|
r$6()
|
|
7017
7039
|
], CxContentBrowserControlSort.prototype, "sortDirections", 2);
|
|
7018
|
-
__decorateClass$
|
|
7040
|
+
__decorateClass$e([
|
|
7019
7041
|
watch("sortOrderName"),
|
|
7020
7042
|
watch("sortDirection"),
|
|
7021
7043
|
watch("sortOrders", { waitUntilFirstUpdate: true }),
|
|
7022
7044
|
watch("sortDirections", { waitUntilFirstUpdate: true })
|
|
7023
7045
|
], CxContentBrowserControlSort.prototype, "handleSortDirectionsChange", 1);
|
|
7024
|
-
CxContentBrowserControlSort = __decorateClass$
|
|
7046
|
+
CxContentBrowserControlSort = __decorateClass$e([
|
|
7025
7047
|
customElement("cx-content-browser-control-sort")
|
|
7026
7048
|
], CxContentBrowserControlSort);
|
|
7027
|
-
const styles$
|
|
7049
|
+
const styles$c = i$7`
|
|
7028
7050
|
:host {
|
|
7029
7051
|
display: contents;
|
|
7030
7052
|
}
|
|
@@ -7034,14 +7056,14 @@ const styles$b = i$7`
|
|
|
7034
7056
|
--checked-icon-display: none;
|
|
7035
7057
|
}
|
|
7036
7058
|
`;
|
|
7037
|
-
var __defProp$
|
|
7038
|
-
var __getOwnPropDesc$
|
|
7039
|
-
var __decorateClass$
|
|
7040
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7059
|
+
var __defProp$d = Object.defineProperty;
|
|
7060
|
+
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
7061
|
+
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
7062
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
7041
7063
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
7042
7064
|
if (decorator = decorators[i4])
|
|
7043
7065
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7044
|
-
if (kind && result) __defProp$
|
|
7066
|
+
if (kind && result) __defProp$d(target, key, result);
|
|
7045
7067
|
return result;
|
|
7046
7068
|
};
|
|
7047
7069
|
let CxContentBrowserControlView = class extends CortexElement {
|
|
@@ -7052,6 +7074,10 @@ let CxContentBrowserControlView = class extends CortexElement {
|
|
|
7052
7074
|
this.views = [];
|
|
7053
7075
|
this.isSeeThrough = false;
|
|
7054
7076
|
this.isMobile = false;
|
|
7077
|
+
this.canUseTable = false;
|
|
7078
|
+
}
|
|
7079
|
+
get isTable() {
|
|
7080
|
+
return this.view === TABLE_VIEW;
|
|
7055
7081
|
}
|
|
7056
7082
|
runConnectedCallback() {
|
|
7057
7083
|
this.handleViewChange();
|
|
@@ -7071,6 +7097,21 @@ let CxContentBrowserControlView = class extends CortexElement {
|
|
|
7071
7097
|
}
|
|
7072
7098
|
});
|
|
7073
7099
|
}
|
|
7100
|
+
renderTableOption() {
|
|
7101
|
+
if (!this.canUseTable) {
|
|
7102
|
+
return A;
|
|
7103
|
+
}
|
|
7104
|
+
return b`
|
|
7105
|
+
<cx-menu-item
|
|
7106
|
+
value=${TABLE_VIEW}
|
|
7107
|
+
type="checkbox"
|
|
7108
|
+
?checked=${this.isTable}
|
|
7109
|
+
>
|
|
7110
|
+
<cx-line-clamp lines="1">${this.localize.term("table")}</cx-line-clamp>
|
|
7111
|
+
<cx-icon slot="prefix" name="table_rows"></cx-icon>
|
|
7112
|
+
</cx-menu-item>
|
|
7113
|
+
`;
|
|
7114
|
+
}
|
|
7074
7115
|
handleViewChange() {
|
|
7075
7116
|
this.selectedView = this.views.find((item) => item.value === this.view);
|
|
7076
7117
|
}
|
|
@@ -7088,7 +7129,7 @@ let CxContentBrowserControlView = class extends CortexElement {
|
|
|
7088
7129
|
<div slot="trigger">
|
|
7089
7130
|
<cx-tooltip content=${this.localize.term("view")}>
|
|
7090
7131
|
<cx-icon-button
|
|
7091
|
-
name
|
|
7132
|
+
name=${this.isTable ? "table_rows" : "dashboard"}
|
|
7092
7133
|
label=${this.localize.term("view")}
|
|
7093
7134
|
outline
|
|
7094
7135
|
></cx-icon-button>
|
|
@@ -7115,6 +7156,7 @@ let CxContentBrowserControlView = class extends CortexElement {
|
|
|
7115
7156
|
)}
|
|
7116
7157
|
<cx-icon slot="prefix" name="grid_view"></cx-icon>
|
|
7117
7158
|
</cx-menu-item>
|
|
7159
|
+
${this.renderTableOption()}
|
|
7118
7160
|
<cx-divider></cx-divider>
|
|
7119
7161
|
<cx-menu-item value="see-thru" class="menu-item--switch">
|
|
7120
7162
|
<cx-space direction="horizontal" justify-content="space-between">
|
|
@@ -7148,7 +7190,7 @@ let CxContentBrowserControlView = class extends CortexElement {
|
|
|
7148
7190
|
() => b`
|
|
7149
7191
|
<cx-menu key="default-menu" no-uncheck>
|
|
7150
7192
|
<cx-menu-label>${this.localize.term("view")}</cx-menu-label>
|
|
7151
|
-
<cx-menu-item type="checkbox">
|
|
7193
|
+
<cx-menu-item type="checkbox" ?checked=${!this.isTable}>
|
|
7152
7194
|
${this.localize.term("grid")}
|
|
7153
7195
|
${n$5(
|
|
7154
7196
|
this.selectedView,
|
|
@@ -7177,6 +7219,7 @@ let CxContentBrowserControlView = class extends CortexElement {
|
|
|
7177
7219
|
</cx-menu>
|
|
7178
7220
|
<cx-icon slot="prefix" name="grid_view"></cx-icon>
|
|
7179
7221
|
</cx-menu-item>
|
|
7222
|
+
${this.renderTableOption()}
|
|
7180
7223
|
<cx-divider></cx-divider>
|
|
7181
7224
|
<cx-menu-item value="see-thru" class="menu-item--switch">
|
|
7182
7225
|
<cx-space direction="horizontal" justify-content="space-between">
|
|
@@ -7194,7 +7237,7 @@ let CxContentBrowserControlView = class extends CortexElement {
|
|
|
7194
7237
|
`;
|
|
7195
7238
|
}
|
|
7196
7239
|
};
|
|
7197
|
-
CxContentBrowserControlView.styles = [componentStyles, styles$
|
|
7240
|
+
CxContentBrowserControlView.styles = [componentStyles, styles$c];
|
|
7198
7241
|
CxContentBrowserControlView.dependencies = {
|
|
7199
7242
|
"cx-divider": CxDivider,
|
|
7200
7243
|
"cx-dropdown": CxDropdown,
|
|
@@ -7208,28 +7251,31 @@ CxContentBrowserControlView.dependencies = {
|
|
|
7208
7251
|
"cx-switch": CxSwitch,
|
|
7209
7252
|
"cx-tooltip": CxTooltip
|
|
7210
7253
|
};
|
|
7211
|
-
__decorateClass$
|
|
7254
|
+
__decorateClass$d([
|
|
7212
7255
|
n$6({ attribute: "view", reflect: true, type: String })
|
|
7213
7256
|
], CxContentBrowserControlView.prototype, "view", 2);
|
|
7214
|
-
__decorateClass$
|
|
7257
|
+
__decorateClass$d([
|
|
7215
7258
|
n$6({ attribute: "views", reflect: false, type: Array })
|
|
7216
7259
|
], CxContentBrowserControlView.prototype, "views", 2);
|
|
7217
|
-
__decorateClass$
|
|
7260
|
+
__decorateClass$d([
|
|
7218
7261
|
n$6({ attribute: "is-see-through", reflect: true, type: Boolean })
|
|
7219
7262
|
], CxContentBrowserControlView.prototype, "isSeeThrough", 2);
|
|
7220
|
-
__decorateClass$
|
|
7263
|
+
__decorateClass$d([
|
|
7221
7264
|
n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
|
|
7222
7265
|
], CxContentBrowserControlView.prototype, "isMobile", 2);
|
|
7223
|
-
__decorateClass$
|
|
7266
|
+
__decorateClass$d([
|
|
7267
|
+
n$6({ attribute: "can-use-table", reflect: true, type: Boolean })
|
|
7268
|
+
], CxContentBrowserControlView.prototype, "canUseTable", 2);
|
|
7269
|
+
__decorateClass$d([
|
|
7224
7270
|
r$6()
|
|
7225
7271
|
], CxContentBrowserControlView.prototype, "selectedView", 2);
|
|
7226
|
-
__decorateClass$
|
|
7272
|
+
__decorateClass$d([
|
|
7227
7273
|
watch("view", { waitUntilFirstUpdate: true })
|
|
7228
7274
|
], CxContentBrowserControlView.prototype, "handleViewChange", 1);
|
|
7229
|
-
CxContentBrowserControlView = __decorateClass$
|
|
7275
|
+
CxContentBrowserControlView = __decorateClass$d([
|
|
7230
7276
|
customElement("cx-content-browser-control-view")
|
|
7231
7277
|
], CxContentBrowserControlView);
|
|
7232
|
-
const styles$
|
|
7278
|
+
const styles$b = i$7`
|
|
7233
7279
|
:host {
|
|
7234
7280
|
display: block;
|
|
7235
7281
|
}
|
|
@@ -7252,14 +7298,14 @@ const styles$a = i$7`
|
|
|
7252
7298
|
margin-left: auto;
|
|
7253
7299
|
}
|
|
7254
7300
|
`;
|
|
7255
|
-
var __defProp$
|
|
7256
|
-
var __getOwnPropDesc$
|
|
7257
|
-
var __decorateClass$
|
|
7258
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7301
|
+
var __defProp$c = Object.defineProperty;
|
|
7302
|
+
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
7303
|
+
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
7304
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
7259
7305
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
7260
7306
|
if (decorator = decorators[i4])
|
|
7261
7307
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7262
|
-
if (kind && result) __defProp$
|
|
7308
|
+
if (kind && result) __defProp$c(target, key, result);
|
|
7263
7309
|
return result;
|
|
7264
7310
|
};
|
|
7265
7311
|
let CxContentBrowserControlBar = class extends CortexElement {
|
|
@@ -7280,6 +7326,7 @@ let CxContentBrowserControlBar = class extends CortexElement {
|
|
|
7280
7326
|
this.loading = false;
|
|
7281
7327
|
this.searchText = "";
|
|
7282
7328
|
this.isMobile = false;
|
|
7329
|
+
this.canUseTable = false;
|
|
7283
7330
|
}
|
|
7284
7331
|
handleSearchChange(event) {
|
|
7285
7332
|
this.searchText = event.target.value;
|
|
@@ -7327,6 +7374,7 @@ let CxContentBrowserControlBar = class extends CortexElement {
|
|
|
7327
7374
|
<cx-content-browser-control-view
|
|
7328
7375
|
view=${this.view}
|
|
7329
7376
|
.views=${this.views}
|
|
7377
|
+
?can-use-table=${this.canUseTable}
|
|
7330
7378
|
?is-see-through=${this.isSeeThrough}
|
|
7331
7379
|
?is-mobile=${this.isMobile}
|
|
7332
7380
|
></cx-content-browser-control-view>
|
|
@@ -7343,7 +7391,7 @@ let CxContentBrowserControlBar = class extends CortexElement {
|
|
|
7343
7391
|
`;
|
|
7344
7392
|
}
|
|
7345
7393
|
};
|
|
7346
|
-
CxContentBrowserControlBar.styles = [componentStyles, styles$
|
|
7394
|
+
CxContentBrowserControlBar.styles = [componentStyles, styles$b];
|
|
7347
7395
|
CxContentBrowserControlBar.dependencies = {
|
|
7348
7396
|
"cx-avatar": CxAvatar,
|
|
7349
7397
|
"cx-content-browser-control-filter": CxContentBrowserControlFilter,
|
|
@@ -7355,52 +7403,55 @@ CxContentBrowserControlBar.dependencies = {
|
|
|
7355
7403
|
"cx-space": CxSpace,
|
|
7356
7404
|
"cx-typography": CxTypography
|
|
7357
7405
|
};
|
|
7358
|
-
__decorateClass$
|
|
7406
|
+
__decorateClass$c([
|
|
7359
7407
|
n$6({ attribute: "current-count", type: Number })
|
|
7360
7408
|
], CxContentBrowserControlBar.prototype, "currentCount", 2);
|
|
7361
|
-
__decorateClass$
|
|
7409
|
+
__decorateClass$c([
|
|
7362
7410
|
n$6({ attribute: "total-count", type: Number })
|
|
7363
7411
|
], CxContentBrowserControlBar.prototype, "totalCount", 2);
|
|
7364
|
-
__decorateClass$
|
|
7412
|
+
__decorateClass$c([
|
|
7365
7413
|
n$6({ attribute: "sort-order-name", reflect: true, type: String })
|
|
7366
7414
|
], CxContentBrowserControlBar.prototype, "sortOrderName", 2);
|
|
7367
|
-
__decorateClass$
|
|
7415
|
+
__decorateClass$c([
|
|
7368
7416
|
n$6({ attribute: "sort-direction", reflect: true, type: String })
|
|
7369
7417
|
], CxContentBrowserControlBar.prototype, "sortDirection", 2);
|
|
7370
|
-
__decorateClass$
|
|
7418
|
+
__decorateClass$c([
|
|
7371
7419
|
n$6({ attribute: "sort-orders", reflect: false, type: Array })
|
|
7372
7420
|
], CxContentBrowserControlBar.prototype, "sortOrders", 2);
|
|
7373
|
-
__decorateClass$
|
|
7421
|
+
__decorateClass$c([
|
|
7374
7422
|
n$6({ attribute: "view", reflect: true, type: String })
|
|
7375
7423
|
], CxContentBrowserControlBar.prototype, "view", 2);
|
|
7376
|
-
__decorateClass$
|
|
7424
|
+
__decorateClass$c([
|
|
7377
7425
|
n$6({ attribute: "views", reflect: false, type: Array })
|
|
7378
7426
|
], CxContentBrowserControlBar.prototype, "views", 2);
|
|
7379
|
-
__decorateClass$
|
|
7427
|
+
__decorateClass$c([
|
|
7380
7428
|
n$6({ attribute: "facets", reflect: false, type: Array })
|
|
7381
7429
|
], CxContentBrowserControlBar.prototype, "facets", 2);
|
|
7382
|
-
__decorateClass$
|
|
7430
|
+
__decorateClass$c([
|
|
7383
7431
|
n$6({ attribute: "available-facets", reflect: false, type: Array })
|
|
7384
7432
|
], CxContentBrowserControlBar.prototype, "availableFacets", 2);
|
|
7385
|
-
__decorateClass$
|
|
7433
|
+
__decorateClass$c([
|
|
7386
7434
|
n$6({ attribute: "selected-facets", reflect: false, type: Object })
|
|
7387
7435
|
], CxContentBrowserControlBar.prototype, "selectedFacets", 2);
|
|
7388
|
-
__decorateClass$
|
|
7436
|
+
__decorateClass$c([
|
|
7389
7437
|
n$6({ attribute: "is-see-through", reflect: true, type: Boolean })
|
|
7390
7438
|
], CxContentBrowserControlBar.prototype, "isSeeThrough", 2);
|
|
7391
|
-
__decorateClass$
|
|
7439
|
+
__decorateClass$c([
|
|
7392
7440
|
n$6({ attribute: "loading", reflect: true, type: Boolean })
|
|
7393
7441
|
], CxContentBrowserControlBar.prototype, "loading", 2);
|
|
7394
|
-
__decorateClass$
|
|
7442
|
+
__decorateClass$c([
|
|
7395
7443
|
n$6({ attribute: false, reflect: false, type: Object })
|
|
7396
7444
|
], CxContentBrowserControlBar.prototype, "newlyChangedOption", 2);
|
|
7397
|
-
__decorateClass$
|
|
7445
|
+
__decorateClass$c([
|
|
7398
7446
|
n$6({ attribute: "search-text", reflect: false, type: String })
|
|
7399
7447
|
], CxContentBrowserControlBar.prototype, "searchText", 2);
|
|
7400
|
-
__decorateClass$
|
|
7448
|
+
__decorateClass$c([
|
|
7401
7449
|
n$6({ attribute: "is-mobile", reflect: false, type: Boolean })
|
|
7402
7450
|
], CxContentBrowserControlBar.prototype, "isMobile", 2);
|
|
7403
|
-
|
|
7451
|
+
__decorateClass$c([
|
|
7452
|
+
n$6({ attribute: "can-use-table", reflect: true, type: Boolean })
|
|
7453
|
+
], CxContentBrowserControlBar.prototype, "canUseTable", 2);
|
|
7454
|
+
CxContentBrowserControlBar = __decorateClass$c([
|
|
7404
7455
|
customElement("cx-content-browser-control-bar")
|
|
7405
7456
|
], CxContentBrowserControlBar);
|
|
7406
7457
|
/**
|
|
@@ -7707,14 +7758,14 @@ var Orientation = /* @__PURE__ */ ((Orientation2) => {
|
|
|
7707
7758
|
Orientation2["Vertical"] = "vertical";
|
|
7708
7759
|
return Orientation2;
|
|
7709
7760
|
})(Orientation || {});
|
|
7710
|
-
var __defProp$
|
|
7711
|
-
var __getOwnPropDesc$
|
|
7712
|
-
var __decorateClass$
|
|
7713
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7761
|
+
var __defProp$b = Object.defineProperty;
|
|
7762
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
7763
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
7764
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
7714
7765
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
7715
7766
|
if (decorator = decorators[i4])
|
|
7716
7767
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7717
|
-
if (kind && result) __defProp$
|
|
7768
|
+
if (kind && result) __defProp$b(target, key, result);
|
|
7718
7769
|
return result;
|
|
7719
7770
|
};
|
|
7720
7771
|
let CxContentBrowserAssetPreviewVideo = class extends CortexElement {
|
|
@@ -7830,40 +7881,40 @@ CxContentBrowserAssetPreviewVideo.dependencies = {
|
|
|
7830
7881
|
"cx-typography": CxTypography,
|
|
7831
7882
|
"cx-video": CxVideo
|
|
7832
7883
|
};
|
|
7833
|
-
__decorateClass$
|
|
7884
|
+
__decorateClass$b([
|
|
7834
7885
|
e$7("cx-video")
|
|
7835
7886
|
], CxContentBrowserAssetPreviewVideo.prototype, "videoElement", 2);
|
|
7836
|
-
__decorateClass$
|
|
7887
|
+
__decorateClass$b([
|
|
7837
7888
|
e$7("img")
|
|
7838
7889
|
], CxContentBrowserAssetPreviewVideo.prototype, "imageElement", 2);
|
|
7839
|
-
__decorateClass$
|
|
7890
|
+
__decorateClass$b([
|
|
7840
7891
|
n$6({ attribute: "src", reflect: true, type: String })
|
|
7841
7892
|
], CxContentBrowserAssetPreviewVideo.prototype, "src", 2);
|
|
7842
|
-
__decorateClass$
|
|
7893
|
+
__decorateClass$b([
|
|
7843
7894
|
n$6({ attribute: "alt", reflect: true, type: String })
|
|
7844
7895
|
], CxContentBrowserAssetPreviewVideo.prototype, "alt", 2);
|
|
7845
|
-
__decorateClass$
|
|
7896
|
+
__decorateClass$b([
|
|
7846
7897
|
n$6({ attribute: "thumbnail-only", reflect: true, type: Boolean })
|
|
7847
7898
|
], CxContentBrowserAssetPreviewVideo.prototype, "thumbnailOnly", 2);
|
|
7848
|
-
__decorateClass$
|
|
7899
|
+
__decorateClass$b([
|
|
7849
7900
|
n$6({ attribute: "thumbnail-src", reflect: true, type: String })
|
|
7850
7901
|
], CxContentBrowserAssetPreviewVideo.prototype, "thumbnailSrc", 2);
|
|
7851
|
-
__decorateClass$
|
|
7902
|
+
__decorateClass$b([
|
|
7852
7903
|
n$6({ reflect: true, type: Boolean })
|
|
7853
7904
|
], CxContentBrowserAssetPreviewVideo.prototype, "controls", 2);
|
|
7854
|
-
__decorateClass$
|
|
7905
|
+
__decorateClass$b([
|
|
7855
7906
|
n$6({ attribute: "loaded", reflect: true, type: Boolean })
|
|
7856
7907
|
], CxContentBrowserAssetPreviewVideo.prototype, "loaded", 2);
|
|
7857
|
-
__decorateClass$
|
|
7908
|
+
__decorateClass$b([
|
|
7858
7909
|
r$6()
|
|
7859
7910
|
], CxContentBrowserAssetPreviewVideo.prototype, "assetDirection", 2);
|
|
7860
|
-
__decorateClass$
|
|
7911
|
+
__decorateClass$b([
|
|
7861
7912
|
r$6()
|
|
7862
7913
|
], CxContentBrowserAssetPreviewVideo.prototype, "progress", 2);
|
|
7863
|
-
CxContentBrowserAssetPreviewVideo = __decorateClass$
|
|
7914
|
+
CxContentBrowserAssetPreviewVideo = __decorateClass$b([
|
|
7864
7915
|
customElement("cx-content-browser-asset-preview-video")
|
|
7865
7916
|
], CxContentBrowserAssetPreviewVideo);
|
|
7866
|
-
const styles$
|
|
7917
|
+
const styles$a = i$7`
|
|
7867
7918
|
:host {
|
|
7868
7919
|
display: block;
|
|
7869
7920
|
position: relative;
|
|
@@ -8010,14 +8061,14 @@ const styles$9 = i$7`
|
|
|
8010
8061
|
transition: none;
|
|
8011
8062
|
}
|
|
8012
8063
|
`;
|
|
8013
|
-
var __defProp$
|
|
8014
|
-
var __getOwnPropDesc$
|
|
8015
|
-
var __decorateClass$
|
|
8016
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8064
|
+
var __defProp$a = Object.defineProperty;
|
|
8065
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
8066
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
8067
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
8017
8068
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
8018
8069
|
if (decorator = decorators[i4])
|
|
8019
8070
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8020
|
-
if (kind && result) __defProp$
|
|
8071
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
8021
8072
|
return result;
|
|
8022
8073
|
};
|
|
8023
8074
|
const GIF_EXTENSION = ".gif";
|
|
@@ -8182,53 +8233,53 @@ let CxContentBrowserAssetPreview = class extends CortexElement {
|
|
|
8182
8233
|
`;
|
|
8183
8234
|
}
|
|
8184
8235
|
};
|
|
8185
|
-
CxContentBrowserAssetPreview.styles = [componentStyles, styles$
|
|
8236
|
+
CxContentBrowserAssetPreview.styles = [componentStyles, styles$a];
|
|
8186
8237
|
CxContentBrowserAssetPreview.dependencies = {
|
|
8187
8238
|
"cx-content-browser-asset-preview-video": CxContentBrowserAssetPreviewVideo,
|
|
8188
8239
|
"cx-icon": CxIcon,
|
|
8189
8240
|
"cx-skeleton": CxSkeleton,
|
|
8190
8241
|
"cx-typography": CxTypography
|
|
8191
8242
|
};
|
|
8192
|
-
__decorateClass$
|
|
8243
|
+
__decorateClass$a([
|
|
8193
8244
|
e$7("cx-content-browser-asset-preview-video")
|
|
8194
8245
|
], CxContentBrowserAssetPreview.prototype, "previewVideo", 2);
|
|
8195
|
-
__decorateClass$
|
|
8246
|
+
__decorateClass$a([
|
|
8196
8247
|
n$6({ attribute: "image-url", reflect: true, type: String })
|
|
8197
8248
|
], CxContentBrowserAssetPreview.prototype, "imageUrl", 2);
|
|
8198
|
-
__decorateClass$
|
|
8249
|
+
__decorateClass$a([
|
|
8199
8250
|
n$6({ attribute: "original-url", reflect: true, type: String })
|
|
8200
8251
|
], CxContentBrowserAssetPreview.prototype, "originalUrl", 2);
|
|
8201
|
-
__decorateClass$
|
|
8252
|
+
__decorateClass$a([
|
|
8202
8253
|
n$6({ attribute: "preview-url", reflect: true, type: String })
|
|
8203
8254
|
], CxContentBrowserAssetPreview.prototype, "previewUrl", 2);
|
|
8204
|
-
__decorateClass$
|
|
8255
|
+
__decorateClass$a([
|
|
8205
8256
|
n$6({ attribute: "alt", reflect: true, type: String })
|
|
8206
8257
|
], CxContentBrowserAssetPreview.prototype, "alt", 2);
|
|
8207
|
-
__decorateClass$
|
|
8258
|
+
__decorateClass$a([
|
|
8208
8259
|
n$6({ attribute: "doc-type", reflect: true, type: String })
|
|
8209
8260
|
], CxContentBrowserAssetPreview.prototype, "docType", 2);
|
|
8210
|
-
__decorateClass$
|
|
8261
|
+
__decorateClass$a([
|
|
8211
8262
|
n$6({ attribute: "extension", reflect: true, type: String })
|
|
8212
8263
|
], CxContentBrowserAssetPreview.prototype, "extension", 2);
|
|
8213
|
-
__decorateClass$
|
|
8264
|
+
__decorateClass$a([
|
|
8214
8265
|
n$6({ attribute: "in-cold-storage", reflect: true, type: Boolean })
|
|
8215
8266
|
], CxContentBrowserAssetPreview.prototype, "inColdStorage", 2);
|
|
8216
|
-
__decorateClass$
|
|
8267
|
+
__decorateClass$a([
|
|
8217
8268
|
n$6({ attribute: "thumbnail-only", reflect: true, type: Boolean })
|
|
8218
8269
|
], CxContentBrowserAssetPreview.prototype, "thumbnailOnly", 2);
|
|
8219
|
-
__decorateClass$
|
|
8270
|
+
__decorateClass$a([
|
|
8220
8271
|
n$6({ attribute: "controls", reflect: true, type: Boolean })
|
|
8221
8272
|
], CxContentBrowserAssetPreview.prototype, "controls", 2);
|
|
8222
|
-
__decorateClass$
|
|
8273
|
+
__decorateClass$a([
|
|
8223
8274
|
r$6()
|
|
8224
8275
|
], CxContentBrowserAssetPreview.prototype, "isError", 2);
|
|
8225
|
-
__decorateClass$
|
|
8276
|
+
__decorateClass$a([
|
|
8226
8277
|
r$6()
|
|
8227
8278
|
], CxContentBrowserAssetPreview.prototype, "loaded", 2);
|
|
8228
|
-
CxContentBrowserAssetPreview = __decorateClass$
|
|
8279
|
+
CxContentBrowserAssetPreview = __decorateClass$a([
|
|
8229
8280
|
customElement("cx-content-browser-asset-preview")
|
|
8230
8281
|
], CxContentBrowserAssetPreview);
|
|
8231
|
-
const styles$
|
|
8282
|
+
const styles$9 = i$7`
|
|
8232
8283
|
:host {
|
|
8233
8284
|
display: block;
|
|
8234
8285
|
padding: var(--cx-spacing-small);
|
|
@@ -8238,14 +8289,14 @@ const styles$8 = i$7`
|
|
|
8238
8289
|
width: 100%;
|
|
8239
8290
|
}
|
|
8240
8291
|
`;
|
|
8241
|
-
var __defProp$
|
|
8242
|
-
var __getOwnPropDesc$
|
|
8243
|
-
var __decorateClass$
|
|
8244
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8292
|
+
var __defProp$9 = Object.defineProperty;
|
|
8293
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
8294
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
8295
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
8245
8296
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
8246
8297
|
if (decorator = decorators[i4])
|
|
8247
8298
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8248
|
-
if (kind && result) __defProp$
|
|
8299
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
8249
8300
|
return result;
|
|
8250
8301
|
};
|
|
8251
8302
|
let CxContentBrowserAssetTrackingParameters = class extends CortexElement {
|
|
@@ -8354,7 +8405,7 @@ let CxContentBrowserAssetTrackingParameters = class extends CortexElement {
|
|
|
8354
8405
|
`;
|
|
8355
8406
|
}
|
|
8356
8407
|
};
|
|
8357
|
-
CxContentBrowserAssetTrackingParameters.styles = [componentStyles, styles$
|
|
8408
|
+
CxContentBrowserAssetTrackingParameters.styles = [componentStyles, styles$9];
|
|
8358
8409
|
CxContentBrowserAssetTrackingParameters.dependencies = {
|
|
8359
8410
|
"cx-button": CxButton,
|
|
8360
8411
|
"cx-icon": CxIcon,
|
|
@@ -8363,13 +8414,13 @@ CxContentBrowserAssetTrackingParameters.dependencies = {
|
|
|
8363
8414
|
"cx-input-group": CxInputGroup,
|
|
8364
8415
|
"cx-space": CxSpace
|
|
8365
8416
|
};
|
|
8366
|
-
__decorateClass$
|
|
8417
|
+
__decorateClass$9([
|
|
8367
8418
|
n$6({ attribute: false, type: Array })
|
|
8368
8419
|
], CxContentBrowserAssetTrackingParameters.prototype, "values", 2);
|
|
8369
|
-
CxContentBrowserAssetTrackingParameters = __decorateClass$
|
|
8420
|
+
CxContentBrowserAssetTrackingParameters = __decorateClass$9([
|
|
8370
8421
|
customElement("cx-content-browser-asset-tracking-parameters")
|
|
8371
8422
|
], CxContentBrowserAssetTrackingParameters);
|
|
8372
|
-
const styles$
|
|
8423
|
+
const styles$8 = i$7`
|
|
8373
8424
|
:host {
|
|
8374
8425
|
display: block;
|
|
8375
8426
|
}
|
|
@@ -8478,14 +8529,14 @@ const styles$7 = i$7`
|
|
|
8478
8529
|
color: var(--cx-color-primary);
|
|
8479
8530
|
}
|
|
8480
8531
|
`;
|
|
8481
|
-
var __defProp$
|
|
8482
|
-
var __getOwnPropDesc$
|
|
8483
|
-
var __decorateClass$
|
|
8484
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8532
|
+
var __defProp$8 = Object.defineProperty;
|
|
8533
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
8534
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
8535
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
8485
8536
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
8486
8537
|
if (decorator = decorators[i4])
|
|
8487
8538
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8488
|
-
if (kind && result) __defProp$
|
|
8539
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
8489
8540
|
return result;
|
|
8490
8541
|
};
|
|
8491
8542
|
const USE_REPRESENTATIVE_VALUE = "use-representative";
|
|
@@ -8735,7 +8786,7 @@ let CxContentBrowserAssetProxySelector = class extends CortexElement {
|
|
|
8735
8786
|
`;
|
|
8736
8787
|
}
|
|
8737
8788
|
};
|
|
8738
|
-
CxContentBrowserAssetProxySelector.styles = [componentStyles, styles$
|
|
8789
|
+
CxContentBrowserAssetProxySelector.styles = [componentStyles, styles$8];
|
|
8739
8790
|
CxContentBrowserAssetProxySelector.dependencies = {
|
|
8740
8791
|
"cx-content-browser-asset-tracking-parameters": CxContentBrowserAssetTrackingParameters,
|
|
8741
8792
|
"cx-icon": CxIcon,
|
|
@@ -8745,46 +8796,46 @@ CxContentBrowserAssetProxySelector.dependencies = {
|
|
|
8745
8796
|
"cx-switch": CxSwitch,
|
|
8746
8797
|
"cx-typography": CxTypography
|
|
8747
8798
|
};
|
|
8748
|
-
__decorateClass$
|
|
8799
|
+
__decorateClass$8([
|
|
8749
8800
|
n$6({ reflect: false, type: Array })
|
|
8750
8801
|
], CxContentBrowserAssetProxySelector.prototype, "items", 2);
|
|
8751
|
-
__decorateClass$
|
|
8802
|
+
__decorateClass$8([
|
|
8752
8803
|
n$6({ attribute: "can-custom-format", reflect: true, type: Boolean })
|
|
8753
8804
|
], CxContentBrowserAssetProxySelector.prototype, "canCustomFormat", 2);
|
|
8754
|
-
__decorateClass$
|
|
8805
|
+
__decorateClass$8([
|
|
8755
8806
|
n$6({ attribute: "can-use-representative", reflect: true, type: Boolean })
|
|
8756
8807
|
], CxContentBrowserAssetProxySelector.prototype, "canUseRepresentative", 2);
|
|
8757
|
-
__decorateClass$
|
|
8808
|
+
__decorateClass$8([
|
|
8758
8809
|
n$6({ attribute: "can-use-ats", reflect: true, type: Boolean })
|
|
8759
8810
|
], CxContentBrowserAssetProxySelector.prototype, "canUseATS", 2);
|
|
8760
|
-
__decorateClass$
|
|
8811
|
+
__decorateClass$8([
|
|
8761
8812
|
n$6({ attribute: "can-use-tracking", reflect: true, type: Boolean })
|
|
8762
8813
|
], CxContentBrowserAssetProxySelector.prototype, "canUseTracking", 2);
|
|
8763
|
-
__decorateClass$
|
|
8814
|
+
__decorateClass$8([
|
|
8764
8815
|
n$6({ attribute: "selected", reflect: true, type: String })
|
|
8765
8816
|
], CxContentBrowserAssetProxySelector.prototype, "selected", 2);
|
|
8766
|
-
__decorateClass$
|
|
8817
|
+
__decorateClass$8([
|
|
8767
8818
|
n$6({ attribute: "disabled-selected", reflect: true, type: Boolean })
|
|
8768
8819
|
], CxContentBrowserAssetProxySelector.prototype, "disabledSelected", 2);
|
|
8769
|
-
__decorateClass$
|
|
8820
|
+
__decorateClass$8([
|
|
8770
8821
|
n$6({ attribute: "custom-width", reflect: true, type: String })
|
|
8771
8822
|
], CxContentBrowserAssetProxySelector.prototype, "customWidth", 2);
|
|
8772
|
-
__decorateClass$
|
|
8823
|
+
__decorateClass$8([
|
|
8773
8824
|
n$6({ attribute: "custom-height", reflect: true, type: String })
|
|
8774
8825
|
], CxContentBrowserAssetProxySelector.prototype, "customHeight", 2);
|
|
8775
|
-
__decorateClass$
|
|
8826
|
+
__decorateClass$8([
|
|
8776
8827
|
n$6({ attribute: "custom-extension", reflect: true, type: String })
|
|
8777
8828
|
], CxContentBrowserAssetProxySelector.prototype, "customExtension", 2);
|
|
8778
|
-
__decorateClass$
|
|
8829
|
+
__decorateClass$8([
|
|
8779
8830
|
n$6({ attribute: "enabled-tracking", reflect: true, type: Boolean })
|
|
8780
8831
|
], CxContentBrowserAssetProxySelector.prototype, "enabledTracking", 2);
|
|
8781
|
-
__decorateClass$
|
|
8832
|
+
__decorateClass$8([
|
|
8782
8833
|
n$6({ attribute: "tracking-parameters", reflect: false, type: Array })
|
|
8783
8834
|
], CxContentBrowserAssetProxySelector.prototype, "trackingParameters", 2);
|
|
8784
|
-
CxContentBrowserAssetProxySelector = __decorateClass$
|
|
8835
|
+
CxContentBrowserAssetProxySelector = __decorateClass$8([
|
|
8785
8836
|
customElement("cx-content-browser-asset-proxy-selector")
|
|
8786
8837
|
], CxContentBrowserAssetProxySelector);
|
|
8787
|
-
const styles$
|
|
8838
|
+
const styles$7 = i$7`
|
|
8788
8839
|
:host {
|
|
8789
8840
|
display: block;
|
|
8790
8841
|
width: 100%;
|
|
@@ -8857,14 +8908,14 @@ const styles$6 = i$7`
|
|
|
8857
8908
|
font-size: var(--cx-font-size-3x-large);
|
|
8858
8909
|
}
|
|
8859
8910
|
`;
|
|
8860
|
-
var __defProp$
|
|
8861
|
-
var __getOwnPropDesc$
|
|
8862
|
-
var __decorateClass$
|
|
8863
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8911
|
+
var __defProp$7 = Object.defineProperty;
|
|
8912
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
8913
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
8914
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
8864
8915
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
8865
8916
|
if (decorator = decorators[i4])
|
|
8866
8917
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8867
|
-
if (kind && result) __defProp$
|
|
8918
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
8868
8919
|
return result;
|
|
8869
8920
|
};
|
|
8870
8921
|
let CxContentBrowserAssetVersionHistory = class extends CortexElement {
|
|
@@ -8936,7 +8987,7 @@ let CxContentBrowserAssetVersionHistory = class extends CortexElement {
|
|
|
8936
8987
|
`;
|
|
8937
8988
|
}
|
|
8938
8989
|
};
|
|
8939
|
-
CxContentBrowserAssetVersionHistory.styles = [componentStyles, styles$
|
|
8990
|
+
CxContentBrowserAssetVersionHistory.styles = [componentStyles, styles$7];
|
|
8940
8991
|
CxContentBrowserAssetVersionHistory.dependencies = {
|
|
8941
8992
|
"cx-grid": CxGrid,
|
|
8942
8993
|
"cx-grid-item": CxGridItem,
|
|
@@ -8948,13 +8999,13 @@ CxContentBrowserAssetVersionHistory.dependencies = {
|
|
|
8948
8999
|
"cx-typography": CxTypography,
|
|
8949
9000
|
"cx-content-browser-asset-preview": CxContentBrowserAssetPreview
|
|
8950
9001
|
};
|
|
8951
|
-
__decorateClass$
|
|
9002
|
+
__decorateClass$7([
|
|
8952
9003
|
n$6({ reflect: false, type: Array })
|
|
8953
9004
|
], CxContentBrowserAssetVersionHistory.prototype, "versions", 2);
|
|
8954
|
-
__decorateClass$
|
|
9005
|
+
__decorateClass$7([
|
|
8955
9006
|
n$6({ reflect: true, type: Boolean })
|
|
8956
9007
|
], CxContentBrowserAssetVersionHistory.prototype, "loading", 2);
|
|
8957
|
-
CxContentBrowserAssetVersionHistory = __decorateClass$
|
|
9008
|
+
CxContentBrowserAssetVersionHistory = __decorateClass$7([
|
|
8958
9009
|
customElement("cx-content-browser-asset-version-history")
|
|
8959
9010
|
], CxContentBrowserAssetVersionHistory);
|
|
8960
9011
|
const dialogStyles = i$7`
|
|
@@ -9005,7 +9056,7 @@ const drawerStyles = i$7`
|
|
|
9005
9056
|
padding: var(--cx-spacing-medium);
|
|
9006
9057
|
}
|
|
9007
9058
|
`;
|
|
9008
|
-
const styles$
|
|
9059
|
+
const styles$6 = i$7`
|
|
9009
9060
|
:host {
|
|
9010
9061
|
display: block;
|
|
9011
9062
|
}
|
|
@@ -9045,14 +9096,14 @@ const styles$5 = i$7`
|
|
|
9045
9096
|
width: 100%;
|
|
9046
9097
|
}
|
|
9047
9098
|
`;
|
|
9048
|
-
var __defProp$
|
|
9049
|
-
var __getOwnPropDesc$
|
|
9050
|
-
var __decorateClass$
|
|
9051
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9099
|
+
var __defProp$6 = Object.defineProperty;
|
|
9100
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
9101
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
9102
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
9052
9103
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
9053
9104
|
if (decorator = decorators[i4])
|
|
9054
9105
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9055
|
-
if (kind && result) __defProp$
|
|
9106
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
9056
9107
|
return result;
|
|
9057
9108
|
};
|
|
9058
9109
|
const DEFAULT_TRACKING_PARAMETERS = [{
|
|
@@ -9094,6 +9145,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9094
9145
|
this.canPinAsset = false;
|
|
9095
9146
|
this.canTrack = false;
|
|
9096
9147
|
this.canUseProxies = false;
|
|
9148
|
+
this.autoSelectFormat = false;
|
|
9097
9149
|
this.simplePick = false;
|
|
9098
9150
|
this.canViewVersions = false;
|
|
9099
9151
|
this.variant = ContentBrowserFormatDialogVariant.Dialog;
|
|
@@ -9134,33 +9186,96 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9134
9186
|
], "value") : [{ displayName: this.localize.term("automatic"), value: this.autoExtension }]).filter((item) => this.shouldAppendAutoExtension || item.value !== this.autoExtension);
|
|
9135
9187
|
return this.canCustomFormat && extensionList.some((item) => item.value === this.asset.extension);
|
|
9136
9188
|
}
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
const assetExtension = (_c2 = (_b3 = (_a3 = this.asset) == null ? void 0 : _a3.extension) == null ? void 0 : _b3.replace(/^\./, "")) != null ? _c2 : "";
|
|
9189
|
+
filterProxies(proxies) {
|
|
9190
|
+
return proxies.filter((item) => {
|
|
9191
|
+
var _a2, _b2, _c2;
|
|
9192
|
+
const assetExtension = (_c2 = (_b2 = (_a2 = this.asset) == null ? void 0 : _a2.extension) == null ? void 0 : _b2.replace(/^\./, "")) != null ? _c2 : "";
|
|
9142
9193
|
if (!item.extension && this.asset && assetExtension) {
|
|
9143
9194
|
return this.supportedExtensions.includes(assetExtension);
|
|
9144
9195
|
}
|
|
9145
9196
|
return true;
|
|
9146
9197
|
});
|
|
9198
|
+
}
|
|
9199
|
+
handleSupportedExtensionsChange() {
|
|
9200
|
+
var _a2, _b2;
|
|
9201
|
+
this.filteredProxies = this.filterProxies(this.proxies);
|
|
9147
9202
|
this.selectedProxy = (_b2 = (_a2 = this.filteredProxies[0]) == null ? void 0 : _a2.id) != null ? _b2 : "";
|
|
9148
9203
|
}
|
|
9204
|
+
/**
|
|
9205
|
+
* What `autoSelectFormat` resolves to for this asset: the proxy to insert with, or `undefined`
|
|
9206
|
+
* when the dialog should open as usual.
|
|
9207
|
+
*
|
|
9208
|
+
* `{ proxy: undefined }` is deliberate rather than a miss — with the picker switched off there is
|
|
9209
|
+
* no format to name and the original file is the only outcome, which is `handleProxyConfirm`'s
|
|
9210
|
+
* no-proxy branch. With the picker on a proxy must actually resolve: confirming none emits
|
|
9211
|
+
* nothing and would turn the click into a silent no-op, so both an empty proxy list and a format
|
|
9212
|
+
* name that matches nothing fall back to the dialog.
|
|
9213
|
+
*/
|
|
9214
|
+
resolveAutoSelection() {
|
|
9215
|
+
const requested = this.autoSelectFormat;
|
|
9216
|
+
if (!isAutoSelectFormatActive(requested)) {
|
|
9217
|
+
return void 0;
|
|
9218
|
+
}
|
|
9219
|
+
if (!this.canUseProxies) {
|
|
9220
|
+
return { proxy: void 0 };
|
|
9221
|
+
}
|
|
9222
|
+
if (requested === true) {
|
|
9223
|
+
const [first] = this.filteredProxies;
|
|
9224
|
+
return first ? { proxy: first } : void 0;
|
|
9225
|
+
}
|
|
9226
|
+
const wanted = String(requested).trim().toLowerCase();
|
|
9227
|
+
const match = this.filteredProxies.find((proxy) => {
|
|
9228
|
+
var _a2, _b2;
|
|
9229
|
+
return ((_a2 = proxy.proxyName) == null ? void 0 : _a2.toLowerCase()) === wanted || ((_b2 = proxy.proxyLabel) == null ? void 0 : _b2.toLowerCase()) === wanted;
|
|
9230
|
+
});
|
|
9231
|
+
return match ? { proxy: match } : void 0;
|
|
9232
|
+
}
|
|
9149
9233
|
open({
|
|
9150
9234
|
asset,
|
|
9151
9235
|
isFavorite,
|
|
9152
9236
|
isAssetPinned = false,
|
|
9153
9237
|
proxies
|
|
9154
9238
|
}) {
|
|
9239
|
+
var _a2, _b2;
|
|
9155
9240
|
this.asset = asset;
|
|
9156
9241
|
this.isFavorite = isFavorite;
|
|
9157
9242
|
this.isAssetPinned = isAssetPinned;
|
|
9158
9243
|
this.proxies = proxies;
|
|
9244
|
+
this.filteredProxies = this.filterProxies(this.proxies);
|
|
9245
|
+
this.selectedProxy = (_b2 = (_a2 = this.filteredProxies[0]) == null ? void 0 : _a2.id) != null ? _b2 : "";
|
|
9246
|
+
const autoSelection = this.disabledConfirm ? void 0 : this.resolveAutoSelection();
|
|
9247
|
+
if (autoSelection) {
|
|
9248
|
+
if (autoSelection.proxy) {
|
|
9249
|
+
this.selectedProxy = autoSelection.proxy.id;
|
|
9250
|
+
}
|
|
9251
|
+
if (!this.loadingConfirm) {
|
|
9252
|
+
this.handleProxyConfirm();
|
|
9253
|
+
}
|
|
9254
|
+
return;
|
|
9255
|
+
}
|
|
9256
|
+
this.loadingConfirm = false;
|
|
9159
9257
|
this.isOpen = true;
|
|
9160
9258
|
}
|
|
9161
9259
|
hide() {
|
|
9162
9260
|
this.handleClose();
|
|
9163
9261
|
}
|
|
9262
|
+
/**
|
|
9263
|
+
* Show a dialog that `open()` skipped through the auto-confirm shortcut. The asset, proxies and
|
|
9264
|
+
* resolved selection are still in place, so this lands the user on exactly the dialog the
|
|
9265
|
+
* shortcut spared them, with its confirm button live again to retry.
|
|
9266
|
+
*/
|
|
9267
|
+
revealAfterAutoConfirm() {
|
|
9268
|
+
if (!this.asset) {
|
|
9269
|
+
this.handleClose();
|
|
9270
|
+
return;
|
|
9271
|
+
}
|
|
9272
|
+
this.loadingConfirm = false;
|
|
9273
|
+
this.isOpen = true;
|
|
9274
|
+
}
|
|
9275
|
+
/** Whether the dialog is actually on screen — false when `open()` took the auto-confirm path. */
|
|
9276
|
+
get isDialogOpen() {
|
|
9277
|
+
return this.isOpen;
|
|
9278
|
+
}
|
|
9164
9279
|
setVersionHistory(versions) {
|
|
9165
9280
|
this.versions = versions;
|
|
9166
9281
|
this.loadingVersionHistory = false;
|
|
@@ -9644,7 +9759,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9644
9759
|
<cx-button
|
|
9645
9760
|
class="content-browser-format__footer__button"
|
|
9646
9761
|
variant="primary"
|
|
9647
|
-
?loading=${this.loadingProxies}
|
|
9762
|
+
?loading=${this.loadingConfirm || this.loadingProxies}
|
|
9648
9763
|
@click=${this.handleProxyConfirm}
|
|
9649
9764
|
>
|
|
9650
9765
|
<cx-icon slot="prefix" name="folder"></cx-icon>
|
|
@@ -9709,7 +9824,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9709
9824
|
`;
|
|
9710
9825
|
}
|
|
9711
9826
|
handleRequestClose(event) {
|
|
9712
|
-
if (this.loadingFavorites || this.loadingPinAsset) {
|
|
9827
|
+
if (this.loadingConfirm || this.loadingFavorites || this.loadingPinAsset) {
|
|
9713
9828
|
event.preventDefault();
|
|
9714
9829
|
return;
|
|
9715
9830
|
}
|
|
@@ -9770,7 +9885,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9770
9885
|
`;
|
|
9771
9886
|
}
|
|
9772
9887
|
};
|
|
9773
|
-
CxContentBrowserFormatDialog.styles = [componentStyles, styles$
|
|
9888
|
+
CxContentBrowserFormatDialog.styles = [componentStyles, styles$6];
|
|
9774
9889
|
CxContentBrowserFormatDialog.dependencies = {
|
|
9775
9890
|
"cx-asset-link-format": CxAssetLinkFormat,
|
|
9776
9891
|
"cx-cropper": CxCropper,
|
|
@@ -9786,16 +9901,16 @@ CxContentBrowserFormatDialog.dependencies = {
|
|
|
9786
9901
|
"cx-tooltip": CxTooltip,
|
|
9787
9902
|
"cx-typography": CxTypography
|
|
9788
9903
|
};
|
|
9789
|
-
__decorateClass$
|
|
9904
|
+
__decorateClass$6([
|
|
9790
9905
|
e$7("cx-asset-link-format")
|
|
9791
9906
|
], CxContentBrowserFormatDialog.prototype, "assetLinkFormat", 2);
|
|
9792
|
-
__decorateClass$
|
|
9907
|
+
__decorateClass$6([
|
|
9793
9908
|
n$6({ reflect: false, type: Object })
|
|
9794
9909
|
], CxContentBrowserFormatDialog.prototype, "boundary", 2);
|
|
9795
|
-
__decorateClass$
|
|
9910
|
+
__decorateClass$6([
|
|
9796
9911
|
n$6({ attribute: false, reflect: false, type: Object })
|
|
9797
9912
|
], CxContentBrowserFormatDialog.prototype, "availableExtensions", 2);
|
|
9798
|
-
__decorateClass$
|
|
9913
|
+
__decorateClass$6([
|
|
9799
9914
|
n$6({
|
|
9800
9915
|
attribute: "supported-extensions",
|
|
9801
9916
|
converter: {
|
|
@@ -9806,7 +9921,7 @@ __decorateClass$5([
|
|
|
9806
9921
|
type: Array
|
|
9807
9922
|
})
|
|
9808
9923
|
], CxContentBrowserFormatDialog.prototype, "supportedExtensions", 2);
|
|
9809
|
-
__decorateClass$
|
|
9924
|
+
__decorateClass$6([
|
|
9810
9925
|
n$6({
|
|
9811
9926
|
attribute: "supported-representative-subtypes",
|
|
9812
9927
|
converter: {
|
|
@@ -9817,113 +9932,116 @@ __decorateClass$5([
|
|
|
9817
9932
|
type: Array
|
|
9818
9933
|
})
|
|
9819
9934
|
], CxContentBrowserFormatDialog.prototype, "supportedRepresentativeSubtypes", 2);
|
|
9820
|
-
__decorateClass$
|
|
9935
|
+
__decorateClass$6([
|
|
9821
9936
|
n$6({ attribute: "auto-extension", reflect: false, type: String })
|
|
9822
9937
|
], CxContentBrowserFormatDialog.prototype, "autoExtension", 2);
|
|
9823
|
-
__decorateClass$
|
|
9938
|
+
__decorateClass$6([
|
|
9824
9939
|
n$6({ attribute: "cta-text", reflect: false, type: String })
|
|
9825
9940
|
], CxContentBrowserFormatDialog.prototype, "ctaText", 2);
|
|
9826
|
-
__decorateClass$
|
|
9941
|
+
__decorateClass$6([
|
|
9827
9942
|
n$6({ attribute: "cta-text-transform", reflect: false, type: String })
|
|
9828
9943
|
], CxContentBrowserFormatDialog.prototype, "ctaTextTransform", 2);
|
|
9829
|
-
__decorateClass$
|
|
9944
|
+
__decorateClass$6([
|
|
9830
9945
|
n$6({ attribute: "can-custom-format", reflect: false, type: Boolean })
|
|
9831
9946
|
], CxContentBrowserFormatDialog.prototype, "canCustomFormat", 2);
|
|
9832
|
-
__decorateClass$
|
|
9947
|
+
__decorateClass$6([
|
|
9833
9948
|
n$6({ attribute: "can-favorite", reflect: false, type: Boolean })
|
|
9834
9949
|
], CxContentBrowserFormatDialog.prototype, "canFavorite", 2);
|
|
9835
|
-
__decorateClass$
|
|
9950
|
+
__decorateClass$6([
|
|
9836
9951
|
n$6({ attribute: "can-pin-asset", reflect: false, type: Boolean })
|
|
9837
9952
|
], CxContentBrowserFormatDialog.prototype, "canPinAsset", 2);
|
|
9838
|
-
__decorateClass$
|
|
9953
|
+
__decorateClass$6([
|
|
9839
9954
|
n$6({ attribute: "can-track", reflect: false, type: Boolean })
|
|
9840
9955
|
], CxContentBrowserFormatDialog.prototype, "canTrack", 2);
|
|
9841
|
-
__decorateClass$
|
|
9956
|
+
__decorateClass$6([
|
|
9842
9957
|
n$6({ attribute: "can-use-proxies", reflect: false, type: Boolean })
|
|
9843
9958
|
], CxContentBrowserFormatDialog.prototype, "canUseProxies", 2);
|
|
9844
|
-
__decorateClass$
|
|
9959
|
+
__decorateClass$6([
|
|
9960
|
+
n$6({ attribute: "auto-select-format", converter: autoSelectFormatConverter, reflect: false })
|
|
9961
|
+
], CxContentBrowserFormatDialog.prototype, "autoSelectFormat", 2);
|
|
9962
|
+
__decorateClass$6([
|
|
9845
9963
|
n$6({ attribute: "simple-pick", reflect: false, type: Boolean })
|
|
9846
9964
|
], CxContentBrowserFormatDialog.prototype, "simplePick", 2);
|
|
9847
|
-
__decorateClass$
|
|
9965
|
+
__decorateClass$6([
|
|
9848
9966
|
n$6({ attribute: "can-view-versions", reflect: false, type: Boolean })
|
|
9849
9967
|
], CxContentBrowserFormatDialog.prototype, "canViewVersions", 2);
|
|
9850
|
-
__decorateClass$
|
|
9968
|
+
__decorateClass$6([
|
|
9851
9969
|
n$6({ reflect: true, type: String })
|
|
9852
9970
|
], CxContentBrowserFormatDialog.prototype, "variant", 2);
|
|
9853
|
-
__decorateClass$
|
|
9971
|
+
__decorateClass$6([
|
|
9854
9972
|
n$6({ attribute: "loading-favorites", reflect: true, type: Boolean })
|
|
9855
9973
|
], CxContentBrowserFormatDialog.prototype, "loadingFavorites", 2);
|
|
9856
|
-
__decorateClass$
|
|
9974
|
+
__decorateClass$6([
|
|
9857
9975
|
n$6({ attribute: "loading-pin-asset", reflect: true, type: Boolean })
|
|
9858
9976
|
], CxContentBrowserFormatDialog.prototype, "loadingPinAsset", 2);
|
|
9859
|
-
__decorateClass$
|
|
9977
|
+
__decorateClass$6([
|
|
9860
9978
|
n$6({ attribute: "loading-proxies", reflect: true, type: Boolean })
|
|
9861
9979
|
], CxContentBrowserFormatDialog.prototype, "loadingProxies", 2);
|
|
9862
|
-
__decorateClass$
|
|
9980
|
+
__decorateClass$6([
|
|
9863
9981
|
n$6({ attribute: "disabled-confirm", reflect: true, type: Boolean })
|
|
9864
9982
|
], CxContentBrowserFormatDialog.prototype, "disabledConfirm", 2);
|
|
9865
|
-
__decorateClass$
|
|
9983
|
+
__decorateClass$6([
|
|
9866
9984
|
n$6({ attribute: "token", type: String })
|
|
9867
9985
|
], CxContentBrowserFormatDialog.prototype, "token", 2);
|
|
9868
|
-
__decorateClass$
|
|
9986
|
+
__decorateClass$6([
|
|
9869
9987
|
n$6({ attribute: "base-url", type: String })
|
|
9870
9988
|
], CxContentBrowserFormatDialog.prototype, "baseUrl", 2);
|
|
9871
|
-
__decorateClass$
|
|
9989
|
+
__decorateClass$6([
|
|
9872
9990
|
r$6()
|
|
9873
9991
|
], CxContentBrowserFormatDialog.prototype, "asset", 2);
|
|
9874
|
-
__decorateClass$
|
|
9992
|
+
__decorateClass$6([
|
|
9875
9993
|
r$6()
|
|
9876
9994
|
], CxContentBrowserFormatDialog.prototype, "isOpen", 2);
|
|
9877
|
-
__decorateClass$
|
|
9995
|
+
__decorateClass$6([
|
|
9878
9996
|
r$6()
|
|
9879
9997
|
], CxContentBrowserFormatDialog.prototype, "isFavorite", 2);
|
|
9880
|
-
__decorateClass$
|
|
9998
|
+
__decorateClass$6([
|
|
9881
9999
|
r$6()
|
|
9882
10000
|
], CxContentBrowserFormatDialog.prototype, "isAssetPinned", 2);
|
|
9883
|
-
__decorateClass$
|
|
10001
|
+
__decorateClass$6([
|
|
9884
10002
|
r$6()
|
|
9885
10003
|
], CxContentBrowserFormatDialog.prototype, "proxies", 2);
|
|
9886
|
-
__decorateClass$
|
|
10004
|
+
__decorateClass$6([
|
|
9887
10005
|
r$6()
|
|
9888
10006
|
], CxContentBrowserFormatDialog.prototype, "showVersionHistory", 2);
|
|
9889
|
-
__decorateClass$
|
|
10007
|
+
__decorateClass$6([
|
|
9890
10008
|
r$6()
|
|
9891
10009
|
], CxContentBrowserFormatDialog.prototype, "showCustomFormat", 2);
|
|
9892
|
-
__decorateClass$
|
|
10010
|
+
__decorateClass$6([
|
|
9893
10011
|
r$6()
|
|
9894
10012
|
], CxContentBrowserFormatDialog.prototype, "loadingVersionHistory", 2);
|
|
9895
|
-
__decorateClass$
|
|
10013
|
+
__decorateClass$6([
|
|
9896
10014
|
r$6()
|
|
9897
10015
|
], CxContentBrowserFormatDialog.prototype, "versions", 2);
|
|
9898
|
-
__decorateClass$
|
|
10016
|
+
__decorateClass$6([
|
|
9899
10017
|
r$6()
|
|
9900
10018
|
], CxContentBrowserFormatDialog.prototype, "filteredProxies", 2);
|
|
9901
|
-
__decorateClass$
|
|
10019
|
+
__decorateClass$6([
|
|
9902
10020
|
r$6()
|
|
9903
10021
|
], CxContentBrowserFormatDialog.prototype, "selectedProxy", 2);
|
|
9904
|
-
__decorateClass$
|
|
10022
|
+
__decorateClass$6([
|
|
9905
10023
|
r$6()
|
|
9906
10024
|
], CxContentBrowserFormatDialog.prototype, "lastProxyBeforeCustomFormat", 2);
|
|
9907
|
-
__decorateClass$
|
|
10025
|
+
__decorateClass$6([
|
|
9908
10026
|
r$6()
|
|
9909
10027
|
], CxContentBrowserFormatDialog.prototype, "confirmedTransformations", 2);
|
|
9910
|
-
__decorateClass$
|
|
10028
|
+
__decorateClass$6([
|
|
9911
10029
|
r$6()
|
|
9912
10030
|
], CxContentBrowserFormatDialog.prototype, "confirmedFormat", 2);
|
|
9913
|
-
__decorateClass$
|
|
10031
|
+
__decorateClass$6([
|
|
9914
10032
|
r$6()
|
|
9915
10033
|
], CxContentBrowserFormatDialog.prototype, "loadingConfirm", 2);
|
|
9916
|
-
__decorateClass$
|
|
10034
|
+
__decorateClass$6([
|
|
9917
10035
|
r$6()
|
|
9918
10036
|
], CxContentBrowserFormatDialog.prototype, "enabledTracking", 2);
|
|
9919
|
-
__decorateClass$
|
|
10037
|
+
__decorateClass$6([
|
|
9920
10038
|
r$6()
|
|
9921
10039
|
], CxContentBrowserFormatDialog.prototype, "trackingParameters", 2);
|
|
9922
|
-
__decorateClass$
|
|
10040
|
+
__decorateClass$6([
|
|
9923
10041
|
watch("proxies", { waitUntilFirstUpdate: true }),
|
|
9924
10042
|
watch("supportedExtensions")
|
|
9925
10043
|
], CxContentBrowserFormatDialog.prototype, "handleSupportedExtensionsChange", 1);
|
|
9926
|
-
CxContentBrowserFormatDialog = __decorateClass$
|
|
10044
|
+
CxContentBrowserFormatDialog = __decorateClass$6([
|
|
9927
10045
|
customElement("cx-content-browser-format-dialog")
|
|
9928
10046
|
], CxContentBrowserFormatDialog);
|
|
9929
10047
|
function __decorate(decorators, target, key, desc) {
|
|
@@ -11722,7 +11840,7 @@ class GridLayout extends GridBaseLayout {
|
|
|
11722
11840
|
this._scrollSize = size;
|
|
11723
11841
|
}
|
|
11724
11842
|
}
|
|
11725
|
-
const styles$
|
|
11843
|
+
const styles$5 = i$7`
|
|
11726
11844
|
:host {
|
|
11727
11845
|
display: block;
|
|
11728
11846
|
}
|
|
@@ -11758,6 +11876,44 @@ const styles$4 = i$7`
|
|
|
11758
11876
|
line-height: var(--cx-line-height-small);
|
|
11759
11877
|
}
|
|
11760
11878
|
|
|
11879
|
+
/*
|
|
11880
|
+
* Affordance only, never a second control: pointer-events stay off so the click lands on the card
|
|
11881
|
+
* beneath and takes the one path a card click already takes, and the button is aria-hidden and
|
|
11882
|
+
* untabbable so the card is still the single thing announced and focused.
|
|
11883
|
+
*/
|
|
11884
|
+
.content-browser-asset-card__cta {
|
|
11885
|
+
/*
|
|
11886
|
+
* Positioned against the card's base, not the image slot, so the image box has to be described
|
|
11887
|
+
* here: inset by the card's own padding and given the same aspect-ratio ::part(image) carries,
|
|
11888
|
+
* which lands it exactly on the thumbnail. Without this it covers the title row too and centres
|
|
11889
|
+
* the button on the card rather than on the image. Keep the ratio in step with ::part(image).
|
|
11890
|
+
*/
|
|
11891
|
+
position: absolute;
|
|
11892
|
+
inset: var(--cx-spacing-x-small);
|
|
11893
|
+
bottom: auto;
|
|
11894
|
+
aspect-ratio: 246 / 180;
|
|
11895
|
+
z-index: 1;
|
|
11896
|
+
display: flex;
|
|
11897
|
+
align-items: center;
|
|
11898
|
+
justify-content: center;
|
|
11899
|
+
background-color: rgb(0 0 0 / 35%);
|
|
11900
|
+
opacity: 0;
|
|
11901
|
+
pointer-events: none;
|
|
11902
|
+
transition: opacity 150ms ease;
|
|
11903
|
+
}
|
|
11904
|
+
|
|
11905
|
+
.content-browser-asset-card:hover .content-browser-asset-card__cta,
|
|
11906
|
+
.content-browser-asset-card:focus-within .content-browser-asset-card__cta,
|
|
11907
|
+
.content-browser-asset-card__cta--busy {
|
|
11908
|
+
opacity: 1;
|
|
11909
|
+
}
|
|
11910
|
+
|
|
11911
|
+
@media (prefers-reduced-motion: reduce) {
|
|
11912
|
+
.content-browser-asset-card__cta {
|
|
11913
|
+
transition: none;
|
|
11914
|
+
}
|
|
11915
|
+
}
|
|
11916
|
+
|
|
11761
11917
|
.content-browser-asset-card__checkbox {
|
|
11762
11918
|
position: absolute;
|
|
11763
11919
|
top: 2px;
|
|
@@ -11770,19 +11926,24 @@ const styles$4 = i$7`
|
|
|
11770
11926
|
pointer-events: none;
|
|
11771
11927
|
}
|
|
11772
11928
|
`;
|
|
11773
|
-
var __defProp$
|
|
11774
|
-
var __getOwnPropDesc$
|
|
11775
|
-
var __decorateClass$
|
|
11776
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
11777
|
-
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
11778
|
-
if (decorator = decorators[i4])
|
|
11929
|
+
var __defProp$5 = Object.defineProperty;
|
|
11930
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
11931
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
11932
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
11933
|
+
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
11934
|
+
if (decorator = decorators[i4])
|
|
11779
11935
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11780
|
-
if (kind && result) __defProp$
|
|
11936
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
11781
11937
|
return result;
|
|
11782
11938
|
};
|
|
11783
11939
|
let CxContentBrowserAssetCard = class extends CortexElement {
|
|
11784
11940
|
constructor() {
|
|
11785
11941
|
super(...arguments);
|
|
11942
|
+
this.localize = new LocalizeController(this);
|
|
11943
|
+
this.showCta = false;
|
|
11944
|
+
this.ctaText = "";
|
|
11945
|
+
this.ctaTextTransform = "capitalize";
|
|
11946
|
+
this.busy = false;
|
|
11786
11947
|
this.imageUrl = "";
|
|
11787
11948
|
this.originalUrl = "";
|
|
11788
11949
|
this.scrubUrl = "";
|
|
@@ -11850,6 +12011,26 @@ let CxContentBrowserAssetCard = class extends CortexElement {
|
|
|
11850
12011
|
?thumbnail-only=${this.view === "small"}
|
|
11851
12012
|
?in-cold-storage=${this.inColdStorage}
|
|
11852
12013
|
></cx-content-browser-asset-preview>
|
|
12014
|
+
${n$5(
|
|
12015
|
+
this.showCta && !this.inColdStorage,
|
|
12016
|
+
() => b`
|
|
12017
|
+
<div
|
|
12018
|
+
slot="image"
|
|
12019
|
+
class=${e$5({
|
|
12020
|
+
"content-browser-asset-card__cta": true,
|
|
12021
|
+
"content-browser-asset-card__cta--busy": this.busy
|
|
12022
|
+
})}
|
|
12023
|
+
aria-hidden="true"
|
|
12024
|
+
>
|
|
12025
|
+
<cx-button size="small" variant="primary" tabindex="-1" ?loading=${this.busy}>
|
|
12026
|
+
<span style=${o$1({ textTransform: this.ctaTextTransform })}>
|
|
12027
|
+
${this.ctaText || this.localize.term("insert")}
|
|
12028
|
+
</span>
|
|
12029
|
+
</cx-button>
|
|
12030
|
+
</div>
|
|
12031
|
+
`,
|
|
12032
|
+
() => A
|
|
12033
|
+
)}
|
|
11853
12034
|
<cx-space spacing="small" align-items="center" wrap="nowrap" class="content-browser-asset-card__info">
|
|
11854
12035
|
${n$5(
|
|
11855
12036
|
this.showTitle && this.assetName,
|
|
@@ -11960,9 +12141,10 @@ let CxContentBrowserAssetCard = class extends CortexElement {
|
|
|
11960
12141
|
`;
|
|
11961
12142
|
}
|
|
11962
12143
|
};
|
|
11963
|
-
CxContentBrowserAssetCard.styles = [componentStyles, styles$
|
|
12144
|
+
CxContentBrowserAssetCard.styles = [componentStyles, styles$5];
|
|
11964
12145
|
CxContentBrowserAssetCard.dependencies = {
|
|
11965
12146
|
"cx-array-line-clamp": CxArrayLineClamp,
|
|
12147
|
+
"cx-button": CxButton,
|
|
11966
12148
|
"cx-card": CxCard,
|
|
11967
12149
|
"cx-checkbox": CxCheckbox,
|
|
11968
12150
|
"cx-content-browser-asset-preview": CxContentBrowserAssetPreview,
|
|
@@ -11971,46 +12153,58 @@ CxContentBrowserAssetCard.dependencies = {
|
|
|
11971
12153
|
"cx-tag": CxTag,
|
|
11972
12154
|
"cx-typography": CxTypography
|
|
11973
12155
|
};
|
|
11974
|
-
__decorateClass$
|
|
12156
|
+
__decorateClass$5([
|
|
12157
|
+
n$6({ attribute: "show-cta", reflect: true, type: Boolean })
|
|
12158
|
+
], CxContentBrowserAssetCard.prototype, "showCta", 2);
|
|
12159
|
+
__decorateClass$5([
|
|
12160
|
+
n$6({ attribute: "cta-text", reflect: false, type: String })
|
|
12161
|
+
], CxContentBrowserAssetCard.prototype, "ctaText", 2);
|
|
12162
|
+
__decorateClass$5([
|
|
12163
|
+
n$6({ attribute: "cta-text-transform", reflect: false, type: String })
|
|
12164
|
+
], CxContentBrowserAssetCard.prototype, "ctaTextTransform", 2);
|
|
12165
|
+
__decorateClass$5([
|
|
12166
|
+
n$6({ attribute: "busy", reflect: true, type: Boolean })
|
|
12167
|
+
], CxContentBrowserAssetCard.prototype, "busy", 2);
|
|
12168
|
+
__decorateClass$5([
|
|
11975
12169
|
n$6({ attribute: "image-url", reflect: true, type: String })
|
|
11976
12170
|
], CxContentBrowserAssetCard.prototype, "imageUrl", 2);
|
|
11977
|
-
__decorateClass$
|
|
12171
|
+
__decorateClass$5([
|
|
11978
12172
|
n$6({ attribute: "original-url", reflect: true, type: String })
|
|
11979
12173
|
], CxContentBrowserAssetCard.prototype, "originalUrl", 2);
|
|
11980
|
-
__decorateClass$
|
|
12174
|
+
__decorateClass$5([
|
|
11981
12175
|
n$6({ attribute: "scrub-url", reflect: true, type: String })
|
|
11982
12176
|
], CxContentBrowserAssetCard.prototype, "scrubUrl", 2);
|
|
11983
|
-
__decorateClass$
|
|
12177
|
+
__decorateClass$5([
|
|
11984
12178
|
n$6({ attribute: "asset-id", reflect: true, type: String })
|
|
11985
12179
|
], CxContentBrowserAssetCard.prototype, "assetId", 2);
|
|
11986
|
-
__decorateClass$
|
|
12180
|
+
__decorateClass$5([
|
|
11987
12181
|
n$6({ attribute: "asset-name", reflect: true, type: String })
|
|
11988
12182
|
], CxContentBrowserAssetCard.prototype, "assetName", 2);
|
|
11989
|
-
__decorateClass$
|
|
12183
|
+
__decorateClass$5([
|
|
11990
12184
|
n$6({ attribute: "asset-width", reflect: true, type: String })
|
|
11991
12185
|
], CxContentBrowserAssetCard.prototype, "assetWidth", 2);
|
|
11992
|
-
__decorateClass$
|
|
12186
|
+
__decorateClass$5([
|
|
11993
12187
|
n$6({ attribute: "asset-height", reflect: true, type: String })
|
|
11994
12188
|
], CxContentBrowserAssetCard.prototype, "assetHeight", 2);
|
|
11995
|
-
__decorateClass$
|
|
12189
|
+
__decorateClass$5([
|
|
11996
12190
|
n$6({ attribute: "asset-size", reflect: true, type: String })
|
|
11997
12191
|
], CxContentBrowserAssetCard.prototype, "assetSize", 2);
|
|
11998
|
-
__decorateClass$
|
|
12192
|
+
__decorateClass$5([
|
|
11999
12193
|
n$6({ attribute: "extension", reflect: true, type: String })
|
|
12000
12194
|
], CxContentBrowserAssetCard.prototype, "extension", 2);
|
|
12001
|
-
__decorateClass$
|
|
12195
|
+
__decorateClass$5([
|
|
12002
12196
|
n$6({ attribute: "in-cold-storage", reflect: true, type: Boolean })
|
|
12003
12197
|
], CxContentBrowserAssetCard.prototype, "inColdStorage", 2);
|
|
12004
|
-
__decorateClass$
|
|
12198
|
+
__decorateClass$5([
|
|
12005
12199
|
n$6({ attribute: "doc-type", reflect: true, type: String })
|
|
12006
12200
|
], CxContentBrowserAssetCard.prototype, "docType", 2);
|
|
12007
|
-
__decorateClass$
|
|
12201
|
+
__decorateClass$5([
|
|
12008
12202
|
n$6({ attribute: "view", reflect: true, type: String })
|
|
12009
12203
|
], CxContentBrowserAssetCard.prototype, "view", 2);
|
|
12010
|
-
__decorateClass$
|
|
12204
|
+
__decorateClass$5([
|
|
12011
12205
|
n$6({ attribute: "selected", reflect: true, type: Boolean })
|
|
12012
12206
|
], CxContentBrowserAssetCard.prototype, "selected", 2);
|
|
12013
|
-
__decorateClass$
|
|
12207
|
+
__decorateClass$5([
|
|
12014
12208
|
n$6({
|
|
12015
12209
|
converter: {
|
|
12016
12210
|
fromAttribute: (value) => value ? value.split(",").map((tag) => tag.trim()).filter(Boolean) : [],
|
|
@@ -12025,25 +12219,25 @@ __decorateClass$4([
|
|
|
12025
12219
|
type: String
|
|
12026
12220
|
})
|
|
12027
12221
|
], CxContentBrowserAssetCard.prototype, "tags", 2);
|
|
12028
|
-
__decorateClass$
|
|
12222
|
+
__decorateClass$5([
|
|
12029
12223
|
n$6({ attribute: "show-tags", reflect: true, type: Boolean })
|
|
12030
12224
|
], CxContentBrowserAssetCard.prototype, "showTags", 2);
|
|
12031
|
-
__decorateClass$
|
|
12225
|
+
__decorateClass$5([
|
|
12032
12226
|
n$6({ attribute: "show-title", reflect: true, type: Boolean })
|
|
12033
12227
|
], CxContentBrowserAssetCard.prototype, "showTitle", 2);
|
|
12034
|
-
__decorateClass$
|
|
12228
|
+
__decorateClass$5([
|
|
12035
12229
|
n$6({ attribute: "show-size", reflect: true, type: Boolean })
|
|
12036
12230
|
], CxContentBrowserAssetCard.prototype, "showSize", 2);
|
|
12037
|
-
__decorateClass$
|
|
12231
|
+
__decorateClass$5([
|
|
12038
12232
|
n$6({ attribute: "show-dimensions", reflect: true, type: Boolean })
|
|
12039
12233
|
], CxContentBrowserAssetCard.prototype, "showDimensions", 2);
|
|
12040
|
-
__decorateClass$
|
|
12234
|
+
__decorateClass$5([
|
|
12041
12235
|
e$7("cx-content-browser-asset-preview")
|
|
12042
12236
|
], CxContentBrowserAssetCard.prototype, "preview", 2);
|
|
12043
|
-
CxContentBrowserAssetCard = __decorateClass$
|
|
12237
|
+
CxContentBrowserAssetCard = __decorateClass$5([
|
|
12044
12238
|
customElement("cx-content-browser-asset-card")
|
|
12045
12239
|
], CxContentBrowserAssetCard);
|
|
12046
|
-
const styles$
|
|
12240
|
+
const styles$4 = i$7`
|
|
12047
12241
|
:host {
|
|
12048
12242
|
display: flex;
|
|
12049
12243
|
align-items: center;
|
|
@@ -12068,14 +12262,14 @@ const styles$3 = i$7`
|
|
|
12068
12262
|
font-size: 96px;
|
|
12069
12263
|
}
|
|
12070
12264
|
`;
|
|
12071
|
-
var __defProp$
|
|
12072
|
-
var __getOwnPropDesc$
|
|
12073
|
-
var __decorateClass$
|
|
12074
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
12265
|
+
var __defProp$4 = Object.defineProperty;
|
|
12266
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
12267
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
12268
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
12075
12269
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
12076
12270
|
if (decorator = decorators[i4])
|
|
12077
12271
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12078
|
-
if (kind && result) __defProp$
|
|
12272
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
12079
12273
|
return result;
|
|
12080
12274
|
};
|
|
12081
12275
|
let CxContentBrowserNoResult = class extends CortexElement {
|
|
@@ -12093,36 +12287,40 @@ let CxContentBrowserNoResult = class extends CortexElement {
|
|
|
12093
12287
|
`;
|
|
12094
12288
|
}
|
|
12095
12289
|
};
|
|
12096
|
-
CxContentBrowserNoResult.styles = [componentStyles, styles$
|
|
12290
|
+
CxContentBrowserNoResult.styles = [componentStyles, styles$4];
|
|
12097
12291
|
CxContentBrowserNoResult.dependencies = {
|
|
12098
12292
|
"cx-icon": CxIcon
|
|
12099
12293
|
};
|
|
12100
|
-
__decorateClass$
|
|
12294
|
+
__decorateClass$4([
|
|
12101
12295
|
n$6({ attribute: "icon", type: String })
|
|
12102
12296
|
], CxContentBrowserNoResult.prototype, "icon", 2);
|
|
12103
|
-
__decorateClass$
|
|
12297
|
+
__decorateClass$4([
|
|
12104
12298
|
n$6({ attribute: "message", type: String })
|
|
12105
12299
|
], CxContentBrowserNoResult.prototype, "message", 2);
|
|
12106
|
-
CxContentBrowserNoResult = __decorateClass$
|
|
12300
|
+
CxContentBrowserNoResult = __decorateClass$4([
|
|
12107
12301
|
customElement("cx-content-browser-no-result")
|
|
12108
12302
|
], CxContentBrowserNoResult);
|
|
12109
12303
|
class ScrollAnchorController {
|
|
12110
12304
|
constructor(host, options) {
|
|
12111
12305
|
__privateAdd(this, _host);
|
|
12112
12306
|
__privateAdd(this, _getContainer);
|
|
12307
|
+
__privateAdd(this, _getContentOffset);
|
|
12113
12308
|
__privateAdd(this, _getItemIndexById);
|
|
12309
|
+
__privateAdd(this, _getLayoutSource);
|
|
12114
12310
|
__privateAdd(this, _itemSelector);
|
|
12115
12311
|
__privateAdd(this, _anchor, null);
|
|
12116
12312
|
__privateAdd(this, _columnCount, 0);
|
|
12117
12313
|
__privateAdd(this, _itemHeight, 0);
|
|
12118
12314
|
__privateAdd(this, _pendingRestoreFrames, []);
|
|
12119
12315
|
__privateAdd(this, _restoreSequence, 0);
|
|
12120
|
-
var _a2;
|
|
12316
|
+
var _a2, _b2, _c2;
|
|
12121
12317
|
__privateSet(this, _host, host);
|
|
12122
12318
|
__privateSet(this, _getContainer, options.getContainer);
|
|
12319
|
+
__privateSet(this, _getContentOffset, (_a2 = options.getContentOffset) != null ? _a2 : (() => 0));
|
|
12123
12320
|
__privateSet(this, _getItemIndexById, options.getItemIndexById);
|
|
12321
|
+
__privateSet(this, _getLayoutSource, (_b2 = options.getLayoutSource) != null ? _b2 : options.getContainer);
|
|
12124
12322
|
__privateSet(this, _itemSelector, options.itemSelector);
|
|
12125
|
-
(
|
|
12323
|
+
(_c2 = host.addController) == null ? void 0 : _c2.call(host, this);
|
|
12126
12324
|
}
|
|
12127
12325
|
capture(container = __privateGet(this, _getContainer).call(this)) {
|
|
12128
12326
|
if (!container || typeof container.querySelectorAll !== "function") {
|
|
@@ -12132,10 +12330,11 @@ class ScrollAnchorController {
|
|
|
12132
12330
|
container.querySelectorAll(__privateGet(this, _itemSelector))
|
|
12133
12331
|
);
|
|
12134
12332
|
const containerTop = container.getBoundingClientRect().top;
|
|
12333
|
+
const contentTop = containerTop + __privateGet(this, _getContentOffset).call(this);
|
|
12135
12334
|
for (const el of children) {
|
|
12136
12335
|
const rect = el.getBoundingClientRect();
|
|
12137
12336
|
const id = el.assetId || el.dataset.id;
|
|
12138
|
-
if (rect.bottom >
|
|
12337
|
+
if (rect.bottom > contentTop && id) {
|
|
12139
12338
|
__privateSet(this, _anchor, {
|
|
12140
12339
|
id,
|
|
12141
12340
|
offset: rect.top - containerTop
|
|
@@ -12155,8 +12354,8 @@ class ScrollAnchorController {
|
|
|
12155
12354
|
this.cancelPendingRestore();
|
|
12156
12355
|
const sequence = ++__privateWrapper(this, _restoreSequence)._;
|
|
12157
12356
|
void __privateGet(this, _host).updateComplete.then(() => __async(this, null, function* () {
|
|
12158
|
-
var _a2;
|
|
12159
|
-
yield (_a2 = __privateGet(this,
|
|
12357
|
+
var _a2, _b2;
|
|
12358
|
+
yield (_b2 = (_a2 = __privateGet(this, _getLayoutSource).call(this)) == null ? void 0 : _a2.layoutComplete) == null ? void 0 : _b2.catch(() => void 0);
|
|
12160
12359
|
if (sequence !== __privateGet(this, _restoreSequence)) {
|
|
12161
12360
|
return;
|
|
12162
12361
|
}
|
|
@@ -12204,7 +12403,10 @@ class ScrollAnchorController {
|
|
|
12204
12403
|
return void 0;
|
|
12205
12404
|
}
|
|
12206
12405
|
const rowIndex = Math.floor(assetIndex / __privateGet(this, _columnCount));
|
|
12207
|
-
return Math.max(
|
|
12406
|
+
return Math.max(
|
|
12407
|
+
0,
|
|
12408
|
+
__privateGet(this, _getContentOffset).call(this) + rowIndex * __privateGet(this, _itemHeight) - __privateGet(this, _anchor).offset
|
|
12409
|
+
);
|
|
12208
12410
|
}
|
|
12209
12411
|
hostDisconnected() {
|
|
12210
12412
|
this.cancelPendingRestore();
|
|
@@ -12226,14 +12428,16 @@ class ScrollAnchorController {
|
|
|
12226
12428
|
}
|
|
12227
12429
|
_host = new WeakMap();
|
|
12228
12430
|
_getContainer = new WeakMap();
|
|
12431
|
+
_getContentOffset = new WeakMap();
|
|
12229
12432
|
_getItemIndexById = new WeakMap();
|
|
12433
|
+
_getLayoutSource = new WeakMap();
|
|
12230
12434
|
_itemSelector = new WeakMap();
|
|
12231
12435
|
_anchor = new WeakMap();
|
|
12232
12436
|
_columnCount = new WeakMap();
|
|
12233
12437
|
_itemHeight = new WeakMap();
|
|
12234
12438
|
_pendingRestoreFrames = new WeakMap();
|
|
12235
12439
|
_restoreSequence = new WeakMap();
|
|
12236
|
-
const styles$
|
|
12440
|
+
const styles$3 = i$7`
|
|
12237
12441
|
:host {
|
|
12238
12442
|
display: block;
|
|
12239
12443
|
flex: 1;
|
|
@@ -12254,24 +12458,24 @@ const styles$2 = i$7`
|
|
|
12254
12458
|
--height: 4px;
|
|
12255
12459
|
}
|
|
12256
12460
|
`;
|
|
12257
|
-
var __defProp$
|
|
12258
|
-
var __getOwnPropDesc$
|
|
12259
|
-
var
|
|
12461
|
+
var __defProp$3 = Object.defineProperty;
|
|
12462
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
12463
|
+
var __typeError$2 = (msg) => {
|
|
12260
12464
|
throw TypeError(msg);
|
|
12261
12465
|
};
|
|
12262
|
-
var __decorateClass$
|
|
12263
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
12466
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
12467
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
12264
12468
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
12265
12469
|
if (decorator = decorators[i4])
|
|
12266
12470
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12267
|
-
if (kind && result) __defProp$
|
|
12471
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
12268
12472
|
return result;
|
|
12269
12473
|
};
|
|
12270
|
-
var
|
|
12271
|
-
var
|
|
12272
|
-
var
|
|
12273
|
-
var
|
|
12274
|
-
var _gutter, _lastHeight, _lastWidth;
|
|
12474
|
+
var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
|
|
12475
|
+
var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
12476
|
+
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12477
|
+
var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), member.set(obj, value), value);
|
|
12478
|
+
var _gutter, _lastHeight$1, _lastWidth;
|
|
12275
12479
|
let CxContentBrowserGrid = class extends CortexElement {
|
|
12276
12480
|
constructor() {
|
|
12277
12481
|
super();
|
|
@@ -12285,12 +12489,16 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12285
12489
|
this.showSize = true;
|
|
12286
12490
|
this.showDimensions = true;
|
|
12287
12491
|
this.showTags = false;
|
|
12492
|
+
this.showCta = false;
|
|
12493
|
+
this.ctaText = "";
|
|
12494
|
+
this.ctaTextTransform = "capitalize";
|
|
12495
|
+
this.busyAssetId = void 0;
|
|
12288
12496
|
this.selectedAssetId = void 0;
|
|
12289
12497
|
this.assetMap = /* @__PURE__ */ new Map();
|
|
12290
12498
|
this.columnWidth = 0;
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12499
|
+
__privateAdd$2(this, _gutter, 8);
|
|
12500
|
+
__privateAdd$2(this, _lastHeight$1, 0);
|
|
12501
|
+
__privateAdd$2(this, _lastWidth, 0);
|
|
12294
12502
|
this.scrollAnchorController = new ScrollAnchorController(this, {
|
|
12295
12503
|
getContainer: () => this.virtualizerEl,
|
|
12296
12504
|
getItemIndexById: (id) => this.assets.findIndex((asset) => asset.id === id),
|
|
@@ -12303,7 +12511,7 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12303
12511
|
}
|
|
12304
12512
|
handleViewChange() {
|
|
12305
12513
|
this.scrollAnchorController.capture();
|
|
12306
|
-
this.calculatePageSize(
|
|
12514
|
+
this.calculatePageSize(__privateGet$2(this, _lastWidth), __privateGet$2(this, _lastHeight$1), true);
|
|
12307
12515
|
}
|
|
12308
12516
|
handleAssetsChange() {
|
|
12309
12517
|
this.assetMap.clear();
|
|
@@ -12321,17 +12529,17 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12321
12529
|
this.debouncedCalculatePageSize(width, height);
|
|
12322
12530
|
}
|
|
12323
12531
|
calculatePageSize(width, height, force = false) {
|
|
12324
|
-
const lastHeight =
|
|
12325
|
-
const lastWidth =
|
|
12532
|
+
const lastHeight = __privateGet$2(this, _lastHeight$1);
|
|
12533
|
+
const lastWidth = __privateGet$2(this, _lastWidth);
|
|
12326
12534
|
if (!force && Math.abs(lastHeight - height) < 10 && Math.abs(lastWidth - width) < 10) {
|
|
12327
12535
|
return;
|
|
12328
12536
|
}
|
|
12329
|
-
|
|
12330
|
-
|
|
12537
|
+
__privateSet$2(this, _lastHeight$1, height);
|
|
12538
|
+
__privateSet$2(this, _lastWidth, width);
|
|
12331
12539
|
const { columnCount, rowCount } = this.calculateColumnCount(width, height);
|
|
12332
12540
|
this.scrollAnchorController.setLayoutMetrics({
|
|
12333
12541
|
columnCount,
|
|
12334
|
-
itemHeight: Math.max(this.columnWidth, 150) +
|
|
12542
|
+
itemHeight: Math.max(this.columnWidth, 150) + __privateGet$2(this, _gutter)
|
|
12335
12543
|
});
|
|
12336
12544
|
this.emit("cx-content-browser-grid-resize", {
|
|
12337
12545
|
detail: {
|
|
@@ -12351,12 +12559,12 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12351
12559
|
}
|
|
12352
12560
|
const effectiveWidth = ((_a2 = this.virtualizerEl) == null ? void 0 : _a2.clientWidth) || width;
|
|
12353
12561
|
const breakPoint = ((_b2 = ASSET_SIZE[this.view]) == null ? void 0 : _b2.minWidth) || ASSET_SIZE[GridView.Large].minWidth;
|
|
12354
|
-
const columnCount = Math.max(1, Math.floor((effectiveWidth +
|
|
12562
|
+
const columnCount = Math.max(1, Math.floor((effectiveWidth + __privateGet$2(this, _gutter)) / (breakPoint + __privateGet$2(this, _gutter))));
|
|
12355
12563
|
let rowCount = 0;
|
|
12356
12564
|
if (height) {
|
|
12357
|
-
rowCount = Math.ceil(height / (breakPoint +
|
|
12565
|
+
rowCount = Math.ceil(height / (breakPoint + __privateGet$2(this, _gutter)));
|
|
12358
12566
|
}
|
|
12359
|
-
const newColumnWidth = Math.floor((effectiveWidth -
|
|
12567
|
+
const newColumnWidth = Math.floor((effectiveWidth - __privateGet$2(this, _gutter) * (columnCount + 1)) / columnCount);
|
|
12360
12568
|
if (newColumnWidth !== this.columnWidth) {
|
|
12361
12569
|
this.columnWidth = newColumnWidth;
|
|
12362
12570
|
}
|
|
@@ -12400,6 +12608,10 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12400
12608
|
?show-size=${this.showSize}
|
|
12401
12609
|
?show-dimensions=${this.showDimensions}
|
|
12402
12610
|
?show-tags=${this.showTags}
|
|
12611
|
+
?show-cta=${this.showCta}
|
|
12612
|
+
?busy=${asset.id === this.busyAssetId}
|
|
12613
|
+
cta-text=${this.ctaText}
|
|
12614
|
+
cta-text-transform=${this.ctaTextTransform}
|
|
12403
12615
|
?in-cold-storage=${asset.inColdStorage}
|
|
12404
12616
|
@click=${this.handleClick}
|
|
12405
12617
|
></cx-content-browser-asset-card>
|
|
@@ -12423,7 +12635,7 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12423
12635
|
class="content-browser-grid-loading"
|
|
12424
12636
|
style=${o$1({
|
|
12425
12637
|
opacity: this.loading ? 1 : 0,
|
|
12426
|
-
padding: `0 ${
|
|
12638
|
+
padding: `0 ${__privateGet$2(this, _gutter) * 2}px ${__privateGet$2(this, _gutter)}px`
|
|
12427
12639
|
})}
|
|
12428
12640
|
>
|
|
12429
12641
|
<cx-progress-bar indeterminate></cx-progress-bar>
|
|
@@ -12447,7 +12659,7 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12447
12659
|
"overflow-x": "hidden"
|
|
12448
12660
|
})}
|
|
12449
12661
|
.layout=${grid({
|
|
12450
|
-
gap: `${
|
|
12662
|
+
gap: `${__privateGet$2(this, _gutter)}px`,
|
|
12451
12663
|
itemSize: {
|
|
12452
12664
|
height: `${Math.max(this.columnWidth, 150)}px`,
|
|
12453
12665
|
width: `${this.columnWidth}px`
|
|
@@ -12466,67 +12678,79 @@ let CxContentBrowserGrid = class extends CortexElement {
|
|
|
12466
12678
|
}
|
|
12467
12679
|
};
|
|
12468
12680
|
_gutter = /* @__PURE__ */ new WeakMap();
|
|
12469
|
-
_lastHeight = /* @__PURE__ */ new WeakMap();
|
|
12681
|
+
_lastHeight$1 = /* @__PURE__ */ new WeakMap();
|
|
12470
12682
|
_lastWidth = /* @__PURE__ */ new WeakMap();
|
|
12471
|
-
CxContentBrowserGrid.styles = [componentStyles, styles$
|
|
12683
|
+
CxContentBrowserGrid.styles = [componentStyles, styles$3];
|
|
12472
12684
|
CxContentBrowserGrid.dependencies = {
|
|
12473
12685
|
"cx-content-browser-asset-card": CxContentBrowserAssetCard,
|
|
12474
12686
|
"cx-content-browser-no-result": CxContentBrowserNoResult,
|
|
12475
12687
|
"cx-progress-bar": CxProgressBar,
|
|
12476
12688
|
"cx-resize-observer": CxResizeObserver
|
|
12477
12689
|
};
|
|
12478
|
-
__decorateClass$
|
|
12690
|
+
__decorateClass$3([
|
|
12479
12691
|
e$7(".content-browser-grid")
|
|
12480
12692
|
], CxContentBrowserGrid.prototype, "containerEl", 2);
|
|
12481
|
-
__decorateClass$
|
|
12693
|
+
__decorateClass$3([
|
|
12482
12694
|
e$7("lit-virtualizer")
|
|
12483
12695
|
], CxContentBrowserGrid.prototype, "virtualizerEl", 2);
|
|
12484
|
-
__decorateClass$
|
|
12696
|
+
__decorateClass$3([
|
|
12485
12697
|
n$6({ attribute: "assets", reflect: false, type: Array })
|
|
12486
12698
|
], CxContentBrowserGrid.prototype, "assets", 2);
|
|
12487
|
-
__decorateClass$
|
|
12699
|
+
__decorateClass$3([
|
|
12488
12700
|
n$6({ attribute: "empty", reflect: true, type: Boolean })
|
|
12489
12701
|
], CxContentBrowserGrid.prototype, "empty", 2);
|
|
12490
|
-
__decorateClass$
|
|
12702
|
+
__decorateClass$3([
|
|
12491
12703
|
n$6({ attribute: "view", reflect: true, type: String })
|
|
12492
12704
|
], CxContentBrowserGrid.prototype, "view", 2);
|
|
12493
|
-
__decorateClass$
|
|
12705
|
+
__decorateClass$3([
|
|
12494
12706
|
n$6({ attribute: "has-more", reflect: true, type: Boolean })
|
|
12495
12707
|
], CxContentBrowserGrid.prototype, "hasMore", 2);
|
|
12496
|
-
__decorateClass$
|
|
12708
|
+
__decorateClass$3([
|
|
12497
12709
|
n$6({ attribute: "loading", reflect: true, type: Boolean })
|
|
12498
12710
|
], CxContentBrowserGrid.prototype, "loading", 2);
|
|
12499
|
-
__decorateClass$
|
|
12711
|
+
__decorateClass$3([
|
|
12500
12712
|
n$6({ attribute: "show-title", reflect: true, type: Boolean })
|
|
12501
12713
|
], CxContentBrowserGrid.prototype, "showTitle", 2);
|
|
12502
|
-
__decorateClass$
|
|
12714
|
+
__decorateClass$3([
|
|
12503
12715
|
n$6({ attribute: "show-size", reflect: true, type: Boolean })
|
|
12504
12716
|
], CxContentBrowserGrid.prototype, "showSize", 2);
|
|
12505
|
-
__decorateClass$
|
|
12717
|
+
__decorateClass$3([
|
|
12506
12718
|
n$6({ attribute: "show-dimensions", reflect: true, type: Boolean })
|
|
12507
12719
|
], CxContentBrowserGrid.prototype, "showDimensions", 2);
|
|
12508
|
-
__decorateClass$
|
|
12720
|
+
__decorateClass$3([
|
|
12509
12721
|
n$6({ attribute: "show-tags", reflect: true, type: Boolean })
|
|
12510
12722
|
], CxContentBrowserGrid.prototype, "showTags", 2);
|
|
12511
|
-
__decorateClass$
|
|
12723
|
+
__decorateClass$3([
|
|
12724
|
+
n$6({ attribute: "show-cta", reflect: true, type: Boolean })
|
|
12725
|
+
], CxContentBrowserGrid.prototype, "showCta", 2);
|
|
12726
|
+
__decorateClass$3([
|
|
12727
|
+
n$6({ attribute: "cta-text", reflect: false, type: String })
|
|
12728
|
+
], CxContentBrowserGrid.prototype, "ctaText", 2);
|
|
12729
|
+
__decorateClass$3([
|
|
12730
|
+
n$6({ attribute: "cta-text-transform", reflect: false, type: String })
|
|
12731
|
+
], CxContentBrowserGrid.prototype, "ctaTextTransform", 2);
|
|
12732
|
+
__decorateClass$3([
|
|
12733
|
+
n$6({ attribute: false })
|
|
12734
|
+
], CxContentBrowserGrid.prototype, "busyAssetId", 2);
|
|
12735
|
+
__decorateClass$3([
|
|
12512
12736
|
n$6({ attribute: "selected-asset-id", reflect: true, type: String })
|
|
12513
12737
|
], CxContentBrowserGrid.prototype, "selectedAssetId", 2);
|
|
12514
|
-
__decorateClass$
|
|
12738
|
+
__decorateClass$3([
|
|
12515
12739
|
r$6()
|
|
12516
12740
|
], CxContentBrowserGrid.prototype, "assetMap", 2);
|
|
12517
|
-
__decorateClass$
|
|
12741
|
+
__decorateClass$3([
|
|
12518
12742
|
r$6()
|
|
12519
12743
|
], CxContentBrowserGrid.prototype, "columnWidth", 2);
|
|
12520
|
-
__decorateClass$
|
|
12744
|
+
__decorateClass$3([
|
|
12521
12745
|
watch("view", { waitUntilFirstUpdate: true })
|
|
12522
12746
|
], CxContentBrowserGrid.prototype, "handleViewChange", 1);
|
|
12523
|
-
__decorateClass$
|
|
12747
|
+
__decorateClass$3([
|
|
12524
12748
|
watch("assets")
|
|
12525
12749
|
], CxContentBrowserGrid.prototype, "handleAssetsChange", 1);
|
|
12526
|
-
CxContentBrowserGrid = __decorateClass$
|
|
12750
|
+
CxContentBrowserGrid = __decorateClass$3([
|
|
12527
12751
|
customElement("cx-content-browser-grid")
|
|
12528
12752
|
], CxContentBrowserGrid);
|
|
12529
|
-
const styles$
|
|
12753
|
+
const styles$2 = i$7`
|
|
12530
12754
|
:host {
|
|
12531
12755
|
display: block;
|
|
12532
12756
|
}
|
|
@@ -12585,14 +12809,14 @@ const styles$1 = i$7`
|
|
|
12585
12809
|
cursor: default;
|
|
12586
12810
|
}
|
|
12587
12811
|
`;
|
|
12588
|
-
var __defProp$
|
|
12589
|
-
var __getOwnPropDesc$
|
|
12590
|
-
var __decorateClass$
|
|
12591
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
12812
|
+
var __defProp$2 = Object.defineProperty;
|
|
12813
|
+
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
12814
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
12815
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
12592
12816
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
12593
12817
|
if (decorator = decorators[i4])
|
|
12594
12818
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12595
|
-
if (kind && result) __defProp$
|
|
12819
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
12596
12820
|
return result;
|
|
12597
12821
|
};
|
|
12598
12822
|
const LOGOUT_ITEM_VALUE = "logout";
|
|
@@ -12684,91 +12908,963 @@ let CxContentBrowserHeader = class extends CortexElement {
|
|
|
12684
12908
|
`;
|
|
12685
12909
|
}
|
|
12686
12910
|
return b`
|
|
12687
|
-
<cx-avatar
|
|
12688
|
-
class="header__user-avatar"
|
|
12689
|
-
label=${this.localize.term("userAvatar")}
|
|
12690
|
-
image=${this.avatar}
|
|
12691
|
-
loading="lazy"
|
|
12692
|
-
></cx-avatar>
|
|
12911
|
+
<cx-avatar
|
|
12912
|
+
class="header__user-avatar"
|
|
12913
|
+
label=${this.localize.term("userAvatar")}
|
|
12914
|
+
image=${this.avatar}
|
|
12915
|
+
loading="lazy"
|
|
12916
|
+
></cx-avatar>
|
|
12917
|
+
`;
|
|
12918
|
+
}
|
|
12919
|
+
render() {
|
|
12920
|
+
const containerClasses = {
|
|
12921
|
+
container: true,
|
|
12922
|
+
"container--bordered": this.bordered
|
|
12923
|
+
};
|
|
12924
|
+
return b`
|
|
12925
|
+
<cx-space class=${e$5(containerClasses)} direction="vertical" spacing="small">
|
|
12926
|
+
<cx-space class="header" justify-content="space-between" align-items="center">
|
|
12927
|
+
<div class="header__title">
|
|
12928
|
+
<cx-space class="header" justify-content="space-between" align-items="center" spacing="x-small">
|
|
12929
|
+
${this.renderTitle()}
|
|
12930
|
+
</cx-space>
|
|
12931
|
+
</div>
|
|
12932
|
+
<div class="header__menu">
|
|
12933
|
+
${this.renderUserDropdown()}
|
|
12934
|
+
${n$5(
|
|
12935
|
+
this.showCloseButton,
|
|
12936
|
+
() => b`
|
|
12937
|
+
<cx-icon-button
|
|
12938
|
+
name="close"
|
|
12939
|
+
label=${this.localize.term("close")}
|
|
12940
|
+
@click=${this.handleCloseClick}
|
|
12941
|
+
></cx-icon-button>
|
|
12942
|
+
`,
|
|
12943
|
+
() => A
|
|
12944
|
+
)}
|
|
12945
|
+
</div>
|
|
12946
|
+
</cx-space>
|
|
12947
|
+
<slot></slot>
|
|
12948
|
+
</cx-space>
|
|
12949
|
+
`;
|
|
12950
|
+
}
|
|
12951
|
+
};
|
|
12952
|
+
CxContentBrowserHeader.styles = [componentStyles, styles$2];
|
|
12953
|
+
CxContentBrowserHeader.dependencies = {
|
|
12954
|
+
"cx-avatar": CxAvatar,
|
|
12955
|
+
"cx-divider": CxDivider,
|
|
12956
|
+
"cx-dropdown": CxDropdown,
|
|
12957
|
+
"cx-icon": CxIcon,
|
|
12958
|
+
"cx-icon-button": CxIconButton,
|
|
12959
|
+
"cx-line-clamp": CxLineClamp,
|
|
12960
|
+
"cx-menu": CxMenu,
|
|
12961
|
+
"cx-menu-item": CxMenuItem,
|
|
12962
|
+
"cx-skeleton": CxSkeleton,
|
|
12963
|
+
"cx-space": CxSpace,
|
|
12964
|
+
"cx-typography": CxTypography
|
|
12965
|
+
};
|
|
12966
|
+
__decorateClass$2([
|
|
12967
|
+
n$6({ type: Boolean })
|
|
12968
|
+
], CxContentBrowserHeader.prototype, "bordered", 2);
|
|
12969
|
+
__decorateClass$2([
|
|
12970
|
+
n$6({ attribute: "application-name", type: String })
|
|
12971
|
+
], CxContentBrowserHeader.prototype, "applicationName", 2);
|
|
12972
|
+
__decorateClass$2([
|
|
12973
|
+
n$6({ type: Boolean })
|
|
12974
|
+
], CxContentBrowserHeader.prototype, "loading", 2);
|
|
12975
|
+
__decorateClass$2([
|
|
12976
|
+
n$6({ attribute: "is-fetching", type: Boolean })
|
|
12977
|
+
], CxContentBrowserHeader.prototype, "isFetching", 2);
|
|
12978
|
+
__decorateClass$2([
|
|
12979
|
+
n$6({ attribute: "avatar", type: String })
|
|
12980
|
+
], CxContentBrowserHeader.prototype, "avatar", 2);
|
|
12981
|
+
__decorateClass$2([
|
|
12982
|
+
n$6({ attribute: "full-name", type: String })
|
|
12983
|
+
], CxContentBrowserHeader.prototype, "fullName", 2);
|
|
12984
|
+
__decorateClass$2([
|
|
12985
|
+
n$6({ attribute: "folder-title", type: String })
|
|
12986
|
+
], CxContentBrowserHeader.prototype, "folderTitle", 2);
|
|
12987
|
+
__decorateClass$2([
|
|
12988
|
+
n$6({ attribute: "show-close-button", type: Boolean })
|
|
12989
|
+
], CxContentBrowserHeader.prototype, "showCloseButton", 2);
|
|
12990
|
+
__decorateClass$2([
|
|
12991
|
+
n$6({ attribute: "can-logout", type: Boolean })
|
|
12992
|
+
], CxContentBrowserHeader.prototype, "canLogout", 2);
|
|
12993
|
+
CxContentBrowserHeader = __decorateClass$2([
|
|
12994
|
+
customElement("cx-content-browser-header")
|
|
12995
|
+
], CxContentBrowserHeader);
|
|
12996
|
+
const styles$1 = i$7`
|
|
12997
|
+
/* Containing block for the absolutely positioned loading bar, which is a direct child. */
|
|
12998
|
+
:host {
|
|
12999
|
+
position: relative;
|
|
13000
|
+
display: block;
|
|
13001
|
+
flex: 1;
|
|
13002
|
+
box-sizing: border-box;
|
|
13003
|
+
/*
|
|
13004
|
+
* The overflow has to stop at the scrollport below, which it only does while the host cannot
|
|
13005
|
+
* grow with the grids' min-content width. Two different parents can let it grow, so both are
|
|
13006
|
+
* closed off:
|
|
13007
|
+
*
|
|
13008
|
+
* width -- a multi-line flex parent stretches an item to its own flex line's cross size, the
|
|
13009
|
+
* largest hypothetical size on that line, and not to the container's width; only a
|
|
13010
|
+
* single-line container does the latter. The picker's column parent wraps, so the
|
|
13011
|
+
* host stretched to the grids' min-content width and carried everything beside it
|
|
13012
|
+
* along (L-429EVG: the login avatar left the viewport). A definite width ends that.
|
|
13013
|
+
* min-width -- in a row parent the main axis is the horizontal one, and a flex item's automatic
|
|
13014
|
+
* minimum size refuses to shrink below its content there. In a column parent that
|
|
13015
|
+
* automatic minimum lands on min-height instead, which is why width alone is not
|
|
13016
|
+
* enough for one shape and min-width alone is not enough for the other.
|
|
13017
|
+
*/
|
|
13018
|
+
width: 100%;
|
|
13019
|
+
min-width: 0;
|
|
13020
|
+
min-height: 0;
|
|
13021
|
+
}
|
|
13022
|
+
|
|
13023
|
+
/*
|
|
13024
|
+
* The one scrollport for both axes. The header and the virtualized rows are separate grids, so
|
|
13025
|
+
* anything that scrolled them separately could drift; sharing a scroll container means a single
|
|
13026
|
+
* scroll offset moves both and they cannot. The vertical scrollbar therefore sits outside both
|
|
13027
|
+
* grids, which is why neither has to reserve a gutter for it.
|
|
13028
|
+
*/
|
|
13029
|
+
.content-browser-table {
|
|
13030
|
+
display: flex;
|
|
13031
|
+
flex-direction: column;
|
|
13032
|
+
height: 100%;
|
|
13033
|
+
overflow: auto;
|
|
13034
|
+
}
|
|
13035
|
+
|
|
13036
|
+
.content-browser-table-loading {
|
|
13037
|
+
position: absolute;
|
|
13038
|
+
width: 100%;
|
|
13039
|
+
z-index: var(--cx-z-index-drawer);
|
|
13040
|
+
}
|
|
13041
|
+
|
|
13042
|
+
.content-browser-table-loading cx-progress-bar {
|
|
13043
|
+
--height: 4px;
|
|
13044
|
+
}
|
|
13045
|
+
|
|
13046
|
+
/*
|
|
13047
|
+
* min-width: min-content is what makes the table scroll instead of squashing: it is the width
|
|
13048
|
+
* at which every track that cannot shrink still fits, so a column dragged wider than the viewport
|
|
13049
|
+
* widens both grids past it and the container gains a horizontal scrollbar. The header and a row
|
|
13050
|
+
* resolve the same track list against the same padding and gaps, so their min-content widths are
|
|
13051
|
+
* equal and their column boundaries stay on top of each other at any scroll offset.
|
|
13052
|
+
*/
|
|
13053
|
+
.content-browser-table__header,
|
|
13054
|
+
.content-browser-table__row {
|
|
13055
|
+
display: grid;
|
|
13056
|
+
align-items: center;
|
|
13057
|
+
/* Set on the host so the header and every virtualized row resolve one identical track list. */
|
|
13058
|
+
grid-template-columns: var(--cx-content-browser-table-columns);
|
|
13059
|
+
column-gap: var(--cx-spacing-medium);
|
|
13060
|
+
padding: var(--cx-spacing-x-small) var(--cx-spacing-medium);
|
|
13061
|
+
min-width: min-content;
|
|
13062
|
+
}
|
|
13063
|
+
|
|
13064
|
+
/*
|
|
13065
|
+
* Sticky rather than outside the scroller: the header has to travel with the rows horizontally
|
|
13066
|
+
* and stay put vertically, and only sharing their scrollport gives the first of those for free.
|
|
13067
|
+
*/
|
|
13068
|
+
.content-browser-table__head {
|
|
13069
|
+
position: sticky;
|
|
13070
|
+
top: 0;
|
|
13071
|
+
z-index: 1;
|
|
13072
|
+
flex: none;
|
|
13073
|
+
min-width: min-content;
|
|
13074
|
+
/*
|
|
13075
|
+
* The offset and the background belong to the sticky box, not to the row inside it: rows now
|
|
13076
|
+
* scroll underneath within the same scrollport, and any part of the sticky box that paints
|
|
13077
|
+
* nothing shows them through. __head is a flex item, so a child's margin cannot collapse out
|
|
13078
|
+
* of it either. Literal fallback because an unthemed host paints no background at all.
|
|
13079
|
+
*/
|
|
13080
|
+
padding-top: 5px;
|
|
13081
|
+
background-color: var(--cx-color-neutral-50, #f9f9f9);
|
|
13082
|
+
}
|
|
13083
|
+
|
|
13084
|
+
.content-browser-table__header {
|
|
13085
|
+
border-bottom: 1px solid var(--cx-color-neutral-200);
|
|
13086
|
+
color: var(--cx-color-neutral-700);
|
|
13087
|
+
}
|
|
13088
|
+
|
|
13089
|
+
/* cx-typography sets its own font-weight, so the host cannot simply inherit one in. */
|
|
13090
|
+
.content-browser-table__header cx-typography::part(base) {
|
|
13091
|
+
font-weight: var(--cx-font-weight-medium);
|
|
13092
|
+
}
|
|
13093
|
+
|
|
13094
|
+
.content-browser-table__body {
|
|
13095
|
+
flex: 1;
|
|
13096
|
+
min-height: 0;
|
|
13097
|
+
}
|
|
13098
|
+
|
|
13099
|
+
/*
|
|
13100
|
+
* lit-virtualizer positions rows absolutely, which makes them shrink-to-fit. Without an explicit
|
|
13101
|
+
* width the row's grid resolves its fr tracks against the row's own content width while the
|
|
13102
|
+
* header -- not virtualized -- resolves the same tracks against the full container, so the two
|
|
13103
|
+
* disagree and a fractional column never receives the free space. 100% is the scrollport, not
|
|
13104
|
+
* the scroll width, so the shared min-width: min-content above is what carries a row past it.
|
|
13105
|
+
*/
|
|
13106
|
+
.content-browser-table__row {
|
|
13107
|
+
box-sizing: border-box;
|
|
13108
|
+
width: 100%;
|
|
13109
|
+
border-bottom: 1px solid var(--cx-color-neutral-200);
|
|
13110
|
+
cursor: pointer;
|
|
13111
|
+
}
|
|
13112
|
+
|
|
13113
|
+
.content-browser-table__row:hover,
|
|
13114
|
+
.content-browser-table__row:focus-visible {
|
|
13115
|
+
background-color: var(--cx-color-neutral-100);
|
|
13116
|
+
outline: none;
|
|
13117
|
+
}
|
|
13118
|
+
|
|
13119
|
+
.content-browser-table__row--selected {
|
|
13120
|
+
background-color: var(--cx-color-primary-100);
|
|
13121
|
+
}
|
|
13122
|
+
|
|
13123
|
+
.content-browser-table__row--disabled {
|
|
13124
|
+
cursor: default;
|
|
13125
|
+
pointer-events: none;
|
|
13126
|
+
opacity: 0.5;
|
|
13127
|
+
}
|
|
13128
|
+
|
|
13129
|
+
.content-browser-table__cell {
|
|
13130
|
+
min-width: 0;
|
|
13131
|
+
overflow: hidden;
|
|
13132
|
+
}
|
|
13133
|
+
|
|
13134
|
+
.content-browser-table__cell--center {
|
|
13135
|
+
text-align: center;
|
|
13136
|
+
}
|
|
13137
|
+
|
|
13138
|
+
.content-browser-table__cell--right {
|
|
13139
|
+
text-align: right;
|
|
13140
|
+
}
|
|
13141
|
+
|
|
13142
|
+
/* Anchors the resize handle; the cell clips, so the handle stays inside its own right edge. */
|
|
13143
|
+
.content-browser-table__header .content-browser-table__cell {
|
|
13144
|
+
position: relative;
|
|
13145
|
+
}
|
|
13146
|
+
|
|
13147
|
+
/*
|
|
13148
|
+
* Kept wholly inside the cell: the cell clips, so any part hanging into the column gap is not
|
|
13149
|
+
* painted and, more importantly, not hit-testable.
|
|
13150
|
+
*/
|
|
13151
|
+
.content-browser-table__resize {
|
|
13152
|
+
position: absolute;
|
|
13153
|
+
top: 0;
|
|
13154
|
+
right: 0;
|
|
13155
|
+
bottom: 0;
|
|
13156
|
+
/* Fallback matters: with no design-system theme the token is empty and the grab target is 0px. */
|
|
13157
|
+
width: var(--cx-spacing-medium, 16px);
|
|
13158
|
+
cursor: col-resize;
|
|
13159
|
+
touch-action: none;
|
|
13160
|
+
}
|
|
13161
|
+
|
|
13162
|
+
/*
|
|
13163
|
+
* The column divider, pinned to the grab target's right edge -- which the cell clips to, so it
|
|
13164
|
+
* lands on the column boundary. Visible at rest as a neutral full-height hairline: it is what
|
|
13165
|
+
* tells the user where the draggable boundaries are before the pointer is anywhere near one, so
|
|
13166
|
+
* it has to read as table chrome. The rules below take it to the primary treatment once the
|
|
13167
|
+
* boundary is actually being addressed. Literal fallbacks because the tokens resolve to nothing
|
|
13168
|
+
* on an unthemed host, and an invisible divider is the defect this fixes.
|
|
13169
|
+
*/
|
|
13170
|
+
.content-browser-table__resize::after {
|
|
13171
|
+
position: absolute;
|
|
13172
|
+
top: 0;
|
|
13173
|
+
right: 0;
|
|
13174
|
+
bottom: 0;
|
|
13175
|
+
width: 1px;
|
|
13176
|
+
background-color: var(--cx-color-neutral-200, #e4e4e7);
|
|
13177
|
+
content: '';
|
|
13178
|
+
}
|
|
13179
|
+
|
|
13180
|
+
.content-browser-table__resize:hover::after,
|
|
13181
|
+
.content-browser-table__resize:focus-visible::after {
|
|
13182
|
+
width: 2px;
|
|
13183
|
+
background-color: var(--cx-color-primary-500, #3b82f6);
|
|
13184
|
+
}
|
|
13185
|
+
|
|
13186
|
+
/*
|
|
13187
|
+
* Keyboard focus needs an indicator of its own: the hover hairline is 2px wide and half the cell
|
|
13188
|
+
* high, far too small to read as focus. The ring is inset by its own width because the header
|
|
13189
|
+
* cell clips -- the handle is flush with the cell's top, right and bottom edges, so anything
|
|
13190
|
+
* drawn outside its box is never painted. Fallbacks matter: with no design-system theme the
|
|
13191
|
+
* tokens are empty and the ring would disappear entirely.
|
|
13192
|
+
*/
|
|
13193
|
+
.content-browser-table__resize:focus-visible {
|
|
13194
|
+
outline: var(--cx-focus-ring-style, solid) var(--cx-focus-ring-width, 3px)
|
|
13195
|
+
var(--cx-focus-ring-color, #2563eb);
|
|
13196
|
+
outline-offset: calc(-1 * var(--cx-focus-ring-width, 3px));
|
|
13197
|
+
}
|
|
13198
|
+
|
|
13199
|
+
/*
|
|
13200
|
+
* While a column is being dragged the pointer is captured, so it can travel anywhere in the
|
|
13201
|
+
* document -- keep the resize cursor and stop the drag from selecting header text.
|
|
13202
|
+
*/
|
|
13203
|
+
.content-browser-table--resizing {
|
|
13204
|
+
cursor: col-resize;
|
|
13205
|
+
user-select: none;
|
|
13206
|
+
}
|
|
13207
|
+
|
|
13208
|
+
.content-browser-table--resizing .content-browser-table__resize::after {
|
|
13209
|
+
width: 2px;
|
|
13210
|
+
background-color: var(--cx-color-primary-500, #3b82f6);
|
|
13211
|
+
}
|
|
13212
|
+
|
|
13213
|
+
.content-browser-table__cell--action {
|
|
13214
|
+
display: flex;
|
|
13215
|
+
justify-content: flex-end;
|
|
13216
|
+
}
|
|
13217
|
+
|
|
13218
|
+
/*
|
|
13219
|
+
* visibility, not display: the action column is a max-content track, so removing the button
|
|
13220
|
+
* from layout would collapse the track and reflow every other column on hover.
|
|
13221
|
+
*/
|
|
13222
|
+
.content-browser-table__action {
|
|
13223
|
+
--min-height: 0;
|
|
13224
|
+
|
|
13225
|
+
visibility: hidden;
|
|
13226
|
+
}
|
|
13227
|
+
|
|
13228
|
+
.content-browser-table__row:hover .content-browser-table__action,
|
|
13229
|
+
.content-browser-table__row:focus-visible .content-browser-table__action,
|
|
13230
|
+
.content-browser-table__row:focus-within .content-browser-table__action,
|
|
13231
|
+
.content-browser-table__row--selected .content-browser-table__action,
|
|
13232
|
+
.content-browser-table__action--busy {
|
|
13233
|
+
visibility: visible;
|
|
13234
|
+
}
|
|
13235
|
+
|
|
13236
|
+
/*
|
|
13237
|
+
* Reserves the action track's width in the header grid so it resolves to the same max-content
|
|
13238
|
+
* size the row grid resolves to. It is never shown and never focusable.
|
|
13239
|
+
*/
|
|
13240
|
+
.content-browser-table__action--placeholder {
|
|
13241
|
+
visibility: hidden;
|
|
13242
|
+
pointer-events: none;
|
|
13243
|
+
}
|
|
13244
|
+
|
|
13245
|
+
.content-browser-table__empty {
|
|
13246
|
+
flex: 1;
|
|
13247
|
+
}
|
|
13248
|
+
`;
|
|
13249
|
+
var __defProp$1 = Object.defineProperty;
|
|
13250
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
13251
|
+
var __typeError$1 = (msg) => {
|
|
13252
|
+
throw TypeError(msg);
|
|
13253
|
+
};
|
|
13254
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
13255
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
13256
|
+
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
13257
|
+
if (decorator = decorators[i4])
|
|
13258
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13259
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
13260
|
+
return result;
|
|
13261
|
+
};
|
|
13262
|
+
var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
|
|
13263
|
+
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
13264
|
+
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13265
|
+
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
13266
|
+
var _lastHeight, _lastScrollTop, _resize, _fallbackListeners;
|
|
13267
|
+
const ROW_HEIGHT = 40;
|
|
13268
|
+
const ACTION_COLUMN_TRACK = "max-content";
|
|
13269
|
+
const MIN_COLUMN_WIDTH = 48;
|
|
13270
|
+
const MAX_COLUMN_WIDTH = 2e3;
|
|
13271
|
+
const COLUMN_RESIZE_STEP = 8;
|
|
13272
|
+
const COLUMN_RESIZE_STEP_LARGE = 32;
|
|
13273
|
+
const TABLE_COLUMNS_PROPERTY = "--cx-content-browser-table-columns";
|
|
13274
|
+
const FLEX_TRACK = /^\d*\.?\d+fr$/i;
|
|
13275
|
+
const MINMAX_TRACK = /^minmax\(\s*(.+?)\s*,\s*(.+?)\s*\)$/i;
|
|
13276
|
+
const COLLAPSIBLE_MINIMUM = /^(auto|min-content)$/i;
|
|
13277
|
+
const PIXEL_MINIMUM = /^(\d*\.?\d+)(px)?$/i;
|
|
13278
|
+
function floorFlexibleTrack(track) {
|
|
13279
|
+
const authored = track.trim();
|
|
13280
|
+
const minmax = MINMAX_TRACK.exec(authored);
|
|
13281
|
+
if (!minmax) {
|
|
13282
|
+
return FLEX_TRACK.test(authored) ? `minmax(${MIN_COLUMN_WIDTH}px, ${authored})` : authored;
|
|
13283
|
+
}
|
|
13284
|
+
const [, minimum, maximum] = minmax;
|
|
13285
|
+
if (!FLEX_TRACK.test(maximum)) {
|
|
13286
|
+
return authored;
|
|
13287
|
+
}
|
|
13288
|
+
const pixels = PIXEL_MINIMUM.exec(minimum);
|
|
13289
|
+
const collapsible = COLLAPSIBLE_MINIMUM.test(minimum) || pixels !== null && Number.parseFloat(pixels[1]) < MIN_COLUMN_WIDTH;
|
|
13290
|
+
return collapsible ? `minmax(${MIN_COLUMN_WIDTH}px, ${maximum})` : authored;
|
|
13291
|
+
}
|
|
13292
|
+
function createColumnWidths(entries = []) {
|
|
13293
|
+
return Object.assign(/* @__PURE__ */ Object.create(null), Object.fromEntries(entries));
|
|
13294
|
+
}
|
|
13295
|
+
function readCellValue(asset, field) {
|
|
13296
|
+
const value = asset[field];
|
|
13297
|
+
if (value === void 0 || value === null || typeof value === "object") {
|
|
13298
|
+
return "";
|
|
13299
|
+
}
|
|
13300
|
+
return String(value);
|
|
13301
|
+
}
|
|
13302
|
+
let CxContentBrowserTable = class extends CortexElement {
|
|
13303
|
+
constructor() {
|
|
13304
|
+
super();
|
|
13305
|
+
this.localize = new LocalizeController(this);
|
|
13306
|
+
this.assets = [];
|
|
13307
|
+
this.columns = [];
|
|
13308
|
+
this.ctaText = "";
|
|
13309
|
+
this.ctaTextTransform = "capitalize";
|
|
13310
|
+
this.empty = false;
|
|
13311
|
+
this.hasMore = false;
|
|
13312
|
+
this.loading = false;
|
|
13313
|
+
this.selectedAssetId = void 0;
|
|
13314
|
+
this.busyAssetId = void 0;
|
|
13315
|
+
this.assetMap = /* @__PURE__ */ new Map();
|
|
13316
|
+
this.columnWidths = createColumnWidths();
|
|
13317
|
+
__privateAdd$1(this, _lastHeight, 0);
|
|
13318
|
+
__privateAdd$1(this, _lastScrollTop, 0);
|
|
13319
|
+
this.scrollAnchorController = new ScrollAnchorController(this, {
|
|
13320
|
+
// The rows scroll inside the table container, not inside the virtualizer, so that is the
|
|
13321
|
+
// element whose scroll offset an anchor has to be captured against and restored on.
|
|
13322
|
+
getContainer: () => this.containerEl,
|
|
13323
|
+
// The sticky header is the container's first in-flow child, so row 0 starts below it rather
|
|
13324
|
+
// than at the content origin. Measured rather than a constant: the height is whatever the
|
|
13325
|
+
// host's tokens and column titles resolve to.
|
|
13326
|
+
getContentOffset: () => {
|
|
13327
|
+
var _a2, _b2;
|
|
13328
|
+
return (_b2 = (_a2 = this.headEl) == null ? void 0 : _a2.getBoundingClientRect().height) != null ? _b2 : 0;
|
|
13329
|
+
},
|
|
13330
|
+
getItemIndexById: (id) => this.assets.findIndex((asset) => asset.id === id),
|
|
13331
|
+
// The container is a plain div, so it has no `layoutComplete` of its own; the virtualizer still
|
|
13332
|
+
// has to have laid the rows out before a restore can land on one.
|
|
13333
|
+
getLayoutSource: () => this.bodyEl,
|
|
13334
|
+
itemSelector: ".content-browser-table__row"
|
|
13335
|
+
});
|
|
13336
|
+
__privateAdd$1(this, _resize);
|
|
13337
|
+
__privateAdd$1(this, _fallbackListeners);
|
|
13338
|
+
this.debouncedCalculatePageSize = debounce(this.calculatePageSize, 200);
|
|
13339
|
+
this.debouncedHandleScrollEnd = debounce(this.handleScrollEnd, 200);
|
|
13340
|
+
this.handleRowClick = this.handleRowClick.bind(this);
|
|
13341
|
+
this.handleActionClick = this.handleActionClick.bind(this);
|
|
13342
|
+
this.handleRowKeyDown = this.handleRowKeyDown.bind(this);
|
|
13343
|
+
}
|
|
13344
|
+
/** One authored track per configured column, in order. The action track is not one of them. */
|
|
13345
|
+
buildColumnTracks(widths) {
|
|
13346
|
+
return this.columns.map((column) => {
|
|
13347
|
+
var _a2;
|
|
13348
|
+
const resized = widths[column.field];
|
|
13349
|
+
return resized === void 0 ? floorFlexibleTrack((_a2 = column.width) != null ? _a2 : "minmax(0, 1fr)") : `${resized}px`;
|
|
13350
|
+
});
|
|
13351
|
+
}
|
|
13352
|
+
buildTemplateColumns(widths) {
|
|
13353
|
+
return [...this.buildColumnTracks(widths), ACTION_COLUMN_TRACK].join(" ");
|
|
13354
|
+
}
|
|
13355
|
+
get templateColumns() {
|
|
13356
|
+
return this.buildTemplateColumns(this.columnWidths);
|
|
13357
|
+
}
|
|
13358
|
+
resolveColumnWidth(field) {
|
|
13359
|
+
var _a2;
|
|
13360
|
+
const configured = this.columnWidths[field];
|
|
13361
|
+
if (configured !== void 0) {
|
|
13362
|
+
return configured;
|
|
13363
|
+
}
|
|
13364
|
+
const cell = this.renderRoot.querySelector(
|
|
13365
|
+
`.content-browser-table__header [role="columnheader"][data-field="${CSS.escape(field)}"]`
|
|
13366
|
+
);
|
|
13367
|
+
return this.clampColumnWidth((_a2 = cell == null ? void 0 : cell.getBoundingClientRect().width) != null ? _a2 : MIN_COLUMN_WIDTH);
|
|
13368
|
+
}
|
|
13369
|
+
clampColumnWidth(width) {
|
|
13370
|
+
return Math.round(Math.min(MAX_COLUMN_WIDTH, Math.max(MIN_COLUMN_WIDTH, width)));
|
|
13371
|
+
}
|
|
13372
|
+
commitColumnWidth(field, width) {
|
|
13373
|
+
if (this.columnWidths[field] === width) {
|
|
13374
|
+
return;
|
|
13375
|
+
}
|
|
13376
|
+
const next = createColumnWidths(Object.entries(this.columnWidths));
|
|
13377
|
+
if (width === void 0) {
|
|
13378
|
+
delete next[field];
|
|
13379
|
+
} else {
|
|
13380
|
+
next[field] = width;
|
|
13381
|
+
}
|
|
13382
|
+
this.columnWidths = next;
|
|
13383
|
+
this.emit("cx-content-browser-table-column-resize", { detail: { field, width } });
|
|
13384
|
+
}
|
|
13385
|
+
/**
|
|
13386
|
+
* Kept off the reactive path: its only effect is the cursor, the text selection and the handle
|
|
13387
|
+
* colour, while a reactive toggle would rebind `renderItem` and re-render every visible row twice
|
|
13388
|
+
* per drag.
|
|
13389
|
+
*/
|
|
13390
|
+
setResizingClass(active) {
|
|
13391
|
+
var _a2;
|
|
13392
|
+
(_a2 = this.containerEl) == null ? void 0 : _a2.classList.toggle("content-browser-table--resizing", active);
|
|
13393
|
+
}
|
|
13394
|
+
bindFallbackListeners(target) {
|
|
13395
|
+
const onMove = (event) => this.handleResizeMove(event);
|
|
13396
|
+
const onUp = (event) => this.handleResizeEnd(event);
|
|
13397
|
+
const onCancel = (event) => this.handleResizeCancel(event);
|
|
13398
|
+
__privateSet$1(this, _fallbackListeners, { onCancel, onMove, onUp, target });
|
|
13399
|
+
target.addEventListener("pointermove", onMove);
|
|
13400
|
+
target.addEventListener("pointerup", onUp);
|
|
13401
|
+
target.addEventListener("pointercancel", onCancel);
|
|
13402
|
+
}
|
|
13403
|
+
releaseFallbackListeners() {
|
|
13404
|
+
if (!__privateGet$1(this, _fallbackListeners)) {
|
|
13405
|
+
return;
|
|
13406
|
+
}
|
|
13407
|
+
const { onCancel, onMove, onUp, target } = __privateGet$1(this, _fallbackListeners);
|
|
13408
|
+
target.removeEventListener("pointermove", onMove);
|
|
13409
|
+
target.removeEventListener("pointerup", onUp);
|
|
13410
|
+
target.removeEventListener("pointercancel", onCancel);
|
|
13411
|
+
__privateSet$1(this, _fallbackListeners, void 0);
|
|
13412
|
+
}
|
|
13413
|
+
/**
|
|
13414
|
+
* With the fallback bound, an event dispatched at the handle reaches the handle's own binding and
|
|
13415
|
+
* then the document one, running every terminal handler twice. The fallback owns the whole drag on
|
|
13416
|
+
* that path, so the element-level delivery is dropped.
|
|
13417
|
+
*/
|
|
13418
|
+
isHandledByFallback(event) {
|
|
13419
|
+
return __privateGet$1(this, _fallbackListeners) !== void 0 && event.currentTarget !== __privateGet$1(this, _fallbackListeners).target;
|
|
13420
|
+
}
|
|
13421
|
+
/** Every trace of a drag: the state the track-list publish is gated on, the cursor, the fallback. */
|
|
13422
|
+
endResize() {
|
|
13423
|
+
__privateSet$1(this, _resize, void 0);
|
|
13424
|
+
this.releaseFallbackListeners();
|
|
13425
|
+
this.setResizingClass(false);
|
|
13426
|
+
}
|
|
13427
|
+
handleResizeStart(event) {
|
|
13428
|
+
const handle = event.currentTarget;
|
|
13429
|
+
const field = handle.dataset.field;
|
|
13430
|
+
if (!field || !event.isPrimary || event.button !== 0 || __privateGet$1(this, _resize)) {
|
|
13431
|
+
return;
|
|
13432
|
+
}
|
|
13433
|
+
event.preventDefault();
|
|
13434
|
+
handle.focus();
|
|
13435
|
+
const startWidth = this.resolveColumnWidth(field);
|
|
13436
|
+
__privateSet$1(this, _resize, {
|
|
13437
|
+
field,
|
|
13438
|
+
pointerId: event.pointerId,
|
|
13439
|
+
startWidth,
|
|
13440
|
+
startX: event.clientX,
|
|
13441
|
+
width: startWidth
|
|
13442
|
+
});
|
|
13443
|
+
this.setResizingClass(true);
|
|
13444
|
+
try {
|
|
13445
|
+
handle.setPointerCapture(event.pointerId);
|
|
13446
|
+
} catch (e2) {
|
|
13447
|
+
this.bindFallbackListeners(handle.ownerDocument);
|
|
13448
|
+
}
|
|
13449
|
+
}
|
|
13450
|
+
/**
|
|
13451
|
+
* The track list a running drag owns, built against the columns rendering right now: the committed
|
|
13452
|
+
* widths with the drag's own preview over the top. Falls back to the committed list when no drag is
|
|
13453
|
+
* running, so one expression covers both.
|
|
13454
|
+
*/
|
|
13455
|
+
get previewTemplateColumns() {
|
|
13456
|
+
if (!__privateGet$1(this, _resize)) {
|
|
13457
|
+
return this.templateColumns;
|
|
13458
|
+
}
|
|
13459
|
+
const preview = createColumnWidths(Object.entries(this.columnWidths));
|
|
13460
|
+
preview[__privateGet$1(this, _resize).field] = __privateGet$1(this, _resize).width;
|
|
13461
|
+
return this.buildTemplateColumns(preview);
|
|
13462
|
+
}
|
|
13463
|
+
/** Repaints the drag with one property write: no re-render, no layout read. */
|
|
13464
|
+
previewColumnWidth(width) {
|
|
13465
|
+
if (!__privateGet$1(this, _resize)) {
|
|
13466
|
+
return;
|
|
13467
|
+
}
|
|
13468
|
+
__privateGet$1(this, _resize).width = width;
|
|
13469
|
+
this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.previewTemplateColumns);
|
|
13470
|
+
}
|
|
13471
|
+
handleResizeMove(event) {
|
|
13472
|
+
if (this.isHandledByFallback(event) || !__privateGet$1(this, _resize) || __privateGet$1(this, _resize).pointerId !== event.pointerId) {
|
|
13473
|
+
return;
|
|
13474
|
+
}
|
|
13475
|
+
this.previewColumnWidth(this.clampColumnWidth(
|
|
13476
|
+
__privateGet$1(this, _resize).startWidth + (event.clientX - __privateGet$1(this, _resize).startX)
|
|
13477
|
+
));
|
|
13478
|
+
}
|
|
13479
|
+
handleResizeEnd(event) {
|
|
13480
|
+
if (this.isHandledByFallback(event) || !__privateGet$1(this, _resize) || __privateGet$1(this, _resize).pointerId !== event.pointerId) {
|
|
13481
|
+
return;
|
|
13482
|
+
}
|
|
13483
|
+
const { field, startWidth, width } = __privateGet$1(this, _resize);
|
|
13484
|
+
this.endResize();
|
|
13485
|
+
if (!this.columns.some((column) => column.field === field)) {
|
|
13486
|
+
this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.templateColumns);
|
|
13487
|
+
return;
|
|
13488
|
+
}
|
|
13489
|
+
if (width !== startWidth) {
|
|
13490
|
+
this.commitColumnWidth(field, width);
|
|
13491
|
+
return;
|
|
13492
|
+
}
|
|
13493
|
+
this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.templateColumns);
|
|
13494
|
+
}
|
|
13495
|
+
/**
|
|
13496
|
+
* A gesture the user agent took away was never a decision: restore the committed track list and
|
|
13497
|
+
* tell the host nothing.
|
|
13498
|
+
*/
|
|
13499
|
+
handleResizeCancel(event) {
|
|
13500
|
+
if (this.isHandledByFallback(event) || !__privateGet$1(this, _resize) || __privateGet$1(this, _resize).pointerId !== event.pointerId) {
|
|
13501
|
+
return;
|
|
13502
|
+
}
|
|
13503
|
+
this.endResize();
|
|
13504
|
+
this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.templateColumns);
|
|
13505
|
+
}
|
|
13506
|
+
handleResizeKeyDown(event) {
|
|
13507
|
+
const handle = event.currentTarget;
|
|
13508
|
+
const field = handle.dataset.field;
|
|
13509
|
+
if (!field) {
|
|
13510
|
+
return;
|
|
13511
|
+
}
|
|
13512
|
+
if (event.key === "Home") {
|
|
13513
|
+
event.preventDefault();
|
|
13514
|
+
this.commitColumnWidth(field, void 0);
|
|
13515
|
+
return;
|
|
13516
|
+
}
|
|
13517
|
+
const step = event.shiftKey ? COLUMN_RESIZE_STEP_LARGE : COLUMN_RESIZE_STEP;
|
|
13518
|
+
const delta = event.key === "ArrowLeft" ? -step : event.key === "ArrowRight" ? step : 0;
|
|
13519
|
+
if (!delta) {
|
|
13520
|
+
return;
|
|
13521
|
+
}
|
|
13522
|
+
event.preventDefault();
|
|
13523
|
+
const startWidth = this.resolveColumnWidth(field);
|
|
13524
|
+
const width = this.clampColumnWidth(startWidth + delta);
|
|
13525
|
+
if (width === startWidth) {
|
|
13526
|
+
return;
|
|
13527
|
+
}
|
|
13528
|
+
this.commitColumnWidth(field, width);
|
|
13529
|
+
}
|
|
13530
|
+
handleResizeReset(event) {
|
|
13531
|
+
const field = event.currentTarget.dataset.field;
|
|
13532
|
+
if (field) {
|
|
13533
|
+
this.commitColumnWidth(field, void 0);
|
|
13534
|
+
}
|
|
13535
|
+
}
|
|
13536
|
+
renderResizeHandle(column) {
|
|
13537
|
+
const pinned = this.columnWidths[column.field];
|
|
13538
|
+
return b`
|
|
13539
|
+
<div
|
|
13540
|
+
class="content-browser-table__resize"
|
|
13541
|
+
role="separator"
|
|
13542
|
+
aria-orientation="vertical"
|
|
13543
|
+
aria-label=${this.localize.term("resize")}
|
|
13544
|
+
aria-valuemin=${MIN_COLUMN_WIDTH}
|
|
13545
|
+
aria-valuemax=${MAX_COLUMN_WIDTH}
|
|
13546
|
+
aria-valuenow=${o$4(pinned)}
|
|
13547
|
+
tabindex="0"
|
|
13548
|
+
data-field=${column.field}
|
|
13549
|
+
@pointerdown=${this.handleResizeStart}
|
|
13550
|
+
@pointermove=${this.handleResizeMove}
|
|
13551
|
+
@pointerup=${this.handleResizeEnd}
|
|
13552
|
+
@pointercancel=${this.handleResizeCancel}
|
|
13553
|
+
@lostpointercapture=${this.handleResizeEnd}
|
|
13554
|
+
@dblclick=${this.handleResizeReset}
|
|
13555
|
+
@keydown=${this.handleResizeKeyDown}
|
|
13556
|
+
></div>
|
|
13557
|
+
`;
|
|
13558
|
+
}
|
|
13559
|
+
handleColumnsChange() {
|
|
13560
|
+
const fields = new Set(this.columns.map((column) => column.field));
|
|
13561
|
+
const kept = Object.entries(this.columnWidths).filter(([field]) => fields.has(field));
|
|
13562
|
+
if (kept.length !== Object.keys(this.columnWidths).length) {
|
|
13563
|
+
this.columnWidths = createColumnWidths(kept);
|
|
13564
|
+
}
|
|
13565
|
+
}
|
|
13566
|
+
updated() {
|
|
13567
|
+
this.style.setProperty(TABLE_COLUMNS_PROPERTY, this.previewTemplateColumns);
|
|
13568
|
+
}
|
|
13569
|
+
disconnectedCallback() {
|
|
13570
|
+
super.disconnectedCallback();
|
|
13571
|
+
this.endResize();
|
|
13572
|
+
}
|
|
13573
|
+
handleAssetsChange() {
|
|
13574
|
+
this.assetMap.clear();
|
|
13575
|
+
this.assets.forEach((item) => this.assetMap.set(item.id, item));
|
|
13576
|
+
this.scrollAnchorController.scheduleRestore();
|
|
13577
|
+
}
|
|
13578
|
+
handleResize(event) {
|
|
13579
|
+
event.stopPropagation();
|
|
13580
|
+
const entries = event.detail.entries;
|
|
13581
|
+
if (entries[0].target !== this.containerEl) {
|
|
13582
|
+
return;
|
|
13583
|
+
}
|
|
13584
|
+
this.scrollAnchorController.capture();
|
|
13585
|
+
this.debouncedCalculatePageSize(entries[0].contentRect.height);
|
|
13586
|
+
}
|
|
13587
|
+
calculatePageSize(height) {
|
|
13588
|
+
if (Math.abs(__privateGet$1(this, _lastHeight) - height) < 10) {
|
|
13589
|
+
return;
|
|
13590
|
+
}
|
|
13591
|
+
__privateSet$1(this, _lastHeight, height);
|
|
13592
|
+
this.scrollAnchorController.setLayoutMetrics({
|
|
13593
|
+
columnCount: 1,
|
|
13594
|
+
itemHeight: ROW_HEIGHT
|
|
13595
|
+
});
|
|
13596
|
+
this.emit("cx-content-browser-grid-resize", {
|
|
13597
|
+
detail: {
|
|
13598
|
+
columnCount: 1,
|
|
13599
|
+
rowCount: Math.ceil(height / ROW_HEIGHT)
|
|
13600
|
+
}
|
|
13601
|
+
});
|
|
13602
|
+
this.scrollAnchorController.scheduleRestore();
|
|
13603
|
+
}
|
|
13604
|
+
selectRow(assetId) {
|
|
13605
|
+
var _a2;
|
|
13606
|
+
if (!assetId || ((_a2 = this.assetMap.get(assetId)) == null ? void 0 : _a2.inColdStorage)) {
|
|
13607
|
+
return;
|
|
13608
|
+
}
|
|
13609
|
+
this.emit("cx-content-browser-grid-click", {
|
|
13610
|
+
detail: {
|
|
13611
|
+
id: assetId
|
|
13612
|
+
}
|
|
13613
|
+
});
|
|
13614
|
+
}
|
|
13615
|
+
handleRowClick(event) {
|
|
13616
|
+
var _a2;
|
|
13617
|
+
this.selectRow((_a2 = event.currentTarget.dataset.id) != null ? _a2 : "");
|
|
13618
|
+
}
|
|
13619
|
+
handleActionClick(event) {
|
|
13620
|
+
var _a2;
|
|
13621
|
+
event.stopPropagation();
|
|
13622
|
+
this.selectRow((_a2 = event.currentTarget.dataset.id) != null ? _a2 : "");
|
|
13623
|
+
}
|
|
13624
|
+
handleRowKeyDown(event) {
|
|
13625
|
+
var _a2;
|
|
13626
|
+
if (event.key !== "Enter" && event.key !== " ") {
|
|
13627
|
+
return;
|
|
13628
|
+
}
|
|
13629
|
+
event.preventDefault();
|
|
13630
|
+
this.selectRow((_a2 = event.currentTarget.dataset.id) != null ? _a2 : "");
|
|
13631
|
+
}
|
|
13632
|
+
/**
|
|
13633
|
+
* @param assetId - omitted for the header's sizing twin, which is inert and never announced.
|
|
13634
|
+
*/
|
|
13635
|
+
renderActionButton(assetId) {
|
|
13636
|
+
const isPlaceholder = assetId === void 0;
|
|
13637
|
+
const isBusy = !isPlaceholder && assetId === this.busyAssetId;
|
|
13638
|
+
return b`
|
|
13639
|
+
<cx-button
|
|
13640
|
+
class=${e$5({
|
|
13641
|
+
"content-browser-table__action": true,
|
|
13642
|
+
"content-browser-table__action--busy": isBusy,
|
|
13643
|
+
"content-browser-table__action--placeholder": isPlaceholder
|
|
13644
|
+
})}
|
|
13645
|
+
data-id=${o$4(assetId)}
|
|
13646
|
+
size="small"
|
|
13647
|
+
variant="primary"
|
|
13648
|
+
tabindex="-1"
|
|
13649
|
+
?loading=${isBusy}
|
|
13650
|
+
aria-hidden=${isPlaceholder ? "true" : "false"}
|
|
13651
|
+
@click=${isPlaceholder ? A : this.handleActionClick}
|
|
13652
|
+
>
|
|
13653
|
+
<span style=${o$1({ textTransform: this.ctaTextTransform })}>
|
|
13654
|
+
${this.ctaText || this.localize.term("insert")}
|
|
13655
|
+
</span>
|
|
13656
|
+
</cx-button>
|
|
13657
|
+
`;
|
|
13658
|
+
}
|
|
13659
|
+
/**
|
|
13660
|
+
* Bound fresh on every render at the call site, deliberately. `lit-virtualizer` re-runs this only
|
|
13661
|
+
* when `items` or `renderItem` change identity, and the selected id lives on neither — with a
|
|
13662
|
+
* stable reference the rows keep their first render and the selected row is never marked. A new
|
|
13663
|
+
* `items` array alone does not do it; the function identity is what the virtualizer acts on.
|
|
13664
|
+
*/
|
|
13665
|
+
renderRow(asset) {
|
|
13666
|
+
if (!asset) {
|
|
13667
|
+
return A;
|
|
13668
|
+
}
|
|
13669
|
+
return b`
|
|
13670
|
+
<div
|
|
13671
|
+
class=${e$5({
|
|
13672
|
+
"content-browser-table__row": true,
|
|
13673
|
+
"content-browser-table__row--disabled": Boolean(asset.inColdStorage),
|
|
13674
|
+
"content-browser-table__row--selected": asset.id === this.selectedAssetId
|
|
13675
|
+
})}
|
|
13676
|
+
data-id=${asset.id}
|
|
13677
|
+
role="row"
|
|
13678
|
+
tabindex=${asset.inColdStorage ? -1 : 0}
|
|
13679
|
+
aria-current=${asset.id === this.selectedAssetId ? "true" : "false"}
|
|
13680
|
+
style=${o$1({
|
|
13681
|
+
"min-height": `${ROW_HEIGHT}px`
|
|
13682
|
+
})}
|
|
13683
|
+
@click=${this.handleRowClick}
|
|
13684
|
+
@keydown=${this.handleRowKeyDown}
|
|
13685
|
+
>
|
|
13686
|
+
${c$1(
|
|
13687
|
+
this.columns,
|
|
13688
|
+
(column, index) => `${column.field}:${index}`,
|
|
13689
|
+
(column) => {
|
|
13690
|
+
var _a2;
|
|
13691
|
+
return b`
|
|
13692
|
+
<div
|
|
13693
|
+
class=${e$5({
|
|
13694
|
+
"content-browser-table__cell": true,
|
|
13695
|
+
[`content-browser-table__cell--${column.align}`]: Boolean(column.align)
|
|
13696
|
+
})}
|
|
13697
|
+
role="cell"
|
|
13698
|
+
>
|
|
13699
|
+
<cx-line-clamp lines=${(_a2 = column.lines) != null ? _a2 : 1}>
|
|
13700
|
+
<cx-typography variant="body3">${readCellValue(asset, column.field)}</cx-typography>
|
|
13701
|
+
</cx-line-clamp>
|
|
13702
|
+
</div>
|
|
13703
|
+
`;
|
|
13704
|
+
}
|
|
13705
|
+
)}
|
|
13706
|
+
<div class="content-browser-table__cell content-browser-table__cell--action" role="cell">
|
|
13707
|
+
${this.renderActionButton(asset.id)}
|
|
13708
|
+
</div>
|
|
13709
|
+
</div>
|
|
12693
13710
|
`;
|
|
12694
13711
|
}
|
|
13712
|
+
handleScroll(event) {
|
|
13713
|
+
const container = event.target;
|
|
13714
|
+
this.scrollAnchorController.capture(container);
|
|
13715
|
+
const scrolledVertically = container.scrollTop !== __privateGet$1(this, _lastScrollTop);
|
|
13716
|
+
__privateSet$1(this, _lastScrollTop, container.scrollTop);
|
|
13717
|
+
if (!scrolledVertically) {
|
|
13718
|
+
return;
|
|
13719
|
+
}
|
|
13720
|
+
if (container.scrollTop + container.clientHeight >= container.scrollHeight - 10) {
|
|
13721
|
+
this.debouncedHandleScrollEnd();
|
|
13722
|
+
}
|
|
13723
|
+
}
|
|
13724
|
+
handleScrollEnd() {
|
|
13725
|
+
if (this.hasMore) {
|
|
13726
|
+
this.emit("cx-content-browser-grid-scroll-end");
|
|
13727
|
+
}
|
|
13728
|
+
}
|
|
12695
13729
|
render() {
|
|
12696
|
-
const containerClasses = {
|
|
12697
|
-
container: true,
|
|
12698
|
-
"container--bordered": this.bordered
|
|
12699
|
-
};
|
|
12700
13730
|
return b`
|
|
12701
|
-
<
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
|
|
13731
|
+
<div
|
|
13732
|
+
class="content-browser-table-loading"
|
|
13733
|
+
style=${o$1({
|
|
13734
|
+
opacity: this.loading ? 1 : 0
|
|
13735
|
+
})}
|
|
13736
|
+
>
|
|
13737
|
+
<cx-progress-bar indeterminate></cx-progress-bar>
|
|
13738
|
+
</div>
|
|
13739
|
+
<cx-resize-observer @cx-resize=${this.handleResize}>
|
|
13740
|
+
<div
|
|
13741
|
+
class="content-browser-table"
|
|
13742
|
+
role="table"
|
|
13743
|
+
@scroll=${this.handleScroll}
|
|
13744
|
+
>
|
|
13745
|
+
<div class="content-browser-table__head" role="rowgroup">
|
|
13746
|
+
<div
|
|
13747
|
+
class="content-browser-table__header"
|
|
13748
|
+
role="row"
|
|
13749
|
+
>
|
|
13750
|
+
${c$1(
|
|
13751
|
+
this.columns,
|
|
13752
|
+
(column) => column.field,
|
|
13753
|
+
(column) => b`
|
|
13754
|
+
<div
|
|
13755
|
+
class=${e$5({
|
|
13756
|
+
"content-browser-table__cell": true,
|
|
13757
|
+
[`content-browser-table__cell--${column.align}`]: Boolean(column.align)
|
|
13758
|
+
})}
|
|
13759
|
+
role="columnheader"
|
|
13760
|
+
data-field=${column.field}
|
|
13761
|
+
>
|
|
13762
|
+
<cx-line-clamp lines="1">
|
|
13763
|
+
<cx-typography variant="small">${column.title}</cx-typography>
|
|
13764
|
+
</cx-line-clamp>
|
|
13765
|
+
${this.renderResizeHandle(column)}
|
|
13766
|
+
</div>
|
|
13767
|
+
`
|
|
13768
|
+
)}
|
|
13769
|
+
<div
|
|
13770
|
+
class="content-browser-table__cell content-browser-table__cell--action"
|
|
13771
|
+
role="columnheader"
|
|
13772
|
+
aria-label=${this.ctaText || this.localize.term("insert")}
|
|
13773
|
+
>
|
|
13774
|
+
${this.renderActionButton(void 0)}
|
|
13775
|
+
</div>
|
|
13776
|
+
</div>
|
|
12707
13777
|
</div>
|
|
12708
|
-
|
|
12709
|
-
|
|
12710
|
-
${n$5(
|
|
12711
|
-
this.showCloseButton,
|
|
13778
|
+
${n$5(
|
|
13779
|
+
this.empty,
|
|
12712
13780
|
() => b`
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
13781
|
+
<cx-content-browser-no-result
|
|
13782
|
+
class="content-browser-table__empty"
|
|
13783
|
+
icon="search_off"
|
|
13784
|
+
message=${this.localize.term("noResults")}
|
|
13785
|
+
></cx-content-browser-no-result>
|
|
13786
|
+
`,
|
|
13787
|
+
// Deliberately not a `scroller`: the table container scrolls both axes, so the
|
|
13788
|
+
// virtualizer sizes itself to the whole list and reacts to that ancestor's scrolling.
|
|
13789
|
+
// One scrollport is what keeps the header and the rows on one horizontal offset.
|
|
13790
|
+
() => b`
|
|
13791
|
+
<lit-virtualizer
|
|
13792
|
+
class="content-browser-table__body"
|
|
13793
|
+
role="rowgroup"
|
|
13794
|
+
.items=${this.assets}
|
|
13795
|
+
.renderItem=${(asset) => this.renderRow(asset)}
|
|
13796
|
+
></lit-virtualizer>
|
|
13797
|
+
`
|
|
12720
13798
|
)}
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
<slot></slot>
|
|
12724
|
-
</cx-space>
|
|
13799
|
+
</div>
|
|
13800
|
+
</cx-resize-observer>
|
|
12725
13801
|
`;
|
|
12726
13802
|
}
|
|
12727
13803
|
};
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
"cx-
|
|
13804
|
+
_lastHeight = /* @__PURE__ */ new WeakMap();
|
|
13805
|
+
_lastScrollTop = /* @__PURE__ */ new WeakMap();
|
|
13806
|
+
_resize = /* @__PURE__ */ new WeakMap();
|
|
13807
|
+
_fallbackListeners = /* @__PURE__ */ new WeakMap();
|
|
13808
|
+
CxContentBrowserTable.styles = [componentStyles, styles$1];
|
|
13809
|
+
CxContentBrowserTable.dependencies = {
|
|
13810
|
+
"cx-button": CxButton,
|
|
13811
|
+
"cx-content-browser-no-result": CxContentBrowserNoResult,
|
|
12735
13812
|
"cx-line-clamp": CxLineClamp,
|
|
12736
|
-
"cx-
|
|
12737
|
-
"cx-
|
|
12738
|
-
"cx-skeleton": CxSkeleton,
|
|
12739
|
-
"cx-space": CxSpace,
|
|
13813
|
+
"cx-progress-bar": CxProgressBar,
|
|
13814
|
+
"cx-resize-observer": CxResizeObserver,
|
|
12740
13815
|
"cx-typography": CxTypography
|
|
12741
13816
|
};
|
|
12742
13817
|
__decorateClass$1([
|
|
12743
|
-
|
|
12744
|
-
],
|
|
13818
|
+
e$7(".content-browser-table")
|
|
13819
|
+
], CxContentBrowserTable.prototype, "containerEl", 2);
|
|
12745
13820
|
__decorateClass$1([
|
|
12746
|
-
|
|
12747
|
-
],
|
|
13821
|
+
e$7(".content-browser-table__head")
|
|
13822
|
+
], CxContentBrowserTable.prototype, "headEl", 2);
|
|
12748
13823
|
__decorateClass$1([
|
|
12749
|
-
|
|
12750
|
-
],
|
|
13824
|
+
e$7("lit-virtualizer")
|
|
13825
|
+
], CxContentBrowserTable.prototype, "bodyEl", 2);
|
|
12751
13826
|
__decorateClass$1([
|
|
12752
|
-
n$6({ attribute: "
|
|
12753
|
-
],
|
|
13827
|
+
n$6({ attribute: "assets", reflect: false, type: Array })
|
|
13828
|
+
], CxContentBrowserTable.prototype, "assets", 2);
|
|
12754
13829
|
__decorateClass$1([
|
|
12755
|
-
n$6({ attribute: "
|
|
12756
|
-
],
|
|
13830
|
+
n$6({ attribute: "columns", reflect: false, type: Array })
|
|
13831
|
+
], CxContentBrowserTable.prototype, "columns", 2);
|
|
12757
13832
|
__decorateClass$1([
|
|
12758
|
-
n$6({ attribute: "
|
|
12759
|
-
],
|
|
13833
|
+
n$6({ attribute: "cta-text", reflect: false, type: String })
|
|
13834
|
+
], CxContentBrowserTable.prototype, "ctaText", 2);
|
|
12760
13835
|
__decorateClass$1([
|
|
12761
|
-
n$6({ attribute: "
|
|
12762
|
-
],
|
|
13836
|
+
n$6({ attribute: "cta-text-transform", reflect: false, type: String })
|
|
13837
|
+
], CxContentBrowserTable.prototype, "ctaTextTransform", 2);
|
|
12763
13838
|
__decorateClass$1([
|
|
12764
|
-
n$6({ attribute: "
|
|
12765
|
-
],
|
|
13839
|
+
n$6({ attribute: "empty", reflect: true, type: Boolean })
|
|
13840
|
+
], CxContentBrowserTable.prototype, "empty", 2);
|
|
12766
13841
|
__decorateClass$1([
|
|
12767
|
-
n$6({ attribute: "
|
|
12768
|
-
],
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
],
|
|
13842
|
+
n$6({ attribute: "has-more", reflect: true, type: Boolean })
|
|
13843
|
+
], CxContentBrowserTable.prototype, "hasMore", 2);
|
|
13844
|
+
__decorateClass$1([
|
|
13845
|
+
n$6({ attribute: "loading", reflect: true, type: Boolean })
|
|
13846
|
+
], CxContentBrowserTable.prototype, "loading", 2);
|
|
13847
|
+
__decorateClass$1([
|
|
13848
|
+
n$6({ attribute: "selected-asset-id", reflect: true, type: String })
|
|
13849
|
+
], CxContentBrowserTable.prototype, "selectedAssetId", 2);
|
|
13850
|
+
__decorateClass$1([
|
|
13851
|
+
n$6({ attribute: false })
|
|
13852
|
+
], CxContentBrowserTable.prototype, "busyAssetId", 2);
|
|
13853
|
+
__decorateClass$1([
|
|
13854
|
+
r$6()
|
|
13855
|
+
], CxContentBrowserTable.prototype, "assetMap", 2);
|
|
13856
|
+
__decorateClass$1([
|
|
13857
|
+
r$6()
|
|
13858
|
+
], CxContentBrowserTable.prototype, "columnWidths", 2);
|
|
13859
|
+
__decorateClass$1([
|
|
13860
|
+
watch("columns", { waitUntilFirstUpdate: true })
|
|
13861
|
+
], CxContentBrowserTable.prototype, "handleColumnsChange", 1);
|
|
13862
|
+
__decorateClass$1([
|
|
13863
|
+
watch("assets")
|
|
13864
|
+
], CxContentBrowserTable.prototype, "handleAssetsChange", 1);
|
|
13865
|
+
CxContentBrowserTable = __decorateClass$1([
|
|
13866
|
+
customElement("cx-content-browser-table")
|
|
13867
|
+
], CxContentBrowserTable);
|
|
12772
13868
|
const appendPathAndQuery = (baseUrl, pathSuffix, extraQueryParams = []) => {
|
|
12773
13869
|
const questionMarkIndex = baseUrl.indexOf("?");
|
|
12774
13870
|
const hashIndex = baseUrl.indexOf("#");
|
|
@@ -13157,8 +14253,26 @@ function apiGetAssetsByIDs(_0) {
|
|
|
13157
14253
|
}
|
|
13158
14254
|
});
|
|
13159
14255
|
}
|
|
14256
|
+
const ASSET_LIST_FIELDS = [
|
|
14257
|
+
DEFAULT_VIEW_SIZE,
|
|
14258
|
+
FIELD_DOC_TYPE,
|
|
14259
|
+
FIELD_EXTENSION,
|
|
14260
|
+
FIELD_FILE_SIZE,
|
|
14261
|
+
FIELD_IDENTIFIER,
|
|
14262
|
+
FIELD_KEYWORDS,
|
|
14263
|
+
FIELD_MAX_HEIGHT,
|
|
14264
|
+
FIELD_MAX_WIDTH,
|
|
14265
|
+
FIELD_ORIGINAL_FILE_NAME,
|
|
14266
|
+
FIELD_RECORD_ID,
|
|
14267
|
+
FIELD_SUBTYPE,
|
|
14268
|
+
FIELD_TITLE_WITH_FALLBACK,
|
|
14269
|
+
FIELD_UPDATED_FILE_NAME,
|
|
14270
|
+
FIELD_STORAGE_GROUP,
|
|
14271
|
+
ORIGINAL_VIEW_SIZE
|
|
14272
|
+
];
|
|
13160
14273
|
function apiGetAssets(_0) {
|
|
13161
14274
|
return __async(this, arguments, function* ({
|
|
14275
|
+
fields,
|
|
13162
14276
|
folderId,
|
|
13163
14277
|
isSeeThrough,
|
|
13164
14278
|
limitedToDocTypes = [],
|
|
@@ -13169,25 +14283,17 @@ function apiGetAssets(_0) {
|
|
|
13169
14283
|
start,
|
|
13170
14284
|
useSession
|
|
13171
14285
|
}) {
|
|
14286
|
+
var _a2;
|
|
14287
|
+
const validatedFields = (_a2 = fields == null ? void 0 : fields.filter((field) => field && typeof field === "string")) != null ? _a2 : [];
|
|
13172
14288
|
try {
|
|
13173
14289
|
const response = yield http.request({
|
|
13174
14290
|
data: __spreadValues({
|
|
13175
14291
|
Fields: [
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
FIELD_KEYWORDS,
|
|
13182
|
-
FIELD_MAX_HEIGHT,
|
|
13183
|
-
FIELD_MAX_WIDTH,
|
|
13184
|
-
FIELD_ORIGINAL_FILE_NAME,
|
|
13185
|
-
FIELD_RECORD_ID,
|
|
13186
|
-
FIELD_SUBTYPE,
|
|
13187
|
-
FIELD_TITLE_WITH_FALLBACK,
|
|
13188
|
-
FIELD_UPDATED_FILE_NAME,
|
|
13189
|
-
FIELD_STORAGE_GROUP,
|
|
13190
|
-
ORIGINAL_VIEW_SIZE
|
|
14292
|
+
...ASSET_LIST_FIELDS,
|
|
14293
|
+
...validatedFields.filter((field, index) => {
|
|
14294
|
+
const seen = [...ASSET_LIST_FIELDS, ...validatedFields.slice(0, index)];
|
|
14295
|
+
return !seen.some((item) => item.toLowerCase() === field.toLowerCase());
|
|
14296
|
+
})
|
|
13191
14297
|
],
|
|
13192
14298
|
Limit: pageSize || void 0,
|
|
13193
14299
|
LimitedToDocTypes: limitedToDocTypes,
|
|
@@ -13203,15 +14309,22 @@ function apiGetAssets(_0) {
|
|
|
13203
14309
|
transformResponse: [
|
|
13204
14310
|
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
13205
14311
|
(rawResponse) => {
|
|
13206
|
-
var
|
|
13207
|
-
const mappedItems = (_b2 = (
|
|
13208
|
-
var
|
|
13209
|
-
let extension = (
|
|
14312
|
+
var _a3, _b2;
|
|
14313
|
+
const mappedItems = (_b2 = (_a3 = rawResponse.contentItems) == null ? void 0 : _a3.map((item) => {
|
|
14314
|
+
var _a4, _b3, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l;
|
|
14315
|
+
let extension = (_a4 = item.fields[FIELD_EXTENSION]) != null ? _a4 : "";
|
|
13210
14316
|
const name = item.fields[FIELD_TITLE_WITH_FALLBACK];
|
|
13211
14317
|
if (extension && !extension.startsWith(".")) {
|
|
13212
14318
|
extension = "." + extension;
|
|
13213
14319
|
}
|
|
13214
|
-
return {
|
|
14320
|
+
return __spreadProps(__spreadValues({}, validatedFields.reduce((acc, field) => {
|
|
14321
|
+
var _a5, _b4;
|
|
14322
|
+
const sourceField = (_a5 = ASSET_LIST_FIELDS.find(
|
|
14323
|
+
(defaultField) => defaultField.toLowerCase() === field.toLowerCase()
|
|
14324
|
+
)) != null ? _a5 : field;
|
|
14325
|
+
acc[field] = (_b4 = item.fields[sourceField]) != null ? _b4 : "";
|
|
14326
|
+
return acc;
|
|
14327
|
+
}, {})), {
|
|
13215
14328
|
allowATSLink: item.fields[FIELD_ALLOW_ATS_LINK] === "True",
|
|
13216
14329
|
docSubType: (_b3 = item.fields[FIELD_SUBTYPE]) != null ? _b3 : "",
|
|
13217
14330
|
docType: (_c2 = item.fields[FIELD_DOC_TYPE]) != null ? _c2 : "",
|
|
@@ -13228,7 +14341,7 @@ function apiGetAssets(_0) {
|
|
|
13228
14341
|
size: (_j = item.fields[FIELD_FILE_SIZE]) != null ? _j : "0 MB",
|
|
13229
14342
|
tags: (_k = item.fields[FIELD_KEYWORDS]) != null ? _k : "",
|
|
13230
14343
|
width: (_l = item.fields[FIELD_MAX_WIDTH]) != null ? _l : "0"
|
|
13231
|
-
};
|
|
14344
|
+
});
|
|
13232
14345
|
})) != null ? _b2 : [];
|
|
13233
14346
|
return {
|
|
13234
14347
|
facets: rawResponse.facets,
|
|
@@ -13703,6 +14816,7 @@ var intersection = baseRest(function(arrays) {
|
|
|
13703
14816
|
});
|
|
13704
14817
|
class FetchAndMergeAssetsController {
|
|
13705
14818
|
constructor(host, {
|
|
14819
|
+
additionalFields,
|
|
13706
14820
|
availableDocTypes,
|
|
13707
14821
|
baseUrl,
|
|
13708
14822
|
defaultFolderId,
|
|
@@ -13744,6 +14858,7 @@ class FetchAndMergeAssetsController {
|
|
|
13744
14858
|
this._debounceResolve = null;
|
|
13745
14859
|
this.host = host;
|
|
13746
14860
|
this.availableDocTypes = availableDocTypes;
|
|
14861
|
+
this.additionalFields = additionalFields != null ? additionalFields : [];
|
|
13747
14862
|
this.defaultFolderId = defaultFolderId;
|
|
13748
14863
|
this.defaultIsSeeThrough = defaultIsSeeThrough;
|
|
13749
14864
|
this.defaultSearchText = defaultSearchText;
|
|
@@ -13874,6 +14989,14 @@ class FetchAndMergeAssetsController {
|
|
|
13874
14989
|
}
|
|
13875
14990
|
this.host.requestUpdate();
|
|
13876
14991
|
}
|
|
14992
|
+
/**
|
|
14993
|
+
* Table columns are host configuration and can be reconfigured after mount, unlike the rest of
|
|
14994
|
+
* these options — every later fetch must ask for the current field list, not the one that
|
|
14995
|
+
* happened to be set when the controller was constructed.
|
|
14996
|
+
*/
|
|
14997
|
+
updateAdditionalFields(additionalFields) {
|
|
14998
|
+
this.additionalFields = additionalFields;
|
|
14999
|
+
}
|
|
13877
15000
|
updateAuth(token, useSession) {
|
|
13878
15001
|
if (this.useSiteSession) {
|
|
13879
15002
|
return;
|
|
@@ -14014,6 +15137,7 @@ class FetchAndMergeAssetsController {
|
|
|
14014
15137
|
}
|
|
14015
15138
|
}
|
|
14016
15139
|
request = __spreadProps(__spreadValues({}, request), {
|
|
15140
|
+
fields: this.additionalFields,
|
|
14017
15141
|
limitedToDocTypes: this.availableDocTypes
|
|
14018
15142
|
});
|
|
14019
15143
|
this.lastRequest = request;
|
|
@@ -14281,6 +15405,9 @@ const styles = i$7`
|
|
|
14281
15405
|
`;
|
|
14282
15406
|
var __defProp2 = Object.defineProperty;
|
|
14283
15407
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15408
|
+
var __typeError2 = (msg) => {
|
|
15409
|
+
throw TypeError(msg);
|
|
15410
|
+
};
|
|
14284
15411
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
14285
15412
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
14286
15413
|
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
@@ -14289,10 +15416,26 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
14289
15416
|
if (kind && result) __defProp2(target, key, result);
|
|
14290
15417
|
return result;
|
|
14291
15418
|
};
|
|
15419
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
15420
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), member.get(obj));
|
|
15421
|
+
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
15422
|
+
var __privateSet2 = (obj, member, value, setter) => (__accessCheck2(obj, member, "write to private field"), member.set(obj, value), value);
|
|
15423
|
+
var _openingAsset, _insertInFlight;
|
|
14292
15424
|
const COMPUTED_FIELDS = ["ScrubUrl", "AllowATSLink"];
|
|
14293
15425
|
const MOBILE_WIDTH_THRESHOLD = 480;
|
|
14294
15426
|
const FORCE_OVERLAY_THRESHOLD = 650;
|
|
14295
15427
|
const PERSISTENT_DRAWER_WIDTH = 400;
|
|
15428
|
+
function resolvePageSize(view) {
|
|
15429
|
+
switch (view) {
|
|
15430
|
+
case GridView.Large:
|
|
15431
|
+
return 15;
|
|
15432
|
+
case GridView.Small:
|
|
15433
|
+
case TABLE_VIEW:
|
|
15434
|
+
return 30;
|
|
15435
|
+
default:
|
|
15436
|
+
return 20;
|
|
15437
|
+
}
|
|
15438
|
+
}
|
|
14296
15439
|
let CxContentBrowser = class extends CortexElement {
|
|
14297
15440
|
constructor() {
|
|
14298
15441
|
super(...arguments);
|
|
@@ -14318,6 +15461,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14318
15461
|
this.canFavorite = false;
|
|
14319
15462
|
this.canPinAsset = false;
|
|
14320
15463
|
this.canUseProxies = false;
|
|
15464
|
+
this.autoSelectFormat = false;
|
|
14321
15465
|
this.simplePick = false;
|
|
14322
15466
|
this.canViewVersions = false;
|
|
14323
15467
|
this.canTrack = false;
|
|
@@ -14326,6 +15470,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14326
15470
|
this.ctaTextTransform = "capitalize";
|
|
14327
15471
|
this.extraFields = [];
|
|
14328
15472
|
this.defaultGridView = GridView.Medium;
|
|
15473
|
+
this.tableColumns = [];
|
|
14329
15474
|
this.defaultSortOrderName = "";
|
|
14330
15475
|
this.defaultSortDirection = "ascending";
|
|
14331
15476
|
this.defaultSelectedFacets = {};
|
|
@@ -14363,28 +15508,40 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14363
15508
|
this.selectedAssetId = void 0;
|
|
14364
15509
|
this.isMobile = false;
|
|
14365
15510
|
this.defaultPageSize = 10;
|
|
15511
|
+
this.busyAssetId = void 0;
|
|
15512
|
+
__privateAdd2(this, _openingAsset, false);
|
|
15513
|
+
__privateAdd2(this, _insertInFlight, false);
|
|
14366
15514
|
}
|
|
14367
15515
|
willUpdate(changedProperties) {
|
|
14368
15516
|
super.willUpdate(changedProperties);
|
|
14369
15517
|
if (!this.hasUpdated) {
|
|
14370
|
-
this.view = this.defaultGridView;
|
|
15518
|
+
this.view = this.defaultGridView === TABLE_VIEW && !this.canUseTable ? GridView.Medium : this.defaultGridView;
|
|
15519
|
+
}
|
|
15520
|
+
}
|
|
15521
|
+
/**
|
|
15522
|
+
* Never trust the host's value: it also arrives by direct property assignment, past the converter.
|
|
15523
|
+
* Entries are checked one by one, not just the outer array — `field` is dereferenced while the
|
|
15524
|
+
* fetch controller is being built, where a throw leaves the controller unassigned and the picker
|
|
15525
|
+
* blank. `title` is only rendered, and Lit renders a nullish one as nothing, so a column is not
|
|
15526
|
+
* worth dropping over it.
|
|
15527
|
+
*/
|
|
15528
|
+
get tableColumnList() {
|
|
15529
|
+
const columns = this.tableColumns;
|
|
15530
|
+
if (!Array.isArray(columns)) {
|
|
15531
|
+
return [];
|
|
14371
15532
|
}
|
|
15533
|
+
return columns.filter((column) => {
|
|
15534
|
+
return !!column && typeof column === "object" && typeof column.field === "string" && column.field.length > 0;
|
|
15535
|
+
});
|
|
15536
|
+
}
|
|
15537
|
+
get canUseTable() {
|
|
15538
|
+
return this.tableColumnList.length > 0;
|
|
14372
15539
|
}
|
|
14373
15540
|
runFirstUpdated() {
|
|
14374
15541
|
if (this.useSiteSession) {
|
|
14375
15542
|
this.baseUrl = resolveSiteSessionUrl(this.baseUrl);
|
|
14376
15543
|
}
|
|
14377
|
-
|
|
14378
|
-
case GridView.Large:
|
|
14379
|
-
this.defaultPageSize = 15;
|
|
14380
|
-
break;
|
|
14381
|
-
case GridView.Medium:
|
|
14382
|
-
this.defaultPageSize = 20;
|
|
14383
|
-
break;
|
|
14384
|
-
case GridView.Small:
|
|
14385
|
-
this.defaultPageSize = 30;
|
|
14386
|
-
break;
|
|
14387
|
-
}
|
|
15544
|
+
this.defaultPageSize = resolvePageSize(this.view);
|
|
14388
15545
|
this.lastRequest = __spreadProps(__spreadValues({}, this.lastRequest), {
|
|
14389
15546
|
folderId: this.defaultFolderId,
|
|
14390
15547
|
isSeeThrough: this.defaultIsSeeThrough,
|
|
@@ -14395,6 +15552,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14395
15552
|
});
|
|
14396
15553
|
this.updateComplete.then(() => {
|
|
14397
15554
|
this.fetchAndMergeAssetsController = new FetchAndMergeAssetsController(this, {
|
|
15555
|
+
additionalFields: this.tableColumnList.map((column) => column.field),
|
|
14398
15556
|
availableDocTypes: this.availableDocTypes,
|
|
14399
15557
|
baseUrl: this.baseUrl,
|
|
14400
15558
|
defaultFolderId: this.defaultFolderId,
|
|
@@ -14434,7 +15592,12 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14434
15592
|
}
|
|
14435
15593
|
openFormatDialog(id) {
|
|
14436
15594
|
return __async(this, null, function* () {
|
|
15595
|
+
if (__privateGet2(this, _openingAsset) || __privateGet2(this, _insertInFlight)) {
|
|
15596
|
+
return;
|
|
15597
|
+
}
|
|
15598
|
+
__privateSet2(this, _openingAsset, true);
|
|
14437
15599
|
this.selectedAssetId = id;
|
|
15600
|
+
this.busyAssetId = id;
|
|
14438
15601
|
try {
|
|
14439
15602
|
const asset = yield this.fetchAndMergeAssetsController.fetchAssetByID(id, {
|
|
14440
15603
|
canFavorite: this.canFavorite,
|
|
@@ -14442,6 +15605,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14442
15605
|
});
|
|
14443
15606
|
if (!asset) {
|
|
14444
15607
|
this.selectedAssetId = void 0;
|
|
15608
|
+
this.busyAssetId = void 0;
|
|
14445
15609
|
return;
|
|
14446
15610
|
}
|
|
14447
15611
|
let isAssetPinned = false;
|
|
@@ -14452,8 +15616,14 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14452
15616
|
isAssetPinned = lookupEvent.detail.isAssetPinned;
|
|
14453
15617
|
}
|
|
14454
15618
|
this.formatDialog.open(__spreadProps(__spreadValues({}, asset), { isAssetPinned }));
|
|
15619
|
+
if (this.formatDialog.isDialogOpen) {
|
|
15620
|
+
this.busyAssetId = void 0;
|
|
15621
|
+
}
|
|
14455
15622
|
} catch (e2) {
|
|
14456
15623
|
this.selectedAssetId = void 0;
|
|
15624
|
+
this.busyAssetId = void 0;
|
|
15625
|
+
} finally {
|
|
15626
|
+
__privateSet2(this, _openingAsset, false);
|
|
14457
15627
|
}
|
|
14458
15628
|
});
|
|
14459
15629
|
}
|
|
@@ -14467,6 +15637,16 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14467
15637
|
});
|
|
14468
15638
|
});
|
|
14469
15639
|
}
|
|
15640
|
+
handleTableColumnsChange() {
|
|
15641
|
+
if (!this.fetchAndMergeAssetsController) {
|
|
15642
|
+
return;
|
|
15643
|
+
}
|
|
15644
|
+
this.fetchAndMergeAssetsController.updateAdditionalFields(
|
|
15645
|
+
this.tableColumnList.map((column) => column.field)
|
|
15646
|
+
);
|
|
15647
|
+
this.lastRequest = __spreadProps(__spreadValues({}, this.lastRequest), { start: 0 });
|
|
15648
|
+
void this.fetchAndMergeAssetsController.fetchAndMergeAssets(this.lastRequest);
|
|
15649
|
+
}
|
|
14470
15650
|
handleAuthChange() {
|
|
14471
15651
|
var _a2;
|
|
14472
15652
|
(_a2 = this.fetchAndMergeAssetsController) == null ? void 0 : _a2.updateAuth(this.token, this.useSession);
|
|
@@ -14524,17 +15704,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14524
15704
|
});
|
|
14525
15705
|
yield this.fetchAndMergeAssetsController.fetchAndMergeAssets(this.lastRequest);
|
|
14526
15706
|
}
|
|
14527
|
-
|
|
14528
|
-
case GridView.Large:
|
|
14529
|
-
this.defaultPageSize = 15;
|
|
14530
|
-
break;
|
|
14531
|
-
case GridView.Medium:
|
|
14532
|
-
this.defaultPageSize = 20;
|
|
14533
|
-
break;
|
|
14534
|
-
case GridView.Small:
|
|
14535
|
-
this.defaultPageSize = 30;
|
|
14536
|
-
break;
|
|
14537
|
-
}
|
|
15707
|
+
this.defaultPageSize = resolvePageSize(event.detail.view);
|
|
14538
15708
|
this.view = event.detail.view;
|
|
14539
15709
|
});
|
|
14540
15710
|
}
|
|
@@ -14654,15 +15824,17 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14654
15824
|
selectedProxyMetadata: event.detail.selectedProxyMetadata
|
|
14655
15825
|
});
|
|
14656
15826
|
this.formatDialog.hide();
|
|
15827
|
+
this.busyAssetId = void 0;
|
|
14657
15828
|
return;
|
|
14658
15829
|
}
|
|
15830
|
+
__privateSet2(this, _insertInFlight, true);
|
|
14659
15831
|
try {
|
|
14660
15832
|
const response = yield this.fetchAndMergeAssetsController.getAssetLink(__spreadProps(__spreadValues({}, event.detail), {
|
|
14661
15833
|
assets: [event.detail.asset],
|
|
14662
15834
|
extraFields: this.extraFields
|
|
14663
15835
|
}));
|
|
14664
15836
|
if (response.isError) {
|
|
14665
|
-
this.
|
|
15837
|
+
this.reportProxyConfirmFailure();
|
|
14666
15838
|
return;
|
|
14667
15839
|
}
|
|
14668
15840
|
this.handleSelectedAsset({
|
|
@@ -14672,12 +15844,23 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14672
15844
|
});
|
|
14673
15845
|
this.formatDialog.hide();
|
|
14674
15846
|
} catch (e2) {
|
|
14675
|
-
this.
|
|
15847
|
+
this.reportProxyConfirmFailure();
|
|
15848
|
+
} finally {
|
|
15849
|
+
__privateSet2(this, _insertInFlight, false);
|
|
15850
|
+
this.busyAssetId = void 0;
|
|
14676
15851
|
}
|
|
14677
15852
|
});
|
|
14678
15853
|
}
|
|
15854
|
+
reportProxyConfirmFailure() {
|
|
15855
|
+
if (this.formatDialog.isDialogOpen) {
|
|
15856
|
+
this.formatDialog.setLoadingConfirm(false);
|
|
15857
|
+
return;
|
|
15858
|
+
}
|
|
15859
|
+
this.formatDialog.revealAfterAutoConfirm();
|
|
15860
|
+
}
|
|
14679
15861
|
handleFormatConfirm(event) {
|
|
14680
15862
|
return __async(this, null, function* () {
|
|
15863
|
+
__privateSet2(this, _insertInFlight, true);
|
|
14681
15864
|
try {
|
|
14682
15865
|
const response = yield this.fetchAndMergeAssetsController.getAssetLink(__spreadProps(__spreadValues({}, event.detail), {
|
|
14683
15866
|
assets: [event.detail.asset],
|
|
@@ -14696,6 +15879,9 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14696
15879
|
this.formatDialog.hide();
|
|
14697
15880
|
} catch (e2) {
|
|
14698
15881
|
this.formatDialog.setLoadingConfirm(false);
|
|
15882
|
+
} finally {
|
|
15883
|
+
__privateSet2(this, _insertInFlight, false);
|
|
15884
|
+
this.busyAssetId = void 0;
|
|
14699
15885
|
}
|
|
14700
15886
|
});
|
|
14701
15887
|
}
|
|
@@ -14841,6 +16027,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14841
16027
|
.newlyChangedOption=${this.newlyChangedOption}
|
|
14842
16028
|
.sortOrders=${sortOrders}
|
|
14843
16029
|
.views=${this.views}
|
|
16030
|
+
?can-use-table=${this.canUseTable}
|
|
14844
16031
|
?is-mobile=${this.isMobile}
|
|
14845
16032
|
?is-see-through=${request == null ? void 0 : request.isSeeThrough}
|
|
14846
16033
|
?loading=${loading}
|
|
@@ -14856,20 +16043,45 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14856
16043
|
@cx-content-browser-control-filter-change=${this.handleFilterChange}
|
|
14857
16044
|
@cx-content-browser-control-bar-search-change=${this.handleSearchChange}
|
|
14858
16045
|
></cx-content-browser-control-bar>
|
|
14859
|
-
|
|
14860
|
-
|
|
14861
|
-
|
|
14862
|
-
|
|
14863
|
-
|
|
14864
|
-
|
|
14865
|
-
|
|
14866
|
-
|
|
14867
|
-
|
|
14868
|
-
|
|
14869
|
-
|
|
14870
|
-
|
|
14871
|
-
|
|
14872
|
-
|
|
16046
|
+
${n$5(
|
|
16047
|
+
this.view === TABLE_VIEW && this.canUseTable,
|
|
16048
|
+
() => b`
|
|
16049
|
+
<cx-content-browser-table
|
|
16050
|
+
.busyAssetId=${this.busyAssetId}
|
|
16051
|
+
.assets=${items}
|
|
16052
|
+
.columns=${this.tableColumnList}
|
|
16053
|
+
?empty=${!loading && items.length === 0}
|
|
16054
|
+
cta-text=${this.ctaText}
|
|
16055
|
+
cta-text-transform=${this.ctaTextTransform}
|
|
16056
|
+
?has-more=${items.length < totalCount}
|
|
16057
|
+
?loading=${loading}
|
|
16058
|
+
selected-asset-id=${o$4(this.selectedAssetId || void 0)}
|
|
16059
|
+
@cx-content-browser-grid-scroll-end=${this.handleScrollEnd}
|
|
16060
|
+
@cx-content-browser-grid-resize=${this.handleGridResize}
|
|
16061
|
+
@cx-content-browser-grid-click=${this.handleGridClick}
|
|
16062
|
+
></cx-content-browser-table>
|
|
16063
|
+
`,
|
|
16064
|
+
() => b`
|
|
16065
|
+
<cx-content-browser-grid
|
|
16066
|
+
.assets=${items}
|
|
16067
|
+
?has-more=${items.length < totalCount}
|
|
16068
|
+
?loading=${loading}
|
|
16069
|
+
?show-title=${this.showTitle}
|
|
16070
|
+
?show-size=${this.showSize}
|
|
16071
|
+
?show-dimensions=${this.showDimensions}
|
|
16072
|
+
?show-tags=${this.showTags}
|
|
16073
|
+
?show-cta=${isAutoSelectFormatActive(this.autoSelectFormat)}
|
|
16074
|
+
.busyAssetId=${this.busyAssetId}
|
|
16075
|
+
cta-text=${this.ctaText}
|
|
16076
|
+
cta-text-transform=${this.ctaTextTransform}
|
|
16077
|
+
selected-asset-id=${o$4(this.selectedAssetId || void 0)}
|
|
16078
|
+
view=${this.view}
|
|
16079
|
+
@cx-content-browser-grid-scroll-end=${this.handleScrollEnd}
|
|
16080
|
+
@cx-content-browser-grid-resize=${this.handleGridResize}
|
|
16081
|
+
@cx-content-browser-grid-click=${this.handleGridClick}
|
|
16082
|
+
></cx-content-browser-grid>
|
|
16083
|
+
`
|
|
16084
|
+
)}
|
|
14873
16085
|
</cx-resize-observer>
|
|
14874
16086
|
<cx-content-browser-format-dialog
|
|
14875
16087
|
.availableExtensions=${availableExtensions}
|
|
@@ -14882,6 +16094,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14882
16094
|
cta-text-transform=${this.ctaTextTransform}
|
|
14883
16095
|
variant=${this.isMobile ? ContentBrowserFormatDialogVariant.Drawer : ContentBrowserFormatDialogVariant.Dialog}
|
|
14884
16096
|
token=${this.useSiteSession ? "" : this.token}
|
|
16097
|
+
.autoSelectFormat=${this.autoSelectFormat}
|
|
14885
16098
|
?can-custom-format=${!!(parameters == null ? void 0 : parameters.ATSEnabled)}
|
|
14886
16099
|
?can-favorite=${this.canFavorite}
|
|
14887
16100
|
?can-pin-asset=${this.canPinAsset}
|
|
@@ -14901,6 +16114,8 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
14901
16114
|
`;
|
|
14902
16115
|
}
|
|
14903
16116
|
};
|
|
16117
|
+
_openingAsset = /* @__PURE__ */ new WeakMap();
|
|
16118
|
+
_insertInFlight = /* @__PURE__ */ new WeakMap();
|
|
14904
16119
|
CxContentBrowser.styles = [componentStyles, styles];
|
|
14905
16120
|
CxContentBrowser.dependencies = {
|
|
14906
16121
|
"cx-content-browser-browser": CxContentBrowserBrowser,
|
|
@@ -14909,6 +16124,7 @@ CxContentBrowser.dependencies = {
|
|
|
14909
16124
|
"cx-content-browser-grid": CxContentBrowserGrid,
|
|
14910
16125
|
"cx-content-browser-header": CxContentBrowserHeader,
|
|
14911
16126
|
"cx-content-browser-no-result": CxContentBrowserNoResult,
|
|
16127
|
+
"cx-content-browser-table": CxContentBrowserTable,
|
|
14912
16128
|
"cx-icon": CxIcon,
|
|
14913
16129
|
"cx-icon-button": CxIconButton,
|
|
14914
16130
|
"cx-resize-observer": CxResizeObserver,
|
|
@@ -15000,6 +16216,9 @@ __decorateClass([
|
|
|
15000
16216
|
__decorateClass([
|
|
15001
16217
|
n$6({ attribute: "can-use-proxies", reflect: true, type: Boolean })
|
|
15002
16218
|
], CxContentBrowser.prototype, "canUseProxies", 2);
|
|
16219
|
+
__decorateClass([
|
|
16220
|
+
n$6({ attribute: "auto-select-format", converter: autoSelectFormatConverter, reflect: false })
|
|
16221
|
+
], CxContentBrowser.prototype, "autoSelectFormat", 2);
|
|
15003
16222
|
__decorateClass([
|
|
15004
16223
|
n$6({ attribute: "simple-pick", reflect: true, type: Boolean })
|
|
15005
16224
|
], CxContentBrowser.prototype, "simplePick", 2);
|
|
@@ -15032,6 +16251,32 @@ __decorateClass([
|
|
|
15032
16251
|
__decorateClass([
|
|
15033
16252
|
n$6({ attribute: "default-grid-view", type: String })
|
|
15034
16253
|
], CxContentBrowser.prototype, "defaultGridView", 2);
|
|
16254
|
+
__decorateClass([
|
|
16255
|
+
n$6({
|
|
16256
|
+
attribute: "table-columns",
|
|
16257
|
+
/**
|
|
16258
|
+
* Lit's stock Array converter returns `null` for anything `JSON.parse` rejects, and a host that
|
|
16259
|
+
* stringifies an array into the attribute hands it `""` or `"[object Object]"`. `null` then
|
|
16260
|
+
* throws on every read below, taking the whole picker down. An unreadable value means "no
|
|
16261
|
+
* columns", which turns the table view off — the same outcome as not configuring one.
|
|
16262
|
+
*/
|
|
16263
|
+
converter: {
|
|
16264
|
+
fromAttribute: (value) => {
|
|
16265
|
+
if (!value) {
|
|
16266
|
+
return [];
|
|
16267
|
+
}
|
|
16268
|
+
try {
|
|
16269
|
+
const parsed = JSON.parse(value);
|
|
16270
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
16271
|
+
} catch (e2) {
|
|
16272
|
+
return [];
|
|
16273
|
+
}
|
|
16274
|
+
},
|
|
16275
|
+
toAttribute: (value) => JSON.stringify(value != null ? value : [])
|
|
16276
|
+
},
|
|
16277
|
+
type: Array
|
|
16278
|
+
})
|
|
16279
|
+
], CxContentBrowser.prototype, "tableColumns", 2);
|
|
15035
16280
|
__decorateClass([
|
|
15036
16281
|
n$6({ attribute: "default-sort-order-name", type: String })
|
|
15037
16282
|
], CxContentBrowser.prototype, "defaultSortOrderName", 2);
|
|
@@ -15095,9 +16340,15 @@ __decorateClass([
|
|
|
15095
16340
|
__decorateClass([
|
|
15096
16341
|
r$6()
|
|
15097
16342
|
], CxContentBrowser.prototype, "isMobile", 2);
|
|
16343
|
+
__decorateClass([
|
|
16344
|
+
r$6()
|
|
16345
|
+
], CxContentBrowser.prototype, "busyAssetId", 2);
|
|
15098
16346
|
__decorateClass([
|
|
15099
16347
|
watch("lastRequest", { waitUntilFirstUpdate: true })
|
|
15100
16348
|
], CxContentBrowser.prototype, "handleLastRequestChange", 1);
|
|
16349
|
+
__decorateClass([
|
|
16350
|
+
watch("tableColumns", { waitUntilFirstUpdate: true })
|
|
16351
|
+
], CxContentBrowser.prototype, "handleTableColumnsChange", 1);
|
|
15101
16352
|
__decorateClass([
|
|
15102
16353
|
watch(["token", "useSession"], { waitUntilFirstUpdate: true })
|
|
15103
16354
|
], CxContentBrowser.prototype, "handleAuthChange", 1);
|