expedite-components 0.0.3 → 0.0.5

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.
@@ -9633,7 +9633,7 @@ const a5 = (e, t) => {
9633
9633
  _("span", {
9634
9634
  class: Ae(["ect-text-left", c.highlight ? "ect-text-lg ect-font-bold ect-text-green-700" : "ect-text-sm ect-font-medium ect-text-gray-800 "]),
9635
9635
  "data-test-id": `configurator-footer-price-value-${f}`
9636
- }, ve(l.$formatCurrency(c.value)), 11, ah)
9636
+ }, ve(c.value), 11, ah)
9637
9637
  ], 8, ih),
9638
9638
  f < o.value.length - 1 ? (X(), ne("div", {
9639
9639
  key: 0,
@@ -24292,7 +24292,19 @@ const f8 = (e) => (ur("data-v-adfc84e9"), e = e(), fr(), e), d8 = /* @__PURE__ *
24292
24292
  ])
24293
24293
  ]));
24294
24294
  }
24295
- }, B8 = /* @__PURE__ */ Ve(D8, [["__scopeId", "data-v-46273585"]]);
24295
+ }, B8 = /* @__PURE__ */ Ve(D8, [["__scopeId", "data-v-46273585"]]), $8 = {
24296
+ install(e) {
24297
+ e.config.globalProperties.$formatCurrency = (t, n = {}) => {
24298
+ const r = {}, i = n.locale || r.locale || "en-US", o = n.currency || r.currency || "USD";
24299
+ let a = t;
24300
+ return typeof t == "string" && (a = Number(t.replace(/[^0-9.-]/g, ""))), new Intl.NumberFormat(i, {
24301
+ style: "currency",
24302
+ currency: o,
24303
+ ...n
24304
+ }).format(Number.isFinite(a) ? a : 0);
24305
+ };
24306
+ }
24307
+ };
24296
24308
  let Si = null;
24297
24309
  if (typeof window < "u") {
24298
24310
  try {
@@ -24302,7 +24314,7 @@ if (typeof window < "u") {
24302
24314
  Si || (Si = s1(), Jr(Si));
24303
24315
  }
24304
24316
  let Ii = null, Ai = null;
24305
- async function $8() {
24317
+ async function F8() {
24306
24318
  return Ii || Ai || (Ai = (async () => {
24307
24319
  try {
24308
24320
  const e = new URL("./style.css", import.meta.url).href, t = await fetch(e);
@@ -24316,31 +24328,36 @@ async function $8() {
24316
24328
  }
24317
24329
  const Iu = (e) => class extends e {
24318
24330
  async connectedCallback() {
24331
+ var t;
24332
+ if (this._instance) {
24333
+ const n = (t = this._instance.appContext) == null ? void 0 : t.app;
24334
+ n && (n.config.globalProperties.$formatCurrency || n.use($8));
24335
+ }
24319
24336
  if (super.connectedCallback && super.connectedCallback(), !!this.shadowRoot && !this.shadowRoot.querySelector("style[data-vue-expedite-style]"))
24320
24337
  try {
24321
- const t = await $8();
24322
- if (t) {
24323
- const n = document.createElement("style");
24324
- n.setAttribute("data-vue-expedite-style", "true"), n.textContent = t, this.shadowRoot.prepend(n);
24338
+ const n = await F8();
24339
+ if (n) {
24340
+ const r = document.createElement("style");
24341
+ r.setAttribute("data-vue-expedite-style", "true"), r.textContent = n, this.shadowRoot.prepend(r);
24325
24342
  } else {
24326
- const n = new URL("./style.css", import.meta.url).href, r = document.createElement("link");
24327
- r.setAttribute("rel", "stylesheet"), r.setAttribute("data-vue-expedite-style", "true"), r.href = n, this.shadowRoot.prepend(r);
24343
+ const r = new URL("./style.css", import.meta.url).href, i = document.createElement("link");
24344
+ i.setAttribute("rel", "stylesheet"), i.setAttribute("data-vue-expedite-style", "true"), i.href = r, this.shadowRoot.prepend(i);
24328
24345
  }
24329
- } catch (t) {
24330
- console.warn("[ExpediteComponents] Failed to inject CSS:", t);
24346
+ } catch (n) {
24347
+ console.warn("[ExpediteComponents] Failed to inject CSS:", n);
24331
24348
  }
24332
24349
  }
24333
- }, F8 = Iu(/* @__PURE__ */ jc(g8)), V8 = Iu(/* @__PURE__ */ jc(B8));
24350
+ }, V8 = Iu(/* @__PURE__ */ jc(g8)), H8 = Iu(/* @__PURE__ */ jc(B8));
24334
24351
  function Au() {
24335
- typeof window < "u" && (customElements.get("vue-expedite-configurator") || customElements.define("vue-expedite-configurator", F8), customElements.get("vue-expedite-gpt") || customElements.define("vue-expedite-gpt", V8));
24352
+ typeof window < "u" && (customElements.get("vue-expedite-configurator") || customElements.define("vue-expedite-configurator", V8), customElements.get("vue-expedite-gpt") || customElements.define("vue-expedite-gpt", H8));
24336
24353
  }
24337
24354
  typeof window < "u" && Au();
24338
- const H8 = {
24355
+ const U8 = {
24339
24356
  register: Au
24340
24357
  };
24341
24358
  export {
24342
- F8 as ExpediteConfiguratorElement,
24343
- V8 as ExpediteGPTElement,
24344
- H8 as default,
24359
+ V8 as ExpediteConfiguratorElement,
24360
+ H8 as ExpediteGPTElement,
24361
+ U8 as default,
24345
24362
  Au as registerWebComponents
24346
24363
  };