mithril-materialized 2.0.0-beta.10 → 2.0.0-beta.12

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/README.md CHANGED
@@ -20,7 +20,7 @@ This is a **major breaking release** that removes all external JavaScript depend
20
20
 
21
21
  - **Removed dependencies**: No longer requires `materialize-css` or `material-icons` packages
22
22
  - **Component updates**: DatePicker and TimePicker now have custom implementations
23
- - **Icon changes**: Uses custom SVG icons instead of Material Icons font
23
+ - **Icon changes**: Library uses custom SVG icons. Material Icons font is supported too, but not required.
24
24
  - **Installation**: Simpler installation process with fewer dependencies
25
25
 
26
26
  ### 📈 Migration from v1.x
@@ -81,7 +81,11 @@ Your CSS imports can remain the same, but you no longer need the materialize-css
81
81
  - MaterialBox
82
82
  - Carousel
83
83
  - Pagination
84
+ - PaginationControls
84
85
  - Parallax
86
+ - Data & Tables
87
+ - DataTable (sorting, filtering, pagination, selection)
88
+ - TreeView (hierarchical data with expand/collapse, selection, and customizable icons)
85
89
  - Additional
86
90
  - Label
87
91
  - HelperText
@@ -114,6 +118,8 @@ Your CSS imports can remain the same, but you no longer need the materialize-css
114
118
  TextInput,
115
119
  Button,
116
120
  DatePicker,
121
+ DataTable,
122
+ TreeView,
117
123
  ThemeToggle,
118
124
  FileUpload,
119
125
  Sidenav,
@@ -154,6 +160,25 @@ Your CSS imports can remain the same, but you no longer need the materialize-css
154
160
  accept: 'image/*',
155
161
  multiple: true,
156
162
  onFilesSelected: (files) => console.log(files)
163
+ }),
164
+
165
+ // TreeView for hierarchical data
166
+ m(TreeView, {
167
+ data: [
168
+ {
169
+ id: 'root',
170
+ label: 'Project Root',
171
+ expanded: true,
172
+ children: [
173
+ { id: 'src', label: 'src/' },
174
+ { id: 'docs', label: 'docs/' },
175
+ ]
176
+ }
177
+ ],
178
+ selectionMode: 'multiple',
179
+ iconType: 'caret',
180
+ showConnectors: true,
181
+ onselection: (selectedIds) => console.log('Selected:', selectedIds)
157
182
  })
158
183
  ])
159
184
  });
@@ -183,36 +208,32 @@ See the [live documentation](https://erikvullings.github.io/mithril-materialized
183
208
  - ✅ Breadcrumb navigation component
184
209
  - ✅ Wizard/Stepper component for multi-step forms
185
210
 
186
- **🔄 Currently Working On:**
187
-
188
- - 🔄 DataTable component with sorting, filtering, and pagination
211
+ **✅ Recently Completed:**
189
212
 
190
- **📋 Phase 1 Remaining:**
191
-
192
- - Enhanced TypeScript definitions with better JSDoc comments
193
- - Performance optimizations and bundle size improvements
213
+ - DataTable component with sorting, filtering, and pagination
214
+ - ✅ TreeView component for hierarchical data with expand/collapse, selection, and VSCode-style connectors
215
+ - Enhanced TypeScript definitions with better JSDoc comments
216
+ - Performance optimizations and bundle size improvements
194
217
 
195
218
  ### 🎯 Phase 2: Advanced Components & Features
196
219
 
197
- **Navigation & Layout:**
198
-
199
- - AppBar/Toolbar component with responsive behavior
200
- - Bottom navigation component for mobile apps
201
- - Drawer/Sidebar component with overlay and push modes
202
- - Grid system enhancements with CSS Grid support
203
-
204
220
  **Data Display:**
205
221
 
206
- - Enhanced DataTable with virtual scrolling for large datasets
207
- - TreeView component for hierarchical data
208
222
  - Card layouts with enhanced Material Design 3.0 styling
209
- - List components with advanced features (virtual scrolling, infinite load)
223
+ - Advanced tree operations (drag & drop, context menus)
210
224
 
211
225
  **Input & Forms:**
212
226
 
213
227
  - Advanced date range picker
214
228
  - Autocomplete with async data loading
215
229
 
230
+ **Navigation & Layout:**
231
+
232
+ - AppBar/Toolbar component with responsive behavior
233
+ - Bottom navigation component for mobile apps
234
+ - Drawer/Sidebar component with overlay and push modes
235
+ - Grid system enhancements with CSS Grid support
236
+
216
237
  ### 🔮 Phase 3: Modern Features & Integration
217
238
 
218
239
  **Developer Experience:**
@@ -240,7 +261,7 @@ See the [live documentation](https://erikvullings.github.io/mithril-materialized
240
261
 
241
262
  **Current Status (v2.0.0-beta.5):**
242
263
 
243
- - Total: 64KB gzipped (44KB JS + 20KB CSS)
264
+ - Total: 70KB gzipped (44KB JS + 26KB CSS)
244
265
  - Modular CSS can reduce bundle by 30-50%
245
266
 
246
267
  **Phase 1 Targets:**
@@ -378,7 +399,7 @@ m(ThemeToggle); // Simple toggle button
378
399
 
379
400
  For advanced customization, you can use the SASS source files directly:
380
401
 
381
- ```scss
402
+ ```css
382
403
  // Import all SASS components
383
404
  @import 'mithril-materialized/sass/materialize.scss';
384
405
 
package/dist/advanced.css CHANGED
@@ -205,21 +205,21 @@ video.responsive-video {
205
205
  height: 30px;
206
206
  }
207
207
  .pagination li a {
208
- color: #444;
208
+ color: var(--mm-text-primary, #444);
209
209
  display: inline-block;
210
210
  font-size: 1.2rem;
211
211
  padding: 0 10px;
212
212
  line-height: 30px;
213
213
  }
214
214
  .pagination li.active a {
215
- color: #fff;
215
+ color: var(--mm-text-on-primary, #fff);
216
216
  }
217
217
  .pagination li.active {
218
218
  background-color: #ee6e73;
219
219
  }
220
220
  .pagination li.disabled a {
221
221
  cursor: default;
222
- color: #999;
222
+ color: var(--mm-text-disabled, #999);
223
223
  }
224
224
  .pagination li i {
225
225
  font-size: 2rem;
@@ -550,8 +550,8 @@ td, th {
550
550
  .collection .collection-item.avatar i.circle {
551
551
  font-size: 18px;
552
552
  line-height: 42px;
553
- color: #fff;
554
- background-color: #999;
553
+ color: var(--mm-text-on-primary, #fff);
554
+ background-color: var(--mm-text-disabled, #999);
555
555
  text-align: center;
556
556
  }
557
557
  .collection .collection-item.avatar .title {
@@ -573,7 +573,7 @@ td, th {
573
573
  color: rgb(234.25, 250.25, 248.75);
574
574
  }
575
575
  .collection .collection-item.active .secondary-content {
576
- color: #fff;
576
+ color: var(--mm-text-on-primary, #fff);
577
577
  }
578
578
  .collection a.collection-item {
579
579
  display: block;
package/dist/button.d.ts CHANGED
@@ -1,30 +1,75 @@
1
1
  import m, { FactoryComponent, Attributes } from 'mithril';
2
+ import { MaterialPosition, IconClass, ButtonVariant } from './types';
3
+ /**
4
+ * HTML attributes that can be passed to button elements
5
+ * @deprecated Use native HTML attributes directly instead
6
+ */
2
7
  export interface HtmlAttrs {
3
8
  id?: string;
4
9
  for?: string;
5
10
  placeholder?: string;
6
11
  autofocus?: boolean;
7
12
  disabled?: boolean;
8
- type?: 'submit' | 'button' | 'text' | 'textarea' | 'number';
13
+ type?: 'submit' | 'button' | 'reset';
9
14
  }
15
+ /**
16
+ * Enhanced button attributes with improved TypeScript support
17
+ * @example
18
+ * ```typescript
19
+ * // Basic button
20
+ * m(Button, { label: 'Click me' })
21
+ *
22
+ * // Submit button with icon
23
+ * m(Button, {
24
+ * variant: { type: 'submit' },
25
+ * label: 'Save',
26
+ * iconName: 'save',
27
+ * iconClass: 'small left'
28
+ * })
29
+ *
30
+ * // Modal trigger button
31
+ * m(Button, {
32
+ * variant: { type: 'modal', modalId: 'my-modal' },
33
+ * label: 'Open Modal'
34
+ * })
35
+ * ```
36
+ */
10
37
  export interface ButtonAttrs extends Attributes {
11
- /** Optional (e.g. in case you only want to use an icon) button label */
38
+ /** Button label text (optional for icon-only buttons) */
12
39
  label?: string;
13
- /** Optional icon material-icons name, @see https://materializecss.com/icons.html */
40
+ /** Material icon name - see https://materializecss.com/icons.html */
14
41
  iconName?: string;
15
- /** Optional icon class, e.g. tiny (1em), small (2em), medium (4em), large (6em), or 'tiny right' */
16
- iconClass?: string;
17
42
  /**
18
- * If the button is intended to open a modal, specify its modal id so we can trigger it,
19
- * @see https://materializecss.com/modals.html
43
+ * Icon size and position class
44
+ * @example 'small', 'medium left', 'large right'
45
+ */
46
+ iconClass?: IconClass;
47
+ /**
48
+ * Button behavior variant - determines button type and behavior
49
+ * @example
50
+ * { type: 'button' } - Standard button
51
+ * { type: 'submit' } - Form submit button
52
+ * { type: 'modal', modalId: 'my-modal' } - Modal trigger
53
+ * { type: 'reset' } - Form reset button
54
+ */
55
+ variant?: ButtonVariant;
56
+ /**
57
+ * @deprecated Use variant instead
58
+ * If the button is intended to open a modal, specify its modal id so we can trigger it
20
59
  */
21
60
  modalId?: string;
22
- /** Some additional HTML attributes that can be attached to the button */
61
+ /**
62
+ * @deprecated Use native HTML attributes directly instead
63
+ * Some additional HTML attributes that can be attached to the button
64
+ */
23
65
  attr?: HtmlAttrs;
24
- /** Optional text-based tooltip, @see https://materializecss.com/tooltips.html */
66
+ /** Tooltip text to display on hover */
25
67
  tooltip?: string;
26
- /** Optional location for the tooltip */
27
- tooltipPostion?: 'top' | 'bottom' | 'left' | 'right';
68
+ /**
69
+ * Tooltip position
70
+ * @fixed typo: tooltipPostion -> tooltipPosition
71
+ */
72
+ tooltipPosition?: MaterialPosition;
28
73
  }
29
74
  /**
30
75
  * A factory to create new buttons.