plmt-constructor-sdk 0.13.39 → 0.14.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 +44 -0
- package/__internal__/view-settings.js +32 -1
- package/config.d.ts +10 -1
- package/declare.d.ts +0 -8
- package/declare.js +0 -5
- package/package.json +1 -1
- package/widget.d.ts +0 -14
|
@@ -9,12 +9,56 @@ export declare enum ViewSettingsItemType {
|
|
|
9
9
|
TextArea = "textArea",
|
|
10
10
|
ConditionalFormatters = "conditions"
|
|
11
11
|
}
|
|
12
|
+
export declare type TooltipPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
13
|
+
export declare type TooltipTrigger = 'hover' | 'focus' | 'click' | 'manual';
|
|
14
|
+
export interface TooltipSettings {
|
|
15
|
+
content?: string;
|
|
16
|
+
placement?: TooltipPlacement;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
distance?: number;
|
|
19
|
+
skidding?: number;
|
|
20
|
+
trigger?: TooltipTrigger | string;
|
|
21
|
+
hoist?: boolean;
|
|
22
|
+
maxWidth?: string;
|
|
23
|
+
hideDelay?: number;
|
|
24
|
+
showDelay?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare enum InputType {
|
|
27
|
+
Text = "text",
|
|
28
|
+
Number = "number",
|
|
29
|
+
Password = "password",
|
|
30
|
+
Email = "email",
|
|
31
|
+
Tel = "tel",
|
|
32
|
+
Url = "url",
|
|
33
|
+
Search = "search",
|
|
34
|
+
Date = "date",
|
|
35
|
+
Time = "time",
|
|
36
|
+
DateTimeLocal = "datetime-local",
|
|
37
|
+
Month = "month",
|
|
38
|
+
Week = "week",
|
|
39
|
+
Color = "color",
|
|
40
|
+
Range = "range",
|
|
41
|
+
File = "file",
|
|
42
|
+
Hidden = "hidden",
|
|
43
|
+
Checkbox = "checkbox",
|
|
44
|
+
Radio = "radio",
|
|
45
|
+
Submit = "submit",
|
|
46
|
+
Reset = "reset",
|
|
47
|
+
Button = "button",
|
|
48
|
+
Image = "image"
|
|
49
|
+
}
|
|
12
50
|
export interface ViewSettingsItemValue {
|
|
13
51
|
type: ViewSettingsItemType;
|
|
14
52
|
key: string;
|
|
15
53
|
label: Text;
|
|
16
54
|
placeholder?: Text;
|
|
55
|
+
disabled?: true;
|
|
56
|
+
clearable?: true;
|
|
57
|
+
flex?: true;
|
|
58
|
+
id?: number;
|
|
59
|
+
typeInput?: InputType;
|
|
17
60
|
defaultValue?: any;
|
|
61
|
+
tooltip?: TooltipSettings;
|
|
18
62
|
options?: {
|
|
19
63
|
label: Text;
|
|
20
64
|
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";
|
|
@@ -12,6 +12,31 @@ var ViewSettingsItemType;
|
|
|
12
12
|
ViewSettingsItemType["TextArea"] = "textArea";
|
|
13
13
|
ViewSettingsItemType["ConditionalFormatters"] = "conditions";
|
|
14
14
|
})(ViewSettingsItemType = exports.ViewSettingsItemType || (exports.ViewSettingsItemType = {}));
|
|
15
|
+
var InputType;
|
|
16
|
+
(function (InputType) {
|
|
17
|
+
InputType["Text"] = "text";
|
|
18
|
+
InputType["Number"] = "number";
|
|
19
|
+
InputType["Password"] = "password";
|
|
20
|
+
InputType["Email"] = "email";
|
|
21
|
+
InputType["Tel"] = "tel";
|
|
22
|
+
InputType["Url"] = "url";
|
|
23
|
+
InputType["Search"] = "search";
|
|
24
|
+
InputType["Date"] = "date";
|
|
25
|
+
InputType["Time"] = "time";
|
|
26
|
+
InputType["DateTimeLocal"] = "datetime-local";
|
|
27
|
+
InputType["Month"] = "month";
|
|
28
|
+
InputType["Week"] = "week";
|
|
29
|
+
InputType["Color"] = "color";
|
|
30
|
+
InputType["Range"] = "range";
|
|
31
|
+
InputType["File"] = "file";
|
|
32
|
+
InputType["Hidden"] = "hidden";
|
|
33
|
+
InputType["Checkbox"] = "checkbox";
|
|
34
|
+
InputType["Radio"] = "radio";
|
|
35
|
+
InputType["Submit"] = "submit";
|
|
36
|
+
InputType["Reset"] = "reset";
|
|
37
|
+
InputType["Button"] = "button";
|
|
38
|
+
InputType["Image"] = "image";
|
|
39
|
+
})(InputType = exports.InputType || (exports.InputType = {}));
|
|
15
40
|
exports.viewSettingsItemValue = '418d9556-a046-4623-be0b-4f4f69ccb783';
|
|
16
41
|
function viewSettingsExtract(viewSettings) {
|
|
17
42
|
return viewSettings
|
|
@@ -21,7 +46,13 @@ function viewSettingsExtract(viewSettings) {
|
|
|
21
46
|
key: item.key,
|
|
22
47
|
label: item.label,
|
|
23
48
|
placeholder: item.placeholder,
|
|
49
|
+
disabled: item.disabled,
|
|
50
|
+
clearable: item.clearable,
|
|
51
|
+
flex: item.flex,
|
|
52
|
+
id: item.id,
|
|
53
|
+
typeInput: item.typeInput,
|
|
24
54
|
defaultValue: valueConversion(item.type, item.defaultValue),
|
|
55
|
+
tooltip: item.tooltip,
|
|
25
56
|
options: item.options || [],
|
|
26
57
|
span: getSpan(item.span),
|
|
27
58
|
}));
|
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",
|
|
@@ -149,6 +149,12 @@ export declare function input(params: {
|
|
|
149
149
|
span?: number;
|
|
150
150
|
placeholder?: Text;
|
|
151
151
|
defaultValue?: string;
|
|
152
|
+
tooltip?: TooltipSettings;
|
|
153
|
+
disabled?: true;
|
|
154
|
+
clearable?: true;
|
|
155
|
+
flex?: true;
|
|
156
|
+
id?: number;
|
|
157
|
+
typeInput?: InputType;
|
|
152
158
|
}): ViewSettingsItem;
|
|
153
159
|
export declare function textArea(params: {
|
|
154
160
|
key: string;
|
|
@@ -162,6 +168,7 @@ export declare function checkbox(params: {
|
|
|
162
168
|
label: Text;
|
|
163
169
|
span?: number;
|
|
164
170
|
defaultValue?: boolean;
|
|
171
|
+
tooltip?: TooltipSettings;
|
|
165
172
|
}): ViewSettingsItem;
|
|
166
173
|
export declare function radio(params: {
|
|
167
174
|
key: string;
|
|
@@ -182,12 +189,14 @@ export declare function select(params: {
|
|
|
182
189
|
}[];
|
|
183
190
|
span?: number;
|
|
184
191
|
defaultValue?: string;
|
|
192
|
+
tooltip?: TooltipSettings;
|
|
185
193
|
}): ViewSettingsItem;
|
|
186
194
|
export declare function colorPicker(params: {
|
|
187
195
|
key: string;
|
|
188
196
|
label: Text;
|
|
189
197
|
span?: number;
|
|
190
198
|
defaultValue?: string;
|
|
199
|
+
tooltip?: TooltipSettings;
|
|
191
200
|
}): ViewSettingsItem;
|
|
192
201
|
export declare function title(label: any): ViewSettingsItem;
|
|
193
202
|
export declare function conditionalFormatters(key: string, label?: Text): ViewSettingsItem;
|
package/declare.d.ts
CHANGED
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
* @module Регистрация виджета
|
|
14
14
|
*/
|
|
15
|
-
import { WidgetState } from './widget';
|
|
16
|
-
declare global {
|
|
17
|
-
interface Window {
|
|
18
|
-
getWidgetState: {
|
|
19
|
-
[uid: string]: () => WidgetState;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
15
|
/**
|
|
24
16
|
* Функция-декоратор
|
|
25
17
|
*/
|
package/declare.js
CHANGED
|
@@ -35,11 +35,6 @@ function Declare(params) {
|
|
|
35
35
|
const uid = readFromUrl('uid');
|
|
36
36
|
if (uid)
|
|
37
37
|
instance.uid = uid;
|
|
38
|
-
if (typeof instance.getWidgetState === 'function' && uid) {
|
|
39
|
-
const getState = window.parent['getWidgetState'] || {};
|
|
40
|
-
getState[uid] = instance.getWidgetState.bind(instance);
|
|
41
|
-
window.parent.getWidgetState = getState;
|
|
42
|
-
}
|
|
43
38
|
Object.assign(instance, {
|
|
44
39
|
viewSettings: {},
|
|
45
40
|
ready() {
|
package/package.json
CHANGED
package/widget.d.ts
CHANGED
|
@@ -18,11 +18,6 @@ export declare abstract class Widget {
|
|
|
18
18
|
ready(): void;
|
|
19
19
|
onInit(): void;
|
|
20
20
|
abstract onChange(): void;
|
|
21
|
-
/**
|
|
22
|
-
* Метод для получения состояния виджета
|
|
23
|
-
* @return `WidgetState`
|
|
24
|
-
*/
|
|
25
|
-
abstract getWidgetState(): WidgetState;
|
|
26
21
|
/**
|
|
27
22
|
* Обработчик события кастомного запроса
|
|
28
23
|
* @param customData WidgetCustomProvide
|
|
@@ -32,15 +27,6 @@ export declare abstract class Widget {
|
|
|
32
27
|
onThemeChange(): void;
|
|
33
28
|
onLangChange(): void;
|
|
34
29
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Состояние виджета
|
|
37
|
-
*/
|
|
38
|
-
export interface WidgetState {
|
|
39
|
-
/** Лимит */
|
|
40
|
-
limit?: number;
|
|
41
|
-
/** Смещение */
|
|
42
|
-
offset?: number;
|
|
43
|
-
}
|
|
44
30
|
/**
|
|
45
31
|
* Интерфейс для виджета с одним источником данных
|
|
46
32
|
*/
|