@aquera/ngx-smart-table 0.0.39 → 0.0.41
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/package.json
CHANGED
|
@@ -2409,6 +2409,7 @@ interface OperatorDefinition {
|
|
|
2409
2409
|
* Fields are consumer-provided via ConditionBuilderConfig.fields.
|
|
2410
2410
|
* The library does not ship default fields.
|
|
2411
2411
|
*/
|
|
2412
|
+
|
|
2412
2413
|
/**
|
|
2413
2414
|
* Editor variant used to render a field's value input.
|
|
2414
2415
|
* - 'text' : free-form text, single value
|
|
@@ -2441,13 +2442,45 @@ interface FieldDefinition {
|
|
|
2441
2442
|
* builder config are allowed. Operator keys must match an OperatorDefinition.key.
|
|
2442
2443
|
*/
|
|
2443
2444
|
operators?: string[];
|
|
2444
|
-
/**
|
|
2445
|
+
/**
|
|
2446
|
+
* Predefined options for 'select' / 'multi-select'. Required for static
|
|
2447
|
+
* dropdowns. When `loadOptions` is also provided, this acts as the initial
|
|
2448
|
+
* (seed) list shown until the first async load resolves.
|
|
2449
|
+
*/
|
|
2445
2450
|
options?: FieldOption[];
|
|
2446
2451
|
/**
|
|
2447
2452
|
* Placeholder text shown in the value editor when nothing is selected.
|
|
2448
2453
|
* Falls back to a sensible default per editor type when omitted.
|
|
2449
2454
|
*/
|
|
2450
2455
|
valuePlaceholder?: string;
|
|
2456
|
+
/**
|
|
2457
|
+
* Show a search box inside the 'select' / 'multi-select' dropdown. Ignored
|
|
2458
|
+
* for 'text' and 'chip' editors.
|
|
2459
|
+
* @default true
|
|
2460
|
+
*/
|
|
2461
|
+
searchable?: boolean;
|
|
2462
|
+
/**
|
|
2463
|
+
* Async options provider for 'select' / 'multi-select' editors. When set, the
|
|
2464
|
+
* editor switches to server-side search: the dropdown's built-in client-side
|
|
2465
|
+
* filtering is turned off and this is invoked with the current search term —
|
|
2466
|
+
* once with `''` when the dropdown first opens, then again (debounced) on each
|
|
2467
|
+
* search keystroke. Return the options to display, as an Observable or Promise.
|
|
2468
|
+
*
|
|
2469
|
+
* While a load is in flight the dropdown shows a loading indicator. The static
|
|
2470
|
+
* `options` array (if any) is shown until the first load resolves. If the
|
|
2471
|
+
* loader errors, the currently shown options are left unchanged.
|
|
2472
|
+
*
|
|
2473
|
+
* @example
|
|
2474
|
+
* loadOptions: (q) => this.api.searchGroups(q) // returns Observable<FieldOption[]>
|
|
2475
|
+
*/
|
|
2476
|
+
loadOptions?: (search: string) => Observable<FieldOption[]> | Promise<FieldOption[]>;
|
|
2477
|
+
/**
|
|
2478
|
+
* Debounce (in ms) applied to search keystrokes before `loadOptions` fires.
|
|
2479
|
+
* The initial open-time load is not debounced. Only relevant when
|
|
2480
|
+
* `loadOptions` is set.
|
|
2481
|
+
* @default 300
|
|
2482
|
+
*/
|
|
2483
|
+
searchDebounceMs?: number;
|
|
2451
2484
|
}
|
|
2452
2485
|
/**
|
|
2453
2486
|
* Grouped fields shown as a submenu in the field picker. Matches the v1 admin-ui
|
|
@@ -6173,6 +6206,12 @@ declare class StConditionRuleComponent {
|
|
|
6173
6206
|
* sub-rules inside a group — v1's 1-level nesting forbids groups-in-groups).
|
|
6174
6207
|
*/
|
|
6175
6208
|
canInsertGroup: boolean;
|
|
6209
|
+
/**
|
|
6210
|
+
* True when this rule is a sub-condition inside a group. Only then does the
|
|
6211
|
+
* first row reserve the connector column (via a spacer) so the sub-conditions
|
|
6212
|
+
* align. Top-level rows are left flush — parent-level layout is unchanged.
|
|
6213
|
+
*/
|
|
6214
|
+
inGroup: boolean;
|
|
6176
6215
|
readonly ruleChange: EventEmitter<SubCondition>;
|
|
6177
6216
|
readonly remove: EventEmitter<void>;
|
|
6178
6217
|
/** User asked to insert a fresh peer Condition directly below this row. */
|
|
@@ -6193,13 +6232,13 @@ declare class StConditionRuleComponent {
|
|
|
6193
6232
|
onOperatorChange(event: Event): void;
|
|
6194
6233
|
onValueChange(value: ConditionValue): void;
|
|
6195
6234
|
onRemoveClick(): void;
|
|
6196
|
-
onInsertBelowClick(): void;
|
|
6235
|
+
onInsertBelowClick(event?: MouseEvent): void;
|
|
6197
6236
|
onAddMenuSelect(event: Event): void;
|
|
6198
6237
|
/** Pick a sensible default operator for a given field: first allowed operator. */
|
|
6199
6238
|
private pickDefaultOperator;
|
|
6200
6239
|
private emit;
|
|
6201
6240
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StConditionRuleComponent, never>;
|
|
6202
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StConditionRuleComponent, "st-condition-rule", never, { "rule": { "alias": "rule"; "required": true; }; "config": { "alias": "config"; "required": true; }; "isFirst": { "alias": "isFirst"; "required": false; }; "canRemove": { "alias": "canRemove"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "canInsertGroup": { "alias": "canInsertGroup"; "required": false; }; }, { "ruleChange": "ruleChange"; "remove": "remove"; "insertBelow": "insertBelow"; "insertGroupBelow": "insertGroupBelow"; }, never, never, true, never>;
|
|
6241
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StConditionRuleComponent, "st-condition-rule", never, { "rule": { "alias": "rule"; "required": true; }; "config": { "alias": "config"; "required": true; }; "isFirst": { "alias": "isFirst"; "required": false; }; "canRemove": { "alias": "canRemove"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "canInsertGroup": { "alias": "canInsertGroup"; "required": false; }; "inGroup": { "alias": "inGroup"; "required": false; }; }, { "ruleChange": "ruleChange"; "remove": "remove"; "insertBelow": "insertBelow"; "insertGroupBelow": "insertGroupBelow"; }, never, never, true, never>;
|
|
6203
6242
|
}
|
|
6204
6243
|
|
|
6205
6244
|
/**
|
|
@@ -6214,13 +6253,26 @@ declare class StConditionRuleComponent {
|
|
|
6214
6253
|
* Value is always handled as `string[]`. Single-value editors use the first array
|
|
6215
6254
|
* element; empty array means "no value".
|
|
6216
6255
|
*/
|
|
6217
|
-
declare class StConditionValueEditorComponent implements OnInit, OnDestroy {
|
|
6256
|
+
declare class StConditionValueEditorComponent implements OnInit, OnChanges, OnDestroy {
|
|
6218
6257
|
field?: FieldDefinition;
|
|
6219
6258
|
operator?: OperatorDefinition;
|
|
6220
6259
|
value: ConditionValue;
|
|
6221
6260
|
disabled: boolean;
|
|
6222
6261
|
readonly valueChange: EventEmitter<ConditionValue>;
|
|
6223
6262
|
private elementRef;
|
|
6263
|
+
private cdr;
|
|
6264
|
+
/**
|
|
6265
|
+
* Async-search state (only used when the field declares `loadOptions`).
|
|
6266
|
+
* - `asyncOptions` holds the latest server-fetched list; null means "not
|
|
6267
|
+
* loaded yet" and we fall back to the field's static `options`.
|
|
6268
|
+
* - `optionsLoading` drives nile-select's loading indicator.
|
|
6269
|
+
* - `loadedForAttribute` guards the one-time open-time load per field.
|
|
6270
|
+
*/
|
|
6271
|
+
asyncOptions: FieldOption[] | null;
|
|
6272
|
+
optionsLoading: boolean;
|
|
6273
|
+
private loadedForAttribute?;
|
|
6274
|
+
private searchTimer;
|
|
6275
|
+
private inFlight;
|
|
6224
6276
|
/** Open/close + highlighted-option state for the slotted-trigger select. */
|
|
6225
6277
|
private dropdownOpen;
|
|
6226
6278
|
private highlightedIndex;
|
|
@@ -6231,6 +6283,14 @@ declare class StConditionValueEditorComponent implements OnInit, OnDestroy {
|
|
|
6231
6283
|
private activeHost;
|
|
6232
6284
|
constructor();
|
|
6233
6285
|
ngOnInit(): void;
|
|
6286
|
+
/**
|
|
6287
|
+
* Reset the async-search state whenever the bound field switches to a
|
|
6288
|
+
* different attribute. The component instance is reused across rule edits
|
|
6289
|
+
* (Angular rebinds `[field]`), so stale fetched options / loading flags from
|
|
6290
|
+
* the previous field must be cleared, and the next open re-triggers the
|
|
6291
|
+
* initial load.
|
|
6292
|
+
*/
|
|
6293
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
6234
6294
|
/**
|
|
6235
6295
|
* Host class flag — when true, the value editor host stretches to take the
|
|
6236
6296
|
* remaining flex space in the rule (so the chip can grow up to the row's
|
|
@@ -6242,6 +6302,21 @@ declare class StConditionValueEditorComponent implements OnInit, OnDestroy {
|
|
|
6242
6302
|
get hidden(): boolean;
|
|
6243
6303
|
/** Placeholder for the current editor — field override wins, else a sensible default per editor type. */
|
|
6244
6304
|
get placeholder(): string;
|
|
6305
|
+
/**
|
|
6306
|
+
* Whether the select / multi-select dropdown shows its search box. Defaults
|
|
6307
|
+
* to true (the field opts out with `searchable: false`). Server-side search
|
|
6308
|
+
* always needs the box, so a field that declares `loadOptions` keeps it on
|
|
6309
|
+
* regardless of the flag.
|
|
6310
|
+
*/
|
|
6311
|
+
get searchEnabled(): boolean;
|
|
6312
|
+
/** True when the field provides an async `loadOptions` callback. */
|
|
6313
|
+
get serverSearch(): boolean;
|
|
6314
|
+
/**
|
|
6315
|
+
* Options rendered into the dropdown. For server-side search this is the
|
|
6316
|
+
* latest fetched list (falling back to the field's static seed list until
|
|
6317
|
+
* the first load resolves); otherwise it's just the static `options`.
|
|
6318
|
+
*/
|
|
6319
|
+
get displayOptions(): FieldOption[];
|
|
6245
6320
|
/** Convenience: first element for single-value editors. */
|
|
6246
6321
|
get singleValue(): string;
|
|
6247
6322
|
/**
|
|
@@ -6283,6 +6358,22 @@ declare class StConditionValueEditorComponent implements OnInit, OnDestroy {
|
|
|
6283
6358
|
* (it lives for the component's lifetime).
|
|
6284
6359
|
*/
|
|
6285
6360
|
onSelectShow(event: Event): void;
|
|
6361
|
+
/**
|
|
6362
|
+
* nile-select fires `nile-search` (with `detail.query`) on every keystroke in
|
|
6363
|
+
* its search box. For server-side search we debounce and re-fetch; when the
|
|
6364
|
+
* field has no `loadOptions` callback the dropdown's built-in client-side
|
|
6365
|
+
* filter handles it and this is a no-op.
|
|
6366
|
+
*/
|
|
6367
|
+
onSelectSearch(event: Event): void;
|
|
6368
|
+
/**
|
|
6369
|
+
* Invoke the field's `loadOptions(query)` and adopt the result. Normalises
|
|
6370
|
+
* the Observable-or-Promise return via `from()`, cancels any in-flight
|
|
6371
|
+
* request (latest-wins), and shows nile-select's loading indicator while the
|
|
6372
|
+
* fetch runs. A failed load leaves the current options untouched.
|
|
6373
|
+
*/
|
|
6374
|
+
private fetchOptions;
|
|
6375
|
+
/** Cancel any pending debounce timer and in-flight options request. */
|
|
6376
|
+
private cancelLoad;
|
|
6286
6377
|
/**
|
|
6287
6378
|
* Nile emits `nile-hide` when its dropdown closes — for any reason (Esc,
|
|
6288
6379
|
* click-outside, single-select pick, programmatic .hide()). Returning focus
|