@vandeurenglenn/lite-elements 0.3.30 → 0.3.32

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.
Files changed (65) hide show
  1. package/exports/apis/device.d.ts +33 -0
  2. package/exports/bundle/banner.js +1 -1
  3. package/exports/bundle/button.js +1 -1
  4. package/exports/bundle/card.js +1 -1
  5. package/exports/bundle/code.js +1 -1
  6. package/exports/bundle/custom-element-BOdKJYdz.js +1 -0
  7. package/exports/bundle/demo-elements.js +1 -1
  8. package/exports/bundle/demo-icons.js +1 -1
  9. package/exports/bundle/demo-shell.js +1 -1
  10. package/exports/bundle/demo.js +1 -1
  11. package/exports/bundle/device.js +1 -0
  12. package/exports/bundle/dialog.js +2 -2
  13. package/exports/bundle/divider.js +1 -1
  14. package/exports/bundle/drawer-button.js +1 -1
  15. package/exports/bundle/drawer-item.js +1 -1
  16. package/exports/bundle/drawer-layout.js +1 -1
  17. package/exports/bundle/drawer.js +4 -2
  18. package/exports/bundle/dropdown-menu.js +1 -1
  19. package/exports/bundle/dropdown.js +1 -1
  20. package/exports/bundle/elements.js +1 -1
  21. package/exports/bundle/elevation.js +1 -1
  22. package/exports/bundle/file-reader-mixin.js +1 -0
  23. package/exports/bundle/icon-button.js +1 -1
  24. package/exports/bundle/icon-set.js +1 -1
  25. package/exports/bundle/icon.js +1 -1
  26. package/exports/bundle/input.js +1 -1
  27. package/exports/bundle/list-item.js +1 -1
  28. package/exports/bundle/menu.js +1 -1
  29. package/exports/bundle/minute-field.js +1 -1
  30. package/exports/bundle/notification.js +5 -48
  31. package/exports/bundle/notifications.js +1 -1
  32. package/exports/bundle/pane.js +2 -2
  33. package/exports/bundle/property-DyuvULjI.js +44 -0
  34. package/exports/bundle/rail.js +1 -1
  35. package/exports/bundle/root.js +1 -1
  36. package/exports/bundle/section.js +1 -1
  37. package/exports/bundle/section2.js +1 -1
  38. package/exports/bundle/selector.js +1 -1
  39. package/exports/bundle/summary-mirror.js +1 -1
  40. package/exports/bundle/summary.js +1 -1
  41. package/exports/bundle/supporting-pane.js +1 -1
  42. package/exports/bundle/tab.js +1 -1
  43. package/exports/bundle/tabs.js +1 -1
  44. package/exports/bundle/text-field.js +1 -1
  45. package/exports/bundle/theme.js +1 -1
  46. package/exports/bundle/time-picker.js +1 -1
  47. package/exports/bundle/toggle-button.js +1 -1
  48. package/exports/bundle/toggle.js +1 -1
  49. package/exports/bundle/top-app-bar.js +1 -1
  50. package/exports/bundle/typography.js +1 -1
  51. package/exports/bundle/upload-file.js +1 -1
  52. package/exports/bundle/upload-image.js +1020 -0
  53. package/exports/device.js +95 -0
  54. package/exports/dialog.js +1 -1
  55. package/exports/drawer.js +2 -0
  56. package/exports/file-reader-mixin.js +11 -0
  57. package/exports/mixins/file-reader-mixin.d.ts +341 -0
  58. package/exports/pane.js +1 -1
  59. package/exports/upload/upload-image.d.ts +381 -0
  60. package/exports/upload-image.js +417 -0
  61. package/package.json +23 -7
  62. package/exports/bundle/custom-element-BMhVvZjf.js +0 -1
  63. package/exports/bundle/upload.js +0 -1
  64. package/exports/upload/upload.d.ts +0 -5
  65. package/exports/upload.js +0 -38
@@ -0,0 +1,417 @@
1
+ import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
+ import { customElement, query, property, css, html, LiteElement } from '@vandeurenglenn/lite';
3
+ import { render } from 'lit-html';
4
+ import '@material/web/button/filled-tonal-button.js';
5
+ import '@material/web/textfield/outlined-text-field.js';
6
+ import { DeviceApi } from './device.js';
7
+ import '@material/web/progress/circular-progress.js';
8
+ import '@vandeurenglenn/lite-elements/dialog.js';
9
+ import '@vandeurenglenn/lite-elements/icon.js';
10
+ import '@vandeurenglenn/lite-elements/tabs.js';
11
+ import '@vandeurenglenn/lite-elements/tab.js';
12
+ import '@vandeurenglenn/lite-elements/selector.js';
13
+ import '@vandeurenglenn/lite-elements/pages.js';
14
+ import { FileReaderMixin } from './file-reader-mixin.js';
15
+
16
+ let CustomUploadImage = (() => {
17
+ let _classDecorators = [customElement('custom-upload-image')];
18
+ let _classDescriptor;
19
+ let _classExtraInitializers = [];
20
+ let _classThis;
21
+ let _classSuper = FileReaderMixin(LiteElement);
22
+ let _pages_decorators;
23
+ let _pages_initializers = [];
24
+ let _pages_extraInitializers = [];
25
+ let _images_decorators;
26
+ let _images_initializers = [];
27
+ let _images_extraInitializers = [];
28
+ let _selector_decorators;
29
+ let _selector_initializers = [];
30
+ let _selector_extraInitializers = [];
31
+ let _open_decorators;
32
+ let _open_initializers = [];
33
+ let _open_extraInitializers = [];
34
+ let _frontCameraDisabled_decorators;
35
+ let _frontCameraDisabled_initializers = [];
36
+ let _frontCameraDisabled_extraInitializers = [];
37
+ let _rearCameraDisabled_decorators;
38
+ let _rearCameraDisabled_initializers = [];
39
+ let _rearCameraDisabled_extraInitializers = [];
40
+ let _hasLibrary_decorators;
41
+ let _hasLibrary_initializers = [];
42
+ let _hasLibrary_extraInitializers = [];
43
+ (class extends _classSuper {
44
+ static { _classThis = this; }
45
+ static {
46
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
47
+ _pages_decorators = [query('custom-pages')];
48
+ _images_decorators = [property({ type: Array, consumes: true })];
49
+ _selector_decorators = [query('custom-tabs')];
50
+ _open_decorators = [property({ type: Boolean, reflect: true })];
51
+ _frontCameraDisabled_decorators = [property({ type: Boolean })];
52
+ _rearCameraDisabled_decorators = [property({ type: Boolean })];
53
+ _hasLibrary_decorators = [property({ type: Boolean, attribute: 'has-library' })];
54
+ __esDecorate(this, null, _pages_decorators, { kind: "accessor", name: "pages", static: false, private: false, access: { has: obj => "pages" in obj, get: obj => obj.pages, set: (obj, value) => { obj.pages = value; } }, metadata: _metadata }, _pages_initializers, _pages_extraInitializers);
55
+ __esDecorate(this, null, _images_decorators, { kind: "accessor", name: "images", static: false, private: false, access: { has: obj => "images" in obj, get: obj => obj.images, set: (obj, value) => { obj.images = value; } }, metadata: _metadata }, _images_initializers, _images_extraInitializers);
56
+ __esDecorate(this, null, _selector_decorators, { kind: "accessor", name: "selector", static: false, private: false, access: { has: obj => "selector" in obj, get: obj => obj.selector, set: (obj, value) => { obj.selector = value; } }, metadata: _metadata }, _selector_initializers, _selector_extraInitializers);
57
+ __esDecorate(this, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
58
+ __esDecorate(this, null, _frontCameraDisabled_decorators, { kind: "accessor", name: "frontCameraDisabled", static: false, private: false, access: { has: obj => "frontCameraDisabled" in obj, get: obj => obj.frontCameraDisabled, set: (obj, value) => { obj.frontCameraDisabled = value; } }, metadata: _metadata }, _frontCameraDisabled_initializers, _frontCameraDisabled_extraInitializers);
59
+ __esDecorate(this, null, _rearCameraDisabled_decorators, { kind: "accessor", name: "rearCameraDisabled", static: false, private: false, access: { has: obj => "rearCameraDisabled" in obj, get: obj => obj.rearCameraDisabled, set: (obj, value) => { obj.rearCameraDisabled = value; } }, metadata: _metadata }, _rearCameraDisabled_initializers, _rearCameraDisabled_extraInitializers);
60
+ __esDecorate(this, null, _hasLibrary_decorators, { kind: "accessor", name: "hasLibrary", static: false, private: false, access: { has: obj => "hasLibrary" in obj, get: obj => obj.hasLibrary, set: (obj, value) => { obj.hasLibrary = value; } }, metadata: _metadata }, _hasLibrary_initializers, _hasLibrary_extraInitializers);
61
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
62
+ _classThis = _classDescriptor.value;
63
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
64
+ }
65
+ deviceApi = new DeviceApi();
66
+ #pages_accessor_storage = __runInitializers(this, _pages_initializers, void 0);
67
+ get pages() { return this.#pages_accessor_storage; }
68
+ set pages(value) { this.#pages_accessor_storage = value; }
69
+ #images_accessor_storage = (__runInitializers(this, _pages_extraInitializers), __runInitializers(this, _images_initializers, void 0));
70
+ get images() { return this.#images_accessor_storage; }
71
+ set images(value) { this.#images_accessor_storage = value; }
72
+ #selector_accessor_storage = (__runInitializers(this, _images_extraInitializers), __runInitializers(this, _selector_initializers, void 0));
73
+ get selector() { return this.#selector_accessor_storage; }
74
+ set selector(value) { this.#selector_accessor_storage = value; }
75
+ #open_accessor_storage = (__runInitializers(this, _selector_extraInitializers), __runInitializers(this, _open_initializers, false));
76
+ get open() { return this.#open_accessor_storage; }
77
+ set open(value) { this.#open_accessor_storage = value; }
78
+ #frontCameraDisabled_accessor_storage = (__runInitializers(this, _open_extraInitializers), __runInitializers(this, _frontCameraDisabled_initializers, false));
79
+ get frontCameraDisabled() { return this.#frontCameraDisabled_accessor_storage; }
80
+ set frontCameraDisabled(value) { this.#frontCameraDisabled_accessor_storage = value; }
81
+ #rearCameraDisabled_accessor_storage = (__runInitializers(this, _frontCameraDisabled_extraInitializers), __runInitializers(this, _rearCameraDisabled_initializers, false));
82
+ get rearCameraDisabled() { return this.#rearCameraDisabled_accessor_storage; }
83
+ set rearCameraDisabled(value) { this.#rearCameraDisabled_accessor_storage = value; }
84
+ #hasLibrary_accessor_storage = (__runInitializers(this, _rearCameraDisabled_extraInitializers), __runInitializers(this, _hasLibrary_initializers, void 0));
85
+ get hasLibrary() { return this.#hasLibrary_accessor_storage; }
86
+ set hasLibrary(value) { this.#hasLibrary_accessor_storage = value; }
87
+ static styles = [
88
+ css `
89
+ :host {
90
+ display: block;
91
+ }
92
+
93
+ h5 {
94
+ margin: 0;
95
+ }
96
+
97
+ custom-tab.custom-selected {
98
+ background: var(--md-sys-color-tertiary);
99
+ --custom-icon-color: var(--md-sys-color-on-tertiary);
100
+ border: none;
101
+ }
102
+
103
+ custom-tab.custom-selected span,
104
+ custom-tab.custom-selected custom-icon {
105
+ color: var(--md-sys-color-on-tertiary);
106
+ --custom-icon-color: var(--md-sys-color-on-tertiary);
107
+ }
108
+
109
+ custom-tab {
110
+ gap: 8px;
111
+ height: 40px;
112
+ padding: 0 12px;
113
+ box-sizing: border-box;
114
+ width: auto;
115
+ border-radius: 20px;
116
+ font: var(--_supporting-text-type);
117
+ }
118
+
119
+ custom-tabs {
120
+ height: 40px;
121
+ }
122
+
123
+ section {
124
+ display: flex;
125
+ flex-direction: column;
126
+ height: 100%;
127
+ width: 100%;
128
+ min-height: 168px;
129
+ position: absolute;
130
+ transform: scale(0);
131
+ justify-content: center;
132
+ align-items: center;
133
+ }
134
+
135
+ section[route='camera'] {
136
+ overflow-y: hidden;
137
+ }
138
+
139
+ section.custom-selected {
140
+ transform: scale(1);
141
+ position: relative;
142
+ }
143
+ md-outlined-text-field {
144
+ padding-top: 12px;
145
+ }
146
+
147
+ .camera-actions {
148
+ width: 100%;
149
+ position: absolute;
150
+ bottom: 0;
151
+ margin-bottom: 3px;
152
+ }
153
+
154
+ section[route='camera'] flex-container {
155
+ height: 320px;
156
+ }
157
+
158
+ flex-column {
159
+ width: auto;
160
+ }
161
+
162
+ flex-container video,
163
+ img:not([data-variant='icon']) {
164
+ height: -webkit-fill-available;
165
+ width: -webkit-fill-available;
166
+ }
167
+
168
+ [route='library'] img {
169
+ width: 150px;
170
+ cursor: pointer;
171
+ }
172
+
173
+ [data-variant='icon'] {
174
+ height: 48px;
175
+ width: 48px;
176
+ }
177
+
178
+ md-dialog {
179
+ --_container-color: #2d2f31;
180
+ }
181
+ `
182
+ ];
183
+ get #dialog() {
184
+ return this.shadowRoot.querySelector('custom-dialog');
185
+ }
186
+ get #cameraPreview() {
187
+ return this.shadowRoot.querySelector('.camera-preview');
188
+ }
189
+ #cameraFacingMode = (__runInitializers(this, _hasLibrary_extraInitializers), 'user');
190
+ #image = { data: null, type: null };
191
+ #takePhoto = async () => {
192
+ // this._previewEl.stop();
193
+ // this._previewEl.srcObject = null;
194
+ const blob = await this.deviceApi.camera.takePhoto(this.#cameraFacingMode);
195
+ // const fd = new FormData();
196
+ // fd.append('image', blob);
197
+ this.#image.data = await globalThis.readAsDataURL(blob);
198
+ this.#image.type = 'base64';
199
+ const img = document.createElement('img');
200
+ img.src = this.#image.data;
201
+ this.shadowRoot.querySelector('flex-container').replaceChild(img.cloneNode(true), this.#cameraPreview);
202
+ };
203
+ #selectFile = ({}) => {
204
+ const input = document.createElement('input');
205
+ input.type = 'file';
206
+ input.multiple = true;
207
+ const onchange = async (event) => {
208
+ const files = await Promise.all(Array.from(input.files).map(async (file) => {
209
+ const data = await this.readAsDataURL(file);
210
+ const item = document.createElement('md-list-item');
211
+ item.headline = file.name;
212
+ item.setAttribute('noninteractive', '');
213
+ item.innerHTML = `
214
+ <img data-variant="icon" slot="start" src="${data}">
215
+ <md-standard-icon-button slot="end"><custom-icon>delete</custom-icon></md-standard-icon-button>
216
+ `;
217
+ item.onclick = () => {
218
+ this.shadowRoot.querySelector('section[route="file"]').removeChild(item);
219
+ };
220
+ this.shadowRoot.querySelector('section[route="file"]').appendChild(item);
221
+ return { name: file.name, data };
222
+ }));
223
+ this.#image.data = files;
224
+ this.#image.type = 'base64[]';
225
+ input.removeEventListener('change', onchange);
226
+ };
227
+ input.addEventListener('change', onchange);
228
+ input.click();
229
+ };
230
+ onChange(propertyKey, value) {
231
+ if (propertyKey === 'open' && value) {
232
+ this.hasLibrary ? this.select('library') : this.select('url');
233
+ }
234
+ }
235
+ select(value) {
236
+ this.selector.select(value);
237
+ }
238
+ #onSelected = async ({ detail }) => {
239
+ this.shadowRoot.querySelector('custom-pages').select(detail);
240
+ if (detail === 'camera') {
241
+ this.frontCameraDisabled = !(await this.deviceApi.hasFrontCam());
242
+ this.rearCameraDisabled = !(await this.deviceApi.hasBackCam());
243
+ this.deviceApi.camera.preview(this.#cameraPreview, this.#cameraFacingMode);
244
+ }
245
+ };
246
+ #onlibclick = (event, hash) => {
247
+ this.#image.data = hash;
248
+ this.#image.type = 'library';
249
+ };
250
+ show() {
251
+ this.#dialog.open = true;
252
+ }
253
+ #addImageTemplate() {
254
+ return html `
255
+ <form id="form-content" method="dialog">
256
+ <custom-tabs attr-for-selected="route" @selected=${this.#onSelected.bind(this)}>
257
+ ${this.hasLibrary
258
+ ? html `
259
+ <custom-tab route="library">
260
+ <custom-icon>photo_library</custom-icon>
261
+ <span>library</span>
262
+ </custom-tab>
263
+ `
264
+ : ''}
265
+ <custom-tab route="url">
266
+ <custom-icon>link</custom-icon>
267
+ <span>url</span>
268
+ </custom-tab>
269
+
270
+ <custom-tab route="camera">
271
+ <custom-icon>camera</custom-icon>
272
+ <span>camera</span>
273
+ </custom-tab>
274
+
275
+ <custom-tab route="file">
276
+ <custom-icon>upload</custom-icon>
277
+ <span>file</span>
278
+ </custom-tab>
279
+ <flex-it></flex-it>
280
+ </custom-tabs>
281
+ <custom-pages attr-for-selected="route">
282
+ ${this.hasLibrary
283
+ ? html `
284
+ <section route="library">
285
+ <flex-wrap-around>
286
+ ${this.images.map((image) => html `
287
+ <img
288
+ @click=${(event) => this.#onlibclick.call(this, event, image.firebaseKey)}
289
+ src=${`${location.origin}/api/image?image=${image.link.replace('.png', 'b.png')}`}
290
+ />
291
+ `)}
292
+ </flex-wrap-around>
293
+ </section>
294
+ `
295
+ : ''}
296
+ <section route="url">
297
+ <flex-column>
298
+ add image using a link/url
299
+ <md-outlined-text-field label="url" input-field="url"></md-outlined-text-field>
300
+ </flex-column>
301
+ </section>
302
+
303
+ <section route="camera">
304
+ <flex-container>
305
+ <video autoplay mute="true" class="camera-preview"></video>
306
+ </flex-container>
307
+
308
+ <flex-row class="camera-actions">
309
+ <flex-it flex="2"></flex-it>
310
+
311
+ <md-standard-icon-button
312
+ @click=${() => (this.#cameraFacingMode = 'user')}
313
+ ?disabled=${this.frontCameraDisabled}
314
+ >
315
+ <custom-icon>photo_camera_front</custom-icon>
316
+ </md-standard-icon-button>
317
+
318
+ <flex-it flex="1"></flex-it>
319
+
320
+ <md-standard-icon-button style="transform: scale(1.66);" @click=${this.#takePhoto}>
321
+ <custom-icon>photo_camera</custom-icon>
322
+ </md-standard-icon-button>
323
+
324
+ <flex-it flex="1"></flex-it>
325
+
326
+ <md-standard-icon-button
327
+ @click=${() => (this.#cameraFacingMode = 'environment')}
328
+ ?disabled=${this.rearCameraDisabled}
329
+ >
330
+ <custom-icon>photo_camera_back</custom-icon>
331
+ </md-standard-icon-button>
332
+
333
+ <flex-it flex="2"></flex-it>
334
+ </flex-row>
335
+ </section>
336
+
337
+ <section route="file">
338
+ <md-filled-tonal-button @click=${this.#selectFile.bind(this)}>
339
+ <custom-icon slot="icon">upload</custom-icon>
340
+ select
341
+ </md-filled-tonal-button>
342
+ </section>
343
+ </custom-pages>
344
+ </form>
345
+
346
+ <flex-row slot="actions">
347
+ <md-text-button form="form-content" value="cancel">cancel</md-text-button>
348
+ <flex-one></flex-one>
349
+ <md-text-button form="form-content" value="submit">submit</md-text-button>
350
+ </flex-row>
351
+ `;
352
+ }
353
+ #onAction = () => new Promise((resolve, reject) => {
354
+ const action = (event) => {
355
+ const inputFields = Array.from(this.shadowRoot.querySelectorAll('[input-field]'));
356
+ const fields = {};
357
+ for (const field of inputFields) {
358
+ fields[field.label] = field.value;
359
+ }
360
+ if (!this.#image.type) {
361
+ const inputField = this.shadowRoot.querySelector('[input-field]');
362
+ this.#image.type = inputField ? 'url' : undefined;
363
+ this.#image.data = inputField?.value;
364
+ }
365
+ const image = {
366
+ type: this.#image.type,
367
+ data: Array.isArray(this.#image.data) ? [...this.#image.data] : this.#image.data
368
+ };
369
+ resolve({ action: event.returnValue, fields, image });
370
+ // @ts-ignore
371
+ this.#dialog.removeEventListener('closed', action);
372
+ this.#image.data = null;
373
+ this.#image.type = null;
374
+ this.deviceApi.camera.close();
375
+ this.#dialog.close();
376
+ render(html ``, this.#dialog);
377
+ };
378
+ // @ts-ignore
379
+ this.#dialog.addEventListener('closed', action);
380
+ });
381
+ #busytemplate(title, description) {
382
+ return html `
383
+ <flex-row slot="title">
384
+ <h5>${title}</h5>
385
+ </flex-row>
386
+ <flex-column>
387
+ <flex-column> ${description} </flex-column>
388
+
389
+ <flex-row style="justify-content: center; width: 100%;">
390
+ <md-circular-progress indeterminate></md-circular-progress>
391
+ </flex-row>
392
+ </flex-column>
393
+ `;
394
+ }
395
+ async addImage() {
396
+ render(this.#addImageTemplate(), this.#dialog);
397
+ this.show();
398
+ return this.#onAction();
399
+ }
400
+ async busy(title, description) {
401
+ render(this.#busytemplate(title, description), this.#dialog);
402
+ this.show();
403
+ }
404
+ close() {
405
+ this.#dialog.open = false;
406
+ }
407
+ render() {
408
+ return html ` <custom-dialog .open=${this.open}></custom-dialog> `;
409
+ }
410
+ static {
411
+ __runInitializers(_classThis, _classExtraInitializers);
412
+ }
413
+ });
414
+ return _classThis;
415
+ })();
416
+
417
+ export { CustomUploadImage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vandeurenglenn/lite-elements",
3
- "version": "0.3.30",
3
+ "version": "0.3.32",
4
4
  "description": "set of lite elements following Material Design 3 spec",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -113,6 +113,14 @@
113
113
  "import": "./exports/demo.js",
114
114
  "types": "./exports/demo/demo.d.ts"
115
115
  },
116
+ "./device": {
117
+ "import": "./exports/device.js",
118
+ "types": "./exports/apis/device.d.ts"
119
+ },
120
+ "./device.js": {
121
+ "import": "./exports/device.js",
122
+ "types": "./exports/apis/device.d.ts"
123
+ },
116
124
  "./dial": {
117
125
  "import": "./exports/dial.js",
118
126
  "types": "./exports/time-picker/dial.d.ts"
@@ -201,6 +209,14 @@
201
209
  "import": "./exports/elevation.js",
202
210
  "types": "./exports/elevation/elevation.d.ts"
203
211
  },
212
+ "./file-reader-mixin": {
213
+ "import": "./exports/file-reader-mixin.js",
214
+ "types": "./exports/mixins/file-reader-mixin.d.ts"
215
+ },
216
+ "./file-reader-mixin.js": {
217
+ "import": "./exports/file-reader-mixin.js",
218
+ "types": "./exports/mixins/file-reader-mixin.d.ts"
219
+ },
204
220
  "./hour-field": {
205
221
  "import": "./exports/hour-field.js",
206
222
  "types": "./exports/time-picker/hour-field.d.ts"
@@ -481,13 +497,13 @@
481
497
  "import": "./exports/upload-file.js",
482
498
  "types": "./exports/upload/upload-file.d.ts"
483
499
  },
484
- "./upload": {
485
- "import": "./exports/upload.js",
486
- "types": "./exports/upload/upload.d.ts"
500
+ "./upload-image": {
501
+ "import": "./exports/upload-image.js",
502
+ "types": "./exports/upload/upload-image.d.ts"
487
503
  },
488
- "./upload.js": {
489
- "import": "./exports/upload.js",
490
- "types": "./exports/upload/upload.d.ts"
504
+ "./upload-image.js": {
505
+ "import": "./exports/upload-image.js",
506
+ "types": "./exports/upload/upload-image.d.ts"
491
507
  }
492
508
  }
493
509
  }
@@ -1 +0,0 @@
1
- function e(e,t,r,n,o,i){function c(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,a=n.kind,f="getter"===a?"get":"setter"===a?"set":"value",u=!t&&e?n.static?e:e.prototype:null,l=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!1,d=r.length-1;d>=0;d--){var g={};for(var h in n)g[h]="access"===h?{}:n[h];for(var h in n.access)g.access[h]=n.access[h];g.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(c(e||null))};var v=(0,r[d])("accessor"===a?{get:l.get,set:l.set}:l[f],g);if("accessor"===a){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=c(v.get))&&(l.get=s),(s=c(v.set))&&(l.set=s),(s=c(v.init))&&o.unshift(s)}else(s=c(v))&&("field"===a?o.unshift(s):l[f]=s)}u&&Object.defineProperty(u,n.name,l),p=!0}function t(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function r(e){return(t,{addInitializer:r})=>{r((function(){customElements.define(e??t.name.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase(),this)}))}}"function"==typeof SuppressedError&&SuppressedError;export{e as _,t as a,r as e};
@@ -1 +0,0 @@
1
- import{_ as t,a,e}from"./custom-element-BMhVvZjf.js";import{t as r,v as s,D as i}from"./property-Do5-bKhz.js";let m=(()=>{let m,o,c,l=[e("custom-upload")],n=[],u=i,h=[],d=[];return class extends u{static{o=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;c=[r({attribute:"with-camera"})],t(this,null,c,{kind:"accessor",name:"withCamera",static:!1,private:!1,access:{has:t=>"withCamera"in t,get:t=>t.withCamera,set:(t,a)=>{t.withCamera=a}},metadata:e},h,d),t(null,m={value:o},l,{kind:"class",name:o.name,metadata:e},null,n),o=m.value,e&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),a(o,n)}#t=a(this,h,void 0);get withCamera(){return this.#t}set withCamera(t){this.#t=t}render(){return s` <custom-pages> </custom-pages> `}constructor(){super(...arguments),a(this,d)}},o})();export{m as CustomUpload};
@@ -1,5 +0,0 @@
1
- import { LiteElement } from '@vandeurenglenn/lite';
2
- export declare class CustomUpload extends LiteElement {
3
- accessor withCamera: any;
4
- render(): import("lit-html").TemplateResult<1>;
5
- }
package/exports/upload.js DELETED
@@ -1,38 +0,0 @@
1
- import { _ as __esDecorate, a as __runInitializers } from './tslib.es6-CFl_-KPR.js';
2
- import { customElement, property, html, LiteElement } from '@vandeurenglenn/lite';
3
-
4
- let CustomUpload = (() => {
5
- let _classDecorators = [customElement('custom-upload')];
6
- let _classDescriptor;
7
- let _classExtraInitializers = [];
8
- let _classThis;
9
- let _classSuper = LiteElement;
10
- let _withCamera_decorators;
11
- let _withCamera_initializers = [];
12
- let _withCamera_extraInitializers = [];
13
- (class extends _classSuper {
14
- static { _classThis = this; }
15
- static {
16
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
17
- _withCamera_decorators = [property({ attribute: 'with-camera' })];
18
- __esDecorate(this, null, _withCamera_decorators, { kind: "accessor", name: "withCamera", static: false, private: false, access: { has: obj => "withCamera" in obj, get: obj => obj.withCamera, set: (obj, value) => { obj.withCamera = value; } }, metadata: _metadata }, _withCamera_initializers, _withCamera_extraInitializers);
19
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
20
- _classThis = _classDescriptor.value;
21
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
22
- __runInitializers(_classThis, _classExtraInitializers);
23
- }
24
- #withCamera_accessor_storage = __runInitializers(this, _withCamera_initializers, void 0);
25
- get withCamera() { return this.#withCamera_accessor_storage; }
26
- set withCamera(value) { this.#withCamera_accessor_storage = value; }
27
- render() {
28
- return html ` <custom-pages> </custom-pages> `;
29
- }
30
- constructor() {
31
- super(...arguments);
32
- __runInitializers(this, _withCamera_extraInitializers);
33
- }
34
- });
35
- return _classThis;
36
- })();
37
-
38
- export { CustomUpload };