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 +41 -20
- package/dist/advanced.css +6 -6
- package/dist/button.d.ts +56 -11
- package/dist/components.css +601 -6
- package/dist/core.css +13 -13
- package/dist/datatable.d.ts +291 -0
- package/dist/forms.css +13 -13
- package/dist/icon.d.ts +2 -2
- package/dist/index.css +622 -16
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +1435 -518
- package/dist/index.js +1440 -517
- package/dist/index.min.css +2 -2
- package/dist/index.umd.js +1440 -517
- package/dist/input.d.ts +0 -1
- package/dist/material-icon.d.ts +3 -0
- package/dist/treeview.d.ts +39 -0
- package/dist/types.d.ts +226 -0
- package/dist/utilities.css +16 -9
- package/package.json +6 -3
- package/sass/components/_cards.scss +10 -3
- package/sass/components/_datatable.scss +417 -0
- package/sass/components/_global.scss +6 -6
- package/sass/components/_treeview.scss +353 -0
- package/sass/components/forms/_range.scss +5 -5
- package/sass/components/forms/_select.scss +1 -1
- package/sass/materialize.scss +2 -0
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**:
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
- 🔄 DataTable component with sorting, filtering, and pagination
|
|
211
|
+
**✅ Recently Completed:**
|
|
189
212
|
|
|
190
|
-
|
|
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
|
-
-
|
|
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:
|
|
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
|
-
```
|
|
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' | '
|
|
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
|
-
/**
|
|
38
|
+
/** Button label text (optional for icon-only buttons) */
|
|
12
39
|
label?: string;
|
|
13
|
-
/**
|
|
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
|
-
*
|
|
19
|
-
* @
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
66
|
+
/** Tooltip text to display on hover */
|
|
25
67
|
tooltip?: string;
|
|
26
|
-
/**
|
|
27
|
-
|
|
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.
|