polymatica-widget 2.1.3 → 2.1.4
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__/widget-options.d.ts +2 -0
- package/__internal__/widget-options.js +6 -1
- package/config.js +22 -58
- package/package.json +1 -1
|
@@ -29,5 +29,7 @@ export interface WidgetOptionConfig {
|
|
|
29
29
|
}[];
|
|
30
30
|
span?: number;
|
|
31
31
|
}
|
|
32
|
+
export declare const widgetOptionsTargetKey = "6ba1fa0f-7eab-49f8-80ef-0fed376661e2";
|
|
33
|
+
export declare function setWidgetOptionsTarget(options: WidgetOptionConfig[]): void;
|
|
32
34
|
export declare function valueConversion(type: WidgetOptionType, source: any): any;
|
|
33
35
|
export declare function getSpan(source?: number): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSpan = exports.valueConversion = exports.WidgetOptionType = void 0;
|
|
3
|
+
exports.getSpan = exports.valueConversion = exports.setWidgetOptionsTarget = exports.widgetOptionsTargetKey = exports.WidgetOptionType = void 0;
|
|
4
4
|
const config_1 = require("../config");
|
|
5
5
|
var WidgetOptionType;
|
|
6
6
|
(function (WidgetOptionType) {
|
|
@@ -25,6 +25,11 @@ var WidgetOptionType;
|
|
|
25
25
|
WidgetOptionType["Select"] = "select";
|
|
26
26
|
WidgetOptionType["ColorPicker"] = "color-picker";
|
|
27
27
|
})(WidgetOptionType = exports.WidgetOptionType || (exports.WidgetOptionType = {}));
|
|
28
|
+
exports.widgetOptionsTargetKey = "6ba1fa0f-7eab-49f8-80ef-0fed376661e2";
|
|
29
|
+
function setWidgetOptionsTarget(options) {
|
|
30
|
+
global[exports.widgetOptionsTargetKey] = options;
|
|
31
|
+
}
|
|
32
|
+
exports.setWidgetOptionsTarget = setWidgetOptionsTarget;
|
|
28
33
|
function valueConversion(type, source) {
|
|
29
34
|
switch (type) {
|
|
30
35
|
case WidgetOptionType.Text:
|
package/config.js
CHANGED
|
@@ -22,121 +22,85 @@ function title(label, params) {
|
|
|
22
22
|
const options = [];
|
|
23
23
|
if (params === null || params === void 0 ? void 0 : params.hint)
|
|
24
24
|
options.push({ label: params.hint, value: 0 });
|
|
25
|
-
|
|
25
|
+
push({
|
|
26
26
|
type: widget_options_1.WidgetOptionType.Title,
|
|
27
27
|
label,
|
|
28
28
|
options,
|
|
29
|
-
};
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
this.target.push(option);
|
|
29
|
+
});
|
|
32
30
|
}
|
|
33
31
|
exports.title = title;
|
|
34
32
|
function label(label, params) {
|
|
35
33
|
const options = [];
|
|
36
34
|
if (params === null || params === void 0 ? void 0 : params.hint)
|
|
37
35
|
options.push({ label: params.hint, value: 0 });
|
|
38
|
-
|
|
36
|
+
push({
|
|
39
37
|
type: widget_options_1.WidgetOptionType.Label,
|
|
40
38
|
label,
|
|
41
39
|
options,
|
|
42
|
-
};
|
|
43
|
-
// @ts-ignore
|
|
44
|
-
this.target.push(option);
|
|
40
|
+
});
|
|
45
41
|
}
|
|
46
42
|
exports.label = label;
|
|
47
43
|
function spacer(span) {
|
|
48
|
-
|
|
49
|
-
type: widget_options_1.WidgetOptionType.Spacer,
|
|
50
|
-
span,
|
|
51
|
-
};
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
this.target.push(option);
|
|
44
|
+
push({ type: widget_options_1.WidgetOptionType.Spacer, span });
|
|
54
45
|
}
|
|
55
46
|
exports.spacer = spacer;
|
|
56
47
|
function line() {
|
|
57
|
-
|
|
58
|
-
type: widget_options_1.WidgetOptionType.LineHorizontal,
|
|
59
|
-
};
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
this.target.push(option);
|
|
48
|
+
push({ type: widget_options_1.WidgetOptionType.LineHorizontal });
|
|
62
49
|
}
|
|
63
50
|
exports.line = line;
|
|
64
51
|
// controls
|
|
65
52
|
function text(params) {
|
|
66
|
-
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
this.target.push(option);
|
|
53
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Text }));
|
|
69
54
|
}
|
|
70
55
|
exports.text = text;
|
|
71
56
|
function number(params) {
|
|
72
|
-
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
this.target.push(option);
|
|
57
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Number }));
|
|
75
58
|
}
|
|
76
59
|
exports.number = number;
|
|
77
60
|
function integer(params) {
|
|
78
|
-
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
this.target.push(option);
|
|
61
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Integer }));
|
|
81
62
|
}
|
|
82
63
|
exports.integer = integer;
|
|
83
64
|
function range(params) {
|
|
84
|
-
|
|
85
|
-
// @ts-ignore
|
|
86
|
-
this.target.push(option);
|
|
65
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Range }));
|
|
87
66
|
}
|
|
88
67
|
exports.range = range;
|
|
89
68
|
function interval(params) {
|
|
90
|
-
|
|
91
|
-
// @ts-ignore
|
|
92
|
-
this.target.push(option);
|
|
69
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Interval }));
|
|
93
70
|
}
|
|
94
71
|
exports.interval = interval;
|
|
95
72
|
function date(params) {
|
|
96
|
-
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
this.target.push(option);
|
|
73
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Date }));
|
|
99
74
|
}
|
|
100
75
|
exports.date = date;
|
|
101
76
|
function time(params) {
|
|
102
|
-
|
|
103
|
-
// @ts-ignore
|
|
104
|
-
this.target.push(option);
|
|
77
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Time }));
|
|
105
78
|
}
|
|
106
79
|
exports.time = time;
|
|
107
80
|
function dateTime(params) {
|
|
108
|
-
|
|
109
|
-
// @ts-ignore
|
|
110
|
-
this.target.push(option);
|
|
81
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.DateTime }));
|
|
111
82
|
}
|
|
112
83
|
exports.dateTime = dateTime;
|
|
113
84
|
function checkbox(params) {
|
|
114
|
-
|
|
115
|
-
// @ts-ignore
|
|
116
|
-
this.target.push(option);
|
|
85
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Checkbox }));
|
|
117
86
|
}
|
|
118
87
|
exports.checkbox = checkbox;
|
|
119
88
|
function radio(params) {
|
|
120
|
-
|
|
121
|
-
// @ts-ignore
|
|
122
|
-
this.target.push(option);
|
|
89
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Radio }));
|
|
123
90
|
}
|
|
124
91
|
exports.radio = radio;
|
|
125
92
|
function radioButton(params) {
|
|
126
|
-
|
|
127
|
-
// @ts-ignore
|
|
128
|
-
this.target.push(option);
|
|
93
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.RadioButtons }));
|
|
129
94
|
}
|
|
130
95
|
exports.radioButton = radioButton;
|
|
131
96
|
function select(params) {
|
|
132
|
-
|
|
133
|
-
// @ts-ignore
|
|
134
|
-
this.target.push(option);
|
|
97
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Select }));
|
|
135
98
|
}
|
|
136
99
|
exports.select = select;
|
|
137
100
|
function colorPicker(params) {
|
|
138
|
-
|
|
139
|
-
// @ts-ignore
|
|
140
|
-
this.target.push(option);
|
|
101
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.ColorPicker }));
|
|
141
102
|
}
|
|
142
103
|
exports.colorPicker = colorPicker;
|
|
104
|
+
function push(option) {
|
|
105
|
+
const target = global[widget_options_1.widgetOptionsTargetKey];
|
|
106
|
+
}
|