dazscript-framework 1.0.12 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dazscript-framework",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "author": "Freddy Diaz",
5
5
  "license": "MPL-2.0",
6
6
  "description": "",
@@ -85,6 +85,11 @@ export class ListViewBuilder<TItem, TData> implements IWidgetBuilder<DzListView>
85
85
  return this
86
86
  }
87
87
 
88
+ selectionMode(mode: number): this {
89
+ this.context.selectionMode = mode
90
+ return this
91
+ }
92
+
88
93
  expanded(onOff: boolean | Observable<boolean>): this {
89
94
  if (typeof onOff === 'boolean')
90
95
  this.context.expanded = new Observable(onOff)
@@ -137,6 +142,7 @@ class ListViewBuilderContext<TItem, TData> {
137
142
  sorting: number = 0
138
143
  sortAscending: boolean = true
139
144
  sortOnBuild: boolean = true
145
+ selectionMode: number | null = null
140
146
  selected: Observable<TData>
141
147
  filter: ListViewFilterOptions
142
148
  doubleClicked: Observable<TData>
@@ -212,6 +218,11 @@ class ListViewBindBuilder<TItem, TData> {
212
218
  return this
213
219
  }
214
220
 
221
+ selectionMode(mode: number): this {
222
+ this.context.selectionMode = mode
223
+ return this
224
+ }
225
+
215
226
  contextMenu(fn: (listView: DzListView, item: DzListViewItem, pos: Point) => DzPopupMenu): this {
216
227
  this.context.contextMenu = fn
217
228
  return this
@@ -407,6 +418,9 @@ const build = <TItem, TData>(context: ListViewBuilderContext<TItem, TData>): DzL
407
418
  })
408
419
 
409
420
  listView.setSorting(context.sorting, context.sortAscending)
421
+ if (context.selectionMode !== null) {
422
+ listView.selectionMode = context.selectionMode
423
+ }
410
424
  buildList(context.items?.value)
411
425
  context.items.connect((items) => {
412
426
  if (context.itemsChangeMode === 'rebuild')