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.
- package/CHANGELOG.md +115 -7
- package/README.md +18 -0
- package/dist/cjs/{helpers-d9aaa8c4.js → helpers-6abce594.js} +5 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/popper-5777994b.js +1732 -0
- package/dist/cjs/wcs-button.cjs.entry.js +1 -1
- package/dist/cjs/wcs-checkbox.cjs.entry.js +6 -2
- package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
- package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
- package/dist/cjs/wcs-dropdown.cjs.entry.js +43 -10
- package/dist/cjs/wcs-error_2.cjs.entry.js +7 -10
- package/dist/cjs/wcs-galactic-menu.cjs.entry.js +3 -1730
- package/dist/cjs/wcs-grid-column.cjs.entry.js +6 -2
- package/dist/cjs/wcs-grid.cjs.entry.js +28 -5
- package/dist/cjs/wcs-input.cjs.entry.js +3 -3
- package/dist/cjs/wcs-mat-icon.cjs.entry.js +1 -1
- package/dist/cjs/wcs-modal.cjs.entry.js +8 -3
- package/dist/cjs/wcs-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/wcs-radio.cjs.entry.js +2 -2
- package/dist/cjs/wcs-select_2.cjs.entry.js +1 -1
- package/dist/cjs/wcs-switch.cjs.entry.js +10 -2
- package/dist/cjs/wcs-textarea.cjs.entry.js +2 -2
- package/dist/cjs/wcs-tooltip.cjs.entry.js +1605 -99
- package/dist/cjs/wcs.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/badge/badge-interface.js +1 -0
- package/dist/collection/components/badge/badge.js +14 -4
- package/dist/collection/components/card/card-interface.js +1 -0
- package/dist/collection/components/card/card.js +7 -2
- package/dist/collection/components/checkbox/checkbox.css +18 -7
- package/dist/collection/components/checkbox/checkbox.js +24 -2
- package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
- package/dist/collection/components/dropdown/dropdown.css +46 -38
- package/dist/collection/components/dropdown/dropdown.js +90 -29
- package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
- package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
- package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
- package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
- package/dist/collection/components/editable-field/editable-field.js +7 -2
- package/dist/collection/components/form-field/form-field.css +1 -2
- package/dist/collection/components/form-field/form-field.js +6 -26
- package/dist/collection/components/grid/grid.js +28 -5
- package/dist/collection/components/grid-column/grid-column.js +9 -3
- package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +7 -2
- package/dist/collection/components/input/input.css +48 -0
- package/dist/collection/components/input/input.js +38 -2
- package/dist/collection/components/mat-icon/mat-icon.css +1 -1
- package/dist/collection/components/mat-icon/mat-icon.js +7 -2
- package/dist/collection/components/modal/modal-interface.js +1 -0
- package/dist/collection/components/modal/modal.css +26 -7
- package/dist/collection/components/modal/modal.js +35 -7
- package/dist/collection/components/nav-item/nav-item.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +4 -4
- package/dist/collection/components/radio/radio.component.js +9 -4
- package/dist/collection/components/radio/radio.css +44 -19
- package/dist/collection/components/radio-group/radio-group.css +5 -1
- package/dist/collection/components/radio-group/radio-group.js +10 -5
- package/dist/collection/components/spinner/spinner-interface.js +1 -0
- package/dist/collection/components/spinner/spinner.js +8 -3
- package/dist/collection/components/switch/switch.css +53 -16
- package/dist/collection/components/switch/switch.js +55 -6
- package/dist/collection/components/tab/tab.js +1 -1
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/textarea/textarea.css +4 -0
- package/dist/collection/components/tooltip/tooltip.css +3 -0
- package/dist/collection/components/tooltip/tooltip.js +308 -90
- package/dist/collection/utils/helpers.js +4 -0
- package/dist/esm/{helpers-50436c51.js → helpers-e2993152.js} +5 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/popper-5f42e560.js +1729 -0
- package/dist/esm/wcs-button.entry.js +1 -1
- package/dist/esm/wcs-checkbox.entry.js +6 -2
- package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
- package/dist/esm/wcs-dropdown-header.entry.js +15 -0
- package/dist/esm/wcs-dropdown.entry.js +43 -10
- package/dist/esm/wcs-error_2.entry.js +7 -10
- package/dist/esm/wcs-galactic-menu.entry.js +2 -1729
- package/dist/esm/wcs-grid-column.entry.js +6 -2
- package/dist/esm/wcs-grid.entry.js +28 -5
- package/dist/esm/wcs-input.entry.js +3 -3
- package/dist/esm/wcs-mat-icon.entry.js +1 -1
- package/dist/esm/wcs-modal.entry.js +8 -3
- package/dist/esm/wcs-radio-group.entry.js +3 -3
- package/dist/esm/wcs-radio.entry.js +2 -2
- package/dist/esm/wcs-select_2.entry.js +1 -1
- package/dist/esm/wcs-switch.entry.js +10 -2
- package/dist/esm/wcs-textarea.entry.js +2 -2
- package/dist/esm/wcs-tooltip.entry.js +1605 -99
- package/dist/esm/wcs.js +2 -2
- package/dist/types/components/badge/badge-interface.d.ts +2 -0
- package/dist/types/components/badge/badge.d.ts +3 -2
- package/dist/types/components/card/card-interface.d.ts +1 -0
- package/dist/types/components/card/card.d.ts +2 -1
- package/dist/types/components/checkbox/checkbox.d.ts +4 -0
- package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
- package/dist/types/components/dropdown/dropdown.d.ts +13 -16
- package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
- package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
- package/dist/types/components/editable-field/editable-field-interface.d.ts +1 -0
- package/dist/types/components/editable-field/editable-field.d.ts +2 -2
- package/dist/types/components/form-field/form-field.d.ts +0 -4
- package/dist/types/components/grid/grid.d.ts +11 -0
- package/dist/types/components/grid-column/grid-column.d.ts +2 -1
- package/dist/types/components/horizontal-stepper/horizontal-stepper-interface.d.ts +1 -0
- package/dist/types/components/horizontal-stepper/horizontal-stepper.d.ts +2 -2
- package/dist/types/components/input/input.d.ts +8 -0
- package/dist/types/components/mat-icon/mat-icon-interface.d.ts +1 -0
- package/dist/types/components/mat-icon/mat-icon.d.ts +2 -2
- package/dist/types/components/modal/modal-interface.d.ts +1 -0
- package/dist/types/components/modal/modal.d.ts +7 -1
- package/dist/types/components/radio/radio.component.d.ts +2 -1
- package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
- package/dist/types/components/radio-group/radio-group.d.ts +2 -2
- package/dist/types/components/spinner/spinner-interface.d.ts +1 -0
- package/dist/types/components/spinner/spinner.d.ts +2 -1
- package/dist/types/components/switch/switch-interface.d.ts +1 -0
- package/dist/types/components/switch/switch.d.ts +10 -2
- package/dist/types/components/tooltip/tooltip.d.ts +70 -6
- package/dist/types/components.d.ts +210 -41
- package/dist/types/interfaces.d.ts +22 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/utils/helpers.d.ts +1 -0
- package/dist/wcs/{p-64523291.entry.js → p-22813c8e.entry.js} +1 -1
- package/dist/wcs/{p-356a8e3b.entry.js → p-384068f7.entry.js} +1 -1
- package/dist/wcs/p-41037455.entry.js +1 -0
- package/dist/wcs/p-4e9e226d.entry.js +1 -0
- package/dist/wcs/p-7206e492.entry.js +1 -0
- package/dist/wcs/p-7c26f650.entry.js +1 -0
- package/dist/wcs/p-8c8740e3.entry.js +1 -0
- package/dist/wcs/p-9619f77a.entry.js +1 -0
- package/dist/wcs/p-a92d369e.entry.js +1 -0
- package/dist/wcs/p-a978c1e3.entry.js +1 -0
- package/dist/wcs/p-b5ffbea8.entry.js +1 -0
- package/dist/wcs/p-bbf1ef42.entry.js +1 -0
- package/dist/wcs/p-bcf381a2.entry.js +1 -0
- package/dist/wcs/{p-3d10b02a.entry.js → p-c7d6d3e1.entry.js} +1 -1
- package/dist/wcs/p-cf4d7a83.js +1 -0
- package/dist/wcs/p-d3c9a644.js +1 -0
- package/dist/wcs/p-ecbe5165.entry.js +6 -0
- package/dist/wcs/p-f430a227.entry.js +1 -0
- package/dist/wcs/p-f96bb0bf.entry.js +1 -0
- package/dist/wcs/{p-4338f140.entry.js → p-ff6d0dfd.entry.js} +1 -1
- package/dist/wcs/wcs.css +1 -1
- package/dist/wcs/wcs.esm.js +1 -1
- package/package.json +5 -4
- package/dist/types/interface.d.ts +0 -3
- package/dist/wcs/p-0fbe574e.entry.js +0 -1
- package/dist/wcs/p-15008e35.entry.js +0 -1
- package/dist/wcs/p-17c6db7f.entry.js +0 -1
- package/dist/wcs/p-62f7ab6d.entry.js +0 -1
- package/dist/wcs/p-83f1ad32.js +0 -1
- package/dist/wcs/p-8f0f9868.entry.js +0 -1
- package/dist/wcs/p-a5a1b27c.entry.js +0 -1
- package/dist/wcs/p-af1a5e52.entry.js +0 -1
- package/dist/wcs/p-bef44630.entry.js +0 -1
- package/dist/wcs/p-d59b4495.entry.js +0 -1
- package/dist/wcs/p-dd300dea.entry.js +0 -1
- package/dist/wcs/p-e486647c.entry.js +0 -1
- package/dist/wcs/p-ed6e8541.entry.js +0 -1
|
@@ -65,22 +65,19 @@ export class FormField {
|
|
|
65
65
|
this.updateLabelRequiredFlag(isRequired, label);
|
|
66
66
|
}
|
|
67
67
|
initSpiedElement() {
|
|
68
|
-
var _a;
|
|
68
|
+
var _a, _b;
|
|
69
69
|
const SUPPORTED_COMPONENTS = ['wcs-input', 'wcs-select', 'wcs-textarea', 'wcs-radio-group', 'wcs-switch', 'wcs-checkbox'];
|
|
70
|
-
this.spiedElement = (_a = this.el.shadowRoot.querySelector('slot:not([name])')) === null || _a === void 0 ? void 0 : _a.assignedElements()[0];
|
|
70
|
+
this.spiedElement = (_a = this.el.shadowRoot.querySelector('slot:not([name])')) === null || _a === void 0 ? void 0 : _a.assignedElements().filter(n => [...SUPPORTED_COMPONENTS, 'SLOT'].map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0];
|
|
71
71
|
// If the component is used in another web component
|
|
72
|
-
if (this.spiedElement.tagName === 'SLOT') {
|
|
72
|
+
if (((_b = this.spiedElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'SLOT') {
|
|
73
73
|
this.spiedElement = (this.spiedElement
|
|
74
74
|
.assignedElements()
|
|
75
75
|
.filter(n => SUPPORTED_COMPONENTS.map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0]);
|
|
76
76
|
}
|
|
77
|
-
if (!this.spiedElement)
|
|
78
|
-
throw new Error('You must provide a slotted element in form field');
|
|
79
|
-
if (SUPPORTED_COMPONENTS
|
|
80
|
-
.map(x => x.toUpperCase())
|
|
81
|
-
.indexOf(this.spiedElement.tagName) === -1) {
|
|
77
|
+
if (!this.spiedElement) {
|
|
82
78
|
// tslint:disable-next-line:no-console
|
|
83
|
-
console.warn('
|
|
79
|
+
console.warn('Form-field component support only ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component.');
|
|
80
|
+
return;
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
updateLabelRequiredFlag(isRequired, label) {
|
|
@@ -143,23 +140,6 @@ export class FormField {
|
|
|
143
140
|
"attribute": "is-error",
|
|
144
141
|
"reflect": true,
|
|
145
142
|
"defaultValue": "false"
|
|
146
|
-
},
|
|
147
|
-
"icon": {
|
|
148
|
-
"type": "any",
|
|
149
|
-
"mutable": false,
|
|
150
|
-
"complexType": {
|
|
151
|
-
"original": "any",
|
|
152
|
-
"resolved": "any",
|
|
153
|
-
"references": {}
|
|
154
|
-
},
|
|
155
|
-
"required": false,
|
|
156
|
-
"optional": false,
|
|
157
|
-
"docs": {
|
|
158
|
-
"tags": [],
|
|
159
|
-
"text": "Name of the material icon to add to the field"
|
|
160
|
-
},
|
|
161
|
-
"attribute": "icon",
|
|
162
|
-
"reflect": false
|
|
163
143
|
}
|
|
164
144
|
}; }
|
|
165
145
|
static get states() { return {
|
|
@@ -83,6 +83,19 @@ export class Grid {
|
|
|
83
83
|
if (this.selectedItems) {
|
|
84
84
|
this.updateSelectionWithValues(this.selectedItems);
|
|
85
85
|
}
|
|
86
|
+
this.applyInitialSortConfig();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Handle existing column's filters (defined before the grid is instantiated)
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
applyInitialSortConfig() {
|
|
93
|
+
const [first, ...other] = this.columns.filter(c => c.sortOrder !== 'none');
|
|
94
|
+
// We keep only one active sorted column
|
|
95
|
+
other === null || other === void 0 ? void 0 : other.forEach(o => o.sortOrder = 'none');
|
|
96
|
+
if (first && !this.serverMode) {
|
|
97
|
+
this.sortBy(first);
|
|
98
|
+
}
|
|
86
99
|
}
|
|
87
100
|
getGridColumnsFromTemplate() {
|
|
88
101
|
const slotted = this.el.shadowRoot.querySelector('slot[name="grid-column"]');
|
|
@@ -93,22 +106,32 @@ export class Grid {
|
|
|
93
106
|
return slotted.assignedElements();
|
|
94
107
|
}
|
|
95
108
|
sortChangeEventHandler(event) {
|
|
109
|
+
if (event.detail.order === 'none')
|
|
110
|
+
return;
|
|
96
111
|
// We keep only one active sort column
|
|
97
112
|
this.columns.filter(c => c !== event.detail.column).forEach(c => c.sortOrder = 'none');
|
|
98
113
|
if (this.serverMode)
|
|
99
114
|
return;
|
|
100
|
-
|
|
115
|
+
this.sortBy(event.detail.column);
|
|
116
|
+
this.updatePageIndex();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Sorts the grid rows according to the given column's configuration
|
|
120
|
+
* @param colmun Column from which to extract the sorting configuration
|
|
121
|
+
* @private
|
|
122
|
+
*/
|
|
123
|
+
sortBy(colmun) {
|
|
124
|
+
if (colmun.sortFn) {
|
|
101
125
|
this.rows = _.cloneDeep(this.rows)
|
|
102
|
-
.sort((a, b) =>
|
|
126
|
+
.sort((a, b) => colmun.sortFn(a.data, b.data, colmun) * getSortOrderInteger(colmun.sortOrder));
|
|
103
127
|
}
|
|
104
128
|
else {
|
|
105
129
|
this.rows = _.cloneDeep(this.rows)
|
|
106
130
|
.sort((a, b) => {
|
|
107
|
-
const path =
|
|
108
|
-
return ((_.get(a.data, path) < _.get(b.data, path)) ? -1 : (_.get(a.data, path) > _.get(b.data, path)) ? 1 : 0) * getSortOrderInteger(
|
|
131
|
+
const path = colmun.path;
|
|
132
|
+
return ((_.get(a.data, path) < _.get(b.data, path)) ? -1 : (_.get(a.data, path) > _.get(b.data, path)) ? 1 : 0) * getSortOrderInteger(colmun.sortOrder);
|
|
109
133
|
});
|
|
110
134
|
}
|
|
111
|
-
this.updatePageIndex();
|
|
112
135
|
}
|
|
113
136
|
/**
|
|
114
137
|
* Update the page's number of all rows
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Event, h, Host, Prop,
|
|
1
|
+
import { Component, Element, Event, h, Host, Prop, Watch } from '@stencil/core';
|
|
2
2
|
import { GridSortArrow } from './grid-sort-arrow';
|
|
3
3
|
export class GridColumn {
|
|
4
4
|
constructor() {
|
|
@@ -10,6 +10,9 @@ export class GridColumn {
|
|
|
10
10
|
parseMyObjectProp(newValue) {
|
|
11
11
|
this.wcsHiddenChange.emit(newValue);
|
|
12
12
|
}
|
|
13
|
+
sortOrderChange(_) {
|
|
14
|
+
this.emitSortConfig();
|
|
15
|
+
}
|
|
13
16
|
emitSortConfig() {
|
|
14
17
|
if (!this.sort)
|
|
15
18
|
return;
|
|
@@ -27,8 +30,8 @@ export class GridColumn {
|
|
|
27
30
|
this.sort ? h(GridSortArrow, { state: this.sortOrder }) : ''))));
|
|
28
31
|
}
|
|
29
32
|
onSortClick() {
|
|
33
|
+
// @Watch on sortOrder property will trigger wcsSortChange event
|
|
30
34
|
this.sortOrder = this.sortOrder === 'none' || this.sortOrder === 'desc' ? 'asc' : 'desc';
|
|
31
|
-
this.emitSortConfig();
|
|
32
35
|
}
|
|
33
36
|
static get is() { return "wcs-grid-column"; }
|
|
34
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -151,7 +154,7 @@ export class GridColumn {
|
|
|
151
154
|
"text": ""
|
|
152
155
|
},
|
|
153
156
|
"attribute": "sort-order",
|
|
154
|
-
"reflect":
|
|
157
|
+
"reflect": false,
|
|
155
158
|
"defaultValue": "'none'"
|
|
156
159
|
},
|
|
157
160
|
"width": {
|
|
@@ -248,5 +251,8 @@ export class GridColumn {
|
|
|
248
251
|
static get watchers() { return [{
|
|
249
252
|
"propName": "hidden",
|
|
250
253
|
"methodName": "parseMyObjectProp"
|
|
254
|
+
}, {
|
|
255
|
+
"propName": "sortOrder",
|
|
256
|
+
"methodName": "sortOrderChange"
|
|
251
257
|
}]; }
|
|
252
258
|
}
|
|
@@ -133,9 +133,14 @@ export class HorizontalStepper {
|
|
|
133
133
|
"type": "string",
|
|
134
134
|
"mutable": false,
|
|
135
135
|
"complexType": {
|
|
136
|
-
"original": "
|
|
136
|
+
"original": "HorizontalStepperMode",
|
|
137
137
|
"resolved": "\"linear\" | \"nonLinear\"",
|
|
138
|
-
"references": {
|
|
138
|
+
"references": {
|
|
139
|
+
"HorizontalStepperMode": {
|
|
140
|
+
"location": "import",
|
|
141
|
+
"path": "./horizontal-stepper-interface"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
139
144
|
},
|
|
140
145
|
"required": false,
|
|
141
146
|
"optional": false,
|
|
@@ -37,14 +37,62 @@
|
|
|
37
37
|
margin-left: 8px;
|
|
38
38
|
margin-right: -8px;
|
|
39
39
|
}
|
|
40
|
+
:host .prefix, :host .suffix {
|
|
41
|
+
color: var(--wcs-white);
|
|
42
|
+
display: flex;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
align-items: center;
|
|
45
|
+
padding: 0 calc(var(--wcs-padding) / 2);
|
|
46
|
+
font-weight: var(--wcs-font-weight-form-value) !important;
|
|
47
|
+
background-color: var(--wcs-text-disabled);
|
|
48
|
+
}
|
|
49
|
+
:host .prefix {
|
|
50
|
+
border-radius: var(--wcs-internal-input-border-radius-left) 0 0 var(--wcs-internal-input-border-radius-left);
|
|
51
|
+
margin: -1px 0 -1px -1px;
|
|
52
|
+
border-left: solid 1px transparent;
|
|
53
|
+
border-top: solid 1px transparent;
|
|
54
|
+
border-bottom: solid 1px transparent;
|
|
55
|
+
}
|
|
56
|
+
:host .suffix {
|
|
57
|
+
border-radius: 0 var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) 0;
|
|
58
|
+
margin: -1px -1px -1px 0px;
|
|
59
|
+
border-right: solid 1px transparent;
|
|
60
|
+
border-top: solid 1px transparent;
|
|
61
|
+
border-bottom: solid 1px transparent;
|
|
62
|
+
}
|
|
40
63
|
|
|
41
64
|
:host([state=error]) {
|
|
42
65
|
border-color: var(--wcs-red) !important;
|
|
43
66
|
}
|
|
44
67
|
|
|
68
|
+
:host([data-has-prefix]) input {
|
|
69
|
+
padding-left: calc(var(--wcs-padding) / 2);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([data-has-suffix]) input {
|
|
73
|
+
padding-left: calc(var(--wcs-padding) / 2);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([disabled]) input {
|
|
77
|
+
color: var(--wcs-text-disabled);
|
|
78
|
+
}
|
|
79
|
+
:host([disabled]) .prefix, :host([disabled]) .suffix {
|
|
80
|
+
color: var(--wcs-light);
|
|
81
|
+
}
|
|
82
|
+
|
|
45
83
|
:host(:focus-within) {
|
|
46
84
|
border: solid 1px var(--wcs-primary);
|
|
47
85
|
}
|
|
86
|
+
:host(:focus-within) .prefix {
|
|
87
|
+
border-left: solid 1px var(--wcs-primary);
|
|
88
|
+
border-top: solid 1px var(--wcs-primary);
|
|
89
|
+
border-bottom: solid 1px var(--wcs-primary);
|
|
90
|
+
}
|
|
91
|
+
:host(:focus-within) .suffix {
|
|
92
|
+
border-right: solid 1px var(--wcs-primary);
|
|
93
|
+
border-top: solid 1px var(--wcs-primary);
|
|
94
|
+
border-bottom: solid 1px var(--wcs-primary);
|
|
95
|
+
}
|
|
48
96
|
:host(:focus-within) wcs-mat-icon {
|
|
49
97
|
color: var(--wcs-primary);
|
|
50
98
|
}
|
|
@@ -205,9 +205,11 @@ export class Input {
|
|
|
205
205
|
if (label) {
|
|
206
206
|
label.id = labelId;
|
|
207
207
|
}
|
|
208
|
-
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null },
|
|
208
|
+
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null, "data-has-prefix": !!this.prefixLabel, "data-has-suffix": !!this.suffixLabel },
|
|
209
|
+
this.prefixLabel ? (h("span", { class: "prefix" }, this.prefixLabel)) : null,
|
|
209
210
|
this.icon ? (h("wcs-mat-icon", { icon: this.icon, size: "m" })) : null,
|
|
210
|
-
h("input", Object.assign({ class: "native-input", ref: input => this.nativeInput = input, "aria-labelledby": label ? labelId : null, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown }, this.inheritedAttributes))
|
|
211
|
+
h("input", Object.assign({ class: "native-input", ref: input => this.nativeInput = input, "aria-labelledby": label ? labelId : null, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown }, this.inheritedAttributes)),
|
|
212
|
+
this.suffixLabel ? (h("span", { class: "suffix" }, this.suffixLabel)) : null));
|
|
211
213
|
}
|
|
212
214
|
static get is() { return "wcs-input"; }
|
|
213
215
|
static get encapsulation() { return "shadow"; }
|
|
@@ -386,6 +388,40 @@ export class Input {
|
|
|
386
388
|
"reflect": false,
|
|
387
389
|
"defaultValue": "0"
|
|
388
390
|
},
|
|
391
|
+
"prefixLabel": {
|
|
392
|
+
"type": "string",
|
|
393
|
+
"mutable": false,
|
|
394
|
+
"complexType": {
|
|
395
|
+
"original": "string",
|
|
396
|
+
"resolved": "string",
|
|
397
|
+
"references": {}
|
|
398
|
+
},
|
|
399
|
+
"required": false,
|
|
400
|
+
"optional": false,
|
|
401
|
+
"docs": {
|
|
402
|
+
"tags": [],
|
|
403
|
+
"text": "Prefix displayed before the text field contents. This is not included in the value."
|
|
404
|
+
},
|
|
405
|
+
"attribute": "prefix-label",
|
|
406
|
+
"reflect": false
|
|
407
|
+
},
|
|
408
|
+
"suffixLabel": {
|
|
409
|
+
"type": "string",
|
|
410
|
+
"mutable": false,
|
|
411
|
+
"complexType": {
|
|
412
|
+
"original": "string",
|
|
413
|
+
"resolved": "string",
|
|
414
|
+
"references": {}
|
|
415
|
+
},
|
|
416
|
+
"required": false,
|
|
417
|
+
"optional": false,
|
|
418
|
+
"docs": {
|
|
419
|
+
"tags": [],
|
|
420
|
+
"text": "Suffix displayed after the text field contents. This is not included in the value."
|
|
421
|
+
},
|
|
422
|
+
"attribute": "suffix-label",
|
|
423
|
+
"reflect": false
|
|
424
|
+
},
|
|
389
425
|
"disabled": {
|
|
390
426
|
"type": "boolean",
|
|
391
427
|
"mutable": false,
|
|
@@ -88,9 +88,14 @@ export class MatIcon {
|
|
|
88
88
|
"type": "string",
|
|
89
89
|
"mutable": false,
|
|
90
90
|
"complexType": {
|
|
91
|
-
"original": "
|
|
91
|
+
"original": "MaterialIconSize",
|
|
92
92
|
"resolved": "\"l\" | \"m\" | \"s\" | \"xl\"",
|
|
93
|
-
"references": {
|
|
93
|
+
"references": {
|
|
94
|
+
"MaterialIconSize": {
|
|
95
|
+
"location": "import",
|
|
96
|
+
"path": "./mat-icon-interface"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
94
99
|
},
|
|
95
100
|
"required": false,
|
|
96
101
|
"optional": false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,7 +20,14 @@ wcs-modal[show] {
|
|
|
20
20
|
/**
|
|
21
21
|
Backdrop
|
|
22
22
|
*/
|
|
23
|
-
wcs-modal[backdrop] .wcs-modal-backdrop {
|
|
23
|
+
wcs-modal[without-backdrop] .wcs-modal-backdrop {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
wcs-modal[without-backdrop] .wcs-modal-container {
|
|
27
|
+
border: solid 1px var(--wcs-text-light);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.wcs-modal-backdrop {
|
|
24
31
|
display: block;
|
|
25
32
|
position: fixed;
|
|
26
33
|
top: 0;
|
|
@@ -31,10 +38,6 @@ wcs-modal[backdrop] .wcs-modal-backdrop {
|
|
|
31
38
|
background-color: var(--wcs-black);
|
|
32
39
|
}
|
|
33
40
|
|
|
34
|
-
.wcs-modal-backdrop {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
41
|
/**
|
|
39
42
|
Modal window
|
|
40
43
|
*/
|
|
@@ -42,8 +45,8 @@ Modal window
|
|
|
42
45
|
position: fixed;
|
|
43
46
|
top: 50%;
|
|
44
47
|
left: 50%;
|
|
45
|
-
|
|
46
|
-
max-width:
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
max-width: 100%;
|
|
47
50
|
/* bring your own prefixes */
|
|
48
51
|
transform: translate(-50%, -50%);
|
|
49
52
|
pointer-events: auto;
|
|
@@ -57,6 +60,22 @@ Modal window
|
|
|
57
60
|
padding: 1.375rem 1.875rem 1.875rem 1.875rem;
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
.wcs-modal-container[data-size=s] {
|
|
64
|
+
width: 288px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.wcs-modal-container[data-size=m] {
|
|
68
|
+
width: 480px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.wcs-modal-container[data-size=l] {
|
|
72
|
+
width: 864px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.wcs-modal-container[data-size=xl] {
|
|
76
|
+
width: 1200px;
|
|
77
|
+
}
|
|
78
|
+
|
|
60
79
|
.wcs-modal-header {
|
|
61
80
|
margin-bottom: 8px;
|
|
62
81
|
display: flex;
|
|
@@ -4,7 +4,7 @@ export class Modal {
|
|
|
4
4
|
/**
|
|
5
5
|
* Specifies whether the component should display a backdrop on the entire page
|
|
6
6
|
*/
|
|
7
|
-
this.
|
|
7
|
+
this.withoutBackdrop = false;
|
|
8
8
|
/**
|
|
9
9
|
* Displays the modal
|
|
10
10
|
*/
|
|
@@ -14,15 +14,20 @@ export class Modal {
|
|
|
14
14
|
* if false, it won't close the modal when the escape key is pressed.
|
|
15
15
|
*/
|
|
16
16
|
this.showCloseButton = false;
|
|
17
|
+
/**
|
|
18
|
+
* There are multiple sizes for modals. The default size is medium (m), however other sizes are available. Select the
|
|
19
|
+
* size best suited for the content and screen size displaying the modal. Remember to test responsiveness.
|
|
20
|
+
*/
|
|
21
|
+
this.size = 'm';
|
|
17
22
|
}
|
|
18
23
|
render() {
|
|
19
24
|
return (h(Host, null,
|
|
20
25
|
h("div", { class: "wcs-modal-backdrop" }),
|
|
21
|
-
h("div", { class: "wcs-modal-container" },
|
|
26
|
+
h("div", { class: "wcs-modal-container", "data-size": this.size },
|
|
22
27
|
h("div", { class: "wcs-modal-header" },
|
|
23
28
|
h("h5", null,
|
|
24
29
|
h("slot", { name: "header" })),
|
|
25
|
-
this.showCloseButton && (h("wcs-button", { shape: "round", mode: "
|
|
30
|
+
this.showCloseButton && (h("wcs-button", { shape: "round", mode: "clear", class: "wcs-dark", onClick: ($event) => this.onCloseButtonClick($event) },
|
|
26
31
|
h("i", { class: "material-icons" }, "close")))),
|
|
27
32
|
h("div", { class: "wcs-modal-content" },
|
|
28
33
|
h("slot", null)),
|
|
@@ -49,7 +54,7 @@ export class Modal {
|
|
|
49
54
|
"$": ["modal.css"]
|
|
50
55
|
}; }
|
|
51
56
|
static get properties() { return {
|
|
52
|
-
"
|
|
57
|
+
"withoutBackdrop": {
|
|
53
58
|
"type": "boolean",
|
|
54
59
|
"mutable": false,
|
|
55
60
|
"complexType": {
|
|
@@ -63,13 +68,13 @@ export class Modal {
|
|
|
63
68
|
"tags": [],
|
|
64
69
|
"text": "Specifies whether the component should display a backdrop on the entire page"
|
|
65
70
|
},
|
|
66
|
-
"attribute": "backdrop",
|
|
71
|
+
"attribute": "without-backdrop",
|
|
67
72
|
"reflect": true,
|
|
68
|
-
"defaultValue": "
|
|
73
|
+
"defaultValue": "false"
|
|
69
74
|
},
|
|
70
75
|
"show": {
|
|
71
76
|
"type": "boolean",
|
|
72
|
-
"mutable":
|
|
77
|
+
"mutable": false,
|
|
73
78
|
"complexType": {
|
|
74
79
|
"original": "boolean",
|
|
75
80
|
"resolved": "boolean",
|
|
@@ -102,6 +107,29 @@ export class Modal {
|
|
|
102
107
|
"attribute": "show-close-button",
|
|
103
108
|
"reflect": true,
|
|
104
109
|
"defaultValue": "false"
|
|
110
|
+
},
|
|
111
|
+
"size": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": false,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "ModalSize",
|
|
116
|
+
"resolved": "\"l\" | \"m\" | \"s\" | \"xl\"",
|
|
117
|
+
"references": {
|
|
118
|
+
"ModalSize": {
|
|
119
|
+
"location": "import",
|
|
120
|
+
"path": "./modal-interface"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "There are multiple sizes for modals. The default size is medium (m), however other sizes are available. Select the\nsize best suited for the content and screen size displaying the modal. Remember to test responsiveness."
|
|
129
|
+
},
|
|
130
|
+
"attribute": "size",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "'m'"
|
|
105
133
|
}
|
|
106
134
|
}; }
|
|
107
135
|
static get events() { return [{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
2
2
|
/**
|
|
3
3
|
* Component displaying progress as a bar.
|
|
4
4
|
*/
|
|
@@ -50,7 +50,7 @@ export class ProgressBar {
|
|
|
50
50
|
static get properties() { return {
|
|
51
51
|
"small": {
|
|
52
52
|
"type": "boolean",
|
|
53
|
-
"mutable":
|
|
53
|
+
"mutable": false,
|
|
54
54
|
"complexType": {
|
|
55
55
|
"original": "boolean",
|
|
56
56
|
"resolved": "boolean",
|
|
@@ -68,7 +68,7 @@ export class ProgressBar {
|
|
|
68
68
|
},
|
|
69
69
|
"showLabel": {
|
|
70
70
|
"type": "boolean",
|
|
71
|
-
"mutable":
|
|
71
|
+
"mutable": false,
|
|
72
72
|
"complexType": {
|
|
73
73
|
"original": "boolean",
|
|
74
74
|
"resolved": "boolean",
|
|
@@ -86,7 +86,7 @@ export class ProgressBar {
|
|
|
86
86
|
},
|
|
87
87
|
"value": {
|
|
88
88
|
"type": "number",
|
|
89
|
-
"mutable":
|
|
89
|
+
"mutable": false,
|
|
90
90
|
"complexType": {
|
|
91
91
|
"original": "number",
|
|
92
92
|
"resolved": "number",
|
|
@@ -31,7 +31,7 @@ export class Radio {
|
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
33
|
return (h(Host, { slot: "option" },
|
|
34
|
-
h("input", { id: this.inputId, type: "radio", value: this.value, checked: this.checked, "aria-disabled": this.disabled ? 'true' : null, "aria-checked": `${this.checked}` }),
|
|
34
|
+
h("input", { id: this.inputId, type: "radio", value: this.value, checked: this.checked, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null, "aria-checked": `${this.checked}` }),
|
|
35
35
|
h("label", { htmlFor: `${this.inputId}` }, this.label)));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "wcs-radio"; }
|
|
@@ -47,9 +47,14 @@ export class Radio {
|
|
|
47
47
|
"type": "string",
|
|
48
48
|
"mutable": false,
|
|
49
49
|
"complexType": {
|
|
50
|
-
"original": "
|
|
51
|
-
"resolved": "\"option\" | \"radio\"",
|
|
52
|
-
"references": {
|
|
50
|
+
"original": "RadioGroupMode",
|
|
51
|
+
"resolved": "\"horizontal\" | \"option\" | \"radio\"",
|
|
52
|
+
"references": {
|
|
53
|
+
"RadioGroupMode": {
|
|
54
|
+
"location": "import",
|
|
55
|
+
"path": "../radio-group/radio-group-interface"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
53
58
|
},
|
|
54
59
|
"required": false,
|
|
55
60
|
"optional": false,
|
|
@@ -1,32 +1,27 @@
|
|
|
1
|
-
:host([mode=radio]) input
|
|
1
|
+
:host([mode=radio]) input,
|
|
2
|
+
:host([mode=horizontal]) input {
|
|
2
3
|
display: none;
|
|
3
4
|
}
|
|
4
|
-
:host([mode=radio]) label
|
|
5
|
-
|
|
5
|
+
:host([mode=radio]) label,
|
|
6
|
+
:host([mode=horizontal]) label {
|
|
6
7
|
margin-bottom: 0;
|
|
7
8
|
color: var(--wcs-text-medium);
|
|
8
|
-
cursor: pointer;
|
|
9
9
|
background-color: transparent;
|
|
10
|
-
border: none;
|
|
11
10
|
font-weight: 500 !important;
|
|
12
|
-
transition: 0.175s ease-in-out;
|
|
13
11
|
}
|
|
14
|
-
:host([mode=radio]) label:before
|
|
15
|
-
|
|
12
|
+
:host([mode=radio]) label:before,
|
|
13
|
+
:host([mode=horizontal]) label:before {
|
|
16
14
|
border-radius: 50%;
|
|
17
|
-
margin-right: var(--wcs-base-margin);
|
|
18
15
|
border: 2px solid var(--wcs-text-disabled);
|
|
19
16
|
position: relative;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
top: 3px;
|
|
22
17
|
width: 1.125rem;
|
|
23
18
|
height: 1.125rem;
|
|
24
19
|
pointer-events: none;
|
|
25
20
|
content: "";
|
|
26
21
|
background-color: var(--wcs-white);
|
|
27
|
-
box-sizing: border-box;
|
|
28
22
|
}
|
|
29
|
-
:host([mode=radio]) label:after
|
|
23
|
+
:host([mode=radio]) label:after,
|
|
24
|
+
:host([mode=horizontal]) label:after {
|
|
30
25
|
transition: 0.175s ease-in-out;
|
|
31
26
|
position: relative;
|
|
32
27
|
width: 1.125rem;
|
|
@@ -35,21 +30,52 @@
|
|
|
35
30
|
background: no-repeat 50%/50% 50%;
|
|
36
31
|
}
|
|
37
32
|
|
|
38
|
-
:host([
|
|
33
|
+
:host([disabled]) label {
|
|
34
|
+
color: var(--wcs-text-disabled);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host(:not([disabled])) label {
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([mode=radio][checked]) label,
|
|
42
|
+
:host([mode=horizontal][checked]) label {
|
|
39
43
|
color: var(--wcs-primary);
|
|
40
44
|
}
|
|
41
|
-
:host([mode=radio][checked]) label:before
|
|
45
|
+
:host([mode=radio][checked]) label:before,
|
|
46
|
+
:host([mode=horizontal][checked]) label:before {
|
|
42
47
|
border-color: var(--wcs-primary);
|
|
43
48
|
background-color: var(--wcs-primary);
|
|
44
49
|
}
|
|
45
50
|
|
|
46
|
-
:host([mode=radio]:hover) label
|
|
51
|
+
:host([mode=radio]:hover):not([disabled]) label,
|
|
52
|
+
:host([mode=horizontal]:hover):not([disabled]) label {
|
|
47
53
|
color: var(--wcs-primary);
|
|
48
54
|
}
|
|
49
|
-
:host([mode=radio]:hover) label:before
|
|
55
|
+
:host([mode=radio]:hover):not([disabled]) label:before,
|
|
56
|
+
:host([mode=horizontal]:hover):not([disabled]) label:before {
|
|
50
57
|
border-color: var(--wcs-primary);
|
|
51
58
|
}
|
|
52
59
|
|
|
60
|
+
:host([mode=radio]) label {
|
|
61
|
+
padding: 0.125rem 0 0;
|
|
62
|
+
border: none;
|
|
63
|
+
transition: 0.175s ease-in-out;
|
|
64
|
+
}
|
|
65
|
+
:host([mode=radio]) label:before {
|
|
66
|
+
transition: 0.175s ease-in-out;
|
|
67
|
+
margin-right: var(--wcs-base-margin);
|
|
68
|
+
display: inline-block;
|
|
69
|
+
top: 3px;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([mode=horizontal]) label:before {
|
|
74
|
+
transition: background-color 0.175s ease-in-out;
|
|
75
|
+
margin: auto auto var(--wcs-base-margin);
|
|
76
|
+
display: block;
|
|
77
|
+
}
|
|
78
|
+
|
|
53
79
|
:host([mode=option]) {
|
|
54
80
|
padding: var(--wcs-base-margin) calc(var(--wcs-base-margin) / 2);
|
|
55
81
|
font-weight: 500 !important;
|
|
@@ -62,11 +88,10 @@
|
|
|
62
88
|
padding: 0;
|
|
63
89
|
}
|
|
64
90
|
:host([mode=option]) label {
|
|
65
|
-
padding:
|
|
91
|
+
padding: 5px calc(2 * var(--wcs-base-margin));
|
|
66
92
|
margin-bottom: 0;
|
|
67
93
|
color: var(--wcs-white);
|
|
68
94
|
white-space: nowrap;
|
|
69
|
-
cursor: pointer;
|
|
70
95
|
border-radius: 0.4375rem;
|
|
71
96
|
}
|
|
72
97
|
|
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
:host([mode=option]) {
|
|
20
20
|
display: inline-flex;
|
|
21
21
|
flex-direction: row;
|
|
22
|
-
padding: calc(var(--wcs-base-margin) /
|
|
22
|
+
padding: calc(var(--wcs-base-margin) / 4);
|
|
23
23
|
background-color: #4d4f53;
|
|
24
24
|
border-radius: 0.6875rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([mode=horizontal]) {
|
|
28
|
+
justify-content: space-between;
|
|
25
29
|
}
|