@moni-labs/moni-ui 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -3
- package/custom-elements.json +6 -6
- package/dist/cdn/chunks/base-BIpe3L86.js +1 -0
- package/dist/cdn/chunks/class-map-DBljv-_e.js +1 -0
- package/dist/cdn/chunks/decorate-DxX3e27g.js +738 -0
- package/dist/cdn/chunks/directive-BSZPiF1A.js +1 -0
- package/dist/cdn/chunks/event-emitter-CGhsijUg.js +1 -0
- package/dist/cdn/chunks/gsap-DWxn8li7.js +1 -0
- package/dist/cdn/chunks/if-defined-CuEAJKpp.js +1 -0
- package/dist/cdn/chunks/live-B7Rjg1kt.js +1 -0
- package/dist/cdn/chunks/query-SWT-tzvq.js +1 -0
- package/dist/cdn/chunks/query-assigned-elements-BBHe1xEY.js +1 -0
- package/dist/cdn/components/moni-app-bar.js +118 -0
- package/dist/cdn/components/moni-badge.js +69 -0
- package/dist/cdn/components/moni-bottom-sheet.js +143 -0
- package/dist/cdn/components/moni-button-group.js +56 -0
- package/dist/cdn/components/moni-button-segment.js +272 -0
- package/dist/cdn/components/moni-button.js +602 -0
- package/dist/cdn/components/moni-card.js +143 -0
- package/dist/cdn/components/moni-carousel.js +311 -0
- package/dist/cdn/components/moni-checkbox.js +137 -0
- package/dist/cdn/components/moni-chip.js +218 -0
- package/dist/cdn/components/moni-color-field.js +54 -0
- package/dist/cdn/components/moni-context-menu.js +24 -0
- package/dist/cdn/components/moni-dialog.js +191 -0
- package/dist/cdn/components/moni-divider.js +32 -0
- package/dist/cdn/components/moni-expansion.js +50 -0
- package/dist/cdn/components/moni-fab-menu.js +57 -0
- package/dist/cdn/components/moni-fab.js +103 -0
- package/dist/cdn/components/moni-file-field.js +45 -0
- package/dist/cdn/components/moni-icon.js +55 -0
- package/dist/cdn/components/moni-list-item.js +144 -0
- package/dist/cdn/components/moni-list.js +16 -0
- package/dist/cdn/components/moni-loading-indicator.js +134 -0
- package/dist/cdn/components/moni-menu-item.js +45 -0
- package/dist/cdn/components/moni-menu.js +165 -0
- package/dist/cdn/components/moni-morph-modal.js +157 -0
- package/dist/cdn/components/moni-nav-item.js +153 -0
- package/dist/cdn/components/moni-nav.js +161 -0
- package/dist/cdn/components/moni-progress.js +420 -0
- package/dist/cdn/components/moni-radio.js +154 -0
- package/dist/cdn/components/moni-ripple.js +55 -0
- package/dist/cdn/components/moni-segmented-button.js +32 -0
- package/dist/cdn/components/moni-select-option.js +47 -0
- package/dist/cdn/components/moni-select.js +503 -0
- package/dist/cdn/components/moni-shape.js +99 -0
- package/dist/cdn/components/moni-side-sheet.js +234 -0
- package/dist/cdn/components/moni-slider.js +252 -0
- package/dist/cdn/components/moni-snackbar.js +91 -0
- package/dist/cdn/components/moni-split-button.js +110 -0
- package/dist/cdn/components/moni-step.js +111 -0
- package/dist/cdn/components/moni-stepper.js +25 -0
- package/dist/cdn/components/moni-switch.js +169 -0
- package/dist/cdn/components/moni-tab.js +93 -0
- package/dist/cdn/components/moni-tabs.js +38 -0
- package/dist/cdn/components/moni-text-field.js +83 -0
- package/dist/cdn/components/moni-textarea.js +46 -0
- package/dist/cdn/components/moni-time-picker.js +496 -0
- package/dist/cdn/components/moni-toolbar.js +71 -0
- package/dist/cdn/components/moni-tooltip.js +161 -0
- package/dist/cdn/components/moni-typography.js +117 -0
- package/dist/cdn/importmap.json +102 -0
- package/dist/cdn/moni-ui.min.css +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import{a as e,c as t,d as n,i as r,m as i,o as a,r as o,s,t as c}from"../chunks/decorate-DxX3e27g.js";import"./moni-icon.js";import"./moni-progress.js";var l=class extends r{constructor(...e){super(...e),this.variant=`assist`,this.size=`small`,this.shape=`round`,this.selected=!1,this.removable=!1,this.disabled=!1,this.loading=!1,this.icon=``,this._hasSlottedIcon=!1}_handleSlotChange(e){let t=e.target;this._hasSlottedIcon=t.assignedNodes({flatten:!0}).length>0}_handleRemoveClick(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent(`remove`,{bubbles:!0,composed:!0}))}get _variant(){return this.variant===`outlined`?`assist`:this.variant===`fill`?`filter`:this.variant}static{this.styles=[o,i`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
vertical-align: middle;
|
|
5
|
+
font-family: var(--font);
|
|
6
|
+
position: relative;
|
|
7
|
+
user-select: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.chip {
|
|
11
|
+
--_padding: 1rem; /* 16dp when no leading icon (M3 spec) */
|
|
12
|
+
--_size: 2rem;
|
|
13
|
+
--_round: calc(var(--_size) / 2);
|
|
14
|
+
--_icon-size: 1.125rem;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
block-size: var(--_size);
|
|
20
|
+
min-inline-size: var(--_size);
|
|
21
|
+
font-size: 0.875rem;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
border: 0.0625rem solid var(--outline);
|
|
25
|
+
color: var(--on-surface);
|
|
26
|
+
padding: 0 var(--_padding);
|
|
27
|
+
border-radius: 0.5rem;
|
|
28
|
+
transition:
|
|
29
|
+
transform var(--speed2),
|
|
30
|
+
background-color var(--speed2),
|
|
31
|
+
border-color var(--speed2),
|
|
32
|
+
border-radius var(--speed2),
|
|
33
|
+
padding var(--speed3);
|
|
34
|
+
user-select: none;
|
|
35
|
+
gap: 0.5rem;
|
|
36
|
+
line-height: normal;
|
|
37
|
+
letter-spacing: normal;
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
position: relative;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.chip::after {
|
|
45
|
+
content: '';
|
|
46
|
+
position: absolute;
|
|
47
|
+
inset: 0;
|
|
48
|
+
background: currentColor;
|
|
49
|
+
opacity: 0;
|
|
50
|
+
transition: opacity var(--speed2);
|
|
51
|
+
border-radius: inherit;
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.chip.has-icon {
|
|
56
|
+
--_padding: 0.5rem; /* 8dp when a leading icon is present (M3 spec) */
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.chip.medium {
|
|
60
|
+
--_size: 2.5rem;
|
|
61
|
+
--_padding: 0.75rem;
|
|
62
|
+
--_icon-size: 1.25rem;
|
|
63
|
+
}
|
|
64
|
+
.chip.medium.has-icon {
|
|
65
|
+
--_padding: 0.75rem;
|
|
66
|
+
}
|
|
67
|
+
.chip.large {
|
|
68
|
+
--_padding: 1rem;
|
|
69
|
+
--_size: 3rem;
|
|
70
|
+
--_icon-size: 1.5rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.chip:hover:not(:disabled)::after {
|
|
74
|
+
opacity: 0.08;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.chip:active:not(:disabled) {
|
|
78
|
+
transform: scale(0.97);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ─── M3 variant colors ─── */
|
|
82
|
+
/* Filter and input chips use outline-variant + on-surface-variant
|
|
83
|
+
for the resting state (M3 spec). Assist and suggestion use
|
|
84
|
+
outline + on-surface for 3:1 contrast (a11y). */
|
|
85
|
+
.chip.filter,
|
|
86
|
+
.chip.input {
|
|
87
|
+
border-color: var(--outline-variant);
|
|
88
|
+
color: var(--on-surface-variant);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.chip.suggestion {
|
|
92
|
+
border-color: var(--outline);
|
|
93
|
+
color: var(--on-surface-variant);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Selected state — M3 filter/input show a leading check and
|
|
97
|
+
secondary-container background. */
|
|
98
|
+
.chip.selected {
|
|
99
|
+
background-color: var(--secondary-container);
|
|
100
|
+
color: var(--on-secondary-container);
|
|
101
|
+
border-color: transparent;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Filter without selection can have leading check on hover to
|
|
105
|
+
indicate the action. */
|
|
106
|
+
.chip.filter.selected::before,
|
|
107
|
+
.chip.input.selected::before {
|
|
108
|
+
content: '\\e5ca';
|
|
109
|
+
font-family: var(--font-icon);
|
|
110
|
+
font-size: var(--_icon-size);
|
|
111
|
+
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
112
|
+
margin-inline-end: 0.25rem;
|
|
113
|
+
color: currentColor;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.chip.no-round {
|
|
117
|
+
border-radius: 0;
|
|
118
|
+
}
|
|
119
|
+
.chip.square {
|
|
120
|
+
border-radius: 0.25rem;
|
|
121
|
+
}
|
|
122
|
+
.chip.circle {
|
|
123
|
+
inline-size: var(--_size);
|
|
124
|
+
padding: 0;
|
|
125
|
+
aspect-ratio: 1;
|
|
126
|
+
border-radius: 50%;
|
|
127
|
+
}
|
|
128
|
+
.chip.left-round {
|
|
129
|
+
border-radius: var(--_round) 0 0 var(--_round) !important;
|
|
130
|
+
}
|
|
131
|
+
.chip.right-round {
|
|
132
|
+
border-radius: 0 var(--_round) var(--_round) 0 !important;
|
|
133
|
+
}
|
|
134
|
+
.chip.top-round {
|
|
135
|
+
border-radius: var(--_round) var(--_round) 0 0 !important;
|
|
136
|
+
}
|
|
137
|
+
.chip.bottom-round {
|
|
138
|
+
border-radius: 0 0 var(--_round) var(--_round) !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.chip:disabled {
|
|
142
|
+
opacity: 0.5;
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.chip:focus-visible {
|
|
148
|
+
outline: 0.125rem solid var(--primary);
|
|
149
|
+
outline-offset: 0.125rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.icon,
|
|
153
|
+
::slotted([slot='icon']) {
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
font-size: var(--_icon-size);
|
|
158
|
+
flex: none;
|
|
159
|
+
color: inherit;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* An empty icon slot must not become a flex item: otherwise the
|
|
163
|
+
container gap reserves space before the label. */
|
|
164
|
+
slot.icon[hidden] {
|
|
165
|
+
display: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.remove {
|
|
169
|
+
display: inline-flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
justify-content: center;
|
|
172
|
+
font-size: var(--_icon-size);
|
|
173
|
+
opacity: 0.7;
|
|
174
|
+
margin-inline-start: 0.125rem;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.loading-spinner {
|
|
178
|
+
inline-size: var(--_icon-size);
|
|
179
|
+
block-size: var(--_icon-size);
|
|
180
|
+
color: currentColor;
|
|
181
|
+
}
|
|
182
|
+
.loading-spinner::part(progress) {
|
|
183
|
+
border-width: 0.1875rem;
|
|
184
|
+
}
|
|
185
|
+
`]}render(){let e=this._variant,r=!!this.icon||this._hasSlottedIcon,i=[`chip`,e,this.size,this.shape,this.selected?`selected`:``,r?`has-icon`:``].filter(Boolean).join(` `);if(this.loading)return n`<button
|
|
186
|
+
class=${i}
|
|
187
|
+
part="chip"
|
|
188
|
+
type="button"
|
|
189
|
+
?disabled=${this.disabled}
|
|
190
|
+
aria-busy="true"
|
|
191
|
+
>
|
|
192
|
+
<moni-progress
|
|
193
|
+
class="loading-spinner"
|
|
194
|
+
part="loading"
|
|
195
|
+
variant="circular"
|
|
196
|
+
indeterminate
|
|
197
|
+
size="small"
|
|
198
|
+
></moni-progress>
|
|
199
|
+
</button>`;let a=this.removable||e===`input`,o=this.icon?n`<span class="icon" part="icon"
|
|
200
|
+
><moni-icon name="${this.icon}"></moni-icon
|
|
201
|
+
></span>`:n`<slot
|
|
202
|
+
name="icon"
|
|
203
|
+
part="icon"
|
|
204
|
+
class="icon"
|
|
205
|
+
?hidden=${!this._hasSlottedIcon}
|
|
206
|
+
@slotchange=${this._handleSlotChange}
|
|
207
|
+
></slot>`,s=a?n`<span class="remove" part="remove" aria-hidden="true" @click=${this._handleRemoveClick}
|
|
208
|
+
><moni-icon name="close"></moni-icon
|
|
209
|
+
></span>`:t;return n`<button
|
|
210
|
+
class=${i}
|
|
211
|
+
part="chip"
|
|
212
|
+
type="button"
|
|
213
|
+
?disabled=${this.disabled}
|
|
214
|
+
>
|
|
215
|
+
${o}
|
|
216
|
+
<span part="label"><slot></slot></span>
|
|
217
|
+
${s}
|
|
218
|
+
</button>`}};c([a({reflect:!0})],l.prototype,`variant`,void 0),c([a({reflect:!0})],l.prototype,`size`,void 0),c([a({reflect:!0})],l.prototype,`shape`,void 0),c([a({type:Boolean,reflect:!0})],l.prototype,`selected`,void 0),c([a({type:Boolean,reflect:!0})],l.prototype,`removable`,void 0),c([a({type:Boolean,reflect:!0})],l.prototype,`disabled`,void 0),c([a({type:Boolean,reflect:!0})],l.prototype,`loading`,void 0),c([a({reflect:!0})],l.prototype,`icon`,void 0),c([e()],l.prototype,`_hasSlottedIcon`,void 0),l=c([s(`moni-chip`)],l);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{c as e,d as t,i as n,m as r,n as i,o as a,r as o,s,t as c}from"../chunks/decorate-DxX3e27g.js";import{t as l}from"../chunks/query-SWT-tzvq.js";import{t as u}from"../chunks/if-defined-CuEAJKpp.js";import{t as d}from"../chunks/class-map-DBljv-_e.js";var f=class extends n{constructor(...e){super(...e),this.name=``,this.label=``,this.variant=`outlined`,this.size=`medium`,this.shape=`no-round`,this.disabled=!1,this.helper=``,this.errorText=``,this.error=!1,this.value=`#6750a4`}updated(e){e.has(`value`)&&(this._colorInput&&(this._colorInput.value=this.value),this._textInput&&(this._textInput.value=this.value)),e.has(`disabled`)&&(this._colorInput&&(this._colorInput.disabled=this.disabled),this._textInput&&(this._textInput.disabled=this.disabled))}static{this.styles=[o,i,r`
|
|
2
|
+
.swatch {
|
|
3
|
+
inline-size: 1.5rem;
|
|
4
|
+
block-size: 1.5rem;
|
|
5
|
+
border-radius: 50%;
|
|
6
|
+
border: 0.0625rem solid var(--outline);
|
|
7
|
+
background-color: var(--_swatch, currentColor);
|
|
8
|
+
position: absolute;
|
|
9
|
+
inset: calc(50% - 0.75rem) auto auto 0.75rem;
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
z-index: 1;
|
|
12
|
+
}
|
|
13
|
+
input[type='text'] {
|
|
14
|
+
padding-inline-start: 2.5rem !important;
|
|
15
|
+
}
|
|
16
|
+
input[type='color'] {
|
|
17
|
+
position: absolute;
|
|
18
|
+
inset: 0;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
z-index: 2;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
}
|
|
23
|
+
`]}render(){let n=!!this.value,r={field:!0,label:!!this.label,fill:this.variant===`filled`,border:this.variant===`outlined`,small:this.size===`small`,large:this.size===`large`,extra:this.size===`extra`,prefix:!0,invalid:this.error,round:this.shape===`round`,square:this.shape===`no-round`};return t`<div class=${d(r)} part="field">
|
|
24
|
+
<span
|
|
25
|
+
class="swatch"
|
|
26
|
+
style="--_swatch: ${this.value};"
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
></span>
|
|
29
|
+
<input
|
|
30
|
+
type="color"
|
|
31
|
+
part="color"
|
|
32
|
+
.value=${this.value}
|
|
33
|
+
?disabled=${this.disabled}
|
|
34
|
+
name=${u(this.name?`${this.name}-color`:void 0)}
|
|
35
|
+
tabindex="-1"
|
|
36
|
+
/>
|
|
37
|
+
<input
|
|
38
|
+
type="text"
|
|
39
|
+
part="text"
|
|
40
|
+
readonly
|
|
41
|
+
.value=${this.value}
|
|
42
|
+
?disabled=${this.disabled}
|
|
43
|
+
name=${u(this.name||void 0)}
|
|
44
|
+
class=${n?`active`:``}
|
|
45
|
+
/>
|
|
46
|
+
${this.label?t`<label
|
|
47
|
+
part="label"
|
|
48
|
+
class=${d({active:n})}
|
|
49
|
+
>${this.label}</label
|
|
50
|
+
>`:e}
|
|
51
|
+
${this.error?t`<output part="helper" class="invalid"
|
|
52
|
+
>${this.errorText||this.helper}</output
|
|
53
|
+
>`:this.helper?t`<output part="helper">${this.helper}</output>`:e}
|
|
54
|
+
</div>`}};c([a({reflect:!0})],f.prototype,`name`,void 0),c([a({reflect:!0})],f.prototype,`label`,void 0),c([a({reflect:!0})],f.prototype,`variant`,void 0),c([a({reflect:!0})],f.prototype,`size`,void 0),c([a({reflect:!0})],f.prototype,`shape`,void 0),c([a({type:Boolean,reflect:!0})],f.prototype,`disabled`,void 0),c([a({reflect:!0})],f.prototype,`helper`,void 0),c([a({reflect:!0,attribute:`error-text`})],f.prototype,`errorText`,void 0),c([a({type:Boolean,reflect:!0})],f.prototype,`error`,void 0),c([a({reflect:!0})],f.prototype,`value`,void 0),c([l(`input[type="color"]`)],f.prototype,`_colorInput`,void 0),c([l(`input[type="text"]`)],f.prototype,`_textInput`,void 0),f=c([s(`moni-color-field`)],f);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as e,d as t,i as n,m as r,o as i,r as a,s as o,t as s}from"../chunks/decorate-DxX3e27g.js";import{t as c}from"../chunks/query-SWT-tzvq.js";import"./moni-menu.js";var l=class extends n{constructor(...e){super(...e),this.placement=`bottom`,this.flip=!1,this._x=0,this._y=0,this._open=!1,this._resolvedPlacement=`bottom`,this._target=null,this._docKeydown=e=>this._onDocKeydown(e),this._onContextMenu=e=>{if(e.preventDefault(),this._target){let t=this._target.getBoundingClientRect();this._x=e.clientX-t.left,this._y=e.clientY-t.top}else this._x=e.clientX,this._y=e.clientY;this._resolvedPlacement=this.placement,this._open=!0,this.updateComplete.then(()=>this._maybeFlip())},this._onDocumentClick=()=>{this._open&&=!1},this._onDocKeydown=e=>{e.key===`Escape`&&this._open&&(this._open=!1)}}connectedCallback(){super.connectedCallback(),this._target=this.parentElement,this._target&&(getComputedStyle(this._target).position===`static`&&(this._target.style.position=`relative`),this._target.addEventListener(`contextmenu`,this._onContextMenu)),document.addEventListener(`click`,this._onDocumentClick),document.addEventListener(`keydown`,this._docKeydown)}disconnectedCallback(){this._target&&this._target.removeEventListener(`contextmenu`,this._onContextMenu),document.removeEventListener(`click`,this._onDocumentClick),document.removeEventListener(`keydown`,this._docKeydown),super.disconnectedCallback()}_maybeFlip(){if(!this.flip)return;let e=this._menuEl?.shadowRoot?.querySelector(`menu`);if(!e)return;let t=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t.bottom>r,a=t.right>n;this.placement===`bottom`&&i?this._resolvedPlacement=`top`:this.placement===`top`&&t.top<0?this._resolvedPlacement=`bottom`:this.placement===`right`&&a?this._resolvedPlacement=`left`:this.placement===`left`&&t.left<0&&(this._resolvedPlacement=`right`)}static{this.styles=[a,r`
|
|
2
|
+
:host {
|
|
3
|
+
display: contents;
|
|
4
|
+
font-family: var(--font);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.menu-host {
|
|
8
|
+
/* Absolute from parent which has position:relative */
|
|
9
|
+
position: absolute;
|
|
10
|
+
inset-inline-start: var(--_x, 0);
|
|
11
|
+
inset-block-start: var(--_y, 0);
|
|
12
|
+
z-index: 200;
|
|
13
|
+
}
|
|
14
|
+
`]}render(){let e=this._open?this._resolvedPlacement:this.placement;return t`<div
|
|
15
|
+
class="menu-host"
|
|
16
|
+
style="--_x: ${this._x}px; --_y: ${this._y}px;"
|
|
17
|
+
>
|
|
18
|
+
<moni-menu
|
|
19
|
+
placement=${e}
|
|
20
|
+
?active=${this._open}
|
|
21
|
+
>
|
|
22
|
+
<slot></slot>
|
|
23
|
+
</moni-menu>
|
|
24
|
+
</div>`}};s([i({reflect:!0})],l.prototype,`placement`,void 0),s([i({type:Boolean,reflect:!0})],l.prototype,`flip`,void 0),s([e()],l.prototype,`_x`,void 0),s([e()],l.prototype,`_y`,void 0),s([e()],l.prototype,`_open`,void 0),s([e()],l.prototype,`_resolvedPlacement`,void 0),s([c(`moni-menu`)],l.prototype,`_menuEl`,void 0),l=s([o(`moni-context-menu`)],l);
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";import{t as s}from"../chunks/query-SWT-tzvq.js";import{t as c}from"../chunks/event-emitter-CGhsijUg.js";var l=class extends t{constructor(...e){super(...e),this.open=!1,this.modal=!1,this.side=`center`,this.size=`medium`,this.title=``}willUpdate(e){if(e.has(`open`)&&this.open!==e.get(`open`)){let e=this.open,t=e?`moni-request-open`:`moni-request-close`;c(this,t,{cancelable:!0})||(this.open=!e)}}updated(e){e.has(`open`)&&this._dialog&&(this.open?(c(this,`moni-open`),this.modal?this._dialog.open||this._dialog.showModal():this._dialog.open||this._dialog.show()):(c(this,`moni-close`),this._dialog.open&&this._dialog.close()))}_onTransitionEnd(e){e.target===this._dialog&&e.propertyName===`transform`&&(this.open?c(this,`moni-opened`):c(this,`moni-closed`))}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
dialog {
|
|
7
|
+
--_padding: 1.5rem;
|
|
8
|
+
--_top: calc(var(--_padding) + env(safe-area-inset-top, 0));
|
|
9
|
+
--_bottom: calc(var(--_padding) + env(safe-area-inset-bottom, 0));
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
visibility: hidden;
|
|
14
|
+
border: none;
|
|
15
|
+
opacity: 0;
|
|
16
|
+
position: fixed;
|
|
17
|
+
box-shadow: var(--elevate2);
|
|
18
|
+
color: var(--on-surface);
|
|
19
|
+
background-color: var(--surface-container-high);
|
|
20
|
+
padding: var(--_padding);
|
|
21
|
+
z-index: 100;
|
|
22
|
+
inset: 10% auto auto 50%;
|
|
23
|
+
min-inline-size: 20rem;
|
|
24
|
+
max-inline-size: 100%;
|
|
25
|
+
max-block-size: 80%;
|
|
26
|
+
overflow-x: hidden;
|
|
27
|
+
overflow-y: hidden;
|
|
28
|
+
transition: all var(--speed3), 0s background-color;
|
|
29
|
+
border-radius: 1.75rem;
|
|
30
|
+
transform: translate(-50%, -4rem) scale(var(--moni-dialog-scale, 1));
|
|
31
|
+
transform-origin: top center;
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
dialog[open] {
|
|
36
|
+
visibility: visible;
|
|
37
|
+
opacity: 1;
|
|
38
|
+
transform: translate(-50%, 0) scale(var(--moni-dialog-scale, 1));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
dialog::backdrop {
|
|
42
|
+
display: block !important;
|
|
43
|
+
opacity: 0;
|
|
44
|
+
visibility: hidden;
|
|
45
|
+
position: fixed;
|
|
46
|
+
inset: 0;
|
|
47
|
+
color: var(--on-surface);
|
|
48
|
+
background-color: rgb(0 0 0 / 0.5);
|
|
49
|
+
z-index: 100;
|
|
50
|
+
transition: all var(--speed3), 0s background-color;
|
|
51
|
+
border-radius: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
dialog[open]::backdrop {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
visibility: visible;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
dialog:is(.top, .right, .bottom, .left, .max) {
|
|
60
|
+
--_padding: 1rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
dialog.top,
|
|
64
|
+
dialog.bottom {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
block-size: auto;
|
|
67
|
+
inline-size: 100%;
|
|
68
|
+
min-inline-size: auto;
|
|
69
|
+
max-block-size: 100%;
|
|
70
|
+
}
|
|
71
|
+
dialog.top {
|
|
72
|
+
inset: 0 auto auto 0;
|
|
73
|
+
transform: translateY(-100%);
|
|
74
|
+
border-radius: 0 0 1rem 1rem;
|
|
75
|
+
padding-block-start: var(--_top);
|
|
76
|
+
}
|
|
77
|
+
dialog.bottom {
|
|
78
|
+
inset: auto auto 0 0;
|
|
79
|
+
transform: translateY(100%);
|
|
80
|
+
border-radius: 1rem 1rem 0 0;
|
|
81
|
+
padding-block-end: var(--_bottom);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
dialog:is(.left, .right) {
|
|
85
|
+
opacity: 1;
|
|
86
|
+
inset: 0 auto auto 0;
|
|
87
|
+
inline-size: auto;
|
|
88
|
+
block-size: 100%;
|
|
89
|
+
max-block-size: 100%;
|
|
90
|
+
background-color: var(--surface);
|
|
91
|
+
padding-block: var(--_top) var(--_bottom);
|
|
92
|
+
}
|
|
93
|
+
dialog.left {
|
|
94
|
+
inset: 0 auto auto 0;
|
|
95
|
+
border-radius: 0 1rem 1rem 0;
|
|
96
|
+
transform: translateX(-100%);
|
|
97
|
+
}
|
|
98
|
+
dialog.right {
|
|
99
|
+
inset: 0 0 auto auto;
|
|
100
|
+
border-radius: 1rem 0 0 1rem;
|
|
101
|
+
transform: translateX(100%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
dialog.max {
|
|
105
|
+
inset: 0 auto auto 0;
|
|
106
|
+
inline-size: 100%;
|
|
107
|
+
block-size: 100%;
|
|
108
|
+
max-inline-size: 100%;
|
|
109
|
+
max-block-size: 100%;
|
|
110
|
+
transform: translateY(4rem);
|
|
111
|
+
background-color: var(--surface);
|
|
112
|
+
border-radius: 0;
|
|
113
|
+
padding-block: var(--_top) var(--_bottom);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
dialog[open]:is(.left, .right, .top, .bottom, .max) {
|
|
117
|
+
transform: translate(0, 0);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
dialog.small {
|
|
121
|
+
inline-size: 25%;
|
|
122
|
+
}
|
|
123
|
+
dialog.medium {
|
|
124
|
+
inline-size: 50%;
|
|
125
|
+
}
|
|
126
|
+
dialog.large {
|
|
127
|
+
inline-size: 75%;
|
|
128
|
+
}
|
|
129
|
+
dialog.small:is(.left, .right) {
|
|
130
|
+
inline-size: 20rem;
|
|
131
|
+
}
|
|
132
|
+
dialog.medium:is(.left, .right) {
|
|
133
|
+
inline-size: 32rem;
|
|
134
|
+
}
|
|
135
|
+
dialog.large:is(.left, .right) {
|
|
136
|
+
inline-size: 44rem;
|
|
137
|
+
}
|
|
138
|
+
dialog.small:is(.top, .bottom) {
|
|
139
|
+
block-size: 16rem;
|
|
140
|
+
}
|
|
141
|
+
dialog.medium:is(.top, .bottom) {
|
|
142
|
+
block-size: 24rem;
|
|
143
|
+
}
|
|
144
|
+
dialog.large:is(.top, .bottom) {
|
|
145
|
+
block-size: 32rem;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
header,
|
|
149
|
+
footer {
|
|
150
|
+
display: grid;
|
|
151
|
+
align-content: center;
|
|
152
|
+
border-radius: 0;
|
|
153
|
+
padding: 0;
|
|
154
|
+
}
|
|
155
|
+
header {
|
|
156
|
+
min-block-size: 3rem;
|
|
157
|
+
}
|
|
158
|
+
[part='content'] {
|
|
159
|
+
min-block-size: 0;
|
|
160
|
+
overflow-x: hidden;
|
|
161
|
+
overflow-y: auto;
|
|
162
|
+
overscroll-behavior: contain;
|
|
163
|
+
}
|
|
164
|
+
footer {
|
|
165
|
+
min-block-size: 3.5rem;
|
|
166
|
+
position: relative;
|
|
167
|
+
z-index: 1;
|
|
168
|
+
background: inherit;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@media (max-width: 37.5rem), (max-height: 37.5rem) {
|
|
172
|
+
dialog:is(.small, .medium, .large):not(.top, .right, .bottom, .left, .max) {
|
|
173
|
+
--_padding: 1rem;
|
|
174
|
+
inline-size: calc(100vw - 2rem);
|
|
175
|
+
min-inline-size: 0;
|
|
176
|
+
max-inline-size: 35rem;
|
|
177
|
+
max-block-size: calc(100dvh - 2rem);
|
|
178
|
+
inset-block-start: 1rem;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
`]}render(){let t=[this.side,this.size,this.modal?`modal`:``].filter(Boolean).join(` `);return e`<dialog
|
|
182
|
+
part="dialog"
|
|
183
|
+
class=${t}
|
|
184
|
+
@transitionend=${this._onTransitionEnd}
|
|
185
|
+
>
|
|
186
|
+
<header part="header">
|
|
187
|
+
<slot name="header">${this.title}</slot>
|
|
188
|
+
</header>
|
|
189
|
+
<div part="content"><slot></slot></div>
|
|
190
|
+
<footer part="footer"><slot name="footer"></slot></footer>
|
|
191
|
+
</dialog>`}};o([r({type:Boolean,reflect:!0})],l.prototype,`open`,void 0),o([r({type:Boolean,reflect:!0})],l.prototype,`modal`,void 0),o([r({reflect:!0})],l.prototype,`side`,void 0),o([r({reflect:!0})],l.prototype,`size`,void 0),o([r({reflect:!0})],l.prototype,`title`,void 0),o([s(`dialog`)],l.prototype,`_dialog`,void 0),l=o([a(`moni-dialog`)],l);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";var s=class extends t{constructor(...e){super(...e),this.inset=`leading`}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
font-family: var(--font);
|
|
5
|
+
/* Especificación M3: grosor de 1dp, on-surface-variant para una separación sutil. */
|
|
6
|
+
block-size: 0.0625rem;
|
|
7
|
+
min-inline-size: 0;
|
|
8
|
+
background-color: var(--outline-variant);
|
|
9
|
+
border: 0;
|
|
10
|
+
margin: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Variantes de inserción. Especificación M3: 16dp desde el borde inicial. */
|
|
14
|
+
:host([inset='leading']) {
|
|
15
|
+
margin-inline-start: 1rem;
|
|
16
|
+
margin-inline-end: 0;
|
|
17
|
+
}
|
|
18
|
+
:host([inset='middle']) {
|
|
19
|
+
margin-inline: 1rem;
|
|
20
|
+
}
|
|
21
|
+
:host([inset='none']) {
|
|
22
|
+
margin-inline: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Separador vertical (la especificación M3 también define el uso vertical). */
|
|
26
|
+
:host([vertical]) {
|
|
27
|
+
inline-size: 0.0625rem;
|
|
28
|
+
block-size: auto;
|
|
29
|
+
min-block-size: 100%;
|
|
30
|
+
align-self: stretch;
|
|
31
|
+
}
|
|
32
|
+
`]}render(){return e`<slot></slot>`}};o([r({reflect:!0})],s.prototype,`inset`,void 0),s=o([a(`moni-divider`)],s);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";var s=class extends t{constructor(...e){super(...e),this.open=!1,this.title=``}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
font-family: var(--font);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
details {
|
|
8
|
+
border-radius: 0.5rem;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
summary {
|
|
13
|
+
list-style-type: none;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
padding: 0.75rem 1rem;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
gap: 0.5rem;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
color: var(--on-surface);
|
|
22
|
+
background-color: var(--surface-container);
|
|
23
|
+
}
|
|
24
|
+
summary::-webkit-details-marker {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
summary::after {
|
|
28
|
+
content: 'expand_more';
|
|
29
|
+
font-family: var(--font-icon);
|
|
30
|
+
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
31
|
+
font-size: 1.25rem;
|
|
32
|
+
transition: transform var(--speed2);
|
|
33
|
+
}
|
|
34
|
+
details[open] > summary::after {
|
|
35
|
+
transform: rotate(180deg);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.body {
|
|
39
|
+
padding: 1rem;
|
|
40
|
+
background-color: var(--surface-container-low);
|
|
41
|
+
color: var(--on-surface);
|
|
42
|
+
}
|
|
43
|
+
`]}render(){return e`<details ?open=${this.open} part="expansion">
|
|
44
|
+
<summary part="summary">
|
|
45
|
+
<slot name="summary">${this.title}</slot>
|
|
46
|
+
</summary>
|
|
47
|
+
<div class="body" part="body">
|
|
48
|
+
<slot></slot>
|
|
49
|
+
</div>
|
|
50
|
+
</details>`}};o([r({type:Boolean,reflect:!0})],s.prototype,`open`,void 0),o([r({reflect:!0})],s.prototype,`title`,void 0),s=o([a(`moni-expansion`)],s);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{a as e,d as t,i as n,m as r,o as i,r as a,s as o,t as s}from"../chunks/decorate-DxX3e27g.js";import{t as c}from"../chunks/query-SWT-tzvq.js";import"./moni-fab.js";var l=class extends n{constructor(...e){super(...e),this.open=!1,this.disabled=!1,this.icon=`add`,this.closeIcon=`close`,this.label=`Abrir acciones`,this.closeLabel=`Cerrar acciones`,this.size=`medium`,this.color=`primary`,this.shape=`rounded`,this.direction=`up`,this.position=``,this._effectiveDirection=`up`,this._crossAlign=`end`,this._actions=[],this._restoreFocus=!1,this._onDocumentPointer=e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)},this._onDocumentClick=e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)},this._onDocumentKey=e=>{if(!this.open)return;if(e.key===`Escape`){e.preventDefault(),this._restoreFocus=!0,this.open=!1;return}if(![`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=this._actions.indexOf(document.activeElement),n=e.key===`ArrowDown`||e.key===`ArrowRight`,r=e.key===`Home`?0:e.key===`End`?this._actions.length-1:(t+(n?1:-1)+this._actions.length)%this._actions.length;this._actions[r]?.focus()},this._onViewportChange=()=>this._placeMenu(),this._toggle=()=>{this.disabled||(this._restoreFocus=this.open,this.open=!this.open)},this._slotChanged=()=>{this._actions.forEach(e=>e.removeEventListener(`click`,this._selectAction)),this._actions=this._slot.assignedElements({flatten:!0}).filter(e=>e.tagName===`MONI-FAB`),this._actions.forEach((e,t)=>{e.style.setProperty(`--_fab-menu-index`,String(t)),e.setAttribute(`role`,`menuitem`),e.addEventListener(`click`,this._selectAction)}),this.open&&queueMicrotask(()=>this._placeMenu())},this._selectAction=()=>{this._restoreFocus=!0,this.open=!1}}disconnectedCallback(){this._removeGlobalListeners(),super.disconnectedCallback()}updated(e){e.has(`direction`)&&!this.open&&(this._effectiveDirection=this.direction),e.has(`open`)&&(this.dispatchEvent(new CustomEvent(`moni-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0})),this.open?(document.addEventListener(`pointerdown`,this._onDocumentPointer,!0),document.addEventListener(`click`,this._onDocumentClick,!0),document.addEventListener(`keydown`,this._onDocumentKey,!0),window.addEventListener(`resize`,this._onViewportChange),queueMicrotask(async()=>{await this._placeMenu(),this._actions[0]?.focus()})):(this._removeGlobalListeners(),this._restoreFocus&&queueMicrotask(()=>this._trigger?.focus()),this._restoreFocus=!1))}_removeGlobalListeners(){document.removeEventListener(`pointerdown`,this._onDocumentPointer,!0),document.removeEventListener(`click`,this._onDocumentClick,!0),document.removeEventListener(`keydown`,this._onDocumentKey,!0),window.removeEventListener(`resize`,this._onViewportChange)}_visibleBoundary(){let e=0,t=0,n=window.innerWidth,r=window.innerHeight,i=this.parentElement;for(;i;){let a=getComputedStyle(i);if(/(hidden|clip|auto|scroll)/.test(`${a.overflow}${a.overflowX}${a.overflowY}`)){let a=i.getBoundingClientRect();e=Math.max(e,a.left),t=Math.max(t,a.top),n=Math.min(n,a.right),r=Math.min(r,a.bottom)}i=i.parentElement}return new DOMRect(e,t,Math.max(0,n-e),Math.max(0,r-t))}async _placeMenu(){if(!this.open||!this._menu)return;let e=this._visibleBoundary(),t={left:`right`,right:`left`,up:`down`,down:`up`},n=this._trigger.getBoundingClientRect(),r=n.top-e.top>=e.bottom-n.bottom?[`up`,`down`]:[`down`,`up`],i=n.left-e.left>=e.right-n.right?[`left`,`right`]:[`right`,`left`],a=this.direction===`left`||this.direction===`right`?r:i,o=[this.direction,t[this.direction],...a].filter((e,t,n)=>n.indexOf(e)===t),s;for(let t of o){this._effectiveDirection=t,this._crossAlign=`end`,await this.updateComplete;let n=this._menu.getBoundingClientRect(),r=t===`up`||t===`down`;(r&&n.left<e.left||!r&&n.top<e.top)&&(this._crossAlign=`start`,await this.updateComplete,n=this._menu.getBoundingClientRect());let i=Math.max(0,e.left-n.left)+Math.max(0,n.right-e.right)+Math.max(0,e.top-n.top)+Math.max(0,n.bottom-e.bottom);if((!s||i<s.overflow)&&(s={direction:t,align:this._crossAlign,overflow:i}),i<=1)return}s&&(this._effectiveDirection=s.direction,this._crossAlign=s.align)}static{this.styles=[a,r`
|
|
2
|
+
:host { display: inline-flex; position: relative; vertical-align: middle; }
|
|
3
|
+
:host([position='bottom-trailing']), :host([position='bottom-leading']),
|
|
4
|
+
:host([position='top-trailing']), :host([position='top-leading']) { position: fixed; z-index: 13; }
|
|
5
|
+
:host([position='bottom-trailing']) { inset: auto max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) auto; }
|
|
6
|
+
:host([position='bottom-leading']) { inset: auto auto max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
|
|
7
|
+
:host([position='top-trailing']) { inset: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) auto auto; }
|
|
8
|
+
:host([position='top-leading']) { inset: max(1rem, env(safe-area-inset-top)) auto auto max(1rem, env(safe-area-inset-left)); }
|
|
9
|
+
|
|
10
|
+
.wrap { display: inline-grid; place-items: center; position: relative; }
|
|
11
|
+
.menu { position: absolute; display: flex; gap: .75rem; margin: 0; padding: 0; align-items: center; pointer-events: none; visibility: hidden; }
|
|
12
|
+
:host([open]) .menu { pointer-events: auto; visibility: visible; }
|
|
13
|
+
.wrap[data-direction='up'] .menu { inset-block-end: calc(100% + 1rem); flex-direction: column-reverse; }
|
|
14
|
+
.wrap[data-direction='down'] .menu { inset-block-start: calc(100% + 1rem); flex-direction: column; }
|
|
15
|
+
.wrap:is([data-direction='up'], [data-direction='down'])[data-align='end'] .menu { inset-inline-end: 0; align-items: flex-end; }
|
|
16
|
+
.wrap:is([data-direction='up'], [data-direction='down'])[data-align='start'] .menu { inset-inline-start: 0; align-items: flex-start; }
|
|
17
|
+
.wrap[data-direction='left'] .menu { inset-inline-end: calc(100% + 1rem); flex-direction: row-reverse; }
|
|
18
|
+
.wrap[data-direction='right'] .menu { inset-inline-start: calc(100% + 1rem); flex-direction: row; }
|
|
19
|
+
.wrap:is([data-direction='left'], [data-direction='right'])[data-align='end'] .menu { inset-block-end: 0; }
|
|
20
|
+
.wrap:is([data-direction='left'], [data-direction='right'])[data-align='start'] .menu { inset-block-start: 0; }
|
|
21
|
+
|
|
22
|
+
::slotted(moni-fab) {
|
|
23
|
+
opacity: 0;
|
|
24
|
+
transform: translateY(.75rem) scale(.8);
|
|
25
|
+
transform-origin: center;
|
|
26
|
+
transition: opacity 160ms ease, transform 300ms cubic-bezier(.2,0,0,1);
|
|
27
|
+
transition-delay: 0ms;
|
|
28
|
+
}
|
|
29
|
+
.wrap[data-direction='down'] ::slotted(moni-fab) { transform: translateY(-.75rem) scale(.8); }
|
|
30
|
+
.wrap[data-direction='left'] ::slotted(moni-fab) { transform: translateX(.75rem) scale(.8); }
|
|
31
|
+
.wrap[data-direction='right'] ::slotted(moni-fab) { transform: translateX(-.75rem) scale(.8); }
|
|
32
|
+
:host([open]) ::slotted(moni-fab) {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
transform: translate(0) scale(1);
|
|
35
|
+
transition-delay: calc(var(--_fab-menu-index, 0) * 45ms);
|
|
36
|
+
}
|
|
37
|
+
.trigger::part(icon) { transition: transform 300ms cubic-bezier(.2,0,0,1); }
|
|
38
|
+
:host([open]) .trigger::part(icon) { transform: rotate(90deg); }
|
|
39
|
+
@media (prefers-reduced-motion: reduce) { ::slotted(moni-fab), .trigger::part(icon) { transition-duration: .01ms; transition-delay: 0ms; } }
|
|
40
|
+
`]}render(){return t`<div class="wrap" data-direction=${this._effectiveDirection} data-align=${this._crossAlign}>
|
|
41
|
+
<div class="menu fab-menu" part="menu" role="menu" aria-hidden=${String(!this.open)}>
|
|
42
|
+
<slot @slotchange=${this._slotChanged}></slot>
|
|
43
|
+
</div>
|
|
44
|
+
<moni-fab
|
|
45
|
+
class="trigger"
|
|
46
|
+
part="trigger"
|
|
47
|
+
.icon=${this.open?this.closeIcon:this.icon}
|
|
48
|
+
.size=${this.size}
|
|
49
|
+
.color=${this.color}
|
|
50
|
+
.shape=${this.shape}
|
|
51
|
+
.disabled=${this.disabled}
|
|
52
|
+
.accessibleLabel=${this.open?this.closeLabel:this.label}
|
|
53
|
+
aria-haspopup="menu"
|
|
54
|
+
aria-expanded=${String(this.open)}
|
|
55
|
+
@click=${this._toggle}
|
|
56
|
+
></moni-fab>
|
|
57
|
+
</div>`}};s([i({type:Boolean,reflect:!0})],l.prototype,`open`,void 0),s([i({type:Boolean,reflect:!0})],l.prototype,`disabled`,void 0),s([i({reflect:!0})],l.prototype,`icon`,void 0),s([i({reflect:!0,attribute:`close-icon`})],l.prototype,`closeIcon`,void 0),s([i({reflect:!0})],l.prototype,`label`,void 0),s([i({reflect:!0,attribute:`close-label`})],l.prototype,`closeLabel`,void 0),s([i({reflect:!0})],l.prototype,`size`,void 0),s([i({reflect:!0})],l.prototype,`color`,void 0),s([i({reflect:!0})],l.prototype,`shape`,void 0),s([i({reflect:!0})],l.prototype,`direction`,void 0),s([i({reflect:!0})],l.prototype,`position`,void 0),s([c(`.trigger`)],l.prototype,`_trigger`,void 0),s([c(`slot`)],l.prototype,`_slot`,void 0),s([c(`.menu`)],l.prototype,`_menu`,void 0),s([e()],l.prototype,`_effectiveDirection`,void 0),s([e()],l.prototype,`_crossAlign`,void 0),l=s([o(`moni-fab-menu`)],l);
|