@ezeep/ezeep-js 1.0.294 → 1.0.302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/{ezp-auth_15.cjs.entry.js → ezp-auth_16.cjs.entry.js} +510 -109
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ezp-file-name/ezp-file-name.css +98 -0
- package/dist/collection/components/ezp-file-name/ezp-file-name.js +280 -0
- package/dist/collection/components/ezp-icon/ezp-icon.js +1 -1
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
- package/dist/collection/components/ezp-input/ezp-input.js +1 -1
- package/dist/collection/components/ezp-label/ezp-label.js +39 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +4 -2
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +216 -88
- package/dist/collection/components/ezp-printing/ezp-printing.js +1 -1
- package/dist/collection/components/ezp-select/ezp-select.js +1 -1
- package/dist/collection/components/ezp-status/ezp-status.js +2 -2
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
- package/dist/collection/components/ezp-upload/ezp-upload.css +5 -1
- package/dist/collection/components/ezp-upload/ezp-upload.js +1 -1
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
- package/dist/collection/shared/storage.js +39 -9
- package/dist/collection/types/shared/types.d.ts +1 -0
- package/dist/collection/utils/printer.js +75 -1
- package/dist/components/auth.js +1 -1
- package/dist/components/ezp-file-name.d.ts +11 -0
- package/dist/components/ezp-file-name.js +1 -0
- package/dist/components/ezp-file-name2.js +1 -0
- package/dist/components/ezp-icon-button2.js +1 -1
- package/dist/components/ezp-icon2.js +1 -1
- package/dist/components/ezp-input2.js +1 -1
- package/dist/components/ezp-label2.js +1 -1
- package/dist/components/ezp-printer-selection2.js +1 -1
- package/dist/components/ezp-printing.js +1 -1
- package/dist/components/ezp-select2.js +1 -1
- package/dist/components/ezp-status2.js +1 -1
- package/dist/components/ezp-stepper2.js +1 -1
- package/dist/components/ezp-text-button2.js +1 -1
- package/dist/components/ezp-upload2.js +1 -1
- package/dist/components/ezp-user-menu2.js +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/directives/proxies.ts +26 -1
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +510 -110
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-fe700ca4.system.entry.js → p-636e190f.system.entry.js} +2 -2
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
- package/dist/ezeep/p-ff075048.entry.js +1 -0
- package/dist/ezeep/types/shared/types.d.ts +1 -0
- package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +83 -0
- package/dist/types/components/ezp-label/ezp-label.d.ts +10 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +40 -2
- package/dist/types/components.d.ts +65 -2
- package/dist/types/shared/storage.d.ts +18 -4
- package/dist/types/shared/types.d.ts +1 -0
- package/dist/types/utils/printer.d.ts +18 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-fe700ca4.system.entry.js → p-636e190f.system.entry.js} +2 -2
- package/www/build/p-DCznw2Ee.system.js +1 -1
- package/www/build/p-a2a4f55b.js +1 -0
- package/www/build/p-ff075048.entry.js +1 -0
- package/www/index.html +1 -1
- package/dist/ezeep/p-3ab5a223.entry.js +0 -1
- package/www/build/p-3ab5a223.entry.js +0 -1
- package/www/build/p-65242d5e.js +0 -1
|
@@ -3,9 +3,9 @@ import i18next from "i18next";
|
|
|
3
3
|
import authStore from "../../services/auth";
|
|
4
4
|
import printStore, { EzpPrintService } from "../../services/print";
|
|
5
5
|
import userStore, { EzpUserService } from "../../services/user";
|
|
6
|
-
import { managePaperDimensions, poll, removeEmptyStrings, subscribeToLanguageChange } from "../../utils/utils";
|
|
6
|
+
import { managePaperDimensions, poll, removeEmptyStrings, subscribeToLanguageChange, } from "../../utils/utils";
|
|
7
7
|
import { PAPER_ID, validatePageRange, formatPageRange } from "../../utils/utils";
|
|
8
|
-
import {
|
|
8
|
+
import { applySavedProperties, classifyJobStatus, hasTrays, hasNoTrays, pickRememberedProperties, } from "../../utils/printer";
|
|
9
9
|
import { uploadAndPrintFile } from "../../services/print-job";
|
|
10
10
|
import { storage } from "../../shared/storage";
|
|
11
11
|
import { HUB_DRIVER_ERROR_CODES, PRINT_REJECTED_CODE, FILE_EXPIRED_STATUS, POLL_INTERVAL_MS, MAX_POLL_ATTEMPTS, HUB_TIMEOUT_MS, } from "../../shared/constants";
|
|
@@ -56,6 +56,10 @@ export class EzpPrinterSelection {
|
|
|
56
56
|
this.hubDriverError = false;
|
|
57
57
|
this.userMenuOpen = false;
|
|
58
58
|
this.printStopped = false;
|
|
59
|
+
/** Starts empty so the dialog can still render if the list never arrives. */
|
|
60
|
+
this.printers = [];
|
|
61
|
+
/** Starts empty so the dialog renders even if the list never loads. */
|
|
62
|
+
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
59
63
|
this.selectedPrinterConfig = {
|
|
60
64
|
Default: {
|
|
61
65
|
Color: '',
|
|
@@ -88,6 +92,8 @@ export class EzpPrinterSelection {
|
|
|
88
92
|
trayname: '',
|
|
89
93
|
PageRanges: '',
|
|
90
94
|
};
|
|
95
|
+
/** True while a printer's capabilities are being fetched. */
|
|
96
|
+
this.loadingPrinterConfig = false;
|
|
91
97
|
this.currentFileIndex = 0;
|
|
92
98
|
this.totalFiles = 0;
|
|
93
99
|
this.failedFiles = [];
|
|
@@ -278,8 +284,7 @@ export class EzpPrinterSelection {
|
|
|
278
284
|
if (hubTimeout)
|
|
279
285
|
clearTimeout(hubTimeout);
|
|
280
286
|
}
|
|
281
|
-
|
|
282
|
-
storage.setPrinter(this.selectedPrinter);
|
|
287
|
+
this.rememberSelection();
|
|
283
288
|
this.printStopped = false;
|
|
284
289
|
};
|
|
285
290
|
this.handleUserMenu = () => {
|
|
@@ -372,24 +377,45 @@ export class EzpPrinterSelection {
|
|
|
372
377
|
break;
|
|
373
378
|
}
|
|
374
379
|
}
|
|
375
|
-
/** Print needs a printer, no job in flight and
|
|
380
|
+
/** Print needs a printer with its capabilities in hand, no job in flight and
|
|
381
|
+
* a valid page range. The config matters: between picking a printer and its
|
|
382
|
+
* properties arriving, the selection is set but the properties still hold
|
|
383
|
+
* blank defaults, and printing then saves those as that printer's settings. */
|
|
376
384
|
get printDisabled() {
|
|
377
|
-
return this.selectedPrinter.id === '' ||
|
|
385
|
+
return (this.selectedPrinter.id === '' ||
|
|
386
|
+
this.loadingPrinterConfig ||
|
|
387
|
+
this.printProcessing ||
|
|
388
|
+
this.pageRangeInvalid);
|
|
378
389
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
390
|
+
/** Keep this printer and its settings for the next print. Stored per printer,
|
|
391
|
+
* so each one keeps its own and no setting follows the user to a printer
|
|
392
|
+
* that cannot do it. */
|
|
393
|
+
rememberSelection() {
|
|
394
|
+
if (!this.selectedPrinter.id)
|
|
395
|
+
return;
|
|
396
|
+
storage.setPrinterSettings(this.selectedPrinter.id, pickRememberedProperties(this.selectedProperties));
|
|
397
|
+
storage.setPrinter(this.selectedPrinter);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Decide which printer the dialog opens on: the one last printed to, or the
|
|
401
|
+
* user's only printer when there is nothing to choose between. Its settings
|
|
402
|
+
* follow once its config is in, since they can only be validated against the
|
|
403
|
+
* printer's capabilities.
|
|
404
|
+
*/
|
|
405
|
+
selectInitialPrinter() {
|
|
406
|
+
var _a, _b;
|
|
384
407
|
const savedPrinter = storage.getPrinter();
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
408
|
+
const savedIsAvailable = (_a = this.printers) === null || _a === void 0 ? void 0 : _a.some((printer) => printer.id === (savedPrinter === null || savedPrinter === void 0 ? void 0 : savedPrinter.id));
|
|
409
|
+
// A printer the user no longer has must not stay preselected.
|
|
410
|
+
if (savedPrinter && !savedIsAvailable)
|
|
411
|
+
storage.clearSavedPrinter();
|
|
412
|
+
if (savedPrinter && savedIsAvailable) {
|
|
413
|
+
this.selectedPrinter = savedPrinter;
|
|
414
|
+
}
|
|
415
|
+
else if (((_b = this.printers) === null || _b === void 0 ? void 0 : _b.length) === 1) {
|
|
416
|
+
// Nothing to pick between: opening a dropdown with one entry in it is
|
|
417
|
+
// busywork, so start on it.
|
|
418
|
+
this.selectedPrinter = this.printers[0];
|
|
393
419
|
}
|
|
394
420
|
else {
|
|
395
421
|
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
@@ -408,17 +434,22 @@ export class EzpPrinterSelection {
|
|
|
408
434
|
}
|
|
409
435
|
async setSelectedProperties(eventDetails) {
|
|
410
436
|
switch (eventDetails.type) {
|
|
411
|
-
case 'printer':
|
|
412
|
-
this.
|
|
413
|
-
this.selectedPrinter
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
.
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
437
|
+
case 'printer': {
|
|
438
|
+
const picked = this.printers.find((printer) => printer.id === eventDetails.id);
|
|
439
|
+
this.selectedPrinter = picked !== null && picked !== void 0 ? picked : {
|
|
440
|
+
id: eventDetails.id,
|
|
441
|
+
name: eventDetails.title,
|
|
442
|
+
location: '',
|
|
443
|
+
is_queue: eventDetails.is_queue,
|
|
444
|
+
};
|
|
445
|
+
// Same guard as the initial load. Without it a failed fetch left the
|
|
446
|
+
// printer selected while the config still described the *previous*
|
|
447
|
+
// one: Print stayed enabled, the job went out with settings nothing
|
|
448
|
+
// had checked against this printer, and those settings were then
|
|
449
|
+
// saved under its id and restored on later opens.
|
|
450
|
+
await this.loadSelectedPrinterConfig();
|
|
421
451
|
break;
|
|
452
|
+
}
|
|
422
453
|
case 'color':
|
|
423
454
|
this.selectedProperties.color =
|
|
424
455
|
eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
|
|
@@ -485,6 +516,55 @@ export class EzpPrinterSelection {
|
|
|
485
516
|
onJobId: (jobId) => (printStore.state.jobID = jobId),
|
|
486
517
|
});
|
|
487
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* What a dropdown should show: the current selection — restored from the last
|
|
521
|
+
* print, or just made by the user — and otherwise the printer's own default.
|
|
522
|
+
*
|
|
523
|
+
* The fallbacks matter because a config may describe its default only by name
|
|
524
|
+
* (`Default.Duplex`, `Default.Paper`, `Default.Tray`) without flagging the
|
|
525
|
+
* matching entry, which is all these dropdowns had to go on before settings
|
|
526
|
+
* were remembered.
|
|
527
|
+
*/
|
|
528
|
+
duplexPreSelection() {
|
|
529
|
+
var _a;
|
|
530
|
+
if (!this.selectedPrinter.id)
|
|
531
|
+
return null;
|
|
532
|
+
const mode = Number(this.selectedProperties.duplexmode);
|
|
533
|
+
if (mode)
|
|
534
|
+
return mode;
|
|
535
|
+
switch ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Duplex) {
|
|
536
|
+
case 'duplex_simplex':
|
|
537
|
+
return i18next.t('printer_selection.duplex_none');
|
|
538
|
+
case 'duplex_vertical':
|
|
539
|
+
return i18next.t('printer_selection.duplex_long');
|
|
540
|
+
case 'duplex_horizontal':
|
|
541
|
+
return i18next.t('printer_selection.duplex_short');
|
|
542
|
+
default:
|
|
543
|
+
return null;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
paperPreSelection() {
|
|
547
|
+
var _a, _b;
|
|
548
|
+
if (!this.selectedPrinter.id)
|
|
549
|
+
return null;
|
|
550
|
+
if (this.selectedProperties.paper)
|
|
551
|
+
return this.selectedProperties.paper;
|
|
552
|
+
const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper;
|
|
553
|
+
return name && ((_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.some((el) => el.Name.includes(name)))
|
|
554
|
+
? name
|
|
555
|
+
: null;
|
|
556
|
+
}
|
|
557
|
+
trayPreSelection() {
|
|
558
|
+
var _a, _b;
|
|
559
|
+
if (!this.selectedPrinter.id)
|
|
560
|
+
return null;
|
|
561
|
+
if (this.selectedProperties.trayname)
|
|
562
|
+
return this.selectedProperties.trayname;
|
|
563
|
+
const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Tray;
|
|
564
|
+
return name && ((_b = this.selectedPrinterConfig.Trays) === null || _b === void 0 ? void 0 : _b.some((el) => el === null || el === void 0 ? void 0 : el.Name.includes(name)))
|
|
565
|
+
? name
|
|
566
|
+
: null;
|
|
567
|
+
}
|
|
488
568
|
setDefaultPaperFormat() {
|
|
489
569
|
var _a, _b, _c, _d, _e;
|
|
490
570
|
let format;
|
|
@@ -553,46 +633,105 @@ export class EzpPrinterSelection {
|
|
|
553
633
|
this.unsubscribeLanguage = subscribeToLanguageChange(this);
|
|
554
634
|
this.printService = new EzpPrintService(this.redirectURI, this.clientID);
|
|
555
635
|
this.printService.registerFetchInterceptor();
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
636
|
+
try {
|
|
637
|
+
// A missing display name must not stop the user from printing.
|
|
638
|
+
await this.getUserInfo().catch(() => undefined);
|
|
639
|
+
let printersLoaded = false;
|
|
640
|
+
try {
|
|
641
|
+
const printers = await this.printService.getPrinterList(authStore.state.accessToken);
|
|
642
|
+
// A failed request still resolves: the API answers with a `{code,
|
|
643
|
+
// message}` body, which would survive `?? []` and break on `.some`.
|
|
644
|
+
if (!Array.isArray(printers))
|
|
645
|
+
throw new Error('Unexpected printer list payload');
|
|
646
|
+
this.printers = printers;
|
|
647
|
+
printersLoaded = true;
|
|
648
|
+
}
|
|
649
|
+
catch (_a) {
|
|
650
|
+
this.printers = [];
|
|
651
|
+
}
|
|
652
|
+
if (!printersLoaded) {
|
|
653
|
+
// Nothing is known about this user's printers, so the saved printer is
|
|
654
|
+
// left untouched: treating it as gone would clear it from storage and
|
|
655
|
+
// lose the settings that are only reachable through it.
|
|
562
656
|
this.noPrinters = true;
|
|
563
657
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
this.
|
|
572
|
-
|
|
573
|
-
|
|
658
|
+
else {
|
|
659
|
+
if (this.printers.length === 0) {
|
|
660
|
+
this.noPrinters = true;
|
|
661
|
+
}
|
|
662
|
+
this.selectInitialPrinter();
|
|
663
|
+
// A printer carried over from a previous print, or the only one the
|
|
664
|
+
// user has, needs its config before its properties can be offered.
|
|
665
|
+
if (this.selectedPrinter.id != '') {
|
|
666
|
+
await this.loadSelectedPrinterConfig();
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
let supportedExtensionsLoaded = false;
|
|
670
|
+
try {
|
|
671
|
+
const response = await (await this.printService.getConfig(authStore.state.accessToken)).json();
|
|
672
|
+
printStore.state.supportedFileExtensions = response.System.FILEEXT;
|
|
673
|
+
supportedExtensionsLoaded = true;
|
|
674
|
+
}
|
|
675
|
+
catch (_b) {
|
|
676
|
+
// Handled below: without the list, nothing can be validated against it.
|
|
677
|
+
}
|
|
678
|
+
try {
|
|
679
|
+
await this.printService
|
|
680
|
+
.getAllPrinterProperties(authStore.state.accessToken)
|
|
681
|
+
.then((printerConfig) => {
|
|
682
|
+
this.printerConfig = printerConfig;
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
catch (_c) {
|
|
686
|
+
// Only used to describe other printers; the dialog works without it.
|
|
687
|
+
}
|
|
688
|
+
// Skipped when the list never arrived: every file would compare as
|
|
689
|
+
// unsupported and the user would be told their document cannot be
|
|
690
|
+
// printed when nothing is actually wrong with it.
|
|
691
|
+
if (supportedExtensionsLoaded && this.files && this.files.length > 0) {
|
|
692
|
+
// Validate all files
|
|
693
|
+
const validationPromises = this.files.map((file) => this.validateFileType(file.name));
|
|
694
|
+
const validationResults = await Promise.all(validationPromises);
|
|
695
|
+
const allValid = validationResults.every((valid) => valid);
|
|
696
|
+
this.notSupported = !allValid;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
finally {
|
|
700
|
+
// Whatever failed above, the dialog has to become usable: the loading
|
|
701
|
+
// status carries no close button, so throwing out of here would strand
|
|
702
|
+
// the user on "Loading My Printers…" with no way back.
|
|
703
|
+
this.loading = false;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Fetch the selected printer's capabilities and restore its saved settings.
|
|
708
|
+
*
|
|
709
|
+
* A failure drops the selection rather than keeping a printer the dialog
|
|
710
|
+
* cannot describe: the options would stay disabled while Print stayed
|
|
711
|
+
* enabled, so the job would go out with properties nothing has verified.
|
|
712
|
+
* With no selection the user picks from the list, which fetches again.
|
|
713
|
+
*/
|
|
714
|
+
async loadSelectedPrinterConfig() {
|
|
715
|
+
this.loadingPrinterConfig = true;
|
|
716
|
+
try {
|
|
717
|
+
const data = await this.printService.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id);
|
|
718
|
+
// An empty list or an error body leaves nothing to configure from.
|
|
719
|
+
const config = data === null || data === void 0 ? void 0 : data[0];
|
|
720
|
+
if (!config)
|
|
721
|
+
throw new Error('No properties returned for the selected printer');
|
|
722
|
+
this.selectedPrinterConfig = config;
|
|
723
|
+
applySavedProperties(config, storage.getPrinterSettings(this.selectedPrinter.id), this.selectedProperties);
|
|
724
|
+
this.setPaperid();
|
|
574
725
|
if (this.selectedProperties.paper === '') {
|
|
575
726
|
this.setDefaultPaperFormat();
|
|
576
727
|
}
|
|
577
728
|
}
|
|
578
|
-
|
|
579
|
-
.
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
await this.printService
|
|
584
|
-
.getAllPrinterProperties(authStore.state.accessToken)
|
|
585
|
-
.then((printerConfig) => {
|
|
586
|
-
this.printerConfig = printerConfig;
|
|
587
|
-
});
|
|
588
|
-
if (this.files && this.files.length > 0) {
|
|
589
|
-
// Validate all files
|
|
590
|
-
const validationPromises = this.files.map((file) => this.validateFileType(file.name));
|
|
591
|
-
const validationResults = await Promise.all(validationPromises);
|
|
592
|
-
const allValid = validationResults.every((valid) => valid);
|
|
593
|
-
this.notSupported = !allValid;
|
|
729
|
+
catch (_a) {
|
|
730
|
+
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
731
|
+
}
|
|
732
|
+
finally {
|
|
733
|
+
this.loadingPrinterConfig = false;
|
|
594
734
|
}
|
|
595
|
-
this.loading = false;
|
|
596
735
|
}
|
|
597
736
|
disconnectedCallback() {
|
|
598
737
|
var _a;
|
|
@@ -678,14 +817,14 @@ export class EzpPrinterSelection {
|
|
|
678
817
|
return null;
|
|
679
818
|
}
|
|
680
819
|
render() {
|
|
681
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
820
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
682
821
|
const fileNames = this.files && this.files.length > 0
|
|
683
822
|
? this.files.map((file) => file.name)
|
|
684
823
|
: this.filename
|
|
685
824
|
? [this.filename]
|
|
686
825
|
: [];
|
|
687
826
|
const fileCount = fileNames.length;
|
|
688
|
-
return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } }, h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && this.renderStatus(), !this.hideheader && (h("div", { id: "header" }, h("div", { id: "title" }, h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') }), !this.notSupported && fileCount > 0 && (h("span", { id: "files-badge" }, i18next.t('printer_selection.file_count', { count: fileCount })))), h("div", { id: "header-actions" }, !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })), h("ezp-icon-button", { level: "tertiary", icon: "close", id: "close", type: "button", onClick: this.handleCancel })))), h("div", { id: "body" }, !this.notSupported && fileNames.length > 0 && (h("div", { id: "files-card" }, fileNames.map((name, index) => (h("div", { class: "file-row", key: index }, h("ezp-icon", { name: "file", class: "file-row-icon" }), h("ezp-
|
|
827
|
+
return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } }, h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && this.renderStatus(), !this.hideheader && (h("div", { id: "header" }, h("div", { id: "title" }, h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') }), !this.notSupported && fileCount > 0 && (h("span", { id: "files-badge" }, i18next.t('printer_selection.file_count', { count: fileCount })))), h("div", { id: "header-actions" }, !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })), h("ezp-icon-button", { level: "tertiary", icon: "close", id: "close", type: "button", onClick: this.handleCancel })))), h("div", { id: "body" }, !this.notSupported && fileNames.length > 0 && (h("div", { id: "files-card" }, fileNames.map((name, index) => (h("div", { class: "file-row", key: index }, h("ezp-icon", { name: "file", class: "file-row-icon" }), h("ezp-file-name", { name: name, placement: index === 0 ? 'bottom' : 'top' })))))), h("ezp-label", { id: "printer-caption", level: "tertiary", weight: "heavy", text: i18next.t('printer_selection.printer') }), h("div", { id: "printer-card" }, h("ezp-select", { id: "printer", label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
|
|
689
828
|
? i18next.t('printer_selection.select_printer')
|
|
690
829
|
: i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
691
830
|
id: printer.id,
|
|
@@ -698,43 +837,34 @@ export class EzpPrinterSelection {
|
|
|
698
837
|
title: option.title,
|
|
699
838
|
meta: '',
|
|
700
839
|
type: 'color',
|
|
701
|
-
})), preSelected: this.selectedPrinter.id
|
|
702
|
-
?
|
|
703
|
-
|
|
840
|
+
})), preSelected: this.selectedPrinter.id
|
|
841
|
+
? this.selectedProperties.color
|
|
842
|
+
? i18next.t('printer_selection.color_color')
|
|
843
|
+
: i18next.t('printer_selection.color_grayscale')
|
|
844
|
+
: null, disabled: !this.selectedPrinterConfig.ColorSupported }), h("ezp-select", { label: i18next.t('printer_selection.duplex'), placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_b = this.duplexOptions) === null || _b === void 0 ? void 0 : _b.map((option) => ({
|
|
704
845
|
id: option.id,
|
|
705
846
|
title: option.title,
|
|
706
847
|
meta: '',
|
|
707
848
|
type: 'duplex',
|
|
708
|
-
})), preSelected: this.
|
|
709
|
-
((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
|
|
710
|
-
? i18next.t('printer_selection.duplex_none')
|
|
711
|
-
: ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
|
|
712
|
-
? i18next.t('printer_selection.duplex_long')
|
|
713
|
-
: ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
|
|
714
|
-
? i18next.t('printer_selection.duplex_short')
|
|
715
|
-
: null, disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: i18next.t('printer_selection.size'), placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
|
|
849
|
+
})), preSelected: this.duplexPreSelection(), disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: i18next.t('printer_selection.size'), placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
|
|
716
850
|
this.selectedPrinterConfig.PaperFormats.map((format) => ({
|
|
717
851
|
id: format.Id,
|
|
718
852
|
title: format.Name,
|
|
719
853
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
720
854
|
type: 'format',
|
|
721
|
-
})), preSelected: this.
|
|
722
|
-
((_g = this.selectedPrinterConfig.PaperFormats) === null || _g === void 0 ? void 0 : _g.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper); }))
|
|
723
|
-
? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
|
|
724
|
-
: null, disabled: !(((_k = (_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) > 0) }), this.paperid == PAPER_ID ? (h(Fragment, null, h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }), h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null, h("ezp-select", { label: i18next.t('printer_selection.orientation'), placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: (_l = this.selectedPrinterConfig.OrientationsSupported) === null || _l === void 0 ? void 0 : _l.map((orientation, index) => ({
|
|
855
|
+
})), preSelected: this.paperPreSelection(), disabled: !(((_d = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0) }), this.paperid == PAPER_ID ? (h(Fragment, null, h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }), h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null, h("ezp-select", { label: i18next.t('printer_selection.orientation'), placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: (_e = this.selectedPrinterConfig.OrientationsSupported) === null || _e === void 0 ? void 0 : _e.map((orientation, index) => ({
|
|
725
856
|
id: index + 1,
|
|
726
857
|
title: i18next.t(`printer_selection.orientation_${orientation}`),
|
|
727
858
|
meta: '',
|
|
728
859
|
type: 'orientation',
|
|
729
|
-
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(((
|
|
860
|
+
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(((_g = (_f = this.selectedPrinterConfig.OrientationsSupported) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0) > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_h = this.selectedPrinterConfig.Resolutions) === null || _h === void 0 ? void 0 : _h.map((option, index) => ({
|
|
730
861
|
id: index,
|
|
731
862
|
title: option,
|
|
732
863
|
meta: '',
|
|
733
864
|
type: 'quality',
|
|
734
|
-
})), preSelected: this.selectedPrinter.id
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
: null, disabled: !(((_u = (_t = this.selectedPrinterConfig.Resolutions) === null || _t === void 0 ? void 0 : _t.length) !== null && _u !== void 0 ? _u : 0) > 0) }), this.selectedPrinterConfig.Trays &&
|
|
865
|
+
})), preSelected: this.selectedPrinter.id
|
|
866
|
+
? this.selectedProperties.resolution || null
|
|
867
|
+
: null, disabled: !(((_k = (_j = this.selectedPrinterConfig.Resolutions) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) > 0) }), this.selectedPrinterConfig.Trays &&
|
|
738
868
|
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
739
869
|
this.selectedPrinterConfig.Trays[0] != null ? (h("ezp-select", { label: i18next.t('printer_selection.trays'), placeholder: i18next.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1
|
|
740
870
|
? this.selectedPrinterConfig.Trays.map((trays) => ({
|
|
@@ -743,10 +873,7 @@ export class EzpPrinterSelection {
|
|
|
743
873
|
meta: '',
|
|
744
874
|
type: 'tray',
|
|
745
875
|
}))
|
|
746
|
-
: undefined, preSelected: this.
|
|
747
|
-
((_v = this.selectedPrinterConfig.Trays) === null || _v === void 0 ? void 0 : _v.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Tray); }))
|
|
748
|
-
? (_w = this.selectedPrinterConfig.Default) === null || _w === void 0 ? void 0 : _w.Tray
|
|
749
|
-
: null })) : null, h("ezp-input", { suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') }))), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), h("button", { id: "print", type: "button", disabled: this.printDisabled, onClick: this.handlePrint, ref: (button) => (this.printButton = button) }, h("ezp-icon", { name: "printer" }), h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') }))), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
876
|
+
: undefined, preSelected: this.trayPreSelection() })) : null, h("ezp-input", { suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') }))), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), h("button", { id: "print", type: "button", disabled: this.printDisabled, onClick: this.handlePrint, ref: (button) => (this.printButton = button) }, h("ezp-icon", { name: "printer" }), h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') }))), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
750
877
|
}
|
|
751
878
|
static get is() { return "ezp-printer-selection"; }
|
|
752
879
|
static get encapsulation() { return "shadow"; }
|
|
@@ -980,6 +1107,7 @@ export class EzpPrinterSelection {
|
|
|
980
1107
|
"printerConfig": {},
|
|
981
1108
|
"selectedPrinterConfig": {},
|
|
982
1109
|
"selectedProperties": {},
|
|
1110
|
+
"loadingPrinterConfig": {},
|
|
983
1111
|
"paperid": {},
|
|
984
1112
|
"currentFileIndex": {},
|
|
985
1113
|
"totalFiles": {},
|
|
@@ -341,7 +341,7 @@ export class EzpPrinting {
|
|
|
341
341
|
*
|
|
342
342
|
*/
|
|
343
343
|
render() {
|
|
344
|
-
return (h(Host, { key: '
|
|
344
|
+
return (h(Host, { key: '988a7acf819e139fe6d103b122bf9181e848be82', class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
345
345
|
? this.systemAppearance
|
|
346
346
|
: userStore.state.appearance} ${this.seamless ? 'seamless' : ''}` }, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger, code: this.code })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, files: this.files, hidemenu: this.hidemenu, hideheader: this.hideheader, seamless: this.seamless })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
|
|
347
347
|
}
|
|
@@ -209,7 +209,7 @@ export class EzpSelect {
|
|
|
209
209
|
this.disabled ? 'disabled' : '',
|
|
210
210
|
];
|
|
211
211
|
const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
|
|
212
|
-
return (h(Host, { key: '
|
|
212
|
+
return (h(Host, { key: '7dd328df209e8906917c97b8002bdcd9e2fafa0b', class: hostClasses.join(' ') }, h("div", { key: '522bbbfea1ef111af7bd7317cc6054138eca020d', id: "wrap" }, h("div", { key: 'd1c2c06a33f629d589e2247342467ebbd7283d1b', id: "toggle", role: "combobox", "aria-haspopup": "listbox", "aria-controls": "list", "aria-expanded": this.expanded ? 'true' : 'false', "aria-label": this.label, "aria-disabled": this.disabled ? 'true' : 'false', tabindex: this.disabled ? -1 : 0, ref: (el) => (this.toggleEl = el), onClick: () => !this.disabled && this.toggle(), onKeyDown: this.handleToggleKeydown }, this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: 'c60d6dd802424b2502d1b9c9066732ef02909779', id: "label", noWrap: true, level: labelLevel, text: this.label }), h("ezp-label", { key: 'c92c91c848aec5b6ff386f32beb41bdaf4407613', id: "value", ellipsis: true, text: ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.title) !== '' ? (_b = this.selected) === null || _b === void 0 ? void 0 : _b.title : this.placeholder }), h("ezp-icon", { key: '7c653c97c7da8471e7db51c1ba04718842a9991b', id: "accessory", name: "expand" })), h("div", { key: '5c1aeeb45f4cbf1c4e26653312d6cc0a7e7084ce', id: "list", role: "listbox", "aria-label": this.label, ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
|
|
213
213
|
var _a, _b;
|
|
214
214
|
if (option.title !== '') {
|
|
215
215
|
return (h("div", { class: `option ${option.id === ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, role: "option", "aria-selected": option.id === ((_b = this.selected) === null || _b === void 0 ? void 0 : _b.id) ? 'true' : 'false', tabindex: this.expanded ? 0 : -1, onClick: () => this.select(option.id), onKeyDown: (event) => this.handleOptionKeydown(event, option.id) }, h("ezp-icon", { name: "checkmark", class: "indicator" }), h("div", { class: "details" }, h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
|
|
@@ -46,9 +46,9 @@ export class EzpStatus {
|
|
|
46
46
|
return (
|
|
47
47
|
// Live region so screen readers announce status changes (loading,
|
|
48
48
|
// processing, success, error) as they render.
|
|
49
|
-
h(Host, { key: '
|
|
49
|
+
h(Host, { key: 'db32e5667bf9438a6d3d80807519ad2c158549ff', role: "status", "aria-live": "polite" }, h("div", { key: '815ecfbd3b272f206764ca852b8d865d7bc3cb8d', id: "box" }, this.processing ? (h("svg", { id: "indicator", viewBox: "0 0 42 42", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("circle", { id: "track", cx: "21", cy: "21", r: "18" }), h("circle", { id: "value", cx: "21", cy: "21", r: "18" }))) : this.icon ? (h("div", { id: "icon" }, h("div", { id: "icon-inner" }, h("ezp-icon", { name: this.icon })))) : null, h("ezp-label", { key: '385d4fbbd7ed1b7a4aa2334d6d2145c2f5207508', id: "description", weight: "heavy", text: this.description }), this.subtext && (h("ezp-label", { key: 'c6a243dd4ddc428f3e34021430d6b935f0a9e1a6', id: "subtext", level: "secondary", text: this.subtext })), (this.cancel || this.close || this.retry) && (h("div", { key: '0dfc5f86b6366b3631ac74c15e9d467a884feb52', id: "footer" }, this.cancel && (h("ezp-text-button", { key: 'a89289163ac7d630d35e887deead462c6dc29af4', class: "action secondary", level: "secondary", onClick: this.handleCancel, label: typeof this.cancel === 'string'
|
|
50
50
|
? this.cancel
|
|
51
|
-
: i18next.t('button_actions.cancel') })), this.close && (h("ezp-text-button", { key: '
|
|
51
|
+
: i18next.t('button_actions.cancel') })), this.close && (h("ezp-text-button", { key: 'd2e3814f2a81ce03f4e0f4bbcf7cc734ade37aa9', class: `action ${this.retry ? 'secondary' : 'primary'}`, level: this.retry ? 'secondary' : 'primary', onClick: this.handleClose, label: typeof this.close === 'string' ? this.close : i18next.t('button_actions.close') })), this.retry && (h("ezp-text-button", { key: '6e53e77afc6c3954435b08c6daaa65dd829ce9ad', class: "action primary", level: "primary", onClick: this.handleRetry, label: typeof this.retry === 'string' ? this.retry : i18next.t('button_actions.retry') })))))));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "ezp-status"; }
|
|
54
54
|
static get encapsulation() { return "shadow"; }
|
|
@@ -127,7 +127,7 @@ export class EzpStepper {
|
|
|
127
127
|
*
|
|
128
128
|
*/
|
|
129
129
|
render() {
|
|
130
|
-
return (h(Host, { key: '
|
|
130
|
+
return (h(Host, { key: 'cbf3ded61537359ed280a204bb71240d0a34473a', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { key: '1c7a265f60d06dbea4a80e19ecdaa4a10aed694c', id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '9fd0e1128480dd9b288cb266542fd4e6b83ceebd', id: "label", noWrap: true, text: this.label }), h("div", { key: '975fc0539e76750d7457c71d40f228cb5ebcaad8', class: "buttons" }, h("button", { key: 'db01d05fdcbc4eda2810751ace0194d9a1ec9eb7', class: "button", type: "button", "aria-label": `Decrease ${this.label}`, disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { key: '7d938efa8426caf292403e94e3565d20dc40d121', name: "minus" })), h("input", { key: 'dbff518a5d1f28b3b23d597947c250bef71fd68a', id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max !== undefined ? this.max.toString() : undefined, value: this.value.toString(), "aria-label": this.label, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), h("button", { key: 'b3001bb27f94f65fce51d3a69d7713e5da9ccdcc', class: "button", type: "button", "aria-label": `Increase ${this.label}`, disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { key: '534bb499fa2ced2591ccbc137186e59d22aa2f5f', name: "plus" })))));
|
|
131
131
|
}
|
|
132
132
|
static get is() { return "ezp-stepper"; }
|
|
133
133
|
static get encapsulation() { return "shadow"; }
|
|
@@ -31,7 +31,7 @@ export class EzpTextButton {
|
|
|
31
31
|
href: this.href,
|
|
32
32
|
target: this.blank ? '_blank' : '_self',
|
|
33
33
|
};
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '31c3726d82b340fad817eec01f597b58702ff292', class: `${this.level}` }, h(TagType, Object.assign({ key: '5e26c8e81ab49575b1a29c309f7792a2286ee455', id: "button", "aria-label": this.label }, attributes), h("ezp-label", { key: 'b21b121c9da908b6cba286a528f8e6772c179a36', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "ezp-text-button"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -177,10 +177,11 @@
|
|
|
177
177
|
* File list
|
|
178
178
|
*
|
|
179
179
|
*/
|
|
180
|
+
/* Deliberately not `overflow: hidden` — that would clip a row's tooltip. Only
|
|
181
|
+
`#add-more` paints to the edge, so it rounds its own corners instead. */
|
|
180
182
|
#files {
|
|
181
183
|
border: 1px solid var(--ezp-core-outline);
|
|
182
184
|
border-radius: 12px;
|
|
183
|
-
overflow: hidden;
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
.file {
|
|
@@ -189,6 +190,8 @@
|
|
|
189
190
|
gap: var(--ezp-spacing-3);
|
|
190
191
|
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
191
192
|
padding: var(--ezp-spacing-3) var(--ezp-spacing-4);
|
|
193
|
+
/* Anchors the file name's tooltip, so it can span the row. */
|
|
194
|
+
position: relative;
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
.file + .file {
|
|
@@ -255,6 +258,7 @@
|
|
|
255
258
|
appearance: none;
|
|
256
259
|
background: var(--ezp-upload-addMore-background, transparent);
|
|
257
260
|
border: 0;
|
|
261
|
+
border-radius: 0 0 11px 11px;
|
|
258
262
|
border-top: 1px solid var(--ezp-core-outline);
|
|
259
263
|
color: var(--ezp-theme-solid);
|
|
260
264
|
cursor: pointer;
|
|
@@ -152,7 +152,7 @@ export class EzpUpload {
|
|
|
152
152
|
*/
|
|
153
153
|
render() {
|
|
154
154
|
const hasFiles = this.selectedFiles.length > 0;
|
|
155
|
-
return (h(Host, { key: '
|
|
155
|
+
return (h(Host, { key: 'f20f756ca7522ab7d27e5c9fff743db9ba26b101', class: { dragging: this.dragging } }, h("form", { key: 'abafb9a19d3dff7da26c8250ea94bbc7876cbc3a', id: "form", ref: (form) => (this.form = form) }, h("input", { key: '09397ebf4641190fdd1af13af537cde9f87257d2', type: "file", name: "input", id: "input", multiple: true, "aria-label": i18next.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), h("div", { key: '0365f750bc55d98a95008bcf404f77b247480d81', id: "modal" }, h("div", { key: '82d8d8ff21977d36a3f18c704002d1a8cdad9016', id: "body-frame" }, h("div", { key: 'ef05d508f0341f92d5e987deb469b2759ee28f1b', id: "body" }, !hasFiles && (h("div", { key: '7885aad8082bedf42ef824ad06a388ed3a083987', id: "dropzone" }, h("ezp-icon", { key: '25707aa1f7018c7942ca5c82a35c4a74f73f5e70', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '2dfb59ce766671396164fcd63d25ef9b04981d01', id: "dropzone-title", level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') }), h("div", { key: 'b831d79aab06973e47666e129e89ba23d3e8a3a4', id: "dropzone-prompt" }, h("ezp-text-button", { key: '2ade7d526019a71b493e00e6737ca13769cccd29', id: "choose", type: "button", onClick: this.openPicker, label: i18next.t('upload.choose_files') }), h("ezp-label", { key: '79903c44e2a82b39c97606aa1ccbe9cb28a42c48', id: "drag-hint", level: "secondary", weight: "strong", text: i18next.t('upload.drag_hint') }), h("ezp-label", { key: '895d43cada83fade39b8d67e70782b9b9fea747c', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '6c825ac2791e82271669a7824ed720b127290242', id: "files" }, this.selectedFiles.map((file, index) => (h("div", { key: this.fileKey(file), class: "file" }, h("span", { class: "file-type", "aria-hidden": "true" }, this.fileType(file.name)), h("div", { class: "file-details" }, h("ezp-file-name", { class: "file-name", weight: "heavy", name: file.name, placement: index === 0 ? 'bottom' : 'top' }), h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), h("button", { type: "button", class: "file-remove", "aria-label": i18next.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index) }, h("ezp-icon", { name: "close" }))))), h("button", { key: 'da8562e56c4006952efa239e8076f333ae27b1be', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: '6b2565bb3a9d4eca02079923ffdee36d5184d10f', name: "plus" }), h("ezp-label", { key: '59ecc6b13ca9fa66b8f04944c57ba680e3bab0f8', level: "secondary", weight: "heavy", text: i18next.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: '26e2552f69637448b3663f9342c421ec29abcca8', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: '0f409daf2c6fc5f3f103f4d4450970aea7edb0c7', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '1e19c3e44aac998ad35671435cfe96a27633b170', level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') })))), h("div", { key: '31d0106aea747008bf2c2760e4cd8ab0e637144b', id: "footer" }, h("ezp-text-button", { key: '24c6c9f25de785443402ac3aa08975c58779faea', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: i18next.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: 'cd0fb877a2a7a756cfbe6aa2fdbacaedbe4c8efb', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: i18next.t('upload.continue'), class: "action" }))))));
|
|
156
156
|
}
|
|
157
157
|
static get is() { return "ezp-upload"; }
|
|
158
158
|
static get encapsulation() { return "shadow"; }
|
|
@@ -84,7 +84,7 @@ export class EzpUserMenu {
|
|
|
84
84
|
*
|
|
85
85
|
*/
|
|
86
86
|
render() {
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: 'cd2505f64646e8f23d534896c01fcd246d974c2f', class: this.open ? 'is-open' : '' }, h("div", { key: '65df837d1eee8b2275f8c0ef72b039c7ae6d08cd', id: "header" }, h("ezp-label", { key: '3ca9bc9d616de1e4efc686f77bcdaa39dab3f18d', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '119abe7450937b7cf2e70ff3ed96d01f3f0aff9d', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '90f40d22672bc65cbf988cf2ab57cbc088218cfd', id: "links" }, this.links.map((link) => (h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, h("ezp-icon", { class: "link__icon", name: link.icon }), h("ezp-label", { text: link.title })))), h("a", { key: '94df9033da5697739c690a180ed2df318f803511', class: "link", onClick: this.logOut }, h("ezp-icon", { key: '609044f6d8255e4378aee226e16c29e9242c8259', class: "link__icon", name: "logout" }), h("ezp-label", { key: '20953a49845a8c4e75081c597d8e916c3b159b51', text: i18next.t('user_menu.logout') }))), h("div", { key: '4b96f92ceb1047c4a88f0b33406a297323eded75', id: "theme" }, h("ezp-label", { key: '156893ed3703f63ee826e4887fa711469603b6c8', class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '2ee3ec8725a98d5dc7d7f792fed969c2dea357f4', id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, h("span", { class: "dot" })))))), h("div", { key: 'd78d2b935d9cdb15df66d761dd9290a68db09e9c', id: "appearance" }, h("ezp-label", { key: 'f290affaf49bd01a06f576a4d52b3d1936dbdb23', class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: '8087488313dbd2898280d3abb6244485b97e4ee4', id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, h("ezp-icon", { name: appearance.name }), h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
|
|
88
88
|
}
|
|
89
89
|
static get is() { return "ezp-user-menu"; }
|
|
90
90
|
static get encapsulation() { return "shadow"; }
|