type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ClassDeclaration |
@Injectable({ providedIn: "root" })
export class GlobalSidebarService implements OnDestroy {
public references: Observable<Array<SidebarRef<any>>>;
public sidebarContent: SidebarContentComponent = null;
public sidebar: MatSidenav = null;
private _references: BehaviorSubject<Map<string, SidebarRef<any... | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class SidebarManager {
constructor(private reference: GlobalSidebarService, private injector: Injector) {
}
/**
* @param id: Unique id for that form. This will allow it to persist
* @param componentType: Component class you want to init inside the sidebar
* @param reset... | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration |
public ngOnDestroy() {
this._references.unsubscribe();
} | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration |
public has(id: string): boolean {
return this._references.value.has(id);
} | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration |
public get(id: string): SidebarRef<any> {
return this._references.value.get(id);
} | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration |
public delete(id: string): boolean {
const references = this._references.value;
const result = references.delete(id);
this._references.next(references);
return result;
} | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration |
public set(id: string, ref: SidebarRef<any>) {
const references = this._references.value;
this._references.value.set(id, ref);
this._references.next(references);
} | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration | /**
* @param id: Unique id for that form. This will allow it to persist
* @param componentType: Component class you want to init inside the sidebar
* @param resetOnOpen: By default when the sidebar is closed indirecly the component will still
* be there so you can resume work. This will make sure it... | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration |
public reopen<T>(sidebarRef: SidebarRef<T>) {
const id = sidebarRef.id;
if (this.reference.has(id)) {
this.reference.sidebarContent.display(this.reference.get(id));
this.reference.sidebar.open();
} else {
log.error(`Unkown sidebar reference with id '${id}'. M... | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration | /**
* This will just close the sidebar. All the reference will be saved.
*/
public close() {
this.reference.sidebar.close();
} | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
MethodDeclaration | /**
* Close the sidebar and remove the reference.
*/
public destroy<T>(sidebarRef: SidebarRef<T>) {
this.reference.sidebarContent.destroy(sidebarRef);
this.reference.delete(sidebarRef.id);
} | Azure/BatchExplorer | src/@batch-flask/ui/sidebar/sidebar-manager.ts | TypeScript |
ClassDeclaration |
export class CustomGenerator extends Generator {
public force: boolean;
public dependencies: string[];
public answers: Record<string, unknown>;
public configurationPath: string;
} | Acidburn0zzz/webpack-cli | packages/generators/src/types/index.ts | TypeScript |
ArrowFunction |
() => {
let imageMapper: ImageMapper;
const imagesMockData = [
{
name: 'front S',
type: 'Image',
imageActualHeight: 110,
imageActualWidth: 110,
viewID: 'front',
effectiveUrl: '/INTERSHOP/static/WFS/inSPIRED-inTRONICS-Site/-/inSPIRED/en_US/S/S_201807171_front.jpg',
typ... | ArtMajMarviq/Intershop | src/app/core/models/image/image.mapper.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
providers: [provideMockStore({ selectors: [{ selector: getICMBaseURL, value: 'http://example.org' }] })],
});
imageMapper = TestBed.inject(ImageMapper);
} | ArtMajMarviq/Intershop | src/app/core/models/image/image.mapper.spec.ts | TypeScript |
ArrowFunction |
() => {
it(`should return Images when getting an Image`, () => {
const images = imageMapper.fromImages(imagesMockData);
expect(images).toBeTruthy();
expect(images[0].effectiveUrl).toBe(
'http://example.org/INTERSHOP/static/WFS/inSPIRED-inTRONICS-Site/-/inSPIRED/en_US/S/S_201807171_front.j... | ArtMajMarviq/Intershop | src/app/core/models/image/image.mapper.spec.ts | TypeScript |
ArrowFunction |
() => {
const images = imageMapper.fromImages(imagesMockData);
expect(images).toBeTruthy();
expect(images[0].effectiveUrl).toBe(
'http://example.org/INTERSHOP/static/WFS/inSPIRED-inTRONICS-Site/-/inSPIRED/en_US/S/S_201807171_front.jpg'
);
expect(images[1].effectiveUrl).toBe('http:... | ArtMajMarviq/Intershop | src/app/core/models/image/image.mapper.spec.ts | TypeScript |
ClassDeclaration | /**
* The AWS::Amplify::Domain resource allows you to connect a custom domain to your app.
*/
export class Domain extends pulumi.CustomResource {
/**
* Get an existing Domain resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name T... | pulumi/pulumi-aws-native | sdk/nodejs/amplify/domain.ts | TypeScript |
InterfaceDeclaration | /**
* The set of arguments for constructing a Domain resource.
*/
export interface DomainArgs {
appId: pulumi.Input<string>;
autoSubDomainCreationPatterns?: pulumi.Input<pulumi.Input<string>[]>;
autoSubDomainIAMRole?: pulumi.Input<string>;
domainName?: pulumi.Input<string>;
enableAutoSubDomain?: p... | pulumi/pulumi-aws-native | sdk/nodejs/amplify/domain.ts | TypeScript |
MethodDeclaration | /**
* Get an existing Domain resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param opts Optional settings to... | pulumi/pulumi-aws-native | sdk/nodejs/amplify/domain.ts | TypeScript |
MethodDeclaration | /**
* Returns true if the given object is an instance of Domain. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Domain {
if (obj === undefined || obj === null) {
return false... | pulumi/pulumi-aws-native | sdk/nodejs/amplify/domain.ts | TypeScript |
ClassDeclaration |
@NgModule({
declarations: [
StartComponent
],
exports: [
StartComponent,
CommonModule,
FormsModule
],
imports: [
CommonModule
]
})
export class SharedModule { } | eamello/Angular-GettingStarted | APM-Start/src/app/shared/shared.module.ts | TypeScript |
ArrowFunction |
(resp) => {
this.redditFeeds = resp.body.data.children;
loading.dismiss(); // when data is finished fecthed, dismiss loading screen
console.log(this.redditFeeds,'data');
} | clydegold8/Ionic-Angular-Sample-Poject | Raw/app/reddit-page/reddit-page.page.ts | TypeScript |
ArrowFunction |
() => {
event.target.complete();
} | clydegold8/Ionic-Angular-Sample-Poject | Raw/app/reddit-page/reddit-page.page.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-reddit-page',
templateUrl: './reddit-page.page.html',
styleUrls: ['./reddit-page.page.scss'],
providers: [RedditService]
})
export class RedditPagePage implements OnInit {
public redditFeeds: any;
constructor(private redditService: RedditService, public loadingController: Loa... | clydegold8/Ionic-Angular-Sample-Poject | Raw/app/reddit-page/reddit-page.page.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
// get the feed from the reddit service
this.getFeed();
} | clydegold8/Ionic-Angular-Sample-Poject | Raw/app/reddit-page/reddit-page.page.ts | TypeScript |
MethodDeclaration |
async getFeed() {
// show loading screen when fetching data from API
const loading = await this.loadingController.create({
message: 'Pulling Latest Popular Subreddit'
});
loading.present();
this.redditService.getConfig().subscribe((resp) => {
this.redditFeeds = resp.body.data.children;... | clydegold8/Ionic-Angular-Sample-Poject | Raw/app/reddit-page/reddit-page.page.ts | TypeScript |
MethodDeclaration |
doRefresh(event) {
this.getFeed();
setTimeout(() => {
event.target.complete();
}, 2000);
} | clydegold8/Ionic-Angular-Sample-Poject | Raw/app/reddit-page/reddit-page.page.ts | TypeScript |
MethodDeclaration |
async presentToast() {
const toast = await this.toastController.create({
message: 'Page under construction',
position: 'top',
duration: 2000
});
toast.present();
} | clydegold8/Ionic-Angular-Sample-Poject | Raw/app/reddit-page/reddit-page.page.ts | TypeScript |
FunctionDeclaration |
function walk(ctx: Lint.WalkContext<void>) {
function cb(node: ts.Node): void {
if (tsutils.isCallExpression(node)) {
const functionTarget = AstUtils.getFunctionTarget(node);
if (functionTarget === 'document' || functionTarget === 'window.document') {
if (node.arguments.length === 1) {
... | wSedlacek/tslint-config-suiyobi | src/microsoft/noDocumentWriteRule.ts | TypeScript |
FunctionDeclaration |
function cb(node: ts.Node): void {
if (tsutils.isCallExpression(node)) {
const functionTarget = AstUtils.getFunctionTarget(node);
if (functionTarget === 'document' || functionTarget === 'window.document') {
if (node.arguments.length === 1) {
const functionName: string = AstUtils.getFu... | wSedlacek/tslint-config-suiyobi | src/microsoft/noDocumentWriteRule.ts | TypeScript |
ClassDeclaration |
export class Rule extends Lint.Rules.AbstractRule {
public static metadata: ExtendedMetadata = {
ruleName: 'no-document-write',
type: 'maintainability',
description: 'Do not use document.write',
options: null, // tslint:disable-line:no-null-keyword
optionsDescription: '',
typescriptOnly: true... | wSedlacek/tslint-config-suiyobi | src/microsoft/noDocumentWriteRule.ts | TypeScript |
MethodDeclaration |
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithFunction(sourceFile, walk);
} | wSedlacek/tslint-config-suiyobi | src/microsoft/noDocumentWriteRule.ts | TypeScript |
FunctionDeclaration |
export default function valueDiff(
offer: TradeOffer,
keyPrices: KeyPrices,
isTradingKeys: boolean,
enableShowOnlyMetal: boolean
): ValueDiff {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const value: { our: Currency; their: Currency } = offer.data('value');
let dif... | PieDimension/tf2autobot | src/lib/tools/valueDiff.ts | TypeScript |
InterfaceDeclaration |
interface ValueDiff {
diff: number;
diffRef: number;
diffKey: string;
} | PieDimension/tf2autobot | src/lib/tools/valueDiff.ts | TypeScript |
ArrowFunction |
pagedData => {
this.page = pagedData.page;
this.rows = pagedData.data;
} | Nagarjun16/ngc-datatable | src/app/paging/paging-scrolling-novirtualization.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'paging-scrolling-novirtualization-demo',
providers: [MockServerResultsService],
template: `
<div>
<h3>
Server-side Paging
<small>
<a
href="https://github.com/swimlane/ngx-datatable/blob/master/src/app/paging/paging-scrolling-novirtualization... | Nagarjun16/ngc-datatable | src/app/paging/paging-scrolling-novirtualization.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.setPage({ offset: 0 });
} | Nagarjun16/ngc-datatable | src/app/paging/paging-scrolling-novirtualization.component.ts | TypeScript |
MethodDeclaration | /**
* Populate the table with new data based on the page number
* @param page The page to select
*/
setPage(pageInfo) {
this.page.pageNumber = pageInfo.offset;
this.serverResultsService.getResults(this.page).subscribe(pagedData => {
this.page = pagedData.page;
this.rows = pagedData.data;
... | Nagarjun16/ngc-datatable | src/app/paging/paging-scrolling-novirtualization.component.ts | TypeScript |
InterfaceDeclaration |
export interface IInductSqlModel<T> {
/** [TRANSACTIONS NOT IMPLEMENTED] Starts a knex transaction and stores this in the class instance */
// startTransaction: () => Promise<knex.Transaction>;
/** [TRANSACTIONS NOT IMPLEMENTED] Destroys the current knex transaction */
// destroyConnection: () => Promi... | inductjs/core | src/types/model-schema.ts | TypeScript |
InterfaceDeclaration |
export interface ValidationResult<T> {
data: T | T[];
errors: Error[];
} | inductjs/core | src/types/model-schema.ts | TypeScript |
EnumDeclaration |
export enum FunctionType {
Query = "query",
Mutation = "mutation",
} | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type Constructor<T> = new (...any: any[]) => T; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type ModelFactory<T> = (
values: T,
opts: InductModelOpts<T>,
...args: unknown[]
) => Promise<InductModel<T>>; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type ModelFunction<T> = () => Promise<
T | T[] | number | ValidationResult<T>
>; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type ModelConstructor<T> = new (...any: any[]) => InductModel<T>; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration | /** Mark types that do not match the condition type (2nd parameter) as 'never' */
type SubType<Base, Condition> = Pick<
Base,
{
[Key in keyof Base]: Base[Key] extends Condition ? Key : never;
}[keyof Base]
>; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type FunctionOfInductModel<T> = keyof Omit<
SubType<InductModel<T>, Function>,
InternalFunctions
>; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type FunctionOfModel<T> = keyof Omit<
SubType<T, Function>,
InternalFunctions
>; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type InternalFunctions =
| "commitTransaction"
| "destroyConnection"
| "startTransaction"
| "rollbackTransaction"
| "validate"
| "con"
| "trx"
| "get"
| "set"; | inductjs/core | src/types/model-schema.ts | TypeScript |
TypeAliasDeclaration |
export type TypegooseModel = ReturnType<typeof getModelForClass>; | inductjs/core | src/types/model-schema.ts | TypeScript |
InterfaceDeclaration |
export interface ProcessEnv {
NODE_ENV: 'development' | 'production'
PORT: string
MAL_CLIENT_ID: string
MONGO_DB_URI: string
PLEX_SECTION_TITLE: string
} | MaanuVazquez/plex-mal-updater | @types/node_types/index.d.ts | TypeScript |
ClassDeclaration |
export class TunnelService extends AbstractTunnelService {
constructor(
@ILogService logService: ILogService,
@IWorkbenchEnvironmentService private environmentService: IWorkbenchEnvironmentService
) {
super(logService);
}
protected retainOrCreateTunnel(_addressProvider: IAddressProvider, remoteHost: string,... | alexlarbi/vscode | src/vs/workbench/services/remote/browser/tunnelServiceImpl.ts | TypeScript |
MethodDeclaration |
protected retainOrCreateTunnel(_addressProvider: IAddressProvider, remoteHost: string, remotePort: number, localPort: number | undefined, elevateIfNeeded: boolean): Promise<RemoteTunnel | undefined> | undefined {
const existing = this.getTunnelFromMap(remoteHost, remotePort);
if (existing) {
++existing.refcount... | alexlarbi/vscode | src/vs/workbench/services/remote/browser/tunnelServiceImpl.ts | TypeScript |
MethodDeclaration |
canTunnel(uri: URI): boolean {
return super.canTunnel(uri) && !!this.environmentService.remoteAuthority;
} | alexlarbi/vscode | src/vs/workbench/services/remote/browser/tunnelServiceImpl.ts | TypeScript |
ArrowFunction |
() => {
describe('INIT_CODE_HASH', () => {
it('matches computed bytecode hash', () => {
expect(COMPUTED_INIT_CODE_HASH).toEqual(INIT_CODE_HASH)
})
})
} | Akifdoganex/miuswap-sdk | test/constants.test.ts | TypeScript |
ArrowFunction |
() => {
it('matches computed bytecode hash', () => {
expect(COMPUTED_INIT_CODE_HASH).toEqual(INIT_CODE_HASH)
})
} | Akifdoganex/miuswap-sdk | test/constants.test.ts | TypeScript |
ArrowFunction |
() => {
expect(COMPUTED_INIT_CODE_HASH).toEqual(INIT_CODE_HASH)
} | Akifdoganex/miuswap-sdk | test/constants.test.ts | TypeScript |
InterfaceDeclaration | /**
* A static class that routes URLs within the application.
*/
export interface IRouter {
/**
* The base URL for the router.
*/
readonly base: string;
/**
* The command registry used by the router.
*/
readonly commands: CommandRegistry;
/**
* The parsed current URL of th... | WestedCrean/theme-purple-please | node_modules/@jupyterlab/application/lib/tokens.d.ts | TypeScript |
InterfaceDeclaration | /**
* The parsed location currently being routed.
*/
interface ILocation extends ReadonlyPartialJSONObject {
/**
* The location hash.
*/
hash: string;
/**
* The path that matched a routing pattern.
*/
path: string;
/**
* The ... | WestedCrean/theme-purple-please | node_modules/@jupyterlab/application/lib/tokens.d.ts | TypeScript |
InterfaceDeclaration | /**
* The options passed into a navigation request.
*/
interface INavOptions {
/**
* Whether the navigation should be hard URL change instead of an HTML
* history API change.
*/
hard?: boolean;
} | WestedCrean/theme-purple-please | node_modules/@jupyterlab/application/lib/tokens.d.ts | TypeScript |
InterfaceDeclaration | /**
* The specification for registering a route with the router.
*/
interface IRegisterOptions {
/**
* The command string that will be invoked upon matching.
*/
command: string;
/**
* The regular expression that will be matched against URLs.
*/
... | WestedCrean/theme-purple-please | node_modules/@jupyterlab/application/lib/tokens.d.ts | TypeScript |
TypeAliasDeclaration | /**
* A function that handles a connection to the server being lost.
*
* #### Notes
* The default implementation shows a simple dialog upon connection
* failures, but it may be overridden by extensions to perform other
* actions.
*/
export declare type IConnectionLost = (manager: ServiceManager.IManager, err: Se... | WestedCrean/theme-purple-please | node_modules/@jupyterlab/application/lib/tokens.d.ts | TypeScript |
FunctionDeclaration | /**
* @name - Table tag configuration
* @description - Configures table tag (assigns row's/column's headers and their respective data types and formats)
*/
export default function TableTagConfig(props: ITableTagConfigProps) {
const { setTagInputMode = null, addTableTag = null, splitPaneWidth = null } = props;
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function selectColumnType(idx: number, type: string, docCount: number) {
setColumns(columns.map((col, currIdx) => {
if (idx === currIdx) {
if (isCompatibleWithType(docCount, col.originalType, type))
return { ...col, type, format: FieldFormat.NotSpecified }
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function selectRowType(idx: number, type: string, docCount: number) {
setRows(rows.map((row, currIdx) => {
if (idx === currIdx) {
if (isCompatibleWithType(docCount, row.originalType, type))
return { ...row, type, format: FieldFormat.NotSpecified }
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function selectColumnFormat(idx: number, format: string) {
setColumns(columns.map((col, currIdx) => idx === currIdx ? { ...col, format } : col
));
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function selectRowFormat(idx: number, format: string) {
setRows(rows.map((row, currIdx) => idx === currIdx ? { ...row, format } : row
));
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function addColumn() {
setColumns([...columns, defaultRowOrColumn]);
setShouldAutoFocus(TableElements.column);
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function addRow() {
setRows([...rows, defaultRowOrColumn]);
setShouldAutoFocus(TableElements.row);
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function handleTextInput(name: string, role: string, index: number) {
if (role === TableElements.column) {
setColumns(
columns.map((column, currIndex) => (index === currIndex)
? { ...column, name }
: column)
);
} else {
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function setTableName(name: string) {
setTableTagName({ ...tableTagName, tableName: name });
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration | // Row/Column headers command bar (reorder, delete)
function getRowsHeaderItems(): IContextualMenuItem[] {
const currSelectionIndex = rowSelection.getSelectedIndices()[0];
return [
{
key: 'Name',
text: 'Name',
className: "list-headers_name",
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getColumnsHeaderItems(): IContextualMenuItem[] {
const currSelectionIndex = columnSelection.getSelectedIndices()[0];
return [
{
key: 'Name',
text: 'Name',
className: "list-headers_name",
style: { width: detailListWidt... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration | // Validation //
function getTextInputError(array: any[], rowName: string, index: number) {
if (!rowName?.length) {
return strings.tags.regionTableTags.configureTag.errors.emptyName
} else if (array.length && array.findIndex((item) => (item === index)) !== -1) {
return strings.ta... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function checkNameUniqueness(array: ITableConfigItem[], arrayName: string) {
const namesMap = {};
let notUniques = [];
array.forEach((item, idx) => {
if (item.name && item.name.length) {
const name = item.name.trim();
namesMap[name] = namesMap[name] ... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function trimFieldNames(array: ITableConfigItem[]) {
return array.map(i => ({ ...i, name: i.name.trim() }));
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function save(cleanTableName: string, cleanRows: ITableConfigItem[], cleanColumns: ITableConfigItem[]) {
const [firstLayerFieldsInput, secondLayerFieldsInput] = getFieldsLayersInput(headersFormatAndType, cleanRows, cleanColumns);
const definition = getDefinitionLayer(cleanTableName, secondLayerFieldsIn... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getItemType(cleanTableName) {
if (type === FieldType.Object) {
return null;
} else {
return cleanTableName + "_object";
}
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getFieldsLayersInput(headersFormatAndType, cleanRows, cleanColumns) {
if (type === FieldType.Object) {
if (headersFormatAndType === TableElements.columns) {
return [cleanRows, cleanColumns];
} else {
return [cleanColumns, cleanRows];
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getDefinitionLayer(cleanTableName, secondLayerFieldsInput) {
return {
fieldKey: cleanTableName + "_object",
fieldType: FieldType.Object,
fieldFormat: FieldFormat.NotSpecified,
itemType: null,
fields: secondLayerFieldsInput.map((field) => {
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getVisualizationHint(headersFormatAndType) {
if (type === FieldType.Object) {
if (headersFormatAndType === TableElements.columns) {
return TableVisualizationHint.Vertical;
} else {
return TableVisualizationHint.Horizontal;
}
}... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getFieldsLayer(cleanTableName, firstLayerFieldsInput) {
if (type === FieldType.Object) {
return firstLayerFieldsInput.map((field) => {
return {
fieldKey: field.name,
fieldType: cleanTableName + "_object",
fieldForm... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function hasEmptyNames(array: ITableConfigItem[]) {
return array.find((i) => !i.name.length) !== undefined ? true : false
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getCleanTable() {
let cleanRows = rows;
let cleanColumns = columns;
if (headersFormatAndType === TableElements.columns) {
cleanRows = rows.map((row) => {
return {
...row,
type: FieldType.String,
for... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function validateInput() {
return !(
notUniqueNames.rows.length > 0
|| notUniqueNames.columns.length > 0
|| (props.tableTag && notUniqueNames.tags && (tableTagName.tableName !== tableTagName.originalTableName))
|| (notUniqueNames.tags && !props.tableTag)
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration | // Reorder items
function onReOrder(displacement: number, role: string) {
const items = role === TableElements.rows ? [...rows] : [...columns];
const selection = role === TableElements.rows ? rowSelection : columnSelection;
const selectedIndex = selection.getSelectedIndices()[0];
const i... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function restoreDeletedField(fieldType: TableElements, index: number) {
let fields;
let deletedFields;
let setFields;
let setDeletedFields;
switch (fieldType) {
case TableElements.row:
fields = rows;
deletedFields = [...deletedRows];
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getDeletedFieldsTable(fieldType: TableElements) {
let deletedFields;
switch (fieldType) {
case TableElements.row:
deletedFields = deletedRows;
break;
case TableElements.column:
deletedFields = deletedColumns;
... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration | // Table preview
function getTableBody() {
let tableBody = null;
const isRowDynamic = type === FieldType.Array;
if (table.rows.length !== 0 && table.columns.length !== 0) {
tableBody = [];
for (let i = 0; i < (isRowDynamic ? 2 : rows.length + 1); i++) {
co... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
FunctionDeclaration |
function getTableTagNameErrorMessage(): string {
if (props.tableTag && tableTagName.tableName.trim() === props.tableTag.name) {
return "";
} else if (!tableTagName.tableName.trim().length) {
return strings.tags.regionTableTags.configureTag.errors.assignTagName
} else if ... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
(type = FieldType.String) => {
const options = [];
const formats = filterFormat(type)
Object.entries(formats).forEach(([key, value]) => {
options.push({ key, text: value })
});
return options;
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
([key, value]) => {
options.push({ key, text: value })
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
() => {
const options = [];
Object.entries(FieldType).forEach(([key, value]) => {
if (value !== FieldType.Object && value !== FieldType.Array) {
options.push({ key, text: value });
}
});
return options;
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
([key, value]) => {
if (value !== FieldType.Object && value !== FieldType.Array) {
options.push({ key, text: value });
}
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
row => ({ name: row.fieldKey, type: row.fieldType, format: row.fieldFormat, originalName: row.fieldKey, originalFormat: row.fieldFormat, originalType: row.fieldType }) | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
col => ({ name: col.fieldKey, type: col.fieldType, format: col.fieldFormat, originalName: col.fieldKey, originalFormat: col.fieldFormat, originalType: col.fieldType }) | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
(state: IApplicationState) => state.currentProject.tags | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
(documentCount: number, type: string, newType: string) => {
return documentCount <= 0 ? true : getTagCategory(type) === getTagCategory(newType);
} | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
(col, currIdx) => {
if (idx === currIdx) {
if (isCompatibleWithType(docCount, col.originalType, type))
return { ...col, type, format: FieldFormat.NotSpecified }
else {
toast.warn(_.capitalize(interpolate(strings.tags.regionTableTags.co... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
ArrowFunction |
(row, currIdx) => {
if (idx === currIdx) {
if (isCompatibleWithType(docCount, row.originalType, type))
return { ...row, type, format: FieldFormat.NotSpecified }
else {
toast.warn(_.capitalize(interpolate(strings.tags.regionTableTags.co... | Anzrz-Inc/formal-taxdai | src/react/components/common/tagInput/tableTagConfig.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.