plmt-constructor-sdk 0.13.5 → 0.13.7
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 +291 -0
- package/__internal__/config.d.ts +60 -54
- package/__internal__/config.js +46 -46
- package/__internal__/dataset.d.ts +19 -19
- package/__internal__/dataset.js +12 -12
- package/__internal__/theme.d.ts +13 -13
- package/__internal__/theme.js +112 -112
- package/__internal__/view-settings.d.ts +24 -24
- package/__internal__/view-settings.js +50 -50
- package/__internal__/widget-io.d.ts +56 -56
- package/__internal__/widget-io.js +21 -21
- package/__internal__/widget-provide-data.d.ts +4 -4
- package/__internal__/widget-provide-data.js +114 -112
- package/__internal__/widget.d.ts +64 -64
- package/__internal__/widget.js +64 -64
- package/config.d.ts +149 -143
- package/config.js +198 -198
- package/data.d.ts +62 -62
- package/data.js +51 -51
- package/declare.d.ts +20 -20
- package/declare.js +131 -131
- package/index.d.ts +2 -2
- package/index.js +18 -18
- package/package.json +2 -2
- package/theme.d.ts +26 -26
- package/theme.js +19 -19
- package/widget.d.ts +63 -63
- package/widget.js +24 -24
package/config.js
CHANGED
|
@@ -1,198 +1,198 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* К помощью конфигурация настраивается получение данных
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
* @module Конфигурация
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.title = exports.colorPicker = exports.select = exports.radio = exports.checkbox = exports.textArea = exports.input = exports.ViewSettingsItem = exports.drilldown = exports.colorize = exports.sort = exports.filter = exports.block = exports.Block = exports.BlockIcon = exports.DataQueryFunction = exports.DataQueryMethod = void 0;
|
|
10
|
-
const data_1 = require("./data");
|
|
11
|
-
const config_1 = require("./__internal__/config");
|
|
12
|
-
const dataset_1 = require("./__internal__/dataset");
|
|
13
|
-
const view_settings_1 = require("./__internal__/view-settings");
|
|
14
|
-
// enums
|
|
15
|
-
var DataQueryMethod;
|
|
16
|
-
(function (DataQueryMethod) {
|
|
17
|
-
DataQueryMethod["Table"] = "table";
|
|
18
|
-
DataQueryMethod["Aggregate"] = "aggregate";
|
|
19
|
-
})(DataQueryMethod = exports.DataQueryMethod || (exports.DataQueryMethod = {}));
|
|
20
|
-
var DataQueryFunction;
|
|
21
|
-
(function (DataQueryFunction) {
|
|
22
|
-
DataQueryFunction["Group"] = "group";
|
|
23
|
-
DataQueryFunction["Sum"] = "sum";
|
|
24
|
-
DataQueryFunction["Average"] = "avg";
|
|
25
|
-
DataQueryFunction["Min"] = "min";
|
|
26
|
-
DataQueryFunction["Max"] = "max";
|
|
27
|
-
DataQueryFunction["First"] = "first";
|
|
28
|
-
DataQueryFunction["Last"] = "last";
|
|
29
|
-
})(DataQueryFunction = exports.DataQueryFunction || (exports.DataQueryFunction = {}));
|
|
30
|
-
var BlockIcon;
|
|
31
|
-
(function (BlockIcon) {
|
|
32
|
-
BlockIcon["AxisX"] = "sys:axis-x";
|
|
33
|
-
BlockIcon["AxisY"] = "sys:axis-y";
|
|
34
|
-
BlockIcon["Value"] = "sys:value-column";
|
|
35
|
-
})(BlockIcon = exports.BlockIcon || (exports.BlockIcon = {}));
|
|
36
|
-
// blocks
|
|
37
|
-
const token = Symbol();
|
|
38
|
-
class Block {
|
|
39
|
-
constructor(_) {
|
|
40
|
-
if (_ !== token)
|
|
41
|
-
throw new Error('Illigal constructor');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.Block = Block;
|
|
45
|
-
function createBlock(source) {
|
|
46
|
-
return Object.assign(new Block(token), {
|
|
47
|
-
[config_1.configDataBlock_Server]: {
|
|
48
|
-
type: source.type,
|
|
49
|
-
key: source.key,
|
|
50
|
-
label: source.label,
|
|
51
|
-
icon: source.icon || '',
|
|
52
|
-
data_type: source.data_type,
|
|
53
|
-
max: source.max || 0,
|
|
54
|
-
function: source.function || null,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function block(params) {
|
|
59
|
-
const columnTypes = params.columnTypes || [];
|
|
60
|
-
const hasNumberType = columnTypes.includes(data_1.ColumnType.Number);
|
|
61
|
-
let columnType;
|
|
62
|
-
switch (columnTypes.length) {
|
|
63
|
-
case 0:
|
|
64
|
-
columnType = dataset_1.DatasetColumnType_Server.Any;
|
|
65
|
-
break;
|
|
66
|
-
case 1:
|
|
67
|
-
columnType = hasNumberType
|
|
68
|
-
? dataset_1.DatasetColumnType_Server.Fact
|
|
69
|
-
: dataset_1.DatasetColumnType_Server.Dimension;
|
|
70
|
-
break;
|
|
71
|
-
default:
|
|
72
|
-
columnType = hasNumberType
|
|
73
|
-
? dataset_1.DatasetColumnType_Server.Any
|
|
74
|
-
: dataset_1.DatasetColumnType_Server.Dimension;
|
|
75
|
-
}
|
|
76
|
-
return createBlock({
|
|
77
|
-
type: config_1.ConfigDataBlockType_Server.Column,
|
|
78
|
-
key: params.key,
|
|
79
|
-
label: params.label,
|
|
80
|
-
icon: params.icon,
|
|
81
|
-
max: params.max,
|
|
82
|
-
function: params.dataQueryFunction,
|
|
83
|
-
data_type: columnType,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports.block = block;
|
|
87
|
-
function filter(params = {}) {
|
|
88
|
-
return createBlock({
|
|
89
|
-
type: config_1.ConfigDataBlockType_Server.Filter,
|
|
90
|
-
key: config_1.blockFilterKey,
|
|
91
|
-
label: params.label || {
|
|
92
|
-
ru: 'Фильтры',
|
|
93
|
-
en: 'Filters',
|
|
94
|
-
},
|
|
95
|
-
icon: params.icon || BlockIcon.Value,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
exports.filter = filter;
|
|
99
|
-
function sort(params = {}) {
|
|
100
|
-
return createBlock({
|
|
101
|
-
type: config_1.ConfigDataBlockType_Server.Sort,
|
|
102
|
-
key: config_1.blockSortKey,
|
|
103
|
-
label: params.label || {
|
|
104
|
-
ru: 'Сортировка',
|
|
105
|
-
en: 'Sort',
|
|
106
|
-
},
|
|
107
|
-
icon: params.icon || BlockIcon.Value,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
exports.sort = sort;
|
|
111
|
-
function colorize(params = {}) {
|
|
112
|
-
return createBlock({
|
|
113
|
-
type: config_1.ConfigDataBlockType_Server.Colorizer,
|
|
114
|
-
key: config_1.blockColorizeKey,
|
|
115
|
-
label: params.label || {
|
|
116
|
-
ru: 'Цветовая дифференциация',
|
|
117
|
-
en: 'Colors',
|
|
118
|
-
},
|
|
119
|
-
icon: params.icon || BlockIcon.Value,
|
|
120
|
-
max: params.max || 0,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
exports.colorize = colorize;
|
|
124
|
-
function drilldown(params) {
|
|
125
|
-
return createBlock({
|
|
126
|
-
type: config_1.ConfigDataBlockType_Server.Drilldown,
|
|
127
|
-
key: (0, config_1.decodeDrilldownData)(params.source, params.additionalFilterSources || []),
|
|
128
|
-
label: params.label || {
|
|
129
|
-
ru: 'Drilldown',
|
|
130
|
-
en: 'Drilldown',
|
|
131
|
-
},
|
|
132
|
-
icon: BlockIcon.Value,
|
|
133
|
-
max: 4,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
exports.drilldown = drilldown;
|
|
137
|
-
class ViewSettingsItem {
|
|
138
|
-
constructor(_) {
|
|
139
|
-
if (_ !== token)
|
|
140
|
-
throw new Error('Illigal constructor');
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
exports.ViewSettingsItem = ViewSettingsItem;
|
|
144
|
-
function createViewSettingsItem(value) {
|
|
145
|
-
return Object.assign(new ViewSettingsItem(token), {
|
|
146
|
-
[view_settings_1.viewSettingsItemValue]: value,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function input(params) {
|
|
150
|
-
return createViewSettingsItem({
|
|
151
|
-
type: view_settings_1.ViewSettingsItemType.Input,
|
|
152
|
-
...params,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
exports.input = input;
|
|
156
|
-
function textArea(params) {
|
|
157
|
-
return createViewSettingsItem({
|
|
158
|
-
type: view_settings_1.ViewSettingsItemType.TextArea,
|
|
159
|
-
...params,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
exports.textArea = textArea;
|
|
163
|
-
function checkbox(params) {
|
|
164
|
-
return createViewSettingsItem({
|
|
165
|
-
type: view_settings_1.ViewSettingsItemType.Checkbox,
|
|
166
|
-
...params,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
exports.checkbox = checkbox;
|
|
170
|
-
function radio(params) {
|
|
171
|
-
return createViewSettingsItem({
|
|
172
|
-
type: view_settings_1.ViewSettingsItemType.Radio,
|
|
173
|
-
...params,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
exports.radio = radio;
|
|
177
|
-
function select(params) {
|
|
178
|
-
return createViewSettingsItem({
|
|
179
|
-
type: view_settings_1.ViewSettingsItemType.Select,
|
|
180
|
-
...params,
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
exports.select = select;
|
|
184
|
-
function colorPicker(params) {
|
|
185
|
-
return createViewSettingsItem({
|
|
186
|
-
type: view_settings_1.ViewSettingsItemType.ColorPicker,
|
|
187
|
-
...params,
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
exports.colorPicker = colorPicker;
|
|
191
|
-
function title(label) {
|
|
192
|
-
return createViewSettingsItem({
|
|
193
|
-
type: view_settings_1.ViewSettingsItemType.Title,
|
|
194
|
-
key: '',
|
|
195
|
-
label,
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
exports.title = title;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* К помощью конфигурация настраивается получение данных
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module Конфигурация
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.title = exports.colorPicker = exports.select = exports.radio = exports.checkbox = exports.textArea = exports.input = exports.ViewSettingsItem = exports.drilldown = exports.colorize = exports.sort = exports.filter = exports.block = exports.Block = exports.BlockIcon = exports.DataQueryFunction = exports.DataQueryMethod = void 0;
|
|
10
|
+
const data_1 = require("./data");
|
|
11
|
+
const config_1 = require("./__internal__/config");
|
|
12
|
+
const dataset_1 = require("./__internal__/dataset");
|
|
13
|
+
const view_settings_1 = require("./__internal__/view-settings");
|
|
14
|
+
// enums
|
|
15
|
+
var DataQueryMethod;
|
|
16
|
+
(function (DataQueryMethod) {
|
|
17
|
+
DataQueryMethod["Table"] = "table";
|
|
18
|
+
DataQueryMethod["Aggregate"] = "aggregate";
|
|
19
|
+
})(DataQueryMethod = exports.DataQueryMethod || (exports.DataQueryMethod = {}));
|
|
20
|
+
var DataQueryFunction;
|
|
21
|
+
(function (DataQueryFunction) {
|
|
22
|
+
DataQueryFunction["Group"] = "group";
|
|
23
|
+
DataQueryFunction["Sum"] = "sum";
|
|
24
|
+
DataQueryFunction["Average"] = "avg";
|
|
25
|
+
DataQueryFunction["Min"] = "min";
|
|
26
|
+
DataQueryFunction["Max"] = "max";
|
|
27
|
+
DataQueryFunction["First"] = "first";
|
|
28
|
+
DataQueryFunction["Last"] = "last";
|
|
29
|
+
})(DataQueryFunction = exports.DataQueryFunction || (exports.DataQueryFunction = {}));
|
|
30
|
+
var BlockIcon;
|
|
31
|
+
(function (BlockIcon) {
|
|
32
|
+
BlockIcon["AxisX"] = "sys:axis-x";
|
|
33
|
+
BlockIcon["AxisY"] = "sys:axis-y";
|
|
34
|
+
BlockIcon["Value"] = "sys:value-column";
|
|
35
|
+
})(BlockIcon = exports.BlockIcon || (exports.BlockIcon = {}));
|
|
36
|
+
// blocks
|
|
37
|
+
const token = Symbol();
|
|
38
|
+
class Block {
|
|
39
|
+
constructor(_) {
|
|
40
|
+
if (_ !== token)
|
|
41
|
+
throw new Error('Illigal constructor');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.Block = Block;
|
|
45
|
+
function createBlock(source) {
|
|
46
|
+
return Object.assign(new Block(token), {
|
|
47
|
+
[config_1.configDataBlock_Server]: {
|
|
48
|
+
type: source.type,
|
|
49
|
+
key: source.key,
|
|
50
|
+
label: source.label,
|
|
51
|
+
icon: source.icon || '',
|
|
52
|
+
data_type: source.data_type,
|
|
53
|
+
max: source.max || 0,
|
|
54
|
+
function: source.function || null,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function block(params) {
|
|
59
|
+
const columnTypes = params.columnTypes || [];
|
|
60
|
+
const hasNumberType = columnTypes.includes(data_1.ColumnType.Number);
|
|
61
|
+
let columnType;
|
|
62
|
+
switch (columnTypes.length) {
|
|
63
|
+
case 0:
|
|
64
|
+
columnType = dataset_1.DatasetColumnType_Server.Any;
|
|
65
|
+
break;
|
|
66
|
+
case 1:
|
|
67
|
+
columnType = hasNumberType
|
|
68
|
+
? dataset_1.DatasetColumnType_Server.Fact
|
|
69
|
+
: dataset_1.DatasetColumnType_Server.Dimension;
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
columnType = hasNumberType
|
|
73
|
+
? dataset_1.DatasetColumnType_Server.Any
|
|
74
|
+
: dataset_1.DatasetColumnType_Server.Dimension;
|
|
75
|
+
}
|
|
76
|
+
return createBlock({
|
|
77
|
+
type: config_1.ConfigDataBlockType_Server.Column,
|
|
78
|
+
key: params.key,
|
|
79
|
+
label: params.label,
|
|
80
|
+
icon: params.icon,
|
|
81
|
+
max: params.max,
|
|
82
|
+
function: params.dataQueryFunction,
|
|
83
|
+
data_type: columnType,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.block = block;
|
|
87
|
+
function filter(params = {}) {
|
|
88
|
+
return createBlock({
|
|
89
|
+
type: config_1.ConfigDataBlockType_Server.Filter,
|
|
90
|
+
key: config_1.blockFilterKey,
|
|
91
|
+
label: params.label || {
|
|
92
|
+
ru: 'Фильтры',
|
|
93
|
+
en: 'Filters',
|
|
94
|
+
},
|
|
95
|
+
icon: params.icon || BlockIcon.Value,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
exports.filter = filter;
|
|
99
|
+
function sort(params = {}) {
|
|
100
|
+
return createBlock({
|
|
101
|
+
type: config_1.ConfigDataBlockType_Server.Sort,
|
|
102
|
+
key: config_1.blockSortKey,
|
|
103
|
+
label: params.label || {
|
|
104
|
+
ru: 'Сортировка',
|
|
105
|
+
en: 'Sort',
|
|
106
|
+
},
|
|
107
|
+
icon: params.icon || BlockIcon.Value,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
exports.sort = sort;
|
|
111
|
+
function colorize(params = {}) {
|
|
112
|
+
return createBlock({
|
|
113
|
+
type: config_1.ConfigDataBlockType_Server.Colorizer,
|
|
114
|
+
key: config_1.blockColorizeKey,
|
|
115
|
+
label: params.label || {
|
|
116
|
+
ru: 'Цветовая дифференциация',
|
|
117
|
+
en: 'Colors',
|
|
118
|
+
},
|
|
119
|
+
icon: params.icon || BlockIcon.Value,
|
|
120
|
+
max: params.max || 0,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
exports.colorize = colorize;
|
|
124
|
+
function drilldown(params) {
|
|
125
|
+
return createBlock({
|
|
126
|
+
type: config_1.ConfigDataBlockType_Server.Drilldown,
|
|
127
|
+
key: (0, config_1.decodeDrilldownData)(params.source, params.additionalFilterSources || []),
|
|
128
|
+
label: params.label || {
|
|
129
|
+
ru: 'Drilldown',
|
|
130
|
+
en: 'Drilldown',
|
|
131
|
+
},
|
|
132
|
+
icon: BlockIcon.Value,
|
|
133
|
+
max: 4,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
exports.drilldown = drilldown;
|
|
137
|
+
class ViewSettingsItem {
|
|
138
|
+
constructor(_) {
|
|
139
|
+
if (_ !== token)
|
|
140
|
+
throw new Error('Illigal constructor');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.ViewSettingsItem = ViewSettingsItem;
|
|
144
|
+
function createViewSettingsItem(value) {
|
|
145
|
+
return Object.assign(new ViewSettingsItem(token), {
|
|
146
|
+
[view_settings_1.viewSettingsItemValue]: value,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function input(params) {
|
|
150
|
+
return createViewSettingsItem({
|
|
151
|
+
type: view_settings_1.ViewSettingsItemType.Input,
|
|
152
|
+
...params,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
exports.input = input;
|
|
156
|
+
function textArea(params) {
|
|
157
|
+
return createViewSettingsItem({
|
|
158
|
+
type: view_settings_1.ViewSettingsItemType.TextArea,
|
|
159
|
+
...params,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
exports.textArea = textArea;
|
|
163
|
+
function checkbox(params) {
|
|
164
|
+
return createViewSettingsItem({
|
|
165
|
+
type: view_settings_1.ViewSettingsItemType.Checkbox,
|
|
166
|
+
...params,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
exports.checkbox = checkbox;
|
|
170
|
+
function radio(params) {
|
|
171
|
+
return createViewSettingsItem({
|
|
172
|
+
type: view_settings_1.ViewSettingsItemType.Radio,
|
|
173
|
+
...params,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
exports.radio = radio;
|
|
177
|
+
function select(params) {
|
|
178
|
+
return createViewSettingsItem({
|
|
179
|
+
type: view_settings_1.ViewSettingsItemType.Select,
|
|
180
|
+
...params,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
exports.select = select;
|
|
184
|
+
function colorPicker(params) {
|
|
185
|
+
return createViewSettingsItem({
|
|
186
|
+
type: view_settings_1.ViewSettingsItemType.ColorPicker,
|
|
187
|
+
...params,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
exports.colorPicker = colorPicker;
|
|
191
|
+
function title(label) {
|
|
192
|
+
return createViewSettingsItem({
|
|
193
|
+
type: view_settings_1.ViewSettingsItemType.Title,
|
|
194
|
+
key: '',
|
|
195
|
+
label,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
exports.title = title;
|
package/data.d.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Для выборки данных, а также управлением фильтрами и сортировкой...
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
* @module Работа с данными
|
|
6
|
-
*/
|
|
7
|
-
export declare enum ColumnType {
|
|
8
|
-
String = "string",
|
|
9
|
-
Number = "number",
|
|
10
|
-
Boolean = "boolean",
|
|
11
|
-
Date = "date",
|
|
12
|
-
Array = "array",
|
|
13
|
-
Object = "object"
|
|
14
|
-
}
|
|
15
|
-
export declare enum FilterMethod {
|
|
16
|
-
Equal = "equally",
|
|
17
|
-
NotEqual = "not_equal",
|
|
18
|
-
GreaterThen = "gt",
|
|
19
|
-
LessThen = "lt",
|
|
20
|
-
GreaterThenOrEqual = "gte",
|
|
21
|
-
LessThenOrEqual = "lte",
|
|
22
|
-
Period = "period",
|
|
23
|
-
DateList = "date_list",
|
|
24
|
-
InList = "in_list",
|
|
25
|
-
NotInList = "nin_list",
|
|
26
|
-
StartsOnIndex = "starts_on_i",
|
|
27
|
-
StartsOn = "starts_on",
|
|
28
|
-
EndsOnIndex = "ends_on_i",
|
|
29
|
-
EndsOn = "ends_on",
|
|
30
|
-
ContainsIndex = "contains_i",
|
|
31
|
-
Contains = "contains",
|
|
32
|
-
NotContainIndex = "not_contain_i",
|
|
33
|
-
NotContain = "not_contain"
|
|
34
|
-
}
|
|
35
|
-
export declare enum SortDirection {
|
|
36
|
-
Asc = "ASC",
|
|
37
|
-
Desc = "DESC"
|
|
38
|
-
}
|
|
39
|
-
export declare enum Target {
|
|
40
|
-
Self = "self",
|
|
41
|
-
Other = "other",
|
|
42
|
-
All = "all"
|
|
43
|
-
}
|
|
44
|
-
export interface DataItem {
|
|
45
|
-
[path: string]: any;
|
|
46
|
-
}
|
|
47
|
-
export interface Column {
|
|
48
|
-
type: ColumnType;
|
|
49
|
-
id: number;
|
|
50
|
-
name: string;
|
|
51
|
-
path: string;
|
|
52
|
-
format: (value: any) => string;
|
|
53
|
-
}
|
|
54
|
-
export interface Filter {
|
|
55
|
-
column: Column;
|
|
56
|
-
method: FilterMethod;
|
|
57
|
-
value: string | number | string[] | number[];
|
|
58
|
-
}
|
|
59
|
-
export interface Sort {
|
|
60
|
-
column: Column;
|
|
61
|
-
direction: SortDirection;
|
|
62
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Для выборки данных, а также управлением фильтрами и сортировкой...
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* @module Работа с данными
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ColumnType {
|
|
8
|
+
String = "string",
|
|
9
|
+
Number = "number",
|
|
10
|
+
Boolean = "boolean",
|
|
11
|
+
Date = "date",
|
|
12
|
+
Array = "array",
|
|
13
|
+
Object = "object"
|
|
14
|
+
}
|
|
15
|
+
export declare enum FilterMethod {
|
|
16
|
+
Equal = "equally",
|
|
17
|
+
NotEqual = "not_equal",
|
|
18
|
+
GreaterThen = "gt",
|
|
19
|
+
LessThen = "lt",
|
|
20
|
+
GreaterThenOrEqual = "gte",
|
|
21
|
+
LessThenOrEqual = "lte",
|
|
22
|
+
Period = "period",
|
|
23
|
+
DateList = "date_list",
|
|
24
|
+
InList = "in_list",
|
|
25
|
+
NotInList = "nin_list",
|
|
26
|
+
StartsOnIndex = "starts_on_i",
|
|
27
|
+
StartsOn = "starts_on",
|
|
28
|
+
EndsOnIndex = "ends_on_i",
|
|
29
|
+
EndsOn = "ends_on",
|
|
30
|
+
ContainsIndex = "contains_i",
|
|
31
|
+
Contains = "contains",
|
|
32
|
+
NotContainIndex = "not_contain_i",
|
|
33
|
+
NotContain = "not_contain"
|
|
34
|
+
}
|
|
35
|
+
export declare enum SortDirection {
|
|
36
|
+
Asc = "ASC",
|
|
37
|
+
Desc = "DESC"
|
|
38
|
+
}
|
|
39
|
+
export declare enum Target {
|
|
40
|
+
Self = "self",
|
|
41
|
+
Other = "other",
|
|
42
|
+
All = "all"
|
|
43
|
+
}
|
|
44
|
+
export interface DataItem {
|
|
45
|
+
[path: string]: any;
|
|
46
|
+
}
|
|
47
|
+
export interface Column {
|
|
48
|
+
type: ColumnType;
|
|
49
|
+
id: number;
|
|
50
|
+
name: string;
|
|
51
|
+
path: string;
|
|
52
|
+
format: (value: any) => string;
|
|
53
|
+
}
|
|
54
|
+
export interface Filter {
|
|
55
|
+
column: Column;
|
|
56
|
+
method: FilterMethod;
|
|
57
|
+
value: string | number | string[] | number[];
|
|
58
|
+
}
|
|
59
|
+
export interface Sort {
|
|
60
|
+
column: Column;
|
|
61
|
+
direction: SortDirection;
|
|
62
|
+
}
|
package/data.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Для выборки данных, а также управлением фильтрами и сортировкой...
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
* @module Работа с данными
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Target = exports.SortDirection = exports.FilterMethod = exports.ColumnType = void 0;
|
|
10
|
-
// enums
|
|
11
|
-
var ColumnType;
|
|
12
|
-
(function (ColumnType) {
|
|
13
|
-
ColumnType["String"] = "string";
|
|
14
|
-
ColumnType["Number"] = "number";
|
|
15
|
-
ColumnType["Boolean"] = "boolean";
|
|
16
|
-
ColumnType["Date"] = "date";
|
|
17
|
-
ColumnType["Array"] = "array";
|
|
18
|
-
ColumnType["Object"] = "object";
|
|
19
|
-
})(ColumnType = exports.ColumnType || (exports.ColumnType = {}));
|
|
20
|
-
var FilterMethod;
|
|
21
|
-
(function (FilterMethod) {
|
|
22
|
-
FilterMethod["Equal"] = "equally";
|
|
23
|
-
FilterMethod["NotEqual"] = "not_equal";
|
|
24
|
-
FilterMethod["GreaterThen"] = "gt";
|
|
25
|
-
FilterMethod["LessThen"] = "lt";
|
|
26
|
-
FilterMethod["GreaterThenOrEqual"] = "gte";
|
|
27
|
-
FilterMethod["LessThenOrEqual"] = "lte";
|
|
28
|
-
FilterMethod["Period"] = "period";
|
|
29
|
-
FilterMethod["DateList"] = "date_list";
|
|
30
|
-
FilterMethod["InList"] = "in_list";
|
|
31
|
-
FilterMethod["NotInList"] = "nin_list";
|
|
32
|
-
FilterMethod["StartsOnIndex"] = "starts_on_i";
|
|
33
|
-
FilterMethod["StartsOn"] = "starts_on";
|
|
34
|
-
FilterMethod["EndsOnIndex"] = "ends_on_i";
|
|
35
|
-
FilterMethod["EndsOn"] = "ends_on";
|
|
36
|
-
FilterMethod["ContainsIndex"] = "contains_i";
|
|
37
|
-
FilterMethod["Contains"] = "contains";
|
|
38
|
-
FilterMethod["NotContainIndex"] = "not_contain_i";
|
|
39
|
-
FilterMethod["NotContain"] = "not_contain";
|
|
40
|
-
})(FilterMethod = exports.FilterMethod || (exports.FilterMethod = {}));
|
|
41
|
-
var SortDirection;
|
|
42
|
-
(function (SortDirection) {
|
|
43
|
-
SortDirection["Asc"] = "ASC";
|
|
44
|
-
SortDirection["Desc"] = "DESC";
|
|
45
|
-
})(SortDirection = exports.SortDirection || (exports.SortDirection = {}));
|
|
46
|
-
var Target;
|
|
47
|
-
(function (Target) {
|
|
48
|
-
Target["Self"] = "self";
|
|
49
|
-
Target["Other"] = "other";
|
|
50
|
-
Target["All"] = "all";
|
|
51
|
-
})(Target = exports.Target || (exports.Target = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Для выборки данных, а также управлением фильтрами и сортировкой...
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
* @module Работа с данными
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Target = exports.SortDirection = exports.FilterMethod = exports.ColumnType = void 0;
|
|
10
|
+
// enums
|
|
11
|
+
var ColumnType;
|
|
12
|
+
(function (ColumnType) {
|
|
13
|
+
ColumnType["String"] = "string";
|
|
14
|
+
ColumnType["Number"] = "number";
|
|
15
|
+
ColumnType["Boolean"] = "boolean";
|
|
16
|
+
ColumnType["Date"] = "date";
|
|
17
|
+
ColumnType["Array"] = "array";
|
|
18
|
+
ColumnType["Object"] = "object";
|
|
19
|
+
})(ColumnType = exports.ColumnType || (exports.ColumnType = {}));
|
|
20
|
+
var FilterMethod;
|
|
21
|
+
(function (FilterMethod) {
|
|
22
|
+
FilterMethod["Equal"] = "equally";
|
|
23
|
+
FilterMethod["NotEqual"] = "not_equal";
|
|
24
|
+
FilterMethod["GreaterThen"] = "gt";
|
|
25
|
+
FilterMethod["LessThen"] = "lt";
|
|
26
|
+
FilterMethod["GreaterThenOrEqual"] = "gte";
|
|
27
|
+
FilterMethod["LessThenOrEqual"] = "lte";
|
|
28
|
+
FilterMethod["Period"] = "period";
|
|
29
|
+
FilterMethod["DateList"] = "date_list";
|
|
30
|
+
FilterMethod["InList"] = "in_list";
|
|
31
|
+
FilterMethod["NotInList"] = "nin_list";
|
|
32
|
+
FilterMethod["StartsOnIndex"] = "starts_on_i";
|
|
33
|
+
FilterMethod["StartsOn"] = "starts_on";
|
|
34
|
+
FilterMethod["EndsOnIndex"] = "ends_on_i";
|
|
35
|
+
FilterMethod["EndsOn"] = "ends_on";
|
|
36
|
+
FilterMethod["ContainsIndex"] = "contains_i";
|
|
37
|
+
FilterMethod["Contains"] = "contains";
|
|
38
|
+
FilterMethod["NotContainIndex"] = "not_contain_i";
|
|
39
|
+
FilterMethod["NotContain"] = "not_contain";
|
|
40
|
+
})(FilterMethod = exports.FilterMethod || (exports.FilterMethod = {}));
|
|
41
|
+
var SortDirection;
|
|
42
|
+
(function (SortDirection) {
|
|
43
|
+
SortDirection["Asc"] = "ASC";
|
|
44
|
+
SortDirection["Desc"] = "DESC";
|
|
45
|
+
})(SortDirection = exports.SortDirection || (exports.SortDirection = {}));
|
|
46
|
+
var Target;
|
|
47
|
+
(function (Target) {
|
|
48
|
+
Target["Self"] = "self";
|
|
49
|
+
Target["Other"] = "other";
|
|
50
|
+
Target["All"] = "all";
|
|
51
|
+
})(Target = exports.Target || (exports.Target = {}));
|
package/declare.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Для того, чтобы виджет получал и управлял данными,
|
|
3
|
-
* класс виджета необходимо декорировать функцией Declare:
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* import { Declare, Widget } from 'plmt-constructor-sdk';
|
|
7
|
-
*
|
|
8
|
-
* @Declare()
|
|
9
|
-
* class MyWidget extends Widget {}
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* @packageDocumentation
|
|
13
|
-
* @module Регистрация виджета
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Функция-декоратор
|
|
17
|
-
*/
|
|
18
|
-
export declare function Declare(params?: {
|
|
19
|
-
provideCssVariables: boolean;
|
|
20
|
-
}): ClassDecorator;
|
|
1
|
+
/**
|
|
2
|
+
* Для того, чтобы виджет получал и управлял данными,
|
|
3
|
+
* класс виджета необходимо декорировать функцией Declare:
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { Declare, Widget } from 'plmt-constructor-sdk';
|
|
7
|
+
*
|
|
8
|
+
* @Declare()
|
|
9
|
+
* class MyWidget extends Widget {}
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
* @module Регистрация виджета
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Функция-декоратор
|
|
17
|
+
*/
|
|
18
|
+
export declare function Declare(params?: {
|
|
19
|
+
provideCssVariables: boolean;
|
|
20
|
+
}): ClassDecorator;
|