Skip to content

Commit

Permalink
$mol_check_list dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Oct 1, 2023
1 parent 3948bb6 commit 8ee9e9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion check/list/list.view.tree
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$mol_check_list $mol_view
dictionary_checked *
dictionary *
Option* $mol_check
checked? <=> option_checked*? false
label <= option_label* /
Expand Down
6 changes: 3 additions & 3 deletions check/list/list.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ namespace $.$$ {
return {}
}

override dictionary_checked(next?: Record<string, boolean>) {
override dictionary(next?: Record<string, boolean>) {
return next ?? {}
}

override option_checked(id: string, next?: boolean | null) {
const prev = this.dictionary_checked()
const prev = this.dictionary()
if (next === undefined) return prev[id] ?? null

const next_rec = { ... prev, [id]: next } as Record<string, boolean>
if (next === null) delete next_rec[id]

return this.dictionary_checked(next_rec)[id] ?? null
return this.dictionary(next_rec)[id] ?? null
}

@ $mol_mem
Expand Down
2 changes: 1 addition & 1 deletion form/draft/demo/demo.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $mol_form_draft_demo $mol_example
<= Hobbies_field $mol_form_field
name \Hobbies
Content <= Hobbies $mol_check_list
dictionary_checked? <=> dictionary_bool*hobbies?
dictionary? <=> dictionary_bool*hobbies?
options *
programming \Programming
bikinkg \Biking
Expand Down

0 comments on commit 8ee9e9f

Please sign in to comment.