@db-ux/ngx-core-components 4.3.0 → 4.3.1

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,5 +1,11 @@
1
1
  # @db-ux/ngx-core-components
2
2
 
3
+ ## 4.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(angular): issue with form-components not applying value changes because of [attr.value] instead of native [value] binding - [see commit 61ab4a3](https://github.com/db-ux-design-system/core-web/commit/61ab4a3e9a781459b829c74cf23624a23edd9e3f)
8
+
3
9
  ## 4.3.0
4
10
 
5
11
  ### Minor Changes
@@ -1393,7 +1393,7 @@ class DBCheckbox {
1393
1393
  [attr.name]="name()"
1394
1394
  [checked]="getBoolean(checked(), 'checked')"
1395
1395
  [disabled]="getBoolean(disabled(), 'disabled')"
1396
- [attr.value]="value()"
1396
+ [value]="value()"
1397
1397
  [required]="getBoolean(required(), 'required')"
1398
1398
  (change)="handleChange($event)"
1399
1399
  (blur)="handleBlur($event)"
@@ -1454,7 +1454,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
1454
1454
  [attr.name]="name()"
1455
1455
  [checked]="getBoolean(checked(), 'checked')"
1456
1456
  [disabled]="getBoolean(disabled(), 'disabled')"
1457
- [attr.value]="value()"
1457
+ [value]="value()"
1458
1458
  [required]="getBoolean(required(), 'required')"
1459
1459
  (change)="handleChange($event)"
1460
1460
  (blur)="handleBlur($event)"
@@ -2350,7 +2350,7 @@ class DBInput {
2350
2350
  this._invalidMessage = signal(undefined, ...(ngDevMode ? [{ debugName: "_invalidMessage" }] : []));
2351
2351
  this._dataListId = signal(undefined, ...(ngDevMode ? [{ debugName: "_dataListId" }] : []));
2352
2352
  this._descByIds = signal(undefined, ...(ngDevMode ? [{ debugName: "_descByIds" }] : []));
2353
- this._value = signal(undefined, ...(ngDevMode ? [{ debugName: "_value" }] : []));
2353
+ this._value = signal("", ...(ngDevMode ? [{ debugName: "_value" }] : []));
2354
2354
  this._voiceOverFallback = signal("", ...(ngDevMode ? [{ debugName: "_voiceOverFallback" }] : []));
2355
2355
  this.abortController = signal(undefined, ...(ngDevMode ? [{ debugName: "abortController" }] : []));
2356
2356
  if (typeof window !== "undefined") {
@@ -2387,7 +2387,9 @@ class DBInput {
2387
2387
  // --- Mitosis: Workaround to make sure the effect() is triggered ---
2388
2388
  this.value();
2389
2389
  // ---
2390
- this._value.set(this.value());
2390
+ if (this.value() !== undefined) {
2391
+ this._value.set(this.value());
2392
+ }
2391
2393
  }, {
2392
2394
  // Enable writing to signals inside effects
2393
2395
  });
@@ -2395,7 +2397,10 @@ class DBInput {
2395
2397
  // --- Mitosis: Workaround to make sure the effect() is triggered ---
2396
2398
  this._ref();
2397
2399
  // ---
2398
- if (this._ref()?.nativeElement) {
2400
+ // If angular uses ngModel value and _value are null
2401
+ // then the value will be set afterward and the _ref will be refreshed
2402
+ const addResetListener = !(this.value() === null && this._value() === null);
2403
+ if (this._ref()?.nativeElement && addResetListener) {
2399
2404
  const defaultValue = undefined;
2400
2405
  let controller = this.abortController();
2401
2406
  if (!controller) {
@@ -2513,7 +2518,7 @@ class DBInput {
2513
2518
  [disabled]="getBoolean(disabled(), 'disabled')"
2514
2519
  [required]="getBoolean(required(), 'required')"
2515
2520
  [attr.step]="getStep(step())"
2516
- [attr.value]="value() ?? _value()"
2521
+ [value]="value() ?? _value()"
2517
2522
  [attr.maxLength]="getNumber(maxLength(), maxlength())"
2518
2523
  [attr.minLength]="getNumber(minLength(), minlength())"
2519
2524
  [attr.max]="getInputValue(max(), type())"
@@ -2538,7 +2543,7 @@ class DBInput {
2538
2543
  <datalist [attr.id]="_dataListId()">
2539
2544
  @for (option of getDataList();track trackByOption0(i, option);let i =
2540
2545
  $index) {
2541
- <option [attr.value]="option.value">{{option.label}}</option>
2546
+ <option [value]="option.value">{{option.label}}</option>
2542
2547
  }
2543
2548
  </datalist>
2544
2549
  }
@@ -2601,7 +2606,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
2601
2606
  [disabled]="getBoolean(disabled(), 'disabled')"
2602
2607
  [required]="getBoolean(required(), 'required')"
2603
2608
  [attr.step]="getStep(step())"
2604
- [attr.value]="value() ?? _value()"
2609
+ [value]="value() ?? _value()"
2605
2610
  [attr.maxLength]="getNumber(maxLength(), maxlength())"
2606
2611
  [attr.minLength]="getNumber(minLength(), minlength())"
2607
2612
  [attr.max]="getInputValue(max(), type())"
@@ -2626,7 +2631,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
2626
2631
  <datalist [attr.id]="_dataListId()">
2627
2632
  @for (option of getDataList();track trackByOption0(i, option);let i =
2628
2633
  $index) {
2629
- <option [attr.value]="option.value">{{option.label}}</option>
2634
+ <option [value]="option.value">{{option.label}}</option>
2630
2635
  }
2631
2636
  </datalist>
2632
2637
  }
@@ -6236,7 +6241,7 @@ class DBRadio {
6236
6241
  [attr.name]="name()"
6237
6242
  [checked]="getBoolean(checked(), 'checked')"
6238
6243
  [disabled]="getBoolean(disabled(), 'disabled')"
6239
- [attr.value]="value()"
6244
+ [value]="value()"
6240
6245
  [required]="getBoolean(required(), 'required')"
6241
6246
  (input)="handleInput($event)"
6242
6247
  (change)="handleChange($event)"
@@ -6269,7 +6274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
6269
6274
  [attr.name]="name()"
6270
6275
  [checked]="getBoolean(checked(), 'checked')"
6271
6276
  [disabled]="getBoolean(disabled(), 'disabled')"
6272
- [attr.value]="value()"
6277
+ [value]="value()"
6273
6278
  [required]="getBoolean(required(), 'required')"
6274
6279
  (input)="handleInput($event)"
6275
6280
  (change)="handleChange($event)"
@@ -6533,7 +6538,10 @@ class DBSelect {
6533
6538
  // --- Mitosis: Workaround to make sure the effect() is triggered ---
6534
6539
  this._ref();
6535
6540
  // ---
6536
- if (this._ref()?.nativeElement) {
6541
+ // If angular uses ngModel value and _value are null
6542
+ // then the value will be set afterward and the _ref will be refreshed
6543
+ const addResetListener = !(this.value() === null && this._value() === null);
6544
+ if (this._ref()?.nativeElement && addResetListener) {
6537
6545
  const defaultValue = undefined;
6538
6546
  let controller = this.abortController();
6539
6547
  if (!controller) {
@@ -7140,7 +7148,7 @@ class DBSwitch {
7140
7148
  [attr.id]="_id()"
7141
7149
  #_ref
7142
7150
  [checked]="getBoolean(checked(), 'checked')"
7143
- [attr.value]="value()"
7151
+ [value]="value()"
7144
7152
  [disabled]="getBoolean(disabled(), 'disabled')"
7145
7153
  [attr.aria-invalid]="validation() === 'invalid' ? 'true' : undefined"
7146
7154
  [attr.aria-describedby]="_descByIds()"
@@ -7209,7 +7217,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
7209
7217
  [attr.id]="_id()"
7210
7218
  #_ref
7211
7219
  [checked]="getBoolean(checked(), 'checked')"
7212
- [attr.value]="value()"
7220
+ [value]="value()"
7213
7221
  [disabled]="getBoolean(disabled(), 'disabled')"
7214
7222
  [attr.aria-invalid]="validation() === 'invalid' ? 'true' : undefined"
7215
7223
  [attr.aria-describedby]="_descByIds()"
@@ -8103,7 +8111,9 @@ class DBTextarea {
8103
8111
  // --- Mitosis: Workaround to make sure the effect() is triggered ---
8104
8112
  this.value();
8105
8113
  // ---
8106
- this._value.set(this.value());
8114
+ if (this.value() !== undefined) {
8115
+ this._value.set(this.value());
8116
+ }
8107
8117
  }, {
8108
8118
  // Enable writing to signals inside effects
8109
8119
  });
@@ -8111,7 +8121,10 @@ class DBTextarea {
8111
8121
  // --- Mitosis: Workaround to make sure the effect() is triggered ---
8112
8122
  this._ref();
8113
8123
  // ---
8114
- if (this._ref()?.nativeElement) {
8124
+ // If angular uses ngModel value and _value are null
8125
+ // then the value will be set afterward and the _ref will be refreshed
8126
+ const addResetListener = !(this.value() === null && this._value() === null);
8127
+ if (this._ref()?.nativeElement && addResetListener) {
8115
8128
  const defaultValue = undefined;
8116
8129
  let controller = this.abortController();
8117
8130
  if (!controller) {
@@ -8227,7 +8240,7 @@ class DBTextarea {
8227
8240
  (change)="handleChange($event)"
8228
8241
  (blur)="handleBlur($event)"
8229
8242
  (focus)="handleFocus($event)"
8230
- [attr.value]="value() ?? _value()"
8243
+ [value]="value() ?? _value()"
8231
8244
  [attr.aria-describedby]="ariaDescribedBy() ?? _descByIds()"
8232
8245
  [attr.placeholder]="placeholder() ?? DEFAULT_PLACEHOLDER"
8233
8246
  [attr.rows]="getNumber(rows(), DEFAULT_ROWS)"
@@ -8296,7 +8309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8296
8309
  (change)="handleChange($event)"
8297
8310
  (blur)="handleBlur($event)"
8298
8311
  (focus)="handleFocus($event)"
8299
- [attr.value]="value() ?? _value()"
8312
+ [value]="value() ?? _value()"
8300
8313
  [attr.aria-describedby]="ariaDescribedBy() ?? _descByIds()"
8301
8314
  [attr.placeholder]="placeholder() ?? DEFAULT_PLACEHOLDER"
8302
8315
  [attr.rows]="getNumber(rows(), DEFAULT_ROWS)"