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/buttons/src/ |
Upload File : |
// eslint-disable-next-line max-classes-per-file import { Counter, CounterColor as ButtonCounterColor, CounterSize as ButtonCounterSize, CounterStyle as ButtonCounterStyle } from 'ui.cnt'; export type ButtonCounterOptions = { color: ?string; style: ?ButtonCounterStyle; value: ?number; maxValue: ?number; useSymbolPercent?: boolean; } export class ButtonCounter { #counter: Counter; constructor(options: ButtonCounterOptions) { this.validateOptions(options); this.#counter = new Counter({ color: options.color ?? ButtonCounterColor.DANGER, style: options.style ?? ButtonCounterStyle.FILLED_ALERT, size: options.size ?? ButtonCounterSize.MEDIUM, value: options.value, maxValue: options.maxValue, usePercentSymbol: options.useSymbolPercent, useAirDesign: true, }); } render(): HTMLElement { return this.#counter.render(); } getValue(): number { return this.#counter.getValue(); } setValue(value: number): void { this.#counter.update(value); } setColor(color: string): void { this.#counter.setColor(color); } validateOptions(options: ButtonCounterOptions): void { // todo add implementation } }