diff --git a/docs/partials/api/ui.grid.treeBase.directive.uiGridTreeBaseExpandAllButtons.html b/docs/partials/api/ui.grid.treeBase.directive.uiGridTreeBaseExpandAllButtons.html index 6ca307173..a5e066d19 100644 --- a/docs/partials/api/ui.grid.treeBase.directive.uiGridTreeBaseExpandAllButtons.html +++ b/docs/partials/api/ui.grid.treeBase.directive.uiGridTreeBaseExpandAllButtons.html @@ -1,4 +1,4 @@ - Improve this doc View source
uiGridTreeBaseExpandAllButtons
+ Improve this doc View sourceuiGridTreeBaseExpandAllButtons
ui.grid.treeBase
uiGridTreeRowHeaderButtons
+ Improve this doc View sourceuiGridTreeRowHeaderButtons
ui.grid.treeBase
uiGridViewport
+ Improve this doc View sourceuiGridViewport
ui.grid.treeBase
Services for treeBase feature
Accumulate the data from this row onto the aggregations for each parent
Iterate over the parents, then iterate over the aggregations for each of those parents, and perform the aggregation for each individual aggregation
@@ -49,7 +49,7 @@boolean | whether or not the tree is all expanded |
Build the object which is stored on the column for holding meta-data about the aggregation. This method should only be called with columns which have an aggregation.
Param | Type | Details |
---|---|---|
column | GridColumn | The column which this object relates to @@ -114,13 +114,13 @@ |
row | GridRow | the row we want to expand |
Helper function used to finalize aggregation nodes and footer cells
Param | Type | Details |
---|---|---|
row | gridRow | The parent we're finalising |
aggregation | aggregation | The aggregation object manipulated by the aggregationFn |
Format the data from the aggregation into the rendered text e.g. if we had label: 'sum: ' and value: 25, we'd create 'sum: 25'.
As part of this we call any formatting callback routines we've been provided.
@@ -132,7 +132,7 @@Param | Type | Details |
---|---|---|
row | gridRow | the parent we're finalising |
After filtering has run, we need to go back through the tree and make sure the parent rows are always visible if any of the child rows are visible (filtering may make a child visible, but the parent may not @@ -143,7 +143,7 @@
Param | Type | Details |
---|---|---|
grid | Grid | the grid to fix filters on |
Looks at the parents array to determine our current state. If any node in the hierarchy is collapsed, then return collapsed, otherwise return expanded.
@@ -175,7 +175,7 @@string | The state we should be setting to any nodes we see |
Performs a recursive sort on the tree nodes, sorting the children of each node and putting them back into the children array.
Before doing this it turns back on all the sortIgnore - things that were previously @@ -202,7 +202,7 @@
promise | promise for the builder - actually we do it all inline so it's immediately resolved |
Uses the tree aggregation functions and finalizers to set the column footer aggregations.
Param | Type | Details |
---|---|---|
rows | rows | The visible rows. not used, but accepted to match signature of GridColumn.aggregationType diff --git a/index.html b/index.html index f49195870..9232a535b 100644 --- a/index.html +++ b/index.html @@ -76,11 +76,11 @@Angular UI GridCode on Github - + - + - Download ( 4.9.1 ) + Download ( 4.9.2 ) diff --git a/release/4.9.2/css/ui-grid.cellnav.css b/release/4.9.2/css/ui-grid.cellnav.css new file mode 100644 index 000000000..6c2ccdd1c --- /dev/null +++ b/release/4.9.2/css/ui-grid.cellnav.css @@ -0,0 +1,25 @@ +.ui-grid-cell-focus { + outline: 0; + background-color: #b3c4c7; +} +.ui-grid-focuser { + position: absolute; + left: 0; + top: 0; + z-index: -1; + width: 100%; + height: 100%; +} +.ui-grid-focuser:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.ui-grid-offscreen { + display: block; + position: absolute; + left: -10000px; + top: -10000px; + clip: rect(0px, 0px, 0px, 0px); +} diff --git a/release/4.9.2/css/ui-grid.cellnav.min.css b/release/4.9.2/css/ui-grid.cellnav.min.css new file mode 100644 index 000000000..0d826950c --- /dev/null +++ b/release/4.9.2/css/ui-grid.cellnav.min.css @@ -0,0 +1 @@ +.ui-grid-cell-focus{outline:0;background-color:#b3c4c7}.ui-grid-focuser{position:absolute;left:0;top:0;z-index:-1;width:100%;height:100%}.ui-grid-focuser:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.ui-grid-offscreen{display:block;position:absolute;left:-10000px;top:-10000px;clip:rect(0, 0, 0, 0)} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.core.css b/release/4.9.2/css/ui-grid.core.css new file mode 100644 index 000000000..4560afcc5 --- /dev/null +++ b/release/4.9.2/css/ui-grid.core.css @@ -0,0 +1,864 @@ +/*! + * ui-grid - v4.9.2 - 2020-12-01 + * Copyright (c) 2020 ; License: MIT + */ +.ui-grid { + border: 1px solid #d4d4d4; + box-sizing: content-box; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -o-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); +} +.ui-grid-vertical-bar { + position: absolute; + right: 0; + width: 0; +} +.ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar, +.ui-grid-cell:not(:last-child) .ui-grid-vertical-bar { + width: 1px; +} +.ui-grid-scrollbar-placeholder { + background-color: transparent; +} +.ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar { + background-color: #d4d4d4; +} +.ui-grid-cell:not(:last-child) .ui-grid-vertical-bar { + background-color: #d4d4d4; +} +.ui-grid-header-cell:last-child .ui-grid-vertical-bar { + right: -1px; + width: 1px; + background-color: #d4d4d4; +} +.ui-grid-clearfix:before, +.ui-grid-clearfix:after { + content: ""; + display: table; +} +.ui-grid-clearfix:after { + clear: both; +} +.ui-grid-invisible { + visibility: hidden; +} +.ui-grid-contents-wrapper { + position: relative; + height: 100%; + width: 100%; +} +.ui-grid-sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.ui-grid-icon-button { + background-color: transparent; + border: none; + padding: 0; +} +.clickable { + cursor: pointer; +} +.ui-grid-top-panel-background { + background-color: #f3f3f3; +} +.ui-grid-header { + border-bottom: 1px solid #d4d4d4; + box-sizing: border-box; +} +.ui-grid-top-panel { + position: relative; + overflow: hidden; + font-weight: bold; + background-color: #f3f3f3; + -webkit-border-top-right-radius: -1px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: -1px; + -moz-border-radius-topright: -1px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: -1px; + border-top-right-radius: -1px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: -1px; + -moz-background-clip: padding-box; + -webkit-background-clip: padding-box; + background-clip: padding-box; +} +.ui-grid-header-viewport { + overflow: hidden; +} +.ui-grid-header-canvas:before, +.ui-grid-header-canvas:after { + content: ""; + display: -ms-flexbox; + display: flex; + line-height: 0; +} +.ui-grid-header-canvas:after { + clear: both; +} +.ui-grid-header-cell-wrapper { + position: relative; + display: -ms-flexbox; + display: flex; + box-sizing: border-box; + height: 100%; + width: 100%; +} +.ui-grid-header-cell-row { + display: -ms-flexbox; + display: flex; + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} +.ui-grid-header-cell { + position: relative; + box-sizing: border-box; + background-color: inherit; + border-right: 1px solid; + border-color: #d4d4d4; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + width: 0; +} +.ui-grid-header-cell:last-child { + border-right: 0; +} +.ui-grid-header-cell .sortable { + cursor: pointer; +} +.ui-grid-header-cell .ui-grid-sort-priority-number { + margin-left: -8px; +} +/* Fixes IE word-wrap if needed on header cells */ +.ui-grid-header-cell > div { + -ms-flex-basis: 100%; + flex-basis: 100%; +} +.ui-grid-header .ui-grid-vertical-bar { + top: 0; + bottom: 0; +} +.ui-grid-column-menu-button { + position: absolute; + right: 1px; + top: 0; +} +.ui-grid-column-menu-button .ui-grid-icon-angle-down { + vertical-align: sub; +} +.ui-grid-header-cell-last-col .ui-grid-cell-contents, +.ui-grid-header-cell-last-col .ui-grid-filter-container, +.ui-grid-header-cell-last-col .ui-grid-column-menu-button, +.ui-grid-header-cell-last-col + .ui-grid-column-resizer.right { + margin-right: 13px; +} +.ui-grid-render-container-right .ui-grid-header-cell-last-col .ui-grid-cell-contents, +.ui-grid-render-container-right .ui-grid-header-cell-last-col .ui-grid-filter-container, +.ui-grid-render-container-right .ui-grid-header-cell-last-col .ui-grid-column-menu-button, +.ui-grid-render-container-right .ui-grid-header-cell-last-col + .ui-grid-column-resizer.right { + margin-right: 28px; +} +.ui-grid-column-menu { + position: absolute; +} +/* Slide up/down animations */ +.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-add, +.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove { + -webkit-transition: all 0.04s linear; + -moz-transition: all 0.04s linear; + -o-transition: all 0.04s linear; + transition: all 0.04s linear; + display: block !important; +} +.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-add.ng-hide-add-active, +.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove { + -webkit-transform: translateY(-100%); + -moz-transform: translateY(-100%); + -o-transform: translateY(-100%); + -ms-transform: translateY(-100%); + transform: translateY(-100%); +} +.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-add, +.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove.ng-hide-remove-active { + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + -ms-transform: translateY(0); + transform: translateY(0); +} +/* Slide up/down animations */ +.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-add, +.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove { + -webkit-transition: all 0.04s linear; + -moz-transition: all 0.04s linear; + -o-transition: all 0.04s linear; + transition: all 0.04s linear; + display: block !important; +} +.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-add.ng-hide-add-active, +.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove { + -webkit-transform: translateY(-100%); + -moz-transform: translateY(-100%); + -o-transform: translateY(-100%); + -ms-transform: translateY(-100%); + transform: translateY(-100%); +} +.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-add, +.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove.ng-hide-remove-active { + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -o-transform: translateY(0); + -ms-transform: translateY(0); + transform: translateY(0); +} +.ui-grid-filter-container { + padding: 4px 10px; + position: relative; +} +.ui-grid-filter-container .ui-grid-filter-button { + position: absolute; + top: 0; + bottom: 0; + right: 0; +} +.ui-grid-filter-container .ui-grid-filter-button [class^="ui-grid-icon"] { + position: absolute; + top: 50%; + line-height: 32px; + margin-top: -16px; + right: 10px; + opacity: 0.66; +} +.ui-grid-filter-container .ui-grid-filter-button [class^="ui-grid-icon"]:hover { + opacity: 1; +} +.ui-grid-filter-container .ui-grid-filter-button-select { + position: absolute; + top: 0; + bottom: 0; + right: 0; +} +.ui-grid-filter-container .ui-grid-filter-button-select [class^="ui-grid-icon"] { + position: absolute; + top: 50%; + line-height: 32px; + margin-top: -16px; + right: 0px; + opacity: 0.66; +} +.ui-grid-filter-container .ui-grid-filter-button-select [class^="ui-grid-icon"]:hover { + opacity: 1; +} +input[type="text"].ui-grid-filter-input { + box-sizing: border-box; + padding: 0 18px 0 0; + margin: 0; + width: 100%; + border: 1px solid #d4d4d4; + -webkit-border-top-right-radius: 0px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: 0; + border-top-right-radius: 0px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 0; + -moz-background-clip: padding-box; + -webkit-background-clip: padding-box; + background-clip: padding-box; +} +input[type="text"].ui-grid-filter-input:hover { + border: 1px solid #d4d4d4; +} +select.ui-grid-filter-select { + padding: 0; + margin: 0; + border: 0; + width: 90%; + border: 1px solid #d4d4d4; + -webkit-border-top-right-radius: 0px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: 0; + border-top-right-radius: 0px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 0; + -moz-background-clip: padding-box; + -webkit-background-clip: padding-box; + background-clip: padding-box; +} +select.ui-grid-filter-select:hover { + border: 1px solid #d4d4d4; +} +.ui-grid-filter-cancel-button-hidden select.ui-grid-filter-select { + width: 100%; +} +.ui-grid-render-container { + position: inherit; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-right-radius: 0px; + -webkit-border-bottom-left-radius: 0px; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomright: 0px; + -moz-border-radius-bottomleft: 0px; + -moz-border-radius-topleft: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 0px; + border-bottom-left-radius: 0px; + border-top-left-radius: 0; + -moz-background-clip: padding-box; + -webkit-background-clip: padding-box; + background-clip: padding-box; +} +.ui-grid-render-container:focus { + outline: none; +} +.ui-grid-viewport { + min-height: 20px; + position: relative; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; +} +.ui-grid-viewport:focus { + outline: none !important; +} +.ui-grid-canvas { + position: relative; + padding-top: 1px; +} +.ui-grid-row { + clear: both; +} +.ui-grid-row:nth-child(odd) .ui-grid-cell { + background-color: #fdfdfd; +} +.ui-grid-row:nth-child(even) .ui-grid-cell { + background-color: #f3f3f3; +} +.ui-grid-row:last-child .ui-grid-cell { + border-bottom-color: #d4d4d4; + border-bottom-style: solid; +} +.ui-grid-row:hover > [ui-grid-row] > .ui-grid-cell:hover .ui-grid-cell, +.ui-grid-row:nth-child(odd):hover .ui-grid-cell, +.ui-grid-row:nth-child(even):hover .ui-grid-cell { + background-color: #d5eaee; +} +.ui-grid-no-row-overlay { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: 10%; + background-color: #f3f3f3; + -webkit-border-top-right-radius: 0px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: 0; + border-top-right-radius: 0px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: 0; + -moz-background-clip: padding-box; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #d4d4d4; + font-size: 2em; + text-align: center; +} +.ui-grid-no-row-overlay > * { + position: absolute; + display: table; + margin: auto 0; + width: 100%; + top: 0; + bottom: 0; + left: 0; + right: 0; + opacity: 0.66; +} +.ui-grid-cell { + overflow: hidden; + float: left; + background-color: inherit; + border-right: 1px solid; + border-color: #d4d4d4; + box-sizing: border-box; +} +.ui-grid-cell:last-child { + border-right: 0; +} +.ui-grid-cell-contents { + padding: 5px; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + white-space: nowrap; + -ms-text-overflow: ellipsis; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + height: 100%; +} +.ui-grid-cell-contents-hidden { + visibility: hidden; + width: 0; + height: 0; + display: none; +} +.ui-grid-row .ui-grid-cell.ui-grid-row-header-cell { + background-color: #F0F0EE; + border-bottom: solid 1px #d4d4d4; +} +.ui-grid-cell-empty { + display: inline-block; + width: 10px; + height: 10px; +} +.ui-grid-footer-info { + padding: 5px 10px; +} +.ui-grid-footer-panel-background { + background-color: #f3f3f3; +} +.ui-grid-footer-panel { + position: relative; + border-bottom: 1px solid #d4d4d4; + border-top: 1px solid #d4d4d4; + overflow: hidden; + font-weight: bold; + background-color: #f3f3f3; + -webkit-border-top-right-radius: -1px; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-top-left-radius: -1px; + -moz-border-radius-topright: -1px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -moz-border-radius-topleft: -1px; + border-top-right-radius: -1px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-top-left-radius: -1px; + -moz-background-clip: padding-box; + -webkit-background-clip: padding-box; + background-clip: padding-box; +} +.ui-grid-grid-footer { + float: left; + width: 100%; +} +.ui-grid-footer-viewport, +.ui-grid-footer-canvas { + height: 100%; +} +.ui-grid-footer-viewport { + overflow: hidden; +} +.ui-grid-footer-canvas { + position: relative; +} +.ui-grid-footer-canvas:before, +.ui-grid-footer-canvas:after { + content: ""; + display: table; + line-height: 0; +} +.ui-grid-footer-canvas:after { + clear: both; +} +.ui-grid-footer-cell-wrapper { + position: relative; + display: table; + box-sizing: border-box; + height: 100%; +} +.ui-grid-footer-cell-row { + display: table-row; +} +.ui-grid-footer-cell { + overflow: hidden; + background-color: inherit; + border-right: 1px solid; + border-color: #d4d4d4; + box-sizing: border-box; + display: table-cell; +} +.ui-grid-footer-cell:last-child { + border-right: 0; +} +.ui-grid-menu-button { + z-index: 2; + position: absolute; + right: 0; + top: 0; + background: #f3f3f3; + border: 0; + border-left: 1px solid #d4d4d4; + border-bottom: 1px solid #d4d4d4; + cursor: pointer; + height: 32px; + font-weight: normal; +} +.ui-grid-menu-button .ui-grid-icon-container { + margin-top: 5px; + margin-left: 2px; +} +.ui-grid-menu-button .ui-grid-menu { + right: 0; +} +.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid { + overflow: scroll; +} +.ui-grid-menu { + overflow: hidden; + max-width: 320px; + z-index: 2; + position: absolute; + right: 100%; + padding: 0 10px 20px 10px; + cursor: pointer; + box-sizing: border-box; +} +.ui-grid-menu-item { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.ui-grid-menu .ui-grid-menu-inner { + background: #fff; + border: 1px solid #d4d4d4; + position: relative; + white-space: nowrap; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +.ui-grid-menu .ui-grid-menu-inner ul { + margin: 0; + padding: 0; + list-style-type: none; +} +.ui-grid-menu .ui-grid-menu-inner ul li { + padding: 0; +} +.ui-grid-menu .ui-grid-menu-inner ul li .ui-grid-menu-item { + color: #000; + min-width: 100%; + padding: 8px; + text-align: left; + background: transparent; + border: none; + cursor: default; +} +.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item { + cursor: pointer; +} +.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item:hover, +.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item:focus { + background-color: #b3c4c7; +} +.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item.ui-grid-menu-item-active { + background-color: #9cb2b6; +} +.ui-grid-menu .ui-grid-menu-inner ul li:not(:last-child) > .ui-grid-menu-item { + border-bottom: 1px solid #d4d4d4; +} +.ui-grid-sortarrow { + right: 5px; + position: absolute; + width: 20px; + top: 0; + bottom: 0; + background-position: center; +} +.ui-grid-sortarrow.down { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -o-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +@font-face { + font-family: 'ui-grid'; + src: url('../fonts/ui-grid.eot'); + src: url('../fonts/ui-grid.eot#iefix') format('embedded-opentype'), url('../fonts/ui-grid.woff') format('woff'), url('../fonts/ui-grid.ttf') format('truetype'), url('../fonts/ui-grid.svg?#ui-grid') format('svg'); + font-weight: normal; + font-style: normal; +} +/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ +/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ +/* +@media screen and (-webkit-min-device-pixel-ratio:0) { + @font-face { + font-family: 'ui-grid'; + src: url('@{font-path}ui-grid.svg?12312827#ui-grid') format('svg'); + } +} +*/ +[class^="ui-grid-icon"]:before, +[class*=" ui-grid-icon"]:before { + font-family: "ui-grid"; + font-style: normal; + font-weight: normal; + speak: none; + display: inline-block; + text-decoration: inherit; + width: 1em; + margin-right: 0.2em; + text-align: center; + /* opacity: .8; */ + /* For safety - reset parent styles, that can break glyph codes*/ + font-variant: normal; + text-transform: none; + /* fix buttons height, for twitter bootstrap */ + line-height: 1em; + /* Animation center compensation - margins should be symmetric */ + /* remove if not needed */ + margin-left: 0.2em; + /* you can be more comfortable with increased icons size */ + /* font-size: 120%; */ + /* Uncomment for 3D effect */ + /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ +} +.ui-grid-icon-blank::before { + width: 1em; + content: ' '; +} +.ui-grid-icon-plus-squared:before { + content: '\c350'; +} +.ui-grid-icon-minus-squared:before { + content: '\c351'; +} +.ui-grid-icon-search:before { + content: '\c352'; +} +.ui-grid-icon-cancel:before { + content: '\c353'; +} +.ui-grid-icon-info-circled:before { + content: '\c354'; +} +.ui-grid-icon-lock:before { + content: '\c355'; +} +.ui-grid-icon-lock-open:before { + content: '\c356'; +} +.ui-grid-icon-pencil:before { + content: '\c357'; +} +.ui-grid-icon-down-dir:before { + content: '\c358'; +} +.ui-grid-icon-up-dir:before { + content: '\c359'; +} +.ui-grid-icon-left-dir:before { + content: '\c35a'; +} +.ui-grid-icon-right-dir:before { + content: '\c35b'; +} +.ui-grid-icon-left-open:before { + content: '\c35c'; +} +.ui-grid-icon-right-open:before { + content: '\c35d'; +} +.ui-grid-icon-angle-down:before { + content: '\c35e'; +} +.ui-grid-icon-filter:before { + content: '\c35f'; +} +.ui-grid-icon-sort-alt-up:before { + content: '\c360'; +} +.ui-grid-icon-sort-alt-down:before { + content: '\c361'; +} +.ui-grid-icon-ok:before { + content: '\c362'; +} +.ui-grid-icon-menu:before { + content: '\c363'; +} +.ui-grid-icon-indent-left:before { + content: '\e800'; +} +.ui-grid-icon-indent-right:before { + content: '\e801'; +} +.ui-grid-icon-spin5:before { + content: '\ea61'; +} +/* +* RTL Styles +*/ +.ui-grid[dir=rtl] .ui-grid-header-cell, +.ui-grid[dir=rtl] .ui-grid-footer-cell, +.ui-grid[dir=rtl] .ui-grid-cell { + float: right !important; +} +.ui-grid[dir=rtl] .ui-grid-column-menu-button { + position: absolute; + left: 1px; + top: 0; + right: inherit; +} +.ui-grid[dir=rtl] .ui-grid-cell:first-child, +.ui-grid[dir=rtl] .ui-grid-header-cell:first-child, +.ui-grid[dir=rtl] .ui-grid-footer-cell:first-child { + border-right: 0; +} +.ui-grid[dir=rtl] .ui-grid-cell:last-child, +.ui-grid[dir=rtl] .ui-grid-header-cell:last-child { + border-right: 1px solid #d4d4d4; + border-left: 0; +} +.ui-grid[dir=rtl] .ui-grid-header-cell:first-child .ui-grid-vertical-bar, +.ui-grid[dir=rtl] .ui-grid-footer-cell:first-child .ui-grid-vertical-bar, +.ui-grid[dir=rtl] .ui-grid-cell:first-child .ui-grid-vertical-bar { + width: 0; +} +.ui-grid[dir=rtl] .ui-grid-menu-button { + z-index: 2; + position: absolute; + left: 0; + right: auto; + background: #f3f3f3; + border: 1px solid #d4d4d4; + cursor: pointer; + min-height: 27px; + font-weight: normal; +} +.ui-grid[dir=rtl] .ui-grid-menu-button .ui-grid-menu { + left: 0; + right: auto; +} +.ui-grid[dir=rtl] .ui-grid-filter-container .ui-grid-filter-button { + right: initial; + left: 0; +} +.ui-grid[dir=rtl] .ui-grid-filter-container .ui-grid-filter-button [class^="ui-grid-icon"] { + right: initial; + left: 10px; +} +/* + Animation example, for spinners +*/ +.ui-grid-animate-spin { + -moz-animation: ui-grid-spin 2s infinite linear; + -o-animation: ui-grid-spin 2s infinite linear; + -webkit-animation: ui-grid-spin 2s infinite linear; + animation: ui-grid-spin 2s infinite linear; + display: inline-block; +} +@-moz-keyframes ui-grid-spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@-webkit-keyframes ui-grid-spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@-o-keyframes ui-grid-spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@-ms-keyframes ui-grid-spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes ui-grid-spin { + 0% { + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + -o-transform: rotate(359deg); + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} diff --git a/release/4.9.2/css/ui-grid.core.min.css b/release/4.9.2/css/ui-grid.core.min.css new file mode 100644 index 000000000..d872513d5 --- /dev/null +++ b/release/4.9.2/css/ui-grid.core.min.css @@ -0,0 +1,4 @@ +/*! + * ui-grid - v4.9.2 - 2020-12-01 + * Copyright (c) 2020 ; License: MIT + */.ui-grid{border:1px solid #d4d4d4;box-sizing:content-box;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-o-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.ui-grid-vertical-bar{position:absolute;right:0;width:0}.ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar,.ui-grid-cell:not(:last-child) .ui-grid-vertical-bar{width:1px}.ui-grid-scrollbar-placeholder{background-color:transparent}.ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar{background-color:#d4d4d4}.ui-grid-cell:not(:last-child) .ui-grid-vertical-bar{background-color:#d4d4d4}.ui-grid-header-cell:last-child .ui-grid-vertical-bar{right:-1px;width:1px;background-color:#d4d4d4}.ui-grid-clearfix:before,.ui-grid-clearfix:after{content:"";display:table}.ui-grid-clearfix:after{clear:both}.ui-grid-invisible{visibility:hidden}.ui-grid-contents-wrapper{position:relative;height:100%;width:100%}.ui-grid-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.ui-grid-icon-button{background-color:transparent;border:none;padding:0}.clickable{cursor:pointer}.ui-grid-top-panel-background{background-color:#f3f3f3}.ui-grid-header{border-bottom:1px solid #d4d4d4;box-sizing:border-box}.ui-grid-top-panel{position:relative;overflow:hidden;font-weight:bold;background-color:#f3f3f3;-webkit-border-top-right-radius:-1px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:-1px;-moz-border-radius-topright:-1px;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:-1px;border-top-right-radius:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:-1px;-moz-background-clip:padding-box;-webkit-background-clip:padding-box;background-clip:padding-box}.ui-grid-header-viewport{overflow:hidden}.ui-grid-header-canvas:before,.ui-grid-header-canvas:after{content:"";display:-ms-flexbox;display:flex;line-height:0}.ui-grid-header-canvas:after{clear:both}.ui-grid-header-cell-wrapper{position:relative;display:-ms-flexbox;display:flex;box-sizing:border-box;height:100%;width:100%}.ui-grid-header-cell-row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.ui-grid-header-cell{position:relative;box-sizing:border-box;background-color:inherit;border-right:1px solid;border-color:#d4d4d4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:0}.ui-grid-header-cell:last-child{border-right:0}.ui-grid-header-cell .sortable{cursor:pointer}.ui-grid-header-cell .ui-grid-sort-priority-number{margin-left:-8px}.ui-grid-header-cell>div{-ms-flex-basis:100%;flex-basis:100%}.ui-grid-header .ui-grid-vertical-bar{top:0;bottom:0}.ui-grid-column-menu-button{position:absolute;right:1px;top:0}.ui-grid-column-menu-button .ui-grid-icon-angle-down{vertical-align:sub}.ui-grid-header-cell-last-col .ui-grid-cell-contents,.ui-grid-header-cell-last-col .ui-grid-filter-container,.ui-grid-header-cell-last-col .ui-grid-column-menu-button,.ui-grid-header-cell-last-col+.ui-grid-column-resizer.right{margin-right:13px}.ui-grid-render-container-right .ui-grid-header-cell-last-col .ui-grid-cell-contents,.ui-grid-render-container-right .ui-grid-header-cell-last-col .ui-grid-filter-container,.ui-grid-render-container-right .ui-grid-header-cell-last-col .ui-grid-column-menu-button,.ui-grid-render-container-right .ui-grid-header-cell-last-col+.ui-grid-column-resizer.right{margin-right:28px}.ui-grid-column-menu{position:absolute}.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-add,.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove{-webkit-transition:all .04s linear;-moz-transition:all .04s linear;-o-transition:all .04s linear;transition:all .04s linear;display:block !important}.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-add.ng-hide-add-active,.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove{-webkit-transform:translateY(-100%);-moz-transform:translateY(-100%);-o-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%)}.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-add,.ui-grid-column-menu .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove.ng-hide-remove-active{-webkit-transform:translateY(0);-moz-transform:translateY(0);-o-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-add,.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove{-webkit-transition:all .04s linear;-moz-transition:all .04s linear;-o-transition:all .04s linear;transition:all .04s linear;display:block !important}.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-add.ng-hide-add-active,.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove{-webkit-transform:translateY(-100%);-moz-transform:translateY(-100%);-o-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%)}.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-add,.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid.ng-hide-remove.ng-hide-remove-active{-webkit-transform:translateY(0);-moz-transform:translateY(0);-o-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.ui-grid-filter-container{padding:4px 10px;position:relative}.ui-grid-filter-container .ui-grid-filter-button{position:absolute;top:0;bottom:0;right:0}.ui-grid-filter-container .ui-grid-filter-button [class^="ui-grid-icon"]{position:absolute;top:50%;line-height:32px;margin-top:-16px;right:10px;opacity:.66}.ui-grid-filter-container .ui-grid-filter-button [class^="ui-grid-icon"]:hover{opacity:1}.ui-grid-filter-container .ui-grid-filter-button-select{position:absolute;top:0;bottom:0;right:0}.ui-grid-filter-container .ui-grid-filter-button-select [class^="ui-grid-icon"]{position:absolute;top:50%;line-height:32px;margin-top:-16px;right:0px;opacity:.66}.ui-grid-filter-container .ui-grid-filter-button-select [class^="ui-grid-icon"]:hover{opacity:1}input[type="text"].ui-grid-filter-input{box-sizing:border-box;padding:0 18px 0 0;margin:0;width:100%;border:1px solid #d4d4d4;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:0;-moz-background-clip:padding-box;-webkit-background-clip:padding-box;background-clip:padding-box}input[type="text"].ui-grid-filter-input:hover{border:1px solid #d4d4d4}select.ui-grid-filter-select{padding:0;margin:0;border:0;width:90%;border:1px solid #d4d4d4;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:0;-moz-background-clip:padding-box;-webkit-background-clip:padding-box;background-clip:padding-box}select.ui-grid-filter-select:hover{border:1px solid #d4d4d4}.ui-grid-filter-cancel-button-hidden select.ui-grid-filter-select{width:100%}.ui-grid-render-container{position:inherit;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:0;-moz-background-clip:padding-box;-webkit-background-clip:padding-box;background-clip:padding-box}.ui-grid-render-container:focus{outline:none}.ui-grid-viewport{min-height:20px;position:relative;overflow-y:scroll;-webkit-overflow-scrolling:touch}.ui-grid-viewport:focus{outline:none !important}.ui-grid-canvas{position:relative;padding-top:1px}.ui-grid-row{clear:both}.ui-grid-row:nth-child(odd) .ui-grid-cell{background-color:#fdfdfd}.ui-grid-row:nth-child(even) .ui-grid-cell{background-color:#f3f3f3}.ui-grid-row:last-child .ui-grid-cell{border-bottom-color:#d4d4d4;border-bottom-style:solid}.ui-grid-row:hover>[ui-grid-row]>.ui-grid-cell:hover .ui-grid-cell,.ui-grid-row:nth-child(odd):hover .ui-grid-cell,.ui-grid-row:nth-child(even):hover .ui-grid-cell{background-color:#d5eaee}.ui-grid-no-row-overlay{position:absolute;top:0;bottom:0;left:0;right:0;margin:10%;background-color:#f3f3f3;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:0;-moz-background-clip:padding-box;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #d4d4d4;font-size:2em;text-align:center}.ui-grid-no-row-overlay>*{position:absolute;display:table;margin:auto 0;width:100%;top:0;bottom:0;left:0;right:0;opacity:.66}.ui-grid-cell{overflow:hidden;float:left;background-color:inherit;border-right:1px solid;border-color:#d4d4d4;box-sizing:border-box}.ui-grid-cell:last-child{border-right:0}.ui-grid-cell-contents{padding:5px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;-ms-text-overflow:ellipsis;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;height:100%}.ui-grid-cell-contents-hidden{visibility:hidden;width:0;height:0;display:none}.ui-grid-row .ui-grid-cell.ui-grid-row-header-cell{background-color:#F0F0EE;border-bottom:solid 1px #d4d4d4}.ui-grid-cell-empty{display:inline-block;width:10px;height:10px}.ui-grid-footer-info{padding:5px 10px}.ui-grid-footer-panel-background{background-color:#f3f3f3}.ui-grid-footer-panel{position:relative;border-bottom:1px solid #d4d4d4;border-top:1px solid #d4d4d4;overflow:hidden;font-weight:bold;background-color:#f3f3f3;-webkit-border-top-right-radius:-1px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:-1px;-moz-border-radius-topright:-1px;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-moz-border-radius-topleft:-1px;border-top-right-radius:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:-1px;-moz-background-clip:padding-box;-webkit-background-clip:padding-box;background-clip:padding-box}.ui-grid-grid-footer{float:left;width:100%}.ui-grid-footer-viewport,.ui-grid-footer-canvas{height:100%}.ui-grid-footer-viewport{overflow:hidden}.ui-grid-footer-canvas{position:relative}.ui-grid-footer-canvas:before,.ui-grid-footer-canvas:after{content:"";display:table;line-height:0}.ui-grid-footer-canvas:after{clear:both}.ui-grid-footer-cell-wrapper{position:relative;display:table;box-sizing:border-box;height:100%}.ui-grid-footer-cell-row{display:table-row}.ui-grid-footer-cell{overflow:hidden;background-color:inherit;border-right:1px solid;border-color:#d4d4d4;box-sizing:border-box;display:table-cell}.ui-grid-footer-cell:last-child{border-right:0}.ui-grid-menu-button{z-index:2;position:absolute;right:0;top:0;background:#f3f3f3;border:0;border-left:1px solid #d4d4d4;border-bottom:1px solid #d4d4d4;cursor:pointer;height:32px;font-weight:normal}.ui-grid-menu-button .ui-grid-icon-container{margin-top:5px;margin-left:2px}.ui-grid-menu-button .ui-grid-menu{right:0}.ui-grid-menu-button .ui-grid-menu .ui-grid-menu-mid{overflow:scroll}.ui-grid-menu{overflow:hidden;max-width:320px;z-index:2;position:absolute;right:100%;padding:0 10px 20px 10px;cursor:pointer;box-sizing:border-box}.ui-grid-menu-item{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-grid-menu .ui-grid-menu-inner{background:#fff;border:1px solid #d4d4d4;position:relative;white-space:nowrap;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.ui-grid-menu .ui-grid-menu-inner ul{margin:0;padding:0;list-style-type:none}.ui-grid-menu .ui-grid-menu-inner ul li{padding:0}.ui-grid-menu .ui-grid-menu-inner ul li .ui-grid-menu-item{color:#000;min-width:100%;padding:8px;text-align:left;background:transparent;border:none;cursor:default}.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item{cursor:pointer}.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item:hover,.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item:focus{background-color:#b3c4c7}.ui-grid-menu .ui-grid-menu-inner ul li button.ui-grid-menu-item.ui-grid-menu-item-active{background-color:#9cb2b6}.ui-grid-menu .ui-grid-menu-inner ul li:not(:last-child)>.ui-grid-menu-item{border-bottom:1px solid #d4d4d4}.ui-grid-sortarrow{right:5px;position:absolute;width:20px;top:0;bottom:0;background-position:center}.ui-grid-sortarrow.down{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}@font-face{font-family:'ui-grid';src:url('../fonts/ui-grid.eot');src:url('../fonts/ui-grid.eot#iefix') format('embedded-opentype'),url('../fonts/ui-grid.woff') format('woff'),url('../fonts/ui-grid.ttf') format('truetype'),url('../fonts/ui-grid.svg?#ui-grid') format('svg');font-weight:normal;font-style:normal}[class^="ui-grid-icon"]:before,[class*=" ui-grid-icon"]:before{font-family:"ui-grid";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.ui-grid-icon-blank::before{width:1em;content:' '}.ui-grid-icon-plus-squared:before{content:'\c350'}.ui-grid-icon-minus-squared:before{content:'\c351'}.ui-grid-icon-search:before{content:'\c352'}.ui-grid-icon-cancel:before{content:'\c353'}.ui-grid-icon-info-circled:before{content:'\c354'}.ui-grid-icon-lock:before{content:'\c355'}.ui-grid-icon-lock-open:before{content:'\c356'}.ui-grid-icon-pencil:before{content:'\c357'}.ui-grid-icon-down-dir:before{content:'\c358'}.ui-grid-icon-up-dir:before{content:'\c359'}.ui-grid-icon-left-dir:before{content:'\c35a'}.ui-grid-icon-right-dir:before{content:'\c35b'}.ui-grid-icon-left-open:before{content:'\c35c'}.ui-grid-icon-right-open:before{content:'\c35d'}.ui-grid-icon-angle-down:before{content:'\c35e'}.ui-grid-icon-filter:before{content:'\c35f'}.ui-grid-icon-sort-alt-up:before{content:'\c360'}.ui-grid-icon-sort-alt-down:before{content:'\c361'}.ui-grid-icon-ok:before{content:'\c362'}.ui-grid-icon-menu:before{content:'\c363'}.ui-grid-icon-indent-left:before{content:'\e800'}.ui-grid-icon-indent-right:before{content:'\e801'}.ui-grid-icon-spin5:before{content:'\ea61'}.ui-grid[dir=rtl] .ui-grid-header-cell,.ui-grid[dir=rtl] .ui-grid-footer-cell,.ui-grid[dir=rtl] .ui-grid-cell{float:right !important}.ui-grid[dir=rtl] .ui-grid-column-menu-button{position:absolute;left:1px;top:0;right:inherit}.ui-grid[dir=rtl] .ui-grid-cell:first-child,.ui-grid[dir=rtl] .ui-grid-header-cell:first-child,.ui-grid[dir=rtl] .ui-grid-footer-cell:first-child{border-right:0}.ui-grid[dir=rtl] .ui-grid-cell:last-child,.ui-grid[dir=rtl] .ui-grid-header-cell:last-child{border-right:1px solid #d4d4d4;border-left:0}.ui-grid[dir=rtl] .ui-grid-header-cell:first-child .ui-grid-vertical-bar,.ui-grid[dir=rtl] .ui-grid-footer-cell:first-child .ui-grid-vertical-bar,.ui-grid[dir=rtl] .ui-grid-cell:first-child .ui-grid-vertical-bar{width:0}.ui-grid[dir=rtl] .ui-grid-menu-button{z-index:2;position:absolute;left:0;right:auto;background:#f3f3f3;border:1px solid #d4d4d4;cursor:pointer;min-height:27px;font-weight:normal}.ui-grid[dir=rtl] .ui-grid-menu-button .ui-grid-menu{left:0;right:auto}.ui-grid[dir=rtl] .ui-grid-filter-container .ui-grid-filter-button{right:initial;left:0}.ui-grid[dir=rtl] .ui-grid-filter-container .ui-grid-filter-button [class^="ui-grid-icon"]{right:initial;left:10px}.ui-grid-animate-spin{-moz-animation:ui-grid-spin 2s infinite linear;-o-animation:ui-grid-spin 2s infinite linear;-webkit-animation:ui-grid-spin 2s infinite linear;animation:ui-grid-spin 2s infinite linear;display:inline-block}@-moz-keyframes ui-grid-spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes ui-grid-spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-o-keyframes ui-grid-spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-ms-keyframes ui-grid-spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes ui-grid-spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.edit.css b/release/4.9.2/css/ui-grid.edit.css new file mode 100644 index 000000000..be3d1461c --- /dev/null +++ b/release/4.9.2/css/ui-grid.edit.css @@ -0,0 +1,23 @@ +.ui-grid-cell input { + border-radius: inherit; + padding: 0; + width: 100%; + color: inherit; + height: auto; + font: inherit; + outline: none; +} +.ui-grid-cell input:focus { + color: inherit; + outline: none; +} +.ui-grid-cell input[type="checkbox"] { + margin: 9px 0 0 6px; + width: auto; +} +.ui-grid-cell input.ng-invalid { + border: 1px solid #fc8f8f; +} +.ui-grid-cell input.ng-valid { + border: 1px solid #d4d4d4; +} diff --git a/release/4.9.2/css/ui-grid.edit.min.css b/release/4.9.2/css/ui-grid.edit.min.css new file mode 100644 index 000000000..64ea11477 --- /dev/null +++ b/release/4.9.2/css/ui-grid.edit.min.css @@ -0,0 +1 @@ +.ui-grid-cell input{border-radius:inherit;padding:0;width:100%;color:inherit;height:auto;font:inherit;outline:none}.ui-grid-cell input:focus{color:inherit;outline:none}.ui-grid-cell input[type="checkbox"]{margin:9px 0 0 6px;width:auto}.ui-grid-cell input.ng-invalid{border:1px solid #fc8f8f}.ui-grid-cell input.ng-valid{border:1px solid #d4d4d4} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.empty-base-layer.css b/release/4.9.2/css/ui-grid.empty-base-layer.css new file mode 100644 index 000000000..0bb8c09ae --- /dev/null +++ b/release/4.9.2/css/ui-grid.empty-base-layer.css @@ -0,0 +1,6 @@ +.ui-grid-viewport .ui-grid-empty-base-layer-container { + position: absolute; + overflow: hidden; + pointer-events: none; + z-index: -1; +} diff --git a/release/4.9.2/css/ui-grid.empty-base-layer.min.css b/release/4.9.2/css/ui-grid.empty-base-layer.min.css new file mode 100644 index 000000000..f89c68ac3 --- /dev/null +++ b/release/4.9.2/css/ui-grid.empty-base-layer.min.css @@ -0,0 +1 @@ +.ui-grid-viewport .ui-grid-empty-base-layer-container{position:absolute;overflow:hidden;pointer-events:none;z-index:-1} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.expandable.css b/release/4.9.2/css/ui-grid.expandable.css new file mode 100644 index 000000000..541349049 --- /dev/null +++ b/release/4.9.2/css/ui-grid.expandable.css @@ -0,0 +1,16 @@ +.expandableRow .ui-grid-row:nth-child(odd) .ui-grid-cell { + background-color: #fdfdfd; +} +.expandableRow .ui-grid-row:nth-child(even) .ui-grid-cell { + background-color: #f3f3f3; +} +.ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell { + pointer-events: none; +} +.ui-grid-expandable-buttons-cell i { + pointer-events: all; +} +.scrollFiller { + float: left; + border: 1px solid #d4d4d4; +} diff --git a/release/4.9.2/css/ui-grid.expandable.min.css b/release/4.9.2/css/ui-grid.expandable.min.css new file mode 100644 index 000000000..2c133841a --- /dev/null +++ b/release/4.9.2/css/ui-grid.expandable.min.css @@ -0,0 +1 @@ +.expandableRow .ui-grid-row:nth-child(odd) .ui-grid-cell{background-color:#fdfdfd}.expandableRow .ui-grid-row:nth-child(even) .ui-grid-cell{background-color:#f3f3f3}.ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell{pointer-events:none}.ui-grid-expandable-buttons-cell i{pointer-events:all}.scrollFiller{float:left;border:1px solid #d4d4d4} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.exporter.css b/release/4.9.2/css/ui-grid.exporter.css new file mode 100644 index 000000000..e69de29bb diff --git a/release/4.9.2/css/ui-grid.exporter.min.css b/release/4.9.2/css/ui-grid.exporter.min.css new file mode 100644 index 000000000..e69de29bb diff --git a/release/4.9.2/css/ui-grid.grouping.css b/release/4.9.2/css/ui-grid.grouping.css new file mode 100644 index 000000000..e0ba6cd1e --- /dev/null +++ b/release/4.9.2/css/ui-grid.grouping.css @@ -0,0 +1,3 @@ +.ui-grid-tree-header-row { + font-weight: bold !important; +} diff --git a/release/4.9.2/css/ui-grid.grouping.min.css b/release/4.9.2/css/ui-grid.grouping.min.css new file mode 100644 index 000000000..599cde666 --- /dev/null +++ b/release/4.9.2/css/ui-grid.grouping.min.css @@ -0,0 +1 @@ +.ui-grid-tree-header-row{font-weight:bold !important} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.importer.css b/release/4.9.2/css/ui-grid.importer.css new file mode 100644 index 000000000..e69de29bb diff --git a/release/4.9.2/css/ui-grid.importer.min.css b/release/4.9.2/css/ui-grid.importer.min.css new file mode 100644 index 000000000..e69de29bb diff --git a/release/4.9.2/css/ui-grid.move-columns.css b/release/4.9.2/css/ui-grid.move-columns.css new file mode 100644 index 000000000..2c8fa80dc --- /dev/null +++ b/release/4.9.2/css/ui-grid.move-columns.css @@ -0,0 +1,9 @@ +.movingColumn { + position: absolute; + top: 0; + border: 1px solid #d4d4d4; + box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.2); +} +.movingColumn .ui-grid-icon-angle-down { + display: none; +} diff --git a/release/4.9.2/css/ui-grid.move-columns.min.css b/release/4.9.2/css/ui-grid.move-columns.min.css new file mode 100644 index 000000000..064caf5e5 --- /dev/null +++ b/release/4.9.2/css/ui-grid.move-columns.min.css @@ -0,0 +1 @@ +.movingColumn{position:absolute;top:0;border:1px solid #d4d4d4;box-shadow:inset 0 0 14px rgba(0,0,0,0.2)}.movingColumn .ui-grid-icon-angle-down{display:none} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.pagination.css b/release/4.9.2/css/ui-grid.pagination.css new file mode 100644 index 000000000..9799fa37e --- /dev/null +++ b/release/4.9.2/css/ui-grid.pagination.css @@ -0,0 +1,299 @@ +/* This file contains variable declarations (do not remove this line) */ +/*-- VARIABLES (DO NOT REMOVE THESE COMMENTS) --*/ +/** +* @section Grid styles +*/ +/** +* @section Header styles +*/ +/** @description Colors for header gradient */ +/** +* @section Grid body styles +*/ +/** @description Colors used for row alternation */ +/** +* @section Grid Menu colors +*/ +/** +* @section Sort arrow colors +*/ +/** +* @section Scrollbar styles +*/ +/** +* @section font library path +*/ +/*-- END VARIABLES (DO NOT REMOVE THESE COMMENTS) --*/ +/*--------------------------------------------------- + LESS Elements 0.9 + --------------------------------------------------- + A set of useful LESS mixins + More info at: http://lesselements.com + ---------------------------------------------------*/ +.ui-grid-pager-panel { + display: flex; + justify-content: space-between; + align-items: center; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + padding-top: 3px; + padding-bottom: 3px; + box-sizing: content-box; +} +.ui-grid-pager-container { + float: left; +} +.ui-grid-pager-control { + padding: 5px 0; + display: flex; + flex-flow: row nowrap; + align-items: center; + margin-right: 10px; + margin-left: 10px; + min-width: 135px; + float: left; +} +.ui-grid-pager-control button, +.ui-grid-pager-control span, +.ui-grid-pager-control input { + margin-right: 4px; +} +.ui-grid-pager-control button { + height: 25px; + min-width: 26px; + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + touch-action: manipulation; + cursor: pointer; + background: #f3f3f3; + border: 1px solid #ccc; + white-space: nowrap; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #eee; +} +.ui-grid-pager-control button:hover { + border-color: #adadad; + text-decoration: none; +} +.ui-grid-pager-control button:focus { + border-color: #8c8c8c; + text-decoration: none; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.ui-grid-pager-control button:active { + border-color: #adadad; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.ui-grid-pager-control button:active:focus { + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.ui-grid-pager-control button:active:hover, +.ui-grid-pager-control button:active:focus { + background-color: #c8c8c8; + border-color: #8c8c8c; +} +.ui-grid-pager-control button:hover, +.ui-grid-pager-control button:focus, +.ui-grid-pager-control button:active { + color: #eee; + background: #dadada; +} +.ui-grid-pager-control button[disabled] { + cursor: not-allowed; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +.ui-grid-pager-control button[disabled]:hover, +.ui-grid-pager-control button[disabled]:focus { + background-color: #f3f3f3; + border-color: #ccc; +} +.ui-grid-pager-control input { + display: inline; + height: 26px; + width: 50px; + vertical-align: top; + color: #555555; + background: #fff; + border: 1px solid #ccc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.ui-grid-pager-control input:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.ui-grid-pager-control input[disabled], +.ui-grid-pager-control input[readonly], +.ui-grid-pager-control input::-moz-placeholder { + opacity: 1; +} +.ui-grid-pager-control input::-moz-placeholder, +.ui-grid-pager-control input:-ms-input-placeholder, +.ui-grid-pager-control input::-webkit-input-placeholder { + color: #999; +} +.ui-grid-pager-control input::-ms-expand { + border: 0; + background-color: transparent; +} +.ui-grid-pager-control input[disabled], +.ui-grid-pager-control input[readonly] { + background-color: #eeeeee; +} +.ui-grid-pager-control input[disabled] { + cursor: not-allowed; +} +.ui-grid-pager-control .ui-grid-pager-max-pages-number { + vertical-align: bottom; +} +.ui-grid-pager-control .ui-grid-pager-max-pages-number > * { + vertical-align: bottom; +} +.ui-grid-pager-control .ui-grid-pager-max-pages-number abbr { + border-bottom: none; + text-decoration: none; +} +.ui-grid-pager-control .first-bar { + width: 10px; + border-left: 2px solid #4d4d4d; + margin-top: -6px; + height: 12px; + margin-left: -3px; +} +.ui-grid-pager-control .first-bar-rtl { + width: 10px; + border-left: 2px solid #4d4d4d; + margin-top: -6px; + height: 12px; + margin-right: -7px; +} +.ui-grid-pager-control .first-triangle { + width: 0; + height: 0; + border-style: solid; + border-width: 5px 8.7px 5px 0; + border-color: transparent #4d4d4d transparent transparent; + margin-left: 2px; +} +.ui-grid-pager-control .next-triangle { + margin-left: 1px; +} +.ui-grid-pager-control .prev-triangle { + margin-left: 0; +} +.ui-grid-pager-control .last-triangle { + width: 0; + height: 0; + border-style: solid; + border-width: 5px 0 5px 8.7px; + border-color: transparent transparent transparent #4d4d4d; + margin-left: -1px; +} +.ui-grid-pager-control .last-bar { + width: 10px; + border-left: 2px solid #4d4d4d; + margin-top: -6px; + height: 12px; + margin-left: 1px; +} +.ui-grid-pager-control .last-bar-rtl { + width: 10px; + border-left: 2px solid #4d4d4d; + margin-top: -6px; + height: 12px; + margin-right: -11px; +} +.ui-grid-pager-row-count-picker { + float: left; + padding: 5px 10px; +} +.ui-grid-pager-row-count-picker select { + color: #555555; + background: #fff; + border: 1px solid #ccc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; + height: 25px; + width: 67px; + display: inline; + vertical-align: middle; +} +.ui-grid-pager-row-count-picker select:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.ui-grid-pager-row-count-picker select[disabled], +.ui-grid-pager-row-count-picker select[readonly], +.ui-grid-pager-row-count-picker select::-moz-placeholder { + opacity: 1; +} +.ui-grid-pager-row-count-picker select::-moz-placeholder, +.ui-grid-pager-row-count-picker select:-ms-input-placeholder, +.ui-grid-pager-row-count-picker select::-webkit-input-placeholder { + color: #999; +} +.ui-grid-pager-row-count-picker select::-ms-expand { + border: 0; + background-color: transparent; +} +.ui-grid-pager-row-count-picker select[disabled], +.ui-grid-pager-row-count-picker select[readonly] { + background-color: #eeeeee; +} +.ui-grid-pager-row-count-picker select[disabled] { + cursor: not-allowed; +} +.ui-grid-pager-row-count-picker .ui-grid-pager-row-count-label { + margin-top: 3px; +} +.ui-grid-pager-count-container { + float: right; + margin-top: 4px; + min-width: 50px; +} +.ui-grid-pager-count-container .ui-grid-pager-count { + margin-right: 10px; + margin-left: 10px; + float: right; +} +.ui-grid-pager-count-container .ui-grid-pager-count abbr { + border-bottom: none; + text-decoration: none; +} diff --git a/release/4.9.2/css/ui-grid.pagination.min.css b/release/4.9.2/css/ui-grid.pagination.min.css new file mode 100644 index 000000000..395aec988 --- /dev/null +++ b/release/4.9.2/css/ui-grid.pagination.min.css @@ -0,0 +1 @@ +.ui-grid-pager-panel{display:flex;justify-content:space-between;align-items:center;position:absolute;left:0;bottom:0;width:100%;padding-top:3px;padding-bottom:3px;box-sizing:content-box}.ui-grid-pager-container{float:left}.ui-grid-pager-control{padding:5px 0;display:flex;flex-flow:row nowrap;align-items:center;margin-right:10px;margin-left:10px;min-width:135px;float:left}.ui-grid-pager-control button,.ui-grid-pager-control span,.ui-grid-pager-control input{margin-right:4px}.ui-grid-pager-control button{height:25px;min-width:26px;display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;background:#f3f3f3;border:1px solid #ccc;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#eee}.ui-grid-pager-control button:hover{border-color:#adadad;text-decoration:none}.ui-grid-pager-control button:focus{border-color:#8c8c8c;text-decoration:none;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ui-grid-pager-control button:active{border-color:#adadad;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.ui-grid-pager-control button:active:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ui-grid-pager-control button:active:hover,.ui-grid-pager-control button:active:focus{background-color:#c8c8c8;border-color:#8c8c8c}.ui-grid-pager-control button:hover,.ui-grid-pager-control button:focus,.ui-grid-pager-control button:active{color:#eee;background:#dadada}.ui-grid-pager-control button[disabled]{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.ui-grid-pager-control button[disabled]:hover,.ui-grid-pager-control button[disabled]:focus{background-color:#f3f3f3;border-color:#ccc}.ui-grid-pager-control input{display:inline;height:26px;width:50px;vertical-align:top;color:#555555;background:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.ui-grid-pager-control input:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.ui-grid-pager-control input[disabled],.ui-grid-pager-control input[readonly],.ui-grid-pager-control input::-moz-placeholder{opacity:1}.ui-grid-pager-control input::-moz-placeholder,.ui-grid-pager-control input:-ms-input-placeholder,.ui-grid-pager-control input::-webkit-input-placeholder{color:#999}.ui-grid-pager-control input::-ms-expand{border:0;background-color:transparent}.ui-grid-pager-control input[disabled],.ui-grid-pager-control input[readonly]{background-color:#eeeeee}.ui-grid-pager-control input[disabled]{cursor:not-allowed}.ui-grid-pager-control .ui-grid-pager-max-pages-number{vertical-align:bottom}.ui-grid-pager-control .ui-grid-pager-max-pages-number>*{vertical-align:bottom}.ui-grid-pager-control .ui-grid-pager-max-pages-number abbr{border-bottom:none;text-decoration:none}.ui-grid-pager-control .first-bar{width:10px;border-left:2px solid #4d4d4d;margin-top:-6px;height:12px;margin-left:-3px}.ui-grid-pager-control .first-bar-rtl{width:10px;border-left:2px solid #4d4d4d;margin-top:-6px;height:12px;margin-right:-7px}.ui-grid-pager-control .first-triangle{width:0;height:0;border-style:solid;border-width:5px 8.7px 5px 0;border-color:transparent #4d4d4d transparent transparent;margin-left:2px}.ui-grid-pager-control .next-triangle{margin-left:1px}.ui-grid-pager-control .prev-triangle{margin-left:0}.ui-grid-pager-control .last-triangle{width:0;height:0;border-style:solid;border-width:5px 0 5px 8.7px;border-color:transparent transparent transparent #4d4d4d;margin-left:-1px}.ui-grid-pager-control .last-bar{width:10px;border-left:2px solid #4d4d4d;margin-top:-6px;height:12px;margin-left:1px}.ui-grid-pager-control .last-bar-rtl{width:10px;border-left:2px solid #4d4d4d;margin-top:-6px;height:12px;margin-right:-11px}.ui-grid-pager-row-count-picker{float:left;padding:5px 10px}.ui-grid-pager-row-count-picker select{color:#555555;background:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px;height:25px;width:67px;display:inline;vertical-align:middle}.ui-grid-pager-row-count-picker select:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.ui-grid-pager-row-count-picker select[disabled],.ui-grid-pager-row-count-picker select[readonly],.ui-grid-pager-row-count-picker select::-moz-placeholder{opacity:1}.ui-grid-pager-row-count-picker select::-moz-placeholder,.ui-grid-pager-row-count-picker select:-ms-input-placeholder,.ui-grid-pager-row-count-picker select::-webkit-input-placeholder{color:#999}.ui-grid-pager-row-count-picker select::-ms-expand{border:0;background-color:transparent}.ui-grid-pager-row-count-picker select[disabled],.ui-grid-pager-row-count-picker select[readonly]{background-color:#eeeeee}.ui-grid-pager-row-count-picker select[disabled]{cursor:not-allowed}.ui-grid-pager-row-count-picker .ui-grid-pager-row-count-label{margin-top:3px}.ui-grid-pager-count-container{float:right;margin-top:4px;min-width:50px}.ui-grid-pager-count-container .ui-grid-pager-count{margin-right:10px;margin-left:10px;float:right}.ui-grid-pager-count-container .ui-grid-pager-count abbr{border-bottom:none;text-decoration:none} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.pinning.css b/release/4.9.2/css/ui-grid.pinning.css new file mode 100644 index 000000000..9c5eb1ae1 --- /dev/null +++ b/release/4.9.2/css/ui-grid.pinning.css @@ -0,0 +1,67 @@ +.ui-grid-pinned-container { + position: absolute; + display: inline; + top: 0; +} +.ui-grid-pinned-container.ui-grid-pinned-container-left { + float: left; + left: 0; +} +.ui-grid-pinned-container.ui-grid-pinned-container-right { + float: right; + right: 0; +} +.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:last-child { + box-sizing: border-box; + border-right: 1px solid; + border-width: 1px; + border-right-color: #aeaeae; +} +.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-cell:last-child { + box-sizing: border-box; + border-right: 1px solid; + border-width: 1px; + border-right-color: #aeaeae; +} +.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar, +.ui-grid-pinned-container .ui-grid-cell:not(:last-child) .ui-grid-vertical-bar { + width: 1px; +} +.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar { + background-color: #d4d4d4; +} +.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-cell:not(:last-child) .ui-grid-vertical-bar { + background-color: #aeaeae; +} +.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:last-child .ui-grid-vertical-bar { + right: -1px; + width: 1px; + background-color: #aeaeae; +} +.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-header-cell:first-child { + box-sizing: border-box; + border-left: 1px solid; + border-width: 1px; + border-left-color: #aeaeae; +} +.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-cell:first-child { + box-sizing: border-box; + border-left: 1px solid; + border-width: 1px; + border-left-color: #aeaeae; +} +.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-header-cell:not(:first-child) .ui-grid-vertical-bar, +.ui-grid-pinned-container .ui-grid-cell:not(:first-child) .ui-grid-vertical-bar { + width: 1px; +} +.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-header-cell:not(:first-child) .ui-grid-vertical-bar { + background-color: #d4d4d4; +} +.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-cell:not(:last-child) .ui-grid-vertical-bar { + background-color: #aeaeae; +} +.ui-grid-pinned-container.ui-grid-pinned-container-first .ui-grid-header-cell:first-child .ui-grid-vertical-bar { + left: -1px; + width: 1px; + background-color: #aeaeae; +} diff --git a/release/4.9.2/css/ui-grid.pinning.min.css b/release/4.9.2/css/ui-grid.pinning.min.css new file mode 100644 index 000000000..7068b8340 --- /dev/null +++ b/release/4.9.2/css/ui-grid.pinning.min.css @@ -0,0 +1 @@ +.ui-grid-pinned-container{position:absolute;display:inline;top:0}.ui-grid-pinned-container.ui-grid-pinned-container-left{float:left;left:0}.ui-grid-pinned-container.ui-grid-pinned-container-right{float:right;right:0}.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:last-child{box-sizing:border-box;border-right:1px solid;border-width:1px;border-right-color:#aeaeae}.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-cell:last-child{box-sizing:border-box;border-right:1px solid;border-width:1px;border-right-color:#aeaeae}.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar,.ui-grid-pinned-container .ui-grid-cell:not(:last-child) .ui-grid-vertical-bar{width:1px}.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar{background-color:#d4d4d4}.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-cell:not(:last-child) .ui-grid-vertical-bar{background-color:#aeaeae}.ui-grid-pinned-container.ui-grid-pinned-container-left .ui-grid-header-cell:last-child .ui-grid-vertical-bar{right:-1px;width:1px;background-color:#aeaeae}.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-header-cell:first-child{box-sizing:border-box;border-left:1px solid;border-width:1px;border-left-color:#aeaeae}.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-cell:first-child{box-sizing:border-box;border-left:1px solid;border-width:1px;border-left-color:#aeaeae}.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-header-cell:not(:first-child) .ui-grid-vertical-bar,.ui-grid-pinned-container .ui-grid-cell:not(:first-child) .ui-grid-vertical-bar{width:1px}.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-header-cell:not(:first-child) .ui-grid-vertical-bar{background-color:#d4d4d4}.ui-grid-pinned-container.ui-grid-pinned-container-right .ui-grid-cell:not(:last-child) .ui-grid-vertical-bar{background-color:#aeaeae}.ui-grid-pinned-container.ui-grid-pinned-container-first .ui-grid-header-cell:first-child .ui-grid-vertical-bar{left:-1px;width:1px;background-color:#aeaeae} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.resize-columns.css b/release/4.9.2/css/ui-grid.resize-columns.css new file mode 100644 index 000000000..100d05e43 --- /dev/null +++ b/release/4.9.2/css/ui-grid.resize-columns.css @@ -0,0 +1,38 @@ +.ui-grid-column-resizer { + top: 0; + bottom: 0; + width: 5px; + position: absolute; + cursor: col-resize; +} +.ui-grid-column-resizer.left { + left: 0; +} +.ui-grid-column-resizer.right { + right: 0; +} +.ui-grid-header-cell:last-child .ui-grid-column-resizer.right { + border-right: 1px solid #d4d4d4; +} +.ui-grid[dir=rtl] .ui-grid-header-cell:last-child .ui-grid-column-resizer.right { + border-right: 0; +} +.ui-grid[dir=rtl] .ui-grid-header-cell:last-child .ui-grid-column-resizer.left { + border-left: 1px solid #d4d4d4; +} +.ui-grid.column-resizing { + cursor: col-resize; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ui-grid.column-resizing .ui-grid-resize-overlay { + position: absolute; + top: 0; + height: 100%; + width: 1px; + background-color: #aeaeae; +} diff --git a/release/4.9.2/css/ui-grid.resize-columns.min.css b/release/4.9.2/css/ui-grid.resize-columns.min.css new file mode 100644 index 000000000..0915bee16 --- /dev/null +++ b/release/4.9.2/css/ui-grid.resize-columns.min.css @@ -0,0 +1 @@ +.ui-grid-column-resizer{top:0;bottom:0;width:5px;position:absolute;cursor:col-resize}.ui-grid-column-resizer.left{left:0}.ui-grid-column-resizer.right{right:0}.ui-grid-header-cell:last-child .ui-grid-column-resizer.right{border-right:1px solid #d4d4d4}.ui-grid[dir=rtl] .ui-grid-header-cell:last-child .ui-grid-column-resizer.right{border-right:0}.ui-grid[dir=rtl] .ui-grid-header-cell:last-child .ui-grid-column-resizer.left{border-left:1px solid #d4d4d4}.ui-grid.column-resizing{cursor:col-resize;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui-grid.column-resizing .ui-grid-resize-overlay{position:absolute;top:0;height:100%;width:1px;background-color:#aeaeae} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.row-edit.css b/release/4.9.2/css/ui-grid.row-edit.css new file mode 100644 index 000000000..741c68b30 --- /dev/null +++ b/release/4.9.2/css/ui-grid.row-edit.css @@ -0,0 +1,9 @@ +.ui-grid-row-saving .ui-grid-cell { + color: #848484 !important; +} +.ui-grid-row-dirty .ui-grid-cell { + color: #610B38; +} +.ui-grid-row-error .ui-grid-cell { + color: #FF0000 !important; +} diff --git a/release/4.9.2/css/ui-grid.row-edit.min.css b/release/4.9.2/css/ui-grid.row-edit.min.css new file mode 100644 index 000000000..362195a02 --- /dev/null +++ b/release/4.9.2/css/ui-grid.row-edit.min.css @@ -0,0 +1 @@ +.ui-grid-row-saving .ui-grid-cell{color:#848484 !important}.ui-grid-row-dirty .ui-grid-cell{color:#610B38}.ui-grid-row-error .ui-grid-cell{color:#FF0000 !important} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.selection.css b/release/4.9.2/css/ui-grid.selection.css new file mode 100644 index 000000000..8267ac9af --- /dev/null +++ b/release/4.9.2/css/ui-grid.selection.css @@ -0,0 +1,25 @@ +.ui-grid-row.ui-grid-row-selected > [ui-grid-row] > .ui-grid-cell { + background-color: #C9DDE1; +} +.ui-grid-disable-selection { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: default; +} +.ui-grid-selection-row-header-buttons { + display: flex; + align-items: center; + height: 100%; + cursor: pointer; +} +.ui-grid-selection-row-header-buttons::before { + opacity: 0.1; +} +.ui-grid-selection-row-header-buttons.ui-grid-row-selected::before, +.ui-grid-selection-row-header-buttons.ui-grid-all-selected::before { + opacity: 1; +} diff --git a/release/4.9.2/css/ui-grid.selection.min.css b/release/4.9.2/css/ui-grid.selection.min.css new file mode 100644 index 000000000..300e60f28 --- /dev/null +++ b/release/4.9.2/css/ui-grid.selection.min.css @@ -0,0 +1 @@ +.ui-grid-row.ui-grid-row-selected>[ui-grid-row]>.ui-grid-cell{background-color:#C9DDE1}.ui-grid-disable-selection{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.ui-grid-selection-row-header-buttons{display:flex;align-items:center;height:100%;cursor:pointer}.ui-grid-selection-row-header-buttons::before{opacity:.1}.ui-grid-selection-row-header-buttons.ui-grid-row-selected::before,.ui-grid-selection-row-header-buttons.ui-grid-all-selected::before{opacity:1} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.tree-base.css b/release/4.9.2/css/ui-grid.tree-base.css new file mode 100644 index 000000000..3431ca558 --- /dev/null +++ b/release/4.9.2/css/ui-grid.tree-base.css @@ -0,0 +1,4 @@ +.ui-grid-tree-row-header-buttons.ui-grid-tree-header { + cursor: pointer; + opacity: 1; +} diff --git a/release/4.9.2/css/ui-grid.tree-base.min.css b/release/4.9.2/css/ui-grid.tree-base.min.css new file mode 100644 index 000000000..968a06a91 --- /dev/null +++ b/release/4.9.2/css/ui-grid.tree-base.min.css @@ -0,0 +1 @@ +.ui-grid-tree-row-header-buttons.ui-grid-tree-header{cursor:pointer;opacity:1} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.tree-view.css b/release/4.9.2/css/ui-grid.tree-view.css new file mode 100644 index 000000000..6dfeb52b7 --- /dev/null +++ b/release/4.9.2/css/ui-grid.tree-view.css @@ -0,0 +1,6 @@ +.ui-grid-tree-header-row { + font-weight: bold !important; +} +.ui-grid-tree-header-row .ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell { + pointer-events: all; +} diff --git a/release/4.9.2/css/ui-grid.tree-view.min.css b/release/4.9.2/css/ui-grid.tree-view.min.css new file mode 100644 index 000000000..c2f4b5de9 --- /dev/null +++ b/release/4.9.2/css/ui-grid.tree-view.min.css @@ -0,0 +1 @@ +.ui-grid-tree-header-row{font-weight:bold !important}.ui-grid-tree-header-row .ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell{pointer-events:all} \ No newline at end of file diff --git a/release/4.9.2/css/ui-grid.validate.css b/release/4.9.2/css/ui-grid.validate.css new file mode 100644 index 000000000..622b0f6e8 --- /dev/null +++ b/release/4.9.2/css/ui-grid.validate.css @@ -0,0 +1,3 @@ +.ui-grid-cell-contents.invalid { + border: 1px solid #fc8f8f; +} diff --git a/release/4.9.2/css/ui-grid.validate.min.css b/release/4.9.2/css/ui-grid.validate.min.css new file mode 100644 index 000000000..4030e751d --- /dev/null +++ b/release/4.9.2/css/ui-grid.validate.min.css @@ -0,0 +1 @@ +.ui-grid-cell-contents.invalid{border:1px solid #fc8f8f} \ No newline at end of file diff --git a/release/4.9.2/fonts/ui-grid.eot b/release/4.9.2/fonts/ui-grid.eot new file mode 100644 index 000000000..59cf0aed2 Binary files /dev/null and b/release/4.9.2/fonts/ui-grid.eot differ diff --git a/release/4.9.2/fonts/ui-grid.svg b/release/4.9.2/fonts/ui-grid.svg new file mode 100644 index 000000000..9d2e03c0e --- /dev/null +++ b/release/4.9.2/fonts/ui-grid.svg @@ -0,0 +1,56 @@ + + + \ No newline at end of file diff --git a/release/4.9.2/fonts/ui-grid.ttf b/release/4.9.2/fonts/ui-grid.ttf new file mode 100644 index 000000000..b1a4b0611 Binary files /dev/null and b/release/4.9.2/fonts/ui-grid.ttf differ diff --git a/release/4.9.2/fonts/ui-grid.woff b/release/4.9.2/fonts/ui-grid.woff new file mode 100644 index 000000000..426c61150 Binary files /dev/null and b/release/4.9.2/fonts/ui-grid.woff differ diff --git a/release/4.9.2/i18n/ui-grid.auto-resize.js b/release/4.9.2/i18n/ui-grid.auto-resize.js new file mode 100644 index 000000000..33f3f9d70 --- /dev/null +++ b/release/4.9.2/i18n/ui-grid.auto-resize.js @@ -0,0 +1,68 @@ +/*! + * ui-grid - v4.9.2 - 2020-12-01 + * Copyright (c) 2020 ; License: MIT + */ + +(function() { + 'use strict'; + /** + * @ngdoc overview + * @name ui.grid.autoResize + * + * @description + * + * #ui.grid.autoResize + * + *Beta This feature is ready for testing, but it either hasn't seen a lot of use or has some known bugs.
+ *
+ * This module provides auto-resizing functionality to UI-Grid.
+ */
+ var module = angular.module('ui.grid.autoResize', ['ui.grid']);
+
+ /**
+ * @ngdoc directive
+ * @name ui.grid.autoResize.directive:uiGridAutoResize
+ * @element div
+ * @restrict A
+ *
+ * @description Stacks on top of the ui-grid directive and
+ * adds the a watch to the grid's height and width which refreshes
+ * the grid content whenever its dimensions change.
+ *
+ */
+ module.directive('uiGridAutoResize', ['gridUtil', function(gridUtil) {
+ return {
+ require: 'uiGrid',
+ scope: false,
+ link: function($scope, $elm, $attrs, uiGridCtrl) {
+ var debouncedRefresh;
+
+ function getDimensions() {
+ return {
+ width: gridUtil.elementWidth($elm),
+ height: gridUtil.elementHeight($elm)
+ };
+ }
+
+ function refreshGrid(prevWidth, prevHeight, width, height) {
+ if ($elm[0].offsetParent !== null) {
+ uiGridCtrl.grid.gridWidth = width;
+ uiGridCtrl.grid.gridHeight = height;
+ uiGridCtrl.grid.queueGridRefresh()
+ .then(function() {
+ uiGridCtrl.grid.api.core.raise.gridDimensionChanged(prevHeight, prevWidth, height, width);
+ });
+ }
+ }
+
+ debouncedRefresh = gridUtil.debounce(refreshGrid, 400);
+
+ $scope.$watchCollection(getDimensions, function(newValues, oldValues) {
+ if (!angular.equals(newValues, oldValues)) {
+ debouncedRefresh(oldValues.width, oldValues.height, newValues.width, newValues.height);
+ }
+ });
+ }
+ };
+ }]);
+})();
diff --git a/release/4.9.2/i18n/ui-grid.auto-resize.min.js b/release/4.9.2/i18n/ui-grid.auto-resize.min.js
new file mode 100644
index 000000000..a7cdd99b5
--- /dev/null
+++ b/release/4.9.2/i18n/ui-grid.auto-resize.min.js
@@ -0,0 +1,7 @@
+/*!
+ * ui-grid - v4.9.2 - 2020-12-01
+ * Copyright (c) 2020 ; License: MIT
+ */
+
+
+!function(){"use strict";angular.module("ui.grid.autoResize",["ui.grid"]).directive("uiGridAutoResize",["gridUtil",function(n){return{require:"uiGrid",scope:!1,link:function(i,r,e,u){var t;t=n.debounce(function(i,e,t,n){null!==r[0].offsetParent&&(u.grid.gridWidth=t,u.grid.gridHeight=n,u.grid.queueGridRefresh().then(function(){u.grid.api.core.raise.gridDimensionChanged(e,i,n,t)}))},400),i.$watchCollection(function(){return{width:n.elementWidth(r),height:n.elementHeight(r)}},function(i,e){angular.equals(i,e)||t(e.width,e.height,i.width,i.height)})}}}])}();
\ No newline at end of file
diff --git a/release/4.9.2/i18n/ui-grid.cellnav.js b/release/4.9.2/i18n/ui-grid.cellnav.js
new file mode 100644
index 000000000..e803b72df
--- /dev/null
+++ b/release/4.9.2/i18n/ui-grid.cellnav.js
@@ -0,0 +1,1181 @@
+/*!
+ * ui-grid - v4.9.2 - 2020-12-01
+ * Copyright (c) 2020 ; License: MIT
+ */
+
+(function () {
+ 'use strict';
+
+ /**
+ * @ngdoc overview
+ * @name ui.grid.cellNav
+ *
+ * @description
+
+ #ui.grid.cellNav
+
+ Stable This feature is stable. There should no longer be breaking api changes without a deprecation warning.
+
+ This module provides cell navigation functionality to UI-Grid.
+ */
+ var module = angular.module('ui.grid.cellNav', ['ui.grid']);
+
+ /**
+ * @ngdoc object
+ * @name ui.grid.cellNav.constant:uiGridCellNavConstants
+ *
+ * @description constants available in cellNav
+ */
+ module.constant('uiGridCellNavConstants', {
+ FEATURE_NAME: 'gridCellNav',
+ CELL_NAV_EVENT: 'cellNav',
+ direction: {LEFT: 0, RIGHT: 1, UP: 2, DOWN: 3, PG_UP: 4, PG_DOWN: 5},
+ EVENT_TYPE: {
+ KEYDOWN: 0,
+ CLICK: 1,
+ CLEAR: 2
+ }
+ });
+
+
+ module.factory('uiGridCellNavFactory', ['gridUtil', 'uiGridConstants', 'uiGridCellNavConstants', 'GridRowColumn', '$q',
+ function (gridUtil, uiGridConstants, uiGridCellNavConstants, GridRowColumn, $q) {
+ /**
+ * @ngdoc object
+ * @name ui.grid.cellNav.object:CellNav
+ * @description returns a CellNav prototype function
+ * @param {object} rowContainer container for rows
+ * @param {object} colContainer parent column container
+ * @param {object} leftColContainer column container to the left of parent
+ * @param {object} rightColContainer column container to the right of parent
+ */
+ var UiGridCellNav = function UiGridCellNav(rowContainer, colContainer, leftColContainer, rightColContainer) {
+ this.rows = rowContainer.visibleRowCache;
+ this.columns = colContainer.visibleColumnCache;
+ this.leftColumns = leftColContainer ? leftColContainer.visibleColumnCache : [];
+ this.rightColumns = rightColContainer ? rightColContainer.visibleColumnCache : [];
+ this.bodyContainer = rowContainer;
+ };
+
+ /** returns focusable columns of all containers */
+ UiGridCellNav.prototype.getFocusableCols = function () {
+ var allColumns = this.leftColumns.concat(this.columns, this.rightColumns);
+
+ return allColumns.filter(function (col) {
+ return col.colDef.allowCellFocus;
+ });
+ };
+
+ /**
+ * @ngdoc object
+ * @name ui.grid.cellNav.api:GridRow
+ *
+ * @description GridRow settings for cellNav feature, these are available to be
+ * set only internally (for example, by other features)
+ */
+
+ /**
+ * @ngdoc object
+ * @name allowCellFocus
+ * @propertyOf ui.grid.cellNav.api:GridRow
+ * @description Enable focus on a cell within this row. If set to false then no cells
+ * in this row can be focused - group header rows as an example would set this to false.
+ * Defaults to true + */ + /** returns focusable rows */ + UiGridCellNav.prototype.getFocusableRows = function () { + return this.rows.filter(function(row) { + return row.allowCellFocus !== false; + }); + }; + + UiGridCellNav.prototype.getNextRowCol = function (direction, curRow, curCol) { + switch (direction) { + case uiGridCellNavConstants.direction.LEFT: + return this.getRowColLeft(curRow, curCol); + case uiGridCellNavConstants.direction.RIGHT: + return this.getRowColRight(curRow, curCol); + case uiGridCellNavConstants.direction.UP: + return this.getRowColUp(curRow, curCol); + case uiGridCellNavConstants.direction.DOWN: + return this.getRowColDown(curRow, curCol); + case uiGridCellNavConstants.direction.PG_UP: + return this.getRowColPageUp(curRow, curCol); + case uiGridCellNavConstants.direction.PG_DOWN: + return this.getRowColPageDown(curRow, curCol); + } + }; + + UiGridCellNav.prototype.initializeSelection = function () { + var focusableCols = this.getFocusableCols(); + var focusableRows = this.getFocusableRows(); + if (focusableCols.length === 0 || focusableRows.length === 0) { + return null; + } + + return new GridRowColumn(focusableRows[0], focusableCols[0]); // return same row + }; + + UiGridCellNav.prototype.getRowColLeft = function (curRow, curCol) { + var focusableCols = this.getFocusableCols(); + var focusableRows = this.getFocusableRows(); + var curColIndex = focusableCols.indexOf(curCol); + var curRowIndex = focusableRows.indexOf(curRow); + + // could not find column in focusable Columns so set it to 1 + if (curColIndex === -1) { + curColIndex = 1; + } + + var nextColIndex = curColIndex === 0 ? focusableCols.length - 1 : curColIndex - 1; + + // get column to left + if (nextColIndex >= curColIndex) { + // On the first row + // if (curRowIndex === 0 && curColIndex === 0) { + // return null; + // } + if (curRowIndex === 0) { + return new GridRowColumn(curRow, focusableCols[nextColIndex]); // return same row + } + else { + // up one row and far right column + return new GridRowColumn(focusableRows[curRowIndex - 1], focusableCols[nextColIndex]); + } + } + else { + return new GridRowColumn(curRow, focusableCols[nextColIndex]); + } + }; + + + + UiGridCellNav.prototype.getRowColRight = function (curRow, curCol) { + var focusableCols = this.getFocusableCols(); + var focusableRows = this.getFocusableRows(); + var curColIndex = focusableCols.indexOf(curCol); + var curRowIndex = focusableRows.indexOf(curRow); + + // could not find column in focusable Columns so set it to 0 + if (curColIndex === -1) { + curColIndex = 0; + } + var nextColIndex = curColIndex === focusableCols.length - 1 ? 0 : curColIndex + 1; + + if (nextColIndex <= curColIndex) { + if (curRowIndex === focusableRows.length - 1) { + return new GridRowColumn(curRow, focusableCols[nextColIndex]); // return same row + } + else { + // down one row and far left column + return new GridRowColumn(focusableRows[curRowIndex + 1], focusableCols[nextColIndex]); + } + } + else { + return new GridRowColumn(curRow, focusableCols[nextColIndex]); + } + }; + + UiGridCellNav.prototype.getRowColDown = function (curRow, curCol) { + var focusableCols = this.getFocusableCols(); + var focusableRows = this.getFocusableRows(); + var curColIndex = focusableCols.indexOf(curCol); + var curRowIndex = focusableRows.indexOf(curRow); + + // could not find column in focusable Columns so set it to 0 + if (curColIndex === -1) { + curColIndex = 0; + } + + if (curRowIndex === focusableRows.length - 1) { + return new GridRowColumn(curRow, focusableCols[curColIndex]); // return same row + } + else { + // down one row + return new GridRowColumn(focusableRows[curRowIndex + 1], focusableCols[curColIndex]); + } + }; + + UiGridCellNav.prototype.getRowColPageDown = function (curRow, curCol) { + var focusableCols = this.getFocusableCols(); + var focusableRows = this.getFocusableRows(); + var curColIndex = focusableCols.indexOf(curCol); + var curRowIndex = focusableRows.indexOf(curRow); + + // could not find column in focusable Columns so set it to 0 + if (curColIndex === -1) { + curColIndex = 0; + } + + var pageSize = this.bodyContainer.minRowsToRender(); + if (curRowIndex >= focusableRows.length - pageSize) { + return new GridRowColumn(focusableRows[focusableRows.length - 1], focusableCols[curColIndex]); // return last row + } + else { + // down one page + return new GridRowColumn(focusableRows[curRowIndex + pageSize], focusableCols[curColIndex]); + } + }; + + UiGridCellNav.prototype.getRowColUp = function (curRow, curCol) { + var focusableCols = this.getFocusableCols(); + var focusableRows = this.getFocusableRows(); + var curColIndex = focusableCols.indexOf(curCol); + var curRowIndex = focusableRows.indexOf(curRow); + + // could not find column in focusable Columns so set it to 0 + if (curColIndex === -1) { + curColIndex = 0; + } + + if (curRowIndex === 0) { + return new GridRowColumn(curRow, focusableCols[curColIndex]); // return same row + } + else { + // up one row + return new GridRowColumn(focusableRows[curRowIndex - 1], focusableCols[curColIndex]); + } + }; + + UiGridCellNav.prototype.getRowColPageUp = function (curRow, curCol) { + var focusableCols = this.getFocusableCols(); + var focusableRows = this.getFocusableRows(); + var curColIndex = focusableCols.indexOf(curCol); + var curRowIndex = focusableRows.indexOf(curRow); + + // could not find column in focusable Columns so set it to 0 + if (curColIndex === -1) { + curColIndex = 0; + } + + var pageSize = this.bodyContainer.minRowsToRender(); + if (curRowIndex - pageSize < 0) { + return new GridRowColumn(focusableRows[0], focusableCols[curColIndex]); // return first row + } + else { + // up one page + return new GridRowColumn(focusableRows[curRowIndex - pageSize], focusableCols[curColIndex]); + } + }; + return UiGridCellNav; + }]); + + /** + * @ngdoc service + * @name ui.grid.cellNav.service:uiGridCellNavService + * + * @description Services for cell navigation features. If you don't like the key maps we use, + * or the direction cells navigation, override with a service decorator (see angular docs) + */ + module.service('uiGridCellNavService', ['gridUtil', 'uiGridConstants', 'uiGridCellNavConstants', '$q', 'uiGridCellNavFactory', 'GridRowColumn', 'ScrollEvent', + function (gridUtil, uiGridConstants, uiGridCellNavConstants, $q, UiGridCellNav, GridRowColumn, ScrollEvent) { + + var service = { + + initializeGrid: function (grid) { + grid.registerColumnBuilder(service.cellNavColumnBuilder); + + + /** + * @ngdoc object + * @name ui.grid.cellNav.Grid:cellNav + * @description cellNav properties added to grid class + */ + grid.cellNav = {}; + grid.cellNav.lastRowCol = null; + grid.cellNav.focusedCells = []; + + service.defaultGridOptions(grid.options); + + /** + * @ngdoc object + * @name ui.grid.cellNav.api:PublicApi + * + * @description Public Api for cellNav feature + */ + var publicApi = { + events: { + cellNav: { + /** + * @ngdoc event + * @name navigate + * @eventOf ui.grid.cellNav.api:PublicApi + * @description raised when the active cell is changed + * + * gridApi.cellNav.on.navigate(scope,function(newRowcol, oldRowCol) {}) + *+ * @param {object} newRowCol new position + * @param {object} oldRowCol old position + */ + navigate: function (newRowCol, oldRowCol) {}, + /** + * @ngdoc event + * @name viewPortKeyDown + * @eventOf ui.grid.cellNav.api:PublicApi + * @description is raised when the viewPort receives a keyDown event. Cells never get focus in uiGrid + * due to the difficulties of setting focus on a cell that is not visible in the viewport. Use this + * event whenever you need a keydown event on a cell + * + * @param {object} event keydown event + * @param {object} rowCol current rowCol position + */ + viewPortKeyDown: function (event, rowCol) {}, + + /** + * @ngdoc event + * @name viewPortKeyPress + * @eventOf ui.grid.cellNav.api:PublicApi + * @description is raised when the viewPort receives a keyPress event. Cells never get focus in uiGrid + * due to the difficulties of setting focus on a cell that is not visible in the viewport. Use this + * event whenever you need a keypress event on a cell + * + * @param {object} event keypress event + * @param {object} rowCol current rowCol position + */ + viewPortKeyPress: function (event, rowCol) {} + } + }, + methods: { + cellNav: { + /** + * @ngdoc function + * @name scrollToFocus + * @methodOf ui.grid.cellNav.api:PublicApi + * @description brings the specified row and column into view, and sets focus + * to that cell + * @param {object} rowEntity gridOptions.data[] array instance to make visible and set focus + * @param {object} colDef to make visible and set focus + * @returns {promise} a promise that is resolved after any scrolling is finished + */ + scrollToFocus: function (rowEntity, colDef) { + return service.scrollToFocus(grid, rowEntity, colDef); + }, + + /** + * @ngdoc function + * @name getFocusedCell + * @methodOf ui.grid.cellNav.api:PublicApi + * @description returns the current (or last if Grid does not have focus) focused row and column + * value is null if no selection has occurred + */ + getFocusedCell: function () { + return grid.cellNav.lastRowCol; + }, + + /** + * @ngdoc function + * @name getCurrentSelection + * @methodOf ui.grid.cellNav.api:PublicApi + * @description returns an array containing the current selection + * array is empty if no selection has occurred + */ + getCurrentSelection: function () { + return grid.cellNav.focusedCells; + }, + + /** + * @ngdoc function + * @name rowColSelectIndex + * @methodOf ui.grid.cellNav.api:PublicApi + * @description returns the index in the order in which the GridRowColumn was selected, returns -1 if the GridRowColumn + * isn't selected + * @param {object} rowCol the rowCol to evaluate + */ + rowColSelectIndex: function (rowCol) { + // return gridUtil.arrayContainsObjectWithProperty(grid.cellNav.focusedCells, 'col.uid', rowCol.col.uid) && + var index = -1; + for (var i = 0; i < grid.cellNav.focusedCells.length; i++) { + if (grid.cellNav.focusedCells[i].col.uid === rowCol.col.uid && + grid.cellNav.focusedCells[i].row.uid === rowCol.row.uid) { + index = i; + break; + } + } + return index; + } + } + } + }; + + grid.api.registerEventsFromObject(publicApi.events); + + grid.api.registerMethodsFromObject(publicApi.methods); + }, + + defaultGridOptions: function (gridOptions) { + /** + * @ngdoc object + * @name ui.grid.cellNav.api:GridOptions + * + * @description GridOptions for cellNav feature, these are available to be + * set using the ui-grid {@link ui.grid.class:GridOptions gridOptions} + */ + + /** + * @ngdoc object + * @name modifierKeysToMultiSelectCells + * @propertyOf ui.grid.cellNav.api:GridOptions + * @description Enable multiple cell selection only when using the ctrlKey or shiftKey. + * Defaults to false + */ + gridOptions.modifierKeysToMultiSelectCells = gridOptions.modifierKeysToMultiSelectCells === true; + + /** + * @ngdoc array + * @name keyDownOverrides + * @propertyOf ui.grid.cellNav.api:GridOptions + * @description An array of event objects to override on keydown. If an event is overridden, the viewPortKeyDown event will + * be raised with the overridden events, allowing custom keydown behavior. + * Defaults to [] + */ + gridOptions.keyDownOverrides = gridOptions.keyDownOverrides || []; + + }, + + /** + * @ngdoc service + * @name decorateRenderContainers + * @methodOf ui.grid.cellNav.service:uiGridCellNavService + * @description decorates grid renderContainers with cellNav functions + */ + decorateRenderContainers: function (grid) { + + var rightContainer = grid.hasRightContainer() ? grid.renderContainers.right : null; + var leftContainer = grid.hasLeftContainer() ? grid.renderContainers.left : null; + + if (leftContainer !== null) { + grid.renderContainers.left.cellNav = new UiGridCellNav(grid.renderContainers.body, leftContainer, rightContainer, grid.renderContainers.body); + } + if (rightContainer !== null) { + grid.renderContainers.right.cellNav = new UiGridCellNav(grid.renderContainers.body, rightContainer, grid.renderContainers.body, leftContainer); + } + + grid.renderContainers.body.cellNav = new UiGridCellNav(grid.renderContainers.body, grid.renderContainers.body, leftContainer, rightContainer); + }, + + /** + * @ngdoc service + * @name getDirection + * @methodOf ui.grid.cellNav.service:uiGridCellNavService + * @description determines which direction to for a given keyDown event + * @returns {uiGridCellNavConstants.direction} direction + */ + getDirection: function (evt) { + if (evt.keyCode === uiGridConstants.keymap.LEFT || + (evt.keyCode === uiGridConstants.keymap.TAB && evt.shiftKey)) { + return uiGridCellNavConstants.direction.LEFT; + } + if (evt.keyCode === uiGridConstants.keymap.RIGHT || + evt.keyCode === uiGridConstants.keymap.TAB) { + return uiGridCellNavConstants.direction.RIGHT; + } + + if (evt.keyCode === uiGridConstants.keymap.UP || + (evt.keyCode === uiGridConstants.keymap.ENTER && evt.shiftKey) ) { + return uiGridCellNavConstants.direction.UP; + } + + if (evt.keyCode === uiGridConstants.keymap.PG_UP) { + return uiGridCellNavConstants.direction.PG_UP; + } + + if (evt.keyCode === uiGridConstants.keymap.DOWN || + evt.keyCode === uiGridConstants.keymap.ENTER && !(evt.ctrlKey || evt.altKey)) { + return uiGridCellNavConstants.direction.DOWN; + } + + if (evt.keyCode === uiGridConstants.keymap.PG_DOWN) { + return uiGridCellNavConstants.direction.PG_DOWN; + } + + return null; + }, + + /** + * @ngdoc service + * @name cellNavColumnBuilder + * @methodOf ui.grid.cellNav.service:uiGridCellNavService + * @description columnBuilder function that adds cell navigation properties to grid column + * @returns {promise} promise that will load any needed templates when resolved + */ + cellNavColumnBuilder: function (colDef, col, gridOptions) { + var promises = []; + + /** + * @ngdoc object + * @name ui.grid.cellNav.api:ColumnDef + * + * @description Column Definitions for cellNav feature, these are available to be + * set using the ui-grid {@link ui.grid.class:GridOptions.columnDef gridOptions.columnDefs} + */ + + /** + * @ngdoc object + * @name allowCellFocus + * @propertyOf ui.grid.cellNav.api:ColumnDef + * @description Enable focus on a cell within this column. + * Defaults to true + */ + colDef.allowCellFocus = colDef.allowCellFocus === undefined ? true : colDef.allowCellFocus; + + return $q.all(promises); + }, + + /** + * @ngdoc method + * @methodOf ui.grid.cellNav.service:uiGridCellNavService + * @name scrollToFocus + * @description Scroll the grid such that the specified + * row and column is in view, and set focus to the cell in that row and column + * @param {Grid} grid the grid you'd like to act upon, usually available + * from gridApi.grid + * @param {object} rowEntity gridOptions.data[] array instance to make visible and set focus to + * @param {object} colDef to make visible and set focus to + * @returns {promise} a promise that is resolved after any scrolling is finished + */ + scrollToFocus: function (grid, rowEntity, colDef) { + var gridRow = null, gridCol = null; + + if (typeof(rowEntity) !== 'undefined' && rowEntity !== null) { + gridRow = grid.getRow(rowEntity); + } + + if (typeof(colDef) !== 'undefined' && colDef !== null) { + gridCol = grid.getColumn(colDef.name ? colDef.name : colDef.field); + } + return grid.api.core.scrollToIfNecessary(gridRow, gridCol).then(function () { + var rowCol = { row: gridRow, col: gridCol }; + + // Broadcast the navigation + if (gridRow !== null && gridCol !== null) { + grid.cellNav.broadcastCellNav(rowCol, null, null); + } + }); + }, + + + /** + * @ngdoc method + * @methodOf ui.grid.cellNav.service:uiGridCellNavService + * @name getLeftWidth + * @description Get the current drawn width of the columns in the + * grid up to the numbered column, and add an apportionment for the + * column that we're on. So if we are on column 0, we want to scroll + * 0% (i.e. exclude this column from calc). If we're on the last column + * we want to scroll to 100% (i.e. include this column in the calc). So + * we include (thisColIndex / totalNumberCols) % of this column width + * @param {Grid} grid the grid you'd like to act upon, usually available + * from gridApi.grid + * @param {GridColumn} upToCol the column to total up to and including + */ + getLeftWidth: function (grid, upToCol) { + var width = 0; + + if (!upToCol) { + return width; + } + + var lastIndex = grid.renderContainers.body.visibleColumnCache.indexOf( upToCol ); + + // total column widths up-to but not including the passed in column + grid.renderContainers.body.visibleColumnCache.forEach( function( col, index ) { + if ( index < lastIndex ) { + width += col.drawnWidth; + } + }); + + // pro-rata the final column based on % of total columns. + var percentage = lastIndex === 0 ? 0 : (lastIndex + 1) / grid.renderContainers.body.visibleColumnCache.length; + width += upToCol.drawnWidth * percentage; + + return width; + } + }; + + return service; + }]); + + /** + * @ngdoc directive + * @name ui.grid.cellNav.directive:uiCellNav + * @element div + * @restrict EA + * + * @description Adds cell navigation features to the grid columns + * + * @example +
+
+
+ ' +
+ ' ' +
+ ' ';
+
+ var ariaNotifier = $compile(ariaNotifierDomElt)($scope);
+ $elm.prepend(ariaNotifier);
+ $scope.$on(uiGridCellNavConstants.CELL_NAV_EVENT, function (evt, rowCol, modifierDown, originEvt) {
+ /*
+ * If the cell nav event was because of a focus event then we don't want to
+ * change the notifier text.
+ * Reasoning: Voice Over fires a focus events when moving arround the grid.
+ * If the screen reader is handing the grid nav properly then we don't need to
+ * use the alert to notify the user of the movement.
+ * In all other cases we do want a notification event.
+ */
+ if (originEvt && originEvt.type === 'focus') {return;}
+
+ function setNotifyText(text) {
+ if (text === ariaNotifier.text().trim()) {return;}
+ ariaNotifier[0].style.clip = 'rect(0px,0px,0px,0px)';
+ /*
+ * This is how google docs handles clearing the div. Seems to work better than setting the text of the div to ''
+ */
+ ariaNotifier[0].innerHTML = "";
+ ariaNotifier[0].style.visibility = 'hidden';
+ ariaNotifier[0].style.visibility = 'visible';
+ if (text !== '') {
+ ariaNotifier[0].style.clip = 'auto';
+ /*
+ * The space after the text is something that google docs does.
+ */
+ ariaNotifier[0].appendChild(document.createTextNode(text + " "));
+ ariaNotifier[0].style.visibility = 'hidden';
+ ariaNotifier[0].style.visibility = 'visible';
+ }
+ }
+
+ function getAppendedColumnHeaderText(col) {
+ return ', ' + i18nService.getSafeText('headerCell.aria.column') + ' ' + col.displayName;
+ }
+
+ function getCellDisplayValue(currentRowColumn) {
+ if (currentRowColumn.col.field === 'selectionRowHeaderCol') {
+ // This is the case when the 'selection' feature is used in the grid and the user has moved
+ // to or inside of the left grid container which holds the checkboxes for selecting rows.
+ // This is necessary for Accessibility. Without this a screen reader cannot determine if the row
+ // is or is not currently selected.
+ return currentRowColumn.row.isSelected ? i18nService.getSafeText('search.aria.selected') : i18nService.getSafeText('search.aria.notSelected');
+ } else {
+ return grid.getCellDisplayValue(currentRowColumn.row, currentRowColumn.col);
+ }
+ }
+
+ var values = [];
+ var currentSelection = grid.api.cellNav.getCurrentSelection();
+ for (var i = 0; i < currentSelection.length; i++) {
+ var cellDisplayValue = getCellDisplayValue(currentSelection[i]) + getAppendedColumnHeaderText(currentSelection[i].col);
+ values.push(cellDisplayValue);
+ }
+ var cellText = values.toString();
+ setNotifyText(cellText);
+
+ });
+ }
+ // Only add the ngAria stuff it will be used
+ if (usesAria) {
+ addAriaLiveRegion();
+ }
+ }
+ };
+ }
+ };
+ }]);
+
+ module.directive('uiGridRenderContainer', ['$timeout', '$document', 'gridUtil', 'uiGridConstants', 'uiGridCellNavService', '$compile','uiGridCellNavConstants',
+ function ($timeout, $document, gridUtil, uiGridConstants, uiGridCellNavService, $compile, uiGridCellNavConstants) {
+ return {
+ replace: true,
+ priority: -99999, // this needs to run very last
+ require: ['^uiGrid', 'uiGridRenderContainer', '?^uiGridCellnav'],
+ scope: false,
+ compile: function () {
+ return {
+ post: function ($scope, $elm, $attrs, controllers) {
+ var uiGridCtrl = controllers[0],
+ renderContainerCtrl = controllers[1],
+ uiGridCellnavCtrl = controllers[2];
+
+ // Skip attaching cell-nav specific logic if the directive is not attached above us
+ if (!uiGridCtrl.grid.api.cellNav) { return; }
+
+ var containerId = renderContainerCtrl.containerId;
+
+ var grid = uiGridCtrl.grid;
+
+ // run each time a render container is created
+ uiGridCellNavService.decorateRenderContainers(grid);
+
+ // focusser only created for body
+ if (containerId !== 'body') {
+ return;
+ }
+
+ if (uiGridCtrl.grid.options.modifierKeysToMultiSelectCells) {
+ $elm.attr('aria-multiselectable', true);
+ }
+ else {
+ $elm.attr('aria-multiselectable', false);
+ }
+
+ // add an element with no dimensions that can be used to set focus and capture keystrokes
+ var focuser = $compile('')($scope);
+ $elm.append(focuser);
+
+ focuser.on('focus', function (evt) {
+ evt.uiGridTargetRenderContainerId = containerId;
+ var rowCol = uiGridCtrl.grid.api.cellNav.getFocusedCell();
+ if (rowCol === null) {
+ rowCol = uiGridCtrl.grid.renderContainers[containerId].cellNav.getNextRowCol(uiGridCellNavConstants.direction.DOWN, null, null);
+ if (rowCol.row && rowCol.col) {
+ uiGridCtrl.cellNav.broadcastCellNav(rowCol);
+ }
+ }
+ });
+
+ uiGridCellnavCtrl.setAriaActivedescendant = function(id) {
+ $elm.attr('aria-activedescendant', id);
+ };
+
+ uiGridCellnavCtrl.removeAriaActivedescendant = function(id) {
+ if ($elm.attr('aria-activedescendant') === id) {
+ $elm.attr('aria-activedescendant', '');
+ }
+ };
+
+
+ uiGridCtrl.focus = function () {
+ gridUtil.focus.byElement(focuser[0]);
+ // allow for first time grid focus
+ };
+
+ var viewPortKeyDownWasRaisedForRowCol = null;
+ // Bind to keydown events in the render container
+ focuser.on('keydown', function (evt) {
+ evt.uiGridTargetRenderContainerId = containerId;
+ var rowCol = uiGridCtrl.grid.api.cellNav.getFocusedCell();
+ var raiseViewPortKeyDown = uiGridCtrl.grid.options.keyDownOverrides.some(function (override) {
+ return Object.keys(override).every( function (property) {
+ return override[property] === evt[property];
+ });
+ });
+ var result = raiseViewPortKeyDown ? null : uiGridCtrl.cellNav.handleKeyDown(evt);
+ if (result === null) {
+ uiGridCtrl.grid.api.cellNav.raise.viewPortKeyDown(evt, rowCol, uiGridCtrl.cellNav.handleKeyDown);
+ viewPortKeyDownWasRaisedForRowCol = rowCol;
+ }
+ });
+ // Bind to keypress events in the render container
+ // keypress events are needed by edit function so the key press
+ // that initiated an edit is not lost
+ // must fire the event in a timeout so the editor can
+ // initialize and subscribe to the event on another event loop
+ focuser.on('keypress', function (evt) {
+ if (viewPortKeyDownWasRaisedForRowCol) {
+ $timeout(function () {
+ uiGridCtrl.grid.api.cellNav.raise.viewPortKeyPress(evt, viewPortKeyDownWasRaisedForRowCol);
+ }, 4);
+
+ viewPortKeyDownWasRaisedForRowCol = null;
+ }
+ });
+
+ $scope.$on('$destroy', function() {
+ // Remove all event handlers associated with this focuser.
+ focuser.off();
+ });
+ }
+ };
+ }
+ };
+ }]);
+
+ module.directive('uiGridViewport',
+ function () {
+ return {
+ replace: true,
+ priority: -99999, // this needs to run very last
+ require: ['^uiGrid', '^uiGridRenderContainer', '?^uiGridCellnav'],
+ scope: false,
+ compile: function () {
+ return {
+ pre: function ($scope, $elm, $attrs, uiGridCtrl) {
+ },
+ post: function ($scope, $elm, $attrs, controllers) {
+ var uiGridCtrl = controllers[0],
+ renderContainerCtrl = controllers[1];
+
+ // Skip attaching cell-nav specific logic if the directive is not attached above us
+ if (!uiGridCtrl.grid.api.cellNav) { return; }
+
+ var containerId = renderContainerCtrl.containerId;
+ // no need to process for other containers
+ if (containerId !== 'body') {
+ return;
+ }
+
+ var grid = uiGridCtrl.grid;
+
+ grid.api.core.on.scrollBegin($scope, function () {
+
+ // Skip if there's no currently-focused cell
+ var lastRowCol = uiGridCtrl.grid.api.cellNav.getFocusedCell();
+ if (lastRowCol === null) {
+ return;
+ }
+
+ // if not in my container, move on
+ // todo: worry about horiz scroll
+ if (!renderContainerCtrl.colContainer.containsColumn(lastRowCol.col)) {
+ return;
+ }
+
+ uiGridCtrl.cellNav.clearFocus();
+
+ });
+
+ grid.api.core.on.scrollEnd($scope, function (args) {
+ // Skip if there's no currently-focused cell
+ var lastRowCol = uiGridCtrl.grid.api.cellNav.getFocusedCell();
+ if (lastRowCol === null) {
+ return;
+ }
+
+ // if not in my container, move on
+ // todo: worry about horiz scroll
+ if (!renderContainerCtrl.colContainer.containsColumn(lastRowCol.col)) {
+ return;
+ }
+
+ uiGridCtrl.cellNav.broadcastCellNav(lastRowCol);
+ });
+
+ grid.api.cellNav.on.navigate($scope, function () {
+ // focus again because it can be lost
+ uiGridCtrl.focus();
+ });
+ }
+ };
+ }
+ };
+ });
+
+ /**
+ * @ngdoc directive
+ * @name ui.grid.cellNav.directive:uiGridCell
+ * @element div
+ * @restrict A
+ * @description Stacks on top of ui.grid.uiGridCell to provide cell navigation
+ */
+ module.directive('uiGridCell', ['$timeout', '$document', 'uiGridCellNavService', 'gridUtil', 'uiGridCellNavConstants', 'uiGridConstants', 'GridRowColumn',
+ function ($timeout, $document, uiGridCellNavService, gridUtil, uiGridCellNavConstants, uiGridConstants, GridRowColumn) {
+ return {
+ priority: -150, // run after default uiGridCell directive and ui.grid.edit uiGridCell
+ restrict: 'A',
+ require: ['^uiGrid', '?^uiGridCellnav'],
+ scope: false,
+ link: function ($scope, $elm, $attrs, controllers) {
+ var uiGridCtrl = controllers[0],
+ uiGridCellnavCtrl = controllers[1];
+ // Skip attaching cell-nav specific logic if the directive is not attached above us
+ if (!uiGridCtrl.grid.api.cellNav) { return; }
+
+ if (!$scope.col.colDef.allowCellFocus) {
+ return;
+ }
+
+ // Convinience local variables
+ var grid = uiGridCtrl.grid;
+ $scope.focused = false;
+
+ // Make this cell focusable but only with javascript/a mouse click
+ $elm.attr('tabindex', -1);
+
+ // When a cell is clicked, broadcast a cellNav event saying that this row+col combo is now focused
+ $elm.find('div').on('click', function (evt) {
+ uiGridCtrl.cellNav.broadcastCellNav(new GridRowColumn($scope.row, $scope.col), evt.ctrlKey || evt.metaKey, evt);
+
+ evt.stopPropagation();
+ $scope.$apply();
+ });
+
+
+ /*
+ * XXX Hack for screen readers.
+ * This allows the grid to focus using only the screen reader cursor.
+ * Since the focus event doesn't include key press information we can't use it
+ * as our primary source of the event.
+ */
+ $elm.on('mousedown', preventMouseDown);
+
+ // turn on and off for edit events
+ if (uiGridCtrl.grid.api.edit) {
+ uiGridCtrl.grid.api.edit.on.beginCellEdit($scope, function () {
+ $elm.off('mousedown', preventMouseDown);
+ });
+
+ uiGridCtrl.grid.api.edit.on.afterCellEdit($scope, function () {
+ $elm.on('mousedown', preventMouseDown);
+ });
+
+ uiGridCtrl.grid.api.edit.on.cancelCellEdit($scope, function () {
+ $elm.on('mousedown', preventMouseDown);
+ });
+ }
+
+ // In case we created a new row, and we are the new created row by ngRepeat
+ // then this cell content might have been selected previously
+ refreshCellFocus();
+
+ function preventMouseDown(evt) {
+ // Prevents the foucus event from firing if the click event is already going to fire.
+ // If both events fire it will cause bouncing behavior.
+ evt.preventDefault();
+ }
+
+ // You can only focus on elements with a tabindex value
+ $elm.on('focus', function (evt) {
+ uiGridCtrl.cellNav.broadcastCellNav(new GridRowColumn($scope.row, $scope.col), false, evt);
+ evt.stopPropagation();
+ $scope.$apply();
+ });
+
+ // This event is fired for all cells. If the cell matches, then focus is set
+ $scope.$on(uiGridCellNavConstants.CELL_NAV_EVENT, refreshCellFocus);
+
+ // Refresh cell focus when a new row id added to the grid
+ var dataChangeDereg = uiGridCtrl.grid.registerDataChangeCallback(function (grid) {
+ // Clear the focus if it's set to avoid the wrong cell getting focused during
+ // a short period of time (from now until $timeout function executed)
+ clearFocus();
+
+ $scope.$applyAsync(refreshCellFocus);
+ }, [uiGridConstants.dataChange.ROW]);
+
+ function refreshCellFocus() {
+ var isFocused = grid.cellNav.focusedCells.some(function (focusedRowCol, index) {
+ return (focusedRowCol.row === $scope.row && focusedRowCol.col === $scope.col);
+ });
+ if (isFocused) {
+ setFocused();
+ } else {
+ clearFocus();
+ }
+ }
+
+ function setFocused() {
+ if (!$scope.focused) {
+ var div = $elm.find('div');
+ div.addClass('ui-grid-cell-focus');
+ $elm.attr('aria-selected', true);
+ uiGridCellnavCtrl.setAriaActivedescendant($elm.attr('id'));
+ $scope.focused = true;
+ }
+ }
+
+ function clearFocus() {
+ if ($scope.focused) {
+ var div = $elm.find('div');
+ div.removeClass('ui-grid-cell-focus');
+ $elm.attr('aria-selected', false);
+ uiGridCellnavCtrl.removeAriaActivedescendant($elm.attr('id'));
+ $scope.focused = false;
+ }
+ }
+
+ $scope.$on('$destroy', function () {
+ dataChangeDereg();
+
+ // .off withouth paramaters removes all handlers
+ $elm.find('div').off();
+ $elm.off();
+ });
+ }
+ };
+ }]);
+})();
diff --git a/release/4.9.2/i18n/ui-grid.cellnav.min.js b/release/4.9.2/i18n/ui-grid.cellnav.min.js
new file mode 100644
index 000000000..039383f41
--- /dev/null
+++ b/release/4.9.2/i18n/ui-grid.cellnav.min.js
@@ -0,0 +1,7 @@
+/*!
+ * ui-grid - v4.9.2 - 2020-12-01
+ * Copyright (c) 2020 ; License: MIT
+ */
+
+
+!function(){"use strict";var e=angular.module("ui.grid.cellNav",["ui.grid"]);e.constant("uiGridCellNavConstants",{FEATURE_NAME:"gridCellNav",CELL_NAV_EVENT:"cellNav",direction:{LEFT:0,RIGHT:1,UP:2,DOWN:3,PG_UP:4,PG_DOWN:5},EVENT_TYPE:{KEYDOWN:0,CLICK:1,CLEAR:2}}),e.factory("uiGridCellNavFactory",["gridUtil","uiGridConstants","uiGridCellNavConstants","GridRowColumn","$q",function(e,l,o,a,i){var n=function(e,l,i,o){this.rows=e.visibleRowCache,this.columns=l.visibleColumnCache,this.leftColumns=i?i.visibleColumnCache:[],this.rightColumns=o?o.visibleColumnCache:[],this.bodyContainer=e};return n.prototype.getFocusableCols=function(){return this.leftColumns.concat(this.columns,this.rightColumns).filter(function(e){return e.colDef.allowCellFocus})},n.prototype.getFocusableRows=function(){return this.rows.filter(function(e){return!1!==e.allowCellFocus})},n.prototype.getNextRowCol=function(e,l,i){switch(e){case o.direction.LEFT:return this.getRowColLeft(l,i);case o.direction.RIGHT:return this.getRowColRight(l,i);case o.direction.UP:return this.getRowColUp(l,i);case o.direction.DOWN:return this.getRowColDown(l,i);case o.direction.PG_UP:return this.getRowColPageUp(l,i);case o.direction.PG_DOWN:return this.getRowColPageDown(l,i)}},n.prototype.initializeSelection=function(){var e=this.getFocusableCols(),l=this.getFocusableRows();return 0===e.length||0===l.length?null:new a(l[0],e[0])},n.prototype.getRowColLeft=function(e,l){var i=this.getFocusableCols(),o=this.getFocusableRows(),n=i.indexOf(l),t=o.indexOf(e);-1===n&&(n=1);var r=0===n?i.length-1:n-1;return new a(n<=r?0===t?e:o[t-1]:e,i[r])},n.prototype.getRowColRight=function(e,l){var i=this.getFocusableCols(),o=this.getFocusableRows(),n=i.indexOf(l),t=o.indexOf(e);-1===n&&(n=0);var r=n===i.length-1?0:n+1;return r<=n?t===o.length-1?new a(e,i[r]):new a(o[t+1],i[r]):new a(e,i[r])},n.prototype.getRowColDown=function(e,l){var i=this.getFocusableCols(),o=this.getFocusableRows(),n=i.indexOf(l),t=o.indexOf(e);return-1===n&&(n=0),t===o.length-1?new a(e,i[n]):new a(o[t+1],i[n])},n.prototype.getRowColPageDown=function(e,l){var i=this.getFocusableCols(),o=this.getFocusableRows(),n=i.indexOf(l),t=o.indexOf(e);-1===n&&(n=0);var r=this.bodyContainer.minRowsToRender();return t>=o.length-r?new a(o[o.length-1],i[n]):new a(o[t+r],i[n])},n.prototype.getRowColUp=function(e,l){var i=this.getFocusableCols(),o=this.getFocusableRows(),n=i.indexOf(l),t=o.indexOf(e);return-1===n&&(n=0),new a(0===t?e:o[t-1],i[n])},n.prototype.getRowColPageUp=function(e,l){var i=this.getFocusableCols(),o=this.getFocusableRows(),n=i.indexOf(l),t=o.indexOf(e);-1===n&&(n=0);var r=this.bodyContainer.minRowsToRender();return new a(t-r<0?o[0]:o[t-r],i[n])},n}]),e.service("uiGridCellNavService",["gridUtil","uiGridConstants","uiGridCellNavConstants","$q","uiGridCellNavFactory","GridRowColumn","ScrollEvent",function(e,l,i,o,n,t,r){var a={initializeGrid:function(o){o.registerColumnBuilder(a.cellNavColumnBuilder),o.cellNav={},o.cellNav.lastRowCol=null,o.cellNav.focusedCells=[],a.defaultGridOptions(o.options);var e={events:{cellNav:{navigate:function(e,l){},viewPortKeyDown:function(e,l){},viewPortKeyPress:function(e,l){}}},methods:{cellNav:{scrollToFocus:function(e,l){return a.scrollToFocus(o,e,l)},getFocusedCell:function(){return o.cellNav.lastRowCol},getCurrentSelection:function(){return o.cellNav.focusedCells},rowColSelectIndex:function(e){for(var l=-1,i=0;i+ * .ui-grid-column-menu-button { + * display: block; + * } + *+ */ + /** + * @ngdoc property + * @name enableColumnMenus + * @propertyOf ui.grid.class:GridOptions.columnDef + * @description Override for column menus everywhere - if set to false then you get no + * column menus. Defaults to true. + * + */ + + $scope.offAllEvents(); + + if ($scope.sortable || $scope.colMenu) { + $scope.onDownEvents(); + + $scope.$on('$destroy', function () { + $scope.offAllEvents(); + }); + } + }; + + updateHeaderOptions(); + + if ($scope.col.filterContainer === 'columnMenu' && $scope.col.filterable) { + $rootScope.$on('menu-shown', function() { + $scope.$applyAsync(function () { + setFilter($scope.col.filterable); + }); + }); + } + + // Register a data change watch that would get triggered whenever someone edits a cell or modifies column defs + var dataChangeDereg = $scope.grid.registerDataChangeCallback( updateHeaderOptions, [uiGridConstants.dataChange.COLUMN]); + + $scope.$on( '$destroy', dataChangeDereg ); + + $scope.handleClick = function(event) { + // If the shift key is being held down, add this column to the sort + var add = false; + if (event.shiftKey) { + add = true; + } + + // Sort this column then rebuild the grid's rows + uiGridCtrl.grid.sortColumn($scope.col, add) + .then(function () { + if (uiGridCtrl.columnMenuScope) { uiGridCtrl.columnMenuScope.hideMenu(); } + uiGridCtrl.grid.refresh(); + }).catch(angular.noop); + }; + + $scope.headerCellArrowKeyDown = function(event) { + if (event.keyCode === 32 || event.keyCode === 13) { + event.preventDefault(); + $scope.toggleMenu(event); + } + }; + + $scope.toggleMenu = function(event) { + + event.stopPropagation(); + + // If the menu is already showing... + if (uiGridCtrl.columnMenuScope.menuShown) { + // ... and we're the column the menu is on... + if (uiGridCtrl.columnMenuScope.col === $scope.col) { + // ... hide it + uiGridCtrl.columnMenuScope.hideMenu(); + } + // ... and we're NOT the column the menu is on + else { + // ... move the menu to our column + uiGridCtrl.columnMenuScope.showMenu($scope.col, $elm); + } + } + // If the menu is NOT showing + else { + // ... show it on our column + uiGridCtrl.columnMenuScope.showMenu($scope.col, $elm); + } + }; + } + }; + } + }; + }]); +})(); + +(function() { + 'use strict'; + + angular.module('ui.grid').directive('uiGridHeader', ['$templateCache', '$compile', 'uiGridConstants', 'gridUtil', '$timeout', 'ScrollEvent', + function($templateCache, $compile, uiGridConstants, gridUtil, $timeout, ScrollEvent) { + var defaultTemplate = 'ui-grid/ui-grid-header', + emptyTemplate = 'ui-grid/ui-grid-no-header'; + + return { + restrict: 'EA', + replace: true, + require: ['^uiGrid', '^uiGridRenderContainer'], + scope: true, + compile: function() { + return { + pre: function ($scope, $elm, $attrs, controllers) { + var uiGridCtrl = controllers[0], + containerCtrl = controllers[1]; + + $scope.grid = uiGridCtrl.grid; + $scope.colContainer = containerCtrl.colContainer; + + updateHeaderReferences(); + + var headerTemplate; + if (!$scope.grid.options.showHeader) { + headerTemplate = emptyTemplate; + } + else { + headerTemplate = ($scope.grid.options.headerTemplate) ? $scope.grid.options.headerTemplate : defaultTemplate; + } + + gridUtil.getTemplate(headerTemplate) + .then(function (contents) { + var template = angular.element(contents); + + var newElm = $compile(template)($scope); + $elm.replaceWith(newElm); + + // And update $elm to be the new element + $elm = newElm; + + updateHeaderReferences(); + + if (containerCtrl) { + // Inject a reference to the header viewport (if it exists) into the grid controller for use in the horizontal scroll handler below + var headerViewport = $elm[0].getElementsByClassName('ui-grid-header-viewport')[0]; + + + if (headerViewport) { + containerCtrl.headerViewport = headerViewport; + angular.element(headerViewport).on('scroll', scrollHandler); + $scope.$on('$destroy', function () { + angular.element(headerViewport).off('scroll', scrollHandler); + }); + } + } + + $scope.grid.queueRefresh(); + }).catch(angular.noop); + + function updateHeaderReferences() { + containerCtrl.header = containerCtrl.colContainer.header = $elm; + + var headerCanvases = $elm[0].getElementsByClassName('ui-grid-header-canvas'); + + if (headerCanvases.length > 0) { + containerCtrl.headerCanvas = containerCtrl.colContainer.headerCanvas = headerCanvases[0]; + } + else { + containerCtrl.headerCanvas = null; + } + } + + function scrollHandler() { + if (uiGridCtrl.grid.isScrollingHorizontally) { + return; + } + var newScrollLeft = gridUtil.normalizeScrollLeft(containerCtrl.headerViewport, uiGridCtrl.grid); + var horizScrollPercentage = containerCtrl.colContainer.scrollHorizontal(newScrollLeft); + + var scrollEvent = new ScrollEvent(uiGridCtrl.grid, null, containerCtrl.colContainer, ScrollEvent.Sources.ViewPortScroll); + scrollEvent.newScrollLeft = newScrollLeft; + if ( horizScrollPercentage > -1 ) { + scrollEvent.x = { percentage: horizScrollPercentage }; + } + + uiGridCtrl.grid.scrollContainers(null, scrollEvent); + } + }, + + post: function ($scope, $elm, $attrs, controllers) { + var uiGridCtrl = controllers[0]; + var containerCtrl = controllers[1]; + + // gridUtil.logDebug('ui-grid-header link'); + + var grid = uiGridCtrl.grid; + + // Don't animate header cells + gridUtil.disableAnimations($elm); + + function updateColumnWidths() { + // this styleBuilder always runs after the renderContainer, so we can rely on the column widths + // already being populated correctly + + var columnCache = containerCtrl.colContainer.visibleColumnCache; + + // Build the CSS + // uiGridCtrl.grid.columns.forEach(function (column) { + var ret = ''; + var canvasWidth = 0; + columnCache.forEach(function (column) { + ret = ret + column.getColClassDefinition(); + canvasWidth += column.drawnWidth; + }); + + containerCtrl.colContainer.canvasWidth = canvasWidth; + + // Return the styles back to buildStyles which pops them into the `customStyles` scope variable + return ret; + } + + containerCtrl.header = $elm; + + var headerViewport = $elm[0].getElementsByClassName('ui-grid-header-viewport')[0]; + if (headerViewport) { + containerCtrl.headerViewport = headerViewport; + } + + // todo: remove this if by injecting gridCtrl into unit tests + if (uiGridCtrl) { + uiGridCtrl.grid.registerStyleComputation({ + priority: 15, + func: updateColumnWidths + }); + } + } + }; + } + }; + }]); +})(); + +(function() { + +angular.module('ui.grid') +.service('uiGridGridMenuService', [ 'gridUtil', 'i18nService', 'uiGridConstants', function( gridUtil, i18nService, uiGridConstants ) { + /** + * @ngdoc service + * @name ui.grid.uiGridGridMenuService + * + * @description Methods for working with the grid menu + */ + + var service = { + /** + * @ngdoc method + * @methodOf ui.grid.uiGridGridMenuService + * @name initialize + * @description Sets up the gridMenu. Most importantly, sets our + * scope onto the grid object as grid.gridMenuScope, allowing us + * to operate when passed only the grid. Second most importantly, + * we register the 'addToGridMenu' and 'removeFromGridMenu' methods + * on the core api. + * @param {$scope} $scope the scope of this gridMenu + * @param {Grid} grid the grid to which this gridMenu is associated + */ + initialize: function( $scope, grid ) { + grid.gridMenuScope = $scope; + $scope.grid = grid; + $scope.registeredMenuItems = []; + + // not certain this is needed, but would be bad to create a memory leak + $scope.$on('$destroy', function() { + if ( $scope.grid && $scope.grid.gridMenuScope ) { + $scope.grid.gridMenuScope = null; + } + if ( $scope.grid ) { + $scope.grid = null; + } + if ( $scope.registeredMenuItems ) { + $scope.registeredMenuItems = null; + } + }); + + $scope.registeredMenuItems = []; + + /** + * @ngdoc function + * @name addToGridMenu + * @methodOf ui.grid.api:PublicApi + * @description add items to the grid menu. Used by features + * to add their menu items if they are enabled, can also be used by + * end users to add menu items. This method has the advantage of allowing + * remove again, which can simplify management of which items are included + * in the menu when. (Noting that in most cases the shown and active functions + * provide a better way to handle visibility of menu items) + * @param {Grid} grid the grid on which we are acting + * @param {array} items menu items in the format as described in the tutorial, with + * the added note that if you want to use remove you must also specify an `id` field, + * which is provided when you want to remove an item. The id should be unique. + * + */ + grid.api.registerMethod( 'core', 'addToGridMenu', service.addToGridMenu ); + + /** + * @ngdoc function + * @name removeFromGridMenu + * @methodOf ui.grid.api:PublicApi + * @description Remove an item from the grid menu based on a provided id. Assumes + * that the id is unique, removes only the last instance of that id. Does nothing if + * the specified id is not found + * @param {Grid} grid the grid on which we are acting + * @param {string} id the id we'd like to remove from the menu + * + */ + grid.api.registerMethod( 'core', 'removeFromGridMenu', service.removeFromGridMenu ); + }, + + + /** + * @ngdoc function + * @name addToGridMenu + * @propertyOf ui.grid.uiGridGridMenuService + * @description add items to the grid menu. Used by features + * to add their menu items if they are enabled, can also be used by + * end users to add menu items. This method has the advantage of allowing + * remove again, which can simplify management of which items are included + * in the menu when. (Noting that in most cases the shown and active functions + * provide a better way to handle visibility of menu items) + * @param {Grid} grid the grid on which we are acting + * @param {array} menuItems menu items in the format as described in the tutorial, with + * the added note that if you want to use remove you must also specify an `id` field, + * which is provided when you want to remove an item. The id should be unique. + * + */ + addToGridMenu: function( grid, menuItems ) { + if ( !angular.isArray( menuItems ) ) { + gridUtil.logError( 'addToGridMenu: menuItems must be an array, and is not, not adding any items'); + } else { + if ( grid.gridMenuScope ) { + grid.gridMenuScope.registeredMenuItems = grid.gridMenuScope.registeredMenuItems ? grid.gridMenuScope.registeredMenuItems : []; + grid.gridMenuScope.registeredMenuItems = grid.gridMenuScope.registeredMenuItems.concat( menuItems ); + } else { + gridUtil.logError( 'Asked to addToGridMenu, but gridMenuScope not present. Timing issue? Please log issue with ui-grid'); + } + } + }, + + + /** + * @ngdoc function + * @name removeFromGridMenu + * @methodOf ui.grid.uiGridGridMenuService + * @description Remove an item from the grid menu based on a provided id. Assumes + * that the id is unique, removes only the last instance of that id. Does nothing if + * the specified id is not found. If there is no gridMenuScope or registeredMenuItems + * then do nothing silently - the desired result is those menu items not be present and they + * aren't. + * @param {Grid} grid the grid on which we are acting + * @param {string} id the id we'd like to remove from the menu + * + */ + removeFromGridMenu: function( grid, id ) { + var foundIndex = -1; + + if ( grid && grid.gridMenuScope ) { + grid.gridMenuScope.registeredMenuItems.forEach( function( value, index ) { + if ( value.id === id ) { + if (foundIndex > -1) { + gridUtil.logError( 'removeFromGridMenu: found multiple items with the same id, removing only the last' ); + } else { + + foundIndex = index; + } + } + }); + } + + if ( foundIndex > -1 ) { + grid.gridMenuScope.registeredMenuItems.splice( foundIndex, 1 ); + } + }, + + + /** + * @ngdoc array + * @name gridMenuCustomItems + * @propertyOf ui.grid.class:GridOptions + * @description (optional) An array of menu items that should be added to + * the gridMenu. Follow the format documented in the tutorial for column + * menu customisation. The context provided to the action function will + * include context.grid. An alternative if working with dynamic menus is to use the + * provided api - core.addToGridMenu and core.removeFromGridMenu, which handles + * some of the management of items for you. + * + */ + /** + * @ngdoc boolean + * @name gridMenuShowHideColumns + * @propertyOf ui.grid.class:GridOptions + * @description true by default, whether the grid menu should allow hide/show + * of columns + * + */ + /** + * @ngdoc method + * @methodOf ui.grid.uiGridGridMenuService + * @name getMenuItems + * @description Decides the menu items to show in the menu. This is a + * combination of: + * + * - the default menu items that are always included, + * - any menu items that have been provided through the addMenuItem api. These + * are typically added by features within the grid + * - any menu items included in grid.options.gridMenuCustomItems. These can be + * changed dynamically, as they're always recalculated whenever we show the + * menu + * @param {$scope} $scope the scope of this gridMenu, from which we can find all + * the information that we need + * @returns {Array} an array of menu items that can be shown + */ + getMenuItems: function( $scope ) { + var menuItems = [ + // this is where we add any menu items we want to always include + ]; + + if ( $scope.grid.options.gridMenuCustomItems ) { + if ( !angular.isArray( $scope.grid.options.gridMenuCustomItems ) ) { + gridUtil.logError( 'gridOptions.gridMenuCustomItems must be an array, and is not'); + } else { + menuItems = menuItems.concat( $scope.grid.options.gridMenuCustomItems ); + } + } + + var clearFilters = [{ + title: i18nService.getSafeText('gridMenu.clearAllFilters'), + action: function ($event) { + $scope.grid.clearAllFilters(); + }, + shown: function() { + return $scope.grid.options.enableFiltering; + }, + order: 100 + }]; + menuItems = menuItems.concat( clearFilters ); + + menuItems = menuItems.concat( $scope.registeredMenuItems ); + + if ( $scope.grid.options.gridMenuShowHideColumns !== false ) { + menuItems = menuItems.concat( service.showHideColumns( $scope ) ); + } + + menuItems.sort(function(a, b) { + return a.order - b.order; + }); + + return menuItems; + }, + + + /** + * @ngdoc array + * @name gridMenuTitleFilter + * @propertyOf ui.grid.class:GridOptions + * @description (optional) A function that takes a title string + * (usually the col.displayName), and converts it into a display value. The function + * must return either a string or a promise. + * + * Used for internationalization of the grid menu column names - for angular-translate + * you can pass $translate as the function, for i18nService you can pass getSafeText as the + * function + * @example + * + * gridOptions = { + * gridMenuTitleFilter: $translate + * } + *+ */ + /** + * @ngdoc method + * @methodOf ui.grid.uiGridGridMenuService + * @name showHideColumns + * @description Adds two menu items for each of the columns in columnDefs. One + * menu item for hide, one menu item for show. Each is visible when appropriate + * (show when column is not visible, hide when column is visible). Each toggles + * the visible property on the columnDef using toggleColumnVisibility + * @param {$scope} $scope of a gridMenu, which contains a reference to the grid + */ + showHideColumns: function( $scope ) { + var showHideColumns = []; + if ( !$scope.grid.options.columnDefs || $scope.grid.options.columnDefs.length === 0 || $scope.grid.columns.length === 0 ) { + return showHideColumns; + } + + function isColumnVisible(colDef) { + return colDef.visible === true || colDef.visible === undefined; + } + + function getColumnIcon(colDef) { + return isColumnVisible(colDef) ? 'ui-grid-icon-ok' : 'ui-grid-icon-cancel'; + } + + // add header for columns + showHideColumns.push({ + title: i18nService.getSafeText('gridMenu.columns'), + order: 300, + templateUrl: 'ui-grid/ui-grid-menu-header-item' + }); + + $scope.grid.options.gridMenuTitleFilter = $scope.grid.options.gridMenuTitleFilter ? $scope.grid.options.gridMenuTitleFilter : function( title ) { return title; }; + + $scope.grid.options.columnDefs.forEach( function( colDef, index ) { + if ( colDef.enableHiding !== false ) { + // add hide menu item - shows an OK icon as we only show when column is already visible + var menuItem = { + icon: getColumnIcon(colDef), + action: function($event) { + $event.stopPropagation(); + + service.toggleColumnVisibility( this.context.gridCol ); + + if ($event.target && $event.target.firstChild) { + if (angular.element($event.target)[0].nodeName === 'I') { + $event.target.className = getColumnIcon(this.context.gridCol.colDef); + } + else { + $event.target.firstChild.className = getColumnIcon(this.context.gridCol.colDef); + } + } + }, + shown: function() { + return this.context.gridCol.colDef.enableHiding !== false; + }, + context: { gridCol: $scope.grid.getColumn(colDef.name || colDef.field) }, + leaveOpen: true, + order: 301 + index + }; + service.setMenuItemTitle( menuItem, colDef, $scope.grid ); + showHideColumns.push( menuItem ); + } + }); + return showHideColumns; + }, + + + /** + * @ngdoc method + * @methodOf ui.grid.uiGridGridMenuService + * @name setMenuItemTitle + * @description Handles the response from gridMenuTitleFilter, adding it directly to the menu + * item if it returns a string, otherwise waiting for the promise to resolve or reject then + * putting the result into the title + * @param {object} menuItem the menuItem we want to put the title on + * @param {object} colDef the colDef from which we can get displayName, name or field + * @param {Grid} grid the grid, from which we can get the options.gridMenuTitleFilter + * + */ + setMenuItemTitle: function( menuItem, colDef, grid ) { + var title = grid.options.gridMenuTitleFilter( colDef.displayName || gridUtil.readableColumnName(colDef.name) || colDef.field ); + + if ( typeof(title) === 'string' ) { + menuItem.title = title; + } else if ( title.then ) { + // must be a promise + menuItem.title = ""; + title.then( function( successValue ) { + menuItem.title = successValue; + }, function( errorValue ) { + menuItem.title = errorValue; + }).catch(angular.noop); + } else { + gridUtil.logError('Expected gridMenuTitleFilter to return a string or a promise, it has returned neither, bad config'); + menuItem.title = 'badconfig'; + } + }, + + /** + * @ngdoc method + * @methodOf ui.grid.uiGridGridMenuService + * @name toggleColumnVisibility + * @description Toggles the visibility of an individual column. Expects to be + * provided a context that has on it a gridColumn, which is the column that + * we'll operate upon. We change the visibility, and refresh the grid as appropriate + * @param {GridColumn} gridCol the column that we want to toggle + * + */ + toggleColumnVisibility: function( gridCol ) { + gridCol.colDef.visible = !( gridCol.colDef.visible === true || gridCol.colDef.visible === undefined ); + + gridCol.grid.refresh(); + gridCol.grid.api.core.notifyDataChange( uiGridConstants.dataChange.COLUMN ); + gridCol.grid.api.core.raise.columnVisibilityChanged( gridCol ); + } + }; + + return service; +}]) + +.directive('uiGridMenuButton', ['gridUtil', 'uiGridConstants', 'uiGridGridMenuService', 'i18nService', +function (gridUtil, uiGridConstants, uiGridGridMenuService, i18nService) { + + return { + priority: 0, + scope: true, + require: ['^uiGrid'], + templateUrl: 'ui-grid/ui-grid-menu-button', + replace: true, + + link: function ($scope, $elm, $attrs, controllers) { + var uiGridCtrl = controllers[0]; + + // For the aria label + $scope.i18n = { + aria: i18nService.getSafeText('gridMenu.aria') + }; + + uiGridGridMenuService.initialize($scope, uiGridCtrl.grid); + + $scope.shown = false; + + $scope.toggleMenu = function () { + if ( $scope.shown ) { + $scope.$broadcast('hide-menu'); + $scope.shown = false; + } else { + $scope.menuItems = uiGridGridMenuService.getMenuItems( $scope ); + $scope.$broadcast('show-menu'); + $scope.shown = true; + } + }; + + $scope.$on('menu-hidden', function() { + $scope.shown = false; + gridUtil.focus.bySelector($elm, '.ui-grid-icon-container'); + }); + } + }; +}]); +})(); + +(function() { + +/** + * @ngdoc directive + * @name ui.grid.directive:uiGridMenu + * @element style + * @restrict A + * + * @description + * Allows us to interpolate expressions in ` + I am in a box. + + + NOTE: It is important to remember to always pass in an event object to
+ * the scrollHandler as the grid scrolling behavior will break without it.
+ * Example+ *+ * $scope.gridOptions = { + * customScroller: function myScrolling(uiGridViewport, scrollHandler) { + * uiGridViewport.on('scroll', function myScrollingOverride(event) { + * // Do something here + * + * scrollHandler(event); + * }); + * } + * }; + *+ * @param {object} uiGridViewport Element being scrolled. (this gets passed in by the grid). + * @param {function} scrollHandler Function that needs to be called when scrolling happens. (this gets passed in by the grid). + */ + if (grid && grid.options && grid.options.customScroller) { + grid.options.customScroller($elm, scrollHandler); + } else { + $elm.on('scroll', scrollHandler); + } + + var ignoreScroll = false; + + function scrollHandler() { + var newScrollTop = $elm[0].scrollTop; + var newScrollLeft = gridUtil.normalizeScrollLeft($elm, grid); + + var vertScrollPercentage = rowContainer.scrollVertical(newScrollTop); + var horizScrollPercentage = colContainer.scrollHorizontal(newScrollLeft); + + var scrollEvent = new ScrollEvent(grid, rowContainer, colContainer, ScrollEvent.Sources.ViewPortScroll); + scrollEvent.newScrollLeft = newScrollLeft; + scrollEvent.newScrollTop = newScrollTop; + if ( horizScrollPercentage > -1 ) { + scrollEvent.x = { percentage: horizScrollPercentage }; + } + + if ( vertScrollPercentage > -1 ) { + scrollEvent.y = { percentage: vertScrollPercentage }; + } + + grid.scrollContainers($scope.$parent.containerId, scrollEvent); + } + + if ($scope.$parent.bindScrollVertical) { + grid.addVerticalScrollSync($scope.$parent.containerId, syncVerticalScroll); + } + + if ($scope.$parent.bindScrollHorizontal) { + grid.addHorizontalScrollSync($scope.$parent.containerId, syncHorizontalScroll); + grid.addHorizontalScrollSync($scope.$parent.containerId + 'header', syncHorizontalHeader); + grid.addHorizontalScrollSync($scope.$parent.containerId + 'footer', syncHorizontalFooter); + } + + function syncVerticalScroll(scrollEvent) { + containerCtrl.prevScrollArgs = scrollEvent; + $elm[0].scrollTop = scrollEvent.getNewScrollTop(rowContainer,containerCtrl.viewport); + } + + function syncHorizontalScroll(scrollEvent) { + containerCtrl.prevScrollArgs = scrollEvent; + var newScrollLeft = scrollEvent.getNewScrollLeft(colContainer, containerCtrl.viewport); + + $elm[0].scrollLeft = gridUtil.denormalizeScrollLeft(containerCtrl.viewport,newScrollLeft, grid); + } + + function syncHorizontalHeader(scrollEvent) { + var newScrollLeft = scrollEvent.getNewScrollLeft(colContainer, containerCtrl.viewport); + + if (containerCtrl.headerViewport) { + containerCtrl.headerViewport.scrollLeft = gridUtil.denormalizeScrollLeft(containerCtrl.viewport,newScrollLeft, grid); + } + } + + function syncHorizontalFooter(scrollEvent) { + var newScrollLeft = scrollEvent.getNewScrollLeft(colContainer, containerCtrl.viewport); + + if (containerCtrl.footerViewport) { + containerCtrl.footerViewport.scrollLeft = gridUtil.denormalizeScrollLeft(containerCtrl.viewport,newScrollLeft, grid); + } + } + + $scope.$on('$destroy', function unbindEvents() { + $elm.off(); + }); + }, + controller: ['$scope', function ($scope) { + this.rowStyle = function () { + var rowContainer = $scope.rowContainer; + var colContainer = $scope.colContainer; + + var styles = {}; + + if (rowContainer.currentTopRow !== 0) { + // top offset based on hidden rows count + var translateY = "translateY("+ (rowContainer.currentTopRow * rowContainer.grid.options.rowHeight) +"px)"; + + styles['transform'] = translateY; + styles['-webkit-transform'] = translateY; + styles['-ms-transform'] = translateY; + } + + if (colContainer.currentFirstColumn !== 0) { + if (colContainer.grid.isRTL()) { + styles['margin-right'] = colContainer.columnOffset + 'px'; + } + else { + styles['margin-left'] = colContainer.columnOffset + 'px'; + } + } + + return styles; + }; + }] + }; + } + ]); + +})(); + +(function() { + angular.module('ui.grid') + .directive('uiGridVisible', function uiGridVisibleAction() { + return function($scope, $elm, $attr) { + $scope.$watch($attr.uiGridVisible, function(visible) { + $elm[visible ? 'removeClass' : 'addClass']('ui-grid-invisible'); + }); + }; + }); +})(); + +(function () { + 'use strict'; + + angular.module('ui.grid').controller('uiGridController', ['$scope', '$element', '$attrs', 'gridUtil', '$q', 'uiGridConstants', + 'gridClassFactory', '$parse', '$compile', + function ($scope, $elm, $attrs, gridUtil, $q, uiGridConstants, + gridClassFactory, $parse, $compile) { + // gridUtil.logDebug('ui-grid controller'); + var self = this; + var deregFunctions = []; + + self.grid = gridClassFactory.createGrid($scope.uiGrid); + + // assign $scope.$parent if appScope not already assigned + self.grid.appScope = self.grid.appScope || $scope.$parent; + + $elm.addClass('grid' + self.grid.id); + self.grid.rtl = gridUtil.getStyles($elm[0])['direction'] === 'rtl'; + + + // angular.extend(self.grid.options, ); + + // all properties of grid are available on scope + $scope.grid = self.grid; + + if ($attrs.uiGridColumns) { + deregFunctions.push( $attrs.$observe('uiGridColumns', function(value) { + self.grid.options.columnDefs = angular.isString(value) ? angular.fromJson(value) : value; + self.grid.buildColumns() + .then(function() { + self.grid.preCompileCellTemplates(); + + self.grid.refreshCanvas(true); + }).catch(angular.noop); + }) ); + } + + // prevents an error from being thrown when the array is not defined yet and fastWatch is on + function getSize(array) { + return array ? array.length : 0; + } + + // if fastWatch is set we watch only the length and the reference, not every individual object + if (self.grid.options.fastWatch) { + self.uiGrid = $scope.uiGrid; + if (angular.isString($scope.uiGrid.data)) { + deregFunctions.push( $scope.$parent.$watch($scope.uiGrid.data, dataWatchFunction) ); + deregFunctions.push( $scope.$parent.$watch(function() { + if ( self.grid.appScope[$scope.uiGrid.data] ) { + return self.grid.appScope[$scope.uiGrid.data].length; + } else { + return undefined; + } + }, dataWatchFunction) ); + } else { + deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.data; }, dataWatchFunction) ); + deregFunctions.push( $scope.$parent.$watch(function() { return getSize($scope.uiGrid.data); }, function() { dataWatchFunction($scope.uiGrid.data); }) ); + } + deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.columnDefs; }, columnDefsWatchFunction) ); + deregFunctions.push( $scope.$parent.$watch(function() { return getSize($scope.uiGrid.columnDefs); }, function() { columnDefsWatchFunction($scope.uiGrid.columnDefs); }) ); + } else { + if (angular.isString($scope.uiGrid.data)) { + deregFunctions.push( $scope.$parent.$watchCollection($scope.uiGrid.data, dataWatchFunction) ); + } else { + deregFunctions.push( $scope.$parent.$watchCollection(function() { return $scope.uiGrid.data; }, dataWatchFunction) ); + } + deregFunctions.push( $scope.$parent.$watchCollection(function() { return $scope.uiGrid.columnDefs; }, columnDefsWatchFunction) ); + } + + + function columnDefsWatchFunction(n, o) { + if (n && n !== o) { + self.grid.options.columnDefs = $scope.uiGrid.columnDefs; + self.grid.callDataChangeCallbacks(uiGridConstants.dataChange.COLUMN, { + orderByColumnDefs: true, + preCompileCellTemplates: true + }); + } + } + + var mostRecentData; + + function dataWatchFunction(newData) { + // gridUtil.logDebug('dataWatch fired'); + var promises = []; + + if ( self.grid.options.fastWatch ) { + if (angular.isString($scope.uiGrid.data)) { + newData = self.grid.appScope.$eval($scope.uiGrid.data); + } else { + newData = $scope.uiGrid.data; + } + } + + mostRecentData = newData; + + if (newData) { + // columns length is greater than the number of row header columns, which don't count because they're created automatically + var hasColumns = self.grid.columns.length > (self.grid.rowHeaderColumns ? self.grid.rowHeaderColumns.length : 0); + + if ( + // If we have no columns + !hasColumns && + // ... and we don't have a ui-grid-columns attribute, which would define columns for us + !$attrs.uiGridColumns && + // ... and we have no pre-defined columns + self.grid.options.columnDefs.length === 0 && + // ... but we DO have data + newData.length > 0 + ) { + // ... then build the column definitions from the data that we have + self.grid.buildColumnDefsFromData(newData); + } + + // If we haven't built columns before and either have some columns defined or some data defined + if (!hasColumns && (self.grid.options.columnDefs.length > 0 || newData.length > 0)) { + // Build the column set, then pre-compile the column cell templates + promises.push(self.grid.buildColumns() + .then(function() { + self.grid.preCompileCellTemplates(); + }).catch(angular.noop)); + } + + $q.all(promises).then(function() { + // use most recent data, rather than the potentially outdated data passed into watcher handler + self.grid.modifyRows(mostRecentData) + .then(function () { + // if (self.viewport) { + self.grid.redrawInPlace(true); + // } + + $scope.$evalAsync(function() { + self.grid.refreshCanvas(true); + self.grid.callDataChangeCallbacks(uiGridConstants.dataChange.ROW); + }); + }).catch(angular.noop); + }).catch(angular.noop); + } + } + + var styleWatchDereg = $scope.$watch(function () { return self.grid.styleComputations; }, function() { + self.grid.refreshCanvas(true); + }); + + $scope.$on('$destroy', function() { + deregFunctions.forEach( function( deregFn ) { deregFn(); }); + styleWatchDereg(); + }); + + self.fireEvent = function(eventName, args) { + args = args || {}; + + // Add the grid to the event arguments if it's not there + if (angular.isUndefined(args.grid)) { + args.grid = self.grid; + } + + $scope.$broadcast(eventName, args); + }; + + self.innerCompile = function innerCompile(elm) { + $compile(elm)($scope); + }; + }]); + +/** + * @ngdoc directive + * @name ui.grid.directive:uiGrid + * @element div + * @restrict EA + * @param {Object} uiGrid Options for the grid to use + * + * @description Create a very basic grid. + * + * @example +
+
+
+ '
+ + ''
+ + ' ',
+ scope: {
+ side: '=uiGridPinnedContainer'
+ },
+ require: '^uiGrid',
+ compile: function compile() {
+ return {
+ post: function ($scope, $elm, $attrs, uiGridCtrl) {
+ // gridUtil.logDebug('ui-grid-pinned-container ' + $scope.side + ' link');
+
+ var grid = uiGridCtrl.grid;
+
+ var myWidth = 0;
+
+ $elm.addClass('ui-grid-pinned-container-' + $scope.side);
+
+ // Monkey-patch the viewport width function
+ if ($scope.side === 'left' || $scope.side === 'right') {
+ grid.renderContainers[$scope.side].getViewportWidth = monkeyPatchedGetViewportWidth;
+ }
+
+ function monkeyPatchedGetViewportWidth() {
+ /*jshint validthis: true */
+ var self = this;
+
+ var viewportWidth = 0;
+ self.visibleColumnCache.forEach(function (column) {
+ viewportWidth += column.drawnWidth;
+ });
+
+ var adjustment = self.getViewportAdjustment();
+
+ viewportWidth = viewportWidth + adjustment.width;
+
+ return viewportWidth;
+ }
+
+ function updateContainerWidth() {
+ if ($scope.side === 'left' || $scope.side === 'right') {
+ var cols = grid.renderContainers[$scope.side].visibleColumnCache;
+ var width = 0;
+ for (var i = 0; i < cols.length; i++) {
+ var col = cols[i];
+ width += col.drawnWidth || col.width || 0;
+ }
+
+ return width;
+ }
+ }
+
+ function updateContainerDimensions() {
+ var ret = '';
+
+ // Column containers
+ if ($scope.side === 'left' || $scope.side === 'right') {
+ myWidth = updateContainerWidth();
+
+ // gridUtil.logDebug('myWidth', myWidth);
+
+ // TODO(c0bra): Subtract sum of col widths from grid viewport width and update it
+ $elm.attr('style', null);
+
+ // var myHeight = grid.renderContainers.body.getViewportHeight(); // + grid.horizontalScrollbarHeight;
+
+ ret += '.grid' + grid.id + ' .ui-grid-pinned-container-' + $scope.side + ', .grid' + grid.id + ' .ui-grid-pinned-container-' + $scope.side + ' .ui-grid-render-container-' + $scope.side + ' .ui-grid-viewport { width: ' + myWidth + 'px; } ';
+ }
+
+ return ret;
+ }
+
+ grid.renderContainers.body.registerViewportAdjuster(function (adjustment) {
+ myWidth = updateContainerWidth();
+
+ // Subtract our own width
+ adjustment.width -= myWidth;
+ adjustment.side = $scope.side;
+
+ return adjustment;
+ });
+
+ // Register style computation to adjust for columns in `side`'s render container
+ grid.registerStyleComputation({
+ priority: 15,
+ func: updateContainerDimensions
+ });
+ }
+ };
+ }
+ };
+ }]);
+})();
+
+(function () {
+ angular.module('ui.grid').config(['$provide', function($provide) {
+ $provide.decorator('i18nService', ['$delegate', function($delegate) {
+ $delegate.add('en', {
+ headerCell: {
+ aria: {
+ defaultFilterLabel: 'Filter for column',
+ removeFilter: 'Remove Filter',
+ columnMenuButtonLabel: 'Column Menu',
+ column: 'Column'
+ },
+ priority: 'Priority:',
+ filterLabel: "Filter for column: "
+ },
+ aggregate: {
+ label: 'items'
+ },
+ groupPanel: {
+ description: 'Drag a column header here and drop it to group by that column.'
+ },
+ search: {
+ aria: {
+ selected: 'Row selected',
+ notSelected: 'Row not selected'
+ },
+ placeholder: 'Search...',
+ showingItems: 'Showing Items:',
+ selectedItems: 'Selected Items:',
+ totalItems: 'Total Items:',
+ size: 'Page Size:',
+ first: 'First Page',
+ next: 'Next Page',
+ previous: 'Previous Page',
+ last: 'Last Page'
+ },
+ menu: {
+ text: 'Choose Columns:'
+ },
+ sort: {
+ ascending: 'Sort Ascending',
+ descending: 'Sort Descending',
+ none: 'Sort None',
+ remove: 'Remove Sort'
+ },
+ column: {
+ hide: 'Hide Column'
+ },
+ aggregation: {
+ count: 'total rows: ',
+ sum: 'total: ',
+ avg: 'avg: ',
+ min: 'min: ',
+ max: 'max: '
+ },
+ pinning: {
+ pinLeft: 'Pin Left',
+ pinRight: 'Pin Right',
+ unpin: 'Unpin'
+ },
+ columnMenu: {
+ close: 'Close'
+ },
+ gridMenu: {
+ aria: {
+ buttonLabel: 'Grid Menu'
+ },
+ columns: 'Columns:',
+ importerTitle: 'Import file',
+ exporterAllAsCsv: 'Export all data as csv',
+ exporterVisibleAsCsv: 'Export visible data as csv',
+ exporterSelectedAsCsv: 'Export selected data as csv',
+ exporterAllAsPdf: 'Export all data as pdf',
+ exporterVisibleAsPdf: 'Export visible data as pdf',
+ exporterSelectedAsPdf: 'Export selected data as pdf',
+ exporterAllAsExcel: 'Export all data as excel',
+ exporterVisibleAsExcel: 'Export visible data as excel',
+ exporterSelectedAsExcel: 'Export selected data as excel',
+ clearAllFilters: 'Clear all filters'
+ },
+ importer: {
+ noHeaders: 'Column names were unable to be derived, does the file have a header?',
+ noObjects: 'Objects were not able to be derived, was there data in the file other than headers?',
+ invalidCsv: 'File was unable to be processed, is it valid CSV?',
+ invalidJson: 'File was unable to be processed, is it valid Json?',
+ jsonNotArray: 'Imported json file must contain an array, aborting.'
+ },
+ pagination: {
+ aria: {
+ pageToFirst: 'Page to first',
+ pageBack: 'Page back',
+ pageSelected: 'Selected page',
+ pageForward: 'Page forward',
+ pageToLast: 'Page to last'
+ },
+ sizes: 'items per page',
+ totalItems: 'items',
+ through: 'through',
+ of: 'of'
+ },
+ grouping: {
+ group: 'Group',
+ ungroup: 'Ungroup',
+ aggregate_count: 'Agg: Count',
+ aggregate_sum: 'Agg: Sum',
+ aggregate_max: 'Agg: Max',
+ aggregate_min: 'Agg: Min',
+ aggregate_avg: 'Agg: Avg',
+ aggregate_remove: 'Agg: Remove'
+ },
+ validate: {
+ error: 'Error:',
+ minLength: 'Value should be at least THRESHOLD characters long.',
+ maxLength: 'Value should be at most THRESHOLD characters long.',
+ required: 'A value is needed.'
+ }
+ });
+ return $delegate;
+ }]);
+ }]);
+})();
+
+(function() {
+
+angular.module('ui.grid')
+.factory('Grid', ['$q', '$compile', '$parse', 'gridUtil', 'uiGridConstants', 'GridOptions', 'GridColumn', 'GridRow', 'GridApi', 'rowSorter', 'rowSearcher', 'GridRenderContainer', '$timeout','ScrollEvent',
+ function($q, $compile, $parse, gridUtil, uiGridConstants, GridOptions, GridColumn, GridRow, GridApi, rowSorter, rowSearcher, GridRenderContainer, $timeout, ScrollEvent) {
+
+ /**
+ * @ngdoc object
+ * @name ui.grid.api:PublicApi
+ * @description Public Api for the core grid features
+ *
+ */
+
+ /**
+ * @ngdoc function
+ * @name ui.grid.class:Grid
+ * @description Grid is the main viewModel. Any properties or methods needed to maintain state are defined in
+ * this prototype. One instance of Grid is created per Grid directive instance.
+ * @param {object} options Object map of options to pass into the grid. An 'id' property is expected.
+ */
+ var Grid = function Grid(options) {
+ var self = this;
+ // Get the id out of the options, then remove it
+ if (options !== undefined && typeof(options.id) !== 'undefined' && options.id) {
+ if (!/^[_a-zA-Z0-9-]+$/.test(options.id)) {
+ throw new Error("Grid id '" + options.id + '" is invalid. It must follow CSS selector syntax rules.');
+ }
+ }
+ else {
+ throw new Error('No ID provided. An ID must be given when creating a grid.');
+ }
+
+ self.id = options.id;
+ delete options.id;
+
+ // Get default options
+ self.options = GridOptions.initialize( options );
+
+ /**
+ * @ngdoc object
+ * @name appScope
+ * @propertyOf ui.grid.class:Grid
+ * @description reference to the application scope (the parent scope of the ui-grid element). Assigned in ui-grid controller
+ * + * use gridOptions.appScopeProvider to override the default assignment of $scope.$parent with any reference + */ + self.appScope = self.options.appScopeProvider; + + self.headerHeight = self.options.headerRowHeight; + + + /** + * @ngdoc object + * @name footerHeight + * @propertyOf ui.grid.class:Grid + * @description returns the total footer height gridFooter + columnFooter + */ + self.footerHeight = self.calcFooterHeight(); + + + /** + * @ngdoc object + * @name columnFooterHeight + * @propertyOf ui.grid.class:Grid + * @description returns the total column footer height + */ + self.columnFooterHeight = self.calcColumnFooterHeight(); + + self.rtl = false; + self.gridHeight = 0; + self.gridWidth = 0; + self.columnBuilders = []; + self.rowBuilders = []; + self.rowsProcessors = []; + self.columnsProcessors = []; + self.styleComputations = []; + self.viewportAdjusters = []; + self.rowHeaderColumns = []; + self.dataChangeCallbacks = {}; + self.verticalScrollSyncCallBackFns = {}; + self.horizontalScrollSyncCallBackFns = {}; + + // self.visibleRowCache = []; + + // Set of 'render' containers for self grid, which can render sets of rows + self.renderContainers = {}; + + // Create a + self.renderContainers.body = new GridRenderContainer('body', self); + + self.cellValueGetterCache = {}; + + // Cached function to use with custom row templates + self.getRowTemplateFn = null; + + + // representation of the rows on the grid. + // these are wrapped references to the actual data rows (options.data) + self.rows = []; + + // represents the columns on the grid + self.columns = []; + + /** + * @ngdoc boolean + * @name isScrollingVertically + * @propertyOf ui.grid.class:Grid + * @description set to true when Grid is scrolling vertically. Set to false via debounced method + */ + self.isScrollingVertically = false; + + /** + * @ngdoc boolean + * @name isScrollingHorizontally + * @propertyOf ui.grid.class:Grid + * @description set to true when Grid is scrolling horizontally. Set to false via debounced method + */ + self.isScrollingHorizontally = false; + + /** + * @ngdoc property + * @name scrollDirection + * @propertyOf ui.grid.class:Grid + * @description set one of the {@link ui.grid.service:uiGridConstants#properties_scrollDirection uiGridConstants.scrollDirection} + * values (UP, DOWN, LEFT, RIGHT, NONE), which tells us which direction we are scrolling. + * Set to NONE via debounced method + */ + self.scrollDirection = uiGridConstants.scrollDirection.NONE; + + // if true, grid will not respond to any scroll events + self.disableScrolling = false; + + + function vertical (scrollEvent) { + self.isScrollingVertically = false; + self.api.core.raise.scrollEnd(scrollEvent); + self.scrollDirection = uiGridConstants.scrollDirection.NONE; + } + + var debouncedVertical = gridUtil.debounce(vertical, self.options.scrollDebounce); + var debouncedVerticalMinDelay = gridUtil.debounce(vertical, 0); + + function horizontal (scrollEvent) { + self.isScrollingHorizontally = false; + self.api.core.raise.scrollEnd(scrollEvent); + self.scrollDirection = uiGridConstants.scrollDirection.NONE; + } + + var debouncedHorizontal = gridUtil.debounce(horizontal, self.options.scrollDebounce); + var debouncedHorizontalMinDelay = gridUtil.debounce(horizontal, 0); + + + /** + * @ngdoc function + * @name flagScrollingVertically + * @methodOf ui.grid.class:Grid + * @description sets isScrollingVertically to true and sets it to false in a debounced function + */ + self.flagScrollingVertically = function(scrollEvent) { + if (!self.isScrollingVertically && !self.isScrollingHorizontally) { + self.api.core.raise.scrollBegin(scrollEvent); + } + self.isScrollingVertically = true; + if (self.options.scrollDebounce === 0 || !scrollEvent.withDelay) { + debouncedVerticalMinDelay(scrollEvent); + } + else { + debouncedVertical(scrollEvent); + } + }; + + /** + * @ngdoc function + * @name flagScrollingHorizontally + * @methodOf ui.grid.class:Grid + * @description sets isScrollingHorizontally to true and sets it to false in a debounced function + */ + self.flagScrollingHorizontally = function(scrollEvent) { + if (!self.isScrollingVertically && !self.isScrollingHorizontally) { + self.api.core.raise.scrollBegin(scrollEvent); + } + self.isScrollingHorizontally = true; + if (self.options.scrollDebounce === 0 || !scrollEvent.withDelay) { + debouncedHorizontalMinDelay(scrollEvent); + } + else { + debouncedHorizontal(scrollEvent); + } + }; + + self.scrollbarHeight = 0; + self.scrollbarWidth = 0; + if (self.options.enableHorizontalScrollbar !== uiGridConstants.scrollbars.NEVER) { + self.scrollbarHeight = gridUtil.getScrollbarWidth(); + } + + if (self.options.enableVerticalScrollbar !== uiGridConstants.scrollbars.NEVER) { + self.scrollbarWidth = gridUtil.getScrollbarWidth(); + } + + self.api = new GridApi(self); + + /** + * @ngdoc function + * @name refresh + * @methodOf ui.grid.api:PublicApi + * @description Refresh the rendered grid on screen. + * The refresh method re-runs both the columnProcessors and the + * rowProcessors, as well as calling refreshCanvas to update all + * the grid sizing. In general you should prefer to use queueGridRefresh + * instead, which is basically a debounced version of refresh. + * + * If you only want to resize the grid, not regenerate all the rows + * and columns, you should consider directly calling refreshCanvas instead. + * + * @param {boolean} [rowsAltered] Optional flag for refreshing when the number of rows has changed + */ + self.api.registerMethod( 'core', 'refresh', this.refresh ); + + /** + * @ngdoc function + * @name queueGridRefresh + * @methodOf ui.grid.api:PublicApi + * @description Request a refresh of the rendered grid on screen, if multiple + * calls to queueGridRefresh are made within a digest cycle only one will execute. + * The refresh method re-runs both the columnProcessors and the + * rowProcessors, as well as calling refreshCanvas to update all + * the grid sizing. In general you should prefer to use queueGridRefresh + * instead, which is basically a debounced version of refresh. + * + */ + self.api.registerMethod( 'core', 'queueGridRefresh', this.queueGridRefresh ); + + /** + * @ngdoc function + * @name refreshRows + * @methodOf ui.grid.api:PublicApi + * @description Runs only the rowProcessors, columns remain as they were. + * It then calls redrawInPlace and refreshCanvas, which adjust the grid sizing. + * @returns {promise} promise that is resolved when render completes? + * + */ + self.api.registerMethod( 'core', 'refreshRows', this.refreshRows ); + + /** + * @ngdoc function + * @name queueRefresh + * @methodOf ui.grid.api:PublicApi + * @description Requests execution of refreshCanvas, if multiple requests are made + * during a digest cycle only one will run. RefreshCanvas updates the grid sizing. + * @returns {promise} promise that is resolved when render completes? + * + */ + self.api.registerMethod( 'core', 'queueRefresh', this.queueRefresh ); + + /** + * @ngdoc function + * @name handleWindowResize + * @methodOf ui.grid.api:PublicApi + * @description Trigger a grid resize, normally this would be picked + * up by a watch on window size, but in some circumstances it is necessary + * to call this manually + * @returns {promise} promise that is resolved when render completes? + * + */ + self.api.registerMethod( 'core', 'handleWindowResize', this.handleWindowResize ); + + + /** + * @ngdoc function + * @name addRowHeaderColumn + * @methodOf ui.grid.api:PublicApi + * @description adds a row header column to the grid + * @param {object} column def + * @param {number} order Determines order of header column on grid. Lower order means header + * is positioned to the left of higher order headers + * + */ + self.api.registerMethod( 'core', 'addRowHeaderColumn', this.addRowHeaderColumn ); + + /** + * @ngdoc function + * @name scrollToIfNecessary + * @methodOf ui.grid.api:PublicApi + * @description Scrolls the grid to make a certain row and column combo visible, + * in the case that it is not completely visible on the screen already. + * @param {GridRow} gridRow row to make visible + * @param {GridColumn} gridCol column to make visible + * @returns {promise} a promise that is resolved when scrolling is complete + * + */ + self.api.registerMethod( 'core', 'scrollToIfNecessary', function(gridRow, gridCol) { return self.scrollToIfNecessary(gridRow, gridCol);} ); + + /** + * @ngdoc function + * @name scrollTo + * @methodOf ui.grid.api:PublicApi + * @description Scroll the grid such that the specified + * row and column is in view + * @param {object} rowEntity gridOptions.data[] array instance to make visible + * @param {object} colDef to make visible + * @returns {promise} a promise that is resolved after any scrolling is finished + */ + self.api.registerMethod( 'core', 'scrollTo', function (rowEntity, colDef) { return self.scrollTo(rowEntity, colDef);} ); + + /** + * @ngdoc function + * @name registerRowsProcessor + * @methodOf ui.grid.api:PublicApi + * @description + * Register a "rows processor" function. When the rows are updated, + * the grid calls each registered "rows processor", which has a chance + * to alter the set of rows (sorting, etc) as long as the count is not + * modified. + * + * @param {function(renderedRowsToProcess, columns )} processorFunction rows processor function, which + * is run in the context of the grid (i.e. this for the function will be the grid), and must + * return the updated rows list, which is passed to the next processor in the chain + * @param {number} priority the priority of this processor. In general we try to do them in 100s to leave room + * for other people to inject rows processors at intermediate priorities. Lower priority rowsProcessors run earlier. + * + * At present allRowsVisible is running at 50, sort manipulations running at 60-65, filter is running at 100, + * sort is at 200, grouping and treeview at 400-410, selectable rows at 500, pagination at 900 (pagination will generally want to be last) + */ + self.api.registerMethod( 'core', 'registerRowsProcessor', this.registerRowsProcessor ); + + /** + * @ngdoc function + * @name registerColumnsProcessor + * @methodOf ui.grid.api:PublicApi + * @description + * Register a "columns processor" function. When the columns are updated, + * the grid calls each registered "columns processor", which has a chance + * to alter the set of columns as long as the count is not + * modified. + * + * @param {function(renderedColumnsToProcess, rows )} processorFunction columns processor function, which + * is run in the context of the grid (i.e. this for the function will be the grid), and must + * return the updated columns list, which is passed to the next processor in the chain + * @param {number} priority the priority of this processor. In general we try to do them in 100s to leave room + * for other people to inject columns processors at intermediate priorities. Lower priority columnsProcessors run earlier. + * + * At present allRowsVisible is running at 50, filter is running at 100, sort is at 200, grouping at 400, selectable rows at 500, pagination at 900 (pagination will generally want to be last) + */ + self.api.registerMethod( 'core', 'registerColumnsProcessor', this.registerColumnsProcessor ); + + /** + * @ngdoc function + * @name sortHandleNulls + * @methodOf ui.grid.api:PublicApi + * @description A null handling method that can be used when building custom sort + * functions + * @example + * + * mySortFn = function(a, b) { + * var nulls = $scope.gridApi.core.sortHandleNulls(a, b); + * if ( nulls !== null ) { + * return nulls; + * } else { + * // your code for sorting here + * }; + *+ * @param {object} a sort value a + * @param {object} b sort value b + * @returns {number} null if there were no nulls/undefineds, otherwise returns + * a sort value that should be passed back from the sort function + * + */ + self.api.registerMethod( 'core', 'sortHandleNulls', rowSorter.handleNulls ); + + /** + * @ngdoc function + * @name sortChanged + * @methodOf ui.grid.api:PublicApi + * @description The sort criteria on one or more columns has + * changed. Provides as parameters the grid and the output of + * getColumnSorting, which is an array of gridColumns + * that have sorting on them, sorted in priority order. + * + * @param {$scope} scope The scope of the controller. This is used to deregister this event when the scope is destroyed. + * @param {Function} callBack Will be called when the event is emited. The function passes back the grid and an array of + * columns with sorts on them, in priority order. + * + * @example + * + * gridApi.core.on.sortChanged( $scope, function(grid, sortColumns) { + * // do something + * }); + *+ */ + self.api.registerEvent( 'core', 'sortChanged' ); + + /** + * @ngdoc function + * @name columnVisibilityChanged + * @methodOf ui.grid.api:PublicApi + * @description The visibility of a column has changed, + * the column itself is passed out as a parameter of the event. + * + * @param {$scope} scope The scope of the controller. This is used to deregister this event when the scope is destroyed. + * @param {Function} callBack Will be called when the event is emited. The function passes back the GridCol that has changed. + * + * @example + * + * gridApi.core.on.columnVisibilityChanged( $scope, function (column) { + * // do something + * } ); + *+ */ + self.api.registerEvent( 'core', 'columnVisibilityChanged' ); + + /** + * @ngdoc method + * @name notifyDataChange + * @methodOf ui.grid.api:PublicApi + * @description Notify the grid that a data or config change has occurred, + * where that change isn't something the grid was otherwise noticing. This + * might be particularly relevant where you've changed values within the data + * and you'd like cell classes to be re-evaluated, or changed config within + * the columnDef and you'd like headerCellClasses to be re-evaluated. + * @param {string} type one of the + * {@link ui.grid.service:uiGridConstants#properties_dataChange uiGridConstants.dataChange} + * values (ALL, ROW, EDIT, COLUMN, OPTIONS), which tells us which refreshes to fire. + * + * - ALL: listeners fired on any of these events, fires listeners on all events. + * - ROW: fired when a row is added or removed. + * - EDIT: fired when the data in a cell is edited. + * - COLUMN: fired when the column definitions are modified. + * - OPTIONS: fired when the grid options are modified. + */ + self.api.registerMethod( 'core', 'notifyDataChange', this.notifyDataChange ); + + /** + * @ngdoc method + * @name clearAllFilters + * @methodOf ui.grid.api:PublicApi + * @description Clears all filters and optionally refreshes the visible rows. + * @param {object} refreshRows Defaults to true. + * @param {object} clearConditions Defaults to false. + * @param {object} clearFlags Defaults to false. + * @returns {promise} If `refreshRows` is true, returns a promise of the rows refreshing. + */ + self.api.registerMethod('core', 'clearAllFilters', this.clearAllFilters); + + self.registerDataChangeCallback( self.columnRefreshCallback, [uiGridConstants.dataChange.COLUMN]); + self.registerDataChangeCallback( self.processRowsCallback, [uiGridConstants.dataChange.EDIT]); + self.registerDataChangeCallback( self.updateFooterHeightCallback, [uiGridConstants.dataChange.OPTIONS]); + + self.registerStyleComputation({ + priority: 10, + func: self.getFooterStyles + }); + }; + + Grid.prototype.calcFooterHeight = function () { + if (!this.hasFooter()) { + return 0; + } + + var height = 0; + if (this.options.showGridFooter) { + height += this.options.gridFooterHeight; + } + + height += this.calcColumnFooterHeight(); + + return height; + }; + + Grid.prototype.calcColumnFooterHeight = function () { + var height = 0; + + if (this.options.showColumnFooter) { + height += this.options.columnFooterHeight; + } + + return height; + }; + + Grid.prototype.getFooterStyles = function () { + var style = '.grid' + this.id + ' .ui-grid-footer-aggregates-row { height: ' + this.options.columnFooterHeight + 'px; }'; + style += ' .grid' + this.id + ' .ui-grid-footer-info { height: ' + this.options.gridFooterHeight + 'px; }'; + return style; + }; + + Grid.prototype.hasFooter = function () { + return this.options.showGridFooter || this.options.showColumnFooter; + }; + + /** + * @ngdoc function + * @name isRTL + * @methodOf ui.grid.class:Grid + * @description Returns true if grid is RightToLeft + */ + Grid.prototype.isRTL = function () { + return this.rtl; + }; + + + /** + * @ngdoc function + * @name registerColumnBuilder + * @methodOf ui.grid.class:Grid + * @description When the build creates columns from column definitions, the columnbuilders will be called to add + * additional properties to the column. + * @param {function(colDef, col, gridOptions)} columnBuilder function to be called + */ + Grid.prototype.registerColumnBuilder = function registerColumnBuilder(columnBuilder) { + this.columnBuilders.push(columnBuilder); + }; + + /** + * @ngdoc function + * @name buildColumnDefsFromData + * @methodOf ui.grid.class:Grid + * @description Populates columnDefs from the provided data + * @param {function(colDef, col, gridOptions)} rowBuilder function to be called + */ + Grid.prototype.buildColumnDefsFromData = function (dataRows) { + this.options.columnDefs = gridUtil.getColumnsFromData(dataRows, this.options.excludeProperties); + }; + + /** + * @ngdoc function + * @name registerRowBuilder + * @methodOf ui.grid.class:Grid + * @description When the build creates rows from gridOptions.data, the rowBuilders will be called to add + * additional properties to the row. + * @param {function(row, gridOptions)} rowBuilder function to be called + */ + Grid.prototype.registerRowBuilder = function registerRowBuilder(rowBuilder) { + this.rowBuilders.push(rowBuilder); + }; + + /** + * @ngdoc function + * @name registerDataChangeCallback + * @methodOf ui.grid.class:Grid + * @description When a data change occurs, the data change callbacks of the specified type + * will be called. The rules are: + * + * - when the data watch fires, that is considered a ROW change (the data watch only notices + * added or removed rows) + * - when the api is called to inform us of a change, the declared type of that change is used + * - when a cell edit completes, the EDIT callbacks are triggered + * - when the columnDef watch fires, the COLUMN callbacks are triggered + * - when the options watch fires, the OPTIONS callbacks are triggered + * + * For a given event: + * - ALL calls ROW, EDIT, COLUMN, OPTIONS and ALL callbacks + * - ROW calls ROW and ALL callbacks + * - EDIT calls EDIT and ALL callbacks + * - COLUMN calls COLUMN and ALL callbacks + * - OPTIONS calls OPTIONS and ALL callbacks + * + * @param {function(grid)} callback function to be called + * @param {array} types the types of data change you want to be informed of. Values from + * the {@link ui.grid.service:uiGridConstants#properties_dataChange uiGridConstants.dataChange} + * values ( ALL, EDIT, ROW, COLUMN, OPTIONS ). Optional and defaults to ALL + * @returns {function} deregister function - a function that can be called to deregister this callback + */ + Grid.prototype.registerDataChangeCallback = function registerDataChangeCallback(callback, types, _this) { + var self = this, + uid = gridUtil.nextUid(); + + if ( !types ) { + types = [uiGridConstants.dataChange.ALL]; + } + if ( !Array.isArray(types)) { + gridUtil.logError("Expected types to be an array or null in registerDataChangeCallback, value passed was: " + types ); + } + this.dataChangeCallbacks[uid] = { callback: callback, types: types, _this: _this }; + + return function() { + delete self.dataChangeCallbacks[uid]; + }; + }; + + /** + * @ngdoc function + * @name callDataChangeCallbacks + * @methodOf ui.grid.class:Grid + * @description Calls the callbacks based on the type of data change that + * has occurred. Always calls the ALL callbacks, calls the ROW, EDIT, COLUMN and OPTIONS callbacks if the + * event type is matching, or if the type is ALL. + * @param {string} type the type of event that occurred - one of the + * {@link ui.grid.service:uiGridConstants#properties_dataChange uiGridConstants.dataChange} + * values (ALL, ROW, EDIT, COLUMN, OPTIONS) + */ + Grid.prototype.callDataChangeCallbacks = function callDataChangeCallbacks(type, options) { + angular.forEach( this.dataChangeCallbacks, function( callback, uid ) { + if ( callback.types.indexOf( uiGridConstants.dataChange.ALL ) !== -1 || + callback.types.indexOf( type ) !== -1 || + type === uiGridConstants.dataChange.ALL ) { + if (callback._this) { + callback.callback.apply(callback._this, this, options); + } + else { + callback.callback(this, options); + } + } + }, this); + }; + + /** + * @ngdoc function + * @name notifyDataChange + * @methodOf ui.grid.class:Grid + * @description Notifies us that a data change has occurred, used in the public + * api for users to tell us when they've changed data or some other event that + * our watches cannot pick up + * @param {string} type the type of event that occurred - one of the + * uiGridConstants.dataChange values (ALL, ROW, EDIT, COLUMN, OPTIONS) + * + * - ALL: listeners fired on any of these events, fires listeners on all events. + * - ROW: fired when a row is added or removed. + * - EDIT: fired when the data in a cell is edited. + * - COLUMN: fired when the column definitions are modified. + * - OPTIONS: fired when the grid options are modified. + */ + Grid.prototype.notifyDataChange = function notifyDataChange(type) { + var constants = uiGridConstants.dataChange; + + if ( type === constants.ALL || + type === constants.COLUMN || + type === constants.EDIT || + type === constants.ROW || + type === constants.OPTIONS ) { + this.callDataChangeCallbacks( type ); + } + else { + gridUtil.logError("Notified of a data change, but the type was not recognised, so no action taken, type was: " + type); + } + }; + + /** + * @ngdoc function + * @name columnRefreshCallback + * @methodOf ui.grid.class:Grid + * @description refreshes the grid when a column refresh + * is notified, which triggers handling of the visible flag. + * This is called on uiGridConstants.dataChange.COLUMN, and is + * registered as a dataChangeCallback in grid.js + * @param {object} grid The grid object. + * @param {object} options Any options passed into the callback. + */ + Grid.prototype.columnRefreshCallback = function columnRefreshCallback(grid, options) { + grid.buildColumns(options); + grid.queueGridRefresh(); + }; + + /** + * @ngdoc function + * @name processRowsCallback + * @methodOf ui.grid.class:Grid + * @description calls the row processors, specifically + * intended to reset the sorting when an edit is called, + * registered as a dataChangeCallback on uiGridConstants.dataChange.EDIT + * @param {object} grid The grid object. + */ + Grid.prototype.processRowsCallback = function processRowsCallback( grid ) { + grid.queueGridRefresh(); + }; + + + /** + * @ngdoc function + * @name updateFooterHeightCallback + * @methodOf ui.grid.class:Grid + * @description recalculates the footer height, + * registered as a dataChangeCallback on uiGridConstants.dataChange.OPTIONS + * @param {object} grid The grid object. + */ + Grid.prototype.updateFooterHeightCallback = function updateFooterHeightCallback( grid ) { + grid.footerHeight = grid.calcFooterHeight(); + grid.columnFooterHeight = grid.calcColumnFooterHeight(); + }; + + + /** + * @ngdoc function + * @name getColumn + * @methodOf ui.grid.class:Grid + * @description returns a grid column for the column name + * @param {string} name column name + */ + Grid.prototype.getColumn = function getColumn(name) { + var columns = this.columns.filter(function (column) { + return column.colDef.name === name; + }); + + return columns.length > 0 ? columns[0] : null; + }; + + /** + * @ngdoc function + * @name getColDef + * @methodOf ui.grid.class:Grid + * @description returns a grid colDef for the column name + * @param {string} name column.field + */ + Grid.prototype.getColDef = function getColDef(name) { + var colDefs = this.options.columnDefs.filter(function (colDef) { + return colDef.name === name; + }); + return colDefs.length > 0 ? colDefs[0] : null; + }; + + /** + * @ngdoc function + * @name assignTypes + * @methodOf ui.grid.class:Grid + * @description uses the first row of data to assign colDef.type for any types not defined. + */ + /** + * @ngdoc property + * @name type + * @propertyOf ui.grid.class:GridOptions.columnDef + * @description the type of the column, used in sorting. If not provided then the + * grid will guess the type. Add this only if the grid guessing is not to your + * satisfaction. One of: + * - 'string' + * - 'boolean' + * - 'number' + * - 'date' + * - 'object' + * - 'numberStr' + * Note that if you choose date, your dates should be in a javascript date type + * + */ + Grid.prototype.assignTypes = function() { + var self = this; + + self.options.columnDefs.forEach(function (colDef, index) { + // Assign colDef type if not specified + if (!colDef.type) { + var col = new GridColumn(colDef, index, self); + var firstRow = self.rows.length > 0 ? self.rows[0] : null; + if (firstRow) { + colDef.type = gridUtil.guessType(self.getCellValue(firstRow, col)); + } + else { + colDef.type = 'string'; + } + } + }); + }; + + + /** + * @ngdoc function + * @name isRowHeaderColumn + * @methodOf ui.grid.class:Grid + * @description returns true if the column is a row Header + * @param {object} column column + */ + Grid.prototype.isRowHeaderColumn = function isRowHeaderColumn(column) { + return this.rowHeaderColumns.indexOf(column) !== -1; + }; + + /** + * @ngdoc function + * @name addRowHeaderColumn + * @methodOf ui.grid.class:Grid + * @description adds a row header column to the grid + * @param {object} colDef Column definition object. + * @param {float} order Number that indicates where the column should be placed in the grid. + * @param {boolean} stopColumnBuild Prevents the buildColumn callback from being triggered. This is useful to improve + * performance of the grid during initial load. + */ + Grid.prototype.addRowHeaderColumn = function addRowHeaderColumn(colDef, order, stopColumnBuild) { + var self = this; + + // default order + if (order === undefined) { + order = 0; + } + + var rowHeaderCol = new GridColumn(colDef, gridUtil.nextUid(), self); + rowHeaderCol.isRowHeader = true; + if (self.isRTL()) { + self.createRightContainer(); + rowHeaderCol.renderContainer = 'right'; + } + else { + self.createLeftContainer(); + rowHeaderCol.renderContainer = 'left'; + } + + // relies on the default column builder being first in array, as it is instantiated + // as part of grid creation + self.columnBuilders[0](colDef,rowHeaderCol,self.options) + .then(function() { + rowHeaderCol.enableFiltering = false; + rowHeaderCol.enableSorting = false; + rowHeaderCol.enableHiding = false; + rowHeaderCol.headerPriority = order; + self.rowHeaderColumns.push(rowHeaderCol); + self.rowHeaderColumns = self.rowHeaderColumns.sort(function (a, b) { + return a.headerPriority - b.headerPriority; + }); + + if (!stopColumnBuild) { + self.buildColumns() + .then(function() { + self.preCompileCellTemplates(); + self.queueGridRefresh(); + }).catch(angular.noop); + } + }).catch(angular.noop); + }; + + /** + * @ngdoc function + * @name getOnlyDataColumns + * @methodOf ui.grid.class:Grid + * @description returns all columns except for rowHeader columns + */ + Grid.prototype.getOnlyDataColumns = function getOnlyDataColumns() { + var self = this, + cols = []; + + self.columns.forEach(function (col) { + if (self.rowHeaderColumns.indexOf(col) === -1) { + cols.push(col); + } + }); + return cols; + }; + + /** + * @ngdoc function + * @name buildColumns + * @methodOf ui.grid.class:Grid + * @description creates GridColumn objects from the columnDefinition. Calls each registered + * columnBuilder to further process the column + * @param {object} opts An object contains options to use when building columns + * + * * **orderByColumnDefs**: defaults to **false**. When true, `buildColumns` will reorder existing columns according to the order within the column definitions. + * + * @returns {Promise} a promise to load any needed column resources + */ + Grid.prototype.buildColumns = function buildColumns(opts) { + var options = { + orderByColumnDefs: false + }; + + angular.extend(options, opts); + + // gridUtil.logDebug('buildColumns'); + var self = this; + var builderPromises = []; + var headerOffset = self.rowHeaderColumns.length; + var i; + + // Remove any columns for which a columnDef cannot be found + // Deliberately don't use forEach, as it doesn't like splice being called in the middle + // Also don't cache columns.length, as it will change during this operation + for (i = 0; i < self.columns.length; i++) { + if (!self.getColDef(self.columns[i].name)) { + self.columns.splice(i, 1); + i--; + } + } + + // add row header columns to the grid columns array _after_ columns without columnDefs have been removed + // rowHeaderColumns is ordered by priority so insert in reverse + for (var j = self.rowHeaderColumns.length - 1; j >= 0; j--) { + self.columns.unshift(self.rowHeaderColumns[j]); + } + + // look at each column def, and update column properties to match. If the column def + // doesn't have a column, then splice in a new gridCol + self.options.columnDefs.forEach(function (colDef, index) { + self.preprocessColDef(colDef); + var col = self.getColumn(colDef.name); + + if (!col) { + col = new GridColumn(colDef, gridUtil.nextUid(), self); + self.columns.splice(index + headerOffset, 0, col); + } + else { + // tell updateColumnDef that the column was pre-existing + col.updateColumnDef(colDef, false); + } + + self.columnBuilders.forEach(function (builder) { + builderPromises.push(builder.call(self, colDef, col, self.options)); + }); + }); + + /*** Reorder columns if necessary ***/ + if (!!options.orderByColumnDefs) { + // Create a shallow copy of the columns as a cache + var columnCache = self.columns.slice(0); + + // We need to allow for the "row headers" when mapping from the column defs array to the columns array + // If we have a row header in columns[0] and don't account for it we'll overwrite it with the column in columnDefs[0] + + // Go through all the column defs, use the shorter of columns length and colDefs.length because if a user has given two columns the same name then + // columns will be shorter than columnDefs. In this situation we'll avoid an error, but the user will still get an unexpected result + var len = Math.min(self.options.columnDefs.length, self.columns.length); + for (i = 0; i < len; i++) { + // If the column at this index has a different name than the column at the same index in the column defs... + if (self.columns[i + headerOffset].name !== self.options.columnDefs[i].name) { + // Replace the one in the cache with the appropriate column + columnCache[i + headerOffset] = self.getColumn(self.options.columnDefs[i].name); + } + else { + // Otherwise just copy over the one from the initial columns + columnCache[i + headerOffset] = self.columns[i + headerOffset]; + } + } + + // Empty out the columns array, non-destructively + self.columns.length = 0; + + // And splice in the updated, ordered columns from the cache + Array.prototype.splice.apply(self.columns, [0, 0].concat(columnCache)); + } + + return $q.all(builderPromises).then(function() { + if (self.rows.length > 0) { + self.assignTypes(); + } + if (options.preCompileCellTemplates) { + self.preCompileCellTemplates(); + } + }).catch(angular.noop); + }; + + Grid.prototype.preCompileCellTemplate = function(col) { + var self = this; + var html = col.cellTemplate.replace(uiGridConstants.MODEL_COL_FIELD, self.getQualifiedColField(col)); + html = html.replace(uiGridConstants.COL_FIELD, 'grid.getCellValue(row, col)'); + + col.compiledElementFn = $compile(html); + + if (col.compiledElementFnDefer) { + col.compiledElementFnDefer.resolve(col.compiledElementFn); + } + }; + +/** + * @ngdoc function + * @name preCompileCellTemplates + * @methodOf ui.grid.class:Grid + * @description precompiles all cell templates + */ + Grid.prototype.preCompileCellTemplates = function() { + var self = this; + self.columns.forEach(function (col) { + if ( col.cellTemplate ) { + self.preCompileCellTemplate( col ); + } else if ( col.cellTemplatePromise ) { + col.cellTemplatePromise.then( function() { + self.preCompileCellTemplate( col ); + }).catch(angular.noop); + } + }); + }; + + /** + * @ngdoc function + * @name getGridQualifiedColField + * @methodOf ui.grid.class:Grid + * @description Returns the $parse-able accessor for a column within its $scope + * @param {GridColumn} col col object + */ + Grid.prototype.getQualifiedColField = function (col) { + var base = 'row.entity'; + if ( col.field === uiGridConstants.ENTITY_BINDING ) { + return base; + } + return gridUtil.preEval(base + '.' + col.field); + }; + + /** + * @ngdoc function + * @name createLeftContainer + * @methodOf ui.grid.class:Grid + * @description creates the left render container if it doesn't already exist + */ + Grid.prototype.createLeftContainer = function() { + if (!this.hasLeftContainer()) { + this.renderContainers.left = new GridRenderContainer('left', this, { disableColumnOffset: true }); + } + }; + + /** + * @ngdoc function + * @name createRightContainer + * @methodOf ui.grid.class:Grid + * @description creates the right render container if it doesn't already exist + */ + Grid.prototype.createRightContainer = function() { + if (!this.hasRightContainer()) { + this.renderContainers.right = new GridRenderContainer('right', this, { disableColumnOffset: true }); + } + }; + + /** + * @ngdoc function + * @name hasLeftContainer + * @methodOf ui.grid.class:Grid + * @description returns true if leftContainer exists + */ + Grid.prototype.hasLeftContainer = function() { + return this.renderContainers.left !== undefined; + }; + + /** + * @ngdoc function + * @name hasRightContainer + * @methodOf ui.grid.class:Grid + * @description returns true if rightContainer exists + */ + Grid.prototype.hasRightContainer = function() { + return this.renderContainers.right !== undefined; + }; + + + /** + * undocumented function + * @name preprocessColDef + * @methodOf ui.grid.class:Grid + * @description defaults the name property from field to maintain backwards compatibility with 2.x + * validates that name or field is present + */ + Grid.prototype.preprocessColDef = function preprocessColDef(colDef) { + var self = this; + + if (!colDef.field && !colDef.name) { + throw new Error('colDef.name or colDef.field property is required'); + } + + // maintain backwards compatibility with 2.x + // field was required in 2.x. now name is required + if (colDef.name === undefined && colDef.field !== undefined) { + // See if the column name already exists: + var newName = colDef.field, + counter = 2; + while (self.getColumn(newName)) { + newName = colDef.field + counter.toString(); + counter++; + } + colDef.name = newName; + } + }; + + // Return a list of items that exist in the `n` array but not the `o` array. Uses optional property accessors passed as third & fourth parameters + Grid.prototype.newInN = function newInN(o, n, oAccessor, nAccessor) { + var self = this; + + var t = []; + for (var i = 0; i < n.length; i++) { + var nV = nAccessor ? n[i][nAccessor] : n[i]; + + var found = false; + for (var j = 0; j < o.length; j++) { + var oV = oAccessor ? o[j][oAccessor] : o[j]; + if (self.options.rowEquality(nV, oV)) { + found = true; + break; + } + } + if (!found) { + t.push(nV); + } + } + + return t; + }; + + /** + * @ngdoc function + * @name getRow + * @methodOf ui.grid.class:Grid + * @description returns the GridRow that contains the rowEntity + * @param {object} rowEntity the gridOptions.data array element instance + * @param {array} lookInRows [optional] the rows to look in - if not provided then + * looks in grid.rows + */ + Grid.prototype.getRow = function getRow(rowEntity, lookInRows) { + var self = this; + + lookInRows = typeof(lookInRows) === 'undefined' ? self.rows : lookInRows; + + var rows = lookInRows.filter(function (row) { + return self.options.rowEquality(row.entity, rowEntity); + }); + return rows.length > 0 ? rows[0] : null; + }; + + + /** + * @ngdoc function + * @name modifyRows + * @methodOf ui.grid.class:Grid + * @description creates or removes GridRow objects from the newRawData array. Calls each registered + * rowBuilder to further process the row + * @param {array} newRawData Modified set of data + * + * This method aims to achieve three things: + * 1. the resulting rows array is in the same order as the newRawData, we'll call + * rowsProcessors immediately after to sort the data anyway + * 2. if we have row hashing available, we try to use the rowHash to find the row + * 3. no memory leaks - rows that are no longer in newRawData need to be garbage collected + * + * The basic logic flow makes use of the newRawData, oldRows and oldHash, and creates + * the newRows and newHash + * + * ``` + * newRawData.forEach newEntity + * if (hashing enabled) + * check oldHash for newEntity + * else + * look for old row directly in oldRows + * if !oldRowFound // must be a new row + * create newRow + * append to the newRows and add to newHash + * run the processors + * ``` + * + * Rows are identified using the hashKey if configured. If not configured, then rows + * are identified using the gridOptions.rowEquality function + * + * This method is useful when trying to select rows immediately after loading data without + * using a $timeout/$interval, e.g.: + * + * $scope.gridOptions.data = someData; + * $scope.gridApi.grid.modifyRows($scope.gridOptions.data); + * $scope.gridApi.selection.selectRow($scope.gridOptions.data[0]); + * + * OR to persist row selection after data update (e.g. rows selected, new data loaded, want + * originally selected rows to be re-selected)) + */ + Grid.prototype.modifyRows = function modifyRows(newRawData) { + var self = this; + var oldRows = self.rows.slice(0); + var oldRowHash = self.rowHashMap || self.createRowHashMap(); + var allRowsSelected = true; + self.rowHashMap = self.createRowHashMap(); + self.rows.length = 0; + + newRawData.forEach( function( newEntity, i ) { + var newRow, oldRow; + + if ( self.options.enableRowHashing ) { + // if hashing is enabled, then this row will be in the hash if we already know about it + oldRow = oldRowHash.get( newEntity ); + } else { + // otherwise, manually search the oldRows to see if we can find this row + oldRow = self.getRow(newEntity, oldRows); + } + + // update newRow to have an entity + if ( oldRow ) { + newRow = oldRow; + newRow.entity = newEntity; + } + + // if we didn't find the row, it must be new, so create it + if ( !newRow ) { + newRow = self.processRowBuilders(new GridRow(newEntity, i, self)); + } + + self.rows.push( newRow ); + self.rowHashMap.put( newEntity, newRow ); + if (!newRow.isSelected) { + allRowsSelected = false; + } + }); + + if (self.selection && self.rows.length) { + self.selection.selectAll = allRowsSelected; + } + + self.assignTypes(); + + var p1 = $q.when(self.processRowsProcessors(self.rows)) + .then(function (renderableRows) { + return self.setVisibleRows(renderableRows); + }).catch(angular.noop); + + var p2 = $q.when(self.processColumnsProcessors(self.columns)) + .then(function (renderableColumns) { + return self.setVisibleColumns(renderableColumns); + }).catch(angular.noop); + + return $q.all([p1, p2]); + }; + + + /** + * Private Undocumented Method + * @name addRows + * @methodOf ui.grid.class:Grid + * @description adds the newRawData array of rows to the grid and calls all registered + * rowBuilders. this keyword will reference the grid + */ + Grid.prototype.addRows = function addRows(newRawData) { + var self = this, + existingRowCount = self.rows.length; + + for (var i = 0; i < newRawData.length; i++) { + var newRow = self.processRowBuilders(new GridRow(newRawData[i], i + existingRowCount, self)); + + if (self.options.enableRowHashing) { + var found = self.rowHashMap.get(newRow.entity); + if (found) { + found.row = newRow; + } + } + + self.rows.push(newRow); + } + }; + + /** + * @ngdoc function + * @name processRowBuilders + * @methodOf ui.grid.class:Grid + * @description processes all RowBuilders for the gridRow + * @param {GridRow} gridRow reference to gridRow + * @returns {GridRow} the gridRow with all additional behavior added + */ + Grid.prototype.processRowBuilders = function processRowBuilders(gridRow) { + var self = this; + + self.rowBuilders.forEach(function (builder) { + builder.call(self, gridRow, self.options); + }); + + return gridRow; + }; + + /** + * @ngdoc function + * @name registerStyleComputation + * @methodOf ui.grid.class:Grid + * @description registered a styleComputation function + * + * If the function returns a value it will be appended into the grid's ` "
+ );
+
+
+ $templateCache.put('ui-grid/uiGridCell',
+ " {{COL_FIELD CUSTOM_FILTERS}} "
+ );
+
+
+ $templateCache.put('ui-grid/uiGridColumnMenu',
+ ""
+ );
+
+
+ $templateCache.put('ui-grid/uiGridFooterCell',
+ " {{ col.getAggregationText() + ( col.getAggregationValue() CUSTOM_FILTERS ) }} {{ col.displayName CUSTOM_FILTERS }} {{col.sort.priority + 1}} t&&(e.sort.priority-=1)}),this.sort={},this.grid.api.core.raise.sortChanged(this.grid,this.grid.getColumnSorting())},t.prototype.getColClass=function(e){var t=u.COL_CLASS_PREFIX+this.uid;return e?"."+t:t},t.prototype.isPinnedLeft=function(){return"left"===this.renderContainer},t.prototype.isPinnedRight=function(){return"right"===this.renderContainer},t.prototype.getColClassDefinition=function(){return" .grid"+this.grid.id+" "+this.getColClass(!0)+" { min-width: "+this.drawnWidth+"px; max-width: "+this.drawnWidth+"px; }"},t.prototype.getRenderContainer=function(){var e=this.renderContainer;return null!==e&&""!==e&&void 0!==e||(e="body"),this.grid.renderContainers[e]},t.prototype.showColumn=function(){this.colDef.visible=!0},t.prototype.getAggregationText=function(){if(this.colDef.aggregationHideLabel)return"";if(this.colDef.aggregationLabel)return this.colDef.aggregationLabel;switch(this.colDef.aggregationType){case u.aggregationTypes.count:return e.getSafeText("aggregation.count");case u.aggregationTypes.sum:return e.getSafeText("aggregation.sum");case u.aggregationTypes.avg:return e.getSafeText("aggregation.avg");case u.aggregationTypes.min:return e.getSafeText("aggregation.min");case u.aggregationTypes.max:return e.getSafeText("aggregation.max");default:return""}},t.prototype.getCellTemplate=function(){return this.cellTemplatePromise},t.prototype.getCompiledElementFn=function(){return this.compiledElementFnDefer.promise},t}]),angular.module("ui.grid").factory("GridOptions",["gridUtil","uiGridConstants",function(t,r){return{initialize:function(e){return e.onRegisterApi=e.onRegisterApi||angular.noop(),e.data=e.data||[],e.columnDefs=e.columnDefs||[],e.excludeProperties=e.excludeProperties||["$$hashKey"],e.enableRowHashing=!1!==e.enableRowHashing,e.rowIdentity=e.rowIdentity||function(e){return t.hashKey(e)},e.getRowIdentity=e.getRowIdentity||function(e){return e.$$hashKey},e.flatEntityAccess=!0===e.flatEntityAccess,e.showHeader=void 0===e.showHeader||e.showHeader,e.showHeader?e.headerRowHeight=void 0!==e.headerRowHeight?e.headerRowHeight:30:e.headerRowHeight=0,"string"==typeof e.rowHeight?e.rowHeight=parseInt(e.rowHeight)||30:e.rowHeight=e.rowHeight||30,e.minRowsToShow=void 0!==e.minRowsToShow?e.minRowsToShow:10,e.showGridFooter=!0===e.showGridFooter,e.showColumnFooter=!0===e.showColumnFooter,e.columnFooterHeight=void 0!==e.columnFooterHeight?e.columnFooterHeight:30,e.gridFooterHeight=void 0!==e.gridFooterHeight?e.gridFooterHeight:30,e.columnWidth=void 0!==e.columnWidth?e.columnWidth:50,e.maxVisibleColumnCount=void 0!==e.maxVisibleColumnCount?e.maxVisibleColumnCount:200,e.virtualizationThreshold=void 0!==e.virtualizationThreshold?e.virtualizationThreshold:20,e.columnVirtualizationThreshold=void 0!==e.columnVirtualizationThreshold?e.columnVirtualizationThreshold:10,e.excessRows=void 0!==e.excessRows?e.excessRows:4,e.scrollThreshold=void 0!==e.scrollThreshold?e.scrollThreshold:4,e.excessColumns=void 0!==e.excessColumns?e.excessColumns:4,e.aggregationCalcThrottle=void 0!==e.aggregationCalcThrottle?e.aggregationCalcThrottle:500,e.wheelScrollThrottle=void 0!==e.wheelScrollThrottle?e.wheelScrollThrottle:70,e.scrollDebounce=void 0!==e.scrollDebounce?e.scrollDebounce:300,e.enableSorting=!1!==e.enableSorting,e.enableFiltering=!0===e.enableFiltering,e.filterContainer=void 0!==e.filterContainer?e.filterContainer:"headerCell",e.enableColumnMenus=!1!==e.enableColumnMenus,e.enableVerticalScrollbar=void 0!==e.enableVerticalScrollbar?e.enableVerticalScrollbar:r.scrollbars.ALWAYS,e.enableHorizontalScrollbar=void 0!==e.enableHorizontalScrollbar?e.enableHorizontalScrollbar:r.scrollbars.ALWAYS,e.enableMinHeightCheck=!1!==e.enableMinHeightCheck,e.minimumColumnSize=void 0!==e.minimumColumnSize?e.minimumColumnSize:30,e.rowEquality=e.rowEquality||function(e,t){return e===t},e.headerTemplate=e.headerTemplate||null,e.footerTemplate=e.footerTemplate||"ui-grid/ui-grid-footer",e.gridFooterTemplate=e.gridFooterTemplate||"ui-grid/ui-grid-grid-footer",e.rowTemplate=e.rowTemplate||"ui-grid/ui-grid-row",e.gridMenuTemplate=e.gridMenuTemplate||"ui-grid/uiGridMenu",e.menuButtonTemplate=e.menuButtonTemplate||"ui-grid/ui-grid-menu-button",e.menuItemTemplate=e.menuItemTemplate||"ui-grid/uiGridMenuItem",e.appScopeProvider=e.appScopeProvider||null,e}}}]),angular.module("ui.grid").factory("GridRenderContainer",["gridUtil","uiGridConstants",function(y,n){function e(e,t,r){var i=this;i.name=e,i.grid=t,i.visibleRowCache=[],i.visibleColumnCache=[],i.renderedRows=[],i.renderedColumns=[],i.prevScrollTop=0,i.prevScrolltopPercentage=0,i.prevRowScrollIndex=0,i.prevScrollLeft=0,i.prevScrollleftPercentage=0,i.prevColumnScrollIndex=0,i.columnStyles="",i.viewportAdjusters=[],i.hasHScrollbar=!1,i.hasVScrollbar=!1,i.canvasHeightShouldUpdate=!0,i.$$canvasHeight=0,r&&angular.isObject(r)&&angular.extend(i,r),t.registerStyleComputation({priority:5,func:function(){return i.updateColumnWidths(),i.columnStyles}})}return e.prototype.reset=function(){this.visibleColumnCache.length=0,this.visibleRowCache.length=0,this.renderedRows.length=0,this.renderedColumns.length=0},e.prototype.containsColumn=function(e){return-1!==this.visibleColumnCache.indexOf(e)},e.prototype.minRowsToRender=function(){for(var e=0,t=0,r=this.getViewportHeight(),i=this.visibleRowCache.length-1;t Validators from this external service have a higher priority than default
+ * ones
+ * @param {function} externalFactoryFunction a function that accepts name and argument to pass to a
+ * validator factory and that returns an object with the same properties as
+ * you can see in {@link ui.grid.validate.service:uiGridValidateService#properties_validatorFactories validatorFactories}
+ */
+ setExternalFactoryFunction: function(externalFactoryFunction) {
+ service.externalFactoryFunction = externalFactoryFunction;
+ },
+
+ /**
+ * @ngdoc service
+ * @name clearExternalFactory
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Removes any link to external factory from this service
+ */
+ clearExternalFactory: function() {
+ delete service.externalFactoryFunction;
+ },
+
+ /**
+ * @ngdoc service
+ * @name getValidatorFromExternalFactory
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Retrieves a validator by executing a validatorFactory
+ * stored in an external service.
+ * @param {string} name the name of the validator to retrieve
+ * @param {object} argument an argument to pass to the validator factory
+ */
+ getValidatorFromExternalFactory: function(name, argument) {
+ return service.externalFactoryFunction(name, argument).validatorFactory(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name getMessageFromExternalFactory
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Retrieves a message stored in an external service.
+ * @param {string} name the name of the validator
+ * @param {object} argument an argument to pass to the message function
+ */
+ getMessageFromExternalFactory: function(name, argument) {
+ return service.externalFactoryFunction(name, argument).messageFunction(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name setValidator
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Adds a new validator to the service
+ * @param {string} name the name of the validator, must be unique
+ * @param {function} validatorFactory a factory that return a validatorFunction
+ * @param {function} messageFunction a function that return the error message
+ */
+ setValidator: function(name, validatorFactory, messageFunction) {
+ service.validatorFactories[name] = {
+ validatorFactory: validatorFactory,
+ messageFunction: messageFunction
+ };
+ },
+
+ /**
+ * @ngdoc service
+ * @name getValidator
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Returns a validator registered to the service
+ * or retrieved from the external factory
+ * @param {string} name the name of the validator to retrieve
+ * @param {object} argument an argument to pass to the validator factory
+ * @returns {object} the validator function
+ */
+ getValidator: function(name, argument) {
+ if (service.externalFactoryFunction) {
+ var validator = service.getValidatorFromExternalFactory(name, argument);
+ if (validator) {
+ return validator;
+ }
+ }
+ if (!service.validatorFactories[name]) {
+ throw ("Invalid validator name: " + name);
+ }
+ return service.validatorFactories[name].validatorFactory(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name getMessage
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Returns the error message related to the validator
+ * @param {string} name the name of the validator
+ * @param {object} argument an argument to pass to the message function
+ * @returns {string} the error message related to the validator
+ */
+ getMessage: function(name, argument) {
+ if (service.externalFactoryFunction) {
+ var message = service.getMessageFromExternalFactory(name, argument);
+ if (message) {
+ return message;
+ }
+ }
+ return service.validatorFactories[name].messageFunction(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name isInvalid
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Returns true if the cell (identified by rowEntity, colDef) is invalid
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ * @returns {boolean} true if the cell is invalid
+ */
+ isInvalid: function (rowEntity, colDef) {
+ return rowEntity['$$invalid'+colDef.name];
+ },
+
+ /**
+ * @ngdoc service
+ * @name setInvalid
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Makes the cell invalid by adding the proper field to the entity
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ */
+ setInvalid: function (rowEntity, colDef) {
+ rowEntity['$$invalid'+colDef.name] = true;
+ },
+
+ /**
+ * @ngdoc service
+ * @name setValid
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Makes the cell valid by removing the proper error field from the entity
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ */
+ setValid: function (rowEntity, colDef) {
+ delete rowEntity['$$invalid'+colDef.name];
+ },
+
+ /**
+ * @ngdoc service
+ * @name setError
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Adds the proper error to the entity errors field
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ * @param {string} validatorName the name of the validator that is failing
+ */
+ setError: function(rowEntity, colDef, validatorName) {
+ if (!rowEntity['$$errors'+colDef.name]) {
+ rowEntity['$$errors'+colDef.name] = {};
+ }
+ rowEntity['$$errors'+colDef.name][validatorName] = true;
+ },
+
+ /**
+ * @ngdoc service
+ * @name clearError
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Removes the proper error from the entity errors field
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ * @param {string} validatorName the name of the validator that is failing
+ */
+ clearError: function(rowEntity, colDef, validatorName) {
+ if (!rowEntity['$$errors'+colDef.name]) {
+ return;
+ }
+ if (validatorName in rowEntity['$$errors'+colDef.name]) {
+ delete rowEntity['$$errors'+colDef.name][validatorName];
+ }
+ },
+
+ /**
+ * @ngdoc function
+ * @name getErrorMessages
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description returns an array of i18n-ed error messages.
+ * @param {object} rowEntity gridOptions.data[] array instance whose errors we are looking for
+ * @param {object} colDef the column whose errors we are looking for
+ * @returns {array} An array of strings containing all the error messages for the cell
+ */
+ getErrorMessages: function(rowEntity, colDef) {
+ var errors = [];
+
+ if (!rowEntity['$$errors'+colDef.name] || Object.keys(rowEntity['$$errors'+colDef.name]).length === 0) {
+ return errors;
+ }
+
+ Object.keys(rowEntity['$$errors'+colDef.name]).sort().forEach(function(validatorName) {
+ errors.push(service.getMessage(validatorName, colDef.validators[validatorName]));
+ });
+
+ return errors;
+ },
+
+ /**
+ * @ngdoc function
+ * @name getFormattedErrors
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description returns the error i18n-ed and formatted in html to be shown inside the page.
+ * @param {object} rowEntity gridOptions.data[] array instance whose errors we are looking for
+ * @param {object} colDef the column whose errors we are looking for
+ * @returns {object} An object that can be used in a template (like a cellTemplate) to display the
+ * message inside the page (i.e. inside a div)
+ */
+ getFormattedErrors: function(rowEntity, colDef) {
+ var msgString = "",
+ errors = service.getErrorMessages(rowEntity, colDef);
+
+ if (!errors.length) {
+ return;
+ }
+
+ errors.forEach(function(errorMsg) {
+ msgString += errorMsg + " ' + i18nService.getSafeText('validate.error') + ' "+n.getSafeText("validate.error")+" t&&(e.sort.priority-=1)}),this.sort={},this.grid.api.core.raise.sortChanged(this.grid,this.grid.getColumnSorting())},t.prototype.getColClass=function(e){var t=u.COL_CLASS_PREFIX+this.uid;return e?"."+t:t},t.prototype.isPinnedLeft=function(){return"left"===this.renderContainer},t.prototype.isPinnedRight=function(){return"right"===this.renderContainer},t.prototype.getColClassDefinition=function(){return" .grid"+this.grid.id+" "+this.getColClass(!0)+" { min-width: "+this.drawnWidth+"px; max-width: "+this.drawnWidth+"px; }"},t.prototype.getRenderContainer=function(){var e=this.renderContainer;return null!==e&&""!==e&&void 0!==e||(e="body"),this.grid.renderContainers[e]},t.prototype.showColumn=function(){this.colDef.visible=!0},t.prototype.getAggregationText=function(){if(this.colDef.aggregationHideLabel)return"";if(this.colDef.aggregationLabel)return this.colDef.aggregationLabel;switch(this.colDef.aggregationType){case u.aggregationTypes.count:return e.getSafeText("aggregation.count");case u.aggregationTypes.sum:return e.getSafeText("aggregation.sum");case u.aggregationTypes.avg:return e.getSafeText("aggregation.avg");case u.aggregationTypes.min:return e.getSafeText("aggregation.min");case u.aggregationTypes.max:return e.getSafeText("aggregation.max");default:return""}},t.prototype.getCellTemplate=function(){return this.cellTemplatePromise},t.prototype.getCompiledElementFn=function(){return this.compiledElementFnDefer.promise},t}]),angular.module("ui.grid").factory("GridOptions",["gridUtil","uiGridConstants",function(t,r){return{initialize:function(e){return e.onRegisterApi=e.onRegisterApi||angular.noop(),e.data=e.data||[],e.columnDefs=e.columnDefs||[],e.excludeProperties=e.excludeProperties||["$$hashKey"],e.enableRowHashing=!1!==e.enableRowHashing,e.rowIdentity=e.rowIdentity||function(e){return t.hashKey(e)},e.getRowIdentity=e.getRowIdentity||function(e){return e.$$hashKey},e.flatEntityAccess=!0===e.flatEntityAccess,e.showHeader=void 0===e.showHeader||e.showHeader,e.showHeader?e.headerRowHeight=void 0!==e.headerRowHeight?e.headerRowHeight:30:e.headerRowHeight=0,"string"==typeof e.rowHeight?e.rowHeight=parseInt(e.rowHeight)||30:e.rowHeight=e.rowHeight||30,e.minRowsToShow=void 0!==e.minRowsToShow?e.minRowsToShow:10,e.showGridFooter=!0===e.showGridFooter,e.showColumnFooter=!0===e.showColumnFooter,e.columnFooterHeight=void 0!==e.columnFooterHeight?e.columnFooterHeight:30,e.gridFooterHeight=void 0!==e.gridFooterHeight?e.gridFooterHeight:30,e.columnWidth=void 0!==e.columnWidth?e.columnWidth:50,e.maxVisibleColumnCount=void 0!==e.maxVisibleColumnCount?e.maxVisibleColumnCount:200,e.virtualizationThreshold=void 0!==e.virtualizationThreshold?e.virtualizationThreshold:20,e.columnVirtualizationThreshold=void 0!==e.columnVirtualizationThreshold?e.columnVirtualizationThreshold:10,e.excessRows=void 0!==e.excessRows?e.excessRows:4,e.scrollThreshold=void 0!==e.scrollThreshold?e.scrollThreshold:4,e.excessColumns=void 0!==e.excessColumns?e.excessColumns:4,e.aggregationCalcThrottle=void 0!==e.aggregationCalcThrottle?e.aggregationCalcThrottle:500,e.wheelScrollThrottle=void 0!==e.wheelScrollThrottle?e.wheelScrollThrottle:70,e.scrollDebounce=void 0!==e.scrollDebounce?e.scrollDebounce:300,e.enableSorting=!1!==e.enableSorting,e.enableFiltering=!0===e.enableFiltering,e.filterContainer=void 0!==e.filterContainer?e.filterContainer:"headerCell",e.enableColumnMenus=!1!==e.enableColumnMenus,e.enableVerticalScrollbar=void 0!==e.enableVerticalScrollbar?e.enableVerticalScrollbar:r.scrollbars.ALWAYS,e.enableHorizontalScrollbar=void 0!==e.enableHorizontalScrollbar?e.enableHorizontalScrollbar:r.scrollbars.ALWAYS,e.enableMinHeightCheck=!1!==e.enableMinHeightCheck,e.minimumColumnSize=void 0!==e.minimumColumnSize?e.minimumColumnSize:30,e.rowEquality=e.rowEquality||function(e,t){return e===t},e.headerTemplate=e.headerTemplate||null,e.footerTemplate=e.footerTemplate||"ui-grid/ui-grid-footer",e.gridFooterTemplate=e.gridFooterTemplate||"ui-grid/ui-grid-grid-footer",e.rowTemplate=e.rowTemplate||"ui-grid/ui-grid-row",e.gridMenuTemplate=e.gridMenuTemplate||"ui-grid/uiGridMenu",e.menuButtonTemplate=e.menuButtonTemplate||"ui-grid/ui-grid-menu-button",e.menuItemTemplate=e.menuItemTemplate||"ui-grid/uiGridMenuItem",e.appScopeProvider=e.appScopeProvider||null,e}}}]),angular.module("ui.grid").factory("GridRenderContainer",["gridUtil","uiGridConstants",function(y,n){function e(e,t,r){var i=this;i.name=e,i.grid=t,i.visibleRowCache=[],i.visibleColumnCache=[],i.renderedRows=[],i.renderedColumns=[],i.prevScrollTop=0,i.prevScrolltopPercentage=0,i.prevRowScrollIndex=0,i.prevScrollLeft=0,i.prevScrollleftPercentage=0,i.prevColumnScrollIndex=0,i.columnStyles="",i.viewportAdjusters=[],i.hasHScrollbar=!1,i.hasVScrollbar=!1,i.canvasHeightShouldUpdate=!0,i.$$canvasHeight=0,r&&angular.isObject(r)&&angular.extend(i,r),t.registerStyleComputation({priority:5,func:function(){return i.updateColumnWidths(),i.columnStyles}})}return e.prototype.reset=function(){this.visibleColumnCache.length=0,this.visibleRowCache.length=0,this.renderedRows.length=0,this.renderedColumns.length=0},e.prototype.containsColumn=function(e){return-1!==this.visibleColumnCache.indexOf(e)},e.prototype.minRowsToRender=function(){for(var e=0,t=0,r=this.getViewportHeight(),i=this.visibleRowCache.length-1;t "+o.getSafeText("validate.error")+" Validators from this external service have a higher priority than default
+ * ones
+ * @param {function} externalFactoryFunction a function that accepts name and argument to pass to a
+ * validator factory and that returns an object with the same properties as
+ * you can see in {@link ui.grid.validate.service:uiGridValidateService#properties_validatorFactories validatorFactories}
+ */
+ setExternalFactoryFunction: function(externalFactoryFunction) {
+ service.externalFactoryFunction = externalFactoryFunction;
+ },
+
+ /**
+ * @ngdoc service
+ * @name clearExternalFactory
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Removes any link to external factory from this service
+ */
+ clearExternalFactory: function() {
+ delete service.externalFactoryFunction;
+ },
+
+ /**
+ * @ngdoc service
+ * @name getValidatorFromExternalFactory
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Retrieves a validator by executing a validatorFactory
+ * stored in an external service.
+ * @param {string} name the name of the validator to retrieve
+ * @param {object} argument an argument to pass to the validator factory
+ */
+ getValidatorFromExternalFactory: function(name, argument) {
+ return service.externalFactoryFunction(name, argument).validatorFactory(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name getMessageFromExternalFactory
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Retrieves a message stored in an external service.
+ * @param {string} name the name of the validator
+ * @param {object} argument an argument to pass to the message function
+ */
+ getMessageFromExternalFactory: function(name, argument) {
+ return service.externalFactoryFunction(name, argument).messageFunction(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name setValidator
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Adds a new validator to the service
+ * @param {string} name the name of the validator, must be unique
+ * @param {function} validatorFactory a factory that return a validatorFunction
+ * @param {function} messageFunction a function that return the error message
+ */
+ setValidator: function(name, validatorFactory, messageFunction) {
+ service.validatorFactories[name] = {
+ validatorFactory: validatorFactory,
+ messageFunction: messageFunction
+ };
+ },
+
+ /**
+ * @ngdoc service
+ * @name getValidator
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Returns a validator registered to the service
+ * or retrieved from the external factory
+ * @param {string} name the name of the validator to retrieve
+ * @param {object} argument an argument to pass to the validator factory
+ * @returns {object} the validator function
+ */
+ getValidator: function(name, argument) {
+ if (service.externalFactoryFunction) {
+ var validator = service.getValidatorFromExternalFactory(name, argument);
+ if (validator) {
+ return validator;
+ }
+ }
+ if (!service.validatorFactories[name]) {
+ throw ("Invalid validator name: " + name);
+ }
+ return service.validatorFactories[name].validatorFactory(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name getMessage
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Returns the error message related to the validator
+ * @param {string} name the name of the validator
+ * @param {object} argument an argument to pass to the message function
+ * @returns {string} the error message related to the validator
+ */
+ getMessage: function(name, argument) {
+ if (service.externalFactoryFunction) {
+ var message = service.getMessageFromExternalFactory(name, argument);
+ if (message) {
+ return message;
+ }
+ }
+ return service.validatorFactories[name].messageFunction(argument);
+ },
+
+ /**
+ * @ngdoc service
+ * @name isInvalid
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Returns true if the cell (identified by rowEntity, colDef) is invalid
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ * @returns {boolean} true if the cell is invalid
+ */
+ isInvalid: function (rowEntity, colDef) {
+ return rowEntity['$$invalid'+colDef.name];
+ },
+
+ /**
+ * @ngdoc service
+ * @name setInvalid
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Makes the cell invalid by adding the proper field to the entity
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ */
+ setInvalid: function (rowEntity, colDef) {
+ rowEntity['$$invalid'+colDef.name] = true;
+ },
+
+ /**
+ * @ngdoc service
+ * @name setValid
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Makes the cell valid by removing the proper error field from the entity
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ */
+ setValid: function (rowEntity, colDef) {
+ delete rowEntity['$$invalid'+colDef.name];
+ },
+
+ /**
+ * @ngdoc service
+ * @name setError
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Adds the proper error to the entity errors field
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ * @param {string} validatorName the name of the validator that is failing
+ */
+ setError: function(rowEntity, colDef, validatorName) {
+ if (!rowEntity['$$errors'+colDef.name]) {
+ rowEntity['$$errors'+colDef.name] = {};
+ }
+ rowEntity['$$errors'+colDef.name][validatorName] = true;
+ },
+
+ /**
+ * @ngdoc service
+ * @name clearError
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description Removes the proper error from the entity errors field
+ * @param {object} rowEntity the row entity of the cell
+ * @param {object} colDef the colDef of the cell
+ * @param {string} validatorName the name of the validator that is failing
+ */
+ clearError: function(rowEntity, colDef, validatorName) {
+ if (!rowEntity['$$errors'+colDef.name]) {
+ return;
+ }
+ if (validatorName in rowEntity['$$errors'+colDef.name]) {
+ delete rowEntity['$$errors'+colDef.name][validatorName];
+ }
+ },
+
+ /**
+ * @ngdoc function
+ * @name getErrorMessages
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description returns an array of i18n-ed error messages.
+ * @param {object} rowEntity gridOptions.data[] array instance whose errors we are looking for
+ * @param {object} colDef the column whose errors we are looking for
+ * @returns {array} An array of strings containing all the error messages for the cell
+ */
+ getErrorMessages: function(rowEntity, colDef) {
+ var errors = [];
+
+ if (!rowEntity['$$errors'+colDef.name] || Object.keys(rowEntity['$$errors'+colDef.name]).length === 0) {
+ return errors;
+ }
+
+ Object.keys(rowEntity['$$errors'+colDef.name]).sort().forEach(function(validatorName) {
+ errors.push(service.getMessage(validatorName, colDef.validators[validatorName]));
+ });
+
+ return errors;
+ },
+
+ /**
+ * @ngdoc function
+ * @name getFormattedErrors
+ * @methodOf ui.grid.validate.service:uiGridValidateService
+ * @description returns the error i18n-ed and formatted in html to be shown inside the page.
+ * @param {object} rowEntity gridOptions.data[] array instance whose errors we are looking for
+ * @param {object} colDef the column whose errors we are looking for
+ * @returns {object} An object that can be used in a template (like a cellTemplate) to display the
+ * message inside the page (i.e. inside a div)
+ */
+ getFormattedErrors: function(rowEntity, colDef) {
+ var msgString = "",
+ errors = service.getErrorMessages(rowEntity, colDef);
+
+ if (!errors.length) {
+ return;
+ }
+
+ errors.forEach(function(errorMsg) {
+ msgString += errorMsg + " ' + i18nService.getSafeText('validate.error') + ' "+n.getSafeText("validate.error")+" "+o.getSafeText("validate.error")+" "+o.getSafeText("validate.error")+" |