@waggylabs/yumekit 0.2.0
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/y-appbar.d.ts +28 -0
- package/dist/components/y-appbar.js +1707 -0
- package/dist/components/y-avatar.d.ts +5 -0
- package/dist/components/y-avatar.js +108 -0
- package/dist/components/y-badge.d.ts +15 -0
- package/dist/components/y-badge.js +149 -0
- package/dist/components/y-button.d.ts +19 -0
- package/dist/components/y-button.js +557 -0
- package/dist/components/y-card.d.ts +8 -0
- package/dist/components/y-card.js +157 -0
- package/dist/components/y-checkbox.d.ts +20 -0
- package/dist/components/y-checkbox.js +256 -0
- package/dist/components/y-dialog.d.ts +18 -0
- package/dist/components/y-dialog.js +232 -0
- package/dist/components/y-drawer.d.ts +1 -0
- package/dist/components/y-drawer.js +459 -0
- package/dist/components/y-icon.d.ts +19 -0
- package/dist/components/y-icon.js +270 -0
- package/dist/components/y-input.d.ts +15 -0
- package/dist/components/y-input.js +233 -0
- package/dist/components/y-menu.d.ts +26 -0
- package/dist/components/y-menu.js +322 -0
- package/dist/components/y-panel.d.ts +23 -0
- package/dist/components/y-panel.js +366 -0
- package/dist/components/y-panelbar.d.ts +3 -0
- package/dist/components/y-panelbar.js +27 -0
- package/dist/components/y-progress.d.ts +38 -0
- package/dist/components/y-progress.js +328 -0
- package/dist/components/y-radio.d.ts +16 -0
- package/dist/components/y-radio.js +202 -0
- package/dist/components/y-select.d.ts +33 -0
- package/dist/components/y-select.js +524 -0
- package/dist/components/y-slider.d.ts +34 -0
- package/dist/components/y-slider.js +387 -0
- package/dist/components/y-switch.d.ts +24 -0
- package/dist/components/y-switch.js +373 -0
- package/dist/components/y-table.d.ts +25 -0
- package/dist/components/y-table.js +327 -0
- package/dist/components/y-tabs.d.ts +21 -0
- package/dist/components/y-tabs.js +286 -0
- package/dist/components/y-tag.d.ts +7 -0
- package/dist/components/y-tag.js +218 -0
- package/dist/components/y-theme.d.ts +10 -0
- package/dist/components/y-theme.js +115 -0
- package/dist/components/y-toast.d.ts +33 -0
- package/dist/components/y-toast.js +248 -0
- package/dist/components/y-tooltip.d.ts +25 -0
- package/dist/components/y-tooltip.js +228 -0
- package/dist/icons/all.d.ts +1 -0
- package/dist/icons/all.js +208 -0
- package/dist/icons/index.d.ts +19 -0
- package/dist/icons/registry.d.ts +3 -0
- package/dist/icons/registry.js +30 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.iife.d.ts +1 -0
- package/dist/index.js +7137 -0
- package/dist/modules/helpers.d.ts +44 -0
- package/dist/modules/helpers.js +124 -0
- package/dist/react.d.ts +214 -0
- package/dist/styles/blue-dark.css +138 -0
- package/dist/styles/blue-light.css +138 -0
- package/dist/styles/orange-dark.css +138 -0
- package/dist/styles/orange-light.css +138 -0
- package/dist/styles/style.css +8 -0
- package/dist/styles/variables.css +594 -0
- package/dist/yumekit.min.js +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
/* ================================================================== */
|
|
2
|
+
/* Centralized SVG icon strings for the YumeKit component library. */
|
|
3
|
+
/* */
|
|
4
|
+
/* Each static icon also lives in its own .svg file in this directory */
|
|
5
|
+
/* so it can be used standalone (e.g. <img src="…">, CSS background, */
|
|
6
|
+
/* design tools, etc.). The strings below mirror those files — keep */
|
|
7
|
+
/* them in sync when editing an icon. */
|
|
8
|
+
/* ================================================================== */
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/* ── Dynamic icons (parameterised — kept as functions) ────────────── */
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 3-dot grip handle for drawers.
|
|
15
|
+
* @param {boolean} horizontal – true for left/right drawers, false for top/bottom.
|
|
16
|
+
*/
|
|
17
|
+
function gripDots(horizontal) {
|
|
18
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${horizontal ? 4 : 20}" height="${horizontal ? 20 : 4}" viewBox="0 0 ${horizontal ? 4 : 20} ${horizontal ? 20 : 4}" fill="currentColor">
|
|
19
|
+
${
|
|
20
|
+
horizontal
|
|
21
|
+
? `<circle cx="2" cy="4" r="1.5"/>
|
|
22
|
+
<circle cx="2" cy="10" r="1.5"/>
|
|
23
|
+
<circle cx="2" cy="16" r="1.5"/>`
|
|
24
|
+
: `<circle cx="4" cy="2" r="1.5"/>
|
|
25
|
+
<circle cx="10" cy="2" r="1.5"/>
|
|
26
|
+
<circle cx="16" cy="2" r="1.5"/>`
|
|
27
|
+
}
|
|
28
|
+
</svg>`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
class YumeDrawer extends HTMLElement {
|
|
32
|
+
static get observedAttributes() {
|
|
33
|
+
return ["visible", "anchor", "position", "resizable"];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
constructor() {
|
|
37
|
+
super();
|
|
38
|
+
this.attachShadow({ mode: "open" });
|
|
39
|
+
this._onAnchorClick = this._onAnchorClick.bind(this);
|
|
40
|
+
this._onKeyDown = this._onKeyDown.bind(this);
|
|
41
|
+
this._onResizePointerDown = this._onResizePointerDown.bind(this);
|
|
42
|
+
this._onResizePointerMove = this._onResizePointerMove.bind(this);
|
|
43
|
+
this._onResizePointerUp = this._onResizePointerUp.bind(this);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
this.render();
|
|
48
|
+
this._setupAnchor();
|
|
49
|
+
if (this.visible) this._show();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
this._teardownAnchor();
|
|
54
|
+
document.removeEventListener("keydown", this._onKeyDown);
|
|
55
|
+
this._cleanupResize();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
59
|
+
if (oldVal === newVal) return;
|
|
60
|
+
if (name === "visible") {
|
|
61
|
+
this.visible ? this._show() : this._hide();
|
|
62
|
+
}
|
|
63
|
+
if (name === "anchor") {
|
|
64
|
+
this._teardownAnchor();
|
|
65
|
+
this._setupAnchor();
|
|
66
|
+
}
|
|
67
|
+
if (name === "position") {
|
|
68
|
+
this._applyPosition();
|
|
69
|
+
}
|
|
70
|
+
if (name === "resizable") {
|
|
71
|
+
this._applyResizable();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get visible() {
|
|
76
|
+
return this.hasAttribute("visible");
|
|
77
|
+
}
|
|
78
|
+
set visible(val) {
|
|
79
|
+
if (val) this.setAttribute("visible", "");
|
|
80
|
+
else this.removeAttribute("visible");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get anchor() {
|
|
84
|
+
return this.getAttribute("anchor");
|
|
85
|
+
}
|
|
86
|
+
set anchor(id) {
|
|
87
|
+
this.setAttribute("anchor", id);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Which edge the drawer slides in from.
|
|
92
|
+
* Accepted values: "left" | "right" | "top" | "bottom" (default "left").
|
|
93
|
+
*/
|
|
94
|
+
get position() {
|
|
95
|
+
return this.getAttribute("position") || "left";
|
|
96
|
+
}
|
|
97
|
+
set position(val) {
|
|
98
|
+
this.setAttribute("position", val);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get resizable() {
|
|
102
|
+
return this.hasAttribute("resizable");
|
|
103
|
+
}
|
|
104
|
+
set resizable(val) {
|
|
105
|
+
if (val) this.setAttribute("resizable", "");
|
|
106
|
+
else this.removeAttribute("resizable");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
_setupAnchor() {
|
|
110
|
+
const id = this.anchor;
|
|
111
|
+
if (id) {
|
|
112
|
+
const el = document.getElementById(id);
|
|
113
|
+
if (el) {
|
|
114
|
+
this._anchorEl = el;
|
|
115
|
+
this._anchorEl.addEventListener("click", this._onAnchorClick);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
_teardownAnchor() {
|
|
121
|
+
if (this._anchorEl) {
|
|
122
|
+
this._anchorEl.removeEventListener("click", this._onAnchorClick);
|
|
123
|
+
this._anchorEl = null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
_onAnchorClick() {
|
|
128
|
+
this.visible = !this.visible;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
_show() {
|
|
132
|
+
this.style.display = "block";
|
|
133
|
+
// Force a reflow so the browser registers the initial state
|
|
134
|
+
this.offsetHeight; // eslint-disable-line no-unused-expressions
|
|
135
|
+
|
|
136
|
+
const overlay = this.shadowRoot.querySelector(".overlay");
|
|
137
|
+
const panel = this.shadowRoot.querySelector(".drawer-panel");
|
|
138
|
+
|
|
139
|
+
if (overlay) overlay.classList.add("open");
|
|
140
|
+
if (panel) {
|
|
141
|
+
panel.classList.add("open");
|
|
142
|
+
panel.focus();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
document.addEventListener("keydown", this._onKeyDown);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
_hide() {
|
|
149
|
+
const overlay = this.shadowRoot.querySelector(".overlay");
|
|
150
|
+
const panel = this.shadowRoot.querySelector(".drawer-panel");
|
|
151
|
+
|
|
152
|
+
if (overlay) overlay.classList.remove("open");
|
|
153
|
+
if (panel) panel.classList.remove("open");
|
|
154
|
+
|
|
155
|
+
document.removeEventListener("keydown", this._onKeyDown);
|
|
156
|
+
|
|
157
|
+
const duration = this._getTransitionDuration(panel);
|
|
158
|
+
if (duration > 0) {
|
|
159
|
+
clearTimeout(this._hideTimer);
|
|
160
|
+
this._hideTimer = setTimeout(() => {
|
|
161
|
+
if (!this.visible) this.style.display = "none";
|
|
162
|
+
}, duration);
|
|
163
|
+
} else {
|
|
164
|
+
this.style.display = "none";
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
_getTransitionDuration(el) {
|
|
169
|
+
if (!el) return 0;
|
|
170
|
+
const style = getComputedStyle(el);
|
|
171
|
+
const raw = style.transitionDuration || "0s";
|
|
172
|
+
const seconds = parseFloat(raw);
|
|
173
|
+
return isNaN(seconds) ? 0 : seconds * 1000;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
_onKeyDown(e) {
|
|
177
|
+
if (e.key === "Escape" && this.visible) {
|
|
178
|
+
this.visible = false;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
_onOverlayClick() {
|
|
183
|
+
this.visible = false;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
_applyPosition() {
|
|
187
|
+
const panel = this.shadowRoot.querySelector(".drawer-panel");
|
|
188
|
+
if (!panel) return;
|
|
189
|
+
panel.setAttribute("data-position", this.position);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
_applyResizable() {
|
|
193
|
+
const handle = this.shadowRoot.querySelector(".resize-handle");
|
|
194
|
+
if (!handle) return;
|
|
195
|
+
handle.style.display = this.resizable ? "flex" : "none";
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
_isHorizontal() {
|
|
199
|
+
return this.position === "left" || this.position === "right";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
_onResizePointerDown(e) {
|
|
203
|
+
e.preventDefault();
|
|
204
|
+
this._resizing = true;
|
|
205
|
+
this._startPointer = this._isHorizontal() ? e.clientX : e.clientY;
|
|
206
|
+
const panel = this.shadowRoot.querySelector(".drawer-panel");
|
|
207
|
+
this._startSize = this._isHorizontal()
|
|
208
|
+
? panel.offsetWidth
|
|
209
|
+
: panel.offsetHeight;
|
|
210
|
+
|
|
211
|
+
panel.style.transition = "none";
|
|
212
|
+
document.addEventListener("pointermove", this._onResizePointerMove);
|
|
213
|
+
document.addEventListener("pointerup", this._onResizePointerUp);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
_onResizePointerMove(e) {
|
|
217
|
+
if (!this._resizing) return;
|
|
218
|
+
const panel = this.shadowRoot.querySelector(".drawer-panel");
|
|
219
|
+
const current = this._isHorizontal() ? e.clientX : e.clientY;
|
|
220
|
+
const delta = current - this._startPointer;
|
|
221
|
+
let newSize;
|
|
222
|
+
|
|
223
|
+
if (this.position === "left") newSize = this._startSize + delta;
|
|
224
|
+
else if (this.position === "right") newSize = this._startSize - delta;
|
|
225
|
+
else if (this.position === "top") newSize = this._startSize + delta;
|
|
226
|
+
else newSize = this._startSize - delta;
|
|
227
|
+
|
|
228
|
+
const minSize = 100;
|
|
229
|
+
newSize = Math.max(minSize, newSize);
|
|
230
|
+
|
|
231
|
+
if (this._isHorizontal()) {
|
|
232
|
+
panel.style.width = `${newSize}px`;
|
|
233
|
+
} else {
|
|
234
|
+
panel.style.height = `${newSize}px`;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
_onResizePointerUp() {
|
|
239
|
+
this._resizing = false;
|
|
240
|
+
const panel = this.shadowRoot.querySelector(".drawer-panel");
|
|
241
|
+
if (panel) panel.style.transition = "";
|
|
242
|
+
document.removeEventListener("pointermove", this._onResizePointerMove);
|
|
243
|
+
document.removeEventListener("pointerup", this._onResizePointerUp);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
_cleanupResize() {
|
|
247
|
+
document.removeEventListener("pointermove", this._onResizePointerMove);
|
|
248
|
+
document.removeEventListener("pointerup", this._onResizePointerUp);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
_gripSVG() {
|
|
252
|
+
return gripDots(this._isHorizontal());
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
render() {
|
|
256
|
+
this.shadowRoot.innerHTML = "";
|
|
257
|
+
|
|
258
|
+
const style = document.createElement("style");
|
|
259
|
+
style.textContent = `
|
|
260
|
+
:host {
|
|
261
|
+
position: fixed;
|
|
262
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
263
|
+
display: none;
|
|
264
|
+
z-index: var(--component-drawer-z-index, 5000);
|
|
265
|
+
}
|
|
266
|
+
:host([visible]) {
|
|
267
|
+
display: block;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.overlay {
|
|
271
|
+
position: absolute;
|
|
272
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
273
|
+
background: rgba(0, 0, 0, 0);
|
|
274
|
+
transition: background var(--drawer-transition-duration, 0.3s) ease;
|
|
275
|
+
}
|
|
276
|
+
.overlay.open {
|
|
277
|
+
background: rgba(0, 0, 0, 0.4);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.drawer-panel {
|
|
281
|
+
position: absolute;
|
|
282
|
+
background: var(--component-drawer-background, #0c0c0d);
|
|
283
|
+
color: var(--component-drawer-color, #f7f7fa);
|
|
284
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
|
|
285
|
+
overflow: hidden;
|
|
286
|
+
outline: none;
|
|
287
|
+
display: flex;
|
|
288
|
+
flex-direction: column;
|
|
289
|
+
border: none;
|
|
290
|
+
border-radius: var(--component-drawer-border-radius, 0);
|
|
291
|
+
transition: transform var(--drawer-transition-duration, 0.3s) ease;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.drawer-panel[data-position="left"],
|
|
295
|
+
.drawer-panel[data-position="right"] {
|
|
296
|
+
top: 0;
|
|
297
|
+
bottom: 0;
|
|
298
|
+
width: var(--drawer-width, 300px);
|
|
299
|
+
flex-direction: row;
|
|
300
|
+
}
|
|
301
|
+
.drawer-panel[data-position="left"] {
|
|
302
|
+
left: 0;
|
|
303
|
+
transform: translateX(-100%);
|
|
304
|
+
border-right: var(--component-drawer-border-width, 2px) solid var(--component-drawer-border-color, #37383a);
|
|
305
|
+
}
|
|
306
|
+
.drawer-panel[data-position="right"] {
|
|
307
|
+
right: 0;
|
|
308
|
+
transform: translateX(100%);
|
|
309
|
+
border-left: var(--component-drawer-border-width, 2px) solid var(--component-drawer-border-color, #37383a);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.drawer-panel[data-position="top"],
|
|
313
|
+
.drawer-panel[data-position="bottom"] {
|
|
314
|
+
left: 0;
|
|
315
|
+
right: 0;
|
|
316
|
+
height: var(--drawer-height, 300px);
|
|
317
|
+
}
|
|
318
|
+
.drawer-panel[data-position="top"] {
|
|
319
|
+
top: 0;
|
|
320
|
+
transform: translateY(-100%);
|
|
321
|
+
border-bottom: var(--component-drawer-border-width, 2px) solid var(--component-drawer-border-color, #37383a);
|
|
322
|
+
}
|
|
323
|
+
.drawer-panel[data-position="bottom"] {
|
|
324
|
+
bottom: 0;
|
|
325
|
+
transform: translateY(100%);
|
|
326
|
+
border-top: var(--component-drawer-border-width, 2px) solid var(--component-drawer-border-color, #37383a);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.drawer-panel.open { transform: translate(0, 0); }
|
|
330
|
+
|
|
331
|
+
.drawer-header {
|
|
332
|
+
padding: var(--component-drawer-padding, 1rem);
|
|
333
|
+
font-weight: bold;
|
|
334
|
+
}
|
|
335
|
+
.drawer-body {
|
|
336
|
+
padding: var(--component-drawer-padding, 1rem);
|
|
337
|
+
flex: 1;
|
|
338
|
+
overflow: auto;
|
|
339
|
+
}
|
|
340
|
+
.drawer-footer {
|
|
341
|
+
padding: var(--component-drawer-padding, 1rem);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* Wrapper so header/body/footer stack vertically inside a row layout */
|
|
345
|
+
.drawer-content {
|
|
346
|
+
display: flex;
|
|
347
|
+
flex-direction: column;
|
|
348
|
+
flex: 1;
|
|
349
|
+
min-width: 0;
|
|
350
|
+
min-height: 0;
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
::slotted(*) {
|
|
355
|
+
margin: 0;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.resize-handle {
|
|
359
|
+
display: none; /* hidden until resizable attr */
|
|
360
|
+
flex-shrink: 0;
|
|
361
|
+
align-items: center;
|
|
362
|
+
justify-content: center;
|
|
363
|
+
color: var(--component-drawer-color, #f7f7fa);
|
|
364
|
+
opacity: 0.6;
|
|
365
|
+
touch-action: none; /* needed for pointer events */
|
|
366
|
+
user-select: none;
|
|
367
|
+
transition: opacity 0.15s, background 0.15s;
|
|
368
|
+
}
|
|
369
|
+
.resize-handle:hover,
|
|
370
|
+
.resize-handle:active {
|
|
371
|
+
opacity: 1;
|
|
372
|
+
background: var(--component-drawer-hover-background, #292a2b);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.drawer-panel[data-position="left"] > .resize-handle,
|
|
376
|
+
.drawer-panel[data-position="right"] > .resize-handle {
|
|
377
|
+
width: var(--component-drawer-handle-width, 6px);
|
|
378
|
+
padding: var(--component-drawer-handle-padding, 4px);
|
|
379
|
+
cursor: ew-resize;
|
|
380
|
+
}
|
|
381
|
+
.drawer-panel[data-position="left"] > .resize-handle {
|
|
382
|
+
order: 99;
|
|
383
|
+
}
|
|
384
|
+
.drawer-panel[data-position="right"] > .resize-handle {
|
|
385
|
+
order: -1;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.drawer-panel[data-position="top"] > .resize-handle,
|
|
389
|
+
.drawer-panel[data-position="bottom"] > .resize-handle {
|
|
390
|
+
height: var(--component-drawer-handle-width, 6px);
|
|
391
|
+
padding: var(--component-drawer-handle-padding, 4px);
|
|
392
|
+
cursor: ns-resize;
|
|
393
|
+
}
|
|
394
|
+
.drawer-panel[data-position="top"] > .resize-handle {
|
|
395
|
+
order: 99;
|
|
396
|
+
}
|
|
397
|
+
.drawer-panel[data-position="bottom"] > .resize-handle {
|
|
398
|
+
order: -1;
|
|
399
|
+
}
|
|
400
|
+
`;
|
|
401
|
+
this.shadowRoot.appendChild(style);
|
|
402
|
+
|
|
403
|
+
const overlay = document.createElement("div");
|
|
404
|
+
overlay.className = "overlay";
|
|
405
|
+
overlay.setAttribute("part", "overlay");
|
|
406
|
+
overlay.addEventListener("click", () => this._onOverlayClick());
|
|
407
|
+
this.shadowRoot.appendChild(overlay);
|
|
408
|
+
|
|
409
|
+
const panel = document.createElement("div");
|
|
410
|
+
panel.className = "drawer-panel";
|
|
411
|
+
panel.setAttribute("role", "dialog");
|
|
412
|
+
panel.setAttribute("aria-modal", "true");
|
|
413
|
+
panel.setAttribute("tabindex", "-1");
|
|
414
|
+
panel.setAttribute("part", "panel");
|
|
415
|
+
panel.setAttribute("data-position", this.position);
|
|
416
|
+
|
|
417
|
+
const handle = document.createElement("div");
|
|
418
|
+
handle.className = "resize-handle";
|
|
419
|
+
handle.innerHTML = this._gripSVG();
|
|
420
|
+
handle.style.display = this.resizable ? "flex" : "none";
|
|
421
|
+
handle.addEventListener("pointerdown", this._onResizePointerDown);
|
|
422
|
+
panel.appendChild(handle);
|
|
423
|
+
|
|
424
|
+
const content = document.createElement("div");
|
|
425
|
+
content.className = "drawer-content";
|
|
426
|
+
|
|
427
|
+
const header = document.createElement("div");
|
|
428
|
+
header.className = "drawer-header";
|
|
429
|
+
header.setAttribute("part", "header");
|
|
430
|
+
header.innerHTML = `<slot name="header"></slot>`;
|
|
431
|
+
|
|
432
|
+
const body = document.createElement("div");
|
|
433
|
+
body.className = "drawer-body";
|
|
434
|
+
body.setAttribute("part", "body");
|
|
435
|
+
body.innerHTML = `<slot name="body"></slot>`;
|
|
436
|
+
|
|
437
|
+
const footer = document.createElement("div");
|
|
438
|
+
footer.className = "drawer-footer";
|
|
439
|
+
footer.setAttribute("part", "footer");
|
|
440
|
+
footer.innerHTML = `<slot name="footer"></slot>`;
|
|
441
|
+
|
|
442
|
+
content.appendChild(header);
|
|
443
|
+
content.appendChild(body);
|
|
444
|
+
content.appendChild(footer);
|
|
445
|
+
panel.appendChild(content);
|
|
446
|
+
this.shadowRoot.appendChild(panel);
|
|
447
|
+
|
|
448
|
+
if (this.visible) {
|
|
449
|
+
requestAnimationFrame(() => {
|
|
450
|
+
overlay.classList.add("open");
|
|
451
|
+
panel.classList.add("open");
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
if (!customElements.get("y-drawer")) {
|
|
458
|
+
customElements.define("y-drawer", YumeDrawer);
|
|
459
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class YumeIcon extends HTMLElement {
|
|
2
|
+
static get observedAttributes(): string[];
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
|
|
5
|
+
set name(val: string);
|
|
6
|
+
get name(): string;
|
|
7
|
+
set size(val: string);
|
|
8
|
+
get size(): string;
|
|
9
|
+
set color(val: string);
|
|
10
|
+
get color(): string;
|
|
11
|
+
set label(val: string);
|
|
12
|
+
get label(): string;
|
|
13
|
+
set weight(val: string);
|
|
14
|
+
get weight(): string;
|
|
15
|
+
_getColor(color: any): any;
|
|
16
|
+
_getSize(size: any): any;
|
|
17
|
+
_getWeight(weight: any): any;
|
|
18
|
+
render(): void;
|
|
19
|
+
}
|