diff --git a/aircox/admin/sound.py b/aircox/admin/sound.py index 44540b0..5b2b830 100644 --- a/aircox/admin/sound.py +++ b/aircox/admin/sound.py @@ -9,7 +9,7 @@ from adminsortable2.admin import SortableAdminBase, SortableInlineAdminMixin from ..models import Sound, Track -class TrackInline(SortableInlineAdminMixin, admin.TabularInline): +class TrackInline(admin.TabularInline): template = 'admin/aircox/playlist_inline.html' model = Track extra = 0 diff --git a/aircox/static/aircox/js/chunk-common.js b/aircox/static/aircox/js/chunk-common.js index a7244d4..ee10f56 100644 --- a/aircox/static/aircox/js/chunk-common.js +++ b/aircox/static/aircox/js/chunk-common.js @@ -75,7 +75,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ALi \*************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Modes\": function() { return /* binding */ Modes; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model */ \"./src/model.js\");\n/* harmony import */ var _track__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../track */ \"./src/track.js\");\n/* harmony import */ var _ARow_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ARow.vue */ \"./src/components/ARow.vue\");\n/* harmony import */ var _ARows_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ARows.vue */ \"./src/components/ARows.vue\");\n\n\n\n\n\n\nconst Modes = {\n Text: 0,\n List: 1,\n Settings: 2\n};\nconst FormatLabels = {\n artist: 'Artiste',\n album: 'Album',\n year: 'Année',\n tags: 'Tags',\n title: 'Titre'\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n components: {\n ARow: _ARow_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n ARows: _ARows_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n },\n props: {\n listClass: String,\n itemClass: String\n },\n data() {\n return {\n dataEl: String,\n Modes: Modes,\n FormatLabels: FormatLabels,\n mode: Modes.Text,\n set: new _model__WEBPACK_IMPORTED_MODULE_2__.Set(_track__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n columns: ['artist', 'title', 'tags', 'album', 'year']\n };\n },\n computed: {\n items() {\n return this.set.items;\n },\n rowsSlots() {\n return Object.keys(this.$slots).filter(x => x.startsWith('row-') || x.startsWith('rows-')).map(x => [x, x.startsWith('rows-') ? x.slice(5) : x]);\n }\n },\n methods: {\n onCellEvent(event) {\n switch (event.name) {\n case 'change':\n this.updateInput();\n break;\n }\n },\n formatMove({\n from,\n to\n }) {\n const value = this.columns[from];\n this.columns.splice(from, 1);\n this.columns.splice(to, 0, value);\n this.updateList();\n },\n listItemMove({\n from,\n to,\n set\n }) {\n set.move(from, to);\n this.updateInput();\n },\n updateList() {\n const items = this.toList(this.$refs.textarea.value, this.$refs.sep.value);\n this.set.reset(items);\n },\n updateInput() {\n const input = this.toText(this.items, this.$refs.sep.value);\n this.$refs.textarea.value = input;\n },\n /**\n * From input and separator, return list of items.\n */\n toList(input, sep) {\n var lines = input.split('\\n');\n var items = [];\n for (let line of lines) {\n line = line.trim();\n if (!line) continue;\n var lineBits = line.split(sep);\n var item = {};\n for (var col in this.columns) {\n if (col >= lineBits.length) break;\n const attr = this.columns[col];\n item[attr] = lineBits[col].trim();\n }\n item && items.push(item);\n }\n return items;\n },\n /**\n * From items and separator return a string\n */\n toText(items, sep) {\n var lines = [];\n sep = ` ${(sep || this.$refs.sep.value).trim()} `;\n for (let item of items) {\n if (!item) continue;\n var line = [];\n for (var col of this.columns) line.push(item.data[col] || '');\n line = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.dropRightWhile)(line, x => !x);\n lines.push(line.join(sep));\n }\n return lines.join('\\n');\n },\n /**\n * Load initial data\n */\n loadData({\n items = [],\n errors,\n fieldErrors,\n ...data\n }) {\n for (var item of items) this.set.push(item);\n }\n },\n mounted() {\n if (this.dataEl) {\n const el = document.getElementById(this.dataEl);\n if (el) {\n const data = JSON.parse(el.textContext);\n loadData(data);\n }\n }\n }\n});\n\n//# sourceURL=webpack://aircox-assets/./src/components/APlaylistEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Modes\": function() { return /* binding */ Modes; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model */ \"./src/model.js\");\n/* harmony import */ var _track__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../track */ \"./src/track.js\");\n/* harmony import */ var _ARow_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ARow.vue */ \"./src/components/ARow.vue\");\n/* harmony import */ var _ARows_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ARows.vue */ \"./src/components/ARows.vue\");\n\n\n\n\n\n\nconst Modes = {\n Text: 0,\n List: 1,\n Settings: 2\n};\nconst FormatLabels = {\n artist: 'Artiste',\n album: 'Album',\n year: 'Année',\n tags: 'Tags',\n title: 'Titre'\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n components: {\n ARow: _ARow_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n ARows: _ARows_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n },\n props: {\n dataEl: String,\n dataPrefix: String,\n listClass: String,\n itemClass: String\n },\n data() {\n return {\n Modes: Modes,\n FormatLabels: FormatLabels,\n mode: Modes.Text,\n set: new _model__WEBPACK_IMPORTED_MODULE_2__.Set(_track__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n columns: ['artist', 'title', 'tags', 'album', 'year'],\n extraData: {}\n };\n },\n computed: {\n items() {\n return this.set.items;\n },\n rowsSlots() {\n return Object.keys(this.$slots).filter(x => x.startsWith('row-') || x.startsWith('rows-')).map(x => [x, x.startsWith('rows-') ? x.slice(5) : x]);\n }\n },\n methods: {\n onCellEvent(event) {\n switch (event.name) {\n case 'change':\n this.updateInput();\n break;\n }\n },\n formatMove({\n from,\n to\n }) {\n const value = this.columns[from];\n this.columns.splice(from, 1);\n this.columns.splice(to, 0, value);\n this.updateList();\n },\n listItemMove({\n from,\n to,\n set\n }) {\n set.move(from, to);\n this.updateInput();\n },\n updateList() {\n const items = this.toList(this.$refs.textarea.value, this.$refs.sep.value);\n this.set.reset(items);\n },\n updateInput() {\n const input = this.toText(this.items, this.$refs.sep.value);\n this.$refs.textarea.value = input;\n },\n /**\n * From input and separator, return list of items.\n */\n toList(input, sep) {\n var lines = input.split('\\n');\n var items = [];\n for (let line of lines) {\n line = line.trim();\n if (!line) continue;\n var lineBits = line.split(sep);\n var item = {};\n for (var col in this.columns) {\n if (col >= lineBits.length) break;\n const attr = this.columns[col];\n item[attr] = lineBits[col].trim();\n }\n item && items.push(item);\n }\n return items;\n },\n /**\n * From items and separator return a string\n */\n toText(items, sep) {\n var lines = [];\n sep = ` ${(sep || this.$refs.sep.value).trim()} `;\n for (let item of items) {\n if (!item) continue;\n var line = [];\n for (var col of this.columns) line.push(item.data[col] || '');\n line = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.dropRightWhile)(line, x => !x);\n lines.push(line.join(sep));\n }\n return lines.join('\\n');\n },\n _data_key(key) {\n key = key.slice(this.dataPrefix.length);\n try {\n var [index, attr] = key.split('-', 1);\n return [Number(index), attr];\n } catch (err) {\n return [null, key];\n }\n },\n /**\n * Load initial data\n */\n loadData({\n items = []\n }) {\n for (var index in items) this.set.push(items[index]);\n this.updateInput();\n }\n },\n mounted() {\n if (this.dataEl) {\n const el = document.getElementById(this.dataEl);\n if (el) {\n const data = JSON.parse(el.textContent);\n this.loadData(data);\n }\n }\n this.mode = this.items ? Modes.List : Modes.Text;\n }\n});\n\n//# sourceURL=webpack://aircox-assets/./src/components/APlaylistEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), @@ -95,7 +95,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ \**************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model */ \"./src/model.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n emit: ['move', 'cell'],\n props: {\n item: Object,\n index: Number,\n columns: Array,\n orderable: {\n type: Boolean,\n default: false\n }\n },\n computed: {\n itemData() {\n return this.item instanceof _model__WEBPACK_IMPORTED_MODULE_0__[\"default\"] ? this.item.data : this.item;\n }\n },\n methods: {\n /// Emit a 'cell' event.\n /// Event data: `{index, name, data, item, attr}`\n ///\n /// @param {Number} col: cell column's index\n /// @param {String} name: cell's event name\n /// @param {} data: cell's event data\n cellEmit(name, col, data) {\n this.$emit('cell', {\n name,\n col,\n data,\n item: this.item,\n attr: this.columns[col]\n });\n },\n onDragStart(ev) {\n const dataset = ev.target.dataset;\n const data = `cell:${dataset.index}`;\n ev.dataTransfer.setData(\"text/cell\", data);\n ev.dataTransfer.dropEffect = 'move';\n },\n onDragOver(ev) {\n ev.preventDefault();\n ev.dataTransfer.dropEffect = 'move';\n },\n onDrop(ev) {\n const data = ev.dataTransfer.getData(\"text/cell\");\n if (!data || !data.startsWith('cell:')) return;\n ev.preventDefault();\n this.$emit('move', {\n from: Number(data.slice(5)),\n to: Number(ev.target.dataset.index)\n });\n }\n }\n});\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARow.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model */ \"./src/model.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n emit: ['move', 'cell'],\n props: {\n item: Object,\n cell: Object,\n orderable: {\n type: Boolean,\n default: false\n }\n },\n computed: {\n row() {\n return this.cell.row || 0;\n },\n columns() {\n return this.cell.columns;\n },\n itemData() {\n return this.item instanceof _model__WEBPACK_IMPORTED_MODULE_2__[\"default\"] ? this.item.data : this.item;\n },\n cells() {\n const cell = (0,vue__WEBPACK_IMPORTED_MODULE_1__.isReactive)(this.cell) && (0,vue__WEBPACK_IMPORTED_MODULE_1__.toRefs)(this.cell) || this.cell;\n const cells = [];\n for (var col in this.columns) cells.push({\n ...cell,\n col: Number(col)\n });\n return cells;\n },\n cellEls() {\n return [...this.$el.querySelectorAll('td')].filter(x => x.dataset.col);\n }\n },\n methods: {\n /// Emit a 'cell' event.\n /// Event data: `{name, data, item, attr}`\n ///\n /// @param {Number} col: cell column's index\n /// @param {String} name: cell's event name\n /// @param {} data: cell's event data\n cellEmit(name, cell, data) {\n this.$emit('cell', {\n name,\n cell,\n data,\n item: this.item\n });\n },\n onDragStart(ev) {\n const dataset = ev.target.dataset;\n const data = `cell:${dataset.col}`;\n ev.dataTransfer.setData(\"text/cell\", data);\n ev.dataTransfer.dropEffect = 'move';\n },\n onDragOver(ev) {\n ev.preventDefault();\n ev.dataTransfer.dropEffect = 'move';\n },\n onDrop(ev) {\n const data = ev.dataTransfer.getData(\"text/cell\");\n if (!data || !data.startsWith('cell:')) return;\n ev.preventDefault();\n this.$emit('move', {\n from: Number(data.slice(5)),\n to: Number(ev.target.dataset.col)\n });\n },\n focus(col, from) {\n if (from) col += from.col;\n const target = this.cellEls[col];\n if (!target) return;\n const control = target.querySelector('input') || target.querySelector('button') || target.querySelector('select') || target.querySelector('a');\n control && control.focus();\n }\n },\n mounted() {\n this.$el.__row = this;\n }\n});\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARow.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), @@ -105,7 +105,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod \***************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _AList_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AList.vue */ \"./src/components/AList.vue\");\n/* harmony import */ var _ARow_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ARow.vue */ \"./src/components/ARow.vue\");\n\n\n\nconst Component = {\n extends: _AList_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n components: {\n ARow: _ARow_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n emit: ['cell'],\n props: {\n ..._AList_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].props,\n columns: Array,\n labels: Object,\n allowCreate: Boolean\n },\n data() {\n return {\n ...super.data,\n extraItem: new this.set.model()\n };\n },\n computed: {\n rowSlots() {\n return Object.keys(this.$slots).filter(x => x.startsWith('row-')).map(x => [x, x.slice(4)]);\n }\n },\n methods: {\n validateExtraCell() {\n if (!this.allowCreate) return;\n this.set.push(this.extraItem);\n this.extraItem = new this.set.model();\n },\n /// React on 'cell' event, re-emitting it with additional values:\n /// - `set`: data set\n /// - `row`: row index\n ///\n /// @param {Number} row: row index\n /// @param {} data: cell's event data\n onCellEvent(row, event) {\n this.$emit('cell', {\n ...event,\n row,\n set: this.set\n });\n }\n }\n};\nComponent.props.itemTag.default = 'tr';\nComponent.props.listTag.default = 'tbody';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Component);\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARows.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _AList_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AList.vue */ \"./src/components/AList.vue\");\n/* harmony import */ var _ARow_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ARow.vue */ \"./src/components/ARow.vue\");\n\n\n\nconst Component = {\n extends: _AList_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n components: {\n ARow: _ARow_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n emit: ['cell'],\n props: {\n ..._AList_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].props,\n columns: Array,\n labels: Object,\n allowCreate: Boolean\n },\n data() {\n return {\n ...super.data,\n extraItem: new this.set.model()\n };\n },\n computed: {\n rowCells() {\n const cells = [];\n for (var row in this.items) cells.push({\n row,\n columns: this.columns\n });\n },\n rows() {\n return [...this.$el.querySelectorAll('tr')].filter(x => x.__row).map(x => x.__row);\n },\n rowSlots() {\n return Object.keys(this.$slots).filter(x => x.startsWith('row-')).map(x => [x, x.slice(4)]);\n }\n },\n methods: {\n validateExtraCell() {\n if (!this.allowCreate) return;\n this.set.push(this.extraItem);\n this.extraItem = new this.set.model();\n },\n onControlKey(event, cell) {\n switch (event.key) {\n case \"ArrowUp\":\n this.focus(-1, 0, cell);\n event.stopPropagation();\n event.preventDefault();\n break;\n case \"ArrowDown\":\n this.focus(1, 0, cell);\n event.stopPropagation();\n event.preventDefault();\n break;\n case \"ArrowLeft\":\n this.focus(0, -1, cell);\n event.stopPropagation();\n event.preventDefault();\n break;\n case \"ArrowRight\":\n this.focus(0, 1, cell);\n event.stopPropagation();\n event.preventDefault();\n break;\n }\n },\n /**\n * React on 'cell' event, re-emitting it with additional values:\n * - `set`: data set\n * - `row`: row index\n *\n * @param {Number} row: row index\n * @param {} data: cell's event data\n */\n onCellEvent(row, event) {\n if (event.name == 'focus') this.cellFocus(event.data, event.cell);\n this.$emit('cell', {\n ...event,\n row,\n set: this.set\n });\n },\n getCellNode(row, col) {\n const el = this.$refs[row];\n return el && el.cellEls(col);\n },\n /**\n * Focus on a cell\n */\n focus(row, col, from = null) {\n if (from) row += from.row;\n row = this.rows[row];\n row && row.focus(col, from);\n }\n }\n};\nComponent.props.itemTag.default = 'tr';\nComponent.props.listTag.default = 'tbody';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Component);\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARows.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), @@ -205,7 +205,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*****************************************************************************************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"playlist-editor\"\n};\nconst _hoisted_2 = {\n class: \"tabs\"\n};\nconst _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"a\", null, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon is-small\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-pencil\"\n})]), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" Texte \")], -1 /* HOISTED */);\nconst _hoisted_4 = [_hoisted_3];\nconst _hoisted_5 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"a\", null, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon is-small\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-list\"\n})]), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" Liste \")], -1 /* HOISTED */);\nconst _hoisted_6 = [_hoisted_5];\nconst _hoisted_7 = {\n class: \"page\"\n};\nconst _hoisted_8 = {\n class: \"columns mt-2\"\n};\nconst _hoisted_9 = {\n class: \"column field is-vcentered\"\n};\nconst _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"label\", {\n class: \"label is-inline mr-2\",\n style: {\n \"vertical-align\": \"middle\"\n }\n}, \" Ordre\", -1 /* HOISTED */);\nconst _hoisted_11 = {\n class: \"table is-bordered is-inline-block\",\n style: {\n \"vertical-align\": \"middle\"\n }\n};\nconst _hoisted_12 = {\n class: \"column field is-vcentered\"\n};\nconst _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"label\", {\n class: \"label is-inline mr-2\",\n style: {\n \"vertical-align\": \"middle\"\n }\n}, \" Séparateur\", -1 /* HOISTED */);\nconst _hoisted_14 = {\n class: \"control is-inline-block\",\n style: {\n \"vertical-align\": \"middle\"\n }\n};\nconst _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"column\"\n}, null, -1 /* HOISTED */);\nconst _hoisted_16 = {\n class: \"page\"\n};\nconst _hoisted_17 = {\n class: \"page\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_a_row = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-row\");\n const _component_a_rows = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-rows\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"top\", {\n set: $data.set,\n columns: $data.columns,\n items: $options.items\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"ul\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"li\", {\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({\n 'is-active': $data.mode == $data.Modes.Text\n }),\n onClick: _cache[0] || (_cache[0] = $event => $data.mode = $data.Modes.Text)\n }, _hoisted_4, 2 /* CLASS */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"li\", {\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({\n 'is-active': $data.mode == $data.Modes.List\n }),\n onClick: _cache[1] || (_cache[1] = $event => $data.mode = $data.Modes.List)\n }, _hoisted_6, 2 /* CLASS */)])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"section\", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"textarea\", {\n ref: \"textarea\",\n class: \"is-fullwidth\",\n style: {\n \"height\": \"10em\"\n },\n onChange: _cache[2] || (_cache[2] = (...args) => $options.updateList && $options.updateList(...args))\n }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_9, [_hoisted_10, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"table\", _hoisted_11, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"tr\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_row, {\n columns: $data.columns,\n item: $data.FormatLabels,\n onMove: $options.formatMove,\n orderable: true\n }, null, 8 /* PROPS */, [\"columns\", \"item\", \"onMove\"])])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_12, [_hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"input\", {\n type: \"text\",\n ref: \"sep\",\n value: \"--\",\n class: \"input is-inline\",\n onChange: _cache[3] || (_cache[3] = $event => $options.updateList())\n }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)])]), _hoisted_15])], 512 /* NEED_PATCH */), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $data.mode == $data.Modes.Text]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"section\", _hoisted_16, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_rows, {\n set: $data.set,\n columns: $data.columns,\n labels: $data.FormatLabels,\n \"allow-create\": true,\n \"list-class\": $props.listClass,\n \"item-class\": $props.itemClass,\n orderable: true,\n onMove: $options.listItemMove,\n onCell: $options.onCellEvent\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.rowsSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps)(data)))])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"set\", \"columns\", \"labels\", \"list-class\", \"item-class\", \"onMove\", \"onCell\"])], 512 /* NEED_PATCH */), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $data.mode == $data.Modes.List]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"section\", _hoisted_17, null, 512 /* NEED_PATCH */), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $data.mode == $data.Modes.Settings]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"bottom\", {\n set: $data.set,\n columns: $data.columns,\n items: $options.items\n })]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/APlaylistEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"playlist-editor\"\n};\nconst _hoisted_2 = {\n class: \"columns\"\n};\nconst _hoisted_3 = {\n class: \"column\"\n};\nconst _hoisted_4 = {\n class: \"column has-text-right\"\n};\nconst _hoisted_5 = {\n class: \"float-right field has-addons\"\n};\nconst _hoisted_6 = {\n class: \"control\"\n};\nconst _hoisted_7 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon is-small\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-pencil\"\n})], -1 /* HOISTED */);\nconst _hoisted_8 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", null, \"Texte\", -1 /* HOISTED */);\nconst _hoisted_9 = [_hoisted_7, _hoisted_8];\nconst _hoisted_10 = {\n class: \"control\"\n};\nconst _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon is-small\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-list\"\n})], -1 /* HOISTED */);\nconst _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", null, \"Liste\", -1 /* HOISTED */);\nconst _hoisted_13 = [_hoisted_11, _hoisted_12];\nconst _hoisted_14 = {\n class: \"page\"\n};\nconst _hoisted_15 = {\n class: \"columns mt-2\"\n};\nconst _hoisted_16 = {\n class: \"column field is-vcentered\"\n};\nconst _hoisted_17 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"label\", {\n class: \"label is-inline mr-2\",\n style: {\n \"vertical-align\": \"middle\"\n }\n}, \" Ordre\", -1 /* HOISTED */);\nconst _hoisted_18 = {\n class: \"table is-bordered is-inline-block\",\n style: {\n \"vertical-align\": \"middle\"\n }\n};\nconst _hoisted_19 = {\n class: \"column field is-vcentered\"\n};\nconst _hoisted_20 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"label\", {\n class: \"label is-inline mr-2\",\n style: {\n \"vertical-align\": \"middle\"\n }\n}, \" Séparateur\", -1 /* HOISTED */);\nconst _hoisted_21 = {\n class: \"control is-inline-block\",\n style: {\n \"vertical-align\": \"middle\"\n }\n};\nconst _hoisted_22 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"column\"\n}, null, -1 /* HOISTED */);\nconst _hoisted_23 = {\n class: \"page\"\n};\nconst _hoisted_24 = {\n class: \"page\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_a_row = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-row\");\n const _component_a_rows = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-rows\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"title\")]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"a\", {\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(['button', 'p-2', $data.mode == $data.Modes.Text ? 'is-primary' : 'is-light']),\n onClick: _cache[0] || (_cache[0] = $event => $data.mode = $data.Modes.Text)\n }, _hoisted_9, 2 /* CLASS */)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"a\", {\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(['button', 'p-2', $data.mode == $data.Modes.List ? 'is-primary' : 'is-light']),\n onClick: _cache[1] || (_cache[1] = $event => $data.mode = $data.Modes.List)\n }, _hoisted_13, 2 /* CLASS */)])])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"top\", {\n set: $data.set,\n columns: $data.columns,\n items: $options.items\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"section\", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"textarea\", {\n ref: \"textarea\",\n class: \"is-fullwidth\",\n rows: \"20\",\n onChange: _cache[2] || (_cache[2] = (...args) => $options.updateList && $options.updateList(...args))\n }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_15, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_16, [_hoisted_17, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"table\", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"tr\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_row, {\n cell: {\n columns: $data.columns\n },\n item: $data.FormatLabels,\n onMove: $options.formatMove,\n orderable: true\n }, null, 8 /* PROPS */, [\"cell\", \"item\", \"onMove\"])])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_19, [_hoisted_20, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_21, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"input\", {\n type: \"text\",\n ref: \"sep\",\n value: \"--\",\n class: \"input is-inline\",\n onChange: _cache[3] || (_cache[3] = $event => $options.updateList())\n }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)])]), _hoisted_22])], 512 /* NEED_PATCH */), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $data.mode == $data.Modes.Text]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"section\", _hoisted_23, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_rows, {\n set: $data.set,\n columns: $data.columns,\n labels: $data.FormatLabels,\n \"allow-create\": true,\n \"list-class\": $props.listClass,\n \"item-class\": $props.itemClass,\n orderable: true,\n onMove: $options.listItemMove,\n onCell: $options.onCellEvent\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.rowsSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps)(data)))])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"set\", \"columns\", \"labels\", \"list-class\", \"item-class\", \"onMove\", \"onCell\"])], 512 /* NEED_PATCH */), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $data.mode == $data.Modes.List]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"section\", _hoisted_24, null, 512 /* NEED_PATCH */), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $data.mode == $data.Modes.Settings]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"bottom\", {\n set: $data.set,\n columns: $data.columns,\n items: $options.items\n })]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/APlaylistEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), @@ -225,7 +225,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \******************************************************************************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = [\"data-index\", \"draggable\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"tr\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"head\", {\n item: $props.item,\n row: $props.index\n }), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.columns, (attr, col) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"td\", {\n key: col,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(['cell', 'cell-' + attr]),\n \"data-index\": col,\n draggable: $props.orderable,\n onDragstart: _cache[0] || (_cache[0] = (...args) => $options.onDragStart && $options.onDragStart(...args)),\n onDragover: _cache[1] || (_cache[1] = (...args) => $options.onDragOver && $options.onDragOver(...args)),\n onDrop: _cache[2] || (_cache[2] = (...args) => $options.onDrop && $options.onDrop(...args))\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, attr, {\n item: $props.item,\n row: $props.index,\n col: col,\n data: $options.itemData,\n attr: attr,\n emit: $options.cellEmit,\n value: $options.itemData && $options.itemData[attr]\n }, () => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.itemData && $options.itemData[attr]), 1 /* TEXT */)])], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_1);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"tail\", {\n item: $props.item,\n row: $props.index\n })]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARow.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = [\"data-col\", \"draggable\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"tr\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"head\", {\n item: $props.item,\n row: $options.row\n }), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.columns, (attr, col) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"td\", {\n key: col,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(['cell', 'cell-' + attr]),\n \"data-col\": col,\n draggable: $props.orderable,\n onDragstart: _cache[0] || (_cache[0] = (...args) => $options.onDragStart && $options.onDragStart(...args)),\n onDragover: _cache[1] || (_cache[1] = (...args) => $options.onDragOver && $options.onDragOver(...args)),\n onDrop: _cache[2] || (_cache[2] = (...args) => $options.onDrop && $options.onDrop(...args))\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, attr, {\n item: $props.item,\n cell: $options.cells[col],\n data: $options.itemData,\n attr: attr,\n emit: $options.cellEmit,\n value: $options.itemData && $options.itemData[attr]\n }, () => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.itemData && $options.itemData[attr]), 1 /* TEXT */)])], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_1);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"tail\", {\n item: $props.item,\n row: $props.cell.row\n })]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARow.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), @@ -235,7 +235,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \*******************************************************************************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"table is-stripped is-fullwidth\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_a_row = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-row\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"table\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"thead\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"tr\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"header-head\"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.columns, col => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"th\", {\n key: col,\n style: {\n \"vertical-align\": \"middle\"\n }\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.labels[col]), 1 /* TEXT */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"header-tail\")])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"tbody\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"head\"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.items, (item, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_a_row, {\n key: index,\n item: item,\n index: index,\n columns: _ctx.columns,\n \"data-index\": index,\n draggable: _ctx.orderable,\n onDragstart: _ctx.onDragStart,\n onDragover: _ctx.onDragOver,\n onDrop: _ctx.onDrop,\n onCell: $event => _ctx.onCellEvent(index, $event)\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.rowSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps)(data)))])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"item\", \"index\", \"columns\", \"data-index\", \"draggable\", \"onDragstart\", \"onDragover\", \"onDrop\", \"onCell\"]);\n }), 128 /* KEYED_FRAGMENT */)), _ctx.allowCreate ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_a_row, {\n key: 0,\n item: _ctx.extraItem,\n index: _ctx.items.length,\n columns: _ctx.columns,\n onKeypress: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)(_ctx.validateExtraCell, [\"stop\", \"prevent\"]), [\"enter\"])\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.rowSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps)(data)))])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"item\", \"index\", \"columns\", \"onKeypress\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"tail\")])]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARows.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"table is-stripped is-fullwidth\"\n};\nconst _hoisted_2 = [\"onKeydownCapture\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_a_row = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-row\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"table\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"thead\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"tr\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"header-head\"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.columns, col => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"th\", {\n key: col,\n style: {\n \"vertical-align\": \"middle\"\n }\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.labels[col]), 1 /* TEXT */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"header-tail\")])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"tbody\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"head\"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.items, (item, row) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n key: row\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" data-index comes from AList component drag & drop \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_row, {\n item: item,\n cell: {\n row,\n columns: _ctx.columns\n },\n \"data-index\": row,\n draggable: _ctx.orderable,\n onDragstart: _ctx.onDragStart,\n onDragover: _ctx.onDragOver,\n onDrop: _ctx.onDrop,\n onCell: _cache[0] || (_cache[0] = $event => _ctx.onCellEvent(_ctx.index, $event))\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.rowSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [slot == 'head' || slot == 'tail' ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps)({\n key: 0\n }, data))) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 1,\n onKeydownCapture: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => _ctx.onControlKey($event, data.cell), [\"ctrl\"])\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps)(data)))], 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_2))])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"item\", \"cell\", \"data-index\", \"draggable\", \"onDragstart\", \"onDragover\", \"onDrop\"])], 64 /* STABLE_FRAGMENT */);\n }), 128 /* KEYED_FRAGMENT */)), _ctx.allowCreate ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_a_row, {\n key: 0,\n item: _ctx.extraItem,\n cell: {\n row: _ctx.items.length,\n columns: _ctx.columns\n },\n onKeypress: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)(_ctx.validateExtraCell, [\"stop\", \"prevent\"]), [\"enter\"])\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.rowSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.guardReactiveProps)(data)))])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"item\", \"cell\", \"onKeypress\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"tail\")])]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/ARows.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), @@ -325,7 +325,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \**********************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Set\": function() { return /* binding */ Set; },\n/* harmony export */ \"default\": function() { return /* binding */ Model; },\n/* harmony export */ \"getCsrf\": function() { return /* binding */ getCsrf; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n\n/**\n * Return cookie with provided key\n */\nfunction getCookie(key) {\n if (document.cookie && document.cookie !== '') {\n const cookie = document.cookie.split(';').find(c => c.trim().startsWith(key + '='));\n return cookie ? decodeURIComponent(cookie.split('=')[1]) : null;\n }\n return null;\n}\n\n/**\n * CSRF token provided by Django\n */\nvar csrfToken = null;\n\n/**\n * Get CSRF token\n */\nfunction getCsrf() {\n if (csrfToken === null) csrfToken = getCookie('csrftoken');\n return csrfToken;\n}\n\n// TODO: prevent duplicate simple fetch\n/**\n * Provide interface used to fetch and manipulate objects.\n */\nclass Model {\n /**\n * Instanciate model with provided data and options.\n * By default `url` is taken from `data.url_`.\n */\n constructor(data = {}, {\n url = null,\n ...options\n } = {}) {\n this.url = url || data.url_;\n this.options = options;\n this.commit(data);\n }\n\n /**\n * Get instance id from its data\n */\n static getId(data) {\n return data.id;\n }\n\n /**\n * Return fetch options\n */\n static getOptions(options) {\n return {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'X-CSRFToken': getCsrf()\n },\n ...options\n };\n }\n\n /**\n * Return model instances for the provided list of model data.\n * @param {Array} items: array of data\n * @param {Object} options: options passed down to all model instances\n */\n static fromList(items, options = {}) {\n return items ? items.map(d => new this(d, options)) : [];\n }\n\n /**\n * Fetch item from server\n */\n static fetch(url, {\n many = false,\n ...options\n } = {}, args = {}) {\n options = this.getOptions(options);\n const request = fetch(url, options).then(response => response.json());\n if (many) return request.then(data => {\n if (!(data instanceof Array)) data = data.results;\n return this.fromList(data, args);\n });else return request.then(data => new this(data, {\n url: url,\n ...args\n }));\n }\n\n /**\n * Fetch data from server.\n */\n fetch(options) {\n options = this.constructor.getOptions(options);\n return fetch(this.url, options).then(response => response.json()).then(data => this.commit(data));\n }\n\n /**\n * Call API action on object.\n */\n action(path, options, commit = false) {\n options = this.constructor.getOptions(options);\n const promise = fetch(this.url + path, options);\n return commit ? promise.then(data => data.json()).then(data => {\n this.commit(data);\n this.data;\n }) : promise;\n }\n\n /**\n * Update instance's data with provided data. Return None\n */\n commit(data) {\n this.id = this.constructor.getId(data);\n this.data = data;\n }\n\n /**\n * Save instance into localStorage.\n */\n store(key) {\n window.localStorage.setItem(key, JSON.stringify(this.data));\n }\n\n /**\n * Load model instance from localStorage.\n */\n static storeLoad(key) {\n let item = window.localStorage.getItem(key);\n return item === null ? item : new this(JSON.parse(item));\n }\n}\n\n/**\n * List of models\n */\nclass Set {\n constructor(model, {\n items = [],\n url = null,\n args = {},\n unique = null,\n max = null,\n storeKey = null\n } = {}) {\n this.items = [];\n this.model = model;\n this.url = url;\n this.unique = unique;\n this.max = max;\n this.storeKey = storeKey;\n for (var item of items) this.push(item, {\n args: args,\n save: false\n });\n }\n get length() {\n return this.items.length;\n }\n\n /**\n * Fetch multiple items from server\n */\n static fetch(model, url, options = null, args = null) {\n options = model.getOptions(options);\n return fetch(url, options).then(response => response.json()).then(data => (data instanceof Array ? data : data.results).map(d => new model(d, {\n url: url,\n ...args\n })));\n }\n\n /**\n * Load list from localStorage\n */\n static storeLoad(model, key, args = {}) {\n let items = window.localStorage.getItem(key);\n return new this(model, {\n ...args,\n storeKey: key,\n items: items ? JSON.parse(items) : []\n });\n }\n\n /**\n * Store list into localStorage\n */\n store() {\n this.storeKey && window.localStorage.setItem(this.storeKey, JSON.stringify(this.items.map(i => i.data)));\n }\n\n /**\n * Save item\n */\n save() {\n this.storeKey && this.store();\n }\n\n /**\n * Get item at index\n */\n get(index) {\n return this.items[index];\n }\n\n /**\n * Find an item by id or using a predicate function\n */\n find(pred) {\n return pred instanceof Function ? this.items.find(pred) : this.items.find(x => x.id == pred.id);\n }\n\n /**\n * Find item index by id or using a predicate function\n */\n findIndex(pred) {\n return pred instanceof Function ? this.items.findIndex(pred) : this.items.findIndex(x => x.id == pred.id);\n }\n\n /**\n * Add item to set, return index.\n */\n push(item, {\n args = {},\n save = true\n } = {}) {\n item = item instanceof this.model ? item : new this.model(item, args);\n if (this.unique) {\n let index = this.findIndex(item);\n if (index > -1) return index;\n }\n if (this.max && this.items.length >= this.max) this.items.splice(0, this.items.length - this.max);\n this.items.push(item);\n save && this.save();\n return this.items.length - 1;\n }\n\n /**\n * Remove item from set by index\n */\n remove(index, {\n save = true\n } = {}) {\n this.items.splice(index, 1);\n save && this.save();\n }\n\n /**\n * Clear items, assign new ones\n */\n reset(items = []) {\n // TODO: check reactivity\n this.items = [];\n for (var item of items) this.push(item);\n }\n move(from, to) {\n if (from >= this.length || to > this.length) throw \"source or target index is not in range\";\n const value = this.items[from];\n this.items.splice(from, 1);\n this.items.splice(to, 0, value);\n }\n}\nSet[Symbol.iterator] = function () {\n return this.items[Symbol.iterator]();\n};\n\n//# sourceURL=webpack://aircox-assets/./src/model.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Set\": function() { return /* binding */ Set; },\n/* harmony export */ \"default\": function() { return /* binding */ Model; },\n/* harmony export */ \"getCsrf\": function() { return /* binding */ getCsrf; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n\n/**\n * Return cookie with provided key\n */\nfunction getCookie(key) {\n if (document.cookie && document.cookie !== '') {\n const cookie = document.cookie.split(';').find(c => c.trim().startsWith(key + '='));\n return cookie ? decodeURIComponent(cookie.split('=')[1]) : null;\n }\n return null;\n}\n\n/**\n * CSRF token provided by Django\n */\nvar csrfToken = null;\n\n/**\n * Get CSRF token\n */\nfunction getCsrf() {\n if (csrfToken === null) csrfToken = getCookie('csrftoken');\n return csrfToken;\n}\n\n// TODO: prevent duplicate simple fetch\n/**\n * Provide interface used to fetch and manipulate objects.\n */\nclass Model {\n /**\n * Instanciate model with provided data and options.\n * By default `url` is taken from `data.url_`.\n */\n constructor(data = {}, {\n url = null,\n ...options\n } = {}) {\n this.url = url || data.url_;\n this.options = options;\n this.commit(data);\n }\n get errors() {\n return this.data.__errors__;\n }\n\n /**\n * Get instance id from its data\n */\n static getId(data) {\n return 'id' in data ? data.id : data.pk;\n }\n\n /**\n * Return fetch options\n */\n static getOptions(options) {\n return {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'X-CSRFToken': getCsrf()\n },\n ...options\n };\n }\n\n /**\n * Return model instances for the provided list of model data.\n * @param {Array} items: array of data\n * @param {Object} options: options passed down to all model instances\n */\n static fromList(items, options = {}) {\n return items ? items.map(d => new this(d, options)) : [];\n }\n\n /**\n * Fetch item from server\n */\n static fetch(url, {\n many = false,\n ...options\n } = {}, args = {}) {\n options = this.getOptions(options);\n const request = fetch(url, options).then(response => response.json());\n if (many) return request.then(data => {\n if (!(data instanceof Array)) data = data.results;\n return this.fromList(data, args);\n });else return request.then(data => new this(data, {\n url: url,\n ...args\n }));\n }\n\n /**\n * Fetch data from server.\n */\n fetch(options) {\n options = this.constructor.getOptions(options);\n return fetch(this.url, options).then(response => response.json()).then(data => this.commit(data));\n }\n\n /**\n * Call API action on object.\n */\n action(path, options, commit = false) {\n options = this.constructor.getOptions(options);\n const promise = fetch(this.url + path, options);\n return commit ? promise.then(data => data.json()).then(data => {\n this.commit(data);\n this.data;\n }) : promise;\n }\n\n /**\n * Update instance's data with provided data. Return None\n */\n commit(data) {\n this.data = data;\n this.id = this.constructor.getId(this.data);\n }\n\n /**\n * Update model data, without reset previous value\n */\n update(data) {\n this.data = {\n ...this.data,\n ...data\n };\n this.id = this.constructor.getId(this.data);\n }\n\n /**\n * Save instance into localStorage.\n */\n store(key) {\n window.localStorage.setItem(key, JSON.stringify(this.data));\n }\n\n /**\n * Load model instance from localStorage.\n */\n static storeLoad(key) {\n let item = window.localStorage.getItem(key);\n return item === null ? item : new this(JSON.parse(item));\n }\n\n /**\n * Return error for a specific attribute name if any \n */\n error(attr = null) {\n return attr === null ? this.errors : this.errors && this.errors[attr];\n }\n}\n\n/**\n * List of models\n */\nclass Set {\n constructor(model, {\n items = [],\n url = null,\n args = {},\n unique = null,\n max = null,\n storeKey = null\n } = {}) {\n this.items = [];\n this.model = model;\n this.url = url;\n this.unique = unique;\n this.max = max;\n this.storeKey = storeKey;\n for (var item of items) this.push(item, {\n args: args,\n save: false\n });\n }\n get length() {\n return this.items.length;\n }\n\n /**\n * Fetch multiple items from server\n */\n static fetch(model, url, options = null, args = null) {\n options = model.getOptions(options);\n return fetch(url, options).then(response => response.json()).then(data => (data instanceof Array ? data : data.results).map(d => new model(d, {\n url: url,\n ...args\n })));\n }\n\n /**\n * Load list from localStorage\n */\n static storeLoad(model, key, args = {}) {\n let items = window.localStorage.getItem(key);\n return new this(model, {\n ...args,\n storeKey: key,\n items: items ? JSON.parse(items) : []\n });\n }\n\n /**\n * Store list into localStorage\n */\n store() {\n this.storeKey && window.localStorage.setItem(this.storeKey, JSON.stringify(this.items.map(i => i.data)));\n }\n\n /**\n * Save item\n */\n save() {\n this.storeKey && this.store();\n }\n\n /**\n * Get item at index\n */\n get(index) {\n return this.items[index];\n }\n\n /**\n * Find an item by id or using a predicate function\n */\n find(pred) {\n return pred instanceof Function ? this.items.find(pred) : this.items.find(x => x.id == pred.id);\n }\n\n /**\n * Find item index by id or using a predicate function\n */\n findIndex(pred) {\n return pred instanceof Function ? this.items.findIndex(pred) : this.items.findIndex(x => x.id == pred.id);\n }\n\n /**\n * Add item to set, return index.\n */\n push(item, {\n args = {},\n save = true\n } = {}) {\n item = item instanceof this.model ? item : new this.model(item, args);\n if (this.unique) {\n let index = this.findIndex(item);\n if (index > -1) return index;\n }\n if (this.max && this.items.length >= this.max) this.items.splice(0, this.items.length - this.max);\n this.items.push(item);\n save && this.save();\n return this.items.length - 1;\n }\n\n /**\n * Remove item from set by index\n */\n remove(index, {\n save = true\n } = {}) {\n this.items.splice(index, 1);\n save && this.save();\n }\n\n /**\n * Clear items, assign new ones\n */\n reset(items = []) {\n // TODO: check reactivity\n this.items = [];\n for (var item of items) this.push(item);\n }\n move(from, to) {\n if (from >= this.length || to > this.length) throw \"source or target index is not in range\";\n const value = this.items[from];\n this.items.splice(from, 1);\n this.items.splice(to, 0, value);\n }\n}\nSet[Symbol.iterator] = function () {\n return this.items[Symbol.iterator]();\n};\n\n//# sourceURL=webpack://aircox-assets/./src/model.js?"); /***/ }), diff --git a/aircox/templates/admin/aircox/playlist_inline.html b/aircox/templates/admin/aircox/playlist_inline.html index ba6ef3e..9255e20 100644 --- a/aircox/templates/admin/aircox/playlist_inline.html +++ b/aircox/templates/admin/aircox/playlist_inline.html @@ -4,21 +4,18 @@ {# include "adminsortable2/edit_inline/tabular-django-4.1.html" #} {% with inline_admin_formset as admin_formset %} {% with admin_formset.formset as formset %} + +
-
{% trans "Playlist" %}
- {{ admin_formset.non_form_errors }} - - + +