type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
(e) => update(e, v) | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
ArrowFunction |
(x) => {
phasors.forEach((i) => {
parametric.map((e) => update(e, i)).forEach((y) => {
const {model, value} = shunt(undefined, series(join(x, y)));
expect(project(model, [v, i])).toBeCloseTo([v, sub(i, solve(value.model, [v, rect(0)])[1])]);
});
});
} | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
ArrowFunction |
(i) => {
parametric.map((e) => update(e, i)).forEach((y) => {
const {model, value} = shunt(undefined, series(join(x, y)));
expect(project(model, [v, i])).toBeCloseTo([v, sub(i, solve(value.model, [v, rect(0)])[1])]);
});
} | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
ArrowFunction |
(e) => update(e, i) | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
ArrowFunction |
(y) => {
const {model, value} = shunt(undefined, series(join(x, y)));
expect(project(model, [v, i])).toBeCloseTo([v, sub(i, solve(value.model, [v, rect(0)])[1])]);
} | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
ArrowFunction |
() => {
elements.forEach((next) => {
expect(unpack(pack(shunt(next)))).toEqual(shunt(next));
elements.forEach((value) => {
expect(unpack(pack(shunt(next, series(value))))).toEqual(shunt(next, series(value)));
});
});
} | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
ArrowFunction |
(next) => {
expect(unpack(pack(shunt(next)))).toEqual(shunt(next));
elements.forEach((value) => {
expect(unpack(pack(shunt(next, series(value))))).toEqual(shunt(next, series(value)));
});
} | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
ArrowFunction |
(value) => {
expect(unpack(pack(shunt(next, series(value))))).toEqual(shunt(next, series(value)));
} | sandeep12407/voelectric | spec/lib/element.spec/shunt.spec.ts | TypeScript |
FunctionDeclaration |
async function genComptroller(world: World, from: string, params: Event): Promise<World> {
let {world: nextWorld, comptrollerImpl: comptroller, comptrollerImplData: comptrollerData} = await buildComptrollerImpl(world, from, params);
world = nextWorld;
world = addAction(
world,
`Added Comptroller (${comp... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setProtocolPaused(world: World, from: string, comptroller: Comptroller, isPaused: boolean): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setProtocolPaused(isPaused), from, ComptrollerErrorReporter);
world = addAction(
world,
`Comptroller: set protocol paused to... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setMaxAssets(world: World, from: string, comptroller: Comptroller, numberOfAssets: NumberV): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setMaxAssets(numberOfAssets.encode()), from, ComptrollerErrorReporter);
world = addAction(
world,
`Set max assets to ${numb... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setLiquidationIncentive(world: World, from: string, comptroller: Comptroller, liquidationIncentive: NumberV): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setLiquidationIncentive(liquidationIncentive.encode()), from, ComptrollerErrorReporter);
world = addAction(
wo... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function supportMarket(world: World, from: string, comptroller: Comptroller, vToken: VToken): Promise<World> {
if (world.dryRun) {
// Skip this specifically on dry runs since it's likely to crash due to a number of reasons
world.printer.printLine(`Dry run: Supporting market \`${vToken._address}\``);
... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function unlistMarket(world: World, from: string, comptroller: Comptroller, vToken: VToken): Promise<World> {
let invokation = await invoke(world, comptroller.methods.unlist(vToken._address), from, ComptrollerErrorReporter);
world = addAction(
world,
`Unlisted market ${vToken.name}`,
invokation
... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function enterMarkets(world: World, from: string, comptroller: Comptroller, assets: string[]): Promise<World> {
let invokation = await invoke(world, comptroller.methods.enterMarkets(assets), from, ComptrollerErrorReporter);
world = addAction(
world,
`Called enter assets ${assets} as ${describeUser(w... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function exitMarket(world: World, from: string, comptroller: Comptroller, asset: string): Promise<World> {
let invokation = await invoke(world, comptroller.methods.exitMarket(asset), from, ComptrollerErrorReporter);
world = addAction(
world,
`Called exit market ${asset} as ${describeUser(world, from... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setPriceOracle(world: World, from: string, comptroller: Comptroller, priceOracleAddr: string): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setPriceOracle(priceOracleAddr), from, ComptrollerErrorReporter);
world = addAction(
world,
`Set price oracle for to ${pr... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setCollateralFactor(world: World, from: string, comptroller: Comptroller, vToken: VToken, collateralFactor: NumberV): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setCollateralFactor(vToken._address, collateralFactor.encode()), from, ComptrollerErrorReporter);
world = ... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setCloseFactor(world: World, from: string, comptroller: Comptroller, closeFactor: NumberV): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setCloseFactor(closeFactor.encode()), from, ComptrollerErrorReporter);
world = addAction(
world,
`Set close factor to ${clos... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function fastForward(world: World, from: string, comptroller: Comptroller, blocks: NumberV): Promise<World> {
let invokation = await invoke(world, comptroller.methods.fastForward(blocks.encode()), from, ComptrollerErrorReporter);
world = addAction(
world,
`Fast forward ${blocks.show()} blocks to #${... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function sendAny(world: World, from:string, comptroller: Comptroller, signature: string, callArgs: string[]): Promise<World> {
const fnData = encodeABI(world, signature, callArgs);
await world.web3.eth.sendTransaction({
to: comptroller._address,
data: fnData,
from: from
})
return worl... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function addVenusMarkets(world: World, from: string, comptroller: Comptroller, vTokens: VToken[]): Promise<World> {
let invokation = await invoke(world, comptroller.methods._addVenusMarkets(vTokens.map(c => c._address)), from, ComptrollerErrorReporter);
world = addAction(
world,
`Added Venus markets... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function dropVenusMarket(world: World, from: string, comptroller: Comptroller, vToken: VToken): Promise<World> {
let invokation = await invoke(world, comptroller.methods._dropVenusMarket(vToken._address), from, ComptrollerErrorReporter);
world = addAction(
world,
`Drop Venus market ${vToken.name}`,
... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function refreshVenusSpeeds(world: World, from: string, comptroller: Comptroller): Promise<World> {
let invokation = await invoke(world, comptroller.methods.refreshVenusSpeeds(), from, ComptrollerErrorReporter);
world = addAction(
world,
`Refreshed Venus speeds`,
invokation
);
return world;... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function claimVenus(world: World, from: string, comptroller: Comptroller, holder: string): Promise<World> {
let invokation = await invoke(world, comptroller.methods.claimVenus(holder), from, ComptrollerErrorReporter);
world = addAction(
world,
`XVS claimed by ${holder}`,
invokation
);
retur... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setVenusRate(world: World, from: string, comptroller: Comptroller, rate: NumberV): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setVenusRate(rate.encode()), from, ComptrollerErrorReporter);
world = addAction(
world,
`XVS rate set to ${rate.show()}`,
invokat... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setVenusSpeed(world: World, from: string, comptroller: Comptroller, vToken: VToken, speed: NumberV): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setVenusSpeed(vToken._address, speed.encode()), from, ComptrollerErrorReporter);
world = addAction(
world,
`Venus s... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function printLiquidity(world: World, comptroller: Comptroller): Promise<World> {
let enterEvents = await getPastEvents(world, comptroller, 'StdComptroller', 'MarketEntered');
let addresses = enterEvents.map((event) => event.returnValues['account']);
let uniq = [...new Set(addresses)];
world.printer.pri... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setPendingAdmin(world: World, from: string, comptroller: Comptroller, newPendingAdmin: string): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setPendingAdmin(newPendingAdmin), from, ComptrollerErrorReporter);
world = addAction(
world,
`Comptroller: ${describeUse... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function acceptAdmin(world: World, from: string, comptroller: Comptroller): Promise<World> {
let invokation = await invoke(world, comptroller.methods._acceptAdmin(), from, ComptrollerErrorReporter);
world = addAction(
world,
`Comptroller: ${describeUser(world, from)} accepts admin`,
invokation
... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setMarketBorrowCaps(world: World, from: string, comptroller: Comptroller, vTokens: VToken[], borrowCaps: NumberV[]): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setMarketBorrowCaps(vTokens.map(c => c._address), borrowCaps.map(c => c.encode())), from, ComptrollerErrorRepo... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
async function setBorrowCapGuardian(world: World, from: string, comptroller: Comptroller, newBorrowCapGuardian: string): Promise<World> {
let invokation = await invoke(world, comptroller.methods._setBorrowCapGuardian(newBorrowCapGuardian), from, ComptrollerErrorReporter);
world = addAction(
world,
`Comptr... | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
FunctionDeclaration |
export async function processComptrollerEvent(world: World, event: Event, from: string | null): Promise<World> {
return await processCommandEvent<any>("Comptroller", comptrollerCommands(), world, event, from);
} | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
c => c._address | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(event) => event.returnValues['account'] | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
async (address) => {
let userLiquidity = await getLiquidity(world, comptroller, address);
return [address, userLiquidity.val];
} | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
([address, liquidity]) => {
world.printer.printLine(`\t${world.settings.lookupAlias(address)}: ${liquidity / 1e18}e18`)
} | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
c => c.encode() | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptrollerParams}) => genComptroller(world, from, comptrollerParams.val) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, isPaused}) => setProtocolPaused(world, from, comptroller, isPaused.val) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vToken}) => supportMarket(world, from, comptroller, vToken) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vToken}) => unlistMarket(world, from, comptroller, vToken) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vTokens}) => enterMarkets(world, from, comptroller, vTokens.map((c) => c._address)) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(c) => c._address | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vToken}) => exitMarket(world, from, comptroller, vToken._address) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, maxAssets}) => setMaxAssets(world, from, comptroller, maxAssets) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, liquidationIncentive}) => setLiquidationIncentive(world, from, comptroller, liquidationIncentive) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, priceOracle}) => setPriceOracle(world, from, comptroller, priceOracle.val) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vToken, collateralFactor}) => setCollateralFactor(world, from, comptroller, vToken, collateralFactor) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, closeFactor}) => setCloseFactor(world, from, comptroller, closeFactor) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, newPendingAdmin}) => setPendingAdmin(world, from, comptroller, newPendingAdmin.val) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller}) => acceptAdmin(world, from, comptroller) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, blocks}) => fastForward(world, from, comptroller, blocks) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, {comptroller}) => printLiquidity(world, comptroller) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, {comptroller, input}) => decodeCall(world, comptroller, input.val) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, signature, callArgs}) => sendAny(world, from, comptroller, signature.val, rawValues(callArgs)) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vTokens}) => addVenusMarkets(world, from, comptroller, vTokens) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vToken}) => dropVenusMarket(world, from, comptroller, vToken) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller}) => refreshVenusSpeeds(world, from, comptroller) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, holder}) => claimVenus(world, from, comptroller, holder.val) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, rate}) => setVenusRate(world, from, comptroller, rate) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, vToken, speed}) => setVenusSpeed(world, from, comptroller, vToken, speed) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller,vTokens,borrowCaps}) => setMarketBorrowCaps(world, from, comptroller, vTokens, borrowCaps) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
ArrowFunction |
(world, from, {comptroller, newBorrowCapGuardian}) => setBorrowCapGuardian(world, from, comptroller, newBorrowCapGuardian.val) | NuttakitDW/siam-protocol | scenario/src/Event/ComptrollerEvent.ts | TypeScript |
InterfaceDeclaration |
export interface OAuthParams {
scope: string;
client_id: string;
client_secret: string;
} | 127001/angular | libs/auth/src/lib/auth/models/oauth-params.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-employee-confirm',
templateUrl: './employee-confirm.component.html',
styleUrls: ['./employee-confirm.component.css']
})
export class EmployeeConfirmComponent implements OnInit {
constructor(public dialogRef: MdDialogRef<EmployeeConfirmComponent>) { }
ngOnInit() {
}
} | afghifariii/btpn-final-project | employee-frontend/src/app/employee/employee-confirm/employee-confirm.component.ts | TypeScript |
FunctionDeclaration | /**
* A manifest file that defines the custom resource provider resources.
* API Version: 2018-09-01-preview.
*/
export function getCustomResourceProvider(args: GetCustomResourceProviderArgs, opts?: pulumi.InvokeOptions): Promise<GetCustomResourceProviderResult> {
if (!opts) {
opts = {}
}
if (!o... | polivbr/pulumi-azure-native | sdk/nodejs/customproviders/getCustomResourceProvider.ts | TypeScript |
InterfaceDeclaration |
export interface GetCustomResourceProviderArgs {
/**
* The name of the resource group.
*/
resourceGroupName: string;
/**
* The name of the resource provider.
*/
resourceProviderName: string;
} | polivbr/pulumi-azure-native | sdk/nodejs/customproviders/getCustomResourceProvider.ts | TypeScript |
InterfaceDeclaration | /**
* A manifest file that defines the custom resource provider resources.
*/
export interface GetCustomResourceProviderResult {
/**
* A list of actions that the custom resource provider implements.
*/
readonly actions?: outputs.customproviders.CustomRPActionRouteDefinitionResponse[];
/**
*... | polivbr/pulumi-azure-native | sdk/nodejs/customproviders/getCustomResourceProvider.ts | TypeScript |
FunctionDeclaration |
export function TaskList() {
const [tasks, setTasks] = useState<Task[]>([]);
const [newTaskTitle, setNewTaskTitle] = useState('');
function handleCreateNewTask() {
// Crie uma nova task com um id random, não permita criar caso o título seja vazio.
if(!newTaskTitle) return;
const newTask = {
... | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
FunctionDeclaration |
function handleCreateNewTask() {
// Crie uma nova task com um id random, não permita criar caso o título seja vazio.
if(!newTaskTitle) return;
const newTask = {
id: Math.random(),
title: newTaskTitle,
isComplete: false,
}
setTasks(oldState => [...oldState, newTask]);
setNew... | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
FunctionDeclaration |
function handleToggleTaskCompletion(id: number) {
// Altere entre `true` ou `false` o campo `isComplete` de uma task com dado ID
const newTasks = tasks.map(task => task.id === id ? {
...task,
isComplete: !task.isComplete
} : task);
setTasks(newTasks)
} | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
FunctionDeclaration |
function handleRemoveTask(id: number) {
// Remova uma task da listagem pelo ID
const filteredTasks = tasks.filter(task => task.id !== id);
setTasks(filteredTasks)
} | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
ArrowFunction |
oldState => [...oldState, newTask] | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
ArrowFunction |
task => task.id === id ? {
...task,
isComplete: !task.isComplete
} : task | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
ArrowFunction |
task => task.id !== id | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
ArrowFunction |
task => (
<li key={task.id}>
<div className | Artur-17/ignite-challenge-01 | src/components/TaskList.tsx | TypeScript |
ClassDeclaration |
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class EmpresaRoutingModule { } | DaniGo-1/Proyecto-byte | byteViews/src/app/components/empresa/empresa-routing.module.ts | TypeScript |
FunctionDeclaration |
function getNextMode(currentMode: CalendarMode) {
if (currentMode === 'year') {
return 'month';
}
if (currentMode === 'month') {
return 'day';
}
return 'year';
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
FunctionDeclaration |
function getPrevMode(currentMode: CalendarMode) {
if (currentMode === 'day') {
return 'month';
}
if (currentMode === 'month') {
return 'year';
}
return 'day';
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
() => {
const {
value,
dateFormat,
markColor,
marked,
localization,
minDate,
maxDate,
tabIndex,
pickerWidth,
pickerStyle,
allowSameEndDate,
} = this.props;
let { initialDate } = this.props;
const {
disable,
enable,
in... | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(e: React.SyntheticEvent<HTMLElement>, { value }: DatesRangePickerOnChangeData) => {
const { dateFormat } = this.props;
const {
start,
end,
} = value;
this.setState({
inputStart: start,
inputEnd: end,
}, () => this.state.mode !== 'day' && this.switchToNextMode());
let ... | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
() => this.state.mode !== 'day' && this.switchToNextMode() | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(e: React.SyntheticEvent<HTMLElement>, { value }: BasePickerOnChangeData): void => {
this.setState({
displayYear: value.year,
}, () => this.switchToNextMode());
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
() => this.switchToNextMode() | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(e: React.SyntheticEvent<HTMLElement>, { value }: BasePickerOnChangeData): void => {
const {
year,
month,
} = value;
this.setState({
displayYear: year,
displayMonth: month,
}, () => this.switchToNextMode());
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(): void => {
this.setState(({ mode }) => {
return { mode: getNextMode(mode) };
}, this.onModeSwitch);
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
({ mode }) => {
return { mode: getNextMode(mode) };
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(): void => {
tick(this.switchToNextModeUndelayed);
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(): void => {
this.setState(({ mode }) => {
return { mode: getPrevMode(mode) };
}, this.onModeSwitch);
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
({ mode }) => {
return { mode: getPrevMode(mode) };
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(): void => {
tick(this.switchToPrevModeUndelayed);
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
ArrowFunction |
(e: React.SyntheticEvent<HTMLElement>, data: any) => {
const { start, end } = parseDatesRange(data.value, this.props.dateFormat);
this.setState({
inputStart: start,
inputEnd: end,
});
this.props.onChange(e, data);
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
InterfaceDeclaration |
interface DatesRangeInputState extends BaseInputState {
mode: CalendarMode;
inputStart: Moment;
inputEnd: Moment;
displayYear: number;
displayMonth: number;
} | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
TypeAliasDeclaration |
type CalendarMode = 'year' | 'month' | 'day'; | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
TypeAliasDeclaration |
export type DatesRangeInputProps =
& BaseInputProps
& DateRelatedProps
& MarkedValuesProps
& MinMaxValueProps
& RangeRelatedProps; | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
TypeAliasDeclaration |
export type DatesRangeInputOnChangeData = DatesRangeInputProps; | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
MethodDeclaration |
public render() {
const {
value,
dateFormat,
initialDate,
maxDate,
minDate,
closable,
marked,
markColor,
localization,
allowSameEndDate,
...rest
} = this.props;
return (
<InputView
popupIsClosed={this.state.popupIsClosed}
... | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
MethodDeclaration |
getDisabledYears(disableParsed) | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
MethodDeclaration |
getDisabledMonths(disableParsed) | zheyujie/semantic-ui-calendar-react | src/inputs/DatesRangeInput.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.