@supersoniks/concorde 1.1.1 → 1.1.2

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.
@@ -7,6 +7,7 @@ export declare class Link extends LitElement {
7
7
  set location(value: string);
8
8
  connectedCallback(): void;
9
9
  disconnectedCallback(): void;
10
+ target: null;
10
11
  /**
11
12
  * Si présent on passe en mode pushstate
12
13
  */
@@ -7,11 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import LocationHandler from "@supersoniks/concorde/core/utils/LocationHandler";
8
8
  import { html, LitElement, css } from "lit";
9
9
  import { customElement, property } from "lit/decorators.js";
10
+ import { ifDefined } from "lit/directives/if-defined.js";
10
11
  let Link = class Link extends LitElement {
11
12
  constructor() {
12
13
  super(...arguments);
13
14
  this.href = "";
14
15
  this._location = "";
16
+ this.target = null;
15
17
  /**
16
18
  * Si présent on passe en mode pushstate
17
19
  */
@@ -43,7 +45,7 @@ let Link = class Link extends LitElement {
43
45
  if (!this.href)
44
46
  return html `<slot></slot>`;
45
47
  return html `
46
- <a href="${this.href}" @click=${this.pushState ? this.handlePushState : null}>
48
+ <a href="${this.href}" target=${ifDefined(this.target)} @click=${this.pushState ? this.handlePushState : null}>
47
49
  <slot></slot>
48
50
  </a>
49
51
  `;
@@ -61,6 +63,9 @@ Link.styles = [
61
63
  __decorate([
62
64
  property({ type: String })
63
65
  ], Link.prototype, "href", void 0);
66
+ __decorate([
67
+ property({ type: String })
68
+ ], Link.prototype, "target", void 0);
64
69
  __decorate([
65
70
  property({ type: Boolean })
66
71
  ], Link.prototype, "pushState", void 0);
@@ -4,7 +4,7 @@ export const coreVariables = css `
4
4
  /* --sc-rfs: 16px; */
5
5
 
6
6
  /* polices*/
7
- --sc-font-family-base: "neue-haas-unica", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
7
+ --sc-font-family-base: aileron, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
8
8
  "Helvetica Neue", Arial, sans-serif;
9
9
  --sc-font-weight-base: 400;
10
10
  --sc-font-style-base: inherit;
@@ -87,12 +87,14 @@ let SonicToast = class SonicToast extends LitElement {
87
87
  // Ajoute le toast à la liste
88
88
  let toastComponent = document.querySelector("sonic-toast");
89
89
  const nextId = new Date().valueOf();
90
+ const interactiveRegExp = new RegExp('<\/a>|<\/button>');
91
+ const hasInteractive = interactiveRegExp.test(conf.text);
90
92
  const currentToast = {
91
93
  id: nextId,
92
94
  text: conf.text,
93
95
  title: conf.title,
94
96
  status: conf.status,
95
- preserve: conf.preserve,
97
+ preserve: hasInteractive ? true : conf.preserve,
96
98
  ghost: conf.ghost,
97
99
  marginTop: conf.marginTop,
98
100
  };
@@ -52,6 +52,7 @@ const Subscriber = (superClass) => {
52
52
  * Cela se fait à l'initialisation uniquement et n'est pas modifiable lors de la vie du composant.
53
53
  */
54
54
  this.noShadowDom = null;
55
+ this.propertyMap = null;
55
56
  this.title = "";
56
57
  /**
57
58
  * L'id / l'adresse du publisher accessible via PublisherManager.get(dataProvider)
@@ -359,6 +360,9 @@ const Subscriber = (superClass) => {
359
360
  }
360
361
  }
361
362
  SubscriberElement.instanceCounter = 0;
363
+ __decorate([
364
+ property({ type: Object })
365
+ ], SubscriberElement.prototype, "propertyMap", void 0);
362
366
  __decorate([
363
367
  property({ type: String, attribute: "data-title" })
364
368
  ], SubscriberElement.prototype, "title", void 0);
@@ -71,6 +71,9 @@ export class PublisherProxy {
71
71
  let desc = Object.getOwnPropertyDescriptor(handler, key);
72
72
  if (desc && !desc.set)
73
73
  return;
74
+ if (handler.propertyMap && handler.propertyMap[key]) {
75
+ key = handler.propertyMap[key];
76
+ }
74
77
  if (typeof handler[key] != "undefined" && handler[key] !== value) {
75
78
  handler[key] = value;
76
79
  }
@@ -116,9 +119,9 @@ export class PublisherProxy {
116
119
  this._templateFillListeners_.add(handler);
117
120
  for (var z in this._value_) {
118
121
  const value = this._value_[z];
119
- let desc = Object.getOwnPropertyDescriptor(handler, z);
120
- if (desc && !desc.set)
121
- continue;
122
+ if (handler.propertyMap && handler.propertyMap[z]) {
123
+ z = handler.propertyMap[z];
124
+ }
122
125
  if (typeof handler[z] != "undefined" && handler[z] !== value) {
123
126
  handler[z] = value;
124
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "customElements": "custom-elements.json",
5
5
  "license": "MIT",
6
6
  "publishConfig": {