PageSourceSearch

https://www.nebelung.de/theme/fc6be77f01289e2dacedb59fa252fa79/js/…rder-approval.multi-select.plugin.0d3654.js

js nebelung.de collected 2026-10-02 10:58:56 UTC 9,108 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[45533],{156:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==s},s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function r(e,t,s){return e.concat(t).map(function(e){return i(e,s)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function l(e,t){try{return t in e}catch(e){return!1}}function o(e,s,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||t,a.cloneUnlessOtherwiseSpecified=i;var c,u,h=Array.isArray(s);return h!==Array.isArray(e)?i(s,a):h?a.arrayMerge(e,s,a):(u={},(c=a).isMergeableObject(e)&&n(e).forEach(function(t){u[t]=i(e[t],c)}),n(s).forEach(function(t){(!l(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(l(e,t)&&c.isMergeableObject(s[t])?u[t]=(function(e,t){if(!t.customMerge)return o;var s=t.customMerge(e);return"function"==typeof s?s:o})(t,c)(e[t],s[t],c):u[t]=i(s[t],c))}),u)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,s){return o(e,s,t)},{})},e.exports=o},707:(e,t,s)=>{s.d(t,{A:()=>i});class i{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let s=i.toUpperCamelCase(e,t);return i.lcFirst(s)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},737:(e,t,s)=>{s.d(t,{A:()=>o});var i=s(156),r=s.n(i),n=s(707);class l{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:s});return this.el.dispatchEvent(i),i}subscribe(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,r=e.split("."),n=s.scope?t.bind(s.scope):t;if(s.once&&!0===s.once){let t=n;n=function(s){i.unsubscribe(e),t(s)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:s,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,s)=>([...s.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):e.push(s),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class o{constructor(e,t={},s=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${s}".`);return}this.el=e,this.$emitter=new l(this.el),this._pluginName=this._getPluginName(s),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),r().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.A.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${t}-config`);return s?window.PluginConfigManager.get(this._pluginName,s):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.A.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${t}-options`);if(s)try{return JSON.parse(s)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}},533:(e,t,s)=>{s.r(t),s.d(t,{default:()=>n});var i=s(737);class r{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var s of e.entries())t(s[1],s[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(s=>{t(e[s],s)});throw Error(`The element type ${typeof e} is not iterable!`)}}class n extends i.A{static #e=this.options={selectionList:".select-selection-list",selectedItem:".select-selection-list__item-holder",selectedItemText:".select-selection-list__item",selectResultList:".select-result-list__content",selectResult:".select-result",selectResultText:".select-result__result-item-text",labelDismiss:".label__dism
1iss"};init(){this.selectedIds=[],this._sampleItem=this.el.querySelector(`${this.options.selectedItem}.sample`),this._sampleResultItem=this.el.querySelector(`${this.options.selectResult}.sample`),this._select=this.el.querySelector(this.options.selectionList),this._selectResults=this.el.querySelectorAll(this.options.selectResult),this._result=this.el.querySelector(this.options.selectResultList),this._registerEvents(),this.el.classList.contains("multi-select")&&this.renderMultiSelectOptions(),this._initValue()}_initValue(){this.selectedIds=JSON.parse(this.el.getAttribute("init-ids"))??[],this.selectedIds?.length&&this._selectResults.forEach(e=>{let t=e.getAttribute("data-id");this.selectedIds.includes(t)&&this.generateSelectedItem(e,t,e.textContent)})}_registerEvents(){this._select.addEventListener("click",this._handleFieldChange.bind(this)),this._select.addEventListener("keydown",this._handleFieldChange.bind(this)),document.body.addEventListener("click",this._onBackgroundClick.bind(this)),document.$emitter.subscribe("MultiSelect/updateConfig",this.renderMultiSelectOptions.bind(this)),this.el.classList.contains("multi-select")||this._registerEventSelectElement()}_registerEventSelectElement(){r.iterate(this._selectResults,e=>{e.addEventListener("click",this._renderResultItem.bind(this)),e.addEventListener("keydown",this._handleKeyDown.bind(this))})}_registerEventRemoveElement(){let e=document.querySelectorAll(this.options.labelDismiss);r.iterate(e,e=>e.addEventListener("click",this._removeResultItem.bind(this)))}_handleFieldChange(){this._result.classList.remove("d-none")}_onBackgroundClick(e){e.target.closest(this.options.selectionList)||e.target.closest(this.options.selectResultList)||this._result.classList.add("d-none"),this.$emitter.publish("onBackgroundClick")}_renderResultItem(e){let t=e.target.querySelector(this.options.selectResultText).textContent,s=e.target.getAttribute("data-id"),i=this.el.querySelector(`${this.options.selectedItem}[data-id="${s}"]`);i?(e.target.classList.remove("is--active"),i.remove(),this.selectedIds=this.selectedIds.filter(e=>e!==s)):(this.generateSelectedItem(e.target,s,t),this.selectedIds=[...this.selectedIds,s]),document.$emitter.publish("MultiSelect/updateValue",{value:this.selectedIds})}_handleKeyDown(e){"Enter"===e.key&&this._renderResultItem(e)}_removeResultItem(e){let t=e.target.closest(this.options.selectedItem),s=t.getAttribute("data-id");this._selectResults.forEach(e=>{e.getAttribute("data-id")===s&&e.classList.remove("is--active")}),this.selectedIds=this.selectedIds.filter(e=>e!==s),document.$emitter.publish("MultiSelect/updateValue",{value:this.selectedIds}),t.remove()}generateSelectedItem(e,t,s){let i=this._sampleItem.cloneNode(!0);i.classList.remove("d-none","sample"),i.setAttribute("data-id",t),i.querySelector(this.options.selectedItemText).textContent=s,this._select.appendChild(i),e.classList.add("is--active"),this._registerEventRemoveElement()}renderMultiSelectOptions(){if(!this.el.classList.contains("multi-select"))return;let e=JSON.parse(this.el.getAttribute("config"))??[],t=this._result.querySelector(".select-result-list__item-list");if(t.innerHTML="",!e.options)return;let s=e.options.options,i=document.documentElement.lang;s.forEach(e=>{let s=this._sampleResultItem.cloneNode(!0);s.classList.remove("d-none","sample"),s.querySelector(".select-result__result-item-text").textContent=e.label[i]??e.label["en-GB"],s.setAttribute("data-id",e.value),t.appendChild(s)}),this._selectResults=this.el.querySelectorAll(this.options.selectResult),this._registerEventSelectElement()}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.