@claspo/common 7.3.1-dev.4 → 7.4.0-nonlinear2

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.
Files changed (224) hide show
  1. package/{out/document → document}/Document.interface.d.ts +2 -0
  2. package/document/ViewNavigationGraph.d.ts +43 -0
  3. package/document/ViewNavigationGraph.js +1 -0
  4. package/package.json +2 -2
  5. package/velocity/SysVelocityRenderer.js +1 -0
  6. package/coverage/lcov-report/block-navigation.js +0 -87
  7. package/coverage/lcov-report/prettify.js +0 -2
  8. package/coverage/lcov-report/sorter.js +0 -196
  9. package/jest.config.ts +0 -204
  10. package/out/package.json +0 -50
  11. package/out/velocity/SysVelocityRenderer.js +0 -1
  12. package/src/DefaultEventEmitter.test.ts +0 -84
  13. package/src/DefaultEventEmitter.ts +0 -96
  14. package/src/HttpAbortableLoader.ts +0 -35
  15. package/src/InAppLayoutType.ts +0 -6
  16. package/src/LayoutType.ts +0 -18
  17. package/src/PrizePool.interface.ts +0 -32
  18. package/src/RenderMode.ts +0 -10
  19. package/src/UuidGenerator.ts +0 -16
  20. package/src/WidgetInitConfig.interface.ts +0 -163
  21. package/src/WidgetType.ts +0 -18
  22. package/src/action/type.ts +0 -7
  23. package/src/async/createAsyncIterator.ts +0 -33
  24. package/src/async/debounce.ts +0 -28
  25. package/src/async/timeout.ts +0 -3
  26. package/src/component-manifest/ComponentManifest.interface.ts +0 -160
  27. package/src/component-manifest/ContextMenuManifest.interface.ts +0 -52
  28. package/src/component-manifest/DisplayCondition.interface.ts +0 -65
  29. package/src/component-manifest/FloatingControlManifest.interface.ts +0 -89
  30. package/src/component-manifest/PropPathCondition.interface.ts +0 -4
  31. package/src/component-manifest/PropertyPaneManifest.interface.ts +0 -614
  32. package/src/converter/time/TimeConverter.spec.ts +0 -11
  33. package/src/converter/time/TimeUnit.spec.ts +0 -12
  34. package/src/converter/time/TimeUnit.ts +0 -34
  35. package/src/converter/time/TimerConverter.ts +0 -29
  36. package/src/document/ComponentInsertType.ts +0 -6
  37. package/src/document/Document.interface.ts +0 -625
  38. package/src/document/DocumentCssVarsReplace.test.ts +0 -2947
  39. package/src/document/DocumentCssVarsReplace.ts +0 -31
  40. package/src/document/DocumentUtils.test.ts +0 -595
  41. package/src/document/DocumentUtils.ts +0 -194
  42. package/src/document/hidden-fields.interface.ts +0 -54
  43. package/src/dom/ViewportSize.ts +0 -61
  44. package/src/dom/copyToClipboard.ts +0 -17
  45. package/src/dom/getMostNestedNode.ts +0 -9
  46. package/src/dom/insertHtmlIntoElement.ts +0 -36
  47. package/src/dom/sanitizeHTML.test.ts +0 -59
  48. package/src/dom/sanitizeHTML.ts +0 -78
  49. package/src/element/BaseElementInViewportHandler.ts +0 -41
  50. package/src/element/CssVarsOperations.ts +0 -37
  51. package/src/element/ThemeCssVars.ts +0 -28
  52. package/src/element/recursiveFindParentNodeByAttribute.test.ts +0 -63
  53. package/src/element/recursiveFindParentNodeByAttribute.ts +0 -25
  54. package/src/flat.ts +0 -16
  55. package/src/handler/HandlerTypes.ts +0 -4
  56. package/src/math/RandomDistributor.test.ts +0 -35
  57. package/src/math/RandomDistributor.ts +0 -58
  58. package/src/math/sum.ts +0 -3
  59. package/src/network/HttpClient.ts +0 -28
  60. package/src/network/HttpStatus.ts +0 -4
  61. package/src/object/isDictionary.test.ts +0 -24
  62. package/src/object/isDictionary.ts +0 -13
  63. package/src/object/omitKeys.test.ts +0 -19
  64. package/src/object/omitKeys.ts +0 -20
  65. package/src/storage/BaseCachingStorage.test.ts +0 -70
  66. package/src/storage/BaseCachingStorage.ts +0 -37
  67. package/src/storage/CachingCookieStorage.test.ts +0 -75
  68. package/src/storage/CachingCookieStorage.ts +0 -36
  69. package/src/storage/CachingLocalStorage.test.ts +0 -59
  70. package/src/storage/CachingLocalStorage.ts +0 -34
  71. package/src/storage/getCookie.test.ts +0 -53
  72. package/src/storage/getCookie.ts +0 -10
  73. package/src/storage/setCookie.test.ts +0 -97
  74. package/src/storage/setCookie.ts +0 -49
  75. package/src/theme/theme.utils.ts +0 -50
  76. package/src/url/sanitizeUrl.test.ts +0 -62
  77. package/src/url/sanitizeUrl.ts +0 -51
  78. package/src/utils/CaseTransformer.test.ts +0 -16
  79. package/src/utils/CaseTransformer.ts +0 -10
  80. package/src/utils/NullishCoalescingOperator.ts +0 -3
  81. package/src/utils/NumericDecline.ts +0 -25
  82. package/src/utils/addEventListener.ts +0 -23
  83. package/src/utils/allSettled.ts +0 -6
  84. package/src/utils/checkTimeZone.spec.ts +0 -18
  85. package/src/utils/checkTimeZone.ts +0 -6
  86. package/src/utils/deviceUtils.ts +0 -12
  87. package/src/utils/flatMap.test.ts +0 -21
  88. package/src/utils/flatMap.ts +0 -3
  89. package/src/utils/fromEntries.ts +0 -6
  90. package/src/utils/generateRandomNumber.test.ts +0 -23
  91. package/src/utils/generateRandomNumber.ts +0 -3
  92. package/src/utils/objectSort.ts +0 -41
  93. package/src/utils/orientationUtils.ts +0 -18
  94. package/src/velocity/SysVelocityContext.spec.ts +0 -88
  95. package/src/velocity/SysVelocityContext.ts +0 -129
  96. package/src/velocity/SysVelocityRenderer.spec.ts +0 -36
  97. package/src/velocity/SysVelocityRenderer.ts +0 -11
  98. package/test/__mocks/jestGlobalMocks.js +0 -1887
  99. /package/{out/DefaultEventEmitter.d.ts → DefaultEventEmitter.d.ts} +0 -0
  100. /package/{out/DefaultEventEmitter.js → DefaultEventEmitter.js} +0 -0
  101. /package/{out/HttpAbortableLoader.d.ts → HttpAbortableLoader.d.ts} +0 -0
  102. /package/{out/HttpAbortableLoader.js → HttpAbortableLoader.js} +0 -0
  103. /package/{out/InAppLayoutType.d.ts → InAppLayoutType.d.ts} +0 -0
  104. /package/{out/InAppLayoutType.js → InAppLayoutType.js} +0 -0
  105. /package/{out/LayoutType.d.ts → LayoutType.d.ts} +0 -0
  106. /package/{out/LayoutType.js → LayoutType.js} +0 -0
  107. /package/{out/PrizePool.interface.d.ts → PrizePool.interface.d.ts} +0 -0
  108. /package/{out/PrizePool.interface.js → PrizePool.interface.js} +0 -0
  109. /package/{out/RenderMode.d.ts → RenderMode.d.ts} +0 -0
  110. /package/{out/RenderMode.js → RenderMode.js} +0 -0
  111. /package/{out/UuidGenerator.d.ts → UuidGenerator.d.ts} +0 -0
  112. /package/{out/UuidGenerator.js → UuidGenerator.js} +0 -0
  113. /package/{out/WidgetInitConfig.interface.d.ts → WidgetInitConfig.interface.d.ts} +0 -0
  114. /package/{out/WidgetInitConfig.interface.js → WidgetInitConfig.interface.js} +0 -0
  115. /package/{out/WidgetType.d.ts → WidgetType.d.ts} +0 -0
  116. /package/{out/WidgetType.js → WidgetType.js} +0 -0
  117. /package/{out/action → action}/type.d.ts +0 -0
  118. /package/{out/action → action}/type.js +0 -0
  119. /package/{out/async → async}/createAsyncIterator.d.ts +0 -0
  120. /package/{out/async → async}/createAsyncIterator.js +0 -0
  121. /package/{out/async → async}/debounce.d.ts +0 -0
  122. /package/{out/async → async}/debounce.js +0 -0
  123. /package/{out/async → async}/timeout.d.ts +0 -0
  124. /package/{out/async → async}/timeout.js +0 -0
  125. /package/{out/component-manifest → component-manifest}/ComponentManifest.interface.d.ts +0 -0
  126. /package/{out/component-manifest → component-manifest}/ComponentManifest.interface.js +0 -0
  127. /package/{out/component-manifest → component-manifest}/ContextMenuManifest.interface.d.ts +0 -0
  128. /package/{out/component-manifest → component-manifest}/ContextMenuManifest.interface.js +0 -0
  129. /package/{out/component-manifest → component-manifest}/DisplayCondition.interface.d.ts +0 -0
  130. /package/{out/component-manifest → component-manifest}/DisplayCondition.interface.js +0 -0
  131. /package/{out/component-manifest → component-manifest}/FloatingControlManifest.interface.d.ts +0 -0
  132. /package/{out/component-manifest → component-manifest}/FloatingControlManifest.interface.js +0 -0
  133. /package/{out/component-manifest → component-manifest}/PropPathCondition.interface.d.ts +0 -0
  134. /package/{out/component-manifest → component-manifest}/PropPathCondition.interface.js +0 -0
  135. /package/{out/component-manifest → component-manifest}/PropertyPaneManifest.interface.d.ts +0 -0
  136. /package/{out/component-manifest → component-manifest}/PropertyPaneManifest.interface.js +0 -0
  137. /package/{out/converter → converter}/time/TimeUnit.d.ts +0 -0
  138. /package/{out/converter → converter}/time/TimeUnit.js +0 -0
  139. /package/{out/converter → converter}/time/TimerConverter.d.ts +0 -0
  140. /package/{out/converter → converter}/time/TimerConverter.js +0 -0
  141. /package/{out/document → document}/ComponentInsertType.d.ts +0 -0
  142. /package/{out/document → document}/ComponentInsertType.js +0 -0
  143. /package/{out/document → document}/Document.interface.js +0 -0
  144. /package/{out/document → document}/DocumentCssVarsReplace.d.ts +0 -0
  145. /package/{out/document → document}/DocumentCssVarsReplace.js +0 -0
  146. /package/{out/document → document}/DocumentUtils.d.ts +0 -0
  147. /package/{out/document → document}/DocumentUtils.js +0 -0
  148. /package/{out/document → document}/hidden-fields.interface.d.ts +0 -0
  149. /package/{out/document → document}/hidden-fields.interface.js +0 -0
  150. /package/{out/dom → dom}/ViewportSize.d.ts +0 -0
  151. /package/{out/dom → dom}/ViewportSize.js +0 -0
  152. /package/{out/dom → dom}/copyToClipboard.d.ts +0 -0
  153. /package/{out/dom → dom}/copyToClipboard.js +0 -0
  154. /package/{out/dom → dom}/getMostNestedNode.d.ts +0 -0
  155. /package/{out/dom → dom}/getMostNestedNode.js +0 -0
  156. /package/{out/dom → dom}/insertHtmlIntoElement.d.ts +0 -0
  157. /package/{out/dom → dom}/insertHtmlIntoElement.js +0 -0
  158. /package/{out/dom → dom}/sanitizeHTML.d.ts +0 -0
  159. /package/{out/dom → dom}/sanitizeHTML.js +0 -0
  160. /package/{out/element → element}/BaseElementInViewportHandler.d.ts +0 -0
  161. /package/{out/element → element}/BaseElementInViewportHandler.js +0 -0
  162. /package/{out/element → element}/CssVarsOperations.d.ts +0 -0
  163. /package/{out/element → element}/CssVarsOperations.js +0 -0
  164. /package/{out/element → element}/ThemeCssVars.d.ts +0 -0
  165. /package/{out/element → element}/ThemeCssVars.js +0 -0
  166. /package/{out/element → element}/recursiveFindParentNodeByAttribute.d.ts +0 -0
  167. /package/{out/element → element}/recursiveFindParentNodeByAttribute.js +0 -0
  168. /package/{out/flat.d.ts → flat.d.ts} +0 -0
  169. /package/{out/flat.js → flat.js} +0 -0
  170. /package/{out/handler → handler}/HandlerTypes.d.ts +0 -0
  171. /package/{out/handler → handler}/HandlerTypes.js +0 -0
  172. /package/{out/math → math}/RandomDistributor.d.ts +0 -0
  173. /package/{out/math → math}/RandomDistributor.js +0 -0
  174. /package/{out/math → math}/sum.d.ts +0 -0
  175. /package/{out/math → math}/sum.js +0 -0
  176. /package/{out/network → network}/HttpClient.d.ts +0 -0
  177. /package/{out/network → network}/HttpClient.js +0 -0
  178. /package/{out/network → network}/HttpStatus.d.ts +0 -0
  179. /package/{out/network → network}/HttpStatus.js +0 -0
  180. /package/{out/object → object}/isDictionary.d.ts +0 -0
  181. /package/{out/object → object}/isDictionary.js +0 -0
  182. /package/{out/object → object}/omitKeys.d.ts +0 -0
  183. /package/{out/object → object}/omitKeys.js +0 -0
  184. /package/{out/storage → storage}/BaseCachingStorage.d.ts +0 -0
  185. /package/{out/storage → storage}/BaseCachingStorage.js +0 -0
  186. /package/{out/storage → storage}/CachingCookieStorage.d.ts +0 -0
  187. /package/{out/storage → storage}/CachingCookieStorage.js +0 -0
  188. /package/{out/storage → storage}/CachingLocalStorage.d.ts +0 -0
  189. /package/{out/storage → storage}/CachingLocalStorage.js +0 -0
  190. /package/{out/storage → storage}/getCookie.d.ts +0 -0
  191. /package/{out/storage → storage}/getCookie.js +0 -0
  192. /package/{out/storage → storage}/setCookie.d.ts +0 -0
  193. /package/{out/storage → storage}/setCookie.js +0 -0
  194. /package/{out/theme → theme}/theme.utils.d.ts +0 -0
  195. /package/{out/theme → theme}/theme.utils.js +0 -0
  196. /package/{out/url → url}/sanitizeUrl.d.ts +0 -0
  197. /package/{out/url → url}/sanitizeUrl.js +0 -0
  198. /package/{out/utils → utils}/CaseTransformer.d.ts +0 -0
  199. /package/{out/utils → utils}/CaseTransformer.js +0 -0
  200. /package/{out/utils → utils}/NullishCoalescingOperator.d.ts +0 -0
  201. /package/{out/utils → utils}/NullishCoalescingOperator.js +0 -0
  202. /package/{out/utils → utils}/NumericDecline.d.ts +0 -0
  203. /package/{out/utils → utils}/NumericDecline.js +0 -0
  204. /package/{out/utils → utils}/addEventListener.d.ts +0 -0
  205. /package/{out/utils → utils}/addEventListener.js +0 -0
  206. /package/{out/utils → utils}/allSettled.d.ts +0 -0
  207. /package/{out/utils → utils}/allSettled.js +0 -0
  208. /package/{out/utils → utils}/checkTimeZone.d.ts +0 -0
  209. /package/{out/utils → utils}/checkTimeZone.js +0 -0
  210. /package/{out/utils → utils}/deviceUtils.d.ts +0 -0
  211. /package/{out/utils → utils}/deviceUtils.js +0 -0
  212. /package/{out/utils → utils}/flatMap.d.ts +0 -0
  213. /package/{out/utils → utils}/flatMap.js +0 -0
  214. /package/{out/utils → utils}/fromEntries.d.ts +0 -0
  215. /package/{out/utils → utils}/fromEntries.js +0 -0
  216. /package/{out/utils → utils}/generateRandomNumber.d.ts +0 -0
  217. /package/{out/utils → utils}/generateRandomNumber.js +0 -0
  218. /package/{out/utils → utils}/objectSort.d.ts +0 -0
  219. /package/{out/utils → utils}/objectSort.js +0 -0
  220. /package/{out/utils → utils}/orientationUtils.d.ts +0 -0
  221. /package/{out/utils → utils}/orientationUtils.js +0 -0
  222. /package/{out/velocity → velocity}/SysVelocityContext.d.ts +0 -0
  223. /package/{out/velocity → velocity}/SysVelocityContext.js +0 -0
  224. /package/{out/velocity → velocity}/SysVelocityRenderer.d.ts +0 -0
@@ -1,129 +0,0 @@
1
- type NumberLike = number | string;
2
-
3
- export interface SysVelocityContextI {
4
- mathTool: {
5
- add: (a: NumberLike, b: NumberLike) => number;
6
- sub: (a: NumberLike, b: NumberLike) => number;
7
- mul: (a: NumberLike, b: NumberLike) => number;
8
- div: (a: NumberLike, b: NumberLike) => number;
9
- };
10
- stringTool: {
11
- equalsIgnoreCase: (a: string, b: string) => boolean;
12
- };
13
- numberTool: {
14
- integer: (a: NumberLike) => number;
15
- format: (f: string | null, v: NumberLike) => string;
16
- number: (v: NumberLike, separator?: string, precision?: number) => string;
17
- };
18
- dateTool: {
19
- currentDate: (format?: string) => string | number;
20
- currentTimeStamp: () => number;
21
- formatDate: (format: string | null, date: Date | string | number) => string | number;
22
- };
23
- }
24
-
25
- export default class SysVelocityContext {
26
-
27
- create(): SysVelocityContextI {
28
- return {
29
- mathTool: {
30
- add: function(a: NumberLike, b: NumberLike): number {
31
- return Number(a) + Number(b);
32
- },
33
- sub: function(a: NumberLike, b: NumberLike): number {
34
- return (a as number) - (b as number);
35
- },
36
- mul: function(a: NumberLike, b: NumberLike): number {
37
- return (a as number) * (b as number);
38
- },
39
- div: function(a: NumberLike, b: NumberLike): number {
40
- return (a as number) / (b as number);
41
- }
42
- },
43
- stringTool: {
44
- equalsIgnoreCase: function(a: string, b: string): boolean {
45
- return String(a).toLowerCase() === String(b).toLowerCase();
46
- },
47
- },
48
- numberTool: {
49
- integer: function(a: NumberLike): number {
50
- return Math.floor(a as number);
51
- },
52
- format: function(f: string | null, v: NumberLike): string {
53
- const precision = (f || '').split('.')[1];
54
- return Number(v).toFixed((precision || '').length);
55
- },
56
- number: function(v: NumberLike, separator: string = ',', precision: number = 3): string {
57
- return Number(v)
58
- .toFixed(precision)
59
- .replace(new RegExp(`[.]0{${precision}}`), '')
60
- .split('.')
61
- .map((item: string, i: number) => {
62
- if (i === 0) {
63
- return item
64
- .split('')
65
- .reverse()
66
- .join('')
67
- .split('')
68
- .map((char: string, i: number) => {
69
- if (i % 3 === 0 && i !== 0) {
70
- char += separator;
71
- return char;
72
- }
73
- return char;
74
- })
75
- .reverse()
76
- .join('');
77
- } else if (i === 1) {
78
- return item;
79
- }
80
- return undefined;
81
- })
82
- .join('.');
83
- }
84
- },
85
- dateTool: {
86
- currentDate: function(format?: string): string | number {
87
- return this.formatDate(format || 'ISO', new Date());
88
- },
89
- currentTimeStamp: function(): number {
90
- return this.formatDate(null, new Date()) as number;
91
- },
92
- formatDate: function(format: string | null, date: Date | string | number): string | number {
93
- const formatNumberLess10 = (number: number): string => number < 9 ? `0${number}` : `${number}`;
94
- const dateObject = new Date(date);
95
- if (dateObject.toString() === 'Invalid Date') {
96
- return date as string;
97
- }
98
- if (format === 'ISO') {
99
- return dateObject.toISOString();
100
- }
101
- if (!format || typeof format !== 'string') {
102
- return dateObject.getTime();
103
- }
104
- const parsedFormat = format.split(' ');
105
- let result = '';
106
- parsedFormat.forEach((piece: string) => {
107
- const upperPiece = piece.toUpperCase();
108
- result = result.length === 0 ? result : result + ' ';
109
- if (upperPiece.includes('HH')) {
110
- result += upperPiece
111
- .replace('HH', formatNumberLess10(dateObject.getHours()))
112
- .replace('MM', formatNumberLess10(dateObject.getMinutes()))
113
- .replace('SS', formatNumberLess10(dateObject.getSeconds()))
114
- }
115
- if (upperPiece.includes('YYYY') || upperPiece.includes('DD')) {
116
- result += upperPiece
117
- .replace('YYYY', String(dateObject.getFullYear()))
118
- .replace('DD', formatNumberLess10(dateObject.getDate()))
119
- .replace('MM', formatNumberLess10(dateObject.getMonth() + 1));
120
- }
121
- });
122
- return result;
123
- }
124
- }
125
- }
126
-
127
- }
128
-
129
- }
@@ -1,36 +0,0 @@
1
- import SysVelocityRenderer from "./SysVelocityRenderer";
2
- import SysVelocityContext from "./SysVelocityContext";
3
-
4
- describe('SysVelocityRenderer', function () {
5
- const baseCtx = new SysVelocityContext().create();
6
- const instance = new SysVelocityRenderer();
7
-
8
- const context = {
9
- "FIRSTNAME": "Kate",
10
- "nestedObject": {
11
- "prop1": "value1"
12
- },
13
- "array": [
14
- {
15
- "el": 1
16
- },
17
- {
18
- "el": 2
19
- }
20
- ]
21
- };
22
- const render = (template: string) => instance.render(template, {...baseCtx, data: context});
23
-
24
- it('should support syntax', function () {
25
-
26
- expect(render('$data.get("FIRSTNAME")')).toEqual("Kate");
27
- expect(render('$data.get("nestedObject").get("prop1")')).toEqual("value1");
28
- expect(render('$data.nestedObject.prop1')).toEqual("value1");
29
- expect(render('#foreach($item in $!data.get(\'array\'))$item.el#end')).toEqual("12");
30
- });
31
-
32
- it('should have sys ctx', function () {
33
-
34
- expect(render('$mathTool.add(1,1)')).toEqual("2");
35
- });
36
- });
@@ -1,11 +0,0 @@
1
- // @ts-ignore
2
- import * as Velocity from 'velocityjs';
3
- import SysVelocityContext from "./SysVelocityContext";
4
-
5
- const sysCtx = new SysVelocityContext().create();
6
-
7
- export default class SysVelocityRenderer {
8
- render(template: string, context: Record<string, any>): string {
9
- return Velocity.render(template, {...sysCtx, ...context});
10
- }
11
- }