@onehat/data 1.19.33 → 1.19.36
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 +1 -1
- package/src/Integration/Browser/Repository/LocalStorage.js +1 -1
- package/src/Integration/Browser/Repository/SessionStorage.js +1 -1
- package/src/Reader/index.js +2 -2
- package/src/Repository/Repository.js +2 -2
- package/src/Schema/Schema.js +6 -0
- package/src/Writer/index.js +2 -2
package/package.json
CHANGED
package/src/Reader/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @module Reader */
|
|
2
2
|
|
|
3
3
|
import JsonReader from './JsonReader.js';
|
|
4
|
-
|
|
4
|
+
import XmlReader from './XmlReader.js';
|
|
5
5
|
|
|
6
6
|
const ReaderTypes = {
|
|
7
7
|
[JsonReader.type]: JsonReader,
|
|
8
|
-
|
|
8
|
+
[XmlReader.type]: XmlReader,
|
|
9
9
|
};
|
|
10
10
|
export default ReaderTypes;
|
|
@@ -545,13 +545,13 @@ export default class Repository extends EventEmitter {
|
|
|
545
545
|
} else if (!_.isNil(this.schema.model.sortProperty)) {
|
|
546
546
|
sorters = [{
|
|
547
547
|
name: this.schema.model.sortProperty,
|
|
548
|
-
direction:
|
|
548
|
+
direction: this.schema.model.sortDir,
|
|
549
549
|
fn: 'default',
|
|
550
550
|
}];
|
|
551
551
|
} else if (!_.isNil(this.schema.model.displayProperty)) {
|
|
552
552
|
sorters = [{
|
|
553
553
|
name: this.schema.model.displayProperty,
|
|
554
|
-
direction:
|
|
554
|
+
direction: this.schema.model.sortDir,
|
|
555
555
|
fn: 'default',
|
|
556
556
|
}];
|
|
557
557
|
}
|
package/src/Schema/Schema.js
CHANGED
|
@@ -65,6 +65,12 @@ export default class Schema extends EventEmitter {
|
|
|
65
65
|
*/
|
|
66
66
|
sortProperty: null,
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @member {string} sortDir - direction of sort Property ('ASC' || 'DESC')
|
|
70
|
+
* if sortProperty has a value and sorters is left blank, an automatic sorter with this property will be created.
|
|
71
|
+
*/
|
|
72
|
+
sortDir: 'ASC',
|
|
73
|
+
|
|
68
74
|
/**
|
|
69
75
|
* @member {string} parentIdProperty - name of parent_id Property (e.g. 'categories__parent_id' for Adjacency Lists, and parent_id for Closure Tables)
|
|
70
76
|
* For trees only
|
package/src/Writer/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @module Writer */
|
|
2
2
|
|
|
3
3
|
import JsonWriter from './JsonWriter.js';
|
|
4
|
-
|
|
4
|
+
import XmlWriter from './XmlWriter.js';
|
|
5
5
|
|
|
6
6
|
const WriterTypes = {
|
|
7
7
|
[JsonWriter.type]: JsonWriter,
|
|
8
|
-
|
|
8
|
+
[XmlWriter.type]: XmlWriter,
|
|
9
9
|
};
|
|
10
10
|
export default WriterTypes;
|