@orangelogic/design-system 2.79.0 → 2.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library/chunks/{asset.DWZ2Lzb6.js → asset.CVuNAhz3.js} +1 -1
- package/library/chunks/{color-swatch-group.DvllHUil.js → color-swatch-group.o7zyUsbZ.js} +1 -1
- package/library/chunks/{endpoints.B7lcoc1N.js → endpoints.BpAhLyZw.js} +126 -117
- package/library/chunks/{folder-select.DOsefkAC.js → folder-select.D6yLoXWU.js} +146 -120
- package/library/chunks/{list-editor.DNa6ROgr.js → list-editor.Hd2f8A0Y.js} +2 -2
- package/library/chunks/{table.B8LpbiGE.js → table.CLyePLwR.js} +252 -237
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +1 -1
- package/library/components/color-swatch-group.js +2 -2
- package/library/components/folder-select.js +2 -2
- package/library/components/list-editor.js +2 -2
- package/library/components/menu-item.js +1 -1
- package/library/components/molecules.js +2 -2
- package/library/components/organisms.js +1 -1
- package/library/components/table.js +1 -1
- package/library/components/types.js +18202 -18132
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/table/table.d.ts +2 -6
- package/library/packages/events/src/cx-unauthorized.d.ts +10 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +1 -0
- package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +2 -0
- package/library/packages/molecules/src/folder-select/folder-select.d.ts +1 -0
- package/library/packages/molecules/src/storybook/storybook.d.ts +60 -24
- package/library/packages/types/src/storybook.d.ts +19 -0
- package/library/react-web-component.d.ts +7 -7
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import X from "../components/input.js";
|
|
|
3
3
|
import Y from "../components/select.js";
|
|
4
4
|
import { C as $, a as ee } from "./tree.q7xRVYyh.js";
|
|
5
5
|
import { n as r, C as O } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
-
import { h as I, F as te, b as re } from "./endpoints.
|
|
6
|
+
import { h as I, F as te, b as re } from "./endpoints.BpAhLyZw.js";
|
|
7
7
|
import { c as R } from "./component.styles.CRO4Odto.js";
|
|
8
8
|
import { c as D } from "./custom-element.L4WJXn1j.js";
|
|
9
9
|
import { L as w } from "./i18n.BUW7B9hr.js";
|
|
@@ -11,9 +11,9 @@ import { w as m } from "./watch.BCJD77bD.js";
|
|
|
11
11
|
import { x as f, i as ae } from "./lit-element.jLBm65_O.js";
|
|
12
12
|
import { r as x } from "./state.CSDxrqLd.js";
|
|
13
13
|
import { e as B } from "./query.BBf1UFkC.js";
|
|
14
|
-
import { r as
|
|
14
|
+
import { r as le } from "./choose.BTbF6BAn.js";
|
|
15
15
|
import { C as W } from "./button.B-ktz-w4.js";
|
|
16
|
-
import { d as
|
|
16
|
+
import { d as se } from "./debounce.DaHuiSGU.js";
|
|
17
17
|
import { o as y } from "./if-defined.BRoBj_Rp.js";
|
|
18
18
|
import { c as q } from "./repeat.DbF2p5ae.js";
|
|
19
19
|
import { n as C } from "./when.Dr1es41R.js";
|
|
@@ -22,14 +22,14 @@ import oe from "../components/space.js";
|
|
|
22
22
|
import { M as P } from "./asset-link-format.BSRDqHg7.js";
|
|
23
23
|
import { g as ne } from "./template.CsJd8Pb_.js";
|
|
24
24
|
import { e as ce } from "./class-map.BiVq-cVR.js";
|
|
25
|
-
var
|
|
25
|
+
var g = /* @__PURE__ */ ((e) => (e.CortexPath = "Document.CortexPath", e.DocType = "CoreField.DocType", e.HasBrowserChildren = "Document.HasBrowserChildren", e.RepresentativeAssetId = "Document.DocumentDirectRepresentativeRID", e.TitleWithFallback = "CoreField.TitleWithFallback", e.rawDocSubtype = "Document.RawDocSubType", e))(g || {});
|
|
26
26
|
const he = 50;
|
|
27
27
|
async function V({
|
|
28
28
|
allowedFolders: e,
|
|
29
29
|
baseUrl: t,
|
|
30
30
|
bearerToken: a,
|
|
31
|
-
excludeVirtualFolders:
|
|
32
|
-
folderId:
|
|
31
|
+
excludeVirtualFolders: o,
|
|
32
|
+
folderId: s,
|
|
33
33
|
includeDirectChild: p,
|
|
34
34
|
limit: u = he,
|
|
35
35
|
searchTerm: U,
|
|
@@ -38,7 +38,7 @@ async function V({
|
|
|
38
38
|
token: Z
|
|
39
39
|
}) {
|
|
40
40
|
let k = [], L = p ?? !0;
|
|
41
|
-
e && e.length > 0 && !
|
|
41
|
+
e && e.length > 0 && !s ? (k = e, E = !0, L = !1) : s && (k = [s]);
|
|
42
42
|
try {
|
|
43
43
|
return (await I.request({
|
|
44
44
|
baseURL: t,
|
|
@@ -48,7 +48,7 @@ async function V({
|
|
|
48
48
|
method: "GET",
|
|
49
49
|
params: {
|
|
50
50
|
IncludeDirectChild: L,
|
|
51
|
-
IncludeVirtualFolders: !
|
|
51
|
+
IncludeVirtualFolders: !o,
|
|
52
52
|
Limit: u,
|
|
53
53
|
ObjectRecordIDs: k,
|
|
54
54
|
SeeThru: !!U,
|
|
@@ -63,28 +63,28 @@ async function V({
|
|
|
63
63
|
responseType: "json",
|
|
64
64
|
transformResponse: [
|
|
65
65
|
...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
|
|
66
|
-
(
|
|
66
|
+
(v, Fe, _) => {
|
|
67
67
|
if (_ !== void 0 && (_ < 200 || _ >= 300))
|
|
68
68
|
return {
|
|
69
69
|
data: [],
|
|
70
70
|
hasMore: !1,
|
|
71
71
|
totalCount: 0
|
|
72
72
|
};
|
|
73
|
-
if (!
|
|
73
|
+
if (!v || typeof v != "object")
|
|
74
74
|
throw new Error("Invalid response format");
|
|
75
|
-
const K =
|
|
75
|
+
const K = v.contentItems?.length ?? 0;
|
|
76
76
|
return {
|
|
77
|
-
data:
|
|
78
|
-
docType: b.fields[
|
|
79
|
-
fullPath: b.fields[
|
|
80
|
-
hasChildren: b.fields[
|
|
77
|
+
data: v.contentItems?.map((b) => ({
|
|
78
|
+
docType: b.fields[g.DocType] ?? "",
|
|
79
|
+
fullPath: b.fields[g.CortexPath] ?? "",
|
|
80
|
+
hasChildren: b.fields[g.HasBrowserChildren] === "1",
|
|
81
81
|
id: b.recordID,
|
|
82
|
-
isShared: b.fields[
|
|
83
|
-
representativeAssetId: b.fields[
|
|
84
|
-
title: b.fields[
|
|
82
|
+
isShared: b.fields[g.rawDocSubtype] === "DO_OR1ND000001913488",
|
|
83
|
+
representativeAssetId: b.fields[g.RepresentativeAssetId] ?? "",
|
|
84
|
+
title: b.fields[g.TitleWithFallback] ?? ""
|
|
85
85
|
})) ?? [],
|
|
86
|
-
hasMore: M + K <
|
|
87
|
-
totalCount:
|
|
86
|
+
hasMore: M + K < v.totalCount,
|
|
87
|
+
totalCount: v.totalCount
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
],
|
|
@@ -98,14 +98,14 @@ async function V({
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
var
|
|
102
|
-
for (var
|
|
103
|
-
(u = e[p]) && (
|
|
104
|
-
return
|
|
101
|
+
var T = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(T || {}), de = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, d = (e, t, a, o) => {
|
|
102
|
+
for (var s = o > 1 ? void 0 : o ? pe(t, a) : t, p = e.length - 1, u; p >= 0; p--)
|
|
103
|
+
(u = e[p]) && (s = (o ? u(t, a, s) : u(s)) || s);
|
|
104
|
+
return o && s && de(t, a, s), s;
|
|
105
105
|
};
|
|
106
106
|
let n = class extends O {
|
|
107
107
|
constructor() {
|
|
108
|
-
super(...arguments), this.localize = new w(this), this.role = "treeitem", this.folderId = "", this.hasChildren = !1, this.fullPath = "", this.docType = P.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = V, this.excludeVirtualFolders = !1, this.url = "", this.data = null, this.hasMore = !1, this.loading = !1;
|
|
108
|
+
super(...arguments), this.localize = new w(this), this.role = "treeitem", this.folderId = "", this.hasChildren = !1, this.fullPath = "", this.docType = P.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = V, this.excludeVirtualFolders = !1, this.url = "", this.icon = "", this.data = null, this.hasMore = !1, this.loading = !1;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
111
|
* This is used to render the cx-tree-item inside the cx-folder-item without the shadow root so that the cx-tree can query select the cx-tree-item inside
|
|
@@ -118,9 +118,13 @@ let n = class extends O {
|
|
|
118
118
|
start: t = 0
|
|
119
119
|
}) {
|
|
120
120
|
if (!this.api)
|
|
121
|
-
return {
|
|
121
|
+
return {
|
|
122
|
+
data: [],
|
|
123
|
+
hasMore: !1,
|
|
124
|
+
totalCount: 0
|
|
125
|
+
};
|
|
122
126
|
try {
|
|
123
|
-
const { data: a, hasMore:
|
|
127
|
+
const { data: a, hasMore: o, totalCount: s } = await this.api({
|
|
124
128
|
baseUrl: this.baseUrl,
|
|
125
129
|
bearerToken: this.bearerToken,
|
|
126
130
|
excludeVirtualFolders: this.excludeVirtualFolders,
|
|
@@ -128,9 +132,17 @@ let n = class extends O {
|
|
|
128
132
|
start: t,
|
|
129
133
|
token: this.token
|
|
130
134
|
});
|
|
131
|
-
return {
|
|
135
|
+
return {
|
|
136
|
+
data: a,
|
|
137
|
+
hasMore: o,
|
|
138
|
+
totalCount: s
|
|
139
|
+
};
|
|
132
140
|
} catch {
|
|
133
|
-
return {
|
|
141
|
+
return {
|
|
142
|
+
data: [],
|
|
143
|
+
hasMore: !1,
|
|
144
|
+
totalCount: 0
|
|
145
|
+
};
|
|
134
146
|
}
|
|
135
147
|
}
|
|
136
148
|
async loadMore(e) {
|
|
@@ -138,11 +150,11 @@ let n = class extends O {
|
|
|
138
150
|
const t = this.data?.length || 0;
|
|
139
151
|
this.loading = !0;
|
|
140
152
|
try {
|
|
141
|
-
const { data: a, hasMore:
|
|
153
|
+
const { data: a, hasMore: o } = await this.fetchFolders({
|
|
142
154
|
folderId: this.folderId,
|
|
143
155
|
start: t
|
|
144
156
|
});
|
|
145
|
-
this.data = [...this.data || [], ...a], this.hasMore =
|
|
157
|
+
this.data = [...this.data || [], ...a], this.hasMore = o;
|
|
146
158
|
} catch {
|
|
147
159
|
} finally {
|
|
148
160
|
this.loading = !1;
|
|
@@ -152,24 +164,25 @@ let n = class extends O {
|
|
|
152
164
|
e.stopPropagation(), this.treeItem.expanded = !0;
|
|
153
165
|
const t = this.data?.length || 0;
|
|
154
166
|
try {
|
|
155
|
-
const { data: a, hasMore:
|
|
167
|
+
const { data: a, hasMore: o } = await this.fetchFolders({
|
|
156
168
|
folderId: this.folderId,
|
|
157
169
|
start: t
|
|
158
170
|
});
|
|
159
|
-
this.data = a, this.hasMore =
|
|
171
|
+
this.data = a, this.hasMore = o;
|
|
160
172
|
} catch {
|
|
161
173
|
this.treeItem.expanded = !1;
|
|
162
174
|
}
|
|
163
175
|
}
|
|
164
176
|
render() {
|
|
165
|
-
|
|
177
|
+
let e = "filled";
|
|
178
|
+
return this.docType === P.Album && (e = "outlined"), f`<cx-tree-item class=${ce({
|
|
166
179
|
"folder-select-tree-item": !0
|
|
167
180
|
})} data-id=${this.folderId} data-url=${y(this.url)} data-name=${y(this.name?.trim() || void 0)} data-representative-asset-id=${y(
|
|
168
181
|
this.representativeAssetId || void 0
|
|
169
|
-
)} role="option" ?lazy=${this.hasChildren && this.data === null} ?selected=${this.selectedValue === this.folderId} @cx-lazy-load=${this.handleLazyLoad}><cx-space class="folder-select-tree-item__label" direction="horizontal" spacing="x-small" align-items="center" wrap="nowrap"><cx-icon class="folder-select-tree__item__icon" name
|
|
182
|
+
)} role="option" ?lazy=${this.hasChildren && this.data === null} ?selected=${this.selectedValue === this.folderId} @cx-lazy-load=${this.handleLazyLoad}><cx-space class="folder-select-tree-item__label" direction="horizontal" spacing="x-small" align-items="center" wrap="nowrap"><cx-icon class="folder-select-tree__item__icon" name=${this.icon || "folder"} variant=${e}></cx-icon><cx-line-clamp lines="1" class="folder-select-tree-item__title">${ne(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${q(
|
|
170
183
|
this.data || [],
|
|
171
|
-
(
|
|
172
|
-
(
|
|
184
|
+
(t) => t.id,
|
|
185
|
+
(t) => f`<cx-folder-select-tree-item slot="children" folder-id=${t.id} full-path=${t.fullPath} name=${t.title} representative-asset-id=${t.representativeAssetId} selected-value=${this.selectedValue} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?has-children=${t.hasChildren} base-url=${this.baseUrl} url=${y(t.url ?? void 0)} .api=${this.api} value=${t.url}></cx-folder-select-tree-item>`
|
|
173
186
|
)}</cx-tree-item>${C(
|
|
174
187
|
this.hasMore,
|
|
175
188
|
() => f`<div slot="children" class="load-more-button"><cx-button variant="text" @click=${this.loadMore} ?loading=${this.loading}>${this.localize.term("more")}</cx-button></div>`
|
|
@@ -238,6 +251,9 @@ d([
|
|
|
238
251
|
d([
|
|
239
252
|
r({ reflect: !0, type: String })
|
|
240
253
|
], n.prototype, "url", 2);
|
|
254
|
+
d([
|
|
255
|
+
r({ reflect: !0, type: String })
|
|
256
|
+
], n.prototype, "icon", 2);
|
|
241
257
|
d([
|
|
242
258
|
x()
|
|
243
259
|
], n.prototype, "data", 2);
|
|
@@ -252,14 +268,14 @@ n = d([
|
|
|
252
268
|
], n);
|
|
253
269
|
var ue = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, Q = (e) => {
|
|
254
270
|
throw TypeError(e);
|
|
255
|
-
}, h = (e, t, a,
|
|
256
|
-
for (var
|
|
257
|
-
(u = e[p]) && (
|
|
258
|
-
return
|
|
259
|
-
}, N = (e, t, a) => t.has(e) || Q("Cannot " + a), me = (e, t, a) => (N(e, t, "read from private field"), t.get(e)), ye = (e, t, a) => t.has(e) ? Q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), xe = (e, t, a,
|
|
271
|
+
}, h = (e, t, a, o) => {
|
|
272
|
+
for (var s = o > 1 ? void 0 : o ? fe(t, a) : t, p = e.length - 1, u; p >= 0; p--)
|
|
273
|
+
(u = e[p]) && (s = (o ? u(t, a, s) : u(s)) || s);
|
|
274
|
+
return o && s && ue(t, a, s), s;
|
|
275
|
+
}, N = (e, t, a) => t.has(e) || Q("Cannot " + a), me = (e, t, a) => (N(e, t, "read from private field"), t.get(e)), ye = (e, t, a) => t.has(e) ? Q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), xe = (e, t, a, o) => (N(e, t, "write to private field"), t.set(e, a), a), S;
|
|
260
276
|
let c = class extends O {
|
|
261
277
|
constructor() {
|
|
262
|
-
super(...arguments), this.localize = new w(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.seeThru = !1, this.extraFolderData = null, this.api = V, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, ye(this, S, !1);
|
|
278
|
+
super(...arguments), this.localize = new w(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.seeThru = !1, this.extraFolderData = null, this.api = V, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, ye(this, S, !1);
|
|
263
279
|
}
|
|
264
280
|
get empty() {
|
|
265
281
|
return !this.loading && this.data.length === 0;
|
|
@@ -299,7 +315,7 @@ let c = class extends O {
|
|
|
299
315
|
e.stopPropagation();
|
|
300
316
|
const t = this.data.length;
|
|
301
317
|
this.loading = !0;
|
|
302
|
-
const { data: a, hasMore:
|
|
318
|
+
const { data: a, hasMore: o } = await this.api({
|
|
303
319
|
baseUrl: this.baseUrl,
|
|
304
320
|
bearerToken: this.bearerToken,
|
|
305
321
|
excludeVirtualFolders: this.excludeVirtualFolders,
|
|
@@ -310,7 +326,7 @@ let c = class extends O {
|
|
|
310
326
|
start: t,
|
|
311
327
|
token: this.token
|
|
312
328
|
});
|
|
313
|
-
this.data = [...this.data, ...a], this.hasMore =
|
|
329
|
+
this.data = [...this.data, ...a], this.hasMore = o, this.loading = !1;
|
|
314
330
|
}
|
|
315
331
|
async handleFetchFolders() {
|
|
316
332
|
const { data: e, hasMore: t } = await this.fetchFolders();
|
|
@@ -354,7 +370,7 @@ let c = class extends O {
|
|
|
354
370
|
)}
|
|
355
371
|
${C(
|
|
356
372
|
this.extraFolderData,
|
|
357
|
-
() => f`<cx-folder-select-tree-item .api=${this.api} base-url=${this.baseUrl} doc-type=${y(this.extraFolderData?.docType ?? void 0)} folder-id=${y(this.extraFolderData?.id ?? void 0)} full-path=${y(this.extraFolderData?.fullPath ?? void 0)} name=${this.extraFolderTitle || this.extraFolderData?.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} token=${this.token} bearer-token=${this.bearerToken} url=${y(this.extraFolderData?.url ?? void 0)} ?has-children=${this.extraFolderData?.hasChildren} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
|
|
373
|
+
() => f`<cx-folder-select-tree-item .api=${this.api} base-url=${this.baseUrl} doc-type=${y(this.extraFolderData?.docType ?? void 0)} folder-id=${y(this.extraFolderData?.id ?? void 0)} full-path=${y(this.extraFolderData?.fullPath ?? void 0)} icon=${this.extraFolderIcon} name=${this.extraFolderTitle || this.extraFolderData?.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} token=${this.token} bearer-token=${this.bearerToken} url=${y(this.extraFolderData?.url ?? void 0)} ?has-children=${this.extraFolderData?.hasChildren} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
|
|
358
374
|
)}
|
|
359
375
|
${q(
|
|
360
376
|
this.data,
|
|
@@ -400,6 +416,9 @@ h([
|
|
|
400
416
|
h([
|
|
401
417
|
r({ attribute: "extra-folder-title", reflect: !0, type: String })
|
|
402
418
|
], c.prototype, "extraFolderTitle", 2);
|
|
419
|
+
h([
|
|
420
|
+
r({ attribute: "extra-folder-icon", reflect: !0, type: String })
|
|
421
|
+
], c.prototype, "extraFolderIcon", 2);
|
|
403
422
|
h([
|
|
404
423
|
r({ attribute: "see-thru", reflect: !0, type: Boolean })
|
|
405
424
|
], c.prototype, "seeThru", 2);
|
|
@@ -436,29 +455,29 @@ h([
|
|
|
436
455
|
m("token", { waitUntilFirstUpdate: !0 }),
|
|
437
456
|
m("searchTerm", { waitUntilFirstUpdate: !0 }),
|
|
438
457
|
m("excludeVirtualFolders", { waitUntilFirstUpdate: !0 }),
|
|
439
|
-
|
|
458
|
+
se(500)
|
|
440
459
|
], c.prototype, "handleFetchFolders", 1);
|
|
441
460
|
c = h([
|
|
442
461
|
D("cx-folder-select-tree")
|
|
443
462
|
], c);
|
|
444
463
|
const be = ae`:host{width:100%;display:block}.folder-select{gap:var(--cx-spacing-x-small);flex-direction:column;display:flex}.folder-select-tree{flex:1;overflow:auto}.folder-select-tree__item__icon{color:var(--cx-color-primary)}.folder-select-tree__empty-message{font-size:var(--cx-font-size-small);color:var(--cx-color-neutral-500);padding-block:var(--cx-spacing-2x-small);padding-inline:var(--cx-spacing-small);text-align:center;cursor:default;user-select:none}.folder-select-tree__load-more{margin-inline:var(--cx-spacing-small)}.folder-select-tree-item::part(label),.folder-select-tree-item__label,.folder-select-tree-item__title{overflow:hidden}`;
|
|
445
|
-
var
|
|
464
|
+
var ge = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, H = (e) => {
|
|
446
465
|
throw TypeError(e);
|
|
447
|
-
},
|
|
448
|
-
for (var
|
|
449
|
-
(u = e[p]) && (
|
|
450
|
-
return
|
|
451
|
-
}, j = (e, t, a) => t.has(e) || H("Cannot " + a), G = (e, t, a) => (j(e, t, "read from private field"), a ? a.call(e) : t.get(e)), $e = (e, t, a) => t.has(e) ? H("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), z = (e, t, a,
|
|
452
|
-
let
|
|
466
|
+
}, i = (e, t, a, o) => {
|
|
467
|
+
for (var s = o > 1 ? void 0 : o ? ve(t, a) : t, p = e.length - 1, u; p >= 0; p--)
|
|
468
|
+
(u = e[p]) && (s = (o ? u(t, a, s) : u(s)) || s);
|
|
469
|
+
return o && s && ge(t, a, s), s;
|
|
470
|
+
}, j = (e, t, a) => t.has(e) || H("Cannot " + a), G = (e, t, a) => (j(e, t, "read from private field"), a ? a.call(e) : t.get(e)), $e = (e, t, a) => t.has(e) ? H("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), z = (e, t, a, o) => (j(e, t, "write to private field"), t.set(e, a), a), F;
|
|
471
|
+
let l = class extends O {
|
|
453
472
|
constructor() {
|
|
454
|
-
super(), this.localize = new w(this), this.minQueryLength = 1, this.selection = "single", this.variant =
|
|
473
|
+
super(), this.localize = new w(this), this.minQueryLength = 1, this.selection = "single", this.variant = T.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = V, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.firstFetchCallback = null, this.searchTerm = "", $e(this, F), this.selectGetOptionValue = this.selectGetOptionValue.bind(this), this.selectGetOptionLabel = this.selectGetOptionLabel.bind(this), this.selectGetOptionSelected = this.selectGetOptionSelected.bind(this), this.selectFilterCallback = this.selectFilterCallback.bind(this), this.selectSetOptionSelected = this.selectSetOptionSelected.bind(this), this.updateWrappedApi();
|
|
455
474
|
}
|
|
456
475
|
updateWrappedApi() {
|
|
457
476
|
if (!this.api) {
|
|
458
|
-
z(this,
|
|
477
|
+
z(this, F, void 0);
|
|
459
478
|
return;
|
|
460
479
|
}
|
|
461
|
-
z(this,
|
|
480
|
+
z(this, F, async (e) => {
|
|
462
481
|
try {
|
|
463
482
|
return await this.api(e);
|
|
464
483
|
} catch (t) {
|
|
@@ -514,125 +533,132 @@ let s = class extends O {
|
|
|
514
533
|
}
|
|
515
534
|
}
|
|
516
535
|
async handleVariantChange() {
|
|
517
|
-
this.variant ===
|
|
536
|
+
this.variant === T.Select && (await this.updateComplete, this.updateFunctionProps());
|
|
518
537
|
}
|
|
519
538
|
handleValueChange() {
|
|
520
539
|
this.selectEl && (this.searchTerm = "", this.selectEl.getOptionValue = this.selectGetOptionValue, this.selectEl.getOptionLabel = this.selectGetOptionLabel, this.selectEl.getOptionSelected = this.selectGetOptionSelected, this.selectEl.filterCallback = this.selectFilterCallback, this.selectEl.setOptionSelected = this.selectSetOptionSelected, this.selectEl.handleDefaultSlotChange());
|
|
521
540
|
}
|
|
522
541
|
render() {
|
|
523
|
-
return f`<div class="folder-select">${
|
|
542
|
+
return f`<div class="folder-select">${le(this.variant, [
|
|
524
543
|
[
|
|
525
|
-
|
|
526
|
-
() => f`<cx-input aria-label=${this.localize.term("searchFolders")} placeholder=${`${this.localize.term("searchFolders")}...`} value=${this.searchTerm} clearable @cx-input=${this.handleSearchTermInputChange}><cx-icon name="search" slot="prefix"></cx-icon></cx-input><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${G(this,
|
|
544
|
+
T.Input,
|
|
545
|
+
() => f`<cx-input aria-label=${this.localize.term("searchFolders")} placeholder=${`${this.localize.term("searchFolders")}...`} value=${this.searchTerm} clearable @cx-input=${this.handleSearchTermInputChange}><cx-icon name="search" slot="prefix"></cx-icon></cx-input><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${G(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
|
|
527
546
|
],
|
|
528
547
|
[
|
|
529
|
-
|
|
530
|
-
() => f`<cx-select clearable hoist lazy name=${this.name} value=${this.value} .form=${this.form} ?required=${this.required} @input=${this.handleSearchTermSelectChange} @cx-clear=${this.handleSearchTermSelectChange} allow-freetext><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${G(this,
|
|
548
|
+
T.Select,
|
|
549
|
+
() => f`<cx-select clearable hoist lazy name=${this.name} value=${this.value} .form=${this.form} ?required=${this.required} @input=${this.handleSearchTermSelectChange} @cx-clear=${this.handleSearchTermSelectChange} allow-freetext><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${G(this, F)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
|
|
531
550
|
]
|
|
532
551
|
])}</div>`;
|
|
533
552
|
}
|
|
534
553
|
};
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
554
|
+
F = /* @__PURE__ */ new WeakMap();
|
|
555
|
+
l.styles = [R, be];
|
|
556
|
+
l.dependencies = {
|
|
538
557
|
"cx-folder-select-tree": c,
|
|
539
558
|
"cx-icon": A,
|
|
540
559
|
"cx-input": X,
|
|
541
560
|
"cx-select": Y
|
|
542
561
|
};
|
|
543
|
-
|
|
562
|
+
i([
|
|
544
563
|
B("cx-select")
|
|
545
|
-
],
|
|
546
|
-
|
|
564
|
+
], l.prototype, "selectEl", 2);
|
|
565
|
+
i([
|
|
547
566
|
r({ attribute: "min-query-length", reflect: !0, type: Number })
|
|
548
|
-
],
|
|
549
|
-
|
|
567
|
+
], l.prototype, "minQueryLength", 2);
|
|
568
|
+
i([
|
|
550
569
|
r({ attribute: "selection", reflect: !0, type: String })
|
|
551
|
-
],
|
|
552
|
-
|
|
570
|
+
], l.prototype, "selection", 2);
|
|
571
|
+
i([
|
|
553
572
|
r({ attribute: "variant", reflect: !0, type: String })
|
|
554
|
-
],
|
|
555
|
-
|
|
573
|
+
], l.prototype, "variant", 2);
|
|
574
|
+
i([
|
|
556
575
|
r({ reflect: !0, type: String })
|
|
557
|
-
],
|
|
558
|
-
|
|
576
|
+
], l.prototype, "value", 2);
|
|
577
|
+
i([
|
|
559
578
|
r({ reflect: !0, type: String })
|
|
560
|
-
],
|
|
561
|
-
|
|
579
|
+
], l.prototype, "name", 2);
|
|
580
|
+
i([
|
|
562
581
|
r({ attribute: "selected-label", reflect: !0, type: String })
|
|
563
|
-
],
|
|
564
|
-
|
|
582
|
+
], l.prototype, "selectedLabel", 2);
|
|
583
|
+
i([
|
|
565
584
|
r({ attribute: "base-url", reflect: !0, type: String })
|
|
566
|
-
],
|
|
567
|
-
|
|
585
|
+
], l.prototype, "baseUrl", 2);
|
|
586
|
+
i([
|
|
568
587
|
r({ reflect: !0, type: Boolean })
|
|
569
|
-
],
|
|
570
|
-
|
|
588
|
+
], l.prototype, "open", 2);
|
|
589
|
+
i([
|
|
571
590
|
r({ reflect: !1, type: String })
|
|
572
|
-
],
|
|
573
|
-
|
|
591
|
+
], l.prototype, "token", 2);
|
|
592
|
+
i([
|
|
574
593
|
r({ attribute: "bearer-token", reflect: !0, type: String })
|
|
575
|
-
],
|
|
576
|
-
|
|
594
|
+
], l.prototype, "bearerToken", 2);
|
|
595
|
+
i([
|
|
577
596
|
r({ attribute: "see-thru", reflect: !0, type: Boolean })
|
|
578
|
-
],
|
|
579
|
-
|
|
597
|
+
], l.prototype, "seeThru", 2);
|
|
598
|
+
i([
|
|
580
599
|
r({ type: Function })
|
|
581
|
-
],
|
|
582
|
-
|
|
600
|
+
], l.prototype, "api", 2);
|
|
601
|
+
i([
|
|
583
602
|
r({ reflect: !0, type: Boolean })
|
|
584
|
-
],
|
|
585
|
-
|
|
603
|
+
], l.prototype, "required", 2);
|
|
604
|
+
i([
|
|
586
605
|
r({ reflect: !1 })
|
|
587
|
-
],
|
|
588
|
-
|
|
606
|
+
], l.prototype, "form", 2);
|
|
607
|
+
i([
|
|
589
608
|
r({
|
|
590
609
|
attribute: "exclude-virtual-folders",
|
|
591
610
|
reflect: !0,
|
|
592
611
|
type: Boolean
|
|
593
612
|
})
|
|
594
|
-
],
|
|
595
|
-
|
|
613
|
+
], l.prototype, "excludeVirtualFolders", 2);
|
|
614
|
+
i([
|
|
596
615
|
r({
|
|
597
616
|
attribute: "extra-folder-id",
|
|
598
617
|
reflect: !0,
|
|
599
618
|
type: String
|
|
600
619
|
})
|
|
601
|
-
],
|
|
602
|
-
|
|
620
|
+
], l.prototype, "extraFolderId", 2);
|
|
621
|
+
i([
|
|
603
622
|
r({
|
|
604
623
|
attribute: "extra-folder-title",
|
|
605
624
|
reflect: !0,
|
|
606
625
|
type: String
|
|
607
626
|
})
|
|
608
|
-
],
|
|
609
|
-
|
|
627
|
+
], l.prototype, "extraFolderTitle", 2);
|
|
628
|
+
i([
|
|
629
|
+
r({
|
|
630
|
+
attribute: "extra-folder-icon",
|
|
631
|
+
reflect: !0,
|
|
632
|
+
type: String
|
|
633
|
+
})
|
|
634
|
+
], l.prototype, "extraFolderIcon", 2);
|
|
635
|
+
i([
|
|
610
636
|
r({ attribute: "first-fetch-callback", reflect: !1, type: Function })
|
|
611
|
-
],
|
|
612
|
-
|
|
637
|
+
], l.prototype, "firstFetchCallback", 2);
|
|
638
|
+
i([
|
|
613
639
|
x()
|
|
614
|
-
],
|
|
615
|
-
|
|
640
|
+
], l.prototype, "searchTerm", 2);
|
|
641
|
+
i([
|
|
616
642
|
m("api")
|
|
617
|
-
],
|
|
618
|
-
|
|
643
|
+
], l.prototype, "updateWrappedApi", 1);
|
|
644
|
+
i([
|
|
619
645
|
m("searchTerm", { waitUntilFirstUpdate: !0 })
|
|
620
|
-
],
|
|
621
|
-
|
|
646
|
+
], l.prototype, "handleSearchTermChange", 1);
|
|
647
|
+
i([
|
|
622
648
|
m("open")
|
|
623
|
-
],
|
|
624
|
-
|
|
649
|
+
], l.prototype, "handleOpenChange", 1);
|
|
650
|
+
i([
|
|
625
651
|
m("variant")
|
|
626
|
-
],
|
|
627
|
-
|
|
652
|
+
], l.prototype, "handleVariantChange", 1);
|
|
653
|
+
i([
|
|
628
654
|
m("selectedLabel", { waitUntilFirstUpdate: !0 }),
|
|
629
655
|
m("value", { waitUntilFirstUpdate: !0 })
|
|
630
|
-
],
|
|
631
|
-
|
|
656
|
+
], l.prototype, "handleValueChange", 1);
|
|
657
|
+
l = i([
|
|
632
658
|
D("cx-folder-select")
|
|
633
|
-
],
|
|
659
|
+
], l);
|
|
634
660
|
export {
|
|
635
|
-
|
|
636
|
-
F,
|
|
661
|
+
l as C,
|
|
662
|
+
T as F,
|
|
637
663
|
V as a
|
|
638
664
|
};
|
|
@@ -9,7 +9,7 @@ import B from "../components/radio.js";
|
|
|
9
9
|
import K from "../components/radio-group.js";
|
|
10
10
|
import U from "../components/select.js";
|
|
11
11
|
import E from "../components/space.js";
|
|
12
|
-
import { C as H, H as V } from "./table.
|
|
12
|
+
import { C as H, H as V } from "./table.CLyePLwR.js";
|
|
13
13
|
import { C as L } from "./typography.DJC_UXgs.js";
|
|
14
14
|
import { n as o, C as T } from "./lib-cortex-element.CVMmyPMC.js";
|
|
15
15
|
import W from "../components/dynamic-select.js";
|
|
@@ -30,7 +30,7 @@ import { n as N } from "./when.Dr1es41R.js";
|
|
|
30
30
|
import { t as ee } from "./toString.CL_lYXbK.js";
|
|
31
31
|
import { C as ae } from "./icon-button.BuhCp--_.js";
|
|
32
32
|
import { C as te } from "./image.4eLWAZ3-.js";
|
|
33
|
-
import { a as ie, D as $ } from "./asset.
|
|
33
|
+
import { a as ie, D as $ } from "./asset.CVuNAhz3.js";
|
|
34
34
|
import { a as ne } from "./index.Cpamj0jB.js";
|
|
35
35
|
import { A as v } from "./content-builder.B4Tqoc6M.js";
|
|
36
36
|
import { e as se, t as w } from "./string.B_rEG27K.js";
|