{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../demo7/src/js/pages/crud/forms/widgets/select2.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,aAAa,E;AACb,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC,E","file":"js/pages/crud/forms/widgets/select2.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"../demo7/src/js/pages/crud/forms/widgets/select2.js\");\n","// Class definition\r\nvar KTSelect2 = function() {\r\n // Private functions\r\n var demos = function() {\r\n // basic\r\n $('#kt_select2_1, #kt_select2_1_validate').select2({\r\n placeholder: \"Select a state\"\r\n });\r\n\r\n // nested\r\n $('#kt_select2_2, #kt_select2_2_validate').select2({\r\n placeholder: \"Select a state\"\r\n });\r\n\r\n // multi select\r\n $('#kt_select2_3, #kt_select2_3_validate').select2({\r\n placeholder: \"Select a state\",\r\n });\r\n\r\n // basic\r\n $('#kt_select2_4').select2({\r\n placeholder: \"Select a state\",\r\n allowClear: true\r\n });\r\n\r\n // loading data from array\r\n var data = [{\r\n id: 0,\r\n text: 'Enhancement'\r\n }, {\r\n id: 1,\r\n text: 'Bug'\r\n }, {\r\n id: 2,\r\n text: 'Duplicate'\r\n }, {\r\n id: 3,\r\n text: 'Invalid'\r\n }, {\r\n id: 4,\r\n text: 'Wontfix'\r\n }];\r\n\r\n $('#kt_select2_5').select2({\r\n placeholder: \"Select a value\",\r\n data: data\r\n });\r\n\r\n // loading remote data\r\n\r\n function formatRepo(repo) {\r\n if (repo.loading) return repo.text;\r\n var markup = \"
\" +\r\n \"
\" +\r\n \"
\" + repo.full_name + \"
\";\r\n if (repo.description) {\r\n markup += \"
\" + repo.description + \"
\";\r\n }\r\n markup += \"
\" +\r\n \"
\" + repo.forks_count + \" Forks
\" +\r\n \"
\" + repo.stargazers_count + \" Stars
\" +\r\n \"
\" + repo.watchers_count + \" Watchers
\" +\r\n \"
\" +\r\n \"
\";\r\n return markup;\r\n }\r\n\r\n function formatRepoSelection(repo) {\r\n return repo.full_name || repo.text;\r\n }\r\n\r\n $(\"#kt_select2_6\").select2({\r\n placeholder: \"Search for git repositories\",\r\n allowClear: true,\r\n ajax: {\r\n url: \"https://api.github.com/search/repositories\",\r\n dataType: 'json',\r\n delay: 250,\r\n data: function(params) {\r\n return {\r\n q: params.term, // search term\r\n page: params.page\r\n };\r\n },\r\n processResults: function(data, params) {\r\n // parse the results into the format expected by Select2\r\n // since we are using custom formatting functions we do not need to\r\n // alter the remote JSON data, except to indicate that infinite\r\n // scrolling can be used\r\n params.page = params.page || 1;\r\n\r\n return {\r\n results: data.items,\r\n pagination: {\r\n more: (params.page * 30) < data.total_count\r\n }\r\n };\r\n },\r\n cache: true\r\n },\r\n escapeMarkup: function(markup) {\r\n return markup;\r\n }, // let our custom formatter work\r\n minimumInputLength: 1,\r\n templateResult: formatRepo, // omitted for brevity, see the source of this page\r\n templateSelection: formatRepoSelection // omitted for brevity, see the source of this page\r\n });\r\n\r\n // custom styles\r\n\r\n // tagging support\r\n $('#kt_select2_12_1, #kt_select2_12_2, #kt_select2_12_3, #kt_select2_12_4').select2({\r\n placeholder: \"Select an option\",\r\n });\r\n\r\n // disabled mode\r\n $('#kt_select2_7').select2({\r\n placeholder: \"Select an option\"\r\n });\r\n\r\n // disabled results\r\n $('#kt_select2_8').select2({\r\n placeholder: \"Select an option\"\r\n });\r\n\r\n // limiting the number of selections\r\n $('#kt_select2_9').select2({\r\n placeholder: \"Select an option\",\r\n maximumSelectionLength: 2\r\n });\r\n\r\n // hiding the search box\r\n $('#kt_select2_10').select2({\r\n placeholder: \"Select an option\",\r\n minimumResultsForSearch: Infinity\r\n });\r\n\r\n // tagging support\r\n $('#kt_select2_11').select2({\r\n placeholder: \"Add a tag\",\r\n tags: true\r\n });\r\n\r\n // disabled results\r\n $('.kt-select2-general').select2({\r\n placeholder: \"Select an option\"\r\n });\r\n }\r\n\r\n var modalDemos = function() {\r\n $('#kt_select2_modal').on('shown.bs.modal', function () {\r\n // basic\r\n $('#kt_select2_1_modal').select2({\r\n placeholder: \"Select a state\"\r\n });\r\n\r\n // nested\r\n $('#kt_select2_2_modal').select2({\r\n placeholder: \"Select a state\"\r\n });\r\n\r\n // multi select\r\n $('#kt_select2_3_modal').select2({\r\n placeholder: \"Select a state\",\r\n });\r\n\r\n // basic\r\n $('#kt_select2_4_modal').select2({\r\n placeholder: \"Select a state\",\r\n allowClear: true\r\n }); \r\n });\r\n }\r\n\r\n // Public functions\r\n return {\r\n init: function() {\r\n demos();\r\n modalDemos();\r\n }\r\n };\r\n}();\r\n\r\n// Initialization\r\njQuery(document).ready(function() {\r\n KTSelect2.init();\r\n});"],"sourceRoot":""}