@esri/solutions-components 0.10.5 → 0.10.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -1
  2. package/dist/cjs/instant-apps-time-filter.cjs.entry.js +40 -21
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/solutions-components.cjs.js +1 -1
  5. package/dist/collection/assets/t9n/layer-list/resources_ar.json +1 -1
  6. package/dist/collection/assets/t9n/layer-list/resources_bg.json +1 -1
  7. package/dist/collection/assets/t9n/layer-list/resources_bs.json +1 -1
  8. package/dist/collection/assets/t9n/layer-list/resources_ca.json +1 -1
  9. package/dist/collection/assets/t9n/layer-list/resources_cs.json +1 -1
  10. package/dist/collection/assets/t9n/layer-list/resources_da.json +1 -1
  11. package/dist/collection/assets/t9n/layer-list/resources_de.json +1 -1
  12. package/dist/collection/assets/t9n/layer-list/resources_el.json +1 -1
  13. package/dist/collection/assets/t9n/layer-list/resources_es.json +1 -1
  14. package/dist/collection/assets/t9n/layer-list/resources_et.json +1 -1
  15. package/dist/collection/assets/t9n/layer-list/resources_fi.json +1 -1
  16. package/dist/collection/assets/t9n/layer-list/resources_fr.json +1 -1
  17. package/dist/collection/assets/t9n/layer-list/resources_he.json +1 -1
  18. package/dist/collection/assets/t9n/layer-list/resources_hr.json +1 -1
  19. package/dist/collection/assets/t9n/layer-list/resources_hu.json +1 -1
  20. package/dist/collection/assets/t9n/layer-list/resources_id.json +1 -1
  21. package/dist/collection/assets/t9n/layer-list/resources_it.json +1 -1
  22. package/dist/collection/assets/t9n/layer-list/resources_ja.json +1 -1
  23. package/dist/collection/assets/t9n/layer-list/resources_ko.json +1 -1
  24. package/dist/collection/assets/t9n/layer-list/resources_lt.json +1 -1
  25. package/dist/collection/assets/t9n/layer-list/resources_lv.json +1 -1
  26. package/dist/collection/assets/t9n/layer-list/resources_nb.json +1 -1
  27. package/dist/collection/assets/t9n/layer-list/resources_nl.json +1 -1
  28. package/dist/collection/assets/t9n/layer-list/resources_pl.json +1 -1
  29. package/dist/collection/assets/t9n/layer-list/resources_pt-BR.json +1 -1
  30. package/dist/collection/assets/t9n/layer-list/resources_pt-PT.json +1 -1
  31. package/dist/collection/assets/t9n/layer-list/resources_ro.json +1 -1
  32. package/dist/collection/assets/t9n/layer-list/resources_ru.json +1 -1
  33. package/dist/collection/assets/t9n/layer-list/resources_sk.json +1 -1
  34. package/dist/collection/assets/t9n/layer-list/resources_sl.json +1 -1
  35. package/dist/collection/assets/t9n/layer-list/resources_sr.json +1 -1
  36. package/dist/collection/assets/t9n/layer-list/resources_sv.json +1 -1
  37. package/dist/collection/assets/t9n/layer-list/resources_th.json +1 -1
  38. package/dist/collection/assets/t9n/layer-list/resources_tr.json +1 -1
  39. package/dist/collection/assets/t9n/layer-list/resources_uk.json +1 -1
  40. package/dist/collection/assets/t9n/layer-list/resources_vi.json +1 -1
  41. package/dist/collection/assets/t9n/layer-list/resources_zh-CN.json +1 -1
  42. package/dist/collection/assets/t9n/layer-list/resources_zh-HK.json +1 -1
  43. package/dist/collection/assets/t9n/layer-list/resources_zh-TW.json +1 -1
  44. package/dist/components/instant-apps-control-panel.js +2 -1
  45. package/dist/components/instant-apps-time-filter.js +46 -23
  46. package/dist/esm/instant-apps-control-panel.entry.js +2 -1
  47. package/dist/esm/instant-apps-time-filter.entry.js +41 -22
  48. package/dist/esm/loader.js +1 -1
  49. package/dist/esm/solutions-components.js +1 -1
  50. package/dist/solutions-components/assets/t9n/layer-list/resources_ar.json +1 -1
  51. package/dist/solutions-components/assets/t9n/layer-list/resources_bg.json +1 -1
  52. package/dist/solutions-components/assets/t9n/layer-list/resources_bs.json +1 -1
  53. package/dist/solutions-components/assets/t9n/layer-list/resources_ca.json +1 -1
  54. package/dist/solutions-components/assets/t9n/layer-list/resources_cs.json +1 -1
  55. package/dist/solutions-components/assets/t9n/layer-list/resources_da.json +1 -1
  56. package/dist/solutions-components/assets/t9n/layer-list/resources_de.json +1 -1
  57. package/dist/solutions-components/assets/t9n/layer-list/resources_el.json +1 -1
  58. package/dist/solutions-components/assets/t9n/layer-list/resources_es.json +1 -1
  59. package/dist/solutions-components/assets/t9n/layer-list/resources_et.json +1 -1
  60. package/dist/solutions-components/assets/t9n/layer-list/resources_fi.json +1 -1
  61. package/dist/solutions-components/assets/t9n/layer-list/resources_fr.json +1 -1
  62. package/dist/solutions-components/assets/t9n/layer-list/resources_he.json +1 -1
  63. package/dist/solutions-components/assets/t9n/layer-list/resources_hr.json +1 -1
  64. package/dist/solutions-components/assets/t9n/layer-list/resources_hu.json +1 -1
  65. package/dist/solutions-components/assets/t9n/layer-list/resources_id.json +1 -1
  66. package/dist/solutions-components/assets/t9n/layer-list/resources_it.json +1 -1
  67. package/dist/solutions-components/assets/t9n/layer-list/resources_ja.json +1 -1
  68. package/dist/solutions-components/assets/t9n/layer-list/resources_ko.json +1 -1
  69. package/dist/solutions-components/assets/t9n/layer-list/resources_lt.json +1 -1
  70. package/dist/solutions-components/assets/t9n/layer-list/resources_lv.json +1 -1
  71. package/dist/solutions-components/assets/t9n/layer-list/resources_nb.json +1 -1
  72. package/dist/solutions-components/assets/t9n/layer-list/resources_nl.json +1 -1
  73. package/dist/solutions-components/assets/t9n/layer-list/resources_pl.json +1 -1
  74. package/dist/solutions-components/assets/t9n/layer-list/resources_pt-BR.json +1 -1
  75. package/dist/solutions-components/assets/t9n/layer-list/resources_pt-PT.json +1 -1
  76. package/dist/solutions-components/assets/t9n/layer-list/resources_ro.json +1 -1
  77. package/dist/solutions-components/assets/t9n/layer-list/resources_ru.json +1 -1
  78. package/dist/solutions-components/assets/t9n/layer-list/resources_sk.json +1 -1
  79. package/dist/solutions-components/assets/t9n/layer-list/resources_sl.json +1 -1
  80. package/dist/solutions-components/assets/t9n/layer-list/resources_sr.json +1 -1
  81. package/dist/solutions-components/assets/t9n/layer-list/resources_sv.json +1 -1
  82. package/dist/solutions-components/assets/t9n/layer-list/resources_th.json +1 -1
  83. package/dist/solutions-components/assets/t9n/layer-list/resources_tr.json +1 -1
  84. package/dist/solutions-components/assets/t9n/layer-list/resources_uk.json +1 -1
  85. package/dist/solutions-components/assets/t9n/layer-list/resources_vi.json +1 -1
  86. package/dist/solutions-components/assets/t9n/layer-list/resources_zh-CN.json +1 -1
  87. package/dist/solutions-components/assets/t9n/layer-list/resources_zh-HK.json +1 -1
  88. package/dist/solutions-components/assets/t9n/layer-list/resources_zh-TW.json +1 -1
  89. package/dist/solutions-components/p-1867168b.entry.js +6 -0
  90. package/dist/solutions-components/{p-ab2adcaf.entry.js → p-cc092b22.entry.js} +1 -1
  91. package/dist/solutions-components/solutions-components.esm.js +1 -1
  92. package/package.json +2 -2
  93. package/dist/solutions-components/p-72f01088.entry.js +0 -6
@@ -72,9 +72,10 @@ const InstantAppsControlPanel = class {
72
72
  };
73
73
  }
74
74
  _getExpand(component) {
75
+ var _a;
75
76
  const { view } = this;
76
77
  const { content } = component;
77
- const expanded = false;
78
+ const expanded = (_a = component === null || component === void 0 ? void 0 : component.expanded) !== null && _a !== void 0 ? _a : false;
78
79
  return new this.Expand({ content, view, expanded, mode: MODE, group: GROUP });
79
80
  }
80
81
  _getComponentsNode() {
@@ -23,6 +23,8 @@ const { state, onChange } = index.createStore({
23
23
  timeInfoItems: [],
24
24
  selectedTimeInfoItem: null,
25
25
  loading: true,
26
+ timeSliderConfig: {},
27
+ autoPlay: false,
26
28
  });
27
29
 
28
30
  /*
@@ -241,8 +243,8 @@ class InstantAppsTimeFilterViewModel {
241
243
  'esri/core/Handles',
242
244
  'esri/core/reactiveUtils',
243
245
  'esri/widgets/TimeSlider',
244
- 'esri/TimeExtent',
245
- 'esri/TimeInterval',
246
+ 'esri/time/TimeExtent',
247
+ 'esri/time/TimeInterval',
246
248
  'esri/layers/support/FeatureFilter',
247
249
  'esri/layers/support/FeatureEffect',
248
250
  ]);
@@ -257,8 +259,11 @@ class InstantAppsTimeFilterViewModel {
257
259
  catch (_a) { }
258
260
  }
259
261
  async init(timeSliderRef) {
262
+ var _a, _b;
260
263
  if (timeSliderRef)
261
264
  timeSliderRef.innerHTML = '';
265
+ if (((_b = (_a = state === null || state === void 0 ? void 0 : state.timeSlider) === null || _a === void 0 ? void 0 : _a.viewModel) === null || _b === void 0 ? void 0 : _b.state) === 'playing')
266
+ state.timeSlider.stop();
262
267
  const { view, timeInfoConfigItems } = state;
263
268
  if (!view)
264
269
  return;
@@ -270,7 +275,7 @@ class InstantAppsTimeFilterViewModel {
270
275
  this.setupFilterModeWatcher();
271
276
  return Promise.resolve();
272
277
  }
273
- catch (_a) { }
278
+ catch (_c) { }
274
279
  }
275
280
  destroy() {
276
281
  var _a, _b;
@@ -315,6 +320,8 @@ class InstantAppsTimeFilterViewModel {
315
320
  state.selectedTimeInfoItem = initialTimeInfoItem;
316
321
  const config = this.getTimeSliderConfig(timeSliderRef);
317
322
  state.timeSlider = new TimeSlider(config);
323
+ if (state.autoPlay)
324
+ state.timeSlider.play();
318
325
  if (((_b = state.view) === null || _b === void 0 ? void 0 : _b.type) === '2d')
319
326
  this.initialize2DView();
320
327
  }
@@ -329,23 +336,16 @@ class InstantAppsTimeFilterViewModel {
329
336
  var _a;
330
337
  const [{ timeExtent, rangeStart, rangeEnd, unit }] = state.timeInfoItems;
331
338
  const { TimeExtent, TimeInterval } = this;
332
- return {
333
- container: timeSliderRef,
334
- fullTimeExtent: timeExtent,
335
- timeExtent: new TimeExtent({
339
+ const config = Object.assign({ container: timeSliderRef, fullTimeExtent: timeExtent, timeExtent: new TimeExtent({
336
340
  start: rangeStart,
337
341
  end: rangeEnd,
338
- }),
339
- mode: 'time-window',
340
- loop: true,
341
- stops: {
342
+ }), mode: 'time-window', stops: {
342
343
  interval: new TimeInterval({
343
344
  unit,
344
345
  value: 1,
345
346
  }),
346
- },
347
- view: ((_a = state.view) === null || _a === void 0 ? void 0 : _a.type) === '3d' ? state.view : null,
348
- };
347
+ }, view: ((_a = state.view) === null || _a === void 0 ? void 0 : _a.type) === '3d' ? state.view : null }, state.timeSliderConfig);
348
+ return config;
349
349
  }
350
350
  initialize2DView() {
351
351
  state.timeInfoItems.forEach(timeInfoItem => this.applyTimeExtent(timeInfoItem.layerView, new this.TimeExtent({ start: timeInfoItem.rangeStart, end: timeInfoItem.rangeEnd })));
@@ -452,6 +452,8 @@ const InstantAppsTimeFilter = class {
452
452
  this.timeInfoConfigItems = [];
453
453
  this.filterMode = undefined;
454
454
  this.view = undefined;
455
+ this.timeSliderConfig = undefined;
456
+ this.autoPlay = false;
455
457
  }
456
458
  async updateTimeInfoConfigItems() {
457
459
  state.timeInfoConfigItems = this.timeInfoConfigItems;
@@ -460,10 +462,28 @@ const InstantAppsTimeFilter = class {
460
462
  async updateFilterMode() {
461
463
  state.filterMode = this.filterMode;
462
464
  }
465
+ async updateTimeSliderConfig() {
466
+ state.timeSliderConfig = this.timeSliderConfig;
467
+ await viewModel.init(this.timeSliderRef);
468
+ }
469
+ async updateAutoPlay() {
470
+ state.autoPlay = this.autoPlay;
471
+ if (state.timeSlider) {
472
+ if (state.autoPlay) {
473
+ state.timeSlider.play();
474
+ }
475
+ else {
476
+ state.timeSlider.stop();
477
+ }
478
+ }
479
+ }
463
480
  async componentWillLoad() {
464
481
  try {
465
482
  state.view = this.view;
466
483
  state.timeInfoConfigItems = this.timeInfoConfigItems;
484
+ state.autoPlay = !!this.autoPlay;
485
+ if (this.timeSliderConfig)
486
+ state.timeSliderConfig = this.timeSliderConfig;
467
487
  if (this.filterMode)
468
488
  state.filterMode = this.filterMode;
469
489
  await locale.getMessages(this);
@@ -484,17 +504,14 @@ const InstantAppsTimeFilter = class {
484
504
  viewModel.destroy();
485
505
  }
486
506
  render() {
487
- return index$1.h(index$1.Host, { key: 'bf0887f83b19239ce1b81efad5c356c7edc05ba1' }, this._renderBase());
507
+ return index$1.h(index$1.Host, { key: '38a0569dba42d51846760bf75df36ee1c88d71b1' }, this._renderBase());
488
508
  }
489
509
  _renderBase() {
490
- return (index$1.h("div", { class: `${CSS.base}${this.view.type !== '2d' ? CSS.threeD : ''}` }, this._renderLoader(), this._renderMain()));
491
- }
492
- _renderMain() {
493
- return (index$1.h(index$1.Fragment, null, this.view.type === '2d' && this._renderTopEl(), index$1.h("div", { ref: (ref) => (this.timeSliderRef = ref) })));
510
+ return (index$1.h("div", { class: `${CSS.base}${this.view.type !== '2d' ? CSS.threeD : ''}` }, this._renderLoader(), this.view.type === '2d' && this._renderTopEl(), index$1.h("div", { key: "time-slider", ref: (ref) => (this.timeSliderRef = ref) })));
494
511
  }
495
512
  _renderLoader() {
496
513
  var _a, _b;
497
- return (state.loading && (index$1.h(index$1.Fragment, null, index$1.h("div", { class: CSS.background }), index$1.h("div", { class: CSS.loadingContainer }, index$1.h("calcite-loader", { scale: "m", label: (_a = this.messages) === null || _a === void 0 ? void 0 : _a.loading, text: (_b = this.messages) === null || _b === void 0 ? void 0 : _b.loading })))));
514
+ return (state.loading && (index$1.h("div", null, index$1.h("div", { class: CSS.background }), index$1.h("div", { class: CSS.loadingContainer }, index$1.h("calcite-loader", { scale: "m", label: (_a = this.messages) === null || _a === void 0 ? void 0 : _a.loading, text: (_b = this.messages) === null || _b === void 0 ? void 0 : _b.loading })))));
498
515
  }
499
516
  _renderTopEl() {
500
517
  const moreThanOneTimeLayer = this.timeInfoConfigItems.length > 1;
@@ -524,7 +541,9 @@ const InstantAppsTimeFilter = class {
524
541
  get el() { return index$1.getElement(this); }
525
542
  static get watchers() { return {
526
543
  "timeInfoConfigItems": ["updateTimeInfoConfigItems"],
527
- "filterMode": ["updateFilterMode"]
544
+ "filterMode": ["updateFilterMode"],
545
+ "timeSliderConfig": ["updateTimeSliderConfig"],
546
+ "autoPlay": ["updateAutoPlay"]
528
547
  }; }
529
548
  };
530
549
  InstantAppsTimeFilter.style = InstantAppsTimeFilterStyle0;