@diniz/webcomponents 1.1.5 → 1.1.7
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 +563 -750
- package/dist/README.md +563 -750
- package/dist/button-demo-BcfxxPSq.js +227 -0
- package/dist/card-demo-Cxp-wRGW.js +230 -0
- package/dist/date-picker-demo-B8y3zapN.js +143 -0
- package/dist/form-demo-page-F1iLCgfh.js +351 -0
- package/dist/home-page-XUM8cHP7.js +468 -0
- package/dist/index-DiYekJaQ.js +2424 -0
- package/dist/layout-demo-CJsZ6DI5.js +289 -0
- package/dist/modal-demo-page-YN2KgJ31.js +195 -0
- package/dist/stepper-demo-page-BkcpKk_F.js +312 -0
- package/dist/table-demo-x2ZD8cFh.js +137 -0
- package/dist/tabs-demo-BQBtZzw9.js +76 -0
- package/dist/toast-demo-page-DLVacHXA.js +260 -0
- package/dist/webcomponents.es.js +31 -1883
- package/dist/webcomponents.umd.js +2537 -113
- package/package.json +1 -1
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { B as c } from "./index-DiYekJaQ.js";
|
|
2
|
+
const u = `<h1>🎨 Layout Component Demo</h1>
|
|
3
|
+
|
|
4
|
+
<div class="demo-intro">
|
|
5
|
+
<p>Create flexible page layouts with header, footer, sidebar, and content areas.</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="demo-section">
|
|
9
|
+
<h2>Basic Layout (Header + Content + Footer)</h2>
|
|
10
|
+
<div class="layout-example">
|
|
11
|
+
<ui-layout>
|
|
12
|
+
<ui-layout-header>
|
|
13
|
+
<div style="font-weight: 600;">Header</div>
|
|
14
|
+
<div style="font-size: 0.9rem; color: rgba(15, 23, 42, 0.6);">Navigation & Logo</div>
|
|
15
|
+
</ui-layout-header>
|
|
16
|
+
<ui-layout-content>
|
|
17
|
+
<div class="content-placeholder">Content Area</div>
|
|
18
|
+
</ui-layout-content>
|
|
19
|
+
<ui-layout-footer>
|
|
20
|
+
<div style="font-size: 0.9rem;">© 2026 Your Company</div>
|
|
21
|
+
</ui-layout-footer>
|
|
22
|
+
</ui-layout>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="demo-section">
|
|
27
|
+
<h2>Layout with Sidebar</h2>
|
|
28
|
+
<div class="layout-example">
|
|
29
|
+
<ui-layout direction="horizontal">
|
|
30
|
+
<ui-layout-sidebar collapsible width="220" collapsed-width="60">
|
|
31
|
+
<div class="sidebar-section">
|
|
32
|
+
<div class="sidebar-label">Menu</div>
|
|
33
|
+
<div class="sidebar-item">Dashboard</div>
|
|
34
|
+
<div class="sidebar-item">Users</div>
|
|
35
|
+
<div class="sidebar-item">Settings</div>
|
|
36
|
+
<div class="sidebar-item">Analytics</div>
|
|
37
|
+
</div>
|
|
38
|
+
</ui-layout-sidebar>
|
|
39
|
+
<ui-layout-content>
|
|
40
|
+
<div class="content-placeholder">Main Content</div>
|
|
41
|
+
</ui-layout-content>
|
|
42
|
+
</ui-layout>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="demo-section">
|
|
47
|
+
<h2>Full Layout (Header + Sidebar + Content + Footer)</h2>
|
|
48
|
+
<div class="layout-example full-height">
|
|
49
|
+
<ui-layout direction="vertical">
|
|
50
|
+
<ui-layout-header height="60">
|
|
51
|
+
<div style="font-weight: 600; font-size: 1.1rem;">App Header</div>
|
|
52
|
+
<div style="display: flex; gap: 1rem;">
|
|
53
|
+
<button style="padding: 0.5rem 1rem; background: var(--color-primary); color: white; border: none; border-radius: 6px; cursor: pointer;">Login</button>
|
|
54
|
+
</div>
|
|
55
|
+
</ui-layout-header>
|
|
56
|
+
|
|
57
|
+
<ui-layout direction="horizontal" style="flex: 1;">
|
|
58
|
+
<ui-layout-sidebar collapsible width="200" collapsed-width="60">
|
|
59
|
+
<div class="sidebar-section">
|
|
60
|
+
<div class="sidebar-item">📊 Dashboard</div>
|
|
61
|
+
<div class="sidebar-item">👥 Users</div>
|
|
62
|
+
<div class="sidebar-item">📝 Projects</div>
|
|
63
|
+
<div class="sidebar-item">⚙️ Settings</div>
|
|
64
|
+
</div>
|
|
65
|
+
</ui-layout-sidebar>
|
|
66
|
+
<ui-layout-content>
|
|
67
|
+
<div style="padding: 2rem;">
|
|
68
|
+
<h3>Welcome to the Dashboard</h3>
|
|
69
|
+
<p style="color: rgba(15, 23, 42, 0.6);">Try clicking the sidebar toggle button to collapse/expand the sidebar.</p>
|
|
70
|
+
<div style="margin-top: 2rem; padding: 1.5rem; background: var(--color-muted); border-radius: 8px;">
|
|
71
|
+
<p style="margin: 0; font-size: 0.95rem;">This is a full-featured layout with header, sidebar, content, and footer.</p>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</ui-layout-content>
|
|
75
|
+
</ui-layout>
|
|
76
|
+
|
|
77
|
+
<ui-layout-footer height="50">
|
|
78
|
+
<div style="font-size: 0.9rem;">© 2026 Dashboard App</div>
|
|
79
|
+
<div style="font-size: 0.85rem; color: rgba(15, 23, 42, 0.6);">v1.0.0</div>
|
|
80
|
+
</ui-layout-footer>
|
|
81
|
+
</ui-layout>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="demo-section">
|
|
86
|
+
<h2>Sidebar Collapse Event</h2>
|
|
87
|
+
<div class="demo-info">
|
|
88
|
+
<p>Listen to <code>collapsed-change</code> event to react to sidebar state changes.</p>
|
|
89
|
+
<div class="event-output" id="eventOutput">Click the sidebar toggle to see events...</div>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="layout-example" style="height: 300px;">
|
|
92
|
+
<ui-layout direction="horizontal">
|
|
93
|
+
<ui-layout-sidebar id="eventSidebar" collapsible width="220">
|
|
94
|
+
<div class="sidebar-item">Item 1</div>
|
|
95
|
+
<div class="sidebar-item">Item 2</div>
|
|
96
|
+
<div class="sidebar-item">Item 3</div>
|
|
97
|
+
</ui-layout-sidebar>
|
|
98
|
+
<ui-layout-content>
|
|
99
|
+
<div class="content-placeholder">Content</div>
|
|
100
|
+
</ui-layout-content>
|
|
101
|
+
</ui-layout>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
`, m = `
|
|
105
|
+
:host {
|
|
106
|
+
display: block;
|
|
107
|
+
color: var(--color-ink);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
h1 {
|
|
111
|
+
font-size: 2.2rem;
|
|
112
|
+
margin-bottom: 0.5rem;
|
|
113
|
+
font-weight: 700;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
h2 {
|
|
117
|
+
font-size: 1.4rem;
|
|
118
|
+
margin: 2rem 0 1rem;
|
|
119
|
+
font-weight: 600;
|
|
120
|
+
border-bottom: 2px solid var(--color-primary);
|
|
121
|
+
padding-bottom: 0.5rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
h3 {
|
|
125
|
+
font-size: 1.2rem;
|
|
126
|
+
margin: 0 0 0.75rem;
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
p {
|
|
131
|
+
line-height: 1.6;
|
|
132
|
+
color: rgba(15, 23, 42, 0.75);
|
|
133
|
+
margin: 0 0 1rem;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
code {
|
|
137
|
+
background: var(--color-muted);
|
|
138
|
+
padding: 0.2rem 0.5rem;
|
|
139
|
+
border-radius: 4px;
|
|
140
|
+
font-family: "Cascadia Mono", "Fira Code", monospace;
|
|
141
|
+
font-size: 0.9rem;
|
|
142
|
+
color: var(--color-primary);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.demo-intro {
|
|
146
|
+
background: linear-gradient(135deg, rgba(36, 236, 113, 0.08) 0%, rgba(52, 168, 235, 0.05) 100%);
|
|
147
|
+
padding: 1.5rem;
|
|
148
|
+
border-radius: 12px;
|
|
149
|
+
border-left: 4px solid var(--color-primary);
|
|
150
|
+
margin-bottom: 2rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.demo-section {
|
|
154
|
+
margin-bottom: 3rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.layout-example {
|
|
158
|
+
background: var(--color-surface);
|
|
159
|
+
border: 1px solid var(--color-border);
|
|
160
|
+
border-radius: 12px;
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
height: 400px;
|
|
163
|
+
box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
|
|
164
|
+
margin-top: 1rem;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.layout-example.full-height {
|
|
168
|
+
height: 550px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.content-placeholder {
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 100%;
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
background: var(--color-bg);
|
|
178
|
+
font-size: 1.1rem;
|
|
179
|
+
font-weight: 500;
|
|
180
|
+
color: rgba(15, 23, 42, 0.5);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.sidebar-label {
|
|
184
|
+
font-size: 0.75rem;
|
|
185
|
+
font-weight: 700;
|
|
186
|
+
text-transform: uppercase;
|
|
187
|
+
letter-spacing: 0.1em;
|
|
188
|
+
color: rgba(15, 23, 42, 0.5);
|
|
189
|
+
padding: 0.75rem 1rem 0.5rem;
|
|
190
|
+
margin-top: 0.5rem;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.sidebar-item {
|
|
194
|
+
padding: 0.75rem 1rem;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
transition: all 0.2s ease;
|
|
197
|
+
font-size: 0.95rem;
|
|
198
|
+
color: var(--color-ink);
|
|
199
|
+
user-select: none;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.sidebar-item:hover {
|
|
203
|
+
background: var(--color-muted);
|
|
204
|
+
color: var(--color-primary);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.sidebar-section {
|
|
208
|
+
padding: 0.5rem 0;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.demo-info {
|
|
212
|
+
background: var(--color-muted);
|
|
213
|
+
padding: 1.5rem;
|
|
214
|
+
border-radius: 8px;
|
|
215
|
+
margin-bottom: 1rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.event-output {
|
|
219
|
+
background: #0f172a;
|
|
220
|
+
color: #f8fafc;
|
|
221
|
+
padding: 1rem;
|
|
222
|
+
border-radius: 6px;
|
|
223
|
+
font-family: "Cascadia Mono", "Fira Code", monospace;
|
|
224
|
+
font-size: 0.85rem;
|
|
225
|
+
margin-top: 0.5rem;
|
|
226
|
+
line-height: 1.5;
|
|
227
|
+
max-height: 150px;
|
|
228
|
+
overflow-y: auto;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.event-output.empty {
|
|
232
|
+
opacity: 0.6;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* Custom scrollbar */
|
|
236
|
+
.event-output::-webkit-scrollbar {
|
|
237
|
+
width: 6px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.event-output::-webkit-scrollbar-track {
|
|
241
|
+
background: rgba(248, 250, 252, 0.1);
|
|
242
|
+
border-radius: 3px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.event-output::-webkit-scrollbar-thumb {
|
|
246
|
+
background: rgba(248, 250, 252, 0.3);
|
|
247
|
+
border-radius: 3px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.event-output::-webkit-scrollbar-thumb:hover {
|
|
251
|
+
background: rgba(248, 250, 252, 0.5);
|
|
252
|
+
}
|
|
253
|
+
`;
|
|
254
|
+
class p extends c {
|
|
255
|
+
async connectedCallback() {
|
|
256
|
+
super.connectedCallback(), await new Promise((t) => requestAnimationFrame(t)), await customElements.whenDefined("ui-layout-sidebar"), await new Promise((t) => setTimeout(t, 50)), this.setupEventListeners();
|
|
257
|
+
}
|
|
258
|
+
setupEventListeners() {
|
|
259
|
+
if (!this.shadowRoot) return;
|
|
260
|
+
const t = this.shadowRoot.querySelector(
|
|
261
|
+
"#eventSidebar"
|
|
262
|
+
);
|
|
263
|
+
if (t) {
|
|
264
|
+
const n = (a) => {
|
|
265
|
+
var i;
|
|
266
|
+
const r = a, e = this.shadowRoot.querySelector(
|
|
267
|
+
"#eventOutput"
|
|
268
|
+
);
|
|
269
|
+
if (e) {
|
|
270
|
+
const d = r.detail.collapsed, s = `[${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] Sidebar ${d ? "collapsed" : "expanded"}`, o = ((i = e.textContent) == null ? void 0 : i.split(`
|
|
271
|
+
`).filter((l) => l.trim())) || [];
|
|
272
|
+
o.length >= 5 && o.shift(), o.push(s), e.textContent = o.join(`
|
|
273
|
+
`), e.classList.remove("empty"), e.scrollTop = e.scrollHeight;
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
t.addEventListener("collapsed-change", n);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
render() {
|
|
280
|
+
this.shadowRoot.innerHTML = `
|
|
281
|
+
<style>${m}</style>
|
|
282
|
+
${u}
|
|
283
|
+
`;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
customElements.define("layout-demo", p);
|
|
287
|
+
export {
|
|
288
|
+
p as LayoutDemo
|
|
289
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { B as w } from "./index-DiYekJaQ.js";
|
|
2
|
+
const B = `
|
|
3
|
+
<div class="demo-container">
|
|
4
|
+
<h1>Modal Component Demo</h1>
|
|
5
|
+
<p>Interactive modals with various sizes and configurations.</p>
|
|
6
|
+
|
|
7
|
+
<div class="demo-section">
|
|
8
|
+
<h2>Basic Modals</h2>
|
|
9
|
+
<div class="demo-controls">
|
|
10
|
+
<ui-button id="openBasicModal" variant="primary" icon="maximize-2">
|
|
11
|
+
Open Basic Modal
|
|
12
|
+
</ui-button>
|
|
13
|
+
<ui-button id="openSmallModal" variant="secondary">
|
|
14
|
+
Small Modal
|
|
15
|
+
</ui-button>
|
|
16
|
+
<ui-button id="openLargeModal" variant="secondary">
|
|
17
|
+
Large Modal
|
|
18
|
+
</ui-button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="demo-section">
|
|
23
|
+
<h2>Modal Behaviors</h2>
|
|
24
|
+
<div class="demo-controls">
|
|
25
|
+
<ui-button id="openNoEscapeModal" variant="ghost">
|
|
26
|
+
No Close on Escape
|
|
27
|
+
</ui-button>
|
|
28
|
+
<ui-button id="openNoBackdropModal" variant="ghost">
|
|
29
|
+
No Close on Backdrop
|
|
30
|
+
</ui-button>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="demo-section">
|
|
35
|
+
<h2>Confirmation Modal</h2>
|
|
36
|
+
<div class="demo-controls">
|
|
37
|
+
<ui-button id="openConfirmModal" variant="primary" icon="alert-circle">
|
|
38
|
+
Delete Item
|
|
39
|
+
</ui-button>
|
|
40
|
+
</div>
|
|
41
|
+
<div id="confirmResult" class="result-display" style="display: none;">
|
|
42
|
+
<strong>Result:</strong> <span id="confirmText"></span>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<!-- Modals -->
|
|
47
|
+
<ui-modal id="basicModal" title="Welcome!" size="md">
|
|
48
|
+
<p>This is a basic modal with a title and content.</p>
|
|
49
|
+
<p>You can close it by:</p>
|
|
50
|
+
<ul>
|
|
51
|
+
<li>Clicking the X button</li>
|
|
52
|
+
<li>Pressing the Escape key</li>
|
|
53
|
+
<li>Clicking outside the modal</li>
|
|
54
|
+
</ul>
|
|
55
|
+
<div slot="footer">
|
|
56
|
+
<ui-button id="basicModalClose" variant="secondary">Close</ui-button>
|
|
57
|
+
<ui-button id="basicModalOk" variant="primary">Got it!</ui-button>
|
|
58
|
+
</div>
|
|
59
|
+
</ui-modal>
|
|
60
|
+
|
|
61
|
+
<ui-modal id="smallModal" title="Small Modal" size="sm">
|
|
62
|
+
<p>This is a small modal perfect for quick messages or confirmations.</p>
|
|
63
|
+
<div slot="footer">
|
|
64
|
+
<ui-button id="smallModalClose" variant="primary">Close</ui-button>
|
|
65
|
+
</div>
|
|
66
|
+
</ui-modal>
|
|
67
|
+
|
|
68
|
+
<ui-modal id="largeModal" title="Large Modal" size="lg">
|
|
69
|
+
<p>This is a large modal that can contain more content.</p>
|
|
70
|
+
<div style="height: 400px; background: #f1f5f9; border-radius: 8px; padding: 1rem; margin: 1rem 0;">
|
|
71
|
+
<p><strong>Scrollable Content Area</strong></p>
|
|
72
|
+
<p>When content exceeds the modal height, it automatically becomes scrollable.</p>
|
|
73
|
+
${Array(20).fill("<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>").join("")}
|
|
74
|
+
</div>
|
|
75
|
+
<div slot="footer">
|
|
76
|
+
<ui-button id="largeModalClose" variant="primary">Close</ui-button>
|
|
77
|
+
</div>
|
|
78
|
+
</ui-modal>
|
|
79
|
+
|
|
80
|
+
<ui-modal id="noEscapeModal" title="No Escape Close" size="md" no-close-on-escape>
|
|
81
|
+
<p>This modal cannot be closed by pressing the Escape key.</p>
|
|
82
|
+
<p>You must click the close button or click outside.</p>
|
|
83
|
+
<div slot="footer">
|
|
84
|
+
<ui-button id="noEscapeClose" variant="primary">Close</ui-button>
|
|
85
|
+
</div>
|
|
86
|
+
</ui-modal>
|
|
87
|
+
|
|
88
|
+
<ui-modal id="noBackdropModal" title="No Backdrop Close" size="md" no-close-on-backdrop>
|
|
89
|
+
<p>This modal cannot be closed by clicking the backdrop.</p>
|
|
90
|
+
<p>You must use the close button or press Escape.</p>
|
|
91
|
+
<div slot="footer">
|
|
92
|
+
<ui-button id="noBackdropClose" variant="primary">Close</ui-button>
|
|
93
|
+
</div>
|
|
94
|
+
</ui-modal>
|
|
95
|
+
|
|
96
|
+
<ui-modal id="confirmModal" title="Confirm Delete" size="sm">
|
|
97
|
+
<p>Are you sure you want to delete this item?</p>
|
|
98
|
+
<p style="color: #ef4444; font-size: 0.875rem;">This action cannot be undone.</p>
|
|
99
|
+
<div slot="footer">
|
|
100
|
+
<ui-button id="confirmCancel" variant="ghost">Cancel</ui-button>
|
|
101
|
+
<ui-button id="confirmDelete" variant="primary" icon="trash-2">Delete</ui-button>
|
|
102
|
+
</div>
|
|
103
|
+
</ui-modal>
|
|
104
|
+
</div>
|
|
105
|
+
`, C = `
|
|
106
|
+
.demo-container {
|
|
107
|
+
padding: 2rem;
|
|
108
|
+
max-width: 1200px;
|
|
109
|
+
margin: 0 auto;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.demo-container h1 {
|
|
113
|
+
font-size: 2rem;
|
|
114
|
+
margin-bottom: 0.5rem;
|
|
115
|
+
color: var(--color-ink);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.demo-container > p {
|
|
119
|
+
color: var(--color-text-muted);
|
|
120
|
+
margin-bottom: 2rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.demo-section {
|
|
124
|
+
margin-bottom: 3rem;
|
|
125
|
+
padding-bottom: 2rem;
|
|
126
|
+
border-bottom: 1px solid var(--color-border);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.demo-section:last-child {
|
|
130
|
+
border-bottom: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.demo-section h2 {
|
|
134
|
+
font-size: 1.5rem;
|
|
135
|
+
margin-bottom: 1rem;
|
|
136
|
+
color: var(--color-ink);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.demo-controls {
|
|
140
|
+
display: flex;
|
|
141
|
+
gap: 1rem;
|
|
142
|
+
flex-wrap: wrap;
|
|
143
|
+
margin-top: 1rem;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.result-display {
|
|
147
|
+
margin-top: 1rem;
|
|
148
|
+
padding: 1rem;
|
|
149
|
+
background: var(--color-muted);
|
|
150
|
+
border-radius: var(--radius-md);
|
|
151
|
+
border-left: 4px solid var(--color-primary);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
ul {
|
|
155
|
+
margin: 1rem 0;
|
|
156
|
+
padding-left: 1.5rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
li {
|
|
160
|
+
margin: 0.5rem 0;
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
163
|
+
class R extends w {
|
|
164
|
+
async connectedCallback() {
|
|
165
|
+
super.connectedCallback(), await Promise.all([
|
|
166
|
+
customElements.whenDefined("ui-modal"),
|
|
167
|
+
customElements.whenDefined("ui-button")
|
|
168
|
+
]), await new Promise((a) => setTimeout(a, 10)), this.setupEventListeners();
|
|
169
|
+
}
|
|
170
|
+
setupEventListeners() {
|
|
171
|
+
const a = this.shadowRoot.getElementById("openBasicModal"), o = this.shadowRoot.getElementById("basicModal"), r = this.shadowRoot.getElementById("basicModalClose"), c = this.shadowRoot.getElementById("basicModalOk");
|
|
172
|
+
a == null || a.addEventListener("click", () => o == null ? void 0 : o.open()), r == null || r.addEventListener("click", () => o == null ? void 0 : o.close()), c == null || c.addEventListener("click", () => o == null ? void 0 : o.close());
|
|
173
|
+
const m = this.shadowRoot.getElementById("openSmallModal"), e = this.shadowRoot.getElementById("smallModal"), u = this.shadowRoot.getElementById("smallModalClose");
|
|
174
|
+
m == null || m.addEventListener("click", () => e == null ? void 0 : e.open()), u == null || u.addEventListener("click", () => e == null ? void 0 : e.close());
|
|
175
|
+
const p = this.shadowRoot.getElementById("openLargeModal"), i = this.shadowRoot.getElementById("largeModal"), h = this.shadowRoot.getElementById("largeModalClose");
|
|
176
|
+
p == null || p.addEventListener("click", () => i == null ? void 0 : i.open()), h == null || h.addEventListener("click", () => i == null ? void 0 : i.close());
|
|
177
|
+
const v = this.shadowRoot.getElementById("openNoEscapeModal"), n = this.shadowRoot.getElementById("noEscapeModal"), g = this.shadowRoot.getElementById("noEscapeClose");
|
|
178
|
+
v == null || v.addEventListener("click", () => n == null ? void 0 : n.open()), g == null || g.addEventListener("click", () => n == null ? void 0 : n.close());
|
|
179
|
+
const b = this.shadowRoot.getElementById("openNoBackdropModal"), s = this.shadowRoot.getElementById("noBackdropModal"), y = this.shadowRoot.getElementById("noBackdropClose");
|
|
180
|
+
b == null || b.addEventListener("click", () => s == null ? void 0 : s.open()), y == null || y.addEventListener("click", () => s == null ? void 0 : s.close());
|
|
181
|
+
const E = this.shadowRoot.getElementById("openConfirmModal"), t = this.shadowRoot.getElementById("confirmModal"), f = this.shadowRoot.getElementById("confirmCancel"), k = this.shadowRoot.getElementById("confirmDelete"), l = this.shadowRoot.getElementById("confirmResult"), d = this.shadowRoot.getElementById("confirmText");
|
|
182
|
+
E == null || E.addEventListener("click", () => t == null ? void 0 : t.open()), f == null || f.addEventListener("click", () => {
|
|
183
|
+
t == null || t.close(), l && d && (l.style.display = "block", d.textContent = "Cancelled", d.style.color = "#64748b");
|
|
184
|
+
}), k == null || k.addEventListener("click", () => {
|
|
185
|
+
t == null || t.close(), l && d && (l.style.display = "block", d.textContent = "Item deleted!", d.style.color = "#ef4444");
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
render() {
|
|
189
|
+
this.shadowRoot.innerHTML = `
|
|
190
|
+
<style>${C}</style>
|
|
191
|
+
${B}
|
|
192
|
+
`;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
customElements.define("modal-demo-page", R);
|