native-document 1.0.225 → 1.0.226

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.225",
3
+ "version": "1.0.226",
4
4
  "description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
5
5
  "author": "AfroCodeur <https://github.com/afrocodeur>",
6
6
  "license": "MIT",
@@ -123,3 +123,15 @@ List.prototype.onItemSelect = function(handler) {
123
123
  this.on('itemSelect', handler);
124
124
  return this;
125
125
  };
126
+
127
+ /**
128
+ * @param {*|Array<*>} value
129
+ * @return {this}
130
+ */
131
+ List.prototype.setSelected = function(value) {
132
+ if(!Array.isArray(value)) {
133
+ value = [value];
134
+ }
135
+ this.$description.selectedValues.set(value);
136
+ return this;
137
+ };
@@ -43,6 +43,8 @@ export interface ListInterface {
43
43
  onItemClick(handler: (item: ListItemInterface, event: MouseEvent) => void): this;
44
44
  onItemSelect(handler: (item: ListItemInterface) => void): this;
45
45
 
46
+ setSelected(value: any): this;
47
+
46
48
  // HasEventEmitter
47
49
  on(event: string, handler: (...args: unknown[]) => void): this;
48
50
  emit(event: string, ...args: unknown[]): void;