@ukho/admiralty-core 4.0.0-next.7 → 4.0.0-next.8
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/admiralty/admiralty.esm.js +1 -1
- package/dist/admiralty/admiralty.esm.js.map +1 -1
- package/dist/admiralty/{p-0747bd00.entry.js → p-1e01bb1c.entry.js} +2 -2
- package/dist/admiralty/{p-0747bd00.entry.js.map → p-1e01bb1c.entry.js.map} +1 -1
- package/dist/admiralty/{p-e11fb21b.entry.js → p-6dde3d41.entry.js} +2 -2
- package/dist/admiralty/p-6dde3d41.entry.js.map +1 -0
- package/dist/admiralty/{p-f8e1cfce.entry.js → p-a0466b05.entry.js} +2 -2
- package/dist/admiralty/p-a0466b05.entry.js.map +1 -0
- package/dist/admiralty/p-f2f2c51d.entry.js +2 -0
- package/dist/admiralty/p-f2f2c51d.entry.js.map +1 -0
- package/dist/cjs/admiralty-autocomplete.cjs.entry.js +4 -3
- package/dist/cjs/admiralty-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty-input.cjs.entry.js +2 -2
- package/dist/cjs/admiralty-input.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty-progress-bar.cjs.entry.js +9 -3
- package/dist/cjs/admiralty-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty-tab-group.cjs.entry.js +17 -5
- package/dist/cjs/admiralty-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -3
- package/dist/collection/components/autocomplete/autocomplete.js +5 -4
- package/dist/collection/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/collection/components/input/input.js +2 -2
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +9 -3
- package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/admiralty-autocomplete.js +4 -3
- package/dist/components/admiralty-autocomplete.js.map +1 -1
- package/dist/components/admiralty-input.js +121 -1
- package/dist/components/admiralty-input.js.map +1 -1
- package/dist/components/admiralty-progress-bar.js +9 -3
- package/dist/components/admiralty-progress-bar.js.map +1 -1
- package/dist/components/admiralty-tab-group.js +13 -1
- package/dist/components/admiralty-tab-group.js.map +1 -1
- package/dist/esm/admiralty-autocomplete.entry.js +4 -3
- package/dist/esm/admiralty-autocomplete.entry.js.map +1 -1
- package/dist/esm/admiralty-input.entry.js +2 -2
- package/dist/esm/admiralty-input.entry.js.map +1 -1
- package/dist/esm/admiralty-progress-bar.entry.js +9 -3
- package/dist/esm/admiralty-progress-bar.entry.js.map +1 -1
- package/dist/esm/admiralty-tab-group.entry.js +13 -1
- package/dist/esm/admiralty-tab-group.entry.js.map +1 -1
- package/dist/esm/admiralty.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/autocomplete/autocomplete.d.ts +1 -1
- package/dist/types/components/progress-bar/progress-bar.d.ts +3 -1
- package/dist/types/components.d.ts +2 -94
- package/docs/docs.json +3 -218
- package/package.json +2 -2
- package/dist/admiralty/p-26ffce79.entry.js +0 -2
- package/dist/admiralty/p-26ffce79.entry.js.map +0 -1
- package/dist/admiralty/p-a4bd6904.js +0 -2
- package/dist/admiralty/p-a4bd6904.js.map +0 -1
- package/dist/admiralty/p-b7153ca1.entry.js +0 -2
- package/dist/admiralty/p-b7153ca1.entry.js.map +0 -1
- package/dist/admiralty/p-d701641c.entry.js +0 -2
- package/dist/admiralty/p-d701641c.entry.js.map +0 -1
- package/dist/admiralty/p-e11fb21b.entry.js.map +0 -1
- package/dist/admiralty/p-f8e1cfce.entry.js.map +0 -1
- package/dist/cjs/Keys-019752ee.js +0 -16
- package/dist/cjs/Keys-019752ee.js.map +0 -1
- package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js +0 -23
- package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js.map +0 -1
- package/dist/cjs/admiralty-type-ahead.cjs.entry.js +0 -204
- package/dist/cjs/admiralty-type-ahead.cjs.entry.js.map +0 -1
- package/dist/collection/components/type-ahead/type-ahead.css +0 -106
- package/dist/collection/components/type-ahead/type-ahead.js +0 -329
- package/dist/collection/components/type-ahead/type-ahead.js.map +0 -1
- package/dist/collection/components/type-ahead-item/type-ahead-item.css +0 -3
- package/dist/collection/components/type-ahead-item/type-ahead-item.js +0 -43
- package/dist/collection/components/type-ahead-item/type-ahead-item.js.map +0 -1
- package/dist/components/admiralty-type-ahead-item.d.ts +0 -11
- package/dist/components/admiralty-type-ahead-item.js +0 -38
- package/dist/components/admiralty-type-ahead-item.js.map +0 -1
- package/dist/components/admiralty-type-ahead.d.ts +0 -11
- package/dist/components/admiralty-type-ahead.js +0 -254
- package/dist/components/admiralty-type-ahead.js.map +0 -1
- package/dist/components/p-1a2059bb.js +0 -125
- package/dist/components/p-1a2059bb.js.map +0 -1
- package/dist/components/p-a4bd6904.js +0 -16
- package/dist/components/p-a4bd6904.js.map +0 -1
- package/dist/esm/Keys-acfce4b9.js +0 -16
- package/dist/esm/Keys-acfce4b9.js.map +0 -1
- package/dist/esm/admiralty-type-ahead-item.entry.js +0 -19
- package/dist/esm/admiralty-type-ahead-item.entry.js.map +0 -1
- package/dist/esm/admiralty-type-ahead.entry.js +0 -200
- package/dist/esm/admiralty-type-ahead.entry.js.map +0 -1
- package/dist/types/components/type-ahead/type-ahead.d.ts +0 -72
- package/dist/types/components/type-ahead-item/type-ahead-item.d.ts +0 -4
|
@@ -98,7 +98,7 @@ export namespace Components {
|
|
|
98
98
|
*/
|
|
99
99
|
"required": boolean;
|
|
100
100
|
/**
|
|
101
|
-
* Toggle showing all values when the input is clicked, like a default dropdown.
|
|
101
|
+
* Toggle showing all values when the input is clicked, like a default dropdown. This will hide the chevron when set to false.
|
|
102
102
|
*/
|
|
103
103
|
"showAllValues": boolean;
|
|
104
104
|
/**
|
|
@@ -777,31 +777,6 @@ export namespace Components {
|
|
|
777
777
|
*/
|
|
778
778
|
"width"?: number;
|
|
779
779
|
}
|
|
780
|
-
interface AdmiraltyTypeAhead {
|
|
781
|
-
/**
|
|
782
|
-
* The hint which will be used under the label to describe the input.
|
|
783
|
-
*/
|
|
784
|
-
"hint": string;
|
|
785
|
-
/**
|
|
786
|
-
* The text content of the label for the input box
|
|
787
|
-
*/
|
|
788
|
-
"label": string;
|
|
789
|
-
/**
|
|
790
|
-
* The placeholder text for the input field
|
|
791
|
-
*/
|
|
792
|
-
"placeholder": string;
|
|
793
|
-
/**
|
|
794
|
-
* Optional property to show results when input box is initally focused
|
|
795
|
-
*/
|
|
796
|
-
"resultsOnInitFocus": boolean;
|
|
797
|
-
/**
|
|
798
|
-
* The value of the textinput
|
|
799
|
-
*/
|
|
800
|
-
"value": string;
|
|
801
|
-
}
|
|
802
|
-
interface AdmiraltyTypeAheadItem {
|
|
803
|
-
"value": string;
|
|
804
|
-
}
|
|
805
780
|
}
|
|
806
781
|
export interface AdmiraltyAutocompleteCustomEvent<T> extends CustomEvent<T> {
|
|
807
782
|
detail: T;
|
|
@@ -883,10 +858,6 @@ export interface AdmiraltyTextareaCustomEvent<T> extends CustomEvent<T> {
|
|
|
883
858
|
detail: T;
|
|
884
859
|
target: HTMLAdmiraltyTextareaElement;
|
|
885
860
|
}
|
|
886
|
-
export interface AdmiraltyTypeAheadCustomEvent<T> extends CustomEvent<T> {
|
|
887
|
-
detail: T;
|
|
888
|
-
target: HTMLAdmiraltyTypeAheadElement;
|
|
889
|
-
}
|
|
890
861
|
declare global {
|
|
891
862
|
interface HTMLAdmiraltyAutocompleteElementEventMap {
|
|
892
863
|
"admiraltyChange": AutoCompleteChangeEventDetail;
|
|
@@ -1443,30 +1414,6 @@ declare global {
|
|
|
1443
1414
|
prototype: HTMLAdmiraltyTextareaElement;
|
|
1444
1415
|
new (): HTMLAdmiraltyTextareaElement;
|
|
1445
1416
|
};
|
|
1446
|
-
interface HTMLAdmiraltyTypeAheadElementEventMap {
|
|
1447
|
-
"selectionChanged": string;
|
|
1448
|
-
"valueChanged": string;
|
|
1449
|
-
}
|
|
1450
|
-
interface HTMLAdmiraltyTypeAheadElement extends Components.AdmiraltyTypeAhead, HTMLStencilElement {
|
|
1451
|
-
addEventListener<K extends keyof HTMLAdmiraltyTypeAheadElementEventMap>(type: K, listener: (this: HTMLAdmiraltyTypeAheadElement, ev: AdmiraltyTypeAheadCustomEvent<HTMLAdmiraltyTypeAheadElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1452
|
-
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1453
|
-
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1454
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1455
|
-
removeEventListener<K extends keyof HTMLAdmiraltyTypeAheadElementEventMap>(type: K, listener: (this: HTMLAdmiraltyTypeAheadElement, ev: AdmiraltyTypeAheadCustomEvent<HTMLAdmiraltyTypeAheadElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1456
|
-
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1457
|
-
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1458
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1459
|
-
}
|
|
1460
|
-
var HTMLAdmiraltyTypeAheadElement: {
|
|
1461
|
-
prototype: HTMLAdmiraltyTypeAheadElement;
|
|
1462
|
-
new (): HTMLAdmiraltyTypeAheadElement;
|
|
1463
|
-
};
|
|
1464
|
-
interface HTMLAdmiraltyTypeAheadItemElement extends Components.AdmiraltyTypeAheadItem, HTMLStencilElement {
|
|
1465
|
-
}
|
|
1466
|
-
var HTMLAdmiraltyTypeAheadItemElement: {
|
|
1467
|
-
prototype: HTMLAdmiraltyTypeAheadItemElement;
|
|
1468
|
-
new (): HTMLAdmiraltyTypeAheadItemElement;
|
|
1469
|
-
};
|
|
1470
1417
|
interface HTMLElementTagNameMap {
|
|
1471
1418
|
"admiralty-autocomplete": HTMLAdmiraltyAutocompleteElement;
|
|
1472
1419
|
"admiralty-autocomplete-option": HTMLAdmiraltyAutocompleteOptionElement;
|
|
@@ -1518,8 +1465,6 @@ declare global {
|
|
|
1518
1465
|
"admiralty-table-header-cell": HTMLAdmiraltyTableHeaderCellElement;
|
|
1519
1466
|
"admiralty-table-row": HTMLAdmiraltyTableRowElement;
|
|
1520
1467
|
"admiralty-textarea": HTMLAdmiraltyTextareaElement;
|
|
1521
|
-
"admiralty-type-ahead": HTMLAdmiraltyTypeAheadElement;
|
|
1522
|
-
"admiralty-type-ahead-item": HTMLAdmiraltyTypeAheadItemElement;
|
|
1523
1468
|
}
|
|
1524
1469
|
}
|
|
1525
1470
|
declare namespace LocalJSX {
|
|
@@ -1597,7 +1542,7 @@ declare namespace LocalJSX {
|
|
|
1597
1542
|
*/
|
|
1598
1543
|
"required"?: boolean;
|
|
1599
1544
|
/**
|
|
1600
|
-
* Toggle showing all values when the input is clicked, like a default dropdown.
|
|
1545
|
+
* Toggle showing all values when the input is clicked, like a default dropdown. This will hide the chevron when set to false.
|
|
1601
1546
|
*/
|
|
1602
1547
|
"showAllValues"?: boolean;
|
|
1603
1548
|
/**
|
|
@@ -2396,39 +2341,6 @@ declare namespace LocalJSX {
|
|
|
2396
2341
|
*/
|
|
2397
2342
|
"width"?: number;
|
|
2398
2343
|
}
|
|
2399
|
-
interface AdmiraltyTypeAhead {
|
|
2400
|
-
/**
|
|
2401
|
-
* The hint which will be used under the label to describe the input.
|
|
2402
|
-
*/
|
|
2403
|
-
"hint"?: string;
|
|
2404
|
-
/**
|
|
2405
|
-
* The text content of the label for the input box
|
|
2406
|
-
*/
|
|
2407
|
-
"label"?: string;
|
|
2408
|
-
/**
|
|
2409
|
-
* Optional function that will be executed when the user selects an item from the typeahead
|
|
2410
|
-
*/
|
|
2411
|
-
"onSelectionChanged"?: (event: AdmiraltyTypeAheadCustomEvent<string>) => void;
|
|
2412
|
-
/**
|
|
2413
|
-
* Event that is fired whenever the value of the typeahead changes e.g. selection from the dropdown or manually typed entry
|
|
2414
|
-
*/
|
|
2415
|
-
"onValueChanged"?: (event: AdmiraltyTypeAheadCustomEvent<string>) => void;
|
|
2416
|
-
/**
|
|
2417
|
-
* The placeholder text for the input field
|
|
2418
|
-
*/
|
|
2419
|
-
"placeholder"?: string;
|
|
2420
|
-
/**
|
|
2421
|
-
* Optional property to show results when input box is initally focused
|
|
2422
|
-
*/
|
|
2423
|
-
"resultsOnInitFocus"?: boolean;
|
|
2424
|
-
/**
|
|
2425
|
-
* The value of the textinput
|
|
2426
|
-
*/
|
|
2427
|
-
"value"?: string;
|
|
2428
|
-
}
|
|
2429
|
-
interface AdmiraltyTypeAheadItem {
|
|
2430
|
-
"value"?: string;
|
|
2431
|
-
}
|
|
2432
2344
|
interface IntrinsicElements {
|
|
2433
2345
|
"admiralty-autocomplete": AdmiraltyAutocomplete;
|
|
2434
2346
|
"admiralty-autocomplete-option": AdmiraltyAutocompleteOption;
|
|
@@ -2480,8 +2392,6 @@ declare namespace LocalJSX {
|
|
|
2480
2392
|
"admiralty-table-header-cell": AdmiraltyTableHeaderCell;
|
|
2481
2393
|
"admiralty-table-row": AdmiraltyTableRow;
|
|
2482
2394
|
"admiralty-textarea": AdmiraltyTextarea;
|
|
2483
|
-
"admiralty-type-ahead": AdmiraltyTypeAhead;
|
|
2484
|
-
"admiralty-type-ahead-item": AdmiraltyTypeAheadItem;
|
|
2485
2395
|
}
|
|
2486
2396
|
}
|
|
2487
2397
|
export { LocalJSX as JSX };
|
|
@@ -2562,8 +2472,6 @@ declare module "@stencil/core" {
|
|
|
2562
2472
|
*/
|
|
2563
2473
|
"admiralty-table-row": LocalJSX.AdmiraltyTableRow & JSXBase.HTMLAttributes<HTMLAdmiraltyTableRowElement>;
|
|
2564
2474
|
"admiralty-textarea": LocalJSX.AdmiraltyTextarea & JSXBase.HTMLAttributes<HTMLAdmiraltyTextareaElement>;
|
|
2565
|
-
"admiralty-type-ahead": LocalJSX.AdmiraltyTypeAhead & JSXBase.HTMLAttributes<HTMLAdmiraltyTypeAheadElement>;
|
|
2566
|
-
"admiralty-type-ahead-item": LocalJSX.AdmiraltyTypeAheadItem & JSXBase.HTMLAttributes<HTMLAdmiraltyTypeAheadItemElement>;
|
|
2567
2475
|
}
|
|
2568
2476
|
}
|
|
2569
2477
|
}
|
package/docs/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2025-01-
|
|
2
|
+
"timestamp": "2025-01-14T12:33:09",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.21.0",
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
"mutable": false,
|
|
397
397
|
"attr": "show-all-values",
|
|
398
398
|
"reflectToAttr": false,
|
|
399
|
-
"docs": "Toggle showing all values when the input is clicked, like a default dropdown.",
|
|
399
|
+
"docs": "Toggle showing all values when the input is clicked, like a default dropdown. This will hide the chevron when set to false.",
|
|
400
400
|
"docsTags": [],
|
|
401
401
|
"default": "true",
|
|
402
402
|
"values": [
|
|
@@ -42246,9 +42246,7 @@
|
|
|
42246
42246
|
],
|
|
42247
42247
|
"slots": [],
|
|
42248
42248
|
"parts": [],
|
|
42249
|
-
"dependents": [
|
|
42250
|
-
"admiralty-type-ahead"
|
|
42251
|
-
],
|
|
42249
|
+
"dependents": [],
|
|
42252
42250
|
"dependencies": [
|
|
42253
42251
|
"admiralty-label",
|
|
42254
42252
|
"admiralty-hint",
|
|
@@ -42262,9 +42260,6 @@
|
|
|
42262
42260
|
],
|
|
42263
42261
|
"admiralty-input-invalid": [
|
|
42264
42262
|
"admiralty-icon"
|
|
42265
|
-
],
|
|
42266
|
-
"admiralty-type-ahead": [
|
|
42267
|
-
"admiralty-input"
|
|
42268
42263
|
]
|
|
42269
42264
|
}
|
|
42270
42265
|
},
|
|
@@ -44701,216 +44696,6 @@
|
|
|
44701
44696
|
"admiralty-icon"
|
|
44702
44697
|
]
|
|
44703
44698
|
}
|
|
44704
|
-
},
|
|
44705
|
-
{
|
|
44706
|
-
"filePath": "src/components/type-ahead/type-ahead.tsx",
|
|
44707
|
-
"encapsulation": "scoped",
|
|
44708
|
-
"tag": "admiralty-type-ahead",
|
|
44709
|
-
"readme": "# admiralty-type-ahead\n",
|
|
44710
|
-
"docs": "",
|
|
44711
|
-
"docsTags": [],
|
|
44712
|
-
"usage": {},
|
|
44713
|
-
"props": [
|
|
44714
|
-
{
|
|
44715
|
-
"name": "hint",
|
|
44716
|
-
"type": "string",
|
|
44717
|
-
"complexType": {
|
|
44718
|
-
"original": "string",
|
|
44719
|
-
"resolved": "string",
|
|
44720
|
-
"references": {}
|
|
44721
|
-
},
|
|
44722
|
-
"mutable": false,
|
|
44723
|
-
"attr": "hint",
|
|
44724
|
-
"reflectToAttr": false,
|
|
44725
|
-
"docs": "The hint which will be used under the label to describe the input.",
|
|
44726
|
-
"docsTags": [],
|
|
44727
|
-
"values": [
|
|
44728
|
-
{
|
|
44729
|
-
"type": "string"
|
|
44730
|
-
}
|
|
44731
|
-
],
|
|
44732
|
-
"optional": false,
|
|
44733
|
-
"required": false
|
|
44734
|
-
},
|
|
44735
|
-
{
|
|
44736
|
-
"name": "label",
|
|
44737
|
-
"type": "string",
|
|
44738
|
-
"complexType": {
|
|
44739
|
-
"original": "string",
|
|
44740
|
-
"resolved": "string",
|
|
44741
|
-
"references": {}
|
|
44742
|
-
},
|
|
44743
|
-
"mutable": false,
|
|
44744
|
-
"attr": "label",
|
|
44745
|
-
"reflectToAttr": false,
|
|
44746
|
-
"docs": "The text content of the label for the input box",
|
|
44747
|
-
"docsTags": [],
|
|
44748
|
-
"values": [
|
|
44749
|
-
{
|
|
44750
|
-
"type": "string"
|
|
44751
|
-
}
|
|
44752
|
-
],
|
|
44753
|
-
"optional": false,
|
|
44754
|
-
"required": false
|
|
44755
|
-
},
|
|
44756
|
-
{
|
|
44757
|
-
"name": "placeholder",
|
|
44758
|
-
"type": "string",
|
|
44759
|
-
"complexType": {
|
|
44760
|
-
"original": "string",
|
|
44761
|
-
"resolved": "string",
|
|
44762
|
-
"references": {}
|
|
44763
|
-
},
|
|
44764
|
-
"mutable": false,
|
|
44765
|
-
"attr": "placeholder",
|
|
44766
|
-
"reflectToAttr": false,
|
|
44767
|
-
"docs": "The placeholder text for the input field",
|
|
44768
|
-
"docsTags": [],
|
|
44769
|
-
"values": [
|
|
44770
|
-
{
|
|
44771
|
-
"type": "string"
|
|
44772
|
-
}
|
|
44773
|
-
],
|
|
44774
|
-
"optional": false,
|
|
44775
|
-
"required": false
|
|
44776
|
-
},
|
|
44777
|
-
{
|
|
44778
|
-
"name": "resultsOnInitFocus",
|
|
44779
|
-
"type": "boolean",
|
|
44780
|
-
"complexType": {
|
|
44781
|
-
"original": "boolean",
|
|
44782
|
-
"resolved": "boolean",
|
|
44783
|
-
"references": {}
|
|
44784
|
-
},
|
|
44785
|
-
"mutable": false,
|
|
44786
|
-
"attr": "results-on-init-focus",
|
|
44787
|
-
"reflectToAttr": false,
|
|
44788
|
-
"docs": "Optional property to show results when input box is initally focused",
|
|
44789
|
-
"docsTags": [],
|
|
44790
|
-
"default": "false",
|
|
44791
|
-
"values": [
|
|
44792
|
-
{
|
|
44793
|
-
"type": "boolean"
|
|
44794
|
-
}
|
|
44795
|
-
],
|
|
44796
|
-
"optional": false,
|
|
44797
|
-
"required": false
|
|
44798
|
-
},
|
|
44799
|
-
{
|
|
44800
|
-
"name": "value",
|
|
44801
|
-
"type": "string",
|
|
44802
|
-
"complexType": {
|
|
44803
|
-
"original": "string",
|
|
44804
|
-
"resolved": "string",
|
|
44805
|
-
"references": {}
|
|
44806
|
-
},
|
|
44807
|
-
"mutable": false,
|
|
44808
|
-
"attr": "value",
|
|
44809
|
-
"reflectToAttr": false,
|
|
44810
|
-
"docs": "The value of the textinput",
|
|
44811
|
-
"docsTags": [],
|
|
44812
|
-
"values": [
|
|
44813
|
-
{
|
|
44814
|
-
"type": "string"
|
|
44815
|
-
}
|
|
44816
|
-
],
|
|
44817
|
-
"optional": false,
|
|
44818
|
-
"required": false
|
|
44819
|
-
}
|
|
44820
|
-
],
|
|
44821
|
-
"methods": [],
|
|
44822
|
-
"events": [
|
|
44823
|
-
{
|
|
44824
|
-
"event": "selectionChanged",
|
|
44825
|
-
"detail": "string",
|
|
44826
|
-
"bubbles": true,
|
|
44827
|
-
"complexType": {
|
|
44828
|
-
"original": "string",
|
|
44829
|
-
"resolved": "string",
|
|
44830
|
-
"references": {}
|
|
44831
|
-
},
|
|
44832
|
-
"cancelable": true,
|
|
44833
|
-
"composed": true,
|
|
44834
|
-
"docs": "Optional function that will be executed when the user selects an item from the typeahead",
|
|
44835
|
-
"docsTags": []
|
|
44836
|
-
},
|
|
44837
|
-
{
|
|
44838
|
-
"event": "valueChanged",
|
|
44839
|
-
"detail": "string",
|
|
44840
|
-
"bubbles": true,
|
|
44841
|
-
"complexType": {
|
|
44842
|
-
"original": "string",
|
|
44843
|
-
"resolved": "string",
|
|
44844
|
-
"references": {}
|
|
44845
|
-
},
|
|
44846
|
-
"cancelable": true,
|
|
44847
|
-
"composed": true,
|
|
44848
|
-
"docs": "Event that is fired whenever the value of the typeahead changes\ne.g. selection from the dropdown or manually typed entry",
|
|
44849
|
-
"docsTags": []
|
|
44850
|
-
}
|
|
44851
|
-
],
|
|
44852
|
-
"listeners": [],
|
|
44853
|
-
"styles": [],
|
|
44854
|
-
"slots": [],
|
|
44855
|
-
"parts": [],
|
|
44856
|
-
"dependents": [],
|
|
44857
|
-
"dependencies": [
|
|
44858
|
-
"admiralty-input"
|
|
44859
|
-
],
|
|
44860
|
-
"dependencyGraph": {
|
|
44861
|
-
"admiralty-type-ahead": [
|
|
44862
|
-
"admiralty-input"
|
|
44863
|
-
],
|
|
44864
|
-
"admiralty-input": [
|
|
44865
|
-
"admiralty-label",
|
|
44866
|
-
"admiralty-hint",
|
|
44867
|
-
"admiralty-input-invalid"
|
|
44868
|
-
],
|
|
44869
|
-
"admiralty-input-invalid": [
|
|
44870
|
-
"admiralty-icon"
|
|
44871
|
-
]
|
|
44872
|
-
}
|
|
44873
|
-
},
|
|
44874
|
-
{
|
|
44875
|
-
"filePath": "src/components/type-ahead-item/type-ahead-item.tsx",
|
|
44876
|
-
"encapsulation": "scoped",
|
|
44877
|
-
"tag": "admiralty-type-ahead-item",
|
|
44878
|
-
"readme": "# admiralty-type-ahead-item\n\n\n",
|
|
44879
|
-
"docs": "",
|
|
44880
|
-
"docsTags": [],
|
|
44881
|
-
"usage": {},
|
|
44882
|
-
"props": [
|
|
44883
|
-
{
|
|
44884
|
-
"name": "value",
|
|
44885
|
-
"type": "string",
|
|
44886
|
-
"complexType": {
|
|
44887
|
-
"original": "string",
|
|
44888
|
-
"resolved": "string",
|
|
44889
|
-
"references": {}
|
|
44890
|
-
},
|
|
44891
|
-
"mutable": false,
|
|
44892
|
-
"attr": "value",
|
|
44893
|
-
"reflectToAttr": false,
|
|
44894
|
-
"docs": "",
|
|
44895
|
-
"docsTags": [],
|
|
44896
|
-
"values": [
|
|
44897
|
-
{
|
|
44898
|
-
"type": "string"
|
|
44899
|
-
}
|
|
44900
|
-
],
|
|
44901
|
-
"optional": false,
|
|
44902
|
-
"required": false
|
|
44903
|
-
}
|
|
44904
|
-
],
|
|
44905
|
-
"methods": [],
|
|
44906
|
-
"events": [],
|
|
44907
|
-
"listeners": [],
|
|
44908
|
-
"styles": [],
|
|
44909
|
-
"slots": [],
|
|
44910
|
-
"parts": [],
|
|
44911
|
-
"dependents": [],
|
|
44912
|
-
"dependencies": [],
|
|
44913
|
-
"dependencyGraph": {}
|
|
44914
44699
|
}
|
|
44915
44700
|
],
|
|
44916
44701
|
"typeLibrary": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukho/admiralty-core",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.8",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"license": "MIT",
|
|
73
73
|
"url": "https://github.com/UKHO/admiralty-design-system",
|
|
74
74
|
"repository": "git://github.com/UKHO/admiralty-design-system.git",
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "6b1b38f90b0d65377a041fccf2d9498da50cfe5b"
|
|
76
76
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as a,f as i,h as r,H as e,g as o}from"./p-71979ff5.js";import{K as s}from"./p-a4bd6904.js";const d=".visually-hidden.sc-admiralty-tab-group:not(:focus):not(:active){position:absolute !important;width:1px !important;height:1px !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important}@media (max-width: 1023px){.desktop-only.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.not-desktop.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.tablet-only.sc-admiralty-tab-group{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-only.sc-admiralty-tab-group{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-or-desktop.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.phone-or-tablet.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.phone-only.sc-admiralty-tab-group{display:none}}@media (max-width: 1023px) and (min-width: 480px){.phone-only.sc-admiralty-tab-group{display:none}}.tab-group-headers.sc-admiralty-tab-group{width:100%}hr.sc-admiralty-tab-group{width:100%;height:2px;margin:6px 0;background-color:var(--admiralty-colour-light)}.headers.sc-admiralty-tab-group{display:flex;overflow-x:auto;white-space:nowrap}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group{cursor:pointer;padding:10px;height:42px;max-width:fit-content;box-sizing:border-box;user-select:none;text-align:center;text-decoration:none;color:var(--admiralty-colour-primary);background-color:unset;font-weight:var(--admiralty-tab-group-font-weight, var(--admiralty-font-weight-medium));font-size:var(--admiralty-tab-group-font-size, var(--admiralty-font-size-0));margin-left:4px}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:first-child{margin-left:0}@media (max-width: 1023px){.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group{font-size:var(--admiralty-tab-group-not-desktop-font-size, var(--admiralty-font-size--1));line-height:18px;padding:8px;height:unset;width:unset}}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:focus-visible{box-shadow:var(--admiralty-focus-colour) inset 0 0 0 2px}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:focus,.headers.sc-admiralty-tab-group .heading.active.sc-admiralty-tab-group:focus{outline:3px solid transparent;color:var(--admiralty-text-colour);background-color:var(--admiralty-focus-colour);box-shadow:0 -2px var(--admiralty-focus-colour), 0 4px var(--admiralty-text-colour);text-decoration:none;box-shadow:0px -4px var(--admiralty-text-colour) inset}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:hover{background-color:var(--admiralty-hover-background-colour);color:var(--admiralty-colour-primary);box-shadow:unset}.headers.sc-admiralty-tab-group .heading.active.sc-admiralty-tab-group{background-color:var(--admiralty-colour-primary);color:var(--admiralty-colour-primary-contrast)}";const n=d;let h=0;const l=class{constructor(i){t(this,i);this.admiraltyTabSelected=a(this,"admiraltyTabSelected",7);this._groupId=h++;this._tabs=[];this._tabHeaders=[];this.selectedIndex=0}handleSelectedTab(t){const a=this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);a.classList.remove("active");a.setAttribute("tabindex",this.getTabIndex(t).toString());this.selectedIndex=t;this.setSelectedTabContent();this.admiraltyTabSelected.emit(t)}setSelectedTabContent(){const t=this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);t.classList.add("active");t.setAttribute("tabindex",this.getTabIndex(this.selectedIndex).toString())}getTabIndex(t){return this.selectedIndex===t?0:-1}getTabContentId(t){return`tab-panel-${this._groupId}-${t}`}getTabLabelId(t){return`tab-label-${this._groupId}-${t}`}handleKeyDown(t){const a=t.target;let i=false;switch(t.key){case s.LEFT_ARROW:this.moveFocusToPreviousTab(a);i=true;break;case s.RIGHT_ARROW:this.moveFocusToNextTab(a);i=true;break;case s.HOME:this.moveFocusToTabHeader(this._tabHeaders[0]);i=true;break;case s.END:this.moveFocusToTabHeader(this._tabHeaders[this._tabHeaders.length-1]);i=true;break}if(i){t.stopPropagation();t.preventDefault()}}moveFocusToTabHeader(t){t.focus()}moveFocusToPreviousTab(t){const a=this._tabHeaders[0];const i=this._tabHeaders[this._tabHeaders.length-1];if(t===a){this.moveFocusToTabHeader(i)}else{const a=this._tabHeaders.indexOf(t);this.moveFocusToTabHeader(this._tabHeaders[a-1])}}moveFocusToNextTab(t){const a=this._tabHeaders[0];const i=this._tabHeaders[this._tabHeaders.length-1];if(t===i){this.moveFocusToTabHeader(a)}else{const a=this._tabHeaders.indexOf(t);this.moveFocusToTabHeader(this._tabHeaders[a+1])}}componentWillLoad(){const t=this.el.querySelectorAll("admiralty-tab");this._tabs=[];if(t.length>0){let a=0;t.forEach((t=>{t.tabLabelId=this.getTabLabelId(a);t.tabContentId=this.getTabContentId(a);this._tabs.push({label:t.label,index:a});++a}));this.selectedIndex=Math.max(0,Math.min(this.selectedIndex,t.length-1))}}componentDidLoad(){this._tabHeaders=Array.from(this.el.querySelectorAll('[role="tab"]'));const t=this.el.querySelectorAll("admiralty-tab .tab-content");if(t.length>0){const a=this.el.querySelector("hr");a.after(...Array.from(t));this.setSelectedTabContent();i(this)}}render(){const t=()=>Array.from(this._tabs).map((t=>r("button",{class:{heading:true,active:t.index===this.selectedIndex},id:this.getTabLabelId(t.index),role:"tab",tabIndex:this.getTabIndex(t.index),"aria-setsize":this._tabs.length,"aria-selected":`${t.index===this.selectedIndex}`,"aria-controls":this.getTabContentId(t.index),onClick:a=>this.handleSelectedTab(t.index),onKeyDown:t=>this.handleKeyDown(t)},t.label)));return r(e,{key:"861fe31a1effe2690ee4e2c14090a12d20365cd1"},r("div",{key:"406afd12063e9349074d327f2e9204f561d201f6",class:"tab-group-headers",role:"tablist"},r("div",{key:"d8eab758c656cf1e837b204e0eaf1407801e8069",class:"headers"},t())),r("hr",{key:"1e4883f50dbb649b25a9f9bcc3a35c1f13e9c393"}),r("slot",{key:"053640a4d85312062fd256f7ee7c78f2d57cf5ea"}))}get el(){return o(this)}};l.style=n;export{l as admiralty_tab_group};
|
|
2
|
-
//# sourceMappingURL=p-26ffce79.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["tabGroupCss","AdmiraltyTabGroupStyle0","nextId","TabGroupComponent","this","_groupId","_tabs","_tabHeaders","handleSelectedTab","idx","oldContent","el","querySelector","getTabContentId","selectedIndex","classList","remove","setAttribute","getTabIndex","toString","setSelectedTabContent","admiraltyTabSelected","emit","activeContent","add","index","i","getTabLabelId","handleKeyDown","event","tgt","target","processed","key","Keys","LEFT_ARROW","moveFocusToPreviousTab","RIGHT_ARROW","moveFocusToNextTab","HOME","moveFocusToTabHeader","END","length","stopPropagation","preventDefault","header","focus","currentHeader","firstTab","lastTab","indexOf","componentWillLoad","tabItems","querySelectorAll","forEach","t","tabLabelId","tabContentId","push","label","Math","max","min","componentDidLoad","Array","from","tabContent","after","forceUpdate","render","createHeaders","map","tab","h","class","heading","active","id","role","tabIndex","onClick","_ev","onKeyDown","ev","Host"],"sources":["src/components/tab-group/tab-group.scss?tag=admiralty-tab-group&encapsulation=scoped","src/components/tab-group/tab-group.tsx"],"sourcesContent":["@import 'tab-group.vars';\n\n.tab-group-headers {\n width: 100%;\n}\n\nhr {\n width: 100%;\n height: 2px;\n margin: 6px 0;\n background-color: $tab-group-separator-colour;\n}\n\n.headers {\n display: flex;\n overflow-x: auto;\n\n white-space: nowrap;\n\n .heading {\n cursor: pointer;\n padding: 10px;\n height: 42px;\n max-width: fit-content;\n box-sizing: border-box;\n user-select: none;\n\n text-align: center;\n text-decoration: none;\n color: $tab-group-heading-text-colour;\n background-color: unset;\n font-weight: $tab-group-heading-text-weight;\n font-size: $tab-group-heading-text-font;\n margin-left: 4px;\n\n &:first-child {\n margin-left: 0;\n }\n\n @include not-desktop {\n font-size: $tab-group-heading-not-desktop-text-font;\n line-height: 18px;\n padding: 8px;\n height: unset;\n width: unset;\n }\n\n &:focus-visible {\n box-shadow: $tab-group-focus-colour inset 0 0 0 2px;\n }\n\n &:focus,\n &.active:focus {\n @include focus-highlight;\n box-shadow: 0px -4px $tab-group-focus-text-colour inset;\n }\n\n &:hover {\n background-color: $tab-group-heading-hover-background-colour;\n color: $tab-group-heading-text-colour;\n box-shadow: unset;\n }\n\n &.active {\n background-color: $tab-group-active-background-colour;\n color: $tab-group-active-text-colour;\n }\n }\n}\n","import { Component, Element, Prop, Event, h, EventEmitter, Host, forceUpdate } from '@stencil/core';\nimport { Keys } from '../Keys';\n\ninterface TabInfo {\n label: string;\n index: number;\n}\n\nlet nextId = 0;\n\n@Component({\n tag: 'admiralty-tab-group',\n styleUrl: 'tab-group.scss',\n scoped: true,\n})\nexport class TabGroupComponent {\n @Element() el: HTMLElement;\n\n @Prop({ mutable: true }) selectedIndex = 0;\n\n @Event() admiraltyTabSelected: EventEmitter<number>;\n\n private _groupId = nextId++;\n\n private _tabs: TabInfo[] = [];\n private _tabHeaders: HTMLElement[] = [];\n\n handleSelectedTab(idx: number) {\n const oldContent = this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);\n oldContent.classList.remove('active');\n oldContent.setAttribute('tabindex', this.getTabIndex(idx).toString());\n\n this.selectedIndex = idx;\n this.setSelectedTabContent();\n\n this.admiraltyTabSelected.emit(idx);\n }\n\n private setSelectedTabContent() {\n const activeContent = this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);\n activeContent.classList.add('active');\n activeContent.setAttribute('tabindex', this.getTabIndex(this.selectedIndex).toString());\n }\n\n private getTabIndex(index: number): number | null {\n return this.selectedIndex === index ? 0 : -1;\n }\n\n private getTabContentId(i: number): string {\n return `tab-panel-${this._groupId}-${i}`;\n }\n\n private getTabLabelId(i: number): string {\n return `tab-label-${this._groupId}-${i}`;\n }\n\n handleKeyDown(event: KeyboardEvent): void {\n const tgt = event.target as HTMLElement;\n let processed = false;\n\n switch (event.key) {\n case Keys.LEFT_ARROW:\n this.moveFocusToPreviousTab(tgt);\n processed = true;\n break;\n case Keys.RIGHT_ARROW:\n this.moveFocusToNextTab(tgt);\n processed = true;\n break;\n\n case Keys.HOME:\n this.moveFocusToTabHeader(this._tabHeaders[0]);\n processed = true;\n break;\n\n case Keys.END:\n this.moveFocusToTabHeader(this._tabHeaders[this._tabHeaders.length - 1]);\n processed = true;\n break;\n default:\n break;\n }\n\n if (processed) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n private moveFocusToTabHeader(header: HTMLElement) {\n header.focus();\n }\n\n private moveFocusToPreviousTab(currentHeader: HTMLElement) {\n const firstTab = this._tabHeaders[0];\n const lastTab = this._tabHeaders[this._tabHeaders.length - 1];\n\n if (currentHeader === firstTab) {\n this.moveFocusToTabHeader(lastTab);\n } else {\n const index = this._tabHeaders.indexOf(currentHeader);\n this.moveFocusToTabHeader(this._tabHeaders[index - 1]);\n }\n }\n\n private moveFocusToNextTab(currentHeader: HTMLElement) {\n const firstTab = this._tabHeaders[0];\n const lastTab = this._tabHeaders[this._tabHeaders.length - 1];\n\n if (currentHeader === lastTab) {\n this.moveFocusToTabHeader(firstTab);\n } else {\n const index = this._tabHeaders.indexOf(currentHeader);\n this.moveFocusToTabHeader(this._tabHeaders[index + 1]);\n }\n }\n\n componentWillLoad() {\n const tabItems = this.el.querySelectorAll('admiralty-tab');\n\n this._tabs = [];\n\n if (tabItems.length > 0) {\n let idx = 0;\n tabItems.forEach(t => {\n t.tabLabelId = this.getTabLabelId(idx);\n t.tabContentId = this.getTabContentId(idx);\n\n this._tabs.push({ label: t.label, index: idx });\n ++idx;\n });\n\n this.selectedIndex = Math.max(0, Math.min(this.selectedIndex, tabItems.length - 1));\n }\n }\n\n componentDidLoad() {\n this._tabHeaders = Array.from(this.el.querySelectorAll('[role=\"tab\"]'));\n\n const tabItems = this.el.querySelectorAll('admiralty-tab .tab-content');\n\n if (tabItems.length > 0) {\n const tabContent = this.el.querySelector('hr');\n tabContent.after(...Array.from(tabItems));\n\n this.setSelectedTabContent();\n forceUpdate(this);\n }\n }\n\n render() {\n const createHeaders = () =>\n Array.from(this._tabs).map(tab => (\n <button\n class={{ heading: true, active: tab.index === this.selectedIndex }}\n id={this.getTabLabelId(tab.index)}\n role=\"tab\"\n tabIndex={this.getTabIndex(tab.index)}\n aria-setsize={this._tabs.length}\n aria-selected={`${tab.index === this.selectedIndex}`}\n aria-controls={this.getTabContentId(tab.index)}\n onClick={_ev => this.handleSelectedTab(tab.index)}\n onKeyDown={ev => this.handleKeyDown(ev)}\n >\n {tab.label}\n </button>\n ));\n\n return (\n <Host>\n <div class=\"tab-group-headers\" role=\"tablist\">\n <div class=\"headers\">{createHeaders()}</div>\n </div>\n <hr />\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAc,q5FACpB,MAAAC,EAAeD,ECOf,IAAIE,EAAS,E,MAOAC,EAAiB,M,oFAOpBC,KAAAC,SAAWH,IAEXE,KAAAE,MAAmB,GACnBF,KAAAG,YAA6B,G,mBAPI,C,CASzC,iBAAAC,CAAkBC,GAChB,MAAMC,EAAaN,KAAKO,GAAGC,cAAc,gBAAgBR,KAAKS,gBAAgB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cAAc6C,EAAI/C,OAC3BqD,KAAK,MACLC,SAAU3E,KAAKc,YAAYsD,EAAI/C,OAAM,eACvBrB,KAAKE,MAAMoC,OAAM,gBAChB,GAAG8B,EAAI/C,QAAUrB,KAAKU,gBAAe,gBACrCV,KAAKS,gBAAgB2D,EAAI/C,OACxCuD,QAASC,GAAO7E,KAAKI,kBAAkBgE,EAAI/C,OAC3CyD,UAAWC,GAAM/E,KAAKwB,cAAcuD,IAEnCX,EAAIb,SAIX,OACEc,EAACW,EAAI,CAAAnD,IAAA,4CACHwC,EAAA,OAAAxC,IAAA,2CAAKyC,MAAM,oBAAoBI,KAAK,WAClCL,EAAA,OAAAxC,IAAA,2CAAKyC,MAAM,WAAWJ,MAExBG,EAAA,MAAAxC,IAAA,6CACAwC,EAAA,QAAAxC,IAAA,6C","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var r;(function(r){r["UP_ARROW"]="ArrowUp";r["DOWN_ARROW"]="ArrowDown";r["LEFT_ARROW"]="ArrowLeft";r["RIGHT_ARROW"]="ArrowRight";r["ENTER"]="Enter";r["TAB"]="Tab";r["HOME"]="Home";r["END"]="End";r["SPACE"]=" "})(r||(r={}));export{r as K};
|
|
2
|
-
//# sourceMappingURL=p-a4bd6904.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Keys"],"sources":["src/components/Keys.ts"],"sourcesContent":["export enum Keys {\n UP_ARROW = 'ArrowUp',\n DOWN_ARROW = 'ArrowDown',\n LEFT_ARROW = 'ArrowLeft',\n RIGHT_ARROW = 'ArrowRight',\n ENTER = 'Enter',\n TAB = 'Tab',\n HOME = 'Home',\n END = 'End',\n SPACE = ' '\n}\n"],"mappings":"IAAYA,GAAZ,SAAYA,GACVA,EAAA,sBACAA,EAAA,0BACAA,EAAA,0BACAA,EAAA,4BACAA,EAAA,iBACAA,EAAA,aACAA,EAAA,eACAA,EAAA,aACAA,EAAA,YACD,EAVD,CAAYA,MAAI,Y","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,h as a,H as c}from"./p-71979ff5.js";const e=".sc-admiralty-type-ahead-item-h{display:block}";const s=e;const d=class{constructor(a){t(this,a);this.value=undefined}render(){return a(c,{key:"b6ccf51ad68ce75c2c5e9670d1d8bb407cdc2ca8",value:this.value})}};d.style=s;export{d as admiralty_type_ahead_item};
|
|
2
|
-
//# sourceMappingURL=p-b7153ca1.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["typeAheadItemCss","AdmiraltyTypeAheadItemStyle0","AdmiraltyTypeAheadItem","render","h","Host","key","value","this"],"sources":["src/components/type-ahead-item/type-ahead-item.scss?tag=admiralty-type-ahead-item&encapsulation=scoped","src/components/type-ahead-item/type-ahead-item.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-type-ahead-item',\n styleUrl: 'type-ahead-item.scss',\n scoped: true,\n})\nexport class AdmiraltyTypeAheadItem {\n @Prop() value: string;\n\n render() {\n return <Host value={this.value}></Host>;\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAmB,iDACzB,MAAAC,EAAeD,E,MCMFE,EAAsB,M,8CAGjC,MAAAC,GACE,OAAOC,EAACC,EAAI,CAAAC,IAAA,2CAACC,MAAOC,KAAKD,O","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,f as a,h as e,H as s,g as h}from"./p-71979ff5.js";import{K as d}from"./p-a4bd6904.js";const n=".visually-hidden.sc-admiralty-type-ahead:not(:focus):not(:active){position:absolute !important;width:1px !important;height:1px !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important}@media (max-width: 1023px){.desktop-only.sc-admiralty-type-ahead{display:none}}@media (min-width: 1024px){.not-desktop.sc-admiralty-type-ahead{display:none}}@media (min-width: 1024px){.tablet-only.sc-admiralty-type-ahead{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-only.sc-admiralty-type-ahead{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-or-desktop.sc-admiralty-type-ahead{display:none}}@media (min-width: 1024px){.phone-or-tablet.sc-admiralty-type-ahead{display:none}}@media (min-width: 1024px){.phone-only.sc-admiralty-type-ahead{display:none}}@media (max-width: 1023px) and (min-width: 480px){.phone-only.sc-admiralty-type-ahead{display:none}}*.sc-admiralty-type-ahead{margin:0px;padding:0px}.text-input-wrap.sc-admiralty-type-ahead{height:auto !important}.filterTextInput.sc-admiralty-type-ahead{width:100%}.typeahead-list-container.sc-admiralty-type-ahead{position:relative}.typeahead-list-container.sc-admiralty-type-ahead .typeahead-list.sc-admiralty-type-ahead{position:absolute;left:0px;top:-24px;background-color:var(--admiralty-background-colour);width:100%;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);border:2px solid var(--admiralty-text-colour);border-top:none;box-sizing:border-box;max-height:180px;overflow-y:auto;z-index:1;list-style:none}.typeahead-list-container.sc-admiralty-type-ahead .typeahead-list.sc-admiralty-type-ahead li.sc-admiralty-type-ahead{cursor:pointer;transform:unset !important;padding:6px;min-height:24px;margin:0}.typeahead-list-container.sc-admiralty-type-ahead .typeahead-list.sc-admiralty-type-ahead li.sc-admiralty-type-ahead:before{content:none}.typeahead-list-container.sc-admiralty-type-ahead .typeahead-list.sc-admiralty-type-ahead li.highlighted.sc-admiralty-type-ahead{background-color:var(--admiralty-colour-primary);color:var(--admiralty-colour-primary-contrast)}";const o=n;const r=class{constructor(a){t(this,a);this.selectionChanged=i(this,"selectionChanged",7);this.valueChanged=i(this,"valueChanged",7);this.internalId=++l;this.filterList=[];this.selectedItemIndex=-1;this.isFocused=false;this.isSilenced=false;this.isAlternateStatusSection=false;this.originalSearch="";this.hasBeenFocusedAtLeastOnce=false;this.filterResult=new Array;this.value=undefined;this.label=undefined;this.hint=undefined;this.placeholder=undefined;this.resultsOnInitFocus=false}get inputValue(){return this.inputControl.value.toString()}set inputValue(t){this.inputControl.value=t}componentDidLoad(){if(this.value){this.inputValue=this.value}}connectedCallback(){this.mutation=new MutationObserver((()=>{this.populateFilterList();a(this)}));this.mutation.observe(this.el,{childList:true,subtree:true})}disconnectedCallback(){if(this.mutation){this.mutation.disconnect();this.mutation=undefined}}populateFilterList(){const t=this.el.querySelectorAll("admiralty-type-ahead-item");this.filterList=[];t.forEach((t=>{this.filterList.push(t.getAttribute("value"))}))}handleFocusIn(){if(this.resultsOnInitFocus&&!this.hasBeenFocusedAtLeastOnce){this.performFilter("");this.hasBeenFocusedAtLeastOnce=true}this.isFocused=true;this.isSilenced=false}handleFocusOut(){this.isFocused=false;this.statusText=null;this.isSilenced=true}textChanged(t){this.originalSearch=t;this.performFilter(t);this.isSilenced=false;this.valueChanged.emit(t)}handleKeyPressed(t){t.stopImmediatePropagation();if(t.key===d.UP_ARROW||t.key===d.DOWN_ARROW){this.navigateSuggestions(t.key);this.updateScroll()}else if(t.key!==d.ENTER){this.textChanged(this.inputValue);this.selectCurrentItem()}}handleKeyDown(t){t.stopImmediatePropagation();if(t.key===d.TAB||t.key===d.ENTER){this.selectCurrentItem()}}handleItemSelected(t){this.inputValue=t;this.textChanged(t);this.filterResult=new Array;this.selectionChanged.emit(t)}performFilter(t){const i=(t,i)=>{const a=t.filter((t=>i===null||i.length<1||t.toLowerCase().indexOf(i.toLowerCase())>-1));return a};this.filterResult=i(this.filterList,t);this.selectedItemIndex=-1}addHighlight(){if(this.selectedItemIndex>-1){const t=this.el.querySelector(`#${this.getListItemId(this.selectedItemIndex)}`);t.classList.add("highlighted")}}removeHighlight(t){if(t>-1){const i=this.el.querySelector(`#${this.getListItemId(t)}`);i.classList.remove("highlighted")}}selectCurrentItem(){if(this.selectedItemIndex>=0){const t=this.filterResult[this.selectedItemIndex];this.handleItemSelected(t)}}handleItemHovered(t){this.removeHighlight(this.selectedItemIndex);this.selectedItemIndex=t;this.addHighlight()}handleComponentFocusOut(){var t;if(((t=this.filterResult)===null||t===void 0?void 0:t.length)>0){this.filterResult=new Array;this.hasBeenFocusedAtLeastOnce=false}}updateScroll(){const t=this.listContainer;const i=t.querySelector("ul");const a=Array.from(i.childNodes).find((t=>t.ariaPosInSet===`${this.selectedItemIndex+1}`));if(t&&a&&t.scrollHeight+t.clientHeight){a.scrollIntoView()}}navigateSuggestions(t){if(t===d.UP_ARROW){this.removeHighlight(this.selectedItemIndex);this.selectedItemIndex--;if(this.selectedItemIndex===-2){this.selectedItemIndex=this.filterResult.length-1}}if(t===d.DOWN_ARROW){this.removeHighlight(this.selectedItemIndex);this.selectedItemIndex++;if(this.selectedItemIndex>this.filterResult.length-1){this.selectedItemIndex=-1}}if(this.selectedItemIndex===-1){this.inputValue=this.originalSearch}else{const t=this.filterResult[this.selectedItemIndex];this.inputValue=t;this.addHighlight()}}getListItemId(t){const i=this.getId();return`${i}-list-item-${t}`}getId(){return this.el.id!=""?this.el.id:`admiralty-typeahead-${this.internalId}`}render(){const t=this.getId();const i=`${t}-input`;const a=`${t}-assistive-hint`;const h=`${t}-list`;return e(s,{key:"a31dfc130539fc7998a1a858780180c3f58a3dca",onFocusout:t=>this.handleComponentFocusOut()},e("div",{key:"2b1d16a096aedc73730e3456a786c79bbb649087",class:"visually-hidden"},e("div",{key:"7a4ffe9d200afbb32759292ad537af595b46d377",class:"results-status-a",role:"status","aria-atomic":"true","aria-live":"polite"},!this.isSilenced&&this.isAlternateStatusSection?this.statusText:""),e("div",{key:"246dd3d76841a08ec9304156956279b1319ae956",class:"results-status-b",role:"status","aria-atomic":"true","aria-live":"polite"},!this.isSilenced&&!this.isAlternateStatusSection?this.statusText:"")),e("admiralty-input",{key:"9226118ea71b0c055c3b8b12bdaf183b8d0f1be0",type:"text",ref:t=>this.inputControl=t,id:i,label:this.label,hint:this.hint,placeholder:this.placeholder,class:"filterTextInput",onKeyUp:t=>this.handleKeyPressed(t),onKeyDown:t=>this.handleKeyDown(t),onFocusin:t=>this.handleFocusIn(),onFocusout:t=>this.handleFocusOut(),"aria-expanded":this.isFocused&&this.filterResult.length>0}),e("span",{key:"2802b19f095e15fef7e346311014f4944578804d",id:a,class:"visually-hidden"},"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."),this.filterResult.length>0?e("div",{class:"typeahead-list-container",ref:t=>this.listContainer=t},e("ul",{class:"typeahead-list",id:h,role:"listbox"},this.filterResult.map(((t,i)=>e("li",{id:this.getListItemId(i),onMouseDown:i=>this.handleItemSelected(t),onMouseOver:t=>this.handleItemHovered(i),"aria-selected":i===this.selectedItemIndex,role:"option",tabindex:"-1","aria-posinset":i+1,"aria-setsize":this.filterResult.length},t))))):null,e("slot",{key:"52fb739eff8fe71caa9e39ae6add139cbb4db1a7"}))}get el(){return h(this)}};let l=0;r.style=o;export{r as admiralty_type_ahead};
|
|
2
|
-
//# sourceMappingURL=p-d701641c.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["typeAheadCss","AdmiraltyTypeAheadStyle0","TypeAheadComponent","this","internalId","id","filterList","selectedItemIndex","isFocused","isSilenced","isAlternateStatusSection","originalSearch","hasBeenFocusedAtLeastOnce","Array","inputValue","inputControl","value","toString","componentDidLoad","connectedCallback","mutation","MutationObserver","populateFilterList","forceUpdate","observe","el","childList","subtree","disconnectedCallback","disconnect","undefined","slotItems","querySelectorAll","forEach","push","getAttribute","handleFocusIn","resultsOnInitFocus","performFilter","handleFocusOut","statusText","textChanged","valueChanged","emit","handleKeyPressed","event","stopImmediatePropagation","key","Keys","UP_ARROW","DOWN_ARROW","navigateSuggestions","updateScroll","ENTER","selectCurrentItem","handleKeyDown","TAB","handleItemSelected","filterResult","selectionChanged","filter","text","length","toLowerCase","indexOf","addHighlight","listItem","querySelector","getListItemId","classList","add","removeHighlight","i","remove","selectedItemText","handleItemHovered","index","handleComponentFocusOut","_a","container","listContainer","ul","selectedItem","from","childNodes","find","item","ariaPosInSet","scrollHeight","clientHeight","scrollIntoView","getId","render","inputId","hintId","listId","h","Host","onFocusout","_ev","class","role","type","ref","label","hint","placeholder","onKeyUp","ev","onKeyDown","onFocusin","map","onMouseDown","onMouseOver","tabindex"],"sources":["src/components/type-ahead/type-ahead.scss?tag=admiralty-type-ahead&encapsulation=scoped","src/components/type-ahead/type-ahead.tsx"],"sourcesContent":["@import 'type-ahead.vars';\n\n* {\n margin: 0px;\n padding: 0px;\n}\n\n.text-input-wrap {\n height: auto !important;\n}\n\n.filterTextInput {\n width: 100%;\n}\n\n.typeahead-list-container {\n position: relative;\n\n .typeahead-list {\n position: absolute;\n left: 0px;\n top: -24px;\n background-color: $type-ahead-background-colour;\n width: 100%;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);\n border: 2px solid $type-ahead-border-colour;\n border-top: none;\n box-sizing: border-box;\n max-height: 180px;\n overflow-y: auto;\n z-index: 1;\n list-style: none;\n\n li {\n cursor: pointer;\n transform: unset !important;\n padding: 6px;\n min-height: 24px;\n margin: 0;\n }\n\n li:before {\n content: none;\n }\n\n li.highlighted {\n background-color: $type-ahead-highlighted-background-colour;\n color: $type-ahead-highlighted-text-colour;\n }\n }\n}\n","import { Component, EventEmitter, Host, Prop, Event, h, State, Element, forceUpdate } from '@stencil/core';\nimport { Keys } from '../Keys';\n\n@Component({\n tag: 'admiralty-type-ahead',\n styleUrl: 'type-ahead.scss',\n scoped: true,\n})\nexport class TypeAheadComponent {\n private internalId = ++id;\n\n @Element() el: HTMLElement;\n\n listContainer!: HTMLDivElement;\n inputControl!: HTMLAdmiraltyInputElement;\n\n @State() filterResult: string[] = new Array<string>();\n\n filterList: Array<string> = [];\n\n selectedItemIndex = -1;\n isFocused = false;\n\n isSilenced = false;\n isAlternateStatusSection = false;\n statusText: string;\n\n private mutation: MutationObserver;\n\n private originalSearch = '';\n private hasBeenFocusedAtLeastOnce = false;\n\n private get inputValue() {\n return this.inputControl.value.toString();\n }\n\n private set inputValue(value: string) {\n this.inputControl.value = value;\n }\n\n /**\n * The value of the textinput\n */\n @Prop() value: string;\n\n /**\n * The text content of the label for the input box\n */\n @Prop() label: string;\n\n /**\n * The hint which will be used under the label to describe the input.\n */\n @Prop() hint: string;\n\n /**\n * The placeholder text for the input field\n */\n @Prop() placeholder: string;\n\n /**\n * Optional property to show results when input box is initally focused\n */\n @Prop() resultsOnInitFocus: boolean = false;\n\n /**\n * Optional function that will be executed when the user selects an item from the typeahead\n */\n @Event() selectionChanged: EventEmitter<string>;\n\n /**\n * Event that is fired whenever the value of the typeahead changes\n * e.g. selection from the dropdown or manually typed entry\n */\n @Event() valueChanged: EventEmitter<string>;\n\n componentDidLoad() {\n if (this.value) {\n this.inputValue = this.value;\n }\n }\n\n connectedCallback() {\n this.mutation = new MutationObserver(() => {\n this.populateFilterList();\n forceUpdate(this);\n });\n this.mutation.observe(this.el, {\n childList: true,\n subtree: true,\n });\n }\n\n disconnectedCallback() {\n if (this.mutation) {\n this.mutation.disconnect();\n this.mutation = undefined;\n }\n }\n\n populateFilterList() {\n const slotItems = this.el.querySelectorAll('admiralty-type-ahead-item');\n this.filterList = [];\n slotItems.forEach(el => {\n this.filterList.push(el.getAttribute('value'));\n });\n }\n\n handleFocusIn() {\n if (this.resultsOnInitFocus && !this.hasBeenFocusedAtLeastOnce) {\n this.performFilter('');\n this.hasBeenFocusedAtLeastOnce = true;\n }\n\n this.isFocused = true;\n this.isSilenced = false;\n }\n\n handleFocusOut() {\n this.isFocused = false;\n this.statusText = null;\n this.isSilenced = true;\n }\n\n private textChanged(value: string): void {\n this.originalSearch = value;\n this.performFilter(value);\n this.isSilenced = false;\n this.valueChanged.emit(value);\n }\n\n handleKeyPressed(event: KeyboardEvent): void {\n event.stopImmediatePropagation();\n\n if (event.key === Keys.UP_ARROW || event.key === Keys.DOWN_ARROW) {\n this.navigateSuggestions(event.key);\n this.updateScroll();\n } else if (event.key !== Keys.ENTER) {\n this.textChanged(this.inputValue);\n this.selectCurrentItem();\n }\n }\n\n handleKeyDown(event: KeyboardEvent): void {\n event.stopImmediatePropagation();\n\n if (event.key === Keys.TAB || event.key === Keys.ENTER) {\n this.selectCurrentItem();\n }\n }\n\n handleItemSelected(value: string): void {\n this.inputValue = value;\n this.textChanged(value);\n this.filterResult = new Array<string>();\n this.selectionChanged.emit(value);\n }\n\n private performFilter(value: string) {\n const filter = (filterList: string[], text: string) => {\n const filterResult = filterList.filter(value => {\n return text === null || text.length < 1 || value.toLowerCase().indexOf(text.toLowerCase()) > -1;\n });\n return filterResult;\n };\n\n this.filterResult = filter(this.filterList, value);\n\n this.selectedItemIndex = -1;\n }\n\n private addHighlight() {\n if (this.selectedItemIndex > -1) {\n const listItem = this.el.querySelector(`#${this.getListItemId(this.selectedItemIndex)}`);\n listItem.classList.add('highlighted');\n }\n }\n\n private removeHighlight(i: number) {\n if (i > -1) {\n const listItem = this.el.querySelector(`#${this.getListItemId(i)}`);\n listItem.classList.remove('highlighted');\n }\n }\n\n private selectCurrentItem(): void {\n if (this.selectedItemIndex >= 0) {\n const selectedItemText = this.filterResult[this.selectedItemIndex];\n this.handleItemSelected(selectedItemText);\n }\n }\n\n handleItemHovered(index: number): void {\n this.removeHighlight(this.selectedItemIndex);\n this.selectedItemIndex = index;\n this.addHighlight();\n }\n\n handleComponentFocusOut() {\n // Ensure dropdown closed on clicking or tabbing away from this component\n if (this.filterResult?.length > 0) {\n this.filterResult = new Array<string>();\n this.hasBeenFocusedAtLeastOnce = false;\n }\n }\n\n /**\n * Check if the selected option is in view, and scroll if not\n */\n private updateScroll() {\n const container = this.listContainer;\n\n const ul = container.querySelector('ul');\n const selectedItem: any = Array.from(ul.childNodes).find((item: any) => item.ariaPosInSet === `${this.selectedItemIndex + 1}`);\n\n if (container && selectedItem && container.scrollHeight + container.clientHeight) {\n selectedItem.scrollIntoView();\n }\n }\n\n private navigateSuggestions(key: Keys) {\n if (key === Keys.UP_ARROW) {\n this.removeHighlight(this.selectedItemIndex);\n this.selectedItemIndex--;\n if (this.selectedItemIndex === -2) {\n this.selectedItemIndex = this.filterResult.length - 1;\n }\n }\n if (key === Keys.DOWN_ARROW) {\n this.removeHighlight(this.selectedItemIndex);\n this.selectedItemIndex++;\n if (this.selectedItemIndex > this.filterResult.length - 1) {\n this.selectedItemIndex = -1;\n }\n }\n if (this.selectedItemIndex === -1) {\n this.inputValue = this.originalSearch;\n } else {\n const value = this.filterResult[this.selectedItemIndex];\n\n this.inputValue = value;\n\n this.addHighlight();\n }\n }\n\n private getListItemId(i: number) {\n const id = this.getId();\n return `${id}-list-item-${i}`;\n }\n\n private getId() {\n return this.el.id != '' ? this.el.id : `admiralty-typeahead-${this.internalId}`;\n }\n\n render() {\n const id = this.getId();\n const inputId = `${id}-input`;\n const hintId = `${id}-assistive-hint`;\n const listId = `${id}-list`;\n\n return (\n <Host onFocusout={_ev => this.handleComponentFocusOut()}>\n <div class=\"visually-hidden\">\n <div class=\"results-status-a\" role=\"status\" aria-atomic=\"true\" aria-live=\"polite\">\n {!this.isSilenced && this.isAlternateStatusSection ? this.statusText : ''}\n </div>\n <div class=\"results-status-b\" role=\"status\" aria-atomic=\"true\" aria-live=\"polite\">\n {!this.isSilenced && !this.isAlternateStatusSection ? this.statusText : ''}\n </div>\n </div>\n <admiralty-input\n type=\"text\"\n ref={el => (this.inputControl = el)}\n id={inputId}\n label={this.label}\n hint={this.hint}\n placeholder={this.placeholder}\n class=\"filterTextInput\"\n onKeyUp={ev => this.handleKeyPressed(ev)}\n onKeyDown={ev => this.handleKeyDown(ev)}\n onFocusin={_ev => this.handleFocusIn()}\n onFocusout={_ev => this.handleFocusOut()}\n aria-expanded={this.isFocused && this.filterResult.length > 0}\n ></admiralty-input>\n\n <span id={hintId} class=\"visually-hidden\">\n When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.\n </span>\n {this.filterResult.length > 0 ? (\n <div class=\"typeahead-list-container\" ref={el => (this.listContainer = el)}>\n <ul class=\"typeahead-list\" id={listId} role=\"listbox\">\n {this.filterResult.map((item, i) => (\n <li\n id={this.getListItemId(i)}\n onMouseDown={_ev => this.handleItemSelected(item)}\n onMouseOver={_ev => this.handleItemHovered(i)}\n aria-selected={i === this.selectedItemIndex}\n role=\"option\"\n tabindex=\"-1\"\n aria-posinset={i + 1}\n aria-setsize={this.filterResult.length}\n >\n {item}\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n <slot></slot>\n </Host>\n );\n }\n}\n\nlet id = 0;\n"],"mappings":"2GAAA,MAAMA,EAAe,grEACrB,MAAAC,EAAeD,E,MCOFE,EAAkB,M,uHACrBC,KAAAC,aAAeC,EASvBF,KAAAG,WAA4B,GAE5BH,KAAAI,mBAAqB,EACrBJ,KAAAK,UAAY,MAEZL,KAAAM,WAAa,MACbN,KAAAO,yBAA2B,MAKnBP,KAAAQ,eAAiB,GACjBR,KAAAS,0BAA4B,M,kBAdF,IAAIC,M,iHA+CA,K,CA/BtC,cAAYC,GACV,OAAOX,KAAKY,aAAaC,MAAMC,U,CAGjC,cAAYH,CAAWE,GACrBb,KAAKY,aAAaC,MAAQA,C,CAuC5B,gBAAAE,GACE,GAAIf,KAAKa,MAAO,CACdb,KAAKW,WAAaX,KAAKa,K,EAI3B,iBAAAG,GACEhB,KAAKiB,SAAW,IAAIC,kBAAiB,KACnClB,KAAKmB,qBACLC,EAAYpB,KAAK,IAEnBA,KAAKiB,SAASI,QAAQrB,KAAKsB,GAAI,CAC7BC,UAAW,KACXC,QAAS,M,CAIb,oBAAAC,GACE,GAAIzB,KAAKiB,SAAU,CACjBjB,KAAKiB,SAASS,aACd1B,KAAKiB,SAAWU,S,EAIpB,kBAAAR,GACE,MAAMS,EAAY5B,KAAKsB,GAAGO,iBAAiB,6BAC3C7B,KAAKG,WAAa,GAClByB,EAAUE,SAAQR,IAChBtB,KAAKG,WAAW4B,KAAKT,EAAGU,aAAa,SAAS,G,CAIlD,aAAAC,GACE,GAAIjC,KAAKkC,qBAAuBlC,KAAKS,0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