@spartan-ng/brain 1.10.0-beta.4 → 1.10.0-beta.6
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/fesm2022/spartan-ng-brain-autocomplete.mjs +11 -5
- package/fesm2022/spartan-ng-brain-autocomplete.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-checkbox.mjs +2 -2
- package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-combobox.mjs +18 -14
- package/fesm2022/spartan-ng-brain-combobox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-core.mjs +124 -67
- package/fesm2022/spartan-ng-brain-core.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-date-picker.mjs +14 -2
- package/fesm2022/spartan-ng-brain-date-picker.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-dialog.mjs +1 -1
- package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-forms.mjs +26 -2
- package/fesm2022/spartan-ng-brain-forms.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-input.mjs +13 -5
- package/fesm2022/spartan-ng-brain-input.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-navigation-menu.mjs +3 -0
- package/fesm2022/spartan-ng-brain-navigation-menu.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-overlay.mjs +1 -1
- package/fesm2022/spartan-ng-brain-overlay.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-radio-group.mjs +12 -4
- package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-select.mjs +4 -2
- package/fesm2022/spartan-ng-brain-select.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-slider.mjs +5 -5
- package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-sonner.mjs +30 -10
- package/fesm2022/spartan-ng-brain-sonner.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-switch.mjs +2 -2
- package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-textarea.mjs +13 -5
- package/fesm2022/spartan-ng-brain-textarea.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-tooltip.mjs +2 -0
- package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/types/spartan-ng-brain-autocomplete.d.ts +4 -2
- package/types/spartan-ng-brain-combobox.d.ts +7 -5
- package/types/spartan-ng-brain-date-picker.d.ts +12 -1
- package/types/spartan-ng-brain-forms.d.ts +3 -0
- package/types/spartan-ng-brain-input.d.ts +9 -2
- package/types/spartan-ng-brain-radio-group.d.ts +9 -2
- package/types/spartan-ng-brain-select.d.ts +2 -2
- package/types/spartan-ng-brain-slider.d.ts +1 -1
- package/types/spartan-ng-brain-textarea.d.ts +9 -2
|
@@ -362,8 +362,9 @@ class BrnComboboxChipInput {
|
|
|
362
362
|
/** Manual override for aria-invalid. When not set, auto-detects from the parent combobox error state. */
|
|
363
363
|
ariaInvalidInput = input(undefined, { ...(ngDevMode ? { debugName: "ariaInvalidInput" } : /* istanbul ignore next */ {}), transform: (v) => (v === '' || v === undefined ? undefined : booleanAttribute(v)),
|
|
364
364
|
alias: 'aria-invalid' });
|
|
365
|
-
/** Computed aria-invalid: uses manual override if provided, otherwise
|
|
366
|
-
_ariaInvalid = computed(() => this.ariaInvalidInput() ?? this.
|
|
365
|
+
/** Computed aria-invalid: uses the manual override if provided, otherwise the error state matcher result. */
|
|
366
|
+
_ariaInvalid = computed(() => this.ariaInvalidInput() ?? !!this._spartanInvalid(), ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
367
|
+
_invalid = computed(() => this._combobox.controlState?.()?.invalid, ...(ngDevMode ? [{ debugName: "_invalid" }] : /* istanbul ignore next */ []));
|
|
367
368
|
_dirty = computed(() => this._combobox.controlState?.()?.dirty, ...(ngDevMode ? [{ debugName: "_dirty" }] : /* istanbul ignore next */ []));
|
|
368
369
|
_touched = computed(() => this._combobox.controlState?.()?.touched, ...(ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []));
|
|
369
370
|
_spartanInvalid = computed(() => this._combobox.controlState?.()?.spartanInvalid, ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
|
|
@@ -408,7 +409,8 @@ class BrnComboboxChipInput {
|
|
|
408
409
|
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
409
410
|
this._combobox.open();
|
|
410
411
|
}
|
|
411
|
-
if (event.key === 'Escape') {
|
|
412
|
+
if (event.key === 'Escape' && this._combobox.hasValue()) {
|
|
413
|
+
event.preventDefault();
|
|
412
414
|
this._combobox.resetValue();
|
|
413
415
|
}
|
|
414
416
|
}
|
|
@@ -418,7 +420,7 @@ class BrnComboboxChipInput {
|
|
|
418
420
|
this._combobox.keyManager.onKeydown(event);
|
|
419
421
|
}
|
|
420
422
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnComboboxChipInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
421
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnComboboxChipInput, isStandalone: true, selector: "input[brnComboboxChipInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidInput: { classPropertyName: "ariaInvalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "text", "role": "combobox", "autocomplete": "off", "autocorrect": "off", "autocapitalize": "none", "spellcheck": "false", "aria-autocomplete": "list", "aria-haspopup": "listbox" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput($event)" }, properties: { "id": "id()", "attr.aria-expanded": "_isExpanded()", "attr.aria-controls": "_isExpanded() ? _comboboxListId() : null", "attr.aria-activedescendant": "_isExpanded() ? _activeDescendant() : null", "attr.aria-invalid": "_ariaInvalid() ? \"true\" : null", "attr.data-invalid": "
|
|
423
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnComboboxChipInput, isStandalone: true, selector: "input[brnComboboxChipInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidInput: { classPropertyName: "ariaInvalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "text", "role": "combobox", "autocomplete": "off", "autocorrect": "off", "autocapitalize": "none", "spellcheck": "false", "aria-autocomplete": "list", "aria-haspopup": "listbox" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput($event)" }, properties: { "id": "id()", "attr.aria-expanded": "_isExpanded()", "attr.aria-controls": "_isExpanded() ? _comboboxListId() : null", "attr.aria-activedescendant": "_isExpanded() ? _activeDescendant() : null", "attr.aria-invalid": "_ariaInvalid() ? \"true\" : null", "attr.data-invalid": "_invalid() ? \"true\" : null", "attr.data-matches-spartan-invalid": "_spartanInvalid() ? \"true\" : null", "attr.data-dirty": "_touched() ? \"true\" : null", "attr.data-touched": "_touched() ? \"true\" : null", "attr.disabled": "_disabled() ? \"\" : null", "attr.data-disabled": "_disabled() ? \"\" : null" } }, exportAs: ["brnComboboxChipInput"], ngImport: i0 });
|
|
422
424
|
}
|
|
423
425
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnComboboxChipInput, decorators: [{
|
|
424
426
|
type: Directive,
|
|
@@ -439,7 +441,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
439
441
|
'[attr.aria-controls]': '_isExpanded() ? _comboboxListId() : null',
|
|
440
442
|
'[attr.aria-activedescendant]': '_isExpanded() ? _activeDescendant() : null',
|
|
441
443
|
'[attr.aria-invalid]': '_ariaInvalid() ? "true" : null',
|
|
442
|
-
'[attr.data-invalid]': '
|
|
444
|
+
'[attr.data-invalid]': '_invalid() ? "true" : null',
|
|
443
445
|
'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? "true" : null',
|
|
444
446
|
'[attr.data-dirty]': '_touched() ? "true" : null',
|
|
445
447
|
'[attr.data-touched]': '_touched() ? "true" : null',
|
|
@@ -615,8 +617,9 @@ class BrnComboboxInput {
|
|
|
615
617
|
/** Whether the combobox panel is expanded */
|
|
616
618
|
_isExpanded = this._combobox.isExpanded;
|
|
617
619
|
_activeDescendant = signal(undefined, ...(ngDevMode ? [{ debugName: "_activeDescendant" }] : /* istanbul ignore next */ []));
|
|
618
|
-
/** Computed aria-invalid: uses manual override if provided, otherwise
|
|
619
|
-
_ariaInvalid = computed(() => this.ariaInvalidInput() ?? this.
|
|
620
|
+
/** Computed aria-invalid: uses the manual override if provided, otherwise the error state matcher result. */
|
|
621
|
+
_ariaInvalid = computed(() => this.ariaInvalidInput() ?? !!this._spartanInvalid(), ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
622
|
+
_invalid = computed(() => this._combobox.controlState?.()?.invalid, ...(ngDevMode ? [{ debugName: "_invalid" }] : /* istanbul ignore next */ []));
|
|
620
623
|
_dirty = computed(() => this._combobox.controlState?.()?.dirty, ...(ngDevMode ? [{ debugName: "_dirty" }] : /* istanbul ignore next */ []));
|
|
621
624
|
_touched = computed(() => this._combobox.controlState?.()?.touched, ...(ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []));
|
|
622
625
|
_spartanInvalid = computed(() => this.forceInvalid() || this._combobox.controlState?.()?.spartanInvalid, ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
|
|
@@ -679,14 +682,15 @@ class BrnComboboxInput {
|
|
|
679
682
|
if (event.key === 'Enter' || event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
680
683
|
this._combobox.open();
|
|
681
684
|
}
|
|
682
|
-
if (event.key === 'Escape') {
|
|
685
|
+
if (event.key === 'Escape' && this._combobox.hasValue()) {
|
|
686
|
+
event.preventDefault();
|
|
683
687
|
this._combobox.resetValue();
|
|
684
688
|
}
|
|
685
689
|
}
|
|
686
690
|
this._combobox.keyManager.onKeydown(event);
|
|
687
691
|
}
|
|
688
692
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnComboboxInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
689
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnComboboxInput, isStandalone: true, selector: "input[brnComboboxInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidInput: { classPropertyName: "ariaInvalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "text", "role": "combobox", "autocomplete": "off", "autocorrect": "off", "autocapitalize": "none", "spellcheck": "false", "aria-autocomplete": "list", "aria-haspopup": "listbox" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput($event)" }, properties: { "id": "id()", "attr.aria-expanded": "_isExpanded()", "attr.aria-controls": "_isExpanded() ? _comboboxListId() : null", "attr.aria-activedescendant": "_isExpanded() ? _activeDescendant() : null", "attr.aria-invalid": "_isCombobox() && _ariaInvalid() ? \"true\": null", "attr.data-invalid": "_isCombobox() &&
|
|
693
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnComboboxInput, isStandalone: true, selector: "input[brnComboboxInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidInput: { classPropertyName: "ariaInvalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "text", "role": "combobox", "autocomplete": "off", "autocorrect": "off", "autocapitalize": "none", "spellcheck": "false", "aria-autocomplete": "list", "aria-haspopup": "listbox" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput($event)" }, properties: { "id": "id()", "attr.aria-expanded": "_isExpanded()", "attr.aria-controls": "_isExpanded() ? _comboboxListId() : null", "attr.aria-activedescendant": "_isExpanded() ? _activeDescendant() : null", "attr.aria-invalid": "_isCombobox() && _ariaInvalid() ? \"true\": null", "attr.data-invalid": "_isCombobox() && _invalid() ? \"true\": null", "attr.data-matches-spartan-invalid": "_isCombobox() && _spartanInvalid() ? \"true\": null", "attr.data-touched": "_isCombobox() && _touched() ? \"true\": null", "attr.data-dirty": "_isCombobox() && _dirty() ? \"true\": null", "attr.disabled": "disabled() ? \"\" : null" } }, exportAs: ["brnComboboxInput"], ngImport: i0 });
|
|
690
694
|
}
|
|
691
695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnComboboxInput, decorators: [{
|
|
692
696
|
type: Directive,
|
|
@@ -707,7 +711,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
707
711
|
'[attr.aria-controls]': '_isExpanded() ? _comboboxListId() : null',
|
|
708
712
|
'[attr.aria-activedescendant]': '_isExpanded() ? _activeDescendant() : null',
|
|
709
713
|
'[attr.aria-invalid]': '_isCombobox() && _ariaInvalid() ? "true": null',
|
|
710
|
-
'[attr.data-invalid]': '_isCombobox() &&
|
|
714
|
+
'[attr.data-invalid]': '_isCombobox() && _invalid() ? "true": null',
|
|
711
715
|
'[attr.data-matches-spartan-invalid]': '_isCombobox() && _spartanInvalid() ? "true": null',
|
|
712
716
|
'[attr.data-touched]': '_isCombobox() && _touched() ? "true": null',
|
|
713
717
|
'[attr.data-dirty]': '_isCombobox() && _dirty() ? "true": null',
|
|
@@ -1151,7 +1155,7 @@ class BrnComboboxTrigger {
|
|
|
1151
1155
|
_contentId = this._combobox.contentId;
|
|
1152
1156
|
_disabled = this._combobox.disabledState;
|
|
1153
1157
|
_isPlaceholder = computed(() => !this._combobox.hasValue(), ...(ngDevMode ? [{ debugName: "_isPlaceholder" }] : /* istanbul ignore next */ []));
|
|
1154
|
-
|
|
1158
|
+
_invalid = computed(() => this._combobox.controlState?.()?.invalid, ...(ngDevMode ? [{ debugName: "_invalid" }] : /* istanbul ignore next */ []));
|
|
1155
1159
|
_dirty = computed(() => this._combobox.controlState?.()?.dirty, ...(ngDevMode ? [{ debugName: "_dirty" }] : /* istanbul ignore next */ []));
|
|
1156
1160
|
_touched = computed(() => this._combobox.controlState?.()?.touched, ...(ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []));
|
|
1157
1161
|
_spartanInvalid = computed(() => this.forceInvalid() || this._combobox.controlState?.()?.spartanInvalid, ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
|
|
@@ -1169,7 +1173,7 @@ class BrnComboboxTrigger {
|
|
|
1169
1173
|
}
|
|
1170
1174
|
}
|
|
1171
1175
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnComboboxTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1172
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnComboboxTrigger, isStandalone: true, selector: "button[brnComboboxTrigger]", inputs: { forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "combobox", "aria-haspopup": "dialog" }, listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.aria-controls": "_isExpanded() ? _contentId() : null", "attr.aria-expanded": "_isExpanded()", "attr.aria-disabled": "_disabled() || null", "attr.disabled": "_disabled() ? \"\" : null", "attr.data-disabled": "_disabled() || null", "attr.data-placeholder": "_isPlaceholder() ? \"\" : null", "attr.aria-invalid": "
|
|
1176
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnComboboxTrigger, isStandalone: true, selector: "button[brnComboboxTrigger]", inputs: { forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "combobox", "aria-haspopup": "dialog" }, listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.aria-controls": "_isExpanded() ? _contentId() : null", "attr.aria-expanded": "_isExpanded()", "attr.aria-disabled": "_disabled() || null", "attr.disabled": "_disabled() ? \"\" : null", "attr.data-disabled": "_disabled() || null", "attr.data-placeholder": "_isPlaceholder() ? \"\" : null", "attr.aria-invalid": " _spartanInvalid() ? \"true\": null", "attr.data-invalid": " _invalid() ? \"true\": null", "attr.data-matches-spartan-invalid": " _spartanInvalid() ? \"true\": null", "attr.data-touched": " _touched() ? \"true\": null", "attr.data-dirty": " _dirty() ? \"true\": null" } }, exportAs: ["brnComboboxTrigger"], ngImport: i0 });
|
|
1173
1177
|
}
|
|
1174
1178
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnComboboxTrigger, decorators: [{
|
|
1175
1179
|
type: Directive,
|
|
@@ -1186,8 +1190,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
1186
1190
|
'[attr.disabled]': '_disabled() ? "" : null',
|
|
1187
1191
|
'[attr.data-disabled]': '_disabled() || null',
|
|
1188
1192
|
'[attr.data-placeholder]': '_isPlaceholder() ? "" : null',
|
|
1189
|
-
'[attr.aria-invalid]': '
|
|
1190
|
-
'[attr.data-invalid]': '
|
|
1193
|
+
'[attr.aria-invalid]': ' _spartanInvalid() ? "true": null',
|
|
1194
|
+
'[attr.data-invalid]': ' _invalid() ? "true": null',
|
|
1191
1195
|
'[attr.data-matches-spartan-invalid]': ' _spartanInvalid() ? "true": null',
|
|
1192
1196
|
'[attr.data-touched]': ' _touched() ? "true": null',
|
|
1193
1197
|
'[attr.data-dirty]': ' _dirty() ? "true": null',
|