dazscript-framework 1.0.25 → 1.0.26

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.25",
3
+ "version": "1.0.26",
4
4
  "author": "Freddy Diaz",
5
5
  "license": "MPL-2.0",
6
6
  "description": "",
@@ -10,6 +10,7 @@ export default class GroupBoxBuilder implements IWidgetBuilder<DzGroupBox> {
10
10
  private _style: { flat?: boolean }
11
11
  private _visible: Observable<boolean>
12
12
  private _enabled: Observable<boolean>
13
+ private _checked: Observable<boolean>
13
14
  private _columns: number = 1
14
15
  private _height: number | null = null
15
16
  private _minHeight: number | null = null
@@ -50,6 +51,13 @@ export default class GroupBoxBuilder implements IWidgetBuilder<DzGroupBox> {
50
51
  return this
51
52
  }
52
53
 
54
+ checkable(value: boolean | Observable<boolean> = true): this {
55
+ this._checked = typeof value === 'boolean'
56
+ ? new Observable(value)
57
+ : value
58
+ return this
59
+ }
60
+
53
61
  visible(value: boolean | Observable<boolean>): this {
54
62
  this._visible = typeof value === 'boolean'
55
63
  ? new Observable(value)
@@ -90,6 +98,10 @@ export default class GroupBoxBuilder implements IWidgetBuilder<DzGroupBox> {
90
98
  groupBox.title = this._title?.value
91
99
  groupBox.flat = this._style?.flat
92
100
  groupBox.columns = this._columns
101
+ if (this._checked) {
102
+ groupBox.checkable = true
103
+ groupBox.checked = this._checked.value
104
+ }
93
105
  if (this._height !== null) groupBox.height = this._height
94
106
  if (this._minHeight !== null) groupBox.minHeight = this._minHeight
95
107
  if (this._maxHeight !== null) groupBox.maxHeight = this._maxHeight
@@ -98,6 +110,15 @@ export default class GroupBoxBuilder implements IWidgetBuilder<DzGroupBox> {
98
110
  groupBox.title = text
99
111
  })
100
112
 
113
+ if (this._checked) {
114
+ this._checked.connect((checked) => {
115
+ groupBox.checked = checked
116
+ })
117
+ groupBox.toggled.scriptConnect((checked) => {
118
+ this._checked.value = checked
119
+ })
120
+ }
121
+
101
122
  new LayoutBuilder(this.context)
102
123
  .parent(groupBox)
103
124
  .direction(this._direction)