@sme.up/ketchup 9.0.0 → 9.2.0

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 (219) hide show
  1. package/dist/cjs/{f-button-b2cfce1c.js → f-button-9ccadd52.js} +2 -2
  2. package/dist/cjs/{f-cell-75fca92b.js → f-cell-3130506f.js} +183 -11
  3. package/dist/cjs/{f-checkbox-48d7af02.js → f-checkbox-9d2635d9.js} +1 -1
  4. package/dist/cjs/{f-chip-3e504f3e.js → f-chip-beb7af58.js} +3 -3
  5. package/dist/cjs/{f-image-270d39ae.js → f-image-66a3c3c1.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-6d0c4678.js → f-paginator-utils-c475e07f.js} +49 -50
  7. package/dist/cjs/{f-text-field-bbcd2143.js → f-text-field-c74856ff.js} +38 -4
  8. package/dist/cjs/{index-c3d10561.js → index-d8e5eb5f.js} +156 -39
  9. package/dist/cjs/index.cjs.js +11 -0
  10. package/dist/cjs/ketchup.cjs.js +3 -3
  11. package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
  12. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +159 -197
  13. package/dist/cjs/kup-box.cjs.entry.js +23 -15
  14. package/dist/cjs/kup-calendar.cjs.entry.js +5061 -5028
  15. package/dist/cjs/kup-card-list.cjs.entry.js +34 -14
  16. package/dist/cjs/kup-cell.cjs.entry.js +9 -7
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
  18. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-echart.cjs.entry.js +2 -2
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
  21. package/dist/cjs/kup-grid.cjs.entry.js +2 -2
  22. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  23. package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
  24. package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
  26. package/dist/cjs/{kup-manager-130bbd9d.js → kup-manager-7334c396.js} +63 -12
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  29. package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
  30. package/dist/cjs/kup-planner.cjs.entry.js +895 -410
  31. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  33. package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
  34. package/dist/cjs/loader.cjs.js +2 -2
  35. package/dist/collection/assets/card-list.js +12 -9
  36. package/dist/collection/assets/index.js +4 -0
  37. package/dist/collection/assets/progress-bar.js +0 -0
  38. package/dist/collection/assets/radio.js +30 -0
  39. package/dist/collection/collection-manifest.json +2 -2
  40. package/dist/collection/components/kup-box/kup-box.js +14 -6
  41. package/dist/collection/components/kup-card/kup-card.css +14 -0
  42. package/dist/collection/components/kup-card/standard/kup-card-standard.js +10 -5
  43. package/dist/collection/components/kup-card-list/kup-card-list-declarations.js +10 -0
  44. package/dist/collection/components/kup-card-list/kup-card-list.js +232 -12
  45. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +47 -48
  46. package/dist/collection/components/kup-data-table/kup-data-table.js +36 -22
  47. package/dist/collection/components/kup-progress-bar/kup-progress-bar.css +1 -242
  48. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +37 -84
  49. package/dist/collection/components/kup-radio/kup-radio.css +0 -161
  50. package/dist/collection/components/kup-radio/kup-radio.js +31 -26
  51. package/dist/collection/components/kup-rating/kup-rating.css +0 -8
  52. package/dist/collection/components/kup-rating/kup-rating.js +27 -52
  53. package/dist/collection/f-components/f-cell/f-cell-declarations.js +1 -0
  54. package/dist/collection/f-components/f-cell/f-cell.js +19 -5
  55. package/dist/collection/f-components/f-progress-bar/f-progress-bar-declarations.js +1 -0
  56. package/dist/collection/f-components/f-progress-bar/f-progress-bar.js +88 -0
  57. package/dist/collection/f-components/f-radio/f-radio-declarations.js +1 -0
  58. package/dist/collection/f-components/f-radio/f-radio.js +28 -0
  59. package/dist/collection/f-components/f-rating/f-rating-declarations.js +1 -0
  60. package/dist/collection/f-components/f-rating/f-rating.js +26 -0
  61. package/dist/collection/f-components/f-text-field/f-text-field.js +36 -2
  62. package/dist/collection/index.js +5 -0
  63. package/dist/collection/managers/kup-data/kup-data.js +2 -0
  64. package/dist/collection/managers/kup-math/kup-math-helper.js +1 -1
  65. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +33 -0
  66. package/dist/collection/managers/kup-theme/kup-theme.js +13 -1
  67. package/dist/collection/utils/cell-utils.js +6 -7
  68. package/dist/collection/utils/utils.js +0 -5
  69. package/dist/components/index.d.ts +6 -0
  70. package/dist/components/index.js +9 -1
  71. package/dist/components/kup-accordion.js +4 -1
  72. package/dist/components/kup-autocomplete.js +1 -1
  73. package/dist/components/kup-autocomplete2.js +13902 -32341
  74. package/dist/components/kup-badge.js +1 -1
  75. package/dist/components/kup-box2.js +26 -7
  76. package/dist/components/kup-button-list.js +1 -1
  77. package/dist/components/kup-button.js +1 -1
  78. package/dist/components/kup-calendar.js +5001 -4964
  79. package/dist/components/kup-card-list.js +44 -13
  80. package/dist/components/kup-card.js +1 -1
  81. package/dist/components/kup-cell.js +2 -1
  82. package/dist/components/kup-chart.js +1 -1
  83. package/dist/components/kup-checkbox.js +1 -1
  84. package/dist/components/kup-chip.js +1 -1
  85. package/dist/components/kup-color-picker.js +1 -1
  86. package/dist/components/kup-combobox.js +1 -1
  87. package/dist/components/kup-dashboard.js +4 -1
  88. package/dist/components/kup-data-table.js +1 -1
  89. package/dist/components/kup-date-picker.js +1 -1
  90. package/dist/components/kup-dialog.js +1 -1
  91. package/dist/components/kup-drawer.js +2 -1
  92. package/dist/components/kup-dropdown-button.js +1 -1
  93. package/dist/components/kup-echart2.js +2 -1
  94. package/dist/components/kup-family-tree.js +2 -1
  95. package/dist/components/kup-form.js +1 -1
  96. package/dist/components/kup-gauge.js +1 -1
  97. package/dist/components/kup-grid2.js +2 -1
  98. package/dist/components/kup-iframe.js +2 -1
  99. package/dist/components/kup-image-list.js +4 -1
  100. package/dist/components/kup-image.js +1 -1
  101. package/dist/components/kup-lazy.js +2 -1
  102. package/dist/components/kup-list.js +1 -1
  103. package/dist/components/kup-magic-box.js +2 -1
  104. package/dist/{esm/kup-manager-c8d5c94d.js → components/kup-manager.js} +63 -13
  105. package/dist/components/kup-nav-bar.js +2 -1
  106. package/dist/components/kup-numeric-picker.js +2 -1
  107. package/dist/components/kup-photo-frame.js +2 -1
  108. package/dist/components/kup-planner.js +896 -408
  109. package/dist/components/kup-probe.js +2 -1
  110. package/dist/components/kup-progress-bar.js +1 -1
  111. package/dist/components/kup-qlik.js +2 -1
  112. package/dist/components/kup-radio.js +1 -1
  113. package/dist/components/kup-rating.js +1 -1
  114. package/dist/components/kup-snackbar.js +2 -1
  115. package/dist/components/kup-spinner.js +1 -1
  116. package/dist/components/kup-switch.js +1 -1
  117. package/dist/components/kup-tab-bar.js +1 -1
  118. package/dist/components/kup-text-field.js +1 -1
  119. package/dist/components/kup-time-picker.js +1 -1
  120. package/dist/components/kup-tree.js +1 -1
  121. package/dist/esm/{f-button-baa419dc.js → f-button-0bce6587.js} +2 -2
  122. package/dist/esm/{f-cell-18ee3afa.js → f-cell-88d375e1.js} +181 -12
  123. package/dist/esm/{f-checkbox-00a1e020.js → f-checkbox-31219c42.js} +1 -1
  124. package/dist/esm/{f-chip-311500f4.js → f-chip-ef0d4130.js} +3 -3
  125. package/dist/esm/{f-image-da03494c.js → f-image-727453df.js} +2 -2
  126. package/dist/esm/{f-paginator-utils-d63a195e.js → f-paginator-utils-4524e41c.js} +49 -50
  127. package/dist/esm/{f-text-field-e5f1f1fd.js → f-text-field-7b4d622c.js} +38 -4
  128. package/dist/esm/{index-3336c3b1.js → index-99c17b08.js} +157 -40
  129. package/dist/esm/index.js +8 -0
  130. package/dist/esm/ketchup.js +4 -4
  131. package/dist/esm/kup-accordion.entry.js +3 -3
  132. package/dist/esm/kup-autocomplete_27.entry.js +159 -197
  133. package/dist/esm/kup-box.entry.js +23 -15
  134. package/dist/esm/kup-calendar.entry.js +5061 -5028
  135. package/dist/esm/kup-card-list.entry.js +34 -14
  136. package/dist/esm/kup-cell.entry.js +9 -7
  137. package/dist/esm/kup-dashboard.entry.js +6 -6
  138. package/dist/esm/kup-drawer.entry.js +2 -2
  139. package/dist/esm/kup-echart.entry.js +2 -2
  140. package/dist/esm/kup-family-tree.entry.js +4 -4
  141. package/dist/esm/kup-grid.entry.js +2 -2
  142. package/dist/esm/kup-iframe.entry.js +2 -2
  143. package/dist/esm/kup-image-list.entry.js +8 -8
  144. package/dist/esm/kup-lazy.entry.js +2 -2
  145. package/dist/esm/kup-magic-box.entry.js +3 -3
  146. package/dist/esm/kup-manager-9a9d2dbb.js +18604 -0
  147. package/dist/esm/kup-nav-bar.entry.js +2 -2
  148. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  149. package/dist/esm/kup-photo-frame.entry.js +2 -2
  150. package/dist/esm/kup-planner.entry.js +895 -410
  151. package/dist/esm/kup-probe.entry.js +2 -2
  152. package/dist/esm/kup-qlik.entry.js +2 -2
  153. package/dist/esm/kup-snackbar.entry.js +4 -4
  154. package/dist/esm/loader.js +3 -3
  155. package/dist/ketchup/index.esm.js +1 -0
  156. package/dist/ketchup/ketchup.esm.js +1 -1
  157. package/dist/ketchup/{p-a8a39b08.entry.js → p-042e1ed0.entry.js} +1 -1
  158. package/dist/ketchup/{p-55fd3f46.entry.js → p-0dc763af.entry.js} +1 -1
  159. package/dist/ketchup/{p-76130e83.entry.js → p-1ae879af.entry.js} +1 -1
  160. package/dist/ketchup/p-1db0c862.entry.js +1 -0
  161. package/dist/ketchup/{p-25de68e5.js → p-20458088.js} +3 -3
  162. package/dist/ketchup/{p-a0f59b05.entry.js → p-20c1a69f.entry.js} +1 -1
  163. package/dist/ketchup/p-267dd24a.entry.js +9 -0
  164. package/dist/ketchup/{p-39602629.js → p-2849af6f.js} +1 -1
  165. package/dist/ketchup/p-30938d5a.entry.js +1 -0
  166. package/dist/ketchup/{p-f729449f.js → p-34e4a985.js} +1 -1
  167. package/dist/ketchup/p-4067c71b.js +2 -0
  168. package/dist/ketchup/{p-8281c9e5.js → p-4e696daf.js} +1 -1
  169. package/dist/ketchup/p-61f71872.entry.js +1 -0
  170. package/dist/ketchup/p-6a7df3d2.js +1 -0
  171. package/dist/ketchup/{p-2dab9c4f.entry.js → p-6b33f5de.entry.js} +1 -1
  172. package/dist/ketchup/{p-4597f25d.js → p-7a876328.js} +1 -1
  173. package/dist/ketchup/{p-7e1c8fc0.entry.js → p-7f64b612.entry.js} +1 -1
  174. package/dist/ketchup/{p-07707cd1.entry.js → p-90db42e6.entry.js} +1 -1
  175. package/dist/ketchup/{p-13eac183.entry.js → p-9cc1c76b.entry.js} +1 -1
  176. package/dist/ketchup/p-9d3d8690.js +1 -0
  177. package/dist/ketchup/{p-7bf649f0.entry.js → p-b4ba27da.entry.js} +1 -1
  178. package/dist/ketchup/{p-2a2a18bf.entry.js → p-c046fd1c.entry.js} +1 -1
  179. package/dist/ketchup/p-c120043a.entry.js +1 -0
  180. package/dist/ketchup/p-d520d757.entry.js +1 -0
  181. package/dist/ketchup/p-e9bc0749.entry.js +1 -0
  182. package/dist/ketchup/{p-7555c10d.js → p-ea56edbe.js} +1 -1
  183. package/dist/ketchup/p-edd88921.entry.js +1 -0
  184. package/dist/ketchup/{p-da58f8ab.entry.js → p-f1f82eef.entry.js} +1 -1
  185. package/dist/ketchup/{p-51aa248f.entry.js → p-f67ee60f.entry.js} +3 -3
  186. package/dist/ketchup/p-f6844304.entry.js +1 -0
  187. package/dist/ketchup/{p-2d192def.entry.js → p-f8213d22.entry.js} +1 -1
  188. package/dist/types/components/kup-box/kup-box.d.ts +1 -0
  189. package/dist/types/components/kup-card-list/kup-card-list-declarations.d.ts +12 -12
  190. package/dist/types/components/kup-card-list/kup-card-list.d.ts +50 -0
  191. package/dist/types/components/kup-progress-bar/kup-progress-bar.d.ts +0 -1
  192. package/dist/types/components/kup-radio/kup-radio-declarations.d.ts +1 -9
  193. package/dist/types/components/kup-radio/kup-radio.d.ts +3 -2
  194. package/dist/types/components/kup-rating/kup-rating.d.ts +2 -7
  195. package/dist/types/components.d.ts +674 -4
  196. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +1 -0
  197. package/dist/types/f-components/f-progress-bar/f-progress-bar-declarations.d.ts +16 -0
  198. package/dist/types/f-components/f-progress-bar/f-progress-bar.d.ts +3 -0
  199. package/dist/types/f-components/f-radio/f-radio-declarations.d.ts +22 -0
  200. package/dist/types/f-components/f-radio/f-radio.d.ts +3 -0
  201. package/dist/types/f-components/f-rating/f-rating-declarations.d.ts +10 -0
  202. package/dist/types/f-components/f-rating/f-rating.d.ts +3 -0
  203. package/dist/types/index.d.ts +4 -0
  204. package/dist/types/managers/kup-theme/kup-theme-declarations.d.ts +12 -0
  205. package/dist/types/stencil-public-runtime.d.ts +26 -3
  206. package/dist/types/utils/utils.d.ts +0 -2
  207. package/package.json +3 -3
  208. package/dist/ketchup/p-008ad26c.js +0 -1
  209. package/dist/ketchup/p-0c19d485.entry.js +0 -9
  210. package/dist/ketchup/p-2d42477d.js +0 -2
  211. package/dist/ketchup/p-5c15661d.entry.js +0 -1
  212. package/dist/ketchup/p-5cfaa673.entry.js +0 -1
  213. package/dist/ketchup/p-5f583257.entry.js +0 -1
  214. package/dist/ketchup/p-80699a95.js +0 -1
  215. package/dist/ketchup/p-81debebe.entry.js +0 -1
  216. package/dist/ketchup/p-bb854cf5.entry.js +0 -1
  217. package/dist/ketchup/p-d6a7498b.entry.js +0 -1
  218. package/dist/ketchup/p-d8384990.entry.js +0 -1
  219. package/dist/ketchup/p-ecb9fe91.entry.js +0 -1
@@ -3,6 +3,7 @@ import { kupManagerInstance, } from "../../managers/kup-manager/kup-manager";
3
3
  import { getProps, setProps } from "../../utils/utils";
4
4
  import { componentWrapperId } from "../../variables/GenericVariables";
5
5
  import { KupRatingProps, } from "./kup-rating-declarations";
6
+ import { FRating } from "../../f-components/f-rating/f-rating";
6
7
  export class KupRating {
7
8
  constructor() {
8
9
  /*-------------------------------------------------*/
@@ -12,30 +13,23 @@ export class KupRating {
12
13
  * Instance of the KupManager class.
13
14
  */
14
15
  this.kupManager = kupManagerInstance();
15
- this.stars = [];
16
16
  this.customStyle = '';
17
17
  this.disabled = false;
18
18
  this.maxValue = 5;
19
19
  this.value = 0;
20
20
  }
21
- onStarClick(newValue) {
21
+ onKupClick(newValue) {
22
22
  if (!this.disabled) {
23
23
  this.value = newValue;
24
- this.buildStars(this.value);
25
- this.kupRatingClick.emit({
24
+ this.kupClick.emit({
26
25
  comp: this,
27
26
  id: this.rootElement.id,
28
27
  value: this.value,
29
28
  });
29
+ this.refresh();
30
30
  }
31
31
  }
32
32
  /*-------------------------------------------------*/
33
- /* W a t c h e r s */
34
- /*-------------------------------------------------*/
35
- onValueChanged() {
36
- this.buildStars(this.value);
37
- }
38
- /*-------------------------------------------------*/
39
33
  /* P u b l i c M e t h o d s */
40
34
  /*-------------------------------------------------*/
41
35
  /**
@@ -60,37 +54,11 @@ export class KupRating {
60
54
  setProps(this, KupRatingProps, props);
61
55
  }
62
56
  /*-------------------------------------------------*/
63
- /* P r i v a t e M e t h o d s */
64
- /*-------------------------------------------------*/
65
- onMouseOver(newValue) {
66
- if (!this.disabled) {
67
- this.buildStars(newValue);
68
- }
69
- }
70
- onMouseOut() {
71
- if (!this.disabled) {
72
- this.buildStars(this.value);
73
- }
74
- }
75
- buildStars(numberOfStars) {
76
- let stars = [];
77
- for (let i = 1; i <= this.maxValue; i++) {
78
- if (i <= numberOfStars) {
79
- stars.push(h("span", { class: "rating", onMouseOver: () => this.onMouseOver(i), onMouseOut: () => this.onMouseOut(), onClick: () => this.onStarClick(i) }, "\u2605"));
80
- }
81
- else {
82
- stars.push(h("span", { class: "rating", onMouseOver: () => this.onMouseOver(i), onMouseOut: () => this.onMouseOut(), onClick: () => this.onStarClick(i) }, "\u2606"));
83
- }
84
- }
85
- this.stars = stars;
86
- }
87
- /*-------------------------------------------------*/
88
57
  /* L i f e c y c l e H o o k s */
89
58
  /*-------------------------------------------------*/
90
59
  componentWillLoad() {
91
60
  this.kupManager.debug.logLoad(this, false);
92
61
  this.kupManager.theme.register(this);
93
- this.onValueChanged();
94
62
  }
95
63
  componentDidLoad() {
96
64
  this.kupManager.debug.logLoad(this, true);
@@ -102,7 +70,28 @@ export class KupRating {
102
70
  this.kupManager.debug.logRender(this, true);
103
71
  }
104
72
  render() {
105
- return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", null, this.stars))));
73
+ const props = {
74
+ danger: this.rootElement.classList.contains('kup-danger')
75
+ ? true
76
+ : false,
77
+ disabled: this.disabled,
78
+ info: this.rootElement.classList.contains('kup-info')
79
+ ? true
80
+ : false,
81
+ maxValue: this.maxValue,
82
+ secondary: this.rootElement.classList.contains('kup-secondary')
83
+ ? true
84
+ : false,
85
+ success: this.rootElement.classList.contains('kup-success')
86
+ ? true
87
+ : false,
88
+ value: this.value,
89
+ warning: this.rootElement.classList.contains('kup-warning')
90
+ ? true
91
+ : false,
92
+ onClick: (i) => this.onKupClick(i),
93
+ };
94
+ return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h(FRating, Object.assign({}, props)))));
106
95
  }
107
96
  disconnectedCallback() {
108
97
  this.kupManager.theme.unregister(this);
@@ -210,14 +199,9 @@ export class KupRating {
210
199
  }
211
200
  };
212
201
  }
213
- static get states() {
214
- return {
215
- "stars": {}
216
- };
217
- }
218
202
  static get events() {
219
203
  return [{
220
- "method": "kupRatingClick",
204
+ "method": "kupClick",
221
205
  "name": "kup-rating-click",
222
206
  "bubbles": true,
223
207
  "cancelable": false,
@@ -326,13 +310,4 @@ export class KupRating {
326
310
  };
327
311
  }
328
312
  static get elementRef() { return "rootElement"; }
329
- static get watchers() {
330
- return [{
331
- "propName": "value",
332
- "methodName": "onValueChanged"
333
- }, {
334
- "propName": "maxValue",
335
- "methodName": "onValueChanged"
336
- }];
337
- }
338
313
  }
@@ -86,6 +86,7 @@ export var FCellShapes;
86
86
  FCellShapes["EDITOR"] = "EDT";
87
87
  FCellShapes["GAUGE"] = "GAU";
88
88
  FCellShapes["IMAGE"] = "IMG";
89
+ FCellShapes["INPUT_CHECKBOX"] = "INC";
89
90
  FCellShapes["INPUT_FIELD"] = "INF";
90
91
  FCellShapes["KNOB"] = "KNB";
91
92
  FCellShapes["MULTI_AUTOCOMPLETE"] = "AML";
@@ -10,6 +10,10 @@ import { KupThemeColorValues } from "../../managers/kup-theme/kup-theme-declarat
10
10
  import { FSwitch } from "../f-switch/f-switch";
11
11
  import { FChipType } from "../f-chip/f-chip-declarations";
12
12
  import { ItemsDisplayMode } from "../../components/kup-list/kup-list-declarations";
13
+ import { FButton } from "../f-button/f-button";
14
+ import { FProgressBar } from "../f-progress-bar/f-progress-bar";
15
+ import { FRadio } from "../f-radio/f-radio";
16
+ import { FRating } from "../f-rating/f-rating";
13
17
  const dom = document.documentElement;
14
18
  /*-------------------------------------------------*/
15
19
  /* C o m p o n e n t */
@@ -207,7 +211,14 @@ function setEditableCell(cellType, classObj, cell, column, props) {
207
211
  if (isAutoCentered(props)) {
208
212
  classObj[FCellClasses.C_CENTERED] = true;
209
213
  }
210
- return (h(FCheckbox, Object.assign({}, cell.data, { onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
214
+ if (cell.shape === FCellShapes.INPUT_CHECKBOX) {
215
+ return (h("input", { checked: cell.value === 'on' || cell.value === '1'
216
+ ? true
217
+ : false, class: "input-checkbox", onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), type: "checkbox" }));
218
+ }
219
+ else {
220
+ return (h(FCheckbox, Object.assign({}, cell.data, { onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
221
+ }
211
222
  case FCellTypes.CHIP:
212
223
  return (h("kup-chip", Object.assign({}, cell.data, { type: FChipType.INPUT, enableInput: true, "onKup-chip-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) }), h("kup-text-field", Object.assign({ fullWidth: true, slot: "field" }, cell.slotData))));
213
224
  case FCellTypes.COLOR_PICKER:
@@ -322,7 +333,7 @@ function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, pr
322
333
  if (isAutoCentered(props)) {
323
334
  classObj[FCellClasses.C_CENTERED] = true;
324
335
  }
325
- return (h("kup-button", Object.assign({ key: column.name + props.row.id }, subcomponentProps, { "onkup-button-click": (e) => cellEvent(e, props, cellType, FCellEvents.CLICK) })));
336
+ return (h(FButton, Object.assign({}, subcomponentProps, { onClick: (e) => cellEvent(e, props, cellType, FCellEvents.CLICK) })));
326
337
  case FCellTypes.BUTTON_LIST:
327
338
  if (isAutoCentered(props)) {
328
339
  classObj[FCellClasses.C_CENTERED] = true;
@@ -348,15 +359,15 @@ function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, pr
348
359
  return (h("kup-gauge", Object.assign({ key: column.name + props.row.id, value: dom.ketchup.math.numberifySafe(cell.value), "width-component": "280px" }, subcomponentProps)));
349
360
  case FCellTypes.KNOB:
350
361
  case FCellTypes.PROGRESS_BAR:
351
- return (h("kup-progress-bar", Object.assign({ key: column.name + props.row.id }, subcomponentProps)));
362
+ return subcomponentProps.customStyle ? (h("kup-progress-bar", Object.assign({ key: column.name + props.row.id }, subcomponentProps))) : (h(FProgressBar, Object.assign({}, subcomponentProps)));
352
363
  case FCellTypes.RADIO:
353
364
  if (isAutoCentered(props)) {
354
365
  classObj[FCellClasses.C_CENTERED] = true;
355
366
  }
356
367
  subcomponentProps['disabled'] = row.readOnly;
357
- return (h("kup-radio", Object.assign({ key: column.name + props.row.id }, subcomponentProps)));
368
+ return h(FRadio, Object.assign({}, subcomponentProps));
358
369
  case FCellTypes.RATING:
359
- return (h("kup-rating", Object.assign({ key: column.name + props.row.id }, subcomponentProps, { disabled: true })));
370
+ return h(FRating, Object.assign({}, subcomponentProps, { disabled: true }));
360
371
  }
361
372
  }
362
373
  function cellEvent(e, props, cellType, cellEventName) {
@@ -429,6 +440,9 @@ function getValueFromEventTaget(e, cellType) {
429
440
  let value = isInputEvent
430
441
  ? e.target.value
431
442
  : e.detail.value;
443
+ if (cellType === FCellTypes.CHECKBOX && isInputEvent) {
444
+ value = e.target.checked ? 'off' : 'on';
445
+ }
432
446
  if (cellType === FCellTypes.NUMBER && isInputEvent) {
433
447
  value = dom.ketchup.math.formattedStringToNumberString(value, '');
434
448
  }
@@ -0,0 +1,88 @@
1
+ import { getAssetPath, h } from "@stencil/core";
2
+ /*-------------------------------------------------*/
3
+ /* C o m p o n e n t */
4
+ /*-------------------------------------------------*/
5
+ export const FProgressBar = (props) => {
6
+ if (!props.centeredLabel && !props.centeredLabel !== false) {
7
+ props.centeredLabel = true;
8
+ }
9
+ let componentClass = `f-progress-bar ${props.danger ? 'kup-danger' : ''} ${props.animated ? 'kup-animated' : ''} ${props.padded ? 'kup-padded' : ''} ${props.info ? 'kup-info' : ''} ${props.slim ? 'kup-slim' : ''} ${props.striped ? 'kup-striped' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.slim ? 'kup-slim' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}`;
10
+ let pieClass = 'pie';
11
+ let radialStyle = undefined;
12
+ if (props.isRadial) {
13
+ componentClass += ' pie-wrapper is-radial';
14
+ }
15
+ else {
16
+ componentClass += ' progress-bar';
17
+ }
18
+ let labelStyle = undefined;
19
+ const valueStyle = {
20
+ width: `${props.value}%`,
21
+ };
22
+ if (!props.centeredLabel) {
23
+ labelStyle = valueStyle;
24
+ if (props.value > 2) {
25
+ componentClass += ' text-color-on-primary';
26
+ }
27
+ }
28
+ else if (props.value > 49) {
29
+ componentClass += ' text-color-on-primary';
30
+ }
31
+ let label = null;
32
+ if (props.icon) {
33
+ label = createIconElement(props);
34
+ }
35
+ else {
36
+ if (!props.hideLabel) {
37
+ if (props.isRadial) {
38
+ if (props.label) {
39
+ label = h("span", { class: "label" }, props.label);
40
+ }
41
+ else {
42
+ label = (h("span", { class: "label" }, props.value, h("span", { class: "smaller" }, "%")));
43
+ }
44
+ }
45
+ else {
46
+ if (props.label) {
47
+ label = props.label;
48
+ }
49
+ else {
50
+ label = props.value + '%';
51
+ }
52
+ }
53
+ }
54
+ }
55
+ if (props.value > 0) {
56
+ pieClass += ' has-value';
57
+ if (props.value > 50) {
58
+ pieClass += ' is-more-than-half';
59
+ }
60
+ else {
61
+ pieClass += ' is-less-than-half';
62
+ }
63
+ }
64
+ if (props.isRadial) {
65
+ return (h("div", { class: componentClass }, label, h("div", { class: pieClass }, h("div", { style: radialStyle, class: "left-side half-circle" }), h("div", { class: "right-side half-circle" })), h("div", { class: "shadow" })));
66
+ }
67
+ else {
68
+ return (h("div", { class: componentClass }, h("div", { class: "progress-bar-percentage", style: valueStyle }, h("span", { style: labelStyle }, label))));
69
+ }
70
+ };
71
+ function createIconElement(props) {
72
+ if (!props.icon) {
73
+ return undefined;
74
+ }
75
+ if (props.icon.indexOf('.') > -1 ||
76
+ props.icon.indexOf('/') > -1 ||
77
+ props.icon.indexOf('\\') > -1) {
78
+ return (h("span", { class: "label kup-icon is-image" }, h("img", { src: props.icon })));
79
+ }
80
+ else {
81
+ let svg = `url('${getAssetPath(`./assets/svg/${props.icon}.svg`)}') no-repeat center`;
82
+ let iconStyle = {
83
+ mask: svg,
84
+ webkitMask: svg,
85
+ };
86
+ return h("span", { style: iconStyle, class: "label kup-icon" });
87
+ }
88
+ }
@@ -0,0 +1,28 @@
1
+ import { h } from "@stencil/core";
2
+ /*-------------------------------------------------*/
3
+ /* C o m p o n e n t */
4
+ /*-------------------------------------------------*/
5
+ export const FRadio = (props) => {
6
+ var _a;
7
+ const hasColumns = !!props.columns;
8
+ const radioList = [];
9
+ for (let i = 0; i < ((_a = props.data) === null || _a === void 0 ? void 0 : _a.length); i++) {
10
+ const data = props.data[i];
11
+ const classObj = {
12
+ radio: true,
13
+ 'radio--checked': data.checked ? true : false,
14
+ 'radio--disabled': props.disabled ? true : false,
15
+ };
16
+ radioList.push(h("div", { class: `form-field ${props.leadingLabel ? ' form-field--align-end' : ''}` }, h("div", { class: classObj }, h("input", { class: "radio__native-control", type: "radio", name: "radio-element", value: data.value, checked: data.checked, disabled: props.disabled, onBlur: props.onBlur, onChange: props.onChange
17
+ ? props.onChange.bind(props.onChange, i)
18
+ : null, onFocus: props.onFocus }), h("div", { class: "radio__background" }, h("div", { class: "radio__outer-circle" }), h("div", { class: "radio__inner-circle" }))), h("label", { htmlFor: 'radio-element', onClick: props.onChange
19
+ ? props.onChange.bind(props.onChange, i)
20
+ : null }, data.label ? data.label : '')));
21
+ }
22
+ const styleObj = {
23
+ '--kup_radio_columns': hasColumns
24
+ ? `repeat(${props.columns}, 1fr)`
25
+ : '',
26
+ };
27
+ return (h("div", { class: `f-radio radio-wrapper ${hasColumns ? 'radio-wrapper-grid' : ''} ${props.danger ? 'kup-danger' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}`, style: styleObj }, radioList));
28
+ };
@@ -0,0 +1,26 @@
1
+ import { h } from "@stencil/core";
2
+ /*-------------------------------------------------*/
3
+ /* C o m p o n e n t */
4
+ /*-------------------------------------------------*/
5
+ export const FRating = (props) => {
6
+ if (!props.maxValue) {
7
+ props.maxValue = 5;
8
+ }
9
+ return (h("div", { class: `f-rating ${props.disabled ? 'disabled' : ''} ${props.danger ? 'kup-danger' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, buildStars(props)));
10
+ };
11
+ function buildStars(props) {
12
+ const stars = [];
13
+ for (let i = 1; i <= props.maxValue; i++) {
14
+ if (i <= props.value) {
15
+ stars.push(h("span", { class: "rating", onClick: props.onClick
16
+ ? props.onClick.bind(props.onClick, i)
17
+ : null }, "\u2605"));
18
+ }
19
+ else {
20
+ stars.push(h("span", { class: "rating", onClick: props.onClick
21
+ ? props.onClick.bind(props.onClick, i)
22
+ : null }, "\u2606"));
23
+ }
24
+ }
25
+ return stars;
26
+ }
@@ -52,7 +52,8 @@ function setContent(props) {
52
52
  let value = props.value;
53
53
  let inputType = (_a = props.inputType) !== null && _a !== void 0 ? _a : 'text';
54
54
  let persManageForNumberFormat = false;
55
- if (props.inputType === 'number' && props.decimals && props.decimals > 0) {
55
+ if (props.inputType === 'number' &&
56
+ ((props.decimals && props.decimals > 0) || props.group)) {
56
57
  inputType = 'text';
57
58
  persManageForNumberFormat = true;
58
59
  }
@@ -90,7 +91,40 @@ function setContent(props) {
90
91
  group: props.group,
91
92
  integer: props.integers,
92
93
  };
93
- e.target.value = formatValue(e.target.value, options, true);
94
+ if (props.min !== undefined &&
95
+ props.min !== null &&
96
+ props.min >
97
+ parseFloat(e.target.value)) {
98
+ e.target.value =
99
+ formatValue(props.min.toString(), options, true);
100
+ }
101
+ else if (props.max !== undefined &&
102
+ props.max !== null &&
103
+ props.max <
104
+ parseFloat(e.target.value)) {
105
+ e.target.value =
106
+ formatValue(props.max.toString(), options, true);
107
+ }
108
+ else {
109
+ e.target.value =
110
+ formatValue(e.target.value, options, true);
111
+ }
112
+ }
113
+ else {
114
+ if (props.min !== undefined &&
115
+ props.min !== null &&
116
+ props.min >
117
+ parseFloat(e.target.value)) {
118
+ e.target.value =
119
+ props.min.toString();
120
+ }
121
+ else if (props.max !== undefined &&
122
+ props.max !== null &&
123
+ props.max <
124
+ parseFloat(e.target.value)) {
125
+ e.target.value =
126
+ props.max.toString();
127
+ }
94
128
  }
95
129
  if (props.onChange) {
96
130
  props.onChange(e);
@@ -0,0 +1,5 @@
1
+ import { KupManager } from "./managers/kup-manager/kup-manager";
2
+ /** used for obtain a KupManager instance without a dom document (for UT) */
3
+ export function newKupManager(init) {
4
+ return new KupManager(init);
5
+ }
@@ -50,6 +50,8 @@ export class KupData {
50
50
  return FCellTypes.GAUGE;
51
51
  case FCellShapes.IMAGE:
52
52
  return FCellTypes.IMAGE;
53
+ case FCellShapes.INPUT_CHECKBOX:
54
+ return FCellTypes.CHECKBOX;
53
55
  case FCellShapes.KNOB:
54
56
  return FCellTypes.KNOB;
55
57
  case FCellShapes.MULTI_AUTOCOMPLETE:
@@ -22,7 +22,7 @@ export function customFormula(formula, row) {
22
22
  return result;
23
23
  }
24
24
  catch (e) {
25
- dom.ketchup.debug.logMessage('kup-data', 'Error while evaluating the following formula!(' + formula + ')', KupDebugCategory.ERROR);
25
+ dom.ketchup.debug.logMessage('kup-data', 'Error while evaluating the following formula!(' + formula + ')', KupDebugCategory.WARNING);
26
26
  return NaN;
27
27
  }
28
28
  }
@@ -87,6 +87,39 @@ export const fImageUsers = [
87
87
  * Components using the FPaginator functional component.
88
88
  */
89
89
  export const fPaginatorUsers = [KupTagNames.BOX, KupTagNames.DATA_TABLE];
90
+ /**
91
+ * Components using the FProgressBar functional component.
92
+ */
93
+ export const fProgressBarUsers = [
94
+ KupTagNames.BOX,
95
+ KupTagNames.CELL,
96
+ KupTagNames.DATA_TABLE,
97
+ KupTagNames.FORM,
98
+ KupTagNames.PROGRESS_BAR,
99
+ KupTagNames.TREE,
100
+ ];
101
+ /**
102
+ * Components using the FRadio functional component.
103
+ */
104
+ export const fRadioUsers = [
105
+ KupTagNames.BOX,
106
+ KupTagNames.CELL,
107
+ KupTagNames.DATA_TABLE,
108
+ KupTagNames.FORM,
109
+ KupTagNames.RADIO,
110
+ KupTagNames.TREE,
111
+ ];
112
+ /**
113
+ * Components using the FRating functional component.
114
+ */
115
+ export const fRatingUsers = [
116
+ KupTagNames.BOX,
117
+ KupTagNames.CELL,
118
+ KupTagNames.DATA_TABLE,
119
+ KupTagNames.FORM,
120
+ KupTagNames.RATING,
121
+ KupTagNames.TREE,
122
+ ];
90
123
  /**
91
124
  * Components using the FSwitch functional component.
92
125
  */
@@ -8,10 +8,13 @@ import * as fCheckboxCSS from "../../f-components/f-checkbox/f-checkbox.css";
8
8
  import * as fChipCSS from "../../f-components/f-chip/f-chip.css";
9
9
  import * as fImageCSS from "../../f-components/f-image/f-image.css";
10
10
  import * as fPaginatorCSS from "../../f-components/f-paginator/f-paginator.css";
11
+ import * as fProgressBarCSS from "../../f-components/f-progress-bar/f-progress-bar.css";
12
+ import * as fRadioCSS from "../../f-components/f-radio/f-radio.css";
13
+ import * as fRatingCSS from "../../f-components/f-rating/f-rating.css";
11
14
  import * as fSwitchCSS from "../../f-components/f-switch/f-switch.css";
12
15
  import * as fTextFieldCSS from "../../f-components/f-text-field/f-text-field.css";
13
16
  import * as rippleCSS from "./mdc-ripple.css";
14
- import { fButtonUsers, fCellUsers, fCheckboxUsers, fChipUsers, fImageUsers, fPaginatorUsers, fSwitchUsers, fTextFieldUsers, masterCustomStyle, rippleUsers, } from "./kup-theme-declarations";
17
+ import { fButtonUsers, fCellUsers, fCheckboxUsers, fChipUsers, fImageUsers, fPaginatorUsers, fProgressBarUsers, fRadioUsers, fRatingUsers, fSwitchUsers, fTextFieldUsers, masterCustomStyle, rippleUsers, } from "./kup-theme-declarations";
15
18
  import { KupDebugCategory } from "../kup-debug/kup-debug-declarations";
16
19
  const dom = document.documentElement;
17
20
  /**
@@ -219,6 +222,15 @@ export class KupTheme {
219
222
  if (fPaginatorUsers.includes(tagName)) {
220
223
  completeStyle += fPaginatorCSS['default'];
221
224
  }
225
+ if (fProgressBarUsers.includes(tagName)) {
226
+ completeStyle += fProgressBarCSS['default'];
227
+ }
228
+ if (fRadioUsers.includes(tagName)) {
229
+ completeStyle += fRadioCSS['default'];
230
+ }
231
+ if (fRatingUsers.includes(tagName)) {
232
+ completeStyle += fRatingCSS['default'];
233
+ }
222
234
  if (fSwitchUsers.includes(tagName)) {
223
235
  completeStyle += fSwitchCSS['default'];
224
236
  }
@@ -105,13 +105,12 @@ export function compareValues(obj1, value1, obj2, value2, sortMode) {
105
105
  v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, KupDatesFormats.ISO_DATE));
106
106
  }
107
107
  else if (dom.ketchup.objects.isTime(obj1)) {
108
- let manageSeconds = dom.ketchup.objects.isTimeWithSeconds(obj1);
109
- v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, manageSeconds
110
- ? KupDatesFormats.ISO_TIME
111
- : KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
112
- v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, manageSeconds
113
- ? KupDatesFormats.ISO_TIME
114
- : KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
108
+ // Previous code could not work because dayjs
109
+ // returns an invalid date when it tries to parse a time
110
+ // This solution is simpler and it works because the time format
111
+ // was assumed to be equals to HH:mm:ss or HH:mm
112
+ v1 = Number(s1.replace(/:/g, ''));
113
+ v2 = Number(s2.replace(/:/g, ''));
115
114
  }
116
115
  else if (dom.ketchup.objects.isTimestamp(obj1)) {
117
116
  v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE_TIME));
@@ -1,4 +1,3 @@
1
- import { KupManager } from "../managers/kup-manager/kup-manager";
2
1
  export function identify(array) {
3
2
  if (array) {
4
3
  for (let i = 0; i < array.length; i++) {
@@ -78,7 +77,3 @@ export function getRegExpFromString(s, flags) {
78
77
  function escapeRegExp(s) {
79
78
  return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
80
79
  }
81
- export function getNewKupManager() {
82
- const kupManager = new KupManager();
83
- return kupManager;
84
- }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
+ * if the path needs to be customized.
4
+ */
5
+ export declare const getAssetPath: (path: string) => string;
6
+
1
7
  /**
2
8
  * Used to manually set the base path where assets can be found.
3
9
  * If the script is used as "module", it's recommended to use "import.meta.url",
@@ -1 +1,9 @@
1
- export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
1
+ export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
2
+ import { K as KupManager } from './kup-manager.js';
3
+
4
+ /** used for obtain a KupManager instance without a dom document (for UT) */
5
+ function newKupManager(init) {
6
+ return new KupManager(init);
7
+ }
8
+
9
+ export { newKupManager };
@@ -1,5 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
2
- import { k as kupManagerInstance, M as MDCRipple, g as getProps, s as setProps, F as FImage, K as KupThemeColorValues, a as KupThemeIconValues, c as componentWrapperId, d as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, h as defineCustomElement$6, i as defineCustomElement$7, j as defineCustomElement$8, l as defineCustomElement$9, m as defineCustomElement$a, n as defineCustomElement$b, o as defineCustomElement$c, p as defineCustomElement$d, q as defineCustomElement$e, r as defineCustomElement$f, t as defineCustomElement$g, u as defineCustomElement$h, v as defineCustomElement$i, w as defineCustomElement$j, x as defineCustomElement$k, y as defineCustomElement$l, z as defineCustomElement$m, A as defineCustomElement$n, B as defineCustomElement$o, C as defineCustomElement$p, D as defineCustomElement$q, E as defineCustomElement$r, G as defineCustomElement$s } from './kup-autocomplete2.js';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps, a as KupThemeColorValues, b as KupThemeIconValues } from './kup-manager.js';
3
+ import { M as MDCRipple, F as FImage, c as componentWrapperId, d as defineCustomElement$2, a as defineCustomElement$3, b as defineCustomElement$4, e as defineCustomElement$5, f as defineCustomElement$6, g as defineCustomElement$7, h as defineCustomElement$8, i as defineCustomElement$9, j as defineCustomElement$a, k as defineCustomElement$b, l as defineCustomElement$c, m as defineCustomElement$d, n as defineCustomElement$e, o as defineCustomElement$f, p as defineCustomElement$g, q as defineCustomElement$h, r as defineCustomElement$i, s as defineCustomElement$j, t as defineCustomElement$k, u as defineCustomElement$l, v as defineCustomElement$m, w as defineCustomElement$n, x as defineCustomElement$o, y as defineCustomElement$p, z as defineCustomElement$q, A as defineCustomElement$r, B as defineCustomElement$s } from './kup-autocomplete2.js';
3
4
 
4
5
  /**
5
6
  * Props of the kup-accordion component.
@@ -212,6 +213,8 @@ const KupAccordion$1 = /*@__PURE__*/ proxyCustomElement(class KupAccordion exten
212
213
  "refresh": [64],
213
214
  "setProps": [64],
214
215
  "toggleItem": [64]
216
+ }, undefined, {
217
+ "ripple": ["applyRipple"]
215
218
  }]);
216
219
  function defineCustomElement$1() {
217
220
  if (typeof customElements === "undefined") {
@@ -1,4 +1,4 @@
1
- import { H as KupAutocomplete$1, G as defineCustomElement$1 } from './kup-autocomplete2.js';
1
+ import { K as KupAutocomplete$1, B as defineCustomElement$1 } from './kup-autocomplete2.js';
2
2
 
3
3
  const KupAutocomplete = KupAutocomplete$1;
4
4
  const defineCustomElement = defineCustomElement$1;