@ezeep/ezeep-js 1.0.148 → 1.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ezeep.cjs.js +3 -3
- package/dist/cjs/ezp-auth_14.cjs.entry.js +118 -67
- package/dist/cjs/{index-62fc857c.js → index-d547be4e.js} +23 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ezp-auth/ezp-auth.js +1 -3
- package/dist/collection/components/ezp-dialog/ezp-dialog.js +0 -2
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +87 -52
- package/dist/collection/components/ezp-printing/ezp-printing.js +24 -3
- package/dist/collection/components/ezp-status/ezp-status.js +0 -2
- package/dist/collection/components/ezp-upload/ezp-upload.js +0 -2
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +0 -2
- package/dist/collection/services/auth.js +2 -0
- package/dist/collection/utils/utils.js +20 -8
- package/dist/components/auth.js +504 -0
- package/dist/components/ezp-auth.d.ts +11 -0
- package/dist/components/ezp-auth.js +6 -0
- package/dist/components/ezp-auth2.js +141 -0
- package/dist/components/ezp-backdrop.d.ts +11 -0
- package/dist/components/ezp-backdrop.js +6 -0
- package/dist/components/ezp-backdrop2.js +46 -0
- package/dist/components/ezp-dialog.d.ts +11 -0
- package/dist/components/ezp-dialog.js +6 -0
- package/dist/components/ezp-dialog2.js +92 -0
- package/dist/components/ezp-icon-button.d.ts +11 -0
- package/dist/components/ezp-icon-button.js +6 -0
- package/dist/components/ezp-icon-button2.js +70 -0
- package/dist/components/ezp-icon.d.ts +11 -0
- package/dist/components/ezp-icon.js +6 -0
- package/dist/components/ezp-icon2.js +58 -0
- package/dist/components/ezp-label.d.ts +11 -0
- package/dist/components/ezp-label.js +6 -0
- package/dist/components/ezp-label2.js +57 -0
- package/dist/components/ezp-printer-selection.d.ts +11 -0
- package/dist/components/ezp-printer-selection.js +6 -0
- package/dist/{custom-elements/index.js → components/ezp-printer-selection2.js} +8225 -12189
- package/dist/components/ezp-printing.d.ts +11 -0
- package/dist/components/ezp-printing.js +271 -0
- package/dist/components/ezp-select.d.ts +11 -0
- package/dist/components/ezp-select.js +6 -0
- package/dist/components/ezp-select2.js +194 -0
- package/dist/components/ezp-status.d.ts +11 -0
- package/dist/components/ezp-status.js +6 -0
- package/dist/components/ezp-status2.js +94 -0
- package/dist/components/ezp-stepper.d.ts +11 -0
- package/dist/components/ezp-stepper.js +6 -0
- package/dist/components/ezp-stepper2.js +119 -0
- package/dist/components/ezp-text-button.d.ts +11 -0
- package/dist/components/ezp-text-button.js +6 -0
- package/dist/components/ezp-text-button2.js +73 -0
- package/dist/components/ezp-upload.d.ts +11 -0
- package/dist/components/ezp-upload.js +6 -0
- package/dist/components/ezp-upload2.js +95 -0
- package/dist/components/ezp-user-menu.d.ts +11 -0
- package/dist/components/ezp-user-menu.js +6 -0
- package/dist/components/ezp-user-menu2.js +159 -0
- package/dist/components/i18next.js +2653 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +15 -0
- package/dist/directives/proxies.ts +2 -2
- package/dist/esm/ezeep.js +3 -3
- package/dist/esm/ezp-auth_14.entry.js +118 -67
- package/dist/esm/{index-265d8cca.js → index-485041ac.js} +23 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_14.entry.js +3 -3
- package/dist/esm-es5/index-485041ac.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/ezeep.js +1 -1
- package/dist/ezeep/p-0b51d725.system.entry.js +21 -0
- package/dist/ezeep/{p-a7b7b386.entry.js → p-b6ec69dc.entry.js} +2 -2
- package/dist/ezeep/p-cc2bb341.system.js +1 -0
- package/dist/ezeep/p-d4dae139.system.js +1 -0
- package/dist/ezeep/{p-f3065800.js → p-fa808a39.js} +0 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +1 -1
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +4 -4
- package/readme.md +6 -3
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/ezeep.js +1 -1
- package/www/build/p-0b51d725.system.entry.js +21 -0
- package/www/build/{p-a7b7b386.entry.js → p-b6ec69dc.entry.js} +2 -2
- package/www/build/p-cc2bb341.system.js +1 -0
- package/www/build/p-d4dae139.system.js +1 -0
- package/www/build/{p-f3065800.js → p-fa808a39.js} +0 -0
- package/www/data/locales/en.json +6 -1
- package/www/index.html +1 -1
- package/dist/custom-elements/index.d.ts +0 -123
- package/dist/esm-es5/index-265d8cca.js +0 -1
- package/dist/ezeep/p-98ec6965.system.js +0 -1
- package/dist/ezeep/p-a1b0d17a.system.entry.js +0 -21
- package/dist/ezeep/p-f89804ee.system.js +0 -1
- package/www/build/p-98ec6965.system.js +0 -1
- package/www/build/p-a1b0d17a.system.entry.js +0 -21
- package/www/build/p-f89804ee.system.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface EzpPrinting extends Components.EzpPrinting, HTMLElement {}
|
|
4
|
+
export const EzpPrinting: {
|
|
5
|
+
prototype: EzpPrinting;
|
|
6
|
+
new (): EzpPrinting;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { HTMLElement, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { a as authStore, i as initi18n, s as sendCodeToParentWindow } from './auth.js';
|
|
3
|
+
import { a as EzpPrintService, p as printStore, d as defineCustomElement$8 } from './ezp-printer-selection2.js';
|
|
4
|
+
import { u as userStore, d as defineCustomElement$2 } from './ezp-user-menu2.js';
|
|
5
|
+
import { i as i18next } from './i18next.js';
|
|
6
|
+
import { d as defineCustomElement$e } from './ezp-auth2.js';
|
|
7
|
+
import { d as defineCustomElement$d } from './ezp-backdrop2.js';
|
|
8
|
+
import { d as defineCustomElement$c } from './ezp-dialog2.js';
|
|
9
|
+
import { d as defineCustomElement$b } from './ezp-icon2.js';
|
|
10
|
+
import { d as defineCustomElement$a } from './ezp-icon-button2.js';
|
|
11
|
+
import { d as defineCustomElement$9 } from './ezp-label2.js';
|
|
12
|
+
import { d as defineCustomElement$7 } from './ezp-select2.js';
|
|
13
|
+
import { d as defineCustomElement$6 } from './ezp-status2.js';
|
|
14
|
+
import { d as defineCustomElement$5 } from './ezp-stepper2.js';
|
|
15
|
+
import { d as defineCustomElement$4 } from './ezp-text-button2.js';
|
|
16
|
+
import { d as defineCustomElement$3 } from './ezp-upload2.js';
|
|
17
|
+
|
|
18
|
+
const authApiHostUrl = "account.ezeep.com";
|
|
19
|
+
const printingApiHostUrl = "printapi.ezeep.com";
|
|
20
|
+
const config = {
|
|
21
|
+
authApiHostUrl: authApiHostUrl,
|
|
22
|
+
printingApiHostUrl: printingApiHostUrl
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const ezpPrintingCss = ":host{font-family:\"Inter\", sans-serif;-webkit-font-feature-settings:\"calt\", \"liga\", \"ss03\", \"zero\", \"cv05\", \"cv10\";font-feature-settings:\"calt\", \"liga\", \"ss03\", \"zero\", \"cv05\", \"cv10\";-webkit-font-kerning:normal;font-kerning:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;-webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;--ezp-duration-1:0.1s;--ezp-duration-2:0.16s;--ezp-duration-3:0.26s;--ezp-duration-4:0.42s;--ezp-duration-5:0.68s;--ezp-duration-6:1s;--ezp-spacing-1:4px;--ezp-spacing-2:6px;--ezp-spacing-3:10px;--ezp-spacing-4:16px;--ezp-spacing-5:26px;--ezp-spacing-6:42px;--ezp-spacing-7:68px;--ezp-spacing-8:110px;--ezp-easing-in-quart:cubic-bezier(0.11, 0, 0.5, 0);--ezp-easing-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--ezp-easing-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--ezp-easing-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--ezp-easing-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--ezp-easing-out-expo:cubic-bezier(0.16, 1, 0.3, 1)}:host(.light){--ezp-color-pink-solid:#f23267;--ezp-color-red-solid:#f23b22;--ezp-color-orange-solid:#fe7200;--ezp-color-green-solid:#5d9200;--ezp-color-cyan-solid:#0091b4;--ezp-color-blue-solid:#4e81f3;--ezp-color-violet-solid:#ae5ef3;--ezp-color-pink-translucent:rgba(242, 50, 103, 0.16);--ezp-color-red-translucent:rgba(242, 59, 34, 0.16);--ezp-color-orange-translucent:rgba(254, 114, 0, 0.16);--ezp-color-green-translucent:rgba(93, 146, 0, 0.16);--ezp-color-cyan-translucent:rgba(0, 145, 180, 0.16);--ezp-color-blue-translucent:rgba(78, 129, 243, 0.16);--ezp-color-violet-translucent:rgba(174, 94, 243, 0.16);--ezp-color-on-theme:white;--ezp-color-surface-primary:white;--ezp-color-surface-secondary:#f3f3f3;--ezp-color-surface-tertiary:white;--ezp-color-shade-primary:rgba(139, 139, 139, 0.1);--ezp-color-shade-secondary:rgba(139, 139, 139, 0.16);--ezp-color-shade-tertiary:rgba(139, 139, 139, 0.22);--ezp-color-foreground-primary:rgba(0, 0, 0, 0.94);--ezp-color-foreground-secondary:rgba(62, 62, 62, 0.68);--ezp-color-foreground-tertiary:rgba(62, 62, 62, 0.42);--ezp-color-outline:rgba(99, 99, 99, 0.16);--ezp-color-overlay-primary:rgba(0, 0, 0, 0.26);--ezp-color-overlay-secondary:rgba(0, 0, 0, 0.16);--ezp-color-shadow:rgba(0, 0, 0, 0.06)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-color-pink-solid:color(display-p3 0.949 0.196 0.404/100%);--ezp-color-red-solid:color(display-p3 0.949 0.231 0.133/100%);--ezp-color-orange-solid:color(display-p3 0.996 0.447 0/100%);--ezp-color-green-solid:color(display-p3 0.365 0.573 0/100%);--ezp-color-cyan-solid:color(display-p3 0 0.569 0.706/100%);--ezp-color-blue-solid:color(display-p3 0.306 0.506 0.953/100%);--ezp-color-violet-solid:color(display-p3 0.682 0.369 0.953/100%);--ezp-color-pink-translucent:color(display-p3 0.949 0.196 0.404/16%);--ezp-color-red-translucent:color(display-p3 0.949 0.231 0.133/16%);--ezp-color-orange-translucent:color(display-p3 0.996 0.447 0/16%);--ezp-color-green-translucent:color(display-p3 0.365 0.573 0/16%);--ezp-color-cyan-translucent:color(display-p3 0 0.569 0.706/16%);--ezp-color-blue-translucent:color(display-p3 0.306 0.506 0.953/16%);--ezp-color-violet-translucent:color(display-p3 0.682 0.369 0.953/16%);--ezp-color-on-theme:color(display-p3 1 1 1/100%);--ezp-color-surface-primary:color(display-p3 1 1 1/100%);--ezp-color-surface-secondary:color(display-p3 0.953 0.953 0.953/100%);--ezp-color-surface-tertiary:color(display-p3 1 1 1/100%);--ezp-color-shade-primary:color(display-p3 0.545 0.545 0.545/10%);--ezp-color-shade-secondary:color(display-p3 0.545 0.545 0.545/16%);--ezp-color-shade-tertiary:color(display-p3 0.545 0.545 0.545/22%);--ezp-color-foreground-primary:color(display-p3 0 0 0/94%);--ezp-color-foreground-secondary:color(display-p3 0.243 0.243 0.243/68%);--ezp-color-foreground-tertiary:color(display-p3 0.243 0.243 0.243/42%);--ezp-color-outline:color(display-p3 0.388 0.388 0.388/16%);--ezp-color-overlay-primary:color(display-p3 0 0 0/26%);--ezp-color-overlay-secondary:color(display-p3 0 0 0/16%);--ezp-color-shadow:color(display-p3 0 0 0/6%)}}}:host(.dark){--ezp-dialog-box-boxShadow:inset 0 0 0 1px var(--ezp-color-outline),\n 0 0 0 1px var(--ezp-color-overlay-secondary);--ezp-printerSelection-body-boxShadow:inset 1px 0 0 0 var(--ezp-color-outline),\n inset -1px 0 0 0 var(--ezp-color-outline);--ezp-printerSelection-footer-boxShadowPosition:inset 0 0 0 1px;--ezp-printerSelection-header-boxShadowPosition:inset 0 0 0 1px;--ezp-select-wrap-boxShadowPositionBottom:inset 0 -1px 0 0;--ezp-select-wrap-boxShadowPositionLeft:inset 1px 0 0 0;--ezp-select-wrap-boxShadowPositionRight:inset -1px 0 0 0;--ezp-select-wrap-boxShadowPositionTop:inset 0 1px 0 0;--ezp-status-box-boxShadowPosition:inset 0 0 0 1px;--ezp-stepper-boxShadowPosition:inset 0 0 0 1px;--ezp-userMenu-boxShadowPosition:inset 0 0 0 1px;--ezp-userMenu-header-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-links-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-theme-boxShadowPosition:inset 0 -1px 0 0}:host(.dark){--ezp-color-pink-solid:#ff4171;--ezp-color-red-solid:#ff482c;--ezp-color-orange-solid:#ff811c;--ezp-color-green-solid:#679c15;--ezp-color-cyan-solid:#209bbf;--ezp-color-blue-solid:#5b8bff;--ezp-color-violet-solid:#ba69ff;--ezp-color-pink-translucent:rgba(255, 65, 113, 0.26);--ezp-color-red-translucent:rgba(255, 72, 44, 0.26);--ezp-color-orange-translucent:rgba(255, 129, 28, 0.26);--ezp-color-green-translucent:rgba(103, 156, 21, 0.26);--ezp-color-cyan-translucent:rgba(32, 155, 191, 0.26);--ezp-color-blue-translucent:rgba(91, 139, 255, 0.26);--ezp-color-violet-translucent:rgba(186, 105, 255, 0.26);--ezp-color-on-theme:white;--ezp-color-surface-primary:black;--ezp-color-surface-secondary:#1b1b1b;--ezp-color-surface-tertiary:#282828;--ezp-color-shade-primary:rgba(99, 99, 99, 0.26);--ezp-color-shade-secondary:rgba(99, 99, 99, 0.32);--ezp-color-shade-tertiary:rgba(99, 99, 99, 0.38);--ezp-color-foreground-primary:rgba(255, 255, 255, 0.94);--ezp-color-foreground-secondary:rgba(182, 182, 182, 0.68);--ezp-color-foreground-tertiary:rgba(182, 182, 182, 0.42);--ezp-color-outline:rgba(139, 139, 139, 0.26);--ezp-color-overlay-primary:rgba(0, 0, 0, 0.68);--ezp-color-overlay-secondary:rgba(0, 0, 0, 0.42);--ezp-color-shadow:rgba(0, 0, 0, 0.1)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-color-pink-solid:color(display-p3 1 0.255 0.443/100%);--ezp-color-red-solid:color(display-p3 1 0.282 0.173/100%);--ezp-color-orange-solid:color(display-p3 1 0.506 0.11/100%);--ezp-color-green-solid:color(display-p3 0.404 0.612 0.082/100%);--ezp-color-cyan-solid:color(display-p3 0.125 0.608 0.749/100%);--ezp-color-blue-solid:color(display-p3 0.357 0.545 1/100%);--ezp-color-violet-solid:color(display-p3 0.729 0.412 1/100%);--ezp-color-pink-translucent:color(display-p3 1 0.255 0.443/26%);--ezp-color-red-translucent:color(display-p3 1 0.282 0.173/26%);--ezp-color-orange-translucent:color(display-p3 1 0.506 0.11/26%);--ezp-color-green-translucent:color(display-p3 0.404 0.612 0.082/26%);--ezp-color-cyan-translucent:color(display-p3 0.125 0.608 0.749/26%);--ezp-color-blue-translucent:color(display-p3 0.357 0.545 1/26%);--ezp-color-violet-translucent:color(display-p3 0.729 0.412 1/26%);--ezp-color-on-theme:color(display-p3 1 1 1/100%);--ezp-color-surface-primary:color(display-p3 0 0 0/100%);--ezp-color-surface-secondary:color(display-p3 0.106 0.106 0.106/100%);--ezp-color-surface-tertiary:color(display-p3 0.157 0.157 0.157/100%);--ezp-color-shade-primary:color(display-p3 0.388 0.388 0.388/26%);--ezp-color-shade-secondary:color(display-p3 0.388 0.388 0.388/32%);--ezp-color-shade-tertiary:color(display-p3 0.388 0.388 0.388/38%);--ezp-color-foreground-primary:color(display-p3 1 1 1/94%);--ezp-color-foreground-secondary:color(display-p3 0.714 0.714 0.714/68%);--ezp-color-foreground-tertiary:color(display-p3 0.714 0.714 0.714/42%);--ezp-color-outline:color(display-p3 0.545 0.545 0.545/26%);--ezp-color-overlay-primary:color(display-p3 0 0 0/68%);--ezp-color-overlay-secondary:color(display-p3 0 0 0/42%);--ezp-color-shadow:color(display-p3 0 0 0/10%)}}}:host(.blue){--ezp-color-theme-solid:var(--ezp-color-blue-solid);--ezp-color-theme-translucent:var(--ezp-color-blue-translucent)}:host(.cyan){--ezp-color-theme-solid:var(--ezp-color-cyan-solid);--ezp-color-theme-translucent:var(--ezp-color-cyan-translucent)}:host(.green){--ezp-color-theme-solid:var(--ezp-color-green-solid);--ezp-color-theme-translucent:var(--ezp-color-green-translucent)}:host(.orange){--ezp-color-theme-solid:var(--ezp-color-orange-solid);--ezp-color-theme-translucent:var(--ezp-color-orange-translucent)}:host(.pink){--ezp-color-theme-solid:var(--ezp-color-pink-solid);--ezp-color-theme-translucent:var(--ezp-color-pink-translucent)}:host(.red){--ezp-color-theme-solid:var(--ezp-color-red-solid);--ezp-color-theme-translucent:var(--ezp-color-red-translucent)}:host(.violet){--ezp-color-theme-solid:var(--ezp-color-violet-solid);--ezp-color-theme-translucent:var(--ezp-color-violet-translucent)}";
|
|
26
|
+
|
|
27
|
+
let EzpPrinting$1 = class extends HTMLElement {
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.__registerHost();
|
|
31
|
+
this.__attachShadow();
|
|
32
|
+
this.filename = '';
|
|
33
|
+
this.hidemenu = false;
|
|
34
|
+
this.theme = 'cyan';
|
|
35
|
+
this.appearance = 'system';
|
|
36
|
+
this.language = '';
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* States
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
/** Description... */
|
|
43
|
+
this.printOpen = false;
|
|
44
|
+
this.authOpen = false;
|
|
45
|
+
this.noDocumentOpen = false;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* Listeners
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
/** Description... */
|
|
53
|
+
listenPrintCancel() {
|
|
54
|
+
this.printOpen = false;
|
|
55
|
+
}
|
|
56
|
+
/** Description... */
|
|
57
|
+
listenPrintSubmit() {
|
|
58
|
+
this.printOpen = false;
|
|
59
|
+
}
|
|
60
|
+
/** Description... */
|
|
61
|
+
listenAuthCancel() {
|
|
62
|
+
this.authOpen = false;
|
|
63
|
+
}
|
|
64
|
+
listenAuthSuccess() {
|
|
65
|
+
if (this.filename != '') {
|
|
66
|
+
this.printOpen = true;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.noDocumentOpen = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
listenUploadFile(event) {
|
|
73
|
+
this.filename = event.detail[0].name;
|
|
74
|
+
this.file = event.detail[0];
|
|
75
|
+
this.open();
|
|
76
|
+
}
|
|
77
|
+
listenDialogClose(event) {
|
|
78
|
+
if (event.detail === 'no-document-selected') {
|
|
79
|
+
this.noDocumentOpen = false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
listenDialogAction(event) {
|
|
83
|
+
if (event.detail === 'no-document-selected') {
|
|
84
|
+
this.noDocumentOpen = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* Public methods
|
|
90
|
+
*
|
|
91
|
+
*/
|
|
92
|
+
async open() {
|
|
93
|
+
if (authStore.state.isAuthorized) {
|
|
94
|
+
if (this.filename) {
|
|
95
|
+
this.printOpen = true;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this.noDocumentOpen = true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.authOpen = true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
checkAuth() {
|
|
106
|
+
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
107
|
+
let accessToken = authStore.state.accessToken;
|
|
108
|
+
if (accessToken === '') {
|
|
109
|
+
accessToken = localStorage.getItem('access_token');
|
|
110
|
+
authStore.state.accessToken = accessToken;
|
|
111
|
+
}
|
|
112
|
+
if (localStorage.getItem('isAuthorized')) {
|
|
113
|
+
authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
|
|
114
|
+
this.authOpen = !authStore.state.isAuthorized;
|
|
115
|
+
}
|
|
116
|
+
printService
|
|
117
|
+
.getConfig(authStore.state.accessToken)
|
|
118
|
+
.then((response) => {
|
|
119
|
+
if (response.ok) {
|
|
120
|
+
authStore.state.isAuthorized = true;
|
|
121
|
+
}
|
|
122
|
+
if (!response.ok) {
|
|
123
|
+
throw new Error('http status ' + response.status);
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
.catch(() => {
|
|
127
|
+
authStore.state.isAuthorized = false;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
componentWillLoad() {
|
|
131
|
+
const systemAppearanceDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
132
|
+
this.systemAppearance = systemAppearanceDark.matches ? 'dark' : 'light';
|
|
133
|
+
systemAppearanceDark.addEventListener('change', (event) => {
|
|
134
|
+
this.systemAppearance = event.matches ? 'dark' : 'light';
|
|
135
|
+
});
|
|
136
|
+
authStore.state.redirectUri = this.redirecturi;
|
|
137
|
+
userStore.state.theme = this.theme;
|
|
138
|
+
userStore.state.appearance = this.appearance;
|
|
139
|
+
if (this.authapihosturl) {
|
|
140
|
+
authStore.state.authApiHostUrl = this.authapihosturl;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
authStore.state.authApiHostUrl = config.authApiHostUrl;
|
|
144
|
+
}
|
|
145
|
+
if (this.printapihosturl) {
|
|
146
|
+
printStore.state.printApiHostUrl = this.printapihosturl;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
150
|
+
}
|
|
151
|
+
initi18n(this.language);
|
|
152
|
+
sendCodeToParentWindow();
|
|
153
|
+
this.checkAuth();
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
*
|
|
157
|
+
* Render method
|
|
158
|
+
*
|
|
159
|
+
*/
|
|
160
|
+
render() {
|
|
161
|
+
return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
162
|
+
? this.systemAppearance
|
|
163
|
+
: userStore.state.appearance}` }, this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, 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" })) : 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() })))));
|
|
164
|
+
}
|
|
165
|
+
static get style() { return ezpPrintingCss; }
|
|
166
|
+
};
|
|
167
|
+
EzpPrinting$1 = /*@__PURE__*/ proxyCustomElement(EzpPrinting$1, [1, "ezp-printing", {
|
|
168
|
+
"clientid": [1],
|
|
169
|
+
"redirecturi": [1],
|
|
170
|
+
"filename": [1025],
|
|
171
|
+
"fileurl": [1],
|
|
172
|
+
"filetype": [1],
|
|
173
|
+
"custom": [4],
|
|
174
|
+
"hidelogin": [4],
|
|
175
|
+
"hidemenu": [4],
|
|
176
|
+
"authapihosturl": [1],
|
|
177
|
+
"printapihosturl": [1],
|
|
178
|
+
"theme": [1],
|
|
179
|
+
"fileid": [1],
|
|
180
|
+
"appearance": [1],
|
|
181
|
+
"trigger": [1],
|
|
182
|
+
"language": [1],
|
|
183
|
+
"printOpen": [32],
|
|
184
|
+
"authOpen": [32],
|
|
185
|
+
"noDocumentOpen": [32],
|
|
186
|
+
"systemAppearance": [32],
|
|
187
|
+
"open": [64]
|
|
188
|
+
}, [[0, "printCancel", "listenPrintCancel"], [0, "printSubmit", "listenPrintSubmit"], [0, "authCancel", "listenAuthCancel"], [0, "authSuccess", "listenAuthSuccess"], [0, "uploadFile", "listenUploadFile"], [0, "dialogClose", "listenDialogClose"], [0, "dialogAction", "listenDialogAction"]]]);
|
|
189
|
+
function defineCustomElement$1() {
|
|
190
|
+
if (typeof customElements === "undefined") {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const components = ["ezp-printing", "ezp-auth", "ezp-backdrop", "ezp-dialog", "ezp-icon", "ezp-icon-button", "ezp-label", "ezp-printer-selection", "ezp-select", "ezp-status", "ezp-stepper", "ezp-text-button", "ezp-upload", "ezp-user-menu"];
|
|
194
|
+
components.forEach(tagName => { switch (tagName) {
|
|
195
|
+
case "ezp-printing":
|
|
196
|
+
if (!customElements.get(tagName)) {
|
|
197
|
+
customElements.define(tagName, EzpPrinting$1);
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
case "ezp-auth":
|
|
201
|
+
if (!customElements.get(tagName)) {
|
|
202
|
+
defineCustomElement$e();
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case "ezp-backdrop":
|
|
206
|
+
if (!customElements.get(tagName)) {
|
|
207
|
+
defineCustomElement$d();
|
|
208
|
+
}
|
|
209
|
+
break;
|
|
210
|
+
case "ezp-dialog":
|
|
211
|
+
if (!customElements.get(tagName)) {
|
|
212
|
+
defineCustomElement$c();
|
|
213
|
+
}
|
|
214
|
+
break;
|
|
215
|
+
case "ezp-icon":
|
|
216
|
+
if (!customElements.get(tagName)) {
|
|
217
|
+
defineCustomElement$b();
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
case "ezp-icon-button":
|
|
221
|
+
if (!customElements.get(tagName)) {
|
|
222
|
+
defineCustomElement$a();
|
|
223
|
+
}
|
|
224
|
+
break;
|
|
225
|
+
case "ezp-label":
|
|
226
|
+
if (!customElements.get(tagName)) {
|
|
227
|
+
defineCustomElement$9();
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
case "ezp-printer-selection":
|
|
231
|
+
if (!customElements.get(tagName)) {
|
|
232
|
+
defineCustomElement$8();
|
|
233
|
+
}
|
|
234
|
+
break;
|
|
235
|
+
case "ezp-select":
|
|
236
|
+
if (!customElements.get(tagName)) {
|
|
237
|
+
defineCustomElement$7();
|
|
238
|
+
}
|
|
239
|
+
break;
|
|
240
|
+
case "ezp-status":
|
|
241
|
+
if (!customElements.get(tagName)) {
|
|
242
|
+
defineCustomElement$6();
|
|
243
|
+
}
|
|
244
|
+
break;
|
|
245
|
+
case "ezp-stepper":
|
|
246
|
+
if (!customElements.get(tagName)) {
|
|
247
|
+
defineCustomElement$5();
|
|
248
|
+
}
|
|
249
|
+
break;
|
|
250
|
+
case "ezp-text-button":
|
|
251
|
+
if (!customElements.get(tagName)) {
|
|
252
|
+
defineCustomElement$4();
|
|
253
|
+
}
|
|
254
|
+
break;
|
|
255
|
+
case "ezp-upload":
|
|
256
|
+
if (!customElements.get(tagName)) {
|
|
257
|
+
defineCustomElement$3();
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
260
|
+
case "ezp-user-menu":
|
|
261
|
+
if (!customElements.get(tagName)) {
|
|
262
|
+
defineCustomElement$2();
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
} });
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const EzpPrinting = EzpPrinting$1;
|
|
269
|
+
const defineCustomElement = defineCustomElement$1;
|
|
270
|
+
|
|
271
|
+
export { EzpPrinting, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface EzpSelect extends Components.EzpSelect, HTMLElement {}
|
|
4
|
+
export const EzpSelect: {
|
|
5
|
+
prototype: EzpSelect;
|
|
6
|
+
new (): EzpSelect;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './ezp-backdrop2.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './ezp-icon2.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './ezp-label2.js';
|
|
5
|
+
|
|
6
|
+
const ezpSelectCss = ":host{--ezp-select-duration:var(--ezp-duration-3);display:block;height:var(--ezp-select-toggle-height);position:relative;-webkit-transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));z-index:var(--ezp-select-zIndex, 3)}:host(:first-child){--ezp-select-wrap-borderRadius:3px 3px 0 0}:host(:last-child){--ezp-select-wrap-borderRadius:0 0 3px 3px}:host(:first-child:last-child){--ezp-select-wrap-borderRadius:3px}:host(:not(:last-child):not(.is-expanded)){--ezp-select-wrap-boxShadowPositionBottom:0 0 0 0}:host(.toggle-horizontal){--ezp-select-label-alignSelf:start;--ezp-select-toggle-gridTemplateAreas:\"label value accessory\";--ezp-select-toggle-gridTemplateColumns:1fr repeat(2, auto);--ezp-select-toggle-height:30px;--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-alignSelf:end}:host(.toggle-horizontal.has-icon){--ezp-select-toggle-gridTemplateAreas:\"icon label value accessory\";--ezp-select-toggle-gridTemplateColumns:auto 1fr repeat(2, auto)}:host(.toggle-vertical){--ezp-select-label-alignSelf:center;--ezp-select-toggle-gridTemplateAreas:\"label accessory\" \"value accessory\";--ezp-select-toggle-gridTemplateColumns:1fr auto;--ezp-select-toggle-height:48px;--ezp-select-toggle-gridTemplateRows:repeat(2, auto);--ezp-select-value-alignSelf:center}:host(.toggle-vertical.has-icon){--ezp-select-toggle-gridTemplateAreas:\"icon label accessory\" \"icon value accessory\";--ezp-select-toggle-gridTemplateColumns:auto 1fr auto}:host(.option-horizontal){--ezp-select-details-gridTemplateColumns:repeat(2, 1fr);--ezp-select-details-gridTemplateRows:auto;--ezp-select-option-height:30px}:host(.option-vertical){--ezp-select-details-gridTemplateColumns:1fr;--ezp-select-details-gridTemplateRows:repeat(2, auto);--ezp-select-option-height:48px}:host(.is-expanded){--ezp-select-accessory-color:var(--ezp-color-theme-solid);--ezp-select-transition:z-index 0s 0s;--ezp-select-zIndex:9999;--ezp-select-icon-color:var(--ezp-color-theme-solid);--ezp-select-label-color:var(--ezp-color-theme-solid);--ezp-select-wrap-borderRadius:3px}:host(.disabled){--ezp-select-accessory-color:var(--ezp-color-foreground-tertiary);--ezp-select-icon-color:var(--ezp-color-foreground-tertiary);--ezp-select-label-color:var(--ezp-color-foreground-tertiary);--ezp-select-toggle-background-hover:transparent;--ezp-select-toggle-cursor:default;--value-color:var(--ezp-color-foreground-tertiary)}#wrap{background:var(--ezp-color-surface-tertiary);border-radius:var(--ezp-select-wrap-borderRadius, 0);-webkit-box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-color-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-color-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-color-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-color-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-color-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-color-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-color-outline);-webkit-transform:translateY(var(--ezp-select-wrap-translateY, 0));transform:translateY(var(--ezp-select-wrap-translateY, 0));-webkit-transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart)}#toggle{background:var(--ezp-select-toggle-background, transparent);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:var(--ezp-select-toggle-cursor, pointer);display:grid;gap:var(--ezp-spacing-2) var(--ezp-spacing-3);grid-template-areas:var(--ezp-select-toggle-gridTemplateAreas, none);grid-template-columns:var(--ezp-select-toggle-gridTemplateColumns, none);grid-template-rows:var(--ezp-select-toggle-gridTemplateRows, auto);height:var(--ezp-select-toggle-height, auto);padding:var(--ezp-spacing-3)}#toggle:hover{--ezp-select-toggle-background:var(\n --ezp-select-toggle-background-hover,\n var(--ezp-color-shade-primary)\n )}#icon{align-self:center;color:var(--ezp-select-icon-color, var(--ezp-color-foreground-secondary));grid-area:icon;margin:calc(var(--ezp-spacing-2) * -1) 0}#label{align-self:var(--ezp-select-label-alignSelf, auto);color:var(--ezp-select-label-color, var(--ezp-color-foreground-secondary));grid-area:label}#value{align-self:var(--ezp-select-value-alignSelf, auto);color:var(--value-color, var(--ezp-color-foreground-primary));grid-area:value}#accessory{align-self:center;color:var(--ezp-select-accessory-color, var(--ezp-color-foreground-secondary));grid-area:accessory;margin:calc(var(--ezp-spacing-2) * -1) 0}#list{-webkit-box-shadow:inset 0 1px 0 0 var(--ezp-color-outline);box-shadow:inset 0 1px 0 0 var(--ezp-color-outline);height:var(--ezp-select-list-height, 0);overflow:auto;-webkit-transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart)}.option{background:var(--ezp-select-option-background);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;height:var(--ezp-select-option-height, auto);padding:0 0 0 var(--ezp-spacing-3)}.option:not(:last-child){--ezp-select-details-boxShadow:inset 0 -1px 0 0 var(--ezp-color-outline)}.option:hover{--ezp-select-option-background:var(--ezp-color-shade-primary)}.option:active{--ezp-select-option-background:var(--ezp-color-shade-secondary)}.option.is-selected{--ezp-select-indicator-opacity:1;--ezp-select-indicator-transform:translateX(0);--ezp-select-indicator-transition:opacity var(--ezp-select-duration)\n var(--ezp-easing-out-quart),\n transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-select-indicator-visibility:visible}.indicator{-ms-flex-item-align:center;align-self:center;color:var(--ezp-color-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0;opacity:var(--ezp-select-indicator-opacity, 0);-webkit-transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));-webkit-transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));visibility:var(--ezp-select-indicator-visibility, hidden)}.details{-webkit-box-shadow:var(--ezp-select-details-boxShadow);box-shadow:var(--ezp-select-details-boxShadow);display:grid;gap:var(--ezp-spacing-2);grid-template-columns:var(--ezp-select-details-gridTemplateColumns, 1fr);grid-template-rows:var(--ezp-select-details-gridTemplateRows, auto);padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) 0}.title{-ms-flex-item-align:start;align-self:start;color:var(--ezp-color-foreground-primary)}.meta{-ms-flex-item-align:end;align-self:end;color:var(--ezp-color-foreground-secondary)}";
|
|
7
|
+
|
|
8
|
+
let EzpSelect = class extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
this.selectToggle = createEvent(this, "selectToggle", 7);
|
|
14
|
+
this.selectSelection = createEvent(this, "selectSelection", 7);
|
|
15
|
+
this.backdrop = document.createElement('ezp-backdrop');
|
|
16
|
+
this.containerHeight = 0;
|
|
17
|
+
this.expandCover = false;
|
|
18
|
+
this.expandRise = false;
|
|
19
|
+
this.listHeight = 0;
|
|
20
|
+
this.spacing = 6;
|
|
21
|
+
this.toggleHeight = 0;
|
|
22
|
+
this.wrapDiff = 0;
|
|
23
|
+
this.wrapHeight = 0;
|
|
24
|
+
this.wrapTop = 0;
|
|
25
|
+
this.duration = 0;
|
|
26
|
+
/** Description... */
|
|
27
|
+
this.label = 'Label';
|
|
28
|
+
/** Description... */
|
|
29
|
+
this.placeholder = 'Placeholder';
|
|
30
|
+
/** Description... */
|
|
31
|
+
this.toggleFlow = 'horizontal';
|
|
32
|
+
/** Description... */
|
|
33
|
+
this.disabled = false;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* States
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
/** Description... */
|
|
40
|
+
this.expanded = false;
|
|
41
|
+
/** Description... */
|
|
42
|
+
this.selected = { id: false, title: '', meta: '' };
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* Private methods
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
this.toggle = () => {
|
|
49
|
+
this.containerHeight = this.container.clientHeight - this.spacing * 2;
|
|
50
|
+
this.listHeight = this.list.scrollHeight;
|
|
51
|
+
this.wrapTop = this.component.offsetTop;
|
|
52
|
+
this.wrapHeight = this.toggleHeight + this.listHeight;
|
|
53
|
+
this.expandCover = this.wrapHeight > this.containerHeight;
|
|
54
|
+
this.expandRise = this.wrapHeight > this.containerHeight - this.wrapTop;
|
|
55
|
+
this.wrapDiff = this.containerHeight - this.wrapHeight - this.wrapTop;
|
|
56
|
+
this.expanded = !this.expanded;
|
|
57
|
+
this.selectToggle.emit(this.expanded);
|
|
58
|
+
};
|
|
59
|
+
this.select = (id) => {
|
|
60
|
+
const delay = this.selected.id === id ? 0 : this.duration * 1000;
|
|
61
|
+
this.selected = this.options.find((option) => option.id === id);
|
|
62
|
+
this.selectSelection.emit(this.selected);
|
|
63
|
+
window.setTimeout(() => {
|
|
64
|
+
this.toggle();
|
|
65
|
+
}, delay);
|
|
66
|
+
};
|
|
67
|
+
this.preSelect = () => {
|
|
68
|
+
this.selected = this.options.find((option) => typeof this.preSelected === 'number'
|
|
69
|
+
? option.id === this.preSelected
|
|
70
|
+
: typeof this.preSelected === 'string'
|
|
71
|
+
? option.title === this.preSelected
|
|
72
|
+
: null);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* Watchers
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
watchExpanded() {
|
|
81
|
+
if (this.expandCover) {
|
|
82
|
+
this.component.style.setProperty('--ezp-select-list-height', this.expanded ? `${this.containerHeight - this.toggleHeight}px` : '0px');
|
|
83
|
+
this.component.style.setProperty('--ezp-select-wrap-translateY', this.expanded ? `${this.wrapTop * -1 + this.spacing}px` : '0px');
|
|
84
|
+
}
|
|
85
|
+
else if (this.expandRise) {
|
|
86
|
+
this.component.style.setProperty('--ezp-select-list-height', this.expanded ? `${this.listHeight}px` : '0px');
|
|
87
|
+
this.component.style.setProperty('--ezp-select-wrap-translateY', this.expanded ? `${this.wrapDiff + this.spacing}px` : '0px');
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.component.style.setProperty('--ezp-select-list-height', this.expanded ? `${this.listHeight}px` : '0px');
|
|
91
|
+
}
|
|
92
|
+
if (this.expanded) {
|
|
93
|
+
this.backdrop.visible = true;
|
|
94
|
+
this.container.appendChild(this.backdrop);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
this.backdrop.visible = false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* Lifecycle methods
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
componentWillLoad() {
|
|
106
|
+
this.container = this.component.closest('[data-backdrop-surface]');
|
|
107
|
+
this.backdrop.addEventListener('backdropHideStart', () => {
|
|
108
|
+
this.expanded = false;
|
|
109
|
+
});
|
|
110
|
+
this.backdrop.addEventListener('backdropHideEnd', () => {
|
|
111
|
+
this.container.removeChild(this.backdrop);
|
|
112
|
+
});
|
|
113
|
+
if (this.preSelected) {
|
|
114
|
+
this.preSelect();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
componentDidLoad() {
|
|
118
|
+
const styles = getComputedStyle(this.component);
|
|
119
|
+
this.toggleHeight = parseInt(styles.getPropertyValue('--ezp-select-toggle-height'));
|
|
120
|
+
this.duration = parseFloat(styles.getPropertyValue('--ezp-select-duration'));
|
|
121
|
+
}
|
|
122
|
+
componentWillUpdate() {
|
|
123
|
+
if (!this.selected.id && this.preSelected) {
|
|
124
|
+
this.preSelect();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* Render method
|
|
130
|
+
*
|
|
131
|
+
*/
|
|
132
|
+
render() {
|
|
133
|
+
const hostClasses = [
|
|
134
|
+
this.expanded ? 'is-expanded' : '',
|
|
135
|
+
this.icon ? 'has-icon' : '',
|
|
136
|
+
`toggle-${this.toggleFlow}`,
|
|
137
|
+
this.optionFlow ? `option-${this.optionFlow}` : '',
|
|
138
|
+
this.disabled ? 'disabled' : '',
|
|
139
|
+
];
|
|
140
|
+
const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
|
|
141
|
+
return (h(Host, { class: hostClasses.join(' ') }, h("div", { id: "wrap" }, h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() }, this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }), h("ezp-label", { id: "value", ellipsis: true, text: this.selected.title !== '' ? this.selected.title : this.placeholder }), h("ezp-icon", { id: "accessory", name: "expand" })), h("div", { id: "list", ref: (element) => (this.list = element) }, this.options.map((option) => {
|
|
142
|
+
if (option.title !== '') {
|
|
143
|
+
return (h("div", { class: `option ${option.id === this.selected.id ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, onClick: () => this.select(option.id) }, h("ezp-icon", { name: "checkmark", class: "indicator" }), h("div", { class: "details" }, h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
|
|
144
|
+
}
|
|
145
|
+
})))));
|
|
146
|
+
}
|
|
147
|
+
get component() { return this; }
|
|
148
|
+
static get watchers() { return {
|
|
149
|
+
"expanded": ["watchExpanded"]
|
|
150
|
+
}; }
|
|
151
|
+
static get style() { return ezpSelectCss; }
|
|
152
|
+
};
|
|
153
|
+
EzpSelect = /*@__PURE__*/ proxyCustomElement(EzpSelect, [1, "ezp-select", {
|
|
154
|
+
"icon": [1],
|
|
155
|
+
"label": [1],
|
|
156
|
+
"optionFlow": [1, "option-flow"],
|
|
157
|
+
"options": [16],
|
|
158
|
+
"placeholder": [1],
|
|
159
|
+
"preSelected": [8, "pre-selected"],
|
|
160
|
+
"toggleFlow": [1, "toggle-flow"],
|
|
161
|
+
"disabled": [4],
|
|
162
|
+
"expanded": [32],
|
|
163
|
+
"selected": [32]
|
|
164
|
+
}]);
|
|
165
|
+
function defineCustomElement() {
|
|
166
|
+
if (typeof customElements === "undefined") {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const components = ["ezp-select", "ezp-backdrop", "ezp-icon", "ezp-label"];
|
|
170
|
+
components.forEach(tagName => { switch (tagName) {
|
|
171
|
+
case "ezp-select":
|
|
172
|
+
if (!customElements.get(tagName)) {
|
|
173
|
+
customElements.define(tagName, EzpSelect);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
case "ezp-backdrop":
|
|
177
|
+
if (!customElements.get(tagName)) {
|
|
178
|
+
defineCustomElement$3();
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
case "ezp-icon":
|
|
182
|
+
if (!customElements.get(tagName)) {
|
|
183
|
+
defineCustomElement$2();
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case "ezp-label":
|
|
187
|
+
if (!customElements.get(tagName)) {
|
|
188
|
+
defineCustomElement$1();
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
} });
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { EzpSelect as E, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface EzpStatus extends Components.EzpStatus, HTMLElement {}
|
|
4
|
+
export const EzpStatus: {
|
|
5
|
+
prototype: EzpStatus;
|
|
6
|
+
new (): EzpStatus;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
|
+
import { i as i18next } from './i18next.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './ezp-icon2.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './ezp-label2.js';
|
|
5
|
+
import { d as defineCustomElement$1 } from './ezp-text-button2.js';
|
|
6
|
+
|
|
7
|
+
const ezpStatusCss = ":host{-ms-flex-align:center;align-items:center;background:var(--ezp-color-overlay-primary);border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;height:100%;-ms-flex-pack:center;justify-content:center;left:0;padding:var(--ezp-spacing-6);position:absolute;top:0;width:100%;z-index:9999}@media (prefers-color-scheme: dark){:host{--box-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#box{--ezp-icon-fill:var(--ezp-color-theme-solid);-ms-flex-align:center;align-items:center;background:var(--ezp-color-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-status-box-boxShadowPosition, 0 0 0 1px) var(--ezp-color-outline);box-shadow:var(--ezp-status-box-boxShadowPosition, 0 0 0 1px) var(--ezp-color-outline);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);padding:var(--ezp-spacing-4) var(--ezp-spacing-5)}#indicator{-webkit-animation:rotate var(--ezp-duration-6) linear infinite;animation:rotate var(--ezp-duration-6) linear infinite;display:block;height:42px;-webkit-transform:rotate(0);transform:rotate(0);width:42px}#track{fill:none;stroke:var(--ezp-color-outline);stroke-width:4px}#value{-webkit-animation:offset var(--ezp-duration-6) linear alternate infinite;animation:offset var(--ezp-duration-6) linear alternate infinite;fill:none;stroke:var(--ezp-color-theme-solid);stroke-dasharray:110;stroke-dashoffset:110;stroke-linecap:round;stroke-width:4px}#description{color:var(--ezp-color-foreground-primary)}#footer{display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}@-webkit-keyframes offset{100%{stroke-dashoffset:55}}@keyframes offset{100%{stroke-dashoffset:55}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";
|
|
8
|
+
|
|
9
|
+
let EzpStatus = class extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.statusCancel = createEvent(this, "statusCancel", 7);
|
|
15
|
+
this.statusClose = createEvent(this, "statusClose", 7);
|
|
16
|
+
this.statusRetry = createEvent(this, "statusRetry", 7);
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Properties
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
this.description = 'Description';
|
|
23
|
+
this.processing = false;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* Private methods
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
this.handleCancel = () => {
|
|
30
|
+
this.statusCancel.emit(this.instance);
|
|
31
|
+
};
|
|
32
|
+
this.handleClose = () => {
|
|
33
|
+
this.statusClose.emit(this.instance);
|
|
34
|
+
};
|
|
35
|
+
this.handleRetry = () => {
|
|
36
|
+
this.statusRetry.emit(this.instance);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* Lifecycle methods
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
componentWillLoad() {
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* Render method
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
render() {
|
|
52
|
+
return (h(Host, null, h("div", { id: "box" }, this.processing ? (h("svg", { id: "indicator", viewBox: "0 0 42 42", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { id: "track", cx: "21", cy: "21", r: "18" }), h("circle", { id: "value", cx: "21", cy: "21", r: "18" }))) : this.icon ? (h("ezp-icon", { name: this.icon, framed: true })) : null, h("ezp-label", { id: "description", level: "tertiary", weight: "strong", text: this.description }), h("div", { id: "footer" }, this.cancel && (h("ezp-text-button", { level: "secondary", small: true, onClick: this.handleCancel, label: typeof this.cancel === 'string' ? this.cancel : i18next.t('button_actions.cancel') })), this.close && (h("ezp-text-button", { level: this.retry ? 'secondary' : 'primary', small: true, onClick: this.handleClose, label: typeof this.close === 'string' ? this.close : i18next.t('button_actions.close') })), this.retry && (h("ezp-text-button", { level: "primary", small: true, onClick: this.handleRetry, label: typeof this.retry === 'string' ? this.retry : i18next.t('button_actions.retry') })), h("slot", null)))));
|
|
53
|
+
}
|
|
54
|
+
static get style() { return ezpStatusCss; }
|
|
55
|
+
};
|
|
56
|
+
EzpStatus = /*@__PURE__*/ proxyCustomElement(EzpStatus, [1, "ezp-status", {
|
|
57
|
+
"description": [1],
|
|
58
|
+
"processing": [4],
|
|
59
|
+
"instance": [1],
|
|
60
|
+
"icon": [1],
|
|
61
|
+
"cancel": [8],
|
|
62
|
+
"close": [8],
|
|
63
|
+
"retry": [8]
|
|
64
|
+
}]);
|
|
65
|
+
function defineCustomElement() {
|
|
66
|
+
if (typeof customElements === "undefined") {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const components = ["ezp-status", "ezp-icon", "ezp-label", "ezp-text-button"];
|
|
70
|
+
components.forEach(tagName => { switch (tagName) {
|
|
71
|
+
case "ezp-status":
|
|
72
|
+
if (!customElements.get(tagName)) {
|
|
73
|
+
customElements.define(tagName, EzpStatus);
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
case "ezp-icon":
|
|
77
|
+
if (!customElements.get(tagName)) {
|
|
78
|
+
defineCustomElement$3();
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
case "ezp-label":
|
|
82
|
+
if (!customElements.get(tagName)) {
|
|
83
|
+
defineCustomElement$2();
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
case "ezp-text-button":
|
|
87
|
+
if (!customElements.get(tagName)) {
|
|
88
|
+
defineCustomElement$1();
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
} });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { EzpStatus as E, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface EzpStepper extends Components.EzpStepper, HTMLElement {}
|
|
4
|
+
export const EzpStepper: {
|
|
5
|
+
prototype: EzpStepper;
|
|
6
|
+
new (): EzpStepper;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|