slicejs-web-framework 1.0.19 → 1.0.21
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/Slice/Components/Structural/Debugger/Debugger.js +3 -3
- package/Slice/Slice.js +2 -1
- package/package.json +1 -1
- package/src/Components/AppComponents/HomePage/HomePage.css +203 -0
- package/src/Components/AppComponents/HomePage/HomePage.html +49 -0
- package/src/Components/AppComponents/HomePage/HomePage.js +196 -0
- package/src/Components/AppComponents/Playground/Playground.js +0 -15
- package/src/Components/components.js +2 -24
- package/src/routes.js +4 -86
- package/src/sliceConfig.json +0 -3
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +0 -16
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +0 -22
- package/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +0 -102
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +0 -15
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +0 -38
- package/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +0 -113
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +0 -21
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +0 -35
- package/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +0 -103
- package/src/Components/AppComponents/Documentation/Documentation.css +0 -0
- package/src/Components/AppComponents/Documentation/Documentation.html +0 -30
- package/src/Components/AppComponents/Documentation/Documentation.js +0 -75
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +0 -62
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
- package/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +0 -283
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +0 -41
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +0 -95
- package/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +0 -315
- package/src/Components/AppComponents/Installation/Installation.css +0 -185
- package/src/Components/AppComponents/Installation/Installation.html +0 -102
- package/src/Components/AppComponents/Installation/Installation.js +0 -61
- package/src/Components/AppComponents/LandingMenu/LandingMenu.css +0 -108
- package/src/Components/AppComponents/LandingMenu/LandingMenu.html +0 -16
- package/src/Components/AppComponents/LandingMenu/LandingMenu.js +0 -33
- package/src/Components/AppComponents/LandingPage/LandingPage.css +0 -14
- package/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
- package/src/Components/AppComponents/LandingPage/LandingPage.js +0 -53
- package/src/Components/AppComponents/MainMenu/MainMenu.css +0 -80
- package/src/Components/AppComponents/MainMenu/MainMenu.html +0 -39
- package/src/Components/AppComponents/MainMenu/MainMenu.js +0 -42
- package/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
- package/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
- package/src/Components/AppComponents/MyLayout/MyLayout.js +0 -13
- package/src/Components/AppComponents/MyNavigation/MyNavigation.css +0 -49
- package/src/Components/AppComponents/MyNavigation/MyNavigation.html +0 -1
- package/src/Components/AppComponents/MyNavigation/MyNavigation.js +0 -60
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.css +0 -89
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.html +0 -108
- package/src/Components/AppComponents/RoutingDocumentation/RoutingDocumentation.js +0 -177
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.css +0 -82
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.html +0 -74
- package/src/Components/AppComponents/ServiceDocumentation/ServiceDocumentation.js +0 -416
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.css +0 -56
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.html +0 -28
- package/src/Components/AppComponents/SliceStylesDocumentation/SliceStylesDocumentation.js +0 -134
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +0 -104
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +0 -12
- package/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +0 -74
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.css +0 -72
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.html +0 -98
- package/src/Components/AppComponents/StructuralDocumentation/StructuralDocumentation.js +0 -219
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +0 -21
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +0 -35
- package/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +0 -103
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.css +0 -296
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.html +0 -89
- package/src/Components/AppComponents/TheBuildMethod/TheBuildMethod.js +0 -86
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +0 -208
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +0 -18
- package/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +0 -111
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.css +0 -61
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.html +0 -80
- package/src/Components/AppComponents/ThemesDocumentation/ThemesDocumentation.js +0 -149
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.css +0 -70
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.html +0 -67
- package/src/Components/AppComponents/VisualDocumentation/VisualDocumentation.js +0 -193
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -475
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +0 -389
- package/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +0 -95
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.css +0 -0
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.html +0 -0
- /package/src/Components/{AppComponents → Visual}/CodeVisualizer/CodeVisualizer.js +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<h1 id="sliceButton">Slice Button</h1>
|
|
2
|
-
<div class="myButton">
|
|
3
|
-
<p>
|
|
4
|
-
To build a simple Slice Button you only need to use the "slice.build"
|
|
5
|
-
method, just like that you have a Slice Button that you can customize with a
|
|
6
|
-
value prop.
|
|
7
|
-
</p>
|
|
8
|
-
</div>
|
|
9
|
-
<div class="colorButton">
|
|
10
|
-
<h2 id="customization">Customization</h2>
|
|
11
|
-
<p>
|
|
12
|
-
You can also cutomize your Slice Button specifying it's background color
|
|
13
|
-
with "customColor.button" and it's font color with "customColor.label".
|
|
14
|
-
</p>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="onClick">
|
|
17
|
-
<h2 id="onClickCallback">onClickCallback</h2>
|
|
18
|
-
<p>
|
|
19
|
-
At last but not least you can add a function to your button with the prop
|
|
20
|
-
"onClickCallback".
|
|
21
|
-
</p>
|
|
22
|
-
</div>
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
export default class ButtonDocumentation extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
slice.controller.setComponentProps(this, props);
|
|
7
|
-
this.debuggerProps = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async init() {
|
|
11
|
-
const grid = await slice.build('Grid', { columns: 2, rows: 1 });
|
|
12
|
-
grid.classList.add('buttonsGrid');
|
|
13
|
-
|
|
14
|
-
const simpleButton = await this.createButton(null, {});
|
|
15
|
-
const myButton = await this.createButton(
|
|
16
|
-
null,
|
|
17
|
-
{
|
|
18
|
-
value: 'Slice Button',
|
|
19
|
-
},
|
|
20
|
-
`{
|
|
21
|
-
value: "Slice Button",
|
|
22
|
-
}`
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
if (window.screen.width <= 770) {
|
|
26
|
-
grid.columns = 1;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
await grid.setItem(simpleButton);
|
|
30
|
-
await grid.setItem(myButton);
|
|
31
|
-
|
|
32
|
-
this.querySelector('.myButton').appendChild(grid);
|
|
33
|
-
|
|
34
|
-
await this.createButton(
|
|
35
|
-
this.querySelector('.colorButton'),
|
|
36
|
-
{
|
|
37
|
-
value: 'Color Button',
|
|
38
|
-
customColor: { label: 'black', button: 'red' },
|
|
39
|
-
},
|
|
40
|
-
`{
|
|
41
|
-
value: "Color Button",
|
|
42
|
-
customColor: { label: "black", button: "red" },
|
|
43
|
-
}`
|
|
44
|
-
);
|
|
45
|
-
const clickButton = await this.createButton(
|
|
46
|
-
this.querySelector('.onClick'),
|
|
47
|
-
{
|
|
48
|
-
value: 'Click',
|
|
49
|
-
onClickCallback: () => {
|
|
50
|
-
if (clickButton.value === 'Click') {
|
|
51
|
-
clickButton.value = 'Clicked';
|
|
52
|
-
} else {
|
|
53
|
-
clickButton.value = 'Click';
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
`{
|
|
58
|
-
value: "Click",
|
|
59
|
-
onClickCallback: () => {
|
|
60
|
-
if (myButton.value === "Click") {
|
|
61
|
-
myButton.value = "Clicked";
|
|
62
|
-
} else {
|
|
63
|
-
myButton.value = "Click";
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
}`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async createButton(appendTo, buttonProps, codeProps) {
|
|
71
|
-
if (!codeProps) {
|
|
72
|
-
codeProps = '{}';
|
|
73
|
-
}
|
|
74
|
-
const myButton = await slice.build('Button', buttonProps);
|
|
75
|
-
|
|
76
|
-
const componentCode = await slice.build('CodeVisualizer', {
|
|
77
|
-
value: `const myButton = await slice.build("Button", ${codeProps});
|
|
78
|
-
|
|
79
|
-
`,
|
|
80
|
-
language: 'javascript',
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
const div = document.createElement('div');
|
|
84
|
-
const buttonDiv = document.createElement('div');
|
|
85
|
-
buttonDiv.classList.add('buttons');
|
|
86
|
-
buttonDiv.appendChild(myButton);
|
|
87
|
-
div.classList.add('buttonsContainer');
|
|
88
|
-
div.appendChild(buttonDiv);
|
|
89
|
-
div.appendChild(componentCode);
|
|
90
|
-
|
|
91
|
-
if (appendTo) {
|
|
92
|
-
appendTo.appendChild(div);
|
|
93
|
-
}
|
|
94
|
-
if (buttonProps.onClickCallback) {
|
|
95
|
-
return myButton;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return div;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
customElements.define('slice-buttondocumentation', ButtonDocumentation);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--cards-padding: 30%;
|
|
3
|
-
}
|
|
4
|
-
.cards {
|
|
5
|
-
padding-left: var(--cards-padding);
|
|
6
|
-
padding-right: var(--cards-padding);
|
|
7
|
-
margin-top: 50px;
|
|
8
|
-
margin-bottom: 50px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@media only screen and (max-width: 770px) {
|
|
12
|
-
:root {
|
|
13
|
-
--cards-padding: 20px;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<h1 id="sliceCard">Slice Card</h1>
|
|
2
|
-
<div class="sliceCard">
|
|
3
|
-
<p>
|
|
4
|
-
When building a "Card" component, by default it's created with the Slice
|
|
5
|
-
logo, and with a default title and text.
|
|
6
|
-
</p>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="myCard">
|
|
9
|
-
<h2 id="myCard">Title and Text</h2>
|
|
10
|
-
<p>
|
|
11
|
-
To build your own Slice Card with your information it's as simple as just
|
|
12
|
-
adding "title" and "text" props to your component.
|
|
13
|
-
</p>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="cardClick">
|
|
16
|
-
<h2 id="cardClick">Click Event | "isOpen" prop</h2>
|
|
17
|
-
<p>
|
|
18
|
-
The Slice Card component has an click eventListener. While the card is
|
|
19
|
-
uncovered and shows the information inside, it's cover can be clicked to
|
|
20
|
-
keep open. Changing it's "isOpen" prop to true. That same eventListener can
|
|
21
|
-
change it back to false, and cover up the card again.
|
|
22
|
-
</p>
|
|
23
|
-
</div>
|
|
24
|
-
<h1 id="customization">Customization</h1>
|
|
25
|
-
<div class="cardIcon">
|
|
26
|
-
<h2 id="icon">Icon</h2>
|
|
27
|
-
<p>
|
|
28
|
-
You can start your Slice Card customization by assignin another icon to it.
|
|
29
|
-
</p>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="cardColor">
|
|
32
|
-
<h2 id="customColor">Custom Color</h2>
|
|
33
|
-
<p>
|
|
34
|
-
You can also change card color by using "customColor" props, using
|
|
35
|
-
"customColor.card" to change it's background, and "customColor.icon" to
|
|
36
|
-
change the icon's color.
|
|
37
|
-
</p>
|
|
38
|
-
</div>
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
export default class CardDocumentation extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
slice.controller.setComponentProps(this, props);
|
|
7
|
-
this.debuggerProps = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async init() {
|
|
11
|
-
await this.createCard(this.querySelector('.sliceCard'), {});
|
|
12
|
-
await this.createCard(
|
|
13
|
-
this.querySelector('.myCard'),
|
|
14
|
-
{
|
|
15
|
-
title: 'My Slice Card',
|
|
16
|
-
text: "My Slice Card's information.",
|
|
17
|
-
},
|
|
18
|
-
`{
|
|
19
|
-
title: "My Slice Card",
|
|
20
|
-
text: "My Slice Card's information.",
|
|
21
|
-
}`
|
|
22
|
-
);
|
|
23
|
-
await this.createCard(
|
|
24
|
-
this.querySelector('.cardClick'),
|
|
25
|
-
{
|
|
26
|
-
title: 'Uncover Slice Card',
|
|
27
|
-
text: 'isOpen is true.',
|
|
28
|
-
isOpen: true,
|
|
29
|
-
},
|
|
30
|
-
`{
|
|
31
|
-
title: "Uncover Slice Card",
|
|
32
|
-
text: "isOpen is true",
|
|
33
|
-
isOpen: true
|
|
34
|
-
}`
|
|
35
|
-
);
|
|
36
|
-
await this.createCard(
|
|
37
|
-
this.querySelector('.cardIcon'),
|
|
38
|
-
{
|
|
39
|
-
title: 'Discord',
|
|
40
|
-
text: 'This card has Discord Icon.',
|
|
41
|
-
icon: {
|
|
42
|
-
name: 'discord',
|
|
43
|
-
iconStyle: 'filled',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
`{
|
|
47
|
-
title: "Discord",
|
|
48
|
-
text: "This card has Discord Icon.",
|
|
49
|
-
icon: {
|
|
50
|
-
name: "discord",
|
|
51
|
-
iconStyle: "filled",
|
|
52
|
-
}
|
|
53
|
-
}`
|
|
54
|
-
);
|
|
55
|
-
await this.createCard(
|
|
56
|
-
this.querySelector('.cardColor'),
|
|
57
|
-
{
|
|
58
|
-
title: 'Github',
|
|
59
|
-
text: 'This card has customized colors.',
|
|
60
|
-
icon: {
|
|
61
|
-
name: 'github',
|
|
62
|
-
iconStyle: 'filled',
|
|
63
|
-
},
|
|
64
|
-
customColor: {
|
|
65
|
-
card: 'darkblue',
|
|
66
|
-
icon: 'white',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
`{
|
|
70
|
-
title: "Github",
|
|
71
|
-
text: "This card has customized colors.",
|
|
72
|
-
icon: {
|
|
73
|
-
name: "github",
|
|
74
|
-
iconStyle: "filled",
|
|
75
|
-
},
|
|
76
|
-
customColor: {
|
|
77
|
-
card: "darkblue",
|
|
78
|
-
icon: "white",
|
|
79
|
-
},
|
|
80
|
-
}`
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async createCard(appendTo, cardProps, codeProps) {
|
|
85
|
-
if (!codeProps) {
|
|
86
|
-
codeProps = '{}';
|
|
87
|
-
}
|
|
88
|
-
const myCard = await slice.build('Card', cardProps);
|
|
89
|
-
|
|
90
|
-
const componentCode = await slice.build('CodeVisualizer', {
|
|
91
|
-
value: `const myCard = await slice.build("Card", ${codeProps});
|
|
92
|
-
|
|
93
|
-
`,
|
|
94
|
-
language: 'javascript',
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
const div = document.createElement('div');
|
|
98
|
-
const cardDiv = document.createElement('div');
|
|
99
|
-
cardDiv.classList.add('cards');
|
|
100
|
-
cardDiv.appendChild(myCard);
|
|
101
|
-
div.classList.add('cards_container');
|
|
102
|
-
div.appendChild(cardDiv);
|
|
103
|
-
div.appendChild(componentCode);
|
|
104
|
-
|
|
105
|
-
if (appendTo) {
|
|
106
|
-
appendTo.appendChild(div);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return div;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
customElements.define('slice-carddocumentation', CardDocumentation);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.checkboxs {
|
|
2
|
-
width: 100%;
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: row;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
}
|
|
8
|
-
.labelCheckbox {
|
|
9
|
-
display: grid;
|
|
10
|
-
align-items: end;
|
|
11
|
-
grid-template-columns: repeat(2, 1fr);
|
|
12
|
-
grid-template-rows: repeat(1, 1fr);
|
|
13
|
-
gap: 10px;
|
|
14
|
-
margin: 0 auto;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@media only screen and (max-width: 770px) {
|
|
18
|
-
.labelCheckbox {
|
|
19
|
-
grid-template-columns: repeat(1, 1fr);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<h1 id="sliceCheckbox">Slice CheckBox</h1>
|
|
2
|
-
<div class="myCheckbox">
|
|
3
|
-
<p>This is a Slice Checkbox.</p>
|
|
4
|
-
</div>
|
|
5
|
-
<div class="colorCheckbox">
|
|
6
|
-
<h2 id="customColor">Custom color</h2>
|
|
7
|
-
<p>
|
|
8
|
-
You cand customize your Slice Checkbox by changing it's color with the color
|
|
9
|
-
prop
|
|
10
|
-
</p>
|
|
11
|
-
</div>
|
|
12
|
-
<h1 id="label">Label</h1>
|
|
13
|
-
<div class="label">
|
|
14
|
-
<p>You can set a label to your checkbox.</p>
|
|
15
|
-
</div>
|
|
16
|
-
<h2 id="labelPlacement">Label Placement</h2>
|
|
17
|
-
<p>You can also set in wich position to put the label to.</p>
|
|
18
|
-
<div class="labelCheckbox">
|
|
19
|
-
<div class="labelLeft">
|
|
20
|
-
<h2>Left</h2>
|
|
21
|
-
<p>This label is positioned at left.</p>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="labelTop">
|
|
24
|
-
<h2>Top</h2>
|
|
25
|
-
<p>This label is positioned at top.</p>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="labelRight">
|
|
28
|
-
<h2>Right (default)</h2>
|
|
29
|
-
<p>This label is positioned at right.</p>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="labelBottom">
|
|
32
|
-
<h2>Bottom</h2>
|
|
33
|
-
<p>This label is positioned at bottom.</p>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
export default class CheckboxDocumentation extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
slice.controller.setComponentProps(this, props);
|
|
7
|
-
this.debuggerProps = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async init() {
|
|
11
|
-
await this.createCheckbox(this.querySelector('.myCheckbox'), {}, `{}`);
|
|
12
|
-
await this.createCheckbox(
|
|
13
|
-
this.querySelector('.colorCheckbox'),
|
|
14
|
-
{ customColor: 'gold' },
|
|
15
|
-
`{
|
|
16
|
-
customColor: "gold"
|
|
17
|
-
}`
|
|
18
|
-
);
|
|
19
|
-
await this.createCheckbox(
|
|
20
|
-
this.querySelector('.label'),
|
|
21
|
-
{
|
|
22
|
-
label: 'Checkbox',
|
|
23
|
-
},
|
|
24
|
-
`{
|
|
25
|
-
label: "Checkbox",
|
|
26
|
-
}`
|
|
27
|
-
);
|
|
28
|
-
await this.createCheckbox(
|
|
29
|
-
this.querySelector('.labelLeft'),
|
|
30
|
-
{
|
|
31
|
-
label: 'Left',
|
|
32
|
-
labelPlacement: 'left',
|
|
33
|
-
},
|
|
34
|
-
`{
|
|
35
|
-
label: "Left",
|
|
36
|
-
labelPlacement: "left",
|
|
37
|
-
}`
|
|
38
|
-
);
|
|
39
|
-
await this.createCheckbox(
|
|
40
|
-
this.querySelector('.labelTop'),
|
|
41
|
-
{
|
|
42
|
-
label: 'Top',
|
|
43
|
-
labelPlacement: 'top',
|
|
44
|
-
},
|
|
45
|
-
`{
|
|
46
|
-
label: "Top",
|
|
47
|
-
labelPlacement: "top",
|
|
48
|
-
}`
|
|
49
|
-
);
|
|
50
|
-
await this.createCheckbox(
|
|
51
|
-
this.querySelector('.labelRight'),
|
|
52
|
-
{
|
|
53
|
-
label: 'Right',
|
|
54
|
-
labelPlacement: 'right',
|
|
55
|
-
},
|
|
56
|
-
`{
|
|
57
|
-
label: "Right",
|
|
58
|
-
labelPlacement: "right",
|
|
59
|
-
}`
|
|
60
|
-
);
|
|
61
|
-
await this.createCheckbox(
|
|
62
|
-
this.querySelector('.labelBottom'),
|
|
63
|
-
{
|
|
64
|
-
label: 'Bottom',
|
|
65
|
-
labelPlacement: 'bottom',
|
|
66
|
-
},
|
|
67
|
-
`{
|
|
68
|
-
label: "Bottom",
|
|
69
|
-
labelPlacement: "bottom",
|
|
70
|
-
}`
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
async createCheckbox(appendTo, checkboxProps, codeProps) {
|
|
75
|
-
if (!codeProps) {
|
|
76
|
-
codeProps = '{}';
|
|
77
|
-
}
|
|
78
|
-
const myCheckbox = await slice.build('Checkbox', checkboxProps);
|
|
79
|
-
|
|
80
|
-
const componentCode = await slice.build('CodeVisualizer', {
|
|
81
|
-
value: `const myCheckbox = await slice.build("Checkbox", ${codeProps});
|
|
82
|
-
|
|
83
|
-
`,
|
|
84
|
-
language: 'javascript',
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
const div = document.createElement('div');
|
|
88
|
-
const checkboxDiv = document.createElement('div');
|
|
89
|
-
checkboxDiv.classList.add('checkboxs');
|
|
90
|
-
checkboxDiv.appendChild(myCheckbox);
|
|
91
|
-
div.classList.add('checkboxs_container');
|
|
92
|
-
div.appendChild(checkboxDiv);
|
|
93
|
-
div.appendChild(componentCode);
|
|
94
|
-
|
|
95
|
-
if (appendTo) {
|
|
96
|
-
appendTo.appendChild(div);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return div;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
customElements.define('slice-checkboxdocumentation', CheckboxDocumentation);
|
|
File without changes
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<h1>Slice Documentation</h1>
|
|
2
|
-
<p>
|
|
3
|
-
The Slice Framework is a modular system based on components, designed to simplify web client development. Its architecture allows functionality to be divided into reusable modules, making maintenance and expansion easier.
|
|
4
|
-
</p>
|
|
5
|
-
<p>
|
|
6
|
-
Components are classified into three main categories: <span>Visual</span>, <span>Structural</span>, and <span>Services</span>. Visual components build the user interface, structural components manage the framework’s core infrastructure, and service components handle business logic and integrations.
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
<div class="visualComponents">
|
|
10
|
-
<h2>Visual Components</h2>
|
|
11
|
-
<p>
|
|
12
|
-
These components define the web client interface using custom HTML tags powered by the Web Components API. They encapsulate logic for dynamic styling, UI interactions, and backend communication via HTTP requests.
|
|
13
|
-
</p>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<div class="structuralComponents">
|
|
17
|
-
<h2>Structural Components</h2>
|
|
18
|
-
<p>
|
|
19
|
-
Structural components provide the core framework infrastructure, managing instances, tracking activities, and optimizing performance. They ensure seamless control over application behavior and debugging.
|
|
20
|
-
</p>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div class="serviceComponents">
|
|
24
|
-
<h2>Service Components</h2>
|
|
25
|
-
<p>
|
|
26
|
-
Services encapsulate business logic and facilitate integrations with technologies like HTTP requests, local storage, and IndexedDB. They promote code reusability and simplify application development.
|
|
27
|
-
</p>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div class="qna"></div>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export default class Documentation extends HTMLElement {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
super();
|
|
4
|
-
slice.attachTemplate(this);
|
|
5
|
-
|
|
6
|
-
slice.controller.setComponentProps(this, props);
|
|
7
|
-
this.debuggerProps = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async init() {
|
|
11
|
-
const htmlCard = await slice.build('Card', {
|
|
12
|
-
title: 'HTML',
|
|
13
|
-
text: 'HyperText Markup Language is the most basic building block of the Web. It defines the meaning and structure of web content.',
|
|
14
|
-
icon: {
|
|
15
|
-
name: 'html',
|
|
16
|
-
iconStyle: 'filled',
|
|
17
|
-
},
|
|
18
|
-
customColor: {
|
|
19
|
-
card: '#E36A2F',
|
|
20
|
-
icon: 'white',
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
const jsCard = await slice.build('Card', {
|
|
24
|
-
title: 'JS',
|
|
25
|
-
text: 'JavaScript is a lightweight interpreted (or just-in-time compiled) programming language with first-class functions.',
|
|
26
|
-
icon: {
|
|
27
|
-
name: 'javascript',
|
|
28
|
-
iconStyle: 'filled',
|
|
29
|
-
},
|
|
30
|
-
customColor: {
|
|
31
|
-
card: 'gold',
|
|
32
|
-
icon: 'white',
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
const cssCard = await slice.build('Card', {
|
|
36
|
-
title: 'CSS',
|
|
37
|
-
text: 'Cascading Style Sheets is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS describes how elements should be rendered on screen, on paper, in speech, or on other media.',
|
|
38
|
-
icon: {
|
|
39
|
-
name: 'css',
|
|
40
|
-
iconStyle: 'filled',
|
|
41
|
-
},
|
|
42
|
-
customColor: {
|
|
43
|
-
card: '#519ABA',
|
|
44
|
-
icon: 'white',
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
const grid = await slice.build('Grid', {
|
|
48
|
-
columns: 3,
|
|
49
|
-
rows: 1,
|
|
50
|
-
items: [htmlCard, jsCard, cssCard],
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
if (window.screen.width <= 770) {
|
|
54
|
-
grid.columns = 1;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
this.querySelector('.visualComponents').appendChild(grid);
|
|
58
|
-
|
|
59
|
-
//Q & A
|
|
60
|
-
const buildQuestion = await slice.build('Details', {
|
|
61
|
-
title: 'How can i build a component?',
|
|
62
|
-
text: "To build a component you need to call the slice.build method with it's required props.",
|
|
63
|
-
});
|
|
64
|
-
const buildExample = await slice.build('CodeVisualizer', {
|
|
65
|
-
value: `const mySliceComponent = await slice.build("MySliceComponentName", props)`,
|
|
66
|
-
language: 'javascript',
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
buildQuestion.addDetail(buildExample);
|
|
70
|
-
|
|
71
|
-
this.querySelector('.qna').appendChild(buildQuestion);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
customElements.define('slice-documentation', Documentation);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
.visualComponents p span {
|
|
2
|
-
color: var(--primary-color);
|
|
3
|
-
}
|
|
4
|
-
:root {
|
|
5
|
-
--docs-width: 64%;
|
|
6
|
-
}
|
|
7
|
-
slice-documentation-page slice-route,
|
|
8
|
-
slice-documentation-page slice-multi-route {
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
slice-mainmenu{
|
|
14
|
-
position: fixed;
|
|
15
|
-
top: 0;
|
|
16
|
-
left: 0;
|
|
17
|
-
font-family: var(--font-family);
|
|
18
|
-
background-color: var(--primary-background-color);
|
|
19
|
-
border-right: 1px solid var(--primary-color-shade);
|
|
20
|
-
/* box-shadow: 10px 0 10px 0px #00000020; */
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
height: 100%;
|
|
24
|
-
width: 17%;
|
|
25
|
-
transition: transform 0.3s ease, width 0.3s ease;
|
|
26
|
-
overflow-x: hidden;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
p {
|
|
30
|
-
text-align: justify;
|
|
31
|
-
}
|
|
32
|
-
h1 {
|
|
33
|
-
padding-top: 10px;
|
|
34
|
-
padding-bottom: 10px;
|
|
35
|
-
border-bottom: 1px solid var(--secondary-background-color);
|
|
36
|
-
}
|
|
37
|
-
h2 {
|
|
38
|
-
padding-top: 10px;
|
|
39
|
-
}
|
|
40
|
-
.grid-container {
|
|
41
|
-
overflow-x: auto;
|
|
42
|
-
}
|
|
43
|
-
@media only screen and (max-width: 770px) {
|
|
44
|
-
:root {
|
|
45
|
-
--docs-width: 100%;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
* {
|
|
49
|
-
font-family: var(--font-family);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
slice-multi-route > :first-child {
|
|
53
|
-
margin-top: 60px;
|
|
54
|
-
color: var(--font-primary-color);
|
|
55
|
-
margin-top: 60px;
|
|
56
|
-
overflow-y: scroll;
|
|
57
|
-
overflow-x: hidden;
|
|
58
|
-
width: var(--docs-width);
|
|
59
|
-
padding-left: 10px;
|
|
60
|
-
padding-right: 10px;
|
|
61
|
-
padding-bottom: 25px;
|
|
62
|
-
}
|
|
File without changes
|