diff --git a/client/Accounts/Login/reg.js b/client/Accounts/Login/reg.js index ef5c80e..c2ddbe2 100644 --- a/client/Accounts/Login/reg.js +++ b/client/Accounts/Login/reg.js @@ -8,7 +8,6 @@ Template.reg.onRendered(function() { Session.set("canreg", false); Session.set("missingReq", false); Session.set("missingName", false); - Session.set("missingPhone", false); Session.set("missingEmail", false); Session.set("missingPassword", false); }); @@ -53,7 +52,6 @@ Template.reg.events({ let email = $("#email").val(); let password = $("#password").val(); let name = $("#name").val(); - let phone = $("#phone").val(); if (name == "" || name == null) { missingName = true; diff --git a/client/AdminMgmt/ListMgmt/listMgmtForm.html b/client/AdminMgmt/ListMgmt/listMgmtForm.html index 5299d72..b058807 100644 --- a/client/AdminMgmt/ListMgmt/listMgmtForm.html +++ b/client/AdminMgmt/ListMgmt/listMgmtForm.html @@ -18,9 +18,9 @@
{{#if $eq editMode false}} - Add + Add {{else}} - Rename + Rename {{/if}}
diff --git a/client/General/DeleteConfModal/deleteConfirmationModal.js b/client/General/DeleteConfModal/deleteConfirmationModal.js index 5bdbbb5..f4cb155 100644 --- a/client/General/DeleteConfModal/deleteConfirmationModal.js +++ b/client/General/DeleteConfModal/deleteConfirmationModal.js @@ -3,7 +3,8 @@ Template.deleteConfirmationModal.onCreated(function() { }); Template.deleteConfirmationModal.onRendered(function() { - $('.modal').modal(); + // put new modal init here + // $('.modal').modal(); }); Template.deleteConfirmationModal.helpers({ @@ -26,7 +27,8 @@ Template.deleteConfirmationModal.events({ console.log(" ERROR deleting item from modal: " + err); } else { // console.log(" SUCCESSFULLY deleted."); - $('#modalDelete').modal('close'); + // put the new modal open / close here + // $('#modalDelete').modal('close'); } }); }, diff --git a/client/General/headerBar.js b/client/General/headerBar.js index bdfd317..34281c1 100644 --- a/client/General/headerBar.js +++ b/client/General/headerBar.js @@ -1,19 +1,14 @@ +import { M } from '../lib/assets/materialize'; Template.headerBar.onCreated(function() { }); Template.headerBar.onRendered(function() { - $('.sidenav').sidenav(); - setTimeout(function() { - $('.sidenav').sidenav(); - $(".dropdown-trigger").dropdown(); - $('.collapsible').collapsible(); - }, 200) - $(".dropdown-trigger").dropdown(); - $('.collapsible').collapsible(); - - + var elems = document.querySelectorAll('.sidenav'); + var instances = M.Sidenav.init(elems, {}); + var elemd = document.querySelectorAll('.dropdown-trigger'); + var instances = M.Dropdown.init(elemd, {}); }); Template.headerBar.helpers({ diff --git a/client/General/modal/modal.js b/client/General/modal/modal.js index 4fec87b..fd46946 100644 --- a/client/General/modal/modal.js +++ b/client/General/modal/modal.js @@ -1,11 +1,12 @@ - +import { M } from '../../lib/assets/materialize.js'; Template.myModal.onCreated(function() { }); Template.myModal.onRendered(function() { - $('.modal').modal(); + var elems = document.querySelectorAll('.modal'); + var instances = M.Modal.init(elems, {}); }); Template.myModal.helpers({ @@ -30,7 +31,7 @@ Template.myModal.events({ } else { $("#genModal").modal('close'); - window[callFunction](functionPassId); // <-- calls the function and passed the Id on confirm. + window[callFunction](functionPassId); // <-- calls the function and passes the Id on confirm. } }, 'click #cancel' (event) { diff --git a/client/ListItems/listItemsForm.js b/client/ListItems/listItemsForm.js index 4fd8b5c..3f947b3 100644 --- a/client/ListItems/listItemsForm.js +++ b/client/ListItems/listItemsForm.js @@ -1,27 +1,26 @@ import { ListItems } from '../../imports/api/listItems.js' import { Lists } from '../../imports/api/lists.js'; import { Products } from '../../imports/api/products.js'; -import { typeahead } from 'typeahead-standalone'; +import { M } from '../lib/assets/materialize.js'; Template.listItemsForm.onCreated(function() { this.subscribe("myListItems", Session.get("listId")); this.subscribe("myLists"); - // this.subscribe("listProducts", Session.get("listItemVal")); this.subscribe("myProducts"); }); Template.listItemsForm.onRendered(function() { - Meteor.setTimeout(function() { - $('select').formSelect(); - }, 100); - $('select').formSelect(); + var elems = document.querySelectorAll('select'); + var instances = M.FormSelect.init(elems, {}); Session.set("listItemEditMode", false); Session.set("itemReqErr", false); Session.set("showReceivedItems", false); Session.set("filtering", false); Session.set("findListItems", {}); this.autorun(() => { - $('input.autocomplete').autocomplete({ + var elems = document.querySelectorAll('.autocomplete'); + var instances = M.Autocomplete.init(elems, { + minLength: 0, data: Session.get("findListItems"), }); }); @@ -95,20 +94,11 @@ Template.listItemsForm.events({ }, 'keyup #findListItems' (event) { if (event.which !== 13) { - let listItemObj = {}; let findItemVal = $("#findListItems").val(); - console.log("Should start showing options now..."); - Session.set("listItemVal", findItemVal); - let listItemInfo = Products.find({ prodName: {$regex: findItemVal + '.*', $options: 'i'}}, { limit: 5 }).fetch(); + let listItemInfo = Products.find({ prodName: {$regex: findItemVal + '.*', $options: 'i'}}).fetch(); if (typeof listItemInfo != 'undefined' && listItemInfo != "" && listItemInfo != null) { - for (i=0; i < listItemInfo.length; i++) { - let item = listItemInfo[i].prodName; - let store = listItemInfo[i].prodStore; - listItemObj[item] = store; - } - Session.set("findListItems", listItemObj); + getDataList(listItemInfo); } - } }, 'click #filterOn' (event) { @@ -119,4 +109,10 @@ Template.listItemsForm.events({ event.preventDefault(); Session.set("filtering", false); } -}); \ No newline at end of file +}); + +getDataList = function(listItemInfo) { + let listItemObjArray = []; + listItemObjArray = listItemInfo.map(info => ({ id: info._id, text: info.prodName, store: info.prodStore })) + Session.set("findListItems", listItemObjArray); +} \ No newline at end of file diff --git a/client/ListItems/listItemsTbl.js b/client/ListItems/listItemsTbl.js index 9824770..177e03e 100644 --- a/client/ListItems/listItemsTbl.js +++ b/client/ListItems/listItemsTbl.js @@ -7,7 +7,8 @@ Template.listItemsTbl.onCreated(function() { }); Template.listItemsTbl.onRendered(function() { - $('.modal').modal(); + // new modal init here + // $('.modal').modal(); Session.set("showReceivedItems", false); Session.set("searchVal", ""); }); @@ -70,6 +71,8 @@ Template.listItemsTbl.events({ Session.set("method", "delete.listItem"); Session.set("item", this.itemName); Session.set("view", "List Items"); - $('#modalDelete').modal('open'); + + // put the new modal js here + // $('#modalDelete').modal('open'); }, }); \ No newline at end of file diff --git a/client/Lists/listsTbl.html b/client/Lists/listsTbl.html index 951bf17..8c82388 100644 --- a/client/Lists/listsTbl.html +++ b/client/Lists/listsTbl.html @@ -8,7 +8,7 @@ check {{/each}} -
  • + Add New List
  • + @@ -19,7 +19,7 @@ {{> listMgmtForm}} {{> snackbar}} diff --git a/client/Lists/listsTbl.js b/client/Lists/listsTbl.js index 6210c44..ff3f07a 100644 --- a/client/Lists/listsTbl.js +++ b/client/Lists/listsTbl.js @@ -1,11 +1,13 @@ import { Lists } from '../../imports/api/lists.js'; +import { M } from '../lib/assets/materialize.js'; Template.listsTbl.onCreated(function() { this.subscribe("myLists"); }); Template.listsTbl.onRendered(function() { - $('.modal').modal(); + var elems = document.querySelectorAll('.modal'); + var instances = M.Modal.init(elems, {}); }); Template.listsTbl.helpers({ @@ -21,7 +23,7 @@ Template.listsTbl.events({ if (sender.localName == "li" || sender.localName == "span") { let listId = event.currentTarget.id; if (listId == "addList") { - $('#modalList').modal('open'); + // $('#modalList').modal('open'); } else { // console.log("listId is: " + listId); Session.set("listId", listId); diff --git a/client/MainLayout.html b/client/MainLayout.html index 2f88bd4..2888ecc 100644 --- a/client/MainLayout.html +++ b/client/MainLayout.html @@ -1,8 +1,10 @@ diff --git a/client/MainLayout.js b/client/MainLayout.js index e3b6563..ef2bcff 100644 --- a/client/MainLayout.js +++ b/client/MainLayout.js @@ -1,11 +1,27 @@ - +import { UserConfig } from "../imports/api/userConfig"; Template.MainLayout.onCreated(function() { - + this.subscribe("UserConfigPrefs"); }); Template.MainLayout.onRendered(function() { - + this.autorun(() => { + let myId = Meteor.userId(); + let myprefs = UserConfig.findOne({ user: myId }); + if (typeof myprefs != 'undefined') { + if (myprefs.darkPref == "light") { + console.log("Found theme as light"); + // Session.set("myTheme", "light"); + document.documentElement.setAttribute('theme', "light"); + } else { + console.log("Found theme as dark"); + // Session.set("myTheme", "dark"); + document.documentElement.setAttribute('theme', "dark"); + } + } else { + console.log("User Prefs appear undefined."); + } + }); }); Template.MainLayout.helpers({ diff --git a/client/lib/assets/materialize.css b/client/lib/assets/materialize.css index dd78a40..c59b33a 100644 --- a/client/lib/assets/materialize.css +++ b/client/lib/assets/materialize.css @@ -1,8 +1,856 @@ /*! - * Materialize v1.1.0-alpha (https://materializecss.github.io/materialize) - * Copyright 2014-2021 Materialize + * Materialize v2.1.0 (https://materializeweb.com) + * Copyright 2014-2024 Materialize * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE) */ +@charset "UTF-8"; +:root { + --md-source: #006495; + /* primary */ + --md-ref-palette-primary0: #000000; + --md-ref-palette-primary10: #001e30; + --md-ref-palette-primary20: #003450; + --md-ref-palette-primary25: #003f60; + --md-ref-palette-primary30: #004b71; + --md-ref-palette-primary35: #005783; + --md-ref-palette-primary40: #006495; + --md-ref-palette-primary50: #0f7eb8; + --md-ref-palette-primary60: #3d98d4; + --md-ref-palette-primary70: #5db3f0; + --md-ref-palette-primary80: #8fcdff; + --md-ref-palette-primary90: #cbe6ff; + --md-ref-palette-primary95: #e6f2ff; + --md-ref-palette-primary98: #f7f9ff; + --md-ref-palette-primary99: #fcfcff; + --md-ref-palette-primary100: #ffffff; + /* secondary */ + --md-ref-palette-secondary0: #000000; + --md-ref-palette-secondary10: #0d1d29; + --md-ref-palette-secondary20: #22323f; + --md-ref-palette-secondary25: #2d3d4b; + --md-ref-palette-secondary30: #394856; + --md-ref-palette-secondary35: #445462; + --md-ref-palette-secondary40: #50606f; + --md-ref-palette-secondary50: #697988; + --md-ref-palette-secondary60: #8293a2; + --md-ref-palette-secondary70: #9dadbd; + --md-ref-palette-secondary80: #b8c8d9; + --md-ref-palette-secondary90: #d4e4f6; + --md-ref-palette-secondary95: #e6f2ff; + --md-ref-palette-secondary98: #f7f9ff; + --md-ref-palette-secondary99: #fcfcff; + --md-ref-palette-secondary100: #ffffff; + /* tertiary */ + --md-ref-palette-tertiary0: #000000; + --md-ref-palette-tertiary10: #211634; + --md-ref-palette-tertiary20: #362b4a; + --md-ref-palette-tertiary25: #423656; + --md-ref-palette-tertiary30: #4d4162; + --md-ref-palette-tertiary35: #594c6e; + --md-ref-palette-tertiary40: #66587b; + --md-ref-palette-tertiary50: #7f7195; + --md-ref-palette-tertiary60: #998ab0; + --md-ref-palette-tertiary70: #b4a4cb; + --md-ref-palette-tertiary80: #d0bfe7; + --md-ref-palette-tertiary90: #ecdcff; + --md-ref-palette-tertiary95: #f7edff; + --md-ref-palette-tertiary98: #fef7ff; + --md-ref-palette-tertiary99: #fffbff; + --md-ref-palette-tertiary100: #ffffff; + /* neutral */ + --md-ref-palette-neutral0: #000000; + --md-ref-palette-neutral10: #1a1c1e; + --md-ref-palette-neutral20: #2e3133; + --md-ref-palette-neutral25: #3a3c3e; + --md-ref-palette-neutral30: #454749; + --md-ref-palette-neutral35: #515255; + --md-ref-palette-neutral40: #5d5e61; + --md-ref-palette-neutral50: #76777a; + --md-ref-palette-neutral60: #8f9194; + --md-ref-palette-neutral70: #aaabae; + --md-ref-palette-neutral80: #c6c6c9; + --md-ref-palette-neutral90: #e2e2e5; + --md-ref-palette-neutral95: #f0f0f3; + --md-ref-palette-neutral98: #f9f9fc; + --md-ref-palette-neutral99: #fcfcff; + --md-ref-palette-neutral100: #ffffff; + /* neutral-variant */ + --md-ref-palette-neutral-variant0: #000000; + --md-ref-palette-neutral-variant10: #161c22; + --md-ref-palette-neutral-variant20: #2b3137; + --md-ref-palette-neutral-variant25: #363c42; + --md-ref-palette-neutral-variant30: #41474d; + --md-ref-palette-neutral-variant35: #4d5359; + --md-ref-palette-neutral-variant40: #595f65; + --md-ref-palette-neutral-variant50: #72787e; + --md-ref-palette-neutral-variant60: #8b9198; + --md-ref-palette-neutral-variant70: #a6acb3; + --md-ref-palette-neutral-variant80: #c1c7ce; + --md-ref-palette-neutral-variant90: #dee3ea; + --md-ref-palette-neutral-variant95: #ecf1f9; + --md-ref-palette-neutral-variant98: #f7f9ff; + --md-ref-palette-neutral-variant99: #fcfcff; + --md-ref-palette-neutral-variant100: #ffffff; + /* error */ + --md-ref-palette-error0: #000000; + --md-ref-palette-error10: #410002; + --md-ref-palette-error20: #690005; + --md-ref-palette-error25: #7e0007; + --md-ref-palette-error30: #93000a; + --md-ref-palette-error35: #a80710; + --md-ref-palette-error40: #ba1a1a; + --md-ref-palette-error50: #de3730; + --md-ref-palette-error60: #ff5449; + --md-ref-palette-error70: #ff897d; + --md-ref-palette-error80: #ffb4ab; + --md-ref-palette-error90: #ffdad6; + --md-ref-palette-error95: #ffedea; + --md-ref-palette-error98: #fff8f7; + --md-ref-palette-error99: #fffbff; + --md-ref-palette-error100: #ffffff; + /* light */ + --md-sys-color-primary-light: #006495; + --md-sys-color-on-primary-light: #ffffff; + --md-sys-color-primary-container-light: #cbe6ff; + --md-sys-color-on-primary-container-light: #001e30; + --md-sys-color-secondary-light: #50606f; + --md-sys-color-on-secondary-light: #ffffff; + --md-sys-color-secondary-container-light: #d4e4f6; + --md-sys-color-on-secondary-container-light: #0d1d29; + --md-sys-color-tertiary-light: #66587b; + --md-sys-color-on-tertiary-light: #ffffff; + --md-sys-color-tertiary-container-light: #ecdcff; + --md-sys-color-on-tertiary-container-light: #211634; + --md-sys-color-error-light: #ba1a1a; + --md-sys-color-error-container-light: #ffdad6; + --md-sys-color-on-error-light: #ffffff; + --md-sys-color-on-error-container-light: #410002; + --md-sys-color-background-light: #fcfcff; + --md-sys-color-on-background-light: #1a1c1e; + --md-sys-color-surface-light: #fcfcff; + --md-sys-color-on-surface-light: #1a1c1e; + --md-sys-color-surface-variant-light: #dee3ea; + --md-sys-color-on-surface-variant-light: #41474d; + --md-sys-color-outline-light: #72787e; + --md-sys-color-inverse-on-surface-light: #f0f0f3; + --md-sys-color-inverse-surface-light: #2e3133; + --md-sys-color-inverse-primary-light: #8fcdff; + --md-sys-color-shadow-light: #000000; + --md-sys-color-surface-tint-light: #006495; + --md-sys-color-outline-variant-light: #c1c7ce; + --md-sys-color-scrim-light: #000000; + /* dark */ + --md-sys-color-primary-dark: #8fcdff; + --md-sys-color-on-primary-dark: #003450; + --md-sys-color-primary-container-dark: #004b71; + --md-sys-color-on-primary-container-dark: #cbe6ff; + --md-sys-color-secondary-dark: #b8c8d9; + --md-sys-color-on-secondary-dark: #22323f; + --md-sys-color-secondary-container-dark: #394856; + --md-sys-color-on-secondary-container-dark: #d4e4f6; + --md-sys-color-tertiary-dark: #d0bfe7; + --md-sys-color-on-tertiary-dark: #362b4a; + --md-sys-color-tertiary-container-dark: #4d4162; + --md-sys-color-on-tertiary-container-dark: #ecdcff; + --md-sys-color-error-dark: #ffb4ab; + --md-sys-color-error-container-dark: #93000a; + --md-sys-color-on-error-dark: #690005; + --md-sys-color-on-error-container-dark: #ffdad6; + --md-sys-color-background-dark: #1a1c1e; + --md-sys-color-on-background-dark: #e2e2e5; + --md-sys-color-surface-dark: #1a1c1e; + --md-sys-color-on-surface-dark: #e2e2e5; + --md-sys-color-surface-variant-dark: #41474d; + --md-sys-color-on-surface-variant-dark: #c1c7ce; + --md-sys-color-outline-dark: #8b9198; + --md-sys-color-inverse-on-surface-dark: #1a1c1e; + --md-sys-color-inverse-surface-dark: #e2e2e5; + --md-sys-color-inverse-primary-dark: #006495; + --md-sys-color-shadow-dark: #000000; + --md-sys-color-surface-tint-dark: #8fcdff; + --md-sys-color-outline-variant-dark: #41474d; + --md-sys-color-scrim-dark: #000000; + /* display - large */ + --md-sys-typescale-display-large-font-family-name: Roboto; + --md-sys-typescale-display-large-font-family-style: Regular; + --md-sys-typescale-display-large-font-weight: 400px; + --md-sys-typescale-display-large-font-size: 57px; + --md-sys-typescale-display-large-line-height: 64px; + --md-sys-typescale-display-large-letter-spacing: -0.25px; + /* display - medium */ + --md-sys-typescale-display-medium-font-family-name: Roboto; + --md-sys-typescale-display-medium-font-family-style: Regular; + --md-sys-typescale-display-medium-font-weight: 400px; + --md-sys-typescale-display-medium-font-size: 45px; + --md-sys-typescale-display-medium-line-height: 52px; + --md-sys-typescale-display-medium-letter-spacing: 0px; + /* display - small */ + --md-sys-typescale-display-small-font-family-name: Roboto; + --md-sys-typescale-display-small-font-family-style: Regular; + --md-sys-typescale-display-small-font-weight: 400px; + --md-sys-typescale-display-small-font-size: 36px; + --md-sys-typescale-display-small-line-height: 44px; + --md-sys-typescale-display-small-letter-spacing: 0px; + /* headline - large */ + --md-sys-typescale-headline-large-font-family-name: Roboto; + --md-sys-typescale-headline-large-font-family-style: Regular; + --md-sys-typescale-headline-large-font-weight: 400px; + --md-sys-typescale-headline-large-font-size: 32px; + --md-sys-typescale-headline-large-line-height: 40px; + --md-sys-typescale-headline-large-letter-spacing: 0px; + /* headline - medium */ + --md-sys-typescale-headline-medium-font-family-name: Roboto; + --md-sys-typescale-headline-medium-font-family-style: Regular; + --md-sys-typescale-headline-medium-font-weight: 400px; + --md-sys-typescale-headline-medium-font-size: 28px; + --md-sys-typescale-headline-medium-line-height: 36px; + --md-sys-typescale-headline-medium-letter-spacing: 0px; + /* headline - small */ + --md-sys-typescale-headline-small-font-family-name: Roboto; + --md-sys-typescale-headline-small-font-family-style: Regular; + --md-sys-typescale-headline-small-font-weight: 400px; + --md-sys-typescale-headline-small-font-size: 24px; + --md-sys-typescale-headline-small-line-height: 32px; + --md-sys-typescale-headline-small-letter-spacing: 0px; + /* body - large */ + --md-sys-typescale-body-large-font-family-name: Roboto; + --md-sys-typescale-body-large-font-family-style: Regular; + --md-sys-typescale-body-large-font-weight: 400px; + --md-sys-typescale-body-large-font-size: 16px; + --md-sys-typescale-body-large-line-height: 24px; + --md-sys-typescale-body-large-letter-spacing: 0.50px; + /* body - medium */ + --md-sys-typescale-body-medium-font-family-name: Roboto; + --md-sys-typescale-body-medium-font-family-style: Regular; + --md-sys-typescale-body-medium-font-weight: 400px; + --md-sys-typescale-body-medium-font-size: 14px; + --md-sys-typescale-body-medium-line-height: 20px; + --md-sys-typescale-body-medium-letter-spacing: 0.25px; + /* body - small */ + --md-sys-typescale-body-small-font-family-name: Roboto; + --md-sys-typescale-body-small-font-family-style: Regular; + --md-sys-typescale-body-small-font-weight: 400px; + --md-sys-typescale-body-small-font-size: 12px; + --md-sys-typescale-body-small-line-height: 16px; + --md-sys-typescale-body-small-letter-spacing: 0.40px; + /* label - large */ + --md-sys-typescale-label-large-font-family-name: Roboto; + --md-sys-typescale-label-large-font-family-style: Medium; + --md-sys-typescale-label-large-font-weight: 500px; + --md-sys-typescale-label-large-font-size: 14px; + --md-sys-typescale-label-large-line-height: 20px; + --md-sys-typescale-label-large-letter-spacing: 0.10px; + /* label - medium */ + --md-sys-typescale-label-medium-font-family-name: Roboto; + --md-sys-typescale-label-medium-font-family-style: Medium; + --md-sys-typescale-label-medium-font-weight: 500px; + --md-sys-typescale-label-medium-font-size: 12px; + --md-sys-typescale-label-medium-line-height: 16px; + --md-sys-typescale-label-medium-letter-spacing: 0.50px; + /* label - small */ + --md-sys-typescale-label-small-font-family-name: Roboto; + --md-sys-typescale-label-small-font-family-style: Medium; + --md-sys-typescale-label-small-font-weight: 500px; + --md-sys-typescale-label-small-font-size: 11px; + --md-sys-typescale-label-small-line-height: 16px; + --md-sys-typescale-label-small-letter-spacing: 0.50px; + /* title - large */ + --md-sys-typescale-title-large-font-family-name: Roboto; + --md-sys-typescale-title-large-font-family-style: Regular; + --md-sys-typescale-title-large-font-weight: 400px; + --md-sys-typescale-title-large-font-size: 22px; + --md-sys-typescale-title-large-line-height: 28px; + --md-sys-typescale-title-large-letter-spacing: 0px; + /* title - medium */ + --md-sys-typescale-title-medium-font-family-name: Roboto; + --md-sys-typescale-title-medium-font-family-style: Medium; + --md-sys-typescale-title-medium-font-weight: 500px; + --md-sys-typescale-title-medium-font-size: 16px; + --md-sys-typescale-title-medium-line-height: 24px; + --md-sys-typescale-title-medium-letter-spacing: 0.15px; + /* title - small */ + --md-sys-typescale-title-small-font-family-name: Roboto; + --md-sys-typescale-title-small-font-family-style: Medium; + --md-sys-typescale-title-small-font-weight: 500px; + --md-sys-typescale-title-small-font-size: 14px; + --md-sys-typescale-title-small-line-height: 20px; + --md-sys-typescale-title-small-letter-spacing: 0.10px; +} + +/* System Defaults */ +:root, :host { + color-scheme: light; + --md-sys-color-primary: var(--md-sys-color-primary-light); + --md-sys-color-on-primary: var(--md-sys-color-on-primary-light); + --md-sys-color-primary-container: var(--md-sys-color-primary-container-light); + --md-sys-color-on-primary-container: var(--md-sys-color-on-primary-container-light); + --md-sys-color-secondary: var(--md-sys-color-secondary-light); + --md-sys-color-on-secondary: var(--md-sys-color-on-secondary-light); + --md-sys-color-secondary-container: var(--md-sys-color-secondary-container-light); + --md-sys-color-on-secondary-container: var(--md-sys-color-on-secondary-container-light); + --md-sys-color-tertiary: var(--md-sys-color-tertiary-light); + --md-sys-color-on-tertiary: var(--md-sys-color-on-tertiary-light); + --md-sys-color-tertiary-container: var(--md-sys-color-tertiary-container-light); + --md-sys-color-on-tertiary-container: var(--md-sys-color-on-tertiary-container-light); + --md-sys-color-error: var(--md-sys-color-error-light); + --md-sys-color-on-error: var(--md-sys-color-on-error-light); + --md-sys-color-error-container: var(--md-sys-color-error-container-light); + --md-sys-color-on-error-container: var(--md-sys-color-on-error-container-light); + --md-sys-color-outline: var(--md-sys-color-outline-light); + --md-sys-color-background: var(--md-sys-color-background-light); + --md-sys-color-on-background: var(--md-sys-color-on-background-light); + --md-sys-color-surface: var(--md-sys-color-surface-light); + --md-sys-color-on-surface: var(--md-sys-color-on-surface-light); + --md-sys-color-surface-variant: var(--md-sys-color-surface-variant-light); + --md-sys-color-on-surface-variant: var(--md-sys-color-on-surface-variant-light); + --md-sys-color-inverse-surface: var(--md-sys-color-inverse-surface-light); + --md-sys-color-inverse-on-surface: var(--md-sys-color-inverse-on-surface-light); + --md-sys-color-inverse-primary: var(--md-sys-color-inverse-primary-light); + --md-sys-color-shadow: var(--md-sys-color-shadow-light); + --md-sys-color-surface-tint: var(--md-sys-color-surface-tint-light); + --md-sys-color-outline-variant: var(--md-sys-color-outline-variant-light); + --md-sys-color-scrim: var(--md-sys-color-scrim-light); +} + +@media (prefers-color-scheme: dark) { + :root, :host { + color-scheme: dark; + --md-sys-color-primary: var(--md-sys-color-primary-dark); + --md-sys-color-on-primary: var(--md-sys-color-on-primary-dark); + --md-sys-color-primary-container: var(--md-sys-color-primary-container-dark); + --md-sys-color-on-primary-container: var(--md-sys-color-on-primary-container-dark); + --md-sys-color-secondary: var(--md-sys-color-secondary-dark); + --md-sys-color-on-secondary: var(--md-sys-color-on-secondary-dark); + --md-sys-color-secondary-container: var(--md-sys-color-secondary-container-dark); + --md-sys-color-on-secondary-container: var(--md-sys-color-on-secondary-container-dark); + --md-sys-color-tertiary: var(--md-sys-color-tertiary-dark); + --md-sys-color-on-tertiary: var(--md-sys-color-on-tertiary-dark); + --md-sys-color-tertiary-container: var(--md-sys-color-tertiary-container-dark); + --md-sys-color-on-tertiary-container: var(--md-sys-color-on-tertiary-container-dark); + --md-sys-color-error: var(--md-sys-color-error-dark); + --md-sys-color-on-error: var(--md-sys-color-on-error-dark); + --md-sys-color-error-container: var(--md-sys-color-error-container-dark); + --md-sys-color-on-error-container: var(--md-sys-color-on-error-container-dark); + --md-sys-color-outline: var(--md-sys-color-outline-dark); + --md-sys-color-background: var(--md-sys-color-background-dark); + --md-sys-color-on-background: var(--md-sys-color-on-background-dark); + --md-sys-color-surface: var(--md-sys-color-surface-dark); + --md-sys-color-on-surface: var(--md-sys-color-on-surface-dark); + --md-sys-color-surface-variant: var(--md-sys-color-surface-variant-dark); + --md-sys-color-on-surface-variant: var(--md-sys-color-on-surface-variant-dark); + --md-sys-color-inverse-surface: var(--md-sys-color-inverse-surface-dark); + --md-sys-color-inverse-on-surface: var(--md-sys-color-inverse-on-surface-dark); + --md-sys-color-inverse-primary: var(--md-sys-color-inverse-primary-dark); + --md-sys-color-shadow: var(--md-sys-color-shadow-dark); + --md-sys-color-surface-tint: var(--md-sys-color-surface-tint-dark); + --md-sys-color-outline-variant: var(--md-sys-color-outline-variant-dark); + --md-sys-color-scrim: var(--md-sys-color-scrim-dark); + } +} +/* ===================================================================== Themes */ +:root[theme=light] { + color-scheme: light; + --md-sys-color-primary: var(--md-sys-color-primary-light); + --md-sys-color-on-primary: var(--md-sys-color-on-primary-light); + --md-sys-color-primary-container: var(--md-sys-color-primary-container-light); + --md-sys-color-on-primary-container: var(--md-sys-color-on-primary-container-light); + --md-sys-color-secondary: var(--md-sys-color-secondary-light); + --md-sys-color-on-secondary: var(--md-sys-color-on-secondary-light); + --md-sys-color-secondary-container: var(--md-sys-color-secondary-container-light); + --md-sys-color-on-secondary-container: var(--md-sys-color-on-secondary-container-light); + --md-sys-color-tertiary: var(--md-sys-color-tertiary-light); + --md-sys-color-on-tertiary: var(--md-sys-color-on-tertiary-light); + --md-sys-color-tertiary-container: var(--md-sys-color-tertiary-container-light); + --md-sys-color-on-tertiary-container: var(--md-sys-color-on-tertiary-container-light); + --md-sys-color-error: var(--md-sys-color-error-light); + --md-sys-color-on-error: var(--md-sys-color-on-error-light); + --md-sys-color-error-container: var(--md-sys-color-error-container-light); + --md-sys-color-on-error-container: var(--md-sys-color-on-error-container-light); + --md-sys-color-outline: var(--md-sys-color-outline-light); + --md-sys-color-background: var(--md-sys-color-background-light); + --md-sys-color-on-background: var(--md-sys-color-on-background-light); + --md-sys-color-surface: var(--md-sys-color-surface-light); + --md-sys-color-on-surface: var(--md-sys-color-on-surface-light); + --md-sys-color-surface-variant: var(--md-sys-color-surface-variant-light); + --md-sys-color-on-surface-variant: var(--md-sys-color-on-surface-variant-light); + --md-sys-color-inverse-surface: var(--md-sys-color-inverse-surface-light); + --md-sys-color-inverse-on-surface: var(--md-sys-color-inverse-on-surface-light); + --md-sys-color-inverse-primary: var(--md-sys-color-inverse-primary-light); + --md-sys-color-shadow: var(--md-sys-color-shadow-light); + --md-sys-color-surface-tint: var(--md-sys-color-surface-tint-light); + --md-sys-color-outline-variant: var(--md-sys-color-outline-variant-light); + --md-sys-color-scrim: var(--md-sys-color-scrim-light); +} + +:root[theme=dark] { + color-scheme: dark; + --md-sys-color-primary: var(--md-sys-color-primary-dark); + --md-sys-color-on-primary: var(--md-sys-color-on-primary-dark); + --md-sys-color-primary-container: var(--md-sys-color-primary-container-dark); + --md-sys-color-on-primary-container: var(--md-sys-color-on-primary-container-dark); + --md-sys-color-secondary: var(--md-sys-color-secondary-dark); + --md-sys-color-on-secondary: var(--md-sys-color-on-secondary-dark); + --md-sys-color-secondary-container: var(--md-sys-color-secondary-container-dark); + --md-sys-color-on-secondary-container: var(--md-sys-color-on-secondary-container-dark); + --md-sys-color-tertiary: var(--md-sys-color-tertiary-dark); + --md-sys-color-on-tertiary: var(--md-sys-color-on-tertiary-dark); + --md-sys-color-tertiary-container: var(--md-sys-color-tertiary-container-dark); + --md-sys-color-on-tertiary-container: var(--md-sys-color-on-tertiary-container-dark); + --md-sys-color-error: var(--md-sys-color-error-dark); + --md-sys-color-on-error: var(--md-sys-color-on-error-dark); + --md-sys-color-error-container: var(--md-sys-color-error-container-dark); + --md-sys-color-on-error-container: var(--md-sys-color-on-error-container-dark); + --md-sys-color-outline: var(--md-sys-color-outline-dark); + --md-sys-color-background: var(--md-sys-color-background-dark); + --md-sys-color-on-background: var(--md-sys-color-on-background-dark); + --md-sys-color-surface: var(--md-sys-color-surface-dark); + --md-sys-color-on-surface: var(--md-sys-color-on-surface-dark); + --md-sys-color-surface-variant: var(--md-sys-color-surface-variant-dark); + --md-sys-color-on-surface-variant: var(--md-sys-color-on-surface-variant-dark); + --md-sys-color-inverse-surface: var(--md-sys-color-inverse-surface-dark); + --md-sys-color-inverse-on-surface: var(--md-sys-color-inverse-on-surface-dark); + --md-sys-color-inverse-primary: var(--md-sys-color-inverse-primary-dark); + --md-sys-color-shadow: var(--md-sys-color-shadow-dark); + --md-sys-color-surface-tint: var(--md-sys-color-surface-tint-dark); + --md-sys-color-outline-variant: var(--md-sys-color-outline-variant-dark); + --md-sys-color-scrim: var(--md-sys-color-scrim-dark); +} + +.primary { + background-color: var(--md-sys-color-primary); +} + +.primary-text { + color: var(--md-sys-color-primary); +} + +.on-primary { + background-color: var(--md-sys-color-on-primary); +} + +.on-primary-text { + color: var(--md-sys-color-on-primary); +} + +.primary-container { + background-color: var(--md-sys-color-primary-container); +} + +.primary-container-text { + color: var(--md-sys-color-primary-container); +} + +.on-primary-container { + background-color: var(--md-sys-color-on-primary-container); +} + +.on-primary-container-text { + color: var(--md-sys-color-on-primary-container); +} + +.secondary { + background-color: var(--md-sys-color-secondary); +} + +.secondary-text { + color: var(--md-sys-color-secondary); +} + +.on-secondary { + background-color: var(--md-sys-color-on-secondary); +} + +.on-secondary-text { + color: var(--md-sys-color-on-secondary); +} + +.secondary-container { + background-color: var(--md-sys-color-secondary-container); +} + +.secondary-container-text { + color: var(--md-sys-color-secondary-container); +} + +.on-secondary-container { + background-color: var(--md-sys-color-on-secondary-container); +} + +.on-secondary-container-text { + color: var(--md-sys-color-on-secondary-container); +} + +.tertiary { + background-color: var(--md-sys-color-tertiary); +} + +.tertiary-text { + color: var(--md-sys-color-tertiary); +} + +.on-tertiary { + background-color: var(--md-sys-color-on-tertiary); +} + +.on-tertiary-text { + color: var(--md-sys-color-on-tertiary); +} + +.tertiary-container { + background-color: var(--md-sys-color-tertiary-container); +} + +.tertiary-container-text { + color: var(--md-sys-color-tertiary-container); +} + +.on-tertiary-container { + background-color: var(--md-sys-color-on-tertiary-container); +} + +.on-tertiary-container-text { + color: var(--md-sys-color-on-tertiary-container); +} + +.error { + background-color: var(--md-sys-color-error); +} + +.error-text { + color: var(--md-sys-color-error); +} + +.on-error { + background-color: var(--md-sys-color-on-error); +} + +.on-error-text { + color: var(--md-sys-color-on-error); +} + +.error-container { + background-color: var(--md-sys-color-error-container); +} + +.error-container-text { + color: var(--md-sys-color-error-container); +} + +.on-error-container { + background-color: var(--md-sys-color-on-error-container); +} + +.on-error-container-text { + color: var(--md-sys-color-on-error-container); +} + +.background { + background-color: var(--md-sys-color-background); +} + +.background-text { + color: var(--md-sys-color-background); +} + +.on-background { + background-color: var(--md-sys-color-on-background); +} + +.on-background-text { + color: var(--md-sys-color-on-background); +} + +.surface, .switch label input[type=checkbox]:checked + .lever:after { + background-color: var(--md-sys-color-surface); +} + +.surface-text { + color: var(--md-sys-color-surface); +} + +.on-surface { + background-color: var(--md-sys-color-on-surface); +} + +.on-surface-text { + color: var(--md-sys-color-on-surface); +} + +.surface-variant, .progress, input[type=range]::-moz-range-track, input[type=range]::-webkit-slider-runnable-track { + background-color: var(--md-sys-color-surface-variant); +} + +.surface-variant-text { + color: var(--md-sys-color-surface-variant); +} + +.on-surface-variant { + background-color: var(--md-sys-color-on-surface-variant); +} + +.on-surface-variant-text, .chip > .material-icons { + color: var(--md-sys-color-on-surface-variant); +} + +.outline, .switch label .lever:after { + background-color: var(--md-sys-color-outline); +} + +.outline-text { + color: var(--md-sys-color-outline); +} + +.inverse-on-surface { + background-color: var(--md-sys-color-inverse-on-surface); +} + +.inverse-on-surface-text { + color: var(--md-sys-color-inverse-on-surface); +} + +.inverse-surface { + background-color: var(--md-sys-color-inverse-surface); +} + +.inverse-surface-text { + color: var(--md-sys-color-inverse-surface); +} + +.inverse-primary { + background-color: var(--md-sys-color-inverse-primary); +} + +.inverse-primary-text { + color: var(--md-sys-color-inverse-primary); +} + +.shadow { + background-color: var(--md-sys-color-shadow); +} + +.shadow-text { + color: var(--md-sys-color-shadow); +} + +.surface-tint { + background-color: var(--md-sys-color-surface-tint); +} + +.surface-tint-text { + color: var(--md-sys-color-surface-tint); +} + +.outline-variant { + background-color: var(--md-sys-color-outline-variant); +} + +.outline-variant-text { + color: var(--md-sys-color-outline-variant); +} + +.scrim { + background-color: var(--md-sys-color-scrim); +} + +.scrim-text { + color: var(--md-sys-color-scrim); +} + +.display-large { + font-family: var(--md-sys-typescale-display-large-font-family-name); + font-style: var(--md-sys-typescale-display-large-font-family-style); + font-weight: var(--md-sys-typescale-display-large-font-weight); + font-size: var(--md-sys-typescale-display-large-font-size); + letter-spacing: var(--md-sys-typescale-display-large-tracking); + line-height: var(--md-sys-typescale-display-large-height); + text-transform: var(--md-sys-typescale-display-large-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-display-large-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-display-large-text-decoration); + text-decoration: var(--md-sys-typescale-display-large-text-decoration); +} + +.display-medium { + font-family: var(--md-sys-typescale-display-medium-font-family-name); + font-style: var(--md-sys-typescale-display-medium-font-family-style); + font-weight: var(--md-sys-typescale-display-medium-font-weight); + font-size: var(--md-sys-typescale-display-medium-font-size); + letter-spacing: var(--md-sys-typescale-display-medium-tracking); + line-height: var(--md-sys-typescale-display-medium-height); + text-transform: var(--md-sys-typescale-display-medium-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-display-medium-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-display-medium-text-decoration); + text-decoration: var(--md-sys-typescale-display-medium-text-decoration); +} + +.display-small { + font-family: var(--md-sys-typescale-display-small-font-family-name); + font-style: var(--md-sys-typescale-display-small-font-family-style); + font-weight: var(--md-sys-typescale-display-small-font-weight); + font-size: var(--md-sys-typescale-display-small-font-size); + letter-spacing: var(--md-sys-typescale-display-small-tracking); + line-height: var(--md-sys-typescale-display-small-height); + text-transform: var(--md-sys-typescale-display-small-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-display-small-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-display-small-text-decoration); + text-decoration: var(--md-sys-typescale-display-small-text-decoration); +} + +.headline-large { + font-family: var(--md-sys-typescale-headline-large-font-family-name); + font-style: var(--md-sys-typescale-headline-large-font-family-style); + font-weight: var(--md-sys-typescale-headline-large-font-weight); + font-size: var(--md-sys-typescale-headline-large-font-size); + letter-spacing: var(--md-sys-typescale-headline-large-tracking); + line-height: var(--md-sys-typescale-headline-large-height); + text-transform: var(--md-sys-typescale-headline-large-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-headline-large-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-headline-large-text-decoration); + text-decoration: var(--md-sys-typescale-headline-large-text-decoration); +} + +.headline-medium { + font-family: var(--md-sys-typescale-headline-medium-font-family-name); + font-style: var(--md-sys-typescale-headline-medium-font-family-style); + font-weight: var(--md-sys-typescale-headline-medium-font-weight); + font-size: var(--md-sys-typescale-headline-medium-font-size); + letter-spacing: var(--md-sys-typescale-headline-medium-tracking); + line-height: var(--md-sys-typescale-headline-medium-height); + text-transform: var(--md-sys-typescale-headline-medium-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-headline-medium-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-headline-medium-text-decoration); + text-decoration: var(--md-sys-typescale-headline-medium-text-decoration); +} + +.headline-small { + font-family: var(--md-sys-typescale-headline-small-font-family-name); + font-style: var(--md-sys-typescale-headline-small-font-family-style); + font-weight: var(--md-sys-typescale-headline-small-font-weight); + font-size: var(--md-sys-typescale-headline-small-font-size); + letter-spacing: var(--md-sys-typescale-headline-small-tracking); + line-height: var(--md-sys-typescale-headline-small-height); + text-transform: var(--md-sys-typescale-headline-small-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-headline-small-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-headline-small-text-decoration); + text-decoration: var(--md-sys-typescale-headline-small-text-decoration); +} + +.body-large { + font-family: var(--md-sys-typescale-body-large-font-family-name); + font-style: var(--md-sys-typescale-body-large-font-family-style); + font-weight: var(--md-sys-typescale-body-large-font-weight); + font-size: var(--md-sys-typescale-body-large-font-size); + letter-spacing: var(--md-sys-typescale-body-large-tracking); + line-height: var(--md-sys-typescale-body-large-height); + text-transform: var(--md-sys-typescale-body-large-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-body-large-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-body-large-text-decoration); + text-decoration: var(--md-sys-typescale-body-large-text-decoration); +} + +.body-medium { + font-family: var(--md-sys-typescale-body-medium-font-family-name); + font-style: var(--md-sys-typescale-body-medium-font-family-style); + font-weight: var(--md-sys-typescale-body-medium-font-weight); + font-size: var(--md-sys-typescale-body-medium-font-size); + letter-spacing: var(--md-sys-typescale-body-medium-tracking); + line-height: var(--md-sys-typescale-body-medium-height); + text-transform: var(--md-sys-typescale-body-medium-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-body-medium-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-body-medium-text-decoration); + text-decoration: var(--md-sys-typescale-body-medium-text-decoration); +} + +.body-small { + font-family: var(--md-sys-typescale-body-small-font-family-name); + font-style: var(--md-sys-typescale-body-small-font-family-style); + font-weight: var(--md-sys-typescale-body-small-font-weight); + font-size: var(--md-sys-typescale-body-small-font-size); + letter-spacing: var(--md-sys-typescale-body-small-tracking); + line-height: var(--md-sys-typescale-body-small-height); + text-transform: var(--md-sys-typescale-body-small-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-body-small-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-body-small-text-decoration); + text-decoration: var(--md-sys-typescale-body-small-text-decoration); +} + +.label-large { + font-family: var(--md-sys-typescale-label-large-font-family-name); + font-style: var(--md-sys-typescale-label-large-font-family-style); + font-weight: var(--md-sys-typescale-label-large-font-weight); + font-size: var(--md-sys-typescale-label-large-font-size); + letter-spacing: var(--md-sys-typescale-label-large-tracking); + line-height: var(--md-sys-typescale-label-large-height); + text-transform: var(--md-sys-typescale-label-large-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-label-large-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-label-large-text-decoration); + text-decoration: var(--md-sys-typescale-label-large-text-decoration); +} + +.label-medium { + font-family: var(--md-sys-typescale-label-medium-font-family-name); + font-style: var(--md-sys-typescale-label-medium-font-family-style); + font-weight: var(--md-sys-typescale-label-medium-font-weight); + font-size: var(--md-sys-typescale-label-medium-font-size); + letter-spacing: var(--md-sys-typescale-label-medium-tracking); + line-height: var(--md-sys-typescale-label-medium-height); + text-transform: var(--md-sys-typescale-label-medium-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-label-medium-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-label-medium-text-decoration); + text-decoration: var(--md-sys-typescale-label-medium-text-decoration); +} + +.label-small { + font-family: var(--md-sys-typescale-label-small-font-family-name); + font-style: var(--md-sys-typescale-label-small-font-family-style); + font-weight: var(--md-sys-typescale-label-small-font-weight); + font-size: var(--md-sys-typescale-label-small-font-size); + letter-spacing: var(--md-sys-typescale-label-small-tracking); + line-height: var(--md-sys-typescale-label-small-height); + text-transform: var(--md-sys-typescale-label-small-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-label-small-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-label-small-text-decoration); + text-decoration: var(--md-sys-typescale-label-small-text-decoration); +} + +.title-large { + font-family: var(--md-sys-typescale-title-large-font-family-name); + font-style: var(--md-sys-typescale-title-large-font-family-style); + font-weight: var(--md-sys-typescale-title-large-font-weight); + font-size: var(--md-sys-typescale-title-large-font-size); + letter-spacing: var(--md-sys-typescale-title-large-tracking); + line-height: var(--md-sys-typescale-title-large-height); + text-transform: var(--md-sys-typescale-title-large-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-title-large-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-title-large-text-decoration); + text-decoration: var(--md-sys-typescale-title-large-text-decoration); +} + +.title-medium { + font-family: var(--md-sys-typescale-title-medium-font-family-name); + font-style: var(--md-sys-typescale-title-medium-font-family-style); + font-weight: var(--md-sys-typescale-title-medium-font-weight); + font-size: var(--md-sys-typescale-title-medium-font-size); + letter-spacing: var(--md-sys-typescale-title-medium-tracking); + line-height: var(--md-sys-typescale-title-medium-height); + text-transform: var(--md-sys-typescale-title-medium-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-title-medium-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-title-medium-text-decoration); + text-decoration: var(--md-sys-typescale-title-medium-text-decoration); +} + +.title-small { + font-family: var(--md-sys-typescale-title-small-font-family-name); + font-style: var(--md-sys-typescale-title-small-font-family-style); + font-weight: var(--md-sys-typescale-title-small-font-weight); + font-size: var(--md-sys-typescale-title-small-font-size); + letter-spacing: var(--md-sys-typescale-title-small-tracking); + line-height: var(--md-sys-typescale-title-small-height); + text-transform: var(--md-sys-typescale-title-small-text-transform); + -webkit-text-decoration: var(--md-sys-typescale-title-small-text-decoration); + -moz-text-decoration: var(--md-sys-typescale-title-small-text-decoration); + text-decoration: var(--md-sys-typescale-title-small-text-decoration); +} + .materialize-red { background-color: #e51c23 !important; } @@ -2139,41 +2987,31 @@ color: transparent !important; } -/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ /* Document ========================================================================== */ /** * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in - * IE on Windows Phone and in iOS. + * 2. Prevent adjustments of font size after orientation changes in iOS. */ html { - line-height: 1.15; - /* 1 */ - -ms-text-size-adjust: 100%; - /* 2 */ - -webkit-text-size-adjust: 100%; - /* 2 */ + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ } /* Sections ========================================================================== */ /** - * Remove the margin in all browsers (opinionated). + * Remove the margin in all browsers. */ body { margin: 0; } /** - * Add the correct display in IE 9-. + * Render the `main` element consistently in IE. */ -article, -aside, -footer, -header, -nav, -section { +main { display: block; } @@ -2188,36 +3026,15 @@ h1 { /* Grouping content ========================================================================== */ -/** - * Add the correct display in IE 9-. - * 1. Add the correct display in IE. - */ -figcaption, -figure, -main { - /* 1 */ - display: block; -} - -/** - * Add the correct margin in IE 8. - */ -figure { - margin: 1em 40px; -} - /** * 1. Add the correct box sizing in Firefox. * 2. Show the overflow in Edge and IE. */ hr { -webkit-box-sizing: content-box; - box-sizing: content-box; - /* 1 */ - height: 0; - /* 1 */ - overflow: visible; - /* 2 */ + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ } /** @@ -2225,46 +3042,29 @@ hr { * 2. Correct the odd `em` font sizing in all browsers. */ pre { - font-family: monospace, monospace; - /* 1 */ - font-size: 1em; - /* 2 */ + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ } /* Text-level semantics ========================================================================== */ /** - * 1. Remove the gray background on active links in IE 10. - * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + * Remove the gray background on active links in IE 10. */ a { background-color: transparent; - /* 1 */ - -webkit-text-decoration-skip: objects; - /* 2 */ } /** - * 1. Remove the bottom border in Chrome 57- and Firefox 39-. + * 1. Remove the bottom border in Chrome 57- * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. */ abbr[title] { - border-bottom: none; - /* 1 */ - text-decoration: underline; - /* 2 */ + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ -webkit-text-decoration: underline dotted; -moz-text-decoration: underline dotted; - text-decoration: underline dotted; - /* 2 */ -} - -/** - * Prevent the duplicate application of `bolder` by the next rule in Safari 6. - */ -b, -strong { - font-weight: inherit; + text-decoration: underline dotted; /* 2 */ } /** @@ -2282,25 +3082,8 @@ strong { code, kbd, samp { - font-family: monospace, monospace; - /* 1 */ - font-size: 1em; - /* 2 */ -} - -/** - * Add the correct font style in Android 4.3-. - */ -dfn { - font-style: italic; -} - -/** - * Add the correct background and color in IE 9-. - */ -mark { - background-color: #ff0; - color: #000; + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ } /** @@ -2333,39 +3116,16 @@ sup { /* Embedded content ========================================================================== */ /** - * Add the correct display in IE 9-. - */ -audio, -video { - display: inline-block; -} - -/** - * Add the correct display in iOS 4-7. - */ -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Remove the border on images inside links in IE 10-. + * Remove the border on images inside links in IE 10. */ img { border-style: none; } -/** - * Hide the overflow in IE. - */ -svg:not(:root) { - overflow: hidden; -} - /* Forms ========================================================================== */ /** - * 1. Change the font styles in all browsers (opinionated). + * 1. Change the font styles in all browsers. * 2. Remove the margin in Firefox and Safari. */ button, @@ -2373,14 +3133,10 @@ input, optgroup, select, textarea { - font-family: sans-serif; - /* 1 */ - font-size: 100%; - /* 1 */ - line-height: 1.15; - /* 1 */ - margin: 0; - /* 2 */ + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ } /** @@ -2388,8 +3144,7 @@ textarea { * 1. Show the overflow in Edge. */ button, -input { - /* 1 */ +input { /* 1 */ overflow: visible; } @@ -2398,31 +3153,27 @@ input { * 1. Remove the inheritance of text transform in Firefox. */ button, -select { - /* 1 */ +select { /* 1 */ text-transform: none; } /** - * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` - * controls in Android 4. - * 2. Correct the inability to style clickable types in iOS and Safari. + * Correct the inability to style clickable types in iOS and Safari. */ button, -html [type="button"], -[type="reset"], -[type="submit"] { +[type=button], +[type=reset], +[type=submit] { -webkit-appearance: button; - /* 2 */ } /** * Remove the inner border and padding in Firefox. */ button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { +[type=button]::-moz-focus-inner, +[type=reset]::-moz-focus-inner, +[type=submit]::-moz-focus-inner { border-style: none; padding: 0; } @@ -2431,9 +3182,9 @@ button::-moz-focus-inner, * Restore the focus styles unset by the previous rule. */ button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { +[type=button]:-moz-focusring, +[type=reset]:-moz-focusring, +[type=submit]:-moz-focusring { outline: 1px dotted ButtonText; } @@ -2452,56 +3203,44 @@ fieldset { */ legend { -webkit-box-sizing: border-box; - box-sizing: border-box; - /* 1 */ - color: inherit; - /* 2 */ - display: table; - /* 1 */ - max-width: 100%; - /* 1 */ - padding: 0; - /* 3 */ - white-space: normal; - /* 1 */ + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ } /** - * 1. Add the correct display in IE 9-. - * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + * Add the correct vertical alignment in Chrome, Firefox, and Opera. */ progress { - display: inline-block; - /* 1 */ vertical-align: baseline; - /* 2 */ } /** - * Remove the default vertical scrollbar in IE. + * Remove the default vertical scrollbar in IE 10+. */ textarea { overflow: auto; } /** - * 1. Add the correct box sizing in IE 10-. - * 2. Remove the padding in IE 10-. + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. */ -[type="checkbox"], -[type="radio"] { +[type=checkbox], +[type=radio] { -webkit-box-sizing: border-box; - box-sizing: border-box; - /* 1 */ - padding: 0; - /* 2 */ + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ } /** * Correct the cursor style of increment and decrement buttons in Chrome. */ -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { +[type=number]::-webkit-inner-spin-button, +[type=number]::-webkit-outer-spin-button { height: auto; } @@ -2509,18 +3248,15 @@ textarea { * 1. Correct the odd appearance in Chrome and Safari. * 2. Correct the outline style in Safari. */ -[type="search"] { - -webkit-appearance: textfield; - /* 1 */ - outline-offset: -2px; - /* 2 */ +[type=search] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ } /** - * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. + * Remove the inner padding in Chrome and Safari on macOS. */ -[type="search"]::-webkit-search-cancel-button, -[type="search"]::-webkit-search-decoration { +[type=search]::-webkit-search-decoration { -webkit-appearance: none; } @@ -2529,20 +3265,16 @@ textarea { * 2. Change font properties to `inherit` in Safari. */ ::-webkit-file-upload-button { - -webkit-appearance: button; - /* 1 */ - font: inherit; - /* 2 */ + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ } /* Interactive ========================================================================== */ /* - * Add the correct display in IE 9-. - * 1. Add the correct display in Edge, IE, and Firefox. + * Add the correct display in Edge, IE 10+, and Firefox. */ -details, -menu { +details { display: block; } @@ -2553,26 +3285,17 @@ summary { display: list-item; } -/* Scripting +/* Misc ========================================================================== */ /** - * Add the correct display in IE 9-. - */ -canvas { - display: inline-block; -} - -/** - * Add the correct display in IE. + * Add the correct display in IE 10+. */ template { display: none; } -/* Hidden - ========================================================================== */ /** - * Add the correct display in IE 10-. + * Add the correct display in IE 10. */ [hidden] { display: none; @@ -2588,6 +3311,11 @@ html { box-sizing: inherit; } +body { + background-color: var(--md-sys-color-background); + color: var(--md-sys-color-on-background); +} + button, input, optgroup, @@ -2596,15 +3324,6 @@ textarea { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } -ul:not(.browser-default) { - padding-left: 0; - list-style-type: none; -} - -ul:not(.browser-default) > li { - list-style-type: none; -} - a { color: #039be5; text-decoration: none; @@ -2626,30 +3345,32 @@ a { clear: both; } -.z-depth-0 { +.z-depth-0, .btn:focus.tonal, .btn-small:focus.tonal, .btn-large:focus.tonal, .btn:focus.filled, .btn-small:focus.filled, .btn-large:focus.filled, .btn.disabled, .btn-floating.disabled, .btn-large.disabled, .btn-small.disabled, .btn-flat.disabled, +.btn:disabled, .btn-floating:disabled, .btn-large:disabled, .btn-small:disabled, .btn-flat:disabled, +.btn[disabled], .btn-floating[disabled], .btn-large[disabled], .btn-small[disabled], .btn-flat[disabled], .btn.text, .text.btn-small, .text.btn-large, .btn-flat { -webkit-box-shadow: none !important; box-shadow: none !important; } /* 2dp elevation modified*/ -.z-depth-1, nav, .card-panel, .card, .toast, .btn, .btn-large, .btn-small, .btn-floating, .dropdown-content, .collapsible, .sidenav { +.z-depth-1, .sidenav, .collapsible, .dropdown-content, .btn-floating, .btn:focus.elevated, .btn-small:focus.elevated, .btn-large:focus.elevated, .btn.tonal:hover, .tonal.btn-small:hover, .tonal.btn-large:hover, .btn.filled:hover, .filled.btn-small:hover, .filled.btn-large:hover, .btn.elevated, .elevated.btn-small, .elevated.btn-large, .card, .card-panel, nav { -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2); box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2); } -.z-depth-1-half, .btn:hover, .btn-large:hover, .btn-small:hover, .btn-floating:hover { +.z-depth-1-half, .btn-floating:focus, .btn-floating:hover { -webkit-box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2); box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2); } /* 6dp elevation modified*/ -.z-depth-2 { +.z-depth-2, .btn.elevated:hover, .elevated.btn-small:hover, .elevated.btn-large:hover { -webkit-box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3); box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3); } /* 12dp elevation modified*/ -.z-depth-3 { +.z-depth-3, .toast { -webkit-box-shadow: 0 8px 17px 2px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); box-shadow: 0 8px 17px 2px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); } @@ -2667,12 +3388,11 @@ a { } .hoverable { - -webkit-transition: -webkit-box-shadow .25s; - transition: -webkit-box-shadow .25s; - transition: box-shadow .25s; - transition: box-shadow .25s, -webkit-box-shadow .25s; + -webkit-transition: -webkit-box-shadow 0.25s; + transition: -webkit-box-shadow 0.25s; + transition: box-shadow 0.25s; + transition: box-shadow 0.25s, -webkit-box-shadow 0.25s; } - .hoverable:hover { -webkit-box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); @@ -2681,45 +3401,44 @@ a { .divider { height: 1px; overflow: hidden; - background-color: #e0e0e0; + background-color: var(--md-sys-color-outline-variant); } blockquote { margin: 20px 0; padding-left: 1.5rem; - border-left: 5px solid #ee6e73; + border-left: 5px solid var(--md-sys-color-primary); } i { line-height: inherit; } - i.left { float: left; - margin-right: 15px; + margin-left: -8px; } - i.right { float: right; - margin-left: 15px; } - i.tiny { font-size: 1rem; } - i.small { font-size: 2rem; } - i.medium { font-size: 4rem; } - i.large { font-size: 6rem; } +html.noscroll { + position: fixed; + overflow-y: scroll; + width: 100%; +} + img.responsive-img, video.responsive-video { max-width: 100%; @@ -2733,38 +3452,35 @@ video.responsive-video { vertical-align: top; height: 30px; } - .pagination li a { - color: #444; + color: var(--md-sys-color-on-surface-variant); display: inline-block; font-size: 1.2rem; padding: 0 10px; line-height: 30px; } - +.pagination li:hover:not(.disabled) { + background-color: rgba(var(--md-sys-color-primary-numeric), 0.06); +} .pagination li.active a { - color: #fff; + color: var(--md-sys-color-on-primary); } - -.pagination li.active { - background-color: #ee6e73; +.pagination li.active, .pagination li.active:hover { + background-color: var(--md-sys-color-primary); } - .pagination li.disabled a { cursor: default; - color: #999; + color: var(--md-sys-color-on-surface); } - .pagination li i { font-size: 2rem; } - .pagination li.pages ul li { display: inline-block; float: none; } -@media only screen and (max-width: 992.99px) { +@media only screen and (max-width : 992.99px) { .pagination { width: 100%; } @@ -2778,27 +3494,25 @@ video.responsive-video { white-space: nowrap; } } - .breadcrumb { display: inline-block; font-size: 18px; - color: rgba(255, 255, 255, 0.7); + color: var(--font-on-primary-color-medium); } - .breadcrumb i, -.breadcrumb [class^="mdi-"], .breadcrumb [class*="mdi-"], -.breadcrumb i.material-icons { - display: inline-block; +.breadcrumb [class^=mdi-], .breadcrumb [class*=mdi-], +.breadcrumb i.material-icons, .breadcrumb i.material-symbols-outlined, +.breadcrumb i.material-symbols-rounded, .breadcrumb i.material-symbols-sharp { + display: block; float: left; font-size: 24px; } - .breadcrumb:before { - content: '\E5CC'; - color: rgba(255, 255, 255, 0.7); + content: "\e5cc"; + color: var(--font-on-primary-color-medium); vertical-align: top; display: inline-block; - font-family: 'Material Icons'; + font-family: "Material Symbols Outlined", "Material Symbols Rounded", "Material Symbols Sharp", "Material Icons"; font-weight: normal; font-style: normal; font-size: 25px; @@ -2806,13 +3520,11 @@ video.responsive-video { -webkit-font-smoothing: antialiased; float: left; } - .breadcrumb:first-child:before { display: none; } - .breadcrumb:last-child { - color: #fff; + color: var(--md-sys-color-on-primary); } .parallax-container { @@ -2820,7 +3532,6 @@ video.responsive-video { overflow: hidden; height: 500px; } - .parallax-container .parallax { position: absolute; top: 0; @@ -2829,7 +3540,6 @@ video.responsive-video { bottom: 0; z-index: -1; } - .parallax-container .parallax img { opacity: 0; position: absolute; @@ -2867,19 +3577,19 @@ ul.staggered-list li { /********************* Media Query Classes **********************/ -@media only screen and (max-width: 600.99px) { +@media only screen and (max-width : 600.99px) { .hide-on-small-only, .hide-on-small-and-down { display: none !important; } } -@media only screen and (max-width: 992.99px) { +@media only screen and (max-width : 992.99px) { .hide-on-med-and-down { display: none !important; } } -@media only screen and (min-width: 601px) { +@media only screen and (min-width : 601px) { .hide-on-med-and-up { display: none !important; } @@ -2891,25 +3601,25 @@ ul.staggered-list li { } } -@media only screen and (min-width: 993px) { +@media only screen and (min-width : 993px) { .hide-on-large-only { display: none !important; } } -@media only screen and (min-width: 1201px) { +@media only screen and (min-width : 1201px) { .hide-on-extra-large-only { display: none !important; } } -@media only screen and (min-width: 1201px) { +@media only screen and (min-width : 1201px) { .show-on-extra-large { display: block !important; } } -@media only screen and (min-width: 993px) { +@media only screen and (min-width : 993px) { .show-on-large { display: block !important; } @@ -2921,37 +3631,43 @@ ul.staggered-list li { } } -@media only screen and (max-width: 600.99px) { +@media only screen and (max-width : 600.99px) { .show-on-small { display: block !important; } } -@media only screen and (min-width: 601px) { +@media only screen and (min-width : 601px) { .show-on-medium-and-up { display: block !important; } } -@media only screen and (max-width: 992.99px) { +@media only screen and (max-width : 992.99px) { .show-on-medium-and-down { display: block !important; } } -@media only screen and (max-width: 600.99px) { +@media only screen and (max-width : 600.99px) { .center-on-small-only { text-align: center; } } .page-footer { - padding-top: 20px; - color: #fff; - background-color: #ee6e73; + margin-top: 5rem; + padding-top: 3rem; + border-top: 1px dashed var(--md-sys-color-outline-variant); } - -.page-footer .footer-copyright { +.page-footer p { + color: var(--md-sys-color-outline-light); +} +.page-footer a { + color: var(--md-sys-color-primary); +} +.page-footer .footer-copyright, +.page-footer .footer-copyright a { overflow: hidden; min-height: 50px; display: -webkit-box; @@ -2967,8 +3683,11 @@ ul.staggered-list li { -ms-flex-pack: justify; justify-content: space-between; padding: 10px 0px; - color: rgba(255, 255, 255, 0.8); - background-color: rgba(51, 51, 51, 0.08); +} + +.page-footer ul { + padding-left: 0; + list-style-type: none; } table, th, td { @@ -2981,34 +3700,28 @@ table { border-collapse: collapse; border-spacing: 0; } - table.striped tr { border-bottom: none; } - -table.striped > tbody > tr:nth-child(odd) { - background-color: rgba(242, 242, 242, 0.5); +table.striped tbody > tr:nth-child(odd) { + background-color: rgba(0, 0, 0, 0.08); } - -table.striped > tbody > tr > td { - border-radius: 0; -} - table.highlight > tbody > tr { - -webkit-transition: background-color .25s ease; - transition: background-color .25s ease; + -webkit-transition: background-color 0.25s ease; + transition: background-color 0.25s ease; } - table.highlight > tbody > tr:hover { - background-color: rgba(242, 242, 242, 0.5); + background-color: rgba(0, 0, 0, 0.04); +} +table thead { + color: var(--md-sys-color-on-surface-variant); } - table.centered thead tr th, table.centered tbody tr td { text-align: center; } tr { - border-bottom: 1px solid rgba(0, 0, 0, 0.12); + border-bottom: 1px solid var(--md-sys-color-outline-variant); } td, th { @@ -3016,10 +3729,10 @@ td, th { display: table-cell; text-align: left; vertical-align: middle; - border-radius: 2px; + border-radius: 0; } -@media only screen and (max-width: 992.99px) { +@media only screen and (max-width : 992.99px) { table.responsive-table { width: 100%; border-collapse: collapse; @@ -3029,7 +3742,7 @@ td, th { /* sort out borders */ } table.responsive-table td:empty:before { - content: '\00a0'; + content: " "; } table.responsive-table th, table.responsive-table td { @@ -3048,7 +3761,7 @@ td, th { padding: 0 10px 0 0; } table.responsive-table thead tr th::before { - content: "\00a0"; + content: " "; } table.responsive-table tbody { display: block; @@ -3076,120 +3789,15 @@ td, th { } table.responsive-table thead { border: 0; - border-right: 1px solid rgba(0, 0, 0, 0.12); + border-right: 1px solid var(--md-sys-color-outline-variant); } } - -.collection { - margin: 0.5rem 0 1rem 0; - border: 1px solid #e0e0e0; - border-radius: 2px; - overflow: hidden; - position: relative; -} - -.collection .collection-item { - background-color: #fff; - line-height: 1.5rem; - padding: 10px 20px; - margin: 0; - border-bottom: 1px solid #e0e0e0; -} - -.collection .collection-item.avatar { - min-height: 84px; - padding-left: 72px; - position: relative; -} - -.collection .collection-item.avatar:not(.circle-clipper) > .circle, -.collection .collection-item.avatar :not(.circle-clipper) > .circle { - position: absolute; - width: 42px; - height: 42px; - overflow: hidden; - left: 15px; - display: inline-block; - vertical-align: middle; -} - -.collection .collection-item.avatar i.circle { - font-size: 18px; - line-height: 42px; - color: #fff; - background-color: #999; - text-align: center; -} - -.collection .collection-item.avatar .title { - font-size: 16px; -} - -.collection .collection-item.avatar p { - margin: 0; -} - -.collection .collection-item.avatar .secondary-content { - position: absolute; - top: 16px; - right: 16px; -} - -.collection .collection-item:last-child { - border-bottom: none; -} - -.collection .collection-item.active { - background-color: #26a69a; - color: #eafaf9; -} - -.collection .collection-item.active .secondary-content { - color: #fff; -} - -.collection a.collection-item { - display: block; - -webkit-transition: .25s; - transition: .25s; - color: #26a69a; -} - -.collection a.collection-item:not(.active):hover { - background-color: #ddd; -} - -.collection.with-header .collection-header { - background-color: #fff; - border-bottom: 1px solid #e0e0e0; - padding: 10px 20px; -} - -.collection.with-header .collection-item { - padding-left: 30px; -} - -.collection.with-header .collection-item.avatar { - padding-left: 72px; -} - -.secondary-content { - float: right; - color: #26a69a; -} - -.collapsible .collection { - margin: 0; - border: none; -} - .video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; } - .video-container iframe, .video-container object, .video-container embed { position: absolute; top: 0; @@ -3198,117 +3806,6 @@ td, th { height: 100%; } -.progress { - position: relative; - height: 4px; - display: block; - width: 100%; - background-color: #acece6; - border-radius: 2px; - margin: 0.5rem 0 1rem 0; - overflow: hidden; -} - -.progress .determinate { - position: absolute; - top: 0; - left: 0; - bottom: 0; - background-color: #26a69a; - -webkit-transition: width .3s linear; - transition: width .3s linear; -} - -.progress .indeterminate { - background-color: #26a69a; -} - -.progress .indeterminate:before { - content: ''; - position: absolute; - background-color: inherit; - top: 0; - left: 0; - bottom: 0; - will-change: left, right; - -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; - animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; -} - -.progress .indeterminate:after { - content: ''; - position: absolute; - background-color: inherit; - top: 0; - left: 0; - bottom: 0; - will-change: left, right; - -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; - animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; - -webkit-animation-delay: 1.15s; - animation-delay: 1.15s; -} - -@-webkit-keyframes indeterminate { - 0% { - left: -35%; - right: 100%; - } - 60% { - left: 100%; - right: -90%; - } - 100% { - left: 100%; - right: -90%; - } -} - -@keyframes indeterminate { - 0% { - left: -35%; - right: 100%; - } - 60% { - left: 100%; - right: -90%; - } - 100% { - left: 100%; - right: -90%; - } -} - -@-webkit-keyframes indeterminate-short { - 0% { - left: -200%; - right: 100%; - } - 60% { - left: 107%; - right: -8%; - } - 100% { - left: 107%; - right: -8%; - } -} - -@keyframes indeterminate-short { - 0% { - left: -200%; - right: 100%; - } - 60% { - left: 107%; - right: -8%; - } - 100% { - left: 107%; - right: -8%; - } -} - /******************* Utility Classes *******************/ @@ -3365,55 +3862,637 @@ input[type=range] + .thumb { padding: 0 !important; } +/************************** + Utility Spacing Classes +**************************/ +.m-0 { + margin: 0 !important; +} + +.mt-0 { + margin-top: 0 !important; +} + +.mr-0 { + margin-right: 0 !important; +} + +.mb-0 { + margin-bottom: 0 !important; +} + +.ml-0 { + margin-left: 0 !important; +} + +.mx-0 { + margin-left: 0 !important; + margin-right: 0 !important; +} + +.my-0 { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +.m-1 { + margin: 0.25rem !important; +} + +.mt-1 { + margin-top: 0.25rem !important; +} + +.mr-1 { + margin-right: 0.25rem !important; +} + +.mb-1 { + margin-bottom: 0.25rem !important; +} + +.ml-1 { + margin-left: 0.25rem !important; +} + +.mx-1 { + margin-left: 0.25rem !important; + margin-right: 0.25rem !important; +} + +.my-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; +} + +.m-2 { + margin: 0.5rem !important; +} + +.mt-2 { + margin-top: 0.5rem !important; +} + +.mr-2 { + margin-right: 0.5rem !important; +} + +.mb-2 { + margin-bottom: 0.5rem !important; +} + +.ml-2 { + margin-left: 0.5rem !important; +} + +.mx-2 { + margin-left: 0.5rem !important; + margin-right: 0.5rem !important; +} + +.my-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; +} + +.m-3 { + margin: 0.75rem !important; +} + +.mt-3 { + margin-top: 0.75rem !important; +} + +.mr-3 { + margin-right: 0.75rem !important; +} + +.mb-3 { + margin-bottom: 0.75rem !important; +} + +.ml-3 { + margin-left: 0.75rem !important; +} + +.mx-3 { + margin-left: 0.75rem !important; + margin-right: 0.75rem !important; +} + +.my-3 { + margin-top: 0.75rem !important; + margin-bottom: 0.75rem !important; +} + +.m-4 { + margin: 1rem !important; +} + +.mt-4 { + margin-top: 1rem !important; +} + +.mr-4 { + margin-right: 1rem !important; +} + +.mb-4 { + margin-bottom: 1rem !important; +} + +.ml-4 { + margin-left: 1rem !important; +} + +.mx-4 { + margin-left: 1rem !important; + margin-right: 1rem !important; +} + +.my-4 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; +} + +.m-5 { + margin: 1.5rem !important; +} + +.mt-5 { + margin-top: 1.5rem !important; +} + +.mr-5 { + margin-right: 1.5rem !important; +} + +.mb-5 { + margin-bottom: 1.5rem !important; +} + +.ml-5 { + margin-left: 1.5rem !important; +} + +.mx-5 { + margin-left: 1.5rem !important; + margin-right: 1.5rem !important; +} + +.my-5 { + margin-top: 1.5rem !important; + margin-bottom: 1.5rem !important; +} + +.m-6 { + margin: 3rem !important; +} + +.mt-6 { + margin-top: 3rem !important; +} + +.mr-6 { + margin-right: 3rem !important; +} + +.mb-6 { + margin-bottom: 3rem !important; +} + +.ml-6 { + margin-left: 3rem !important; +} + +.mx-6 { + margin-left: 3rem !important; + margin-right: 3rem !important; +} + +.my-6 { + margin-top: 3rem !important; + margin-bottom: 3rem !important; +} + +.m-auto { + margin: auto !important; +} + +.mt-auto { + margin-top: auto !important; +} + +.mr-auto { + margin-right: auto !important; +} + +.mb-auto { + margin-bottom: auto !important; +} + +.ml-auto { + margin-left: auto !important; +} + +.mx-auto { + margin-left: auto !important; + margin-right: auto !important; +} + +.my-auto { + margin-top: auto !important; + margin-bottom: auto !important; +} + +.p-0 { + padding: 0 !important; +} + +.pt-0 { + padding-top: 0 !important; +} + +.pr-0 { + padding-right: 0 !important; +} + +.pb-0 { + padding-bottom: 0 !important; +} + +.pl-0 { + padding-left: 0 !important; +} + +.px-0 { + padding-left: 0 !important; + padding-right: 0 !important; +} + +.py-0 { + padding-top: 0 !important; + padding-bottom: 0 !important; +} + +.p-1 { + padding: 0.25rem !important; +} + +.pt-1 { + padding-top: 0.25rem !important; +} + +.pr-1 { + padding-right: 0.25rem !important; +} + +.pb-1 { + padding-bottom: 0.25rem !important; +} + +.pl-1 { + padding-left: 0.25rem !important; +} + +.px-1 { + padding-left: 0.25rem !important; + padding-right: 0.25rem !important; +} + +.py-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; +} + +.p-2 { + padding: 0.5rem !important; +} + +.pt-2 { + padding-top: 0.5rem !important; +} + +.pr-2 { + padding-right: 0.5rem !important; +} + +.pb-2 { + padding-bottom: 0.5rem !important; +} + +.pl-2 { + padding-left: 0.5rem !important; +} + +.px-2 { + padding-left: 0.5rem !important; + padding-right: 0.5rem !important; +} + +.py-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; +} + +.p-3 { + padding: 0.75rem !important; +} + +.pt-3 { + padding-top: 0.75rem !important; +} + +.pr-3 { + padding-right: 0.75rem !important; +} + +.pb-3 { + padding-bottom: 0.75rem !important; +} + +.pl-3 { + padding-left: 0.75rem !important; +} + +.px-3 { + padding-left: 0.75rem !important; + padding-right: 0.75rem !important; +} + +.py-3 { + padding-top: 0.75rem !important; + padding-bottom: 0.75rem !important; +} + +.p-4 { + padding: 1rem !important; +} + +.pt-4 { + padding-top: 1rem !important; +} + +.pr-4 { + padding-right: 1rem !important; +} + +.pb-4 { + padding-bottom: 1rem !important; +} + +.pl-4 { + padding-left: 1rem !important; +} + +.px-4 { + padding-left: 1rem !important; + padding-right: 1rem !important; +} + +.py-4 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; +} + +.p-5 { + padding: 1.5rem !important; +} + +.pt-5 { + padding-top: 1.5rem !important; +} + +.pr-5 { + padding-right: 1.5rem !important; +} + +.pb-5 { + padding-bottom: 1.5rem !important; +} + +.pl-5 { + padding-left: 1.5rem !important; +} + +.px-5 { + padding-left: 1.5rem !important; + padding-right: 1.5rem !important; +} + +.py-5 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; +} + +.p-6 { + padding: 3rem !important; +} + +.pt-6 { + padding-top: 3rem !important; +} + +.pr-6 { + padding-right: 3rem !important; +} + +.pb-6 { + padding-bottom: 3rem !important; +} + +.pl-6 { + padding-left: 3rem !important; +} + +.px-6 { + padding-left: 3rem !important; + padding-right: 3rem !important; +} + +.py-6 { + padding-top: 3rem !important; + padding-bottom: 3rem !important; +} + +.p-auto { + padding: auto !important; +} + +.pt-auto { + padding-top: auto !important; +} + +.pr-auto { + padding-right: auto !important; +} + +.pb-auto { + padding-bottom: auto !important; +} + +.pl-auto { + padding-left: auto !important; +} + +.px-auto { + padding-left: auto !important; + padding-right: auto !important; +} + +.py-auto { + padding-top: auto !important; + padding-bottom: auto !important; +} + +.collection { + padding-left: 0; + list-style-type: none; + margin: 0.5rem 0 1rem 0; + border: 1px solid var(--md-sys-color-outline-variant); + border-radius: 2px; + overflow: hidden; + position: relative; +} +.collection .collection-item { + background-color: transparent; + line-height: 1.5rem; + padding: 10px 20px; + margin: 0; + border-bottom: 1px solid var(--md-sys-color-outline-variant); +} +.collection .collection-item.avatar { + min-height: 84px; + padding-left: 72px; + position: relative; +} +.collection .collection-item.avatar:not(.circle-clipper) > .circle, +.collection .collection-item.avatar :not(.circle-clipper) > .circle { + position: absolute; + width: 42px; + height: 42px; + overflow: hidden; + left: 15px; + display: inline-block; + vertical-align: middle; +} +.collection .collection-item.avatar i.circle { + font-size: 18px; + line-height: 42px; + color: #fff; + background-color: var(--md-sys-color-shadow-light); + text-align: center; +} +.collection .collection-item.avatar .title { + font-size: 16px; +} +.collection .collection-item.avatar p { + margin: 0; +} +.collection .collection-item.avatar .secondary-content { + position: absolute; + top: 16px; + right: 16px; +} +.collection .collection-item:last-child { + border-bottom: none; +} +.collection .collection-item.active { + background-color: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); +} +.collection .collection-item.active .secondary-content { + color: var(--md-sys-color-on-primary); +} +.collection a.collection-item { + display: block; + -webkit-transition: 0.25s; + transition: 0.25s; + color: var(--md-sys-color-primary); +} +.collection a.collection-item:not(.active):hover { + background-color: rgba(0, 0, 0, 0.04); +} +.collection.with-header .collection-header { + background-color: transparent; + border-bottom: 1px solid var(--md-sys-color-outline-variant); + padding: 10px 20px; +} +.collection.with-header .collection-item { + padding-left: 30px; +} +.collection.with-header .collection-item.avatar { + padding-left: 72px; +} + +.secondary-content { + float: right; + color: var(--md-sys-color-primary); +} + +.collapsible .collection { + margin: 0; + border: none; +} + +:root { + --bagde-height: 22px; +} + span.badge { min-width: 3rem; padding: 0 6px; margin-left: 14px; text-align: center; font-size: 1rem; - line-height: 22px; - height: 22px; - color: #757575; + line-height: var(--bagde-height); + height: var(--bagde-height); + color: var(--md-sys-color-on-surface-variant); float: right; -webkit-box-sizing: border-box; box-sizing: border-box; } - span.badge.new { font-weight: 300; font-size: 0.8rem; - color: #fff; - background-color: #26a69a; + color: var(--md-sys-color-on-primary); + background-color: var(--md-sys-color-primary); border-radius: 2px; } - span.badge.new:after { content: " new"; } - span.badge[data-badge-caption]::after { content: " " attr(data-badge-caption); } +.active span.badge { + color: var(--md-sys-color-on-primary); +} + nav ul a span.badge { display: inline-block; float: none; margin-left: 4px; - line-height: 22px; - height: 22px; + line-height: var(--bagde-height); + height: var(--bagde-height); -webkit-font-smoothing: auto; } .collection-item span.badge { - margin-top: calc(0.75rem - 11px); + margin-top: calc(0.75rem - var(--bagde-height) * 0.5); } .collapsible span.badge { margin-left: auto; } +.collapsible .active span.badge:not(.new) { + color: var(--md-sys-color-on-surface-variant); +} + .sidenav span.badge { - margin-top: calc(24px - 11px); + margin-top: calc(var(--sidenav-line-height) * 0.5 - 11px); } table span.badge { @@ -3423,11 +4502,12 @@ table span.badge { } /* This is needed for some mobile phones to display the Google Icon font properly */ -.material-icons { +.material-icons, .material-symbols-outlined, +.material-symbols-rounded, .material-symbols-sharp { text-rendering: optimizeLegibility; - -webkit-font-feature-settings: 'liga'; - -moz-font-feature-settings: 'liga'; - font-feature-settings: 'liga'; + -webkit-font-feature-settings: "liga"; + -moz-font-feature-settings: "liga"; + font-feature-settings: "liga"; } .container { @@ -3436,915 +4516,395 @@ table span.badge { width: 90%; } -@media only screen and (min-width: 601px) { +@media only screen and (min-width : 601px) { .container { width: 85%; } } - -@media only screen and (min-width: 993px) { +@media only screen and (min-width : 993px) { .container { width: 70%; } } - -.col .row { - margin-left: -0.75rem; - margin-right: -0.75rem; -} - .section { - padding-top: 1rem; - padding-bottom: 1rem; -} - -.section.no-pad { - padding: 0; -} - -.section.no-pad-bot { - padding-bottom: 0; -} - -.section.no-pad-top { - padding-top: 0; + padding: 1rem 0; } .row { - margin-left: auto; - margin-right: auto; - margin-bottom: 20px; + --gap-size: 1.5rem; + display: grid; + grid-template-columns: repeat(12, 1fr); + gap: var(--gap-size); } - -.row:after { - content: ""; - display: table; - clear: both; +.row .g-0 { + gap: 0; } - -.row .col { - float: left; - -webkit-box-sizing: border-box; - box-sizing: border-box; - padding: 0 0.75rem; - min-height: 1px; +.row .g-1 { + gap: calc(0.25 * var(--gap-size)); } - -.row .col[class*="push-"], .row .col[class*="pull-"] { - position: relative; +.row .g-2 { + gap: calc(0.5 * var(--gap-size)); } - -.row .col.s1 { - width: 8.3333333333%; - margin-left: auto; - left: auto; - right: auto; +.row .g-3 { + gap: calc(1 * var(--gap-size)); } - -.row .col.s2 { - width: 16.6666666667%; - margin-left: auto; - left: auto; - right: auto; +.row .g-4 { + gap: calc(1.5 * var(--gap-size)); } - -.row .col.s3 { - width: 25%; - margin-left: auto; - left: auto; - right: auto; +.row .g-5 { + gap: calc(3 * var(--gap-size)); } - -.row .col.s4 { - width: 33.3333333333%; - margin-left: auto; - left: auto; - right: auto; +.row .s1 { + grid-column: auto/span 1; } - -.row .col.s5 { - width: 41.6666666667%; - margin-left: auto; - left: auto; - right: auto; +.row .s2 { + grid-column: auto/span 2; } - -.row .col.s6 { - width: 50%; - margin-left: auto; - left: auto; - right: auto; +.row .s3 { + grid-column: auto/span 3; } - -.row .col.s7 { - width: 58.3333333333%; - margin-left: auto; - left: auto; - right: auto; +.row .s4 { + grid-column: auto/span 4; } - -.row .col.s8 { - width: 66.6666666667%; - margin-left: auto; - left: auto; - right: auto; +.row .s5 { + grid-column: auto/span 5; } - -.row .col.s9 { - width: 75%; - margin-left: auto; - left: auto; - right: auto; +.row .s6 { + grid-column: auto/span 6; } - -.row .col.s10 { - width: 83.3333333333%; - margin-left: auto; - left: auto; - right: auto; +.row .s7 { + grid-column: auto/span 7; } - -.row .col.s11 { - width: 91.6666666667%; - margin-left: auto; - left: auto; - right: auto; +.row .s8 { + grid-column: auto/span 8; } - -.row .col.s12 { - width: 100%; - margin-left: auto; - left: auto; - right: auto; +.row .s9 { + grid-column: auto/span 9; } - -.row .col.offset-s1 { - margin-left: 8.3333333333%; +.row .s10 { + grid-column: auto/span 10; } - -.row .col.pull-s1 { - right: 8.3333333333%; +.row .s11 { + grid-column: auto/span 11; } - -.row .col.push-s1 { - left: 8.3333333333%; +.row .s12 { + grid-column: auto/span 12; } - -.row .col.offset-s2 { - margin-left: 16.6666666667%; +.row .offset-s1 { + grid-column-start: 3; } - -.row .col.pull-s2 { - right: 16.6666666667%; +.row .offset-s2 { + grid-column-start: 2; } - -.row .col.push-s2 { - left: 16.6666666667%; +.row .offset-s3 { + grid-column-start: 4; } - -.row .col.offset-s3 { - margin-left: 25%; +.row .offset-s4 { + grid-column-start: 5; } - -.row .col.pull-s3 { - right: 25%; +.row .offset-s5 { + grid-column-start: 6; } - -.row .col.push-s3 { - left: 25%; +.row .offset-s6 { + grid-column-start: 7; } - -.row .col.offset-s4 { - margin-left: 33.3333333333%; +.row .offset-s7 { + grid-column-start: 8; } - -.row .col.pull-s4 { - right: 33.3333333333%; +.row .offset-s8 { + grid-column-start: 9; } - -.row .col.push-s4 { - left: 33.3333333333%; +.row .offset-s9 { + grid-column-start: 10; } - -.row .col.offset-s5 { - margin-left: 41.6666666667%; +.row .offset-s10 { + grid-column-start: 11; } - -.row .col.pull-s5 { - right: 41.6666666667%; +.row .offset-s11 { + grid-column-start: 12; } - -.row .col.push-s5 { - left: 41.6666666667%; -} - -.row .col.offset-s6 { - margin-left: 50%; -} - -.row .col.pull-s6 { - right: 50%; -} - -.row .col.push-s6 { - left: 50%; -} - -.row .col.offset-s7 { - margin-left: 58.3333333333%; -} - -.row .col.pull-s7 { - right: 58.3333333333%; -} - -.row .col.push-s7 { - left: 58.3333333333%; -} - -.row .col.offset-s8 { - margin-left: 66.6666666667%; -} - -.row .col.pull-s8 { - right: 66.6666666667%; -} - -.row .col.push-s8 { - left: 66.6666666667%; -} - -.row .col.offset-s9 { - margin-left: 75%; -} - -.row .col.pull-s9 { - right: 75%; -} - -.row .col.push-s9 { - left: 75%; -} - -.row .col.offset-s10 { - margin-left: 83.3333333333%; -} - -.row .col.pull-s10 { - right: 83.3333333333%; -} - -.row .col.push-s10 { - left: 83.3333333333%; -} - -.row .col.offset-s11 { - margin-left: 91.6666666667%; -} - -.row .col.pull-s11 { - right: 91.6666666667%; -} - -.row .col.push-s11 { - left: 91.6666666667%; -} - -.row .col.offset-s12 { - margin-left: 100%; -} - -.row .col.pull-s12 { - right: 100%; -} - -.row .col.push-s12 { - left: 100%; -} - -@media only screen and (min-width: 601px) { - .row .col.m1 { - width: 8.3333333333%; - margin-left: auto; - left: auto; - right: auto; +@media only screen and (min-width : 601px) { + .row .m1 { + grid-column: auto/span 1; } - .row .col.m2 { - width: 16.6666666667%; - margin-left: auto; - left: auto; - right: auto; + .row .m2 { + grid-column: auto/span 2; } - .row .col.m3 { - width: 25%; - margin-left: auto; - left: auto; - right: auto; + .row .m3 { + grid-column: auto/span 3; } - .row .col.m4 { - width: 33.3333333333%; - margin-left: auto; - left: auto; - right: auto; + .row .m4 { + grid-column: auto/span 4; } - .row .col.m5 { - width: 41.6666666667%; - margin-left: auto; - left: auto; - right: auto; + .row .m5 { + grid-column: auto/span 5; } - .row .col.m6 { - width: 50%; - margin-left: auto; - left: auto; - right: auto; + .row .m6 { + grid-column: auto/span 6; } - .row .col.m7 { - width: 58.3333333333%; - margin-left: auto; - left: auto; - right: auto; + .row .m7 { + grid-column: auto/span 7; } - .row .col.m8 { - width: 66.6666666667%; - margin-left: auto; - left: auto; - right: auto; + .row .m8 { + grid-column: auto/span 8; } - .row .col.m9 { - width: 75%; - margin-left: auto; - left: auto; - right: auto; + .row .m9 { + grid-column: auto/span 9; } - .row .col.m10 { - width: 83.3333333333%; - margin-left: auto; - left: auto; - right: auto; + .row .m10 { + grid-column: auto/span 10; } - .row .col.m11 { - width: 91.6666666667%; - margin-left: auto; - left: auto; - right: auto; + .row .m11 { + grid-column: auto/span 11; } - .row .col.m12 { - width: 100%; - margin-left: auto; - left: auto; - right: auto; + .row .m12 { + grid-column: auto/span 12; } - .row .col.offset-m1 { - margin-left: 8.3333333333%; + .row .offset-m1 { + grid-column-start: 2; } - .row .col.pull-m1 { - right: 8.3333333333%; + .row .offset-m2 { + grid-column-start: 3; } - .row .col.push-m1 { - left: 8.3333333333%; + .row .offset-m3 { + grid-column-start: 4; } - .row .col.offset-m2 { - margin-left: 16.6666666667%; + .row .offset-m4 { + grid-column-start: 5; } - .row .col.pull-m2 { - right: 16.6666666667%; + .row .offset-m5 { + grid-column-start: 6; } - .row .col.push-m2 { - left: 16.6666666667%; + .row .offset-m6 { + grid-column-start: 7; } - .row .col.offset-m3 { - margin-left: 25%; + .row .offset-m7 { + grid-column-start: 8; } - .row .col.pull-m3 { - right: 25%; + .row .offset-m8 { + grid-column-start: 9; } - .row .col.push-m3 { - left: 25%; + .row .offset-m9 { + grid-column-start: 10; } - .row .col.offset-m4 { - margin-left: 33.3333333333%; + .row .offset-m10 { + grid-column-start: 11; } - .row .col.pull-m4 { - right: 33.3333333333%; + .row .offset-m11 { + grid-column-start: 12; } - .row .col.push-m4 { - left: 33.3333333333%; +} +@media only screen and (min-width : 993px) { + .row .l1 { + grid-column: auto/span 1; } - .row .col.offset-m5 { - margin-left: 41.6666666667%; + .row .l2 { + grid-column: auto/span 2; } - .row .col.pull-m5 { - right: 41.6666666667%; + .row .l3 { + grid-column: auto/span 3; } - .row .col.push-m5 { - left: 41.6666666667%; + .row .l4 { + grid-column: auto/span 4; } - .row .col.offset-m6 { - margin-left: 50%; + .row .l5 { + grid-column: auto/span 5; } - .row .col.pull-m6 { - right: 50%; + .row .l6 { + grid-column: auto/span 6; } - .row .col.push-m6 { - left: 50%; + .row .l7 { + grid-column: auto/span 7; } - .row .col.offset-m7 { - margin-left: 58.3333333333%; + .row .l8 { + grid-column: auto/span 8; } - .row .col.pull-m7 { - right: 58.3333333333%; + .row .l9 { + grid-column: auto/span 9; } - .row .col.push-m7 { - left: 58.3333333333%; + .row .l10 { + grid-column: auto/span 10; } - .row .col.offset-m8 { - margin-left: 66.6666666667%; + .row .l11 { + grid-column: auto/span 11; } - .row .col.pull-m8 { - right: 66.6666666667%; + .row .l12 { + grid-column: auto/span 12; } - .row .col.push-m8 { - left: 66.6666666667%; + .row .offset-l1 { + grid-column-start: 2; } - .row .col.offset-m9 { - margin-left: 75%; + .row .offset-l2 { + grid-column-start: 3; } - .row .col.pull-m9 { - right: 75%; + .row .offset-l3 { + grid-column-start: 4; } - .row .col.push-m9 { - left: 75%; + .row .offset-l4 { + grid-column-start: 5; } - .row .col.offset-m10 { - margin-left: 83.3333333333%; + .row .offset-l5 { + grid-column-start: 6; } - .row .col.pull-m10 { - right: 83.3333333333%; + .row .offset-l6 { + grid-column-start: 7; } - .row .col.push-m10 { - left: 83.3333333333%; + .row .offset-l7 { + grid-column-start: 8; } - .row .col.offset-m11 { - margin-left: 91.6666666667%; + .row .offset-l8 { + grid-column-start: 9; } - .row .col.pull-m11 { - right: 91.6666666667%; + .row .offset-l9 { + grid-column-start: 10; } - .row .col.push-m11 { - left: 91.6666666667%; + .row .offset-l10 { + grid-column-start: 11; } - .row .col.offset-m12 { - margin-left: 100%; + .row .offset-l11 { + grid-column-start: 12; } - .row .col.pull-m12 { - right: 100%; +} +@media only screen and (min-width : 1201px) { + .row .xl1 { + grid-column: auto/span 1; } - .row .col.push-m12 { - left: 100%; + .row .xl2 { + grid-column: auto/span 2; + } + .row .xl3 { + grid-column: auto/span 3; + } + .row .xl4 { + grid-column: auto/span 4; + } + .row .xl5 { + grid-column: auto/span 5; + } + .row .xl6 { + grid-column: auto/span 6; + } + .row .xl7 { + grid-column: auto/span 7; + } + .row .xl8 { + grid-column: auto/span 8; + } + .row .xl9 { + grid-column: auto/span 9; + } + .row .xl10 { + grid-column: auto/span 10; + } + .row .xl11 { + grid-column: auto/span 11; + } + .row .xl12 { + grid-column: auto/span 12; + } + .row .offset-xl1 { + grid-column-start: 2; + } + .row .offset-xl2 { + grid-column-start: 3; + } + .row .offset-xl3 { + grid-column-start: 4; + } + .row .offset-xl4 { + grid-column-start: 5; + } + .row .offset-xl5 { + grid-column-start: 6; + } + .row .offset-xl6 { + grid-column-start: 7; + } + .row .offset-xl7 { + grid-column-start: 8; + } + .row .offset-xl8 { + grid-column-start: 9; + } + .row .offset-xl9 { + grid-column-start: 10; + } + .row .offset-xl10 { + grid-column-start: 11; + } + .row .offset-xl11 { + grid-column-start: 12; } } -@media only screen and (min-width: 993px) { - .row .col.l1 { - width: 8.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l2 { - width: 16.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l3 { - width: 25%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l4 { - width: 33.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l5 { - width: 41.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l6 { - width: 50%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l7 { - width: 58.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l8 { - width: 66.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l9 { - width: 75%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l10 { - width: 83.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l11 { - width: 91.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.l12 { - width: 100%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.offset-l1 { - margin-left: 8.3333333333%; - } - .row .col.pull-l1 { - right: 8.3333333333%; - } - .row .col.push-l1 { - left: 8.3333333333%; - } - .row .col.offset-l2 { - margin-left: 16.6666666667%; - } - .row .col.pull-l2 { - right: 16.6666666667%; - } - .row .col.push-l2 { - left: 16.6666666667%; - } - .row .col.offset-l3 { - margin-left: 25%; - } - .row .col.pull-l3 { - right: 25%; - } - .row .col.push-l3 { - left: 25%; - } - .row .col.offset-l4 { - margin-left: 33.3333333333%; - } - .row .col.pull-l4 { - right: 33.3333333333%; - } - .row .col.push-l4 { - left: 33.3333333333%; - } - .row .col.offset-l5 { - margin-left: 41.6666666667%; - } - .row .col.pull-l5 { - right: 41.6666666667%; - } - .row .col.push-l5 { - left: 41.6666666667%; - } - .row .col.offset-l6 { - margin-left: 50%; - } - .row .col.pull-l6 { - right: 50%; - } - .row .col.push-l6 { - left: 50%; - } - .row .col.offset-l7 { - margin-left: 58.3333333333%; - } - .row .col.pull-l7 { - right: 58.3333333333%; - } - .row .col.push-l7 { - left: 58.3333333333%; - } - .row .col.offset-l8 { - margin-left: 66.6666666667%; - } - .row .col.pull-l8 { - right: 66.6666666667%; - } - .row .col.push-l8 { - left: 66.6666666667%; - } - .row .col.offset-l9 { - margin-left: 75%; - } - .row .col.pull-l9 { - right: 75%; - } - .row .col.push-l9 { - left: 75%; - } - .row .col.offset-l10 { - margin-left: 83.3333333333%; - } - .row .col.pull-l10 { - right: 83.3333333333%; - } - .row .col.push-l10 { - left: 83.3333333333%; - } - .row .col.offset-l11 { - margin-left: 91.6666666667%; - } - .row .col.pull-l11 { - right: 91.6666666667%; - } - .row .col.push-l11 { - left: 91.6666666667%; - } - .row .col.offset-l12 { - margin-left: 100%; - } - .row .col.pull-l12 { - right: 100%; - } - .row .col.push-l12 { - left: 100%; - } -} - -@media only screen and (min-width: 1201px) { - .row .col.xl1 { - width: 8.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl2 { - width: 16.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl3 { - width: 25%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl4 { - width: 33.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl5 { - width: 41.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl6 { - width: 50%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl7 { - width: 58.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl8 { - width: 66.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl9 { - width: 75%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl10 { - width: 83.3333333333%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl11 { - width: 91.6666666667%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.xl12 { - width: 100%; - margin-left: auto; - left: auto; - right: auto; - } - .row .col.offset-xl1 { - margin-left: 8.3333333333%; - } - .row .col.pull-xl1 { - right: 8.3333333333%; - } - .row .col.push-xl1 { - left: 8.3333333333%; - } - .row .col.offset-xl2 { - margin-left: 16.6666666667%; - } - .row .col.pull-xl2 { - right: 16.6666666667%; - } - .row .col.push-xl2 { - left: 16.6666666667%; - } - .row .col.offset-xl3 { - margin-left: 25%; - } - .row .col.pull-xl3 { - right: 25%; - } - .row .col.push-xl3 { - left: 25%; - } - .row .col.offset-xl4 { - margin-left: 33.3333333333%; - } - .row .col.pull-xl4 { - right: 33.3333333333%; - } - .row .col.push-xl4 { - left: 33.3333333333%; - } - .row .col.offset-xl5 { - margin-left: 41.6666666667%; - } - .row .col.pull-xl5 { - right: 41.6666666667%; - } - .row .col.push-xl5 { - left: 41.6666666667%; - } - .row .col.offset-xl6 { - margin-left: 50%; - } - .row .col.pull-xl6 { - right: 50%; - } - .row .col.push-xl6 { - left: 50%; - } - .row .col.offset-xl7 { - margin-left: 58.3333333333%; - } - .row .col.pull-xl7 { - right: 58.3333333333%; - } - .row .col.push-xl7 { - left: 58.3333333333%; - } - .row .col.offset-xl8 { - margin-left: 66.6666666667%; - } - .row .col.pull-xl8 { - right: 66.6666666667%; - } - .row .col.push-xl8 { - left: 66.6666666667%; - } - .row .col.offset-xl9 { - margin-left: 75%; - } - .row .col.pull-xl9 { - right: 75%; - } - .row .col.push-xl9 { - left: 75%; - } - .row .col.offset-xl10 { - margin-left: 83.3333333333%; - } - .row .col.pull-xl10 { - right: 83.3333333333%; - } - .row .col.push-xl10 { - left: 83.3333333333%; - } - .row .col.offset-xl11 { - margin-left: 91.6666666667%; - } - .row .col.pull-xl11 { - right: 91.6666666667%; - } - .row .col.push-xl11 { - left: 91.6666666667%; - } - .row .col.offset-xl12 { - margin-left: 100%; - } - .row .col.pull-xl12 { - right: 100%; - } - .row .col.push-xl12 { - left: 100%; - } +:root { + --navbar-height: 64px; + --navbar-height-mobile: 56px; } nav { - color: #fff; - background-color: #ee6e73; + color: var(--md-sys-color-on-primary); + background-color: var(--md-sys-color-secondary-container); width: 100%; - height: 56px; - line-height: 56px; + height: var(--navbar-height-mobile); + line-height: var(--navbar-height-mobile); } - nav.nav-extended { height: auto; } - nav.nav-extended .nav-wrapper { - min-height: 56px; + min-height: var(--navbar-height-mobile); height: auto; } - nav.nav-extended .nav-content { position: relative; line-height: normal; } - nav a { - color: #fff; + color: var(--md-sys-color-on-primary); } - nav i, -nav [class^="mdi-"], nav [class*="mdi-"], -nav i.material-icons { +nav [class^=mdi-], nav [class*=mdi-], +nav i.material-icons, nav i.material-symbols-outlined, +nav i.material-symbols-rounded, nav i.material-symbols-sharp { display: block; font-size: 24px; - height: 56px; - line-height: 56px; + height: var(--navbar-height-mobile); + line-height: var(--navbar-height-mobile); } - nav .nav-wrapper { position: relative; height: 100%; } - -@media only screen and (min-width: 993px) { +@media only screen and (min-width : 993px) { nav a.sidenav-trigger { display: none; } } - nav .sidenav-trigger { float: left; position: relative; z-index: 1; - height: 56px; + height: var(--navbar-height-mobile); margin: 0 18px; } - nav .sidenav-trigger i { - height: 56px; - line-height: 56px; + height: var(--navbar-height-mobile); + line-height: var(--navbar-height-mobile); } - nav .brand-logo { position: absolute; - color: #fff; + color: var(--md-sys-color-on-primary); display: inline-block; font-size: 2.1rem; padding: 0; } - nav .brand-logo.center { left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); } - -@media only screen and (max-width: 992.99px) { +@media only screen and (max-width : 992.99px) { nav .brand-logo { left: 50%; -webkit-transform: translateX(-50%); @@ -4363,152 +4923,133 @@ nav .brand-logo.center { left: auto; } } - nav .brand-logo.right { right: 0.5rem; padding: 0; } - nav .brand-logo i, -nav .brand-logo [class^="mdi-"], nav .brand-logo [class*="mdi-"], -nav .brand-logo i.material-icons { +nav .brand-logo [class^=mdi-], nav .brand-logo [class*=mdi-], +nav .brand-logo i.material-icons, nav .brand-logo i.material-symbols-outlined, +nav .brand-logo i.material-symbols-rounded, nav .brand-logo i.material-symbols-sharp { float: left; margin-right: 15px; } - nav .nav-title { display: inline-block; font-size: 32px; padding: 28px 0; } - -nav ul { +nav ul:not(.dropdown-content) { + list-style-type: none; margin: 0; } - -nav ul li { - -webkit-transition: background-color .3s; - transition: background-color .3s; +nav ul:not(.dropdown-content) > li { + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; float: left; padding: 0; } - -nav ul li.active { - background-color: rgba(0, 0, 0, 0.1); -} - -nav ul a { - -webkit-transition: background-color .3s; - transition: background-color .3s; +nav ul:not(.dropdown-content) > li > a { + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; font-size: 1rem; - color: #fff; + color: var(--md-sys-color-on-primary); display: block; padding: 0 15px; cursor: pointer; } - -nav ul a.btn, nav ul a.btn-large, nav ul a.btn-small, nav ul a.btn-large, nav ul a.btn-flat, nav ul a.btn-floating { +nav ul:not(.dropdown-content) > li > a.active { + background-color: var(--md-ref-palette-primary80); +} +nav ul:not(.dropdown-content) > li > a:hover:not(.active) { + background-color: var(--md-ref-palette-primary70); +} +nav ul:not(.dropdown-content) > li > a.btn, nav ul:not(.dropdown-content) > li > a.btn-small, nav ul:not(.dropdown-content) > li > a.btn-large, nav ul:not(.dropdown-content) > li > a.btn-flat, nav ul:not(.dropdown-content) > li > a.btn-floating { margin-top: -2px; margin-left: 15px; margin-right: 15px; + display: inline-block; } - -nav ul a.btn > .material-icons, nav ul a.btn-large > .material-icons, nav ul a.btn-small > .material-icons, nav ul a.btn-large > .material-icons, nav ul a.btn-flat > .material-icons, nav ul a.btn-floating > .material-icons { +nav ul:not(.dropdown-content) > li > a.btn > .material-icons, nav ul:not(.dropdown-content) > li > a.btn-small > .material-icons, nav ul:not(.dropdown-content) > li > a.btn > .material-symbols-outlined, nav ul:not(.dropdown-content) > li > a.btn-small > .material-symbols-outlined, nav ul:not(.dropdown-content) > li > a.btn > .material-symbols-rounded, nav ul:not(.dropdown-content) > li > a.btn-small > .material-symbols-rounded, nav ul:not(.dropdown-content) > li > a.btn > .material-symbols-sharp, nav ul:not(.dropdown-content) > li > a.btn-small > .material-symbols-sharp, nav ul:not(.dropdown-content) > li > a.btn-large > .material-icons, nav ul:not(.dropdown-content) > li > a.btn-large > .material-symbols-outlined, nav ul:not(.dropdown-content) > li > a.btn-large > .material-symbols-rounded, nav ul:not(.dropdown-content) > li > a.btn-large > .material-symbols-sharp, nav ul:not(.dropdown-content) > li > a.btn-flat > .material-icons, nav ul:not(.dropdown-content) > li > a.btn-flat > .material-symbols-outlined, nav ul:not(.dropdown-content) > li > a.btn-flat > .material-symbols-rounded, nav ul:not(.dropdown-content) > li > a.btn-flat > .material-symbols-sharp, nav ul:not(.dropdown-content) > li > a.btn-floating > .material-icons, nav ul:not(.dropdown-content) > li > a.btn-floating > .material-symbols-outlined, nav ul:not(.dropdown-content) > li > a.btn-floating > .material-symbols-rounded, nav ul:not(.dropdown-content) > li > a.btn-floating > .material-symbols-sharp { height: inherit; line-height: inherit; } - -nav ul a:hover { - background-color: rgba(0, 0, 0, 0.1); -} - -nav ul.left { +nav ul:not(.dropdown-content).left { float: left; } - nav form { height: 100%; } - nav .input-field { margin: 0; height: 100%; } - -nav .input-field input { +nav .input-field input[type=search] { height: 100%; font-size: 1.2rem; border: none; padding-left: 2rem; + color: var(--md-sys-color-on-primary); } - -nav .input-field input:focus, nav .input-field input[type=text]:valid, nav .input-field input[type=password]:valid, nav .input-field input[type=email]:valid, nav .input-field input[type=url]:valid, nav .input-field input[type=date]:valid { +nav .input-field input[type=search]:focus, nav .input-field input[type=search][type=text]:valid, nav .input-field input[type=search][type=password]:valid, nav .input-field input[type=search][type=email]:valid, nav .input-field input[type=search][type=url]:valid, nav .input-field input[type=search][type=date]:valid { border: none; -webkit-box-shadow: none; box-shadow: none; } - nav .input-field label { top: 0; left: 0; } - nav .input-field label i { - color: rgba(255, 255, 255, 0.7); - -webkit-transition: color .3s; - transition: color .3s; + color: var(--font-on-primary-color-medium); + -webkit-transition: color 0.3s; + transition: color 0.3s; } - nav .input-field label.active i { - color: #fff; + color: var(--md-sys-color-on-primary); } .navbar-fixed { position: relative; - height: 56px; + height: var(--navbar-height-mobile); z-index: 997; } - .navbar-fixed nav { position: fixed; + right: 0; } -@media only screen and (min-width: 601px) { +@media only screen and (min-width : 601px) { nav.nav-extended .nav-wrapper { - min-height: 64px; + min-height: var(--navbar-height-mobile); } nav, nav .nav-wrapper i, nav a.sidenav-trigger, nav a.sidenav-trigger i { - height: 64px; - line-height: 64px; + height: var(--navbar-height); + line-height: var(--navbar-height); } .navbar-fixed { - height: 64px; + height: var(--navbar-height); } } - a { text-decoration: none; } html { - line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-weight: normal; - color: rgba(0, 0, 0, 0.87); + color: var(--md-sys-color-on-background); } - @media only screen and (min-width: 0) { html { font-size: 14px; } } - @media only screen and (min-width: 993px) { html { font-size: 14.5px; } } - @media only screen and (min-width: 1201px) { html { font-size: 15px; @@ -4585,127 +5126,106 @@ small { font-size: 1.2rem; } } - @media only screen and (min-width: 390px) { .flow-text { font-size: 1.224rem; } } - @media only screen and (min-width: 420px) { .flow-text { font-size: 1.248rem; } } - @media only screen and (min-width: 450px) { .flow-text { font-size: 1.272rem; } } - @media only screen and (min-width: 480px) { .flow-text { font-size: 1.296rem; } } - @media only screen and (min-width: 510px) { .flow-text { font-size: 1.32rem; } } - @media only screen and (min-width: 540px) { .flow-text { font-size: 1.344rem; } } - @media only screen and (min-width: 570px) { .flow-text { font-size: 1.368rem; } } - @media only screen and (min-width: 600px) { .flow-text { font-size: 1.392rem; } } - @media only screen and (min-width: 630px) { .flow-text { font-size: 1.416rem; } } - @media only screen and (min-width: 660px) { .flow-text { font-size: 1.44rem; } } - @media only screen and (min-width: 690px) { .flow-text { font-size: 1.464rem; } } - @media only screen and (min-width: 720px) { .flow-text { font-size: 1.488rem; } } - @media only screen and (min-width: 750px) { .flow-text { font-size: 1.512rem; } } - @media only screen and (min-width: 780px) { .flow-text { font-size: 1.536rem; } } - @media only screen and (min-width: 810px) { .flow-text { font-size: 1.56rem; } } - @media only screen and (min-width: 840px) { .flow-text { font-size: 1.584rem; } } - @media only screen and (min-width: 870px) { .flow-text { font-size: 1.608rem; } } - @media only screen and (min-width: 900px) { .flow-text { font-size: 1.632rem; } } - @media only screen and (min-width: 930px) { .flow-text { font-size: 1.656rem; } } - @media only screen and (min-width: 960px) { .flow-text { font-size: 1.68rem; } } - @media only screen and (max-width: 360px) { .flow-text { font-size: 1.2rem; @@ -4718,116 +5238,98 @@ small { transition: transform 0.3s cubic-bezier(0.53, 0.01, 0.36, 1.63) !important; transition: transform 0.3s cubic-bezier(0.53, 0.01, 0.36, 1.63), -webkit-transform 0.3s cubic-bezier(0.53, 0.01, 0.36, 1.63) !important; } - .scale-transition.scale-out { -webkit-transform: scale(0); transform: scale(0); - -webkit-transition: -webkit-transform .2s !important; - transition: -webkit-transform .2s !important; - transition: transform .2s !important; - transition: transform .2s, -webkit-transform .2s !important; + -webkit-transition: -webkit-transform 0.2s !important; + transition: -webkit-transform 0.2s !important; + transition: transform 0.2s !important; + transition: transform 0.2s, -webkit-transform 0.2s !important; } - .scale-transition.scale-in { -webkit-transform: scale(1); transform: scale(1); } .card-panel { - -webkit-transition: -webkit-box-shadow .25s; - transition: -webkit-box-shadow .25s; - transition: box-shadow .25s; - transition: box-shadow .25s, -webkit-box-shadow .25s; + -webkit-transition: -webkit-box-shadow 0.25s; + transition: -webkit-box-shadow 0.25s; + transition: box-shadow 0.25s; + transition: box-shadow 0.25s, -webkit-box-shadow 0.25s; padding: 24px; margin: 0.5rem 0 1rem 0; - border-radius: 2px; - background-color: #fff; + border-radius: 12px; + background-color: var(--md-sys-color-surface); } .card { + overflow: hidden; position: relative; - margin: 0.5rem 0 1rem 0; - background-color: #fff; - -webkit-transition: -webkit-box-shadow .25s; - transition: -webkit-box-shadow .25s; - transition: box-shadow .25s; - transition: box-shadow .25s, -webkit-box-shadow .25s; - border-radius: 2px; + background-color: var(--md-sys-color-surface); + -webkit-transition: -webkit-box-shadow 0.25s; + transition: -webkit-box-shadow 0.25s; + transition: box-shadow 0.25s; + transition: box-shadow 0.25s, -webkit-box-shadow 0.25s; + border-radius: 12px; } - .card .card-title { font-size: 24px; font-weight: 300; } - .card .card-title.activator { cursor: pointer; } - .card.small, .card.medium, .card.large { position: relative; } - .card.small .card-image, .card.medium .card-image, .card.large .card-image { max-height: 60%; overflow: hidden; } - .card.small .card-image + .card-content, .card.medium .card-image + .card-content, .card.large .card-image + .card-content { max-height: 40%; } - .card.small .card-content, .card.medium .card-content, .card.large .card-content { max-height: 100%; overflow: hidden; } - .card.small .card-action, .card.medium .card-action, .card.large .card-action { position: absolute; bottom: 0; left: 0; right: 0; } - .card.small { height: 300px; } - .card.medium { height: 400px; } - .card.large { height: 500px; } - .card.horizontal { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } - .card.horizontal.small .card-image, .card.horizontal.medium .card-image, .card.horizontal.large .card-image { height: 100%; max-height: none; overflow: visible; } - .card.horizontal.small .card-image img, .card.horizontal.medium .card-image img, .card.horizontal.large .card-image img { height: 100%; } - .card.horizontal .card-image { max-width: 50%; } - .card.horizontal .card-image img { border-radius: 2px 0 0 2px; max-width: 100%; width: auto; } - .card.horizontal .card-stacked { display: -webkit-box; display: -webkit-flex; @@ -4844,27 +5346,22 @@ small { flex: 1; position: relative; } - .card.horizontal .card-stacked .card-content { -webkit-box-flex: 1; -webkit-flex-grow: 1; -ms-flex-positive: 1; flex-grow: 1; } - .card.sticky-action .card-action { z-index: 2; } - .card.sticky-action .card-reveal { z-index: 1; padding-bottom: 64px; } - .card .card-image { position: relative; } - .card .card-image img { display: block; border-radius: 2px 2px 0 0; @@ -4875,62 +5372,53 @@ small { bottom: 0; width: 100%; } - .card .card-image .card-title { - color: #fff; + color: var(--md-sys-color-surface); position: absolute; bottom: 0; left: 0; max-width: 100%; padding: 24px; } - .card .card-content { padding: 24px; border-radius: 0 0 2px 2px; } - .card .card-content p { margin: 0; } - .card .card-content .card-title { display: block; line-height: 32px; margin-bottom: 8px; } - .card .card-content .card-title i { line-height: 32px; } - .card .card-action { - background-color: inherit; - border-top: 1px solid rgba(160, 160, 160, 0.2); + border-top: 1px solid var(--md-sys-color-outline-variant); position: relative; - padding: 16px 24px; + background-color: inherit; } - .card .card-action:last-child { border-radius: 0 0 2px 2px; } - -.card .card-action a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-large):not(.btn-floating) { - color: #ffab40; - margin-right: 24px; - -webkit-transition: color .3s ease; - transition: color .3s ease; - text-transform: uppercase; +.card .card-action a { + padding: 16px 24px; + display: inline-block; } - -.card .card-action a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-large):not(.btn-floating):hover { - color: #ffd8a6; +.card .card-action a:not(.btn):not(.btn-small):not(.btn-large):not(.btn-large):not(.btn-floating) { + color: var(--md-sys-color-primary); + -webkit-transition: color 0.3s ease; + transition: color 0.3s ease; +} +.card .card-action a:not(.btn):not(.btn-small):not(.btn-large):not(.btn-large):not(.btn-floating):hover { + background-color: rgba(var(--md-sys-color-primary-numeric), 0.06); } - .card .card-reveal { padding: 24px; position: absolute; - background-color: #fff; + background-color: var(--md-sys-color-surface); width: 100%; overflow-y: auto; left: 0; @@ -4939,7 +5427,6 @@ small { z-index: 3; display: none; } - .card .card-reveal .card-title { cursor: pointer; display: block; @@ -4950,23 +5437,20 @@ small { position: fixed; z-index: 10000; } - -@media only screen and (max-width: 600.99px) { +@media only screen and (max-width : 600.99px) { #toast-container { min-width: 100%; bottom: 0%; } } - -@media only screen and (min-width: 601px) and (max-width: 992.99px) { +@media only screen and (min-width : 601px) and (max-width : 992.99px) { #toast-container { left: 5%; bottom: 7%; max-width: 90%; } } - -@media only screen and (min-width: 993px) { +@media only screen and (min-width : 993px) { #toast-container { top: 10%; right: 7%; @@ -4975,7 +5459,7 @@ small { } .toast { - border-radius: 2px; + border-radius: 4px; top: 35px; width: auto; margin-top: 10px; @@ -4983,12 +5467,13 @@ small { max-width: 100%; height: auto; min-height: 48px; - line-height: 1.5em; - background-color: #323232; - padding: 10px 25px; - font-size: 1.1rem; - font-weight: 300; - color: #fff; + padding-left: 16px; + padding-right: 12px; + font-size: 14px; + font-weight: 500; + line-height: 20px; + color: var(--md-sys-color-inverse-on-surface); + background-color: var(--md-sys-color-inverse-surface); display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -5003,19 +5488,16 @@ small { justify-content: space-between; cursor: default; } - .toast .toast-action { - color: #eeff41; + color: var(--md-sys-color-inverse-primary); font-weight: 500; margin-right: -25px; margin-left: 3rem; } - .toast.rounded { border-radius: 24px; } - -@media only screen and (max-width: 600.99px) { +@media only screen and (max-width : 600.99px) { .toast { width: 100%; border-radius: 0; @@ -5023,61 +5505,67 @@ small { } .tabs { + padding-left: 0; + list-style-type: none; position: relative; overflow-x: auto; overflow-y: hidden; height: 48px; width: 100%; - background-color: #fff; + background-color: var(--md-sys-color-surface); margin: 0 auto; white-space: nowrap; } - .tabs.tabs-transparent { background-color: transparent; } - -.tabs.tabs-transparent .tab a, +.tabs.tabs-transparent .tab a { + color: var(--font-on-primary-color-medium); +} .tabs.tabs-transparent .tab.disabled a, -.tabs.tabs-transparent .tab.disabled a:hover { - color: rgba(255, 255, 255, 0.7); +.tabs.tabs-transparent .tab.disabled a:hover, +.tabs.tabs-transparent .tab.disabled a:focus { + color: rgba(255, 255, 255, 0.38); +} +.tabs.tabs-transparent .tab a:hover { + background-color: rgba(0, 0, 0, 0.04); +} +.tabs.tabs-transparent .tab a.active, +.tabs.tabs-transparent .tab a:focus { + background-color: transparent; } - .tabs.tabs-transparent .tab a:hover, -.tabs.tabs-transparent .tab a.active { - color: #fff; +.tabs.tabs-transparent .tab a.active, +.tabs.tabs-transparent .tab a:focus { + color: var(--md-sys-color-on-primary); } - .tabs.tabs-transparent .indicator { - background-color: #fff; + background-color: var(--md-sys-color-on-primary); } - .tabs.tabs-fixed-width { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } - .tabs.tabs-fixed-width .tab { -webkit-box-flex: 1; -webkit-flex-grow: 1; -ms-flex-positive: 1; flex-grow: 1; } - .tabs .tab { + padding-left: 0; + list-style-type: none; display: inline-block; text-align: center; line-height: 48px; height: 48px; padding: 0; margin: 0; - text-transform: uppercase; } - .tabs .tab a { - color: rgba(238, 110, 115, 0.7); + color: var(--md-sys-color-on-surface-variant); display: block; width: 100%; height: 100%; @@ -5085,35 +5573,41 @@ small { font-size: 14px; text-overflow: ellipsis; overflow: hidden; - -webkit-transition: color .28s ease, background-color .28s ease; - transition: color .28s ease, background-color .28s ease; + -webkit-transition: color 0.28s ease, background-color 0.28s ease; + transition: color 0.28s ease, background-color 0.28s ease; } - -.tabs .tab a:focus, .tabs .tab a:focus.active { - background-color: rgba(246, 178, 181, 0.2); +.tabs .tab a.active { + background-color: transparent; +} +.tabs .tab a.active, .tabs .tab a:focus, .tabs .tab a:hover { + color: var(--md-sys-color-primary); +} +.tabs .tab a:hover { + background-color: rgba(var(--md-sys-color-primary-numeric), 0.06); +} +.tabs .tab a:focus, .tabs .tab a.active { + background-color: rgba(var(--md-sys-color-primary-numeric), 0.18); outline: none; } - -.tabs .tab a:hover, .tabs .tab a.active { - background-color: transparent; - color: #ee6e73; -} - -.tabs .tab.disabled a, -.tabs .tab.disabled a:hover { - color: rgba(238, 110, 115, 0.4); +.tabs .tab.disabled a, .tabs .tab.disabled a:hover { + color: var(--md-sys-color-on-surface); cursor: default; + background-color: transparent; +} +.tabs .tab.disabled a:not(:focus), .tabs .tab.disabled a:hover:not(:focus) { + background-color: transparent; } - .tabs .indicator { position: absolute; bottom: 0; - height: 2px; - background-color: #f6b2b5; + height: 3px; + background-color: var(--md-sys-color-primary); will-change: left, right; + border-radius: 3px 3px 0 0; } -@media only screen and (max-width: 992.99px) { +/* Fixed Sidenav hide on smaller */ +@media only screen and (max-width : 992.99px) { .tabs { display: -webkit-box; display: -webkit-flex; @@ -5130,26 +5624,39 @@ small { padding: 0 12px; } } - .material-tooltip { - padding: 10px 8px; - font-size: 1rem; - z-index: 2000; - background-color: transparent; - border-radius: 2px; - color: #fff; - min-height: 36px; - line-height: 120%; + padding: 0 8px; + border-radius: 4px; + color: var(--md-sys-color-inverse-on-surface); + background-color: var(--md-sys-color-inverse-surface); + font-family: var(--md-sys-typescale-body-small-font-family-name); + font-size: var(--md-sys-typescale-body-small-font-size); + line-height: var(--md-sys-typescale-body-small-line-height); + font-weight: var(--md-sys-typescale-body-small-font-weight); + min-height: 24px; opacity: 0; + padding-top: 6px; + padding-bottom: 6px; + font-size: 12px; + line-height: 16px; + font-weight: 400; + letter-spacing: 0.4px; position: absolute; - text-align: center; - max-width: calc(100% - 4px); + max-width: 300px; overflow: hidden; left: 0; top: 0; pointer-events: none; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; visibility: hidden; - background-color: #323232; + z-index: 2000; } .backdrop { @@ -5158,185 +5665,228 @@ small { height: 7px; width: 14px; border-radius: 0 0 50% 50%; - background-color: #323232; + background-color: var(--md-sys-color-inverse-surface); z-index: -1; - -webkit-transform-origin: 50% 0%; - transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0; + transform-origin: 50% 0; visibility: hidden; } -.btn, .btn-large, .btn-small, -.btn-flat { +.btn, .btn-small, .btn-large, .btn-floating, .btn-flat { + --btn-height: 40px; + --btn-font-size-icon: 16px; + --btn-padding: 24px; + --btn-padding-icon: 16px; + --btn-gap-icon: 8px; + --btn-border-radius: 4px; + --btn-font-size: 14px; + height: var(--btn-height); border: none; - border-radius: 2px; - display: inline-block; - height: 36px; - line-height: 36px; - padding: 0 16px; - text-transform: uppercase; - vertical-align: middle; + border-radius: var(--btn-border-radius); + padding-left: var(--btn-padding); + padding-right: var(--btn-padding); + font-size: ver(--btn-font-size); + font-weight: 500; + text-decoration: none; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + cursor: pointer; -webkit-tap-highlight-color: transparent; + white-space: nowrap; + outline: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-transition: background-color 0.2s ease-out; + transition: background-color 0.2s ease-out; } -.btn.disabled, .disabled.btn-large, .disabled.btn-small, -.btn-floating.disabled, -.btn-large.disabled, -.btn-small.disabled, -.btn-flat.disabled, -.btn:disabled, -.btn-large:disabled, -.btn-small:disabled, -.btn-floating:disabled, -.btn-large:disabled, -.btn-small:disabled, -.btn-flat:disabled, -.btn[disabled], -.btn-large[disabled], -.btn-small[disabled], -.btn-floating[disabled], -.btn-large[disabled], -.btn-small[disabled], -.btn-flat[disabled] { +.btn.icon-left, .icon-left.btn-small, .icon-left.btn-large, .btn.icon-right, .icon-right.btn-small, .icon-right.btn-large { + position: relative; +} + +.btn.icon-left, .icon-left.btn-small, .icon-left.btn-large { + padding-left: calc(var(--btn-padding-icon) + var(--btn-font-size-icon) + var(--btn-gap-icon)); +} + +.btn.icon-right, .icon-right.btn-small, .icon-right.btn-large { + padding-right: calc(var(--btn-padding-icon) + var(--btn-font-size-icon) + var(--btn-gap-icon)); +} + +.btn.icon-left i, .icon-left.btn-small i, .icon-left.btn-large i, .btn.icon-right i, .icon-right.btn-small i, .icon-right.btn-large i { + position: absolute; + font-size: var(--btn-font-size-icon); +} + +.btn.icon-left i, .icon-left.btn-small i, .icon-left.btn-large i { + left: var(--btn-padding-icon); +} + +.btn.icon-right i, .icon-right.btn-small i, .icon-right.btn-large i { + right: var(--btn-padding-icon); +} + +.btn.filled, .filled.btn-small, .filled.btn-large { + color: var(--md-sys-color-on-primary); + background-color: var(--md-sys-color-primary); +} + +.btn.tonal, .tonal.btn-small, .tonal.btn-large { + color: var(--md-sys-color-on-secondary-container); + background-color: var(--md-sys-color-secondary-container); +} + +.btn.elevated, .elevated.btn-small, .elevated.btn-large { + color: var(--md-sys-color-on-secondary-container); + background-color: var(--md-sys-color-secondary-container); +} + +.btn.outlined, .outlined.btn-small, .outlined.btn-large { + background-color: transparent; + color: var(--md-sys-color-primary); + border: 1px solid var(--md-sys-color-outline); +} + +.btn.text, .text.btn-small, .text.btn-large, .btn-flat { + color: var(--md-sys-color-primary); + background-color: transparent; +} + +.btn.disabled, .btn-floating.disabled, .btn-large.disabled, .btn-small.disabled, .btn-flat.disabled, +.btn:disabled, .btn-floating:disabled, .btn-large:disabled, .btn-small:disabled, .btn-flat:disabled, +.btn[disabled], .btn-floating[disabled], .btn-large[disabled], .btn-small[disabled], .btn-flat[disabled] { + color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 76%); + background-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 24%); pointer-events: none; - background-color: #DFDFDF !important; -webkit-box-shadow: none; box-shadow: none; - color: #9F9F9F !important; cursor: default; } -.btn.disabled:hover, .disabled.btn-large:hover, .disabled.btn-small:hover, -.btn-floating.disabled:hover, -.btn-large.disabled:hover, -.btn-small.disabled:hover, -.btn-flat.disabled:hover, -.btn:disabled:hover, -.btn-large:disabled:hover, -.btn-small:disabled:hover, -.btn-floating:disabled:hover, -.btn-large:disabled:hover, -.btn-small:disabled:hover, -.btn-flat:disabled:hover, -.btn[disabled]:hover, -.btn-large[disabled]:hover, -.btn-small[disabled]:hover, -.btn-floating[disabled]:hover, -.btn-large[disabled]:hover, -.btn-small[disabled]:hover, -.btn-flat[disabled]:hover { - background-color: #DFDFDF !important; - color: #9F9F9F !important; +.btn.elevated:hover, .elevated.btn-small:hover, .elevated.btn-large:hover { + color: var(--md-sys-color-primary); + background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-on-secondary-container) 16%); } -.btn, .btn-large, .btn-small, -.btn-floating, -.btn-large, -.btn-small, -.btn-flat { - font-size: 14px; - outline: 0; +.btn.filled:hover, .filled.btn-small:hover, .filled.btn-large:hover { + color: var(--md-sys-color-on-primary); + background-color: color-mix(in srgb, var(--md-sys-color-primary), var(--md-sys-color-on-primary) 16%); } -.btn i, .btn-large i, .btn-small i, -.btn-floating i, -.btn-large i, -.btn-small i, -.btn-flat i { - font-size: 1.3rem; - line-height: inherit; +.btn.tonal:hover, .tonal.btn-small:hover, .tonal.btn-large:hover { + color: var(--md-sys-color-on-secondary-container); + background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-on-secondary-container) 16%); } -.btn:focus, .btn-large:focus, .btn-small:focus, -.btn-floating:focus { - background-color: #1d7d74; +.btn.outlined:hover, .outlined.btn-small:hover, .outlined.btn-large:hover { + color: var(--md-sys-color-primary); + background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 16%); } -.btn, .btn-large, .btn-small { - text-decoration: none; - color: #fff; - background-color: #26a69a; - text-align: center; - letter-spacing: .5px; - -webkit-transition: background-color .2s ease-out; - transition: background-color .2s ease-out; - cursor: pointer; +.btn.text:hover, .text.btn-small:hover, .text.btn-large:hover { + color: var(--md-sys-color-primary); + background-color: color-mix(in srgb, var(--md-sys-color-primary) 16%, transparent); } -.btn:hover, .btn-large:hover, .btn-small:hover { - background-color: #2bbbad; +.btn:focus.elevated, .btn-small:focus.elevated, .btn-large:focus.elevated { + color: var(--md-sys-color-primary); + background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-primary) 20%); +} + +.btn:focus.filled, .btn-small:focus.filled, .btn-large:focus.filled { + color: var(--md-sys-color-on-primary); + background-color: color-mix(in srgb, var(--md-sys-color-primary), var(--md-sys-color-on-primary) 20%); +} + +.btn:focus.tonal, .btn-small:focus.tonal, .btn-large:focus.tonal { + color: var(--md-sys-color-on-secondary-container); + background-color: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-on-secondary-container) 20%); +} + +.btn:focus.outlined, .btn-small:focus.outlined, .btn-large:focus.outlined { + color: var(--md-sys-color-primary); + background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 20%); + border: 1px solid var(--md-sys-color-primary); +} + +.btn:focus.text, .btn-small:focus.text, .btn-large:focus.text { + color: var(--md-sys-color-primary); + background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 20%); +} + +.btn:focus-visible.filled, .btn-small:focus-visible.filled, .btn-large:focus-visible.filled, .btn:focus-visible.elevated, .btn-small:focus-visible.elevated, .btn-large:focus-visible.elevated, .btn:focus-visible.tonal, .btn-small:focus-visible.tonal, .btn-large:focus-visible.tonal, .btn:focus-visible.outlined, .btn-small:focus-visible.outlined, .btn-large:focus-visible.outlined, .btn:focus-visible.text, .btn-small:focus-visible.text, .btn-large:focus-visible.text { + outline: 3px solid var(--md-sys-color-secondary); + outline-offset: 2px; } .btn-floating { - display: inline-block; - color: #fff; + width: 40px; + height: 40px; + color: var(--md-sys-color-on-primary-container); + background-color: var(--md-sys-color-primary-container); + border-radius: 16px; + padding: 0; + display: grid; + grid-auto-flow: column; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; position: relative; overflow: hidden; z-index: 1; - width: 40px; - height: 40px; - line-height: 40px; - padding: 0; - background-color: #26a69a; - border-radius: 50%; - -webkit-transition: background-color .3s; - transition: background-color .3s; + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; cursor: pointer; vertical-align: middle; } - .btn-floating:hover { - background-color: #26a69a; + background-color: color-mix(in srgb, var(--md-sys-color-primary-container), var(--md-sys-color-on-primary-container) 16%); +} +.btn-floating:focus { + background-color: var(--md-ref-palette-secondary80); } - .btn-floating:before { border-radius: 0; } - .btn-floating.btn-large { width: 56px; height: 56px; padding: 0; } - .btn-floating.btn-large.halfway-fab { bottom: -28px; } - -.btn-floating.btn-large i { - line-height: 56px; -} - .btn-floating.btn-small { - width: 32.4px; - height: 32.4px; + --btn-small-height: calc(0.75 * var(--btn-height)); + width: var(--btn-small-height) e; + height: var(--btn-small-height); } - .btn-floating.btn-small.halfway-fab { - bottom: -16.2px; + bottom: calc(var(--btn-small-height) * -0.5); } - -.btn-floating.btn-small i { - line-height: 32.4px; -} - .btn-floating.halfway-fab { position: absolute; right: 24px; bottom: -20px; } - .btn-floating.halfway-fab.left { right: auto; left: 24px; } - .btn-floating i { + color: var(--md-sys-color-on-secondary); + font-size: 1.6rem; width: inherit; display: inline-block; text-align: center; - color: #fff; - font-size: 1.6rem; - line-height: 40px; } button.btn-floating { @@ -5351,15 +5901,14 @@ button.btn-floating { margin-bottom: 0; z-index: 997; } - .fixed-action-btn.active ul { visibility: visible; + padding-left: 0; + list-style-type: none; } - .fixed-action-btn.direction-left, .fixed-action-btn.direction-right { padding: 0 0 0 15px; } - .fixed-action-btn.direction-left ul, .fixed-action-btn.direction-right ul { text-align: right; right: 64px; @@ -5371,31 +5920,25 @@ button.btn-floating { /*width 100% only goes to width of button container */ width: 500px; } - .fixed-action-btn.direction-left ul li, .fixed-action-btn.direction-right ul li { display: inline-block; margin: 7.5px 15px 0 0; } - .fixed-action-btn.direction-right { padding: 0 15px 0 0; } - .fixed-action-btn.direction-right ul { text-align: left; direction: rtl; left: 64px; right: auto; } - .fixed-action-btn.direction-right ul li { margin: 7.5px 0 0 15px; } - .fixed-action-btn.direction-bottom { padding: 0 0 15px 0; } - .fixed-action-btn.direction-bottom ul { top: 64px; bottom: auto; @@ -5409,20 +5952,16 @@ button.btn-floating { -ms-flex-direction: column-reverse; flex-direction: column-reverse; } - .fixed-action-btn.direction-bottom ul li { margin: 15px 0 0 0; } - .fixed-action-btn.toolbar { padding: 0; height: 56px; } - .fixed-action-btn.toolbar.active > a i { opacity: 0; } - .fixed-action-btn.toolbar ul { display: -webkit-box; display: -webkit-flex; @@ -5432,7 +5971,6 @@ button.btn-floating { bottom: 0; z-index: 1; } - .fixed-action-btn.toolbar ul li { -webkit-box-flex: 1; -webkit-flex: 1; @@ -5444,7 +5982,6 @@ button.btn-floating { -webkit-transition: none; transition: none; } - .fixed-action-btn.toolbar ul li a { display: block; overflow: hidden; @@ -5454,15 +5991,13 @@ button.btn-floating { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; - color: #fff; + color: var(--md-sys-color-on-secondary); line-height: 56px; z-index: 1; } - .fixed-action-btn.toolbar ul li a i { line-height: inherit; } - .fixed-action-btn ul { left: 0; right: 0; @@ -5472,15 +6007,12 @@ button.btn-floating { margin: 0; visibility: hidden; } - .fixed-action-btn ul li { margin-bottom: 15px; } - .fixed-action-btn ul a.btn-floating { opacity: 0; } - .fixed-action-btn .fab-backdrop { position: absolute; top: 0; @@ -5488,54 +6020,25 @@ button.btn-floating { z-index: -1; width: 40px; height: 40px; - background-color: #26a69a; - border-radius: 50%; + background-color: var(--md-sys-color-secondary); + border-radius: 16px; -webkit-transform: scale(0); transform: scale(0); } -.btn-flat { - -webkit-box-shadow: none; - box-shadow: none; - background-color: transparent; - color: #343434; - cursor: pointer; - -webkit-transition: background-color .2s; - transition: background-color .2s; -} - -.btn-flat:focus, .btn-flat:hover { - -webkit-box-shadow: none; - box-shadow: none; -} - -.btn-flat:focus { - background-color: rgba(0, 0, 0, 0.1); -} - -.btn-flat.disabled, .btn-flat.btn-flat[disabled] { - background-color: transparent !important; - color: #b3b2b2 !important; - cursor: default; -} - .btn-large { - height: 54px; - line-height: 54px; - font-size: 15px; + height: calc(1.5 * var(--btn-height)); + font-size: 18px; padding: 0 28px; } - .btn-large i { font-size: 1.6rem; } .btn-small { - height: 32.4px; - line-height: 32.4px; + height: calc(0.75 * var(--btn-height)); font-size: 13px; } - .btn-small i { font-size: 1.2rem; } @@ -5544,8 +6047,14 @@ button.btn-floating { display: block; } +.btn.rounded, .rounded.btn-large, .rounded.btn-small { + border-radius: 99999px; +} + .dropdown-content { - background-color: #fff; + padding-left: 0; + list-style-type: none; + background-color: var(--md-sys-color-surface); margin: 0; display: none; min-width: 100px; @@ -5558,48 +6067,34 @@ button.btn-floating { -webkit-transform-origin: 0 0; transform-origin: 0 0; } - -.dropdown-content:focus { - outline: 0; -} - .dropdown-content li { clear: both; - color: rgba(0, 0, 0, 0.87); + color: var(--md-sys-color-on-background); cursor: pointer; min-height: 50px; line-height: 1.5rem; width: 100%; text-align: left; } - .dropdown-content li:hover, .dropdown-content li.active { - background-color: #eee; + background-color: color-mix(in srgb, var(--md-sys-color-surface), var(--md-sys-color-on-surface) 8%); } - -.dropdown-content li:focus { - outline: none; -} - .dropdown-content li.divider { min-height: 0; height: 1px; } - .dropdown-content li > a, .dropdown-content li > span { font-size: 16px; - color: #26a69a; + color: var(--md-sys-color-primary); display: block; line-height: 22px; padding: 14px 16px; } - .dropdown-content li > span > label { top: 1px; left: 0; height: 18px; } - .dropdown-content li > a > i { height: inherit; line-height: inherit; @@ -5609,10 +6104,10 @@ button.btn-floating { } body.keyboard-focused .dropdown-content li:focus { - background-color: #dadada; + background-color: rgba(0, 0, 0, 0.12); } -.input-field.col .dropdown-content [type="checkbox"] + label { +.input-field.col .dropdown-content [type=checkbox] + label { top: 1px; left: 0; height: 18px; @@ -5624,224 +6119,50 @@ body.keyboard-focused .dropdown-content li:focus { cursor: pointer; } -/*! - * Waves v0.7.6 - * http://fian.my.id/Waves - * - * Copyright 2014-2018 Alfiana E. Sibuea and other contributors - * Released under the MIT license - * https://github.com/fians/Waves/blob/master/LICENSE */ -.waves-effect { - position: relative; - cursor: pointer; - display: inline-block; - overflow: hidden; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-tap-highlight-color: transparent; -} - -.waves-effect .waves-ripple { - position: absolute; - border-radius: 50%; - width: 100px; - height: 100px; - margin-top: -50px; - margin-left: -50px; - opacity: 0; - background: rgba(0, 0, 0, 0.2); - background: radial-gradient(rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(255, 255, 255, 0) 70%); - -webkit-transition: all 0.5s ease-out; - transition: all 0.5s ease-out; - -webkit-transition-property: -webkit-transform, opacity; - -webkit-transition-property: opacity, -webkit-transform; - transition-property: opacity, -webkit-transform; - transition-property: transform, opacity; - transition-property: transform, opacity, -webkit-transform; - -webkit-transform: scale(0) translate(0, 0); - transform: scale(0) translate(0, 0); - pointer-events: none; -} - -.waves-effect.waves-light .waves-ripple { - background: rgba(255, 255, 255, 0.4); - background: radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%); -} - -.waves-effect.waves-classic .waves-ripple { - background: rgba(0, 0, 0, 0.2); -} - -.waves-effect.waves-classic.waves-light .waves-ripple { - background: rgba(255, 255, 255, 0.4); -} - -.waves-effect.waves-light .waves-ripple { - background-color: rgba(255, 255, 255, 0.45); -} - -.waves-effect.waves-red .waves-ripple { - background-color: rgba(244, 67, 54, 0.7); -} - -.waves-effect.waves-yellow .waves-ripple { - background-color: rgba(255, 235, 59, 0.7); -} - -.waves-effect.waves-orange .waves-ripple { - background-color: rgba(255, 152, 0, 0.7); -} - -.waves-effect.waves-purple .waves-ripple { - background-color: rgba(156, 39, 176, 0.7); -} - -.waves-effect.waves-green .waves-ripple { - background-color: rgba(76, 175, 80, 0.7); -} - -.waves-effect.waves-teal .waves-ripple { - background-color: rgba(0, 150, 136, 0.7); -} - -.waves-effect input[type="button"], .waves-effect input[type="reset"], .waves-effect input[type="submit"] { - border: 0; - font-style: normal; - font-size: inherit; - text-transform: inherit; - background: none; -} - -.waves-notransition { - -webkit-transition: none !important; - transition: none !important; -} - -.waves-button, -.waves-circle { - -webkit-transform: translateZ(0); - transform: translateZ(0); - -webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%); -} - -.waves-button, -.waves-button:hover, -.waves-button:visited, -.waves-button-input { - white-space: nowrap; - vertical-align: middle; - cursor: pointer; - border: none; - outline: none; - color: inherit; - background-color: rgba(0, 0, 0, 0); - font-size: 1em; - line-height: 1em; - text-align: center; - text-decoration: none; - z-index: 1; -} - -.waves-button { - padding: 0.85em 1.1em; - border-radius: 0.2em; -} - -.waves-button-input { - margin: 0; - padding: 0.85em 1.1em; -} - -.waves-input-wrapper { - border-radius: 0.2em; - vertical-align: bottom; -} - -.waves-input-wrapper.waves-button { - padding: 0; -} - -.waves-input-wrapper .waves-button-input { - position: relative; - top: 0; - left: 0; - z-index: 1; -} - -.waves-circle { - text-align: center; - width: 2.5em; - height: 2.5em; - line-height: 2.5em; - border-radius: 50%; -} - -.waves-float { - -webkit-mask-image: none; - -webkit-box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12); - box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12); - -webkit-transition: all 300ms; - transition: all 300ms; -} - -.waves-float:active { - -webkit-box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3); - box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3); -} - -.waves-block { - display: block; -} - .modal { + --modal-footer-height: 56px; + --modal-footer-divider-height: 1px; + --modal-border-radius: 28px; + --modal-padding: 24px; display: none; position: fixed; left: 0; right: 0; - background-color: #fafafa; + background-color: var(--md-sys-color-surface); padding: 0; max-height: 70%; width: 55%; margin: auto; overflow-y: auto; - border-radius: 2px; + border-radius: var(--modal-border-radius); will-change: top, opacity; } - .modal:focus { outline: none; } - -@media only screen and (max-width: 992.99px) { +@media only screen and (max-width : 992.99px) { .modal { width: 80%; } } - .modal h1, .modal h2, .modal h3, .modal h4 { margin-top: 0; } - .modal .modal-content { - padding: 24px; + padding: var(--modal-padding); overflow-y: hidden; } - .modal .modal-close { cursor: pointer; } - .modal .modal-footer { - border-radius: 0 0 2px 2px; - background-color: #fafafa; + border-radius: 0 0 var(--modal-border-radius) var(--modal-border-radius); + background-color: var(--md-sys-color-surface); padding: 4px 6px; - height: 56px; + height: var(--modal-footer-height); width: 100%; text-align: right; } - .modal .modal-footer .btn, .modal .modal-footer .btn-large, .modal .modal-footer .btn-small, .modal .modal-footer .btn-flat { margin: 6px 0; } @@ -5864,19 +6185,17 @@ body.keyboard-focused .dropdown-content li:focus { padding: 0; height: 70%; } - .modal.modal-fixed-footer .modal-content { position: absolute; - height: calc(100% - 56px); + height: calc(100% - var(--modal-footer-height)); max-height: 100%; width: 100%; overflow-y: auto; } - .modal.modal-fixed-footer .modal-footer { - border-top: 1px solid rgba(0, 0, 0, 0.1); + border-top: var(--modal-footer-divider-height) solid var(--md-sys-color-outline-variant); position: absolute; - bottom: 0; + bottom: var(--modal-footer-divider-height); } .modal.bottom-sheet { @@ -5890,9 +6209,11 @@ body.keyboard-focused .dropdown-content li:focus { } .collapsible { - border-top: 1px solid #ddd; - border-right: 1px solid #ddd; - border-left: 1px solid #ddd; + padding-left: 0; + list-style-type: none; + border-top: 1px solid var(--md-sys-color-outline-variant); + border-right: 1px solid var(--md-sys-color-outline-variant); + border-left: 1px solid var(--md-sys-color-outline-variant); margin: 0.5rem 0 1rem 0; } @@ -5905,14 +6226,11 @@ body.keyboard-focused .dropdown-content li:focus { -webkit-tap-highlight-color: transparent; line-height: 1.5; padding: 1rem; - background-color: #fff; - border-bottom: 1px solid #ddd; + border-bottom: 1px solid var(--md-sys-color-outline-variant); } - .collapsible-header:focus { outline: 0; } - .collapsible-header i { width: 2rem; font-size: 1.6rem; @@ -5921,58 +6239,28 @@ body.keyboard-focused .dropdown-content li:focus { margin-right: 1rem; } +.collapsible-header::after { + content: "â–¾"; + text-align: right; + margin-right: 0.25rem; + width: 100%; +} + +.active .collapsible-header::after { + content: "â–´"; +} + .keyboard-focused .collapsible-header:focus { - background-color: #eee; + background-color: rgba(0, 0, 0, 0.12); } .collapsible-body { - display: none; - border-bottom: 1px solid #ddd; + max-height: 0; + border-bottom: 1px solid var(--md-sys-color-outline-variant); -webkit-box-sizing: border-box; box-sizing: border-box; - padding: 2rem; -} - -.sidenav .collapsible, -.sidenav.sidenav-fixed .collapsible { - border: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -.sidenav .collapsible li, -.sidenav.sidenav-fixed .collapsible li { - padding: 0; -} - -.sidenav .collapsible-header, -.sidenav.sidenav-fixed .collapsible-header { - background-color: transparent; - border: none; - line-height: inherit; - height: inherit; - padding: 0 16px; -} - -.sidenav .collapsible-header:hover, -.sidenav.sidenav-fixed .collapsible-header:hover { - background-color: rgba(0, 0, 0, 0.05); -} - -.sidenav .collapsible-header i, -.sidenav.sidenav-fixed .collapsible-header i { - line-height: inherit; -} - -.sidenav .collapsible-body, -.sidenav.sidenav-fixed .collapsible-body { - border: 0; - background-color: #fff; -} - -.sidenav .collapsible-body li a, -.sidenav.sidenav-fixed .collapsible-body li a { - padding: 0 23.5px 0 31px; + padding: 0 2rem; + overflow: hidden; } .collapsible.popout { @@ -5980,7 +6268,6 @@ body.keyboard-focused .dropdown-content li:focus { -webkit-box-shadow: none; box-shadow: none; } - .collapsible.popout > li { -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); @@ -5988,7 +6275,6 @@ body.keyboard-focused .dropdown-content li:focus { -webkit-transition: margin 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); transition: margin 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); } - .collapsible.popout > li.active { -webkit-box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15); box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15); @@ -5996,83 +6282,124 @@ body.keyboard-focused .dropdown-content li:focus { } .chip { - display: inline-block; + --font-size: 14px; + --font-size-icon: 18px; + --padding: 8px; + color: var(--md-sys-color-on-surface-variant); + background-color: rgba(0, 0, 0, 0.09); + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + white-space: nowrap; + gap: 8px; + margin: 0; height: 32px; - font-size: 13px; + padding-left: var(--padding); + padding-right: var(--padding); + font-size: var(--font-size); font-weight: 500; - color: rgba(0, 0, 0, 0.6); - line-height: 32px; - padding: 0 12px; - border-radius: 16px; - background-color: #e4e4e4; - margin-bottom: 5px; - margin-right: 5px; + border-radius: 8px; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + vertical-align: top; } - .chip:focus { outline: none; - background-color: #26a69a; - color: #fff; + background-color: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); +} + +.chip.outlined { + background-color: transparent; + border-color: var(--md-sys-color-outline); + border-width: 1px; + border-style: solid; } .chip > img { - float: left; - margin: 0 8px 0 -12px; - height: 32px; - width: 32px; - border-radius: 50%; + margin: 0; + width: 24px; + height: 24px; + -o-object-fit: cover; + object-fit: cover; + border-radius: 12px; +} + +.chip > .material-icons { + font-size: var(--font-size-icon); } .chip .close { + border-radius: 50%; + height: 24px; + width: 24px; + padding: 0; + display: grid; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-content: center; + -ms-flex-line-pack: center; + align-content: center; cursor: pointer; - float: right; - font-size: 16px; - line-height: 32px; - padding-left: 8px; +} + +.chip .close:hover { + background-color: rgba(136, 136, 136, 0.5333333333); } .chips { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + gap: 4px; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; border: none; - border-bottom: 1px solid #9e9e9e; + border-bottom: 1px solid var(--md-sys-color-on-surface-variant); -webkit-box-shadow: none; box-shadow: none; margin: 0 0 8px 0; - min-height: 45px; + padding: 4px; outline: none; - -webkit-transition: all .3s; - transition: all .3s; + -webkit-transition: all 0.3s; + transition: all 0.3s; } - .chips.focus { - border-bottom: 1px solid #26a69a; - -webkit-box-shadow: 0 1px 0 0 #26a69a; - box-shadow: 0 1px 0 0 #26a69a; + border-bottom: 1px solid var(--md-sys-color-primary); + -webkit-box-shadow: 0 1px 0 0 var(--md-sys-color-primary); + box-shadow: 0 1px 0 0 var(--md-sys-color-primary); } - .chips:hover { cursor: text; } - .chips input:not([type]):not(.browser-default).input { background: none; border: 0; - color: rgba(0, 0, 0, 0.6); + color: var(--md-sys-color-on-background); display: inline-block; font-size: 16px; - height: 3rem; - line-height: 32px; + height: 32px; outline: 0; margin: 0; padding: 0; width: 120px; } - .chips input:not([type]):not(.browser-default).input:focus { border: 0; -webkit-box-shadow: none; box-shadow: none; } - .chips .autocomplete-content { margin-top: 0; margin-bottom: 0; @@ -6101,15 +6428,13 @@ body.keyboard-focused .dropdown-content li:focus { cursor: -webkit-zoom-in; cursor: zoom-in; position: relative; - -webkit-transition: opacity .4s; - transition: opacity .4s; + -webkit-transition: opacity 0.4s; + transition: opacity 0.4s; -webkit-backface-visibility: hidden; } - .materialboxed:hover:not(.active) { - opacity: .8; + opacity: 0.8; } - .materialboxed.active { cursor: -webkit-zoom-out; cursor: zoom-out; @@ -6121,7 +6446,7 @@ body.keyboard-focused .dropdown-content li:focus { right: 0; bottom: 0; left: 0; - background-color: #292929; + background-color: var(--md-sys-color-background); z-index: 1000; will-change: opacity; } @@ -6129,7 +6454,7 @@ body.keyboard-focused .dropdown-content li:focus { .materialbox-caption { position: fixed; display: none; - color: #fff; + color: var(--md-sys-color-on-background); line-height: 50px; bottom: 0; left: 0; @@ -6142,33 +6467,35 @@ body.keyboard-focused .dropdown-content li:focus { } select:focus { - outline: 1px solid #c9f3ef; + outline: 1px solid var(--md-ref-palette-primary80); } +/* button:focus { outline: none; - background-color: #2ab7a9; + background-color: $button-background-focus; } - +*/ label { font-size: 0.8rem; - color: #9e9e9e; + color: var(--md-sys-color-on-surface-variant); } -/* Text Inputs + Textarea - ========================================================================== */ /* Style Placeholders */ ::-webkit-input-placeholder { - color: #d1d1d1; + color: var(--md-sys-color-on-surface-variant); } ::-moz-placeholder { - color: #d1d1d1; + color: var(--md-sys-color-on-surface-variant); +} +:-ms-input-placeholder { + color: var(--md-sys-color-on-surface-variant); } ::-ms-input-placeholder { - color: #d1d1d1; + color: var(--md-sys-color-on-surface-variant); } ::placeholder { - color: #d1d1d1; + color: var(--md-sys-color-on-surface-variant); } /* Text inputs */ @@ -6181,580 +6508,284 @@ input[type=time]:not(.browser-default), input[type=date]:not(.browser-default), input[type=datetime]:not(.browser-default), input[type=datetime-local]:not(.browser-default), +input[type=month]:not(.browser-default), input[type=tel]:not(.browser-default), input[type=number]:not(.browser-default), input[type=search]:not(.browser-default), textarea.materialize-textarea { - background-color: transparent; - border: none; - border-bottom: 1px solid #9e9e9e; - border-radius: 0; outline: none; - height: 3rem; + color: var(--md-sys-color-on-background); width: 100%; font-size: 16px; - margin: 0 0 8px 0; - padding: 0; - -webkit-box-shadow: none; - box-shadow: none; - -webkit-box-sizing: content-box; - box-sizing: content-box; - -webkit-transition: border .3s, -webkit-box-shadow .3s; - transition: border .3s, -webkit-box-shadow .3s; - transition: box-shadow .3s, border .3s; - transition: box-shadow .3s, border .3s, -webkit-box-shadow .3s; -} - -input:not([type]):not(.browser-default):disabled, input:not([type]):not(.browser-default)[readonly="readonly"], -input[type=text]:not(.browser-default):disabled, -input[type=text]:not(.browser-default)[readonly="readonly"], -input[type=password]:not(.browser-default):disabled, -input[type=password]:not(.browser-default)[readonly="readonly"], -input[type=email]:not(.browser-default):disabled, -input[type=email]:not(.browser-default)[readonly="readonly"], -input[type=url]:not(.browser-default):disabled, -input[type=url]:not(.browser-default)[readonly="readonly"], -input[type=time]:not(.browser-default):disabled, -input[type=time]:not(.browser-default)[readonly="readonly"], -input[type=date]:not(.browser-default):disabled, -input[type=date]:not(.browser-default)[readonly="readonly"], -input[type=datetime]:not(.browser-default):disabled, -input[type=datetime]:not(.browser-default)[readonly="readonly"], -input[type=datetime-local]:not(.browser-default):disabled, -input[type=datetime-local]:not(.browser-default)[readonly="readonly"], -input[type=tel]:not(.browser-default):disabled, -input[type=tel]:not(.browser-default)[readonly="readonly"], -input[type=number]:not(.browser-default):disabled, -input[type=number]:not(.browser-default)[readonly="readonly"], -input[type=search]:not(.browser-default):disabled, -input[type=search]:not(.browser-default)[readonly="readonly"], -textarea.materialize-textarea:disabled, -textarea.materialize-textarea[readonly="readonly"] { - color: rgba(0, 0, 0, 0.42); - border-bottom: 1px dotted rgba(0, 0, 0, 0.42); -} - -input:not([type]):not(.browser-default):disabled + label, -input:not([type]):not(.browser-default)[readonly="readonly"] + label, -input[type=text]:not(.browser-default):disabled + label, -input[type=text]:not(.browser-default)[readonly="readonly"] + label, -input[type=password]:not(.browser-default):disabled + label, -input[type=password]:not(.browser-default)[readonly="readonly"] + label, -input[type=email]:not(.browser-default):disabled + label, -input[type=email]:not(.browser-default)[readonly="readonly"] + label, -input[type=url]:not(.browser-default):disabled + label, -input[type=url]:not(.browser-default)[readonly="readonly"] + label, -input[type=time]:not(.browser-default):disabled + label, -input[type=time]:not(.browser-default)[readonly="readonly"] + label, -input[type=date]:not(.browser-default):disabled + label, -input[type=date]:not(.browser-default)[readonly="readonly"] + label, -input[type=datetime]:not(.browser-default):disabled + label, -input[type=datetime]:not(.browser-default)[readonly="readonly"] + label, -input[type=datetime-local]:not(.browser-default):disabled + label, -input[type=datetime-local]:not(.browser-default)[readonly="readonly"] + label, -input[type=tel]:not(.browser-default):disabled + label, -input[type=tel]:not(.browser-default)[readonly="readonly"] + label, -input[type=number]:not(.browser-default):disabled + label, -input[type=number]:not(.browser-default)[readonly="readonly"] + label, -input[type=search]:not(.browser-default):disabled + label, -input[type=search]:not(.browser-default)[readonly="readonly"] + label, -textarea.materialize-textarea:disabled + label, -textarea.materialize-textarea[readonly="readonly"] + label { - color: rgba(0, 0, 0, 0.42); -} - -input:not([type]):not(.browser-default):focus:not([readonly]), -input[type=text]:not(.browser-default):focus:not([readonly]), -input[type=password]:not(.browser-default):focus:not([readonly]), -input[type=email]:not(.browser-default):focus:not([readonly]), -input[type=url]:not(.browser-default):focus:not([readonly]), -input[type=time]:not(.browser-default):focus:not([readonly]), -input[type=date]:not(.browser-default):focus:not([readonly]), -input[type=datetime]:not(.browser-default):focus:not([readonly]), -input[type=datetime-local]:not(.browser-default):focus:not([readonly]), -input[type=tel]:not(.browser-default):focus:not([readonly]), -input[type=number]:not(.browser-default):focus:not([readonly]), -input[type=search]:not(.browser-default):focus:not([readonly]), -textarea.materialize-textarea:focus:not([readonly]) { - border-bottom: 1px solid #26a69a; - -webkit-box-shadow: 0 1px 0 0 #26a69a; - box-shadow: 0 1px 0 0 #26a69a; -} - -input:not([type]):not(.browser-default):focus:not([readonly]) + label, -input[type=text]:not(.browser-default):focus:not([readonly]) + label, -input[type=password]:not(.browser-default):focus:not([readonly]) + label, -input[type=email]:not(.browser-default):focus:not([readonly]) + label, -input[type=url]:not(.browser-default):focus:not([readonly]) + label, -input[type=time]:not(.browser-default):focus:not([readonly]) + label, -input[type=date]:not(.browser-default):focus:not([readonly]) + label, -input[type=datetime]:not(.browser-default):focus:not([readonly]) + label, -input[type=datetime-local]:not(.browser-default):focus:not([readonly]) + label, -input[type=tel]:not(.browser-default):focus:not([readonly]) + label, -input[type=number]:not(.browser-default):focus:not([readonly]) + label, -input[type=search]:not(.browser-default):focus:not([readonly]) + label, -textarea.materialize-textarea:focus:not([readonly]) + label { - color: #26a69a; -} - -input:not([type]):not(.browser-default):focus.valid ~ label, -input[type=text]:not(.browser-default):focus.valid ~ label, -input[type=password]:not(.browser-default):focus.valid ~ label, -input[type=email]:not(.browser-default):focus.valid ~ label, -input[type=url]:not(.browser-default):focus.valid ~ label, -input[type=time]:not(.browser-default):focus.valid ~ label, -input[type=date]:not(.browser-default):focus.valid ~ label, -input[type=datetime]:not(.browser-default):focus.valid ~ label, -input[type=datetime-local]:not(.browser-default):focus.valid ~ label, -input[type=tel]:not(.browser-default):focus.valid ~ label, -input[type=number]:not(.browser-default):focus.valid ~ label, -input[type=search]:not(.browser-default):focus.valid ~ label, -textarea.materialize-textarea:focus.valid ~ label { - color: #4CAF50; -} - -input:not([type]):not(.browser-default):focus.invalid ~ label, -input[type=text]:not(.browser-default):focus.invalid ~ label, -input[type=password]:not(.browser-default):focus.invalid ~ label, -input[type=email]:not(.browser-default):focus.invalid ~ label, -input[type=url]:not(.browser-default):focus.invalid ~ label, -input[type=time]:not(.browser-default):focus.invalid ~ label, -input[type=date]:not(.browser-default):focus.invalid ~ label, -input[type=datetime]:not(.browser-default):focus.invalid ~ label, -input[type=datetime-local]:not(.browser-default):focus.invalid ~ label, -input[type=tel]:not(.browser-default):focus.invalid ~ label, -input[type=number]:not(.browser-default):focus.invalid ~ label, -input[type=search]:not(.browser-default):focus.invalid ~ label, -textarea.materialize-textarea:focus.invalid ~ label { - color: #F44336; -} - -input:not([type]):not(.browser-default).validate + label, -input[type=text]:not(.browser-default).validate + label, -input[type=password]:not(.browser-default).validate + label, -input[type=email]:not(.browser-default).validate + label, -input[type=url]:not(.browser-default).validate + label, -input[type=time]:not(.browser-default).validate + label, -input[type=date]:not(.browser-default).validate + label, -input[type=datetime]:not(.browser-default).validate + label, -input[type=datetime-local]:not(.browser-default).validate + label, -input[type=tel]:not(.browser-default).validate + label, -input[type=number]:not(.browser-default).validate + label, -input[type=search]:not(.browser-default).validate + label, -textarea.materialize-textarea.validate + label { - width: 100%; + height: 56px; } /* Validation Sass Placeholders */ -input.valid:not([type]):not(.browser-default), input.valid:not([type]):not(.browser-default):focus, -input.valid[type=text]:not(.browser-default), -input.valid[type=text]:not(.browser-default):focus, -input.valid[type=password]:not(.browser-default), -input.valid[type=password]:not(.browser-default):focus, -input.valid[type=email]:not(.browser-default), -input.valid[type=email]:not(.browser-default):focus, -input.valid[type=url]:not(.browser-default), -input.valid[type=url]:not(.browser-default):focus, -input.valid[type=time]:not(.browser-default), -input.valid[type=time]:not(.browser-default):focus, -input.valid[type=date]:not(.browser-default), -input.valid[type=date]:not(.browser-default):focus, -input.valid[type=datetime]:not(.browser-default), -input.valid[type=datetime]:not(.browser-default):focus, -input.valid[type=datetime-local]:not(.browser-default), -input.valid[type=datetime-local]:not(.browser-default):focus, -input.valid[type=tel]:not(.browser-default), -input.valid[type=tel]:not(.browser-default):focus, -input.valid[type=number]:not(.browser-default), -input.valid[type=number]:not(.browser-default):focus, -input.valid[type=search]:not(.browser-default), -input.valid[type=search]:not(.browser-default):focus, -textarea.materialize-textarea.valid, -textarea.materialize-textarea.valid:focus, .select-wrapper.valid > input.select-dropdown { - border-bottom: 1px solid #4CAF50; - -webkit-box-shadow: 0 1px 0 0 #4CAF50; - box-shadow: 0 1px 0 0 #4CAF50; +/* +%custom-success-message { + content: attr(data-success); + color: $success-color; } - -input.invalid:not([type]):not(.browser-default), input.invalid:not([type]):not(.browser-default):focus, -input.invalid[type=text]:not(.browser-default), -input.invalid[type=text]:not(.browser-default):focus, -input.invalid[type=password]:not(.browser-default), -input.invalid[type=password]:not(.browser-default):focus, -input.invalid[type=email]:not(.browser-default), -input.invalid[type=email]:not(.browser-default):focus, -input.invalid[type=url]:not(.browser-default), -input.invalid[type=url]:not(.browser-default):focus, -input.invalid[type=time]:not(.browser-default), -input.invalid[type=time]:not(.browser-default):focus, -input.invalid[type=date]:not(.browser-default), -input.invalid[type=date]:not(.browser-default):focus, -input.invalid[type=datetime]:not(.browser-default), -input.invalid[type=datetime]:not(.browser-default):focus, -input.invalid[type=datetime-local]:not(.browser-default), -input.invalid[type=datetime-local]:not(.browser-default):focus, -input.invalid[type=tel]:not(.browser-default), -input.invalid[type=tel]:not(.browser-default):focus, -input.invalid[type=number]:not(.browser-default), -input.invalid[type=number]:not(.browser-default):focus, -input.invalid[type=search]:not(.browser-default), -input.invalid[type=search]:not(.browser-default):focus, -textarea.materialize-textarea.invalid, -textarea.materialize-textarea.invalid:focus, .select-wrapper.invalid > input.select-dropdown, -.select-wrapper.invalid > input.select-dropdown:focus { - border-bottom: 1px solid #F44336; - -webkit-box-shadow: 0 1px 0 0 #F44336; - box-shadow: 0 1px 0 0 #F44336; +%custom-error-message { + content: attr(data-error); + color: var(--md-sys-color-error); } - -input:not([type]):not(.browser-default).valid ~ .helper-text[data-success], -input:not([type]):not(.browser-default):focus.valid ~ .helper-text[data-success], -input:not([type]):not(.browser-default).invalid ~ .helper-text[data-error], -input:not([type]):not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=text]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=text]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=text]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=text]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=password]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=password]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=password]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=password]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=email]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=email]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=email]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=email]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=url]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=url]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=url]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=url]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=time]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=time]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=time]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=time]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=date]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=date]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=date]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=date]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=datetime]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=datetime]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=datetime]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=datetime]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=datetime-local]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=datetime-local]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=datetime-local]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=datetime-local]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=tel]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=tel]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=tel]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=tel]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=number]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=number]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=number]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=number]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -input[type=search]:not(.browser-default).valid ~ .helper-text[data-success], -input[type=search]:not(.browser-default):focus.valid ~ .helper-text[data-success], -input[type=search]:not(.browser-default).invalid ~ .helper-text[data-error], -input[type=search]:not(.browser-default):focus.invalid ~ .helper-text[data-error], -textarea.materialize-textarea.valid ~ .helper-text[data-success], -textarea.materialize-textarea:focus.valid ~ .helper-text[data-success], -textarea.materialize-textarea.invalid ~ .helper-text[data-error], -textarea.materialize-textarea:focus.invalid ~ .helper-text[data-error], .select-wrapper.valid .helper-text[data-success], -.select-wrapper.invalid ~ .helper-text[data-error] { - color: transparent; +*/ +.input-field { + --input-color: var(--md-sys-color-primary); + position: relative; + clear: both; +} +.input-field input, .input-field textarea { + -webkit-box-sizing: border-box; + box-sizing: border-box; /* https://stackoverflow.com/questions/1377719/padding-within-inputs-breaks-width-100*/ + padding: 0 16px; + padding-top: 20px; + background-color: var(--md-sys-color-surface); + border: none; + border-radius: 4px; + border-bottom: 1px solid var(--md-sys-color-on-surface-variant); + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} +.input-field input:focus:not([readonly]), .input-field textarea:focus:not([readonly]) { + border-bottom: 2px solid var(--input-color); + padding-top: 21px; +} +.input-field input:disabled, .input-field input[readonly=readonly], .input-field textarea:disabled, .input-field textarea[readonly=readonly] { + color: rgba(var(--md_sys_color_on-surface), 0.38); + border-color: rgba(var(--md_sys_color_on-surface), 0.12); + background-color: rgba(var(--md_sys_color_on-surface), 0.04); +} +.input-field input:focus:not([readonly]) + label, .input-field textarea:focus:not([readonly]) + label { + color: var(--input-color); +} +.input-field input:not(:-moz-placeholder-shown) + label, .input-field textarea:not(:-moz-placeholder-shown) + label { + transform: scale(0.75); + top: 8px; +} +.input-field input:not(:-ms-input-placeholder) + label, .input-field textarea:not(:-ms-input-placeholder) + label { + transform: scale(0.75); + top: 8px; +} +.input-field input:focus:not([readonly]) + label, .input-field input:not([placeholder=" "]) + label, .input-field input:not(:placeholder-shown) + label, .input-field textarea:focus:not([readonly]) + label, .input-field textarea:not([placeholder=" "]) + label, .input-field textarea:not(:placeholder-shown) + label { + -webkit-transform: scale(0.75); + transform: scale(0.75); + top: 8px; +} +.input-field input:disabled + label, .input-field input[readonly=readonly] + label, .input-field textarea:disabled + label, .input-field textarea[readonly=readonly] + label { + color: rgba(var(--md_sys_color_on-surface), 0.38); +} +.input-field input::-webkit-input-placeholder { + -webkit-user-select: none; + user-select: none; +} +.input-field input::-moz-placeholder { + -moz-user-select: none; + user-select: none; +} +.input-field input:-ms-input-placeholder { + -ms-user-select: none; + user-select: none; +} +.input-field input::-ms-input-placeholder { + -ms-user-select: none; + user-select: none; +} +.input-field input::placeholder { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; - pointer-events: none; } - -input:not([type]):not(.browser-default).valid ~ .helper-text:after, -input:not([type]):not(.browser-default):focus.valid ~ .helper-text:after, -input[type=text]:not(.browser-default).valid ~ .helper-text:after, -input[type=text]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=password]:not(.browser-default).valid ~ .helper-text:after, -input[type=password]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=email]:not(.browser-default).valid ~ .helper-text:after, -input[type=email]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=url]:not(.browser-default).valid ~ .helper-text:after, -input[type=url]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=time]:not(.browser-default).valid ~ .helper-text:after, -input[type=time]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=date]:not(.browser-default).valid ~ .helper-text:after, -input[type=date]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=datetime]:not(.browser-default).valid ~ .helper-text:after, -input[type=datetime]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=datetime-local]:not(.browser-default).valid ~ .helper-text:after, -input[type=datetime-local]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=tel]:not(.browser-default).valid ~ .helper-text:after, -input[type=tel]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=number]:not(.browser-default).valid ~ .helper-text:after, -input[type=number]:not(.browser-default):focus.valid ~ .helper-text:after, -input[type=search]:not(.browser-default).valid ~ .helper-text:after, -input[type=search]:not(.browser-default):focus.valid ~ .helper-text:after, -textarea.materialize-textarea.valid ~ .helper-text:after, -textarea.materialize-textarea:focus.valid ~ .helper-text:after, .select-wrapper.valid ~ .helper-text:after { - content: attr(data-success); - color: #4CAF50; -} - -input:not([type]):not(.browser-default).invalid ~ .helper-text:after, -input:not([type]):not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=text]:not(.browser-default).invalid ~ .helper-text:after, -input[type=text]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=password]:not(.browser-default).invalid ~ .helper-text:after, -input[type=password]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=email]:not(.browser-default).invalid ~ .helper-text:after, -input[type=email]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=url]:not(.browser-default).invalid ~ .helper-text:after, -input[type=url]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=time]:not(.browser-default).invalid ~ .helper-text:after, -input[type=time]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=date]:not(.browser-default).invalid ~ .helper-text:after, -input[type=date]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=datetime]:not(.browser-default).invalid ~ .helper-text:after, -input[type=datetime]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=datetime-local]:not(.browser-default).invalid ~ .helper-text:after, -input[type=datetime-local]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=tel]:not(.browser-default).invalid ~ .helper-text:after, -input[type=tel]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=number]:not(.browser-default).invalid ~ .helper-text:after, -input[type=number]:not(.browser-default):focus.invalid ~ .helper-text:after, -input[type=search]:not(.browser-default).invalid ~ .helper-text:after, -input[type=search]:not(.browser-default):focus.invalid ~ .helper-text:after, -textarea.materialize-textarea.invalid ~ .helper-text:after, -textarea.materialize-textarea:focus.invalid ~ .helper-text:after, .select-wrapper.invalid ~ .helper-text:after { - content: attr(data-error); - color: #F44336; -} - -input:not([type]):not(.browser-default) + label:after, -input[type=text]:not(.browser-default) + label:after, -input[type=password]:not(.browser-default) + label:after, -input[type=email]:not(.browser-default) + label:after, -input[type=url]:not(.browser-default) + label:after, -input[type=time]:not(.browser-default) + label:after, -input[type=date]:not(.browser-default) + label:after, -input[type=datetime]:not(.browser-default) + label:after, -input[type=datetime-local]:not(.browser-default) + label:after, -input[type=tel]:not(.browser-default) + label:after, -input[type=number]:not(.browser-default) + label:after, -input[type=search]:not(.browser-default) + label:after, -textarea.materialize-textarea + label:after, .select-wrapper + label:after { - display: block; - content: ""; - position: absolute; - top: 100%; - left: 0; - opacity: 0; - -webkit-transition: .2s opacity ease-out, .2s color ease-out; - transition: .2s opacity ease-out, .2s color ease-out; -} - -.input-field { - position: relative; - margin-top: 1rem; - margin-bottom: 1rem; -} - -.input-field.inline { - display: inline-block; - vertical-align: middle; - margin-left: 5px; -} - -.input-field.inline input, -.input-field.inline .select-dropdown { - margin-bottom: 1rem; -} - -.input-field.col label { - left: 0.75rem; -} - -.input-field.col .prefix ~ label, -.input-field.col .prefix ~ .validate ~ label, -.input-field.col .suffix ~ label, -.input-field.col .suffix ~ .validate ~ label { - width: calc(100% - 3rem - 1.5rem); -} - .input-field > label { - color: #9e9e9e; + color: var(--md-sys-color-on-surface-variant); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + font-size: 16px; position: absolute; - top: 0; - left: 0; - font-size: 1rem; + left: 16px; + top: 16px; cursor: text; - -webkit-transition: color .2s ease-out, -webkit-transform .2s ease-out; - transition: color .2s ease-out, -webkit-transform .2s ease-out; - transition: transform .2s ease-out, color .2s ease-out; - transition: transform .2s ease-out, color .2s ease-out, -webkit-transform .2s ease-out; - -webkit-transform-origin: 0% 100%; - transform-origin: 0% 100%; - text-align: initial; - -webkit-transform: translateY(12px); - transform: translateY(12px); + -webkit-transform-origin: top left; + transform-origin: top left; + -webkit-transition: left 0.2s ease-out, top 0.2s ease-out, -webkit-transform 0.2s ease-out; + transition: left 0.2s ease-out, top 0.2s ease-out, -webkit-transform 0.2s ease-out; + transition: left 0.2s ease-out, top 0.2s ease-out, transform 0.2s ease-out; + transition: left 0.2s ease-out, top 0.2s ease-out, transform 0.2s ease-out, -webkit-transform 0.2s ease-out; } - -.input-field > label:not(.label-icon).active { - -webkit-transform: translateY(-14px) scale(0.8); - transform: translateY(-14px) scale(0.8); - -webkit-transform-origin: 0 0; - transform-origin: 0 0; -} - -.input-field > input[type]:-webkit-autofill:not(.browser-default):not([type="search"]) + label, -.input-field > input[type=date]:not(.browser-default) + label, -.input-field > input[type=time]:not(.browser-default) + label { - -webkit-transform: translateY(-14px) scale(0.8); - transform: translateY(-14px) scale(0.8); - -webkit-transform-origin: 0 0; - transform-origin: 0 0; -} - -.input-field .helper-text { - position: relative; - min-height: 18px; - display: block; +.input-field .supporting-text { + color: var(--md-sys-color-on-surface-variant); font-size: 12px; - color: rgba(0, 0, 0, 0.54); + padding: 0 16px; + margin-top: 4px; } - -.input-field .helper-text::after { - opacity: 1; +.input-field .character-counter { + color: var(--md-sys-color-on-surface-variant); + font-size: 12px; + float: right; + padding: 0 16px; + margin-top: 4px; +} +.input-field .prefix { position: absolute; - top: 0; - left: 0; + left: 12px; + top: 16px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; } - -.input-field .prefix, .input-field .suffix { - position: absolute; - width: 3rem; - font-size: 2rem; - -webkit-transition: color .2s; - transition: color .2s; - top: 0.5rem; -} - -.input-field .prefix.active, .input-field .suffix.active { - color: #26a69a; -} - -.input-field .prefix ~ input, -.input-field .prefix ~ textarea, -.input-field .prefix ~ .select-wrapper, -.input-field .prefix ~ label, -.input-field .prefix ~ .validate ~ label, -.input-field .prefix ~ .helper-text, -.input-field .prefix ~ .autocomplete-content { - margin-left: 3rem; - width: 92%; - width: calc(100% - 3rem); -} - -.input-field .prefix ~ label { - margin-left: 3rem; -} - -@media only screen and (max-width: 992.99px) { - .input-field .prefix ~ input, - .input-field .suffix ~ input { - width: 86%; - width: calc(100% - 3rem); - } -} - -@media only screen and (max-width: 600.99px) { - .input-field .prefix ~ input, - .input-field .suffix ~ input { - width: 80%; - width: calc(100% - 3rem); - } -} - .input-field .suffix { - right: 0; + position: absolute; + right: 12px; + top: 16px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } - -.input-field .suffix ~ input, -.input-field .suffix ~ textarea, -.input-field .suffix ~ .select-wrapper, -.input-field .suffix ~ label, -.input-field .suffix ~ .validate ~ label, -.input-field .suffix ~ .helper-text, -.input-field .suffix ~ .autocomplete-content { - margin-right: 3rem; - width: 92%; - width: calc(100% - 3rem); +.input-field .prefix ~ input, .input-field .prefix ~ textarea { + padding-left: 52px; } - -.input-field .suffix ~ label { - margin-right: 3rem; +.input-field .suffix ~ input, .input-field .suffix ~ textarea { + padding-right: 52px; +} +.input-field .prefix ~ label { + left: 52px; +} +.input-field.outlined input, .input-field.outlined textarea { + padding-top: 0; + background-color: var(--md-sys-color-background); + border: 1px solid var(--md-sys-color-on-surface-variant); + border-radius: 4px; +} +.input-field.outlined input:focus:not([readonly]), .input-field.outlined textarea:focus:not([readonly]) { + border: 2px solid var(--input-color); + padding-top: 0; + margin-left: -1px; +} +.input-field.outlined input:focus:not([readonly]) + label, .input-field.outlined textarea:focus:not([readonly]) + label { + color: var(--input-color); +} +.input-field.outlined input:not(:-moz-placeholder-shown) + label, .input-field.outlined textarea:not(:-moz-placeholder-shown) + label { + top: -8px; + left: 16px; + margin-left: -4px; + padding: 0 4px; + background-color: var(--md-sys-color-background); +} +.input-field.outlined input:not(:-ms-input-placeholder) + label, .input-field.outlined textarea:not(:-ms-input-placeholder) + label { + top: -8px; + left: 16px; + margin-left: -4px; + padding: 0 4px; + background-color: var(--md-sys-color-background); +} +.input-field.outlined input:focus:not([readonly]) + label, .input-field.outlined input:not([placeholder=" "]) + label, .input-field.outlined input:not(:placeholder-shown) + label, .input-field.outlined textarea:focus:not([readonly]) + label, .input-field.outlined textarea:not([placeholder=" "]) + label, .input-field.outlined textarea:not(:placeholder-shown) + label { + top: -8px; + left: 16px; + margin-left: -4px; + padding: 0 4px; + background-color: var(--md-sys-color-background); +} +.input-field.outlined input:disabled, .input-field.outlined input[readonly=readonly], .input-field.outlined textarea:disabled, .input-field.outlined textarea[readonly=readonly] { + color: rgba(var(--md_sys_color_on-surface), 0.38); + border-color: rgba(var(--md_sys_color_on-surface), 0.12); +} +.input-field.error input, .input-field.error textarea { + border-color: var(--md-sys-color-error); +} +.input-field.error input:focus:not([readonly]), .input-field.error textarea:focus:not([readonly]) { + border-color: var(--md-sys-color-error); +} +.input-field.error input:focus:not([readonly]) + label, .input-field.error textarea:focus:not([readonly]) + label { + color: var(--md-sys-color-error); +} +.input-field.error label { + color: var(--md-sys-color-error); +} +.input-field.error .supporting-text { + color: var(--md-sys-color-error); +} +.input-field.error .suffix { + color: var(--md-sys-color-error); } /* Search Field */ +.searchbar .prefix { + position: absolute; + padding-left: 1rem; + top: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; +} +.searchbar > input { + border-width: 0; + background-color: transparent; + padding-left: 3rem; +} + +.searchbar.has-sidebar { + margin-left: 0; +} +@media only screen and (min-width : 993px) { + .searchbar.has-sidebar { + margin-left: 300px; + } +} + +/* .input-field input[type=search] { display: block; line-height: inherit; - -webkit-transition: .3s background-color; - transition: .3s background-color; -} -.nav-wrapper .input-field input[type=search] { - height: inherit; - padding-left: 4rem; - width: calc(100% - 4rem); - border: 0; - -webkit-box-shadow: none; - box-shadow: none; + .nav-wrapper & { + height: inherit; + padding-left: 4rem; + width: calc(100% - 4rem); + border: 0; + box-shadow: none; + } + &:focus:not(.browser-default) { + border: 0; + box-shadow: none; + } + & + .label-icon { + transform: none; + left: 1rem; + } } - -.input-field input[type=search]:focus:not(.browser-default) { - background-color: #fff; - border: 0; - -webkit-box-shadow: none; - box-shadow: none; - color: #444; -} - -.input-field input[type=search]:focus:not(.browser-default) + label i, -.input-field input[type=search]:focus:not(.browser-default) ~ .mdi-navigation-close, -.input-field input[type=search]:focus:not(.browser-default) ~ .material-icons { - color: #444; -} - -.input-field input[type=search] + .label-icon { - -webkit-transform: none; - transform: none; - left: 1rem; -} - -.input-field input[type=search] ~ .mdi-navigation-close, -.input-field input[type=search] ~ .material-icons { - position: absolute; - top: 0; - right: 1rem; - color: transparent; - cursor: pointer; - font-size: 2rem; - -webkit-transition: .3s color; - transition: .3s color; -} - +*/ /* Textarea */ textarea { width: 100%; height: 3rem; background-color: transparent; } - textarea.materialize-textarea { + padding-top: 26px !important; + padding-bottom: 4px !important; line-height: normal; - overflow-y: hidden; - /* prevents scroll bar flash */ - padding: .8rem 0 .8rem 0; - /* prevents text jump on Enter keypress */ + overflow-y: hidden; /* prevents scroll bar flash */ resize: none; min-height: 3rem; -webkit-box-sizing: border-box; @@ -6765,42 +6796,32 @@ textarea.materialize-textarea { visibility: hidden; white-space: pre-wrap; word-wrap: break-word; - overflow-wrap: break-word; - /* future version of deprecated 'word-wrap' */ - padding-top: 1.2rem; - /* prevents text jump on Enter keypress */ + overflow-wrap: break-word; /* future version of deprecated 'word-wrap' */ + padding-top: 1.2rem; /* prevents text jump on Enter keypress */ position: absolute; top: 0; z-index: -1; } -/* Autocomplete */ +/* Autocomplete Items */ .autocomplete-content li .highlight { - color: #444; + color: var(--md-sys-color-on-background); } - .autocomplete-content li img { height: 40px; width: 40px; margin: 5px 15px; } -/* Character Counter */ -.character-counter { - min-height: 18px; -} - -/* Radio Buttons - ========================================================================== */ -[type="radio"]:not(:checked), -[type="radio"]:checked { +[type=radio]:not(:checked), +[type=radio]:checked { position: absolute; opacity: 0; pointer-events: none; } -[type="radio"]:not(:checked) + span, -[type="radio"]:checked + span { +[type=radio]:not(:checked) + span, +[type=radio]:checked + span { position: relative; padding-left: 35px; cursor: pointer; @@ -6808,17 +6829,17 @@ textarea.materialize-textarea { height: 25px; line-height: 25px; font-size: 1rem; - -webkit-transition: .28s ease; - transition: .28s ease; + -webkit-transition: 0.28s ease; + transition: 0.28s ease; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } -[type="radio"] + span:before, -[type="radio"] + span:after { - content: ''; +[type=radio] + span:before, +[type=radio] + span:after { + content: ""; position: absolute; left: 0; top: 0; @@ -6826,108 +6847,107 @@ textarea.materialize-textarea { width: 16px; height: 16px; z-index: 0; - -webkit-transition: .28s ease; - transition: .28s ease; + -webkit-transition: 0.28s ease; + transition: 0.28s ease; } /* Unchecked styles */ -[type="radio"]:not(:checked) + span:before, -[type="radio"]:not(:checked) + span:after, -[type="radio"]:checked + span:before, -[type="radio"]:checked + span:after, -[type="radio"].with-gap:checked + span:before, -[type="radio"].with-gap:checked + span:after { +[type=radio]:not(:checked) + span:before, +[type=radio]:not(:checked) + span:after, +[type=radio]:checked + span:before, +[type=radio]:checked + span:after, +[type=radio].with-gap:checked + span:before, +[type=radio].with-gap:checked + span:after { border-radius: 50%; } -[type="radio"]:not(:checked) + span:before, -[type="radio"]:not(:checked) + span:after { - border: 2px solid #5a5a5a; +[type=radio]:not(:checked) + span:before, +[type=radio]:not(:checked) + span:after { + border: 2px solid var(--md-sys-color-on-surface-variant); } -[type="radio"]:not(:checked) + span:after { +[type=radio]:not(:checked) + span:after { -webkit-transform: scale(0); transform: scale(0); } /* Checked styles */ -[type="radio"]:checked + span:before { +[type=radio]:checked + span:before { border: 2px solid transparent; } -[type="radio"]:checked + span:after, -[type="radio"].with-gap:checked + span:before, -[type="radio"].with-gap:checked + span:after { - border: 2px solid #26a69a; +[type=radio]:checked + span:after, +[type=radio].with-gap:checked + span:before, +[type=radio].with-gap:checked + span:after { + border: 2px solid var(--md-sys-color-primary); } -[type="radio"]:checked + span:after, -[type="radio"].with-gap:checked + span:after { - background-color: #26a69a; +[type=radio]:checked + span:after, +[type=radio].with-gap:checked + span:after { + background-color: var(--md-sys-color-primary); } -[type="radio"]:checked + span:after { +[type=radio]:checked + span:after { -webkit-transform: scale(1.02); transform: scale(1.02); } /* Radio With gap */ -[type="radio"].with-gap:checked + span:after { +[type=radio].with-gap:checked + span:after { -webkit-transform: scale(0.5); transform: scale(0.5); } /* Focused styles */ -[type="radio"].tabbed:focus + span:before { - -webkit-box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.1); +[type=radio].tabbed:focus + span:before { + -webkit-box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18); + box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18); } /* Disabled Radio With gap */ -[type="radio"].with-gap:disabled:checked + span:before { - border: 2px solid rgba(0, 0, 0, 0.42); +[type=radio].with-gap:disabled:checked + span:before { + border: 2px solid var(--md-sys-color-on-surface); } -[type="radio"].with-gap:disabled:checked + span:after { +[type=radio].with-gap:disabled:checked + span:after { border: none; - background-color: rgba(0, 0, 0, 0.42); + background-color: var(--md-sys-color-on-surface); } /* Disabled style */ -[type="radio"]:disabled:not(:checked) + span:before, -[type="radio"]:disabled:checked + span:before { +[type=radio]:disabled:not(:checked) + span:before, +[type=radio]:disabled:checked + span:before { background-color: transparent; - border-color: rgba(0, 0, 0, 0.42); + border-color: var(--md-sys-color-on-surface); } -[type="radio"]:disabled + span { - color: rgba(0, 0, 0, 0.42); +[type=radio]:disabled + span { + color: var(--md-sys-color-on-surface); } -[type="radio"]:disabled:not(:checked) + span:before { - border-color: rgba(0, 0, 0, 0.42); +[type=radio]:disabled:not(:checked) + span:before { + border-color: var(--md-sys-color-on-surface); } -[type="radio"]:disabled:checked + span:after { - background-color: rgba(0, 0, 0, 0.42); - border-color: #949494; +[type=radio]:disabled:checked + span:after { + background-color: var(--md-sys-color-on-surface); + border-color: var(--md-sys-color-on-surface); } /* Checkboxes ========================================================================== */ /* Remove default checkbox */ -[type="checkbox"]:not(:checked), -[type="checkbox"]:checked { +[type=checkbox]:not(:checked), +[type=checkbox]:checked { position: absolute; opacity: 0; pointer-events: none; } -[type="checkbox"] { +[type=checkbox] { /* checkbox aspect */ } - -[type="checkbox"] + span:not(.lever) { +[type=checkbox] + span:not(.lever) { position: relative; padding-left: 35px; cursor: pointer; @@ -6940,53 +6960,48 @@ textarea.materialize-textarea { -ms-user-select: none; user-select: none; } - -[type="checkbox"] + span:not(.lever):before, -[type="checkbox"]:not(.filled-in) + span:not(.lever):after { - content: ''; +[type=checkbox] + span:not(.lever):before, [type=checkbox]:not(.filled-in) + span:not(.lever):after { + content: ""; position: absolute; top: 0; left: 0; width: 18px; height: 18px; z-index: 0; - border: 2px solid #5a5a5a; + border: 2px solid var(--md-sys-color-on-surface-variant); border-radius: 1px; margin-top: 3px; - -webkit-transition: .2s; - transition: .2s; + -webkit-transition: 0.2s; + transition: 0.2s; } - -[type="checkbox"]:not(.filled-in) + span:not(.lever):after { +[type=checkbox]:not(.filled-in) + span:not(.lever):after { border: 0; -webkit-transform: scale(0); transform: scale(0); } - -[type="checkbox"]:not(:checked):disabled + span:not(.lever):before { +[type=checkbox]:not(:checked):disabled + span:not(.lever):before { border: none; - background-color: rgba(0, 0, 0, 0.42); + background-color: var(--md-sys-color-on-surface); } - -[type="checkbox"].tabbed:focus + span:not(.lever):after { +[type=checkbox].tabbed:focus + span:not(.lever):after { -webkit-transform: scale(1); transform: scale(1); border: 0; border-radius: 50%; - -webkit-box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.1); - background-color: rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.12); + box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.12); + background-color: rgba(0, 0, 0, 0.12); } -[type="checkbox"]:checked + span:not(.lever):before { +[type=checkbox]:checked + span:not(.lever):before { top: -4px; left: -5px; width: 12px; height: 22px; border-top: 2px solid transparent; border-left: 2px solid transparent; - border-right: 2px solid #26a69a; - border-bottom: 2px solid #26a69a; + border-right: 2px solid var(--md-sys-color-primary); + border-bottom: 2px solid var(--md-sys-color-primary); -webkit-transform: rotate(40deg); transform: rotate(40deg); -webkit-backface-visibility: hidden; @@ -6994,21 +7009,20 @@ textarea.materialize-textarea { -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; } - -[type="checkbox"]:checked:disabled + span:before { - border-right: 2px solid rgba(0, 0, 0, 0.42); - border-bottom: 2px solid rgba(0, 0, 0, 0.42); +[type=checkbox]:checked:disabled + span:before { + border-right: 2px solid var(--md-sys-color-on-surface); + border-bottom: 2px solid var(--md-sys-color-on-surface); } /* Indeterminate checkbox */ -[type="checkbox"]:indeterminate + span:not(.lever):before { +[type=checkbox]:indeterminate + span:not(.lever):before { top: -11px; left: -12px; width: 10px; height: 22px; border-top: none; border-left: none; - border-right: 2px solid #26a69a; + border-right: 2px solid var(--md-sys-color-primary); border-bottom: none; -webkit-transform: rotate(90deg); transform: rotate(90deg); @@ -7017,28 +7031,25 @@ textarea.materialize-textarea { -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; } - -[type="checkbox"]:indeterminate:disabled + span:not(.lever):before { - border-right: 2px solid rgba(0, 0, 0, 0.42); +[type=checkbox]:indeterminate:disabled + span:not(.lever):before { + border-right: 2px solid var(--md-sys-color-on-surface); background-color: transparent; } -[type="checkbox"].filled-in + span:not(.lever):after { +[type=checkbox].filled-in + span:not(.lever):after { border-radius: 2px; } - -[type="checkbox"].filled-in + span:not(.lever):before, -[type="checkbox"].filled-in + span:not(.lever):after { - content: ''; +[type=checkbox].filled-in + span:not(.lever):before, +[type=checkbox].filled-in + span:not(.lever):after { + content: ""; left: 0; position: absolute; /* .1s delay is for check animation */ - -webkit-transition: border .25s, background-color .25s, width .20s .1s, height .20s .1s, top .20s .1s, left .20s .1s; - transition: border .25s, background-color .25s, width .20s .1s, height .20s .1s, top .20s .1s, left .20s .1s; + -webkit-transition: border 0.25s, background-color 0.25s, width 0.2s 0.1s, height 0.2s 0.1s, top 0.2s 0.1s, left 0.2s 0.1s; + transition: border 0.25s, background-color 0.25s, width 0.2s 0.1s, height 0.2s 0.1s, top 0.2s 0.1s, left 0.2s 0.1s; z-index: 1; } - -[type="checkbox"].filled-in:not(:checked) + span:not(.lever):before { +[type=checkbox].filled-in:not(:checked) + span:not(.lever):before { width: 0; height: 0; border: 3px solid transparent; @@ -7049,73 +7060,73 @@ textarea.materialize-textarea { -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; } - -[type="checkbox"].filled-in:not(:checked) + span:not(.lever):after { +[type=checkbox].filled-in:not(:checked) + span:not(.lever):after { height: 20px; width: 20px; background-color: transparent; - border: 2px solid #5a5a5a; + border: 2px solid var(--md-sys-color-on-surface-variant); top: 0px; z-index: 0; } - -[type="checkbox"].filled-in:checked + span:not(.lever):before { +[type=checkbox].filled-in:checked + span:not(.lever):before { top: 0; left: 1px; width: 8px; height: 13px; border-top: 2px solid transparent; border-left: 2px solid transparent; - border-right: 2px solid #fff; - border-bottom: 2px solid #fff; + border-right: 2px solid var(--md-sys-color-on-primary); + border-bottom: 2px solid var(--md-sys-color-on-primary); -webkit-transform: rotateZ(37deg); transform: rotateZ(37deg); -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; } - -[type="checkbox"].filled-in:checked + span:not(.lever):after { +[type=checkbox].filled-in:checked + span:not(.lever):after { top: 0; width: 20px; height: 20px; - border: 2px solid #26a69a; - background-color: #26a69a; + border: 2px solid var(--md-sys-color-primary); + background-color: var(--md-sys-color-primary); z-index: 0; } - -[type="checkbox"].filled-in.tabbed:focus + span:not(.lever):after { +[type=checkbox].filled-in.tabbed:focus + span:not(.lever):after { border-radius: 2px; - border-color: #5a5a5a; - background-color: rgba(0, 0, 0, 0.1); + border-color: var(--md-sys-color-on-surface-variant) r; + background-color: rgba(0, 0, 0, 0.12); } - -[type="checkbox"].filled-in.tabbed:checked:focus + span:not(.lever):after { +[type=checkbox].filled-in.tabbed:checked:focus + span:not(.lever):after { border-radius: 2px; - background-color: #26a69a; - border-color: #26a69a; + background-color: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); } - -[type="checkbox"].filled-in:disabled:not(:checked) + span:not(.lever):before { +[type=checkbox].filled-in:disabled:not(:checked) + span:not(.lever):before { background-color: transparent; border: 2px solid transparent; } - -[type="checkbox"].filled-in:disabled:not(:checked) + span:not(.lever):after { +[type=checkbox].filled-in:disabled:not(:checked) + span:not(.lever):after { border-color: transparent; - background-color: #949494; + background-color: var(--md-sys-color-on-surface); } - -[type="checkbox"].filled-in:disabled:checked + span:not(.lever):before { +[type=checkbox].filled-in:disabled:checked + span:not(.lever):before { background-color: transparent; } - -[type="checkbox"].filled-in:disabled:checked + span:not(.lever):after { - background-color: #949494; - border-color: #949494; +[type=checkbox].filled-in:disabled:checked + span:not(.lever):after { + background-color: var(--md-sys-color-on-surface); + border-color: var(--md-sys-color-on-surface); +} + +.switch { + --track-height: 32px; + --track-width: 52px; + --border-width: 2px; + --size-off: 16px; + --size-on: 24px; + --icon-size: 16px; + --gap-on: calc(((var(--track-height) - var(--size-on)) / 2) - var(--border-width)); + --gap-off: calc(((var(--track-height) - var(--size-off)) / 2) - var(--border-width)); } -/* Switch - ========================================================================== */ .switch, .switch * { -webkit-tap-highlight-color: transparent; @@ -7134,26 +7145,26 @@ textarea.materialize-textarea { width: 0; height: 0; } - -.switch label input[type=checkbox]:checked:not([disabled]) { - background-color: #84c7c1; +.switch label input[type=checkbox]:checked + .lever { + background-color: var(--md-sys-color-primary); + border-color: var(--md-sys-color-primary); } - .switch label input[type=checkbox]:checked + .lever:before, .switch label input[type=checkbox]:checked + .lever:after { - left: 18px; + top: var(--gap-on); + left: calc(var(--track-width) - var(--size-on) - var(--gap-on) - 2 * var(--border-width)); + width: var(--size-on); + height: var(--size-on); } - -.switch label input[type=checkbox]:checked + .lever:after { - background-color: #26a69a; -} - .switch label .lever { content: ""; display: inline-block; position: relative; - width: 36px; - height: 14px; - background-color: rgba(0, 0, 0, 0.38); + width: var(--track-width); + height: var(--track-height); + border-style: solid; + border-width: 2px; + border-color: var(--md-sys-color-outline); + background-color: var(--md-sys-color-surface-variant); border-radius: 15px; margin-right: 10px; -webkit-transition: background 0.3s ease; @@ -7161,111 +7172,139 @@ textarea.materialize-textarea { vertical-align: middle; margin: 0 16px; } - .switch label .lever:before, .switch label .lever:after { content: ""; position: absolute; display: inline-block; - width: 20px; - height: 20px; + width: var(--size-off); + height: var(--size-off); border-radius: 50%; - left: 0; - top: -3px; - -webkit-transition: left 0.3s ease, background .3s ease, -webkit-box-shadow 0.1s ease, -webkit-transform .1s ease; - transition: left 0.3s ease, background .3s ease, -webkit-box-shadow 0.1s ease, -webkit-transform .1s ease; - transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease, transform .1s ease; - transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease, transform .1s ease, -webkit-box-shadow 0.1s ease, -webkit-transform .1s ease; + left: var(--gap-off); + top: var(--gap-off); + -webkit-transition: left 0.3s ease, background 0.3s ease, -webkit-box-shadow 0.1s ease, -webkit-transform 0.1s ease; + transition: left 0.3s ease, background 0.3s ease, -webkit-box-shadow 0.1s ease, -webkit-transform 0.1s ease; + transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease, transform 0.1s ease; + transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease, transform 0.1s ease, -webkit-box-shadow 0.1s ease, -webkit-transform 0.1s ease; } - -.switch label .lever:before { - background-color: rgba(38, 166, 154, 0.15); -} - .switch label .lever:after { - background-color: #F1F1F1; - -webkit-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); - box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); + height: var(--size-off); + width: var(--size-off); +} + +input[type=checkbox]:not(:disabled) ~ .lever:active:before, +input[type=checkbox]:not(:disabled).tabbed:focus ~ .lever::before, +input[type=checkbox]:not(:disabled) ~ .lever:hover::before { + -webkit-transform: scale(2.4); + transform: scale(2.4); +} + +input[type=checkbox]:checked:not(:disabled) ~ .lever:hover::before { + background-color: rgba(var(--md-sys-color-primary-numeric), 0.06); } input[type=checkbox]:checked:not(:disabled) ~ .lever:active::before, input[type=checkbox]:checked:not(:disabled).tabbed:focus ~ .lever::before { - -webkit-transform: scale(2.4); - transform: scale(2.4); - background-color: rgba(38, 166, 154, 0.15); + background-color: rgba(var(--md-sys-color-primary-numeric), 0.18); +} + +input[type=checkbox]:not(:disabled) ~ .lever:hover::before { + background-color: rgba(0, 0, 0, 0.04); } input[type=checkbox]:not(:disabled) ~ .lever:active:before, input[type=checkbox]:not(:disabled).tabbed:focus ~ .lever::before { - -webkit-transform: scale(2.4); - transform: scale(2.4); - background-color: rgba(0, 0, 0, 0.08); + background-color: rgba(0, 0, 0, 0.12); } .switch input[type=checkbox][disabled] + .lever { cursor: default; - background-color: rgba(0, 0, 0, 0.12); -} - -.switch label input[type=checkbox][disabled] + .lever:after, -.switch label input[type=checkbox][disabled]:checked + .lever:after { - background-color: #949494; + opacity: 0.5; } /* Select Field ========================================================================== */ select.browser-default { opacity: 1; + color: var(--md-sys-color-on-background); } select { opacity: 0; - background-color: rgba(255, 255, 255, 0.9); + background-color: var(--md-sys-color-surface); width: 100%; padding: 5px; - border: 1px solid #f2f2f2; + border: 1px solid var(--md-sys-color-outline-variant); border-radius: 2px; height: 3rem; } -.select-label { - position: absolute; -} - .select-wrapper { + /* + &.valid .helper-text[data-success], + &.invalid ~ .helper-text[data-error] { + @extend %hidden-text; + } + + &.valid { + & > input.select-dropdown { + @extend %valid-input-style; + } + & ~ .helper-text:after { + //@extend %custom-success-message; + } + } + + &.invalid { + & > input.select-dropdown, + & > input.select-dropdown:focus { + @extend %invalid-input-style; + } + & ~ .helper-text:after { + //@extend %custom-error-message; + } + } + + &.valid + label, + &.invalid + label { + width: 100%; + pointer-events: none; + } + & + label:after { + //@extend %input-after-style; + } + */ position: relative; + /* + input.select-dropdown { + &:focus { + border-bottom: 1px solid var(--md-sys-color-primary); + } + position: relative; + cursor: pointer; + background-color: transparent; + border: none; + border-bottom: 2px solid var(--md-sys-color-on-surface-variant); + outline: none; + height: 3rem; + line-height: 3rem; + width: 100%; + font-size: 16px; + margin: 0 0 8px 0; + padding: 0; + display: block; + user-select:none; + z-index: 1; + color: var(--md-sys-color-on-background); + } + */ + /* + & + label { + position: absolute; + top: -26px; + font-size: .8rem; + } + */ } - -.select-wrapper.valid + label, -.select-wrapper.invalid + label { - width: 100%; - pointer-events: none; -} - -.select-wrapper input.select-dropdown { - position: relative; - cursor: pointer; - background-color: transparent; - border: none; - border-bottom: 1px solid #9e9e9e; - outline: none; - height: 3rem; - line-height: 3rem; - width: 100%; - font-size: 16px; - margin: 0 0 8px 0; - padding: 0; - display: block; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - z-index: 1; -} - -.select-wrapper input.select-dropdown:focus { - border-bottom: 1px solid #26a69a; -} - .select-wrapper .caret { position: absolute; right: 0; @@ -7273,15 +7312,8 @@ select { bottom: 0; margin: auto 0; z-index: 0; - fill: rgba(0, 0, 0, 0.87); + fill: var(--md-sys-color-on-background); } - -.select-wrapper + label { - position: absolute; - top: -26px; - font-size: 0.8rem; -} - .select-wrapper .hide-select { width: 0; height: 0; @@ -7292,19 +7324,18 @@ select { } select:disabled { - color: rgba(0, 0, 0, 0.42); + color: var(--md-sys-color-on-surface); } .select-wrapper.disabled + label { - color: rgba(0, 0, 0, 0.42); + color: var(--md-sys-color-on-surface); } - .select-wrapper.disabled .caret { - fill: rgba(0, 0, 0, 0.42); + fill: var(--md-sys-color-on-surface); } .select-wrapper input.select-dropdown:disabled { - color: rgba(0, 0, 0, 0.42); + color: var(--md-sys-color-on-surface); cursor: default; -webkit-user-select: none; -moz-user-select: none; @@ -7313,48 +7344,50 @@ select:disabled { } .select-wrapper i { - color: rgba(0, 0, 0, 0.3); + color: var(--md-sys-color-on-surface); } .select-dropdown li.disabled, .select-dropdown li.disabled > span, .select-dropdown li.optgroup { - color: rgba(0, 0, 0, 0.3); - background-color: transparent; + color: var(--md-sys-color-on-surface); } -body.keyboard-focused .select-dropdown.dropdown-content li:focus { - background-color: rgba(0, 0, 0, 0.08); +/* +body.keyboard-focused { + .select-dropdown.dropdown-content li:focus { + //background-color: $select-option-focus; + } } -.select-dropdown.dropdown-content li:hover { - background-color: rgba(0, 0, 0, 0.08); -} +.select-dropdown.dropdown-content { + li { + &:hover:not(.disabled) { + //background-color: $select-option-hover; + } -.select-dropdown.dropdown-content li.selected { - background-color: rgba(0, 0, 0, 0.03); + &.selected:not(.disabled) { + //background-color: $select-option-selected; + } + } } - +*/ +/* +// Prefix Icons .prefix ~ .select-wrapper { margin-left: 3rem; width: 92%; width: calc(100% - 3rem); } - -.prefix ~ label { - margin-left: 3rem; -} - +.prefix ~ label { margin-left: 3rem; } +// Suffix Icons .suffix ~ .select-wrapper { margin-right: 3rem; width: 92%; width: calc(100% - 3rem); } - -.suffix ~ label { - margin-right: 3rem; -} - +.suffix ~ label { margin-right: 3rem; } +*/ .select-dropdown li img { height: 40px; width: 40px; @@ -7363,67 +7396,59 @@ body.keyboard-focused .select-dropdown.dropdown-content li:focus { } .select-dropdown li.optgroup { - border-top: 1px solid #eee; + border-top: 1px solid rgba(0, 0, 0, 0.04); } - .select-dropdown li.optgroup.selected > span { - color: rgba(0, 0, 0, 0.7); + color: var(--md-sys-color-on-background); } - .select-dropdown li.optgroup > span { - color: rgba(0, 0, 0, 0.4); + color: var(--md-sys-color-on-surface-variant); } - .select-dropdown li.optgroup ~ li.optgroup-option { padding-left: 1rem; } -/* File Input - ========================================================================== */ -.file-field { - position: relative; +.select-dropdown .selected { + color: red; } +.file-field { + display: grid; + grid-template-columns: -webkit-min-content auto; + grid-template-columns: min-content auto; + gap: 10px; +} .file-field .file-path-wrapper { overflow: hidden; - padding-left: 10px; } - .file-field input.file-path { width: 100%; } - .file-field .btn, .file-field .btn-large, .file-field .btn-small { - float: left; height: 3rem; line-height: 3rem; } - .file-field span { cursor: pointer; } - .file-field input[type=file] { position: absolute; top: 0; right: 0; left: 0; bottom: 0; + cursor: pointer; width: 100%; margin: 0; padding: 0; - font-size: 20px; - cursor: pointer; opacity: 0; + font-size: 20px; filter: alpha(opacity=0); } - .file-field input[type=file]::-webkit-file-upload-button { display: none; } -/* Range - ========================================================================== */ .range-field { position: relative; } @@ -7442,7 +7467,6 @@ input[type=range] { margin: 15px 0; padding: 0; } - input[type=range]:focus { outline: none; } @@ -7455,30 +7479,27 @@ input[type=range] + .thumb { height: 0; width: 0; border-radius: 50%; - background-color: #26a69a; + background-color: var(--md-sys-color-primary); margin-left: 7px; -webkit-transform-origin: 50% 50%; transform-origin: 50% 50%; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } - input[type=range] + .thumb .value { display: block; width: 30px; text-align: center; - color: #26a69a; + color: var(--md-sys-color-primary); font-size: 0; -webkit-transform: rotate(45deg); transform: rotate(45deg); } - input[type=range] + .thumb.active { border-radius: 50% 50% 50% 0; } - input[type=range] + .thumb.active .value { - color: #fff; + color: var(--md-sys-color-on-primary); margin-left: -1px; margin-top: 8px; font-size: 10px; @@ -7490,7 +7511,6 @@ input[type=range] { input[type=range]::-webkit-slider-runnable-track { height: 3px; - background: #c2c0c2; border: none; } @@ -7499,32 +7519,29 @@ input[type=range]::-webkit-slider-thumb { height: 14px; width: 14px; border-radius: 50%; - background: #26a69a; - -webkit-transition: -webkit-box-shadow .3s; - transition: -webkit-box-shadow .3s; - transition: box-shadow .3s; - transition: box-shadow .3s, -webkit-box-shadow .3s; + background: var(--md-sys-color-primary); + -webkit-transition: -webkit-box-shadow 0.3s; + transition: -webkit-box-shadow 0.3s; + transition: box-shadow 0.3s; + transition: box-shadow 0.3s, -webkit-box-shadow 0.3s; -webkit-appearance: none; - background-color: #26a69a; + background-color: var(--md-sys-color-primary); -webkit-transform-origin: 50% 50%; transform-origin: 50% 50%; margin: -5px 0 0 0; } .keyboard-focused input[type=range]:focus:not(.active)::-webkit-slider-thumb { - -webkit-box-shadow: 0 0 0 10px rgba(38, 166, 154, 0.26); - box-shadow: 0 0 0 10px rgba(38, 166, 154, 0.26); + -webkit-box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18); + box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18); } input[type=range] { - /* fix for FF unable to apply focus style bug */ - border: 1px solid white; /*required for proper track sizing in FF*/ } input[type=range]::-moz-range-track { height: 3px; - background: #c2c0c2; border: none; } @@ -7537,11 +7554,9 @@ input[type=range]::-moz-range-thumb { height: 14px; width: 14px; border-radius: 50%; - background: #26a69a; - -webkit-transition: -webkit-box-shadow .3s; - transition: -webkit-box-shadow .3s; - transition: box-shadow .3s; - transition: box-shadow .3s, -webkit-box-shadow .3s; + background: var(--md-sys-color-primary); + -moz-transition: box-shadow 0.3s; + transition: box-shadow 0.3s; margin-top: -5px; } @@ -7551,7 +7566,7 @@ input[type=range]:-moz-focusring { } .keyboard-focused input[type=range]:focus:not(.active)::-moz-range-thumb { - box-shadow: 0 0 0 10px rgba(38, 166, 154, 0.26); + box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18); } input[type=range]::-ms-track { @@ -7563,12 +7578,14 @@ input[type=range]::-ms-track { color: transparent; } -input[type=range]::-ms-fill-lower { - background: #777; +input[type=range]::-ms-fill-lower, +input[type=range]::-moz-range-progress { + background: var(--md-sys-color-primary); } -input[type=range]::-ms-fill-upper { - background: #ddd; +input[type=range]::-ms-fill-upper, +input[type=range]::-moz-range-track { + background: var(--md-sys-color-shadow-light); } input[type=range]::-ms-thumb { @@ -7576,62 +7593,60 @@ input[type=range]::-ms-thumb { height: 14px; width: 14px; border-radius: 50%; - background: #26a69a; - -webkit-transition: -webkit-box-shadow .3s; - transition: -webkit-box-shadow .3s; - transition: box-shadow .3s; - transition: box-shadow .3s, -webkit-box-shadow .3s; + background: var(--md-sys-color-primary); + -ms-transition: box-shadow 0.3s; + transition: box-shadow 0.3s; } .keyboard-focused input[type=range]:focus:not(.active)::-ms-thumb { - box-shadow: 0 0 0 10px rgba(38, 166, 154, 0.26); + box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18); } -/*************** - Nav List -***************/ +.table-of-contents { + list-style: none; +} .table-of-contents.fixed { position: fixed; } - .table-of-contents li { - padding: 2px 0; + padding: 0; } - .table-of-contents a { display: inline-block; - font-weight: 300; - color: #757575; + font-weight: 400; + color: var(--md-sys-color-secondary); padding-left: 16px; - height: 1.5rem; - line-height: 1.5rem; - letter-spacing: .4; - display: inline-block; + height: 2rem; + line-height: 2rem; + border-left: 1px solid var(--md-sys-color-outline-variant); } - .table-of-contents a:hover { - color: #a8a8a8; + color: var(--md-sys-color-on-background); padding-left: 15px; - border-left: 1px solid #ee6e73; } - .table-of-contents a.active { + color: var(--md-sys-color-primary); font-weight: 500; padding-left: 14px; - border-left: 2px solid #ee6e73; + border-left: 2px solid var(--md-sys-color-primary); } +/* This should be an UL-Element*/ .sidenav { + --sidenav-width: 300px; + --sidenav-font-size: 14px; + --sidenav-padding: 16px; + --sidenav-item-height: 48px; + --sidenav-line-height: var(--sidenav-item-height); position: fixed; - width: 300px; + width: var(--sidenav-width); left: 0; top: 0; margin: 0; -webkit-transform: translateX(-100%); transform: translateX(-100%); height: 100vh; - padding-bottom: 60px; - background-color: #fff; + padding: 0; z-index: 999; overflow-y: auto; will-change: transform; @@ -7639,8 +7654,19 @@ input[type=range]::-ms-thumb { backface-visibility: hidden; -webkit-transform: translateX(-105%); transform: translateX(-105%); + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: var(--md-sys-color-on-secondary-container); + background-color: var(--md-sys-color-surface); + /* Hover only on top row */ + /*a:hover { + //color: red; + //background-color: var(--md-sys-color-on-secondary-container); + //md.sys.color.on-secondary-container + }*/ } - .sidenav.right-aligned { right: 0; -webkit-transform: translateX(105%); @@ -7649,97 +7675,90 @@ input[type=range]::-ms-thumb { -webkit-transform: translateX(100%); transform: translateX(100%); } - .sidenav .collapsible { margin: 0; } - +.sidenav a:focus { + background-color: rgba(0, 0, 0, 0.12); +} +.sidenav li.active > a:not(.collapsible-header):not(.btn):not(.btn-large):not(.btn-small):not(.btn-large):not(.btn-small):not(.btn-flat):not(.btn-large):not(.btn-floating) { + background-color: color-mix(in srgb, var(--md-sys-color-secondary) 10%, transparent); +} +.sidenav .collapsible-body > ul { + padding-left: 10px; +} .sidenav li { - float: none; - line-height: 48px; + list-style: none; + display: grid; + -webkit-align-content: center; + -ms-flex-line-pack: center; + align-content: center; } - -.sidenav li.active { - background-color: rgba(0, 0, 0, 0.05); -} - .sidenav li > a { - color: rgba(0, 0, 0, 0.87); - display: block; - font-size: 14px; + /* https://stackoverflow.com/questions/5848090/full-width-hover-background-for-nested-lists */ + margin: 0 12px; + padding: 0 var(--sidenav-padding); + /* + min-width: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + */ + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + height: var(--sidenav-item-height); + font-size: var(--sidenav-font-size); font-weight: 500; - height: 48px; - line-height: 48px; - padding: 0 32px; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + overflow: hidden; + border-radius: 100px; + /* TODO: Use special class in future like "mw-icon" */ } - -.sidenav li > a:hover { - background-color: rgba(0, 0, 0, 0.05); +.sidenav li > a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-flat):not(.btn-large):not(.btn-floating) { + color: var(--md-sys-color-on-secondary-container); } - -.sidenav li > a.btn, .sidenav li > a.btn-large, .sidenav li > a.btn-small, .sidenav li > a.btn-large, .sidenav li > a.btn-flat, .sidenav li > a.btn-floating { +.sidenav li > a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-flat):not(.btn-large):not(.btn-floating):hover { + background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); +} +.sidenav li > a.btn, .sidenav li > a.btn-small, .sidenav li > a.btn-large, .sidenav li > a.btn-flat, .sidenav li > a.btn-floating { margin: 10px 15px; } - -.sidenav li > a.btn, .sidenav li > a.btn-large, .sidenav li > a.btn-small, .sidenav li > a.btn-large, .sidenav li > a.btn-floating { - color: #fff; +.sidenav li > a > .material-icons, .sidenav li > a > .material-symbols-outlined, .sidenav li > a > .material-symbols-rounded, .sidenav li > a > .material-symbols-sharp { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + vertical-align: middle; + margin-right: 12px; } - -.sidenav li > a.btn-flat { - color: #343434; -} - -.sidenav li > a.btn:hover, .sidenav li > a.btn-large:hover, .sidenav li > a.btn-small:hover, .sidenav li > a.btn-large:hover { - background-color: #2bbbad; -} - -.sidenav li > a.btn-floating:hover { - background-color: #26a69a; -} - -.sidenav li > a > i, -.sidenav li > a > [class^="mdi-"], .sidenav li > a li > a > [class*="mdi-"], -.sidenav li > a > i.material-icons { - float: left; - height: 48px; - line-height: 48px; - margin: 0 32px 0 0; - width: 24px; - color: rgba(0, 0, 0, 0.54); -} - .sidenav .divider { - margin: 8px 0 0 0; + margin: calc(var(--sidenav-padding) * 0.5) 0 0 0; } - .sidenav .subheader { cursor: initial; pointer-events: none; - color: rgba(0, 0, 0, 0.54); - font-size: 14px; + color: red; + font-size: var(--sidenav-font-size); font-weight: 500; - line-height: 48px; + line-height: var(--sidenav-line-height); } - -.sidenav .subheader:hover { - background-color: transparent; -} - .sidenav .user-view { position: relative; - padding: 32px 32px 0; - margin-bottom: 8px; + padding: calc(var(--sidenav-padding) * 2) calc(var(--sidenav-padding) * 2) 0; + margin-bottom: calc(var(--sidenav-padding) * 0.5); } - .sidenav .user-view > a { height: auto; padding: 0; } - .sidenav .user-view > a:hover { background-color: transparent; } - .sidenav .user-view .background { overflow: hidden; position: absolute; @@ -7749,27 +7768,22 @@ input[type=range]::-ms-thumb { left: 0; z-index: -1; } - .sidenav .user-view .circle, .sidenav .user-view .name, .sidenav .user-view .email { display: block; } - .sidenav .user-view .circle { height: 64px; width: 64px; } - .sidenav .user-view .name, .sidenav .user-view .email { - font-size: 14px; - line-height: 24px; + font-size: var(--sidenav-font-size); + line-height: calc(var(--sidenav-line-height) * 0.5); } - .sidenav .user-view .name { margin-top: 16px; font-weight: 500; } - .sidenav .user-view .email { padding-bottom: 16px; font-weight: 400; @@ -7782,7 +7796,6 @@ input[type=range]::-ms-thumb { left: 0; z-index: 998; } - .drag-target.right-aligned { right: 0; } @@ -7793,13 +7806,12 @@ input[type=range]::-ms-thumb { transform: translateX(0); position: fixed; } - .sidenav.sidenav-fixed.right-aligned { right: 0; left: auto; } -@media only screen and (max-width: 992.99px) { +@media only screen and (max-width : 992.99px) { .sidenav.sidenav-fixed { -webkit-transform: translateX(-105%); transform: translateX(-105%); @@ -7809,23 +7821,12 @@ input[type=range]::-ms-thumb { transform: translateX(105%); } .sidenav > a { - padding: 0 16px; + padding: 0 var(--sidenav-padding); } .sidenav .user-view { - padding: 16px 16px 0; + padding: var(--sidenav-padding) var(--sidenav-padding) 0; } } - -.sidenav .collapsible-body > ul:not(.collapsible) > li.active, -.sidenav.sidenav-fixed .collapsible-body > ul:not(.collapsible) > li.active { - background-color: #ee6e73; -} - -.sidenav .collapsible-body > ul:not(.collapsible) > li.active a, -.sidenav.sidenav-fixed .collapsible-body > ul:not(.collapsible) > li.active a { - color: #fff; -} - .sidenav .collapsible-body { padding: 0; } @@ -7842,6 +7843,125 @@ input[type=range]::-ms-thumb { display: none; } +.sidenav .collapsible, +.sidenav.sidenav-fixed .collapsible { + border: none; + -webkit-box-shadow: none; + box-shadow: none; +} +.sidenav .collapsible-header, +.sidenav.sidenav-fixed .collapsible-header { + border: none; +} +.sidenav .collapsible-body, +.sidenav.sidenav-fixed .collapsible-body { + border: none; +} + +.progress { + position: relative; + height: 4px; + display: block; + width: 100%; + border-radius: 4px; + margin: 0.5rem 0 1rem 0; + overflow: hidden; + background-color: var(--md-sys-color-secondary-container); +} +.progress .determinate { + position: absolute; + top: 0; + left: 0; + bottom: 0; + background-color: var(--md-sys-color-primary); + -webkit-transition: width 0.3s linear; + transition: width 0.3s linear; +} +.progress .indeterminate { + background-color: var(--md-sys-color-primary); +} +.progress .indeterminate:before { + content: ""; + position: absolute; + background-color: inherit; + top: 0; + left: 0; + bottom: 0; + will-change: left, right; + -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; + animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; +} +.progress .indeterminate:after { + content: ""; + position: absolute; + background-color: inherit; + top: 0; + left: 0; + bottom: 0; + will-change: left, right; + -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; + animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; + -webkit-animation-delay: 1.15s; + animation-delay: 1.15s; +} + +@-webkit-keyframes indeterminate { + 0% { + left: -35%; + right: 100%; + } + 60% { + left: 100%; + right: -90%; + } + 100% { + left: 100%; + right: -90%; + } +} + +@keyframes indeterminate { + 0% { + left: -35%; + right: 100%; + } + 60% { + left: 100%; + right: -90%; + } + 100% { + left: 100%; + right: -90%; + } +} +@-webkit-keyframes indeterminate-short { + 0% { + left: -200%; + right: 100%; + } + 60% { + left: 107%; + right: -8%; + } + 100% { + left: 107%; + right: -8%; + } +} +@keyframes indeterminate-short { + 0% { + left: -200%; + right: 100%; + } + 60% { + left: 107%; + right: -8%; + } + 100% { + left: 107%; + right: -8%; + } +} /* @license Copyright (c) 2014 The Polymer Project Authors. All rights reserved. @@ -7873,17 +7993,14 @@ input[type=range]::-ms-thumb { width: 50px; height: 50px; } - .preloader-wrapper.small { width: 36px; height: 36px; } - .preloader-wrapper.big { width: 64px; height: 64px; } - .preloader-wrapper.active { /* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */ -webkit-animation: container-rotate 1568ms linear infinite; @@ -7895,20 +8012,18 @@ input[type=range]::-ms-thumb { -webkit-transform: rotate(360deg); } } - @keyframes container-rotate { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } - .spinner-layer { position: absolute; width: 100%; height: 100%; opacity: 0; - border-color: #26a69a; + border-color: var(--md-sys-color-primary); } .spinner-blue, @@ -7982,81 +8097,63 @@ input[type=range]::-ms-thumb { @-webkit-keyframes fill-unfill-rotate { 12.5% { -webkit-transform: rotate(135deg); - } - /* 0.5 * ARCSIZE */ + } /* 0.5 * ARCSIZE */ 25% { -webkit-transform: rotate(270deg); - } - /* 1 * ARCSIZE */ + } /* 1 * ARCSIZE */ 37.5% { -webkit-transform: rotate(405deg); - } - /* 1.5 * ARCSIZE */ + } /* 1.5 * ARCSIZE */ 50% { -webkit-transform: rotate(540deg); - } - /* 2 * ARCSIZE */ + } /* 2 * ARCSIZE */ 62.5% { -webkit-transform: rotate(675deg); - } - /* 2.5 * ARCSIZE */ + } /* 2.5 * ARCSIZE */ 75% { -webkit-transform: rotate(810deg); - } - /* 3 * ARCSIZE */ + } /* 3 * ARCSIZE */ 87.5% { -webkit-transform: rotate(945deg); - } - /* 3.5 * ARCSIZE */ + } /* 3.5 * ARCSIZE */ to { -webkit-transform: rotate(1080deg); - } - /* 4 * ARCSIZE */ + } /* 4 * ARCSIZE */ } - @keyframes fill-unfill-rotate { 12.5% { -webkit-transform: rotate(135deg); transform: rotate(135deg); - } - /* 0.5 * ARCSIZE */ + } /* 0.5 * ARCSIZE */ 25% { -webkit-transform: rotate(270deg); transform: rotate(270deg); - } - /* 1 * ARCSIZE */ + } /* 1 * ARCSIZE */ 37.5% { -webkit-transform: rotate(405deg); transform: rotate(405deg); - } - /* 1.5 * ARCSIZE */ + } /* 1.5 * ARCSIZE */ 50% { -webkit-transform: rotate(540deg); transform: rotate(540deg); - } - /* 2 * ARCSIZE */ + } /* 2 * ARCSIZE */ 62.5% { -webkit-transform: rotate(675deg); transform: rotate(675deg); - } - /* 2.5 * ARCSIZE */ + } /* 2.5 * ARCSIZE */ 75% { -webkit-transform: rotate(810deg); transform: rotate(810deg); - } - /* 3 * ARCSIZE */ + } /* 3 * ARCSIZE */ 87.5% { -webkit-transform: rotate(945deg); transform: rotate(945deg); - } - /* 3.5 * ARCSIZE */ + } /* 3.5 * ARCSIZE */ to { -webkit-transform: rotate(1080deg); transform: rotate(1080deg); - } - /* 4 * ARCSIZE */ + } /* 4 * ARCSIZE */ } - @-webkit-keyframes blue-fade-in-out { from { opacity: 1; @@ -8077,7 +8174,6 @@ input[type=range]::-ms-thumb { opacity: 1; } } - @keyframes blue-fade-in-out { from { opacity: 1; @@ -8098,7 +8194,6 @@ input[type=range]::-ms-thumb { opacity: 1; } } - @-webkit-keyframes red-fade-in-out { from { opacity: 0; @@ -8116,7 +8211,6 @@ input[type=range]::-ms-thumb { opacity: 0; } } - @keyframes red-fade-in-out { from { opacity: 0; @@ -8134,7 +8228,6 @@ input[type=range]::-ms-thumb { opacity: 0; } } - @-webkit-keyframes yellow-fade-in-out { from { opacity: 0; @@ -8152,7 +8245,6 @@ input[type=range]::-ms-thumb { opacity: 0; } } - @keyframes yellow-fade-in-out { from { opacity: 0; @@ -8170,7 +8262,6 @@ input[type=range]::-ms-thumb { opacity: 0; } } - @-webkit-keyframes green-fade-in-out { from { opacity: 0; @@ -8188,7 +8279,6 @@ input[type=range]::-ms-thumb { opacity: 0; } } - @keyframes green-fade-in-out { from { opacity: 0; @@ -8206,7 +8296,6 @@ input[type=range]::-ms-thumb { opacity: 0; } } - /** * Patch the gap that appear between the two adjacent div.circle-clipper while the * spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11). @@ -8234,12 +8323,10 @@ input[type=range]::-ms-thumb { overflow: hidden; border-color: inherit; } - .circle-clipper .circle { width: 200%; height: 100%; - border-width: 3px; - /* STROKEWIDTH */ + border-width: 3px; /* STROKEWIDTH */ border-style: solid; border-color: inherit; border-bottom-color: transparent !important; @@ -8251,14 +8338,12 @@ input[type=range]::-ms-thumb { right: 0; bottom: 0; } - .circle-clipper.left .circle { left: 0; border-right-color: transparent !important; -webkit-transform: rotate(129deg); transform: rotate(129deg); } - .circle-clipper.right .circle { left: -100%; border-left-color: transparent !important; @@ -8289,7 +8374,6 @@ input[type=range]::-ms-thumb { -webkit-transform: rotate(130deg); } } - @keyframes left-spin { from { -webkit-transform: rotate(130deg); @@ -8304,7 +8388,6 @@ input[type=range]::-ms-thumb { transform: rotate(130deg); } } - @-webkit-keyframes right-spin { from { -webkit-transform: rotate(-130deg); @@ -8316,7 +8399,6 @@ input[type=range]::-ms-thumb { -webkit-transform: rotate(-130deg); } } - @keyframes right-spin { from { -webkit-transform: rotate(-130deg); @@ -8331,7 +8413,6 @@ input[type=range]::-ms-thumb { transform: rotate(-130deg); } } - #spinnerContainer.cooldown { /* duration: SHRINK_TIME */ -webkit-animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1); @@ -8346,7 +8427,6 @@ input[type=range]::-ms-thumb { opacity: 0; } } - @keyframes fade-out { from { opacity: 1; @@ -8355,13 +8435,11 @@ input[type=range]::-ms-thumb { opacity: 0; } } - .slider { position: relative; height: 400px; width: 100%; } - .slider.fullscreen { height: 100%; width: 100%; @@ -8371,23 +8449,33 @@ input[type=range]::-ms-thumb { right: 0; bottom: 0; } - .slider.fullscreen ul.slides { + padding-left: 0; + list-style-type: none; height: 100%; } - .slider.fullscreen ul.indicators { + padding-left: 0; + list-style-type: none; z-index: 2; bottom: 30px; } - +.slider.fullscreen ul.indicators .indicator-item { + background-color: rgba(255, 255, 255, 0.45); +} +.slider.fullscreen ul.indicators .indicator-item.active { + background-color: var(--md-ref-palette-primary100); +} .slider .slides { - background-color: #9e9e9e; + background-color: var(--md-sys-color-surface); margin: 0; height: 400px; + padding-left: 0; + list-style-type: none; } - .slider .slides li { + padding-left: 0; + list-style-type: none; opacity: 0; position: absolute; top: 0; @@ -8397,14 +8485,12 @@ input[type=range]::-ms-thumb { height: inherit; overflow: hidden; } - .slider .slides li img { height: 100%; width: 100%; background-size: cover; background-position: center; } - .slider .slides li .caption { color: #fff; position: absolute; @@ -8413,16 +8499,15 @@ input[type=range]::-ms-thumb { width: 70%; opacity: 0; } - .slider .slides li .caption p { - color: #e0e0e0; + color: rgba(255, 255, 255, 0.75); } - .slider .slides li.active { z-index: 2; } - .slider .indicators { + padding-left: 0; + list-style-type: none; position: absolute; text-align: center; left: 0; @@ -8430,29 +8515,36 @@ input[type=range]::-ms-thumb { bottom: 0; margin: 0; } - .slider .indicators .indicator-item { display: inline-block; position: relative; - cursor: pointer; height: 16px; width: 16px; margin: 0 12px; - background-color: #e0e0e0; - -webkit-transition: background-color .3s; - transition: background-color .3s; - border-radius: 50%; } - -.slider .indicators .indicator-item.active { - background-color: #4CAF50; +.slider .indicators .indicator-item-btn { + position: absolute; + top: 0; + left: 0; + cursor: pointer; + background-color: var(--md-sys-color-shadow-light); + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; + border-radius: 50%; + border-width: 0; + width: 100%; + height: 100%; +} +.slider .indicators .indicator-item-btn.active { + background-color: var(--md-sys-color-primary); } .carousel { + --carousel-height: 400px; overflow: hidden; position: relative; width: 100%; - height: 400px; + height: var(--carousel-height); -webkit-perspective: 500px; perspective: 500px; -webkit-transform-style: preserve-3d; @@ -8460,12 +8552,10 @@ input[type=range]::-ms-thumb { -webkit-transform-origin: 0% 50%; transform-origin: 0% 50%; } - .carousel.carousel-slider { top: 0; left: 0; } - .carousel.carousel-slider .carousel-fixed-item { position: absolute; left: 0; @@ -8473,44 +8563,39 @@ input[type=range]::-ms-thumb { bottom: 20px; z-index: 1; } - .carousel.carousel-slider .carousel-fixed-item.with-indicators { bottom: 68px; } - .carousel.carousel-slider .carousel-item { width: 100%; height: 100%; - min-height: 400px; + min-height: var(--carousel-height); position: absolute; top: 0; left: 0; } - .carousel.carousel-slider .carousel-item h2 { font-size: 24px; font-weight: 500; line-height: 32px; } - .carousel.carousel-slider .carousel-item p { font-size: 15px; } - .carousel .carousel-item { visibility: hidden; - width: 200px; - height: 200px; + width: calc(var(--carousel-height) * 0.5); + height: calc(var(--carousel-height) * 0.5); position: absolute; top: 0; left: 0; } - .carousel .carousel-item > img { width: 100%; } - .carousel .indicators { + padding-left: 0; + list-style-type: none; position: absolute; text-align: center; left: 0; @@ -8518,7 +8603,6 @@ input[type=range]::-ms-thumb { bottom: 0; margin: 0; } - .carousel .indicators .indicator-item { display: inline-block; position: relative; @@ -8526,16 +8610,14 @@ input[type=range]::-ms-thumb { height: 8px; width: 8px; margin: 24px 4px; - background-color: rgba(255, 255, 255, 0.5); - -webkit-transition: background-color .3s; - transition: background-color .3s; + background-color: rgba(255, 255, 255, 0.45); + -webkit-transition: background-color 0.3s; + transition: background-color 0.3s; border-radius: 50%; } - .carousel .indicators .indicator-item.active { - background-color: #fff; + background-color: var(--md-ref-palette-primary100); } - .carousel.scrolling .carousel-item .materialboxed, .carousel .carousel-item:not(.active) .materialboxed { pointer-events: none; @@ -8547,8 +8629,8 @@ input[type=range]::-ms-thumb { position: fixed; z-index: 1000; visibility: hidden; - -webkit-transition: visibility 0s .3s; - transition: visibility 0s .3s; + -webkit-transition: visibility 0s 0.3s; + transition: visibility 0s 0.3s; } .tap-target-wrapper.open { @@ -8556,46 +8638,35 @@ input[type=range]::-ms-thumb { -webkit-transition: visibility 0s; transition: visibility 0s; } - .tap-target-wrapper.open .tap-target { -webkit-transform: scale(1); transform: scale(1); - opacity: .95; + opacity: 0.95; -webkit-transition: opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1), -webkit-transform 0.3s cubic-bezier(0.42, 0, 0.58, 1); transition: opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1), -webkit-transform 0.3s cubic-bezier(0.42, 0, 0.58, 1); transition: transform 0.3s cubic-bezier(0.42, 0, 0.58, 1), opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1); transition: transform 0.3s cubic-bezier(0.42, 0, 0.58, 1), opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1), -webkit-transform 0.3s cubic-bezier(0.42, 0, 0.58, 1); } - .tap-target-wrapper.open .tap-target-wave::before { -webkit-transform: scale(1); transform: scale(1); } - .tap-target-wrapper.open .tap-target-wave::after { visibility: visible; -webkit-animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite; animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite; - -webkit-transition: opacity .3s, - visibility 0s 1s, - -webkit-transform .3s; - transition: opacity .3s, - visibility 0s 1s, - -webkit-transform .3s; - transition: opacity .3s, - transform .3s, - visibility 0s 1s; - transition: opacity .3s, - transform .3s, - visibility 0s 1s, - -webkit-transform .3s; + -webkit-transition: opacity 0.3s, visibility 0s 1s, -webkit-transform 0.3s; + transition: opacity 0.3s, visibility 0s 1s, -webkit-transform 0.3s; + transition: opacity 0.3s, transform 0.3s, visibility 0s 1s; + transition: opacity 0.3s, transform 0.3s, visibility 0s 1s, -webkit-transform 0.3s; } .tap-target { position: absolute; font-size: 1rem; border-radius: 50%; - background-color: #ee6e73; + background-color: var(--md-sys-color-surface); + color: var(--md-sys-color-on-secondary); -webkit-box-shadow: 0 20px 20px 0 rgba(0, 0, 0, 0.14), 0 10px 50px 0 rgba(0, 0, 0, 0.12), 0 30px 10px -20px rgba(0, 0, 0, 0.2); box-shadow: 0 20px 20px 0 rgba(0, 0, 0, 0.14), 0 10px 50px 0 rgba(0, 0, 0, 0.12), 0 30px 10px -20px rgba(0, 0, 0, 0.2); width: 100%; @@ -8619,41 +8690,29 @@ input[type=range]::-ms-thumb { border-radius: 50%; z-index: 10001; } - .tap-target-wave::before, .tap-target-wave::after { - content: ''; + content: ""; display: block; position: absolute; width: 100%; height: 100%; border-radius: 50%; - background-color: #ffffff; + background-color: var(--md-sys-color-surface); } - .tap-target-wave::before { -webkit-transform: scale(0); transform: scale(0); - -webkit-transition: -webkit-transform .3s; - transition: -webkit-transform .3s; - transition: transform .3s; - transition: transform .3s, -webkit-transform .3s; + -webkit-transition: -webkit-transform 0.3s; + transition: -webkit-transform 0.3s; + transition: transform 0.3s; + transition: transform 0.3s, -webkit-transform 0.3s; } - .tap-target-wave::after { visibility: hidden; - -webkit-transition: opacity .3s, - visibility 0s, - -webkit-transform .3s; - transition: opacity .3s, - visibility 0s, - -webkit-transform .3s; - transition: opacity .3s, - transform .3s, - visibility 0s; - transition: opacity .3s, - transform .3s, - visibility 0s, - -webkit-transform .3s; + -webkit-transition: opacity 0.3s, visibility 0s, -webkit-transform 0.3s; + transition: opacity 0.3s, visibility 0s, -webkit-transform 0.3s; + transition: opacity 0.3s, transform 0.3s, visibility 0s; + transition: opacity 0.3s, transform 0.3s, visibility 0s, -webkit-transform 0.3s; z-index: -1; } @@ -8665,7 +8724,6 @@ input[type=range]::-ms-thumb { z-index: 10002; position: absolute !important; } - .tap-target-origin:not(.btn):not(.btn-large):not(.btn-small), .tap-target-origin:not(.btn):not(.btn-large):not(.btn-small):hover { background: none; } @@ -8676,26 +8734,25 @@ input[type=range]::-ms-thumb { height: 600px; } } - .pulse { overflow: visible; position: relative; } - .pulse::before { - content: ''; + content: ""; display: block; position: absolute; + pointer-events: none; width: 100%; height: 100%; top: 0; left: 0; background-color: inherit; border-radius: inherit; - -webkit-transition: opacity .3s, -webkit-transform .3s; - transition: opacity .3s, -webkit-transform .3s; - transition: opacity .3s, transform .3s; - transition: opacity .3s, transform .3s, -webkit-transform .3s; + -webkit-transition: opacity 0.3s, -webkit-transform 0.3s; + transition: opacity 0.3s, -webkit-transform 0.3s; + transition: opacity 0.3s, transform 0.3s; + transition: opacity 0.3s, transform 0.3s, -webkit-transform 0.3s; -webkit-animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite; animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite; z-index: -1; @@ -8736,7 +8793,6 @@ input[type=range]::-ms-thumb { transform: scale(1.5); } } - /* Modal */ .datepicker-modal { max-width: 325px; @@ -8755,6 +8811,7 @@ input[type=range]::-ms-thumb { -ms-flex-direction: column; flex-direction: column; padding: 0; + background-color: var(--md-sys-color-surface); } .datepicker-controls { @@ -8769,35 +8826,44 @@ input[type=range]::-ms-thumb { width: 280px; margin: 0 auto; } - .datepicker-controls .selects-container { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } - .datepicker-controls .select-wrapper input { border-bottom: none; text-align: center; margin: 0; } - .datepicker-controls .select-wrapper input:focus { border-bottom: none; } - .datepicker-controls .select-wrapper .caret { display: none; } - .datepicker-controls .select-year input { width: 50px; } - .datepicker-controls .select-month input { width: 80px; } +.datepicker-controls .month-prev, +.datepicker-controls .month-next { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; +} +.datepicker-controls .month-prev > svg, +.datepicker-controls .month-next > svg { + fill: var(--md-sys-color-on-surface-variant); +} .month-prev, .month-next { margin-top: 4px; @@ -8812,19 +8878,17 @@ input[type=range]::-ms-thumb { -webkit-flex: 1 auto; -ms-flex: 1 auto; flex: 1 auto; - background-color: #26a69a; - color: #fff; + background-color: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); padding: 20px 22px; font-weight: 500; } - .datepicker-date-display .year-text { display: block; font-size: 1.5rem; line-height: 25px; - color: rgba(255, 255, 255, 0.7); + color: var(--md-sys-color-on-primary); } - .datepicker-date-display .date-text { display: block; font-size: 2.8rem; @@ -8845,41 +8909,34 @@ input[type=range]::-ms-thumb { font-size: 1rem; margin: 0 auto; } - .datepicker-table thead { border-bottom: none; } - .datepicker-table th { padding: 10px 5px; text-align: center; } - .datepicker-table tr { border: none; } - .datepicker-table abbr { text-decoration: none; - color: #999; + color: var(--md-sys-color-on-surface-variant); } - .datepicker-table td { + color: var(--md-sys-color-on-background); border-radius: 50%; padding: 0; } - .datepicker-table td.is-today { - color: #26a69a; + color: var(--md-sys-color-primary); } - .datepicker-table td.is-selected { - background-color: #26a69a; - color: #fff; + background-color: var(--md-sys-color-primary); + color: var(--md-sys-color-on-primary); } - .datepicker-table td.is-outside-current-month, .datepicker-table td.is-disabled { - color: rgba(0, 0, 0, 0.3); + color: var(--md-sys-color-on-surface); pointer-events: none; } @@ -8894,9 +8951,11 @@ input[type=range]::-ms-thumb { cursor: pointer; color: inherit; } - +.datepicker-day-button:hover { + background-color: rgba(var(--md-sys-color-primary-numeric), 0.06); +} .datepicker-day-button:focus { - background-color: rgba(43, 161, 150, 0.25); + background-color: rgba(var(--md-sys-color-primary-numeric), 0.18); } /* Footer */ @@ -8918,16 +8977,16 @@ input[type=range]::-ms-thumb { .datepicker-clear, .datepicker-today, .datepicker-done { - color: #26a69a; + color: var(--md-sys-color-primary); padding: 0 1rem; } .datepicker-clear { - color: #F44336; + color: var(--md-sys-color-error); } /* Media Queries */ -@media only screen and (min-width: 601px) { +@media only screen and (min-width : 601px) { .datepicker-modal { max-width: 625px; } @@ -8953,7 +9012,6 @@ input[type=range]::-ms-thumb { line-height: 44px; } } - /* Timepicker Containers */ .timepicker-modal { max-width: 325px; @@ -8974,16 +9032,17 @@ input[type=range]::-ms-thumb { } .text-primary { - color: white; + color: var(--md-sys-color-on-primary); } /* Clock Digital Display */ .timepicker-digital-display { + width: 200px; -webkit-box-flex: 1; -webkit-flex: 1 auto; -ms-flex: 1 auto; flex: 1 auto; - background-color: #26a69a; + background-color: var(--md-sys-color-primary); padding: 10px; font-weight: 300; } @@ -8992,7 +9051,7 @@ input[type=range]::-ms-thumb { font-size: 4rem; font-weight: bold; text-align: center; - color: rgba(255, 255, 255, 0.6); + color: var(--font-on-primary-color-medium); font-weight: 400; position: relative; -webkit-user-select: none; @@ -9000,21 +9059,35 @@ input[type=range]::-ms-thumb { -ms-user-select: none; user-select: none; } +.timepicker-text-container input[type=text] { + height: 4rem; + color: rgba(255, 255, 255, 0.6); + border-bottom: 0px; + font-size: 4rem; + direction: ltr; +} -.timepicker-span-hours, -.timepicker-span-minutes, +.timepicker-input-hours, +.timepicker-input-minutes, .timepicker-span-am-pm div { cursor: pointer; } -.timepicker-span-hours { +input[type=text].timepicker-input-hours { + text-align: right; + width: 28%; margin-right: 3px; } -.timepicker-span-minutes { +input[type=text].timepicker-input-minutes { + width: 33%; margin-left: 3px; } +input[type=text].text-primary { + color: rgb(255, 255, 255); +} + .timepicker-display-am-pm { font-size: 1.3rem; position: absolute; @@ -9029,10 +9102,11 @@ input[type=range]::-ms-thumb { -webkit-flex: 2.5 auto; -ms-flex: 2.5 auto; flex: 2.5 auto; + background-color: var(--md-sys-color-surface); } .timepicker-plate { - background-color: #eee; + background-color: rgba(0, 0, 0, 0.09); border-radius: 50%; width: 270px; height: 270px; @@ -9062,7 +9136,7 @@ input[type=range]::-ms-thumb { .timepicker-tick { border-radius: 50%; - color: rgba(0, 0, 0, 0.87); + color: var(--md-sys-color-on-background); line-height: 40px; text-align: center; width: 40px; @@ -9074,7 +9148,7 @@ input[type=range]::-ms-thumb { .timepicker-tick.active, .timepicker-tick:hover { - background-color: rgba(38, 166, 154, 0.25); + background-color: rgba(var(--md-sys-color-primary-numeric), 0.06); } .timepicker-dial { @@ -9087,12 +9161,10 @@ input[type=range]::-ms-thumb { .timepicker-dial-out { opacity: 0; } - .timepicker-dial-out.timepicker-hours { -webkit-transform: scale(1.1, 1.1); transform: scale(1.1, 1.1); } - .timepicker-dial-out.timepicker-minutes { -webkit-transform: scale(0.8, 0.8); transform: scale(0.8, 0.8); @@ -9102,9 +9174,8 @@ input[type=range]::-ms-thumb { -webkit-transition: opacity 175ms; transition: opacity 175ms; } - .timepicker-canvas line { - stroke: #26a69a; + stroke: var(--md-sys-color-primary); stroke-width: 4; stroke-linecap: round; } @@ -9115,12 +9186,12 @@ input[type=range]::-ms-thumb { .timepicker-canvas-bearing { stroke: none; - fill: #26a69a; + fill: var(--md-sys-color-primary); } .timepicker-canvas-bg { stroke: none; - fill: #26a69a; + fill: var(--md-sys-color-primary); } /* Footer */ @@ -9138,11 +9209,11 @@ input[type=range]::-ms-thumb { } .timepicker-clear { - color: #F44336; + color: var(--md-sys-color-error); } .timepicker-close { - color: #26a69a; + color: var(--md-sys-color-primary); } .timepicker-clear, @@ -9151,7 +9222,7 @@ input[type=range]::-ms-thumb { } /* Media Queries */ -@media only screen and (min-width: 601px) { +@media only screen and (min-width : 601px) { .timepicker-modal { max-width: 600px; } @@ -9172,4 +9243,4 @@ input[type=range]::-ms-thumb { text-align: center; margin-top: 1.2rem; } -} +} \ No newline at end of file diff --git a/client/lib/assets/materialize.js b/client/lib/assets/materialize.js index eb286f5..48fa6a5 100644 --- a/client/lib/assets/materialize.js +++ b/client/lib/assets/materialize.js @@ -1,2216 +1,2663 @@ /*! - * Materialize v1.1.0-alpha (https://materializecss.github.io/materialize) - * Copyright 2014-2021 Materialize + * Materialize v2.1.0 (https://materializeweb.com) + * Copyright 2014-2024 Materialize * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE) */ -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/*! cash-dom 1.3.5, https://github.com/kenwheeler/cash @license MIT */ -(function (factory) { - window.cash = factory(); -})(function () { - var doc = document, - win = window, - ArrayProto = Array.prototype, - slice = ArrayProto.slice, - filter = ArrayProto.filter, - push = ArrayProto.push; - - var noop = function () {}, - isFunction = function (item) { - // @see https://crbug.com/568448 - return typeof item === typeof noop && item.call; - }, - isString = function (item) { - return typeof item === typeof ""; - }; - - var idMatch = /^#[\w-]*$/, - classMatch = /^\.[\w-]*$/, - htmlMatch = /<.+>/, - singlet = /^\w+$/; - - function find(selector, context) { - context = context || doc; - var elems = classMatch.test(selector) ? context.getElementsByClassName(selector.slice(1)) : singlet.test(selector) ? context.getElementsByTagName(selector) : context.querySelectorAll(selector); - return elems; - } - - var frag; - function parseHTML(str) { - if (!frag) { - frag = doc.implementation.createHTMLDocument(null); - var base = frag.createElement("base"); - base.href = doc.location.href; - frag.head.appendChild(base); - } - - frag.body.innerHTML = str; - - return frag.body.childNodes; - } - - function onReady(fn) { - if (doc.readyState !== "loading") { - fn(); - } else { - doc.addEventListener("DOMContentLoaded", fn); - } - } - - function Init(selector, context) { - if (!selector) { - return this; - } - - // If already a cash collection, don't do any further processing - if (selector.cash && selector !== win) { - return selector; - } - - var elems = selector, - i = 0, - length; - - if (isString(selector)) { - elems = idMatch.test(selector) ? - // If an ID use the faster getElementById check - doc.getElementById(selector.slice(1)) : htmlMatch.test(selector) ? - // If HTML, parse it into real elements - parseHTML(selector) : - // else use `find` - find(selector, context); - - // If function, use as shortcut for DOM ready - } else if (isFunction(selector)) { - onReady(selector);return this; - } - - if (!elems) { - return this; - } - - // If a single DOM element is passed in or received via ID, return the single element - if (elems.nodeType || elems === win) { - this[0] = elems; - this.length = 1; - } else { - // Treat like an array and loop through each item. - length = this.length = elems.length; - for (; i < length; i++) { - this[i] = elems[i]; - } - } - - return this; - } - - function cash(selector, context) { - return new Init(selector, context); - } - - var fn = cash.fn = cash.prototype = Init.prototype = { // jshint ignore:line - cash: true, - length: 0, - push: push, - splice: ArrayProto.splice, - map: ArrayProto.map, - init: Init - }; - - Object.defineProperty(fn, "constructor", { value: cash }); - - cash.parseHTML = parseHTML; - cash.noop = noop; - cash.isFunction = isFunction; - cash.isString = isString; - - cash.extend = fn.extend = function (target) { - target = target || {}; - - var args = slice.call(arguments), - length = args.length, - i = 1; - - if (args.length === 1) { - target = this; - i = 0; - } - - for (; i < length; i++) { - if (!args[i]) { - continue; - } - for (var key in args[i]) { - if (args[i].hasOwnProperty(key)) { - target[key] = args[i][key]; - } - } - } - - return target; - }; - - function each(collection, callback) { - var l = collection.length, - i = 0; - - for (; i < l; i++) { - if (callback.call(collection[i], collection[i], i, collection) === false) { - break; - } - } - } - - function matches(el, selector) { - var m = el && (el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector || el.oMatchesSelector); - return !!m && m.call(el, selector); - } - - function getCompareFunction(selector) { - return ( - /* Use browser's `matches` function if string */ - isString(selector) ? matches : - /* Match a cash element */ - selector.cash ? function (el) { - return selector.is(el); - } : - /* Direct comparison */ - function (el, selector) { - return el === selector; - } - ); - } - - function unique(collection) { - return cash(slice.call(collection).filter(function (item, index, self) { - return self.indexOf(item) === index; - })); - } - - cash.extend({ - merge: function (first, second) { - var len = +second.length, - i = first.length, - j = 0; - - for (; j < len; i++, j++) { - first[i] = second[j]; - } - - first.length = i; - return first; - }, - - each: each, - matches: matches, - unique: unique, - isArray: Array.isArray, - isNumeric: function (n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - }); - - var uid = cash.uid = "_cash" + Date.now(); - - function getDataCache(node) { - return node[uid] = node[uid] || {}; - } - - function setData(node, key, value) { - return getDataCache(node)[key] = value; - } - - function getData(node, key) { - var c = getDataCache(node); - if (c[key] === undefined) { - c[key] = node.dataset ? node.dataset[key] : cash(node).attr("data-" + key); - } - return c[key]; - } - - function removeData(node, key) { - var c = getDataCache(node); - if (c) { - delete c[key]; - } else if (node.dataset) { - delete node.dataset[key]; - } else { - cash(node).removeAttr("data-" + name); - } - } - - fn.extend({ - data: function (name, value) { - if (isString(name)) { - return value === undefined ? getData(this[0], name) : this.each(function (v) { - return setData(v, name, value); - }); - } - - for (var key in name) { - this.data(key, name[key]); - } - - return this; - }, - - removeData: function (key) { - return this.each(function (v) { - return removeData(v, key); - }); - } - - }); - - var notWhiteMatch = /\S+/g; - - function getClasses(c) { - return isString(c) && c.match(notWhiteMatch); - } - - function hasClass(v, c) { - return v.classList ? v.classList.contains(c) : new RegExp("(^| )" + c + "( |$)", "gi").test(v.className); - } - - function addClass(v, c, spacedName) { - if (v.classList) { - v.classList.add(c); - } else if (spacedName.indexOf(" " + c + " ")) { - v.className += " " + c; - } - } - - function removeClass(v, c) { - if (v.classList) { - v.classList.remove(c); - } else { - v.className = v.className.replace(c, ""); - } - } - - fn.extend({ - addClass: function (c) { - var classes = getClasses(c); - - return classes ? this.each(function (v) { - var spacedName = " " + v.className + " "; - each(classes, function (c) { - addClass(v, c, spacedName); - }); - }) : this; - }, - - attr: function (name, value) { - if (!name) { - return undefined; - } - - if (isString(name)) { - if (value === undefined) { - return this[0] ? this[0].getAttribute ? this[0].getAttribute(name) : this[0][name] : undefined; - } - - return this.each(function (v) { - if (v.setAttribute) { - v.setAttribute(name, value); - } else { - v[name] = value; - } - }); - } - - for (var key in name) { - this.attr(key, name[key]); - } - - return this; - }, - - hasClass: function (c) { - var check = false, - classes = getClasses(c); - if (classes && classes.length) { - this.each(function (v) { - check = hasClass(v, classes[0]); - return !check; - }); - } - return check; - }, - - prop: function (name, value) { - if (isString(name)) { - return value === undefined ? this[0][name] : this.each(function (v) { - v[name] = value; - }); - } - - for (var key in name) { - this.prop(key, name[key]); - } - - return this; - }, - - removeAttr: function (name) { - return this.each(function (v) { - if (v.removeAttribute) { - v.removeAttribute(name); - } else { - delete v[name]; - } - }); - }, - - removeClass: function (c) { - if (!arguments.length) { - return this.attr("class", ""); - } - var classes = getClasses(c); - return classes ? this.each(function (v) { - each(classes, function (c) { - removeClass(v, c); - }); - }) : this; - }, - - removeProp: function (name) { - return this.each(function (v) { - delete v[name]; - }); - }, - - toggleClass: function (c, state) { - if (state !== undefined) { - return this[state ? "addClass" : "removeClass"](c); - } - var classes = getClasses(c); - return classes ? this.each(function (v) { - var spacedName = " " + v.className + " "; - each(classes, function (c) { - if (hasClass(v, c)) { - removeClass(v, c); - } else { - addClass(v, c, spacedName); - } - }); - }) : this; - } }); - - fn.extend({ - add: function (selector, context) { - return unique(cash.merge(this, cash(selector, context))); - }, - - each: function (callback) { - each(this, callback); - return this; - }, - - eq: function (index) { - return cash(this.get(index)); - }, - - filter: function (selector) { - if (!selector) { - return this; - } - - var comparator = isFunction(selector) ? selector : getCompareFunction(selector); - - return cash(filter.call(this, function (e) { - return comparator(e, selector); - })); - }, - - first: function () { - return this.eq(0); - }, - - get: function (index) { - if (index === undefined) { - return slice.call(this); - } - return index < 0 ? this[index + this.length] : this[index]; - }, - - index: function (elem) { - var child = elem ? cash(elem)[0] : this[0], - collection = elem ? this : cash(child).parent().children(); - return slice.call(collection).indexOf(child); - }, - - last: function () { - return this.eq(-1); - } - - }); - - var camelCase = function () { - var camelRegex = /(?:^\w|[A-Z]|\b\w)/g, - whiteSpace = /[\s-_]+/g; - return function (str) { - return str.replace(camelRegex, function (letter, index) { - return letter[index === 0 ? "toLowerCase" : "toUpperCase"](); - }).replace(whiteSpace, ""); - }; - }(); - - var getPrefixedProp = function () { - var cache = {}, - doc = document, - div = doc.createElement("div"), - style = div.style; - - return function (prop) { - prop = camelCase(prop); - if (cache[prop]) { - return cache[prop]; - } - - var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), - prefixes = ["webkit", "moz", "ms", "o"], - props = (prop + " " + prefixes.join(ucProp + " ") + ucProp).split(" "); - - each(props, function (p) { - if (p in style) { - cache[p] = prop = cache[prop] = p; - return false; - } - }); - - return cache[prop]; - }; - }(); - - cash.prefixedProp = getPrefixedProp; - cash.camelCase = camelCase; - - fn.extend({ - css: function (prop, value) { - if (isString(prop)) { - prop = getPrefixedProp(prop); - return arguments.length > 1 ? this.each(function (v) { - return v.style[prop] = value; - }) : win.getComputedStyle(this[0])[prop]; - } - - for (var key in prop) { - this.css(key, prop[key]); - } - - return this; - } - - }); - - function compute(el, prop) { - return parseInt(win.getComputedStyle(el[0], null)[prop], 10) || 0; - } - - each(["Width", "Height"], function (v) { - var lower = v.toLowerCase(); - - fn[lower] = function () { - return this[0].getBoundingClientRect()[lower]; - }; - - fn["inner" + v] = function () { - return this[0]["client" + v]; - }; - - fn["outer" + v] = function (margins) { - return this[0]["offset" + v] + (margins ? compute(this, "margin" + (v === "Width" ? "Left" : "Top")) + compute(this, "margin" + (v === "Width" ? "Right" : "Bottom")) : 0); - }; - }); - - function registerEvent(node, eventName, callback) { - var eventCache = getData(node, "_cashEvents") || setData(node, "_cashEvents", {}); - eventCache[eventName] = eventCache[eventName] || []; - eventCache[eventName].push(callback); - node.addEventListener(eventName, callback); - } - - function removeEvent(node, eventName, callback) { - var events = getData(node, "_cashEvents"), - eventCache = events && events[eventName], - index; - - if (!eventCache) { - return; - } - - if (callback) { - node.removeEventListener(eventName, callback); - index = eventCache.indexOf(callback); - if (index >= 0) { - eventCache.splice(index, 1); - } - } else { - each(eventCache, function (event) { - node.removeEventListener(eventName, event); - }); - eventCache = []; - } - } - - fn.extend({ - off: function (eventName, callback) { - return this.each(function (v) { - return removeEvent(v, eventName, callback); - }); - }, - - on: function (eventName, delegate, callback, runOnce) { - // jshint ignore:line - var originalCallback; - if (!isString(eventName)) { - for (var key in eventName) { - this.on(key, delegate, eventName[key]); - } - return this; - } - - if (isFunction(delegate)) { - callback = delegate; - delegate = null; - } - - if (eventName === "ready") { - onReady(callback); - return this; - } - - if (delegate) { - originalCallback = callback; - callback = function (e) { - var t = e.target; - while (!matches(t, delegate)) { - if (t === this || t === null) { - return t = false; - } - - t = t.parentNode; - } - - if (t) { - originalCallback.call(t, e); - } - }; - } - - return this.each(function (v) { - var finalCallback = callback; - if (runOnce) { - finalCallback = function () { - callback.apply(this, arguments); - removeEvent(v, eventName, finalCallback); - }; - } - registerEvent(v, eventName, finalCallback); - }); - }, - - one: function (eventName, delegate, callback) { - return this.on(eventName, delegate, callback, true); - }, - - ready: onReady, - - /** - * Modified - * Triggers browser event - * @param String eventName - * @param Object data - Add properties to event object - */ - trigger: function (eventName, data) { - if (document.createEvent) { - var evt = document.createEvent('HTMLEvents'); - evt.initEvent(eventName, true, false); - evt = this.extend(evt, data); - return this.each(function (v) { - return v.dispatchEvent(evt); - }); - } - } - - }); - - function encode(name, value) { - return "&" + encodeURIComponent(name) + "=" + encodeURIComponent(value).replace(/%20/g, "+"); - } - - function getSelectMultiple_(el) { - var values = []; - each(el.options, function (o) { - if (o.selected) { - values.push(o.value); - } - }); - return values.length ? values : null; - } - - function getSelectSingle_(el) { - var selectedIndex = el.selectedIndex; - return selectedIndex >= 0 ? el.options[selectedIndex].value : null; - } - - function getValue(el) { - var type = el.type; - if (!type) { - return null; - } - switch (type.toLowerCase()) { - case "select-one": - return getSelectSingle_(el); - case "select-multiple": - return getSelectMultiple_(el); - case "radio": - return el.checked ? el.value : null; - case "checkbox": - return el.checked ? el.value : null; - default: - return el.value ? el.value : null; - } - } - - fn.extend({ - serialize: function () { - var query = ""; - - each(this[0].elements || this, function (el) { - if (el.disabled || el.tagName === "FIELDSET") { - return; - } - var name = el.name; - switch (el.type.toLowerCase()) { - case "file": - case "reset": - case "submit": - case "button": - break; - case "select-multiple": - var values = getValue(el); - if (values !== null) { - each(values, function (value) { - query += encode(name, value); - }); - } - break; - default: - var value = getValue(el); - if (value !== null) { - query += encode(name, value); - } - } - }); - - return query.substr(1); - }, - - val: function (value) { - if (value === undefined) { - return getValue(this[0]); - } - - return this.each(function (v) { - return v.value = value; - }); - } - - }); - - function insertElement(el, child, prepend) { - if (prepend) { - var first = el.childNodes[0]; - el.insertBefore(child, first); - } else { - el.appendChild(child); - } - } - - function insertContent(parent, child, prepend) { - var str = isString(child); - - if (!str && child.length) { - each(child, function (v) { - return insertContent(parent, v, prepend); - }); - return; - } - - each(parent, str ? function (v) { - return v.insertAdjacentHTML(prepend ? "afterbegin" : "beforeend", child); - } : function (v, i) { - return insertElement(v, i === 0 ? child : child.cloneNode(true), prepend); - }); - } - - fn.extend({ - after: function (selector) { - cash(selector).insertAfter(this); - return this; - }, - - append: function (content) { - insertContent(this, content); - return this; - }, - - appendTo: function (parent) { - insertContent(cash(parent), this); - return this; - }, - - before: function (selector) { - cash(selector).insertBefore(this); - return this; - }, - - clone: function () { - return cash(this.map(function (v) { - return v.cloneNode(true); - })); - }, - - empty: function () { - this.html(""); - return this; - }, - - html: function (content) { - if (content === undefined) { - return this[0].innerHTML; - } - var source = content.nodeType ? content[0].outerHTML : content; - return this.each(function (v) { - return v.innerHTML = source; - }); - }, - - insertAfter: function (selector) { - var _this = this; - - cash(selector).each(function (el, i) { - var parent = el.parentNode, - sibling = el.nextSibling; - _this.each(function (v) { - parent.insertBefore(i === 0 ? v : v.cloneNode(true), sibling); - }); - }); - - return this; - }, - - insertBefore: function (selector) { - var _this2 = this; - cash(selector).each(function (el, i) { - var parent = el.parentNode; - _this2.each(function (v) { - parent.insertBefore(i === 0 ? v : v.cloneNode(true), el); - }); - }); - return this; - }, - - prepend: function (content) { - insertContent(this, content, true); - return this; - }, - - prependTo: function (parent) { - insertContent(cash(parent), this, true); - return this; - }, - - remove: function () { - return this.each(function (v) { - if (!!v.parentNode) { - return v.parentNode.removeChild(v); - } - }); - }, - - text: function (content) { - if (content === undefined) { - return this[0].textContent; - } - return this.each(function (v) { - return v.textContent = content; - }); - } - - }); - - var docEl = doc.documentElement; - - fn.extend({ - position: function () { - var el = this[0]; - return { - left: el.offsetLeft, - top: el.offsetTop - }; - }, - - offset: function () { - var rect = this[0].getBoundingClientRect(); - return { - top: rect.top + win.pageYOffset - docEl.clientTop, - left: rect.left + win.pageXOffset - docEl.clientLeft - }; - }, - - offsetParent: function () { - return cash(this[0].offsetParent); - } - - }); - - fn.extend({ - children: function (selector) { - var elems = []; - this.each(function (el) { - push.apply(elems, el.children); - }); - elems = unique(elems); - - return !selector ? elems : elems.filter(function (v) { - return matches(v, selector); - }); - }, - - closest: function (selector) { - if (!selector || this.length < 1) { - return cash(); - } - if (this.is(selector)) { - return this.filter(selector); - } - return this.parent().closest(selector); - }, - - is: function (selector) { - if (!selector) { - return false; - } - - var match = false, - comparator = getCompareFunction(selector); - - this.each(function (el) { - match = comparator(el, selector); - return !match; - }); - - return match; - }, - - find: function (selector) { - if (!selector || selector.nodeType) { - return cash(selector && this.has(selector).length ? selector : null); - } - - var elems = []; - this.each(function (el) { - push.apply(elems, find(selector, el)); - }); - - return unique(elems); - }, - - has: function (selector) { - var comparator = isString(selector) ? function (el) { - return find(selector, el).length !== 0; - } : function (el) { - return el.contains(selector); - }; - - return this.filter(comparator); - }, - - next: function () { - return cash(this[0].nextElementSibling); - }, - - not: function (selector) { - if (!selector) { - return this; - } - - var comparator = getCompareFunction(selector); - - return this.filter(function (el) { - return !comparator(el, selector); - }); - }, - - parent: function () { - var result = []; - - this.each(function (item) { - if (item && item.parentNode) { - result.push(item.parentNode); - } - }); - - return unique(result); - }, - - parents: function (selector) { - var last, - result = []; - - this.each(function (item) { - last = item; - - while (last && last.parentNode && last !== doc.body.parentNode) { - last = last.parentNode; - - if (!selector || selector && matches(last, selector)) { - result.push(last); - } - } - }); - - return unique(result); - }, - - prev: function () { - return cash(this[0].previousElementSibling); - }, - - siblings: function (selector) { - var collection = this.parent().children(selector), - el = this[0]; - - return collection.filter(function (i) { - return i !== el; - }); - } - - }); - - return cash; -}); +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else { + var a = factory(); + for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; + } +})(this, function() { +return /******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./src/autocomplete.ts": +/*!*****************************!*\ + !*** ./src/autocomplete.ts ***! + \*****************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Autocomplete = void 0; +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const dropdown_1 = __webpack_require__(/*! ./dropdown */ "./src/dropdown.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); ; -var Component = function () { - /** - * Generic constructor for all components - * @constructor - * @param {Element} el - * @param {Object} options - */ - function Component(classDef, el, options) { - _classCallCheck(this, Component); - - // Display error if el is valid HTML Element - if (!(el instanceof Element)) { - console.error(Error(el + ' is not an HTML Element')); - } - - // If exists, destroy and reinitialize in child - var ins = classDef.getInstance(el); - if (!!ins) { - ins.destroy(); - } - - this.el = el; - this.$el = cash(el); - } - - /** - * Initializes components - * @param {class} classDef - * @param {Element | NodeList | jQuery} els - * @param {Object} options - */ - - - _createClass(Component, null, [{ - key: "init", - value: function init(classDef, els, options) { - var instances = null; - if (els instanceof Element) { - instances = new classDef(els, options); - } else if (!!els && (els.jquery || els.cash || els instanceof NodeList)) { - var instancesArr = []; - for (var i = 0; i < els.length; i++) { - instancesArr.push(new classDef(els[i], options)); - } - instances = instancesArr; - } - - return instances; - } - }]); - - return Component; -}(); - -; // Required for Meteor package, the use of window prevents export by Meteor -(function (window) { - if (window.Package) { - M = {}; - } else { - window.M = {}; - } - - // Check for jQuery - M.jQueryLoaded = !!window.jQuery; -})(window); - -// AMD -if (typeof define === 'function' && define.amd) { - define('M', [], function () { - return M; - }); - - // Common JS -} else if (typeof exports !== 'undefined' && !exports.nodeType) { - if (typeof module !== 'undefined' && !module.nodeType && module.exports) { - exports = module.exports = M; - } - exports.default = M; -} - -M.version = '1.0.0'; - -M.keys = { - TAB: 9, - ENTER: 13, - ESC: 27, - ARROW_UP: 38, - ARROW_DOWN: 40 -}; - -/** - * TabPress Keydown handler - */ -M.tabPressed = false; -M.keyDown = false; -var docHandleKeydown = function (e) { - M.keyDown = true; - if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) { - M.tabPressed = true; - } -}; -var docHandleKeyup = function (e) { - M.keyDown = false; - if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) { - M.tabPressed = false; - } -}; -var docHandleFocus = function (e) { - if (M.keyDown) { - document.body.classList.add('keyboard-focused'); - } -}; -var docHandleBlur = function (e) { - document.body.classList.remove('keyboard-focused'); -}; -document.addEventListener('keydown', docHandleKeydown, true); -document.addEventListener('keyup', docHandleKeyup, true); -document.addEventListener('focus', docHandleFocus, true); -document.addEventListener('blur', docHandleBlur, true); - -/** - * Initialize jQuery wrapper for plugin - * @param {Class} plugin javascript class - * @param {string} pluginName jQuery plugin name - * @param {string} classRef Class reference name - */ -M.initializeJqueryWrapper = function (plugin, pluginName, classRef) { - jQuery.fn[pluginName] = function (methodOrOptions) { - // Call plugin method if valid method name is passed in - if (plugin.prototype[methodOrOptions]) { - var params = Array.prototype.slice.call(arguments, 1); - - // Getter methods - if (methodOrOptions.slice(0, 3) === 'get') { - var instance = this.first()[0][classRef]; - return instance[methodOrOptions].apply(instance, params); - } - - // Void methods - return this.each(function () { - var instance = this[classRef]; - instance[methodOrOptions].apply(instance, params); - }); - - // Initialize plugin if options or no argument is passed in - } else if (typeof methodOrOptions === 'object' || !methodOrOptions) { - plugin.init(this, arguments[0]); - return this; - } - - // Return error if an unrecognized method name is passed in - jQuery.error("Method " + methodOrOptions + " does not exist on jQuery." + pluginName); - }; -}; - -/** - * Automatically initialize components - * @param {Element} context DOM Element to search within for components - */ -M.AutoInit = function (context) { - // Use document.body if no context is given - var root = !!context ? context : document.body; - - var registry = { - Autocomplete: root.querySelectorAll('.autocomplete:not(.no-autoinit)'), - Carousel: root.querySelectorAll('.carousel:not(.no-autoinit)'), - Chips: root.querySelectorAll('.chips:not(.no-autoinit)'), - Collapsible: root.querySelectorAll('.collapsible:not(.no-autoinit)'), - Datepicker: root.querySelectorAll('.datepicker:not(.no-autoinit)'), - Dropdown: root.querySelectorAll('.dropdown-trigger:not(.no-autoinit)'), - Materialbox: root.querySelectorAll('.materialboxed:not(.no-autoinit)'), - Modal: root.querySelectorAll('.modal:not(.no-autoinit)'), - Parallax: root.querySelectorAll('.parallax:not(.no-autoinit)'), - Pushpin: root.querySelectorAll('.pushpin:not(.no-autoinit)'), - ScrollSpy: root.querySelectorAll('.scrollspy:not(.no-autoinit)'), - FormSelect: root.querySelectorAll('select:not(.no-autoinit)'), - Sidenav: root.querySelectorAll('.sidenav:not(.no-autoinit)'), - Tabs: root.querySelectorAll('.tabs:not(.no-autoinit)'), - TapTarget: root.querySelectorAll('.tap-target:not(.no-autoinit)'), - Timepicker: root.querySelectorAll('.timepicker:not(.no-autoinit)'), - Tooltip: root.querySelectorAll('.tooltipped:not(.no-autoinit)'), - FloatingActionButton: root.querySelectorAll('.fixed-action-btn:not(.no-autoinit)') - }; - - for (var pluginName in registry) { - var plugin = M[pluginName]; - plugin.init(registry[pluginName]); - } -}; - -/** - * Generate approximated selector string for a jQuery object - * @param {jQuery} obj jQuery object to be parsed - * @returns {string} - */ -M.objectSelectorString = function (obj) { - var tagStr = obj.prop('tagName') || ''; - var idStr = obj.attr('id') || ''; - var classStr = obj.attr('class') || ''; - return (tagStr + idStr + classStr).replace(/\s/g, ''); -}; - -// Unique Random ID -M.guid = function () { - function s4() { - return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); - } - return function () { - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); - }; -}(); - -/** - * Escapes hash from special characters - * @param {string} hash String returned from this.hash - * @returns {string} - */ -M.escapeHash = function (hash) { - return hash.replace(/(:|\.|\[|\]|,|=|\/)/g, '\\$1'); -}; - -/** - * @typedef {Object} Edges - * @property {Boolean} top If the top edge was exceeded - * @property {Boolean} right If the right edge was exceeded - * @property {Boolean} bottom If the bottom edge was exceeded - * @property {Boolean} left If the left edge was exceeded - */ - -/** - * @typedef {Object} Bounding - * @property {Number} left left offset coordinate - * @property {Number} top top offset coordinate - * @property {Number} width - * @property {Number} height - */ - -/** - * Escapes hash from special characters - * @param {Element} container Container element that acts as the boundary - * @param {Bounding} bounding element bounding that is being checked - * @param {Number} offset offset from edge that counts as exceeding - * @returns {Edges} - */ -M.checkWithinContainer = function (container, bounding, offset) { - var edges = { - top: false, - right: false, - bottom: false, - left: false - }; - - var containerRect = container.getBoundingClientRect(); - // If body element is smaller than viewport, use viewport height instead. - var containerBottom = container === document.body ? Math.max(containerRect.bottom, window.innerHeight) : containerRect.bottom; - - var scrollLeft = container.scrollLeft; - var scrollTop = container.scrollTop; - - var scrolledX = bounding.left - scrollLeft; - var scrolledY = bounding.top - scrollTop; - - // Check for container and viewport for each edge - if (scrolledX < containerRect.left + offset || scrolledX < offset) { - edges.left = true; - } - - if (scrolledX + bounding.width > containerRect.right - offset || scrolledX + bounding.width > window.innerWidth - offset) { - edges.right = true; - } - - if (scrolledY < containerRect.top + offset || scrolledY < offset) { - edges.top = true; - } - - if (scrolledY + bounding.height > containerBottom - offset || scrolledY + bounding.height > window.innerHeight - offset) { - edges.bottom = true; - } - - return edges; -}; - -M.checkPossibleAlignments = function (el, container, bounding, offset) { - var canAlign = { - top: true, - right: true, - bottom: true, - left: true, - spaceOnTop: null, - spaceOnRight: null, - spaceOnBottom: null, - spaceOnLeft: null - }; - - var containerAllowsOverflow = getComputedStyle(container).overflow === 'visible'; - var containerRect = container.getBoundingClientRect(); - var containerHeight = Math.min(containerRect.height, window.innerHeight); - var containerWidth = Math.min(containerRect.width, window.innerWidth); - var elOffsetRect = el.getBoundingClientRect(); - - var scrollLeft = container.scrollLeft; - var scrollTop = container.scrollTop; - - var scrolledX = bounding.left - scrollLeft; - var scrolledYTopEdge = bounding.top - scrollTop; - var scrolledYBottomEdge = bounding.top + elOffsetRect.height - scrollTop; - - // Check for container and viewport for left - canAlign.spaceOnRight = !containerAllowsOverflow ? containerWidth - (scrolledX + bounding.width) : window.innerWidth - (elOffsetRect.left + bounding.width); - if (canAlign.spaceOnRight < 0) { - canAlign.left = false; - } - - // Check for container and viewport for Right - canAlign.spaceOnLeft = !containerAllowsOverflow ? scrolledX - bounding.width + elOffsetRect.width : elOffsetRect.right - bounding.width; - if (canAlign.spaceOnLeft < 0) { - canAlign.right = false; - } - - // Check for container and viewport for Top - canAlign.spaceOnBottom = !containerAllowsOverflow ? containerHeight - (scrolledYTopEdge + bounding.height + offset) : window.innerHeight - (elOffsetRect.top + bounding.height + offset); - if (canAlign.spaceOnBottom < 0) { - canAlign.top = false; - } - - // Check for container and viewport for Bottom - canAlign.spaceOnTop = !containerAllowsOverflow ? scrolledYBottomEdge - (bounding.height - offset) : elOffsetRect.bottom - (bounding.height + offset); - if (canAlign.spaceOnTop < 0) { - canAlign.bottom = false; - } - - return canAlign; -}; - -M.getOverflowParent = function (element) { - if (element == null) { - return null; - } - - if (element === document.body || getComputedStyle(element).overflow !== 'visible') { - return element; - } - - return M.getOverflowParent(element.parentElement); -}; - -/** - * Gets id of component from a trigger - * @param {Element} trigger trigger - * @returns {string} - */ -M.getIdFromTrigger = function (trigger) { - var id = trigger.getAttribute('data-target'); - if (!id) { - id = trigger.getAttribute('href'); - if (id) { - id = id.slice(1); - } else { - id = ''; - } - } - return id; -}; - -/** - * Multi browser support for document scroll top - * @returns {Number} - */ -M.getDocumentScrollTop = function () { - return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; -}; - -/** - * Multi browser support for document scroll left - * @returns {Number} - */ -M.getDocumentScrollLeft = function () { - return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; -}; - -/** - * @typedef {Object} Edges - * @property {Boolean} top If the top edge was exceeded - * @property {Boolean} right If the right edge was exceeded - * @property {Boolean} bottom If the bottom edge was exceeded - * @property {Boolean} left If the left edge was exceeded - */ - -/** - * @typedef {Object} Bounding - * @property {Number} left left offset coordinate - * @property {Number} top top offset coordinate - * @property {Number} width - * @property {Number} height - */ - -/** - * Get time in ms - * @license https://raw.github.com/jashkenas/underscore/master/LICENSE - * @type {function} - * @return {number} - */ -var getTime = Date.now || function () { - return new Date().getTime(); -}; - -/** - * Returns a function, that, when invoked, will only be triggered at most once - * during a given window of time. Normally, the throttled function will run - * as much as it can, without ever going more than once per `wait` duration; - * but if you'd like to disable the execution on the leading edge, pass - * `{leading: false}`. To disable execution on the trailing edge, ditto. - * @license https://raw.github.com/jashkenas/underscore/master/LICENSE - * @param {function} func - * @param {number} wait - * @param {Object=} options - * @returns {Function} - */ -M.throttle = function (func, wait, options) { - var context = void 0, - args = void 0, - result = void 0; - var timeout = null; - var previous = 0; - options || (options = {}); - var later = function () { - previous = options.leading === false ? 0 : getTime(); - timeout = null; - result = func.apply(context, args); - context = args = null; - }; - return function () { - var now = getTime(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; -}; - -/* Feature detection */ -var passiveIfSupported = false; -try { - window.addEventListener("test", null, Object.defineProperty({}, "passive", { - get: function () { - passiveIfSupported = { passive: false }; - } - })); -} catch (err) {} -; /* - v2.2.0 - 2017 Julian Garnier - Released under the MIT license - */ -var $jscomp = { scope: {} };$jscomp.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function (e, r, p) { - if (p.get || p.set) throw new TypeError("ES3 does not support getters and setters.");e != Array.prototype && e != Object.prototype && (e[r] = p.value); -};$jscomp.getGlobal = function (e) { - return "undefined" != typeof window && window === e ? e : "undefined" != typeof global && null != global ? global : e; -};$jscomp.global = $jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX = "jscomp_symbol_"; -$jscomp.initSymbol = function () { - $jscomp.initSymbol = function () {};$jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol); -};$jscomp.symbolCounter_ = 0;$jscomp.Symbol = function (e) { - return $jscomp.SYMBOL_PREFIX + (e || "") + $jscomp.symbolCounter_++; -}; -$jscomp.initSymbolIterator = function () { - $jscomp.initSymbol();var e = $jscomp.global.Symbol.iterator;e || (e = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator"));"function" != typeof Array.prototype[e] && $jscomp.defineProperty(Array.prototype, e, { configurable: !0, writable: !0, value: function () { - return $jscomp.arrayIterator(this); - } });$jscomp.initSymbolIterator = function () {}; -};$jscomp.arrayIterator = function (e) { - var r = 0;return $jscomp.iteratorPrototype(function () { - return r < e.length ? { done: !1, value: e[r++] } : { done: !0 }; - }); -}; -$jscomp.iteratorPrototype = function (e) { - $jscomp.initSymbolIterator();e = { next: e };e[$jscomp.global.Symbol.iterator] = function () { - return this; - };return e; -};$jscomp.array = $jscomp.array || {};$jscomp.iteratorFromArray = function (e, r) { - $jscomp.initSymbolIterator();e instanceof String && (e += "");var p = 0, - m = { next: function () { - if (p < e.length) { - var u = p++;return { value: r(u, e[u]), done: !1 }; - }m.next = function () { - return { done: !0, value: void 0 }; - };return m.next(); - } };m[Symbol.iterator] = function () { - return m; - };return m; -}; -$jscomp.polyfill = function (e, r, p, m) { - if (r) { - p = $jscomp.global;e = e.split(".");for (m = 0; m < e.length - 1; m++) { - var u = e[m];u in p || (p[u] = {});p = p[u]; - }e = e[e.length - 1];m = p[e];r = r(m);r != m && null != r && $jscomp.defineProperty(p, e, { configurable: !0, writable: !0, value: r }); - } -};$jscomp.polyfill("Array.prototype.keys", function (e) { - return e ? e : function () { - return $jscomp.iteratorFromArray(this, function (e) { - return e; - }); - }; -}, "es6-impl", "es3");var $jscomp$this = this; -(function (r) { - M.anime = r(); -})(function () { - function e(a) { - if (!h.col(a)) try { - return document.querySelectorAll(a); - } catch (c) {} - }function r(a, c) { - for (var d = a.length, b = 2 <= arguments.length ? arguments[1] : void 0, f = [], n = 0; n < d; n++) { - if (n in a) { - var k = a[n];c.call(b, k, n, a) && f.push(k); - } - }return f; - }function p(a) { - return a.reduce(function (a, d) { - return a.concat(h.arr(d) ? p(d) : d); - }, []); - }function m(a) { - if (h.arr(a)) return a; - h.str(a) && (a = e(a) || a);return a instanceof NodeList || a instanceof HTMLCollection ? [].slice.call(a) : [a]; - }function u(a, c) { - return a.some(function (a) { - return a === c; - }); - }function C(a) { - var c = {}, - d;for (d in a) { - c[d] = a[d]; - }return c; - }function D(a, c) { - var d = C(a), - b;for (b in a) { - d[b] = c.hasOwnProperty(b) ? c[b] : a[b]; - }return d; - }function z(a, c) { - var d = C(a), - b;for (b in c) { - d[b] = h.und(a[b]) ? c[b] : a[b]; - }return d; - }function T(a) { - a = a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function (a, c, d, k) { - return c + c + d + d + k + k; - });var c = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a); - a = parseInt(c[1], 16);var d = parseInt(c[2], 16), - c = parseInt(c[3], 16);return "rgba(" + a + "," + d + "," + c + ",1)"; - }function U(a) { - function c(a, c, b) { - 0 > b && (b += 1);1 < b && --b;return b < 1 / 6 ? a + 6 * (c - a) * b : .5 > b ? c : b < 2 / 3 ? a + (c - a) * (2 / 3 - b) * 6 : a; - }var d = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a = parseInt(d[1]) / 360;var b = parseInt(d[2]) / 100, - f = parseInt(d[3]) / 100, - d = d[4] || 1;if (0 == b) f = b = a = f;else { - var n = .5 > f ? f * (1 + b) : f + b - f * b, - k = 2 * f - n, - f = c(k, n, a + 1 / 3), - b = c(k, n, a);a = c(k, n, a - 1 / 3); - }return "rgba(" + 255 * f + "," + 255 * b + "," + 255 * a + "," + d + ")"; - }function y(a) { - if (a = /([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a)) return a[2]; - }function V(a) { - if (-1 < a.indexOf("translate") || "perspective" === a) return "px";if (-1 < a.indexOf("rotate") || -1 < a.indexOf("skew")) return "deg"; - }function I(a, c) { - return h.fnc(a) ? a(c.target, c.id, c.total) : a; - }function E(a, c) { - if (c in a.style) return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()) || "0"; - }function J(a, c) { - if (h.dom(a) && u(W, c)) return "transform";if (h.dom(a) && (a.getAttribute(c) || h.svg(a) && a[c])) return "attribute";if (h.dom(a) && "transform" !== c && E(a, c)) return "css";if (null != a[c]) return "object"; - }function X(a, c) { - var d = V(c), - d = -1 < c.indexOf("scale") ? 1 : 0 + d;a = a.style.transform;if (!a) return d;for (var b = [], f = [], n = [], k = /(\w+)\((.+?)\)/g; b = k.exec(a);) { - f.push(b[1]), n.push(b[2]); - }a = r(n, function (a, b) { - return f[b] === c; - });return a.length ? a[0] : d; - }function K(a, c) { - switch (J(a, c)) {case "transform": - return X(a, c);case "css": - return E(a, c);case "attribute": - return a.getAttribute(c);}return a[c] || 0; - }function L(a, c) { - var d = /^(\*=|\+=|-=)/.exec(a);if (!d) return a;var b = y(a) || 0;c = parseFloat(c);a = parseFloat(a.replace(d[0], ""));switch (d[0][0]) {case "+": - return c + a + b;case "-": - return c - a + b;case "*": - return c * a + b;} - }function F(a, c) { - return Math.sqrt(Math.pow(c.x - a.x, 2) + Math.pow(c.y - a.y, 2)); - }function M(a) { - a = a.points;for (var c = 0, d, b = 0; b < a.numberOfItems; b++) { - var f = a.getItem(b);0 < b && (c += F(d, f));d = f; - }return c; - }function N(a) { - if (a.getTotalLength) return a.getTotalLength();switch (a.tagName.toLowerCase()) {case "circle": - return 2 * Math.PI * a.getAttribute("r");case "rect": - return 2 * a.getAttribute("width") + 2 * a.getAttribute("height");case "line": - return F({ x: a.getAttribute("x1"), y: a.getAttribute("y1") }, { x: a.getAttribute("x2"), y: a.getAttribute("y2") });case "polyline": - return M(a);case "polygon": - var c = a.points;return M(a) + F(c.getItem(c.numberOfItems - 1), c.getItem(0));} - }function Y(a, c) { - function d(b) { - b = void 0 === b ? 0 : b;return a.el.getPointAtLength(1 <= c + b ? c + b : 0); - }var b = d(), - f = d(-1), - n = d(1);switch (a.property) {case "x": - return b.x;case "y": - return b.y; - case "angle": - return 180 * Math.atan2(n.y - f.y, n.x - f.x) / Math.PI;} - }function O(a, c) { - var d = /-?\d*\.?\d+/g, - b;b = h.pth(a) ? a.totalLength : a;if (h.col(b)) { - if (h.rgb(b)) { - var f = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);b = f ? "rgba(" + f[1] + ",1)" : b; - } else b = h.hex(b) ? T(b) : h.hsl(b) ? U(b) : void 0; - } else f = (f = y(b)) ? b.substr(0, b.length - f.length) : b, b = c && !/\s/g.test(b) ? f + c : f;b += "";return { original: b, numbers: b.match(d) ? b.match(d).map(Number) : [0], strings: h.str(a) || c ? b.split(d) : [] }; - }function P(a) { - a = a ? p(h.arr(a) ? a.map(m) : m(a)) : [];return r(a, function (a, d, b) { - return b.indexOf(a) === d; - }); - }function Z(a) { - var c = P(a);return c.map(function (a, b) { - return { target: a, id: b, total: c.length }; - }); - }function aa(a, c) { - var d = C(c);if (h.arr(a)) { - var b = a.length;2 !== b || h.obj(a[0]) ? h.fnc(c.duration) || (d.duration = c.duration / b) : a = { value: a }; - }return m(a).map(function (a, b) { - b = b ? 0 : c.delay;a = h.obj(a) && !h.pth(a) ? a : { value: a };h.und(a.delay) && (a.delay = b);return a; - }).map(function (a) { - return z(a, d); - }); - }function ba(a, c) { - var d = {}, - b;for (b in a) { - var f = I(a[b], c);h.arr(f) && (f = f.map(function (a) { - return I(a, c); - }), 1 === f.length && (f = f[0]));d[b] = f; - }d.duration = parseFloat(d.duration);d.delay = parseFloat(d.delay);return d; - }function ca(a) { - return h.arr(a) ? A.apply(this, a) : Q[a]; - }function da(a, c) { - var d;return a.tweens.map(function (b) { - b = ba(b, c);var f = b.value, - e = K(c.target, a.name), - k = d ? d.to.original : e, - k = h.arr(f) ? f[0] : k, - w = L(h.arr(f) ? f[1] : f, k), - e = y(w) || y(k) || y(e);b.from = O(k, e);b.to = O(w, e);b.start = d ? d.end : a.offset;b.end = b.start + b.delay + b.duration;b.easing = ca(b.easing);b.elasticity = (1E3 - Math.min(Math.max(b.elasticity, 1), 999)) / 1E3;b.isPath = h.pth(f);b.isColor = h.col(b.from.original);b.isColor && (b.round = 1);return d = b; - }); - }function ea(a, c) { - return r(p(a.map(function (a) { - return c.map(function (b) { - var c = J(a.target, b.name);if (c) { - var d = da(b, a);b = { type: c, property: b.name, animatable: a, tweens: d, duration: d[d.length - 1].end, delay: d[0].delay }; - } else b = void 0;return b; - }); - })), function (a) { - return !h.und(a); - }); - }function R(a, c, d, b) { - var f = "delay" === a;return c.length ? (f ? Math.min : Math.max).apply(Math, c.map(function (b) { - return b[a]; - })) : f ? b.delay : d.offset + b.delay + b.duration; - }function fa(a) { - var c = D(ga, a), - d = D(S, a), - b = Z(a.targets), - f = [], - e = z(c, d), - k;for (k in a) { - e.hasOwnProperty(k) || "targets" === k || f.push({ name: k, offset: e.offset, tweens: aa(a[k], d) }); - }a = ea(b, f);return z(c, { children: [], animatables: b, animations: a, duration: R("duration", a, c, d), delay: R("delay", a, c, d) }); - }function q(a) { - function c() { - return window.Promise && new Promise(function (a) { - return p = a; - }); - }function d(a) { - return g.reversed ? g.duration - a : a; - }function b(a) { - for (var b = 0, c = {}, d = g.animations, f = d.length; b < f;) { - var e = d[b], - k = e.animatable, - h = e.tweens, - n = h.length - 1, - l = h[n];n && (l = r(h, function (b) { - return a < b.end; - })[0] || l);for (var h = Math.min(Math.max(a - l.start - l.delay, 0), l.duration) / l.duration, w = isNaN(h) ? 1 : l.easing(h, l.elasticity), h = l.to.strings, p = l.round, n = [], m = void 0, m = l.to.numbers.length, t = 0; t < m; t++) { - var x = void 0, - x = l.to.numbers[t], - q = l.from.numbers[t], - x = l.isPath ? Y(l.value, w * x) : q + w * (x - q);p && (l.isColor && 2 < t || (x = Math.round(x * p) / p));n.push(x); - }if (l = h.length) for (m = h[0], w = 0; w < l; w++) { - p = h[w + 1], t = n[w], isNaN(t) || (m = p ? m + (t + p) : m + (t + " ")); - } else m = n[0];ha[e.type](k.target, e.property, m, c, k.id);e.currentValue = m;b++; - }if (b = Object.keys(c).length) for (d = 0; d < b; d++) { - H || (H = E(document.body, "transform") ? "transform" : "-webkit-transform"), g.animatables[d].target.style[H] = c[d].join(" "); - }g.currentTime = a;g.progress = a / g.duration * 100; - }function f(a) { - if (g[a]) g[a](g); - }function e() { - g.remaining && !0 !== g.remaining && g.remaining--; - }function k(a) { - var k = g.duration, - n = g.offset, - w = n + g.delay, - r = g.currentTime, - x = g.reversed, - q = d(a);if (g.children.length) { - var u = g.children, - v = u.length; - if (q >= g.currentTime) for (var G = 0; G < v; G++) { - u[G].seek(q); - } else for (; v--;) { - u[v].seek(q); - } - }if (q >= w || !k) g.began || (g.began = !0, f("begin")), f("run");if (q > n && q < k) b(q);else if (q <= n && 0 !== r && (b(0), x && e()), q >= k && r !== k || !k) b(k), x || e();f("update");a >= k && (g.remaining ? (t = h, "alternate" === g.direction && (g.reversed = !g.reversed)) : (g.pause(), g.completed || (g.completed = !0, f("complete"), "Promise" in window && (p(), m = c()))), l = 0); - }a = void 0 === a ? {} : a;var h, - t, - l = 0, - p = null, - m = c(), - g = fa(a);g.reset = function () { - var a = g.direction, - c = g.loop;g.currentTime = 0;g.progress = 0;g.paused = !0;g.began = !1;g.completed = !1;g.reversed = "reverse" === a;g.remaining = "alternate" === a && 1 === c ? 2 : c;b(0);for (a = g.children.length; a--;) { - g.children[a].reset(); - } - };g.tick = function (a) { - h = a;t || (t = h);k((l + h - t) * q.speed); - };g.seek = function (a) { - k(d(a)); - };g.pause = function () { - var a = v.indexOf(g);-1 < a && v.splice(a, 1);g.paused = !0; - };g.play = function () { - g.paused && (g.paused = !1, t = 0, l = d(g.currentTime), v.push(g), B || ia()); - };g.reverse = function () { - g.reversed = !g.reversed;t = 0;l = d(g.currentTime); - };g.restart = function () { - g.pause(); - g.reset();g.play(); - };g.finished = m;g.reset();g.autoplay && g.play();return g; - }var ga = { update: void 0, begin: void 0, run: void 0, complete: void 0, loop: 1, direction: "normal", autoplay: !0, offset: 0 }, - S = { duration: 1E3, delay: 0, easing: "easeOutElastic", elasticity: 500, round: 0 }, - W = "translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "), - H, - h = { arr: function (a) { - return Array.isArray(a); - }, obj: function (a) { - return -1 < Object.prototype.toString.call(a).indexOf("Object"); +let _defaults = { + data: [], // Autocomplete data set + onAutocomplete: null, // Callback for when autocompleted + dropdownOptions: { + // Default dropdown options + autoFocus: false, + closeOnClick: false, + coverTrigger: false }, - pth: function (a) { - return h.obj(a) && a.hasOwnProperty("totalLength"); - }, svg: function (a) { - return a instanceof SVGElement; - }, dom: function (a) { - return a.nodeType || h.svg(a); - }, str: function (a) { - return "string" === typeof a; - }, fnc: function (a) { - return "function" === typeof a; - }, und: function (a) { - return "undefined" === typeof a; - }, hex: function (a) { - return (/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a) - ); - }, rgb: function (a) { - return (/^rgb/.test(a) - ); - }, hsl: function (a) { - return (/^hsl/.test(a) - ); - }, col: function (a) { - return h.hex(a) || h.rgb(a) || h.hsl(a); - } }, - A = function () { - function a(a, d, b) { - return (((1 - 3 * b + 3 * d) * a + (3 * b - 6 * d)) * a + 3 * d) * a; - }return function (c, d, b, f) { - if (0 <= c && 1 >= c && 0 <= b && 1 >= b) { - var e = new Float32Array(11);if (c !== d || b !== f) for (var k = 0; 11 > k; ++k) { - e[k] = a(.1 * k, c, b); - }return function (k) { - if (c === d && b === f) return k;if (0 === k) return 0;if (1 === k) return 1;for (var h = 0, l = 1; 10 !== l && e[l] <= k; ++l) { - h += .1; - }--l;var l = h + (k - e[l]) / (e[l + 1] - e[l]) * .1, - n = 3 * (1 - 3 * b + 3 * c) * l * l + 2 * (3 * b - 6 * c) * l + 3 * c;if (.001 <= n) { - for (h = 0; 4 > h; ++h) { - n = 3 * (1 - 3 * b + 3 * c) * l * l + 2 * (3 * b - 6 * c) * l + 3 * c;if (0 === n) break;var m = a(l, c, b) - k, - l = l - m / n; - }k = l; - } else if (0 === n) k = l;else { - var l = h, - h = h + .1, - g = 0;do { - m = l + (h - l) / 2, n = a(m, c, b) - k, 0 < n ? h = m : l = m; - } while (1e-7 < Math.abs(n) && 10 > ++g);k = m; - }return a(k, d, f); + minLength: 1, // Min characters before autocomplete starts + isMultiSelect: false, + onSearch: (text, autocomplete) => { + const normSearch = text.toLocaleLowerCase(); + autocomplete.setMenuItems(autocomplete.options.data.filter((option) => { + var _a; + return option.id.toString().toLocaleLowerCase().includes(normSearch) + || ((_a = option.text) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase().includes(normSearch)); + })); + }, + maxDropDownHeight: '300px', + allowUnsafeHTML: false +}; +class Autocomplete extends component_1.Component { + constructor(el, options) { + super(el, options, Autocomplete); + this._handleInputBlur = () => { + if (!this._mousedown) { + this.close(); + this._resetAutocomplete(); + } }; - } - }; - }(), - Q = function () { - function a(a, b) { - return 0 === a || 1 === a ? a : -Math.pow(2, 10 * (a - 1)) * Math.sin(2 * (a - 1 - b / (2 * Math.PI) * Math.asin(1)) * Math.PI / b); - }var c = "Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "), - d = { In: [[.55, .085, .68, .53], [.55, .055, .675, .19], [.895, .03, .685, .22], [.755, .05, .855, .06], [.47, 0, .745, .715], [.95, .05, .795, .035], [.6, .04, .98, .335], [.6, -.28, .735, .045], a], Out: [[.25, .46, .45, .94], [.215, .61, .355, 1], [.165, .84, .44, 1], [.23, 1, .32, 1], [.39, .575, .565, 1], [.19, 1, .22, 1], [.075, .82, .165, 1], [.175, .885, .32, 1.275], function (b, c) { - return 1 - a(1 - b, c); - }], InOut: [[.455, .03, .515, .955], [.645, .045, .355, 1], [.77, 0, .175, 1], [.86, 0, .07, 1], [.445, .05, .55, .95], [1, 0, 0, 1], [.785, .135, .15, .86], [.68, -.55, .265, 1.55], function (b, c) { - return .5 > b ? a(2 * b, c) / 2 : 1 - a(-2 * b + 2, c) / 2; - }] }, - b = { linear: A(.25, .25, .75, .75) }, - f = {}, - e;for (e in d) { - f.type = e, d[f.type].forEach(function (a) { - return function (d, f) { - b["ease" + a.type + c[f]] = h.fnc(d) ? d : A.apply($jscomp$this, d); + this._handleInputKeyupAndFocus = (e) => { + if (e.type === 'keyup') + Autocomplete._keydown = false; + this.count = 0; + const actualValue = this.el.value.toLocaleLowerCase(); + // Don't capture enter or arrow key usage. + if (utils_1.Utils.keys.ENTER.includes(e.key) || utils_1.Utils.keys.ARROW_UP.includes(e.key) || utils_1.Utils.keys.ARROW_DOWN.includes(e.key)) + return; + // Check if the input isn't empty + // Check if focus triggered by tab + if (this.oldVal !== actualValue && (utils_1.Utils.tabPressed || e.type !== 'focus')) { + this.open(); + } + // Value has changed! + if (this.oldVal !== actualValue) { + this._setStatusLoading(); + this.options.onSearch(this.el.value, this); + } + // Reset Single-Select when Input cleared + if (!this.options.isMultiSelect && this.el.value.length === 0) { + this.selectedValues = []; + this._triggerChanged(); + } + this.oldVal = actualValue; }; - }(f)), f = { type: f.type }; - }return b; - }(), - ha = { css: function (a, c, d) { - return a.style[c] = d; - }, attribute: function (a, c, d) { - return a.setAttribute(c, d); - }, object: function (a, c, d) { - return a[c] = d; - }, transform: function (a, c, d, b, f) { - b[f] || (b[f] = []);b[f].push(c + "(" + d + ")"); - } }, - v = [], - B = 0, - ia = function () { - function a() { - B = requestAnimationFrame(c); - }function c(c) { - var b = v.length;if (b) { - for (var d = 0; d < b;) { - v[d] && v[d].tick(c), d++; - }a(); - } else cancelAnimationFrame(B), B = 0; - }return a; - }();q.version = "2.2.0";q.speed = 1;q.running = v;q.remove = function (a) { - a = P(a);for (var c = v.length; c--;) { - for (var d = v[c], b = d.animations, f = b.length; f--;) { - u(a, b[f].animatable.target) && (b.splice(f, 1), b.length || d.pause()); - } + this._handleInputKeydown = (e) => { + var _a, _b; + Autocomplete._keydown = true; + // Arrow keys and enter key usage + const numItems = this.container.querySelectorAll('li').length; + // select element on Enter + if (utils_1.Utils.keys.ENTER.includes(e.key) && this.activeIndex >= 0) { + const liElement = this.container.querySelectorAll('li')[this.activeIndex]; + if (liElement) { + this.selectOption(liElement.getAttribute('data-id')); + e.preventDefault(); + } + return; + } + // Capture up and down key + if (utils_1.Utils.keys.ARROW_UP.includes(e.key) || utils_1.Utils.keys.ARROW_DOWN.includes(e.key)) { + e.preventDefault(); + if (utils_1.Utils.keys.ARROW_UP.includes(e.key) && this.activeIndex > 0) + this.activeIndex--; + if (utils_1.Utils.keys.ARROW_DOWN.includes(e.key) && this.activeIndex < numItems - 1) + this.activeIndex++; + (_a = this.$active) === null || _a === void 0 ? void 0 : _a.classList.remove('active'); + if (this.activeIndex >= 0) { + this.$active = this.container.querySelectorAll('li')[this.activeIndex]; + (_b = this.$active) === null || _b === void 0 ? void 0 : _b.classList.add('active'); + // Focus selected + this.container.children[this.activeIndex].scrollIntoView({ + behavior: 'smooth', + block: 'nearest', + inline: 'nearest' + }); + } + } + }; + this._handleInputClick = () => { + this.open(); + }; + this._handleContainerMousedownAndTouchstart = () => { + this._mousedown = true; + }; + this._handleContainerMouseupAndTouchend = () => { + this._mousedown = false; + }; + /** + * Show autocomplete. + */ + this.open = () => { + const inputText = this.el.value.toLocaleLowerCase(); + this._resetAutocomplete(); + if (inputText.length >= this.options.minLength) { + this.isOpen = true; + this._renderDropdown(); + } + // Open dropdown + if (!this.dropdown.isOpen) { + setTimeout(() => { + this.dropdown.open(); + }, 100); + } + else + this.dropdown.recalculateDimensions(); // Recalculate dropdown when its already open + }; + /** + * Hide autocomplete. + */ + this.close = () => { + this.dropdown.close(); + }; + this.el.M_Autocomplete = this; + this.options = Object.assign(Object.assign({}, Autocomplete.defaults), options); + this.isOpen = false; + this.count = 0; + this.activeIndex = -1; + this.oldVal = ""; + this.selectedValues = []; + this.menuItems = []; + this.$active = null; + this._mousedown = false; + this._setupDropdown(); + this._setupEventHandlers(); } - };q.getValue = K;q.path = function (a, c) { - var d = h.str(a) ? e(a)[0] : a, - b = c || 100;return function (a) { - return { el: d, property: a, totalLength: N(d) * (b / 100) }; - }; - };q.setDashoffset = function (a) { - var c = N(a);a.setAttribute("stroke-dasharray", c);return c; - };q.bezier = A;q.easings = Q;q.timeline = function (a) { - var c = q(a);c.pause();c.duration = 0;c.add = function (d) { - c.children.forEach(function (a) { - a.began = !0;a.completed = !0; - });m(d).forEach(function (b) { - var d = z(b, D(S, a || {}));d.targets = d.targets || a.targets;b = c.duration;var e = d.offset;d.autoplay = !1;d.direction = c.direction;d.offset = h.und(e) ? b : L(e, b);c.began = !0;c.completed = !0;c.seek(d.offset);d = q(d);d.began = !0;d.completed = !0;d.duration > b && (c.duration = d.duration);c.children.push(d); - });c.seek(0);c.reset();c.autoplay && c.restart();return c; - };return c; - };q.random = function (a, c) { - return Math.floor(Math.random() * (c - a + 1)) + a; - };return q; -}); -;(function ($, anim) { - 'use strict'; + static get defaults() { + return _defaults; + } + /** + * Initializes instances of Autocomplete. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, Autocomplete); + } + static getInstance(el) { + return el.M_Autocomplete; + } + destroy() { + this._removeEventHandlers(); + this._removeDropdown(); + this.el.M_Autocomplete = undefined; + } + _setupEventHandlers() { + this.el.addEventListener('blur', this._handleInputBlur); + this.el.addEventListener('keyup', this._handleInputKeyupAndFocus); + this.el.addEventListener('focus', this._handleInputKeyupAndFocus); + this.el.addEventListener('keydown', this._handleInputKeydown); + this.el.addEventListener('click', this._handleInputClick); + this.container.addEventListener('mousedown', this._handleContainerMousedownAndTouchstart); + this.container.addEventListener('mouseup', this._handleContainerMouseupAndTouchend); + if (typeof window.ontouchstart !== 'undefined') { + this.container.addEventListener('touchstart', this._handleContainerMousedownAndTouchstart); + this.container.addEventListener('touchend', this._handleContainerMouseupAndTouchend); + } + } + _removeEventHandlers() { + this.el.removeEventListener('blur', this._handleInputBlur); + this.el.removeEventListener('keyup', this._handleInputKeyupAndFocus); + this.el.removeEventListener('focus', this._handleInputKeyupAndFocus); + this.el.removeEventListener('keydown', this._handleInputKeydown); + this.el.removeEventListener('click', this._handleInputClick); + this.container.removeEventListener('mousedown', this._handleContainerMousedownAndTouchstart); + this.container.removeEventListener('mouseup', this._handleContainerMouseupAndTouchend); + if (typeof window.ontouchstart !== 'undefined') { + this.container.removeEventListener('touchstart', this._handleContainerMousedownAndTouchstart); + this.container.removeEventListener('touchend', this._handleContainerMouseupAndTouchend); + } + } + _setupDropdown() { + this.container = document.createElement('ul'); + this.container.style.maxHeight = this.options.maxDropDownHeight; + this.container.id = `autocomplete-options-${utils_1.Utils.guid()}`; + this.container.classList.add('autocomplete-content', 'dropdown-content'); + this.el.setAttribute('data-target', this.container.id); + // ! Issue in Component Dropdown: _placeDropdown moves dom-position + this.el.parentElement.appendChild(this.container); + // Initialize dropdown + let dropdownOptions = Object.assign(Object.assign({}, Autocomplete.defaults.dropdownOptions), this.options.dropdownOptions); + let userOnItemClick = dropdownOptions.onItemClick; + // Ensuring the select Option call when user passes custom onItemClick function to dropdown + dropdownOptions.onItemClick = (li) => { + if (!li) + return; + const entryID = li.getAttribute('data-id'); + this.selectOption(entryID); + // Handle user declared onItemClick if needed + if (userOnItemClick && typeof userOnItemClick === 'function') + userOnItemClick.call(this.dropdown, this.el); + }; + this.dropdown = dropdown_1.Dropdown.init(this.el, dropdownOptions); + // ! Workaround for Label: move label up again + // TODO: Just use PopperJS in future! + const label = this.el.parentElement.querySelector('label'); + if (label) + this.el.after(label); + // Sketchy removal of dropdown click handler + this.el.removeEventListener('click', this.dropdown._handleClick); + // Set Value if already set in HTML + if (this.el.value) + this.selectOption(this.el.value); + // Add StatusInfo + const div = document.createElement('div'); + div.classList.add('status-info'); + div.setAttribute('style', 'position: absolute;right:0;top:0;'); + this.el.parentElement.appendChild(div); + this._updateSelectedInfo(); + } + _removeDropdown() { + this.container.parentNode.removeChild(this.container); + } + _resetCurrentElementPosition() { + var _a; + this.activeIndex = -1; + (_a = this.$active) === null || _a === void 0 ? void 0 : _a.classList.remove('active'); + } + _resetAutocomplete() { + this.container.replaceChildren(); + this._resetCurrentElementPosition(); + this.oldVal = null; + this.isOpen = false; + this._mousedown = false; + } + _highlightPartialText(input, label) { + const start = label.toLocaleLowerCase().indexOf('' + input.toLocaleLowerCase() + ''); + const end = start + input.length - 1; + //custom filters may return results where the string does not match any part + if (start == -1 || end == -1) { + return [label, '', '']; + } + return [label.slice(0, start), label.slice(start, end + 1), label.slice(end + 1)]; + } + _createDropdownItem(entry) { + const item = document.createElement('li'); + item.setAttribute('data-id', entry.id); + item.setAttribute('style', 'display:grid; grid-auto-flow: column; user-select: none; align-items: center;'); + // Checkbox + if (this.options.isMultiSelect) { + item.innerHTML = ` +
    + sel.id === entry.id) ? ' checked="checked"' : ''}> +
    `; + } + // Image + if (entry.image) { + const img = document.createElement('img'); + img.classList.add('circle'); + img.src = entry.image; + item.appendChild(img); + } + // Text + const inputText = this.el.value.toLocaleLowerCase(); + const parts = this._highlightPartialText(inputText, (entry.text || entry.id).toString()); + const div = document.createElement('div'); + div.setAttribute('style', 'line-height:1.2;font-weight:500;'); + if (this.options.allowUnsafeHTML) { + div.innerHTML = parts[0] + '' + parts[1] + '' + parts[2]; + } + else { + div.appendChild(document.createTextNode(parts[0])); + if (parts[1]) { + const highlight = document.createElement('span'); + highlight.textContent = parts[1]; + highlight.classList.add('highlight'); + div.appendChild(highlight); + div.appendChild(document.createTextNode(parts[2])); + } + } + const itemText = document.createElement('div'); + itemText.classList.add('item-text'); + itemText.setAttribute('style', 'padding:5px;overflow:hidden;'); + item.appendChild(itemText); + item.querySelector('.item-text').appendChild(div); + // Description + if (typeof entry.description === 'string' || (typeof entry.description === 'number' && !isNaN(entry.description))) { + const description = document.createElement('small'); + description.setAttribute('style', 'line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;'); + description.innerText = entry.description; + item.querySelector('.item-text').appendChild(description); + } + // Set Grid + const getGridConfig = () => { + if (this.options.isMultiSelect) { + if (entry.image) + return '40px min-content auto'; // cb-img-txt + return '40px auto'; // cb-txt + } + if (entry.image) + return 'min-content auto'; // img-txt + return 'auto'; // txt + }; + item.style.gridTemplateColumns = getGridConfig(); + return item; + } + _renderDropdown() { + this._resetAutocomplete(); + // Check if Data is empty + if (this.menuItems.length === 0) { + this.menuItems = this.selectedValues; // Show selected Items + } + for (let i = 0; i < this.menuItems.length; i++) { + const item = this._createDropdownItem(this.menuItems[i]); + this.container.append(item); + } + } + _setStatusLoading() { + this.el.parentElement.querySelector('.status-info').innerHTML = `
    + + + +
    `; + } + _updateSelectedInfo() { + const statusElement = this.el.parentElement.querySelector('.status-info'); + if (statusElement) { + if (this.options.isMultiSelect) + statusElement.innerHTML = this.selectedValues.length.toString(); + else + statusElement.innerHTML = ''; + } + } + _refreshInputText() { + if (this.selectedValues.length === 1) { + const entry = this.selectedValues[0]; + this.el.value = entry.text || entry.id; // Write Text to Input + } + } + _triggerChanged() { + this.el.dispatchEvent(new Event('change')); + // Trigger Autocomplete Event + if (typeof this.options.onAutocomplete === 'function') + this.options.onAutocomplete.call(this, this.selectedValues); + } + /** + * Updates the visible or selectable items shown in the menu. + * @param menuItems Items to be available. + */ + setMenuItems(menuItems) { + this.menuItems = menuItems; + this.open(); + this._updateSelectedInfo(); + } + /** + * Sets selected values. + * @param entries + */ + setValues(entries) { + this.selectedValues = entries; + this._updateSelectedInfo(); + if (!this.options.isMultiSelect) { + this._refreshInputText(); + } + this._triggerChanged(); + } + /** + * Select a specific autocomplete option via id-property. + * @param id The id of a data-entry. + */ + selectOption(id) { + const entry = this.menuItems.find((item) => item.id == id); + if (!entry) + return; + // Toggle Checkbox + const li = this.container.querySelector('li[data-id="' + id + '"]'); + if (!li) + return; + if (this.options.isMultiSelect) { + const checkbox = li.querySelector('input[type="checkbox"]'); + checkbox.checked = !checkbox.checked; + if (checkbox.checked) + this.selectedValues.push(entry); + else + this.selectedValues = this.selectedValues.filter((selectedEntry) => selectedEntry.id !== entry.id); + this.el.focus(); + } + else { + // Single-Select + this.selectedValues = [entry]; + this._refreshInputText(); + this._resetAutocomplete(); + this.close(); + } + this._updateSelectedInfo(); + this._triggerChanged(); + } +} +exports.Autocomplete = Autocomplete; - var _defaults = { + +/***/ }), + +/***/ "./src/buttons.ts": +/*!************************!*\ + !*** ./src/buttons.ts ***! + \************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FloatingActionButton = void 0; +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +; +let _defaults = { + direction: 'top', + hoverEnabled: true, + toolbarEnabled: false +}; +class FloatingActionButton extends component_1.Component { + constructor(el, options) { + super(el, options, FloatingActionButton); + this._handleFABClick = () => { + if (this.isOpen) { + this.close(); + } + else { + this.open(); + } + }; + this._handleDocumentClick = (e) => { + const elem = e.target; + if (elem !== this._menu) + this.close; + }; + /** + * Open FAB. + */ + this.open = () => { + if (this.isOpen) + return; + if (this.options.toolbarEnabled) + this._animateInToolbar(); + else + this._animateInFAB(); + this.isOpen = true; + }; + /** + * Close FAB. + */ + this.close = () => { + if (!this.isOpen) + return; + if (this.options.toolbarEnabled) { + window.removeEventListener('scroll', this.close, true); + document.body.removeEventListener('click', this._handleDocumentClick, true); + } + else { + this._animateOutFAB(); + } + this.isOpen = false; + }; + this.el.M_FloatingActionButton = this; + this.options = Object.assign(Object.assign({}, FloatingActionButton.defaults), options); + this.isOpen = false; + this._anchor = this.el.querySelector('a'); + this._menu = this.el.querySelector('ul'); + this._floatingBtns = Array.from(this.el.querySelectorAll('ul .btn-floating')); + this._floatingBtnsReverse = this._floatingBtns.reverse(); + this.offsetY = 0; + this.offsetX = 0; + this.el.classList.add(`direction-${this.options.direction}`); + if (this.options.direction === 'top') + this.offsetY = 40; + else if (this.options.direction === 'right') + this.offsetX = -40; + else if (this.options.direction === 'bottom') + this.offsetY = -40; + else + this.offsetX = 40; + this._setupEventHandlers(); + } + static get defaults() { + return _defaults; + } + /** + * Initializes instances of FloatingActionButton. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, FloatingActionButton); + } + static getInstance(el) { + return el.M_FloatingActionButton; + } + destroy() { + this._removeEventHandlers(); + this.el.M_FloatingActionButton = undefined; + } + _setupEventHandlers() { + if (this.options.hoverEnabled && !this.options.toolbarEnabled) { + this.el.addEventListener('mouseenter', this.open); + this.el.addEventListener('mouseleave', this.close); + } + else { + this.el.addEventListener('click', this._handleFABClick); + } + } + _removeEventHandlers() { + if (this.options.hoverEnabled && !this.options.toolbarEnabled) { + this.el.removeEventListener('mouseenter', this.open); + this.el.removeEventListener('mouseleave', this.close); + } + else { + this.el.removeEventListener('click', this._handleFABClick); + } + } + _animateInFAB() { + this.el.classList.add('active'); + const delayIncrement = 40; + const duration = 275; + this._floatingBtnsReverse.forEach((el, index) => { + const delay = delayIncrement * index; + el.style.transition = 'none'; + el.style.opacity = '0'; + el.style.transform = `translate(${this.offsetX}px, ${this.offsetY}px) scale(0.4)`; + setTimeout(() => { + // from: + el.style.opacity = '0.4'; + // easeInOutQuad + setTimeout(() => { + // to: + el.style.transition = `opacity ${duration}ms ease, transform ${duration}ms ease`; + el.style.opacity = '1'; + el.style.transform = 'translate(0, 0) scale(1)'; + }, 1); + }, delay); + }); + } + _animateOutFAB() { + const duration = 175; + setTimeout(() => this.el.classList.remove('active'), duration); + this._floatingBtnsReverse.forEach((el) => { + el.style.transition = `opacity ${duration}ms ease, transform ${duration}ms ease`; + // to + el.style.opacity = '0'; + el.style.transform = `translate(${this.offsetX}px, ${this.offsetY}px) scale(0.4)`; + }); + } + _animateInToolbar() { + let scaleFactor; + let windowWidth = window.innerWidth; + let windowHeight = window.innerHeight; + let btnRect = this.el.getBoundingClientRect(); + const backdrop = document.createElement('div'); + backdrop.classList.add('fab-backdrop'); // $('
    '); + const fabColor = getComputedStyle(this._anchor).backgroundColor; // css('background-color'); + this._anchor.append(backdrop); + this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2; + this.offsetY = windowHeight - btnRect.bottom; + scaleFactor = windowWidth / backdrop[0].clientWidth; + this.btnBottom = btnRect.bottom; + this.btnLeft = btnRect.left; + this.btnWidth = btnRect.width; + // Set initial state + this.el.classList.add('active'); + this.el.style.textAlign = 'center'; + this.el.style.width = '100%'; + this.el.style.bottom = '0'; + this.el.style.left = '0'; + this.el.style.transform = 'translateX(' + this.offsetX + 'px)'; + this.el.style.transition = 'none'; + this._anchor.style.transform = `translateY(${this.offsetY}px`; + this._anchor.style.transition = 'none'; + backdrop.style.backgroundColor = fabColor; + setTimeout(() => { + this.el.style.transform = ''; + this.el.style.transition = 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'; + this._anchor.style.overflow = 'visible'; + this._anchor.style.transform = ''; + this._anchor.style.transition = 'transform .2s'; + setTimeout(() => { + this.el.style.overflow = 'hidden'; + this.el.style.backgroundColor = fabColor; + backdrop.style.transform = 'scale(' + scaleFactor + ')'; + backdrop.style.transition = 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'; + this._menu.querySelectorAll('li > a').forEach((a) => a.style.opacity = '1'); + // Scroll to close. + window.addEventListener('scroll', this.close, true); + document.body.addEventListener('click', this._handleDocumentClick, true); + }, 100); + }, 0); + } +} +exports.FloatingActionButton = FloatingActionButton; + + +/***/ }), + +/***/ "./src/cards.ts": +/*!**********************!*\ + !*** ./src/cards.ts ***! + \**********************/ +/***/ (function(__unused_webpack_module, exports) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Cards = void 0; +class Cards { + static Init() { + document.addEventListener("DOMContentLoaded", () => { + document.body.addEventListener('click', e => { + const trigger = e.target; + const card = trigger.closest('.card'); + if (!card) + return; + const cardReveal = Array.from(card.children).find(elem => elem.classList.contains('card-reveal')); + if (!cardReveal) + return; + const initialOverflow = getComputedStyle(card).overflow; + // Close Card + const closeArea = cardReveal.querySelector('.card-reveal .card-title'); + if (trigger === closeArea || closeArea.contains(trigger)) { + const duration = 225; + cardReveal.style.transition = `transform ${duration}ms ease`; //easeInOutQuad + cardReveal.style.transform = 'translateY(0)'; + setTimeout(() => { + cardReveal.style.display = 'none'; + card.style.overflow = initialOverflow; + }, duration); + } + ; + // Reveal Card + const activators = card.querySelectorAll('.activator'); + activators.forEach(activator => { + if (trigger === activator || activator.contains(trigger)) { + card.style.overflow = 'hidden'; + cardReveal.style.display = 'block'; + setTimeout(() => { + const duration = 300; + cardReveal.style.transition = `transform ${duration}ms ease`; //easeInOutQuad + cardReveal.style.transform = 'translateY(-100%)'; + }, 1); + } + }); + }); + }); + } +} +exports.Cards = Cards; + + +/***/ }), + +/***/ "./src/carousel.ts": +/*!*************************!*\ + !*** ./src/carousel.ts ***! + \*************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Carousel = void 0; +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +let _defaults = { + duration: 200, // ms + dist: -100, // zoom scale TODO: make this more intuitive as an option + shift: 0, // spacing for center image + padding: 0, // Padding between non center items + numVisible: 5, // Number of visible items in carousel + fullWidth: false, // Change to full width styles + indicators: false, // Toggle indicators + noWrap: false, // Don't wrap around and cycle through items. + onCycleTo: null // Callback for when a new slide is cycled to. +}; +class Carousel extends component_1.Component { + constructor(el, options) { + var _a; + super(el, options, Carousel); + /** The index of the center carousel item. */ + this.center = 0; + this._handleThrottledResize = utils_1.Utils.throttle(function () { this._handleResize(); }, 200, null).bind(this); + this._handleCarouselTap = (e) => { + // Fixes firefox draggable image bug + if (e.type === 'mousedown' && e.target.tagName === 'IMG') { + e.preventDefault(); + } + this.pressed = true; + this.dragged = false; + this.verticalDragged = false; + this.reference = this._xpos(e); + this.referenceY = this._ypos(e); + this.velocity = this.amplitude = 0; + this.frame = this.offset; + this.timestamp = Date.now(); + clearInterval(this.ticker); + this.ticker = setInterval(this._track, 100); + }; + this._handleCarouselDrag = (e) => { + let x, y, delta, deltaY; + if (this.pressed) { + x = this._xpos(e); + y = this._ypos(e); + delta = this.reference - x; + deltaY = Math.abs(this.referenceY - y); + if (deltaY < 30 && !this.verticalDragged) { + // If vertical scrolling don't allow dragging. + if (delta > 2 || delta < -2) { + this.dragged = true; + this.reference = x; + this._scroll(this.offset + delta); + } + } + else if (this.dragged) { + // If dragging don't allow vertical scroll. + e.preventDefault(); + e.stopPropagation(); + return false; + } + else { + // Vertical scrolling. + this.verticalDragged = true; + } + } + if (this.dragged) { + // If dragging don't allow vertical scroll. + e.preventDefault(); + e.stopPropagation(); + return false; + } + }; + this._handleCarouselRelease = (e) => { + if (this.pressed) { + this.pressed = false; + } + else { + return; + } + clearInterval(this.ticker); + this.target = this.offset; + if (this.velocity > 10 || this.velocity < -10) { + this.amplitude = 0.9 * this.velocity; + this.target = this.offset + this.amplitude; + } + this.target = Math.round(this.target / this.dim) * this.dim; + // No wrap of items. + if (this.noWrap) { + if (this.target >= this.dim * (this.count - 1)) { + this.target = this.dim * (this.count - 1); + } + else if (this.target < 0) { + this.target = 0; + } + } + this.amplitude = this.target - this.offset; + this.timestamp = Date.now(); + requestAnimationFrame(this._autoScroll); + if (this.dragged) { + e.preventDefault(); + e.stopPropagation(); + } + return false; + }; + this._handleCarouselClick = (e) => { + // Disable clicks if carousel was dragged. + if (this.dragged) { + e.preventDefault(); + e.stopPropagation(); + return false; + } + else if (!this.options.fullWidth) { + const clickedElem = e.target.closest('.carousel-item'); + if (!clickedElem) + return; + const clickedIndex = [...clickedElem.parentNode.children].indexOf(clickedElem); + const diff = this._wrap(this.center) - clickedIndex; + // Disable clicks if carousel was shifted by click + if (diff !== 0) { + e.preventDefault(); + e.stopPropagation(); + } + // fixes https://github.com/materializecss/materialize/issues/180 + if (clickedIndex < 0) { + // relative X position > center of carousel = clicked at the right part of the carousel + if (e.clientX - e.target.getBoundingClientRect().left > this.el.clientWidth / 2) { + this.next(); + } + else { + this.prev(); + } + } + else { + this._cycleTo(clickedIndex); + } + } + }; + this._handleIndicatorClick = (e) => { + e.stopPropagation(); + const indicator = e.target.closest('.indicator-item'); + if (indicator) { + const index = [...indicator.parentNode.children].indexOf(indicator); + this._cycleTo(index); + } + }; + this._handleResize = () => { + if (this.options.fullWidth) { + this.itemWidth = this.el.querySelector('.carousel-item').clientWidth; + this.imageHeight = this.el.querySelector('.carousel-item.active').clientHeight; + this.dim = this.itemWidth * 2 + this.options.padding; + this.offset = this.center * 2 * this.itemWidth; + this.target = this.offset; + this._setCarouselHeight(true); + } + else { + this._scroll(); + } + }; + this._track = () => { + let now, elapsed, delta, v; + now = Date.now(); + elapsed = now - this.timestamp; + this.timestamp = now; + delta = this.offset - this.frame; + this.frame = this.offset; + v = (1000 * delta) / (1 + elapsed); + this.velocity = 0.8 * v + 0.2 * this.velocity; + }; + this._autoScroll = () => { + let elapsed, delta; + if (this.amplitude) { + elapsed = Date.now() - this.timestamp; + delta = this.amplitude * Math.exp(-elapsed / this.options.duration); + if (delta > 2 || delta < -2) { + this._scroll(this.target - delta); + requestAnimationFrame(this._autoScroll); + } + else { + this._scroll(this.target); + } + } + }; + this.el.M_Carousel = this; + this.options = Object.assign(Object.assign({}, Carousel.defaults), options); + // Setup + this.hasMultipleSlides = this.el.querySelectorAll('.carousel-item').length > 1; + this.showIndicators = this.options.indicators && this.hasMultipleSlides; + this.noWrap = this.options.noWrap || !this.hasMultipleSlides; + this.pressed = false; + this.dragged = false; + this.offset = this.target = 0; + this.images = []; + this.itemWidth = this.el.querySelector('.carousel-item').clientWidth; + this.itemHeight = this.el.querySelector('.carousel-item').clientHeight; + this.dim = this.itemWidth * 2 + this.options.padding || 1; // Make sure dim is non zero for divisions. + // Full Width carousel setup + if (this.options.fullWidth) { + this.options.dist = 0; + this._setCarouselHeight(); + // Offset fixed items when indicators. + if (this.showIndicators) { + (_a = this.el.querySelector('.carousel-fixed-item')) === null || _a === void 0 ? void 0 : _a.classList.add('with-indicators'); + } + } + // Iterate through slides + this._indicators = document.createElement('ul'); + this._indicators.classList.add('indicators'); + this.el.querySelectorAll('.carousel-item').forEach((item, i) => { + this.images.push(item); + if (this.showIndicators) { + const indicator = document.createElement('li'); + indicator.classList.add('indicator-item'); + if (i === 0) { + indicator.classList.add('active'); + } + this._indicators.appendChild(indicator); + } + }); + if (this.showIndicators) + this.el.appendChild(this._indicators); + this.count = this.images.length; + // Cap numVisible at count + this.options.numVisible = Math.min(this.count, this.options.numVisible); + // Setup cross browser string + this.xform = 'transform'; + ['webkit', 'Moz', 'O', 'ms'].every((prefix) => { + var e = prefix + 'Transform'; + if (typeof document.body.style[e] !== 'undefined') { + this.xform = e; + return false; + } + return true; + }); + this._setupEventHandlers(); + this._scroll(this.offset); + } + static get defaults() { + return _defaults; + } + /** + * Initializes instances of Carousel. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, Carousel); + } + static getInstance(el) { + return el.M_Carousel; + } + destroy() { + this._removeEventHandlers(); + this.el.M_Carousel = undefined; + } + _setupEventHandlers() { + if (typeof window.ontouchstart !== 'undefined') { + this.el.addEventListener('touchstart', this._handleCarouselTap); + this.el.addEventListener('touchmove', this._handleCarouselDrag); + this.el.addEventListener('touchend', this._handleCarouselRelease); + } + this.el.addEventListener('mousedown', this._handleCarouselTap); + this.el.addEventListener('mousemove', this._handleCarouselDrag); + this.el.addEventListener('mouseup', this._handleCarouselRelease); + this.el.addEventListener('mouseleave', this._handleCarouselRelease); + this.el.addEventListener('click', this._handleCarouselClick); + if (this.showIndicators && this._indicators) { + this._indicators.querySelectorAll('.indicator-item').forEach((el) => { + el.addEventListener('click', this._handleIndicatorClick); + }); + } + // Resize + window.addEventListener('resize', this._handleThrottledResize); + } + _removeEventHandlers() { + if (typeof window.ontouchstart !== 'undefined') { + this.el.removeEventListener('touchstart', this._handleCarouselTap); + this.el.removeEventListener('touchmove', this._handleCarouselDrag); + this.el.removeEventListener('touchend', this._handleCarouselRelease); + } + this.el.removeEventListener('mousedown', this._handleCarouselTap); + this.el.removeEventListener('mousemove', this._handleCarouselDrag); + this.el.removeEventListener('mouseup', this._handleCarouselRelease); + this.el.removeEventListener('mouseleave', this._handleCarouselRelease); + this.el.removeEventListener('click', this._handleCarouselClick); + if (this.showIndicators && this._indicators) { + this._indicators.querySelectorAll('.indicator-item').forEach((el) => { + el.removeEventListener('click', this._handleIndicatorClick); + }); + } + window.removeEventListener('resize', this._handleThrottledResize); + } + _setCarouselHeight(imageOnly = false) { + const firstSlide = this.el.querySelector('.carousel-item.active') + ? this.el.querySelector('.carousel-item.active') + : this.el.querySelector('.carousel-item'); + const firstImage = firstSlide.querySelector('img'); + if (firstImage) { + if (firstImage.complete) { + // If image won't trigger the load event + const imageHeight = firstImage.clientHeight; + if (imageHeight > 0) { + this.el.style.height = imageHeight + 'px'; + } + else { + // If image still has no height, use the natural dimensions to calculate + const naturalWidth = firstImage.naturalWidth; + const naturalHeight = firstImage.naturalHeight; + const adjustedHeight = (this.el.clientWidth / naturalWidth) * naturalHeight; + this.el.style.height = adjustedHeight + 'px'; + } + } + else { + // Get height when image is loaded normally + firstImage.addEventListener('load', () => { + this.el.style.height = firstImage.offsetHeight + 'px'; + }); + } + } + else if (!imageOnly) { + const slideHeight = firstSlide.clientHeight; + this.el.style.height = slideHeight + 'px'; + } + } + _xpos(e) { + // touch event + if (e.type.startsWith("touch") && e.targetTouches.length >= 1) { + return e.targetTouches[0].clientX; + } + // mouse event + return e.clientX; + } + _ypos(e) { + // touch event + if (e.type.startsWith("touch") && e.targetTouches.length >= 1) { + return e.targetTouches[0].clientY; + } + // mouse event + return e.clientY; + } + _wrap(x) { + return x >= this.count + ? x % this.count + : x < 0 + ? this._wrap(this.count + (x % this.count)) + : x; + } + _scroll(x = 0) { + // Track scrolling state + if (!this.el.classList.contains('scrolling')) { + this.el.classList.add('scrolling'); + } + if (this.scrollingTimeout != null) { + window.clearTimeout(this.scrollingTimeout); + } + this.scrollingTimeout = window.setTimeout(() => { + this.el.classList.remove('scrolling'); + }, this.options.duration); + // Start actual scroll + let i, half, delta, dir, tween, el, alignment, zTranslation, tweenedOpacity, centerTweenedOpacity; + let lastCenter = this.center; + let numVisibleOffset = 1 / this.options.numVisible; + this.offset = typeof x === 'number' ? x : this.offset; + this.center = Math.floor((this.offset + this.dim / 2) / this.dim); + delta = this.offset - this.center * this.dim; + dir = delta < 0 ? 1 : -1; + tween = (-dir * delta * 2) / this.dim; + half = this.count >> 1; + if (this.options.fullWidth) { + alignment = 'translateX(0)'; + centerTweenedOpacity = 1; + } + else { + alignment = 'translateX(' + (this.el.clientWidth - this.itemWidth) / 2 + 'px) '; + alignment += 'translateY(' + (this.el.clientHeight - this.itemHeight) / 2 + 'px)'; + centerTweenedOpacity = 1 - numVisibleOffset * tween; + } + // Set indicator active + if (this.showIndicators) { + const diff = this.center % this.count; + const activeIndicator = this._indicators.querySelector('.indicator-item.active'); + const activeIndicatorIndex = [...activeIndicator.parentNode.children].indexOf(activeIndicator); + if (activeIndicatorIndex !== diff) { + activeIndicator.classList.remove('active'); + const pos = diff < 0 ? this.count + diff : diff; + this._indicators.querySelectorAll('.indicator-item')[pos].classList.add('active'); + } + } + // center + // Don't show wrapped items. + if (!this.noWrap || (this.center >= 0 && this.center < this.count)) { + el = this.images[this._wrap(this.center)]; + // Add active class to center item. + if (!el.classList.contains('active')) { + this.el.querySelector('.carousel-item').classList.remove('active'); + el.classList.add('active'); + } + let transformString = `${alignment} translateX(${-delta / 2}px) translateX(${dir * + this.options.shift * + tween * + i}px) translateZ(${this.options.dist * tween}px)`; + this._updateItemStyle(el, centerTweenedOpacity, 0, transformString); + } + for (i = 1; i <= half; ++i) { + // right side + if (this.options.fullWidth) { + zTranslation = this.options.dist; + tweenedOpacity = i === half && delta < 0 ? 1 - tween : 1; + } + else { + zTranslation = this.options.dist * (i * 2 + tween * dir); + tweenedOpacity = 1 - numVisibleOffset * (i * 2 + tween * dir); + } + // Don't show wrapped items. + if (!this.noWrap || this.center + i < this.count) { + el = this.images[this._wrap(this.center + i)]; + let transformString = `${alignment} translateX(${this.options.shift + + (this.dim * i - delta) / 2}px) translateZ(${zTranslation}px)`; + this._updateItemStyle(el, tweenedOpacity, -i, transformString); + } + // left side + if (this.options.fullWidth) { + zTranslation = this.options.dist; + tweenedOpacity = i === half && delta > 0 ? 1 - tween : 1; + } + else { + zTranslation = this.options.dist * (i * 2 - tween * dir); + tweenedOpacity = 1 - numVisibleOffset * (i * 2 - tween * dir); + } + // Don't show wrapped items. + if (!this.noWrap || this.center - i >= 0) { + el = this.images[this._wrap(this.center - i)]; + let transformString = `${alignment} translateX(${-this.options.shift + + (-this.dim * i - delta) / 2}px) translateZ(${zTranslation}px)`; + this._updateItemStyle(el, tweenedOpacity, -i, transformString); + } + } + // center + // Don't show wrapped items. + if (!this.noWrap || (this.center >= 0 && this.center < this.count)) { + el = this.images[this._wrap(this.center)]; + let transformString = `${alignment} translateX(${-delta / 2}px) translateX(${dir * + this.options.shift * + tween}px) translateZ(${this.options.dist * tween}px)`; + this._updateItemStyle(el, centerTweenedOpacity, 0, transformString); + } + // onCycleTo callback + const _currItem = this.el.querySelectorAll('.carousel-item')[this._wrap(this.center)]; + if (lastCenter !== this.center && typeof this.options.onCycleTo === 'function') { + this.options.onCycleTo.call(this, _currItem, this.dragged); + } + // One time callback + if (typeof this.oneTimeCallback === 'function') { + this.oneTimeCallback.call(this, _currItem, this.dragged); + this.oneTimeCallback = null; + } + } + _updateItemStyle(el, opacity, zIndex, transform) { + el.style[this.xform] = transform; + el.style.zIndex = zIndex.toString(); + el.style.opacity = opacity.toString(); + el.style.visibility = 'visible'; + } + _cycleTo(n, callback = null) { + let diff = (this.center % this.count) - n; + // Account for wraparound. + if (!this.noWrap) { + if (diff < 0) { + if (Math.abs(diff + this.count) < Math.abs(diff)) { + diff += this.count; + } + } + else if (diff > 0) { + if (Math.abs(diff - this.count) < diff) { + diff -= this.count; + } + } + } + this.target = this.dim * Math.round(this.offset / this.dim); + // Next + if (diff < 0) { + this.target += this.dim * Math.abs(diff); + } // Prev + else if (diff > 0) { + this.target -= this.dim * diff; + } + // Set one time callback + if (typeof callback === 'function') { + this.oneTimeCallback = callback; + } + // Scroll + if (this.offset !== this.target) { + this.amplitude = this.target - this.offset; + this.timestamp = Date.now(); + requestAnimationFrame(this._autoScroll); + } + } + /** + * Move carousel to next slide or go forward a given amount of slides. + * @param n How many times the carousel slides. + */ + next(n = 1) { + if (n === undefined || isNaN(n)) { + n = 1; + } + let index = this.center + n; + if (index >= this.count || index < 0) { + if (this.noWrap) + return; + index = this._wrap(index); + } + this._cycleTo(index); + } + /** + * Move carousel to previous slide or go back a given amount of slides. + * @param n How many times the carousel slides. + */ + prev(n = 1) { + if (n === undefined || isNaN(n)) { + n = 1; + } + let index = this.center - n; + if (index >= this.count || index < 0) { + if (this.noWrap) + return; + index = this._wrap(index); + } + this._cycleTo(index); + } + /** + * Move carousel to nth slide. + * @param n Index of slide. + * @param callback "onCycleTo" optional callback. + */ + set(n, callback) { + if (n === undefined || isNaN(n)) { + n = 0; + } + if (n > this.count || n < 0) { + if (this.noWrap) + return; + n = this._wrap(n); + } + this._cycleTo(n, callback); + } +} +exports.Carousel = Carousel; + + +/***/ }), + +/***/ "./src/characterCounter.ts": +/*!*********************************!*\ + !*** ./src/characterCounter.ts ***! + \*********************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CharacterCounter = void 0; +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +; +const _defaults = Object.freeze({}); +class CharacterCounter extends component_1.Component { + constructor(el, options) { + super(el, {}, CharacterCounter); + this.updateCounter = () => { + let maxLength = parseInt(this.el.getAttribute('maxlength')), actualLength = this.el.value.length; + this.isValidLength = actualLength <= maxLength; + let counterString = actualLength.toString(); + if (maxLength) { + counterString += '/' + maxLength; + this._validateInput(); + } + this.counterEl.innerHTML = counterString; + }; + this.el.M_CharacterCounter = this; + this.options = Object.assign(Object.assign({}, CharacterCounter.defaults), options); + this.isInvalid = false; + this.isValidLength = false; + this._setupCounter(); + this._setupEventHandlers(); + } + static get defaults() { + return _defaults; + } + /** + * Initializes instances of CharacterCounter. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, CharacterCounter); + } + static getInstance(el) { + return el.M_CharacterCounter; + } + destroy() { + this._removeEventHandlers(); + this.el.CharacterCounter = undefined; + this._removeCounter(); + } + _setupEventHandlers() { + this.el.addEventListener('focus', this.updateCounter, true); + this.el.addEventListener('input', this.updateCounter, true); + } + _removeEventHandlers() { + this.el.removeEventListener('focus', this.updateCounter, true); + this.el.removeEventListener('input', this.updateCounter, true); + } + _setupCounter() { + this.counterEl = document.createElement('span'); + this.counterEl.classList.add('character-counter'); + this.counterEl.style.float = 'right'; + this.counterEl.style.fontSize = '12px'; + this.counterEl.style.height = '1'; + this.el.parentElement.appendChild(this.counterEl); + } + _removeCounter() { + this.counterEl.remove(); + } + _validateInput() { + if (this.isValidLength && this.isInvalid) { + this.isInvalid = false; + this.el.classList.remove('invalid'); + } + else if (!this.isValidLength && !this.isInvalid) { + this.isInvalid = true; + this.el.classList.remove('valid'); + this.el.classList.add('invalid'); + } + } +} +exports.CharacterCounter = CharacterCounter; + + +/***/ }), + +/***/ "./src/chips.ts": +/*!**********************!*\ + !*** ./src/chips.ts ***! + \**********************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Chips = void 0; +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const autocomplete_1 = __webpack_require__(/*! ./autocomplete */ "./src/autocomplete.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +let _defaults = { + data: [], + placeholder: '', + secondaryPlaceholder: '', + closeIconClass: 'material-icons', + autocompleteOptions: {}, + autocompleteOnly: false, + limit: Infinity, + onChipAdd: null, + onChipSelect: null, + onChipDelete: null +}; +function gGetIndex(el) { + return [...el.parentNode.children].indexOf(el); +} +class Chips extends component_1.Component { + constructor(el, options) { + super(el, options, Chips); + this._handleChipClick = (e) => { + const _chip = e.target.closest('.chip'); + const clickedClose = e.target.classList.contains('close'); + if (_chip) { + const index = [..._chip.parentNode.children].indexOf(_chip); + if (clickedClose) { + this.deleteChip(index); + this._input.focus(); + } + else { + this.selectChip(index); + } + // Default handle click to focus on input + } + else { + this._input.focus(); + } + }; + this._handleInputFocus = () => { + this.el.classList.add('focus'); + }; + this._handleInputBlur = () => { + this.el.classList.remove('focus'); + }; + this._handleInputKeydown = (e) => { + Chips._keydown = true; + if (utils_1.Utils.keys.ENTER.includes(e.key)) { + // Override enter if autocompleting. + if (this.hasAutocomplete && this.autocomplete && this.autocomplete.isOpen) { + return; + } + e.preventDefault(); + if (!this.hasAutocomplete || (this.hasAutocomplete && !this.options.autocompleteOnly)) { + this.addChip({ id: this._input.value }); + } + this._input.value = ''; + } + else if ((utils_1.Utils.keys.BACKSPACE.includes(e.key) || utils_1.Utils.keys.ARROW_LEFT.includes(e.key)) && + this._input.value === '' && + this.chipsData.length) { + e.preventDefault(); + this.selectChip(this.chipsData.length - 1); + } + }; + this.el.M_Chips = this; + this.options = Object.assign(Object.assign({}, Chips.defaults), options); + this.el.classList.add('chips', 'input-field'); + this.chipsData = []; + this._chips = []; + this._setupInput(); + this.hasAutocomplete = Object.keys(this.options.autocompleteOptions).length > 0; + // Set input id + if (!this._input.getAttribute('id')) + this._input.setAttribute('id', utils_1.Utils.guid()); + // Render initial chips + if (this.options.data.length) { + this.chipsData = this.options.data; + this._renderChips(); + } + // Setup autocomplete if needed + if (this.hasAutocomplete) + this._setupAutocomplete(); + this._setPlaceholder(); + this._setupLabel(); + this._setupEventHandlers(); + } + static get defaults() { + return _defaults; + } + /** + * Initializes instances of Chips. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, Chips); + } + static getInstance(el) { + return el.M_Chips; + } + getData() { + return this.chipsData; + } + destroy() { + this._removeEventHandlers(); + this._chips.forEach(c => c.remove()); + this._chips = []; + this.el.M_Chips = undefined; + } + _setupEventHandlers() { + this.el.addEventListener('click', this._handleChipClick); + document.addEventListener('keydown', Chips._handleChipsKeydown); + document.addEventListener('keyup', Chips._handleChipsKeyup); + this.el.addEventListener('blur', Chips._handleChipsBlur, true); + this._input.addEventListener('focus', this._handleInputFocus); + this._input.addEventListener('blur', this._handleInputBlur); + this._input.addEventListener('keydown', this._handleInputKeydown); + } + _removeEventHandlers() { + this.el.removeEventListener('click', this._handleChipClick); + document.removeEventListener('keydown', Chips._handleChipsKeydown); + document.removeEventListener('keyup', Chips._handleChipsKeyup); + this.el.removeEventListener('blur', Chips._handleChipsBlur, true); + this._input.removeEventListener('focus', this._handleInputFocus); + this._input.removeEventListener('blur', this._handleInputBlur); + this._input.removeEventListener('keydown', this._handleInputKeydown); + } + static _handleChipsKeydown(e) { + Chips._keydown = true; + const chips = e.target.closest('.chips'); + const chipsKeydown = e.target && chips; + // Don't handle keydown inputs on input and textarea + const tag = e.target.tagName; + if (tag === 'INPUT' || tag === 'TEXTAREA' || !chipsKeydown) + return; + const currChips = chips.M_Chips; + if (utils_1.Utils.keys.BACKSPACE.includes(e.key) || utils_1.Utils.keys.DELETE.includes(e.key)) { + e.preventDefault(); + let selectIndex = currChips.chipsData.length; + if (currChips._selectedChip) { + const index = gGetIndex(currChips._selectedChip); + currChips.deleteChip(index); + currChips._selectedChip = null; + // Make sure selectIndex doesn't go negative + selectIndex = Math.max(index - 1, 0); + } + if (currChips.chipsData.length) + currChips.selectChip(selectIndex); + else + currChips._input.focus(); + } + else if (utils_1.Utils.keys.ARROW_LEFT.includes(e.key)) { + if (currChips._selectedChip) { + const selectIndex = gGetIndex(currChips._selectedChip) - 1; + if (selectIndex < 0) + return; + currChips.selectChip(selectIndex); + } + } + else if (utils_1.Utils.keys.ARROW_RIGHT.includes(e.key)) { + if (currChips._selectedChip) { + const selectIndex = gGetIndex(currChips._selectedChip) + 1; + if (selectIndex >= currChips.chipsData.length) + currChips._input.focus(); + else + currChips.selectChip(selectIndex); + } + } + } + static _handleChipsKeyup(e) { + Chips._keydown = false; + } + static _handleChipsBlur(e) { + if (!Chips._keydown && document.hidden) { + const chips = e.target.closest('.chips'); + const currChips = chips.M_Chips; + currChips._selectedChip = null; + } + } + _renderChip(chip) { + if (!chip.id) + return; + const renderedChip = document.createElement('div'); + renderedChip.classList.add('chip'); + renderedChip.innerText = chip.text || chip.id; + renderedChip.setAttribute('tabindex', "0"); + const closeIcon = document.createElement('i'); + closeIcon.classList.add(this.options.closeIconClass, 'close'); + closeIcon.innerText = 'close'; + // attach image if needed + if (chip.image) { + const img = document.createElement('img'); + img.setAttribute('src', chip.image); + renderedChip.insertBefore(img, renderedChip.firstChild); + } + renderedChip.appendChild(closeIcon); + return renderedChip; + } + _renderChips() { + this._chips = []; //.remove(); + for (let i = 0; i < this.chipsData.length; i++) { + const chipElem = this._renderChip(this.chipsData[i]); + this.el.appendChild(chipElem); + this._chips.push(chipElem); + } + // move input to end + this.el.append(this._input); + } + _setupAutocomplete() { + this.options.autocompleteOptions.onAutocomplete = (items) => { + if (items.length > 0) + this.addChip({ + id: items[0].id, + text: items[0].text, + image: items[0].image + }); + this._input.value = ''; + this._input.focus(); + }; + this.autocomplete = autocomplete_1.Autocomplete.init(this._input, this.options.autocompleteOptions); + } + _setupInput() { + this._input = this.el.querySelector('input'); + if (!this._input) { + this._input = document.createElement('input'); + this.el.append(this._input); + } + this._input.classList.add('input'); + } + _setupLabel() { + this._label = this.el.querySelector('label'); + if (this._label) + this._label.setAttribute('for', this._input.getAttribute('id')); + } + _setPlaceholder() { + if (this.chipsData !== undefined && !this.chipsData.length && this.options.placeholder) { + this._input.placeholder = this.options.placeholder; + } + else if ((this.chipsData === undefined || !!this.chipsData.length) && + this.options.secondaryPlaceholder) { + this._input.placeholder = this.options.secondaryPlaceholder; + } + } + _isValidAndNotExist(chip) { + const isValid = !!chip.id; + const doesNotExist = !this.chipsData.some(item => item.id == chip.id); + return isValid && doesNotExist; + } + /** + * Add chip to input. + * @param chip Chip data object + */ + addChip(chip) { + if (!this._isValidAndNotExist(chip) || this.chipsData.length >= this.options.limit) + return; + const renderedChip = this._renderChip(chip); + this._chips.push(renderedChip); + this.chipsData.push(chip); + //$(this._input).before(renderedChip); + this._input.before(renderedChip); + this._setPlaceholder(); + // fire chipAdd callback + if (typeof this.options.onChipAdd === 'function') { + this.options.onChipAdd(this.el, renderedChip); + } + } + /** + * Delete nth chip. + * @param chipIndex Index of chip + */ + deleteChip(chipIndex) { + const chip = this._chips[chipIndex]; + this._chips[chipIndex].remove(); + this._chips.splice(chipIndex, 1); + this.chipsData.splice(chipIndex, 1); + this._setPlaceholder(); + // fire chipDelete callback + if (typeof this.options.onChipDelete === 'function') { + this.options.onChipDelete(this.el, chip); + } + } + /** + * Select nth chip. + * @param chipIndex Index of chip + */ + selectChip(chipIndex) { + const chip = this._chips[chipIndex]; + this._selectedChip = chip; + chip.focus(); + // fire chipSelect callback + if (typeof this.options.onChipSelect === 'function') { + this.options.onChipSelect(this.el, chip); + } + } + static Init() { + document.addEventListener("DOMContentLoaded", () => { + // Handle removal of static chips. + document.body.addEventListener('click', e => { + if (e.target.closest('.chip .close')) { + const chips = e.target.closest('.chips'); + if (chips && chips.M_Chips == undefined) + return; + e.target.closest('.chip').remove(); + } + }); + }); + } +} +exports.Chips = Chips; +(() => { + Chips._keydown = false; +})(); + + +/***/ }), + +/***/ "./src/collapsible.ts": +/*!****************************!*\ + !*** ./src/collapsible.ts ***! + \****************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Collapsible = void 0; +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +const _defaults = { accordion: true, - onOpenStart: undefined, - onOpenEnd: undefined, - onCloseStart: undefined, - onCloseEnd: undefined, + onOpenStart: null, + onOpenEnd: null, + onCloseStart: null, + onCloseEnd: null, inDuration: 300, outDuration: 300 - }; - - /** - * @class - * - */ - - var Collapsible = function (_Component) { - _inherits(Collapsible, _Component); - - /** - * Construct Collapsible instance - * @constructor - * @param {Element} el - * @param {Object} options - */ - function Collapsible(el, options) { - _classCallCheck(this, Collapsible); - - var _this3 = _possibleConstructorReturn(this, (Collapsible.__proto__ || Object.getPrototypeOf(Collapsible)).call(this, Collapsible, el, options)); - - _this3.el.M_Collapsible = _this3; - - /** - * Options for the collapsible - * @member Collapsible#options - * @prop {Boolean} [accordion=false] - Type of the collapsible - * @prop {Function} onOpenStart - Callback function called before collapsible is opened - * @prop {Function} onOpenEnd - Callback function called after collapsible is opened - * @prop {Function} onCloseStart - Callback function called before collapsible is closed - * @prop {Function} onCloseEnd - Callback function called after collapsible is closed - * @prop {Number} inDuration - Transition in duration in milliseconds. - * @prop {Number} outDuration - Transition duration in milliseconds. - */ - _this3.options = $.extend({}, Collapsible.defaults, options); - - // Setup tab indices - _this3.$headers = _this3.$el.children('li').children('.collapsible-header'); - _this3.$headers.attr('tabindex', 0); - - _this3._setupEventHandlers(); - - // Open first active - var $activeBodies = _this3.$el.children('li.active').children('.collapsible-body'); - if (_this3.options.accordion) { - // Handle Accordion - $activeBodies.first().css('display', 'block'); - } else { - // Handle Expandables - $activeBodies.css('display', 'block'); - } - return _this3; +}; +class Collapsible extends component_1.Component { + constructor(el, options) { + super(el, options, Collapsible); + this._handleCollapsibleClick = (e) => { + const header = e.target.closest('.collapsible-header'); + if (e.target && header) { + const collapsible = header.closest('.collapsible'); + if (collapsible !== this.el) + return; + const li = header.closest('li'); + const isActive = li.classList.contains('active'); + const index = [...li.parentNode.children].indexOf(li); + if (isActive) + this.close(index); + else + this.open(index); + } + }; + this._handleCollapsibleKeydown = (e) => { + if (utils_1.Utils.keys.ENTER.includes(e.key)) { + this._handleCollapsibleClick(e); + } + }; + /** + * Open collapsible section. + * @param n Nth section to open. + */ + this.open = (index) => { + const listItems = Array.from(this.el.children).filter(c => c.tagName === 'LI'); + const li = listItems[index]; + if (li && !li.classList.contains('active')) { + // onOpenStart callback + if (typeof this.options.onOpenStart === 'function') { + this.options.onOpenStart.call(this, li); + } + // Handle accordion behavior + if (this.options.accordion) { + const activeLis = listItems.filter(li => li.classList.contains('active')); + activeLis.forEach(activeLi => { + const index = listItems.indexOf(activeLi); + this.close(index); + }); + } + // Animate in + li.classList.add('active'); + this._animateIn(index); + } + }; + /** + * Close collapsible section. + * @param n Nth section to close. + */ + this.close = (index) => { + const li = Array.from(this.el.children).filter(c => c.tagName === 'LI')[index]; + if (li && li.classList.contains('active')) { + // onCloseStart callback + if (typeof this.options.onCloseStart === 'function') { + this.options.onCloseStart.call(this, li); + } + // Animate out + li.classList.remove('active'); + this._animateOut(index); + } + }; + this.el.M_Collapsible = this; + this.options = Object.assign(Object.assign({}, Collapsible.defaults), options); + // Setup tab indices + this._headers = Array.from(this.el.querySelectorAll('li > .collapsible-header')); + this._headers.forEach(el => el.tabIndex = 0); + this._setupEventHandlers(); + // Open active + const activeBodies = Array.from(this.el.querySelectorAll('li.active > .collapsible-body')); + if (this.options.accordion) { + if (activeBodies.length > 0) { + // Accordion => open first active only + this._setExpanded(activeBodies[0]); + } + } + else { + // Expandables => all active + activeBodies.forEach(el => this._setExpanded(el)); + } } - - _createClass(Collapsible, [{ - key: "destroy", - - - /** - * Teardown component - */ - value: function destroy() { + static get defaults() { + return _defaults; + } + /** + * Initializes instances of Collapsible. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, Collapsible); + } + static getInstance(el) { + return el.M_Collapsible; + } + destroy() { this._removeEventHandlers(); this.el.M_Collapsible = undefined; - } - - /** - * Setup Event Handlers - */ - - }, { - key: "_setupEventHandlers", - value: function _setupEventHandlers() { - var _this4 = this; - - this._handleCollapsibleClickBound = this._handleCollapsibleClick.bind(this); - this._handleCollapsibleKeydownBound = this._handleCollapsibleKeydown.bind(this); - this.el.addEventListener('click', this._handleCollapsibleClickBound); - this.$headers.each(function (header) { - header.addEventListener('keydown', _this4._handleCollapsibleKeydownBound); - }); - } - - /** - * Remove Event Handlers - */ - - }, { - key: "_removeEventHandlers", - value: function _removeEventHandlers() { - var _this5 = this; - - this.el.removeEventListener('click', this._handleCollapsibleClickBound); - this.$headers.each(function (header) { - header.removeEventListener('keydown', _this5._handleCollapsibleKeydownBound); - }); - } - - /** - * Handle Collapsible Click - * @param {Event} e - */ - - }, { - key: "_handleCollapsibleClick", - value: function _handleCollapsibleClick(e) { - var $header = $(e.target).closest('.collapsible-header'); - if (e.target && $header.length) { - var $collapsible = $header.closest('.collapsible'); - if ($collapsible[0] === this.el) { - var $collapsibleLi = $header.closest('li'); - var $collapsibleLis = $collapsible.children('li'); - var isActive = $collapsibleLi[0].classList.contains('active'); - var index = $collapsibleLis.index($collapsibleLi); - - if (isActive) { - this.close(index); - } else { - this.open(index); + } + _setupEventHandlers() { + this.el.addEventListener('click', this._handleCollapsibleClick); + this._headers.forEach(header => header.addEventListener('keydown', this._handleCollapsibleKeydown)); + } + _removeEventHandlers() { + this.el.removeEventListener('click', this._handleCollapsibleClick); + this._headers.forEach(header => header.removeEventListener('keydown', this._handleCollapsibleKeydown)); + } + _setExpanded(li) { + li.style.maxHeight = li.scrollHeight + "px"; + } + _animateIn(index) { + const li = this.el.children[index]; + if (!li) + return; + const body = li.querySelector('.collapsible-body'); + const duration = this.options.inDuration; // easeInOutCubic + body.style.transition = `max-height ${duration}ms ease-out`; + this._setExpanded(body); + setTimeout(() => { + if (typeof this.options.onOpenEnd === 'function') { + this.options.onOpenEnd.call(this, li); } - } - } - } - - /** - * Handle Collapsible Keydown - * @param {Event} e - */ - - }, { - key: "_handleCollapsibleKeydown", - value: function _handleCollapsibleKeydown(e) { - if (e.keyCode === 13) { - this._handleCollapsibleClickBound(e); - } - } - - /** - * Animate in collapsible slide - * @param {Number} index - 0th index of slide - */ - - }, { - key: "_animateIn", - value: function _animateIn(index) { - var _this6 = this; - - var $collapsibleLi = this.$el.children('li').eq(index); - if ($collapsibleLi.length) { - var $body = $collapsibleLi.children('.collapsible-body'); - - anim.remove($body[0]); - $body.css({ - display: 'block', - overflow: 'hidden', - height: 0, - paddingTop: '', - paddingBottom: '' - }); - - var pTop = $body.css('padding-top'); - var pBottom = $body.css('padding-bottom'); - var finalHeight = $body[0].scrollHeight; - $body.css({ - paddingTop: 0, - paddingBottom: 0 - }); - - anim({ - targets: $body[0], - height: finalHeight, - paddingTop: pTop, - paddingBottom: pBottom, - duration: this.options.inDuration, - easing: 'easeInOutCubic', - complete: function (anim) { - $body.css({ - overflow: '', - paddingTop: '', - paddingBottom: '', - height: '' - }); - - // onOpenEnd callback - if (typeof _this6.options.onOpenEnd === 'function') { - _this6.options.onOpenEnd.call(_this6, $collapsibleLi[0]); - } + }, duration); + } + _animateOut(index) { + const li = this.el.children[index]; + if (!li) + return; + const body = li.querySelector('.collapsible-body'); + const duration = this.options.outDuration; // easeInOutCubic + body.style.transition = `max-height ${duration}ms ease-out`; + body.style.maxHeight = "0"; + setTimeout(() => { + if (typeof this.options.onCloseEnd === 'function') { + this.options.onCloseEnd.call(this, li); } - }); + }, duration); + } +} +exports.Collapsible = Collapsible; + + +/***/ }), + +/***/ "./src/component.ts": +/*!**************************!*\ + !*** ./src/component.ts ***! + \**************************/ +/***/ (function(__unused_webpack_module, exports) { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Component = void 0; +; +; +/** + * Base class implementation for Materialize components. + */ +class Component { + /** + * Constructs component instance and set everything up. + */ + constructor(el, options, classDef) { + // Display error if el is not a valid HTML Element + if (!(el instanceof HTMLElement)) { + console.error(Error(el + ' is not an HTML Element')); } - } - - /** - * Animate out collapsible slide - * @param {Number} index - 0th index of slide to open - */ - - }, { - key: "_animateOut", - value: function _animateOut(index) { - var _this7 = this; - - var $collapsibleLi = this.$el.children('li').eq(index); - if ($collapsibleLi.length) { - var $body = $collapsibleLi.children('.collapsible-body'); - anim.remove($body[0]); - $body.css('overflow', 'hidden'); - anim({ - targets: $body[0], - height: 0, - paddingTop: 0, - paddingBottom: 0, - duration: this.options.outDuration, - easing: 'easeInOutCubic', - complete: function () { - $body.css({ - height: '', - overflow: '', - padding: '', - display: '' - }); - - // onCloseEnd callback - if (typeof _this7.options.onCloseEnd === 'function') { - _this7.options.onCloseEnd.call(_this7, $collapsibleLi[0]); - } + // If exists, destroy and reinitialize in child + let ins = classDef.getInstance(el); + if (!!ins) { + ins.destroy(); + } + this.el = el; + } + /** + * Initializes component instances. + * @param els HTML elements. + * @param options Component options. + * @param classDef Class definition. + */ + static init(els, options, classDef) { + let instances = null; + if (els instanceof Element) { + instances = new classDef(els, options); + } + else if (!!els && els.length) { + instances = []; + for (let i = 0; i < els.length; i++) { + instances.push(new classDef(els[i], options)); } - }); } - } + return instances; + } + /** + * @returns default options for component instance. + */ + static get defaults() { return {}; } + /** + * Retrieves component instance for the given element. + * @param el Associated HTML Element. + */ + static getInstance(el) { + throw new Error("This method must be implemented."); + } + /** + * Destroy plugin instance and teardown. + */ + destroy() { throw new Error("This method must be implemented."); } +} +exports.Component = Component; - /** - * Open Collapsible - * @param {Number} index - 0th index of slide - */ - }, { - key: "open", - value: function open(index) { - var _this8 = this; +/***/ }), - var $collapsibleLi = this.$el.children('li').eq(index); - if ($collapsibleLi.length && !$collapsibleLi[0].classList.contains('active')) { - // onOpenStart callback - if (typeof this.options.onOpenStart === 'function') { - this.options.onOpenStart.call(this, $collapsibleLi[0]); - } +/***/ "./src/datepicker.ts": +/*!***************************!*\ + !*** ./src/datepicker.ts ***! + \***************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // Handle accordion behavior - if (this.options.accordion) { - var $collapsibleLis = this.$el.children('li'); - var $activeLis = this.$el.children('li.active'); - $activeLis.each(function (el) { - var index = $collapsibleLis.index($(el)); - _this8.close(index); - }); - } - // Animate in - $collapsibleLi[0].classList.add('active'); - this._animateIn(index); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Datepicker = void 0; +const modal_1 = __webpack_require__(/*! ./modal */ "./src/modal.ts"); +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const select_1 = __webpack_require__(/*! ./select */ "./src/select.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +; +let _defaults = { + // Close when date is selected + autoClose: false, + // the default output format for the input field value + format: 'mmm dd, yyyy', + // Used to create date object from current input string + parse: null, + // The initial date to view when first opened + defaultDate: null, + // Make the `defaultDate` the initial selected value + setDefaultDate: false, + disableWeekends: false, + disableDayFn: null, + // First day of week (0: Sunday, 1: Monday etc) + firstDay: 0, + // The earliest date that can be selected + minDate: null, + // Thelatest date that can be selected + maxDate: null, + // Number of years either side, or array of upper/lower range + yearRange: 10, + // used internally (don't config outside) + minYear: 0, + maxYear: 9999, + minMonth: undefined, + maxMonth: undefined, + startRange: null, + endRange: null, + isRTL: false, + yearRangeReverse: false, + // Render the month after year in the calendar title + showMonthAfterYear: false, + // Render days of the calendar grid that fall in the next or previous month + showDaysInNextAndPreviousMonths: false, + // Specify a DOM element to render the calendar in + container: null, + // Show clear button + showClearBtn: false, + // internationalization + i18n: { + cancel: 'Cancel', + clear: 'Clear', + done: 'Ok', + previousMonth: '‹', + nextMonth: '›', + months: [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' + ], + monthsShort: [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec' + ], + weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + weekdaysAbbrev: ['S', 'M', 'T', 'W', 'T', 'F', 'S'] + }, + // events array + events: [], + // callback function + onSelect: null, + onOpen: null, + onClose: null, + onDraw: null +}; +class Datepicker extends component_1.Component { + constructor(el, options) { + super(el, options, Datepicker); + this._handleInputClick = () => { + this.open(); + }; + this._handleInputKeydown = (e) => { + if (utils_1.Utils.keys.ENTER.includes(e.key)) { + e.preventDefault(); + this.open(); + } + }; + this._handleCalendarClick = (e) => { + if (!this.isOpen) + return; + const target = (e.target); + if (!target.classList.contains('is-disabled')) { + if (target.classList.contains('datepicker-day-button') && + !target.classList.contains('is-empty') && + !target.parentElement.classList.contains('is-disabled')) { + this.setDate(new Date(e.target.getAttribute('data-year'), e.target.getAttribute('data-month'), e.target.getAttribute('data-day'))); + if (this.options.autoClose) { + this._finishSelection(); + } + } + else if (target.closest('.month-prev')) { + this.prevMonth(); + } + else if (target.closest('.month-next')) { + this.nextMonth(); + } + } + }; + this._handleClearClick = () => { + this.date = null; + this.setInputValue(); + this.close(); + }; + this._handleMonthChange = (e) => { + this.gotoMonth(e.target.value); + }; + this._handleYearChange = (e) => { + this.gotoYear(e.target.value); + }; + this._handleInputChange = (e) => { + var _a; + let date; + // Prevent change event from being fired when triggered by the plugin + if (((_a = e['detail']) === null || _a === void 0 ? void 0 : _a.firedBy) === this) + return; + if (this.options.parse) { + date = this.options.parse(this.el.value, typeof this.options.format === "function" + ? this.options.format(new Date(this.el.value)) + : this.options.format); + } + else { + date = new Date(Date.parse(this.el.value)); + } + if (Datepicker._isDate(date)) + this.setDate(date); + }; + // Set input value to the selected date and close Datepicker + this._finishSelection = () => { + this.setInputValue(); + this.close(); + }; + /** + * Open datepicker. + */ + this.open = () => { + if (this.isOpen) + return; + this.isOpen = true; + if (typeof this.options.onOpen === 'function') { + this.options.onOpen.call(this); + } + this.draw(); + this.modal.open(undefined); + return this; + }; + /** + * Close datepicker. + */ + this.close = () => { + if (!this.isOpen) + return; + this.isOpen = false; + if (typeof this.options.onClose === 'function') { + this.options.onClose.call(this); + } + this.modal.close(); + return this; + }; + this.el.M_Datepicker = this; + this.options = Object.assign(Object.assign({}, Datepicker.defaults), options); + // make sure i18n defaults are not lost when only few i18n option properties are passed + if (!!options && options.hasOwnProperty('i18n') && typeof options.i18n === 'object') { + this.options.i18n = Object.assign(Object.assign({}, Datepicker.defaults.i18n), options.i18n); } - } - - /** - * Close Collapsible - * @param {Number} index - 0th index of slide - */ - - }, { - key: "close", - value: function close(index) { - var $collapsibleLi = this.$el.children('li').eq(index); - if ($collapsibleLi.length && $collapsibleLi[0].classList.contains('active')) { - // onCloseStart callback - if (typeof this.options.onCloseStart === 'function') { - this.options.onCloseStart.call(this, $collapsibleLi[0]); - } - - // Animate out - $collapsibleLi[0].classList.remove('active'); - this._animateOut(index); + // Remove time component from minDate and maxDate options + if (this.options.minDate) + this.options.minDate.setHours(0, 0, 0, 0); + if (this.options.maxDate) + this.options.maxDate.setHours(0, 0, 0, 0); + this.id = utils_1.Utils.guid(); + this._setupVariables(); + this._insertHTMLIntoDOM(); + this._setupModal(); + this._setupEventHandlers(); + if (!this.options.defaultDate) { + this.options.defaultDate = new Date(Date.parse(this.el.value)); } - } - }], [{ - key: "init", - value: function init(els, options) { - return _get(Collapsible.__proto__ || Object.getPrototypeOf(Collapsible), "init", this).call(this, this, els, options); - } - - /** - * Get Instance - */ - - }, { - key: "getInstance", - value: function getInstance(el) { - var domElem = !!el.jquery ? el[0] : el; - return domElem.M_Collapsible; - } - }, { - key: "defaults", - get: function () { + let defDate = this.options.defaultDate; + if (Datepicker._isDate(defDate)) { + if (this.options.setDefaultDate) { + this.setDate(defDate, true); + this.setInputValue(); + } + else { + this.gotoDate(defDate); + } + } + else { + this.gotoDate(new Date()); + } + this.isOpen = false; + } + static get defaults() { return _defaults; - } - }]); + } + /** + * Initializes instances of Datepicker. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, Datepicker); + } + static _isDate(obj) { + return /Date/.test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime()); + } + static _isWeekend(date) { + let day = date.getDay(); + return day === 0 || day === 6; + } + static _setToStartOfDay(date) { + if (Datepicker._isDate(date)) + date.setHours(0, 0, 0, 0); + } + static _getDaysInMonth(year, month) { + return [31, Datepicker._isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; + } + static _isLeapYear(year) { + // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951 + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + } + static _compareDates(a, b) { + // weak date comparison (use setToStartOfDay(date) to ensure correct result) + return a.getTime() === b.getTime(); + } + static getInstance(el) { + return el.M_Datepicker; + } + destroy() { + this._removeEventHandlers(); + this.modal.destroy(); + this.modalEl.remove(); + this.destroySelects(); + this.el.M_Datepicker = undefined; + } + destroySelects() { + let oldYearSelect = this.calendarEl.querySelector('.orig-select-year'); + if (oldYearSelect) { + select_1.FormSelect.getInstance(oldYearSelect).destroy(); + } + let oldMonthSelect = this.calendarEl.querySelector('.orig-select-month'); + if (oldMonthSelect) { + select_1.FormSelect.getInstance(oldMonthSelect).destroy(); + } + } + _insertHTMLIntoDOM() { + if (this.options.showClearBtn) { + this.clearBtn.style.visibility = ''; + this.clearBtn.innerText = this.options.i18n.clear; + } + this.doneBtn.innerText = this.options.i18n.done; + this.cancelBtn.innerText = this.options.i18n.cancel; + if (this.options.container) { + const optEl = this.options.container; + this.options.container = + optEl instanceof HTMLElement ? optEl : document.querySelector(optEl); + this.options.container.append(this.modalEl); + } + else { + //this.modalEl.before(this.el); + this.el.parentElement.appendChild(this.modalEl); + } + } + _setupModal() { + this.modalEl.id = 'modal-' + this.id; + this.modal = modal_1.Modal.init(this.modalEl, { + onCloseEnd: () => { + this.isOpen = false; + } + }); + } + /** + * Gets a string representation of the selected date. + */ + toString(format = null) { + format = format || this.options.format; + if (typeof format === 'function') + return format(this.date); + if (!Datepicker._isDate(this.date)) + return ''; + // String Format + const formatArray = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g); + const formattedDate = formatArray + .map(label => this.formats[label] ? this.formats[label]() : label) + .join(''); + return formattedDate; + } + /** + * Set a date on the datepicker. + * @param date Date to set on the datepicker. + * @param preventOnSelect Undocumented as of 5 March 2018. + */ + setDate(date = null, preventOnSelect = false) { + if (!date) { + this.date = null; + this._renderDateDisplay(); + return this.draw(); + } + if (typeof date === 'string') { + date = new Date(Date.parse(date)); + } + if (!Datepicker._isDate(date)) { + return; + } + let min = this.options.minDate, max = this.options.maxDate; + if (Datepicker._isDate(min) && date < min) { + date = min; + } + else if (Datepicker._isDate(max) && date > max) { + date = max; + } + this.date = new Date(date.getTime()); + this._renderDateDisplay(); + Datepicker._setToStartOfDay(this.date); + this.gotoDate(this.date); + if (!preventOnSelect && typeof this.options.onSelect === 'function') { + this.options.onSelect.call(this, this.date); + } + } + /** + * Sets current date as the input value. + */ + setInputValue() { + this.el.value = this.toString(); + this.el.dispatchEvent(new CustomEvent('change', { bubbles: true, cancelable: true, composed: true, detail: { firedBy: this } })); + } + _renderDateDisplay() { + let displayDate = Datepicker._isDate(this.date) ? this.date : new Date(); + let i18n = this.options.i18n; + let day = i18n.weekdaysShort[displayDate.getDay()]; + let month = i18n.monthsShort[displayDate.getMonth()]; + let date = displayDate.getDate(); + this.yearTextEl.innerHTML = displayDate.getFullYear().toString(); + this.dateTextEl.innerHTML = `${day}, ${month} ${date}`; + } + /** + * Change date view to a specific date on the datepicker. + * @param date Date to show on the datepicker. + */ + gotoDate(date) { + let newCalendar = true; + if (!Datepicker._isDate(date)) { + return; + } + if (this.calendars) { + let firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), lastVisibleDate = new Date(this.calendars[this.calendars.length - 1].year, this.calendars[this.calendars.length - 1].month, 1), visibleDate = date.getTime(); + // get the end of the month + lastVisibleDate.setMonth(lastVisibleDate.getMonth() + 1); + lastVisibleDate.setDate(lastVisibleDate.getDate() - 1); + newCalendar = + visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate; + } + if (newCalendar) { + this.calendars = [ + { + month: date.getMonth(), + year: date.getFullYear() + } + ]; + } + this.adjustCalendars(); + } + adjustCalendars() { + this.calendars[0] = this.adjustCalendar(this.calendars[0]); + this.draw(); + } + adjustCalendar(calendar) { + if (calendar.month < 0) { + calendar.year -= Math.ceil(Math.abs(calendar.month) / 12); + calendar.month += 12; + } + if (calendar.month > 11) { + calendar.year += Math.floor(Math.abs(calendar.month) / 12); + calendar.month -= 12; + } + return calendar; + } + nextMonth() { + this.calendars[0].month++; + this.adjustCalendars(); + } + prevMonth() { + this.calendars[0].month--; + this.adjustCalendars(); + } + render(year, month, randId) { + let opts = this.options, now = new Date(), days = Datepicker._getDaysInMonth(year, month), before = new Date(year, month, 1).getDay(), data = [], row = []; + Datepicker._setToStartOfDay(now); + if (opts.firstDay > 0) { + before -= opts.firstDay; + if (before < 0) { + before += 7; + } + } + let previousMonth = month === 0 ? 11 : month - 1, nextMonth = month === 11 ? 0 : month + 1, yearOfPreviousMonth = month === 0 ? year - 1 : year, yearOfNextMonth = month === 11 ? year + 1 : year, daysInPreviousMonth = Datepicker._getDaysInMonth(yearOfPreviousMonth, previousMonth); + let cells = days + before, after = cells; + while (after > 7) { + after -= 7; + } + cells += 7 - after; + let isWeekSelected = false; + for (let i = 0, r = 0; i < cells; i++) { + let day = new Date(year, month, 1 + (i - before)), isSelected = Datepicker._isDate(this.date) + ? Datepicker._compareDates(day, this.date) + : false, isToday = Datepicker._compareDates(day, now), hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false, isEmpty = i < before || i >= days + before, dayNumber = 1 + (i - before), monthNumber = month, yearNumber = year, isStartRange = opts.startRange && Datepicker._compareDates(opts.startRange, day), isEndRange = opts.endRange && Datepicker._compareDates(opts.endRange, day), isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange, isDisabled = (opts.minDate && day < opts.minDate) || + (opts.maxDate && day > opts.maxDate) || + (opts.disableWeekends && Datepicker._isWeekend(day)) || + (opts.disableDayFn && opts.disableDayFn(day)); + if (isEmpty) { + if (i < before) { + dayNumber = daysInPreviousMonth + dayNumber; + monthNumber = previousMonth; + yearNumber = yearOfPreviousMonth; + } + else { + dayNumber = dayNumber - days; + monthNumber = nextMonth; + yearNumber = yearOfNextMonth; + } + } + let dayConfig = { + day: dayNumber, + month: monthNumber, + year: yearNumber, + hasEvent: hasEvent, + isSelected: isSelected, + isToday: isToday, + isDisabled: isDisabled, + isEmpty: isEmpty, + isStartRange: isStartRange, + isEndRange: isEndRange, + isInRange: isInRange, + showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths + }; + row.push(this.renderDay(dayConfig)); + if (++r === 7) { + data.push(this.renderRow(row, opts.isRTL, isWeekSelected)); + row = []; + r = 0; + isWeekSelected = false; + } + } + return this.renderTable(opts, data, randId); + } + renderDay(opts) { + let arr = []; + let ariaSelected = 'false'; + if (opts.isEmpty) { + if (opts.showDaysInNextAndPreviousMonths) { + arr.push('is-outside-current-month'); + arr.push('is-selection-disabled'); + } + else { + return ''; + } + } + if (opts.isDisabled) { + arr.push('is-disabled'); + } + if (opts.isToday) { + arr.push('is-today'); + } + if (opts.isSelected) { + arr.push('is-selected'); + ariaSelected = 'true'; + } + if (opts.hasEvent) { + arr.push('has-event'); + } + if (opts.isInRange) { + arr.push('is-inrange'); + } + if (opts.isStartRange) { + arr.push('is-startrange'); + } + if (opts.isEndRange) { + arr.push('is-endrange'); + } + return (`` + + `` + + ''); + } + renderRow(days, isRTL, isRowSelected) { + return ('' + + (isRTL ? days.reverse() : days).join('') + + ''); + } + renderTable(opts, data, randId) { + return ('
    ' + + this.renderHead(opts) + + this.renderBody(data) + + '
    '); + } + renderHead(opts) { + let i, arr = []; + for (i = 0; i < 7; i++) { + arr.push(`${this.renderDayName(opts, i, true)}`); + } + return '' + (opts.isRTL ? arr.reverse() : arr).join('') + ''; + } + renderBody(rows) { + return '' + rows.join('') + ''; + } + renderTitle(instance, c, year, month, refYear, randId) { + let i, j, arr, opts = this.options, isMinYear = year === opts.minYear, isMaxYear = year === opts.maxYear, html = '
    ', monthHtml, yearHtml, prev = true, next = true; + for (arr = [], i = 0; i < 12; i++) { + arr.push(''); + } + monthHtml = ''; + if (Array.isArray(opts.yearRange)) { + i = opts.yearRange[0]; + j = opts.yearRange[1] + 1; + } + else { + i = year - opts.yearRange; + j = 1 + year + opts.yearRange; + } + for (arr = []; i < j && i <= opts.maxYear; i++) { + if (i >= opts.minYear) { + arr.push(``); + } + } + if (opts.yearRangeReverse) + arr.reverse(); + yearHtml = ``; + let leftArrow = ''; + html += ``; + html += '
    '; + if (opts.showMonthAfterYear) { + html += yearHtml + monthHtml; + } + else { + html += monthHtml + yearHtml; + } + html += '
    '; + if (isMinYear && (month === 0 || opts.minMonth >= month)) { + prev = false; + } + if (isMaxYear && (month === 11 || opts.maxMonth <= month)) { + next = false; + } + let rightArrow = ''; + html += ``; + return (html += '
    '); + } + // refresh HTML + draw(force = false) { + if (!this.isOpen && !force) + return; + let opts = this.options, minYear = opts.minYear, maxYear = opts.maxYear, minMonth = opts.minMonth, maxMonth = opts.maxMonth, html = '', randId; + if (this._y <= minYear) { + this._y = minYear; + if (!isNaN(minMonth) && this._m < minMonth) { + this._m = minMonth; + } + } + if (this._y >= maxYear) { + this._y = maxYear; + if (!isNaN(maxMonth) && this._m > maxMonth) { + this._m = maxMonth; + } + } + randId = + 'datepicker-title-' + + Math.random() + .toString(36) + .replace(/[^a-z]+/g, '') + .substr(0, 2); + for (let c = 0; c < 1; c++) { + this._renderDateDisplay(); + html += + this.renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId); + } + this.destroySelects(); + this.calendarEl.innerHTML = html; + // Init Materialize Select + let yearSelect = this.calendarEl.querySelector('.orig-select-year'); + let monthSelect = this.calendarEl.querySelector('.orig-select-month'); + select_1.FormSelect.init(yearSelect, { + classes: 'select-year', + dropdownOptions: { container: document.body, constrainWidth: false } + }); + select_1.FormSelect.init(monthSelect, { + classes: 'select-month', + dropdownOptions: { container: document.body, constrainWidth: false } + }); + // Add change handlers for select + yearSelect.addEventListener('change', this._handleYearChange); + monthSelect.addEventListener('change', this._handleMonthChange); + if (typeof this.options.onDraw === 'function') { + this.options.onDraw.call(this); + } + } + _setupEventHandlers() { + this.el.addEventListener('click', this._handleInputClick); + this.el.addEventListener('keydown', this._handleInputKeydown); + this.el.addEventListener('change', this._handleInputChange); + this.calendarEl.addEventListener('click', this._handleCalendarClick); + this.doneBtn.addEventListener('click', this._finishSelection); + this.cancelBtn.addEventListener('click', this.close); + if (this.options.showClearBtn) { + this.clearBtn.addEventListener('click', this._handleClearClick); + } + } + _setupVariables() { + const template = document.createElement('template'); + template.innerHTML = Datepicker._template.trim(); + this.modalEl = template.content.firstChild; + this.calendarEl = this.modalEl.querySelector('.datepicker-calendar'); + this.yearTextEl = this.modalEl.querySelector('.year-text'); + this.dateTextEl = this.modalEl.querySelector('.date-text'); + if (this.options.showClearBtn) { + this.clearBtn = this.modalEl.querySelector('.datepicker-clear'); + } + this.doneBtn = this.modalEl.querySelector('.datepicker-done'); + this.cancelBtn = this.modalEl.querySelector('.datepicker-cancel'); + this.formats = { + d: () => { + return this.date.getDate(); + }, + dd: () => { + let d = this.date.getDate(); + return (d < 10 ? '0' : '') + d; + }, + ddd: () => { + return this.options.i18n.weekdaysShort[this.date.getDay()]; + }, + dddd: () => { + return this.options.i18n.weekdays[this.date.getDay()]; + }, + m: () => { + return this.date.getMonth() + 1; + }, + mm: () => { + let m = this.date.getMonth() + 1; + return (m < 10 ? '0' : '') + m; + }, + mmm: () => { + return this.options.i18n.monthsShort[this.date.getMonth()]; + }, + mmmm: () => { + return this.options.i18n.months[this.date.getMonth()]; + }, + yy: () => { + return ('' + this.date.getFullYear()).slice(2); + }, + yyyy: () => { + return this.date.getFullYear(); + } + }; + } + _removeEventHandlers() { + this.el.removeEventListener('click', this._handleInputClick); + this.el.removeEventListener('keydown', this._handleInputKeydown); + this.el.removeEventListener('change', this._handleInputChange); + this.calendarEl.removeEventListener('click', this._handleCalendarClick); + } + // change view to a specific month (zero-index, e.g. 0: January) + gotoMonth(month) { + if (!isNaN(month)) { + this.calendars[0].month = parseInt(month, 10); + this.adjustCalendars(); + } + } + // change view to a specific full year (e.g. "2012") + gotoYear(year) { + if (!isNaN(year)) { + this.calendars[0].year = parseInt(year, 10); + this.adjustCalendars(); + } + } + renderDayName(opts, day, abbr = false) { + day += opts.firstDay; + while (day >= 7) { + day -= 7; + } + return abbr ? opts.i18n.weekdaysAbbrev[day] : opts.i18n.weekdays[day]; + } +} +exports.Datepicker = Datepicker; +(() => { + Datepicker._template = ` + `; +})(); - return Collapsible; - }(Component); - M.Collapsible = Collapsible; +/***/ }), - if (M.jQueryLoaded) { - M.initializeJqueryWrapper(Collapsible, 'collapsible', 'M_Collapsible'); - } -})(cash, M.anime); -;(function ($, anim) { - 'use strict'; +/***/ "./src/dropdown.ts": +/*!*************************!*\ + !*** ./src/dropdown.ts ***! + \*************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - var _defaults = { + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Dropdown = void 0; +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +; +const _defaults = { alignment: 'left', autoFocus: true, constrainWidth: true, @@ -2225,691 +2672,982 @@ $jscomp.polyfill = function (e, r, p, m) { onCloseStart: null, onCloseEnd: null, onItemClick: null - }; - - /** - * @class - */ - - var Dropdown = function (_Component2) { - _inherits(Dropdown, _Component2); - - function Dropdown(el, options) { - _classCallCheck(this, Dropdown); - - var _this9 = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, Dropdown, el, options)); - - _this9.el.M_Dropdown = _this9; - Dropdown._dropdowns.push(_this9); - - _this9.id = M.getIdFromTrigger(el); - _this9.dropdownEl = document.getElementById(_this9.id); - _this9.$dropdownEl = $(_this9.dropdownEl); - - /** - * Options for the dropdown - * @member Dropdown#options - * @prop {String} [alignment='left'] - Edge which the dropdown is aligned to - * @prop {Boolean} [autoFocus=true] - Automatically focus dropdown el for keyboard - * @prop {Boolean} [constrainWidth=true] - Constrain width to width of the button - * @prop {Element} container - Container element to attach dropdown to (optional) - * @prop {Boolean} [coverTrigger=true] - Place dropdown over trigger - * @prop {Boolean} [closeOnClick=true] - Close on click of dropdown item - * @prop {Boolean} [hover=false] - Open dropdown on hover - * @prop {Number} [inDuration=150] - Duration of open animation in ms - * @prop {Number} [outDuration=250] - Duration of close animation in ms - * @prop {Function} onOpenStart - Function called when dropdown starts opening - * @prop {Function} onOpenEnd - Function called when dropdown finishes opening - * @prop {Function} onCloseStart - Function called when dropdown starts closing - * @prop {Function} onCloseEnd - Function called when dropdown finishes closing - */ - _this9.options = $.extend({}, Dropdown.defaults, options); - - /** - * Describes open/close state of dropdown - * @type {Boolean} - */ - _this9.isOpen = false; - - /** - * Describes if dropdown content is scrollable - * @type {Boolean} - */ - _this9.isScrollable = false; - - /** - * Describes if touch moving on dropdown content - * @type {Boolean} - */ - _this9.isTouchMoving = false; - - _this9.focusedIndex = -1; - _this9.filterQuery = []; - - // Move dropdown-content after dropdown-trigger - _this9._moveDropdown(); - - _this9._makeDropdownFocusable(); - _this9._resetFilterQueryBound = _this9._resetFilterQuery.bind(_this9); - _this9._handleDocumentClickBound = _this9._handleDocumentClick.bind(_this9); - _this9._handleDocumentTouchmoveBound = _this9._handleDocumentTouchmove.bind(_this9); - _this9._handleDropdownClickBound = _this9._handleDropdownClick.bind(_this9); - _this9._handleDropdownKeydownBound = _this9._handleDropdownKeydown.bind(_this9); - _this9._handleTriggerKeydownBound = _this9._handleTriggerKeydown.bind(_this9); - _this9._setupEventHandlers(); - return _this9; +}; +class Dropdown extends component_1.Component { + constructor(el, options) { + super(el, options, Dropdown); + this._handleClick = (e) => { + e.preventDefault(); + if (this.isOpen) { + this.close(); + } + else { + this.open(); + } + }; + this._handleMouseEnter = () => { + this.open(); + }; + this._handleMouseLeave = (e) => { + const toEl = e.relatedTarget; + const leaveToDropdownContent = !!toEl.closest('.dropdown-content'); + let leaveToActiveDropdownTrigger = false; + const closestTrigger = toEl.closest('.dropdown-trigger'); + if (closestTrigger && + !!closestTrigger.M_Dropdown && + closestTrigger.M_Dropdown.isOpen) { + leaveToActiveDropdownTrigger = true; + } + // Close hover dropdown if mouse did not leave to either active dropdown-trigger or dropdown-content + if (!leaveToActiveDropdownTrigger && !leaveToDropdownContent) { + this.close(); + } + }; + this._handleDocumentClick = (e) => { + const target = e.target; + if (this.options.closeOnClick && + target.closest('.dropdown-content') && + !this.isTouchMoving) { + // isTouchMoving to check if scrolling on mobile. + this.close(); + } + else if (!target.closest('.dropdown-content')) { + // Do this one frame later so that if the element clicked also triggers _handleClick + // For example, if a label for a select was clicked, that we don't close/open the dropdown + setTimeout(() => { + if (this.isOpen) { + this.close(); + } + }, 0); + } + this.isTouchMoving = false; + }; + this._handleTriggerKeydown = (e) => { + // ARROW DOWN OR ENTER WHEN SELECT IS CLOSED - open Dropdown + const arrowDownOrEnter = utils_1.Utils.keys.ARROW_DOWN.includes(e.key) || utils_1.Utils.keys.ENTER.includes(e.key); + if (arrowDownOrEnter && !this.isOpen) { + e.preventDefault(); + this.open(); + } + }; + this._handleDocumentTouchmove = (e) => { + const target = e.target; + if (target.closest('.dropdown-content')) { + this.isTouchMoving = true; + } + }; + this._handleDropdownClick = (e) => { + // onItemClick callback + if (typeof this.options.onItemClick === 'function') { + const itemEl = e.target.closest('li'); + this.options.onItemClick.call(this, itemEl); + } + }; + this._handleDropdownKeydown = (e) => { + const arrowUpOrDown = utils_1.Utils.keys.ARROW_DOWN.includes(e.key) || utils_1.Utils.keys.ARROW_UP.includes(e.key); + if (utils_1.Utils.keys.TAB.includes(e.key)) { + e.preventDefault(); + this.close(); + } + // Navigate down dropdown list + else if (arrowUpOrDown && this.isOpen) { + e.preventDefault(); + const direction = utils_1.Utils.keys.ARROW_DOWN.includes(e.key) ? 1 : -1; + let newFocusedIndex = this.focusedIndex; + let hasFoundNewIndex = false; + do { + newFocusedIndex = newFocusedIndex + direction; + if (!!this.dropdownEl.children[newFocusedIndex] && + this.dropdownEl.children[newFocusedIndex].tabIndex !== -1) { + hasFoundNewIndex = true; + break; + } + } while (newFocusedIndex < this.dropdownEl.children.length && newFocusedIndex >= 0); + if (hasFoundNewIndex) { + // Remove active class from old element + if (this.focusedIndex >= 0) + this.dropdownEl.children[this.focusedIndex].classList.remove('active'); + this.focusedIndex = newFocusedIndex; + this._focusFocusedItem(); + } + } + // ENTER selects choice on focused item + else if (utils_1.Utils.keys.ENTER.includes(e.key) && this.isOpen) { + // Search for and `; + arrLi.push(li); + ul.append(li); }); - } - this.$input[0].value = ''; - - // delete or left - } else if ((e.keyCode === 8 || e.keyCode === 37) && this.$input[0].value === '' && this.chipsData.length) { - e.preventDefault(); - this.selectChip(this.chipsData.length - 1); + this.el.append(ul); + this._indicators = arrLi; } - } - - /** - * Render Chip - * @param {chip} chip - * @return {Element} - */ - - }, { - key: "_renderChip", - value: function _renderChip(chip) { - if (!chip.tag) { - return; + } + _removeIndicators() { + this.el.querySelector('ul.indicators').remove(); //find('ul.indicators').remove(); + } + set(index) { + // Wrap around indices. + if (index >= this._slides.length) + index = 0; + else if (index < 0) + index = this._slides.length - 1; + // Only do if index changes + if (this.activeIndex === index) + return; + this._activeSlide = this._slides[this.activeIndex]; + const _caption = this._activeSlide.querySelector('.caption'); + this._activeSlide.classList.remove('active'); + // Enables every slide + this._slides.forEach(slide => slide.style.visibility = 'visible'); + //--- Hide active Slide + Caption + this._activeSlide.style.opacity = '0'; + setTimeout(() => { + this._slides.forEach(slide => { + if (slide.classList.contains('active')) + return; + slide.style.opacity = '0'; + slide.style.transform = 'translate(0, 0)'; + // Disables invisible slides (for assistive technologies) + slide.style.visibility = 'hidden'; + }); + }, this.options.duration); + // Hide active Caption + //this._animateCaptionIn(_caption, this.options.duration); + _caption.style.opacity = '0'; + // Update indicators + if (this.options.indicators) { + const activeIndicator = this._indicators[this.activeIndex].children[0]; + const nextIndicator = this._indicators[index].children[0]; + activeIndicator.classList.remove('active'); + nextIndicator.classList.add('active'); + if (typeof this.options.indicatorLabelFunc === "function") { + activeIndicator.ariaLabel = this.options.indicatorLabelFunc.call(this, this.activeIndex, false); + nextIndicator.ariaLabel = this.options.indicatorLabelFunc.call(this, index, true); + } } - - var renderedChip = document.createElement('div'); - var closeIcon = document.createElement('i'); - renderedChip.classList.add('chip'); - renderedChip.textContent = chip.tag; - renderedChip.setAttribute('tabindex', 0); - $(closeIcon).addClass('material-icons close'); - closeIcon.textContent = 'close'; - - // attach image if needed - if (chip.image) { - var img = document.createElement('img'); - img.setAttribute('src', chip.image); - renderedChip.insertBefore(img, renderedChip.firstChild); + //--- Show new Slide + Caption + this._animateSlide(this._slides[index], true); + this._slides[index].classList.add('active'); + this.activeIndex = index; + // Reset interval, if allowed. This check prevents autostart + // when slider is paused, since it can be changed though indicators. + if (this.interval != null) { + this.start(); } + } + _pause(fromEvent) { + clearInterval(this.interval); + this.eventPause = fromEvent; + this.interval = null; + } +} +exports.Slider = Slider; - renderedChip.appendChild(closeIcon); - return renderedChip; - } - /** - * Render Chips - */ +/***/ }), - }, { - key: "_renderChips", - value: function _renderChips() { - this.$chips.remove(); - for (var i = 0; i < this.chipsData.length; i++) { - var chipEl = this._renderChip(this.chipsData[i]); - this.$el.append(chipEl); - this.$chips.add(chipEl); - } +/***/ "./src/tabs.ts": +/*!*********************!*\ + !*** ./src/tabs.ts ***! + \*********************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - // move input to end - this.$el.append(this.$input[0]); - } - /** - * Setup Autocomplete - */ - - }, { - key: "_setupAutocomplete", - value: function _setupAutocomplete() { - var _this46 = this; - - this.options.autocompleteOptions.onAutocomplete = function (val) { - _this46.addChip({ - tag: val - }); - _this46.$input[0].value = ''; - _this46.$input[0].focus(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Tabs = void 0; +const carousel_1 = __webpack_require__(/*! ./carousel */ "./src/carousel.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +; +let _defaults = { + duration: 300, + onShow: null, + swipeable: false, + responsiveThreshold: Infinity // breakpoint for swipeable +}; +class Tabs extends component_1.Component { + constructor(el, options) { + super(el, options, Tabs); + this._handleWindowResize = () => { + this._setTabsAndTabWidth(); + if (this._tabWidth !== 0 && this._tabsWidth !== 0) { + this._indicator.style.left = this._calcLeftPos(this._activeTabLink) + 'px'; + this._indicator.style.right = this._calcRightPos(this._activeTabLink) + 'px'; + } }; - - this.autocomplete = M.Autocomplete.init(this.$input[0], this.options.autocompleteOptions); - } - - /** - * Setup Input - */ - - }, { - key: "_setupInput", - value: function _setupInput() { - this.$input = this.$el.find('input'); - if (!this.$input.length) { - this.$input = $(''); - this.$el.append(this.$input); - } - - this.$input.addClass('input'); - } - - /** - * Setup Label - */ - - }, { - key: "_setupLabel", - value: function _setupLabel() { - this.$label = this.$el.find('label'); - if (this.$label.length) { - this.$label[0].setAttribute('for', this.$input.attr('id')); - } - } - - /** - * Set placeholder - */ - - }, { - key: "_setPlaceholder", - value: function _setPlaceholder() { - if (this.chipsData !== undefined && !this.chipsData.length && this.options.placeholder) { - $(this.$input).prop('placeholder', this.options.placeholder); - } else if ((this.chipsData === undefined || !!this.chipsData.length) && this.options.secondaryPlaceholder) { - $(this.$input).prop('placeholder', this.options.secondaryPlaceholder); - } - } - - /** - * Check if chip is valid - * @param {chip} chip - */ - - }, { - key: "_isValid", - value: function _isValid(chip) { - if (chip.hasOwnProperty('tag') && chip.tag !== '') { - var exists = false; - for (var i = 0; i < this.chipsData.length; i++) { - if (this.chipsData[i].tag === chip.tag) { - exists = true; - break; + this._handleTabClick = (e) => { + const tabLink = e.target; + const tab = tabLink.parentElement; + // Handle click on tab link only + if (!tabLink || !tab.classList.contains('tab')) + return; + // is disabled? + if (tab.classList.contains('disabled')) { + e.preventDefault(); + return; } - } - return !exists; - } - - return false; - } - - /** - * Add chip - * @param {chip} chip - */ - - }, { - key: "addChip", - value: function addChip(chip) { - if (!this._isValid(chip) || this.chipsData.length >= this.options.limit) { - return; - } - - var renderedChip = this._renderChip(chip); - this.$chips.add(renderedChip); - this.chipsData.push(chip); - $(this.$input).before(renderedChip); - this._setPlaceholder(); - - // fire chipAdd callback - if (typeof this.options.onChipAdd === 'function') { - this.options.onChipAdd.call(this, this.$el, renderedChip); - } - } - - /** - * Delete chip - * @param {Number} chip - */ - - }, { - key: "deleteChip", - value: function deleteChip(chipIndex) { - var $chip = this.$chips.eq(chipIndex); - this.$chips.eq(chipIndex).remove(); - this.$chips = this.$chips.filter(function (el) { - return $(el).index() >= 0; - }); - this.chipsData.splice(chipIndex, 1); - this._setPlaceholder(); - - // fire chipDelete callback - if (typeof this.options.onChipDelete === 'function') { - this.options.onChipDelete.call(this, this.$el, $chip[0]); - } - } - - /** - * Select chip - * @param {Number} chip - */ - - }, { - key: "selectChip", - value: function selectChip(chipIndex) { - var $chip = this.$chips.eq(chipIndex); - this._selectedChip = $chip; - $chip[0].focus(); - - // fire chipSelect callback - if (typeof this.options.onChipSelect === 'function') { - this.options.onChipSelect.call(this, this.$el, $chip[0]); - } - } - }], [{ - key: "init", - value: function init(els, options) { - return _get(Chips.__proto__ || Object.getPrototypeOf(Chips), "init", this).call(this, this, els, options); - } - - /** - * Get Instance - */ - - }, { - key: "getInstance", - value: function getInstance(el) { - var domElem = !!el.jquery ? el[0] : el; - return domElem.M_Chips; - } - }, { - key: "_handleChipsKeydown", - value: function _handleChipsKeydown(e) { - Chips._keydown = true; - - var $chips = $(e.target).closest('.chips'); - var chipsKeydown = e.target && $chips.length; - - // Don't handle keydown inputs on input and textarea - if ($(e.target).is('input, textarea') || !chipsKeydown) { - return; - } - - var currChips = $chips[0].M_Chips; - - // backspace and delete - if (e.keyCode === 8 || e.keyCode === 46) { - e.preventDefault(); - - var selectIndex = currChips.chipsData.length; - if (currChips._selectedChip) { - var index = currChips._selectedChip.index(); - currChips.deleteChip(index); - currChips._selectedChip = null; - - // Make sure selectIndex doesn't go negative - selectIndex = Math.max(index - 1, 0); - } - - if (currChips.chipsData.length) { - currChips.selectChip(selectIndex); - } else { - currChips.$input[0].focus(); - } - - // left arrow key - } else if (e.keyCode === 37) { - if (currChips._selectedChip) { - var _selectIndex = currChips._selectedChip.index() - 1; - if (_selectIndex < 0) { - return; + // Act as regular link if target attribute is specified. + if (tabLink.hasAttribute('target')) + return; + // Make the old tab inactive. + this._activeTabLink.classList.remove('active'); + const _oldContent = this._content; + // Update the variables with the new link and content + this._activeTabLink = tabLink; + if (tabLink.hash) + this._content = document.querySelector(tabLink.hash); + this._tabLinks = this.el.querySelectorAll('li.tab > a'); + // Make the tab active + this._activeTabLink.classList.add('active'); + const prevIndex = this._index; + this._index = Math.max(Array.from(this._tabLinks).indexOf(tabLink), 0); + // Swap content + if (this.options.swipeable) { + if (this._tabsCarousel) { + this._tabsCarousel.set(this._index, () => { + if (typeof this.options.onShow === 'function') + this.options.onShow.call(this, this._content); + }); + } } - currChips.selectChip(_selectIndex); - } - - // right arrow key - } else if (e.keyCode === 39) { - if (currChips._selectedChip) { - var _selectIndex2 = currChips._selectedChip.index() + 1; - - if (_selectIndex2 >= currChips.chipsData.length) { - currChips.$input[0].focus(); - } else { - currChips.selectChip(_selectIndex2); + else { + if (this._content) { + this._content.style.display = 'block'; + this._content.classList.add('active'); + if (typeof this.options.onShow === 'function') + this.options.onShow.call(this, this._content); + if (_oldContent && _oldContent !== this._content) { + _oldContent.style.display = 'none'; + _oldContent.classList.remove('active'); + } + } } - } + // Update widths after content is swapped (scrollbar bugfix) + this._setTabsAndTabWidth(); + this._animateIndicator(prevIndex); + e.preventDefault(); + }; + this.el.M_Tabs = this; + this.options = Object.assign(Object.assign({}, Tabs.defaults), options); + this._tabLinks = this.el.querySelectorAll('li.tab > a'); + this._index = 0; + this._setupActiveTabLink(); + if (this.options.swipeable) { + this._setupSwipeableTabs(); } - } - - /** - * Handle Chips Keyup - * @param {Event} e - */ - - }, { - key: "_handleChipsKeyup", - value: function _handleChipsKeyup(e) { - Chips._keydown = false; - } - - /** - * Handle Chips Blur - * @param {Event} e - */ - - }, { - key: "_handleChipsBlur", - value: function _handleChipsBlur(e) { - if (!Chips._keydown && document.hidden) { - var $chips = $(e.target).closest('.chips'); - var currChips = $chips[0].M_Chips; - - currChips._selectedChip = null; + else { + this._setupNormalTabs(); } - } - }, { - key: "defaults", - get: function () { - return _defaults; - } - }]); - - return Chips; - }(Component); - - /** - * @static - * @memberof Chips - */ - - - Chips._keydown = false; - - M.Chips = Chips; - - if (M.jQueryLoaded) { - M.initializeJqueryWrapper(Chips, 'chips', 'M_Chips'); - } - - $(document).ready(function () { - // Handle removal of static chips. - $(document.body).on('click', '.chip .close', function () { - var $chips = $(this).closest('.chips'); - if ($chips.length && $chips[0].M_Chips) { - return; - } - $(this).closest('.chip').remove(); - }); - }); -})(cash); -;(function ($) { - 'use strict'; - - var _defaults = { - top: 0, - bottom: Infinity, - offset: 0, - onPositionChange: null - }; - - /** - * @class - * - */ - - var Pushpin = function (_Component13) { - _inherits(Pushpin, _Component13); - - /** - * Construct Pushpin instance - * @constructor - * @param {Element} el - * @param {Object} options - */ - function Pushpin(el, options) { - _classCallCheck(this, Pushpin); - - var _this47 = _possibleConstructorReturn(this, (Pushpin.__proto__ || Object.getPrototypeOf(Pushpin)).call(this, Pushpin, el, options)); - - _this47.el.M_Pushpin = _this47; - - /** - * Options for the modal - * @member Pushpin#options - */ - _this47.options = $.extend({}, Pushpin.defaults, options); - - _this47.originalOffset = _this47.el.offsetTop; - Pushpin._pushpins.push(_this47); - _this47._setupEventHandlers(); - _this47._updatePosition(); - return _this47; + // Setup tabs indicator after content to ensure accurate widths + this._setTabsAndTabWidth(); + this._createIndicator(); + this._setupEventHandlers(); } - - _createClass(Pushpin, [{ - key: "destroy", - - - /** - * Teardown component - */ - value: function destroy() { - this.el.style.top = null; - this._removePinClasses(); - - // Remove pushpin Inst - var index = Pushpin._pushpins.indexOf(this); - Pushpin._pushpins.splice(index, 1); - if (Pushpin._pushpins.length === 0) { - this._removeEventHandlers(); - } - this.el.M_Pushpin = undefined; - } - }, { - key: "_setupEventHandlers", - value: function _setupEventHandlers() { - document.addEventListener('scroll', Pushpin._updateElements); - } - }, { - key: "_removeEventHandlers", - value: function _removeEventHandlers() { - document.removeEventListener('scroll', Pushpin._updateElements); - } - }, { - key: "_updatePosition", - value: function _updatePosition() { - var scrolled = M.getDocumentScrollTop() + this.options.offset; - - if (this.options.top <= scrolled && this.options.bottom >= scrolled && !this.el.classList.contains('pinned')) { - this._removePinClasses(); - this.el.style.top = this.options.offset + "px"; - this.el.classList.add('pinned'); - - // onPositionChange callback - if (typeof this.options.onPositionChange === 'function') { - this.options.onPositionChange.call(this, 'pinned'); - } - } - - // Add pin-top (when scrolled position is above top) - if (scrolled < this.options.top && !this.el.classList.contains('pin-top')) { - this._removePinClasses(); - this.el.style.top = 0; - this.el.classList.add('pin-top'); - - // onPositionChange callback - if (typeof this.options.onPositionChange === 'function') { - this.options.onPositionChange.call(this, 'pin-top'); - } - } - - // Add pin-bottom (when scrolled position is below bottom) - if (scrolled > this.options.bottom && !this.el.classList.contains('pin-bottom')) { - this._removePinClasses(); - this.el.classList.add('pin-bottom'); - this.el.style.top = this.options.bottom - this.originalOffset + "px"; - - // onPositionChange callback - if (typeof this.options.onPositionChange === 'function') { - this.options.onPositionChange.call(this, 'pin-bottom'); - } - } - } - }, { - key: "_removePinClasses", - value: function _removePinClasses() { - // IE 11 bug (can't remove multiple classes in one line) - this.el.classList.remove('pin-top'); - this.el.classList.remove('pinned'); - this.el.classList.remove('pin-bottom'); - } - }], [{ - key: "init", - value: function init(els, options) { - return _get(Pushpin.__proto__ || Object.getPrototypeOf(Pushpin), "init", this).call(this, this, els, options); - } - - /** - * Get Instance - */ - - }, { - key: "getInstance", - value: function getInstance(el) { - var domElem = !!el.jquery ? el[0] : el; - return domElem.M_Pushpin; - } - }, { - key: "_updateElements", - value: function _updateElements() { - for (var elIndex in Pushpin._pushpins) { - var pInstance = Pushpin._pushpins[elIndex]; - pInstance._updatePosition(); - } - } - }, { - key: "defaults", - get: function () { + static get defaults() { return _defaults; - } - }]); - - return Pushpin; - }(Component); - - /** - * @static - * @memberof Pushpin - */ - - - Pushpin._pushpins = []; - - M.Pushpin = Pushpin; - - if (M.jQueryLoaded) { - M.initializeJqueryWrapper(Pushpin, 'pushpin', 'M_Pushpin'); - } -})(cash); -;(function ($, anim) { - 'use strict'; - - var _defaults = { - direction: 'top', - hoverEnabled: true, - toolbarEnabled: false - }; - - $.fn.reverse = [].reverse; - - /** - * @class - * - */ - - var FloatingActionButton = function (_Component14) { - _inherits(FloatingActionButton, _Component14); - - /** - * Construct FloatingActionButton instance - * @constructor - * @param {Element} el - * @param {Object} options - */ - function FloatingActionButton(el, options) { - _classCallCheck(this, FloatingActionButton); - - var _this48 = _possibleConstructorReturn(this, (FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton)).call(this, FloatingActionButton, el, options)); - - _this48.el.M_FloatingActionButton = _this48; - - /** - * Options for the fab - * @member FloatingActionButton#options - * @prop {Boolean} [direction] - Direction fab menu opens - * @prop {Boolean} [hoverEnabled=true] - Enable hover vs click - * @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition - */ - _this48.options = $.extend({}, FloatingActionButton.defaults, options); - - _this48.isOpen = false; - _this48.$anchor = _this48.$el.children('a').first(); - _this48.$menu = _this48.$el.children('ul').first(); - _this48.$floatingBtns = _this48.$el.find('ul .btn-floating'); - _this48.$floatingBtnsReverse = _this48.$el.find('ul .btn-floating').reverse(); - _this48.offsetY = 0; - _this48.offsetX = 0; - - _this48.$el.addClass("direction-" + _this48.options.direction); - if (_this48.options.direction === 'top') { - _this48.offsetY = 40; - } else if (_this48.options.direction === 'right') { - _this48.offsetX = -40; - } else if (_this48.options.direction === 'bottom') { - _this48.offsetY = -40; - } else { - _this48.offsetX = 40; - } - _this48._setupEventHandlers(); - return _this48; } - - _createClass(FloatingActionButton, [{ - key: "destroy", - - - /** - * Teardown component - */ - value: function destroy() { + /** + * Initializes instances of Tabs. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, Tabs); + } + static getInstance(el) { + return el.M_Tabs; + } + destroy() { this._removeEventHandlers(); - this.el.M_FloatingActionButton = undefined; - } - - /** - * Setup Event Handlers - */ - - }, { - key: "_setupEventHandlers", - value: function _setupEventHandlers() { - this._handleFABClickBound = this._handleFABClick.bind(this); - this._handleOpenBound = this.open.bind(this); - this._handleCloseBound = this.close.bind(this); - - if (this.options.hoverEnabled && !this.options.toolbarEnabled) { - this.el.addEventListener('mouseenter', this._handleOpenBound); - this.el.addEventListener('mouseleave', this._handleCloseBound); - } else { - this.el.addEventListener('click', this._handleFABClickBound); + this._indicator.parentNode.removeChild(this._indicator); + if (this.options.swipeable) { + this._teardownSwipeableTabs(); } - } - - /** - * Remove Event Handlers - */ - - }, { - key: "_removeEventHandlers", - value: function _removeEventHandlers() { - if (this.options.hoverEnabled && !this.options.toolbarEnabled) { - this.el.removeEventListener('mouseenter', this._handleOpenBound); - this.el.removeEventListener('mouseleave', this._handleCloseBound); - } else { - this.el.removeEventListener('click', this._handleFABClickBound); + else { + this._teardownNormalTabs(); } - } - - /** - * Handle FAB Click - */ - - }, { - key: "_handleFABClick", - value: function _handleFABClick() { - if (this.isOpen) { - this.close(); - } else { - this.open(); + this.el.M_Tabs = undefined; + } + /** + * The index of tab that is currently shown. + */ + get index() { return this._index; } + _setupEventHandlers() { + window.addEventListener('resize', this._handleWindowResize); + this.el.addEventListener('click', this._handleTabClick); + } + _removeEventHandlers() { + window.removeEventListener('resize', this._handleWindowResize); + this.el.removeEventListener('click', this._handleTabClick); + } + _createIndicator() { + const indicator = document.createElement('li'); + indicator.classList.add('indicator'); + this.el.appendChild(indicator); + this._indicator = indicator; + this._indicator.style.left = this._calcLeftPos(this._activeTabLink) + 'px'; + this._indicator.style.right = this._calcRightPos(this._activeTabLink) + 'px'; + } + _setupActiveTabLink() { + // If the location.hash matches one of the links, use that as the active tab. + this._activeTabLink = Array.from(this._tabLinks).find((a) => a.getAttribute('href') === location.hash); + // If no match is found, use the first link or any with class 'active' as the initial active tab. + if (!this._activeTabLink) { + this._activeTabLink = this.el.querySelector('li.tab a.active'); } - } - - /** - * Handle Document Click - * @param {Event} e - */ - - }, { - key: "_handleDocumentClick", - value: function _handleDocumentClick(e) { - if (!$(e.target).closest(this.$menu).length) { - this.close(); + if (this._activeTabLink.length === 0) { + this._activeTabLink = this.el.querySelector('li.tab a'); } - } - - /** - * Open FAB - */ - - }, { - key: "open", - value: function open() { - if (this.isOpen) { - return; + Array.from(this._tabLinks).forEach((a) => a.classList.remove('active')); + this._activeTabLink.classList.add('active'); + this._index = Math.max(Array.from(this._tabLinks).indexOf(this._activeTabLink), 0); + if (this._activeTabLink && this._activeTabLink.hash) { + this._content = document.querySelector(this._activeTabLink.hash); + if (this._content) + this._content.classList.add('active'); } - - if (this.options.toolbarEnabled) { - this._animateInToolbar(); - } else { - this._animateInFAB(); - } - this.isOpen = true; - } - - /** - * Close FAB - */ - - }, { - key: "close", - value: function close() { - if (!this.isOpen) { - return; - } - - if (this.options.toolbarEnabled) { - window.removeEventListener('scroll', this._handleCloseBound, true); - document.body.removeEventListener('click', this._handleDocumentClickBound, true); - this._animateOutToolbar(); - } else { - this._animateOutFAB(); - } - this.isOpen = false; - } - - /** - * Classic FAB Menu open - */ - - }, { - key: "_animateInFAB", - value: function _animateInFAB() { - var _this49 = this; - - this.$el.addClass('active'); - - var time = 0; - this.$floatingBtnsReverse.each(function (el) { - anim({ - targets: el, - opacity: 1, - scale: [0.4, 1], - translateY: [_this49.offsetY, 0], - translateX: [_this49.offsetX, 0], - duration: 275, - delay: time, - easing: 'easeInOutQuad' - }); - time += 40; - }); - } - - /** - * Classic FAB Menu close - */ - - }, { - key: "_animateOutFAB", - value: function _animateOutFAB() { - var _this50 = this; - - this.$floatingBtnsReverse.each(function (el) { - anim.remove(el); - anim({ - targets: el, - opacity: 0, - scale: 0.4, - translateY: _this50.offsetY, - translateX: _this50.offsetX, - duration: 175, - easing: 'easeOutQuad', - complete: function () { - _this50.$el.removeClass('active'); + } + _setupSwipeableTabs() { + // Change swipeable according to responsive threshold + if (window.innerWidth > this.options.responsiveThreshold) + this.options.swipeable = false; + const tabsContent = []; + this._tabLinks.forEach(a => { + if (a.hash) { + const currContent = document.querySelector(a.hash); + currContent.classList.add('carousel-item'); + tabsContent.push(currContent); } - }); }); - } - - /** - * Toolbar transition Menu open - */ - - }, { - key: "_animateInToolbar", - value: function _animateInToolbar() { - var _this51 = this; - - var scaleFactor = void 0; - var windowWidth = window.innerWidth; - var windowHeight = window.innerHeight; - var btnRect = this.el.getBoundingClientRect(); - var backdrop = $('
    '); - var fabColor = this.$anchor.css('background-color'); - this.$anchor.append(backdrop); - - this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2; - this.offsetY = windowHeight - btnRect.bottom; - scaleFactor = windowWidth / backdrop[0].clientWidth; - this.btnBottom = btnRect.bottom; - this.btnLeft = btnRect.left; - this.btnWidth = btnRect.width; - - // Set initial state - this.$el.addClass('active'); - this.$el.css({ - 'text-align': 'center', - width: '100%', - bottom: 0, - left: 0, - transform: 'translateX(' + this.offsetX + 'px)', - transition: 'none' + // Create Carousel-Wrapper around Tab-Contents + const tabsWrapper = document.createElement('div'); + tabsWrapper.classList.add('tabs-content', 'carousel', 'carousel-slider'); + // Wrap around + tabsContent[0].parentElement.insertBefore(tabsWrapper, tabsContent[0]); + tabsContent.forEach(tabContent => { + tabsWrapper.appendChild(tabContent); + tabContent.style.display = ''; }); - this.$anchor.css({ - transform: 'translateY(' + -this.offsetY + 'px)', - transition: 'none' + // Keep active tab index to set initial carousel slide + const tab = this._activeTabLink.parentElement; + const activeTabIndex = Array.from(tab.parentNode.children).indexOf(tab); + this._tabsCarousel = carousel_1.Carousel.init(tabsWrapper, { + fullWidth: true, + noWrap: true, + onCycleTo: (item) => { + const prevIndex = this._index; + this._index = Array.from(item.parentNode.children).indexOf(item); + this._activeTabLink.classList.remove('active'); + this._activeTabLink = Array.from(this._tabLinks)[this._index]; + this._activeTabLink.classList.add('active'); + this._animateIndicator(prevIndex); + if (typeof this.options.onShow === 'function') + this.options.onShow.call(this, this._content); + } }); - backdrop.css({ - 'background-color': fabColor + // Set initial carousel slide to active tab + this._tabsCarousel.set(activeTabIndex); + } + _teardownSwipeableTabs() { + const tabsWrapper = this._tabsCarousel.el; + this._tabsCarousel.destroy(); + // Unwrap + tabsWrapper.after(tabsWrapper.children); + tabsWrapper.remove(); + } + _setupNormalTabs() { + // Hide Tabs Content + Array.from(this._tabLinks).forEach((a) => { + if (a === this._activeTabLink) + return; + if (a.hash) { + const currContent = document.querySelector(a.hash); + if (currContent) + currContent.style.display = 'none'; + } }); - - setTimeout(function () { - _this51.$el.css({ - transform: '', - transition: 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s' - }); - _this51.$anchor.css({ - overflow: 'visible', - transform: '', - transition: 'transform .2s' - }); - - setTimeout(function () { - _this51.$el.css({ - overflow: 'hidden', - 'background-color': fabColor - }); - backdrop.css({ - transform: 'scale(' + scaleFactor + ')', - transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)' - }); - _this51.$menu.children('li').children('a').css({ - opacity: 1 - }); - - // Scroll to close. - _this51._handleDocumentClickBound = _this51._handleDocumentClick.bind(_this51); - window.addEventListener('scroll', _this51._handleCloseBound, true); - document.body.addEventListener('click', _this51._handleDocumentClickBound, true); - }, 100); - }, 0); - } - - /** - * Toolbar transition Menu close - */ - - }, { - key: "_animateOutToolbar", - value: function _animateOutToolbar() { - var _this52 = this; - - var windowWidth = window.innerWidth; - var windowHeight = window.innerHeight; - var backdrop = this.$el.find('.fab-backdrop'); - var fabColor = this.$anchor.css('background-color'); - - this.offsetX = this.btnLeft - windowWidth / 2 + this.btnWidth / 2; - this.offsetY = windowHeight - this.btnBottom; - - // Hide backdrop - this.$el.removeClass('active'); - this.$el.css({ - 'background-color': 'transparent', - transition: 'none' - }); - this.$anchor.css({ - transition: 'none' - }); - backdrop.css({ - transform: 'scale(0)', - 'background-color': fabColor - }); - this.$menu.children('li').children('a').css({ - opacity: '' + } + _teardownNormalTabs() { + // show Tabs Content + this._tabLinks.forEach((a) => { + if (a.hash) { + const currContent = document.querySelector(a.hash); + if (currContent) + currContent.style.display = ''; + } }); + } + _setTabsAndTabWidth() { + this._tabsWidth = this.el.getBoundingClientRect().width; + this._tabWidth = Math.max(this._tabsWidth, this.el.scrollWidth) / this._tabLinks.length; + } + _calcRightPos(el) { + return Math.ceil(this._tabsWidth - el.offsetLeft - el.getBoundingClientRect().width); + } + _calcLeftPos(el) { + return Math.floor(el.offsetLeft); + } + /** + * Recalculate tab indicator position. This is useful when + * the indicator position is not correct. + */ + updateTabIndicator() { + this._setTabsAndTabWidth(); + this._animateIndicator(this._index); + } + _animateIndicator(prevIndex) { + let leftDelay = 0, rightDelay = 0; + const isMovingLeftOrStaying = (this._index - prevIndex >= 0); + if (isMovingLeftOrStaying) + leftDelay = 90; + else + rightDelay = 90; + // in v1: easeOutQuad + this._indicator.style.transition = ` + left ${this.options.duration}ms ease-out ${leftDelay}ms, + right ${this.options.duration}ms ease-out ${rightDelay}ms`; + this._indicator.style.left = this._calcLeftPos(this._activeTabLink) + 'px'; + this._indicator.style.right = this._calcRightPos(this._activeTabLink) + 'px'; + } + /** + * Show tab content that corresponds to the tab with the id. + * @param tabId The id of the tab that you want to switch to. + */ + select(tabId) { + const tab = Array.from(this._tabLinks).find((a) => a.getAttribute('href') === '#' + tabId); + if (tab) + tab.click(); + } +} +exports.Tabs = Tabs; - setTimeout(function () { - backdrop.remove(); - // Set initial state. - _this52.$el.css({ - 'text-align': '', - width: '', - bottom: '', - left: '', - overflow: '', - 'background-color': '', - transform: 'translate3d(' + -_this52.offsetX + 'px,0,0)' - }); - _this52.$anchor.css({ - overflow: '', - transform: 'translate3d(0,' + _this52.offsetY + 'px,0)' - }); +/***/ }), - setTimeout(function () { - _this52.$el.css({ - transform: 'translate3d(0,0,0)', - transition: 'transform .2s' - }); - _this52.$anchor.css({ - transform: 'translate3d(0,0,0)', - transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)' - }); - }, 20); - }, 200); - } - }], [{ - key: "init", - value: function init(els, options) { - return _get(FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton), "init", this).call(this, this, els, options); - } +/***/ "./src/tapTarget.ts": +/*!**************************!*\ + !*** ./src/tapTarget.ts ***! + \**************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - /** - * Get Instance - */ - }, { - key: "getInstance", - value: function getInstance(el) { - var domElem = !!el.jquery ? el[0] : el; - return domElem.M_FloatingActionButton; - } - }, { - key: "defaults", - get: function () { - return _defaults; - } - }]); - - return FloatingActionButton; - }(Component); - - M.FloatingActionButton = FloatingActionButton; - - if (M.jQueryLoaded) { - M.initializeJqueryWrapper(FloatingActionButton, 'floatingActionButton', 'M_FloatingActionButton'); - } -})(cash, M.anime); -;(function ($) { - 'use strict'; - - var _defaults = { - // Close when date is selected - autoClose: false, - - // the default output format for the input field value - format: 'mmm dd, yyyy', - - // Used to create date object from current input string - parse: null, - - // The initial date to view when first opened - defaultDate: null, - - // Make the `defaultDate` the initial selected value - setDefaultDate: false, - - disableWeekends: false, - - disableDayFn: null, - - // First day of week (0: Sunday, 1: Monday etc) - firstDay: 0, - - // The earliest date that can be selected - minDate: null, - // Thelatest date that can be selected - maxDate: null, - - // Number of years either side, or array of upper/lower range - yearRange: 10, - - // used internally (don't config outside) - minYear: 0, - maxYear: 9999, - minMonth: undefined, - maxMonth: undefined, - - startRange: null, - endRange: null, - - isRTL: false, - - // Render the month after year in the calendar title - showMonthAfterYear: false, - - // Render days of the calendar grid that fall in the next or previous month - showDaysInNextAndPreviousMonths: false, - - // Specify a DOM element to render the calendar in - container: null, - - // Show clear button - showClearBtn: false, - - // internationalization - i18n: { - cancel: 'Cancel', - clear: 'Clear', - done: 'Ok', - previousMonth: '‹', - nextMonth: '›', - months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - weekdaysAbbrev: ['S', 'M', 'T', 'W', 'T', 'F', 'S'] - }, - - // events array - events: [], - - // callback function - onSelect: null, +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TapTarget = void 0; +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +; +let _defaults = { onOpen: null, - onClose: null, - onDraw: null - }; - - /** - * @class - * - */ - - var Datepicker = function (_Component15) { - _inherits(Datepicker, _Component15); - - /** - * Construct Datepicker instance and set up overlay - * @constructor - * @param {Element} el - * @param {Object} options - */ - function Datepicker(el, options) { - _classCallCheck(this, Datepicker); - - var _this53 = _possibleConstructorReturn(this, (Datepicker.__proto__ || Object.getPrototypeOf(Datepicker)).call(this, Datepicker, el, options)); - - _this53.el.M_Datepicker = _this53; - - _this53.options = $.extend({}, Datepicker.defaults, options); - - // make sure i18n defaults are not lost when only few i18n option properties are passed - if (!!options && options.hasOwnProperty('i18n') && typeof options.i18n === 'object') { - _this53.options.i18n = $.extend({}, Datepicker.defaults.i18n, options.i18n); - } - - // Remove time component from minDate and maxDate options - if (_this53.options.minDate) _this53.options.minDate.setHours(0, 0, 0, 0); - if (_this53.options.maxDate) _this53.options.maxDate.setHours(0, 0, 0, 0); - - _this53.id = M.guid(); - - _this53._setupVariables(); - _this53._insertHTMLIntoDOM(); - _this53._setupModal(); - - _this53._setupEventHandlers(); - - if (!_this53.options.defaultDate) { - _this53.options.defaultDate = new Date(Date.parse(_this53.el.value)); - } - - var defDate = _this53.options.defaultDate; - if (Datepicker._isDate(defDate)) { - if (_this53.options.setDefaultDate) { - _this53.setDate(defDate, true); - _this53.setInputValue(); - } else { - _this53.gotoDate(defDate); - } - } else { - _this53.gotoDate(new Date()); - } - - /** - * Describes open/close state of datepicker - * @type {Boolean} - */ - _this53.isOpen = false; - return _this53; - } - - _createClass(Datepicker, [{ - key: "destroy", - - - /** - * Teardown component - */ - value: function destroy() { - this._removeEventHandlers(); - this.modal.destroy(); - $(this.modalEl).remove(); - this.destroySelects(); - this.el.M_Datepicker = undefined; - } - }, { - key: "destroySelects", - value: function destroySelects() { - var oldYearSelect = this.calendarEl.querySelector('.orig-select-year'); - if (oldYearSelect) { - M.FormSelect.getInstance(oldYearSelect).destroy(); - } - var oldMonthSelect = this.calendarEl.querySelector('.orig-select-month'); - if (oldMonthSelect) { - M.FormSelect.getInstance(oldMonthSelect).destroy(); - } - } - }, { - key: "_insertHTMLIntoDOM", - value: function _insertHTMLIntoDOM() { - if (this.options.showClearBtn) { - $(this.clearBtn).css({ visibility: '' }); - this.clearBtn.innerHTML = this.options.i18n.clear; - } - - this.doneBtn.innerHTML = this.options.i18n.done; - this.cancelBtn.innerHTML = this.options.i18n.cancel; - - if (this.options.container) { - this.$modalEl.appendTo(this.options.container); - } else { - this.$modalEl.insertBefore(this.el); - } - } - }, { - key: "_setupModal", - value: function _setupModal() { - var _this54 = this; - - this.modalEl.id = 'modal-' + this.id; - this.modal = M.Modal.init(this.modalEl, { - onCloseEnd: function () { - _this54.isOpen = false; - } - }); - } - }, { - key: "toString", - value: function toString(format) { - var _this55 = this; - - format = format || this.options.format; - if (!Datepicker._isDate(this.date)) { - return ''; - } - - var formatArray = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g); - var formattedDate = formatArray.map(function (label) { - if (_this55.formats[label]) { - return _this55.formats[label](); - } - - return label; - }).join(''); - return formattedDate; - } - }, { - key: "setDate", - value: function setDate(date, preventOnSelect) { - if (!date) { - this.date = null; - this._renderDateDisplay(); - return this.draw(); - } - if (typeof date === 'string') { - date = new Date(Date.parse(date)); - } - if (!Datepicker._isDate(date)) { - return; - } - - var min = this.options.minDate, - max = this.options.maxDate; - - if (Datepicker._isDate(min) && date < min) { - date = min; - } else if (Datepicker._isDate(max) && date > max) { - date = max; - } - - this.date = new Date(date.getTime()); - - this._renderDateDisplay(); - - Datepicker._setToStartOfDay(this.date); - this.gotoDate(this.date); - - if (!preventOnSelect && typeof this.options.onSelect === 'function') { - this.options.onSelect.call(this, this.date); - } - } - }, { - key: "setInputValue", - value: function setInputValue() { - this.el.value = this.toString(); - this.$el.trigger('change', { firedBy: this }); - } - }, { - key: "_renderDateDisplay", - value: function _renderDateDisplay() { - var displayDate = Datepicker._isDate(this.date) ? this.date : new Date(); - var i18n = this.options.i18n; - var day = i18n.weekdaysShort[displayDate.getDay()]; - var month = i18n.monthsShort[displayDate.getMonth()]; - var date = displayDate.getDate(); - this.yearTextEl.innerHTML = displayDate.getFullYear(); - this.dateTextEl.innerHTML = day + ", " + month + " " + date; - } - - /** - * change view to a specific date - */ - - }, { - key: "gotoDate", - value: function gotoDate(date) { - var newCalendar = true; - - if (!Datepicker._isDate(date)) { - return; - } - - if (this.calendars) { - var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), - lastVisibleDate = new Date(this.calendars[this.calendars.length - 1].year, this.calendars[this.calendars.length - 1].month, 1), - visibleDate = date.getTime(); - // get the end of the month - lastVisibleDate.setMonth(lastVisibleDate.getMonth() + 1); - lastVisibleDate.setDate(lastVisibleDate.getDate() - 1); - newCalendar = visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate; - } - - if (newCalendar) { - this.calendars = [{ - month: date.getMonth(), - year: date.getFullYear() - }]; - } - - this.adjustCalendars(); - } - }, { - key: "adjustCalendars", - value: function adjustCalendars() { - this.calendars[0] = this.adjustCalendar(this.calendars[0]); - this.draw(); - } - }, { - key: "adjustCalendar", - value: function adjustCalendar(calendar) { - if (calendar.month < 0) { - calendar.year -= Math.ceil(Math.abs(calendar.month) / 12); - calendar.month += 12; - } - if (calendar.month > 11) { - calendar.year += Math.floor(Math.abs(calendar.month) / 12); - calendar.month -= 12; - } - return calendar; - } - }, { - key: "nextMonth", - value: function nextMonth() { - this.calendars[0].month++; - this.adjustCalendars(); - } - }, { - key: "prevMonth", - value: function prevMonth() { - this.calendars[0].month--; - this.adjustCalendars(); - } - }, { - key: "render", - value: function render(year, month, randId) { - var opts = this.options, - now = new Date(), - days = Datepicker._getDaysInMonth(year, month), - before = new Date(year, month, 1).getDay(), - data = [], - row = []; - Datepicker._setToStartOfDay(now); - if (opts.firstDay > 0) { - before -= opts.firstDay; - if (before < 0) { - before += 7; - } - } - var previousMonth = month === 0 ? 11 : month - 1, - nextMonth = month === 11 ? 0 : month + 1, - yearOfPreviousMonth = month === 0 ? year - 1 : year, - yearOfNextMonth = month === 11 ? year + 1 : year, - daysInPreviousMonth = Datepicker._getDaysInMonth(yearOfPreviousMonth, previousMonth); - var cells = days + before, - after = cells; - while (after > 7) { - after -= 7; - } - cells += 7 - after; - var isWeekSelected = false; - for (var i = 0, r = 0; i < cells; i++) { - var day = new Date(year, month, 1 + (i - before)), - isSelected = Datepicker._isDate(this.date) ? Datepicker._compareDates(day, this.date) : false, - isToday = Datepicker._compareDates(day, now), - hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false, - isEmpty = i < before || i >= days + before, - dayNumber = 1 + (i - before), - monthNumber = month, - yearNumber = year, - isStartRange = opts.startRange && Datepicker._compareDates(opts.startRange, day), - isEndRange = opts.endRange && Datepicker._compareDates(opts.endRange, day), - isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange, - isDisabled = opts.minDate && day < opts.minDate || opts.maxDate && day > opts.maxDate || opts.disableWeekends && Datepicker._isWeekend(day) || opts.disableDayFn && opts.disableDayFn(day); - - if (isEmpty) { - if (i < before) { - dayNumber = daysInPreviousMonth + dayNumber; - monthNumber = previousMonth; - yearNumber = yearOfPreviousMonth; - } else { - dayNumber = dayNumber - days; - monthNumber = nextMonth; - yearNumber = yearOfNextMonth; - } - } - - var dayConfig = { - day: dayNumber, - month: monthNumber, - year: yearNumber, - hasEvent: hasEvent, - isSelected: isSelected, - isToday: isToday, - isDisabled: isDisabled, - isEmpty: isEmpty, - isStartRange: isStartRange, - isEndRange: isEndRange, - isInRange: isInRange, - showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths - }; - - row.push(this.renderDay(dayConfig)); - - if (++r === 7) { - data.push(this.renderRow(row, opts.isRTL, isWeekSelected)); - row = []; - r = 0; - isWeekSelected = false; - } - } - return this.renderTable(opts, data, randId); - } - }, { - key: "renderDay", - value: function renderDay(opts) { - var arr = []; - var ariaSelected = 'false'; - if (opts.isEmpty) { - if (opts.showDaysInNextAndPreviousMonths) { - arr.push('is-outside-current-month'); - arr.push('is-selection-disabled'); - } else { - return ''; - } - } - if (opts.isDisabled) { - arr.push('is-disabled'); - } - - if (opts.isToday) { - arr.push('is-today'); - } - if (opts.isSelected) { - arr.push('is-selected'); - ariaSelected = 'true'; - } - if (opts.hasEvent) { - arr.push('has-event'); - } - if (opts.isInRange) { - arr.push('is-inrange'); - } - if (opts.isStartRange) { - arr.push('is-startrange'); - } - if (opts.isEndRange) { - arr.push('is-endrange'); - } - return "" + ("") + ''; - } - }, { - key: "renderRow", - value: function renderRow(days, isRTL, isRowSelected) { - return '' + (isRTL ? days.reverse() : days).join('') + ''; - } - }, { - key: "renderTable", - value: function renderTable(opts, data, randId) { - return '
    ' + this.renderHead(opts) + this.renderBody(data) + '
    '; - } - }, { - key: "renderHead", - value: function renderHead(opts) { - var i = void 0, - arr = []; - for (i = 0; i < 7; i++) { - arr.push("" + this.renderDayName(opts, i, true) + ""); - } - return '' + (opts.isRTL ? arr.reverse() : arr).join('') + ''; - } - }, { - key: "renderBody", - value: function renderBody(rows) { - return '' + rows.join('') + ''; - } - }, { - key: "renderTitle", - value: function renderTitle(instance, c, year, month, refYear, randId) { - var i = void 0, - j = void 0, - arr = void 0, - opts = this.options, - isMinYear = year === opts.minYear, - isMaxYear = year === opts.maxYear, - html = '
    ', - monthHtml = void 0, - yearHtml = void 0, - prev = true, - next = true; - - for (arr = [], i = 0; i < 12; i++) { - arr.push(''); - } - - monthHtml = ''; - - if ($.isArray(opts.yearRange)) { - i = opts.yearRange[0]; - j = opts.yearRange[1] + 1; - } else { - i = year - opts.yearRange; - j = 1 + year + opts.yearRange; - } - - for (arr = []; i < j && i <= opts.maxYear; i++) { - if (i >= opts.minYear) { - arr.push(""); - } - } - if (opts.yearRangeReverse) { - arr.reverse(); - } - - yearHtml = ""; - - var leftArrow = ''; - html += ""; - - html += '
    '; - if (opts.showMonthAfterYear) { - html += yearHtml + monthHtml; - } else { - html += monthHtml + yearHtml; - } - html += '
    '; - - if (isMinYear && (month === 0 || opts.minMonth >= month)) { - prev = false; - } - - if (isMaxYear && (month === 11 || opts.maxMonth <= month)) { - next = false; - } - - var rightArrow = ''; - html += ""; - - return html += '
    '; - } - - /** - * refresh the HTML - */ - - }, { - key: "draw", - value: function draw(force) { - if (!this.isOpen && !force) { - return; - } - var opts = this.options, - minYear = opts.minYear, - maxYear = opts.maxYear, - minMonth = opts.minMonth, - maxMonth = opts.maxMonth, - html = '', - randId = void 0; - - if (this._y <= minYear) { - this._y = minYear; - if (!isNaN(minMonth) && this._m < minMonth) { - this._m = minMonth; - } - } - if (this._y >= maxYear) { - this._y = maxYear; - if (!isNaN(maxMonth) && this._m > maxMonth) { - this._m = maxMonth; - } - } - - randId = 'datepicker-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2); - - for (var c = 0; c < 1; c++) { - this._renderDateDisplay(); - html += this.renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId); - } - - this.destroySelects(); - - this.calendarEl.innerHTML = html; - - // Init Materialize Select - var yearSelect = this.calendarEl.querySelector('.orig-select-year'); - var monthSelect = this.calendarEl.querySelector('.orig-select-month'); - M.FormSelect.init(yearSelect, { - classes: 'select-year', - dropdownOptions: { container: document.body, constrainWidth: false } - }); - M.FormSelect.init(monthSelect, { - classes: 'select-month', - dropdownOptions: { container: document.body, constrainWidth: false } - }); - - // Add change handlers for select - yearSelect.addEventListener('change', this._handleYearChange.bind(this)); - monthSelect.addEventListener('change', this._handleMonthChange.bind(this)); - - if (typeof this.options.onDraw === 'function') { - this.options.onDraw(this); - } - } - - /** - * Setup Event Handlers - */ - - }, { - key: "_setupEventHandlers", - value: function _setupEventHandlers() { - this._handleInputKeydownBound = this._handleInputKeydown.bind(this); - this._handleInputClickBound = this._handleInputClick.bind(this); - this._handleInputChangeBound = this._handleInputChange.bind(this); - this._handleCalendarClickBound = this._handleCalendarClick.bind(this); - this._finishSelectionBound = this._finishSelection.bind(this); - this._handleMonthChange = this._handleMonthChange.bind(this); - this._closeBound = this.close.bind(this); - - this.el.addEventListener('click', this._handleInputClickBound); - this.el.addEventListener('keydown', this._handleInputKeydownBound); - this.el.addEventListener('change', this._handleInputChangeBound); - this.calendarEl.addEventListener('click', this._handleCalendarClickBound); - this.doneBtn.addEventListener('click', this._finishSelectionBound); - this.cancelBtn.addEventListener('click', this._closeBound); - - if (this.options.showClearBtn) { - this._handleClearClickBound = this._handleClearClick.bind(this); - this.clearBtn.addEventListener('click', this._handleClearClickBound); - } - } - }, { - key: "_setupVariables", - value: function _setupVariables() { - var _this56 = this; - - this.$modalEl = $(Datepicker._template); - this.modalEl = this.$modalEl[0]; - - this.calendarEl = this.modalEl.querySelector('.datepicker-calendar'); - - this.yearTextEl = this.modalEl.querySelector('.year-text'); - this.dateTextEl = this.modalEl.querySelector('.date-text'); - if (this.options.showClearBtn) { - this.clearBtn = this.modalEl.querySelector('.datepicker-clear'); - } - this.doneBtn = this.modalEl.querySelector('.datepicker-done'); - this.cancelBtn = this.modalEl.querySelector('.datepicker-cancel'); - - this.formats = { - d: function () { - return _this56.date.getDate(); - }, - dd: function () { - var d = _this56.date.getDate(); - return (d < 10 ? '0' : '') + d; - }, - ddd: function () { - return _this56.options.i18n.weekdaysShort[_this56.date.getDay()]; - }, - dddd: function () { - return _this56.options.i18n.weekdays[_this56.date.getDay()]; - }, - m: function () { - return _this56.date.getMonth() + 1; - }, - mm: function () { - var m = _this56.date.getMonth() + 1; - return (m < 10 ? '0' : '') + m; - }, - mmm: function () { - return _this56.options.i18n.monthsShort[_this56.date.getMonth()]; - }, - mmmm: function () { - return _this56.options.i18n.months[_this56.date.getMonth()]; - }, - yy: function () { - return ('' + _this56.date.getFullYear()).slice(2); - }, - yyyy: function () { - return _this56.date.getFullYear(); - } + onClose: null +}; +class TapTarget extends component_1.Component { + constructor(el, options) { + super(el, options, TapTarget); + this._handleThrottledResize = utils_1.Utils.throttle(function () { this._handleResize(); }, 200).bind(this); + this._handleTargetClick = () => { + this.open(); }; - } - - /** - * Remove Event Handlers - */ - - }, { - key: "_removeEventHandlers", - value: function _removeEventHandlers() { - this.el.removeEventListener('click', this._handleInputClickBound); - this.el.removeEventListener('keydown', this._handleInputKeydownBound); - this.el.removeEventListener('change', this._handleInputChangeBound); - this.calendarEl.removeEventListener('click', this._handleCalendarClickBound); - } - }, { - key: "_handleInputClick", - value: function _handleInputClick() { - this.open(); - } - }, { - key: "_handleInputKeydown", - value: function _handleInputKeydown(e) { - if (e.which === M.keys.ENTER) { - e.preventDefault(); - this.open(); - } - } - }, { - key: "_handleCalendarClick", - value: function _handleCalendarClick(e) { - if (!this.isOpen) { - return; - } - - var $target = $(e.target); - if (!$target.hasClass('is-disabled')) { - if ($target.hasClass('datepicker-day-button') && !$target.hasClass('is-empty') && !$target.parent().hasClass('is-disabled')) { - this.setDate(new Date(e.target.getAttribute('data-year'), e.target.getAttribute('data-month'), e.target.getAttribute('data-day'))); - if (this.options.autoClose) { - this._finishSelection(); + this._handleOriginClick = () => { + this.close(); + }; + this._handleResize = () => { + this._calculatePositioning(); + }; + this._handleDocumentClick = (e) => { + if (!e.target.closest('.tap-target-wrapper')) { + this.close(); + e.preventDefault(); + e.stopPropagation(); } - } else if ($target.closest('.month-prev').length) { - this.prevMonth(); - } else if ($target.closest('.month-next').length) { - this.nextMonth(); - } - } - } - }, { - key: "_handleClearClick", - value: function _handleClearClick() { - this.date = null; - this.setInputValue(); - this.close(); - } - }, { - key: "_handleMonthChange", - value: function _handleMonthChange(e) { - this.gotoMonth(e.target.value); - } - }, { - key: "_handleYearChange", - value: function _handleYearChange(e) { - this.gotoYear(e.target.value); - } - - /** - * change view to a specific month (zero-index, e.g. 0: January) - */ - - }, { - key: "gotoMonth", - value: function gotoMonth(month) { - if (!isNaN(month)) { - this.calendars[0].month = parseInt(month, 10); - this.adjustCalendars(); - } - } - - /** - * change view to a specific full year (e.g. "2012") - */ - - }, { - key: "gotoYear", - value: function gotoYear(year) { - if (!isNaN(year)) { - this.calendars[0].year = parseInt(year, 10); - this.adjustCalendars(); - } - } - }, { - key: "_handleInputChange", - value: function _handleInputChange(e) { - var date = void 0; - - // Prevent change event from being fired when triggered by the plugin - if (e.firedBy === this) { - return; - } - if (this.options.parse) { - date = this.options.parse(this.el.value, this.options.format); - } else { - date = new Date(Date.parse(this.el.value)); - } - - if (Datepicker._isDate(date)) { - this.setDate(date); - } - } - }, { - key: "renderDayName", - value: function renderDayName(opts, day, abbr) { - day += opts.firstDay; - while (day >= 7) { - day -= 7; - } - return abbr ? opts.i18n.weekdaysAbbrev[day] : opts.i18n.weekdays[day]; - } - - /** - * Set input value to the selected date and close Datepicker - */ - - }, { - key: "_finishSelection", - value: function _finishSelection() { - this.setInputValue(); - this.close(); - } - - /** - * Open Datepicker - */ - - }, { - key: "open", - value: function open() { - if (this.isOpen) { - return; - } - - this.isOpen = true; - if (typeof this.options.onOpen === 'function') { - this.options.onOpen.call(this); - } - this.draw(); - this.modal.open(); - return this; - } - - /** - * Close Datepicker - */ - - }, { - key: "close", - value: function close() { - if (!this.isOpen) { - return; - } - + }; + /** + * Open Tap Target. + */ + this.open = () => { + if (this.isOpen) + return; + // onOpen callback + if (typeof this.options.onOpen === 'function') { + this.options.onOpen.call(this, this._origin); + } + this.isOpen = true; + this.wrapper.classList.add('open'); + document.body.addEventListener('click', this._handleDocumentClick, true); + document.body.addEventListener('touchend', this._handleDocumentClick); + }; + /** + * Close Tap Target. + */ + this.close = () => { + if (!this.isOpen) + return; + // onClose callback + if (typeof this.options.onClose === 'function') { + this.options.onClose.call(this, this._origin); + } + this.isOpen = false; + this.wrapper.classList.remove('open'); + document.body.removeEventListener('click', this._handleDocumentClick, true); + document.body.removeEventListener('touchend', this._handleDocumentClick); + }; + this.el.M_TapTarget = this; + this.options = Object.assign(Object.assign({}, TapTarget.defaults), options); this.isOpen = false; - if (typeof this.options.onClose === 'function') { - this.options.onClose.call(this); - } - this.modal.close(); - return this; - } - }], [{ - key: "init", - value: function init(els, options) { - return _get(Datepicker.__proto__ || Object.getPrototypeOf(Datepicker), "init", this).call(this, this, els, options); - } - }, { - key: "_isDate", - value: function _isDate(obj) { - return (/Date/.test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime()) - ); - } - }, { - key: "_isWeekend", - value: function _isWeekend(date) { - var day = date.getDay(); - return day === 0 || day === 6; - } - }, { - key: "_setToStartOfDay", - value: function _setToStartOfDay(date) { - if (Datepicker._isDate(date)) date.setHours(0, 0, 0, 0); - } - }, { - key: "_getDaysInMonth", - value: function _getDaysInMonth(year, month) { - return [31, Datepicker._isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; - } - }, { - key: "_isLeapYear", - value: function _isLeapYear(year) { - // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951 - return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; - } - }, { - key: "_compareDates", - value: function _compareDates(a, b) { - // weak date comparison (use setToStartOfDay(date) to ensure correct result) - return a.getTime() === b.getTime(); - } - }, { - key: "_setToStartOfDay", - value: function _setToStartOfDay(date) { - if (Datepicker._isDate(date)) date.setHours(0, 0, 0, 0); - } - - /** - * Get Instance - */ - - }, { - key: "getInstance", - value: function getInstance(el) { - var domElem = !!el.jquery ? el[0] : el; - return domElem.M_Datepicker; - } - }, { - key: "defaults", - get: function () { + // setup + this._origin = document.querySelector(`#${el.dataset.target}`); + this._setup(); + this._calculatePositioning(); + this._setupEventHandlers(); + } + static get defaults() { return _defaults; - } - }]); + } + /** + * Initializes instances of TapTarget. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, TapTarget); + } + static getInstance(el) { + return el.M_TapTarget; + } + destroy() { + this._removeEventHandlers(); + this.el.TapTarget = undefined; + } + _setupEventHandlers() { + this.el.addEventListener('click', this._handleTargetClick); + this.originEl.addEventListener('click', this._handleOriginClick); + // Resize + window.addEventListener('resize', this._handleThrottledResize); + } + _removeEventHandlers() { + this.el.removeEventListener('click', this._handleTargetClick); + this.originEl.removeEventListener('click', this._handleOriginClick); + window.removeEventListener('resize', this._handleThrottledResize); + } + _setup() { + // Creating tap target + this.wrapper = this.el.parentElement; + this.waveEl = this.wrapper.querySelector('.tap-target-wave'); + this.originEl = this.wrapper.querySelector('.tap-target-origin'); + this.contentEl = this.el.querySelector('.tap-target-content'); + // Creating wrapper + if (!this.wrapper.classList.contains('.tap-target-wrapper')) { + this.wrapper = document.createElement('div'); + this.wrapper.classList.add('tap-target-wrapper'); + this.el.before(this.wrapper); + this.wrapper.append(this.el); + } + // Creating content + if (!this.contentEl) { + this.contentEl = document.createElement('div'); + this.contentEl.classList.add('tap-target-content'); + this.el.append(this.contentEl); + } + // Creating foreground wave + if (!this.waveEl) { + this.waveEl = document.createElement('div'); + this.waveEl.classList.add('tap-target-wave'); + // Creating origin + if (!this.originEl) { + this.originEl = this._origin.cloneNode(true); // .clone(true, true); + this.originEl.classList.add('tap-target-origin'); + this.originEl.removeAttribute('id'); + this.originEl.removeAttribute('style'); + this.waveEl.append(this.originEl); + } + this.wrapper.append(this.waveEl); + } + } + _offset(el) { + const box = el.getBoundingClientRect(); + const docElem = document.documentElement; + return { + top: box.top + window.pageYOffset - docElem.clientTop, + left: box.left + window.pageXOffset - docElem.clientLeft + }; + } + _calculatePositioning() { + // Element or parent is fixed position? + let isFixed = getComputedStyle(this._origin).position === 'fixed'; + if (!isFixed) { + let currentElem = this._origin; + const parents = []; + while ((currentElem = currentElem.parentNode) && currentElem !== document) + parents.push(currentElem); + for (let i = 0; i < parents.length; i++) { + isFixed = getComputedStyle(parents[i]).position === 'fixed'; + if (isFixed) + break; + } + } + // Calculating origin + const originWidth = this._origin.offsetWidth; + const originHeight = this._origin.offsetHeight; + const originTop = isFixed ? this._offset(this._origin).top - utils_1.Utils.getDocumentScrollTop() : this._offset(this._origin).top; + const originLeft = isFixed ? this._offset(this._origin).left - utils_1.Utils.getDocumentScrollLeft() : this._offset(this._origin).left; + // Calculating screen + const windowWidth = window.innerWidth; + const windowHeight = window.innerHeight; + const scrollBarWidth = windowWidth - document.documentElement.clientWidth; + const centerX = windowWidth / 2; + const centerY = windowHeight / 2; + const isLeft = originLeft <= centerX; + const isRight = originLeft > centerX; + const isTop = originTop <= centerY; + const isBottom = originTop > centerY; + const isCenterX = originLeft >= windowWidth * 0.25 && originLeft <= windowWidth * 0.75; + // Calculating tap target + const tapTargetWidth = this.el.offsetWidth; + const tapTargetHeight = this.el.offsetHeight; + const tapTargetTop = originTop + originHeight / 2 - tapTargetHeight / 2; + const tapTargetLeft = originLeft + originWidth / 2 - tapTargetWidth / 2; + const tapTargetPosition = isFixed ? 'fixed' : 'absolute'; + // Calculating content + const tapTargetTextWidth = isCenterX ? tapTargetWidth : tapTargetWidth / 2 + originWidth; + const tapTargetTextHeight = tapTargetHeight / 2; + const tapTargetTextTop = isTop ? tapTargetHeight / 2 : 0; + const tapTargetTextBottom = 0; + const tapTargetTextLeft = isLeft && !isCenterX ? tapTargetWidth / 2 - originWidth : 0; + const tapTargetTextRight = 0; + const tapTargetTextPadding = originWidth; + const tapTargetTextAlign = isBottom ? 'bottom' : 'top'; + // Calculating wave + const tapTargetWaveWidth = originWidth > originHeight ? originWidth * 2 : originWidth * 2; + const tapTargetWaveHeight = tapTargetWaveWidth; + const tapTargetWaveTop = tapTargetHeight / 2 - tapTargetWaveHeight / 2; + const tapTargetWaveLeft = tapTargetWidth / 2 - tapTargetWaveWidth / 2; + // Setting tap target + this.wrapper.style.top = isTop ? tapTargetTop + 'px' : ''; + this.wrapper.style.right = isRight ? windowWidth - tapTargetLeft - tapTargetWidth - scrollBarWidth + 'px' : ''; + this.wrapper.style.bottom = isBottom ? windowHeight - tapTargetTop - tapTargetHeight + 'px' : ''; + this.wrapper.style.left = isLeft ? tapTargetLeft + 'px' : ''; + this.wrapper.style.position = tapTargetPosition; + // Setting content + this.contentEl.style.width = tapTargetTextWidth + 'px'; + this.contentEl.style.height = tapTargetTextHeight + 'px'; + this.contentEl.style.top = tapTargetTextTop + 'px'; + this.contentEl.style.right = tapTargetTextRight + 'px'; + this.contentEl.style.bottom = tapTargetTextBottom + 'px'; + this.contentEl.style.left = tapTargetTextLeft + 'px'; + this.contentEl.style.padding = tapTargetTextPadding + 'px'; + this.contentEl.style.verticalAlign = tapTargetTextAlign; + // Setting wave + this.waveEl.style.top = tapTargetWaveTop + 'px'; + this.waveEl.style.left = tapTargetWaveLeft + 'px'; + this.waveEl.style.width = tapTargetWaveWidth + 'px'; + this.waveEl.style.height = tapTargetWaveHeight + 'px'; + } +} +exports.TapTarget = TapTarget; - return Datepicker; - }(Component); - Datepicker._template = [''].join(''); +/***/ }), - M.Datepicker = Datepicker; +/***/ "./src/timepicker.ts": +/*!***************************!*\ + !*** ./src/timepicker.ts ***! + \***************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - if (M.jQueryLoaded) { - M.initializeJqueryWrapper(Datepicker, 'datepicker', 'M_Datepicker'); - } -})(cash); -;(function ($) { - 'use strict'; - var _defaults = { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Timepicker = void 0; +const modal_1 = __webpack_require__(/*! ./modal */ "./src/modal.ts"); +const utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts"); +const component_1 = __webpack_require__(/*! ./component */ "./src/component.ts"); +let _defaults = { dialRadius: 135, outerRadius: 105, innerRadius: 70, @@ -10057,2735 +6176,1539 @@ $jscomp.polyfill = function (e, r, p, m) { defaultTime: 'now', // default time, 'now' or '13:14' e.g. fromNow: 0, // Millisecond offset from the defaultTime showClearBtn: false, - // internationalization i18n: { - cancel: 'Cancel', - clear: 'Clear', - done: 'Ok' + cancel: 'Cancel', + clear: 'Clear', + done: 'Ok' }, - autoClose: false, // auto close when minute is selected twelveHour: true, // change to 12 hour AM/PM clock from 24 hour vibrate: true, // vibrate the device when dragging clock hand - // Callbacks onOpenStart: null, onOpenEnd: null, onCloseStart: null, onCloseEnd: null, onSelect: null - }; - - /** - * @class - * - */ - - var Timepicker = function (_Component16) { - _inherits(Timepicker, _Component16); - - function Timepicker(el, options) { - _classCallCheck(this, Timepicker); - - var _this57 = _possibleConstructorReturn(this, (Timepicker.__proto__ || Object.getPrototypeOf(Timepicker)).call(this, Timepicker, el, options)); - - _this57.el.M_Timepicker = _this57; - - _this57.options = $.extend({}, Timepicker.defaults, options); - - _this57.id = M.guid(); - _this57._insertHTMLIntoDOM(); - _this57._setupModal(); - _this57._setupVariables(); - _this57._setupEventHandlers(); - - _this57._clockSetup(); - _this57._pickerSetup(); - return _this57; +}; +class Timepicker extends component_1.Component { + constructor(el, options) { + super(el, options, Timepicker); + this._handleInputClick = () => { + this.open(); + }; + this._handleInputKeydown = (e) => { + if (utils_1.Utils.keys.ENTER.includes(e.key)) { + e.preventDefault(); + this.open(); + } + }; + this._handleTimeInputEnterKey = (e) => { + if (utils_1.Utils.keys.ENTER.includes(e.key)) { + e.preventDefault(); + this._inputFromTextField(); + } + }; + this._handleClockClickStart = (e) => { + e.preventDefault(); + let clockPlateBR = this.plate.getBoundingClientRect(); + let offset = { x: clockPlateBR.left, y: clockPlateBR.top }; + this.x0 = offset.x + this.options.dialRadius; + this.y0 = offset.y + this.options.dialRadius; + this.moved = false; + let clickPos = Timepicker._Pos(e); + this.dx = clickPos.x - this.x0; + this.dy = clickPos.y - this.y0; + // Set clock hands + this.setHand(this.dx, this.dy, false); + // Mousemove on document + document.addEventListener('mousemove', this._handleDocumentClickMove); + document.addEventListener('touchmove', this._handleDocumentClickMove); + // Mouseup on document + document.addEventListener('mouseup', this._handleDocumentClickEnd); + document.addEventListener('touchend', this._handleDocumentClickEnd); + }; + this._handleDocumentClickMove = (e) => { + e.preventDefault(); + let clickPos = Timepicker._Pos(e); + let x = clickPos.x - this.x0; + let y = clickPos.y - this.y0; + this.moved = true; + this.setHand(x, y, false); + }; + this._handleDocumentClickEnd = (e) => { + e.preventDefault(); + document.removeEventListener('mouseup', this._handleDocumentClickEnd); + document.removeEventListener('touchend', this._handleDocumentClickEnd); + let clickPos = Timepicker._Pos(e); + let x = clickPos.x - this.x0; + let y = clickPos.y - this.y0; + if (this.moved && x === this.dx && y === this.dy) { + this.setHand(x, y); + } + if (this.currentView === 'hours') { + this.showView('minutes', this.options.duration / 2); + } + else if (this.options.autoClose) { + this.minutesView.classList.add('timepicker-dial-out'); + setTimeout(() => { + this.done(); + }, this.options.duration / 2); + } + if (typeof this.options.onSelect === 'function') { + this.options.onSelect.call(this, this.hours, this.minutes); + } + // Unbind mousemove event + document.removeEventListener('mousemove', this._handleDocumentClickMove); + document.removeEventListener('touchmove', this._handleDocumentClickMove); + }; + this._handleAmPmClick = (e) => { + const btnClicked = e.target; + this.amOrPm = btnClicked.classList.contains('am-btn') ? 'AM' : 'PM'; + this._updateAmPmView(); + }; + /** + * Show hours or minutes view on timepicker. + * @param view The name of the view you want to switch to, 'hours' or 'minutes'. + */ + this.showView = (view, delay = null) => { + if (view === 'minutes' && getComputedStyle(this.hoursView).visibility === 'visible') { + // raiseCallback(this.options.beforeHourSelect); + } + let isHours = view === 'hours', nextView = isHours ? this.hoursView : this.minutesView, hideView = isHours ? this.minutesView : this.hoursView; + this.currentView = view; + if (isHours) { + this.inputHours.classList.add('text-primary'); + this.inputMinutes.classList.remove('text-primary'); + } + else { + this.inputHours.classList.remove('text-primary'); + this.inputMinutes.classList.add('text-primary'); + } + // Transition view + hideView.classList.add('timepicker-dial-out'); + nextView.style.visibility = 'visible'; + nextView.classList.remove('timepicker-dial-out'); + // Reset clock hand + this.resetClock(delay); + // After transitions ended + clearTimeout(this.toggleViewTimer); + this.toggleViewTimer = setTimeout(() => { + hideView.style.visibility = 'hidden'; + }, this.options.duration); + }; + this._inputFromTextField = () => { + const isHours = this.currentView === 'hours'; + if (isHours) { + const value = parseInt(this.inputHours.value); + if (value > 0 && value < 13) { + this.drawClockFromTimeInput(value, isHours); + this.showView('minutes', this.options.duration / 2); + this.hours = value; + this.inputMinutes.focus(); + } + else { + const hour = new Date().getHours(); + this.inputHours.value = (hour % 12).toString(); + } + } + else { + const value = parseInt(this.inputMinutes.value); + if (value >= 0 && value < 60) { + this.inputMinutes.value = Timepicker._addLeadingZero(value); + this.drawClockFromTimeInput(value, isHours); + this.minutes = value; + this.modalEl.querySelector('.confirmation-btns :nth-child(2)').focus(); + } + else { + const minutes = new Date().getMinutes(); + this.inputMinutes.value = Timepicker._addLeadingZero(minutes); + } + } + }; + /** + * Open timepicker. + */ + this.open = () => { + if (this.isOpen) + return; + this.isOpen = true; + this._updateTimeFromInput(); + this.showView('hours'); + this.modal.open(undefined); + }; + /** + * Close timepicker. + */ + this.close = () => { + if (!this.isOpen) + return; + this.isOpen = false; + this.modal.close(); + }; + this.done = (e = null, clearValue = null) => { + // Set input value + let last = this.el.value; + let value = clearValue + ? '' + : Timepicker._addLeadingZero(this.hours) + ':' + Timepicker._addLeadingZero(this.minutes); + this.time = value; + if (!clearValue && this.options.twelveHour) { + value = `${value} ${this.amOrPm}`; + } + this.el.value = value; + // Trigger change event + if (value !== last) { + this.el.dispatchEvent(new Event('change', { bubbles: true, cancelable: true, composed: true })); + } + this.close(); + this.el.focus(); + }; + this.clear = () => { + this.done(null, true); + }; + this.el.M_Timepicker = this; + this.options = Object.assign(Object.assign({}, Timepicker.defaults), options); + this.id = utils_1.Utils.guid(); + this._insertHTMLIntoDOM(); + this._setupModal(); + this._setupVariables(); + this._setupEventHandlers(); + this._clockSetup(); + this._pickerSetup(); } - - _createClass(Timepicker, [{ - key: "destroy", - - - /** - * Teardown component - */ - value: function destroy() { + static get defaults() { + return _defaults; + } + /** + * Initializes instances of Timepicker. + * @param els HTML elements. + * @param options Component options. + */ + static init(els, options = {}) { + return super.init(els, options, Timepicker); + } + static _addLeadingZero(num) { + return (num < 10 ? '0' : '') + num; + } + static _createSVGEl(name) { + let svgNS = 'http://www.w3.org/2000/svg'; + return document.createElementNS(svgNS, name); + } + static _Pos(e) { + if (e.type.startsWith("touch") && e.targetTouches.length >= 1) { + return { x: e.targetTouches[0].clientX, y: e.targetTouches[0].clientY }; + } + // mouse event + return { x: e.clientX, y: e.clientY }; + } + static getInstance(el) { + return el.M_Timepicker; + } + destroy() { this._removeEventHandlers(); this.modal.destroy(); - $(this.modalEl).remove(); + this.modalEl.remove(); this.el.M_Timepicker = undefined; - } - - /** - * Setup Event Handlers - */ - - }, { - key: "_setupEventHandlers", - value: function _setupEventHandlers() { - this._handleInputKeydownBound = this._handleInputKeydown.bind(this); - this._handleInputClickBound = this._handleInputClick.bind(this); - this._handleClockClickStartBound = this._handleClockClickStart.bind(this); - this._handleDocumentClickMoveBound = this._handleDocumentClickMove.bind(this); - this._handleDocumentClickEndBound = this._handleDocumentClickEnd.bind(this); - - this.el.addEventListener('click', this._handleInputClickBound); - this.el.addEventListener('keydown', this._handleInputKeydownBound); - this.plate.addEventListener('mousedown', this._handleClockClickStartBound); - this.plate.addEventListener('touchstart', this._handleClockClickStartBound); - - $(this.spanHours).on('click', this.showView.bind(this, 'hours')); - $(this.spanMinutes).on('click', this.showView.bind(this, 'minutes')); - } - }, { - key: "_removeEventHandlers", - value: function _removeEventHandlers() { - this.el.removeEventListener('click', this._handleInputClickBound); - this.el.removeEventListener('keydown', this._handleInputKeydownBound); - } - }, { - key: "_handleInputClick", - value: function _handleInputClick() { - this.open(); - } - }, { - key: "_handleInputKeydown", - value: function _handleInputKeydown(e) { - if (e.which === M.keys.ENTER) { - e.preventDefault(); - this.open(); - } - } - }, { - key: "_handleClockClickStart", - value: function _handleClockClickStart(e) { - e.preventDefault(); - var clockPlateBR = this.plate.getBoundingClientRect(); - var offset = { x: clockPlateBR.left, y: clockPlateBR.top }; - - this.x0 = offset.x + this.options.dialRadius; - this.y0 = offset.y + this.options.dialRadius; - this.moved = false; - var clickPos = Timepicker._Pos(e); - this.dx = clickPos.x - this.x0; - this.dy = clickPos.y - this.y0; - - // Set clock hands - this.setHand(this.dx, this.dy, false); - - // Mousemove on document - document.addEventListener('mousemove', this._handleDocumentClickMoveBound); - document.addEventListener('touchmove', this._handleDocumentClickMoveBound); - - // Mouseup on document - document.addEventListener('mouseup', this._handleDocumentClickEndBound); - document.addEventListener('touchend', this._handleDocumentClickEndBound); - } - }, { - key: "_handleDocumentClickMove", - value: function _handleDocumentClickMove(e) { - e.preventDefault(); - var clickPos = Timepicker._Pos(e); - var x = clickPos.x - this.x0; - var y = clickPos.y - this.y0; - this.moved = true; - this.setHand(x, y, false, true); - } - }, { - key: "_handleDocumentClickEnd", - value: function _handleDocumentClickEnd(e) { - var _this58 = this; - - e.preventDefault(); - document.removeEventListener('mouseup', this._handleDocumentClickEndBound); - document.removeEventListener('touchend', this._handleDocumentClickEndBound); - var clickPos = Timepicker._Pos(e); - var x = clickPos.x - this.x0; - var y = clickPos.y - this.y0; - if (this.moved && x === this.dx && y === this.dy) { - this.setHand(x, y); - } - - if (this.currentView === 'hours') { - this.showView('minutes', this.options.duration / 2); - } else if (this.options.autoClose) { - $(this.minutesView).addClass('timepicker-dial-out'); - setTimeout(function () { - _this58.done(); - }, this.options.duration / 2); - } - - if (typeof this.options.onSelect === 'function') { - this.options.onSelect.call(this, this.hours, this.minutes); - } - - // Unbind mousemove event - document.removeEventListener('mousemove', this._handleDocumentClickMoveBound); - document.removeEventListener('touchmove', this._handleDocumentClickMoveBound); - } - }, { - key: "_insertHTMLIntoDOM", - value: function _insertHTMLIntoDOM() { - this.$modalEl = $(Timepicker._template); - this.modalEl = this.$modalEl[0]; + } + _setupEventHandlers() { + this.el.addEventListener('click', this._handleInputClick); + this.el.addEventListener('keydown', this._handleInputKeydown); + this.plate.addEventListener('mousedown', this._handleClockClickStart); + this.plate.addEventListener('touchstart', this._handleClockClickStart); + this.digitalClock.addEventListener('keyup', this._inputFromTextField); + this.inputHours.addEventListener('click', () => this.showView('hours')); + this.inputMinutes.addEventListener('click', () => this.showView('minutes')); + } + _removeEventHandlers() { + this.el.removeEventListener('click', this._handleInputClick); + this.el.removeEventListener('keydown', this._handleInputKeydown); + } + _insertHTMLIntoDOM() { + const template = document.createElement('template'); + template.innerHTML = Timepicker._template.trim(); + this.modalEl = template.content.firstChild; this.modalEl.id = 'modal-' + this.id; - // Append popover to input by default - var containerEl = document.querySelector(this.options.container); + const optEl = this.options.container; + const containerEl = optEl instanceof HTMLElement ? optEl : document.querySelector(optEl); if (this.options.container && !!containerEl) { - this.$modalEl.appendTo(containerEl); - } else { - this.$modalEl.insertBefore(this.el); + containerEl.append(this.modalEl); } - } - }, { - key: "_setupModal", - value: function _setupModal() { - var _this59 = this; - - this.modal = M.Modal.init(this.modalEl, { - onOpenStart: this.options.onOpenStart, - onOpenEnd: this.options.onOpenEnd, - onCloseStart: this.options.onCloseStart, - onCloseEnd: function () { - if (typeof _this59.options.onCloseEnd === 'function') { - _this59.options.onCloseEnd.call(_this59); + else { + this.el.parentElement.appendChild(this.modalEl); + } + } + _setupModal() { + this.modal = modal_1.Modal.init(this.modalEl, { + onOpenStart: this.options.onOpenStart, + onOpenEnd: this.options.onOpenEnd, + onCloseStart: this.options.onCloseStart, + onCloseEnd: () => { + if (typeof this.options.onCloseEnd === 'function') { + this.options.onCloseEnd.call(this); + } + this.isOpen = false; } - _this59.isOpen = false; - } }); - } - }, { - key: "_setupVariables", - value: function _setupVariables() { + } + _setupVariables() { this.currentView = 'hours'; - this.vibrate = navigator.vibrate ? 'vibrate' : navigator.webkitVibrate ? 'webkitVibrate' : null; - + this.vibrate = navigator.vibrate + ? 'vibrate' + : navigator.webkitVibrate + ? 'webkitVibrate' + : null; this._canvas = this.modalEl.querySelector('.timepicker-canvas'); this.plate = this.modalEl.querySelector('.timepicker-plate'); - + this.digitalClock = this.modalEl.querySelector('.timepicker-display-column'); this.hoursView = this.modalEl.querySelector('.timepicker-hours'); this.minutesView = this.modalEl.querySelector('.timepicker-minutes'); - this.spanHours = this.modalEl.querySelector('.timepicker-span-hours'); - this.spanMinutes = this.modalEl.querySelector('.timepicker-span-minutes'); + this.inputHours = this.modalEl.querySelector('.timepicker-input-hours'); + this.inputMinutes = this.modalEl.querySelector('.timepicker-input-minutes'); this.spanAmPm = this.modalEl.querySelector('.timepicker-span-am-pm'); this.footer = this.modalEl.querySelector('.timepicker-footer'); this.amOrPm = 'PM'; - } - }, { - key: "_pickerSetup", - value: function _pickerSetup() { - var $clearBtn = $("").appendTo(this.footer).on('click', this.clear.bind(this)); - if (this.options.showClearBtn) { - $clearBtn.css({ visibility: '' }); - } - - var confirmationBtnsContainer = $('
    '); - $('').appendTo(confirmationBtnsContainer).on('click', this.close.bind(this)); - $('').appendTo(confirmationBtnsContainer).on('click', this.done.bind(this)); - confirmationBtnsContainer.appendTo(this.footer); - } - }, { - key: "_clockSetup", - value: function _clockSetup() { + } + _createButton(text, visibility) { + const button = document.createElement('button'); + button.classList.add('btn-flat', 'waves-effect'); + button.style.visibility = visibility; + button.type = 'button'; + button.tabIndex = this.options.twelveHour ? 3 : 1; + button.innerText = text; + return button; + } + _pickerSetup() { + const clearButton = this._createButton(this.options.i18n.clear, this.options.showClearBtn ? '' : 'hidden'); + clearButton.classList.add('timepicker-clear'); + clearButton.addEventListener('click', this.clear); + this.footer.appendChild(clearButton); + const confirmationBtnsContainer = document.createElement('div'); + confirmationBtnsContainer.classList.add('confirmation-btns'); + this.footer.append(confirmationBtnsContainer); + const cancelButton = this._createButton(this.options.i18n.cancel, ''); + cancelButton.classList.add('timepicker-close'); + cancelButton.addEventListener('click', this.close); + confirmationBtnsContainer.appendChild(cancelButton); + const doneButton = this._createButton(this.options.i18n.done, ''); + doneButton.classList.add('timepicker-close'); + doneButton.addEventListener('click', this.done); + confirmationBtnsContainer.appendChild(doneButton); + } + _clockSetup() { if (this.options.twelveHour) { - this.$amBtn = $('
    AM
    '); - this.$pmBtn = $('
    PM
    '); - this.$amBtn.on('click', this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm); - this.$pmBtn.on('click', this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm); + // AM Button + this._amBtn = document.createElement('div'); + this._amBtn.classList.add('am-btn'); + this._amBtn.innerText = 'AM'; + this._amBtn.addEventListener('click', this._handleAmPmClick); + this.spanAmPm.appendChild(this._amBtn); + // PM Button + this._pmBtn = document.createElement('div'); + this._pmBtn.classList.add('pm-btn'); + this._pmBtn.innerText = 'PM'; + this._pmBtn.addEventListener('click', this._handleAmPmClick); + this.spanAmPm.appendChild(this._pmBtn); } - this._buildHoursView(); this._buildMinutesView(); this._buildSVGClock(); - } - }, { - key: "_buildSVGClock", - value: function _buildSVGClock() { + } + _buildSVGClock() { // Draw clock hands and others - var dialRadius = this.options.dialRadius; - var tickRadius = this.options.tickRadius; - var diameter = dialRadius * 2; - - var svg = Timepicker._createSVGEl('svg'); + let dialRadius = this.options.dialRadius; + let tickRadius = this.options.tickRadius; + let diameter = dialRadius * 2; + let svg = Timepicker._createSVGEl('svg'); svg.setAttribute('class', 'timepicker-svg'); - svg.setAttribute('width', diameter); - svg.setAttribute('height', diameter); - var g = Timepicker._createSVGEl('g'); + svg.setAttribute('width', diameter.toString()); + svg.setAttribute('height', diameter.toString()); + let g = Timepicker._createSVGEl('g'); g.setAttribute('transform', 'translate(' + dialRadius + ',' + dialRadius + ')'); - var bearing = Timepicker._createSVGEl('circle'); + let bearing = Timepicker._createSVGEl('circle'); bearing.setAttribute('class', 'timepicker-canvas-bearing'); - bearing.setAttribute('cx', 0); - bearing.setAttribute('cy', 0); - bearing.setAttribute('r', 4); - var hand = Timepicker._createSVGEl('line'); - hand.setAttribute('x1', 0); - hand.setAttribute('y1', 0); - var bg = Timepicker._createSVGEl('circle'); + bearing.setAttribute('cx', '0'); + bearing.setAttribute('cy', '0'); + bearing.setAttribute('r', '4'); + let hand = Timepicker._createSVGEl('line'); + hand.setAttribute('x1', '0'); + hand.setAttribute('y1', '0'); + let bg = Timepicker._createSVGEl('circle'); bg.setAttribute('class', 'timepicker-canvas-bg'); - bg.setAttribute('r', tickRadius); + bg.setAttribute('r', tickRadius.toString()); g.appendChild(hand); g.appendChild(bg); g.appendChild(bearing); svg.appendChild(g); this._canvas.appendChild(svg); - this.hand = hand; this.bg = bg; this.bearing = bearing; this.g = g; - } - }, { - key: "_buildHoursView", - value: function _buildHoursView() { - var $tick = $('
    '); + } + _buildHoursView() { + const $tick = document.createElement('div'); + $tick.classList.add('timepicker-tick'); // Hours view if (this.options.twelveHour) { - for (var i = 1; i < 13; i += 1) { - var tick = $tick.clone(); - var radian = i / 6 * Math.PI; - var radius = this.options.outerRadius; - tick.css({ - left: this.options.dialRadius + Math.sin(radian) * radius - this.options.tickRadius + 'px', - top: this.options.dialRadius - Math.cos(radian) * radius - this.options.tickRadius + 'px' - }); - tick.html(i === 0 ? '00' : i); - this.hoursView.appendChild(tick[0]); - // tick.on(mousedownEvent, mousedown); - } - } else { - for (var _i2 = 0; _i2 < 24; _i2 += 1) { - var _tick = $tick.clone(); - var _radian = _i2 / 6 * Math.PI; - var inner = _i2 > 0 && _i2 < 13; - var _radius = inner ? this.options.innerRadius : this.options.outerRadius; - _tick.css({ - left: this.options.dialRadius + Math.sin(_radian) * _radius - this.options.tickRadius + 'px', - top: this.options.dialRadius - Math.cos(_radian) * _radius - this.options.tickRadius + 'px' - }); - _tick.html(_i2 === 0 ? '00' : _i2); - this.hoursView.appendChild(_tick[0]); - // tick.on(mousedownEvent, mousedown); - } + for (let i = 1; i < 13; i += 1) { + const tick = $tick.cloneNode(true); + const radian = (i / 6) * Math.PI; + const radius = this.options.outerRadius; + tick.style.left = this.options.dialRadius + Math.sin(radian) * radius - this.options.tickRadius + 'px'; + tick.style.top = this.options.dialRadius - Math.cos(radian) * radius - this.options.tickRadius + 'px'; + tick.innerHTML = i === 0 ? '00' : i.toString(); + this.hoursView.appendChild(tick); + // tick.on(mousedownEvent, mousedown); + } } - } - }, { - key: "_buildMinutesView", - value: function _buildMinutesView() { - var $tick = $('
    '); + else { + for (let i = 0; i < 24; i += 1) { + const tick = $tick.cloneNode(true); + const radian = (i / 6) * Math.PI; + const inner = i > 0 && i < 13; + const radius = inner ? this.options.innerRadius : this.options.outerRadius; + tick.style.left = this.options.dialRadius + Math.sin(radian) * radius - this.options.tickRadius + 'px'; + tick.style.top = this.options.dialRadius - Math.cos(radian) * radius - this.options.tickRadius + 'px'; + tick.innerHTML = i === 0 ? '00' : i.toString(); + this.hoursView.appendChild(tick); + // tick.on(mousedownEvent, mousedown); + } + } + } + _buildMinutesView() { + const _tick = document.createElement('div'); + _tick.classList.add('timepicker-tick'); // Minutes view - for (var i = 0; i < 60; i += 5) { - var tick = $tick.clone(); - var radian = i / 30 * Math.PI; - tick.css({ - left: this.options.dialRadius + Math.sin(radian) * this.options.outerRadius - this.options.tickRadius + 'px', - top: this.options.dialRadius - Math.cos(radian) * this.options.outerRadius - this.options.tickRadius + 'px' - }); - tick.html(Timepicker._addLeadingZero(i)); - this.minutesView.appendChild(tick[0]); + for (let i = 0; i < 60; i += 5) { + const tick = _tick.cloneNode(true); + const radian = (i / 30) * Math.PI; + tick.style.left = + this.options.dialRadius + + Math.sin(radian) * this.options.outerRadius - + this.options.tickRadius + + 'px'; + tick.style.top = + this.options.dialRadius - + Math.cos(radian) * this.options.outerRadius - + this.options.tickRadius + + 'px'; + tick.innerHTML = Timepicker._addLeadingZero(i); + this.minutesView.appendChild(tick); } - } - }, { - key: "_handleAmPmClick", - value: function _handleAmPmClick(e) { - var $btnClicked = $(e.target); - this.amOrPm = $btnClicked.hasClass('am-btn') ? 'AM' : 'PM'; - this._updateAmPmView(); - } - }, { - key: "_updateAmPmView", - value: function _updateAmPmView() { + } + _updateAmPmView() { if (this.options.twelveHour) { - this.$amBtn.toggleClass('text-primary', this.amOrPm === 'AM'); - this.$pmBtn.toggleClass('text-primary', this.amOrPm === 'PM'); + if (this.amOrPm === 'PM') { + this._amBtn.classList.remove('text-primary'); + this._pmBtn.classList.add('text-primary'); + } + else if (this.amOrPm === 'AM') { + this._amBtn.classList.add('text-primary'); + this._pmBtn.classList.remove('text-primary'); + } } - } - }, { - key: "_updateTimeFromInput", - value: function _updateTimeFromInput() { + } + _updateTimeFromInput() { // Get the time - var value = ((this.el.value || this.options.defaultTime || '') + '').split(':'); + let value = ((this.el.value || this.options.defaultTime || '') + '').split(':'); if (this.options.twelveHour && !(typeof value[1] === 'undefined')) { - if (value[1].toUpperCase().indexOf('AM') > 0) { - this.amOrPm = 'AM'; - } else { - this.amOrPm = 'PM'; - } - value[1] = value[1].replace('AM', '').replace('PM', ''); + if (value[1].toUpperCase().indexOf('AM') > 0) { + this.amOrPm = 'AM'; + } + else { + this.amOrPm = 'PM'; + } + value[1] = value[1].replace('AM', '').replace('PM', ''); } if (value[0] === 'now') { - var now = new Date(+new Date() + this.options.fromNow); - value = [now.getHours(), now.getMinutes()]; - if (this.options.twelveHour) { - this.amOrPm = value[0] >= 12 && value[0] < 24 ? 'PM' : 'AM'; - } + let now = new Date(+new Date() + this.options.fromNow); + value = [now.getHours().toString(), now.getMinutes().toString()]; + if (this.options.twelveHour) { + this.amOrPm = parseInt(value[0]) >= 12 && parseInt(value[0]) < 24 ? 'PM' : 'AM'; + } } this.hours = +value[0] || 0; this.minutes = +value[1] || 0; - this.spanHours.innerHTML = this.hours; - this.spanMinutes.innerHTML = Timepicker._addLeadingZero(this.minutes); - + this.inputHours.value = this.hours; + this.inputMinutes.value = Timepicker._addLeadingZero(this.minutes); this._updateAmPmView(); - } - }, { - key: "showView", - value: function showView(view, delay) { - if (view === 'minutes' && $(this.hoursView).css('visibility') === 'visible') { - // raiseCallback(this.options.beforeHourSelect); - } - var isHours = view === 'hours', - nextView = isHours ? this.hoursView : this.minutesView, - hideView = isHours ? this.minutesView : this.hoursView; - this.currentView = view; - - $(this.spanHours).toggleClass('text-primary', isHours); - $(this.spanMinutes).toggleClass('text-primary', !isHours); - - // Transition view - hideView.classList.add('timepicker-dial-out'); - $(nextView).css('visibility', 'visible').removeClass('timepicker-dial-out'); - - // Reset clock hand - this.resetClock(delay); - - // After transitions ended - clearTimeout(this.toggleViewTimer); - this.toggleViewTimer = setTimeout(function () { - $(hideView).css('visibility', 'hidden'); - }, this.options.duration); - } - }, { - key: "resetClock", - value: function resetClock(delay) { - var view = this.currentView, - value = this[view], - isHours = view === 'hours', - unit = Math.PI / (isHours ? 6 : 30), - radian = value * unit, - radius = isHours && value > 0 && value < 13 ? this.options.innerRadius : this.options.outerRadius, - x = Math.sin(radian) * radius, - y = -Math.cos(radian) * radius, - self = this; - + } + resetClock(delay) { + var _a; + let view = this.currentView, value = this[view], isHours = view === 'hours', unit = Math.PI / (isHours ? 6 : 30), radian = value * unit, radius = isHours && value > 0 && value < 13 ? this.options.innerRadius : this.options.outerRadius, x = Math.sin(radian) * radius, y = -Math.cos(radian) * radius, self = this; if (delay) { - $(this.canvas).addClass('timepicker-canvas-out'); - setTimeout(function () { - $(self.canvas).removeClass('timepicker-canvas-out'); - self.setHand(x, y); - }, delay); - } else { - this.setHand(x, y); + (_a = this.canvas) === null || _a === void 0 ? void 0 : _a.classList.add('timepicker-canvas-out'); + setTimeout(() => { + var _a; + (_a = self.canvas) === null || _a === void 0 ? void 0 : _a.classList.remove('timepicker-canvas-out'); + self.setHand(x, y); + }, delay); } - } - }, { - key: "setHand", - value: function setHand(x, y, roundBy5) { - var _this60 = this; - - var radian = Math.atan2(x, -y), - isHours = this.currentView === 'hours', - unit = Math.PI / (isHours || roundBy5 ? 6 : 30), - z = Math.sqrt(x * x + y * y), - inner = isHours && z < (this.options.outerRadius + this.options.innerRadius) / 2, - radius = inner ? this.options.innerRadius : this.options.outerRadius; - + else { + this.setHand(x, y); + } + } + drawClockFromTimeInput(value, isHours) { + const unit = Math.PI / (isHours ? 6 : 30); + const radian = value * unit; + let radius; if (this.options.twelveHour) { - radius = this.options.outerRadius; + radius = this.options.outerRadius; + } + let cx1 = Math.sin(radian) * (radius - this.options.tickRadius), cy1 = -Math.cos(radian) * (radius - this.options.tickRadius), cx2 = Math.sin(radian) * radius, cy2 = -Math.cos(radian) * radius; + this.hand.setAttribute('x2', cx1.toString()); + this.hand.setAttribute('y2', cy1.toString()); + this.bg.setAttribute('cx', cx2.toString()); + this.bg.setAttribute('cy', cy2.toString()); + } + setHand(x, y, roundBy5 = false) { + let radian = Math.atan2(x, -y), isHours = this.currentView === 'hours', unit = Math.PI / (isHours || roundBy5 ? 6 : 30), z = Math.sqrt(x * x + y * y), inner = isHours && z < (this.options.outerRadius + this.options.innerRadius) / 2, radius = inner ? this.options.innerRadius : this.options.outerRadius; + if (this.options.twelveHour) { + radius = this.options.outerRadius; } - // Radian should in range [0, 2PI] if (radian < 0) { - radian = Math.PI * 2 + radian; + radian = Math.PI * 2 + radian; } - // Get the round value - var value = Math.round(radian / unit); - + let value = Math.round(radian / unit); // Get the round radian radian = value * unit; - // Correct the hours or minutes if (this.options.twelveHour) { - if (isHours) { - if (value === 0) value = 12; - } else { - if (roundBy5) value *= 5; - if (value === 60) value = 0; - } - } else { - if (isHours) { - if (value === 12) { - value = 0; + if (isHours) { + if (value === 0) + value = 12; } - value = inner ? value === 0 ? 12 : value : value === 0 ? 0 : value + 12; - } else { - if (roundBy5) { - value *= 5; + else { + if (roundBy5) + value *= 5; + if (value === 60) + value = 0; + } + } + else { + if (isHours) { + if (value === 12) { + value = 0; + } + value = inner ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12; + } + else { + if (roundBy5) { + value *= 5; + } + if (value === 60) { + value = 0; + } } - if (value === 60) { - value = 0; - } - } } - // Once hours or minutes changed, vibrate the device if (this[this.currentView] !== value) { - if (this.vibrate && this.options.vibrate) { - // Do not vibrate too frequently - if (!this.vibrateTimer) { - navigator[this.vibrate](10); - this.vibrateTimer = setTimeout(function () { - _this60.vibrateTimer = null; - }, 100); + if (this.vibrate && this.options.vibrate) { + // Do not vibrate too frequently + if (!this.vibrateTimer) { + navigator[this.vibrate](10); + this.vibrateTimer = setTimeout(() => { + this.vibrateTimer = null; + }, 100); + } } - } } - this[this.currentView] = value; if (isHours) { - this['spanHours'].innerHTML = value; - } else { - this['spanMinutes'].innerHTML = Timepicker._addLeadingZero(value); + this.inputHours.value = value.toString(); + } + else { + this.inputMinutes.value = Timepicker._addLeadingZero(value); } - // Set clock hand and others' position - var cx1 = Math.sin(radian) * (radius - this.options.tickRadius), - cy1 = -Math.cos(radian) * (radius - this.options.tickRadius), - cx2 = Math.sin(radian) * radius, - cy2 = -Math.cos(radian) * radius; - this.hand.setAttribute('x2', cx1); - this.hand.setAttribute('y2', cy1); - this.bg.setAttribute('cx', cx2); - this.bg.setAttribute('cy', cy2); - } - }, { - key: "open", - value: function open() { - if (this.isOpen) { - return; - } - - this.isOpen = true; - this._updateTimeFromInput(); - this.showView('hours'); - - this.modal.open(); - } - }, { - key: "close", - value: function close() { - if (!this.isOpen) { - return; - } - - this.isOpen = false; - this.modal.close(); - } - - /** - * Finish timepicker selection. - */ - - }, { - key: "done", - value: function done(e, clearValue) { - // Set input value - var last = this.el.value; - var value = clearValue ? '' : Timepicker._addLeadingZero(this.hours) + ':' + Timepicker._addLeadingZero(this.minutes); - this.time = value; - if (!clearValue && this.options.twelveHour) { - value = value + " " + this.amOrPm; - } - this.el.value = value; - - // Trigger change event - if (value !== last) { - this.$el.trigger('change'); - } - - this.close(); - this.el.focus(); - } - }, { - key: "clear", - value: function clear() { - this.done(null, true); - } - }], [{ - key: "init", - value: function init(els, options) { - return _get(Timepicker.__proto__ || Object.getPrototypeOf(Timepicker), "init", this).call(this, this, els, options); - } - }, { - key: "_addLeadingZero", - value: function _addLeadingZero(num) { - return (num < 10 ? '0' : '') + num; - } - }, { - key: "_createSVGEl", - value: function _createSVGEl(name) { - var svgNS = 'http://www.w3.org/2000/svg'; - return document.createElementNS(svgNS, name); - } - - /** - * @typedef {Object} Point - * @property {number} x The X Coordinate - * @property {number} y The Y Coordinate - */ - - /** - * Get x position of mouse or touch event - * @param {Event} e - * @return {Point} x and y location - */ - - }, { - key: "_Pos", - value: function _Pos(e) { - if (e.targetTouches && e.targetTouches.length >= 1) { - return { x: e.targetTouches[0].clientX, y: e.targetTouches[0].clientY }; - } - // mouse event - return { x: e.clientX, y: e.clientY }; - } - - /** - * Get Instance - */ - - }, { - key: "getInstance", - value: function getInstance(el) { - var domElem = !!el.jquery ? el[0] : el; - return domElem.M_Timepicker; - } - }, { - key: "defaults", - get: function () { - return _defaults; - } - }]); - - return Timepicker; - }(Component); - - Timepicker._template = [''].join(''); - - M.Timepicker = Timepicker; - - if (M.jQueryLoaded) { - M.initializeJqueryWrapper(Timepicker, 'timepicker', 'M_Timepicker'); - } -})(cash); -;(function ($) { - 'use strict'; - - var _defaults = {}; - - /** - * @class - * - */ - - var CharacterCounter = function (_Component17) { - _inherits(CharacterCounter, _Component17); - - /** - * Construct CharacterCounter instance - * @constructor - * @param {Element} el - * @param {Object} options - */ - function CharacterCounter(el, options) { - _classCallCheck(this, CharacterCounter); - - var _this61 = _possibleConstructorReturn(this, (CharacterCounter.__proto__ || Object.getPrototypeOf(CharacterCounter)).call(this, CharacterCounter, el, options)); - - _this61.el.M_CharacterCounter = _this61; - - /** - * Options for the character counter - */ - _this61.options = $.extend({}, CharacterCounter.defaults, options); - - _this61.isInvalid = false; - _this61.isValidLength = false; - _this61._setupCounter(); - _this61._setupEventHandlers(); - return _this61; + let cx1 = Math.sin(radian) * (radius - this.options.tickRadius), cy1 = -Math.cos(radian) * (radius - this.options.tickRadius), cx2 = Math.sin(radian) * radius, cy2 = -Math.cos(radian) * radius; + this.hand.setAttribute('x2', cx1.toString()); + this.hand.setAttribute('y2', cy1.toString()); + this.bg.setAttribute('cx', cx2.toString()); + this.bg.setAttribute('cy', cy2.toString()); } - - _createClass(CharacterCounter, [{ - key: "destroy", +} +exports.Timepicker = Timepicker; +(() => { + Timepicker._template = ` +