@blueprint-ts/core 4.0.0-beta.2 → 4.0.0-beta.4
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## v4.0.0-beta.4 - 2026-02-26 (beta)
|
|
2
|
+
|
|
3
|
+
# [4.0.0-beta.4](/compare/v4.0.0-beta.3...v4.0.0-beta.4) (2026-02-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Use WritableComputedRef for field models 3cdb7dc
|
|
9
|
+
## v4.0.0-beta.3 - 2026-02-26 (beta)
|
|
10
|
+
|
|
11
|
+
# [4.0.0-beta.3](/compare/v4.0.0-beta.2...v4.0.0-beta.3) (2026-02-26)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* Make PropertyAwareArray nominal to avoid array type confusion b68b6fe
|
|
1
17
|
## v4.0.0-beta.2 - 2026-02-26 (beta)
|
|
2
18
|
|
|
3
19
|
# [4.0.0-beta.2](/compare/v4.0.0-beta.1...v4.0.0-beta.2) (2026-02-26)
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive, computed, toRaw, type ComputedRef, watch } from 'vue'
|
|
1
|
+
import { reactive, computed, toRaw, type ComputedRef, type WritableComputedRef, watch } from 'vue'
|
|
2
2
|
import { camelCase, upperFirst, cloneDeep, isEqual } from 'lodash-es'
|
|
3
3
|
import isEqualWith from 'lodash-es/isEqualWith'
|
|
4
4
|
import { type PersistedForm } from './types/PersistedForm'
|
|
@@ -21,7 +21,7 @@ type FieldErrors = ErrorMessages | ErrorObject | ErrorArray
|
|
|
21
21
|
type ErrorBag = Record<string, FieldErrors>
|
|
22
22
|
|
|
23
23
|
type FieldProperty<T> = {
|
|
24
|
-
model:
|
|
24
|
+
model: WritableComputedRef<T>
|
|
25
25
|
errors: ErrorMessages
|
|
26
26
|
dirty: boolean
|
|
27
27
|
touched: boolean
|
|
@@ -164,7 +164,7 @@ export abstract class BaseForm<RequestBody extends object, FormBody extends obje
|
|
|
164
164
|
private readonly dirty: DirtyMap<FormBody>
|
|
165
165
|
private readonly touched: Record<keyof FormBody, boolean>
|
|
166
166
|
private readonly original: FormBody
|
|
167
|
-
private readonly _model: { [K in keyof FormBody]:
|
|
167
|
+
private readonly _model: { [K in keyof FormBody]: WritableComputedRef<FormBody[K]> }
|
|
168
168
|
private _errors: ErrorBag = reactive<ErrorBag>({})
|
|
169
169
|
private _hasErrors: ComputedRef<boolean>
|
|
170
170
|
protected append: string[] = []
|
|
@@ -375,7 +375,7 @@ export abstract class BaseForm<RequestBody extends object, FormBody extends obje
|
|
|
375
375
|
this.buildFieldDependencies()
|
|
376
376
|
|
|
377
377
|
this.state = reactive(initialData) as FormBody
|
|
378
|
-
this._model = {} as { [K in keyof FormBody]:
|
|
378
|
+
this._model = {} as { [K in keyof FormBody]: WritableComputedRef<FormBody[K]> }
|
|
379
379
|
|
|
380
380
|
for (const key in this.state) {
|
|
381
381
|
const value = this.state[key]
|
|
@@ -23,12 +23,17 @@ export type PropertyAware<T> = {
|
|
|
23
23
|
* computed getters/setters, error tracking, and dirty flags.
|
|
24
24
|
*/
|
|
25
25
|
export class PropertyAwareArray<T = unknown> extends Array<T> {
|
|
26
|
+
// Private brand to prevent plain arrays from being assignable to PropertyAwareArray.
|
|
27
|
+
// This keeps conditional types from treating normal arrays as property-aware.
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-private-class-members
|
|
29
|
+
private readonly __propertyAwareArrayBrand!: void
|
|
26
30
|
/**
|
|
27
31
|
* Creates a new PropertyAwareArray instance
|
|
28
32
|
*/
|
|
29
33
|
public constructor(items: T[] = []) {
|
|
30
34
|
// Call Array constructor with array length
|
|
31
35
|
super()
|
|
36
|
+
void this.__propertyAwareArrayBrand
|
|
32
37
|
|
|
33
38
|
// Add items to the array
|
|
34
39
|
if (items && items.length) {
|