@sondor-technology/sondor-components 1.0.1-develop.13 → 1.0.1-develop.14
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/dist/components/alert/alert.constants.d.ts +3 -0
- package/dist/components/alert/alert.constants.d.ts.map +1 -0
- package/dist/components/alert/alert.constants.js +2 -0
- package/dist/components/alert/alert.constants.js.map +1 -0
- package/dist/components/alert/alert.d.ts +4 -3
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +21 -11
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/badge/badge.constants.d.ts +3 -0
- package/dist/components/badge/badge.constants.d.ts.map +1 -0
- package/dist/components/badge/badge.constants.js +2 -0
- package/dist/components/badge/badge.constants.js.map +1 -0
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +3 -2
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/button/button.constants.d.ts +7 -0
- package/dist/components/button/button.constants.d.ts.map +1 -0
- package/dist/components/button/button.constants.js +4 -0
- package/dist/components/button/button.constants.js.map +1 -0
- package/dist/components/button/button.d.ts +8 -4
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +181 -137
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +1 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/button-group.js +17 -21
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/checkbox/checkbox.constants.d.ts +3 -0
- package/dist/components/checkbox/checkbox.constants.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.constants.js +2 -0
- package/dist/components/checkbox/checkbox.constants.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +5 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +21 -5
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +7 -7
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +130 -66
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/content-card/content-card.d.ts.map +1 -1
- package/dist/components/content-card/content-card.js +10 -15
- package/dist/components/content-card/content-card.js.map +1 -0
- package/dist/components/divider/divider.constants.d.ts +5 -0
- package/dist/components/divider/divider.constants.d.ts.map +1 -0
- package/dist/components/divider/divider.constants.js +3 -0
- package/dist/components/divider/divider.constants.js.map +1 -0
- package/dist/components/divider/divider.d.ts +4 -2
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/divider.js +18 -9
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +7 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +73 -30
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/field/field.d.ts +2 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +8 -9
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/footer/footer.d.ts +8 -1
- package/dist/components/footer/footer.d.ts.map +1 -1
- package/dist/components/footer/footer.js +42 -12
- package/dist/components/footer/footer.js.map +1 -0
- package/dist/components/form/form-step.js +1 -0
- package/dist/components/form/form-step.js.map +1 -0
- package/dist/components/form/form.d.ts +3 -0
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +109 -69
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/grid/grid-row.d.ts +3 -3
- package/dist/components/grid/grid-row.d.ts.map +1 -1
- package/dist/components/grid/grid-row.js +36 -22
- package/dist/components/grid/grid-row.js.map +1 -0
- package/dist/components/grid/grid.d.ts +2 -2
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +5 -2
- package/dist/components/grid/grid.js.map +1 -0
- package/dist/components/icon/icon-paths.d.ts +161 -86
- package/dist/components/icon/icon-paths.d.ts.map +1 -1
- package/dist/components/icon/icon-paths.js +176 -106
- package/dist/components/icon/icon-paths.js.map +1 -0
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +6 -5
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +30 -37
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/link/link.d.ts +6 -6
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/link/link.js +42 -19
- package/dist/components/link/link.js.map +1 -0
- package/dist/components/metadata/metadata.d.ts +3 -3
- package/dist/components/metadata/metadata.d.ts.map +1 -1
- package/dist/components/metadata/metadata.js +23 -20
- package/dist/components/metadata/metadata.js.map +1 -0
- package/dist/components/modal/modal.d.ts +4 -16
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +99 -62
- package/dist/components/modal/modal.js.map +1 -0
- package/dist/components/page-layout/page-layout.d.ts +4 -3
- package/dist/components/page-layout/page-layout.d.ts.map +1 -1
- package/dist/components/page-layout/page-layout.js +95 -68
- package/dist/components/page-layout/page-layout.js.map +1 -0
- package/dist/components/radio/radio.d.ts +8 -0
- package/dist/components/radio/radio.d.ts.map +1 -1
- package/dist/components/radio/radio.js +8 -12
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +6 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +44 -18
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/router/router.d.ts +5 -7
- package/dist/components/router/router.d.ts.map +1 -1
- package/dist/components/router/router.js +54 -38
- package/dist/components/router/router.js.map +1 -0
- package/dist/components/select/select.d.ts +1 -3
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +14 -5
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +3 -2
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +10 -13
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/switch/switch.d.ts +12 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +28 -22
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/table/data-table.d.ts +3 -25
- package/dist/components/table/data-table.d.ts.map +1 -1
- package/dist/components/table/data-table.js +211 -146
- package/dist/components/table/data-table.js.map +1 -0
- package/dist/components/table/table.d.ts +3 -3
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +39 -20
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/tab-panel.d.ts +3 -1
- package/dist/components/tabs/tab-panel.d.ts.map +1 -1
- package/dist/components/tabs/tab-panel.js +21 -11
- package/dist/components/tabs/tab-panel.js.map +1 -0
- package/dist/components/tabs/tab.d.ts +5 -1
- package/dist/components/tabs/tab.d.ts.map +1 -1
- package/dist/components/tabs/tab.js +46 -28
- package/dist/components/tabs/tab.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +4 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +76 -13
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +13 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/textarea/textarea.js +59 -13
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.constants.d.ts +3 -0
- package/dist/components/theme-toggle/theme-toggle.constants.d.ts.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.constants.js +2 -0
- package/dist/components/theme-toggle/theme-toggle.constants.js.map +1 -0
- package/dist/components/theme-toggle/theme-toggle.d.ts +3 -2
- package/dist/components/theme-toggle/theme-toggle.d.ts.map +1 -1
- package/dist/components/theme-toggle/theme-toggle.js +46 -19
- package/dist/components/theme-toggle/theme-toggle.js.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-group.d.ts +5 -2
- package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-group.js +50 -14
- package/dist/components/vertical-nav/vertical-nav-group.js.map +1 -0
- package/dist/components/vertical-nav/vertical-nav-item.d.ts +3 -2
- package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -1
- package/dist/components/vertical-nav/vertical-nav-item.js +30 -8
- package/dist/components/vertical-nav/vertical-nav-item.js.map +1 -0
- package/dist/styles/index.css +48 -17
- package/dist/styles/reset.js +1 -0
- package/dist/styles/reset.js.map +1 -0
- package/package.json +2 -1
- package/src/components/alert/alert.constants.ts +2 -0
- package/src/components/alert/alert.ts +24 -15
- package/src/components/badge/badge.constants.ts +2 -0
- package/src/components/badge/badge.ts +3 -4
- package/src/components/breadcrumb/breadcrumb.ts +2 -2
- package/src/components/button/button.constants.ts +8 -0
- package/src/components/button/button.ts +184 -144
- package/src/components/button-group/button-group.ts +18 -22
- package/src/components/checkbox/checkbox.constants.ts +2 -0
- package/src/components/checkbox/checkbox.ts +33 -18
- package/src/components/code-block/code-block.ts +151 -84
- package/src/components/content-card/content-card.ts +10 -16
- package/src/components/divider/divider.constants.ts +5 -0
- package/src/components/divider/divider.ts +22 -11
- package/src/components/drawer/drawer.ts +79 -34
- package/src/components/field/field.ts +9 -11
- package/src/components/footer/footer.ts +43 -12
- package/src/components/form/form.ts +121 -84
- package/src/components/grid/grid-row.ts +45 -32
- package/src/components/grid/grid.ts +7 -4
- package/src/components/icon/icon-paths.ts +175 -106
- package/src/components/icon/icon.ts +6 -6
- package/src/components/input/input.ts +32 -42
- package/src/components/link/link.ts +45 -21
- package/src/components/metadata/metadata.ts +26 -24
- package/src/components/modal/modal.ts +108 -74
- package/src/components/page-layout/page-layout.ts +97 -72
- package/src/components/radio/radio.ts +8 -13
- package/src/components/radio-group/radio-group.ts +45 -21
- package/src/components/router/router.ts +73 -50
- package/src/components/select/select.ts +18 -19
- package/src/components/skeleton/skeleton.ts +14 -14
- package/src/components/switch/switch.ts +31 -25
- package/src/components/table/data-table.ts +248 -177
- package/src/components/table/table.ts +52 -29
- package/src/components/tabs/tab-panel.ts +25 -13
- package/src/components/tabs/tab.ts +58 -33
- package/src/components/tabs/tabs.ts +77 -15
- package/src/components/textarea/textarea.ts +63 -15
- package/src/components/theme-toggle/theme-toggle.constants.ts +2 -0
- package/src/components/theme-toggle/theme-toggle.ts +47 -22
- package/src/components/vertical-nav/vertical-nav-group.ts +57 -18
- package/src/components/vertical-nav/vertical-nav-item.ts +35 -12
- package/src/styles/globals.css +27 -4
- package/src/styles/theme.css +38 -32
- package/tsconfig.json +2 -1
- package/dist/components/card/card.d.ts +0 -11
- package/dist/components/card/card.d.ts.map +0 -1
- package/dist/components/card/card.js +0 -54
- package/src/components/card/card.ts +0 -53
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {LitElement, html, css, PropertyValues, nothing} from "lit";
|
|
2
|
+
import {customElement, property, query} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
4
|
|
|
5
|
-
@customElement(
|
|
5
|
+
@customElement("st-modal")
|
|
6
6
|
export class StModal extends LitElement {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@property({
|
|
7
|
+
@property({type: Boolean, reflect: true}) open = false;
|
|
8
|
+
@property({type: String}) heading = "";
|
|
9
|
+
@property({type: String}) size: "sm" | "md" | "lg" | "xl" | "xxl" = "md";
|
|
10
|
+
@property({type: Boolean}) static = false;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
* Title text displayed in the modal header.
|
|
14
|
-
*/
|
|
15
|
-
@property({ type: String }) heading = '';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Size of the modal (sm, md, lg, xl, xxl).
|
|
19
|
-
*/
|
|
20
|
-
@property({ type: String }) size: 'sm' | 'md' | 'lg' | 'xl' | 'xxl' = 'md';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* If true, the modal cannot be closed by clicking the backdrop or pressing Esc.
|
|
24
|
-
*/
|
|
25
|
-
@property({ type: Boolean }) static = false;
|
|
26
|
-
|
|
27
|
-
@query('dialog') private dialogEl!: HTMLDialogElement;
|
|
12
|
+
@query("dialog") private dialogEl!: HTMLDialogElement;
|
|
28
13
|
|
|
29
14
|
private isClosing = false;
|
|
30
15
|
|
|
@@ -41,43 +26,72 @@ export class StModal extends LitElement {
|
|
|
41
26
|
border-radius: var(--st-radius-lg, 0.5rem);
|
|
42
27
|
background-color: var(--st-color-surface);
|
|
43
28
|
color: var(--st-color-text);
|
|
44
|
-
|
|
45
|
-
/* Responsive width calculation */
|
|
29
|
+
|
|
46
30
|
width: calc(100% - 2rem);
|
|
47
31
|
margin: auto;
|
|
48
|
-
|
|
49
|
-
box-shadow:
|
|
32
|
+
|
|
33
|
+
box-shadow:
|
|
34
|
+
0 20px 25px -5px rgb(0 0 0 / 0.1),
|
|
35
|
+
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
50
36
|
font-family: var(--st-font-family, inherit);
|
|
51
37
|
}
|
|
52
38
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
dialog.size-
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
dialog.size-sm {
|
|
40
|
+
max-width: 400px;
|
|
41
|
+
}
|
|
42
|
+
dialog.size-md {
|
|
43
|
+
max-width: 500px;
|
|
44
|
+
}
|
|
45
|
+
dialog.size-lg {
|
|
46
|
+
max-width: 800px;
|
|
47
|
+
}
|
|
48
|
+
dialog.size-xl {
|
|
49
|
+
max-width: 1024px;
|
|
50
|
+
}
|
|
51
|
+
dialog.size-xxl {
|
|
52
|
+
max-width: 1280px;
|
|
53
|
+
}
|
|
59
54
|
|
|
60
55
|
dialog::backdrop {
|
|
61
56
|
background-color: rgba(0, 0, 0, 0.5);
|
|
62
57
|
backdrop-filter: blur(2px);
|
|
63
58
|
}
|
|
64
59
|
|
|
65
|
-
/* Animations */
|
|
66
60
|
@keyframes fade-in {
|
|
67
|
-
from {
|
|
68
|
-
|
|
61
|
+
from {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
}
|
|
64
|
+
to {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
}
|
|
69
67
|
}
|
|
70
68
|
@keyframes fade-out {
|
|
71
|
-
from {
|
|
72
|
-
|
|
69
|
+
from {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
72
|
+
to {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
}
|
|
73
75
|
}
|
|
74
76
|
@keyframes slide-up {
|
|
75
|
-
from {
|
|
76
|
-
|
|
77
|
+
from {
|
|
78
|
+
opacity: 0;
|
|
79
|
+
transform: translateY(20px) scale(0.95);
|
|
80
|
+
}
|
|
81
|
+
to {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
transform: translateY(0) scale(1);
|
|
84
|
+
}
|
|
77
85
|
}
|
|
78
86
|
@keyframes slide-down {
|
|
79
|
-
from {
|
|
80
|
-
|
|
87
|
+
from {
|
|
88
|
+
opacity: 1;
|
|
89
|
+
transform: translateY(0) scale(1);
|
|
90
|
+
}
|
|
91
|
+
to {
|
|
92
|
+
opacity: 0;
|
|
93
|
+
transform: translateY(20px) scale(0.95);
|
|
94
|
+
}
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
dialog[open] {
|
|
@@ -86,7 +100,7 @@ export class StModal extends LitElement {
|
|
|
86
100
|
dialog[open]::backdrop {
|
|
87
101
|
animation: fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
88
102
|
}
|
|
89
|
-
|
|
103
|
+
|
|
90
104
|
dialog.closing {
|
|
91
105
|
animation: slide-down 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
92
106
|
}
|
|
@@ -118,7 +132,9 @@ export class StModal extends LitElement {
|
|
|
118
132
|
align-items: center;
|
|
119
133
|
justify-content: center;
|
|
120
134
|
border-radius: var(--st-radius-sm);
|
|
121
|
-
transition:
|
|
135
|
+
transition:
|
|
136
|
+
color 0.2s,
|
|
137
|
+
background-color 0.2s;
|
|
122
138
|
}
|
|
123
139
|
|
|
124
140
|
.close-btn:hover {
|
|
@@ -141,13 +157,16 @@ export class StModal extends LitElement {
|
|
|
141
157
|
border-top: 1px solid var(--st-color-border);
|
|
142
158
|
background-color: var(--st-color-surface-muted, #f8fafc);
|
|
143
159
|
}
|
|
144
|
-
|
|
160
|
+
`,
|
|
145
161
|
];
|
|
146
162
|
|
|
147
|
-
|
|
148
|
-
|
|
163
|
+
// 🚀 FIX: Typed strictly and calls super
|
|
164
|
+
override updated(changedProperties: PropertyValues<this>) {
|
|
165
|
+
super.updated(changedProperties);
|
|
166
|
+
|
|
167
|
+
if (changedProperties.has("open")) {
|
|
149
168
|
if (this.open) {
|
|
150
|
-
this.dialogEl.classList.remove(
|
|
169
|
+
this.dialogEl.classList.remove("closing");
|
|
151
170
|
this.isClosing = false;
|
|
152
171
|
if (!this.dialogEl.open) {
|
|
153
172
|
this.dialogEl.showModal();
|
|
@@ -161,27 +180,27 @@ export class StModal extends LitElement {
|
|
|
161
180
|
private closeWithAnimation() {
|
|
162
181
|
if (this.isClosing) return;
|
|
163
182
|
this.isClosing = true;
|
|
164
|
-
this.dialogEl.classList.add(
|
|
165
|
-
|
|
183
|
+
this.dialogEl.classList.add("closing");
|
|
184
|
+
|
|
166
185
|
const onAnimationEnd = () => {
|
|
167
|
-
this.dialogEl.
|
|
168
|
-
this.dialogEl.classList.remove('closing');
|
|
186
|
+
this.dialogEl.classList.remove("closing");
|
|
169
187
|
this.isClosing = false;
|
|
170
188
|
if (!this.open) {
|
|
171
189
|
this.dialogEl.close();
|
|
172
190
|
}
|
|
173
191
|
};
|
|
174
|
-
|
|
175
|
-
|
|
192
|
+
|
|
193
|
+
// 🚀 FIX: Prevent listener stacking on rapid toggles
|
|
194
|
+
this.dialogEl.addEventListener("animationend", onAnimationEnd, {once: true});
|
|
176
195
|
}
|
|
177
196
|
|
|
178
197
|
private handleClose() {
|
|
179
198
|
this.open = false;
|
|
180
|
-
this.dispatchEvent(new CustomEvent(
|
|
199
|
+
this.dispatchEvent(new CustomEvent("st-close", {bubbles: true, composed: true}));
|
|
181
200
|
}
|
|
182
201
|
|
|
183
202
|
private handleCancel(e: Event) {
|
|
184
|
-
e.preventDefault();
|
|
203
|
+
e.preventDefault();
|
|
185
204
|
if (!this.static) {
|
|
186
205
|
this.handleClose();
|
|
187
206
|
}
|
|
@@ -190,7 +209,7 @@ export class StModal extends LitElement {
|
|
|
190
209
|
private onDialogClose() {
|
|
191
210
|
if (this.open) {
|
|
192
211
|
this.open = false;
|
|
193
|
-
this.dispatchEvent(new CustomEvent(
|
|
212
|
+
this.dispatchEvent(new CustomEvent("st-close", {bubbles: true, composed: true}));
|
|
194
213
|
}
|
|
195
214
|
}
|
|
196
215
|
|
|
@@ -198,7 +217,7 @@ export class StModal extends LitElement {
|
|
|
198
217
|
if (this.static) return;
|
|
199
218
|
|
|
200
219
|
const rect = this.dialogEl.getBoundingClientRect();
|
|
201
|
-
const clickedOutside =
|
|
220
|
+
const clickedOutside =
|
|
202
221
|
e.clientX < rect.left ||
|
|
203
222
|
e.clientX > rect.right ||
|
|
204
223
|
e.clientY < rect.top ||
|
|
@@ -211,28 +230,43 @@ export class StModal extends LitElement {
|
|
|
211
230
|
|
|
212
231
|
render() {
|
|
213
232
|
return html`
|
|
214
|
-
<dialog
|
|
233
|
+
<dialog
|
|
215
234
|
class="size-${this.size}"
|
|
216
|
-
aria-labelledby=${this.heading ?
|
|
217
|
-
@cancel=${this.handleCancel}
|
|
218
|
-
@click=${this.handleBackdropClick}
|
|
235
|
+
aria-labelledby=${this.heading ? "modal-heading" : nothing}
|
|
236
|
+
@cancel=${this.handleCancel}
|
|
237
|
+
@click=${this.handleBackdropClick}
|
|
219
238
|
@close=${this.onDialogClose}
|
|
220
239
|
>
|
|
221
|
-
|
|
240
|
+
<!-- 🚀 FIX: Removed @click=stopPropagation from all inner wrappers -->
|
|
241
|
+
<div class="modal-header">
|
|
222
242
|
<slot name="header">
|
|
223
243
|
<h3 class="modal-title" id="modal-heading">${this.heading}</h3>
|
|
224
244
|
</slot>
|
|
225
|
-
|
|
226
|
-
${!this.static
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
245
|
+
|
|
246
|
+
${!this.static
|
|
247
|
+
? html`
|
|
248
|
+
<button class="close-btn" @click=${this.handleClose} aria-label="Close modal">
|
|
249
|
+
<svg
|
|
250
|
+
width="18"
|
|
251
|
+
height="18"
|
|
252
|
+
viewBox="0 0 24 24"
|
|
253
|
+
fill="none"
|
|
254
|
+
stroke="currentColor"
|
|
255
|
+
stroke-width="2"
|
|
256
|
+
stroke-linecap="round"
|
|
257
|
+
stroke-linejoin="round"
|
|
258
|
+
>
|
|
259
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
260
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
261
|
+
</svg>
|
|
262
|
+
</button>
|
|
263
|
+
`
|
|
264
|
+
: nothing}
|
|
231
265
|
</div>
|
|
232
|
-
<div class="modal-body"
|
|
266
|
+
<div class="modal-body">
|
|
233
267
|
<slot></slot>
|
|
234
268
|
</div>
|
|
235
|
-
<div class="modal-footer"
|
|
269
|
+
<div class="modal-footer">
|
|
236
270
|
<slot name="footer"></slot>
|
|
237
271
|
</div>
|
|
238
272
|
</dialog>
|
|
@@ -242,6 +276,6 @@ export class StModal extends LitElement {
|
|
|
242
276
|
|
|
243
277
|
declare global {
|
|
244
278
|
interface HTMLElementTagNameMap {
|
|
245
|
-
|
|
279
|
+
"st-modal": StModal;
|
|
246
280
|
}
|
|
247
|
-
}
|
|
281
|
+
}
|