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
|
@@ -43,6 +43,9 @@ let GridColumn = class {
|
|
|
43
43
|
parseMyObjectProp(newValue) {
|
|
44
44
|
this.wcsHiddenChange.emit(newValue);
|
|
45
45
|
}
|
|
46
|
+
sortOrderChange(_) {
|
|
47
|
+
this.emitSortConfig();
|
|
48
|
+
}
|
|
46
49
|
emitSortConfig() {
|
|
47
50
|
if (!this.sort)
|
|
48
51
|
return;
|
|
@@ -56,12 +59,13 @@ let GridColumn = class {
|
|
|
56
59
|
return (h(Host, { onClick: this.onSortClick.bind(this), slot: "grid-column" }, h("th", { style: { width: this.width }, class: this.sort ? 'pointer' : '' }, h("div", { class: "grid-column-th-content" }, h("span", null, this.name), this.sort ? h(GridSortArrow, { state: this.sortOrder }) : ''))));
|
|
57
60
|
}
|
|
58
61
|
onSortClick() {
|
|
62
|
+
// @Watch on sortOrder property will trigger wcsSortChange event
|
|
59
63
|
this.sortOrder = this.sortOrder === 'none' || this.sortOrder === 'desc' ? 'asc' : 'desc';
|
|
60
|
-
this.emitSortConfig();
|
|
61
64
|
}
|
|
62
65
|
get el() { return getElement(this); }
|
|
63
66
|
static get watchers() { return {
|
|
64
|
-
"hidden": ["parseMyObjectProp"]
|
|
67
|
+
"hidden": ["parseMyObjectProp"],
|
|
68
|
+
"sortOrder": ["sortOrderChange"]
|
|
65
69
|
}; }
|
|
66
70
|
};
|
|
67
71
|
GridColumn.style = gridColumnCss;
|
|
@@ -170,6 +170,19 @@ let Grid = class {
|
|
|
170
170
|
if (this.selectedItems) {
|
|
171
171
|
this.updateSelectionWithValues(this.selectedItems);
|
|
172
172
|
}
|
|
173
|
+
this.applyInitialSortConfig();
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Handle existing column's filters (defined before the grid is instantiated)
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
applyInitialSortConfig() {
|
|
180
|
+
const [first, ...other] = this.columns.filter(c => c.sortOrder !== 'none');
|
|
181
|
+
// We keep only one active sorted column
|
|
182
|
+
other === null || other === void 0 ? void 0 : other.forEach(o => o.sortOrder = 'none');
|
|
183
|
+
if (first && !this.serverMode) {
|
|
184
|
+
this.sortBy(first);
|
|
185
|
+
}
|
|
173
186
|
}
|
|
174
187
|
getGridColumnsFromTemplate() {
|
|
175
188
|
const slotted = this.el.shadowRoot.querySelector('slot[name="grid-column"]');
|
|
@@ -180,22 +193,32 @@ let Grid = class {
|
|
|
180
193
|
return slotted.assignedElements();
|
|
181
194
|
}
|
|
182
195
|
sortChangeEventHandler(event) {
|
|
196
|
+
if (event.detail.order === 'none')
|
|
197
|
+
return;
|
|
183
198
|
// We keep only one active sort column
|
|
184
199
|
this.columns.filter(c => c !== event.detail.column).forEach(c => c.sortOrder = 'none');
|
|
185
200
|
if (this.serverMode)
|
|
186
201
|
return;
|
|
187
|
-
|
|
202
|
+
this.sortBy(event.detail.column);
|
|
203
|
+
this.updatePageIndex();
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Sorts the grid rows according to the given column's configuration
|
|
207
|
+
* @param colmun Column from which to extract the sorting configuration
|
|
208
|
+
* @private
|
|
209
|
+
*/
|
|
210
|
+
sortBy(colmun) {
|
|
211
|
+
if (colmun.sortFn) {
|
|
188
212
|
this.rows = lodash.cloneDeep(this.rows)
|
|
189
|
-
.sort((a, b) =>
|
|
213
|
+
.sort((a, b) => colmun.sortFn(a.data, b.data, colmun) * getSortOrderInteger(colmun.sortOrder));
|
|
190
214
|
}
|
|
191
215
|
else {
|
|
192
216
|
this.rows = lodash.cloneDeep(this.rows)
|
|
193
217
|
.sort((a, b) => {
|
|
194
|
-
const path =
|
|
195
|
-
return ((lodash.get(a.data, path) < lodash.get(b.data, path)) ? -1 : (lodash.get(a.data, path) > lodash.get(b.data, path)) ? 1 : 0) * getSortOrderInteger(
|
|
218
|
+
const path = colmun.path;
|
|
219
|
+
return ((lodash.get(a.data, path) < lodash.get(b.data, path)) ? -1 : (lodash.get(a.data, path) > lodash.get(b.data, path)) ? 1 : 0) * getSortOrderInteger(colmun.sortOrder);
|
|
196
220
|
});
|
|
197
221
|
}
|
|
198
|
-
this.updatePageIndex();
|
|
199
222
|
}
|
|
200
223
|
/**
|
|
201
224
|
* Update the page's number of all rows
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-b982604a.js';
|
|
2
|
-
import { d as debounceEvent, i as inheritAttributes, f as findItemLabel } from './helpers-
|
|
2
|
+
import { d as debounceEvent, i as inheritAttributes, f as findItemLabel } from './helpers-e2993152.js';
|
|
3
3
|
|
|
4
|
-
const inputCss = ":host{--wcs-input-icon-color:var(--wcs-text-medium);--wcs-internal-input-border-radius-left:var(--wcs-input-border-radius-left, var(--wcs-border-radius));--wcs-internal-input-border-radius-right:var(--wcs-input-border-radius-right, var(--wcs-border-radius));display:flex;width:100%;border-radius:var(--wcs-internal-input-border-radius-left) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-left);background-color:var(--wcs-light);border:1px solid var(--wcs-light);background-clip:padding-box}:host ::placeholder{font-weight:400;font-style:italic}:host input{overflow:hidden;box-sizing:border-box;min-height:24px;width:100%;background-color:transparent;font-family:var(--wcs-font-sans-serif);color:var(--wcs-primary);font-weight:var(--wcs-font-weight-form-value) !important;border:none;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);font-size:1rem;line-height:1.5}:host input:focus{box-shadow:none;outline:0}:host wcs-mat-icon{position:relative;margin-top:8px;margin-left:8px;margin-right:-8px}:host([state=error]){border-color:var(--wcs-red) !important}:host(:focus-within){border:solid 1px var(--wcs-primary)}:host(:focus-within) wcs-mat-icon{color:var(--wcs-primary)}";
|
|
4
|
+
const inputCss = ":host{--wcs-input-icon-color:var(--wcs-text-medium);--wcs-internal-input-border-radius-left:var(--wcs-input-border-radius-left, var(--wcs-border-radius));--wcs-internal-input-border-radius-right:var(--wcs-input-border-radius-right, var(--wcs-border-radius));display:flex;width:100%;border-radius:var(--wcs-internal-input-border-radius-left) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-left);background-color:var(--wcs-light);border:1px solid var(--wcs-light);background-clip:padding-box}:host ::placeholder{font-weight:400;font-style:italic}:host input{overflow:hidden;box-sizing:border-box;min-height:24px;width:100%;background-color:transparent;font-family:var(--wcs-font-sans-serif);color:var(--wcs-primary);font-weight:var(--wcs-font-weight-form-value) !important;border:none;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);font-size:1rem;line-height:1.5}:host input:focus{box-shadow:none;outline:0}:host wcs-mat-icon{position:relative;margin-top:8px;margin-left:8px;margin-right:-8px}:host .prefix,:host .suffix{color:var(--wcs-white);display:flex;white-space:nowrap;align-items:center;padding:0 calc(var(--wcs-padding) / 2);font-weight:var(--wcs-font-weight-form-value) !important;background-color:var(--wcs-text-disabled)}:host .prefix{border-radius:var(--wcs-internal-input-border-radius-left) 0 0 var(--wcs-internal-input-border-radius-left);margin:-1px 0 -1px -1px;border-left:solid 1px transparent;border-top:solid 1px transparent;border-bottom:solid 1px transparent}:host .suffix{border-radius:0 var(--wcs-internal-input-border-radius-right) var(--wcs-internal-input-border-radius-right) 0;margin:-1px -1px -1px 0px;border-right:solid 1px transparent;border-top:solid 1px transparent;border-bottom:solid 1px transparent}:host([state=error]){border-color:var(--wcs-red) !important}:host([data-has-prefix]) input{padding-left:calc(var(--wcs-padding) / 2)}:host([data-has-suffix]) input{padding-left:calc(var(--wcs-padding) / 2)}:host([disabled]) input{color:var(--wcs-text-disabled)}:host([disabled]) .prefix,:host([disabled]) .suffix{color:var(--wcs-light)}:host(:focus-within){border:solid 1px var(--wcs-primary)}:host(:focus-within) .prefix{border-left:solid 1px var(--wcs-primary);border-top:solid 1px var(--wcs-primary);border-bottom:solid 1px var(--wcs-primary)}:host(:focus-within) .suffix{border-right:solid 1px var(--wcs-primary);border-top:solid 1px var(--wcs-primary);border-bottom:solid 1px var(--wcs-primary)}:host(:focus-within) wcs-mat-icon{color:var(--wcs-primary)}";
|
|
5
5
|
|
|
6
6
|
let Input = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -210,7 +210,7 @@ let Input = class {
|
|
|
210
210
|
if (label) {
|
|
211
211
|
label.id = labelId;
|
|
212
212
|
}
|
|
213
|
-
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null }, this.icon ? (h("wcs-mat-icon", { icon: this.icon, size: "m" })) : null, 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))));
|
|
213
|
+
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null, "data-has-prefix": !!this.prefixLabel, "data-has-suffix": !!this.suffixLabel }, this.prefixLabel ? (h("span", { class: "prefix" }, this.prefixLabel)) : null, this.icon ? (h("wcs-mat-icon", { icon: this.icon, size: "m" })) : null, 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)), this.suffixLabel ? (h("span", { class: "suffix" }, this.suffixLabel)) : null));
|
|
214
214
|
}
|
|
215
215
|
get el() { return getElement(this); }
|
|
216
216
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-b982604a.js';
|
|
2
2
|
|
|
3
|
-
const matIconCss = ":host{display:
|
|
3
|
+
const matIconCss = ":host{display:inline-block}:host .size-s{font-size:18px}:host .size-m{font-size:24px}:host .size-l{font-size:36px}:host .size-xl{font-size:48px}";
|
|
4
4
|
|
|
5
5
|
let MatIcon = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-b982604a.js';
|
|
2
2
|
|
|
3
|
-
const modalCss = "wcs-modal{--saas-fix-modal:rgba(var(--wcs-black), 0.5);z-index:999;position:fixed;top:0;bottom:0;left:0;right:0;display:none}wcs-modal[show]{display:block;width:100%;height:100%;opacity:1;display:block}wcs-modal[backdrop] .wcs-modal-backdrop{display:block;position:fixed;top:0;left:0;bottom:0;right:0;opacity:0.4;background-color:var(--wcs-black)}.wcs-modal-
|
|
3
|
+
const modalCss = "wcs-modal{--saas-fix-modal:rgba(var(--wcs-black), 0.5);z-index:999;position:fixed;top:0;bottom:0;left:0;right:0;display:none}wcs-modal[show]{display:block;width:100%;height:100%;opacity:1;display:block}wcs-modal[without-backdrop] .wcs-modal-backdrop{display:none}wcs-modal[without-backdrop] .wcs-modal-container{border:solid 1px var(--wcs-text-light)}.wcs-modal-backdrop{display:block;position:fixed;top:0;left:0;bottom:0;right:0;opacity:0.4;background-color:var(--wcs-black)}.wcs-modal-container{position:fixed;top:50%;left:50%;box-sizing:border-box;max-width:100%;transform:translate(-50%, -50%);pointer-events:auto;background-color:#fff;background-clip:padding-box;border:0 solid rgba(0, 0, 0, 0.2);border-radius:0.4375rem;outline:0;z-index:20000;display:block;padding:1.375rem 1.875rem 1.875rem 1.875rem}.wcs-modal-container[data-size=s]{width:288px}.wcs-modal-container[data-size=m]{width:480px}.wcs-modal-container[data-size=l]{width:864px}.wcs-modal-container[data-size=xl]{width:1200px}.wcs-modal-header{margin-bottom:8px;display:flex;align-items:center;justify-content:space-between}.wcs-modal-header h5{font-size:24px;font-weight:400;margin:0}.wcs-modal-content{font-weight:400;font-size:16px}.wcs-modal-actions{margin-top:20px;float:right}";
|
|
4
4
|
|
|
5
5
|
let Modal = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -9,7 +9,7 @@ let Modal = class {
|
|
|
9
9
|
/**
|
|
10
10
|
* Specifies whether the component should display a backdrop on the entire page
|
|
11
11
|
*/
|
|
12
|
-
this.
|
|
12
|
+
this.withoutBackdrop = false;
|
|
13
13
|
/**
|
|
14
14
|
* Displays the modal
|
|
15
15
|
*/
|
|
@@ -19,9 +19,14 @@ let Modal = class {
|
|
|
19
19
|
* if false, it won't close the modal when the escape key is pressed.
|
|
20
20
|
*/
|
|
21
21
|
this.showCloseButton = false;
|
|
22
|
+
/**
|
|
23
|
+
* There are multiple sizes for modals. The default size is medium (m), however other sizes are available. Select the
|
|
24
|
+
* size best suited for the content and screen size displaying the modal. Remember to test responsiveness.
|
|
25
|
+
*/
|
|
26
|
+
this.size = 'm';
|
|
22
27
|
}
|
|
23
28
|
render() {
|
|
24
|
-
return (h(Host, null, h("div", { class: "wcs-modal-backdrop" }), h("div", { class: "wcs-modal-container" }, h("div", { class: "wcs-modal-header" }, h("h5", null, h("slot", { name: "header" })), this.showCloseButton && (h("wcs-button", { shape: "round", mode: "
|
|
29
|
+
return (h(Host, null, h("div", { class: "wcs-modal-backdrop" }), h("div", { class: "wcs-modal-container", "data-size": this.size }, h("div", { class: "wcs-modal-header" }, h("h5", null, h("slot", { name: "header" })), this.showCloseButton && (h("wcs-button", { shape: "round", mode: "clear", class: "wcs-dark", onClick: ($event) => this.onCloseButtonClick($event) }, h("i", { class: "material-icons" }, "close")))), h("div", { class: "wcs-modal-content" }, h("slot", null)), h("div", { class: "wcs-modal-actions" }, h("slot", { name: "actions" })))));
|
|
25
30
|
}
|
|
26
31
|
onKeyDown(event) {
|
|
27
32
|
if (this.showCloseButton && event.key === 'Escape') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-b982604a.js';
|
|
2
2
|
|
|
3
|
-
const radioGroupCss = ":host{display:flex}:host([mode=radio]){flex-direction:column}:host([mode=radio]) ::slotted([slot=option]:first-child){margin-top:0}:host([mode=radio]) ::slotted([slot=option]:last-child){margin-bottom:0}:host([mode=radio]) ::slotted([slot=options]){margin-top:calc(var(--wcs-base-margin) / 2);margin-bottom:calc(var(--wcs-base-margin) / 2)}:host([mode=option]){display:inline-flex;flex-direction:row;padding:calc(var(--wcs-base-margin) /
|
|
3
|
+
const radioGroupCss = ":host{display:flex}:host([mode=radio]){flex-direction:column}:host([mode=radio]) ::slotted([slot=option]:first-child){margin-top:0}:host([mode=radio]) ::slotted([slot=option]:last-child){margin-bottom:0}:host([mode=radio]) ::slotted([slot=options]){margin-top:calc(var(--wcs-base-margin) / 2);margin-bottom:calc(var(--wcs-base-margin) / 2)}:host([mode=option]){display:inline-flex;flex-direction:row;padding:calc(var(--wcs-base-margin) / 4);background-color:#4d4f53;border-radius:0.6875rem}:host([mode=horizontal]){justify-content:space-between}";
|
|
4
4
|
|
|
5
5
|
let RadioGroup = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -15,9 +15,9 @@ let RadioGroup = class {
|
|
|
15
15
|
if (this.value) {
|
|
16
16
|
this.updateOptionsState(this.value, true);
|
|
17
17
|
}
|
|
18
|
-
if (this.mode === 'option') {
|
|
18
|
+
if (this.mode === 'option' || this.mode === 'horizontal') {
|
|
19
19
|
for (const option of this.options) {
|
|
20
|
-
option.mode =
|
|
20
|
+
option.mode = this.mode;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-b982604a.js';
|
|
2
2
|
|
|
3
|
-
const radioCss = ":host([mode=radio]) input{display:none}:host([mode=radio]) label{
|
|
3
|
+
const radioCss = ":host([mode=radio]) input,:host([mode=horizontal]) input{display:none}:host([mode=radio]) label,:host([mode=horizontal]) label{margin-bottom:0;color:var(--wcs-text-medium);background-color:transparent;font-weight:500 !important}:host([mode=radio]) label:before,:host([mode=horizontal]) label:before{border-radius:50%;border:2px solid var(--wcs-text-disabled);position:relative;width:1.125rem;height:1.125rem;pointer-events:none;content:\"\";background-color:var(--wcs-white)}:host([mode=radio]) label:after,:host([mode=horizontal]) label:after{transition:0.175s ease-in-out;position:relative;width:1.125rem;height:1.125rem;content:\"\";background:no-repeat 50%/50% 50%}:host([disabled]) label{color:var(--wcs-text-disabled)}:host(:not([disabled])) label{cursor:pointer}:host([mode=radio][checked]) label,:host([mode=horizontal][checked]) label{color:var(--wcs-primary)}:host([mode=radio][checked]) label:before,:host([mode=horizontal][checked]) label:before{border-color:var(--wcs-primary);background-color:var(--wcs-primary)}:host([mode=radio]:hover):not([disabled]) label,:host([mode=horizontal]:hover):not([disabled]) label{color:var(--wcs-primary)}:host([mode=radio]:hover):not([disabled]) label:before,:host([mode=horizontal]:hover):not([disabled]) label:before{border-color:var(--wcs-primary)}:host([mode=radio]) label{padding:0.125rem 0 0;border:none;transition:0.175s ease-in-out}:host([mode=radio]) label:before{transition:0.175s ease-in-out;margin-right:var(--wcs-base-margin);display:inline-block;top:3px;box-sizing:border-box}:host([mode=horizontal]) label:before{transition:background-color 0.175s ease-in-out;margin:auto auto var(--wcs-base-margin);display:block}:host([mode=option]){padding:var(--wcs-base-margin) calc(var(--wcs-base-margin) / 2);font-weight:500 !important}:host([mode=option]) input{position:absolute;z-index:-1;opacity:0;box-sizing:border-box;padding:0}:host([mode=option]) label{padding:5px calc(2 * var(--wcs-base-margin));margin-bottom:0;color:var(--wcs-white);white-space:nowrap;border-radius:0.4375rem}:host([mode=option][checked]) label{font-weight:500 !important;color:var(--wcs-primary);background-color:var(--wcs-white)}";
|
|
4
4
|
|
|
5
5
|
let Radio = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -35,7 +35,7 @@ let Radio = class {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h(Host, { slot: "option" }, h("input", { id: this.inputId, type: "radio", value: this.value, checked: this.checked, "aria-disabled": this.disabled ? 'true' : null, "aria-checked": `${this.checked}` }), h("label", { htmlFor: `${this.inputId}` }, this.label)));
|
|
38
|
+
return (h(Host, { slot: "option" }, 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}` }), h("label", { htmlFor: `${this.inputId}` }, this.label)));
|
|
39
39
|
}
|
|
40
40
|
get el() { return getElement(this); }
|
|
41
41
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-b982604a.js';
|
|
2
2
|
import { l as lodash } from './lodash-d6d9d079.js';
|
|
3
3
|
import { S as SelectArrow } from './select-arrow-73ac4016.js';
|
|
4
|
-
import {
|
|
4
|
+
import { b as isElement } from './helpers-e2993152.js';
|
|
5
5
|
import { M as MDCRipple } from './component-6b4d470f.js';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-b982604a.js';
|
|
2
2
|
|
|
3
|
-
const switchCss = ":host{--wcs-switch-background-color-initial:var(--wcs-text-light);--wcs-switch-background-color-final:var(--wcs-primary);--wcs-switch-bullet-color-initial:var(--wcs-switch-background-color-final);--wcs-switch-bullet-color-final:var(--wcs-switch-background-color-initial);display:flex}.wcs-container{position:relative;display:
|
|
3
|
+
const switchCss = ":host{--wcs-switch-background-color-initial:var(--wcs-text-light);--wcs-switch-background-color-final:var(--wcs-primary);--wcs-switch-bullet-color-initial:var(--wcs-switch-background-color-final);--wcs-switch-bullet-color-final:var(--wcs-switch-background-color-initial);--wcs-switch-text-color:var(--wcs-text-medium);display:flex}:host([disabled]){--wcs-switch-text-color:var(--wcs-text-disabled)}.wcs-container{position:relative;display:flex;margin-bottom:0}:host([label-alignment=top]) .wcs-container{align-items:start}:host([label-alignment=center]) .wcs-container{align-items:center}:host([label-alignment=bottom]) .wcs-container{align-items:flex-end}.wcs-container input{position:absolute;opacity:0;height:0;width:0}.text{color:var(--wcs-switch-text-color);margin-left:6px;font-weight:500;line-height:1.375}.wcs-container:not([aria-disabled]) input:checked~.text{--wcs-switch-text-color:var(--wcs-primary)}.wcs-checkmark::before{position:absolute;transition:all 0.15s ease-out}.wcs-checkmark::before{bottom:0.3125rem;left:0.3125rem;width:0.875rem;height:0.875rem;content:\"\";border-radius:50%;background-color:var(--wcs-switch-bullet-color-initial)}:host([disabled]:not([checked])) .wcs-checkmark::before{background-color:var(--wcs-text-disabled)}:host([disabled]:not([checked])) .wcs-checkmark{background-color:var(--wcs-light)}:host([disabled][checked]) .wcs-checkmark::before{background-color:var(--wcs-white)}:host([disabled][checked]) .wcs-checkmark{background-color:var(--wcs-text-disabled)}.wcs-checkmark{top:0;right:0;bottom:0;left:0;width:3rem;height:1.5rem;border-radius:0.75rem;background-color:var(--wcs-switch-background-color-initial)}.wcs-container:not([aria-disabled]){cursor:pointer}.wcs-container:hover:not([aria-disabled]){--wcs-switch-text-color:var(--wcs-primary)}input:not([disabled]):checked+.wcs-checkmark::before,.wcs-container:hover input:not([disabled])+.wcs-checkmark::before,.wcs-container:focus input:not([disabled])+.wcs-checkmark::before{background-color:var(--wcs-switch-bullet-color-final)}input:checked+.wcs-checkmark::before{transform:translateX(24px)}input:not([disabled]):checked+.wcs-checkmark,.wcs-container:hover input:not([disabled])+.wcs-checkmark,.wcs-container:focus input:not([disabled])+.wcs-checkmark{background-color:var(--wcs-switch-background-color-final)}";
|
|
4
4
|
|
|
5
5
|
let Switch = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -12,6 +12,14 @@ let Switch = class {
|
|
|
12
12
|
* If `true`, the switch is selected.
|
|
13
13
|
*/
|
|
14
14
|
this.checked = false;
|
|
15
|
+
/**
|
|
16
|
+
* Specifie the alignment of the switch with the label content
|
|
17
|
+
*/
|
|
18
|
+
this.labelAlignment = 'center';
|
|
19
|
+
/**
|
|
20
|
+
* Specify wether the switch is disabled or not.
|
|
21
|
+
*/
|
|
22
|
+
this.disabled = false;
|
|
15
23
|
}
|
|
16
24
|
toggleChange(_event) {
|
|
17
25
|
this.checked = !this.checked;
|
|
@@ -20,7 +28,7 @@ let Switch = class {
|
|
|
20
28
|
});
|
|
21
29
|
}
|
|
22
30
|
render() {
|
|
23
|
-
return (h(Host, null, h("label", { htmlFor: this.name, class: "wcs-container"
|
|
31
|
+
return (h(Host, null, h("label", { htmlFor: this.name, class: "wcs-container", "aria-disabled": this.disabled }, h("input", { onChange: (evt) => this.toggleChange(evt), checked: this.checked, class: "wcs-switch", type: "checkbox", name: this.name, disabled: this.disabled, id: this.name }), h("span", { class: "wcs-checkmark" }), h("span", { class: "text" }, h("slot", null)))));
|
|
24
32
|
}
|
|
25
33
|
get el() { return getElement(this); }
|
|
26
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, a as readTask, h, H as Host, g as getElement } from './index-b982604a.js';
|
|
2
|
-
import { d as debounceEvent, i as inheritAttributes, r as raf, f as findItemLabel } from './helpers-
|
|
2
|
+
import { d as debounceEvent, i as inheritAttributes, r as raf, f as findItemLabel } from './helpers-e2993152.js';
|
|
3
3
|
|
|
4
|
-
const textareaCss = ":host{--wcs-textarea-icon-color:var(--wcs-text-medium);--wcs-internal-textarea-border-radius-left:var(--wcs-textarea-border-radius-left, var(--wcs-border-radius));--wcs-internal-textarea-border-radius-right:var(--wcs-textarea-border-radius-right, var(--wcs-border-radius));display:flex;flex-direction:row;width:100%;border-radius:var(--wcs-internal-textarea-border-radius-left) var(--wcs-internal-textarea-border-radius-right) var(--wcs-internal-textarea-border-radius-right) var(--wcs-internal-textarea-border-radius-left);background-color:var(--wcs-light);border:1px solid var(--wcs-light);background-clip:padding-box}:host ::placeholder{font-weight:400;font-style:italic}:host textarea{overflow:auto;flex:1;width:100%;box-sizing:border-box;min-height:24px;background-color:transparent;font-family:var(--wcs-font-sans-serif);color:var(--wcs-primary);font-weight:var(--wcs-font-weight-form-value) !important;border:none;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);font-size:1rem;line-height:1.5}:host textarea:focus{box-shadow:none;outline:0}:host wcs-mat-icon{position:relative;margin-top:7px;margin-left:8px;margin-right:-8px}:host([state=error]){border-color:var(--wcs-red) !important}:host(:focus-within){border:solid 1px var(--wcs-primary)}:host(:focus-within) wcs-mat-icon{color:var(--wcs-primary)}";
|
|
4
|
+
const textareaCss = ":host{--wcs-textarea-icon-color:var(--wcs-text-medium);--wcs-internal-textarea-border-radius-left:var(--wcs-textarea-border-radius-left, var(--wcs-border-radius));--wcs-internal-textarea-border-radius-right:var(--wcs-textarea-border-radius-right, var(--wcs-border-radius));display:flex;flex-direction:row;width:100%;border-radius:var(--wcs-internal-textarea-border-radius-left) var(--wcs-internal-textarea-border-radius-right) var(--wcs-internal-textarea-border-radius-right) var(--wcs-internal-textarea-border-radius-left);background-color:var(--wcs-light);border:1px solid var(--wcs-light);background-clip:padding-box}:host ::placeholder{font-weight:400;font-style:italic}:host textarea{overflow:auto;flex:1;width:100%;box-sizing:border-box;min-height:24px;background-color:transparent;font-family:var(--wcs-font-sans-serif);color:var(--wcs-primary);font-weight:var(--wcs-font-weight-form-value) !important;border:none;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);font-size:1rem;line-height:1.5}:host textarea:focus{box-shadow:none;outline:0}:host wcs-mat-icon{position:relative;margin-top:7px;margin-left:8px;margin-right:-8px}:host([disabled]) textarea{color:var(--wcs-text-disabled)}:host([state=error]){border-color:var(--wcs-red) !important}:host(:focus-within){border:solid 1px var(--wcs-primary)}:host(:focus-within) wcs-mat-icon{color:var(--wcs-primary)}";
|
|
5
5
|
|
|
6
6
|
let Textarea = class {
|
|
7
7
|
constructor(hostRef) {
|