Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/short-view/dist/ |
Upload File : |
{"version":3,"file":"short.view.bundle.js","sources":["../src/short.view.js"],"sourcesContent":["import { Dom, Type, Loc } from 'main.core';\nimport { EventEmitter } from 'main.core.events';\nimport { SplitButton, ButtonSize, ButtonColor } from 'ui.buttons';\nimport { SwitcherColor } from 'ui.switcher';\n\ntype Params = {\n\tisShortView: 'Y' | 'N'\n}\n\nexport class ShortView extends EventEmitter\n{\n\tconstructor(params: Params)\n\t{\n\t\tsuper(params);\n\n\t\tthis.setEventNamespace('BX.UI.ShortView');\n\n\t\tthis.setShortView(params.isShortView);\n\n\t\tthis.node = null;\n\t}\n\n\trenderTo(container: HTMLElement)\n\t{\n\t\tif (!Type.isDomNode(container))\n\t\t{\n\t\t\tthrow new Error('UI ShortView: HTMLElement not found');\n\t\t}\n\n\t\tDom.append(this.render(), container);\n\t}\n\n\trender(): HTMLElement\n\t{\n\t\tconst checked = (this.getShortView() === 'Y');\n\n\t\tthis.node = new SplitButton({\n\t\t\ttext: Loc.getMessage('UI_SHORT_VIEW_LABEL'),\n\t\t\tround: true,\n\t\t\tsize: ButtonSize.SMALL,\n\t\t\tcolor: ButtonColor.LIGHT_BORDER,\n\t\t\tclassName: 'ui-btn-themes',\n\t\t\tmainButton: {\n\t\t\t\tonclick: (button: SplitButton, event: MouseEvent) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.node.getSwitcher().toggle();\n\t\t\t\t},\n\t\t\t},\n\t\t\tswitcher: {\n\t\t\t\tchecked,\n\t\t\t\tcolor: SwitcherColor.primary,\n\t\t\t\thandlers: {\n\t\t\t\t\ttoggled: () => this.onChange(),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\n\t\treturn this.node.render();\n\t}\n\n\tsetShortView(value: string)\n\t{\n\t\tthis.shortView = (value === 'Y' ? 'Y' : 'N');\n\t}\n\n\tgetShortView(): 'Y' | 'N'\n\t{\n\t\treturn this.shortView;\n\t}\n\n\tonChange()\n\t{\n\t\tthis.setShortView(this.node.getSwitcher().isChecked() ? 'Y' : 'N');\n\n\t\tthis.emit('change', this.getShortView());\n\t}\n}\n"],"names":["ShortView","EventEmitter","constructor","params","setEventNamespace","setShortView","isShortView","node","renderTo","container","Type","isDomNode","Error","Dom","append","render","checked","getShortView","SplitButton","text","Loc","getMessage","round","size","ButtonSize","SMALL","color","ButtonColor","LIGHT_BORDER","className","mainButton","onclick","button","event","preventDefault","getSwitcher","toggle","switcher","SwitcherColor","primary","handlers","toggled","onChange","value","shortView","isChecked","emit"],"mappings":";;;;;;CASO,MAAMA,SAAS,SAASC,6BAAY,CAC3C;GACCC,WAAW,CAACC,MAAc,EAC1B;KACC,KAAK,CAACA,MAAM,CAAC;KAEb,IAAI,CAACC,iBAAiB,CAAC,iBAAiB,CAAC;KAEzC,IAAI,CAACC,YAAY,CAACF,MAAM,CAACG,WAAW,CAAC;KAErC,IAAI,CAACC,IAAI,GAAG,IAAI;;GAGjBC,QAAQ,CAACC,SAAsB,EAC/B;KACC,IAAI,CAACC,cAAI,CAACC,SAAS,CAACF,SAAS,CAAC,EAC9B;OACC,MAAM,IAAIG,KAAK,CAAC,qCAAqC,CAAC;;KAGvDC,aAAG,CAACC,MAAM,CAAC,IAAI,CAACC,MAAM,EAAE,EAAEN,SAAS,CAAC;;GAGrCM,MAAM,GACN;KACC,MAAMC,OAAO,GAAI,IAAI,CAACC,YAAY,EAAE,KAAK,GAAI;KAE7C,IAAI,CAACV,IAAI,GAAG,IAAIW,sBAAW,CAAC;OAC3BC,IAAI,EAAEC,aAAG,CA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