type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
done => { const callStream = new Http2CallStream( 'foo', {} as Http2Channel, callStreamArgs, filterStackFactory ); const http2Stream = new ClientHttp2StreamMock({ payload: Buffer.concat([serialize(message), serialize(message)]), // 42 bytes ...
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
done => { const callStream = new Http2CallStream( 'foo', {} as Http2Channel, callStreamArgs, filterStackFactory ); const http2Stream = new ClientHttp2StreamMock({ payload: Buffer.alloc(0), frameLengths: [], }); let streamFlushed = false; ...
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
(chunk: Buffer) => { const dataLength = chunk.readInt32BE(1); const encodedMessage = chunk.slice(5).toString('utf8'); assert.strictEqual(dataLength, message.length); assert.strictEqual(encodedMessage, message); streamFlushed = true; }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
() => { // Ensure this is called only after contents are written to http2Stream assert.ok(streamFlushed); }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
done => { const callStream = new Http2CallStream( 'foo', {} as Http2Channel, callStreamArgs, filterStackFactory ); const http2Stream = new ClientHttp2StreamMock({ payload: Buffer.alloc(0), frameLengths: [], }); http2Stream.once( 'wri...
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
(chunk: Buffer) => { const dataLength = chunk.readInt32BE(1); const encodedMessage = chunk.slice(5).toString('utf8'); assert.strictEqual(dataLength, message.length); assert.strictEqual(encodedMessage, message); }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
() => { const callStream = new Http2CallStream( 'foo', {} as Http2Channel, callStreamArgs, filterStackFactory ); const http2Stream = new ClientHttp2StreamMock({ payload: Buffer.alloc(0), frameLengths: [], }); callStream.once( 'status...
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
status => { assert.strictEqual(status.code, Status.INTERNAL); }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ClassDeclaration
class ClientHttp2StreamMock extends stream.Duplex implements http2.ClientHttp2Stream { constructor(private readonly dataFrames: DataFrames) { super(); } emitResponse(responseCode: number, metadata?: Metadata) { this.emit('response', { [HTTP2_HEADER_STATUS]: responseCode, ...(metadata ? meta...
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
InterfaceDeclaration
interface DataFrames { payload: Buffer; frameLengths: number[]; }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
MethodDeclaration
emitResponse(responseCode: number, metadata?: Metadata) { this.emit('response', { [HTTP2_HEADER_STATUS]: responseCode, ...(metadata ? metadata.toHttp2Headers() : {}), }); }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
MethodDeclaration
_read() { if (this.dataFrame === this.dataFrames.frameLengths.length) { if (this.bytesRead < this.dataFrames.payload.length) { this.push( this.dataFrames.payload.slice( this.bytesRead, this.dataFrames.payload.length ) ); } this.push(null...
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
MethodDeclaration
_write(chunk: Buffer, encoding: string, cb: Function) { this.emit('write', chunk); cb(); }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
MethodDeclaration
sendTrailers(headers: OutgoingHttpHeaders) { return this; }
SProst/grpc-node
packages/grpc-js/test/test-call-stream.ts
TypeScript
ArrowFunction
medium => this.requestOtpAction(medium)
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
ArrowFunction
action => action != null
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
ArrowFunction
() => { this.addSub(this.authService.newOtp({ medium }).subscribe(res => { this.notificationService.snackBar(this.i18n.password.otpSent((res || []).join(', '))); this.otpSent.emit(null); })); }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
ArrowFunction
res => { this.notificationService.snackBar(this.i18n.password.otpSent((res || []).join(', '))); this.otpSent.emit(null); }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
ArrowFunction
() => this.i18n.password.otpReceiveBySent(medium)
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
ClassDeclaration
/** * Component used to display a password input */ @Component({ selector: 'password-input', templateUrl: 'password-input.component.html', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: PasswordInputComponent, multi: true }, { provide: NG_VALID...
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { super.ngOnInit(); const input = this.passwordInput; // Initialize the one-time-password fields this.otp = input.mode === PasswordModeEnum.OTP; if (this.otp) { this.otpActions = (input.otpSendMediums || []) .map(medium => this.requestOtpAction(medium)) .filt...
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
/** * Returns an action to request a new OTP * @param medium The send medium */ private requestOtpAction(medium: SendMediumEnum): ActionWithIcon { let icon: string; let label: string; switch (medium) { case SendMediumEnum.EMAIL: icon = 'email'; label = this.i18n.general.sendMe...
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
vkKey(combination: string) { this.enteredVKPassword.push(combination); this.updateVKButtons(); }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
vkClear() { this.enteredVKPassword = []; this.updateVKButtons(); }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
vkBack() { this.enteredVKPassword.splice(this.enteredVKPassword.length - 1, 1); this.updateVKButtons(); }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
private updateVKButtons(): void { if (this.enteredVKPassword.length < this.passwordInput.buttons.length) { this.currentVKCombinations = chunk(this.passwordInput.buttons[this.enteredVKPassword.length], this.passwordInput.buttonsPerRow); } this.formControl.setValue(this.enteredVKPassword.length === 0 ?...
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
onDisabledChange(isDisabled: boolean): void { if (this.passwordField && this.passwordField.nativeElement) { this.passwordField.nativeElement.disabled = isDisabled; } }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
focus() { if (this.passwordField && this.passwordField.nativeElement) { this.passwordField.nativeElement.focus(); } }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
// Validator methods validate(c: AbstractControl): ValidationErrors { if (!c.touched) { return null; } const value = c.value; if (value == null || value === '') { return { required: true, }; } return null; }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
otpDisableMessageFunction(medium: string): (remaining: number) => string { return () => this.i18n.password.otpReceiveBySent(medium); }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
MethodDeclaration
registerOnValidatorChange() { }
Kcire6/CyclosInfoUGT
src/app/shared/password-input.component.ts
TypeScript
FunctionDeclaration
function WeeklyChart(PlyFirebase) { function arrayToObject(arr) { const res = {}; arr.forEach(curr => { res[curr.chordKey] = curr; }); return res; } function createWeeklyChart(weeklyChart: WeeklyChart) { // convert songs into objects weeklyChart.songs = this.arrayToObject(weeklyC...
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
FunctionDeclaration
function arrayToObject(arr) { const res = {}; arr.forEach(curr => { res[curr.chordKey] = curr; }); return res; }
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
FunctionDeclaration
function createWeeklyChart(weeklyChart: WeeklyChart) { // convert songs into objects weeklyChart.songs = this.arrayToObject(weeklyChart.songs); return new Promise((resolve, reject) => { PlyFirebase.insert('weeklyCharts', weeklyChart) .then(result => resolve(result)) .catch(error => rejec...
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
FunctionDeclaration
function getLatestChart() { return new Promise((resolve, reject) => { PlyFirebase.selecteByAggregate('weeklyCharts', 'dateCreated') .then(result => resolve(result)) .catch(error => reject(error)); }); }
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
ArrowFunction
curr => { res[curr.chordKey] = curr; }
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
ArrowFunction
(resolve, reject) => { PlyFirebase.insert('weeklyCharts', weeklyChart) .then(result => resolve(result)) .catch(error => reject(error)); }
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
ArrowFunction
result => resolve(result)
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
ArrowFunction
error => reject(error)
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
ArrowFunction
(resolve, reject) => { PlyFirebase.selecteByAggregate('weeklyCharts', 'dateCreated') .then(result => resolve(result)) .catch(error => reject(error)); }
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
InterfaceDeclaration
interface Song { artist: string; title: string; rank: number; chordKey: string; }
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
InterfaceDeclaration
interface WeeklyChart { dateCreated: number; weekNumber: number; year: number; songs: Song[]; }
team-playalong/playalong-monorepo
packages/playalong-web/app/pages/ply-weekly-chart/weeklyChart.service.ts
TypeScript
ClassDeclaration
@Module({ imports: [], controllers: [AppController, ProductsController, DiscordController], providers: [AppService, ProductsService, DiscordService], }) export class AppModule {}
decent-linuxxx/rest_api
src/app.module.ts
TypeScript
ClassDeclaration
export class CreateCategoryDto { @IsString() @IsNotEmpty() readonly name: string; @IsString() @IsNotEmpty() readonly description: string; }
kasteion/javascript-backend-learning-route
0018-backend-nestjs/platzi-store/src/dto/category.dto.ts
TypeScript
ClassDeclaration
export class UpdateCategoryDto extends PartialType(CreateCategoryDto) {}
kasteion/javascript-backend-learning-route
0018-backend-nestjs/platzi-store/src/dto/category.dto.ts
TypeScript
ArrowFunction
({ loading, item, ticker, onToggle, checked }) => { const { t } = useTranslation(); if (loading) { return <UnlockTokensRowSkeleton />; } const date = item.timestamp.format("DD MMM YYYY"); const time = item.timestamp.format("HH:mm:ss"); const relativeTime = item.timestamp.fromNow(); return ( <TableRow> ...
NayiemWillems/desktop-wallet-1
src/domains/transaction/components/UnlockTokens/blocks/UnlockTokensSelect/UnlockTokensRow.tsx
TypeScript
MethodDeclaration
t("TRANSACTION.UNLOCK_TOKENS.UNLOCKABLE")
NayiemWillems/desktop-wallet-1
src/domains/transaction/components/UnlockTokens/blocks/UnlockTokensSelect/UnlockTokensRow.tsx
TypeScript
MethodDeclaration
t("TRANSACTION.UNLOCK_TOKENS.LOCKED")
NayiemWillems/desktop-wallet-1
src/domains/transaction/components/UnlockTokens/blocks/UnlockTokensSelect/UnlockTokensRow.tsx
TypeScript
ClassDeclaration
export default class User { id: number; username: string; bio: string; profile_name: string; avatar: string; style?: string; constructor( id: number, username: string, avatar: string, bio: string, profile_name: string ) { this.id = id; this.username = username; this.ava...
pacokleitz/strugl
client/lib/user.ts
TypeScript
ArrowFunction
(event: Event) => { if (!this.props.open) { return; } <<<<<<< HEAD if ( this.menuRef.current && !this.menuRef.current.contains(event.target as Node) ) { this.props.setOpen(false); } }
gxchris95/stave
src/app/components/burgerMenu/BurgerMenu.tsx
TypeScript
ArrowFunction
child => { const props = {onClick: () => this.props.setOpen(!this.props.open)}; if (React.isValidElement(child)) { return React.cloneElement(child, props); } return child; }
gxchris95/stave
src/app/components/burgerMenu/BurgerMenu.tsx
TypeScript
ArrowFunction
() => this.props.setOpen(!this.props.open)
gxchris95/stave
src/app/components/burgerMenu/BurgerMenu.tsx
TypeScript
ClassDeclaration
class BurgerMenu extends React.Component<{open: boolean; setOpen: Function}> { ======= import { StyledBurger } from './StyledBurger'; import { StyledMenu } from './StyledMenu'; class BurgerMenu extends React.Component<{open: boolean, setOpen: Function}> { >>>>>>> 6fe7a7deb55bd77f5f91c4e387bc7ec9e2da9486 private men...
gxchris95/stave
src/app/components/burgerMenu/BurgerMenu.tsx
TypeScript
MethodDeclaration
componentDidMount() { document.addEventListener('mousedown', this.handleClickOutside); }
gxchris95/stave
src/app/components/burgerMenu/BurgerMenu.tsx
TypeScript
MethodDeclaration
componentWillUnmount() { document.removeEventListener('mousedown', this.handleClickOutside); }
gxchris95/stave
src/app/components/burgerMenu/BurgerMenu.tsx
TypeScript
MethodDeclaration
render() { const childrenWithProps = React.Children.map(this.props.children, child => { const props = {onClick: () => this.props.setOpen(!this.props.open)}; if (React.isValidElement(child)) { return React.cloneElement(child, props); } return child; }); return ( <div r...
gxchris95/stave
src/app/components/burgerMenu/BurgerMenu.tsx
TypeScript
ArrowFunction
e => { this._currentSnippets.length = 0; let selectFn: (snippet: ISnippet) => boolean; if (e.selection.isEmpty()) { // empty selection -> real text (no whitespace) left of cursor const prefix = getNonWhitespacePrefix(editor.getModel(), editor.getPosition()); selectFn = prefix && (snippet => ends...
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
ArrowFunction
snippet => endsWith(prefix, snippet.prefix)
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
ArrowFunction
snippet => selected === snippet.prefix
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
ArrowFunction
s => { if (selectFn(s)) { this._currentSnippets.push(s); } return true; }
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
ArrowFunction
x => x.performSnippetCompletions()
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
ClassDeclaration
@commonEditorContribution export class TabCompletionController implements editorCommon.IEditorContribution { private static ID = 'editor.tabCompletionController'; static ContextKey = new RawContextKey<boolean>('hasSnippetCompletions', undefined); public static get(editor: editorCommon.ICommonCodeEditor): TabCompl...
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
MethodDeclaration
public static get(editor: editorCommon.ICommonCodeEditor): TabCompletionController { return editor.getContribution<TabCompletionController>(TabCompletionController.ID); }
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
MethodDeclaration
dispose(): void { this._cursorChangeSubscription.dispose(); }
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
MethodDeclaration
performSnippetCompletions(): void { if (this._currentSnippets.length === 1) { const snippet = this._currentSnippets[0]; this._snippetController.insert(snippet.codeSnippet, snippet.prefix.length, 0); // } else { // todo@joh - show suggest widget with proposals } }
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
MethodDeclaration
getId(): string { return TabCompletionController.ID; }
BugraC/vscode
src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts
TypeScript
ClassDeclaration
@Injectable() export class PlaylistParser { parse($body) { const $playlists = $body.find('div.list_album').eq(0).find('li'); const self = this; const playlists = $playlists.map(function (i, elem) { return self.getPlaylist($(this)); }).get(); return pla...
huuthanhla/RankSong
src/modules/online/home/playlist.parser.ts
TypeScript
MethodDeclaration
parse($body) { const $playlists = $body.find('div.list_album').eq(0).find('li'); const self = this; const playlists = $playlists.map(function (i, elem) { return self.getPlaylist($(this)); }).get(); return playlists; }
huuthanhla/RankSong
src/modules/online/home/playlist.parser.ts
TypeScript
MethodDeclaration
private getPlaylist($playlist) { const $name = $playlist.find('div.info_album a.name_song'); const name = $name.text(); const $singer = $playlist.find('div.info_album a.name_singer'); const singer = $singer.map(function (i, elem) { return $(this).text(); }).get().jo...
huuthanhla/RankSong
src/modules/online/home/playlist.parser.ts
TypeScript
ArrowFunction
({ duration = 1, delay = 0, circle = false, co, width, height = '100%', className, ...props }: SkeletonProps & React.ComponentPropsWithoutRef<'div'>) => { const computedClassNames = clsx(className); const theme = useTheme() as Theme; const styles = css({ width: width, height: height, ...
fogcity/components
src/components/Skeleton/index.tsx
TypeScript
TypeAliasDeclaration
type SkeletonProps = { duration?: number; delay?: number; circle?: boolean; width?: string; height?: string; co?: ((theme: Theme) => React.CSSProperties) | React.CSSProperties; };
fogcity/components
src/components/Skeleton/index.tsx
TypeScript
FunctionDeclaration
export default function ButtonDemo() { return ( <Page title="Button 按钮" className="button-demo"> <Block title="按钮颜色"> <Space> <Button variant="contained" color="primary"> 主要按钮 </Button> <Button variant="contained" color="info"> 信息按钮 </...
bingtsingw/taroify
packages/demo/src/pages/basic/button/index.tsx
TypeScript
ArrowFunction
(auction: AuctionView) => { const [priceUSD, setPriceUSD] = useState<number | undefined>(undefined) const id = auction?.thumbnail?.metadata?.pubkey const tokenInfo = useTokenList().subscribedTokens.filter( m => m.address == auction.auction.info.tokenMint )[0] const { amount: _amount } = useAuctionStatus...
Muffintechxyz/metaplex
js/packages/web/src/hooks/useNFTData.tsx
TypeScript
ArrowFunction
m => m.address == auction.auction.info.tokenMint
Muffintechxyz/metaplex
js/packages/web/src/hooks/useNFTData.tsx
TypeScript
ArrowFunction
a => a.tokenMint == tokenInfo?.address
Muffintechxyz/metaplex
js/packages/web/src/hooks/useNFTData.tsx
TypeScript
ArrowFunction
() => { setPriceUSD(tokenPrice * amount) }
Muffintechxyz/metaplex
js/packages/web/src/hooks/useNFTData.tsx
TypeScript
InterfaceDeclaration
interface IInputArtifact { account: string id: string }
Rossalli/charlescd
butler/src/app/v2/core/integrations/spinnaker/connector/utils/base-stage-helm.ts
TypeScript
InterfaceDeclaration
export interface IBaseHelmStage { stageEnabled: IStageEnabled | Record<string, unknown> completeOtherBranchesThenFail: false continuePipeline: true failPipeline: false expectedArtifacts: ICreateProduceArtifact[] inputArtifacts: IInputArtifact[] name: string namespace: string outputName: string over...
Rossalli/charlescd
butler/src/app/v2/core/integrations/spinnaker/connector/utils/base-stage-helm.ts
TypeScript
ArrowFunction
(event) => this._button_click(event)
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
ClassDeclaration
export abstract class AbstractButtonView extends WidgetView { model: AbstractButton protected icon_views: {[key: string]: AbstractIconView} protected buttonEl: HTMLButtonElement initialize(options: any): void { super.initialize(options) this.icon_views = {} this.render() } connect_signals()...
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
ClassDeclaration
export abstract class AbstractButton extends Widget { constructor(attrs?: Partial<AbstractButton.Attrs>, opts?: AbstractButton.Opts) { super(attrs, opts) } static initClass() { this.prototype.type = "AbstractButton" this.define({ label: [ p.String, "Button" ], icon: [ p.I...
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
InterfaceDeclaration
export interface Attrs extends Widget.Attrs { label: string icon: AbstractIcon button_type: ButtonType callback: any // XXX }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
InterfaceDeclaration
export interface Opts extends Widget.Opts {}
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
InterfaceDeclaration
export interface AbstractButton extends AbstractButton.Attrs {}
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
TypeAliasDeclaration
export type ButtonType = "default" | "primary" | "success" | "warning" | "danger" | "link"
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
initialize(options: any): void { super.initialize(options) this.icon_views = {} this.render() }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
connect_signals(): void { super.connect_signals() this.connect(this.model.change, () => this.render()) }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
remove(): void { remove_views(this.icon_views) super.remove() }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
_render_button(...children: (string | HTMLElement)[]): HTMLButtonElement { return button({ type: "button", disabled: this.model.disabled, class: [`bk-bs-btn`, `bk-bs-btn-${this.model.button_type}`], }, ...children) }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
render(): void { super.render() empty(this.el) this.buttonEl = this._render_button(this.model.label) this.buttonEl.addEventListener("click", (event) => this._button_click(event)) this.el.appendChild(this.buttonEl) const icon = this.model.icon if (icon != null) { build_views(this.ico...
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
_button_click(event: Event): void { event.preventDefault() this.change_input() }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
change_input(): void { if (this.model.callback != null) this.model.callback.execute(this.model) }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
MethodDeclaration
static initClass() { this.prototype.type = "AbstractButton" this.define({ label: [ p.String, "Button" ], icon: [ p.Instance ], button_type: [ p.String, "default" ], // TODO (bev) callback: [ p.Instance ], }) }
hanteng/bokeh
bokehjs/src/coffee/models/widgets/abstract_button.ts
TypeScript
ArrowFunction
(ref: Toaster) => (this.toaster = ref)
FAWLKTZ/fiddle
src/renderer/components/commands-action-button.tsx
TypeScript
ArrowFunction
() => !!appState.gitHubToken || !appState.isTokenDialogShowing
FAWLKTZ/fiddle
src/renderer/components/commands-action-button.tsx
TypeScript
ArrowFunction
() => !appState.isGenericDialogShowing
FAWLKTZ/fiddle
src/renderer/components/commands-action-button.tsx
TypeScript
ArrowFunction
() => { let text; if (gistId) { text = actionType; } else if (activeGistAction === GistActionState.updating) { text = 'Updating...'; } else if (activeGistAction === GistActionState.publishing) { text = 'Publishing...'; } else if (activeGistAction === GistActionStat...
FAWLKTZ/fiddle
src/renderer/components/commands-action-button.tsx
TypeScript
ArrowFunction
() => { switch (actionType) { case GistActionType.publish: return 'upload'; case GistActionType.update: return 'refresh'; case GistActionType.delete: return 'delete'; } }
FAWLKTZ/fiddle
src/renderer/components/commands-action-button.tsx
TypeScript
ArrowFunction
() => { const { gistId } = this.props.appState; const { actionType } = this.state; if (!gistId) { return null; } const menu = ( <Menu> <MenuItem text="Publish" active={actionType === GistActionType.publish}
FAWLKTZ/fiddle
src/renderer/components/commands-action-button.tsx
TypeScript
ArrowFunction
() => { const { gitHubPublishAsPublic, gistId } = this.props.appState; const { actionType } = this.state; if (gistId && actionType !== GistActionType.publish) { return null; } const privacyIcon = gitHubPublishAsPublic ? 'unlock' : 'lock'; const privacyMenu = ( <Menu> <Menu...
FAWLKTZ/fiddle
src/renderer/components/commands-action-button.tsx
TypeScript