{"version":3,"file":"pfe-content-set.min.js","sources":["../_temp/polyfills--pfe-content-set.js","../_temp/pfe-content-set.js"],"sourcesContent":["// @POLYFILL NodeList.prototype.forEach()\n// https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach\nif (window.NodeList && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = function (callback, thisArg) {\n thisArg = thisArg || window;\n for (var i = 0; i < this.length; i++) {\n callback.call(thisArg, this[i], i, this);\n }\n };\n}\n","/*!\n * PatternFly Elements: PfeContentSet 1.12.3\n * @license\n * Copyright 2021 Red Hat, Inc.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n*/\n\n// Import polyfills: matches, closest, includes, assign\nimport \"./polyfills--pfe-content-set.js\";\n\nimport PFElement from \"../../pfelement/dist/pfelement.js\";\nimport PfeAccordion from \"../../pfe-accordion/dist/pfe-accordion.js\";\nimport PfeTabs from \"../../pfe-tabs/dist/pfe-tabs.js\";\n\nconst CONTENT_MUTATION_CONFIG = {\n characterData: false,\n childList: true,\n subtree: false,\n};\nclass PfeContentSet extends PFElement {\n\n // Injected at build-time\n static get version() {\n return \"1.12.3\";\n }\n\n // Injected at build-time\n get html() {\n return `\n\n
`;\n }\n\n static get tag() {\n return \"pfe-content-set\";\n }\n\n get styleUrl() {\n return \"pfe-content-set.scss\";\n }\n\n get templateUrl() {\n return \"pfe-content-set.html\";\n }\n\n static get meta() {\n return {\n title: \"Content set\",\n description:\n \"This element creates a flexible component that renders an accordion or tabset depending on screen size.\",\n };\n }\n\n static get pfeType() {\n return PFElement.pfeType.combo;\n }\n\n /**\n * Property definitions for Content set combine the options available for Tabs & Accordion\n */\n static get properties() {\n return {\n //-- PFE-TABS specific properties\n vertical: {\n title: \"Vertical orientation\",\n type: Boolean,\n default: false,\n cascade: \"pfe-tabs\",\n },\n selectedIndex: {\n title: \"Index of the selected tab\",\n type: Number,\n cascade: \"pfe-tabs\",\n },\n tabAlign: {\n title: \"Tab alignment\",\n type: String,\n enum: [\"center\"],\n cascade: \"pfe-tabs\",\n },\n variant: {\n title: \"Variant\",\n type: String,\n enum: [\"wind\", \"earth\"],\n default: \"wind\",\n cascade: \"pfe-tabs\",\n },\n // @TODO: Deprecated for 1.0\n oldVariant: {\n type: String,\n attr: \"pfe-variant\",\n alias: \"variant\",\n },\n // @TODO: Deprecated for 1.0\n oldTabHistory: {\n type: Boolean,\n alias: \"tabHistory\",\n attr: \"pfe-tab-history\",\n },\n tabHistory: {\n title: \"Tab History\",\n type: Boolean,\n default: false,\n cascade: \"pfe-tabs\",\n },\n //-- PFE-ACCORDION specific properties\n disclosure: {\n // Leaving this as a string since it's an opt out\n title: \"Disclosure\",\n type: String,\n values: [\"true\", \"false\"],\n cascade: \"pfe-accordion\",\n },\n // @TODO: Deprecated pfe-disclosure in 1.0\n oldDisclosure: {\n type: String,\n alias: \"disclosure\",\n attr: \"pfe-disclosure\",\n },\n //-- PFE-CONTENT-SET specific properties\n breakpoint: {\n title: \"Custom breakpoint\",\n type: String,\n default: \"700\",\n observer: \"_updateBreakpoint\",\n },\n // @TODO: Deprecated in 1.0\n oldBreakpoint: {\n type: String,\n alias: \"breakpoint\",\n attr: \"pfe-breakpoint\",\n },\n align: {\n type: String,\n enum: [\"center\"],\n observer: \"_alignmentHandler\",\n },\n // @TODO: Deprecated in 1.0\n oldAlign: {\n attr: \"pfe-align\",\n alias: \"align\",\n },\n // @TODO: Deprecated in 1.0\n pfeId: {\n type: String,\n attr: \"pfe-id\",\n observer: \"_copyToId\",\n },\n };\n }\n\n /**\n * Schema definition for slotted content\n * Useful for CMS dynamic imports of components\n */\n static get slots() {\n return {\n default: {\n title: \"Default\",\n type: \"array\",\n namedSlot: false,\n items: {\n $ref: \"raw\",\n },\n },\n };\n }\n\n get breakpointValue() {\n return parseInt(this.breakpoint.replace(/\\D/g, \"\"));\n }\n\n /**\n * Getter: should this be rendered as a tabset based on the breakpoint size\n * @returns {boolean} Is this a tabset?\n */\n get isTab() {\n return this.parentNode\n ? this.parentNode.offsetWidth > this.breakpointValue\n : window.outerWidth > this.breakpointValue;\n }\n\n /**\n * Getter: Alias now for this.view\n * @returns {NodeItem} The rendering component\n */\n get viewAll() {\n return this.view;\n }\n\n /**\n * Getter: Capture the rendering component from the shadow DOM\n * @returns {NodeItem} The rendering component from the shadow DOM\n */\n get view() {\n if (!this._rendered) return;\n return this.shadowRoot.querySelector(this.expectedTag);\n }\n\n /**\n * Getter: should this be rendered as a tabset based on the breakpoint size\n * @returns {boolean} Is this a tabset?\n */\n get expectedTag() {\n if (this.isIE11) return \"pfe-accordion\";\n else return this.isTab ? \"pfe-tabs\" : \"pfe-accordion\";\n }\n\n /**\n * Getter: Capture the tabs component from the _view slot (if it exists)\n * @returns {NodeItem} The tabs component from the _view slot\n */\n get tabs() {\n return this.querySelector(`pfe-tabs[slot=\"_view\"]`);\n }\n\n /**\n * Getter: Capture the accordion component from the _view slot (if it exists)\n * @returns {NodeItem} The accordion component from the _view slot\n */\n get accordion() {\n return this.querySelector(`pfe-accordion[slot=\"_view\"]`);\n }\n\n /**\n * Getter: Validates the incoming light DOM for some usable content\n * @returns {boolean} Returns true if some usable light DOM exists\n */\n get hasValidLightDOM() {\n // If any light DOM exists, validate it meets the requirements for rendering\n if (this.hasLightDOM()) {\n let valid = false;\n // Loop through the assigned nodes\n [...this.children].forEach((node) => {\n // Validate that any non-text nodes have the right attributes present\n // They don't have to be in the right order, just that they exist at all lets us progress\n if (\n node.nodeName !== \"#text\" &&\n (this._isHeader(node) ||\n this._isPanel(node) ||\n (node.tagName && node.tagName.toLowerCase() === this.expectedTag))\n )\n valid = true;\n });\n return valid;\n } else return false;\n }\n\n constructor() {\n super(PfeContentSet, { type: PfeContentSet.PfeType });\n\n this.build = this.build.bind(this);\n\n this._mutationHandler = this._mutationHandler.bind(this);\n this._alignmentHandler = this._alignmentHandler.bind(this);\n this._resizeHandler = this._resizeHandler.bind(this);\n\n this._build = this._build.bind(this);\n this._buildSets = this._buildSets.bind(this);\n\n this._isHeader = this._isHeader.bind(this);\n this._isPanel = this._isPanel.bind(this);\n this._addNodes = this._addNodes.bind(this);\n this._removeNodes = this._removeNodes.bind(this);\n this._findConnection = this._findConnection.bind(this);\n this._addNode = this._addNode.bind(this);\n this._removeNode = this._removeNode.bind(this);\n this._updateNode = this._updateNode.bind(this);\n\n this._copyToId = this._copyToId.bind(this);\n this._updateBreakpoint = this._updateBreakpoint.bind(this);\n\n this._observer = new MutationObserver(this._mutationHandler);\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // this.setAttribute(\"hidden\", \"\");\n\n // Validate that the light DOM data exists before building\n if (this.hasValidLightDOM) this._build();\n\n if (!this.isIE11) {\n window.addEventListener(\"resize\", () => {\n clearTimeout(this._resizeHandler._tId);\n this._resizeHandler._tId = setTimeout(this._resizeHandler, 100);\n });\n\n this._observer.observe(this, CONTENT_MUTATION_CONFIG);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n if (!this.isIE11) {\n this._observer.disconnect();\n\n window.removeEventListener(\"resize\", () => {\n clearTimeout(this._resizeHandler._tId);\n this._resizeHandler._tId = setTimeout(this._resizeHandler, 100);\n });\n }\n }\n\n /**\n * Run the internal build task\n */\n build() {\n // Fire the build of the internals for the new component\n return this._build();\n }\n\n /**\n * Mutation handler\n * Read in and parse the mutation list, rebuilding as necessary\n */\n _mutationHandler(mutationsList) {\n if (!this.isIE11 && mutationsList) {\n for (let mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n if (mutation.addedNodes && mutation.addedNodes.length > 0) {\n // Check the added nodes to make sure it's not assigned to the _view slot\n let nodes = mutation.addedNodes;\n if (nodes.length > 0) this._addNodes(nodes);\n }\n if (mutation.removedNodes && mutation.removedNodes.length > 0) {\n // Check the added nodes to make sure it's not assigned to the _view slot\n let nodes = mutation.removedNodes;\n if (nodes.length > 0) this._removeNodes(nodes);\n }\n }\n }\n\n return;\n }\n\n // If no mutation list is provided or it's IE11, rebuild the whole thing\n this._build();\n }\n\n /**\n * Checks if the element provided is a header region\n * @returns {boolean} True if the element provided is a header region\n */\n _isHeader(el) {\n // Ensure that we don't throw an error if we encounter a web component\n // yet to be defined.\n if (typeof el.hasAttribute !== \"undefined\") {\n return !!(el.hasAttribute(`${this.tag}--header`) || el.tagName.match(/H[1-6]/));\n }\n return false;\n }\n\n /**\n * Checks if the element provided is a panel region\n * @returns {boolean} True if the element provided is a panel region\n */\n _isPanel(el) {\n // Ensure that we don't throw an error if we encounter a web component\n // yet to be defined.\n if (typeof el.previousElementSibling !== \"undefined\") {\n return !!this._isHeader(el.previousElementSibling);\n }\n return false;\n }\n\n /**\n * Reflect the addition of nodes from light DOM into the rendered view\n */\n _addNodes(list) {\n this._build(list);\n\n // @TODO: Build in some logic for injecting a single node rather than rebuild\n // list.forEach(item => this._addNode(item));\n }\n\n /**\n * Reflect the removal of nodes from light DOM into the rendered view\n */\n _removeNodes(list) {\n list.forEach((item) => this._removeNode(item));\n\n // If a container doesn't exist, escape now\n if (!this.view) return;\n\n // Check if the container is empty, hide\n if (!this.view.hasChildNodes()) this.view.setAttribute(\"hidden\", \"\");\n else this.view.removeAttribute(\"hidden\");\n }\n\n /**\n * Find a connection between a node in light DOM that was added or removed\n * and the matching node in the rendered component; this makes upgrades more\n * efficient so we're not rebuilding everything every time.\n * @returns {Node} Returns the node in the rendered component that maps to the light DOM node provided\n */\n _findConnection(node) {\n let connection = null;\n\n if (!this.view) return connection;\n\n // If this node is mapped to one in the upgraded component\n if (node.nodeName !== \"#text\" && node.hasAttribute(\"slot\")) {\n const id = node.getAttribute(\"slot\");\n if (id) connection = this.view.querySelector(`[name=\"${id}\"]`);\n }\n\n if (!connection) this.warn(`no slot could be found with [name=\"${id}\"]`);\n\n // Return the connection\n return connection;\n }\n\n /**\n * Reflect the removal of a node from light DOM into the rendered view\n */\n _addNode(node) {\n if (!this.view) return;\n\n // @TODO: Build in some logic for injecting a single node rather than rebuild\n\n // Fire a full rebuild if it can't determine the mapped element\n this._build();\n }\n\n /**\n * Reflect the removal of a node from light DOM into the rendered view\n */\n _removeNode(node) {\n if (!this.view) return;\n\n const connection = this._findConnection(node);\n if (connection) {\n let header, panel;\n const el = connection.parentElement;\n\n // Look for the sibling element\n if (\n el.getAttribute(\"content-type\") === \"header\" &&\n el.nextElementSibling &&\n el.nextElementSibling.getAttribute(\"content-type\") === \"panel\"\n ) {\n header = el;\n panel = el.nextElementSibling;\n } else if (\n el.getAttribute(\"content-type\") === \"panel\" &&\n el.previousElementSibling &&\n el.previousElementSibling.getAttribute(\"content-type\") === \"header\"\n ) {\n header = el.previousElementSibling;\n panel = el;\n }\n\n // This will remove the sibling element from the\n // shadow template but not the light DOM\n if (header) header.remove();\n if (panel) panel.remove();\n }\n // Fire a full rebuild if it can't determine the mapped element\n else this._build();\n }\n\n _updateNode(node, textContent) {\n if (!this.view) return;\n\n const connection = this._findConnection(node);\n if (connection) {\n if (textContent) connection.textContent = textContent;\n else connection.innerHTML = node.innerHTML;\n }\n // Fire a full rebuild if it can't determine the mapped element\n else this._build();\n }\n\n /**\n * Manage the building of the rendering component\n * Optionally accepts the input of new nodes added to the DOM\n */\n // @TODO: Add back a promise here post-IE11\n _build() {\n const addedNodes = this.children;\n\n // If sets is not null, build them using the template\n if (addedNodes.length > 0) {\n Promise.all([customElements.whenDefined(this.expectedTag)]).then(() => {\n const template = this.expectedTag === \"pfe-tabs\" ? PfeTabs.contentTemplate : PfeAccordion.contentTemplate;\n const sets = this._buildSets(addedNodes, template);\n sets.id = this.id || this.randomId;\n\n const container = this.shadowRoot.querySelector(\"#container\");\n\n if (sets && container) {\n if (!this.isIE11) {\n // Disconnect the observer while we parse it\n this._observer.disconnect();\n\n // This does not work in IE11 for some reason\n container.innerHTML = sets.outerHTML;\n\n // Context is irrelevant in IE11\n this.resetContext();\n } else {\n container.innerHTML = \"\";\n container.appendChild(sets);\n\n // In IE11, we need to hide the light DOM headers (b/c they're copied into shadow DOM on accordion)\n [...this.querySelectorAll(\"[pfe-content-set--header]\")].map((item) => {\n item.style.display = \"none\";\n });\n }\n\n this.cascadeProperties();\n this.removeAttribute(\"hidden\");\n\n // Attach the mutation observer\n if (!this.isIE11) this._observer.observe(this, CONTENT_MUTATION_CONFIG);\n }\n });\n } else {\n this.setAttribute(\"hidden\", \"\");\n }\n }\n\n _buildSets(sets, template) {\n let tagElement = document.createElement(this.expectedTag);\n\n for (let i = 0; i < sets.length; i = i + 2) {\n let header = sets[i];\n let panel = sets[i + 1];\n\n // Set up the template for the sets of content\n const wrapper = document.createElement(\"template\");\n wrapper.innerHTML = template.trim();\n\n // Capture the template markup as a cloned node\n const templateMarkup = wrapper.content.cloneNode(true);\n\n if (!header) this.warn(`no element found at position ${i} of the light DOM input.`);\n if (!panel) this.warn(`no element found at position ${i + 1} of the light DOM input.`);\n\n if (header && this._isHeader(header) && panel && this._isPanel(panel)) {\n // Capture the line-item from the template\n [header, panel].forEach((region, idx) => {\n const section = idx === 0 ? \"header\" : \"panel\";\n\n let piece = templateMarkup.querySelector(`[content-type=\"${section}\"]`).cloneNode(true);\n\n // Create a new slot for the shadow template and create a random name for it\n const slot = document.createElement(\"slot\");\n slot.name = this.randomId.replace(\"pfe-\", `${section}-`);\n\n // Append the new slot into the template item\n piece.appendChild(slot);\n\n // Connect the light DOM region to the newly create slot\n region.setAttribute(\"slot\", slot.name);\n\n // Capture the ID from the region or the pfe-id if they exist\n if (region.id || region.getAttribute(\"pfe-id\")) piece.id = region.id || region.getAttribute(\"pfe-id\");\n\n // Attach the template item to the element tag\n tagElement.appendChild(piece);\n });\n }\n }\n\n return tagElement;\n }\n\n _copyToId(oldVal, newVal) {\n if (oldVal !== newVal && !this.id) {\n // Don't overwrite an existing ID but backwards support pfe-id\n this.id = newVal;\n }\n }\n\n _alignmentHandler(oldVal, newVal) {\n if (oldVal !== newVal) this.tabAlign = newVal;\n }\n\n _resizeHandler() {\n if (!this.view || (this.view && this.view.tag !== this.expectedTag)) {\n this._build();\n }\n }\n\n _updateBreakpoint() {\n // If the correct rendering element isn't in use yet, build it from scratch\n if (!this.view || (this.view && this.view.tag !== this.expectedTag)) {\n this._build();\n }\n }\n}\n\nPFElement.create(PfeContentSet);\n\nexport default PfeContentSet;\n"],"names":["window","NodeList","prototype","forEach","callback","thisArg","i","this","length","call","CONTENT_MUTATION_CONFIG","characterData","childList","subtree","PfeContentSet","PFElement","version","html","tag","styleUrl","templateUrl","meta","title","description","pfeType","combo","properties","vertical","type","Boolean","default","cascade","selectedIndex","Number","tabAlign","String","enum","variant","oldVariant","attr","alias","oldTabHistory","tabHistory","disclosure","values","oldDisclosure","breakpoint","observer","oldBreakpoint","align","oldAlign","pfeId","slots","namedSlot","items","$ref","breakpointValue","parseInt","replace","isTab","parentNode","offsetWidth","outerWidth","viewAll","view","_rendered","shadowRoot","querySelector","expectedTag","isIE11","tabs","accordion","hasValidLightDOM","hasLightDOM","valid","children","node","nodeName","_isHeader","_isPanel","tagName","toLowerCase","[object Object]","super","PfeType","build","bind","_mutationHandler","_alignmentHandler","_resizeHandler","_build","_buildSets","_addNodes","_removeNodes","_findConnection","_addNode","_removeNode","_updateNode","_copyToId","_updateBreakpoint","_observer","MutationObserver","connectedCallback","addEventListener","clearTimeout","_tId","setTimeout","observe","disconnectedCallback","disconnect","removeEventListener","mutationsList","mutation","addedNodes","nodes","removedNodes","el","hasAttribute","match","previousElementSibling","list","item","hasChildNodes","removeAttribute","setAttribute","connection","id","getAttribute","warn","header","panel","parentElement","nextElementSibling","remove","textContent","innerHTML","Promise","all","customElements","whenDefined","then","template","PfeTabs","contentTemplate","PfeAccordion","sets","randomId","container","appendChild","querySelectorAll","map","style","display","outerHTML","resetContext","cascadeProperties","tagElement","document","createElement","wrapper","trim","templateMarkup","content","cloneNode","region","idx","section","piece","slot","name","oldVal","newVal","create"],"mappings":"qKAEIA,OAAOC,WAAaA,SAASC,UAAUC,UACzCF,SAASC,UAAUC,QAAU,SAAUC,EAAUC,GAC/CA,EAAUA,GAAWL,OACrB,IAAK,IAAIM,EAAI,EAAGA,EAAIC,KAAKC,OAAQF,IAC/BF,EAASK,KAAKJ,EAASE,KAAKD,GAAIA,EAAGC;;;;;;;;;;;;;;;;;;;;;;;;GC0BzC,MAAMG,EAA0B,CAC9BC,eAAe,EACfC,WAAW,EACXC,SAAS,GAEX,MAAMC,UAAsBC,EAG1BC,qBACE,MAAO,SAITC,WACE,MAAO,uPAKTC,iBACE,MAAO,kBAGTC,eACE,MAAO,uBAGTC,kBACE,MAAO,uBAGTC,kBACE,MAAO,CACLC,MAAO,cACPC,YACE,2GAINC,qBACE,OAAOT,EAAUS,QAAQC,MAM3BC,wBACE,MAAO,CAELC,SAAU,CACRL,MAAO,uBACPM,KAAMC,QACNC,SAAS,EACTC,QAAS,YAEXC,cAAe,CACbV,MAAO,4BACPM,KAAMK,OACNF,QAAS,YAEXG,SAAU,CACRZ,MAAO,gBACPM,KAAMO,OACNC,KAAM,CAAC,UACPL,QAAS,YAEXM,QAAS,CACPf,MAAO,UACPM,KAAMO,OACNC,KAAM,CAAC,OAAQ,SACfN,QAAS,OACTC,QA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