@ezeep/ezeep-js 1.0.136 → 1.0.140
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.
- package/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_12.cjs.entry.js +126 -46
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-icon/assets/glyph-dark.svg +3 -0
- package/dist/collection/components/ezp-icon/assets/glyph-light.svg +3 -0
- package/dist/collection/components/ezp-icon/assets/glyph-system.svg +3 -0
- package/dist/collection/components/ezp-icon/ezp-icon.css +2 -2
- package/dist/collection/components/ezp-icon/ezp-icon.js +1 -1
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +2 -3
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +109 -38
- package/dist/collection/components/ezp-printing/ezp-printing.css +211 -120
- package/dist/collection/components/ezp-printing/ezp-printing.js +43 -1
- package/dist/collection/components/ezp-progress/ezp-progress.css +1 -1
- package/dist/collection/components/ezp-select/ezp-select.js +1 -1
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +45 -1
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +15 -2
- package/dist/collection/services/print.js +17 -1
- package/dist/collection/services/user.js +1 -0
- package/dist/custom-elements/index.js +128 -48
- package/dist/directives/proxies.ts +4 -4
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_12.entry.js +126 -46
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_12.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/assets/glyph-dark.svg +3 -0
- package/dist/ezeep/assets/glyph-light.svg +3 -0
- package/dist/ezeep/assets/glyph-system.svg +3 -0
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/p-0711b970.entry.js +1 -0
- package/dist/ezeep/p-c488ee3f.system.js +1 -1
- package/dist/ezeep/p-e8c8adc1.system.entry.js +1 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +3 -1
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +3 -1
- package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +2 -0
- package/dist/types/components.d.ts +7 -1
- package/dist/types/services/print.d.ts +8 -1
- package/dist/types/services/user.d.ts +1 -0
- package/dist/types/shared/types.d.ts +4 -0
- package/package.json +1 -1
- package/readme.md +27 -3
- package/www/build/assets/glyph-dark.svg +3 -0
- package/www/build/assets/glyph-light.svg +3 -0
- package/www/build/assets/glyph-system.svg +3 -0
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/p-0711b970.entry.js +1 -0
- package/www/build/p-c488ee3f.system.js +1 -1
- package/www/build/p-e8c8adc1.system.entry.js +1 -0
- package/www/index.html +1 -1
- package/dist/ezeep/p-12ca28b7.system.entry.js +0 -1
- package/dist/ezeep/p-f4d2e700.entry.js +0 -1
- package/www/build/p-12ca28b7.system.entry.js +0 -1
- package/www/build/p-f4d2e700.entry.js +0 -1
|
@@ -6,6 +6,7 @@ import config from '../../shared/config.json';
|
|
|
6
6
|
export class EzpPrinting {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.theme = 'cyan';
|
|
9
|
+
this.appearance = 'system';
|
|
9
10
|
/**
|
|
10
11
|
*
|
|
11
12
|
* States
|
|
@@ -69,6 +70,7 @@ export class EzpPrinting {
|
|
|
69
70
|
componentWillLoad() {
|
|
70
71
|
authStore.state.redirectUri = this.redirecturi;
|
|
71
72
|
userStore.state.theme = this.theme;
|
|
73
|
+
userStore.state.appearance = this.appearance;
|
|
72
74
|
if (this.authapihosturl) {
|
|
73
75
|
authStore.state.authApiHostUrl = this.authapihosturl;
|
|
74
76
|
}
|
|
@@ -90,7 +92,7 @@ export class EzpPrinting {
|
|
|
90
92
|
*
|
|
91
93
|
*/
|
|
92
94
|
render() {
|
|
93
|
-
return (h(Host, { class: userStore.state.theme }, this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype })) : this.custom ? (h("slot", null)) : (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))));
|
|
95
|
+
return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance}` }, this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid })) : this.custom ? (h("slot", null)) : (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))));
|
|
94
96
|
}
|
|
95
97
|
static get is() { return "ezp-printing"; }
|
|
96
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -276,6 +278,46 @@ export class EzpPrinting {
|
|
|
276
278
|
"attribute": "theme",
|
|
277
279
|
"reflect": false,
|
|
278
280
|
"defaultValue": "'cyan'"
|
|
281
|
+
},
|
|
282
|
+
"fileid": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "string",
|
|
287
|
+
"resolved": "string",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": ""
|
|
295
|
+
},
|
|
296
|
+
"attribute": "fileid",
|
|
297
|
+
"reflect": false
|
|
298
|
+
},
|
|
299
|
+
"appearance": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"mutable": false,
|
|
302
|
+
"complexType": {
|
|
303
|
+
"original": "AppearanceTypes",
|
|
304
|
+
"resolved": "\"dark\" | \"light\" | \"system\"",
|
|
305
|
+
"references": {
|
|
306
|
+
"AppearanceTypes": {
|
|
307
|
+
"location": "import",
|
|
308
|
+
"path": "./../../shared/types"
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"required": false,
|
|
313
|
+
"optional": false,
|
|
314
|
+
"docs": {
|
|
315
|
+
"tags": [],
|
|
316
|
+
"text": ""
|
|
317
|
+
},
|
|
318
|
+
"attribute": "appearance",
|
|
319
|
+
"reflect": false,
|
|
320
|
+
"defaultValue": "'system'"
|
|
279
321
|
}
|
|
280
322
|
}; }
|
|
281
323
|
static get states() { return {
|
|
@@ -145,7 +145,7 @@ export class EzpSelect {
|
|
|
145
145
|
"mutable": false,
|
|
146
146
|
"complexType": {
|
|
147
147
|
"original": "IconNameTypes",
|
|
148
|
-
"resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"duplex\" | \"expand\" | \"help\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\"",
|
|
148
|
+
"resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"dark\" | \"duplex\" | \"expand\" | \"help\" | \"light\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\" | \"system\"",
|
|
149
149
|
"references": {
|
|
150
150
|
"IconNameTypes": {
|
|
151
151
|
"location": "import",
|
|
@@ -91,7 +91,7 @@ export class EzpStepper {
|
|
|
91
91
|
"mutable": false,
|
|
92
92
|
"complexType": {
|
|
93
93
|
"original": "IconNameTypes",
|
|
94
|
-
"resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"duplex\" | \"expand\" | \"help\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\"",
|
|
94
|
+
"resolved": "\"account\" | \"checkmark\" | \"close\" | \"color\" | \"copies\" | \"dark\" | \"duplex\" | \"expand\" | \"help\" | \"light\" | \"logout\" | \"menu\" | \"minus\" | \"orientation\" | \"plus\" | \"printer\" | \"quality\" | \"size\" | \"system\"",
|
|
95
95
|
"references": {
|
|
96
96
|
"IconNameTypes": {
|
|
97
97
|
"location": "import",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
#links {
|
|
78
|
-
box-shadow: 0 var(--hairline-width-positive) 0 0 var(--hairline-color);
|
|
79
78
|
display: flex;
|
|
80
79
|
flex-direction: column;
|
|
81
80
|
padding: var(--spacing-2);
|
|
@@ -102,6 +101,7 @@
|
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
#theme {
|
|
104
|
+
box-shadow: inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);
|
|
105
105
|
display: grid;
|
|
106
106
|
gap: var(--spacing-3);
|
|
107
107
|
grid-template: repeat(2, auto)/1fr;
|
|
@@ -182,6 +182,50 @@
|
|
|
182
182
|
width: 18px;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
#appearance {
|
|
186
|
+
box-shadow: inset 0 var(--hairline-width-positive) 0 0 var(--hairline-color);
|
|
187
|
+
display: grid;
|
|
188
|
+
gap: var(--spacing-3);
|
|
189
|
+
grid-template: repeat(2, auto)/1fr;
|
|
190
|
+
padding: var(--spacing-4) var(--spacing-4) var(--spacing-3);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
#tabs {
|
|
194
|
+
display: grid;
|
|
195
|
+
grid-template: auto/repeat(3, 1fr);
|
|
196
|
+
margin: 0 calc(var(--spacing-2) * -1);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.tab {
|
|
200
|
+
--icon-height: 8px;
|
|
201
|
+
align-items: center;
|
|
202
|
+
appearance: none;
|
|
203
|
+
background: var(--tab-background, transparent);
|
|
204
|
+
border: 0;
|
|
205
|
+
border-radius: 14px;
|
|
206
|
+
color: var(--tab-color, var(--color-foreground-secondary));
|
|
207
|
+
cursor: var(--tab-cursor, pointer);
|
|
208
|
+
display: flex;
|
|
209
|
+
gap: var(--spacing-2);
|
|
210
|
+
justify-content: center;
|
|
211
|
+
margin: 0;
|
|
212
|
+
outline: none;
|
|
213
|
+
padding: var(--spacing-3) var(--spacing-3) var(--spacing-3) var(--spacing-2);
|
|
214
|
+
}
|
|
215
|
+
@media (hover: hover) {
|
|
216
|
+
.tab:not(.selected):hover {
|
|
217
|
+
--tab-background: var(--color-shade-primary);
|
|
218
|
+
}
|
|
219
|
+
.tab:not(.selected):active {
|
|
220
|
+
--tab-background: var(--color-shade-secondary);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
.tab.selected {
|
|
224
|
+
--tab-background: var(--color-theme-translucent);
|
|
225
|
+
--tab-color: var(--color-theme-solid);
|
|
226
|
+
--tab-cursor: normal;
|
|
227
|
+
}
|
|
228
|
+
|
|
185
229
|
@keyframes dot-bounce {
|
|
186
230
|
0% {
|
|
187
231
|
transform: scale(1, 1);
|
|
@@ -17,6 +17,11 @@ export class EzpUserMenu {
|
|
|
17
17
|
},
|
|
18
18
|
];
|
|
19
19
|
this.themes = ['pink', 'red', 'orange', 'green', 'cyan', 'blue', 'violet'];
|
|
20
|
+
this.appearances = [
|
|
21
|
+
{ title: 'System', name: 'system' },
|
|
22
|
+
{ title: 'Light', name: 'light' },
|
|
23
|
+
{ title: 'Dark', name: 'dark' },
|
|
24
|
+
];
|
|
20
25
|
this.name = 'John Doe';
|
|
21
26
|
this.open = false;
|
|
22
27
|
this.handleClose = () => {
|
|
@@ -30,6 +35,9 @@ export class EzpUserMenu {
|
|
|
30
35
|
this.handleTheme = (theme) => {
|
|
31
36
|
userStore.state.theme = theme;
|
|
32
37
|
};
|
|
38
|
+
this.handleAppearance = (appearance) => {
|
|
39
|
+
userStore.state.appearance = appearance;
|
|
40
|
+
};
|
|
33
41
|
}
|
|
34
42
|
/**
|
|
35
43
|
*
|
|
@@ -83,9 +91,14 @@ export class EzpUserMenu {
|
|
|
83
91
|
h("ezp-icon", { class: "link__icon", name: "logout" }),
|
|
84
92
|
h("ezp-label", { text: "Logout" }))),
|
|
85
93
|
h("div", { id: "theme" },
|
|
86
|
-
h("ezp-label", { text: "Color Theme:" }),
|
|
94
|
+
h("ezp-label", { text: "Color Theme:", weight: "strong" }),
|
|
87
95
|
h("div", { id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) },
|
|
88
|
-
h("span", { class: "dot" }))))))
|
|
96
|
+
h("span", { class: "dot" })))))),
|
|
97
|
+
h("div", { id: "appearance" },
|
|
98
|
+
h("ezp-label", { text: "Appearance:", weight: "strong" }),
|
|
99
|
+
h("div", { id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) },
|
|
100
|
+
h("ezp-icon", { name: appearance.name }),
|
|
101
|
+
h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
|
|
89
102
|
}
|
|
90
103
|
static get is() { return "ezp-user-menu"; }
|
|
91
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -107,7 +107,17 @@ export class EzpPrintService {
|
|
|
107
107
|
'Content-Type': 'application/json',
|
|
108
108
|
},
|
|
109
109
|
body: JSON.stringify(Object.assign(Object.assign(Object.assign({ fileurl: fileUrl, type: fileType, printerid: printerID }, (filename && { alias: filename })), (printAndDelete && { printanddelete: printAndDelete })), { properties })),
|
|
110
|
-
})
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
printByFileID(accessToken, fileID, fileType, printerID, properties, filename, printAndDelete) {
|
|
113
|
+
return fetch(`https://${this.printingApi}/sfapi/Print/`, {
|
|
114
|
+
method: 'POST',
|
|
115
|
+
headers: {
|
|
116
|
+
Authorization: 'Bearer ' + accessToken,
|
|
117
|
+
'Content-Type': 'application/json',
|
|
118
|
+
},
|
|
119
|
+
body: JSON.stringify(Object.assign(Object.assign(Object.assign({ fileid: fileID, type: fileType, printerid: printerID }, (filename && { alias: filename })), (printAndDelete && { printanddelete: printAndDelete })), { properties })),
|
|
120
|
+
});
|
|
111
121
|
}
|
|
112
122
|
}
|
|
113
123
|
const printStore = createStore({
|
|
@@ -115,5 +125,11 @@ const printStore = createStore({
|
|
|
115
125
|
jobID: '',
|
|
116
126
|
printFinished: false,
|
|
117
127
|
printApiHostUrl: '',
|
|
128
|
+
printerProperties: {},
|
|
129
|
+
fileID: '',
|
|
130
|
+
fileUrl: '',
|
|
131
|
+
fileType: '',
|
|
132
|
+
printerID: '',
|
|
133
|
+
fileName: ''
|
|
118
134
|
});
|
|
119
135
|
export default printStore;
|