@supersoniks/concorde 1.1.47 → 1.1.48

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.
Files changed (33) hide show
  1. package/concorde-core.bundle.js +16 -16
  2. package/concorde-core.es.js +254 -96
  3. package/core/components/functional/fetch/fetch.d.ts +4 -0
  4. package/core/components/functional/list/list.d.ts +4 -0
  5. package/core/components/functional/queue/queue.d.ts +2 -0
  6. package/core/components/functional/queue/queue.js +37 -11
  7. package/core/components/functional/sdui/sdui.d.ts +4 -0
  8. package/core/components/ui/badge/badge.js +3 -4
  9. package/core/components/ui/button/button.d.ts +4 -0
  10. package/core/components/ui/form/checkbox/checkbox.d.ts +8 -0
  11. package/core/components/ui/form/css/form-control.js +7 -5
  12. package/core/components/ui/form/form-layout/form-layout.js +3 -1
  13. package/core/components/ui/form/input/input.d.ts +8 -1
  14. package/core/components/ui/form/input/input.js +10 -3
  15. package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +102 -13
  16. package/core/components/ui/form/input-autocomplete/input-autocomplete.js +212 -53
  17. package/core/components/ui/form/textarea/textarea.d.ts +4 -0
  18. package/core/components/ui/modal/modal.d.ts +2 -0
  19. package/core/components/ui/modal/modal.js +6 -3
  20. package/core/components/ui/pop/pop.js +17 -6
  21. package/core/decorators/Subscriber.d.ts +3 -0
  22. package/core/decorators/Subscriber.js +78 -0
  23. package/core/mixins/Fetcher.d.ts +7 -1
  24. package/core/mixins/FormCheckable.d.ts +4 -0
  25. package/core/mixins/FormElement.d.ts +1 -0
  26. package/core/mixins/FormElement.js +6 -2
  27. package/core/mixins/FormInput.d.ts +5 -4
  28. package/core/mixins/Subscriber.d.ts +4 -0
  29. package/core/mixins/Subscriber.js +30 -4
  30. package/mixins.d.ts +12 -0
  31. package/package.json +2 -2
  32. package/concorde-customer.bundle.js +0 -129
  33. package/concorde-customer.es.js +0 -22004
@@ -96,6 +96,26 @@ const Subscriber = (superClass, type) => {
96
96
  };
97
97
  args;
98
98
  }
99
+ onConnected(callback) {
100
+ if (!this.connectedCallbackCalls)
101
+ this.connectedCallbackCalls = new Set();
102
+ this.connectedCallbackCalls.add(callback);
103
+ }
104
+ onDisconnected(callback) {
105
+ if (!this.disconnectedCallbackCalls)
106
+ this.disconnectedCallbackCalls = new Set();
107
+ this.disconnectedCallbackCalls.add(callback);
108
+ }
109
+ offConnected(callback) {
110
+ if (!this.connectedCallbackCalls)
111
+ this.connectedCallbackCalls = new Set();
112
+ this.connectedCallbackCalls.delete(callback);
113
+ }
114
+ offDisconnected(callback) {
115
+ if (!this.disconnectedCallbackCalls)
116
+ this.disconnectedCallbackCalls = new Set();
117
+ this.disconnectedCallbackCalls.delete(callback);
118
+ }
99
119
  /**
100
120
  * va de parent en parent pour trouver un attribut
101
121
  * @param attributeName nom de l'attribut
@@ -141,6 +161,7 @@ const Subscriber = (superClass, type) => {
141
161
  this.style.removeProperty("display");
142
162
  }
143
163
  connectedCallback() {
164
+ var _a;
144
165
  SubscriberElement.instanceCounter++;
145
166
  if (this.hasAttribute("lazyRendering")) {
146
167
  const options = {
@@ -168,9 +189,11 @@ const Subscriber = (superClass, type) => {
168
189
  this.addDebugger();
169
190
  }
170
191
  super.connectedCallback();
192
+ (_a = this.connectedCallbackCalls) === null || _a === void 0 ? void 0 : _a.forEach((cb) => cb(this));
171
193
  }
172
194
  disconnectedCallback() {
173
- var _a;
195
+ var _a, _b;
196
+ (_a = this.disconnectedCallbackCalls) === null || _a === void 0 ? void 0 : _a.forEach((cb) => cb(this));
174
197
  this.removeDebugger();
175
198
  super.disconnectedCallback();
176
199
  if (this.publisher) {
@@ -180,7 +203,7 @@ const Subscriber = (superClass, type) => {
180
203
  if (this.wordingPublisher)
181
204
  this.wordingPublisher.stopTemplateFilling(this);
182
205
  if (this.onAssign)
183
- (_a = this.publisher) === null || _a === void 0 ? void 0 : _a.offAssign(this.onAssign);
206
+ (_b = this.publisher) === null || _b === void 0 ? void 0 : _b.offAssign(this.onAssign);
184
207
  }
185
208
  addDebugger() {
186
209
  var _a;
@@ -278,7 +301,8 @@ const Subscriber = (superClass, type) => {
278
301
  }
279
302
  if (!hasWording)
280
303
  return;
281
- const publisher = PublisherManager.get("sonic-wording");
304
+ const publisher = PublisherManager.get("sonic-wording", { localStorageMode: "enabled" });
305
+ yield PublisherManager.getInstance().isLocalStrorageReady;
282
306
  const wordingProvider = this.getAncestorAttributeValue("wordingProvider");
283
307
  const api = new API(this.getApiConfiguration());
284
308
  if (wordingProvider) {
@@ -296,7 +320,9 @@ const Subscriber = (superClass, type) => {
296
320
  }
297
321
  }
298
322
  if (wordings.length > 0) {
299
- const result = (yield api.post(wordingProvider, { labels: wordings }));
323
+ const calledURL = wordingProvider + "?labels[]=" + wordings.join("&labels[]=");
324
+ // const result = (await api.post(wordingProvider, {labels: wordings})) as Record<string, string>;
325
+ const result = (yield api.get(calledURL));
300
326
  for (const elt in result) {
301
327
  publisher["wording_" + elt] = result[elt];
302
328
  }
package/mixins.d.ts CHANGED
@@ -46,6 +46,10 @@ export declare const Fetcher: <T extends new (...args: any[]) => mySubscriber.Su
46
46
  getAttribute(name: string): string;
47
47
  hasAttribute(attributeName: string): boolean;
48
48
  getBoundingClientRect(): DOMRect;
49
+ onConnected(callback: (component: any) => void): void;
50
+ offConnected(callback: (component: any) => void): void;
51
+ onDisconnected(callback: (component: any) => void): void;
52
+ offDisconnected(callback: (component: any) => void): void;
49
53
  };
50
54
  } & T;
51
55
  export declare const FormCheckable: <T extends new (...args: any[]) => myFormElement.FormElementInterface>(superClass: T) => {
@@ -108,6 +112,10 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
108
112
  getAttribute(name: string): string;
109
113
  hasAttribute(attributeName: string): boolean;
110
114
  getBoundingClientRect(): DOMRect;
115
+ onConnected(callback: (component: any) => void): void;
116
+ offConnected(callback: (component: any) => void): void;
117
+ onDisconnected(callback: (component: any) => void): void;
118
+ offDisconnected(callback: (component: any) => void): void;
111
119
  };
112
120
  } & T;
113
121
  import * as myFormElement from "@supersoniks/concorde/core/mixins/FormElement";
@@ -169,6 +177,10 @@ export declare const FormInput: <T extends new (...args: any[]) => myFormElement
169
177
  hasAttribute(attributeName: string): boolean;
170
178
  disconnectedCallback(): void;
171
179
  getBoundingClientRect(): DOMRect;
180
+ onConnected(callback: (component: any) => void): void;
181
+ offConnected(callback: (component: any) => void): void;
182
+ onDisconnected(callback: (component: any) => void): void;
183
+ offDisconnected(callback: (component: any) => void): void;
172
184
  };
173
185
  } & T;
174
186
  import * as mySubscriber from "@supersoniks/concorde/core/mixins/Subscriber";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "1.1.47",
3
+ "version": "1.1.48",
4
4
  "customElements": "custom-elements.json",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -224,6 +224,7 @@
224
224
  "./ui": "./core/components/ui/ui.js",
225
225
  "./core/core": "./core/core.js",
226
226
  "./core": "./core/core.js",
227
+ "./core/decorators/Subscriber": "./core/decorators/Subscriber.js",
227
228
  "./core/mixins/Fetcher": "./core/mixins/Fetcher.js",
228
229
  "./mixins/Fetcher": "./core/mixins/Fetcher.js",
229
230
  "./core/mixins/FormCheckable": "./core/mixins/FormCheckable.js",
@@ -265,7 +266,6 @@
265
266
  "./docs/navigation/navigation": "./docs/navigation/navigation.js",
266
267
  "./docs/navigation": "./docs/navigation/navigation.js",
267
268
  "./docs/prism/index": "./docs/prism/index.js",
268
- "./docs/search/docs-search.json": "./docs/search/docs-search.json",
269
269
  "./docs/search/markdown-renderer": "./docs/search/markdown-renderer.js",
270
270
  "./docs/search/page": "./docs/search/page.js",
271
271
  "./docs/search/search": "./docs/search/search.js",