plmt-constructor-sdk 0.17.7 → 0.17.10
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__/config.d.ts +0 -6
- package/__internal__/config.js +1 -8
- package/__internal__/view-settings.d.ts +3 -0
- package/__internal__/view-settings.js +2 -0
- package/conditional-format/conditions.d.ts +2 -1
- package/conditional-format/conditions.js +4 -5
- package/conditional-format/constants.d.ts +0 -6
- package/conditional-format/constants.js +1 -8
- package/config.d.ts +8 -57
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/view-settings-params.d.ts +63 -0
- package/view-settings-params.js +8 -0
package/__internal__/config.d.ts
CHANGED
|
@@ -20,12 +20,6 @@ export declare enum DataQueryFunction_Server {
|
|
|
20
20
|
Count = "COUNT",
|
|
21
21
|
CountDistinct = "COUNT_DISTINCT"
|
|
22
22
|
}
|
|
23
|
-
export declare enum ColumnType_Server {
|
|
24
|
-
String = 0,
|
|
25
|
-
Number = 1,
|
|
26
|
-
Date = 2,
|
|
27
|
-
Boolean = 3
|
|
28
|
-
}
|
|
29
23
|
export interface Config_Server {
|
|
30
24
|
label: Text;
|
|
31
25
|
icon: string;
|
package/__internal__/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encodeDrilldownData = exports.decodeDrilldownData = exports.blockColorizeKey = exports.blockSortKey = exports.blockFilterKey = exports.configDataBlock_Server = exports.
|
|
3
|
+
exports.encodeDrilldownData = exports.decodeDrilldownData = exports.blockColorizeKey = exports.blockSortKey = exports.blockFilterKey = exports.configDataBlock_Server = exports.DataQueryFunction_Server = exports.ConfigDataBlockType_Server = void 0;
|
|
4
4
|
// enums
|
|
5
5
|
var ConfigDataBlockType_Server;
|
|
6
6
|
(function (ConfigDataBlockType_Server) {
|
|
@@ -22,13 +22,6 @@ var DataQueryFunction_Server;
|
|
|
22
22
|
DataQueryFunction_Server["Count"] = "COUNT";
|
|
23
23
|
DataQueryFunction_Server["CountDistinct"] = "COUNT_DISTINCT";
|
|
24
24
|
})(DataQueryFunction_Server = exports.DataQueryFunction_Server || (exports.DataQueryFunction_Server = {}));
|
|
25
|
-
var ColumnType_Server;
|
|
26
|
-
(function (ColumnType_Server) {
|
|
27
|
-
ColumnType_Server[ColumnType_Server["String"] = 0] = "String";
|
|
28
|
-
ColumnType_Server[ColumnType_Server["Number"] = 1] = "Number";
|
|
29
|
-
ColumnType_Server[ColumnType_Server["Date"] = 2] = "Date";
|
|
30
|
-
ColumnType_Server[ColumnType_Server["Boolean"] = 3] = "Boolean";
|
|
31
|
-
})(ColumnType_Server = exports.ColumnType_Server || (exports.ColumnType_Server = {}));
|
|
32
25
|
exports.configDataBlock_Server = '8316067a-d04b-4b21-bd4d-35529846617b';
|
|
33
26
|
exports.blockFilterKey = '34642664-dbd1-4e35-b0ea-2eaabe796b48';
|
|
34
27
|
exports.blockSortKey = '2c849ed6-6105-4aa2-a961-9f95135dfe3b';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Text, ViewSettingsItem } from '../config';
|
|
2
|
+
import type { AffixContent } from '../view-settings-params';
|
|
2
3
|
export declare enum ViewSettingsItemType {
|
|
3
4
|
Input = "text",
|
|
4
5
|
Checkbox = "checkbox",
|
|
@@ -68,6 +69,8 @@ export interface ViewSettingsItemValue {
|
|
|
68
69
|
}[];
|
|
69
70
|
span?: number;
|
|
70
71
|
invalidChars?: string[];
|
|
72
|
+
prefix?: AffixContent;
|
|
73
|
+
suffix?: AffixContent;
|
|
71
74
|
}
|
|
72
75
|
export declare const viewSettingsItemValue = "418d9556-a046-4623-be0b-4f4f69ccb783";
|
|
73
76
|
export declare function viewSettingsExtract(viewSettings: ViewSettingsItem[]): ViewSettingsItemValue[];
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isFulfillingCondition = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
4
|
const data_1 = require("../data");
|
|
6
5
|
function isFulfillingCondition(type, cellValue, condition) {
|
|
7
6
|
const method = condition.condition;
|
|
8
7
|
const conditionValue = condition.value;
|
|
9
8
|
switch (type) {
|
|
10
|
-
case
|
|
9
|
+
case data_1.ColumnType.String:
|
|
11
10
|
return isFulfillingStringCondition(method, cellValue, conditionValue);
|
|
12
|
-
case
|
|
13
|
-
case
|
|
11
|
+
case data_1.ColumnType.Number:
|
|
12
|
+
case data_1.ColumnType.Boolean:
|
|
14
13
|
const value = Array.isArray(conditionValue)
|
|
15
14
|
? conditionValue.map((item) => Number(item))
|
|
16
15
|
: conditionValue;
|
|
17
16
|
return isFulfillingNumberCondition(method, cellValue, value);
|
|
18
|
-
case
|
|
17
|
+
case data_1.ColumnType.Date:
|
|
19
18
|
const cellDate = new Date(cellValue);
|
|
20
19
|
if (Array.isArray(conditionValue)) {
|
|
21
20
|
if (conditionValue.length < 2)
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COLOR_STEPS =
|
|
4
|
-
var ColumnType;
|
|
5
|
-
(function (ColumnType) {
|
|
6
|
-
ColumnType[ColumnType["String"] = 0] = "String";
|
|
7
|
-
ColumnType[ColumnType["Number"] = 1] = "Number";
|
|
8
|
-
ColumnType[ColumnType["Date"] = 2] = "Date";
|
|
9
|
-
ColumnType[ColumnType["Boolean"] = 3] = "Boolean";
|
|
10
|
-
})(ColumnType = exports.ColumnType || (exports.ColumnType = {}));
|
|
3
|
+
exports.COLOR_STEPS = void 0;
|
|
11
4
|
exports.COLOR_STEPS = 128;
|
package/config.d.ts
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
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 {
|
|
10
|
+
import { viewSettingsItemValue } from './__internal__/view-settings';
|
|
11
|
+
import type { CheckboxParams, ColorPickerParams, InputParams, RadioParams, SelectParams, TextAreaParams } from './view-settings-params';
|
|
11
12
|
export declare enum DataQueryMethod {
|
|
12
13
|
Table = "table",
|
|
13
14
|
PivotTable = "pivot",
|
|
@@ -150,62 +151,12 @@ export declare class ViewSettingsItem {
|
|
|
150
151
|
private [viewSettingsItemValue];
|
|
151
152
|
constructor(_: symbol);
|
|
152
153
|
}
|
|
153
|
-
export declare function input(params:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
tooltip?: TooltipSettings;
|
|
160
|
-
disabled?: true;
|
|
161
|
-
clearable?: true;
|
|
162
|
-
flex?: true;
|
|
163
|
-
id?: number;
|
|
164
|
-
typeInput?: InputType;
|
|
165
|
-
invalidChars?: string[];
|
|
166
|
-
}): ViewSettingsItem;
|
|
167
|
-
export declare function textArea(params: {
|
|
168
|
-
key: string;
|
|
169
|
-
label: Text;
|
|
170
|
-
span?: number;
|
|
171
|
-
placeholder?: Text;
|
|
172
|
-
defaultValue?: string;
|
|
173
|
-
}): ViewSettingsItem;
|
|
174
|
-
export declare function checkbox(params: {
|
|
175
|
-
key: string;
|
|
176
|
-
label: Text;
|
|
177
|
-
span?: number;
|
|
178
|
-
defaultValue?: boolean;
|
|
179
|
-
tooltip?: TooltipSettings;
|
|
180
|
-
}): ViewSettingsItem;
|
|
181
|
-
export declare function radio(params: {
|
|
182
|
-
key: string;
|
|
183
|
-
label: Text;
|
|
184
|
-
options: {
|
|
185
|
-
label: Text;
|
|
186
|
-
value: string;
|
|
187
|
-
}[];
|
|
188
|
-
span?: number;
|
|
189
|
-
defaultValue?: string;
|
|
190
|
-
}): ViewSettingsItem;
|
|
191
|
-
export declare function select(params: {
|
|
192
|
-
key: string;
|
|
193
|
-
label: Text;
|
|
194
|
-
options: {
|
|
195
|
-
label: Text;
|
|
196
|
-
value: string;
|
|
197
|
-
}[];
|
|
198
|
-
span?: number;
|
|
199
|
-
defaultValue?: string;
|
|
200
|
-
tooltip?: TooltipSettings;
|
|
201
|
-
}): ViewSettingsItem;
|
|
202
|
-
export declare function colorPicker(params: {
|
|
203
|
-
key: string;
|
|
204
|
-
label: Text;
|
|
205
|
-
span?: number;
|
|
206
|
-
defaultValue?: string;
|
|
207
|
-
tooltip?: TooltipSettings;
|
|
208
|
-
}): ViewSettingsItem;
|
|
154
|
+
export declare function input(params: InputParams): ViewSettingsItem;
|
|
155
|
+
export declare function textArea(params: TextAreaParams): ViewSettingsItem;
|
|
156
|
+
export declare function checkbox(params: CheckboxParams): ViewSettingsItem;
|
|
157
|
+
export declare function radio(params: RadioParams): ViewSettingsItem;
|
|
158
|
+
export declare function select(params: SelectParams): ViewSettingsItem;
|
|
159
|
+
export declare function colorPicker(params: ColorPickerParams): ViewSettingsItem;
|
|
209
160
|
/**
|
|
210
161
|
* Создаёт collapsible секцию в панели настроек
|
|
211
162
|
*/
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./declare"), exports);
|
|
18
18
|
__exportStar(require("./widget"), exports);
|
|
19
19
|
__exportStar(require("./conditional-format"), exports);
|
|
20
|
+
__exportStar(require("./view-settings-params"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Типы параметров элементов панели настроек виджета
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* @module Настройки отображения
|
|
6
|
+
*/
|
|
7
|
+
import type { Text } from './config';
|
|
8
|
+
import type { InputType, TooltipSettings } from './__internal__/view-settings';
|
|
9
|
+
export declare type IconSettings = string | {
|
|
10
|
+
icon: string;
|
|
11
|
+
library: string;
|
|
12
|
+
};
|
|
13
|
+
export interface HtmlSettings {
|
|
14
|
+
type: 'html';
|
|
15
|
+
html: string;
|
|
16
|
+
}
|
|
17
|
+
export declare type BadgeVariant = 'primary' | 'success' | 'neutral' | 'warning' | 'danger';
|
|
18
|
+
export declare type BadgeSize = 'x-small' | 'small' | 'medium' | 'large';
|
|
19
|
+
export interface BadgeSettings {
|
|
20
|
+
type: 'badge';
|
|
21
|
+
prefix?: IconSettings;
|
|
22
|
+
suffix?: IconSettings;
|
|
23
|
+
size?: BadgeSize;
|
|
24
|
+
pill?: true;
|
|
25
|
+
variant?: BadgeVariant;
|
|
26
|
+
light?: true;
|
|
27
|
+
content?: Text;
|
|
28
|
+
}
|
|
29
|
+
export declare type AffixContent = IconSettings | BadgeSettings | HtmlSettings;
|
|
30
|
+
export interface ViewSettingsOption {
|
|
31
|
+
label: Text;
|
|
32
|
+
value: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ViewSettingsBaseParams {
|
|
35
|
+
key: string;
|
|
36
|
+
label: Text;
|
|
37
|
+
span?: number;
|
|
38
|
+
defaultValue?: string;
|
|
39
|
+
placeholder?: Text;
|
|
40
|
+
tooltip?: TooltipSettings;
|
|
41
|
+
prefix?: AffixContent;
|
|
42
|
+
suffix?: AffixContent;
|
|
43
|
+
options?: ViewSettingsOption[];
|
|
44
|
+
}
|
|
45
|
+
export interface InputParams extends ViewSettingsBaseParams {
|
|
46
|
+
disabled?: true;
|
|
47
|
+
clearable?: true;
|
|
48
|
+
flex?: true;
|
|
49
|
+
id?: number;
|
|
50
|
+
typeInput?: InputType;
|
|
51
|
+
invalidChars?: string[];
|
|
52
|
+
}
|
|
53
|
+
export declare type TextAreaParams = ViewSettingsBaseParams;
|
|
54
|
+
export interface CheckboxParams extends Omit<ViewSettingsBaseParams, 'defaultValue'> {
|
|
55
|
+
defaultValue?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface RadioParams extends ViewSettingsBaseParams {
|
|
58
|
+
options: ViewSettingsOption[];
|
|
59
|
+
}
|
|
60
|
+
export interface SelectParams extends ViewSettingsBaseParams {
|
|
61
|
+
options: ViewSettingsOption[];
|
|
62
|
+
}
|
|
63
|
+
export declare type ColorPickerParams = ViewSettingsBaseParams;
|