@supersoniks/concorde 1.1.7 → 1.1.10

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 (76) hide show
  1. package/core/components/functional/configuration/configuration.d.ts +5 -0
  2. package/core/components/functional/configuration/configuration.js +21 -0
  3. package/core/components/functional/date/date.d.ts +2 -1
  4. package/core/components/functional/date/date.js +9 -2
  5. package/core/components/functional/fetch/fetch.d.ts +27 -10
  6. package/core/components/functional/fetch/fetch.js +27 -12
  7. package/core/components/functional/functional.d.ts +1 -0
  8. package/core/components/functional/functional.js +1 -0
  9. package/core/components/functional/list/list.d.ts +12 -7
  10. package/core/components/functional/list/list.js +55 -17
  11. package/core/components/functional/queue/queue.js +7 -3
  12. package/core/components/functional/sonic-scope/sonic-scope.d.ts +5 -0
  13. package/core/components/functional/sonic-scope/sonic-scope.js +20 -0
  14. package/core/components/functional/states/states.js +0 -2
  15. package/core/components/functional/submit/submit.d.ts +2 -0
  16. package/core/components/functional/submit/submit.js +23 -8
  17. package/core/components/ui/badge/badge.js +0 -1
  18. package/core/components/ui/button/button.d.ts +10 -2
  19. package/core/components/ui/button/button.js +10 -2
  20. package/core/components/ui/card/card-footer.d.ts +5 -0
  21. package/core/components/ui/card/card-footer.js +27 -0
  22. package/core/components/ui/card/card-header-descripton.d.ts +5 -0
  23. package/core/components/ui/card/card-header-descripton.js +33 -0
  24. package/core/components/ui/card/card-header.d.ts +8 -0
  25. package/core/components/ui/card/card-header.js +67 -0
  26. package/core/components/ui/card/card-main.d.ts +5 -0
  27. package/core/components/ui/card/card-main.js +29 -0
  28. package/core/components/ui/card/card.d.ts +12 -0
  29. package/core/components/ui/card/card.js +90 -0
  30. package/core/components/ui/form/checkbox/checkbox.d.ts +0 -2
  31. package/core/components/ui/form/checkbox/checkbox.js +3 -3
  32. package/core/components/ui/form/css/form-control.js +2 -0
  33. package/core/components/ui/form/fieldset/fieldset.js +1 -1
  34. package/core/components/ui/form/fieldset/legend-description.d.ts +5 -0
  35. package/core/components/ui/form/fieldset/legend-description.js +35 -0
  36. package/core/components/ui/form/fieldset/legend.d.ts +4 -5
  37. package/core/components/ui/form/fieldset/legend.js +21 -25
  38. package/core/components/ui/form/input/input.d.ts +1 -2
  39. package/core/components/ui/form/input/input.js +3 -3
  40. package/core/components/ui/form/textarea/textarea.d.ts +0 -1
  41. package/core/components/ui/form/textarea/textarea.js +2 -2
  42. package/core/components/ui/progress/progress.d.ts +7 -0
  43. package/core/components/ui/progress/progress.js +63 -0
  44. package/core/components/ui/table/table-caption.d.ts +5 -0
  45. package/core/components/ui/table/table-caption.js +24 -0
  46. package/core/components/ui/table/table-tbody.d.ts +5 -0
  47. package/core/components/ui/table/table-tbody.js +37 -0
  48. package/core/components/ui/table/table-td.d.ts +7 -0
  49. package/core/components/ui/table/table-td.js +45 -0
  50. package/core/components/ui/table/table-tfoot.d.ts +5 -0
  51. package/core/components/ui/table/table-tfoot.js +23 -0
  52. package/core/components/ui/table/table-th.d.ts +6 -0
  53. package/core/components/ui/table/table-th.js +43 -0
  54. package/core/components/ui/table/table-thead.d.ts +5 -0
  55. package/core/components/ui/table/table-thead.js +24 -0
  56. package/core/components/ui/table/table-tr.d.ts +5 -0
  57. package/core/components/ui/table/table-tr.js +24 -0
  58. package/core/components/ui/table/table.d.ts +16 -0
  59. package/core/components/ui/table/table.js +88 -0
  60. package/core/components/ui/theme/theme-collection/core-variables.js +2 -2
  61. package/core/components/ui/theme/theme-collection/dark.js +3 -2
  62. package/core/components/ui/theme/theme-collection/light.js +1 -0
  63. package/core/components/ui/ui.d.ts +3 -0
  64. package/core/components/ui/ui.js +3 -0
  65. package/core/mixins/Fetcher.d.ts +1 -4
  66. package/core/mixins/Fetcher.js +2 -2
  67. package/core/mixins/FormCheckable.d.ts +3 -2
  68. package/core/mixins/FormInput.d.ts +0 -1
  69. package/core/mixins/Subscriber.d.ts +0 -1
  70. package/core/mixins/Subscriber.js +0 -15
  71. package/core/utils/DataBindObserver.js +0 -2
  72. package/core/utils/Objects.d.ts +2 -1
  73. package/core/utils/Objects.js +8 -2
  74. package/core/utils/PublisherProxy.mjs +42 -12
  75. package/core/utils/api.js +1 -1
  76. package/package.json +36 -1
@@ -59,7 +59,7 @@ export class PublisherProxy {
59
59
  }
60
60
  }
61
61
  _publishAssignement_(lockInternalMutationsTransmission = false) {
62
- this._assignListeners_.forEach((handler) => handler(this._value_.__value ? this._value_.__value : this._value_));
62
+ this._assignListeners_.forEach((handler) => handler(this.get()));
63
63
  this._publishInternalMutation_(lockInternalMutationsTransmission);
64
64
  }
65
65
  _publishInvalidation_() {
@@ -93,7 +93,7 @@ export class PublisherProxy {
93
93
  if (typeof handler != "function")
94
94
  return;
95
95
  this._assignListeners_.add(handler);
96
- handler(this._value_.__value ? this._value_.__value : this._value_);
96
+ handler(this.get());
97
97
  }
98
98
  /**
99
99
  * Stop les appels de la fonction "handler" (passée en paramettre) lorsque la valeur gérée par le proxy change par assignation
@@ -181,6 +181,9 @@ export class PublisherProxy {
181
181
  * Assigne une nouvelle valeur au proxy ce qui déclenche la transmission de la donnée en fonction des "écouteurs" associés
182
182
  */
183
183
  set(newValue, lockInternalMutationsTransmission = false) {
184
+ /**
185
+ * On retounre tout de suite si la valeur n'a pas changé
186
+ */
184
187
  if (this._value_ === newValue)
185
188
  return true;
186
189
  if (this._value_.hasOwnProperty("__value") &&
@@ -188,24 +191,45 @@ export class PublisherProxy {
188
191
  this._value_.__value === newValue.__value) {
189
192
  return true;
190
193
  }
194
+ /**
195
+ * On assigne la nouvelle valeur
196
+ */
191
197
  this._value_ = newValue;
192
- if (this._value_.hasOwnProperty("__value")) {
198
+ /**
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
+ * On publie juste et on sen va.
201
+ */
202
+ const isPrimitiveValue = (this._value_.hasOwnProperty("__value"));
203
+ if (isPrimitiveValue) {
193
204
  this._publishAssignement_(lockInternalMutationsTransmission);
194
205
  return true;
195
206
  }
207
+ /**
208
+ * On fait la diff sur l'existant.
209
+ * On maintient les proxys à supprimer et ceux à ajouter.
210
+ * On met à jour leur valeur interne
211
+ * On publie les maj au fur et a mesure de modifications
212
+ */
196
213
  Array.from(this._proxies_.keys()).forEach((key) => {
197
- // delete this._value_[key];
214
+ /**
215
+ * On supprime les proxys qui ne sont plus dans la nouvelle valeur si ils n'on pas d'écouteurs
216
+ **/
198
217
  if (!this._value_[key] && this._proxies_.has(key) && !this._proxies_.get(key).hasListener()) {
199
218
  this._proxies_.delete(key);
200
219
  }
201
220
  });
221
+ /**
222
+ * Si la donnée est complexe (objet, tableau)
223
+ * on crée les proxys pour les sous-éléments qui n'en on pas
224
+ * On renseigne les nouvelles valeurs internes des proxies
225
+ */
202
226
  if (isComplex(this._value_)) {
203
227
  for (let key in this._value_) {
204
228
  let v = newValue[key];
205
229
  let isVComplex = isComplex(v);
206
230
  let valueV = isVComplex ? v : { __value: v };
207
231
  if (!this._proxies_.has(key)) {
208
- let newPublisher = new Publisher(valueV, this);
232
+ let newPublisher = new Publisher({}, this);
209
233
  this._proxies_.set(key, newPublisher, true);
210
234
  newPublisher._proxies_.set("_parent_", this);
211
235
  }
@@ -213,6 +237,9 @@ export class PublisherProxy {
213
237
  this._publishDynamicFilling_(key, v);
214
238
  }
215
239
  }
240
+ /**
241
+ * On prévient les écouteurs que la valeur a changé
242
+ */
216
243
  this._publishAssignement_();
217
244
  return true;
218
245
  }
@@ -220,8 +247,10 @@ export class PublisherProxy {
220
247
  * Extraire la valeur actuelle du proxy
221
248
  */
222
249
  get() {
223
- if (this._value_.hasOwnProperty("__value"))
224
- return this._value_.__value || null;
250
+ if (this._value_.hasOwnProperty("__value")) {
251
+ let v = this._value_.__value;
252
+ return v != undefined ? v : null;
253
+ }
225
254
  return this._value_;
226
255
  }
227
256
  }
@@ -344,24 +373,25 @@ export default class Publisher extends PublisherProxy {
344
373
  * Les gestionnairs associés sopnt déclenchés en conséquence de manière profonde et remontante si nécessaire.
345
374
  */
346
375
  set: function (oTarget, sKey, vValue) {
376
+ //Fonctionnement pour la donnée interne pas de dispatch;
347
377
  if (sKey == "_value_") {
348
378
  oTarget._value_ = vValue;
349
379
  return oTarget._value_;
350
380
  }
351
- const isValueComplex = isComplex(vValue);
381
+ //Création du publisher si il n'existe pas
352
382
  if (!that._proxies_.has(sKey)) {
353
- let newPublisher = new Publisher(isValueComplex ? vValue : { __value: vValue }, that);
383
+ let newPublisher = new Publisher({}, that);
354
384
  newPublisher._proxies_.set("_parent_", thisProxy);
355
385
  that._proxies_.set(sKey, newPublisher);
356
386
  }
357
- if (that._value_[sKey] === vValue && isValueComplex)
358
- return vValue;
387
+ //mis à jour et publication de la donnée si elle a changé
359
388
  const prevValue = that._value_[sKey];
360
389
  if (prevValue !== vValue) {
361
390
  that._value_[sKey] = vValue;
362
391
  that._publishDynamicFilling_(sKey, vValue);
392
+ that._proxies_.get(sKey).set(isComplex(vValue) ? vValue : { __value: vValue });
363
393
  }
364
- that._proxies_.get(sKey).set(isComplex(vValue) ? vValue : { __value: vValue });
394
+ //on retourne le proxy pour pouvoir chainer les assignements
365
395
  return that._proxies_.get(sKey);
366
396
  },
367
397
  /**
package/core/utils/api.js CHANGED
@@ -84,7 +84,7 @@ class API {
84
84
  * Concatène le serviceURL et le endpoint donné en paramètre
85
85
  */
86
86
  computeURL(path) {
87
- return this.serviceURL + "/" + path;
87
+ return (this.serviceURL + "/" + path).replace(/([^(https?\:)])\/{2,}/g, "$1/");
88
88
  }
89
89
  /*
90
90
  * Envoie des données au endPoint passé en paramètre. par défaut en POST
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "1.1.7",
3
+ "version": "1.1.10",
4
4
  "customElements": "custom-elements.json",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -9,6 +9,7 @@
9
9
  "dependencies": {
10
10
  "@lit-labs/motion": "^1.0.1",
11
11
  "@lit-labs/observers": "^1.0.1",
12
+ "chart.js": "^3.9.1",
12
13
  "lit": "^2.2.3",
13
14
  "url-pattern": "^1.0.3"
14
15
  },
@@ -23,6 +24,8 @@
23
24
  "vite": "^2.6.14"
24
25
  },
25
26
  "exports": {
27
+ "./core/components/functional/configuration/configuration": "./core/components/functional/configuration/configuration",
28
+ "./functional/configuration": "./core/components/functional/configuration/configuration",
26
29
  "./core/components/functional/date/date": "./core/components/functional/date/date",
27
30
  "./functional/date": "./core/components/functional/date/date",
28
31
  "./core/components/functional/example/example": "./core/components/functional/example/example",
@@ -41,6 +44,8 @@
41
44
  "./functional/router/redirect": "./core/components/functional/router/redirect",
42
45
  "./core/components/functional/router/router": "./core/components/functional/router/router",
43
46
  "./functional/router": "./core/components/functional/router/router",
47
+ "./core/components/functional/sonic-scope/sonic-scope": "./core/components/functional/sonic-scope/sonic-scope",
48
+ "./functional/sonic-scope": "./core/components/functional/sonic-scope/sonic-scope",
44
49
  "./core/components/functional/states/states": "./core/components/functional/states/states",
45
50
  "./functional/states": "./core/components/functional/states/states",
46
51
  "./core/components/functional/submit/submit": "./core/components/functional/submit/submit",
@@ -53,6 +58,16 @@
53
58
  "./ui/badge": "./core/components/ui/badge/badge",
54
59
  "./core/components/ui/button/button": "./core/components/ui/button/button",
55
60
  "./ui/button": "./core/components/ui/button/button",
61
+ "./core/components/ui/card/card-footer": "./core/components/ui/card/card-footer",
62
+ "./ui/card/card-footer": "./core/components/ui/card/card-footer",
63
+ "./core/components/ui/card/card-header-descripton": "./core/components/ui/card/card-header-descripton",
64
+ "./ui/card/card-header-descripton": "./core/components/ui/card/card-header-descripton",
65
+ "./core/components/ui/card/card-header": "./core/components/ui/card/card-header",
66
+ "./ui/card/card-header": "./core/components/ui/card/card-header",
67
+ "./core/components/ui/card/card-main": "./core/components/ui/card/card-main",
68
+ "./ui/card/card-main": "./core/components/ui/card/card-main",
69
+ "./core/components/ui/card/card": "./core/components/ui/card/card",
70
+ "./ui/card": "./core/components/ui/card/card",
56
71
  "./core/components/ui/divider/divider": "./core/components/ui/divider/divider",
57
72
  "./ui/divider": "./core/components/ui/divider/divider",
58
73
  "./core/components/ui/form/checkbox/checkbox": "./core/components/ui/form/checkbox/checkbox",
@@ -61,6 +76,8 @@
61
76
  "./ui/form/css/form-control": "./core/components/ui/form/css/form-control",
62
77
  "./core/components/ui/form/fieldset/fieldset": "./core/components/ui/form/fieldset/fieldset",
63
78
  "./ui/form/fieldset": "./core/components/ui/form/fieldset/fieldset",
79
+ "./core/components/ui/form/fieldset/legend-description": "./core/components/ui/form/fieldset/legend-description",
80
+ "./ui/form/fieldset/legend-description": "./core/components/ui/form/fieldset/legend-description",
64
81
  "./core/components/ui/form/fieldset/legend": "./core/components/ui/form/fieldset/legend",
65
82
  "./ui/form/fieldset/legend": "./core/components/ui/form/fieldset/legend",
66
83
  "./core/components/ui/form/form-layout/form-actions": "./core/components/ui/form/form-layout/form-actions",
@@ -109,6 +126,24 @@
109
126
  "./ui/modal": "./core/components/ui/modal/modal",
110
127
  "./core/components/ui/pop/pop": "./core/components/ui/pop/pop",
111
128
  "./ui/pop": "./core/components/ui/pop/pop",
129
+ "./core/components/ui/progress/progress": "./core/components/ui/progress/progress",
130
+ "./ui/progress": "./core/components/ui/progress/progress",
131
+ "./core/components/ui/table/table-caption": "./core/components/ui/table/table-caption",
132
+ "./ui/table/table-caption": "./core/components/ui/table/table-caption",
133
+ "./core/components/ui/table/table-tbody": "./core/components/ui/table/table-tbody",
134
+ "./ui/table/table-tbody": "./core/components/ui/table/table-tbody",
135
+ "./core/components/ui/table/table-td": "./core/components/ui/table/table-td",
136
+ "./ui/table/table-td": "./core/components/ui/table/table-td",
137
+ "./core/components/ui/table/table-tfoot": "./core/components/ui/table/table-tfoot",
138
+ "./ui/table/table-tfoot": "./core/components/ui/table/table-tfoot",
139
+ "./core/components/ui/table/table-th": "./core/components/ui/table/table-th",
140
+ "./ui/table/table-th": "./core/components/ui/table/table-th",
141
+ "./core/components/ui/table/table-thead": "./core/components/ui/table/table-thead",
142
+ "./ui/table/table-thead": "./core/components/ui/table/table-thead",
143
+ "./core/components/ui/table/table-tr": "./core/components/ui/table/table-tr",
144
+ "./ui/table/table-tr": "./core/components/ui/table/table-tr",
145
+ "./core/components/ui/table/table": "./core/components/ui/table/table",
146
+ "./ui/table": "./core/components/ui/table/table",
112
147
  "./core/components/ui/tabs/tab": "./core/components/ui/tabs/tab",
113
148
  "./ui/tabs/tab": "./core/components/ui/tabs/tab",
114
149
  "./core/components/ui/tabs/tabs": "./core/components/ui/tabs/tabs",