(window["webpackJsonp_name_"] = window["webpackJsonp_name_"] || []).push([[15],{ /***/ 119: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.inputController = inputController; var _InputControllerTest = __webpack_require__(194); var _InputControllerTest2 = _interopRequireDefault(_InputControllerTest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function inputController() { var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; // const selects = context.querySelectorAll('select'); // if (selects.length) { // import('../Select/Select') // .then(Select => { // new Select.default({ // elems: selects // }); // }); // } _InputControllerTest2.default.init(context); // getItems(context).then(items => { // initItems(items); // }); return false; } // function getItems(context = document) { // return Promise.all([getElems(context, 'class'), getElems(context, 'type')]) // .then(res => { // return new Map([...Array.from(res[0]), ...Array.from(res[1])]); // }).catch(e => { // throw new Error(e); // }); // } // function getElems(context = document, type = "type") { // let inputItems = new Map(); // let initializedClass = '.project-input_initializing'; // const array = type === 'type' ? INPUT_TYPES : ELEMS_CLASSES; // array.forEach(el => { // let elems = Array.from(context.querySelectorAll(`${el}:not(${initializedClass})${type === 'type' ? '' : ':not(input)'}`)).map((item: any) => { // item.classList.add('project-input_initializing'); // return item; // }); // elems.length && inputItems.set(el, elems); // }); // return inputItems; // } // function initItems(items: any) { // for (let elems of items.keys()) { // switch (elems) { // case 'textarea': // // text // case '[type="email"]': // case '[type="password"]': // case '[type="search"]': // case '[type="tel"]': // case '[type="text"]': // case '[type="url"]': { // initInput(elems === 'textarea' ? 'textarea' : 'text', items.get(elems)); // // initText(elems === 'textarea' ? 'textarea' : 'text', items.get(elems)); // break; // } // // button // case 'button': // case '.button': // case '.tag-cloud-link': // case '.vc_btn3': { // initInput('button', items.get(elems)); // // initButton('button', items.get(elems)); // break; // } // case '[type="button"]': // case '[type="image"]': // case '[type="reset"]': // case '[type="submit"]': { // initInput('button', items.get(elems)); // // initTypeButton('button', items.get(elems)); // break; // } // // radio and checkbox // // case '[type="checkbox"]': // // case '[type="radio"]': { // // initInput(elems === '[type="checkbox"]' ? 'checkbox' : 'radio', items.get(elems)); // // // initRadioAndCheckbox(elems === '[type="checkbox"]' ? 'checkbox' : 'radio', items.get(elems)); // // break; // // } // // spin box // case '[type="number"]': { // // initInput('number', items.get(elems)) // initInput('number', items.get(elems)); // // initSpinBox('number', items.get(elems)); // break; // } // // file // case '[type="file"]': { // initInput('file', items.get(elems)); // // initFile('file', items.get(elems)); // break; // } // // jquery date picker // case '[type="date"]': { // initInput('date', items.get(elems)); // // initDatePicker('date', items.get(elems)); // break; // } // // // jquery color picker // // case '[type="color"]': { // // initColorPicker('color', items.get(elems)); // // break; // // } // // jquery slider widget // case '[type="range"]': { // initInput('slider', items.get(elems)); // // initRange('slider', items.get(elems)); // break; // } // } // } // } // function isInitialized(item) { // if (item.classList.contains('project-input_initialized') // || item.parentNode.classList.contains('project-input_initialized') // || item.parentNode.classList.contains('ginput_container_list') // ) { // return true; // } else { // return false; // } // } // function initInput(type: any, items: any) { // items.forEach((item: any) => { // if (isInitialized(item)) { // return false; // } // getTemplate(type, item); // }); // } // function initColorPicker(type: any, items: any) { // items.forEach((item: any) => { // // appendItemInTemplate(item, getTemplate(type, item)); // import('./jQuery_UI/UI_Spectrum-colorpicker') // .then(() => { // ($(item) as any).spectrum({ // showInput: true, // preferredFormat: 'rgb', // allowEmpty: true, // showInitial: true, // showAlpha: true, // replacerClassName: 'project-input project-input_color', // change: function (color) { // if (!color) { // this.value = ''; // this.setAttribute('value', ''); // } else { // this.value = color; // this.setAttribute('value', color); // } // } // }); // }); // }); // } // function initRange(type: any, items: any) { // items.forEach((item: any) => { // const template = getTemplate(type, item); // appendItemInTemplate(item, template); // // System.import('jquery-ui/ui/widgets/slider').then(() => { // import('./jQuery_UI/UI_Slider').then(() => { // $(template).slider({ // max: parseInt(item.max, 10) || 100, // min: parseInt(item.min, 10) || 0, // step: parseInt(item.step, 10) || 1, // range: "min", // create: function (event, ui) { // item.value = ui.value; // }, // stop: function (event, ui) { // item.parentNode.classList.remove('project-input_focused'); // item.value = ui.value; // }, // start: () => { // item.parentNode.classList.add('project-input_focused'); // } // }); // }); // }); // } // import { INPUT_TYPES, ELEMS_CLASSES } from './INPUT_LIST'; // import { getTemplate, appendItemInTemplate, getBackground } from './templates'; /***/ }) }]);