lucid-extension-sdk 0.0.51 → 0.0.52
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/package.json
CHANGED
|
@@ -19,7 +19,16 @@ export declare enum FieldDisplayType {
|
|
|
19
19
|
* Given a number, display the number in the bottom-left of the card. If the number is higher than 999,
|
|
20
20
|
* display 999.
|
|
21
21
|
*/
|
|
22
|
-
StandardEstimation = "StandardEstimation"
|
|
22
|
+
StandardEstimation = "StandardEstimation",
|
|
23
|
+
/**
|
|
24
|
+
* Given a URL, display a small image cropped into a circle in the lower-left of the card.
|
|
25
|
+
*/
|
|
26
|
+
ImageBadge = "ImageBadge",
|
|
27
|
+
/**
|
|
28
|
+
* Given a date, display a small calendar icon alongside a very short version of the date
|
|
29
|
+
* as a string, e.g. "Sep 9"
|
|
30
|
+
*/
|
|
31
|
+
DateBadge = "DateBadge"
|
|
23
32
|
}
|
|
24
33
|
export declare const isFieldDisplayType: (x: unknown) => x is FieldDisplayType;
|
|
25
34
|
/**
|
|
@@ -30,9 +39,13 @@ export declare enum OnClickHandlerKeys {
|
|
|
30
39
|
/**
|
|
31
40
|
* Display the UI panel to edit fields on the data associated with the card
|
|
32
41
|
*/
|
|
33
|
-
BasicEditPanel = "BasicEditPanel"
|
|
42
|
+
BasicEditPanel = "BasicEditPanel",
|
|
43
|
+
/**
|
|
44
|
+
* Open a new browser window to a URL specified by linkFormula
|
|
45
|
+
*/
|
|
46
|
+
OpenBrowserWindow = "OpenBrowserWindow"
|
|
34
47
|
}
|
|
35
|
-
export declare const isOnClickHandlerKey: (x: unknown) => x is OnClickHandlerKeys
|
|
48
|
+
export declare const isOnClickHandlerKey: (x: unknown) => x is OnClickHandlerKeys;
|
|
36
49
|
export interface StencilConfig {
|
|
37
50
|
/**
|
|
38
51
|
* How should we generate the stencil/data graphic from the specified field value?
|
|
@@ -48,6 +61,19 @@ export interface StencilConfig {
|
|
|
48
61
|
* by starting the string with "=", e.g. "=darken("#ffffff", 0.5)"
|
|
49
62
|
*/
|
|
50
63
|
backgroundColor?: string;
|
|
64
|
+
/**
|
|
65
|
+
* If specified, the result of this formula (executed in the context of the data item
|
|
66
|
+
* associated with this card) will be used instead of the raw field value when
|
|
67
|
+
* creating the data graphic. This can be useful if, for example, you see to convert
|
|
68
|
+
* an ID into a URL.
|
|
69
|
+
*/
|
|
70
|
+
valueFormula?: string;
|
|
71
|
+
/**
|
|
72
|
+
* If specified, the result of this formula (executed in the context of the data item
|
|
73
|
+
* associated with this card) will be used as a tooltip when the user hovers the
|
|
74
|
+
* cursor over this data graphic.
|
|
75
|
+
*/
|
|
76
|
+
tooltipFormula?: string;
|
|
51
77
|
/**
|
|
52
78
|
* Each display type has its default location on the card. You can override those
|
|
53
79
|
* default locations by setting these values.
|
|
@@ -63,6 +89,10 @@ export interface StencilConfig {
|
|
|
63
89
|
* generated via the above displayType?
|
|
64
90
|
*/
|
|
65
91
|
onClickHandlerKey?: OnClickHandlerKeys;
|
|
92
|
+
/**
|
|
93
|
+
* If onClickHandlerKey is OpenBrowserWindow, this formula calculates the URL to open.
|
|
94
|
+
*/
|
|
95
|
+
linkFormula?: string;
|
|
66
96
|
}
|
|
67
97
|
/**
|
|
68
98
|
* Configuration settings for how to display a particular field on the card itself.
|
|
@@ -77,6 +107,9 @@ export declare type SerializedLucidCardFieldDisplaySettings = {
|
|
|
77
107
|
/** Since renamed to displayType, but we can't change the serialized name */
|
|
78
108
|
'getterKey': FieldDisplayType;
|
|
79
109
|
'bg'?: string;
|
|
110
|
+
'f'?: string;
|
|
111
|
+
't'?: string;
|
|
112
|
+
'l'?: string;
|
|
80
113
|
'h'?: HorizontalBadgePos;
|
|
81
114
|
'v'?: VerticalBadgePos;
|
|
82
115
|
'onClickHandlerKey'?: OnClickHandlerKeys;
|
|
@@ -24,6 +24,15 @@ var FieldDisplayType;
|
|
|
24
24
|
* display 999.
|
|
25
25
|
*/
|
|
26
26
|
FieldDisplayType["StandardEstimation"] = "StandardEstimation";
|
|
27
|
+
/**
|
|
28
|
+
* Given a URL, display a small image cropped into a circle in the lower-left of the card.
|
|
29
|
+
*/
|
|
30
|
+
FieldDisplayType["ImageBadge"] = "ImageBadge";
|
|
31
|
+
/**
|
|
32
|
+
* Given a date, display a small calendar icon alongside a very short version of the date
|
|
33
|
+
* as a string, e.g. "Sep 9"
|
|
34
|
+
*/
|
|
35
|
+
FieldDisplayType["DateBadge"] = "DateBadge";
|
|
27
36
|
})(FieldDisplayType = exports.FieldDisplayType || (exports.FieldDisplayType = {}));
|
|
28
37
|
exports.isFieldDisplayType = (0, validators_1.enumValidator)(FieldDisplayType);
|
|
29
38
|
/**
|
|
@@ -36,6 +45,10 @@ var OnClickHandlerKeys;
|
|
|
36
45
|
* Display the UI panel to edit fields on the data associated with the card
|
|
37
46
|
*/
|
|
38
47
|
OnClickHandlerKeys["BasicEditPanel"] = "BasicEditPanel";
|
|
48
|
+
/**
|
|
49
|
+
* Open a new browser window to a URL specified by linkFormula
|
|
50
|
+
*/
|
|
51
|
+
OnClickHandlerKeys["OpenBrowserWindow"] = "OpenBrowserWindow";
|
|
39
52
|
})(OnClickHandlerKeys = exports.OnClickHandlerKeys || (exports.OnClickHandlerKeys = {}));
|
|
40
53
|
exports.isOnClickHandlerKey = (0, validators_1.enumValidator)(OnClickHandlerKeys);
|
|
41
54
|
/** @ignore */
|
|
@@ -43,6 +56,9 @@ function serializeLucidCardFieldDisplaySettings(settings) {
|
|
|
43
56
|
return {
|
|
44
57
|
'StencilConfig': settings.stencilConfig && {
|
|
45
58
|
'getterKey': settings.stencilConfig.displayType,
|
|
59
|
+
'f': settings.stencilConfig.valueFormula,
|
|
60
|
+
't': settings.stencilConfig.tooltipFormula,
|
|
61
|
+
'l': settings.stencilConfig.linkFormula,
|
|
46
62
|
'bg': settings.stencilConfig.backgroundColor,
|
|
47
63
|
'h': settings.stencilConfig.horizontalPosition,
|
|
48
64
|
'v': settings.stencilConfig.verticalPosition,
|
|
@@ -56,6 +72,9 @@ function deserializeLucidCardFieldDisplaySettings(settings) {
|
|
|
56
72
|
return {
|
|
57
73
|
stencilConfig: settings['StencilConfig'] && {
|
|
58
74
|
displayType: settings['StencilConfig']['getterKey'],
|
|
75
|
+
valueFormula: settings['StencilConfig']['f'],
|
|
76
|
+
tooltipFormula: settings['StencilConfig']['t'],
|
|
77
|
+
linkFormula: settings['StencilConfig']['l'],
|
|
59
78
|
backgroundColor: settings['StencilConfig']['bg'],
|
|
60
79
|
horizontalPosition: settings['StencilConfig']['h'],
|
|
61
80
|
verticalPosition: settings['StencilConfig']['v'],
|