@ezeep/ezeep-js 1.0.247 → 1.0.248
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/ezp-auth_15.cjs.entry.js +72 -6
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +1 -1
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +71 -5
- package/dist/custom-elements/index.js +72 -6
- package/dist/esm/ezp-auth_15.entry.js +72 -6
- package/dist/esm-es5/ezp-auth_15.entry.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-8895ff9b.system.entry.js → p-072037fa.system.entry.js} +3 -3
- package/dist/ezeep/{p-51613df0.entry.js → p-69095c75.entry.js} +1 -1
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +3 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-8895ff9b.system.entry.js → p-072037fa.system.entry.js} +3 -3
- package/www/build/{p-51613df0.entry.js → p-69095c75.entry.js} +1 -1
- package/www/build/p-84bd195a.system.js +1 -1
|
@@ -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;
|
|
@@ -34097,13 +34097,54 @@ let EzpStepper = class {
|
|
|
34097
34097
|
*
|
|
34098
34098
|
*/
|
|
34099
34099
|
this.handleDecrease = () => {
|
|
34100
|
-
this.value
|
|
34100
|
+
const newValue = this.value - 1;
|
|
34101
|
+
// Only decrease if within safe range and above minimum
|
|
34102
|
+
if (newValue >= Number.MIN_SAFE_INTEGER && (this.min === undefined || newValue >= this.min)) {
|
|
34103
|
+
this.value = newValue;
|
|
34104
|
+
}
|
|
34101
34105
|
};
|
|
34102
34106
|
this.handleIncrease = () => {
|
|
34103
|
-
this.value
|
|
34107
|
+
const newValue = this.value + 1;
|
|
34108
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34109
|
+
// Only increase if within safe range and below maximum
|
|
34110
|
+
if (newValue <= Number.MAX_SAFE_INTEGER && newValue <= effectiveMax) {
|
|
34111
|
+
this.value = newValue;
|
|
34112
|
+
}
|
|
34104
34113
|
};
|
|
34105
34114
|
this.handleInput = () => {
|
|
34106
|
-
|
|
34115
|
+
if (!this.input)
|
|
34116
|
+
return;
|
|
34117
|
+
let inputString = this.input.value.trim();
|
|
34118
|
+
// If the input is empty, set the value to the minimum
|
|
34119
|
+
if (inputString === '') {
|
|
34120
|
+
this.value = this.min;
|
|
34121
|
+
this.input.value = this.value.toString();
|
|
34122
|
+
return;
|
|
34123
|
+
}
|
|
34124
|
+
// Remove all non-digit characters, keep only numbers
|
|
34125
|
+
const cleanedInput = inputString.replace(/\D/g, '');
|
|
34126
|
+
// If nothing remains after cleaning, revert to the last valid value
|
|
34127
|
+
if (cleanedInput === '') {
|
|
34128
|
+
this.input.value = this.value.toString();
|
|
34129
|
+
return;
|
|
34130
|
+
}
|
|
34131
|
+
// Limit input length to prevent precision loss (MAX_SAFE_INTEGER has 16 digits)
|
|
34132
|
+
const maxDigits = Number.MAX_SAFE_INTEGER.toString().length;
|
|
34133
|
+
const truncatedInput = cleanedInput.slice(0, maxDigits);
|
|
34134
|
+
let inputValue = Number(truncatedInput);
|
|
34135
|
+
// Safety check: ensure the number is within safe integer range
|
|
34136
|
+
if (inputValue > Number.MAX_SAFE_INTEGER) {
|
|
34137
|
+
inputValue = Number.MAX_SAFE_INTEGER;
|
|
34138
|
+
}
|
|
34139
|
+
// Ensure the value is between min and max
|
|
34140
|
+
if (this.min !== undefined && inputValue < this.min)
|
|
34141
|
+
inputValue = this.min;
|
|
34142
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34143
|
+
if (inputValue > effectiveMax)
|
|
34144
|
+
inputValue = effectiveMax;
|
|
34145
|
+
// Update component state and input field
|
|
34146
|
+
this.value = inputValue;
|
|
34147
|
+
this.input.value = inputValue.toString();
|
|
34107
34148
|
};
|
|
34108
34149
|
this.setFocus = () => {
|
|
34109
34150
|
this.input.focus();
|
|
@@ -34114,6 +34155,18 @@ let EzpStepper = class {
|
|
|
34114
34155
|
this.handleFocus = () => {
|
|
34115
34156
|
this.focused = true;
|
|
34116
34157
|
};
|
|
34158
|
+
this.handleKeyDown = (event) => {
|
|
34159
|
+
// If key is allowed or a Ctrl/Cmd combination, do nothing
|
|
34160
|
+
if (EzpStepper.ALLOWED_KEYS.includes(event.key) ||
|
|
34161
|
+
((event.ctrlKey || event.metaKey) && EzpStepper.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
|
|
34162
|
+
return;
|
|
34163
|
+
}
|
|
34164
|
+
// If the key is not a digit, prevent default behavior (block input)
|
|
34165
|
+
const isDigit = /^\d$/.test(event.key);
|
|
34166
|
+
if (!isDigit) {
|
|
34167
|
+
event.preventDefault();
|
|
34168
|
+
}
|
|
34169
|
+
};
|
|
34117
34170
|
}
|
|
34118
34171
|
/**
|
|
34119
34172
|
*
|
|
@@ -34121,7 +34174,8 @@ let EzpStepper = class {
|
|
|
34121
34174
|
*
|
|
34122
34175
|
*/
|
|
34123
34176
|
watchValue() {
|
|
34124
|
-
|
|
34177
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34178
|
+
this.canIncrease = this.value < effectiveMax;
|
|
34125
34179
|
this.canDecrease = this.min !== undefined ? this.value > this.min : true;
|
|
34126
34180
|
this.stepperChanged.emit(this.value);
|
|
34127
34181
|
}
|
|
@@ -34139,12 +34193,24 @@ let EzpStepper = class {
|
|
|
34139
34193
|
*
|
|
34140
34194
|
*/
|
|
34141
34195
|
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" })))));
|
|
34196
|
+
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
34197
|
}
|
|
34144
34198
|
static get watchers() { return {
|
|
34145
34199
|
"value": ["watchValue"]
|
|
34146
34200
|
}; }
|
|
34147
34201
|
};
|
|
34202
|
+
EzpStepper.ALLOWED_KEYS = [
|
|
34203
|
+
'Backspace',
|
|
34204
|
+
'Delete',
|
|
34205
|
+
'Tab',
|
|
34206
|
+
'Escape',
|
|
34207
|
+
'Enter',
|
|
34208
|
+
'ArrowLeft',
|
|
34209
|
+
'ArrowUp',
|
|
34210
|
+
'ArrowRight',
|
|
34211
|
+
'ArrowDown',
|
|
34212
|
+
];
|
|
34213
|
+
EzpStepper.CTRL_CMD_KEYS = ['a', 'c', 'v', 'x'];
|
|
34148
34214
|
EzpStepper.style = ezpStepperCss;
|
|
34149
34215
|
|
|
34150
34216
|
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}";
|
|
@@ -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" })),
|
|
@@ -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
|
};
|
|
@@ -34130,13 +34130,54 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34130
34130
|
*
|
|
34131
34131
|
*/
|
|
34132
34132
|
this.handleDecrease = () => {
|
|
34133
|
-
this.value
|
|
34133
|
+
const newValue = this.value - 1;
|
|
34134
|
+
// Only decrease if within safe range and above minimum
|
|
34135
|
+
if (newValue >= Number.MIN_SAFE_INTEGER && (this.min === undefined || newValue >= this.min)) {
|
|
34136
|
+
this.value = newValue;
|
|
34137
|
+
}
|
|
34134
34138
|
};
|
|
34135
34139
|
this.handleIncrease = () => {
|
|
34136
|
-
this.value
|
|
34140
|
+
const newValue = this.value + 1;
|
|
34141
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34142
|
+
// Only increase if within safe range and below maximum
|
|
34143
|
+
if (newValue <= Number.MAX_SAFE_INTEGER && newValue <= effectiveMax) {
|
|
34144
|
+
this.value = newValue;
|
|
34145
|
+
}
|
|
34137
34146
|
};
|
|
34138
34147
|
this.handleInput = () => {
|
|
34139
|
-
|
|
34148
|
+
if (!this.input)
|
|
34149
|
+
return;
|
|
34150
|
+
let inputString = this.input.value.trim();
|
|
34151
|
+
// If the input is empty, set the value to the minimum
|
|
34152
|
+
if (inputString === '') {
|
|
34153
|
+
this.value = this.min;
|
|
34154
|
+
this.input.value = this.value.toString();
|
|
34155
|
+
return;
|
|
34156
|
+
}
|
|
34157
|
+
// Remove all non-digit characters, keep only numbers
|
|
34158
|
+
const cleanedInput = inputString.replace(/\D/g, '');
|
|
34159
|
+
// If nothing remains after cleaning, revert to the last valid value
|
|
34160
|
+
if (cleanedInput === '') {
|
|
34161
|
+
this.input.value = this.value.toString();
|
|
34162
|
+
return;
|
|
34163
|
+
}
|
|
34164
|
+
// Limit input length to prevent precision loss (MAX_SAFE_INTEGER has 16 digits)
|
|
34165
|
+
const maxDigits = Number.MAX_SAFE_INTEGER.toString().length;
|
|
34166
|
+
const truncatedInput = cleanedInput.slice(0, maxDigits);
|
|
34167
|
+
let inputValue = Number(truncatedInput);
|
|
34168
|
+
// Safety check: ensure the number is within safe integer range
|
|
34169
|
+
if (inputValue > Number.MAX_SAFE_INTEGER) {
|
|
34170
|
+
inputValue = Number.MAX_SAFE_INTEGER;
|
|
34171
|
+
}
|
|
34172
|
+
// Ensure the value is between min and max
|
|
34173
|
+
if (this.min !== undefined && inputValue < this.min)
|
|
34174
|
+
inputValue = this.min;
|
|
34175
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34176
|
+
if (inputValue > effectiveMax)
|
|
34177
|
+
inputValue = effectiveMax;
|
|
34178
|
+
// Update component state and input field
|
|
34179
|
+
this.value = inputValue;
|
|
34180
|
+
this.input.value = inputValue.toString();
|
|
34140
34181
|
};
|
|
34141
34182
|
this.setFocus = () => {
|
|
34142
34183
|
this.input.focus();
|
|
@@ -34147,6 +34188,18 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34147
34188
|
this.handleFocus = () => {
|
|
34148
34189
|
this.focused = true;
|
|
34149
34190
|
};
|
|
34191
|
+
this.handleKeyDown = (event) => {
|
|
34192
|
+
// If key is allowed or a Ctrl/Cmd combination, do nothing
|
|
34193
|
+
if (EzpStepper$1.ALLOWED_KEYS.includes(event.key) ||
|
|
34194
|
+
((event.ctrlKey || event.metaKey) && EzpStepper$1.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
|
|
34195
|
+
return;
|
|
34196
|
+
}
|
|
34197
|
+
// If the key is not a digit, prevent default behavior (block input)
|
|
34198
|
+
const isDigit = /^\d$/.test(event.key);
|
|
34199
|
+
if (!isDigit) {
|
|
34200
|
+
event.preventDefault();
|
|
34201
|
+
}
|
|
34202
|
+
};
|
|
34150
34203
|
}
|
|
34151
34204
|
/**
|
|
34152
34205
|
*
|
|
@@ -34154,7 +34207,8 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34154
34207
|
*
|
|
34155
34208
|
*/
|
|
34156
34209
|
watchValue() {
|
|
34157
|
-
|
|
34210
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34211
|
+
this.canIncrease = this.value < effectiveMax;
|
|
34158
34212
|
this.canDecrease = this.min !== undefined ? this.value > this.min : true;
|
|
34159
34213
|
this.stepperChanged.emit(this.value);
|
|
34160
34214
|
}
|
|
@@ -34172,13 +34226,25 @@ let EzpStepper$1 = class extends HTMLElement {
|
|
|
34172
34226
|
*
|
|
34173
34227
|
*/
|
|
34174
34228
|
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" })))));
|
|
34229
|
+
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
34230
|
}
|
|
34177
34231
|
static get watchers() { return {
|
|
34178
34232
|
"value": ["watchValue"]
|
|
34179
34233
|
}; }
|
|
34180
34234
|
static get style() { return ezpStepperCss; }
|
|
34181
34235
|
};
|
|
34236
|
+
EzpStepper$1.ALLOWED_KEYS = [
|
|
34237
|
+
'Backspace',
|
|
34238
|
+
'Delete',
|
|
34239
|
+
'Tab',
|
|
34240
|
+
'Escape',
|
|
34241
|
+
'Enter',
|
|
34242
|
+
'ArrowLeft',
|
|
34243
|
+
'ArrowUp',
|
|
34244
|
+
'ArrowRight',
|
|
34245
|
+
'ArrowDown',
|
|
34246
|
+
];
|
|
34247
|
+
EzpStepper$1.CTRL_CMD_KEYS = ['a', 'c', 'v', 'x'];
|
|
34182
34248
|
|
|
34183
34249
|
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
34250
|
|
|
@@ -33603,7 +33603,7 @@ let EzpPrinterSelection = class {
|
|
|
33603
33603
|
})), preSelected: this.selectedPrinter.id &&
|
|
33604
33604
|
((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
|
|
33605
33605
|
? this.selectedPrinterConfig.Default.Tray
|
|
33606
|
-
: 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'),
|
|
33606
|
+
: 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 }))));
|
|
33607
33607
|
}
|
|
33608
33608
|
};
|
|
33609
33609
|
EzpPrinterSelection.style = ezpPrinterSelectionCss;
|
|
@@ -34093,13 +34093,54 @@ let EzpStepper = class {
|
|
|
34093
34093
|
*
|
|
34094
34094
|
*/
|
|
34095
34095
|
this.handleDecrease = () => {
|
|
34096
|
-
this.value
|
|
34096
|
+
const newValue = this.value - 1;
|
|
34097
|
+
// Only decrease if within safe range and above minimum
|
|
34098
|
+
if (newValue >= Number.MIN_SAFE_INTEGER && (this.min === undefined || newValue >= this.min)) {
|
|
34099
|
+
this.value = newValue;
|
|
34100
|
+
}
|
|
34097
34101
|
};
|
|
34098
34102
|
this.handleIncrease = () => {
|
|
34099
|
-
this.value
|
|
34103
|
+
const newValue = this.value + 1;
|
|
34104
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34105
|
+
// Only increase if within safe range and below maximum
|
|
34106
|
+
if (newValue <= Number.MAX_SAFE_INTEGER && newValue <= effectiveMax) {
|
|
34107
|
+
this.value = newValue;
|
|
34108
|
+
}
|
|
34100
34109
|
};
|
|
34101
34110
|
this.handleInput = () => {
|
|
34102
|
-
|
|
34111
|
+
if (!this.input)
|
|
34112
|
+
return;
|
|
34113
|
+
let inputString = this.input.value.trim();
|
|
34114
|
+
// If the input is empty, set the value to the minimum
|
|
34115
|
+
if (inputString === '') {
|
|
34116
|
+
this.value = this.min;
|
|
34117
|
+
this.input.value = this.value.toString();
|
|
34118
|
+
return;
|
|
34119
|
+
}
|
|
34120
|
+
// Remove all non-digit characters, keep only numbers
|
|
34121
|
+
const cleanedInput = inputString.replace(/\D/g, '');
|
|
34122
|
+
// If nothing remains after cleaning, revert to the last valid value
|
|
34123
|
+
if (cleanedInput === '') {
|
|
34124
|
+
this.input.value = this.value.toString();
|
|
34125
|
+
return;
|
|
34126
|
+
}
|
|
34127
|
+
// Limit input length to prevent precision loss (MAX_SAFE_INTEGER has 16 digits)
|
|
34128
|
+
const maxDigits = Number.MAX_SAFE_INTEGER.toString().length;
|
|
34129
|
+
const truncatedInput = cleanedInput.slice(0, maxDigits);
|
|
34130
|
+
let inputValue = Number(truncatedInput);
|
|
34131
|
+
// Safety check: ensure the number is within safe integer range
|
|
34132
|
+
if (inputValue > Number.MAX_SAFE_INTEGER) {
|
|
34133
|
+
inputValue = Number.MAX_SAFE_INTEGER;
|
|
34134
|
+
}
|
|
34135
|
+
// Ensure the value is between min and max
|
|
34136
|
+
if (this.min !== undefined && inputValue < this.min)
|
|
34137
|
+
inputValue = this.min;
|
|
34138
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34139
|
+
if (inputValue > effectiveMax)
|
|
34140
|
+
inputValue = effectiveMax;
|
|
34141
|
+
// Update component state and input field
|
|
34142
|
+
this.value = inputValue;
|
|
34143
|
+
this.input.value = inputValue.toString();
|
|
34103
34144
|
};
|
|
34104
34145
|
this.setFocus = () => {
|
|
34105
34146
|
this.input.focus();
|
|
@@ -34110,6 +34151,18 @@ let EzpStepper = class {
|
|
|
34110
34151
|
this.handleFocus = () => {
|
|
34111
34152
|
this.focused = true;
|
|
34112
34153
|
};
|
|
34154
|
+
this.handleKeyDown = (event) => {
|
|
34155
|
+
// If key is allowed or a Ctrl/Cmd combination, do nothing
|
|
34156
|
+
if (EzpStepper.ALLOWED_KEYS.includes(event.key) ||
|
|
34157
|
+
((event.ctrlKey || event.metaKey) && EzpStepper.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
|
|
34158
|
+
return;
|
|
34159
|
+
}
|
|
34160
|
+
// If the key is not a digit, prevent default behavior (block input)
|
|
34161
|
+
const isDigit = /^\d$/.test(event.key);
|
|
34162
|
+
if (!isDigit) {
|
|
34163
|
+
event.preventDefault();
|
|
34164
|
+
}
|
|
34165
|
+
};
|
|
34113
34166
|
}
|
|
34114
34167
|
/**
|
|
34115
34168
|
*
|
|
@@ -34117,7 +34170,8 @@ let EzpStepper = class {
|
|
|
34117
34170
|
*
|
|
34118
34171
|
*/
|
|
34119
34172
|
watchValue() {
|
|
34120
|
-
|
|
34173
|
+
const effectiveMax = this.max !== undefined ? Math.min(this.max, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER;
|
|
34174
|
+
this.canIncrease = this.value < effectiveMax;
|
|
34121
34175
|
this.canDecrease = this.min !== undefined ? this.value > this.min : true;
|
|
34122
34176
|
this.stepperChanged.emit(this.value);
|
|
34123
34177
|
}
|
|
@@ -34135,12 +34189,24 @@ let EzpStepper = class {
|
|
|
34135
34189
|
*
|
|
34136
34190
|
*/
|
|
34137
34191
|
render() {
|
|
34138
|
-
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" })))));
|
|
34192
|
+
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" })))));
|
|
34139
34193
|
}
|
|
34140
34194
|
static get watchers() { return {
|
|
34141
34195
|
"value": ["watchValue"]
|
|
34142
34196
|
}; }
|
|
34143
34197
|
};
|
|
34198
|
+
EzpStepper.ALLOWED_KEYS = [
|
|
34199
|
+
'Backspace',
|
|
34200
|
+
'Delete',
|
|
34201
|
+
'Tab',
|
|
34202
|
+
'Escape',
|
|
34203
|
+
'Enter',
|
|
34204
|
+
'ArrowLeft',
|
|
34205
|
+
'ArrowUp',
|
|
34206
|
+
'ArrowRight',
|
|
34207
|
+
'ArrowDown',
|
|
34208
|
+
];
|
|
34209
|
+
EzpStepper.CTRL_CMD_KEYS = ['a', 'c', 'v', 'x'];
|
|
34144
34210
|
EzpStepper.style = ezpStepperCss;
|
|
34145
34211
|
|
|
34146
34212
|
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}";
|