mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 20:44:08 +00:00
feat: add currency management for families with enabled currencies (#1419)
* feat: add currency management for families with enabled currencies * feat: update currency selection logic and improve accessibility * feat: update currency preferences to use group moniker in titles --------- Signed-off-by: Ang Wei Feng (Ted) <hello@tedawf.com> Signed-off-by: Juan José Mata <juanjo.mata@gmail.com> Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
committed by
GitHub
parent
1aa3c8f007
commit
60929cdee0
@@ -0,0 +1,31 @@
|
||||
import { Controller } from "@hotwired/stimulus";
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ["dialog", "checkbox"];
|
||||
static values = {
|
||||
baseCurrency: String,
|
||||
};
|
||||
|
||||
open() {
|
||||
this.dialogTarget.showModal();
|
||||
}
|
||||
|
||||
selectAll() {
|
||||
this.checkboxTargets.forEach((checkbox) => {
|
||||
checkbox.checked = true;
|
||||
});
|
||||
}
|
||||
|
||||
selectBaseOnly() {
|
||||
this.checkboxTargets.forEach((checkbox) => {
|
||||
checkbox.checked = checkbox.value === this.baseCurrencyValue;
|
||||
});
|
||||
}
|
||||
|
||||
handleSubmitEnd(event) {
|
||||
if (!event.detail.success) return;
|
||||
if (!this.dialogTarget.open) return;
|
||||
|
||||
this.dialogTarget.close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user