@natachah/vanilla-frontend 0.0.4 → 0.1.0

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 (75) hide show
  1. package/.gitlab-ci.yml +7 -0
  2. package/docs/pages/{components → base}/media.html +2 -2
  3. package/docs/pages/{layout → base}/reset.html +2 -2
  4. package/docs/pages/{layout → base}/typography.html +2 -2
  5. package/docs/pages/components/badge.html +2 -2
  6. package/docs/pages/components/breadcrumb.html +1 -1
  7. package/docs/pages/components/button.html +2 -2
  8. package/docs/pages/components/card.html +1 -1
  9. package/docs/pages/components/dialog.html +1 -1
  10. package/docs/pages/components/disclosure.html +1 -1
  11. package/docs/pages/components/dropdown.html +2 -2
  12. package/docs/pages/components/form.html +2 -2
  13. package/docs/pages/components/list.html +1 -1
  14. package/docs/pages/components/loading.html +1 -1
  15. package/docs/pages/components/progress.html +1 -1
  16. package/docs/pages/components/slider.html +1 -1
  17. package/docs/pages/components/table.html +1 -1
  18. package/docs/pages/javascript/sortable.html +10 -10
  19. package/docs/pages/javascript/tree.html +5 -5
  20. package/docs/pages/{layout → layouts}/grid.html +1 -1
  21. package/docs/pages/quick-start/conventions.html +7 -7
  22. package/docs/pages/quick-start/customization.html +59 -62
  23. package/docs/pages/quick-start/installation.html +31 -28
  24. package/docs/pages/quick-start/mixins.html +29 -11
  25. package/docs/src/js/demo.js +1 -1
  26. package/docs/src/js/doc-layout.js +9 -6
  27. package/docs/src/scss/demo.scss +2 -2
  28. package/docs/src/scss/layout.scss +1 -1
  29. package/docs/src/scss/style.scss +2 -2
  30. package/esbuild.mjs +1 -1
  31. package/js/_autofill.js +0 -1
  32. package/js/_check-all.js +0 -1
  33. package/js/_comfort.js +0 -1
  34. package/js/_consent.js +0 -1
  35. package/js/_dialog.js +0 -1
  36. package/js/_dropdown.js +0 -1
  37. package/js/_scroll.js +0 -1
  38. package/js/_sidebar.js +0 -1
  39. package/js/_slider.js +0 -1
  40. package/js/_sortable.js +4 -3
  41. package/js/_tabpanel.js +0 -1
  42. package/js/_toggle.js +0 -1
  43. package/js/_tree.js +2 -3
  44. package/js/tests/sortable.test.js +4 -4
  45. package/js/tests/tree.test.js +5 -5
  46. package/js/utilities/_base-component.js +0 -1
  47. package/js/utilities/_cookie.js +0 -1
  48. package/js/utilities/_error.js +0 -1
  49. package/js/utilities/_form-helper.js +0 -1
  50. package/package.json +2 -2
  51. package/scss/abstracts/_default.scss +21 -0
  52. package/scss/{utilities/_mixin.scss → abstracts/_mixins.scss} +49 -15
  53. package/scss/{variables/_setting.scss → abstracts/_options.scss} +5 -24
  54. package/scss/{_media.scss → base/_media.scss} +1 -2
  55. package/scss/{utilities → base}/_reset.scss +2 -3
  56. package/scss/{utilities → base}/_typography.scss +1 -2
  57. package/scss/base/index.scss +3 -0
  58. package/scss/{_badge.scss → components/_badge.scss} +5 -4
  59. package/scss/{_breadcrumb.scss → components/_breadcrumb.scss} +0 -1
  60. package/scss/{_button.scss → components/_button.scss} +2 -1
  61. package/scss/{_card.scss → components/_card.scss} +9 -8
  62. package/scss/{_dialog.scss → components/_dialog.scss} +7 -23
  63. package/scss/{_disclosure.scss → components/_disclosure.scss} +2 -1
  64. package/scss/{_dropdown.scss → components/_dropdown.scss} +7 -6
  65. package/scss/{_form.scss → components/_form.scss} +2 -1
  66. package/scss/{_group.scss → components/_group.scss} +3 -1
  67. package/scss/{_list.scss → components/_list.scss} +4 -3
  68. package/scss/{_loading.scss → components/_loading.scss} +0 -1
  69. package/scss/{_progress.scss → components/_progress.scss} +0 -1
  70. package/scss/{_slider.scss → components/_slider.scss} +0 -1
  71. package/scss/{_table.scss → components/_table.scss} +0 -1
  72. package/scss/components/index.scss +14 -0
  73. package/scss/{_grid.scss → layouts/_grid.scss} +1 -2
  74. package/scss/{variables → themes}/_root.scss +0 -1
  75. package/scss/vanilla-frontend.scss +19 -21
@@ -21,42 +21,45 @@
21
21
  <p>Then you can import the <b>SCSS</b> files:</p>
22
22
 
23
23
  <doc-code data-type="scss">
24
- @import '@natachah/vanilla-frontend/scss/vanilla-frontend.scss';
24
+ @use '@natachah/vanilla-frontend/scss/vanilla-frontend.scss';
25
25
  </doc-code>
26
26
 
27
27
  <p>Or better, include only the files that you need, here the template with all files:</p>
28
28
 
29
29
  <doc-code data-type="scss">
30
- // Can be overide by your own variables files
31
- @import '@natachah/vanilla-frontend/scss/variables/_root';
32
- @import '@natachah/vanilla-frontend/scss/variables/_setting';
33
-
34
- // Utilities
35
- @import '@natachah/vanilla-frontend/scss/utilities/_mixin';
36
- @import '@natachah/vanilla-frontend/scss/utilities/_reset';
37
- @import '@natachah/vanilla-frontend/scss/utilities/_typography';
38
-
39
- // Components
40
- @import '@natachah/vanilla-frontend/scss/_badge';
41
- @import '@natachah/vanilla-frontend/scss/_breadcrumb';
42
- @import '@natachah/vanilla-frontend/scss/_button';
43
- @import '@natachah/vanilla-frontend/scss/_card';
44
- @import '@natachah/vanilla-frontend/scss/_dialog';
45
- @import '@natachah/vanilla-frontend/scss/_disclosure';
46
- @import '@natachah/vanilla-frontend/scss/_dropdown';
47
- @import '@natachah/vanilla-frontend/scss/_form';
48
- @import '@natachah/vanilla-frontend/scss/_grid';
49
- @import '@natachah/vanilla-frontend/scss/_group';
50
- @import '@natachah/vanilla-frontend/scss/_list';
51
- @import '@natachah/vanilla-frontend/scss/_loading';
52
- @import '@natachah/vanilla-frontend/scss/_media';
53
- @import '@natachah/vanilla-frontend/scss/_progress';
54
- @import '@natachah/vanilla-frontend/scss/_slider';
55
- @import '@natachah/vanilla-frontend/scss/_table';
30
+ // Should be overide by your own files
31
+ @use '@natachah/vanilla-frontend/scss/themes/_root';
32
+
33
+ // If you need to use the mixin
34
+ @use '@natachah/vanilla-frontend/scss/abstracts/_mixin';
35
+
36
+ // Base files (reset, typography and media)
37
+ @use "@natachah/vanilla-frontend/scss/base";
38
+
39
+ // Layouts
40
+ @use "@natachah/vanilla-frontend/scss/layouts/grid";
41
+
42
+ // Components files (or: @use "@natachah/vanilla-frontend/scss/components";)
43
+ @use '@natachah/vanilla-frontend/scss/components/_badge';
44
+ @use '@natachah/vanilla-frontend/scss/components/_breadcrumb';
45
+ @use '@natachah/vanilla-frontend/scss/components/_button';
46
+ @use '@natachah/vanilla-frontend/scss/components/_card';
47
+ @use '@natachah/vanilla-frontend/scss/components/_dialog';
48
+ @use '@natachah/vanilla-frontend/scss/components/_disclosure';
49
+ @use '@natachah/vanilla-frontend/scss/components/_dropdown';
50
+ @use '@natachah/vanilla-frontend/scss/components/_form';
51
+ @use '@natachah/vanilla-frontend/scss/components/_grid';
52
+ @use '@natachah/vanilla-frontend/scss/components/_group';
53
+ @use '@natachah/vanilla-frontend/scss/components/_list';
54
+ @use '@natachah/vanilla-frontend/scss/components/_loading';
55
+ @use '@natachah/vanilla-frontend/scss/components/_progress';
56
+ @use '@natachah/vanilla-frontend/scss/components/_slider';
57
+ @use '@natachah/vanilla-frontend/scss/components/_table';
58
+
56
59
  </doc-code>
57
60
 
58
61
  <blockquote>
59
- <p>There is no required files, but it's recommanded to have at least the reset and typography...</p>
62
+ <p>There is no required files, but it's recommanded to have at least the <b>base/*</b> and the <b>themes/root</b></p>
60
63
  </blockquote>
61
64
 
62
65
  <p>Import the <b>Javascript</b> files that you need, here the template:</p>
@@ -17,7 +17,7 @@
17
17
  <p>To use them, import this file:</p>
18
18
 
19
19
  <doc-code data-type="scss">
20
- @import '@natachah/vanilla-frontend/scss/utilities/_mixin';
20
+ @use '@natachah/vanilla-frontend/scss/abstracts/_mixin';
21
21
  </doc-code>
22
22
 
23
23
  <h2>Create an item</h2>
@@ -42,13 +42,13 @@
42
42
  /// @access public
43
43
  ///
44
44
 
45
- @include as-item($name, $states: (), $properties: $default-item-properties)
45
+ @include as-item($name, $states: (), $properties: default.$item-properties)
46
46
  </doc-code>
47
47
 
48
48
  <p>This mixin also include the <b>outline</b> and <b>color</b> variations. It also create some CSS custom properties with the <code>$name</code> value as <code>--{$name}-color</code> with fallback values from the <code>$properties</code>.</p>
49
49
 
50
50
  <blockquote class="warning">
51
- <p>The default properties are set inside the <code>$default-item-properties</code> variable of the file <code>./scss/variables/_setting.scss</code></p>
51
+ <p>The default properties are set inside the <code>default.$item-properties</code> variable of the file <code>./scss/variables/_setting.scss</code></p>
52
52
  </blockquote>
53
53
 
54
54
  <h2>Create a list</h2>
@@ -64,13 +64,31 @@
64
64
  /// @access public
65
65
  ///
66
66
 
67
- @include as-list($name, $states: (), $properties: $default-item-properties)
67
+ @include as-list($name, $states: (), $properties: default.$item-properties)
68
68
  </doc-code>
69
69
 
70
70
  <blockquote>
71
71
  <p>This mixin is used for the <b>list</b> and <b>dropdown</b> components</p>
72
72
  </blockquote>
73
73
 
74
+ <h2>Add header and footer to an item</h2>
75
+
76
+ <p>This mixin will create a header and a footer with negativ margin, some padding and a divider border.</p>
77
+
78
+ <doc-code data-type="scss">
79
+ /// Create a basic item with an header and a footer style
80
+ ///
81
+ /// @param {string} $name - Name of the component
82
+ /// @param {array} $properties - List of default properties (check in /variables/_setting.scss)
83
+ /// @access public
84
+ ///
85
+ @mixin with-header-and-footer($name, $properties: default.$item-properties)
86
+ </doc-code>
87
+
88
+ <blockquote>
89
+ <p>This mixin is used in <b>Dialog</b> components</p>
90
+ </blockquote>
91
+
74
92
  <h2>Set outline variation</h2>
75
93
 
76
94
  <p>This mixin will create the <code>.outline</code> class to transform an item to the outline varation.</p>
@@ -95,7 +113,7 @@
95
113
  </doc-code>
96
114
  <doc-code id="setting" data-type="scss" role="tabpanel">
97
115
  $outline-variations: (
98
- my-component-name
116
+ my-component-name
99
117
  );
100
118
  </doc-code>
101
119
  </div>
@@ -126,7 +144,7 @@
126
144
  </doc-code>
127
145
  <doc-code id="setting" data-type="scss" role="tabpanel">
128
146
  $color-variations: (
129
- my-component-name: (primary, other-color)
147
+ my-component-name: (primary, other-color)
130
148
  );
131
149
  </doc-code>
132
150
  </div>
@@ -167,9 +185,9 @@
167
185
  </doc-code>
168
186
  <doc-code id="scss" data-type="scss" role="tabpanel">
169
187
  @container (max-width:800px) {
170
- table {
171
- @include as-responsive-table()
172
- }
188
+ table {
189
+ @include as-responsive-table()
190
+ }
173
191
  }
174
192
  </doc-code>
175
193
  <doc-code id="css" data-type="css" role="tabpanel">
@@ -201,11 +219,11 @@
201
219
  </doc-code>
202
220
  <doc-code id="scss" data-type="scss" role="tabpanel">
203
221
  #wider {
204
- @include flex-grid-wider-column(3)
222
+ @include flex-grid-wider-column(3)
205
223
  }
206
224
 
207
225
  #offset {
208
- @include flex-grid-offset-column(2)
226
+ @include flex-grid-offset-column(2)
209
227
  }
210
228
  </doc-code>
211
229
  </div>
@@ -5,7 +5,7 @@
5
5
  * This is the code for the demonstration code
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
8
+
9
9
  * @copyright Natacha Herth, design & web development
10
10
  *
11
11
  */
@@ -18,7 +18,7 @@ class DocLayout extends HTMLElement {
18
18
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pin-angle" viewBox="0 0 16 16">
19
19
  <path d="M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a6 6 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707s.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a6 6 0 0 1 1.013.16l3.134-3.133a3 3 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146m.122 2.112v-.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a5 5 0 0 0-.288-.076 5 5 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a5 5 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034q.172.002.343-.04L9.927 2.028q-.042.172-.04.343a1.8 1.8 0 0 0 .062.46z"/>
20
20
  </svg>
21
- 0.0.1
21
+ 0.1.0
22
22
  </span>
23
23
  </li>
24
24
  <li>
@@ -55,11 +55,15 @@ class DocLayout extends HTMLElement {
55
55
  <li><a href="/pages/quick-start/mixins.html">SCSS Mixins</a></li>
56
56
  <li><a href="/pages/quick-start/conventions.html">Conventions</a></li>
57
57
  </ul>
58
- <h2>Layout</h2>
58
+ <h2>Base</h2>
59
59
  <ul>
60
- <li><a href="/pages/layout/reset.html">Reset</a></li>
61
- <li><a href="/pages/layout/typography.html">Typography</a></li>
62
- <li><a href="/pages/layout/grid.html">Grid</a></li>
60
+ <li><a href="/pages/base/reset.html">Reset</a></li>
61
+ <li><a href="/pages/base/typography.html">Typography</a></li>
62
+ <li><a href="/pages/base/media.html">Media</a></li>
63
+ </ul>
64
+ <h2>Layouts</h2>
65
+ <ul>
66
+ <li><a href="/pages/layouts/grid.html">Grid</a></li>
63
67
  </ul>
64
68
  <h2>Components</h2>
65
69
  <ul>
@@ -73,7 +77,6 @@ class DocLayout extends HTMLElement {
73
77
  <li><a href="/pages/components/form.html">Form</a></li>
74
78
  <li><a href="/pages/components/list.html">List</a></li>
75
79
  <li><a href="/pages/components/loading.html">Loading</a></li>
76
- <li><a href="/pages/components/media.html">Media</a></li>
77
80
  <li><a href="/pages/components/progress.html">Progress</a></li>
78
81
  <li><a href="/pages/components/slider.html">Slider</a></li>
79
82
  <li><a href="/pages/components/table.html">Table</a></li>
@@ -5,11 +5,11 @@
5
5
  /// This is the style for demonstration bloc
6
6
  ///
7
7
  /// @author Natacha Herth
8
- /// @since 1.0.0
8
+
9
9
  ///
10
10
  ////
11
11
 
12
- @import './../../../scss/utilities/_mixin.scss';
12
+ @use './../../../scss/abstracts/mixins' as *;
13
13
 
14
14
  // Demo for grid offset
15
15
  #flexGridDemoOffset {
@@ -5,7 +5,7 @@
5
5
  /// This is the style for the basic layout with a sidebar
6
6
  ///
7
7
  /// @author Natacha Herth
8
- /// @since 1.0.0
8
+
9
9
  ///
10
10
  ////
11
11
 
@@ -5,11 +5,11 @@
5
5
  /// This is the style for the website
6
6
  ///
7
7
  /// @author Natacha Herth
8
- /// @since 1.0.0
8
+
9
9
  ///
10
10
  ////
11
11
 
12
- @import './../../../scss/utilities/_mixin.scss';
12
+ @use './../../../scss/abstracts/mixins' as *;
13
13
 
14
14
  :root {
15
15
 
package/esbuild.mjs CHANGED
@@ -5,7 +5,7 @@ import autoprefixer from 'autoprefixer'
5
5
 
6
6
  esbuild
7
7
  .build({
8
- entryPoints: ["scss/vanilla-frontend.scss", "js/vanilla-frontend.js"],
8
+ entryPoints: ["scss/vanilla-frontend.scss"],
9
9
  entryNames: '[name]',
10
10
  outbase: "./",
11
11
  outdir: './bundles',
package/js/_autofill.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to automatic filling some fields from another
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
package/js/_check-all.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to un/check a list of checkboxes
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
package/js/_comfort.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class create and manage the cookies for saving theme and style changes for visual comfort
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
package/js/_consent.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class create and manage the cookies for saving the consent to comply the GDPR
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
package/js/_dialog.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionalities for open/close/submit an HTML dialog
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
package/js/_dropdown.js CHANGED
@@ -6,7 +6,6 @@
6
6
  * This component is a simpler version of the Toggle
7
7
  *
8
8
  * @author Natacha Herth
9
- * @version 0.0.1
10
9
  * @copyright Natacha Herth, design & web development
11
10
  *
12
11
  */
package/js/_scroll.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This script enable an HTML element to scroll to a position and to spy some buttons
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
package/js/_sidebar.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to toggles multiple tabpanel
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  *
11
10
  */
package/js/_slider.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to make an element slider
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  *
11
10
  * * keep check on the scrollend event: https://caniuse.com/?search=scrollend
package/js/_sortable.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to sort a list or a table
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
@@ -27,9 +26,11 @@ export default class Sortable extends BaseComponent {
27
26
  super(el, options, 'sortable')
28
27
 
29
28
  // Define the properties
30
- this._withHandle = this._element.querySelector('[data-handle]') ? true : false
29
+ this._withHandle = this._element.querySelector('[data-handle=sortable]') ? true : false
31
30
  this._current = null
32
31
 
32
+ console.log(this)
33
+
33
34
  // Init the event listener
34
35
  this.#init()
35
36
 
@@ -49,7 +50,7 @@ export default class Sortable extends BaseComponent {
49
50
  this.items.forEach((item) => {
50
51
 
51
52
  // Toggle the [dragable] attribute
52
- item.addEventListener('mousedown', (e) => { if (!this._withHandle || e.target.hasAttribute('data-handle')) item.draggable = true })
53
+ item.addEventListener('mousedown', (e) => { if (!this._withHandle || (e.target.hasAttribute('data-handle') && e.target.getAttribute('data-handle') === 'sortable')) item.draggable = true })
53
54
  item.addEventListener('mouseup', () => item.draggable = false)
54
55
 
55
56
  // Drag and drop events
package/js/_tabpanel.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to toggles multiple tabpanel
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  *
11
10
  */
package/js/_toggle.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to un/collapse some element by another
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  *
11
10
  * * NOTE: Check availability of the ariaControlsElements to select the #ids
package/js/_tree.js CHANGED
@@ -5,7 +5,6 @@
5
5
  * This class enable the functionality to expand/contract element as a tree
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
@@ -28,7 +27,7 @@ export default class Tree extends BaseComponent {
28
27
  // Define the properties
29
28
  this._type = this._element.role == 'tree' ? 'list' : 'grid'
30
29
 
31
- this._withHandle = this._element.querySelector('[data-handle]') ? true : false
30
+ this._withHandle = this._element.querySelector('[data-handle=tree]') ? true : false
32
31
 
33
32
  this._items = this._element.querySelectorAll('[aria-expanded]')
34
33
 
@@ -45,7 +44,7 @@ export default class Tree extends BaseComponent {
45
44
  #init() {
46
45
 
47
46
  this._items.forEach(item => item.addEventListener('click', (e) => {
48
- if (!this._withHandle || e.target.hasAttribute('data-handle')) {
47
+ if (!this._withHandle || (e.target.hasAttribute('data-handle') && e.target.getAttribute('data-handle') === 'tree')) {
49
48
  e.stopPropagation()
50
49
  this.toggle(item)
51
50
  }
@@ -34,9 +34,9 @@ beforeAll(() => {
34
34
  '<li draggable="false">Three</li>' +
35
35
  '</ul>' +
36
36
  '<table id="fakeTable">' +
37
- '<tr draggable="false"><td data-handle>DRAG</td><td>One</td></tr>' +
38
- '<tr draggable="false"><td data-handle>DRAG</td><td>Two</td></tr>' +
39
- '<tr draggable="false"><td data-handle>DRAG</td><td>Three</td></tr>' +
37
+ '<tr draggable="false"><td data-handle="sortable">DRAG</td><td>One</td></tr>' +
38
+ '<tr draggable="false"><td data-handle="sortable">DRAG</td><td>Two</td></tr>' +
39
+ '<tr draggable="false"><td data-handle="sortable">DRAG</td><td>Three</td></tr>' +
40
40
  '</table>'
41
41
 
42
42
  fakeListSortable = new Sortable(document.getElementById('fakeList'))
@@ -70,7 +70,7 @@ describe('Mousedown & Mouseup', () => {
70
70
 
71
71
  test('With handle & Mouseup toggle the [draggable] attribute', () => {
72
72
  const item = document.querySelector('#fakeTable tr')
73
- const handle = document.querySelector('#fakeTable tr:first-child [data-handle]')
73
+ const handle = document.querySelector('#fakeTable tr:first-child [data-handle=sortable]')
74
74
  const customMousedown = new MouseEvent('mousedown')
75
75
  Object.defineProperty(customMousedown, 'target', { value: handle }) // Define the mousedown event with custom target
76
76
  expect(item.draggable).toBeFalsy()
@@ -41,8 +41,8 @@ beforeAll(() => {
41
41
  '</ul>' +
42
42
  '<table id="fakeGridTree" role="treegrid">' +
43
43
  '<tr aria-level="1"><td></td></tr>' +
44
- '<tr aria-level="1" aria-expanded="false" aria-owns="lvl2"><td data-handle></td></tr>' +
45
- '<tr id="lvl2" aria-level="2" aria-expanded="false" aria-owns="lvl3" hidden><td data-handle></td></tr>' +
44
+ '<tr aria-level="1" aria-expanded="false" aria-owns="lvl2"><td data-handle="tree"></td></tr>' +
45
+ '<tr id="lvl2" aria-level="2" aria-expanded="false" aria-owns="lvl3" hidden><td data-handle="tree"></td></tr>' +
46
46
  '<tr id="lvl3" aria-level="3" hidden><td></td></tr>' +
47
47
  '<tr aria-level="1"><td></td></tr>' +
48
48
  '</table>'
@@ -53,7 +53,7 @@ beforeAll(() => {
53
53
  fakeRow = fakeGridTree._element.querySelector('tr[aria-level="1"][aria-expanded]')
54
54
 
55
55
  customClick = new MouseEvent('click')
56
- Object.defineProperty(customClick, 'target', { value: fakeRow.querySelector('[data-handle]') }) // Define the click event with custom target
56
+ Object.defineProperty(customClick, 'target', { value: fakeRow.querySelector('[data-handle=tree]') }) // Define the click event with custom target
57
57
 
58
58
  })
59
59
 
@@ -130,10 +130,10 @@ describe('#Toggle()', () => {
130
130
  const lvl3 = document.getElementById('lvl3')
131
131
 
132
132
  const customClickLvl2 = new MouseEvent('click')
133
- Object.defineProperty(customClickLvl2, 'target', { value: lvl2.querySelector('[data-handle]') }) // Define the click event with custom target
133
+ Object.defineProperty(customClickLvl2, 'target', { value: lvl2.querySelector('[data-handle=tree]') }) // Define the click event with custom target
134
134
 
135
135
  const customClickLvl3 = new MouseEvent('click')
136
- Object.defineProperty(customClickLvl3, 'target', { value: lvl3.querySelector('[data-handle]') }) // Define the click event with custom target
136
+ Object.defineProperty(customClickLvl3, 'target', { value: lvl3.querySelector('[data-handle=tree]') }) // Define the click event with custom target
137
137
 
138
138
  fireEvent(fakeRow, customClick)
139
139
  fireEvent(lvl2, customClickLvl2)
@@ -5,7 +5,6 @@
5
5
  * This class regroup common functionalities for other classes
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
@@ -5,7 +5,6 @@
5
5
  * This class create and manage the cookies
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
@@ -5,7 +5,6 @@
5
5
  * This make global error message
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
@@ -5,7 +5,6 @@
5
5
  * This class regroup some helper function for forms
6
6
  *
7
7
  * @author Natacha Herth
8
- * @version 0.0.1
9
8
  * @copyright Natacha Herth, design & web development
10
9
  */
11
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natachah/vanilla-frontend",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "description": "A vanilla frontend framework",
5
5
  "keywords": [
6
6
  "html5",
@@ -29,7 +29,7 @@
29
29
  "@testing-library/dom": "^9.3.4",
30
30
  "@vitest/coverage-v8": "^1.3.1",
31
31
  "autoprefixer": "^10.4.19",
32
- "esbuild": "0.21.5",
32
+ "esbuild": "^0.21.5",
33
33
  "esbuild-sass-plugin": "^3.3.1",
34
34
  "fast-glob": "^3.3.2",
35
35
  "happy-dom": "^13.6.2",
@@ -0,0 +1,21 @@
1
+ ////
2
+ /// ------------------------------------------------------------------
3
+ /// Default values for items
4
+ /// ------------------------------------------------------------------
5
+ /// Setting variables
6
+ ///
7
+ /// @group abstracts
8
+ /// @author Natacha Herth
9
+ ///
10
+ ////
11
+
12
+ $item-properties: (
13
+ color: var(--color-font),
14
+ background: transparent,
15
+ border-size: var(--border-size),
16
+ border-style: var(--border-style),
17
+ border-color: transparent,
18
+ border-radius: var(--border-radius),
19
+ padding-inline: var(--padding-inline),
20
+ padding-block: var(--padding-block)
21
+ );