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,CAAF,EAJqB,CAAP,CAAhB,CADgE,CASlE,CAKLhU,gBA7BoBA,QAAQ,CAAC7B,CAAD,CAAS0B,CAAT,CAAiBC,CAAjB,CAAuB,CACnD,MAAMoU,EAAmB,GAAElC,CAAOY,CAAAA,MAAP,EAAgBC,CAAAA,WAAlB,eAA4C/M,KAAM0M,CAAAA,WAAlD,4BACzB,OAAOtL,QAAQC,CAAAA,OAAR,CAAgBiH,CAAEsF,CAAAA,OAAF,CAAUQ,CAAV,CAA2B9F,CAAEsE,CAAAA,KAAF,CAAQ,CACxDvU,OAAQA,CADgD,CAExD0B,OAAQA,CAFgD,CAGxDU,IAAKT,CAHmD,CAAR,CAI/C,CAAA,CAJ+C,CAA3B,CAIb2F,CAAAA,IAJa,CAIR0N,CAJQ,CAAhB,CAF4C,CAwB9C,CAtHiE,CAA1E,C;ACIA7X,MAAA,CAAO,0BAAP,CAAmC,QAAS,EAAG,EAA/C;", "sources":["Logic.js","displayerXObjectPropertyHelper.js","editBus.js","jsonMerge.js","liveDataSource.js","polyfills.js"], "sourcesContent":["/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\n\ndefine('xwiki-livedata', [\n \"vue\",\n \"vue-i18n\",\n \"xwiki-livedata-vue\",\n \"xwiki-livedata-source\",\n \"xwiki-json-merge\",\n \"edit-bus\",\n \"xwiki-livedata-polyfills\"\n], function(\n Vue,\n VueI18n,\n XWikiLivedata,\n liveDataSource,\n jsonMerge,\n editBus\n) {\n\n /**\n * Make vue use the i18n plugin\n */\n Vue.use(VueI18n);\n\n\n /**\n * Map the element to its data object\n * So that each instance of the livedata on the page handle there own data\n */\n const instancesMap = new WeakMap();\n\n\n\n /**\n * The init function of the logic script\n * For each livedata element on the page, returns its corresponding data / API\n * If the data does not exists yet, create it from the element\n * @param {HTMLElement} element The HTML Element corresponding to the Livedata component\n */\n const init = function (element) {\n\n if (!instancesMap.has(element)) {\n // create a new logic object associated to the element\n const logic = new Logic(element);\n instancesMap.set(element, logic);\n }\n\n return instancesMap.get(element);\n };\n\n /**\n * A service providing footnotes related operations. \n */\n class FootnotesService {\n constructor() {\n this._footnotes = [];\n }\n\n /**\n * Register a new footnote. If a footnote with the same translationKey is already registered this method has no\n * effect on the list of registered footnotes.\n * @param symbol the symbol to identify the entries related to the footnote \n * @param translationKey the translation key of the footnote text \n */\n put(symbol, translationKey) {\n if (!this._footnotes.some(footnote => footnote.translationKey === translationKey)) {\n this._footnotes.push({symbol, translationKey});\n }\n }\n \n reset() {\n this._footnotes.splice(0);\n }\n \n list() {\n return this._footnotes;\n }\n }\n\n /**\n * Class for a logic element\n * Contains the Livedata data object and methods to mutate it\n * Can be used in the layouts to display the data, and call its API\n * @param {HTMLElement} element The HTML Element corresponding to the Livedata\n */\n const Logic = function (element) {\n this.element = element;\n this.data = JSON.parse(element.getAttribute(\"data-config\") || \"{}\");\n this.contentTrusted = element.getAttribute(\"data-config-content-trusted\") === \"true\"; \n this.data.entries = Object.freeze(this.data.entries);\n\n // Reactive properties must be initialized before Vue is instantiated.\n this.firstEntriesLoading = true;\n this.currentLayoutId = \"\";\n this.changeLayout(this.data.meta.defaultLayout);\n this.entrySelection = {\n selected: [],\n deselected: [],\n isGlobal: false,\n };\n this.openedPanels = [];\n this.footnotes = new FootnotesService();\n this.panels = [];\n\n element.removeAttribute(\"data-config\");\n\n const locale = document.documentElement.getAttribute('lang');\n\n const i18n = new VueI18n({\n locale: locale,\n messages: {},\n silentFallbackWarn: true,\n });\n\n // Vue.js replaces the container - prevent this by creating a placeholder for Vue.js to replace.\n const placeholderElement = document.createElement('div');\n this.element.appendChild(placeholderElement);\n\n // create Vuejs instance\n const vue = new Vue({\n el: placeholderElement,\n components: {\n \"XWikiLivedata\": XWikiLivedata,\n },\n template: \"\",\n i18n: i18n,\n data: {\n logic: this\n },\n mounted()\n {\n element.classList.remove('loading');\n // Trigger the \"instanceCreated\" event on the next tick to ensure that the constructor has returned and thus\n // all references to the logic instance have been initialized.\n this.$nextTick(function () {\n this.logic.triggerEvent('instanceCreated', {});\n });\n }\n });\n\n // Fetch the data if we don't have any. This call must be made just after the main Vue component is initialized as \n // LivedataPersistentConfiguration must be mounted for the persisted filters to be loaded and applied when fetching \n // the entries.\n // We use a dedicated field (firstEntriesLoading) for the first load as the fetch start/end events can be triggered \n // before the loader components is loaded (and in this case the loader is never hidden even once the entries are\n // displayed).\n if (!this.data.data.entries.length) {\n this.updateEntries()\n // Mark the loader as finished, even if it fails as the loader should stop and a message be displayed to the \n // user in this case.\n .finally(() => this.firstEntriesLoading = false);\n } else {\n this.firstEntriesLoading = false;\n }\n\n editBus.init(this);\n\n /**\n * Load given translations from the server\n *\n * @param {object} parameters\n * @param {string} componentName The name component who needs the translations\n * Used to avoid loading the same translations several times\n * @param {string} prefix The translation keys prefix\n * @param {string[]} keys\n */\n this.loadTranslations = async function ({ componentName, prefix, keys }) {\n // If translations were already loaded, return.\n if (this.loadTranslations[componentName]) return;\n this.loadTranslations[componentName] = true;\n // Fetch translation and load them.\n try {\n const translations = await liveDataSource.getTranslations(locale, prefix, keys);\n i18n.mergeLocaleMessage(locale, translations)\n } catch (error) {\n console.error(error);\n }\n }\n\n // Load needed translations for the Livedata\n const translationsPromise = this.loadTranslations({\n prefix: \"livedata.\",\n keys: [\n \"dropdownMenu.title\",\n \"dropdownMenu.actions\",\n \"dropdownMenu.layouts\",\n \"dropdownMenu.panels\",\n \"dropdownMenu.panels.properties\",\n \"dropdownMenu.panels.sort\",\n \"dropdownMenu.panels.filter\",\n \"selection.selectInAllPages\",\n \"selection.infoBar.selectedCount\",\n \"selection.infoBar.allSelected\",\n \"selection.infoBar.allSelectedBut\",\n \"pagination.currentEntries\",\n \"pagination.pageSize\",\n \"pagination.page\",\n \"pagination.first\",\n \"pagination.previous\",\n \"pagination.next\",\n \"pagination.last\",\n \"action.refresh\",\n \"action.addEntry\",\n \"action.reorder.hint\",\n \"action.resizeColumn.hint\",\n \"panel.filter.title\",\n \"panel.filter.noneFilterable\",\n \"panel.filter.addConstraint\",\n \"panel.filter.addProperty\",\n \"panel.filter.delete\",\n \"panel.filter.deleteAll\",\n \"panel.properties.title\",\n \"panel.sort.title\",\n \"panel.sort.noneSortable\",\n \"panel.sort.direction.ascending\",\n \"panel.sort.direction.descending\",\n \"panel.sort.add\",\n \"panel.sort.delete\",\n \"displayer.emptyValue\",\n \"displayer.link.noValue\",\n \"displayer.boolean.true\",\n \"displayer.boolean.false\",\n \"displayer.xObjectProperty.missingDocumentName.errorMessage\",\n \"displayer.xObjectProperty.failedToRetrieveField.errorMessage\",\n \"displayer.actions.edit\",\n \"displayer.actions.followLink\",\n \"filter.list.emptyLabel\",\n \"footnotes.computedTitle\",\n \"footnotes.propertyNotViewable\",\n \"bottombar.noEntries\",\n \"error.updateEntriesFailed\"\n ],\n });\n\n // Return a translation only once the translations have been loaded from the server.\n this.translate = async (key, ...args) => {\n // Make sure that the translations are loaded from the server before translating.\n await translationsPromise;\n return vue.$t(key, args);\n }\n \n // Waits for the translations to be loaded before continuing.\n this.translationsLoaded = async() => {\n await translationsPromise;\n }\n\n // Registers panels once the translations have been loadded as they are otherwise hard to update.\n this.translationsLoaded().finally(() => {\n this.registerPanel({\n id: 'propertiesPanel',\n title: vue.$t('livedata.panel.properties.title'),\n name: vue.$t('livedata.dropdownMenu.panels.properties'),\n icon: 'list-bullets',\n component: 'LivedataAdvancedPanelProperties',\n order: 1000\n });\n this.registerPanel({\n id: 'sortPanel',\n title: vue.$t('livedata.panel.sort.title'),\n name: vue.$t('livedata.dropdownMenu.panels.sort'),\n icon: 'table_sort',\n component: 'LivedataAdvancedPanelSort',\n order: 2000\n });\n this.registerPanel({\n id: 'filterPanel',\n title: vue.$t('livedata.panel.filter.title'),\n name: vue.$t('livedata.dropdownMenu.panels.filter'),\n icon: 'filter',\n component: 'LivedataAdvancedPanelFilter',\n order: 3000\n });\n });\n };\n\n\n\n\n /**\n * THE LOGIC API\n */\n Logic.prototype = {\n\n\n /**\n * ---------------------------------------------------------------\n * EVENTS\n */\n\n\n /**\n * Send custom events\n * @param {String} eventName The name of the event, without the prefix \"xwiki:livedata\"\n * @param {Object} eventData The data associated with the event.\n * The livedata object reference is automatically added\n */\n triggerEvent (eventName, eventData) {\n // configure event\n const defaultData = {\n livedata: this,\n };\n eventName = \"xwiki:livedata:\" + eventName;\n eventData = {\n bubbles: true,\n detail: Object.assign(defaultData, eventData),\n };\n const event = new CustomEvent(eventName, eventData);\n // dispatch event\n this.element.dispatchEvent(event);\n },\n\n /**\n * Listen for custom events\n * @param {String} eventName The name of the event, without the prefix \"xwiki:livedata\"\n * @param {Function} callback Function to call we the event is triggered: e => { ... }\n */\n onEvent (eventName, callback) {\n eventName = \"xwiki:livedata:\" + eventName;\n this.element.addEventListener(eventName, function (e) {\n callback(e);\n });\n },\n\n\n /**\n * Listen for custom events, mathching certain conditions\n * @param {String} eventName The name of the event, without the prefix \"xwiki:livedata\"\n * @param {Object|Function} condition The condition to execute the callback\n * if Object, values of object properties must match e.detail properties values\n * if Function, the function must return true. e.detail is passed as argument\n * @param {Function} callback Function to call we the event is triggered: e => { ... }\n */\n onEventWhere (eventName, condition, callback) {\n eventName = \"xwiki:livedata:\" + eventName;\n this.element.addEventListener(eventName, function (e) {\n // Object check\n if (typeof condition === \"object\") {\n const isDetailMatching = (data, detail) => Object.keys(data).every(key => {\n return typeof data[key] === \"object\"\n ? isDetailMatching(data[key], detail?.[key])\n : Object.is(data[key], detail?.[key]);\n });\n if (!isDetailMatching(condition, e.detail)) { return; }\n }\n // Function check\n if (typeof condition === \"function\") {\n if (!condition(e.detail)) { return; }\n }\n // call callback\n callback(e);\n });\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * UTILS\n */\n\n\n /**\n * Return the list of layout ids\n * @returns {Array}\n */\n getLayoutIds () {\n return this.data.meta.layouts.map(layoutDescriptor => layoutDescriptor.id);\n },\n\n\n /**\n * Return the id of the given entry\n * @param {Object} entry\n * @returns {String}\n */\n getEntryId (entry) {\n const idProperty = this.data.meta.entryDescriptor.idProperty || \"id\";\n if (entry[idProperty] === undefined) {\n console.warn(\"Entry has no id (at property [\" + idProperty + \"]\", entry);\n return;\n }\n return entry[idProperty];\n },\n\n /*\n As Sets are not reactive in Vue 2.x, if we want to create\n a reactive collection of unique objects, we have to use arrays.\n So here are some handy functions to do what Sets do, but with arrays\n */\n\n /**\n * Return whether the array has the given item\n * @param {Array} uniqueArray An array of unique items\n * @param {Any} item\n */\n uniqueArrayHas (uniqueArray, item) {\n return uniqueArray.includes(item);\n },\n\n\n /**\n * Add the given item if not present in the array, or does nothing\n * @param {Array} uniqueArray An array of unique items\n * @param {Any} item\n */\n uniqueArrayAdd (uniqueArray, item) {\n if (this.uniqueArrayHas(uniqueArray, item)) { return; }\n uniqueArray.push(item);\n },\n\n\n /**\n * Remove the given item from the array if present, or does nothing\n * @param {Array} uniqueArray An array of unique items\n * @param {Any} item\n */\n uniqueArrayRemove (uniqueArray, item) {\n const index = uniqueArray.indexOf(item);\n if (index === -1) { return; }\n uniqueArray.splice(index, 1);\n },\n\n\n /**\n * Toggle the given item from the array, ensuring its uniqueness\n * @param {Array} uniqueArray An array of unique items\n * @param {Any} item\n * @param {Boolean} force Optional: true force add / false force remove\n */\n uniqueArrayToggle (uniqueArray, item, force) {\n if (force === undefined) {\n force = !this.uniqueArrayHas(uniqueArray, item);\n }\n if (force) {\n this.uniqueArrayAdd(uniqueArray, item);\n } else {\n this.uniqueArrayRemove(uniqueArray, item);\n }\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * DESCRIPTORS\n */\n\n\n /**\n * Returns the property descriptors of displayable properties\n * @returns {Array}\n */\n getPropertyDescriptors () {\n return this.data.query.properties.map(propertyId => this.getPropertyDescriptor(propertyId));\n },\n\n\n /**\n * Return the property descriptor corresponding to a property id\n * @param {String} propertyId\n * @returns {Object}\n */\n getPropertyDescriptor (propertyId) {\n const propertyDescriptor = this.data.meta.propertyDescriptors\n .find(propertyDescriptor => propertyDescriptor.id === propertyId);\n if (!propertyDescriptor) {\n console.error(\"Property descriptor of property `\" + propertyId + \"` does not exists\");\n }\n return propertyDescriptor;\n },\n\n\n /**\n * Return the property type descriptor corresponding to a property id\n * @param {String} propertyId\n * @returns {Object}\n */\n getPropertyTypeDescriptor (propertyId) {\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n if (!propertyDescriptor) { return; }\n return this.data.meta.propertyTypes\n .find(typeDescriptor => typeDescriptor.id === propertyDescriptor.type);\n },\n\n\n /**\n * Return the layout descriptor corresponding to a layout id\n * @param {String} propertyId\n * @returns {Object}\n */\n getLayoutDescriptor (layoutId) {\n return this.data.meta.layouts\n .find(layoutDescriptor => layoutDescriptor.id === layoutId);\n },\n\n\n /**\n * Get the displayer descriptor associated to a property id\n * @param {String} propertyId\n * @returns {Object}\n */\n getDisplayerDescriptor (propertyId) {\n // Property descriptor config\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n // Property type descriptor config\n const typeDescriptor = this.getPropertyTypeDescriptor(propertyId);\n // Merge the property and type displayer descriptors.\n const customDisplayerDescriptor = jsonMerge({}, typeDescriptor?.displayer, propertyDescriptor?.displayer);\n // Get the default displayer descriptor.\n const displayerId = customDisplayerDescriptor.id || this.data.meta.defaultDisplayer;\n const defaultDisplayerDescriptor = this.data.meta.displayers.find(displayer => displayer.id === displayerId);\n // Merge displayer descriptors.\n return jsonMerge({}, defaultDisplayerDescriptor, customDisplayerDescriptor);\n },\n\n\n /**\n * Get the filter descriptor associated to a property id\n * @param {String} propertyId\n * @returns {Object}\n */\n getFilterDescriptor(propertyId) {\n // Property descriptor config\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n // Property type descriptor config\n const typeDescriptor = this.getPropertyTypeDescriptor(propertyId);\n // Merge the property and type filter descriptors.\n const customFilterDescriptor = jsonMerge({}, typeDescriptor?.filter, propertyDescriptor?.filter);\n // Get the default filter descriptor.\n const filterId = customFilterDescriptor.id || this.data.meta.defaultFilter;\n const defaultFilterDescriptor = this.data.meta.filters.find(filter => filter.id === filterId);\n // Merge filter descriptors.\n return jsonMerge({}, defaultFilterDescriptor, customFilterDescriptor);\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * LAYOUT\n */\n\n\n /**\n * Fetch the entries of the current page according to the query configuration.\n * @returns the fetched entries\n */\n fetchEntries() {\n // Before fetch event\n this.triggerEvent(\"beforeEntryFetch\");\n // Fetch entries from data source\n return liveDataSource.getEntries(this.data.query)\n .then(data => {\n // After fetch event\n return data\n })\n .finally(() => this.triggerEvent(\"afterEntryFetch\"));\n },\n\n\n updateEntries () {\n return this.fetchEntries()\n .then(data => {\n this.data.data = Object.freeze(data);\n // Remove the outdated footnotes, they will be recomputed by the new entries.\n this.footnotes.reset()\n })\n .catch(err => {\n // Prevent undesired notifications of the end user for non business related errors (for instance, the user\n // left the page before the request was completed).\n // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState\n if (err.readyState === 4) {\n this.translate('livedata.error.updateEntriesFailed')\n .then(value => new XWiki.widgets.Notification(value, 'error'));\n }\n console.error('Failed to fetch the entries', err)\n });\n },\n\n\n /**\n * Return whether the Livedata is editable or not\n * if entry given, return whether it is editable\n * if property given, return whether it is editable (for any entries)\n * If entry and property given, return whether specific value is editable\n * @param {Object} [parameters]\n * @param {Object} [parameters.entry] The entry object\n * @param {Number} [parameters.propertyId] The property id of the entry\n */\n isEditable ({ entry, propertyId } = {}) {\n // TODO: Ensure entry is valid (need other current PR)\n // TODO: Ensure property is valid (need other current PR)\n\n // Check if the edit entry action is available.\n if (!this.data.meta.actions.find(action => action.id === \"edit\")) {\n return false;\n }\n\n // Check if we are allowed to edit the given entry.\n if (entry && !this.isEntryEditable(entry)) {\n return false;\n }\n\n // Check if the specified property is editable.\n return !propertyId || this.isPropertyEditable(propertyId);\n },\n\n /**\n * Returns whether the given entry is editable or not.\n *\n * @param {Object} entry\n * @returns {Boolean}\n */\n isEntryEditable (entry) {\n return this.isActionAllowed('edit', entry);\n },\n\n /**\n * Returns whether a certain property is editable or not.\n *\n * @param {String} propertyId\n * @returns {Boolean}\n */\n isPropertyEditable (propertyId) {\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n const propertyTypeDescriptor = this.getPropertyTypeDescriptor(propertyId);\n return propertyDescriptor && (propertyDescriptor.editable !== undefined ? propertyDescriptor.editable :\n (propertyTypeDescriptor && propertyTypeDescriptor.editable));\n },\n\n /**\n * Set the value of the given entry property\n * @param {Object} parameters\n * @param {Object} parameters.entry The entry we want to modify\n * @param {number} parameters.propertyId The property id we want to modify in the entry\n * @param {string} parameters.value The new value of entry property\n */\n setValue({entry, propertyId, value}) {\n // TODO: Ensure entry is valid (need other current PR)\n // TODO: Ensure property is valid (need other current PR)\n if (!this.isEditable({entry, propertyId})) {\n return;\n }\n entry[propertyId] = value;\n const source = this.data.query.source;\n const entryId = this.getEntryId(entry);\n // Once the entry updated, reload the whole livedata because changing a single entry can have an impact on other \n // properties of the entry, but also possibly on other entriers, or in the way they are sorted.\n liveDataSource.updateEntryProperty(source, entryId, propertyId, entry[propertyId])\n .then(() => this.updateEntries());\n },\n\n /**\n * Update the entry with the values object passed in parameter and s\n * @param {Object} entry the current entry\n * @param {Object} values the entry's values to update\n */\n setValues({entryId, values}) {\n const source = this.data.query.source;\n return liveDataSource.updateEntry(source, entryId, values)\n .then(() => this.updateEntries());\n\n },\n\n\n /**\n * Return whether adding new entries is enabled.\n */\n canAddEntry () {\n // Check if the add entry action is available.\n return this.data.meta.actions.find(action => action.id === \"addEntry\");\n },\n\n addEntry () {\n if (!this.canAddEntry()) { return; }\n const mockNewUrl = () => this.getEntryId(this.data.data.entries.slice(-1)[0]) + \"0\";\n // TODO: CALL FUNCTION TO CREATE NEW DATA HERE\n Promise.resolve({ /* MOCK DATA */\n \"doc_url\": mockNewUrl(),\n \"doc_name\": undefined,\n \"doc_date\": \"1585311660000\",\n \"doc_title\": undefined,\n \"doc_author\": \"Author 1\",\n \"doc_creationDate\": \"1585311660000\",\n \"doc_creator\": \"Creator 1\",\n \"age\": undefined,\n \"tags\": undefined,\n \"country\": undefined,\n \"other\": undefined,\n })\n .then(newEntry => {\n this.data.data.entries.push(newEntry);\n this.data.data.count++; // TODO: remove when merging with backend\n });\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * LAYOUT\n */\n\n\n /**\n * Load a layout, or default layout if none specified\n * @param {String} layoutId The id of the layout to load with requireJS\n * @returns {Promise}\n */\n changeLayout (layoutId) {\n // bad layout\n if (!this.getLayoutDescriptor(layoutId)) {\n console.error(\"Layout of id `\" + layoutId + \"` does not have a descriptor\");\n return;\n }\n // set layout\n const previousLayoutId = this.currentLayoutId;\n this.currentLayoutId = layoutId;\n // dispatch events\n this.triggerEvent(\"layoutChange\", {\n layoutId: layoutId,\n previousLayoutId: previousLayoutId,\n });\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * PAGINATION\n */\n\n\n /**\n * Get total number of pages\n * @returns {Number}\n */\n getPageCount () {\n return Math.ceil(this.data.data.count / this.data.query.limit);\n },\n\n\n /**\n * Get the page corresponding to the specified entry (0-based index)\n * @param {Number} entryIndex The index of the entry. Uses current entry if undefined.\n * @returns {Number}\n */\n getPageIndex (entryIndex) {\n if (entryIndex === undefined) {\n entryIndex = this.data.query.offset;\n }\n return Math.floor(entryIndex / this.data.query.limit);\n },\n\n\n /**\n * Set page index (0-based index), then fetch new data\n * @param {Number} pageIndex\n * @returns {Promise}\n */\n setPageIndex (pageIndex) {\n return new Promise ((resolve, reject) => {\n if (pageIndex < 0 || pageIndex >= this.getPageCount()) { return void reject(); }\n const previousPageIndex = this.getPageIndex();\n this.data.query.offset = this.getFirstIndexOfPage(pageIndex);\n this.triggerEvent(\"pageChange\", {\n pageIndex: pageIndex,\n previousPageIndex: previousPageIndex,\n });\n this.updateEntries().then(resolve, reject);\n });\n },\n\n\n /**\n * Get the first entry index of the given page index\n * @param {Number} pageIndex The page index. Uses current page if undefined.\n * @returns {Number}\n */\n getFirstIndexOfPage (pageIndex) {\n if (pageIndex === undefined) {\n pageIndex = this.getPageIndex();\n }\n if (0 <= pageIndex && pageIndex < this.getPageCount()) {\n return pageIndex * this.data.query.limit;\n } else {\n return -1;\n }\n },\n\n\n /**\n * Get the last entry index of the given page index\n * @param {Number} pageIndex The page index. Uses current page if undefined.\n * @returns {Number}\n */\n getLastIndexOfPage (pageIndex) {\n if (pageIndex === undefined) {\n pageIndex = this.getPageIndex();\n }\n if (0 <= pageIndex && pageIndex < this.getPageCount()) {\n return Math.min(this.getFirstIndexOfPage(pageIndex) + this.data.query.limit, this.data.data.count) - 1;\n } else {\n return -1;\n }\n },\n\n\n /**\n * Set the pagination page size, then fetch new data\n * @param {Number} pageSize\n * @returns {Promise}\n */\n setPageSize (pageSize) {\n return new Promise ((resolve, reject) => {\n if (pageSize < 0) { return void reject(); }\n const previousPageSize = this.data.query.limit;\n if (pageSize === previousPageSize) { return void resolve(); }\n this.data.query.limit = pageSize;\n // Reset the offset whenever the page size changes.\n this.data.query.offset = 0;\n this.triggerEvent(\"pageSizeChange\", {\n pageSize: pageSize,\n previousPageSize: previousPageSize,\n });\n this.updateEntries().then(resolve, reject);\n });\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * DISPLAY\n */\n\n\n /**\n * Returns whether a certain property is visible\n * @param {String} propertyId\n * @returns {Boolean}\n */\n isPropertyVisible (propertyId) {\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n return propertyDescriptor.visible;\n },\n\n\n /**\n * Set whether the given property should be visible\n * @param {String} propertyId\n * @param {Boolean} visible\n */\n setPropertyVisible (propertyId, visible) {\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n propertyDescriptor.visible = visible;\n },\n\n\n /**\n * Move a property to a certain index in the property order list\n * @param {String|Number} from The id or index of the property to move\n * @param {Number} toIndex\n */\n reorderProperty (from, toIndex) {\n let fromIndex;\n if (typeof from === \"number\") {\n fromIndex = from;\n } else if (typeof from === \"string\") {\n fromIndex = this.data.query.properties.indexOf(from);\n } else {\n return;\n }\n if (fromIndex < 0 || toIndex < 0) { return; }\n this.data.query.properties.splice(toIndex, 0, this.data.query.properties.splice(fromIndex, 1)[0]);\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * SELECTION\n */\n\n\n /**\n * Return whether selecting entries is enabled. If an entry is given, return whether that entry can be selected.\n *\n * @param {Object} [parameters]\n * @param {Object} [parameters.entry]\n */\n isSelectionEnabled ({ entry } = {}) {\n // An entry is selectable if it has an id specified.\n return this.data.meta.selection.enabled && (!entry || this.getEntryId(entry));\n },\n\n\n /**\n * Return whether the entry is currently selected\n * @param {Object} entry\n * @returns {Boolean}\n */\n isEntrySelected (entry) {\n const entryId = this.getEntryId(entry);\n if (this.entrySelection.isGlobal) {\n return !this.uniqueArrayHas(this.entrySelection.deselected, entryId);\n } else {\n return this.uniqueArrayHas(this.entrySelection.selected, entryId);\n }\n },\n\n\n /**\n * Select the specified entries\n * @param {Object|Array} entries\n */\n selectEntries (entries) {\n if (!this.isSelectionEnabled()) { return; }\n const entryArray = (entries instanceof Array) ? entries : [entries];\n entryArray.forEach(entry => {\n if (!this.isSelectionEnabled({ entry })) { return; }\n const entryId = this.getEntryId(entry);\n if (this.entrySelection.isGlobal) {\n this.uniqueArrayRemove(this.entrySelection.deselected, entryId);\n }\n else {\n this.uniqueArrayAdd(this.entrySelection.selected, entryId);\n }\n this.triggerEvent(\"select\", {\n entry: entry,\n });\n });\n },\n\n\n /**\n * Deselect the specified entries\n * @param {Object|Array} entries\n */\n deselectEntries (entries) {\n if (!this.isSelectionEnabled()) { return; }\n const entryArray = (entries instanceof Array) ? entries : [entries];\n entryArray.forEach(entry => {\n if (!this.isSelectionEnabled({ entry })) { return; }\n const entryId = this.getEntryId(entry);\n if (this.entrySelection.isGlobal) {\n this.uniqueArrayAdd(this.entrySelection.deselected, entryId);\n }\n else {\n this.uniqueArrayRemove(this.entrySelection.selected, entryId);\n }\n this.triggerEvent(\"deselect\", {\n entry: entry,\n });\n });\n },\n\n\n /**\n * Toggle the selection of the specified entries\n * @param {Object|Array} entries\n * @param {Boolean} select Whether to select or not the entries. Undefined toggle current state\n */\n toggleSelectEntries (entries, select) {\n if (!this.isSelectionEnabled()) { return; }\n const entryArray = (entries instanceof Array) ? entries : [entries];\n entryArray.forEach(entry => {\n if (!this.isSelectionEnabled({ entry })) { return; }\n if (select === undefined) {\n select = !this.isEntrySelected(entry);\n }\n if (select) {\n this.selectEntries(entry);\n } else {\n this.deselectEntries(entry);\n }\n });\n },\n\n\n /**\n * Get number of selectable entries in page\n * @returns {Number}\n */\n selectableCountInPage () {\n if (!this.isSelectionEnabled()) { return 0; }\n return this.data.data.entries\n .filter(entry => this.isSelectionEnabled({ entry }))\n .length;\n },\n\n\n /**\n * Set the entry selection globally accross pages\n * @param {Boolean} global\n */\n setEntrySelectGlobal (global) {\n if (!this.isSelectionEnabled()) { return; }\n this.entrySelection.isGlobal = global;\n this.entrySelection.selected.splice(0);\n this.entrySelection.deselected.splice(0);\n this.triggerEvent(\"selectGlobal\", {\n state: global,\n });\n },\n\n\n\n /**\n * ---------------------------------------------------------------\n * ACTIONS\n */\n\n\n /**\n * @param {String|Object} specifies the action\n * @returns {Object} the descriptor of the specified live data action\n */\n getActionDescriptor(action) {\n const descriptor = typeof action === 'string' ? {id: action} : action;\n const baseDescriptor = this.data.meta.actions.find(baseDescriptor => baseDescriptor.id === descriptor.id);\n return jsonMerge({}, baseDescriptor, descriptor);\n },\n\n\n /**\n * @param {String|Object} specifies the action\n * @param {Object} the live data entry that is the target of the action\n * @returns {Boolean} whether the specified action is allowed to target the specified live data entry\n */\n isActionAllowed(action, entry) {\n const actionDescriptor = this.getActionDescriptor(action);\n return !actionDescriptor.allowProperty || entry[actionDescriptor.allowProperty];\n },\n\n\n /**\n * ---------------------------------------------------------------\n * SORT\n */\n\n\n /**\n * Returns whether a certain property is sortable or not\n * @param {String} propertyId\n * @returns {Boolean}\n */\n isPropertySortable (propertyId) {\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n const propertyTypeDescriptor = this.getPropertyTypeDescriptor(propertyId);\n return propertyDescriptor && (propertyDescriptor.sortable !== undefined ? propertyDescriptor.sortable :\n (propertyTypeDescriptor && propertyTypeDescriptor.sortable));\n },\n\n\n /**\n * Returns the sortable properties from the live data query.\n *\n * @returns {Array}\n */\n getSortableProperties () {\n return this.data.query.properties.filter(property => this.isPropertySortable(property));\n },\n\n\n /**\n * Returns the sortable properties that don't have a sort entry in the live data query.\n *\n * @returns {Array}\n */\n getUnsortedProperties () {\n return this.getSortableProperties().filter(property => !this.getQuerySort(property));\n },\n\n\n /**\n * Get the sort query associated to a property id\n * @param {String} propertyId\n */\n getQuerySort (propertyId) {\n return this.data.query.sort.find(sort => sort.property === propertyId);\n },\n\n\n /**\n * Update sort configuration based on parameters, then fetch new data\n * @param {String} property The property to sort according to\n * @param {String} level The sort level for the property (0 is the highest).\n * Undefined means keep current. Negative value removes property sort.\n * @param {String} descending Specify whether the sort should be descending or not.\n * Undefined means toggle current direction\n * @returns {Promise}\n */\n sort (property, level, descending) {\n const err = new Error(\"Property `\" + property + \"` is not sortable\");\n return new Promise ((resolve, reject) => {\n // Allow the user to remove a sort entry (level < 0) even if the property is not sortable.\n if (!(level < 0 || this.isPropertySortable(property))) {\n return void reject(err);\n }\n // find property current sort level\n const currentLevel = this.data.query.sort.findIndex(sortObject => sortObject.property === property);\n // default level\n if (level === undefined) {\n level = (currentLevel !== -1) ? currentLevel : 0;\n } else if (level < 0) {\n level = -1;\n }\n // default descending\n if (descending === undefined) {\n descending = (currentLevel !== -1) ? !this.data.query.sort[currentLevel].descending : false;\n }\n // create sort object\n const sortObject = {\n property: property,\n descending: descending,\n };\n // apply sort\n if (level !== -1) {\n this.data.query.sort.splice(level, 1, sortObject);\n }\n if (currentLevel !== -1 && currentLevel !== level) {\n this.data.query.sort.splice(currentLevel, 1);\n }\n // dispatch events\n this.triggerEvent(\"sort\", {\n property: property,\n level: level,\n descending: descending,\n });\n\n this.updateEntries().then(resolve, reject);\n });\n },\n\n\n /**\n * Add new sort entry, shorthand of sort:\n * If the property is already sorting, does nothing\n * @param {String} property The property to add to the sort\n * @param {String} descending Specify whether the sort should be descending or not.\n * Undefined means toggle current direction\n * @returns {Promise}\n */\n addSort (property, descending) {\n const err = new Error(\"Property `\" + property + \"` is already sorting\");\n const propertyQuerySort = this.data.query.sort.find(sortObject => sortObject.property === property);\n if (propertyQuerySort) { return Promise.reject(err); }\n return this.sort(property, this.data.query.sort.length, descending);\n },\n\n\n /**\n * Remove a sort entry, shorthand of sort:\n * @param {String} property The property to remove to the sort\n * @returns {Promise}\n */\n removeSort (property) {\n return this.sort(property, -1);\n },\n\n\n /**\n * Move a sort entry to a certain index in the query sort list\n * @param {String} property The property to reorder the sort\n * @param {Number} toIndex\n */\n reorderSort (propertyId, toIndex) {\n const err = new Error(\"Property `\" + propertyId + \"` is not sortable\");\n return new Promise ((resolve, reject) => {\n const fromIndex = this.data.query.sort.findIndex(querySort => querySort.property === propertyId);\n if (fromIndex < 0 || toIndex < 0) { return void reject(err); }\n this.data.query.sort.splice(toIndex, 0, this.data.query.sort.splice(fromIndex, 1)[0]);\n\n // dispatch events\n this.triggerEvent(\"sort\", {\n type: \"move\",\n property: propertyId,\n level: toIndex,\n });\n\n this.updateEntries().then(resolve, reject);\n });\n },\n\n\n\n\n /**\n * ---------------------------------------------------------------\n * FILTER\n */\n\n\n /**\n * Returns whether a certain property is filterable or not\n * @param {String} propertyId\n * @returns {Boolean}\n */\n isPropertyFilterable (propertyId) {\n const propertyDescriptor = this.getPropertyDescriptor(propertyId);\n const propertyTypeDescriptor = this.getPropertyTypeDescriptor(propertyId);\n return propertyDescriptor && (propertyDescriptor.filterable !== undefined ? propertyDescriptor.filterable :\n (propertyTypeDescriptor && propertyTypeDescriptor.filterable));\n },\n\n\n /**\n * Returns the filterable properties from the live data query.\n *\n * @returns {Array}\n */\n getFilterableProperties () {\n return this.data.query.properties.filter(property => this.isPropertyFilterable(property));\n },\n\n\n /**\n * Returns the filterable properties that don't have constraints in the live data query.\n *\n * @returns {Array}\n */\n getUnfilteredProperties () {\n return this.getFilterableProperties().filter(property => {\n const filter = this.getQueryFilterGroup(property);\n return !filter || filter.constraints.length === 0;\n });\n },\n\n\n /**\n * Get the filter in the query data object associated to a property id\n * @param {String} propertyId\n * @returns {Object}\n */\n getQueryFilterGroup (propertyId) {\n return this.data.query.filters.find(filter => filter.property === propertyId);\n },\n\n\n /**\n * Get the filters in the query data object associated to a property id\n * @param {String} propertyId\n * @returns {Array} The constraints array of the filter group, or empty array if it does not exist\n */\n getQueryFilters (propertyId) {\n const queryFilterGroup = this.getQueryFilterGroup(propertyId);\n return queryFilterGroup && queryFilterGroup.constraints || [];\n },\n\n\n /**\n * Get the default filter operator associated to a property id\n * @param {String} propertyId\n * @returns {String}\n */\n getFilterDefaultOperator (propertyId) {\n // get valid operator descriptor\n const filterDescriptor = this.getFilterDescriptor(propertyId);\n if (!filterDescriptor) { return; }\n const filterOperators = filterDescriptor.operators;\n if (!(filterOperators instanceof Array)) { return; }\n if (filterOperators.length === 0) { return; }\n // get default operator\n const defaultOperator = filterDescriptor.defaultOperator;\n const isDefaultOperatorValid = !!filterOperators.find(operator => operator.id === defaultOperator);\n if (defaultOperator && isDefaultOperatorValid) {\n return defaultOperator;\n } else {\n return filterOperators[0].id;\n }\n },\n\n\n /**\n * Return an object containing the new and old filter entries corresponding to parameters\n * oldEntry: the filter entry to be modified\n * newEntry: what this entry should be modified to\n * @param {String} property The property to filter according to\n * @param {String} index The index of the filter entry\n * @param {String} filterEntry The filter data used to update the filter configuration\n * (see Logic.prototype.filter for more)\n * @returns {Object} {oldEntry, newEntry}\n * with oldEntry / newEntry being {property, index, operator, value}\n */\n _computeFilterEntries (property, index, filterEntry, {filterOperator} = {}) {\n if (!this.isPropertyFilterable(property)) { return; }\n // default indexes\n index = index || 0;\n if (index < 0) { index = -1; }\n if (filterEntry.index < 0) { filterEntry.index = -1; }\n // old entry\n let oldEntry = {\n property: property,\n index: index,\n };\n const queryFilters = this.getQueryFilters(property);\n const currentEntry = queryFilters[index] || {};\n oldEntry = Object.assign({}, currentEntry, oldEntry);\n // new entry (copy properties that are not undefined from filterEntry)\n let newEntry = Object.fromEntries(Object.entries(filterEntry || {})\n .filter(entry => entry[1] !== undefined));\n const self = this;\n const defaultEntry = {\n property: property,\n value: \"\",\n operator: self.getFilterDefaultOperator(property),\n index: 0,\n };\n newEntry = Object.assign({}, defaultEntry, oldEntry, newEntry);\n if (filterOperator) {\n newEntry.operator = filterOperator;\n }\n // check newEntry operator\n const newEntryValidOperator = this.getFilterDescriptor(newEntry.property).operators\n .some(operator => operator.id === newEntry.operator);\n if (!newEntryValidOperator) {\n newEntry.operator = self.getFilterDefaultOperator(newEntry.property);\n }\n return {\n oldEntry: oldEntry,\n newEntry: newEntry,\n };\n },\n\n\n /**\n * Return the filtering type, based on oldEntry and newEntry\n * @param {Object} oldEntry\n * @param {Oject} newEntry\n * @returns {String} \"add\" | \"remove\" | \"move\" | \"modify\"\n */\n _getFilteringType (oldEntry, newEntry) {\n const queryFilter = this.getQueryFilterGroup(oldEntry.property);\n if (queryFilter && oldEntry.index === -1) {\n return \"add\";\n }\n if (newEntry.index === -1) {\n return \"remove\";\n }\n if (oldEntry.index !== newEntry.index) {\n return \"move\";\n }\n return \"modify\";\n },\n\n\n /**\n * Update filter configuration based on parameters, then fetch new data\n * @param {String} property The property to filter according to\n * @param {String} index The index of the filter entry\n * @param {String} filterEntry The filter data used to update the filter configuration\n * filterEntry = {property, operator, value}\n * undefined values are defaulted to current values, then to default values.\n * @param {String} filterEntry.property The new property to filter according to\n * @param {String} filterEntry.index The new index the filter should go. -1 delete filter\n * @param {String} filterEntry.operator The operator of the filter.\n * Should match the filter descriptor of the filter property\n * @param {String} filterEntry.value Value for the new filter entry\n * @returns {Promise}\n */\n filter(property, index, filterEntry, {filterOperator} = {}) {\n const err = new Error(\"Property `\" + property + \"` is not filterable\");\n return new Promise ((resolve, reject) => {\n const filterEntries = this._computeFilterEntries(property, index, filterEntry, {filterOperator});\n if (!filterEntries) { return void reject(err); }\n const oldEntry = filterEntries.oldEntry;\n const newEntry = filterEntries.newEntry;\n const filteringType = this._getFilteringType(oldEntry, newEntry);\n // remove filter at current property and index\n if (oldEntry.index !== -1) {\n this.getQueryFilters(oldEntry.property).splice(index, 1);\n }\n // add filter at new property and index\n if (newEntry.index !== -1) {\n // create filterGroup if not exists\n if (!this.getQueryFilterGroup(newEntry.property)) {\n this.data.query.filters.push({\n property: newEntry.property,\n // We use by default AND between filter groups (different properties) and OR inside a filter group (same\n // property)\n matchAll: false,\n constraints: [],\n });\n }\n // add entry\n this.getQueryFilterGroup(newEntry.property).constraints.splice(newEntry.index, 0, {\n operator: newEntry.operator,\n value: newEntry.value,\n });\n }\n // remove filter group if empty\n if (this.getQueryFilters(oldEntry.property).length === 0) {\n this.removeAllFilters(oldEntry.property);\n }\n // Reset the offset whenever the filters are updated.\n this.data.query.offset = 0;\n // dispatch events\n this.triggerEvent(\"filter\", {\n type: filteringType,\n oldEntry: oldEntry,\n newEntry: newEntry,\n });\n\n this.updateEntries().then(resolve, reject);\n });\n },\n\n\n /**\n * Add new filter entry, shorthand of filter:\n * @param {String} property Which property to add the filter to\n * @param {String} operator The operator of the filter. Should match the filter descriptor of the property\n * @param {String} value Default value for the new filter entry\n * @param {Number} index Index of new filter entry. Undefined means last\n * @returns {Promise}\n */\n addFilter (property, operator, value, index) {\n if (index === undefined) {\n index = ((this.getQueryFilterGroup(property) || {}).constraints || []).length;\n }\n return this.filter(property, -1, {\n property: property,\n operator: operator,\n value: value,\n index: index,\n });\n },\n\n\n /**\n * Remove a filter entry in the configuration, then fetch new data\n * @param {String} property Property to remove the filter to\n * @param {String} index The index of the filter to remove. Undefined means last.\n * @returns {Promise}\n */\n removeFilter (property, index) {\n return this.filter(property, index, {index: -1});\n },\n\n\n /**\n * Remove all the filters associated to a property\n * @param {String} property Property to remove the filters to\n * @returns {Promise}\n */\n removeAllFilters (property) {\n return new Promise ((resolve, reject) => {\n const filterIndex = this.data.query.filters\n .findIndex(filterGroup => filterGroup.property === property);\n if (filterIndex < 0) { return void reject(); }\n const removedFilterGroups = this.data.query.filters.splice(filterIndex, 1);\n // Reset the offset whenever the filters are updated.\n this.data.query.offset = 0;\n // dispatch events\n this.triggerEvent(\"filter\", {\n type: \"removeAll\",\n property: property,\n removedFilters: removedFilterGroups[0].constraints,\n });\n this.updateEntries().then(resolve, reject);\n });\n },\n \n //\n // Edit Bus\n //\n\n getEditBus() {\n return editBus;\n },\n\n /**\n * Registers a panel.\n *\n * The panel must have the following attributes:\n * * id: the id of the panel, must be unique among all panels, also used as suffix of the class on the panel\n * * name: the name that shall be shown in the menu\n * * title: the title that shall be displayed in the title bar of the panel\n * * icon: the name of the icon for the menu and the title of the panel\n * * container: the Element that shall be attached to the extension panel's body, this should contain the main UI\n * * component: the component of the panel, should be \"LiveDataAdvancedPanelExtension\" for extension panels\n * * order: the ordering number, panels are sorted by this number in ascending order\n *\n * @param {Object} panel the panel to add\n */\n registerPanel(panel)\n {\n // Basic insertion sorting to avoid shuffling the (reactive) array.\n const index = this.panels.findIndex(p => p.order > panel.order);\n if (index === -1) {\n this.panels.push(panel);\n } else {\n this.panels.splice(index, 0, panel);\n }\n },\n\n //\n // Content status\n //\n\n /**\n * @returns {boolean} when false, the content is not trusted will be sanitized whenever Vue integrated escaping\n * is not enough. When true, the content is never sanitized\n */\n isContentTrusted() {\n return this.contentTrusted;\n }\n };\n\n\n\n\n\n // return the init function to be used in the layouts\n return init;\n\n});\n\n\n\n","/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\ndefine('xwiki-livedata-xObjectPropertyHelper', ['jquery', 'xwiki-meta', 'xwiki-entityReference'], function($, xcontext, XWiki) {\n 'use strict';\n\n /**\n * Pass the vue-i18n helper to the module to allow error messages to be localized.\n * @param $t the vue-i18n localization helper\n */\n function setLocalization($t) {\n this.$t = $t;\n }\n\n /**\n * Resolve the url of the document reference in the given mode.\n * @param documentReference the document reference\n * @param mode the mode\n * @returns {*} the computed relative url\n */\n function computeTargetURL(documentReference, mode) {\n return new XWiki.Document(XWiki.Model.resolve(documentReference, XWiki.EntityType.DOCUMENT)).getURL(mode);\n }\n\n function getPropertyReference(propertyName, className) {\n if (propertyName.startsWith('doc.')) {\n return propertyName.substring('doc.'.length);\n } else {\n // We target the first object of the specified type (class name).\n return className + '[0].' + propertyName;\n }\n }\n\n function load(mode, documentReference, property, className) {\n const targetUrl = computeTargetURL(documentReference, 'get');\n return Promise.resolve($.get(targetUrl, {\n xpage: 'display',\n mode: mode,\n // TODO: handle the object index when provided\n property: getPropertyReference(property, className),\n type: property.startsWith('doc.') ? 'document' : 'object',\n language: xcontext.locale\n })).catch(() => {\n new XWiki.widgets.Notification(\n this.$t('livedata.displayer.xObjectProperty.failedToRetrieveField.errorMessage', [mode]), 'error');\n return Promise.reject();\n });\n }\n\n /**\n * Load an XObject property field in edit mode.\n * @param documentReference the reference of the document containing the XObject\n * @param className the class name of the XObject\n * @param property the XObject property to display\n * @returns {*} the XObject property field html content in edit mode\n */\n function edit(documentReference, className, property) {\n return load('edit', documentReference, property, className);\n }\n\n /**\n * Load an XObject property field in view mode.\n * @param documentReference the reference of the document containing the XObject\n * @param className the class name of the XObject\n * @param property the XObject property to display\n * @returns {*} the XObject property field html content in view mode\n */\n function view(documentReference, className, property) {\n return load('view', documentReference, property, className);\n }\n\n return {edit, view, setLocalization};\n});\n","/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\n\n/**\n * Vue event bus for the edit action states.\n * Sent events:\n * - start-editing-entry({entryId, propertyId}): when an entry passes in edit mode\n * - cancel-editing-entry({entryId, propertyId}): when an entry goes out of edit mode without saving its edits\n * - save-editing-entry({entryId, propertyId, content}): when an entry goes out of edit model and wants to save its\n * edits. The content is an object mapping the keys and values of the cell form attributes.\n */\ndefine('edit-bus', ['vue'], (Vue) => {\n\n var _logic = undefined;\n var _editBus = new Vue();\n var _editBusService = undefined;\n\n /**\n * Centralizes the edition event listeners and maintain a centralized state of the edition states and results for the\n * live data.\n * This is useful to know when to save the table, and to know which cells can be edited according to the current edit\n * state\n */\n class EditBusService {\n\n /**\n * Default constructor.\n * @param editBus an edit bus Vue object\n * @param logic the live data logic instance\n */\n constructor(editBus, logic) {\n this.editBus = editBus;\n this.editStates = {};\n this.logic = logic;\n }\n\n /**\n * Initializes the Vue events listeners.\n */\n init() {\n this.editBus.$on('start-editing-entry', ({entryId, propertyId}) => {\n const entryState = this.editStates[entryId] || {};\n const propertyState = entryState[propertyId] || {};\n propertyState.editing = true;\n entryState[propertyId] = propertyState;\n this.editStates[entryId] = entryState;\n })\n\n this.editBus.$on('cancel-editing-entry', ({entryId, propertyId}) => {\n const entryState = this.editStates[entryId];\n const propertyState = entryState[propertyId];\n\n // The entry is not edited anymore.\n // The content is not edited, and should be `undefined` if the property was edited for the first time.\n // If the property was edited and saved a first time, then edited and cancelled, the content must stay to one from\n // the first edit.\n propertyState.editing = false;\n\n })\n\n this.editBus.$on('save-editing-entry', ({entryId, propertyId, content}) => {\n const entryState = this.editStates[entryId];\n const propertyState = entryState[propertyId];\n // The entry is not edited anymore but its content will need to be saved once the rest of the properties of the \n // entry are not in edit mode. \n propertyState.editing = false;\n propertyState.tosave = true;\n propertyState.content = content;\n this.save(entryId);\n })\n }\n\n /**\n * Save the changed values of an entry server side.\n * @param entryId the entry id of the entry to save\n */\n save(entryId) {\n const values = this.editStates[entryId];\n var canBeSaved = false;\n var keyEntry = undefined;\n\n\n // Look for the single cell to save.\n for (keyEntry in values) {\n const entryValue = values[keyEntry];\n\n const editing = entryValue.editing;\n const tosave = entryValue.tosave;\n canBeSaved = !editing && tosave;\n\n if (canBeSaved) break;\n }\n\n // If a cell to save is found, we get its content and save it. \n if (canBeSaved && keyEntry) {\n const vals = values[keyEntry].content;\n\n this.logic.setValues({entryId, values: vals})\n .then(() => {\n this.editStates[entryId] = {};\n })\n .catch(() => {\n new XWiki.widgets.Notification(`The row save action failed.`, 'error');\n });\n }\n }\n\n isEditable() {\n for (const editStatesKey in this.editStates) {\n const editStates = this.editStates[editStatesKey];\n for (const editStateKey in editStates) {\n const editState = editStates[editStateKey];\n if (editState.editing) {\n return false;\n }\n }\n }\n return true;\n }\n\n onAnyEvent(callback) {\n this.editBus.$on(['save-editing-entry', 'start-editing-entry', 'cancel-editing-entry'], () => callback())\n }\n }\n\n /**\n * Initialized the edit bus view and services.\n * @param logic the live data logic instance\n */\n function init(logic) {\n _logic = logic\n _editBusService = new EditBusService(_editBus, logic);\n _editBusService.init()\n }\n\n /**\n * Notifies the start of a cell modification. After this event, the cell is considered as edited unless it is\n * canceled.\n * @param entry the entry of the edited row\n * @param propertyId the property id of the edited cell.\n */\n function start(entry, propertyId) {\n _editBus.$emit('start-editing-entry', {\n entryId: _logic.getEntryId(entry),\n propertyId\n });\n\n }\n\n /**\n * Notifies the cancellation of the edition of a cell. The cell rollback to a non modified state.\n * @param entry the entry of the edited row\n * @param propertyId the property id of the edited cell\n */\n function cancel(entry, propertyId) {\n _editBus.$emit('cancel-editing-entry', {\n entryId: _logic.getEntryId(entry),\n propertyId\n })\n\n }\n\n /**\n * Notifies the save of the a cell. With the current save strategy, the cell is directly save and the table is reload\n * after this notification.\n * @param entry the entry of the edit row\n * @param propertyId the property id of the edited cell\n * @param content the attributes of the edit cell form, in the form of an object\n `\n */\n function save(entry, propertyId, content) {\n _editBus.$emit('save-editing-entry', {\n entryId: _logic.getEntryId(entry),\n propertyId: propertyId,\n content: content\n });\n }\n\n /**\n * Indicated if cells are allowed to switch to edit mode. For instance, a cell is not allowed to be edited if another\n * cell is already in edit mode. In this case the currently edited cell must be saved or cancelled before another one\n * can be edited.\n * @returns {*} true if the cells are allowed to switch to edit mode, false otherwise\n */\n function isEditable() {\n return _editBusService.isEditable();\n }\n \n function onAnyEvent(callback) {\n _editBusService.onAnyEvent(callback);\n }\n\n return {init, start, cancel, save, isEditable, onAnyEvent};\n})\n","/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\ndefine('xwiki-json-merge', function() {\n let merge = function(left, right) {\n if (left?.constructor === Object && right?.constructor === Object) {\n return mergeObject(left, right);\n } else if (Array.isArray(left) && Array.isArray(right)) {\n return mergeArray(left, right);\n } else if (right == null) {\n // Keep the left value.\n return left;\n } else {\n // Overwrite the left value because either it's null or we cannot merge.\n return deepCopy(right);\n }\n };\n\n let mergeArray = function(left, right) {\n // Take the items from the right, merging them with the corresponding item from the left.\n const fromRight = right.map(rightItem => merge(findById(rightItem.id, left), rightItem));\n // Take the items from the left that are identifiable and that are not present on the right.\n const fromLeft = deepCopy(left.filter(leftItem => leftItem.id != null && findById(leftItem.id, right) == null));\n return fromRight.concat(fromLeft);\n };\n\n let mergeObject = function(left, right) {\n // Don't merge if the right object has an identifier different than the one of the left object.\n if (right.hasOwnProperty('id') && left.id !== right.id) {\n return deepCopy(right);\n }\n Object.keys(right).forEach(key => {\n left[key] = merge(left[key], right[key]);\n });\n return left;\n };\n\n let deepCopy = function(value) {\n return JSON.parse(JSON.stringify(value));\n };\n\n let findById = function(id, array) {\n if (id != null) {\n return array.find(item => item.id === id);\n }\n };\n\n return function(...objects) {\n return objects?.reduce(merge, null);\n };\n});\n","/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\ndefine('xwiki-livedata-source', ['module', 'jquery'], function(module, $) {\n 'use strict';\n\n var baseURL = module.config().contextPath + '/rest/liveData/sources/';\n\n var getEntries = function(liveDataQuery) {\n var entriesURL = getEntriesURL(liveDataQuery.source);\n\n var parameters = {\n properties: liveDataQuery.properties,\n offset: liveDataQuery.offset,\n limit: liveDataQuery.limit\n };\n // Add filters.\n parameters.matchAll = [];\n liveDataQuery.filters.forEach(filter => {\n if (filter.matchAll) {\n parameters.matchAll.push(filter.property);\n }\n parameters['filters.' + filter.property] = filter.constraints\n .filter(constraint => constraint.value !== undefined)\n .map(constraint => {\n if (constraint.operator === undefined) {\n constraint.operator = \"\";\n }\n return constraint;\n })\n .map(constraint => constraint.operator + ':' + constraint.value);\n });\n // Add sort.\n parameters.sort = liveDataQuery.sort.map(sort => sort.property);\n parameters.descending = liveDataQuery.sort.map(sort => sort.descending);\n\n return Promise.resolve($.getJSON(entriesURL, $.param(parameters, true)).then(toLiveData));\n };\n\n var getEntriesURL = function(source) {\n var entriesURL = baseURL + encodeURIComponent(source.id) + '/entries';\n return addSourcePathParameters(source, entriesURL);\n };\n\n function addSourcePathParameters(source, url) {\n var parameters = {\n // Make sure the response is not retrieved from cache (IE11 doesn't obey the caching HTTP headers).\n timestamp: new Date().getTime(),\n namespace: `wiki:${XWiki.currentWiki}`\n };\n addSourceParameters(parameters, source);\n return `${url}?${$.param(parameters, true)}`;\n }\n\n function getEntryPropertyURL(source, entryId, propertyId) {\n const encodedSourceId = encodeURIComponent(source.id);\n const encodedEntryId = encodeURIComponent(entryId);\n const encodedPropertyId = encodeURIComponent(propertyId);\n const url = `${baseURL}${encodedSourceId}/entries/${encodedEntryId}/properties/${encodedPropertyId}`\n return addSourcePathParameters(source, url);\n }\n \n function getEntryURL(source, entryId) {\n const encodedSourceId = encodeURIComponent(source.id);\n const encodedEntryId = encodeURIComponent(entryId);\n const url = `${baseURL}${encodedSourceId}/entries/${encodedEntryId}`\n return addSourcePathParameters(source, url);\n }\n\n var addSourceParameters = function(parameters, source) {\n $.each(source, (key, value) => {\n if (key !== 'id') {\n parameters['sourceParams.' + key] = value;\n }\n });\n };\n\n var toLiveData = function(data) {\n return {\n count: data.count,\n entries: data.entries.map(entry => entry.values)\n };\n };\n\n var addEntry = function(source, entry) {\n return Promise.resolve($.post(getEntriesURL(source), entry).then(e => e.values));\n };\n \n function updateEntry(source, entryId, values) {\n return Promise.resolve($.ajax({\n type: 'PUT',\n url: getEntryURL(source, entryId),\n contentType: 'application/json',\n data: JSON.stringify({values})\n }));\n }\n\n var getTranslations = function(locale, prefix, keys) {\n const translationsURL = `${module.config().contextPath}/rest/wikis/${XWiki.currentWiki}/localization/translations`;\n return Promise.resolve($.getJSON(translationsURL, $.param({\n locale: locale,\n prefix: prefix,\n key: keys\n }, true)).then(toTranslationsMap));\n };\n\n var toTranslationsMap = function(responseJSON) {\n var translationsMap = {};\n responseJSON.translations?.forEach(translation => translationsMap[translation.key] = translation.rawSource);\n return translationsMap;\n };\n\n function updateEntryProperty(source, entryId, propertyId, propertyValue) {\n return Promise.resolve($.ajax({\n type: 'PUT',\n url: getEntryPropertyURL(source, entryId, propertyId),\n contentType: 'text/plain',\n data: `${propertyValue}`\n }))\n }\n\n return {\n getEntries,\n addEntry,\n updateEntry, \n updateEntryProperty,\n getTranslations\n };\n});\n","/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\n/**\n * Polyfills that are not yet provided by Closure Compiler.\n * See https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/js/polyfills.txt\n */\ndefine('xwiki-livedata-polyfills', function () {\n});\n"], "names":["define","Vue","VueI18n","XWikiLivedata","liveDataSource","jsonMerge","editBus","use","instancesMap","WeakMap","FootnotesService","constructor","_footnotes","put","symbol","translationKey","some","footnote","push","reset","splice","list","Logic","element","data","JSON","parse","getAttribute","contentTrusted","entries","Object","freeze","firstEntriesLoading","currentLayoutId","changeLayout","meta","defaultLayout","entrySelection","selected","deselected","isGlobal","openedPanels","footnotes","panels","removeAttribute","locale","document","documentElement","i18n","messages","silentFallbackWarn","placeholderElement","createElement","appendChild","vue","el","components","template","logic","mounted","classList","remove","$nextTick","triggerEvent","length","updateEntries","finally","init","loadTranslations","this.loadTranslations","componentName","prefix","keys","translations","getTranslations","mergeLocaleMessage","error","console","translationsPromise","translate","this.translate","key","args","$t","translationsLoaded","this.translationsLoaded","registerPanel","id","title","name","icon","component","order","prototype","eventName","eventData","defaultData","livedata","bubbles","detail","assign","event","CustomEvent","dispatchEvent","onEvent","callback","addEventListener","e","onEventWhere","condition","isDetailMatching","every","is","getLayoutIds","layouts","map","layoutDescriptor","getEntryId","entry","idProperty","entryDescriptor","undefined","warn","uniqueArrayHas","uniqueArray","item","includes","uniqueArrayAdd","uniqueArrayRemove","index","indexOf","uniqueArrayToggle","force","getPropertyDescriptors","query","properties","propertyId","getPropertyDescriptor","propertyDescriptor","propertyDescriptors","find","getPropertyTypeDescriptor","propertyTypes","typeDescriptor","type","getLayoutDescriptor","layoutId","getDisplayerDescriptor","customDisplayerDescriptor","displayer","displayerId","defaultDisplayer","defaultDisplayerDescriptor","displayers","getFilterDescriptor","customFilterDescriptor","filter","filterId","defaultFilter","defaultFilterDescriptor","filters","fetchEntries","getEntries","then","catch","err","readyState","value","XWiki","widgets","Notification","isEditable","actions","action","isEntryEditable","isPropertyEditable","isActionAllowed","propertyTypeDescriptor","editable","setValue","source","entryId","updateEntryProperty","setValues","values","updateEntry","canAddEntry","addEntry","Promise","resolve","mockNewUrl","slice","newEntry","count","previousLayoutId","getPageCount","Math","ceil","limit","getPageIndex","entryIndex","offset","floor","setPageIndex","pageIndex","reject","previousPageIndex","getFirstIndexOfPage","getLastIndexOfPage","min","setPageSize","pageSize","previousPageSize","isPropertyVisible","visible","setPropertyVisible","reorderProperty","from","toIndex","fromIndex","isSelectionEnabled","selection","enabled","isEntrySelected","selectEntries","forEach","entryArray","Array","deselectEntries","toggleSelectEntries","select","selectableCountInPage","setEntrySelectGlobal","global","state","getActionDescriptor","descriptor","baseDescriptor","actionDescriptor","allowProperty","isPropertySortable","sortable","getSortableProperties","property","getUnsortedProperties","getQuerySort","sort","level","descending","Error","currentLevel","findIndex","sortObject","addSort","propertyQuerySort","removeSort","reorderSort","querySort","isPropertyFilterable","filterable","getFilterableProperties","getUnfilteredProperties","getQueryFilterGroup","constraints","getQueryFilters","queryFilterGroup","getFilterDefaultOperator","filterDescriptor","filterOperators","operators","defaultOperator","isDefaultOperatorValid","operator","_computeFilterEntries","filterEntry","filterOperator","oldEntry","currentEntry","queryFilters","fromEntries","defaultEntry","self","newEntryValidOperator","_getFilteringType","queryFilter","filterEntries","filteringType","matchAll","removeAllFilters","addFilter","removeFilter","filterIndex","filterGroup","removedFilterGroups","removedFilters","getEditBus","panel","p","isContentTrusted","has","set","get","$","xcontext","getPropertyReference","propertyName","className","startsWith","substring","load","mode","documentReference","targetUrl","getURL","Document","Model","EntityType","DOCUMENT","xpage","language","edit","view","setLocalization","_logic","_editBus","_editBusService","EditBusService","editStates","$on","entryState","propertyState","editing","content","tosave","save","canBeSaved","keyEntry","entryValue","editStatesKey","editStateKey","editState","onAnyEvent","start","$emit","cancel","merge","left","right","mergeObject","isArray","mergeArray","stringify","fromRight","rightItem","findById","fromLeft","leftItem","concat","hasOwnProperty","array","objects","reduce","module","addSourcePathParameters","url","parameters","timestamp","getTime","Date","namespace","currentWiki","addSourceParameters","param","baseURL","config","contextPath","getEntriesURL","entriesURL","encodeURIComponent","each","toLiveData","toTranslationsMap","responseJSON","translationsMap","translation","rawSource","liveDataQuery","constraint","getJSON","post","ajax","encodedSourceId","encodedEntryId","contentType","propertyValue","encodedPropertyId","translationsURL"] }