mithril-materialized 1.0.0 → 1.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.
- package/dist/autocomplete.d.ts +7 -7
- package/dist/button.d.ts +40 -40
- package/dist/carousel.d.ts +18 -18
- package/dist/chip.d.ts +11 -11
- package/dist/code-block.d.ts +9 -9
- package/dist/collapsible.d.ts +22 -22
- package/dist/collection.d.ts +49 -49
- package/dist/dropdown.d.ts +46 -46
- package/dist/floating-action-button.d.ts +34 -34
- package/dist/icon.d.ts +11 -11
- package/dist/index.d.ts +26 -26
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/input-options.d.ts +81 -81
- package/dist/input.d.ts +42 -42
- package/dist/label.d.ts +22 -22
- package/dist/map-editor.d.ts +63 -63
- package/dist/material-box.d.ts +21 -21
- package/dist/modal.d.ts +26 -26
- package/dist/option.d.ts +56 -52
- package/dist/pagination.d.ts +20 -20
- package/dist/parallax.d.ts +13 -13
- package/dist/pickers.d.ts +8 -8
- package/dist/radio.d.ts +37 -37
- package/dist/select.d.ts +47 -45
- package/dist/switch.d.ts +13 -13
- package/dist/tabs.d.ts +45 -45
- package/dist/timeline.d.ts +24 -24
- package/dist/utils.d.ts +70 -70
- package/package.json +8 -8
package/dist/autocomplete.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import { FactoryComponent } from 'mithril';
|
|
3
|
-
import { IInputOptions } from './input-options';
|
|
4
|
-
export interface IAutoCompleteOptions extends Partial<M.AutocompleteOptions>, IInputOptions<string> {
|
|
5
|
-
}
|
|
6
|
-
/** Component to auto complete your text input */
|
|
7
|
-
export declare const Autocomplete: FactoryComponent<IAutoCompleteOptions>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import { FactoryComponent } from 'mithril';
|
|
3
|
+
import { IInputOptions } from './input-options';
|
|
4
|
+
export interface IAutoCompleteOptions extends Partial<M.AutocompleteOptions>, IInputOptions<string> {
|
|
5
|
+
}
|
|
6
|
+
/** Component to auto complete your text input */
|
|
7
|
+
export declare const Autocomplete: FactoryComponent<IAutoCompleteOptions>;
|
package/dist/button.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface IHtmlAttributes {
|
|
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 IMaterialButton 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?: IHtmlAttributes;
|
|
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, attributes?: string) => FactoryComponent<IMaterialButton>;
|
|
35
|
-
export declare const Button: m.FactoryComponent<IMaterialButton>;
|
|
36
|
-
export declare const LargeButton: m.FactoryComponent<IMaterialButton>;
|
|
37
|
-
export declare const SmallButton: m.FactoryComponent<IMaterialButton>;
|
|
38
|
-
export declare const FlatButton: m.FactoryComponent<IMaterialButton>;
|
|
39
|
-
export declare const RoundIconButton: m.FactoryComponent<IMaterialButton>;
|
|
40
|
-
export declare const SubmitButton: m.FactoryComponent<IMaterialButton>;
|
|
1
|
+
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface IHtmlAttributes {
|
|
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 IMaterialButton 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?: IHtmlAttributes;
|
|
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, attributes?: string) => FactoryComponent<IMaterialButton>;
|
|
35
|
+
export declare const Button: m.FactoryComponent<IMaterialButton>;
|
|
36
|
+
export declare const LargeButton: m.FactoryComponent<IMaterialButton>;
|
|
37
|
+
export declare const SmallButton: m.FactoryComponent<IMaterialButton>;
|
|
38
|
+
export declare const FlatButton: m.FactoryComponent<IMaterialButton>;
|
|
39
|
+
export declare const RoundIconButton: m.FactoryComponent<IMaterialButton>;
|
|
40
|
+
export declare const SubmitButton: m.FactoryComponent<IMaterialButton>;
|
package/dist/carousel.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
-
export interface ICarouselItem extends Attributes {
|
|
4
|
-
/** Relative page link, e.g. '#one' */
|
|
5
|
-
href: string;
|
|
6
|
-
/** Image source */
|
|
7
|
-
src: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ICarousel extends Partial<M.CarouselOptions>, Attributes {
|
|
10
|
-
/** The list of images */
|
|
11
|
-
items: ICarouselItem[];
|
|
12
|
-
}
|
|
13
|
-
export declare const CarouselItem: FactoryComponent<ICarouselItem>;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a collabsible or accordion (via the accordion option, default true) component.
|
|
16
|
-
* @see https://materializecss.com/carousel.html
|
|
17
|
-
*/
|
|
18
|
-
export declare const Carousel: FactoryComponent<ICarousel>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
+
export interface ICarouselItem extends Attributes {
|
|
4
|
+
/** Relative page link, e.g. '#one' */
|
|
5
|
+
href: string;
|
|
6
|
+
/** Image source */
|
|
7
|
+
src: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ICarousel extends Partial<M.CarouselOptions>, Attributes {
|
|
10
|
+
/** The list of images */
|
|
11
|
+
items: ICarouselItem[];
|
|
12
|
+
}
|
|
13
|
+
export declare const CarouselItem: FactoryComponent<ICarouselItem>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a collabsible or accordion (via the accordion option, default true) component.
|
|
16
|
+
* @see https://materializecss.com/carousel.html
|
|
17
|
+
*/
|
|
18
|
+
export declare const Carousel: FactoryComponent<ICarousel>;
|
package/dist/chip.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
-
export interface IChipsOptions extends Partial<M.ChipsOptions>, Attributes {
|
|
4
|
-
onchange?: (chips: M.ChipData[]) => void;
|
|
5
|
-
/** Optional label above the input */
|
|
6
|
-
label?: string;
|
|
7
|
-
/** Optional help text below the input */
|
|
8
|
-
helperText?: string;
|
|
9
|
-
}
|
|
10
|
-
/** Chips and tags */
|
|
11
|
-
export declare const Chips: FactoryComponent<IChipsOptions>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
+
export interface IChipsOptions extends Partial<M.ChipsOptions>, Attributes {
|
|
4
|
+
onchange?: (chips: M.ChipData[]) => void;
|
|
5
|
+
/** Optional label above the input */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Optional help text below the input */
|
|
8
|
+
helperText?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Chips and tags */
|
|
11
|
+
export declare const Chips: FactoryComponent<IChipsOptions>;
|
package/dist/code-block.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import './styles/codeblock.css';
|
|
2
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
-
export interface ICodeBlock extends Attributes {
|
|
4
|
-
language?: string;
|
|
5
|
-
code: string | string[];
|
|
6
|
-
newRow?: boolean;
|
|
7
|
-
}
|
|
8
|
-
/** A simple code block without syntax high-lighting */
|
|
9
|
-
export declare const CodeBlock: FactoryComponent<ICodeBlock>;
|
|
1
|
+
import './styles/codeblock.css';
|
|
2
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
+
export interface ICodeBlock extends Attributes {
|
|
4
|
+
language?: string;
|
|
5
|
+
code: string | string[];
|
|
6
|
+
newRow?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** A simple code block without syntax high-lighting */
|
|
9
|
+
export declare const CodeBlock: FactoryComponent<ICodeBlock>;
|
package/dist/collapsible.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import { FactoryComponent, Attributes, Vnode } from 'mithril';
|
|
3
|
-
export interface ICollapsibleItem extends Attributes {
|
|
4
|
-
/** Header of the collabsible item, may contain HTML or may be a Vnode */
|
|
5
|
-
header?: string | Vnode<any, any>;
|
|
6
|
-
/** Body of the collabsible item, may contain HTML or may be a Vnode */
|
|
7
|
-
body?: string | Vnode<any, any>;
|
|
8
|
-
/** If active, preselect the collabsible item. */
|
|
9
|
-
active?: boolean;
|
|
10
|
-
/** Add an material icon in front of the header. */
|
|
11
|
-
iconName?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ICollapsible extends Partial<M.CollapsibleOptions>, Attributes {
|
|
14
|
-
/** The list of accordeon/collabsible items */
|
|
15
|
-
items: ICollapsibleItem[];
|
|
16
|
-
}
|
|
17
|
-
export declare const CollapsibleItem: FactoryComponent<ICollapsibleItem>;
|
|
18
|
-
/**
|
|
19
|
-
* Creates a collabsible or accordion (via the accordion option, default true) component.
|
|
20
|
-
* @see https://materializecss.com/collapsible.html
|
|
21
|
-
*/
|
|
22
|
-
export declare const Collapsible: FactoryComponent<ICollapsible>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import { FactoryComponent, Attributes, Vnode } from 'mithril';
|
|
3
|
+
export interface ICollapsibleItem extends Attributes {
|
|
4
|
+
/** Header of the collabsible item, may contain HTML or may be a Vnode */
|
|
5
|
+
header?: string | Vnode<any, any>;
|
|
6
|
+
/** Body of the collabsible item, may contain HTML or may be a Vnode */
|
|
7
|
+
body?: string | Vnode<any, any>;
|
|
8
|
+
/** If active, preselect the collabsible item. */
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** Add an material icon in front of the header. */
|
|
11
|
+
iconName?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ICollapsible extends Partial<M.CollapsibleOptions>, Attributes {
|
|
14
|
+
/** The list of accordeon/collabsible items */
|
|
15
|
+
items: ICollapsibleItem[];
|
|
16
|
+
}
|
|
17
|
+
export declare const CollapsibleItem: FactoryComponent<ICollapsibleItem>;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a collabsible or accordion (via the accordion option, default true) component.
|
|
20
|
+
* @see https://materializecss.com/collapsible.html
|
|
21
|
+
*/
|
|
22
|
+
export declare const Collapsible: FactoryComponent<ICollapsible>;
|
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 ICollectionItem {
|
|
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: ICollectionItem) => void;
|
|
26
|
-
/** Any other virtual element properties, including attributes and event handlers. */
|
|
27
|
-
[property: string]: any;
|
|
28
|
-
}
|
|
29
|
-
export interface ICollection extends Attributes {
|
|
30
|
-
/** Optional header */
|
|
31
|
-
header?: string;
|
|
32
|
-
/** The list of items */
|
|
33
|
-
items: ICollectionItem[];
|
|
34
|
-
/** Mode of operation */
|
|
35
|
-
mode?: CollectionMode;
|
|
36
|
-
}
|
|
37
|
-
export declare const SecondaryContent: FactoryComponent<ICollectionItem>;
|
|
38
|
-
export declare const ListItem: FactoryComponent<{
|
|
39
|
-
item: ICollectionItem;
|
|
40
|
-
mode: CollectionMode;
|
|
41
|
-
}>;
|
|
42
|
-
export declare const AnchorItem: FactoryComponent<{
|
|
43
|
-
item: ICollectionItem;
|
|
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<ICollection>;
|
|
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 ICollectionItem {
|
|
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: ICollectionItem) => void;
|
|
26
|
+
/** Any other virtual element properties, including attributes and event handlers. */
|
|
27
|
+
[property: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export interface ICollection extends Attributes {
|
|
30
|
+
/** Optional header */
|
|
31
|
+
header?: string;
|
|
32
|
+
/** The list of items */
|
|
33
|
+
items: ICollectionItem[];
|
|
34
|
+
/** Mode of operation */
|
|
35
|
+
mode?: CollectionMode;
|
|
36
|
+
}
|
|
37
|
+
export declare const SecondaryContent: FactoryComponent<ICollectionItem>;
|
|
38
|
+
export declare const ListItem: FactoryComponent<{
|
|
39
|
+
item: ICollectionItem;
|
|
40
|
+
mode: CollectionMode;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const AnchorItem: FactoryComponent<{
|
|
43
|
+
item: ICollectionItem;
|
|
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<ICollection>;
|
package/dist/dropdown.d.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import m, { Component, Attributes } from 'mithril';
|
|
3
|
-
export interface IDropdownOption<T extends string | number> {
|
|
4
|
-
/** ID property of the selected item */
|
|
5
|
-
id?: T;
|
|
6
|
-
/** Label to show in the dropdown */
|
|
7
|
-
label: string;
|
|
8
|
-
/** Can we select the item */
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
/** Display a Materials Icon in front of the label */
|
|
11
|
-
iconName?: string;
|
|
12
|
-
/** Add a divider */
|
|
13
|
-
divider?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface IDropdownOptions<T extends string | number> extends Partial<M.DropdownOptions>, Attributes {
|
|
16
|
-
/**
|
|
17
|
-
* Optional id of the dropdown element
|
|
18
|
-
* @default 'dropdown'
|
|
19
|
-
*/
|
|
20
|
-
id?: T;
|
|
21
|
-
/**
|
|
22
|
-
* Optional label when no item is selected
|
|
23
|
-
* @default 'Select'
|
|
24
|
-
*/
|
|
25
|
-
label?: string;
|
|
26
|
-
key?: string | number;
|
|
27
|
-
/** If true, disable the selection */
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
/** Item array to show in the dropdown. If the value is not supplied, uses he name. */
|
|
30
|
-
items: IDropdownOption<T>[];
|
|
31
|
-
/**
|
|
32
|
-
* Selected value or name
|
|
33
|
-
* @deprecated Use initialValue instead
|
|
34
|
-
*/
|
|
35
|
-
checkedId?: T;
|
|
36
|
-
/** Selected value or name */
|
|
37
|
-
initialValue?: T;
|
|
38
|
-
/** When a value or name is selected */
|
|
39
|
-
onchange?: (value: T) => void;
|
|
40
|
-
/** Uses Materialize icons as a prefix or postfix. */
|
|
41
|
-
iconName?: string;
|
|
42
|
-
/** Add a description underneath the input field. */
|
|
43
|
-
helperText?: string;
|
|
44
|
-
}
|
|
45
|
-
/** Dropdown component */
|
|
46
|
-
export declare const Dropdown: <T extends string | number>() => m.Component<IDropdownOptions<T>, {}>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import m, { Component, Attributes } from 'mithril';
|
|
3
|
+
export interface IDropdownOption<T extends string | number> {
|
|
4
|
+
/** ID property of the selected item */
|
|
5
|
+
id?: T;
|
|
6
|
+
/** Label to show in the dropdown */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Can we select the item */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Display a Materials Icon in front of the label */
|
|
11
|
+
iconName?: string;
|
|
12
|
+
/** Add a divider */
|
|
13
|
+
divider?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface IDropdownOptions<T extends string | number> extends Partial<M.DropdownOptions>, Attributes {
|
|
16
|
+
/**
|
|
17
|
+
* Optional id of the dropdown element
|
|
18
|
+
* @default 'dropdown'
|
|
19
|
+
*/
|
|
20
|
+
id?: T;
|
|
21
|
+
/**
|
|
22
|
+
* Optional label when no item is selected
|
|
23
|
+
* @default 'Select'
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
key?: string | number;
|
|
27
|
+
/** If true, disable the selection */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Item array to show in the dropdown. If the value is not supplied, uses he name. */
|
|
30
|
+
items: IDropdownOption<T>[];
|
|
31
|
+
/**
|
|
32
|
+
* Selected value or name
|
|
33
|
+
* @deprecated Use initialValue instead
|
|
34
|
+
*/
|
|
35
|
+
checkedId?: T;
|
|
36
|
+
/** Selected value or name */
|
|
37
|
+
initialValue?: T;
|
|
38
|
+
/** When a value or name is selected */
|
|
39
|
+
onchange?: (value: T) => void;
|
|
40
|
+
/** Uses Materialize icons as a prefix or postfix. */
|
|
41
|
+
iconName?: string;
|
|
42
|
+
/** Add a description underneath the input field. */
|
|
43
|
+
helperText?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Dropdown component */
|
|
46
|
+
export declare const Dropdown: <T extends string | number>() => m.Component<IDropdownOptions<T>, {}>;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import { FactoryComponent } from 'mithril';
|
|
3
|
-
export interface IFloatingActionButton extends Partial<M.FloatingActionButtonOptions> {
|
|
4
|
-
/** Optional classes to add to the top element */
|
|
5
|
-
className?: string;
|
|
6
|
-
/** Optional style to add to the top element, e.g. for positioning it inline */
|
|
7
|
-
style?: string;
|
|
8
|
-
/** Material-icons name for the main FAB, @see https://materializecss.com/icons.html */
|
|
9
|
-
iconName: string;
|
|
10
|
-
/** Helper option to place the FAB inline instead of the bottom right of the display */
|
|
11
|
-
position?: 'left' | 'right' | 'inline-left' | 'inline-right';
|
|
12
|
-
/**
|
|
13
|
-
* Optional icon class, e.g. tiny (1em), small (2em), medium (4em), large (6em), or 'tiny right'.
|
|
14
|
-
* @default large
|
|
15
|
-
*/
|
|
16
|
-
iconClass?: string;
|
|
17
|
-
/** The buttons you want to show */
|
|
18
|
-
buttons?: Array<{
|
|
19
|
-
/** Optional classes you want to add to the main element */
|
|
20
|
-
className?: string;
|
|
21
|
-
/** Name of the icon */
|
|
22
|
-
iconName: string;
|
|
23
|
-
/** Classes of the icon */
|
|
24
|
-
iconClass?: string;
|
|
25
|
-
/** On click function */
|
|
26
|
-
onClick?: (e: UIEvent) => void;
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* A Floating Action Button.
|
|
31
|
-
*
|
|
32
|
-
* @example FlatButton = ButtonFactory('a.waves-effect.waves-teal.btn-flat');
|
|
33
|
-
*/
|
|
34
|
-
export declare const FloatingActionButton: FactoryComponent<IFloatingActionButton>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import { FactoryComponent } from 'mithril';
|
|
3
|
+
export interface IFloatingActionButton extends Partial<M.FloatingActionButtonOptions> {
|
|
4
|
+
/** Optional classes to add to the top element */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Optional style to add to the top element, e.g. for positioning it inline */
|
|
7
|
+
style?: string;
|
|
8
|
+
/** Material-icons name for the main FAB, @see https://materializecss.com/icons.html */
|
|
9
|
+
iconName: string;
|
|
10
|
+
/** Helper option to place the FAB inline instead of the bottom right of the display */
|
|
11
|
+
position?: 'left' | 'right' | 'inline-left' | 'inline-right';
|
|
12
|
+
/**
|
|
13
|
+
* Optional icon class, e.g. tiny (1em), small (2em), medium (4em), large (6em), or 'tiny right'.
|
|
14
|
+
* @default large
|
|
15
|
+
*/
|
|
16
|
+
iconClass?: string;
|
|
17
|
+
/** The buttons you want to show */
|
|
18
|
+
buttons?: Array<{
|
|
19
|
+
/** Optional classes you want to add to the main element */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Name of the icon */
|
|
22
|
+
iconName: string;
|
|
23
|
+
/** Classes of the icon */
|
|
24
|
+
iconClass?: string;
|
|
25
|
+
/** On click function */
|
|
26
|
+
onClick?: (e: UIEvent) => void;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A Floating Action Button.
|
|
31
|
+
*
|
|
32
|
+
* @example FlatButton = ButtonFactory('a.waves-effect.waves-teal.btn-flat');
|
|
33
|
+
*/
|
|
34
|
+
export declare const FloatingActionButton: FactoryComponent<IFloatingActionButton>;
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface IMaterialIcon 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<IMaterialIcon>;
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface IMaterialIcon 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<IMaterialIcon>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export * from './autocomplete';
|
|
2
|
-
export * from './button';
|
|
3
|
-
export * from './carousel';
|
|
4
|
-
export * from './chip';
|
|
5
|
-
export * from './code-block';
|
|
6
|
-
export * from './collapsible';
|
|
7
|
-
export * from './collection';
|
|
8
|
-
export * from './dropdown';
|
|
9
|
-
export * from './floating-action-button';
|
|
10
|
-
export * from './icon';
|
|
11
|
-
export * from './input-options';
|
|
12
|
-
export * from './input';
|
|
13
|
-
export * from './label';
|
|
14
|
-
export * from './map-editor';
|
|
15
|
-
export * from './material-box';
|
|
16
|
-
export * from './modal';
|
|
17
|
-
export * from './option';
|
|
18
|
-
export * from './pagination';
|
|
19
|
-
export * from './parallax';
|
|
20
|
-
export * from './pickers';
|
|
21
|
-
export * from './radio';
|
|
22
|
-
export * from './select';
|
|
23
|
-
export * from './switch';
|
|
24
|
-
export * from './tabs';
|
|
25
|
-
export * from './timeline';
|
|
26
|
-
export * from './utils';
|
|
1
|
+
export * from './autocomplete';
|
|
2
|
+
export * from './button';
|
|
3
|
+
export * from './carousel';
|
|
4
|
+
export * from './chip';
|
|
5
|
+
export * from './code-block';
|
|
6
|
+
export * from './collapsible';
|
|
7
|
+
export * from './collection';
|
|
8
|
+
export * from './dropdown';
|
|
9
|
+
export * from './floating-action-button';
|
|
10
|
+
export * from './icon';
|
|
11
|
+
export * from './input-options';
|
|
12
|
+
export * from './input';
|
|
13
|
+
export * from './label';
|
|
14
|
+
export * from './map-editor';
|
|
15
|
+
export * from './material-box';
|
|
16
|
+
export * from './modal';
|
|
17
|
+
export * from './option';
|
|
18
|
+
export * from './pagination';
|
|
19
|
+
export * from './parallax';
|
|
20
|
+
export * from './pickers';
|
|
21
|
+
export * from './radio';
|
|
22
|
+
export * from './select';
|
|
23
|
+
export * from './switch';
|
|
24
|
+
export * from './tabs';
|
|
25
|
+
export * from './timeline';
|
|
26
|
+
export * from './utils';
|