wcs-core 2.6.0 → 2.10.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 (159) hide show
  1. package/CHANGELOG.md +115 -7
  2. package/README.md +18 -0
  3. package/dist/cjs/{helpers-d9aaa8c4.js → helpers-6abce594.js} +5 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/popper-5777994b.js +1732 -0
  6. package/dist/cjs/wcs-button.cjs.entry.js +1 -1
  7. package/dist/cjs/wcs-checkbox.cjs.entry.js +6 -2
  8. package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
  9. package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
  10. package/dist/cjs/wcs-dropdown.cjs.entry.js +43 -10
  11. package/dist/cjs/wcs-error_2.cjs.entry.js +7 -10
  12. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +3 -1730
  13. package/dist/cjs/wcs-grid-column.cjs.entry.js +6 -2
  14. package/dist/cjs/wcs-grid.cjs.entry.js +28 -5
  15. package/dist/cjs/wcs-input.cjs.entry.js +3 -3
  16. package/dist/cjs/wcs-mat-icon.cjs.entry.js +1 -1
  17. package/dist/cjs/wcs-modal.cjs.entry.js +8 -3
  18. package/dist/cjs/wcs-radio-group.cjs.entry.js +3 -3
  19. package/dist/cjs/wcs-radio.cjs.entry.js +2 -2
  20. package/dist/cjs/wcs-select_2.cjs.entry.js +1 -1
  21. package/dist/cjs/wcs-switch.cjs.entry.js +10 -2
  22. package/dist/cjs/wcs-textarea.cjs.entry.js +2 -2
  23. package/dist/cjs/wcs-tooltip.cjs.entry.js +1605 -99
  24. package/dist/cjs/wcs.cjs.js +2 -2
  25. package/dist/collection/collection-manifest.json +3 -1
  26. package/dist/collection/components/badge/badge-interface.js +1 -0
  27. package/dist/collection/components/badge/badge.js +14 -4
  28. package/dist/collection/components/card/card-interface.js +1 -0
  29. package/dist/collection/components/card/card.js +7 -2
  30. package/dist/collection/components/checkbox/checkbox.css +18 -7
  31. package/dist/collection/components/checkbox/checkbox.js +24 -2
  32. package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
  33. package/dist/collection/components/dropdown/dropdown.css +46 -38
  34. package/dist/collection/components/dropdown/dropdown.js +90 -29
  35. package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
  36. package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
  37. package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
  38. package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
  39. package/dist/collection/components/editable-field/editable-field.js +7 -2
  40. package/dist/collection/components/form-field/form-field.css +1 -2
  41. package/dist/collection/components/form-field/form-field.js +6 -26
  42. package/dist/collection/components/grid/grid.js +28 -5
  43. package/dist/collection/components/grid-column/grid-column.js +9 -3
  44. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +7 -2
  45. package/dist/collection/components/input/input.css +48 -0
  46. package/dist/collection/components/input/input.js +38 -2
  47. package/dist/collection/components/mat-icon/mat-icon.css +1 -1
  48. package/dist/collection/components/mat-icon/mat-icon.js +7 -2
  49. package/dist/collection/components/modal/modal-interface.js +1 -0
  50. package/dist/collection/components/modal/modal.css +26 -7
  51. package/dist/collection/components/modal/modal.js +35 -7
  52. package/dist/collection/components/nav-item/nav-item.js +1 -1
  53. package/dist/collection/components/progress-bar/progress-bar.js +4 -4
  54. package/dist/collection/components/radio/radio.component.js +9 -4
  55. package/dist/collection/components/radio/radio.css +44 -19
  56. package/dist/collection/components/radio-group/radio-group.css +5 -1
  57. package/dist/collection/components/radio-group/radio-group.js +10 -5
  58. package/dist/collection/components/spinner/spinner-interface.js +1 -0
  59. package/dist/collection/components/spinner/spinner.js +8 -3
  60. package/dist/collection/components/switch/switch.css +53 -16
  61. package/dist/collection/components/switch/switch.js +55 -6
  62. package/dist/collection/components/tab/tab.js +1 -1
  63. package/dist/collection/components/tabs/tabs.js +1 -1
  64. package/dist/collection/components/textarea/textarea.css +4 -0
  65. package/dist/collection/components/tooltip/tooltip.css +3 -0
  66. package/dist/collection/components/tooltip/tooltip.js +308 -90
  67. package/dist/collection/utils/helpers.js +4 -0
  68. package/dist/esm/{helpers-50436c51.js → helpers-e2993152.js} +5 -1
  69. package/dist/esm/loader.js +2 -2
  70. package/dist/esm/popper-5f42e560.js +1729 -0
  71. package/dist/esm/wcs-button.entry.js +1 -1
  72. package/dist/esm/wcs-checkbox.entry.js +6 -2
  73. package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
  74. package/dist/esm/wcs-dropdown-header.entry.js +15 -0
  75. package/dist/esm/wcs-dropdown.entry.js +43 -10
  76. package/dist/esm/wcs-error_2.entry.js +7 -10
  77. package/dist/esm/wcs-galactic-menu.entry.js +2 -1729
  78. package/dist/esm/wcs-grid-column.entry.js +6 -2
  79. package/dist/esm/wcs-grid.entry.js +28 -5
  80. package/dist/esm/wcs-input.entry.js +3 -3
  81. package/dist/esm/wcs-mat-icon.entry.js +1 -1
  82. package/dist/esm/wcs-modal.entry.js +8 -3
  83. package/dist/esm/wcs-radio-group.entry.js +3 -3
  84. package/dist/esm/wcs-radio.entry.js +2 -2
  85. package/dist/esm/wcs-select_2.entry.js +1 -1
  86. package/dist/esm/wcs-switch.entry.js +10 -2
  87. package/dist/esm/wcs-textarea.entry.js +2 -2
  88. package/dist/esm/wcs-tooltip.entry.js +1605 -99
  89. package/dist/esm/wcs.js +2 -2
  90. package/dist/types/components/badge/badge-interface.d.ts +2 -0
  91. package/dist/types/components/badge/badge.d.ts +3 -2
  92. package/dist/types/components/card/card-interface.d.ts +1 -0
  93. package/dist/types/components/card/card.d.ts +2 -1
  94. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  95. package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
  96. package/dist/types/components/dropdown/dropdown.d.ts +13 -16
  97. package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
  98. package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
  99. package/dist/types/components/editable-field/editable-field-interface.d.ts +1 -0
  100. package/dist/types/components/editable-field/editable-field.d.ts +2 -2
  101. package/dist/types/components/form-field/form-field.d.ts +0 -4
  102. package/dist/types/components/grid/grid.d.ts +11 -0
  103. package/dist/types/components/grid-column/grid-column.d.ts +2 -1
  104. package/dist/types/components/horizontal-stepper/horizontal-stepper-interface.d.ts +1 -0
  105. package/dist/types/components/horizontal-stepper/horizontal-stepper.d.ts +2 -2
  106. package/dist/types/components/input/input.d.ts +8 -0
  107. package/dist/types/components/mat-icon/mat-icon-interface.d.ts +1 -0
  108. package/dist/types/components/mat-icon/mat-icon.d.ts +2 -2
  109. package/dist/types/components/modal/modal-interface.d.ts +1 -0
  110. package/dist/types/components/modal/modal.d.ts +7 -1
  111. package/dist/types/components/radio/radio.component.d.ts +2 -1
  112. package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
  113. package/dist/types/components/radio-group/radio-group.d.ts +2 -2
  114. package/dist/types/components/spinner/spinner-interface.d.ts +1 -0
  115. package/dist/types/components/spinner/spinner.d.ts +2 -1
  116. package/dist/types/components/switch/switch-interface.d.ts +1 -0
  117. package/dist/types/components/switch/switch.d.ts +10 -2
  118. package/dist/types/components/tooltip/tooltip.d.ts +70 -6
  119. package/dist/types/components.d.ts +210 -41
  120. package/dist/types/interfaces.d.ts +22 -0
  121. package/dist/types/stencil-public-runtime.d.ts +6 -4
  122. package/dist/types/utils/helpers.d.ts +1 -0
  123. package/dist/wcs/{p-64523291.entry.js → p-22813c8e.entry.js} +1 -1
  124. package/dist/wcs/{p-356a8e3b.entry.js → p-384068f7.entry.js} +1 -1
  125. package/dist/wcs/p-41037455.entry.js +1 -0
  126. package/dist/wcs/p-4e9e226d.entry.js +1 -0
  127. package/dist/wcs/p-7206e492.entry.js +1 -0
  128. package/dist/wcs/p-7c26f650.entry.js +1 -0
  129. package/dist/wcs/p-8c8740e3.entry.js +1 -0
  130. package/dist/wcs/p-9619f77a.entry.js +1 -0
  131. package/dist/wcs/p-a92d369e.entry.js +1 -0
  132. package/dist/wcs/p-a978c1e3.entry.js +1 -0
  133. package/dist/wcs/p-b5ffbea8.entry.js +1 -0
  134. package/dist/wcs/p-bbf1ef42.entry.js +1 -0
  135. package/dist/wcs/p-bcf381a2.entry.js +1 -0
  136. package/dist/wcs/{p-3d10b02a.entry.js → p-c7d6d3e1.entry.js} +1 -1
  137. package/dist/wcs/p-cf4d7a83.js +1 -0
  138. package/dist/wcs/p-d3c9a644.js +1 -0
  139. package/dist/wcs/p-ecbe5165.entry.js +6 -0
  140. package/dist/wcs/p-f430a227.entry.js +1 -0
  141. package/dist/wcs/p-f96bb0bf.entry.js +1 -0
  142. package/dist/wcs/{p-4338f140.entry.js → p-ff6d0dfd.entry.js} +1 -1
  143. package/dist/wcs/wcs.css +1 -1
  144. package/dist/wcs/wcs.esm.js +1 -1
  145. package/package.json +5 -4
  146. package/dist/types/interface.d.ts +0 -3
  147. package/dist/wcs/p-0fbe574e.entry.js +0 -1
  148. package/dist/wcs/p-15008e35.entry.js +0 -1
  149. package/dist/wcs/p-17c6db7f.entry.js +0 -1
  150. package/dist/wcs/p-62f7ab6d.entry.js +0 -1
  151. package/dist/wcs/p-83f1ad32.js +0 -1
  152. package/dist/wcs/p-8f0f9868.entry.js +0 -1
  153. package/dist/wcs/p-a5a1b27c.entry.js +0 -1
  154. package/dist/wcs/p-af1a5e52.entry.js +0 -1
  155. package/dist/wcs/p-bef44630.entry.js +0 -1
  156. package/dist/wcs/p-d59b4495.entry.js +0 -1
  157. package/dist/wcs/p-dd300dea.entry.js +0 -1
  158. package/dist/wcs/p-e486647c.entry.js +0 -1
  159. package/dist/wcs/p-ed6e8541.entry.js +0 -1
@@ -10,9 +10,9 @@ export class RadioGroup {
10
10
  if (this.value) {
11
11
  this.updateOptionsState(this.value, true);
12
12
  }
13
- if (this.mode === 'option') {
13
+ if (this.mode === 'option' || this.mode === 'horizontal') {
14
14
  for (const option of this.options) {
15
- option.mode = 'option';
15
+ option.mode = this.mode;
16
16
  }
17
17
  }
18
18
  }
@@ -94,9 +94,14 @@ export class RadioGroup {
94
94
  "type": "string",
95
95
  "mutable": false,
96
96
  "complexType": {
97
- "original": "'radio' | 'option'",
98
- "resolved": "\"option\" | \"radio\"",
99
- "references": {}
97
+ "original": "RadioGroupMode",
98
+ "resolved": "\"horizontal\" | \"option\" | \"radio\"",
99
+ "references": {
100
+ "RadioGroupMode": {
101
+ "location": "import",
102
+ "path": "./radio-group-interface"
103
+ }
104
+ }
100
105
  },
101
106
  "required": false,
102
107
  "optional": false,
@@ -18,11 +18,16 @@ export class Spinner {
18
18
  static get properties() { return {
19
19
  "mode": {
20
20
  "type": "string",
21
- "mutable": true,
21
+ "mutable": false,
22
22
  "complexType": {
23
- "original": "'border' | 'growing'",
23
+ "original": "WcsSpinnerMode",
24
24
  "resolved": "\"border\" | \"growing\"",
25
- "references": {}
25
+ "references": {
26
+ "WcsSpinnerMode": {
27
+ "location": "import",
28
+ "path": "./spinner-interface"
29
+ }
30
+ }
26
31
  },
27
32
  "required": false,
28
33
  "optional": false,
@@ -3,40 +3,54 @@
3
3
  --wcs-switch-background-color-final: var(--wcs-primary);
4
4
  --wcs-switch-bullet-color-initial: var(--wcs-switch-background-color-final);
5
5
  --wcs-switch-bullet-color-final: var(--wcs-switch-background-color-initial);
6
+ --wcs-switch-text-color: var(--wcs-text-medium);
6
7
  display: flex;
7
8
  }
8
9
 
10
+ :host([disabled]) {
11
+ --wcs-switch-text-color: var(--wcs-text-disabled);
12
+ }
13
+
9
14
  /* Customize the label (the wcs-container) */
10
15
  .wcs-container {
11
16
  position: relative;
12
- display: inline-block;
13
- width: 3rem;
14
- height: 1.5rem;
17
+ display: flex;
15
18
  margin-bottom: 0;
16
19
  }
17
20
 
21
+ /* Let the user choose the alignment of the checkbox with the label text */
22
+ :host([label-alignment=top]) .wcs-container {
23
+ align-items: start;
24
+ }
25
+
26
+ :host([label-alignment=center]) .wcs-container {
27
+ align-items: center;
28
+ }
29
+
30
+ :host([label-alignment=bottom]) .wcs-container {
31
+ align-items: flex-end;
32
+ }
33
+
18
34
  /* Hide the browser's default switch */
19
35
  .wcs-container input {
20
36
  position: absolute;
21
37
  opacity: 0;
22
- cursor: pointer;
23
38
  height: 0;
24
39
  width: 0;
25
40
  }
26
41
 
27
- /* Create a custom switch */
28
- .wcs-switch, .text {
29
- position: absolute;
30
- width: 1px;
31
- height: 1px;
32
- padding: 0;
33
- overflow: hidden;
34
- clip: rect(0, 0, 0, 0);
35
- white-space: nowrap;
36
- border: 0;
42
+ .text {
43
+ color: var(--wcs-switch-text-color);
44
+ margin-left: 6px;
45
+ font-weight: 500;
46
+ line-height: 1.375;
47
+ }
48
+
49
+ .wcs-container:not([aria-disabled]) input:checked ~ .text {
50
+ --wcs-switch-text-color: var(--wcs-primary);
37
51
  }
38
52
 
39
- .wcs-checkmark::before, .wcs-checkmark {
53
+ .wcs-checkmark::before {
40
54
  position: absolute;
41
55
  transition: all 0.15s ease-out;
42
56
  }
@@ -51,16 +65,39 @@
51
65
  background-color: var(--wcs-switch-bullet-color-initial);
52
66
  }
53
67
 
68
+ :host([disabled]:not([checked])) .wcs-checkmark::before {
69
+ background-color: var(--wcs-text-disabled);
70
+ }
71
+ :host([disabled]:not([checked])) .wcs-checkmark {
72
+ background-color: var(--wcs-light);
73
+ }
74
+
75
+ :host([disabled][checked]) .wcs-checkmark::before {
76
+ background-color: var(--wcs-white);
77
+ }
78
+ :host([disabled][checked]) .wcs-checkmark {
79
+ background-color: var(--wcs-text-disabled);
80
+ }
81
+
54
82
  .wcs-checkmark {
55
83
  top: 0;
56
84
  right: 0;
57
85
  bottom: 0;
58
86
  left: 0;
59
- cursor: pointer;
87
+ width: 3rem;
88
+ height: 1.5rem;
60
89
  border-radius: 0.75rem;
61
90
  background-color: var(--wcs-switch-background-color-initial);
62
91
  }
63
92
 
93
+ .wcs-container:not([aria-disabled]) {
94
+ cursor: pointer;
95
+ }
96
+
97
+ .wcs-container:hover:not([aria-disabled]) {
98
+ --wcs-switch-text-color: var(--wcs-primary);
99
+ }
100
+
64
101
  /* When the switch is checked, change the bullet to grey */
65
102
  input:not([disabled]):checked + .wcs-checkmark::before,
66
103
  .wcs-container:hover input:not([disabled]) + .wcs-checkmark::before,
@@ -1,4 +1,4 @@
1
- import { Component, Prop, Event, Element, h, Host } from '@stencil/core';
1
+ import { Component, Element, Event, h, Host, Prop } from '@stencil/core';
2
2
  export class Switch {
3
3
  constructor() {
4
4
  this.switchId = `wcs-switch-${switchIds++}`;
@@ -7,6 +7,14 @@ export class Switch {
7
7
  * If `true`, the switch is selected.
8
8
  */
9
9
  this.checked = false;
10
+ /**
11
+ * Specifie the alignment of the switch with the label content
12
+ */
13
+ this.labelAlignment = 'center';
14
+ /**
15
+ * Specify wether the switch is disabled or not.
16
+ */
17
+ this.disabled = false;
10
18
  }
11
19
  toggleChange(_event) {
12
20
  this.checked = !this.checked;
@@ -16,11 +24,11 @@ export class Switch {
16
24
  }
17
25
  render() {
18
26
  return (h(Host, null,
19
- h("label", { htmlFor: this.name, class: "wcs-container" },
27
+ h("label", { htmlFor: this.name, class: "wcs-container", "aria-disabled": this.disabled },
28
+ h("input", { onChange: (evt) => this.toggleChange(evt), checked: this.checked, class: "wcs-switch", type: "checkbox", name: this.name, disabled: this.disabled, id: this.name }),
29
+ h("span", { class: "wcs-checkmark" }),
20
30
  h("span", { class: "text" },
21
- h("slot", null)),
22
- h("input", { onChange: (evt) => this.toggleChange(evt), checked: this.checked, class: "wcs-switch", type: "checkbox", name: this.name, id: this.name }),
23
- h("span", { class: "wcs-checkmark" }))));
31
+ h("slot", null)))));
24
32
  }
25
33
  static get is() { return "wcs-switch"; }
26
34
  static get encapsulation() { return "shadow"; }
@@ -51,7 +59,7 @@ export class Switch {
51
59
  },
52
60
  "checked": {
53
61
  "type": "boolean",
54
- "mutable": true,
62
+ "mutable": false,
55
63
  "complexType": {
56
64
  "original": "boolean",
57
65
  "resolved": "boolean",
@@ -64,6 +72,47 @@ export class Switch {
64
72
  "text": "If `true`, the switch is selected."
65
73
  },
66
74
  "attribute": "checked",
75
+ "reflect": true,
76
+ "defaultValue": "false"
77
+ },
78
+ "labelAlignment": {
79
+ "type": "string",
80
+ "mutable": false,
81
+ "complexType": {
82
+ "original": "SwitchLabelAlignment",
83
+ "resolved": "\"bottom\" | \"center\" | \"top\"",
84
+ "references": {
85
+ "SwitchLabelAlignment": {
86
+ "location": "import",
87
+ "path": "./switch-interface"
88
+ }
89
+ }
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": "Specifie the alignment of the switch with the label content"
96
+ },
97
+ "attribute": "label-alignment",
98
+ "reflect": true,
99
+ "defaultValue": "'center'"
100
+ },
101
+ "disabled": {
102
+ "type": "boolean",
103
+ "mutable": false,
104
+ "complexType": {
105
+ "original": "boolean",
106
+ "resolved": "boolean",
107
+ "references": {}
108
+ },
109
+ "required": false,
110
+ "optional": false,
111
+ "docs": {
112
+ "tags": [],
113
+ "text": "Specify wether the switch is disabled or not."
114
+ },
115
+ "attribute": "disabled",
67
116
  "reflect": false,
68
117
  "defaultValue": "false"
69
118
  }
@@ -16,7 +16,7 @@ export class Tab {
16
16
  static get properties() { return {
17
17
  "header": {
18
18
  "type": "string",
19
- "mutable": true,
19
+ "mutable": false,
20
20
  "complexType": {
21
21
  "original": "string",
22
22
  "resolved": "string",
@@ -166,7 +166,7 @@ export class Tabs {
166
166
  static get properties() { return {
167
167
  "align": {
168
168
  "type": "string",
169
- "mutable": true,
169
+ "mutable": false,
170
170
  "complexType": {
171
171
  "original": "WcsTabsAlignment",
172
172
  "resolved": "\"center\" | \"end\" | \"start\"",
@@ -40,6 +40,10 @@
40
40
  margin-right: -8px;
41
41
  }
42
42
 
43
+ :host([disabled]) textarea {
44
+ color: var(--wcs-text-disabled);
45
+ }
46
+
43
47
  :host([state=error]) {
44
48
  border-color: var(--wcs-red) !important;
45
49
  }
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: none;
3
+ }