@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.
Files changed (100) hide show
  1. package/dist/cjs/ezeep.cjs.js +3 -3
  2. package/dist/cjs/ezp-auth_14.cjs.entry.js +118 -67
  3. package/dist/cjs/{index-62fc857c.js → index-d547be4e.js} +23 -0
  4. package/dist/cjs/loader.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +2 -2
  6. package/dist/collection/components/ezp-auth/ezp-auth.js +1 -3
  7. package/dist/collection/components/ezp-dialog/ezp-dialog.js +0 -2
  8. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +87 -52
  9. package/dist/collection/components/ezp-printing/ezp-printing.js +24 -3
  10. package/dist/collection/components/ezp-status/ezp-status.js +0 -2
  11. package/dist/collection/components/ezp-upload/ezp-upload.js +0 -2
  12. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +0 -2
  13. package/dist/collection/services/auth.js +2 -0
  14. package/dist/collection/utils/utils.js +20 -8
  15. package/dist/components/auth.js +504 -0
  16. package/dist/components/ezp-auth.d.ts +11 -0
  17. package/dist/components/ezp-auth.js +6 -0
  18. package/dist/components/ezp-auth2.js +141 -0
  19. package/dist/components/ezp-backdrop.d.ts +11 -0
  20. package/dist/components/ezp-backdrop.js +6 -0
  21. package/dist/components/ezp-backdrop2.js +46 -0
  22. package/dist/components/ezp-dialog.d.ts +11 -0
  23. package/dist/components/ezp-dialog.js +6 -0
  24. package/dist/components/ezp-dialog2.js +92 -0
  25. package/dist/components/ezp-icon-button.d.ts +11 -0
  26. package/dist/components/ezp-icon-button.js +6 -0
  27. package/dist/components/ezp-icon-button2.js +70 -0
  28. package/dist/components/ezp-icon.d.ts +11 -0
  29. package/dist/components/ezp-icon.js +6 -0
  30. package/dist/components/ezp-icon2.js +58 -0
  31. package/dist/components/ezp-label.d.ts +11 -0
  32. package/dist/components/ezp-label.js +6 -0
  33. package/dist/components/ezp-label2.js +57 -0
  34. package/dist/components/ezp-printer-selection.d.ts +11 -0
  35. package/dist/components/ezp-printer-selection.js +6 -0
  36. package/dist/{custom-elements/index.js → components/ezp-printer-selection2.js} +8225 -12189
  37. package/dist/components/ezp-printing.d.ts +11 -0
  38. package/dist/components/ezp-printing.js +271 -0
  39. package/dist/components/ezp-select.d.ts +11 -0
  40. package/dist/components/ezp-select.js +6 -0
  41. package/dist/components/ezp-select2.js +194 -0
  42. package/dist/components/ezp-status.d.ts +11 -0
  43. package/dist/components/ezp-status.js +6 -0
  44. package/dist/components/ezp-status2.js +94 -0
  45. package/dist/components/ezp-stepper.d.ts +11 -0
  46. package/dist/components/ezp-stepper.js +6 -0
  47. package/dist/components/ezp-stepper2.js +119 -0
  48. package/dist/components/ezp-text-button.d.ts +11 -0
  49. package/dist/components/ezp-text-button.js +6 -0
  50. package/dist/components/ezp-text-button2.js +73 -0
  51. package/dist/components/ezp-upload.d.ts +11 -0
  52. package/dist/components/ezp-upload.js +6 -0
  53. package/dist/components/ezp-upload2.js +95 -0
  54. package/dist/components/ezp-user-menu.d.ts +11 -0
  55. package/dist/components/ezp-user-menu.js +6 -0
  56. package/dist/components/ezp-user-menu2.js +159 -0
  57. package/dist/components/i18next.js +2653 -0
  58. package/dist/components/index.d.ts +26 -0
  59. package/dist/components/index.js +15 -0
  60. package/dist/directives/proxies.ts +2 -2
  61. package/dist/esm/ezeep.js +3 -3
  62. package/dist/esm/ezp-auth_14.entry.js +118 -67
  63. package/dist/esm/{index-265d8cca.js → index-485041ac.js} +23 -0
  64. package/dist/esm/loader.js +3 -3
  65. package/dist/esm/polyfills/css-shim.js +1 -1
  66. package/dist/esm-es5/ezeep.js +1 -1
  67. package/dist/esm-es5/ezp-auth_14.entry.js +3 -3
  68. package/dist/esm-es5/index-485041ac.js +1 -0
  69. package/dist/esm-es5/loader.js +1 -1
  70. package/dist/ezeep/ezeep.esm.js +1 -1
  71. package/dist/ezeep/ezeep.js +1 -1
  72. package/dist/ezeep/p-0b51d725.system.entry.js +21 -0
  73. package/dist/ezeep/{p-a7b7b386.entry.js → p-b6ec69dc.entry.js} +2 -2
  74. package/dist/ezeep/p-cc2bb341.system.js +1 -0
  75. package/dist/ezeep/p-d4dae139.system.js +1 -0
  76. package/dist/ezeep/{p-f3065800.js → p-fa808a39.js} +0 -0
  77. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +1 -1
  78. package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -0
  79. package/dist/types/components.d.ts +2 -0
  80. package/dist/types/stencil-public-runtime.d.ts +6 -4
  81. package/dist/types/utils/utils.d.ts +1 -1
  82. package/package.json +4 -4
  83. package/readme.md +6 -3
  84. package/www/build/ezeep.esm.js +1 -1
  85. package/www/build/ezeep.js +1 -1
  86. package/www/build/p-0b51d725.system.entry.js +21 -0
  87. package/www/build/{p-a7b7b386.entry.js → p-b6ec69dc.entry.js} +2 -2
  88. package/www/build/p-cc2bb341.system.js +1 -0
  89. package/www/build/p-d4dae139.system.js +1 -0
  90. package/www/build/{p-f3065800.js → p-fa808a39.js} +0 -0
  91. package/www/data/locales/en.json +6 -1
  92. package/www/index.html +1 -1
  93. package/dist/custom-elements/index.d.ts +0 -123
  94. package/dist/esm-es5/index-265d8cca.js +0 -1
  95. package/dist/ezeep/p-98ec6965.system.js +0 -1
  96. package/dist/ezeep/p-a1b0d17a.system.entry.js +0 -21
  97. package/dist/ezeep/p-f89804ee.system.js +0 -1
  98. package/www/build/p-98ec6965.system.js +0 -1
  99. package/www/build/p-a1b0d17a.system.entry.js +0 -21
  100. package/www/build/p-f89804ee.system.js +0 -1
@@ -0,0 +1,119 @@
1
+ import { HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './ezp-icon2.js';
3
+ import { d as defineCustomElement$1 } from './ezp-label2.js';
4
+
5
+ const ezpStepperCss = ":host{-ms-flex-align:center;align-items:center;background:var(--ezp-color-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-color-outline);box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-color-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:var(--ezp-stepper-gridTemplate, auto/auto 1fr auto);padding:0 var(--ezp-spacing-2) 0 var(--ezp-spacing-3);position:relative;z-index:0}:host(.focused){--ezp-stepper-icon-color:var(--ezp-color-theme-solid);--ezp-stepper-label-color:var(--ezp-color-theme-solid)}:host(.has-icon){--ezp-stepper-gridTemplate:auto / repeat(2, auto) 1fr auto}#toggle{background:var(--ezp-stepper-toggle-background, transparent);border-radius:3px;cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}@media (hover: hover){#toggle:hover{--ezp-stepper-toggle-background:var(--ezp-color-shade-primary)}}#icon{color:var(--ezp-stepper-icon-color, var(--ezp-color-foreground-secondary));pointer-events:none}#label{color:var(--ezp-stepper-label-color, var(--ezp-color-foreground-secondary));pointer-events:none}#input{-moz-appearance:textfield;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-color-foreground-primary);cursor:inherit;font-family:inherit;-webkit-font-feature-settings:\"tnum\";font-feature-settings:\"tnum\";font-size:14px;-webkit-font-smoothing:antialiased;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0;pointer-events:none;text-align:right;width:100%}#input::-webkit-outer-spin-button,#input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.buttons{display:-ms-flexbox;display:flex}.button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-stepper-button-background, transparent);border:0;border-radius:50%;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-stepper-button-color, var(--ezp-color-theme-solid));cursor:var(--ezp-stepper-button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-1)}@media (hover: hover){.button:not(:disabled):hover{--ezp-stepper-button-background:var(--ezp-color-shade-primary)}.button:not(:disabled):active{--ezp-stepper-button-background:var(--ezp-color-shade-secondary)}}.button:disabled{--ezp-stepper-button-color:var(--ezp-color-foreground-tertiary);--ezp-stepper-button-cursor:default}";
6
+
7
+ let EzpStepper = class extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.__attachShadow();
12
+ this.stepperChanged = createEvent(this, "stepperChanged", 7);
13
+ /** Description... */
14
+ this.label = 'Label';
15
+ /** Description... */
16
+ this.min = 1;
17
+ /**
18
+ *
19
+ * States
20
+ *
21
+ */
22
+ /** Description... */
23
+ this.canDecrease = true;
24
+ /** Description... */
25
+ this.canIncrease = true;
26
+ /** Description... */
27
+ this.focused = false;
28
+ /** Description... */
29
+ this.value = 1;
30
+ /**
31
+ *
32
+ * Private methods
33
+ *
34
+ */
35
+ this.handleDecrease = () => {
36
+ this.value--;
37
+ };
38
+ this.handleIncrease = () => {
39
+ this.value++;
40
+ };
41
+ this.handleInput = () => {
42
+ this.value = this.input.value !== '' ? parseInt(this.input.value) : this.min;
43
+ };
44
+ this.setFocus = () => {
45
+ this.input.focus();
46
+ };
47
+ this.handleBlur = () => {
48
+ this.focused = false;
49
+ };
50
+ this.handleFocus = () => {
51
+ this.focused = true;
52
+ };
53
+ }
54
+ /**
55
+ *
56
+ * Watchers
57
+ *
58
+ */
59
+ watchValue() {
60
+ this.canIncrease = this.max !== undefined ? this.value < this.max : true;
61
+ this.canDecrease = this.min !== undefined ? this.value > this.min : true;
62
+ this.stepperChanged.emit(this.value);
63
+ }
64
+ /**
65
+ *
66
+ * Lifecycle methods
67
+ *
68
+ */
69
+ componentWillLoad() {
70
+ this.watchValue();
71
+ }
72
+ /**
73
+ *
74
+ * Render method
75
+ *
76
+ */
77
+ render() {
78
+ return (h(Host, { class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, text: this.label }), h("input", { id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max.toString(), value: this.value.toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur }), h("div", { class: "buttons" }, h("button", { class: "button", disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { name: "minus" })), h("button", { class: "button", disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { name: "plus" })))));
79
+ }
80
+ static get watchers() { return {
81
+ "value": ["watchValue"]
82
+ }; }
83
+ static get style() { return ezpStepperCss; }
84
+ };
85
+ EzpStepper = /*@__PURE__*/ proxyCustomElement(EzpStepper, [1, "ezp-stepper", {
86
+ "icon": [1],
87
+ "label": [1],
88
+ "max": [2],
89
+ "min": [2],
90
+ "canDecrease": [32],
91
+ "canIncrease": [32],
92
+ "focused": [32],
93
+ "value": [32]
94
+ }]);
95
+ function defineCustomElement() {
96
+ if (typeof customElements === "undefined") {
97
+ return;
98
+ }
99
+ const components = ["ezp-stepper", "ezp-icon", "ezp-label"];
100
+ components.forEach(tagName => { switch (tagName) {
101
+ case "ezp-stepper":
102
+ if (!customElements.get(tagName)) {
103
+ customElements.define(tagName, EzpStepper);
104
+ }
105
+ break;
106
+ case "ezp-icon":
107
+ if (!customElements.get(tagName)) {
108
+ defineCustomElement$2();
109
+ }
110
+ break;
111
+ case "ezp-label":
112
+ if (!customElements.get(tagName)) {
113
+ defineCustomElement$1();
114
+ }
115
+ break;
116
+ } });
117
+ }
118
+
119
+ export { EzpStepper as E, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface EzpTextButton extends Components.EzpTextButton, HTMLElement {}
4
+ export const EzpTextButton: {
5
+ prototype: EzpTextButton;
6
+ new (): EzpTextButton;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { E as EzpTextButton$1, d as defineCustomElement$1 } from './ezp-text-button2.js';
2
+
3
+ const EzpTextButton = EzpTextButton$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { EzpTextButton, defineCustomElement };
@@ -0,0 +1,73 @@
1
+ import { HTMLElement, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$1 } from './ezp-label2.js';
3
+
4
+ const ezpTextButtonCss = ":host{display:-ms-flexbox;display:flex}:host(.primary){--ezp-textButton-background-disabled:var(--ezp-color-shade-primary);--ezp-textButton-background-init:var(--ezp-color-theme-solid);--ezp-textButton-color-disabled:var(--ezp-color-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-color-on-theme);--ezp-textButton-opacity-active:0.74;--ezp-textButton-opacity-hover:0.84}:host(.secondary){--ezp-textButton-background-active:var(--ezp-color-shade-tertiary);--ezp-textButton-background-disabled:var(--ezp-color-shade-primary);--ezp-textButton-background-hover:var(--ezp-color-shade-secondary);--ezp-textButton-background-init:var(--ezp-color-shade-primary);--ezp-textButton-color-disabled:var(--ezp-color-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-color-theme-solid)}:host(.tertiary){--ezp-textButton-background-active:var(--ezp-color-shade-secondary);--ezp-textButton-background-disabled:transparent;--ezp-textButton-background-hover:var(--ezp-color-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-color-disabled:var(--ezp-color-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-color-theme-solid)}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-textButton-background, var(--ezp-textButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-textButton-color, var(--ezp-textButton-color-init));cursor:var(--ezp-textButton-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-textButton-opacity, 1);outline:none;padding:var(--ezp-spacing-3);white-space:nowrap;width:100%}@media (hover: hover){#button:not(:disabled):hover{--ezp-textButton-background:var(\n --ezp-textButton-background-hover,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-textButton-background:var(\n --ezp-textButton-background-active,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-active, 1)}}#button:disabled{--ezp-textButton-background:var(--ezp-textButton-background-disabled);--ezp-textButton-color:var(--ezp-textButton-color-disabled);--ezp-textButton-cursor:default}#label{pointer-events:none}";
5
+
6
+ let EzpTextButton = class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
11
+ /**
12
+ *
13
+ * Properties
14
+ *
15
+ */
16
+ /** Description... */
17
+ this.blank = false;
18
+ /** Description... */
19
+ this.disabled = false;
20
+ /** Description... */
21
+ this.level = 'primary';
22
+ /** Description... */
23
+ this.small = false;
24
+ }
25
+ /**
26
+ *
27
+ * Render method
28
+ *
29
+ */
30
+ render() {
31
+ const TagType = this.type !== undefined ? 'button' : 'a';
32
+ const attributes = this.type !== undefined
33
+ ? {
34
+ type: this.type,
35
+ disabled: this.disabled,
36
+ }
37
+ : {
38
+ href: this.href,
39
+ target: this.blank ? '_blank' : '_self',
40
+ };
41
+ return (h(Host, { class: `${this.level}` }, h(TagType, Object.assign({ id: "button" }, attributes), h("ezp-label", { id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
42
+ }
43
+ static get style() { return ezpTextButtonCss; }
44
+ };
45
+ EzpTextButton = /*@__PURE__*/ proxyCustomElement(EzpTextButton, [1, "ezp-text-button", {
46
+ "blank": [4],
47
+ "disabled": [4],
48
+ "href": [1],
49
+ "level": [1],
50
+ "label": [1],
51
+ "type": [1],
52
+ "small": [4]
53
+ }]);
54
+ function defineCustomElement() {
55
+ if (typeof customElements === "undefined") {
56
+ return;
57
+ }
58
+ const components = ["ezp-text-button", "ezp-label"];
59
+ components.forEach(tagName => { switch (tagName) {
60
+ case "ezp-text-button":
61
+ if (!customElements.get(tagName)) {
62
+ customElements.define(tagName, EzpTextButton);
63
+ }
64
+ break;
65
+ case "ezp-label":
66
+ if (!customElements.get(tagName)) {
67
+ defineCustomElement$1();
68
+ }
69
+ break;
70
+ } });
71
+ }
72
+
73
+ export { EzpTextButton as E, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface EzpUpload extends Components.EzpUpload, HTMLElement {}
4
+ export const EzpUpload: {
5
+ prototype: EzpUpload;
6
+ new (): EzpUpload;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { E as EzpUpload$1, d as defineCustomElement$1 } from './ezp-upload2.js';
2
+
3
+ const EzpUpload = EzpUpload$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { EzpUpload, defineCustomElement };
@@ -0,0 +1,95 @@
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$2 } from './ezp-icon2.js';
4
+ import { d as defineCustomElement$1 } from './ezp-label2.js';
5
+
6
+ const ezpUploadCss = ":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-upload-background, transparent);border:1px dashed var(--ezp-upload-border-color, var(--ezp-color-foreground-tertiary));border-radius:3px;color:var(--ezp-color-foreground-primary);display:grid;grid-template:auto/minmax(auto, 280px);height:var(--ezp-upload-height, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);position:relative;-webkit-transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);width:var(--ezp-upload-width, auto)}:host(.dragging){--ezp-upload-background:var(--ezp-color-theme-translucent);--ezp-upload-border-color:var(--ezp-color-theme-translucent);--ezp-upload-header-blur:16px;--ezp-upload-header-opacity:0.42}#header{--ezp-icon-fill:var(--ezp-color-theme-solid);-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-webkit-filter:blur(var(--ezp-upload-header-blur, 0));filter:blur(var(--ezp-upload-header-blur, 0));-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);opacity:var(--ezp-upload-header-opacity, 1);text-align:center;-webkit-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart)}#meta{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--ezp-spacing-3) 3px;-ms-flex-pack:center;justify-content:center}#select{color:var(--ezp-color-theme-solid);cursor:pointer;opacity:var(--ezp-upload-select-opacity, 1);text-decoration:underline;white-space:nowrap}@media (hover: hover){#select:hover{--ezp-upload-select-opacity:0.58}}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}";
7
+
8
+ let EzpUpload = class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.uploadFile = createEvent(this, "uploadFile", 7);
14
+ /**
15
+ *
16
+ * States
17
+ *
18
+ */
19
+ this.dragging = false;
20
+ /**
21
+ *
22
+ * Private methods
23
+ *
24
+ */
25
+ this.handleInput = () => {
26
+ this.uploadFile.emit(this.input.files);
27
+ };
28
+ }
29
+ /**
30
+ *
31
+ * Listeners
32
+ *
33
+ */
34
+ handleDragEnter() {
35
+ this.dragging = true;
36
+ }
37
+ handleDragOver(event) {
38
+ event.stopPropagation();
39
+ event.preventDefault();
40
+ event.dataTransfer.dropEffect = 'copy';
41
+ }
42
+ handleDragLeave() {
43
+ this.dragging = false;
44
+ }
45
+ handleDrop(event) {
46
+ event.stopPropagation();
47
+ event.preventDefault();
48
+ this.dragging = false;
49
+ this.uploadFile.emit(event.dataTransfer.files);
50
+ }
51
+ /**
52
+ *
53
+ * Lifecycle methods
54
+ *
55
+ */
56
+ componentWillLoad() {
57
+ }
58
+ /**
59
+ *
60
+ * Render method
61
+ *
62
+ */
63
+ render() {
64
+ return (h(Host, { class: { dragging: this.dragging } }, h("div", { id: "box" }, 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') }))))));
65
+ }
66
+ static get style() { return ezpUploadCss; }
67
+ };
68
+ EzpUpload = /*@__PURE__*/ proxyCustomElement(EzpUpload, [1, "ezp-upload", {
69
+ "dragging": [32]
70
+ }, [[1, "dragenter", "handleDragEnter"], [0, "dragover", "handleDragOver"], [1, "dragleave", "handleDragLeave"], [0, "drop", "handleDrop"]]]);
71
+ function defineCustomElement() {
72
+ if (typeof customElements === "undefined") {
73
+ return;
74
+ }
75
+ const components = ["ezp-upload", "ezp-icon", "ezp-label"];
76
+ components.forEach(tagName => { switch (tagName) {
77
+ case "ezp-upload":
78
+ if (!customElements.get(tagName)) {
79
+ customElements.define(tagName, EzpUpload);
80
+ }
81
+ break;
82
+ case "ezp-icon":
83
+ if (!customElements.get(tagName)) {
84
+ defineCustomElement$2();
85
+ }
86
+ break;
87
+ case "ezp-label":
88
+ if (!customElements.get(tagName)) {
89
+ defineCustomElement$1();
90
+ }
91
+ break;
92
+ } });
93
+ }
94
+
95
+ export { EzpUpload as E, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface EzpUserMenu extends Components.EzpUserMenu, HTMLElement {}
4
+ export const EzpUserMenu: {
5
+ prototype: EzpUserMenu;
6
+ new (): EzpUserMenu;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { a as EzpUserMenu$1, d as defineCustomElement$1 } from './ezp-user-menu2.js';
2
+
3
+ const EzpUserMenu = EzpUserMenu$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { EzpUserMenu, defineCustomElement };
@@ -0,0 +1,159 @@
1
+ import { HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
2
+ import { c as createStore, a as authStore } from './auth.js';
3
+ import { i as i18next } from './i18next.js';
4
+ import { d as defineCustomElement$4 } from './ezp-backdrop2.js';
5
+ import { d as defineCustomElement$3 } from './ezp-icon2.js';
6
+ import { d as defineCustomElement$2 } from './ezp-icon-button2.js';
7
+ import { d as defineCustomElement$1 } from './ezp-label2.js';
8
+
9
+ class EzpUserService {
10
+ getUserInfo() {
11
+ return fetch(`https://${authStore.state.authApiHostUrl}/v1/users/me`, {
12
+ headers: {
13
+ Authorization: 'Bearer ' + authStore.state.accessToken,
14
+ 'Content-Type': 'application/json',
15
+ },
16
+ method: 'GET',
17
+ }).then((response) => {
18
+ return response.json();
19
+ });
20
+ }
21
+ }
22
+ const userStore = createStore({
23
+ user: null,
24
+ theme: '',
25
+ appearance: '',
26
+ });
27
+
28
+ const ezpUserMenuCss = ":host{background:var(--ezp-color-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-userMenu-boxShadowPosition, 0 0 0 1px) var(--ezp-color-outline);box-shadow:var(--ezp-userMenu-boxShadowPosition, 0 0 0 1px) var(--ezp-color-outline);display:block;opacity:var(--ezp-userMenu-opacity, 0);position:absolute;right:0;top:0;-webkit-transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));-webkit-transform-origin:right top;transform-origin:right top;-webkit-transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));visibility:var(--ezp-userMenu-visibility, hidden);z-index:5}:host(.is-open){--ezp-userMenu-opacity:1;--ezp-userMenu-scale:1, 1;--ezp-userMenu-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart),\n transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-userMenu-visibility:visible}@media (prefers-color-scheme: dark){:host{--ezp-userMenu-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#header{-ms-flex-align:center;align-items:center;-webkit-box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);-webkit-box-shadow:0;box-shadow:0;display:grid;grid-template:auto/1fr auto;padding:var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4)}#name{color:var(--ezp-color-foreground-primary)}#close{margin:calc(var(--ezp-spacing-3) * -1) 0}#links{-webkit-box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--ezp-spacing-2)}.link{-ms-flex-align:center;align-items:center;background:var(--ezp-userMenu-link-background, transparent);border-radius:3px;color:var(--ezp-color-foreground-primary);cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;padding:var(--ezp-spacing-3);text-decoration:none}.link:hover{--ezp-userMenu-link-background:var(--ezp-color-shade-primary)}.link__icon{color:var(--ezp-color-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0}.caption{color:var(--ezp-color-foreground-primary)}#theme{-webkit-box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#swatches{display:-ms-flexbox;display:flex;margin:0 calc(var(--ezp-spacing-2) * -1)}.swatch{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-swatch-background, transparent);border:0;border-radius:50%;color:var(--ezp-userMenu-swatch-color);cursor:var(--ezp-userMenu-swatch-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-userMenu-swatch-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){.swatch:not(.selected):hover{--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent)}.swatch:not(.selected):active{--ezp-userMenu-swatch-opacity:0.74}}.swatch.selected{--ezp-userMenu-dot-boxShadowSize:10px;--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent);--ezp-userMenu-swatch-cursor:normal}.swatch.selected>.dot{-webkit-animation:dot-bounce var(--ezp-duration-2) ease-in-out;animation:dot-bounce var(--ezp-duration-2) ease-in-out}.swatch--blue{--ezp-userMenu-swatch-theme-solid:var(--ezp-color-blue-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-color-blue-translucent)}.swatch--cyan{--ezp-userMenu-swatch-theme-solid:var(--ezp-color-cyan-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-color-cyan-translucent)}.swatch--green{--ezp-userMenu-swatch-theme-solid:var(--ezp-color-green-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-color-green-translucent)}.swatch--orange{--ezp-userMenu-swatch-theme-solid:var(--ezp-color-orange-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-color-orange-translucent)}.swatch--pink{--ezp-userMenu-swatch-theme-solid:var(--ezp-color-pink-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-color-pink-translucent)}.swatch--red{--ezp-userMenu-swatch-theme-solid:var(--ezp-color-red-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-color-red-translucent)}.swatch--violet{--ezp-userMenu-swatch-theme-solid:var(--ezp-color-violet-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-color-violet-translucent)}.dot{background:var(--ezp-userMenu-dot-background, transparent);border-radius:50%;-webkit-box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);height:18px;-webkit-transition:-webkit-box-shadow var(--ezp-duration-2);transition:-webkit-box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2), -webkit-box-shadow var(--ezp-duration-2);width:18px}#appearance{display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#tabs{display:grid;grid-template:auto/repeat(3, 1fr);margin:0 calc(var(--ezp-spacing-2) * -1)}.tab{--ezp-icon-height:8px;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-tab-background, transparent);border:0;border-radius:14px;color:var(--ezp-userMenu-tab-color, var(--ezp-color-foreground-secondary));cursor:var(--ezp-userMenu-tab-cursor, pointer);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-2)}@media (hover: hover){.tab:not(.selected):hover{--ezp-userMenu-tab-background:var(--ezp-color-shade-primary)}.tab:not(.selected):active{--ezp-userMenu-tab-background:var(--ezp-color-shade-secondary)}}.tab.selected{--ezp-userMenu-tab-background:var(--ezp-color-theme-translucent);--ezp-userMenu-tab-color:var(--ezp-color-theme-solid);--ezp-userMenu-tab-cursor:normal}@-webkit-keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}@keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}";
29
+
30
+ let EzpUserMenu = class extends HTMLElement {
31
+ constructor() {
32
+ super();
33
+ this.__registerHost();
34
+ this.__attachShadow();
35
+ this.userMenuClosure = createEvent(this, "userMenuClosure", 7);
36
+ this.logoutEmitter = createEvent(this, "logoutEmitter", 7);
37
+ this.backdrop = document.createElement('ezp-backdrop');
38
+ this.links = [
39
+ {
40
+ title: i18next.t('user_menu.account'),
41
+ icon: 'account',
42
+ href: 'https://app.ezeep.com',
43
+ },
44
+ {
45
+ title: i18next.t('user_menu.help'),
46
+ icon: 'help',
47
+ href: 'https://support.ezeep.com',
48
+ },
49
+ ];
50
+ this.themes = ['pink', 'red', 'orange', 'green', 'cyan', 'blue', 'violet'];
51
+ this.appearances = [
52
+ { title: i18next.t('user_menu.system'), name: 'system' },
53
+ { title: i18next.t('user_menu.light'), name: 'light' },
54
+ { title: i18next.t('user_menu.dark'), name: 'dark' },
55
+ ];
56
+ this.name = 'John Doe';
57
+ this.open = false;
58
+ this.handleClose = () => {
59
+ this.userMenuClosure.emit();
60
+ };
61
+ this.logOut = () => {
62
+ localStorage.clear();
63
+ authStore.state.isAuthorized = false;
64
+ this.logoutEmitter.emit();
65
+ };
66
+ this.handleTheme = (theme) => {
67
+ userStore.state.theme = theme;
68
+ };
69
+ this.handleAppearance = (appearance) => {
70
+ userStore.state.appearance = appearance;
71
+ };
72
+ }
73
+ /**
74
+ *
75
+ * Privatre methods
76
+ *
77
+ */
78
+ /**
79
+ *
80
+ * Watchers
81
+ *
82
+ */
83
+ watchOpen() {
84
+ if (this.open) {
85
+ this.backdrop.visible = true;
86
+ this.container.appendChild(this.backdrop);
87
+ }
88
+ else {
89
+ this.backdrop.visible = false;
90
+ this.userMenuClosure.emit();
91
+ }
92
+ }
93
+ /**
94
+ *
95
+ * Render method
96
+ *
97
+ */
98
+ componentWillLoad() {
99
+ this.container = this.component.closest('[data-backdrop-surface]');
100
+ this.backdrop.addEventListener('backdropHideStart', () => {
101
+ this.open = false;
102
+ });
103
+ this.backdrop.addEventListener('backdropHideEnd', () => {
104
+ this.container.removeChild(this.backdrop);
105
+ });
106
+ }
107
+ /**
108
+ *
109
+ * Render method
110
+ *
111
+ */
112
+ render() {
113
+ return (h(Host, { class: this.open ? 'is-open' : '' }, h("div", { id: "header" }, h("ezp-label", { ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { id: "links" }, this.links.map((link) => (h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, h("ezp-icon", { class: "link__icon", name: link.icon }), h("ezp-label", { text: link.title })))), h("a", { class: "link", onClick: this.logOut }, h("ezp-icon", { class: "link__icon", name: "logout" }), h("ezp-label", { text: i18next.t('user_menu.logout') }))), h("div", { id: "theme" }, h("ezp-label", { class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, h("span", { class: "dot" })))))), h("div", { id: "appearance" }, h("ezp-label", { class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, h("ezp-icon", { name: appearance.name }), h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
114
+ }
115
+ get component() { return this; }
116
+ static get watchers() { return {
117
+ "open": ["watchOpen"]
118
+ }; }
119
+ static get style() { return ezpUserMenuCss; }
120
+ };
121
+ EzpUserMenu = /*@__PURE__*/ proxyCustomElement(EzpUserMenu, [1, "ezp-user-menu", {
122
+ "name": [1],
123
+ "open": [1028]
124
+ }]);
125
+ function defineCustomElement() {
126
+ if (typeof customElements === "undefined") {
127
+ return;
128
+ }
129
+ const components = ["ezp-user-menu", "ezp-backdrop", "ezp-icon", "ezp-icon-button", "ezp-label"];
130
+ components.forEach(tagName => { switch (tagName) {
131
+ case "ezp-user-menu":
132
+ if (!customElements.get(tagName)) {
133
+ customElements.define(tagName, EzpUserMenu);
134
+ }
135
+ break;
136
+ case "ezp-backdrop":
137
+ if (!customElements.get(tagName)) {
138
+ defineCustomElement$4();
139
+ }
140
+ break;
141
+ case "ezp-icon":
142
+ if (!customElements.get(tagName)) {
143
+ defineCustomElement$3();
144
+ }
145
+ break;
146
+ case "ezp-icon-button":
147
+ if (!customElements.get(tagName)) {
148
+ defineCustomElement$2();
149
+ }
150
+ break;
151
+ case "ezp-label":
152
+ if (!customElements.get(tagName)) {
153
+ defineCustomElement$1();
154
+ }
155
+ break;
156
+ } });
157
+ }
158
+
159
+ export { EzpUserService as E, EzpUserMenu as a, defineCustomElement as d, userStore as u };