Browse Source
* Move search component into the component library * Migrate search fields * Reshuffle imports slightly * Remove export input module --------- Co-authored-by: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com>pull/5241/head
13 changed files with 85 additions and 55 deletions
@ -1,36 +0,0 @@ |
|||||||
import { FormsModule, ReactiveFormsModule } from "@angular/forms"; |
|
||||||
import { Meta, moduleMetadata, Story } from "@storybook/angular"; |
|
||||||
|
|
||||||
import { JslibModule } from "@bitwarden/angular/jslib.module"; |
|
||||||
import { InputModule } from "@bitwarden/components/src/input/input.module"; |
|
||||||
|
|
||||||
import { PreloadedEnglishI18nModule } from "../../../../../tests/preloaded-english-i18n.module"; |
|
||||||
|
|
||||||
import { SearchInputComponent } from "./search-input.component"; |
|
||||||
|
|
||||||
export default { |
|
||||||
title: "Web/Organizations/Search Input", |
|
||||||
component: SearchInputComponent, |
|
||||||
decorators: [ |
|
||||||
moduleMetadata({ |
|
||||||
imports: [ |
|
||||||
InputModule, |
|
||||||
FormsModule, |
|
||||||
ReactiveFormsModule, |
|
||||||
PreloadedEnglishI18nModule, |
|
||||||
JslibModule, |
|
||||||
], |
|
||||||
providers: [], |
|
||||||
}), |
|
||||||
], |
|
||||||
} as Meta; |
|
||||||
|
|
||||||
const Template: Story<SearchInputComponent> = (args: SearchInputComponent) => ({ |
|
||||||
props: args, |
|
||||||
template: ` |
|
||||||
<app-search-input [(ngModel)]="searchText" [placeholder]="placeholder" [disabled]="disabled"></app-search-input> |
|
||||||
`,
|
|
||||||
}); |
|
||||||
|
|
||||||
export const Default = Template.bind({}); |
|
||||||
Default.args = {}; |
|
||||||
@ -1,14 +1,15 @@ |
|||||||
import { NgModule } from "@angular/core"; |
import { NgModule } from "@angular/core"; |
||||||
|
|
||||||
|
import { SearchModule } from "@bitwarden/components"; |
||||||
|
|
||||||
import { SharedModule } from "../../../shared/shared.module"; |
import { SharedModule } from "../../../shared/shared.module"; |
||||||
|
|
||||||
import { AccessSelectorModule } from "./components/access-selector/access-selector.module"; |
import { AccessSelectorModule } from "./components/access-selector/access-selector.module"; |
||||||
import { CollectionDialogModule } from "./components/collection-dialog"; |
import { CollectionDialogModule } from "./components/collection-dialog"; |
||||||
import { SearchInputComponent } from "./components/search-input/search-input.component"; |
|
||||||
|
|
||||||
@NgModule({ |
@NgModule({ |
||||||
imports: [SharedModule, CollectionDialogModule, AccessSelectorModule], |
imports: [SharedModule, CollectionDialogModule, AccessSelectorModule, SearchModule], |
||||||
declarations: [SearchInputComponent], |
declarations: [], |
||||||
exports: [SharedModule, CollectionDialogModule, AccessSelectorModule, SearchInputComponent], |
exports: [SharedModule, CollectionDialogModule, AccessSelectorModule, SearchModule], |
||||||
}) |
}) |
||||||
export class SharedOrganizationModule {} |
export class SharedOrganizationModule {} |
||||||
|
|||||||
@ -0,0 +1 @@ |
|||||||
|
export * from "./search.module"; |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
import { NgModule } from "@angular/core"; |
||||||
|
import { FormsModule } from "@angular/forms"; |
||||||
|
|
||||||
|
import { InputModule } from "../input/input.module"; |
||||||
|
import { SharedModule } from "../shared"; |
||||||
|
|
||||||
|
import { SearchComponent } from "./search.component"; |
||||||
|
|
||||||
|
@NgModule({ |
||||||
|
imports: [SharedModule, InputModule, FormsModule], |
||||||
|
declarations: [SearchComponent], |
||||||
|
exports: [SearchComponent], |
||||||
|
}) |
||||||
|
export class SearchModule {} |
||||||
@ -0,0 +1,40 @@ |
|||||||
|
import { FormsModule, ReactiveFormsModule } from "@angular/forms"; |
||||||
|
import { Meta, moduleMetadata, Story } from "@storybook/angular"; |
||||||
|
|
||||||
|
import { JslibModule } from "@bitwarden/angular/jslib.module"; |
||||||
|
import { I18nService } from "@bitwarden/common/abstractions/i18n.service"; |
||||||
|
|
||||||
|
import { InputModule } from "../input/input.module"; |
||||||
|
import { I18nMockService } from "../utils/i18n-mock.service"; |
||||||
|
|
||||||
|
import { SearchComponent } from "./search.component"; |
||||||
|
|
||||||
|
export default { |
||||||
|
title: "Component Library/Form/Search", |
||||||
|
component: SearchComponent, |
||||||
|
decorators: [ |
||||||
|
moduleMetadata({ |
||||||
|
imports: [InputModule, FormsModule, ReactiveFormsModule, JslibModule], |
||||||
|
providers: [ |
||||||
|
{ |
||||||
|
provide: I18nService, |
||||||
|
useFactory: () => { |
||||||
|
return new I18nMockService({ |
||||||
|
search: "Search", |
||||||
|
}); |
||||||
|
}, |
||||||
|
}, |
||||||
|
], |
||||||
|
}), |
||||||
|
], |
||||||
|
} as Meta; |
||||||
|
|
||||||
|
const Template: Story<SearchComponent> = (args: SearchComponent) => ({ |
||||||
|
props: args, |
||||||
|
template: ` |
||||||
|
<bit-search [(ngModel)]="searchText" [placeholder]="placeholder" [disabled]="disabled"></bit-search> |
||||||
|
`,
|
||||||
|
}); |
||||||
|
|
||||||
|
export const Default = Template.bind({}); |
||||||
|
Default.args = {}; |
||||||
Loading…
Reference in new issue