@ezeep/ezeep-js 1.0.294 → 1.0.306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cjs/ezeep.cjs.js +1 -1
  2. package/dist/cjs/{ezp-auth_15.cjs.entry.js → ezp-auth_16.cjs.entry.js} +674 -110
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +1 -0
  5. package/dist/collection/components/ezp-file-name/ezp-file-name.css +98 -0
  6. package/dist/collection/components/ezp-file-name/ezp-file-name.js +411 -0
  7. package/dist/collection/components/ezp-icon/ezp-icon.js +1 -1
  8. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
  9. package/dist/collection/components/ezp-input/ezp-input.js +1 -1
  10. package/dist/collection/components/ezp-label/ezp-label.js +39 -1
  11. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +31 -3
  12. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +243 -90
  13. package/dist/collection/components/ezp-printing/ezp-printing.js +20 -2
  14. package/dist/collection/components/ezp-select/ezp-select.js +1 -1
  15. package/dist/collection/components/ezp-status/ezp-status.js +2 -2
  16. package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
  17. package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
  18. package/dist/collection/components/ezp-upload/ezp-upload.css +26 -1
  19. package/dist/collection/components/ezp-upload/ezp-upload.js +14 -3
  20. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
  21. package/dist/collection/shared/storage.js +39 -9
  22. package/dist/collection/types/shared/types.d.ts +2 -0
  23. package/dist/collection/utils/printer.js +75 -1
  24. package/dist/collection/utils/utils.js +29 -0
  25. package/dist/components/auth.js +1 -1
  26. package/dist/components/ezp-file-name.d.ts +11 -0
  27. package/dist/components/ezp-file-name.js +1 -0
  28. package/dist/components/ezp-file-name2.js +1 -0
  29. package/dist/components/ezp-icon-button2.js +1 -1
  30. package/dist/components/ezp-icon2.js +1 -1
  31. package/dist/components/ezp-input2.js +1 -1
  32. package/dist/components/ezp-label2.js +1 -1
  33. package/dist/components/ezp-printer-selection2.js +1 -1
  34. package/dist/components/ezp-printing.js +1 -1
  35. package/dist/components/ezp-select2.js +1 -1
  36. package/dist/components/ezp-status2.js +1 -1
  37. package/dist/components/ezp-stepper2.js +1 -1
  38. package/dist/components/ezp-text-button2.js +1 -1
  39. package/dist/components/ezp-upload2.js +1 -1
  40. package/dist/components/ezp-user-menu2.js +1 -1
  41. package/dist/components/utils.js +1 -1
  42. package/dist/directives/proxies.ts +38 -4
  43. package/dist/esm/ezeep.js +1 -1
  44. package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +674 -111
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm-es5/ezeep.js +1 -1
  47. package/dist/esm-es5/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +2 -2
  48. package/dist/esm-es5/loader.js +1 -1
  49. package/dist/ezeep/ezeep.esm.js +1 -1
  50. package/dist/ezeep/p-646c1d42.entry.js +1 -0
  51. package/dist/ezeep/p-8e2d88a9.system.entry.js +7 -0
  52. package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
  53. package/dist/ezeep/types/shared/types.d.ts +2 -0
  54. package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +125 -0
  55. package/dist/types/components/ezp-label/ezp-label.d.ts +10 -0
  56. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +48 -2
  57. package/dist/types/components/ezp-printing/ezp-printing.d.ts +9 -2
  58. package/dist/types/components/ezp-upload/ezp-upload.d.ts +4 -0
  59. package/dist/types/components.d.ts +82 -3
  60. package/dist/types/shared/storage.d.ts +18 -4
  61. package/dist/types/shared/types.d.ts +2 -0
  62. package/dist/types/utils/printer.d.ts +18 -0
  63. package/dist/types/utils/utils.d.ts +20 -1
  64. package/package.json +1 -1
  65. package/www/build/ezeep.esm.js +1 -1
  66. package/www/build/p-646c1d42.entry.js +1 -0
  67. package/www/build/p-70951744.js +1 -0
  68. package/www/build/p-8e2d88a9.system.entry.js +7 -0
  69. package/www/build/p-DCznw2Ee.system.js +1 -1
  70. package/www/index.html +1 -1
  71. package/dist/ezeep/p-3ab5a223.entry.js +0 -1
  72. package/dist/ezeep/p-fe700ca4.system.entry.js +0 -7
  73. package/www/build/p-3ab5a223.entry.js +0 -1
  74. package/www/build/p-65242d5e.js +0 -1
  75. package/www/build/p-fe700ca4.system.entry.js +0 -7
@@ -127,7 +127,7 @@ export class EzpStepper {
127
127
  *
128
128
  */
129
129
  render() {
130
- return (h(Host, { key: 'cdb3aa8969719def6546f35fac5aa35b47c1f94b', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { key: '4b0edee6d156edc6e8f79eb0639be4203b12fc5b', id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '4fb1d96f12933ee37c05afafee8f313d77a06e9e', id: "label", noWrap: true, text: this.label }), h("div", { key: '3be9bb50e25876cecf351632e002bc37474a12df', class: "buttons" }, h("button", { key: '77fdb0f15d4b54a820a7c4329b2f49ac2bef832e', class: "button", type: "button", "aria-label": `Decrease ${this.label}`, disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { key: '76cc4d8fefdb61a9ad66aa63fe36414093207ef5', name: "minus" })), h("input", { key: 'fab279a99fb1803fc8095c881f6d43233a12de6b', 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: 'fa0ad31ae7a0481d4ca173211ae2796a6ef5e805', class: "button", type: "button", "aria-label": `Increase ${this.label}`, disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { key: '98bb7417e464e4d5704d8f5d4f969a11d0c70fcf', name: "plus" })))));
130
+ return (h(Host, { key: 'cbf3ded61537359ed280a204bb71240d0a34473a', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { key: '1c7a265f60d06dbea4a80e19ecdaa4a10aed694c', id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '9fd0e1128480dd9b288cb266542fd4e6b83ceebd', id: "label", noWrap: true, text: this.label }), h("div", { key: '975fc0539e76750d7457c71d40f228cb5ebcaad8', class: "buttons" }, h("button", { key: 'db01d05fdcbc4eda2810751ace0194d9a1ec9eb7', class: "button", type: "button", "aria-label": `Decrease ${this.label}`, disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { key: '7d938efa8426caf292403e94e3565d20dc40d121', name: "minus" })), h("input", { key: 'dbff518a5d1f28b3b23d597947c250bef71fd68a', id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max !== undefined ? this.max.toString() : undefined, value: this.value.toString(), "aria-label": this.label, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), h("button", { key: 'b3001bb27f94f65fce51d3a69d7713e5da9ccdcc', class: "button", type: "button", "aria-label": `Increase ${this.label}`, disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { key: '534bb499fa2ced2591ccbc137186e59d22aa2f5f', name: "plus" })))));
131
131
  }
132
132
  static get is() { return "ezp-stepper"; }
133
133
  static get encapsulation() { return "shadow"; }
@@ -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: 'eded3e128d17f4b5bf5a29b01e51f4a2ba1d6d74', id: "button", "aria-label": this.label }, attributes), h("ezp-label", { key: '4974381f385143ac4828f74c580ef280357e85ac', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
34
+ return (h(Host, { key: '31c3726d82b340fad817eec01f597b58702ff292', class: `${this.level}` }, h(TagType, Object.assign({ key: '5e26c8e81ab49575b1a29c309f7792a2286ee455', id: "button", "aria-label": this.label }, attributes), h("ezp-label", { key: 'b21b121c9da908b6cba286a528f8e6772c179a36', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
35
35
  }
36
36
  static get is() { return "ezp-text-button"; }
37
37
  static get encapsulation() { return "shadow"; }
@@ -177,10 +177,33 @@
177
177
  * File list
178
178
  *
179
179
  */
180
+ /* The tallest thing in a row is its remove button (`.file-remove`). */
181
+ /* Deliberately not `overflow: hidden` — that would clip a row's tooltip. Only
182
+ `#add-more` paints to the edge, so it rounds its own corners instead.
183
+
184
+ Anchors the file names' tooltips, so they can span the row. It sits outside
185
+ the scrolling list on purpose: a scroll container clips the absolutely
186
+ positioned boxes anchored inside it, but not those anchored beyond it. The
187
+ names measure where their row is when the tooltip opens (`anchor="parent"`). */
180
188
  #files {
181
189
  border: 1px solid var(--ezp-core-outline);
182
190
  border-radius: 12px;
183
- overflow: hidden;
191
+ position: relative;
192
+ }
193
+
194
+ /* Scrolls on its own, so loading more files never makes the card — or the
195
+ window around it — taller. "Add more files" stays below it, in reach. Half
196
+ of a fifth row shows at the bottom, which tells the list goes on, and each
197
+ row after the first adds its 1px divider. `max-height` rather than
198
+ `height`, so a short list looks the same as before. */
199
+ #file-list {
200
+ /* Rounds its own top corners, which the scrollbar would otherwise cover. */
201
+ border-radius: 11px 11px 0 0;
202
+ max-height: var(--ezp-upload-fileList-maxHeight, calc(4.5 * calc(28px + 2 * var(--ezp-spacing-3)) + 4px));
203
+ /* Long names are truncated by `ezp-file-name`; nothing scrolls sideways. */
204
+ overflow-x: hidden;
205
+ overflow-y: auto;
206
+ scrollbar-width: thin;
184
207
  }
185
208
 
186
209
  .file {
@@ -188,6 +211,7 @@
188
211
  display: grid;
189
212
  gap: var(--ezp-spacing-3);
190
213
  grid-template-columns: auto minmax(0, 1fr) auto;
214
+ min-height: calc(28px + 2 * var(--ezp-spacing-3));
191
215
  padding: var(--ezp-spacing-3) var(--ezp-spacing-4);
192
216
  }
193
217
 
@@ -255,6 +279,7 @@
255
279
  appearance: none;
256
280
  background: var(--ezp-upload-addMore-background, transparent);
257
281
  border: 0;
282
+ border-radius: 0 0 11px 11px;
258
283
  border-top: 1px solid var(--ezp-core-outline);
259
284
  color: var(--ezp-theme-solid);
260
285
  cursor: pointer;
@@ -1,5 +1,5 @@
1
1
  import { Host, h } from "@stencil/core";
2
- import { subscribeToLanguageChange } from "../../utils/utils";
2
+ import { firstVisibleChild, subscribeToLanguageChange } from "../../utils/utils";
3
3
  import i18next from "i18next";
4
4
  /** File formats advertised to the user as supported for printing. */
5
5
  const SUPPORTED_FORMATS = ['PDF', 'DOCX', 'PNG', 'JPG', 'XLSX'];
@@ -12,6 +12,9 @@ export class EzpUpload {
12
12
  */
13
13
  this.selectedFiles = [];
14
14
  this.dragging = false;
15
+ /** First row of the file list that is at least partly in view. Its tooltip
16
+ * opens downwards, as there is no list left above it to cover. */
17
+ this.firstVisibleFile = 0;
15
18
  /**
16
19
  *
17
20
  * Listeners
@@ -67,6 +70,12 @@ export class EzpUpload {
67
70
  // `printCancel` listener resets the form and the selection.
68
71
  this.printCancel.emit();
69
72
  };
73
+ this.handleFilesScroll = (event) => {
74
+ const first = firstVisibleChild(event.currentTarget);
75
+ // Scroll fires every frame; only a change of row is worth a render.
76
+ if (first >= 0 && first !== this.firstVisibleFile)
77
+ this.firstVisibleFile = first;
78
+ };
70
79
  this.handleContinue = () => {
71
80
  if (this.selectedFiles.length === 0)
72
81
  return;
@@ -119,6 +128,7 @@ export class EzpUpload {
119
128
  var _a;
120
129
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
121
130
  this.selectedFiles = [];
131
+ this.firstVisibleFile = 0;
122
132
  this.resetDrag();
123
133
  }
124
134
  fileKey(file) {
@@ -152,7 +162,7 @@ export class EzpUpload {
152
162
  */
153
163
  render() {
154
164
  const hasFiles = this.selectedFiles.length > 0;
155
- return (h(Host, { key: '4230fcbee5d8a20d79c05035a1783f16696a66fa', class: { dragging: this.dragging } }, h("form", { key: '5dcae80d94508ebe05e3dc8df463b0a1b79563ff', id: "form", ref: (form) => (this.form = form) }, h("input", { key: '480307c4fdbe7a39ba3872bce7cf905888f7946b', type: "file", name: "input", id: "input", multiple: true, "aria-label": i18next.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), h("div", { key: '95a58113221f2337323f0b6df3d58e459fdece2c', id: "modal" }, h("div", { key: '876b5ebe74d685b2ec7196df3deb8a9fd5437305', id: "body-frame" }, h("div", { key: '15465aeb4e939ce26b09d1a1c4f9b9b5d8901762', id: "body" }, !hasFiles && (h("div", { key: '912e27683e12d3d8ca999b4c3dbe1f528677aafd', id: "dropzone" }, h("ezp-icon", { key: '8cb1edf6b5c14a7815e52f7bc91d674047045e57', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '678ea4205fbe81d3621dc205303533eb8c12ce23', id: "dropzone-title", level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') }), h("div", { key: '0fcd25bb9f12c1cd0c056d88cf94a20946b44f2a', id: "dropzone-prompt" }, h("ezp-text-button", { key: '5cc5ff7a98f87ae1eb2db4009435b926924be2e9', id: "choose", type: "button", onClick: this.openPicker, label: i18next.t('upload.choose_files') }), h("ezp-label", { key: 'b64fe2cadd1639c5ef0b10da0084d420abd8232f', id: "drag-hint", level: "secondary", weight: "strong", text: i18next.t('upload.drag_hint') }), h("ezp-label", { key: '5bf5178e691d35a58e988bacff656bd790f4c6ea', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '289ce054d8987ba1d2a5c6481171dce341dd1e5c', id: "files" }, this.selectedFiles.map((file, index) => (h("div", { key: this.fileKey(file), class: "file" }, h("span", { class: "file-type", "aria-hidden": "true" }, this.fileType(file.name)), h("div", { class: "file-details" }, h("ezp-label", { class: "file-name", ellipsis: true, weight: "heavy", text: file.name }), h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), h("button", { type: "button", class: "file-remove", "aria-label": i18next.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index) }, h("ezp-icon", { name: "close" }))))), h("button", { key: 'd0b397071945aadecde0a92b9a9e36a40a612197', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: 'cd89350e28759f3d2b4553367ff6c6f4eaf07dfc', name: "plus" }), h("ezp-label", { key: '0f959da4e971ad6520563d892afb086b1a3df5a4', level: "secondary", weight: "heavy", text: i18next.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: 'd767d3dc25ce56b85dd0b3dcacf88a6fa4e420e1', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: 'fefa5a29b5bd2df98b5d9fedfce2e6800418544f', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '7ef3bba07de86ecefa094617f6262f47875db36a', level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') })))), h("div", { key: 'd7b1f67053bd4e0eef8d271eb7c3e547d4d40af3', id: "footer" }, h("ezp-text-button", { key: 'c0195d9ba0012a5297254eae8d60dc90337eb7a1', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: i18next.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: '154a5770c232fadd7befd1af09c26cbe5d143f36', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: i18next.t('upload.continue'), class: "action" }))))));
165
+ return (h(Host, { key: '647c38e3dd42274be594a2fd5eb668943cd37256', class: { dragging: this.dragging } }, h("form", { key: 'a0af9e0bb32e8460b0b86bd897913a1c434747a8', id: "form", ref: (form) => (this.form = form) }, h("input", { key: 'd687034216a6e03a484fdd4462a7e2817675237c', type: "file", name: "input", id: "input", multiple: true, "aria-label": i18next.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), h("div", { key: '82a76ba0258746bc552afc03c500a563c698e821', id: "modal" }, h("div", { key: 'a6113ba410cf3985ad64fa9300cf4e9ef2182e4f', id: "body-frame" }, h("div", { key: 'd9af36800ce744146c43a7e99f289413e13b9ae3', id: "body" }, !hasFiles && (h("div", { key: 'df98d670f9c0498597f414158108c38265b59b90', id: "dropzone" }, h("ezp-icon", { key: '0202221de58ae709f5823501cfce1bc9d1087136', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '9cbb60bc48f9e74af2c613d8c83a973e984ce824', id: "dropzone-title", level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') }), h("div", { key: 'ccaef599519bf24af543f4727fb4c1a62338b9df', id: "dropzone-prompt" }, h("ezp-text-button", { key: 'f084bb66ff63e9448cb6e7aea1782d8d2c9914b3', id: "choose", type: "button", onClick: this.openPicker, label: i18next.t('upload.choose_files') }), h("ezp-label", { key: 'f5e7bd5219637c13cc0f9ad97ab42a14d35aa601', id: "drag-hint", level: "secondary", weight: "strong", text: i18next.t('upload.drag_hint') }), h("ezp-label", { key: 'd5334e1e3aaaaaf9a7abb4be38a27226f73a162a', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '9eaec0f2ddb0f2ca4679e4a314afb2b42c211a17', id: "files" }, h("div", { key: 'bc990a270c2432c8237b75eebc9d4881a6bb856e', id: "file-list", onScroll: this.handleFilesScroll }, this.selectedFiles.map((file, index) => (h("div", { key: this.fileKey(file), class: "file", "data-tooltip-row": true }, h("span", { class: "file-type", "aria-hidden": "true" }, this.fileType(file.name)), h("div", { class: "file-details" }, h("ezp-file-name", { class: "file-name", weight: "heavy", name: file.name, anchor: "parent", placement: index === this.firstVisibleFile ? 'bottom' : 'top' }), h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), h("button", { type: "button", class: "file-remove", "aria-label": i18next.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index) }, h("ezp-icon", { name: "close" })))))), h("button", { key: 'd22584a56b417545260c5b8c2210a6c62b59426e', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: '1313f4255c6a58e58d04b0188153ec815ce6b938', name: "plus" }), h("ezp-label", { key: 'deadcecb7b733c33a3990802a4ebf6b84726b48e', level: "secondary", weight: "heavy", text: i18next.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: '20bf6c68fd28c8de0b63b88aad24f1ab63d25ac3', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: '135896652629a8eba574c21af1af20ba6722ad5d', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '03921a166561ce06af4fce3abcd1f812738844f5', level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') })))), h("div", { key: '2d1e16e9e8ca950e1e968ca12939a245f7618adc', id: "footer" }, h("ezp-text-button", { key: '6a776b09c068982932225a4903df003e8a89b20a', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: i18next.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: 'ca872a7d7834191001faef1140dbd344566ed79d', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: i18next.t('upload.continue'), class: "action" }))))));
156
166
  }
157
167
  static get is() { return "ezp-upload"; }
158
168
  static get encapsulation() { return "shadow"; }
@@ -169,7 +179,8 @@ export class EzpUpload {
169
179
  static get states() {
170
180
  return {
171
181
  "selectedFiles": {},
172
- "dragging": {}
182
+ "dragging": {},
183
+ "firstVisibleFile": {}
173
184
  };
174
185
  }
175
186
  static get events() {
@@ -84,7 +84,7 @@ export class EzpUserMenu {
84
84
  *
85
85
  */
86
86
  render() {
87
- return (h(Host, { key: '3d13f203651146743cf8ac7754764e37d5cead30', class: this.open ? 'is-open' : '' }, h("div", { key: '28c08e6068d25a96d385553491edfcec25e516d3', id: "header" }, h("ezp-label", { key: '45881a8cff5d1efbbae133cd13206120c2ae17da', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '92205d9008c0d3a68989ea8bca24c481b1542716', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '4ef631425b38ed208f5e55446525c45943e6dfee', id: "links" }, this.links.map((link) => (h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, h("ezp-icon", { class: "link__icon", name: link.icon }), h("ezp-label", { text: link.title })))), h("a", { key: '85e8603a60e7150458e31cc20bbaa99a0f024636', class: "link", onClick: this.logOut }, h("ezp-icon", { key: 'c96a13aeb65e645e7180c469d9168550d6bfaee2', class: "link__icon", name: "logout" }), h("ezp-label", { key: '1aa825d659ffedd8318016540716c88a27f4f75b', text: i18next.t('user_menu.logout') }))), h("div", { key: 'c7d2c25bebb2601c34215766b2e85359834e16f7', id: "theme" }, h("ezp-label", { key: 'e39f708172868841fd5d043dc6d8466a4db71405', class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '26dc2c26d4408c0cb03d0e2fbd4954744eb2ada4', id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, h("span", { class: "dot" })))))), h("div", { key: 'ed62f9a441fd9eb464699c8cfdc277148b471bf8', id: "appearance" }, h("ezp-label", { key: '6b21204284c739cc00d79caca622f892d44a6889', class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: 'fcd9dcf68b857b6b22b7617dd999c7137ab04c9e', id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, h("ezp-icon", { name: appearance.name }), h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
87
+ return (h(Host, { key: 'a6967dc3eb3b13630dbf652681c6c5c1f769f584', class: this.open ? 'is-open' : '' }, h("div", { key: '5cbf232927f4b26c1c05b01a6025b5f33fe3bfaa', id: "header" }, h("ezp-label", { key: '83987303c029d9d01f42d5d817edaf6c72629513', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '45a64f18578adf35aeb824e393a359368e32e35a', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '8bd44e5b32662baad24ee9a39abca4e772b0ef4b', id: "links" }, this.links.map((link) => (h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, h("ezp-icon", { class: "link__icon", name: link.icon }), h("ezp-label", { text: link.title })))), h("a", { key: '64f041741f7760f85dd5090d0c9feebd7dec3289', class: "link", onClick: this.logOut }, h("ezp-icon", { key: 'bd0beefa519acb37328d9c3fd33c4286ff7e1ddc', class: "link__icon", name: "logout" }), h("ezp-label", { key: 'a37c8e9ffc43d0d89fe4d5dadf1dde5e36155074', text: i18next.t('user_menu.logout') }))), h("div", { key: 'ad74827637906199b94f61d5f617fcaa9044c553', id: "theme" }, h("ezp-label", { key: 'c420ad169436c96acd4add9951e02f2d6fd43240', class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '04d383554f2cdfd6b7864c3e23295e2bc6f244b8', id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, h("span", { class: "dot" })))))), h("div", { key: '4e40758f22b322cbcd3d26054c6c4801c555430a', id: "appearance" }, h("ezp-label", { key: '3034f9eaa028ce4928c8bf2c36dc223b98eba45d', class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: 'dfa6a115e24db557891295f3a8e1ab1cfa4332f0', id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, h("ezp-icon", { name: appearance.name }), h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
88
88
  }
89
89
  static get is() { return "ezp-user-menu"; }
90
90
  static get encapsulation() { return "shadow"; }
@@ -11,8 +11,10 @@ const KEY = {
11
11
  accessToken: 'access_token',
12
12
  refreshToken: 'refreshToken',
13
13
  isAuthorized: 'isAuthorized',
14
+ /** Legacy single-printer settings blob, read once to seed `printerSettings`. */
14
15
  properties: 'properties',
15
16
  printer: 'printer',
17
+ printerSettings: 'printerSettings',
16
18
  };
17
19
  function getJSON(key) {
18
20
  const raw = localStorage.getItem(key);
@@ -43,29 +45,57 @@ export const storage = {
43
45
  hasIsAuthorized() {
44
46
  return localStorage.getItem(KEY.isAuthorized) !== null;
45
47
  },
46
- getProperties() {
47
- return getJSON(KEY.properties);
48
+ /**
49
+ * Settings the user last printed with on `printerId`, or null if that printer
50
+ * has none yet. Kept per printer so switching printers never carries another
51
+ * printer's paper size or tray over to one that may not have it.
52
+ */
53
+ getPrinterSettings(printerId) {
54
+ var _a;
55
+ return (_a = readPrinterSettings()[printerId]) !== null && _a !== void 0 ? _a : null;
48
56
  },
49
- setProperties(properties) {
50
- localStorage.setItem(KEY.properties, JSON.stringify(properties));
57
+ setPrinterSettings(printerId, properties) {
58
+ const all = readPrinterSettings();
59
+ all[printerId] = properties;
60
+ localStorage.setItem(KEY.printerSettings, JSON.stringify(all));
51
61
  },
62
+ /** The printer used for the last print, preselected when the dialog reopens. */
52
63
  getPrinter() {
53
64
  return getJSON(KEY.printer);
54
65
  },
55
66
  setPrinter(printer) {
56
67
  localStorage.setItem(KEY.printer, JSON.stringify(printer));
57
68
  },
58
- /** Remove everything tied to the current session (used on logout). */
69
+ /**
70
+ * Remove everything tied to the current session (used on logout).
71
+ *
72
+ * Print settings and the last printer deliberately survive: they belong to
73
+ * this browser profile rather than to the session, and are validated against
74
+ * the signed-in user's printers on the next load (an unknown printer resets
75
+ * the selection), so the next user never inherits a selection they can't use.
76
+ */
59
77
  clearSession() {
60
- localStorage.removeItem(KEY.properties);
61
78
  localStorage.removeItem(KEY.refreshToken);
62
79
  localStorage.removeItem(KEY.accessToken);
63
- localStorage.removeItem(KEY.printer);
64
80
  localStorage.removeItem(KEY.isAuthorized);
65
81
  },
66
- /** Remove just the saved printer + its properties (used when the saved printer is gone). */
82
+ /** Forget which printer was last used (when it is gone from the user's list).
83
+ * Its settings stay put, ready in case that printer comes back. */
67
84
  clearSavedPrinter() {
68
85
  localStorage.removeItem(KEY.printer);
69
- localStorage.removeItem(KEY.properties);
70
86
  },
71
87
  };
88
+ /**
89
+ * Read the per-printer settings map, seeding it once from the pre-upgrade
90
+ * single-printer blob so a user who already printed keeps those settings.
91
+ */
92
+ function readPrinterSettings() {
93
+ const stored = getJSON(KEY.printerSettings);
94
+ if (stored)
95
+ return stored;
96
+ const legacy = getJSON(KEY.properties);
97
+ const legacyPrinter = getJSON(KEY.printer);
98
+ if (legacy && (legacyPrinter === null || legacyPrinter === void 0 ? void 0 : legacyPrinter.id))
99
+ return { [legacyPrinter.id]: legacy };
100
+ return {};
101
+ }
@@ -52,6 +52,8 @@ export type TextButtonLevelTypes = 'primary' | 'secondary' | 'tertiary'
52
52
  export type TextButtonTypeTypes = 'button'
53
53
  export type LabelLevelTypes = 'primary' | 'secondary' | 'tertiary'
54
54
  export type WeightTypes = 'soft' | 'strong' | 'heavy'
55
+ export type TooltipPlacementTypes = 'top' | 'bottom'
56
+ export type TooltipAnchorTypes = 'container' | 'parent'
55
57
  export type ThemeTypes = 'pink' | 'red' | 'orange' | 'green' | 'teal' | 'cyan' | 'blue' | 'violet'
56
58
  export type AppearanceTypes = 'system' | 'light' | 'dark'
57
59
  export type TriggerTypes = 'custom' | 'file' | 'button'
@@ -1,4 +1,6 @@
1
- import { JobStatus, PROCESSING_JOB_STATUSES, FAILED_JOB_STATUSES, HUB_DRIVER_ERROR_CODES, } from "../shared/constants";
1
+ import { JobStatus, PROCESSING_JOB_STATUSES, FAILED_JOB_STATUSES, HUB_DRIVER_ERROR_CODES, PAPER_ID, } from "../shared/constants";
2
+ /** Duplex modes the dialog offers: none, long edge, short edge. */
3
+ const DUPLEX_MODES = [1, 2, 3];
2
4
  /**
3
5
  * Derive the default print properties for a printer from its configuration.
4
6
  *
@@ -41,6 +43,78 @@ export function applyPrinterDefaults(config, properties) {
41
43
  delete properties.PageRanges;
42
44
  return properties;
43
45
  }
46
+ /**
47
+ * Carry the settings the user last printed with on this printer over the
48
+ * printer's own defaults, dropping anything the printer can no longer do.
49
+ *
50
+ * Capabilities change between sessions — a printer loses a tray, an admin
51
+ * swaps the paper formats — and a stale value would otherwise be sent to the
52
+ * API or shown as a selection that isn't in the list. Each field is therefore
53
+ * only restored if the current config still offers it; everything else stays
54
+ * on the default `applyPrinterDefaults` just put in place. Copies and page
55
+ * ranges are never part of `saved`, so they are never restored.
56
+ */
57
+ export function applySavedProperties(config, saved, properties) {
58
+ var _a, _b, _c, _d, _e;
59
+ applyPrinterDefaults(config, properties);
60
+ if (!saved)
61
+ return properties;
62
+ if (config.ColorSupported && typeof saved.color === 'boolean') {
63
+ properties.color = saved.color;
64
+ }
65
+ if (config.DuplexSupported && DUPLEX_MODES.includes(Number(saved.duplexmode))) {
66
+ properties.duplex = true;
67
+ properties.duplexmode = Number(saved.duplexmode);
68
+ }
69
+ const paper = (_a = config.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((format) => format.Id === Number(saved.paperid));
70
+ if (paper) {
71
+ properties.paper = paper.Name;
72
+ properties.paperid = paper.Id;
73
+ // Only meaningful for the custom format, which carries its own dimensions.
74
+ if (paper.Id === PAPER_ID) {
75
+ properties.paperwidth = saved.paperwidth;
76
+ properties.paperlength = saved.paperlength;
77
+ }
78
+ }
79
+ // Orientations are offered as 1-based positions in `OrientationsSupported`.
80
+ const orientation = Number(saved.orientation);
81
+ if (orientation >= 1 && orientation <= ((_c = (_b = config.OrientationsSupported) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0)) {
82
+ properties.orientation = orientation;
83
+ }
84
+ if (typeof saved.resolution === 'string' && ((_d = config.Resolutions) === null || _d === void 0 ? void 0 : _d.includes(saved.resolution))) {
85
+ properties.resolution = saved.resolution;
86
+ }
87
+ if (hasTrays(config)) {
88
+ const tray = (_e = config.Trays) === null || _e === void 0 ? void 0 : _e.find((option) => (option === null || option === void 0 ? void 0 : option.Index) === Number(saved.defaultSource));
89
+ if (tray) {
90
+ properties.trayname = tray.Name;
91
+ properties.defaultSource = tray.Index;
92
+ }
93
+ }
94
+ return properties;
95
+ }
96
+ /**
97
+ * The slice of the current selection worth remembering for next time: what the
98
+ * print dialog offers per printer, minus copies and page ranges, which belong
99
+ * to the one document being printed rather than to the printer.
100
+ */
101
+ export function pickRememberedProperties(properties) {
102
+ const { color, duplex, duplexmode, paper, paperid, paperwidth, paperlength } = properties;
103
+ const { orientation, resolution, trayname, defaultSource } = properties;
104
+ return {
105
+ color,
106
+ duplex,
107
+ duplexmode,
108
+ paper,
109
+ paperid,
110
+ paperwidth,
111
+ paperlength,
112
+ orientation,
113
+ resolution,
114
+ trayname,
115
+ defaultSource,
116
+ };
117
+ }
44
118
  /** Does this printer config report an explicit "no usable trays" state? */
45
119
  export function hasNoTrays(config) {
46
120
  return !!config.Trays && config.Trays.length >= 0 && config.Trays[0] == null;
@@ -17,6 +17,35 @@ export function subscribeToLanguageChange(component) {
17
17
  i18next.on('languageChanged', rerender);
18
18
  return () => i18next.off('languageChanged', rerender);
19
19
  }
20
+ /** Index of the first child of a scroll container that is at least half in
21
+ * view, or -1 when it has none. Lists use it to open the topmost visible row's
22
+ * tooltip downwards, as nothing in the list is left above that row to cover.
23
+ * A row showing only a sliver doesn't count: the row below it is the one the
24
+ * user reads first, and that one should open downwards. */
25
+ export function firstVisibleChild(container) {
26
+ const top = container.getBoundingClientRect().top;
27
+ return Array.from(container.children).findIndex((child) => {
28
+ const rect = child.getBoundingClientRect();
29
+ return (rect.top + rect.bottom) / 2 > top;
30
+ });
31
+ }
32
+ /**
33
+ * Side a tooltip should open on, given where it was asked to open and the room
34
+ * there is. The requested side wins whenever the bubble fits there; otherwise
35
+ * it flips to the other side if that fits, or if that simply has more room.
36
+ * All values are in the same (screen) pixels.
37
+ */
38
+ export function pickTooltipSide(requested, row, needed, visible) {
39
+ const above = row.top - visible.top;
40
+ const below = visible.bottom - row.bottom;
41
+ const room = { top: above, bottom: below };
42
+ const other = requested === 'top' ? 'bottom' : 'top';
43
+ if (room[requested] >= needed)
44
+ return requested;
45
+ if (room[other] >= needed || room[other] > room[requested])
46
+ return other;
47
+ return requested;
48
+ }
20
49
  export function encodeFormData(data) {
21
50
  return Object.keys(data)
22
51
  .map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))
@@ -1 +1 @@
1
- import*as e from"@stencil/core/internal/client";import{h as t}from"./utils.js";const r=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const r=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(r=t))||r.isConnected);var r}));e.set(t,r)}})(...t)}),2e3)}})(),o=e.forceUpdate,s=e.getRenderingRef,n=(e,t)=>{const r=e.indexOf(t);r>=0&&(e[r]=e[e.length-1],e.length--)},i=(e,t)=>{const i=((e,t=(e,t)=>e!==t)=>{const r=()=>{return("function"==typeof(t=e)?t():t)??{};var t},o=r();let s=new Map(Object.entries(o));const i="undefined"!=typeof Proxy,c=i?null:{},a={dispose:[],get:[],set:[],reset:[]},h=new Map,l=()=>{s=new Map(Object.entries(r())),i||S(),a.reset.forEach((e=>e()))},u=e=>(a.get.forEach((t=>t(e))),s.get(e)),d=(e,r)=>{const o=s.get(e);t(r,o,e)&&(s.set(e,r),i||g(e),a.set.forEach((t=>t(e,r,o))))},f=i?new Proxy(o,{get:(e,t)=>u(t),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>s.has(t),set:(e,t,r)=>(d(t,r),!0)}):(S(),c),p=(e,t)=>(a[e].push(t),()=>{n(a[e],t)});function g(e){!i&&c&&(Object.prototype.hasOwnProperty.call(c,e)||Object.defineProperty(c,e,{configurable:!0,enumerable:!0,get:()=>u(e),set(t){d(e,t)}}))}function S(){if(i||!c)return;const e=new Set(s.keys());for(const t of Object.keys(c))e.has(t)||delete c[t];for(const t of e)g(t)}return{state:f,get:u,set:d,on:p,onChange:(e,t)=>{const o=(r,o)=>{r===e&&t(o)},s=()=>{const o=r();t(o[e])},n=p("set",o),i=p("reset",s);return h.set(t,{setHandler:o,resetHandler:s,propName:e}),()=>{n(),i(),h.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(p("set",t.set)),t.get&&e.push(p("get",t.get)),t.reset&&e.push(p("reset",t.reset)),t.dispose&&e.push(p("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{a.dispose.forEach((e=>e())),l()},reset:l,forceUpdate:e=>{const t=s.get(e);a.set.forEach((r=>r(e,t,t)))},removeListener:(e,t)=>{const r=h.get(t);r&&r.propName===e&&(n(a.set,r.setHandler),n(a.reset,r.resetHandler),h.delete(t))}}})(e,t);return i.use((()=>{if("function"!=typeof s||"function"!=typeof o)return{};const e=o,t=s,n=new Map;return{dispose:()=>n.clear(),get:e=>{const r=t();r&&((e,t,r)=>{let o=e.get(t);o||(o=[],e.set(t,o)),o.some((e=>e.deref()===r))||o.push(new WeakRef(r))})(n,e,r)},set:t=>{const o=n.get(t);if(o){const r=o.filter((t=>{const r=t.deref();return!!r&&e(r)}));n.set(t,r)}r(n)},reset:()=>{n.forEach((t=>{t.forEach((t=>{const r=t.deref();r&&e(r)}))})),r(n)}}})()),i},c="refreshToken",a="isAuthorized",h="properties",l="printer";function u(e){const t=localStorage.getItem(e);if(null===t)return null;try{return JSON.parse(t)}catch(e){return null}}const d={getRefreshToken:()=>localStorage.getItem(c),setRefreshToken(e){localStorage.setItem(c,e)},getIsAuthorized:()=>"true"===localStorage.getItem(a),setIsAuthorized(e){localStorage.setItem(a,e.toString())},hasIsAuthorized:()=>null!==localStorage.getItem(a),getProperties:()=>u(h),setProperties(e){localStorage.setItem(h,JSON.stringify(e))},getPrinter:()=>u(l),setPrinter(e){localStorage.setItem(l,JSON.stringify(e))},clearSession(){localStorage.removeItem(h),localStorage.removeItem(c),localStorage.removeItem("access_token"),localStorage.removeItem(l),localStorage.removeItem(a)},clearSavedPrinter(){localStorage.removeItem(l),localStorage.removeItem(h)}};class f{constructor(e,t){this.urlParams=new URLSearchParams,this.isAuthorized=!1,this.redirectURI=e,this.clientID=t,p.state.clientID=t,this.oauthUrl=p.state.authApiHostUrl,this.authURI=new URL(`https://${this.oauthUrl}/oauth/authorize/`),this.accessTokenURL=`https://${this.oauthUrl}/oauth/access_token/`}generateCodeVerifier(){if(""!==p.state.codeVerifier)this.codeVerifier=p.state.codeVerifier;else{const e=new Uint8Array(128),t=crypto.getRandomValues(e),r=btoa(t.toString()).substr(0,128);this.codeVerifier=r,p.state.codeVerifier=this.codeVerifier}}async generateCodeChallenge(e){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t),o=btoa(String.fromCharCode(...new Uint8Array(r)));this.codeChallenge=o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}buildAuthURI(){this.urlParams.append("response_type","code"),this.urlParams.append("client_id",this.clientID),this.urlParams.append("redirect_uri",this.redirectURI),this.urlParams.append("code_challenge",this.codeChallenge),this.urlParams.append("code_challenge_method","S256"),this.authURI.search=this.urlParams.toString(),p.state.authUri=this.authURI.toString()}oauthHeaders(){return{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"}}persistTokens(e,t){this.accessToken=e,p.state.accessToken=e,this.refreshToken=t,p.state.refreshToken=t,d.setRefreshToken(t),this.isAuthorized=!0,p.state.isAuthorized=!0,d.setIsAuthorized(!0)}getAccessToken(){return fetch(this.accessTokenURL,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({grant_type:"authorization_code",scope:"printing",code:p.state.code,redirect_uri:this.redirectURI,code_verifier:p.state.codeVerifier})}).then((e=>e.json())).then((e=>{e.access_token&&this.persistTokens(e.access_token,e.refresh_token)}))}refreshTokens(){return fetch(this.accessTokenURL,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({grant_type:"refresh_token",scope:"printing",refresh_token:p.state.refreshToken})}).then((e=>e.json())).then((e=>{e.access_token&&this.persistTokens(e.access_token,e.refresh_token)}))}revokeRefreshToken(){p.state.refreshToken&&fetch(`https://${this.oauthUrl}/oauth/revoke/`,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({token:p.state.refreshToken})}).catch((()=>{}))}}const p=i({code:"",codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:!1,devApi:!1,authApiHostUrl:"",redirectUri:"",authUri:"",clientID:""});function g(){const e=new URLSearchParams(window.location.search).get("code");window.opener&&e&&(window.opener.postMessage(e,p.state.redirectUri),window.close())}export{f as E,p as a,g as b,i as c,d as s}
1
+ import*as e from"@stencil/core/internal/client";import{k as t}from"./utils.js";const r=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const r=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(r=t))||r.isConnected);var r}));e.set(t,r)}})(...t)}),2e3)}})(),n=e.forceUpdate,o=e.getRenderingRef,s=(e,t)=>{const r=e.indexOf(t);r>=0&&(e[r]=e[e.length-1],e.length--)},i=(e,t)=>{const i=((e,t=(e,t)=>e!==t)=>{const r=()=>{return("function"==typeof(t=e)?t():t)??{};var t},n=r();let o=new Map(Object.entries(n));const i="undefined"!=typeof Proxy,c=i?null:{},a={dispose:[],get:[],set:[],reset:[]},h=new Map,l=()=>{o=new Map(Object.entries(r())),i||S(),a.reset.forEach((e=>e()))},u=e=>(a.get.forEach((t=>t(e))),o.get(e)),d=(e,r)=>{const n=o.get(e);t(r,n,e)&&(o.set(e,r),i||p(e),a.set.forEach((t=>t(e,r,n))))},f=i?new Proxy(n,{get:(e,t)=>u(t),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>o.has(t),set:(e,t,r)=>(d(t,r),!0)}):(S(),c),g=(e,t)=>(a[e].push(t),()=>{s(a[e],t)});function p(e){!i&&c&&(Object.prototype.hasOwnProperty.call(c,e)||Object.defineProperty(c,e,{configurable:!0,enumerable:!0,get:()=>u(e),set(t){d(e,t)}}))}function S(){if(i||!c)return;const e=new Set(o.keys());for(const t of Object.keys(c))e.has(t)||delete c[t];for(const t of e)p(t)}return{state:f,get:u,set:d,on:g,onChange:(e,t)=>{const n=(r,n)=>{r===e&&t(n)},o=()=>{const n=r();t(n[e])},s=g("set",n),i=g("reset",o);return h.set(t,{setHandler:n,resetHandler:o,propName:e}),()=>{s(),i(),h.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(g("set",t.set)),t.get&&e.push(g("get",t.get)),t.reset&&e.push(g("reset",t.reset)),t.dispose&&e.push(g("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{a.dispose.forEach((e=>e())),l()},reset:l,forceUpdate:e=>{const t=o.get(e);a.set.forEach((r=>r(e,t,t)))},removeListener:(e,t)=>{const r=h.get(t);r&&r.propName===e&&(s(a.set,r.setHandler),s(a.reset,r.resetHandler),h.delete(t))}}})(e,t);return i.use((()=>{if("function"!=typeof o||"function"!=typeof n)return{};const e=n,t=o,s=new Map;return{dispose:()=>s.clear(),get:e=>{const r=t();r&&((e,t,r)=>{let n=e.get(t);n||(n=[],e.set(t,n)),n.some((e=>e.deref()===r))||n.push(new WeakRef(r))})(s,e,r)},set:t=>{const n=s.get(t);if(n){const r=n.filter((t=>{const r=t.deref();return!!r&&e(r)}));s.set(t,r)}r(s)},reset:()=>{s.forEach((t=>{t.forEach((t=>{const r=t.deref();r&&e(r)}))})),r(s)}}})()),i},c="refreshToken",a="isAuthorized",h="printer",l="printerSettings";function u(e){const t=localStorage.getItem(e);if(null===t)return null;try{return JSON.parse(t)}catch(e){return null}}const d={getRefreshToken:()=>localStorage.getItem(c),setRefreshToken(e){localStorage.setItem(c,e)},getIsAuthorized:()=>"true"===localStorage.getItem(a),setIsAuthorized(e){localStorage.setItem(a,e.toString())},hasIsAuthorized:()=>null!==localStorage.getItem(a),getPrinterSettings(e){var t;return null!==(t=f()[e])&&void 0!==t?t:null},setPrinterSettings(e,t){const r=f();r[e]=t,localStorage.setItem(l,JSON.stringify(r))},getPrinter:()=>u(h),setPrinter(e){localStorage.setItem(h,JSON.stringify(e))},clearSession(){localStorage.removeItem(c),localStorage.removeItem("access_token"),localStorage.removeItem(a)},clearSavedPrinter(){localStorage.removeItem(h)}};function f(){const e=u(l);if(e)return e;const t=u("properties"),r=u(h);return t&&(null==r?void 0:r.id)?{[r.id]:t}:{}}class g{constructor(e,t){this.urlParams=new URLSearchParams,this.isAuthorized=!1,this.redirectURI=e,this.clientID=t,p.state.clientID=t,this.oauthUrl=p.state.authApiHostUrl,this.authURI=new URL(`https://${this.oauthUrl}/oauth/authorize/`),this.accessTokenURL=`https://${this.oauthUrl}/oauth/access_token/`}generateCodeVerifier(){if(""!==p.state.codeVerifier)this.codeVerifier=p.state.codeVerifier;else{const e=new Uint8Array(128),t=crypto.getRandomValues(e),r=btoa(t.toString()).substr(0,128);this.codeVerifier=r,p.state.codeVerifier=this.codeVerifier}}async generateCodeChallenge(e){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t),n=btoa(String.fromCharCode(...new Uint8Array(r)));this.codeChallenge=n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}buildAuthURI(){this.urlParams.append("response_type","code"),this.urlParams.append("client_id",this.clientID),this.urlParams.append("redirect_uri",this.redirectURI),this.urlParams.append("code_challenge",this.codeChallenge),this.urlParams.append("code_challenge_method","S256"),this.authURI.search=this.urlParams.toString(),p.state.authUri=this.authURI.toString()}oauthHeaders(){return{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"}}persistTokens(e,t){this.accessToken=e,p.state.accessToken=e,this.refreshToken=t,p.state.refreshToken=t,d.setRefreshToken(t),this.isAuthorized=!0,p.state.isAuthorized=!0,d.setIsAuthorized(!0)}getAccessToken(){return fetch(this.accessTokenURL,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({grant_type:"authorization_code",scope:"printing",code:p.state.code,redirect_uri:this.redirectURI,code_verifier:p.state.codeVerifier})}).then((e=>e.json())).then((e=>{e.access_token&&this.persistTokens(e.access_token,e.refresh_token)}))}refreshTokens(){return fetch(this.accessTokenURL,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({grant_type:"refresh_token",scope:"printing",refresh_token:p.state.refreshToken})}).then((e=>e.json())).then((e=>{e.access_token&&this.persistTokens(e.access_token,e.refresh_token)}))}revokeRefreshToken(){p.state.refreshToken&&fetch(`https://${this.oauthUrl}/oauth/revoke/`,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({token:p.state.refreshToken})}).catch((()=>{}))}}const p=i({code:"",codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:!1,devApi:!1,authApiHostUrl:"",redirectUri:"",authUri:"",clientID:""});function S(){const e=new URLSearchParams(window.location.search).get("code");window.opener&&e&&(window.opener.postMessage(e,p.state.redirectUri),window.close())}export{g as E,p as a,S as b,i as c,d as s}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface EzpFileName extends Components.EzpFileName, HTMLElement {}
4
+ export const EzpFileName: {
5
+ prototype: EzpFileName;
6
+ new (): EzpFileName;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1 @@
1
+ import{E as e,d as o}from"./ezp-file-name2.js";const s=e,a=o;export{s as EzpFileName,a as defineCustomElement}
@@ -0,0 +1 @@
1
+ import{proxyCustomElement as e,HTMLElement as t,h as i,Host as s,transformTag as o}from"@stencil/core/internal/client";import{j as a}from"./utils.js";import{d as n}from"./ezp-label2.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.openGeneration=0,this.scrollTargets=[],this.name="",this.level="secondary",this.weight="soft",this.placement="top",this.anchor="container",this.expanded=!1,this.tooltipOpen=!1,this.openTooltip=()=>{if(!this.hasHover||this.expanded)return;clearTimeout(this.openTimeout);const e=++this.openGeneration;this.openTimeout=setTimeout((async()=>{await this.isClipped()&&e===this.openGeneration&&(this.tooltipOpen=!0)}),300)},this.closeTooltip=()=>{this.openGeneration++,clearTimeout(this.openTimeout),clearTimeout(this.closeTimeout),this.tooltipOpen=!1},this.scheduleClose=()=>{clearTimeout(this.openTimeout),clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(this.closeTooltip,200)},this.cancelScheduledClose=()=>{clearTimeout(this.closeTimeout)},this.toggleExpanded=()=>{this.expanded=!this.expanded,this.expanded&&this.closeTooltip()}}disconnectedCallback(){this.closeTooltip(),this.stopWatchingScroll()}componentDidRender(){this.tooltipOpen&&"parent"===this.anchor&&this.placeTooltip()}watchTooltipOpen(e){e&&"parent"===this.anchor?this.watchScroll():this.stopWatchingScroll()}handleKeyDown(e){"Escape"===e.key&&this.tooltipOpen&&(e.stopPropagation(),this.closeTooltip())}get hasHover(){var e,t;return null!==(t=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(hover: hover)").matches)&&void 0!==t&&t}async isClipped(){var e,t;const i=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector(".head");return!!i&&(await(null===(t=i.componentOnReady)||void 0===t?void 0:t.call(i)),i.isTruncated())}placeTooltip(){var e,t;const i=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector("#tooltip"),s=null!==(t=this.host.closest("[data-tooltip-row]"))&&void 0!==t?t:this.host.parentElement;if(!i||!s)return;i.style.bottom="auto",i.style.top="0px";const o=i.getBoundingClientRect(),n=i.offsetHeight>0?o.height/i.offsetHeight:1,l=s.getBoundingClientRect(),r=(parseFloat(getComputedStyle(i).getPropertyValue("--ezp-spacing-2"))||6)*n,h=a(this.placement,l,o.height+r,this.visibleArea(i));i.style.top=(("top"===h?l.top-r-o.height:l.bottom+r)-o.top)/(n||1)+"px"}visibleArea(e){var t;let i=0,s=window.innerHeight,o=e.offsetParent;for(;o;){if("visible"!==getComputedStyle(o).overflowY){const e=o.getBoundingClientRect();i=Math.max(i,e.top),s=Math.min(s,e.bottom)}o=null!==(t=o.parentElement)&&void 0!==t?t:o.getRootNode().host||null}return{top:i,bottom:s}}watchScroll(){this.stopWatchingScroll();const e=[window];let t=this.host.parentNode;for(;t;)t.nodeType===Node.ELEMENT_NODE&&e.push(t),t=t instanceof ShadowRoot?t.host:t.parentNode;e.forEach((e=>e.addEventListener("scroll",this.closeTooltip,{passive:!0}))),window.addEventListener("resize",this.closeTooltip,{passive:!0}),this.scrollTargets=e}stopWatchingScroll(){this.scrollTargets.forEach((e=>e.removeEventListener("scroll",this.closeTooltip))),this.scrollTargets=[],window.removeEventListener("resize",this.closeTooltip)}render(){const e=!this.expanded&&this.name.length>8,t=e?this.name.slice(0,-8):this.name,o=e?this.name.slice(-8):"";return i(s,{key:"6fa83e22c07a31d2a56df34f2f12edf20e1eba15",class:{expanded:this.expanded,[`place-${this.placement}`]:!0}},i("button",{key:"07c2f0afc897be0ef1bd1622a486d7ff7ec73953",type:"button",id:"trigger","aria-label":this.name,"aria-expanded":this.expanded?"true":"false",onClick:this.toggleExpanded,onMouseEnter:this.openTooltip,onMouseLeave:this.scheduleClose,onFocus:this.openTooltip,onBlur:this.closeTooltip},i("ezp-label",{key:"7a8711a0ac21e2b7bf84a40492b0b193dd3dd29f",class:"head",ellipsis:e,level:this.level,weight:this.weight,text:t}),e&&i("ezp-label",{key:"be08c7a34cff7db6e5328627de26ff272415e27d",class:"tail",level:this.level,weight:this.weight,text:o})),this.tooltipOpen&&i("div",{key:"fe79f1aeced27b5ebf68e8a6cd3fcdd26e19c5eb",id:"tooltip","aria-hidden":"true",onMouseEnter:this.cancelScheduledClose,onMouseLeave:this.closeTooltip},this.name))}get host(){return this}static get watchers(){return{tooltipOpen:[{watchTooltipOpen:0}]}}static get style(){return'@charset "UTF-8";:host{display:block;min-width:0}#trigger{-ms-flex-align:baseline;align-items:baseline;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:4px;color:inherit;cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;margin:0;max-width:100%;min-width:0;outline-color:var(--ezp-theme-solid);outline-offset:2px;padding:0;text-align:left}.head{-ms-flex:0 1 auto;flex:0 1 auto;min-width:0}.tail{-ms-flex:0 0 auto;flex:0 0 auto}:host(:not(.expanded)) .head,:host(:not(.expanded)) .tail{--ezp-label-whiteSpace:pre}:host(.expanded) .head{--ezp-label-whiteSpace:pre-wrap}:host(.expanded) #trigger{word-break:break-all}#tooltip{background:var(--ezp-core-surface-tertiary);border-radius:8px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);color:var(--ezp-core-foreground-primary);font-size:12px;font-weight:500;left:0;line-height:18px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);pointer-events:auto;position:absolute;right:0;word-break:break-all;z-index:10}:host(.place-top) #tooltip{bottom:calc(100% + var(--ezp-spacing-2))}:host(.place-bottom) #tooltip{top:calc(100% + var(--ezp-spacing-2))}'}},[1,"ezp-file-name",{name:[1],level:[1],weight:[1],placement:[1],anchor:[1],expanded:[32],tooltipOpen:[32]},[[10,"keydown","handleKeyDown"]],{tooltipOpen:[{watchTooltipOpen:0}]}]);function r(){"undefined"!=typeof customElements&&["ezp-file-name","ezp-label"].forEach((e=>{switch(e){case"ezp-file-name":customElements.get(o(e))||customElements.define(o(e),l);break;case"ezp-label":customElements.get(o(e))||n()}}))}export{l as E,r as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as o,HTMLElement as e,h as t,Host as n,transformTag as r}from"@stencil/core/internal/client";import{d as i}from"./ezp-icon2.js";const a=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.blank=!1,this.disabled=!1,this.level="primary"}render(){const o=void 0!==this.type?"button":"a",e=void 0!==this.type?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"},r=this.icon.replace(/[-_]/g," ");return t(n,{key:"7d3d43ec31503ff7ecc87e9f498ee5b2d09d5d96",class:`${this.level}`},t(o,Object.assign({key:"b7d5c646bb66ebff92d661574c647f8a2773a908",id:"button","aria-label":r},e),t("ezp-icon",{key:"bc4c322b7c9389a8aaa27feac7084ae9e1befaa4",name:this.icon})))}static get style(){return":host{display:block}:host(.primary){--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:var(--ezp-theme-solid);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-white-100);--ezp-iconButton-opacity-active:0.74;--ezp-iconButton-opacity-hover:0.84}:host(.secondary){--ezp-iconButton-background-active:var(--ezp-core-shade-tertiary);--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-hover:var(--ezp-core-shade-secondary);--ezp-iconButton-background-init:var(--ezp-core-shade-primary);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-iconButton-background-active:var(--ezp-core-shade-secondary);--ezp-iconButton-background-hover:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.quaternary){--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid);--ezp-iconButton-opacity-active:0.58;--ezp-iconButton-opacity-hover:0.74}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-iconButton-background, var(--ezp-iconButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-iconButton-color, var(--ezp-iconButton-color-init));cursor:var(--ezp-iconButton-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-iconButton-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){#button:not(:disabled):hover{--ezp-iconButton-background:var( --ezp-iconButton-background-hover, var(--ezp-iconButton-background-init) );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-iconButton-background:var( --ezp-iconButton-background-active, var(--ezp-iconButton-background-init) );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-active, 1)}}#button:disabled{--ezp-iconButton-background:var( --ezp-iconButton-background-disabled, var(--ezp-iconButton-background-init) );--ezp-iconButton-color:var(--ezp-iconButton-color-disabled);--ezp-iconButton-cursor:default}"}},[1,"ezp-icon-button",{blank:[4],disabled:[4],href:[1],icon:[1],level:[1],type:[1]}]);function c(){"undefined"!=typeof customElements&&["ezp-icon-button","ezp-icon"].forEach((o=>{switch(o){case"ezp-icon-button":customElements.get(r(o))||customElements.define(r(o),a);break;case"ezp-icon":customElements.get(r(o))||i()}}))}export{a as E,c as d}
1
+ import{proxyCustomElement as o,HTMLElement as t,h as e,Host as n,transformTag as r}from"@stencil/core/internal/client";import{d as i}from"./ezp-icon2.js";const a=o(class extends t{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.blank=!1,this.disabled=!1,this.level="primary"}render(){const o=void 0!==this.type?"button":"a",t=void 0!==this.type?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"},r=this.icon.replace(/[-_]/g," ");return e(n,{key:"d67a43c2b91eaa4fa79dd8559824f3ffc23757b2",class:`${this.level}`},e(o,Object.assign({key:"3b11b4e0c40c8f900496ae03a4eee11f0980cd80",id:"button","aria-label":r},t),e("ezp-icon",{key:"14a35e8f779628197f7dd89219792d7809990631",name:this.icon})))}static get style(){return":host{display:block}:host(.primary){--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:var(--ezp-theme-solid);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-white-100);--ezp-iconButton-opacity-active:0.74;--ezp-iconButton-opacity-hover:0.84}:host(.secondary){--ezp-iconButton-background-active:var(--ezp-core-shade-tertiary);--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-hover:var(--ezp-core-shade-secondary);--ezp-iconButton-background-init:var(--ezp-core-shade-primary);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-iconButton-background-active:var(--ezp-core-shade-secondary);--ezp-iconButton-background-hover:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.quaternary){--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid);--ezp-iconButton-opacity-active:0.58;--ezp-iconButton-opacity-hover:0.74}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-iconButton-background, var(--ezp-iconButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-iconButton-color, var(--ezp-iconButton-color-init));cursor:var(--ezp-iconButton-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-iconButton-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){#button:not(:disabled):hover{--ezp-iconButton-background:var( --ezp-iconButton-background-hover, var(--ezp-iconButton-background-init) );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-iconButton-background:var( --ezp-iconButton-background-active, var(--ezp-iconButton-background-init) );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-active, 1)}}#button:disabled{--ezp-iconButton-background:var( --ezp-iconButton-background-disabled, var(--ezp-iconButton-background-init) );--ezp-iconButton-color:var(--ezp-iconButton-color-disabled);--ezp-iconButton-cursor:default}"}},[1,"ezp-icon-button",{blank:[4],disabled:[4],href:[1],icon:[1],level:[1],type:[1]}]);function c(){"undefined"!=typeof customElements&&["ezp-icon-button","ezp-icon"].forEach((o=>{switch(o){case"ezp-icon-button":customElements.get(r(o))||customElements.define(r(o),a);break;case"ezp-icon":customElements.get(r(o))||i()}}))}export{a as E,c as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as i,getAssetPath as n,h as r,Host as a,transformTag as t}from"@stencil/core/internal/client";const c=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.size="normal",this.framed=!1}async componentWillLoad(){await fetch(n(`./assets/glyph-${this.name}.svg`)).then((e=>e.text())).then((e=>{this.glyph=e})).catch((()=>{}))}render(){return r(a,{key:"e1b22ece00f1260a34561c8d1efd44c2d5f37c73",class:`${this.size} ${this.framed?"framed":""}`,"aria-hidden":"true"},r("div",{key:"0734d4b5fdc363303d69b7e5dc138f8caeaa316c",id:"glyph",innerHTML:this.glyph}))}static get assetsDirs(){return["assets"]}static get style(){return":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-icon-background, transparent);border-radius:var(--ezp-icon-borderRadius, 0);display:grid;grid-template:var(--ezp-icon-gridTemplate)/var(--ezp-icon-gridTemplate);height:var(--ezp-icon-height, var(--ezp-icon-size));-ms-flex-pack:center;justify-content:center;padding:var(--ezp-icon-padding, 0);width:var(--ezp-icon-width, var(--ezp-icon-size))}:host(.framed){--ezp-icon-background:var(--ezp-core-shade-primary);--ezp-icon-borderRadius:50%;--ezp-icon-padding:var(--ezp-icon-frame)}:host(.normal){--ezp-icon-size:18px;--ezp-icon-gridTemplate:24px;--ezp-icon-frame:var(--ezp-spacing-3)}:host(.large){--ezp-icon-size:36px;--ezp-icon-gridTemplate:48px;--ezp-icon-frame:var(--ezp-spacing-4)}:host(.huge){--ezp-icon-size:54px;--ezp-icon-gridTemplate:72px;--ezp-icon-frame:var(--ezp-spacing-5)}svg{display:block;fill:var(--ezp-icon-fill, currentColor);height:100%;width:100%}"}},[1,"ezp-icon",{name:[1],size:[1],framed:[4]}]);function s(){"undefined"!=typeof customElements&&["ezp-icon"].forEach((e=>{"ezp-icon"===e&&(customElements.get(t(e))||customElements.define(t(e),c))}))}export{c as E,s as d}
1
+ import{proxyCustomElement as e,HTMLElement as i,getAssetPath as n,h as r,Host as t,transformTag as a}from"@stencil/core/internal/client";const s=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.size="normal",this.framed=!1}async componentWillLoad(){await fetch(n(`./assets/glyph-${this.name}.svg`)).then((e=>e.text())).then((e=>{this.glyph=e})).catch((()=>{}))}render(){return r(t,{key:"f1a45d38b75ccf4e0c5e6200d9d04c7e5766bfbc",class:`${this.size} ${this.framed?"framed":""}`,"aria-hidden":"true"},r("div",{key:"70f6963181d31089fefb662079e1e075540d2fe7",id:"glyph",innerHTML:this.glyph}))}static get assetsDirs(){return["assets"]}static get style(){return":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-icon-background, transparent);border-radius:var(--ezp-icon-borderRadius, 0);display:grid;grid-template:var(--ezp-icon-gridTemplate)/var(--ezp-icon-gridTemplate);height:var(--ezp-icon-height, var(--ezp-icon-size));-ms-flex-pack:center;justify-content:center;padding:var(--ezp-icon-padding, 0);width:var(--ezp-icon-width, var(--ezp-icon-size))}:host(.framed){--ezp-icon-background:var(--ezp-core-shade-primary);--ezp-icon-borderRadius:50%;--ezp-icon-padding:var(--ezp-icon-frame)}:host(.normal){--ezp-icon-size:18px;--ezp-icon-gridTemplate:24px;--ezp-icon-frame:var(--ezp-spacing-3)}:host(.large){--ezp-icon-size:36px;--ezp-icon-gridTemplate:48px;--ezp-icon-frame:var(--ezp-spacing-4)}:host(.huge){--ezp-icon-size:54px;--ezp-icon-gridTemplate:72px;--ezp-icon-frame:var(--ezp-spacing-5)}svg{display:block;fill:var(--ezp-icon-fill, currentColor);height:100%;width:100%}"}},[1,"ezp-icon",{name:[1],size:[1],framed:[4]}]);function c(){"undefined"!=typeof customElements&&["ezp-icon"].forEach((e=>{"ezp-icon"===e&&(customElements.get(a(e))||customElements.define(a(e),s))}))}export{s as E,c as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as o,Host as r,transformTag as n}from"@stencil/core/internal/client";import{d as a}from"./ezp-icon2.js";import{d as p}from"./ezp-label2.js";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.inputValueChanged=i(this,"inputValueChanged",7),this.timeout=null,this.label="Label",this.type="text",this.placeholder="",this.focused=!1,this.setFocus=()=>{var e;null===(e=this.input)||void 0===e||e.focus()},this.handleBlur=()=>{this.focused=!1},this.handleFocus=()=>{this.focused=!0}}handleChange(e){this.timeout&&clearTimeout(this.timeout);const t=e.target;this.value=t.value?t.value:"number"===this.type?0:"",this.timeout=setTimeout((()=>{this.inputValueChanged.emit({type:this.eventType.toLowerCase(),value:this.value})}),500)}render(){const e=!!this.icon;return o(r,{key:"47a8f8b4f1dd6a8cb2b67ffc21e8770e555a52e3",class:{focused:this.focused,"has-icon":e},onClick:this.setFocus},e?o("ezp-icon",{id:"icon",name:this.icon}):null,o("ezp-label",{key:"7d9401d2ab927cb52cd2fcfbdcf8790c5a6d0228",id:"label",noWrap:!0,level:"secondary",text:this.label}),o("input",{key:"f0422183a1677ba90e8fe74d6ccf3abdaeb3d645",id:"input",type:this.type,value:this.value,placeholder:this.placeholder,"aria-label":this.label,onInput:e=>this.handleChange(e),ref:e=>this.input=e,onFocus:this.handleFocus,onBlur:this.handleBlur}),this.suffix?o("ezp-label",{id:"suffix",level:"secondary",text:this.suffix}):null)}static get style(){return':host{-ms-flex-align:center;align-items:center;background:transparent;cursor:text;display:grid;gap:var(--ezp-spacing-3);grid-template:var(--ezp-input-grid-template, auto/auto 1fr);height:56px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);position:relative;z-index:var(--ezp-input-z-index, 3)}:host(.has-icon){--ezp-input-grid-template:auto / auto auto 1fr}:host([suffix]){--ezp-input-grid-template:auto / auto 1fr auto;--ezp-input-input-padding-right:0}:host([suffix].has-icon){--ezp-input-grid-template:auto / auto auto 1fr auto;--ezp-input-input-padding-right:0}:host(.focused){--ezp-input-label-color:var(--ezp-core-foreground-primary)}#label{color:var(--ezp-input-label-color, var(--ezp-core-foreground-primary))}#icon{--ezp-icon-background:var(--ezp-theme-translucent);--ezp-icon-borderRadius:50%;--ezp-icon-height:40px;--ezp-icon-width:40px;color:var(--ezp-input-icon-color, var(--ezp-theme-solid))}#input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:text;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;-webkit-font-smoothing:antialiased;font-weight:600;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0 var(--ezp-input-input-padding-right, var(--ezp-spacing-1)) 0 0;text-align:right;width:100%}#input::-webkit-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::-moz-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input:-ms-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::-ms-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input[type=number]::-webkit-inner-spin-button,#input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}#suffix{color:var(--ezp-core-foreground-tertiary)}'}},[1,"ezp-input",{label:[1],value:[1032],type:[1],icon:[1],suffix:[513],eventType:[1,"event-type"],placeholder:[1],focused:[32]}]);function u(){"undefined"!=typeof customElements&&["ezp-input","ezp-icon","ezp-label"].forEach((e=>{switch(e){case"ezp-input":customElements.get(n(e))||customElements.define(n(e),s);break;case"ezp-icon":customElements.get(n(e))||a();break;case"ezp-label":customElements.get(n(e))||p()}}))}export{s as E,u as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as o,Host as r,transformTag as n}from"@stencil/core/internal/client";import{d as a}from"./ezp-icon2.js";import{d as p}from"./ezp-label2.js";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.inputValueChanged=i(this,"inputValueChanged",7),this.timeout=null,this.label="Label",this.type="text",this.placeholder="",this.focused=!1,this.setFocus=()=>{var e;null===(e=this.input)||void 0===e||e.focus()},this.handleBlur=()=>{this.focused=!1},this.handleFocus=()=>{this.focused=!0}}handleChange(e){this.timeout&&clearTimeout(this.timeout);const t=e.target;this.value=t.value?t.value:"number"===this.type?0:"",this.timeout=setTimeout((()=>{this.inputValueChanged.emit({type:this.eventType.toLowerCase(),value:this.value})}),500)}render(){const e=!!this.icon;return o(r,{key:"f36f5811ba4e86b0aa3f53be916220136a1d2443",class:{focused:this.focused,"has-icon":e},onClick:this.setFocus},e?o("ezp-icon",{id:"icon",name:this.icon}):null,o("ezp-label",{key:"88f93411e1463b23ca4ae88d278a69df5038509d",id:"label",noWrap:!0,level:"secondary",text:this.label}),o("input",{key:"b23ba3c8fea465a559e9c6d7b3da50152b412a1c",id:"input",type:this.type,value:this.value,placeholder:this.placeholder,"aria-label":this.label,onInput:e=>this.handleChange(e),ref:e=>this.input=e,onFocus:this.handleFocus,onBlur:this.handleBlur}),this.suffix?o("ezp-label",{id:"suffix",level:"secondary",text:this.suffix}):null)}static get style(){return':host{-ms-flex-align:center;align-items:center;background:transparent;cursor:text;display:grid;gap:var(--ezp-spacing-3);grid-template:var(--ezp-input-grid-template, auto/auto 1fr);height:56px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);position:relative;z-index:var(--ezp-input-z-index, 3)}:host(.has-icon){--ezp-input-grid-template:auto / auto auto 1fr}:host([suffix]){--ezp-input-grid-template:auto / auto 1fr auto;--ezp-input-input-padding-right:0}:host([suffix].has-icon){--ezp-input-grid-template:auto / auto auto 1fr auto;--ezp-input-input-padding-right:0}:host(.focused){--ezp-input-label-color:var(--ezp-core-foreground-primary)}#label{color:var(--ezp-input-label-color, var(--ezp-core-foreground-primary))}#icon{--ezp-icon-background:var(--ezp-theme-translucent);--ezp-icon-borderRadius:50%;--ezp-icon-height:40px;--ezp-icon-width:40px;color:var(--ezp-input-icon-color, var(--ezp-theme-solid))}#input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:text;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;-webkit-font-smoothing:antialiased;font-weight:600;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0 var(--ezp-input-input-padding-right, var(--ezp-spacing-1)) 0 0;text-align:right;width:100%}#input::-webkit-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::-moz-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input:-ms-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::-ms-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input[type=number]::-webkit-inner-spin-button,#input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}#suffix{color:var(--ezp-core-foreground-tertiary)}'}},[1,"ezp-input",{label:[1],value:[1032],type:[1],icon:[1],suffix:[513],eventType:[1,"event-type"],placeholder:[1],focused:[32]}]);function u(){"undefined"!=typeof customElements&&["ezp-input","ezp-icon","ezp-label"].forEach((e=>{switch(e){case"ezp-input":customElements.get(n(e))||customElements.define(n(e),s);break;case"ezp-icon":customElements.get(n(e))||a();break;case"ezp-label":customElements.get(n(e))||p()}}))}export{s as E,u as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as l,Host as a,transformTag as i}from"@stencil/core/internal/client";const p=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ellipsis=!1,this.level="secondary",this.noWrap=!1,this.text="Label",this.weight="soft"}render(){return l(a,{key:"941746aaf861bd3ffe8dc65c1c5dbc52866be923",class:`${this.level} ${this.weight} ${this.ellipsis?"ellipsis":""} ${this.noWrap?"no-wrap":""}`},l("div",{key:"36ee30f53e0209f569129ce1c1ca8e1ccf5d0803",id:"text"},this.text))}static get style(){return':host{display:block;min-width:var(--ezp-label-minWidth, auto);padding-bottom:1px;padding-top:1px}:host::before,:host::after{content:"";display:block;height:0}:host::before{margin-top:calc((var(--ezp-label-offset) + 1px) * -1)}:host::after{margin-bottom:calc((var(--ezp-label-offset) + 1px) * -1)}:host(.no-wrap){--ezp-label-whiteSpace:nowrap}:host(.ellipsis){--ezp-label-minWidth:0;--ezp-label-overflow:hidden;--ezp-label-textOverflow:ellipsis;--ezp-label-whiteSpace:nowrap;--ezp-label-width:100%}:host(.primary){--ezp-label-fontSize:17px;--ezp-label-lineHeight:24px;--ezp-label-letterSpacing:-0.0127756105em;--ezp-label-offset:6px}:host(.secondary){--ezp-label-fontSize:14px;--ezp-label-lineHeight:20px;--ezp-label-letterSpacing:-0.0062235443em;--ezp-label-offset:5px}:host(.tertiary){--ezp-label-fontSize:12px;--ezp-label-lineHeight:18px;--ezp-label-letterSpacing:0.0004907745em;--ezp-label-offset:5px}:host(.soft){--ezp-label-fontWeight:400}:host(.strong){--ezp-label-fontWeight:500}:host(.heavy){--ezp-label-fontWeight:600}#text{font-size:var(--ezp-label-fontSize);font-weight:var(--ezp-label-fontWeight);letter-spacing:var(--ezp-label-letterSpacing);line-height:var(--ezp-label-lineHeight);overflow:var(--ezp-label-overflow, visible);text-overflow:var(--ezp-label-textOverflow, clip);white-space:var(--ezp-label-whiteSpace, normal);width:var(--ezp-label-width, auto)}'}},[1,"ezp-label",{ellipsis:[4],level:[1],noWrap:[4,"no-wrap"],text:[1],weight:[1]}]);function o(){"undefined"!=typeof customElements&&["ezp-label"].forEach((e=>{"ezp-label"===e&&(customElements.get(i(e))||customElements.define(i(e),p))}))}export{p as E,o as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as l,Host as a,transformTag as i}from"@stencil/core/internal/client";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ellipsis=!1,this.level="secondary",this.noWrap=!1,this.text="Label",this.weight="soft"}async isTruncated(){var e;const t=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector("#text");return!!t&&t.scrollWidth>t.clientWidth+1}render(){return l(a,{key:"42139679511e711132912a1f762d345951fd1774",class:`${this.level} ${this.weight} ${this.ellipsis?"ellipsis":""} ${this.noWrap?"no-wrap":""}`},l("div",{key:"5e54e8142d274cacb375cce8d5ef52ccdeaeec84",id:"text"},this.text))}get host(){return this}static get style(){return':host{display:block;min-width:var(--ezp-label-minWidth, auto);padding-bottom:1px;padding-top:1px}:host::before,:host::after{content:"";display:block;height:0}:host::before{margin-top:calc((var(--ezp-label-offset) + 1px) * -1)}:host::after{margin-bottom:calc((var(--ezp-label-offset) + 1px) * -1)}:host(.no-wrap){--ezp-label-whiteSpace:nowrap}:host(.ellipsis){--ezp-label-minWidth:0;--ezp-label-overflow:hidden;--ezp-label-textOverflow:ellipsis;--ezp-label-whiteSpace:nowrap;--ezp-label-width:100%}:host(.primary){--ezp-label-fontSize:17px;--ezp-label-lineHeight:24px;--ezp-label-letterSpacing:-0.0127756105em;--ezp-label-offset:6px}:host(.secondary){--ezp-label-fontSize:14px;--ezp-label-lineHeight:20px;--ezp-label-letterSpacing:-0.0062235443em;--ezp-label-offset:5px}:host(.tertiary){--ezp-label-fontSize:12px;--ezp-label-lineHeight:18px;--ezp-label-letterSpacing:0.0004907745em;--ezp-label-offset:5px}:host(.soft){--ezp-label-fontWeight:400}:host(.strong){--ezp-label-fontWeight:500}:host(.heavy){--ezp-label-fontWeight:600}#text{font-size:var(--ezp-label-fontSize);font-weight:var(--ezp-label-fontWeight);letter-spacing:var(--ezp-label-letterSpacing);line-height:var(--ezp-label-lineHeight);overflow:var(--ezp-label-overflow, visible);text-overflow:var(--ezp-label-textOverflow, clip);white-space:var(--ezp-label-whiteSpace, normal);width:var(--ezp-label-width, auto)}'}},[1,"ezp-label",{ellipsis:[4],level:[1],noWrap:[4,"no-wrap"],text:[1],weight:[1],isTruncated:[64]}]);function p(){"undefined"!=typeof customElements&&["ezp-label"].forEach((e=>{"ezp-label"===e&&(customElements.get(i(e))||customElements.define(i(e),o))}))}export{o as E,p as d}