type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
buscarDestino(): Observable<Contrato[]> { return this.http.get<Contrato[]>(API_URL); }
DJRICHARD15/FrontEnd
.history/src/app/services/Contrato.service_20190318084726.ts
TypeScript
MethodDeclaration
crearOActualizarDestino(contrato: Contrato): Observable<Contrato[]> { return this.http.post<Contrato[]>(API_URL_CREATE, contrato); }
DJRICHARD15/FrontEnd
.history/src/app/services/Contrato.service_20190318084726.ts
TypeScript
MethodDeclaration
delateDestino(contrato: Contrato): Observable<Contrato[]> { return this.http.post<Contrato[]>(API_URL_DELATE, contrato); }
DJRICHARD15/FrontEnd
.history/src/app/services/Contrato.service_20190318084726.ts
TypeScript
FunctionDeclaration
export function Header({ selectedGenre }: GenreResponseProps) { return ( <header> <span className="category"> Categoria:<span> {selectedGenre.title}</span> </span> </header> ); }
dunseen/ignite-template-componentizando-a-aplicacao
src/components/Header.tsx
TypeScript
InterfaceDeclaration
interface GenreResponseProps { selectedGenre: { title: string; }; }
dunseen/ignite-template-componentizando-a-aplicacao
src/components/Header.tsx
TypeScript
ClassDeclaration
//melhorar validacoes nos metodos export class RegrasController { async index(req: Request, res: Response) { if (new JsonWebToken().verificaToken(req.headers.authorization)) { try { const regrasservice = new RegrasService(); const results = await regrasservice.in...
ProximaMicrosoft/Back-End-Projeto
src/controllers/regrascontroller.ts
TypeScript
MethodDeclaration
async index(req: Request, res: Response) { if (new JsonWebToken().verificaToken(req.headers.authorization)) { try { const regrasservice = new RegrasService(); const results = await regrasservice.index() return res.json(results) } catch (er...
ProximaMicrosoft/Back-End-Projeto
src/controllers/regrascontroller.ts
TypeScript
MethodDeclaration
async create(req: Request, res: Response, next: NextFunction) { if (new JsonWebToken().verificaToken(req.headers.authorization)) { const body = req.body as Regras const regrasservice = new RegrasService() body.arquivo = req.file.filename const respostas = await r...
ProximaMicrosoft/Back-End-Projeto
src/controllers/regrascontroller.ts
TypeScript
MethodDeclaration
async delete(req: Request, res: Response, next: NextFunction) { if (new JsonWebToken().verificaToken(req.headers.authorization)) { const id = req.params.id const regrasservice = new RegrasService(); var respostas = await regrasservice.delete(id) return res.status...
ProximaMicrosoft/Back-End-Projeto
src/controllers/regrascontroller.ts
TypeScript
FunctionDeclaration
export function getCurveSelectionParamsWithInterval(q: QueryParamsWithInterval): string { switch (q.curveSelection.tag) { case CurveSelectionType.IdSelection: return "id=" + q.curveSelection.val.join(","); case CurveSelectionType.FilterSelection: return "filterId=" + q.curveSelection.val.toString...
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
FunctionDeclaration
export function getCurveSelectionParamsWithRange(q: QueryParamsWithRange): string { switch (q.curveSelection.tag) { case CurveSelectionType.IdSelection: return "id=" + q.curveSelection.val.join(","); case CurveSelectionType.FilterSelection: return "filterId=" + q.curveSelection.val.toString(); ...
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
FunctionDeclaration
export function addTimeTransformQueryParam(q: { tr?: number }): string { return q.tr ? "tr=" + q.tr.toString() : ""; }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
EnumDeclaration
export enum LastOfType { Days, Months }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
EnumDeclaration
export enum VersionSelectionType { LastN, MUV, LastOf, Version, ForMostRecent }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
EnumDeclaration
export enum CurveSelectionType { IdSelection, FilterSelection }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
EnumDeclaration
export enum ExtractionRangeType { DateRange, Period, PeriodRange, RelativeInterval }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
EnumDeclaration
export enum RelativeIntervalType { RollingWeek, RollingMonth, RollingQuarter, RollingYear, WeekToDate, MonthToDate, QuarterToDate, YearToDate }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
EnumDeclaration
export enum FillerKindType { Null="Null", NoFill="NoFill", LatestValidValue="LatestValidValue", CustomValue="CustomValue" }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type QueryParamsWithInterval = { extractionRange: ExtractionRange; curveSelection: CurveSelection; tz?: string; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type QueryParamsWithRange = { extractionRange: ExtractionRangeWithoutInterval; curveSelection: CurveSelection; tz?: string; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type ActualQueryParams = QueryParamsWithInterval & { granularity: Granularity; tr?: number; fill?: CustomFill<number> };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type AuctionQueryParams = QueryParamsWithRange
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type VersionedQueryParams = QueryParamsWithInterval & { granularity: Granularity; tr?: number; fill?: CustomFill<number> versionSelection: VersionSelection; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
type MarketAssessmentValue = { settlement?: number; open?: number; close?: number; high?: number; low?: number; volumePaid?: number; volueGiven?: number; volume?: number; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type MasQueryParams = QueryParamsWithInterval & { fill?: CustomFill<MarketAssessmentValue>; products: string[]; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type BidAskValue = { bestBidPrice?: number; bestAskPrice?: number; bestBidQuantity?: number; bestAskQuantity?: number; lastPrice?: number; lastQuantity?: number; }
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type BidAskQueryParams = QueryParamsWithInterval & { fill?: CustomFill<BidAskValue>; products: string[]; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type VersionSelection = LastN | MUV | LastOf | Version | ForMostRecent;
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type LastN = { tag: VersionSelectionType.LastN; val: number };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type MUV = { tag: VersionSelectionType.MUV };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type LastOf = { tag: VersionSelectionType.LastOf; lastOfType: LastOfType; extraction: LastOfExtractionType; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type ForMostRecent = { tag: VersionSelectionType.ForMostRecent; extraction: MostRecentExtractionType; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type LastOfExtractionType = DateRange | Period | PeriodRange;
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type MostRecentExtractionType = DateRange | Period | PeriodRange;
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type Version = { tag: VersionSelectionType.Version; val: Date };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type CurveSelection = IdSelection | FilterSelection;
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type IdSelection = { tag: CurveSelectionType.IdSelection; val: number[]; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type FilterSelection = { tag: CurveSelectionType.FilterSelection; val: number; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type ExtractionRange = | DateRange | Period | PeriodRange | RelativeInterval;
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type ExtractionRangeWithoutInterval = | DateRange | Period | PeriodRange;
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type DateRange = { tag: ExtractionRangeType.DateRange; start: Date; end: Date; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type Period = { tag: ExtractionRangeType.Period; Period: string; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type PeriodRange = { tag: ExtractionRangeType.PeriodRange; PeriodFrom: string; PeriodTo: string; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
export type RelativeInterval = { tag: ExtractionRangeType.RelativeInterval; Interval: RelativeIntervalType; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
TypeAliasDeclaration
type CustomFill<a> = | { fillerType: FillerKindType.Null; } | { fillerType: FillerKindType.NoFill; } | { fillerType: FillerKindType.LatestValidValue; fillerPeriod: string; } | { fillerType: FillerKindType.CustomValue; fillerValue: a; };
ARKlab/ArtesianSDK-JS
src/Service/Query/Data/Query.ts
TypeScript
ClassDeclaration
@ApiUseTags('Skins') @Controller('skins') export class SkinsController { constructor(private readonly skinsService: SkinsService) { } @Post() @ApiBearerAuth() @Roles(['USER_ADMIN']) @UseGuards(AuthGuard('jwt'), RolesGuard) @UsePipes(new ValidationPipe()) @ApiResponse({ status: 201, descrip...
thomashanahan/app-nestjs
src/skins/skins.controller.ts
TypeScript
MethodDeclaration
@Post() @ApiBearerAuth() @Roles(['USER_ADMIN']) @UseGuards(AuthGuard('jwt'), RolesGuard) @UsePipes(new ValidationPipe()) @ApiResponse({ status: 201, description: `${ENTITY} has been successfully created.` }) @ApiResponse({ status: 404, description: `${ENTITY} not found.` }) @ApiResponse({ s...
thomashanahan/app-nestjs
src/skins/skins.controller.ts
TypeScript
MethodDeclaration
@Get() @ApiBearerAuth() @Roles(['USER_ADMIN']) @UseGuards(AuthGuard('jwt'), RolesGuard) @UsePipes(new ValidationPipe()) @ApiImplicitQuery({ name: 'limit', type: Number, required: false }) @ApiImplicitQuery({ name: 'skip', type: Number, required: false }) @ApiImplicitQuery({ name: 'sortBy', ...
thomashanahan/app-nestjs
src/skins/skins.controller.ts
TypeScript
MethodDeclaration
@Get('/subscription') @ApiBearerAuth() @UseGuards(AuthGuard('jwt'), RolesGuard) @UsePipes(new ValidationPipe()) @ApiResponse({ status: 201, description: `${ENTITY} has been successfully created.` }) @ApiResponse({ status: 404, description: `${ENTITY} not found.` }) @ApiResponse({ status: 400, d...
thomashanahan/app-nestjs
src/skins/skins.controller.ts
TypeScript
MethodDeclaration
@Get('/:skinId') @ApiBearerAuth() @Roles(['USER_ADMIN']) @UseGuards(AuthGuard('jwt'), RolesGuard) @UsePipes(new ValidationPipe()) @ApiImplicitParam({ name: 'skinId', type: String }) @ApiResponse({ status: 201, description: `${ENTITY} has been successfully created.` }) @ApiResponse({ status:...
thomashanahan/app-nestjs
src/skins/skins.controller.ts
TypeScript
MethodDeclaration
@Put('/:skinId') @ApiBearerAuth() @Roles(['USER_ADMIN']) @UseGuards(AuthGuard('jwt'), RolesGuard) @UsePipes(new ValidationPipe()) @ApiImplicitParam({ name: 'skinId', type: String }) @ApiResponse({ status: 201, description: `${ENTITY} has been successfully created.` }) @ApiResponse({ status:...
thomashanahan/app-nestjs
src/skins/skins.controller.ts
TypeScript
MethodDeclaration
@Delete('/:skinId') @ApiBearerAuth() @Roles(['USER_ADMIN']) @UseGuards(AuthGuard('jwt'), RolesGuard) @UsePipes(new ValidationPipe()) @ApiImplicitParam({ name: 'skinId', type: String }) @ApiResponse({ status: 201, description: `${ENTITY} has been successfully created.` }) @ApiResponse({ stat...
thomashanahan/app-nestjs
src/skins/skins.controller.ts
TypeScript
ArrowFunction
<T extends any>(value: T): T | undefined => { const ref = useRef<T>(); useEffect(() => { ref.current = value; }); return ref.current; }
maxtuzz/tuzhub
client/src/components/hooks/usePrevious.tsx
TypeScript
ArrowFunction
() => { ref.current = value; }
maxtuzz/tuzhub
client/src/components/hooks/usePrevious.tsx
TypeScript
ClassDeclaration
@NgModule({ declarations: [ AppComponent, HomeComponent, StaffComponent, MeetingComponent, NewsComponent, ContactComponent, SignInComponent, NavBarComponent, SignUpComponent, ForgotPasswordComponent, VerifyEmailComponent, DashboardComponent, FooterComponent, Up...
jpvpa/polisoft
src/app/app.module.ts
TypeScript
ArrowFunction
({ color = 'transparent', onClick, contrastColor = '#ffffff' }: Props) => { const handleCircleClick = () => onClick(); const cursorClasses = className({ cursor: true, black: contrastColor !== '#ffffff' }); return ( <div className='circle' onClick={handleCircleClick}> <div className='b...
Kokoserver/khairo_ehr
khairo/static/react/src/ui/color-picker/picker-field/Circle.tsx
TypeScript
ArrowFunction
() => onClick()
Kokoserver/khairo_ehr
khairo/static/react/src/ui/color-picker/picker-field/Circle.tsx
TypeScript
TypeAliasDeclaration
type Props = { color: string; onClick: () => void; contrastColor?: string; };
Kokoserver/khairo_ehr
khairo/static/react/src/ui/color-picker/picker-field/Circle.tsx
TypeScript
FunctionDeclaration
function ActiveLink({ children, href }: any) { const router = useRouter(); const handleClick = (e: any) => { e.preventDefault(); router.push(href); }; const classActive = () => { return router.asPath === href ? 'link-secondary' : 'link-dark'; }; return ( <a href={href} onClic...
felipelssilva/invasive-species-survey
src/components/molecules/activeLink/ActiveLink.tsx
TypeScript
ArrowFunction
(e: any) => { e.preventDefault(); router.push(href); }
felipelssilva/invasive-species-survey
src/components/molecules/activeLink/ActiveLink.tsx
TypeScript
ArrowFunction
() => { return router.asPath === href ? 'link-secondary' : 'link-dark'; }
felipelssilva/invasive-species-survey
src/components/molecules/activeLink/ActiveLink.tsx
TypeScript
ClassDeclaration
/** * This is a simple entity for use during debugging. It can mark a cell in * the maze by rendering its bounds. */ export class Marker extends Entity { /** * Construct a new marker entity that will render on the stage provided. * * This needs to know the size of t...
OdatNurd/devember-2016
ts/game/entity/Marker.ts
TypeScript
FunctionDeclaration
export function OptionsControl(config: OptionsBasicConfig) { return function <T extends React.ComponentType<OptionsControlProps>>( component: T ): T { const renderer = registerOptionsControl({ ...config, component: component }); return renderer.component as any; }; }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
FunctionDeclaration
export function highlight( text: string, input?: string, hlClassName: string = 'is-matched' ) { if (!input) { return text; } text = String(text); const reg = new RegExp( input.replace(/([\$\^\*\+\-\?\.\(\)\|\[\]\\])/g, '\\$1'), 'i' ); if (!reg.test(text)) { return text; } const ...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
() => JSON.stringify([formItem.loading, formItem.filteredOptions])
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
() => this.forceUpdate()
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
(selectedOption: Option) => selectedOption[valueField || 'value']
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
() => this.normalizeValue()
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
val => typeof val === 'string' || typeof val === 'number'
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
(selectedOption: Option) => selectedOption[valueField || 'value']
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
item => item[valueField || 'value']
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
item => item === origin
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
item => item[valueField || 'value'] == value[valueField || 'value']
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
ArrowFunction
(text: string, index) => { text && dom.push(<span key={index}>{text}</span>); dom.push( <span className={hlClassName} key={`${index}-hl`}
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
InterfaceDeclaration
export interface FormOptionsControl extends FormBaseControl { /** * 选项集合 */ options?: Array<Option> | string[] | PlainObject; /** * 可用来通过 API 拉取 options。 */ source?: SchemaApi | SchemaTokenizeableString; /** * 用表达式来配置 source 接口初始要不要拉取 * * @deprecated 建议用 source 接口的 sendOn */ initF...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
InterfaceDeclaration
export interface OptionsBasicConfig extends FormItemBasicConfig { autoLoadOptionsFromSource?: boolean; }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
InterfaceDeclaration
export interface OptionsConfig extends OptionsBasicConfig { component: React.ComponentType<OptionsControlProps>; }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
InterfaceDeclaration
// 下发给注册进来的组件的属性。 export interface OptionsControlProps extends FormControlProps, Omit<FormOptionsControl, 'type'> { options: Array<Option>; onToggle: ( option: Option, submitOnChange?: boolean, changeImmediately?: boolean ) => void; onToggleAll: () => void; selectedOptions: Array<Option>; ...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
InterfaceDeclaration
// 自己接收的属性。 export interface OptionsProps extends FormControlProps, OptionProps { source?: Api; deferApi?: Api; creatable?: boolean; addApi?: Api; addControls?: Array<any>; editApi?: Api; editControls?: Array<any>; deleteApi?: Api; deleteConfirmText?: string; optionLabel?: string; }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
TypeAliasDeclaration
export type OptionsControlComponent = React.ComponentType<FormControlProps>;
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
componentWillMount() { const { initFetch, formItem, source, data, setPrinstineValue, defaultValue, multiple, joinValues, extractValue, addHook, formInited, valueField, options, value } = this.pro...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
componentDidMount() { this.normalizeValue(); }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
shouldComponentUpdate(nextProps: OptionsProps) { if (config.strictMode === false || nextProps.strictMode === false) { return true; } else if (nextProps.source || nextProps.autoComplete) { return true; } if (anyChanged(detectProps, this.props, nextProps)) { return true; ...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
componentDidUpdate(prevProps: OptionsProps) { const props = this.props; const formItem = props.formItem as IFormItemStore; if (!formItem || !props.formInited) { return; } else if (!prevProps.formItem) { // todo 优化 name 变化情况。 } if (prevProps.value !== props.value ||...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
componentWillUnmount() { this.props.removeHook && this.props.removeHook(this.reload, 'init'); this.reaction && this.reaction(); }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
normalizeValue() { const { joinValues, extractValue, value, multiple, formItem, valueField } = this.props; if (!formItem || joinValues !== false || !formItem.options.length) { return; } if ( extractValue === false && ...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
getWrappedInstance() { return this.input; }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind inputRef(ref: any) { this.input = ref; }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind handleToggle( option: Option, submitOnChange?: boolean, changeImmediately?: boolean ) { const { onChange, joinValues, extractValue, valueField, delimiter, clearable, resetValue, multiple, formItem, ...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind handleToggleAll() { const { value, onChange, joinValues, extractValue, valueField, delimiter, resetValue, multiple, formItem } = this.props; if (!formItem) { return; } const selectedOptions = f...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
// 当有 action 触发,如果指定了 reload 目标组件,有可能会来到这里面来 @autobind reload() { return this.reloadOptions(); }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind reloadOptions(setError?: boolean) { const {source, formItem, data, onChange} = this.props; if (formItem && isPureVariable(source as string)) { formItem.setOptions( normalizeOptions( resolveVariableAndFilter(source as string, data, '| raw') || [] ) ...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind deferLoad(option: Option) { const {deferApi, source, env, formItem, data} = this.props; if (option.loaded) { return; } const api = option.deferApi || deferApi || source; if (!api) { env.notify( 'error', '请在选项中设置 `deferApi` 或者表单项中设置 `def...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind async initOptions(data: any) { await this.reload(); const {formItem, name} = this.props; if (!formItem) { return; } if (isAlive(formItem) && formItem.value) { setVariable(data, name!, formItem.value); } }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
focus() { this.input && this.input.focus && this.input.focus(); }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind setOptions(options: Array<any>, skipNormalize = false) { const formItem = this.props.formItem as IFormItemStore; formItem && formItem.setOptions( skipNormalize ? options : normalizeOptions(options || []) ); }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind syncOptions() { const formItem = this.props.formItem as IFormItemStore; formItem && formItem.syncOptions(); }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind setLoading(value: boolean) { const formItem = this.props.formItem as IFormItemStore; formItem && formItem.setLoading(value); }
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind async handleOptionAdd( idx: number | Array<number> = -1, value: any, skipForm: boolean = false ) { let { addControls, disabled, labelField, onOpenDialog, optionLabel, addApi, source, data, valueField, ...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript
MethodDeclaration
@autobind async handleOptionEdit( value: any, origin: any = value, skipForm: boolean = false ) { let { editControls, disabled, labelField, onOpenDialog, editApi, env, source, data, formItem: model, optionLab...
EasonYi/amis
src/renderers/Form/Options.tsx
TypeScript