@ezeep/ezeep-js 1.0.247 → 1.0.249
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 +80 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +1 -1
- package/dist/collection/components/ezp-printing/ezp-printing.js +27 -0
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +71 -5
- package/dist/custom-elements/index.js +80 -6
- package/dist/directives/proxies.ts +1 -1
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +80 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-51613df0.entry.js → p-2562e9cb.entry.js} +1 -1
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/ezeep/{p-8895ff9b.system.entry.js → p-aebf439e.system.entry.js} +3 -3
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -0
- package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +3 -0
- package/dist/types/components.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +41 -0
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-51613df0.entry.js → p-2562e9cb.entry.js} +1 -1
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/build/{p-8895ff9b.system.entry.js → p-aebf439e.system.entry.js} +3 -3
- package/dist/types/shared/types.d.ts +0 -140
package/dist/cjs/ezeep.cjs.js
CHANGED
|
@@ -17,5 +17,5 @@ const patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
19
|
appGlobals.globalScripts();
|
|
20
|
-
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
21
21
|
});
|
|
@@ -33607,7 +33607,7 @@ let EzpPrinterSelection = class {
|
|
|
33607
33607
|
})), preSelected: this.selectedPrinter.id &&
|
|
33608
33608
|
((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
|
|
33609
33609
|
? this.selectedPrinterConfig.Default.Tray
|
|
33610
|
-
: null })) : null, index.h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), index.h("ezp-stepper", { label: i18next.t('printer_selection.copies'),
|
|
33610
|
+
: null })) : null, index.h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), index.h("ezp-stepper", { label: i18next.t('printer_selection.copies'), icon: "copies" })), index.h("div", { id: "footer" }, index.h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), index.h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })), !this.hidemenu && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
33611
33611
|
}
|
|
33612
33612
|
};
|
|
33613
33613
|
EzpPrinterSelection.style = ezpPrinterSelectionCss;
|
|
@@ -33780,6 +33780,14 @@ let EzpPrinting = class {
|
|
|
33780
33780
|
this.auth.buildAuthURI();
|
|
33781
33781
|
return authStore.state.authUri;
|
|
33782
33782
|
}
|
|
33783
|
+
async setAuthRefreshToken(refreshToken) {
|
|
33784
|
+
// Store the refresh token in the same way as the component does in self-managed auth
|
|
33785
|
+
authStore.state.refreshToken = refreshToken;
|
|
33786
|
+
localStorage.setItem('refreshToken', refreshToken);
|
|
33787
|
+
// Mark as authorized since we have a valid refresh token
|
|
33788
|
+
authStore.state.isAuthorized = true;
|
|
33789
|
+
localStorage.setItem('isAuthorized', 'true');
|
|
33790
|
+
}
|
|
33783
33791
|
async checkAuth() {
|
|
33784
33792
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
33785
33793
|
let accessToken = authStore.state.accessToken;
|
|
@@ -34097,13 +34105,54 @@ let EzpStepper = class {
|
|
|
34097
34105
|
*
|
|
34098
34106
|
*/
|
|
34099
34107
|
this.handleDecrease = () => {
|
|
34100
|
-
this.value
|
|
34108
|
+
const newValue = this.value - 1;
|
|
34109
|
+
// Only decrease if within safe range and above minimum
|
|
34110
|
+
if (newValue >= Number.MIN_SAFE_INTEGER && (this.min === undefined || newValue >= this.min)) {
|
|
34111
|
+
this.value = newValue;
|
|
34112
|
+
}
|
|
34101
34113
|
};
|
|
34102
34114
|
this.handleIncrease = () => {
|
|
34103
|
-
this.value
|
|
34115
|
+
const newValue = this.value + 1;
|
|
34116
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34117
|
+
// Only increase if within safe range and below maximum
|
|
34118
|
+
if (newValue <= Number.MAX_SAFE_INTEGER && newValue <= effectiveMax) {
|
|
34119
|
+
this.value = newValue;
|
|
34120
|
+
}
|
|
34104
34121
|
};
|
|
34105
34122
|
this.handleInput = () => {
|
|
34106
|
-
|
|
34123
|
+
if (!this.input)
|
|
34124
|
+
return;
|
|
34125
|
+
let inputString = this.input.value.trim();
|
|
34126
|
+
// If the input is empty, set the value to the minimum
|
|
34127
|
+
if (inputString === '') {
|
|
34128
|
+
this.value = this.min;
|
|
34129
|
+
this.input.value = this.value.toString();
|
|
34130
|
+
return;
|
|
34131
|
+
}
|
|
34132
|
+
// Remove all non-digit characters, keep only numbers
|
|
34133
|
+
const cleanedInput = inputString.replace(/\D/g, '');
|
|
34134
|
+
// If nothing remains after cleaning, revert to the last valid value
|
|
34135
|
+
if (cleanedInput === '') {
|
|
34136
|
+
this.input.value = this.value.toString();
|
|
34137
|
+
return;
|
|
34138
|
+
}
|
|
34139
|
+
// Limit input length to prevent precision loss (MAX_SAFE_INTEGER has 16 digits)
|
|
34140
|
+
const maxDigits = Number.MAX_SAFE_INTEGER.toString().length;
|
|
34141
|
+
const truncatedInput = cleanedInput.slice(0, maxDigits);
|
|
34142
|
+
let inputValue = Number(truncatedInput);
|
|
34143
|
+
// Safety check: ensure the number is within safe integer range
|
|
34144
|
+
if (inputValue > Number.MAX_SAFE_INTEGER) {
|
|
34145
|
+
inputValue = Number.MAX_SAFE_INTEGER;
|
|
34146
|
+
}
|
|
34147
|
+
// Ensure the value is between min and max
|
|
34148
|
+
if (this.min !== undefined && inputValue < this.min)
|
|
34149
|
+
inputValue = this.min;
|
|
34150
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34151
|
+
if (inputValue > effectiveMax)
|
|
34152
|
+
inputValue = effectiveMax;
|
|
34153
|
+
// Update component state and input field
|
|
34154
|
+
this.value = inputValue;
|
|
34155
|
+
this.input.value = inputValue.toString();
|
|
34107
34156
|
};
|
|
34108
34157
|
this.setFocus = () => {
|
|
34109
34158
|
this.input.focus();
|
|
@@ -34114,6 +34163,18 @@ let EzpStepper = class {
|
|
|
34114
34163
|
this.handleFocus = () => {
|
|
34115
34164
|
this.focused = true;
|
|
34116
34165
|
};
|
|
34166
|
+
this.handleKeyDown = (event) => {
|
|
34167
|
+
// If key is allowed or a Ctrl/Cmd combination, do nothing
|
|
34168
|
+
if (EzpStepper.ALLOWED_KEYS.includes(event.key) ||
|
|
34169
|
+
((event.ctrlKey || event.metaKey) && EzpStepper.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
|
|
34170
|
+
return;
|
|
34171
|
+
}
|
|
34172
|
+
// If the key is not a digit, prevent default behavior (block input)
|
|
34173
|
+
const isDigit = /^\d$/.test(event.key);
|
|
34174
|
+
if (!isDigit) {
|
|
34175
|
+
event.preventDefault();
|
|
34176
|
+
}
|
|
34177
|
+
};
|
|
34117
34178
|
}
|
|
34118
34179
|
/**
|
|
34119
34180
|
*
|
|
@@ -34121,7 +34182,8 @@ let EzpStepper = class {
|
|
|
34121
34182
|
*
|
|
34122
34183
|
*/
|
|
34123
34184
|
watchValue() {
|
|
34124
|
-
|
|
34185
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34186
|
+
this.canIncrease = this.value < effectiveMax;
|
|
34125
34187
|
this.canDecrease = this.min !== undefined ? this.value > this.min : true;
|
|
34126
34188
|
this.stepperChanged.emit(this.value);
|
|
34127
34189
|
}
|
|
@@ -34139,12 +34201,24 @@ let EzpStepper = class {
|
|
|
34139
34201
|
*
|
|
34140
34202
|
*/
|
|
34141
34203
|
render() {
|
|
34142
|
-
return (index.h(index.Host, { class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, index.h("div", { id: "toggle", onClick: this.setFocus }), this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { id: "label", noWrap: true, text: this.label }), index.h("input", { id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max.toString(), value: this.value.toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur }), index.h("div", { class: "buttons" }, index.h("button", { class: "button", disabled: !this.canDecrease, onClick: this.handleDecrease }, index.h("ezp-icon", { name: "minus" })), index.h("button", { class: "button", disabled: !this.canIncrease, onClick: this.handleIncrease }, index.h("ezp-icon", { name: "plus" })))));
|
|
34204
|
+
return (index.h(index.Host, { class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, index.h("div", { id: "toggle", onClick: this.setFocus }), this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { id: "label", noWrap: true, text: this.label }), index.h("input", { 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(), onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), index.h("div", { class: "buttons" }, index.h("button", { class: "button", disabled: !this.canDecrease, onClick: this.handleDecrease }, index.h("ezp-icon", { name: "minus" })), index.h("button", { class: "button", disabled: !this.canIncrease, onClick: this.handleIncrease }, index.h("ezp-icon", { name: "plus" })))));
|
|
34143
34205
|
}
|
|
34144
34206
|
static get watchers() { return {
|
|
34145
34207
|
"value": ["watchValue"]
|
|
34146
34208
|
}; }
|
|
34147
34209
|
};
|
|
34210
|
+
EzpStepper.ALLOWED_KEYS = [
|
|
34211
|
+
'Backspace',
|
|
34212
|
+
'Delete',
|
|
34213
|
+
'Tab',
|
|
34214
|
+
'Escape',
|
|
34215
|
+
'Enter',
|
|
34216
|
+
'ArrowLeft',
|
|
34217
|
+
'ArrowUp',
|
|
34218
|
+
'ArrowRight',
|
|
34219
|
+
'ArrowDown',
|
|
34220
|
+
];
|
|
34221
|
+
EzpStepper.CTRL_CMD_KEYS = ['a', 'c', 'v', 'x'];
|
|
34148
34222
|
EzpStepper.style = ezpStepperCss;
|
|
34149
34223
|
|
|
34150
34224
|
const ezpTextButtonCss = ":host{display:-ms-flexbox;display:flex}:host(.primary){--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-init:var(--ezp-theme-solid);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-white-100);--ezp-textButton-opacity-active:0.74;--ezp-textButton-opacity-hover:0.84}:host(.secondary){--ezp-textButton-background-active:var(--ezp-core-shade-tertiary);--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-hover:var(--ezp-core-shade-secondary);--ezp-textButton-background-init:var(--ezp-core-shade-primary);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-disabled:transparent;--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-textButton-background, var(--ezp-textButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-textButton-color, var(--ezp-textButton-color-init));cursor:var(--ezp-textButton-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-textButton-opacity, 1);outline:none;padding:var(--ezp-spacing-3);white-space:nowrap;width:100%}@media (hover: hover){#button:not(:disabled):hover{--ezp-textButton-background:var(\n --ezp-textButton-background-hover,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-textButton-background:var(\n --ezp-textButton-background-active,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-active, 1)}}#button:disabled{--ezp-textButton-background:var(--ezp-textButton-background-disabled);--ezp-textButton-color:var(--ezp-textButton-color-disabled);--ezp-textButton-cursor:default}#label{pointer-events:none}";
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
|
|
|
16
16
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
17
17
|
return patchEsm().then(() => {
|
|
18
18
|
appGlobals.globalScripts();
|
|
19
|
-
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
19
|
+
return index.bootstrapLazy([["ezp-auth_15.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -862,7 +862,7 @@ export class EzpPrinterSelection {
|
|
|
862
862
|
? this.selectedPrinterConfig.Default.Tray
|
|
863
863
|
: null })) : null,
|
|
864
864
|
h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })),
|
|
865
|
-
h("ezp-stepper", { label: i18next.t('printer_selection.copies'),
|
|
865
|
+
h("ezp-stepper", { label: i18next.t('printer_selection.copies'), icon: "copies" })),
|
|
866
866
|
h("div", { id: "footer" },
|
|
867
867
|
h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }),
|
|
868
868
|
h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })),
|
|
@@ -162,6 +162,14 @@ export class EzpPrinting {
|
|
|
162
162
|
this.auth.buildAuthURI();
|
|
163
163
|
return authStore.state.authUri;
|
|
164
164
|
}
|
|
165
|
+
async setAuthRefreshToken(refreshToken) {
|
|
166
|
+
// Store the refresh token in the same way as the component does in self-managed auth
|
|
167
|
+
authStore.state.refreshToken = refreshToken;
|
|
168
|
+
localStorage.setItem('refreshToken', refreshToken);
|
|
169
|
+
// Mark as authorized since we have a valid refresh token
|
|
170
|
+
authStore.state.isAuthorized = true;
|
|
171
|
+
localStorage.setItem('isAuthorized', 'true');
|
|
172
|
+
}
|
|
165
173
|
async checkAuth() {
|
|
166
174
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
167
175
|
let accessToken = authStore.state.accessToken;
|
|
@@ -680,6 +688,25 @@ export class EzpPrinting {
|
|
|
680
688
|
"tags": []
|
|
681
689
|
}
|
|
682
690
|
},
|
|
691
|
+
"setAuthRefreshToken": {
|
|
692
|
+
"complexType": {
|
|
693
|
+
"signature": "(refreshToken: string) => Promise<void>",
|
|
694
|
+
"parameters": [{
|
|
695
|
+
"tags": [],
|
|
696
|
+
"text": ""
|
|
697
|
+
}],
|
|
698
|
+
"references": {
|
|
699
|
+
"Promise": {
|
|
700
|
+
"location": "global"
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
"return": "Promise<void>"
|
|
704
|
+
},
|
|
705
|
+
"docs": {
|
|
706
|
+
"text": "",
|
|
707
|
+
"tags": []
|
|
708
|
+
}
|
|
709
|
+
},
|
|
683
710
|
"checkAuth": {
|
|
684
711
|
"complexType": {
|
|
685
712
|
"signature": "() => Promise<boolean>",
|
|
@@ -24,13 +24,54 @@ export class EzpStepper {
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
this.handleDecrease = () => {
|
|
27
|
-
this.value
|
|
27
|
+
const newValue = this.value - 1;
|
|
28
|
+
// Only decrease if within safe range and above minimum
|
|
29
|
+
if (newValue >= Number.MIN_SAFE_INTEGER && (this.min === undefined || newValue >= this.min)) {
|
|
30
|
+
this.value = newValue;
|
|
31
|
+
}
|
|
28
32
|
};
|
|
29
33
|
this.handleIncrease = () => {
|
|
30
|
-
this.value
|
|
34
|
+
const newValue = this.value + 1;
|
|
35
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
36
|
+
// Only increase if within safe range and below maximum
|
|
37
|
+
if (newValue <= Number.MAX_SAFE_INTEGER && newValue <= effectiveMax) {
|
|
38
|
+
this.value = newValue;
|
|
39
|
+
}
|
|
31
40
|
};
|
|
32
41
|
this.handleInput = () => {
|
|
33
|
-
|
|
42
|
+
if (!this.input)
|
|
43
|
+
return;
|
|
44
|
+
let inputString = this.input.value.trim();
|
|
45
|
+
// If the input is empty, set the value to the minimum
|
|
46
|
+
if (inputString === '') {
|
|
47
|
+
this.value = this.min;
|
|
48
|
+
this.input.value = this.value.toString();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// Remove all non-digit characters, keep only numbers
|
|
52
|
+
const cleanedInput = inputString.replace(/\D/g, '');
|
|
53
|
+
// If nothing remains after cleaning, revert to the last valid value
|
|
54
|
+
if (cleanedInput === '') {
|
|
55
|
+
this.input.value = this.value.toString();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
// Limit input length to prevent precision loss (MAX_SAFE_INTEGER has 16 digits)
|
|
59
|
+
const maxDigits = Number.MAX_SAFE_INTEGER.toString().length;
|
|
60
|
+
const truncatedInput = cleanedInput.slice(0, maxDigits);
|
|
61
|
+
let inputValue = Number(truncatedInput);
|
|
62
|
+
// Safety check: ensure the number is within safe integer range
|
|
63
|
+
if (inputValue > Number.MAX_SAFE_INTEGER) {
|
|
64
|
+
inputValue = Number.MAX_SAFE_INTEGER;
|
|
65
|
+
}
|
|
66
|
+
// Ensure the value is between min and max
|
|
67
|
+
if (this.min !== undefined && inputValue < this.min)
|
|
68
|
+
inputValue = this.min;
|
|
69
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
70
|
+
if (inputValue > effectiveMax)
|
|
71
|
+
inputValue = effectiveMax;
|
|
72
|
+
// Update component state and input field
|
|
73
|
+
this.value = inputValue;
|
|
74
|
+
this.input.value = inputValue.toString();
|
|
34
75
|
};
|
|
35
76
|
this.setFocus = () => {
|
|
36
77
|
this.input.focus();
|
|
@@ -41,6 +82,18 @@ export class EzpStepper {
|
|
|
41
82
|
this.handleFocus = () => {
|
|
42
83
|
this.focused = true;
|
|
43
84
|
};
|
|
85
|
+
this.handleKeyDown = (event) => {
|
|
86
|
+
// If key is allowed or a Ctrl/Cmd combination, do nothing
|
|
87
|
+
if (EzpStepper.ALLOWED_KEYS.includes(event.key) ||
|
|
88
|
+
((event.ctrlKey || event.metaKey) && EzpStepper.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// If the key is not a digit, prevent default behavior (block input)
|
|
92
|
+
const isDigit = /^\d$/.test(event.key);
|
|
93
|
+
if (!isDigit) {
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
44
97
|
}
|
|
45
98
|
/**
|
|
46
99
|
*
|
|
@@ -48,7 +101,8 @@ export class EzpStepper {
|
|
|
48
101
|
*
|
|
49
102
|
*/
|
|
50
103
|
watchValue() {
|
|
51
|
-
|
|
104
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
105
|
+
this.canIncrease = this.value < effectiveMax;
|
|
52
106
|
this.canDecrease = this.min !== undefined ? this.value > this.min : true;
|
|
53
107
|
this.stepperChanged.emit(this.value);
|
|
54
108
|
}
|
|
@@ -70,7 +124,7 @@ export class EzpStepper {
|
|
|
70
124
|
h("div", { id: "toggle", onClick: this.setFocus }),
|
|
71
125
|
this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null,
|
|
72
126
|
h("ezp-label", { id: "label", noWrap: true, text: this.label }),
|
|
73
|
-
h("input", { id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max.toString(), value: this.value.toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur }),
|
|
127
|
+
h("input", { 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(), onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }),
|
|
74
128
|
h("div", { class: "buttons" },
|
|
75
129
|
h("button", { class: "button", disabled: !this.canDecrease, onClick: this.handleDecrease },
|
|
76
130
|
h("ezp-icon", { name: "minus" })),
|
|
@@ -189,3 +243,15 @@ export class EzpStepper {
|
|
|
189
243
|
"methodName": "watchValue"
|
|
190
244
|
}]; }
|
|
191
245
|
}
|
|
246
|
+
EzpStepper.ALLOWED_KEYS = [
|
|
247
|
+
'Backspace',
|
|
248
|
+
'Delete',
|
|
249
|
+
'Tab',
|
|
250
|
+
'Escape',
|
|
251
|
+
'Enter',
|
|
252
|
+
'ArrowLeft',
|
|
253
|
+
'ArrowUp',
|
|
254
|
+
'ArrowRight',
|
|
255
|
+
'ArrowDown',
|
|
256
|
+
];
|
|
257
|
+
EzpStepper.CTRL_CMD_KEYS = ['a', 'c', 'v', 'x'];
|
|
@@ -33632,7 +33632,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33632
33632
|
})), preSelected: this.selectedPrinter.id &&
|
|
33633
33633
|
((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
|
|
33634
33634
|
? this.selectedPrinterConfig.Default.Tray
|
|
33635
|
-
: null })) : null, h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), h("ezp-stepper", { label: i18next.t('printer_selection.copies'),
|
|
33635
|
+
: null })) : null, h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), h("ezp-stepper", { label: i18next.t('printer_selection.copies'), icon: "copies" })), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
33636
33636
|
}
|
|
33637
33637
|
static get style() { return ezpPrinterSelectionCss; }
|
|
33638
33638
|
};
|
|
@@ -33807,6 +33807,14 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33807
33807
|
this.auth.buildAuthURI();
|
|
33808
33808
|
return authStore.state.authUri;
|
|
33809
33809
|
}
|
|
33810
|
+
async setAuthRefreshToken(refreshToken) {
|
|
33811
|
+
// Store the refresh token in the same way as the component does in self-managed auth
|
|
33812
|
+
authStore.state.refreshToken = refreshToken;
|
|
33813
|
+
localStorage.setItem('refreshToken', refreshToken);
|
|
33814
|
+
// Mark as authorized since we have a valid refresh token
|
|
33815
|
+
authStore.state.isAuthorized = true;
|
|
33816
|
+
localStorage.setItem('isAuthorized', 'true');
|
|
33817
|
+
}
|
|
33810
33818
|
async checkAuth() {
|
|
33811
33819
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
33812
33820
|
let accessToken = authStore.state.accessToken;
|
|
@@ -34130,13 +34138,54 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34130
34138
|
*
|
|
34131
34139
|
*/
|
|
34132
34140
|
this.handleDecrease = () => {
|
|
34133
|
-
this.value
|
|
34141
|
+
const newValue = this.value - 1;
|
|
34142
|
+
// Only decrease if within safe range and above minimum
|
|
34143
|
+
if (newValue >= Number.MIN_SAFE_INTEGER && (this.min === undefined || newValue >= this.min)) {
|
|
34144
|
+
this.value = newValue;
|
|
34145
|
+
}
|
|
34134
34146
|
};
|
|
34135
34147
|
this.handleIncrease = () => {
|
|
34136
|
-
this.value
|
|
34148
|
+
const newValue = this.value + 1;
|
|
34149
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34150
|
+
// Only increase if within safe range and below maximum
|
|
34151
|
+
if (newValue <= Number.MAX_SAFE_INTEGER && newValue <= effectiveMax) {
|
|
34152
|
+
this.value = newValue;
|
|
34153
|
+
}
|
|
34137
34154
|
};
|
|
34138
34155
|
this.handleInput = () => {
|
|
34139
|
-
|
|
34156
|
+
if (!this.input)
|
|
34157
|
+
return;
|
|
34158
|
+
let inputString = this.input.value.trim();
|
|
34159
|
+
// If the input is empty, set the value to the minimum
|
|
34160
|
+
if (inputString === '') {
|
|
34161
|
+
this.value = this.min;
|
|
34162
|
+
this.input.value = this.value.toString();
|
|
34163
|
+
return;
|
|
34164
|
+
}
|
|
34165
|
+
// Remove all non-digit characters, keep only numbers
|
|
34166
|
+
const cleanedInput = inputString.replace(/\D/g, '');
|
|
34167
|
+
// If nothing remains after cleaning, revert to the last valid value
|
|
34168
|
+
if (cleanedInput === '') {
|
|
34169
|
+
this.input.value = this.value.toString();
|
|
34170
|
+
return;
|
|
34171
|
+
}
|
|
34172
|
+
// Limit input length to prevent precision loss (MAX_SAFE_INTEGER has 16 digits)
|
|
34173
|
+
const maxDigits = Number.MAX_SAFE_INTEGER.toString().length;
|
|
34174
|
+
const truncatedInput = cleanedInput.slice(0, maxDigits);
|
|
34175
|
+
let inputValue = Number(truncatedInput);
|
|
34176
|
+
// Safety check: ensure the number is within safe integer range
|
|
34177
|
+
if (inputValue > Number.MAX_SAFE_INTEGER) {
|
|
34178
|
+
inputValue = Number.MAX_SAFE_INTEGER;
|
|
34179
|
+
}
|
|
34180
|
+
// Ensure the value is between min and max
|
|
34181
|
+
if (this.min !== undefined && inputValue < this.min)
|
|
34182
|
+
inputValue = this.min;
|
|
34183
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34184
|
+
if (inputValue > effectiveMax)
|
|
34185
|
+
inputValue = effectiveMax;
|
|
34186
|
+
// Update component state and input field
|
|
34187
|
+
this.value = inputValue;
|
|
34188
|
+
this.input.value = inputValue.toString();
|
|
34140
34189
|
};
|
|
34141
34190
|
this.setFocus = () => {
|
|
34142
34191
|
this.input.focus();
|
|
@@ -34147,6 +34196,18 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34147
34196
|
this.handleFocus = () => {
|
|
34148
34197
|
this.focused = true;
|
|
34149
34198
|
};
|
|
34199
|
+
this.handleKeyDown = (event) => {
|
|
34200
|
+
// If key is allowed or a Ctrl/Cmd combination, do nothing
|
|
34201
|
+
if (EzpStepper$1.ALLOWED_KEYS.includes(event.key) ||
|
|
34202
|
+
((event.ctrlKey || event.metaKey) && EzpStepper$1.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
|
|
34203
|
+
return;
|
|
34204
|
+
}
|
|
34205
|
+
// If the key is not a digit, prevent default behavior (block input)
|
|
34206
|
+
const isDigit = /^\d$/.test(event.key);
|
|
34207
|
+
if (!isDigit) {
|
|
34208
|
+
event.preventDefault();
|
|
34209
|
+
}
|
|
34210
|
+
};
|
|
34150
34211
|
}
|
|
34151
34212
|
/**
|
|
34152
34213
|
*
|
|
@@ -34154,7 +34215,8 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34154
34215
|
*
|
|
34155
34216
|
*/
|
|
34156
34217
|
watchValue() {
|
|
34157
|
-
|
|
34218
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34219
|
+
this.canIncrease = this.value < effectiveMax;
|
|
34158
34220
|
this.canDecrease = this.min !== undefined ? this.value > this.min : true;
|
|
34159
34221
|
this.stepperChanged.emit(this.value);
|
|
34160
34222
|
}
|
|
@@ -34172,13 +34234,25 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34172
34234
|
*
|
|
34173
34235
|
*/
|
|
34174
34236
|
render() {
|
|
34175
|
-
return (h(Host, { class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, text: this.label }), h("input", { id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max.toString(), value: this.value.toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur }), h("div", { class: "buttons" }, h("button", { class: "button", disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { name: "minus" })), h("button", { class: "button", disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { name: "plus" })))));
|
|
34237
|
+
return (h(Host, { class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, text: this.label }), h("input", { 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(), onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), h("div", { class: "buttons" }, h("button", { class: "button", disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { name: "minus" })), h("button", { class: "button", disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { name: "plus" })))));
|
|
34176
34238
|
}
|
|
34177
34239
|
static get watchers() { return {
|
|
34178
34240
|
"value": ["watchValue"]
|
|
34179
34241
|
}; }
|
|
34180
34242
|
static get style() { return ezpStepperCss; }
|
|
34181
34243
|
};
|
|
34244
|
+
EzpStepper$1.ALLOWED_KEYS = [
|
|
34245
|
+
'Backspace',
|
|
34246
|
+
'Delete',
|
|
34247
|
+
'Tab',
|
|
34248
|
+
'Escape',
|
|
34249
|
+
'Enter',
|
|
34250
|
+
'ArrowLeft',
|
|
34251
|
+
'ArrowUp',
|
|
34252
|
+
'ArrowRight',
|
|
34253
|
+
'ArrowDown',
|
|
34254
|
+
];
|
|
34255
|
+
EzpStepper$1.CTRL_CMD_KEYS = ['a', 'c', 'v', 'x'];
|
|
34182
34256
|
|
|
34183
34257
|
const ezpTextButtonCss = ":host{display:-ms-flexbox;display:flex}:host(.primary){--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-init:var(--ezp-theme-solid);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-white-100);--ezp-textButton-opacity-active:0.74;--ezp-textButton-opacity-hover:0.84}:host(.secondary){--ezp-textButton-background-active:var(--ezp-core-shade-tertiary);--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-hover:var(--ezp-core-shade-secondary);--ezp-textButton-background-init:var(--ezp-core-shade-primary);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-disabled:transparent;--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-textButton-background, var(--ezp-textButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-textButton-color, var(--ezp-textButton-color-init));cursor:var(--ezp-textButton-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-textButton-opacity, 1);outline:none;padding:var(--ezp-spacing-3);white-space:nowrap;width:100%}@media (hover: hover){#button:not(:disabled):hover{--ezp-textButton-background:var(\n --ezp-textButton-background-hover,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-textButton-background:var(\n --ezp-textButton-background-active,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-active, 1)}}#button:disabled{--ezp-textButton-background:var(--ezp-textButton-background-disabled);--ezp-textButton-color:var(--ezp-textButton-color-disabled);--ezp-textButton-cursor:default}#label{pointer-events:none}";
|
|
34184
34258
|
|
|
@@ -195,7 +195,7 @@ export class EzpPrinterSelection {
|
|
|
195
195
|
export declare interface EzpPrinting extends Components.EzpPrinting {}
|
|
196
196
|
@ProxyCmp({
|
|
197
197
|
inputs: ['appearance', 'authapihosturl', 'clientid', 'code', 'custom', 'filedata', 'fileid', 'filename', 'filetype', 'fileurl', 'hideheader', 'hidelogin', 'hidemenu', 'language', 'printapihosturl', 'redirecturi', 'seamless', 'theme', 'trigger'],
|
|
198
|
-
methods: ['open', 'logOut', 'getSasUri', 'getAuthUri', 'checkAuth']
|
|
198
|
+
methods: ['open', 'logOut', 'getSasUri', 'getAuthUri', 'setAuthRefreshToken', 'checkAuth']
|
|
199
199
|
})
|
|
200
200
|
@Component({
|
|
201
201
|
selector: 'ezp-printing',
|
package/dist/esm/ezeep.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
|
|
16
16
|
patchBrowser().then(options => {
|
|
17
17
|
globalScripts();
|
|
18
|
-
return bootstrapLazy([["ezp-auth_15",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
18
|
+
return bootstrapLazy([["ezp-auth_15",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
19
19
|
});
|