slicejs-cli 2.0.6 → 2.0.7

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/commands/init/init.js +15 -14
  2. package/package.json +1 -1
  3. package/ProjectTemplate/api/index.js +0 -97
  4. package/ProjectTemplate/src/App/index.html +0 -22
  5. package/ProjectTemplate/src/App/index.js +0 -63
  6. package/ProjectTemplate/src/App/style.css +0 -40
  7. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +0 -16
  8. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +0 -22
  9. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +0 -102
  10. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +0 -15
  11. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +0 -38
  12. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +0 -113
  13. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +0 -21
  14. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +0 -35
  15. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +0 -103
  16. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.css +0 -14
  17. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.html +0 -3
  18. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.js +0 -45
  19. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.css +0 -0
  20. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.html +0 -30
  21. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.js +0 -75
  22. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +0 -62
  23. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
  24. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +0 -241
  25. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +0 -41
  26. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +0 -95
  27. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +0 -315
  28. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.css +0 -108
  29. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.html +0 -16
  30. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.js +0 -33
  31. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.css +0 -14
  32. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
  33. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.js +0 -53
  34. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.css +0 -80
  35. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.html +0 -39
  36. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.js +0 -42
  37. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
  38. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
  39. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.js +0 -13
  40. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.css +0 -49
  41. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.html +0 -1
  42. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.js +0 -60
  43. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.css +0 -12
  44. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.html +0 -0
  45. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.js +0 -126
  46. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +0 -104
  47. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +0 -12
  48. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +0 -74
  49. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +0 -21
  50. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +0 -35
  51. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +0 -103
  52. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +0 -23
  53. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +0 -6
  54. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +0 -129
  55. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -0
  56. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +0 -7
  57. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +0 -15
  58. package/ProjectTemplate/src/Components/Service/FetchManager/FetchManager.js +0 -133
  59. package/ProjectTemplate/src/Components/Service/IndexedDbManager/IndexedDbManager.js +0 -141
  60. package/ProjectTemplate/src/Components/Service/Link/Link.js +0 -26
  61. package/ProjectTemplate/src/Components/Visual/Button/Button.css +0 -47
  62. package/ProjectTemplate/src/Components/Visual/Button/Button.html +0 -5
  63. package/ProjectTemplate/src/Components/Visual/Button/Button.js +0 -70
  64. package/ProjectTemplate/src/Components/Visual/Card/Card.css +0 -68
  65. package/ProjectTemplate/src/Components/Visual/Card/Card.html +0 -7
  66. package/ProjectTemplate/src/Components/Visual/Card/Card.js +0 -107
  67. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.css +0 -87
  68. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.html +0 -8
  69. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.js +0 -86
  70. package/ProjectTemplate/src/Components/Visual/Details/Details.css +0 -70
  71. package/ProjectTemplate/src/Components/Visual/Details/Details.html +0 -9
  72. package/ProjectTemplate/src/Components/Visual/Details/Details.js +0 -76
  73. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.css +0 -60
  74. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.html +0 -5
  75. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.js +0 -63
  76. package/ProjectTemplate/src/Components/Visual/Grid/Grid.css +0 -7
  77. package/ProjectTemplate/src/Components/Visual/Grid/Grid.html +0 -1
  78. package/ProjectTemplate/src/Components/Visual/Grid/Grid.js +0 -57
  79. package/ProjectTemplate/src/Components/Visual/Icon/Icon.css +0 -510
  80. package/ProjectTemplate/src/Components/Visual/Icon/Icon.html +0 -1
  81. package/ProjectTemplate/src/Components/Visual/Icon/Icon.js +0 -89
  82. package/ProjectTemplate/src/Components/Visual/Icon/slc.eot +0 -0
  83. package/ProjectTemplate/src/Components/Visual/Icon/slc.json +0 -555
  84. package/ProjectTemplate/src/Components/Visual/Icon/slc.styl +0 -507
  85. package/ProjectTemplate/src/Components/Visual/Icon/slc.svg +0 -1485
  86. package/ProjectTemplate/src/Components/Visual/Icon/slc.symbol.svg +0 -1059
  87. package/ProjectTemplate/src/Components/Visual/Icon/slc.ttf +0 -0
  88. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff +0 -0
  89. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff2 +0 -0
  90. package/ProjectTemplate/src/Components/Visual/Input/Input.css +0 -91
  91. package/ProjectTemplate/src/Components/Visual/Input/Input.html +0 -4
  92. package/ProjectTemplate/src/Components/Visual/Input/Input.js +0 -215
  93. package/ProjectTemplate/src/Components/Visual/Layout/Layout.css +0 -0
  94. package/ProjectTemplate/src/Components/Visual/Layout/Layout.html +0 -0
  95. package/ProjectTemplate/src/Components/Visual/Layout/Layout.js +0 -49
  96. package/ProjectTemplate/src/Components/Visual/Loading/Loading.css +0 -56
  97. package/ProjectTemplate/src/Components/Visual/Loading/Loading.html +0 -83
  98. package/ProjectTemplate/src/Components/Visual/Loading/Loading.js +0 -38
  99. package/ProjectTemplate/src/Components/Visual/MultiRoute/MultiRoute.js +0 -93
  100. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.css +0 -115
  101. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.html +0 -44
  102. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.js +0 -141
  103. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.css +0 -117
  104. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.html +0 -24
  105. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.js +0 -16
  106. package/ProjectTemplate/src/Components/Visual/Route/Route.js +0 -93
  107. package/ProjectTemplate/src/Components/Visual/Select/Select.css +0 -84
  108. package/ProjectTemplate/src/Components/Visual/Select/Select.html +0 -8
  109. package/ProjectTemplate/src/Components/Visual/Select/Select.js +0 -195
  110. package/ProjectTemplate/src/Components/Visual/Switch/Switch.css +0 -76
  111. package/ProjectTemplate/src/Components/Visual/Switch/Switch.html +0 -8
  112. package/ProjectTemplate/src/Components/Visual/Switch/Switch.js +0 -102
  113. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.css +0 -36
  114. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.html +0 -1
  115. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.js +0 -126
  116. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.css +0 -8
  117. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.html +0 -1
  118. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.js +0 -48
  119. package/ProjectTemplate/src/Components/components.js +0 -42
  120. package/ProjectTemplate/src/Styles/sliceStyles.css +0 -34
  121. package/ProjectTemplate/src/Themes/Dark.css +0 -42
  122. package/ProjectTemplate/src/Themes/Light.css +0 -31
  123. package/ProjectTemplate/src/Themes/Slice.css +0 -47
  124. package/ProjectTemplate/src/images/Slice.js-logo.png +0 -0
  125. package/ProjectTemplate/src/images/favicon.ico +0 -0
  126. package/ProjectTemplate/src/images/im2/Slice.js-logo.png +0 -0
  127. package/ProjectTemplate/src/routes.js +0 -36
  128. package/ProjectTemplate/src/sliceConfig.json +0 -58
@@ -1,70 +0,0 @@
1
- export default class Button extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- slice.attachTemplate(this);
5
- this.$value = this.querySelector('.slice_button_value');
6
- this.$button = this.querySelector('.slice_button');
7
- if (props.onClickCallback) {
8
- this.onClickCallback = props.onClickCallback;
9
- this.querySelector('.slice_button_container').addEventListener(
10
- 'click',
11
- async () => await this.onClickCallback()
12
- );
13
- //revisar esta verga por si habria q deletear o no
14
- }
15
-
16
- slice.controller.setComponentProps(this, props);
17
- this.debuggerProps = ['value', 'onClickCallback', 'customColor'];
18
- }
19
-
20
- async init() {
21
- if (this.icon) {
22
- this.$icon = await slice.build('Icon', {
23
- name: this.icon,
24
- size: '25px',
25
- color: 'var(--primary-color-contrast)',
26
- // iconStyle: this._icon.iconStyle,
27
- });
28
- this.$button.appendChild(this.$icon);
29
- }
30
- }
31
-
32
- get icon() {
33
- return this._icon;
34
- }
35
-
36
- set icon(value) {
37
- this._icon = value;
38
- if (!this.$icon) return;
39
- this.$icon.name = value.name;
40
- this.$icon.iconStyle = value.iconStyle;
41
- }
42
-
43
- get value() {
44
- return this._value;
45
- }
46
-
47
- set value(value) {
48
- this._value = value;
49
- this.$value.textContent = value;
50
- }
51
-
52
- get customColor() {
53
- return this._customColor;
54
- }
55
-
56
- set customColor(value) {
57
- this._customColor = value;
58
- if (value.button) {
59
- this.style = `--primary-color: ${value.button};`;
60
- }
61
- if (value.label) {
62
- this.$button.style = `--primary-color-contrast: ${value.label};`;
63
- }
64
- }
65
-
66
- handleButtonClick() {
67
- this.onClickCallback();
68
- }
69
- }
70
- window.customElements.define('slice-button', Button);
@@ -1,68 +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
- height: 220px;
10
- position: relative;
11
- font-family: var(--font-family);
12
- background-color: var(--seconday-background-color);
13
- border-radius: var(--border-radius-slice);
14
- transition: all 300ms;
15
- }
16
-
17
- .slice-card:hover {
18
- .card_cover {
19
- height: auto;
20
- transform: translateY(-70%);
21
- box-shadow: 0px 10px 10px #00000050;
22
- }
23
- .card_info {
24
- height: 100%;
25
- transform: translateY(20%);
26
- box-shadow: 0px -10px 10px #00000050;
27
- }
28
- }
29
- .card_cover {
30
- width: 100%;
31
- height: 90%;
32
- background: var(--primary-color);
33
- display: flex;
34
- justify-content: center;
35
- align-items: center;
36
- position: absolute;
37
- z-index: 1;
38
- transition: all 400ms ease;
39
- border-radius: var(--border-radius-slice);
40
- }
41
-
42
- .card_info {
43
- width: 100%;
44
- height: 200px;
45
- bottom: 0;
46
- color: var(--font-secondary-color);
47
- background: var(--secondary-background-color);
48
- position: absolute;
49
- font-size: 20px;
50
- transition: all 400ms cubic-bezier(0.5, 0, 0, 1);
51
- border-radius: var(--border-radius-slice);
52
- }
53
-
54
- .card_info p {
55
- text-align: center;
56
- color: var(--font-secondary-color);
57
- padding: 0px 20px 20px 20px;
58
- font-size: 15px;
59
- display: -webkit-box;
60
- display: -moz-box;
61
- display: box;
62
- -webkit-box-orient: vertical;
63
- -moz-box-orient: vertical;
64
- box-orient: vertical;
65
- -webkit-line-clamp: 5;
66
- line-clamp: 5;
67
- overflow: hidden;
68
- }
@@ -1,7 +0,0 @@
1
- <div class="slice-card">
2
- <div class="card_cover"></div>
3
- <div class="card_info">
4
- <h1 class="title">Slice Card Title</h1>
5
- <p class="text">Slice Card text</p>
6
- </div>
7
- </div>
@@ -1,107 +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.$cover.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: 'sliceJs', iconStyle: 'filled' };
41
- }
42
-
43
- this.$icon = await slice.build('Icon', {
44
- name: this.icon.name,
45
- size: '150px',
46
- color: this.$color.icon,
47
- iconStyle: this._icon.iconStyle,
48
- });
49
- this.$cover.appendChild(this.$icon);
50
- }
51
-
52
- get title() {
53
- return this._title;
54
- }
55
-
56
- set title(value) {
57
- this._title = value;
58
- this.$title.textContent = value;
59
- }
60
-
61
- get text() {
62
- return this._text;
63
- }
64
-
65
- set text(value) {
66
- this._text = value;
67
- this.$text.textContent = value;
68
- }
69
-
70
- get icon() {
71
- return this._icon;
72
- }
73
-
74
- set icon(value) {
75
- this._icon = value;
76
- if (!this.$icon) return;
77
- this.$icon.name = value.name;
78
- this.$icon.iconStyle = value.iconStyle;
79
- }
80
-
81
- get isOpen() {
82
- return this._isOpen;
83
- }
84
-
85
- set isOpen(boolean) {
86
- this._isOpen = boolean;
87
- if (boolean) {
88
- this.$cover.style.zIndex = 0;
89
- } else {
90
- this.$cover.style.zIndex = 1;
91
- }
92
- }
93
-
94
- get customColor() {
95
- return this._customColor;
96
- }
97
-
98
- set customColor(value) {
99
- this._customColor = value;
100
- this.$color = value;
101
- if (value.card) {
102
- this.$cover.style.backgroundColor = value.card;
103
- }
104
- }
105
- }
106
-
107
- 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,8 +0,0 @@
1
- <div class="slice_checkbox_container">
2
- <div class="slice_checkbox">
3
- <label>
4
- <input type="checkbox" />
5
- <div class="checkmark"></div>
6
- </label>
7
- </div>
8
- </div>
@@ -1,86 +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', 'labelPlacement'];
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
- get checked() {
23
- return this._checked;
24
- }
25
-
26
- set checked(value) {
27
- this._checked = value;
28
- this.querySelector('input').checked = value;
29
- }
30
-
31
- get label() {
32
- return this._label;
33
- }
34
-
35
- set label(value) {
36
- this._label = value;
37
- if (this.querySelector('.checkbox_label')) {
38
- this.querySelector('.checkbox_label').textContent = value;
39
- } else {
40
- const label = document.createElement('label');
41
- label.classList.add('checkbox_label');
42
- label.textContent = value;
43
- this.$checkbox.appendChild(label);
44
- }
45
- }
46
-
47
- get customColor() {
48
- return this._customColor;
49
- }
50
-
51
- set customColor(value) {
52
- this._customColor = value;
53
- this.style = `--success-color: ${value};`;
54
- }
55
-
56
- get labelPlacement() {
57
- return this._labelPlacement;
58
- }
59
-
60
- set labelPlacement(value) {
61
- if (value === 'left') {
62
- this.$checkbox.style = ` flex-direction: row-reverse;`;
63
- }
64
- if (value === 'right') {
65
- this.$checkbox.style = `flex-direction: row;`;
66
- }
67
- if (value === 'top') {
68
- this.$checkbox.style = `flex-direction: column-reverse;`;
69
- }
70
- if (value === 'bottom') {
71
- this.$checkbox.style = `flex-direction: column;`;
72
- }
73
- }
74
-
75
- get disabled() {
76
- return this._disabled;
77
- }
78
-
79
- set disabled(value) {
80
- this._disabled = value;
81
- this.querySelector('input').disabled = value;
82
- this.$checkmark.classList.add('disabled');
83
- }
84
- }
85
-
86
- customElements.define('slice-checkbox', Checkbox);
@@ -1,70 +0,0 @@
1
- slice-details {
2
- font-family: var(--font-family);
3
- color: var(--font-primary-color);
4
- }
5
- .details_summary {
6
- cursor: pointer;
7
- display: flex;
8
- align-items: center;
9
- border-bottom: var(--slice-border) solid var(--primary-color);
10
- padding: 10px;
11
- }
12
- .details_summary .caret {
13
- transform: rotate(-90deg);
14
- margin-right: 10px;
15
- color: var(--primary-color);
16
- }
17
- .details_title {
18
- width: 100%;
19
- font-weight: bold;
20
- }
21
- .details_text {
22
- color: var(--font-secondary-color);
23
- }
24
- .details_container {
25
- padding-left: 5px;
26
- padding: 10px;
27
- background-color: var(--secondary-background-color);
28
- border-radius: var(--border-radius-slice);
29
- visibility: hidden;
30
- display: block;
31
- height: 0; /* Inicia con altura 0 */
32
- overflow: hidden;
33
- transition:
34
- height 0.3s ease,
35
- visibility 0.3s ease; /* Agrega transición a height */
36
- }
37
-
38
- .details_open {
39
- height: auto; /* Altura se ajustará automáticamente después de la transición */
40
- visibility: visible;
41
- }
42
-
43
- .symbol {
44
- border-radius: 5px;
45
- width: 20px;
46
- height: 20px;
47
- position: relative;
48
- transition: transform 0.3s ease;
49
- }
50
-
51
- .symbol::before,
52
- .symbol::after {
53
- content: '';
54
- position: absolute;
55
- background-color: var(--primary-color);
56
- width: 15px;
57
- height: 2px;
58
- top: 50%;
59
- left: 0;
60
- transition: transform 0.5s ease;
61
- }
62
-
63
- .symbol.plus::after {
64
- transform: rotate(90deg);
65
- }
66
-
67
- .symbol.minus::before,
68
- .symbol.minus::after {
69
- transform: rotate(360deg);
70
- }
@@ -1,9 +0,0 @@
1
- <div class="details_summary">
2
- <div class="symbol plus"></div>
3
- <span class="details_title"></span>
4
- </div>
5
- <div class="details_container">
6
- <div class="full_details">
7
- <div class="details_text"></div>
8
- </div>
9
- </div>
@@ -1,76 +0,0 @@
1
- export default class Details extends HTMLElement {
2
- constructor(props) {
3
- super();
4
- slice.attachTemplate(this);
5
-
6
- this.$detailsTitle = this.querySelector('.details_title');
7
- this.$detailsText = this.querySelector('.details_text');
8
- this.$details = this.querySelector('.full_details');
9
- this.$summary = this.querySelector('.details_summary');
10
- this.$container = this.querySelector('.details_container'); // Referencia al contenedor
11
-
12
- this.$summary.addEventListener('click', () => {
13
- this.toggleDetails();
14
- });
15
-
16
- slice.controller.setComponentProps(this, props);
17
- this.debuggerProps = ['title', 'text'];
18
- }
19
-
20
- toggleDetails() {
21
- const isOpen = this.$container.classList.toggle('details_open');
22
- const symbol = this.$summary.querySelector('.symbol');
23
-
24
- if (isOpen) {
25
- symbol.classList.remove('plus');
26
- symbol.classList.add('minus');
27
-
28
- // Obtener la altura total del contenedor
29
- const fullHeight = this.$container.scrollHeight + 'px';
30
-
31
- // Establecer la altura para iniciar la animación
32
- this.$container.style.height = fullHeight;
33
-
34
- // Después de la transición, ajustar la altura a 'auto'
35
- this.$container.addEventListener('transitionend', function onTransitionEnd() {
36
- this.style.height = 'auto';
37
- this.removeEventListener('transitionend', onTransitionEnd);
38
- });
39
- } else {
40
- symbol.classList.remove('minus');
41
- symbol.classList.add('plus');
42
-
43
- // Establecer la altura para iniciar la animación de cierre
44
- this.$container.style.height = this.$container.scrollHeight + 'px';
45
-
46
- // Forzar el reflujo para que la transición funcione
47
- requestAnimationFrame(() => {
48
- this.$container.style.height = '0';
49
- });
50
- }
51
- }
52
-
53
- get title() {
54
- return this._title;
55
- }
56
-
57
- set title(value) {
58
- this._title = value;
59
- this.$detailsTitle.textContent = value;
60
- }
61
-
62
- get text() {
63
- return this._text;
64
- }
65
-
66
- set text(value) {
67
- this._text = value;
68
- this.$detailsText.textContent = value;
69
- }
70
-
71
- addDetail(value) {
72
- this.$details.appendChild(value);
73
- }
74
- }
75
-
76
- customElements.define('slice-details', Details);
@@ -1,60 +0,0 @@
1
- .slice_dropdown_label {
2
- cursor: pointer;
3
- }
4
- .slice_dropdown {
5
- cursor: pointer;
6
- user-select: none;
7
- display: flex;
8
- justify-content: center;
9
- display: flex;
10
- border-radius: var(--border-radius-slice);
11
- border: var(--slice-border) solid var(--primary-color);
12
- align-items: center;
13
- }
14
- .slice_dropdown .caret {
15
- margin-left: 10px;
16
- border-top-color: var(--primary-color-contrast);
17
- }
18
- .slice_dropbox {
19
- display: flex;
20
- flex-direction: column;
21
- border: var(--slice-border) solid var(--primary-color);
22
- list-style: none;
23
- font-family: var(--font-family);
24
- visibility: hidden;
25
- overflow: hidden;
26
- position: absolute;
27
- opacity: 0;
28
- transition: 0s, opacity 0.3s;
29
- top: 100%;
30
- z-index: 1;
31
- background-color: var(--primary-color);
32
- border-radius: var(--border-radius-slice);
33
- box-shadow: 0 0 10px 0 #00000050;
34
- }
35
- .slice_dropbox_open {
36
- overflow-y: scroll;
37
- min-height: min-content;
38
- max-height: 200px;
39
- visibility: visible;
40
- opacity: 1;
41
- }
42
- .slice_dropbox_open::-webkit-scrollbar {
43
- width: 5px;
44
- }
45
- .slice_dropbox_open::-webkit-scrollbar-thumb {
46
- background: var(--secondary-color);
47
- border-radius: var(--border-radius-slice);
48
- }
49
- .slice_dropbox {
50
- width: 100%;
51
- }
52
- .slice_dropbox_open div a {
53
- text-decoration: none;
54
- color: var(--primary-color-contrast);
55
- width: 100%;
56
- }
57
- .slice_dropbox_open div {
58
- width: 100%;
59
- padding: 5px;
60
- }
@@ -1,5 +0,0 @@
1
- <div class="slice_dropdown">
2
- <label class="slice_dropdown_label"></label>
3
- <div class="caret"></div>
4
- </div>
5
- <div class="slice_dropbox"></div>