@supersoniks/concorde 1.1.41 → 1.1.43
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/README.md +0 -0
- package/cli.js +0 -0
- package/components.d.ts +0 -0
- package/components.js +2 -3
- package/concorde-core.bundle.js +37 -42
- package/concorde-core.es.js +5702 -4823
- package/core/_types/types.d.ts +26 -0
- package/core/_types/types.js +1 -0
- package/core/components/functional/date/date.d.ts +13 -5
- package/core/components/functional/date/date.js +48 -29
- package/core/components/functional/example/example.d.ts +1 -1
- package/core/components/functional/example/example.js +1 -1
- package/core/components/functional/fetch/fetch.d.ts +40 -3
- package/core/components/functional/fetch/fetch.js +2 -6
- package/core/components/functional/functional.d.ts +2 -0
- package/core/components/functional/functional.js +2 -0
- package/core/components/functional/if/if.d.ts +3 -0
- package/core/components/functional/if/if.js +6 -12
- package/core/components/functional/if/if.test.d.ts +1 -0
- package/core/components/functional/if/if.test.js +44 -0
- package/core/components/functional/list/list.d.ts +32 -8
- package/core/components/functional/list/list.js +33 -40
- package/core/components/functional/mix/mix.d.ts +22 -0
- package/core/components/functional/mix/mix.js +99 -0
- package/core/components/functional/queue/queue.d.ts +16 -3
- package/core/components/functional/queue/queue.js +71 -15
- package/core/components/functional/router/redirect.d.ts +10 -1
- package/core/components/functional/router/redirect.js +5 -6
- package/core/components/functional/router/router.d.ts +15 -1
- package/core/components/functional/router/router.js +1 -6
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +1 -1
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +24 -12
- package/core/components/functional/sdui/default-library.json +108 -0
- package/core/components/functional/sdui/sdui-utils.d.ts +5 -0
- package/core/components/functional/sdui/sdui-utils.js +63 -0
- package/core/components/functional/sdui/sdui.d.ts +20 -9
- package/core/components/functional/sdui/sdui.js +64 -24
- package/core/components/functional/sdui/types.d.ts +4 -2
- package/core/components/functional/sdui/types.js +0 -0
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -0
- package/core/components/functional/sonic-scope/sonic-scope.js +0 -0
- package/core/components/functional/states/states.d.ts +19 -3
- package/core/components/functional/states/states.js +7 -12
- package/core/components/functional/submit/submit.d.ts +16 -1
- package/core/components/functional/submit/submit.js +87 -17
- package/core/components/functional/subscriber/subscriber.d.ts +4 -1
- package/core/components/functional/subscriber/subscriber.js +1 -6
- package/core/components/functional/value/value.d.ts +7 -0
- package/core/components/functional/value/value.js +26 -0
- package/core/components/ui/_css/scroll.d.ts +0 -0
- package/core/components/ui/_css/scroll.js +6 -7
- package/core/components/ui/_css/size.d.ts +1 -0
- package/core/components/ui/_css/size.js +3 -1
- package/core/components/ui/_css/type.d.ts +0 -0
- package/core/components/ui/_css/type.js +0 -0
- package/core/components/ui/alert/alert.d.ts +2 -2
- package/core/components/ui/alert/alert.js +11 -16
- package/core/components/ui/badge/badge.d.ts +3 -1
- package/core/components/ui/badge/badge.js +36 -22
- package/core/components/ui/button/button.d.ts +23 -20
- package/core/components/ui/button/button.js +59 -42
- package/core/components/ui/captcha/captcha.d.ts +14 -2
- package/core/components/ui/captcha/captcha.js +17 -12
- package/core/components/ui/card/card-footer.d.ts +0 -0
- package/core/components/ui/card/card-footer.js +1 -8
- package/core/components/ui/card/card-header-descripton.d.ts +0 -0
- package/core/components/ui/card/card-header-descripton.js +3 -9
- package/core/components/ui/card/card-header.d.ts +0 -0
- package/core/components/ui/card/card-header.js +1 -6
- package/core/components/ui/card/card-main.d.ts +0 -0
- package/core/components/ui/card/card-main.js +0 -5
- package/core/components/ui/card/card.d.ts +1 -1
- package/core/components/ui/card/card.js +28 -12
- package/core/components/ui/divider/divider.d.ts +2 -0
- package/core/components/ui/divider/divider.js +44 -17
- package/core/components/ui/form/checkbox/checkbox.d.ts +53 -16
- package/core/components/ui/form/checkbox/checkbox.js +54 -29
- package/core/components/ui/form/css/form-control.d.ts +2 -0
- package/core/components/ui/form/css/form-control.js +145 -67
- package/core/components/ui/form/fieldset/fieldset.d.ts +8 -1
- package/core/components/ui/form/fieldset/fieldset.js +45 -8
- package/core/components/ui/form/fieldset/legend-description.d.ts +0 -0
- package/core/components/ui/form/fieldset/legend-description.js +0 -5
- package/core/components/ui/form/fieldset/legend.d.ts +0 -0
- package/core/components/ui/form/fieldset/legend.js +4 -7
- package/core/components/ui/form/form-actions/form-actions.d.ts +2 -0
- package/core/components/ui/form/form-actions/form-actions.js +26 -11
- package/core/components/ui/form/form-layout/form-layout.d.ts +5 -2
- package/core/components/ui/form/form-layout/form-layout.js +31 -9
- package/core/components/ui/form/input/input.d.ts +15 -18
- package/core/components/ui/form/input/input.js +89 -54
- package/core/components/ui/form/input/password-helper.d.ts +7 -1
- package/core/components/ui/form/input/password-helper.js +33 -10
- package/core/components/ui/form/input/same-value-helper.d.ts +1 -1
- package/core/components/ui/form/input/same-value-helper.js +1 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +34 -0
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +133 -0
- package/core/components/ui/form/radio/radio.d.ts +6 -0
- package/core/components/ui/form/radio/radio.js +7 -12
- package/core/components/ui/form/select/select.d.ts +23 -7
- package/core/components/ui/form/select/select.js +71 -40
- package/core/components/ui/form/textarea/textarea.d.ts +13 -13
- package/core/components/ui/form/textarea/textarea.js +31 -38
- package/core/components/ui/group/group.d.ts +11 -1
- package/core/components/ui/group/group.js +79 -17
- package/core/components/ui/icon/icon.d.ts +10 -3
- package/core/components/ui/icon/icon.js +16 -15
- package/core/components/ui/icon/icons.d.ts +0 -0
- package/core/components/ui/icon/icons.js +11 -8
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/image/image.d.ts +0 -0
- package/core/components/ui/image/image.js +0 -5
- package/core/components/ui/link/link.d.ts +1 -1
- package/core/components/ui/link/link.js +2 -6
- package/core/components/ui/loader/loader.d.ts +0 -0
- package/core/components/ui/loader/loader.js +2 -8
- package/core/components/ui/loader/styles/fixed.d.ts +0 -0
- package/core/components/ui/loader/styles/fixed.js +0 -0
- package/core/components/ui/loader/styles/inline.d.ts +0 -0
- package/core/components/ui/loader/styles/inline.js +0 -0
- package/core/components/ui/menu/menu-item.d.ts +0 -0
- package/core/components/ui/menu/menu-item.js +4 -9
- package/core/components/ui/menu/menu.d.ts +9 -1
- package/core/components/ui/menu/menu.js +183 -27
- package/core/components/ui/modal/modal-actions.d.ts +0 -0
- package/core/components/ui/modal/modal-actions.js +1 -6
- package/core/components/ui/modal/modal-close.d.ts +1 -0
- package/core/components/ui/modal/modal-close.js +14 -10
- package/core/components/ui/modal/modal-content.d.ts +0 -0
- package/core/components/ui/modal/modal-content.js +0 -5
- package/core/components/ui/modal/modal-subtitle.d.ts +0 -0
- package/core/components/ui/modal/modal-subtitle.js +2 -6
- package/core/components/ui/modal/modal-title.d.ts +0 -0
- package/core/components/ui/modal/modal-title.js +0 -5
- package/core/components/ui/modal/modal.d.ts +7 -7
- package/core/components/ui/modal/modal.js +36 -36
- package/core/components/ui/pop/pop.d.ts +2 -1
- package/core/components/ui/pop/pop.js +11 -10
- package/core/components/ui/progress/progress.d.ts +0 -0
- package/core/components/ui/progress/progress.js +34 -32
- package/core/components/ui/table/table-caption.d.ts +0 -0
- package/core/components/ui/table/table-caption.js +5 -10
- package/core/components/ui/table/table-tbody.d.ts +0 -0
- package/core/components/ui/table/table-tbody.js +10 -14
- package/core/components/ui/table/table-td.d.ts +2 -0
- package/core/components/ui/table/table-td.js +8 -5
- package/core/components/ui/table/table-tfoot.d.ts +0 -0
- package/core/components/ui/table/table-tfoot.js +5 -7
- package/core/components/ui/table/table-th.d.ts +2 -0
- package/core/components/ui/table/table-th.js +12 -9
- package/core/components/ui/table/table-thead.d.ts +0 -0
- package/core/components/ui/table/table-thead.js +1 -6
- package/core/components/ui/table/table-tr.d.ts +0 -0
- package/core/components/ui/table/table-tr.js +4 -6
- package/core/components/ui/table/table.d.ts +0 -3
- package/core/components/ui/table/table.js +14 -31
- package/core/components/ui/taxonomy/taxonomy.d.ts +6 -3
- package/core/components/ui/taxonomy/taxonomy.js +9 -9
- package/core/components/ui/theme/css/tailwind.css +0 -0
- package/core/components/ui/theme/css/tailwind.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/core-variables.js +13 -11
- package/core/components/ui/theme/theme-collection/dark.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/dark.js +1 -1
- package/core/components/ui/theme/theme-collection/light.d.ts +0 -0
- package/core/components/ui/theme/theme-collection/light.js +0 -0
- package/core/components/ui/theme/theme.d.ts +1 -6
- package/core/components/ui/theme/theme.js +7 -36
- package/core/components/ui/toast/message-subscriber.d.ts +13 -7
- package/core/components/ui/toast/message-subscriber.js +0 -0
- package/core/components/ui/toast/toast-item.d.ts +0 -0
- package/core/components/ui/toast/toast-item.js +1 -1
- package/core/components/ui/toast/toast.d.ts +2 -1
- package/core/components/ui/toast/toast.js +29 -14
- package/core/components/ui/toast/types.d.ts +0 -0
- package/core/components/ui/toast/types.js +0 -0
- package/core/components/ui/tooltip/tooltip.d.ts +1 -0
- package/core/components/ui/tooltip/tooltip.js +35 -14
- package/core/components/ui/ui.d.ts +1 -0
- package/core/components/ui/ui.js +1 -3
- package/core/core.d.ts +0 -0
- package/core/core.js +5 -6
- package/core/mixins/Fetcher.d.ts +19 -10
- package/core/mixins/Fetcher.js +26 -10
- package/core/mixins/FormCheckable.d.ts +17 -8
- package/core/mixins/FormCheckable.js +177 -22
- package/core/mixins/FormElement.d.ts +12 -7
- package/core/mixins/FormElement.js +42 -26
- package/core/mixins/FormInput.d.ts +8 -4
- package/core/mixins/FormInput.js +4 -3
- package/core/mixins/Subscriber.d.ts +7 -5
- package/core/mixins/Subscriber.js +34 -32
- package/core/mixins/TemplatesContainer.d.ts +0 -0
- package/core/mixins/TemplatesContainer.js +0 -0
- package/core/mixins/mixins.d.ts +0 -0
- package/core/mixins/mixins.js +0 -0
- package/core/utils/Arrays.d.ts +15 -15
- package/core/utils/Arrays.js +0 -0
- package/core/utils/DataBindObserver.d.ts +16 -9
- package/core/utils/DataBindObserver.js +23 -28
- package/core/utils/Electron.d.ts +5 -1
- package/core/utils/Electron.js +4 -2
- package/core/utils/Format.d.ts +0 -0
- package/core/utils/Format.js +0 -0
- package/core/utils/HTML.d.ts +9 -2
- package/core/utils/HTML.js +22 -3
- package/core/utils/LocationHandler.d.ts +6 -5
- package/core/utils/LocationHandler.js +19 -8
- package/core/utils/Objects.d.ts +7 -4
- package/core/utils/Objects.js +28 -6
- package/core/utils/{PublisherProxy.d.mts → PublisherProxy.d.ts} +40 -31
- package/core/utils/{PublisherProxy.mjs → PublisherProxy.js} +54 -28
- package/core/utils/Utils.d.ts +3 -0
- package/core/utils/Utils.js +18 -0
- package/core/utils/api.d.ts +39 -7
- package/core/utils/api.js +45 -32
- package/img/concorde-logo.svg +1 -0
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +36 -18
- package/mixins.js +3 -4
- package/package.json +47 -10
- package/svg/regular/plane.svg +1 -0
- package/svg/solid/plane.svg +1 -0
- package/test-utils/TestUtils.d.ts +4 -0
- package/test-utils/TestUtils.js +12 -0
- package/utils.d.ts +3 -1
- package/utils.js +7 -5
- package/core/components/functional/configuration/configuration.d.ts +0 -5
- package/core/components/functional/configuration/configuration.js +0 -22
- package/core/components/ui/tabs/tab.d.ts +0 -6
- package/core/components/ui/tabs/tab.js +0 -46
- package/core/components/ui/tabs/tabs.d.ts +0 -15
- package/core/components/ui/tabs/tabs.js +0 -129
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
import { DirectiveResult } from "lit/directive";
|
|
3
|
+
import { UnsafeHTMLDirective } from "lit/directives/unsafe-html";
|
|
4
|
+
/**
|
|
5
|
+
* Afficher l'icone choisie parmis une liste prédéfinie dans icons.json
|
|
6
|
+
* les tailles suivantes sont disponible via l'attribut *size* : 2xs,xs,sm,"",lg,xl,2xl
|
|
7
|
+
*/
|
|
2
8
|
export declare class Icon extends LitElement {
|
|
3
9
|
static styles: import("lit").CSSResult;
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
renderId: number;
|
|
11
|
+
updateIcon(): void;
|
|
12
|
+
iconText: DirectiveResult<typeof UnsafeHTMLDirective> | string;
|
|
6
13
|
/**
|
|
7
14
|
* Nom identifiant l'icone ex : *info*
|
|
8
15
|
*/
|
|
@@ -21,5 +28,5 @@ export declare class Icon extends LitElement {
|
|
|
21
28
|
private _library;
|
|
22
29
|
get library(): string;
|
|
23
30
|
set library(newLibrary: string);
|
|
24
|
-
render():
|
|
31
|
+
render(): DirectiveResult<typeof UnsafeHTMLDirective>;
|
|
25
32
|
}
|
|
@@ -13,17 +13,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
import { LitElement, css, nothing } from "lit";
|
|
17
|
-
import { customElement, property } from "lit/decorators.js";
|
|
18
16
|
import Icons from "@supersoniks/concorde/core/components/ui/icon/icons";
|
|
17
|
+
import { css, LitElement, nothing } from "lit";
|
|
18
|
+
import { customElement, property } from "lit/decorators.js";
|
|
19
|
+
const tagName = "sonic-icon";
|
|
19
20
|
/**
|
|
20
21
|
* Afficher l'icone choisie parmis une liste prédéfinie dans icons.json
|
|
21
22
|
* les tailles suivantes sont disponible via l'attribut *size* : 2xs,xs,sm,"",lg,xl,2xl
|
|
22
23
|
*/
|
|
23
|
-
const tagName = "sonic-icon";
|
|
24
24
|
let Icon = class Icon extends LitElement {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
|
+
this.renderId = 0;
|
|
27
28
|
this.iconText = "";
|
|
28
29
|
/**
|
|
29
30
|
* Nom identifiant l'icone ex : *info*
|
|
@@ -39,12 +40,17 @@ let Icon = class Icon extends LitElement {
|
|
|
39
40
|
this._library = "";
|
|
40
41
|
}
|
|
41
42
|
updateIcon() {
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
if (!this.name)
|
|
44
|
+
return;
|
|
45
|
+
this.renderId++;
|
|
46
|
+
const frameRenderId = this.renderId;
|
|
47
|
+
window.requestAnimationFrame(() => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
if (frameRenderId != this.renderId) {
|
|
44
49
|
return;
|
|
50
|
+
}
|
|
45
51
|
this.iconText = yield Icons.default.get({ name: this.name, prefix: this.prefix, library: this.library });
|
|
46
52
|
this.requestUpdate();
|
|
47
|
-
});
|
|
53
|
+
}));
|
|
48
54
|
}
|
|
49
55
|
get name() {
|
|
50
56
|
return this._name;
|
|
@@ -88,14 +94,14 @@ Icon.styles = css `
|
|
|
88
94
|
width: var(--sc-icon-size, 1em);
|
|
89
95
|
}
|
|
90
96
|
|
|
91
|
-
svg:not([fill="none"]){
|
|
97
|
+
svg:not([fill="none"]) {
|
|
92
98
|
fill: currentColor;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
|
-
svg[fill="none"]{
|
|
101
|
+
svg[fill="none"] {
|
|
96
102
|
stroke-width: 2;
|
|
97
103
|
}
|
|
98
|
-
|
|
104
|
+
|
|
99
105
|
:host([size="2xs"]) svg {
|
|
100
106
|
--sc-icon-size: 0.625em;
|
|
101
107
|
}
|
|
@@ -122,7 +128,7 @@ Icon.styles = css `
|
|
|
122
128
|
|
|
123
129
|
:host([size="3xl"]) svg {
|
|
124
130
|
--sc-icon-size: 2.8em;
|
|
125
|
-
|
|
131
|
+
}
|
|
126
132
|
`;
|
|
127
133
|
__decorate([
|
|
128
134
|
property({ type: String })
|
|
@@ -137,8 +143,3 @@ Icon = __decorate([
|
|
|
137
143
|
customElement(tagName)
|
|
138
144
|
], Icon);
|
|
139
145
|
export { Icon };
|
|
140
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
141
|
-
try {
|
|
142
|
-
customElements.define(tagName, Icon);
|
|
143
|
-
}
|
|
144
|
-
catch (e) { }
|
|
File without changes
|
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
var _a;
|
|
11
|
-
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
12
11
|
import icons from "@supersoniks/concorde/core/components/ui/icon/icons.json";
|
|
12
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
13
13
|
/**
|
|
14
14
|
* Ce tableau static permet de ne pas appeler plusieurs fois le même service lors d'appel concurrents en GET.
|
|
15
15
|
*/
|
|
@@ -31,6 +31,9 @@ const libraries = {
|
|
|
31
31
|
feathers: {
|
|
32
32
|
url: "https://cdn.jsdelivr.net/npm/feather-icons@4.29.0/dist/icons/$name.svg",
|
|
33
33
|
},
|
|
34
|
+
lucide: {
|
|
35
|
+
url: "https://cdn.jsdelivr.net/npm/lucide-static@0.16.29/icons/$name.svg",
|
|
36
|
+
},
|
|
34
37
|
material: {
|
|
35
38
|
url: "https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.5/svg/$name/$prefix.svg",
|
|
36
39
|
defaultPrefix: "regular",
|
|
@@ -39,6 +42,7 @@ const libraries = {
|
|
|
39
42
|
url: "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/svgs/$prefix/$name.svg",
|
|
40
43
|
defaultPrefix: "regular",
|
|
41
44
|
},
|
|
45
|
+
custom: { url: "", defaultPrefix: "" },
|
|
42
46
|
};
|
|
43
47
|
let hasEnabledCustomLibrary = false;
|
|
44
48
|
function enableCustomLibrary() {
|
|
@@ -46,9 +50,9 @@ function enableCustomLibrary() {
|
|
|
46
50
|
if (hasEnabledCustomLibrary)
|
|
47
51
|
return;
|
|
48
52
|
hasEnabledCustomLibrary = true;
|
|
49
|
-
libraries.custom =
|
|
50
|
-
libraries.custom.
|
|
51
|
-
|
|
53
|
+
libraries.custom.url = ((_b = document.querySelector("[customIconLibraryPath]")) === null || _b === void 0 ? void 0 : _b.getAttribute("customIconLibraryPath")) || "";
|
|
54
|
+
libraries.custom.defaultPrefix =
|
|
55
|
+
((_c = document.querySelector("[customIconDefaultPrefix]")) === null || _c === void 0 ? void 0 : _c.getAttribute("customIconDefaultPrefix")) || "";
|
|
52
56
|
}
|
|
53
57
|
export default class Icons {
|
|
54
58
|
static registerIcons(newIcons) {
|
|
@@ -77,8 +81,9 @@ Icons.fontAwesomeNext = {
|
|
|
77
81
|
}
|
|
78
82
|
if (library && libraries[library]) {
|
|
79
83
|
let libraryItem = libraries[library];
|
|
80
|
-
let prefix = params.prefix || libraryItem.defaultPrefix;
|
|
84
|
+
let prefix = params.prefix || libraryItem.defaultPrefix || "";
|
|
81
85
|
let libIcons = iconsAsRecord[library] || {};
|
|
86
|
+
iconsAsRecord[library] = libIcons;
|
|
82
87
|
let libIconsKey = prefix + "-" + name;
|
|
83
88
|
// if(!libIcons )libIcons = iconsAsRecord[library] = {};
|
|
84
89
|
/**
|
|
@@ -90,8 +95,6 @@ Icons.fontAwesomeNext = {
|
|
|
90
95
|
/**
|
|
91
96
|
* on utilise une promise mutualisée pour ne pas faire plusieurs appels concurents d'une même icone
|
|
92
97
|
*/
|
|
93
|
-
if (libIcons[libIconsKey])
|
|
94
|
-
return unsafeHTML(libIcons[libIconsKey]);
|
|
95
98
|
if (!loadingGetPromises.has(url)) {
|
|
96
99
|
let promise = new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
100
|
let result = yield fetch(url);
|
|
@@ -114,7 +117,7 @@ Icons.fontAwesomeNext = {
|
|
|
114
117
|
*/
|
|
115
118
|
let result = yield loadingGetPromises.get(url);
|
|
116
119
|
loadingGetPromises.delete(url);
|
|
117
|
-
libIcons[libIconsKey] = result;
|
|
120
|
+
libIcons[libIconsKey] = result || "";
|
|
118
121
|
return unsafeHTML(result);
|
|
119
122
|
}
|
|
120
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "core": { "cancel": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "check-circled-outline": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7 12.5L10 15.5L17 8.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "check": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5 13L9 17L19 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "emoji-puzzled": "
|
|
1
|
+
{ "core": { "cancel": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "check-circled-outline": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7 12.5L10 15.5L17 8.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "check": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5 13L9 17L19 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "emoji-puzzled": "<svg width=\"24px\" height=\"24px\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" ><path d=\"M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"M11.5 15.5s1.5-2 4.5-2 4.5 2 4.5 2M3 4c0-2.754 4-2.754 4 0 0 1.967-2 1.64-2 4M5 11.01l.01-.011\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"M17.5 9a.5.5 0 110-1 .5.5 0 010 1zM10.5 9a.5.5 0 110-1 .5.5 0 010 1z\" fill=\"#000\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path></svg>", "info-empty": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12 11.5V16.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7.51L12.01 7.49889\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "loader": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-loader\"><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"6\"></line><line x1=\"12\" y1=\"18\" x2=\"12\" y2=\"22\"></line><line x1=\"4.93\" y1=\"4.93\" x2=\"7.76\" y2=\"7.76\"></line><line x1=\"16.24\" y1=\"16.24\" x2=\"19.07\" y2=\"19.07\"></line><line x1=\"2\" y1=\"12\" x2=\"6\" y2=\"12\"></line><line x1=\"18\" y1=\"12\" x2=\"22\" y2=\"12\"></line><line x1=\"4.93\" y1=\"19.07\" x2=\"7.76\" y2=\"16.24\"></line><line x1=\"16.24\" y1=\"7.76\" x2=\"19.07\" y2=\"4.93\"></line></svg>", "minus-small": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"w-6 h-6\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M18 12H6\" />\n</svg>\n", "more-horiz": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M18 12.5C18.2761 12.5 18.5 12.2761 18.5 12C18.5 11.7239 18.2761 11.5 18 11.5C17.7239 11.5 17.5 11.7239 17.5 12C17.5 12.2761 17.7239 12.5 18 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M6 12.5C6.27614 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.7239 5.5 12C5.5 12.2761 5.72386 12.5 6 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "more-vert": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 18.5C12.2761 18.5 12.5 18.2761 12.5 18C12.5 17.7239 12.2761 17.5 12 17.5C11.7239 17.5 11.5 17.7239 11.5 18C11.5 18.2761 11.7239 18.5 12 18.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 6.5C12.2761 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.2761 5.5 12 5.5C11.7239 5.5 11.5 5.72386 11.5 6C11.5 6.27614 11.7239 6.5 12 6.5Z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "nav-arrow-down": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", "warning-circled-outline": "<svg width=\"24\" height=\"24\" stroke-width=\"1.5\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12 7L12 13\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 17.01L12.01 16.9989\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n" } }
|
|
File without changes
|
|
@@ -10,7 +10,7 @@ export declare class Link extends LitElement {
|
|
|
10
10
|
* - strict : l'url courante match exactement avec le href du bouton
|
|
11
11
|
* - partial : l'url courante match à gauche avec le href du bouton
|
|
12
12
|
* - disabled : aucune activation / désactivation
|
|
13
|
-
|
|
13
|
+
*/
|
|
14
14
|
autoActive: "strict" | "partial" | "disabled";
|
|
15
15
|
connectedCallback(): void;
|
|
16
16
|
disconnectedCallback(): void;
|
|
@@ -20,7 +20,7 @@ let Link = class Link extends LitElement {
|
|
|
20
20
|
* - strict : l'url courante match exactement avec le href du bouton
|
|
21
21
|
* - partial : l'url courante match à gauche avec le href du bouton
|
|
22
22
|
* - disabled : aucune activation / désactivation
|
|
23
|
-
|
|
23
|
+
*/
|
|
24
24
|
this.autoActive = "partial";
|
|
25
25
|
this._target = null;
|
|
26
26
|
/**
|
|
@@ -73,7 +73,7 @@ Link.styles = [
|
|
|
73
73
|
a {
|
|
74
74
|
color: inherit;
|
|
75
75
|
text-decoration: none;
|
|
76
|
-
display:contents;
|
|
76
|
+
display: contents;
|
|
77
77
|
}
|
|
78
78
|
`,
|
|
79
79
|
];
|
|
@@ -93,7 +93,3 @@ Link = __decorate([
|
|
|
93
93
|
customElement(tagName)
|
|
94
94
|
], Link);
|
|
95
95
|
export { Link };
|
|
96
|
-
try {
|
|
97
|
-
customElements.define(tagName, Link);
|
|
98
|
-
}
|
|
99
|
-
catch (e) { }
|
|
File without changes
|
|
@@ -26,9 +26,8 @@ let Loader = Loader_1 = class Loader extends LitElement {
|
|
|
26
26
|
let loader = Loader_1.loader;
|
|
27
27
|
if (!conf)
|
|
28
28
|
conf = {};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
loader.setAttribute(z, v[z]);
|
|
29
|
+
if (conf.mode)
|
|
30
|
+
loader.setAttribute("mode", conf.mode);
|
|
32
31
|
if (!conf.container) {
|
|
33
32
|
conf.container = document.querySelector("sonic-theme") || document.body;
|
|
34
33
|
conf.mode = "fixed";
|
|
@@ -88,8 +87,3 @@ Loader = Loader_1 = __decorate([
|
|
|
88
87
|
customElement(tagName)
|
|
89
88
|
], Loader);
|
|
90
89
|
export { Loader };
|
|
91
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
92
|
-
try {
|
|
93
|
-
customElements.define(tagName, Loader);
|
|
94
|
-
}
|
|
95
|
-
catch (e) { }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,16 +12,16 @@ let MenuItem = class MenuItem extends Button {
|
|
|
12
12
|
super();
|
|
13
13
|
}
|
|
14
14
|
connectedCallback() {
|
|
15
|
-
if (!this.hasAttribute(
|
|
15
|
+
if (!this.hasAttribute("variant")) {
|
|
16
16
|
this.variant = "ghost";
|
|
17
17
|
}
|
|
18
|
-
if (!this.hasAttribute(
|
|
18
|
+
if (!this.hasAttribute("type")) {
|
|
19
19
|
this.type = "primary";
|
|
20
20
|
}
|
|
21
|
-
if (!this.hasAttribute(
|
|
21
|
+
if (!this.hasAttribute("shape")) {
|
|
22
22
|
this.shape = "block";
|
|
23
23
|
}
|
|
24
|
-
if (!this.hasAttribute(
|
|
24
|
+
if (!this.hasAttribute("align")) {
|
|
25
25
|
this.align = "left";
|
|
26
26
|
}
|
|
27
27
|
super.connectedCallback();
|
|
@@ -31,8 +31,3 @@ MenuItem = __decorate([
|
|
|
31
31
|
customElement(tagName)
|
|
32
32
|
], MenuItem);
|
|
33
33
|
export { MenuItem };
|
|
34
|
-
//Ajout pour Storybook
|
|
35
|
-
try {
|
|
36
|
-
customElements.define(tagName, MenuItem);
|
|
37
|
-
}
|
|
38
|
-
catch (e) { }
|
|
@@ -16,18 +16,26 @@ export declare class MenuItems extends LitElement {
|
|
|
16
16
|
/**
|
|
17
17
|
* Ombre
|
|
18
18
|
*/
|
|
19
|
-
shadow: "" | "sm" | "md" |
|
|
19
|
+
shadow: "" | "sm" | "md" | "lg" | "xl" | "none" | null;
|
|
20
20
|
moreShape: "square" | "circle";
|
|
21
|
+
scrollable: boolean;
|
|
22
|
+
observer: ResizeObserver | null;
|
|
21
23
|
/**
|
|
22
24
|
* Propriété min-width du bouton
|
|
23
25
|
*/
|
|
24
26
|
minWidth: string;
|
|
27
|
+
menu: HTMLElement;
|
|
25
28
|
menuChildren: Array<HTMLElement>;
|
|
26
29
|
moreElements: Array<HTMLElement>;
|
|
27
30
|
hasMoreElements: boolean;
|
|
28
31
|
checkIfMore(): void;
|
|
29
32
|
updated(_changedProperties: PropertyValues): void;
|
|
30
33
|
mainSlotChange(): void;
|
|
34
|
+
connectedCallback(): void;
|
|
35
|
+
disconnectedCallback(): void;
|
|
36
|
+
updateIsScollable: () => void;
|
|
37
|
+
initScrollable(): void;
|
|
38
|
+
setScrollShadow(target: HTMLElement, direction: string): void;
|
|
31
39
|
setChildrenSize(menuItems: Array<HTMLElement>): void;
|
|
32
40
|
render(): import("lit-html").TemplateResult<1>;
|
|
33
41
|
}
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, css } from "lit";
|
|
8
8
|
import { styleMap } from "lit/directives/style-map.js";
|
|
9
|
-
import { customElement, property, queryAssignedElements, state } from "lit/decorators.js";
|
|
9
|
+
import { customElement, property, queryAssignedElements, state, query } from "lit/decorators.js";
|
|
10
10
|
import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
11
11
|
const tagName = "sonic-menu";
|
|
12
12
|
let MenuItems = class MenuItems extends LitElement {
|
|
@@ -28,18 +28,26 @@ let MenuItems = class MenuItems extends LitElement {
|
|
|
28
28
|
*/
|
|
29
29
|
this.shadow = null;
|
|
30
30
|
this.moreShape = "circle";
|
|
31
|
+
this.scrollable = false;
|
|
32
|
+
this.observer = null;
|
|
31
33
|
/**
|
|
32
34
|
* Propriété min-width du bouton
|
|
33
35
|
*/
|
|
34
36
|
this.minWidth = "0";
|
|
35
37
|
this.hasMoreElements = false;
|
|
38
|
+
this.updateIsScollable = () => {
|
|
39
|
+
if (this.scrollable) {
|
|
40
|
+
this.initScrollable();
|
|
41
|
+
this.setScrollShadow(this, this.direction);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
36
44
|
}
|
|
37
45
|
checkIfMore() {
|
|
38
46
|
var _a;
|
|
39
47
|
this.hasMoreElements = !!((_a = this.moreElements) === null || _a === void 0 ? void 0 : _a.length);
|
|
40
48
|
}
|
|
41
49
|
updated(_changedProperties) {
|
|
42
|
-
const moreBtn = this.querySelector(
|
|
50
|
+
const moreBtn = this.querySelector(".more-btn");
|
|
43
51
|
if (this.size && moreBtn) {
|
|
44
52
|
moreBtn.setAttribute("size", this.size);
|
|
45
53
|
}
|
|
@@ -53,6 +61,85 @@ let MenuItems = class MenuItems extends LitElement {
|
|
|
53
61
|
}
|
|
54
62
|
mainSlotChange() {
|
|
55
63
|
this.setChildrenSize(this.menuChildren);
|
|
64
|
+
this.updateIsScollable();
|
|
65
|
+
}
|
|
66
|
+
connectedCallback() {
|
|
67
|
+
this.observer = new ResizeObserver(this.updateIsScollable);
|
|
68
|
+
// observe if menu elements are overflowing and initiate scrollable
|
|
69
|
+
this.observer.observe(this);
|
|
70
|
+
super.connectedCallback();
|
|
71
|
+
}
|
|
72
|
+
disconnectedCallback() {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
75
|
+
super.disconnectedCallback();
|
|
76
|
+
}
|
|
77
|
+
initScrollable() {
|
|
78
|
+
const tabsMenu = this;
|
|
79
|
+
let isDown = false;
|
|
80
|
+
let startX;
|
|
81
|
+
let scrollLeft;
|
|
82
|
+
if (this.scrollable) {
|
|
83
|
+
tabsMenu.addEventListener("mousedown", (e) => {
|
|
84
|
+
isDown = true;
|
|
85
|
+
tabsMenu.classList.add("active");
|
|
86
|
+
startX = e.pageX - tabsMenu.offsetLeft;
|
|
87
|
+
scrollLeft = tabsMenu.scrollLeft;
|
|
88
|
+
});
|
|
89
|
+
tabsMenu.addEventListener("mouseleave", () => {
|
|
90
|
+
isDown = false;
|
|
91
|
+
tabsMenu.classList.remove("active");
|
|
92
|
+
});
|
|
93
|
+
tabsMenu.addEventListener("mouseup", () => {
|
|
94
|
+
isDown = false;
|
|
95
|
+
tabsMenu.classList.remove("active");
|
|
96
|
+
});
|
|
97
|
+
tabsMenu.addEventListener("mousemove", (e) => {
|
|
98
|
+
if (!isDown)
|
|
99
|
+
return;
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
const x = e.pageX - tabsMenu.offsetLeft;
|
|
102
|
+
const walk = (x - startX) * 1.5; //scroll-fast
|
|
103
|
+
tabsMenu.scrollLeft = scrollLeft - walk;
|
|
104
|
+
this.setScrollShadow(tabsMenu, this.direction);
|
|
105
|
+
});
|
|
106
|
+
tabsMenu.addEventListener("scroll", (e) => {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
// const delta = Math.sign(e.deltaY);
|
|
109
|
+
// tabsMenu.scrollLeft += delta * 50;
|
|
110
|
+
this.setScrollShadow(tabsMenu, this.direction);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
setScrollShadow(target, direction) {
|
|
115
|
+
if (direction == "row") {
|
|
116
|
+
if (target.scrollLeft > 0) {
|
|
117
|
+
this.classList.add("shadow-left");
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.classList.remove("shadow-left");
|
|
121
|
+
}
|
|
122
|
+
if (target.scrollLeft < target.scrollWidth - target.offsetWidth) {
|
|
123
|
+
this.classList.add("shadow-right");
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.classList.remove("shadow-right");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else if (direction == "column") {
|
|
130
|
+
if (target.scrollTop > 0) {
|
|
131
|
+
this.classList.add("shadow-top");
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
this.classList.remove("shadow-top");
|
|
135
|
+
}
|
|
136
|
+
if (target.scrollTop < target.scrollHeight - (target.offsetHeight + 1)) {
|
|
137
|
+
this.classList.add("shadow-bottom");
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.classList.remove("shadow-bottom");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
56
143
|
}
|
|
57
144
|
setChildrenSize(menuItems) {
|
|
58
145
|
menuItems.forEach((elt) => {
|
|
@@ -63,7 +150,7 @@ let MenuItems = class MenuItems extends LitElement {
|
|
|
63
150
|
elt.setAttribute("align", this.align);
|
|
64
151
|
}
|
|
65
152
|
if (this.direction == "row") {
|
|
66
|
-
if (elt.getAttribute(
|
|
153
|
+
if (elt.getAttribute("shape") == "block") {
|
|
67
154
|
elt.setAttribute("shape", "default");
|
|
68
155
|
}
|
|
69
156
|
}
|
|
@@ -73,34 +160,34 @@ let MenuItems = class MenuItems extends LitElement {
|
|
|
73
160
|
const menuStyles = {
|
|
74
161
|
minWidth: this.minWidth,
|
|
75
162
|
flexDirection: this.direction,
|
|
76
|
-
gap: this.gap
|
|
163
|
+
gap: this.gap,
|
|
77
164
|
};
|
|
78
165
|
const isMenuRow = this.direction == "row";
|
|
79
166
|
const popStyles = {
|
|
80
|
-
display:
|
|
81
|
-
alignSelf: isMenuRow ?
|
|
82
|
-
justifySelf:
|
|
83
|
-
flexDirection: this.direction
|
|
167
|
+
display: "block",
|
|
168
|
+
alignSelf: isMenuRow ? "center" : "flex-start",
|
|
169
|
+
justifySelf: "center",
|
|
170
|
+
flexDirection: this.direction,
|
|
84
171
|
};
|
|
85
172
|
const popBtnStyles = {
|
|
86
|
-
marginLeft: isMenuRow ?
|
|
173
|
+
marginLeft: isMenuRow ? "" : ".55em",
|
|
87
174
|
};
|
|
88
175
|
return html `<menu part="menu" class="shadowable" style=${styleMap(menuStyles)}>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
176
|
+
<slot @slotchange=${this.mainSlotChange}></slot>
|
|
177
|
+
<sonic-pop style=${styleMap(popStyles)} class=${!this.hasMoreElements ? "hidden" : ""}>
|
|
178
|
+
<sonic-menu-item style=${styleMap(popBtnStyles)} class="more-btn" shape=${this.moreShape} align="center">
|
|
179
|
+
<sonic-icon size="xl" name=${isMenuRow ? "more-vert" : "more-horiz"}></sonic-icon>
|
|
180
|
+
</sonic-menu-item>
|
|
181
|
+
<slot name="more" @slotchange=${this.checkIfMore} slot="content"></slot>
|
|
182
|
+
</sonic-pop>
|
|
183
|
+
</menu>`;
|
|
97
184
|
}
|
|
98
185
|
};
|
|
99
186
|
MenuItems.styles = [
|
|
100
187
|
css `
|
|
101
188
|
:host {
|
|
102
189
|
display: block;
|
|
103
|
-
--sc-menu-gap
|
|
190
|
+
--sc-menu-gap: 0.15rem;
|
|
104
191
|
}
|
|
105
192
|
|
|
106
193
|
:host > menu {
|
|
@@ -109,9 +196,9 @@ MenuItems.styles = [
|
|
|
109
196
|
margin: 0;
|
|
110
197
|
padding: 0.35em;
|
|
111
198
|
}
|
|
112
|
-
|
|
199
|
+
|
|
113
200
|
.hidden {
|
|
114
|
-
display:none !important;
|
|
201
|
+
display: none !important;
|
|
115
202
|
}
|
|
116
203
|
|
|
117
204
|
/*OMBRE*/
|
|
@@ -128,11 +215,79 @@ MenuItems.styles = [
|
|
|
128
215
|
:host([shadow="lg"]) .shadowable {
|
|
129
216
|
box-shadow: var(--sc-shadow-lg);
|
|
130
217
|
}
|
|
131
|
-
|
|
218
|
+
|
|
132
219
|
:host([shadow="none"]) .shadowable {
|
|
133
220
|
box-shadow: none;
|
|
134
221
|
}
|
|
135
|
-
|
|
222
|
+
|
|
223
|
+
/* SCROLLABLE*/
|
|
224
|
+
:host([scrollable]) {
|
|
225
|
+
scrollbar-width: none;
|
|
226
|
+
-ms-overflow-style: none;
|
|
227
|
+
}
|
|
228
|
+
:host([scrollable]) menu > * {
|
|
229
|
+
scroll-snap-align: start;
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
}
|
|
232
|
+
:host([scrollable][direction="row"]) {
|
|
233
|
+
overflow-x: scroll;
|
|
234
|
+
scroll-snap-type: x mandatory;
|
|
235
|
+
}
|
|
236
|
+
:host([scrollable][direction="column"]) {
|
|
237
|
+
overflow-y: scroll;
|
|
238
|
+
scroll-snap-type: y mandatory;
|
|
239
|
+
}
|
|
240
|
+
:host([scrollable])::-webkit-scrollbar {
|
|
241
|
+
display: none !important;
|
|
242
|
+
}
|
|
243
|
+
:host([scrollable][direction="row"].shadow-right) {
|
|
244
|
+
-webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
245
|
+
mask-image: linear-gradient(to left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
246
|
+
}
|
|
247
|
+
:host([scrollable][direction="row"].shadow-left) {
|
|
248
|
+
-webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
249
|
+
mask-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
250
|
+
}
|
|
251
|
+
:host([scrollable][direction="row"].shadow-left.shadow-right) {
|
|
252
|
+
-webkit-mask-image: linear-gradient(
|
|
253
|
+
to right,
|
|
254
|
+
rgba(0, 0, 0, 0) 0%,
|
|
255
|
+
rgba(0, 0, 0, 1) 10%,
|
|
256
|
+
rgba(0, 0, 0, 1) 90%,
|
|
257
|
+
rgba(0, 0, 0, 0) 100%
|
|
258
|
+
);
|
|
259
|
+
mask-image: linear-gradient(
|
|
260
|
+
to right,
|
|
261
|
+
rgba(0, 0, 0, 0) 0%,
|
|
262
|
+
rgba(0, 0, 0, 1) 10%,
|
|
263
|
+
rgba(0, 0, 0, 1) 90%,
|
|
264
|
+
rgba(0, 0, 0, 0) 100%
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
:host([scrollable][direction="column"].shadow-top) {
|
|
268
|
+
-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
269
|
+
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
270
|
+
}
|
|
271
|
+
:host([scrollable][direction="column"].shadow-bottom) {
|
|
272
|
+
-webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
273
|
+
mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
274
|
+
}
|
|
275
|
+
:host([scrollable][direction="column"].shadow-top.shadow-bottom) {
|
|
276
|
+
-webkit-mask-image: linear-gradient(
|
|
277
|
+
to top,
|
|
278
|
+
rgba(0, 0, 0, 0) 0%,
|
|
279
|
+
rgba(0, 0, 0, 1) 10%,
|
|
280
|
+
rgba(0, 0, 0, 1) 90%,
|
|
281
|
+
rgba(0, 0, 0, 0) 100%
|
|
282
|
+
);
|
|
283
|
+
mask-image: linear-gradient(
|
|
284
|
+
to bottom,
|
|
285
|
+
rgba(0, 0, 0, 0) 0%,
|
|
286
|
+
rgba(0, 0, 0, 1) 10%,
|
|
287
|
+
rgba(0, 0, 0, 1) 90%,
|
|
288
|
+
rgba(0, 0, 0, 0) 100%
|
|
289
|
+
);
|
|
290
|
+
}
|
|
136
291
|
`,
|
|
137
292
|
];
|
|
138
293
|
__decorate([
|
|
@@ -153,9 +308,15 @@ __decorate([
|
|
|
153
308
|
__decorate([
|
|
154
309
|
property({ type: String })
|
|
155
310
|
], MenuItems.prototype, "moreShape", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
property({ type: Boolean })
|
|
313
|
+
], MenuItems.prototype, "scrollable", void 0);
|
|
156
314
|
__decorate([
|
|
157
315
|
property({ type: String })
|
|
158
316
|
], MenuItems.prototype, "minWidth", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
query("menu")
|
|
319
|
+
], MenuItems.prototype, "menu", void 0);
|
|
159
320
|
__decorate([
|
|
160
321
|
queryAssignedElements({ selector: "sonic-menu-item" })
|
|
161
322
|
], MenuItems.prototype, "menuChildren", void 0);
|
|
@@ -169,8 +330,3 @@ MenuItems = __decorate([
|
|
|
169
330
|
customElement(tagName)
|
|
170
331
|
], MenuItems);
|
|
171
332
|
export { MenuItems };
|
|
172
|
-
//Ajout pour la creation du cem notamment pour Storybook
|
|
173
|
-
try {
|
|
174
|
-
customElements.define(tagName, MenuItems);
|
|
175
|
-
}
|
|
176
|
-
catch (e) { }
|
|
File without changes
|