File

src/services/web-components.service.ts

Index

Properties
Methods

Constructor

constructor(anchorService: AnchorService)
Parameters :
Name Type Optional
anchorService AnchorService No

Methods

applyAnchorToComponent
applyAnchorToComponent(component: any)

Applies anchor to component According to the anchor value in the component this function should call the anchor service to apply the expected transformation.

Parameters :
Name Type Optional Description
component any No

the current component

Returns : void
calculatePosition
calculatePosition(parentInstance: any)

Calculates position foreach component in the order list

Parameters :
Name Type Optional
parentInstance any No
Returns : void
createOrderArrayForComponent
createOrderArrayForComponent(parentInstance: any)

Creates order array for component excluding the defaultControls

Parameters :
Name Type Optional Description
parentInstance any No

the parent component for the current component

Returns : void
createOrderArrayForComponentWithoutDefaultControls
createOrderArrayForComponentWithoutDefaultControls(parentInstance: any)

Creates order array for component without exclude the default controls.

Parameters :
Name Type Optional Description
parentInstance any No

the parent component for the current component

Returns : void
dockChange
dockChange(component: any)

calls when a component changes the value of the dock or when is called explicitly

Parameters :
Name Type Optional Description
component any No

component with the new value of dock

Returns : void
getParent
getParent(component: any)

Gets parent from the model

Parameters :
Name Type Optional Description
component any No

to get the parent instance that should be in the componentsCollection

Returns : any

parent Instance or null

isParentCandidate
isParentCandidate(component: any)

Determines if component received as parameter is parent candidate

Parameters :
Name Type Optional Description
component any No

Component reference

Returns : boolean

True if component is a parent

processBottom
processBottom(size: any, component: any, offsets: any)

Process bottom dock. Should change the width and keep the height

Parameters :
Name Type Optional Description
size any No

container size

component any No

component to process

offsets any No

object that save the restrictions of area.

Returns : any

the new offset

processChildrenCollection
processChildrenCollection(parentInstance: any, component: any)

Process children collection for the component's parent

Parameters :
Name Type Optional Description
parentInstance any No

parent of the component

component any No

the component to process

Returns : void
processComponents
processComponents(components: any, parentInstance: any, size: any, offsets: any, fillComponents: any[])
Parameters :
Name Type Optional
components any No
parentInstance any No
size any No
offsets any No
fillComponents any[] No
Returns : void
processDock
processDock(parentInstance: any)

Process the dock property for each children of the parentInstance. get the parent size, and keep the offset after render the control in the container.

Parameters :
Name Type Optional Description
parentInstance any No

Parent whose children will be processed.

Returns : void
processDockCases
processDockCases(currentComponent: any, offsets: IOffsets, size: ISize, fillComponents: any[], elementToDelete: any[], index: number)

Process dock cases for each case

Parameters :
Name Type Optional Description
currentComponent any No

component to process

offsets IOffsets No

keep the space between components

size ISize No

parent size

fillComponents any[] No

collection of components that are with dock = fill

elementToDelete any[] No

element that are with the dock = none to delete

index number No

index of the order array

Returns : IOffsets

returns the new offsets with the new element located

processDockInRegisterComponent
processDockInRegisterComponent(component: any, parentInstance: any)

Process dock when the component is registering

Parameters :
Name Type Optional Description
component any No

component to process

parentInstance any No

parent of the component

Returns : void
processFill
processFill(size: any, component: any, offsets: any)

Process Fill dock. Should change the width and/or the height

Parameters :
Name Type Optional Description
size any No

container size

component any No

component to process

offsets any No

object that save the restrictions of area.

Returns : void

the new offset

processFillDockAfterOtherDock
processFillDockAfterOtherDock(fillComponents: any[], parentInstance: any, size: literal type, offsets: literal type)

Process fill dock after other dock properties.

Parameters :
Name Type Optional Description
fillComponents any[] No

array with the components to process.

parentInstance any No

parent of the components.

size literal type No

the parent size used.

offsets literal type No

offsets of the other components.

Returns : void
processLeft
processLeft(size: any, component: any, offsets: any)

Process left dock. Should change the height and keep the width

Parameters :
Name Type Optional Description
size any No

container size

component any No

component to process

offsets any No

object that save the restrictions of area.

Returns : any

the new offset

processNone
processNone(currentComponent: any)

Process none dock. should return to the initial position.

Parameters :
Name Type Optional Description
currentComponent any No

component to process

Returns : void
processOrphanComponent
processOrphanComponent(component: any)

Process orphan component, when the component have a parent but the parent is not ready yet.

Parameters :
Name Type Optional Description
component any No

component to process

Returns : void
processPendingParentCollection
processPendingParentCollection()

Process pending parent collection Includes pending to assign parent collected items in the controls collection

Returns : void
processRight
processRight(size: any, component: any, offsets: any)

Process right dock. Should change the height and keep the width

Parameters :
Name Type Optional Description
size any No

container size

component any No

component to process

offsets any No

object that save the restrictions of area.

Returns : any

the new offset

processTop
processTop(size: any, component: any, offsets: any)

Process top dock. Should change the width and keep the height

Parameters :
Name Type Optional Description
size any No

container size

component any No

component to process

offsets any No

object that save the restrictions of area.

Returns : any

the new offset

registerComponent
registerComponent(component: any)

Registers each component of the app in the componentsCollection. Each component should be register by the ngOnInit lifecycle. The control-container-winforms-base.component and control-winforms-base.component call this method

Parameters :
Name Type Optional Description
component any No

Angular Component to register.

Returns : void
saveInitialValues
saveInitialValues(component: any)

Saves initial values. used to keep the initial position of the control in case the dock return to none. try to get from the model or computed position by the browser.

Parameters :
Name Type Optional
component any No
Returns : void
startDocking
startDocking(component: any)

Starts docking from the form. use the throttling process to avoid process each time the dock.

Parameters :
Name Type Optional Description
component any No

form to execute the dock process

Returns : void
unRegisterComponent
unRegisterComponent(component: any)

unregister the component from the collection. first remove the references from the parent, the remove the references from the componentsCollection

Parameters :
Name Type Optional
component any No
Returns : void

Properties

anchorCalled
Type : object
Default value : {}

Anchor called of web components service To keep tracking of anchored forms

componentsCollection
Type : any
delay
Type : number
Default value : 150

Delay of buffer calls for the startDocking

formsCalled
Type : object
Default value : {}

Forms called from the components detectChanges or syncCompleted event. see more in the ngOnInit of any

pendingParentsCollection
Type : []
Default value : []

results matching ""

    No results matching ""