mithril-materialized 0.19.7 → 1.0.0-beta.1
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 +6 -2
- package/dist/autocomplete.d.ts +14 -7
- package/dist/button.d.ts +40 -40
- package/dist/carousel.d.ts +38 -18
- package/dist/chip.d.ts +31 -11
- package/dist/code-block.d.ts +8 -9
- package/dist/collapsible.d.ts +26 -22
- package/dist/collection.d.ts +49 -49
- package/dist/dropdown.d.ts +45 -46
- package/dist/floating-action-button.d.ts +37 -34
- package/dist/icon.d.ts +11 -11
- package/dist/index.css +7968 -2
- package/dist/index.d.ts +26 -28
- package/dist/index.esm.js +4211 -2
- package/dist/index.js +4265 -2
- package/dist/index.umd.js +4269 -2
- package/dist/input-options.d.ts +85 -81
- package/dist/input.d.ts +47 -42
- package/dist/label.d.ts +21 -22
- package/dist/material-box.d.ts +38 -21
- package/dist/material-icon.d.ts +14 -0
- package/dist/modal.d.ts +41 -26
- package/dist/option.d.ts +61 -52
- package/dist/pagination.d.ts +16 -20
- package/dist/parallax.d.ts +14 -13
- package/dist/pickers.d.ts +130 -8
- package/dist/radio.d.ts +41 -37
- package/dist/search-select.d.ts +41 -0
- package/dist/select.d.ts +46 -45
- package/dist/switch.d.ts +12 -13
- package/dist/tabs.d.ts +57 -45
- package/dist/utils.d.ts +43 -70
- package/package.json +55 -16
- package/sass/components/_badges.scss +59 -0
- package/sass/components/_buttons.scss +327 -0
- package/sass/components/_cards.scss +197 -0
- package/sass/components/_carousel.scss +92 -0
- package/sass/components/_chips.scss +92 -0
- package/sass/components/_collapsible.scss +94 -0
- package/sass/components/_color-classes.scss +34 -0
- package/sass/components/_color-variables.scss +371 -0
- package/sass/components/_datepicker.scss +251 -0
- package/sass/components/_dropdown.scss +90 -0
- package/sass/components/_global.scss +775 -0
- package/sass/components/_grid.scss +160 -0
- package/sass/components/_icons-material-design.scss +5 -0
- package/sass/components/_materialbox.scss +43 -0
- package/sass/components/_modal.scss +97 -0
- package/sass/components/_navbar.scss +211 -0
- package/sass/components/_normalize.scss +447 -0
- package/sass/components/_preloader.scss +336 -0
- package/sass/components/_pulse.scss +34 -0
- package/sass/components/_sidenav.scss +213 -0
- package/sass/components/_slider.scss +94 -0
- package/sass/components/_table_of_contents.scss +36 -0
- package/sass/components/_tabs.scss +102 -0
- package/sass/components/_tapTarget.scss +105 -0
- package/sass/components/_timepicker.scss +170 -0
- package/sass/components/_toast.scss +61 -0
- package/sass/components/_tooltip.scss +32 -0
- package/sass/components/_transitions.scss +13 -0
- package/sass/components/_typography.scss +61 -0
- package/sass/components/_variables.scss +352 -0
- package/sass/components/_waves.scss +114 -0
- package/sass/components/forms/_checkboxes.scss +203 -0
- package/sass/components/forms/_file-input.scss +50 -0
- package/sass/components/forms/_form-groups.scss +28 -0
- package/sass/components/forms/_forms.scss +24 -0
- package/sass/components/forms/_input-fields.scss +361 -0
- package/sass/components/forms/_radio-buttons.scss +118 -0
- package/sass/components/forms/_range.scss +164 -0
- package/sass/components/forms/_select.scss +193 -0
- package/sass/components/forms/_switches.scss +92 -0
- package/sass/materialize.scss +41 -0
- package/dist/index.css.map +0 -1
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js +0 -2
- package/dist/index.modern.js.map +0 -1
- package/dist/index.umd.js.map +0 -1
- package/dist/kanban.d.ts +0 -47
- package/dist/layout-form-generator.d.ts +0 -75
- package/dist/map-editor.d.ts +0 -63
- package/dist/timeline.d.ts +0 -24
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mithril-materialized
|
|
2
2
|
|
|
3
|
-
A [materialize-css](https://materializecss.com) library for the Mithril framework (tested with v2.0
|
|
3
|
+
A [materialize-css](https://materializecss.com) library for the Mithril framework (tested with v2.0 and higher, but presumably, it should work with v1.1.6 too), making it easier to use a Materialize theme in your application. The main focus of this library is on creating Mithril components for the more complicated Materialize components.
|
|
4
4
|
|
|
5
5
|
Supported components:
|
|
6
6
|
|
|
@@ -45,12 +45,16 @@ Supported components:
|
|
|
45
45
|
- HelperText
|
|
46
46
|
- Not from Materialize-CSS
|
|
47
47
|
- CodeBlock
|
|
48
|
-
-
|
|
48
|
+
- SearchSelect, a searchable select dropdown
|
|
49
49
|
- [Timeline](https://erikvullings.github.io/mithril-materialized/#!/timeline)
|
|
50
50
|
- [MapEditor](https://erikvullings.github.io/mithril-materialized/#!/map_editor)
|
|
51
51
|
|
|
52
52
|
## Version history
|
|
53
53
|
|
|
54
|
+
v1.2.0: Added Search select, a searchable select dropdown
|
|
55
|
+
|
|
56
|
+
v1.1.7: Added option to add style to InputCheckbox and Options
|
|
57
|
+
|
|
54
58
|
v0.17.1: bug fix
|
|
55
59
|
|
|
56
60
|
- `Select` component also reacts when the `checkedId` property becomes undefined (previously, it would ignore it).
|
package/dist/autocomplete.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
1
|
+
import { FactoryComponent } from 'mithril';
|
|
2
|
+
import { InputAttributes } from './input-options';
|
|
3
|
+
export interface AutoCompleteAttributes extends InputAttributes<string> {
|
|
4
|
+
/** The data object defining the autocomplete options */
|
|
5
|
+
data?: Record<string, string | null>;
|
|
6
|
+
/** Limit of how many options are shown. Default: Infinity */
|
|
7
|
+
limit?: number;
|
|
8
|
+
/** Minimum length of input before autocomplete shows. Default: 1 */
|
|
9
|
+
minLength?: number;
|
|
10
|
+
/** Function called when an option is selected */
|
|
11
|
+
onAutocomplete?: (value: string) => void;
|
|
12
|
+
}
|
|
13
|
+
/** Component to auto complete your text input - Pure Mithril implementation */
|
|
14
|
+
export declare const Autocomplete: FactoryComponent<AutoCompleteAttributes>;
|
package/dist/button.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
3
|
-
id?: string;
|
|
4
|
-
for?: string;
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
autofocus?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
type?: 'submit' | 'button' | 'text' | 'textarea' | 'number';
|
|
9
|
-
}
|
|
10
|
-
export interface
|
|
11
|
-
/** Optional (e.g. in case you only want to use an icon) button label */
|
|
12
|
-
label?: string;
|
|
13
|
-
/** Optional icon material-icons name, @see https://materializecss.com/icons.html */
|
|
14
|
-
iconName?: string;
|
|
15
|
-
/** Optional icon class, e.g. tiny (1em), small (2em), medium (4em), large (6em), or 'tiny right' */
|
|
16
|
-
iconClass?: string;
|
|
17
|
-
/**
|
|
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
|
|
20
|
-
*/
|
|
21
|
-
modalId?: string;
|
|
22
|
-
/** Some additional HTML attributes that can be attached to the button */
|
|
23
|
-
attr?:
|
|
24
|
-
/** Optional text-based tooltip, @see https://materializecss.com/tooltips.html */
|
|
25
|
-
tooltip?: string;
|
|
26
|
-
/** Optional location for the tooltip */
|
|
27
|
-
tooltipPostion?: 'top' | 'bottom' | 'left' | 'right';
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* A factory to create new buttons.
|
|
31
|
-
*
|
|
32
|
-
* @example FlatButton = ButtonFactory('a.waves-effect.waves-teal.btn-flat');
|
|
33
|
-
*/
|
|
34
|
-
export declare const ButtonFactory: (defaultClassNames: string,
|
|
35
|
-
export declare const Button: m.FactoryComponent<
|
|
36
|
-
export declare const LargeButton: m.FactoryComponent<
|
|
37
|
-
export declare const SmallButton: m.FactoryComponent<
|
|
38
|
-
export declare const FlatButton: m.FactoryComponent<
|
|
39
|
-
export declare const RoundIconButton: m.FactoryComponent<
|
|
40
|
-
export declare const SubmitButton: m.FactoryComponent<
|
|
1
|
+
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface HtmlAttributes {
|
|
3
|
+
id?: string;
|
|
4
|
+
for?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
autofocus?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
type?: 'submit' | 'button' | 'text' | 'textarea' | 'number';
|
|
9
|
+
}
|
|
10
|
+
export interface ButtonAttributes extends Attributes {
|
|
11
|
+
/** Optional (e.g. in case you only want to use an icon) button label */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Optional icon material-icons name, @see https://materializecss.com/icons.html */
|
|
14
|
+
iconName?: string;
|
|
15
|
+
/** Optional icon class, e.g. tiny (1em), small (2em), medium (4em), large (6em), or 'tiny right' */
|
|
16
|
+
iconClass?: string;
|
|
17
|
+
/**
|
|
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
|
|
20
|
+
*/
|
|
21
|
+
modalId?: string;
|
|
22
|
+
/** Some additional HTML attributes that can be attached to the button */
|
|
23
|
+
attr?: HtmlAttributes;
|
|
24
|
+
/** Optional text-based tooltip, @see https://materializecss.com/tooltips.html */
|
|
25
|
+
tooltip?: string;
|
|
26
|
+
/** Optional location for the tooltip */
|
|
27
|
+
tooltipPostion?: 'top' | 'bottom' | 'left' | 'right';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A factory to create new buttons.
|
|
31
|
+
*
|
|
32
|
+
* @example FlatButton = ButtonFactory('a.waves-effect.waves-teal.btn-flat');
|
|
33
|
+
*/
|
|
34
|
+
export declare const ButtonFactory: (element: string, defaultClassNames: string, type?: string) => FactoryComponent<ButtonAttributes>;
|
|
35
|
+
export declare const Button: m.FactoryComponent<ButtonAttributes>;
|
|
36
|
+
export declare const LargeButton: m.FactoryComponent<ButtonAttributes>;
|
|
37
|
+
export declare const SmallButton: m.FactoryComponent<ButtonAttributes>;
|
|
38
|
+
export declare const FlatButton: m.FactoryComponent<ButtonAttributes>;
|
|
39
|
+
export declare const RoundIconButton: m.FactoryComponent<ButtonAttributes>;
|
|
40
|
+
export declare const SubmitButton: m.FactoryComponent<ButtonAttributes>;
|
package/dist/carousel.d.ts
CHANGED
|
@@ -1,18 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface CarouselItem extends Attributes {
|
|
3
|
+
/** Relative page link, e.g. '#one' */
|
|
4
|
+
href: string;
|
|
5
|
+
/** Image source */
|
|
6
|
+
src: string;
|
|
7
|
+
/** Alternative name */
|
|
8
|
+
alt?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CarouselOptions {
|
|
11
|
+
/** Duration of carousel item change animation in ms */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Zoom scale (perspective distance) */
|
|
14
|
+
dist?: number;
|
|
15
|
+
/** Spacing for center image */
|
|
16
|
+
shift?: number;
|
|
17
|
+
/** Padding between non-center items */
|
|
18
|
+
padding?: number;
|
|
19
|
+
/** Number of visible items in carousel */
|
|
20
|
+
numVisible?: number;
|
|
21
|
+
/** Change to full width styles */
|
|
22
|
+
fullWidth?: boolean;
|
|
23
|
+
/** Toggle indicators */
|
|
24
|
+
indicators?: boolean;
|
|
25
|
+
/** Don't wrap around and cycle through items */
|
|
26
|
+
noWrap?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CarouselAttributes extends CarouselOptions, Attributes {
|
|
29
|
+
/** The list of images */
|
|
30
|
+
items: CarouselItem[];
|
|
31
|
+
/** Called when carousel item changes */
|
|
32
|
+
onCycleTo?: (item: CarouselItem, index: number, dragged: boolean) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Materialize CSS Carousel component with dynamic positioning
|
|
36
|
+
* Port of the original MaterializeCSS carousel logic
|
|
37
|
+
*/
|
|
38
|
+
export declare const Carousel: FactoryComponent<CarouselAttributes>;
|
package/dist/chip.d.ts
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import m from 'mithril';
|
|
2
|
+
export interface ChipData {
|
|
3
|
+
tag: string;
|
|
4
|
+
image?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AutocompleteOption extends ChipData {
|
|
8
|
+
value?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ChipsAttributes {
|
|
11
|
+
id?: string;
|
|
12
|
+
data?: ChipData[];
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
secondaryPlaceholder?: string;
|
|
15
|
+
autocompleteOptions?: {
|
|
16
|
+
data: Record<string, string | null> | AutocompleteOption[];
|
|
17
|
+
limit?: number;
|
|
18
|
+
minLength?: number;
|
|
19
|
+
};
|
|
20
|
+
limit?: number;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
isMandatory?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
helperText?: string;
|
|
26
|
+
onchange?: (data: ChipData[]) => void;
|
|
27
|
+
onChipAdd?: (chip: ChipData) => void;
|
|
28
|
+
onChipDelete?: (chip: ChipData) => void;
|
|
29
|
+
onChipSelect?: (chip: ChipData) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const Chips: m.FactoryComponent<ChipsAttributes>;
|
package/dist/code-block.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import '
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const CodeBlock: FactoryComponent<ICodeBlock>;
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface CodeBlockAttributes extends Attributes {
|
|
3
|
+
language?: string;
|
|
4
|
+
code: string | string[];
|
|
5
|
+
newRow?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** A simple code block without syntax high-lighting */
|
|
8
|
+
export declare const CodeBlock: FactoryComponent<CodeBlockAttributes>;
|
package/dist/collapsible.d.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { FactoryComponent, Attributes, Vnode } from 'mithril';
|
|
2
|
+
export interface CollapsibleItem extends Attributes {
|
|
3
|
+
/** Header of the collabsible item, may contain HTML or may be a Vnode */
|
|
4
|
+
header?: string | Vnode<any, any>;
|
|
5
|
+
/** Body of the collabsible item, may contain HTML or may be a Vnode */
|
|
6
|
+
body?: string | Vnode<any, any>;
|
|
7
|
+
/** If active, preselect the collabsible item. */
|
|
8
|
+
active?: boolean;
|
|
9
|
+
/** Add an material icon in front of the header. */
|
|
10
|
+
iconName?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CollapsibleAttributes extends Attributes {
|
|
13
|
+
/** The list of accordeon/collabsible items */
|
|
14
|
+
items: CollapsibleItem[];
|
|
15
|
+
/** If true, only one item can be expanded at a time (accordion mode) */
|
|
16
|
+
accordion?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const CollapsibleItem: FactoryComponent<CollapsibleItem & {
|
|
19
|
+
isActive: boolean;
|
|
20
|
+
onToggle: () => void;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a collabsible or accordion component with pure CSS/Mithril implementation.
|
|
24
|
+
* No MaterializeCSS JavaScript dependencies.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Collapsible: FactoryComponent<CollapsibleAttributes>;
|
package/dist/collection.d.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { FactoryComponent, Attributes, Vnode } from 'mithril';
|
|
2
|
-
export declare enum CollectionMode {
|
|
3
|
-
BASIC = 0,
|
|
4
|
-
LINKS = 1,
|
|
5
|
-
AVATAR = 2
|
|
6
|
-
}
|
|
7
|
-
export interface
|
|
8
|
-
/** If available, will be used as the key, so all items need an id. */
|
|
9
|
-
id?: string | number;
|
|
10
|
-
/** Title of the collection item */
|
|
11
|
-
title: string | Vnode<any, any>;
|
|
12
|
-
/** For links, may contain a URL reference */
|
|
13
|
-
href?: string;
|
|
14
|
-
/** For Avatar mode, may contain a URL reference to an image or a material icons class name */
|
|
15
|
-
avatar?: string;
|
|
16
|
-
/** Add a class to the avatar image or icon, e.g. a color 'red'. */
|
|
17
|
-
className?: string;
|
|
18
|
-
/** For Avatar mode, may contain a two-line trusted HTML content */
|
|
19
|
-
content?: string;
|
|
20
|
-
/** If active, preselect the collection item. */
|
|
21
|
-
active?: boolean;
|
|
22
|
-
/** Add a material icon as secondary content. */
|
|
23
|
-
iconName?: string;
|
|
24
|
-
/** Onclick event handler */
|
|
25
|
-
onclick?: (item:
|
|
26
|
-
/** Any other virtual element properties, including attributes and event handlers. */
|
|
27
|
-
[property: string]: any;
|
|
28
|
-
}
|
|
29
|
-
export interface
|
|
30
|
-
/** Optional header */
|
|
31
|
-
header?: string;
|
|
32
|
-
/** The list of items */
|
|
33
|
-
items:
|
|
34
|
-
/** Mode of operation */
|
|
35
|
-
mode?: CollectionMode;
|
|
36
|
-
}
|
|
37
|
-
export declare const SecondaryContent: FactoryComponent<
|
|
38
|
-
export declare const ListItem: FactoryComponent<{
|
|
39
|
-
item:
|
|
40
|
-
mode: CollectionMode;
|
|
41
|
-
}>;
|
|
42
|
-
export declare const AnchorItem: FactoryComponent<{
|
|
43
|
-
item:
|
|
44
|
-
}>;
|
|
45
|
-
/**
|
|
46
|
-
* Creates a Collection of items, optionally containing links, headers, secondary content or avatars.
|
|
47
|
-
* @see https://materializecss.com/collections.html
|
|
48
|
-
*/
|
|
49
|
-
export declare const Collection: FactoryComponent<
|
|
1
|
+
import { FactoryComponent, Attributes, Vnode } from 'mithril';
|
|
2
|
+
export declare enum CollectionMode {
|
|
3
|
+
BASIC = 0,
|
|
4
|
+
LINKS = 1,
|
|
5
|
+
AVATAR = 2
|
|
6
|
+
}
|
|
7
|
+
export interface CollectionItem {
|
|
8
|
+
/** If available, will be used as the key, so all items need an id. */
|
|
9
|
+
id?: string | number;
|
|
10
|
+
/** Title of the collection item */
|
|
11
|
+
title: string | Vnode<any, any>;
|
|
12
|
+
/** For links, may contain a URL reference */
|
|
13
|
+
href?: string;
|
|
14
|
+
/** For Avatar mode, may contain a URL reference to an image or a material icons class name */
|
|
15
|
+
avatar?: string;
|
|
16
|
+
/** Add a class to the avatar image or icon, e.g. a color 'red'. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** For Avatar mode, may contain a two-line trusted HTML content */
|
|
19
|
+
content?: string;
|
|
20
|
+
/** If active, preselect the collection item. */
|
|
21
|
+
active?: boolean;
|
|
22
|
+
/** Add a material icon as secondary content. */
|
|
23
|
+
iconName?: string;
|
|
24
|
+
/** Onclick event handler */
|
|
25
|
+
onclick?: (item: CollectionItem) => void;
|
|
26
|
+
/** Any other virtual element properties, including attributes and event handlers. */
|
|
27
|
+
[property: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export interface CollectionAttributes extends Attributes {
|
|
30
|
+
/** Optional header */
|
|
31
|
+
header?: string;
|
|
32
|
+
/** The list of items */
|
|
33
|
+
items: CollectionItem[];
|
|
34
|
+
/** Mode of operation */
|
|
35
|
+
mode?: CollectionMode;
|
|
36
|
+
}
|
|
37
|
+
export declare const SecondaryContent: FactoryComponent<CollectionItem>;
|
|
38
|
+
export declare const ListItem: FactoryComponent<{
|
|
39
|
+
item: CollectionItem;
|
|
40
|
+
mode: CollectionMode;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const AnchorItem: FactoryComponent<{
|
|
43
|
+
item: CollectionItem;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a Collection of items, optionally containing links, headers, secondary content or avatars.
|
|
47
|
+
* @see https://materializecss.com/collections.html
|
|
48
|
+
*/
|
|
49
|
+
export declare const Collection: FactoryComponent<CollectionAttributes>;
|
package/dist/dropdown.d.ts
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export declare const Dropdown: () => Component<IDropdownOptions>;
|
|
1
|
+
import { Component, Attributes } from 'mithril';
|
|
2
|
+
export interface DropdownItem<T extends string | number> {
|
|
3
|
+
/** ID property of the selected item */
|
|
4
|
+
id?: T;
|
|
5
|
+
/** Label to show in the dropdown */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Can we select the item */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Display a Materials Icon in front of the label */
|
|
10
|
+
iconName?: string;
|
|
11
|
+
/** Add a divider */
|
|
12
|
+
divider?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface DropdownAttributes<T extends string | number> extends Attributes {
|
|
15
|
+
/**
|
|
16
|
+
* Optional id of the dropdown element
|
|
17
|
+
* @default 'dropdown'
|
|
18
|
+
*/
|
|
19
|
+
id?: T;
|
|
20
|
+
/**
|
|
21
|
+
* Optional label when no item is selected
|
|
22
|
+
* @default 'Select'
|
|
23
|
+
*/
|
|
24
|
+
label?: string;
|
|
25
|
+
key?: string | number;
|
|
26
|
+
/** If true, disable the selection */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Item array to show in the dropdown. If the value is not supplied, uses he name. */
|
|
29
|
+
items: DropdownItem<T>[];
|
|
30
|
+
/**
|
|
31
|
+
* Selected value or name
|
|
32
|
+
* @deprecated Use initialValue instead
|
|
33
|
+
*/
|
|
34
|
+
checkedId?: T;
|
|
35
|
+
/** Selected value or name */
|
|
36
|
+
initialValue?: T;
|
|
37
|
+
/** When a value or name is selected */
|
|
38
|
+
onchange?: (value: T) => void;
|
|
39
|
+
/** Uses Materialize icons as a prefix or postfix. */
|
|
40
|
+
iconName?: string;
|
|
41
|
+
/** Add a description underneath the input field. */
|
|
42
|
+
helperText?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Pure TypeScript Dropdown component - no Materialize dependencies */
|
|
45
|
+
export declare const Dropdown: <T extends string | number>() => Component<DropdownAttributes<T>>;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { FactoryComponent } from 'mithril';
|
|
2
|
+
export interface FloatingActionButtonAttributes {
|
|
3
|
+
/** Optional classes to add to the top element */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Optional style to add to the top element, e.g. for positioning it inline */
|
|
6
|
+
style?: string;
|
|
7
|
+
/** Material-icons name for the main FAB, @see https://materializecss.com/icons.html */
|
|
8
|
+
iconName: string;
|
|
9
|
+
/** Helper option to place the FAB inline instead of the bottom right of the display */
|
|
10
|
+
position?: 'left' | 'right' | 'inline-left' | 'inline-right';
|
|
11
|
+
/**
|
|
12
|
+
* Optional icon class, e.g. tiny (1em), small (2em), medium (4em), large (6em), or 'tiny right'.
|
|
13
|
+
* @default large
|
|
14
|
+
*/
|
|
15
|
+
iconClass?: string;
|
|
16
|
+
/** The buttons you want to show */
|
|
17
|
+
buttons?: Array<{
|
|
18
|
+
/** Optional classes you want to add to the main element */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Name of the icon */
|
|
21
|
+
iconName: string;
|
|
22
|
+
/** Classes of the icon */
|
|
23
|
+
iconClass?: string;
|
|
24
|
+
/** On click function */
|
|
25
|
+
onClick?: (e: UIEvent) => void;
|
|
26
|
+
}>;
|
|
27
|
+
/** Direction to open the buttons */
|
|
28
|
+
direction?: 'top' | 'bottom' | 'left' | 'right';
|
|
29
|
+
/** Whether to show the toolbar */
|
|
30
|
+
toolbarEnabled?: boolean;
|
|
31
|
+
/** Hover behavior */
|
|
32
|
+
hoverEnabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Floating Action Button
|
|
36
|
+
*/
|
|
37
|
+
export declare const FloatingActionButton: FactoryComponent<FloatingActionButtonAttributes>;
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
3
|
-
iconName: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* A simple material icon, defined by its icon name.
|
|
7
|
-
*
|
|
8
|
-
* @example m(Icon, { className: 'small' }, 'create') renders a small 'create' icon
|
|
9
|
-
* @example m(Icon, { className: 'prefix' }, iconName) renders the icon as a prefix
|
|
10
|
-
*/
|
|
11
|
-
export declare const Icon: FactoryComponent<
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface MaterialIcon extends Attributes {
|
|
3
|
+
iconName: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A simple material icon, defined by its icon name.
|
|
7
|
+
*
|
|
8
|
+
* @example m(Icon, { className: 'small' }, 'create') renders a small 'create' icon
|
|
9
|
+
* @example m(Icon, { className: 'prefix' }, iconName) renders the icon as a prefix
|
|
10
|
+
*/
|
|
11
|
+
export declare const Icon: FactoryComponent<MaterialIcon>;
|