@ezeep/ezeep-js 1.0.294 → 1.0.302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/{ezp-auth_15.cjs.entry.js → ezp-auth_16.cjs.entry.js} +510 -109
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ezp-file-name/ezp-file-name.css +98 -0
- package/dist/collection/components/ezp-file-name/ezp-file-name.js +280 -0
- package/dist/collection/components/ezp-icon/ezp-icon.js +1 -1
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
- package/dist/collection/components/ezp-input/ezp-input.js +1 -1
- package/dist/collection/components/ezp-label/ezp-label.js +39 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +4 -2
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +216 -88
- package/dist/collection/components/ezp-printing/ezp-printing.js +1 -1
- package/dist/collection/components/ezp-select/ezp-select.js +1 -1
- package/dist/collection/components/ezp-status/ezp-status.js +2 -2
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
- package/dist/collection/components/ezp-upload/ezp-upload.css +5 -1
- package/dist/collection/components/ezp-upload/ezp-upload.js +1 -1
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
- package/dist/collection/shared/storage.js +39 -9
- package/dist/collection/types/shared/types.d.ts +1 -0
- package/dist/collection/utils/printer.js +75 -1
- package/dist/components/auth.js +1 -1
- package/dist/components/ezp-file-name.d.ts +11 -0
- package/dist/components/ezp-file-name.js +1 -0
- package/dist/components/ezp-file-name2.js +1 -0
- package/dist/components/ezp-icon-button2.js +1 -1
- package/dist/components/ezp-icon2.js +1 -1
- package/dist/components/ezp-input2.js +1 -1
- package/dist/components/ezp-label2.js +1 -1
- package/dist/components/ezp-printer-selection2.js +1 -1
- package/dist/components/ezp-printing.js +1 -1
- package/dist/components/ezp-select2.js +1 -1
- package/dist/components/ezp-status2.js +1 -1
- package/dist/components/ezp-stepper2.js +1 -1
- package/dist/components/ezp-text-button2.js +1 -1
- package/dist/components/ezp-upload2.js +1 -1
- package/dist/components/ezp-user-menu2.js +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/directives/proxies.ts +26 -1
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +510 -110
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-fe700ca4.system.entry.js → p-636e190f.system.entry.js} +2 -2
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
- package/dist/ezeep/p-ff075048.entry.js +1 -0
- package/dist/ezeep/types/shared/types.d.ts +1 -0
- package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +83 -0
- package/dist/types/components/ezp-label/ezp-label.d.ts +10 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +40 -2
- package/dist/types/components.d.ts +65 -2
- package/dist/types/shared/storage.d.ts +18 -4
- package/dist/types/shared/types.d.ts +1 -0
- package/dist/types/utils/printer.d.ts +18 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-fe700ca4.system.entry.js → p-636e190f.system.entry.js} +2 -2
- package/www/build/p-DCznw2Ee.system.js +1 -1
- package/www/build/p-a2a4f55b.js +1 -0
- package/www/build/p-ff075048.entry.js +1 -0
- package/www/index.html +1 -1
- package/dist/ezeep/p-3ab5a223.entry.js +0 -1
- package/www/build/p-3ab5a223.entry.js +0 -1
- package/www/build/p-65242d5e.js +0 -1
|
@@ -2880,8 +2880,10 @@ const KEY = {
|
|
|
2880
2880
|
accessToken: 'access_token',
|
|
2881
2881
|
refreshToken: 'refreshToken',
|
|
2882
2882
|
isAuthorized: 'isAuthorized',
|
|
2883
|
+
/** Legacy single-printer settings blob, read once to seed `printerSettings`. */
|
|
2883
2884
|
properties: 'properties',
|
|
2884
2885
|
printer: 'printer',
|
|
2886
|
+
printerSettings: 'printerSettings',
|
|
2885
2887
|
};
|
|
2886
2888
|
function getJSON(key) {
|
|
2887
2889
|
const raw = localStorage.getItem(key);
|
|
@@ -2912,32 +2914,60 @@ const storage = {
|
|
|
2912
2914
|
hasIsAuthorized() {
|
|
2913
2915
|
return localStorage.getItem(KEY.isAuthorized) !== null;
|
|
2914
2916
|
},
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
+
/**
|
|
2918
|
+
* Settings the user last printed with on `printerId`, or null if that printer
|
|
2919
|
+
* has none yet. Kept per printer so switching printers never carries another
|
|
2920
|
+
* printer's paper size or tray over to one that may not have it.
|
|
2921
|
+
*/
|
|
2922
|
+
getPrinterSettings(printerId) {
|
|
2923
|
+
var _a;
|
|
2924
|
+
return (_a = readPrinterSettings()[printerId]) !== null && _a !== void 0 ? _a : null;
|
|
2917
2925
|
},
|
|
2918
|
-
|
|
2919
|
-
|
|
2926
|
+
setPrinterSettings(printerId, properties) {
|
|
2927
|
+
const all = readPrinterSettings();
|
|
2928
|
+
all[printerId] = properties;
|
|
2929
|
+
localStorage.setItem(KEY.printerSettings, JSON.stringify(all));
|
|
2920
2930
|
},
|
|
2931
|
+
/** The printer used for the last print, preselected when the dialog reopens. */
|
|
2921
2932
|
getPrinter() {
|
|
2922
2933
|
return getJSON(KEY.printer);
|
|
2923
2934
|
},
|
|
2924
2935
|
setPrinter(printer) {
|
|
2925
2936
|
localStorage.setItem(KEY.printer, JSON.stringify(printer));
|
|
2926
2937
|
},
|
|
2927
|
-
/**
|
|
2938
|
+
/**
|
|
2939
|
+
* Remove everything tied to the current session (used on logout).
|
|
2940
|
+
*
|
|
2941
|
+
* Print settings and the last printer deliberately survive: they belong to
|
|
2942
|
+
* this browser profile rather than to the session, and are validated against
|
|
2943
|
+
* the signed-in user's printers on the next load (an unknown printer resets
|
|
2944
|
+
* the selection), so the next user never inherits a selection they can't use.
|
|
2945
|
+
*/
|
|
2928
2946
|
clearSession() {
|
|
2929
|
-
localStorage.removeItem(KEY.properties);
|
|
2930
2947
|
localStorage.removeItem(KEY.refreshToken);
|
|
2931
2948
|
localStorage.removeItem(KEY.accessToken);
|
|
2932
|
-
localStorage.removeItem(KEY.printer);
|
|
2933
2949
|
localStorage.removeItem(KEY.isAuthorized);
|
|
2934
2950
|
},
|
|
2935
|
-
/**
|
|
2951
|
+
/** Forget which printer was last used (when it is gone from the user's list).
|
|
2952
|
+
* Its settings stay put, ready in case that printer comes back. */
|
|
2936
2953
|
clearSavedPrinter() {
|
|
2937
2954
|
localStorage.removeItem(KEY.printer);
|
|
2938
|
-
localStorage.removeItem(KEY.properties);
|
|
2939
2955
|
},
|
|
2940
2956
|
};
|
|
2957
|
+
/**
|
|
2958
|
+
* Read the per-printer settings map, seeding it once from the pre-upgrade
|
|
2959
|
+
* single-printer blob so a user who already printed keeps those settings.
|
|
2960
|
+
*/
|
|
2961
|
+
function readPrinterSettings() {
|
|
2962
|
+
const stored = getJSON(KEY.printerSettings);
|
|
2963
|
+
if (stored)
|
|
2964
|
+
return stored;
|
|
2965
|
+
const legacy = getJSON(KEY.properties);
|
|
2966
|
+
const legacyPrinter = getJSON(KEY.printer);
|
|
2967
|
+
if (legacy && (legacyPrinter === null || legacyPrinter === void 0 ? void 0 : legacyPrinter.id))
|
|
2968
|
+
return { [legacyPrinter.id]: legacy };
|
|
2969
|
+
return {};
|
|
2970
|
+
}
|
|
2941
2971
|
|
|
2942
2972
|
class EzpAuthorizationService {
|
|
2943
2973
|
constructor(redirectURI, clientID) {
|
|
@@ -3353,6 +3383,158 @@ const EzpDialog = class {
|
|
|
3353
3383
|
};
|
|
3354
3384
|
EzpDialog.style = ezpDialogCss();
|
|
3355
3385
|
|
|
3386
|
+
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))}`;
|
|
3387
|
+
|
|
3388
|
+
/**
|
|
3389
|
+
* Characters kept at the end of a truncated name. Uploads often differ only in
|
|
3390
|
+
* a suffix like `_DE.pdf`, which a plain end-ellipsis would be the first thing
|
|
3391
|
+
* to hide, so that tail is held back and the middle gives way instead.
|
|
3392
|
+
*/
|
|
3393
|
+
const TAIL_LENGTH = 8;
|
|
3394
|
+
/** Hovering across a list shouldn't flash a tooltip over every row in passing. */
|
|
3395
|
+
const OPEN_DELAY_MS = 300;
|
|
3396
|
+
/** Grace period for crossing the gap between the name and the bubble, so the
|
|
3397
|
+
* tooltip can be hovered rather than vanishing on the way (WCAG 1.4.13). */
|
|
3398
|
+
const CLOSE_DELAY_MS = 200;
|
|
3399
|
+
const EzpFileName = class {
|
|
3400
|
+
constructor(hostRef) {
|
|
3401
|
+
registerInstance(this, hostRef);
|
|
3402
|
+
/** Invalidates an in-flight open when the pointer leaves. */
|
|
3403
|
+
this.openGeneration = 0;
|
|
3404
|
+
/**
|
|
3405
|
+
*
|
|
3406
|
+
* Properties
|
|
3407
|
+
*
|
|
3408
|
+
*/
|
|
3409
|
+
/** The full file name. Always present in the DOM, so screen readers and
|
|
3410
|
+
* copy-paste get it in full however it is truncated on screen. */
|
|
3411
|
+
this.name = '';
|
|
3412
|
+
/** Type scale of the rendered name, passed through to `ezp-label`. */
|
|
3413
|
+
this.level = 'secondary';
|
|
3414
|
+
/** Font weight of the rendered name, passed through to `ezp-label`. */
|
|
3415
|
+
this.weight = 'soft';
|
|
3416
|
+
/** Side the tooltip opens on. Consumers point it away from the edge their
|
|
3417
|
+
* row sits against — `bottom` for the first row of a list, `top` below it. */
|
|
3418
|
+
this.placement = 'top';
|
|
3419
|
+
/**
|
|
3420
|
+
*
|
|
3421
|
+
* States
|
|
3422
|
+
*
|
|
3423
|
+
*/
|
|
3424
|
+
/** Set by tapping the name: shows it in full, wrapped over several lines.
|
|
3425
|
+
* This is the touch counterpart of the tooltip, which needs a pointer. */
|
|
3426
|
+
this.expanded = false;
|
|
3427
|
+
this.tooltipOpen = false;
|
|
3428
|
+
this.openTooltip = () => {
|
|
3429
|
+
if (!this.hasHover || this.expanded)
|
|
3430
|
+
return;
|
|
3431
|
+
clearTimeout(this.openTimeout);
|
|
3432
|
+
const generation = ++this.openGeneration;
|
|
3433
|
+
this.openTimeout = setTimeout(async () => {
|
|
3434
|
+
const clipped = await this.isClipped();
|
|
3435
|
+
// Measuring yields, and the pointer may have moved on in the meantime —
|
|
3436
|
+
// opening now would leave a tooltip behind with nothing to dismiss it.
|
|
3437
|
+
if (clipped && generation === this.openGeneration)
|
|
3438
|
+
this.tooltipOpen = true;
|
|
3439
|
+
}, OPEN_DELAY_MS);
|
|
3440
|
+
};
|
|
3441
|
+
this.closeTooltip = () => {
|
|
3442
|
+
this.openGeneration++;
|
|
3443
|
+
clearTimeout(this.openTimeout);
|
|
3444
|
+
clearTimeout(this.closeTimeout);
|
|
3445
|
+
this.tooltipOpen = false;
|
|
3446
|
+
};
|
|
3447
|
+
/** Leaves the tooltip up briefly so the pointer can reach it. */
|
|
3448
|
+
this.scheduleClose = () => {
|
|
3449
|
+
clearTimeout(this.openTimeout);
|
|
3450
|
+
clearTimeout(this.closeTimeout);
|
|
3451
|
+
this.closeTimeout = setTimeout(this.closeTooltip, CLOSE_DELAY_MS);
|
|
3452
|
+
};
|
|
3453
|
+
this.cancelScheduledClose = () => {
|
|
3454
|
+
clearTimeout(this.closeTimeout);
|
|
3455
|
+
};
|
|
3456
|
+
this.toggleExpanded = () => {
|
|
3457
|
+
this.expanded = !this.expanded;
|
|
3458
|
+
// The full name is on screen now; a tooltip repeating it is just in the way.
|
|
3459
|
+
if (this.expanded)
|
|
3460
|
+
this.closeTooltip();
|
|
3461
|
+
};
|
|
3462
|
+
}
|
|
3463
|
+
/**
|
|
3464
|
+
*
|
|
3465
|
+
* Lifecycle methods
|
|
3466
|
+
*
|
|
3467
|
+
*/
|
|
3468
|
+
disconnectedCallback() {
|
|
3469
|
+
clearTimeout(this.openTimeout);
|
|
3470
|
+
clearTimeout(this.closeTimeout);
|
|
3471
|
+
}
|
|
3472
|
+
/**
|
|
3473
|
+
*
|
|
3474
|
+
* Listeners
|
|
3475
|
+
*
|
|
3476
|
+
*/
|
|
3477
|
+
/**
|
|
3478
|
+
* Escape dismisses the tooltip, and only the tooltip.
|
|
3479
|
+
*
|
|
3480
|
+
* Listening globally catches the key however the tooltip was opened,
|
|
3481
|
+
* including by hover, when nothing here has focus. It has to run in the
|
|
3482
|
+
* capture phase: stopping propagation on the way back up happens after every
|
|
3483
|
+
* ancestor has already seen the key, so a host app that closes its dialog on
|
|
3484
|
+
* Escape would close it as the tooltip was dismissed.
|
|
3485
|
+
*
|
|
3486
|
+
* `window` rather than `document`, because dialog libraries capture on the
|
|
3487
|
+
* document themselves — Radix's `DismissableLayer` does — and register before
|
|
3488
|
+
* a component mounted inside them, so they would still see the key first.
|
|
3489
|
+
* Capture runs window before document, so this transient layer consumes the
|
|
3490
|
+
* key first, and only while it is actually open.
|
|
3491
|
+
*/
|
|
3492
|
+
handleKeyDown(event) {
|
|
3493
|
+
if (event.key === 'Escape' && this.tooltipOpen) {
|
|
3494
|
+
event.stopPropagation();
|
|
3495
|
+
this.closeTooltip();
|
|
3496
|
+
}
|
|
3497
|
+
}
|
|
3498
|
+
/**
|
|
3499
|
+
*
|
|
3500
|
+
* Private methods
|
|
3501
|
+
*
|
|
3502
|
+
*/
|
|
3503
|
+
/** Tooltips need a pointer; touch devices get the tap-to-expand path instead.
|
|
3504
|
+
* Tapping fires a synthetic `mouseenter` in most mobile browsers, so without
|
|
3505
|
+
* this check a tooltip would open on every tap. */
|
|
3506
|
+
get hasHover() {
|
|
3507
|
+
var _a, _b;
|
|
3508
|
+
return (_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(hover: hover)').matches) !== null && _b !== void 0 ? _b : false;
|
|
3509
|
+
}
|
|
3510
|
+
/** Whether anything is actually hidden. A name that fits needs no tooltip —
|
|
3511
|
+
* repeating text the reader can already see is just noise in the way. */
|
|
3512
|
+
async isClipped() {
|
|
3513
|
+
var _a, _b;
|
|
3514
|
+
const head = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.head');
|
|
3515
|
+
if (!head)
|
|
3516
|
+
return false;
|
|
3517
|
+
await ((_b = head.componentOnReady) === null || _b === void 0 ? void 0 : _b.call(head));
|
|
3518
|
+
return head.isTruncated();
|
|
3519
|
+
}
|
|
3520
|
+
/**
|
|
3521
|
+
*
|
|
3522
|
+
* Render method
|
|
3523
|
+
*
|
|
3524
|
+
*/
|
|
3525
|
+
render() {
|
|
3526
|
+
// Splitting is a rendering device only: `head` holds everything but the last
|
|
3527
|
+
// few characters and is the part CSS is allowed to clip, so the two labels
|
|
3528
|
+
// together still spell out the whole name.
|
|
3529
|
+
const split = !this.expanded && this.name.length > TAIL_LENGTH;
|
|
3530
|
+
const head = split ? this.name.slice(0, -TAIL_LENGTH) : this.name;
|
|
3531
|
+
const tail = split ? this.name.slice(-TAIL_LENGTH) : '';
|
|
3532
|
+
return (h(Host, { key: '4e84aca15abf4d1e59f2418fff0fdc13efd2a7b2', class: { expanded: this.expanded, [`place-${this.placement}`]: true } }, h("button", { key: '61de272bffc87cd440cd307ba49bee1f9795f8ae', 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: 'd8120b13f24c5921d688431f90f7967b60fe4878', class: "head", ellipsis: split, level: this.level, weight: this.weight, text: head }), split && h("ezp-label", { key: '9129bedf96a55bd650efca46a3f2e7e599af2776', class: "tail", level: this.level, weight: this.weight, text: tail })), this.tooltipOpen && (h("div", { key: 'fb710729e9262fca148c342bf99c001fd5a760c3', id: "tooltip", "aria-hidden": "true", onMouseEnter: this.cancelScheduledClose, onMouseLeave: this.closeTooltip }, this.name))));
|
|
3533
|
+
}
|
|
3534
|
+
get host() { return getElement(this); }
|
|
3535
|
+
};
|
|
3536
|
+
EzpFileName.style = ezpFileNameCss();
|
|
3537
|
+
|
|
3356
3538
|
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
3539
|
|
|
3358
3540
|
const EzpIcon = class {
|
|
@@ -3387,7 +3569,7 @@ const EzpIcon = class {
|
|
|
3387
3569
|
return (
|
|
3388
3570
|
// Decorative: icons here always sit next to a label or live-region text,
|
|
3389
3571
|
// so hide them from the accessibility tree to avoid double announcements.
|
|
3390
|
-
h(Host, { key: '
|
|
3572
|
+
h(Host, { key: 'f1a45d38b75ccf4e0c5e6200d9d04c7e5766bfbc', class: `${this.size} ${this.framed ? 'framed' : ''}`, "aria-hidden": "true" }, h("div", { key: '70f6963181d31089fefb662079e1e075540d2fe7', id: "glyph", innerHTML: this.glyph })));
|
|
3391
3573
|
}
|
|
3392
3574
|
static get assetsDirs() { return ["assets"]; }
|
|
3393
3575
|
};
|
|
@@ -3429,7 +3611,7 @@ const EzpIconButton = class {
|
|
|
3429
3611
|
// Icon-only control: derive an accessible name from the icon so screen
|
|
3430
3612
|
// readers announce something meaningful (e.g. "menu", "printer").
|
|
3431
3613
|
const label = this.icon.replace(/[-_]/g, ' ');
|
|
3432
|
-
return (h(Host, { key: '
|
|
3614
|
+
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
3615
|
}
|
|
3434
3616
|
};
|
|
3435
3617
|
EzpIconButton.style = ezpIconButtonCss();
|
|
@@ -3484,7 +3666,7 @@ const EzpInput = class {
|
|
|
3484
3666
|
}
|
|
3485
3667
|
render() {
|
|
3486
3668
|
const hasIcon = !!this.icon;
|
|
3487
|
-
return (h(Host, { key: '
|
|
3669
|
+
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
3670
|
}
|
|
3489
3671
|
};
|
|
3490
3672
|
EzpInput.style = ezpInputCss();
|
|
@@ -3510,14 +3692,31 @@ const EzpLabel = class {
|
|
|
3510
3692
|
/** Description... */
|
|
3511
3693
|
this.weight = 'soft';
|
|
3512
3694
|
}
|
|
3695
|
+
/**
|
|
3696
|
+
*
|
|
3697
|
+
* Public methods
|
|
3698
|
+
*
|
|
3699
|
+
*/
|
|
3700
|
+
/** Whether the text is currently clipped — `ellipsis` only bites when the
|
|
3701
|
+
* text outgrows the space it was given, which callers cannot tell from the
|
|
3702
|
+
* props alone. Lets a caller offer the full text only when it is needed. */
|
|
3703
|
+
async isTruncated() {
|
|
3704
|
+
var _a;
|
|
3705
|
+
const text = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#text');
|
|
3706
|
+
if (!text)
|
|
3707
|
+
return false;
|
|
3708
|
+
// A pixel of slack: sub-pixel layout rounds scrollWidth up on its own.
|
|
3709
|
+
return text.scrollWidth > text.clientWidth + 1;
|
|
3710
|
+
}
|
|
3513
3711
|
/**
|
|
3514
3712
|
*
|
|
3515
3713
|
* Render method
|
|
3516
3714
|
*
|
|
3517
3715
|
*/
|
|
3518
3716
|
render() {
|
|
3519
|
-
return (h(Host, { key: '
|
|
3717
|
+
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
3718
|
}
|
|
3719
|
+
get host() { return getElement(this); }
|
|
3521
3720
|
};
|
|
3522
3721
|
EzpLabel.style = ezpLabelCss();
|
|
3523
3722
|
|
|
@@ -38095,6 +38294,8 @@ const userStore = createStore({
|
|
|
38095
38294
|
appearance: '',
|
|
38096
38295
|
});
|
|
38097
38296
|
|
|
38297
|
+
/** Duplex modes the dialog offers: none, long edge, short edge. */
|
|
38298
|
+
const DUPLEX_MODES = [1, 2, 3];
|
|
38098
38299
|
/**
|
|
38099
38300
|
* Derive the default print properties for a printer from its configuration.
|
|
38100
38301
|
*
|
|
@@ -38137,6 +38338,78 @@ function applyPrinterDefaults(config, properties) {
|
|
|
38137
38338
|
delete properties.PageRanges;
|
|
38138
38339
|
return properties;
|
|
38139
38340
|
}
|
|
38341
|
+
/**
|
|
38342
|
+
* Carry the settings the user last printed with on this printer over the
|
|
38343
|
+
* printer's own defaults, dropping anything the printer can no longer do.
|
|
38344
|
+
*
|
|
38345
|
+
* Capabilities change between sessions — a printer loses a tray, an admin
|
|
38346
|
+
* swaps the paper formats — and a stale value would otherwise be sent to the
|
|
38347
|
+
* API or shown as a selection that isn't in the list. Each field is therefore
|
|
38348
|
+
* only restored if the current config still offers it; everything else stays
|
|
38349
|
+
* on the default `applyPrinterDefaults` just put in place. Copies and page
|
|
38350
|
+
* ranges are never part of `saved`, so they are never restored.
|
|
38351
|
+
*/
|
|
38352
|
+
function applySavedProperties(config, saved, properties) {
|
|
38353
|
+
var _a, _b, _c, _d, _e;
|
|
38354
|
+
applyPrinterDefaults(config, properties);
|
|
38355
|
+
if (!saved)
|
|
38356
|
+
return properties;
|
|
38357
|
+
if (config.ColorSupported && typeof saved.color === 'boolean') {
|
|
38358
|
+
properties.color = saved.color;
|
|
38359
|
+
}
|
|
38360
|
+
if (config.DuplexSupported && DUPLEX_MODES.includes(Number(saved.duplexmode))) {
|
|
38361
|
+
properties.duplex = true;
|
|
38362
|
+
properties.duplexmode = Number(saved.duplexmode);
|
|
38363
|
+
}
|
|
38364
|
+
const paper = (_a = config.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((format) => format.Id === Number(saved.paperid));
|
|
38365
|
+
if (paper) {
|
|
38366
|
+
properties.paper = paper.Name;
|
|
38367
|
+
properties.paperid = paper.Id;
|
|
38368
|
+
// Only meaningful for the custom format, which carries its own dimensions.
|
|
38369
|
+
if (paper.Id === PAPER_ID) {
|
|
38370
|
+
properties.paperwidth = saved.paperwidth;
|
|
38371
|
+
properties.paperlength = saved.paperlength;
|
|
38372
|
+
}
|
|
38373
|
+
}
|
|
38374
|
+
// Orientations are offered as 1-based positions in `OrientationsSupported`.
|
|
38375
|
+
const orientation = Number(saved.orientation);
|
|
38376
|
+
if (orientation >= 1 && orientation <= ((_c = (_b = config.OrientationsSupported) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0)) {
|
|
38377
|
+
properties.orientation = orientation;
|
|
38378
|
+
}
|
|
38379
|
+
if (typeof saved.resolution === 'string' && ((_d = config.Resolutions) === null || _d === void 0 ? void 0 : _d.includes(saved.resolution))) {
|
|
38380
|
+
properties.resolution = saved.resolution;
|
|
38381
|
+
}
|
|
38382
|
+
if (hasTrays(config)) {
|
|
38383
|
+
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));
|
|
38384
|
+
if (tray) {
|
|
38385
|
+
properties.trayname = tray.Name;
|
|
38386
|
+
properties.defaultSource = tray.Index;
|
|
38387
|
+
}
|
|
38388
|
+
}
|
|
38389
|
+
return properties;
|
|
38390
|
+
}
|
|
38391
|
+
/**
|
|
38392
|
+
* The slice of the current selection worth remembering for next time: what the
|
|
38393
|
+
* print dialog offers per printer, minus copies and page ranges, which belong
|
|
38394
|
+
* to the one document being printed rather than to the printer.
|
|
38395
|
+
*/
|
|
38396
|
+
function pickRememberedProperties(properties) {
|
|
38397
|
+
const { color, duplex, duplexmode, paper, paperid, paperwidth, paperlength } = properties;
|
|
38398
|
+
const { orientation, resolution, trayname, defaultSource } = properties;
|
|
38399
|
+
return {
|
|
38400
|
+
color,
|
|
38401
|
+
duplex,
|
|
38402
|
+
duplexmode,
|
|
38403
|
+
paper,
|
|
38404
|
+
paperid,
|
|
38405
|
+
paperwidth,
|
|
38406
|
+
paperlength,
|
|
38407
|
+
orientation,
|
|
38408
|
+
resolution,
|
|
38409
|
+
trayname,
|
|
38410
|
+
defaultSource,
|
|
38411
|
+
};
|
|
38412
|
+
}
|
|
38140
38413
|
/** Does this printer config report an explicit "no usable trays" state? */
|
|
38141
38414
|
function hasNoTrays(config) {
|
|
38142
38415
|
return !!config.Trays && config.Trays.length >= 0 && config.Trays[0] == null;
|
|
@@ -38234,7 +38507,7 @@ async function uploadAndPrintFile(ctx, file, hooks = {}) {
|
|
|
38234
38507
|
}
|
|
38235
38508
|
}
|
|
38236
38509
|
|
|
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);padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}.file-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);min-width:0}.file-row ezp-
|
|
38510
|
+
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);padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}.file-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);min-width:0;position:relative}.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
38511
|
|
|
38239
38512
|
const EzpPrinterSelection = class {
|
|
38240
38513
|
constructor(hostRef) {
|
|
@@ -38287,6 +38560,10 @@ const EzpPrinterSelection = class {
|
|
|
38287
38560
|
this.hubDriverError = false;
|
|
38288
38561
|
this.userMenuOpen = false;
|
|
38289
38562
|
this.printStopped = false;
|
|
38563
|
+
/** Starts empty so the dialog can still render if the list never arrives. */
|
|
38564
|
+
this.printers = [];
|
|
38565
|
+
/** Starts empty so the dialog renders even if the list never loads. */
|
|
38566
|
+
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
38290
38567
|
this.selectedPrinterConfig = {
|
|
38291
38568
|
Default: {
|
|
38292
38569
|
Color: '',
|
|
@@ -38319,6 +38596,8 @@ const EzpPrinterSelection = class {
|
|
|
38319
38596
|
trayname: '',
|
|
38320
38597
|
PageRanges: '',
|
|
38321
38598
|
};
|
|
38599
|
+
/** True while a printer's capabilities are being fetched. */
|
|
38600
|
+
this.loadingPrinterConfig = false;
|
|
38322
38601
|
this.currentFileIndex = 0;
|
|
38323
38602
|
this.totalFiles = 0;
|
|
38324
38603
|
this.failedFiles = [];
|
|
@@ -38509,8 +38788,7 @@ const EzpPrinterSelection = class {
|
|
|
38509
38788
|
if (hubTimeout)
|
|
38510
38789
|
clearTimeout(hubTimeout);
|
|
38511
38790
|
}
|
|
38512
|
-
|
|
38513
|
-
storage.setPrinter(this.selectedPrinter);
|
|
38791
|
+
this.rememberSelection();
|
|
38514
38792
|
this.printStopped = false;
|
|
38515
38793
|
};
|
|
38516
38794
|
this.handleUserMenu = () => {
|
|
@@ -38603,24 +38881,45 @@ const EzpPrinterSelection = class {
|
|
|
38603
38881
|
break;
|
|
38604
38882
|
}
|
|
38605
38883
|
}
|
|
38606
|
-
/** Print needs a printer, no job in flight and
|
|
38884
|
+
/** Print needs a printer with its capabilities in hand, no job in flight and
|
|
38885
|
+
* a valid page range. The config matters: between picking a printer and its
|
|
38886
|
+
* properties arriving, the selection is set but the properties still hold
|
|
38887
|
+
* blank defaults, and printing then saves those as that printer's settings. */
|
|
38607
38888
|
get printDisabled() {
|
|
38608
|
-
return this.selectedPrinter.id === '' ||
|
|
38889
|
+
return (this.selectedPrinter.id === '' ||
|
|
38890
|
+
this.loadingPrinterConfig ||
|
|
38891
|
+
this.printProcessing ||
|
|
38892
|
+
this.pageRangeInvalid);
|
|
38893
|
+
}
|
|
38894
|
+
/** Keep this printer and its settings for the next print. Stored per printer,
|
|
38895
|
+
* so each one keeps its own and no setting follows the user to a printer
|
|
38896
|
+
* that cannot do it. */
|
|
38897
|
+
rememberSelection() {
|
|
38898
|
+
if (!this.selectedPrinter.id)
|
|
38899
|
+
return;
|
|
38900
|
+
storage.setPrinterSettings(this.selectedPrinter.id, pickRememberedProperties(this.selectedProperties));
|
|
38901
|
+
storage.setPrinter(this.selectedPrinter);
|
|
38609
38902
|
}
|
|
38610
|
-
|
|
38611
|
-
|
|
38612
|
-
|
|
38613
|
-
|
|
38614
|
-
|
|
38903
|
+
/**
|
|
38904
|
+
* Decide which printer the dialog opens on: the one last printed to, or the
|
|
38905
|
+
* user's only printer when there is nothing to choose between. Its settings
|
|
38906
|
+
* follow once its config is in, since they can only be validated against the
|
|
38907
|
+
* printer's capabilities.
|
|
38908
|
+
*/
|
|
38909
|
+
selectInitialPrinter() {
|
|
38910
|
+
var _a, _b;
|
|
38615
38911
|
const savedPrinter = storage.getPrinter();
|
|
38616
|
-
|
|
38617
|
-
|
|
38618
|
-
|
|
38619
|
-
|
|
38620
|
-
|
|
38621
|
-
|
|
38622
|
-
|
|
38623
|
-
|
|
38912
|
+
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));
|
|
38913
|
+
// A printer the user no longer has must not stay preselected.
|
|
38914
|
+
if (savedPrinter && !savedIsAvailable)
|
|
38915
|
+
storage.clearSavedPrinter();
|
|
38916
|
+
if (savedPrinter && savedIsAvailable) {
|
|
38917
|
+
this.selectedPrinter = savedPrinter;
|
|
38918
|
+
}
|
|
38919
|
+
else if (((_b = this.printers) === null || _b === void 0 ? void 0 : _b.length) === 1) {
|
|
38920
|
+
// Nothing to pick between: opening a dropdown with one entry in it is
|
|
38921
|
+
// busywork, so start on it.
|
|
38922
|
+
this.selectedPrinter = this.printers[0];
|
|
38624
38923
|
}
|
|
38625
38924
|
else {
|
|
38626
38925
|
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
@@ -38639,17 +38938,22 @@ const EzpPrinterSelection = class {
|
|
|
38639
38938
|
}
|
|
38640
38939
|
async setSelectedProperties(eventDetails) {
|
|
38641
38940
|
switch (eventDetails.type) {
|
|
38642
|
-
case 'printer':
|
|
38643
|
-
this.
|
|
38644
|
-
this.selectedPrinter
|
|
38645
|
-
|
|
38646
|
-
|
|
38647
|
-
|
|
38648
|
-
.
|
|
38649
|
-
|
|
38650
|
-
|
|
38651
|
-
|
|
38941
|
+
case 'printer': {
|
|
38942
|
+
const picked = this.printers.find((printer) => printer.id === eventDetails.id);
|
|
38943
|
+
this.selectedPrinter = picked !== null && picked !== void 0 ? picked : {
|
|
38944
|
+
id: eventDetails.id,
|
|
38945
|
+
name: eventDetails.title,
|
|
38946
|
+
location: '',
|
|
38947
|
+
is_queue: eventDetails.is_queue,
|
|
38948
|
+
};
|
|
38949
|
+
// Same guard as the initial load. Without it a failed fetch left the
|
|
38950
|
+
// printer selected while the config still described the *previous*
|
|
38951
|
+
// one: Print stayed enabled, the job went out with settings nothing
|
|
38952
|
+
// had checked against this printer, and those settings were then
|
|
38953
|
+
// saved under its id and restored on later opens.
|
|
38954
|
+
await this.loadSelectedPrinterConfig();
|
|
38652
38955
|
break;
|
|
38956
|
+
}
|
|
38653
38957
|
case 'color':
|
|
38654
38958
|
this.selectedProperties.color =
|
|
38655
38959
|
eventDetails.title == instance.t('printer_selection.color_color') ? true : false;
|
|
@@ -38714,6 +39018,55 @@ const EzpPrinterSelection = class {
|
|
|
38714
39018
|
onJobId: (jobId) => (printStore.state.jobID = jobId),
|
|
38715
39019
|
});
|
|
38716
39020
|
}
|
|
39021
|
+
/**
|
|
39022
|
+
* What a dropdown should show: the current selection — restored from the last
|
|
39023
|
+
* print, or just made by the user — and otherwise the printer's own default.
|
|
39024
|
+
*
|
|
39025
|
+
* The fallbacks matter because a config may describe its default only by name
|
|
39026
|
+
* (`Default.Duplex`, `Default.Paper`, `Default.Tray`) without flagging the
|
|
39027
|
+
* matching entry, which is all these dropdowns had to go on before settings
|
|
39028
|
+
* were remembered.
|
|
39029
|
+
*/
|
|
39030
|
+
duplexPreSelection() {
|
|
39031
|
+
var _a;
|
|
39032
|
+
if (!this.selectedPrinter.id)
|
|
39033
|
+
return null;
|
|
39034
|
+
const mode = Number(this.selectedProperties.duplexmode);
|
|
39035
|
+
if (mode)
|
|
39036
|
+
return mode;
|
|
39037
|
+
switch ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Duplex) {
|
|
39038
|
+
case 'duplex_simplex':
|
|
39039
|
+
return instance.t('printer_selection.duplex_none');
|
|
39040
|
+
case 'duplex_vertical':
|
|
39041
|
+
return instance.t('printer_selection.duplex_long');
|
|
39042
|
+
case 'duplex_horizontal':
|
|
39043
|
+
return instance.t('printer_selection.duplex_short');
|
|
39044
|
+
default:
|
|
39045
|
+
return null;
|
|
39046
|
+
}
|
|
39047
|
+
}
|
|
39048
|
+
paperPreSelection() {
|
|
39049
|
+
var _a, _b;
|
|
39050
|
+
if (!this.selectedPrinter.id)
|
|
39051
|
+
return null;
|
|
39052
|
+
if (this.selectedProperties.paper)
|
|
39053
|
+
return this.selectedProperties.paper;
|
|
39054
|
+
const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper;
|
|
39055
|
+
return name && ((_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.some((el) => el.Name.includes(name)))
|
|
39056
|
+
? name
|
|
39057
|
+
: null;
|
|
39058
|
+
}
|
|
39059
|
+
trayPreSelection() {
|
|
39060
|
+
var _a, _b;
|
|
39061
|
+
if (!this.selectedPrinter.id)
|
|
39062
|
+
return null;
|
|
39063
|
+
if (this.selectedProperties.trayname)
|
|
39064
|
+
return this.selectedProperties.trayname;
|
|
39065
|
+
const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Tray;
|
|
39066
|
+
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)))
|
|
39067
|
+
? name
|
|
39068
|
+
: null;
|
|
39069
|
+
}
|
|
38717
39070
|
setDefaultPaperFormat() {
|
|
38718
39071
|
var _a, _b, _c, _d, _e;
|
|
38719
39072
|
let format;
|
|
@@ -38782,46 +39135,105 @@ const EzpPrinterSelection = class {
|
|
|
38782
39135
|
this.unsubscribeLanguage = subscribeToLanguageChange(this);
|
|
38783
39136
|
this.printService = new EzpPrintService(this.redirectURI, this.clientID);
|
|
38784
39137
|
this.printService.registerFetchInterceptor();
|
|
38785
|
-
|
|
38786
|
-
|
|
38787
|
-
.
|
|
38788
|
-
|
|
38789
|
-
|
|
38790
|
-
|
|
39138
|
+
try {
|
|
39139
|
+
// A missing display name must not stop the user from printing.
|
|
39140
|
+
await this.getUserInfo().catch(() => undefined);
|
|
39141
|
+
let printersLoaded = false;
|
|
39142
|
+
try {
|
|
39143
|
+
const printers = await this.printService.getPrinterList(authStore.state.accessToken);
|
|
39144
|
+
// A failed request still resolves: the API answers with a `{code,
|
|
39145
|
+
// message}` body, which would survive `?? []` and break on `.some`.
|
|
39146
|
+
if (!Array.isArray(printers))
|
|
39147
|
+
throw new Error('Unexpected printer list payload');
|
|
39148
|
+
this.printers = printers;
|
|
39149
|
+
printersLoaded = true;
|
|
39150
|
+
}
|
|
39151
|
+
catch (_a) {
|
|
39152
|
+
this.printers = [];
|
|
39153
|
+
}
|
|
39154
|
+
if (!printersLoaded) {
|
|
39155
|
+
// Nothing is known about this user's printers, so the saved printer is
|
|
39156
|
+
// left untouched: treating it as gone would clear it from storage and
|
|
39157
|
+
// lose the settings that are only reachable through it.
|
|
38791
39158
|
this.noPrinters = true;
|
|
38792
39159
|
}
|
|
38793
|
-
|
|
38794
|
-
|
|
38795
|
-
|
|
38796
|
-
|
|
38797
|
-
|
|
38798
|
-
|
|
38799
|
-
|
|
38800
|
-
this.
|
|
38801
|
-
|
|
38802
|
-
|
|
39160
|
+
else {
|
|
39161
|
+
if (this.printers.length === 0) {
|
|
39162
|
+
this.noPrinters = true;
|
|
39163
|
+
}
|
|
39164
|
+
this.selectInitialPrinter();
|
|
39165
|
+
// A printer carried over from a previous print, or the only one the
|
|
39166
|
+
// user has, needs its config before its properties can be offered.
|
|
39167
|
+
if (this.selectedPrinter.id != '') {
|
|
39168
|
+
await this.loadSelectedPrinterConfig();
|
|
39169
|
+
}
|
|
39170
|
+
}
|
|
39171
|
+
let supportedExtensionsLoaded = false;
|
|
39172
|
+
try {
|
|
39173
|
+
const response = await (await this.printService.getConfig(authStore.state.accessToken)).json();
|
|
39174
|
+
printStore.state.supportedFileExtensions = response.System.FILEEXT;
|
|
39175
|
+
supportedExtensionsLoaded = true;
|
|
39176
|
+
}
|
|
39177
|
+
catch (_b) {
|
|
39178
|
+
// Handled below: without the list, nothing can be validated against it.
|
|
39179
|
+
}
|
|
39180
|
+
try {
|
|
39181
|
+
await this.printService
|
|
39182
|
+
.getAllPrinterProperties(authStore.state.accessToken)
|
|
39183
|
+
.then((printerConfig) => {
|
|
39184
|
+
this.printerConfig = printerConfig;
|
|
39185
|
+
});
|
|
39186
|
+
}
|
|
39187
|
+
catch (_c) {
|
|
39188
|
+
// Only used to describe other printers; the dialog works without it.
|
|
39189
|
+
}
|
|
39190
|
+
// Skipped when the list never arrived: every file would compare as
|
|
39191
|
+
// unsupported and the user would be told their document cannot be
|
|
39192
|
+
// printed when nothing is actually wrong with it.
|
|
39193
|
+
if (supportedExtensionsLoaded && this.files && this.files.length > 0) {
|
|
39194
|
+
// Validate all files
|
|
39195
|
+
const validationPromises = this.files.map((file) => this.validateFileType(file.name));
|
|
39196
|
+
const validationResults = await Promise.all(validationPromises);
|
|
39197
|
+
const allValid = validationResults.every((valid) => valid);
|
|
39198
|
+
this.notSupported = !allValid;
|
|
39199
|
+
}
|
|
39200
|
+
}
|
|
39201
|
+
finally {
|
|
39202
|
+
// Whatever failed above, the dialog has to become usable: the loading
|
|
39203
|
+
// status carries no close button, so throwing out of here would strand
|
|
39204
|
+
// the user on "Loading My Printers…" with no way back.
|
|
39205
|
+
this.loading = false;
|
|
39206
|
+
}
|
|
39207
|
+
}
|
|
39208
|
+
/**
|
|
39209
|
+
* Fetch the selected printer's capabilities and restore its saved settings.
|
|
39210
|
+
*
|
|
39211
|
+
* A failure drops the selection rather than keeping a printer the dialog
|
|
39212
|
+
* cannot describe: the options would stay disabled while Print stayed
|
|
39213
|
+
* enabled, so the job would go out with properties nothing has verified.
|
|
39214
|
+
* With no selection the user picks from the list, which fetches again.
|
|
39215
|
+
*/
|
|
39216
|
+
async loadSelectedPrinterConfig() {
|
|
39217
|
+
this.loadingPrinterConfig = true;
|
|
39218
|
+
try {
|
|
39219
|
+
const data = await this.printService.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id);
|
|
39220
|
+
// An empty list or an error body leaves nothing to configure from.
|
|
39221
|
+
const config = data === null || data === void 0 ? void 0 : data[0];
|
|
39222
|
+
if (!config)
|
|
39223
|
+
throw new Error('No properties returned for the selected printer');
|
|
39224
|
+
this.selectedPrinterConfig = config;
|
|
39225
|
+
applySavedProperties(config, storage.getPrinterSettings(this.selectedPrinter.id), this.selectedProperties);
|
|
39226
|
+
this.setPaperid();
|
|
38803
39227
|
if (this.selectedProperties.paper === '') {
|
|
38804
39228
|
this.setDefaultPaperFormat();
|
|
38805
39229
|
}
|
|
38806
39230
|
}
|
|
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;
|
|
39231
|
+
catch (_a) {
|
|
39232
|
+
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
39233
|
+
}
|
|
39234
|
+
finally {
|
|
39235
|
+
this.loadingPrinterConfig = false;
|
|
38823
39236
|
}
|
|
38824
|
-
this.loading = false;
|
|
38825
39237
|
}
|
|
38826
39238
|
disconnectedCallback() {
|
|
38827
39239
|
var _a;
|
|
@@ -38907,14 +39319,14 @@ const EzpPrinterSelection = class {
|
|
|
38907
39319
|
return null;
|
|
38908
39320
|
}
|
|
38909
39321
|
render() {
|
|
38910
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
39322
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
38911
39323
|
const fileNames = this.files && this.files.length > 0
|
|
38912
39324
|
? this.files.map((file) => file.name)
|
|
38913
39325
|
: this.filename
|
|
38914
39326
|
? [this.filename]
|
|
38915
39327
|
: [];
|
|
38916
39328
|
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-
|
|
39329
|
+
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-file-name", { name: name, placement: index === 0 ? '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
39330
|
? instance.t('printer_selection.select_printer')
|
|
38919
39331
|
: instance.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
38920
39332
|
id: printer.id,
|
|
@@ -38927,43 +39339,34 @@ const EzpPrinterSelection = class {
|
|
|
38927
39339
|
title: option.title,
|
|
38928
39340
|
meta: '',
|
|
38929
39341
|
type: 'color',
|
|
38930
|
-
})), preSelected: this.selectedPrinter.id
|
|
38931
|
-
?
|
|
38932
|
-
|
|
39342
|
+
})), preSelected: this.selectedPrinter.id
|
|
39343
|
+
? this.selectedProperties.color
|
|
39344
|
+
? instance.t('printer_selection.color_color')
|
|
39345
|
+
: instance.t('printer_selection.color_grayscale')
|
|
39346
|
+
: 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
39347
|
id: option.id,
|
|
38934
39348
|
title: option.title,
|
|
38935
39349
|
meta: '',
|
|
38936
39350
|
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 &&
|
|
39351
|
+
})), 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
39352
|
this.selectedPrinterConfig.PaperFormats.map((format) => ({
|
|
38946
39353
|
id: format.Id,
|
|
38947
39354
|
title: format.Name,
|
|
38948
39355
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
38949
39356
|
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) => ({
|
|
39357
|
+
})), 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
39358
|
id: index + 1,
|
|
38955
39359
|
title: instance.t(`printer_selection.orientation_${orientation}`),
|
|
38956
39360
|
meta: '',
|
|
38957
39361
|
type: 'orientation',
|
|
38958
|
-
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(((
|
|
39362
|
+
})), 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
39363
|
id: index,
|
|
38960
39364
|
title: option,
|
|
38961
39365
|
meta: '',
|
|
38962
39366
|
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 &&
|
|
39367
|
+
})), preSelected: this.selectedPrinter.id
|
|
39368
|
+
? this.selectedProperties.resolution || null
|
|
39369
|
+
: 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
39370
|
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
38968
39371
|
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
39372
|
? this.selectedPrinterConfig.Trays.map((trays) => ({
|
|
@@ -38972,10 +39375,7 @@ const EzpPrinterSelection = class {
|
|
|
38972
39375
|
meta: '',
|
|
38973
39376
|
type: 'tray',
|
|
38974
39377
|
}))
|
|
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 }))));
|
|
39378
|
+
: 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
39379
|
}
|
|
38980
39380
|
};
|
|
38981
39381
|
EzpPrinterSelection.style = ezpPrinterSelectionCss();
|
|
@@ -39325,7 +39725,7 @@ const EzpPrinting = class {
|
|
|
39325
39725
|
*
|
|
39326
39726
|
*/
|
|
39327
39727
|
render() {
|
|
39328
|
-
return (h(Host, { key: '
|
|
39728
|
+
return (h(Host, { key: '988a7acf819e139fe6d103b122bf9181e848be82', class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
39329
39729
|
? this.systemAppearance
|
|
39330
39730
|
: 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
39731
|
}
|
|
@@ -39561,7 +39961,7 @@ const EzpSelect = class {
|
|
|
39561
39961
|
this.disabled ? 'disabled' : '',
|
|
39562
39962
|
];
|
|
39563
39963
|
const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
|
|
39564
|
-
return (h(Host, { key: '
|
|
39964
|
+
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
39965
|
var _a, _b;
|
|
39566
39966
|
if (option.title !== '') {
|
|
39567
39967
|
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 +40031,9 @@ const EzpStatus = class {
|
|
|
39631
40031
|
return (
|
|
39632
40032
|
// Live region so screen readers announce status changes (loading,
|
|
39633
40033
|
// processing, success, error) as they render.
|
|
39634
|
-
h(Host, { key: '
|
|
40034
|
+
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
40035
|
? this.cancel
|
|
39636
|
-
: instance.t('button_actions.cancel') })), this.close && (h("ezp-text-button", { key: '
|
|
40036
|
+
: 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
40037
|
}
|
|
39638
40038
|
};
|
|
39639
40039
|
EzpStatus.style = ezpStatusCss();
|
|
@@ -39770,7 +40170,7 @@ const EzpStepper = class {
|
|
|
39770
40170
|
*
|
|
39771
40171
|
*/
|
|
39772
40172
|
render() {
|
|
39773
|
-
return (h(Host, { key: '
|
|
40173
|
+
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
40174
|
}
|
|
39775
40175
|
static get watchers() { return {
|
|
39776
40176
|
"value": [{
|
|
@@ -39827,12 +40227,12 @@ const EzpTextButton = class {
|
|
|
39827
40227
|
href: this.href,
|
|
39828
40228
|
target: this.blank ? '_blank' : '_self',
|
|
39829
40229
|
};
|
|
39830
|
-
return (h(Host, { key: '
|
|
40230
|
+
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
40231
|
}
|
|
39832
40232
|
};
|
|
39833
40233
|
EzpTextButton.style = ezpTextButtonCss();
|
|
39834
40234
|
|
|
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
|
|
40235
|
+
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}.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);position:relative}.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
40236
|
|
|
39837
40237
|
/** File formats advertised to the user as supported for printing. */
|
|
39838
40238
|
const SUPPORTED_FORMATS = ['PDF', 'DOCX', 'PNG', 'JPG', 'XLSX'];
|
|
@@ -39989,7 +40389,7 @@ const EzpUpload = class {
|
|
|
39989
40389
|
*/
|
|
39990
40390
|
render() {
|
|
39991
40391
|
const hasFiles = this.selectedFiles.length > 0;
|
|
39992
|
-
return (h(Host, { key: '
|
|
40392
|
+
return (h(Host, { key: 'f20f756ca7522ab7d27e5c9fff743db9ba26b101', class: { dragging: this.dragging } }, h("form", { key: 'abafb9a19d3dff7da26c8250ea94bbc7876cbc3a', id: "form", ref: (form) => (this.form = form) }, h("input", { key: '09397ebf4641190fdd1af13af537cde9f87257d2', type: "file", name: "input", id: "input", multiple: true, "aria-label": instance.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), h("div", { key: '0365f750bc55d98a95008bcf404f77b247480d81', id: "modal" }, h("div", { key: '82d8d8ff21977d36a3f18c704002d1a8cdad9016', id: "body-frame" }, h("div", { key: 'ef05d508f0341f92d5e987deb469b2759ee28f1b', id: "body" }, !hasFiles && (h("div", { key: '7885aad8082bedf42ef824ad06a388ed3a083987', id: "dropzone" }, h("ezp-icon", { key: '25707aa1f7018c7942ca5c82a35c4a74f73f5e70', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '2dfb59ce766671396164fcd63d25ef9b04981d01', id: "dropzone-title", level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') }), h("div", { key: 'b831d79aab06973e47666e129e89ba23d3e8a3a4', id: "dropzone-prompt" }, h("ezp-text-button", { key: '2ade7d526019a71b493e00e6737ca13769cccd29', id: "choose", type: "button", onClick: this.openPicker, label: instance.t('upload.choose_files') }), h("ezp-label", { key: '79903c44e2a82b39c97606aa1ccbe9cb28a42c48', id: "drag-hint", level: "secondary", weight: "strong", text: instance.t('upload.drag_hint') }), h("ezp-label", { key: '895d43cada83fade39b8d67e70782b9b9fea747c', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '6c825ac2791e82271669a7824ed720b127290242', id: "files" }, this.selectedFiles.map((file, index) => (h("div", { key: this.fileKey(file), class: "file" }, h("span", { class: "file-type", "aria-hidden": "true" }, this.fileType(file.name)), h("div", { class: "file-details" }, h("ezp-file-name", { class: "file-name", weight: "heavy", name: file.name, placement: index === 0 ? 'bottom' : 'top' }), h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), h("button", { type: "button", class: "file-remove", "aria-label": instance.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index) }, h("ezp-icon", { name: "close" }))))), h("button", { key: 'da8562e56c4006952efa239e8076f333ae27b1be', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: '6b2565bb3a9d4eca02079923ffdee36d5184d10f', name: "plus" }), h("ezp-label", { key: '59ecc6b13ca9fa66b8f04944c57ba680e3bab0f8', level: "secondary", weight: "heavy", text: instance.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: '26e2552f69637448b3663f9342c421ec29abcca8', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: '0f409daf2c6fc5f3f103f4d4450970aea7edb0c7', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '1e19c3e44aac998ad35671435cfe96a27633b170', level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') })))), h("div", { key: '31d0106aea747008bf2c2760e4cd8ab0e637144b', id: "footer" }, h("ezp-text-button", { key: '24c6c9f25de785443402ac3aa08975c58779faea', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: instance.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: 'cd0fb877a2a7a756cfbe6aa2fdbacaedbe4c8efb', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: instance.t('upload.continue'), class: "action" }))))));
|
|
39993
40393
|
}
|
|
39994
40394
|
};
|
|
39995
40395
|
EzpUpload.style = ezpUploadCss();
|
|
@@ -40079,7 +40479,7 @@ const EzpUserMenu = class {
|
|
|
40079
40479
|
*
|
|
40080
40480
|
*/
|
|
40081
40481
|
render() {
|
|
40082
|
-
return (h(Host, { key: '
|
|
40482
|
+
return (h(Host, { key: 'cd2505f64646e8f23d534896c01fcd246d974c2f', class: this.open ? 'is-open' : '' }, h("div", { key: '65df837d1eee8b2275f8c0ef72b039c7ae6d08cd', id: "header" }, h("ezp-label", { key: '3ca9bc9d616de1e4efc686f77bcdaa39dab3f18d', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '119abe7450937b7cf2e70ff3ed96d01f3f0aff9d', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '90f40d22672bc65cbf988cf2ab57cbc088218cfd', id: "links" }, this.links.map((link) => (h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, h("ezp-icon", { class: "link__icon", name: link.icon }), h("ezp-label", { text: link.title })))), h("a", { key: '94df9033da5697739c690a180ed2df318f803511', class: "link", onClick: this.logOut }, h("ezp-icon", { key: '609044f6d8255e4378aee226e16c29e9242c8259', class: "link__icon", name: "logout" }), h("ezp-label", { key: '20953a49845a8c4e75081c597d8e916c3b159b51', text: instance.t('user_menu.logout') }))), h("div", { key: '4b96f92ceb1047c4a88f0b33406a297323eded75', id: "theme" }, h("ezp-label", { key: '156893ed3703f63ee826e4887fa711469603b6c8', class: "caption", text: `${instance.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '2ee3ec8725a98d5dc7d7f792fed969c2dea357f4', id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, h("span", { class: "dot" })))))), h("div", { key: 'd78d2b935d9cdb15df66d761dd9290a68db09e9c', id: "appearance" }, h("ezp-label", { key: 'f290affaf49bd01a06f576a4d52b3d1936dbdb23', class: "caption", text: `${instance.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: '8087488313dbd2898280d3abb6244485b97e4ee4', id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, h("ezp-icon", { name: appearance.name }), h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
|
|
40083
40483
|
}
|
|
40084
40484
|
get component() { return getElement(this); }
|
|
40085
40485
|
static get watchers() { return {
|
|
@@ -40090,4 +40490,4 @@ const EzpUserMenu = class {
|
|
|
40090
40490
|
};
|
|
40091
40491
|
EzpUserMenu.style = ezpUserMenuCss();
|
|
40092
40492
|
|
|
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 };
|
|
40493
|
+
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 };
|