@ezeep/ezeep-js 1.0.272 → 1.0.284

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.
Files changed (132) hide show
  1. package/dist/cjs/{app-globals-D7ISNeUi.js → app-globals-L_3XPZxT.js} +7 -1
  2. package/dist/cjs/ezeep.cjs.js +4 -4
  3. package/dist/cjs/ezp-auth_15.cjs.entry.js +7338 -3700
  4. package/dist/cjs/{index-dv_gozsq.js → index-DM5v_sge.js} +3 -2
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/collection/collection-manifest.json +1 -1
  7. package/dist/collection/components/ezp-auth/ezp-auth.css +0 -12
  8. package/dist/collection/components/ezp-auth/ezp-auth.js +78 -18
  9. package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +5 -5
  10. package/dist/collection/components/ezp-dialog/ezp-dialog.js +85 -13
  11. package/dist/collection/components/ezp-icon/assets/glyph-cloud-upload.svg +4 -0
  12. package/dist/collection/components/ezp-icon/assets/glyph-file.svg +3 -0
  13. package/dist/collection/components/ezp-icon/ezp-icon.js +8 -3
  14. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +5 -2
  15. package/dist/collection/components/ezp-input/ezp-input.css +19 -38
  16. package/dist/collection/components/ezp-input/ezp-input.js +16 -14
  17. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +175 -48
  18. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +215 -329
  19. package/dist/collection/components/ezp-printing/ezp-printing.css +23 -23
  20. package/dist/collection/components/ezp-printing/ezp-printing.js +119 -35
  21. package/dist/collection/components/ezp-select/ezp-select.css +56 -38
  22. package/dist/collection/components/ezp-select/ezp-select.js +93 -14
  23. package/dist/collection/components/ezp-status/ezp-status.css +94 -9
  24. package/dist/collection/components/ezp-status/ezp-status.js +42 -13
  25. package/dist/collection/components/ezp-stepper/ezp-stepper.css +37 -35
  26. package/dist/collection/components/ezp-stepper/ezp-stepper.js +14 -7
  27. package/dist/collection/components/ezp-text-button/ezp-text-button.css +3 -3
  28. package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
  29. package/dist/collection/components/ezp-upload/ezp-upload.css +243 -77
  30. package/dist/collection/components/ezp-upload/ezp-upload.js +80 -10
  31. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +2 -1
  32. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +15 -15
  33. package/dist/collection/services/auth.js +37 -36
  34. package/dist/collection/services/http.js +11 -0
  35. package/dist/collection/services/print-job.js +72 -0
  36. package/dist/collection/services/print.js +21 -69
  37. package/dist/collection/services/user.js +2 -9
  38. package/dist/collection/shared/constants.js +55 -0
  39. package/dist/collection/shared/global.js +7 -1
  40. package/dist/collection/shared/storage.js +71 -0
  41. package/dist/collection/types/shared/types.d.ts +42 -9
  42. package/dist/collection/utils/printer.js +68 -0
  43. package/dist/collection/utils/utils.js +24 -9
  44. package/dist/components/auth.js +1 -1
  45. package/dist/components/ezp-auth2.js +1 -1
  46. package/dist/components/ezp-backdrop2.js +1 -1
  47. package/dist/components/ezp-dialog2.js +1 -1
  48. package/dist/components/ezp-icon-button2.js +1 -1
  49. package/dist/components/ezp-icon2.js +1 -1
  50. package/dist/components/ezp-input2.js +1 -1
  51. package/dist/components/ezp-printer-selection2.js +1 -1
  52. package/dist/components/ezp-printing.js +1 -1
  53. package/dist/components/ezp-select2.js +1 -1
  54. package/dist/components/ezp-status2.js +1 -1
  55. package/dist/components/ezp-stepper2.js +1 -1
  56. package/dist/components/ezp-text-button2.js +1 -1
  57. package/dist/components/ezp-upload2.js +1 -1
  58. package/dist/components/ezp-user-menu.js +1 -1
  59. package/dist/components/ezp-user-menu2.js +1 -1
  60. package/dist/components/index.js +1 -1
  61. package/dist/components/utils.js +1 -0
  62. package/dist/directives/proxies.ts +74 -47
  63. package/dist/esm/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +7 -1
  64. package/dist/esm/ezeep.js +5 -5
  65. package/dist/esm/ezp-auth_15.entry.js +7338 -3700
  66. package/dist/esm/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
  67. package/dist/esm/loader.js +4 -4
  68. package/dist/esm-es5/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +1 -1
  69. package/dist/esm-es5/ezeep.js +1 -1
  70. package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
  71. package/dist/esm-es5/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
  72. package/dist/esm-es5/loader.js +1 -1
  73. package/dist/ezeep/assets/glyph-cloud-upload.svg +4 -0
  74. package/dist/ezeep/assets/glyph-file.svg +3 -0
  75. package/dist/ezeep/ezeep.esm.js +1 -1
  76. package/dist/ezeep/ezeep.js +1 -1
  77. package/dist/ezeep/p-1e286bd1.system.entry.js +7 -0
  78. package/dist/ezeep/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
  79. package/dist/ezeep/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
  80. package/{www/build/p-DhXN1yGM.system.js → dist/ezeep/p-CYpousxy.system.js} +2 -2
  81. package/dist/ezeep/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
  82. package/dist/ezeep/p-DCznw2Ee.system.js +1 -0
  83. package/dist/ezeep/p-a2b688f0.entry.js +1 -0
  84. package/dist/ezeep/types/shared/types.d.ts +42 -9
  85. package/dist/types/components/ezp-auth/ezp-auth.d.ts +8 -5
  86. package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +2 -2
  87. package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +14 -3
  88. package/dist/types/components/ezp-input/ezp-input.d.ts +17 -14
  89. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +23 -7
  90. package/dist/types/components/ezp-printing/ezp-printing.d.ts +26 -2
  91. package/dist/types/components/ezp-select/ezp-select.d.ts +10 -4
  92. package/dist/types/components/ezp-status/ezp-status.d.ts +7 -4
  93. package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +1 -1
  94. package/dist/types/components/ezp-upload/ezp-upload.d.ts +13 -1
  95. package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +5 -2
  96. package/dist/types/components.d.ts +47 -39
  97. package/dist/types/services/auth.d.ts +10 -0
  98. package/dist/types/services/http.d.ts +4 -0
  99. package/dist/types/services/print-job.d.ts +48 -0
  100. package/dist/types/services/print.d.ts +10 -9
  101. package/dist/types/services/user.d.ts +13 -2
  102. package/dist/types/shared/constants.d.ts +51 -0
  103. package/dist/types/shared/storage.d.ts +24 -0
  104. package/dist/types/shared/types.d.ts +42 -9
  105. package/dist/types/stencil-public-runtime.d.ts +1 -0
  106. package/dist/types/utils/printer.d.ts +22 -0
  107. package/dist/types/utils/utils.d.ts +22 -10
  108. package/package.json +30 -18
  109. package/readme.md +1 -0
  110. package/www/build/assets/glyph-cloud-upload.svg +4 -0
  111. package/www/build/assets/glyph-file.svg +3 -0
  112. package/www/build/ezeep.esm.js +1 -1
  113. package/www/build/ezeep.js +1 -1
  114. package/www/build/p-1e286bd1.system.entry.js +7 -0
  115. package/www/build/p-544b7033.js +1 -0
  116. package/www/build/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
  117. package/www/build/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
  118. package/{dist/ezeep/p-DhXN1yGM.system.js → www/build/p-CYpousxy.system.js} +2 -2
  119. package/www/build/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
  120. package/www/build/p-DCznw2Ee.system.js +1 -0
  121. package/www/build/p-a2b688f0.entry.js +1 -0
  122. package/www/data/locales/de.json +14 -5
  123. package/www/data/locales/en.json +14 -5
  124. package/www/index.html +2 -5
  125. package/dist/components/i18next.js +0 -1
  126. package/dist/ezeep/p-2177b8f4.system.entry.js +0 -7
  127. package/dist/ezeep/p-CfQRcOh8.system.js +0 -1
  128. package/dist/ezeep/p-de8f6583.entry.js +0 -1
  129. package/www/build/p-2177b8f4.system.entry.js +0 -7
  130. package/www/build/p-256870db.js +0 -1
  131. package/www/build/p-CfQRcOh8.system.js +0 -1
  132. package/www/build/p-de8f6583.entry.js +0 -1
@@ -41,7 +41,7 @@ export class EzpStepper {
41
41
  this.handleInput = () => {
42
42
  if (!this.input)
43
43
  return;
44
- let inputString = this.input.value.trim();
44
+ const inputString = this.input.value.trim();
45
45
  // If the input is empty, set the value to the minimum
46
46
  if (inputString === '') {
47
47
  this.value = this.min;
@@ -74,7 +74,8 @@ export class EzpStepper {
74
74
  this.input.value = inputValue.toString();
75
75
  };
76
76
  this.setFocus = () => {
77
- this.input.focus();
77
+ var _a;
78
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
78
79
  };
79
80
  this.handleBlur = () => {
80
81
  this.focused = false;
@@ -85,7 +86,8 @@ export class EzpStepper {
85
86
  this.handleKeyDown = (event) => {
86
87
  // If key is allowed or a Ctrl/Cmd combination, do nothing
87
88
  if (EzpStepper.ALLOWED_KEYS.includes(event.key) ||
88
- ((event.ctrlKey || event.metaKey) && EzpStepper.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
89
+ ((event.ctrlKey || event.metaKey) &&
90
+ EzpStepper.CTRL_CMD_KEYS.includes(event.key.toLowerCase()))) {
89
91
  return;
90
92
  }
91
93
  // If the key is not a digit, prevent default behavior (block input)
@@ -112,6 +114,11 @@ export class EzpStepper {
112
114
  *
113
115
  */
114
116
  componentWillLoad() {
117
+ // The default value (1) can sit below a higher `min`; clamp it on load so
118
+ // the stepper never starts in an out-of-range state.
119
+ if (this.min !== undefined && this.value < this.min) {
120
+ this.value = this.min;
121
+ }
115
122
  this.watchValue();
116
123
  }
117
124
  /**
@@ -120,7 +127,7 @@ export class EzpStepper {
120
127
  *
121
128
  */
122
129
  render() {
123
- return (h(Host, { key: 'c38bfbfc2ec2a7151bb04240c2eee1b8ad3ec613', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { key: '0f4546db4e6004561114c6073672160c4cebe01b', id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '74bd616d5336895a33b54668c3641e23267427d8', id: "label", noWrap: true, text: this.label }), h("input", { key: '612cbac350e67e5915e3bd2b68beef61d87d65f4', 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", { key: '7b20d44d0fef4c6d206acba4ba7a5b545cefe437', class: "buttons" }, h("button", { key: 'b71ead9b92eef6e56638073d5e9e39e0f3460618', class: "button", disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { key: 'd2fc6589d1044644da2c40f85ad67f5a4c1aecdd', name: "minus" })), h("button", { key: 'ea7d7c6f9064c03d3a8ea2434fe26dd7f964b4d4', class: "button", disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { key: '5c4d5c89e329a7af4bf7cc5afd0b4b6f97ff4b3b', name: "plus" })))));
130
+ return (h(Host, { key: 'ef15da0203857706cd220bd932fe25fb20f9a876', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { key: 'c36d83b93752da6678184e6e5d449e7422d0dd10', id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '14e07c854636dfce079c349dd245fa8c7fc3025d', id: "label", noWrap: true, text: this.label }), h("div", { key: '11eef956e9f5dbb0feffa5fd2aed60dae7d80035', class: "buttons" }, h("button", { key: 'e328929f56a3aebeff825a711674a9e3d9e91ab0', class: "button", type: "button", "aria-label": `Decrease ${this.label}`, disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { key: 'd1af53b4ab9e22c28bd16325851f01e7c551de94', name: "minus" })), h("input", { key: '3591c3060576cf1abdc1187e20aa97b901589a92', id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max !== undefined ? this.max.toString() : undefined, value: this.value.toString(), "aria-label": this.label, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), h("button", { key: 'c081e7190bbea2f2d75cf81394c781ade876dce6', class: "button", type: "button", "aria-label": `Increase ${this.label}`, disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { key: 'd3a1ddde274537dec1f5a17c0cdf5afdd40fe24f', name: "plus" })))));
124
131
  }
125
132
  static get is() { return "ezp-stepper"; }
126
133
  static get encapsulation() { return "shadow"; }
@@ -141,7 +148,7 @@ export class EzpStepper {
141
148
  "mutable": false,
142
149
  "complexType": {
143
150
  "original": "IconNameTypes",
144
- "resolved": "\"account\" | \"checkmark\" | \"checkmark-alt\" | \"close\" | \"color\" | \"copies\" | \"dark\" | \"drag-drop\" | \"duplex\" | \"exclamation-mark\" | \"expand\" | \"height\" | \"help\" | \"light\" | \"logo\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"paper_range\" | \"plus\" | \"printer\" | \"quality\" | \"question-mark\" | \"size\" | \"system\" | \"trays\" | \"width\"",
151
+ "resolved": "\"account\" | \"checkmark\" | \"checkmark-alt\" | \"close\" | \"cloud-upload\" | \"color\" | \"copies\" | \"dark\" | \"drag-drop\" | \"duplex\" | \"exclamation-mark\" | \"expand\" | \"file\" | \"height\" | \"help\" | \"light\" | \"logo\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"paper_range\" | \"plus\" | \"printer\" | \"quality\" | \"question-mark\" | \"size\" | \"system\" | \"trays\" | \"width\"",
145
152
  "references": {
146
153
  "IconNameTypes": {
147
154
  "location": "import",
@@ -243,8 +250,8 @@ export class EzpStepper {
243
250
  "text": "\nEvents"
244
251
  },
245
252
  "complexType": {
246
- "original": "any",
247
- "resolved": "any",
253
+ "original": "number",
254
+ "resolved": "number",
248
255
  "references": {}
249
256
  }
250
257
  }];
@@ -38,8 +38,8 @@
38
38
  appearance: none;
39
39
  background: var(--ezp-textButton-background, var(--ezp-textButton-background-init));
40
40
  border: 0;
41
- border-radius: 3px;
42
- box-shadow: none;
41
+ border-radius: var(--ezp-textButton-borderRadius, 3px);
42
+ box-shadow: var(--ezp-textButton-boxShadow, none);
43
43
  color: var(--ezp-textButton-color, var(--ezp-textButton-color-init));
44
44
  cursor: var(--ezp-textButton-cursor, pointer);
45
45
  display: flex;
@@ -48,7 +48,7 @@
48
48
  margin: 0;
49
49
  opacity: var(--ezp-textButton-opacity, 1);
50
50
  outline: none;
51
- padding: var(--ezp-spacing-3);
51
+ padding: var(--ezp-textButton-padding, var(--ezp-spacing-3));
52
52
  white-space: nowrap;
53
53
  width: 100%;
54
54
  }
@@ -31,7 +31,7 @@ export class EzpTextButton {
31
31
  href: this.href,
32
32
  target: this.blank ? '_blank' : '_self',
33
33
  };
34
- return (h(Host, { key: '24c7d7fe23395513fccfc8fc94fbc552a1763148', class: `${this.level}` }, h(TagType, Object.assign({ key: 'f983601cdd0b0312850826422a18bfaa3c16a87b', id: "button" }, attributes), h("ezp-label", { key: '63de52e9734a621baa3ec51c27429c049c7aab93', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
34
+ return (h(Host, { key: 'e4d814429f79e8c7043ac26f44ebab08ba119cb4', class: `${this.level}` }, h(TagType, Object.assign({ key: 'e3f66d16f69c8abc1f073558b6547644340dcb6b', id: "button", "aria-label": this.label }, attributes), h("ezp-label", { key: 'c091e210993059cdf044863fe600212ec04c44b7', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
35
35
  }
36
36
  static get is() { return "ezp-text-button"; }
37
37
  static get encapsulation() { return "shadow"; }
@@ -1,129 +1,295 @@
1
- @charset "UTF-8";
2
1
  /**
3
2
  *
4
3
  * Rules
5
4
  *
6
5
  */
7
6
  :host {
8
- align-content: center;
9
- background: var(--ezp-upload-background, transparent);
10
- border: 1px dashed var(--ezp-upload-border-color, var(--ezp-core-foreground-tertiary));
11
- border-radius: 3px;
7
+ --ezp-upload-gradient: linear-gradient(
8
+ 135deg,
9
+ color-mix(in srgb, var(--ezp-theme-solid), white 14%) 0%,
10
+ color-mix(in srgb, var(--ezp-theme-solid), black 22%) 100%
11
+ );
12
12
  box-sizing: border-box;
13
13
  color: var(--ezp-core-foreground-primary);
14
- display: grid;
15
- grid-template: auto/minmax(auto, 280px);
16
- height: var(--ezp-upload-height, auto);
17
- justify-content: center;
18
- padding: var(--ezp-spacing-3);
19
- position: relative;
20
- transition: background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);
14
+ display: block;
21
15
  width: var(--ezp-upload-width, auto);
16
+ height: var(--ezp-upload-height, auto);
22
17
  }
23
- :host(.dragging) {
24
- --ezp-upload-background: var(--ezp-theme-translucent);
25
- --ezp-upload-border-color: var(--ezp-theme-translucent);
26
- --ezp-upload-header-blur: 16px;
27
- --ezp-upload-header-opacity: 0.42;
18
+
19
+ *,
20
+ *::before,
21
+ *::after {
22
+ box-sizing: border-box;
23
+ }
24
+
25
+ #form {
26
+ display: block;
27
+ height: 100%;
28
+ }
29
+
30
+ #input {
31
+ appearance: none;
32
+ height: 0;
33
+ opacity: 0;
34
+ pointer-events: none;
35
+ position: absolute;
36
+ width: 0;
37
+ }
38
+
39
+ #modal {
40
+ background: var(--ezp-core-surface-tertiary);
41
+ border-radius: 16px;
42
+ box-shadow: 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: var(--ezp-spacing-4);
46
+ height: 100%;
47
+ padding: var(--ezp-spacing-5);
28
48
  }
29
49
 
50
+ /**
51
+ *
52
+ * Header
53
+ *
54
+ */
30
55
  #header {
31
- --ezp-icon-fill: var(--ezp-theme-solid);
32
56
  align-items: center;
57
+ border-bottom: 1px solid var(--ezp-core-outline);
33
58
  display: flex;
34
- filter: blur(var(--ezp-upload-header-blur, 0));
59
+ justify-content: space-between;
60
+ padding-bottom: var(--ezp-spacing-4);
61
+ }
62
+
63
+ #heading {
64
+ --ezp-label-fontSize: 22px;
65
+ --ezp-label-lineHeight: 28px;
66
+ }
67
+
68
+ /**
69
+ *
70
+ * Dropzone
71
+ *
72
+ */
73
+ #dropzone {
74
+ align-items: center;
75
+ background: var(--ezp-upload-background, transparent);
76
+ border: 1.5px dashed var(--ezp-upload-border-color, var(--ezp-core-foreground-tertiary));
77
+ border-radius: 12px;
78
+ display: flex;
79
+ /* Grow to fill the modal body so the dashed box spans the available height,
80
+ and keep the contents centered vertically within it. */
81
+ flex: 1 1 auto;
35
82
  flex-direction: column;
36
- gap: var(--ezp-spacing-5);
37
- opacity: var(--ezp-upload-header-opacity, 1);
83
+ gap: var(--ezp-spacing-4);
84
+ justify-content: center;
85
+ min-height: 0;
86
+ padding: var(--ezp-spacing-6) var(--ezp-spacing-5);
38
87
  text-align: center;
39
- transition: filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart);
40
- /* When files are selected, collapse the drop-zone icon and primary description
41
- so the file list has more breathing room. */
88
+ transition: background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);
42
89
  }
43
- #header:has(#file-list) {
44
- gap: var(--ezp-spacing-3);
90
+
91
+ :host(.dragging) {
92
+ --ezp-upload-background: var(--ezp-theme-translucent);
93
+ --ezp-upload-border-color: var(--ezp-theme-solid);
45
94
  }
46
- #header:has(#file-list) > ezp-icon {
47
- display: none;
95
+
96
+ #cloud {
97
+ align-items: center;
98
+ background: var(--ezp-upload-gradient);
99
+ border-radius: 20px;
100
+ box-shadow: 0 12px 24px -8px color-mix(in srgb, var(--ezp-theme-solid), transparent 45%);
101
+ color: var(--ezp-white-100);
102
+ display: flex;
103
+ height: 84px;
104
+ justify-content: center;
105
+ width: 84px;
48
106
  }
49
- #header:has(#file-list) > ezp-label:first-of-type {
50
- display: none;
107
+ #cloud ezp-icon {
108
+ --ezp-icon-size: 40px;
109
+ --ezp-icon-gridTemplate: 40px;
110
+ }
111
+
112
+ #dropzone-title {
113
+ --ezp-label-fontSize: 20px;
114
+ --ezp-label-lineHeight: 26px;
51
115
  }
52
116
 
53
117
  #meta {
118
+ align-items: baseline;
119
+ color: var(--ezp-core-foreground-secondary);
54
120
  display: flex;
55
121
  flex-wrap: wrap;
56
- gap: var(--ezp-spacing-3) 3px;
122
+ gap: 4px;
57
123
  justify-content: center;
58
124
  }
59
125
 
60
- #select {
126
+ #browse {
61
127
  color: var(--ezp-theme-solid);
62
128
  cursor: pointer;
63
- opacity: var(--ezp-upload-select-opacity, 1);
64
- text-decoration: underline;
65
- white-space: nowrap;
129
+ opacity: var(--ezp-upload-browse-opacity, 1);
66
130
  }
67
131
  @media (hover: hover) {
68
- #select:hover {
69
- --ezp-upload-select-opacity: 0.58;
132
+ #browse:hover {
133
+ --ezp-upload-browse-opacity: 0.6;
70
134
  }
71
135
  }
72
136
 
73
- #input {
74
- appearance: none;
75
- height: 0;
76
- opacity: 0;
77
- pointer-events: none;
78
- position: absolute;
79
- width: 0;
137
+ /**
138
+ *
139
+ * Format chips
140
+ *
141
+ */
142
+ #formats {
143
+ display: flex;
144
+ flex-wrap: wrap;
145
+ gap: var(--ezp-spacing-2);
146
+ justify-content: center;
80
147
  }
81
148
 
82
- #file-list {
149
+ .format {
150
+ background: transparent;
151
+ border: 1px solid var(--ezp-core-outline);
152
+ border-radius: 999px;
153
+ color: var(--ezp-core-foreground-secondary);
154
+ font-size: 12px;
155
+ font-weight: 600;
156
+ letter-spacing: 0.02em;
157
+ line-height: 1;
158
+ padding: 7px 14px;
159
+ }
160
+
161
+ /**
162
+ *
163
+ * File thumbnails
164
+ *
165
+ */
166
+ #thumbs {
83
167
  display: flex;
84
- flex-direction: column;
85
- gap: var(--ezp-spacing-3);
86
- width: 100%;
87
- max-height: var(--ezp-upload-fileList-maxHeight, 35vh);
168
+ flex-wrap: wrap;
169
+ gap: var(--ezp-spacing-4);
170
+ justify-content: center;
171
+ max-height: 40vh;
88
172
  overflow-y: auto;
89
- /* Cross-platform thin scrollbar — Windows default is too chunky for this size. */
173
+ padding: var(--ezp-spacing-1);
90
174
  scrollbar-width: thin;
91
- scrollbar-color: var(--ezp-core-foreground-tertiary) transparent;
92
- /* WebKit fallback for older Safari / Chrome that don't honor scrollbar-width. */
93
- }
94
- #file-list::-webkit-scrollbar {
95
- width: 8px;
96
- height: 8px;
97
- }
98
- #file-list::-webkit-scrollbar-thumb {
99
- background: var(--ezp-core-foreground-tertiary);
100
- border-radius: 4px;
101
- }
102
- #file-list::-webkit-scrollbar-track {
103
- background: transparent;
175
+ width: 100%;
104
176
  }
105
177
 
106
- .file-item {
107
- display: grid;
108
- grid-template-columns: 1fr auto;
178
+ .thumb {
109
179
  align-items: center;
110
- gap: var(--ezp-spacing-3);
111
- padding: var(--ezp-spacing-2) var(--ezp-spacing-3);
112
- background: var(--ezp-core-background-secondary);
113
- border-radius: 3px;
114
- min-height: 32px;
180
+ display: flex;
181
+ flex-direction: column;
182
+ gap: 6px;
183
+ position: relative;
184
+ width: 88px;
115
185
  }
116
186
 
117
- .file-name {
118
- grid-column: 1;
119
- min-width: 0;
187
+ .thumb-icon {
188
+ align-items: center;
189
+ background: var(--ezp-upload-gradient);
190
+ border-radius: 50%;
191
+ color: var(--ezp-white-100);
192
+ display: flex;
193
+ height: 56px;
194
+ justify-content: center;
195
+ width: 56px;
196
+ }
197
+ .thumb-icon ezp-icon {
198
+ --ezp-icon-size: 26px;
199
+ --ezp-icon-gridTemplate: 26px;
120
200
  }
121
- .file-name ezp-label {
201
+
202
+ .thumb-name {
122
203
  --ezp-label-minWidth: 0;
204
+ max-width: 100%;
205
+ }
206
+
207
+ .thumb-meta {
208
+ letter-spacing: 0.02em;
123
209
  }
124
210
 
125
- .file-remove {
126
- grid-column: 2;
211
+ .thumb-remove {
212
+ align-items: center;
213
+ appearance: none;
214
+ background: var(--ezp-core-surface-tertiary);
215
+ border: 1px solid var(--ezp-core-outline);
216
+ border-radius: 50%;
217
+ color: var(--ezp-core-foreground-secondary);
218
+ cursor: pointer;
127
219
  display: flex;
220
+ height: 20px;
221
+ justify-content: center;
222
+ padding: 0;
223
+ position: absolute;
224
+ right: 8px;
225
+ top: -4px;
226
+ transition: color var(--ezp-duration-2) var(--ezp-easing-out-quart);
227
+ width: 20px;
228
+ z-index: 1;
229
+ }
230
+ .thumb-remove ezp-icon {
231
+ --ezp-icon-size: 12px;
232
+ --ezp-icon-gridTemplate: 12px;
233
+ }
234
+ @media (hover: hover) {
235
+ .thumb-remove:hover {
236
+ color: var(--ezp-core-foreground-primary);
237
+ }
238
+ }
239
+
240
+ .thumb-add {
241
+ cursor: pointer;
242
+ }
243
+ .thumb-add .thumb-add-icon {
128
244
  align-items: center;
245
+ border: 1.5px dashed var(--ezp-core-foreground-tertiary);
246
+ border-radius: 50%;
247
+ color: var(--ezp-core-foreground-secondary);
248
+ display: flex;
249
+ height: 56px;
250
+ justify-content: center;
251
+ transition: border-color var(--ezp-duration-2) var(--ezp-easing-out-quart);
252
+ width: 56px;
253
+ }
254
+ .thumb-add .thumb-add-icon ezp-icon {
255
+ --ezp-icon-size: 24px;
256
+ --ezp-icon-gridTemplate: 24px;
257
+ }
258
+ @media (hover: hover) {
259
+ .thumb-add:hover .thumb-add-icon {
260
+ border-color: var(--ezp-theme-solid);
261
+ color: var(--ezp-theme-solid);
262
+ }
263
+ }
264
+
265
+ /**
266
+ *
267
+ * Ready counter
268
+ *
269
+ */
270
+ #ready {
271
+ color: var(--ezp-core-foreground-secondary);
272
+ letter-spacing: 0.08em;
273
+ text-align: center;
274
+ text-transform: uppercase;
275
+ }
276
+
277
+ /**
278
+ *
279
+ * Footer
280
+ *
281
+ */
282
+ #footer {
283
+ display: grid;
284
+ gap: var(--ezp-spacing-3);
285
+ grid-template-columns: 1fr 1.4fr;
286
+ }
287
+
288
+ .action {
289
+ --ezp-textButton-borderRadius: 999px;
290
+ --ezp-textButton-padding: var(--ezp-spacing-4);
291
+ }
292
+
293
+ #continue {
294
+ --ezp-textButton-background-init: var(--ezp-upload-gradient);
129
295
  }
@@ -1,5 +1,8 @@
1
- import { Host, h, Fragment } from "@stencil/core";
1
+ import { Host, h } from "@stencil/core";
2
+ import { subscribeToLanguageChange } from "../../utils/utils";
2
3
  import i18next from "i18next";
4
+ /** File formats advertised to the user as supported for printing. */
5
+ const SUPPORTED_FORMATS = ['PDF', 'DOCX', 'PNG', 'JPG', 'XLSX'];
3
6
  export class EzpUpload {
4
7
  constructor() {
5
8
  /**
@@ -15,7 +18,8 @@ export class EzpUpload {
15
18
  *
16
19
  */
17
20
  this.handleInput = () => {
18
- const files = Array.from(this.input.files);
21
+ var _a, _b;
22
+ const files = Array.from((_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
19
23
  // Add new files to existing selection instead of replacing
20
24
  this.selectedFiles = [...this.selectedFiles, ...files];
21
25
  this.uploadFile.emit(this.selectedFiles);
@@ -34,6 +38,24 @@ export class EzpUpload {
34
38
  this.input.value = '';
35
39
  }
36
40
  };
41
+ this.clearSelection = () => {
42
+ var _a;
43
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
44
+ this.selectedFiles = [];
45
+ this.uploadFile.emit(this.selectedFiles);
46
+ };
47
+ this.handleContinue = () => {
48
+ if (this.selectedFiles.length === 0)
49
+ return;
50
+ this.uploadContinue.emit(this.selectedFiles);
51
+ };
52
+ }
53
+ connectedCallback() {
54
+ this.unsubscribeLanguage = subscribeToLanguageChange(this);
55
+ }
56
+ disconnectedCallback() {
57
+ var _a;
58
+ (_a = this.unsubscribeLanguage) === null || _a === void 0 ? void 0 : _a.call(this);
37
59
  }
38
60
  /**
39
61
  *
@@ -46,31 +68,54 @@ export class EzpUpload {
46
68
  handleDragOver(event) {
47
69
  event.stopPropagation();
48
70
  event.preventDefault();
49
- event.dataTransfer.dropEffect = 'copy';
71
+ if (event.dataTransfer) {
72
+ event.dataTransfer.dropEffect = 'copy';
73
+ }
50
74
  }
51
75
  handleDragLeave() {
52
76
  this.dragging = false;
53
77
  }
54
78
  handleDrop(event) {
79
+ var _a, _b;
55
80
  event.stopPropagation();
56
81
  event.preventDefault();
57
82
  this.dragging = false;
58
- const files = Array.from(event.dataTransfer.files);
83
+ const files = Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
59
84
  // Add new files to existing selection instead of replacing
60
85
  this.selectedFiles = [...this.selectedFiles, ...files];
61
86
  this.uploadFile.emit(this.selectedFiles);
62
87
  }
63
88
  listenPrintCancel() {
64
- this.form.reset();
89
+ var _a;
90
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
65
91
  this.selectedFiles = [];
66
92
  }
93
+ /** Extract a short, upper-cased file-type label from the file name. */
94
+ fileType(name) {
95
+ const extension = name.split('.').pop();
96
+ return extension && extension !== name ? extension.toUpperCase() : i18next.t('upload.file_type_fallback');
97
+ }
98
+ /** Human-readable file size (matches the mockup's "14.6 KB" style). */
99
+ formatSize(bytes) {
100
+ if (bytes < 1024)
101
+ return `${bytes} B`;
102
+ const units = ['KB', 'MB', 'GB'];
103
+ let size = bytes / 1024;
104
+ let unit = 0;
105
+ while (size >= 1024 && unit < units.length - 1) {
106
+ size /= 1024;
107
+ unit++;
108
+ }
109
+ return `${size.toFixed(1)} ${units[unit]}`;
110
+ }
67
111
  /**
68
112
  *
69
113
  * Render method
70
114
  *
71
115
  */
72
116
  render() {
73
- return (h(Host, { key: '4711c053e354bac32778220913800e9ddbeea4ae', class: { dragging: this.dragging } }, h("form", { key: 'bc38c6da6d342dbec11724ada061a136ce5e8ec9', id: "form", ref: (form) => (this.form = form) }, h("div", { key: '7823a9d8b9687a3dd4614a6de2d8ce9ed9e105a9', id: "header" }, h("ezp-icon", { key: '0cfe322cd35d84ca5dd55d03c2e9f485d61c36fc', name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { key: '54408d9e0b2bc3837dbda634c8f0d1980cd9ca13', weight: "strong", text: i18next.t('upload.description') }), h("div", { key: '2c205310172c020fff181af64aa2b2d01b8c14a3', id: "meta" }, h("ezp-label", { key: '5d66adb460bcaa82a0f2bdff02e4bef61c926471', level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { key: 'eb84ebab2edf72fabab9c818d609a93a0dd531d5', htmlFor: "input", id: "select" }, h("ezp-label", { key: '8daed6c65c7ba63b741d958e824e2c5e5cdc402f', level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { key: 'bdc526e6393100006423e1e7fe2eacc4c7ba1984', type: "file", name: "input", id: "input", multiple: true, ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { key: '7126b66e7fa542bb4566e1b2af1a03357da08cf3', level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.selectedFiles.length > 0 && (h(Fragment, null, h("ezp-label", { key: 'e0334c3a4378db13dbcf755b79564b7ecbe3630e', level: "secondary", text: i18next.t('upload.selected_files') }), h("div", { key: 'aaa7963218870cd372b67b48d7e73945f39b062a', id: "file-list" }, this.selectedFiles.map((file, index) => (h("div", { key: index, class: "file-item" }, h("div", { class: "file-name" }, h("ezp-label", { level: "tertiary", text: file.name })), h("div", { class: "file-remove" }, h("ezp-icon-button", { icon: "close", type: "button", level: "tertiary", onClick: (event) => this.removeFile(event, index) }))))))))))));
117
+ const hasFiles = this.selectedFiles.length > 0;
118
+ return (h(Host, { key: '80a675de624854f74f5996c37d24aff661d5f9e3', class: { dragging: this.dragging } }, h("form", { key: '4d301b144501b7ec147942a9e17f3bf25dea2d11', id: "form", ref: (form) => (this.form = form) }, h("input", { key: '65a6ba2d294fb77c8de9dba0ea9a5174b44d21a2', type: "file", name: "input", id: "input", multiple: true, "aria-label": i18next.t('upload.description'), ref: (input) => (this.input = input), onInput: this.handleInput }), h("div", { key: '42837b813a19478cc44007e05c1171a0cd8569a6', id: "modal" }, h("div", { key: '23243241f17024bde96c98f415dca2696f34d4ee', id: "header" }, h("ezp-label", { key: 'f3b41b967b6632e79d8bee2af682fc6d97685223', id: "heading", weight: "heavy", text: i18next.t('upload.heading') }), h("ezp-icon-button", { key: '9b239f06f0c75cede6a5312f2913f002441064a4', icon: "close", type: "button", level: "tertiary", onClick: this.clearSelection })), h("div", { key: '3c04a276ef24b3763a3ca0638d031dd8c1705300', id: "dropzone" }, hasFiles && (h("div", { key: '95610c71e57beccf2f6457dee6120952a1f924c7', id: "thumbs" }, this.selectedFiles.map((file, index) => (h("div", { key: index, class: "thumb" }, h("button", { type: "button", class: "thumb-remove", "aria-label": i18next.t('button_actions.close'), onClick: (event) => this.removeFile(event, index) }, h("ezp-icon", { name: "close" })), h("div", { class: "thumb-icon" }, h("ezp-icon", { name: "file" })), h("ezp-label", { class: "thumb-name", ellipsis: true, text: file.name }), h("ezp-label", { class: "thumb-meta", level: "tertiary", weight: "strong", text: `${this.fileType(file.name)} · ${this.formatSize(file.size)}` })))), h("label", { key: 'f4126b83f2947acbe861febb7a36a3adb9083022', htmlFor: "input", class: "thumb thumb-add" }, h("div", { key: '74d6094429e62377fa64a6b9dd69fb112f61807e', class: "thumb-add-icon" }, h("ezp-icon", { key: 'ed4ba315c9f03f63c3a459d887df2fa0d151339a', name: "plus" })), h("ezp-label", { key: '945c95ded15e1449c0c07fab74fa8bddfc1f712a', class: "thumb-name", level: "tertiary", text: i18next.t('upload.add_more') })))), !hasFiles && (h("div", { key: '3f177a95ddb406beaf4590d14e80979d61f47ef0', id: "cloud" }, h("ezp-icon", { key: 'df1646e18945ed7ae06e5768aa38ac5a41ece898', name: "cloud-upload" }))), h("ezp-label", { key: 'ac690849856ef1f333ac07977bf037c50bf932b2', id: "dropzone-title", weight: "heavy", text: i18next.t('upload.dropzone_title') }), h("div", { key: '75450a0a252eb1d89f712694b5a2c53f2af49716', id: "meta" }, h("ezp-label", { key: 'f2a47822f778492be7dae45b34201b42b11529e2', level: "secondary", text: i18next.t('upload.meta_leading') }), h("label", { key: '1da677a25803eb46551dc6073af83ab2280f0f25', htmlFor: "input", id: "browse" }, h("ezp-label", { key: 'f3ccd35677e9c982455f7cc0602e82722f181912', level: "secondary", weight: "strong", text: i18next.t('upload.browse') })), h("ezp-label", { key: '72033ea8583a30304523156e70db582dea34949a', level: "secondary", text: i18next.t('upload.meta_multiple') })), h("div", { key: 'e366576f4a0f553b879e15596eaa8abee39268b4', id: "formats" }, SUPPORTED_FORMATS.map((format) => (h("span", { class: "format", key: format }, format))))), hasFiles && (h("ezp-label", { key: '1d3286a144d9a18117b5c8ff656df8ca60d14287', id: "ready", level: "secondary", weight: "strong", text: i18next.t('upload.files_ready', { count: this.selectedFiles.length }) })), h("div", { key: '9508e04611014e3308b3552ac022dd35fe089f94', id: "footer" }, h("ezp-text-button", { key: '140f08816c3ed3474dd1485d07635090a55f6042', type: "button", level: "secondary", onClick: this.clearSelection, label: i18next.t('button_actions.cancel'), class: "action" }), h("ezp-text-button", { key: 'edd9ecceff3efa596bc2fb1073a26b1e8915b283', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: i18next.t('upload.continue'), class: "action" }))))));
74
119
  }
75
120
  static get is() { return "ezp-upload"; }
76
121
  static get encapsulation() { return "shadow"; }
@@ -99,12 +144,37 @@ export class EzpUpload {
99
144
  "composed": true,
100
145
  "docs": {
101
146
  "tags": [],
102
- "text": "\nEvents"
147
+ "text": "Keeps the parent's file state in sync as the selection changes."
148
+ },
149
+ "complexType": {
150
+ "original": "File[]",
151
+ "resolved": "File[]",
152
+ "references": {
153
+ "File": {
154
+ "location": "global",
155
+ "id": "global::File"
156
+ }
157
+ }
158
+ }
159
+ }, {
160
+ "method": "uploadContinue",
161
+ "name": "uploadContinue",
162
+ "bubbles": true,
163
+ "cancelable": true,
164
+ "composed": true,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": "Fired when the user confirms the selection and wants to move on to print options."
103
168
  },
104
169
  "complexType": {
105
- "original": "any",
106
- "resolved": "any",
107
- "references": {}
170
+ "original": "File[]",
171
+ "resolved": "File[]",
172
+ "references": {
173
+ "File": {
174
+ "location": "global",
175
+ "id": "global::File"
176
+ }
177
+ }
108
178
  }
109
179
  }];
110
180
  }
@@ -46,7 +46,8 @@
46
46
  :host(.is-open) {
47
47
  --ezp-userMenu-opacity: 1;
48
48
  --ezp-userMenu-scale: 1, 1;
49
- --ezp-userMenu-transition: opacity var(--ezp-duration-3) var(--ezp-easing-out-quart),
49
+ --ezp-userMenu-transition:
50
+ opacity var(--ezp-duration-3) var(--ezp-easing-out-quart),
50
51
  transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s 0s;
51
52
  --ezp-userMenu-visibility: visible;
52
53
  }