@spartan-ng/brain 1.0.5 → 1.1.0-beta.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/date-picker/README.md +3 -0
- package/fesm2022/spartan-ng-brain-accordion.mjs +2 -2
- package/fesm2022/spartan-ng-brain-accordion.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-calendar.mjs +465 -3
- package/fesm2022/spartan-ng-brain-calendar.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-checkbox.mjs +8 -3
- package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-date-picker.mjs +166 -0
- package/fesm2022/spartan-ng-brain-date-picker.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-radio-group.mjs +9 -4
- package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-resizable.mjs +18 -4
- package/fesm2022/spartan-ng-brain-resizable.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-switch.mjs +8 -3
- package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -1
- package/package.json +5 -1
- package/types/spartan-ng-brain-calendar.d.ts +204 -2
- package/types/spartan-ng-brain-checkbox.d.ts +6 -1
- package/types/spartan-ng-brain-date-picker.d.ts +100 -0
- package/types/spartan-ng-brain-radio-group.d.ts +6 -1
- package/types/spartan-ng-brain-resizable.d.ts +2 -1
- package/types/spartan-ng-brain-switch.d.ts +6 -1
|
@@ -60,6 +60,11 @@ declare class BrnCheckbox implements ControlValueAccessor, AfterContentInit, OnD
|
|
|
60
60
|
* CSS classes applied to inner button element.
|
|
61
61
|
*/
|
|
62
62
|
readonly class: _angular_core.InputSignal<string | null>;
|
|
63
|
+
/**
|
|
64
|
+
* Styles applied to the host element. Bound via `[style]` so they apply through the CSSOM and are
|
|
65
|
+
* not blocked by a strict Content-Security-Policy.
|
|
66
|
+
*/
|
|
67
|
+
readonly hostStyles: _angular_core.InputSignal<string>;
|
|
63
68
|
/**
|
|
64
69
|
* Accessibility label for screen readers.
|
|
65
70
|
* Use when no visible label exists.
|
|
@@ -163,7 +168,7 @@ declare class BrnCheckbox implements ControlValueAccessor, AfterContentInit, OnD
|
|
|
163
168
|
*/
|
|
164
169
|
setDisabledState(isDisabled: boolean): void;
|
|
165
170
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnCheckbox, never>;
|
|
166
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnCheckbox, "brn-checkbox", never, { "checkedInput": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; "indeterminate": "indeterminateChange"; "touched": "touched"; }, never, ["*"], true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>;
|
|
171
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnCheckbox, "brn-checkbox", never, { "checkedInput": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "hostStyles": { "alias": "hostStyles"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; "indeterminate": "indeterminateChange"; "touched": "touched"; }, never, ["*"], true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>;
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
declare const BrnCheckboxImports: readonly [typeof BrnCheckbox];
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as _spartan_ng_brain_popover from '@spartan-ng/brain/popover';
|
|
2
|
+
import { BrnPopover } from '@spartan-ng/brain/popover';
|
|
3
|
+
import * as _spartan_ng_brain_date_picker from '@spartan-ng/brain/date-picker';
|
|
4
|
+
import * as _angular_core from '@angular/core';
|
|
5
|
+
import { Signal, InjectionToken, Type, ExistingProvider } from '@angular/core';
|
|
6
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Headless behavior shared by every date picker text input (single, multi,
|
|
10
|
+
* range, month-year). Owns the editable text mirror, cursor preservation and
|
|
11
|
+
* the commit/parse lifecycle; styled subclasses provide the template, styling
|
|
12
|
+
* and the parse/format strategy.
|
|
13
|
+
*
|
|
14
|
+
* `V` is the value type held by the associated date picker (e.g. `Date`,
|
|
15
|
+
* `Date[]` or `[Date, Date]`).
|
|
16
|
+
*/
|
|
17
|
+
declare abstract class BrnDateInput<V> {
|
|
18
|
+
private static _nextId;
|
|
19
|
+
readonly inputId: _angular_core.InputSignal<string>;
|
|
20
|
+
private readonly _document;
|
|
21
|
+
private readonly _host;
|
|
22
|
+
private readonly _inputElement;
|
|
23
|
+
private _pendingSelection;
|
|
24
|
+
protected readonly _datePicker: _spartan_ng_brain_date_picker.BrnDatePickerBase<V>;
|
|
25
|
+
protected readonly _popover: _angular_core.Signal<_spartan_ng_brain_popover.BrnPopover>;
|
|
26
|
+
protected readonly _disabled: _angular_core.Signal<boolean>;
|
|
27
|
+
/** Initial text shown in the input. Mirrored by the picker once a date is committed. */
|
|
28
|
+
readonly inputValue: _angular_core.InputSignal<string>;
|
|
29
|
+
/** Show a clear button that resets the input and picker value. Hidden when empty. */
|
|
30
|
+
readonly showClear: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
31
|
+
/** Open the popover on input click. */
|
|
32
|
+
readonly openOnClick: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
33
|
+
/** Forces the invalid state visually, regardless of form control state. */
|
|
34
|
+
readonly forceInvalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
35
|
+
/** Accessible label for the clear button. */
|
|
36
|
+
readonly clearAriaLabel: _angular_core.InputSignal<string>;
|
|
37
|
+
/** Accessible label for the calendar trigger button. */
|
|
38
|
+
readonly calendarAriaLabel: _angular_core.InputSignal<string>;
|
|
39
|
+
/** @internal Id used by the trigger contract for labeling. */
|
|
40
|
+
readonly triggerId: _angular_core.Signal<string>;
|
|
41
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Parse user-entered text into the picker value. Return `null` for
|
|
44
|
+
* invalid input - the picker's value is cleared while the text is preserved
|
|
45
|
+
* so the user can fix it.
|
|
46
|
+
*/
|
|
47
|
+
protected abstract parseValue(value: string): V | null;
|
|
48
|
+
/**
|
|
49
|
+
* Format the committed value into the input/edit format shown while the
|
|
50
|
+
* input is focused. On blur the picker's display format is restored.
|
|
51
|
+
*/
|
|
52
|
+
protected abstract formatInputValue(value: V): string;
|
|
53
|
+
/**
|
|
54
|
+
* Text shown in the input. Mirrors the picker's `formattedDate` and the
|
|
55
|
+
* parent's `inputValue`, and accepts user writes via `_handleInputChange`.
|
|
56
|
+
* Commits only happen on blur / Enter, so in-progress text isn't clobbered.
|
|
57
|
+
*/
|
|
58
|
+
protected readonly _inputValue: _angular_core.WritableSignal<string>;
|
|
59
|
+
protected readonly _showClearButton: _angular_core.Signal<boolean>;
|
|
60
|
+
constructor();
|
|
61
|
+
protected _handleInputChange(event: Event): void;
|
|
62
|
+
protected _clear(): void;
|
|
63
|
+
protected _handleEnter(event: Event): void;
|
|
64
|
+
/** On focus, reformat the committed value into the input/edit format. */
|
|
65
|
+
protected _handleFocus(): void;
|
|
66
|
+
/** On blur, commit the input and snap back to the picker's display format. */
|
|
67
|
+
protected _handleBlur(): void;
|
|
68
|
+
protected _commitDate(): void;
|
|
69
|
+
protected _open(): void;
|
|
70
|
+
protected _handleClick(): void;
|
|
71
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnDateInput<any>, never>;
|
|
72
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnDateInput<any>, never, never, { "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "inputValue": { "alias": "inputValue"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "openOnClick": { "alias": "openOnClick"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; "isSignal": true; }; "calendarAriaLabel": { "alias": "calendarAriaLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface BrnDatePickerTriggerBase {
|
|
76
|
+
triggerId: Signal<string>;
|
|
77
|
+
}
|
|
78
|
+
declare const BrnDatePickerTriggerToken: InjectionToken<BrnDatePickerTriggerBase>;
|
|
79
|
+
declare function provideBrnDatePickerTrigger(instance: Type<BrnDatePickerTriggerBase>): ExistingProvider;
|
|
80
|
+
|
|
81
|
+
interface BrnDatePickerBase<T> {
|
|
82
|
+
popover: Signal<BrnPopover>;
|
|
83
|
+
disabledState: Signal<boolean>;
|
|
84
|
+
formattedDate: Signal<string | undefined>;
|
|
85
|
+
hasDate: Signal<boolean>;
|
|
86
|
+
/** The current raw value. Used by inputs to reformat into the input format on focus. Optional. */
|
|
87
|
+
value?: Signal<T | null>;
|
|
88
|
+
/** Commit a date to the picker (e.g. from a parsed input). Pass `null` to clear. Optional. */
|
|
89
|
+
updateDate?(value: T | null): void;
|
|
90
|
+
touched?(): void;
|
|
91
|
+
}
|
|
92
|
+
declare const BrnDatePickerToken: InjectionToken<BrnDatePickerBase<unknown>>;
|
|
93
|
+
declare function provideBrnDatePicker(instance: Type<BrnDatePickerBase<unknown>>): ExistingProvider;
|
|
94
|
+
/**
|
|
95
|
+
* Inject the date picker component.
|
|
96
|
+
*/
|
|
97
|
+
declare function injectBrnDatePicker<T>(): BrnDatePickerBase<T>;
|
|
98
|
+
|
|
99
|
+
export { BrnDateInput, BrnDatePickerToken, BrnDatePickerTriggerToken, injectBrnDatePicker, provideBrnDatePicker, provideBrnDatePickerTrigger };
|
|
100
|
+
export type { BrnDatePickerBase, BrnDatePickerTriggerBase };
|
|
@@ -41,6 +41,11 @@ declare class BrnRadio<T = unknown> implements OnDestroy {
|
|
|
41
41
|
* The value this radio button represents.
|
|
42
42
|
*/
|
|
43
43
|
readonly value: _angular_core.InputSignal<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Styles applied to the visually hidden native input element. Bound via `[style]` so they apply
|
|
46
|
+
* through the CSSOM and are not blocked by a strict Content-Security-Policy.
|
|
47
|
+
*/
|
|
48
|
+
readonly inputStyles: _angular_core.InputSignal<string>;
|
|
44
49
|
/**
|
|
45
50
|
* Whether the radio button is required.
|
|
46
51
|
*/
|
|
@@ -61,7 +66,7 @@ declare class BrnRadio<T = unknown> implements OnDestroy {
|
|
|
61
66
|
/** Triggered when the user clicks on the touch target. */
|
|
62
67
|
protected onTouchTargetClick(event: Event): void;
|
|
63
68
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnRadio<any>, never>;
|
|
64
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnRadio<any>, "brn-radio", ["brnRadio"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, { "change": "change"; }, never, ["[target],[indicator]", "*"], true, never>;
|
|
69
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnRadio<any>, "brn-radio", ["brnRadio"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "inputStyles": { "alias": "inputStyles"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, { "change": "change"; }, never, ["[target],[indicator]", "*"], true, never>;
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
declare const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: {
|
|
@@ -72,7 +72,8 @@ declare class BrnResizableGroup {
|
|
|
72
72
|
private _appliedLayout;
|
|
73
73
|
constructor();
|
|
74
74
|
private _synchronizePanelSizes;
|
|
75
|
-
private
|
|
75
|
+
private _layoutsEquivalent;
|
|
76
|
+
private _panelsEqual;
|
|
76
77
|
startResize(handleIndex: number, event: MouseEvent | TouchEvent): void;
|
|
77
78
|
private _handleResize;
|
|
78
79
|
private _queueResize;
|
|
@@ -46,6 +46,11 @@ declare class BrnSwitch implements AfterContentInit, OnDestroy, ControlValueAcce
|
|
|
46
46
|
* CSS classes applied to inner button element.
|
|
47
47
|
*/
|
|
48
48
|
readonly class: _angular_core.InputSignal<string | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Styles applied to the host element. Bound via `[style]` so they apply through the CSSOM and are
|
|
51
|
+
* not blocked by a strict Content-Security-Policy.
|
|
52
|
+
*/
|
|
53
|
+
readonly hostStyles: _angular_core.InputSignal<string>;
|
|
49
54
|
/**
|
|
50
55
|
* Size of the switch.
|
|
51
56
|
* Drives the size-keyed registry style rules via the `data-size` attribute.
|
|
@@ -145,7 +150,7 @@ declare class BrnSwitch implements AfterContentInit, OnDestroy, ControlValueAcce
|
|
|
145
150
|
*/
|
|
146
151
|
setDisabledState(isDisabled: boolean): void;
|
|
147
152
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnSwitch, never>;
|
|
148
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnSwitch, "brn-switch", never, { "checkedInput": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; "touched": "touched"; }, never, ["brn-switch-thumb"], true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>;
|
|
153
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnSwitch, "brn-switch", never, { "checkedInput": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "hostStyles": { "alias": "hostStyles"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; "touched": "touched"; }, never, ["brn-switch-thumb"], true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>;
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
declare class BrnSwitchThumb {
|