@ascentgl/ads-ui 0.0.144 → 0.0.146

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.
@@ -2696,6 +2696,19 @@ class AdsCheckboxComponent extends AbstractBaseComponent {
2696
2696
  this.width = 'fit-content';
2697
2697
  }
2698
2698
  /** @ignore */
2699
+ ngOnInit() {
2700
+ this.valueChangeSub = this.valueControl.valueChanges.subscribe(() => {
2701
+ if (!this.valueControl.dirty) {
2702
+ this.valueControl.markAsDirty();
2703
+ }
2704
+ if (!this.valueControl.touched) {
2705
+ this.valueControl.markAsTouched();
2706
+ }
2707
+ // Only want this to happen once
2708
+ this.valueChangeSub?.unsubscribe();
2709
+ });
2710
+ }
2711
+ /** @ignore */
2699
2712
  ngOnChanges(changes) {
2700
2713
  if (changes.required) {
2701
2714
  if (this.required) {
@@ -4897,6 +4910,16 @@ class AdsDatetimepickerComponent extends AbstractInputComponent {
4897
4910
  }
4898
4911
  return value;
4899
4912
  }
4913
+ syncState(status) {
4914
+ if (status === 'INVALID') {
4915
+ this.displayControl.setErrors(this.valueControl.errors);
4916
+ this.touchControls();
4917
+ }
4918
+ else {
4919
+ this.displayControl.setErrors([]);
4920
+ }
4921
+ super.syncState();
4922
+ }
4900
4923
  /** @ignore */
4901
4924
  setupSubscriptions() {
4902
4925
  /**
@@ -4904,7 +4927,7 @@ class AdsDatetimepickerComponent extends AbstractInputComponent {
4904
4927
  *sync display control statuses with value control status for proper error display
4905
4928
  * make sure "displayControl" disabled state and value are synchronized with "control" disabled state and value
4906
4929
  */
4907
- this.subscriptions.push(this.valueControl.statusChanges.subscribe(() => this.syncState()));
4930
+ this.subscriptions.push(this.valueControl.statusChanges.subscribe((status) => this.syncState(status)));
4908
4931
  this.subscriptions.push(this.valueControl.valueChanges.subscribe(() => this.syncDisplayedValue()));
4909
4932
  /**
4910
4933
  * NOTE: registering display value change is needed to know when to focus time part of datetime if showTimePicker is false