ngx-dynamic-entity 2.1.0 → 2.2.0
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/README.md +1 -1
- package/fesm2022/ngx-dynamic-entity.mjs +2003 -572
- package/fesm2022/ngx-dynamic-entity.mjs.map +1 -1
- package/package.json +2 -2
- package/styles.css +210 -0
- package/types/ngx-dynamic-entity.d.ts +312 -184
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, Type, EnvironmentProviders, WritableSignal, OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, Provider } from '@angular/core';
|
|
3
|
-
import { ReferenceOption, LocalizedText, EntityFormConfig, FormRule, ImportLookups, MappingPlan, ImportResult, TemplateSpec, SheetData, CommonModuleEntry, EntityReferenceLoader, LookupListSource, RecordMigration, FileUploadHandler, FieldValidators, NestedFieldConfig, ReferenceLoaderContext, DropdownOption, LookupListValue, NestedTabConfig, RuleEvaluationResult, FieldScopeEntry, EvaluateFormRulesOptions, ImportColumn, UnsupportedColumn, ImportRowError } from '@dynamic-entity/core';
|
|
3
|
+
import { ReferenceOption, LocalizedText, EntityFormConfig, FormRule, ImportLookups, MappingPlan, ImportResult, TemplateSpec, SheetData, CommonModuleEntry, EntityReferenceLoader, LookupListSource, RecordMigration, FileUploadHandler, FieldValidators, NestedFieldConfig, ReferenceLoaderContext, DropdownOption, LookupListValue, NestedTabConfig, RuleEvaluationResult, FieldScopeEntry, EvaluateFormRulesOptions, ImportColumn, UnsupportedColumn, ImportRowError, SliderBounds } from '@dynamic-entity/core';
|
|
4
4
|
export { AutoPatchConfig, CommonModuleEntry, ComponentClass, DropdownOption, EntityFormConfig, EntityPermissions, EntityReferenceConfig, EntityReferenceLoader, FieldTableConfig, FieldValidators, FileRef, FormRule, LocalizedText, NestedFieldConfig, NestedTabConfig, PatchOnTrueMapping, RbacContext, ReferenceLoaderContext, ReferenceOption, RichFieldType, RuleAction, RuleCondition, RuleEvaluationResult, VersionedRecord, formatDisplayValue, normalizeConfig, normalizeOption, resolveLabel, resolveOptionLabel, resolveOptionValue, valuesMatch } from '@dynamic-entity/core';
|
|
5
5
|
import { ValidatorFn, AsyncValidatorFn, AbstractControl, ValidationErrors, FormGroup, FormArray } from '@angular/forms';
|
|
6
6
|
import * as rxjs from 'rxjs';
|
|
@@ -83,6 +83,10 @@ declare const DEFAULT_UI_TEXT: {
|
|
|
83
83
|
noImage: string;
|
|
84
84
|
uploadImage: string;
|
|
85
85
|
changeImage: string;
|
|
86
|
+
ratingValue: string;
|
|
87
|
+
clearValue: string;
|
|
88
|
+
addTagPlaceholder: string;
|
|
89
|
+
removeTag: string;
|
|
86
90
|
month: string;
|
|
87
91
|
year: string;
|
|
88
92
|
write: string;
|
|
@@ -286,9 +290,8 @@ interface ImportTransport {
|
|
|
286
290
|
* choice — and `spec` is that selection already expanded against the config. A transport that
|
|
287
291
|
* renders locally wants the spec; one that asks a server wants the selection, because the
|
|
288
292
|
* server has the config and only the choice needs to cross the wire. Passing both means
|
|
289
|
-
* neither has to reconstruct the other
|
|
290
|
-
*
|
|
291
|
-
* inverse of the expansion. Optional, so an existing implementation keeps compiling.
|
|
293
|
+
* neither has to reconstruct the other. Optional, so an existing implementation keeps
|
|
294
|
+
* compiling.
|
|
292
295
|
*/
|
|
293
296
|
template(spec: TemplateSpec, format: TemplateFormat, context: ImportContext, fields?: readonly string[]): Promise<Blob>;
|
|
294
297
|
}
|
|
@@ -465,7 +468,7 @@ declare const ENTITY_REF_CACHE_STORE: InjectionToken<EntityRefCacheStore>;
|
|
|
465
468
|
declare const SYSTEM_DEFAULT_CAN_EDIT: InjectionToken<(roles: string[]) => boolean>;
|
|
466
469
|
type ConfigSourceHandler = (entityKey: string) => any;
|
|
467
470
|
/**
|
|
468
|
-
* Registry/Resolver for resolving an EntityFormConfig by entity key across entities
|
|
471
|
+
* Registry/Resolver for resolving an EntityFormConfig by entity key across entities.
|
|
469
472
|
* Enables cross-entity field referencing (`isReferenced`, `referencedEntityKey`, `referencedFieldId`, `hasDrift`).
|
|
470
473
|
*/
|
|
471
474
|
declare const CONFIG_SOURCE: InjectionToken<ConfigSourceHandler>;
|
|
@@ -493,8 +496,7 @@ declare const MARKDOWN_RENDERER: InjectionToken<(source: string) => string>;
|
|
|
493
496
|
*
|
|
494
497
|
* Masking is presentational — see SECURITY.md — and what it prints is a product decision:
|
|
495
498
|
* `••••••••` reads as a redaction, "Hidden" reads as a permission, and a localized string
|
|
496
|
-
* reads as neither in English
|
|
497
|
-
* there was no way to choose.
|
|
499
|
+
* reads as neither in English, so it is the host's to choose.
|
|
498
500
|
*
|
|
499
501
|
* @example
|
|
500
502
|
* { provide: MASKED_PLACEHOLDER, useValue: '••••••••' }
|
|
@@ -618,7 +620,7 @@ declare const provideNgxDynamicEntity: (config?: NgxDynamicEntityConfig) => Envi
|
|
|
618
620
|
*
|
|
619
621
|
* `FieldRegistryService` imports no components. Whatever you register here is what gets
|
|
620
622
|
* bundled, so an app that only uses text/number/dropdown pays for three components and
|
|
621
|
-
* their imports, not twenty-
|
|
623
|
+
* their imports, not twenty-seven.
|
|
622
624
|
*
|
|
623
625
|
* ```ts
|
|
624
626
|
* // Everything (convenient; bundles all built-ins):
|
|
@@ -634,7 +636,7 @@ declare const provideNgxDynamicEntity: (config?: NgxDynamicEntityConfig) => Envi
|
|
|
634
636
|
declare function builtInFieldTypes(): Record<string, Type<any>>;
|
|
635
637
|
/** Register a specific set of field types. Only the components you name are bundled. */
|
|
636
638
|
declare function provideFieldTypes(types: Record<string, Type<any>>): EnvironmentProviders;
|
|
637
|
-
/** Register all
|
|
639
|
+
/** Register all 27 built-in field type keys. Convenience for apps that use most of them. */
|
|
638
640
|
declare function provideBuiltInFieldTypes(): EnvironmentProviders;
|
|
639
641
|
|
|
640
642
|
/**
|
|
@@ -680,6 +682,10 @@ declare class HookRegistryService {
|
|
|
680
682
|
static ɵprov: i0.ɵɵInjectableDeclaration<HookRegistryService>;
|
|
681
683
|
}
|
|
682
684
|
|
|
685
|
+
/** The built-in web address check. The rule itself is in core, so an import applies the same one. */
|
|
686
|
+
declare const urlValidator: ValidatorFn;
|
|
687
|
+
/** The built-in phone number check. The rule itself is in core, so an import applies the same one. */
|
|
688
|
+
declare const phoneValidator: ValidatorFn;
|
|
683
689
|
/**
|
|
684
690
|
* ValidatorRegistryService — resolves validator configs / key strings to Angular ValidatorFns.
|
|
685
691
|
*/
|
|
@@ -709,10 +715,9 @@ declare class ValidatorRegistryService {
|
|
|
709
715
|
/**
|
|
710
716
|
* Say when a named validator resolved to nothing.
|
|
711
717
|
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
*
|
|
715
|
-
* lands in the database.
|
|
718
|
+
* Silence would be the worst failure mode this library has: the schema says the field is
|
|
719
|
+
* checked, the field is not checked, the form saves, and nothing says so. For
|
|
720
|
+
* `customAsync` that is typically a uniqueness check, so the duplicate lands in the database.
|
|
716
721
|
*
|
|
717
722
|
* Dev only, once per name — this runs while controls are built, which happens on every
|
|
718
723
|
* config change. `validateConfig` with `knownValidators` is the build-time version of the
|
|
@@ -1000,13 +1005,8 @@ interface RuleSyncContext {
|
|
|
1000
1005
|
/**
|
|
1001
1006
|
* RulesEvaluationService — evaluates rules, and owns what a result *means*.
|
|
1002
1007
|
*
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1005
|
-
* decided again forty lines further down. They disagreed about what "every field" meant, and
|
|
1006
|
-
* the consequence was a required field inside a `group` that a rule had hidden holding
|
|
1007
|
-
* `form.invalid` true forever with nothing on screen to explain it.
|
|
1008
|
-
*
|
|
1009
|
-
* Precedence lives here now, in one method that both callers go through. Still stateless —
|
|
1008
|
+
* Precedence lives in one method that both the render filter and the validity sync go
|
|
1009
|
+
* through, so what is on screen and what counts toward validity cannot disagree. Stateless —
|
|
1010
1010
|
* every method takes the result it is interpreting, so there is nothing to go stale against a
|
|
1011
1011
|
* rebuilt form and nothing to reset between configs.
|
|
1012
1012
|
*/
|
|
@@ -1081,9 +1081,7 @@ declare class ConfigSourceService {
|
|
|
1081
1081
|
/**
|
|
1082
1082
|
* Resolves an Angular `ValidationErrors` object to the message shown under a field.
|
|
1083
1083
|
*
|
|
1084
|
-
*
|
|
1085
|
-
* German form meant re-implementing every field type — the labels honoured `language` while
|
|
1086
|
-
* the errors underneath them did not.
|
|
1084
|
+
* Field components never hardcode these strings, so errors honour `language` just as labels do.
|
|
1087
1085
|
*
|
|
1088
1086
|
* A message is a plain string, or a function when it needs the error's own detail
|
|
1089
1087
|
* (`minlength.requiredLength`, `min.min`, and so on). The active `language` is passed
|
|
@@ -1119,12 +1117,10 @@ declare class ValidationMessagesService {
|
|
|
1119
1117
|
/**
|
|
1120
1118
|
* The message for a field, chosen by its **type** rather than by a list the caller supplies.
|
|
1121
1119
|
*
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
* rendered
|
|
1125
|
-
*
|
|
1126
|
-
* (the offending field is usually on a tab that is not rendered), so it would have needed a
|
|
1127
|
-
* second copy of the same table, and a dropdown would have said "This field is required" in
|
|
1120
|
+
* Both the field itself and the error summary above the form render this message, and the
|
|
1121
|
+
* summary has no field component to ask (the offending field is usually on a tab that is
|
|
1122
|
+
* not rendered). Per-component key orders would drift, and a dropdown would say "This
|
|
1123
|
+
* field is required" in
|
|
1128
1124
|
* the summary and "Please select an option" under the control.
|
|
1129
1125
|
*
|
|
1130
1126
|
* One table, read from both places, is what keeps those two sentences the same sentence.
|
|
@@ -1314,8 +1310,7 @@ declare class DynamicFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1314
1310
|
/**
|
|
1315
1311
|
* Whether the current roles may see this record at all.
|
|
1316
1312
|
*
|
|
1317
|
-
* `permissions.view`
|
|
1318
|
-
* still received the complete form with every value in the DOM. It is honoured now.
|
|
1313
|
+
* A user whose roles fail `permissions.view` gets no form, so no value reaches the DOM.
|
|
1319
1314
|
*
|
|
1320
1315
|
* As with masking, this is presentational: it stops the browser rendering data, it does
|
|
1321
1316
|
* not stop the data reaching the browser. Authorize on the server.
|
|
@@ -1359,13 +1354,11 @@ declare class DynamicFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1359
1354
|
/**
|
|
1360
1355
|
* Whether the Save button is unavailable.
|
|
1361
1356
|
*
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
*
|
|
1365
|
-
* user is left comparing a disabled button against a form that looks, to them, filled in.
|
|
1366
|
-
* On a tabbed form the offending field is usually not even on screen.
|
|
1357
|
+
* Deliberately not `submitBlocked`: a greyed button is the worst answer to "why can't I
|
|
1358
|
+
* save?". It cannot be clicked, so the form never gets to say which field is at fault or
|
|
1359
|
+
* which tab it is on — and on a tabbed form that field is usually not on screen.
|
|
1367
1360
|
*
|
|
1368
|
-
* Save
|
|
1361
|
+
* Save stays available while the form is merely invalid. Clicking it still saves
|
|
1369
1362
|
* nothing — `submit()` checks `submitBlocked` and refuses — but the refusal is where the
|
|
1370
1363
|
* error summary, the tab badges and the jump to the first bad field come from, so pressing
|
|
1371
1364
|
* Save produces an explanation instead of silence.
|
|
@@ -1535,25 +1528,10 @@ declare class DynamicFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1535
1528
|
/**
|
|
1536
1529
|
* Ids already warned about, per component instance.
|
|
1537
1530
|
*
|
|
1538
|
-
*
|
|
1539
|
-
*
|
|
1540
|
-
* that lived as long as the server did, and the first request to render a config
|
|
1541
|
-
* suppressed the warning for every request after it. Per instance, the warning is once per
|
|
1542
|
-
* form — which is what "warn once" was meant to mean.
|
|
1531
|
+
* Per instance, never `static`: under SSR a module-global set would outlive every request,
|
|
1532
|
+
* and the first render of a config would suppress the warning for every render after it.
|
|
1543
1533
|
*/
|
|
1544
1534
|
private readonly warnedAmbiguousIds;
|
|
1545
|
-
/**
|
|
1546
|
-
* The value map rules and `showWhen` are evaluated against.
|
|
1547
|
-
*
|
|
1548
|
-
* Every field appears under two keys: its bare id, and its `refererField` path wrapped in brackets.
|
|
1549
|
-
* The bare id is what every config written so far uses and is kept exactly as it was — but
|
|
1550
|
-
* ids are unique per scope, so when two scopes define one the last field walked wins and
|
|
1551
|
-
* the rule reads whichever that is. `[personal.address]` names one field and cannot be
|
|
1552
|
-
* ambiguous, which is why a rule that has to distinguish them uses the ref.
|
|
1553
|
-
*
|
|
1554
|
-
* Both live in one flat map on purpose: `evaluateFormRules` takes a `Record<string,
|
|
1555
|
-
* unknown>` and needs no knowledge of refs at all — the extra keys simply resolve.
|
|
1556
|
-
*/
|
|
1557
1535
|
/**
|
|
1558
1536
|
* Every name a rule may address this field by.
|
|
1559
1537
|
*
|
|
@@ -1579,28 +1557,16 @@ declare class DynamicFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1579
1557
|
/**
|
|
1580
1558
|
* Every field in the config with the scope its value is stored under, cached per config.
|
|
1581
1559
|
*
|
|
1582
|
-
* `collectFieldScopes` walks the whole tree
|
|
1583
|
-
*
|
|
1584
|
-
* tab — a quadratic walk on every change-detection pass. Keyed by config identity, so a
|
|
1560
|
+
* `collectFieldScopes` walks the whole tree, and `pathFor` runs once per rendered field on
|
|
1561
|
+
* every change-detection pass — uncached, that is quadratic. Keyed by config identity, so a
|
|
1585
1562
|
* new config invalidates it without an explicit lifecycle hook to forget.
|
|
1586
1563
|
*/
|
|
1587
1564
|
private fieldScopes;
|
|
1588
1565
|
private scopeEntryFor;
|
|
1589
1566
|
private scopeCache?;
|
|
1590
|
-
/**
|
|
1591
|
-
* The control a scope entry addresses, named by path rather than by bare id.
|
|
1592
|
-
*
|
|
1593
|
-
* `getControl(field.id)` with no tab falls through to a first-match recursive search of the
|
|
1594
|
-
* whole form, so with `address` on two tabs, hiding one disabled the other. The control
|
|
1595
|
-
* tree mirrors the scope path exactly — `buildTabControls` nests by tab id and
|
|
1596
|
-
* `buildFieldControl` nests a `group` under its own id — so a `[path]` ref resolves through
|
|
1597
|
-
* `form.get()` on `getControl`'s first branch and names exactly one control.
|
|
1598
|
-
*
|
|
1599
|
-
* A field inside an `array` has no static path: its controls live in `FormArray` rows built
|
|
1600
|
-
* per row. `form.get()` returns null for those and they are left alone, which is correct —
|
|
1601
|
-
* a row's controls are created and destroyed with the row.
|
|
1602
|
-
*/
|
|
1567
|
+
/** The control a scope entry addresses — see `FormStructureService.controlAt`. */
|
|
1603
1568
|
private controlForEntry;
|
|
1569
|
+
/** The value map rules and `showWhen` are evaluated against — see `FormStructureService.flattenValues`. */
|
|
1604
1570
|
private flattenFormValues;
|
|
1605
1571
|
/**
|
|
1606
1572
|
* `autoPatch` — copy mapped fields out of the record the user just selected in an
|
|
@@ -1610,8 +1576,18 @@ declare class DynamicFormComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1610
1576
|
/**
|
|
1611
1577
|
* `patchOnTrue` — when a boolean/checkbox field transitions to `true`,
|
|
1612
1578
|
* copy `from` → `to` within the current record.
|
|
1579
|
+
*
|
|
1580
|
+
* The trigger is read by its ref, and a bare `from`/`to` resolves to a sibling in the
|
|
1581
|
+
* trigger's own scope before falling back to a form-wide lookup — so two groups that each
|
|
1582
|
+
* carry `home`, `billing` and a "same as" flag patch within themselves, not across.
|
|
1613
1583
|
*/
|
|
1614
1584
|
private runPatchOnTrue;
|
|
1585
|
+
/**
|
|
1586
|
+
* A field named by a mapping, preferring a sibling in `scope` when the name is a bare id.
|
|
1587
|
+
*
|
|
1588
|
+
* `key` is the field's entry in the flattened value map; `control` is the control it owns.
|
|
1589
|
+
*/
|
|
1590
|
+
private resolveInScope;
|
|
1615
1591
|
/**
|
|
1616
1592
|
* Prefer a control declared on the configured target tab; fall back to a top-level control.
|
|
1617
1593
|
*
|
|
@@ -1851,10 +1827,8 @@ declare class DynamicRecordFormComponent implements OnChanges {
|
|
|
1851
1827
|
/**
|
|
1852
1828
|
* What this record is called, as opposed to what kind of thing it is.
|
|
1853
1829
|
*
|
|
1854
|
-
*
|
|
1855
|
-
*
|
|
1856
|
-
* looking at, was the one thing it did not say. The entity keeps the subtitle; this takes
|
|
1857
|
-
* the heading.
|
|
1830
|
+
* A record header exists to answer *which* record am I looking at, so this takes the
|
|
1831
|
+
* heading and the entity name keeps the subtitle.
|
|
1858
1832
|
*
|
|
1859
1833
|
* The order is deliberate. `showOnMinimize` is the author saying "this is what identifies a
|
|
1860
1834
|
* record" — it is what the summary panel and the collapsed view already show — so it is
|
|
@@ -1913,11 +1887,6 @@ declare class DynamicRecordFormComponent implements OnChanges {
|
|
|
1913
1887
|
rowDrawerTitle(field: NestedFieldConfig): string;
|
|
1914
1888
|
/** Summary values render through the shared core formatter, not a local stringifier. */
|
|
1915
1889
|
formatFieldValue(field: NestedFieldConfig): string;
|
|
1916
|
-
/**
|
|
1917
|
-
* Finds which tab — and, where the field lives one level down, which sub-tab — owns a
|
|
1918
|
-
* field. The walk used to check top-level `fields` only, so every field in a sub-tab was
|
|
1919
|
-
* simply not found and the jump did nothing at all.
|
|
1920
|
-
*/
|
|
1921
1890
|
/**
|
|
1922
1891
|
* Switches to the tab holding `fieldId`, then scrolls it into view and moves focus to it.
|
|
1923
1892
|
*
|
|
@@ -1987,7 +1956,7 @@ declare class DynamicFieldComponent implements OnChanges, OnDestroy {
|
|
|
1987
1956
|
*
|
|
1988
1957
|
* `detectChanges()` rather than `markForCheck()`: a selection that arrives from a native
|
|
1989
1958
|
* `change` event (or Playwright) may not be followed by another Angular tick, so a dirty
|
|
1990
|
-
* flag would never be flushed. Running CD on the hosted component
|
|
1959
|
+
* flag would never be flushed. Running CD on the hosted component immediately is what shows the copied value.
|
|
1991
1960
|
*
|
|
1992
1961
|
* Done here rather than in each of the eighteen field components: the host owns the
|
|
1993
1962
|
* component reference, so one subscription covers every type including custom ones.
|
|
@@ -2512,12 +2481,6 @@ declare class TextareaFieldComponent {
|
|
|
2512
2481
|
masked: boolean;
|
|
2513
2482
|
get label(): string;
|
|
2514
2483
|
get placeholder(): string;
|
|
2515
|
-
/**
|
|
2516
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2517
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2518
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2519
|
-
* of fifteen field types.
|
|
2520
|
-
*/
|
|
2521
2484
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2522
2485
|
get hint(): string;
|
|
2523
2486
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2595,12 +2558,6 @@ declare class MarkdownFieldComponent implements OnChanges {
|
|
|
2595
2558
|
*/
|
|
2596
2559
|
private cached?;
|
|
2597
2560
|
protected rendered(): string | null;
|
|
2598
|
-
/**
|
|
2599
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2600
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2601
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2602
|
-
* of fifteen field types.
|
|
2603
|
-
*/
|
|
2604
2561
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2605
2562
|
get hint(): string;
|
|
2606
2563
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2656,12 +2613,6 @@ declare class CurrencyFieldComponent {
|
|
|
2656
2613
|
get placeholder(): string;
|
|
2657
2614
|
/** Picks the currency symbol from the locale — defaults to '$'. */
|
|
2658
2615
|
get symbol(): string;
|
|
2659
|
-
/**
|
|
2660
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2661
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2662
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2663
|
-
* of fifteen field types.
|
|
2664
|
-
*/
|
|
2665
2616
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2666
2617
|
get hint(): string;
|
|
2667
2618
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2689,12 +2640,6 @@ declare class EmailFieldComponent {
|
|
|
2689
2640
|
masked: boolean;
|
|
2690
2641
|
get label(): string;
|
|
2691
2642
|
get placeholder(): string;
|
|
2692
|
-
/**
|
|
2693
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2694
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2695
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2696
|
-
* of fifteen field types.
|
|
2697
|
-
*/
|
|
2698
2643
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2699
2644
|
get hint(): string;
|
|
2700
2645
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2726,12 +2671,6 @@ declare class PasswordFieldComponent {
|
|
|
2726
2671
|
get label(): string;
|
|
2727
2672
|
get placeholder(): string;
|
|
2728
2673
|
toggleVisibility(): void;
|
|
2729
|
-
/**
|
|
2730
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2731
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2732
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2733
|
-
* of fifteen field types.
|
|
2734
|
-
*/
|
|
2735
2674
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2736
2675
|
get hint(): string;
|
|
2737
2676
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2759,12 +2698,6 @@ declare class CheckboxFieldComponent {
|
|
|
2759
2698
|
readonly: boolean;
|
|
2760
2699
|
masked: boolean;
|
|
2761
2700
|
get label(): string;
|
|
2762
|
-
/**
|
|
2763
|
-
* Configured messages reach this field too.
|
|
2764
|
-
*
|
|
2765
|
-
* It rendered no error element at all, so a required checkbox left unticked told the user
|
|
2766
|
-
* nothing — and `validationMessages` could not reach a field that never displayed one.
|
|
2767
|
-
*/
|
|
2768
2701
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2769
2702
|
get hint(): string;
|
|
2770
2703
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2797,12 +2730,6 @@ declare class BooleanFieldComponent {
|
|
|
2797
2730
|
readonly: boolean;
|
|
2798
2731
|
masked: boolean;
|
|
2799
2732
|
get label(): string;
|
|
2800
|
-
/**
|
|
2801
|
-
* Configured messages reach this field too.
|
|
2802
|
-
*
|
|
2803
|
-
* It rendered no error element at all, so a required checkbox left unticked told the user
|
|
2804
|
-
* nothing — and `validationMessages` could not reach a field that never displayed one.
|
|
2805
|
-
*/
|
|
2806
2733
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2807
2734
|
get hint(): string;
|
|
2808
2735
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2831,22 +2758,12 @@ declare class DateFieldComponent {
|
|
|
2831
2758
|
/**
|
|
2832
2759
|
* ISO 8601 date → display string, through the formatter the host configured.
|
|
2833
2760
|
*
|
|
2834
|
-
*
|
|
2835
|
-
*
|
|
2836
|
-
* field but not this one. A host that configured formatters got them almost everywhere,
|
|
2837
|
-
* and silently did not get them on the field type most likely to be the reason they
|
|
2838
|
-
* configured formatters at all.
|
|
2761
|
+
* Never call `toLocaleDateString()` directly here: `setDateFormatters` is the one seam for
|
|
2762
|
+
* choosing how a date renders, and every date display has to go through it.
|
|
2839
2763
|
*
|
|
2840
|
-
* The default formatter is `toLocaleDateString()` with no locale
|
|
2841
|
-
* has not called `setDateFormatters` renders exactly what it rendered before.
|
|
2764
|
+
* The default formatter is `toLocaleDateString()` with no locale.
|
|
2842
2765
|
*/
|
|
2843
2766
|
formatDate(value: string | null): string;
|
|
2844
|
-
/**
|
|
2845
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2846
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2847
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2848
|
-
* of fifteen field types.
|
|
2849
|
-
*/
|
|
2850
2767
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2851
2768
|
get hint(): string;
|
|
2852
2769
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2897,12 +2814,6 @@ declare class DateTimeFieldComponent {
|
|
|
2897
2814
|
* handed on as ISO rather than the raw value.
|
|
2898
2815
|
*/
|
|
2899
2816
|
formatDateTime(value: unknown): string;
|
|
2900
|
-
/**
|
|
2901
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2902
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2903
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2904
|
-
* of fifteen field types.
|
|
2905
|
-
*/
|
|
2906
2817
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2907
2818
|
get hint(): string;
|
|
2908
2819
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2942,12 +2853,6 @@ declare class TimeFieldComponent {
|
|
|
2942
2853
|
* another in the record summary because the two drifted apart.
|
|
2943
2854
|
*/
|
|
2944
2855
|
formatTime(value: unknown): string;
|
|
2945
|
-
/**
|
|
2946
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2947
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2948
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2949
|
-
* of fifteen field types.
|
|
2950
|
-
*/
|
|
2951
2856
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
2952
2857
|
get hint(): string;
|
|
2953
2858
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -2990,12 +2895,6 @@ declare class MonthYearFieldComponent {
|
|
|
2990
2895
|
onMonthChange(month: string): void;
|
|
2991
2896
|
onYearChange(year: string): void;
|
|
2992
2897
|
formatValue(value: unknown): string;
|
|
2993
|
-
/**
|
|
2994
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
2995
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
2996
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
2997
|
-
* of fifteen field types.
|
|
2998
|
-
*/
|
|
2999
2898
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3000
2899
|
get hint(): string;
|
|
3001
2900
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -3038,10 +2937,7 @@ declare class DropdownFieldComponent {
|
|
|
3038
2937
|
* The value this option stores — the option object itself.
|
|
3039
2938
|
*
|
|
3040
2939
|
* Kept as a method rather than binding `option` straight into the template, because it is
|
|
3041
|
-
* the one place that says *why* the two are the same thing.
|
|
3042
|
-
* `getOptionStoredValue`, an exported identity function whose two branches returned their
|
|
3043
|
-
* argument unchanged; naming a transformation that does not happen is worse than naming
|
|
3044
|
-
* nothing, because a reader has to go and check.
|
|
2940
|
+
* the one place that says *why* the two are the same thing.
|
|
3045
2941
|
*/
|
|
3046
2942
|
getOptStoredVal(option: DropdownOption): unknown;
|
|
3047
2943
|
getOptLabel(option: DropdownOption): string;
|
|
@@ -3095,10 +2991,7 @@ declare class RadioFieldComponent implements OnDestroy {
|
|
|
3095
2991
|
* The value this option stores — the option object itself.
|
|
3096
2992
|
*
|
|
3097
2993
|
* Kept as a method rather than binding `option` straight into the template, because it is
|
|
3098
|
-
* the one place that says *why* the two are the same thing.
|
|
3099
|
-
* `getOptionStoredValue`, an exported identity function whose two branches returned their
|
|
3100
|
-
* argument unchanged; naming a transformation that does not happen is worse than naming
|
|
3101
|
-
* nothing, because a reader has to go and check.
|
|
2994
|
+
* the one place that says *why* the two are the same thing.
|
|
3102
2995
|
*/
|
|
3103
2996
|
getOptStoredVal(option: DropdownOption): unknown;
|
|
3104
2997
|
/**
|
|
@@ -3121,12 +3014,6 @@ declare class RadioFieldComponent implements OnDestroy {
|
|
|
3121
3014
|
isChecked(option: DropdownOption): boolean;
|
|
3122
3015
|
/** Read-only display — synchronous, per §6.2. See `DropdownFieldComponent.getLabel`. */
|
|
3123
3016
|
getSelectedLabel(): string;
|
|
3124
|
-
/**
|
|
3125
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
3126
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
3127
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
3128
|
-
* of fifteen field types.
|
|
3129
|
-
*/
|
|
3130
3017
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3131
3018
|
get hint(): string;
|
|
3132
3019
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -3166,21 +3053,12 @@ declare class MultiSelectFieldComponent {
|
|
|
3166
3053
|
* The value this option stores — the option object itself.
|
|
3167
3054
|
*
|
|
3168
3055
|
* Kept as a method rather than binding `option` straight into the template, because it is
|
|
3169
|
-
* the one place that says *why* the two are the same thing.
|
|
3170
|
-
* `getOptionStoredValue`, an exported identity function whose two branches returned their
|
|
3171
|
-
* argument unchanged; naming a transformation that does not happen is worse than naming
|
|
3172
|
-
* nothing, because a reader has to go and check.
|
|
3056
|
+
* the one place that says *why* the two are the same thing.
|
|
3173
3057
|
*/
|
|
3174
3058
|
getOptStoredVal(option: DropdownOption): unknown;
|
|
3175
3059
|
getOptLabel(option: DropdownOption): string;
|
|
3176
3060
|
/** Read-only display — synchronous, per §6.2. See `DropdownFieldComponent.getLabel`. */
|
|
3177
3061
|
getLabels(values: unknown): string;
|
|
3178
|
-
/**
|
|
3179
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
3180
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
3181
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
3182
|
-
* of fifteen field types.
|
|
3183
|
-
*/
|
|
3184
3062
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3185
3063
|
get hint(): string;
|
|
3186
3064
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -3243,12 +3121,6 @@ declare class EntityRefFieldComponent implements OnInit {
|
|
|
3243
3121
|
private parentValue;
|
|
3244
3122
|
/** Reload (and drop a stale selection) whenever the parent control changes. */
|
|
3245
3123
|
private watchParent;
|
|
3246
|
-
/**
|
|
3247
|
-
* Resolved through `ValidationMessagesService`, so `provideNgxDynamicEntity({
|
|
3248
|
-
* validationMessages })` reaches this field. It used to render a fixed
|
|
3249
|
-
* "This field has an error", which made a documented, configurable feature work on three
|
|
3250
|
-
* of fifteen field types.
|
|
3251
|
-
*/
|
|
3252
3124
|
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3253
3125
|
get hint(): string;
|
|
3254
3126
|
/** The ids of whatever is describing this control right now. */
|
|
@@ -3393,5 +3265,261 @@ declare class FileFieldComponent {
|
|
|
3393
3265
|
static ɵcmp: i0.ɵɵComponentDeclaration<FileFieldComponent, "ngx-file-field", never, { "field": { "alias": "field"; "required": false; }; "control": { "alias": "control"; "required": false; }; "language": { "alias": "language"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "masked": { "alias": "masked"; "required": false; }; }, {}, never, never, true, never>;
|
|
3394
3266
|
}
|
|
3395
3267
|
|
|
3396
|
-
|
|
3268
|
+
/**
|
|
3269
|
+
* URL field: a `type="url"` input, and a link when read-only.
|
|
3270
|
+
*
|
|
3271
|
+
* The read-only link is rendered only for a value that passes `isValidUrl`, meaning an http or
|
|
3272
|
+
* https address. A record can hold anything, including `javascript:`, and a field whose job is
|
|
3273
|
+
* to show an address must not turn a stored script into something to click. Anything else is
|
|
3274
|
+
* shown as plain text.
|
|
3275
|
+
*/
|
|
3276
|
+
declare class UrlFieldComponent {
|
|
3277
|
+
/**
|
|
3278
|
+
* Unique to this component instance: an `array` renders the same field once per row, and a
|
|
3279
|
+
* DOM id may not repeat. See `field-dom-id.ts`.
|
|
3280
|
+
*/
|
|
3281
|
+
private readonly instanceId;
|
|
3282
|
+
protected domId(suffix?: string): string;
|
|
3283
|
+
/** Overridable via MASKED_PLACEHOLDER; the default is the historic literal. */
|
|
3284
|
+
protected readonly maskedText: string;
|
|
3285
|
+
private readonly messages;
|
|
3286
|
+
field: NestedFieldConfig;
|
|
3287
|
+
control: AbstractControl;
|
|
3288
|
+
language: string;
|
|
3289
|
+
readonly: boolean;
|
|
3290
|
+
masked: boolean;
|
|
3291
|
+
get label(): string;
|
|
3292
|
+
get placeholder(): string;
|
|
3293
|
+
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3294
|
+
get hint(): string;
|
|
3295
|
+
/** Whether the stored value is an http(s) address, and so safe to render as a link. */
|
|
3296
|
+
get linkable(): boolean;
|
|
3297
|
+
/** The ids of whatever is describing this control right now. */
|
|
3298
|
+
protected describedBy(): string | null;
|
|
3299
|
+
get errorMessage(): string;
|
|
3300
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UrlFieldComponent, never>;
|
|
3301
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UrlFieldComponent, "ngx-url-field", never, { "field": { "alias": "field"; "required": false; }; "control": { "alias": "control"; "required": false; }; "language": { "alias": "language"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "masked": { "alias": "masked"; "required": false; }; }, {}, never, never, true, never>;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
/**
|
|
3305
|
+
* Phone field: a `type="tel"` input, and a `tel:` link when read-only.
|
|
3306
|
+
*
|
|
3307
|
+
* The value is stored exactly as typed, spaces and brackets included. The number is shown back
|
|
3308
|
+
* to people far more often than it is dialled, and `+44 20 7946 0958` is easier to read than
|
|
3309
|
+
* its digits run together. Only the link target is stripped down to what a dialler needs.
|
|
3310
|
+
*/
|
|
3311
|
+
declare class PhoneFieldComponent {
|
|
3312
|
+
/**
|
|
3313
|
+
* Unique to this component instance: an `array` renders the same field once per row, and a
|
|
3314
|
+
* DOM id may not repeat. See `field-dom-id.ts`.
|
|
3315
|
+
*/
|
|
3316
|
+
private readonly instanceId;
|
|
3317
|
+
protected domId(suffix?: string): string;
|
|
3318
|
+
/** Overridable via MASKED_PLACEHOLDER; the default is the historic literal. */
|
|
3319
|
+
protected readonly maskedText: string;
|
|
3320
|
+
private readonly messages;
|
|
3321
|
+
field: NestedFieldConfig;
|
|
3322
|
+
control: AbstractControl;
|
|
3323
|
+
language: string;
|
|
3324
|
+
readonly: boolean;
|
|
3325
|
+
masked: boolean;
|
|
3326
|
+
get label(): string;
|
|
3327
|
+
get placeholder(): string;
|
|
3328
|
+
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3329
|
+
get hint(): string;
|
|
3330
|
+
/** `tel:` plus the digits and a leading `+`, or null for a value that is not a phone number. */
|
|
3331
|
+
get dialHref(): string | null;
|
|
3332
|
+
/** The ids of whatever is describing this control right now. */
|
|
3333
|
+
protected describedBy(): string | null;
|
|
3334
|
+
get errorMessage(): string;
|
|
3335
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PhoneFieldComponent, never>;
|
|
3336
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PhoneFieldComponent, "ngx-phone-field", never, { "field": { "alias": "field"; "required": false; }; "control": { "alias": "control"; "required": false; }; "language": { "alias": "language"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "masked": { "alias": "masked"; "required": false; }; }, {}, never, never, true, never>;
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
/**
|
|
3340
|
+
* Slider field: a range input over `validators.min`–`validators.max` in steps of `field.step`.
|
|
3341
|
+
*
|
|
3342
|
+
* A range input cannot show that it is empty. With no value it puts the thumb at the midpoint,
|
|
3343
|
+
* which looks exactly like a chosen value. The readout beside it is therefore the value itself,
|
|
3344
|
+
* and shows a dash until someone moves the thumb. Without it, a required slider nobody touched
|
|
3345
|
+
* would look answered and still fail at save.
|
|
3346
|
+
*/
|
|
3347
|
+
declare class SliderFieldComponent {
|
|
3348
|
+
/**
|
|
3349
|
+
* Unique to this component instance: an `array` renders the same field once per row, and a
|
|
3350
|
+
* DOM id may not repeat. See `field-dom-id.ts`.
|
|
3351
|
+
*/
|
|
3352
|
+
private readonly instanceId;
|
|
3353
|
+
protected domId(suffix?: string): string;
|
|
3354
|
+
/** Overridable via MASKED_PLACEHOLDER; the default is the historic literal. */
|
|
3355
|
+
protected readonly maskedText: string;
|
|
3356
|
+
private readonly messages;
|
|
3357
|
+
field: NestedFieldConfig;
|
|
3358
|
+
control: AbstractControl;
|
|
3359
|
+
language: string;
|
|
3360
|
+
readonly: boolean;
|
|
3361
|
+
masked: boolean;
|
|
3362
|
+
get label(): string;
|
|
3363
|
+
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3364
|
+
get hint(): string;
|
|
3365
|
+
get bounds(): SliderBounds;
|
|
3366
|
+
/** Whether the control holds a number. The thumb's position cannot say. */
|
|
3367
|
+
get hasValue(): boolean;
|
|
3368
|
+
get display(): string;
|
|
3369
|
+
/** The ids of whatever is describing this control right now. */
|
|
3370
|
+
protected describedBy(): string | null;
|
|
3371
|
+
get errorMessage(): string;
|
|
3372
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SliderFieldComponent, never>;
|
|
3373
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SliderFieldComponent, "ngx-slider-field", never, { "field": { "alias": "field"; "required": false; }; "control": { "alias": "control"; "required": false; }; "language": { "alias": "language"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "masked": { "alias": "masked"; "required": false; }; }, {}, never, never, true, never>;
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
/**
|
|
3377
|
+
* Rating field: 1 to `validators.max` stars (default 5), stored as a number.
|
|
3378
|
+
*
|
|
3379
|
+
* Built from native radio inputs in a fieldset, not clickable spans. That gives it the
|
|
3380
|
+
* behaviour a radio group already has: arrow keys move the choice, Tab enters and leaves the
|
|
3381
|
+
* group once, and a screen reader announces "3 of 5, radio button, 3 of 5". Each star's
|
|
3382
|
+
* label is text a host can translate (`ratingValue`), because a star glyph read aloud is
|
|
3383
|
+
* "black star".
|
|
3384
|
+
*/
|
|
3385
|
+
declare class RatingFieldComponent implements OnDestroy {
|
|
3386
|
+
/**
|
|
3387
|
+
* Unique to this component instance: an `array` renders the same field once per row, and a
|
|
3388
|
+
* DOM id may not repeat. See `field-dom-id.ts`.
|
|
3389
|
+
*/
|
|
3390
|
+
private readonly instanceId;
|
|
3391
|
+
protected domId(suffix?: string): string;
|
|
3392
|
+
/** Overridable via MASKED_PLACEHOLDER; the default is the historic literal. */
|
|
3393
|
+
protected readonly maskedText: string;
|
|
3394
|
+
private readonly messages;
|
|
3395
|
+
private readonly cdr;
|
|
3396
|
+
protected readonly ui: UiTextService;
|
|
3397
|
+
field: NestedFieldConfig;
|
|
3398
|
+
language: string;
|
|
3399
|
+
readonly: boolean;
|
|
3400
|
+
masked: boolean;
|
|
3401
|
+
private _control;
|
|
3402
|
+
private _controlSub?;
|
|
3403
|
+
/**
|
|
3404
|
+
* Subscribed because the radios are not bound through a form directive. A value patched in
|
|
3405
|
+
* from outside (a reset, an autoPatch) would otherwise leave an OnPush view showing the old
|
|
3406
|
+
* stars.
|
|
3407
|
+
*/
|
|
3408
|
+
set control(value: AbstractControl);
|
|
3409
|
+
get control(): AbstractControl;
|
|
3410
|
+
ngOnDestroy(): void;
|
|
3411
|
+
get label(): string;
|
|
3412
|
+
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3413
|
+
get hint(): string;
|
|
3414
|
+
get scale(): number;
|
|
3415
|
+
get stars(): number[];
|
|
3416
|
+
/** The stored rating, or null when there is none or it is not a star on this scale. */
|
|
3417
|
+
get current(): number | null;
|
|
3418
|
+
select(star: number): void;
|
|
3419
|
+
clear(): void;
|
|
3420
|
+
/** The ids of whatever is describing this control right now. */
|
|
3421
|
+
protected describedBy(): string | null;
|
|
3422
|
+
get errorMessage(): string;
|
|
3423
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RatingFieldComponent, never>;
|
|
3424
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RatingFieldComponent, "ngx-rating-field", never, { "field": { "alias": "field"; "required": false; }; "language": { "alias": "language"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "masked": { "alias": "masked"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, true, never>;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
/**
|
|
3428
|
+
* Colour field: a native colour picker, storing `#rrggbb`.
|
|
3429
|
+
*
|
|
3430
|
+
* Like a range input, a colour input has no empty state and shows black. The code beside it is
|
|
3431
|
+
* therefore the real value, a dash until a colour is chosen, and a clear button sets the value
|
|
3432
|
+
* back to nothing. Without them, "no colour" and "black" would look the same.
|
|
3433
|
+
*
|
|
3434
|
+
* Only a value that passes `normalizeHexColor` reaches a `style` binding. A record can hold
|
|
3435
|
+
* any string, and a colour swatch is no place to interpret one.
|
|
3436
|
+
*/
|
|
3437
|
+
declare class ColorFieldComponent {
|
|
3438
|
+
/**
|
|
3439
|
+
* Unique to this component instance: an `array` renders the same field once per row, and a
|
|
3440
|
+
* DOM id may not repeat. See `field-dom-id.ts`.
|
|
3441
|
+
*/
|
|
3442
|
+
private readonly instanceId;
|
|
3443
|
+
protected domId(suffix?: string): string;
|
|
3444
|
+
/** Overridable via MASKED_PLACEHOLDER; the default is the historic literal. */
|
|
3445
|
+
protected readonly maskedText: string;
|
|
3446
|
+
private readonly messages;
|
|
3447
|
+
protected readonly ui: UiTextService;
|
|
3448
|
+
field: NestedFieldConfig;
|
|
3449
|
+
control: AbstractControl;
|
|
3450
|
+
language: string;
|
|
3451
|
+
readonly: boolean;
|
|
3452
|
+
masked: boolean;
|
|
3453
|
+
get label(): string;
|
|
3454
|
+
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3455
|
+
get hint(): string;
|
|
3456
|
+
/** The stored colour as `#rrggbb`, or null when there is none or it is not a colour. */
|
|
3457
|
+
get hex(): string | null;
|
|
3458
|
+
clear(): void;
|
|
3459
|
+
/** The ids of whatever is describing this control right now. */
|
|
3460
|
+
protected describedBy(): string | null;
|
|
3461
|
+
get errorMessage(): string;
|
|
3462
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColorFieldComponent, never>;
|
|
3463
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ColorFieldComponent, "ngx-color-field", never, { "field": { "alias": "field"; "required": false; }; "control": { "alias": "control"; "required": false; }; "language": { "alias": "language"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "masked": { "alias": "masked"; "required": false; }; }, {}, never, never, true, never>;
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
/**
|
|
3467
|
+
* Tags field: free text entered as a list of chips, stored as `string[]`.
|
|
3468
|
+
*
|
|
3469
|
+
* Unlike `multiSelect`, the values are whatever the user types, so there is no option list to
|
|
3470
|
+
* keep in step. Enter or a comma ends a tag, Backspace in an empty box removes the last one,
|
|
3471
|
+
* and pasted text is split on commas, semicolons and line breaks. Leaving the box commits
|
|
3472
|
+
* what is in it, so a tag someone typed and then tabbed away from is not silently lost.
|
|
3473
|
+
*
|
|
3474
|
+
* The control holds the array. The text box is only a draft, which is why it is not bound
|
|
3475
|
+
* with a form directive.
|
|
3476
|
+
*/
|
|
3477
|
+
declare class TagsFieldComponent implements OnDestroy {
|
|
3478
|
+
/**
|
|
3479
|
+
* Unique to this component instance: an `array` renders the same field once per row, and a
|
|
3480
|
+
* DOM id may not repeat. See `field-dom-id.ts`.
|
|
3481
|
+
*/
|
|
3482
|
+
private readonly instanceId;
|
|
3483
|
+
protected domId(suffix?: string): string;
|
|
3484
|
+
/** Overridable via MASKED_PLACEHOLDER; the default is the historic literal. */
|
|
3485
|
+
protected readonly maskedText: string;
|
|
3486
|
+
private readonly messages;
|
|
3487
|
+
private readonly cdr;
|
|
3488
|
+
protected readonly ui: UiTextService;
|
|
3489
|
+
field: NestedFieldConfig;
|
|
3490
|
+
language: string;
|
|
3491
|
+
readonly: boolean;
|
|
3492
|
+
masked: boolean;
|
|
3493
|
+
private _control;
|
|
3494
|
+
private _controlSub?;
|
|
3495
|
+
/** Subscribed for the same reason as the rating field: nothing here is a form directive. */
|
|
3496
|
+
set control(value: AbstractControl);
|
|
3497
|
+
get control(): AbstractControl;
|
|
3498
|
+
ngOnDestroy(): void;
|
|
3499
|
+
get label(): string;
|
|
3500
|
+
get placeholder(): string;
|
|
3501
|
+
/** Author help text, shown under the control and named by `aria-describedby`. */
|
|
3502
|
+
get hint(): string;
|
|
3503
|
+
/** The stored tags, read leniently. A record may hold a single string or anything else. */
|
|
3504
|
+
get tags(): string[];
|
|
3505
|
+
onKeydown(event: KeyboardEvent, entry: HTMLInputElement): void;
|
|
3506
|
+
onPaste(event: ClipboardEvent, entry: HTMLInputElement): void;
|
|
3507
|
+
onBlur(entry: HTMLInputElement): void;
|
|
3508
|
+
/** Add whatever is in the draft box, split on separators, and empty it. */
|
|
3509
|
+
commit(entry: HTMLInputElement): void;
|
|
3510
|
+
private add;
|
|
3511
|
+
remove(tag: string): void;
|
|
3512
|
+
/**
|
|
3513
|
+
* An empty list is stored as `[]`, not `null`. `required` treats both as empty, and `[]`
|
|
3514
|
+
* stays the same shape as every other value this field holds.
|
|
3515
|
+
*/
|
|
3516
|
+
private write;
|
|
3517
|
+
/** The ids of whatever is describing this control right now. */
|
|
3518
|
+
protected describedBy(): string | null;
|
|
3519
|
+
get errorMessage(): string;
|
|
3520
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TagsFieldComponent, never>;
|
|
3521
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TagsFieldComponent, "ngx-tags-field", never, { "field": { "alias": "field"; "required": false; }; "language": { "alias": "language"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "masked": { "alias": "masked"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, true, never>;
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
export { ASYNC_VALIDATOR_REGISTRY, ArrayFieldComponent, BooleanFieldComponent, COMMON_MODULES_REGISTRY, CONFIG_SOURCE, CascadeDataService, CheckboxFieldComponent, ColorFieldComponent, ConfigSourceService, CurrencyFieldComponent, DEFAULT_UI_TEXT, DEFAULT_VALIDATION_MESSAGES, DateFieldComponent, DateTimeFieldComponent, DropdownFieldComponent, DynamicFieldComponent, DynamicFormComponent, DynamicRecordFormComponent, ENTITY_REF_CACHE_STORE, ENTITY_REF_REGISTRY, EmailFieldComponent, EntityImportComponent, EntityRefFieldComponent, EntityRefRegistryService, EntityRefSelectionService, EntityReferenceService, FIELD_TYPE_REGISTRY, FIELD_TYPE_SETS, FieldRegistryService, FileFieldComponent, GroupFieldComponent, HOOK_REGISTRY, HookRegistryService, HttpImportTransport, IMPORT_TRANSPORT, ImageFieldComponent, ImportErrorsComponent, ImportMapperComponent, ImportPreviewComponent, ImportTemplateComponent, InMemoryEntityRefCacheStore, LOOKUP_REGISTRY, LocalImportTransport, LookupRegistryService, MARKDOWN_RENDERER, MASKED_PLACEHOLDER, MASKED_ROLES, MarkdownFieldComponent, MonthYearFieldComponent, MultiSelectFieldComponent, NumberFieldComponent, PasswordFieldComponent, PhoneFieldComponent, RECORD_MIGRATIONS, RadioFieldComponent, RatingFieldComponent, RbacService, RulesEvaluationService, SHEET_PARSER, SYSTEM_DEFAULT_CAN_EDIT, SliderFieldComponent, TagsFieldComponent, TextFieldComponent, TextareaFieldComponent, TimeFieldComponent, UI_TEXT, UPLOAD_HANDLER, UiTextService, UrlFieldComponent, VALIDATION_MESSAGES, VALIDATOR_REGISTRY, ValidationMessagesService, ValidatorRegistryService, builtInFieldTypes, defaultSheetParser, fieldDescribedBy, fieldDomId, nextFieldInstanceId, phoneValidator, provideBuiltInFieldTypes, provideFieldTypes, provideHttpImportTransport, provideNgxDynamicEntity, refreshChoiceOptions, resolveUiText, urlValidator };
|
|
3397
3525
|
export type { ChoiceOptionHost, ConfigSourceHandler, DynamicFieldComponentContract, EntityRefCacheStore, EntityRefSelection, HookFn, HttpImportTransportOptions, ImportContext, ImportPreview, ImportTransport, InvalidField, MessageOrderEntry, NgxDynamicEntityConfig, RuleSyncContext, SheetParser, TemplateFormat, UiTextKey, UiTextOverrides, UiTextOverridesFor, UiTextParams, UiTextResolver, UiTextResolverFor, UiTextValue, ValidationMessage };
|