@orangelogic/design-system 2.77.0-pr86393.2 → 2.78.0-ci.3
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/{color-swatch-group.C7T6-sY7.js → color-swatch-group.DLXAJdU4.js} +1 -1
- package/library/chunks/{list-editor.DluUZa06.js → list-editor.C2ZRwPIG.js} +1 -1
- package/library/chunks/{pagination.g4zErKN2.js → pagination.DZq0IZjI.js} +82 -72
- package/library/chunks/{table.CcqrVieF.js → table.COCT3Fsb.js} +135 -33
- package/library/components/atoms.js +2 -2
- package/library/components/color-swatch-group.js +2 -2
- package/library/components/list-editor.js +2 -2
- package/library/components/molecules.js +1 -1
- package/library/components/organisms.js +1 -1
- package/library/components/pagination.js +1 -1
- package/library/components/select.js +156 -127
- package/library/components/table.js +2 -2
- package/library/components/textarea.js +2 -4
- package/library/components/types.js +1872 -1861
- package/library/components/video.js +3521 -3499
- package/library/package.json +4 -1
- package/library/packages/atoms/src/components/pagination/pagination.d.ts +2 -1
- package/library/packages/atoms/src/components/select/select.d.ts +11 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Ajax/Ajax.d.ts +1 -1
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/List.d.ts +32 -1
- package/library/packages/organisms/src/carousel/carousel.d.ts +2 -0
- package/library/packages/types/src/table.d.ts +2 -0
- package/library/react-web-component.d.ts +7 -3
- package/package.json +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from "../components/space.js";
|
|
2
|
-
import { C as $ } from "./table.
|
|
2
|
+
import { C as $ } from "./table.COCT3Fsb.js";
|
|
3
3
|
import { C as k } from "./typography.oDzoLbZS.js";
|
|
4
4
|
import { n as h, C as F } from "./lib-cortex-element.CVMmyPMC.js";
|
|
5
5
|
import { C, a as m } from "./color-swatch.BuUP5yG4.js";
|
|
@@ -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.COCT3Fsb.js";
|
|
13
13
|
import { C as L } from "./typography.oDzoLbZS.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";
|
|
@@ -5,11 +5,11 @@ import { c as f } from "./custom-element.L4WJXn1j.js";
|
|
|
5
5
|
import { L as C } from "./i18n.BUW7B9hr.js";
|
|
6
6
|
import { c as l } from "./math.DqTA6ya4.js";
|
|
7
7
|
import { w as x } from "./watch.BCJD77bD.js";
|
|
8
|
-
import { i as z, x as
|
|
8
|
+
import { i as z, x as p } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import { r as d } from "./state.CSDxrqLd.js";
|
|
10
10
|
import { e as S } from "./class-map.BiVq-cVR.js";
|
|
11
11
|
import { c as m } from "./repeat.DbF2p5ae.js";
|
|
12
|
-
import { n as
|
|
12
|
+
import { n as r } from "./when.Dr1es41R.js";
|
|
13
13
|
import { C as $ } from "./button.DS64Tr8Z.js";
|
|
14
14
|
import v from "../components/input.js";
|
|
15
15
|
import { C as w } from "./option.Csqefux_.js";
|
|
@@ -94,10 +94,10 @@ const O = z`
|
|
|
94
94
|
color: var(--cx-color-primary);
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
|
-
var
|
|
98
|
-
for (var o =
|
|
99
|
-
(u = t[h]) && (o = (
|
|
100
|
-
return
|
|
97
|
+
var M = Object.defineProperty, D = Object.getOwnPropertyDescriptor, a = (t, i, s, g) => {
|
|
98
|
+
for (var o = g > 1 ? void 0 : g ? D(i, s) : i, h = t.length - 1, u; h >= 0; h--)
|
|
99
|
+
(u = t[h]) && (o = (g ? u(i, s, o) : u(o)) || o);
|
|
100
|
+
return g && o && M(i, s, o), o;
|
|
101
101
|
};
|
|
102
102
|
let e = class extends b {
|
|
103
103
|
constructor() {
|
|
@@ -121,6 +121,9 @@ let e = class extends b {
|
|
|
121
121
|
get nextDisabled() {
|
|
122
122
|
return this._pageIndex >= this._pageCount;
|
|
123
123
|
}
|
|
124
|
+
get hasMultiplePages() {
|
|
125
|
+
return this._pageCount > 1;
|
|
126
|
+
}
|
|
124
127
|
updatePageCount() {
|
|
125
128
|
const t = Number.isFinite(this.pageSize) && this.pageSize > 0 ? this.pageSize : 1;
|
|
126
129
|
this._pageCount = Math.max(1, Math.ceil(this.count / t)), this.pageIndex = l(this.pageIndex, 1, this._pageCount);
|
|
@@ -160,7 +163,7 @@ let e = class extends b {
|
|
|
160
163
|
this._pageInputValue = this.pageIndex.toString();
|
|
161
164
|
}
|
|
162
165
|
renderCounterInput() {
|
|
163
|
-
return
|
|
166
|
+
return p`<cx-input
|
|
164
167
|
part="pagination-input"
|
|
165
168
|
class="pagination__page-input"
|
|
166
169
|
type="text"
|
|
@@ -197,7 +200,7 @@ let e = class extends b {
|
|
|
197
200
|
i && (this.pageIndex = Number(i.dataset.page));
|
|
198
201
|
}
|
|
199
202
|
renderPageButton(t) {
|
|
200
|
-
return
|
|
203
|
+
return p`
|
|
201
204
|
<cx-button
|
|
202
205
|
data-page=${t}
|
|
203
206
|
variant="text"
|
|
@@ -212,17 +215,17 @@ let e = class extends b {
|
|
|
212
215
|
`;
|
|
213
216
|
}
|
|
214
217
|
renderPageButtons() {
|
|
215
|
-
const t = Math.floor((this.paginationButtonCount - 1) / 2), i = Math.ceil((this.paginationButtonCount - 1) / 2),
|
|
218
|
+
const t = Math.floor((this.paginationButtonCount - 1) / 2), i = Math.ceil((this.paginationButtonCount - 1) / 2), s = Math.max(
|
|
216
219
|
1,
|
|
217
220
|
this._pageCount - this.pageIndex + t + 1 < this.paginationButtonCount ? this._pageCount - this.paginationButtonCount + 1 : this.pageIndex - t
|
|
218
|
-
),
|
|
221
|
+
), g = Math.min(
|
|
219
222
|
this._pageCount,
|
|
220
223
|
this.pageIndex <= i ? this.paginationButtonCount : this.pageIndex + i
|
|
221
224
|
);
|
|
222
|
-
return
|
|
225
|
+
return p`
|
|
223
226
|
<div class="pagination__pages" @click=${this.handlePageClick}>
|
|
224
227
|
${m(
|
|
225
|
-
Array.from({ length:
|
|
228
|
+
Array.from({ length: g - s + 1 }, (o, h) => h + s),
|
|
226
229
|
(o) => o,
|
|
227
230
|
(o) => this.renderPageButton(o)
|
|
228
231
|
)}
|
|
@@ -230,15 +233,17 @@ let e = class extends b {
|
|
|
230
233
|
`;
|
|
231
234
|
}
|
|
232
235
|
renderPageCount() {
|
|
233
|
-
return this.showPaginationInput ?
|
|
234
|
-
${this.renderCounterInput()}
|
|
235
|
-
<cx-typography variant="body3">${this.localize.term("itemOfTotal", "", this._pageCount)}</cx-typography>
|
|
236
|
-
</cx-space>` : s`<cx-typography variant="body3" class="pagination_count">
|
|
236
|
+
return !this.showPaginationInput || !this.hasMultiplePages ? p`<cx-typography variant="body3" class="pagination_count">
|
|
237
237
|
${this.localize.term("itemOfTotal", this.pageIndex, this._pageCount)}
|
|
238
|
-
</cx-typography
|
|
238
|
+
</cx-typography>` : p`<cx-space class="pagination_count">
|
|
239
|
+
${this.renderCounterInput()}
|
|
240
|
+
<cx-typography variant="body3">
|
|
241
|
+
${this.localize.term("itemOfTotal", "", this._pageCount)}
|
|
242
|
+
</cx-typography>
|
|
243
|
+
</cx-space>`;
|
|
239
244
|
}
|
|
240
245
|
renderRowCount() {
|
|
241
|
-
return
|
|
246
|
+
return p`<cx-typography variant="body3" class="pagination_count">
|
|
242
247
|
${this.localize.term(
|
|
243
248
|
"itemRangeOfTotal",
|
|
244
249
|
this.pageStart,
|
|
@@ -248,11 +253,11 @@ let e = class extends b {
|
|
|
248
253
|
</cx-typography>`;
|
|
249
254
|
}
|
|
250
255
|
render() {
|
|
251
|
-
return
|
|
256
|
+
return p`
|
|
252
257
|
<div class="pagination">
|
|
253
|
-
${
|
|
258
|
+
${r(
|
|
254
259
|
this.pageSizeOptions.length > 1,
|
|
255
|
-
() =>
|
|
260
|
+
() => p`
|
|
256
261
|
<label class="pagination__label__container">
|
|
257
262
|
<cx-typography variant="body3" class="pagination__label">
|
|
258
263
|
${this.label}
|
|
@@ -267,7 +272,7 @@ let e = class extends b {
|
|
|
267
272
|
${m(
|
|
268
273
|
this.pageSizeOptions,
|
|
269
274
|
(t) => t,
|
|
270
|
-
(t) =>
|
|
275
|
+
(t) => p`
|
|
271
276
|
<cx-option value=${t}>${t}</cx-option>
|
|
272
277
|
`
|
|
273
278
|
)}
|
|
@@ -275,70 +280,75 @@ let e = class extends b {
|
|
|
275
280
|
</label>
|
|
276
281
|
`
|
|
277
282
|
)}
|
|
278
|
-
${
|
|
283
|
+
${r(
|
|
279
284
|
this.paginationCounter === c.Both || this.paginationCounter === c.Rows,
|
|
280
285
|
() => this.renderRowCount(),
|
|
281
286
|
() => this.renderPageCount()
|
|
282
287
|
)}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
${r(
|
|
289
|
+
this.hasMultiplePages,
|
|
290
|
+
() => p`
|
|
291
|
+
<div class="pagination__navigation-buttons">
|
|
292
|
+
${r(
|
|
293
|
+
this.showFirst,
|
|
294
|
+
() => p`
|
|
295
|
+
<cx-tooltip hoist content=${this.localize.term("first")}>
|
|
296
|
+
<cx-icon-button
|
|
297
|
+
class="pagination__first"
|
|
298
|
+
label=${this.localize.term("first")}
|
|
299
|
+
name="first_page"
|
|
300
|
+
size=${this.iconButtonSize}
|
|
301
|
+
?disabled=${this.prevDisabled}
|
|
302
|
+
@click=${this.handleFirst}
|
|
303
|
+
></cx-icon-button>
|
|
304
|
+
</cx-tooltip>
|
|
305
|
+
`
|
|
306
|
+
)}
|
|
307
|
+
<cx-tooltip hoist content=${this.localize.term("previous")}>
|
|
288
308
|
<cx-icon-button
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
309
|
+
part="back-icon"
|
|
310
|
+
class="pagination__back"
|
|
311
|
+
label=${this.localize.term("previous")}
|
|
312
|
+
name=${this.backIconName}
|
|
292
313
|
size=${this.iconButtonSize}
|
|
293
314
|
?disabled=${this.prevDisabled}
|
|
294
|
-
@click=${this.
|
|
315
|
+
@click=${this.handleBack}
|
|
295
316
|
></cx-icon-button>
|
|
296
317
|
</cx-tooltip>
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
label=${this.localize.term("previous")}
|
|
304
|
-
name=${this.backIconName}
|
|
305
|
-
size=${this.iconButtonSize}
|
|
306
|
-
?disabled=${this.prevDisabled}
|
|
307
|
-
@click=${this.handleBack}
|
|
308
|
-
></cx-icon-button>
|
|
309
|
-
</cx-tooltip>
|
|
310
|
-
${g(
|
|
311
|
-
this.paginationCounter === c.Both,
|
|
312
|
-
() => this.renderPageCount()
|
|
313
|
-
)}
|
|
314
|
-
${g(this.showPaginationButtons, () => this.renderPageButtons())}
|
|
315
|
-
<cx-tooltip hoist content=${this.localize.term("next")}>
|
|
316
|
-
<cx-icon-button
|
|
317
|
-
part="next-icon"
|
|
318
|
-
class="pagination__forward"
|
|
319
|
-
label=${this.localize.term("next")}
|
|
320
|
-
name=${this.nextIconName}
|
|
321
|
-
size=${this.iconButtonSize}
|
|
322
|
-
?disabled=${this.nextDisabled}
|
|
323
|
-
@click=${this.handleForward}
|
|
324
|
-
></cx-icon-button>
|
|
325
|
-
</cx-tooltip>
|
|
326
|
-
${g(
|
|
327
|
-
this.showLast,
|
|
328
|
-
() => s`
|
|
329
|
-
<cx-tooltip hoist content=${this.localize.term("last")}>
|
|
318
|
+
${r(
|
|
319
|
+
this.paginationCounter === c.Both,
|
|
320
|
+
() => this.renderPageCount()
|
|
321
|
+
)}
|
|
322
|
+
${r(this.showPaginationButtons, () => this.renderPageButtons())}
|
|
323
|
+
<cx-tooltip hoist content=${this.localize.term("next")}>
|
|
330
324
|
<cx-icon-button
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
325
|
+
part="next-icon"
|
|
326
|
+
class="pagination__forward"
|
|
327
|
+
label=${this.localize.term("next")}
|
|
328
|
+
name=${this.nextIconName}
|
|
334
329
|
size=${this.iconButtonSize}
|
|
335
330
|
?disabled=${this.nextDisabled}
|
|
336
|
-
@click=${this.
|
|
331
|
+
@click=${this.handleForward}
|
|
337
332
|
></cx-icon-button>
|
|
338
333
|
</cx-tooltip>
|
|
339
|
-
|
|
334
|
+
${r(
|
|
335
|
+
this.showLast,
|
|
336
|
+
() => p`
|
|
337
|
+
<cx-tooltip hoist content=${this.localize.term("last")}>
|
|
338
|
+
<cx-icon-button
|
|
339
|
+
class="pagination__last"
|
|
340
|
+
label=${this.localize.term("last")}
|
|
341
|
+
name="last_page"
|
|
342
|
+
size=${this.iconButtonSize}
|
|
343
|
+
?disabled=${this.nextDisabled}
|
|
344
|
+
@click=${this.handleLast}
|
|
345
|
+
></cx-icon-button>
|
|
346
|
+
</cx-tooltip>
|
|
347
|
+
`
|
|
348
|
+
)}
|
|
349
|
+
</div>
|
|
350
|
+
`
|
|
340
351
|
)}
|
|
341
|
-
</div>
|
|
342
352
|
</div>
|
|
343
353
|
`;
|
|
344
354
|
}
|
|
@@ -362,7 +372,7 @@ a([
|
|
|
362
372
|
attribute: "page-size-options",
|
|
363
373
|
converter: {
|
|
364
374
|
fromAttribute: (t) => {
|
|
365
|
-
const i = (t ?? "").trim().split(/\s+/).map((
|
|
375
|
+
const i = (t ?? "").trim().split(/\s+/).map((s) => Number.parseInt(s, 10)).filter((s) => Number.isFinite(s) && s > 0);
|
|
366
376
|
return i.length ? i : [];
|
|
367
377
|
},
|
|
368
378
|
toAttribute: (t) => t.join(" ")
|
|
@@ -9,7 +9,7 @@ import Ns from "../components/spinner.js";
|
|
|
9
9
|
import { n as g, C as Ne } from "./lib-cortex-element.CVMmyPMC.js";
|
|
10
10
|
import { c as qe } from "./component.styles.DMSLciL5.js";
|
|
11
11
|
import { o as Vs, O as $i } from "./overlayscrollbars.XhGWx9Zk.js";
|
|
12
|
-
import { C as Is, P as Bs } from "./pagination.
|
|
12
|
+
import { C as Is, P as Bs } from "./pagination.DZq0IZjI.js";
|
|
13
13
|
import { c as Ve } from "./custom-element.L4WJXn1j.js";
|
|
14
14
|
import { L as lt } from "./i18n.BUW7B9hr.js";
|
|
15
15
|
import { w as _ } from "./watch.BCJD77bD.js";
|
|
@@ -1451,8 +1451,9 @@ const bo = H`
|
|
|
1451
1451
|
}
|
|
1452
1452
|
|
|
1453
1453
|
.tabulator .tabulator-alert.tabulator-alert-state-loading {
|
|
1454
|
-
|
|
1455
|
-
|
|
1454
|
+
--loading-offset: var(--cx-spacing-x-small);
|
|
1455
|
+
top: calc(var(--header-height, var(--cx-spacing-3x-large)) + var(--border-width) + var(--loading-offset));
|
|
1456
|
+
height: calc(100% - var(--header-height, var(--cx-spacing-3x-large)) - var(--border-width) - var(--loading-offset));
|
|
1456
1457
|
}
|
|
1457
1458
|
|
|
1458
1459
|
.tabulator.tabulator-header-hidden .tabulator-alert.tabulator-alert-state-loading {
|
|
@@ -3409,7 +3410,7 @@ const Rs = function(a, e, t) {
|
|
|
3409
3410
|
return a;
|
|
3410
3411
|
}, Be = process.env.NODE_ENV === "development", Z = class Z extends R {
|
|
3411
3412
|
constructor(e) {
|
|
3412
|
-
super(e), this.fetchApi = fetch, this.config = {}, this.url = "", this.urlGenerator = !1, this.params = !1, this.loaderPromise = !1, this.registerTableOption("ajaxURL", !1), this.registerTableOption("ajaxURLGenerator", !1), this.registerTableOption("ajaxParams", {}), this.registerTableOption("ajaxConfig", "get"), this.registerTableOption("ajaxContentType", "form"), this.registerTableOption("ajaxRequestFunc", !1), this.registerTableOption("ajaxRequesting", () => {
|
|
3413
|
+
super(e), this.fetchApi = typeof globalThis.fetch == "function" ? globalThis.fetch.bind(globalThis) : void 0, this.config = {}, this.url = "", this.urlGenerator = !1, this.params = !1, this.loaderPromise = !1, this.registerTableOption("ajaxURL", !1), this.registerTableOption("ajaxURLGenerator", !1), this.registerTableOption("ajaxParams", {}), this.registerTableOption("ajaxConfig", "get"), this.registerTableOption("ajaxContentType", "form"), this.registerTableOption("ajaxRequestFunc", !1), this.registerTableOption("ajaxRequesting", () => {
|
|
3413
3414
|
}), this.registerTableOption("ajaxResponse", !1), this.contentTypeFormatters = Z.contentTypeFormatters;
|
|
3414
3415
|
}
|
|
3415
3416
|
// initialize setup options
|
|
@@ -3481,21 +3482,28 @@ Z.moduleName = "ajax", Z.defaultConfig = $o, Z.defaultURLGenerator = Rs, Z.conte
|
|
|
3481
3482
|
"Ajax Error - Invalid ajaxContentType value:",
|
|
3482
3483
|
this.table.options.ajaxContentType
|
|
3483
3484
|
);
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3485
|
+
if (e) {
|
|
3486
|
+
if (typeof t.headers > "u" && (t.headers = {}), typeof t.headers.Accept > "u" && (t.headers.Accept = "application/json"), typeof t.headers["X-Requested-With"] > "u" && (t.headers["X-Requested-With"] = "XMLHttpRequest"), typeof t.mode > "u" && (t.mode = "cors"), t.mode == "cors" ? typeof t.credentials > "u" && (t.credentials = "same-origin") : typeof t.credentials > "u" && (t.credentials = "include"), !this.fetchApi) {
|
|
3487
|
+
r(new Error("fetch is not available"));
|
|
3488
|
+
return;
|
|
3489
|
+
}
|
|
3490
|
+
this.fetchApi(e, t).then((n) => {
|
|
3491
|
+
n.ok ? n.json().then((l) => {
|
|
3492
|
+
o(l);
|
|
3493
|
+
}).catch((l) => {
|
|
3494
|
+
r(l), Be && console.warn(
|
|
3495
|
+
"Ajax Load Error - Invalid JSON returned",
|
|
3496
|
+
l
|
|
3497
|
+
);
|
|
3498
|
+
}) : (Be && console.error(
|
|
3499
|
+
"Ajax Load Error - Connection Error: " + n.status,
|
|
3500
|
+
n.statusText
|
|
3501
|
+
), r(n));
|
|
3502
|
+
}).catch((n) => {
|
|
3503
|
+
Be && console.error("Ajax Load Error - Connection Error: ", n), r(n);
|
|
3504
|
+
});
|
|
3505
|
+
} else
|
|
3506
|
+
Be && console.warn("Ajax Load Error - No URL Set"), o([]);
|
|
3499
3507
|
});
|
|
3500
3508
|
};
|
|
3501
3509
|
let kt = Z;
|
|
@@ -7048,7 +7056,7 @@ let ot = fe;
|
|
|
7048
7056
|
const ie = process.env.NODE_ENV === "development", Mn = x` <cx-option></cx-option>`, kn = x` <cx-divider></cx-divider>`;
|
|
7049
7057
|
class Ln {
|
|
7050
7058
|
constructor(e, t, i, s, o, r) {
|
|
7051
|
-
this._itemsMap = /* @__PURE__ */ new Map(), this.
|
|
7059
|
+
this._itemsMap = /* @__PURE__ */ new Map(), this.table = e.table, this.cell = t, this.params = this._initializeParams(r), this.fetchApi = typeof globalThis.fetch == "function" ? globalThis.fetch.bind(globalThis) : void 0, this.data = [], this.displayItems = [], this.focusedItem = null, this.input = this._createSelectElement(), this.initialValue = void 0, this.initialValues = [], this.isHeaderFilter = t.row?.type === "header", this.typing = !1, this.listIteration = 0, this.lastAction = "", this.actions = {
|
|
7052
7060
|
cancel: o,
|
|
7053
7061
|
success: s
|
|
7054
7062
|
}, this._initializeValue(), i(this._onRendered.bind(this)), this.clickStop = this.clickStop.bind(this);
|
|
@@ -7064,7 +7072,10 @@ class Ln {
|
|
|
7064
7072
|
let e = this.cell.getValue();
|
|
7065
7073
|
await this.rebuildOptionsList();
|
|
7066
7074
|
const { defaultValue: t } = this.params;
|
|
7067
|
-
e == null && t
|
|
7075
|
+
e == null && t != null && (e = t), this.initialValue = e, e == null ? (this.initialValues = [], this.input.value = []) : (this.initialValues = this._getSanitizedInitialValues(e), this.input.value = this.initialValues), this.input.handleValueChange(), this.isHeaderFilter && this.headerFilterInitialListGen();
|
|
7076
|
+
}
|
|
7077
|
+
_getSanitizedInitialValues(e) {
|
|
7078
|
+
return (Array.isArray(e) ? e : [e]).map((i) => this.sanitizeValue(i));
|
|
7068
7079
|
}
|
|
7069
7080
|
async _onRendered() {
|
|
7070
7081
|
await this.input.updateComplete;
|
|
@@ -7111,16 +7122,24 @@ class Ln {
|
|
|
7111
7122
|
return typeof e == "string" ? t = qs(e) : t = e, t && (t.slot = "prefix"), t;
|
|
7112
7123
|
}
|
|
7113
7124
|
_createSelectElement() {
|
|
7114
|
-
const {
|
|
7125
|
+
const {
|
|
7126
|
+
autocomplete: e,
|
|
7127
|
+
clearable: t,
|
|
7128
|
+
fallbackOptionValue: i,
|
|
7129
|
+
freeWidth: s,
|
|
7130
|
+
placeholder: o
|
|
7131
|
+
} = this.params, r = x`
|
|
7115
7132
|
<cx-select
|
|
7116
7133
|
style="width: 100%; margin: auto;"
|
|
7117
7134
|
hoist
|
|
7118
7135
|
?clearable=${t}
|
|
7119
|
-
?free-width=${
|
|
7120
|
-
placeholder=${be(
|
|
7136
|
+
?free-width=${s ?? !1}
|
|
7137
|
+
placeholder=${be(o)}
|
|
7121
7138
|
></cx-select>
|
|
7122
|
-
`,
|
|
7123
|
-
|
|
7139
|
+
`, n = T(r);
|
|
7140
|
+
i && (n.fallbackOptionValue = this.sanitizeValue(i));
|
|
7141
|
+
const l = this.createPrefixElement();
|
|
7142
|
+
return l && n.prepend(l), e || (n.style.cursor = "default", n.style.caretColor = "transparent"), this._bindInputEvents(n), n;
|
|
7124
7143
|
}
|
|
7125
7144
|
_initializeParams(e) {
|
|
7126
7145
|
const t = /* @__PURE__ */ new Set(["values", "valuesURL", "valuesLookup"]);
|
|
@@ -7207,6 +7226,8 @@ class Ln {
|
|
|
7207
7226
|
e = Rs(e, {}, o);
|
|
7208
7227
|
let r = [];
|
|
7209
7228
|
try {
|
|
7229
|
+
if (!this.fetchApi)
|
|
7230
|
+
throw new Error("fetch is not available");
|
|
7210
7231
|
const n = await this.fetchApi(e);
|
|
7211
7232
|
if (!n.ok)
|
|
7212
7233
|
return ie && console.error(
|
|
@@ -7257,10 +7278,36 @@ class Ln {
|
|
|
7257
7278
|
});
|
|
7258
7279
|
const r = this._parseListItem(o, 0);
|
|
7259
7280
|
t.push(r);
|
|
7260
|
-
});
|
|
7281
|
+
}), this._appendFallbackOptionItem(t);
|
|
7261
7282
|
const { freetext: s } = this.params;
|
|
7262
7283
|
return s && (this.input.value = Array.isArray(this.initialValues) ? this.initialValues.join(",") : String(this.initialValues || ""), this.typing = !0, this.lastAction = "typing"), this.data = t, this._rebuildItemsMap(), t;
|
|
7263
7284
|
}
|
|
7285
|
+
/**
|
|
7286
|
+
* Appends a fallback option when `fallbackOptionValue` is configured
|
|
7287
|
+
* and not explicitly declared in the list values.
|
|
7288
|
+
*/
|
|
7289
|
+
_appendFallbackOptionItem(e) {
|
|
7290
|
+
const { fallbackOptionLabel: t = "Custom", fallbackOptionValue: i } = this.params;
|
|
7291
|
+
if (!i)
|
|
7292
|
+
return;
|
|
7293
|
+
const s = this.sanitizeValue(i);
|
|
7294
|
+
this._hasListItemValue(e, s) || e.push(
|
|
7295
|
+
this._parseListItem(
|
|
7296
|
+
{
|
|
7297
|
+
label: t,
|
|
7298
|
+
value: i
|
|
7299
|
+
},
|
|
7300
|
+
0
|
|
7301
|
+
)
|
|
7302
|
+
);
|
|
7303
|
+
}
|
|
7304
|
+
/**
|
|
7305
|
+
* Checks recursively whether grouped/flat list items already contain
|
|
7306
|
+
* a given sanitized option value.
|
|
7307
|
+
*/
|
|
7308
|
+
_hasListItemValue(e, t) {
|
|
7309
|
+
return e.some((i) => i.group && i.options ? this._hasListItemValue(i.options, t) : i.sanitizedValue === t);
|
|
7310
|
+
}
|
|
7264
7311
|
_parseListItem(e, t) {
|
|
7265
7312
|
let i;
|
|
7266
7313
|
return e.options ? i = this._parseListGroup(e, t + 1) : (i = {
|
|
@@ -7424,12 +7471,67 @@ class Ln {
|
|
|
7424
7471
|
if (!s.length)
|
|
7425
7472
|
return t ? i : this.input.value;
|
|
7426
7473
|
if (this.input.multiple)
|
|
7427
|
-
return
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
const
|
|
7432
|
-
return
|
|
7474
|
+
return this._getCommittedMultipleOutput(s);
|
|
7475
|
+
const o = this.input.getOptionValue(s[0]);
|
|
7476
|
+
if (this._hasPreservedFallbackOptionOutput(o))
|
|
7477
|
+
return this.initialValue;
|
|
7478
|
+
const r = this._getMappedOptionOutput(o);
|
|
7479
|
+
return t && r === "" ? i : r;
|
|
7480
|
+
}
|
|
7481
|
+
/**
|
|
7482
|
+
* Resolves the selected values once so preserved fallback arrays are not
|
|
7483
|
+
* inserted into a single selected-option slot.
|
|
7484
|
+
*/
|
|
7485
|
+
_getCommittedMultipleOutput(e) {
|
|
7486
|
+
const t = e.map((s) => this.input.getOptionValue(s)), i = this._getPreservedFallbackMultipleOutput(t);
|
|
7487
|
+
return i.hasValue ? i.value : t.map(
|
|
7488
|
+
(s) => this._getMappedOptionOutput(s)
|
|
7489
|
+
);
|
|
7490
|
+
}
|
|
7491
|
+
_getMappedOptionOutput(e) {
|
|
7492
|
+
const t = this._itemsMap.get(e);
|
|
7493
|
+
return t ? t.value : e;
|
|
7494
|
+
}
|
|
7495
|
+
_getPreservedInputValueOutput(e) {
|
|
7496
|
+
const t = this._itemsMap.get(this.sanitizeValue(e));
|
|
7497
|
+
return t ? t.value : e;
|
|
7498
|
+
}
|
|
7499
|
+
_getPreservedFallbackMultipleOutput(e) {
|
|
7500
|
+
const { fallbackOptionValue: t } = this.params;
|
|
7501
|
+
if (!t)
|
|
7502
|
+
return { hasValue: !1 };
|
|
7503
|
+
const i = this.sanitizeValue(t);
|
|
7504
|
+
if (!e.includes(
|
|
7505
|
+
i
|
|
7506
|
+
))
|
|
7507
|
+
return { hasValue: !1 };
|
|
7508
|
+
const o = Array.isArray(this.input.value) ? this.input.value : [this.input.value];
|
|
7509
|
+
return this._hasPreservedUnmatchedInputValue(
|
|
7510
|
+
o,
|
|
7511
|
+
i
|
|
7512
|
+
) ? {
|
|
7513
|
+
hasValue: !0,
|
|
7514
|
+
value: o.map(
|
|
7515
|
+
(r) => this._getPreservedInputValueOutput(r)
|
|
7516
|
+
)
|
|
7517
|
+
} : { hasValue: !1 };
|
|
7518
|
+
}
|
|
7519
|
+
/**
|
|
7520
|
+
* Checks for a preserved unmatched editor value when the selected option is
|
|
7521
|
+
* the configured fallback option used for undeclared values.
|
|
7522
|
+
*/
|
|
7523
|
+
_hasPreservedFallbackOptionOutput(e) {
|
|
7524
|
+
const { fallbackOptionValue: t } = this.params;
|
|
7525
|
+
if (!t || e !== this.sanitizeValue(t))
|
|
7526
|
+
return !1;
|
|
7527
|
+
const i = Array.isArray(this.input.value) ? this.input.value : [this.input.value];
|
|
7528
|
+
return this._hasPreservedUnmatchedInputValue(i, e);
|
|
7529
|
+
}
|
|
7530
|
+
_hasPreservedUnmatchedInputValue(e, t) {
|
|
7531
|
+
return e.some((i) => {
|
|
7532
|
+
const s = String(i);
|
|
7533
|
+
return s !== "" && s !== t && !this._itemsMap.has(s);
|
|
7534
|
+
});
|
|
7433
7535
|
}
|
|
7434
7536
|
_resolveValue(e) {
|
|
7435
7537
|
const t = e === void 0 ? this._getCommittedOutput() : e.value;
|
|
@@ -47,7 +47,7 @@ import { default as ze } from "./menu-label.js";
|
|
|
47
47
|
import { default as qe } from "./menu-section.js";
|
|
48
48
|
import { default as Ke } from "./mutation-observer.js";
|
|
49
49
|
import { C as We } from "../chunks/option.Csqefux_.js";
|
|
50
|
-
import { C as Ye } from "../chunks/pagination.
|
|
50
|
+
import { C as Ye } from "../chunks/pagination.DZq0IZjI.js";
|
|
51
51
|
import { default as _e } from "./popup.js";
|
|
52
52
|
import { default as ea } from "./progress-bar.js";
|
|
53
53
|
import { default as oa } from "./progress-ring.js";
|
|
@@ -70,7 +70,7 @@ import { default as ka } from "./stepper.js";
|
|
|
70
70
|
import { default as Ea } from "./switch.js";
|
|
71
71
|
import { default as La } from "./tab.js";
|
|
72
72
|
import { C as ja } from "../chunks/tab-group.Dg6a82ei.js";
|
|
73
|
-
import { C as za } from "../chunks/table.
|
|
73
|
+
import { C as za } from "../chunks/table.COCT3Fsb.js";
|
|
74
74
|
import { default as qa } from "./tab-panel.js";
|
|
75
75
|
import { default as Ka } from "./tag.js";
|
|
76
76
|
import { default as Wa } from "./textarea.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./space.js";
|
|
2
|
-
import "../chunks/table.
|
|
2
|
+
import "../chunks/table.COCT3Fsb.js";
|
|
3
3
|
import "../chunks/typography.oDzoLbZS.js";
|
|
4
4
|
import "../chunks/lib-cortex-element.CVMmyPMC.js";
|
|
5
5
|
import "../chunks/color-swatch.BuUP5yG4.js";
|
|
6
6
|
import "../chunks/component.styles.DMSLciL5.js";
|
|
7
|
-
import { C as w } from "../chunks/color-swatch-group.
|
|
7
|
+
import { C as w } from "../chunks/color-swatch-group.DLXAJdU4.js";
|
|
8
8
|
import "../chunks/content-builder.B4Tqoc6M.js";
|
|
9
9
|
import "../chunks/custom-element.L4WJXn1j.js";
|
|
10
10
|
import "../chunks/debounce.DaHuiSGU.js";
|
|
@@ -9,7 +9,7 @@ import "./radio.js";
|
|
|
9
9
|
import "./radio-group.js";
|
|
10
10
|
import "./select.js";
|
|
11
11
|
import "./space.js";
|
|
12
|
-
import "../chunks/table.
|
|
12
|
+
import "../chunks/table.COCT3Fsb.js";
|
|
13
13
|
import "../chunks/typography.oDzoLbZS.js";
|
|
14
14
|
import "../chunks/lib-cortex-element.CVMmyPMC.js";
|
|
15
15
|
import "./dynamic-select.js";
|
|
@@ -18,7 +18,7 @@ import "../chunks/custom-element.L4WJXn1j.js";
|
|
|
18
18
|
import "../chunks/debounce.DaHuiSGU.js";
|
|
19
19
|
import "../chunks/i18n.BUW7B9hr.js";
|
|
20
20
|
import "../chunks/watch.BCJD77bD.js";
|
|
21
|
-
import { c as E, C as F } from "../chunks/list-editor.
|
|
21
|
+
import { c as E, C as F } from "../chunks/list-editor.C2ZRwPIG.js";
|
|
22
22
|
import "../chunks/lit-element.jLBm65_O.js";
|
|
23
23
|
import "../chunks/state.CSDxrqLd.js";
|
|
24
24
|
import "../chunks/query.BBf1UFkC.js";
|
|
@@ -6,7 +6,7 @@ import { default as u } from "./corner-position-input-group.js";
|
|
|
6
6
|
import { C as m } from "../chunks/cropper.D1lO3pl-.js";
|
|
7
7
|
import { default as i } from "./dynamic-select.js";
|
|
8
8
|
import { C as c } from "../chunks/folder-select.B2qxSKA5.js";
|
|
9
|
-
import { C as P } from "../chunks/list-editor.
|
|
9
|
+
import { C as P } from "../chunks/list-editor.C2ZRwPIG.js";
|
|
10
10
|
import { default as I } from "./masonry.js";
|
|
11
11
|
import { default as y } from "./padding-input-group.js";
|
|
12
12
|
import { default as w } from "./position-picker.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as a } from "./asset-link-format.js";
|
|
2
|
-
import { C as t } from "../chunks/color-swatch-group.
|
|
2
|
+
import { C as t } from "../chunks/color-swatch-group.DLXAJdU4.js";
|
|
3
3
|
import { C } from "../chunks/file-on-demand.BTTdth3o.js";
|
|
4
4
|
export {
|
|
5
5
|
a as CxAssetLinkFormat,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./space.js";
|
|
2
2
|
import "../chunks/lib-cortex-element.CVMmyPMC.js";
|
|
3
3
|
import "../chunks/icon-button.C3eqeQl9.js";
|
|
4
|
-
import { C as k } from "../chunks/pagination.
|
|
4
|
+
import { C as k } from "../chunks/pagination.DZq0IZjI.js";
|
|
5
5
|
import "../chunks/custom-element.L4WJXn1j.js";
|
|
6
6
|
import "../chunks/i18n.BUW7B9hr.js";
|
|
7
7
|
import "../chunks/math.DqTA6ya4.js";
|