File

projects/angular2-query-builder/src/lib/query-builder/query-builder.interfaces.ts

Properties

addIcon
addIcon: string
Type : string
arrowIcon
arrowIcon: string
Type : string
arrowIconButton
arrowIconButton: string
Type : string
button
button: string
Type : string
buttonGroup
buttonGroup: string
Type : string
collapsed
collapsed: string
Type : string
connector
connector: string
Type : string
emptyWarning
emptyWarning: string
Type : string
entityControl
entityControl: string
Type : string
entityControlSize
entityControlSize: string
Type : string
fieldControl
fieldControl: string
Type : string
fieldControlSize
fieldControlSize: string
Type : string
inputControl
inputControl: string
Type : string
inputControlSize
inputControlSize: string
Type : string
invalidRuleSet
invalidRuleSet: string
Type : string
operatorControl
operatorControl: string
Type : string
operatorControlSize
operatorControlSize: string
Type : string
removeButton
removeButton: string
Type : string
removeButtonSize
removeButtonSize: string
Type : string
removeIcon
removeIcon: string
Type : string
rightAlign
rightAlign: string
Type : string
row
row: string
Type : string
rule
rule: string
Type : string
ruleSet
ruleSet: string
Type : string
switchControl
switchControl: string
Type : string
switchGroup
switchGroup: string
Type : string
switchLabel
switchLabel: string
Type : string
switchRadio
switchRadio: string
Type : string
switchRow
switchRow: string
Type : string
transition
transition: string
Type : string
tree
tree: string
Type : string
treeContainer
treeContainer: string
Type : string
import { ValidationErrors } from '@angular/forms';

export interface RuleSet {
  condition: string;
  rules: Array<RuleSet | Rule>;
  collapsed?: boolean;
  isChild?: boolean;
}

export interface Rule {
  field: string;
  value?: any;
  operator?: string;
  entity?: string;
}

export interface Option {
  name: string;
  value: any;
}

export interface FieldMap {
  [key: string]: Field;
}

export interface Field {
  name: string;
  value?: string;
  type: string;
  nullable?: boolean;
  options?: Option[];
  operators?: string[];
  defaultValue?: any;
  defaultOperator?: any;
  entity?: string;
  validator?: (rule: Rule, parent: RuleSet) => any | null;
}

export interface LocalRuleMeta {
  ruleset: boolean;
  invalid: boolean;
}

export interface EntityMap {
  [key: string]: Entity;
}

export interface Entity {
  name: string;
  value?: string;
  defaultField?: any;
}

export interface QueryBuilderClassNames {
  arrowIconButton?: string;
  arrowIcon?: string;
  removeIcon?: string;
  addIcon?: string;
  button?: string;
  buttonGroup?: string;
  removeButton?: string;
  removeButtonSize?: string;
  switchRow?: string;
  switchGroup?: string;
  switchLabel?: string;
  switchRadio?: string;
  switchControl?: string;
  rightAlign?: string;
  transition?: string;
  collapsed?: string;
  treeContainer?: string;
  tree?: string;
  row?: string;
  connector?: string;
  rule?: string;
  ruleSet?: string;
  invalidRuleSet?: string;
  emptyWarning?: string;
  fieldControl?: string;
  fieldControlSize?: string;
  entityControl?: string;
  entityControlSize?: string;
  operatorControl?: string;
  operatorControlSize?: string;
  inputControl?: string;
  inputControlSize?: string;
}

export interface QueryBuilderConfig {
  fields: FieldMap;
  entities?: EntityMap;
  allowEmptyRulesets?: boolean;
  getOperators?: (fieldName: string, field: Field) => string[];
  getInputType?: (field: string, operator: string) => string;
  getOptions?: (field: string) => Option[];
  addRuleSet?: (parent: RuleSet) => void;
  addRule?: (parent: RuleSet) => void;
  removeRuleSet?: (ruleset: RuleSet, parent: RuleSet) => void;
  removeRule?: (rule: Rule, parent: RuleSet) => void;
  coerceValueForOperator?: (operator: string, value: any, rule: Rule) => any;
  calculateFieldChangeValue?: (currentField: Field,
                               nextField: Field,
                               currentValue: any) => any;
}

export interface SwitchGroupContext {
  onChange: (conditionValue: string) => void;
  getDisabledState: () => boolean;
  $implicit: RuleSet;
}

export interface EmptyWarningContext {
  getDisabledState: () => boolean;
  message: string;
  $implicit: RuleSet;
}

export interface ArrowIconContext {
  getDisabledState: () => boolean;
  $implicit: RuleSet;
}

export interface EntityContext {
  onChange: (entityValue: string, rule: Rule) => void;
  getDisabledState: () => boolean;
  entities: Entity[];
  $implicit: Rule;
}

export interface FieldContext {
  onChange: (fieldValue: string, rule: Rule) => void;
  getFields: (entityName: string) => void;
  getDisabledState: () => boolean;
  fields: Field[];
  $implicit: Rule;
}

export interface OperatorContext {
  onChange: () => void;
  getDisabledState: () => boolean;
  operators: string[];
  $implicit: Rule;
}

export interface InputContext {
  onChange: () => void;
  getDisabledState: () => boolean;
  options: Option[];
  field: Field;
  $implicit: Rule;
}

export interface ButtonGroupContext {
  addRule: () => void;
  addRuleSet: () => void;
  removeRuleSet: () => void;
  getDisabledState: () => boolean;
  $implicit: RuleSet;
}

export interface RemoveButtonContext {
  removeRule: (rule: Rule) => void;
  getDisabledState: () => boolean;
  $implicit: Rule;
}

results matching ""

    No results matching ""