@momentum-ui/web-components 2.26.7 → 2.26.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.
@@ -204,7 +204,7 @@ export declare namespace ComboBox {
204
204
  checkForVirtualScroll(): boolean;
205
205
  rangeChanged(): void;
206
206
  getCustomErrorContent(): DocumentFragment;
207
- getCustomContent(option: string | OptionMember): DocumentFragment | TemplateResult;
207
+ getCustomContent(option: string | OptionMember): TemplateResult | DocumentFragment;
208
208
  renderGroupLabelHeader(option: OptionMember, optionIndex: number): TemplateResult;
209
209
  renderWithoutVirtualScroll(): import("lit-html").DirectiveFn;
210
210
  highlightingSearchedText(option: OptionMember | string): TemplateResult[];
@@ -1,10 +1,15 @@
1
1
  import { AbstractControl } from "./Form.types";
2
2
  import { ObservableControl } from "./ObservableControl";
3
+ export type ArrayValidatorFn<ItemType> = (arr: FormArray<ItemType>) => void;
3
4
  export declare class FormArray<ItemType> extends ObservableControl<ItemType[]> implements AbstractControl<ItemType[]> {
4
5
  private readonly controls;
5
- constructor(controls: AbstractControl<ItemType>[]);
6
+ private readonly arrayValidators;
7
+ private inArrayValidation;
8
+ constructor(controls: AbstractControl<ItemType>[], arrayValidators?: ReadonlyArray<ArrayValidatorFn<ItemType>>);
6
9
  at(index: number): AbstractControl<ItemType>;
10
+ private runArrayValidators;
7
11
  push(control: AbstractControl<ItemType>): void;
12
+ private childChanged;
8
13
  removeAt(index: number): void;
9
14
  get value(): ItemType[];
10
15
  get valid(): boolean;
@@ -6,11 +6,14 @@ export declare class FormControl<ValueType> extends ObservableControl<ValueType>
6
6
  private validationErrors;
7
7
  private touched;
8
8
  private readonly validators;
9
+ private groupErrors;
9
10
  constructor(initialValue: ValueType, validators?: ValidatorFn<ValueType>[]);
10
11
  get value(): ValueType;
11
12
  markAsTouched(): void;
12
13
  get valid(): boolean;
13
14
  get errors(): ValidationError[];
15
+ addGroupError(error: ValidationError): void;
16
+ clearGroupErrorsByType(type: string): void;
14
17
  setValue(value: ValueType): void;
15
18
  validate(): void;
16
19
  }
@@ -2,5 +2,6 @@ export { FormControl } from "./FormControl";
2
2
  export { FormGroup } from "./FormGroup";
3
3
  export { FormArray } from "./FormArray";
4
4
  export { Validators } from "./validators";
5
+ export { ArrayValidators } from "./validators.array";
5
6
  export { AbstractControl } from "./Form.types";
6
7
  export { ValidationError } from "./Form.types";
@@ -0,0 +1,12 @@
1
+ import { FormArray } from "./FormArray";
2
+ import { FormGroup } from "./FormGroup";
3
+ import { FormControl } from "./FormControl";
4
+ /**
5
+ * Array-level validator to ensure values are strictly increasing.
6
+ * - Checks each control selected from the FormArray
7
+ * - Adds a groupError to the first offending control
8
+ */
9
+ export declare function strictIncreasingOnly<FormValues extends Record<string, unknown>>(select: (row: FormGroup<FormValues>) => FormControl<number>): (arr: FormArray<FormValues>) => void;
10
+ export declare const ArrayValidators: {
11
+ strictIncreasingOnly: typeof strictIncreasingOnly;
12
+ };
@@ -3,4 +3,5 @@ export declare const Validators: {
3
3
  required: <FieldValue>() => ValidatorFn<FieldValue>;
4
4
  minLength: (min: number) => ValidatorFn<string>;
5
5
  maxLength: (max: number) => ValidatorFn<string>;
6
+ nonNegative: () => ValidatorFn<number>;
6
7
  };
@@ -108,7 +108,7 @@ export declare namespace Input {
108
108
  showDropdown: boolean;
109
109
  dropdownExpanded: boolean;
110
110
  dropdownAriaLabel: string;
111
- displayCharacterCount: boolean;
111
+ maxSuggestedLength: number | undefined;
112
112
  input: HTMLInputElement;
113
113
  private isEditing;
114
114
  private readonly inputSectionRightSlot;
@@ -165,7 +165,7 @@ export declare namespace Input {
165
165
  private get inputRightTemplateClassMap();
166
166
  inputRightTemplate(): import("lit-element").TemplateResult | undefined;
167
167
  private get comboBoxButtonTemplate();
168
- private characterCountTemplate;
168
+ private characterCountLabelTemplate;
169
169
  secondaryLabelTemplate(): {};
170
170
  helpTextTemplate(): {};
171
171
  messagesTemplate(): {};
@@ -12,6 +12,8 @@ export declare namespace Radio {
12
12
  tabIndex: number;
13
13
  label: string;
14
14
  value: string;
15
+ message: string;
16
+ hideMessage: boolean;
15
17
  ariaLabel: string;
16
18
  autofocus: boolean;
17
19
  private _disabled;
@@ -20,6 +22,8 @@ export declare namespace Radio {
20
22
  checked: boolean;
21
23
  private get inputAriaLabel();
22
24
  static get styles(): import("lit-element").CSSResult[];
25
+ private get helpTextClassMap();
26
+ messagesTemplate(): {};
23
27
  render(): import("lit-element").TemplateResult;
24
28
  }
25
29
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momentum-ui/web-components",
3
- "version": "2.26.7",
3
+ "version": "2.26.11",
4
4
  "author": "Yana Harris",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/momentum-design/momentum-ui.git",