Skip to content

Commit b8a1efd

Browse files
committed
feat: add "make findable" to navigation bar
1 parent ede5ff1 commit b8a1efd

File tree

4 files changed

+52
-9
lines changed

4 files changed

+52
-9
lines changed

elements/src/components.d.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ export namespace Components {
8080
}
8181
interface PosLoginForm {
8282
}
83+
interface PosMakeFindable {
84+
"uri": string;
85+
}
8386
interface PosNavigationBar {
8487
"uri": string;
8588
}
@@ -188,6 +191,10 @@ export interface PosLoginFormCustomEvent<T> extends CustomEvent<T> {
188191
detail: T;
189192
target: HTMLPosLoginFormElement;
190193
}
194+
export interface PosMakeFindableCustomEvent<T> extends CustomEvent<T> {
195+
detail: T;
196+
target: HTMLPosMakeFindableElement;
197+
}
191198
export interface PosNavigationBarCustomEvent<T> extends CustomEvent<T> {
192199
detail: T;
193200
target: HTMLPosNavigationBarElement;
@@ -542,6 +549,23 @@ declare global {
542549
prototype: HTMLPosLoginFormElement;
543550
new (): HTMLPosLoginFormElement;
544551
};
552+
interface HTMLPosMakeFindableElementEventMap {
553+
"pod-os:init": any;
554+
}
555+
interface HTMLPosMakeFindableElement extends Components.PosMakeFindable, HTMLStencilElement {
556+
addEventListener<K extends keyof HTMLPosMakeFindableElementEventMap>(type: K, listener: (this: HTMLPosMakeFindableElement, ev: PosMakeFindableCustomEvent<HTMLPosMakeFindableElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
557+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
558+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
559+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
560+
removeEventListener<K extends keyof HTMLPosMakeFindableElementEventMap>(type: K, listener: (this: HTMLPosMakeFindableElement, ev: PosMakeFindableCustomEvent<HTMLPosMakeFindableElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
561+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
562+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
563+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
564+
}
565+
var HTMLPosMakeFindableElement: {
566+
prototype: HTMLPosMakeFindableElement;
567+
new (): HTMLPosMakeFindableElement;
568+
};
545569
interface HTMLPosNavigationBarElementEventMap {
546570
"pod-os:init": any;
547571
"pod-os:link": any;
@@ -804,6 +828,7 @@ declare global {
804828
"pos-literals": HTMLPosLiteralsElement;
805829
"pos-login": HTMLPosLoginElement;
806830
"pos-login-form": HTMLPosLoginFormElement;
831+
"pos-make-findable": HTMLPosMakeFindableElement;
807832
"pos-navigation-bar": HTMLPosNavigationBarElement;
808833
"pos-new-thing-form": HTMLPosNewThingFormElement;
809834
"pos-picture": HTMLPosPictureElement;
@@ -930,6 +955,10 @@ declare namespace LocalJSX {
930955
*/
931956
"onPod-os:idp-url-selected"?: (event: PosLoginFormCustomEvent<any>) => void;
932957
}
958+
interface PosMakeFindable {
959+
"onPod-os:init"?: (event: PosMakeFindableCustomEvent<any>) => void;
960+
"uri": string;
961+
}
933962
interface PosNavigationBar {
934963
"onPod-os:init"?: (event: PosNavigationBarCustomEvent<any>) => void;
935964
"onPod-os:link"?: (event: PosNavigationBarCustomEvent<any>) => void;
@@ -1036,6 +1065,7 @@ declare namespace LocalJSX {
10361065
"pos-literals": PosLiterals;
10371066
"pos-login": PosLogin;
10381067
"pos-login-form": PosLoginForm;
1068+
"pos-make-findable": PosMakeFindable;
10391069
"pos-navigation-bar": PosNavigationBar;
10401070
"pos-new-thing-form": PosNewThingForm;
10411071
"pos-picture": PosPicture;
@@ -1088,6 +1118,7 @@ declare module "@stencil/core" {
10881118
"pos-literals": LocalJSX.PosLiterals & JSXBase.HTMLAttributes<HTMLPosLiteralsElement>;
10891119
"pos-login": LocalJSX.PosLogin & JSXBase.HTMLAttributes<HTMLPosLoginElement>;
10901120
"pos-login-form": LocalJSX.PosLoginForm & JSXBase.HTMLAttributes<HTMLPosLoginFormElement>;
1121+
"pos-make-findable": LocalJSX.PosMakeFindable & JSXBase.HTMLAttributes<HTMLPosMakeFindableElement>;
10911122
"pos-navigation-bar": LocalJSX.PosNavigationBar & JSXBase.HTMLAttributes<HTMLPosNavigationBarElement>;
10921123
"pos-new-thing-form": LocalJSX.PosNewThingForm & JSXBase.HTMLAttributes<HTMLPosNewThingFormElement>;
10931124
"pos-picture": LocalJSX.PosPicture & JSXBase.HTMLAttributes<HTMLPosPictureElement>;

elements/src/components/pos-navigation-bar/pos-navigation-bar.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@
4141
--description-color: var(--color-grey-200);
4242
--uri-color: var(--color-grey-200);
4343
}
44+
45+
.bar {
46+
display: flex;
47+
flex-direction: row;
48+
align-items: center;
49+
}

elements/src/components/pos-navigation-bar/pos-navigation-bar.spec.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ describe('pos-navigation-bar', () => {
1414
<pos-navigation-bar uri="https://pod.example/resource">
1515
<mock:shadow-root>
1616
<form>
17-
<ion-searchbar debounce="300" enterkeyhint="search" placeholder="Search or enter URI" value="https://pod.example/resource"></ion-searchbar>
17+
<div class="bar">
18+
<pos-make-findable uri="https://pod.example/resource"></pos-make-findable>
19+
<ion-searchbar debounce="300" enterkeyhint="search" placeholder="Search or enter URI" value="https://pod.example/resource"></ion-searchbar>
20+
</div>
1821
</form>
1922
</mock:shadow-root>
2023
</pos-navigation-bar>`);

elements/src/components/pos-navigation-bar/pos-navigation-bar.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,17 @@ export class PosNavigationBar implements PodOsAware {
9393
render() {
9494
return (
9595
<form onSubmit={e => this.onSubmit(e)}>
96-
<ion-searchbar
97-
enterkeyhint="search"
98-
placeholder="Search or enter URI"
99-
value={this.uri}
100-
debounce={300}
101-
onIonChange={e => this.onChange(e)}
102-
onIonInput={e => this.onChange(e)}
103-
/>
96+
<div class="bar">
97+
<pos-make-findable uri={this.uri}></pos-make-findable>
98+
<ion-searchbar
99+
enterkeyhint="search"
100+
placeholder="Search or enter URI"
101+
value={this.uri}
102+
debounce={300}
103+
onIonChange={e => this.onChange(e)}
104+
onIonInput={e => this.onChange(e)}
105+
/>
106+
</div>
104107
{this.suggestions.length > 0 ? (
105108
<div class="suggestions">
106109
<ol>

0 commit comments

Comments
 (0)