-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSchema.js
55 lines (54 loc) · 1001 Bytes
/
Schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// SimpleSchema
Shuttler.Selection.SelectedDocumentSchema = new SimpleSchema({
from: {
type: Shuttler.Ref.Schema,
optional: true
},
path: {
type: Shuttler.Ref.Schema,
optional: true
},
prev: {
type: String,
optional: true
},
selector: {
type: String
}
});
// SimpleSchema
Shuttler.Selection.OptionsSchema = new SimpleSchema({
isSelector: {
type: Function,
optional: true,
defaultValue: function(selector) {
return !selector._selected;
}
},
selectorQuery: {
type: Function,
optional: true,
defaultValue: function() {
return { [this._options.selectedField]: { $exists: false } };
}
},
isSelected: {
type: Function,
optional: true,
defaultValue: function(selected) {
return !!selected._selected;
}
},
selectedQuery: {
type: Function,
optional: true,
defaultValue: function() {
return { [this._options.selectedField]: { $exists: true } };
}
},
selectedField: {
type: String,
optional: true,
defaultValue: '_selected'
}
});