slicejs-cli 2.0.3 → 2.0.6
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/ProjectTemplate/api/index.js +97 -0
- package/ProjectTemplate/src/App/index.html +22 -0
- package/ProjectTemplate/src/App/index.js +63 -0
- package/ProjectTemplate/src/App/style.css +40 -0
- package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +16 -0
- package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +22 -0
- package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +102 -0
- package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +15 -0
- package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +38 -0
- package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +113 -0
- package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +21 -0
- package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +35 -0
- package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +103 -0
- package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.css +14 -0
- package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.html +3 -0
- package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.js +45 -0
- package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.css +0 -0
- package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.html +30 -0
- package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.js +75 -0
- package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +62 -0
- package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
- package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +241 -0
- package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +41 -0
- package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +95 -0
- package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +315 -0
- package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.css +108 -0
- package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.html +16 -0
- package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.js +33 -0
- package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.css +14 -0
- package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
- package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.js +53 -0
- package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.css +80 -0
- package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.html +39 -0
- package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.js +42 -0
- package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
- package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
- package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.js +13 -0
- package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.css +49 -0
- package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.html +1 -0
- package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.js +60 -0
- package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.css +12 -0
- package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.html +0 -0
- package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.js +126 -0
- package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +104 -0
- package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +12 -0
- package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +74 -0
- package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +21 -0
- package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +35 -0
- package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +103 -0
- package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +23 -0
- package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +6 -0
- package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +129 -0
- package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -0
- package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +7 -0
- package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +15 -0
- package/ProjectTemplate/src/Components/Service/FetchManager/FetchManager.js +133 -0
- package/ProjectTemplate/src/Components/Service/IndexedDbManager/IndexedDbManager.js +141 -0
- package/ProjectTemplate/src/Components/Service/Link/Link.js +26 -0
- package/ProjectTemplate/src/Components/Visual/Button/Button.css +47 -0
- package/ProjectTemplate/src/Components/Visual/Button/Button.html +5 -0
- package/ProjectTemplate/src/Components/Visual/Button/Button.js +70 -0
- package/ProjectTemplate/src/Components/Visual/Card/Card.css +68 -0
- package/ProjectTemplate/src/Components/Visual/Card/Card.html +7 -0
- package/ProjectTemplate/src/Components/Visual/Card/Card.js +107 -0
- package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.css +87 -0
- package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.html +8 -0
- package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.js +86 -0
- package/ProjectTemplate/src/Components/Visual/Details/Details.css +70 -0
- package/ProjectTemplate/src/Components/Visual/Details/Details.html +9 -0
- package/ProjectTemplate/src/Components/Visual/Details/Details.js +76 -0
- package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.css +60 -0
- package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.html +5 -0
- package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.js +63 -0
- package/ProjectTemplate/src/Components/Visual/Grid/Grid.css +7 -0
- package/ProjectTemplate/src/Components/Visual/Grid/Grid.html +1 -0
- package/ProjectTemplate/src/Components/Visual/Grid/Grid.js +57 -0
- package/ProjectTemplate/src/Components/Visual/Icon/Icon.css +510 -0
- package/ProjectTemplate/src/Components/Visual/Icon/Icon.html +1 -0
- package/ProjectTemplate/src/Components/Visual/Icon/Icon.js +89 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.eot +0 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.json +555 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.styl +507 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.svg +1485 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.symbol.svg +1059 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.ttf +0 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.woff +0 -0
- package/ProjectTemplate/src/Components/Visual/Icon/slc.woff2 +0 -0
- package/ProjectTemplate/src/Components/Visual/Input/Input.css +91 -0
- package/ProjectTemplate/src/Components/Visual/Input/Input.html +4 -0
- package/ProjectTemplate/src/Components/Visual/Input/Input.js +215 -0
- package/ProjectTemplate/src/Components/Visual/Layout/Layout.css +0 -0
- package/ProjectTemplate/src/Components/Visual/Layout/Layout.html +0 -0
- package/ProjectTemplate/src/Components/Visual/Layout/Layout.js +49 -0
- package/ProjectTemplate/src/Components/Visual/Loading/Loading.css +56 -0
- package/ProjectTemplate/src/Components/Visual/Loading/Loading.html +83 -0
- package/ProjectTemplate/src/Components/Visual/Loading/Loading.js +38 -0
- package/ProjectTemplate/src/Components/Visual/MultiRoute/MultiRoute.js +93 -0
- package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.css +115 -0
- package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.html +44 -0
- package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.js +141 -0
- package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.css +117 -0
- package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.html +24 -0
- package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.js +16 -0
- package/ProjectTemplate/src/Components/Visual/Route/Route.js +93 -0
- package/ProjectTemplate/src/Components/Visual/Select/Select.css +84 -0
- package/ProjectTemplate/src/Components/Visual/Select/Select.html +8 -0
- package/ProjectTemplate/src/Components/Visual/Select/Select.js +195 -0
- package/ProjectTemplate/src/Components/Visual/Switch/Switch.css +76 -0
- package/ProjectTemplate/src/Components/Visual/Switch/Switch.html +8 -0
- package/ProjectTemplate/src/Components/Visual/Switch/Switch.js +102 -0
- package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.css +36 -0
- package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.html +1 -0
- package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.js +126 -0
- package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.css +8 -0
- package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.html +1 -0
- package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.js +48 -0
- package/ProjectTemplate/src/Components/components.js +42 -0
- package/ProjectTemplate/src/Styles/sliceStyles.css +34 -0
- package/ProjectTemplate/src/Themes/Dark.css +42 -0
- package/ProjectTemplate/src/Themes/Light.css +31 -0
- package/ProjectTemplate/src/Themes/Slice.css +47 -0
- package/ProjectTemplate/src/images/Slice.js-logo.png +0 -0
- package/ProjectTemplate/src/images/favicon.ico +0 -0
- package/ProjectTemplate/src/images/im2/Slice.js-logo.png +0 -0
- package/ProjectTemplate/src/routes.js +36 -0
- package/ProjectTemplate/src/sliceConfig.json +58 -0
- package/package.json +2 -2
- package/post.js +5 -2
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
export default class InputDocumentation 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.createInput(this.querySelector('.myInput'), {});
|
|
12
|
+
//Props
|
|
13
|
+
await this.createInput(
|
|
14
|
+
this.querySelector('.inputPlaceholder'),
|
|
15
|
+
{ placeholder: 'Enter text here' },
|
|
16
|
+
`{
|
|
17
|
+
placeholder: "Enter text here"
|
|
18
|
+
}`
|
|
19
|
+
);
|
|
20
|
+
await this.createInput(
|
|
21
|
+
this.querySelector('.requiredProp'),
|
|
22
|
+
{
|
|
23
|
+
placeholder: 'Enter text here',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
`{
|
|
27
|
+
placeholder: "Enter text here",
|
|
28
|
+
required: true
|
|
29
|
+
}`
|
|
30
|
+
);
|
|
31
|
+
await this.createInput(
|
|
32
|
+
this.querySelector('.disabledProp'),
|
|
33
|
+
{
|
|
34
|
+
placeholder: 'Enter text here',
|
|
35
|
+
disabled: true,
|
|
36
|
+
},
|
|
37
|
+
`{
|
|
38
|
+
placeholder: "Enter text here",
|
|
39
|
+
disabled: true
|
|
40
|
+
}`
|
|
41
|
+
);
|
|
42
|
+
//Types
|
|
43
|
+
await this.createInput(
|
|
44
|
+
this.querySelector('.typeText'),
|
|
45
|
+
{
|
|
46
|
+
placeholder: 'Enter text here',
|
|
47
|
+
type: 'text',
|
|
48
|
+
},
|
|
49
|
+
`{
|
|
50
|
+
placeholder: "Enter text here",
|
|
51
|
+
type: "text"
|
|
52
|
+
}`
|
|
53
|
+
);
|
|
54
|
+
await this.createInput(
|
|
55
|
+
this.querySelector('.typeNumber'),
|
|
56
|
+
{
|
|
57
|
+
placeholder: 'Enter numbers here',
|
|
58
|
+
type: 'number',
|
|
59
|
+
},
|
|
60
|
+
`{
|
|
61
|
+
placeholder: "Enter numbers here",
|
|
62
|
+
type: "number"
|
|
63
|
+
}`
|
|
64
|
+
);
|
|
65
|
+
await this.createInput(
|
|
66
|
+
this.querySelector('.typePassword'),
|
|
67
|
+
{
|
|
68
|
+
placeholder: 'Password',
|
|
69
|
+
type: 'password',
|
|
70
|
+
},
|
|
71
|
+
`{
|
|
72
|
+
placeholder: "Password",
|
|
73
|
+
type: "password"
|
|
74
|
+
}`
|
|
75
|
+
);
|
|
76
|
+
await this.createInput(
|
|
77
|
+
this.querySelector('.secretProp'),
|
|
78
|
+
{
|
|
79
|
+
placeholder: 'Password',
|
|
80
|
+
type: 'password',
|
|
81
|
+
secret: true,
|
|
82
|
+
},
|
|
83
|
+
`{
|
|
84
|
+
placeholder: "Password",
|
|
85
|
+
type: "password",
|
|
86
|
+
secret: true
|
|
87
|
+
}`
|
|
88
|
+
);
|
|
89
|
+
await this.createInput(
|
|
90
|
+
this.querySelector('.emailType'),
|
|
91
|
+
{ placeholder: 'Email', type: 'email' },
|
|
92
|
+
`{
|
|
93
|
+
placeholder: "Email",
|
|
94
|
+
type: "email"
|
|
95
|
+
}`
|
|
96
|
+
);
|
|
97
|
+
await this.createInput(
|
|
98
|
+
this.querySelector('.dateType'),
|
|
99
|
+
{ placeholder: 'Date', type: 'date' },
|
|
100
|
+
`{
|
|
101
|
+
placeholder: "Date",
|
|
102
|
+
type: "date"
|
|
103
|
+
}`
|
|
104
|
+
);
|
|
105
|
+
const conditionsInput = await this.createInput(
|
|
106
|
+
this.querySelector('.inputConditions'),
|
|
107
|
+
{
|
|
108
|
+
placeholder: 'Password',
|
|
109
|
+
type: 'password',
|
|
110
|
+
secret: true,
|
|
111
|
+
conditions: {
|
|
112
|
+
// regex: "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\W_]).{8,}$",
|
|
113
|
+
minLength: 8,
|
|
114
|
+
maxLength: 10,
|
|
115
|
+
minMinusc: 1,
|
|
116
|
+
maxMinusc: 4,
|
|
117
|
+
minMayusc: 1,
|
|
118
|
+
maxMayusc: 6,
|
|
119
|
+
minNumber: 1,
|
|
120
|
+
maxNumber: 6,
|
|
121
|
+
minSymbol: 1,
|
|
122
|
+
maxSymbol: 10,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
`{
|
|
126
|
+
placeholder: "Password",
|
|
127
|
+
type: "password",
|
|
128
|
+
secret: true,
|
|
129
|
+
conditions: {
|
|
130
|
+
// regex: "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\W_]).{8,}$",
|
|
131
|
+
minLength: 8,
|
|
132
|
+
maxLength: 10,
|
|
133
|
+
minMinusc: 1,
|
|
134
|
+
maxMinusc: 4,
|
|
135
|
+
minMayusc: 1,
|
|
136
|
+
maxMayusc: 6,
|
|
137
|
+
minNumber: 1,
|
|
138
|
+
maxNumber: 6,
|
|
139
|
+
minSymbol: 1,
|
|
140
|
+
maxSymbol: 10,
|
|
141
|
+
},
|
|
142
|
+
}`,
|
|
143
|
+
'Validate Conditions'
|
|
144
|
+
);
|
|
145
|
+
const regexInput = await this.createInput(
|
|
146
|
+
this.querySelector('.inputRegex'),
|
|
147
|
+
{
|
|
148
|
+
placeholder: 'Password with regex',
|
|
149
|
+
type: 'password',
|
|
150
|
+
secret: true,
|
|
151
|
+
conditions: {
|
|
152
|
+
// regex: "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\W_]).{8,}$",
|
|
153
|
+
minLength: 8,
|
|
154
|
+
maxLength: 10,
|
|
155
|
+
minMinusc: 1,
|
|
156
|
+
maxMinusc: 4,
|
|
157
|
+
minMayusc: 1,
|
|
158
|
+
maxMayusc: 6,
|
|
159
|
+
minNumber: 1,
|
|
160
|
+
maxNumber: 6,
|
|
161
|
+
minSymbol: 1,
|
|
162
|
+
maxSymbol: 10,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
`{
|
|
166
|
+
placeholder: "Password with regex",
|
|
167
|
+
type: "password",
|
|
168
|
+
secret: true,
|
|
169
|
+
conditions: {
|
|
170
|
+
regex: "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\W_]).{8,}$",
|
|
171
|
+
// minLength: 8,
|
|
172
|
+
// maxLength: 10,
|
|
173
|
+
// minMinusc: 1,
|
|
174
|
+
// maxMinusc: 4,
|
|
175
|
+
// minMayusc: 1,
|
|
176
|
+
// maxMayusc: 6,
|
|
177
|
+
// minNumber: 1,
|
|
178
|
+
// maxNumber: 6,
|
|
179
|
+
// minSymbol: 1,
|
|
180
|
+
// maxSymbol: 10,
|
|
181
|
+
},
|
|
182
|
+
}`,
|
|
183
|
+
'Validate Regex'
|
|
184
|
+
);
|
|
185
|
+
await this.inputMethos(
|
|
186
|
+
this.querySelector('.inputMethods'),
|
|
187
|
+
{
|
|
188
|
+
placeholder: 'Methods',
|
|
189
|
+
conditions: {
|
|
190
|
+
minLength: 8,
|
|
191
|
+
minNumber: 1,
|
|
192
|
+
minSymbol: 1,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
`{
|
|
196
|
+
placeholder: "Methods",
|
|
197
|
+
conditions: {
|
|
198
|
+
minLength: 8,
|
|
199
|
+
minNumber: 1,
|
|
200
|
+
minSymbol: 1,
|
|
201
|
+
}
|
|
202
|
+
}`
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async createInput(appendTo, inputProps, codeProps, validate) {
|
|
207
|
+
if (!codeProps) {
|
|
208
|
+
codeProps = '{}';
|
|
209
|
+
}
|
|
210
|
+
const myInput = await slice.build('Input', inputProps);
|
|
211
|
+
|
|
212
|
+
const componentCode = await slice.build('CodeVisualizer', {
|
|
213
|
+
value: `const myInput = await slice.build("Input", ${codeProps});
|
|
214
|
+
|
|
215
|
+
`,
|
|
216
|
+
language: 'javascript',
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
const div = document.createElement('div');
|
|
220
|
+
const inputDiv = document.createElement('div');
|
|
221
|
+
inputDiv.classList.add('inputs');
|
|
222
|
+
inputDiv.appendChild(myInput);
|
|
223
|
+
|
|
224
|
+
div.classList.add('inputsContainer');
|
|
225
|
+
div.appendChild(inputDiv);
|
|
226
|
+
if (validate) {
|
|
227
|
+
const validateButton = await slice.build('Button', {
|
|
228
|
+
value: validate,
|
|
229
|
+
onClickCallback: () => {
|
|
230
|
+
myInput.validateValue();
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
div.appendChild(validateButton);
|
|
234
|
+
}
|
|
235
|
+
div.appendChild(componentCode);
|
|
236
|
+
|
|
237
|
+
appendTo.appendChild(div);
|
|
238
|
+
|
|
239
|
+
return myInput;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
async inputMethos(appendTo, inputProps, codeProps) {
|
|
243
|
+
if (!codeProps) {
|
|
244
|
+
codeProps = '{}';
|
|
245
|
+
}
|
|
246
|
+
const myInput = await slice.build('Input', inputProps);
|
|
247
|
+
|
|
248
|
+
const componentCode = await slice.build('CodeVisualizer', {
|
|
249
|
+
value: `const myInput = await slice.build("Input", ${codeProps});
|
|
250
|
+
|
|
251
|
+
myInput.validateValue();
|
|
252
|
+
myInput.clear();
|
|
253
|
+
myInput.triggerError();
|
|
254
|
+
myInput.triggerSuccess();
|
|
255
|
+
|
|
256
|
+
`,
|
|
257
|
+
language: 'javascript',
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
const div = document.createElement('div');
|
|
261
|
+
const inputDiv = document.createElement('div');
|
|
262
|
+
inputDiv.classList.add('inputs');
|
|
263
|
+
inputDiv.appendChild(myInput);
|
|
264
|
+
|
|
265
|
+
div.classList.add('inputsContainer');
|
|
266
|
+
div.appendChild(inputDiv);
|
|
267
|
+
const buttons = document.createElement('div');
|
|
268
|
+
buttons.classList.add('inputButtons');
|
|
269
|
+
const validateButton = await slice.build('Button', {
|
|
270
|
+
value: 'Validate',
|
|
271
|
+
onClickCallback: () => {
|
|
272
|
+
myInput.validateValue();
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
const clearButton = await slice.build('Button', {
|
|
276
|
+
value: 'Clear',
|
|
277
|
+
customColor: {
|
|
278
|
+
button: 'var(--medium-color)',
|
|
279
|
+
},
|
|
280
|
+
onClickCallback: () => {
|
|
281
|
+
myInput.clear();
|
|
282
|
+
},
|
|
283
|
+
});
|
|
284
|
+
const errorButton = await slice.build('Button', {
|
|
285
|
+
value: 'Error',
|
|
286
|
+
customColor: {
|
|
287
|
+
button: 'var(--danger-color)',
|
|
288
|
+
},
|
|
289
|
+
onClickCallback: () => {
|
|
290
|
+
myInput.triggerError();
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
const successButton = await slice.build('Button', {
|
|
294
|
+
value: 'Success',
|
|
295
|
+
customColor: {
|
|
296
|
+
button: 'var(--success-color)',
|
|
297
|
+
},
|
|
298
|
+
onClickCallback: () => {
|
|
299
|
+
myInput.triggerSuccess();
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
buttons.appendChild(validateButton);
|
|
303
|
+
buttons.appendChild(clearButton);
|
|
304
|
+
buttons.appendChild(errorButton);
|
|
305
|
+
buttons.appendChild(successButton);
|
|
306
|
+
div.appendChild(buttons);
|
|
307
|
+
div.appendChild(componentCode);
|
|
308
|
+
|
|
309
|
+
appendTo.appendChild(div);
|
|
310
|
+
|
|
311
|
+
return myInput;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
customElements.define('slice-inputdocumentation', InputDocumentation);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
slice-landing-menu {
|
|
2
|
+
h1 {
|
|
3
|
+
z-index: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
h2{
|
|
7
|
+
color: var(--font-primary-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.sliceLogo {
|
|
11
|
+
position: absolute;
|
|
12
|
+
z-index: -1;
|
|
13
|
+
}
|
|
14
|
+
.intro {
|
|
15
|
+
height: 85vh;
|
|
16
|
+
position: relative;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
}
|
|
21
|
+
.intro h1 {
|
|
22
|
+
/* font-family: "Ubuntu", sans-serif; */
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
color: var(--font-primary-color);
|
|
26
|
+
animation: fade-in 3s ease;
|
|
27
|
+
text-shadow: black 1px 0 100px;
|
|
28
|
+
}
|
|
29
|
+
.intro .sliceLogo {
|
|
30
|
+
opacity: 0.75;
|
|
31
|
+
color: var(--primary-color);
|
|
32
|
+
animation: fade-in-logo 5s ease, beat 10s ease infinite 5s;
|
|
33
|
+
}
|
|
34
|
+
.info {
|
|
35
|
+
bottom: 0;
|
|
36
|
+
position: absolute;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
.info p a {
|
|
42
|
+
color: var(--primary-color);
|
|
43
|
+
text-decoration: none;
|
|
44
|
+
transition: all 0.3s ease;
|
|
45
|
+
}
|
|
46
|
+
.info p a:hover {
|
|
47
|
+
text-shadow: white 1px 0 10px;
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
}
|
|
50
|
+
.goToDocs {
|
|
51
|
+
margin-top: 50px;
|
|
52
|
+
color: var(--font-primary-color);
|
|
53
|
+
}
|
|
54
|
+
.goToDocs p {
|
|
55
|
+
text-align: justify;
|
|
56
|
+
}
|
|
57
|
+
@media screen and (min-width: 770px) {
|
|
58
|
+
.goToDocs {
|
|
59
|
+
padding-left: 30%;
|
|
60
|
+
padding-right: 30%;
|
|
61
|
+
}
|
|
62
|
+
h1 {
|
|
63
|
+
font-size: 100px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
@media screen and (max-width: 770px) {
|
|
68
|
+
.goToDocs {
|
|
69
|
+
padding: 10px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.info {
|
|
73
|
+
bottom: 20;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
@keyframes fade-in {
|
|
79
|
+
0% {
|
|
80
|
+
opacity: 0;
|
|
81
|
+
scale: 0.5;
|
|
82
|
+
}
|
|
83
|
+
100% {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
scale: 1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
@keyframes fade-in-logo {
|
|
89
|
+
0% {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
scale: 0.5;
|
|
92
|
+
}
|
|
93
|
+
100% {
|
|
94
|
+
opacity: 0.75;
|
|
95
|
+
scale: 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
@keyframes beat {
|
|
99
|
+
0% {
|
|
100
|
+
scale: 1;
|
|
101
|
+
}
|
|
102
|
+
50% {
|
|
103
|
+
scale: 0.9;
|
|
104
|
+
}
|
|
105
|
+
100% {
|
|
106
|
+
scale: 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div class="intro">
|
|
2
|
+
<h1>Slice Framework</h1>
|
|
3
|
+
<div class="info">
|
|
4
|
+
<h2 style="text-align: center; padding-top: 10px;">Slice.js: Build Your Web App One Slice at a Time.</h2>
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="goToDocs">
|
|
8
|
+
<p>
|
|
9
|
+
Introducing Slice.js, a revolutionary frontend framework built on modern web standards and powered by the simplicity of vanilla JavaScript.
|
|
10
|
+
With its modular, component-based architecture, Slice.js streamlines web development, enabling developers who know the core technologies—HTML, CSS, and JavaScript—to build robust, well-organized web applications with ease.
|
|
11
|
+
</p>
|
|
12
|
+
<p>
|
|
13
|
+
Dive into our comprehensive documentation to learn how Slice.js leverages native web components and a clean,
|
|
14
|
+
standards-based syntax to simplify your workflow.
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default class LandingMenu 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
|
+
let logoSize = '500px';
|
|
12
|
+
if (window.screen.width <= 770) {
|
|
13
|
+
logoSize = '300px';
|
|
14
|
+
}
|
|
15
|
+
const sliceLogo = await slice.build('Icon', {
|
|
16
|
+
name: 'sliceJs',
|
|
17
|
+
size: logoSize,
|
|
18
|
+
color: 'var(--font-primary-color)',
|
|
19
|
+
iconStyle: 'filled',
|
|
20
|
+
});
|
|
21
|
+
sliceLogo.classList.add('sliceLogo');
|
|
22
|
+
this.querySelector('.intro').appendChild(sliceLogo);
|
|
23
|
+
const goToDocs = await slice.build('Button', {
|
|
24
|
+
value: 'Go to Documentation',
|
|
25
|
+
onClickCallback: async () => {
|
|
26
|
+
await slice.router.navigate('/Documentation');
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
this.querySelector('.goToDocs').appendChild(goToDocs);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
customElements.define('slice-landing-menu', LandingMenu);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
slice-landingpage slice-layout {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
}
|
|
6
|
+
.landing_page {
|
|
7
|
+
font-family: var(--font-family);
|
|
8
|
+
color: var(--font-primary-color);
|
|
9
|
+
overflow-y: scroll;
|
|
10
|
+
overflow-x: hidden;
|
|
11
|
+
padding-left: 10px;
|
|
12
|
+
padding-right: 10px;
|
|
13
|
+
padding-bottom: 25px;
|
|
14
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export default class LandingPage 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 div = document.createElement('div');
|
|
12
|
+
let theme = slice.stylesManager.themeManager.currentTheme;
|
|
13
|
+
|
|
14
|
+
const navBar = await slice.build('Navbar', {
|
|
15
|
+
logo: {
|
|
16
|
+
src: '../../images/Slice.js-logo.png',
|
|
17
|
+
path: '',
|
|
18
|
+
},
|
|
19
|
+
buttons: [
|
|
20
|
+
{
|
|
21
|
+
value: 'Change Theme',
|
|
22
|
+
onClickCallback: async () => {
|
|
23
|
+
if (theme === 'Slice') {
|
|
24
|
+
await slice.setTheme('Light');
|
|
25
|
+
theme = 'Light';
|
|
26
|
+
} else if (theme === 'Light') {
|
|
27
|
+
await slice.setTheme('Dark');
|
|
28
|
+
theme = 'Dark';
|
|
29
|
+
} else if (theme === 'Dark') {
|
|
30
|
+
await slice.setTheme('Slice');
|
|
31
|
+
theme = 'Slice';
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
div.appendChild(navBar);
|
|
39
|
+
const divView = document.createElement('div');
|
|
40
|
+
divView.classList.add('landing_page');
|
|
41
|
+
|
|
42
|
+
const landingMenu = await slice.build('LandingMenu', {});
|
|
43
|
+
divView.appendChild(landingMenu);
|
|
44
|
+
const layOut = await slice.build('Layout', {
|
|
45
|
+
layout: div,
|
|
46
|
+
view: divView,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
this.appendChild(layOut);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
customElements.define('slice-landingpage', LandingPage);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
slice-mainmenu {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
font-family: var(--font-family);
|
|
6
|
+
background-color: var(--primary-background-color);
|
|
7
|
+
border-right: 1px solid var(--primary-color-shade);
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
height: 100%;
|
|
11
|
+
width: 17%;
|
|
12
|
+
transition: transform 0.3s ease, width 0.3s ease;
|
|
13
|
+
overflow-x: hidden;
|
|
14
|
+
}
|
|
15
|
+
.slice_menu {
|
|
16
|
+
margin-top: 175px;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
overflow-y: scroll;
|
|
20
|
+
overflow-x: hidden;
|
|
21
|
+
padding: 10px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.slice_menu_button {
|
|
25
|
+
position: fixed;
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
visibility: hidden;
|
|
29
|
+
width: min-content;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
padding: 20px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.menu_title {
|
|
35
|
+
visibility: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.slice_close_menu {
|
|
39
|
+
visibility: hidden;
|
|
40
|
+
position: absolute;
|
|
41
|
+
padding: 20px;
|
|
42
|
+
top: 0;
|
|
43
|
+
right: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
slice-treeview .simple_treeview::-webkit-scrollbar,
|
|
47
|
+
slice-mainmenu::-webkit-scrollbar {
|
|
48
|
+
width: 0px;
|
|
49
|
+
}
|
|
50
|
+
slice-treeview .simple_treeview::-webkit-scrollbar:horizontal,
|
|
51
|
+
slice-mainmenu::-webkit-scrollbar:horizontal {
|
|
52
|
+
height: 0px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media only screen and (max-width: 770px) {
|
|
56
|
+
slice-mainmenu {
|
|
57
|
+
top: 0px;
|
|
58
|
+
position: fixed;
|
|
59
|
+
z-index: 100000;
|
|
60
|
+
display: flex;
|
|
61
|
+
width: 0%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.slice_menu_button {
|
|
65
|
+
right: 100%;
|
|
66
|
+
visibility: visible;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.menu_title {
|
|
70
|
+
visibility: visible;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.slice_menu_open {
|
|
74
|
+
width: 80%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.slice_close_menu {
|
|
78
|
+
visibility: visible;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<div class="slice_menu_button">
|
|
2
|
+
<svg
|
|
3
|
+
class="w-6 h-6 text-gray-800 dark:text-white"
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
width="24"
|
|
7
|
+
height="24"
|
|
8
|
+
fill="none"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
stroke="var(--primary-color-contrast)"
|
|
13
|
+
stroke-linecap="round"
|
|
14
|
+
stroke-width="2.3"
|
|
15
|
+
d="M5 7h14M5 12h14M5 17h14"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="slice_menu">
|
|
20
|
+
<div class="slice_close_menu">
|
|
21
|
+
<svg
|
|
22
|
+
class="w-6 h-6 text-gray-800 dark:text-white"
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
+
width="24"
|
|
26
|
+
height="24"
|
|
27
|
+
fill="none"
|
|
28
|
+
viewBox="0 0 24 24"
|
|
29
|
+
>
|
|
30
|
+
<path
|
|
31
|
+
stroke="var(--primary-color)"
|
|
32
|
+
stroke-linecap="round"
|
|
33
|
+
stroke-linejoin="round"
|
|
34
|
+
stroke-width="2"
|
|
35
|
+
d="M6 18 17.94 6M18 18 6.06 6"
|
|
36
|
+
/>
|
|
37
|
+
</svg>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default class MainMenu extends HTMLElement {
|
|
2
|
+
constructor(props) {
|
|
3
|
+
super();
|
|
4
|
+
slice.attachTemplate(this);
|
|
5
|
+
|
|
6
|
+
this.$menuButton = this.querySelector('.slice_menu_button');
|
|
7
|
+
this.$closeButton = this.querySelector('.slice_close_menu');
|
|
8
|
+
this.$menu = this.querySelector('.slice_menu');
|
|
9
|
+
|
|
10
|
+
this.$menuButton.addEventListener('click', () => {
|
|
11
|
+
this.handleOpenMenu();
|
|
12
|
+
});
|
|
13
|
+
this.$closeButton.addEventListener('click', () => {
|
|
14
|
+
this.handleCloseMenu();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
slice.controller.setComponentProps(this, props);
|
|
18
|
+
this.debuggerProps = [];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
init() {
|
|
22
|
+
this.addEventListener('mouseleave', () => {
|
|
23
|
+
if (this.querySelector('.slice_menu_open')) {
|
|
24
|
+
this.handleCloseMenu();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
add(value) {
|
|
30
|
+
this.$menu.appendChild(value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
handleOpenMenu() {
|
|
34
|
+
this.classList.add('slice_menu_open');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
handleCloseMenu() {
|
|
38
|
+
this.classList.remove('slice_menu_open');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
customElements.define('slice-mainmenu', MainMenu);
|
|
File without changes
|
|
File without changes
|