@genesislcap/foundation-ui 14.488.2 → 14.489.0-GENC-1351.10
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/dist/custom-elements.json +1412 -680
- package/dist/dts/combobox/combobox.d.ts +25 -0
- package/dist/dts/combobox/combobox.d.ts.map +1 -1
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/options-datasource/options-datasource.d.ts +69 -0
- package/dist/dts/options-datasource/options-datasource.d.ts.map +1 -1
- package/dist/dts/react.d.ts +15 -13
- package/dist/dts/select/select.d.ts +8 -0
- package/dist/dts/select/select.d.ts.map +1 -1
- package/dist/dts/utils/base-datasource.d.ts +37 -1
- package/dist/dts/utils/base-datasource.d.ts.map +1 -1
- package/dist/dts/utils/event-types.d.ts +9 -0
- package/dist/dts/utils/event-types.d.ts.map +1 -0
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/esm/combobox/combobox.js +38 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/options-datasource/options-datasource.js +236 -29
- package/dist/esm/select/select.js +12 -0
- package/dist/esm/utils/base-datasource.js +132 -3
- package/dist/esm/utils/event-types.js +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/foundation-ui.api.json +370 -7
- package/dist/foundation-ui.d.ts +148 -1
- package/dist/react.cjs +37 -13
- package/dist/react.mjs +34 -10
- package/package.json +19 -19
|
@@ -5,6 +5,7 @@ import { FilterMode } from './combobox.types';
|
|
|
5
5
|
* @tagname %%prefix%%-combobox
|
|
6
6
|
*
|
|
7
7
|
* @fires change - Fired when a selection is confirmed in autocomplete-both mode
|
|
8
|
+
* @fires open-change - Fired when the dropdown opens or closes. detail: `OpenChangeEventDetail`
|
|
8
9
|
*/
|
|
9
10
|
export declare class Combobox extends FASTComboBox {
|
|
10
11
|
#private;
|
|
@@ -12,6 +13,16 @@ export declare class Combobox extends FASTComboBox {
|
|
|
12
13
|
private needManualChangeEventDispatch;
|
|
13
14
|
get activeDescendant(): string;
|
|
14
15
|
slottedDatasource: HTMLSlotElement;
|
|
16
|
+
/**
|
|
17
|
+
* Enables server-side filtering: typed input refetches from the server with a criteria
|
|
18
|
+
* instead of filtering the already-loaded options client-side.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Automatically forced to `true` (overriding an explicit `async="false"`) when the
|
|
22
|
+
* slotted datasource has `infinite-scroll` enabled — see
|
|
23
|
+
* {@link Combobox.enableAsyncForInfiniteScrollDatasource}. With only a page of the
|
|
24
|
+
* resource loaded, client-side filtering would silently only search that page.
|
|
25
|
+
*/
|
|
15
26
|
async: boolean;
|
|
16
27
|
debounce: number;
|
|
17
28
|
debounceChanged(oldValue: any, newValue: number): void;
|
|
@@ -42,10 +53,24 @@ export declare class Combobox extends FASTComboBox {
|
|
|
42
53
|
* @experimental
|
|
43
54
|
*/
|
|
44
55
|
scrollWhenSelectionChangesOptions: boolean | ScrollIntoViewOptions;
|
|
56
|
+
/**
|
|
57
|
+
* The scrollable element hosting the dropdown options. Part of the public contract for
|
|
58
|
+
* slotted datasources (e.g. options-datasource infinite scroll) to observe scrolling.
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
get scrollableListbox(): HTMLElement | null;
|
|
45
62
|
openChanged(): void;
|
|
46
63
|
get value(): string;
|
|
47
64
|
set value(next: string);
|
|
48
65
|
slottedOptionsChanged(prev: Element[] | undefined, next: Element[]): void;
|
|
66
|
+
/**
|
|
67
|
+
* When the slotted datasource pages its options (infinite scroll), only a page of the
|
|
68
|
+
* resource is loaded client-side, so filtering typed input locally is meaningless.
|
|
69
|
+
* Switch to async mode so input refetches from the server with a criteria instead;
|
|
70
|
+
* further pages honour that criteria. This overrides an explicit `async="false"` on
|
|
71
|
+
* the combobox — infinite-scroll datasources cannot support client-side filtering.
|
|
72
|
+
*/
|
|
73
|
+
private enableAsyncForInfiniteScrollDatasource;
|
|
49
74
|
filterOptions(): void;
|
|
50
75
|
clickHandler(e: MouseEvent): boolean | void;
|
|
51
76
|
keydownHandler(e: KeyboardEvent): boolean | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/combobox/combobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/combobox/combobox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAclE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,YAAY;;IACxC,OAAO,CAAC,SAAS,CAAS;IAI1B,OAAO,CAAC,6BAA6B,CAAkB;IACvD,IACI,gBAAgB,WAKnB;IAEW,iBAAiB,EAAE,eAAe,CAAC;IAC/C;;;;;;;;;OASG;IACwB,KAAK,UAAS;IACnC,QAAQ,EAAE,MAAM,CAAiB;IACvC,eAAe,CAAC,QAAQ,KAAA,EAAE,QAAQ,EAAE,MAAM;IAG1C,qBAAqB,MAAC;IACtB,iFAAiF;IAE1E,aAAa,EAAE,OAAO,CAAS;IAEtC,wFAAwF;IAEjF,gBAAgB,EAAE,OAAO,CAAS;IAEzC,2DAA2D;IAEpD,UAAU,EAAE,UAAU,CAAgB;IAE7C;;;OAGG;IAEH,2BAA2B,EAAE,OAAO,CAAS;IAE7C;;;OAGG;IAEH,kCAAkC,EAAE,OAAO,GAAG,qBAAqB,CAGjE;IAEF;;;OAGG;IAEH,0BAA0B,EAAE,OAAO,CAAS;IAE5C;;;OAGG;IAEH,iCAAiC,EAAE,OAAO,GAAG,qBAAqB,CAGhE;IAEF;;;;OAIG;IACH,IAAW,iBAAiB,IAAI,WAAW,GAAG,IAAI,CAEjD;IAED,WAAW;IAqBX,IAAW,KAAK,IAKO,MAAM,CAF5B;IAED,IAAW,KAAK,CAAC,IAAI,EAAE,MAAM,EA6B5B;IAEe,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAOzF;;;;;;OAMG;IACH,OAAO,CAAC,sCAAsC;IAY9B,aAAa,IAAI,IAAI;IAmBrB,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI;IAuB3C,cAAc,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;IAgDhD,YAAY,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;IAgC9D;;;;OAIG;IACH,SAAS,KAAK,SAAS,IAAI,OAAO,CAGjC;IAED;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM;IAKhC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI;IAQpD,cAAc;IAmBd,aAAa,aAOX;IAEF,OAAO,CAAC,2BAA2B;CAUpC;AAGD,eAAO,MAAM,+BAA+B,EAAE,cAG7C,CAAC;AAEF,eAAO,MAAM,qBAAqB;;CAajC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,8SAM7B,CAAC"}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -99,5 +99,6 @@ export * from './tree-view';
|
|
|
99
99
|
export * from './url-input';
|
|
100
100
|
export * from './utils/base-datasource';
|
|
101
101
|
export * from './utils/editable-elements';
|
|
102
|
+
export * from './utils/event-types';
|
|
102
103
|
export { getPrefix as getDesignSystemPrefix } from './utils/dom';
|
|
103
104
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/d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AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GenesisResources } from '@genesislcap/foundation-comms';
|
|
1
2
|
import type { Combobox } from '../combobox';
|
|
2
3
|
import type { Select } from '../select';
|
|
3
4
|
import { BaseDatasource } from '../utils';
|
|
@@ -18,11 +19,30 @@ export interface ValueChangeEventDetail {
|
|
|
18
19
|
* @fires value-change - Fired when the selected value changes. detail: `ValueChangeEventDetail`
|
|
19
20
|
*/
|
|
20
21
|
export declare class OptionsDatasource extends BaseDatasource {
|
|
22
|
+
resources: GenesisResources;
|
|
21
23
|
labelField: string;
|
|
22
24
|
optionElement: string;
|
|
23
25
|
valueField: string;
|
|
24
26
|
emptyDataLabel: string;
|
|
25
27
|
allowCustomOptions: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Enables infinite scrolling. Instead of loading everything upfront, only `page-size`
|
|
30
|
+
* options are loaded initially and the next page is requested when the user scrolls near
|
|
31
|
+
* the bottom of the dropdown. REQUEST_SERVER resources page by OFFSET; DATASERVER
|
|
32
|
+
* resources page via MORE_ROWS on a live stream (total still capped by `maxView`).
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* When paging REQUEST_SERVER resources by OFFSET, set a stable `order-by` — without one
|
|
36
|
+
* the server has no other guaranteed ordering between requests, so rows can shift across
|
|
37
|
+
* pages (duplicates/gaps) as the underlying data changes between fetches. Also, when the
|
|
38
|
+
* parent is a combobox, this forces `async` mode on it (see `Combobox.async`), since only
|
|
39
|
+
* a page of options is loaded client-side.
|
|
40
|
+
*/
|
|
41
|
+
infiniteScroll: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Number of options fetched per page when `infinite-scroll` is enabled. Defaults to 20.
|
|
44
|
+
*/
|
|
45
|
+
pageSize: number;
|
|
26
46
|
labelFormatter: any;
|
|
27
47
|
labelRowFormatter: (any: any) => string;
|
|
28
48
|
initialSelectedValue: string | number;
|
|
@@ -36,20 +56,69 @@ export declare class OptionsDatasource extends BaseDatasource {
|
|
|
36
56
|
}[];
|
|
37
57
|
baseCriteria: string;
|
|
38
58
|
private resizeObserver;
|
|
59
|
+
private static readonly defaultPageSize;
|
|
60
|
+
/**
|
|
61
|
+
* Distance from the bottom of the listbox (in px) at which the next page is requested.
|
|
62
|
+
*/
|
|
63
|
+
private static readonly scrollLoadThresholdPx;
|
|
64
|
+
private listboxElement;
|
|
65
|
+
private loadingMoreRows;
|
|
66
|
+
private renderedOptionsCount;
|
|
67
|
+
private lastTopUpScrollHeight;
|
|
68
|
+
private emptyDataOption;
|
|
39
69
|
connectedCallback(): Promise<void>;
|
|
40
70
|
disconnectedCallback(): void;
|
|
71
|
+
/**
|
|
72
|
+
* While the dropdown is closed, the listbox has no dimensions and cannot be scrolled,
|
|
73
|
+
* so re-check whether the visible listbox needs topping up every time it opens. Also
|
|
74
|
+
* retries attaching the scroll listener if the initial attempt (queued on connect)
|
|
75
|
+
* missed the listbox because the host hadn't rendered it yet.
|
|
76
|
+
*/
|
|
77
|
+
private selectOpenChangeHandler;
|
|
78
|
+
/**
|
|
79
|
+
* REQUEST_SERVER resources page by OFFSET against one-shot requests, so they keep the
|
|
80
|
+
* default snapshot mode. DATASERVER resources page via MORE_ROWS, which needs the live
|
|
81
|
+
* stream's SOURCE_REF, so they switch to stream mode.
|
|
82
|
+
*/
|
|
83
|
+
private applyInfiniteScrollFetchMode;
|
|
84
|
+
private attachListboxScrollListener;
|
|
85
|
+
private listboxScrollHandler;
|
|
86
|
+
private loadNextPage;
|
|
87
|
+
/**
|
|
88
|
+
* If the loaded options don't fill the visible listbox (so it can't be scrolled),
|
|
89
|
+
* keep requesting pages until it overflows or the server runs out of rows.
|
|
90
|
+
*/
|
|
91
|
+
private topUpVisibleListbox;
|
|
41
92
|
private resizeObserverCallback;
|
|
42
93
|
selectChangeHandler: (e: any) => void;
|
|
43
94
|
fetchData(): void;
|
|
44
95
|
asyncModeIntialization(): Promise<void>;
|
|
45
96
|
clearData(): void;
|
|
46
97
|
private checkOverflow;
|
|
98
|
+
private rowToOption;
|
|
99
|
+
private renderListboxOptions;
|
|
100
|
+
private removeEmptyDataOption;
|
|
47
101
|
syncComponentData(snapshotData?: any[]): void;
|
|
48
102
|
getInitialLabel(): string;
|
|
49
103
|
private getDisplayForValue;
|
|
50
104
|
resetCombobox(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Appends rows to the already rendered options. Used by REQUEST_SERVER
|
|
107
|
+
* infinite scroll paging, where each page contains only the new rows.
|
|
108
|
+
*/
|
|
51
109
|
handleStreamInserts(insertedRows: any[]): void;
|
|
110
|
+
/**
|
|
111
|
+
* @remarks
|
|
112
|
+
* Not implemented: rendered options are only ever appended (see `syncComponentData` /
|
|
113
|
+
* `handleStreamInserts`). For DATASERVER `infinite-scroll`, a live delete/update on a
|
|
114
|
+
* row already rendered in an open dropdown will not be reflected until the datasource
|
|
115
|
+
* is refetched (e.g. criteria change) — tracked as a known limitation, not a v1 goal.
|
|
116
|
+
*/
|
|
52
117
|
handleStreamDeletes(deletedRows: any[]): void;
|
|
118
|
+
/**
|
|
119
|
+
* @remarks
|
|
120
|
+
* Not implemented — see {@link OptionsDatasource.handleStreamDeletes}.
|
|
121
|
+
*/
|
|
53
122
|
handleStreamUpdates(updatedRows: any[]): void;
|
|
54
123
|
}
|
|
55
124
|
//# sourceMappingURL=options-datasource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-datasource.d.ts","sourceRoot":"","sources":["../../../src/options-datasource/options-datasource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options-datasource.d.ts","sourceRoot":"","sources":["../../../src/options-datasource/options-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,+BAA+B,CAAC;AAY/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,cAAc,EAKf,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,qBAGa,iBAAkB,SAAQ,cAAc;IACjC,SAAS,EAAG,gBAAgB,CAAC;IAEX,UAAU,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAyB;IAC1B,kBAAkB,UAAS;IAEzF;;;;;;;;;;;;OAYG;IACsD,cAAc,UAAS;IAEhF;;OAEG;IAEH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,iBAAiB,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE;IAuDtC,eAAe;IAIf,OAAO,CAAC,kBAAkB;IAS1B,aAAa;IAMb;;;OAGG;IACH,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,GAAG,IAAI;IAc9C;;;;;;OAMG;IACH,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI;IAI7C;;;OAGG;IACH,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI;CAG9C"}
|
package/dist/dts/react.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ import type { Tooltip as TooltipWC } from './tooltip/tooltip';
|
|
|
100
100
|
import type { TreeView as TreeViewWC } from './tree-view/tree-view';
|
|
101
101
|
import type { UrlInput as UrlInputWC } from './url-input/url-input';
|
|
102
102
|
import type { AddGroupEventDetail, AddRuleEventDetail, DelGroupEventDetail, DelRuleEventDetail, UpdateGroupEventDetail, UpdateRuleEventDetail } from '@genesislcap/expression-builder';
|
|
103
|
-
import type { ClearOptions, DailyConfig, FileReadEventDetail, FileSelectedEventDetail, FilterChangedEventDetail, FilterClearedEventDetail, MonthlyConfig, MultiselectOption, SelectedOption, StepClickEventDetail, ValidationError, ValidationFailureEventDetail, ValueChangeEventDetail, WeeklyConfig, YearlyConfig } from '@genesislcap/foundation-ui';
|
|
103
|
+
import type { ClearOptions, DailyConfig, FileReadEventDetail, FileSelectedEventDetail, FilterChangedEventDetail, FilterClearedEventDetail, MonthlyConfig, MultiselectOption, OpenChangeEventDetail, SelectedOption, StepClickEventDetail, ValidationError, ValidationFailureEventDetail, ValueChangeEventDetail, WeeklyConfig, YearlyConfig } from '@genesislcap/foundation-ui';
|
|
104
104
|
|
|
105
105
|
/** @internal Maps a web component class to its public props only.
|
|
106
106
|
* keyof T skips private/protected members, so this avoids the TS error
|
|
@@ -131,14 +131,14 @@ interface HTMLWCProps extends React.AriaAttributes {
|
|
|
131
131
|
onInput?(e: Event): void;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
export declare const
|
|
134
|
+
export declare const ActionsMenu: React.ForwardRefExoticComponent<
|
|
135
135
|
React.PropsWithChildren<
|
|
136
|
-
Omit<PublicOf<
|
|
136
|
+
Omit<PublicOf<ActionsMenuWC>, 'children' | 'style'> &
|
|
137
137
|
HTMLWCProps & {
|
|
138
138
|
}
|
|
139
|
-
> & React.RefAttributes<
|
|
139
|
+
> & React.RefAttributes<ActionsMenuWC>
|
|
140
140
|
>;
|
|
141
|
-
export type
|
|
141
|
+
export type ActionsMenuRef = ActionsMenuWC;
|
|
142
142
|
|
|
143
143
|
export declare const AccordionItem: React.ForwardRefExoticComponent<
|
|
144
144
|
React.PropsWithChildren<
|
|
@@ -149,14 +149,14 @@ export declare const AccordionItem: React.ForwardRefExoticComponent<
|
|
|
149
149
|
>;
|
|
150
150
|
export type AccordionItemRef = AccordionItemWC;
|
|
151
151
|
|
|
152
|
-
export declare const
|
|
152
|
+
export declare const AiIndicator: React.ForwardRefExoticComponent<
|
|
153
153
|
React.PropsWithChildren<
|
|
154
|
-
Omit<PublicOf<
|
|
154
|
+
Omit<PublicOf<AiIndicatorWC>, 'children' | 'style'> &
|
|
155
155
|
HTMLWCProps & {
|
|
156
156
|
}
|
|
157
|
-
> & React.RefAttributes<
|
|
157
|
+
> & React.RefAttributes<AiIndicatorWC>
|
|
158
158
|
>;
|
|
159
|
-
export type
|
|
159
|
+
export type AiIndicatorRef = AiIndicatorWC;
|
|
160
160
|
|
|
161
161
|
export declare const AiCriteriaSearch: React.ForwardRefExoticComponent<
|
|
162
162
|
React.PropsWithChildren<
|
|
@@ -169,14 +169,14 @@ export declare const AiCriteriaSearch: React.ForwardRefExoticComponent<
|
|
|
169
169
|
>;
|
|
170
170
|
export type AiCriteriaSearchRef = AiCriteriaSearchWC;
|
|
171
171
|
|
|
172
|
-
export declare const
|
|
172
|
+
export declare const Accordion: React.ForwardRefExoticComponent<
|
|
173
173
|
React.PropsWithChildren<
|
|
174
|
-
Omit<PublicOf<
|
|
174
|
+
Omit<PublicOf<AccordionWC>, 'children' | 'style'> &
|
|
175
175
|
HTMLWCProps & {
|
|
176
176
|
}
|
|
177
|
-
> & React.RefAttributes<
|
|
177
|
+
> & React.RefAttributes<AccordionWC>
|
|
178
178
|
>;
|
|
179
|
-
export type
|
|
179
|
+
export type AccordionRef = AccordionWC;
|
|
180
180
|
|
|
181
181
|
export declare const Anchor: React.ForwardRefExoticComponent<
|
|
182
182
|
React.PropsWithChildren<
|
|
@@ -294,6 +294,7 @@ export declare const Combobox: React.ForwardRefExoticComponent<
|
|
|
294
294
|
React.PropsWithChildren<
|
|
295
295
|
Omit<PublicOf<ComboboxWC>, 'children' | 'style'> &
|
|
296
296
|
HTMLWCProps & {
|
|
297
|
+
onOpenChange?: (event: CustomEvent<OpenChangeEventDetail>) => void;
|
|
297
298
|
}
|
|
298
299
|
> & React.RefAttributes<ComboboxWC>
|
|
299
300
|
>;
|
|
@@ -823,6 +824,7 @@ export declare const Select: React.ForwardRefExoticComponent<
|
|
|
823
824
|
React.PropsWithChildren<
|
|
824
825
|
Omit<PublicOf<SelectWC>, 'children' | 'style'> &
|
|
825
826
|
HTMLWCProps & {
|
|
827
|
+
onOpenChange?: (event: CustomEvent<OpenChangeEventDetail>) => void;
|
|
826
828
|
}
|
|
827
829
|
> & React.RefAttributes<SelectWC>
|
|
828
830
|
>;
|
|
@@ -2,8 +2,16 @@ import { Select as FASTSelect } from '@microsoft/fast-components';
|
|
|
2
2
|
import type { ListboxOption, SelectOptions } from '@microsoft/fast-foundation';
|
|
3
3
|
/**
|
|
4
4
|
* @tagname %%prefix%%-select
|
|
5
|
+
*
|
|
6
|
+
* @fires open-change - Fired when the dropdown opens or closes. detail: `OpenChangeEventDetail`
|
|
5
7
|
*/
|
|
6
8
|
export declare class Select extends FASTSelect {
|
|
9
|
+
/**
|
|
10
|
+
* The scrollable element hosting the dropdown options. Part of the public contract for
|
|
11
|
+
* slotted datasources (e.g. options-datasource infinite scroll) to observe scrolling.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
get scrollableListbox(): HTMLElement | null;
|
|
7
15
|
/**
|
|
8
16
|
* @internal
|
|
9
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAK/E
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAK/E;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC;;;;OAIG;IACH,IAAW,iBAAiB,IAAI,WAAW,GAAG,IAAI,CAEjD;IAED;;OAEG;IACa,qBAAqB,CACnC,IAAI,EAAE,WAAW,EAAE,GAAG,SAAS,EAC/B,IAAI,EAAE,WAAW,EAAE,GAClB,IAAI;IAqCP;;;;;OAKG;IACH,SAAS,CAAC,4BAA4B,CACpC,aAAa,GAAE,aAAa,GAAG,IAA+B,GAC7D,IAAI;IAcE,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI;IAyB3D,cAAc,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;CAoB1D;AAGD,eAAO,MAAM,6BAA6B,EAAE,cAA0B,CAAC;AAEvE,eAAO,MAAM,mBAAmB;;CAa/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,0SAM3B,CAAC"}
|
|
@@ -379,6 +379,12 @@ export declare abstract class BaseDatasource extends BaseDatasource_base {
|
|
|
379
379
|
isSnapshot: boolean;
|
|
380
380
|
maxRows: number;
|
|
381
381
|
maxView: number;
|
|
382
|
+
/**
|
|
383
|
+
* Sort field(s) for the resource. When using OFFSET-based paging (e.g.
|
|
384
|
+
* `options-datasource`'s `infinite-scroll`), the server has no other guaranteed row
|
|
385
|
+
* ordering between requests, so a stable `orderBy` is required to avoid rows shifting
|
|
386
|
+
* across pages (duplicates/gaps) as the underlying data changes between fetches.
|
|
387
|
+
*/
|
|
382
388
|
orderBy: string;
|
|
383
389
|
request: any;
|
|
384
390
|
requestChanged(oldValue: any, newValue: any): void;
|
|
@@ -394,7 +400,15 @@ export declare abstract class BaseDatasource extends BaseDatasource_base {
|
|
|
394
400
|
set datasourceConfig(config: DatasourceOptions);
|
|
395
401
|
requiresFullDataRefresh: boolean;
|
|
396
402
|
dataSub: Subscription;
|
|
397
|
-
|
|
403
|
+
protected sourceRef: string;
|
|
404
|
+
/**
|
|
405
|
+
* Whether the server reported more rows are available beyond the ones already fetched.
|
|
406
|
+
*/
|
|
407
|
+
protected moreRowsAvailable: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* The OFFSET to request the next page from, for REQUEST_SERVER paging.
|
|
410
|
+
*/
|
|
411
|
+
protected nextRequestOffset: number;
|
|
398
412
|
rowsSyncedWithStream: Map<string, any>;
|
|
399
413
|
dataSubWasLoggedOff: boolean;
|
|
400
414
|
private criteriaFromFilters;
|
|
@@ -409,6 +423,28 @@ export declare abstract class BaseDatasource extends BaseDatasource_base {
|
|
|
409
423
|
abstract handleStreamUpdates(updatedRows: any[]): void;
|
|
410
424
|
fetchGenesisData(withFullInit?: boolean): Promise<void>;
|
|
411
425
|
initDatasource(): Promise<void>;
|
|
426
|
+
/**
|
|
427
|
+
* Whether a further page of rows can be requested from the server.
|
|
428
|
+
* @public
|
|
429
|
+
*/
|
|
430
|
+
canRequestMoreRows(): boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Requests the next page of rows (up to `maxRows`) from the server.
|
|
433
|
+
*
|
|
434
|
+
* @remarks
|
|
435
|
+
* For DATASERVER resources a MORE_ROWS message is sent against the active stream's view and
|
|
436
|
+
* the rows are delivered as inserts on the existing stream subscription. For REQUEST_SERVER
|
|
437
|
+
* resources the next page is requested by OFFSET and delivered via `handleStreamInserts`.
|
|
438
|
+
* @public
|
|
439
|
+
*/
|
|
440
|
+
requestMoreRows(): Promise<void>;
|
|
441
|
+
/**
|
|
442
|
+
* Row extraction identical to `Datasource.snapshotFiltered`, kept local so the raw
|
|
443
|
+
* response (with MORE_ROWS/NEXT_OFFSET paging metadata) remains available.
|
|
444
|
+
*/
|
|
445
|
+
private filterSnapshotResult;
|
|
446
|
+
private updateRequestPagingState;
|
|
447
|
+
private initialRequestOffset;
|
|
412
448
|
private datasourceOptions;
|
|
413
449
|
private handleStreamUpdate;
|
|
414
450
|
applyRequestServerData(requestServerResult: RequestServerResult): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-datasource.d.ts","sourceRoot":"","sources":["../../../src/utils/base-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EAGV,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,wBAAwB,
|
|
1
|
+
{"version":3,"file":"base-datasource.d.ts","sourceRoot":"","sources":["../../../src/utils/base-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,UAAU,EAGV,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,wBAAwB,EAKxB,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EAAU,OAAO,EAAE,MAAM,UAAU,CAAC;AAO3C,MAAM,WAAW,kCAAkC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,EAAE,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kBAAkB,IAAI,OAAO;IAiBpC;;;;;;;;OAQG;IACU,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IA+C7C;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,kBAAkB;IAYnB,sBAAsB,CAAC,mBAAmB,EAAE,mBAAmB;IAqC/D,mBAAmB,CAAC,gBAAgB,EAAE,wBAAwB;IAwBrE,OAAO,CAAC,aAAa;IAKd,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK9C,YAAY,CAAC,SAAS,EAAE,MAAM;IAKrC,WAAW,CAAC,MAAM,GAAE,kCAAuC,GAAG,IAAI;IAQlE,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa;IAIlD,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa;CAOtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../../src/utils/event-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
|
|
@@ -13,6 +13,7 @@ const DEBOUNCE_TIME = 500;
|
|
|
13
13
|
* @tagname %%prefix%%-combobox
|
|
14
14
|
*
|
|
15
15
|
* @fires change - Fired when a selection is confirmed in autocomplete-both mode
|
|
16
|
+
* @fires open-change - Fired when the dropdown opens or closes. detail: `OpenChangeEventDetail`
|
|
16
17
|
*/
|
|
17
18
|
export class Combobox extends FASTComboBox {
|
|
18
19
|
constructor() {
|
|
@@ -20,6 +21,16 @@ export class Combobox extends FASTComboBox {
|
|
|
20
21
|
_Combobox_indicator.set(this, void 0);
|
|
21
22
|
_Combobox_wasOpenOnEnterDown.set(this, false);
|
|
22
23
|
this.needManualChangeEventDispatch = false;
|
|
24
|
+
/**
|
|
25
|
+
* Enables server-side filtering: typed input refetches from the server with a criteria
|
|
26
|
+
* instead of filtering the already-loaded options client-side.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Automatically forced to `true` (overriding an explicit `async="false"`) when the
|
|
30
|
+
* slotted datasource has `infinite-scroll` enabled — see
|
|
31
|
+
* {@link Combobox.enableAsyncForInfiniteScrollDatasource}. With only a page of the
|
|
32
|
+
* resource loaded, client-side filtering would silently only search that page.
|
|
33
|
+
*/
|
|
23
34
|
this.async = false;
|
|
24
35
|
this.debounce = DEBOUNCE_TIME;
|
|
25
36
|
/** Controls whether to perform a case-sensitive search in the list of options */
|
|
@@ -73,8 +84,18 @@ export class Combobox extends FASTComboBox {
|
|
|
73
84
|
debounceChanged(oldValue, newValue) {
|
|
74
85
|
this.debouncedInputHandler = debounce(this.asyncSetFilter, newValue);
|
|
75
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* The scrollable element hosting the dropdown options. Part of the public contract for
|
|
89
|
+
* slotted datasources (e.g. options-datasource infinite scroll) to observe scrolling.
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
get scrollableListbox() {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
return (_a = this.listbox) !== null && _a !== void 0 ? _a : (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.listbox');
|
|
95
|
+
}
|
|
76
96
|
openChanged() {
|
|
77
97
|
super.openChanged();
|
|
98
|
+
this.$emit('open-change', { open: this.open });
|
|
78
99
|
if (this.open) {
|
|
79
100
|
if (this.scrollToSelectedWhenOpening) {
|
|
80
101
|
// TODO: Double-check this bit / DOM.queueUpdate do not work here
|
|
@@ -122,10 +143,27 @@ export class Combobox extends FASTComboBox {
|
|
|
122
143
|
}
|
|
123
144
|
}
|
|
124
145
|
slottedOptionsChanged(prev, next) {
|
|
146
|
+
this.enableAsyncForInfiniteScrollDatasource();
|
|
125
147
|
const shouldEmit = this.async ? true : false;
|
|
126
148
|
super.slottedOptionsChanged(prev, next);
|
|
127
149
|
this['updateValue'](shouldEmit);
|
|
128
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* When the slotted datasource pages its options (infinite scroll), only a page of the
|
|
153
|
+
* resource is loaded client-side, so filtering typed input locally is meaningless.
|
|
154
|
+
* Switch to async mode so input refetches from the server with a criteria instead;
|
|
155
|
+
* further pages honour that criteria. This overrides an explicit `async="false"` on
|
|
156
|
+
* the combobox — infinite-scroll datasources cannot support client-side filtering.
|
|
157
|
+
*/
|
|
158
|
+
enableAsyncForInfiniteScrollDatasource() {
|
|
159
|
+
var _a;
|
|
160
|
+
if (this.async)
|
|
161
|
+
return;
|
|
162
|
+
const datasource = (_a = this.slottedDatasource) === null || _a === void 0 ? void 0 : _a.assignedNodes().find((x) => x instanceof OptionsDatasource);
|
|
163
|
+
if (datasource === null || datasource === void 0 ? void 0 : datasource.infiniteScroll) {
|
|
164
|
+
this.async = true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
129
167
|
filterOptions() {
|
|
130
168
|
if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) {
|
|
131
169
|
this['filter'] = '';
|
package/dist/esm/index.js
CHANGED