mithril-materialized 0.19.6 → 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/dist/kanban.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import m, { Component, Attributes } from 'mithril';
|
|
2
|
-
import { IModelField, IConvertibleType } from './layout-form-generator';
|
|
3
|
-
import './styles/kanban.css';
|
|
4
|
-
export interface IKanbanI18n {
|
|
5
|
-
newItem: string;
|
|
6
|
-
modalDeleteItem: string;
|
|
7
|
-
modalCreateNewItem: string;
|
|
8
|
-
modalEditNewItem: string;
|
|
9
|
-
}
|
|
10
|
-
export interface IKanban<T> extends Attributes {
|
|
11
|
-
/**
|
|
12
|
-
* Label for creating a new item
|
|
13
|
-
* @deprecated Use i18n instead
|
|
14
|
-
*/
|
|
15
|
-
label?: string;
|
|
16
|
-
/** Label for creating a new item */
|
|
17
|
-
i18n?: IKanbanI18n;
|
|
18
|
-
/** The model representing the item's fields */
|
|
19
|
-
model: IModelField[];
|
|
20
|
-
/** The items that we want to show */
|
|
21
|
-
items?: T[];
|
|
22
|
-
/** Notify of changes */
|
|
23
|
-
onchange?: (items: T[]) => void;
|
|
24
|
-
/** If true, use a modal for editing with a fixed footer */
|
|
25
|
-
fixedFooter?: boolean;
|
|
26
|
-
/** Can we create and edit new items: default true */
|
|
27
|
-
canEdit?: boolean;
|
|
28
|
-
/** Can we sort items: default true */
|
|
29
|
-
canSort?: boolean;
|
|
30
|
-
/** Can we drag items - in this case, sorting is disabled: default false */
|
|
31
|
-
canDrag?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Can we move items between lists (based on the same model): default false.
|
|
34
|
-
* Must be enabled on both lists in order to work.
|
|
35
|
-
*/
|
|
36
|
-
moveBetweenList?: boolean;
|
|
37
|
-
/** Sort direction */
|
|
38
|
-
sortDirection?: 'asc' | 'desc';
|
|
39
|
-
/** Properties to sort */
|
|
40
|
-
sortProperties?: string[];
|
|
41
|
-
/** Property IDs which can always be edited, e.g. also in the list view */
|
|
42
|
-
editableIds?: string[];
|
|
43
|
-
/** If true, disable the item */
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
}
|
|
46
|
-
/** A flexible list of items, supporting drag-n-drop */
|
|
47
|
-
export declare const Kanban: <T extends IConvertibleType>() => m.Component<Partial<IKanban<T>>, {}>;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
/// <reference types="materialize-css" />
|
|
3
|
-
import 'tslib';
|
|
4
|
-
import m, { Component } from 'mithril';
|
|
5
|
-
import { IInputOption } from './option';
|
|
6
|
-
/** List of components that can be used for generating a form */
|
|
7
|
-
export declare type ComponentType = 'text' | 'number' | 'url' | 'email' | 'date' | 'time' | 'checkbox' | 'select' | 'options' | 'radios';
|
|
8
|
-
/** Generic description of a form field, based on a union of the individual component options */
|
|
9
|
-
export interface IModelField {
|
|
10
|
-
/** Name of the property in the generated object */
|
|
11
|
-
id: string;
|
|
12
|
-
/** Type of component to use for rendering the field. If empty, field will not be rendered. */
|
|
13
|
-
component?: ComponentType;
|
|
14
|
-
/** Label to display */
|
|
15
|
-
label?: string;
|
|
16
|
-
/** Optional class to append to the field */
|
|
17
|
-
className?: string;
|
|
18
|
-
/** Optional icon to display on the element, based on the materializecss.com/icons */
|
|
19
|
-
iconName?: string;
|
|
20
|
-
/** Optional class for the icon, e.g. to make it smaller or bigger */
|
|
21
|
-
iconClass?: string;
|
|
22
|
-
/** For text, may it have multiple lines */
|
|
23
|
-
multiline?: boolean;
|
|
24
|
-
/** If true, the item is required */
|
|
25
|
-
required?: boolean;
|
|
26
|
-
/** If true, the item is disabled */
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
/** Optional placeholder */
|
|
29
|
-
placeholder?: string;
|
|
30
|
-
/** Optional helper text */
|
|
31
|
-
helperText?: string;
|
|
32
|
-
/** Start a new row after this field */
|
|
33
|
-
newRow?: boolean;
|
|
34
|
-
/** Options for radios, options (checkboxes), and selections */
|
|
35
|
-
options?: IInputOption[];
|
|
36
|
-
/** If true, draw the radio buttons inline */
|
|
37
|
-
inline?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* If specified, generate a value automatically, e.g. to set an ID, or to use a GUID.
|
|
40
|
-
* Possible options are `guid` to generate a GUID, or 'id' to generate an `idXXXX`.
|
|
41
|
-
*/
|
|
42
|
-
autogenerate?: 'guid' | 'id';
|
|
43
|
-
}
|
|
44
|
-
/** A data object that can be created */
|
|
45
|
-
export interface IConvertibleType {
|
|
46
|
-
id: string | number;
|
|
47
|
-
[key: string]: undefined | string | number | boolean | Date | Array<string | number>;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Convert a model field to a component.
|
|
51
|
-
*
|
|
52
|
-
* @param model Model properties
|
|
53
|
-
* @param value Initial value of the property item
|
|
54
|
-
* @param options Component options
|
|
55
|
-
*/
|
|
56
|
-
export declare const fieldToComponent: ({ component, required: isMandatory, options: selectOptions, autogenerate, ...props }: IModelField, value?: string | number | boolean | Date | Array<string | number>, options?: {
|
|
57
|
-
onchange?: ((v: string | number | boolean | Date | Array<string | number>, overwrite?: boolean) => void) | undefined;
|
|
58
|
-
containerId?: string | undefined;
|
|
59
|
-
autofocus?: boolean | undefined;
|
|
60
|
-
disabled?: boolean | undefined;
|
|
61
|
-
multiline?: boolean | undefined;
|
|
62
|
-
key?: string | number | undefined;
|
|
63
|
-
}) => m.Vnode<import("./input-options").IInputOptions<string>, unknown> | m.Vnode<import("./input-options").IInputOptions<number>, unknown> | m.Vnode<import("./option").IInputCheckbox, unknown> | m.Vnode<import("./select").ISelectOptions, unknown> | m.Vnode<import("./option").IOptions, unknown> | m.Vnode<import("./radio").IRadioButtons, unknown> | m.Vnode<import("./input-options").IInputOptions<Date> & Partial<M.DatepickerOptions>, unknown> | m.Vnode<import("./input-options").IInputOptions<string> & Partial<M.TimepickerOptions>, unknown> | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Generate a new group or form based on an object's model description, where a model consists of multiple fields.
|
|
66
|
-
*/
|
|
67
|
-
export declare const LayoutForm: <T extends IConvertibleType>() => m.Component<{
|
|
68
|
-
el?: string | undefined;
|
|
69
|
-
model: IModelField[];
|
|
70
|
-
item: T;
|
|
71
|
-
containerId?: string | undefined;
|
|
72
|
-
disabled?: boolean | undefined;
|
|
73
|
-
editableIds?: (keyof T)[] | undefined;
|
|
74
|
-
onchange?: ((valid: boolean) => void) | undefined;
|
|
75
|
-
}, {}>;
|
package/dist/map-editor.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
import './styles/map-editor.css';
|
|
3
|
-
import { ICollectionItem } from './collection';
|
|
4
|
-
export interface IMapEditor extends Attributes {
|
|
5
|
-
/** Optional ID of the element */
|
|
6
|
-
id?: string;
|
|
7
|
-
/** If true, displays a header over the map */
|
|
8
|
-
header?: string;
|
|
9
|
-
/** Instead of a header, use a label */
|
|
10
|
-
label?: string;
|
|
11
|
-
/** Places a required * after the label */
|
|
12
|
-
isMandatory?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Optional value for the key label
|
|
15
|
-
* @default: "Key"
|
|
16
|
-
*/
|
|
17
|
-
labelKey?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Optional value for the value label
|
|
20
|
-
* @default: "Value"
|
|
21
|
-
*/
|
|
22
|
-
labelValue?: string;
|
|
23
|
-
/** If true, the item cannot be edited */
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
/** Icon for the properties' collection */
|
|
26
|
-
iconName?: string;
|
|
27
|
-
/** Icon for the key editor: if none provided, and the iconName is set, uses 'label' */
|
|
28
|
-
iconNameKey?: string;
|
|
29
|
-
/** If true, do not parse arrays like [1, 2, 3] into number[] or [a, b, c] into a string[] */
|
|
30
|
-
disallowArrays?: boolean;
|
|
31
|
-
/** The actual map of key-value pairs supports numbers, strings, booleans and arrays of strings and numbers. */
|
|
32
|
-
properties: {
|
|
33
|
-
[key: string]: number | string | boolean | Array<string | number>;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Called when the properties collection has changed. Not needed if you are performing a direct edit on the
|
|
37
|
-
* properties object, but in case you have created a mapping, this allows you to convert the object back again.
|
|
38
|
-
*/
|
|
39
|
-
onchange?: (properties: {
|
|
40
|
-
[key: string]: number | string | boolean | Array<string | number>;
|
|
41
|
-
}) => void;
|
|
42
|
-
/**
|
|
43
|
-
* In order to create a boolean, you first have to enter a truthy or falsy value.
|
|
44
|
-
* Default 'true' and 'false', but you can add more options.
|
|
45
|
-
*/
|
|
46
|
-
truthy?: string[];
|
|
47
|
-
/**
|
|
48
|
-
* In order to create a boolean, you first have to enter a truthy or falsy value.
|
|
49
|
-
* Default 'true' and 'false', but you can add more options.
|
|
50
|
-
*/
|
|
51
|
-
falsy?: string[];
|
|
52
|
-
/**
|
|
53
|
-
* Optional function to replace the render function of a key-value pair.
|
|
54
|
-
* The ICollectionItems's title may be a Vnode.
|
|
55
|
-
*/
|
|
56
|
-
keyValueConverter?: (key: string, value: number | string | boolean | Array<string | number>) => ICollectionItem;
|
|
57
|
-
/** Optional class to apply to the key column, @default .col.s4 */
|
|
58
|
-
keyClass?: string;
|
|
59
|
-
/** Optional class to apply to the value column, @default .col.s8 */
|
|
60
|
-
valueClass?: string;
|
|
61
|
-
}
|
|
62
|
-
/** A simple viewer and/or editor for a map of key - value pairs */
|
|
63
|
-
export declare const MapEditor: FactoryComponent<IMapEditor>;
|
package/dist/timeline.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Vnode, FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
import './styles/timeline.css';
|
|
3
|
-
export interface ITimelineItem {
|
|
4
|
-
id?: string;
|
|
5
|
-
title?: Vnode<any, any> | string;
|
|
6
|
-
datetime: Date;
|
|
7
|
-
iconName?: string;
|
|
8
|
-
active?: boolean;
|
|
9
|
-
content?: Vnode<any, any> | string;
|
|
10
|
-
}
|
|
11
|
-
export interface ITimeline extends Attributes {
|
|
12
|
-
items: ITimelineItem[];
|
|
13
|
-
/** When an item is selected, call this function */
|
|
14
|
-
onSelect?: (ti: ITimelineItem) => void;
|
|
15
|
-
/** Formatter for the dates, @default date/month/year in UTC */
|
|
16
|
-
dateFormatter?: (d: Date) => string;
|
|
17
|
-
/** Formatter for the time @default HH:mm in UTC */
|
|
18
|
-
timeFormatter?: (d: Date) => string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A timeline component to generate a simple vertical timeline based on Codrops' Vertical Timeline.
|
|
22
|
-
* @see https://tympanus.net/codrops/2013/05/02/vertical-timeline/
|
|
23
|
-
*/
|
|
24
|
-
export declare const Timeline: FactoryComponent<ITimeline>;
|