@ezeep/ezeep-js 1.0.138 → 1.0.142

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 (56) hide show
  1. package/dist/cjs/ezeep.cjs.js +1 -1
  2. package/dist/cjs/ezp-auth_12.cjs.entry.js +340 -46
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/components/ezp-icon/assets/glyph-dark.svg +3 -0
  5. package/dist/collection/components/ezp-icon/assets/glyph-light.svg +3 -0
  6. package/dist/collection/components/ezp-icon/assets/glyph-system.svg +3 -0
  7. package/dist/collection/components/ezp-icon/ezp-icon.css +2 -2
  8. package/dist/collection/components/ezp-icon/ezp-icon.js +1 -1
  9. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
  10. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +2 -3
  11. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +323 -38
  12. package/dist/collection/components/ezp-printing/ezp-printing.css +211 -120
  13. package/dist/collection/components/ezp-printing/ezp-printing.js +43 -1
  14. package/dist/collection/components/ezp-progress/ezp-progress.css +1 -1
  15. package/dist/collection/components/ezp-select/ezp-select.js +1 -1
  16. package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
  17. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +45 -1
  18. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +15 -2
  19. package/dist/collection/services/print.js +17 -1
  20. package/dist/collection/services/user.js +1 -0
  21. package/dist/custom-elements/index.js +342 -48
  22. package/dist/directives/proxies.ts +4 -4
  23. package/dist/esm/ezeep.js +1 -1
  24. package/dist/esm/ezp-auth_12.entry.js +340 -46
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/esm-es5/ezeep.js +1 -1
  27. package/dist/esm-es5/ezp-auth_12.entry.js +1 -1
  28. package/dist/esm-es5/loader.js +1 -1
  29. package/dist/ezeep/assets/glyph-dark.svg +3 -0
  30. package/dist/ezeep/assets/glyph-light.svg +3 -0
  31. package/dist/ezeep/assets/glyph-system.svg +3 -0
  32. package/dist/ezeep/ezeep.esm.js +1 -1
  33. package/dist/ezeep/p-c488ee3f.system.js +1 -1
  34. package/dist/ezeep/p-c7eac982.system.entry.js +1 -0
  35. package/dist/ezeep/p-c9ef1ce0.entry.js +1 -0
  36. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +3 -1
  37. package/dist/types/components/ezp-printing/ezp-printing.d.ts +3 -1
  38. package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +2 -0
  39. package/dist/types/components.d.ts +7 -1
  40. package/dist/types/services/print.d.ts +8 -1
  41. package/dist/types/services/user.d.ts +1 -0
  42. package/dist/types/shared/types.d.ts +4 -0
  43. package/package.json +1 -1
  44. package/readme.md +3 -4
  45. package/www/build/assets/glyph-dark.svg +3 -0
  46. package/www/build/assets/glyph-light.svg +3 -0
  47. package/www/build/assets/glyph-system.svg +3 -0
  48. package/www/build/ezeep.esm.js +1 -1
  49. package/www/build/p-c488ee3f.system.js +1 -1
  50. package/www/build/p-c7eac982.system.entry.js +1 -0
  51. package/www/build/p-c9ef1ce0.entry.js +1 -0
  52. package/www/index.html +1 -1
  53. package/dist/ezeep/p-12ca28b7.system.entry.js +0 -1
  54. package/dist/ezeep/p-f4d2e700.entry.js +0 -1
  55. package/www/build/p-12ca28b7.system.entry.js +0 -1
  56. package/www/build/p-f4d2e700.entry.js +0 -1
@@ -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_12.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"printOpen":[32],"authOpen":[32],"open":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authShow","listenAuthShow"],[0,"printShow","listenPrintShow"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1],"fileurl":[1],"filetype":[1],"loading":[32],"options":[32],"printInProgress":[32],"userMenuOpen":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedProperties":[32],"previouslySelectedProperties":[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"auth":[32],"authURI":[32],"accessToken":[32]}],[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"],"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-progress",{"status":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1]}],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon",{"name":[1],"size":[1]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
19
+ return index.bootstrapLazy([["ezp-auth_12.cjs",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"printOpen":[32],"authOpen":[32],"open":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authShow","listenAuthShow"],[0,"printShow","listenPrintShow"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1],"fileurl":[1],"filetype":[1],"fileid":[1],"loading":[32],"options":[32],"printInProgress":[32],"userMenuOpen":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"previouslySelectedProperties":[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"auth":[32],"authURI":[32],"accessToken":[32]}],[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"],"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-progress",{"status":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1]}],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon",{"name":[1],"size":[1]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
20
20
  });
21
21
  };
22
22
 
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.99996 14.9999C10.9705 14.9999 15 10.9705 15 5.99994C15 4.54599 14.6552 3.17257 14.0429 1.95697C16.9831 3.43778 19 6.48334 19 9.99997C19 14.9705 14.9706 19 10 19C6.4834 19 3.43785 16.9831 1.95703 14.0429C3.17262 14.6552 4.54603 14.9999 5.99996 14.9999Z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.17318 1.7612C7.68343 1.54985 8.26839 1.79215 8.47974 2.30239L9.24511 4.15015C9.45646 4.6604 9.21416 5.24536 8.70392 5.45671C8.19367 5.66806 7.6087 5.42576 7.39735 4.91552L6.63199 3.06776C6.42064 2.55751 6.66294 1.97255 7.17318 1.7612ZM16 11C16 13.7614 13.7614 16 11 16C8.23859 16 6.00002 13.7614 6.00002 11C6.00002 8.23859 8.23859 6.00002 11 6.00002C13.7614 6.00002 16 8.23859 16 11ZM14.6027 17.0845C14.3913 16.5743 13.8064 16.332 13.2961 16.5433C12.7859 16.7547 12.5436 17.3396 12.7549 17.8499L13.5203 19.6976C13.7316 20.2079 14.3166 20.4502 14.8268 20.2388C15.3371 20.0275 15.5794 19.4425 15.368 18.9323L14.6027 17.0845ZM1.76126 7.17318C1.97261 6.66294 2.55758 6.42064 3.06782 6.63199L4.91558 7.39735C5.42582 7.6087 5.66813 8.19367 5.45678 8.70392C5.24543 9.21416 4.66046 9.45646 4.15021 9.24511L2.30245 8.47974C1.79221 8.26839 1.54991 7.68343 1.76126 7.17318ZM19.6976 13.5203L17.8499 12.7549C17.3396 12.5436 16.7547 12.7859 16.5433 13.2961C16.332 13.8064 16.5743 14.3913 17.0845 14.6027L18.9323 15.368C19.4425 15.5794 20.0275 15.3371 20.2388 14.8268C20.4502 14.3166 20.2079 13.7316 19.6976 13.5203ZM1.7612 14.8269C1.54985 14.3166 1.79215 13.7316 2.30239 13.5203L4.15015 12.7549C4.6604 12.5436 5.24536 12.7859 5.45671 13.2961C5.66806 13.8064 5.42576 14.3913 4.91552 14.6027L3.06776 15.368C2.55751 15.5794 1.97255 15.3371 1.7612 14.8269ZM17.0845 7.39737C16.5743 7.60872 16.332 8.19368 16.5433 8.70393C16.7547 9.21417 17.3396 9.45648 17.8499 9.24513L19.6976 8.47976C20.2079 8.26841 20.4502 7.68344 20.2388 7.1732C20.0275 6.66295 19.4425 6.42065 18.9323 6.632L17.0845 7.39737ZM7.17318 20.2388C6.66294 20.0274 6.42064 19.4425 6.63199 18.9322L7.39735 17.0845C7.6087 16.5742 8.19367 16.3319 8.70392 16.5433C9.21416 16.7546 9.45646 17.3396 9.24511 17.8498L8.47974 19.6976C8.26839 20.2078 7.68343 20.4501 7.17318 20.2388ZM12.7549 4.15017C12.5436 4.66042 12.7859 5.24538 13.2961 5.45673C13.8064 5.66808 14.3913 5.42578 14.6027 4.91554L15.368 3.06778C15.5794 2.55753 15.3371 1.97257 14.8268 1.76122C14.3166 1.54987 13.7316 1.79217 13.5203 2.30241L12.7549 4.15017Z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11ZM11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11C20 6.02944 15.9706 2 11 2ZM5 11C5 12.6569 5.67157 14.1569 6.75736 15.2426L15.2426 6.75736C14.1569 5.67157 12.6569 5 11 5C7.68629 5 5 7.68629 5 11Z" />
3
+ </svg>
@@ -8,9 +8,9 @@
8
8
  display: block;
9
9
  display: grid;
10
10
  grid-template: var(--host-gridTemplate)/var(--host-gridTemplate);
11
- height: var(--host-size);
11
+ height: var(--icon-height, var(--host-size));
12
12
  justify-content: center;
13
- width: var(--host-size);
13
+ width: var(--icon-width, var(--host-size));
14
14
  }
15
15
  :host(.normal) {
16
16
  --host-size: 18px;
@@ -41,7 +41,7 @@ export class EzpIcon {
41
41
  "mutable": false,
42
42
  "complexType": {
43
43
  "original": "IconNameTypes",
44
- "resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"duplex\" | \"expand\" | \"help\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\"",
44
+ "resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"dark\" | \"duplex\" | \"expand\" | \"help\" | \"light\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\" | \"system\"",
45
45
  "references": {
46
46
  "IconNameTypes": {
47
47
  "location": "import",
@@ -100,7 +100,7 @@ export class EzpIconButton {
100
100
  "mutable": false,
101
101
  "complexType": {
102
102
  "original": "IconNameTypes",
103
- "resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"duplex\" | \"expand\" | \"help\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\"",
103
+ "resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"dark\" | \"duplex\" | \"expand\" | \"help\" | \"light\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\" | \"system\"",
104
104
  "references": {
105
105
  "IconNameTypes": {
106
106
  "location": "import",
@@ -53,12 +53,11 @@
53
53
  #container {
54
54
  background: var(--color-surface-tertiary);
55
55
  border-radius: 6px;
56
- box-shadow: var(--container-separator-position, 0 0 0 var(--hairline-width-positive)) var(--hairline-color), 0 var(--spacing-3) var(--spacing-4) 0 var(--color-shadow), 0 var(--spacing-4) var(--spacing-5) 0 var(--color-shadow), 0 var(--spacing-5) var(--spacing-6) 0 var(--color-shadow), 0 var(--spacing-6) var(--spacing-7) 0 var(--color-shadow), 0 var(--spacing-7) var(--spacing-8) 0 var(--color-shadow);
57
56
  position: relative;
58
57
  }
59
58
 
60
59
  #header {
61
- box-shadow: var(--header-separator-position, 0 var(--hairline-width-positive) 0 0) var(--hairline-color);
60
+ box-shadow: inset 0 var(--hairline-width-negative) 0 0 var(--hairline-color);
62
61
  color: var(--color-foreground-primary);
63
62
  display: grid;
64
63
  grid-column-gap: var(--spacing-1);
@@ -84,7 +83,7 @@
84
83
  }
85
84
 
86
85
  #footer {
87
- box-shadow: var(--footer-separator-position, 0 var(--hairline-width-negative) 0 0) var(--hairline-color);
86
+ box-shadow: inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);
88
87
  display: grid;
89
88
  grid-column-gap: var(--spacing-2);
90
89
  grid-template-columns: repeat(2, 1fr);
@@ -31,11 +31,225 @@ export class EzpPrinterSelection {
31
31
  this.printInProgress = false;
32
32
  this.userMenuOpen = false;
33
33
  this.selectedPrinter = { id: '', location: '', name: '' };
34
+ this.selectedPrinterConfig = {
35
+ "Collate": true,
36
+ "Color": true,
37
+ "Driver": "TP Output Gateway",
38
+ "DuplexMode": 1,
39
+ "DuplexSupported": true,
40
+ "Id": "f0c0f30c-e9ff-4e11-9181-2417fabeb23f",
41
+ "Location": "",
42
+ "MediaSupported": [
43
+ "Auto",
44
+ "Letter",
45
+ "Legal",
46
+ "Executive",
47
+ "A4",
48
+ "A5",
49
+ "B5 (JIS)",
50
+ "Umschlag 10",
51
+ "Umschlag DL",
52
+ "Umschlag C5",
53
+ "Umschlag C6",
54
+ "Umschlag Monarch",
55
+ "Jap. Postkarte",
56
+ "A6",
57
+ "JIS Chou Nr. 2 119x277 mm",
58
+ "4x6Zoll",
59
+ "5x7 Zoll",
60
+ "8x10Zoll",
61
+ "Ofuku hagaki",
62
+ "10x15 cm",
63
+ "13x18 cm",
64
+ "Karteikarte 3 x 5\"",
65
+ "Karteikarte 4x6 Zoll"
66
+ ],
67
+ "MediaSupportedId": [
68
+ 0,
69
+ 1,
70
+ 5,
71
+ 7,
72
+ 9,
73
+ 11,
74
+ 13,
75
+ 20,
76
+ 27,
77
+ 28,
78
+ 31,
79
+ 37,
80
+ 43,
81
+ 70,
82
+ 119,
83
+ 120,
84
+ 121,
85
+ 122,
86
+ 123,
87
+ 124,
88
+ 125,
89
+ 126,
90
+ 127
91
+ ],
92
+ "Name": "HP DeskJet 3630 series",
93
+ "OrientationsSupported": [
94
+ "portrait",
95
+ "landscape"
96
+ ],
97
+ "OrientationsSupportedId": [
98
+ 1,
99
+ 2
100
+ ],
101
+ "PaperFormats": [
102
+ {
103
+ "Id": 0,
104
+ "Name": "Auto",
105
+ "XRes": 0,
106
+ "YRes": 0
107
+ },
108
+ {
109
+ "Id": 1,
110
+ "Name": "Letter",
111
+ "XRes": 2159,
112
+ "YRes": 2794
113
+ },
114
+ {
115
+ "Id": 5,
116
+ "Name": "Legal",
117
+ "XRes": 2159,
118
+ "YRes": 3556
119
+ },
120
+ {
121
+ "Id": 7,
122
+ "Name": "Executive",
123
+ "XRes": 1841,
124
+ "YRes": 2667
125
+ },
126
+ {
127
+ "Id": 9,
128
+ "Name": "A4",
129
+ "XRes": 2100,
130
+ "YRes": 2970
131
+ },
132
+ {
133
+ "Id": 11,
134
+ "Name": "A5",
135
+ "XRes": 1480,
136
+ "YRes": 2100
137
+ },
138
+ {
139
+ "Id": 13,
140
+ "Name": "B5 (JIS)",
141
+ "XRes": 1820,
142
+ "YRes": 2570
143
+ },
144
+ {
145
+ "Id": 20,
146
+ "Name": "Umschlag 10",
147
+ "XRes": 1047,
148
+ "YRes": 2413
149
+ },
150
+ {
151
+ "Id": 27,
152
+ "Name": "Umschlag DL",
153
+ "XRes": 1100,
154
+ "YRes": 2200
155
+ },
156
+ {
157
+ "Id": 28,
158
+ "Name": "Umschlag C5",
159
+ "XRes": 1620,
160
+ "YRes": 2290
161
+ },
162
+ {
163
+ "Id": 31,
164
+ "Name": "Umschlag C6",
165
+ "XRes": 1140,
166
+ "YRes": 1620
167
+ },
168
+ {
169
+ "Id": 37,
170
+ "Name": "Umschlag Monarch",
171
+ "XRes": 984,
172
+ "YRes": 1905
173
+ },
174
+ {
175
+ "Id": 43,
176
+ "Name": "Jap. Postkarte",
177
+ "XRes": 1000,
178
+ "YRes": 1480
179
+ },
180
+ {
181
+ "Id": 70,
182
+ "Name": "A6",
183
+ "XRes": 1050,
184
+ "YRes": 1480
185
+ },
186
+ {
187
+ "Id": 119,
188
+ "Name": "JIS Chou Nr. 2 119x277 mm",
189
+ "XRes": 1109,
190
+ "YRes": 1460
191
+ },
192
+ {
193
+ "Id": 120,
194
+ "Name": "4x6Zoll",
195
+ "XRes": 1016,
196
+ "YRes": 1524
197
+ },
198
+ {
199
+ "Id": 121,
200
+ "Name": "5x7 Zoll",
201
+ "XRes": 1270,
202
+ "YRes": 1778
203
+ },
204
+ {
205
+ "Id": 122,
206
+ "Name": "8x10Zoll",
207
+ "XRes": 2032,
208
+ "YRes": 2540
209
+ },
210
+ {
211
+ "Id": 123,
212
+ "Name": "Ofuku hagaki",
213
+ "XRes": 2000,
214
+ "YRes": 1479
215
+ },
216
+ {
217
+ "Id": 124,
218
+ "Name": "10x15 cm",
219
+ "XRes": 1016,
220
+ "YRes": 1524
221
+ },
222
+ {
223
+ "Id": 125,
224
+ "Name": "13x18 cm",
225
+ "XRes": 1270,
226
+ "YRes": 1778
227
+ },
228
+ {
229
+ "Id": 126,
230
+ "Name": "Karteikarte 3 x 5\"",
231
+ "XRes": 762,
232
+ "YRes": 1270
233
+ },
234
+ {
235
+ "Id": 127,
236
+ "Name": "Karteikarte 4x6 Zoll",
237
+ "XRes": 1016,
238
+ "YRes": 1524
239
+ }
240
+ ],
241
+ "Resolutions": [
242
+ "Auto",
243
+ "600",
244
+ "1200"
245
+ ],
246
+ "TPUID": 1
247
+ };
34
248
  // needs to be initialised with empty strings
35
249
  this.selectedProperties = {
36
250
  paper: '',
37
251
  paperid: '',
38
- color: '',
252
+ color: false,
39
253
  duplex: false,
40
254
  duplexmode: '',
41
255
  orientation: '',
@@ -45,7 +259,7 @@ export class EzpPrinterSelection {
45
259
  this.previouslySelectedProperties = {
46
260
  paper: '',
47
261
  paperid: '',
48
- color: '',
262
+ color: false,
49
263
  duplex: false,
50
264
  duplexmode: '',
51
265
  orientation: '',
@@ -63,39 +277,88 @@ export class EzpPrinterSelection {
63
277
  };
64
278
  /** Description... */
65
279
  this.handlePrint = () => {
280
+ const validateData = (data) => {
281
+ if (data.jobstatus === 0) {
282
+ this.printInProgress = false;
283
+ return true;
284
+ }
285
+ return false;
286
+ };
287
+ const POLL_INTERVAL = 2000;
66
288
  this.printInProgress = true;
67
- this.printService
68
- .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id,
69
289
  // we have to initialse this obj with empty strings to display the select component
70
290
  // but don't want to send any attributes with empty strings to the API
71
- removeEmptyStrings(this.selectedProperties), this.filename)
72
- .then((data) => {
73
- if (data.jobid) {
74
- printStore.state.jobID = data.jobid;
75
- const POLL_INTERVAL = 2000;
76
- const validateData = (data) => {
77
- if (data.jobstatus === 0) {
291
+ removeEmptyStrings(this.selectedProperties);
292
+ // put it in store for further use
293
+ printStore.state.fileUrl = this.fileurl;
294
+ printStore.state.fileID = this.fileid;
295
+ printStore.state.fileType = this.filetype;
296
+ printStore.state.printerID = this.selectedPrinter.id;
297
+ printStore.state.printerProperties = this.selectedProperties;
298
+ printStore.state.fileName = this.filename;
299
+ if (this.fileurl) {
300
+ this.printService
301
+ .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, this.selectedProperties, this.filename)
302
+ .then((response) => {
303
+ if (response.status === 412) {
304
+ response.json().then(data => this.fileid = data.fileid);
305
+ this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, this.selectedProperties, this.filename).finally(() => this.printInProgress = false);
306
+ }
307
+ else {
308
+ return response.json();
309
+ }
310
+ })
311
+ .then((data) => {
312
+ if (data.jobid) {
313
+ printStore.state.jobID = data.jobid;
314
+ poll({
315
+ fn: this.printService.getPrintStatus,
316
+ validate: validateData,
317
+ interval: POLL_INTERVAL,
318
+ maxAttempts: 10,
319
+ })
320
+ .then(data)
321
+ .catch((err) => {
322
+ console.warn(err);
78
323
  this.printInProgress = false;
79
- return true;
80
- }
81
- return false;
82
- };
83
- poll({
84
- fn: this.printService.getPrintStatus,
85
- validate: validateData,
86
- interval: POLL_INTERVAL,
87
- maxAttempts: 10,
88
- })
89
- .then(data)
90
- .catch((err) => {
91
- console.warn(err);
324
+ });
325
+ }
326
+ else {
92
327
  this.printInProgress = false;
93
- });
94
- }
95
- else {
328
+ }
329
+ })
330
+ .catch(error => {
331
+ console.log(error);
96
332
  this.printInProgress = false;
97
- }
98
- });
333
+ });
334
+ }
335
+ else if (this.fileid) {
336
+ this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, this.selectedProperties, this.filename)
337
+ .then((response) => response.json())
338
+ .then((data) => {
339
+ if (data.jobid) {
340
+ printStore.state.jobID = data.jobid;
341
+ poll({
342
+ fn: this.printService.getPrintStatus,
343
+ validate: validateData,
344
+ interval: POLL_INTERVAL,
345
+ maxAttempts: 10,
346
+ })
347
+ .then(data)
348
+ .catch((err) => {
349
+ console.warn(err);
350
+ this.printInProgress = false;
351
+ });
352
+ }
353
+ else {
354
+ this.printInProgress = false;
355
+ }
356
+ })
357
+ .catch(error => {
358
+ console.log(error);
359
+ this.printInProgress = false;
360
+ });
361
+ }
99
362
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
100
363
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
101
364
  localStorage.setItem('previouslySelectedProperties', JSON.stringify(this.previouslySelectedProperties));
@@ -143,11 +406,14 @@ export class EzpPrinterSelection {
143
406
  this.userName = userStore.state.user.display_name;
144
407
  });
145
408
  }
146
- setSelectedProperties(eventDetails) {
409
+ async setSelectedProperties(eventDetails) {
147
410
  switch (eventDetails.type) {
148
411
  case 'printer':
149
412
  this.selectedPrinter.id = eventDetails.id;
150
413
  this.selectedPrinter.name = eventDetails.title;
414
+ await this.printService.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id).then(data => this.selectedPrinterConfig = data[0]);
415
+ console.log('selected printer config:');
416
+ console.log(this.selectedPrinterConfig);
151
417
  break;
152
418
  case 'color':
153
419
  this.selectedProperties.color = !!eventDetails.id;
@@ -201,7 +467,8 @@ export class EzpPrinterSelection {
201
467
  await this.printService
202
468
  .getAllPrinterProperties(authStore.state.accessToken)
203
469
  .then((printerConfig) => {
204
- this.printerConfig = printerConfig[0];
470
+ this.printerConfig = printerConfig;
471
+ console.log(this.printerConfig);
205
472
  });
206
473
  this.loading = false;
207
474
  }
@@ -229,7 +496,7 @@ export class EzpPrinterSelection {
229
496
  type: 'printer',
230
497
  })), preSelected: this.selectedPrinter.name })),
231
498
  h("div", { id: "options" },
232
- h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.printerConfig.Color
499
+ h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
233
500
  ? [
234
501
  {
235
502
  id: 1,
@@ -250,29 +517,29 @@ export class EzpPrinterSelection {
250
517
  title: i18next.t('printer_selection.color_grayscale'),
251
518
  meta: '',
252
519
  type: 'color',
253
- }
520
+ },
254
521
  ], preSelected: this.previouslySelectedProperties.color }),
255
- h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.printerConfig.OrientationsSupported.map((orientation, index) => ({
522
+ 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) => ({
256
523
  id: index,
257
524
  title: i18next.t(`printer_selection.orientation_${orientation}`),
258
525
  meta: '',
259
526
  type: 'orientation',
260
527
  })), preSelected: this.previouslySelectedProperties.orientation }),
261
- h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.printerConfig.PaperFormats.map((format) => ({
528
+ 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) => ({
262
529
  id: format.Id,
263
530
  title: format.Name,
264
531
  meta: `${format.XRes} x ${format.YRes}`,
265
532
  type: 'format',
266
533
  })), preSelected: this.previouslySelectedProperties.paper }),
267
- h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", toggleFlow: "horizontal", options: this.printerConfig.Resolutions.map((option, index) => ({
534
+ h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", toggleFlow: "horizontal", options: this.selectedPrinterConfig.Resolutions.map((option, index) => ({
268
535
  id: index,
269
536
  title: option,
270
537
  meta: '',
271
538
  type: 'quality',
272
539
  })), preSelected: !this.previouslySelectedProperties.resolution
273
- ? this.printerConfig.Resolutions[0]
540
+ ? this.selectedPrinterConfig.Resolutions[0]
274
541
  : this.previouslySelectedProperties.resolution }),
275
- this.printerConfig.DuplexSupported ? (h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", toggleFlow: "horizontal", options: this.duplexOptions.map((option) => ({
542
+ this.selectedPrinterConfig.DuplexSupported ? (h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", toggleFlow: "horizontal", options: this.duplexOptions.map((option) => ({
276
543
  id: option.id,
277
544
  title: option.title,
278
545
  meta: '',
@@ -379,6 +646,23 @@ export class EzpPrinterSelection {
379
646
  },
380
647
  "attribute": "filetype",
381
648
  "reflect": false
649
+ },
650
+ "fileid": {
651
+ "type": "string",
652
+ "mutable": false,
653
+ "complexType": {
654
+ "original": "string",
655
+ "resolved": "string",
656
+ "references": {}
657
+ },
658
+ "required": false,
659
+ "optional": false,
660
+ "docs": {
661
+ "tags": [],
662
+ "text": ""
663
+ },
664
+ "attribute": "fileid",
665
+ "reflect": false
382
666
  }
383
667
  }; }
384
668
  static get states() { return {
@@ -390,6 +674,7 @@ export class EzpPrinterSelection {
390
674
  "printers": {},
391
675
  "selectedPrinter": {},
392
676
  "printerConfig": {},
677
+ "selectedPrinterConfig": {},
393
678
  "selectedProperties": {},
394
679
  "previouslySelectedProperties": {}
395
680
  }; }