slicejs-cli 1.0.54 → 1.0.56
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/commands/listComponents/listComponents.js +69 -30
- package/package.json +1 -1
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Provider/TestProvider/TestProvider.js +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Service/FetchManager/FetchManager.js +0 -134
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Service/IndexedDbManager/IndexedDbManager.js +0 -138
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Service/LocalStorageManager/LocalStorageManager.js +0 -45
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Service/Translator/Translator.js +0 -59
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Service/Translator/messages.json +0 -50
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Controller/Controller.js +0 -106
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Debugger/Debugger.css +0 -95
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Debugger/Debugger.html +0 -10
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Debugger/Debugger.js +0 -250
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Logger/Log.js +0 -10
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/Logger/Logger.js +0 -112
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/StylesManager/CustomStylesManager/CustomStylesManager.js +0 -52
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/StylesManager/StylesManager.js +0 -42
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Structural/StylesManager/ThemeManager/ThemeManager.js +0 -25
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Button/Button.css +0 -44
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Button/Button.html +0 -5
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Button/Button.js +0 -39
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Card/Card.css +0 -63
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Card/Card.html +0 -7
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Card/Card.js +0 -110
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Checkbox/Checkbox.css +0 -87
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Checkbox/Checkbox.html +0 -8
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Checkbox/Checkbox.js +0 -87
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/CodeValidator/CodeValidator.css +0 -97
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/CodeValidator/CodeValidator.html +0 -18
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/CodeValidator/CodeValidator.js +0 -86
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/Icon.css +0 -505
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/Icon.html +0 -1
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/Icon.js +0 -95
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.eot +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.json +0 -550
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.styl +0 -502
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.svg +0 -1470
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.symbol.svg +0 -1035
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.ttf +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.woff +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Icon/slc.woff2 +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Input/Input.css +0 -87
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Input/Input.html +0 -4
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Input/Input.js +0 -210
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Loading/Loading.css +0 -56
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Loading/Loading.html +0 -83
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Loading/Loading.js +0 -39
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Navbar/Navbar.css +0 -30
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Navbar/Navbar.html +0 -6
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Navbar/Navbar.js +0 -39
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Select/Select.css +0 -91
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Select/Select.html +0 -8
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Select/Select.js +0 -210
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Switch/Switch.css +0 -76
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Switch/Switch.html +0 -8
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Switch/Switch.js +0 -109
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/TestComponent/TestComponent.css +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/TestComponent/TestComponent.html +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/TestComponent/TestComponent.js +0 -0
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester/Tester.css +0 -34
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester/Tester.html +0 -7
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester/Tester.js +0 -33
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester2/Tester2.css +0 -34
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester2/Tester2.html +0 -43
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/Tester2/Tester2.js +0 -39
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/ToastAlert/ToastAlert.css +0 -110
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/ToastAlert/ToastAlert.html +0 -12
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/ToastAlert/ToastAlert.js +0 -65
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/complexNavbar/complexNavbar.css +0 -163
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/complexNavbar/complexNavbar.html +0 -15
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/complexNavbar/complexNavbar.js +0 -48
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/imageCarousel/img-carousel.css +0 -56
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/imageCarousel/img-carousel.html +0 -6
- package/PROJECT_TEMPLATES/Basic/Slice/Components/Visual/imageCarousel/img-carousel.js +0 -119
- package/PROJECT_TEMPLATES/Basic/Slice/Components/components.js +0 -23
- package/PROJECT_TEMPLATES/Basic/Slice/Slice.js +0 -194
- package/PROJECT_TEMPLATES/Basic/Slice/Styles/Custom/custom.css +0 -23
- package/PROJECT_TEMPLATES/Basic/Slice/Styles/sliceStyles.css +0 -10
- package/PROJECT_TEMPLATES/Basic/Slice/Themes/Dark.css +0 -38
- package/PROJECT_TEMPLATES/Basic/Slice/Themes/Light.css +0 -31
- package/PROJECT_TEMPLATES/Basic/Slice/Themes/Slice.css +0 -30
- package/PROJECT_TEMPLATES/Basic/Slice/package.json +0 -12
- package/PROJECT_TEMPLATES/Basic/Slice/sliceConfig.json +0 -32
- package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/index.html +0 -14
- package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/index.js +0 -395
- package/PROJECT_TEMPLATES/Basic/src/Views/LandingPage/style.css +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
.title {
|
|
2
|
-
font-size: 20px;
|
|
3
|
-
font-weight: bold;
|
|
4
|
-
color: var(--font-primary-color);
|
|
5
|
-
text-align: center;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.slice-card {
|
|
9
|
-
width: 300px;
|
|
10
|
-
position: relative;
|
|
11
|
-
font-family: var(--font-family);
|
|
12
|
-
transition: all 300ms;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.slice-card:hover {
|
|
16
|
-
.card_cover {
|
|
17
|
-
transform: translateY(-90%);
|
|
18
|
-
box-shadow: 0px 10px 10px #00000050;
|
|
19
|
-
}
|
|
20
|
-
.card_info {
|
|
21
|
-
/* transform: translateY(20%); */
|
|
22
|
-
box-shadow: 0px -10px 10px #00000050;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.card_cover {
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: 220px;
|
|
29
|
-
background: var(--primary-color);
|
|
30
|
-
display: flex;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
align-items: center;
|
|
33
|
-
position: absolute;
|
|
34
|
-
z-index: 1;
|
|
35
|
-
transition: all 400ms ease;
|
|
36
|
-
border-radius: var(--border-radius-slice);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.card_info {
|
|
40
|
-
width: 100%;
|
|
41
|
-
margin-top: 20px;
|
|
42
|
-
height: 220px;
|
|
43
|
-
color: var(--font-secondary-color);
|
|
44
|
-
background: var(--secondary-background-color);
|
|
45
|
-
position: absolute;
|
|
46
|
-
font-size: 20px;
|
|
47
|
-
transition: all 400ms cubic-bezier(0.5, 0, 0, 1);
|
|
48
|
-
border-radius: var(--border-radius-slice);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.card_info p {
|
|
52
|
-
padding: 0px 20px 20px 20px;
|
|
53
|
-
font-size: 20px;
|
|
54
|
-
display: -webkit-box;
|
|
55
|
-
display: -moz-box;
|
|
56
|
-
display: box;
|
|
57
|
-
-webkit-box-orient: vertical;
|
|
58
|
-
-moz-box-orient: vertical;
|
|
59
|
-
box-orient: vertical;
|
|
60
|
-
-webkit-line-clamp: 5;
|
|
61
|
-
line-clamp: 5;
|
|
62
|
-
overflow: hidden;
|
|
63
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
export default class Card extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
this.$card = this.querySelector(".slice-card");
|
|
6
|
-
this.$title = this.querySelector(".title");
|
|
7
|
-
this.$text = this.querySelector(".text");
|
|
8
|
-
this.$cover = this.querySelector(".card_cover");
|
|
9
|
-
slice.controller.setComponentProps(this, props);
|
|
10
|
-
|
|
11
|
-
this.$card.addEventListener("click", () => {
|
|
12
|
-
this.isOpen = !this.isOpen;
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
this.$card.addEventListener("mouseover", () => {
|
|
16
|
-
this.$cover.style.backgroundColor = this.$color.icon;
|
|
17
|
-
this.$icon.color = this.$color.card;
|
|
18
|
-
});
|
|
19
|
-
this.$card.addEventListener("mouseout", () => {
|
|
20
|
-
this.$cover.style.backgroundColor = this.$color.card;
|
|
21
|
-
this.$icon.color = this.$color.icon;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
this.debuggerProps = ["title", "text", "icon", "customColor", "isOpen"];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async init() {
|
|
28
|
-
if (this.isOpen === undefined) {
|
|
29
|
-
this.isOpen = false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (!this.customColor) {
|
|
33
|
-
this.$color = {
|
|
34
|
-
icon: "var(--primary-color-contrast)",
|
|
35
|
-
card: "var(--primary-color)",
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (!this._icon) {
|
|
40
|
-
this.icon.name = "youtube";
|
|
41
|
-
this.icon.iconStyle = "filled";
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
this.$icon = await slice.build("Icon", {
|
|
45
|
-
name: this.icon.name,
|
|
46
|
-
size: "150px",
|
|
47
|
-
color: this.$color.icon,
|
|
48
|
-
iconStyle: this._icon.iconStyle,
|
|
49
|
-
});
|
|
50
|
-
this.$cover.appendChild(this.$icon);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
get title() {
|
|
54
|
-
return this._title;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
set title(value) {
|
|
58
|
-
this._title = value;
|
|
59
|
-
this.$title.textContent = value;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
get text() {
|
|
63
|
-
return this._text;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
set text(value) {
|
|
67
|
-
this._text = value;
|
|
68
|
-
this.$text.textContent = value;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
get icon() {
|
|
72
|
-
return this._icon;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
set icon(value) {
|
|
76
|
-
this._icon = value;
|
|
77
|
-
if (!this.$icon) return;
|
|
78
|
-
this.$icon.name = value.name;
|
|
79
|
-
this.$icon.iconStyle = value.iconStyle;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
get isOpen() {
|
|
85
|
-
return this._isOpen;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
set isOpen(boolean) {
|
|
89
|
-
this._isOpen = boolean;
|
|
90
|
-
if (boolean) {
|
|
91
|
-
this.$cover.style.zIndex = 0;
|
|
92
|
-
} else {
|
|
93
|
-
this.$cover.style.zIndex = 1;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
get customColor() {
|
|
98
|
-
return this._customColor;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
set customColor(value) {
|
|
102
|
-
this._customColor = value;
|
|
103
|
-
this.$color = value;
|
|
104
|
-
if (value.card) {
|
|
105
|
-
this.$cover.style.backgroundColor = value.card;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
customElements.define("slice-card", Card);
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
.slice_checkbox input {
|
|
2
|
-
position: absolute;
|
|
3
|
-
opacity: 0;
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
height: 0;
|
|
6
|
-
width: 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.slice_checkbox_container {
|
|
10
|
-
width: fit-content;
|
|
11
|
-
}
|
|
12
|
-
.slice_checkbox {
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
user-select: none;
|
|
16
|
-
margin-top: 25px;
|
|
17
|
-
margin-bottom: 25px;
|
|
18
|
-
position: relative;
|
|
19
|
-
user-select: none;
|
|
20
|
-
}
|
|
21
|
-
.checkbox_label {
|
|
22
|
-
margin: 5px;
|
|
23
|
-
font-family: var(--font-family);
|
|
24
|
-
color: var(--font-primary-color);
|
|
25
|
-
}
|
|
26
|
-
.checkmark {
|
|
27
|
-
position: relative;
|
|
28
|
-
top: 0;
|
|
29
|
-
left: 0;
|
|
30
|
-
height: 1.3em;
|
|
31
|
-
width: 1.3em;
|
|
32
|
-
background-color: var(--secondary-background-color);
|
|
33
|
-
border: var(--slice-border) solid var(--primary-color);
|
|
34
|
-
transition: all 0.3s;
|
|
35
|
-
border-radius: var(--border-radius-slice);
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
}
|
|
38
|
-
.slice_checkbox input:checked ~ .checkmark {
|
|
39
|
-
border: var(--slice-border) solid var(--success-color);
|
|
40
|
-
background-color: var(--success-color);
|
|
41
|
-
animation: pop 0.5s;
|
|
42
|
-
animation-direction: alternate;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.checkmark:after {
|
|
46
|
-
content: "";
|
|
47
|
-
position: absolute;
|
|
48
|
-
display: none;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.slice_checkbox input:checked ~ .checkmark:after {
|
|
52
|
-
display: block;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.slice_checkbox .checkmark:after {
|
|
56
|
-
left: 0.45em;
|
|
57
|
-
top: 0.25em;
|
|
58
|
-
width: 0.25em;
|
|
59
|
-
height: 0.5em;
|
|
60
|
-
border: solid white;
|
|
61
|
-
border-width: 0 0.15em 0.15em 0;
|
|
62
|
-
transform: rotate(45deg);
|
|
63
|
-
}
|
|
64
|
-
.disabled {
|
|
65
|
-
border-color: var(--disabled-color);
|
|
66
|
-
background-color: var(--primary-color-shade);
|
|
67
|
-
color: var(--disabled-color);
|
|
68
|
-
cursor: not-allowed;
|
|
69
|
-
}
|
|
70
|
-
@keyframes pop {
|
|
71
|
-
0% {
|
|
72
|
-
transform: scale(1);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
50% {
|
|
76
|
-
transform: scale(0.9);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
100% {
|
|
80
|
-
transform: scale(1);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
.checkbox_label {
|
|
84
|
-
margin-left: 5px;
|
|
85
|
-
font-family: var(--font-family);
|
|
86
|
-
color: var(--font-primary-color);
|
|
87
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
export default class Checkbox extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
this.$checkbox = this.querySelector(".slice_checkbox");
|
|
6
|
-
this.$checkmark = this.querySelector(".checkmark");
|
|
7
|
-
|
|
8
|
-
slice.controller.setComponentProps(this, props);
|
|
9
|
-
this.debuggerProps = ["checked", "disabled", "customColor", "position"];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
init() {
|
|
13
|
-
if (this._checked === undefined) {
|
|
14
|
-
this.checked = false;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if(!this.disabled){
|
|
18
|
-
this._disabled=false;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
get checked() {
|
|
24
|
-
return this._checked;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
set checked(value) {
|
|
28
|
-
this._checked = value;
|
|
29
|
-
this.querySelector("input").checked = value;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
get label() {
|
|
33
|
-
return this._label;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
set label(value) {
|
|
37
|
-
this._label = value;
|
|
38
|
-
if (this.querySelector(".checkbox_label")) {
|
|
39
|
-
this.querySelector(".checkbox_label").textContent = value;
|
|
40
|
-
} else {
|
|
41
|
-
const label = document.createElement("label");
|
|
42
|
-
label.classList.add("checkbox_label");
|
|
43
|
-
label.textContent = value;
|
|
44
|
-
this.$checkbox.appendChild(label);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get customColor() {
|
|
49
|
-
return this._customColor;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
set customColor(value) {
|
|
53
|
-
this._customColor = value;
|
|
54
|
-
this.style = `--success-color: ${value};`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
get position() {
|
|
58
|
-
return this._position;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
set position(value) {
|
|
62
|
-
if (value === "left") {
|
|
63
|
-
this.$checkbox.style = ` flex-direction: row-reverse;`;
|
|
64
|
-
}
|
|
65
|
-
if (value === "right") {
|
|
66
|
-
this.$checkbox.style = `flex-direction: row;`;
|
|
67
|
-
}
|
|
68
|
-
if (value === "top") {
|
|
69
|
-
this.$checkbox.style = `flex-direction: column-reverse;`;
|
|
70
|
-
}
|
|
71
|
-
if (value === "bottom") {
|
|
72
|
-
this.$checkbox.style = `flex-direction: column;`;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
get disabled() {
|
|
77
|
-
return this._disabled;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
set disabled(value) {
|
|
81
|
-
this._disabled = value;
|
|
82
|
-
this.querySelector("input").disabled = value;
|
|
83
|
-
this.$checkmark.classList.add("disabled");
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
customElements.define("slice-checkbox", Checkbox);
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/* Import Google font - Poppins */
|
|
2
|
-
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");
|
|
3
|
-
* {
|
|
4
|
-
margin: 0;
|
|
5
|
-
padding: 0;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
font-family: "Poppins", sans-serif;
|
|
8
|
-
}
|
|
9
|
-
body {
|
|
10
|
-
min-height: 100vh;
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
background: #4070f4;
|
|
15
|
-
}
|
|
16
|
-
:where(.container, form, .input-field, header) {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
}
|
|
22
|
-
.container {
|
|
23
|
-
background: #fff;
|
|
24
|
-
padding: 30px 65px;
|
|
25
|
-
border-radius: 12px;
|
|
26
|
-
row-gap: 20px;
|
|
27
|
-
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
|
|
28
|
-
z-index: 15000;
|
|
29
|
-
position: fixed;
|
|
30
|
-
}
|
|
31
|
-
.container header {
|
|
32
|
-
height: 65px;
|
|
33
|
-
width: 65px;
|
|
34
|
-
background: #4070f4;
|
|
35
|
-
color: #fff;
|
|
36
|
-
font-size: 2.5rem;
|
|
37
|
-
border-radius: 50%;
|
|
38
|
-
}
|
|
39
|
-
.container h4 {
|
|
40
|
-
font-size: 1.25rem;
|
|
41
|
-
color: #333;
|
|
42
|
-
font-weight: 500;
|
|
43
|
-
}
|
|
44
|
-
form .input-field {
|
|
45
|
-
flex-direction: row;
|
|
46
|
-
column-gap: 10px;
|
|
47
|
-
}
|
|
48
|
-
.input-field input {
|
|
49
|
-
height: 45px;
|
|
50
|
-
width: 42px;
|
|
51
|
-
border-radius: 6px;
|
|
52
|
-
outline: none;
|
|
53
|
-
font-size: 1.125rem;
|
|
54
|
-
text-align: center;
|
|
55
|
-
border: 1px solid #ddd;
|
|
56
|
-
}
|
|
57
|
-
.input-field input:focus {
|
|
58
|
-
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
|
59
|
-
}
|
|
60
|
-
.input-field input::-webkit-inner-spin-button,
|
|
61
|
-
.input-field input::-webkit-outer-spin-button {
|
|
62
|
-
display: none;
|
|
63
|
-
}
|
|
64
|
-
form button {
|
|
65
|
-
margin-top: 25px;
|
|
66
|
-
width: 100%;
|
|
67
|
-
color: #fff;
|
|
68
|
-
font-size: 1rem;
|
|
69
|
-
border: none;
|
|
70
|
-
padding: 9px 0;
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
border-radius: 6px;
|
|
73
|
-
pointer-events: none;
|
|
74
|
-
background: #6e93f7;
|
|
75
|
-
transition: all 0.2s ease;
|
|
76
|
-
}
|
|
77
|
-
form button.active {
|
|
78
|
-
background: #4070f4;
|
|
79
|
-
pointer-events: auto;
|
|
80
|
-
}
|
|
81
|
-
form button:hover {
|
|
82
|
-
background: #0e4bf1;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.center-screen {
|
|
86
|
-
position: absolute;
|
|
87
|
-
top: 50%;
|
|
88
|
-
left: 50%;
|
|
89
|
-
margin-right: -50%;
|
|
90
|
-
transform: translate(-50%, -50%);
|
|
91
|
-
z-index: 100000;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.container::backdrop{
|
|
95
|
-
background-color: black;
|
|
96
|
-
opacity: 0.5;
|
|
97
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<link rel="stylesheet" href="./Slice/css/CodeValidator.css">
|
|
2
|
-
<div class="container center-screen">
|
|
3
|
-
<header>
|
|
4
|
-
<i class="bx bxs-check-shield"></i>
|
|
5
|
-
</header>
|
|
6
|
-
<h4>Enter OTP Code</h4>
|
|
7
|
-
<form action="#">
|
|
8
|
-
<div class="input-field">
|
|
9
|
-
<input type="number" />
|
|
10
|
-
<input type="number" disabled />
|
|
11
|
-
<input type="number" disabled />
|
|
12
|
-
<input type="number" disabled />
|
|
13
|
-
<input type="number" disabled />
|
|
14
|
-
<input type="number" disabled />
|
|
15
|
-
</div>
|
|
16
|
-
<button>Verify OTP</button>
|
|
17
|
-
</form>
|
|
18
|
-
</div>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export default class Button extends HTMLElement {
|
|
2
|
-
constructor() {
|
|
3
|
-
super();
|
|
4
|
-
slice.controller
|
|
5
|
-
.loadTemplate("./Slice/templates/codeValidator.html")
|
|
6
|
-
.then((template) => {
|
|
7
|
-
this.shadow = this.attachShadow({ mode: "open" });
|
|
8
|
-
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
9
|
-
|
|
10
|
-
const inputs = this.shadowRoot.querySelectorAll("input"),
|
|
11
|
-
button = this.shadowRoot.querySelector("button");
|
|
12
|
-
|
|
13
|
-
// iterate over all inputs
|
|
14
|
-
inputs.forEach((input, index1) => {
|
|
15
|
-
input.addEventListener("keyup", (e) => {
|
|
16
|
-
// This code gets the current input element and stores it in the currentInput variable
|
|
17
|
-
// This code gets the next sibling element of the current input element and stores it in the nextInput variable
|
|
18
|
-
// This code gets the previous sibling element of the current input element and stores it in the prevInput variable
|
|
19
|
-
const currentInput = input,
|
|
20
|
-
nextInput = input.nextElementSibling,
|
|
21
|
-
prevInput = input.previousElementSibling;
|
|
22
|
-
|
|
23
|
-
// if the value has more than one character then clear it
|
|
24
|
-
if (currentInput.value.length > 1) {
|
|
25
|
-
currentInput.value = "";
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// if the next input is disabled and the current value is not empty
|
|
29
|
-
// enable the next input and focus on it
|
|
30
|
-
if (
|
|
31
|
-
nextInput &&
|
|
32
|
-
nextInput.hasAttribute("disabled") &&
|
|
33
|
-
currentInput.value !== ""
|
|
34
|
-
) {
|
|
35
|
-
nextInput.removeAttribute("disabled");
|
|
36
|
-
nextInput.focus();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// if the backspace key is pressed
|
|
40
|
-
if (e.key === "Backspace") {
|
|
41
|
-
// iterate over all inputs again
|
|
42
|
-
inputs.forEach((input, index2) => {
|
|
43
|
-
// if the index1 of the current input is less than or equal to the index2 of the input in the outer loop
|
|
44
|
-
// and the previous element exists, set the disabled attribute on the input and focus on the previous element
|
|
45
|
-
if (index1 <= index2 && prevInput) {
|
|
46
|
-
input.setAttribute("disabled", true);
|
|
47
|
-
input.value = "";
|
|
48
|
-
prevInput.focus();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
//if the fourth input( which index number is 3) is not empty and has not disable attribute then
|
|
53
|
-
//add active class if not then remove the active class.
|
|
54
|
-
if (!inputs[5].disabled && inputs[5].value !== "") {
|
|
55
|
-
button.classList.add("active");
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
button.classList.remove("active");
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
//focus the first input which index is 0 on window load
|
|
63
|
-
window.addEventListener("load", () => inputs[0].focus());
|
|
64
|
-
|
|
65
|
-
slice.controller.registerComponent(this);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
show() {
|
|
70
|
-
document.body.appendChild(this);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
getSubmitButton() {
|
|
74
|
-
return this.shadowRoot.querySelector("button");
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
getCode() {
|
|
78
|
-
let code = "";
|
|
79
|
-
const inputs = this.shadowRoot.querySelectorAll("input");
|
|
80
|
-
inputs.forEach((input) => {
|
|
81
|
-
code += input.value;
|
|
82
|
-
});
|
|
83
|
-
return code;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
window.customElements.define("my-button", Button);
|