From 817a3f4475ee1c3903d911b800ff32d070de7799 Mon Sep 17 00:00:00 2001 From: noogen Date: Wed, 14 Apr 2021 20:56:27 -0500 Subject: [PATCH] tie remove event directly --- dist/index.js | 4 ++-- dist/index.js.map | 2 +- dist/mix-manifest.json | 2 +- example/index.js | 4 ++-- example/index.js.map | 2 +- example/mix-manifest.json | 2 +- package.json | 2 +- src/VdtnetTable.vue | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index a6319bb..7f96dac 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2,7 +2,7 @@ * vue-datatables-net * Vue jQuery DataTables.net wrapper component * - * @version v1.5.1 + * @version v1.5.2 * @author friends@niiknow.org * @repository https://github.com/niiknow/vue-datatables-net.git */ @@ -535,7 +535,7 @@ var myUniqueId = 1; }); } - $el.find('#vdtnetable1_wrapper').on('remove', function () { + $el.on('remove', function () { if (that.dataTable) { that.dataTable.destroy(true); } diff --git a/dist/index.js.map b/dist/index.js.map index f27dfe3..822f385 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["webpack://VdtnetTable/webpack/universalModuleDefinition","webpack://VdtnetTable/./src/VdtnetTable.vue?8e78","webpack://VdtnetTable/./src/VdtnetTable.vue?8f44","webpack://VdtnetTable/./node_modules/css-loader/dist/runtime/api.js","webpack://VdtnetTable/./src/VdtnetTable.vue","webpack://VdtnetTable/./src/VdtnetTable.vue?245f","webpack://VdtnetTable/./src/VdtnetTable.vue?0f0e","webpack://VdtnetTable/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://VdtnetTable/./src/VdtnetTable.vue?fcec","webpack://VdtnetTable/./node_modules/vue-style-loader/lib/addStylesClient.js","webpack://VdtnetTable/./node_modules/vue-style-loader/lib/listToStyles.js","webpack://VdtnetTable/webpack/bootstrap","webpack://VdtnetTable/webpack/runtime/compat get default export","webpack://VdtnetTable/webpack/runtime/define property getters","webpack://VdtnetTable/webpack/runtime/hasOwnProperty shorthand","webpack://VdtnetTable/webpack/runtime/make namespace object","webpack://VdtnetTable/./src/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VdtnetTable\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VdtnetTable\"] = factory();\n\telse\n\t\troot[\"VdtnetTable\"] = factory();\n})(self, function() {\nreturn ","//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar myUniqueId = 1;\nexport default {\n name: 'VdtnetTable',\n props: {\n /**\n * The table id\n *\n * @type String\n */\n id: {\n type: String,\n \"default\": null\n },\n\n /**\n * Set the container classes.\n *\n * @type String\n */\n containerClassName: {\n type: String,\n \"default\": 'table-responsive d-print-inline'\n },\n\n /**\n * Set the input column search classes.\n *\n * @type String\n */\n columnSearchClassName: {\n type: String,\n \"default\": 'form-control form-control-sm'\n },\n\n /**\n * Set the tfoot classes.\n *\n * @type String\n */\n tfootClassName: {\n type: String\n },\n\n /**\n * Set the thead classes.\n *\n * @type String\n */\n theadClassName: {\n type: String\n },\n\n /**\n * Set the table classes you wish to use, default with bootstrap4\n * but you can override with: themeforest, foundation, etc..\n *\n * @type String\n */\n className: {\n type: String,\n \"default\": 'table table-striped table-bordered nowrap w-100'\n },\n\n /**\n * the options object: https://datatables.net/manual/options\n *\n * @type Object\n */\n opts: {\n type: Object\n },\n\n /**\n * List all fields to be converted to opts columns\n *\n * @type Object\n */\n fields: {\n type: Object\n },\n\n /**\n * Pass in DataTables.Net jQuery to resolve any conflict from\n * multiple jQuery loaded in the browser\n *\n * @type Object\n */\n jquery: {\n type: Object\n },\n\n /**\n * Pass in Vue to resolve any conflict from multiple loaded\n *\n * @type Object\n */\n vue: {\n type: Object\n },\n\n /**\n * The select-checkbox column index (start at 1)\n * Current implementation require datatables.net-select\n *\n * @type Number\n */\n selectCheckbox: {\n type: Number,\n \"default\": -1\n },\n\n /**\n * Provide custom local data loading. Warning: this option has not been\n * thoroughly tested. Please use ajax and serverSide instead.\n *\n * @type Function\n */\n dataLoader: {\n type: Function\n },\n\n /**\n * true to hide the footer of the table\n *\n * @type Boolean\n */\n hideFooter: {\n type: Boolean\n },\n\n /**\n * true to hide the tfoot of the table\n *\n * @type Boolean\n */\n hideTfoot: {\n type: Boolean,\n \"default\": true\n },\n\n /**\n * true to hide the individual column search of the table\n *\n * @type Boolean\n */\n columnSearch: {\n type: Boolean,\n \"default\": false\n },\n\n /**\n * The details column configuration of master/details.\n *\n * @type {Object}\n */\n details: {\n type: Object\n }\n },\n data: function data() {\n // initialize defaults\n return {\n tableId: null,\n options: {\n /*eslint-disable */\n dom: \"tr<'row vdtnet-footer'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'pl>>\",\n\n /*eslint-enable */\n columns: [],\n language: {\n infoFiltered: ''\n },\n lengthMenu: [[15, 100, 500, 1000, -1], [15, 100, 500, 1000, 'All']],\n pageLength: 15,\n buttons: [] // remove any button defaults\n\n },\n dataTable: null,\n vdtnet: this\n };\n },\n computed: {\n jq: function jq() {\n return this.jquery || window.jQuery;\n },\n myVue: function myVue() {\n return this.vue || window.Vue;\n },\n classes: function classes() {\n var that = this;\n var classes = \"\".concat(that.containerClassName, \" vdtnet-container\");\n\n if (this.hideFooter) {\n classes += ' hide-footer';\n }\n\n return classes;\n }\n },\n created: function created() {\n var that = this;\n var jq = that.jq;\n var startCol = 0;\n var icol = 0;\n that.tableId = that.id || \"vdtnetable\".concat(myUniqueId++); // allow user to override default options\n\n if (that.opts) {\n that.options = jq.extend({}, that.options, that.opts);\n }\n\n that.options.order = that.options.order || [[startCol, 'asc']];\n\n if (that.fields) {\n var fields = that.fields;\n var cols = that.options.columns;\n var orders = that.options.order;\n\n for (var k in fields) {\n var field = fields[k];\n field.name = field.name || k; // disable search and sort for local field\n\n if (field.isLocal) {\n field.searchable = false;\n field.sortable = false;\n } // generate\n\n\n var col = {\n label: field.label || field.name,\n data: field.data || field.name,\n width: field.width,\n name: field.name,\n className: field.className,\n index: field.index || icol + 1\n };\n\n if (field.hasOwnProperty('defaultContent')) {\n col.defaultContent = field.defaultContent;\n }\n\n if (field.hasOwnProperty('sortable')) {\n col.orderable = field.sortable;\n }\n\n if (field.hasOwnProperty('visible')) {\n col.visible = field.visible;\n }\n\n if (field.hasOwnProperty('searchable')) {\n col.searchable = field.searchable;\n }\n\n if (field.hasOwnProperty('editField')) {\n col.editField = field.editField;\n }\n\n if (field.hasOwnProperty('classHeaderName')) {\n col.classHeaderName = field.classHeaderName;\n }\n\n if (field.hasOwnProperty('classFooterName')) {\n col.classFooterName = field.classFooterName;\n }\n\n if (field.template) {\n col.template = field.template;\n }\n\n if (field.render) {\n col.render = field.render;\n } // console.log(col)\n\n\n cols.push(col);\n\n if (field.defaultOrder) {\n orders.push([icol, field.defaultOrder]);\n }\n\n icol++;\n }\n }\n\n if (that.selectCheckbox) {\n // create checkbox column\n var _col = {\n orderable: false,\n searchable: false,\n name: '_select_checkbox',\n className: 'select-checkbox d-print-none',\n data: null,\n defaultContent: '',\n index: that.selectCheckbox - 1\n };\n that.options.columns.splice(that.selectCheckbox - 1, 0, _col); // console.log(that.options.columns)\n\n that.options.select = that.options.select || {\n style: 'os',\n selector: 'td.select-checkbox'\n };\n\n if (that.selectCheckbox === 1) {\n startCol++;\n }\n } // handle master details\n\n\n if (that.details) {\n var detailsIndex = that.details.index || 1; // create details column\n\n var _col2 = {\n orderable: false,\n searchable: false,\n name: '_details_control',\n className: 'details-control d-print-none',\n data: null,\n defaultContent: that.details.icons || '+-',\n index: detailsIndex - 1\n };\n that.options.columns.splice(detailsIndex - 1, 0, _col2);\n\n if (detailsIndex === 1) {\n startCol++;\n }\n }\n\n if (startCol > 0) {\n if (that.options.order) {\n that.options.order.forEach(function (v) {\n v[0] += startCol;\n });\n } else {\n that.options.order = [[startCol, 'asc']];\n }\n }\n },\n mounted: function mounted() {\n var that = this;\n var jq = that.jq;\n var $el = jq(that.$refs.table);\n var cols = that.options.columns;\n\n for (var k in cols) {\n var col = cols[k];\n\n if (col.template || that.$scopedSlots[col.name]) {\n col.render = that.compileTemplate(col, that.$scopedSlots[col.name]);\n }\n\n if (col.render) {\n if (!col.render.templated) {\n (function () {\n var myRender = col.render;\n\n col.render = function () {\n return myRender.apply(that, Array.prototype.slice.call(arguments));\n };\n })();\n }\n }\n\n if (col.template) {\n delete col.template;\n }\n } // handle local data loader\n\n\n if (that.dataLoader) {\n delete that.options.ajax;\n that.options.serverSide = false;\n }\n\n if (!that.hideFooter && that.columnSearch) {\n that.options.initComplete = function () {\n var api = this.api();\n var state = api.state.loaded();\n api.columns().every(function () {\n var that = this;\n var colIdx = this.index();\n\n if (state) {\n var colSearch = state.columns[colIdx].search;\n\n if (colSearch.search) {\n jq('input', this.footer()).val(colSearch.search);\n }\n }\n\n jq('input', this.footer()).on('keyup change clear search', function () {\n if (that.search() !== this.value) {\n that.search(this.value).draw();\n }\n });\n });\n };\n } // you can access and update the that.options and $el here before we create the DataTable\n\n\n that.$emit('table-creating', that, $el);\n that.dataTable = $el.DataTable(that.options);\n\n if (that.selectCheckbox) {\n // handle select all checkbox\n $el.on('click', 'th input.select-all-checkbox', function (e) {\n if (jq(e.target).is(':checked')) {\n that.dataTable.rows().select();\n } else {\n that.dataTable.rows().deselect();\n }\n }); // handle individual row select events\n\n that.dataTable.on('select deselect', function (e, dt, type, indexes) {\n var $input = $el.find('th input.select-all-checkbox');\n\n if (that.dataTable.rows({\n selected: true\n }).count() !== that.dataTable.rows().count()) {\n jq('th.select-checkbox').removeClass('selected');\n $input.attr('checked', false);\n } else {\n jq('th.select-checkbox').addClass('selected');\n $input.attr('checked', true);\n } // type is select/deselect so event become row-select or row-deselect\n\n\n that.$emit('row-' + e.type, {\n dataTable: that.dataTable,\n e: e,\n dt: dt,\n type: type,\n indexes: indexes\n }); // to get data, see const examples below\n // const rows = event.dataTable.rows( event.indexes )\n // const data = rows.data()\n });\n }\n\n $el.find('#vdtnetable1_wrapper').on('remove', function () {\n if (that.dataTable) {\n that.dataTable.destroy(true);\n }\n\n that.dataTable = null;\n }); // wire up edit, delete, and/or action buttons\n\n $el.on('click', '[data-action]', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var target = jq(e.target);\n var action = target.attr('data-action'); // no action, simply exit\n\n if (!action) {\n return;\n } else {\n var tr = target; // detect if action is inside a row\n // get data from parent row/tr\n\n if (target.prop('tagName') !== 'TR') {\n tr = target.closest('tr');\n }\n\n if (tr) {\n // if child row, get previous/parent row\n if (tr.hasClass('master-details')) {\n tr = tr.prev();\n }\n\n var row = that.dataTable.row(tr);\n var data = row.data();\n that.$emit(action, data, row, tr, target);\n } else {\n // not a row click, must be other kind of action\n // such as bulk, csv, pdf, etc...\n that.$emit(action, null, null, null, target);\n }\n }\n }); // handle master/details\n\n if (that.details) {\n // default to render function\n var renderFunc = that.details.render; // must be string template\n\n if (that.details.template || that.$scopedSlots['_details']) {\n renderFunc = that.compileTemplate(that.details, that.$scopedSlots['_details']);\n } else if (renderFunc) {\n renderFunc = function renderFunc() {\n return that.details.render.apply(that, Array.prototype.slice.call(arguments));\n };\n } // handle master/details\n // Add event listener for opening and closing details\n\n\n $el.on('click', 'td.details-control', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var target = jq(e.target);\n var tr = target.closest('tr');\n\n if (tr.hasClass('master-details')) {\n tr = tr.prev();\n }\n\n var row = that.dataTable.row(tr);\n\n if (row.child.isShown()) {\n // This row is already open - close it\n row.child.hide();\n tr.removeClass('master');\n } else {\n // Open this row\n var data = row.data();\n row.child(renderFunc(data, 'child', row, tr)).show();\n tr.addClass('master').next().addClass('master-details');\n }\n });\n }\n\n that.$emit('table-created', that); // finally, load data\n\n if (that.dataLoader) {\n that.reload();\n }\n },\n methods: {\n /**\n * Vue.compile a template string and return the compiled function\n *\n * @param {Object} object with template property\n * @param {Object} the slot\n * @return {Function} the compiled template function\n */\n compileTemplate: function compileTemplate(field, slot) {\n var that = this;\n var jq = that.jq;\n var vue = that.myVue;\n var res = vue.compile(\"
\".concat(field.template || '', \"
\"));\n\n var renderFunc = function renderFunc(data, type, row, meta) {\n var myRender = res.render;\n\n if (slot) {\n myRender = function myRender(createElement) {\n return createElement('div', [slot({\n data: data,\n type: type,\n row: row,\n meta: meta,\n vdtnet: that,\n def: field,\n comp: that.$parent\n })]);\n };\n }\n\n var comp = new vue({\n data: {\n data: data,\n type: type,\n row: row,\n meta: meta,\n vdtnet: that,\n def: field,\n comp: that.$parent\n },\n render: myRender,\n staticRenderFns: res.staticRenderFns\n }).$mount();\n return jq(comp.$el).html();\n };\n\n renderFunc.templated = true;\n return renderFunc;\n },\n\n /**\n * Set table data array that was loaded from somewhere else\n * This method allow for local setting of data; though, it\n * is recommended to use ajax instead of this.\n *\n * @param {Array} data the array of data\n * @return {Object} the component\n */\n setTableData: function setTableData(data) {\n var that = this;\n\n if (data.constructor === Array) {\n that.dataTable.clear().rows.add(data);\n that.dataTable.draw(false);\n that.dataTable.columns.adjust();\n }\n\n return that;\n },\n\n /**\n * pass through reload method\n *\n * @param {Boolean} resetPaging true to reset current page position\n * @return {Object} the component\n */\n reload: function reload() {\n var resetPaging = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var that = this;\n\n if (that.dataLoader) {\n // manual data loading\n that.dataLoader(function (data) {\n if (data && !data.data) {\n data = {\n data: data\n };\n }\n\n that.setTableData(data.data);\n that.$emit('reloaded', data, that);\n });\n } else {\n that.dataTable.ajax.reload(function (data) {\n that.$emit('reloaded', data, that);\n }, resetPaging);\n }\n\n return that;\n },\n search: function search(value) {\n var that = this;\n that.dataTable.search(value).draw();\n return that;\n },\n setPageLength: function setPageLength(value) {\n var that = this;\n that.dataTable.page.len(value);\n return that.reload();\n },\n getServerParams: function getServerParams() {\n if (this.dataLoader) {\n return {};\n }\n\n return this.dataTable.ajax.params();\n }\n }\n};","// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"\\n.select-checkbox, .select-all-checkbox {\\n cursor: pointer;\\n}\\n.vdtnet-footer .dataTables_length {\\n padding-top: 6px;\\n padding-right: 10px;\\n}\\n.vdtnet-footer .dataTables_length, .vdtnet-footer .dataTables_paginate {\\n float: right;\\n}\\n.hide-footer .vdtnet-footer {\\n display: none;\\n}\\n.master .details-plus\\n{\\n cursor: pointer;\\n display: none;\\n}\\n.details-minus\\n{\\n cursor: pointer;\\n display: none;\\n}\\n.master .details-minus\\n{\\n cursor: pointer;\\n display: inline;\\n}\\n.details-control {\\n cursor: pointer;\\n font-weight: 700;\\n}\\n\", \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","import { render, staticRenderFns } from \"./VdtnetTable.vue?vue&type=template&id=c0350a64&\"\nimport script from \"./VdtnetTable.vue?vue&type=script&lang=js&\"\nexport * from \"./VdtnetTable.vue?vue&type=script&lang=js&\"\nimport style0 from \"./VdtnetTable.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"/Volumes/Extra/work/niiknow/vue-datatables-net/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('c0350a64')) {\n api.createRecord('c0350a64', component.options)\n } else {\n api.reload('c0350a64', component.options)\n }\n module.hot.accept(\"./VdtnetTable.vue?vue&type=template&id=c0350a64&\", function () {\n api.rerender('c0350a64', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"src/VdtnetTable.vue\"\nexport default component.exports","import mod from \"-!../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../node_modules/vue-loader/lib/index.js??vue-loader-options!./VdtnetTable.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../node_modules/vue-loader/lib/index.js??vue-loader-options!./VdtnetTable.vue?vue&type=script&lang=js&\"","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { class: _vm.classes }, [_vm._m(0)])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"table\",\n {\n ref: \"table\",\n class: _vm.className,\n attrs: { id: _vm.tableId, cellpadding: \"0\" }\n },\n [\n _c(\"thead\", { class: _vm.theadClassName }, [\n _c(\n \"tr\",\n _vm._l(_vm.options.columns, function(field, i) {\n return _c(\n \"th\",\n { key: \"head_\" + i, class: field.classHeaderName },\n [\n _vm._t(\n \"HEAD_\" + field.name,\n [\n field.name === \"_select_checkbox\"\n ? _c(\"input\", {\n staticClass: \"select-all-checkbox d-print-none\",\n attrs: { type: \"checkbox\" }\n })\n : _c(\"div\", {\n domProps: { innerHTML: _vm._s(field.label) }\n })\n ],\n { field: field, i: i }\n )\n ],\n 2\n )\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n !_vm.hideTfoot\n ? _c(\"tfoot\", { class: _vm.tfootClassName }, [\n _c(\n \"tr\",\n _vm._l(_vm.options.columns, function(field, i) {\n return _c(\n \"th\",\n { key: \"foot_\" + i, class: field.classFooterName },\n [\n _vm._t(\n \"FOOT_\" + field.name,\n [\n _vm.columnSearch &&\n (field.searchable ||\n typeof field.searchable === \"undefined\")\n ? _c(\"input\", {\n class: _vm.columnSearchClassName,\n attrs: {\n placeholder: field.label,\n type: \"search\"\n }\n })\n : !_vm.columnSearch\n ? _c(\"div\", {\n domProps: { innerHTML: _vm._s(field.label) }\n })\n : _vm._e()\n ],\n { field: field, i: i }\n )\n ],\n 2\n )\n }),\n 0\n )\n ])\n : _vm._e()\n ]\n )\n }\n]\nrender._withStripped = true\n\nexport { render, staticRenderFns }","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","// style-loader: Adds some css to the DOM by adding a