mithril-materialized 3.16.0 → 3.17.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.
- package/README.md +32 -2
- package/dist/advanced.css +92 -1
- package/dist/button.d.ts +3 -1
- package/dist/circular-progress.d.ts +2 -2
- package/dist/combobox.d.ts +35 -0
- package/dist/components.css +127 -14
- package/dist/core.css +278 -3
- package/dist/floating-action-button.d.ts +2 -1
- package/dist/form-section.d.ts +35 -0
- package/dist/forms.css +280 -5
- package/dist/index.css +340 -19
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +697 -296
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +710 -295
- package/dist/index.js.map +1 -0
- package/dist/index.min.css +2 -2
- package/dist/index.umd.js +710 -295
- package/dist/index.umd.js.map +1 -0
- package/dist/input-options.d.ts +4 -1
- package/dist/likert-scale.d.ts +2 -1
- package/dist/linear-progress.d.ts +2 -2
- package/dist/material-icon.d.ts +2 -1
- package/dist/radio.d.ts +9 -0
- package/dist/range-slider.d.ts +3 -2
- package/dist/rating.d.ts +2 -1
- package/dist/search-select.d.ts +15 -2
- package/dist/select.d.ts +14 -1
- package/dist/sidenav.d.ts +6 -0
- package/dist/treeview.d.ts +2 -2
- package/dist/types.d.ts +5 -0
- package/dist/utilities.css +93 -2
- package/dist/utils.d.ts +30 -1
- package/package.json +16 -19
- package/sass/components/_badge-component.scss +8 -0
- package/sass/components/_buttons.scss +9 -9
- package/sass/components/_global.scss +93 -0
- package/sass/components/_likert-scale.scss +24 -0
- package/sass/components/_theme-variables.scss +22 -1
- package/sass/components/_toggle-group.scss +3 -0
- package/sass/components/forms/_form-groups.scss +1 -1
- package/sass/components/forms/_form-section.scss +63 -0
- package/sass/components/forms/_forms.scss +1 -0
- package/sass/components/forms/_input-fields.scss +55 -0
- package/sass/components/forms/_range-enhanced.scss +3 -3
- package/sass/components/forms/_select.scss +85 -0
package/dist/input-options.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Attributes } from 'mithril';
|
|
2
|
+
import { ComponentStyle } from './types';
|
|
2
3
|
export interface InputAttrs<T = string> extends Attributes {
|
|
3
4
|
/** Optional label. */
|
|
4
5
|
label?: string;
|
|
@@ -35,6 +36,8 @@ export interface InputAttrs<T = string> extends Attributes {
|
|
|
35
36
|
* and copy the text from it.
|
|
36
37
|
*/
|
|
37
38
|
readOnly?: boolean;
|
|
39
|
+
/** @deprecated Use readOnly instead. Kept for backward compatibility. */
|
|
40
|
+
readonly?: boolean;
|
|
38
41
|
/** When true, add the autofocus attribute to the input field. */
|
|
39
42
|
autofocus?: (() => boolean) | boolean;
|
|
40
43
|
/** Key down event */
|
|
@@ -70,7 +73,7 @@ export interface InputAttrs<T = string> extends Attributes {
|
|
|
70
73
|
/** Sets the input field to disabled. */
|
|
71
74
|
disabled?: boolean;
|
|
72
75
|
/** Optional style information. */
|
|
73
|
-
style?:
|
|
76
|
+
style?: ComponentStyle;
|
|
74
77
|
/** When input type is a number, optionally specify the minimum value. */
|
|
75
78
|
min?: number;
|
|
76
79
|
/** When input type is a number, optionally specify the maximum value. */
|
package/dist/likert-scale.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
import { ComponentStyle } from './types';
|
|
2
3
|
/** Likert scale component size options */
|
|
3
4
|
export type LikertScaleSize = 'small' | 'medium' | 'large';
|
|
4
5
|
/** Likert scale component density options */
|
|
@@ -62,7 +63,7 @@ export interface LikertScaleAttrs<T extends number = number> extends Attributes
|
|
|
62
63
|
/** Class name for the container */
|
|
63
64
|
className?: string;
|
|
64
65
|
/** Additional CSS styles */
|
|
65
|
-
style?:
|
|
66
|
+
style?: ComponentStyle;
|
|
66
67
|
/** Use CSS grid for label/scale alignment in multi-question surveys (default: false) */
|
|
67
68
|
alignLabels?: boolean;
|
|
68
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
import { MaterialColor, ColorIntensity } from './types';
|
|
2
|
+
import { MaterialColor, ColorIntensity, ComponentStyle } from './types';
|
|
3
3
|
import { ProgressMode, ProgressSize } from './circular-progress';
|
|
4
4
|
/** LinearProgress component attributes */
|
|
5
5
|
export interface LinearProgressAttrs extends Attributes {
|
|
@@ -22,7 +22,7 @@ export interface LinearProgressAttrs extends Attributes {
|
|
|
22
22
|
/** Additional CSS class names */
|
|
23
23
|
className?: string;
|
|
24
24
|
/** Additional CSS styles */
|
|
25
|
-
style?:
|
|
25
|
+
style?: ComponentStyle;
|
|
26
26
|
/** HTML ID for the component */
|
|
27
27
|
id?: string;
|
|
28
28
|
/** ARIA label for accessibility */
|
package/dist/material-icon.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
import { ComponentStyle } from './types';
|
|
2
3
|
declare const iconPaths: {
|
|
3
4
|
readonly caret: readonly ["M7 10l5 5 5-5z", "M0 0h24v24H0z"];
|
|
4
5
|
readonly close: readonly ["M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z", "M0 0h24v24H0z"];
|
|
@@ -19,7 +20,7 @@ export type IconName = keyof typeof iconPaths;
|
|
|
19
20
|
export interface MaterialIconAttrs extends Attributes {
|
|
20
21
|
name: IconName;
|
|
21
22
|
direction?: 'up' | 'down' | 'left' | 'right';
|
|
22
|
-
style?:
|
|
23
|
+
style?: ComponentStyle;
|
|
23
24
|
onclick?: (e: MouseEvent) => void;
|
|
24
25
|
}
|
|
25
26
|
export declare const MaterialIcon: FactoryComponent<MaterialIconAttrs>;
|
package/dist/radio.d.ts
CHANGED
|
@@ -31,6 +31,13 @@ export interface RadioButtonsAttrs<T extends string | number> extends Attributes
|
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
/** Layout for the options: 'vertical' (default) or 'horizontal' */
|
|
33
33
|
layout?: 'vertical' | 'horizontal';
|
|
34
|
+
/** @deprecated Use layout instead. Kept for backward compatibility. */
|
|
35
|
+
direction?: 'vertical' | 'horizontal';
|
|
36
|
+
/**
|
|
37
|
+
* Explicitly allow HTML in option labels and description.
|
|
38
|
+
* Disabled by default to prevent unsafe rendering.
|
|
39
|
+
*/
|
|
40
|
+
allowHtml?: boolean;
|
|
34
41
|
}
|
|
35
42
|
export interface RadioButtonAttrs<T extends string | number> extends Attributes {
|
|
36
43
|
id: T;
|
|
@@ -41,6 +48,8 @@ export interface RadioButtonAttrs<T extends string | number> extends Attributes
|
|
|
41
48
|
disabled?: boolean;
|
|
42
49
|
/** Optional input id for the radio button */
|
|
43
50
|
inputId?: string;
|
|
51
|
+
/** Explicitly allow trusted HTML in the label */
|
|
52
|
+
allowHtml?: boolean;
|
|
44
53
|
}
|
|
45
54
|
export declare const RadioButton: <T extends string | number>() => Component<RadioButtonAttrs<T>>;
|
|
46
55
|
/** Component to show a list of radio buttons, from which you can choose one. */
|
package/dist/range-slider.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import m from 'mithril';
|
|
2
2
|
import { InputAttrs } from './input-options';
|
|
3
|
+
import { ComponentStyle } from './types';
|
|
3
4
|
export declare const SingleRangeSlider: {
|
|
4
5
|
oninit({ state }: {
|
|
5
6
|
state: any;
|
|
@@ -10,7 +11,7 @@ export declare const SingleRangeSlider: {
|
|
|
10
11
|
view({ attrs, state, }: {
|
|
11
12
|
attrs: InputAttrs<any> & {
|
|
12
13
|
cn?: string;
|
|
13
|
-
style?:
|
|
14
|
+
style?: ComponentStyle;
|
|
14
15
|
iconName?: string;
|
|
15
16
|
id: string;
|
|
16
17
|
label?: string;
|
|
@@ -30,7 +31,7 @@ export declare const DoubleRangeSlider: {
|
|
|
30
31
|
view({ attrs, state, }: {
|
|
31
32
|
attrs: InputAttrs<any> & {
|
|
32
33
|
cn?: string;
|
|
33
|
-
style?:
|
|
34
|
+
style?: ComponentStyle;
|
|
34
35
|
iconName?: string;
|
|
35
36
|
id: string;
|
|
36
37
|
label?: string;
|
package/dist/rating.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
import { ComponentStyle } from './types';
|
|
2
3
|
/** Rating component size options */
|
|
3
4
|
export type RatingSize = 'small' | 'medium' | 'large';
|
|
4
5
|
/** Rating component density options */
|
|
@@ -37,7 +38,7 @@ export interface RatingAttrs extends Attributes {
|
|
|
37
38
|
/** Class name for the container */
|
|
38
39
|
className?: string;
|
|
39
40
|
/** Additional CSS styles */
|
|
40
|
-
style?:
|
|
41
|
+
style?: ComponentStyle;
|
|
41
42
|
/** Callback when rating changes */
|
|
42
43
|
onchange?: (value: number) => void;
|
|
43
44
|
/** Callback when rating is hovered (preview mode) */
|
package/dist/search-select.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Component } from 'mithril';
|
|
1
|
+
import m, { Component } from 'mithril';
|
|
2
2
|
import { SelectAttrs } from './select';
|
|
3
3
|
import { InputOption } from './option';
|
|
4
4
|
export interface SearchSelectI18n {
|
|
5
5
|
/** Text shown when no options match the search */
|
|
6
6
|
noOptionsFound?: string;
|
|
7
|
+
/** Text shown while async options are loading */
|
|
8
|
+
loadingOptions?: string;
|
|
9
|
+
/** Text shown when async option loading fails */
|
|
10
|
+
loadingError?: string;
|
|
7
11
|
/** Prefix for adding new option */
|
|
8
12
|
addNewPrefix?: string;
|
|
9
13
|
/** Message template for truncated results. Use {shown} and {total} placeholders */
|
|
@@ -12,6 +16,8 @@ export interface SearchSelectI18n {
|
|
|
12
16
|
maxSelectionsReached?: string;
|
|
13
17
|
}
|
|
14
18
|
export interface SearchSelectAttrs<T extends string | number> extends SelectAttrs<T> {
|
|
19
|
+
/** Async options loader for remote/large data sets */
|
|
20
|
+
loadOptions?: (query: string) => Promise<InputOption<T>[]>;
|
|
15
21
|
/** Callback when user creates a new option: should return new ID */
|
|
16
22
|
oncreateNewOption?: (term: string) => InputOption<T> | Promise<InputOption<T>>;
|
|
17
23
|
/** Placeholder text for the search input, default 'Search options...' */
|
|
@@ -31,6 +37,7 @@ export interface SearchSelectAttrs<T extends string | number> extends SelectAttr
|
|
|
31
37
|
}
|
|
32
38
|
interface SearchSelectState<T extends string | number> {
|
|
33
39
|
id: string;
|
|
40
|
+
listboxId: string;
|
|
34
41
|
isOpen: boolean;
|
|
35
42
|
searchTerm: string;
|
|
36
43
|
inputRef: HTMLElement | null;
|
|
@@ -38,9 +45,15 @@ interface SearchSelectState<T extends string | number> {
|
|
|
38
45
|
focusedIndex: number;
|
|
39
46
|
internalSelectedIds: T[];
|
|
40
47
|
createdOptions: InputOption<T>[];
|
|
48
|
+
asyncOptions: InputOption<T>[];
|
|
49
|
+
isLoading: boolean;
|
|
50
|
+
loadError: string | null;
|
|
51
|
+
latestRequestId: number;
|
|
41
52
|
}
|
|
42
53
|
/**
|
|
43
54
|
* Mithril Factory Component for Multi-Select Dropdown with search
|
|
44
55
|
*/
|
|
45
|
-
export declare const SearchSelect: <T extends string | number>(
|
|
56
|
+
export declare const SearchSelect: <T extends string | number>(maybeVnode?: m.Vnode<SearchSelectAttrs<T>, {
|
|
57
|
+
__searchSelectInstance?: Component<SearchSelectAttrs<T>, SearchSelectState<T>>;
|
|
58
|
+
}>) => Component<SearchSelectAttrs<T>, SearchSelectState<T>>;
|
|
46
59
|
export {};
|
package/dist/select.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Attributes, Component } from 'mithril';
|
|
2
2
|
import { InputOption } from './option';
|
|
3
|
+
import { ComponentStyle } from './types';
|
|
3
4
|
export type SortSelected<T extends string | number> = 'asc' | 'desc' | 'none' | ((a: InputOption<T>, b: InputOption<T>) => number);
|
|
5
|
+
export type SelectSummaryMode = 'labels' | 'count' | 'all-or-count';
|
|
6
|
+
export type SelectAppearance = 'standard' | 'outlined';
|
|
4
7
|
export interface SelectAttrs<T extends string | number> extends Attributes {
|
|
5
8
|
/** Options to select from */
|
|
6
9
|
options: InputOption<T>[];
|
|
@@ -34,7 +37,7 @@ export interface SelectAttrs<T extends string | number> extends Attributes {
|
|
|
34
37
|
/** Sets the input field to disabled. */
|
|
35
38
|
disabled?: boolean;
|
|
36
39
|
/** Optional style information. */
|
|
37
|
-
style?:
|
|
40
|
+
style?: ComponentStyle;
|
|
38
41
|
/** If true, break to a new row */
|
|
39
42
|
newRow?: boolean;
|
|
40
43
|
/**
|
|
@@ -50,6 +53,16 @@ export interface SelectAttrs<T extends string | number> extends Attributes {
|
|
|
50
53
|
maxHeight?: string;
|
|
51
54
|
/** Sort selected items: 'asc' (alphabetically A-Z), 'desc' (Z-A), 'none' (insertion order), or custom sort function */
|
|
52
55
|
sortSelected?: SortSelected<T>;
|
|
56
|
+
/** Display mode for selected values in the input field. Defaults to 'labels'. */
|
|
57
|
+
summaryMode?: SelectSummaryMode;
|
|
58
|
+
/** Label shown when all selectable options are selected in summary mode 'all-or-count'. */
|
|
59
|
+
allSelectedLabel?: string;
|
|
60
|
+
/** Label shown when no options are selected in summary mode 'all-or-count'. */
|
|
61
|
+
noneSelectedLabel?: string;
|
|
62
|
+
/** Custom formatter for count-based summary modes. */
|
|
63
|
+
countLabel?: (selectedCount: number, totalCount: number) => string;
|
|
64
|
+
/** Visual style of the trigger. Defaults to 'standard'. */
|
|
65
|
+
appearance?: SelectAppearance;
|
|
53
66
|
}
|
|
54
67
|
/** Select component */
|
|
55
68
|
export declare const Select: <T extends string | number>() => Component<SelectAttrs<T>>;
|
package/dist/sidenav.d.ts
CHANGED
|
@@ -75,6 +75,12 @@ export interface SidenavItemAttrs {
|
|
|
75
75
|
href?: string;
|
|
76
76
|
/** Custom class */
|
|
77
77
|
className?: string;
|
|
78
|
+
/** Native title attribute text shown on hover */
|
|
79
|
+
title?: string;
|
|
80
|
+
/** Alias for title; used when title is not provided */
|
|
81
|
+
tooltip?: string;
|
|
82
|
+
/** Show tooltip only while sidenav is collapsed, @default true */
|
|
83
|
+
tooltipWhenCollapsedOnly?: boolean;
|
|
78
84
|
/** Whether this is a divider */
|
|
79
85
|
divider?: boolean;
|
|
80
86
|
/** Whether this is a subheader */
|
package/dist/treeview.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
import { EventHandler, SelectionMode } from './types';
|
|
2
|
+
import { EventHandler, SelectionMode, ComponentStyle } from './types';
|
|
3
3
|
export interface TreeNode {
|
|
4
4
|
id: string;
|
|
5
5
|
label: string;
|
|
@@ -32,7 +32,7 @@ export interface TreeViewAttrs<T extends TreeNode = TreeNode> extends Attributes
|
|
|
32
32
|
/** Optional CSS class */
|
|
33
33
|
className?: string;
|
|
34
34
|
/** Optional inline styles */
|
|
35
|
-
style?:
|
|
35
|
+
style?: ComponentStyle;
|
|
36
36
|
/** Component ID */
|
|
37
37
|
id?: string;
|
|
38
38
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -36,6 +36,11 @@ export type ExtendedPosition = MaterialPosition | 'top-left' | 'top-right' | 'bo
|
|
|
36
36
|
export type ValidationSuccess = true | '';
|
|
37
37
|
export type ValidationError = false | string;
|
|
38
38
|
export type ValidationResult = ValidationSuccess | ValidationError;
|
|
39
|
+
/**
|
|
40
|
+
* Shared style prop type used by component attrs.
|
|
41
|
+
* Supports CSS text strings and Mithril style objects.
|
|
42
|
+
*/
|
|
43
|
+
export type ComponentStyle = string | Record<string, string | number | undefined>;
|
|
39
44
|
/**
|
|
40
45
|
* Generic event handler type with proper typing for value and optional event
|
|
41
46
|
* @template T - The type of the value being handled
|
package/dist/utilities.css
CHANGED
|
@@ -2281,6 +2281,31 @@ html {
|
|
|
2281
2281
|
box-sizing: border-box;
|
|
2282
2282
|
}
|
|
2283
2283
|
|
|
2284
|
+
/* Default themed scrollbar styling for all scroll containers */
|
|
2285
|
+
* {
|
|
2286
|
+
scrollbar-width: thin;
|
|
2287
|
+
scrollbar-color: var(--mm-scrollbar-thumb-color, rgba(128, 128, 128, 0.35)) var(--mm-scrollbar-track-color, transparent);
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
*::-webkit-scrollbar {
|
|
2291
|
+
width: 10px;
|
|
2292
|
+
height: 10px;
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
*::-webkit-scrollbar-track {
|
|
2296
|
+
background: var(--mm-scrollbar-track-color, transparent);
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
*::-webkit-scrollbar-thumb {
|
|
2300
|
+
background-color: var(--mm-scrollbar-thumb-color, rgba(128, 128, 128, 0.35));
|
|
2301
|
+
border-radius: 8px;
|
|
2302
|
+
border: 2px solid var(--mm-scrollbar-track-color, transparent);
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
*::-webkit-scrollbar-thumb:hover {
|
|
2306
|
+
background-color: var(--mm-scrollbar-thumb-hover-color, rgba(128, 128, 128, 0.5));
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2284
2309
|
*, *:before, *:after {
|
|
2285
2310
|
box-sizing: inherit;
|
|
2286
2311
|
}
|
|
@@ -2773,7 +2798,7 @@ td, th {
|
|
|
2773
2798
|
}
|
|
2774
2799
|
.collection .collection-item.active {
|
|
2775
2800
|
background-color: #26a69a;
|
|
2776
|
-
color: rgb(
|
|
2801
|
+
color: rgb(91.862745098%, 98.137254902%, 97.5490196078%);
|
|
2777
2802
|
}
|
|
2778
2803
|
.collection .collection-item.active .secondary-content {
|
|
2779
2804
|
color: var(--mm-text-on-primary, #fff);
|
|
@@ -2902,6 +2927,72 @@ td, th {
|
|
|
2902
2927
|
/*******************
|
|
2903
2928
|
Utility Classes
|
|
2904
2929
|
*******************/
|
|
2930
|
+
.mm-layout-row {
|
|
2931
|
+
display: flex;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
.mm-layout-row--center {
|
|
2935
|
+
align-items: center;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
.mm-layout-row--align-end {
|
|
2939
|
+
align-items: flex-end;
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
.mm-layout-row--wrap {
|
|
2943
|
+
flex-wrap: wrap;
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
.mm-layout-row--justify-start {
|
|
2947
|
+
justify-content: flex-start;
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
.mm-layout-row--justify-end {
|
|
2951
|
+
justify-content: flex-end;
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
.mm-layout-row--justify-between {
|
|
2955
|
+
justify-content: space-between;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
.mm-layout-stack {
|
|
2959
|
+
display: flex;
|
|
2960
|
+
flex-direction: column;
|
|
2961
|
+
gap: var(--mm-layout-gap, 0);
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
.mm-layout-cluster {
|
|
2965
|
+
display: flex;
|
|
2966
|
+
align-items: center;
|
|
2967
|
+
flex-wrap: wrap;
|
|
2968
|
+
gap: var(--mm-layout-gap, 8px);
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
.mm-layout-grow {
|
|
2972
|
+
flex: 1 1 auto;
|
|
2973
|
+
min-width: 0;
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
.mm-layout-ml-auto {
|
|
2977
|
+
margin-left: auto;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
.mm-layout-ml-8 {
|
|
2981
|
+
margin-left: var(--mm-layout-inline-gap, 8px);
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
.mm-layout-mr-8 {
|
|
2985
|
+
margin-right: var(--mm-layout-inline-gap, 8px);
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
.mm-layout-item-icon {
|
|
2989
|
+
margin-right: var(--mm-layout-icon-gap, 32px);
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
.mm-layout-gap-sm {
|
|
2993
|
+
gap: var(--mm-layout-gap-sm, 8px);
|
|
2994
|
+
}
|
|
2995
|
+
|
|
2905
2996
|
.hide {
|
|
2906
2997
|
display: none !important;
|
|
2907
2998
|
}
|
|
@@ -3094,7 +3185,7 @@ td, th {
|
|
|
3094
3185
|
text-transform: uppercase;
|
|
3095
3186
|
}
|
|
3096
3187
|
.card .card-action a:not(.btn):not(.btn-large):not(.btn-floating):hover {
|
|
3097
|
-
color: rgb(
|
|
3188
|
+
color: rgb(100%, 84.6504465661%, 65.0980392157%);
|
|
3098
3189
|
}
|
|
3099
3190
|
.card .card-reveal {
|
|
3100
3191
|
padding: 24px;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import m from 'mithril';
|
|
1
2
|
import { SortSelected } from './select';
|
|
2
3
|
import { InputOption } from '.';
|
|
3
4
|
/**
|
|
@@ -36,6 +37,27 @@ export declare const sortOptions: <T extends string | number>(options: InputOpti
|
|
|
36
37
|
* @returns
|
|
37
38
|
*/
|
|
38
39
|
export declare const padLeft: (n: string | number, width?: number, z?: string) => string;
|
|
40
|
+
export declare const normalizeSelection: <T>(value?: T | T[]) => T[];
|
|
41
|
+
export interface ControllableValueOptions<T> {
|
|
42
|
+
controlled: boolean;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
controlledValue?: T;
|
|
45
|
+
defaultValue?: T;
|
|
46
|
+
internalValue?: T;
|
|
47
|
+
fallbackValue: T;
|
|
48
|
+
}
|
|
49
|
+
export declare const resolveControllableValue: <T>({ controlled, disabled, controlledValue, defaultValue, internalValue, fallbackValue, }: ControllableValueOptions<T>) => T;
|
|
50
|
+
export interface FieldChromeOptions {
|
|
51
|
+
label?: string;
|
|
52
|
+
id?: string;
|
|
53
|
+
isMandatory?: boolean;
|
|
54
|
+
isActive?: boolean | string;
|
|
55
|
+
initialValue?: boolean;
|
|
56
|
+
helperText?: string;
|
|
57
|
+
dataError?: string;
|
|
58
|
+
dataSuccess?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare const renderFieldChrome: ({ label, id, isMandatory, isActive, initialValue, helperText, dataError, dataSuccess, }: FieldChromeOptions) => m.Children[];
|
|
39
61
|
export declare const getDropdownStyles: (inputRef?: HTMLElement | null, overlap?: boolean, options?: {
|
|
40
62
|
/** ID property of the selected item */
|
|
41
63
|
id?: string | number;
|
|
@@ -77,7 +99,14 @@ export declare const releasePortalContainer: (id: string) => void;
|
|
|
77
99
|
* @param vnode - Mithril vnode to render
|
|
78
100
|
* @param zIndex - Z-index for portal container (default: 1004)
|
|
79
101
|
*/
|
|
80
|
-
export declare const renderToPortal: (containerId: string, vnode:
|
|
102
|
+
export declare const renderToPortal: (containerId: string, vnode: m.Children, zIndex?: number) => void;
|
|
103
|
+
export interface PortalSyncOptions {
|
|
104
|
+
containerId: string;
|
|
105
|
+
shouldRender: boolean;
|
|
106
|
+
vnode: m.Children | null;
|
|
107
|
+
zIndex?: number;
|
|
108
|
+
}
|
|
109
|
+
export declare const syncPortalContent: ({ containerId, shouldRender, vnode, zIndex }: PortalSyncOptions) => void;
|
|
81
110
|
/**
|
|
82
111
|
* Clears portal content and releases container reference.
|
|
83
112
|
* If this is the last reference, the container will be removed from the DOM.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mithril-materialized",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0",
|
|
4
4
|
"description": "A materialize library for mithril.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"dev": "concurrently \"rollup -c rollup.config.mjs -w\" \"pnpm run css:watch\"",
|
|
44
44
|
"start": "pnpm run dev",
|
|
45
45
|
"clean": "rimraf dist node_modules/.cache",
|
|
46
|
-
"test": "
|
|
47
|
-
"test:watch": "
|
|
48
|
-
"test:coverage": "
|
|
49
|
-
"test:ui": "
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"test:watch": "vitest",
|
|
48
|
+
"test:coverage": "vitest run --coverage",
|
|
49
|
+
"test:ui": "vitest --reporter=verbose",
|
|
50
50
|
"test:server": "node test-server.js",
|
|
51
51
|
"test:visual": "playwright test",
|
|
52
52
|
"test:visual:ui": "playwright test --ui",
|
|
@@ -77,26 +77,23 @@
|
|
|
77
77
|
"mithril": "^2.3.8"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@playwright/test": "^1.
|
|
80
|
+
"@playwright/test": "^1.61.1",
|
|
81
81
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
82
82
|
"@testing-library/dom": "^10.4.1",
|
|
83
|
-
"@testing-library/jest-dom": "^
|
|
83
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
84
84
|
"@testing-library/user-event": "^14.6.1",
|
|
85
|
-
"@types/jest": "^30.0.0",
|
|
86
85
|
"@types/mithril": "^2.2.8",
|
|
87
|
-
"autoprefixer": "^10.4
|
|
88
|
-
"concurrently": "^
|
|
89
|
-
"
|
|
90
|
-
"jest": "^30.3.0",
|
|
91
|
-
"jest-environment-jsdom": "^30.3.0",
|
|
92
|
-
"js-yaml": "^4.1.1",
|
|
86
|
+
"autoprefixer": "^10.5.4",
|
|
87
|
+
"concurrently": "^10.0.3",
|
|
88
|
+
"js-yaml": "^5.2.2",
|
|
93
89
|
"rimraf": "^6.1.3",
|
|
94
|
-
"rollup": "^4.
|
|
90
|
+
"rollup": "^4.62.2",
|
|
95
91
|
"rollup-plugin-postcss": "^4.0.2",
|
|
96
|
-
"sass": "^1.
|
|
97
|
-
"ts-jest": "^29.4.9",
|
|
92
|
+
"sass": "^1.101.7",
|
|
98
93
|
"tslib": "^2.8.1",
|
|
99
|
-
"typedoc": "^0.28.
|
|
100
|
-
"typescript": "^
|
|
94
|
+
"typedoc": "^0.28.20",
|
|
95
|
+
"typescript": "^5.9.2",
|
|
96
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
97
|
+
"vitest": "^4.1.10"
|
|
101
98
|
}
|
|
102
99
|
}
|
|
@@ -23,6 +23,14 @@ $badge-dot-border-radius: 50% !default;
|
|
|
23
23
|
flex-shrink: 0;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
// Optional layout helper for dense badge demo/list groups.
|
|
27
|
+
.badge-showcase {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
gap: var(--mm-badge-showcase-gap, 20px);
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
// Badge element - using .m-badge to avoid conflicts with Materialize's span.badge
|
|
27
35
|
.m-badge {
|
|
28
36
|
position: absolute;
|
|
@@ -62,22 +62,22 @@
|
|
|
62
62
|
.btn,
|
|
63
63
|
.btn-floating {
|
|
64
64
|
&:focus {
|
|
65
|
-
background-color: color.adjust(variables.$button-raised-background, $lightness: -10%);
|
|
65
|
+
background-color: var(--mm-primary-color-dark, #{color.adjust(variables.$button-raised-background, $lightness: -10%)});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Raised Button
|
|
70
70
|
.btn {
|
|
71
71
|
text-decoration: none;
|
|
72
|
-
color: variables.$button-raised-color;
|
|
73
|
-
background-color: variables.$button-raised-background;
|
|
72
|
+
color: var(--mm-button-text, #{variables.$button-raised-color});
|
|
73
|
+
background-color: var(--mm-primary-color, #{variables.$button-raised-background});
|
|
74
74
|
text-align: center;
|
|
75
75
|
letter-spacing: .5px;
|
|
76
76
|
@extend .z-depth-1 !optional;
|
|
77
77
|
transition: background-color .2s ease-out;
|
|
78
78
|
cursor: pointer;
|
|
79
79
|
&:hover {
|
|
80
|
-
background-color: variables.$button-raised-background-hover;
|
|
80
|
+
background-color: var(--mm-primary-color-dark, #{variables.$button-raised-background-hover});
|
|
81
81
|
@extend .z-depth-1-half !optional;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
// Floating button
|
|
86
86
|
.btn-floating {
|
|
87
87
|
&:hover {
|
|
88
|
-
background-color: variables.$button-floating-background-hover;
|
|
88
|
+
background-color: var(--mm-primary-color-dark, #{variables.$button-floating-background-hover});
|
|
89
89
|
@extend .z-depth-1-half !optional;
|
|
90
90
|
}
|
|
91
91
|
&:before {
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
bottom: math.div(-(variables.$button-floating-size), 2);
|
|
125
125
|
}
|
|
126
126
|
display: inline-block;
|
|
127
|
-
color: variables.$button-floating-color;
|
|
127
|
+
color: var(--mm-button-text, #{variables.$button-floating-color});
|
|
128
128
|
position: relative;
|
|
129
129
|
overflow: hidden;
|
|
130
130
|
z-index: 1;
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
height: variables.$button-floating-size;
|
|
133
133
|
line-height: variables.$button-floating-size;
|
|
134
134
|
padding: 0;
|
|
135
|
-
background-color: variables.$button-floating-background;
|
|
135
|
+
background-color: var(--mm-primary-color, #{variables.$button-floating-background});
|
|
136
136
|
border-radius: variables.$button-floating-radius;
|
|
137
137
|
@extend .z-depth-1 !optional;
|
|
138
138
|
transition: background-color .3s;
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
width: inherit;
|
|
143
143
|
display: inline-block;
|
|
144
144
|
text-align: center;
|
|
145
|
-
color: variables.$button-floating-color;
|
|
145
|
+
color: var(--mm-button-text, #{variables.$button-floating-color});
|
|
146
146
|
font-size: variables.$button-large-icon-font-size;
|
|
147
147
|
line-height: variables.$button-floating-size;
|
|
148
148
|
}
|
|
@@ -269,7 +269,7 @@ button.btn-floating {
|
|
|
269
269
|
z-index: -1;
|
|
270
270
|
width: variables.$button-floating-size;
|
|
271
271
|
height: variables.$button-floating-size;
|
|
272
|
-
background-color: variables.$button-floating-background;
|
|
272
|
+
background-color: var(--mm-primary-color, #{variables.$button-floating-background});
|
|
273
273
|
border-radius: variables.$button-floating-radius;
|
|
274
274
|
transform: scale(0);
|
|
275
275
|
}
|