@supersoniks/concorde 1.1.25 → 1.1.27

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 (78) hide show
  1. package/README.md +0 -0
  2. package/cli.js +0 -0
  3. package/components.d.ts +2 -2
  4. package/components.js +2 -2
  5. package/concorde-core.bundle.js +22 -22
  6. package/concorde-core.es.js +20 -20
  7. package/core/components/functional/list/list.d.ts +1 -1
  8. package/core/components/functional/list/list.js +1 -1
  9. package/core/components/ui/_css/scroll.d.ts +1 -0
  10. package/core/components/ui/_css/scroll.js +22 -0
  11. package/core/components/ui/_css/types.d.ts +2 -0
  12. package/core/components/ui/_css/types.js +60 -0
  13. package/core/components/ui/alert/alert.js +1 -1
  14. package/core/components/ui/button/button.d.ts +1 -1
  15. package/core/components/ui/button/button.js +0 -4
  16. package/core/components/ui/card/card-footer.d.ts +0 -1
  17. package/core/components/ui/card/card-footer.js +7 -9
  18. package/core/components/ui/card/card-main.d.ts +0 -1
  19. package/core/components/ui/card/card-main.js +7 -9
  20. package/core/components/ui/form/checkbox/checkbox.d.ts +1 -0
  21. package/core/components/ui/form/checkbox/checkbox.js +19 -0
  22. package/core/components/ui/form/css/form-control.js +36 -33
  23. package/core/components/ui/form/fieldset/fieldset.d.ts +1 -1
  24. package/core/components/ui/form/fieldset/fieldset.js +0 -4
  25. package/core/components/ui/form/fieldset/legend.d.ts +3 -3
  26. package/core/components/ui/form/fieldset/legend.js +3 -8
  27. package/core/components/ui/form/input/input.d.ts +0 -3
  28. package/core/components/ui/form/input/input.js +1 -1
  29. package/core/components/ui/form/radio/radio.d.ts +1 -1
  30. package/core/components/ui/form/radio/radio.js +1 -1
  31. package/core/components/ui/form/select/select.js +4 -3
  32. package/core/components/ui/form/textarea/textarea.js +4 -2
  33. package/core/components/ui/icon/icon.js +1 -1
  34. package/core/components/ui/icon/icons.js +1 -1
  35. package/core/components/ui/loader/loader.js +2 -2
  36. package/core/components/ui/menu/menu-item.d.ts +1 -1
  37. package/core/components/ui/menu/menu-item.js +1 -1
  38. package/core/components/ui/menu/menu.d.ts +1 -1
  39. package/core/components/ui/menu/menu.js +1 -1
  40. package/core/components/ui/modal/modal.d.ts +5 -5
  41. package/core/components/ui/modal/modal.js +11 -25
  42. package/core/components/ui/table/table-caption.js +2 -11
  43. package/core/components/ui/table/table-td.d.ts +1 -0
  44. package/core/components/ui/table/table-td.js +13 -4
  45. package/core/components/ui/table/table-th.d.ts +1 -0
  46. package/core/components/ui/table/table-th.js +23 -9
  47. package/core/components/ui/table/table-tr.js +2 -0
  48. package/core/components/ui/table/table.d.ts +9 -7
  49. package/core/components/ui/table/table.js +33 -11
  50. package/core/components/ui/tabs/tab.d.ts +1 -1
  51. package/core/components/ui/tabs/tab.js +1 -1
  52. package/core/components/ui/tabs/tabs.js +1 -2
  53. package/core/components/ui/taxonomy/taxonomy.d.ts +2 -2
  54. package/core/components/ui/taxonomy/taxonomy.js +2 -2
  55. package/core/components/ui/theme/css/tailwind.css +0 -0
  56. package/core/components/ui/theme/css/tailwind.d.ts +0 -0
  57. package/core/components/ui/theme/theme-collection/core-variables.js +4 -1
  58. package/core/components/ui/theme/theme.js +3 -3
  59. package/core/components/ui/toast/message-subscriber.js +1 -1
  60. package/core/components/ui/toast/toast-item.d.ts +2 -2
  61. package/core/components/ui/toast/toast-item.js +4 -14
  62. package/core/components/ui/toast/toast.d.ts +3 -3
  63. package/core/components/ui/toast/toast.js +1 -1
  64. package/core/mixins/Fetcher.d.ts +2 -2
  65. package/core/mixins/Fetcher.js +7 -5
  66. package/core/mixins/FormCheckable.d.ts +3 -0
  67. package/core/mixins/FormElement.js +5 -1
  68. package/core/mixins/FormInput.d.ts +8 -0
  69. package/core/mixins/Subscriber.js +1 -1
  70. package/core/utils/DataBindObserver.js +4 -0
  71. package/core/utils/LocationHandler.js +4 -2
  72. package/core/utils/api.d.ts +2 -2
  73. package/core/utils/api.js +8 -8
  74. package/mixins.d.ts +3 -3
  75. package/mixins.js +6 -6
  76. package/package.json +192 -185
  77. package/utils.d.ts +8 -8
  78. package/utils.js +8 -8
@@ -20,11 +20,19 @@ declare const Form: <T extends Constructor<FormElementInterface>>(superClass: T)
20
20
  required: true | null;
21
21
  formDataProvider: string;
22
22
  _value: any;
23
+ /**
24
+ * Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
25
+ * On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
26
+ */
23
27
  value: any;
24
28
  _name: string;
25
29
  name: string;
26
30
  props: any;
27
31
  isConnected: boolean;
32
+ /**
33
+ * Le type De l'input, comme en html cependant tous les types ne sont pas actuellements compatibles en raison du style en vigueur
34
+ * On peut essayer text, date, color, email par exemple, mais pas radio/checkbox/range a priori
35
+ */
28
36
  getAncestorAttributeValue(attributeName: string): string;
29
37
  hasAncestorAttribute(attributeName: string): boolean;
30
38
  querySelectorAll(selector: string): NodeListOf<Element>;
@@ -18,7 +18,7 @@ import { property } from "lit/decorators.js";
18
18
  import API from "@supersoniks/concorde/core/utils/api";
19
19
  import HTML from "@supersoniks/concorde/core/utils/HTML";
20
20
  import DataBindObserver from "@supersoniks/concorde/core/utils/DataBindObserver";
21
- import Objects from "../utils/Objects";
21
+ import Objects from "@supersoniks/concorde/core/utils/Objects";
22
22
  let keepDebugOnMouseOut = false;
23
23
  let debugs = new Set();
24
24
  //Pour référence
@@ -17,6 +17,8 @@ export default class DataBindObserver {
17
17
  Array.from(DataBindObserver.observedElements.keys()).forEach((k) => DataBindObserver.unObserve(k));
18
18
  }
19
19
  static observe(element) {
20
+ if (!element)
21
+ return;
20
22
  if (!DataBindObserver.enabled)
21
23
  return;
22
24
  if (DataBindObserver.observedElements.has(element))
@@ -35,6 +37,8 @@ export default class DataBindObserver {
35
37
  * Arrêter à observer un élément html.
36
38
  */
37
39
  static unObserve(element) {
40
+ if (!element)
41
+ return;
38
42
  let observer = this.observedElements.get(element);
39
43
  if (!observer)
40
44
  return;
@@ -1,3 +1,4 @@
1
+ var _a;
1
2
  /**
2
3
  * Gestionnaire d'écoute des modifications sur l'url courante.
3
4
  * On peut s'y abonner via la methode statique onChange()
@@ -5,10 +6,11 @@
5
6
  */
6
7
  export default class LocationHandler {
7
8
  static listen() {
9
+ var _a;
8
10
  if (!LocationHandler.listening) {
9
11
  return;
10
12
  }
11
- let newURL = document.location.href.replace(document.location.origin, "");
13
+ let newURL = (_a = document.location) === null || _a === void 0 ? void 0 : _a.href.replace(document.location.origin, "");
12
14
  if (LocationHandler.prevURL && LocationHandler.prevURL != newURL) {
13
15
  LocationHandler.prevURL = newURL;
14
16
  LocationHandler.listeners.forEach((listener) => {
@@ -116,4 +118,4 @@ export default class LocationHandler {
116
118
  }
117
119
  LocationHandler.listeners = [];
118
120
  LocationHandler.listening = false;
119
- LocationHandler.prevURL = document.location.href.replace(document.location.origin, "");
121
+ LocationHandler.prevURL = (_a = document.location) === null || _a === void 0 ? void 0 : _a.href.replace(document.location.origin, "");
@@ -39,12 +39,12 @@ declare class API {
39
39
  * Basic auth
40
40
  */
41
41
  auth(): Promise<void>;
42
- get(path: String): Promise<any>;
42
+ get(path: String, additionalHeaders?: HeadersInit): Promise<any>;
43
43
  /**
44
44
  * Création du header, avec authentification si besoin
45
45
  * ajout du language via le header accept-language qui contient le langue du navigateur
46
46
  */
47
- createHeaders(): Promise<Record<string, string>>;
47
+ createHeaders(additionalHeaders?: HeadersInit): Promise<Record<string, string>>;
48
48
  /**
49
49
  * Concatène le serviceURL et le endpoint donné en paramètre
50
50
  */
package/core/utils/api.js CHANGED
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import HTML from "./HTML";
10
+ import HTML from "@supersoniks/concorde/core/utils/HTML";
11
11
  class API {
12
12
  constructor(config) {
13
13
  this.serviceURL = config.serviceURL;
@@ -43,9 +43,9 @@ class API {
43
43
  catch (e) { }
44
44
  });
45
45
  }
46
- get(path) {
46
+ get(path, additionalHeaders) {
47
47
  return __awaiter(this, void 0, void 0, function* () {
48
- let headers = yield this.createHeaders();
48
+ let headers = yield this.createHeaders(additionalHeaders);
49
49
  const url = this.computeURL(path);
50
50
  if (!API.loadingGetPromises.has(url)) {
51
51
  let promise = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
@@ -69,7 +69,7 @@ class API {
69
69
  * Création du header, avec authentification si besoin
70
70
  * ajout du language via le header accept-language qui contient le langue du navigateur
71
71
  */
72
- createHeaders() {
72
+ createHeaders(additionalHeaders) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
74
  yield this.auth();
75
75
  let headers = {};
@@ -77,6 +77,9 @@ class API {
77
77
  headers.Authorization = "Bearer " + this.token;
78
78
  headers.credentials = "include";
79
79
  headers["Accept-Language"] = HTML.getLanguage();
80
+ if (additionalHeaders) {
81
+ Object.assign(headers, additionalHeaders);
82
+ }
80
83
  return headers;
81
84
  });
82
85
  }
@@ -92,12 +95,9 @@ class API {
92
95
  send(path, data, method = "POST", additionalHeaders) {
93
96
  return __awaiter(this, void 0, void 0, function* () {
94
97
  yield this.auth();
95
- let headers = yield this.createHeaders();
98
+ let headers = yield this.createHeaders(additionalHeaders);
96
99
  headers["Accept"] = "application/json";
97
100
  headers["Content-Type"] = "application/json";
98
- if (additionalHeaders) {
99
- Object.assign(headers, additionalHeaders);
100
- }
101
101
  let result = yield fetch(this.computeURL(path), {
102
102
  headers: headers,
103
103
  method: method,
package/mixins.d.ts CHANGED
@@ -83,7 +83,7 @@ export declare const FormCheckable: <T extends new (...args: any[]) => myFormEle
83
83
  disconnectedCallback(): void;
84
84
  };
85
85
  } & T;
86
- import * as myFormElement from "./core/mixins/FormElement";
86
+ import * as myFormElement from "@supersoniks/concorde/core/mixins/FormElement";
87
87
  export declare const FormElement: <T extends new (...args: any[]) => mySubscriber.SubscriberInterface>(superClass: T) => (new (...args: any[]) => myFormElement.FormElementInterface) & T;
88
88
  export declare const FormInput: <T extends new (...args: any[]) => myFormElement.FormElementInterface>(superClass: T) => {
89
89
  new (...args: any[]): {
@@ -128,7 +128,7 @@ export declare const FormInput: <T extends new (...args: any[]) => myFormElement
128
128
  disconnectedCallback(): void;
129
129
  };
130
130
  } & T;
131
- import * as mySubscriber from "./core/mixins/Subscriber";
131
+ import * as mySubscriber from "@supersoniks/concorde/core/mixins/Subscriber";
132
132
  export declare const Subscriber: <T extends new (...args: any[]) => import("lit").LitElement>(superClass: T) => (new (...args: any[]) => mySubscriber.SubscriberInterface) & T;
133
- import * as myTemplatesContainer from "./core/mixins/TemplatesContainer";
133
+ import * as myTemplatesContainer from "@supersoniks/concorde/core/mixins/TemplatesContainer";
134
134
  export declare const TemplatesContainer: <T extends new (...args: any[]) => import("lit").LitElement>(superClass: T) => (new (...args: any[]) => myTemplatesContainer.TemplatesContainerInterface) & T;
package/mixins.js CHANGED
@@ -1,15 +1,15 @@
1
1
  //
2
- import * as myFetcher from "./core/mixins/Fetcher";
2
+ import * as myFetcher from "@supersoniks/concorde/core/mixins/Fetcher";
3
3
  export const Fetcher = myFetcher.default;
4
- import * as myFormCheckable from "./core/mixins/FormCheckable";
4
+ import * as myFormCheckable from "@supersoniks/concorde/core/mixins/FormCheckable";
5
5
  export const FormCheckable = myFormCheckable.default;
6
- import * as myFormElement from "./core/mixins/FormElement";
6
+ import * as myFormElement from "@supersoniks/concorde/core/mixins/FormElement";
7
7
  export const FormElement = myFormElement.default;
8
- import * as myFormInput from "./core/mixins/FormInput";
8
+ import * as myFormInput from "@supersoniks/concorde/core/mixins/FormInput";
9
9
  export const FormInput = myFormInput.default;
10
- import * as mySubscriber from "./core/mixins/Subscriber";
10
+ import * as mySubscriber from "@supersoniks/concorde/core/mixins/Subscriber";
11
11
  export const Subscriber = mySubscriber.default;
12
- import * as myTemplatesContainer from "./core/mixins/TemplatesContainer";
12
+ import * as myTemplatesContainer from "@supersoniks/concorde/core/mixins/TemplatesContainer";
13
13
  export const TemplatesContainer = myTemplatesContainer.default;
14
14
  let win = window;
15
15
  win["concorde-mixins"] = win["concorde-mixins"] || {};