mithril-materialized 0.19.7 → 1.0.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 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.0-rc4 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.
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,7 +45,6 @@ Supported components:
45
45
  - HelperText
46
46
  - Not from Materialize-CSS
47
47
  - CodeBlock
48
- - [Kanban](https://erikvullings.github.io/mithril-materialized/#!/kanban)
49
48
  - [Timeline](https://erikvullings.github.io/mithril-materialized/#!/timeline)
50
49
  - [MapEditor](https://erikvullings.github.io/mithril-materialized/#!/map_editor)
51
50
 
@@ -1,8 +1,8 @@
1
1
  /// <reference types="materialize-css" />
2
- import { Component, Attributes } from 'mithril';
3
- export interface IDropdownOption {
2
+ import m, { Component, Attributes } from 'mithril';
3
+ export interface IDropdownOption<T extends string | number> {
4
4
  /** ID property of the selected item */
5
- id?: string | number;
5
+ id?: T;
6
6
  /** Label to show in the dropdown */
7
7
  label: string;
8
8
  /** Can we select the item */
@@ -12,12 +12,12 @@ export interface IDropdownOption {
12
12
  /** Add a divider */
13
13
  divider?: boolean;
14
14
  }
15
- export interface IDropdownOptions extends Partial<M.DropdownOptions>, Attributes {
15
+ export interface IDropdownOptions<T extends string | number> extends Partial<M.DropdownOptions>, Attributes {
16
16
  /**
17
17
  * Optional id of the dropdown element
18
18
  * @default 'dropdown'
19
19
  */
20
- id?: string;
20
+ id?: T;
21
21
  /**
22
22
  * Optional label when no item is selected
23
23
  * @default 'Select'
@@ -27,20 +27,20 @@ export interface IDropdownOptions extends Partial<M.DropdownOptions>, Attributes
27
27
  /** If true, disable the selection */
28
28
  disabled?: boolean;
29
29
  /** Item array to show in the dropdown. If the value is not supplied, uses he name. */
30
- items: IDropdownOption[];
30
+ items: IDropdownOption<T>[];
31
31
  /**
32
32
  * Selected value or name
33
33
  * @deprecated Use initialValue instead
34
34
  */
35
- checkedId?: string | number;
35
+ checkedId?: T;
36
36
  /** Selected value or name */
37
- initialValue?: string | number;
37
+ initialValue?: T;
38
38
  /** When a value or name is selected */
39
- onchange?: (value: string | number) => void;
39
+ onchange?: (value: T) => void;
40
40
  /** Uses Materialize icons as a prefix or postfix. */
41
41
  iconName?: string;
42
42
  /** Add a description underneath the input field. */
43
43
  helperText?: string;
44
44
  }
45
45
  /** Dropdown component */
46
- export declare const Dropdown: () => Component<IDropdownOptions>;
46
+ export declare const Dropdown: <T extends string | number>() => m.Component<IDropdownOptions<T>, {}>;
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .twist{transform:scaleY(-1)}input[type=color]:not(.browser-default){background-color:transparent;border:none;border-bottom:1px solid #9e9e9e;border-radius:0;box-shadow:none;box-sizing:content-box;font-size:16px;height:3rem;margin:0 0 8px;outline:none;padding:0;transition:box-shadow .3s,border .3s;width:100%}.input-field.options>label{top:-2.5rem}.codeblock{margin:1.5rem 0 2.5rem}.codeblock>div{margin-bottom:1rem}.codeblock>label{display:inline-block}.kanban .kanban__draggable{cursor:move;cursor:grab;cursor:-webkit-grab}.kanban .kanban__draggable:active{cursor:grabbing;cursor:-webkit-grabbing}.kanban .kanban__below{background:linear-gradient(180deg,rgba(30,87,153,0) 0,rgba(30,87,153,.7));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#001e5799",endColorstr="#b31e5799",GradientType=0)}.kanban .kanban__above{background:linear-gradient(180deg,rgba(30,87,153,.7) 0,rgba(30,87,153,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#b31e5799",endColorstr="#001e5799",GradientType=0)}.kanban__item{padding-bottom:12px}.kanban__item.disabled{padding-bottom:24px}.kanban__item>.card-action{margin-bottom:0;text-align:right}.map-editor .input-field .prefix~.collection{margin-left:3rem;width:92%;width:calc(100% - 3rem)}.map-editor .active .checkbox-in-collection label>input[type=checkbox]:checked+span:before{-webkit-backface-visibility:hidden;border-color:transparent #fff #fff transparent;border-style:solid;border-width:2px;height:22px;left:-3px;top:-4px;transform:rotate(40deg);transform-origin:100% 100%;width:12px}.clear,.clear-10,.clear-15{clear:both}.clear-10{margin-bottom:10px}.clear-15{margin-bottom:15px}span.mandatory{color:red;margin-left:5px}label+.switch{margin-top:1rem}.mm_timeline{list-style:none;margin:30px 0 0;padding:0;position:relative}.mm_timeline:before{background:#afdcf8;bottom:0;content:"";left:20%;margin-left:-10px;position:absolute;top:0;width:10px}.mm_timeline>li .mm_time{display:block;padding-right:100px;position:absolute;width:25%}.mm_timeline>li .mm_time span{display:block;text-align:right}.mm_timeline>li .mm_time span:first-child{color:#bdd0db;font-size:.9em}.mm_timeline>li .mm_time span:last-child{color:#3594cb;font-size:1.4em}.mm_timeline>li:nth-child(odd) .mm_time span:last-child{color:#6cbfee}.mm_timeline>li.active:nth-child(2n) .mm_time span:last-child,.mm_timeline>li.active:nth-child(odd) .mm_time span:last-child{color:#060558}.mm_timeline>li .mm_label{background:#3594cb;border-radius:5px;color:#fff;font-size:1.2em;font-weight:300;line-height:1.4;margin:0 0 15px 28%;padding:.6em 1em;position:relative}.mm_timeline>li.active .mm_label{border:4px solid #060558}.mm_timeline>li:nth-child(odd) .mm_label{background:#6cbfee}.mm_timeline>li .mm_label h5{border-bottom:1px solid hsla(0,0%,100%,.4);margin-top:0;padding:0 0 10px}.mm_timeline>li .mm_label:after{border:10px solid transparent;border-right-color:#3594cb;content:" ";height:0;pointer-events:none;position:absolute;right:100%;top:10px;width:0}.mm_timeline>li:nth-child(2n).active .mm_label:after,.mm_timeline>li:nth-child(odd).active .mm_label:after{border-right-color:#060558}.mm_timeline>li:nth-child(odd) .mm_label:after{border-right-color:#6cbfee}.mm_timeline>li .mm_icon{-webkit-font-smoothing:antialiased;background:#46a4da;border-radius:50%;box-shadow:0 0 0 8px #afdcf8;color:#fff;font-size:1.4em;font-style:normal;font-variant:normal;font-weight:400;height:40px;left:20%;line-height:40px;margin:0 0 0 -25px;position:absolute;text-align:center;text-transform:none;width:40px}.mm_timeline>li.active .mm_icon{background:#060558}.mm_icon>.material-icons{line-height:3rem}@media screen and (max-width:65.375em){.mm_timeline>li .mm_time span:last-child{font-size:1.5em}}@media screen and (max-width:47.2em){.mm_timeline:before{display:none}.mm_timeline>li .mm_time{padding:0 0 20px;position:relative;width:100%}.mm_timeline>li .mm_time span{text-align:left}.mm_timeline>li .mm_label{font-size:95%;font-weight:400;margin:0 0 30px;padding:1em}.mm_timeline>li .mm_label:after{border-bottom-color:#3594cb;border-right-color:transparent;left:20px;right:auto;top:-20px}.mm_timeline>li:nth-child(odd) .mm_label:after{border-bottom-color:#6cbfee;border-right-color:transparent}.mm_timeline>li .mm_icon{float:right;left:auto;margin:-55px 5px 0 0;position:relative}}
1
+ .twist{transform:scaleY(-1)}input[type=color]:not(.browser-default){background-color:transparent;border:none;border-bottom:1px solid #9e9e9e;border-radius:0;box-shadow:none;box-sizing:content-box;font-size:16px;height:3rem;margin:0 0 8px;outline:none;padding:0;transition:box-shadow .3s,border .3s;width:100%}.input-field.options>label{top:-2.5rem}.codeblock{margin:1.5rem 0 2.5rem}.codeblock>div{margin-bottom:1rem}.codeblock>label{display:inline-block}.map-editor .input-field .prefix~.collection{margin-left:3rem;width:92%;width:calc(100% - 3rem)}.map-editor .active .checkbox-in-collection label>input[type=checkbox]:checked+span:before{-webkit-backface-visibility:hidden;border-color:transparent #fff #fff transparent;border-style:solid;border-width:2px;height:22px;left:-3px;top:-4px;transform:rotate(40deg);transform-origin:100% 100%;width:12px}.clear,.clear-10,.clear-15{clear:both}.clear-10{margin-bottom:10px}.clear-15{margin-bottom:15px}span.mandatory{color:red;margin-left:5px}label+.switch{margin-top:1rem}.mm_timeline{list-style:none;margin:30px 0 0;padding:0;position:relative}.mm_timeline:before{background:#afdcf8;bottom:0;content:"";left:20%;margin-left:-10px;position:absolute;top:0;width:10px}.mm_timeline>li .mm_time{display:block;padding-right:100px;position:absolute;width:25%}.mm_timeline>li .mm_time span{display:block;text-align:right}.mm_timeline>li .mm_time span:first-child{color:#bdd0db;font-size:.9em}.mm_timeline>li .mm_time span:last-child{color:#3594cb;font-size:1.4em}.mm_timeline>li:nth-child(odd) .mm_time span:last-child{color:#6cbfee}.mm_timeline>li.active:nth-child(2n) .mm_time span:last-child,.mm_timeline>li.active:nth-child(odd) .mm_time span:last-child{color:#060558}.mm_timeline>li .mm_label{background:#3594cb;border-radius:5px;color:#fff;font-size:1.2em;font-weight:300;line-height:1.4;margin:0 0 15px 28%;padding:.6em 1em;position:relative}.mm_timeline>li.active .mm_label{border:4px solid #060558}.mm_timeline>li:nth-child(odd) .mm_label{background:#6cbfee}.mm_timeline>li .mm_label h5{border-bottom:1px solid hsla(0,0%,100%,.4);margin-top:0;padding:0 0 10px}.mm_timeline>li .mm_label:after{border:10px solid transparent;border-right-color:#3594cb;content:" ";height:0;pointer-events:none;position:absolute;right:100%;top:10px;width:0}.mm_timeline>li:nth-child(2n).active .mm_label:after,.mm_timeline>li:nth-child(odd).active .mm_label:after{border-right-color:#060558}.mm_timeline>li:nth-child(odd) .mm_label:after{border-right-color:#6cbfee}.mm_timeline>li .mm_icon{-webkit-font-smoothing:antialiased;background:#46a4da;border-radius:50%;box-shadow:0 0 0 8px #afdcf8;color:#fff;font-size:1.4em;font-style:normal;font-variant:normal;font-weight:400;height:40px;left:20%;line-height:40px;margin:0 0 0 -25px;position:absolute;text-align:center;text-transform:none;width:40px}.mm_timeline>li.active .mm_icon{background:#060558}.mm_icon>.material-icons{line-height:3rem}@media screen and (max-width:65.375em){.mm_timeline>li .mm_time span:last-child{font-size:1.5em}}@media screen and (max-width:47.2em){.mm_timeline:before{display:none}.mm_timeline>li .mm_time{padding:0 0 20px;position:relative;width:100%}.mm_timeline>li .mm_time span{text-align:left}.mm_timeline>li .mm_label{font-size:95%;font-weight:400;margin:0 0 30px;padding:1em}.mm_timeline>li .mm_label:after{border-bottom-color:#3594cb;border-right-color:transparent;left:20px;right:auto;top:-20px}.mm_timeline>li:nth-child(odd) .mm_label:after{border-bottom-color:#6cbfee;border-right-color:transparent}.mm_timeline>li .mm_icon{float:right;left:auto;margin:-55px 5px 0 0;position:relative}}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["input.css","codeblock.css","kanban.css","map-editor.css","switch.css","timeline.css"],"names":[],"mappings":"AAAA,OACE,oBACF,CAEA,wCAGE,4BAA6B,CAE7B,WAAgC,CAAhC,+BAAgC,CAChC,eAAgB,CAOhB,eAAgB,CAEhB,sBAAuB,CALvB,cAAe,CAFf,WAAY,CAPZ,cAAmB,CAMnB,YAAa,CAIb,SAAU,CAOV,oCAAwC,CATxC,UAWF,CAEA,2BACE,WACF,CC5BA,WACE,sBACF,CACA,eACE,kBACF,CACA,iBACE,oBACF,CCRA,2BACE,WAAY,CACZ,WAAY,CAEZ,mBACF,CAGA,kCACE,eAAgB,CAEhB,uBACF,CAEA,uBAQE,yEAIC,CACD,mHACF,CAEA,uBAQE,yEAIC,CACD,mHACF,CAEA,cACE,mBACF,CACA,uBACE,mBACF,CACA,2BACE,eAAgB,CAChB,gBACF,CCvDA,6CACE,gBAAiB,CACjB,SAAU,CACV,uBACF,CAEA,2FAcE,kCAAmC,CANnC,8CAA8B,CAA9B,kBAA8B,CAA9B,gBAA8B,CAJ9B,WAAY,CAFZ,SAAU,CADV,QAAS,CAYT,uBAAwB,CAMxB,0BAA2B,CAhB3B,UAiBF,CC1BA,2BAGE,UAEF,CACA,UACE,kBACF,CACA,UACE,kBACF,CACA,eAEE,SAAU,CADV,eAEF,CACA,cACE,eACF,CClBA,aAGE,eAAgB,CAFhB,eAAkB,CAClB,SAAU,CAEV,iBACF,CAGA,oBAME,kBAAmB,CAFnB,QAAS,CAHT,UAAW,CAMX,QAAS,CACT,iBAAkB,CANlB,iBAAkB,CAClB,KAAM,CAEN,UAIF,CAGA,yBACE,aAAc,CAEd,mBAAoB,CACpB,iBAAkB,CAFlB,SAGF,CAEA,8BACE,aAAc,CACd,gBACF,CAEA,0CAEE,aAAc,CADd,cAEF,CAEA,yCAEE,aAAc,CADd,eAEF,CAEA,wDACE,aACF,CAGA,6HAEE,aACF,CAGA,0BAEE,kBAAmB,CAOnB,iBAAkB,CANlB,UAAW,CAEX,eAAgB,CAChB,eAAgB,CAChB,eAAgB,CANhB,mBAAoB,CAGpB,gBAAkB,CAIlB,iBAEF,CAGA,iCACE,wBACF,CAEA,yCACE,kBACF,CAEA,6BAGE,0CAAiD,CAFjD,YAAe,CACf,gBAEF,CAGA,gCASE,6BAAkB,CAAlB,0BAAkB,CANlB,WAAY,CACZ,QAAS,CAGT,mBAAoB,CADpB,iBAAkB,CALlB,UAAW,CASX,QAAS,CALT,OAMF,CAGA,2GAEE,0BACF,CAEA,+CACE,0BACF,CAGA,yBASE,kCAAmC,CAGnC,kBAAmB,CACnB,iBAAkB,CAClB,4BAA6B,CAH7B,UAAW,CAJX,eAAgB,CAJhB,iBAAkB,CAElB,mBAAoB,CADpB,eAAmB,CAFnB,WAAY,CAcZ,QAAS,CART,gBAAiB,CAUjB,kBAAmB,CARnB,iBAAkB,CAKlB,iBAAkB,CATlB,mBAAoB,CALpB,UAkBF,CAGA,gCACC,kBACD,CAEA,yBACE,gBACF,CAGA,uCACE,yCACE,eACF,CACF,CAEA,qCACE,oBACE,YACF,CAEA,yBAGE,gBAAmB,CADnB,iBAAkB,CADlB,UAGF,CAEA,8BACE,eACF,CAEA,0BAIE,aAAc,CADd,eAAgB,CAFhB,eAAkB,CAClB,WAGF,CAEA,gCAIE,2BAA4B,CAD5B,8BAA+B,CAD/B,SAAU,CADV,UAAW,CAIX,SACF,CAEA,+CAEE,2BAA4B,CAD5B,8BAEF,CAEA,yBAEE,WAAY,CACZ,SAAU,CACV,oBAAuB,CAHvB,iBAIF,CACF","file":"index.css","sourcesContent":[".twist {\n transform: scaleY(-1);\n}\n\ninput[type='color']:not(.browser-default) {\n margin: 0px 0 8px 0;\n /** Copied from input[type=number] */\n background-color: transparent;\n border: none;\n border-bottom: 1px solid #9e9e9e;\n border-radius: 0;\n outline: none;\n height: 3rem;\n width: 100%;\n font-size: 16px;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n -webkit-transition: border 0.3s, -webkit-box-shadow 0.3s;\n transition: border 0.3s, -webkit-box-shadow 0.3s;\n transition: box-shadow 0.3s, border 0.3s;\n transition: box-shadow 0.3s, border 0.3s, -webkit-box-shadow 0.3s;\n}\n\n.input-field.options > label {\n top: -2.5rem;\n}",".codeblock {\n margin: 1.5rem 0 2.5rem 0;\n}\n.codeblock > div {\n margin-bottom: 1rem;\n}\n.codeblock > label {\n display: inline-block;\n}\n",".kanban .kanban__draggable {\n cursor: move; /* fallback if grab cursor is unsupported */\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n\n/* (Optional) Apply a \"closed-hand\" cursor during drag operation. */\n.kanban .kanban__draggable:active {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}\n\n.kanban .kanban__below {\n /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#1e5799+100,1e5799+100,1e5799+100&0+0,0.7+100 */\n background: -moz-linear-gradient(top, rgba(30, 87, 153, 0) 0%, rgba(30, 87, 153, 0.7) 100%); /* FF3.6-15 */\n background: -webkit-linear-gradient(\n top,\n rgba(30, 87, 153, 0) 0%,\n rgba(30, 87, 153, 0.7) 100%\n ); /* Chrome10-25,Safari5.1-6 */\n background: linear-gradient(\n to bottom,\n rgba(30, 87, 153, 0) 0%,\n rgba(30, 87, 153, 0.7) 100%\n ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#001e5799', endColorstr='#b31e5799',GradientType=0 ); /* IE6-9 */\n}\n\n.kanban .kanban__above {\n /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#1e5799+0,1e5799+0,1e5799+0&0.7+0,0+100 */\n background: -moz-linear-gradient(top, rgba(30, 87, 153, 0.7) 0%, rgba(30, 87, 153, 0) 100%); /* FF3.6-15 */\n background: -webkit-linear-gradient(\n top,\n rgba(30, 87, 153, 0.7) 0%,\n rgba(30, 87, 153, 0) 100%\n ); /* Chrome10-25,Safari5.1-6 */\n background: linear-gradient(\n to bottom,\n rgba(30, 87, 153, 0.7) 0%,\n rgba(30, 87, 153, 0) 100%\n ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b31e5799', endColorstr='#001e5799',GradientType=0 ); /* IE6-9 */\n}\n\n.kanban__item {\n padding-bottom: 12px;\n}\n.kanban__item.disabled {\n padding-bottom: 24px;\n}\n.kanban__item > .card-action {\n margin-bottom: 0;\n text-align: right;\n}",".map-editor .input-field .prefix ~ .collection {\n margin-left: 3rem;\n width: 92%;\n width: calc(100% - 3rem);\n}\n/* For truthy values, the checkbox is not visible when the item is selected, so make it white */\n.map-editor .active .checkbox-in-collection label > input[type='checkbox']:checked + span:before {\n top: -4px;\n left: -3px;\n width: 12px;\n height: 22px;\n border-top: 2px solid transparent;\n border-left: 2px solid transparent;\n border-right: 2px solid white; /* You need to change the colour here */\n border-bottom: 2px solid white; /* And here */\n -webkit-transform: rotate(40deg);\n -moz-transform: rotate(40deg);\n -ms-transform: rotate(40deg);\n -o-transform: rotate(40deg);\n transform: rotate(40deg);\n -webkit-backface-visibility: hidden;\n -webkit-transform-origin: 100% 100%;\n -moz-transform-origin: 100% 100%;\n -ms-transform-origin: 100% 100%;\n -o-transform-origin: 100% 100%;\n transform-origin: 100% 100%;\n}\n",".clear,\n.clear-10,\n.clear-15 {\n clear: both;\n /* overflow: hidden; Précaution pour IE 7 */\n}\n.clear-10 {\n margin-bottom: 10px;\n}\n.clear-15 {\n margin-bottom: 15px;\n}\nspan.mandatory {\n margin-left: 5px;\n color: red;\n}\nlabel+.switch {\n margin-top: 1rem;\n}\n",".mm_timeline {\n margin: 30px 0 0 0;\n padding: 0;\n list-style: none;\n position: relative;\n}\n\n/* The line */\n.mm_timeline:before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n width: 10px;\n background: #afdcf8;\n left: 20%;\n margin-left: -10px;\n}\n\n/* The date/time */\n.mm_timeline > li .mm_time {\n display: block;\n width: 25%;\n padding-right: 100px;\n position: absolute;\n}\n\n.mm_timeline > li .mm_time span {\n display: block;\n text-align: right;\n}\n\n.mm_timeline > li .mm_time span:first-child {\n font-size: 0.9em;\n color: #bdd0db;\n}\n\n.mm_timeline > li .mm_time span:last-child {\n font-size: 1.4em;\n color: #3594cb;\n}\n\n.mm_timeline > li:nth-child(odd) .mm_time span:last-child {\n color: #6cbfee;\n}\n\n/* Active time */\n.mm_timeline > li.active:nth-child(even) .mm_time span:last-child,\n.mm_timeline > li.active:nth-child(odd) .mm_time span:last-child {\n color: rgb(6, 5, 88);\n}\n\n/* Right content */\n.mm_timeline > li .mm_label {\n margin: 0 0 15px 28%;\n background: #3594cb;\n color: #fff;\n padding: 0.6em 1em;\n font-size: 1.2em;\n font-weight: 300;\n line-height: 1.4;\n position: relative;\n border-radius: 5px;\n}\n\n/* Active label */\n.mm_timeline > li.active .mm_label {\n border: 4px solid rgb(6, 5, 88);\n}\n\n.mm_timeline > li:nth-child(odd) .mm_label {\n background: #6cbfee;\n}\n\n.mm_timeline > li .mm_label h5 {\n margin-top: 0px;\n padding: 0 0 10px 0;\n border-bottom: 1px solid rgba(255, 255, 255, 0.4);\n}\n\n/* The triangle */\n.mm_timeline > li .mm_label:after {\n right: 100%;\n border: solid transparent;\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n border-right-color: #3594cb;\n border-width: 10px;\n top: 10px;\n}\n\n/* Active triangle */\n.mm_timeline > li:nth-child(even).active .mm_label:after,\n.mm_timeline > li:nth-child(odd).active .mm_label:after {\n border-right-color: rgb(6, 5, 88);\n}\n\n.mm_timeline > li:nth-child(odd) .mm_label:after {\n border-right-color: #6cbfee;\n}\n\n/* The icons */\n.mm_timeline > li .mm_icon {\n width: 40px;\n height: 40px;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n font-size: 1.4em;\n line-height: 40px;\n -webkit-font-smoothing: antialiased;\n position: absolute;\n color: #fff;\n background: #46a4da;\n border-radius: 50%;\n box-shadow: 0 0 0 8px #afdcf8;\n text-align: center;\n left: 20%;\n /* top: 0; */\n margin: 0 0 0 -25px;\n}\n\n/* Active icon */\n.mm_timeline > li.active .mm_icon {\n\tbackground: rgb(6, 5, 88);\n}\n\n.mm_icon > .material-icons {\n line-height: 3rem;\n}\n\n/* Example Media Queries */\n@media screen and (max-width: 65.375em) {\n .mm_timeline > li .mm_time span:last-child {\n font-size: 1.5em;\n }\n}\n\n@media screen and (max-width: 47.2em) {\n .mm_timeline:before {\n display: none;\n }\n\n .mm_timeline > li .mm_time {\n width: 100%;\n position: relative;\n padding: 0 0 20px 0;\n }\n\n .mm_timeline > li .mm_time span {\n text-align: left;\n }\n\n .mm_timeline > li .mm_label {\n margin: 0 0 30px 0;\n padding: 1em;\n font-weight: 400;\n font-size: 95%;\n }\n\n .mm_timeline > li .mm_label:after {\n right: auto;\n left: 20px;\n border-right-color: transparent;\n border-bottom-color: #3594cb;\n top: -20px;\n }\n\n .mm_timeline > li:nth-child(odd) .mm_label:after {\n border-right-color: transparent;\n border-bottom-color: #6cbfee;\n }\n\n .mm_timeline > li .mm_icon {\n position: relative;\n float: right;\n left: auto;\n margin: -55px 5px 0 0px;\n }\n}\n"]}
1
+ {"version":3,"sources":["input.css","codeblock.css","map-editor.css","switch.css","timeline.css"],"names":[],"mappings":"AAAA,OACE,oBACF,CAEA,wCAGE,4BAA6B,CAE7B,WAAgC,CAAhC,+BAAgC,CAChC,eAAgB,CAOhB,eAAgB,CAEhB,sBAAuB,CALvB,cAAe,CAFf,WAAY,CAPZ,cAAmB,CAMnB,YAAa,CAIb,SAAU,CAOV,oCAAwC,CATxC,UAWF,CAEA,2BACE,WACF,CC5BA,WACE,sBACF,CACA,eACE,kBACF,CACA,iBACE,oBACF,CCRA,6CACE,gBAAiB,CACjB,SAAU,CACV,uBACF,CAEA,2FAcE,kCAAmC,CANnC,8CAA8B,CAA9B,kBAA8B,CAA9B,gBAA8B,CAJ9B,WAAY,CAFZ,SAAU,CADV,QAAS,CAYT,uBAAwB,CAMxB,0BAA2B,CAhB3B,UAiBF,CC1BA,2BAGE,UAEF,CACA,UACE,kBACF,CACA,UACE,kBACF,CACA,eAEE,SAAU,CADV,eAEF,CACA,cACE,eACF,CClBA,aAGE,eAAgB,CAFhB,eAAkB,CAClB,SAAU,CAEV,iBACF,CAGA,oBAME,kBAAmB,CAFnB,QAAS,CAHT,UAAW,CAMX,QAAS,CACT,iBAAkB,CANlB,iBAAkB,CAClB,KAAM,CAEN,UAIF,CAGA,yBACE,aAAc,CAEd,mBAAoB,CACpB,iBAAkB,CAFlB,SAGF,CAEA,8BACE,aAAc,CACd,gBACF,CAEA,0CAEE,aAAc,CADd,cAEF,CAEA,yCAEE,aAAc,CADd,eAEF,CAEA,wDACE,aACF,CAGA,6HAEE,aACF,CAGA,0BAEE,kBAAmB,CAOnB,iBAAkB,CANlB,UAAW,CAEX,eAAgB,CAChB,eAAgB,CAChB,eAAgB,CANhB,mBAAoB,CAGpB,gBAAkB,CAIlB,iBAEF,CAGA,iCACE,wBACF,CAEA,yCACE,kBACF,CAEA,6BAGE,0CAAiD,CAFjD,YAAe,CACf,gBAEF,CAGA,gCASE,6BAAkB,CAAlB,0BAAkB,CANlB,WAAY,CACZ,QAAS,CAGT,mBAAoB,CADpB,iBAAkB,CALlB,UAAW,CASX,QAAS,CALT,OAMF,CAGA,2GAEE,0BACF,CAEA,+CACE,0BACF,CAGA,yBASE,kCAAmC,CAGnC,kBAAmB,CACnB,iBAAkB,CAClB,4BAA6B,CAH7B,UAAW,CAJX,eAAgB,CAJhB,iBAAkB,CAElB,mBAAoB,CADpB,eAAmB,CAFnB,WAAY,CAcZ,QAAS,CART,gBAAiB,CAUjB,kBAAmB,CARnB,iBAAkB,CAKlB,iBAAkB,CATlB,mBAAoB,CALpB,UAkBF,CAGA,gCACC,kBACD,CAEA,yBACE,gBACF,CAGA,uCACE,yCACE,eACF,CACF,CAEA,qCACE,oBACE,YACF,CAEA,yBAGE,gBAAmB,CADnB,iBAAkB,CADlB,UAGF,CAEA,8BACE,eACF,CAEA,0BAIE,aAAc,CADd,eAAgB,CAFhB,eAAkB,CAClB,WAGF,CAEA,gCAIE,2BAA4B,CAD5B,8BAA+B,CAD/B,SAAU,CADV,UAAW,CAIX,SACF,CAEA,+CAEE,2BAA4B,CAD5B,8BAEF,CAEA,yBAEE,WAAY,CACZ,SAAU,CACV,oBAAuB,CAHvB,iBAIF,CACF","file":"index.css","sourcesContent":[".twist {\n transform: scaleY(-1);\n}\n\ninput[type='color']:not(.browser-default) {\n margin: 0px 0 8px 0;\n /** Copied from input[type=number] */\n background-color: transparent;\n border: none;\n border-bottom: 1px solid #9e9e9e;\n border-radius: 0;\n outline: none;\n height: 3rem;\n width: 100%;\n font-size: 16px;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n -webkit-transition: border 0.3s, -webkit-box-shadow 0.3s;\n transition: border 0.3s, -webkit-box-shadow 0.3s;\n transition: box-shadow 0.3s, border 0.3s;\n transition: box-shadow 0.3s, border 0.3s, -webkit-box-shadow 0.3s;\n}\n\n.input-field.options > label {\n top: -2.5rem;\n}",".codeblock {\n margin: 1.5rem 0 2.5rem 0;\n}\n.codeblock > div {\n margin-bottom: 1rem;\n}\n.codeblock > label {\n display: inline-block;\n}\n",".map-editor .input-field .prefix ~ .collection {\n margin-left: 3rem;\n width: 92%;\n width: calc(100% - 3rem);\n}\n/* For truthy values, the checkbox is not visible when the item is selected, so make it white */\n.map-editor .active .checkbox-in-collection label > input[type='checkbox']:checked + span:before {\n top: -4px;\n left: -3px;\n width: 12px;\n height: 22px;\n border-top: 2px solid transparent;\n border-left: 2px solid transparent;\n border-right: 2px solid white; /* You need to change the colour here */\n border-bottom: 2px solid white; /* And here */\n -webkit-transform: rotate(40deg);\n -moz-transform: rotate(40deg);\n -ms-transform: rotate(40deg);\n -o-transform: rotate(40deg);\n transform: rotate(40deg);\n -webkit-backface-visibility: hidden;\n -webkit-transform-origin: 100% 100%;\n -moz-transform-origin: 100% 100%;\n -ms-transform-origin: 100% 100%;\n -o-transform-origin: 100% 100%;\n transform-origin: 100% 100%;\n}\n",".clear,\n.clear-10,\n.clear-15 {\n clear: both;\n /* overflow: hidden; Précaution pour IE 7 */\n}\n.clear-10 {\n margin-bottom: 10px;\n}\n.clear-15 {\n margin-bottom: 15px;\n}\nspan.mandatory {\n margin-left: 5px;\n color: red;\n}\nlabel+.switch {\n margin-top: 1rem;\n}\n",".mm_timeline {\n margin: 30px 0 0 0;\n padding: 0;\n list-style: none;\n position: relative;\n}\n\n/* The line */\n.mm_timeline:before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n width: 10px;\n background: #afdcf8;\n left: 20%;\n margin-left: -10px;\n}\n\n/* The date/time */\n.mm_timeline > li .mm_time {\n display: block;\n width: 25%;\n padding-right: 100px;\n position: absolute;\n}\n\n.mm_timeline > li .mm_time span {\n display: block;\n text-align: right;\n}\n\n.mm_timeline > li .mm_time span:first-child {\n font-size: 0.9em;\n color: #bdd0db;\n}\n\n.mm_timeline > li .mm_time span:last-child {\n font-size: 1.4em;\n color: #3594cb;\n}\n\n.mm_timeline > li:nth-child(odd) .mm_time span:last-child {\n color: #6cbfee;\n}\n\n/* Active time */\n.mm_timeline > li.active:nth-child(even) .mm_time span:last-child,\n.mm_timeline > li.active:nth-child(odd) .mm_time span:last-child {\n color: rgb(6, 5, 88);\n}\n\n/* Right content */\n.mm_timeline > li .mm_label {\n margin: 0 0 15px 28%;\n background: #3594cb;\n color: #fff;\n padding: 0.6em 1em;\n font-size: 1.2em;\n font-weight: 300;\n line-height: 1.4;\n position: relative;\n border-radius: 5px;\n}\n\n/* Active label */\n.mm_timeline > li.active .mm_label {\n border: 4px solid rgb(6, 5, 88);\n}\n\n.mm_timeline > li:nth-child(odd) .mm_label {\n background: #6cbfee;\n}\n\n.mm_timeline > li .mm_label h5 {\n margin-top: 0px;\n padding: 0 0 10px 0;\n border-bottom: 1px solid rgba(255, 255, 255, 0.4);\n}\n\n/* The triangle */\n.mm_timeline > li .mm_label:after {\n right: 100%;\n border: solid transparent;\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n border-right-color: #3594cb;\n border-width: 10px;\n top: 10px;\n}\n\n/* Active triangle */\n.mm_timeline > li:nth-child(even).active .mm_label:after,\n.mm_timeline > li:nth-child(odd).active .mm_label:after {\n border-right-color: rgb(6, 5, 88);\n}\n\n.mm_timeline > li:nth-child(odd) .mm_label:after {\n border-right-color: #6cbfee;\n}\n\n/* The icons */\n.mm_timeline > li .mm_icon {\n width: 40px;\n height: 40px;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n font-size: 1.4em;\n line-height: 40px;\n -webkit-font-smoothing: antialiased;\n position: absolute;\n color: #fff;\n background: #46a4da;\n border-radius: 50%;\n box-shadow: 0 0 0 8px #afdcf8;\n text-align: center;\n left: 20%;\n /* top: 0; */\n margin: 0 0 0 -25px;\n}\n\n/* Active icon */\n.mm_timeline > li.active .mm_icon {\n\tbackground: rgb(6, 5, 88);\n}\n\n.mm_icon > .material-icons {\n line-height: 3rem;\n}\n\n/* Example Media Queries */\n@media screen and (max-width: 65.375em) {\n .mm_timeline > li .mm_time span:last-child {\n font-size: 1.5em;\n }\n}\n\n@media screen and (max-width: 47.2em) {\n .mm_timeline:before {\n display: none;\n }\n\n .mm_timeline > li .mm_time {\n width: 100%;\n position: relative;\n padding: 0 0 20px 0;\n }\n\n .mm_timeline > li .mm_time span {\n text-align: left;\n }\n\n .mm_timeline > li .mm_label {\n margin: 0 0 30px 0;\n padding: 1em;\n font-weight: 400;\n font-size: 95%;\n }\n\n .mm_timeline > li .mm_label:after {\n right: auto;\n left: 20px;\n border-right-color: transparent;\n border-bottom-color: #3594cb;\n top: -20px;\n }\n\n .mm_timeline > li:nth-child(odd) .mm_label:after {\n border-right-color: transparent;\n border-bottom-color: #6cbfee;\n }\n\n .mm_timeline > li .mm_icon {\n position: relative;\n float: right;\n left: auto;\n margin: -55px 5px 0 0px;\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -7,11 +7,9 @@ export * from './collapsible';
7
7
  export * from './collection';
8
8
  export * from './dropdown';
9
9
  export * from './floating-action-button';
10
- export * from './layout-form-generator';
11
10
  export * from './icon';
12
11
  export * from './input-options';
13
12
  export * from './input';
14
- export * from './kanban';
15
13
  export * from './label';
16
14
  export * from './map-editor';
17
15
  export * from './material-box';
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import e from"mithril";import t from"materialize-css";var n=function(){return"idxxxxxxxx".replace(/[x]/g,function(){return(16*Math.random()|0).toString(16)})},i=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},a=function(){var e=arguments;return function(t){return[].slice.call(e).reduceRight(function(e,t){return t(e)},t)}},r=function(e){return function(t){return Array.prototype.map.call(t,e)}},o=function(e){return function(t){return Array.prototype.join.call(t,e)}},c=function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})},l=function(e){return e?a(o(""),r(function(t){return"["+c(t)+'="'+function(e){return void 0===e&&(e=""),e.toString().replace(/"/g,"&quot;")}(e[t])+'"]'}),Object.keys)(e):""},d=["min","max","minLength","maxLength","rows","cols","placeholder","autocomplete","pattern","readOnly","step"],s=function(e){return d.indexOf(e)>=0},u=function(e){return e.disabled?"[disabled]":""},f=function(e){return e.required||e.isMandatory?"[required][aria-required=true]":""},v=function(e){return function(e){var t,n=(t=e,function(e){return void 0!==t[e]});return Object.keys(e).filter(s).filter(n).reduce(function(t,n){var i=e[n];return t.push("["+n.toLowerCase()+"="+i+"]"),t},[]).join("")}(e)+function(e){return e.maxLength?"[data-length="+e.maxLength+"]":""}(e)+u(e)+f(e)+("boolean"==typeof(t=e.autofocus)&&t||t&&t()?"[autofocus]":"");var t},m=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},p=function(){var e=arguments;return function(t){return[].slice.call(e).reduce(function(e,t){return t(e)},t)}},h=function(e,t,n){return void 0===t&&(t=2),void 0===n&&(n="0"),(e+="").length>=t?e:new Array(t-e.length+1).join(n)+e},b=function(e,t,n){var i=e[t];e[t]=e[n],e[n]=i},g=function(e,t,n){var i=e[t];e.splice(t,1),e.splice(n,0,i)};function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y.apply(this,arguments)}function k(e,t){if(null==e)return{};var n,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)t.indexOf(n=r[i])>=0||(a[n]=e[n]);return a}var w,x=["label","id","isMandatory","isActive"],N={view:function(t){return e("span.mandatory",t.attrs,"*")}},I=function(){return{view:function(t){var n=t.attrs,i=n.label,a=n.id,r=n.isMandatory,o=n.isActive,c=k(n,x);return i?e("label"+(o?".active":"")+(a?"[for="+a+"]":""),c,[e.trust(i),r?e(N):void 0]):void 0}}},C=function(){return{view:function(t){var n=t.attrs,i=n.helperText,a=n.dataError,r=n.dataSuccess,o=a||r?l({dataError:a,dataSuccess:r}):"";return i||o?e("span.helper-text"+o,i?e.trust(i):""):void 0}}},T=function(){var t={id:n()};return{view:function(n){var i=n.attrs,a=i.id||t.id,r=v(i),o=i.label,c=i.helperText,l=i.initialValue,d=i.onchange,s=i.className,u=i.iconName,f=i.isMandatory;return e(".input-field"+(i.newRow?".clear":""),{className:void 0===s?"col s12":s,style:i.style},[u?e("i.material-icons.prefix",u):"",e("input.autocomplete[type=text][tabindex=0][id="+a+"]"+r,{oncreate:function(e){M.Autocomplete.init(e.dom,i)},onchange:d?function(e){e.target&&e.target.value&&d(e.target.value)}:void 0,value:l}),e(I,{label:o,id:a,isMandatory:f,isActive:l}),e(C,{helperText:c})])}}},A=["iconName"],V=function(){return{view:function(t){var n=t.attrs,i=n.iconName,a=k(n,A);return e("i.material-icons",a,i)}}},S=["modalId","tooltip","tooltipPostion","iconName","iconClass","label","attr"],_=function(t,n){return void 0===n&&(n=""),function(){var i=""+t+n;return{view:function(t){var n=t.attrs,a=n.modalId,r=n.tooltip,o=n.tooltipPostion,c=n.iconName,d=n.iconClass,s=n.label,u=n.attr,f=k(n,S);return e(i+(a?".modal-trigger[href=#"+a+"]":"")+(r?".tooltipped[data-position="+(o||"top")+"][data-tooltip="+r+"]":"")+l(u),f,c?e(V,{iconName:c,className:d||"left"}):void 0,s||void 0)}}}},D=_("a.waves-effect.waves-light.btn"),L=_("a.waves-effect.waves-light.btn-large"),E=_("a.waves-effect.waves-light.btn-small"),O=_("a.waves-effect.waves-teal.btn-flat"),R=_("button.btn-floating.btn-large.waves-effect.waves-light"),F=_("button.btn.waves-effect.waves-light","[type=submit]"),j=function(){return{view:function(t){var n=t.attrs;return e("a.carousel-item",{href:n.href},e("img[src="+n.src+"]"))}}},B=function(){return{view:function(t){var n=t.attrs,i=n.items;return i&&i.length>0?e(".carousel",{oncreate:function(e){M.Carousel.init(e.dom,n)}},i.map(function(t){return e(j,t)})):void 0}}},K=function(){return{oncreate:function(e){var t=e.attrs,n=e.dom,i=t.onchange,a=t.onChipAdd,r=t.onChipDelete,o=M.Chips.getInstance(n.children[0]),c=a?a.bind(o):void 0;t.onChipAdd=function(e,t){i&&i(this.chipsData),c&&c(e,t)};var l=r?r.bind(o):void 0;t.onChipDelete=function(e,t){i&&i(this.chipsData),l&&l(e,t)},M.Chips.init(n.children[0],t)},onupdate:function(e){var t=e.attrs.data;if(t&&0!==t.length){var n=M.Chips.getInstance(e.dom.children[0]);t.forEach(function(e){return n.addChip(e)})}},view:function(t){var n=t.attrs,i=n.isMandatory,a=void 0===i?n.required:i,r=n.className,o=n.label,c=n.helperText;return e(".input-field",{className:void 0===r?"col s12":r},[e(".chips.chips-autocomplete"+(n.placeholder?".chips-placeholder":"")+(n.data?".chips-initial":"")),o?e(I,{label:o,isMandatory:a,className:"active"}):void 0,c?e(C,{helperText:c}):void 0])}}},q=function(){return{view:function(t){var n=t.attrs,i=n.newRow,a=n.code,r=n.language||"lang-TypeScript",o=r.replace("lang-",""),c=a instanceof Array?a.join("\n"):a;return e("pre.codeblock"+(i?".clear":""),n,[e("div",e("label",o)),e("code."+r,c)])}}},U=function(){return{view:function(t){var n=t.attrs,i=n.header,a=n.body,r=n.iconName;return e(n.active?"li.active":"li",[i||r?e(".collapsible-header",[r?e("i.material-icons",r):void 0,i?"string"==typeof i?e("span",i):i:void 0]):void 0,a?e(".collapsible-body",a):void 0])}}},P=function(){return{oncreate:function(e){M.Collapsible.init(e.dom,e.attrs)},view:function(t){var n=t.attrs,i=n.items;return i&&i.length>0?e("ul.collapsible",{class:n.class||n.className,style:n.style,id:n.id},i.map(function(t){return e(U,t)})):void 0}}},z=["header","items","mode"],H=["title","active","href"],Y=["items","header"],J=["items","header","mode"];!function(e){e[e.BASIC=0]="BASIC",e[e.LINKS=1]="LINKS",e[e.AVATAR=2]="AVATAR"}(w||(w={}));var $=function(e){return e&&/https?:\/\//.test(e)},W=function(){return{view:function(t){var n=t.attrs,i=n.href,a=n.iconName,r=void 0===a?"send":a,o=n.onclick,c=n.style,l={href:i,style:void 0===c?{cursor:"pointer"}:c,className:"secondary-content",onclick:o?function(){return o(n)}:void 0};return $(i)||!i?e("a[target=_]",l,e(V,{iconName:r})):e(e.route.Link,l,e(V,{iconName:r}))}}},Z=function(e){return void 0===e&&(e=""),/\./.test(e)},G=function(){return{view:function(t){var n=t.attrs,i=n.item,a=i.title,r=i.content,o=void 0===r?"":r,c=i.active,l=i.iconName,d=i.avatar,s=i.className,u=i.onclick;return n.mode===w.AVATAR?e("li.collection-item.avatar"+(c?".active":""),{onclick:u?function(){return u(i)}:void 0},[Z(d)?e("img.circle",{src:d}):e("i.material-icons.circle",{className:s},d),e("span.title",a),e("p",e.trust(o)),e(W,i)]):e("li.collection-item"+(c?".active":""),l?e("div",[a,e(W,i)]):a)}}},Q=function(){return{view:function(t){var n=t.attrs,i=n.header,a=n.items,r=n.mode,o=void 0===r?w.BASIC:r,c=k(n,z),l=a.map(function(t){return e(G,{key:t.id,item:t,mode:o})});return i?e("ul.collection.with-header",c,[e("li.collection-header",e("h4",i)),l]):e("ul.collection",c,l)}}},X=function(){return{view:function(t){var n=t.attrs.item,i=n.title,a=n.active,r=n.href,o=y({},k(n,H),{className:"collection-item "+(a?"active":""),href:r});return $(r)||!r?e("a[target=_]",o,i):e(e.route.Link,o,i)}}},ee=function(){return{view:function(t){var n=t.attrs,i=n.items,a=n.header,r=k(n,Y);return a?e(".collection.with-header",r,[e(".collection-header",e("h4",a)),i.map(function(t){return e(X,{key:t.id,item:t})})]):e(".collection",r,i.map(function(t){return e(X,{key:t.id,item:t})}))}}},te=function(){return{view:function(t){var n=t.attrs,i=n.items,a=n.header,r=n.mode,o=void 0===r?w.BASIC:r,c=k(n,J);return a||i&&i.length>0?o===w.LINKS?e(ee,y({header:a,items:i},c)):e(Q,y({header:a,items:i,mode:o},c)):void 0}}},ne=["key","label","onchange","disabled","items","iconName","helperText","style","className"],ie=function(){var t={};return{oninit:function(e){var i=e.attrs,a=i.id,r=void 0===a?n():a,o=i.initialValue,c=i.checkedId;t.id=r,t.initialValue=o||c},view:function(n){var i=n.attrs,a=i.key,r=i.label,o=i.onchange,c=i.disabled,l=void 0!==c&&c,d=i.items,s=i.iconName,u=i.helperText,f=i.style,v=i.className,m=void 0===v?"col s12":v,p=k(i,ne),h=t.id,b=t.initialValue,g=b?d.filter(function(e){return e.id?e.id===b:e.label===b}).shift():void 0,y=g?g.label:r||"Select";return e(".input-field",{className:m,key:a,style:f},[s?e("i.material-icons.prefix",s):void 0,e(C,{helperText:u}),e("a.dropdown-trigger.btn.truncate[href=#][data-target="+h+"]"+(l?"[disabled]":""),{className:"col s12",style:f||(s?"margin: 0.2em 0 0 3em;":void 0),oncreate:function(e){M.Dropdown.init(e.dom,p)}},y),e("ul.dropdown-content[id="+h+"]",d.map(function(n){return e("li"+(n.divider?".divider[tabindex=-1]":""),n.divider?void 0:e("a",{onclick:o?function(){t.initialValue=n.id||n.label,o(t.initialValue)}:void 0},[n.iconName?e("i.material-icons",n.iconName):void 0,n.label]))}))])}}},ae=["className","iconName","iconClass","position","style","buttons"],re=function(){return{view:function(t){var n=t.attrs,i=n.className,a=n.iconName,r=n.iconClass,o=void 0===r?"large":r,c=n.position,l=n.style,d=void 0===l?"left"===c||"inline-left"===c?"position: absolute; display: inline-block; left: 24px;":"right"===c||"inline-right"===c?"position: absolute; display: inline-block; right: 24px;":void 0:l,s=n.buttons,u=k(n,ae),f=e(".fixed-action-btn",{style:d,oncreate:function(e){return M.FloatingActionButton.init(e.dom,u)}},[e("a.btn-floating.btn-large",{className:i},e("i.material-icons",{classNames:o},a)),s?e("ul",s.map(function(t){return e("li",e("a.btn-floating",{className:t.className,onclick:function(e){return t.onClick&&t.onClick(e)}},e("i.material-icons",{className:t.iconClass},t.iconName)))})):void 0]);return"inline-right"===c||"inline-left"===c?e("div",{style:"position: relative; height: 70px;"},f):f}}},oe=["className","helperText","iconName","id","initialValue","isMandatory","label","onchange","style"],ce=["className","dataError","dataSuccess","helperText","iconName","id","initialValue","isMandatory","label","maxLength","newRow","onchange","onkeydown","onkeypress","onkeyup","style","validate"],le=function(){var i={id:n()};return{view:function(n){var a=n.attrs,r=a.className,o=void 0===r?"col s12":r,c=a.helperText,l=a.iconName,d=a.id,s=void 0===d?i.id:d,u=a.initialValue,f=a.isMandatory,m=a.label,p=a.onchange,h=a.style,b=k(a,oe),g=v(b);return e(".input-field",{className:o,style:h},[l?e("i.material-icons.prefix",l):"",e("textarea.materialize-textarea[tabindex=0][id="+s+"]"+g,{oncreate:function(e){var n=e.dom;t.textareaAutoResize(n),a.maxLength&&t.CharacterCounter.init(n)},onchange:p?function(e){var t=e.target;p(t&&"string"==typeof t.value?t.value:"")}:void 0,value:u}),e(I,{label:m,id:s,isMandatory:f,isActive:u||a.placeholder}),e(C,{helperText:c})])}}},de=function(i,a){return void 0===a&&(a=""),function(){var r={id:n()},o=function(e){var t=e.value;return!t||"number"!==i&&"range"!==i?t:+t},c=function(e,t){e.setCustomValidity("boolean"==typeof t?t?"":"Custom validation failed":t)};return{view:function(n){var l=n.attrs,d=l.className,s=void 0===d?"col s12":d,u=l.dataError,f=l.dataSuccess,m=l.helperText,p=l.iconName,h=l.id,b=void 0===h?r.id:h,g=l.initialValue,y=l.isMandatory,w=l.label,x=l.maxLength,N=l.newRow,M=l.onchange,T=l.onkeydown,A=l.onkeypress,V=l.onkeyup,S=l.style,_=l.validate,D=k(l,ce),L=v(D);return e(".input-field"+(N?".clear":"")+a,{className:s,style:S},[p?e("i.material-icons.prefix",p):void 0,e("input.validate[type="+i+"][tabindex=0][id="+b+"]"+L,{oncreate:function(e){var n,a=e.dom;(n=l.autofocus)&&("boolean"==typeof n?n:n())&&a.focus(),x&&t.CharacterCounter.init(a),"range"===i&&t.Range.init(a)},onkeyup:V?function(e){V(e,o(e.target))}:void 0,onkeydown:T?function(e){T(e,o(e.target))}:void 0,onkeypress:A?function(e){A(e,o(e.target))}:void 0,onupdate:_?function(e){var t=e.dom;c(t,_(o(t),t))}:void 0,onchange:function(e){var t=e.target;if(t){var n=o(t);M&&M(n),_&&c(t,_(n,t))}},value:g}),e(I,{label:w,id:b,isMandatory:y,isActive:!(void 0===g&&!l.placeholder&&"number"!==i&&"color"!==i&&"range"!==i)}),e(C,{helperText:m,dataError:u,dataSuccess:f})])}}}},se=de("text"),ue=de("password"),fe=de("number"),ve=de("url"),me=de("color"),pe=de("range",".range-field"),he=de("email"),be=function(){var t,n=!1;return{view:function(i){var a=i.attrs,r=a.multiple,o=a.disabled,c=a.initialValue,l=a.placeholder,d=a.onchange,s=a.className,u=void 0===s?"col s12":s,f=a.accept,v=a.label,m=void 0===v?"File":v,p=f?f instanceof Array?f.join(", "):f:void 0,h=p?"[accept="+p+"]":"",b=r?"[multiple]":"",g=o?"[disabled]":"",y=l?"[placeholder="+l+"]":"";return e(".file-field.input-field",{className:a.class||u},[e(".btn",[e("span",m),e("input[type=file]"+b+g+h,{onchange:d?function(e){var t=e.target;t&&t.files&&d&&(n=!0,d(t.files))}:void 0})]),e(".file-path-wrapper",e("input.file-path.validate"+y+"[type=text]",{oncreate:function(e){t=e.dom,c&&(t.value=c)}})),(n||c)&&e("a.waves-effect.waves-teal.btn-flat",{style:"float: right;position: relative;top: -3rem; padding: 0",onclick:function(){n=!1,t.value="",d&&d({})}},e("i.material-icons","clear"))])}}},ge=["label","helperText","initialValue","newRow","className","iconName","isMandatory","onchange","disabled"],ye=["label","helperText","initialValue","newRow","className","iconName","isMandatory","onchange","disabled"],ke=function(){var t={id:n()};return{view:function(n){var i=n.attrs,a=i.label,r=i.helperText,o=i.initialValue,c=i.newRow,l=i.className,d=void 0===l?"col s12":l,s=i.iconName,u=i.isMandatory,f=i.onchange,m=i.disabled,p=k(i,ge),h=t.id,b=v(p),g=f?function(){return t.dp&&f(t.dp.date)}:void 0;return e(".input-field"+(c?".clear":""),{className:d,onremove:function(){return t.dp&&t.dp.destroy()}},[s?e("i.material-icons.prefix",s):"",e("input.datepicker[type=text][tabindex=0][id="+h+"]"+b+(m?"[disabled]":""),{oncreate:function(e){t.dp=M.Datepicker.init(e.dom,y({format:"yyyy/mm/dd",showClearBtn:!0,setDefaultDate:!0,defaultDate:o?new Date(o):new Date},p,{onClose:g}))}}),e(I,{label:a,id:h,isMandatory:u,isActive:!!o}),e(C,{helperText:r})])}}},we=function(){var t={id:n()};return{view:function(n){var i=n.attrs,a=i.label,r=i.helperText,o=i.initialValue,c=i.newRow,l=i.className,d=void 0===l?"col s12":l,s=i.iconName,u=i.isMandatory,f=i.onchange,m=i.disabled,p=k(i,ye),h=t.id,b=v(p),g=c?".clear":"",w=new Date,x=f?function(){return t.tp&&f(t.tp.time||o||w.getHours()+":"+w.getMinutes())}:void 0;return e(".input-field.timepicker"+g,{className:d,onremove:function(){return t.tp&&t.tp.destroy()}},[s?e("i.material-icons.prefix",s):"",e("input[type=text][tabindex=0][id="+h+"]"+b+(m?"[disabled]":""),{value:o,oncreate:function(e){t.tp=M.Timepicker.init(e.dom,y({twelveHour:!1,showClearBtn:!0,defaultTime:o},p,{onCloseEnd:x}))}}),e(I,{label:a,id:h,isMandatory:u,isActive:o}),e(C,{helperText:r})])}}},xe=function(){return{view:function(t){var n=t.attrs,i=n.className,a=n.onchange,r=n.label;return e("div",{className:void 0===i?"col s12":i},e("label",[e("input[type=checkbox][tabindex=0]"+(n.checked?"[checked]":"")+(n.disabled?"[disabled]":""),{onclick:a?function(e){e.target&&void 0!==e.target.checked&&a(e.target.checked)}:void 0}),r?"string"==typeof r?e("span",r):r:void 0]))}}},Ne=function(){var t={},n=function(e){return t.checkedIds.indexOf(e)>=0};return{oninit:function(e){var n=e.attrs,i=n.checkedId,a=i||n.initialValue;t.checkedId=i,t.checkedIds=a?a instanceof Array?[].concat(a):[a]:[]},view:function(i){var a=i.attrs,r=a.label,o=a.id,c=a.options,l=a.checkedId,d=a.description,s=a.className,u=void 0===s?"col s12":s,f=a.disabled,v=a.checkboxClass,m=a.newRow,p=a.isMandatory,h=a.onchange;l&&t.checkedId!==l&&(t.checkedId=l,t.checkedIds=l instanceof Array?l:[l]);var b=h?function(e,n){var i=t.checkedIds.filter(function(t){return t!==e});n&&i.push(e),t.checkedIds=i,h(i)}:void 0;return e("div"+(m?".clear":""),{className:u},[e("div",{className:"input-field options"},e(I,{id:o,label:r,isMandatory:p})),e(C,{helperText:d})].concat(c.map(function(t){return e(xe,{disabled:f||t.disabled,label:t.label,onchange:b?function(e){return b(t.id,e)}:void 0,className:v,checked:n(t.id)})})))}}},Ie=function(){var t={},n=function(e){return e.map(function(e){return e.id}).join("")},i=function(e,t,n){return void 0===n&&(n=!1),n||(t instanceof Array&&(e||"number"==typeof e)?t.indexOf(e)>=0:t===e)};return{oninit:function(e){var i=e.attrs,a=i.checkedId,r=i.initialValue;t.ids=n(i.options);var o=a||r;t.checkedId=a,t.initialValue=o?o instanceof Array?[].concat(o.filter(function(e){return null!==e})):[o]:[]},view:function(a){var r=a.attrs,o=r.id,c=r.newRow,l=r.className,d=void 0===l?"col s12":l,s=r.checkedId,u=r.key,f=r.options,v=r.multiple,p=r.label,h=r.helperText,b=r.placeholder,g=r.isMandatory,y=r.iconName,k=r.disabled,w=r.classes,x=r.dropdownOptions,N=r.onchange;t.checkedId!==s&&(t.initialValue=s?s instanceof Array?s:[s]:void 0);var T=t.initialValue,A=N?v?function(){var e=t.instance&&t.instance.getSelectedValues(),n=e?e.length>0&&m(e[0])?e.map(function(e){return+e}):e.filter(function(e){return null!==e||void 0!==e}):void 0;t.initialValue=n||[],N(t.initialValue)}:function(e){if(e&&e.currentTarget){var n=e.currentTarget,i=m(n.value)?+n.value:n.value;t.initialValue=void 0!==typeof i?[i]:[]}t.initialValue&&N(t.initialValue)}:void 0,V=c?".clear":"",S=k?"[disabled]":"",_=v?"[multiple]":"",D=0===f.filter(function(e){return i(e.id,T)}).length;return e(".input-field.select-space"+V,{className:d,key:u},[y&&e("i.material-icons.prefix",y),e("select[id="+o+"]"+S+_,{oncreate:function(e){t.instance=M.FormSelect.init(e.dom,{classes:w,dropdownOptions:x})},onupdate:function(e){var i=e.dom,a=n(f),r=s&&t.checkedId!==s.toString();t.ids!==a&&(t.ids=a,r=!0),t.checkedId!==s&&(t.checkedId=s,r=!0),r&&(t.instance=M.FormSelect.init(i,{classes:w,dropdownOptions:x}))},onchange:A},b?e("option[disabled]"+(D?"[selected]":""),b):"",f.map(function(t,n){return e("option[value="+t.id+"]"+(t.title?"[title="+t.title+"]":"")+(t.disabled?"[disabled]":"")+(i(t.id,T,0===n&&D&&!b)?"[selected]":""),t.label.replace("&amp;","&"))})),e(I,{label:p,isMandatory:g}),e(C,{helperText:h})])}}},Ce=function(){var t={groupId:n()};return{oninit:function(e){var n=e.attrs,i=n.checkedId,a=n.initialValue;t.oldCheckedId=i,t.checkedId=i||a},view:function(n){var i=n.attrs,a=i.id,r=i.checkedId,o=i.newRow,c=i.className,l=void 0===c?"col s12":c,d=i.label,s=void 0===d?"":d,u=i.disabled,f=i.description,v=i.options,m=i.isMandatory,p=i.checkboxClass,h=i.onchange;t.oldCheckedId!==r&&(t.oldCheckedId=t.checkedId=r);var b=t.groupId,g=t.checkedId,k=function(e){t.checkedId=e,h&&h(e)};return e("div"+(a?"[id="+a+"]":"")+(o?".clear":""),{className:l},[e("div",{className:"input-field options"},e(I,{id:a,label:s,isMandatory:m})),f?e("p.helper-text",e.trust(f)):""].concat(v.map(function(t){return e(Me,y({},t,{onchange:k,groupId:b,disabled:u,className:p,checked:t.id===g}))})))}}},Me=function(){return{view:function(t){var n=t.attrs,i=n.id,a=n.label,r=n.onchange,o=n.className;return e("div",{className:void 0===o?"col s12":o},e("label",[e("input[type=radio][tabindex=0][name="+n.groupId+"]"+(n.checked?"[checked=checked]":"")+(n.disabled?"[disabled]":""),{onclick:r?function(){return r(i)}:void 0}),e("span",e.trust(a))]))}}},Te=["component","required","options","autogenerate"],Ae=function(t,a,r){var o=t.component,c=t.required,l=t.options,d=t.autogenerate,s=k(t,Te);void 0===r&&(r={});var u=r.containerId,f=r.autofocus,v=r.disabled,m=void 0!==v&&v,p=r.onchange,h=r.multiline,b=r.key;d&&p&&p("id"===d?n():i(),!1);var g=c?function(e){return e instanceof Array?e&&e.length>0:void 0!==typeof e}:void 0;switch(o){case"text":return e(h?le:se,y({},s,{key:b,isMandatory:c,validate:g,autofocus:f,disabled:m,onchange:p,initialValue:a}));case"number":return e(fe,y({},s,{key:b,isMandatory:c,validate:g,autofocus:f,disabled:m,onchange:p,initialValue:a}));case"url":return e(ve,y({},s,{key:b,isMandatory:c,validate:g,autofocus:f,disabled:m,onchange:p,initialValue:a}));case"email":return e(he,y({},s,{key:b,isMandatory:c,validate:g,autofocus:f,disabled:m,onchange:p,initialValue:a}));case"checkbox":return e(xe,y({},s,{validate:g,disabled:m,onchange:p,checked:a}));case"select":return e(Ie,y({},s,{key:b,options:l||[{id:"none",label:"Unspecified"}],disabled:m,isMandatory:c,validate:g,onchange:function(e){return e&&p&&p(e)},checkedId:a}));case"options":return e(Ne,y({},s,{key:b,options:l||[{id:"none",label:"Unspecified"}],disabled:m,isMandatory:c,validate:g,onchange:function(e){return p&&p(e)},checkedId:a}));case"radios":return e(Ce,y({},s,{key:b,options:l||[{id:"none",label:"Unspecified"}],disabled:m,isMandatory:c,validate:g,onchange:function(e){return e&&p&&p(e)},checkedId:a}));case"date":var w=a||new Date;return!a&&p&&p(w),e(ke,y({},s,{key:b,isMandatory:c,autofocus:f,disabled:m,onchange:p,initialValue:w,container:u?document.getElementById(u):document.body}));case"time":var x=a||"00:00";return!a&&p&&p(x),e(we,y({},s,{key:b,isMandatory:c,autofocus:f,disabled:m,onchange:p,initialValue:x,container:u||document.body.id}));default:return}},Ve=function(){var t={};return{view:function(n){var i=n.attrs,a=i.el,r=void 0===a?".row":a,o=i.model,c=i.item,l=i.containerId,d=i.disabled,s=void 0!==d&&d,u=i.editableIds,f=void 0===u?[]:u,v=i.onchange;return t.item=c,t.model=o,v&&v(!1),e(r,{style:"margin-bottom: -15px;",key:c.id},o.map(function(e,n){return Ae(e,c[e.id],{containerId:l,autofocus:0===n,disabled:s&&f.indexOf(e.id)<0,onchange:s&&f.indexOf(e.id)<0?void 0:function(n,i){void 0===i&&(i=!0),(i||void 0===t.item[e.id])&&(t.item[e.id]=n,v&&v(function(){var e=t.item;return t.model.filter(function(e){return e.required}).reduce(function(t,n){return t&&!(void 0===e[n.id]||e[n.id]instanceof Array&&0===e[n.id].length||"string"==typeof e[n.id]&&0===e[n.id].length)},!0)}()))}})}))}}},Se=function(){return{oncreate:function(e){var t=e.attrs,n=t.onCreate,i=M.Modal.init(e.dom,t.options);n&&n(i)},view:function(t){var n=t.attrs,i=n.description,a=n.buttons,r=n.richContent;return e(".modal"+(n.fixedFooter?".modal-fixed-footer":"")+(n.bottomSheet?".bottom-sheet":"")+"[id="+n.id+"]",[e(".modal-content",[e("h4",n.title),r&&"string"==typeof i?e.trust(i||""):"string"==typeof i?e("p",i):i]),a?e(".modal-footer",a.map(function(t){return e(O,y({},t,{className:"modal-close"}))})):void 0])}}},_e=function(){var t={id:n()},a=function(){return t.onchange&&t.onchange(t.items)},r=function(e,t){var n=e.getBoundingClientRect();return t.clientY-n.top<n.height/2?"above":"below"},o=function e(t){var n=t.getAttribute("data-kanban-index");return n?+n:t.parentElement?e(t.parentElement):-1},c=function e(t){return!!/kanban__item/.test(t.className)||!!t.parentElement&&e(t.parentElement)},l=function e(t){return/kanban__item/.test(t.className)?t:t.parentElement?e(t.parentElement):null},d=function(e,n,i){return t.moveBetweenList?"above"===e?n:n+1:i<n?"above"===e?n-1:n:"above"===e?n:n-1},s={draggable:!0,ondrop:function(e){e.preventDefault();var c=t.dragIndex,s=t.moveBetweenList,u=t.copying,f=e.target,v=l(f);if(v){v.classList.remove("kanban__above","kanban__below");var m=r(f,e),p=o(f),h=d(m,p,c);if(h<c&&t.dragIndex++,s&&e.dataTransfer){var b=JSON.parse(e.dataTransfer.getData("application/json"));u&&function(e){t.model.filter(function(e){return e.autogenerate}).forEach(function(t){e[t.id]="id"===t.autogenerate?n():i()})}(b),t.items.splice(h,0,b)}else g(t.items,c,h);a()}},ondragstart:function(e){var n=e.target;if(e.dataTransfer){var i=t.items;e.dataTransfer.effectAllowed="copyMove",t.dragIndex=o(n),e.dataTransfer.setData("application/json",JSON.stringify(i[t.dragIndex],null,2))}},ondragover:function(e){e.redraw=!1,e.preventDefault();var n=l(e.target);if(n&&e.dataTransfer){var i=e.getModifierState("Control");n.classList.remove("kanban__above","kanban__below");var a=r(n,e);!function(e,n){if(!c(e))return!1;var i=t.dragIndex;if(t.moveBetweenList)return!0;var a=o(e),r=d(n,a,i);return i!==a&&r!==i}(n,a)?e.dataTransfer.dropEffect="none":(n.classList.add("kanban__"+a),t.copying=i,e.dataTransfer.dropEffect=i?"copy":"move")}},ondragleave:function(e){e.redraw=!1;var t=l(e.target);t&&t.classList.remove("kanban__above","kanban__below")},ondragend:function(e){e.dataTransfer&&"move"===e.dataTransfer.dropEffect&&(t.items.splice(t.dragIndex,1),a())}};return{oninit:function(e){var n=e.attrs,i=n.items,a=n.canEdit,r=void 0===a||a,o=n.canSort,c=void 0===o||o,l=n.canDrag,d=void 0!==l&&l,s=n.sortDirection,u=void 0===s?"asc":s,f=n.model,v=void 0===f?[]:f,m=n.label,p=void 0===m?"item":m,h=n.i18n,b=void 0===h?{newItem:"New "+p,modalDeleteItem:"Delete "+p,modalCreateNewItem:"Create new "+p,modalEditNewItem:"Edit new "+p}:h,g=n.containerId,k=n.editableIds,w=void 0===k?[]:k,x=n.fixedFooter,N=void 0!==x&&x,I=n.moveBetweenList,C=void 0!==I&&I;t.items=(void 0===i?[]:i).map(function(e){return y({},e)}),t.model=v,t.i18n=b,t.canEdit=r,t.canSort=c,t.canDrag=d,t.sortDirection=u,t.containerId=g,t.fixedFooter=N,t.editId="edit_item_"+t.id,t.deleteId="delete_item_"+t.id,t.moveBetweenList=C,t.editableIds=w,t.sortableIds=[{label:"None"}].concat(v.filter(function(e){return e.label}).map(function(e){return{label:e.label,id:e.id}}))},view:function(n){var i=n.attrs,r=i.disabled,o=i.onchange,c=t.model,l=t.items,d=t.canSort,u=t.sortDirection,f=t.curSortId,v=t.i18n,m=t.containerId,p=t.fixedFooter,h=t.canDrag,b=t.canEdit,g=t.moveBetweenList,k=t.sortableIds,w=t.editableIds;if(c){t.onchange=o;var x="asc"===u?1:-1,N=d&&f?l.sort(function(e,t){return e[f]>t[f]?x:e[f]<t[f]?-x:0}):l;return e(".kanban",[e(".row.kanban__menu",{style:"margin-bottom: 0;"},[b&&!r?e(O,{label:v.newItem,modalId:t.editId,iconName:"add",onclick:function(){t.curItem=void 0,t.updatedItem={}}}):void 0,d&&!h&&k&&l.length>1?[e(O,{iconName:"sort",iconClass:"asc"===u?"left twist":"",className:"right",onclick:function(){t.sortDirection="asc"===t.sortDirection?"desc":"asc"}}),e(ie,{items:k,checkedId:f,className:"right",style:"margin: 0 auto;",onchange:function(e){return t.curSortId=e}})]:void 0]),e(".row.kanban__items",e(".col.s12",N.length>0||!g?N.map(function(n,i){return e(".card-panel.kanban__item[data-kanban-index="+i+"]"+(r?".disabled":""),h&&!r?y({key:n.id},s):{key:n.id},[e(".card-content",e(Ve,{model:c,item:n,containerId:m,disabled:!0,editableIds:w,onchange:function(e){t.canSave=e,e&&o&&o(t.items)}})),b&&!r?e(".card-action.row",e(".col.s12",[e(O,{iconName:"edit",modalId:t.editId,onclick:function(){t.curItem=n,t.updatedItem=y({},n)}}),e(O,{iconName:"delete",modalId:t.deleteId,onclick:function(){return t.curItem=n}})])):void 0])}):e(".card-panel.kanban__item",y({},s)))),e(Se,{id:t.editId,title:v.modalCreateNewItem,fixedFooter:p,description:t.updatedItem?e(Ve,{model:c,item:t.updatedItem||{},containerId:m,onchange:function(e){t.canSave=e}}):void 0,buttons:[{iconName:"cancel",label:"Cancel"},{iconName:"save",label:"Save",disabled:!t.canSave,onclick:function(){if(t.curItem){var e=t.curItem;c.forEach(function(n){e[n.id]=t.updatedItem[n.id]})}else t.updatedItem&&t.items.push(t.updatedItem);a()}}]}),e(Se,{id:t.deleteId,title:v.modalDeleteItem,description:"Are you sure?",buttons:[{label:"No"},{label:"Yes",onclick:function(){t.items=t.items.filter(function(e){return e!==t.curItem}),a()}}]})])}}}},De=function(){var t=function(e){return i.curKey=i.id=e},i={elementId:n(),id:"",curKey:"",kvc:function(t,n,i){var a=i.keyClass,r=void 0===a?".col.s4":a,o=i.valueClass,c=void 0===o?".col.s8":o,l=n instanceof Array?n.join(", "):"boolean"==typeof n?e(xe,{label:" ",checked:n,disabled:!0,className:"checkbox-in-collection"}):n.toString();return{title:e(".row",{style:"margin-bottom: 0"},[e(r,e("b",t)),e(c,l)])}}},a=function(){i.id="",i.curKey=""};return{oninit:function(e){var t=e.attrs,n=t.keyValueConverter,a=t.id;n&&(i.kvc=n),a&&(i.elementId=a)},view:function(n){var r=n.attrs,o=r.className,c=void 0===o?"col s12":o,l=r.disabled,d=r.disallowArrays,s=r.header,u=r.iconName,f=r.iconNameKey,v=void 0===f?u?"label":void 0:f,m=r.isMandatory,p=r.label,h=r.labelKey,b=void 0===h?"Key":h,g=r.labelValue,y=void 0===g?"Value":g,k=r.properties,x=r.onchange,N=r.falsy,C=void 0===N?["false"]:N,M=r.truthy,T=void 0===M?["true"]:M,A=function(){return x?x(k):void 0},V=function(e,n){return Object.keys(e).map(function(t){return{key:t,value:e[t]}}).map(function(e){return function(e,n){var a=n.onclick;return n.id=n.id||e,n.active=e===i.curKey,n.onclick=a?function(){return t(e)&&a(n)}:function(){return t(e)},n}(e.key,i.kvc(e.key,e.value,{keyClass:n.keyClass,valueClass:n.valueClass}))})}(k,{keyClass:r.keyClass,valueClass:r.valueClass}),S=i.curKey,_=k[S],D="boolean"==typeof _||"number"==typeof _?_:_?_ instanceof Array?"["+_.join(", ")+"]":_:"",L=i.elementId;return[e(".map-editor",e(".input-field",{className:c,style:"min-height: 1.5em;"},[u?e("i.material-icons.prefix",u):"",e(I,{label:p,isMandatory:m,isActive:V.length>0}),e(te,{id:L,items:V,mode:w.LINKS,header:s})])),l?void 0:[e(se,{label:b,iconName:v,className:"col s5",initialValue:S,onchange:function(e){i.curKey=e,i.id&&(delete k[i.id],k[e]=_,i.id=e),A()}}),"string"==typeof D?e(le,{label:y,initialValue:D,className:"col s7",onchange:function(e){var t=function(e,t,n){return t.indexOf(e)>=0||!(n.indexOf(e)>=0)&&void 0}(e,T,C),n=void 0===t&&/^\s*\d+\s*$/i.test(e)?+e:void 0;k[S]="boolean"==typeof t?t:"number"==typeof n?n:function(e,t){if(void 0===t&&(t=!1),t)return e;if(e){var n=/\s*\[(.*)\]\s*/gi.exec(e);if(n&&2===n.length)return n[1].split(",").map(function(e){return e.trim()}).map(function(e){return/^\d+$/g.test(e)?+e:e})}}(e,d)||e,A()}}):"number"==typeof D?e(fe,{label:y,initialValue:D,className:"col s7",onchange:function(e){k[S]=e,A()}}):e(xe,{label:y,checked:D,className:"input-field col s7",onchange:function(e){k[S]=e,A()}}),e(".col.s12.right-align",[e(O,{iconName:"add",onclick:a}),e(O,{iconName:"delete",disabled:!S,onclick:function(){delete k[S],a(),A()}})])]]}}},Le=function(){return{oncreate:function(e){M.Materialbox.init(e.dom,e.attrs)},view:function(t){var n=t.attrs,i=n.width,a=n.height;return e("img.materialboxed[src="+n.src+"]"+(i?"[width="+i+"]":"")+(a?"[height="+a+"]":""),n)}}},Ee=function(){return{view:function(t){var n=t.attrs,i=n.title;return e("li",{className:n.active?"active":n.disabled?"disabled":"waves-effect"},"number"==typeof i?e(e.route.Link,{href:n.href},i):i)}}},Oe=function(){var t={pagIndex:0};return{view:function(n){var i=n.attrs,a=i.items,r=i.curPage,o=void 0===r?1:r,c=i.size,l=void 0===c?Math.min(9,a.length):c,d=t.pagIndex,s=d*l,u=s+l,f=d>0,v=u<a.length,m=[{title:e("a",{onclick:function(){return f&&t.pagIndex--}},e("i.material-icons","chevron_left")),disabled:!f}].concat(a.filter(function(e,t){return s<=t&&t<u}),[{title:e("a",{onclick:function(){return v&&t.pagIndex++}},e("i.material-icons","chevron_right")),disabled:!v}]);return e("ul.pagination",m.map(function(t,n){return e(Ee,y({title:s+n},t,{active:s+n===o}))}))}}},Re=function(){return{oncreate:function(e){M.Parallax.init(e.dom,e.attrs)},view:function(t){var n=t.attrs.src;return n?e(".parallax-container",e(".parallax",e("img[src="+n+"]"))):void 0}}},Fe=function(){var t={id:n()};return{view:function(n){var i=n.attrs,a=i.id||t.id,r=i.label,o=i.left,c=i.right,l=i.disabled,d=i.onchange,s=i.checked,f=i.className;return e("div"+(i.newRow?".clear":""),{className:void 0===f?"col s12":f},[r?e(I,{label:r||"",id:a,isMandatory:i.isMandatory}):void 0,e(".switch",e("label",[o||"Off",e("input[id="+a+"][type=checkbox]"+u({disabled:l})+(s?"[checked]":""),{onclick:d?function(e){e.target&&void 0!==e.target.checked&&d(e.target.checked)}:void 0}),e("span.lever"),c||"On"]))])}}},je=function(){var t={},n=function(e,t){return t||e.replace(/ /g,"").toLowerCase()};return{view:function(i){var a=i.attrs,r=a.tabWidth,o=a.selectedTabId,c=a.tabs,l=a.className,d=a.style,s=a.duration,u=a.onShow,f=a.swipeable,v=a.responsiveThreshold,m=c.filter(function(e){return e.active}).shift(),p=o||(m?n(m.title,m.id):"");return e(".row",[e(".col.s12",e("ul.tabs"+("fill"===r?".tabs-fixed-width":""),{className:l,style:d,oncreate:function(e){t.instance=M.Tabs.init(e.dom,{duration:s,onShow:u,responsiveThreshold:v,swipeable:f})},onupdate:function(){if(p){var e=document.getElementById("tab_"+p);e&&e.click()}},onremove:function(){return t.instance.destroy()}},c.map(function(t){var i=t.className,a=t.title,o=t.id,l=t.active,d=t.target,s=t.href;return e("li.tab"+(t.disabled?".disabled":"")+("fixed"===r?".col.s"+Math.floor(12/c.length):""),{className:i},e("a[id=tab_"+n(a,o)+"]"+(l?".active":""),{target:d,href:s||"#"+n(a,o)},a))}))),c.filter(function(e){return void 0===e.href}).map(function(t){var i=t.vnode,a=t.contentClass;return e(".col.s12[id="+n(t.title,t.id)+"]",{className:a},i)})])}}},Be=function(){return{view:function(t){var n=t.attrs,i=n.id,a=n.title,r=n.datetime,o=n.active,c=n.content,l=n.iconName,d=n.timeFormatter,s=n.onSelect;return e("li"+(o?".active":"")+(i?"[id="+i+"]":""),{onclick:s?function(){return s({id:i,title:a,datetime:r,active:o,content:c})}:void 0,style:s?"cursor: pointer;":void 0},[e(".mm_time",{datetime:r},[e("span",(0,n.dateFormatter)(r)),e("span",d(r))]),l?e(".mm_icon",e("i.material-icons",l)):void 0,e(".mm_label",[a?"string"==typeof a?e("h5",a):a:void 0,c?"string"==typeof c?e("p",c):c:void 0])])}}},Ke=function(){var t=function(e){return e.getUTCDate()+"/"+(e.getUTCMonth()+1)+"/"+e.getUTCFullYear()},n=function(e){return h(e.getUTCHours())+":"+h(e.getUTCMinutes())};return{view:function(i){var a=i.attrs,r=a.onSelect,o=a.timeFormatter,c=void 0===o?n:o,l=a.dateFormatter,d=void 0===l?t:l;return e("ul.mm_timeline",a.items.map(function(t){return e(Be,y({onSelect:r,dateFormatter:d,timeFormatter:c},t))}))}}};export{X as AnchorItem,T as Autocomplete,D as Button,_ as ButtonFactory,B as Carousel,j as CarouselItem,K as Chips,q as CodeBlock,P as Collapsible,U as CollapsibleItem,te as Collection,w as CollectionMode,me as ColorInput,ke as DatePicker,ie as Dropdown,he as EmailInput,be as FileInput,O as FlatButton,re as FloatingActionButton,C as HelperText,V as Icon,xe as InputCheckbox,_e as Kanban,I as Label,L as LargeButton,Ve as LayoutForm,G as ListItem,N as Mandatory,De as MapEditor,Le as MaterialBox,Se as ModalPanel,fe as NumberInput,Ne as Options,Oe as Pagination,Re as Parallax,ue as PasswordInput,Me as RadioButton,Ce as RadioButtons,pe as RangeInput,R as RoundIconButton,W as SecondaryContent,Ie as Select,E as SmallButton,F as SubmitButton,Fe as Switch,je as Tabs,le as TextArea,se as TextInput,we as TimePicker,Ke as Timeline,ve as UrlInput,c as camelToSnake,a as compose,u as disable,Ae as fieldToComponent,m as isNumeric,o as join,r as map,g as move,h as padLeft,p as pipe,f as req,b as swap,l as toAttributeString,v as toAttrs,n as uniqueId,i as uuid4};
1
+ import e from"mithril";import t from"materialize-css";var i=function(){return"idxxxxxxxx".replace(/[x]/g,function(){return(16*Math.random()|0).toString(16)})},n=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},a=function(){var e=arguments;return function(t){return[].slice.call(e).reduceRight(function(e,t){return t(e)},t)}},r=function(e){return function(t){return Array.prototype.map.call(t,e)}},o=function(e){return function(t){return Array.prototype.join.call(t,e)}},c=function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})},l=function(e){return e?a(o(""),r(function(t){return"["+c(t)+'="'+function(e){return void 0===e&&(e=""),e.toString().replace(/"/g,"&quot;")}(e[t])+'"]'}),Object.keys)(e):""},d=["min","max","minLength","maxLength","rows","cols","placeholder","autocomplete","pattern","readOnly","step"],s=function(e){return d.indexOf(e)>=0},u=function(e){return e.disabled?"[disabled]":""},f=function(e){return e.required||e.isMandatory?"[required][aria-required=true]":""},v=function(e){return function(e){var t,i=(t=e,function(e){return void 0!==t[e]});return Object.keys(e).filter(s).filter(i).reduce(function(t,i){var n=e[i];return t.push("["+i.toLowerCase()+"="+n+"]"),t},[]).join("")}(e)+function(e){return e.maxLength?"[data-length="+e.maxLength+"]":""}(e)+u(e)+f(e)+("boolean"==typeof(t=e.autofocus)&&t||t&&t()?"[autofocus]":"");var t},m=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},p=function(){var e=arguments;return function(t){return[].slice.call(e).reduce(function(e,t){return t(e)},t)}},h=function(e,t,i){return void 0===t&&(t=2),void 0===i&&(i="0"),(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e},b=function(e,t,i){var n=e[t];e[t]=e[i],e[i]=n},g=function(e,t,i){var n=e[t];e.splice(t,1),e.splice(i,0,n)};function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},y.apply(this,arguments)}function x(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)t.indexOf(i=r[n])>=0||(a[i]=e[i]);return a}var w,k=["label","id","isMandatory","isActive"],N={view:function(t){return e("span.mandatory",t.attrs,"*")}},C=function(){return{view:function(t){var i=t.attrs,n=i.label,a=i.id,r=i.isMandatory,o=i.isActive,c=x(i,k);return n?e("label"+(o?".active":"")+(a?"[for="+a+"]":""),c,[e.trust(n),r?e(N):void 0]):void 0}}},I=function(){return{view:function(t){var i=t.attrs,n=i.helperText,a=i.dataError,r=i.dataSuccess,o=a||r?l({dataError:a,dataSuccess:r}):"";return n||o?e("span.helper-text"+o,n?e.trust(n):""):void 0}}},A=function(){var t={id:i()};return{view:function(i){var n=i.attrs,a=n.id||t.id,r=v(n),o=n.label,c=n.helperText,l=n.initialValue,d=n.onchange,s=n.className,u=n.iconName,f=n.isMandatory;return e(".input-field"+(n.newRow?".clear":""),{className:void 0===s?"col s12":s,style:n.style},[u?e("i.material-icons.prefix",u):"",e("input.autocomplete[type=text][tabindex=0][id="+a+"]"+r,{oncreate:function(e){M.Autocomplete.init(e.dom,n)},onchange:d?function(e){e.target&&e.target.value&&d(e.target.value)}:void 0,value:l}),e(C,{label:o,id:a,isMandatory:f,isActive:l}),e(I,{helperText:c})])}}},T=["iconName"],V=function(){return{view:function(t){var i=t.attrs,n=i.iconName,a=x(i,T);return e("i.material-icons",a,n)}}},S=["modalId","tooltip","tooltipPostion","iconName","iconClass","label","attr"],O=function(t,i){return void 0===i&&(i=""),function(){var n=""+t+i;return{view:function(t){var i=t.attrs,a=i.modalId,r=i.tooltip,o=i.tooltipPostion,c=i.iconName,d=i.iconClass,s=i.label,u=i.attr,f=x(i,S);return e(n+(a?".modal-trigger[href=#"+a+"]":"")+(r?".tooltipped[data-position="+(o||"top")+"][data-tooltip="+r+"]":"")+l(u),f,c?e(V,{iconName:c,className:d||"left"}):void 0,s||void 0)}}}},R=O("a.waves-effect.waves-light.btn"),L=O("a.waves-effect.waves-light.btn-large"),j=O("a.waves-effect.waves-light.btn-small"),F=O("a.waves-effect.waves-teal.btn-flat"),D=O("button.btn-floating.btn-large.waves-effect.waves-light"),K=O("button.btn.waves-effect.waves-light","[type=submit]"),_=function(){return{view:function(t){var i=t.attrs;return e("a.carousel-item",{href:i.href},e("img[src="+i.src+"]"))}}},B=function(){return{view:function(t){var i=t.attrs,n=i.items;return n&&n.length>0?e(".carousel",{oncreate:function(e){M.Carousel.init(e.dom,i)}},n.map(function(t){return e(_,t)})):void 0}}},E=function(){return{oncreate:function(e){var t=e.attrs,i=e.dom,n=t.onchange,a=t.onChipAdd,r=t.onChipDelete,o=M.Chips.getInstance(i.children[0]),c=a?a.bind(o):void 0;t.onChipAdd=function(e,t){n&&n(this.chipsData),c&&c(e,t)};var l=r?r.bind(o):void 0;t.onChipDelete=function(e,t){n&&n(this.chipsData),l&&l(e,t)},M.Chips.init(i.children[0],t)},onupdate:function(e){var t=e.attrs.data;if(t&&0!==t.length){var i=M.Chips.getInstance(e.dom.children[0]);t.forEach(function(e){return i.addChip(e)})}},view:function(t){var i=t.attrs,n=i.isMandatory,a=void 0===n?i.required:n,r=i.className,o=i.label,c=i.helperText;return e(".input-field",{className:void 0===r?"col s12":r},[e(".chips.chips-autocomplete"+(i.placeholder?".chips-placeholder":"")+(i.data?".chips-initial":"")),o?e(C,{label:o,isMandatory:a,className:"active"}):void 0,c?e(I,{helperText:c}):void 0])}}},q=function(){return{view:function(t){var i=t.attrs,n=i.newRow,a=i.code,r=i.language||"lang-TypeScript",o=r.replace("lang-",""),c=a instanceof Array?a.join("\n"):a;return e("pre.codeblock"+(n?".clear":""),i,[e("div",e("label",o)),e("code."+r,c)])}}},P=function(){return{view:function(t){var i=t.attrs,n=i.header,a=i.body,r=i.iconName;return e(i.active?"li.active":"li",[n||r?e(".collapsible-header",[r?e("i.material-icons",r):void 0,n?"string"==typeof n?e("span",n):n:void 0]):void 0,a?e(".collapsible-body",a):void 0])}}},U=function(){return{oncreate:function(e){M.Collapsible.init(e.dom,e.attrs)},view:function(t){var i=t.attrs,n=i.items;return n&&n.length>0?e("ul.collapsible",{class:i.class||i.className,style:i.style,id:i.id},n.map(function(t){return e(P,t)})):void 0}}},z=["header","items","mode"],H=["title","active","href"],$=["items","header"],W=["items","header","mode"];!function(e){e[e.BASIC=0]="BASIC",e[e.LINKS=1]="LINKS",e[e.AVATAR=2]="AVATAR"}(w||(w={}));var Y=function(e){return e&&/https?:\/\//.test(e)},Z=function(){return{view:function(t){var i=t.attrs,n=i.href,a=i.iconName,r=void 0===a?"send":a,o=i.onclick,c=i.style,l={href:n,style:void 0===c?{cursor:"pointer"}:c,className:"secondary-content",onclick:o?function(){return o(i)}:void 0};return Y(n)||!n?e("a[target=_]",l,e(V,{iconName:r})):e(e.route.Link,l,e(V,{iconName:r}))}}},G=function(e){return void 0===e&&(e=""),/\./.test(e)},J=function(){return{view:function(t){var i=t.attrs,n=i.item,a=n.title,r=n.content,o=void 0===r?"":r,c=n.active,l=n.iconName,d=n.avatar,s=n.className,u=n.onclick;return i.mode===w.AVATAR?e("li.collection-item.avatar"+(c?".active":""),{onclick:u?function(){return u(n)}:void 0},[G(d)?e("img.circle",{src:d}):e("i.material-icons.circle",{className:s},d),e("span.title",a),e("p",e.trust(o)),e(Z,n)]):e("li.collection-item"+(c?".active":""),l?e("div",[a,e(Z,n)]):a)}}},Q=function(){return{view:function(t){var i=t.attrs,n=i.header,a=i.items,r=i.mode,o=void 0===r?w.BASIC:r,c=x(i,z),l=a.map(function(t){return e(J,{key:t.id,item:t,mode:o})});return n?e("ul.collection.with-header",c,[e("li.collection-header",e("h4",n)),l]):e("ul.collection",c,l)}}},X=function(){return{view:function(t){var i=t.attrs.item,n=i.title,a=i.active,r=i.href,o=y({},x(i,H),{className:"collection-item "+(a?"active":""),href:r});return Y(r)||!r?e("a[target=_]",o,n):e(e.route.Link,o,n)}}},ee=function(){return{view:function(t){var i=t.attrs,n=i.items,a=i.header,r=x(i,$);return a?e(".collection.with-header",r,[e(".collection-header",e("h4",a)),n.map(function(t){return e(X,{key:t.id,item:t})})]):e(".collection",r,n.map(function(t){return e(X,{key:t.id,item:t})}))}}},te=function(){return{view:function(t){var i=t.attrs,n=i.items,a=i.header,r=i.mode,o=void 0===r?w.BASIC:r,c=x(i,W);return a||n&&n.length>0?o===w.LINKS?e(ee,y({header:a,items:n},c)):e(Q,y({header:a,items:n,mode:o},c)):void 0}}},ie=["key","label","onchange","disabled","items","iconName","helperText","style","className"],ne=function(){var t={};return{oninit:function(e){var n=e.attrs,a=n.id,r=void 0===a?i():a,o=n.initialValue,c=n.checkedId;t.id=r,t.initialValue=o||c},view:function(i){var n=i.attrs,a=n.key,r=n.label,o=n.onchange,c=n.disabled,l=void 0!==c&&c,d=n.items,s=n.iconName,u=n.helperText,f=n.style,v=n.className,m=void 0===v?"col s12":v,p=x(n,ie),h=t.id,b=t.initialValue,g=b?d.filter(function(e){return e.id?e.id===b:e.label===b}).shift():void 0,y=g?g.label:r||"Select";return e(".input-field",{className:m,key:a,style:f},[s?e("i.material-icons.prefix",s):void 0,e(I,{helperText:u}),e("a.dropdown-trigger.btn.truncate[href=#][data-target="+h+"]"+(l?"[disabled]":""),{className:"col s12",style:f||(s?"margin: 0.2em 0 0 3em;":void 0),oncreate:function(e){M.Dropdown.init(e.dom,p)}},y),e("ul.dropdown-content[id="+h+"]",d.map(function(i){return e("li"+(i.divider?".divider[tabindex=-1]":""),i.divider?void 0:e("a",{onclick:o?function(){t.initialValue=i.id||i.label,o(t.initialValue)}:void 0},[i.iconName?e("i.material-icons",i.iconName):void 0,i.label]))}))])}}},ae=["className","iconName","iconClass","position","style","buttons"],re=function(){return{view:function(t){var i=t.attrs,n=i.className,a=i.iconName,r=i.iconClass,o=void 0===r?"large":r,c=i.position,l=i.style,d=void 0===l?"left"===c||"inline-left"===c?"position: absolute; display: inline-block; left: 24px;":"right"===c||"inline-right"===c?"position: absolute; display: inline-block; right: 24px;":void 0:l,s=i.buttons,u=x(i,ae),f=e(".fixed-action-btn",{style:d,oncreate:function(e){return M.FloatingActionButton.init(e.dom,u)}},[e("a.btn-floating.btn-large",{className:n},e("i.material-icons",{classNames:o},a)),s?e("ul",s.map(function(t){return e("li",e("a.btn-floating",{className:t.className,onclick:function(e){return t.onClick&&t.onClick(e)}},e("i.material-icons",{className:t.iconClass},t.iconName)))})):void 0]);return"inline-right"===c||"inline-left"===c?e("div",{style:"position: relative; height: 70px;"},f):f}}},oe=["className","helperText","iconName","id","initialValue","isMandatory","label","onchange","style"],ce=["className","dataError","dataSuccess","helperText","iconName","id","initialValue","isMandatory","label","maxLength","newRow","onchange","onkeydown","onkeypress","onkeyup","style","validate"],le=function(){var n={id:i()};return{view:function(i){var a=i.attrs,r=a.className,o=void 0===r?"col s12":r,c=a.helperText,l=a.iconName,d=a.id,s=void 0===d?n.id:d,u=a.initialValue,f=a.isMandatory,m=a.label,p=a.onchange,h=a.style,b=x(a,oe),g=v(b);return e(".input-field",{className:o,style:h},[l?e("i.material-icons.prefix",l):"",e("textarea.materialize-textarea[tabindex=0][id="+s+"]"+g,{oncreate:function(e){var i=e.dom;t.textareaAutoResize(i),a.maxLength&&t.CharacterCounter.init(i)},onchange:p?function(e){var t=e.target;p(t&&"string"==typeof t.value?t.value:"")}:void 0,value:u}),e(C,{label:m,id:s,isMandatory:f,isActive:u||a.placeholder}),e(I,{helperText:c})])}}},de=function(n,a){return void 0===a&&(a=""),function(){var r={id:i()},o=function(e){var t=e.value;return!t||"number"!==n&&"range"!==n?t:+t},c=function(e,t){e.setCustomValidity("boolean"==typeof t?t?"":"Custom validation failed":t)};return{view:function(i){var l=i.attrs,d=l.className,s=void 0===d?"col s12":d,u=l.dataError,f=l.dataSuccess,m=l.helperText,p=l.iconName,h=l.id,b=void 0===h?r.id:h,g=l.initialValue,y=l.isMandatory,w=l.label,k=l.maxLength,N=l.newRow,M=l.onchange,A=l.onkeydown,T=l.onkeypress,V=l.onkeyup,S=l.style,O=l.validate,R=x(l,ce),L=v(R);return e(".input-field"+(N?".clear":"")+a,{className:s,style:S},[p?e("i.material-icons.prefix",p):void 0,e("input.validate[type="+n+"][tabindex=0][id="+b+"]"+L,{oncreate:function(e){var i,a=e.dom;(i=l.autofocus)&&("boolean"==typeof i?i:i())&&a.focus(),k&&t.CharacterCounter.init(a),"range"===n&&t.Range.init(a)},onkeyup:V?function(e){V(e,o(e.target))}:void 0,onkeydown:A?function(e){A(e,o(e.target))}:void 0,onkeypress:T?function(e){T(e,o(e.target))}:void 0,onupdate:O?function(e){var t=e.dom;c(t,O(o(t),t))}:void 0,onchange:function(e){var t=e.target;if(t){var i=o(t);M&&M(i),O&&c(t,O(i,t))}},value:g}),e(C,{label:w,id:b,isMandatory:y,isActive:!(void 0===g&&!l.placeholder&&"number"!==n&&"color"!==n&&"range"!==n)}),e(I,{helperText:m,dataError:u,dataSuccess:f})])}}}},se=de("text"),ue=de("password"),fe=de("number"),ve=de("url"),me=de("color"),pe=de("range",".range-field"),he=de("email"),be=function(){var t,i=!1;return{view:function(n){var a=n.attrs,r=a.multiple,o=a.disabled,c=a.initialValue,l=a.placeholder,d=a.onchange,s=a.className,u=void 0===s?"col s12":s,f=a.accept,v=a.label,m=void 0===v?"File":v,p=f?f instanceof Array?f.join(", "):f:void 0,h=p?"[accept="+p+"]":"",b=r?"[multiple]":"",g=o?"[disabled]":"",y=l?"[placeholder="+l+"]":"";return e(".file-field.input-field",{className:a.class||u},[e(".btn",[e("span",m),e("input[type=file]"+b+g+h,{onchange:d?function(e){var t=e.target;t&&t.files&&d&&(i=!0,d(t.files))}:void 0})]),e(".file-path-wrapper",e("input.file-path.validate"+y+"[type=text]",{oncreate:function(e){t=e.dom,c&&(t.value=c)}})),(i||c)&&e("a.waves-effect.waves-teal.btn-flat",{style:"float: right;position: relative;top: -3rem; padding: 0",onclick:function(){i=!1,t.value="",d&&d({})}},e("i.material-icons","clear"))])}}},ge=function(){return{view:function(t){var i=t.attrs,n=i.className,a=i.onchange,r=i.label;return e("div",{className:void 0===n?"col s12":n},e("label",[e("input[type=checkbox][tabindex=0]"+(i.checked?"[checked]":"")+(i.disabled?"[disabled]":""),{onclick:a?function(e){e.target&&void 0!==e.target.checked&&a(e.target.checked)}:void 0}),r?"string"==typeof r?e("span",r):r:void 0]))}}},ye=function(){var t={},i=function(e){return t.checkedIds.indexOf(e)>=0};return{oninit:function(e){var i=e.attrs,n=i.checkedId,a=n||i.initialValue;t.checkedId=n,t.checkedIds=a?a instanceof Array?[].concat(a):[a]:[]},view:function(n){var a=n.attrs,r=a.label,o=a.id,c=a.options,l=a.checkedId,d=a.description,s=a.className,u=void 0===s?"col s12":s,f=a.disabled,v=a.checkboxClass,m=a.newRow,p=a.isMandatory,h=a.onchange;l&&t.checkedId!==l&&(t.checkedId=l,t.checkedIds=l instanceof Array?l:[l]);var b=h?function(e,i){var n=t.checkedIds.filter(function(t){return t!==e});i&&n.push(e),t.checkedIds=n,h(n)}:void 0;return e("div"+(m?".clear":""),{className:u},[e("div",{className:"input-field options"},e(C,{id:o,label:r,isMandatory:p})),e(I,{helperText:d})].concat(c.map(function(t){return e(ge,{disabled:f||t.disabled,label:t.label,onchange:b?function(e){return b(t.id,e)}:void 0,className:v,checked:i(t.id)})})))}}},xe=function(){var t=function(e){return n.curKey=n.id=e},n={elementId:i(),id:"",curKey:"",kvc:function(t,i,n){var a=n.keyClass,r=void 0===a?".col.s4":a,o=n.valueClass,c=void 0===o?".col.s8":o,l=i instanceof Array?i.join(", "):"boolean"==typeof i?e(ge,{label:" ",checked:i,disabled:!0,className:"checkbox-in-collection"}):i.toString();return{title:e(".row",{style:"margin-bottom: 0"},[e(r,e("b",t)),e(c,l)])}}},a=function(){n.id="",n.curKey=""};return{oninit:function(e){var t=e.attrs,i=t.keyValueConverter,a=t.id;i&&(n.kvc=i),a&&(n.elementId=a)},view:function(i){var r=i.attrs,o=r.className,c=void 0===o?"col s12":o,l=r.disabled,d=r.disallowArrays,s=r.header,u=r.iconName,f=r.iconNameKey,v=void 0===f?u?"label":void 0:f,m=r.isMandatory,p=r.label,h=r.labelKey,b=void 0===h?"Key":h,g=r.labelValue,y=void 0===g?"Value":g,x=r.properties,k=r.onchange,N=r.falsy,M=void 0===N?["false"]:N,I=r.truthy,A=void 0===I?["true"]:I,T=function(){return k?k(x):void 0},V=function(e,i){return Object.keys(e).map(function(t){return{key:t,value:e[t]}}).map(function(e){return function(e,i){var a=i.onclick;return i.id=i.id||e,i.active=e===n.curKey,i.onclick=a?function(){return t(e)&&a(i)}:function(){return t(e)},i}(e.key,n.kvc(e.key,e.value,{keyClass:i.keyClass,valueClass:i.valueClass}))})}(x,{keyClass:r.keyClass,valueClass:r.valueClass}),S=n.curKey,O=x[S],R="boolean"==typeof O||"number"==typeof O?O:O?O instanceof Array?"["+O.join(", ")+"]":O:"",L=n.elementId;return[e(".map-editor",e(".input-field",{className:c,style:"min-height: 1.5em;"},[u?e("i.material-icons.prefix",u):"",e(C,{label:p,isMandatory:m,isActive:V.length>0}),e(te,{id:L,items:V,mode:w.LINKS,header:s})])),l?void 0:[e(se,{label:b,iconName:v,className:"col s5",initialValue:S,onchange:function(e){n.curKey=e,n.id&&(delete x[n.id],x[e]=O,n.id=e),T()}}),"string"==typeof R?e(le,{label:y,initialValue:R,className:"col s7",onchange:function(e){var t=function(e,t,i){return t.indexOf(e)>=0||!(i.indexOf(e)>=0)&&void 0}(e,A,M),i=void 0===t&&/^\s*\d+\s*$/i.test(e)?+e:void 0;x[S]="boolean"==typeof t?t:"number"==typeof i?i:function(e,t){if(void 0===t&&(t=!1),t)return e;if(e){var i=/\s*\[(.*)\]\s*/gi.exec(e);if(i&&2===i.length)return i[1].split(",").map(function(e){return e.trim()}).map(function(e){return/^\d+$/g.test(e)?+e:e})}}(e,d)||e,T()}}):"number"==typeof R?e(fe,{label:y,initialValue:R,className:"col s7",onchange:function(e){x[S]=e,T()}}):e(ge,{label:y,checked:R,className:"input-field col s7",onchange:function(e){x[S]=e,T()}}),e(".col.s12.right-align",[e(F,{iconName:"add",onclick:a}),e(F,{iconName:"delete",disabled:!S,onclick:function(){delete x[S],a(),T()}})])]]}}},we=function(){return{oncreate:function(e){M.Materialbox.init(e.dom,e.attrs)},view:function(t){var i=t.attrs,n=i.width,a=i.height;return e("img.materialboxed[src="+i.src+"]"+(n?"[width="+n+"]":"")+(a?"[height="+a+"]":""),i)}}},ke=function(){return{oncreate:function(e){var t=e.attrs,i=t.onCreate,n=M.Modal.init(e.dom,t.options);i&&i(n)},view:function(t){var i=t.attrs,n=i.description,a=i.buttons,r=i.richContent;return e(".modal"+(i.fixedFooter?".modal-fixed-footer":"")+(i.bottomSheet?".bottom-sheet":"")+"[id="+i.id+"]",[e(".modal-content",[e("h4",i.title),r&&"string"==typeof n?e.trust(n||""):"string"==typeof n?e("p",n):n]),a?e(".modal-footer",a.map(function(t){return e(F,y({},t,{className:"modal-close"}))})):void 0])}}},Ne=function(){return{view:function(t){var i=t.attrs,n=i.title;return e("li",{className:i.active?"active":i.disabled?"disabled":"waves-effect"},"number"==typeof n?e(e.route.Link,{href:i.href},n):n)}}},Ce=function(){var t={pagIndex:0};return{view:function(i){var n=i.attrs,a=n.items,r=n.curPage,o=void 0===r?1:r,c=n.size,l=void 0===c?Math.min(9,a.length):c,d=t.pagIndex,s=d*l,u=s+l,f=d>0,v=u<a.length,m=[{title:e("a",{onclick:function(){return f&&t.pagIndex--}},e("i.material-icons","chevron_left")),disabled:!f}].concat(a.filter(function(e,t){return s<=t&&t<u}),[{title:e("a",{onclick:function(){return v&&t.pagIndex++}},e("i.material-icons","chevron_right")),disabled:!v}]);return e("ul.pagination",m.map(function(t,i){return e(Ne,y({title:s+i},t,{active:s+i===o}))}))}}},Me=function(){return{oncreate:function(e){M.Parallax.init(e.dom,e.attrs)},view:function(t){var i=t.attrs.src;return i?e(".parallax-container",e(".parallax",e("img[src="+i+"]"))):void 0}}},Ie=["label","helperText","initialValue","newRow","className","iconName","isMandatory","onchange","disabled"],Ae=["label","helperText","initialValue","newRow","className","iconName","isMandatory","onchange","disabled"],Te=function(){var t={id:i()};return{view:function(i){var n=i.attrs,a=n.label,r=n.helperText,o=n.initialValue,c=n.newRow,l=n.className,d=void 0===l?"col s12":l,s=n.iconName,u=n.isMandatory,f=n.onchange,m=n.disabled,p=x(n,Ie),h=t.id,b=v(p),g=f?function(){return t.dp&&f(t.dp.date)}:void 0;return e(".input-field"+(c?".clear":""),{className:d,onremove:function(){return t.dp&&t.dp.destroy()}},[s?e("i.material-icons.prefix",s):"",e("input.datepicker[type=text][tabindex=0][id="+h+"]"+b+(m?"[disabled]":""),{oncreate:function(e){t.dp=M.Datepicker.init(e.dom,y({format:"yyyy/mm/dd",showClearBtn:!0,setDefaultDate:!0,defaultDate:o?new Date(o):new Date},p,{onClose:g}))}}),e(C,{label:a,id:h,isMandatory:u,isActive:!!o}),e(I,{helperText:r})])}}},Ve=function(){var t={id:i()};return{view:function(i){var n=i.attrs,a=n.label,r=n.helperText,o=n.initialValue,c=n.newRow,l=n.className,d=void 0===l?"col s12":l,s=n.iconName,u=n.isMandatory,f=n.onchange,m=n.disabled,p=x(n,Ae),h=t.id,b=v(p),g=c?".clear":"",w=new Date,k=f?function(){return t.tp&&f(t.tp.time||o||w.getHours()+":"+w.getMinutes())}:void 0;return e(".input-field.timepicker"+g,{className:d,onremove:function(){return t.tp&&t.tp.destroy()}},[s?e("i.material-icons.prefix",s):"",e("input[type=text][tabindex=0][id="+h+"]"+b+(m?"[disabled]":""),{value:o,oncreate:function(e){t.tp=M.Timepicker.init(e.dom,y({twelveHour:!1,showClearBtn:!0,defaultTime:o},p,{onCloseEnd:k}))}}),e(C,{label:a,id:h,isMandatory:u,isActive:o}),e(I,{helperText:r})])}}},Se=function(){return{view:function(t){var i=t.attrs,n=i.id,a=i.label,r=i.onchange,o=i.className;return e("div",{className:void 0===o?"col s12":o},e("label",[e("input[type=radio][tabindex=0][name="+i.groupId+"]"+(i.checked?"[checked=checked]":"")+(i.disabled?"[disabled]":""),{onclick:r?function(){return r(n)}:void 0}),e("span",e.trust(a))]))}}},Oe=function(){var t={groupId:i()};return{oninit:function(e){var i=e.attrs,n=i.checkedId,a=i.initialValue;t.oldCheckedId=n,t.checkedId=n||a},view:function(i){var n=i.attrs,a=n.id,r=n.checkedId,o=n.newRow,c=n.className,l=void 0===c?"col s12":c,d=n.label,s=void 0===d?"":d,u=n.disabled,f=n.description,v=n.options,m=n.isMandatory,p=n.checkboxClass,h=n.onchange;t.oldCheckedId!==r&&(t.oldCheckedId=t.checkedId=r);var b=t.groupId,g=t.checkedId,x=function(e){t.checkedId=e,h&&h(e)};return e("div"+(a?"[id="+a+"]":"")+(o?".clear":""),{className:l},[e("div",{className:"input-field options"},e(C,{id:a,label:s,isMandatory:m})),f?e("p.helper-text",e.trust(f)):""].concat(v.map(function(t){return e(Se,y({},t,{onchange:x,groupId:b,disabled:u,className:p,checked:t.id===g}))})))}}},Re=function(){var t={},i=function(e){return e.map(function(e){return e.id}).join("")},n=function(e,t,i){return void 0===i&&(i=!1),i||(t instanceof Array&&(e||"number"==typeof e)?t.indexOf(e)>=0:t===e)};return{oninit:function(e){var n=e.attrs,a=n.checkedId,r=n.initialValue;t.ids=i(n.options);var o=a||r;t.checkedId=a,t.initialValue=o?o instanceof Array?[].concat(o.filter(function(e){return null!==e})):[o]:[]},view:function(a){var r=a.attrs,o=r.id,c=r.newRow,l=r.className,d=void 0===l?"col s12":l,s=r.checkedId,u=r.key,f=r.options,v=r.multiple,p=r.label,h=r.helperText,b=r.placeholder,g=r.isMandatory,y=r.iconName,x=r.disabled,w=r.classes,k=r.dropdownOptions,N=r.onchange;t.checkedId!==s&&(t.initialValue=s?s instanceof Array?s:[s]:void 0);var A=t.initialValue,T=N?v?function(){var e=t.instance&&t.instance.getSelectedValues(),i=e?e.length>0&&m(e[0])?e.map(function(e){return+e}):e.filter(function(e){return null!==e||void 0!==e}):void 0;t.initialValue=i||[],N(t.initialValue)}:function(e){if(e&&e.currentTarget){var i=e.currentTarget,n=m(i.value)?+i.value:i.value;t.initialValue=void 0!==typeof n?[n]:[]}t.initialValue&&N(t.initialValue)}:void 0,V=c?".clear":"",S=x?"[disabled]":"",O=v?"[multiple]":"",R=0===f.filter(function(e){return n(e.id,A)}).length;return e(".input-field.select-space"+V,{className:d,key:u},[y&&e("i.material-icons.prefix",y),e("select[id="+o+"]"+S+O,{oncreate:function(e){t.instance=M.FormSelect.init(e.dom,{classes:w,dropdownOptions:k})},onupdate:function(e){var n=e.dom,a=i(f),r=s&&t.checkedId!==s.toString();t.ids!==a&&(t.ids=a,r=!0),t.checkedId!==s&&(t.checkedId=s,r=!0),r&&(t.instance=M.FormSelect.init(n,{classes:w,dropdownOptions:k}))},onchange:T},b?e("option[disabled]"+(R?"[selected]":""),b):"",f.map(function(t,i){return e("option[value="+t.id+"]"+(t.title?"[title="+t.title+"]":"")+(t.disabled?"[disabled]":"")+(n(t.id,A,0===i&&R&&!b)?"[selected]":""),t.label.replace("&amp;","&"))})),e(C,{label:p,isMandatory:g}),e(I,{helperText:h})])}}},Le=["label","left","right","disabled","newRow","onchange","checked","isMandatory","className"],je=function(){var t={id:i()};return{view:function(i){var n=i.attrs,a=n.id||t.id,r=n.label,o=n.left,c=n.right,l=n.disabled,d=n.newRow,s=n.onchange,f=n.checked,v=n.isMandatory,m=n.className,p=void 0===m?"col s12":m,h=x(n,Le);return e("div"+(d?".clear":""),{className:p},[r?e(C,{label:r||"",id:a,isMandatory:v}):void 0,e(".switch",h,e("label",[o||"Off",e("input[id="+a+"][type=checkbox]"+u({disabled:l})+(f?"[checked]":""),{onclick:s?function(e){e.target&&void 0!==e.target.checked&&s(e.target.checked)}:void 0}),e("span.lever"),c||"On"]))])}}},Fe=function(){var t={},i=function(e,t){return t||e.replace(/ /g,"").toLowerCase()};return{view:function(n){var a=n.attrs,r=a.tabWidth,o=a.selectedTabId,c=a.tabs,l=a.className,d=a.style,s=a.duration,u=a.onShow,f=a.swipeable,v=a.responsiveThreshold,m=c.filter(function(e){return e.active}).shift(),p=o||(m?i(m.title,m.id):"");return e(".row",[e(".col.s12",e("ul.tabs"+("fill"===r?".tabs-fixed-width":""),{className:l,style:d,oncreate:function(e){t.instance=M.Tabs.init(e.dom,{duration:s,onShow:u,responsiveThreshold:v,swipeable:f})},onupdate:function(){if(p){var e=document.getElementById("tab_"+p);e&&e.click()}},onremove:function(){return t.instance.destroy()}},c.map(function(t){var n=t.className,a=t.title,o=t.id,l=t.active,d=t.target,s=t.href;return e("li.tab"+(t.disabled?".disabled":"")+("fixed"===r?".col.s"+Math.floor(12/c.length):""),{className:n},e("a[id=tab_"+i(a,o)+"]"+(l?".active":""),{target:d,href:s||"#"+i(a,o)},a))}))),c.filter(function(e){return void 0===e.href}).map(function(t){var n=t.vnode,a=t.contentClass;return e(".col.s12[id="+i(t.title,t.id)+"]",{className:a},n)})])}}},De=function(){return{view:function(t){var i=t.attrs,n=i.id,a=i.title,r=i.datetime,o=i.active,c=i.content,l=i.iconName,d=i.timeFormatter,s=i.onSelect;return e("li"+(o?".active":"")+(n?"[id="+n+"]":""),{onclick:s?function(){return s({id:n,title:a,datetime:r,active:o,content:c})}:void 0,style:s?"cursor: pointer;":void 0},[e(".mm_time",{datetime:r},[e("span",(0,i.dateFormatter)(r)),e("span",d(r))]),l?e(".mm_icon",e("i.material-icons",l)):void 0,e(".mm_label",[a?"string"==typeof a?e("h5",a):a:void 0,c?"string"==typeof c?e("p",c):c:void 0])])}}},Ke=function(){var t=function(e){return e.getUTCDate()+"/"+(e.getUTCMonth()+1)+"/"+e.getUTCFullYear()},i=function(e){return h(e.getUTCHours())+":"+h(e.getUTCMinutes())};return{view:function(n){var a=n.attrs,r=a.onSelect,o=a.timeFormatter,c=void 0===o?i:o,l=a.dateFormatter,d=void 0===l?t:l;return e("ul.mm_timeline",a.items.map(function(t){return e(De,y({onSelect:r,dateFormatter:d,timeFormatter:c},t))}))}}};export{X as AnchorItem,A as Autocomplete,R as Button,O as ButtonFactory,B as Carousel,_ as CarouselItem,E as Chips,q as CodeBlock,U as Collapsible,P as CollapsibleItem,te as Collection,w as CollectionMode,me as ColorInput,Te as DatePicker,ne as Dropdown,he as EmailInput,be as FileInput,F as FlatButton,re as FloatingActionButton,I as HelperText,V as Icon,ge as InputCheckbox,C as Label,L as LargeButton,J as ListItem,N as Mandatory,xe as MapEditor,we as MaterialBox,ke as ModalPanel,fe as NumberInput,ye as Options,Ce as Pagination,Me as Parallax,ue as PasswordInput,Se as RadioButton,Oe as RadioButtons,pe as RangeInput,D as RoundIconButton,Z as SecondaryContent,Re as Select,j as SmallButton,K as SubmitButton,je as Switch,Fe as Tabs,le as TextArea,se as TextInput,Ve as TimePicker,Ke as Timeline,ve as UrlInput,c as camelToSnake,a as compose,u as disable,m as isNumeric,o as join,r as map,g as move,h as padLeft,p as pipe,f as req,b as swap,l as toAttributeString,v as toAttrs,i as uniqueId,n as uuid4};
2
2
  //# sourceMappingURL=index.esm.js.map