@miso.ai/client-sdk-ui 1.10.0 → 1.10.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,7 +26,10 @@ function root(layout, state) {
|
|
|
26
26
|
const roleAttr = role ? ` data-role="${role}"` : '';
|
|
27
27
|
const data = state.value || {};
|
|
28
28
|
const channelAttr = data.channel ? ` data-channel="${data.channel}"` : '';
|
|
29
|
-
|
|
29
|
+
const items = layout._getItems(state);
|
|
30
|
+
const itemCount = items ? items.length : undefined;
|
|
31
|
+
const itemCountAttr = itemCount !== undefined ? ` data-item-count="${itemCount}"` : '';
|
|
32
|
+
return `<div class="${className} ${status}"${roleAttr}${channelAttr}${itemCountAttr}>${status === _constants.STATUS.READY ? templates[status](layout, state) : ''}</div>`;
|
|
30
33
|
}
|
|
31
34
|
function ready(layout, state) {
|
|
32
35
|
const {
|
|
@@ -261,14 +264,9 @@ class AffiliationLayout extends _collection.default {
|
|
|
261
264
|
}
|
|
262
265
|
_render(element, states, controls) {
|
|
263
266
|
super._render(element, states, controls);
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
this._itemCount = items ? items.length : undefined;
|
|
268
|
-
(0, _commons.requestAnimationFrame)(() => {
|
|
269
|
-
this._syncItemCount();
|
|
270
|
-
this._syncItemIndex();
|
|
271
|
-
});
|
|
267
|
+
// sync again for incremental item rendering
|
|
268
|
+
this._syncItemCount(states);
|
|
269
|
+
this._syncItemIndex();
|
|
272
270
|
}
|
|
273
271
|
_syncElement(element) {
|
|
274
272
|
const oldElement = this._element;
|
|
@@ -283,7 +281,11 @@ class AffiliationLayout extends _collection.default {
|
|
|
283
281
|
newElement && this._viewable.observe(newElement);
|
|
284
282
|
}
|
|
285
283
|
_syncItemCount() {
|
|
286
|
-
|
|
284
|
+
let {
|
|
285
|
+
state
|
|
286
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
287
|
+
const items = this._getItems(state);
|
|
288
|
+
const itemCount = this._itemCount = items ? items.length : undefined;
|
|
287
289
|
if (itemCount === this._displayedCount) {
|
|
288
290
|
return;
|
|
289
291
|
}
|
package/dist/cjs/version.js
CHANGED
package/package.json
CHANGED
|
@@ -13,7 +13,10 @@ function root(layout, state) {
|
|
|
13
13
|
const roleAttr = role ? ` data-role="${role}"` : '';
|
|
14
14
|
const data = state.value || {};
|
|
15
15
|
const channelAttr = data.channel ? ` data-channel="${data.channel}"` : '';
|
|
16
|
-
|
|
16
|
+
const items = layout._getItems(state);
|
|
17
|
+
const itemCount = items ? items.length : undefined;
|
|
18
|
+
const itemCountAttr = itemCount !== undefined ? ` data-item-count="${itemCount}"` : '';
|
|
19
|
+
return `<div class="${className} ${status}"${roleAttr}${channelAttr}${itemCountAttr}>${status === STATUS.READY ? templates[status](layout, state) : ''}</div>`;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
function ready(layout, state) {
|
|
@@ -227,15 +230,9 @@ export default class AffiliationLayout extends CollectionLayout {
|
|
|
227
230
|
|
|
228
231
|
_render(element, states, controls) {
|
|
229
232
|
super._render(element, states, controls);
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
this._itemCount = items ? items.length : undefined;
|
|
234
|
-
|
|
235
|
-
raf(() => {
|
|
236
|
-
this._syncItemCount();
|
|
237
|
-
this._syncItemIndex();
|
|
238
|
-
});
|
|
233
|
+
// sync again for incremental item rendering
|
|
234
|
+
this._syncItemCount(states);
|
|
235
|
+
this._syncItemIndex();
|
|
239
236
|
}
|
|
240
237
|
|
|
241
238
|
_syncElement(element) {
|
|
@@ -252,8 +249,9 @@ export default class AffiliationLayout extends CollectionLayout {
|
|
|
252
249
|
newElement && this._viewable.observe(newElement);
|
|
253
250
|
}
|
|
254
251
|
|
|
255
|
-
_syncItemCount() {
|
|
256
|
-
const
|
|
252
|
+
_syncItemCount({ state } = {}) {
|
|
253
|
+
const items = this._getItems(state);
|
|
254
|
+
const itemCount = this._itemCount = items ? items.length : undefined;
|
|
257
255
|
if (itemCount === this._displayedCount) {
|
|
258
256
|
return;
|
|
259
257
|
}
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.10.0';
|
|
1
|
+
export default '1.10.1-beta.0';
|