@ezeep/ezeep-js 1.0.290 → 1.0.302

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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} +572 -139
  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 +280 -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.css +11 -2
  10. package/dist/collection/components/ezp-input/ezp-input.js +3 -5
  11. package/dist/collection/components/ezp-label/ezp-label.js +39 -1
  12. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +45 -17
  13. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +220 -88
  14. package/dist/collection/components/ezp-printing/ezp-printing.js +1 -1
  15. package/dist/collection/components/ezp-select/ezp-select.css +9 -12
  16. package/dist/collection/components/ezp-select/ezp-select.js +1 -1
  17. package/dist/collection/components/ezp-status/ezp-status.js +2 -2
  18. package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
  19. package/dist/collection/components/ezp-text-button/ezp-text-button.css +3 -1
  20. package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
  21. package/dist/collection/components/ezp-upload/ezp-upload.css +176 -143
  22. package/dist/collection/components/ezp-upload/ezp-upload.js +56 -9
  23. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
  24. package/dist/collection/shared/storage.js +39 -9
  25. package/dist/collection/types/shared/types.d.ts +1 -0
  26. package/dist/collection/utils/printer.js +75 -1
  27. package/dist/components/auth.js +1 -1
  28. package/dist/components/ezp-file-name.d.ts +11 -0
  29. package/dist/components/ezp-file-name.js +1 -0
  30. package/dist/components/ezp-file-name2.js +1 -0
  31. package/dist/components/ezp-icon-button2.js +1 -1
  32. package/dist/components/ezp-icon2.js +1 -1
  33. package/dist/components/ezp-input2.js +1 -1
  34. package/dist/components/ezp-label2.js +1 -1
  35. package/dist/components/ezp-printer-selection2.js +1 -1
  36. package/dist/components/ezp-printing.js +1 -1
  37. package/dist/components/ezp-select2.js +1 -1
  38. package/dist/components/ezp-status2.js +1 -1
  39. package/dist/components/ezp-stepper2.js +1 -1
  40. package/dist/components/ezp-text-button2.js +1 -1
  41. package/dist/components/ezp-upload2.js +1 -1
  42. package/dist/components/ezp-user-menu2.js +1 -1
  43. package/dist/components/utils.js +1 -1
  44. package/dist/directives/proxies.ts +26 -1
  45. package/dist/esm/ezeep.js +1 -1
  46. package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +572 -140
  47. package/dist/esm/loader.js +1 -1
  48. package/dist/esm-es5/ezeep.js +1 -1
  49. package/dist/esm-es5/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +2 -2
  50. package/dist/esm-es5/loader.js +1 -1
  51. package/dist/ezeep/ezeep.esm.js +1 -1
  52. package/dist/ezeep/{p-6a494b7b.system.entry.js → p-636e190f.system.entry.js} +2 -2
  53. package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
  54. package/dist/ezeep/p-ff075048.entry.js +1 -0
  55. package/dist/ezeep/types/shared/types.d.ts +1 -0
  56. package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +83 -0
  57. package/dist/types/components/ezp-label/ezp-label.d.ts +10 -0
  58. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +41 -1
  59. package/dist/types/components/ezp-upload/ezp-upload.d.ts +8 -1
  60. package/dist/types/components.d.ts +65 -4
  61. package/dist/types/shared/storage.d.ts +18 -4
  62. package/dist/types/shared/types.d.ts +1 -0
  63. package/dist/types/utils/printer.d.ts +18 -0
  64. package/package.json +1 -1
  65. package/www/build/ezeep.esm.js +1 -1
  66. package/www/build/{p-6a494b7b.system.entry.js → p-636e190f.system.entry.js} +2 -2
  67. package/www/build/p-DCznw2Ee.system.js +1 -1
  68. package/www/build/p-a2a4f55b.js +1 -0
  69. package/www/build/p-ff075048.entry.js +1 -0
  70. package/www/data/locales/de.json +6 -9
  71. package/www/data/locales/en.json +6 -9
  72. package/www/index.html +1 -1
  73. package/dist/ezeep/p-0df147f4.entry.js +0 -1
  74. package/www/build/p-0df147f4.entry.js +0 -1
  75. package/www/build/p-67021add.js +0 -1
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-L_3XPZxT.js');
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["ezp-auth_15.cjs",[[257,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"uploadContinue","listenUploadContinue"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{"filedata":[{"watchFileData":0}],"filename":[{"watchFilename":0}],"fileurl":[{"watchFileUrl":0}],"language":[{"watchLanguage":0}]}],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"printTimedOut":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]},[[8,"keydown","handleKeydown"]]],[1,"ezp-user-menu",{"name":[1],"open":[1028]},null,{"open":[{"watchOpen":0}]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]},null,{"expanded":[{"watchExpanded":0}],"preSelected":[{"preSelectedChanged":0}]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]},null,{"value":[{"watchValue":0}]}],[1,"ezp-status",{"description":[1],"subtext":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
9
+ return index.bootstrapLazy([["ezp-auth_16.cjs",[[257,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"setAuthRefreshToken":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"userCancel","listenUserCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"uploadContinue","listenUploadContinue"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]],{"filedata":[{"watchFileData":0}],"filename":[{"watchFilename":0}],"fileurl":[{"watchFileUrl":0}],"language":[{"watchLanguage":0}]}],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"printTimedOut":[32],"notSupported":[32],"noPrinters":[32],"hubDriverError":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"loadingPrinterConfig":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[0,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[9,"drop","resetDrag"],[9,"dragend","resetDrag"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]},[[8,"keydown","handleKeydown"]]],[1,"ezp-user-menu",{"name":[1],"open":[1028]},null,{"open":[{"watchOpen":0}]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]},null,{"expanded":[{"watchExpanded":0}],"preSelected":[{"preSelectedChanged":0}]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]},null,{"value":[{"watchValue":0}]}],[1,"ezp-status",{"description":[1],"subtext":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-file-name",{"name":[1],"level":[1],"weight":[1],"placement":[1],"expanded":[32],"tooltipOpen":[32]},[[10,"keydown","handleKeyDown"]]],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1],"isTruncated":[64]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -3,6 +3,7 @@
3
3
  "components/ezp-auth/ezp-auth.js",
4
4
  "components/ezp-backdrop/ezp-backdrop.js",
5
5
  "components/ezp-dialog/ezp-dialog.js",
6
+ "components/ezp-file-name/ezp-file-name.js",
6
7
  "components/ezp-icon/ezp-icon.js",
7
8
  "components/ezp-icon-button/ezp-icon-button.js",
8
9
  "components/ezp-input/ezp-input.js",
@@ -0,0 +1,98 @@
1
+ @charset "UTF-8";
2
+ /**
3
+ *
4
+ * Rules
5
+ *
6
+ */
7
+ /* Deliberately not a positioning context: the tooltip anchors to the nearest
8
+ positioned ancestor, so the consumer puts `position: relative` on the whole
9
+ row and the bubble may use its full width instead of the name column's. */
10
+ :host {
11
+ display: block;
12
+ min-width: 0;
13
+ }
14
+
15
+ /* The name is a button so the full text is reachable without a pointer: tap on
16
+ touch, Enter or Space on a keyboard. */
17
+ #trigger {
18
+ align-items: baseline;
19
+ appearance: none;
20
+ background: transparent;
21
+ border: 0;
22
+ border-radius: 4px;
23
+ color: inherit;
24
+ cursor: pointer;
25
+ display: flex;
26
+ font-family: inherit;
27
+ margin: 0;
28
+ max-width: 100%;
29
+ min-width: 0;
30
+ outline-color: var(--ezp-theme-solid);
31
+ outline-offset: 2px;
32
+ padding: 0;
33
+ text-align: left;
34
+ }
35
+
36
+ /* Everything but the last few characters, and the only part allowed to clip. */
37
+ .head {
38
+ flex: 0 1 auto;
39
+ min-width: 0;
40
+ }
41
+
42
+ /* Held back from truncation, so a trailing `_DE` / `_EN` stays readable. */
43
+ .tail {
44
+ flex: 0 0 auto;
45
+ }
46
+
47
+ /* The split can fall on a space — `Invoice (1).pdf`, `Document copy.pdf` — and
48
+ a space at the edge of a block collapses away, silently renaming the file on
49
+ screen. `pre` keeps it; the halves still cannot wrap, which is what the
50
+ ellipsis needs. */
51
+ :host(:not(.expanded)) .head,
52
+ :host(:not(.expanded)) .tail {
53
+ --ezp-label-whiteSpace: pre;
54
+ }
55
+
56
+ /* Expanded shows the whole name, so it has to wrap while keeping its spaces. */
57
+ :host(.expanded) .head {
58
+ --ezp-label-whiteSpace: pre-wrap;
59
+ }
60
+
61
+ :host(.expanded) #trigger {
62
+ /* Long names rarely carry spaces, so allow a break anywhere. */
63
+ word-break: break-all;
64
+ }
65
+
66
+ /**
67
+ *
68
+ * Tooltip
69
+ *
70
+ */
71
+ #tooltip {
72
+ background: var(--ezp-core-surface-tertiary);
73
+ border-radius: 8px;
74
+ box-shadow: 0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);
75
+ color: var(--ezp-core-foreground-primary);
76
+ font-size: 12px;
77
+ font-weight: 500;
78
+ left: 0;
79
+ line-height: 18px;
80
+ padding: var(--ezp-spacing-2) var(--ezp-spacing-3);
81
+ /* Stays hoverable so it can be read without it vanishing (WCAG 1.4.13); it
82
+ closes on its own mouseleave, so it only sits over the row while in use. */
83
+ pointer-events: auto;
84
+ position: absolute;
85
+ /* Spans the row it is anchored to: wide enough for most names to stay on one
86
+ line, and it covers the neighbouring row cleanly rather than half of it. */
87
+ right: 0;
88
+ word-break: break-all;
89
+ z-index: 10;
90
+ }
91
+
92
+ :host(.place-top) #tooltip {
93
+ bottom: calc(100% + var(--ezp-spacing-2));
94
+ }
95
+
96
+ :host(.place-bottom) #tooltip {
97
+ top: calc(100% + var(--ezp-spacing-2));
98
+ }
@@ -0,0 +1,280 @@
1
+ import { Host, h } from "@stencil/core";
2
+ /**
3
+ * Characters kept at the end of a truncated name. Uploads often differ only in
4
+ * a suffix like `_DE.pdf`, which a plain end-ellipsis would be the first thing
5
+ * to hide, so that tail is held back and the middle gives way instead.
6
+ */
7
+ const TAIL_LENGTH = 8;
8
+ /** Hovering across a list shouldn't flash a tooltip over every row in passing. */
9
+ const OPEN_DELAY_MS = 300;
10
+ /** Grace period for crossing the gap between the name and the bubble, so the
11
+ * tooltip can be hovered rather than vanishing on the way (WCAG 1.4.13). */
12
+ const CLOSE_DELAY_MS = 200;
13
+ export class EzpFileName {
14
+ constructor() {
15
+ /** Invalidates an in-flight open when the pointer leaves. */
16
+ this.openGeneration = 0;
17
+ /**
18
+ *
19
+ * Properties
20
+ *
21
+ */
22
+ /** The full file name. Always present in the DOM, so screen readers and
23
+ * copy-paste get it in full however it is truncated on screen. */
24
+ this.name = '';
25
+ /** Type scale of the rendered name, passed through to `ezp-label`. */
26
+ this.level = 'secondary';
27
+ /** Font weight of the rendered name, passed through to `ezp-label`. */
28
+ this.weight = 'soft';
29
+ /** Side the tooltip opens on. Consumers point it away from the edge their
30
+ * row sits against — `bottom` for the first row of a list, `top` below it. */
31
+ this.placement = 'top';
32
+ /**
33
+ *
34
+ * States
35
+ *
36
+ */
37
+ /** Set by tapping the name: shows it in full, wrapped over several lines.
38
+ * This is the touch counterpart of the tooltip, which needs a pointer. */
39
+ this.expanded = false;
40
+ this.tooltipOpen = false;
41
+ this.openTooltip = () => {
42
+ if (!this.hasHover || this.expanded)
43
+ return;
44
+ clearTimeout(this.openTimeout);
45
+ const generation = ++this.openGeneration;
46
+ this.openTimeout = setTimeout(async () => {
47
+ const clipped = await this.isClipped();
48
+ // Measuring yields, and the pointer may have moved on in the meantime —
49
+ // opening now would leave a tooltip behind with nothing to dismiss it.
50
+ if (clipped && generation === this.openGeneration)
51
+ this.tooltipOpen = true;
52
+ }, OPEN_DELAY_MS);
53
+ };
54
+ this.closeTooltip = () => {
55
+ this.openGeneration++;
56
+ clearTimeout(this.openTimeout);
57
+ clearTimeout(this.closeTimeout);
58
+ this.tooltipOpen = false;
59
+ };
60
+ /** Leaves the tooltip up briefly so the pointer can reach it. */
61
+ this.scheduleClose = () => {
62
+ clearTimeout(this.openTimeout);
63
+ clearTimeout(this.closeTimeout);
64
+ this.closeTimeout = setTimeout(this.closeTooltip, CLOSE_DELAY_MS);
65
+ };
66
+ this.cancelScheduledClose = () => {
67
+ clearTimeout(this.closeTimeout);
68
+ };
69
+ this.toggleExpanded = () => {
70
+ this.expanded = !this.expanded;
71
+ // The full name is on screen now; a tooltip repeating it is just in the way.
72
+ if (this.expanded)
73
+ this.closeTooltip();
74
+ };
75
+ }
76
+ /**
77
+ *
78
+ * Lifecycle methods
79
+ *
80
+ */
81
+ disconnectedCallback() {
82
+ clearTimeout(this.openTimeout);
83
+ clearTimeout(this.closeTimeout);
84
+ }
85
+ /**
86
+ *
87
+ * Listeners
88
+ *
89
+ */
90
+ /**
91
+ * Escape dismisses the tooltip, and only the tooltip.
92
+ *
93
+ * Listening globally catches the key however the tooltip was opened,
94
+ * including by hover, when nothing here has focus. It has to run in the
95
+ * capture phase: stopping propagation on the way back up happens after every
96
+ * ancestor has already seen the key, so a host app that closes its dialog on
97
+ * Escape would close it as the tooltip was dismissed.
98
+ *
99
+ * `window` rather than `document`, because dialog libraries capture on the
100
+ * document themselves — Radix's `DismissableLayer` does — and register before
101
+ * a component mounted inside them, so they would still see the key first.
102
+ * Capture runs window before document, so this transient layer consumes the
103
+ * key first, and only while it is actually open.
104
+ */
105
+ handleKeyDown(event) {
106
+ if (event.key === 'Escape' && this.tooltipOpen) {
107
+ event.stopPropagation();
108
+ this.closeTooltip();
109
+ }
110
+ }
111
+ /**
112
+ *
113
+ * Private methods
114
+ *
115
+ */
116
+ /** Tooltips need a pointer; touch devices get the tap-to-expand path instead.
117
+ * Tapping fires a synthetic `mouseenter` in most mobile browsers, so without
118
+ * this check a tooltip would open on every tap. */
119
+ get hasHover() {
120
+ var _a, _b;
121
+ return (_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(hover: hover)').matches) !== null && _b !== void 0 ? _b : false;
122
+ }
123
+ /** Whether anything is actually hidden. A name that fits needs no tooltip —
124
+ * repeating text the reader can already see is just noise in the way. */
125
+ async isClipped() {
126
+ var _a, _b;
127
+ const head = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.head');
128
+ if (!head)
129
+ return false;
130
+ await ((_b = head.componentOnReady) === null || _b === void 0 ? void 0 : _b.call(head));
131
+ return head.isTruncated();
132
+ }
133
+ /**
134
+ *
135
+ * Render method
136
+ *
137
+ */
138
+ render() {
139
+ // Splitting is a rendering device only: `head` holds everything but the last
140
+ // few characters and is the part CSS is allowed to clip, so the two labels
141
+ // together still spell out the whole name.
142
+ const split = !this.expanded && this.name.length > TAIL_LENGTH;
143
+ const head = split ? this.name.slice(0, -TAIL_LENGTH) : this.name;
144
+ const tail = split ? this.name.slice(-TAIL_LENGTH) : '';
145
+ return (h(Host, { key: '4e84aca15abf4d1e59f2418fff0fdc13efd2a7b2', class: { expanded: this.expanded, [`place-${this.placement}`]: true } }, h("button", { key: '61de272bffc87cd440cd307ba49bee1f9795f8ae', type: "button", id: "trigger", "aria-label": this.name, "aria-expanded": this.expanded ? 'true' : 'false', onClick: this.toggleExpanded, onMouseEnter: this.openTooltip, onMouseLeave: this.scheduleClose, onFocus: this.openTooltip, onBlur: this.closeTooltip }, h("ezp-label", { key: 'd8120b13f24c5921d688431f90f7967b60fe4878', class: "head", ellipsis: split, level: this.level, weight: this.weight, text: head }), split && h("ezp-label", { key: '9129bedf96a55bd650efca46a3f2e7e599af2776', class: "tail", level: this.level, weight: this.weight, text: tail })), this.tooltipOpen && (h("div", { key: 'fb710729e9262fca148c342bf99c001fd5a760c3', id: "tooltip", "aria-hidden": "true", onMouseEnter: this.cancelScheduledClose, onMouseLeave: this.closeTooltip }, this.name))));
146
+ }
147
+ static get is() { return "ezp-file-name"; }
148
+ static get encapsulation() { return "shadow"; }
149
+ static get originalStyleUrls() {
150
+ return {
151
+ "$": ["ezp-file-name.scss"]
152
+ };
153
+ }
154
+ static get styleUrls() {
155
+ return {
156
+ "$": ["ezp-file-name.css"]
157
+ };
158
+ }
159
+ static get properties() {
160
+ return {
161
+ "name": {
162
+ "type": "string",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "string",
166
+ "resolved": "string",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "The full file name. Always present in the DOM, so screen readers and\ncopy-paste get it in full however it is truncated on screen."
174
+ },
175
+ "getter": false,
176
+ "setter": false,
177
+ "reflect": false,
178
+ "attribute": "name",
179
+ "defaultValue": "''"
180
+ },
181
+ "level": {
182
+ "type": "string",
183
+ "mutable": false,
184
+ "complexType": {
185
+ "original": "LabelLevelTypes",
186
+ "resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
187
+ "references": {
188
+ "LabelLevelTypes": {
189
+ "location": "import",
190
+ "path": "../../shared/types",
191
+ "id": "src/shared/types.d.ts::LabelLevelTypes",
192
+ "referenceLocation": "LabelLevelTypes"
193
+ }
194
+ }
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": "Type scale of the rendered name, passed through to `ezp-label`."
201
+ },
202
+ "getter": false,
203
+ "setter": false,
204
+ "reflect": false,
205
+ "attribute": "level",
206
+ "defaultValue": "'secondary'"
207
+ },
208
+ "weight": {
209
+ "type": "string",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "WeightTypes",
213
+ "resolved": "\"heavy\" | \"soft\" | \"strong\"",
214
+ "references": {
215
+ "WeightTypes": {
216
+ "location": "import",
217
+ "path": "../../shared/types",
218
+ "id": "src/shared/types.d.ts::WeightTypes",
219
+ "referenceLocation": "WeightTypes"
220
+ }
221
+ }
222
+ },
223
+ "required": false,
224
+ "optional": false,
225
+ "docs": {
226
+ "tags": [],
227
+ "text": "Font weight of the rendered name, passed through to `ezp-label`."
228
+ },
229
+ "getter": false,
230
+ "setter": false,
231
+ "reflect": false,
232
+ "attribute": "weight",
233
+ "defaultValue": "'soft'"
234
+ },
235
+ "placement": {
236
+ "type": "string",
237
+ "mutable": false,
238
+ "complexType": {
239
+ "original": "TooltipPlacementTypes",
240
+ "resolved": "\"bottom\" | \"top\"",
241
+ "references": {
242
+ "TooltipPlacementTypes": {
243
+ "location": "import",
244
+ "path": "../../shared/types",
245
+ "id": "src/shared/types.d.ts::TooltipPlacementTypes",
246
+ "referenceLocation": "TooltipPlacementTypes"
247
+ }
248
+ }
249
+ },
250
+ "required": false,
251
+ "optional": false,
252
+ "docs": {
253
+ "tags": [],
254
+ "text": "Side the tooltip opens on. Consumers point it away from the edge their\nrow sits against \u2014 `bottom` for the first row of a list, `top` below it."
255
+ },
256
+ "getter": false,
257
+ "setter": false,
258
+ "reflect": false,
259
+ "attribute": "placement",
260
+ "defaultValue": "'top'"
261
+ }
262
+ };
263
+ }
264
+ static get states() {
265
+ return {
266
+ "expanded": {},
267
+ "tooltipOpen": {}
268
+ };
269
+ }
270
+ static get elementRef() { return "host"; }
271
+ static get listeners() {
272
+ return [{
273
+ "name": "keydown",
274
+ "method": "handleKeyDown",
275
+ "target": "window",
276
+ "capture": true,
277
+ "passive": false
278
+ }];
279
+ }
280
+ }
@@ -30,7 +30,7 @@ export class EzpIcon {
30
30
  return (
31
31
  // Decorative: icons here always sit next to a label or live-region text,
32
32
  // so hide them from the accessibility tree to avoid double announcements.
33
- h(Host, { key: 'e1b22ece00f1260a34561c8d1efd44c2d5f37c73', class: `${this.size} ${this.framed ? 'framed' : ''}`, "aria-hidden": "true" }, h("div", { key: '0734d4b5fdc363303d69b7e5dc138f8caeaa316c', id: "glyph", innerHTML: this.glyph })));
33
+ h(Host, { key: 'f1a45d38b75ccf4e0c5e6200d9d04c7e5766bfbc', class: `${this.size} ${this.framed ? 'framed' : ''}`, "aria-hidden": "true" }, h("div", { key: '70f6963181d31089fefb662079e1e075540d2fe7', id: "glyph", innerHTML: this.glyph })));
34
34
  }
35
35
  static get is() { return "ezp-icon"; }
36
36
  static get encapsulation() { return "shadow"; }
@@ -32,7 +32,7 @@ export class EzpIconButton {
32
32
  // Icon-only control: derive an accessible name from the icon so screen
33
33
  // readers announce something meaningful (e.g. "menu", "printer").
34
34
  const label = this.icon.replace(/[-_]/g, ' ');
35
- return (h(Host, { key: '7d3d43ec31503ff7ecc87e9f498ee5b2d09d5d96', class: `${this.level}` }, h(TagType, Object.assign({ key: 'b7d5c646bb66ebff92d661574c647f8a2773a908', id: "button", "aria-label": label }, attributes), h("ezp-icon", { key: 'bc4c322b7c9389a8aaa27feac7084ae9e1befaa4', name: this.icon }))));
35
+ return (h(Host, { key: 'd67a43c2b91eaa4fa79dd8559824f3ffc23757b2', class: `${this.level}` }, h(TagType, Object.assign({ key: '3b11b4e0c40c8f900496ae03a4eee11f0980cd80', id: "button", "aria-label": label }, attributes), h("ezp-icon", { key: '14a35e8f779628197f7dd89219792d7809990631', name: this.icon }))));
36
36
  }
37
37
  static get is() { return "ezp-icon-button"; }
38
38
  static get encapsulation() { return "shadow"; }
@@ -34,13 +34,22 @@
34
34
  cursor: text;
35
35
  display: grid;
36
36
  gap: var(--ezp-spacing-3);
37
- grid-template: var(--ezp-input-grid-template, auto/auto auto 1fr);
37
+ grid-template: var(--ezp-input-grid-template, auto/auto 1fr);
38
38
  height: 56px;
39
39
  padding: var(--ezp-spacing-2) var(--ezp-spacing-3);
40
40
  position: relative;
41
41
  z-index: var(--ezp-input-z-index, 3);
42
42
  }
43
+ :host(.has-icon) {
44
+ --ezp-input-grid-template: auto / auto auto 1fr;
45
+ }
46
+
43
47
  :host([suffix]) {
48
+ --ezp-input-grid-template: auto / auto 1fr auto;
49
+ --ezp-input-input-padding-right: 0;
50
+ }
51
+
52
+ :host([suffix].has-icon) {
44
53
  --ezp-input-grid-template: auto / auto auto 1fr auto;
45
54
  --ezp-input-input-padding-right: 0;
46
55
  }
@@ -73,8 +82,8 @@
73
82
  font-family: inherit;
74
83
  font-feature-settings: "tnum";
75
84
  font-size: 14px;
76
- font-weight: 600;
77
85
  -webkit-font-smoothing: antialiased;
86
+ font-weight: 600;
78
87
  height: 30px;
79
88
  letter-spacing: -0.0062235443em;
80
89
  margin: 0;
@@ -12,8 +12,6 @@ export class EzpInput {
12
12
  /** Description... */
13
13
  this.type = 'text';
14
14
  /** Description... */
15
- this.icon = 'color';
16
- /** Description... */
17
15
  this.placeholder = '';
18
16
  /**
19
17
  *
@@ -46,7 +44,8 @@ export class EzpInput {
46
44
  }, 500);
47
45
  }
48
46
  render() {
49
- return (h(Host, { key: 'ba8958137bce0592dbe4ec23c03284885f570e27', class: { focused: this.focused }, onClick: this.setFocus }, h("ezp-icon", { key: '9d3b108841ffdabec9b9a98d6d6b2ea19fba37fc', id: "icon", name: this.icon }), h("ezp-label", { key: '5fee00202e9c6407bddf8a1b7090d983d79e42b3', id: "label", noWrap: true, level: "secondary", text: this.label }), h("input", { key: '99c71e9c6d29193046bd0b6094efbac828ffab15', id: "input", type: this.type, value: this.value, placeholder: this.placeholder, "aria-label": this.label, onInput: (event) => this.handleChange(event), ref: (input) => (this.input = input), onFocus: this.handleFocus, onBlur: this.handleBlur }), this.suffix ? h("ezp-label", { id: "suffix", level: "secondary", text: this.suffix }) : null));
47
+ const hasIcon = !!this.icon;
48
+ return (h(Host, { key: 'f36f5811ba4e86b0aa3f53be916220136a1d2443', class: { focused: this.focused, 'has-icon': hasIcon }, onClick: this.setFocus }, hasIcon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '88f93411e1463b23ca4ae88d278a69df5038509d', id: "label", noWrap: true, level: "secondary", text: this.label }), h("input", { key: 'b23ba3c8fea465a559e9c6d7b3da50152b412a1c', id: "input", type: this.type, value: this.value, placeholder: this.placeholder, "aria-label": this.label, onInput: (event) => this.handleChange(event), ref: (input) => (this.input = input), onFocus: this.handleFocus, onBlur: this.handleBlur }), this.suffix ? h("ezp-label", { id: "suffix", level: "secondary", text: this.suffix }) : null));
50
49
  }
51
50
  static get is() { return "ezp-input"; }
52
51
  static get encapsulation() { return "shadow"; }
@@ -145,8 +144,7 @@ export class EzpInput {
145
144
  "getter": false,
146
145
  "setter": false,
147
146
  "reflect": false,
148
- "attribute": "icon",
149
- "defaultValue": "'color'"
147
+ "attribute": "icon"
150
148
  },
151
149
  "suffix": {
152
150
  "type": "string",
@@ -17,13 +17,29 @@ export class EzpLabel {
17
17
  /** Description... */
18
18
  this.weight = 'soft';
19
19
  }
20
+ /**
21
+ *
22
+ * Public methods
23
+ *
24
+ */
25
+ /** Whether the text is currently clipped — `ellipsis` only bites when the
26
+ * text outgrows the space it was given, which callers cannot tell from the
27
+ * props alone. Lets a caller offer the full text only when it is needed. */
28
+ async isTruncated() {
29
+ var _a;
30
+ const text = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#text');
31
+ if (!text)
32
+ return false;
33
+ // A pixel of slack: sub-pixel layout rounds scrollWidth up on its own.
34
+ return text.scrollWidth > text.clientWidth + 1;
35
+ }
20
36
  /**
21
37
  *
22
38
  * Render method
23
39
  *
24
40
  */
25
41
  render() {
26
- return (h(Host, { key: '2dc1901cc1a083e659eb7224a3e34566145e89c2', class: `${this.level} ${this.weight} ${this.ellipsis ? 'ellipsis' : ''} ${this.noWrap ? 'no-wrap' : ''}` }, h("div", { key: '8919f66e8401b3e2797d0ab9ce50f42c0b244348', id: "text" }, this.text)));
42
+ return (h(Host, { key: '42139679511e711132912a1f762d345951fd1774', class: `${this.level} ${this.weight} ${this.ellipsis ? 'ellipsis' : ''} ${this.noWrap ? 'no-wrap' : ''}` }, h("div", { key: '5e54e8142d274cacb375cce8d5ef52ccdeaeec84', id: "text" }, this.text)));
27
43
  }
28
44
  static get is() { return "ezp-label"; }
29
45
  static get encapsulation() { return "shadow"; }
@@ -155,4 +171,26 @@ export class EzpLabel {
155
171
  }
156
172
  };
157
173
  }
174
+ static get methods() {
175
+ return {
176
+ "isTruncated": {
177
+ "complexType": {
178
+ "signature": "() => Promise<boolean>",
179
+ "parameters": [],
180
+ "references": {
181
+ "Promise": {
182
+ "location": "global",
183
+ "id": "global::Promise"
184
+ }
185
+ },
186
+ "return": "Promise<boolean>"
187
+ },
188
+ "docs": {
189
+ "text": "Whether the text is currently clipped \u2014 `ellipsis` only bites when the\ntext outgrows the space it was given, which callers cannot tell from the\nprops alone. Lets a caller offer the full text only when it is needed.",
190
+ "tags": []
191
+ }
192
+ }
193
+ };
194
+ }
195
+ static get elementRef() { return "host"; }
158
196
  }