@duet3d/objectmodel 3.7.0-beta.4 → 3.7.0-beta.6

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.
package/README.md CHANGED
@@ -4,13 +4,7 @@ TypeScript implementation of the Duet3D Object Model.
4
4
 
5
5
  ## Installation
6
6
 
7
- Install via `npm install @duet3d/objectmodel`. Users of Vue 2 must also run this command after the first import:
8
-
9
- ```
10
- globalThis._duetModelSetArray = (array, index, value) => Vue.set(array, index, value);
11
- ```
12
-
13
- This is required to make sure that change events for arrays are correctly fired.
7
+ Install via `npm install @duet3d/objectmodel`.
14
8
 
15
9
  ## Bug reports
16
10
 
@@ -1,5 +1,4 @@
1
1
  import { isModelObject } from "./ModelObject";
2
- import { setArrayItem } from "./index";
3
2
  /**
4
3
  * Class for storing model object items in an array
5
4
  */
@@ -52,23 +51,23 @@ export class ModelCollection extends Array {
52
51
  if (currentItem === null) {
53
52
  const newItem = jsonElement[i];
54
53
  if (newItem instanceof that.$itemConstructor) {
55
- setArrayItem(this, i, jsonElement[i]);
54
+ this[i] = jsonElement[i];
56
55
  }
57
56
  else {
58
57
  const refItem = new that.$itemConstructor();
59
- setArrayItem(this, i, refItem.update(newItem));
58
+ this[i] = refItem.update(newItem);
60
59
  }
61
60
  }
62
61
  else if (isModelObject(currentItem)) {
63
62
  const newItem = currentItem.update(jsonElement[i]);
64
63
  if (currentItem !== newItem) {
65
- setArrayItem(this, i, newItem);
64
+ this[i] = newItem;
66
65
  }
67
66
  }
68
67
  else {
69
68
  const newItem = jsonElement[i];
70
69
  if (currentItem !== newItem) {
71
- setArrayItem(this, i, newItem);
70
+ this[i] = newItem;
72
71
  }
73
72
  }
74
73
  }
@@ -1,4 +1,4 @@
1
- import { ModelCollection, setArrayItem } from "./index";
1
+ import { ModelCollection } from "./index";
2
2
  /**
3
3
  * Check whether a given value provides model update functionality
4
4
  * @param value Value to check
@@ -49,12 +49,12 @@ export class ModelObject {
49
49
  for (let i = 0; i < Math.min(prop.length, value.length); i++) {
50
50
  const propItem = prop[i];
51
51
  if (propItem === null) {
52
- setArrayItem(prop, i, value[i]);
52
+ prop[i] = value[i];
53
53
  }
54
54
  else {
55
55
  const newItem = value[i];
56
56
  if (propItem !== newItem) {
57
- setArrayItem(prop, i, newItem);
57
+ prop[i] = newItem;
58
58
  }
59
59
  }
60
60
  }