type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
type=>word
Bronson-Brown-deVost/koa-sqe-api
db/entities/scroll_version.ts
TypeScript
ArrowFunction
word=>word.scroll_versions
Bronson-Brown-deVost/koa-sqe-api
db/entities/scroll_version.ts
TypeScript
ClassDeclaration
@Entity("scroll_version",{schema:"SQE_DEV"}) @Index("fk_scroll_version_to_user_idx",["user_",]) @Index("fk_scroll_version_tos_vg_idx",["scroll_version_group_",]) export class scroll_version { @PrimaryGeneratedColumn({ name:"scroll_version_id" }) scroll_version_id:number; @Ma...
Bronson-Brown-deVost/koa-sqe-api
db/entities/scroll_version.ts
TypeScript
ArrowFunction
({ title = "Watch lot", ...props }) => { return ( <Icon {...props} viewBox="0 0 18 18"> <Title>{title}</Title> <Path d="M14.591 12.229a8.82 8.82 0 0 1-1.653-4.979V5.938a3.938 3.938 0 1 0-7.876 0V7.25a8.82 8.82 0 0 1-1.653 4.979.446.446 0 0 0-.053.464c.074.15.227.245.394.245h2.949a2.336 2....
pepopowitz/palette
packages/palette/src/svgs/BellIcon.tsx
TypeScript
MethodDeclaration
color(props
pepopowitz/palette
packages/palette/src/svgs/BellIcon.tsx
TypeScript
ArrowFunction
element => { this.form.get(element.split("/")).disable(); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
ArrowFunction
element => { this.form.get(element.split("/")).enable(); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
ArrowFunction
value => { if (value) { this.map_cfg.features = value; value.forEach(feature => { switch(feature.type){ case 'occupazione': this.form.get('affected_area').patchValue(feature.features[0] || ''); break; } }); console.log("D...
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
ArrowFunction
feature => { switch(feature.type){ case 'occupazione': this.form.get('affected_area').patchValue(feature.features[0] || ''); break; } }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
ArrowFunction
error => { console.log('errore mappa'); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'view-occupazione-suolo-pubblico', templateUrl: './view-occupazione-suolo-pubblico.component.html', styleUrls: ['./view-occupazione-suolo-pubblico.component.scss'] }) export class ViewOccupazioneSuoloPubblicoComponent implements OnInit { form: FormGroup; @Input() data: any; @Input()...
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.form = this.formService.createDetailsOccupazioneAreePubbliche(); this.form.patchValue(this.data); this.patchDate(); this.form.disable(); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
resetDetails(){ this.form.patchValue(this.data); this.patchDate(); this.form.disable(); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
patchDate(){ this.form.get('start_date').patchValue(this.formService.convertItalianDate(this.data.start_date)); if(this.data.end_date){ this.form.get('end_date').patchValue(this.formService.convertItalianDate(this.data.end_date)); } }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
changeTipologia(event: any, target: string[]){ let value = event.value if(value === 'permanent'){ target.forEach(element => { this.form.get(element.split("/")).disable(); }); } else { target.forEach(element => { this.form.get(element.split("/")).enable(); }); } ...
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
minDate(){ var result = new Date(); result.setDate(result.getDate() + 20); return result; }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
differenceDate(form: AbstractControl, value1: string, value2: string, dest: string) { if (form.get(value1).value === null || form.get(value1).value === '' || form.get(value2).value === undefined) return; if (form.get(value2).value === null || form.get(value2).value === '' || form.get(value2).value === un...
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
calculateMinDate(form: AbstractControl, target: string) { if (form.get(target).value === null || form.get(target).value === '') return; let date: any = new Date(form.get(target).value); return new Date(date.setDate(date.getDate())); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
changeOther(event: any, control: AbstractControl){ switch(event.checked){ case true: control.enable(); control.updateValueAndValidity(); break; case false: control.disable() control.updateValueAndValidity(); break; } }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
modify(){ if(this.can_modify){ this.form.disable(); this.resetDetails(); } else { this.form.enable(); this.form.get('start_date').disable(); this.form.get('end_date').disable(); } this.can_modify = !this.can_modify; }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
save(){ if(this.form.valid){ this.isLoading = true let result = this.form.getRawValue(); this.formatData(result); this.update_details.next({details: result}); } else { this.validationService.validateAllFormFields(this.form); } }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
completeModify(){ this.isLoading = false; this.can_modify = false; this.form.disable(); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
abortModify(){ this.isLoading = false; }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
formatData(body: any){ if(body.end_date){ body.end_date = formatDate(body.end_date, "yyyy-MM-dd", "en"); } if(body.start_date){ body.start_date = formatDate(body.start_date, "yyyy-MM-dd", "en"); } }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
getErrorMessage(control: AbstractControl) { return this.validationService.getErrorMessage(control); }
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
MethodDeclaration
openMap() { event.preventDefault(); event.stopPropagation(); let features = [ { type: 'occupazione', features: this.form.get('affected_area').value != '' ? [this.form.get('affected_area').value] : [] } ] this.map_cfg.features = features; this.dialog.openMap(this.map_...
oikosengineering/suefrontend
src/app/core/components/shared/details/view-occupazione-suolo-pubblico/view-occupazione-suolo-pubblico.component.ts
TypeScript
ArrowFunction
(params) => { const { target, command, projectName, version } = params; const outputDir = `../${projectName}_qqgame`; if (command == 'build') { return { outputDir, commands: [ new CleanPlugin({ matchers: ["js", "resource"] }), ...
DRL9/egret-core
tools/templates/empty/scripts/config.qqgame.ts
TypeScript
ArrowFunction
() => { const clientForm = shallow( <ClientForm isClientFormVisible={true} createClient={({}) => {}}
humanoidsbv/team-awesome-dylan
src/components/client-form/__tests__/ClientForm.test.tsx
TypeScript
ArrowFunction
() => { const toggleClientFormSpy = jest.fn(); const clientForm = shallow( <ClientForm isClientFormVisible={true} createClient={({}) => {}}
humanoidsbv/team-awesome-dylan
src/components/client-form/__tests__/ClientForm.test.tsx
TypeScript
ArrowFunction
(l) => l.Key === test
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
ArrowFunction
(l) => l.Key.startsWith(this.props.genlocales[0].Key)
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
ArrowFunction
(l) => ( <MenuItem value={l.Key}
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
ArrowFunction
(l) => l.Key.startsWith(this.state.selectedGenLocale)
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
ArrowFunction
(l) => ( <MenuItem value={l.Key}
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
ArrowFunction
(p) => ( <MenuItem value={p.Key}
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
ClassDeclaration
export default class PacksPage extends React.Component< IPacksPageProps, IPacksPageState > { constructor(props: IPacksPageProps) { super(props); this.state = { selectedGenLocale: props.genlocales.length === 0 ? "" : props.genlocales[0].Key, selectedLocale: props.locales.length...
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
InterfaceDeclaration
interface IPacksPageProps { module: IAppModule; packages: { Key: string; Value: string }[]; locales: { Key: string; Value: string }[]; genlocales: { Key: string; Value: string }[]; }
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
InterfaceDeclaration
interface IPacksPageState { selectedPackage: number; selectedGenLocale: string; selectedLocale: string; }
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
MethodDeclaration
private findBestLocale(genLocale: string): string { var test = `${genLocale}-${genLocale.toUpperCase()}`; var res = this.props.locales.filter((l) => l.Key === test); if (res.length > 0) { return res[0].Key; } return this.props.locales.filter((l) => l.Key.startsWith(this.props.genlocales...
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
MethodDeclaration
public render(): JSX.Element { return ( <div> <div className={styles.page}> <div className={styles.dddiv}> <FormControl style={{ minWidth: "200px" }}> <Select value={this.state.selectedGenLocale} onChange={(e) => th...
DNN-Connect/LanguagePackManager
Client/Js/LpManager/Components/Packs/PacksPage.tsx
TypeScript
ArrowFunction
() => { const pluginId = "c061d18abea0"; let activityService: ActivityService; let userSettingsService: UserSettingsService; let syncService: SyncService; let component: FitnessTrendComponent; let fixture: ComponentFixture<FitnessTrendComponent>; beforeEach((done: Function) => { spyOn(ExternalUpdatesServic...
Jeecie/elevate
plugin/app/src/app/fitness-trend/fitness-trend.component.spec.ts
TypeScript
ArrowFunction
(done: Function) => { spyOn(ExternalUpdatesService, "getBrowserExternalMessages").and.returnValue({ addListener: (request: any, sender: chrome.runtime.MessageSender) => { } }); spyOn(ExternalUpdatesService, "getBrowserPluginId").and.returnValue(pluginId); TestBed.configureTestingModule({ imports: [...
Jeecie/elevate
plugin/app/src/app/fitness-trend/fitness-trend.component.spec.ts
TypeScript
ArrowFunction
(request: any, sender: chrome.runtime.MessageSender) => { }
Jeecie/elevate
plugin/app/src/app/fitness-trend/fitness-trend.component.spec.ts
TypeScript
ArrowFunction
(done: Function) => { expect(component).toBeTruthy(); done(); }
Jeecie/elevate
plugin/app/src/app/fitness-trend/fitness-trend.component.spec.ts
TypeScript
ArrowFunction
(done: Function) => { // Given component.fitnessTrendConfigModel.heartRateImpulseMode = HeartRateImpulseMode.HRSS; component.isTrainingZonesEnabled = true; component.isPowerMeterEnabled = true; component.isSwimEnabled = true; component.isEBikeRidesEnabled = true; const localStorageGetItemSpy = spyOn(loc...
Jeecie/elevate
plugin/app/src/app/fitness-trend/fitness-trend.component.spec.ts
TypeScript
ArrowFunction
(done: Function) => { // Given component.fitnessTrendConfigModel.heartRateImpulseMode = HeartRateImpulseMode.TRIMP; component.isTrainingZonesEnabled = true; component.isPowerMeterEnabled = true; component.isSwimEnabled = true; component.isEBikeRidesEnabled = true; const localStorageGetItemSpy = spyOn(lo...
Jeecie/elevate
plugin/app/src/app/fitness-trend/fitness-trend.component.spec.ts
TypeScript
ArrowFunction
() => { const toast = useToast() const formik = useFormik({ initialValues: { nickname: '', username: '', email: '', password: '' }, validationSchema: SignUpSchema, onSubmit: async (values) => { values.username = values.username.toLowerCase() await signUp(values).catch(({ code }: { code: str...
apolofreitas/fluentlevel
src/screens/SignUpScreen.tsx
TypeScript
ArrowFunction
async (values) => { values.username = values.username.toLowerCase() await signUp(values).catch(({ code }: { code: string }) => { if (code === 'auth/username-already-in-use') { showSimpleToast(toast, 'Nome de usuário já em uso') } else if (code === 'auth/email-already-in-use') { ...
apolofreitas/fluentlevel
src/screens/SignUpScreen.tsx
TypeScript
ArrowFunction
({ code }: { code: string }) => { if (code === 'auth/username-already-in-use') { showSimpleToast(toast, 'Nome de usuário já em uso') } else if (code === 'auth/email-already-in-use') { showSimpleToast(toast, 'Email já cadastrado') } else if (code === 'auth/invalid-email') { ...
apolofreitas/fluentlevel
src/screens/SignUpScreen.tsx
TypeScript
MethodDeclaration
isPasswordShowing ? ( <Icon as={Feather} name="eye-off" size={4} color="primary.500" /> ) : ( <Icon as={Feather} name="eye" size={4} color="primary.500"
apolofreitas/fluentlevel
src/screens/SignUpScreen.tsx
TypeScript
ArrowFunction
(hours) => hours / 24
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(rads) => rads * 24
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(turbidity) => { CommandManager.instance.setPropertyOnSelection('turbidity', turbidity) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(rayleigh) => { CommandManager.instance.setPropertyOnSelection('rayleigh', rayleigh) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(luminance) => { CommandManager.instance.setPropertyOnSelection('luminance', luminance) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(mieCoefficient) => { CommandManager.instance.setPropertyOnSelection('mieCoefficient', mieCoefficient) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(mieDirectionalG) => { CommandManager.instance.setPropertyOnSelection('mieDirectionalG', mieDirectionalG) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(inclination) => { CommandManager.instance.setPropertyOnSelection('inclination', inclination) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(azimuth) => { CommandManager.instance.setPropertyOnSelection('azimuth', azimuth) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(distance) => { CommandManager.instance.setPropertyOnSelection('distance', distance) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(backgroundType) => { CommandManager.instance.setPropertyOnSelection('backgroundType', backgroundType) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(path) => { CommandManager.instance.setPropertyOnSelection('equirectangularPath', path) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(path) => { CommandManager.instance.setPropertyOnSelection('cubemapPath', path) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(backgroundColor) => { CommandManager.instance.setPropertyOnSelection('backgroundColor', backgroundColor) }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(node) => ( <> <NumericInputGroup name="Time of Day"
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(value, onChange) => ( <> <InputGroup name="Texture"
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(node) => ( <> <InputGroup name="Color"
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
(node) => { switch (node.backgroundType) { case SkyTypeEnum.equirectangular as any: return this.renderTextureSettings((node as any).equirectangularPath, this.onChangeEquirectangularPathOption) case SkyTypeEnum.cubemap as any: return this.renderTextureSettings((node as any).cubemapPath, ...
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ClassDeclaration
/** * SkyboxNodeEditor component class used to render editor view to customize component property. * * @author Robert Long * @type {class component} */ export class SkyboxNodeEditor extends Component<SkyboxNodeEditorProps, {}> { //defining iconComponent with icon name static iconComponent = Cloud static desc...
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
TypeAliasDeclaration
/** * SkyboxNodeEditorProps declaring props for SkyboxNodeEditor. * * @author Robert Long * @type {Object} */ type SkyboxNodeEditorProps = { node?: object t: Function }
EpsilonCoder/xr3ngine
packages/editor/src/components/properties/SkyboxNodeEditor.tsx
TypeScript
ArrowFunction
() => { return Bluebird.fromCallback( fs.readFile.bind( null, node.path ) ) }
dodevops/socko-converter-file
lib/converter/CartridgeNodeConverter.ts
TypeScript
ClassDeclaration
/** * A node converter for socko-api's CartridgeNodeInterfaces */ export class CartridgeNodeConverter implements NodeConverterInterface { private _log: Logger constructor () { this._log = getLogger('socko-converter-file:converter:CartridgeNodeConverter') } public isEligible (options: ConverterOptionsInt...
dodevops/socko-converter-file
lib/converter/CartridgeNodeConverter.ts
TypeScript
MethodDeclaration
public isEligible (options: ConverterOptionsInterface, node: FileNode): boolean { let check = node.name.endsWith(options.cartridgeNodeExtension) if (check) { this._log.debug('This is a Cartridge node.') } return check }
dodevops/socko-converter-file
lib/converter/CartridgeNodeConverter.ts
TypeScript
MethodDeclaration
public convert (options: ConverterOptionsInterface, node: FileNode): Bluebird<SockoNodeInterface> { let name = node.name.slice(0, node.name.indexOf(options.cartridgeNodeExtension)) return Bluebird.resolve( new CartridgeNodeBuilder() .withName(name) .withReadContent( () => { ...
dodevops/socko-converter-file
lib/converter/CartridgeNodeConverter.ts
TypeScript
ArrowFunction
photosVideos => { this.photosVideos = photosVideos; }
Tortu-Ch/Angular-Fuse-demo
src/app/main/pages/profile/tabs/photos-videos/photos-videos.component.ts
TypeScript
ClassDeclaration
@Component({ selector : 'profile-photos-videos', templateUrl : './photos-videos.component.html', styleUrls : ['./photos-videos.component.scss'], encapsulation: ViewEncapsulation.None, animations : fuseAnimations }) export class ProfilePhotosVideosComponent implements OnInit, OnDestroy { ...
Tortu-Ch/Angular-Fuse-demo
src/app/main/pages/profile/tabs/photos-videos/photos-videos.component.ts
TypeScript
MethodDeclaration
// ----------------------------------------------------------------------------------------------------- // @ Lifecycle hooks // ----------------------------------------------------------------------------------------------------- /** * On init */ ngOnInit(): void { this._profileService.photosVide...
Tortu-Ch/Angular-Fuse-demo
src/app/main/pages/profile/tabs/photos-videos/photos-videos.component.ts
TypeScript
MethodDeclaration
/** * On destroy */ ngOnDestroy(): void { // Unsubscribe from all subscriptions this._unsubscribeAll.next(); this._unsubscribeAll.complete(); }
Tortu-Ch/Angular-Fuse-demo
src/app/main/pages/profile/tabs/photos-videos/photos-videos.component.ts
TypeScript
ClassDeclaration
/** * HTTPエラー。Variant Also Negotiates. */ class HttpVariantAlsoNegotiatesException extends HttpException { /** * @constructor * @public * @param {number} status * @param {string} code=null * @param {string} message="" */ constructor(status:number, code:string=null, message:string="") { super(status,...
sakura-internet/saklient.node
src/saklient/errors/HttpVariantAlsoNegotiatesException.ts
TypeScript
FunctionDeclaration
function assignOptionIds( options: (OptionDescriptor | ActionListItemDescriptor)[], comboBoxId: string, ): OptionDescriptor[] | ActionListItemDescriptor[] { options.map( ( option: OptionDescriptor | ActionListItemDescriptor, optionIndex: number, ) => { option.id = `${comboBoxId}-${optio...
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
FunctionDeclaration
function optionsAreEqual( firstOptions: (OptionDescriptor | ActionListItemDescriptor)[], secondOptions: (OptionDescriptor | ActionListItemDescriptor)[], ) { if (firstOptions.length !== secondOptions.length) { return false; } return firstOptions.every( (firstItem: OptionDescriptor | ActionListItemDesc...
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
FunctionDeclaration
function isOption( navigableOption: OptionDescriptor | ActionListItemDescriptor, ): navigableOption is OptionDescriptor { return (navigableOption as OptionDescriptor).value !== undefined; }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
FunctionDeclaration
function filterForOptions( mixedArray: (ActionListItemDescriptor | OptionDescriptor)[], ): OptionDescriptor[] { return mixedArray.filter((item) => isOption(item)) as OptionDescriptor[]; }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
(subscriberCallback) => subscriberCallback()
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
(callback: () => void) => { this.subscriptions.push(callback); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
(callback: () => void) => { this.subscriptions = this.subscriptions.filter( (subscription) => subscription !== callback, ); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
(subscription) => subscription !== callback
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { this.selectNextOption(); this.handlePopoverOpen; }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { this.selectPreviousOption(); this.handlePopoverOpen; }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { const {selectedOption} = this.state; if (this.state.popoverActive && selectedOption) { if (isOption(selectedOption)) { this.handleSelection(selectedOption.value); } else { selectedOption.onAction && selectedOption.onAction(); } } this.handlePopoverOpen; }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { this.setState({popoverActive: true, popoverWasActive: true}); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { this.setState({popoverActive: false, popoverWasActive: false}, () => { this.resetVisuallySelectedOptions(); }); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { this.resetVisuallySelectedOptions(); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { !this.state.popoverActive && this.setState({popoverActive: true}); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
(newSelected: string) => { const {selected, allowMultiple} = this.props; let newlySelectedOptions = selected; if (selected.includes(newSelected)) { newlySelectedOptions.splice(newlySelectedOptions.indexOf(newSelected), 1); } else if (allowMultiple) { newlySelectedOptions.push(newSelected); ...
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
(selected: string[]) => { const {onSelect, allowMultiple} = this.props; selected && onSelect(selected); if (!allowMultiple) { this.resetVisuallySelectedOptions(); this.setState({popoverActive: false, popoverWasActive: false}); } }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
( newOptions: (OptionDescriptor | ActionListItemDescriptor)[], ) => { const {selectedIndex, selectedOption} = this.state; if (selectedOption && newOptions.includes(selectedOption)) { this.selectOptionAtIndex(newOptions.indexOf(selectedOption)); } else if (selectedIndex > newOptions.length - 1) ...
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { const {navigableOptions} = this.state; this.setState({ selectedOption: undefined, selectedIndex: -1, }); navigableOptions && navigableOptions.forEach((option) => { option.active = false; }); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
(option) => { option.active = false; }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript
ArrowFunction
() => { this.setState({popoverActive: false, popoverWasActive: false}); }
Amit-A/polaris-react
src/components/Autocomplete/components/ComboBox/ComboBox.tsx
TypeScript