repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
hellokellyworld/purejswatermark-deploy
packages/core/types/plugins.d.ts
<gh_stars>1-10 /** * These files pertain to the typings of plugins or types * * They're not meant as utils to decode types, but rather * the type definitons themsleves for plugins and types of various kinds */ import { Image, EncoderFn, DecoderFn } from './etc'; import { Omit } from './utils'; export ty...
hellokellyworld/purejswatermark-deploy
packages/core/types/functions.d.ts
<reponame>hellokellyworld/purejswatermark-deploy import {PJW} from './PJW'; export function addConstants( constants: [string, string | number], PJWInstance?: PJW ): void; export function addPJWMethods( methods: [string, Function], PJWInstance?: PJW ): void; export function PJWEvMethod( methodName: string, ...
hellokellyworld/purejswatermark-deploy
packages/utils/index.d.ts
import { Image, Omit } from '@PJW/core'; import { ThrowStatement } from 'typescript'; export function isNodePattern(cb: Function): true; export function isNodePattern(cb: Omit<any, Function>): false; export function throwError(error: string | Error, cb?: (err: Error) => void): ThrowStatement; export function scan(im...
hellokellyworld/purejswatermark-deploy
packages/types/index.d.ts
<filename>packages/types/index.d.ts<gh_stars>1-10 import jpeg from '@PJW/jpeg'; import png from '@PJW/png'; import bmp from '@PJW/bmp'; import tiff from '@PJW/tiff'; import gif from '@PJW/gif'; type JpegRet = ReturnType<typeof jpeg> type PngRet = ReturnType<typeof png> type BmpRet = ReturnType<typeof bmp> type TiffRet...
hellokellyworld/purejswatermark-deploy
packages/custom/types/index.d.ts
<filename>packages/custom/types/index.d.ts<gh_stars>1-10 // TypeScript Version: 3.1 // See the `PJW` package index.d.ts for why the version is not 2.8 import { FunctionRet, PJW, PJWPlugin, PJWType, GetIntersectionFromPlugins, GetIntersectionFromPluginsStatics, PJWConstructors } from '@PJW/core'; type PJW...
hellokellyworld/purejswatermark-deploy
packages/core/types/index.d.ts
<filename>packages/core/types/index.d.ts export * from './etc'; export * from './functions'; export * from './plugins'; export * from './utils'; import {PJW, PJWConstructors} from './PJW'; export { PJW, PJWConstructors }; declare const defaultExp: PJW; export default defaultExp;
hellokellyworld/purejswatermark-deploy
packages/plugin-blit/index.d.ts
import { PJW, ImageCallback } from '@PJW/core'; interface Blit { blit(src: PJW, x: number, y: number, cb?: ImageCallback<this>): this; blit( src: PJW, x: number, y: number, srcx: number, srcy: number, srcw: number, srch: number, cb?: ImageCallback<this> ): this; } export default ...
hellokellyworld/purejswatermark-deploy
packages/plugin-color/index.d.ts
<reponame>hellokellyworld/purejswatermark-deploy import { ImageCallback } from '@PJW/core'; type ColorActionName = | 'mix' | 'tint' | 'shade' | 'xor' | 'red' | 'green' | 'blue' | 'hue'; type ColorAction = { apply: ColorActionName; params: any; }; interface Color { brightness(val: number, cb?: I...
hellokellyworld/purejswatermark-deploy
packages/PJW/types/index.d.ts
// TypeScript Version: 2.8 declare const DepreciatedPJW: DepreciatedPJW; export = DepreciatedPJW; /** * @deprecated PJW typings for TS <3.1 are being depreciated. Please upgrade your TypeScript version */ interface DepreciatedPJW { // Constructors new(path: string, cb?: ImageCallback): this; new(urlOptions:...
hellokellyworld/purejswatermark-deploy
packages/PJW/types/ts3.1/index.d.ts
<reponame>hellokellyworld/purejswatermark-deploy /** * While there is nothing in these typings that prevent it from running in TS 2.8 even, * due to the complexity of the typings anything lower than TS 3.1 will only see * PJW as `any`. In order to test the strict versions of these types in our typing * test suite, ...
amamov/v0.amamov.com
server/tags/tags.service.ts
<filename>server/tags/tags.service.ts import { Injectable } from '@nestjs/common' import { InjectRepository } from '@nestjs/typeorm' import { Repository } from 'typeorm' import { TagEntity } from './tags.entity' @Injectable() export class TagsService { constructor( @InjectRepository(TagEntity) private readon...
amamov/v0.amamov.com
server/common/decorators/client-real-ip.decorator.ts
import * as requestIp from 'request-ip' import { createParamDecorator, ExecutionContext } from '@nestjs/common' import { Request } from 'express' export const ClientIp = createParamDecorator( (data: unknown, ctx: ExecutionContext) => { const request: Request = ctx.switchToHttp().getRequest() if (request.hea...
amamov/v0.amamov.com
server/blogs/blogs.service.ts
import { BadRequestException, Injectable } from '@nestjs/common' import { InjectRepository } from '@nestjs/typeorm' import { Connection, FindConditions, Repository } from 'typeorm' import { BlogEntity } from './blogs.entity' import { paginate, IPaginationOptions } from 'nestjs-typeorm-paginate' import { UsersService } ...
amamov/v0.amamov.com
server/common/exceptions/http-api-exception.filter.ts
<gh_stars>1-10 import { ExceptionFilter, Catch, ArgumentsHost, HttpException, Logger, } from '@nestjs/common' import { Response } from 'express' @Catch(HttpException) export class HttpApiExceptionFilter implements ExceptionFilter { private readonly logger = new Logger(HttpApiExceptionFilter.name) catch(...
amamov/v0.amamov.com
server/blogs/blog-upload-body.pipe.ts
<gh_stars>1-10 import { PipeTransform, Injectable, ArgumentMetadata, BadRequestException, } from '@nestjs/common' import { BlogUploadDTO } from './dtos/blog-upload.dto' @Injectable() export class BlogUploadBodyPipe implements PipeTransform { transform(data: BlogUploadDTO, metadata: ArgumentMetadata) { if...
amamov/v0.amamov.com
server/main.ts
<filename>server/main.ts<gh_stars>1-10 import * as path from 'path' import { NestFactory, Reflector } from '@nestjs/core' import { ClassSerializerInterceptor, Logger, ValidationPipe, } from '@nestjs/common' import { NestExpressApplication } from '@nestjs/platform-express' import { SwaggerModule, DocumentBuilder }...
amamov/v0.amamov.com
server/common/middlewares/global.middleware.ts
import { Logger } from '@nestjs/common' import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger' import { NestExpressApplication } from '@nestjs/platform-express' import * as expressBasicAuth from 'express-basic-auth' import * as passport from 'passport' import * as cookieParser from 'cookie-parser' export abs...
amamov/v0.amamov.com
server/common/entities/common.entity.ts
<gh_stars>1-10 import { CreateDateColumn, DeleteDateColumn, PrimaryGeneratedColumn, UpdateDateColumn, } from 'typeorm' import { IsUUID } from 'class-validator' export abstract class CommonEntity { @IsUUID() @PrimaryGeneratedColumn('uuid') id: string // 해당 열이 추가된 시각을 자동으로 기록 // 만일 Postgres의 time zone...
amamov/v0.amamov.com
server/users/dtos/user-login.dto.ts
import { PickType } from '@nestjs/swagger' import { UserEntity } from '../users.entity' export class UserLogInDTO extends PickType(UserEntity, [ 'email', 'password', ] as const) {}
amamov/v0.amamov.com
server/common/exceptions/http-exception.filter.ts
<reponame>amamov/v0.amamov.com<gh_stars>1-10 import { ArgumentsHost, HttpException, Catch, ExceptionFilter, Logger, } from '@nestjs/common' import { Response } from 'express' @Catch(HttpException) export class HttpExceptionFilter implements ExceptionFilter { private logger = new Logger(HttpExceptionFilter....
amamov/v0.amamov.com
server/users/dtos/user.dto.ts
<gh_stars>1-10 import { OmitType } from '@nestjs/swagger' import { UserEntity } from '../users.entity' export class UserDTO extends OmitType(UserEntity, ['password'] as const) {}
amamov/v0.amamov.com
server/blogs/blogs.module.ts
<reponame>amamov/v0.amamov.com<filename>server/blogs/blogs.module.ts import { AwsService } from '../common/services/aws.service' import { forwardRef, Module } from '@nestjs/common' import { TypeOrmModule } from '@nestjs/typeorm' import { TagsModule } from '../tags/tags.module' import { UsersModule } from '../users/user...
amamov/v0.amamov.com
server/users/users.service.ts
import { BadRequestException, Injectable, Logger, UnauthorizedException, } from '@nestjs/common' import { Response } from 'express' import { InjectRepository } from '@nestjs/typeorm' import { JwtService } from '@nestjs/jwt' import { Repository } from 'typeorm' import { UserEntity } from './users.entity' import ...
amamov/v0.amamov.com
server/blogs/blogs.entity.ts
<filename>server/blogs/blogs.entity.ts import { VisitorEntity } from '../visitors/visitors.entity' import { IsBoolean, IsString } from 'class-validator' import { CommonEntity } from '../common/entities/common.entity' // ormconfig.json에서 파싱 가능하도록 상대 경로로 지정 import { Column, Entity, JoinColumn, JoinTable, ManyTo...
amamov/v0.amamov.com
server/users/users.controller.ts
import { BadRequestException, Body, Controller, Get, Logger, NotFoundException, Post, Redirect, Render, Res, UseFilters, UseGuards, UseInterceptors, } from '@nestjs/common' import { Response } from 'express' import { CurrentUser } from '../common/decorators/current-user.decorator' import { Jwt...
amamov/v0.amamov.com
server/visitors/visitors.module.ts
import { Module } from '@nestjs/common' import { TypeOrmModule } from '@nestjs/typeorm' import { VisitorEntity } from './visitors.entity' @Module({ imports: [TypeOrmModule.forFeature([VisitorEntity])], exports: [TypeOrmModule.forFeature([VisitorEntity])], }) export class VisitorsModule {}
amamov/v0.amamov.com
server/common/pipes/not-null.pipe.ts
import { PipeTransform, Injectable, ArgumentMetadata, BadRequestException, } from '@nestjs/common' @Injectable() export class NotNullPipe implements PipeTransform { transform(data: any, metadata: ArgumentMetadata) { if (!data) { throw new BadRequestException('충분한 값이 제공되지 않았습니다.') } return d...
amamov/v0.amamov.com
server/tags/tags.module.ts
<reponame>amamov/v0.amamov.com<gh_stars>1-10 import { forwardRef, Module } from '@nestjs/common' import { TypeOrmModule } from '@nestjs/typeorm' import { BlogsModule } from '../blogs/blogs.module' import { TagEntity } from './tags.entity' import { TagsService } from './tags.service' @Module({ imports: [ TypeOrmM...
amamov/v0.amamov.com
server/app.module.ts
import { CacheInterceptor, CacheModule, MiddlewareConsumer, Module, NestModule, } from '@nestjs/common' import { ConfigModule, ConfigService } from '@nestjs/config' import { TypeOrmModule, TypeOrmModuleOptions } from '@nestjs/typeorm' import * as Joi from 'joi' import { SnakeNamingStrategy } from 'typeorm-nam...
amamov/v0.amamov.com
server/tags/tags.entity.ts
import { IsNotEmpty, IsString } from 'class-validator' import { CommonEntity } from '../common/entities/common.entity' import { Column, Entity, ManyToMany } from 'typeorm' import { BlogEntity } from '../blogs/blogs.entity' @Entity({ name: 'TAG', }) export class TagEntity extends CommonEntity { @IsString() @IsNot...
amamov/v0.amamov.com
server/visitors/visitors.entity.ts
import { IsIP, IsNotEmpty } from 'class-validator' import { CommonEntity } from '../common/entities/common.entity' import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm' import { BlogEntity } from '../blogs/blogs.entity' @Entity({ name: 'VISITOR', }) export class VisitorEntity extends CommonEntity { @IsIP...
amamov/v0.amamov.com
server/blogs/blog-images.entity.ts
<filename>server/blogs/blog-images.entity.ts import { IsNotEmpty, IsString } from 'class-validator' import { CommonEntity } from '../common/entities/common.entity' import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm' import { BlogEntity } from './blogs.entity' @Entity({ name: 'BLOG_IMAGE', }) export class...
amamov/v0.amamov.com
server/users/users.module.ts
<filename>server/users/users.module.ts import { Module } from '@nestjs/common' import { UsersController } from './users.controller' import { UserEntity } from './users.entity' import { PassportModule } from '@nestjs/passport' import { JwtModule } from '@nestjs/jwt' import { JwtStrategy } from './jwt/jwt.strategy' impor...
amamov/v0.amamov.com
server/users/jwt/jwt.strategy.ts
import { JwtPayload } from './jwt.payload' import { UsersService } from '../users.service' import { ExtractJwt, Strategy } from 'passport-jwt' import { PassportStrategy } from '@nestjs/passport' import { Injectable, UnauthorizedException } from '@nestjs/common' import { jwtExtractorFromCookies } from './jwtExtractorFro...
amamov/v0.amamov.com
server/blogs/blogs.controller.ts
<reponame>amamov/v0.amamov.com import { BadRequestException, Body, Controller, Delete, Get, Logger, NotFoundException, Param, Patch, Post, Render, UploadedFile, UseFilters, UseGuards, UseInterceptors, } from '@nestjs/common' import { FileInterceptor } from '@nestjs/platform-express' import...
amamov/v0.amamov.com
server/users/jwt/jwtExtractorFromCookies.ts
<reponame>amamov/v0.amamov.com import { Request } from 'express' import { JwtFromRequestFunction } from 'passport-jwt' export const jwtExtractorFromCookies: JwtFromRequestFunction = ( request: Request, ): string | null => { try { const jwt = request.cookies['jwt'] return jwt } catch (error) { return ...
amamov/v0.amamov.com
server/common/services/aws.service.ts
import * as path from 'path' import { BadRequestException, Injectable, Logger } from '@nestjs/common' import { ConfigService } from '@nestjs/config' import * as AWS from 'aws-sdk' import sharp = require('sharp') import { PromiseResult } from 'aws-sdk/lib/request' @Injectable() export class AwsService { private reado...
amamov/v0.amamov.com
server/users/users.entity.ts
<filename>server/users/users.entity.ts import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString, } from 'class-validator' import { CommonEntity } from '../common/entities/common.entity' // ormconfig.json에서 파싱 가능하도록 상대 경로로 지정 import { Column, Entity, Index, OneToMany } from 'typeorm' import { BlogEntity }...
amamov/v0.amamov.com
server/blogs/dtos/blog-upload.dto.ts
import { PickType } from '@nestjs/swagger' import { IsNotEmpty, IsString } from 'class-validator' import { BlogEntity } from '../blogs.entity' export class BlogUploadDTO extends PickType(BlogEntity, [ 'title', 'description', 'contents', ] as const) { @IsString() @IsNotEmpty() tags: string @IsNotEmpty() ...
amamov/v0.amamov.com
server/app.controller.ts
import { UserEntity } from './users/users.entity' import { BadRequestException, Controller, DefaultValuePipe, Get, Logger, ParseIntPipe, Query, Render, Res, UseGuards, } from '@nestjs/common' import { Response } from 'express' import { CurrentUser } from './common/decorators/current-user.decorator' ...
amamov/v0.amamov.com
server/typing.d.ts
<reponame>amamov/v0.amamov.com import { UserDTO } from './users/dtos/user.dto' declare global { namespace Express { interface User extends UserDTO {} interface Request { token?: string user?: any } } }
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFTextFieldModel.ts
import {IFFFieldModel, IFFFieldModelProps } from "."; export interface IFFTextFieldModelProps extends IFFFieldModelProps { width?: number; } export interface IFFTextFieldModel extends IFFFieldModel { props: IFFTextFieldModelProps; }
rnwood/swayforms
crownforms-components/src/lib/designer/components/FormDesigner.tsx
import * as React from "react"; import { observable } from "mobx"; import { observer } from "mobx-react"; import { DragDropContext, DropResult } from "react-beautiful-dnd"; import { FormComponentConstructor, FormModel, Form, FormComponent, IFieldModelOptions, TypedValue, IFormComponentOptions, IFormComp...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/validation/ExpressionSectionValidationRuleModel.ts
<reponame>rnwood/swayforms<gh_stars>1-10 import { computed, observable } from "mobx"; import { Expression } from "../expressions"; import {FieldValidationRuleModel, ISectionValidationRuleModelOptions, IValidationRuleModelOptions, SectionValidationRuleModel} from "." import { FieldModel, IFieldModelOptions, FormModel, B...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/RepeatableSubFormFieldModel.ts
<filename>crownforms-components/src/lib/renderer/models/RepeatableSubFormFieldModel.ts import { computed } from "mobx"; import { FormComponent, FieldModel, IFieldModelOptions, FormModel, IFormModelOptions, SectionModel, ValidationErrorModel, SubFormValueArrayValue, SubFormValue, IFieldModelState, ...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/validation/SectionValidationRuleModel.ts
import { ValidationRuleModel, ExpressionFieldValidationRuleModel, IValidationRuleModelOptions, IExpressionFieldValidationRuleModelOptions, RegexFieldValidationRuleModel, IRegexFieldValidationRuleModelOptions, ExpressionSectionValidationRuleModel, IExpressionSectionValidationRuleModelOptions } from '.'; import { FieldMo...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/UnsupportedFormField.tsx
import { observer } from "mobx-react"; import React from "react"; import {UnsupportedFieldModel} from "../../models"; import { FormField, FieldValidationErrors } from "."; @observer export class UnsupportedFormField extends FormField< UnsupportedFieldModel > { focus(): void { this.elementRef.current?.focus(); ...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/IFormComponentProps.ts
import { IFormSectionFieldProps, IFormSectionProps } from '.'; import { FieldModel } from '..'; import { IFieldModelOptions, SectionModel, TypedValue } from '../models'; export interface IFormComponentProps { hooks?: { onRenderSection?: (props: IFormSectionProps) => JSX.Element | undefined; onRenderField?: (...
rnwood/swayforms
crownforms-components/src/lib/designer/components/DesignerFormSection.tsx
import { FormSection, IFormSectionProps } from "../../renderer"; import React, { Component } from "react"; import { Droppable, DroppableProvided } from "react-beautiful-dnd"; import { FormDesignerModel } from '../models'; import { observer } from 'mobx-react'; interface IProps extends IFormSectionProps { designer: F...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/SectionModel.ts
import { computed, observable } from "mobx"; import { TwoChoiceFieldModel, ITwoChoiceFieldOptions, HtmlFieldModel, BooleanValue, FieldModel, FormComponent, FormComponentConstructor, FormModel, IFieldModelOptions, TypedValue, ValidationErrorModel, DateFieldModel, TextFieldModel, StringValue, ...
rnwood/swayforms
crownforms-components/src/lib/designer/components/DesignerFormSectionField.tsx
import { FieldModel, FormComponent, FormSectionField, IFieldModelOptions, IFormComponentOptions, IFormComponentState, IFormSectionFieldProps, TypedValue } from '../../renderer'; import React, { Component, SyntheticEvent } from 'react'; import { Draggable } from 'react-beautiful-dnd'; import { FormDesignerModel } from '...
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFNumberFieldModel.ts
import {IFFFieldModel, IFFFieldModelProps } from "."; export interface IFFNumberFieldModelProps extends IFFFieldModelProps { prefix?: string; suffix?: string; decimalPlaces?: number; width?: number; } export interface IFFNumberFieldModel extends IFFFieldModel { props: IFFNumberFieldModelProps; }
rnwood/swayforms
crownforms-components/src/lib/renderer/models/IChoicesFieldModelOptions.ts
import { IFieldModelOptions } from './FieldModel'; import { IOptions } from '.'; export interface IChoicesFieldModelOptions extends IFieldModelOptions { choices: ({ label: string; value: string|number|boolean|null }[]) | {lookup: string}; autoPopulateFields?: boolean }
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/FieldValidationErrors.tsx
import { observer } from "mobx-react"; import * as React from "react"; import { TypedValue, FieldModel, IFieldModelOptions } from "../../models"; @observer export class FieldValidationErrors extends React.Component<{ field: FieldModel<TypedValue, IFieldModelOptions>; }> { render() { return ( <React.Fragm...
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFFormModel.ts
<reponame>rnwood/swayforms import {IFFFieldModel, IFFFieldModelProps, IFFSectionModel, IFFLookupModel, IFFModel } from "."; export interface IFFFormModel extends IFFModel { formName: string; sections: IFFSectionModel[]; props: { id: string integrationDefinition?: { [key: string]: IFFLookupModel ...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/LogicalExpression.ts
import { observable } from "mobx"; import {FormModel} from ".."; import { Expression } from "."; export class LogicalExpression extends Expression<boolean> { constructor(left: Expression<any>, and: boolean, right: Expression<any>) { super(); this.left = left; this.right = right; this.and = and; } ...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/conditions/FFConditions.ts
<filename>crownforms-components/src/lib/renderer/models/conditions/FFConditions.ts /* AutoGenerated Code, changes may be overwritten * INPUT GRAMMAR: * expression * := _ head=term tail=booleanExpressionTail* _ * booleanExpressionTail * := tail={ addExpression | orExpression | andExpression | equalsExpression | notEq...
rnwood/swayforms
crownforms/shared/PublicPage.tsx
import { observable } from "mobx"; import { Component, ReactNode } from "react"; export abstract class PublicPage<TProps> extends Component<TProps> { abstract renderTitle() : ReactNode; abstract renderBody() : ReactNode; render() { return <div> <header className="govuk-header " role="...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/SelectFormField.tsx
import * as React from "react"; import { ChangeEvent } from "react"; import { observer } from "mobx-react"; import { FieldValidationErrors, FormField } from "."; import { StringValue, SelectOneFieldModel } from "../../models"; @observer export class SelectFormField extends FormField<SelectOneFieldModel> { private h...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/RadioFormField.tsx
<reponame>rnwood/swayforms import * as React from "react"; import { ChangeEvent } from "react"; import { observer } from "mobx-react"; import { FieldValidationErrors, FormField } from "."; import { StringValue, SelectOneFieldModel } from "../../models"; @observer export class RadioFormField extends FormField<SelectOn...
rnwood/swayforms
crownforms/shared/AdminPage.tsx
import { PublicPage } from "./PublicPage"; export class NotFoundError extends Error { } export abstract class AdminPage<TProps> extends PublicPage<TProps> { }
rnwood/swayforms
crownforms-components/src/lib/renderer/models/validation/ValidationRuleModel.ts
<gh_stars>1-10 import { observable } from 'mobx'; import {FieldModel, FormModel, IFieldModelOptions, TypedValue} from ".."; import { IOptions } from '../FormComponent'; import { IFormModelState } from '../FormModel'; export interface IValidationRuleModelOptions extends IOptions { readonly type: string; } export abs...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/validation/RegexFieldValidationRuleModel.ts
<reponame>rnwood/swayforms<gh_stars>1-10 import { observable } from "mobx"; import { FieldValidationRuleModel, IFieldValidationRuleModelOptions, IValidationRuleModelOptions } from "."; import { StringValue, TypedValue, FormModel, FieldModel, IFieldModelOptions } from ".."; export interface IRegexFieldValidationRuleMod...
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFSubFormFieldModel.ts
import {IFFFieldModel, IFFFieldModelProps, IFFFormModel } from "."; export interface IFFSubFormFieldModelProps extends IFFFieldModelProps { subformDefinition: IFFFormModel; displayStyle: "summary"; repeatable?: boolean; } export interface IFFSubFormFieldModel extends IFFFieldModel { props: IFFSubFormFieldMode...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/FormSection.tsx
<reponame>rnwood/swayforms import * as React from "react"; import { observer } from "mobx-react"; import { DroppableProvided, Droppable } from "react-beautiful-dnd"; import { FormSectionField, IFormSectionFieldProps } from "."; import { SectionModel, ValidationErrorModel } from "../models"; import { computed } from 'm...
rnwood/swayforms
crownforms/pages/service/[url].tsx
import React from "react"; import { FormModel, Form, IFormModelOptions, IFormModelState } from "crownforms-components"; import {observer, useStaticRendering} from "mobx-react" import {observable} from "mobx" import { GetServerSidePropsContext, GetServerSidePropsResult } from "next"; import { IncomingMessage } f...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/ITaskModel.ts
export interface ITaskModel { description: string; promise: Promise<unknown>; }
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/CheckboxFormField.tsx
<reponame>rnwood/swayforms import * as React from "react"; import { observer } from "mobx-react"; import { FormField, FieldValidationErrors } from "."; import { StringValue, TwoChoiceFieldModel } from "../../../renderer"; import { computed } from 'mobx'; @observer export class CheckboxFormField extends FormField< T...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/ComparisonExpression.ts
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { observable } from "mobx"; import {FormModel} from ".."; import { Expression } from "."; export enum ComparisonExpressionType { GreaterThan = ">", GreaterThanEquals = ">=", LessThan = "<",...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/TwoChoiceFieldModel.ts
<reponame>rnwood/swayforms import { computed } from 'mobx'; import { StringValue, TypedValue, ITypedValueConverter, FieldModel, IFieldModelOptions, FormComponent, IFormComponentOptions, IFormComponentState, ValueFieldModel, } from "."; import { IFieldModelState } from './FieldModel'; import { BooleanV...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/EqualsExpression.ts
<filename>crownforms-components/src/lib/renderer/models/expressions/EqualsExpression.ts import { observable } from "mobx"; import {FormModel} from ".."; import { Expression } from "."; export class EqualsExpression extends Expression<any> { constructor( left: Expression<any>, notEquals: boolean, right: E...
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFLookupModel.ts
<gh_stars>1-10 import { IFFFieldModel, IFFModel } from '.'; export interface IFFLookupModel_Output_template { fields: string; method: string, url: string, path_to_values: string; responseType: string; } export interface IFFLookupModel extends IFFModel { ID: string, Name: string, Type: string, Outpu...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/Expression.ts
<reponame>rnwood/swayforms import { observable } from "mobx"; import {FormModel} from ".."; export abstract class Expression<T> { protected abstract getResultInternal(data: FormModel): T; @observable lastResult: T | undefined; getResult(data: FormModel): T { const result = this.getResultInternal(data); ...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/RepeatableSubFormField.tsx
<filename>crownforms-components/src/lib/renderer/components/fields/RepeatableSubFormField.tsx import * as React from "react"; import { observer } from "mobx-react"; import { FormField } from "."; import { Form } from ".."; import { SubFormValue, RepeatableSubFormFieldModel } from "../../models"; @observer export class...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/ArrayAccessExpression.ts
import { observable } from "mobx"; import {FormModel} from ".."; import { Expression } from "."; export class ArrayAccessExpression extends Expression<any> { constructor(expression: Expression<any>, indexExpression: Expression<any>) { super(); this.expression = expression; this.indexExpression = indexExp...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/LiteralExpression.ts
<reponame>rnwood/swayforms import { observable } from "mobx"; import {FormModel} from ".."; import { Expression } from "."; export class LiteralExpression extends Expression<any> { constructor(value: any) { super(); this.value = value; } @observable value: any; protected getResultInternal(data: For...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/index.ts
<gh_stars>1-10 export { FormComponent } from "./FormComponent"; export type { IFormComponentOptions, IFormComponentState, IOptions } from "./FormComponent"; export { FormModel } from "./FormModel"; export type { IFormModelOptions, IFormModelState } from "./FormModel"; export * from "./conditions"; export * from "./val...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/IfExpression.ts
<reponame>rnwood/swayforms import { observable } from "mobx"; import {FormModel} from ".."; import { Expression } from "."; export class IfExpression extends Expression<any> { constructor( condition: Expression<any>, trueResult: Expression<any>, falseResult: Expression<any> ) { super(); this.co...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/SelectSeveralFieldModel.ts
import { observable } from "mobx"; import { StringArrayValue, IFieldModelOptions, FieldModel, SectionModel, IChoicesFieldModelOptions, IFieldModelState } from "."; import { SelectFieldModel } from './SelectFieldModel'; import { StringValue } from './TypedValue'; export interface ISelectSeveralFieldModelOptions exten...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/IFieldModelControl.ts
import {ValidationErrorModel} from '.'; export interface IFieldModelControl { focus(): void; controlValueError: ValidationErrorModel | null; }
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/FFFormConverter.ts
<filename>crownforms-components/src/lib/designer/models/firmstep/FFFormConverter.ts import { ExpressionFieldValidationRuleModel, FFConditionParser, FieldValidationRuleModel, IFieldModelOptions, IRepeatableSubFormFieldOptions, ISectionModelOptions, ITextFieldOptions, ITypedValueConverter, IUnsupportedF...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/expressions/index.ts
<reponame>rnwood/swayforms export * from './Expression' export * from './ArrayAccessExpression' export * from './CaseConversionExpression' export * from './ComparisonExpression' export * from './ContainsExpression' export * from './ConvertToBooleanValueExpression' export * from './ConvertToStringValueExpression' export...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/DateFieldModel.ts
import { computed, observable } from "mobx"; import {FieldModel, IFieldModelOptions, SectionModel, DateValue, ValidationErrorModel, IFieldModelState, StringValue, ValueFieldModel } from "."; import { ValidationErrorModelSeverity } from './ValidationErrorModel'; export interface IDateFieldOptions extends IFieldModelOp...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/MultiCheckboxFormField.tsx
import * as React from "react"; import { observer } from "mobx-react"; import { FormField, FieldValidationErrors } from "."; import { SelectSeveralFieldModel, StringValue, StringArrayValue, } from "../../models"; @observer export class MultiCheckboxFormField extends FormField<SelectSeveralFieldModel> { priva...
rnwood/swayforms
crownforms-components/src/lib/designer/components/ComponentTree.tsx
<filename>crownforms-components/src/lib/designer/components/ComponentTree.tsx import * as React from "react"; import { reaction, observable, action } from "mobx"; import { observer } from "mobx-react"; import { ReactNode, SyntheticEvent } from "react"; import { FormDesignerModel } from "../models"; import { FormCompo...
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFHtmlFieldModel.ts
<gh_stars>1-10 import {IFFFieldModel, IFFFieldModelProps } from "."; export interface IFFHtmlFieldModelProps extends IFFFieldModelProps { content: string; } export interface IFFHtmlFieldModel extends IFFFieldModel { props: IFFHtmlFieldModelProps; }
rnwood/swayforms
crownforms-components/src/lib/renderer/models/SelectOneFieldModel.ts
<reponame>rnwood/swayforms<gh_stars>1-10 import { observable } from "mobx"; import { StringValue } from "./TypedValue"; import {FieldModel, IFieldModelOptions, SectionModel } from "."; import { IChoicesFieldModelOptions } from './IChoicesFieldModelOptions'; import { SelectFieldModel } from './SelectFieldModel'; import...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/AutoLookupModel.ts
<reponame>rnwood/swayforms import { FormComponentConstructor, TypedValue, VoidValue, FormComponent, IFormComponentOptions, FieldModel, IFieldModelOptions, StringValue, IFieldModelState, ValidationErrorModel, ValidationErrorModelSeverity, } from "."; import { IFormComponentState } from "./FormCompo...
rnwood/swayforms
crownforms-components/src/lib/noreact.tsx
<reponame>rnwood/swayforms<filename>crownforms-components/src/lib/noreact.tsx import React from "react"; import ReactDOM from "react-dom"; import { Form, FormModel, IFormModelOptions } from "./renderer"; class CrownForms { async init(elementId: string, options: IFormModelOptions | string): Promise<FormModel> { l...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/Form.tsx
<gh_stars>1-10 import * as React from "react"; import { observer } from "mobx-react"; import { action, computed, observable } from "mobx"; import { FormSection, IFormComponentProps, IFormSectionProps } from "."; import { FormModel, SectionModel, ValidationErrorModel, ValidationErrorModelSeverity, } from "../mod...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/HtmlFieldModel.ts
import { observable } from "mobx"; import { StringValue } from "./TypedValue"; import {FieldModel, IFieldModelOptions, SectionModel, ValueFieldModel } from "."; import {LiteralExpression} from "./expressions"; import { IFieldModelState } from './FieldModel'; export interface IHtmlFieldModelOptions extends IFieldMod...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/FieldValueReplacer.ts
import { StringValue, FormModel } from "."; import { FFConditionParser } from "./conditions"; const EXPRESSIONREGEX = /\{\((.+?)\)\}/gi; const REGEX = /\{([^}]+)\}/gi; export class FieldValueReplacer { static replace(input: string, data: FormModel): string { return input ?.replaceAll(EXPRESSIONREGEX, (m: ...
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFTextAreaFieldModel.ts
import {IFFFieldModel, IFFFieldModelProps } from "."; export interface IFFTextAreaFieldModelProps extends IFFFieldModelProps {} export interface IFFTextAreaFieldModel extends IFFFieldModel { props: IFFTextAreaFieldModelProps; }
rnwood/swayforms
crownforms/pages/index.tsx
<reponame>rnwood/swayforms import { Service } from "@prisma/client"; import { useStaticRendering } from "mobx-react"; import { GetServerSidePropsContext, GetServerSidePropsResult } from "next"; import React from "react"; import { ApiClient } from "../shared/ApiClient"; import { PublicPage } from "../shared/PublicPage";...
rnwood/swayforms
crownforms-components/src/lib/renderer/components/fields/TextFormField.tsx
<filename>crownforms-components/src/lib/renderer/components/fields/TextFormField.tsx import * as React from "react"; import { observer } from "mobx-react"; import { FormField, FieldValidationErrors } from "."; import { StringValue, TextFieldModel } from "../../models"; @observer export class TextFormField extends For...
rnwood/swayforms
crownforms-components/src/lib/designer/models/firmstep/IFFSectionModel.ts
import {IFFFieldModel, IFFFieldModelProps, IFFModel } from "."; export interface IFFSectionModel extends IFFModel { name: string; id: string; fields: IFFFieldModel[]; props: { displayCondition?: string; validation?: string; validationMessage?: string; }; }
rnwood/swayforms
crownforms/pages/api/service/index.ts
import { NextApiRequest, NextApiResponse } from "next" import { PrismaClient } from '@prisma/client' export default async function handler(req :NextApiRequest, res: NextApiResponse) { const { method, } = req; switch (method) { case 'GET': const db = new PrismaClient(); const services ...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/ValidationErrorModel.ts
<filename>crownforms-components/src/lib/renderer/models/ValidationErrorModel.ts import {FieldModel, IFieldModelOptions, TypedValue } from "."; import { FormComponent, IFormComponentOptions, IFormComponentState } from './FormComponent'; export enum ValidationErrorModelSeverity { Fatal, Correctable } export class ...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/FormModel.ts
import { computed, observable } from "mobx"; import { FormDesignerModel } from "../../designer"; import { FieldModel, FormComponent, FormComponentConstructor, IFieldModelOptions, ISectionModelOptions, RepeatableSubFormFieldModel, SectionModel, SubFormFieldModel, TypedValue, ValidationErrorModel, I...
rnwood/swayforms
crownforms-components/src/lib/renderer/models/FormComponentConstructor.ts
<filename>crownforms-components/src/lib/renderer/models/FormComponentConstructor.ts<gh_stars>1-10 import { TypedValue, FormComponent, IFieldModelOptions, IFormComponentOptions, IFormComponentState } from "."; export type FormComponentConstructor<T, TOptions extends IFormComponentOptions> = (new ( parent: FormCompone...