@ezeep/ezeep-js 1.0.150 → 1.0.156

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 (55) hide show
  1. package/dist/cjs/ezeep.cjs.js +3 -3
  2. package/dist/cjs/ezp-auth_14.cjs.entry.js +118 -67
  3. package/dist/cjs/{index-62fc857c.js → index-d547be4e.js} +23 -0
  4. package/dist/cjs/loader.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +2 -2
  6. package/dist/collection/components/ezp-auth/ezp-auth.js +1 -3
  7. package/dist/collection/components/ezp-dialog/ezp-dialog.js +0 -2
  8. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +87 -52
  9. package/dist/collection/components/ezp-printing/ezp-printing.js +24 -3
  10. package/dist/collection/components/ezp-status/ezp-status.js +0 -2
  11. package/dist/collection/components/ezp-upload/ezp-upload.js +0 -2
  12. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +0 -2
  13. package/dist/collection/services/auth.js +2 -0
  14. package/dist/collection/utils/utils.js +20 -8
  15. package/dist/custom-elements/index.js +119 -68
  16. package/dist/directives/proxies.ts +2 -2
  17. package/dist/esm/ezeep.js +3 -3
  18. package/dist/esm/ezp-auth_14.entry.js +118 -67
  19. package/dist/esm/{index-265d8cca.js → index-485041ac.js} +23 -0
  20. package/dist/esm/loader.js +3 -3
  21. package/dist/esm/polyfills/css-shim.js +1 -1
  22. package/dist/esm-es5/ezeep.js +1 -1
  23. package/dist/esm-es5/ezp-auth_14.entry.js +3 -3
  24. package/dist/esm-es5/index-485041ac.js +1 -0
  25. package/dist/esm-es5/loader.js +1 -1
  26. package/dist/ezeep/ezeep.esm.js +1 -1
  27. package/dist/ezeep/ezeep.js +1 -1
  28. package/dist/ezeep/p-0b51d725.system.entry.js +21 -0
  29. package/dist/ezeep/{p-a7b7b386.entry.js → p-b6ec69dc.entry.js} +2 -2
  30. package/dist/ezeep/p-cc2bb341.system.js +1 -0
  31. package/dist/ezeep/p-d4dae139.system.js +1 -0
  32. package/dist/ezeep/{p-f3065800.js → p-fa808a39.js} +0 -0
  33. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +1 -1
  34. package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -0
  35. package/dist/types/components.d.ts +2 -0
  36. package/dist/types/stencil-public-runtime.d.ts +6 -4
  37. package/dist/types/utils/utils.d.ts +1 -1
  38. package/package.json +2 -2
  39. package/readme.md +3 -1
  40. package/www/build/ezeep.esm.js +1 -1
  41. package/www/build/ezeep.js +1 -1
  42. package/www/build/p-0b51d725.system.entry.js +21 -0
  43. package/www/build/{p-a7b7b386.entry.js → p-b6ec69dc.entry.js} +2 -2
  44. package/www/build/p-cc2bb341.system.js +1 -0
  45. package/www/build/p-d4dae139.system.js +1 -0
  46. package/www/build/{p-f3065800.js → p-fa808a39.js} +0 -0
  47. package/www/data/locales/en.json +6 -1
  48. package/www/index.html +1 -1
  49. package/dist/esm-es5/index-265d8cca.js +0 -1
  50. package/dist/ezeep/p-98ec6965.system.js +0 -1
  51. package/dist/ezeep/p-a1b0d17a.system.entry.js +0 -21
  52. package/dist/ezeep/p-f89804ee.system.js +0 -1
  53. package/www/build/p-98ec6965.system.js +0 -1
  54. package/www/build/p-a1b0d17a.system.entry.js +0 -21
  55. package/www/build/p-f89804ee.system.js +0 -1
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-62fc857c.js');
3
+ const index = require('./index-d547be4e.js');
4
4
  const appGlobals = require('./app-globals-53afb196.js');
5
5
 
6
6
  /*
7
- Stencil Client Patch Browser v2.11.0 | MIT Licensed | https://stenciljs.com
7
+ Stencil Client Patch Browser v2.14.0 | MIT Licensed | https://stenciljs.com
8
8
  */
9
9
  const patchBrowser = () => {
10
10
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('ezeep.cjs.js', document.baseURI).href));
@@ -17,5 +17,5 @@ const patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(options => {
19
19
  appGlobals.globalScripts();
20
- 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],"printOpen":[32],"authOpen":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[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],"options":[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],"previouslySelectedProperties":[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"]]],[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);
20
+ 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],"noDocumentOpen":[32],"systemAppearance":[32],"open":[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],"options":[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"]]],[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);
21
21
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-62fc857c.js');
5
+ const index = require('./index-d547be4e.js');
6
6
 
7
7
  const appendToMap = (map, propName, value) => {
8
8
  const items = map.get(propName);
@@ -2926,6 +2926,9 @@ const printer_selection = {
2926
2926
  orientation: "Orientation",
2927
2927
  size: "Paper Size",
2928
2928
  duplex: "Double-sided",
2929
+ duplex_none: "None",
2930
+ duplex_long: "Long edge binding",
2931
+ duplex_short: "Short edge binding",
2929
2932
  quality: "Print Quality",
2930
2933
  select_printer: "Select a printer",
2931
2934
  select_color: "Select Color/Grayscale",
@@ -2938,7 +2941,8 @@ const printer_selection = {
2938
2941
  orientation_portrait: "Portrait",
2939
2942
  orientation_landscape: "Landscape",
2940
2943
  unknown_location: "Unknown location",
2941
- no_printers: "No printers found."
2944
+ no_printers: "No printers found.",
2945
+ copies: "Copies"
2942
2946
  };
2943
2947
  const button_actions = {
2944
2948
  login: "Sign In",
@@ -2977,7 +2981,7 @@ function encodeFormData(data) {
2977
2981
  .map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))
2978
2982
  .join('&');
2979
2983
  }
2980
- function initi18n() {
2984
+ function initi18n(language) {
2981
2985
  const resources = {
2982
2986
  en: {
2983
2987
  translation: translationsEN,
@@ -2986,13 +2990,25 @@ function initi18n() {
2986
2990
  translation: translationsDE,
2987
2991
  },
2988
2992
  };
2989
- i18next.init({
2990
- resources,
2991
- lng: navigator.language,
2992
- // allow keys to be phrases having `:`, `.`
2993
- nsSeparator: false,
2994
- fallbackLng: 'en',
2995
- });
2993
+ // override browserlanguage if language is provided
2994
+ if (language != '') {
2995
+ i18next.init({
2996
+ resources,
2997
+ lng: language,
2998
+ // allow keys to be phrases having `:`, `.`
2999
+ nsSeparator: false,
3000
+ fallbackLng: 'en',
3001
+ });
3002
+ }
3003
+ else {
3004
+ i18next.init({
3005
+ resources,
3006
+ lng: navigator.language,
3007
+ // allow keys to be phrases having `:`, `.`
3008
+ nsSeparator: false,
3009
+ fallbackLng: 'en',
3010
+ });
3011
+ }
2996
3012
  }
2997
3013
  const poll = async ({ fn, validate, interval, maxAttempts }) => {
2998
3014
  let attempts = 0;
@@ -3060,6 +3076,7 @@ class EzpAuthorizationService {
3060
3076
  }
3061
3077
  getAccessToken() {
3062
3078
  return fetch(this.accessTokenURL, {
3079
+ credentials: 'include',
3063
3080
  headers: {
3064
3081
  Authorization: 'Basic ' + btoa(this.clientID + ':'),
3065
3082
  'Content-Type': 'application/x-www-form-urlencoded',
@@ -3093,6 +3110,7 @@ class EzpAuthorizationService {
3093
3110
  }
3094
3111
  refreshTokens() {
3095
3112
  fetch(this.accessTokenURL, {
3113
+ credentials: 'include',
3096
3114
  headers: {
3097
3115
  Authorization: 'Basic ' + btoa(this.clientID + ':'),
3098
3116
  'Content-Type': 'application/x-www-form-urlencoded',
@@ -3193,13 +3211,12 @@ let EzpAuth = class {
3193
3211
  }
3194
3212
  receiveMessage(event) {
3195
3213
  this.auth.code = event.data;
3196
- this.auth.getAccessToken().finally(() => {
3214
+ this.auth.getAccessToken().then(() => {
3197
3215
  this.authCancel.emit();
3198
3216
  this.authSuccess.emit();
3199
3217
  });
3200
3218
  }
3201
3219
  async componentWillLoad() {
3202
- initi18n();
3203
3220
  this.auth = new EzpAuthorizationService(this.redirectURI, this.clientID);
3204
3221
  if (authStore.state.isAuthorized === false) {
3205
3222
  this.auth.generateCodeVerifier();
@@ -3269,7 +3286,6 @@ let EzpDialog = class {
3269
3286
  *
3270
3287
  */
3271
3288
  componentWillLoad() {
3272
- initi18n();
3273
3289
  }
3274
3290
  /**
3275
3291
  *
@@ -32683,15 +32699,15 @@ let EzpPrinterSelection = class {
32683
32699
  this.duplexOptions = [
32684
32700
  {
32685
32701
  id: 1,
32686
- title: 'None',
32702
+ title: i18next.t('printer_selection.duplex_none'),
32687
32703
  },
32688
32704
  {
32689
32705
  id: 2,
32690
- title: 'Long edge binding',
32706
+ title: i18next.t('printer_selection.duplex_long'),
32691
32707
  },
32692
32708
  {
32693
32709
  id: 3,
32694
- title: 'Short edge binding',
32710
+ title: i18next.t('printer_selection.duplex_short'),
32695
32711
  },
32696
32712
  ];
32697
32713
  this.hidemenu = false;
@@ -32729,16 +32745,6 @@ let EzpPrinterSelection = class {
32729
32745
  copies: '',
32730
32746
  resolution: '',
32731
32747
  };
32732
- this.previouslySelectedProperties = {
32733
- paper: '',
32734
- paperid: '',
32735
- color: false,
32736
- duplex: false,
32737
- duplexmode: '',
32738
- orientation: '',
32739
- copies: '',
32740
- resolution: '',
32741
- };
32742
32748
  /**
32743
32749
  *
32744
32750
  * Private methods
@@ -32783,6 +32789,10 @@ let EzpPrinterSelection = class {
32783
32789
  }
32784
32790
  })
32785
32791
  .then((data) => {
32792
+ if (data.code === 804) {
32793
+ this.printFailed = true;
32794
+ this.printProcessing = false;
32795
+ }
32786
32796
  if (data.jobid) {
32787
32797
  printStore.state.jobID = data.jobid;
32788
32798
  poll({
@@ -32792,15 +32802,19 @@ let EzpPrinterSelection = class {
32792
32802
  maxAttempts: 10,
32793
32803
  }).catch((err) => {
32794
32804
  console.warn(err);
32805
+ this.printFailed = true;
32806
+ this.printProcessing = false;
32795
32807
  });
32796
32808
  }
32797
32809
  else {
32798
32810
  this.printFailed = true;
32811
+ this.printProcessing = false;
32799
32812
  }
32800
32813
  })
32801
32814
  .catch((error) => {
32802
32815
  console.log(error);
32803
32816
  this.printFailed = true;
32817
+ this.printProcessing = false;
32804
32818
  });
32805
32819
  }
32806
32820
  if (this.file) {
@@ -32808,7 +32822,6 @@ let EzpPrinterSelection = class {
32808
32822
  }
32809
32823
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
32810
32824
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
32811
- localStorage.setItem('previouslySelectedProperties', JSON.stringify(this.previouslySelectedProperties));
32812
32825
  this.printStopped = false;
32813
32826
  };
32814
32827
  this.handleUserMenu = () => {
@@ -32880,9 +32893,6 @@ let EzpPrinterSelection = class {
32880
32893
  else {
32881
32894
  this.selectedPrinter = { id: '', location: '', name: '' };
32882
32895
  }
32883
- if (localStorage.getItem('previouslySelectedProperties')) {
32884
- this.previouslySelectedProperties = JSON.parse(localStorage.getItem('previouslySelectedProperties'));
32885
- }
32886
32896
  }
32887
32897
  getUserInfo() {
32888
32898
  const userService = new EzpUserService();
@@ -32899,24 +32909,20 @@ let EzpPrinterSelection = class {
32899
32909
  await this.printService
32900
32910
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
32901
32911
  .then((data) => (this.selectedPrinterConfig = data[0]));
32912
+ this.setDefaultPaperFormat();
32902
32913
  break;
32903
32914
  case 'color':
32904
32915
  this.selectedProperties.color = !!eventDetails.id;
32905
- this.previouslySelectedProperties.color = eventDetails.title;
32906
32916
  break;
32907
32917
  case 'orientation':
32908
32918
  this.selectedProperties.orientation = eventDetails.id;
32909
- this.previouslySelectedProperties.orientation = eventDetails.title;
32910
32919
  break;
32911
32920
  case 'format':
32912
32921
  this.selectedProperties.paper = eventDetails.title;
32913
32922
  this.selectedProperties.paperid = eventDetails.id;
32914
- this.previouslySelectedProperties.paper = eventDetails.title;
32915
- this.previouslySelectedProperties.paperid = eventDetails.id;
32916
32923
  break;
32917
32924
  case 'quality':
32918
32925
  this.selectedProperties.resolution = eventDetails.title;
32919
- this.previouslySelectedProperties.resolution = eventDetails.title;
32920
32926
  break;
32921
32927
  case 'duplex':
32922
32928
  if (eventDetails.title === 'None') {
@@ -32926,7 +32932,6 @@ let EzpPrinterSelection = class {
32926
32932
  this.selectedProperties.duplex = true;
32927
32933
  }
32928
32934
  this.selectedProperties.duplexmode = eventDetails.id;
32929
- this.previouslySelectedProperties.duplexmode = eventDetails.id;
32930
32935
  break;
32931
32936
  }
32932
32937
  }
@@ -32951,6 +32956,10 @@ let EzpPrinterSelection = class {
32951
32956
  this.printService
32952
32957
  .printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, this.selectedProperties, this.filename)
32953
32958
  .then((data) => {
32959
+ if (data.code === 804) {
32960
+ this.printFailed = true;
32961
+ this.printProcessing = false;
32962
+ }
32954
32963
  if (data.jobid) {
32955
32964
  printStore.state.jobID = data.jobid;
32956
32965
  poll({
@@ -32961,21 +32970,40 @@ let EzpPrinterSelection = class {
32961
32970
  }).catch((err) => {
32962
32971
  console.log(err);
32963
32972
  this.printFailed = true;
32973
+ this.printProcessing = false;
32964
32974
  });
32965
32975
  }
32966
32976
  else {
32967
32977
  this.printFailed = true;
32978
+ this.printProcessing = false;
32968
32979
  }
32969
32980
  })
32970
32981
  .catch((error) => {
32971
32982
  console.log(error);
32972
32983
  this.printFailed = true;
32984
+ this.printProcessing = false;
32973
32985
  });
32974
32986
  }
32975
32987
  else {
32976
32988
  this.printFailed = true;
32989
+ this.printProcessing = false;
32977
32990
  }
32978
32991
  }
32992
+ setDefaultPaperFormat() {
32993
+ let format;
32994
+ const language = navigator.language;
32995
+ if (language === 'en-US') {
32996
+ format = 'Letter';
32997
+ }
32998
+ else if (language === 'my') {
32999
+ format = 'Letter';
33000
+ }
33001
+ else {
33002
+ format = 'A4';
33003
+ }
33004
+ this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name === format).Name;
33005
+ this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name === format).Id;
33006
+ }
32979
33007
  /**
32980
33008
  *
32981
33009
  * Lifecycle methods
@@ -32983,11 +33011,19 @@ let EzpPrinterSelection = class {
32983
33011
  */
32984
33012
  /** Description... */
32985
33013
  async componentWillLoad() {
32986
- initi18n();
32987
33014
  this.loading = true;
32988
33015
  this.getPropertiesFromLocalStorage();
32989
33016
  this.getUserInfo();
32990
33017
  this.printService = new EzpPrintService(this.redirectURI, this.clientID);
33018
+ // if printer is stored from previous print, get the config to enable property selection
33019
+ if (this.selectedPrinter.id != '') {
33020
+ await this.printService
33021
+ .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33022
+ .then((data) => (this.selectedPrinterConfig = data[0]));
33023
+ if (this.selectedProperties.paper === '') {
33024
+ this.setDefaultPaperFormat();
33025
+ }
33026
+ }
32991
33027
  await (await this.printService.getConfig(authStore.state.accessToken))
32992
33028
  .json()
32993
33029
  .then((response) => {
@@ -33032,7 +33068,9 @@ let EzpPrinterSelection = class {
33032
33068
  ? printer.location
33033
33069
  : i18next.t('printer_selection.unknown_location'),
33034
33070
  type: 'printer',
33035
- })), preSelected: this.selectedPrinter ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), index.h("div", { id: "options" }, index.h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
33071
+ })),
33072
+ // preSelected={this.selectedPrinter ? this.selectedPrinter.name : null}
33073
+ disabled: !(this.printers.length > 0) })), index.h("div", { id: "options" }, index.h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
33036
33074
  ? [
33037
33075
  {
33038
33076
  id: 1,
@@ -33056,11 +33094,25 @@ let EzpPrinterSelection = class {
33056
33094
  },
33057
33095
  ],
33058
33096
  // preSelected={
33059
- // this.previouslySelectedProperties.color
33060
- // ? this.previouslySelectedProperties.color
33061
- // : this.selectedPrinterConfig.Color
33062
- // ? i18next.t('printer_selection.color_grayscale')
33063
- // : null
33097
+ // this.selectedProperties.color ?
33098
+ // [
33099
+ // {
33100
+ // id: 1,
33101
+ // title: i18next.t('printer_selection.color'),
33102
+ // meta: '',
33103
+ // type: 'color',
33104
+ // },
33105
+ // ]
33106
+ // : !this.selectedProperties.color ?
33107
+ // [
33108
+ // {
33109
+ // id: 0,
33110
+ // title: i18next.t('printer_selection.color_grayscale'),
33111
+ // meta: '',
33112
+ // type: 'color',
33113
+ // },
33114
+ // ]
33115
+ // : null
33064
33116
  // }
33065
33117
  disabled: !this.selectedPrinterConfig.Color }), index.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) => ({
33066
33118
  id: option.id,
@@ -33069,10 +33121,10 @@ let EzpPrinterSelection = class {
33069
33121
  type: 'duplex',
33070
33122
  })),
33071
33123
  // preSelected={
33072
- // this.previouslySelectedProperties.duplex
33073
- // ? this.previouslySelectedProperties.duplex
33074
- // : this.selectedPrinterConfig.DuplexSupported
33075
- // ? 'None'
33124
+ // this.selectedProperties.duplex
33125
+ // ? this.selectedProperties.duplex
33126
+ // // : this.selectedPrinterConfig.DuplexSupported
33127
+ // // ? 'None'
33076
33128
  // : null
33077
33129
  // }
33078
33130
  disabled: !this.selectedPrinterConfig.DuplexSupported }), index.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) => ({
@@ -33082,10 +33134,10 @@ let EzpPrinterSelection = class {
33082
33134
  type: 'format',
33083
33135
  })),
33084
33136
  // preSelected={
33085
- // this.previouslySelectedProperties.paper
33086
- // ? this.previouslySelectedProperties.paper
33087
- // : this.selectedPrinterConfig.PaperFormats.length > 0
33088
- // ? this.selectedPrinterConfig.PaperFormats[0].Name
33137
+ // this.selectedProperties.paper
33138
+ // ? this.selectedProperties.paper
33139
+ // // : this.selectedPrinterConfig.PaperFormats.length > 0
33140
+ // // ? this.selectedPrinterConfig.PaperFormats[0].Name
33089
33141
  // : null
33090
33142
  // }
33091
33143
  disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }), index.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) => ({
@@ -33095,12 +33147,12 @@ let EzpPrinterSelection = class {
33095
33147
  type: 'orientation',
33096
33148
  })),
33097
33149
  // preSelected={
33098
- // this.previouslySelectedProperties.orientation
33099
- // ? this.previouslySelectedProperties.orientation
33100
- // : this.selectedPrinterConfig.OrientationsSupported.length > 0
33101
- // ? i18next.t(
33102
- // `printer_selection.orientation_${this.selectedPrinterConfig.OrientationsSupported[0]}`
33103
- // )
33150
+ // this.selectedProperties.orientation
33151
+ // ? this.selectedProperties.orientation
33152
+ // // : this.selectedPrinterConfig.OrientationsSupported.length > 0
33153
+ // // ? i18next.t(
33154
+ // // `printer_selection.orientation_${this.selectedPrinterConfig.OrientationsSupported[0]}`
33155
+ // // )
33104
33156
  // : null
33105
33157
  // }
33106
33158
  disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), index.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) => ({
@@ -33110,13 +33162,13 @@ let EzpPrinterSelection = class {
33110
33162
  type: 'quality',
33111
33163
  })),
33112
33164
  // preSelected={
33113
- // this.previouslySelectedProperties.resolution
33114
- // ? this.previouslySelectedProperties.resolution
33115
- // : this.selectedPrinterConfig.Resolutions.length > 0
33116
- // ? this.selectedPrinterConfig.Resolutions[0]
33165
+ // this.selectedProperties.resolution
33166
+ // ? this.selectedProperties.resolution
33167
+ // // : this.selectedPrinterConfig.Resolutions.length > 0
33168
+ // // ? this.selectedPrinterConfig.Resolutions[0]
33117
33169
  // : null
33118
33170
  // }
33119
- disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })), index.h("ezp-stepper", { label: "Copies", max: 10, icon: "copies" })), index.h("div", { id: "footer" }, index.h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel') }), index.h("ezp-text-button", { disabled: this.selectedPrinter.id === '', type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print') })), !this.hidemenu && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
33171
+ disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })), index.h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })), index.h("div", { id: "footer" }, index.h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel') }), index.h("ezp-text-button", { disabled: this.selectedPrinter.id === '', type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print') })), !this.hidemenu && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
33120
33172
  }
33121
33173
  };
33122
33174
  EzpPrinterSelection.style = ezpPrinterSelectionCss;
@@ -33133,9 +33185,11 @@ const ezpPrintingCss = ":host{font-family:\"Inter\", sans-serif;-webkit-font-fea
33133
33185
  let EzpPrinting = class {
33134
33186
  constructor(hostRef) {
33135
33187
  index.registerInstance(this, hostRef);
33188
+ this.filename = '';
33136
33189
  this.hidemenu = false;
33137
33190
  this.theme = 'cyan';
33138
33191
  this.appearance = 'system';
33192
+ this.language = '';
33139
33193
  /**
33140
33194
  *
33141
33195
  * States
@@ -33164,7 +33218,7 @@ let EzpPrinting = class {
33164
33218
  this.authOpen = false;
33165
33219
  }
33166
33220
  listenAuthSuccess() {
33167
- if (this.filename) {
33221
+ if (this.filename != '') {
33168
33222
  this.printOpen = true;
33169
33223
  }
33170
33224
  else {
@@ -33250,7 +33304,7 @@ let EzpPrinting = class {
33250
33304
  else {
33251
33305
  printStore.state.printApiHostUrl = config.printingApiHostUrl;
33252
33306
  }
33253
- initi18n();
33307
+ initi18n(this.language);
33254
33308
  sendCodeToParentWindow();
33255
33309
  this.checkAuth();
33256
33310
  }
@@ -33449,7 +33503,6 @@ let EzpStatus = class {
33449
33503
  *
33450
33504
  */
33451
33505
  componentWillLoad() {
33452
- initi18n();
33453
33506
  }
33454
33507
  /**
33455
33508
  *
@@ -33630,7 +33683,6 @@ let EzpUpload = class {
33630
33683
  *
33631
33684
  */
33632
33685
  componentWillLoad() {
33633
- initi18n();
33634
33686
  }
33635
33687
  /**
33636
33688
  *
@@ -33712,7 +33764,6 @@ let EzpUserMenu = class {
33712
33764
  *
33713
33765
  */
33714
33766
  componentWillLoad() {
33715
- initi18n();
33716
33767
  this.container = this.component.closest('[data-backdrop-surface]');
33717
33768
  this.backdrop.addEventListener('backdropHideStart', () => {
33718
33769
  this.open = false;
@@ -933,6 +933,29 @@ const then = (promise, thenFn) => {
933
933
  };
934
934
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
935
935
  ;
936
+ /**
937
+ * Parse a new property value for a given property type.
938
+ *
939
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
940
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
941
+ * 1. `any`, the type given to `propValue` in the function signature
942
+ * 2. the type stored from `propType`.
943
+ *
944
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
945
+ *
946
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
947
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
948
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
949
+ * ```tsx
950
+ * <my-cmp prop-val={0}></my-cmp>
951
+ * ```
952
+ *
953
+ * HTML prop values on the other hand, will always a string
954
+ *
955
+ * @param propValue the new value to coerce to some type
956
+ * @param propType the type of the prop, expressed as a binary number
957
+ * @returns the parsed/coerced value
958
+ */
936
959
  const parsePropertyValue = (propValue, propType) => {
937
960
  // ensure this value is of the correct prop type
938
961
  if (propValue != null && !isComplexType(propValue)) {
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-62fc857c.js');
5
+ const index = require('./index-d547be4e.js');
6
6
  const appGlobals = require('./app-globals-53afb196.js');
7
7
 
8
8
  /*
9
- Stencil Client Patch Esm v2.11.0 | MIT Licensed | https://stenciljs.com
9
+ Stencil Client Patch Esm v2.14.0 | MIT Licensed | https://stenciljs.com
10
10
  */
11
11
  const patchEsm = () => {
12
12
  return index.promiseResolve();
@@ -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],"printOpen":[32],"authOpen":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[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],"options":[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],"previouslySelectedProperties":[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"]]],[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],"noDocumentOpen":[32],"systemAppearance":[32],"open":[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],"options":[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"]]],[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);
20
20
  });
21
21
  };
22
22
 
@@ -17,8 +17,8 @@
17
17
  ],
18
18
  "compiler": {
19
19
  "name": "@stencil/core",
20
- "version": "2.11.0",
21
- "typescriptVersion": "4.3.5"
20
+ "version": "2.14.0",
21
+ "typescriptVersion": "4.5.4"
22
22
  },
23
23
  "collections": [],
24
24
  "bundles": [],
@@ -2,7 +2,6 @@ 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';
5
- import { initi18n } from '../../utils/utils';
6
5
  export class EzpAuth {
7
6
  constructor() {
8
7
  this.windowObjectReference = null;
@@ -53,13 +52,12 @@ export class EzpAuth {
53
52
  }
54
53
  receiveMessage(event) {
55
54
  this.auth.code = event.data;
56
- this.auth.getAccessToken().finally(() => {
55
+ this.auth.getAccessToken().then(() => {
57
56
  this.authCancel.emit();
58
57
  this.authSuccess.emit();
59
58
  });
60
59
  }
61
60
  async componentWillLoad() {
62
- initi18n();
63
61
  this.auth = new EzpAuthorizationService(this.redirectURI, this.clientID);
64
62
  if (authStore.state.isAuthorized === false) {
65
63
  this.auth.generateCodeVerifier();
@@ -1,5 +1,4 @@
1
1
  import { Component, Host, Prop, Event, h } from '@stencil/core';
2
- import { initi18n } from '../../utils/utils';
3
2
  import i18next from 'i18next';
4
3
  export class EzpDialog {
5
4
  constructor() {
@@ -24,7 +23,6 @@ export class EzpDialog {
24
23
  *
25
24
  */
26
25
  componentWillLoad() {
27
- initi18n();
28
26
  }
29
27
  /**
30
28
  *