@supersoniks/concorde 1.1.30 → 1.1.34

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 (46) hide show
  1. package/README.md +0 -0
  2. package/cli.js +0 -0
  3. package/concorde-core.bundle.js +102 -114
  4. package/concorde-core.es.js +7586 -54
  5. package/core/components/functional/date/date.js +8 -2
  6. package/core/components/functional/list/list.js +17 -11
  7. package/core/components/functional/queue/queue.d.ts +4 -1
  8. package/core/components/functional/queue/queue.js +16 -3
  9. package/core/components/functional/submit/submit.js +62 -33
  10. package/core/components/ui/_css/size.js +24 -24
  11. package/core/components/ui/alert/alert.js +1 -1
  12. package/core/components/ui/button/button.d.ts +3 -2
  13. package/core/components/ui/captcha/captcha.d.ts +17 -0
  14. package/core/components/ui/captcha/captcha.js +64 -0
  15. package/core/components/ui/form/checkbox/checkbox.d.ts +9 -4
  16. package/core/components/ui/form/checkbox/checkbox.js +28 -35
  17. package/core/components/ui/form/fieldset/legend.d.ts +7 -2
  18. package/core/components/ui/form/fieldset/legend.js +34 -8
  19. package/core/components/ui/form/input/input.d.ts +6 -2
  20. package/core/components/ui/form/input/input.js +4 -13
  21. package/core/components/ui/form/select/select.d.ts +7 -2
  22. package/core/components/ui/form/select/select.js +32 -7
  23. package/core/components/ui/form/textarea/textarea.d.ts +6 -2
  24. package/core/components/ui/form/textarea/textarea.js +2 -7
  25. package/core/components/ui/taxonomy/taxonomy.js +2 -1
  26. package/core/components/ui/theme/css/tailwind.css +0 -0
  27. package/core/components/ui/theme/css/tailwind.d.ts +0 -0
  28. package/core/components/ui/theme/theme.d.ts +1 -0
  29. package/core/components/ui/theme/theme.js +5 -1
  30. package/core/components/ui/toast/toast-item.js +24 -6
  31. package/core/components/ui/toast/toast.js +6 -2
  32. package/core/components/ui/ui.d.ts +1 -0
  33. package/core/components/ui/ui.js +1 -0
  34. package/core/mixins/Fetcher.js +4 -0
  35. package/core/mixins/FormCheckable.d.ts +3 -8
  36. package/core/mixins/FormCheckable.js +4 -15
  37. package/core/mixins/FormElement.js +7 -0
  38. package/core/mixins/FormInput.d.ts +8 -9
  39. package/core/mixins/FormInput.js +39 -2
  40. package/core/mixins/Subscriber.js +4 -0
  41. package/core/utils/PublisherProxy.d.mts +1 -1
  42. package/core/utils/PublisherProxy.mjs +3 -3
  43. package/core/utils/api.d.ts +4 -0
  44. package/core/utils/api.js +29 -3
  45. package/mixins.d.ts +9 -2
  46. package/package.json +3 -1
@@ -9,11 +9,12 @@ const Form = (superClass) => {
9
9
  class FormInput extends superClass {
10
10
  constructor(...args) {
11
11
  super();
12
+ this.forceAutoFill = false;
12
13
  /**
13
14
  * Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
14
15
  * On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
15
16
  */
16
- this.type = "text";
17
+ this._type = "text";
17
18
  args;
18
19
  }
19
20
  validateFormElement() {
@@ -25,10 +26,46 @@ const Form = (superClass) => {
25
26
  this.getFormPublisher().isFormValid = false;
26
27
  input.reportValidity();
27
28
  }
29
+ set type(value) {
30
+ if (this.hasAttribute("type") && !this.forceAutoFill)
31
+ value = this.getAttribute("type");
32
+ this._type = value;
33
+ this.requestUpdate();
34
+ }
35
+ get type() {
36
+ return this._type;
37
+ }
38
+ get description() {
39
+ return this._description;
40
+ }
41
+ set description(value) {
42
+ if (this.hasAttribute("description") && !this.forceAutoFill)
43
+ value = this.getAttribute("description");
44
+ this._description = value;
45
+ this.requestUpdate();
46
+ }
47
+ get label() {
48
+ return this._label;
49
+ }
50
+ set label(value) {
51
+ if (this.hasAttribute("label") && !this.forceAutoFill)
52
+ value = this.getAttribute("label");
53
+ this._label = value;
54
+ this.requestUpdate();
55
+ }
28
56
  }
57
+ __decorate([
58
+ property()
59
+ ], FormInput.prototype, "forceAutoFill", void 0);
29
60
  __decorate([
30
61
  property({ type: String })
31
- ], FormInput.prototype, "type", void 0);
62
+ ], FormInput.prototype, "type", null);
63
+ __decorate([
64
+ property()
65
+ ], FormInput.prototype, "description", null);
66
+ __decorate([
67
+ property()
68
+ ], FormInput.prototype, "label", null);
32
69
  __decorate([
33
70
  property({ type: Number })
34
71
  ], FormInput.prototype, "tabindex", void 0);
@@ -50,6 +50,7 @@ const Subscriber = (superClass) => {
50
50
  * noAutoFill permet de désactiver le remplissage automatique des propriétés par le publisher dans le cas ou on utilise "props" seulement ou le dataBinding par exemple
51
51
  */
52
52
  this.noAutoFill = false;
53
+ this.forceAutoFill = false;
53
54
  /**
54
55
  *
55
56
  */
@@ -361,6 +362,9 @@ const Subscriber = (superClass) => {
361
362
  __decorate([
362
363
  property({ type: Boolean })
363
364
  ], SubscriberElement.prototype, "noAutoFill", void 0);
365
+ __decorate([
366
+ property({ type: Boolean })
367
+ ], SubscriberElement.prototype, "forceAutoFill", void 0);
364
368
  __decorate([
365
369
  property({ type: Object })
366
370
  ], SubscriberElement.prototype, "propertyMap", void 0);
@@ -85,7 +85,7 @@ export class PublisherProxy {
85
85
  * Utilitaires de gestion des Publisher
86
86
  * Obtenir, replacer ou supprimer un Publisher
87
87
  *
88
- */
88
+ */
89
89
  export class PublisherManager {
90
90
  static instance: null;
91
91
  /**
@@ -199,7 +199,7 @@ export class PublisherProxy {
199
199
  * Si il s'agit d'une valeur primitive (un entier, une chaine ) la valeure en renseignée par un objet contenant la vaeur {__value}
200
200
  * On publie juste et on sen va.
201
201
  */
202
- const isPrimitiveValue = (this._value_.hasOwnProperty("__value"));
202
+ const isPrimitiveValue = this._value_.hasOwnProperty("__value");
203
203
  if (isPrimitiveValue) {
204
204
  this._publishAssignement_(lockInternalMutationsTransmission);
205
205
  return true;
@@ -222,7 +222,7 @@ export class PublisherProxy {
222
222
  * Si la donnée est complexe (objet, tableau)
223
223
  * on crée les proxys pour les sous-éléments qui n'en on pas
224
224
  * On renseigne les nouvelles valeurs internes des proxies
225
- */
225
+ */
226
226
  if (isComplex(this._value_)) {
227
227
  for (let key in this._value_) {
228
228
  let v = newValue[key];
@@ -258,7 +258,7 @@ export class PublisherProxy {
258
258
  * Utilitaires de gestion des Publisher
259
259
  * Obtenir, replacer ou supprimer un Publisher
260
260
  *
261
- */
261
+ */
262
262
  export class PublisherManager {
263
263
  constructor() {
264
264
  if (PublisherManager.instance != null)
@@ -50,6 +50,10 @@ declare class API {
50
50
  */
51
51
  computeURL(path: String): string;
52
52
  send(path: String, data: any, method?: string, additionalHeaders?: HeadersInit): Promise<any>;
53
+ /**
54
+ * Agit comme une soumission de formulaire, mais attends un json en réponse
55
+ */
56
+ submitFormData(path: String, data: any, method?: string, additionalHeaders?: HeadersInit): Promise<any>;
53
57
  /**
54
58
  * Appel send en utilisant le méthode PUT
55
59
  */
package/core/utils/api.js CHANGED
@@ -52,10 +52,11 @@ class API {
52
52
  let result = yield fetch(url, { headers: headers });
53
53
  try {
54
54
  let json = yield result.json();
55
+ json._sonic_http_response_ = result;
55
56
  resolve(json);
56
57
  }
57
58
  catch (e) {
58
- resolve(null);
59
+ resolve({ _sonic_http_response_: result });
59
60
  }
60
61
  }));
61
62
  API.loadingGetPromises.set(url, promise);
@@ -94,7 +95,6 @@ class API {
94
95
  */
95
96
  send(path, data, method = "POST", additionalHeaders) {
96
97
  return __awaiter(this, void 0, void 0, function* () {
97
- yield this.auth();
98
98
  let headers = yield this.createHeaders(additionalHeaders);
99
99
  headers["Accept"] = "application/json";
100
100
  headers["Content-Type"] = "application/json";
@@ -105,10 +105,36 @@ class API {
105
105
  });
106
106
  try {
107
107
  let json = yield result.json();
108
+ json._sonic_http_response_ = result;
109
+ return json;
110
+ }
111
+ catch (e) {
112
+ return { _sonic_http_response_: result };
113
+ }
114
+ });
115
+ }
116
+ /**
117
+ * Agit comme une soumission de formulaire, mais attends un json en réponse
118
+ */
119
+ submitFormData(path, data, method = "POST", additionalHeaders) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ let headers = yield this.createHeaders(additionalHeaders);
122
+ headers["Accept"] = "application/json";
123
+ let formData = new FormData();
124
+ for (let z in data)
125
+ formData.set(z, data[z]);
126
+ let result = yield fetch(this.computeURL(path), {
127
+ headers: headers,
128
+ method: method,
129
+ body: formData,
130
+ });
131
+ try {
132
+ let json = yield result.json();
133
+ json._sonic_http_response_ = result;
108
134
  return json;
109
135
  }
110
136
  catch (e) {
111
- return null;
137
+ return { _sonic_http_response_: result };
112
138
  }
113
139
  });
114
140
  }
package/mixins.d.ts CHANGED
@@ -41,8 +41,7 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
41
41
  new (...args: any[]): {
42
42
  _value: string | null;
43
43
  value: string | null;
44
- _name: string;
45
- name: string;
44
+ forceAutoFill: boolean;
46
45
  unique: true | null;
47
46
  radio: true | null;
48
47
  _checked: true | null;
@@ -61,6 +60,8 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
61
60
  required: boolean;
62
61
  disabled: true | null;
63
62
  formDataProvider: string;
63
+ _name: string;
64
+ name: string;
64
65
  props: any;
65
66
  isConnected: boolean;
66
67
  getAncestorAttributeValue(attributeName: string): string;
@@ -89,7 +90,13 @@ export declare const FormElement: <T extends new (...args: any[]) => mySubscribe
89
90
  export declare const FormInput: <T extends new (...args: any[]) => myFormElement.FormElementInterface>(superClass: T) => {
90
91
  new (...args: any[]): {
91
92
  validateFormElement(): void;
93
+ forceAutoFill: boolean;
94
+ _type: "number" | "search" | "file" | "button" | "password" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local";
92
95
  type: "number" | "search" | "file" | "button" | "password" | "url" | "color" | "hidden" | "time" | "image" | "text" | "reset" | "submit" | "month" | "week" | "checkbox" | "radio" | "range" | "tel" | "email" | "date" | "datetime-local";
96
+ _description?: string | undefined;
97
+ description: string | undefined;
98
+ _label?: string | undefined;
99
+ label: string | undefined;
93
100
  tabindex?: number | undefined;
94
101
  autocomplete?: "url" | "name" | "language" | "on" | "tel" | "email" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo" | undefined;
95
102
  getFormPublisher(): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "1.1.30",
3
+ "version": "1.1.34",
4
4
  "customElements": "custom-elements.json",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -66,6 +66,8 @@
66
66
  "./ui/badge": "./core/components/ui/badge/badge.js",
67
67
  "./core/components/ui/button/button": "./core/components/ui/button/button.js",
68
68
  "./ui/button": "./core/components/ui/button/button.js",
69
+ "./core/components/ui/captcha/captcha": "./core/components/ui/captcha/captcha.js",
70
+ "./ui/captcha": "./core/components/ui/captcha/captcha.js",
69
71
  "./core/components/ui/card/card-footer": "./core/components/ui/card/card-footer.js",
70
72
  "./ui/card/card-footer": "./core/components/ui/card/card-footer.js",
71
73
  "./core/components/ui/card/card-header-descripton": "./core/components/ui/card/card-header-descripton.js",