@coolon/angular-ui-powerups 16.1.0-alpha.306 → 16.1.0-alpha.307

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.
Files changed (31) hide show
  1. package/assets/form.scss +35 -0
  2. package/esm2022/lib/components/commands/button-renderer/button-renderer.component.mjs +25 -4
  3. package/esm2022/lib/components/commands/command/command.component.mjs +7 -3
  4. package/esm2022/lib/components/commands/group/popup-menu/more-menu.component.mjs +1 -1
  5. package/esm2022/lib/components/commands/group/popup-menu/popup-menu.component.mjs +1 -1
  6. package/esm2022/lib/components/forms/abstract-input.component.mjs +33 -4
  7. package/esm2022/lib/components/forms/number-input/number-input.component.mjs +6 -11
  8. package/esm2022/lib/components/forms/password-input/password-input.component.mjs +1 -1
  9. package/esm2022/lib/components/forms/search-input/search-input.component.mjs +2 -2
  10. package/esm2022/lib/components/forms/string-input/string-input.component.mjs +1 -1
  11. package/esm2022/lib/components/forms/sub-form-list/sub-form-list.component.mjs +1 -1
  12. package/esm2022/lib/components/tables/renderer/table-action-column/table-action-column.component.mjs +1 -1
  13. package/esm2022/lib/directives/density.directive.mjs +24 -0
  14. package/esm2022/lib/directives/directives.module.mjs +6 -1
  15. package/esm2022/lib/directives/exports.mjs +2 -1
  16. package/esm2022/lib/interaction/components/activity-actions/activity-actions.component.mjs +1 -1
  17. package/esm2022/lib/interaction/components/activity-triggers/inline-activity-trigger/inline-activity-trigger.component.mjs +1 -1
  18. package/esm2022/lib/interaction/components/activity-triggers/modal-activity-trigger/modal-activity-trigger.component.mjs +1 -1
  19. package/esm2022/lib/interaction/components/activity-triggers/popup-activity-trigger/popup-activity-trigger.component.mjs +1 -1
  20. package/esm2022/lib/interaction/components/add-card-activity/add-card-activity.component.mjs +1 -1
  21. package/esm2022/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.mjs +1 -1
  22. package/fesm2022/coolon-angular-ui-powerups.mjs +103 -30
  23. package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
  24. package/lib/components/commands/button-renderer/button-renderer.component.d.ts +8 -1
  25. package/lib/components/commands/command/command.component.d.ts +4 -1
  26. package/lib/components/forms/abstract-input.component.d.ts +16 -2
  27. package/lib/components/forms/number-input/number-input.component.d.ts +5 -8
  28. package/lib/directives/density.directive.d.ts +27 -0
  29. package/lib/directives/directives.module.d.ts +14 -13
  30. package/lib/directives/exports.d.ts +1 -0
  31. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { MatButton } from "@angular/material/button";
2
2
  import { ThemePalette } from "@angular/material/core";
3
3
  import { MatMenuItem } from "@angular/material/menu";
4
4
  import { BooleanValueModelChain, CommandFace, ListModel, ValueModel, ValueModelChain } from "@coolon/pectin";
5
+ import { Density } from '../../../directives/density.directive';
5
6
  import { HorizontalAlignment } from "../../alignment";
6
7
  import { CommandFace as CommandFaceUtils } from '../command-face';
7
8
  import { PopupAwareComponent } from "../group/popup-aware.component";
@@ -15,6 +16,12 @@ export declare class ButtonRendererComponent extends PopupAwareComponent {
15
16
  accessor busy: boolean;
16
17
  alignFace: HorizontalAlignment;
17
18
  forceRenderAsButton: boolean;
19
+ private readonly densityArea;
20
+ /** How much room the button takes (see {@link Density}): its own, else its area's. */
21
+ density?: Density;
22
+ get dense(): boolean;
23
+ get compact(): boolean;
24
+ private get resolvedDensity();
18
25
  matControl: MatMenuItem | MatButton;
19
26
  readonly buttonStyle$: ValueModelChain<string>;
20
27
  readonly color$: ValueModelChain<ThemePalette>;
@@ -26,5 +33,5 @@ export declare class ButtonRendererComponent extends PopupAwareComponent {
26
33
  get renderAsMenuItem(): boolean;
27
34
  focus(): void;
28
35
  static ɵfac: i0.ɵɵFactoryDeclaration<ButtonRendererComponent, never>;
29
- static ɵcmp: i0.ɵɵComponentDeclaration<ButtonRendererComponent, "aup-button-renderer", never, { "faces$": { "alias": "faces$"; "required": false; }; "faces": { "alias": "faces"; "required": false; }; "enabled$": { "alias": "enabled$"; "required": false; }; "enabled": { "alias": "enabled"; "required": false; }; "busy$": { "alias": "busy$"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; "alignFace": { "alias": "alignFace"; "required": false; }; "forceRenderAsButton": { "alias": "forceRenderAsButton"; "required": false; }; }, {}, never, never, false, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonRendererComponent, "aup-button-renderer", never, { "faces$": { "alias": "faces$"; "required": false; }; "faces": { "alias": "faces"; "required": false; }; "enabled$": { "alias": "enabled$"; "required": false; }; "enabled": { "alias": "enabled"; "required": false; }; "busy$": { "alias": "busy$"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; "alignFace": { "alias": "alignFace"; "required": false; }; "forceRenderAsButton": { "alias": "forceRenderAsButton"; "required": false; }; "density": { "alias": "density"; "required": false; }; }, {}, never, never, false, never>;
30
37
  }
@@ -1,6 +1,7 @@
1
1
  import { ThemePalette } from "@angular/material/core";
2
2
  import { BooleanValueModelChain, Command, ListModelChain, ValueModel, ValueModelChain } from "@coolon/pectin";
3
3
  import { HorizontalAlignment } from '../../alignment';
4
+ import { Density } from "../../../directives/density.directive";
4
5
  import { ButtonRendererComponent } from "../button-renderer/button-renderer.component";
5
6
  import { CommandFace } from '../command-face';
6
7
  import { PopupAwareComponent } from '../group/popup-aware.component';
@@ -16,6 +17,8 @@ export declare class CommandComponent extends PopupAwareComponent {
16
17
  accessor busyFace: CommandFace;
17
18
  CommandFace: typeof CommandFace;
18
19
  alignFace: HorizontalAlignment;
20
+ /** How much room the button takes (see {@link Density}); unset, it follows its area's. */
21
+ density?: Density;
19
22
  protected button: ButtonRendererComponent;
20
23
  readonly faces$: ListModelChain<CommandFace>;
21
24
  readonly buttonStyle$: ValueModelChain<string>;
@@ -30,5 +33,5 @@ export declare class CommandComponent extends PopupAwareComponent {
30
33
  isActive(face: CommandFace): boolean;
31
34
  requestFocus(): void;
32
35
  static ɵfac: i0.ɵɵFactoryDeclaration<CommandComponent, never>;
33
- static ɵcmp: i0.ɵɵComponentDeclaration<CommandComponent, "aup-command", never, { "command": { "alias": "command"; "required": false; }; "face$": { "alias": "face$"; "required": false; }; "face": { "alias": "face"; "required": false; }; "busyFace$": { "alias": "busyFace$"; "required": false; }; "busyFace": { "alias": "busyFace"; "required": false; }; "alignFace": { "alias": "alignFace"; "required": false; }; }, {}, never, never, false, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<CommandComponent, "aup-command", never, { "command": { "alias": "command"; "required": false; }; "face$": { "alias": "face$"; "required": false; }; "face": { "alias": "face"; "required": false; }; "busyFace$": { "alias": "busyFace$"; "required": false; }; "busyFace": { "alias": "busyFace"; "required": false; }; "alignFace": { "alias": "alignFace"; "required": false; }; "density": { "alias": "density"; "required": false; }; }, {}, never, never, false, never>;
34
37
  }
@@ -3,6 +3,7 @@ import { ErrorStateMatcher } from '@angular/material/core';
3
3
  import { FloatLabelType } from "@angular/material/form-field";
4
4
  import { Command, Disposable, EventListenerList, FocusManager, IMutableHasValue, ListModel, MutableValueModel, ValueModel } from '@coolon/pectin';
5
5
  import type { ValidationMessage } from '@coolon/pectin';
6
+ import { Density } from '../../directives/density.directive';
6
7
  import { DisposableComponent } from '../disposable-component';
7
8
  import type { FormField } from "./form-field";
8
9
  import * as i0 from "@angular/core";
@@ -34,7 +35,20 @@ export declare class AbstractInputComponent<T> extends DisposableComponent {
34
35
  userFloatLabel: FloatLabelType;
35
36
  _hint?: string;
36
37
  _placeholder?: string;
37
- dense: boolean;
38
+ private readonly densityArea;
39
+ private ownDensity?;
40
+ /** The density a subclass has when neither it nor an area around it says otherwise. */
41
+ protected defaultDensity: Density;
42
+ /** How much room this field takes (see {@link Density}): its own, else its area's, else its default. */
43
+ set density(density: Density);
44
+ get density(): Density;
45
+ /**
46
+ * True for `dense` and for `compact`, which both show messages through the suffix icon's popup
47
+ * rather than under the field. Setting it is the older way to ask for `dense`.
48
+ */
49
+ get dense(): boolean;
50
+ set dense(dense: boolean);
51
+ get compact(): boolean;
38
52
  private readonly _enabled$;
39
53
  set enabled$(condition$: ValueModel<boolean>);
40
54
  get enabled$(): ValueModel<boolean>;
@@ -119,7 +133,7 @@ export declare class AbstractInputComponent<T> extends DisposableComponent {
119
133
  onValueEdited(callback: (is: T, was: T) => void): Disposable;
120
134
  protected hackyGetI18n(key: keyof FormField): string;
121
135
  static ɵfac: i0.ɵɵFactoryDeclaration<AbstractInputComponent<any>, never>;
122
- static ɵcmp: i0.ɵɵComponentDeclaration<AbstractInputComponent<any>, "ng-component", never, { "i18n$": { "alias": "i18n$"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "_label": { "alias": "label"; "required": false; }; "userFloatLabel": { "alias": "floatLabel"; "required": false; }; "_hint": { "alias": "hint"; "required": false; }; "_placeholder": { "alias": "placeholder"; "required": false; }; "dense": { "alias": "dense"; "required": false; }; "enabled$": { "alias": "enabled$"; "required": false; }; "disable$": { "alias": "disable$"; "required": false; }; "focusCommand": { "alias": "command.focus"; "required": false; }; "blurCommand": { "alias": "command.blur"; "required": false; }; "enterCommand": { "alias": "command.enter"; "required": false; }; "escapeCommand": { "alias": "command.escape"; "required": false; }; "clickCommand": { "alias": "command.click"; "required": false; }; }, { "focus": "focus"; "blur": "blur"; "enterKey": "enterKey"; "escapeKey": "escapeKey"; }, never, never, false, never>;
136
+ static ɵcmp: i0.ɵɵComponentDeclaration<AbstractInputComponent<any>, "ng-component", never, { "i18n$": { "alias": "i18n$"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "_label": { "alias": "label"; "required": false; }; "userFloatLabel": { "alias": "floatLabel"; "required": false; }; "_hint": { "alias": "hint"; "required": false; }; "_placeholder": { "alias": "placeholder"; "required": false; }; "density": { "alias": "density"; "required": false; }; "dense": { "alias": "dense"; "required": false; }; "enabled$": { "alias": "enabled$"; "required": false; }; "disable$": { "alias": "disable$"; "required": false; }; "focusCommand": { "alias": "command.focus"; "required": false; }; "blurCommand": { "alias": "command.blur"; "required": false; }; "enterCommand": { "alias": "command.enter"; "required": false; }; "escapeCommand": { "alias": "command.escape"; "required": false; }; "clickCommand": { "alias": "command.click"; "required": false; }; }, { "focus": "focus"; "blur": "blur"; "enterKey": "enterKey"; "escapeKey": "escapeKey"; }, never, never, false, never>;
123
137
  }
124
138
  export declare namespace AbstractInputComponent {
125
139
  /** 'hint' is the plain, non-validation hint — it has no severity of its own. */
@@ -10,14 +10,11 @@ export declare class NumberInputComponent extends AbstractValueInputComponent<nu
10
10
  accessor significantDigits$: ValueModel<number>;
11
11
  accessor significantDigits: number;
12
12
  /**
13
- * Selects the layout, not a breakpoint — a touch-density form uses the touch layout throughout,
14
- * so the two never mix in one column. 'touch' unstacks the steppers to full-height buttons either
15
- * side of the field, because stacking them in a 56px row would halve each one.
16
- *
17
- * Orthogonal to {@link dense}, which goes the other way (a 37px row for tables and sub-forms).
18
- * Setting both is contradictory; touch wins, since its rules come later.
13
+ * At `touch` density (see {@link Density}) the steppers unstack to full-height buttons either side
14
+ * of the field, because stacking them in a 56px row would halve each one. It selects the layout,
15
+ * not a breakpoint: a touch-density form uses the touch layout throughout, so the two never mix
16
+ * in one column.
19
17
  */
20
- density: 'desktop' | 'touch';
21
18
  get touchDensity(): boolean;
22
19
  /**
23
20
  * The steppers live outside the field's outline now, so nothing about them is styled by Material.
@@ -77,5 +74,5 @@ export declare class NumberInputComponent extends AbstractValueInputComponent<nu
77
74
  protected onStepperPress(event: MouseEvent): void;
78
75
  onValueChange(value: number): void;
79
76
  static ɵfac: i0.ɵɵFactoryDeclaration<NumberInputComponent, never>;
80
- static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent, "aup-number-input", never, { "autocomplete": { "alias": "autocomplete"; "required": false; }; "min$": { "alias": "min$"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max$": { "alias": "max$"; "required": false; }; "max": { "alias": "max"; "required": false; }; "significantDigits$": { "alias": "significantDigits$"; "required": false; }; "significantDigits": { "alias": "significantDigits"; "required": false; }; "density": { "alias": "density"; "required": false; }; }, {}, never, never, false, never>;
77
+ static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent, "aup-number-input", never, { "autocomplete": { "alias": "autocomplete"; "required": false; }; "min$": { "alias": "min$"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max$": { "alias": "max$"; "required": false; }; "max": { "alias": "max"; "required": false; }; "significantDigits$": { "alias": "significantDigits$"; "required": false; }; "significantDigits": { "alias": "significantDigits"; "required": false; }; }, {}, never, never, false, never>;
81
78
  }
@@ -0,0 +1,27 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * How much room AUP's inputs and commands take, from the roomiest to the tightest:
4
+ *
5
+ * - `touch`: for fingers rather than a pointer. Today only the number input does anything different,
6
+ * splitting its steppers to full-height buttons either side of the field; the rest are `regular`.
7
+ * - `regular`: Material's own sizes, with a floating label and messages shown under the field.
8
+ * - `dense`: a 37px field and 32px buttons, for table cells and sub-form rows. A field shows its
9
+ * validation through a popup on its suffix icon rather than under it, so the row never grows.
10
+ * - `compact`: a field and buttons about 28px tall in the surrounding text's size, for editors that
11
+ * sit inline among text, such as a schedule's day and time pickers. Messages work as for `dense`.
12
+ */
13
+ export type Density = 'touch' | 'regular' | 'dense' | 'compact';
14
+ /**
15
+ * Sets the density of every AUP input and command inside its element, so a form area of compact
16
+ * editors says so once. An input's or command's own `density` (or `dense`) still wins.
17
+ *
18
+ * <section aupDensity="compact">
19
+ * <aup-select-input [options]="weekdays" [(value)]="weekday"/>
20
+ * <aup-command [command]="removeCommand"/>
21
+ * </section>
22
+ */
23
+ export declare class DensityDirective {
24
+ density: Density;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DensityDirective, never>;
26
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DensityDirective, "[aupDensity]", never, { "density": { "alias": "aupDensity"; "required": false; }; }, {}, never, never, false, never>;
27
+ }
@@ -1,20 +1,21 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./aup-tooltip.directive";
3
3
  import * as i2 from "./command.directive";
4
- import * as i3 from "./focus-binding.directive";
5
- import * as i4 from "./highlight.pipe";
6
- import * as i5 from "./highlight-text-model.directive";
7
- import * as i6 from "./garbage-collector.directive";
8
- import * as i7 from "@angular/common";
9
- import * as i8 from "@angular/platform-browser/animations";
10
- import * as i9 from "@angular/forms";
11
- import * as i10 from "@angular/material/input";
12
- import * as i11 from "@angular/material/form-field";
13
- import * as i12 from "@angular/material/select";
14
- import * as i13 from "@angular/material/tabs";
15
- import * as i14 from "@angular/material/tooltip";
4
+ import * as i3 from "./density.directive";
5
+ import * as i4 from "./focus-binding.directive";
6
+ import * as i5 from "./highlight.pipe";
7
+ import * as i6 from "./highlight-text-model.directive";
8
+ import * as i7 from "./garbage-collector.directive";
9
+ import * as i8 from "@angular/common";
10
+ import * as i9 from "@angular/platform-browser/animations";
11
+ import * as i10 from "@angular/forms";
12
+ import * as i11 from "@angular/material/input";
13
+ import * as i12 from "@angular/material/form-field";
14
+ import * as i13 from "@angular/material/select";
15
+ import * as i14 from "@angular/material/tabs";
16
+ import * as i15 from "@angular/material/tooltip";
16
17
  export declare class DirectivesModule {
17
18
  static ɵfac: i0.ɵɵFactoryDeclaration<DirectivesModule, never>;
18
- static ɵmod: i0.ɵɵNgModuleDeclaration<DirectivesModule, [typeof i1.AupTooltipDirective, typeof i2.CommandDirective, typeof i3.FocusBindingDirective, typeof i4.HighlightPipe, typeof i5.HighlightTextModelDirective, typeof i6.GarbageCollectorDirective], [typeof i7.CommonModule, typeof i8.BrowserAnimationsModule, typeof i9.FormsModule, typeof i10.MatInputModule, typeof i11.MatFormFieldModule, typeof i12.MatSelectModule, typeof i13.MatTabsModule, typeof i14.MatTooltipModule], [typeof i1.AupTooltipDirective, typeof i2.CommandDirective, typeof i3.FocusBindingDirective, typeof i4.HighlightPipe, typeof i5.HighlightTextModelDirective, typeof i6.GarbageCollectorDirective]>;
19
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DirectivesModule, [typeof i1.AupTooltipDirective, typeof i2.CommandDirective, typeof i3.DensityDirective, typeof i4.FocusBindingDirective, typeof i5.HighlightPipe, typeof i6.HighlightTextModelDirective, typeof i7.GarbageCollectorDirective], [typeof i8.CommonModule, typeof i9.BrowserAnimationsModule, typeof i10.FormsModule, typeof i11.MatInputModule, typeof i12.MatFormFieldModule, typeof i13.MatSelectModule, typeof i14.MatTabsModule, typeof i15.MatTooltipModule], [typeof i1.AupTooltipDirective, typeof i2.CommandDirective, typeof i3.DensityDirective, typeof i4.FocusBindingDirective, typeof i5.HighlightPipe, typeof i6.HighlightTextModelDirective, typeof i7.GarbageCollectorDirective]>;
19
20
  static ɵinj: i0.ɵɵInjectorDeclaration<DirectivesModule>;
20
21
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export * from "./aup-tooltip.directive";
5
5
  export * from "./command.directive";
6
+ export * from "./density.directive";
6
7
  export * from "./directives.module";
7
8
  export * from "./focus-binding-factory";
8
9
  export * from "./focus-binding.directive";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.306",
3
+ "version": "16.1.0-alpha.307",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",