plmt-constructor-sdk 0.13.40 → 0.15.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/__internal__/view-settings.d.ts +47 -0
- package/__internal__/view-settings.js +35 -1
- package/config.d.ts +28 -2
- package/config.js +34 -4
- package/package.json +1 -1
|
@@ -5,16 +5,63 @@ export declare enum ViewSettingsItemType {
|
|
|
5
5
|
Radio = "radio",
|
|
6
6
|
Select = "select",
|
|
7
7
|
ColorPicker = "color-picker",
|
|
8
|
+
Group = "group",
|
|
8
9
|
Title = "title",
|
|
10
|
+
Subtitle = "subtitle",
|
|
11
|
+
SectionLabel = "sectionLabel",
|
|
9
12
|
TextArea = "textArea",
|
|
10
13
|
ConditionalFormatters = "conditions"
|
|
11
14
|
}
|
|
15
|
+
export declare type TooltipPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
16
|
+
export declare type TooltipTrigger = 'hover' | 'focus' | 'click' | 'manual';
|
|
17
|
+
export interface TooltipSettings {
|
|
18
|
+
content?: string;
|
|
19
|
+
placement?: TooltipPlacement;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
distance?: number;
|
|
22
|
+
skidding?: number;
|
|
23
|
+
trigger?: TooltipTrigger | string;
|
|
24
|
+
hoist?: boolean;
|
|
25
|
+
maxWidth?: string;
|
|
26
|
+
hideDelay?: number;
|
|
27
|
+
showDelay?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare enum InputType {
|
|
30
|
+
Text = "text",
|
|
31
|
+
Number = "number",
|
|
32
|
+
Password = "password",
|
|
33
|
+
Email = "email",
|
|
34
|
+
Tel = "tel",
|
|
35
|
+
Url = "url",
|
|
36
|
+
Search = "search",
|
|
37
|
+
Date = "date",
|
|
38
|
+
Time = "time",
|
|
39
|
+
DateTimeLocal = "datetime-local",
|
|
40
|
+
Month = "month",
|
|
41
|
+
Week = "week",
|
|
42
|
+
Color = "color",
|
|
43
|
+
Range = "range",
|
|
44
|
+
File = "file",
|
|
45
|
+
Hidden = "hidden",
|
|
46
|
+
Checkbox = "checkbox",
|
|
47
|
+
Radio = "radio",
|
|
48
|
+
Submit = "submit",
|
|
49
|
+
Reset = "reset",
|
|
50
|
+
Button = "button",
|
|
51
|
+
Image = "image"
|
|
52
|
+
}
|
|
12
53
|
export interface ViewSettingsItemValue {
|
|
13
54
|
type: ViewSettingsItemType;
|
|
14
55
|
key: string;
|
|
15
56
|
label: Text;
|
|
16
57
|
placeholder?: Text;
|
|
58
|
+
disabled?: true;
|
|
59
|
+
clearable?: true;
|
|
60
|
+
flex?: true;
|
|
61
|
+
id?: number;
|
|
62
|
+
typeInput?: InputType;
|
|
17
63
|
defaultValue?: any;
|
|
64
|
+
tooltip?: TooltipSettings;
|
|
18
65
|
options?: {
|
|
19
66
|
label: Text;
|
|
20
67
|
value: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.valueConversion = exports.viewSettingsExtract = exports.viewSettingsItemValue = exports.ViewSettingsItemType = void 0;
|
|
3
|
+
exports.valueConversion = exports.viewSettingsExtract = exports.viewSettingsItemValue = exports.InputType = exports.ViewSettingsItemType = void 0;
|
|
4
4
|
var ViewSettingsItemType;
|
|
5
5
|
(function (ViewSettingsItemType) {
|
|
6
6
|
ViewSettingsItemType["Input"] = "text";
|
|
@@ -8,10 +8,38 @@ var ViewSettingsItemType;
|
|
|
8
8
|
ViewSettingsItemType["Radio"] = "radio";
|
|
9
9
|
ViewSettingsItemType["Select"] = "select";
|
|
10
10
|
ViewSettingsItemType["ColorPicker"] = "color-picker";
|
|
11
|
+
ViewSettingsItemType["Group"] = "group";
|
|
11
12
|
ViewSettingsItemType["Title"] = "title";
|
|
13
|
+
ViewSettingsItemType["Subtitle"] = "subtitle";
|
|
14
|
+
ViewSettingsItemType["SectionLabel"] = "sectionLabel";
|
|
12
15
|
ViewSettingsItemType["TextArea"] = "textArea";
|
|
13
16
|
ViewSettingsItemType["ConditionalFormatters"] = "conditions";
|
|
14
17
|
})(ViewSettingsItemType = exports.ViewSettingsItemType || (exports.ViewSettingsItemType = {}));
|
|
18
|
+
var InputType;
|
|
19
|
+
(function (InputType) {
|
|
20
|
+
InputType["Text"] = "text";
|
|
21
|
+
InputType["Number"] = "number";
|
|
22
|
+
InputType["Password"] = "password";
|
|
23
|
+
InputType["Email"] = "email";
|
|
24
|
+
InputType["Tel"] = "tel";
|
|
25
|
+
InputType["Url"] = "url";
|
|
26
|
+
InputType["Search"] = "search";
|
|
27
|
+
InputType["Date"] = "date";
|
|
28
|
+
InputType["Time"] = "time";
|
|
29
|
+
InputType["DateTimeLocal"] = "datetime-local";
|
|
30
|
+
InputType["Month"] = "month";
|
|
31
|
+
InputType["Week"] = "week";
|
|
32
|
+
InputType["Color"] = "color";
|
|
33
|
+
InputType["Range"] = "range";
|
|
34
|
+
InputType["File"] = "file";
|
|
35
|
+
InputType["Hidden"] = "hidden";
|
|
36
|
+
InputType["Checkbox"] = "checkbox";
|
|
37
|
+
InputType["Radio"] = "radio";
|
|
38
|
+
InputType["Submit"] = "submit";
|
|
39
|
+
InputType["Reset"] = "reset";
|
|
40
|
+
InputType["Button"] = "button";
|
|
41
|
+
InputType["Image"] = "image";
|
|
42
|
+
})(InputType = exports.InputType || (exports.InputType = {}));
|
|
15
43
|
exports.viewSettingsItemValue = '418d9556-a046-4623-be0b-4f4f69ccb783';
|
|
16
44
|
function viewSettingsExtract(viewSettings) {
|
|
17
45
|
return viewSettings
|
|
@@ -21,7 +49,13 @@ function viewSettingsExtract(viewSettings) {
|
|
|
21
49
|
key: item.key,
|
|
22
50
|
label: item.label,
|
|
23
51
|
placeholder: item.placeholder,
|
|
52
|
+
disabled: item.disabled,
|
|
53
|
+
clearable: item.clearable,
|
|
54
|
+
flex: item.flex,
|
|
55
|
+
id: item.id,
|
|
56
|
+
typeInput: item.typeInput,
|
|
24
57
|
defaultValue: valueConversion(item.type, item.defaultValue),
|
|
58
|
+
tooltip: item.tooltip,
|
|
25
59
|
options: item.options || [],
|
|
26
60
|
span: getSpan(item.span),
|
|
27
61
|
}));
|
package/config.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { ColumnType } from './data';
|
|
8
8
|
import { DataSettings as WidgetDataSettings, DataSettingsMap as WidgetDataSettingsMap, ViewSettings } from './widget';
|
|
9
9
|
import { configDataBlock_Server } from './__internal__/config';
|
|
10
|
-
import { viewSettingsItemValue } from './__internal__/view-settings';
|
|
10
|
+
import { TooltipSettings, InputType, viewSettingsItemValue } from './__internal__/view-settings';
|
|
11
11
|
export declare enum DataQueryMethod {
|
|
12
12
|
Table = "table",
|
|
13
13
|
PivotTable = "pivot",
|
|
@@ -136,6 +136,7 @@ export interface CreateViewSettings<DataSettings extends WidgetDataSettings | Wi
|
|
|
136
136
|
}): ViewSettingsItem[];
|
|
137
137
|
}
|
|
138
138
|
export declare type ViewSettingsValidator = (value: any) => Text | null;
|
|
139
|
+
declare type ViewSettingsLabel = Text | string;
|
|
139
140
|
export interface ViewSettingsValidation {
|
|
140
141
|
[key: string]: ViewSettingsValidator;
|
|
141
142
|
}
|
|
@@ -149,6 +150,12 @@ export declare function input(params: {
|
|
|
149
150
|
span?: number;
|
|
150
151
|
placeholder?: Text;
|
|
151
152
|
defaultValue?: string;
|
|
153
|
+
tooltip?: TooltipSettings;
|
|
154
|
+
disabled?: true;
|
|
155
|
+
clearable?: true;
|
|
156
|
+
flex?: true;
|
|
157
|
+
id?: number;
|
|
158
|
+
typeInput?: InputType;
|
|
152
159
|
}): ViewSettingsItem;
|
|
153
160
|
export declare function textArea(params: {
|
|
154
161
|
key: string;
|
|
@@ -162,6 +169,7 @@ export declare function checkbox(params: {
|
|
|
162
169
|
label: Text;
|
|
163
170
|
span?: number;
|
|
164
171
|
defaultValue?: boolean;
|
|
172
|
+
tooltip?: TooltipSettings;
|
|
165
173
|
}): ViewSettingsItem;
|
|
166
174
|
export declare function radio(params: {
|
|
167
175
|
key: string;
|
|
@@ -182,12 +190,30 @@ export declare function select(params: {
|
|
|
182
190
|
}[];
|
|
183
191
|
span?: number;
|
|
184
192
|
defaultValue?: string;
|
|
193
|
+
tooltip?: TooltipSettings;
|
|
185
194
|
}): ViewSettingsItem;
|
|
186
195
|
export declare function colorPicker(params: {
|
|
187
196
|
key: string;
|
|
188
197
|
label: Text;
|
|
189
198
|
span?: number;
|
|
190
199
|
defaultValue?: string;
|
|
200
|
+
tooltip?: TooltipSettings;
|
|
191
201
|
}): ViewSettingsItem;
|
|
192
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Создаёт collapsible секцию в панели настроек
|
|
204
|
+
*/
|
|
205
|
+
export declare function group(label: ViewSettingsLabel): ViewSettingsItem;
|
|
206
|
+
/**
|
|
207
|
+
* @deprecated Используйте group(), старый title() оставлен как alias для обратной совместимости
|
|
208
|
+
*/
|
|
209
|
+
export declare function title(label: ViewSettingsLabel): ViewSettingsItem;
|
|
210
|
+
/**
|
|
211
|
+
* Создаёт внутренний подзаголовок внутри текущей секции настроек
|
|
212
|
+
*/
|
|
213
|
+
export declare function subtitle(label: ViewSettingsLabel): ViewSettingsItem;
|
|
214
|
+
/**
|
|
215
|
+
* Создаёт вложенный заголовок внутри секции настроек
|
|
216
|
+
*/
|
|
217
|
+
export declare function sectionLabel(label: ViewSettingsLabel): ViewSettingsItem;
|
|
193
218
|
export declare function conditionalFormatters(key: string, label?: Text): ViewSettingsItem;
|
|
219
|
+
export {};
|
package/config.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module Конфигурация
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.conditionalFormatters = 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;
|
|
9
|
+
exports.conditionalFormatters = exports.sectionLabel = exports.subtitle = exports.title = exports.group = 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
10
|
const data_1 = require("./data");
|
|
11
11
|
const config_1 = require("./__internal__/config");
|
|
12
12
|
const dataset_1 = require("./__internal__/dataset");
|
|
@@ -149,6 +149,9 @@ function createViewSettingsItem(value) {
|
|
|
149
149
|
[view_settings_1.viewSettingsItemValue]: value,
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
+
function toText(label) {
|
|
153
|
+
return typeof label === 'string' ? { ru: label, en: label } : label;
|
|
154
|
+
}
|
|
152
155
|
function input(params) {
|
|
153
156
|
return createViewSettingsItem({
|
|
154
157
|
type: view_settings_1.ViewSettingsItemType.Input,
|
|
@@ -191,14 +194,41 @@ function colorPicker(params) {
|
|
|
191
194
|
});
|
|
192
195
|
}
|
|
193
196
|
exports.colorPicker = colorPicker;
|
|
194
|
-
function
|
|
197
|
+
function layoutItem(type, label) {
|
|
195
198
|
return createViewSettingsItem({
|
|
196
|
-
type
|
|
199
|
+
type,
|
|
197
200
|
key: '',
|
|
198
|
-
label,
|
|
201
|
+
label: toText(label),
|
|
199
202
|
});
|
|
200
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Создаёт collapsible секцию в панели настроек
|
|
206
|
+
*/
|
|
207
|
+
function group(label) {
|
|
208
|
+
return layoutItem(view_settings_1.ViewSettingsItemType.Group, label);
|
|
209
|
+
}
|
|
210
|
+
exports.group = group;
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated Используйте group(), старый title() оставлен как alias для обратной совместимости
|
|
213
|
+
*/
|
|
214
|
+
function title(label) {
|
|
215
|
+
return layoutItem(view_settings_1.ViewSettingsItemType.Title, label);
|
|
216
|
+
}
|
|
201
217
|
exports.title = title;
|
|
218
|
+
/**
|
|
219
|
+
* Создаёт внутренний подзаголовок внутри текущей секции настроек
|
|
220
|
+
*/
|
|
221
|
+
function subtitle(label) {
|
|
222
|
+
return layoutItem(view_settings_1.ViewSettingsItemType.Subtitle, label);
|
|
223
|
+
}
|
|
224
|
+
exports.subtitle = subtitle;
|
|
225
|
+
/**
|
|
226
|
+
* Создаёт вложенный заголовок внутри секции настроек
|
|
227
|
+
*/
|
|
228
|
+
function sectionLabel(label) {
|
|
229
|
+
return layoutItem(view_settings_1.ViewSettingsItemType.SectionLabel, label);
|
|
230
|
+
}
|
|
231
|
+
exports.sectionLabel = sectionLabel;
|
|
202
232
|
function conditionalFormatters(key, label) {
|
|
203
233
|
return createViewSettingsItem({
|
|
204
234
|
type: view_settings_1.ViewSettingsItemType.ConditionalFormatters,
|