@kitten-science/kitten-scientists 2.0.0-beta.10-20250403-28002ba → 2.0.0-beta.10-dev-2a02d77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/KittenScientists.d.ts +1 -1
- package/lib/KittenScientists.d.ts.map +1 -1
- package/lib/KittenScientists.js +6 -6
- package/lib/KittenScientists.js.map +1 -1
- package/lib/ReligionManager.js +1 -1
- package/lib/ReligionManager.js.map +1 -1
- package/lib/TimeControlManager.js +2 -2
- package/lib/TimeControlManager.js.map +1 -1
- package/lib/TradeManager.d.ts.map +1 -1
- package/lib/TradeManager.js.map +1 -1
- package/lib/tools/Log.d.ts +1 -1
- package/lib/tools/Log.d.ts.map +1 -1
- package/lib/tools/Log.js +4 -1
- package/lib/tools/Log.js.map +1 -1
- package/lib/ui/BonfireSettingsUi.d.ts +4 -5
- package/lib/ui/BonfireSettingsUi.d.ts.map +1 -1
- package/lib/ui/BonfireSettingsUi.js +96 -111
- package/lib/ui/BonfireSettingsUi.js.map +1 -1
- package/lib/ui/BuildSectionTools.d.ts +2 -26
- package/lib/ui/BuildSectionTools.d.ts.map +1 -1
- package/lib/ui/BuildSectionTools.js +47 -56
- package/lib/ui/BuildSectionTools.js.map +1 -1
- package/lib/ui/BuildingUpgradeSettingsUi.d.ts +2 -4
- package/lib/ui/BuildingUpgradeSettingsUi.d.ts.map +1 -1
- package/lib/ui/BuildingUpgradeSettingsUi.js +13 -20
- package/lib/ui/BuildingUpgradeSettingsUi.js.map +1 -1
- package/lib/ui/EmbassySettingsUi.d.ts +4 -5
- package/lib/ui/EmbassySettingsUi.d.ts.map +1 -1
- package/lib/ui/EmbassySettingsUi.js +48 -61
- package/lib/ui/EmbassySettingsUi.js.map +1 -1
- package/lib/ui/EngineSettingsUi.d.ts +2 -2
- package/lib/ui/EngineSettingsUi.d.ts.map +1 -1
- package/lib/ui/EngineSettingsUi.js +10 -8
- package/lib/ui/EngineSettingsUi.js.map +1 -1
- package/lib/ui/InternalsUi.d.ts +2 -2
- package/lib/ui/InternalsUi.d.ts.map +1 -1
- package/lib/ui/InternalsUi.js +43 -53
- package/lib/ui/InternalsUi.js.map +1 -1
- package/lib/ui/LogFilterSettingsUi.d.ts +2 -4
- package/lib/ui/LogFilterSettingsUi.d.ts.map +1 -1
- package/lib/ui/LogFilterSettingsUi.js +24 -32
- package/lib/ui/LogFilterSettingsUi.js.map +1 -1
- package/lib/ui/MissionSettingsUi.d.ts +2 -4
- package/lib/ui/MissionSettingsUi.d.ts.map +1 -1
- package/lib/ui/MissionSettingsUi.js +13 -18
- package/lib/ui/MissionSettingsUi.js.map +1 -1
- package/lib/ui/PolicySettingsUi.d.ts +2 -4
- package/lib/ui/PolicySettingsUi.d.ts.map +1 -1
- package/lib/ui/PolicySettingsUi.js +13 -20
- package/lib/ui/PolicySettingsUi.js.map +1 -1
- package/lib/ui/ReligionSettingsUi.d.ts +4 -5
- package/lib/ui/ReligionSettingsUi.d.ts.map +1 -1
- package/lib/ui/ReligionSettingsUi.js +108 -132
- package/lib/ui/ReligionSettingsUi.js.map +1 -1
- package/lib/ui/ResetBonfireSettingsUi.d.ts +2 -2
- package/lib/ui/ResetBonfireSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetBonfireSettingsUi.js +30 -36
- package/lib/ui/ResetBonfireSettingsUi.js.map +1 -1
- package/lib/ui/ResetReligionSettingsUi.d.ts +2 -2
- package/lib/ui/ResetReligionSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetReligionSettingsUi.js +42 -51
- package/lib/ui/ResetReligionSettingsUi.js.map +1 -1
- package/lib/ui/ResetResourcesSettingsUi.d.ts +2 -2
- package/lib/ui/ResetResourcesSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetResourcesSettingsUi.js +24 -31
- package/lib/ui/ResetResourcesSettingsUi.js.map +1 -1
- package/lib/ui/ResetSettingsUi.d.ts +2 -4
- package/lib/ui/ResetSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetSettingsUi.js +14 -19
- package/lib/ui/ResetSettingsUi.js.map +1 -1
- package/lib/ui/ResetSpaceSettingsUi.d.ts +2 -2
- package/lib/ui/ResetSpaceSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetSpaceSettingsUi.js +30 -39
- package/lib/ui/ResetSpaceSettingsUi.js.map +1 -1
- package/lib/ui/ResetTimeSettingsUi.d.ts +2 -2
- package/lib/ui/ResetTimeSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetTimeSettingsUi.js +32 -41
- package/lib/ui/ResetTimeSettingsUi.js.map +1 -1
- package/lib/ui/ResetUpgradesSettingsUi.d.ts +2 -2
- package/lib/ui/ResetUpgradesSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetUpgradesSettingsUi.js +12 -12
- package/lib/ui/ResetUpgradesSettingsUi.js.map +1 -1
- package/lib/ui/ResourcesSettingsUi.d.ts +2 -4
- package/lib/ui/ResourcesSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResourcesSettingsUi.js +16 -20
- package/lib/ui/ResourcesSettingsUi.js.map +1 -1
- package/lib/ui/ScienceSettingsUi.d.ts +2 -4
- package/lib/ui/ScienceSettingsUi.d.ts.map +1 -1
- package/lib/ui/ScienceSettingsUi.js +16 -35
- package/lib/ui/ScienceSettingsUi.js.map +1 -1
- package/lib/ui/SpaceSettingsUi.d.ts +4 -5
- package/lib/ui/SpaceSettingsUi.d.ts.map +1 -1
- package/lib/ui/SpaceSettingsUi.js +43 -54
- package/lib/ui/SpaceSettingsUi.js.map +1 -1
- package/lib/ui/StateManagementUi.d.ts +2 -2
- package/lib/ui/StateManagementUi.d.ts.map +1 -1
- package/lib/ui/StateManagementUi.js +162 -169
- package/lib/ui/StateManagementUi.js.map +1 -1
- package/lib/ui/TechSettingsUi.d.ts +4 -5
- package/lib/ui/TechSettingsUi.d.ts.map +1 -1
- package/lib/ui/TechSettingsUi.js +51 -69
- package/lib/ui/TechSettingsUi.js.map +1 -1
- package/lib/ui/TimeControlSettingsUi.d.ts +3 -4
- package/lib/ui/TimeControlSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeControlSettingsUi.js +22 -34
- package/lib/ui/TimeControlSettingsUi.js.map +1 -1
- package/lib/ui/TimeSettingsUi.d.ts +4 -5
- package/lib/ui/TimeSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeSettingsUi.js +55 -62
- package/lib/ui/TimeSettingsUi.js.map +1 -1
- package/lib/ui/TimeSkipHeatSettingsUi.d.ts +4 -5
- package/lib/ui/TimeSkipHeatSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeSkipHeatSettingsUi.js +28 -44
- package/lib/ui/TimeSkipHeatSettingsUi.js.map +1 -1
- package/lib/ui/TimeSkipSettingsUi.d.ts +2 -4
- package/lib/ui/TimeSkipSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeSkipSettingsUi.js +75 -103
- package/lib/ui/TimeSkipSettingsUi.js.map +1 -1
- package/lib/ui/TradeSettingsUi.d.ts +4 -5
- package/lib/ui/TradeSettingsUi.d.ts.map +1 -1
- package/lib/ui/TradeSettingsUi.js +102 -115
- package/lib/ui/TradeSettingsUi.js.map +1 -1
- package/lib/ui/UpgradeSettingsUi.d.ts +4 -5
- package/lib/ui/UpgradeSettingsUi.d.ts.map +1 -1
- package/lib/ui/UpgradeSettingsUi.js +50 -66
- package/lib/ui/UpgradeSettingsUi.js.map +1 -1
- package/lib/ui/UserInterface.d.ts +3 -0
- package/lib/ui/UserInterface.d.ts.map +1 -1
- package/lib/ui/UserInterface.js +37 -19
- package/lib/ui/UserInterface.js.map +1 -1
- package/lib/ui/VillageSettingsUi.d.ts +2 -4
- package/lib/ui/VillageSettingsUi.d.ts.map +1 -1
- package/lib/ui/VillageSettingsUi.js +87 -105
- package/lib/ui/VillageSettingsUi.js.map +1 -1
- package/lib/ui/WorkshopSettingsUi.d.ts +4 -5
- package/lib/ui/WorkshopSettingsUi.d.ts.map +1 -1
- package/lib/ui/WorkshopSettingsUi.js +82 -103
- package/lib/ui/WorkshopSettingsUi.js.map +1 -1
- package/lib/ui/components/Button.d.ts +9 -8
- package/lib/ui/components/Button.d.ts.map +1 -1
- package/lib/ui/components/Button.js +8 -6
- package/lib/ui/components/Button.js.map +1 -1
- package/lib/ui/components/ButtonListItem.d.ts +4 -4
- package/lib/ui/components/ButtonListItem.d.ts.map +1 -1
- package/lib/ui/components/ButtonListItem.js +2 -7
- package/lib/ui/components/ButtonListItem.js.map +1 -1
- package/lib/ui/components/CollapsiblePanel.d.ts +15 -11
- package/lib/ui/components/CollapsiblePanel.d.ts.map +1 -1
- package/lib/ui/components/CollapsiblePanel.js +42 -25
- package/lib/ui/components/CollapsiblePanel.js.map +1 -1
- package/lib/ui/components/Container.d.ts +7 -2
- package/lib/ui/components/Container.d.ts.map +1 -1
- package/lib/ui/components/Container.js +6 -3
- package/lib/ui/components/Container.js.map +1 -1
- package/lib/ui/components/CyclesList.d.ts +7 -8
- package/lib/ui/components/CyclesList.d.ts.map +1 -1
- package/lib/ui/components/CyclesList.js +34 -27
- package/lib/ui/components/CyclesList.js.map +1 -1
- package/lib/ui/components/Delimiter.d.ts +3 -2
- package/lib/ui/components/Delimiter.d.ts.map +1 -1
- package/lib/ui/components/Delimiter.js +6 -2
- package/lib/ui/components/Delimiter.js.map +1 -1
- package/lib/ui/components/Dialog.d.ts +14 -6
- package/lib/ui/components/Dialog.d.ts.map +1 -1
- package/lib/ui/components/Dialog.js +66 -40
- package/lib/ui/components/Dialog.js.map +1 -1
- package/lib/ui/components/ExplainerListItem.d.ts +5 -2
- package/lib/ui/components/ExplainerListItem.d.ts.map +1 -1
- package/lib/ui/components/ExplainerListItem.js +7 -4
- package/lib/ui/components/ExplainerListItem.js.map +1 -1
- package/lib/ui/components/Fieldset.d.ts +6 -4
- package/lib/ui/components/Fieldset.d.ts.map +1 -1
- package/lib/ui/components/Fieldset.js +6 -3
- package/lib/ui/components/Fieldset.js.map +1 -1
- package/lib/ui/components/HeaderListItem.d.ts +6 -3
- package/lib/ui/components/HeaderListItem.d.ts.map +1 -1
- package/lib/ui/components/HeaderListItem.js +6 -3
- package/lib/ui/components/HeaderListItem.js.map +1 -1
- package/lib/ui/components/IconButton.d.ts +8 -6
- package/lib/ui/components/IconButton.d.ts.map +1 -1
- package/lib/ui/components/IconButton.js +6 -5
- package/lib/ui/components/IconButton.js.map +1 -1
- package/lib/ui/components/IconSettingsPanel.d.ts +5 -4
- package/lib/ui/components/IconSettingsPanel.d.ts.map +1 -1
- package/lib/ui/components/IconSettingsPanel.js +4 -2
- package/lib/ui/components/IconSettingsPanel.js.map +1 -1
- package/lib/ui/components/Input.d.ts +6 -3
- package/lib/ui/components/Input.d.ts.map +1 -1
- package/lib/ui/components/Input.js +6 -3
- package/lib/ui/components/Input.js.map +1 -1
- package/lib/ui/components/LabelListItem.d.ts +10 -7
- package/lib/ui/components/LabelListItem.d.ts.map +1 -1
- package/lib/ui/components/LabelListItem.js +21 -10
- package/lib/ui/components/LabelListItem.js.map +1 -1
- package/lib/ui/components/ListItem.d.ts +9 -6
- package/lib/ui/components/ListItem.d.ts.map +1 -1
- package/lib/ui/components/ListItem.js +6 -3
- package/lib/ui/components/ListItem.js.map +1 -1
- package/lib/ui/components/OptionsListItem.d.ts +6 -5
- package/lib/ui/components/OptionsListItem.d.ts.map +1 -1
- package/lib/ui/components/OptionsListItem.js +7 -5
- package/lib/ui/components/OptionsListItem.js.map +1 -1
- package/lib/ui/components/Paragraph.d.ts +7 -2
- package/lib/ui/components/Paragraph.d.ts.map +1 -1
- package/lib/ui/components/Paragraph.js +6 -3
- package/lib/ui/components/Paragraph.js.map +1 -1
- package/lib/ui/components/RadioItem.d.ts +9 -7
- package/lib/ui/components/RadioItem.d.ts.map +1 -1
- package/lib/ui/components/RadioItem.js +9 -7
- package/lib/ui/components/RadioItem.js.map +1 -1
- package/lib/ui/components/SeasonsList.d.ts +7 -6
- package/lib/ui/components/SeasonsList.d.ts.map +1 -1
- package/lib/ui/components/SeasonsList.js +20 -13
- package/lib/ui/components/SeasonsList.js.map +1 -1
- package/lib/ui/components/SettingLimitedListItem.d.ts +7 -7
- package/lib/ui/components/SettingLimitedListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingLimitedListItem.js +7 -8
- package/lib/ui/components/SettingLimitedListItem.js.map +1 -1
- package/lib/ui/components/SettingLimitedTriggerListItem.d.ts +7 -6
- package/lib/ui/components/SettingLimitedTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingLimitedTriggerListItem.js +12 -11
- package/lib/ui/components/SettingLimitedTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingListItem.d.ts +11 -11
- package/lib/ui/components/SettingListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingListItem.js +16 -20
- package/lib/ui/components/SettingListItem.js.map +1 -1
- package/lib/ui/components/SettingMaxListItem.d.ts +7 -7
- package/lib/ui/components/SettingMaxListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingMaxListItem.js +12 -10
- package/lib/ui/components/SettingMaxListItem.js.map +1 -1
- package/lib/ui/components/SettingMaxTriggerListItem.d.ts +9 -6
- package/lib/ui/components/SettingMaxTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingMaxTriggerListItem.js +19 -14
- package/lib/ui/components/SettingMaxTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingTriggerListItem.d.ts +8 -7
- package/lib/ui/components/SettingTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingTriggerListItem.js +15 -12
- package/lib/ui/components/SettingTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingsList.d.ts +13 -11
- package/lib/ui/components/SettingsList.d.ts.map +1 -1
- package/lib/ui/components/SettingsList.js +15 -16
- package/lib/ui/components/SettingsList.js.map +1 -1
- package/lib/ui/components/SettingsPanel.d.ts +9 -8
- package/lib/ui/components/SettingsPanel.d.ts.map +1 -1
- package/lib/ui/components/SettingsPanel.js +10 -10
- package/lib/ui/components/SettingsPanel.js.map +1 -1
- package/lib/ui/components/TextButton.d.ts +7 -6
- package/lib/ui/components/TextButton.d.ts.map +1 -1
- package/lib/ui/components/TextButton.js +7 -5
- package/lib/ui/components/TextButton.js.map +1 -1
- package/lib/ui/components/ToolbarListItem.d.ts +6 -5
- package/lib/ui/components/ToolbarListItem.d.ts.map +1 -1
- package/lib/ui/components/ToolbarListItem.js +7 -12
- package/lib/ui/components/ToolbarListItem.js.map +1 -1
- package/lib/ui/components/UiComponent.d.ts +32 -18
- package/lib/ui/components/UiComponent.d.ts.map +1 -1
- package/lib/ui/components/UiComponent.js +50 -19
- package/lib/ui/components/UiComponent.js.map +1 -1
- package/lib/ui/components/WorkshopCraftListItem.d.ts +8 -7
- package/lib/ui/components/WorkshopCraftListItem.d.ts.map +1 -1
- package/lib/ui/components/WorkshopCraftListItem.js +17 -18
- package/lib/ui/components/WorkshopCraftListItem.js.map +1 -1
- package/lib/ui/components/buttons/ConsumeButton.d.ts +5 -2
- package/lib/ui/components/buttons/ConsumeButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/ConsumeButton.js +19 -26
- package/lib/ui/components/buttons/ConsumeButton.js.map +1 -1
- package/lib/ui/components/buttons/ExpandoButton.d.ts +6 -2
- package/lib/ui/components/buttons/ExpandoButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/ExpandoButton.js +10 -9
- package/lib/ui/components/buttons/ExpandoButton.js.map +1 -1
- package/lib/ui/components/buttons/LimitedButton.d.ts +8 -7
- package/lib/ui/components/buttons/LimitedButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/LimitedButton.js +20 -13
- package/lib/ui/components/buttons/LimitedButton.js.map +1 -1
- package/lib/ui/components/buttons/MaxButton.d.ts +5 -5
- package/lib/ui/components/buttons/MaxButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/MaxButton.js +5 -7
- package/lib/ui/components/buttons/MaxButton.js.map +1 -1
- package/lib/ui/components/buttons/PaddingButton.d.ts +5 -2
- package/lib/ui/components/buttons/PaddingButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/PaddingButton.js +6 -3
- package/lib/ui/components/buttons/PaddingButton.js.map +1 -1
- package/lib/ui/components/buttons/StockButton.d.ts +5 -2
- package/lib/ui/components/buttons/StockButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/StockButton.js +25 -32
- package/lib/ui/components/buttons/StockButton.js.map +1 -1
- package/lib/ui/components/buttons/TriggerButton.d.ts +6 -5
- package/lib/ui/components/buttons/TriggerButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/TriggerButton.js +11 -12
- package/lib/ui/components/buttons/TriggerButton.js.map +1 -1
- package/lib/ui/components/buttons-text/BuyButton.d.ts +6 -5
- package/lib/ui/components/buttons-text/BuyButton.d.ts.map +1 -1
- package/lib/ui/components/buttons-text/BuyButton.js +19 -26
- package/lib/ui/components/buttons-text/BuyButton.js.map +1 -1
- package/lib/ui/components/buttons-text/SellButton.d.ts +6 -5
- package/lib/ui/components/buttons-text/SellButton.d.ts.map +1 -1
- package/lib/ui/components/buttons-text/SellButton.js +19 -28
- package/lib/ui/components/buttons-text/SellButton.js.map +1 -1
- package/output/kitten-scientists.inject.js +2427 -2536
- package/package.json +4 -4
|
@@ -5,7 +5,6 @@ export class SettingListItem extends LabelListItem {
|
|
|
5
5
|
setting;
|
|
6
6
|
checkbox;
|
|
7
7
|
readOnly;
|
|
8
|
-
static #nextId = 0;
|
|
9
8
|
/**
|
|
10
9
|
* Construct a new setting element.
|
|
11
10
|
* This is a simple checkbox with a label.
|
|
@@ -15,46 +14,43 @@ export class SettingListItem extends LabelListItem {
|
|
|
15
14
|
* @param setting The setting this element is linked to.
|
|
16
15
|
* @param options Options for this list item.
|
|
17
16
|
*/
|
|
18
|
-
constructor(
|
|
19
|
-
super(
|
|
17
|
+
constructor(parent, setting, label, options) {
|
|
18
|
+
super(parent, label, { ...options });
|
|
20
19
|
this.element.addClass(styles.setting);
|
|
21
|
-
const id = `ks-setting${
|
|
20
|
+
const id = `ks-setting${this.componentId}`;
|
|
22
21
|
const checkbox = $("<input/>", {
|
|
23
22
|
id,
|
|
24
23
|
type: "checkbox",
|
|
25
24
|
}).addClass(styles.checkbox);
|
|
26
|
-
this.readOnly = options
|
|
25
|
+
this.readOnly = options?.readOnly ?? false;
|
|
27
26
|
checkbox.prop("disabled", this.readOnly);
|
|
28
|
-
checkbox.on("change", () => {
|
|
27
|
+
checkbox.on("change", (event) => {
|
|
29
28
|
if (checkbox.is(":checked") && !setting.enabled) {
|
|
30
|
-
|
|
31
|
-
options.onCheck?.();
|
|
32
|
-
this.refreshUi();
|
|
29
|
+
this.check();
|
|
33
30
|
}
|
|
34
31
|
else if (!checkbox.is(":checked") && setting.enabled) {
|
|
35
|
-
|
|
36
|
-
options.onUnCheck?.();
|
|
37
|
-
this.refreshUi();
|
|
32
|
+
this.uncheck();
|
|
38
33
|
}
|
|
39
34
|
});
|
|
40
35
|
this.elementLabel.before(checkbox);
|
|
41
36
|
this.elementLabel.prop("for", id);
|
|
42
37
|
this.checkbox = checkbox;
|
|
43
38
|
this.setting = setting;
|
|
44
|
-
this.addChildren(options.children);
|
|
45
39
|
}
|
|
46
|
-
|
|
40
|
+
toString() {
|
|
41
|
+
return `[${SettingListItem.name}#${this.componentId}]: '${this.elementLabel.text()}'`;
|
|
42
|
+
}
|
|
43
|
+
async check(isBatchProcess = false) {
|
|
47
44
|
this.setting.enabled = true;
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
45
|
+
await this.options?.onCheck?.call(isBatchProcess);
|
|
46
|
+
this.requestRefresh(true);
|
|
50
47
|
}
|
|
51
|
-
uncheck(isBatchProcess = false) {
|
|
48
|
+
async uncheck(isBatchProcess = false) {
|
|
52
49
|
this.setting.enabled = false;
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
50
|
+
await this.options.onUnCheck?.call(isBatchProcess);
|
|
51
|
+
this.requestRefresh(true);
|
|
55
52
|
}
|
|
56
53
|
refreshUi() {
|
|
57
|
-
super.refreshUi();
|
|
58
54
|
if (this.setting.enabled) {
|
|
59
55
|
this.element.addClass(styles.checked);
|
|
60
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingListItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingListItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7D,OAAO,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAqBnG,MAAM,OAAO,eAAoD,SAAQ,aAAa;IAE3E,OAAO,CAAW;IAClB,QAAQ,CAAU;IAE3B,QAAQ,CAAU;IAElB;;;;;;;;OAQG;IACH,YACE,MAAmB,EACnB,OAAiB,EACjB,KAAa,EACb,OAAgC;QAEhC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEtC,MAAM,EAAE,GAAG,aAAa,IAAI,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,CAAC,CAAC,UAAU,EAAE;YAC7B,EAAE;YACF,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAE7B,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,KAAK,CAAC;QAC3C,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEzC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAyB,EAAE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B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import type { SettingMax } from "../../settings/Settings.js";
|
|
3
2
|
import { SettingListItem, type SettingListItemOptions } from "./SettingListItem.js";
|
|
4
3
|
import type { UiComponent } from "./UiComponent.js";
|
|
5
4
|
import { MaxButton } from "./buttons/MaxButton.js";
|
|
6
|
-
export type
|
|
7
|
-
readonly onRefreshMax
|
|
8
|
-
readonly onSetMax: (
|
|
5
|
+
export type SettingMaxListItemOptions = ThisType<SettingMaxListItem> & SettingListItemOptions & {
|
|
6
|
+
readonly onRefreshMax?: () => void;
|
|
7
|
+
readonly onSetMax: () => void;
|
|
9
8
|
};
|
|
10
|
-
export declare class SettingMaxListItem
|
|
9
|
+
export declare class SettingMaxListItem extends SettingListItem<SettingMax> {
|
|
10
|
+
readonly options: SettingMaxListItemOptions;
|
|
11
11
|
readonly maxButton: MaxButton;
|
|
12
12
|
/**
|
|
13
13
|
* Create a UI element for a setting that can have a maximum.
|
|
@@ -19,7 +19,7 @@ export declare class SettingMaxListItem<TOptions extends SettingListItemOptions<
|
|
|
19
19
|
* @param setting The setting model.
|
|
20
20
|
* @param options Options for the list item.
|
|
21
21
|
*/
|
|
22
|
-
constructor(
|
|
23
|
-
|
|
22
|
+
constructor(parent: UiComponent, setting: SettingMax, label: string, options: SettingMaxListItemOptions);
|
|
23
|
+
toString(): string;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=SettingMaxListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingMaxListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SettingMaxListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,GAClE,sBAAsB,GAAG;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAEJ,qBAAa,kBAAmB,SAAQ,eAAe,CAAC,UAAU,CAAC;IACjE,SAAiB,OAAO,EAAE,yBAAyB,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAE9B;;;;;;;;;OASG;gBAED,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB;IAkBpC,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -14,21 +14,23 @@ export class SettingMaxListItem extends SettingListItem {
|
|
|
14
14
|
* @param setting The setting model.
|
|
15
15
|
* @param options Options for the list item.
|
|
16
16
|
*/
|
|
17
|
-
constructor(
|
|
18
|
-
super(
|
|
19
|
-
this.maxButton = new MaxButton(
|
|
17
|
+
constructor(parent, setting, label, options) {
|
|
18
|
+
super(parent, setting, label, options);
|
|
19
|
+
this.maxButton = new MaxButton(parent, setting, {
|
|
20
20
|
border: false,
|
|
21
|
-
onClick:
|
|
22
|
-
|
|
21
|
+
onClick: () => {
|
|
22
|
+
options.onSetMax.call(this);
|
|
23
|
+
this.requestRefresh();
|
|
24
|
+
},
|
|
25
|
+
onRefresh: options?.onRefreshMax ? () => options.onRefreshMax?.call(this) : undefined,
|
|
23
26
|
});
|
|
24
|
-
this.
|
|
25
|
-
new Container(
|
|
27
|
+
this.addChildrenHead([
|
|
28
|
+
new Container(parent, { classes: [stylesLabelListItem.fillSpace] }),
|
|
26
29
|
this.maxButton,
|
|
27
30
|
]);
|
|
28
31
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.maxButton.refreshUi();
|
|
32
|
+
toString() {
|
|
33
|
+
return `[${SettingMaxListItem.name}#${this.componentId}]: '${this.elementLabel.text()}'`;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
//# sourceMappingURL=SettingMaxListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingMaxListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxListItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingMaxListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxListItem.ts"],"names":[],"mappings":"AACA,OAAO,EAA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2
|
import type { SettingOptions, SettingTriggerMax } from "../../settings/Settings.js";
|
|
4
3
|
import { SettingListItem, type SettingListItemOptions } from "./SettingListItem.js";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
4
|
+
import type { SettingMaxListItemOptions } from "./SettingMaxListItem.js";
|
|
5
|
+
import type { SettingTriggerListItemOptions } from "./SettingTriggerListItem.js";
|
|
7
6
|
import type { UiComponent } from "./UiComponent.js";
|
|
8
7
|
import { MaxButton } from "./buttons/MaxButton.js";
|
|
9
8
|
import { TriggerButton } from "./buttons/TriggerButton.js";
|
|
10
|
-
export
|
|
9
|
+
export type SettingMaxTriggerListItemOptions = ThisType<SettingMaxTriggerListItem> & SettingListItemOptions & SettingMaxListItemOptions & SettingTriggerListItemOptions & {
|
|
10
|
+
readonly renderLabelTrigger?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare class SettingMaxTriggerListItem extends SettingListItem<SettingTriggerMax> {
|
|
13
|
+
readonly options: SettingMaxTriggerListItemOptions;
|
|
11
14
|
readonly maxButton: MaxButton;
|
|
12
15
|
readonly triggerButton: TriggerButton;
|
|
13
|
-
constructor(
|
|
14
|
-
|
|
16
|
+
constructor(parent: UiComponent, setting: SettingTriggerMax, locale: SettingOptions<SupportedLocale>, label: string, options: SettingMaxTriggerListItemOptions);
|
|
17
|
+
toString(): string;
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=SettingMaxTriggerListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingMaxTriggerListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxTriggerListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SettingMaxTriggerListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxTriggerListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpF,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC,yBAAyB,CAAC,GAChF,sBAAsB,GACtB,yBAAyB,GACzB,6BAA6B,GAAG;IAC9B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEJ,qBAAa,yBAA0B,SAAQ,eAAe,CAAC,iBAAiB,CAAC;IAC/E,SAAiB,OAAO,EAAE,gCAAgC,CAAC;IAC3D,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;gBAGpC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,EACvC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gCAAgC;IAgC3C,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -7,31 +7,36 @@ import { TriggerButton } from "./buttons/TriggerButton.js";
|
|
|
7
7
|
export class SettingMaxTriggerListItem extends SettingListItem {
|
|
8
8
|
maxButton;
|
|
9
9
|
triggerButton;
|
|
10
|
-
constructor(
|
|
11
|
-
super(
|
|
12
|
-
this.maxButton = new MaxButton(
|
|
10
|
+
constructor(parent, setting, locale, label, options) {
|
|
11
|
+
super(parent, setting, label, options);
|
|
12
|
+
this.maxButton = new MaxButton(parent, setting, {
|
|
13
13
|
alignment: "right",
|
|
14
14
|
border: false,
|
|
15
15
|
classes: [stylesButton.headAction],
|
|
16
|
-
onClick:
|
|
17
|
-
|
|
16
|
+
onClick: () => {
|
|
17
|
+
options.onSetMax.call(this);
|
|
18
|
+
this.requestRefresh();
|
|
19
|
+
},
|
|
20
|
+
onRefresh: options?.onRefreshMax ? () => options.onRefreshMax?.call(this) : undefined,
|
|
18
21
|
});
|
|
19
|
-
this.triggerButton = new TriggerButton(
|
|
22
|
+
this.triggerButton = new TriggerButton(parent, setting, locale, {
|
|
20
23
|
border: false,
|
|
21
24
|
classes: [stylesButton.lastHeadAction],
|
|
22
|
-
onClick:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
onClick: async () => {
|
|
26
|
+
await options.onSetTrigger.call(this);
|
|
27
|
+
this.requestRefresh();
|
|
28
|
+
},
|
|
29
|
+
onRefresh: options?.onRefreshTrigger ? () => options.onRefreshTrigger?.call(this) : undefined,
|
|
30
|
+
renderLabel: options?.renderLabelTrigger ?? true,
|
|
26
31
|
});
|
|
27
|
-
this.
|
|
28
|
-
new Container(
|
|
32
|
+
this.addChildrenHead([
|
|
33
|
+
new Container(parent, { classes: [stylesLabelListItem.fillSpace] }),
|
|
29
34
|
this.maxButton,
|
|
30
35
|
this.triggerButton,
|
|
31
36
|
]);
|
|
32
37
|
}
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
toString() {
|
|
39
|
+
return `[${SettingMaxTriggerListItem.name}#${this.componentId}]: '${this.elementLabel.text()}'`;
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
//# sourceMappingURL=SettingMaxTriggerListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingMaxTriggerListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxTriggerListItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingMaxTriggerListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingMaxTriggerListItem.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAA+B,MAAM,sBAAsB,CAAC;AAIpF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,MAAM,OAAO,yBAA0B,SAAQ,eAAkC;IAEtE,SAAS,CAAY;IACrB,aAAa,CAAgB;IAEtC,YACE,MAAmB,EACnB,OAA0B,EAC1B,MAAuC,EACvC,KAAa,EACb,OAAyC;QAEzC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAEvC,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE;YAC9C,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC;YAClC,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,CAAC;YACD,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;SACtF,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;YAC9D,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC;YACtC,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtC,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,CAAC;YACD,SAAS,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;YAC7F,WAAW,EAAE,OAAO,EAAE,kBAAkB,IAAI,IAAI;SACjD,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,CAAC;YACnB,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YACnE,IAAI,CAAC,SAAS;YACd,IAAI,CAAC,aAAa;SACnB,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,yBAAyB,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC;IAClG,CAAC;CACF"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { SupportedLocale } from "../../Engine.js";
|
|
2
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
3
2
|
import type { SettingOptions, SettingThreshold, SettingTrigger } from "../../settings/Settings.js";
|
|
4
3
|
import { SettingListItem, type SettingListItemOptions } from "./SettingListItem.js";
|
|
5
4
|
import type { UiComponent } from "./UiComponent.js";
|
|
6
5
|
import { TriggerButton } from "./buttons/TriggerButton.js";
|
|
7
|
-
export type
|
|
8
|
-
readonly onRefreshTrigger
|
|
9
|
-
readonly onSetTrigger: (
|
|
6
|
+
export type SettingTriggerListItemOptions = ThisType<SettingTriggerListItem> & SettingListItemOptions & {
|
|
7
|
+
readonly onRefreshTrigger?: () => void | Promise<void>;
|
|
8
|
+
readonly onSetTrigger: () => void | Promise<void>;
|
|
9
|
+
readonly renderLabelTrigger?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare class SettingTriggerListItem
|
|
11
|
+
export declare class SettingTriggerListItem extends SettingListItem {
|
|
12
|
+
readonly options: SettingTriggerListItemOptions;
|
|
12
13
|
readonly triggerButton: TriggerButton;
|
|
13
|
-
constructor(
|
|
14
|
-
|
|
14
|
+
constructor(parent: UiComponent, setting: SettingThreshold | SettingTrigger, locale: SettingOptions<SupportedLocale>, label: string, options: SettingTriggerListItemOptions);
|
|
15
|
+
toString(): string;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=SettingTriggerListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingTriggerListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingTriggerListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SettingTriggerListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingTriggerListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGnG,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC,sBAAsB,CAAC,GAC1E,sBAAsB,GAAG;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEJ,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,SAAiB,OAAO,EAAE,6BAA6B,CAAC;IACxD,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;gBAGpC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,gBAAgB,GAAG,cAAc,EAC1C,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,EACvC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,6BAA6B;IAoBxC,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -4,22 +4,25 @@ import { SettingListItem } from "./SettingListItem.js";
|
|
|
4
4
|
import { TriggerButton } from "./buttons/TriggerButton.js";
|
|
5
5
|
export class SettingTriggerListItem extends SettingListItem {
|
|
6
6
|
triggerButton;
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
9
|
-
this.triggerButton = new TriggerButton(
|
|
7
|
+
constructor(parent, setting, locale, label, options) {
|
|
8
|
+
super(parent, setting, label, options);
|
|
9
|
+
this.triggerButton = new TriggerButton(parent, setting, locale, {
|
|
10
10
|
alignment: "right",
|
|
11
11
|
border: false,
|
|
12
|
-
onClick:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
onClick: async () => {
|
|
13
|
+
await options.onSetTrigger.call(this);
|
|
14
|
+
this.requestRefresh();
|
|
15
|
+
},
|
|
16
|
+
onRefresh: options?.onRefreshTrigger ? () => options.onRefreshTrigger?.call(this) : undefined,
|
|
17
|
+
renderLabel: options?.renderLabelTrigger ?? true,
|
|
16
18
|
});
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
+
this.addChildrenHead([
|
|
20
|
+
new Container(parent, { classes: [stylesLabelListItem.fillSpace] }),
|
|
21
|
+
this.triggerButton,
|
|
22
|
+
]);
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.triggerButton.refreshUi();
|
|
24
|
+
toString() {
|
|
25
|
+
return `[${SettingTriggerListItem.name}#${this.componentId}]: '${this.elementLabel.text()}'`;
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
//# sourceMappingURL=SettingTriggerListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingTriggerListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingTriggerListItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingTriggerListItem.js","sourceRoot":"","sources":["../../../source/ui/components/SettingTriggerListItem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAA+B,MAAM,sBAAsB,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IAEhD,aAAa,CAAgB;IAEtC,YACE,MAAmB,EACnB,OAA0C,EAC1C,MAAuC,EACvC,KAAa,EACb,OAAsC;QAEtC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAEvC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;YAC9D,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtC,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,CAAC;YACD,SAAS,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;YAC7F,WAAW,EAAE,OAAO,EAAE,kBAAkB,IAAI,IAAI;SACjD,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,CAAC;YACnB,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YACnE,IAAI,CAAC,aAAa;SACnB,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,sBAAsB,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC;IAC/F,CAAC;CACF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import { IconButton } from "./IconButton.js";
|
|
3
|
-
import { UiComponent, type
|
|
4
|
-
export type SettingsListOptions
|
|
5
|
-
readonly hasEnableAll
|
|
6
|
-
readonly hasDisableAll
|
|
7
|
-
readonly onEnableAll
|
|
8
|
-
readonly onDisableAll
|
|
9
|
-
readonly onReset
|
|
2
|
+
import { UiComponent, type UiComponentOptions } from "./UiComponent.js";
|
|
3
|
+
export type SettingsListOptions = ThisType<SettingsList> & UiComponentOptions & {
|
|
4
|
+
readonly hasEnableAll?: boolean;
|
|
5
|
+
readonly hasDisableAll?: boolean;
|
|
6
|
+
readonly onEnableAll?: () => void;
|
|
7
|
+
readonly onDisableAll?: () => void;
|
|
8
|
+
readonly onReset?: () => void;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
11
|
* The `SettingsList` is a `<ul>` designed to host `SettingListItem` instances.
|
|
@@ -16,7 +15,8 @@ export type SettingsListOptions<TChild extends UiComponentInterface = UiComponen
|
|
|
16
15
|
*
|
|
17
16
|
* This construct is also sometimes referred to as an "items list" for historic reasons.
|
|
18
17
|
*/
|
|
19
|
-
export declare class SettingsList
|
|
18
|
+
export declare class SettingsList extends UiComponent {
|
|
19
|
+
readonly options: SettingsListOptions;
|
|
20
20
|
readonly element: JQuery;
|
|
21
21
|
readonly list: JQuery;
|
|
22
22
|
readonly disableAllButton: IconButton | undefined;
|
|
@@ -28,7 +28,9 @@ export declare class SettingsList<TOptions extends SettingsListOptions<UiCompone
|
|
|
28
28
|
* @param host A reference to the host.
|
|
29
29
|
* @param options Which tools should be available on the list?
|
|
30
30
|
*/
|
|
31
|
-
constructor(
|
|
32
|
-
|
|
31
|
+
constructor(parent: UiComponent, options?: SettingsListOptions);
|
|
32
|
+
toString(): string;
|
|
33
|
+
addChild(child: UiComponent): this;
|
|
34
|
+
refreshUi(): void;
|
|
33
35
|
}
|
|
34
36
|
//# sourceMappingURL=SettingsList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsList.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingsList.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsList.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingsList.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CAAC,GACtD,kBAAkB,GAAG;IACnB,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAEJ;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C,SAAiB,OAAO,EAAE,mBAAmB,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,WAAW,EAAE,UAAU,GAAG,SAAS,CAAC;IAE7C;;;;;OAKG;gBACS,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,mBAAmB;IA6F9D,QAAQ,IAAI,MAAM;IAIT,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAO3C,SAAS,IAAI,IAAI;CAClB"}
|
|
@@ -24,8 +24,8 @@ export class SettingsList extends UiComponent {
|
|
|
24
24
|
* @param host A reference to the host.
|
|
25
25
|
* @param options Which tools should be available on the list?
|
|
26
26
|
*/
|
|
27
|
-
constructor(
|
|
28
|
-
super(
|
|
27
|
+
constructor(parent, options) {
|
|
28
|
+
super(parent, { ...options });
|
|
29
29
|
const toolOptions = {
|
|
30
30
|
hasDisableAll: true,
|
|
31
31
|
hasEnableAll: true,
|
|
@@ -38,8 +38,7 @@ export class SettingsList extends UiComponent {
|
|
|
38
38
|
if (hasTools) {
|
|
39
39
|
const tools = $("<div/>").addClass(styles.listTools);
|
|
40
40
|
if (toolOptions.hasEnableAll) {
|
|
41
|
-
|
|
42
|
-
this.enableAllButton = new IconButton(this._host, Icons.CheckboxCheck, host.engine.i18n("ui.enable.all"), {
|
|
41
|
+
this.enableAllButton = new IconButton(parent, Icons.CheckboxCheck, parent.host.engine.i18n("ui.enable.all"), {
|
|
43
42
|
onClick: () => {
|
|
44
43
|
const event = new Event("enableAll", { cancelable: true });
|
|
45
44
|
this.dispatchEvent(event);
|
|
@@ -51,17 +50,14 @@ export class SettingsList extends UiComponent {
|
|
|
51
50
|
child.check(true);
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
this.refreshUi();
|
|
53
|
+
options?.onEnableAll?.call(this);
|
|
54
|
+
this.requestRefresh();
|
|
58
55
|
},
|
|
59
56
|
});
|
|
60
57
|
tools.append(this.enableAllButton.element);
|
|
61
58
|
}
|
|
62
59
|
if (toolOptions.hasDisableAll) {
|
|
63
|
-
|
|
64
|
-
this.disableAllButton = new IconButton(this._host, Icons.CheckboxUnCheck, host.engine.i18n("ui.disable.all"));
|
|
60
|
+
this.disableAllButton = new IconButton(parent, Icons.CheckboxUnCheck, parent.host.engine.i18n("ui.disable.all"));
|
|
65
61
|
this.disableAllButton.element.on("click", () => {
|
|
66
62
|
const event = new Event("disableAll", { cancelable: true });
|
|
67
63
|
this.dispatchEvent(event);
|
|
@@ -73,16 +69,14 @@ export class SettingsList extends UiComponent {
|
|
|
73
69
|
child.uncheck();
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
this.refreshUi();
|
|
72
|
+
options?.onDisableAll?.call(this);
|
|
73
|
+
this.requestRefresh();
|
|
80
74
|
});
|
|
81
75
|
tools.append(this.disableAllButton.element);
|
|
82
76
|
}
|
|
83
77
|
const onReset = toolOptions.onReset;
|
|
84
78
|
if (!isNil(onReset)) {
|
|
85
|
-
this.resetButton = new IconButton(
|
|
79
|
+
this.resetButton = new IconButton(parent, Icons.Reset, parent.host.engine.i18n("ui.reset"), {
|
|
86
80
|
onClick: () => {
|
|
87
81
|
onReset();
|
|
88
82
|
},
|
|
@@ -92,11 +86,16 @@ export class SettingsList extends UiComponent {
|
|
|
92
86
|
container.append(tools);
|
|
93
87
|
}
|
|
94
88
|
this.element = container;
|
|
95
|
-
|
|
89
|
+
}
|
|
90
|
+
toString() {
|
|
91
|
+
return `[${SettingsList.name}#${this.componentId}]`;
|
|
96
92
|
}
|
|
97
93
|
addChild(child) {
|
|
94
|
+
child.parent = this;
|
|
98
95
|
this.children.add(child);
|
|
99
96
|
this.list.append(child.element);
|
|
97
|
+
return this;
|
|
100
98
|
}
|
|
99
|
+
refreshUi() { }
|
|
101
100
|
}
|
|
102
101
|
//# sourceMappingURL=SettingsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsList.js","sourceRoot":"","sources":["../../../source/ui/components/SettingsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsList.js","sourceRoot":"","sources":["../../../source/ui/components/SettingsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AAWxE;;;;;;;GAOG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAElC,OAAO,CAAS;IAChB,IAAI,CAAS;IAEb,gBAAgB,CAAyB;IACzC,eAAe,CAAyB;IACxC,WAAW,CAAyB;IAE7C;;;;;OAKG;IACH,YAAY,MAAmB,EAAE,OAA6B;QAC5D,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAE9B,MAAM,WAAW,GAAG;YAClB,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,IAAI;YAClB,GAAG,OAAO;SACX,CAAC;QACF,MAAM,QAAQ,GACZ,WAAW,CAAC,aAAa,IAAI,WAAW,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAEvF,MAAM,SAAS,GAAG,CAAC,CAAC,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,CAAC;oBACZ,CAAC;iBACF,CACF,CAAC;gBACF,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACzC,CAAC;YAED,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,YAAY,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IACtD,CAAC;IAEQ,QAAQ,CAAC,KAAkB;QAClC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,KAAU,CAAC;CACrB"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import type { Setting } from "../../settings/Settings.js";
|
|
3
|
-
import { CollapsiblePanel, type
|
|
2
|
+
import { CollapsiblePanel, type CollapsiblePanelOptions } from "./CollapsiblePanel.js";
|
|
4
3
|
import type { LabelListItem } from "./LabelListItem.js";
|
|
5
4
|
import type { SettingListItem } from "./SettingListItem.js";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import type { UiComponent } from "./UiComponent.js";
|
|
6
|
+
export type SettingsPanelOptions<TListItem extends LabelListItem = LabelListItem> = ThisType<SettingsPanel> & CollapsiblePanelOptions & {
|
|
7
|
+
readonly settingItem?: TListItem;
|
|
8
8
|
};
|
|
9
9
|
export declare class SettingsPanel<TSetting extends Setting = Setting, TListItem extends LabelListItem = LabelListItem> extends CollapsiblePanel implements SettingListItem {
|
|
10
|
+
readonly options: SettingsPanelOptions<TListItem>;
|
|
10
11
|
readonly setting: TSetting;
|
|
11
12
|
readonly settingItem: TListItem;
|
|
12
13
|
get isExpanded(): boolean;
|
|
13
14
|
get elementLabel(): JQuery<HTMLElement>;
|
|
14
|
-
get head(): LabelListItem<import("./LabelListItem.js").LabelListItemOptions<import("./UiComponent.js").UiComponent<import("./UiComponent.js").UiComponentOptions<import("./UiComponent.js").UiComponentInterface>>>>;
|
|
15
15
|
get readOnly(): boolean;
|
|
16
16
|
set readOnly(_value: boolean);
|
|
17
|
-
check(): void
|
|
18
|
-
uncheck(): void
|
|
17
|
+
check(): Promise<void>;
|
|
18
|
+
uncheck(): Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Constructs a settings panel that is used to contain a major section of the UI.
|
|
21
21
|
*
|
|
@@ -24,6 +24,7 @@ export declare class SettingsPanel<TSetting extends Setting = Setting, TListItem
|
|
|
24
24
|
* @param setting - An setting for which this is the settings panel.
|
|
25
25
|
* @param options - Options for this panel.
|
|
26
26
|
*/
|
|
27
|
-
constructor(
|
|
27
|
+
constructor(parent: UiComponent, setting: TSetting, settingItem: TListItem, options?: SettingsPanelOptions<TListItem>);
|
|
28
|
+
toString(): string;
|
|
28
29
|
}
|
|
29
30
|
//# sourceMappingURL=SettingsPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,oBAAoB,CAAC,SAAS,SAAS,aAAa,GAAG,aAAa,IAC9E,QAAQ,CAAC,aAAa,CAAC,GACrB,uBAAuB,GAAG;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;CAClC,CAAC;AAEN,qBAAa,aAAa,CACtB,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,SAAS,SAAS,aAAa,GAAG,aAAa,CAEjD,SAAQ,gBACR,YAAW,eAAe;IAE1B,SAAiB,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;IAEhC,IAAI,UAAU,YAEb;IAGD,IAAI,YAAY,wBAEf;IAED,IAAI,QAAQ,IAGS,OAAO,CAD3B;IACD,IAAI,QAAQ,CAAC,MAAM,EAAE,OAAO,EAE3B;IAEK,KAAK;IAKL,OAAO;IAKb;;;;;;;OAOG;gBAED,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,SAAS,EACtB,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC;IAQ3C,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -7,10 +7,7 @@ export class SettingsPanel extends CollapsiblePanel {
|
|
|
7
7
|
}
|
|
8
8
|
// SettingListItem interface
|
|
9
9
|
get elementLabel() {
|
|
10
|
-
return this.
|
|
11
|
-
}
|
|
12
|
-
get head() {
|
|
13
|
-
return this._head;
|
|
10
|
+
return this.head.element;
|
|
14
11
|
}
|
|
15
12
|
get readOnly() {
|
|
16
13
|
return true;
|
|
@@ -18,13 +15,13 @@ export class SettingsPanel extends CollapsiblePanel {
|
|
|
18
15
|
set readOnly(_value) {
|
|
19
16
|
/* noop */
|
|
20
17
|
}
|
|
21
|
-
check() {
|
|
18
|
+
async check() {
|
|
22
19
|
this.setting.enabled = true;
|
|
23
|
-
this.
|
|
20
|
+
this.requestRefresh();
|
|
24
21
|
}
|
|
25
|
-
uncheck() {
|
|
22
|
+
async uncheck() {
|
|
26
23
|
this.setting.enabled = false;
|
|
27
|
-
this.
|
|
24
|
+
this.requestRefresh();
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
27
|
* Constructs a settings panel that is used to contain a major section of the UI.
|
|
@@ -34,10 +31,13 @@ export class SettingsPanel extends CollapsiblePanel {
|
|
|
34
31
|
* @param setting - An setting for which this is the settings panel.
|
|
35
32
|
* @param options - Options for this panel.
|
|
36
33
|
*/
|
|
37
|
-
constructor(
|
|
38
|
-
super(
|
|
34
|
+
constructor(parent, setting, settingItem, options) {
|
|
35
|
+
super(parent, settingItem, options);
|
|
39
36
|
this.settingItem = settingItem;
|
|
40
37
|
this.setting = setting;
|
|
41
38
|
}
|
|
39
|
+
toString() {
|
|
40
|
+
return `[${SettingsPanel.name}#${this.componentId}]: '${this.settingItem.elementLabel.text()}'`;
|
|
41
|
+
}
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=SettingsPanel.js.map
|