@supersoniks/concorde 1.0.2 → 1.0.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.
@@ -1207,13 +1207,14 @@ const fixed = r$5`
1207
1207
  transform:transateY(-50%) translateX(-50%);
1208
1208
  z-index:999;
1209
1209
  }
1210
+
1210
1211
  .sonic-loader--fixed > div:nth-child(2) {
1211
1212
  animation-delay: -0.5s;
1212
1213
  }
1213
1214
  .sonic-loader--fixed > div:nth-child(3) {
1214
1215
  animation-delay: -0.2s;
1215
-
1216
1216
  }
1217
+
1217
1218
  .sonic-loader--fixed > div:nth-child(4) {
1218
1219
  display:none !important;
1219
1220
  }
@@ -1250,7 +1251,7 @@ var __decorateClass$g = (decorators, target, key, kind) => {
1250
1251
  let SonicLoader = class extends Subscriber(s$1) {
1251
1252
  constructor() {
1252
1253
  super(...arguments);
1253
- this.mode = "inline";
1254
+ this.mode = "fixed";
1254
1255
  }
1255
1256
  static show(conf) {
1256
1257
  if (!SonicLoader.loader)
@@ -1261,10 +1262,11 @@ let SonicLoader = class extends Subscriber(s$1) {
1261
1262
  let v2 = conf;
1262
1263
  for (let z2 in v2)
1263
1264
  loader.setAttribute(z2, v2[z2]);
1264
- let container = document.querySelector("sonic-theme");
1265
- if (!container)
1266
- container = document.body;
1267
- container.appendChild(loader);
1265
+ if (!conf.container) {
1266
+ conf.container = document.querySelector("sonic-theme") || document.body;
1267
+ conf.mode = "fixed";
1268
+ }
1269
+ conf.container.appendChild(loader);
1268
1270
  SonicLoader.callCounter++;
1269
1271
  }
1270
1272
  static hide() {
@@ -2713,7 +2715,7 @@ let SonicPricesButton = class extends Subscriber(s$1) {
2713
2715
  async _handleClick() {
2714
2716
  let api = new API({});
2715
2717
  this.loading = true;
2716
- SonicLoader.show();
2718
+ const timeoutId = setTimeout(SonicLoader.show, 250);
2717
2719
  let result = await api.put("/api-billetterie/webcomponents/cart", {
2718
2720
  events: [
2719
2721
  {
@@ -2724,6 +2726,7 @@ let SonicPricesButton = class extends Subscriber(s$1) {
2724
2726
  ]
2725
2727
  });
2726
2728
  this.loading = false;
2729
+ clearTimeout(timeoutId);
2727
2730
  SonicLoader.hide();
2728
2731
  if (!result) {
2729
2732
  SonicToast.add({ text: "Network Error", status: "error", styled: true });
@@ -3139,7 +3142,7 @@ var __decorateClass = (decorators, target, key, kind) => {
3139
3142
  __defProp(target, key, result);
3140
3143
  return result;
3141
3144
  };
3142
- let SonicTheme = class extends s$1 {
3145
+ let SonicTheme = class extends Subscriber(s$1) {
3143
3146
  constructor() {
3144
3147
  super(...arguments);
3145
3148
  this.theme = "light";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -1,6 +1,8 @@
1
1
  import { LitElement } from "lit";
2
- export declare class SonicTheme extends LitElement {
2
+ declare const SonicTheme_base: (new (...args: any[]) => import("../../core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
3
+ export declare class SonicTheme extends SonicTheme_base {
3
4
  static styles: import("lit").CSSResult[];
4
5
  theme: string;
5
6
  render(): import("lit-html").TemplateResult<1>;
6
7
  }
8
+ export {};
@@ -6,6 +6,7 @@ export declare class SonicLoader extends SonicLoader_base {
6
6
  static callCounter: number;
7
7
  static show(conf?: {
8
8
  mode?: string;
9
+ container?: HTMLElement;
9
10
  }): void;
10
11
  static hide(): void;
11
12
  mode: string;
@@ -1,11 +1,12 @@
1
1
  import { LitElement } from "lit";
2
2
  declare type ToastStatus = "success" | "error" | "info";
3
3
  declare type Toast = {
4
- id: number;
4
+ id?: number;
5
5
  text: string;
6
6
  title?: string;
7
7
  status?: ToastStatus;
8
8
  preserve?: boolean;
9
+ styled?: boolean;
9
10
  };
10
11
  declare const SonicToast_base: (new (...args: any[]) => import("../../../core/mixins/Subscriber").SubscriberInterface) & typeof LitElement;
11
12
  export declare class SonicToast extends SonicToast_base {
@@ -14,13 +15,7 @@ export declare class SonicToast extends SonicToast_base {
14
15
  className: string;
15
16
  styled: boolean;
16
17
  render(): import("lit-html").TemplateResult<1>;
17
- static add(conf: {
18
- text: string;
19
- status?: ToastStatus;
20
- title?: string;
21
- styled?: boolean;
22
- preserve?: boolean;
23
- }): {
18
+ static add(conf: Toast): {
24
19
  id: number;
25
20
  text: string;
26
21
  title: string | undefined;