@ekzo-dev/bootstrap-addons 5.3.9 → 5.3.11

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@ekzo-dev/bootstrap-addons",
3
3
  "description": "Aurelia Bootstrap additional component",
4
- "version": "5.3.9",
4
+ "version": "5.3.11",
5
5
  "homepage": "https://github.com/ekzo-dev/aurelia-components/tree/main/packages/bootstrap-addons",
6
6
  "repository": {
7
7
  "type": "git",
@@ -23,20 +23,20 @@ type DurationLabels = {
23
23
  export class BsDurationInput extends BaseField implements EventListenerObject {
24
24
  @bindable({ mode: BindingMode.twoWay })
25
25
  get value(): string {
26
- const { years, months, days, hours, minutes, seconds } = this.duration;
27
-
28
- return Temporal.Duration.from({
29
- // at least one field must be present for correct formatting
30
- years: years ?? 0,
31
- months,
32
- days,
33
- hours,
34
- minutes,
35
- seconds,
36
- }).toString();
26
+ const { duration } = this;
27
+
28
+ if (Object.values(duration).every((v) => v == null || v.toString() === '')) {
29
+ return '';
30
+ }
31
+
32
+ return Temporal.Duration.from(duration).toString();
37
33
  }
38
34
  set value(value: unknown) {
39
- this._parseDuration(value != null ? value.toString() : 'PT0S');
35
+ if (value == null || value === '') {
36
+ this.duration = {};
37
+ } else {
38
+ this._parseDuration(value.toString());
39
+ }
40
40
  }
41
41
 
42
42
  @bindable()