@ezeep/ezeep-js 1.0.167 → 1.0.169

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.
@@ -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],"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
+ 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",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[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
  });
@@ -2955,13 +2955,14 @@ const button_actions = {
2955
2955
  cancel: "Cancel",
2956
2956
  close: "Close",
2957
2957
  retry: "Retry",
2958
- next: "Next"
2958
+ select_printer: "Select Printer"
2959
2959
  };
2960
2960
  const upload = {
2961
2961
  description: "Drop a file here into the browser ",
2962
2962
  meta_leading: "or",
2963
2963
  meta_select: "select a file",
2964
- meta_trailing: "to print with ezeep Blue."
2964
+ meta_trailing: "to print with ezeep Blue.",
2965
+ selected_file: "Selected File:"
2965
2966
  };
2966
2967
  const user_menu = {
2967
2968
  theme: "Color theme",
@@ -3184,6 +3185,11 @@ let EzpAuth = class {
3184
3185
  this.authCancel.emit();
3185
3186
  }
3186
3187
  openSignInWindow(url, name) {
3188
+ if (authStore.state.isAuthorized) {
3189
+ this.authCancel.emit();
3190
+ this.authSuccess.emit();
3191
+ return;
3192
+ }
3187
3193
  // remove any existing event listeners
3188
3194
  window.removeEventListener('message', this.receiveMessage);
3189
3195
  // window features
@@ -3235,7 +3241,7 @@ let EzpAuth = class {
3235
3241
  }
3236
3242
  }
3237
3243
  render() {
3238
- return (index.h(index.Host, null, this.hidelogin && this.trigger === 'button' ? (index.h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (index.h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.next') })) : (index.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" }))));
3244
+ return (index.h(index.Host, null, this.hidelogin && this.trigger === 'button' ? (index.h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (index.h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.select_printer') })) : (index.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" }))));
3239
3245
  }
3240
3246
  };
3241
3247
  EzpAuth.style = ezpAuthCss;
@@ -32839,7 +32845,6 @@ let EzpPrinterSelection = class {
32839
32845
  await this.printService
32840
32846
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
32841
32847
  .then((data) => (this.selectedPrinterConfig = data[0]));
32842
- console.log(this.selectedPrinterConfig);
32843
32848
  this.setDefaultPaperFormat();
32844
32849
  break;
32845
32850
  case 'color':
@@ -33099,14 +33104,17 @@ let EzpPrinting = class {
33099
33104
  /** Description... */
33100
33105
  listenPrintCancel() {
33101
33106
  this.printOpen = false;
33107
+ this.checkAuth();
33102
33108
  }
33103
33109
  /** Description... */
33104
33110
  listenPrintSubmit() {
33105
33111
  this.printOpen = false;
33112
+ this.checkAuth();
33106
33113
  }
33107
33114
  /** Description... */
33108
33115
  listenAuthCancel() {
33109
33116
  this.authOpen = false;
33117
+ this.checkAuth();
33110
33118
  }
33111
33119
  listenAuthSuccess() {
33112
33120
  if (this.onlyGetSasUri) {
@@ -33141,7 +33149,8 @@ let EzpPrinting = class {
33141
33149
  *
33142
33150
  */
33143
33151
  async open() {
33144
- if (authStore.state.isAuthorized) {
33152
+ if (authStore.state.isAuthorized && this.trigger === 'file') {
33153
+ this.authOpen = true;
33145
33154
  if (this.filename) {
33146
33155
  this.printOpen = true;
33147
33156
  }
@@ -33225,8 +33234,8 @@ let EzpPrinting = class {
33225
33234
  else {
33226
33235
  printStore.state.printApiHostUrl = config.printingApiHostUrl;
33227
33236
  }
33228
- initi18n(this.language);
33229
33237
  sendCodeToParentWindow();
33238
+ initi18n(this.language);
33230
33239
  this.checkAuth();
33231
33240
  }
33232
33241
  componentDidLoad() {
@@ -33240,7 +33249,7 @@ let EzpPrinting = class {
33240
33249
  render() {
33241
33250
  return (index.h(index.Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
33242
33251
  ? this.systemAppearance
33243
- : userStore.state.appearance}` }, this.authOpen ? (index.h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (index.h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (index.h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null, this.trigger === 'custom' ? (index.h("slot", null)) : this.trigger === 'file' ? (index.h("ezp-upload", null)) : (this.trigger === 'button' && (index.h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() })))));
33252
+ : userStore.state.appearance}` }, this.trigger === 'custom' ? (index.h("slot", null)) : this.trigger === 'file' ? (index.h("ezp-upload", null)) : (this.trigger === 'button' && (index.h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (index.h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (index.h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (index.h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
33244
33253
  }
33245
33254
  };
33246
33255
  EzpPrinting.style = ezpPrintingCss;
@@ -33572,6 +33581,7 @@ let EzpUpload = class {
33572
33581
  * States
33573
33582
  *
33574
33583
  */
33584
+ this.filename = '';
33575
33585
  this.dragging = false;
33576
33586
  /**
33577
33587
  *
@@ -33579,6 +33589,7 @@ let EzpUpload = class {
33579
33589
  *
33580
33590
  */
33581
33591
  this.handleInput = () => {
33592
+ this.filename = this.input.files[0].name;
33582
33593
  this.uploadFile.emit(this.input.files);
33583
33594
  };
33584
33595
  }
@@ -33602,10 +33613,12 @@ let EzpUpload = class {
33602
33613
  event.stopPropagation();
33603
33614
  event.preventDefault();
33604
33615
  this.dragging = false;
33616
+ this.filename = event.dataTransfer.files[0].name;
33605
33617
  this.uploadFile.emit(event.dataTransfer.files);
33606
33618
  }
33607
33619
  listenPrintCancel() {
33608
33620
  this.form.reset();
33621
+ this.filename = '';
33609
33622
  }
33610
33623
  /**
33611
33624
  *
@@ -33613,7 +33626,7 @@ let EzpUpload = class {
33613
33626
  *
33614
33627
  */
33615
33628
  render() {
33616
- return (index.h(index.Host, { class: { dragging: this.dragging } }, index.h("form", { id: "form", ref: (form) => (this.form = form) }, index.h("div", { id: "header" }, index.h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), index.h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), index.h("div", { id: "meta" }, index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), index.h("label", { htmlFor: "input", id: "select" }, index.h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), index.h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') }))))));
33629
+ return (index.h(index.Host, { class: { dragging: this.dragging } }, index.h("form", { id: "form", ref: (form) => (this.form = form) }, index.h("div", { id: "header" }, index.h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), index.h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), index.h("div", { id: "meta" }, index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), index.h("label", { htmlFor: "input", id: "select" }, index.h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), index.h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.filename != '' && (index.h(index.Fragment, null, index.h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }), index.h("ezp-label", { level: "tertiary", text: this.filename })))))));
33617
33630
  }
33618
33631
  };
33619
33632
  EzpUpload.style = ezpUploadCss;
@@ -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],"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);
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",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[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,6 +17,11 @@ export class EzpAuth {
17
17
  this.authCancel.emit();
18
18
  }
19
19
  openSignInWindow(url, name) {
20
+ if (authStore.state.isAuthorized) {
21
+ this.authCancel.emit();
22
+ this.authSuccess.emit();
23
+ return;
24
+ }
20
25
  // remove any existing event listeners
21
26
  window.removeEventListener('message', this.receiveMessage);
22
27
  // window features
@@ -68,7 +73,7 @@ export class EzpAuth {
68
73
  }
69
74
  }
70
75
  render() {
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" }))));
76
+ 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.select_printer') })) : (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" }))));
72
77
  }
73
78
  static get is() { return "ezp-auth"; }
74
79
  static get encapsulation() { return "shadow"; }
@@ -223,7 +223,6 @@ export class EzpPrinterSelection {
223
223
  await this.printService
224
224
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
225
225
  .then((data) => (this.selectedPrinterConfig = data[0]));
226
- console.log(this.selectedPrinterConfig);
227
226
  this.setDefaultPaperFormat();
228
227
  break;
229
228
  case 'color':
@@ -31,14 +31,17 @@ export class EzpPrinting {
31
31
  /** Description... */
32
32
  listenPrintCancel() {
33
33
  this.printOpen = false;
34
+ this.checkAuth();
34
35
  }
35
36
  /** Description... */
36
37
  listenPrintSubmit() {
37
38
  this.printOpen = false;
39
+ this.checkAuth();
38
40
  }
39
41
  /** Description... */
40
42
  listenAuthCancel() {
41
43
  this.authOpen = false;
44
+ this.checkAuth();
42
45
  }
43
46
  listenAuthSuccess() {
44
47
  if (this.onlyGetSasUri) {
@@ -73,7 +76,8 @@ export class EzpPrinting {
73
76
  *
74
77
  */
75
78
  async open() {
76
- if (authStore.state.isAuthorized) {
79
+ if (authStore.state.isAuthorized && this.trigger === 'file') {
80
+ this.authOpen = true;
77
81
  if (this.filename) {
78
82
  this.printOpen = true;
79
83
  }
@@ -157,8 +161,8 @@ export class EzpPrinting {
157
161
  else {
158
162
  printStore.state.printApiHostUrl = config.printingApiHostUrl;
159
163
  }
160
- initi18n(this.language);
161
164
  sendCodeToParentWindow();
165
+ initi18n(this.language);
162
166
  this.checkAuth();
163
167
  }
164
168
  componentDidLoad() {
@@ -173,8 +177,8 @@ export class EzpPrinting {
173
177
  return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
174
178
  ? this.systemAppearance
175
179
  : userStore.state.appearance}` },
176
- this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null,
177
- this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() })))));
180
+ this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))),
181
+ this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
178
182
  }
179
183
  static get is() { return "ezp-printing"; }
180
184
  static get encapsulation() { return "shadow"; }
@@ -1,4 +1,4 @@
1
- import { Component, Host, Listen, Event, State, h } from '@stencil/core';
1
+ import { Component, Host, Listen, Event, State, h, Fragment } from '@stencil/core';
2
2
  import i18next from 'i18next';
3
3
  export class EzpUpload {
4
4
  constructor() {
@@ -7,6 +7,7 @@ export class EzpUpload {
7
7
  * States
8
8
  *
9
9
  */
10
+ this.filename = '';
10
11
  this.dragging = false;
11
12
  /**
12
13
  *
@@ -14,6 +15,7 @@ export class EzpUpload {
14
15
  *
15
16
  */
16
17
  this.handleInput = () => {
18
+ this.filename = this.input.files[0].name;
17
19
  this.uploadFile.emit(this.input.files);
18
20
  };
19
21
  }
@@ -37,10 +39,12 @@ export class EzpUpload {
37
39
  event.stopPropagation();
38
40
  event.preventDefault();
39
41
  this.dragging = false;
42
+ this.filename = event.dataTransfer.files[0].name;
40
43
  this.uploadFile.emit(event.dataTransfer.files);
41
44
  }
42
45
  listenPrintCancel() {
43
46
  this.form.reset();
47
+ this.filename = '';
44
48
  }
45
49
  /**
46
50
  *
@@ -58,7 +62,10 @@ export class EzpUpload {
58
62
  h("label", { htmlFor: "input", id: "select" },
59
63
  h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })),
60
64
  h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }),
61
- h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') }))))));
65
+ h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })),
66
+ this.filename != '' && (h(Fragment, null,
67
+ h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }),
68
+ h("ezp-label", { level: "tertiary", text: this.filename })))))));
62
69
  }
63
70
  static get is() { return "ezp-upload"; }
64
71
  static get encapsulation() { return "shadow"; }
@@ -69,6 +76,7 @@ export class EzpUpload {
69
76
  "$": ["ezp-upload.css"]
70
77
  }; }
71
78
  static get states() { return {
79
+ "filename": {},
72
80
  "dragging": {}
73
81
  }; }
74
82
  static get events() { return [{
@@ -2964,13 +2964,14 @@ const button_actions = {
2964
2964
  cancel: "Cancel",
2965
2965
  close: "Close",
2966
2966
  retry: "Retry",
2967
- next: "Next"
2967
+ select_printer: "Select Printer"
2968
2968
  };
2969
2969
  const upload = {
2970
2970
  description: "Drop a file here into the browser ",
2971
2971
  meta_leading: "or",
2972
2972
  meta_select: "select a file",
2973
- meta_trailing: "to print with ezeep Blue."
2973
+ meta_trailing: "to print with ezeep Blue.",
2974
+ selected_file: "Selected File:"
2974
2975
  };
2975
2976
  const user_menu = {
2976
2977
  theme: "Color theme",
@@ -3195,6 +3196,11 @@ let EzpAuth$1 = class extends HTMLElement {
3195
3196
  this.authCancel.emit();
3196
3197
  }
3197
3198
  openSignInWindow(url, name) {
3199
+ if (authStore.state.isAuthorized) {
3200
+ this.authCancel.emit();
3201
+ this.authSuccess.emit();
3202
+ return;
3203
+ }
3198
3204
  // remove any existing event listeners
3199
3205
  window.removeEventListener('message', this.receiveMessage);
3200
3206
  // window features
@@ -3246,7 +3252,7 @@ let EzpAuth$1 = class extends HTMLElement {
3246
3252
  }
3247
3253
  }
3248
3254
  render() {
3249
- 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" }))));
3255
+ 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.select_printer') })) : (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" }))));
3250
3256
  }
3251
3257
  static get style() { return ezpAuthCss; }
3252
3258
  };
@@ -32862,7 +32868,6 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
32862
32868
  await this.printService
32863
32869
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
32864
32870
  .then((data) => (this.selectedPrinterConfig = data[0]));
32865
- console.log(this.selectedPrinterConfig);
32866
32871
  this.setDefaultPaperFormat();
32867
32872
  break;
32868
32873
  case 'color':
@@ -33124,14 +33129,17 @@ let EzpPrinting$1 = class extends HTMLElement {
33124
33129
  /** Description... */
33125
33130
  listenPrintCancel() {
33126
33131
  this.printOpen = false;
33132
+ this.checkAuth();
33127
33133
  }
33128
33134
  /** Description... */
33129
33135
  listenPrintSubmit() {
33130
33136
  this.printOpen = false;
33137
+ this.checkAuth();
33131
33138
  }
33132
33139
  /** Description... */
33133
33140
  listenAuthCancel() {
33134
33141
  this.authOpen = false;
33142
+ this.checkAuth();
33135
33143
  }
33136
33144
  listenAuthSuccess() {
33137
33145
  if (this.onlyGetSasUri) {
@@ -33166,7 +33174,8 @@ let EzpPrinting$1 = class extends HTMLElement {
33166
33174
  *
33167
33175
  */
33168
33176
  async open() {
33169
- if (authStore.state.isAuthorized) {
33177
+ if (authStore.state.isAuthorized && this.trigger === 'file') {
33178
+ this.authOpen = true;
33170
33179
  if (this.filename) {
33171
33180
  this.printOpen = true;
33172
33181
  }
@@ -33250,8 +33259,8 @@ let EzpPrinting$1 = class extends HTMLElement {
33250
33259
  else {
33251
33260
  printStore.state.printApiHostUrl = config.printingApiHostUrl;
33252
33261
  }
33253
- initi18n(this.language);
33254
33262
  sendCodeToParentWindow();
33263
+ initi18n(this.language);
33255
33264
  this.checkAuth();
33256
33265
  }
33257
33266
  componentDidLoad() {
@@ -33265,7 +33274,7 @@ let EzpPrinting$1 = class extends HTMLElement {
33265
33274
  render() {
33266
33275
  return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
33267
33276
  ? this.systemAppearance
33268
- : userStore.state.appearance}` }, this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() })))));
33277
+ : userStore.state.appearance}` }, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
33269
33278
  }
33270
33279
  static get style() { return ezpPrintingCss; }
33271
33280
  };
@@ -33607,6 +33616,7 @@ let EzpUpload$1 = class extends HTMLElement {
33607
33616
  * States
33608
33617
  *
33609
33618
  */
33619
+ this.filename = '';
33610
33620
  this.dragging = false;
33611
33621
  /**
33612
33622
  *
@@ -33614,6 +33624,7 @@ let EzpUpload$1 = class extends HTMLElement {
33614
33624
  *
33615
33625
  */
33616
33626
  this.handleInput = () => {
33627
+ this.filename = this.input.files[0].name;
33617
33628
  this.uploadFile.emit(this.input.files);
33618
33629
  };
33619
33630
  }
@@ -33637,10 +33648,12 @@ let EzpUpload$1 = class extends HTMLElement {
33637
33648
  event.stopPropagation();
33638
33649
  event.preventDefault();
33639
33650
  this.dragging = false;
33651
+ this.filename = event.dataTransfer.files[0].name;
33640
33652
  this.uploadFile.emit(event.dataTransfer.files);
33641
33653
  }
33642
33654
  listenPrintCancel() {
33643
33655
  this.form.reset();
33656
+ this.filename = '';
33644
33657
  }
33645
33658
  /**
33646
33659
  *
@@ -33648,7 +33661,7 @@ let EzpUpload$1 = class extends HTMLElement {
33648
33661
  *
33649
33662
  */
33650
33663
  render() {
33651
- return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') }))))));
33664
+ return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.filename != '' && (h(Fragment, null, h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }), h("ezp-label", { level: "tertiary", text: this.filename })))))));
33652
33665
  }
33653
33666
  static get style() { return ezpUploadCss; }
33654
33667
  };
@@ -33764,7 +33777,7 @@ const EzpSelect = /*@__PURE__*/proxyCustomElement(EzpSelect$1, [1,"ezp-select",{
33764
33777
  const EzpStatus = /*@__PURE__*/proxyCustomElement(EzpStatus$1, [1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}]);
33765
33778
  const EzpStepper = /*@__PURE__*/proxyCustomElement(EzpStepper$1, [1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}]);
33766
33779
  const EzpTextButton = /*@__PURE__*/proxyCustomElement(EzpTextButton$1, [1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}]);
33767
- const EzpUpload = /*@__PURE__*/proxyCustomElement(EzpUpload$1, [1,"ezp-upload",{"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]]);
33780
+ const EzpUpload = /*@__PURE__*/proxyCustomElement(EzpUpload$1, [1,"ezp-upload",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]]);
33768
33781
  const EzpUserMenu = /*@__PURE__*/proxyCustomElement(EzpUserMenu$1, [1,"ezp-user-menu",{"name":[1],"open":[1028]}]);
33769
33782
  const defineCustomElements = (opts) => {
33770
33783
  if (typeof customElements !== 'undefined') {
package/dist/esm/ezeep.js CHANGED
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
 
16
16
  patchBrowser().then(options => {
17
17
  globalScripts();
18
- return bootstrapLazy([["ezp-auth_14",[[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);
18
+ return bootstrapLazy([["ezp-auth_14",[[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",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[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
19
  });
@@ -2951,13 +2951,14 @@ const button_actions = {
2951
2951
  cancel: "Cancel",
2952
2952
  close: "Close",
2953
2953
  retry: "Retry",
2954
- next: "Next"
2954
+ select_printer: "Select Printer"
2955
2955
  };
2956
2956
  const upload = {
2957
2957
  description: "Drop a file here into the browser ",
2958
2958
  meta_leading: "or",
2959
2959
  meta_select: "select a file",
2960
- meta_trailing: "to print with ezeep Blue."
2960
+ meta_trailing: "to print with ezeep Blue.",
2961
+ selected_file: "Selected File:"
2961
2962
  };
2962
2963
  const user_menu = {
2963
2964
  theme: "Color theme",
@@ -3180,6 +3181,11 @@ let EzpAuth = class {
3180
3181
  this.authCancel.emit();
3181
3182
  }
3182
3183
  openSignInWindow(url, name) {
3184
+ if (authStore.state.isAuthorized) {
3185
+ this.authCancel.emit();
3186
+ this.authSuccess.emit();
3187
+ return;
3188
+ }
3183
3189
  // remove any existing event listeners
3184
3190
  window.removeEventListener('message', this.receiveMessage);
3185
3191
  // window features
@@ -3231,7 +3237,7 @@ let EzpAuth = class {
3231
3237
  }
3232
3238
  }
3233
3239
  render() {
3234
- 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" }))));
3240
+ 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.select_printer') })) : (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" }))));
3235
3241
  }
3236
3242
  };
3237
3243
  EzpAuth.style = ezpAuthCss;
@@ -32835,7 +32841,6 @@ let EzpPrinterSelection = class {
32835
32841
  await this.printService
32836
32842
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
32837
32843
  .then((data) => (this.selectedPrinterConfig = data[0]));
32838
- console.log(this.selectedPrinterConfig);
32839
32844
  this.setDefaultPaperFormat();
32840
32845
  break;
32841
32846
  case 'color':
@@ -33095,14 +33100,17 @@ let EzpPrinting = class {
33095
33100
  /** Description... */
33096
33101
  listenPrintCancel() {
33097
33102
  this.printOpen = false;
33103
+ this.checkAuth();
33098
33104
  }
33099
33105
  /** Description... */
33100
33106
  listenPrintSubmit() {
33101
33107
  this.printOpen = false;
33108
+ this.checkAuth();
33102
33109
  }
33103
33110
  /** Description... */
33104
33111
  listenAuthCancel() {
33105
33112
  this.authOpen = false;
33113
+ this.checkAuth();
33106
33114
  }
33107
33115
  listenAuthSuccess() {
33108
33116
  if (this.onlyGetSasUri) {
@@ -33137,7 +33145,8 @@ let EzpPrinting = class {
33137
33145
  *
33138
33146
  */
33139
33147
  async open() {
33140
- if (authStore.state.isAuthorized) {
33148
+ if (authStore.state.isAuthorized && this.trigger === 'file') {
33149
+ this.authOpen = true;
33141
33150
  if (this.filename) {
33142
33151
  this.printOpen = true;
33143
33152
  }
@@ -33221,8 +33230,8 @@ let EzpPrinting = class {
33221
33230
  else {
33222
33231
  printStore.state.printApiHostUrl = config.printingApiHostUrl;
33223
33232
  }
33224
- initi18n(this.language);
33225
33233
  sendCodeToParentWindow();
33234
+ initi18n(this.language);
33226
33235
  this.checkAuth();
33227
33236
  }
33228
33237
  componentDidLoad() {
@@ -33236,7 +33245,7 @@ let EzpPrinting = class {
33236
33245
  render() {
33237
33246
  return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
33238
33247
  ? this.systemAppearance
33239
- : userStore.state.appearance}` }, this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() })))));
33248
+ : userStore.state.appearance}` }, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
33240
33249
  }
33241
33250
  };
33242
33251
  EzpPrinting.style = ezpPrintingCss;
@@ -33568,6 +33577,7 @@ let EzpUpload = class {
33568
33577
  * States
33569
33578
  *
33570
33579
  */
33580
+ this.filename = '';
33571
33581
  this.dragging = false;
33572
33582
  /**
33573
33583
  *
@@ -33575,6 +33585,7 @@ let EzpUpload = class {
33575
33585
  *
33576
33586
  */
33577
33587
  this.handleInput = () => {
33588
+ this.filename = this.input.files[0].name;
33578
33589
  this.uploadFile.emit(this.input.files);
33579
33590
  };
33580
33591
  }
@@ -33598,10 +33609,12 @@ let EzpUpload = class {
33598
33609
  event.stopPropagation();
33599
33610
  event.preventDefault();
33600
33611
  this.dragging = false;
33612
+ this.filename = event.dataTransfer.files[0].name;
33601
33613
  this.uploadFile.emit(event.dataTransfer.files);
33602
33614
  }
33603
33615
  listenPrintCancel() {
33604
33616
  this.form.reset();
33617
+ this.filename = '';
33605
33618
  }
33606
33619
  /**
33607
33620
  *
@@ -33609,7 +33622,7 @@ let EzpUpload = class {
33609
33622
  *
33610
33623
  */
33611
33624
  render() {
33612
- return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') }))))));
33625
+ return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.filename != '' && (h(Fragment, null, h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }), h("ezp-label", { level: "tertiary", text: this.filename })))))));
33613
33626
  }
33614
33627
  };
33615
33628
  EzpUpload.style = ezpUploadCss;