@cargosense/cargo-design-system 1.0.14 → 1.0.15

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.
@@ -282,13 +282,13 @@ const hA = (Q, A) => {
282
282
  }
283
283
  return [eA(Q, E + (Q[g] || "<?>") + (A === 2 ? "</svg>" : A === 3 ? "</math>" : "")), B];
284
284
  };
285
- class H {
285
+ class z {
286
286
  constructor({ strings: A, _$litType$: g }, B) {
287
287
  let C;
288
288
  this.parts = [];
289
289
  let E = 0, I = 0;
290
290
  const s = A.length - 1, e = this.parts, [r, Y] = hA(A, g);
291
- if (this.el = H.createElement(r, B), U.currentNode = this.el.content, g === 2 || g === 3) {
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);
294
294
  }
@@ -342,7 +342,7 @@ class lA {
342
342
  for (; e !== void 0; ) {
343
343
  if (I === e.index) {
344
344
  let r;
345
- e.type === 2 ? r = new z(E, E.nextSibling, this, A) : e.type === 1 ? r = new e.ctor(E, e.name, e.strings, this, A) : e.type === 6 && (r = new uA(E, this, A)), this._$AV.push(r), e = B[++s];
345
+ e.type === 2 ? r = new H(E, E.nextSibling, this, A) : e.type === 1 ? r = new e.ctor(E, e.name, e.strings, this, A) : e.type === 6 && (r = new uA(E, this, A)), this._$AV.push(r), e = B[++s];
346
346
  }
347
347
  I !== e?.index && (E = U.nextNode(), I++);
348
348
  }
@@ -353,7 +353,7 @@ class lA {
353
353
  for (const B of this._$AV) B !== void 0 && (B.strings !== void 0 ? (B._$AI(A, B, g), g += B.strings.length - 2) : B._$AI(A[g])), g++;
354
354
  }
355
355
  }
356
- class z {
356
+ class H {
357
357
  get _$AU() {
358
358
  return this._$AM?._$AU ?? this._$Cv;
359
359
  }
@@ -384,7 +384,7 @@ class z {
384
384
  this._$AH !== M && N(this._$AH) ? this._$AA.nextSibling.data = A : this.T(d.createTextNode(A)), this._$AH = A;
385
385
  }
386
386
  $(A) {
387
- const { values: g, _$litType$: B } = A, C = typeof B == "number" ? this._$AC(A) : (B.el === void 0 && (B.el = H.createElement(eA(B.h, B.h[0]), this.options)), B);
387
+ const { values: g, _$litType$: B } = A, C = typeof B == "number" ? this._$AC(A) : (B.el === void 0 && (B.el = z.createElement(eA(B.h, B.h[0]), this.options)), B);
388
388
  if (this._$AH?._$AD === C) this._$AH.p(g);
389
389
  else {
390
390
  const E = new lA(C, this), I = E.u(this.options);
@@ -393,13 +393,13 @@ class z {
393
393
  }
394
394
  _$AC(A) {
395
395
  let g = gA.get(A.strings);
396
- return g === void 0 && gA.set(A.strings, g = new H(A)), g;
396
+ return g === void 0 && gA.set(A.strings, g = new z(A)), g;
397
397
  }
398
398
  k(A) {
399
399
  k(this._$AH) || (this._$AH = [], this._$AR());
400
400
  const g = this._$AH;
401
401
  let B, C = 0;
402
- for (const E of A) C === g.length ? g.push(B = new z(this.O(J()), this.O(J()), this, this.options)) : B = g[C], B._$AI(E), C++;
402
+ for (const E of A) C === g.length ? g.push(B = new H(this.O(J()), this.O(J()), this, this.options)) : B = g[C], B._$AI(E), C++;
403
403
  C < g.length && (this._$AR(B && B._$AB.nextSibling, C), g.length = C);
404
404
  }
405
405
  _$AR(A = this._$AA.nextSibling, g) {
@@ -478,13 +478,13 @@ class uA {
478
478
  }
479
479
  }
480
480
  const PA = m.litHtmlPolyfillSupport;
481
- PA?.(H, z), (m.litHtmlVersions ??= []).push("3.3.1");
481
+ PA?.(z, H), (m.litHtmlVersions ??= []).push("3.3.1");
482
482
  const vA = (Q, A, g) => {
483
483
  const B = g?.renderBefore ?? A;
484
484
  let C = B._$litPart$;
485
485
  if (C === void 0) {
486
486
  const E = g?.renderBefore ?? null;
487
- B._$litPart$ = C = new z(A.insertBefore(J(), E), E, void 0, g ?? {});
487
+ B._$litPart$ = C = new H(A.insertBefore(J(), E), E, void 0, g ?? {});
488
488
  }
489
489
  return C._$AI(Q), C;
490
490
  };
@@ -670,7 +670,7 @@ function Eg() {
670
670
  * SPDX-License-Identifier: BSD-3-Clause
671
671
  */
672
672
  const n = (Q) => Q ?? M;
673
- class HA extends w {
673
+ class zA extends w {
674
674
  static styles = i`
675
675
  @font-face {
676
676
  font-family: 'Geist';
@@ -731,9 +731,9 @@ class HA extends w {
731
731
  }
732
732
  }
733
733
  function Ig() {
734
- typeof window < "u" && !customElements.get("cd-data-object") && customElements.define("cd-data-object", HA);
734
+ typeof window < "u" && !customElements.get("cd-data-object") && customElements.define("cd-data-object", zA);
735
735
  }
736
- const zA = (Q, A, g) => {
736
+ const HA = (Q, A, g) => {
737
737
  const B = Q[A];
738
738
  return B ? typeof B == "function" ? B() : Promise.resolve(B) : new Promise((C, E) => {
739
739
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(E.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + A + (A.split("/").length !== g ? ". Note that variables only represent file names one level deep." : ""))));
@@ -831,7 +831,7 @@ class yA extends w {
831
831
  }
832
832
  async loadIcon() {
833
833
  try {
834
- let A = this.name.toLowerCase(), g = await zA(/* @__PURE__ */ Object.assign({ "../../icons/add-circle.svg": () => import("./add-circle.es.js"), "../../icons/air.svg": () => import("./air.es.js"), "../../icons/api.svg": () => import("./api.es.js"), "../../icons/arrow.svg": () => import("./arrow.es.js"), "../../icons/browser-settings.svg": () => import("./browser-settings.es.js"), "../../icons/caret-down.svg": () => import("./caret-down.es.js"), "../../icons/caret-end-mini-down.svg": () => import("./caret-end-mini-down.es.js"), "../../icons/caret-end-mini-left.svg": () => import("./caret-end-mini-left.es.js"), "../../icons/caret-end-mini-right.svg": () => import("./caret-end-mini-right.es.js"), "../../icons/caret-end-mini-up.svg": () => import("./caret-end-mini-up.es.js"), "../../icons/caret-mini-down.svg": () => import("./caret-mini-down.es.js"), "../../icons/caret-mini-left.svg": () => import("./caret-mini-left.es.js"), "../../icons/caret-mini-right.svg": () => import("./caret-mini-right.es.js"), "../../icons/caret-mini-up.svg": () => import("./caret-mini-up.es.js"), "../../icons/check.svg": () => import("./check.es.js"), "../../icons/configuration.svg": () => import("./configuration.es.js"), "../../icons/copy.svg": () => import("./copy.es.js"), "../../icons/cost.svg": () => import("./cost.es.js"), "../../icons/document.svg": () => import("./document.es.js"), "../../icons/exception.svg": () => import("./exception.es.js"), "../../icons/exit.svg": () => import("./exit.es.js"), "../../icons/external.svg": () => import("./external.es.js"), "../../icons/gps-device.svg": () => import("./gps-device.es.js"), "../../icons/hart.svg": () => import("./hart.es.js"), "../../icons/insights.svg": () => import("./insights.es.js"), "../../icons/integration.svg": () => import("./integration.es.js"), "../../icons/inventory.svg": () => import("./inventory.es.js"), "../../icons/issue.svg": () => import("./issue.es.js"), "../../icons/it.svg": () => import("./it.es.js"), "../../icons/logistics-contract.svg": () => import("./logistics-contract.es.js"), "../../icons/ocean.svg": () => import("./ocean.es.js"), "../../icons/package-with-qr.svg": () => import("./package-with-qr.es.js"), "../../icons/package.svg": () => import("./package.es.js"), "../../icons/phone-with-qr.svg": () => import("./phone-with-qr.es.js"), "../../icons/ping.svg": () => import("./ping.es.js"), "../../icons/playbook.svg": () => import("./playbook.es.js"), "../../icons/plus.svg": () => import("./plus.es.js"), "../../icons/pm.svg": () => import("./pm.es.js"), "../../icons/qr-code.svg": () => import("./qr-code.es.js"), "../../icons/search.svg": () => import("./search.es.js"), "../../icons/sensors.svg": () => import("./sensors.es.js"), "../../icons/server.svg": () => import("./server.es.js"), "../../icons/sustainablity.svg": () => import("./sustainablity.es.js"), "../../icons/task-list.svg": () => import("./task-list.es.js"), "../../icons/temperature-device.svg": () => import("./temperature-device.es.js"), "../../icons/truck.svg": () => import("./truck.es.js"), "../../icons/users.svg": () => import("./users.es.js"), "../../icons/warehouse.svg": () => import("./warehouse.es.js"), "../../icons/water-device.svg": () => import("./water-device.es.js") }), `../../icons/${A}.svg`, 4);
834
+ let A = this.name.toLowerCase(), g = await HA(/* @__PURE__ */ Object.assign({ "../../icons/add-circle.svg": () => import("./add-circle.es.js"), "../../icons/air.svg": () => import("./air.es.js"), "../../icons/api.svg": () => import("./api.es.js"), "../../icons/arrow.svg": () => import("./arrow.es.js"), "../../icons/browser-settings.svg": () => import("./browser-settings.es.js"), "../../icons/caret-down.svg": () => import("./caret-down.es.js"), "../../icons/caret-end-mini-down.svg": () => import("./caret-end-mini-down.es.js"), "../../icons/caret-end-mini-left.svg": () => import("./caret-end-mini-left.es.js"), "../../icons/caret-end-mini-right.svg": () => import("./caret-end-mini-right.es.js"), "../../icons/caret-end-mini-up.svg": () => import("./caret-end-mini-up.es.js"), "../../icons/caret-mini-down.svg": () => import("./caret-mini-down.es.js"), "../../icons/caret-mini-left.svg": () => import("./caret-mini-left.es.js"), "../../icons/caret-mini-right.svg": () => import("./caret-mini-right.es.js"), "../../icons/caret-mini-up.svg": () => import("./caret-mini-up.es.js"), "../../icons/check.svg": () => import("./check.es.js"), "../../icons/configuration.svg": () => import("./configuration.es.js"), "../../icons/copy.svg": () => import("./copy.es.js"), "../../icons/cost.svg": () => import("./cost.es.js"), "../../icons/document.svg": () => import("./document.es.js"), "../../icons/exception.svg": () => import("./exception.es.js"), "../../icons/exit.svg": () => import("./exit.es.js"), "../../icons/external.svg": () => import("./external.es.js"), "../../icons/gps-device.svg": () => import("./gps-device.es.js"), "../../icons/hart.svg": () => import("./hart.es.js"), "../../icons/insights.svg": () => import("./insights.es.js"), "../../icons/integration.svg": () => import("./integration.es.js"), "../../icons/inventory.svg": () => import("./inventory.es.js"), "../../icons/issue.svg": () => import("./issue.es.js"), "../../icons/it.svg": () => import("./it.es.js"), "../../icons/logistics-contract.svg": () => import("./logistics-contract.es.js"), "../../icons/ocean.svg": () => import("./ocean.es.js"), "../../icons/package-with-qr.svg": () => import("./package-with-qr.es.js"), "../../icons/package.svg": () => import("./package.es.js"), "../../icons/phone-with-qr.svg": () => import("./phone-with-qr.es.js"), "../../icons/ping.svg": () => import("./ping.es.js"), "../../icons/playbook.svg": () => import("./playbook.es.js"), "../../icons/plus.svg": () => import("./plus.es.js"), "../../icons/pm.svg": () => import("./pm.es.js"), "../../icons/qr-code.svg": () => import("./qr-code.es.js"), "../../icons/search.svg": () => import("./search.es.js"), "../../icons/sensors.svg": () => import("./sensors.es.js"), "../../icons/server.svg": () => import("./server.es.js"), "../../icons/sustainablity.svg": () => import("./sustainablity.es.js"), "../../icons/task-list.svg": () => import("./task-list.es.js"), "../../icons/temperature-device.svg": () => import("./temperature-device.es.js"), "../../icons/truck.svg": () => import("./truck.es.js"), "../../icons/users.svg": () => import("./users.es.js"), "../../icons/warehouse.svg": () => import("./warehouse.es.js"), "../../icons/water-device.svg": () => import("./water-device.es.js") }), `../../icons/${A}.svg`, 4);
835
835
  console.log(`Loading icon: ${A}.svg`), this.loadedIcon = g.default || g, this.loadedIcon = this.loadedIcon.replace(/height="[^"]*"/, "").replace(/width="[^"]*"/, ""), this.loadedIcon = this.loadedIcon.replace(/stroke="([^"]*)"/g, 'stroke="var(--icon-stroke, $1)"'), this.loadedIcon = this.loadedIcon.replace(/stroke-width="4"/g, 'stroke-width="var(--icon-stroke-width-primary, 4)"'), this.loadedIcon = this.loadedIcon.replace(/stroke-width="3"/g, 'stroke-width="var(--icon-stroke-width-secondary, 3)"'), this.loadedIcon = this.loadedIcon.replace(/fill="white"/g, 'fill="var(--icon-background-page, white)"'), this.loadedIcon = this.loadedIcon.replace(/fill="#6DDAC6"/g, 'fill="var(--icon-background-primary, #6DDAC6)"'), this.loadedIcon = this.loadedIcon.replace(/fill="#B1E9DF"/g, 'fill="var(--icon-background-secondary, #B1E9DF)"'), this.requestUpdate();
836
836
  } catch {
837
837
  console.log(`Icon "${this.name}" not found.`), this.loadedIcon = "<!-- Icon not found -->";
@@ -2161,6 +2161,15 @@ class XA extends w {
2161
2161
  type: Boolean,
2162
2162
  reflect: !0
2163
2163
  },
2164
+ items: {
2165
+ type: Array,
2166
+ reflect: !0
2167
+ },
2168
+ selectedItem: {
2169
+ type: String,
2170
+ reflect: !0,
2171
+ attribute: "selected-item"
2172
+ },
2164
2173
  error: {
2165
2174
  type: Boolean,
2166
2175
  reflect: !0
@@ -2185,7 +2194,7 @@ class XA extends w {
2185
2194
  }
2186
2195
  };
2187
2196
  constructor() {
2188
- 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._internals = this.attachInternals();
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();
2189
2198
  }
2190
2199
  render() {
2191
2200
  return t`
@@ -2200,7 +2209,7 @@ class XA extends w {
2200
2209
  @change="${this.handleChange}"
2201
2210
  >
2202
2211
  ${this.placeholder ? t`<option value="" disabled selected>${this.placeholder}</option>` : ""}
2203
- <slot></slot>
2212
+ ${this.items ? this.items.map((A) => t`<option .value=${A} ?selected=${this.selectedItem == A}>${A}</option>`) : t`<slot></slot>`}
2204
2213
  </select>
2205
2214
  <cd-icon name="caret-down" class="select-icon" size='xxs'></cd-icon>
2206
2215
  </div>
@@ -2694,20 +2703,19 @@ class Ag extends w {
2694
2703
  <div class="page-size">
2695
2704
  <div class="page-select">
2696
2705
  <span class="label">${this.label}</span>
2706
+ <cd-select full-width style="--input-width: 100%;" .items=${this.sizes} selected-item="${this.size}">
2697
2707
 
2698
- <cd-select full-width style="--input-width: 100%;">
2699
- ${this.sizes.map((A) => t`<option value="${A}" ?selected="${this.size === A}">${A}</option>`)}
2700
2708
  </cd-select>
2701
2709
 
2702
2710
  </div>
2703
- <span class="total-items"><span class="page-number"> ${this.range} </span> of <span class="page-number">${this.totalItems}</span> items</span>
2711
+ <span class="total-items"><span class="page-number page-range"> ${this.range} </span> of <span class="page-number">${this.totalItems}</span> items</span>
2704
2712
 
2705
2713
  <cd-pagination skip-to-end skip-to-start></cd-pagination>
2706
2714
  </div>
2707
2715
  `;
2708
2716
  }
2709
2717
  firstUpdated() {
2710
- this.shadowRoot.querySelector("cd-pagination").totalPages = this.totalItems > 0 ? Math.ceil(this.totalItems / this.size) : 0, this.shadowRoot.querySelector("cd-select").addEventListener("change", (A) => {
2718
+ console.log(this.sizes), this.sizes.includes(this.size) || (this.sizes = [.../* @__PURE__ */ new Set([...this.sizes, this.size])].sort((A, g) => A - g), this.range = `1 - ${this.size}`), this.shadowRoot.querySelector("cd-pagination").totalPages = this.totalItems > 0 ? Math.ceil(this.totalItems / this.size) : 0, this.shadowRoot.querySelector("cd-select").addEventListener("change", (A) => {
2711
2719
  this.size = Number(A.target.value), this.range = `${(this.shadowRoot.querySelector("cd-pagination").currentPage - 1) * this.size + 1} - ${Math.min(this.shadowRoot.querySelector("cd-pagination").currentPage * this.size, this.totalItems)}`, (this.shadowRoot.querySelector("cd-pagination").currentPage - 1) * this.size + 1 > this.totalItems && (this.range = `${(Math.ceil(this.totalItems / this.size) - 1) * this.size + 1} - ${this.totalItems}`), this.shadowRoot.querySelector("cd-pagination").totalPages = this.totalItems > 0 ? Math.ceil(this.totalItems / this.size) : 0, this.shadowRoot.querySelector("cd-pagination").currentPage > this.shadowRoot.querySelector("cd-pagination").totalPages && (this.shadowRoot.querySelector("cd-pagination").currentPage = this.shadowRoot.querySelector("cd-pagination").totalPages), this.dispatchEvent(new CustomEvent("size-changed", {
2712
2720
  detail: {
2713
2721
  size: this.size
@@ -2736,7 +2744,7 @@ export {
2736
2744
  Yg as A,
2737
2745
  JA as B,
2738
2746
  bA as C,
2739
- HA as D,
2747
+ zA as D,
2740
2748
  VA as E,
2741
2749
  LA as F,
2742
2750
  XA as G,