1
1
( function ( ) {
2
2
'use strict' ;
3
+
4
+ /**
5
+ * @ngdoc object
6
+ * @name ui.grid.service:uiGridConstants
7
+ * @description Constants for use across many grid features
8
+ *
9
+ */
10
+
11
+
3
12
angular . module ( 'ui.grid' ) . constant ( 'uiGridConstants' , {
4
13
LOG_DEBUG_MESSAGES : true ,
5
14
LOG_WARN_MESSAGES : true ,
62
71
F11 : 122 ,
63
72
F12 : 123
64
73
} ,
74
+ /**
75
+ * @ngdoc object
76
+ * @name ASC
77
+ * @propertyOf ui.grid.service:uiGridConstants
78
+ * @description Used in {@link ui.grid.class:GridOptions.columnDef#properties_sort columnDef.sort} and
79
+ * {@link ui.grid.class:GridOptions.columnDef#properties_sortDirectionCycle columnDef.sortDirectionCycle}
80
+ * to configure the sorting direction of the column
81
+ */
65
82
ASC : 'asc' ,
83
+ /**
84
+ * @ngdoc object
85
+ * @name DESC
86
+ * @propertyOf ui.grid.service:uiGridConstants
87
+ * @description Used in {@link ui.grid.class:GridOptions.columnDef#properties_sort columnDef.sort} and
88
+ * {@link ui.grid.class:GridOptions.columnDef#properties_sortDirectionCycle columnDef.sortDirectionCycle}
89
+ * to configure the sorting direction of the column
90
+ */
66
91
DESC : 'desc' ,
92
+
93
+
94
+ /**
95
+ * @ngdoc object
96
+ * @name filter
97
+ * @propertyOf ui.grid.service:uiGridConstants
98
+ * @description Used in {@link ui.grid.class:GridOptions.columnDef#properties_filter columnDef.filter}
99
+ * to configure filtering on the column
100
+ *
101
+ * `SELECT` and `INPUT` are used with the `type` property of the filter, the rest are used to specify
102
+ * one of the built-in conditions.
103
+ *
104
+ * Available `condition` options are:
105
+ * - `uiGridConstants.filter.STARTS_WITH`
106
+ * - `uiGridConstants.filter.ENDS_WITH`
107
+ * - `uiGridConstants.filter.CONTAINS`
108
+ * - `uiGridConstants.filter.GREATER_THAN`
109
+ * - `uiGridConstants.filter.GREATER_THAN_OR_EQUAL`
110
+ * - `uiGridConstants.filter.LESS_THAN`
111
+ * - `uiGridConstants.filter.LESS_THAN_OR_EQUAL`
112
+ * - `uiGridConstants.filter.NOT_EQUAL`
113
+ * - `uiGridConstants.filter.STARTS_WITH`
114
+ *
115
+ *
116
+ * Available `type` options are:
117
+ * - `uiGridConstants.filter.SELECT` - use a dropdown box for the cell header filter field
118
+ * - `uiGridConstants.filter.INPUT` - use a text box for the cell header filter field
119
+ */
67
120
filter : {
68
121
STARTS_WITH : 2 ,
69
122
ENDS_WITH : 4 ,
78
131
INPUT : 'input'
79
132
} ,
80
133
134
+ /**
135
+ * @ngdoc object
136
+ * @name aggregationTypes
137
+ * @propertyOf ui.grid.service:uiGridConstants
138
+ * @description Used in {@link ui.grid.class:GridOptions.columnDef#properties_aggregationType columnDef.aggregationType}
139
+ * to specify the type of built-in aggregation the column should use.
140
+ *
141
+ * Available options are:
142
+ * - `uiGridConstants.aggregationTypes.sum` - add the values in this column to produce the aggregated value
143
+ * - `uiGridConstants.aggregationTypes.count` - count the number of rows to produce the aggregated value
144
+ * - `uiGridConstants.aggregationTypes.avg` - average the values in this column to produce the aggregated value
145
+ * - `uiGridConstants.aggregationTypes.min` - use the minimum value in this column as the aggregated value
146
+ * - `uiGridConstants.aggregationTypes.max` - use the maximum value in this column as the aggregated value
147
+ */
81
148
aggregationTypes : {
82
149
sum : 2 ,
83
150
count : 4 ,
89
156
// TODO(c0bra): Create full list of these somehow. NOTE: do any allow a space before or after them?
90
157
CURRENCY_SYMBOLS : [ 'ƒ' , '$' , '£' , '$' , '¤' , '¥' , '៛' , '₩' , '₱' , '฿' , '₫' ] ,
91
158
159
+ /**
160
+ * @ngdoc object
161
+ * @name scrollDirection
162
+ * @propertyOf ui.grid.service:uiGridConstants
163
+ * @description Set on {@link ui.grid.class:Grid#properties_scrollDirection Grid.scrollDirection},
164
+ * to indicate the direction the grid is currently scrolling in
165
+ *
166
+ * Available options are:
167
+ * - `uiGridConstants.scrollDirection.UP` - set when the grid is scrolling up
168
+ * - `uiGridConstants.scrollDirection.DOWN` - set when the grid is scrolling down
169
+ * - `uiGridConstants.scrollDirection.LEFT` - set when the grid is scrolling left
170
+ * - `uiGridConstants.scrollDirection.RIGHT` - set when the grid is scrolling right
171
+ * - `uiGridConstants.scrollDirection.NONE` - set when the grid is not scrolling, this is the default
172
+ */
92
173
scrollDirection : {
93
174
UP : 'up' ,
94
175
DOWN : 'down' ,
98
179
99
180
} ,
100
181
182
+ /**
183
+ * @ngdoc object
184
+ * @name dataChange
185
+ * @propertyOf ui.grid.service:uiGridConstants
186
+ * @description Used with {@link ui.grid.core.api:PublicApi#methods_notifyDataChange PublicApi.notifyDataChange},
187
+ * {@link ui.grid.class:Grid#methods_callDataChangeCallbacks Grid.callDataChangeCallbacks},
188
+ * and {@link ui.grid.class:Grid#methods_registerDataChangeCallback Grid.registerDataChangeCallback}
189
+ * to specify the type of the event(s).
190
+ *
191
+ * Available options are:
192
+ * - `uiGridConstants.dataChange.ALL` - listeners fired on any of these events, fires listeners on all events.
193
+ * - `uiGridConstants.dataChange.EDIT` - fired when the data in a cell is edited
194
+ * - `uiGridConstants.dataChange.ROW` - fired when a row is added or removed
195
+ * - `uiGridConstants.dataChange.COLUMN` - fired when the column definitions are modified
196
+ * - `uiGridConstants.dataChange.OPTIONS` - fired when the grid options are modified
197
+ */
101
198
dataChange : {
102
199
ALL : 'all' ,
103
200
EDIT : 'edit' ,
104
201
ROW : 'row' ,
105
202
COLUMN : 'column' ,
106
203
OPTIONS : 'options'
107
204
} ,
205
+
206
+ /**
207
+ * @ngdoc object
208
+ * @name scrollbars
209
+ * @propertyOf ui.grid.service:uiGridConstants
210
+ * @description Used with {@link ui.grid.class:GridOptions#properties_enableHorizontalScrollbar GridOptions.enableHorizontalScrollbar}
211
+ * and {@link ui.grid.class:GridOptions#properties_enableVerticalScrollbar GridOptions.enableVerticalScrollbar}
212
+ * to specify the scrollbar policy for that direction.
213
+ *
214
+ * Available options are:
215
+ * - `uiGridConstants.scrollbars.NEVER` - never show scrollbars in this direction
216
+ * - `uiGridConstants.scrollbars.ALWAYS` - always show scrollbars in this direction
217
+ */
218
+
108
219
scrollbars : {
109
220
NEVER : 0 ,
110
221
ALWAYS : 1
111
222
//WHEN_NEEDED: 2
112
223
}
113
224
} ) ;
114
225
115
- } ) ( ) ;
226
+ } ) ( ) ;
0 commit comments