@penwin/discord-components-core 4.2.1 → 4.3.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/custom-elements.json +2136 -362
- package/dist/bundle/index.mjs +1676 -1152
- package/dist/bundle/index.mjs.map +1 -1
- package/dist/components/_private/BaseDiscordSelectMenuOption.d.ts +12 -0
- package/dist/components/_private/BaseDiscordSelectMenuOption.d.ts.map +1 -0
- package/dist/components/_private/BaseDiscordSelectMenuOption.js +121 -0
- package/dist/components/_private/BaseDiscordSelectMenuOption.js.map +1 -0
- package/dist/components/discord-author-info/DiscordAuthorInfo.js +1 -1
- package/dist/components/discord-channel-select-menu-option/DiscordChannelSelectMenuOption.d.ts +29 -0
- package/dist/components/discord-channel-select-menu-option/DiscordChannelSelectMenuOption.d.ts.map +1 -0
- package/dist/components/discord-channel-select-menu-option/DiscordChannelSelectMenuOption.js +213 -0
- package/dist/components/discord-channel-select-menu-option/DiscordChannelSelectMenuOption.js.map +1 -0
- package/dist/components/discord-custom-emoji/DiscordCustomEmoji.js +2 -2
- package/dist/components/discord-embed/DiscordEmbed.d.ts +2 -0
- package/dist/components/discord-embed/DiscordEmbed.d.ts.map +1 -1
- package/dist/components/discord-embed/DiscordEmbed.js +54 -8
- package/dist/components/discord-embed/DiscordEmbed.js.map +1 -1
- package/dist/components/discord-embed-description/DiscordEmbedDescription.d.ts.map +1 -1
- package/dist/components/discord-embed-description/DiscordEmbedDescription.js +4 -0
- package/dist/components/discord-embed-description/DiscordEmbedDescription.js.map +1 -1
- package/dist/components/discord-forwarded-message/DiscordForwardedMessage.d.ts +2 -2
- package/dist/components/discord-forwarded-message/DiscordForwardedMessage.d.ts.map +1 -1
- package/dist/components/discord-forwarded-message/DiscordForwardedMessage.js +4 -29
- package/dist/components/discord-forwarded-message/DiscordForwardedMessage.js.map +1 -1
- package/dist/components/discord-header/DiscordHeader.js +3 -3
- package/dist/components/discord-media-fullscreen-previewer/DiscordMediaFullscreenPreviewer.d.ts +7 -6
- package/dist/components/discord-media-fullscreen-previewer/DiscordMediaFullscreenPreviewer.d.ts.map +1 -1
- package/dist/components/discord-media-fullscreen-previewer/DiscordMediaFullscreenPreviewer.js +42 -13
- package/dist/components/discord-media-fullscreen-previewer/DiscordMediaFullscreenPreviewer.js.map +1 -1
- package/dist/components/discord-media-gallery/DiscordMediaGallery.d.ts +4 -4
- package/dist/components/discord-media-gallery/DiscordMediaGallery.d.ts.map +1 -1
- package/dist/components/discord-media-gallery/DiscordMediaGallery.js +2 -5
- package/dist/components/discord-media-gallery/DiscordMediaGallery.js.map +1 -1
- package/dist/components/discord-media-gallery-item/DiscordMediaGalleryItem.d.ts +4 -2
- package/dist/components/discord-media-gallery-item/DiscordMediaGalleryItem.d.ts.map +1 -1
- package/dist/components/discord-media-gallery-item/DiscordMediaGalleryItem.js +39 -8
- package/dist/components/discord-media-gallery-item/DiscordMediaGalleryItem.js.map +1 -1
- package/dist/components/discord-mentionable-select-menu/DiscordMentionableSelectMenu.d.ts +10 -0
- package/dist/components/discord-mentionable-select-menu/DiscordMentionableSelectMenu.d.ts.map +1 -0
- package/dist/components/discord-mentionable-select-menu/DiscordMentionableSelectMenu.js +19 -0
- package/dist/components/discord-mentionable-select-menu/DiscordMentionableSelectMenu.js.map +1 -0
- package/dist/components/discord-message/DiscordMessage.d.ts.map +1 -1
- package/dist/components/discord-message/DiscordMessage.js +13 -2
- package/dist/components/discord-message/DiscordMessage.js.map +1 -1
- package/dist/components/discord-role-select-menu-option/DiscordRoleSelectMenuOption.d.ts +29 -0
- package/dist/components/discord-role-select-menu-option/DiscordRoleSelectMenuOption.d.ts.map +1 -0
- package/dist/components/discord-role-select-menu-option/DiscordRoleSelectMenuOption.js +141 -0
- package/dist/components/discord-role-select-menu-option/DiscordRoleSelectMenuOption.js.map +1 -0
- package/dist/components/discord-select-menu-portal/DiscordSelectMenuPortal.d.ts +13 -0
- package/dist/components/discord-select-menu-portal/DiscordSelectMenuPortal.d.ts.map +1 -0
- package/dist/components/discord-select-menu-portal/DiscordSelectMenuPortal.js +79 -0
- package/dist/components/discord-select-menu-portal/DiscordSelectMenuPortal.js.map +1 -0
- package/dist/components/discord-string-select-menu/DiscordStringSelectMenu.d.ts +16 -1
- package/dist/components/discord-string-select-menu/DiscordStringSelectMenu.d.ts.map +1 -1
- package/dist/components/discord-string-select-menu/DiscordStringSelectMenu.js +210 -29
- package/dist/components/discord-string-select-menu/DiscordStringSelectMenu.js.map +1 -1
- package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.d.ts +4 -6
- package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.d.ts.map +1 -1
- package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.js +44 -60
- package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.js.map +1 -1
- package/dist/components/discord-thumbnail/DiscordThumbnail.d.ts +1 -0
- package/dist/components/discord-thumbnail/DiscordThumbnail.d.ts.map +1 -1
- package/dist/components/discord-thumbnail/DiscordThumbnail.js +17 -4
- package/dist/components/discord-thumbnail/DiscordThumbnail.js.map +1 -1
- package/dist/components/discord-user-select-menu-option/DiscordUserSelectMenuOption.d.ts +31 -0
- package/dist/components/discord-user-select-menu-option/DiscordUserSelectMenuOption.d.ts.map +1 -0
- package/dist/components/discord-user-select-menu-option/DiscordUserSelectMenuOption.js +129 -0
- package/dist/components/discord-user-select-menu-option/DiscordUserSelectMenuOption.js.map +1 -0
- package/dist/components/discord-video-attachment/DiscordVideoAttachment.d.ts +2 -0
- package/dist/components/discord-video-attachment/DiscordVideoAttachment.d.ts.map +1 -1
- package/dist/components/discord-video-attachment/DiscordVideoAttachment.js +38 -6
- package/dist/components/discord-video-attachment/DiscordVideoAttachment.js.map +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/util.d.ts +1 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +48 -0
- package/dist/util.js.map +1 -1
- package/package.json +15 -4
|
@@ -7,27 +7,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
var DiscordStringSelectMenu_1;
|
|
11
|
+
/* eslint-disable lit-a11y/click-events-have-key-events */
|
|
10
12
|
import { consume } from '@lit/context';
|
|
11
13
|
import { css, html, LitElement } from 'lit';
|
|
12
|
-
import { customElement, eventOptions, property } from 'lit/decorators.js';
|
|
14
|
+
import { customElement, eventOptions, property, state } from 'lit/decorators.js';
|
|
13
15
|
import { classMap } from 'lit/directives/class-map.js';
|
|
16
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
17
|
+
import { when } from 'lit/directives/when.js';
|
|
14
18
|
import { messagesLightTheme } from '../discord-messages/DiscordMessages.js';
|
|
15
19
|
import ExpandMore from '../svgs/ExpandMore.js';
|
|
20
|
+
import ModalClose from '../svgs/ModalClose.js';
|
|
16
21
|
let DiscordStringSelectMenu = class DiscordStringSelectMenu extends LitElement {
|
|
17
|
-
|
|
18
|
-
super(...arguments);
|
|
19
|
-
/**
|
|
20
|
-
* The placeholder of the select-menu
|
|
21
|
-
*/
|
|
22
|
-
this.placeholder = 'Make a selection';
|
|
23
|
-
this.lightTheme = false;
|
|
24
|
-
}
|
|
22
|
+
static { DiscordStringSelectMenu_1 = this; }
|
|
25
23
|
/**
|
|
26
24
|
* @internal
|
|
27
25
|
*/
|
|
28
26
|
static { this.styles = css `
|
|
29
27
|
.discord-string-select-menu {
|
|
30
|
-
height:
|
|
28
|
+
height: 46px;
|
|
31
29
|
min-height: 36px;
|
|
32
30
|
display: flex;
|
|
33
31
|
align-items: center;
|
|
@@ -36,9 +34,9 @@ let DiscordStringSelectMenu = class DiscordStringSelectMenu extends LitElement {
|
|
|
36
34
|
cursor: pointer;
|
|
37
35
|
color: color-mix(in oklab, hsl(210 calc(1 * 9.1%) 87.1% / 1) 100%, black 0%);
|
|
38
36
|
border: 1px solid;
|
|
39
|
-
border-radius:
|
|
40
|
-
background-color:
|
|
41
|
-
border-color:
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
background-color: #28292e;
|
|
39
|
+
border-color: #3e3f44;
|
|
42
40
|
padding: 8px !important;
|
|
43
41
|
width: 90%;
|
|
44
42
|
max-width: 400px;
|
|
@@ -47,6 +45,10 @@ let DiscordStringSelectMenu = class DiscordStringSelectMenu extends LitElement {
|
|
|
47
45
|
font-weight: 500;
|
|
48
46
|
}
|
|
49
47
|
|
|
48
|
+
:host {
|
|
49
|
+
user-select: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
50
52
|
:host([light-theme]) .discord-string-select-menu {
|
|
51
53
|
background-color: #ebebeb !important;
|
|
52
54
|
border-color: #b5b5b5 !important;
|
|
@@ -62,17 +64,16 @@ let DiscordStringSelectMenu = class DiscordStringSelectMenu extends LitElement {
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
.discord-string-select-menu-option-slot {
|
|
67
|
+
margin-top: 4px;
|
|
65
68
|
overflow-y: auto;
|
|
66
69
|
overflow-x: hidden;
|
|
67
70
|
color: currentColor;
|
|
68
|
-
border:
|
|
69
|
-
border-
|
|
70
|
-
border-
|
|
71
|
-
|
|
72
|
-
background-color: color-mix(in oklab, hsl(220 calc(1 * 6.5%) 18% / 1) 100%, black 0%);
|
|
71
|
+
border: 1px solid;
|
|
72
|
+
border-radius: 8px;
|
|
73
|
+
border-color: #474850;
|
|
74
|
+
background-color: #3c3d45;
|
|
73
75
|
cursor: pointer;
|
|
74
76
|
box-sizing: border-box;
|
|
75
|
-
border-radius: 4px;
|
|
76
77
|
gap: 10px;
|
|
77
78
|
display: block;
|
|
78
79
|
max-height: 190px;
|
|
@@ -128,35 +129,202 @@ let DiscordStringSelectMenu = class DiscordStringSelectMenu extends LitElement {
|
|
|
128
129
|
.discord-expand-more-icon {
|
|
129
130
|
margin-left: auto;
|
|
130
131
|
}
|
|
132
|
+
|
|
133
|
+
.discord-clear-input-button {
|
|
134
|
+
appearance: none;
|
|
135
|
+
border: none;
|
|
136
|
+
height: 16px;
|
|
137
|
+
outline: none;
|
|
138
|
+
background-color: transparent;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
padding: 0;
|
|
141
|
+
margin: 0;
|
|
142
|
+
color: currentColor;
|
|
143
|
+
svg {
|
|
144
|
+
width: 16px;
|
|
145
|
+
height: 16px;
|
|
146
|
+
fill: currentColor;
|
|
147
|
+
path {
|
|
148
|
+
fill: currentColor;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.discord-buttons-container {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: 4px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.search-input {
|
|
160
|
+
flex: 1;
|
|
161
|
+
border: none;
|
|
162
|
+
outline: none;
|
|
163
|
+
background-color: transparent;
|
|
164
|
+
color: currentColor;
|
|
165
|
+
appearance: none;
|
|
166
|
+
font-size: 16px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
center {
|
|
170
|
+
height: 46px;
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: center;
|
|
174
|
+
}
|
|
131
175
|
`; }
|
|
176
|
+
constructor() {
|
|
177
|
+
super();
|
|
178
|
+
this.withSearch = false;
|
|
179
|
+
/**
|
|
180
|
+
* The placeholder of the select-menu
|
|
181
|
+
*/
|
|
182
|
+
this.placeholder = 'Make a selection';
|
|
183
|
+
this.lightTheme = false;
|
|
184
|
+
this.noResultsFound = false;
|
|
185
|
+
this.isSearching = false;
|
|
186
|
+
this.inputRef = createRef();
|
|
187
|
+
this.handleWindowClickOutsideEvent = this.handleWindowClickOutsideEvent.bind(this);
|
|
188
|
+
}
|
|
189
|
+
selectOption(selectedOption) {
|
|
190
|
+
const node = selectedOption?.cloneNode(true);
|
|
191
|
+
if (node) {
|
|
192
|
+
node.slot = 'default';
|
|
193
|
+
node.selected = false;
|
|
194
|
+
this.append(node);
|
|
195
|
+
this.doVisibleAllOptions();
|
|
196
|
+
}
|
|
197
|
+
this.__previousSelectedNode?.remove();
|
|
198
|
+
this.__previousSelectedNode = node;
|
|
199
|
+
if (!this.options)
|
|
200
|
+
return;
|
|
201
|
+
for (const option of this.options) {
|
|
202
|
+
if (option === selectedOption)
|
|
203
|
+
option.selected = true;
|
|
204
|
+
else
|
|
205
|
+
option.selected = false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
connectedCallback() {
|
|
209
|
+
super.connectedCallback();
|
|
210
|
+
this.options = this.querySelectorAll('discord-string-select-menu-option, discord-user-select-menu-option, discord-role-select-menu-option, discord-channel-select-menu-option');
|
|
211
|
+
for (const option of this.options) {
|
|
212
|
+
if (option.selected) {
|
|
213
|
+
this.selectOption(option);
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
this.doVisibleAllOptions();
|
|
218
|
+
}
|
|
219
|
+
handleInput(input) {
|
|
220
|
+
const search = input.toLowerCase();
|
|
221
|
+
this.isSearching = search.trim().length > 0;
|
|
222
|
+
if (!this.options)
|
|
223
|
+
return;
|
|
224
|
+
let visibleOptions = 0;
|
|
225
|
+
for (const option of this.options) {
|
|
226
|
+
option.visible = option.filter(search);
|
|
227
|
+
if (option.visible)
|
|
228
|
+
visibleOptions++;
|
|
229
|
+
}
|
|
230
|
+
this.noResultsFound = visibleOptions === 0;
|
|
231
|
+
}
|
|
232
|
+
doVisibleAllOptions() {
|
|
233
|
+
if (!this.options)
|
|
234
|
+
return;
|
|
235
|
+
for (const option of this.options) {
|
|
236
|
+
option.visible = true;
|
|
237
|
+
}
|
|
238
|
+
this.noResultsFound = false;
|
|
239
|
+
}
|
|
132
240
|
render() {
|
|
133
241
|
return html `
|
|
134
242
|
<label
|
|
243
|
+
for="label-target"
|
|
135
244
|
class="${classMap({
|
|
136
245
|
'discord-string-select-menu-label': true,
|
|
137
246
|
'discord-string-select-menu': true,
|
|
138
247
|
'discord-string-select-menu-disabled': this.disabled
|
|
139
248
|
})}"
|
|
249
|
+
@click=${(event) => event.stopPropagation()}
|
|
140
250
|
>
|
|
141
|
-
<
|
|
142
|
-
|
|
251
|
+
<slot name="default">
|
|
252
|
+
${when(this.withSearch, () => html `<input
|
|
253
|
+
${ref(this.inputRef)}
|
|
254
|
+
class="search-input"
|
|
255
|
+
id=${this.__previousSelectedNode ? 'search-input' : 'label-target'}
|
|
256
|
+
type="text"
|
|
257
|
+
spellcheck="false"
|
|
258
|
+
autocomplete="off"
|
|
259
|
+
placeholder=${this.placeholder}
|
|
260
|
+
@focus=${() => this.openOptions(true)}
|
|
261
|
+
@input=${(event) => this.handleInput(event.target.value)}
|
|
262
|
+
/>`, () => html `<span>${this.placeholder}</span>`)}
|
|
263
|
+
</slot>
|
|
264
|
+
<div class="discord-buttons-container">
|
|
265
|
+
${when(this.__previousSelectedNode ?? (this.withSearch && this.isSearching), () => html `<button
|
|
266
|
+
class="discord-clear-input-button"
|
|
267
|
+
@click=${(event) => {
|
|
268
|
+
event.stopPropagation();
|
|
269
|
+
if (this.__previousSelectedNode) {
|
|
270
|
+
this.selectOption(void 0);
|
|
271
|
+
}
|
|
272
|
+
else if (this.inputRef.value) {
|
|
273
|
+
this.inputRef.value.value = '';
|
|
274
|
+
this.handleInput('');
|
|
275
|
+
}
|
|
276
|
+
}}
|
|
277
|
+
>
|
|
278
|
+
${ModalClose()}
|
|
279
|
+
</button>`)}
|
|
280
|
+
${ExpandMore({ class: 'discord-expand-more-icon' })}
|
|
281
|
+
</div>
|
|
282
|
+
<span class="discord-string-select-menu-hidden"
|
|
283
|
+
><input
|
|
284
|
+
id=${this.withSearch && !this.__previousSelectedNode ? 'clear-input' : 'label-target'}
|
|
285
|
+
type="checkbox"
|
|
286
|
+
@click=${() => this.openOptions()}
|
|
287
|
+
/></span>
|
|
143
288
|
</label>
|
|
144
|
-
<div class="discord-string-select-menu-option-slot discord-string-select-menu-hidden"
|
|
289
|
+
<div class="discord-string-select-menu-option-slot discord-string-select-menu-hidden">
|
|
290
|
+
<slot></slot>
|
|
291
|
+
${when(this.noResultsFound, () => html `<center>No results found</center>`)}
|
|
292
|
+
</div>
|
|
145
293
|
`;
|
|
146
294
|
}
|
|
147
|
-
|
|
295
|
+
handleWindowClickOutsideEvent() {
|
|
296
|
+
this.openOptions(false);
|
|
297
|
+
window.removeEventListener('click', this.handleWindowClickOutsideEvent);
|
|
298
|
+
}
|
|
299
|
+
disconnectedCallback() {
|
|
300
|
+
super.disconnectedCallback();
|
|
301
|
+
window.removeEventListener('click', this.handleWindowClickOutsideEvent);
|
|
302
|
+
}
|
|
303
|
+
openOptions(open) {
|
|
304
|
+
window.removeEventListener('click', this.handleWindowClickOutsideEvent);
|
|
148
305
|
const expandMoreIcon = this.shadowRoot?.querySelectorAll('svg.discord-expand-more-icon').item(0);
|
|
149
306
|
const optionsMenu = this.shadowRoot?.querySelectorAll('div.discord-string-select-menu-option-slot').item(0);
|
|
150
307
|
const stringSelectMenu = this.shadowRoot?.querySelectorAll('label.discord-string-select-menu').item(0);
|
|
151
308
|
if (stringSelectMenu?.className.includes('discord-string-select-menu-disabled'))
|
|
152
309
|
return;
|
|
153
|
-
|
|
310
|
+
const isForceOpen = open === true;
|
|
311
|
+
const isForceClosed = open === false;
|
|
312
|
+
const isClosed = optionsMenu?.className.includes('discord-string-select-menu-hidden');
|
|
313
|
+
if (isClosed || isForceOpen) {
|
|
154
314
|
optionsMenu?.setAttribute('class', 'discord-string-select-menu-option-slot');
|
|
155
315
|
expandMoreIcon?.setAttribute('class', 'discord-expand-more-icon discord-string-select-menu-rotated');
|
|
316
|
+
window.addEventListener('click', this.handleWindowClickOutsideEvent);
|
|
317
|
+
if (DiscordStringSelectMenu_1.currentOpenInstance && DiscordStringSelectMenu_1.currentOpenInstance !== this) {
|
|
318
|
+
DiscordStringSelectMenu_1.currentOpenInstance.openOptions(false);
|
|
319
|
+
}
|
|
320
|
+
DiscordStringSelectMenu_1.currentOpenInstance = this;
|
|
156
321
|
}
|
|
157
|
-
else {
|
|
322
|
+
else if (!isClosed || isForceClosed) {
|
|
158
323
|
optionsMenu?.setAttribute('class', 'discord-string-select-menu-option-slot discord-string-select-menu-hidden');
|
|
159
324
|
expandMoreIcon?.setAttribute('class', 'discord-expand-more-icon');
|
|
325
|
+
if (DiscordStringSelectMenu_1.currentOpenInstance === this) {
|
|
326
|
+
DiscordStringSelectMenu_1.currentOpenInstance = void 0;
|
|
327
|
+
}
|
|
160
328
|
}
|
|
161
329
|
}
|
|
162
330
|
};
|
|
@@ -173,14 +341,27 @@ __decorate([
|
|
|
173
341
|
property({ type: Boolean, reflect: true, attribute: 'light-theme' }),
|
|
174
342
|
__metadata("design:type", Object)
|
|
175
343
|
], DiscordStringSelectMenu.prototype, "lightTheme", void 0);
|
|
344
|
+
__decorate([
|
|
345
|
+
state(),
|
|
346
|
+
__metadata("design:type", Function)
|
|
347
|
+
], DiscordStringSelectMenu.prototype, "__previousSelectedNode", void 0);
|
|
348
|
+
__decorate([
|
|
349
|
+
state(),
|
|
350
|
+
__metadata("design:type", Object)
|
|
351
|
+
], DiscordStringSelectMenu.prototype, "noResultsFound", void 0);
|
|
352
|
+
__decorate([
|
|
353
|
+
state(),
|
|
354
|
+
__metadata("design:type", Object)
|
|
355
|
+
], DiscordStringSelectMenu.prototype, "isSearching", void 0);
|
|
176
356
|
__decorate([
|
|
177
357
|
eventOptions({ once: false, capture: true, passive: true }),
|
|
178
358
|
__metadata("design:type", Function),
|
|
179
|
-
__metadata("design:paramtypes", []),
|
|
359
|
+
__metadata("design:paramtypes", [Boolean]),
|
|
180
360
|
__metadata("design:returntype", void 0)
|
|
181
|
-
], DiscordStringSelectMenu.prototype, "
|
|
182
|
-
DiscordStringSelectMenu = __decorate([
|
|
183
|
-
customElement('discord-string-select-menu')
|
|
361
|
+
], DiscordStringSelectMenu.prototype, "openOptions", null);
|
|
362
|
+
DiscordStringSelectMenu = DiscordStringSelectMenu_1 = __decorate([
|
|
363
|
+
customElement('discord-string-select-menu'),
|
|
364
|
+
__metadata("design:paramtypes", [])
|
|
184
365
|
], DiscordStringSelectMenu);
|
|
185
366
|
export { DiscordStringSelectMenu };
|
|
186
367
|
//# sourceMappingURL=DiscordStringSelectMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordStringSelectMenu.js","sourceRoot":"","sources":["../../../src/components/discord-string-select-menu/DiscordStringSelectMenu.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiscordStringSelectMenu.js","sourceRoot":"","sources":["../../../src/components/discord-string-select-menu/DiscordStringSelectMenu.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,0DAA0D;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAGxC,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAU;;IACtD;;OAEG;aAC6B,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,IAAI,EAAE,CAAC;;;;0DA8B3D;AAnWW,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;;GAC/B,uBAAuB,CAoWnC"}
|
package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare class DiscordStringSelectMenuOption extends LitElement implements LightTheme {
|
|
1
|
+
import { BaseDiscordSelectMenuOption } from '../_private/BaseDiscordSelectMenuOption.js';
|
|
2
|
+
export declare class DiscordStringSelectMenuOption extends BaseDiscordSelectMenuOption {
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
6
5
|
*/
|
|
7
|
-
static readonly styles: import("lit").CSSResult;
|
|
6
|
+
static readonly styles: import("lit").CSSResult[];
|
|
8
7
|
/**
|
|
9
8
|
* The emoji URL to use in the SelectMenu.
|
|
10
9
|
*/
|
|
@@ -21,9 +20,8 @@ export declare class DiscordStringSelectMenuOption extends LitElement implements
|
|
|
21
20
|
* The description of the option
|
|
22
21
|
*/
|
|
23
22
|
description: string;
|
|
24
|
-
selectOption: (...args: unknown[]) => void;
|
|
25
23
|
checkLabelIsProvided(): void;
|
|
26
|
-
|
|
24
|
+
filter(searchValue: string): boolean;
|
|
27
25
|
protected render(): import("lit").TemplateResult<1>;
|
|
28
26
|
}
|
|
29
27
|
declare global {
|
package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordStringSelectMenuOption.d.ts","sourceRoot":"","sources":["../../../src/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiscordStringSelectMenuOption.d.ts","sourceRoot":"","sources":["../../../src/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF,qBACa,6BAA8B,SAAQ,2BAA2B;IAC7E;;OAEG;IACH,gBAAgC,MAAM,4BA+BpC;IAEF;;OAEG;IAEI,KAAK,EAAE,MAAM,CAAC;IAErB;;OAEG;IAEI,SAAS,SAAW;IAE3B;;OAEG;IAEI,KAAK,EAAE,MAAM,CAAC;IAErB;;OAEG;IAEI,WAAW,EAAE,MAAM,CAAC;IAEpB,oBAAoB;IAMpB,MAAM,CAAC,WAAW,EAAE,MAAM;cAKd,MAAM;CA+BzB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mCAAmC,EAAE,6BAA6B,CAAC;KACnE;CACD"}
|
|
@@ -7,73 +7,65 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { css, html, LitElement } from 'lit';
|
|
10
|
+
import { css, html } from 'lit';
|
|
12
11
|
import { customElement, property } from 'lit/decorators.js';
|
|
13
12
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
14
13
|
import { when } from 'lit/directives/when.js';
|
|
15
14
|
import { DiscordComponentsError } from '../../util.js';
|
|
16
|
-
import {
|
|
17
|
-
let DiscordStringSelectMenuOption = class DiscordStringSelectMenuOption extends
|
|
15
|
+
import { BaseDiscordSelectMenuOption } from '../_private/BaseDiscordSelectMenuOption.js';
|
|
16
|
+
let DiscordStringSelectMenuOption = class DiscordStringSelectMenuOption extends BaseDiscordSelectMenuOption {
|
|
18
17
|
constructor() {
|
|
19
18
|
super(...arguments);
|
|
20
19
|
/**
|
|
21
20
|
* The name of the emoji used in the SelectMenu.
|
|
22
21
|
*/
|
|
23
22
|
this.emojiName = 'emoji';
|
|
24
|
-
this.lightTheme = false;
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* @internal
|
|
28
26
|
*/
|
|
29
|
-
static { this.styles =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
padding: 8px 8px 8px 12px;
|
|
35
|
-
gap: 10px;
|
|
36
|
-
font-size: small;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
}
|
|
27
|
+
static { this.styles = [
|
|
28
|
+
css `
|
|
29
|
+
label {
|
|
30
|
+
padding: 8px 8px 8px 12px !important;
|
|
31
|
+
}
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
.discord-string-select-menu-option-emoji {
|
|
34
|
+
margin-right: 4px;
|
|
35
|
+
object-fit: contain;
|
|
36
|
+
width: 1.375em;
|
|
37
|
+
height: 1.375em;
|
|
38
|
+
vertical-align: bottom;
|
|
39
|
+
}
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
.discord-string-select-menu-option-ellipsis-text {
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
}
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
.discord-string-select-menu-option-hidden {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.discord-string-select-menu-option-ellipsis-text {
|
|
63
|
-
overflow: hidden;
|
|
64
|
-
text-overflow: ellipsis;
|
|
65
|
-
white-space: nowrap;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.discord-string-select-menu-option-hidden {
|
|
69
|
-
display: none;
|
|
70
|
-
}
|
|
71
|
-
`; }
|
|
51
|
+
:host([slot='default']) {
|
|
52
|
+
.discord-string-select-menu-option-description {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`,
|
|
57
|
+
BaseDiscordSelectMenuOption.baseStyles
|
|
58
|
+
]; }
|
|
72
59
|
checkLabelIsProvided() {
|
|
73
60
|
if (!this.label) {
|
|
74
61
|
throw new DiscordComponentsError('The label of option is required');
|
|
75
62
|
}
|
|
76
63
|
}
|
|
64
|
+
filter(searchValue) {
|
|
65
|
+
if (this.label.toLowerCase().includes(searchValue))
|
|
66
|
+
return true;
|
|
67
|
+
return this.description?.toLowerCase().includes(searchValue);
|
|
68
|
+
}
|
|
77
69
|
render() {
|
|
78
70
|
this.checkLabelIsProvided();
|
|
79
71
|
return html `
|
|
@@ -84,13 +76,14 @@ let DiscordStringSelectMenuOption = class DiscordStringSelectMenuOption extends
|
|
|
84
76
|
draggable="true"
|
|
85
77
|
class="discord-string-select-menu-option-emoji"
|
|
86
78
|
/>`, () => html `<span class="discord-string-select-menu-option-emoji">${this.emoji}</span>`))}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
${this.renderSelectedContainer(html `<div class="discord-string-select-menu-option-ellipsis-text">
|
|
80
|
+
<div class="discord-string-select-menu-option-ellipsis-text">
|
|
81
|
+
<strong>${this.label}</strong>
|
|
82
|
+
</div>
|
|
83
|
+
${when(this.description, () => html `<span class="discord-string-select-menu-option-description">${this.description}</span>`)}
|
|
84
|
+
</div>`)}
|
|
85
|
+
|
|
86
|
+
<span class="discord-string-select-menu-option-hidden"><input type="checkbox" @click=${this.selectOption} /></span>
|
|
94
87
|
</label>
|
|
95
88
|
`;
|
|
96
89
|
}
|
|
@@ -111,15 +104,6 @@ __decorate([
|
|
|
111
104
|
property({ attribute: 'description' }),
|
|
112
105
|
__metadata("design:type", String)
|
|
113
106
|
], DiscordStringSelectMenuOption.prototype, "description", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
property({ reflect: false, noAccessor: true, attribute: false }),
|
|
116
|
-
__metadata("design:type", Function)
|
|
117
|
-
], DiscordStringSelectMenuOption.prototype, "selectOption", void 0);
|
|
118
|
-
__decorate([
|
|
119
|
-
consume({ context: messagesLightTheme }),
|
|
120
|
-
property({ type: Boolean, reflect: true, attribute: 'light-theme' }),
|
|
121
|
-
__metadata("design:type", Object)
|
|
122
|
-
], DiscordStringSelectMenuOption.prototype, "lightTheme", void 0);
|
|
123
107
|
DiscordStringSelectMenuOption = __decorate([
|
|
124
108
|
customElement('discord-string-select-menu-option')
|
|
125
109
|
], DiscordStringSelectMenuOption);
|
package/dist/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordStringSelectMenuOption.js","sourceRoot":"","sources":["../../../src/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DiscordStringSelectMenuOption.js","sourceRoot":"","sources":["../../../src/components/discord-string-select-menu-option/DiscordStringSelectMenuOption.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAGlF,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,2BAA2B;IAAvE;;QA2CN;;WAEG;QAEI,cAAS,GAAG,OAAO,CAAC;IAwD5B,CAAC;IAtGA;;OAEG;aAC6B,WAAM,GAAG;QACxC,GAAG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AC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;;4DAC3B;AAMd;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;;gEAC1B;AAMpB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;;4DACZ;AAMd;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;;kEACZ;AA3Df,6BAA6B;IADzC,aAAa,CAAC,mCAAmC,CAAC;GACtC,6BAA6B,CAuGzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordThumbnail.d.ts","sourceRoot":"","sources":["../../../src/components/discord-thumbnail/DiscordThumbnail.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiscordThumbnail.d.ts","sourceRoot":"","sources":["../../../src/components/discord-thumbnail/DiscordThumbnail.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,+CAA+C,CAAC;AAGvD,qBACa,gBAAiB,SAAQ,UAAU;IAC/C;;OAEG;IACH,gBAAgC,MAAM,4BAcpC;IAGK,KAAK,EAAE,MAAM,CAAC;IAGd,WAAW,EAAE,MAAM,CAAC;IAGpB,OAAO,UAAS;IAGvB,OAAO,CAAC,MAAM,CAAS;cAEJ,MAAM;CAYzB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,gBAAgB,CAAC;KACtC;CACD"}
|
|
@@ -7,14 +7,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
/* eslint-disable lit-a11y/click-events-have-key-events */
|
|
10
11
|
import { css, html, LitElement } from 'lit';
|
|
11
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
12
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
12
13
|
import '../discord-custom-emoji/DiscordCustomEmoji.js';
|
|
13
14
|
import { DiscordMediaSpoileableCover } from '../discord-media-spoileable-cover/DiscordMediaSpoileableCover.js';
|
|
14
15
|
let DiscordThumbnail = class DiscordThumbnail extends LitElement {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments);
|
|
17
18
|
this.spoiler = false;
|
|
19
|
+
this.isOpen = false;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* @internal
|
|
@@ -28,15 +30,22 @@ let DiscordThumbnail = class DiscordThumbnail extends LitElement {
|
|
|
28
30
|
border-radius: 8px;
|
|
29
31
|
overflow: hidden;
|
|
30
32
|
}
|
|
33
|
+
img {
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
31
36
|
`,
|
|
32
37
|
DiscordMediaSpoileableCover.hostStyles
|
|
33
38
|
]; }
|
|
34
39
|
render() {
|
|
35
40
|
return html `
|
|
36
41
|
${DiscordMediaSpoileableCover.inject(this.spoiler)}
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
<img src=${this.media} alt="Thumbnail" width="85" height="85" draggable="false" @click=${() => (this.isOpen = true)} />
|
|
43
|
+
<discord-media-fullscreen-previewer
|
|
44
|
+
@close-full-screen=${() => (this.isOpen = false)}
|
|
45
|
+
.currentSlot=${0}
|
|
46
|
+
.isOpen=${this.isOpen}
|
|
47
|
+
.mediaItems=${[{ height: 85, media: this.media, mimeType: 'image', width: 85 }]}
|
|
48
|
+
></discord-media-fullscreen-previewer>
|
|
40
49
|
`;
|
|
41
50
|
}
|
|
42
51
|
};
|
|
@@ -52,6 +61,10 @@ __decorate([
|
|
|
52
61
|
property({ type: Boolean, reflect: true }),
|
|
53
62
|
__metadata("design:type", Object)
|
|
54
63
|
], DiscordThumbnail.prototype, "spoiler", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
state(),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], DiscordThumbnail.prototype, "isOpen", void 0);
|
|
55
68
|
DiscordThumbnail = __decorate([
|
|
56
69
|
customElement('discord-thumbnail')
|
|
57
70
|
], DiscordThumbnail);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordThumbnail.js","sourceRoot":"","sources":["../../../src/components/discord-thumbnail/DiscordThumbnail.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DiscordThumbnail.js","sourceRoot":"","sources":["../../../src/components/discord-thumbnail/DiscordThumbnail.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0DAA0D;AAC1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,+CAA+C,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kEAAkE,CAAC;AAGxG,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QA2BC,YAAO,GAAG,KAAK,CAAC;QAGf,WAAM,GAAG,KAAK,CAAC;IAcxB,CAAC;IA3CA;;OAEG;aAC6B,WAAM,GAAG;QACxC,GAAG,CAAA;;;;;;;;;;;GAWF;QACD,2BAA2B,CAAC,UAAU;KACtC,AAdqC,CAcpC;IAciB,MAAM;QACxB,OAAO,IAAI,CAAA;KACR,2BAA2B,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;cACvC,IAAI,CAAC,KAAK,oEAAoE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;;yBAE7F,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;mBACjC,CAAC;cACN,IAAI,CAAC,MAAM;kBACP,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;;GAEhF,CAAC;IACH,CAAC;;AAtBM;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACN;AAGd;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACA;AAGpB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGf;IADP,KAAK,EAAE;;gDACe;AA9BX,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CA4C5B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseDiscordSelectMenuOption } from '../_private/BaseDiscordSelectMenuOption.js';
|
|
2
|
+
export interface UserSelectMenuOptionData {
|
|
3
|
+
avatarUrl: string;
|
|
4
|
+
discriminator: string;
|
|
5
|
+
username: string;
|
|
6
|
+
globalName?: string;
|
|
7
|
+
bot?: boolean;
|
|
8
|
+
verified?: boolean;
|
|
9
|
+
identifier: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class DiscordUserSelectMenuOption extends BaseDiscordSelectMenuOption implements UserSelectMenuOptionData {
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
static readonly styles: import("lit").CSSResult[];
|
|
16
|
+
identifier: string;
|
|
17
|
+
avatarUrl: string;
|
|
18
|
+
username: string;
|
|
19
|
+
discriminator: string;
|
|
20
|
+
globalName: string;
|
|
21
|
+
bot: boolean;
|
|
22
|
+
verified: boolean;
|
|
23
|
+
filter(searchValue: string): boolean;
|
|
24
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'discord-user-select-menu-option': DiscordUserSelectMenuOption;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=DiscordUserSelectMenuOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscordUserSelectMenuOption.d.ts","sourceRoot":"","sources":["../../../src/components/discord-user-select-menu-option/DiscordUserSelectMenuOption.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF,MAAM,WAAW,wBAAwB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,qBACa,2BAA4B,SAAQ,2BAA4B,YAAW,wBAAwB;IAC/G;;OAEG;IACH,gBAAgC,MAAM,4BAwCpC;IAGK,UAAU,EAAE,MAAM,CAAC;IAGnB,SAAS,EAAE,MAAM,CAAC;IAGlB,QAAQ,EAAE,MAAM,CAAC;IAGjB,aAAa,EAAE,MAAM,CAAC;IAGtB,UAAU,EAAE,MAAM,CAAC;IAGnB,GAAG,UAAS;IAGZ,QAAQ,UAAS;IAEjB,MAAM,CAAC,WAAW,EAAE,MAAM;cAMd,MAAM;CA0BzB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,iCAAiC,EAAE,2BAA2B,CAAC;KAC/D;CACD"}
|