@zanichelli/delta_share 2.0.2 → 2.0.3
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/wc/cjs/license-activation_16.cjs.entry.js +65 -22
- package/dist/wc/collection/beans/index.js +6 -0
- package/dist/wc/collection/components/license-activation/license-activation.js +22 -11
- package/dist/wc/collection/components/license-activation-form/license-activation-form.js +32 -17
- package/dist/wc/custom-elements/index.js +65 -22
- package/dist/wc/delta_share/delta_share.esm.js +1 -1
- package/dist/wc/delta_share/p-6422287d.entry.js +3 -0
- package/dist/wc/esm/license-activation_16.entry.js +65 -22
- package/dist/wc/types/beans/index.d.ts +6 -0
- package/dist/wc/types/components/license-activation/license-activation.d.ts +4 -4
- package/dist/wc/types/components/license-activation-form/license-activation-form.d.ts +7 -7
- package/dist/wc/types/components.d.ts +5 -5
- package/package.json +1 -1
- package/dist/wc/delta_share/p-4f8b368d.entry.js +0 -3
|
@@ -9,6 +9,35 @@ const index$2 = require('./index-1fda0714.js');
|
|
|
9
9
|
const icons = require('./icons-f65fa82e.js');
|
|
10
10
|
const utils = require('./utils-1f907efa.js');
|
|
11
11
|
|
|
12
|
+
var DeviceEnum;
|
|
13
|
+
(function (DeviceEnum) {
|
|
14
|
+
DeviceEnum["mobile"] = "mobile";
|
|
15
|
+
DeviceEnum["tablet"] = "tablet";
|
|
16
|
+
DeviceEnum["desktop"] = "desktop";
|
|
17
|
+
DeviceEnum["desktopNew"] = "desktopNew";
|
|
18
|
+
})(DeviceEnum || (DeviceEnum = {}));
|
|
19
|
+
var LicenseActivationVariantEnum;
|
|
20
|
+
(function (LicenseActivationVariantEnum) {
|
|
21
|
+
LicenseActivationVariantEnum["box"] = "box";
|
|
22
|
+
LicenseActivationVariantEnum["modal"] = "modal";
|
|
23
|
+
LicenseActivationVariantEnum["preview"] = "preview";
|
|
24
|
+
})(LicenseActivationVariantEnum || (LicenseActivationVariantEnum = {}));
|
|
25
|
+
var LicenseActivationStateEnum;
|
|
26
|
+
(function (LicenseActivationStateEnum) {
|
|
27
|
+
LicenseActivationStateEnum["INITIAL"] = "INITIAL";
|
|
28
|
+
LicenseActivationStateEnum["ACTIVATING"] = "ACTIVATING";
|
|
29
|
+
LicenseActivationStateEnum["ACTIVATED"] = "ACTIVATED";
|
|
30
|
+
LicenseActivationStateEnum["SUCCESS"] = "SUCCESS";
|
|
31
|
+
})(LicenseActivationStateEnum || (LicenseActivationStateEnum = {}));
|
|
32
|
+
var LicenseActivationActionEnum;
|
|
33
|
+
(function (LicenseActivationActionEnum) {
|
|
34
|
+
LicenseActivationActionEnum["REQUEST"] = "app/LICENSE_ACTIVATION/REQUEST";
|
|
35
|
+
LicenseActivationActionEnum["ACTIVATED"] = "app/LICENSE_ACTIVATION/ACTIVATED";
|
|
36
|
+
LicenseActivationActionEnum["SUCCESS"] = "app/LICENSE_ACTIVATION/SUCCESS";
|
|
37
|
+
LicenseActivationActionEnum["FAIL"] = "app/LICENSE_ACTIVATION/FAIL";
|
|
38
|
+
LicenseActivationActionEnum["RESET"] = "app/LICENSE_ACTIVATION/RESET";
|
|
39
|
+
})(LicenseActivationActionEnum || (LicenseActivationActionEnum = {}));
|
|
40
|
+
|
|
12
41
|
const appendToMap = (map, propName, value) => {
|
|
13
42
|
const items = map.get(propName);
|
|
14
43
|
if (!items) {
|
|
@@ -1729,7 +1758,8 @@ const LicenseActivation = class {
|
|
|
1729
1758
|
async componentWillLoad() {
|
|
1730
1759
|
await getCms(state);
|
|
1731
1760
|
this.cms = state.cms;
|
|
1732
|
-
this.modalState =
|
|
1761
|
+
this.modalState =
|
|
1762
|
+
this.variant === LicenseActivationVariantEnum.modal ? "open" : "closed";
|
|
1733
1763
|
this.isMobile =
|
|
1734
1764
|
window.screen.width <= mobileBreakpoint ||
|
|
1735
1765
|
window.innerWidth <= mobileBreakpoint;
|
|
@@ -1812,7 +1842,7 @@ const LicenseActivation = class {
|
|
|
1812
1842
|
if (!inputVal) {
|
|
1813
1843
|
this.handleLicenseModalOpen(false);
|
|
1814
1844
|
}
|
|
1815
|
-
if ((this.variant ===
|
|
1845
|
+
if ((this.variant === LicenseActivationVariantEnum.modal ||
|
|
1816
1846
|
this.modalState === "open" ||
|
|
1817
1847
|
licenseActivationStatus === "initial") &&
|
|
1818
1848
|
inputVal) {
|
|
@@ -1835,7 +1865,7 @@ const LicenseActivation = class {
|
|
|
1835
1865
|
return (index.h("license-activation-box", { error: this.licenseActivationState.licenseActivationApiError, code: this.licenseActivationState.licenseActivationCode }, this.renderLicenseActivationForm(variant)));
|
|
1836
1866
|
}
|
|
1837
1867
|
renderLicenseActivationModal() {
|
|
1838
|
-
return (index.h("license-activation-modal", { id: `${this.host.id}-modal`, "modal-title": this.cms["newdashboard.licenseActivation.modalTitle"], onActivationModalClose: () => this.handleLicenseModalClose(), resetStore: this.resetStore }, this.renderLicenseActivationForm(
|
|
1868
|
+
return (index.h("license-activation-modal", { id: `${this.host.id}-modal`, "modal-title": this.cms["newdashboard.licenseActivation.modalTitle"], onActivationModalClose: () => this.handleLicenseModalClose(), resetStore: this.resetStore }, this.renderLicenseActivationForm(LicenseActivationVariantEnum.modal)));
|
|
1839
1869
|
}
|
|
1840
1870
|
retrieveTextsObject() {
|
|
1841
1871
|
const { inputMessage, inputLabel, inputPlaceholder, buttonLabel, isMobile, additionalDescription, buttonIcon, previewInputPlaceholder, previewButtonLabel, previewButtonIcon, previewButtonSize, } = this;
|
|
@@ -1861,7 +1891,8 @@ const LicenseActivation = class {
|
|
|
1861
1891
|
infoBoxIcon: `${this.environment.URL_S3_IMAGES_FOLDER}bollinoSIAE.svg`,
|
|
1862
1892
|
infoBoxContent: this.cms["newdashboard.licenseActivation.infoBoxContent"],
|
|
1863
1893
|
supportLink: this.cms["newdashboard.licenseActivation.contactUs.url"],
|
|
1864
|
-
additionalDescription: this.variant ===
|
|
1894
|
+
additionalDescription: this.variant === LicenseActivationVariantEnum.modal &&
|
|
1895
|
+
additionalDescription,
|
|
1865
1896
|
};
|
|
1866
1897
|
}
|
|
1867
1898
|
renderLicenseActivationForm(variant) {
|
|
@@ -1874,16 +1905,19 @@ const LicenseActivation = class {
|
|
|
1874
1905
|
return (index.h("z-button", { onClick: () => this.handleMobileButtonClick() }, this.cms["newdashboard.onboarding.licenseActivation.mobileSubmitLabel"]));
|
|
1875
1906
|
}
|
|
1876
1907
|
render() {
|
|
1877
|
-
if (this.isMobile &&
|
|
1908
|
+
if (this.isMobile &&
|
|
1909
|
+
this.variant !== LicenseActivationVariantEnum.preview) {
|
|
1878
1910
|
return (index.h(index.Host, null, this.forceModal
|
|
1879
1911
|
? this.renderLicenseActivationModal()
|
|
1880
|
-
: this.renderMobileButton(), this.variant ===
|
|
1912
|
+
: this.renderMobileButton(), this.variant === LicenseActivationVariantEnum.box &&
|
|
1881
1913
|
this.modalState === "open" &&
|
|
1882
1914
|
this.renderLicenseActivationModal()));
|
|
1883
1915
|
}
|
|
1884
|
-
return (index.h(index.Host, null, this.variant ===
|
|
1916
|
+
return (index.h(index.Host, null, this.variant === LicenseActivationVariantEnum.box ||
|
|
1917
|
+
this.variant === LicenseActivationVariantEnum.preview
|
|
1885
1918
|
? this.renderLicenseActivationBox(this.variant)
|
|
1886
|
-
: this.modalState === "open" && this.renderLicenseActivationModal(), (this.variant ===
|
|
1919
|
+
: this.modalState === "open" && this.renderLicenseActivationModal(), (this.variant === LicenseActivationVariantEnum.box ||
|
|
1920
|
+
this.variant === LicenseActivationVariantEnum.preview) &&
|
|
1887
1921
|
this.modalState === "open" &&
|
|
1888
1922
|
this.submitClicked &&
|
|
1889
1923
|
this.renderLicenseActivationModal()));
|
|
@@ -1941,26 +1975,33 @@ const LicenseActivationForm = class {
|
|
|
1941
1975
|
this.submitButtonClick.emit({ value: inputVal });
|
|
1942
1976
|
}
|
|
1943
1977
|
handleInfoClick() {
|
|
1944
|
-
if (this.variant ===
|
|
1978
|
+
if (this.variant === LicenseActivationVariantEnum.modal) {
|
|
1945
1979
|
this.showInfoBox = true;
|
|
1946
1980
|
}
|
|
1947
|
-
if (this.variant ===
|
|
1981
|
+
if (this.variant === LicenseActivationVariantEnum.box ||
|
|
1982
|
+
this.variant === LicenseActivationVariantEnum.preview) {
|
|
1948
1983
|
this.handleModalOpen();
|
|
1949
1984
|
}
|
|
1950
1985
|
}
|
|
1951
1986
|
renderInput() {
|
|
1952
1987
|
const { inputMessage, inputLabel, placeholder, inputStatus, previewInputPlaceholder, } = this.formTexts;
|
|
1953
|
-
if (this.variant ===
|
|
1988
|
+
if (this.variant === LicenseActivationVariantEnum.preview &&
|
|
1989
|
+
!previewInputPlaceholder)
|
|
1954
1990
|
return;
|
|
1955
|
-
const message = this.variant ===
|
|
1991
|
+
const message = this.variant === LicenseActivationVariantEnum.box
|
|
1956
1992
|
? inputMessage
|
|
1957
1993
|
: this.error
|
|
1958
1994
|
? this.error
|
|
1959
1995
|
: inputMessage;
|
|
1960
|
-
return (index.h("z-input", { value: this.inputVal, htmlid: `${this.formid}_input`, label: this.variant ===
|
|
1996
|
+
return (index.h("z-input", { value: this.inputVal, htmlid: `${this.formid}_input`, label: this.variant === LicenseActivationVariantEnum.preview
|
|
1997
|
+
? ""
|
|
1998
|
+
: inputLabel, placeholder: this.variant === LicenseActivationVariantEnum.preview
|
|
1999
|
+
? previewInputPlaceholder
|
|
2000
|
+
: placeholder, htmltitle: placeholder, message: this.variant === LicenseActivationVariantEnum.preview ? "" : message, hasmessage: this.variant !== LicenseActivationVariantEnum.preview, status: this.variant === LicenseActivationVariantEnum.box ? null : inputStatus, disabled: !!this.requestLoading, onInputChange: (e) => this.handleFormInputChange(e.detail) }));
|
|
1961
2001
|
}
|
|
1962
2002
|
renderButton() {
|
|
1963
|
-
const disabled = (this.variant ===
|
|
2003
|
+
const disabled = (this.variant === LicenseActivationVariantEnum.modal && !this.inputVal) ||
|
|
2004
|
+
!!this.requestLoading;
|
|
1964
2005
|
return (index.h("z-button", { variant: index$1.ButtonVariantEnum.primary, size: this.getButtonSize(this.variant), square: this.getButtonSquare(this.variant), disabled: disabled || !this.enableButton || this.requestLoading, onClick: () => this.handleSubmitButtonClick(this.inputVal) }, this.renderButtonValue(this.variant, disabled)));
|
|
1965
2006
|
}
|
|
1966
2007
|
renderButtonValue(variant, disabled = false) {
|
|
@@ -1976,7 +2017,7 @@ const LicenseActivationForm = class {
|
|
|
1976
2017
|
}
|
|
1977
2018
|
renderInfoLink() {
|
|
1978
2019
|
const { linkLabel } = this.formTexts;
|
|
1979
|
-
if (this.variant ===
|
|
2020
|
+
if (this.variant === LicenseActivationVariantEnum.preview)
|
|
1980
2021
|
return;
|
|
1981
2022
|
return (index.h("z-link", { icon: "question-mark", onClick: () => this.handleInfoClick() }, linkLabel));
|
|
1982
2023
|
}
|
|
@@ -1999,36 +2040,38 @@ const LicenseActivationForm = class {
|
|
|
1999
2040
|
window.location.href = formTexts.supportLink;
|
|
2000
2041
|
}
|
|
2001
2042
|
renderErrorSection() {
|
|
2002
|
-
if (this.variant !==
|
|
2043
|
+
if (this.variant !== LicenseActivationVariantEnum.modal || !this.error)
|
|
2003
2044
|
return;
|
|
2004
2045
|
const { errorButtonLabel, errorSectionMessage } = this.formTexts;
|
|
2005
2046
|
return (index.h("section", { class: "error-section" }, index.h("span", { class: "heading-01" }, errorSectionMessage), index.h("z-button", { variant: index$1.ButtonVariantEnum.secondary, onClick: this.redirectToSupport }, errorButtonLabel)));
|
|
2006
2047
|
}
|
|
2007
2048
|
getButtonSize(variant) {
|
|
2008
2049
|
const { previewButtonSize } = this.formTexts;
|
|
2009
|
-
if (variant ===
|
|
2050
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonSize)
|
|
2010
2051
|
return previewButtonSize;
|
|
2011
2052
|
return "big";
|
|
2012
2053
|
}
|
|
2013
2054
|
getButtonSquare(variant) {
|
|
2014
2055
|
const { previewButtonLabel, previewButtonIcon } = this.formTexts;
|
|
2015
|
-
if (variant ===
|
|
2056
|
+
if (variant === LicenseActivationVariantEnum.preview &&
|
|
2057
|
+
previewButtonIcon &&
|
|
2058
|
+
!previewButtonLabel)
|
|
2016
2059
|
return true;
|
|
2017
2060
|
return undefined;
|
|
2018
2061
|
}
|
|
2019
2062
|
getButtonIcon(variant) {
|
|
2020
2063
|
const { buttonIcon, previewButtonIcon } = this.formTexts;
|
|
2021
|
-
if (variant ===
|
|
2064
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonIcon)
|
|
2022
2065
|
return previewButtonIcon;
|
|
2023
|
-
if (variant !==
|
|
2066
|
+
if (variant !== LicenseActivationVariantEnum.preview && buttonIcon)
|
|
2024
2067
|
return buttonIcon;
|
|
2025
2068
|
return undefined;
|
|
2026
2069
|
}
|
|
2027
2070
|
getButtonLabel(variant) {
|
|
2028
2071
|
const { buttonLabel, previewButtonLabel } = this.formTexts;
|
|
2029
|
-
if (variant ===
|
|
2072
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonLabel)
|
|
2030
2073
|
return previewButtonLabel;
|
|
2031
|
-
if (variant !==
|
|
2074
|
+
if (variant !== LicenseActivationVariantEnum.preview && buttonLabel)
|
|
2032
2075
|
return buttonLabel;
|
|
2033
2076
|
return "";
|
|
2034
2077
|
}
|
|
@@ -5,6 +5,12 @@ export var DeviceEnum;
|
|
|
5
5
|
DeviceEnum["desktop"] = "desktop";
|
|
6
6
|
DeviceEnum["desktopNew"] = "desktopNew";
|
|
7
7
|
})(DeviceEnum || (DeviceEnum = {}));
|
|
8
|
+
export var LicenseActivationVariantEnum;
|
|
9
|
+
(function (LicenseActivationVariantEnum) {
|
|
10
|
+
LicenseActivationVariantEnum["box"] = "box";
|
|
11
|
+
LicenseActivationVariantEnum["modal"] = "modal";
|
|
12
|
+
LicenseActivationVariantEnum["preview"] = "preview";
|
|
13
|
+
})(LicenseActivationVariantEnum || (LicenseActivationVariantEnum = {}));
|
|
8
14
|
export var LicenseActivationStateEnum;
|
|
9
15
|
(function (LicenseActivationStateEnum) {
|
|
10
16
|
LicenseActivationStateEnum["INITIAL"] = "INITIAL";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component, Host, h, Prop, State, Element, Event, Listen, } from "@stencil/core";
|
|
2
|
+
import { LicenseActivationVariantEnum, } from "../../beans";
|
|
2
3
|
import state from "../../store";
|
|
3
4
|
import { getCms } from "../../store/CMS";
|
|
4
5
|
import { Env } from "../../utils/env";
|
|
@@ -14,7 +15,8 @@ export class LicenseActivation {
|
|
|
14
15
|
async componentWillLoad() {
|
|
15
16
|
await getCms(state);
|
|
16
17
|
this.cms = state.cms;
|
|
17
|
-
this.modalState =
|
|
18
|
+
this.modalState =
|
|
19
|
+
this.variant === LicenseActivationVariantEnum.modal ? "open" : "closed";
|
|
18
20
|
this.isMobile =
|
|
19
21
|
window.screen.width <= mobileBreakpoint ||
|
|
20
22
|
window.innerWidth <= mobileBreakpoint;
|
|
@@ -97,7 +99,7 @@ export class LicenseActivation {
|
|
|
97
99
|
if (!inputVal) {
|
|
98
100
|
this.handleLicenseModalOpen(false);
|
|
99
101
|
}
|
|
100
|
-
if ((this.variant ===
|
|
102
|
+
if ((this.variant === LicenseActivationVariantEnum.modal ||
|
|
101
103
|
this.modalState === "open" ||
|
|
102
104
|
licenseActivationStatus === "initial") &&
|
|
103
105
|
inputVal) {
|
|
@@ -120,7 +122,7 @@ export class LicenseActivation {
|
|
|
120
122
|
return (h("license-activation-box", { error: this.licenseActivationState.licenseActivationApiError, code: this.licenseActivationState.licenseActivationCode }, this.renderLicenseActivationForm(variant)));
|
|
121
123
|
}
|
|
122
124
|
renderLicenseActivationModal() {
|
|
123
|
-
return (h("license-activation-modal", { id: `${this.host.id}-modal`, "modal-title": this.cms["newdashboard.licenseActivation.modalTitle"], onActivationModalClose: () => this.handleLicenseModalClose(), resetStore: this.resetStore }, this.renderLicenseActivationForm(
|
|
125
|
+
return (h("license-activation-modal", { id: `${this.host.id}-modal`, "modal-title": this.cms["newdashboard.licenseActivation.modalTitle"], onActivationModalClose: () => this.handleLicenseModalClose(), resetStore: this.resetStore }, this.renderLicenseActivationForm(LicenseActivationVariantEnum.modal)));
|
|
124
126
|
}
|
|
125
127
|
retrieveTextsObject() {
|
|
126
128
|
const { inputMessage, inputLabel, inputPlaceholder, buttonLabel, isMobile, additionalDescription, buttonIcon, previewInputPlaceholder, previewButtonLabel, previewButtonIcon, previewButtonSize, } = this;
|
|
@@ -146,7 +148,8 @@ export class LicenseActivation {
|
|
|
146
148
|
infoBoxIcon: `${this.environment.URL_S3_IMAGES_FOLDER}bollinoSIAE.svg`,
|
|
147
149
|
infoBoxContent: this.cms["newdashboard.licenseActivation.infoBoxContent"],
|
|
148
150
|
supportLink: this.cms["newdashboard.licenseActivation.contactUs.url"],
|
|
149
|
-
additionalDescription: this.variant ===
|
|
151
|
+
additionalDescription: this.variant === LicenseActivationVariantEnum.modal &&
|
|
152
|
+
additionalDescription,
|
|
150
153
|
};
|
|
151
154
|
}
|
|
152
155
|
renderLicenseActivationForm(variant) {
|
|
@@ -159,20 +162,23 @@ export class LicenseActivation {
|
|
|
159
162
|
return (h("z-button", { onClick: () => this.handleMobileButtonClick() }, this.cms["newdashboard.onboarding.licenseActivation.mobileSubmitLabel"]));
|
|
160
163
|
}
|
|
161
164
|
render() {
|
|
162
|
-
if (this.isMobile &&
|
|
165
|
+
if (this.isMobile &&
|
|
166
|
+
this.variant !== LicenseActivationVariantEnum.preview) {
|
|
163
167
|
return (h(Host, null,
|
|
164
168
|
this.forceModal
|
|
165
169
|
? this.renderLicenseActivationModal()
|
|
166
170
|
: this.renderMobileButton(),
|
|
167
|
-
this.variant ===
|
|
171
|
+
this.variant === LicenseActivationVariantEnum.box &&
|
|
168
172
|
this.modalState === "open" &&
|
|
169
173
|
this.renderLicenseActivationModal()));
|
|
170
174
|
}
|
|
171
175
|
return (h(Host, null,
|
|
172
|
-
this.variant ===
|
|
176
|
+
this.variant === LicenseActivationVariantEnum.box ||
|
|
177
|
+
this.variant === LicenseActivationVariantEnum.preview
|
|
173
178
|
? this.renderLicenseActivationBox(this.variant)
|
|
174
179
|
: this.modalState === "open" && this.renderLicenseActivationModal(),
|
|
175
|
-
(this.variant ===
|
|
180
|
+
(this.variant === LicenseActivationVariantEnum.box ||
|
|
181
|
+
this.variant === LicenseActivationVariantEnum.preview) &&
|
|
176
182
|
this.modalState === "open" &&
|
|
177
183
|
this.submitClicked &&
|
|
178
184
|
this.renderLicenseActivationModal()));
|
|
@@ -190,9 +196,14 @@ export class LicenseActivation {
|
|
|
190
196
|
"type": "string",
|
|
191
197
|
"mutable": false,
|
|
192
198
|
"complexType": {
|
|
193
|
-
"original": "
|
|
194
|
-
"resolved": "
|
|
195
|
-
"references": {
|
|
199
|
+
"original": "LicenseActivationVariantType",
|
|
200
|
+
"resolved": "LicenseActivationVariantEnum.box | LicenseActivationVariantEnum.modal | LicenseActivationVariantEnum.preview",
|
|
201
|
+
"references": {
|
|
202
|
+
"LicenseActivationVariantType": {
|
|
203
|
+
"location": "import",
|
|
204
|
+
"path": "../../beans"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
196
207
|
},
|
|
197
208
|
"required": false,
|
|
198
209
|
"optional": false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, Host, h, Prop, State, Event, } from "@stencil/core";
|
|
2
2
|
import { ButtonVariantEnum } from "@zanichelli/albe-web-components/dist/collection/beans/index";
|
|
3
|
+
import { LicenseActivationVariantEnum, } from "../../beans";
|
|
3
4
|
import { manageMarkupContent } from "../../utils/utils";
|
|
4
5
|
export class LicenseActivationForm {
|
|
5
6
|
constructor() {
|
|
@@ -17,26 +18,33 @@ export class LicenseActivationForm {
|
|
|
17
18
|
this.submitButtonClick.emit({ value: inputVal });
|
|
18
19
|
}
|
|
19
20
|
handleInfoClick() {
|
|
20
|
-
if (this.variant ===
|
|
21
|
+
if (this.variant === LicenseActivationVariantEnum.modal) {
|
|
21
22
|
this.showInfoBox = true;
|
|
22
23
|
}
|
|
23
|
-
if (this.variant ===
|
|
24
|
+
if (this.variant === LicenseActivationVariantEnum.box ||
|
|
25
|
+
this.variant === LicenseActivationVariantEnum.preview) {
|
|
24
26
|
this.handleModalOpen();
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
renderInput() {
|
|
28
30
|
const { inputMessage, inputLabel, placeholder, inputStatus, previewInputPlaceholder, } = this.formTexts;
|
|
29
|
-
if (this.variant ===
|
|
31
|
+
if (this.variant === LicenseActivationVariantEnum.preview &&
|
|
32
|
+
!previewInputPlaceholder)
|
|
30
33
|
return;
|
|
31
|
-
const message = this.variant ===
|
|
34
|
+
const message = this.variant === LicenseActivationVariantEnum.box
|
|
32
35
|
? inputMessage
|
|
33
36
|
: this.error
|
|
34
37
|
? this.error
|
|
35
38
|
: inputMessage;
|
|
36
|
-
return (h("z-input", { value: this.inputVal, htmlid: `${this.formid}_input`, label: this.variant ===
|
|
39
|
+
return (h("z-input", { value: this.inputVal, htmlid: `${this.formid}_input`, label: this.variant === LicenseActivationVariantEnum.preview
|
|
40
|
+
? ""
|
|
41
|
+
: inputLabel, placeholder: this.variant === LicenseActivationVariantEnum.preview
|
|
42
|
+
? previewInputPlaceholder
|
|
43
|
+
: placeholder, htmltitle: placeholder, message: this.variant === LicenseActivationVariantEnum.preview ? "" : message, hasmessage: this.variant !== LicenseActivationVariantEnum.preview, status: this.variant === LicenseActivationVariantEnum.box ? null : inputStatus, disabled: !!this.requestLoading, onInputChange: (e) => this.handleFormInputChange(e.detail) }));
|
|
37
44
|
}
|
|
38
45
|
renderButton() {
|
|
39
|
-
const disabled = (this.variant ===
|
|
46
|
+
const disabled = (this.variant === LicenseActivationVariantEnum.modal && !this.inputVal) ||
|
|
47
|
+
!!this.requestLoading;
|
|
40
48
|
return (h("z-button", { variant: ButtonVariantEnum.primary, size: this.getButtonSize(this.variant), square: this.getButtonSquare(this.variant), disabled: disabled || !this.enableButton || this.requestLoading, onClick: () => this.handleSubmitButtonClick(this.inputVal) }, this.renderButtonValue(this.variant, disabled)));
|
|
41
49
|
}
|
|
42
50
|
renderButtonValue(variant, disabled = false) {
|
|
@@ -54,7 +62,7 @@ export class LicenseActivationForm {
|
|
|
54
62
|
}
|
|
55
63
|
renderInfoLink() {
|
|
56
64
|
const { linkLabel } = this.formTexts;
|
|
57
|
-
if (this.variant ===
|
|
65
|
+
if (this.variant === LicenseActivationVariantEnum.preview)
|
|
58
66
|
return;
|
|
59
67
|
return (h("z-link", { icon: "question-mark", onClick: () => this.handleInfoClick() }, linkLabel));
|
|
60
68
|
}
|
|
@@ -81,7 +89,7 @@ export class LicenseActivationForm {
|
|
|
81
89
|
window.location.href = formTexts.supportLink;
|
|
82
90
|
}
|
|
83
91
|
renderErrorSection() {
|
|
84
|
-
if (this.variant !==
|
|
92
|
+
if (this.variant !== LicenseActivationVariantEnum.modal || !this.error)
|
|
85
93
|
return;
|
|
86
94
|
const { errorButtonLabel, errorSectionMessage } = this.formTexts;
|
|
87
95
|
return (h("section", { class: "error-section" },
|
|
@@ -90,29 +98,31 @@ export class LicenseActivationForm {
|
|
|
90
98
|
}
|
|
91
99
|
getButtonSize(variant) {
|
|
92
100
|
const { previewButtonSize } = this.formTexts;
|
|
93
|
-
if (variant ===
|
|
101
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonSize)
|
|
94
102
|
return previewButtonSize;
|
|
95
103
|
return "big";
|
|
96
104
|
}
|
|
97
105
|
getButtonSquare(variant) {
|
|
98
106
|
const { previewButtonLabel, previewButtonIcon } = this.formTexts;
|
|
99
|
-
if (variant ===
|
|
107
|
+
if (variant === LicenseActivationVariantEnum.preview &&
|
|
108
|
+
previewButtonIcon &&
|
|
109
|
+
!previewButtonLabel)
|
|
100
110
|
return true;
|
|
101
111
|
return undefined;
|
|
102
112
|
}
|
|
103
113
|
getButtonIcon(variant) {
|
|
104
114
|
const { buttonIcon, previewButtonIcon } = this.formTexts;
|
|
105
|
-
if (variant ===
|
|
115
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonIcon)
|
|
106
116
|
return previewButtonIcon;
|
|
107
|
-
if (variant !==
|
|
117
|
+
if (variant !== LicenseActivationVariantEnum.preview && buttonIcon)
|
|
108
118
|
return buttonIcon;
|
|
109
119
|
return undefined;
|
|
110
120
|
}
|
|
111
121
|
getButtonLabel(variant) {
|
|
112
122
|
const { buttonLabel, previewButtonLabel } = this.formTexts;
|
|
113
|
-
if (variant ===
|
|
123
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonLabel)
|
|
114
124
|
return previewButtonLabel;
|
|
115
|
-
if (variant !==
|
|
125
|
+
if (variant !== LicenseActivationVariantEnum.preview && buttonLabel)
|
|
116
126
|
return buttonLabel;
|
|
117
127
|
return "";
|
|
118
128
|
}
|
|
@@ -301,9 +311,14 @@ export class LicenseActivationForm {
|
|
|
301
311
|
"type": "string",
|
|
302
312
|
"mutable": false,
|
|
303
313
|
"complexType": {
|
|
304
|
-
"original": "
|
|
305
|
-
"resolved": "
|
|
306
|
-
"references": {
|
|
314
|
+
"original": "LicenseActivationVariantType",
|
|
315
|
+
"resolved": "LicenseActivationVariantEnum.box | LicenseActivationVariantEnum.modal | LicenseActivationVariantEnum.preview",
|
|
316
|
+
"references": {
|
|
317
|
+
"LicenseActivationVariantType": {
|
|
318
|
+
"location": "import",
|
|
319
|
+
"path": "../../beans"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
307
322
|
},
|
|
308
323
|
"required": false,
|
|
309
324
|
"optional": false,
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
import { getRenderingRef, forceUpdate, createEvent, h, Host, attachShadow, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
3
|
|
|
4
|
+
var DeviceEnum;
|
|
5
|
+
(function (DeviceEnum) {
|
|
6
|
+
DeviceEnum["mobile"] = "mobile";
|
|
7
|
+
DeviceEnum["tablet"] = "tablet";
|
|
8
|
+
DeviceEnum["desktop"] = "desktop";
|
|
9
|
+
DeviceEnum["desktopNew"] = "desktopNew";
|
|
10
|
+
})(DeviceEnum || (DeviceEnum = {}));
|
|
11
|
+
var LicenseActivationVariantEnum;
|
|
12
|
+
(function (LicenseActivationVariantEnum) {
|
|
13
|
+
LicenseActivationVariantEnum["box"] = "box";
|
|
14
|
+
LicenseActivationVariantEnum["modal"] = "modal";
|
|
15
|
+
LicenseActivationVariantEnum["preview"] = "preview";
|
|
16
|
+
})(LicenseActivationVariantEnum || (LicenseActivationVariantEnum = {}));
|
|
17
|
+
var LicenseActivationStateEnum;
|
|
18
|
+
(function (LicenseActivationStateEnum) {
|
|
19
|
+
LicenseActivationStateEnum["INITIAL"] = "INITIAL";
|
|
20
|
+
LicenseActivationStateEnum["ACTIVATING"] = "ACTIVATING";
|
|
21
|
+
LicenseActivationStateEnum["ACTIVATED"] = "ACTIVATED";
|
|
22
|
+
LicenseActivationStateEnum["SUCCESS"] = "SUCCESS";
|
|
23
|
+
})(LicenseActivationStateEnum || (LicenseActivationStateEnum = {}));
|
|
24
|
+
var LicenseActivationActionEnum;
|
|
25
|
+
(function (LicenseActivationActionEnum) {
|
|
26
|
+
LicenseActivationActionEnum["REQUEST"] = "app/LICENSE_ACTIVATION/REQUEST";
|
|
27
|
+
LicenseActivationActionEnum["ACTIVATED"] = "app/LICENSE_ACTIVATION/ACTIVATED";
|
|
28
|
+
LicenseActivationActionEnum["SUCCESS"] = "app/LICENSE_ACTIVATION/SUCCESS";
|
|
29
|
+
LicenseActivationActionEnum["FAIL"] = "app/LICENSE_ACTIVATION/FAIL";
|
|
30
|
+
LicenseActivationActionEnum["RESET"] = "app/LICENSE_ACTIVATION/RESET";
|
|
31
|
+
})(LicenseActivationActionEnum || (LicenseActivationActionEnum = {}));
|
|
32
|
+
|
|
4
33
|
const appendToMap = (map, propName, value) => {
|
|
5
34
|
const items = map.get(propName);
|
|
6
35
|
if (!items) {
|
|
@@ -1738,7 +1767,8 @@ const LicenseActivation$1 = class extends HTMLElement {
|
|
|
1738
1767
|
async componentWillLoad() {
|
|
1739
1768
|
await getCms(state);
|
|
1740
1769
|
this.cms = state.cms;
|
|
1741
|
-
this.modalState =
|
|
1770
|
+
this.modalState =
|
|
1771
|
+
this.variant === LicenseActivationVariantEnum.modal ? "open" : "closed";
|
|
1742
1772
|
this.isMobile =
|
|
1743
1773
|
window.screen.width <= mobileBreakpoint$1 ||
|
|
1744
1774
|
window.innerWidth <= mobileBreakpoint$1;
|
|
@@ -1821,7 +1851,7 @@ const LicenseActivation$1 = class extends HTMLElement {
|
|
|
1821
1851
|
if (!inputVal) {
|
|
1822
1852
|
this.handleLicenseModalOpen(false);
|
|
1823
1853
|
}
|
|
1824
|
-
if ((this.variant ===
|
|
1854
|
+
if ((this.variant === LicenseActivationVariantEnum.modal ||
|
|
1825
1855
|
this.modalState === "open" ||
|
|
1826
1856
|
licenseActivationStatus === "initial") &&
|
|
1827
1857
|
inputVal) {
|
|
@@ -1844,7 +1874,7 @@ const LicenseActivation$1 = class extends HTMLElement {
|
|
|
1844
1874
|
return (h("license-activation-box", { error: this.licenseActivationState.licenseActivationApiError, code: this.licenseActivationState.licenseActivationCode }, this.renderLicenseActivationForm(variant)));
|
|
1845
1875
|
}
|
|
1846
1876
|
renderLicenseActivationModal() {
|
|
1847
|
-
return (h("license-activation-modal", { id: `${this.host.id}-modal`, "modal-title": this.cms["newdashboard.licenseActivation.modalTitle"], onActivationModalClose: () => this.handleLicenseModalClose(), resetStore: this.resetStore }, this.renderLicenseActivationForm(
|
|
1877
|
+
return (h("license-activation-modal", { id: `${this.host.id}-modal`, "modal-title": this.cms["newdashboard.licenseActivation.modalTitle"], onActivationModalClose: () => this.handleLicenseModalClose(), resetStore: this.resetStore }, this.renderLicenseActivationForm(LicenseActivationVariantEnum.modal)));
|
|
1848
1878
|
}
|
|
1849
1879
|
retrieveTextsObject() {
|
|
1850
1880
|
const { inputMessage, inputLabel, inputPlaceholder, buttonLabel, isMobile, additionalDescription, buttonIcon, previewInputPlaceholder, previewButtonLabel, previewButtonIcon, previewButtonSize, } = this;
|
|
@@ -1870,7 +1900,8 @@ const LicenseActivation$1 = class extends HTMLElement {
|
|
|
1870
1900
|
infoBoxIcon: `${this.environment.URL_S3_IMAGES_FOLDER}bollinoSIAE.svg`,
|
|
1871
1901
|
infoBoxContent: this.cms["newdashboard.licenseActivation.infoBoxContent"],
|
|
1872
1902
|
supportLink: this.cms["newdashboard.licenseActivation.contactUs.url"],
|
|
1873
|
-
additionalDescription: this.variant ===
|
|
1903
|
+
additionalDescription: this.variant === LicenseActivationVariantEnum.modal &&
|
|
1904
|
+
additionalDescription,
|
|
1874
1905
|
};
|
|
1875
1906
|
}
|
|
1876
1907
|
renderLicenseActivationForm(variant) {
|
|
@@ -1883,16 +1914,19 @@ const LicenseActivation$1 = class extends HTMLElement {
|
|
|
1883
1914
|
return (h("z-button", { onClick: () => this.handleMobileButtonClick() }, this.cms["newdashboard.onboarding.licenseActivation.mobileSubmitLabel"]));
|
|
1884
1915
|
}
|
|
1885
1916
|
render() {
|
|
1886
|
-
if (this.isMobile &&
|
|
1917
|
+
if (this.isMobile &&
|
|
1918
|
+
this.variant !== LicenseActivationVariantEnum.preview) {
|
|
1887
1919
|
return (h(Host, null, this.forceModal
|
|
1888
1920
|
? this.renderLicenseActivationModal()
|
|
1889
|
-
: this.renderMobileButton(), this.variant ===
|
|
1921
|
+
: this.renderMobileButton(), this.variant === LicenseActivationVariantEnum.box &&
|
|
1890
1922
|
this.modalState === "open" &&
|
|
1891
1923
|
this.renderLicenseActivationModal()));
|
|
1892
1924
|
}
|
|
1893
|
-
return (h(Host, null, this.variant ===
|
|
1925
|
+
return (h(Host, null, this.variant === LicenseActivationVariantEnum.box ||
|
|
1926
|
+
this.variant === LicenseActivationVariantEnum.preview
|
|
1894
1927
|
? this.renderLicenseActivationBox(this.variant)
|
|
1895
|
-
: this.modalState === "open" && this.renderLicenseActivationModal(), (this.variant ===
|
|
1928
|
+
: this.modalState === "open" && this.renderLicenseActivationModal(), (this.variant === LicenseActivationVariantEnum.box ||
|
|
1929
|
+
this.variant === LicenseActivationVariantEnum.preview) &&
|
|
1896
1930
|
this.modalState === "open" &&
|
|
1897
1931
|
this.submitClicked &&
|
|
1898
1932
|
this.renderLicenseActivationModal()));
|
|
@@ -2033,26 +2067,33 @@ const LicenseActivationForm$1 = class extends HTMLElement {
|
|
|
2033
2067
|
this.submitButtonClick.emit({ value: inputVal });
|
|
2034
2068
|
}
|
|
2035
2069
|
handleInfoClick() {
|
|
2036
|
-
if (this.variant ===
|
|
2070
|
+
if (this.variant === LicenseActivationVariantEnum.modal) {
|
|
2037
2071
|
this.showInfoBox = true;
|
|
2038
2072
|
}
|
|
2039
|
-
if (this.variant ===
|
|
2073
|
+
if (this.variant === LicenseActivationVariantEnum.box ||
|
|
2074
|
+
this.variant === LicenseActivationVariantEnum.preview) {
|
|
2040
2075
|
this.handleModalOpen();
|
|
2041
2076
|
}
|
|
2042
2077
|
}
|
|
2043
2078
|
renderInput() {
|
|
2044
2079
|
const { inputMessage, inputLabel, placeholder, inputStatus, previewInputPlaceholder, } = this.formTexts;
|
|
2045
|
-
if (this.variant ===
|
|
2080
|
+
if (this.variant === LicenseActivationVariantEnum.preview &&
|
|
2081
|
+
!previewInputPlaceholder)
|
|
2046
2082
|
return;
|
|
2047
|
-
const message = this.variant ===
|
|
2083
|
+
const message = this.variant === LicenseActivationVariantEnum.box
|
|
2048
2084
|
? inputMessage
|
|
2049
2085
|
: this.error
|
|
2050
2086
|
? this.error
|
|
2051
2087
|
: inputMessage;
|
|
2052
|
-
return (h("z-input", { value: this.inputVal, htmlid: `${this.formid}_input`, label: this.variant ===
|
|
2088
|
+
return (h("z-input", { value: this.inputVal, htmlid: `${this.formid}_input`, label: this.variant === LicenseActivationVariantEnum.preview
|
|
2089
|
+
? ""
|
|
2090
|
+
: inputLabel, placeholder: this.variant === LicenseActivationVariantEnum.preview
|
|
2091
|
+
? previewInputPlaceholder
|
|
2092
|
+
: placeholder, htmltitle: placeholder, message: this.variant === LicenseActivationVariantEnum.preview ? "" : message, hasmessage: this.variant !== LicenseActivationVariantEnum.preview, status: this.variant === LicenseActivationVariantEnum.box ? null : inputStatus, disabled: !!this.requestLoading, onInputChange: (e) => this.handleFormInputChange(e.detail) }));
|
|
2053
2093
|
}
|
|
2054
2094
|
renderButton() {
|
|
2055
|
-
const disabled = (this.variant ===
|
|
2095
|
+
const disabled = (this.variant === LicenseActivationVariantEnum.modal && !this.inputVal) ||
|
|
2096
|
+
!!this.requestLoading;
|
|
2056
2097
|
return (h("z-button", { variant: ButtonVariantEnum.primary, size: this.getButtonSize(this.variant), square: this.getButtonSquare(this.variant), disabled: disabled || !this.enableButton || this.requestLoading, onClick: () => this.handleSubmitButtonClick(this.inputVal) }, this.renderButtonValue(this.variant, disabled)));
|
|
2057
2098
|
}
|
|
2058
2099
|
renderButtonValue(variant, disabled = false) {
|
|
@@ -2068,7 +2109,7 @@ const LicenseActivationForm$1 = class extends HTMLElement {
|
|
|
2068
2109
|
}
|
|
2069
2110
|
renderInfoLink() {
|
|
2070
2111
|
const { linkLabel } = this.formTexts;
|
|
2071
|
-
if (this.variant ===
|
|
2112
|
+
if (this.variant === LicenseActivationVariantEnum.preview)
|
|
2072
2113
|
return;
|
|
2073
2114
|
return (h("z-link", { icon: "question-mark", onClick: () => this.handleInfoClick() }, linkLabel));
|
|
2074
2115
|
}
|
|
@@ -2091,36 +2132,38 @@ const LicenseActivationForm$1 = class extends HTMLElement {
|
|
|
2091
2132
|
window.location.href = formTexts.supportLink;
|
|
2092
2133
|
}
|
|
2093
2134
|
renderErrorSection() {
|
|
2094
|
-
if (this.variant !==
|
|
2135
|
+
if (this.variant !== LicenseActivationVariantEnum.modal || !this.error)
|
|
2095
2136
|
return;
|
|
2096
2137
|
const { errorButtonLabel, errorSectionMessage } = this.formTexts;
|
|
2097
2138
|
return (h("section", { class: "error-section" }, h("span", { class: "heading-01" }, errorSectionMessage), h("z-button", { variant: ButtonVariantEnum.secondary, onClick: this.redirectToSupport }, errorButtonLabel)));
|
|
2098
2139
|
}
|
|
2099
2140
|
getButtonSize(variant) {
|
|
2100
2141
|
const { previewButtonSize } = this.formTexts;
|
|
2101
|
-
if (variant ===
|
|
2142
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonSize)
|
|
2102
2143
|
return previewButtonSize;
|
|
2103
2144
|
return "big";
|
|
2104
2145
|
}
|
|
2105
2146
|
getButtonSquare(variant) {
|
|
2106
2147
|
const { previewButtonLabel, previewButtonIcon } = this.formTexts;
|
|
2107
|
-
if (variant ===
|
|
2148
|
+
if (variant === LicenseActivationVariantEnum.preview &&
|
|
2149
|
+
previewButtonIcon &&
|
|
2150
|
+
!previewButtonLabel)
|
|
2108
2151
|
return true;
|
|
2109
2152
|
return undefined;
|
|
2110
2153
|
}
|
|
2111
2154
|
getButtonIcon(variant) {
|
|
2112
2155
|
const { buttonIcon, previewButtonIcon } = this.formTexts;
|
|
2113
|
-
if (variant ===
|
|
2156
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonIcon)
|
|
2114
2157
|
return previewButtonIcon;
|
|
2115
|
-
if (variant !==
|
|
2158
|
+
if (variant !== LicenseActivationVariantEnum.preview && buttonIcon)
|
|
2116
2159
|
return buttonIcon;
|
|
2117
2160
|
return undefined;
|
|
2118
2161
|
}
|
|
2119
2162
|
getButtonLabel(variant) {
|
|
2120
2163
|
const { buttonLabel, previewButtonLabel } = this.formTexts;
|
|
2121
|
-
if (variant ===
|
|
2164
|
+
if (variant === LicenseActivationVariantEnum.preview && previewButtonLabel)
|
|
2122
2165
|
return previewButtonLabel;
|
|
2123
|
-
if (variant !==
|
|
2166
|
+
if (variant !== LicenseActivationVariantEnum.preview && buttonLabel)
|
|
2124
2167
|
return buttonLabel;
|
|
2125
2168
|
return "";
|
|
2126
2169
|
}
|