@ezeep/ezeep-js 1.0.166 → 1.0.167

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 (61) hide show
  1. package/dist/cjs/ezeep.cjs.js +2 -2
  2. package/dist/cjs/ezp-auth_14.cjs.entry.js +62 -76
  3. package/dist/cjs/{index-baa7689a.js → index-0b159f85.js} +6 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/components/ezp-auth/ezp-auth.css +2 -2
  6. package/dist/collection/components/ezp-auth/ezp-auth.js +25 -4
  7. package/dist/collection/components/ezp-backdrop/ezp-backdrop.css +1 -1
  8. package/dist/collection/components/ezp-dialog/ezp-dialog.css +5 -5
  9. package/dist/collection/components/ezp-icon/ezp-icon.css +1 -1
  10. package/dist/collection/components/ezp-icon-button/ezp-icon-button.css +16 -16
  11. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +10 -9
  12. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +29 -47
  13. package/dist/collection/components/ezp-printing/ezp-printing.css +203 -133
  14. package/dist/collection/components/ezp-printing/ezp-printing.js +4 -2
  15. package/dist/collection/components/ezp-select/ezp-select.css +21 -21
  16. package/dist/collection/components/ezp-select/ezp-select.js +5 -4
  17. package/dist/collection/components/ezp-status/ezp-status.css +7 -8
  18. package/dist/collection/components/ezp-status/ezp-status.js +2 -3
  19. package/dist/collection/components/ezp-stepper/ezp-stepper.css +12 -12
  20. package/dist/collection/components/ezp-text-button/ezp-text-button.css +14 -14
  21. package/dist/collection/components/ezp-upload/ezp-upload.css +6 -6
  22. package/dist/collection/components/ezp-upload/ezp-upload.js +9 -7
  23. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +33 -29
  24. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
  25. package/dist/custom-elements/index.js +63 -77
  26. package/dist/directives/proxies.ts +2 -2
  27. package/dist/esm/ezeep.js +2 -2
  28. package/dist/esm/ezp-auth_14.entry.js +62 -76
  29. package/dist/esm/{index-18d4bf15.js → index-13f75d28.js} +6 -1
  30. package/dist/esm/loader.js +2 -2
  31. package/dist/esm-es5/ezeep.js +1 -1
  32. package/dist/esm-es5/ezp-auth_14.entry.js +3 -3
  33. package/dist/esm-es5/index-13f75d28.js +1 -0
  34. package/dist/esm-es5/loader.js +1 -1
  35. package/dist/ezeep/ezeep.esm.js +1 -1
  36. package/dist/ezeep/ezeep.js +1 -1
  37. package/{www/build/p-80d5c308.system.js → dist/ezeep/p-16c7584d.system.js} +1 -1
  38. package/dist/ezeep/p-17f25f95.js +1 -0
  39. package/dist/ezeep/{p-cec0b069.system.entry.js → p-9ac499ef.system.entry.js} +3 -3
  40. package/dist/ezeep/{p-a91289a6.entry.js → p-a84d0e34.entry.js} +2 -2
  41. package/dist/ezeep/p-c04b764e.system.js +1 -0
  42. package/dist/types/components/ezp-auth/ezp-auth.d.ts +1 -0
  43. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +1 -0
  44. package/dist/types/components/ezp-upload/ezp-upload.d.ts +2 -6
  45. package/dist/types/components.d.ts +2 -0
  46. package/dist/types/shared/types.d.ts +3 -2
  47. package/package.json +3 -1
  48. package/www/build/ezeep.esm.js +1 -1
  49. package/www/build/ezeep.js +1 -1
  50. package/{dist/ezeep/p-80d5c308.system.js → www/build/p-16c7584d.system.js} +1 -1
  51. package/www/build/p-17f25f95.js +1 -0
  52. package/www/build/{p-cec0b069.system.entry.js → p-9ac499ef.system.entry.js} +3 -3
  53. package/www/build/{p-a91289a6.entry.js → p-a84d0e34.entry.js} +2 -2
  54. package/www/build/p-c04b764e.system.js +1 -0
  55. package/www/data/locales/en.json +3 -1
  56. package/www/index.html +8 -1
  57. package/dist/esm-es5/index-18d4bf15.js +0 -1
  58. package/dist/ezeep/p-d9b69b53.js +0 -1
  59. package/dist/ezeep/p-f96ca6a7.system.js +0 -1
  60. package/www/build/p-d9b69b53.js +0 -1
  61. package/www/build/p-f96ca6a7.system.js +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-baa7689a.js');
5
+ const index = require('./index-0b159f85.js');
6
6
  const appGlobals = require('./app-globals-53afb196.js');
7
7
 
8
8
  /*
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
16
16
  if (typeof window === 'undefined') return Promise.resolve();
17
17
  return patchEsm().then(() => {
18
18
  appGlobals.globalScripts();
19
- return index.bootstrapLazy([["ezp-auth_14.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[64],"logOut":[64],"getSasUri":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"printProcessing":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32]},[[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],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
19
+ return index.bootstrapLazy([["ezp-auth_14.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[64],"logOut":[64],"getSasUri":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"printProcessing":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32]},[[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],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
20
20
  });
21
21
  };
22
22
 
@@ -4,7 +4,7 @@
4
4
  *
5
5
  */
6
6
  :host {
7
- --ezp-color-theme-solid: var(--ezp-color-cyan-solid);
8
- --ezp-color-theme-translucent: var(--ezp-color-cyan-translucent);
7
+ --ezp-theme-solid: var(--ezp-accent-cyan-solid);
8
+ --ezp-theme-translucent: var(--ezp-accent-cyan-translucent);
9
9
  display: block;
10
10
  }
@@ -1,4 +1,4 @@
1
- import { Component, Host, h, Prop, State, Event, Listen } from '@stencil/core';
1
+ import { Component, Host, h, Prop, State, Event, Listen, } from '@stencil/core';
2
2
  import { EzpAuthorizationService } from '../../services/auth';
3
3
  import authStore from '../../services/auth';
4
4
  import i18next from 'i18next';
@@ -31,6 +31,11 @@ export class EzpAuth {
31
31
  then we load it in the already opened secondary window and then
32
32
  we bring such window back on top/in front of its parent window. */
33
33
  this.oauthPopupWindow = window.open(url, name, windowFeatures);
34
+ if (!this.oauthPopupWindow ||
35
+ this.oauthPopupWindow.closed ||
36
+ typeof this.oauthPopupWindow.closed == 'undefined') {
37
+ alert('popup blocked');
38
+ }
34
39
  this.oauthPopupWindow.focus();
35
40
  }
36
41
  else {
@@ -58,13 +63,12 @@ export class EzpAuth {
58
63
  await this.auth.generateCodeChallenge(authStore.state.codeVerifier);
59
64
  this.auth.buildAuthURI();
60
65
  }
61
- if (this.hidelogin) {
66
+ if (this.hidelogin && this.trigger === 'button') {
62
67
  this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login');
63
68
  }
64
69
  }
65
70
  render() {
66
- return this.hidelogin ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : (h(Host, null,
67
- h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login" })));
71
+ return (h(Host, null, this.hidelogin && this.trigger === 'button' ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.next') })) : (h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login" }))));
68
72
  }
69
73
  static get is() { return "ezp-auth"; }
70
74
  static get encapsulation() { return "shadow"; }
@@ -125,6 +129,23 @@ export class EzpAuth {
125
129
  },
126
130
  "attribute": "hidelogin",
127
131
  "reflect": false
132
+ },
133
+ "trigger": {
134
+ "type": "string",
135
+ "mutable": false,
136
+ "complexType": {
137
+ "original": "string",
138
+ "resolved": "string",
139
+ "references": {}
140
+ },
141
+ "required": false,
142
+ "optional": false,
143
+ "docs": {
144
+ "tags": [],
145
+ "text": ""
146
+ },
147
+ "attribute": "trigger",
148
+ "reflect": false
128
149
  }
129
150
  }; }
130
151
  static get states() { return {
@@ -5,7 +5,7 @@
5
5
  */
6
6
  :host {
7
7
  animation: var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);
8
- background: var(--ezp-color-overlay-primary);
8
+ background: var(--ezp-core-backdrop);
9
9
  border-radius: 6px;
10
10
  display: block;
11
11
  height: 100%;
@@ -1,7 +1,7 @@
1
1
  :host {
2
- --ezp-icon-fill: var(--ezp-color-theme-solid);
2
+ --ezp-icon-fill: var(--ezp-theme-solid);
3
3
  align-content: center;
4
- background: var(--ezp-color-overlay-primary);
4
+ background: var(--ezp-core-backdrop);
5
5
  display: grid;
6
6
  grid-template: auto/minmax(auto, 280px);
7
7
  height: 100%;
@@ -13,9 +13,9 @@
13
13
  }
14
14
 
15
15
  #box {
16
- background: var(--ezp-color-surface-tertiary);
16
+ background: var(--ezp-core-surface-tertiary);
17
17
  border-radius: 6px;
18
- box-shadow: var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-color-overlay-secondary));
18
+ box-shadow: var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10));
19
19
  }
20
20
 
21
21
  #header {
@@ -34,7 +34,7 @@
34
34
  }
35
35
 
36
36
  #text {
37
- color: var(--ezp-color-foreground-primary);
37
+ color: var(--ezp-core-foreground-primary);
38
38
  display: flex;
39
39
  flex-direction: column;
40
40
  gap: var(--ezp-spacing-4);
@@ -15,7 +15,7 @@
15
15
  width: var(--ezp-icon-width, var(--ezp-icon-size));
16
16
  }
17
17
  :host(.framed) {
18
- --ezp-icon-background: var(--ezp-color-shade-primary);
18
+ --ezp-icon-background: var(--ezp-core-shade-primary);
19
19
  --ezp-icon-borderRadius: 50%;
20
20
  --ezp-icon-padding: var(--ezp-icon-frame);
21
21
  }
@@ -7,35 +7,35 @@
7
7
  display: block;
8
8
  }
9
9
  :host(.primary) {
10
- --ezp-iconButton-background-disabled: var(--ezp-color-shade-primary);
11
- --ezp-iconButton-background-init: var(--ezp-color-theme-solid);
12
- --ezp-iconButton-color-disabled: var(--ezp-color-foreground-tertiary);
13
- --ezp-iconButton-color-init: var(--ezp-color-on-theme);
10
+ --ezp-iconButton-background-disabled: var(--ezp-core-shade-primary);
11
+ --ezp-iconButton-background-init: var(--ezp-theme-solid);
12
+ --ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
13
+ --ezp-iconButton-color-init: var(--ezp-white-100);
14
14
  --ezp-iconButton-opacity-active: 0.74;
15
15
  --ezp-iconButton-opacity-hover: 0.84;
16
16
  }
17
17
 
18
18
  :host(.secondary) {
19
- --ezp-iconButton-background-active: var(--ezp-color-shade-tertiary);
20
- --ezp-iconButton-background-disabled: var(--ezp-color-shade-primary);
21
- --ezp-iconButton-background-hover: var(--ezp-color-shade-secondary);
22
- --ezp-iconButton-background-init: var(--ezp-color-shade-primary);
23
- --ezp-iconButton-color-disabled: var(--ezp-color-foreground-tertiary);
24
- --ezp-iconButton-color-init: var(--ezp-color-theme-solid);
19
+ --ezp-iconButton-background-active: var(--ezp-core-shade-tertiary);
20
+ --ezp-iconButton-background-disabled: var(--ezp-core-shade-primary);
21
+ --ezp-iconButton-background-hover: var(--ezp-core-shade-secondary);
22
+ --ezp-iconButton-background-init: var(--ezp-core-shade-primary);
23
+ --ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
24
+ --ezp-iconButton-color-init: var(--ezp-theme-solid);
25
25
  }
26
26
 
27
27
  :host(.tertiary) {
28
- --ezp-iconButton-background-active: var(--ezp-color-shade-secondary);
29
- --ezp-iconButton-background-hover: var(--ezp-color-shade-primary);
28
+ --ezp-iconButton-background-active: var(--ezp-core-shade-secondary);
29
+ --ezp-iconButton-background-hover: var(--ezp-core-shade-primary);
30
30
  --ezp-iconButton-background-init: transparent;
31
- --ezp-iconButton-color-disabled: var(--ezp-color-foreground-tertiary);
32
- --ezp-iconButton-color-init: var(--ezp-color-theme-solid);
31
+ --ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
32
+ --ezp-iconButton-color-init: var(--ezp-theme-solid);
33
33
  }
34
34
 
35
35
  :host(.quaternary) {
36
36
  --ezp-iconButton-background-init: transparent;
37
- --ezp-iconButton-color-disabled: var(--ezp-color-foreground-tertiary);
38
- --ezp-iconButton-color-init: var(--ezp-color-theme-solid);
37
+ --ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
38
+ --ezp-iconButton-color-init: var(--ezp-theme-solid);
39
39
  --ezp-iconButton-opacity-active: 0.58;
40
40
  --ezp-iconButton-opacity-hover: 0.74;
41
41
  }
@@ -30,30 +30,31 @@
30
30
  */
31
31
  :host {
32
32
  align-content: center;
33
- background: var(--ezp-color-overlay-primary);
33
+ background: var(--ezp-core-backdrop);
34
34
  display: grid;
35
- grid-template: auto/320px;
35
+ grid-template: auto/var(--ezp-printerSelection-width, 320px);
36
36
  height: 100vh;
37
37
  justify-content: center;
38
38
  left: 0;
39
39
  position: fixed;
40
40
  top: 0;
41
41
  width: 100vw;
42
+ z-index: 1;
42
43
  }
43
44
 
44
45
  #box {
45
- background: var(--ezp-color-surface-tertiary);
46
+ background: var(--ezp-core-surface-tertiary);
46
47
  border-radius: 6px;
47
- box-shadow: var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-color-overlay-secondary));
48
+ box-shadow: var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-black-10));
48
49
  position: relative;
49
50
  }
50
51
 
51
52
  #header {
52
53
  border-radius: 6px 6px 0 0;
53
- box-shadow: var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);
54
- color: var(--ezp-color-foreground-primary);
54
+ box-shadow: var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);
55
+ color: var(--ezp-core-foreground-primary);
55
56
  display: grid;
56
- grid-column-gap: var(--ezp-spacing-1);
57
+ grid-column-gap: var(--ezp-spacing-2);
57
58
  grid-template-columns: auto 1fr auto;
58
59
  padding: var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4);
59
60
  position: relative;
@@ -67,7 +68,7 @@
67
68
  }
68
69
 
69
70
  #body {
70
- background: var(--ezp-color-surface-secondary);
71
+ background: var(--ezp-core-surface-secondary);
71
72
  box-shadow: var(--ezp-printerSelection-body-boxShadow, none);
72
73
  display: flex;
73
74
  flex-direction: column;
@@ -77,7 +78,7 @@
77
78
 
78
79
  #footer {
79
80
  border-radius: 0 0 6px 6px;
80
- box-shadow: var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-color-outline);
81
+ box-shadow: var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-core-outline);
81
82
  display: grid;
82
83
  grid-column-gap: var(--ezp-spacing-2);
83
84
  grid-template-columns: repeat(2, 1fr);
@@ -50,11 +50,11 @@ export class EzpPrinterSelection {
50
50
  paper: '',
51
51
  paperid: '',
52
52
  color: false,
53
- duplex: false,
54
- duplexmode: '',
55
- orientation: '',
53
+ duplex: true,
54
+ duplexmode: 1,
55
+ orientation: 1,
56
56
  copies: '',
57
- resolution: '',
57
+ resolution: 0,
58
58
  };
59
59
  /**
60
60
  *
@@ -77,6 +77,7 @@ export class EzpPrinterSelection {
77
77
  this.MAX_POLL_ATTEMPTS = Infinity;
78
78
  /** Description... */
79
79
  this.handlePrint = async () => {
80
+ this.printButton.blur();
80
81
  this.printProcessing = true;
81
82
  // we have to initialse this obj with empty strings to display the select component
82
83
  // but don't want to send any attributes with empty strings to the API
@@ -203,7 +204,7 @@ export class EzpPrinterSelection {
203
204
  this.selectedPrinter = JSON.parse(localStorage.getItem('printer'));
204
205
  }
205
206
  else {
206
- this.selectedPrinter = { id: '', location: '', name: '' };
207
+ this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
207
208
  }
208
209
  }
209
210
  getUserInfo() {
@@ -218,9 +219,11 @@ export class EzpPrinterSelection {
218
219
  case 'printer':
219
220
  this.selectedPrinter.id = eventDetails.id;
220
221
  this.selectedPrinter.name = eventDetails.title;
222
+ this.selectedPrinter.is_queue = eventDetails.is_queue;
221
223
  await this.printService
222
224
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
223
225
  .then((data) => (this.selectedPrinterConfig = data[0]));
226
+ console.log(this.selectedPrinterConfig);
224
227
  this.setDefaultPaperFormat();
225
228
  break;
226
229
  case 'color':
@@ -325,8 +328,10 @@ export class EzpPrinterSelection {
325
328
  else {
326
329
  format = 'A4';
327
330
  }
328
- this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
329
- this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
331
+ if (this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format))) {
332
+ this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
333
+ this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
334
+ }
330
335
  }
331
336
  /**
332
337
  *
@@ -385,10 +390,10 @@ export class EzpPrinterSelection {
385
390
  ? i18next.t('printer_selection.prepare_upload')
386
391
  : this.uploading
387
392
  ? i18next.t('printer_selection.uploading')
388
- : i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
393
+ : i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printSuccess && this.selectedPrinter.is_queue ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
389
394
  h("div", { id: "header" },
390
395
  h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }),
391
- h("ezp-label", { text: !this.notSupported ? this.filename : '' }),
396
+ h("ezp-label", { text: !this.notSupported ? this.filename : '', ellipsis: true }),
392
397
  !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu }))),
393
398
  h("div", { id: "body" },
394
399
  h("div", { id: "printer" },
@@ -397,13 +402,10 @@ export class EzpPrinterSelection {
397
402
  : i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
398
403
  id: printer.id,
399
404
  title: printer.name,
400
- meta: printer.location !== ''
401
- ? printer.location
402
- : '',
405
+ meta: printer.location !== '' ? printer.location : '',
403
406
  type: 'printer',
404
- })),
405
- // preSelected={this.selectedPrinter ? this.selectedPrinter.name : null}
406
- disabled: !(this.printers.length > 0) })),
407
+ is_queue: printer.is_queue,
408
+ })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })),
407
409
  h("div", { id: "options" },
408
410
  h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
409
411
  ? [
@@ -427,61 +429,41 @@ export class EzpPrinterSelection {
427
429
  meta: '',
428
430
  type: 'color',
429
431
  },
430
- ],
431
- // preSelected={
432
- // this.selectedProperties.color
433
- // ? i18next.t('printer_selection.color_color')
434
- // : i18next.t('printer_selection.color_grayscale')
435
- // }
436
- disabled: !this.selectedPrinterConfig.Color }),
432
+ ], preSelected: this.selectedPrinter.id
433
+ ? this.selectedProperties.color
434
+ ? i18next.t('printer_selection.color_color')
435
+ : i18next.t('printer_selection.color_grayscale')
436
+ : null, disabled: !this.selectedPrinterConfig.Color }),
437
437
  h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: this.duplexOptions.map((option) => ({
438
438
  id: option.id,
439
439
  title: option.title,
440
440
  meta: '',
441
441
  type: 'duplex',
442
- })),
443
- // preSelected={
444
- // this.selectedProperties.duplex
445
- // ? this.duplexOptions.find(
446
- // (option) => option.id === this.selectedProperties.duplexmode
447
- // ).id
448
- // : null
449
- // }
450
- disabled: !this.selectedPrinterConfig.DuplexSupported }),
442
+ })), preSelected: this.selectedPrinter.id && this.selectedProperties.duplex
443
+ ? this.duplexOptions.find((option) => option.id === this.selectedProperties.duplexmode).id
444
+ : null, disabled: !this.selectedPrinterConfig.DuplexSupported }),
451
445
  h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats.map((format) => ({
452
446
  id: format.Id,
453
447
  title: format.Name,
454
448
  meta: `${format.XRes} x ${format.YRes}`,
455
449
  type: 'format',
456
- })),
457
- // preSelected={this.selectedProperties.paper ? this.selectedProperties.paper : null}
458
- disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }),
450
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.paper : null, disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }),
459
451
  h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.OrientationsSupported.map((orientation, index) => ({
460
452
  id: index + 1,
461
453
  title: i18next.t(`printer_selection.orientation_${orientation}`),
462
454
  meta: '',
463
455
  type: 'orientation',
464
- })),
465
- // preSelected={
466
- // this.selectedProperties.orientation
467
- // ? this.selectedProperties.orientation
468
- // : null
469
- // }
470
- disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
456
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
471
457
  h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Resolutions.map((option, index) => ({
472
458
  id: index,
473
459
  title: option,
474
460
  meta: '',
475
461
  type: 'quality',
476
- })),
477
- // preSelected={
478
- // this.selectedProperties.resolution ? this.selectedProperties.resolution : null
479
- // }
480
- disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })),
462
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.resolution : null, disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })),
481
463
  h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })),
482
464
  h("div", { id: "footer" },
483
465
  h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel') }),
484
- h("ezp-text-button", { disabled: this.selectedPrinter.id === '', type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print') })),
466
+ h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button) })),
485
467
  !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
486
468
  }
487
469
  static get is() { return "ezp-printer-selection"; }