@omegagrid/core 0.2.5
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/dist/common/actions.d.ts +16 -0
- package/dist/common/actions.d.ts.map +1 -0
- package/dist/common/actions.js +19 -0
- package/dist/common/actions.js.map +1 -0
- package/dist/common/colors.d.ts +25 -0
- package/dist/common/colors.d.ts.map +1 -0
- package/dist/common/colors.js +54 -0
- package/dist/common/colors.js.map +1 -0
- package/dist/common/csv.d.ts +23 -0
- package/dist/common/csv.d.ts.map +1 -0
- package/dist/common/csv.js +99 -0
- package/dist/common/csv.js.map +1 -0
- package/dist/common/dates.d.ts +13 -0
- package/dist/common/dates.d.ts.map +1 -0
- package/dist/common/dates.js +118 -0
- package/dist/common/dates.js.map +1 -0
- package/dist/common/dom.d.ts +79 -0
- package/dist/common/dom.d.ts.map +1 -0
- package/dist/common/dom.js +242 -0
- package/dist/common/dom.js.map +1 -0
- package/dist/common/html.d.ts +3 -0
- package/dist/common/html.d.ts.map +1 -0
- package/dist/common/html.js +33 -0
- package/dist/common/html.js.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +43 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/linkedList.d.ts +24 -0
- package/dist/common/linkedList.d.ts.map +1 -0
- package/dist/common/linkedList.js +70 -0
- package/dist/common/linkedList.js.map +1 -0
- package/dist/common/logger.d.ts +23 -0
- package/dist/common/logger.d.ts.map +1 -0
- package/dist/common/logger.js +58 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/matrix.d.ts +6 -0
- package/dist/common/matrix.d.ts.map +1 -0
- package/dist/common/matrix.js +24 -0
- package/dist/common/matrix.js.map +1 -0
- package/dist/common/mixin.d.ts +4 -0
- package/dist/common/mixin.d.ts.map +1 -0
- package/dist/common/mixin.js +3 -0
- package/dist/common/mixin.js.map +1 -0
- package/dist/common/numbers.d.ts +18 -0
- package/dist/common/numbers.d.ts.map +1 -0
- package/dist/common/numbers.js +209 -0
- package/dist/common/numbers.js.map +1 -0
- package/dist/common/options.d.ts +10 -0
- package/dist/common/options.d.ts.map +1 -0
- package/dist/common/options.js +22 -0
- package/dist/common/options.js.map +1 -0
- package/dist/common/tree.d.ts +68 -0
- package/dist/common/tree.d.ts.map +1 -0
- package/dist/common/tree.js +190 -0
- package/dist/common/tree.js.map +1 -0
- package/dist/common/utils.d.ts +15 -0
- package/dist/common/utils.d.ts.map +1 -0
- package/dist/common/utils.js +92 -0
- package/dist/common/utils.js.map +1 -0
- package/dist/constants.d.ts +45 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +29 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/model/adapter.d.ts +8 -0
- package/dist/model/adapter.d.ts.map +1 -0
- package/dist/model/adapter.js +17 -0
- package/dist/model/adapter.js.map +1 -0
- package/dist/model/componentStore.d.ts +11 -0
- package/dist/model/componentStore.d.ts.map +1 -0
- package/dist/model/componentStore.js +26 -0
- package/dist/model/componentStore.js.map +1 -0
- package/dist/model/index.d.ts +5 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +21 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/plugins.d.ts +13 -0
- package/dist/model/plugins.d.ts.map +1 -0
- package/dist/model/plugins.js +29 -0
- package/dist/model/plugins.js.map +1 -0
- package/dist/model/ui.d.ts +19 -0
- package/dist/model/ui.d.ts.map +1 -0
- package/dist/model/ui.js +16 -0
- package/dist/model/ui.js.map +1 -0
- package/dist/styling/index.d.ts +3 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +10 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/stylable.d.ts +10 -0
- package/dist/styling/stylable.d.ts.map +1 -0
- package/dist/styling/stylable.js +43 -0
- package/dist/styling/stylable.js.map +1 -0
- package/dist/styling/styleManager.d.ts +20 -0
- package/dist/styling/styleManager.d.ts.map +1 -0
- package/dist/styling/styleManager.js +126 -0
- package/dist/styling/styleManager.js.map +1 -0
- package/dist/themes.d.ts +7 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +163 -0
- package/dist/themes.js.map +1 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +14 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/accordion.d.ts +12 -0
- package/dist/ui/accordion.d.ts.map +1 -0
- package/dist/ui/accordion.js +94 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert.d.ts +15 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +106 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/attributeTable.d.ts +8 -0
- package/dist/ui/attributeTable.d.ts.map +1 -0
- package/dist/ui/attributeTable.js +39 -0
- package/dist/ui/attributeTable.js.map +1 -0
- package/dist/ui/baseElement.d.ts +7 -0
- package/dist/ui/baseElement.d.ts.map +1 -0
- package/dist/ui/baseElement.js +15 -0
- package/dist/ui/baseElement.js.map +1 -0
- package/dist/ui/button.d.ts +20 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +98 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/button.style.d.ts +2 -0
- package/dist/ui/button.style.d.ts.map +1 -0
- package/dist/ui/button.style.js +72 -0
- package/dist/ui/button.style.js.map +1 -0
- package/dist/ui/checkbox.d.ts +14 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +59 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/colorpicker.d.ts +15 -0
- package/dist/ui/colorpicker.d.ts.map +1 -0
- package/dist/ui/colorpicker.js +160 -0
- package/dist/ui/colorpicker.js.map +1 -0
- package/dist/ui/container.d.ts +26 -0
- package/dist/ui/container.d.ts.map +1 -0
- package/dist/ui/container.js +240 -0
- package/dist/ui/container.js.map +1 -0
- package/dist/ui/dropdown.d.ts +32 -0
- package/dist/ui/dropdown.d.ts.map +1 -0
- package/dist/ui/dropdown.js +197 -0
- package/dist/ui/dropdown.js.map +1 -0
- package/dist/ui/dropdownMenu.d.ts +12 -0
- package/dist/ui/dropdownMenu.d.ts.map +1 -0
- package/dist/ui/dropdownMenu.js +58 -0
- package/dist/ui/dropdownMenu.js.map +1 -0
- package/dist/ui/expander.d.ts +28 -0
- package/dist/ui/expander.d.ts.map +1 -0
- package/dist/ui/expander.js +151 -0
- package/dist/ui/expander.js.map +1 -0
- package/dist/ui/icon.d.ts +24 -0
- package/dist/ui/icon.d.ts.map +1 -0
- package/dist/ui/icon.js +77 -0
- package/dist/ui/icon.js.map +1 -0
- package/dist/ui/images.d.ts +2 -0
- package/dist/ui/images.d.ts.map +1 -0
- package/dist/ui/images.js +17 -0
- package/dist/ui/images.js.map +1 -0
- package/dist/ui/index.d.ts +25 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +41 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input.d.ts +11 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +67 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/list.d.ts +67 -0
- package/dist/ui/list.d.ts.map +1 -0
- package/dist/ui/list.js +362 -0
- package/dist/ui/list.js.map +1 -0
- package/dist/ui/loader.d.ts +9 -0
- package/dist/ui/loader.d.ts.map +1 -0
- package/dist/ui/loader.js +40 -0
- package/dist/ui/loader.js.map +1 -0
- package/dist/ui/menu.d.ts +36 -0
- package/dist/ui/menu.d.ts.map +1 -0
- package/dist/ui/menu.js +154 -0
- package/dist/ui/menu.js.map +1 -0
- package/dist/ui/menu.style.d.ts +3 -0
- package/dist/ui/menu.style.d.ts.map +1 -0
- package/dist/ui/menu.style.js +45 -0
- package/dist/ui/menu.style.js.map +1 -0
- package/dist/ui/overlay.d.ts +17 -0
- package/dist/ui/overlay.d.ts.map +1 -0
- package/dist/ui/overlay.js +95 -0
- package/dist/ui/overlay.js.map +1 -0
- package/dist/ui/overlay.style.d.ts +2 -0
- package/dist/ui/overlay.style.d.ts.map +1 -0
- package/dist/ui/overlay.style.js +49 -0
- package/dist/ui/overlay.style.js.map +1 -0
- package/dist/ui/panel.d.ts +24 -0
- package/dist/ui/panel.d.ts.map +1 -0
- package/dist/ui/panel.js +131 -0
- package/dist/ui/panel.js.map +1 -0
- package/dist/ui/panel.style.d.ts +2 -0
- package/dist/ui/panel.style.d.ts.map +1 -0
- package/dist/ui/panel.style.js +66 -0
- package/dist/ui/panel.style.js.map +1 -0
- package/dist/ui/sizer.d.ts +44 -0
- package/dist/ui/sizer.d.ts.map +1 -0
- package/dist/ui/sizer.js +216 -0
- package/dist/ui/sizer.js.map +1 -0
- package/dist/ui/slider.d.ts +41 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/slider.js +228 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sortableList.d.ts +33 -0
- package/dist/ui/sortableList.d.ts.map +1 -0
- package/dist/ui/sortableList.js +159 -0
- package/dist/ui/sortableList.js.map +1 -0
- package/dist/ui/splitContainer.d.ts +37 -0
- package/dist/ui/splitContainer.d.ts.map +1 -0
- package/dist/ui/splitContainer.js +201 -0
- package/dist/ui/splitContainer.js.map +1 -0
- package/dist/ui/splitContainer.style.d.ts +2 -0
- package/dist/ui/splitContainer.style.d.ts.map +1 -0
- package/dist/ui/splitContainer.style.js +46 -0
- package/dist/ui/splitContainer.style.js.map +1 -0
- package/dist/ui/tooltip.d.ts +23 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +163 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/tooltip.style.d.ts +2 -0
- package/dist/ui/tooltip.style.d.ts.map +1 -0
- package/dist/ui/tooltip.style.js +114 -0
- package/dist/ui/tooltip.style.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.escapeRegExp = exports.isControlCharacter = exports.removeAccents = exports.minmax2d = exports.minmax = exports.trim = exports.clone = exports.cloneDeep = exports.mergeDeep = exports.ifNull = exports.isCharLetter = exports.isString = exports.isObject = void 0;
|
|
4
|
+
function isObject(value) {
|
|
5
|
+
return (value && typeof value === 'object' && !Array.isArray(value));
|
|
6
|
+
}
|
|
7
|
+
exports.isObject = isObject;
|
|
8
|
+
function isString(value) {
|
|
9
|
+
return typeof value == 'string';
|
|
10
|
+
}
|
|
11
|
+
exports.isString = isString;
|
|
12
|
+
function isCharLetter(char) {
|
|
13
|
+
return char.toLowerCase() !== char.toUpperCase();
|
|
14
|
+
}
|
|
15
|
+
exports.isCharLetter = isCharLetter;
|
|
16
|
+
function ifNull(value, def) {
|
|
17
|
+
return value == null ? def : value;
|
|
18
|
+
}
|
|
19
|
+
exports.ifNull = ifNull;
|
|
20
|
+
function mergeDeep(target, ...sources) {
|
|
21
|
+
if (!sources.length)
|
|
22
|
+
return target;
|
|
23
|
+
const source = sources.shift();
|
|
24
|
+
if (isObject(target) && isObject(source)) {
|
|
25
|
+
for (const key in source) {
|
|
26
|
+
if (isObject(source[key])) {
|
|
27
|
+
if (!target[key])
|
|
28
|
+
Object.assign(target, { [key]: {} });
|
|
29
|
+
mergeDeep(target[key], source[key]);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
Object.assign(target, { [key]: source[key] });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return mergeDeep(target, ...sources);
|
|
37
|
+
}
|
|
38
|
+
exports.mergeDeep = mergeDeep;
|
|
39
|
+
function cloneDeep(obj) {
|
|
40
|
+
return mergeDeep({}, obj);
|
|
41
|
+
}
|
|
42
|
+
exports.cloneDeep = cloneDeep;
|
|
43
|
+
function clone(obj) {
|
|
44
|
+
return Object.assign({}, obj);
|
|
45
|
+
}
|
|
46
|
+
exports.clone = clone;
|
|
47
|
+
function trim(value, char) {
|
|
48
|
+
if (char === ']')
|
|
49
|
+
char = '\\]';
|
|
50
|
+
if (char === '^')
|
|
51
|
+
char = '\\^';
|
|
52
|
+
if (char === '\\')
|
|
53
|
+
char = '\\\\';
|
|
54
|
+
return value.replace(new RegExp('^[' + char + ']+|[' + char + ']+$', 'g'), '');
|
|
55
|
+
}
|
|
56
|
+
exports.trim = trim;
|
|
57
|
+
function minmax(values) {
|
|
58
|
+
let min = null, max = null;
|
|
59
|
+
values.forEach(v => {
|
|
60
|
+
if (!isNaN(v) && v != null) {
|
|
61
|
+
min = Math.min(min == null ? Number.MAX_SAFE_INTEGER : min, v);
|
|
62
|
+
max = Math.max(max == null ? Number.MIN_SAFE_INTEGER : max, v);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return [min, max];
|
|
66
|
+
}
|
|
67
|
+
exports.minmax = minmax;
|
|
68
|
+
function minmax2d(...values) {
|
|
69
|
+
let min = null, max = null;
|
|
70
|
+
values.forEach(matrice => matrice.forEach(row => row.forEach(v => {
|
|
71
|
+
if (!isNaN(v) && v != null) {
|
|
72
|
+
min = Math.min(min == null ? Number.MAX_SAFE_INTEGER : min, v);
|
|
73
|
+
max = Math.max(max == null ? Number.MIN_SAFE_INTEGER : max, v);
|
|
74
|
+
}
|
|
75
|
+
})));
|
|
76
|
+
return [min, max];
|
|
77
|
+
}
|
|
78
|
+
exports.minmax2d = minmax2d;
|
|
79
|
+
function removeAccents(str) {
|
|
80
|
+
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
81
|
+
}
|
|
82
|
+
exports.removeAccents = removeAccents;
|
|
83
|
+
const controlCharacters = ["Shift", "Escape", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
|
|
84
|
+
function isControlCharacter(charCode) {
|
|
85
|
+
return controlCharacters.includes(charCode);
|
|
86
|
+
}
|
|
87
|
+
exports.isControlCharacter = isControlCharacter;
|
|
88
|
+
function escapeRegExp(value) {
|
|
89
|
+
return value.replace(/[.*+?^${}()|[\]\\]/gi, '\\$&');
|
|
90
|
+
}
|
|
91
|
+
exports.escapeRegExp = escapeRegExp;
|
|
92
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":";;;AAGA,SAAgB,QAAQ,CAAC,KAAc;IACtC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACtE,CAAC;AAFD,4BAEC;AAED,SAAgB,QAAQ,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,IAAI,QAAQ,CAAC;AACjC,CAAC;AAFD,4BAEC;AAED,SAAgB,YAAY,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;AAClD,CAAC;AAFD,oCAEC;AAED,SAAgB,MAAM,CAAI,KAAa,EAAE,GAAM;IAC9C,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAA,CAAC,CAAC,KAAK,CAAC;AACnC,CAAC;AAFD,wBAEC;AAED,SAAgB,SAAS,CAAC,MAAW,EAAE,GAAG,OAAc;IACvD,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IACnC,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAC/B,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1C,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YAC1B,IAAI,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBAC3B,IAAI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;AAED,SAAgB,aAAa,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC;AAFD,sCAEC;AAGD,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAE1G,SAAgB,kBAAkB,CAAC,QAAgB;IAClD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAFD,gDAEC;AAED,SAAgB,YAAY,CAAC,KAAa;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Color from 'color';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
LOCALE: string;
|
|
4
|
+
PREFIX: string;
|
|
5
|
+
DEFAULT_ACCENT_COLOR: string;
|
|
6
|
+
DEFAULT_ACCENT_COLOR_2: Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | any | ArrayLike<number> | {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}> | ArrayLike<number> | {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}> | ArrayLike<number> | {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}> | ArrayLike<number> | {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}> | ArrayLike<number> | {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}> | ArrayLike<number> | {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}> | ArrayLike<number> | {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}> | ArrayLike<number> | {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}> | ArrayLike<number> | {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}> | ArrayLike<number> | {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}> | ArrayLike<number> | {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}> | ArrayLike<number> | {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>;
|
|
31
|
+
SIZER_SIZE: number;
|
|
32
|
+
SLIDER_SIZE: number;
|
|
33
|
+
SLIDER_MIN_LENGTH: number;
|
|
34
|
+
EXPANDER_SIZE: number;
|
|
35
|
+
LIST_ITEM_HEIGHT: number;
|
|
36
|
+
LIST_RENDERING_TRESHOLD: number;
|
|
37
|
+
LIST_AUTOSCROLL_TRESHOLD: number;
|
|
38
|
+
LIST_AUTOSCROLL_DELAY: number;
|
|
39
|
+
DEFAULT_TEXT_HIGHLIGHT_COLOR: string;
|
|
40
|
+
TOOLTIP_MARGIN: number;
|
|
41
|
+
MENU_ITEM_HEIGHT: number;
|
|
42
|
+
COLORPICKER_COLOR_SIZE: number;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU1B,wBAiBC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const color_1 = __importDefault(require("color"));
|
|
7
|
+
const DEFAULT_ACCENT_COLOR = '#00955d';
|
|
8
|
+
const LOCALE = typeof navigator !== 'undefined' ? (navigator.languages && navigator.languages.length
|
|
9
|
+
? navigator.languages[0]
|
|
10
|
+
: navigator.language) : 'en';
|
|
11
|
+
exports.default = {
|
|
12
|
+
LOCALE: LOCALE,
|
|
13
|
+
PREFIX: 'og',
|
|
14
|
+
DEFAULT_ACCENT_COLOR: DEFAULT_ACCENT_COLOR,
|
|
15
|
+
DEFAULT_ACCENT_COLOR_2: (0, color_1.default)(DEFAULT_ACCENT_COLOR).darken(0.6),
|
|
16
|
+
SIZER_SIZE: 5,
|
|
17
|
+
SLIDER_SIZE: 12,
|
|
18
|
+
SLIDER_MIN_LENGTH: 30,
|
|
19
|
+
EXPANDER_SIZE: 13,
|
|
20
|
+
LIST_ITEM_HEIGHT: 22,
|
|
21
|
+
LIST_RENDERING_TRESHOLD: 30,
|
|
22
|
+
LIST_AUTOSCROLL_TRESHOLD: 30,
|
|
23
|
+
LIST_AUTOSCROLL_DELAY: 100,
|
|
24
|
+
DEFAULT_TEXT_HIGHLIGHT_COLOR: 'var(--text-highlight-color)',
|
|
25
|
+
TOOLTIP_MARGIN: 8,
|
|
26
|
+
MENU_ITEM_HEIGHT: 25,
|
|
27
|
+
COLORPICKER_COLOR_SIZE: 16
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAEvC,MAAM,MAAM,GAAG,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,CACjD,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM;IAChD,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,SAAS,CAAC,QAAQ,CACrB,CAAC,CAAC,CAAC,IAAI,CAAC;AAET,kBAAe;IACd,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,IAAI;IACZ,oBAAoB,EAAE,oBAAoB;IAC1C,sBAAsB,EAAE,IAAA,eAAK,EAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC/D,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,EAAE;IACf,iBAAiB,EAAE,EAAE;IACrB,aAAa,EAAE,EAAE;IACjB,gBAAgB,EAAE,EAAE;IACpB,uBAAuB,EAAE,EAAE;IAC3B,wBAAwB,EAAE,EAAE;IAC5B,qBAAqB,EAAE,GAAG;IAC1B,4BAA4B,EAAE,6BAA6B;IAC3D,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAE,EAAE;CAC1B,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './common';
|
|
2
|
+
export { default as constants } from './constants';
|
|
3
|
+
export { Options as CommonOptions, initOptions as initCommonOptions } from './common/options';
|
|
4
|
+
export * from './ui';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export * from './styling';
|
|
7
|
+
export * from './model';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC9F,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.initCommonOptions = exports.constants = void 0;
|
|
21
|
+
__exportStar(require("./common"), exports);
|
|
22
|
+
var constants_1 = require("./constants");
|
|
23
|
+
Object.defineProperty(exports, "constants", { enumerable: true, get: function () { return __importDefault(constants_1).default; } });
|
|
24
|
+
var options_1 = require("./common/options");
|
|
25
|
+
Object.defineProperty(exports, "initCommonOptions", { enumerable: true, get: function () { return options_1.initOptions; } });
|
|
26
|
+
__exportStar(require("./ui"), exports);
|
|
27
|
+
__exportStar(require("./types"), exports);
|
|
28
|
+
__exportStar(require("./styling"), exports);
|
|
29
|
+
__exportStar(require("./model"), exports);
|
|
30
|
+
const wc_fontawesome_1 = require("@riovir/wc-fontawesome");
|
|
31
|
+
if (!customElements.get('og-fa-icon')) {
|
|
32
|
+
customElements.define('og-fa-icon', wc_fontawesome_1.FontAwesomeIcon);
|
|
33
|
+
}
|
|
34
|
+
if (!customElements.get('og-fa-layers')) {
|
|
35
|
+
customElements.define('og-fa-layers', wc_fontawesome_1.FontAwesomeLayers);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAmD;AAA1C,uHAAA,OAAO,OAAa;AAC7B,4CAA8F;AAA3D,4GAAA,WAAW,OAAqB;AACnE,uCAAqB;AACrB,0CAAwB;AACxB,4CAA0B;AAC1B,0CAAwB;AACxB,2DAA4E;AAE5E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;IACvC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,gCAAe,CAAC,CAAC;AACtD,CAAC;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;IACzC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,kCAAiB,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare abstract class ComponentAdapter<TComponent extends HTMLElement = HTMLElement> {
|
|
2
|
+
private _component;
|
|
3
|
+
readonly customProperties?: Record<string, unknown>;
|
|
4
|
+
get component(): TComponent;
|
|
5
|
+
protected atteched(_component: TComponent): void;
|
|
6
|
+
attach(component: TComponent): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/model/adapter.ts"],"names":[],"mappings":"AAEA,8BAAsB,gBAAgB,CAAC,UAAU,SAAS,WAAW,GAAG,WAAW;IAElF,OAAO,CAAC,UAAU,CAAa;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IAEzD,IAAI,SAAS,eAA6B;IAE1C,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU;IAEzC,MAAM,CAAC,SAAS,EAAE,UAAU;CAK5B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ComponentAdapter = void 0;
|
|
5
|
+
class ComponentAdapter {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.customProperties = {};
|
|
8
|
+
}
|
|
9
|
+
get component() { return this._component; }
|
|
10
|
+
atteched(_component) { }
|
|
11
|
+
attach(component) {
|
|
12
|
+
this._component = component;
|
|
13
|
+
this.atteched(component);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ComponentAdapter = ComponentAdapter;
|
|
17
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/model/adapter.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAEzD,MAAsB,gBAAgB;IAAtC;QAGU,qBAAgB,GAA6B,EAAE,CAAC;IAW1D,CAAC;IATA,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,UAAU,CAAA,CAAC,CAAC;IAEhC,QAAQ,CAAC,UAAsB,IAAI,CAAC;IAE9C,MAAM,CAAC,SAAqB;QAC3B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CAED;AAdD,4CAcC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentFactory, ComponentId } from "../types";
|
|
2
|
+
export declare class ComponentStore<T extends HTMLElement> {
|
|
3
|
+
readonly factory: ComponentFactory<T>;
|
|
4
|
+
readonly items: Map<ComponentId, T>;
|
|
5
|
+
constructor(factory: ComponentFactory<T>);
|
|
6
|
+
get(id: ComponentId): Promise<T>;
|
|
7
|
+
remove(id: ComponentId): this;
|
|
8
|
+
has(id: ComponentId): boolean;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=componentStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentStore.d.ts","sourceRoot":"","sources":["../../src/model/componentStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzD,qBAAa,cAAc,CAAC,CAAC,SAAS,WAAW;aAIpB,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAFxD,SAAgB,KAAK,sBAA6B;gBAEtB,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAElD,GAAG,CAAC,EAAE,EAAE,WAAW;IAKzB,MAAM,CAAC,EAAE,EAAE,WAAW;IAKtB,GAAG,CAAC,EAAE,EAAE,WAAW;IAInB,KAAK;CAIL"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentStore = void 0;
|
|
4
|
+
class ComponentStore {
|
|
5
|
+
constructor(factory) {
|
|
6
|
+
this.factory = factory;
|
|
7
|
+
this.items = new Map();
|
|
8
|
+
}
|
|
9
|
+
async get(id) {
|
|
10
|
+
if (!this.items.has(id))
|
|
11
|
+
this.items.set(id, await this.factory(id));
|
|
12
|
+
return this.items.get(id);
|
|
13
|
+
}
|
|
14
|
+
remove(id) {
|
|
15
|
+
this.items.delete(id);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
has(id) {
|
|
19
|
+
return this.items.has(id);
|
|
20
|
+
}
|
|
21
|
+
clear() {
|
|
22
|
+
this.items.clear();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.ComponentStore = ComponentStore;
|
|
26
|
+
//# sourceMappingURL=componentStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentStore.js","sourceRoot":"","sources":["../../src/model/componentStore.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAc;IAI1B,YAA4B,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;QAFxC,UAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEU,CAAC;IAE7D,KAAK,CAAC,GAAG,CAAC,EAAe;QACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,EAAe;QACrB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,GAAG,CAAC,EAAe;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CAED;AAxBD,wCAwBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./adapter"), exports);
|
|
18
|
+
__exportStar(require("./componentStore"), exports);
|
|
19
|
+
__exportStar(require("./plugins"), exports);
|
|
20
|
+
__exportStar(require("./ui"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,mDAAiC;AACjC,4CAA0B;AAC1B,uCAAqB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare abstract class Plugin<T extends HTMLElement> {
|
|
2
|
+
static pluginName: string;
|
|
3
|
+
protected component: T;
|
|
4
|
+
init(component: T): void;
|
|
5
|
+
}
|
|
6
|
+
export declare class Plugins<T extends HTMLElement> {
|
|
7
|
+
readonly component: T;
|
|
8
|
+
readonly plugins: Map<string, Plugin<T>>;
|
|
9
|
+
constructor(component: T);
|
|
10
|
+
register(plugin: Plugin<T>): this;
|
|
11
|
+
init(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/model/plugins.ts"],"names":[],"mappings":"AAAA,8BAAsB,MAAM,CAAC,CAAC,SAAS,WAAW;IAEjD,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;IAE1B,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;IAEvB,IAAI,CAAC,SAAS,EAAE,CAAC;CAIjB;AAED,qBAAa,OAAO,CAAC,CAAC,SAAS,WAAW;aAIb,SAAS,EAAE,CAAC;IAFxC,SAAgB,OAAO,yBAAgC;gBAE3B,SAAS,EAAE,CAAC;IAExC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAQ1B,IAAI;CAIJ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Plugins = exports.Plugin = void 0;
|
|
4
|
+
class Plugin {
|
|
5
|
+
init(component) {
|
|
6
|
+
this.component = component;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.Plugin = Plugin;
|
|
10
|
+
class Plugins {
|
|
11
|
+
constructor(component) {
|
|
12
|
+
this.component = component;
|
|
13
|
+
this.plugins = new Map();
|
|
14
|
+
}
|
|
15
|
+
register(plugin) {
|
|
16
|
+
const name = (Object.getPrototypeOf(plugin)).constructor.pluginName;
|
|
17
|
+
if (!name)
|
|
18
|
+
throw new Error('invalid plugin name');
|
|
19
|
+
if (this.plugins.has(name))
|
|
20
|
+
throw new Error('plugin already registered');
|
|
21
|
+
this.plugins.set(name, plugin);
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
init() {
|
|
25
|
+
this.plugins.forEach(p => p.init(this.component));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Plugins = Plugins;
|
|
29
|
+
//# sourceMappingURL=plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/model/plugins.ts"],"names":[],"mappings":";;;AAAA,MAAsB,MAAM;IAM3B,IAAI,CAAC,SAAY;QAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;CAED;AAVD,wBAUC;AAED,MAAa,OAAO;IAInB,YAA4B,SAAY;QAAZ,cAAS,GAAT,SAAS,CAAG;QAFxB,YAAO,GAAG,IAAI,GAAG,EAAqB,CAAC;IAEZ,CAAC;IAE5C,QAAQ,CAAC,MAAiB;QACzB,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;QACpE,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAClD,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACzE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,CAAC;CAED;AAlBD,0BAkBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum UIValueType {
|
|
2
|
+
General = "g",
|
|
3
|
+
Text = "t",
|
|
4
|
+
Number = "n",
|
|
5
|
+
Date = "d",
|
|
6
|
+
DateTime = "dt",
|
|
7
|
+
Time = "tm",
|
|
8
|
+
Checkbox = "b",
|
|
9
|
+
Select = "s",
|
|
10
|
+
MultiSelect = "m"
|
|
11
|
+
}
|
|
12
|
+
export type UIValueFormat = string;
|
|
13
|
+
export type UIAttribute = {
|
|
14
|
+
k: string;
|
|
15
|
+
v: unknown;
|
|
16
|
+
t: UIValueType;
|
|
17
|
+
f: UIValueFormat;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/model/ui.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACtB,OAAO,MAAM;IACb,IAAI,MAAM;IACV,MAAM,MAAM;IACZ,IAAI,MAAM;IACV,QAAQ,OAAO;IACf,IAAI,OAAO;IACX,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,WAAW,MAAM;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,MAAM,WAAW,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,OAAO,CAAC;IACX,CAAC,EAAE,WAAW,CAAC;IACf,CAAC,EAAE,aAAa,CAAA;CAChB,CAAA"}
|
package/dist/model/ui.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIValueType = void 0;
|
|
4
|
+
var UIValueType;
|
|
5
|
+
(function (UIValueType) {
|
|
6
|
+
UIValueType["General"] = "g";
|
|
7
|
+
UIValueType["Text"] = "t";
|
|
8
|
+
UIValueType["Number"] = "n";
|
|
9
|
+
UIValueType["Date"] = "d";
|
|
10
|
+
UIValueType["DateTime"] = "dt";
|
|
11
|
+
UIValueType["Time"] = "tm";
|
|
12
|
+
UIValueType["Checkbox"] = "b";
|
|
13
|
+
UIValueType["Select"] = "s";
|
|
14
|
+
UIValueType["MultiSelect"] = "m";
|
|
15
|
+
})(UIValueType || (exports.UIValueType = UIValueType = {}));
|
|
16
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/model/ui.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAUX;AAVD,WAAY,WAAW;IACtB,4BAAa,CAAA;IACb,yBAAU,CAAA;IACV,2BAAY,CAAA;IACZ,yBAAU,CAAA;IACV,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,6BAAc,CAAA;IACd,2BAAY,CAAA;IACZ,gCAAiB,CAAA;AAClB,CAAC,EAVW,WAAW,2BAAX,WAAW,QAUtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styling/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyleEvent = exports.getStyleManager = exports.StyleManager = exports.stylable = void 0;
|
|
4
|
+
var stylable_1 = require("./stylable");
|
|
5
|
+
Object.defineProperty(exports, "stylable", { enumerable: true, get: function () { return stylable_1.stylable; } });
|
|
6
|
+
var styleManager_1 = require("./styleManager");
|
|
7
|
+
Object.defineProperty(exports, "StyleManager", { enumerable: true, get: function () { return styleManager_1.StyleManager; } });
|
|
8
|
+
Object.defineProperty(exports, "getStyleManager", { enumerable: true, get: function () { return styleManager_1.getStyleManager; } });
|
|
9
|
+
Object.defineProperty(exports, "StyleEvent", { enumerable: true, get: function () { return styleManager_1.StyleEvent; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/styling/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA2E;AAAlE,4GAAA,YAAY,OAAA;AAAE,+GAAA,eAAe,OAAA;AAAE,0GAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
type Constructor<T> = new (...args: any[]) => T;
|
|
3
|
+
export type StylableArgs = {
|
|
4
|
+
vars?: (string | RegExp)[];
|
|
5
|
+
colorType?: ('color' | 'background' | 'border')[];
|
|
6
|
+
colorTypeSelector?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const stylable: (args: StylableArgs) => <T extends Constructor<LitElement>>(superClass: T) => Constructor<LitElement> & T;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=stylable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylable.d.ts","sourceRoot":"","sources":["../../src/styling/stylable.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,UAAU,EAAkB,MAAM,KAAK,CAAC;AAIpE,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,CAAC,OAAO,GAAC,YAAY,GAAC,QAAQ,CAAC,EAAE,CAAC;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,SAAU,YAAY,sFAkC1C,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stylable = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
+
const lit_1 = require("lit");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const styleManager_1 = require("./styleManager");
|
|
8
|
+
const stylable = (args) => (superClass) => {
|
|
9
|
+
var _a;
|
|
10
|
+
let vars = (_a = args.vars) !== null && _a !== void 0 ? _a : [];
|
|
11
|
+
let defaultColorStyles = [];
|
|
12
|
+
if (args.colorType && args.colorType.length > 0) {
|
|
13
|
+
vars.push('colortype-*');
|
|
14
|
+
vars = vars.filter((v, i, a) => a.indexOf(v) === i);
|
|
15
|
+
defaultColorStyles = Object.values(types_1.ColorTypes).map(type => (0, lit_1.unsafeCSS)(`
|
|
16
|
+
:host([color="${type}"])${args.colorTypeSelector ? ` ${args.colorTypeSelector}` : ''} {
|
|
17
|
+
${args.colorType.map(prop => {
|
|
18
|
+
if (prop == 'color')
|
|
19
|
+
return `color: var(--colortype-${type}-text-color);`;
|
|
20
|
+
if (prop == 'background')
|
|
21
|
+
return `background-color: var(--colortype-${type}-background-color);`;
|
|
22
|
+
if (prop == 'border')
|
|
23
|
+
return `border: 1px solid var(--colortype-${type}-border-color);`;
|
|
24
|
+
}).join("\n")}
|
|
25
|
+
}
|
|
26
|
+
`));
|
|
27
|
+
}
|
|
28
|
+
class StylableElement extends superClass {
|
|
29
|
+
static finalizeStyles(styles) {
|
|
30
|
+
styles = styles ? (Array.isArray(styles) ? styles : [styles]) : [];
|
|
31
|
+
return lit_1.LitElement.finalizeStyles([(0, lit_1.css) `
|
|
32
|
+
${(0, styleManager_1.getStyleManager)().getCSS(':host', vars)}
|
|
33
|
+
`, ...defaultColorStyles, ...styles]);
|
|
34
|
+
}
|
|
35
|
+
static getStyleManager() {
|
|
36
|
+
return (0, styleManager_1.getStyleManager)();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
StylableElement.cssVariables = vars;
|
|
40
|
+
return StylableElement;
|
|
41
|
+
};
|
|
42
|
+
exports.stylable = stylable;
|
|
43
|
+
//# sourceMappingURL=stylable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylable.js","sourceRoot":"","sources":["../../src/styling/stylable.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,6BAAoE;AACpE,oCAAsC;AACtC,iDAAiD;AAU1C,MAAM,QAAQ,GAAG,CAAC,IAAkB,EAAE,EAAE,CAAC,CAAoC,UAAa,EAAE,E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AC,CAAC,EAAE,CAAC;YACnE,OAAO,gBAAU,CAAC,cAAc,CAAC,CAAC,IAAA,SAAG,EAAA;MAClC,IAAA,8BAAe,GAAE,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC;IACzC,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;QACvC,CAAC;QAED,MAAM,CAAC,eAAe;YACrB,OAAO,IAAA,8BAAe,GAAE,CAAA;QACzB,CAAC;;IAXM,4BAAY,GAAG,IAAI,CAAC;IAc5B,OAAO,eAA8C,CAAC;AACvD,CAAC,CAAC;AAlCW,QAAA,QAAQ,YAkCnB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Theme } from '../types';
|
|
2
|
+
export declare class StyleEvent extends Event {
|
|
3
|
+
readonly theme: string;
|
|
4
|
+
constructor(type: string, theme: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class StyleManager extends EventTarget {
|
|
7
|
+
_currentTheme: string;
|
|
8
|
+
variables: Map<string, Theme>;
|
|
9
|
+
get currentThemeName(): string;
|
|
10
|
+
get themes(): Map<string, Theme>;
|
|
11
|
+
constructor(themes?: Record<string, Theme>);
|
|
12
|
+
getVariable(name: string, theme?: string): string;
|
|
13
|
+
setVariable(name: string, value: string, theme?: string): string;
|
|
14
|
+
addVariables(theme: string, vars: Record<string, string>): this;
|
|
15
|
+
calculateDerivates(theme?: string): void;
|
|
16
|
+
getCSS(scope?: string, variables?: (string | RegExp)[], theme?: string): import("lit").CSSResult;
|
|
17
|
+
register(themeName?: string, theme?: Theme): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const getStyleManager: () => StyleManager;
|
|
20
|
+
//# sourceMappingURL=styleManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleManager.d.ts","sourceRoot":"","sources":["../../src/styling/styleManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAmCjC,qBAAa,UAAW,SAAQ,KAAK;aAEM,KAAK,EAAE,MAAM;gBAA3C,IAAI,EAAE,MAAM,EAAkB,KAAK,EAAE,MAAM;CAIvD;AAED,qBAAa,YAAa,SAAQ,WAAW;IAE5C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,qBAA4B;IAErC,IAAI,gBAAgB,WAEnB;IAED,IAAI,MAAM,uBAET;gBAEW,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAM;IAQ9C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAA8B;IAI/D,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAA8B;IAK9E,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQxD,kBAAkB,CAAC,KAAK,GAAE,MAA8B;IAIxD,MAAM,CAAC,KAAK,SAAU,EAAE,SAAS,GAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAS,EAAE,KAAK,GAAE,MAA8B;IA2BpG,QAAQ,CAAC,SAAS,GAAE,MAA8B,EAAE,KAAK,GAAE,KAAY;CAgBvE;AAGD,eAAO,MAAM,eAAe,oBAE3B,CAAA"}
|