Skip to content

Commit 16f1bdb

Browse files
committed
Merge pull request #1434 from enyojs/ENYO-2133-graynorton
Documentation for WIP features:
2 parents bf895ad + 7ce9912 commit 16f1bdb

File tree

5 files changed

+413
-69
lines changed

5 files changed

+413
-69
lines changed

src/NewDataList.js

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
22
* Contains the declaration for the {@link module:enyo/NewDataList~NewDataList} kind.
3+
*
34
* @wip
5+
* @public
46
* @module enyo/NewDataList
57
*/
68

@@ -15,27 +17,134 @@ var
1517
VirtualDataRepeater = require('./VirtualDataRepeater');
1618

1719
/**
18-
* {@link module:enyo/NewDataList~NewDataList} is a work-in-progress
20+
* {@link module:enyo/NewDataList~NewDataList} is new virtual list implementation.
21+
*
22+
* It is intended to replace the older {@link module:enyo/DataList~DataList},
23+
* {@link module:enyo/DataGridList~DataGridList} and probably
24+
* {@link module:layout/List~List}, but as of the Enyo 2.7 release is a work in
25+
* progress and currently lacks many of the features of those older implementations.
26+
*
27+
* The most significant difference between `NewDataList` and `DataList` / `DataGridList`
28+
* is that `NewDataList` "virtualizes" items one at a time, not a page at a time. This
29+
* approach performs somewhat better in general and most notably disributes the cost of
30+
* virtualization over time, which produces smoother frame rates.
31+
*
32+
* `NewDataList` supports both linear and grid layouts, in either horizontal or
33+
* vertical direction.
34+
*
35+
* Notes:
36+
* * List items must be styled with `position: absolute` to be laid out properly,
37+
* but `NewDataList` does not currently provide any default style rules for items,
38+
* so you need to specify `position: absolute` in your items' classes or style attributes.
39+
* * `NewDataList` currently supports only explicitly sized items; neither variable-size
40+
* items nor "naturally" sized items are currently supported.
1941
*
2042
* @class NewDataList
2143
* @extends module:enyo/VirtualDataRepeater~VirtualDataRepeater
2244
* @wip
2345
* @ui
46+
* @public
2447
*/
2548
module.exports = kind(
2649
/** @lends module:enyo/NewDataList~NewDataList.prototype */ {
2750
name: 'enyo.NewDataList',
2851
kind: VirtualDataRepeater,
52+
/**
53+
* The direction of the layout, which may be either `'vertical'`
54+
* or `'horizontal'`.
55+
*
56+
* @type {String}
57+
* @default 'vertical'
58+
* @public
59+
*/
2960
direction: 'vertical',
61+
/**
62+
* The height of each list item, in pixels.
63+
*
64+
* Required for grid layouts and linear vertical layouts; may be
65+
* omitted for linear horizontal layouts.
66+
*
67+
* @type {Number}
68+
* @default 100
69+
* @public
70+
*/
3071
itemHeight: 100,
72+
/**
73+
* The width of each list item, in pixels.
74+
*
75+
* Required for grid layouts and linear horizontal layouts; may be
76+
* omitted for linear vertical layouts.
77+
*
78+
* @type {Number}
79+
* @default 100
80+
* @public
81+
*/
3182
itemWidth: 100,
83+
/**
84+
* The space between list items, in pixels.
85+
*
86+
* @type {Number}
87+
* @default 0
88+
* @public
89+
*/
3290
spacing: 0,
91+
/**
92+
* The number of rows (only applies to horizontally scrolling grid layouts).
93+
*
94+
* To specify a horizontally scrolling grid layout, set `rows` to `2` or more
95+
* and `direction` to `horizontal`.
96+
*
97+
* @type {Number}
98+
* @default 'auto'
99+
* @public
100+
*/
33101
rows: 'auto',
102+
/**
103+
* The number of columns (only applies to vertically scrolling grid layouts).
104+
*
105+
* To specify a vertically scrolling grid layout, set `columns` to `2` or more
106+
* and `direction` to `vertical`.
107+
*
108+
* @type {Number}
109+
* @default 'auto'
110+
* @public
111+
*/
34112
columns: 'auto',
113+
/**
114+
* This number determines how many "extra" items the list will generate, beyond
115+
* the number required to fill the list's viewport. Higher numbers result in more
116+
* extra items being generated.
117+
*
118+
* You should generally not need to adjust this value.
119+
*
120+
* @type {Number}
121+
* @default 3
122+
* @public
123+
*/
35124
overhang: 3,
36-
// Experimental
125+
/**
126+
* This feature is experimental, and only partly functional.
127+
*
128+
* When `scrollToBoundaries` is set to `true`, the list will come to rest on an
129+
* item boundary, such that the first visible item is fully within the list's
130+
* viewport, not partially outside.
131+
*
132+
* Important limitation: this feature currently only works when scrolling in
133+
* response to wheel events or when scrolling to explicitly provided coordinates;
134+
* it does not work when scrolling in response to touch or mouse events.
135+
*
136+
* @type {Boolean}
137+
* @default false
138+
* @public
139+
*/
37140
scrollToBoundaries: false,
141+
/**
142+
* @private
143+
*/
38144
mixins: [Scrollable],
145+
/**
146+
* @private
147+
*/
39148
observers: [
40149
{method: 'reset', path: [
41150
'direction', 'columns', 'rows',

src/NewDrawer/NewDrawer.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ var
1616
NewAnimator = require('../NewAnimator');
1717

1818
/**
19-
* {@link module:enyo/NewDrawer~NewDrawer} is a work-in-progress
19+
* {@link module:enyo/NewDrawer~NewDrawer} is an experimental
20+
* {@link module:enyo/Control~Control}.
21+
*
22+
* It is not a 1:1 replacement for {@link module:enyo/Drawer~Drawer}
23+
* and will likely never be promoted out of its experimental state.
24+
* Use at your own risk.
2025
*
2126
* @class NewDrawer
2227
* @extends module:enyo/Control~Control
@@ -78,4 +83,4 @@ module.exports = kind(
7883
// this.discoverControlParent();
7984
};
8085
})
81-
});
86+
});

0 commit comments

Comments
 (0)