@saltcorn/data 0.6.1 → 0.6.2-beta.0
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/base-plugin/fieldviews.js +33 -28
- package/base-plugin/types.js +223 -94
- package/base-plugin/viewtemplates/edit.js +21 -17
- package/base-plugin/viewtemplates/filter.js +62 -15
- package/base-plugin/viewtemplates/list.js +16 -16
- package/base-plugin/viewtemplates/room.js +24 -22
- package/base-plugin/viewtemplates/show.js +26 -26
- package/base-plugin/viewtemplates/viewable_fields.js +25 -26
- package/db/index.js +6 -3
- package/models/expression.js +37 -25
- package/models/field.js +18 -12
- package/models/form.js +7 -6
- package/package.json +12 -7
- package/plugin-helper.js +31 -11
- package/tests/calc.test.js +22 -0
|
@@ -18,9 +18,9 @@ const {
|
|
|
18
18
|
const tags = require("@saltcorn/markup/tags");
|
|
19
19
|
const { select_options, radio_group } = require("@saltcorn/markup/helpers");
|
|
20
20
|
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
22
|
* select namespace
|
|
23
|
-
* @namespace
|
|
23
|
+
* @namespace
|
|
24
24
|
* @category saltcorn-data
|
|
25
25
|
*/
|
|
26
26
|
const select = {
|
|
@@ -29,7 +29,7 @@ const select = {
|
|
|
29
29
|
/** @type {boolean} */
|
|
30
30
|
isEdit: true,
|
|
31
31
|
/**
|
|
32
|
-
* @type {object[]}
|
|
32
|
+
* @type {object[]}
|
|
33
33
|
*/
|
|
34
34
|
configFields: () => [
|
|
35
35
|
{
|
|
@@ -37,6 +37,11 @@ const select = {
|
|
|
37
37
|
label: "Neutral label",
|
|
38
38
|
type: "String",
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
name: "where",
|
|
42
|
+
label: "Where",
|
|
43
|
+
type: "String",
|
|
44
|
+
},
|
|
40
45
|
{
|
|
41
46
|
name: "force_required",
|
|
42
47
|
label: "Force required",
|
|
@@ -45,15 +50,15 @@ const select = {
|
|
|
45
50
|
type: "Bool",
|
|
46
51
|
},
|
|
47
52
|
],
|
|
48
|
-
|
|
53
|
+
|
|
49
54
|
/**
|
|
50
|
-
* @param {*} nm
|
|
51
|
-
* @param {*} v
|
|
52
|
-
* @param {*} attrs
|
|
53
|
-
* @param {*} cls
|
|
54
|
-
* @param {*} reqd
|
|
55
|
-
* @param {*} field
|
|
56
|
-
* @returns {object}
|
|
55
|
+
* @param {*} nm
|
|
56
|
+
* @param {*} v
|
|
57
|
+
* @param {*} attrs
|
|
58
|
+
* @param {*} cls
|
|
59
|
+
* @param {*} reqd
|
|
60
|
+
* @param {*} field
|
|
61
|
+
* @returns {object}
|
|
57
62
|
*/
|
|
58
63
|
run: (nm, v, attrs, cls, reqd, field) => {
|
|
59
64
|
if (attrs.disabled)
|
|
@@ -84,9 +89,9 @@ const select = {
|
|
|
84
89
|
},
|
|
85
90
|
};
|
|
86
91
|
|
|
87
|
-
/**
|
|
92
|
+
/**
|
|
88
93
|
* radio_select namespace
|
|
89
|
-
* @namespace
|
|
94
|
+
* @namespace
|
|
90
95
|
* @category saltcorn-data
|
|
91
96
|
*/
|
|
92
97
|
const radio_select = {
|
|
@@ -95,12 +100,12 @@ const radio_select = {
|
|
|
95
100
|
/** @type {boolean} */
|
|
96
101
|
isEdit: true,
|
|
97
102
|
/**
|
|
98
|
-
* @param {*} nm
|
|
99
|
-
* @param {*} v
|
|
100
|
-
* @param {*} attrs
|
|
101
|
-
* @param {*} cls
|
|
102
|
-
* @param {*} reqd
|
|
103
|
-
* @param {*} field
|
|
103
|
+
* @param {*} nm
|
|
104
|
+
* @param {*} v
|
|
105
|
+
* @param {*} attrs
|
|
106
|
+
* @param {*} cls
|
|
107
|
+
* @param {*} reqd
|
|
108
|
+
* @param {*} field
|
|
104
109
|
* @returns {object}
|
|
105
110
|
*/
|
|
106
111
|
run: (nm, v, attrs, cls, reqd, field) =>
|
|
@@ -112,9 +117,9 @@ const radio_select = {
|
|
|
112
117
|
}),
|
|
113
118
|
};
|
|
114
119
|
|
|
115
|
-
/**
|
|
120
|
+
/**
|
|
116
121
|
* select namespace
|
|
117
|
-
* @namespace
|
|
122
|
+
* @namespace
|
|
118
123
|
* @category saltcorn-data
|
|
119
124
|
*/
|
|
120
125
|
const search_or_create = {
|
|
@@ -123,7 +128,7 @@ const search_or_create = {
|
|
|
123
128
|
/** @type {boolean} */
|
|
124
129
|
isEdit: true,
|
|
125
130
|
/**
|
|
126
|
-
* @param {object} field
|
|
131
|
+
* @param {object} field
|
|
127
132
|
* @returns {Promise<object[]>}
|
|
128
133
|
*/
|
|
129
134
|
configFields: async (field) => {
|
|
@@ -146,12 +151,12 @@ const search_or_create = {
|
|
|
146
151
|
},
|
|
147
152
|
|
|
148
153
|
/**
|
|
149
|
-
* @param {*} nm
|
|
150
|
-
* @param {*} v
|
|
151
|
-
* @param {*} attrs
|
|
152
|
-
* @param {*} cls
|
|
153
|
-
* @param {*} reqd
|
|
154
|
-
* @param {*} field
|
|
154
|
+
* @param {*} nm
|
|
155
|
+
* @param {*} v
|
|
156
|
+
* @param {*} attrs
|
|
157
|
+
* @param {*} cls
|
|
158
|
+
* @param {*} reqd
|
|
159
|
+
* @param {*} field
|
|
155
160
|
* @returns {object}
|
|
156
161
|
*/
|
|
157
162
|
run: (nm, v, attrs, cls, reqd, field) => {
|