@sme.up/ketchup 9.0.0 → 9.1.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 (160) hide show
  1. package/dist/cjs/{f-button-b2cfce1c.js → f-button-733664a5.js} +2 -2
  2. package/dist/cjs/{f-cell-75fca92b.js → f-cell-f37757a6.js} +183 -11
  3. package/dist/cjs/{f-checkbox-48d7af02.js → f-checkbox-556771e8.js} +1 -1
  4. package/dist/cjs/{f-chip-3e504f3e.js → f-chip-3349d130.js} +3 -3
  5. package/dist/cjs/{f-image-270d39ae.js → f-image-b7a5816b.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-6d0c4678.js → f-paginator-utils-1fe1df76.js} +49 -50
  7. package/dist/cjs/{f-text-field-bbcd2143.js → f-text-field-8557fc3f.js} +38 -4
  8. package/dist/cjs/{index-c3d10561.js → index-4b3a5567.js} +48 -18
  9. package/dist/cjs/ketchup.cjs.js +3 -3
  10. package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
  11. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +157 -195
  12. package/dist/cjs/kup-box.cjs.entry.js +23 -15
  13. package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-card-list.cjs.entry.js +2 -2
  15. package/dist/cjs/kup-cell.cjs.entry.js +9 -7
  16. package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
  17. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  18. package/dist/cjs/kup-echart.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
  20. package/dist/cjs/kup-grid.cjs.entry.js +2 -2
  21. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  22. package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
  23. package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
  25. package/dist/cjs/{kup-manager-130bbd9d.js → kup-manager-cb73c128.js} +59 -9
  26. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  27. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-planner.cjs.entry.js +3 -3
  30. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
  33. package/dist/cjs/loader.cjs.js +2 -2
  34. package/dist/collection/assets/index.js +4 -0
  35. package/dist/collection/assets/progress-bar.js +0 -0
  36. package/dist/collection/assets/radio.js +30 -0
  37. package/dist/collection/collection-manifest.json +2 -2
  38. package/dist/collection/components/kup-box/kup-box.js +14 -6
  39. package/dist/collection/components/kup-card/kup-card.css +14 -0
  40. package/dist/collection/components/kup-card/standard/kup-card-standard.js +10 -5
  41. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +47 -48
  42. package/dist/collection/components/kup-data-table/kup-data-table.js +36 -22
  43. package/dist/collection/components/kup-progress-bar/kup-progress-bar.css +1 -242
  44. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +37 -84
  45. package/dist/collection/components/kup-radio/kup-radio.css +0 -161
  46. package/dist/collection/components/kup-radio/kup-radio.js +31 -26
  47. package/dist/collection/components/kup-rating/kup-rating.css +0 -8
  48. package/dist/collection/components/kup-rating/kup-rating.js +27 -52
  49. package/dist/collection/f-components/f-cell/f-cell-declarations.js +1 -0
  50. package/dist/collection/f-components/f-cell/f-cell.js +19 -5
  51. package/dist/collection/f-components/f-progress-bar/f-progress-bar-declarations.js +1 -0
  52. package/dist/collection/f-components/f-progress-bar/f-progress-bar.js +88 -0
  53. package/dist/collection/f-components/f-radio/f-radio-declarations.js +1 -0
  54. package/dist/collection/f-components/f-radio/f-radio.js +28 -0
  55. package/dist/collection/f-components/f-rating/f-rating-declarations.js +1 -0
  56. package/dist/collection/f-components/f-rating/f-rating.js +26 -0
  57. package/dist/collection/f-components/f-text-field/f-text-field.js +36 -2
  58. package/dist/collection/managers/kup-data/kup-data.js +2 -0
  59. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +33 -0
  60. package/dist/collection/managers/kup-theme/kup-theme.js +13 -1
  61. package/dist/collection/utils/cell-utils.js +6 -7
  62. package/dist/components/index.d.ts +6 -0
  63. package/dist/components/index.js +1 -1
  64. package/dist/components/kup-accordion.js +2 -0
  65. package/dist/components/kup-autocomplete2.js +962 -801
  66. package/dist/components/kup-box2.js +24 -6
  67. package/dist/components/kup-calendar.js +3 -0
  68. package/dist/components/kup-dashboard.js +2 -0
  69. package/dist/components/kup-image-list.js +2 -0
  70. package/dist/components/kup-planner.js +2 -0
  71. package/dist/esm/{f-button-baa419dc.js → f-button-f247ce10.js} +2 -2
  72. package/dist/esm/{f-cell-18ee3afa.js → f-cell-ba94f1b3.js} +181 -12
  73. package/dist/esm/{f-checkbox-00a1e020.js → f-checkbox-cbf7b3de.js} +1 -1
  74. package/dist/esm/{f-chip-311500f4.js → f-chip-104c4a64.js} +3 -3
  75. package/dist/esm/{f-image-da03494c.js → f-image-d2a9603c.js} +2 -2
  76. package/dist/esm/{f-paginator-utils-d63a195e.js → f-paginator-utils-743522fa.js} +49 -50
  77. package/dist/esm/{f-text-field-e5f1f1fd.js → f-text-field-4d91ccfc.js} +38 -4
  78. package/dist/esm/{index-3336c3b1.js → index-c161a33e.js} +48 -18
  79. package/dist/esm/ketchup.js +4 -4
  80. package/dist/esm/kup-accordion.entry.js +3 -3
  81. package/dist/esm/kup-autocomplete_27.entry.js +157 -195
  82. package/dist/esm/kup-box.entry.js +23 -15
  83. package/dist/esm/kup-calendar.entry.js +5 -5
  84. package/dist/esm/kup-card-list.entry.js +2 -2
  85. package/dist/esm/kup-cell.entry.js +9 -7
  86. package/dist/esm/kup-dashboard.entry.js +6 -6
  87. package/dist/esm/kup-drawer.entry.js +2 -2
  88. package/dist/esm/kup-echart.entry.js +2 -2
  89. package/dist/esm/kup-family-tree.entry.js +4 -4
  90. package/dist/esm/kup-grid.entry.js +2 -2
  91. package/dist/esm/kup-iframe.entry.js +2 -2
  92. package/dist/esm/kup-image-list.entry.js +8 -8
  93. package/dist/esm/kup-lazy.entry.js +2 -2
  94. package/dist/esm/kup-magic-box.entry.js +3 -3
  95. package/dist/esm/{kup-manager-c8d5c94d.js → kup-manager-94b3d177.js} +59 -9
  96. package/dist/esm/kup-nav-bar.entry.js +2 -2
  97. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  98. package/dist/esm/kup-photo-frame.entry.js +2 -2
  99. package/dist/esm/kup-planner.entry.js +3 -3
  100. package/dist/esm/kup-probe.entry.js +2 -2
  101. package/dist/esm/kup-qlik.entry.js +2 -2
  102. package/dist/esm/kup-snackbar.entry.js +4 -4
  103. package/dist/esm/loader.js +3 -3
  104. package/dist/ketchup/ketchup.esm.js +1 -1
  105. package/dist/ketchup/p-12e47371.js +1 -0
  106. package/dist/ketchup/{p-81debebe.entry.js → p-15548f51.entry.js} +1 -1
  107. package/dist/ketchup/p-20e8ab84.js +2 -0
  108. package/dist/ketchup/{p-a0f59b05.entry.js → p-21f1b22a.entry.js} +1 -1
  109. package/dist/ketchup/{p-25de68e5.js → p-2c47b88f.js} +3 -3
  110. package/dist/ketchup/{p-7e1c8fc0.entry.js → p-304f296e.entry.js} +1 -1
  111. package/dist/ketchup/p-48f8b0d5.entry.js +9 -0
  112. package/dist/ketchup/p-4ca502ce.entry.js +1 -0
  113. package/dist/ketchup/{p-7555c10d.js → p-4d7c02f4.js} +1 -1
  114. package/dist/ketchup/{p-76130e83.entry.js → p-5abbf31b.entry.js} +1 -1
  115. package/dist/ketchup/{p-13eac183.entry.js → p-5c9b10a5.entry.js} +1 -1
  116. package/dist/ketchup/{p-55fd3f46.entry.js → p-5cb2dbf3.entry.js} +1 -1
  117. package/dist/ketchup/p-679ccbf8.js +1 -0
  118. package/dist/ketchup/p-6a0ac578.entry.js +1 -0
  119. package/dist/ketchup/{p-d6a7498b.entry.js → p-87e13738.entry.js} +1 -1
  120. package/dist/ketchup/p-8e5db599.entry.js +1 -0
  121. package/dist/ketchup/{p-07707cd1.entry.js → p-a14ede8c.entry.js} +1 -1
  122. package/dist/ketchup/{p-39602629.js → p-a2007880.js} +1 -1
  123. package/dist/ketchup/{p-da58f8ab.entry.js → p-a2b75445.entry.js} +1 -1
  124. package/dist/ketchup/{p-8281c9e5.js → p-b0678a34.js} +1 -1
  125. package/dist/ketchup/{p-4597f25d.js → p-ba003975.js} +1 -1
  126. package/dist/ketchup/{p-f729449f.js → p-bb80719e.js} +1 -1
  127. package/dist/ketchup/{p-2a2a18bf.entry.js → p-bf41d71f.entry.js} +1 -1
  128. package/dist/ketchup/{p-d8384990.entry.js → p-c32e8755.entry.js} +1 -1
  129. package/dist/ketchup/p-c4b1bde1.entry.js +1 -0
  130. package/dist/ketchup/p-c6b58be6.entry.js +1 -0
  131. package/dist/ketchup/{p-2dab9c4f.entry.js → p-d56763cf.entry.js} +1 -1
  132. package/dist/ketchup/{p-7bf649f0.entry.js → p-e7f57bee.entry.js} +1 -1
  133. package/dist/ketchup/{p-a8a39b08.entry.js → p-eb12225c.entry.js} +1 -1
  134. package/dist/ketchup/{p-2d192def.entry.js → p-f22abf4e.entry.js} +1 -1
  135. package/dist/ketchup/{p-51aa248f.entry.js → p-f82db512.entry.js} +1 -1
  136. package/dist/types/components/kup-box/kup-box.d.ts +1 -0
  137. package/dist/types/components/kup-progress-bar/kup-progress-bar.d.ts +0 -1
  138. package/dist/types/components/kup-radio/kup-radio-declarations.d.ts +1 -9
  139. package/dist/types/components/kup-radio/kup-radio.d.ts +3 -2
  140. package/dist/types/components/kup-rating/kup-rating.d.ts +2 -7
  141. package/dist/types/components.d.ts +6 -4
  142. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +1 -0
  143. package/dist/types/f-components/f-progress-bar/f-progress-bar-declarations.d.ts +16 -0
  144. package/dist/types/f-components/f-progress-bar/f-progress-bar.d.ts +3 -0
  145. package/dist/types/f-components/f-radio/f-radio-declarations.d.ts +22 -0
  146. package/dist/types/f-components/f-radio/f-radio.d.ts +3 -0
  147. package/dist/types/f-components/f-rating/f-rating-declarations.d.ts +10 -0
  148. package/dist/types/f-components/f-rating/f-rating.d.ts +3 -0
  149. package/dist/types/managers/kup-theme/kup-theme-declarations.d.ts +12 -0
  150. package/dist/types/stencil-public-runtime.d.ts +5 -3
  151. package/package.json +2 -2
  152. package/dist/ketchup/p-008ad26c.js +0 -1
  153. package/dist/ketchup/p-0c19d485.entry.js +0 -9
  154. package/dist/ketchup/p-2d42477d.js +0 -2
  155. package/dist/ketchup/p-5c15661d.entry.js +0 -1
  156. package/dist/ketchup/p-5cfaa673.entry.js +0 -1
  157. package/dist/ketchup/p-5f583257.entry.js +0 -1
  158. package/dist/ketchup/p-80699a95.js +0 -1
  159. package/dist/ketchup/p-bb854cf5.entry.js +0 -1
  160. package/dist/ketchup/p-ecb9fe91.entry.js +0 -1
@@ -3,6 +3,7 @@ import { kupManagerInstance, } from "../../managers/kup-manager/kup-manager";
3
3
  import { KupRadioProps, } from "./kup-radio-declarations";
4
4
  import { getProps, setProps } from "../../utils/utils";
5
5
  import { componentWrapperId } from "../../variables/GenericVariables";
6
+ import { FRadio } from "../../f-components/f-radio/f-radio";
6
7
  export class KupRadio {
7
8
  constructor() {
8
9
  /*-------------------------------------------------*/
@@ -41,6 +42,7 @@ export class KupRadio {
41
42
  id: this.rootElement.id,
42
43
  value: this.value,
43
44
  });
45
+ this.refresh();
44
46
  }
45
47
  onKupFocus() {
46
48
  this.kupFocus.emit({
@@ -92,28 +94,31 @@ export class KupRadio {
92
94
  if (!this.data || this.data.length === 0) {
93
95
  return;
94
96
  }
95
- const hasColumns = !!this.columns;
96
- const radioList = [];
97
- for (let i = 0; i < this.data.length; i++) {
98
- const data = this.data[i];
99
- const classObj = {
100
- radio: true,
101
- 'radio--checked': data.checked ? true : false,
102
- 'radio--disabled': this.disabled ? true : false,
103
- };
104
- const radioEl = (h("div", { class: `form-field ${this.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: this.disabled, onBlur: () => this.onKupBlur(), onChange: () => this.onKupChange(i), onFocus: () => this.onKupFocus() }), h("div", { class: "radio__background" }, h("div", { class: "radio__outer-circle" }), h("div", { class: "radio__inner-circle" }))), h("label", { htmlFor: 'radio-element', onClick: () => this.onKupChange(i) }, data.label ? data.label : '')));
105
- radioList.push(radioEl);
106
- }
107
- const hostStyle = {
108
- '--kup_radio_columns': hasColumns
109
- ? `repeat(${this.columns}, 1fr)`
110
- : '',
111
- };
112
- const classObj = {
113
- 'radio-wrapper': true,
114
- 'radio-wrapper--grid': hasColumns ? true : false,
97
+ const props = {
98
+ columns: this.columns,
99
+ danger: this.rootElement.classList.contains('kup-danger')
100
+ ? true
101
+ : false,
102
+ data: this.data,
103
+ disabled: this.disabled,
104
+ info: this.rootElement.classList.contains('kup-info')
105
+ ? true
106
+ : false,
107
+ leadingLabel: this.leadingLabel,
108
+ secondary: this.rootElement.classList.contains('kup-secondary')
109
+ ? true
110
+ : false,
111
+ success: this.rootElement.classList.contains('kup-success')
112
+ ? true
113
+ : false,
114
+ warning: this.rootElement.classList.contains('kup-warning')
115
+ ? true
116
+ : false,
117
+ onBlur: () => this.onKupBlur(),
118
+ onChange: (i) => this.onKupChange(i),
119
+ onFocus: () => this.onKupFocus(),
115
120
  };
116
- return (h(Host, { style: hostStyle }, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", { class: classObj }, radioList))));
121
+ return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h(FRadio, Object.assign({}, props)))));
117
122
  }
118
123
  disconnectedCallback() {
119
124
  this.kupManager.theme.unregister(this);
@@ -181,13 +186,13 @@ export class KupRadio {
181
186
  "type": "unknown",
182
187
  "mutable": false,
183
188
  "complexType": {
184
- "original": "KupRadioData[]",
185
- "resolved": "KupRadioData[]",
189
+ "original": "FRadioData[]",
190
+ "resolved": "FRadioData[]",
186
191
  "references": {
187
- "KupRadioData": {
192
+ "FRadioData": {
188
193
  "location": "import",
189
- "path": "./kup-radio-declarations",
190
- "id": "src/components/kup-radio/kup-radio-declarations.ts::KupRadioData"
194
+ "path": "../../f-components/f-radio/f-radio-declarations",
195
+ "id": "src/f-components/f-radio/f-radio-declarations.ts::FRadioData"
191
196
  }
192
197
  }
193
198
  },
@@ -3,13 +3,5 @@
3
3
  * @prop --kup-rating-font-size: Sets font size of the component.
4
4
  */
5
5
  :host {
6
- --kup_rating_color: var(--kup-rating-color, orange);
7
- --kup_rating_font_size: var(--kup-rating-font-size, 30px);
8
6
  display: block;
9
- }
10
-
11
- .rating {
12
- color: var(--kup_rating_color);
13
- cursor: pointer;
14
- font-size: var(--kup_rating_font_size);
15
7
  }
@@ -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);
@@ -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:
@@ -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,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 @@
1
- export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
1
+ export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
@@ -212,6 +212,8 @@ const KupAccordion$1 = /*@__PURE__*/ proxyCustomElement(class KupAccordion exten
212
212
  "refresh": [64],
213
213
  "setProps": [64],
214
214
  "toggleItem": [64]
215
+ }, undefined, {
216
+ "ripple": ["applyRipple"]
215
217
  }]);
216
218
  function defineCustomElement$1() {
217
219
  if (typeof customElements === "undefined") {