Skip to content

Latest commit

 

History

History
429 lines (330 loc) · 15.4 KB

directive-api.md

File metadata and controls

429 lines (330 loc) · 15.4 KB

Classes

lightReport
reportFilter
reportGrid
reportQuery
tagsFilter

An angular wrapper for Stork-Tags input component, handles component events of Added\Removed and executes call for suggestions on demand.

Typedefs

OnLoadedCallback : function

'onLoaded' callback.

OnSelectCallback : function

'onSelect' callback.

OnDoubleSelectCallback : function

'onDoubleSelect' callback.

OnClickCallback : function

'onClick' callback.

OnSortCallback : function

'onSort' callback.

OnColumnResizeCallback : function

'onColumnResize' callback.

OnScrollHitBottomCallback : function

'onScrollHitBottom' callback.

lightReport

Kind: global class
Access: public
Properties

Name Type Default Description
[lightReport] BaseReportService Light report service instance. you may use lightReportFactory to init such instance.
[gridSettings] gridSettings
[reportAutoQuery] string true Auto submit the query on filter change.
[reportSubmitLabel] string "Submit" The submit button label.
[sortDirections] string The possible states of sorting
[onLoaded] OnLoadedCallback onLoaded allows you to specify custom behavior when an element is loaded.
[onSelect] OnSelectCallback onSelect allows you to specify custom behavior when an element is selected.
[onDoubleSelect] OnDoubleSelectCallback onDoubleSelect allows you to specify custom behavior when an element is double selected.
[onClick] OnClickCallback onClick allows you to specify custom behavior when an element is fully clicked.
[onSort] OnSortCallback onSort allows you to specify custom behavior when an element is sorted, return true\false in order to execute internal sort after override.
[onColumnResize] OnColumnResizeCallback onColumnResize allows you to specify custom behavior when an column resize.

new lightReport()

Light report component main entry directive. End to end(server<-->client) reports components, used as rest on demand or local self contained data presentation report.

  • If you don't use the AutoApplyQuery but rather wish to use the form manual submit mode make sure to sign any buttons(if any) with type='button' other wise it will trigger the submit.

Example

     <div    light-report="lightReportFactory"
             data-report-auto-apply-query="true"
             data-report-submit-label="Submit">

              Select Tenor:
				 <select id="tenorSelect"
						 ng-model="selectedTenor"
						 ng-options="tenor.label for tenor in tenors track by tenor.value"
						 report-filter="tenorFilter"
						 data-filter-value="selectedTenor.value"
						 data-filter-field="tenor"
						 data-filter-type="reportFilterService.FIELD">
				 </select>
      </div>

lightReport.$scope.applyQueryHandler(event, message) ℗

Kind: static method of lightReport
Access: private

Param
event
message

lightReport.$scope.onDataHandler(result, isAppended) ℗

Kind: static method of lightReport
Access: private

Param
result
isAppended

reportFilter

Kind: global class
Access: public

new reportFilter([reportFilter], [filterKey], filterField, [filterValue], [filterType], [filterFrom], [filterTo])

Report Filter

Supports light report query input fields for data filtering. Adding the report filter to any of the trunscluded query elements will bind the ngModel to the ReportModel query filters.

Param Type Description
[reportFilter] string populates bound object with api property.
[filterKey] bool key in case of multiple filter elements as in case of IN range filter, if not set will use FilterField + 'Filter' as key.
filterField string the field\column name to be filtered.
[filterValue] string | number | bool used in case ngModel is not authentic as direct field value.
[filterType] string (ReportFilterService.FIELD
[filterFrom] bool used in range\date_range filter, marks the field as the start element in the range of from -> to.
[filterTo] bool used in range\date_range filter, marks the field as the end element in the range of from -> to

Example

    Field Filter:
	   <select   ng-model="selectedName"
				 ng-options="name in names"

				 report-filter="name"
				 data-filter-value="selectedTenor.value"
				 data-filter-field="tenor"
				 data-filter-type="reportFilterService.FIELD">
	    </select>

     Range Filter:
     <input filter='key' filterFrom/>
     <input filter='key' filterTo/>

reportGrid

Kind: global class
Access: public
Properties

Name Type Description
[gridSettings] gridSettings
[onLoaded] OnLoadedCallback report grid load complete.
[onSelect] OnSelectCallback element is selected.
[onDoubleSelect] OnDoubleSelectCallback element is double selected.
[onClick] OnClickCallback element is fully clicked.
[onSort] OnSortCallback column sort call back.
[onColumnResize] OnColumnResizeCallback column resize call back.
[onScrollHitBottom] OnScrollHitBottomCallback on scroll hit bottom defined by gridSettings.infiniteScrollTolerance.

new reportGrid()

Report grid wraps the 3rd party grid components to normalize light reports required functionality and behavior, dispatching proper grid load and events flow.

Example

	 <div class="lightReportGrid"
	     ng-model="reportService.reportModel.data"

	     report-grid
	     data-grid-settings="gridSettings"

	     data-on-loaded="onGridLoadedHandler"
	     data-on-sort="onGridSortHandler"
	     data-on-select="onSelect"
	     data-on-double-select="onDoubleSelect"
	     data-on-click="onClick"
	     data-on-column-resize="onColumnResize"
	     data-on-scroll-hit-bottom="onScrollHitBottom">
	 </div>

reportGrid.$scope.onGridSortHandler(event)

Grid sort event handler, triggers bound onSort call back with field and direction parameters. Direction values: asc, desc or null for no direction.

Kind: static method of reportGrid
Access: public

Param
event

reportQuery

Kind: global class
Access: public

new reportQuery(queryModel)

Report Query

Emits lightReportEvents.APPLY_QUERY event if reportAutoQuery property is true.

Param Type Description
queryModel ReportQueryModel used in range\date_range filter, marks the field as the end element in the range of from -> to
reportAutoQuery

reportQuery.$scope.filterChangedHandler(event, message) ⇒ JSON

Filter change handler, if reportAutoQuery is active non partial filters will trigger. expected message fields:

Kind: static method of reportQuery
Returns: JSON - - filter result
Access: private

Param Type Description
event object
message object
message.key string filter key
message.type string [ReportFilterService]
[message.field] string
[message.data] string
[message.from] number | date Range input from
[message.to] number | date Range input to

reportQuery.$scope.filterRemovedHandler(key) ℗

Filter remove handler. expected message fields:

Kind: static method of reportQuery
Access: private

Param Type Description
key string filter key

reportQuery.$scope.submitEventHandler() ℗

Kind: static method of reportQuery
Access: private

tagsFilter

An angular wrapper for Stork-Tags input component, handles component events of Added\Removed and executes call for suggestions on demand.

Kind: global class
Access: public
Properties

Name Type Description
getSuggestions function function executed to with current queryString, existingTags and callback for results. function getSuggestions(queryString, existingTags, callback)
placeholder string placeholder for the input field.
settings tagsFilterSettings

tagsFilter..suggestionsHandler(queryString, existingTags, callback)

function to be delivered by user for suggestions on user input change.

Kind: static method of tagsFilter

Param Type Description
queryString String user input
existingTags Array existing tags
callback function results ready callback

tagsFilter..tagsFilterSettings : Object

Kind: static typedef of tagsFilter
Access: public
Properties

Name Type Default Description
[suggestionsHandler] suggestionsHandler operand type.
[element] HTMLElement hosting element html container element.
storkTagsInput
[placeholder] String '' placeholder text for the input field.
[rechooseRemove] Boolean true
[inputMinWidth] number 110

OnLoadedCallback : function

'onLoaded' callback.

Kind: global typedef

Param Type Description
grid grid The grid component
setColumns function Replace existing grid columns.
setData function Replace grid data.
refresh function Refresh grid display.

OnSelectCallback : function

'onSelect' callback.

Kind: global typedef

Param Type Description
dataIndex int Selected record index.
rowData object Selected row record.
column String Selected record column.
isSelect boolean Is record selected.

OnDoubleSelectCallback : function

'onDoubleSelect' callback.

Kind: global typedef

Param Type Description
dataIndex int Selected record index.
rowData object Selected row record.
column String Selected record column.
isSelect boolean Is record selected.

OnClickCallback : function

'onClick' callback.

Kind: global typedef

Param Type Description
dataIndex int Selected record index.
rowData object Selected row record.
column String Selected record column.
isSelect boolean Is record selected.

OnSortCallback : function

'onSort' callback.

Kind: global typedef

Param Type Default Description
field string Selected record index.
direction string "asc\desc" Selected row record.

OnColumnResizeCallback : function

'onColumnResize' callback.

Kind: global typedef

Param Type Description
column string Selected column.
index int Selected row record.
width int column width.

OnScrollHitBottomCallback : function

'onScrollHitBottom' callback.

Kind: global typedef

Param Type Description
column string Selected column.
index int Selected row record.
width int column width.