|
122 | 122 |
|
123 | 123 | __updateSelection(multi, itemsInfo) { |
124 | 124 | let path = itemsInfo.path; |
125 | | - if (path == 'items') { |
| 125 | + if (path == JSCompiler_renameProperty('items', this)) { |
126 | 126 | // Case 1 - items array changed, so diff against previous array and |
127 | 127 | // deselect any removed items and adjust selected indices |
128 | 128 | let newItems = itemsInfo.base || []; |
|
137 | 137 | } |
138 | 138 | this.__lastItems = newItems; |
139 | 139 | this.__lastMulti = multi; |
140 | | - } else if (itemsInfo.path == 'items.splices') { |
| 140 | + } else if (itemsInfo.path == `${JSCompiler_renameProperty('items', this)}.splices`) { |
141 | 141 | // Case 2 - got specific splice information describing the array mutation: |
142 | 142 | // deselect any removed items and adjust selected indices |
143 | 143 | this.__applySplices(itemsInfo.value.indexSplices); |
144 | 144 | } else { |
145 | 145 | // Case 3 - an array element was changed, so deselect the previous |
146 | 146 | // item for that index if it was previously selected |
147 | | - let part = path.slice('items.'.length); |
| 147 | + let part = path.slice(`${JSCompiler_renameProperty('items', this)}.`.length); |
148 | 148 | let idx = parseInt(part, 10); |
149 | 149 | if ((part.indexOf('.') < 0) && part == idx) { |
150 | 150 | this.__deselectChangedIdx(idx); |
|
182 | 182 | selected.forEach((idx, item) => { |
183 | 183 | if (idx < 0) { |
184 | 184 | if (this.multi) { |
185 | | - this.splice('selected', sidx, 1); |
| 185 | + this.splice(JSCompiler_renameProperty('selected', this), sidx, 1); |
186 | 186 | } else { |
187 | 187 | this.selected = this.selectedItem = null; |
188 | 188 | } |
|
199 | 199 | let sidx = 0; |
200 | 200 | this.__selectedMap.forEach(idx => { |
201 | 201 | if (idx >= 0) { |
202 | | - this.linkPaths('items.' + idx, 'selected.' + sidx++); |
| 202 | + this.linkPaths(`${JSCompiler_renameProperty('items', this)}.` + idx, `${JSCompiler_renameProperty('selected', this)}.` + sidx++); |
203 | 203 | } |
204 | 204 | }); |
205 | 205 | } else { |
206 | 206 | this.__selectedMap.forEach(idx => { |
207 | | - this.linkPaths('selected', 'items.' + idx); |
208 | | - this.linkPaths('selectedItem', 'items.' + idx); |
| 207 | + this.linkPaths(JSCompiler_renameProperty('selected', this), `${JSCompiler_renameProperty('items', this)}.` + idx); |
| 208 | + this.linkPaths(JSCompiler_renameProperty('selectedItem', this), `${JSCompiler_renameProperty('items', this)}.` + idx); |
209 | 209 | }); |
210 | 210 | } |
211 | 211 | } |
|
260 | 260 | } |
261 | 261 |
|
262 | 262 | __selectedIndexForItemIndex(idx) { |
263 | | - let selected = this.__dataLinkedPaths['items.' + idx]; |
| 263 | + let selected = this.__dataLinkedPaths[`${JSCompiler_renameProperty('items', this)}.` + idx]; |
264 | 264 | if (selected) { |
265 | | - return parseInt(selected.slice('selected.'.length), 10); |
| 265 | + return parseInt(selected.slice(`${JSCompiler_renameProperty('selected', this)}.`.length), 10); |
266 | 266 | } |
267 | 267 | } |
268 | 268 |
|
|
282 | 282 | } |
283 | 283 | this.__updateLinks(); |
284 | 284 | if (this.multi) { |
285 | | - this.splice('selected', sidx, 1); |
| 285 | + this.splice(JSCompiler_renameProperty('selected', this), sidx, 1); |
286 | 286 | } else { |
287 | 287 | this.selected = this.selectedItem = null; |
288 | 288 | } |
|
326 | 326 | this.__selectedMap.set(item, idx); |
327 | 327 | this.__updateLinks(); |
328 | 328 | if (this.multi) { |
329 | | - this.push('selected', item); |
| 329 | + this.push(JSCompiler_renameProperty('selected', this), item); |
330 | 330 | } else { |
331 | 331 | this.selected = this.selectedItem = item; |
332 | 332 | } |
|
0 commit comments