Sha256: 007b029b71619219e325c5380c67400e0e5aa573a1f1f086a02447769c7ec68d
Contents?: true
Size: 850 Bytes
Versions: 21
Compression:
Stored size: 850 Bytes
Contents
export default function paramsEditorFieldComponent({ name, value }) { return { name, value, init() { this.$watch("value", () => this.update()); }, update() { if (this.validate()) { const searchParams = new URLSearchParams(window.location.search); searchParams.set(this.name, this.value); const path = location.href.replace(location.search, ""); this.navigateTo(`${path}?${searchParams.toString()}`); } }, validate() { return this.$root.reportValidity ? this.$root.reportValidity() : true; }, get isNarrowLayout() { return this.narrow || false; }, bindings: { input: { [":id"]: "`param-${name}`", ["x-ref"]: "input", ["x-model.debounce.200"]: "value", ["@keydown.stop"]: true, }, }, }; }
Version data entries
21 entries across 21 versions & 1 rubygems