@ezeep/ezeep-js 1.0.294 → 1.0.306
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} +674 -110
- 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 +411 -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 +31 -3
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +243 -90
- package/dist/collection/components/ezp-printing/ezp-printing.js +20 -2
- 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 +26 -1
- package/dist/collection/components/ezp-upload/ezp-upload.js +14 -3
- 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 +2 -0
- package/dist/collection/utils/printer.js +75 -1
- package/dist/collection/utils/utils.js +29 -0
- 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 +38 -4
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +674 -111
- 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-646c1d42.entry.js +1 -0
- package/dist/ezeep/p-8e2d88a9.system.entry.js +7 -0
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
- package/dist/ezeep/types/shared/types.d.ts +2 -0
- package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +125 -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 +48 -2
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +9 -2
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +4 -0
- package/dist/types/components.d.ts +82 -3
- package/dist/types/shared/storage.d.ts +18 -4
- package/dist/types/shared/types.d.ts +2 -0
- package/dist/types/utils/printer.d.ts +18 -0
- package/dist/types/utils/utils.d.ts +20 -1
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/p-646c1d42.entry.js +1 -0
- package/www/build/p-70951744.js +1 -0
- package/www/build/p-8e2d88a9.system.entry.js +7 -0
- package/www/build/p-DCznw2Ee.system.js +1 -1
- package/www/index.html +1 -1
- package/dist/ezeep/p-3ab5a223.entry.js +0 -1
- package/dist/ezeep/p-fe700ca4.system.entry.js +0 -7
- package/www/build/p-3ab5a223.entry.js +0 -1
- package/www/build/p-65242d5e.js +0 -1
- package/www/build/p-fe700ca4.system.entry.js +0 -7
|
@@ -2763,6 +2763,35 @@ function subscribeToLanguageChange(component) {
|
|
|
2763
2763
|
instance.on('languageChanged', rerender);
|
|
2764
2764
|
return () => instance.off('languageChanged', rerender);
|
|
2765
2765
|
}
|
|
2766
|
+
/** Index of the first child of a scroll container that is at least half in
|
|
2767
|
+
* view, or -1 when it has none. Lists use it to open the topmost visible row's
|
|
2768
|
+
* tooltip downwards, as nothing in the list is left above that row to cover.
|
|
2769
|
+
* A row showing only a sliver doesn't count: the row below it is the one the
|
|
2770
|
+
* user reads first, and that one should open downwards. */
|
|
2771
|
+
function firstVisibleChild(container) {
|
|
2772
|
+
const top = container.getBoundingClientRect().top;
|
|
2773
|
+
return Array.from(container.children).findIndex((child) => {
|
|
2774
|
+
const rect = child.getBoundingClientRect();
|
|
2775
|
+
return (rect.top + rect.bottom) / 2 > top;
|
|
2776
|
+
});
|
|
2777
|
+
}
|
|
2778
|
+
/**
|
|
2779
|
+
* Side a tooltip should open on, given where it was asked to open and the room
|
|
2780
|
+
* there is. The requested side wins whenever the bubble fits there; otherwise
|
|
2781
|
+
* it flips to the other side if that fits, or if that simply has more room.
|
|
2782
|
+
* All values are in the same (screen) pixels.
|
|
2783
|
+
*/
|
|
2784
|
+
function pickTooltipSide(requested, row, needed, visible) {
|
|
2785
|
+
const above = row.top - visible.top;
|
|
2786
|
+
const below = visible.bottom - row.bottom;
|
|
2787
|
+
const room = { top: above, bottom: below };
|
|
2788
|
+
const other = requested === 'top' ? 'bottom' : 'top';
|
|
2789
|
+
if (room[requested] >= needed)
|
|
2790
|
+
return requested;
|
|
2791
|
+
if (room[other] >= needed || room[other] > room[requested])
|
|
2792
|
+
return other;
|
|
2793
|
+
return requested;
|
|
2794
|
+
}
|
|
2766
2795
|
function encodeFormData(data) {
|
|
2767
2796
|
return Object.keys(data)
|
|
2768
2797
|
.map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))
|
|
@@ -2880,8 +2909,10 @@ const KEY = {
|
|
|
2880
2909
|
accessToken: 'access_token',
|
|
2881
2910
|
refreshToken: 'refreshToken',
|
|
2882
2911
|
isAuthorized: 'isAuthorized',
|
|
2912
|
+
/** Legacy single-printer settings blob, read once to seed `printerSettings`. */
|
|
2883
2913
|
properties: 'properties',
|
|
2884
2914
|
printer: 'printer',
|
|
2915
|
+
printerSettings: 'printerSettings',
|
|
2885
2916
|
};
|
|
2886
2917
|
function getJSON(key) {
|
|
2887
2918
|
const raw = localStorage.getItem(key);
|
|
@@ -2912,32 +2943,60 @@ const storage = {
|
|
|
2912
2943
|
hasIsAuthorized() {
|
|
2913
2944
|
return localStorage.getItem(KEY.isAuthorized) !== null;
|
|
2914
2945
|
},
|
|
2915
|
-
|
|
2916
|
-
|
|
2946
|
+
/**
|
|
2947
|
+
* Settings the user last printed with on `printerId`, or null if that printer
|
|
2948
|
+
* has none yet. Kept per printer so switching printers never carries another
|
|
2949
|
+
* printer's paper size or tray over to one that may not have it.
|
|
2950
|
+
*/
|
|
2951
|
+
getPrinterSettings(printerId) {
|
|
2952
|
+
var _a;
|
|
2953
|
+
return (_a = readPrinterSettings()[printerId]) !== null && _a !== void 0 ? _a : null;
|
|
2917
2954
|
},
|
|
2918
|
-
|
|
2919
|
-
|
|
2955
|
+
setPrinterSettings(printerId, properties) {
|
|
2956
|
+
const all = readPrinterSettings();
|
|
2957
|
+
all[printerId] = properties;
|
|
2958
|
+
localStorage.setItem(KEY.printerSettings, JSON.stringify(all));
|
|
2920
2959
|
},
|
|
2960
|
+
/** The printer used for the last print, preselected when the dialog reopens. */
|
|
2921
2961
|
getPrinter() {
|
|
2922
2962
|
return getJSON(KEY.printer);
|
|
2923
2963
|
},
|
|
2924
2964
|
setPrinter(printer) {
|
|
2925
2965
|
localStorage.setItem(KEY.printer, JSON.stringify(printer));
|
|
2926
2966
|
},
|
|
2927
|
-
/**
|
|
2967
|
+
/**
|
|
2968
|
+
* Remove everything tied to the current session (used on logout).
|
|
2969
|
+
*
|
|
2970
|
+
* Print settings and the last printer deliberately survive: they belong to
|
|
2971
|
+
* this browser profile rather than to the session, and are validated against
|
|
2972
|
+
* the signed-in user's printers on the next load (an unknown printer resets
|
|
2973
|
+
* the selection), so the next user never inherits a selection they can't use.
|
|
2974
|
+
*/
|
|
2928
2975
|
clearSession() {
|
|
2929
|
-
localStorage.removeItem(KEY.properties);
|
|
2930
2976
|
localStorage.removeItem(KEY.refreshToken);
|
|
2931
2977
|
localStorage.removeItem(KEY.accessToken);
|
|
2932
|
-
localStorage.removeItem(KEY.printer);
|
|
2933
2978
|
localStorage.removeItem(KEY.isAuthorized);
|
|
2934
2979
|
},
|
|
2935
|
-
/**
|
|
2980
|
+
/** Forget which printer was last used (when it is gone from the user's list).
|
|
2981
|
+
* Its settings stay put, ready in case that printer comes back. */
|
|
2936
2982
|
clearSavedPrinter() {
|
|
2937
2983
|
localStorage.removeItem(KEY.printer);
|
|
2938
|
-
localStorage.removeItem(KEY.properties);
|
|
2939
2984
|
},
|
|
2940
2985
|
};
|
|
2986
|
+
/**
|
|
2987
|
+
* Read the per-printer settings map, seeding it once from the pre-upgrade
|
|
2988
|
+
* single-printer blob so a user who already printed keeps those settings.
|
|
2989
|
+
*/
|
|
2990
|
+
function readPrinterSettings() {
|
|
2991
|
+
const stored = getJSON(KEY.printerSettings);
|
|
2992
|
+
if (stored)
|
|
2993
|
+
return stored;
|
|
2994
|
+
const legacy = getJSON(KEY.properties);
|
|
2995
|
+
const legacyPrinter = getJSON(KEY.printer);
|
|
2996
|
+
if (legacy && (legacyPrinter === null || legacyPrinter === void 0 ? void 0 : legacyPrinter.id))
|
|
2997
|
+
return { [legacyPrinter.id]: legacy };
|
|
2998
|
+
return {};
|
|
2999
|
+
}
|
|
2941
3000
|
|
|
2942
3001
|
class EzpAuthorizationService {
|
|
2943
3002
|
constructor(redirectURI, clientID) {
|
|
@@ -3353,6 +3412,260 @@ const EzpDialog = class {
|
|
|
3353
3412
|
};
|
|
3354
3413
|
EzpDialog.style = ezpDialogCss();
|
|
3355
3414
|
|
|
3415
|
+
const ezpFileNameCss = () => `@charset "UTF-8";:host{display:block;min-width:0}#trigger{-ms-flex-align:baseline;align-items:baseline;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:4px;color:inherit;cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;margin:0;max-width:100%;min-width:0;outline-color:var(--ezp-theme-solid);outline-offset:2px;padding:0;text-align:left}.head{-ms-flex:0 1 auto;flex:0 1 auto;min-width:0}.tail{-ms-flex:0 0 auto;flex:0 0 auto}:host(:not(.expanded)) .head,:host(:not(.expanded)) .tail{--ezp-label-whiteSpace:pre}:host(.expanded) .head{--ezp-label-whiteSpace:pre-wrap}:host(.expanded) #trigger{word-break:break-all}#tooltip{background:var(--ezp-core-surface-tertiary);border-radius:8px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);color:var(--ezp-core-foreground-primary);font-size:12px;font-weight:500;left:0;line-height:18px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);pointer-events:auto;position:absolute;right:0;word-break:break-all;z-index:10}:host(.place-top) #tooltip{bottom:calc(100% + var(--ezp-spacing-2))}:host(.place-bottom) #tooltip{top:calc(100% + var(--ezp-spacing-2))}`;
|
|
3416
|
+
|
|
3417
|
+
/**
|
|
3418
|
+
* Characters kept at the end of a truncated name. Uploads often differ only in
|
|
3419
|
+
* a suffix like `_DE.pdf`, which a plain end-ellipsis would be the first thing
|
|
3420
|
+
* to hide, so that tail is held back and the middle gives way instead.
|
|
3421
|
+
*/
|
|
3422
|
+
const TAIL_LENGTH = 8;
|
|
3423
|
+
/** Hovering across a list shouldn't flash a tooltip over every row in passing. */
|
|
3424
|
+
const OPEN_DELAY_MS = 300;
|
|
3425
|
+
/** Grace period for crossing the gap between the name and the bubble, so the
|
|
3426
|
+
* tooltip can be hovered rather than vanishing on the way (WCAG 1.4.13). */
|
|
3427
|
+
const CLOSE_DELAY_MS = 200;
|
|
3428
|
+
const EzpFileName = class {
|
|
3429
|
+
constructor(hostRef) {
|
|
3430
|
+
registerInstance(this, hostRef);
|
|
3431
|
+
/** Invalidates an in-flight open when the pointer leaves. */
|
|
3432
|
+
this.openGeneration = 0;
|
|
3433
|
+
/** Everything the open tooltip listens to for scrolling, to detach on close. */
|
|
3434
|
+
this.scrollTargets = [];
|
|
3435
|
+
/**
|
|
3436
|
+
*
|
|
3437
|
+
* Properties
|
|
3438
|
+
*
|
|
3439
|
+
*/
|
|
3440
|
+
/** The full file name. Always present in the DOM, so screen readers and
|
|
3441
|
+
* copy-paste get it in full however it is truncated on screen. */
|
|
3442
|
+
this.name = '';
|
|
3443
|
+
/** Type scale of the rendered name, passed through to `ezp-label`. */
|
|
3444
|
+
this.level = 'secondary';
|
|
3445
|
+
/** Font weight of the rendered name, passed through to `ezp-label`. */
|
|
3446
|
+
this.weight = 'soft';
|
|
3447
|
+
/** Side the tooltip opens on. Consumers point it away from the edge their
|
|
3448
|
+
* row sits against — `bottom` for the first row of a list, `top` below it. */
|
|
3449
|
+
this.placement = 'top';
|
|
3450
|
+
/** What the tooltip is placed against.
|
|
3451
|
+
*
|
|
3452
|
+
* `container`: the nearest positioned ancestor, by CSS alone. The consumer
|
|
3453
|
+
* makes the row that ancestor, and the bubble opens at the row's edge.
|
|
3454
|
+
*
|
|
3455
|
+
* `parent`: the row the name sits in, measured when the tooltip opens — the
|
|
3456
|
+
* closest ancestor marked `data-tooltip-row`, or else the name's parent
|
|
3457
|
+
* element. For rows inside a scroll container, which would clip a bubble
|
|
3458
|
+
* anchored to the row. The consumer puts the positioned ancestor outside the
|
|
3459
|
+
* scroller instead, and the bubble spans that ancestor but lines up with
|
|
3460
|
+
* the row. */
|
|
3461
|
+
this.anchor = 'container';
|
|
3462
|
+
/**
|
|
3463
|
+
*
|
|
3464
|
+
* States
|
|
3465
|
+
*
|
|
3466
|
+
*/
|
|
3467
|
+
/** Set by tapping the name: shows it in full, wrapped over several lines.
|
|
3468
|
+
* This is the touch counterpart of the tooltip, which needs a pointer. */
|
|
3469
|
+
this.expanded = false;
|
|
3470
|
+
this.tooltipOpen = false;
|
|
3471
|
+
this.openTooltip = () => {
|
|
3472
|
+
if (!this.hasHover || this.expanded)
|
|
3473
|
+
return;
|
|
3474
|
+
clearTimeout(this.openTimeout);
|
|
3475
|
+
const generation = ++this.openGeneration;
|
|
3476
|
+
this.openTimeout = setTimeout(async () => {
|
|
3477
|
+
const clipped = await this.isClipped();
|
|
3478
|
+
// Measuring yields, and the pointer may have moved on in the meantime —
|
|
3479
|
+
// opening now would leave a tooltip behind with nothing to dismiss it.
|
|
3480
|
+
if (clipped && generation === this.openGeneration)
|
|
3481
|
+
this.tooltipOpen = true;
|
|
3482
|
+
}, OPEN_DELAY_MS);
|
|
3483
|
+
};
|
|
3484
|
+
this.closeTooltip = () => {
|
|
3485
|
+
this.openGeneration++;
|
|
3486
|
+
clearTimeout(this.openTimeout);
|
|
3487
|
+
clearTimeout(this.closeTimeout);
|
|
3488
|
+
this.tooltipOpen = false;
|
|
3489
|
+
};
|
|
3490
|
+
/** Leaves the tooltip up briefly so the pointer can reach it. */
|
|
3491
|
+
this.scheduleClose = () => {
|
|
3492
|
+
clearTimeout(this.openTimeout);
|
|
3493
|
+
clearTimeout(this.closeTimeout);
|
|
3494
|
+
this.closeTimeout = setTimeout(this.closeTooltip, CLOSE_DELAY_MS);
|
|
3495
|
+
};
|
|
3496
|
+
this.cancelScheduledClose = () => {
|
|
3497
|
+
clearTimeout(this.closeTimeout);
|
|
3498
|
+
};
|
|
3499
|
+
this.toggleExpanded = () => {
|
|
3500
|
+
this.expanded = !this.expanded;
|
|
3501
|
+
// The full name is on screen now; a tooltip repeating it is just in the way.
|
|
3502
|
+
if (this.expanded)
|
|
3503
|
+
this.closeTooltip();
|
|
3504
|
+
};
|
|
3505
|
+
}
|
|
3506
|
+
/**
|
|
3507
|
+
*
|
|
3508
|
+
* Lifecycle methods
|
|
3509
|
+
*
|
|
3510
|
+
*/
|
|
3511
|
+
disconnectedCallback() {
|
|
3512
|
+
// Closing also drops the listeners. A node that is moved comes back with
|
|
3513
|
+
// its tooltip shut, rather than open with nothing left to close it.
|
|
3514
|
+
this.closeTooltip();
|
|
3515
|
+
this.stopWatchingScroll();
|
|
3516
|
+
}
|
|
3517
|
+
componentDidRender() {
|
|
3518
|
+
if (this.tooltipOpen && this.anchor === 'parent')
|
|
3519
|
+
this.placeTooltip();
|
|
3520
|
+
}
|
|
3521
|
+
/**
|
|
3522
|
+
*
|
|
3523
|
+
* Watchers
|
|
3524
|
+
*
|
|
3525
|
+
*/
|
|
3526
|
+
/** A measured bubble stays where it was put, so once the row scrolls away
|
|
3527
|
+
* under it, it would point at the wrong name. Closing it is the honest fix. */
|
|
3528
|
+
watchTooltipOpen(open) {
|
|
3529
|
+
if (open && this.anchor === 'parent')
|
|
3530
|
+
this.watchScroll();
|
|
3531
|
+
else
|
|
3532
|
+
this.stopWatchingScroll();
|
|
3533
|
+
}
|
|
3534
|
+
/**
|
|
3535
|
+
*
|
|
3536
|
+
* Listeners
|
|
3537
|
+
*
|
|
3538
|
+
*/
|
|
3539
|
+
/**
|
|
3540
|
+
* Escape dismisses the tooltip, and only the tooltip.
|
|
3541
|
+
*
|
|
3542
|
+
* Listening globally catches the key however the tooltip was opened,
|
|
3543
|
+
* including by hover, when nothing here has focus. It has to run in the
|
|
3544
|
+
* capture phase: stopping propagation on the way back up happens after every
|
|
3545
|
+
* ancestor has already seen the key, so a host app that closes its dialog on
|
|
3546
|
+
* Escape would close it as the tooltip was dismissed.
|
|
3547
|
+
*
|
|
3548
|
+
* `window` rather than `document`, because dialog libraries capture on the
|
|
3549
|
+
* document themselves — Radix's `DismissableLayer` does — and register before
|
|
3550
|
+
* a component mounted inside them, so they would still see the key first.
|
|
3551
|
+
* Capture runs window before document, so this transient layer consumes the
|
|
3552
|
+
* key first, and only while it is actually open.
|
|
3553
|
+
*/
|
|
3554
|
+
handleKeyDown(event) {
|
|
3555
|
+
if (event.key === 'Escape' && this.tooltipOpen) {
|
|
3556
|
+
event.stopPropagation();
|
|
3557
|
+
this.closeTooltip();
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
/**
|
|
3561
|
+
*
|
|
3562
|
+
* Private methods
|
|
3563
|
+
*
|
|
3564
|
+
*/
|
|
3565
|
+
/** Tooltips need a pointer; touch devices get the tap-to-expand path instead.
|
|
3566
|
+
* Tapping fires a synthetic `mouseenter` in most mobile browsers, so without
|
|
3567
|
+
* this check a tooltip would open on every tap. */
|
|
3568
|
+
get hasHover() {
|
|
3569
|
+
var _a, _b;
|
|
3570
|
+
return (_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(hover: hover)').matches) !== null && _b !== void 0 ? _b : false;
|
|
3571
|
+
}
|
|
3572
|
+
/** Whether anything is actually hidden. A name that fits needs no tooltip —
|
|
3573
|
+
* repeating text the reader can already see is just noise in the way. */
|
|
3574
|
+
async isClipped() {
|
|
3575
|
+
var _a, _b;
|
|
3576
|
+
const head = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.head');
|
|
3577
|
+
if (!head)
|
|
3578
|
+
return false;
|
|
3579
|
+
await ((_b = head.componentOnReady) === null || _b === void 0 ? void 0 : _b.call(head));
|
|
3580
|
+
return head.isTruncated();
|
|
3581
|
+
}
|
|
3582
|
+
/** Lines the bubble up with the row the name sits in. Its containing block
|
|
3583
|
+
* is somewhere further out, so `top: 0` shows where that block starts, and
|
|
3584
|
+
* the offset is taken from there. Measurements are in screen pixels, which
|
|
3585
|
+
* differ from CSS pixels when a host scales the dialog with a transform, so
|
|
3586
|
+
* the offset is converted back before it is applied.
|
|
3587
|
+
*
|
|
3588
|
+
* `placement` is a preference here: a row near the edge of whatever clips
|
|
3589
|
+
* the bubble may not have room on that side, so it opens on the other. */
|
|
3590
|
+
placeTooltip() {
|
|
3591
|
+
var _a, _b;
|
|
3592
|
+
const tooltip = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#tooltip');
|
|
3593
|
+
const row = (_b = this.host.closest('[data-tooltip-row]')) !== null && _b !== void 0 ? _b : this.host.parentElement;
|
|
3594
|
+
if (!tooltip || !row)
|
|
3595
|
+
return;
|
|
3596
|
+
tooltip.style.bottom = 'auto';
|
|
3597
|
+
tooltip.style.top = '0px';
|
|
3598
|
+
const bubble = tooltip.getBoundingClientRect();
|
|
3599
|
+
const scale = tooltip.offsetHeight > 0 ? bubble.height / tooltip.offsetHeight : 1;
|
|
3600
|
+
const rowRect = row.getBoundingClientRect();
|
|
3601
|
+
const gap = (parseFloat(getComputedStyle(tooltip).getPropertyValue('--ezp-spacing-2')) || 6) * scale;
|
|
3602
|
+
const side = pickTooltipSide(this.placement, rowRect, bubble.height + gap, this.visibleArea(tooltip));
|
|
3603
|
+
const top = side === 'top' ? rowRect.top - gap - bubble.height : rowRect.bottom + gap;
|
|
3604
|
+
tooltip.style.top = `${(top - bubble.top) / (scale || 1)}px`;
|
|
3605
|
+
}
|
|
3606
|
+
/** The part of the screen the bubble can show in: the viewport, narrowed by
|
|
3607
|
+
* every ancestor of its containing block that clips overflow — the host's
|
|
3608
|
+
* scrolling body, say. The scroller the rows sit in isn't among them, as the
|
|
3609
|
+
* bubble is anchored beyond it. */
|
|
3610
|
+
visibleArea(tooltip) {
|
|
3611
|
+
var _a;
|
|
3612
|
+
let top = 0;
|
|
3613
|
+
let bottom = window.innerHeight;
|
|
3614
|
+
let node = tooltip.offsetParent;
|
|
3615
|
+
while (node) {
|
|
3616
|
+
if (getComputedStyle(node).overflowY !== 'visible') {
|
|
3617
|
+
const rect = node.getBoundingClientRect();
|
|
3618
|
+
top = Math.max(top, rect.top);
|
|
3619
|
+
bottom = Math.min(bottom, rect.bottom);
|
|
3620
|
+
}
|
|
3621
|
+
node = (_a = node.parentElement) !== null && _a !== void 0 ? _a : (node.getRootNode().host || null);
|
|
3622
|
+
}
|
|
3623
|
+
return { top, bottom };
|
|
3624
|
+
}
|
|
3625
|
+
/** Scroll events don't bubble, so every ancestor is listened to directly —
|
|
3626
|
+
* across shadow roots, since the scroll container is usually the consumer's.
|
|
3627
|
+
* A window resize re-wraps the bubble just the same, so it closes it too. */
|
|
3628
|
+
watchScroll() {
|
|
3629
|
+
this.stopWatchingScroll();
|
|
3630
|
+
const targets = [window];
|
|
3631
|
+
let node = this.host.parentNode;
|
|
3632
|
+
while (node) {
|
|
3633
|
+
if (node.nodeType === Node.ELEMENT_NODE)
|
|
3634
|
+
targets.push(node);
|
|
3635
|
+
node = node instanceof ShadowRoot ? node.host : node.parentNode;
|
|
3636
|
+
}
|
|
3637
|
+
targets.forEach((target) => target.addEventListener('scroll', this.closeTooltip, { passive: true }));
|
|
3638
|
+
window.addEventListener('resize', this.closeTooltip, { passive: true });
|
|
3639
|
+
this.scrollTargets = targets;
|
|
3640
|
+
}
|
|
3641
|
+
stopWatchingScroll() {
|
|
3642
|
+
this.scrollTargets.forEach((target) => target.removeEventListener('scroll', this.closeTooltip));
|
|
3643
|
+
this.scrollTargets = [];
|
|
3644
|
+
window.removeEventListener('resize', this.closeTooltip);
|
|
3645
|
+
}
|
|
3646
|
+
/**
|
|
3647
|
+
*
|
|
3648
|
+
* Render method
|
|
3649
|
+
*
|
|
3650
|
+
*/
|
|
3651
|
+
render() {
|
|
3652
|
+
// Splitting is a rendering device only: `head` holds everything but the last
|
|
3653
|
+
// few characters and is the part CSS is allowed to clip, so the two labels
|
|
3654
|
+
// together still spell out the whole name.
|
|
3655
|
+
const split = !this.expanded && this.name.length > TAIL_LENGTH;
|
|
3656
|
+
const head = split ? this.name.slice(0, -TAIL_LENGTH) : this.name;
|
|
3657
|
+
const tail = split ? this.name.slice(-TAIL_LENGTH) : '';
|
|
3658
|
+
return (h(Host, { key: '6fa83e22c07a31d2a56df34f2f12edf20e1eba15', class: { expanded: this.expanded, [`place-${this.placement}`]: true } }, h("button", { key: '07c2f0afc897be0ef1bd1622a486d7ff7ec73953', type: "button", id: "trigger", "aria-label": this.name, "aria-expanded": this.expanded ? 'true' : 'false', onClick: this.toggleExpanded, onMouseEnter: this.openTooltip, onMouseLeave: this.scheduleClose, onFocus: this.openTooltip, onBlur: this.closeTooltip }, h("ezp-label", { key: '7a8711a0ac21e2b7bf84a40492b0b193dd3dd29f', class: "head", ellipsis: split, level: this.level, weight: this.weight, text: head }), split && h("ezp-label", { key: 'be08c7a34cff7db6e5328627de26ff272415e27d', class: "tail", level: this.level, weight: this.weight, text: tail })), this.tooltipOpen && (h("div", { key: 'fe79f1aeced27b5ebf68e8a6cd3fcdd26e19c5eb', id: "tooltip", "aria-hidden": "true", onMouseEnter: this.cancelScheduledClose, onMouseLeave: this.closeTooltip }, this.name))));
|
|
3659
|
+
}
|
|
3660
|
+
get host() { return getElement(this); }
|
|
3661
|
+
static get watchers() { return {
|
|
3662
|
+
"tooltipOpen": [{
|
|
3663
|
+
"watchTooltipOpen": 0
|
|
3664
|
+
}]
|
|
3665
|
+
}; }
|
|
3666
|
+
};
|
|
3667
|
+
EzpFileName.style = ezpFileNameCss();
|
|
3668
|
+
|
|
3356
3669
|
const ezpIconCss = () => `:host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-icon-background, transparent);border-radius:var(--ezp-icon-borderRadius, 0);display:grid;grid-template:var(--ezp-icon-gridTemplate)/var(--ezp-icon-gridTemplate);height:var(--ezp-icon-height, var(--ezp-icon-size));-ms-flex-pack:center;justify-content:center;padding:var(--ezp-icon-padding, 0);width:var(--ezp-icon-width, var(--ezp-icon-size))}:host(.framed){--ezp-icon-background:var(--ezp-core-shade-primary);--ezp-icon-borderRadius:50%;--ezp-icon-padding:var(--ezp-icon-frame)}:host(.normal){--ezp-icon-size:18px;--ezp-icon-gridTemplate:24px;--ezp-icon-frame:var(--ezp-spacing-3)}:host(.large){--ezp-icon-size:36px;--ezp-icon-gridTemplate:48px;--ezp-icon-frame:var(--ezp-spacing-4)}:host(.huge){--ezp-icon-size:54px;--ezp-icon-gridTemplate:72px;--ezp-icon-frame:var(--ezp-spacing-5)}svg{display:block;fill:var(--ezp-icon-fill, currentColor);height:100%;width:100%}`;
|
|
3357
3670
|
|
|
3358
3671
|
const EzpIcon = class {
|
|
@@ -3387,7 +3700,7 @@ const EzpIcon = class {
|
|
|
3387
3700
|
return (
|
|
3388
3701
|
// Decorative: icons here always sit next to a label or live-region text,
|
|
3389
3702
|
// so hide them from the accessibility tree to avoid double announcements.
|
|
3390
|
-
h(Host, { key: '
|
|
3703
|
+
h(Host, { key: 'f1a45d38b75ccf4e0c5e6200d9d04c7e5766bfbc', class: `${this.size} ${this.framed ? 'framed' : ''}`, "aria-hidden": "true" }, h("div", { key: '70f6963181d31089fefb662079e1e075540d2fe7', id: "glyph", innerHTML: this.glyph })));
|
|
3391
3704
|
}
|
|
3392
3705
|
static get assetsDirs() { return ["assets"]; }
|
|
3393
3706
|
};
|
|
@@ -3429,7 +3742,7 @@ const EzpIconButton = class {
|
|
|
3429
3742
|
// Icon-only control: derive an accessible name from the icon so screen
|
|
3430
3743
|
// readers announce something meaningful (e.g. "menu", "printer").
|
|
3431
3744
|
const label = this.icon.replace(/[-_]/g, ' ');
|
|
3432
|
-
return (h(Host, { key: '
|
|
3745
|
+
return (h(Host, { key: 'd67a43c2b91eaa4fa79dd8559824f3ffc23757b2', class: `${this.level}` }, h(TagType, Object.assign({ key: '3b11b4e0c40c8f900496ae03a4eee11f0980cd80', id: "button", "aria-label": label }, attributes), h("ezp-icon", { key: '14a35e8f779628197f7dd89219792d7809990631', name: this.icon }))));
|
|
3433
3746
|
}
|
|
3434
3747
|
};
|
|
3435
3748
|
EzpIconButton.style = ezpIconButtonCss();
|
|
@@ -3484,7 +3797,7 @@ const EzpInput = class {
|
|
|
3484
3797
|
}
|
|
3485
3798
|
render() {
|
|
3486
3799
|
const hasIcon = !!this.icon;
|
|
3487
|
-
return (h(Host, { key: '
|
|
3800
|
+
return (h(Host, { key: 'f36f5811ba4e86b0aa3f53be916220136a1d2443', class: { focused: this.focused, 'has-icon': hasIcon }, onClick: this.setFocus }, hasIcon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '88f93411e1463b23ca4ae88d278a69df5038509d', id: "label", noWrap: true, level: "secondary", text: this.label }), h("input", { key: 'b23ba3c8fea465a559e9c6d7b3da50152b412a1c', id: "input", type: this.type, value: this.value, placeholder: this.placeholder, "aria-label": this.label, onInput: (event) => this.handleChange(event), ref: (input) => (this.input = input), onFocus: this.handleFocus, onBlur: this.handleBlur }), this.suffix ? h("ezp-label", { id: "suffix", level: "secondary", text: this.suffix }) : null));
|
|
3488
3801
|
}
|
|
3489
3802
|
};
|
|
3490
3803
|
EzpInput.style = ezpInputCss();
|
|
@@ -3510,14 +3823,31 @@ const EzpLabel = class {
|
|
|
3510
3823
|
/** Description... */
|
|
3511
3824
|
this.weight = 'soft';
|
|
3512
3825
|
}
|
|
3826
|
+
/**
|
|
3827
|
+
*
|
|
3828
|
+
* Public methods
|
|
3829
|
+
*
|
|
3830
|
+
*/
|
|
3831
|
+
/** Whether the text is currently clipped — `ellipsis` only bites when the
|
|
3832
|
+
* text outgrows the space it was given, which callers cannot tell from the
|
|
3833
|
+
* props alone. Lets a caller offer the full text only when it is needed. */
|
|
3834
|
+
async isTruncated() {
|
|
3835
|
+
var _a;
|
|
3836
|
+
const text = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#text');
|
|
3837
|
+
if (!text)
|
|
3838
|
+
return false;
|
|
3839
|
+
// A pixel of slack: sub-pixel layout rounds scrollWidth up on its own.
|
|
3840
|
+
return text.scrollWidth > text.clientWidth + 1;
|
|
3841
|
+
}
|
|
3513
3842
|
/**
|
|
3514
3843
|
*
|
|
3515
3844
|
* Render method
|
|
3516
3845
|
*
|
|
3517
3846
|
*/
|
|
3518
3847
|
render() {
|
|
3519
|
-
return (h(Host, { key: '
|
|
3848
|
+
return (h(Host, { key: '42139679511e711132912a1f762d345951fd1774', class: `${this.level} ${this.weight} ${this.ellipsis ? 'ellipsis' : ''} ${this.noWrap ? 'no-wrap' : ''}` }, h("div", { key: '5e54e8142d274cacb375cce8d5ef52ccdeaeec84', id: "text" }, this.text)));
|
|
3520
3849
|
}
|
|
3850
|
+
get host() { return getElement(this); }
|
|
3521
3851
|
};
|
|
3522
3852
|
EzpLabel.style = ezpLabelCss();
|
|
3523
3853
|
|
|
@@ -38095,6 +38425,8 @@ const userStore = createStore({
|
|
|
38095
38425
|
appearance: '',
|
|
38096
38426
|
});
|
|
38097
38427
|
|
|
38428
|
+
/** Duplex modes the dialog offers: none, long edge, short edge. */
|
|
38429
|
+
const DUPLEX_MODES = [1, 2, 3];
|
|
38098
38430
|
/**
|
|
38099
38431
|
* Derive the default print properties for a printer from its configuration.
|
|
38100
38432
|
*
|
|
@@ -38137,6 +38469,78 @@ function applyPrinterDefaults(config, properties) {
|
|
|
38137
38469
|
delete properties.PageRanges;
|
|
38138
38470
|
return properties;
|
|
38139
38471
|
}
|
|
38472
|
+
/**
|
|
38473
|
+
* Carry the settings the user last printed with on this printer over the
|
|
38474
|
+
* printer's own defaults, dropping anything the printer can no longer do.
|
|
38475
|
+
*
|
|
38476
|
+
* Capabilities change between sessions — a printer loses a tray, an admin
|
|
38477
|
+
* swaps the paper formats — and a stale value would otherwise be sent to the
|
|
38478
|
+
* API or shown as a selection that isn't in the list. Each field is therefore
|
|
38479
|
+
* only restored if the current config still offers it; everything else stays
|
|
38480
|
+
* on the default `applyPrinterDefaults` just put in place. Copies and page
|
|
38481
|
+
* ranges are never part of `saved`, so they are never restored.
|
|
38482
|
+
*/
|
|
38483
|
+
function applySavedProperties(config, saved, properties) {
|
|
38484
|
+
var _a, _b, _c, _d, _e;
|
|
38485
|
+
applyPrinterDefaults(config, properties);
|
|
38486
|
+
if (!saved)
|
|
38487
|
+
return properties;
|
|
38488
|
+
if (config.ColorSupported && typeof saved.color === 'boolean') {
|
|
38489
|
+
properties.color = saved.color;
|
|
38490
|
+
}
|
|
38491
|
+
if (config.DuplexSupported && DUPLEX_MODES.includes(Number(saved.duplexmode))) {
|
|
38492
|
+
properties.duplex = true;
|
|
38493
|
+
properties.duplexmode = Number(saved.duplexmode);
|
|
38494
|
+
}
|
|
38495
|
+
const paper = (_a = config.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((format) => format.Id === Number(saved.paperid));
|
|
38496
|
+
if (paper) {
|
|
38497
|
+
properties.paper = paper.Name;
|
|
38498
|
+
properties.paperid = paper.Id;
|
|
38499
|
+
// Only meaningful for the custom format, which carries its own dimensions.
|
|
38500
|
+
if (paper.Id === PAPER_ID) {
|
|
38501
|
+
properties.paperwidth = saved.paperwidth;
|
|
38502
|
+
properties.paperlength = saved.paperlength;
|
|
38503
|
+
}
|
|
38504
|
+
}
|
|
38505
|
+
// Orientations are offered as 1-based positions in `OrientationsSupported`.
|
|
38506
|
+
const orientation = Number(saved.orientation);
|
|
38507
|
+
if (orientation >= 1 && orientation <= ((_c = (_b = config.OrientationsSupported) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0)) {
|
|
38508
|
+
properties.orientation = orientation;
|
|
38509
|
+
}
|
|
38510
|
+
if (typeof saved.resolution === 'string' && ((_d = config.Resolutions) === null || _d === void 0 ? void 0 : _d.includes(saved.resolution))) {
|
|
38511
|
+
properties.resolution = saved.resolution;
|
|
38512
|
+
}
|
|
38513
|
+
if (hasTrays(config)) {
|
|
38514
|
+
const tray = (_e = config.Trays) === null || _e === void 0 ? void 0 : _e.find((option) => (option === null || option === void 0 ? void 0 : option.Index) === Number(saved.defaultSource));
|
|
38515
|
+
if (tray) {
|
|
38516
|
+
properties.trayname = tray.Name;
|
|
38517
|
+
properties.defaultSource = tray.Index;
|
|
38518
|
+
}
|
|
38519
|
+
}
|
|
38520
|
+
return properties;
|
|
38521
|
+
}
|
|
38522
|
+
/**
|
|
38523
|
+
* The slice of the current selection worth remembering for next time: what the
|
|
38524
|
+
* print dialog offers per printer, minus copies and page ranges, which belong
|
|
38525
|
+
* to the one document being printed rather than to the printer.
|
|
38526
|
+
*/
|
|
38527
|
+
function pickRememberedProperties(properties) {
|
|
38528
|
+
const { color, duplex, duplexmode, paper, paperid, paperwidth, paperlength } = properties;
|
|
38529
|
+
const { orientation, resolution, trayname, defaultSource } = properties;
|
|
38530
|
+
return {
|
|
38531
|
+
color,
|
|
38532
|
+
duplex,
|
|
38533
|
+
duplexmode,
|
|
38534
|
+
paper,
|
|
38535
|
+
paperid,
|
|
38536
|
+
paperwidth,
|
|
38537
|
+
paperlength,
|
|
38538
|
+
orientation,
|
|
38539
|
+
resolution,
|
|
38540
|
+
trayname,
|
|
38541
|
+
defaultSource,
|
|
38542
|
+
};
|
|
38543
|
+
}
|
|
38140
38544
|
/** Does this printer config report an explicit "no usable trays" state? */
|
|
38141
38545
|
function hasNoTrays(config) {
|
|
38142
38546
|
return !!config.Trays && config.Trays.length >= 0 && config.Trays[0] == null;
|
|
@@ -38234,12 +38638,13 @@ async function uploadAndPrintFile(ctx, file, hooks = {}) {
|
|
|
38234
38638
|
}
|
|
38235
38639
|
}
|
|
38236
38640
|
|
|
38237
|
-
const ezpPrinterSelectionCss = () => `:host{--ezp-status-border-radius:16px;background:var(--ezp-printerSelection-background, var(--ezp-core-backdrop));-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;inset:var(--ezp-printerSelection-inset, 0);overflow-y:auto;padding:var(--ezp-printerSelection-padding, var(--ezp-spacing-5));position:var(--ezp-printerSelection-position, fixed);z-index:1}:host(.seamless){--ezp-printerSelection-background:transparent;--ezp-printerSelection-box-background:transparent;--ezp-printerSelection-box-boxShadow:none;--ezp-printerSelection-box-margin:0;--ezp-printerSelection-box-padding:0;--ezp-printerSelection-inset:auto;--ezp-printerSelection-padding:0;--ezp-printerSelection-position:static;--ezp-printerSelection-width:100%}#box{background:var(--ezp-printerSelection-box-background, var(--ezp-core-surface-tertiary));border-radius:16px;-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));color:var(--ezp-core-foreground-primary);margin:var(--ezp-printerSelection-box-margin, auto);padding:var(--ezp-printerSelection-box-padding, 0);position:relative;width:var(--ezp-printerSelection-width, 384px)}#header{-ms-flex-align:center;align-items:center;border-bottom:1px solid var(--ezp-core-outline);color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);-ms-flex-pack:justify;justify-content:space-between;padding:var(--ezp-spacing-4);position:relative;z-index:3}#title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);min-width:0}#title ezp-label{--ezp-label-fontSize:20px;--ezp-label-lineHeight:26px}#files-badge{background:var(--ezp-theme-translucent);border-radius:999px;color:var(--ezp-theme-solid);font-size:12px;font-weight:600;line-height:1;padding:5px 10px;white-space:nowrap}#header-actions{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}#body{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-tertiary));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3);padding:var(--ezp-spacing-4)}#files-card{background:var(--ezp-core-surface-secondary);border-radius:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);
|
|
38641
|
+
const ezpPrinterSelectionCss = () => `:host{--ezp-status-border-radius:16px;background:var(--ezp-printerSelection-background, var(--ezp-core-backdrop));-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;inset:var(--ezp-printerSelection-inset, 0);overflow-y:auto;padding:var(--ezp-printerSelection-padding, var(--ezp-spacing-5));position:var(--ezp-printerSelection-position, fixed);z-index:1}:host(.seamless){--ezp-printerSelection-background:transparent;--ezp-printerSelection-box-background:transparent;--ezp-printerSelection-box-boxShadow:none;--ezp-printerSelection-box-margin:0;--ezp-printerSelection-box-padding:0;--ezp-printerSelection-inset:auto;--ezp-printerSelection-padding:0;--ezp-printerSelection-position:static;--ezp-printerSelection-width:100%}#box{background:var(--ezp-printerSelection-box-background, var(--ezp-core-surface-tertiary));border-radius:16px;-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));color:var(--ezp-core-foreground-primary);margin:var(--ezp-printerSelection-box-margin, auto);padding:var(--ezp-printerSelection-box-padding, 0);position:relative;width:var(--ezp-printerSelection-width, 384px)}#header{-ms-flex-align:center;align-items:center;border-bottom:1px solid var(--ezp-core-outline);color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);-ms-flex-pack:justify;justify-content:space-between;padding:var(--ezp-spacing-4);position:relative;z-index:3}#title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);min-width:0}#title ezp-label{--ezp-label-fontSize:20px;--ezp-label-lineHeight:26px}#files-badge{background:var(--ezp-theme-translucent);border-radius:999px;color:var(--ezp-theme-solid);font-size:12px;font-weight:600;line-height:1;padding:5px 10px;white-space:nowrap}#header-actions{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}#body{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-tertiary));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3);padding:var(--ezp-spacing-4)}#files-card{background:var(--ezp-core-surface-secondary);border-radius:12px;padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}#files{position:relative}#files-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);margin:calc(-1 * 4px);max-height:var(--ezp-printerSelection-filesList-maxHeight, calc(4.5 * 20px + 4 * var(--ezp-spacing-2)));overflow-x:hidden;overflow-y:auto;padding:4px;scrollbar-width:thin}.file-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;gap:var(--ezp-spacing-3);min-height:20px;min-width:0}.file-row ezp-file-name{-ms-flex:0 1 auto;flex:0 1 auto}.file-row-icon{--ezp-icon-size:18px;--ezp-icon-gridTemplate:18px;color:var(--ezp-theme-solid);-ms-flex-negative:0;flex-shrink:0}#printer-caption{color:var(--ezp-core-foreground-secondary);letter-spacing:0.08em;padding:0 var(--ezp-spacing-1);text-transform:uppercase}#printer-card{border-radius:12px;-webkit-box-shadow:inset 0 0 0 1px var(--ezp-core-outline);box-shadow:inset 0 0 0 1px var(--ezp-core-outline);position:relative}#printer{--ezp-select-label-display:none;--ezp-select-toggle-gridTemplateAreas:'icon value accessory';--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-textAlign:left}#print{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-theme-solid);border:0;border-radius:8px;color:var(--ezp-white-100);cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;gap:var(--ezp-spacing-3);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:13px var(--ezp-spacing-4);-webkit-transition:opacity var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:opacity var(--ezp-duration-2) var(--ezp-easing-out-quart);width:100%}#print ezp-icon{--ezp-icon-size:20px;--ezp-icon-gridTemplate:20px}@media (hover: hover){#print:not(:disabled):hover{opacity:0.9}#print:not(:disabled):active{opacity:0.8}}#print:disabled{background:var(--ezp-core-shade-primary);color:var(--ezp-core-foreground-tertiary);cursor:default}#options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}#options>*{-webkit-box-shadow:inset 0 -1px 0 0 var(--ezp-core-outline);box-shadow:inset 0 -1px 0 0 var(--ezp-core-outline)}#options>*:last-child{-webkit-box-shadow:none;box-shadow:none}#footer{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-tertiary));border-radius:0 0 16px 16px;border-top:1px solid var(--ezp-core-outline);bottom:0;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr 1.4fr;padding:var(--ezp-spacing-4);position:-webkit-sticky;position:sticky;z-index:3}#cancel{--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-borderRadius:8px;--ezp-textButton-boxShadow:inset 0 0 0 1px var(--ezp-core-outline);--ezp-textButton-color-init:var(--ezp-core-foreground-primary);--ezp-textButton-padding:13px var(--ezp-spacing-3)}`;
|
|
38238
38642
|
|
|
38239
38643
|
const EzpPrinterSelection = class {
|
|
38240
38644
|
constructor(hostRef) {
|
|
38241
38645
|
registerInstance(this, hostRef);
|
|
38242
38646
|
this.printCancel = createEvent(this, "printCancel", 7);
|
|
38647
|
+
this.printDismiss = createEvent(this, "printDismiss", 7);
|
|
38243
38648
|
this.printSubmit = createEvent(this, "printSubmit", 7);
|
|
38244
38649
|
this.logout = createEvent(this, "logout", 7);
|
|
38245
38650
|
this.fileExtension = '';
|
|
@@ -38287,6 +38692,13 @@ const EzpPrinterSelection = class {
|
|
|
38287
38692
|
this.hubDriverError = false;
|
|
38288
38693
|
this.userMenuOpen = false;
|
|
38289
38694
|
this.printStopped = false;
|
|
38695
|
+
/** First row of the file list that is at least partly in view. Its tooltip
|
|
38696
|
+
* opens downwards, as there is no list left above it to cover. */
|
|
38697
|
+
this.firstVisibleFile = 0;
|
|
38698
|
+
/** Starts empty so the dialog can still render if the list never arrives. */
|
|
38699
|
+
this.printers = [];
|
|
38700
|
+
/** Starts empty so the dialog renders even if the list never loads. */
|
|
38701
|
+
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
38290
38702
|
this.selectedPrinterConfig = {
|
|
38291
38703
|
Default: {
|
|
38292
38704
|
Color: '',
|
|
@@ -38319,6 +38731,8 @@ const EzpPrinterSelection = class {
|
|
|
38319
38731
|
trayname: '',
|
|
38320
38732
|
PageRanges: '',
|
|
38321
38733
|
};
|
|
38734
|
+
/** True while a printer's capabilities are being fetched. */
|
|
38735
|
+
this.loadingPrinterConfig = false;
|
|
38322
38736
|
this.currentFileIndex = 0;
|
|
38323
38737
|
this.totalFiles = 0;
|
|
38324
38738
|
this.failedFiles = [];
|
|
@@ -38335,7 +38749,7 @@ const EzpPrinterSelection = class {
|
|
|
38335
38749
|
this.successfulFiles = [];
|
|
38336
38750
|
this.partialSuccess = false;
|
|
38337
38751
|
this.hubDriverError = false;
|
|
38338
|
-
this.
|
|
38752
|
+
this.printDismiss.emit();
|
|
38339
38753
|
};
|
|
38340
38754
|
/** Poll `validate` callback: maps a job status to component state, returns `true` to stop polling. */
|
|
38341
38755
|
this.validateData = (data) => {
|
|
@@ -38509,13 +38923,18 @@ const EzpPrinterSelection = class {
|
|
|
38509
38923
|
if (hubTimeout)
|
|
38510
38924
|
clearTimeout(hubTimeout);
|
|
38511
38925
|
}
|
|
38512
|
-
|
|
38513
|
-
storage.setPrinter(this.selectedPrinter);
|
|
38926
|
+
this.rememberSelection();
|
|
38514
38927
|
this.printStopped = false;
|
|
38515
38928
|
};
|
|
38516
38929
|
this.handleUserMenu = () => {
|
|
38517
38930
|
this.userMenuOpen = true;
|
|
38518
38931
|
};
|
|
38932
|
+
this.handleFilesScroll = (event) => {
|
|
38933
|
+
const first = firstVisibleChild(event.currentTarget);
|
|
38934
|
+
// Scroll fires every frame; only a change of row is worth a render.
|
|
38935
|
+
if (first >= 0 && first !== this.firstVisibleFile)
|
|
38936
|
+
this.firstVisibleFile = first;
|
|
38937
|
+
};
|
|
38519
38938
|
this.validateFileType = async (name) => {
|
|
38520
38939
|
var _a;
|
|
38521
38940
|
const extension = (_a = name.split('.').pop()) !== null && _a !== void 0 ? _a : '';
|
|
@@ -38603,24 +39022,45 @@ const EzpPrinterSelection = class {
|
|
|
38603
39022
|
break;
|
|
38604
39023
|
}
|
|
38605
39024
|
}
|
|
38606
|
-
/** Print needs a printer, no job in flight and
|
|
39025
|
+
/** Print needs a printer with its capabilities in hand, no job in flight and
|
|
39026
|
+
* a valid page range. The config matters: between picking a printer and its
|
|
39027
|
+
* properties arriving, the selection is set but the properties still hold
|
|
39028
|
+
* blank defaults, and printing then saves those as that printer's settings. */
|
|
38607
39029
|
get printDisabled() {
|
|
38608
|
-
return this.selectedPrinter.id === '' ||
|
|
39030
|
+
return (this.selectedPrinter.id === '' ||
|
|
39031
|
+
this.loadingPrinterConfig ||
|
|
39032
|
+
this.printProcessing ||
|
|
39033
|
+
this.pageRangeInvalid);
|
|
39034
|
+
}
|
|
39035
|
+
/** Keep this printer and its settings for the next print. Stored per printer,
|
|
39036
|
+
* so each one keeps its own and no setting follows the user to a printer
|
|
39037
|
+
* that cannot do it. */
|
|
39038
|
+
rememberSelection() {
|
|
39039
|
+
if (!this.selectedPrinter.id)
|
|
39040
|
+
return;
|
|
39041
|
+
storage.setPrinterSettings(this.selectedPrinter.id, pickRememberedProperties(this.selectedProperties));
|
|
39042
|
+
storage.setPrinter(this.selectedPrinter);
|
|
38609
39043
|
}
|
|
38610
|
-
|
|
38611
|
-
|
|
38612
|
-
|
|
38613
|
-
|
|
38614
|
-
|
|
39044
|
+
/**
|
|
39045
|
+
* Decide which printer the dialog opens on: the one last printed to, or the
|
|
39046
|
+
* user's only printer when there is nothing to choose between. Its settings
|
|
39047
|
+
* follow once its config is in, since they can only be validated against the
|
|
39048
|
+
* printer's capabilities.
|
|
39049
|
+
*/
|
|
39050
|
+
selectInitialPrinter() {
|
|
39051
|
+
var _a, _b;
|
|
38615
39052
|
const savedPrinter = storage.getPrinter();
|
|
38616
|
-
|
|
38617
|
-
|
|
38618
|
-
|
|
38619
|
-
|
|
38620
|
-
|
|
38621
|
-
|
|
38622
|
-
|
|
38623
|
-
|
|
39053
|
+
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));
|
|
39054
|
+
// A printer the user no longer has must not stay preselected.
|
|
39055
|
+
if (savedPrinter && !savedIsAvailable)
|
|
39056
|
+
storage.clearSavedPrinter();
|
|
39057
|
+
if (savedPrinter && savedIsAvailable) {
|
|
39058
|
+
this.selectedPrinter = savedPrinter;
|
|
39059
|
+
}
|
|
39060
|
+
else if (((_b = this.printers) === null || _b === void 0 ? void 0 : _b.length) === 1) {
|
|
39061
|
+
// Nothing to pick between: opening a dropdown with one entry in it is
|
|
39062
|
+
// busywork, so start on it.
|
|
39063
|
+
this.selectedPrinter = this.printers[0];
|
|
38624
39064
|
}
|
|
38625
39065
|
else {
|
|
38626
39066
|
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
@@ -38639,17 +39079,22 @@ const EzpPrinterSelection = class {
|
|
|
38639
39079
|
}
|
|
38640
39080
|
async setSelectedProperties(eventDetails) {
|
|
38641
39081
|
switch (eventDetails.type) {
|
|
38642
|
-
case 'printer':
|
|
38643
|
-
this.
|
|
38644
|
-
this.selectedPrinter
|
|
38645
|
-
|
|
38646
|
-
|
|
38647
|
-
|
|
38648
|
-
.
|
|
38649
|
-
|
|
38650
|
-
|
|
38651
|
-
|
|
39082
|
+
case 'printer': {
|
|
39083
|
+
const picked = this.printers.find((printer) => printer.id === eventDetails.id);
|
|
39084
|
+
this.selectedPrinter = picked !== null && picked !== void 0 ? picked : {
|
|
39085
|
+
id: eventDetails.id,
|
|
39086
|
+
name: eventDetails.title,
|
|
39087
|
+
location: '',
|
|
39088
|
+
is_queue: eventDetails.is_queue,
|
|
39089
|
+
};
|
|
39090
|
+
// Same guard as the initial load. Without it a failed fetch left the
|
|
39091
|
+
// printer selected while the config still described the *previous*
|
|
39092
|
+
// one: Print stayed enabled, the job went out with settings nothing
|
|
39093
|
+
// had checked against this printer, and those settings were then
|
|
39094
|
+
// saved under its id and restored on later opens.
|
|
39095
|
+
await this.loadSelectedPrinterConfig();
|
|
38652
39096
|
break;
|
|
39097
|
+
}
|
|
38653
39098
|
case 'color':
|
|
38654
39099
|
this.selectedProperties.color =
|
|
38655
39100
|
eventDetails.title == instance.t('printer_selection.color_color') ? true : false;
|
|
@@ -38714,6 +39159,55 @@ const EzpPrinterSelection = class {
|
|
|
38714
39159
|
onJobId: (jobId) => (printStore.state.jobID = jobId),
|
|
38715
39160
|
});
|
|
38716
39161
|
}
|
|
39162
|
+
/**
|
|
39163
|
+
* What a dropdown should show: the current selection — restored from the last
|
|
39164
|
+
* print, or just made by the user — and otherwise the printer's own default.
|
|
39165
|
+
*
|
|
39166
|
+
* The fallbacks matter because a config may describe its default only by name
|
|
39167
|
+
* (`Default.Duplex`, `Default.Paper`, `Default.Tray`) without flagging the
|
|
39168
|
+
* matching entry, which is all these dropdowns had to go on before settings
|
|
39169
|
+
* were remembered.
|
|
39170
|
+
*/
|
|
39171
|
+
duplexPreSelection() {
|
|
39172
|
+
var _a;
|
|
39173
|
+
if (!this.selectedPrinter.id)
|
|
39174
|
+
return null;
|
|
39175
|
+
const mode = Number(this.selectedProperties.duplexmode);
|
|
39176
|
+
if (mode)
|
|
39177
|
+
return mode;
|
|
39178
|
+
switch ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Duplex) {
|
|
39179
|
+
case 'duplex_simplex':
|
|
39180
|
+
return instance.t('printer_selection.duplex_none');
|
|
39181
|
+
case 'duplex_vertical':
|
|
39182
|
+
return instance.t('printer_selection.duplex_long');
|
|
39183
|
+
case 'duplex_horizontal':
|
|
39184
|
+
return instance.t('printer_selection.duplex_short');
|
|
39185
|
+
default:
|
|
39186
|
+
return null;
|
|
39187
|
+
}
|
|
39188
|
+
}
|
|
39189
|
+
paperPreSelection() {
|
|
39190
|
+
var _a, _b;
|
|
39191
|
+
if (!this.selectedPrinter.id)
|
|
39192
|
+
return null;
|
|
39193
|
+
if (this.selectedProperties.paper)
|
|
39194
|
+
return this.selectedProperties.paper;
|
|
39195
|
+
const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper;
|
|
39196
|
+
return name && ((_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.some((el) => el.Name.includes(name)))
|
|
39197
|
+
? name
|
|
39198
|
+
: null;
|
|
39199
|
+
}
|
|
39200
|
+
trayPreSelection() {
|
|
39201
|
+
var _a, _b;
|
|
39202
|
+
if (!this.selectedPrinter.id)
|
|
39203
|
+
return null;
|
|
39204
|
+
if (this.selectedProperties.trayname)
|
|
39205
|
+
return this.selectedProperties.trayname;
|
|
39206
|
+
const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Tray;
|
|
39207
|
+
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)))
|
|
39208
|
+
? name
|
|
39209
|
+
: null;
|
|
39210
|
+
}
|
|
38717
39211
|
setDefaultPaperFormat() {
|
|
38718
39212
|
var _a, _b, _c, _d, _e;
|
|
38719
39213
|
let format;
|
|
@@ -38782,46 +39276,105 @@ const EzpPrinterSelection = class {
|
|
|
38782
39276
|
this.unsubscribeLanguage = subscribeToLanguageChange(this);
|
|
38783
39277
|
this.printService = new EzpPrintService(this.redirectURI, this.clientID);
|
|
38784
39278
|
this.printService.registerFetchInterceptor();
|
|
38785
|
-
|
|
38786
|
-
|
|
38787
|
-
.
|
|
38788
|
-
|
|
38789
|
-
|
|
38790
|
-
|
|
39279
|
+
try {
|
|
39280
|
+
// A missing display name must not stop the user from printing.
|
|
39281
|
+
await this.getUserInfo().catch(() => undefined);
|
|
39282
|
+
let printersLoaded = false;
|
|
39283
|
+
try {
|
|
39284
|
+
const printers = await this.printService.getPrinterList(authStore.state.accessToken);
|
|
39285
|
+
// A failed request still resolves: the API answers with a `{code,
|
|
39286
|
+
// message}` body, which would survive `?? []` and break on `.some`.
|
|
39287
|
+
if (!Array.isArray(printers))
|
|
39288
|
+
throw new Error('Unexpected printer list payload');
|
|
39289
|
+
this.printers = printers;
|
|
39290
|
+
printersLoaded = true;
|
|
39291
|
+
}
|
|
39292
|
+
catch (_a) {
|
|
39293
|
+
this.printers = [];
|
|
39294
|
+
}
|
|
39295
|
+
if (!printersLoaded) {
|
|
39296
|
+
// Nothing is known about this user's printers, so the saved printer is
|
|
39297
|
+
// left untouched: treating it as gone would clear it from storage and
|
|
39298
|
+
// lose the settings that are only reachable through it.
|
|
38791
39299
|
this.noPrinters = true;
|
|
38792
39300
|
}
|
|
38793
|
-
|
|
38794
|
-
|
|
38795
|
-
|
|
38796
|
-
|
|
38797
|
-
|
|
38798
|
-
|
|
38799
|
-
|
|
38800
|
-
this.
|
|
38801
|
-
|
|
38802
|
-
|
|
39301
|
+
else {
|
|
39302
|
+
if (this.printers.length === 0) {
|
|
39303
|
+
this.noPrinters = true;
|
|
39304
|
+
}
|
|
39305
|
+
this.selectInitialPrinter();
|
|
39306
|
+
// A printer carried over from a previous print, or the only one the
|
|
39307
|
+
// user has, needs its config before its properties can be offered.
|
|
39308
|
+
if (this.selectedPrinter.id != '') {
|
|
39309
|
+
await this.loadSelectedPrinterConfig();
|
|
39310
|
+
}
|
|
39311
|
+
}
|
|
39312
|
+
let supportedExtensionsLoaded = false;
|
|
39313
|
+
try {
|
|
39314
|
+
const response = await (await this.printService.getConfig(authStore.state.accessToken)).json();
|
|
39315
|
+
printStore.state.supportedFileExtensions = response.System.FILEEXT;
|
|
39316
|
+
supportedExtensionsLoaded = true;
|
|
39317
|
+
}
|
|
39318
|
+
catch (_b) {
|
|
39319
|
+
// Handled below: without the list, nothing can be validated against it.
|
|
39320
|
+
}
|
|
39321
|
+
try {
|
|
39322
|
+
await this.printService
|
|
39323
|
+
.getAllPrinterProperties(authStore.state.accessToken)
|
|
39324
|
+
.then((printerConfig) => {
|
|
39325
|
+
this.printerConfig = printerConfig;
|
|
39326
|
+
});
|
|
39327
|
+
}
|
|
39328
|
+
catch (_c) {
|
|
39329
|
+
// Only used to describe other printers; the dialog works without it.
|
|
39330
|
+
}
|
|
39331
|
+
// Skipped when the list never arrived: every file would compare as
|
|
39332
|
+
// unsupported and the user would be told their document cannot be
|
|
39333
|
+
// printed when nothing is actually wrong with it.
|
|
39334
|
+
if (supportedExtensionsLoaded && this.files && this.files.length > 0) {
|
|
39335
|
+
// Validate all files
|
|
39336
|
+
const validationPromises = this.files.map((file) => this.validateFileType(file.name));
|
|
39337
|
+
const validationResults = await Promise.all(validationPromises);
|
|
39338
|
+
const allValid = validationResults.every((valid) => valid);
|
|
39339
|
+
this.notSupported = !allValid;
|
|
39340
|
+
}
|
|
39341
|
+
}
|
|
39342
|
+
finally {
|
|
39343
|
+
// Whatever failed above, the dialog has to become usable: the loading
|
|
39344
|
+
// status carries no close button, so throwing out of here would strand
|
|
39345
|
+
// the user on "Loading My Printers…" with no way back.
|
|
39346
|
+
this.loading = false;
|
|
39347
|
+
}
|
|
39348
|
+
}
|
|
39349
|
+
/**
|
|
39350
|
+
* Fetch the selected printer's capabilities and restore its saved settings.
|
|
39351
|
+
*
|
|
39352
|
+
* A failure drops the selection rather than keeping a printer the dialog
|
|
39353
|
+
* cannot describe: the options would stay disabled while Print stayed
|
|
39354
|
+
* enabled, so the job would go out with properties nothing has verified.
|
|
39355
|
+
* With no selection the user picks from the list, which fetches again.
|
|
39356
|
+
*/
|
|
39357
|
+
async loadSelectedPrinterConfig() {
|
|
39358
|
+
this.loadingPrinterConfig = true;
|
|
39359
|
+
try {
|
|
39360
|
+
const data = await this.printService.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id);
|
|
39361
|
+
// An empty list or an error body leaves nothing to configure from.
|
|
39362
|
+
const config = data === null || data === void 0 ? void 0 : data[0];
|
|
39363
|
+
if (!config)
|
|
39364
|
+
throw new Error('No properties returned for the selected printer');
|
|
39365
|
+
this.selectedPrinterConfig = config;
|
|
39366
|
+
applySavedProperties(config, storage.getPrinterSettings(this.selectedPrinter.id), this.selectedProperties);
|
|
39367
|
+
this.setPaperid();
|
|
38803
39368
|
if (this.selectedProperties.paper === '') {
|
|
38804
39369
|
this.setDefaultPaperFormat();
|
|
38805
39370
|
}
|
|
38806
39371
|
}
|
|
38807
|
-
|
|
38808
|
-
.
|
|
38809
|
-
|
|
38810
|
-
|
|
38811
|
-
|
|
38812
|
-
await this.printService
|
|
38813
|
-
.getAllPrinterProperties(authStore.state.accessToken)
|
|
38814
|
-
.then((printerConfig) => {
|
|
38815
|
-
this.printerConfig = printerConfig;
|
|
38816
|
-
});
|
|
38817
|
-
if (this.files && this.files.length > 0) {
|
|
38818
|
-
// Validate all files
|
|
38819
|
-
const validationPromises = this.files.map((file) => this.validateFileType(file.name));
|
|
38820
|
-
const validationResults = await Promise.all(validationPromises);
|
|
38821
|
-
const allValid = validationResults.every((valid) => valid);
|
|
38822
|
-
this.notSupported = !allValid;
|
|
39372
|
+
catch (_a) {
|
|
39373
|
+
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
39374
|
+
}
|
|
39375
|
+
finally {
|
|
39376
|
+
this.loadingPrinterConfig = false;
|
|
38823
39377
|
}
|
|
38824
|
-
this.loading = false;
|
|
38825
39378
|
}
|
|
38826
39379
|
disconnectedCallback() {
|
|
38827
39380
|
var _a;
|
|
@@ -38907,14 +39460,14 @@ const EzpPrinterSelection = class {
|
|
|
38907
39460
|
return null;
|
|
38908
39461
|
}
|
|
38909
39462
|
render() {
|
|
38910
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
39463
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
38911
39464
|
const fileNames = this.files && this.files.length > 0
|
|
38912
39465
|
? this.files.map((file) => file.name)
|
|
38913
39466
|
: this.filename
|
|
38914
39467
|
? [this.filename]
|
|
38915
39468
|
: [];
|
|
38916
39469
|
const fileCount = fileNames.length;
|
|
38917
|
-
return this.loading ? (h("ezp-status", { processing: true, description: instance.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: instance.t('printer_selection.print') }), !this.notSupported && fileCount > 0 && (h("span", { id: "files-badge" }, instance.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-
|
|
39470
|
+
return this.loading ? (h("ezp-status", { processing: true, description: instance.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: instance.t('printer_selection.print') }), !this.notSupported && fileCount > 0 && (h("span", { id: "files-badge" }, instance.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" }, h("div", { id: "files" }, h("div", { id: "files-list", onScroll: this.handleFilesScroll }, 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, anchor: "parent", placement: index === this.firstVisibleFile ? 'bottom' : 'top' })))))))), h("ezp-label", { id: "printer-caption", level: "tertiary", weight: "heavy", text: instance.t('printer_selection.printer') }), h("div", { id: "printer-card" }, h("ezp-select", { id: "printer", label: instance.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
|
|
38918
39471
|
? instance.t('printer_selection.select_printer')
|
|
38919
39472
|
: instance.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
38920
39473
|
id: printer.id,
|
|
@@ -38927,43 +39480,34 @@ const EzpPrinterSelection = class {
|
|
|
38927
39480
|
title: option.title,
|
|
38928
39481
|
meta: '',
|
|
38929
39482
|
type: 'color',
|
|
38930
|
-
})), preSelected: this.selectedPrinter.id
|
|
38931
|
-
?
|
|
38932
|
-
|
|
39483
|
+
})), preSelected: this.selectedPrinter.id
|
|
39484
|
+
? this.selectedProperties.color
|
|
39485
|
+
? instance.t('printer_selection.color_color')
|
|
39486
|
+
: instance.t('printer_selection.color_grayscale')
|
|
39487
|
+
: null, disabled: !this.selectedPrinterConfig.ColorSupported }), h("ezp-select", { label: instance.t('printer_selection.duplex'), placeholder: instance.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_b = this.duplexOptions) === null || _b === void 0 ? void 0 : _b.map((option) => ({
|
|
38933
39488
|
id: option.id,
|
|
38934
39489
|
title: option.title,
|
|
38935
39490
|
meta: '',
|
|
38936
39491
|
type: 'duplex',
|
|
38937
|
-
})), preSelected: this.
|
|
38938
|
-
((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
|
|
38939
|
-
? instance.t('printer_selection.duplex_none')
|
|
38940
|
-
: ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
|
|
38941
|
-
? instance.t('printer_selection.duplex_long')
|
|
38942
|
-
: ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
|
|
38943
|
-
? instance.t('printer_selection.duplex_short')
|
|
38944
|
-
: null, disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: instance.t('printer_selection.size'), placeholder: instance.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
|
|
39492
|
+
})), preSelected: this.duplexPreSelection(), disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: instance.t('printer_selection.size'), placeholder: instance.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
|
|
38945
39493
|
this.selectedPrinterConfig.PaperFormats.map((format) => ({
|
|
38946
39494
|
id: format.Id,
|
|
38947
39495
|
title: format.Name,
|
|
38948
39496
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
38949
39497
|
type: 'format',
|
|
38950
|
-
})), preSelected: this.
|
|
38951
|
-
((_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); }))
|
|
38952
|
-
? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
|
|
38953
|
-
: 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: instance.t('printer_selection.width') }), h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: instance.t('printer_selection.length') }))) : null, h("ezp-select", { label: instance.t('printer_selection.orientation'), placeholder: instance.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: (_l = this.selectedPrinterConfig.OrientationsSupported) === null || _l === void 0 ? void 0 : _l.map((orientation, index) => ({
|
|
39498
|
+
})), 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: instance.t('printer_selection.width') }), h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: instance.t('printer_selection.length') }))) : null, h("ezp-select", { label: instance.t('printer_selection.orientation'), placeholder: instance.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: (_e = this.selectedPrinterConfig.OrientationsSupported) === null || _e === void 0 ? void 0 : _e.map((orientation, index) => ({
|
|
38954
39499
|
id: index + 1,
|
|
38955
39500
|
title: instance.t(`printer_selection.orientation_${orientation}`),
|
|
38956
39501
|
meta: '',
|
|
38957
39502
|
type: 'orientation',
|
|
38958
|
-
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(((
|
|
39503
|
+
})), 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: instance.t('printer_selection.quality'), placeholder: instance.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_h = this.selectedPrinterConfig.Resolutions) === null || _h === void 0 ? void 0 : _h.map((option, index) => ({
|
|
38959
39504
|
id: index,
|
|
38960
39505
|
title: option,
|
|
38961
39506
|
meta: '',
|
|
38962
39507
|
type: 'quality',
|
|
38963
|
-
})), preSelected: this.selectedPrinter.id
|
|
38964
|
-
|
|
38965
|
-
|
|
38966
|
-
: 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 &&
|
|
39508
|
+
})), preSelected: this.selectedPrinter.id
|
|
39509
|
+
? this.selectedProperties.resolution || null
|
|
39510
|
+
: 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 &&
|
|
38967
39511
|
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
38968
39512
|
this.selectedPrinterConfig.Trays[0] != null ? (h("ezp-select", { label: instance.t('printer_selection.trays'), placeholder: instance.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1
|
|
38969
39513
|
? this.selectedPrinterConfig.Trays.map((trays) => ({
|
|
@@ -38972,10 +39516,7 @@ const EzpPrinterSelection = class {
|
|
|
38972
39516
|
meta: '',
|
|
38973
39517
|
type: 'tray',
|
|
38974
39518
|
}))
|
|
38975
|
-
: undefined, preSelected: this.
|
|
38976
|
-
((_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); }))
|
|
38977
|
-
? (_w = this.selectedPrinterConfig.Default) === null || _w === void 0 ? void 0 : _w.Tray
|
|
38978
|
-
: null })) : null, h("ezp-input", { suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: instance.t('printer_selection.page_ranges') }))), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: instance.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: instance.t('printer_selection.print') }))), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
39519
|
+
: 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: instance.t('printer_selection.page_ranges') }))), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: instance.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: instance.t('printer_selection.print') }))), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
38979
39520
|
}
|
|
38980
39521
|
};
|
|
38981
39522
|
EzpPrinterSelection.style = ezpPrinterSelectionCss();
|
|
@@ -39058,6 +39599,18 @@ const EzpPrinting = class {
|
|
|
39058
39599
|
document.dispatchEvent(printCancelEvent);
|
|
39059
39600
|
this.printFinished.emit();
|
|
39060
39601
|
}
|
|
39602
|
+
/** Cancel or close on the print options card. With an upload step to go
|
|
39603
|
+
* back to, only the card closes: the files picked there stay picked, and
|
|
39604
|
+
* removing them is the upload card's "Clear files". Without one there is
|
|
39605
|
+
* nothing left to show, so it ends the flow like `printCancel`. */
|
|
39606
|
+
listenPrintDismiss() {
|
|
39607
|
+
if (this.trigger === 'file') {
|
|
39608
|
+
this.printOpen = false;
|
|
39609
|
+
}
|
|
39610
|
+
else {
|
|
39611
|
+
this.listenPrintCancel();
|
|
39612
|
+
}
|
|
39613
|
+
}
|
|
39061
39614
|
/** Description... */
|
|
39062
39615
|
listenPrintSubmit() {
|
|
39063
39616
|
this.printOpen = false;
|
|
@@ -39325,7 +39878,7 @@ const EzpPrinting = class {
|
|
|
39325
39878
|
*
|
|
39326
39879
|
*/
|
|
39327
39880
|
render() {
|
|
39328
|
-
return (h(Host, { key: '
|
|
39881
|
+
return (h(Host, { key: '1b33fdafac04c08cdd11412202a537f66131caef', class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
39329
39882
|
? this.systemAppearance
|
|
39330
39883
|
: 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: instance.t('no_document_dialog.heading'), description: instance.t('no_document_dialog.description'), action: instance.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
|
|
39331
39884
|
}
|
|
@@ -39561,7 +40114,7 @@ const EzpSelect = class {
|
|
|
39561
40114
|
this.disabled ? 'disabled' : '',
|
|
39562
40115
|
];
|
|
39563
40116
|
const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
|
|
39564
|
-
return (h(Host, { key: '
|
|
40117
|
+
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) => {
|
|
39565
40118
|
var _a, _b;
|
|
39566
40119
|
if (option.title !== '') {
|
|
39567
40120
|
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)));
|
|
@@ -39631,9 +40184,9 @@ const EzpStatus = class {
|
|
|
39631
40184
|
return (
|
|
39632
40185
|
// Live region so screen readers announce status changes (loading,
|
|
39633
40186
|
// processing, success, error) as they render.
|
|
39634
|
-
h(Host, { key: '
|
|
40187
|
+
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'
|
|
39635
40188
|
? this.cancel
|
|
39636
|
-
: instance.t('button_actions.cancel') })), this.close && (h("ezp-text-button", { key: '
|
|
40189
|
+
: instance.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 : instance.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 : instance.t('button_actions.retry') })))))));
|
|
39637
40190
|
}
|
|
39638
40191
|
};
|
|
39639
40192
|
EzpStatus.style = ezpStatusCss();
|
|
@@ -39770,7 +40323,7 @@ const EzpStepper = class {
|
|
|
39770
40323
|
*
|
|
39771
40324
|
*/
|
|
39772
40325
|
render() {
|
|
39773
|
-
return (h(Host, { key: '
|
|
40326
|
+
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" })))));
|
|
39774
40327
|
}
|
|
39775
40328
|
static get watchers() { return {
|
|
39776
40329
|
"value": [{
|
|
@@ -39827,12 +40380,12 @@ const EzpTextButton = class {
|
|
|
39827
40380
|
href: this.href,
|
|
39828
40381
|
target: this.blank ? '_blank' : '_self',
|
|
39829
40382
|
};
|
|
39830
|
-
return (h(Host, { key: '
|
|
40383
|
+
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' }))));
|
|
39831
40384
|
}
|
|
39832
40385
|
};
|
|
39833
40386
|
EzpTextButton.style = ezpTextButtonCss();
|
|
39834
40387
|
|
|
39835
|
-
const ezpUploadCss = () => `@charset "UTF-8";:host{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);display:block;height:var(--ezp-upload-height, auto);width:var(--ezp-upload-width, auto)}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}#form{display:block;height:100%}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}#modal{background:var(--ezp-core-surface-tertiary);border-radius:16px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden}:host(.dragging) #modal *{pointer-events:none}#body-frame{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;position:relative}#body{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;overflow-y:auto;padding:var(--ezp-spacing-4);scrollbar-width:thin}#dropzone{-ms-flex-align:center;align-items:center;background:var(--ezp-theme-translucent);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:var(--ezp-upload-dropzone-boxShadow, none);box-shadow:var(--ezp-upload-dropzone-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;min-height:160px;padding:var(--ezp-spacing-6) var(--ezp-spacing-4);text-align:center;-webkit-transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart)}:host(.dragging){--ezp-upload-dropzone-boxShadow:0 0 0 4px var(--ezp-theme-translucent)}:host(:not(.dragging)) #dropzone-title,:host(.dragging) #dropzone-prompt{display:none}#drop-overlay{-ms-flex-align:center;align-items:center;background:-webkit-gradient(linear, left top, left bottom, from(var(--ezp-theme-translucent)), to(var(--ezp-theme-translucent))), var(--ezp-core-surface-tertiary);background:linear-gradient(var(--ezp-theme-translucent), var(--ezp-theme-translucent)), var(--ezp-core-surface-tertiary);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:0 0 0 4px var(--ezp-theme-translucent);box-shadow:0 0 0 4px var(--ezp-theme-translucent);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);inset:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;pointer-events:none;position:absolute;text-align:center;z-index:1}#dropzone-icon{--ezp-icon-size:32px;--ezp-icon-gridTemplate:32px;color:var(--ezp-theme-solid)}#dropzone-prompt{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3)}#choose{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-5)}#drag-hint{color:var(--ezp-core-foreground-primary)}#formats{color:var(--ezp-core-foreground-secondary)}#files{border:1px solid var(--ezp-core-outline);border-radius:12px;overflow:hidden}.file{-ms-flex-align:center;align-items:center;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:auto minmax(0, 1fr) auto;padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}.file+.file{border-top:1px solid var(--ezp-core-outline)}.file-type{background:var(--ezp-theme-translucent);border-radius:6px;color:var(--ezp-theme-solid);font-size:11px;font-weight:600;letter-spacing:0.02em;line-height:1;overflow:hidden;padding:8px 6px;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:56px}.file-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);min-width:0}.file-size{color:var(--ezp-core-foreground-secondary)}.file-remove{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:6px;color:var(--ezp-core-foreground-tertiary);cursor:pointer;display:-ms-flexbox;display:flex;height:28px;-ms-flex-pack:center;justify-content:center;padding:0;-webkit-transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:28px}.file-remove ezp-icon{--ezp-icon-size:16px;--ezp-icon-gridTemplate:16px}@media (hover: hover){.file-remove:hover{color:var(--ezp-core-foreground-primary)}}#add-more{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-upload-addMore-background, transparent);border:0;border-top:1px solid var(--ezp-core-outline);color:var(--ezp-theme-solid);cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;gap:4px;-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);-webkit-transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:100%}#add-more ezp-icon{--ezp-icon-size:18px;--ezp-icon-gridTemplate:18px}@media (hover: hover){#add-more:hover{--ezp-upload-addMore-background:var(--ezp-core-shade-primary)}}#footer{border-top:1px solid var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr 1.4fr;padding:var(--ezp-spacing-4)}.action{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-3);--ezp-textButton-whiteSpace:normal;text-align:center}#clear{--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-boxShadow:inset 0 0 0 1px var(--ezp-core-outline);--ezp-textButton-color-init:var(--ezp-core-foreground-primary)}`;
|
|
40388
|
+
const ezpUploadCss = () => `@charset "UTF-8";:host{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);display:block;height:var(--ezp-upload-height, auto);width:var(--ezp-upload-width, auto)}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}#form{display:block;height:100%}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}#modal{background:var(--ezp-core-surface-tertiary);border-radius:16px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden}:host(.dragging) #modal *{pointer-events:none}#body-frame{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;position:relative}#body{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;overflow-y:auto;padding:var(--ezp-spacing-4);scrollbar-width:thin}#dropzone{-ms-flex-align:center;align-items:center;background:var(--ezp-theme-translucent);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:var(--ezp-upload-dropzone-boxShadow, none);box-shadow:var(--ezp-upload-dropzone-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;min-height:160px;padding:var(--ezp-spacing-6) var(--ezp-spacing-4);text-align:center;-webkit-transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart)}:host(.dragging){--ezp-upload-dropzone-boxShadow:0 0 0 4px var(--ezp-theme-translucent)}:host(:not(.dragging)) #dropzone-title,:host(.dragging) #dropzone-prompt{display:none}#drop-overlay{-ms-flex-align:center;align-items:center;background:-webkit-gradient(linear, left top, left bottom, from(var(--ezp-theme-translucent)), to(var(--ezp-theme-translucent))), var(--ezp-core-surface-tertiary);background:linear-gradient(var(--ezp-theme-translucent), var(--ezp-theme-translucent)), var(--ezp-core-surface-tertiary);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:0 0 0 4px var(--ezp-theme-translucent);box-shadow:0 0 0 4px var(--ezp-theme-translucent);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);inset:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;pointer-events:none;position:absolute;text-align:center;z-index:1}#dropzone-icon{--ezp-icon-size:32px;--ezp-icon-gridTemplate:32px;color:var(--ezp-theme-solid)}#dropzone-prompt{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3)}#choose{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-5)}#drag-hint{color:var(--ezp-core-foreground-primary)}#formats{color:var(--ezp-core-foreground-secondary)}#files{border:1px solid var(--ezp-core-outline);border-radius:12px;position:relative}#file-list{border-radius:11px 11px 0 0;max-height:var(--ezp-upload-fileList-maxHeight, calc(4.5 * calc(28px + 2 * var(--ezp-spacing-3)) + 4px));overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}.file{-ms-flex-align:center;align-items:center;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:auto minmax(0, 1fr) auto;min-height:calc(28px + 2 * var(--ezp-spacing-3));padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}.file+.file{border-top:1px solid var(--ezp-core-outline)}.file-type{background:var(--ezp-theme-translucent);border-radius:6px;color:var(--ezp-theme-solid);font-size:11px;font-weight:600;letter-spacing:0.02em;line-height:1;overflow:hidden;padding:8px 6px;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:56px}.file-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);min-width:0}.file-size{color:var(--ezp-core-foreground-secondary)}.file-remove{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:6px;color:var(--ezp-core-foreground-tertiary);cursor:pointer;display:-ms-flexbox;display:flex;height:28px;-ms-flex-pack:center;justify-content:center;padding:0;-webkit-transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:28px}.file-remove ezp-icon{--ezp-icon-size:16px;--ezp-icon-gridTemplate:16px}@media (hover: hover){.file-remove:hover{color:var(--ezp-core-foreground-primary)}}#add-more{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-upload-addMore-background, transparent);border:0;border-radius:0 0 11px 11px;border-top:1px solid var(--ezp-core-outline);color:var(--ezp-theme-solid);cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;gap:4px;-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);-webkit-transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:100%}#add-more ezp-icon{--ezp-icon-size:18px;--ezp-icon-gridTemplate:18px}@media (hover: hover){#add-more:hover{--ezp-upload-addMore-background:var(--ezp-core-shade-primary)}}#footer{border-top:1px solid var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr 1.4fr;padding:var(--ezp-spacing-4)}.action{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-3);--ezp-textButton-whiteSpace:normal;text-align:center}#clear{--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-boxShadow:inset 0 0 0 1px var(--ezp-core-outline);--ezp-textButton-color-init:var(--ezp-core-foreground-primary)}`;
|
|
39836
40389
|
|
|
39837
40390
|
/** File formats advertised to the user as supported for printing. */
|
|
39838
40391
|
const SUPPORTED_FORMATS = ['PDF', 'DOCX', 'PNG', 'JPG', 'XLSX'];
|
|
@@ -39849,6 +40402,9 @@ const EzpUpload = class {
|
|
|
39849
40402
|
*/
|
|
39850
40403
|
this.selectedFiles = [];
|
|
39851
40404
|
this.dragging = false;
|
|
40405
|
+
/** First row of the file list that is at least partly in view. Its tooltip
|
|
40406
|
+
* opens downwards, as there is no list left above it to cover. */
|
|
40407
|
+
this.firstVisibleFile = 0;
|
|
39852
40408
|
/**
|
|
39853
40409
|
*
|
|
39854
40410
|
* Listeners
|
|
@@ -39904,6 +40460,12 @@ const EzpUpload = class {
|
|
|
39904
40460
|
// `printCancel` listener resets the form and the selection.
|
|
39905
40461
|
this.printCancel.emit();
|
|
39906
40462
|
};
|
|
40463
|
+
this.handleFilesScroll = (event) => {
|
|
40464
|
+
const first = firstVisibleChild(event.currentTarget);
|
|
40465
|
+
// Scroll fires every frame; only a change of row is worth a render.
|
|
40466
|
+
if (first >= 0 && first !== this.firstVisibleFile)
|
|
40467
|
+
this.firstVisibleFile = first;
|
|
40468
|
+
};
|
|
39907
40469
|
this.handleContinue = () => {
|
|
39908
40470
|
if (this.selectedFiles.length === 0)
|
|
39909
40471
|
return;
|
|
@@ -39956,6 +40518,7 @@ const EzpUpload = class {
|
|
|
39956
40518
|
var _a;
|
|
39957
40519
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
39958
40520
|
this.selectedFiles = [];
|
|
40521
|
+
this.firstVisibleFile = 0;
|
|
39959
40522
|
this.resetDrag();
|
|
39960
40523
|
}
|
|
39961
40524
|
fileKey(file) {
|
|
@@ -39989,7 +40552,7 @@ const EzpUpload = class {
|
|
|
39989
40552
|
*/
|
|
39990
40553
|
render() {
|
|
39991
40554
|
const hasFiles = this.selectedFiles.length > 0;
|
|
39992
|
-
return (h(Host, { key: '
|
|
40555
|
+
return (h(Host, { key: '647c38e3dd42274be594a2fd5eb668943cd37256', class: { dragging: this.dragging } }, h("form", { key: 'a0af9e0bb32e8460b0b86bd897913a1c434747a8', id: "form", ref: (form) => (this.form = form) }, h("input", { key: 'd687034216a6e03a484fdd4462a7e2817675237c', type: "file", name: "input", id: "input", multiple: true, "aria-label": instance.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), h("div", { key: '82a76ba0258746bc552afc03c500a563c698e821', id: "modal" }, h("div", { key: 'a6113ba410cf3985ad64fa9300cf4e9ef2182e4f', id: "body-frame" }, h("div", { key: 'd9af36800ce744146c43a7e99f289413e13b9ae3', id: "body" }, !hasFiles && (h("div", { key: 'df98d670f9c0498597f414158108c38265b59b90', id: "dropzone" }, h("ezp-icon", { key: '0202221de58ae709f5823501cfce1bc9d1087136', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '9cbb60bc48f9e74af2c613d8c83a973e984ce824', id: "dropzone-title", level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') }), h("div", { key: 'ccaef599519bf24af543f4727fb4c1a62338b9df', id: "dropzone-prompt" }, h("ezp-text-button", { key: 'f084bb66ff63e9448cb6e7aea1782d8d2c9914b3', id: "choose", type: "button", onClick: this.openPicker, label: instance.t('upload.choose_files') }), h("ezp-label", { key: 'f5e7bd5219637c13cc0f9ad97ab42a14d35aa601', id: "drag-hint", level: "secondary", weight: "strong", text: instance.t('upload.drag_hint') }), h("ezp-label", { key: 'd5334e1e3aaaaaf9a7abb4be38a27226f73a162a', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '9eaec0f2ddb0f2ca4679e4a314afb2b42c211a17', id: "files" }, h("div", { key: 'bc990a270c2432c8237b75eebc9d4881a6bb856e', id: "file-list", onScroll: this.handleFilesScroll }, this.selectedFiles.map((file, index) => (h("div", { key: this.fileKey(file), class: "file", "data-tooltip-row": true }, 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, anchor: "parent", placement: index === this.firstVisibleFile ? 'bottom' : 'top' }), h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), h("button", { type: "button", class: "file-remove", "aria-label": instance.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index) }, h("ezp-icon", { name: "close" })))))), h("button", { key: 'd22584a56b417545260c5b8c2210a6c62b59426e', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: '1313f4255c6a58e58d04b0188153ec815ce6b938', name: "plus" }), h("ezp-label", { key: 'deadcecb7b733c33a3990802a4ebf6b84726b48e', level: "secondary", weight: "heavy", text: instance.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: '20bf6c68fd28c8de0b63b88aad24f1ab63d25ac3', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: '135896652629a8eba574c21af1af20ba6722ad5d', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '03921a166561ce06af4fce3abcd1f812738844f5', level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') })))), h("div", { key: '2d1e16e9e8ca950e1e968ca12939a245f7618adc', id: "footer" }, h("ezp-text-button", { key: '6a776b09c068982932225a4903df003e8a89b20a', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: instance.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: 'ca872a7d7834191001faef1140dbd344566ed79d', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: instance.t('upload.continue'), class: "action" }))))));
|
|
39993
40556
|
}
|
|
39994
40557
|
};
|
|
39995
40558
|
EzpUpload.style = ezpUploadCss();
|
|
@@ -40079,7 +40642,7 @@ const EzpUserMenu = class {
|
|
|
40079
40642
|
*
|
|
40080
40643
|
*/
|
|
40081
40644
|
render() {
|
|
40082
|
-
return (h(Host, { key: '
|
|
40645
|
+
return (h(Host, { key: 'a6967dc3eb3b13630dbf652681c6c5c1f769f584', class: this.open ? 'is-open' : '' }, h("div", { key: '5cbf232927f4b26c1c05b01a6025b5f33fe3bfaa', id: "header" }, h("ezp-label", { key: '83987303c029d9d01f42d5d817edaf6c72629513', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '45a64f18578adf35aeb824e393a359368e32e35a', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '8bd44e5b32662baad24ee9a39abca4e772b0ef4b', 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: '64f041741f7760f85dd5090d0c9feebd7dec3289', class: "link", onClick: this.logOut }, h("ezp-icon", { key: 'bd0beefa519acb37328d9c3fd33c4286ff7e1ddc', class: "link__icon", name: "logout" }), h("ezp-label", { key: 'a37c8e9ffc43d0d89fe4d5dadf1dde5e36155074', text: instance.t('user_menu.logout') }))), h("div", { key: 'ad74827637906199b94f61d5f617fcaa9044c553', id: "theme" }, h("ezp-label", { key: 'c420ad169436c96acd4add9951e02f2d6fd43240', class: "caption", text: `${instance.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '04d383554f2cdfd6b7864c3e23295e2bc6f244b8', 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: '4e40758f22b322cbcd3d26054c6c4801c555430a', id: "appearance" }, h("ezp-label", { key: '3034f9eaa028ce4928c8bf2c36dc223b98eba45d', class: "caption", text: `${instance.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: 'dfa6a115e24db557891295f3a8e1ab1cfa4332f0', 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" }))))))));
|
|
40083
40646
|
}
|
|
40084
40647
|
get component() { return getElement(this); }
|
|
40085
40648
|
static get watchers() { return {
|
|
@@ -40090,4 +40653,4 @@ const EzpUserMenu = class {
|
|
|
40090
40653
|
};
|
|
40091
40654
|
EzpUserMenu.style = ezpUserMenuCss();
|
|
40092
40655
|
|
|
40093
|
-
export { EzpAuth as ezp_auth, EzpBackdrop as ezp_backdrop, EzpDialog as ezp_dialog, EzpIcon as ezp_icon, EzpIconButton as ezp_icon_button, EzpInput as ezp_input, EzpLabel as ezp_label, EzpPrinterSelection as ezp_printer_selection, EzpPrinting as ezp_printing, EzpSelect as ezp_select, EzpStatus as ezp_status, EzpStepper as ezp_stepper, EzpTextButton as ezp_text_button, EzpUpload as ezp_upload, EzpUserMenu as ezp_user_menu };
|
|
40656
|
+
export { EzpAuth as ezp_auth, EzpBackdrop as ezp_backdrop, EzpDialog as ezp_dialog, EzpFileName as ezp_file_name, EzpIcon as ezp_icon, EzpIconButton as ezp_icon_button, EzpInput as ezp_input, EzpLabel as ezp_label, EzpPrinterSelection as ezp_printer_selection, EzpPrinting as ezp_printing, EzpSelect as ezp_select, EzpStatus as ezp_status, EzpStepper as ezp_stepper, EzpTextButton as ezp_text_button, EzpUpload as ezp_upload, EzpUserMenu as ezp_user_menu };
|