@cargosense/cargo-design-system 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/assets/index.es.js
CHANGED
|
@@ -263,22 +263,22 @@ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[f("elementProper
|
|
|
263
263
|
* Copyright 2017 Google LLC
|
|
264
264
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
265
265
|
*/
|
|
266
|
-
const m = globalThis, b = m.trustedTypes, Z = b ? b.createPolicy("lit-html", { createHTML: (Q) => Q }) : void 0, QA = "$lit$",
|
|
267
|
-
\f\r]`, v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, q = /-->/g, $ = />/g,
|
|
266
|
+
const m = globalThis, b = m.trustedTypes, Z = b ? b.createPolicy("lit-html", { createHTML: (Q) => Q }) : void 0, QA = "$lit$", l = `lit$${Math.random().toFixed(9).slice(2)}$`, EA = "?" + l, nA = `<${EA}>`, d = document, J = () => d.createComment(""), N = (Q) => Q === null || typeof Q != "object" && typeof Q != "function", k = Array.isArray, FA = (Q) => k(Q) || typeof Q?.[Symbol.iterator] == "function", T = `[
|
|
267
|
+
\f\r]`, v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, q = /-->/g, $ = />/g, h = RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^
|
|
268
268
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), _ = /'/g, AA = /"/g, eA = /^(?:script|style|textarea|title)$/i, aA = (Q) => (A, ...g) => ({ _$litType$: Q, strings: A, values: g }), t = aA(1), u = Symbol.for("lit-noChange"), M = Symbol.for("lit-nothing"), gA = /* @__PURE__ */ new WeakMap(), U = d.createTreeWalker(d, 129);
|
|
269
269
|
function IA(Q, A) {
|
|
270
270
|
if (!k(Q) || !Q.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
271
271
|
return Z !== void 0 ? Z.createHTML(A) : A;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const lA = (Q, A) => {
|
|
274
274
|
const g = Q.length - 1, B = [];
|
|
275
275
|
let C, E = A === 2 ? "<svg>" : A === 3 ? "<math>" : "", e = v;
|
|
276
276
|
for (let s = 0; s < g; s++) {
|
|
277
277
|
const I = Q[s];
|
|
278
278
|
let r, Y, o = -1, F = 0;
|
|
279
|
-
for (; F < I.length && (e.lastIndex = F, Y = e.exec(I), Y !== null); ) F = e.lastIndex, e === v ? Y[1] === "!--" ? e = q : Y[1] !== void 0 ? e = $ : Y[2] !== void 0 ? (eA.test(Y[2]) && (C = RegExp("</" + Y[2], "g")), e =
|
|
280
|
-
const a = e ===
|
|
281
|
-
E += e === v ? I + nA : o >= 0 ? (B.push(r), I.slice(0, o) + QA + I.slice(o) +
|
|
279
|
+
for (; F < I.length && (e.lastIndex = F, Y = e.exec(I), Y !== null); ) F = e.lastIndex, e === v ? Y[1] === "!--" ? e = q : Y[1] !== void 0 ? e = $ : Y[2] !== void 0 ? (eA.test(Y[2]) && (C = RegExp("</" + Y[2], "g")), e = h) : Y[3] !== void 0 && (e = h) : e === h ? Y[0] === ">" ? (e = C ?? v, o = -1) : Y[1] === void 0 ? o = -2 : (o = e.lastIndex - Y[2].length, r = Y[1], e = Y[3] === void 0 ? h : Y[3] === '"' ? AA : _) : e === AA || e === _ ? e = h : e === q || e === $ ? e = v : (e = h, C = void 0);
|
|
280
|
+
const a = e === h && Q[s + 1].startsWith("/>") ? " " : "";
|
|
281
|
+
E += e === v ? I + nA : o >= 0 ? (B.push(r), I.slice(0, o) + QA + I.slice(o) + l + a) : I + l + (o === -2 ? s : a);
|
|
282
282
|
}
|
|
283
283
|
return [IA(Q, E + (Q[g] || "<?>") + (A === 2 ? "</svg>" : A === 3 ? "</math>" : "")), B];
|
|
284
284
|
};
|
|
@@ -287,7 +287,7 @@ class z {
|
|
|
287
287
|
let C;
|
|
288
288
|
this.parts = [];
|
|
289
289
|
let E = 0, e = 0;
|
|
290
|
-
const s = A.length - 1, I = this.parts, [r, Y] =
|
|
290
|
+
const s = A.length - 1, I = this.parts, [r, Y] = lA(A, g);
|
|
291
291
|
if (this.el = z.createElement(r, B), U.currentNode = this.el.content, g === 2 || g === 3) {
|
|
292
292
|
const o = this.el.content.firstChild;
|
|
293
293
|
o.replaceWith(...o.childNodes);
|
|
@@ -295,11 +295,11 @@ class z {
|
|
|
295
295
|
for (; (C = U.nextNode()) !== null && I.length < s; ) {
|
|
296
296
|
if (C.nodeType === 1) {
|
|
297
297
|
if (C.hasAttributes()) for (const o of C.getAttributeNames()) if (o.endsWith(QA)) {
|
|
298
|
-
const F = Y[e++], a = C.getAttribute(o).split(
|
|
298
|
+
const F = Y[e++], a = C.getAttribute(o).split(l), y = /([.?@])?(.*)/.exec(F);
|
|
299
299
|
I.push({ type: 1, index: E, name: y[2], strings: a, ctor: y[1] === "." ? UA : y[1] === "?" ? dA : y[1] === "@" ? GA : x }), C.removeAttribute(o);
|
|
300
|
-
} else o.startsWith(
|
|
300
|
+
} else o.startsWith(l) && (I.push({ type: 6, index: E }), C.removeAttribute(o));
|
|
301
301
|
if (eA.test(C.tagName)) {
|
|
302
|
-
const o = C.textContent.split(
|
|
302
|
+
const o = C.textContent.split(l), F = o.length - 1;
|
|
303
303
|
if (F > 0) {
|
|
304
304
|
C.textContent = b ? b.emptyScript : "";
|
|
305
305
|
for (let a = 0; a < F; a++) C.append(o[a], J()), U.nextNode(), I.push({ type: 2, index: ++E });
|
|
@@ -309,7 +309,7 @@ class z {
|
|
|
309
309
|
} else if (C.nodeType === 8) if (C.data === EA) I.push({ type: 2, index: E });
|
|
310
310
|
else {
|
|
311
311
|
let o = -1;
|
|
312
|
-
for (; (o = C.data.indexOf(
|
|
312
|
+
for (; (o = C.data.indexOf(l, o + 1)) !== -1; ) I.push({ type: 7, index: E }), o += l.length - 1;
|
|
313
313
|
}
|
|
314
314
|
E++;
|
|
315
315
|
}
|
|
@@ -325,7 +325,7 @@ function P(Q, A, g = Q, B) {
|
|
|
325
325
|
const E = N(A) ? void 0 : A._$litDirective$;
|
|
326
326
|
return C?.constructor !== E && (C?._$AO?.(!1), E === void 0 ? C = void 0 : (C = new E(Q), C._$AT(Q, g, B)), B !== void 0 ? (g._$Co ??= [])[B] = C : g._$Cl = C), C !== void 0 && (A = P(Q, C._$AS(Q, A.values), C, B)), A;
|
|
327
327
|
}
|
|
328
|
-
class
|
|
328
|
+
class hA {
|
|
329
329
|
constructor(A, g) {
|
|
330
330
|
this._$AV = [], this._$AN = void 0, this._$AD = A, this._$AM = g;
|
|
331
331
|
}
|
|
@@ -387,7 +387,7 @@ class H {
|
|
|
387
387
|
const { values: g, _$litType$: B } = A, C = typeof B == "number" ? this._$AC(A) : (B.el === void 0 && (B.el = z.createElement(IA(B.h, B.h[0]), this.options)), B);
|
|
388
388
|
if (this._$AH?._$AD === C) this._$AH.p(g);
|
|
389
389
|
else {
|
|
390
|
-
const E = new
|
|
390
|
+
const E = new hA(C, this), e = E.u(this.options);
|
|
391
391
|
E.p(g), this.T(e), this._$AH = E;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
@@ -2148,10 +2148,12 @@ class XA extends w {
|
|
|
2148
2148
|
`;
|
|
2149
2149
|
static properties = {
|
|
2150
2150
|
name: {
|
|
2151
|
-
type: String
|
|
2151
|
+
type: String,
|
|
2152
|
+
reflect: !0
|
|
2152
2153
|
},
|
|
2153
2154
|
value: {
|
|
2154
|
-
type: String
|
|
2155
|
+
type: String,
|
|
2156
|
+
reflect: !0
|
|
2155
2157
|
},
|
|
2156
2158
|
disabled: {
|
|
2157
2159
|
type: Boolean,
|
|
@@ -2170,6 +2172,11 @@ class XA extends w {
|
|
|
2170
2172
|
reflect: !0,
|
|
2171
2173
|
attribute: "selected-item"
|
|
2172
2174
|
},
|
|
2175
|
+
blank: {
|
|
2176
|
+
type: Boolean,
|
|
2177
|
+
reflect: !0,
|
|
2178
|
+
attribute: "blank"
|
|
2179
|
+
},
|
|
2173
2180
|
error: {
|
|
2174
2181
|
type: Boolean,
|
|
2175
2182
|
reflect: !0
|
|
@@ -2194,7 +2201,7 @@ class XA extends w {
|
|
|
2194
2201
|
}
|
|
2195
2202
|
};
|
|
2196
2203
|
constructor() {
|
|
2197
|
-
super(), this.name = void 0, this.value = void 0, this.disabled = !1, this.required = !1, this.error = !1, this.placeholder = void 0, this.fullWidth = !1, this.items = [], this.selectedItem = void 0, this._internals = this.attachInternals();
|
|
2204
|
+
super(), this.name = void 0, this.value = void 0, this.disabled = !1, this.required = !1, this.error = !1, this.placeholder = void 0, this.fullWidth = !1, this.items = [], this.selectedItem = void 0, this.blank = void 0, this._internals = this.attachInternals();
|
|
2198
2205
|
}
|
|
2199
2206
|
render() {
|
|
2200
2207
|
return t`
|
|
@@ -2208,8 +2215,9 @@ class XA extends w {
|
|
|
2208
2215
|
class="${this.error ? "input-error" : ""} ${this.size} ${this.fullWidth ? "full-width" : ""}"
|
|
2209
2216
|
@change="${this.handleChange}"
|
|
2210
2217
|
>
|
|
2211
|
-
|
|
2212
|
-
|
|
2218
|
+
${this.placeholder ? t`<option value="" disabled selected>${this.placeholder}</option>` : ""}
|
|
2219
|
+
${this.blank === !0 && n(this.blanK) ? t`<option value="'false'" selected></option>` : ""}
|
|
2220
|
+
${this.items ? this.items.map((A) => t`<option .value=${A} ?selected=${this.selectedItem == A}>${A}</option>`) : t`<slot></slot>`}
|
|
2213
2221
|
</select>
|
|
2214
2222
|
<cd-icon name="caret-down" class="select-icon" size='xxs'></cd-icon>
|
|
2215
2223
|
</div>
|
|
@@ -2570,6 +2578,26 @@ class $A extends w {
|
|
|
2570
2578
|
reflect: !0,
|
|
2571
2579
|
attribute: "disabled-next",
|
|
2572
2580
|
defaultValue: !1
|
|
2581
|
+
},
|
|
2582
|
+
skipToStartClick: {
|
|
2583
|
+
type: Function,
|
|
2584
|
+
reflect: !1,
|
|
2585
|
+
attribute: !1
|
|
2586
|
+
},
|
|
2587
|
+
previousClick: {
|
|
2588
|
+
type: Function,
|
|
2589
|
+
reflect: !1,
|
|
2590
|
+
attribute: !1
|
|
2591
|
+
},
|
|
2592
|
+
nextClick: {
|
|
2593
|
+
type: Function,
|
|
2594
|
+
reflect: !1,
|
|
2595
|
+
attribute: !1
|
|
2596
|
+
},
|
|
2597
|
+
skipToEndClick: {
|
|
2598
|
+
type: Function,
|
|
2599
|
+
reflect: !1,
|
|
2600
|
+
attribute: !1
|
|
2573
2601
|
}
|
|
2574
2602
|
};
|
|
2575
2603
|
constructor() {
|
|
@@ -2581,17 +2609,17 @@ class $A extends w {
|
|
|
2581
2609
|
<slot name="default"></slot>
|
|
2582
2610
|
|
|
2583
2611
|
${this.skipToStart ? t`
|
|
2584
|
-
<cd-icon name="caret-end-mini-left" @click="${
|
|
2612
|
+
<cd-icon name="caret-end-mini-left" @click="${this.skipToStartClick}" color="${n(this.currentPage === 1 || this.disabled || this.disabledPrevious ? "var(--input-border-color-disabled)" : void 0)}" tabindex="${this.currentPage === 1 ? -1 : 0}"></cd-icon>
|
|
2585
2613
|
` : ""}
|
|
2586
2614
|
|
|
2587
|
-
<cd-icon name="caret-mini-left" @click="${this.
|
|
2615
|
+
<cd-icon name="caret-mini-left" @click="${this.previousClick}" color="${n(this.currentPage === 1 || this.disabled || this.disabledPrevious ? "var(--input-border-color-disabled)" : void 0)}" tabindex="${this.currentPage === 1 ? -1 : 0}"></cd-icon>
|
|
2588
2616
|
|
|
2589
2617
|
<span>Page <span class="page-number">${this.currentPage}</span> of <span class="page-number">${this.totalPages}</span></span>
|
|
2590
2618
|
|
|
2591
|
-
<cd-icon name="caret-mini-right" @click="${this.
|
|
2619
|
+
<cd-icon name="caret-mini-right" @click="${this.nextClick}" color="${n(this.currentPage === this.totalPages || this.disabled || this.disabledNext ? "var(--input-border-color-disabled)" : void 0)}" tabindex="${this.currentPage === this.totalPages ? -1 : 0}"></cd-icon>
|
|
2592
2620
|
|
|
2593
2621
|
${this.skipToEnd ? t`
|
|
2594
|
-
<cd-icon name="caret-end-mini-right" @click="${
|
|
2622
|
+
<cd-icon name="caret-end-mini-right" @click="${this.skipToEndClick}" color="${n(this.currentPage === this.totalPages || this.disabled || this.disabledNext ? "var(--input-border-color-disabled)" : void 0)}" tabindex="${this.currentPage === this.totalPages ? -1 : 0}"></cd-icon>
|
|
2595
2623
|
` : ""}
|
|
2596
2624
|
|
|
2597
2625
|
<slot name="after"></slot>
|