{"version":3,"sources":["webpack:///../WCC.UI/App/components/dropdowns/base/base.scss?625b","webpack:///../WCC.UI/App/components/dropdowns/base/base.ts","webpack:///../WCC.UI/App/components/dropdowns/list/list.html?9def","webpack:///../WCC.UI/App/components/dropdowns/list/list.ts","webpack:///../WCC.UI/App/decorators/componentModel.ts","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/App/components/dropdowns/base/base.scss","webpack:///../WCC.UI/App/components/dropdowns/list/list.html"],"names":["api","content","__esModule","default","module","i","options","exports","locals","Dropdown","constructor","jsonModel","_jsonModel$Items","this","items","ko","observable","Items","unwrap","theme","flattenComputed","textSize","findItem","itemOrPredicate","_","isFunction","find","isObject","includes","DropdownVM","model","info","bodyNode","onBodyClick","m","e","$rowOrBody","$","target","closest","is","children","length","preventDefault","stopPropagation","isAlwaysShown","pureComputed","checkIfAlwaysShown","isVisible","applyBindingsToNode","element","__decorate","injectable","componentModel","__param","inject","wccModules","componentConfig","componentInfo","expose","ListDropdownVM","super","headerNodes","templateNodes","filter","contents","bodyNodes","componentModelMetadataKey","Symbol","ctor","Reflect","defineMetadata","system","SystemHelpers","html","getTemplatesAndResources","forEach","node","document","head","appendChild","___CSS_LOADER_API_IMPORT___","push"],"mappings":"uIAAA,IAAIA,EAAM,EAAQ,gFACFC,EAAU,EAAQ,kJAIC,iBAFvBA,EAAUA,EAAQC,WAAaD,EAAQE,QAAUF,KAG/CA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAG9C,IAAIK,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEPN,EAAIC,EAASK,GAI1BF,EAAOG,QAAUN,EAAQO,QAAU,I,q1BCO7B,MAAgBC,EAKlBC,YAAYC,GAA2B,IAAAC,EACnCC,KAAKC,MAAQC,EAAGC,WAA2B,QAAjBJ,EAAU,MAATD,OAAS,EAATA,EAAWM,aAAK,IAAAL,IAAa,MAATD,OAAS,EAATA,EAAWG,OAAOI,SAASf,QAAQ,IAClFU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EAAQE,QAAUF,GAE1CA,GACV,4B,yvBCAT,IAAqB2D,EAArB,cAA4C/B,IAIxCnB,YACwCoB,EACFC,GAElC8B,MAAM/B,EAAOC,GAEblB,KAAKiD,YAAczB,EAAEN,EAAKgC,eAAeC,OAAO,aAAaC,WAC7DpD,KAAKqD,UAAY7B,EAAEN,EAAKgC,eAAeC,OAAO,aAAaC,WAG5ClB,qBACf,OAAO,IAfMa,EAAcT,EAAA,CADlCC,cAMQE,EAAA,EAAAC,YAAOC,IAAWC,kBAClBH,EAAA,EAAAC,YAAOC,IAAWE,iBANNE,gB,wICNrB,oEAAO,MAAMO,EAA4BC,OAAO,sBAElC,SAAUf,EAAevB,GACnC,OAAQuC,IACJC,QAAQC,eAAeJ,EAA2BrC,EAAOuC,GAClDA,K,+DCLf,WAOC,KAPD,aACI,MAAMG,EAAS,EAAQ,mCAAkBC,cAEzC,OAAO,SAAUC,GACbF,EAAOG,yBAAyBD,GAC3BE,SAAQ,SAAUC,GAAQC,SAASC,KAAKC,YAAYH,QAEhE,+B,kKCLDtE,EADkC,EAAQ,wDAChC0E,EAA4B,IAE9BC,KAAK,CAAC9E,EAAOC,EAAI,01DAA21D,KAEp3DD,EAAOG,QAAUA,G,kHCHjBH,EAAOG,QAFI","file":"212.0f873f9253ddfca15e80.js","sourcesContent":["var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./base.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import componentModel from 'decorators/componentModel';\r\nimport { inject, injectable } from \"inversify\";\r\nimport { PureComputed, Subscribable, SubscribableOrNullableValue, SubscribableOrValue } from \"knockout\";\r\nimport { wccModules } from \"../../../enums/wccModules\";\r\nimport './base.scss';\r\n\r\nexport interface DropdownItem {\n title: Subscribable | string\r\n value: T\r\n header?: SubscribableOrNullableValue\r\n separate?: SubscribableOrNullableValue\r\n separateAfter?: SubscribableOrNullableValue\r\n}\n\nexport interface JSONDropdown {\n Items?: SubscribableOrValue>>\r\n items?: SubscribableOrValue>>\r\n theme?: DropdownTheme\r\n textSize?: DropdownTextSize\r\n}\n\nexport type DropdownItemOrPredicate = DropdownItem | ((item: DropdownItem) => boolean)\nexport type DropdownTheme = 'darkgrey' | 'black' | 'blue' | 'grey' | 'white';\nexport type DropdownTextSize = 'medium' | 'small' | 'extrasmall' | 'large';\n\nexport abstract class Dropdown {\n items: PureComputed>>\n theme: Subscribable\n textSize: Subscribable\n\n constructor(jsonModel?: JSONDropdown) {\r\n this.items = ko.observable(jsonModel?.Items ?? jsonModel?.items).unwrap().default([]);\r\n this.theme = ko.flattenComputed(jsonModel?.theme, 'darkgrey');\r\n this.textSize = ko.flattenComputed(jsonModel?.textSize, 'small');\r\n }\r\n\r\n protected findItem(itemOrPredicate: DropdownItemOrPredicate) {\r\n if (_.isFunction(itemOrPredicate))\r\n return this.items().find(itemOrPredicate);\r\n else if (_.isObject(itemOrPredicate) && this.items().includes(itemOrPredicate))\r\n return itemOrPredicate;\r\n\n return undefined;\r\n }\r\n}\n\n@injectable()\n@componentModel(Dropdown)\nexport default class DropdownVM {\n bodyNode = ko.observable();\n\n constructor(\r\n @inject(wccModules.componentConfig) model: Dropdown,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n const isAlwaysShown = ko.pureComputed(() => this.checkIfAlwaysShown());\r\n const isVisible = ko.pureComputed(() => isAlwaysShown() || model.items().length > 0);\r\n\r\n ko.applyBindingsToNode(info.element, {\n 'visible': isVisible,\n\n 'css': {\n 'wcc-dropdown': true,\n 'wcc-dropdown--black': model.theme.is('black'),\n 'wcc-dropdown--blue': model.theme.is('blue'),\n 'wcc-dropdown--grey': model.theme.is('grey'),\n 'wcc-dropdown--white': model.theme.is('white'),\n 'wcc-dropdown--text-m': model.textSize.is('medium'),\n 'wcc-dropdown--text-xs': model.textSize.is('extrasmall'),\n 'wcc-dropdown--text-lg': model.textSize.is('large')\n }\n });\r\n }\r\n\r\n onBodyClick = (m: any, e: JQueryEventObject) => {\r\n const $target = $(e.target);\r\n const $rowOrBody = $target.closest('li, .dropdown-menu');\r\n\r\n let isClickable = $rowOrBody.is('li') && $rowOrBody.children('a').length > 0;\r\n\r\n if (!isClickable) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n }\r\n\r\n protected checkIfAlwaysShown() {\r\n return false;\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./list.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport DropdownVM, { Dropdown } from '../base/base';\r\nimport './list.html';\r\n\n@injectable()\nexport default class ListDropdownVM extends DropdownVM {\n headerNodes: JQuery\n bodyNodes: JQuery\n\n constructor(\r\n @inject(wccModules.componentConfig) model: Dropdown,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n super(model, info);\r\n\r\n this.headerNodes = $(info.templateNodes).filter('list-head').contents();\n this.bodyNodes = $(info.templateNodes).filter('list-body').contents();\r\n }\r\n\r\n protected override checkIfAlwaysShown() {\r\n return true;\r\n }\r\n}","export const componentModelMetadataKey = Symbol('component:template');\r\n\r\nexport default function componentModel(model: any) {\r\n return (ctor: any) => {\r\n Reflect.defineMetadata(componentModelMetadataKey, model, ctor);\r\n return ctor;\r\n }\r\n}","define(function () {\r\n const system = require('helpers/system').SystemHelpers;\r\n\r\n return function (html) {\r\n system.getTemplatesAndResources(html)\r\n .forEach(function (node) { document.head.appendChild(node) });\r\n }\r\n});","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".wcc-dropdown{display:inline-block;position:relative;max-width:100%;vertical-align:text-bottom}.wcc-dropdown .dropdown-toggle{overflow:hidden}.wcc-dropdown .dropdown-toggle .wcc-link{color:#7a7a7a;border-bottom-color:#7a7a7a;font-size:13px;display:inline-block}.wcc-dropdown .dropdown-toggle .wcc-link:hover{color:#474747;border-bottom-color:#474747}.wcc-dropdown .dropdown-header{user-select:none}.wcc-dropdown li a{overflow:hidden;text-overflow:ellipsis}.wcc-dropdown.wcc-dropdown--custom-scroll .dropdown-menu::-webkit-scrollbar{width:8px;height:8px}.wcc-dropdown.wcc-dropdown--custom-scroll .dropdown-menu::-webkit-scrollbar-track{background-color:#e0e0dc;border-radius:4px}.wcc-dropdown.wcc-dropdown--custom-scroll .dropdown-menu::-webkit-scrollbar-thumb{background-color:#a0a0a0;border-radius:4px}.wcc-dropdown--black .dropdown-toggle .wcc-link{color:#262626;border-bottom-color:#262626}.wcc-dropdown--black .dropdown-toggle .wcc-link:hover{color:#000;border-bottom-color:#000}.wcc-dropdown--blue .dropdown-toggle .wcc-link{color:#5ca2dd;border-bottom-color:#5ca2dd}.wcc-dropdown--blue .dropdown-toggle .wcc-link:hover{color:#246faf;border-bottom-color:#246faf}.wcc-dropdown--grey .dropdown-toggle .wcc-link{color:#c6c6c6;border-bottom-color:#c6c6c6}.wcc-dropdown--grey .dropdown-toggle .wcc-link:hover{color:#939393;border-bottom-color:#939393}.wcc-dropdown--white .dropdown-toggle .wcc-link{color:#fff;border-bottom-color:#fff}.wcc-dropdown--white .dropdown-toggle .wcc-link:hover{color:#ccc;border-bottom-color:#ccc}.wcc-dropdown--text-m .dropdown-toggle .wcc-link{font-size:14px}.wcc-dropdown--text-xs .dropdown-toggle .wcc-link{font-size:12px}.wcc-dropdown--text-lg .dropdown-toggle .wcc-link{font-size:16px}.wcc-dropdown--dynamic .dropdown-menu{max-height:500px;max-width:360px;overflow-x:hidden}.wcc-dropdown--dynamic .dropdown-menu .divider:last-child{display:none}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}