@supersoniks/concorde 1.0.8 → 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.
- package/core/components/ui/link/link.d.ts +1 -0
- package/core/components/ui/link/link.js +6 -1
- package/core/components/ui/theme/theme-collection/core-variables.js +1 -1
- package/core/components/ui/toast/toast.js +3 -1
- package/core/mixins/Subscriber.js +4 -0
- package/core/utils/PublisherProxy.mjs +9 -0
- package/package.json +1 -21
|
@@ -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:
|
|
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);
|
|
@@ -68,6 +68,12 @@ export class PublisherProxy {
|
|
|
68
68
|
}
|
|
69
69
|
_publishTemplateFilling_(key, value) {
|
|
70
70
|
this._templateFillListeners_.forEach((handler) => {
|
|
71
|
+
let desc = Object.getOwnPropertyDescriptor(handler, key);
|
|
72
|
+
if (desc && !desc.set)
|
|
73
|
+
return;
|
|
74
|
+
if (handler.propertyMap && handler.propertyMap[key]) {
|
|
75
|
+
key = handler.propertyMap[key];
|
|
76
|
+
}
|
|
71
77
|
if (typeof handler[key] != "undefined" && handler[key] !== value) {
|
|
72
78
|
handler[key] = value;
|
|
73
79
|
}
|
|
@@ -113,6 +119,9 @@ export class PublisherProxy {
|
|
|
113
119
|
this._templateFillListeners_.add(handler);
|
|
114
120
|
for (var z in this._value_) {
|
|
115
121
|
const value = this._value_[z];
|
|
122
|
+
if (handler.propertyMap && handler.propertyMap[z]) {
|
|
123
|
+
z = handler.propertyMap[z];
|
|
124
|
+
}
|
|
116
125
|
if (typeof handler[z] != "undefined" && handler[z] !== value) {
|
|
117
126
|
handler[z] = value;
|
|
118
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supersoniks/concorde",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"customElements": "custom-elements.json",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -9,39 +9,19 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@lit-labs/motion": "^1.0.1",
|
|
11
11
|
"@lit-labs/observers": "^1.0.1",
|
|
12
|
-
"@types/node": "^17.0.30",
|
|
13
12
|
"lit": "^2.2.3",
|
|
14
|
-
"reflect-metadata": "^0.1.13",
|
|
15
|
-
"storybook-i18n": "^1.0.8",
|
|
16
13
|
"url-pattern": "^1.0.3"
|
|
17
14
|
},
|
|
18
|
-
"peerDependencies": {
|
|
19
|
-
"lit": "^2.2.3"
|
|
20
|
-
},
|
|
21
15
|
"devDependencies": {
|
|
22
|
-
"@custom-elements-manifest/analyzer": "^0.5.7",
|
|
23
|
-
"@storybook/addon-actions": "^6.5.0-beta.8",
|
|
24
|
-
"@storybook/addon-docs": "^6.5.0-beta.8",
|
|
25
|
-
"@storybook/addon-essentials": "^6.5.0-beta.8",
|
|
26
|
-
"@storybook/addon-links": "^6.5.0-beta.8",
|
|
27
|
-
"@storybook/builder-vite": "^0.1.32",
|
|
28
|
-
"@storybook/client-api": "6.5.0-beta.8",
|
|
29
|
-
"@storybook/web-components": "^6.5.0-beta.8",
|
|
30
16
|
"@tailwindcss/typography": "^0.5.2",
|
|
31
17
|
"autoprefixer": "^10.4.5",
|
|
32
|
-
"custom-elements-manifest": "^1.0.0",
|
|
33
18
|
"postcss": "^8.4.12",
|
|
34
19
|
"rollup-plugin-minify-html-literals": "^1.2.6",
|
|
35
20
|
"rollup-plugin-postcss-lit": "^2.0.0",
|
|
36
21
|
"tailwindcss": "^3.0.23",
|
|
37
|
-
"ts-prune": "^0.10.3",
|
|
38
22
|
"typescript": "^4.6.4",
|
|
39
23
|
"vite": "^2.6.14"
|
|
40
24
|
},
|
|
41
|
-
"resolutions": {
|
|
42
|
-
"webpack": "^4.46.0",
|
|
43
|
-
"webpack-cli": "^4.9.2"
|
|
44
|
-
},
|
|
45
25
|
"exports": {
|
|
46
26
|
"./core/components/functional/date/date": "./core/components/functional/date/date",
|
|
47
27
|
"./functional/date": "./core/components/functional/date/date",
|