@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.
Files changed (27) hide show
  1. package/library/chunks/{asset.DWZ2Lzb6.js → asset.CVuNAhz3.js} +1 -1
  2. package/library/chunks/{color-swatch-group.DvllHUil.js → color-swatch-group.o7zyUsbZ.js} +1 -1
  3. package/library/chunks/{endpoints.B7lcoc1N.js → endpoints.BpAhLyZw.js} +126 -117
  4. package/library/chunks/{folder-select.DOsefkAC.js → folder-select.D6yLoXWU.js} +146 -120
  5. package/library/chunks/{list-editor.DNa6ROgr.js → list-editor.Hd2f8A0Y.js} +2 -2
  6. package/library/chunks/{table.B8LpbiGE.js → table.CLyePLwR.js} +252 -237
  7. package/library/components/asset-link-format.js +2 -2
  8. package/library/components/atoms.js +1 -1
  9. package/library/components/color-swatch-group.js +2 -2
  10. package/library/components/folder-select.js +2 -2
  11. package/library/components/list-editor.js +2 -2
  12. package/library/components/menu-item.js +1 -1
  13. package/library/components/molecules.js +2 -2
  14. package/library/components/organisms.js +1 -1
  15. package/library/components/table.js +1 -1
  16. package/library/components/types.js +18202 -18132
  17. package/library/package.json +1 -1
  18. package/library/packages/atoms/src/components/table/table.d.ts +2 -6
  19. package/library/packages/events/src/cx-unauthorized.d.ts +10 -0
  20. package/library/packages/events/src/events.d.ts +1 -0
  21. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +1 -0
  22. package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +2 -0
  23. package/library/packages/molecules/src/folder-select/folder-select.d.ts +1 -0
  24. package/library/packages/molecules/src/storybook/storybook.d.ts +60 -24
  25. package/library/packages/types/src/storybook.d.ts +19 -0
  26. package/library/react-web-component.d.ts +7 -7
  27. 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.B7lcoc1N.js";
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 se } from "./choose.BTbF6BAn.js";
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 le } from "./debounce.DaHuiSGU.js";
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 v = /* @__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))(v || {});
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: i,
32
- folderId: l,
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 && !l ? (k = e, E = !0, L = !1) : l && (k = [l]);
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: !i,
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
- (g, Te, _) => {
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 (!g || typeof g != "object")
73
+ if (!v || typeof v != "object")
74
74
  throw new Error("Invalid response format");
75
- const K = g.contentItems?.length ?? 0;
75
+ const K = v.contentItems?.length ?? 0;
76
76
  return {
77
- data: g.contentItems?.map((b) => ({
78
- docType: b.fields[v.DocType] ?? "",
79
- fullPath: b.fields[v.CortexPath] ?? "",
80
- hasChildren: b.fields[v.HasBrowserChildren] === "1",
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[v.rawDocSubtype] === "DO_OR1ND000001913488",
83
- representativeAssetId: b.fields[v.RepresentativeAssetId] ?? "",
84
- title: b.fields[v.TitleWithFallback] ?? ""
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 < g.totalCount,
87
- totalCount: g.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 F = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(F || {}), de = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, d = (e, t, a, i) => {
102
- for (var l = i > 1 ? void 0 : i ? pe(t, a) : t, p = e.length - 1, u; p >= 0; p--)
103
- (u = e[p]) && (l = (i ? u(t, a, l) : u(l)) || l);
104
- return i && l && de(t, a, l), l;
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 { data: [], hasMore: !1 };
121
+ return {
122
+ data: [],
123
+ hasMore: !1,
124
+ totalCount: 0
125
+ };
122
126
  try {
123
- const { data: a, hasMore: i } = await this.api({
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 { data: a, hasMore: i };
135
+ return {
136
+ data: a,
137
+ hasMore: o,
138
+ totalCount: s
139
+ };
132
140
  } catch {
133
- return { data: [], hasMore: !1 };
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: i } = await this.fetchFolders({
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 = i;
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: i } = await this.fetchFolders({
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 = i;
171
+ this.data = a, this.hasMore = o;
160
172
  } catch {
161
173
  this.treeItem.expanded = !1;
162
174
  }
163
175
  }
164
176
  render() {
165
- return f`<cx-tree-item class=${ce({
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="folder" variant=${this.docType === P.Album ? "outlined" : "filled"}></cx-icon><cx-line-clamp lines="1" class="folder-select-tree-item__title">${ne(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${q(
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
- (e) => e.id,
172
- (e) => f`<cx-folder-select-tree-item slot="children" folder-id=${e.id} full-path=${e.fullPath} name=${e.title} representative-asset-id=${e.representativeAssetId} selected-value=${this.selectedValue} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?has-children=${e.hasChildren} base-url=${this.baseUrl} url=${y(e.url ?? void 0)} .api=${this.api} value=${e.url}></cx-folder-select-tree-item>`
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, i) => {
256
- for (var l = i > 1 ? void 0 : i ? fe(t, a) : t, p = e.length - 1, u; p >= 0; p--)
257
- (u = e[p]) && (l = (i ? u(t, a, l) : u(l)) || l);
258
- return i && l && ue(t, a, l), l;
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, i) => (N(e, t, "write to private field"), t.set(e, a), a), S;
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: i } = await this.api({
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 = i, this.loading = !1;
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
- le(500)
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 ve = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, H = (e) => {
464
+ var ge = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, H = (e) => {
446
465
  throw TypeError(e);
447
- }, o = (e, t, a, i) => {
448
- for (var l = i > 1 ? void 0 : i ? ge(t, a) : t, p = e.length - 1, u; p >= 0; p--)
449
- (u = e[p]) && (l = (i ? u(t, a, l) : u(l)) || l);
450
- return i && l && ve(t, a, l), l;
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, i) => (j(e, t, "write to private field"), t.set(e, a), a), T;
452
- let s = class extends O {
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 = F.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.firstFetchCallback = null, this.searchTerm = "", $e(this, T), 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();
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, T, void 0);
477
+ z(this, F, void 0);
459
478
  return;
460
479
  }
461
- z(this, T, async (e) => {
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 === F.Select && (await this.updateComplete, this.updateFunctionProps());
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">${se(this.variant, [
542
+ return f`<div class="folder-select">${le(this.variant, [
524
543
  [
525
- F.Input,
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, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
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
- F.Select,
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, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
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
- T = /* @__PURE__ */ new WeakMap();
536
- s.styles = [R, be];
537
- s.dependencies = {
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
- o([
562
+ i([
544
563
  B("cx-select")
545
- ], s.prototype, "selectEl", 2);
546
- o([
564
+ ], l.prototype, "selectEl", 2);
565
+ i([
547
566
  r({ attribute: "min-query-length", reflect: !0, type: Number })
548
- ], s.prototype, "minQueryLength", 2);
549
- o([
567
+ ], l.prototype, "minQueryLength", 2);
568
+ i([
550
569
  r({ attribute: "selection", reflect: !0, type: String })
551
- ], s.prototype, "selection", 2);
552
- o([
570
+ ], l.prototype, "selection", 2);
571
+ i([
553
572
  r({ attribute: "variant", reflect: !0, type: String })
554
- ], s.prototype, "variant", 2);
555
- o([
573
+ ], l.prototype, "variant", 2);
574
+ i([
556
575
  r({ reflect: !0, type: String })
557
- ], s.prototype, "value", 2);
558
- o([
576
+ ], l.prototype, "value", 2);
577
+ i([
559
578
  r({ reflect: !0, type: String })
560
- ], s.prototype, "name", 2);
561
- o([
579
+ ], l.prototype, "name", 2);
580
+ i([
562
581
  r({ attribute: "selected-label", reflect: !0, type: String })
563
- ], s.prototype, "selectedLabel", 2);
564
- o([
582
+ ], l.prototype, "selectedLabel", 2);
583
+ i([
565
584
  r({ attribute: "base-url", reflect: !0, type: String })
566
- ], s.prototype, "baseUrl", 2);
567
- o([
585
+ ], l.prototype, "baseUrl", 2);
586
+ i([
568
587
  r({ reflect: !0, type: Boolean })
569
- ], s.prototype, "open", 2);
570
- o([
588
+ ], l.prototype, "open", 2);
589
+ i([
571
590
  r({ reflect: !1, type: String })
572
- ], s.prototype, "token", 2);
573
- o([
591
+ ], l.prototype, "token", 2);
592
+ i([
574
593
  r({ attribute: "bearer-token", reflect: !0, type: String })
575
- ], s.prototype, "bearerToken", 2);
576
- o([
594
+ ], l.prototype, "bearerToken", 2);
595
+ i([
577
596
  r({ attribute: "see-thru", reflect: !0, type: Boolean })
578
- ], s.prototype, "seeThru", 2);
579
- o([
597
+ ], l.prototype, "seeThru", 2);
598
+ i([
580
599
  r({ type: Function })
581
- ], s.prototype, "api", 2);
582
- o([
600
+ ], l.prototype, "api", 2);
601
+ i([
583
602
  r({ reflect: !0, type: Boolean })
584
- ], s.prototype, "required", 2);
585
- o([
603
+ ], l.prototype, "required", 2);
604
+ i([
586
605
  r({ reflect: !1 })
587
- ], s.prototype, "form", 2);
588
- o([
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
- ], s.prototype, "excludeVirtualFolders", 2);
595
- o([
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
- ], s.prototype, "extraFolderId", 2);
602
- o([
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
- ], s.prototype, "extraFolderTitle", 2);
609
- o([
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
- ], s.prototype, "firstFetchCallback", 2);
612
- o([
637
+ ], l.prototype, "firstFetchCallback", 2);
638
+ i([
613
639
  x()
614
- ], s.prototype, "searchTerm", 2);
615
- o([
640
+ ], l.prototype, "searchTerm", 2);
641
+ i([
616
642
  m("api")
617
- ], s.prototype, "updateWrappedApi", 1);
618
- o([
643
+ ], l.prototype, "updateWrappedApi", 1);
644
+ i([
619
645
  m("searchTerm", { waitUntilFirstUpdate: !0 })
620
- ], s.prototype, "handleSearchTermChange", 1);
621
- o([
646
+ ], l.prototype, "handleSearchTermChange", 1);
647
+ i([
622
648
  m("open")
623
- ], s.prototype, "handleOpenChange", 1);
624
- o([
649
+ ], l.prototype, "handleOpenChange", 1);
650
+ i([
625
651
  m("variant")
626
- ], s.prototype, "handleVariantChange", 1);
627
- o([
652
+ ], l.prototype, "handleVariantChange", 1);
653
+ i([
628
654
  m("selectedLabel", { waitUntilFirstUpdate: !0 }),
629
655
  m("value", { waitUntilFirstUpdate: !0 })
630
- ], s.prototype, "handleValueChange", 1);
631
- s = o([
656
+ ], l.prototype, "handleValueChange", 1);
657
+ l = i([
632
658
  D("cx-folder-select")
633
- ], s);
659
+ ], l);
634
660
  export {
635
- s as C,
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.B8LpbiGE.js";
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.DWZ2Lzb6.js";
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";