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.
Files changed (128) hide show
  1. package/ProjectTemplate/api/index.js +97 -0
  2. package/ProjectTemplate/src/App/index.html +22 -0
  3. package/ProjectTemplate/src/App/index.js +63 -0
  4. package/ProjectTemplate/src/App/style.css +40 -0
  5. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +16 -0
  6. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +22 -0
  7. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +102 -0
  8. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +15 -0
  9. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +38 -0
  10. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +113 -0
  11. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +21 -0
  12. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +35 -0
  13. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +103 -0
  14. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.css +14 -0
  15. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.html +3 -0
  16. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.js +45 -0
  17. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.css +0 -0
  18. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.html +30 -0
  19. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.js +75 -0
  20. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +62 -0
  21. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
  22. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +241 -0
  23. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +41 -0
  24. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +95 -0
  25. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +315 -0
  26. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.css +108 -0
  27. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.html +16 -0
  28. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.js +33 -0
  29. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.css +14 -0
  30. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
  31. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.js +53 -0
  32. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.css +80 -0
  33. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.html +39 -0
  34. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.js +42 -0
  35. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
  36. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
  37. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.js +13 -0
  38. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.css +49 -0
  39. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.html +1 -0
  40. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.js +60 -0
  41. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.css +12 -0
  42. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.html +0 -0
  43. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.js +126 -0
  44. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +104 -0
  45. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +12 -0
  46. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +74 -0
  47. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +21 -0
  48. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +35 -0
  49. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +103 -0
  50. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +23 -0
  51. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +6 -0
  52. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +129 -0
  53. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -0
  54. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +7 -0
  55. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +15 -0
  56. package/ProjectTemplate/src/Components/Service/FetchManager/FetchManager.js +133 -0
  57. package/ProjectTemplate/src/Components/Service/IndexedDbManager/IndexedDbManager.js +141 -0
  58. package/ProjectTemplate/src/Components/Service/Link/Link.js +26 -0
  59. package/ProjectTemplate/src/Components/Visual/Button/Button.css +47 -0
  60. package/ProjectTemplate/src/Components/Visual/Button/Button.html +5 -0
  61. package/ProjectTemplate/src/Components/Visual/Button/Button.js +70 -0
  62. package/ProjectTemplate/src/Components/Visual/Card/Card.css +68 -0
  63. package/ProjectTemplate/src/Components/Visual/Card/Card.html +7 -0
  64. package/ProjectTemplate/src/Components/Visual/Card/Card.js +107 -0
  65. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.css +87 -0
  66. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.html +8 -0
  67. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.js +86 -0
  68. package/ProjectTemplate/src/Components/Visual/Details/Details.css +70 -0
  69. package/ProjectTemplate/src/Components/Visual/Details/Details.html +9 -0
  70. package/ProjectTemplate/src/Components/Visual/Details/Details.js +76 -0
  71. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.css +60 -0
  72. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.html +5 -0
  73. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.js +63 -0
  74. package/ProjectTemplate/src/Components/Visual/Grid/Grid.css +7 -0
  75. package/ProjectTemplate/src/Components/Visual/Grid/Grid.html +1 -0
  76. package/ProjectTemplate/src/Components/Visual/Grid/Grid.js +57 -0
  77. package/ProjectTemplate/src/Components/Visual/Icon/Icon.css +510 -0
  78. package/ProjectTemplate/src/Components/Visual/Icon/Icon.html +1 -0
  79. package/ProjectTemplate/src/Components/Visual/Icon/Icon.js +89 -0
  80. package/ProjectTemplate/src/Components/Visual/Icon/slc.eot +0 -0
  81. package/ProjectTemplate/src/Components/Visual/Icon/slc.json +555 -0
  82. package/ProjectTemplate/src/Components/Visual/Icon/slc.styl +507 -0
  83. package/ProjectTemplate/src/Components/Visual/Icon/slc.svg +1485 -0
  84. package/ProjectTemplate/src/Components/Visual/Icon/slc.symbol.svg +1059 -0
  85. package/ProjectTemplate/src/Components/Visual/Icon/slc.ttf +0 -0
  86. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff +0 -0
  87. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff2 +0 -0
  88. package/ProjectTemplate/src/Components/Visual/Input/Input.css +91 -0
  89. package/ProjectTemplate/src/Components/Visual/Input/Input.html +4 -0
  90. package/ProjectTemplate/src/Components/Visual/Input/Input.js +215 -0
  91. package/ProjectTemplate/src/Components/Visual/Layout/Layout.css +0 -0
  92. package/ProjectTemplate/src/Components/Visual/Layout/Layout.html +0 -0
  93. package/ProjectTemplate/src/Components/Visual/Layout/Layout.js +49 -0
  94. package/ProjectTemplate/src/Components/Visual/Loading/Loading.css +56 -0
  95. package/ProjectTemplate/src/Components/Visual/Loading/Loading.html +83 -0
  96. package/ProjectTemplate/src/Components/Visual/Loading/Loading.js +38 -0
  97. package/ProjectTemplate/src/Components/Visual/MultiRoute/MultiRoute.js +93 -0
  98. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.css +115 -0
  99. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.html +44 -0
  100. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.js +141 -0
  101. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.css +117 -0
  102. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.html +24 -0
  103. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.js +16 -0
  104. package/ProjectTemplate/src/Components/Visual/Route/Route.js +93 -0
  105. package/ProjectTemplate/src/Components/Visual/Select/Select.css +84 -0
  106. package/ProjectTemplate/src/Components/Visual/Select/Select.html +8 -0
  107. package/ProjectTemplate/src/Components/Visual/Select/Select.js +195 -0
  108. package/ProjectTemplate/src/Components/Visual/Switch/Switch.css +76 -0
  109. package/ProjectTemplate/src/Components/Visual/Switch/Switch.html +8 -0
  110. package/ProjectTemplate/src/Components/Visual/Switch/Switch.js +102 -0
  111. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.css +36 -0
  112. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.html +1 -0
  113. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.js +126 -0
  114. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.css +8 -0
  115. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.html +1 -0
  116. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.js +48 -0
  117. package/ProjectTemplate/src/Components/components.js +42 -0
  118. package/ProjectTemplate/src/Styles/sliceStyles.css +34 -0
  119. package/ProjectTemplate/src/Themes/Dark.css +42 -0
  120. package/ProjectTemplate/src/Themes/Light.css +31 -0
  121. package/ProjectTemplate/src/Themes/Slice.css +47 -0
  122. package/ProjectTemplate/src/images/Slice.js-logo.png +0 -0
  123. package/ProjectTemplate/src/images/favicon.ico +0 -0
  124. package/ProjectTemplate/src/images/im2/Slice.js-logo.png +0 -0
  125. package/ProjectTemplate/src/routes.js +36 -0
  126. package/ProjectTemplate/src/sliceConfig.json +58 -0
  127. package/package.json +2 -2
  128. package/post.js +5 -2
@@ -0,0 +1,14 @@
1
+ .codevisualizer_container {
2
+ font-size: smaller;
3
+ max-width: 100%;
4
+ background-color: var(--primary-background-color);
5
+ border: 1px solid var(--primary-color);
6
+ padding: 10px;
7
+ border-radius: 10px;
8
+ overflow-x: scroll;
9
+ }
10
+
11
+ .codevisualizer pre code[class*='language-'],
12
+ .codevisualizer pre pre[class*='language-'] {
13
+ color: var(--font-primary-color);
14
+ }
@@ -0,0 +1,3 @@
1
+ <div class="codevisualizer_container">
2
+ <pre class="codevisualizer"><code></code></pre>
3
+ </div>
@@ -0,0 +1,45 @@
1
+ export default class CodeVisualizer extends HTMLElement {
2
+ constructor(props) {
3
+ super();
4
+ slice.attachTemplate(this);
5
+
6
+ this.$container = this.querySelector('.codevisualizer_container');
7
+ this.$code = this.querySelector('.codevisualizer');
8
+
9
+ slice.controller.setComponentProps(this, props);
10
+ this.debuggerProps = ['language', 'value'];
11
+ this.editor = null;
12
+ }
13
+
14
+ set value(value) {
15
+ this._value = value;
16
+ }
17
+
18
+ get value() {
19
+ return this._value;
20
+ }
21
+
22
+ set language(value) {
23
+ this._language = value;
24
+ }
25
+
26
+ get language() {
27
+ return this._language;
28
+ }
29
+
30
+ init() {
31
+ this.visualizeCode();
32
+ }
33
+
34
+ visualizeCode() {
35
+ if (this._value && this._language) {
36
+ this.$code.innerHTML = `<pre><code class="language-${this._language}">${Prism.highlight(
37
+ this._value,
38
+ Prism.languages[this._language],
39
+ this._language
40
+ )}</code></pre>`;
41
+ }
42
+ }
43
+ }
44
+
45
+ customElements.define('slice-codevisualizer', CodeVisualizer);
@@ -0,0 +1,30 @@
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>
@@ -0,0 +1,75 @@
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);
@@ -0,0 +1,62 @@
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
+ }
@@ -0,0 +1,241 @@
1
+ export default class DocumentationPage extends HTMLElement {
2
+ constructor(props) {
3
+ super();
4
+ slice.attachTemplate(this);
5
+
6
+ slice.controller.setComponentProps(this, props);
7
+ this.debuggerProps = [];
8
+
9
+ this.components = ['Button', 'Card', 'Checkbox', 'Input', 'Switch'];
10
+ }
11
+
12
+ async init() {
13
+ await import('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js');
14
+ await import('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js');
15
+ const css = await fetch('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css');
16
+ const cssText = await css.text();
17
+ const style = document.createElement('style');
18
+ style.innerHTML = cssText;
19
+ document.head.appendChild(style);
20
+
21
+ const navBar = await slice.build('Navbar', {
22
+ position: 'fixed',
23
+ logo: {
24
+ src: '../../images/Slice.js-logo.png',
25
+ path: '/',
26
+ },
27
+ items: [
28
+ {
29
+ text: 'Home',
30
+ path: '/',
31
+ },
32
+ {
33
+ text: 'Documentation',
34
+ path: '/Documentation',
35
+ },
36
+ {
37
+ text: 'Playground',
38
+ path: '/Playground',
39
+ },
40
+ {
41
+ text: 'Our Team',
42
+ path: '/Team',
43
+ }
44
+
45
+ ],
46
+ buttons: [
47
+ {
48
+ value: 'Change Theme',
49
+ // color:
50
+ onClickCallback: async () => {
51
+ if (theme === 'Slice') {
52
+ await slice.setTheme('Light');
53
+ theme = 'Light';
54
+ } else if (theme === 'Light') {
55
+ await slice.setTheme('Dark');
56
+ theme = 'Dark';
57
+ } else if (theme === 'Dark') {
58
+ await slice.setTheme('Slice');
59
+ theme = 'Slice';
60
+ }
61
+ },
62
+ },
63
+ ],
64
+ });
65
+
66
+ const components = {
67
+ Button: 'Visual',
68
+ Card: 'Visual',
69
+ Checkbox: 'Visual',
70
+ Input: 'Visual',
71
+ Switch: 'Visual',
72
+ };
73
+
74
+ let documentationRoutes = {
75
+ value: 'Visual',
76
+ items: [],
77
+ };
78
+
79
+ for (const name in components) {
80
+ const component = {
81
+ value: name,
82
+ path: `/Documentation/${name}`,
83
+ component: `${name}Documentation`,
84
+ };
85
+ if (components[name] === 'Visual') {
86
+ documentationRoutes.items.push(component);
87
+ }
88
+ }
89
+
90
+ const treeview = await slice.build('TreeView', {
91
+ items: [
92
+ {
93
+ value: 'Introduction',
94
+ items: [
95
+ {
96
+ value: 'What is Slice.js?',
97
+ path: '/Documentation/What-is-Slice.js',
98
+ component: 'WhatIsSlice',
99
+ },
100
+ {
101
+ value: 'Installation',
102
+ path: '/Documentation/Installation',
103
+ component: 'Installation',
104
+ },
105
+ ],
106
+ },
107
+ {
108
+ value: 'Getting Started',
109
+ items: [
110
+ {
111
+ value: 'Components',
112
+ items: [
113
+ {
114
+ value: 'The build method',
115
+ path: '/Documentation/The-build-method',
116
+ component: 'TheBuildMethod',
117
+ },
118
+ {
119
+ value: 'Visual',
120
+ path: '/Documentation/Visual',
121
+ component: 'VisualDocumentation',
122
+ },
123
+ {
124
+ value: 'Structural',
125
+ path: '/Documentation/Structural',
126
+ component: 'StructuralDocumentation',
127
+ },
128
+ {
129
+ value: 'Services',
130
+ path: '/Documentation/Services',
131
+ component: 'ServicesDocumentation',
132
+ },
133
+ {
134
+ value: `Lifecycle methods`,
135
+ path: '/Documentation/Lifecycle-methods',
136
+ component: 'LifecycleMethods',
137
+ },
138
+ ],
139
+ },
140
+ {
141
+ value: 'Routing',
142
+ path: '/Documentation/Routing',
143
+ component: 'RoutingDocumentation',
144
+ },
145
+ {
146
+ value: 'Themes',
147
+ path: '/Documentation/Themes',
148
+ component: 'ThemesDocumentation',
149
+ },
150
+ {
151
+ value: 'Slice Styles',
152
+ path: '/Documentation/Slice-Styles',
153
+ component: 'SliceStylesDocumentation',
154
+ },
155
+ ],
156
+ },
157
+ {
158
+ value: 'Components Library',
159
+ items: [
160
+ {
161
+ value: 'Services',
162
+ items: [
163
+ {
164
+ value: 'FetchManager',
165
+ path: '/Documentation/SliceComponents/FetchManager',
166
+ },
167
+ ],
168
+ },
169
+ documentationRoutes,
170
+ ],
171
+ },
172
+ ],
173
+ onClickCallback: async (item) => {
174
+ if (item.path) {
175
+ //myRouteContainer.path = item.path;
176
+ //myRouteContainer.component = item.component;
177
+ await slice.router.navigate(item.path);
178
+ myNavigation.page = VisualComponentsMultiRoute;
179
+ }
180
+ },
181
+ });
182
+
183
+ const extraRoute = {
184
+ path: '/Documentation',
185
+ component: 'Documentation',
186
+ };
187
+
188
+ //add extra route to the routes
189
+ documentationRoutes.items.push(extraRoute);
190
+
191
+ function getRoutes(array) {
192
+ for (let i = 0; i < array.length; i++) {
193
+ if (array[i].items) {
194
+ getRoutes(array[i].items);
195
+ } else {
196
+ const exists = documentationRoutes.items.some(route => route.path === array[i].path);
197
+ if (!exists) {
198
+ documentationRoutes.items.push(array[i]);
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+
205
+
206
+ const VisualComponentsMultiRoute = await slice.build('MultiRoute', {
207
+ routes: documentationRoutes.items,
208
+ });
209
+
210
+
211
+
212
+ const mainMenu = await slice.build('MainMenu', {});
213
+ mainMenu.add(treeview);
214
+
215
+ const myNavigation = await slice.build('MyNavigation', {
216
+ page: VisualComponentsMultiRoute,
217
+ });
218
+
219
+ const layOut = await slice.build('Layout', {
220
+ // layout: div,
221
+ view: VisualComponentsMultiRoute,
222
+ });
223
+
224
+ layOut.onLayOut(mainMenu);
225
+ layOut.onLayOut(navBar);
226
+ layOut.onLayOut(myNavigation);
227
+
228
+ let theme = slice.stylesManager.themeManager.currentTheme;
229
+
230
+ if (window.location.pathname === '/Documentation') {
231
+ await VisualComponentsMultiRoute.renderIfCurrentRoute();
232
+ }
233
+ this.appendChild(layOut);
234
+
235
+ //if route is domain/Documentation
236
+
237
+ }
238
+
239
+ }
240
+
241
+ customElements.define('slice-documentation-page', DocumentationPage);
@@ -0,0 +1,41 @@
1
+ .inputs {
2
+ display: flex;
3
+ justify-content: center;
4
+ width: 100%;
5
+ }
6
+ .typeText,
7
+ .typeNumber {
8
+ width: 100%;
9
+ }
10
+ .inputGrid {
11
+ display: grid;
12
+ grid-template-columns: repeat(2, 1fr);
13
+ grid-template-rows: repeat(1, 1fr);
14
+ gap: 10px;
15
+ }
16
+ ul li::marker,
17
+ ul span {
18
+ color: var(--primary-color);
19
+ }
20
+ .validateConditions {
21
+ width: 100%;
22
+ display: flex;
23
+ flex-direction: row;
24
+ justify-content: center;
25
+ align-items: center;
26
+ }
27
+ .inputButtons {
28
+ display: flex;
29
+ justify-content: center;
30
+ slice-button {
31
+ width: 100%;
32
+ }
33
+ }
34
+ @media only screen and (max-width: 770px) {
35
+ .inputs {
36
+ width: 100%;
37
+ }
38
+ .inputGrid {
39
+ display: block;
40
+ }
41
+ }
@@ -0,0 +1,95 @@
1
+ <h1 id="sliceInput">Slice Input</h1>
2
+ <div class="myInput">
3
+ <p>
4
+ A Slice Input is build with a type default prop of text, that can be used by
5
+ to enter any data the user wants to.
6
+ </p>
7
+ </div>
8
+ <h1 id="props">Props</h1>
9
+ <div class="inputPlaceholder">
10
+ <h2 id="placeholder">Placeholder</h2>
11
+ <p></p>
12
+ </div>
13
+ <div class="requiredProp">
14
+ <h2 id="required">Required Prop</h2>
15
+ <p>The required prop triggers error if there is no value.</p>
16
+ </div>
17
+ <div class="disabledProp">
18
+ <h2 id="disabled">Disabled Prop</h2>
19
+ <p>The disabled prop cancels all kind of interaction with the input.</p>
20
+ </div>
21
+ <h1 id="types">Types</h1>
22
+ <div class="inputTypes">
23
+ <div class="typeText">
24
+ <h2 id="typeText">Text</h2>
25
+ <p>
26
+ As said before, the text type is the default type to a Slice Input. can be
27
+ field with text, numbers, and symbols.
28
+ </p>
29
+ </div>
30
+ <div class="typeNumber">
31
+ <h2 id="typeText">Number</h2>
32
+ <p>
33
+ In text type an user can enter as much of text as numbers, but with number
34
+ type it can only be enter numbers.
35
+ </p>
36
+ </div>
37
+ <div class="password">
38
+ <h2 id="password">Password & Secret Prop</h2>
39
+ <p>
40
+ The password type for a Slice Input automatically sets all the information
41
+ into secret. With secret prop being true the data entered can be revealed
42
+ at will by the user.
43
+ </p>
44
+ <div class="inputGrid">
45
+ <div class="typePassword"></div>
46
+ <div class="secretProp"></div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ <div class="emailType">
51
+ <h2 id="typeEmail">Email</h2>
52
+ <p>
53
+ The very own HTML Input tag can verify if the data entered is a valid email.
54
+ </p>
55
+ </div>
56
+ <div class="dateType">
57
+ <h2 id="typeDate">Date</h2>
58
+ <p>This type allows the user to enter a specific date of the calendar.</p>
59
+ </div>
60
+ <h1 id="conditions">Slice Input Conditions</h1>
61
+ <div class="conditions">
62
+ <p>
63
+ The Slice Input cand have conditions set up by the developers. This is highly recomended for emails and passwords, but also can by used in the default text type.
64
+ <ul>
65
+ <li>regex <span>=</span> string <span>(optional)</span></li>
66
+ <li>minLength <span>=</span> number <span>(optional)</span></li>
67
+ <li>maxLength <span>=</span> number</li>
68
+ <li>minMinusc <span>=</span> number <span>(optional)</span></li>
69
+ <li>maxMinusc <span>=</span> number</li>
70
+ <li>minMayusc <span>=</span> number <span>(optional)</span></li>
71
+ <li>maxMayusc <span>=</span> number</li>
72
+ <li>minNumber <span>=</span> number <span>(optional)</span></li>
73
+ <li>maxNumber <span>=</span> number</li>
74
+ <li>minSymbol <span>=</span> number <span>(optional)</span></li>
75
+ <li>maxSymbol <span>=</span> number</li>
76
+ </ul>
77
+ The usage of "regex" makes the rest of conditions useless because it has to specify all conditions. Regex is only recomended for those who have the proper knowledge.
78
+ </p>
79
+ <div class="validateConditions"></div>
80
+ <!-- <div class="inputGrid"> -->
81
+ <div class="inputConditions"></div>
82
+ <div class="inputRegex"></div>
83
+ <!-- </div> -->
84
+ </div>
85
+ <h1 id="methods">Methods</h1>
86
+ <div class="inputMethods">
87
+ <p>The Slice Input has it's own methods to validate if the entered data match the conditions, to trigger error (and success), and to clear the input.
88
+ <ul>
89
+ <li>validateValue();</li>
90
+ <li>clear();</li>
91
+ <li>triggerError();</li>
92
+ <li>triggerSuccess();</li>
93
+ </ul>
94
+ </p>
95
+ </div>