UNPKG

@kitten-science/kitten-scientists

Version:

Add-on for the wonderful incremental browser game: https://kittensgame.com/web/

37 lines 1.57 kB
import stylesButton from "./Button.module.css"; import { Container } from "./Container.js"; import stylesLabelListItem from "./LabelListItem.module.css"; import { SettingListItem } from "./SettingListItem.js"; import { MaxButton } from "./buttons/MaxButton.js"; import { TriggerButton } from "./buttons/TriggerButton.js"; export class SettingMaxTriggerListItem extends SettingListItem { maxButton; triggerButton; constructor(host, setting, locale, label, options) { super(host, setting, label, options); this.maxButton = new MaxButton(host, setting, { alignment: "right", border: false, classes: [stylesButton.headAction], onClick: options?.onSetMax ? () => options.onSetMax?.(this) : undefined, onRefresh: options?.onRefreshMax ? () => options.onRefreshMax?.(this) : undefined, }); this.triggerButton = new TriggerButton(host, setting, locale, { border: false, classes: [stylesButton.lastHeadAction], onClick: options?.onSetTrigger ? () => options.onSetTrigger?.(this) : undefined, onRefreshTitle: options?.onRefreshTrigger ? () => options.onRefreshTrigger?.(this) : undefined, }); this.head.addChildren([ new Container(host, { classes: [stylesLabelListItem.fillSpace] }), this.maxButton, this.triggerButton, ]); } refreshUi() { super.refreshUi(); } } //# sourceMappingURL=SettingMaxTriggerListItem.js.map