mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2025-02-03 05:14:16 +03:00
1 line
7.7 KiB
Plaintext
1 line
7.7 KiB
Plaintext
{"version":3,"sources":["../src/bootstrapMaterialDesign.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAaA,IAAM,uBAAuB,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;AAOtC,MAAM,IAAI,GAAG,yBAAyB,CAAA;AACtC,MAAM,QAAQ,YAAU,IAAI,AAAE,CAAA;AAC9B,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;;;;;;;;;AAUrC,MAAM,OAAO,GAAG;AACd,WAAO,EAAE;AACP,cAAQ,EAAE,CACR,uCAAuC,EACvC,+BAA+B,EAC/B,6BAA6B,EAC7B,oCAAoC,EACpC,+BAA+B,EAC/B,gEAAgE,EAChE,SAAS;OACV;KACF;AACD,SAAK,EAAE;AACL,cAAQ,EAAE,CACR,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,CACtB;KACF;AACD,YAAQ,EAAE;AACR,cAAQ,EAAE,0CAA0C;KACrD;AACD,gBAAY,EAAE;AACZ,cAAQ,EAAE,8CAA8C;KACzD;AACD,SAAK,EAAE;AACL,cAAQ,EAAE,oCAAoC;KAC/C;AACD,aAAS,EAAE;AACT,cAAQ,EAAE,kBAAkB;KAC7B;AACD,YAAQ,EAAE;AACR,cAAQ,EAAE,MAAM;KACjB;AACD,UAAM,EAAE,IAAI;;AAEZ,iBAAa,EAAE,CACb,SAAS,EACT,OAAO,EACP,UAAU,EACV,cAAc,EACd,OAAO,EACP,WAAW,EACX,UAAU,CACX;GACF,CAAA;;;;;;;;MAOK,uBAAuB;AAEhB,aAFP,uBAAuB,CAEf,OAAO,EAAE,MAAM,EAAE;;;4BAFzB,uBAAuB;;AAGzB,UAAI,CAAC,OAAO,GAAG,OAAO,CAAA;AACtB,UAAI,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,C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GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;AACtB,cAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;;AAElC,cAAI,CAAC,IAAI,EAAE;AACT,gBAAI,GAAG,IAAI,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAChD,oBAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC9B;SACF,CAAC,CAAA;OACH;;;WA7DG,uBAAuB;;;AAqE7B,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAA;AACrD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,uBAAuB,CAAA;AAChD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,YAAM;AAC5B,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,uBAAuB,CAAC,gBAAgB,CAAA;GAChD,CAAA;;AAED,SAAO,uBAAuB,CAAA;CAE/B,CAAA,CAAE,MAAM,CAAC,CAAA","file":"bootstrapMaterialDesign.js","sourcesContent":["//import Util from './util'\n\n/**\n * $.bootstrapMaterialDesign(config) is a macro class to configure the components generally\n * used in Material Design for Bootstrap. You may pass overrides to the configurations\n * which will be passed into each component, or you may omit use of this class and\n * configure each component separately.\n *\n * NOTE: If omitting use of this class, please note that the Input component must be\n * initialized prior to other decorating components such as radio, checkbox,\n * togglebutton, fileInput.\n *\n */\nconst BootstrapMaterialDesign = (($) => {\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n const NAME = 'bootstrapMaterialDesign'\n const DATA_KEY = `mdb.${NAME}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n /**\n *\n * Default macro configuration for each component (primarily selectors).\n * - selector: may be a string or an array. Any array will be joined with a comma to generate the selector\n * - disable any component by defining it as false with an override. e.g. $.bootstrapMaterialDesign({ autofill: false })\n *\n * @see each individual component for more configuration settings.\n */\n const Default = {\n ripples: {\n selector: [\n '.btn:not(.btn-link):not(.ripple-none)',\n '.card-image:not(.ripple-none)',\n '.navbar a:not(.ripple-none)',\n '.dropdown-menu a:not(.ripple-none)',\n '.nav-tabs a:not(.ripple-none)',\n '.pagination li:not(.active):not(.disabled) a:not(.ripple-none)',\n '.ripple' // generic marker class to add ripple to elements\n ]\n },\n input: {\n selector: [\n 'input.form-control',\n 'textarea.form-control',\n 'select.form-control'\n ]\n },\n checkbox: {\n selector: '.checkbox > label > input[type=checkbox]'\n },\n togglebutton: {\n selector: '.togglebutton > label > input[type=checkbox]'\n },\n radio: {\n selector: '.radio > label > input[type=radio]'\n },\n fileInput: {\n selector: 'input[type=file]'\n },\n autofill: {\n selector: 'body'\n },\n arrive: true,\n // create an ordered component list for instantiation\n instantiation: [\n 'ripples',\n 'input',\n 'checkbox',\n 'togglebutton',\n 'radio',\n 'fileInput',\n 'autofill'\n ]\n }\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n class BootstrapMaterialDesign {\n\n constructor(element, config) {\n this.element = element\n this.config = $.extend({}, Default, config)\n let $document = $(document)\n\n for (let component in this.config.instantiation) {\n\n // the component's config fragment is passed in directly, allowing users to override\n let componentConfig = this.config[component]\n\n // check to make sure component config is enabled (not `false`)\n if (componentConfig) {\n\n // assemble the selector as it may be an array\n let selector = this._resolveSelector(componentConfig)\n\n // instantiate component on selector elements with config\n $(selector)[component](componentConfig)\n\n // add to arrive if present and enabled\n if (document.arrive && this.config.arrive) {\n $document.arrive(selector, (element) => { // eslint-disable-line no-loop-func\n $(element)[component](componentConfig)\n })\n }\n }\n }\n }\n\n dispose() {\n $.removeData(this.element, DATA_KEY)\n this.element = null\n this.config = null\n }\n\n // ------------------------------------------------------------------------\n // private\n\n _resolveSelector(componentConfig) {\n let selector = componentConfig['selector']\n if (Array.isArray(selector)) {\n selector = selector.join(', ')\n }\n\n return selector\n }\n\n // ------------------------------------------------------------------------\n // static\n static _jQueryInterface(config) {\n return this.each(function () {\n let $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new BootstrapMaterialDesign(this, config)\n $element.data(DATA_KEY, data)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n $.fn[NAME] = BootstrapMaterialDesign._jQueryInterface\n $.fn[NAME].Constructor = BootstrapMaterialDesign\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return BootstrapMaterialDesign._jQueryInterface\n }\n\n return BootstrapMaterialDesign\n\n})(jQuery)\n\nexport default BootstrapMaterialDesign\n"]} |