@cscfi/csc-ui 2.2.8 → 2.2.10
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/dist/cjs/c-autocomplete_34.cjs.entry.js +28 -16
- package/dist/cjs/c-autocomplete_34.cjs.entry.js.map +1 -1
- package/dist/cjs/c-slider.cjs.entry.js +2 -2
- package/dist/cjs/c-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/csc-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/c-input/c-input.js +5 -24
- package/dist/collection/components/c-input/c-input.js.map +1 -1
- package/dist/collection/components/c-select/c-select.js +18 -7
- package/dist/collection/components/c-select/c-select.js.map +1 -1
- package/dist/collection/components/c-slider/c-slider.js +3 -3
- package/dist/collection/components/c-slider/c-slider.js.map +1 -1
- package/dist/collection/components/c-text-field/c-text-field.js +8 -6
- package/dist/collection/components/c-text-field/c-text-field.js.map +1 -1
- package/dist/components/c-autocomplete.js +1 -1
- package/dist/components/c-input.js +1 -1
- package/dist/components/c-select.js +19 -8
- package/dist/components/c-select.js.map +1 -1
- package/dist/components/c-slider.js +3 -3
- package/dist/components/c-slider.js.map +1 -1
- package/dist/components/c-text-field.js +9 -7
- package/dist/components/c-text-field.js.map +1 -1
- package/dist/components/{p-aa75dd47.js → p-fc209a6c.js} +6 -8
- package/dist/components/p-fc209a6c.js.map +1 -0
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/csc-ui.esm.js.map +1 -1
- package/dist/csc-ui/{p-af181b9b.entry.js → p-1727bdd2.entry.js} +2 -2
- package/dist/csc-ui/p-1727bdd2.entry.js.map +1 -0
- package/dist/csc-ui/{p-23b2eb59.entry.js → p-77699a28.entry.js} +2 -2
- package/dist/csc-ui/p-77699a28.entry.js.map +1 -0
- package/dist/esm/c-autocomplete_34.entry.js +28 -16
- package/dist/esm/c-autocomplete_34.entry.js.map +1 -1
- package/dist/esm/c-slider.entry.js +2 -2
- package/dist/esm/c-slider.entry.js.map +1 -1
- package/dist/esm/csc-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/c-input/c-input.d.ts +1 -2
- package/dist/types/components/c-slider/c-slider.d.ts +1 -1
- package/dist/types/components/c-text-field/c-text-field.d.ts +2 -2
- package/dist/types/components.d.ts +14 -22
- package/package.json +1 -1
- package/vscode-data.json +4 -8
- package/dist/components/p-aa75dd47.js.map +0 -1
- package/dist/csc-ui/p-23b2eb59.entry.js.map +0 -1
- package/dist/csc-ui/p-af181b9b.entry.js.map +0 -1
|
@@ -1078,9 +1078,8 @@ const CInput = class {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
};
|
|
1080
1080
|
this.active = false;
|
|
1081
|
-
this.
|
|
1081
|
+
this.automaticFocus = false;
|
|
1082
1082
|
this.disabled = false;
|
|
1083
|
-
this.form = false;
|
|
1084
1083
|
this.hideDetails = false;
|
|
1085
1084
|
this.hint = '';
|
|
1086
1085
|
this.hostId = undefined;
|
|
@@ -1132,7 +1131,7 @@ const CInput = class {
|
|
|
1132
1131
|
}
|
|
1133
1132
|
componentDidLoad() {
|
|
1134
1133
|
var _a, _b, _c, _d;
|
|
1135
|
-
if (this.
|
|
1134
|
+
if (this.automaticFocus) {
|
|
1136
1135
|
setTimeout(() => {
|
|
1137
1136
|
this._onFocus(false);
|
|
1138
1137
|
}, 500);
|
|
@@ -1249,9 +1248,9 @@ const CInput = class {
|
|
|
1249
1248
|
filled: !!this.value,
|
|
1250
1249
|
[`c-input--${this.variant}`]: true,
|
|
1251
1250
|
};
|
|
1252
|
-
return (index.h(index.Host, { key: '
|
|
1251
|
+
return (index.h(index.Host, { key: '3eaed9b18bae4e0d5891d3aaf05258a2f004d510', disabled: this.disabled }, index.h("div", { key: '91f379e0225ec22f735ecfb0027d69eeeed782d9', id: 'announce-' + this.inputId, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), index.h("div", { key: 'b88a244f97c62653ab6f26dbf907849bd1adbf4c', class: containerClasses }, index.h("div", { key: '85244770af3e46cbaf8da75304c2af39bccd32f8', class: "c-input__control" }, index.h("div", { key: '74e11458e36a8fc2efcafff74af9b6b00ed723ed', class: "c-input__slot", onClick: () => this._onFocus() }, this._renderBorders(), index.h("div", { key: 'da43ec53065b0961700ae79f624a1652deaf895e', class: "c-input__field", style: {
|
|
1253
1252
|
'--_c-input-label-position': this.preSlotWidth + 'px',
|
|
1254
|
-
} }, index.h("slot", { key: '
|
|
1253
|
+
} }, index.h("slot", { key: 'df38e347976436b599536f9d0ab5cbb5ac3fa545', name: "pre" }), this._renderLabel(), index.h("slot", { key: '6d3de5e123c8867a3ed0c11a63811245b68b03e3' }))), this.variant === 'select' && index.h("slot", { key: '86333618f43eba0c502219e856c7ed0be891a7b4', name: "dropdown" }), !this.hideDetails && (index.h("c-message", { key: 'd83e818f53579dfbf25d838f615d5479e8454705', hint: this.hint, inputId: this.inputId, valid: this.valid, validation: this.validation }))))));
|
|
1255
1254
|
}
|
|
1256
1255
|
get el() { return index.getElement(this); }
|
|
1257
1256
|
static get watchers() { return {
|
|
@@ -1786,9 +1785,10 @@ const CSelect = class {
|
|
|
1786
1785
|
this._lastKeyPressTime = null;
|
|
1787
1786
|
this._searchString = '';
|
|
1788
1787
|
this._toggleDropdown = (event) => {
|
|
1788
|
+
var _a;
|
|
1789
1789
|
event.stopPropagation();
|
|
1790
1790
|
if (this.dropdownVisible) {
|
|
1791
|
-
this._dropdownElement.close();
|
|
1791
|
+
(_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
|
|
1792
1792
|
return;
|
|
1793
1793
|
}
|
|
1794
1794
|
this._dropdownElement.open();
|
|
@@ -1896,6 +1896,7 @@ const CSelect = class {
|
|
|
1896
1896
|
this._dropdownElement.updateList();
|
|
1897
1897
|
}
|
|
1898
1898
|
handleKeyDown(event) {
|
|
1899
|
+
var _a, _b, _c;
|
|
1899
1900
|
const alphanumeric = /^[0-9a-zA-Z ]+$/;
|
|
1900
1901
|
if (this.disabled)
|
|
1901
1902
|
return;
|
|
@@ -1918,12 +1919,12 @@ const CSelect = class {
|
|
|
1918
1919
|
}
|
|
1919
1920
|
if (event.key === 'Escape') {
|
|
1920
1921
|
this._preventDialogOpen = true;
|
|
1921
|
-
this._dropdownElement.close();
|
|
1922
|
+
(_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
|
|
1922
1923
|
this._inputElement.focus();
|
|
1923
1924
|
return;
|
|
1924
1925
|
}
|
|
1925
1926
|
if (event.key === 'Tab') {
|
|
1926
|
-
this._dropdownElement.close();
|
|
1927
|
+
(_b = this._dropdownElement) === null || _b === void 0 ? void 0 : _b.close();
|
|
1927
1928
|
}
|
|
1928
1929
|
if (event.key === 'ArrowDown') {
|
|
1929
1930
|
event.preventDefault();
|
|
@@ -1941,7 +1942,7 @@ const CSelect = class {
|
|
|
1941
1942
|
if (event.key === 'ArrowUp') {
|
|
1942
1943
|
event.preventDefault();
|
|
1943
1944
|
if (this.currentIndex === 0) {
|
|
1944
|
-
this._dropdownElement.close();
|
|
1945
|
+
(_c = this._dropdownElement) === null || _c === void 0 ? void 0 : _c.close();
|
|
1945
1946
|
this._inputElement.focus();
|
|
1946
1947
|
}
|
|
1947
1948
|
if (!this.dropdownVisible) {
|
|
@@ -1981,10 +1982,19 @@ const CSelect = class {
|
|
|
1981
1982
|
this._selectOption(this.returnObject ? v : { name: v, value: v });
|
|
1982
1983
|
}
|
|
1983
1984
|
onSelectOption(event) {
|
|
1985
|
+
var _a, _b;
|
|
1986
|
+
if (this.returnObject &&
|
|
1987
|
+
this.value.value === event.detail.value) {
|
|
1988
|
+
(_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
|
|
1989
|
+
}
|
|
1990
|
+
if (!this.returnObject && this.value === event.detail.value) {
|
|
1991
|
+
(_b = this._dropdownElement) === null || _b === void 0 ? void 0 : _b.close();
|
|
1992
|
+
}
|
|
1984
1993
|
this._setValue(event.detail);
|
|
1985
1994
|
}
|
|
1986
1995
|
_selectOption({ value, name }) {
|
|
1987
|
-
|
|
1996
|
+
var _a;
|
|
1997
|
+
(_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
|
|
1988
1998
|
const selection = this._setCurrentIndex({ name, value });
|
|
1989
1999
|
if (this.optionElementsExist && this.optionAsSelection && selection) {
|
|
1990
2000
|
const clone = selection.cloneNode(true);
|
|
@@ -2079,12 +2089,12 @@ const CSelect = class {
|
|
|
2079
2089
|
}
|
|
2080
2090
|
render() {
|
|
2081
2091
|
const itemType = this.optionElementsExist ? 'option' : 'item';
|
|
2082
|
-
return (index.h(index.Host, { key: '
|
|
2092
|
+
return (index.h(index.Host, { key: '44469f8a65994971033ccdd17db364a7a2b05031' }, index.h("c-dropdown", { key: 'bbc11df651bf6ecfd9bcb3c11b38efc3ace6bfa5', ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "dropdown-item-type": itemType, items: this._items, parent: this.el, type: "select" }, index.h("c-input", { key: '6f19558e4ef18b3aec1155d37f86ffcd07062e3a', slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.value, variant: "select", onClick: () => !this.disabled && this._dropdownElement.open() }, index.h("slot", { key: 'e90aa3e9c71cb220dd36b4c48aa606d5432e9216', name: "pre", slot: "pre" }), index.h("div", { key: '542869bf1a8e162798e2d7e38964383d643ac6c5', class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading &&
|
|
2083
2093
|
this.value &&
|
|
2084
2094
|
this.clearable &&
|
|
2085
2095
|
this._renderReset(), !this.loading &&
|
|
2086
2096
|
(!this.value || !this.clearable) &&
|
|
2087
|
-
this._renderChevron(), index.h("slot", { key: '
|
|
2097
|
+
this._renderChevron(), index.h("slot", { key: '403cf21005383c491f3bbe42517fae4f1785375e', onSlotchange: () => this._onSlotChange() })), index.h("slot", { key: '810329ec1606db953c64c58ee9e77a954aaf2de8', name: "post", slot: "post" })))));
|
|
2088
2098
|
}
|
|
2089
2099
|
static get formAssociated() { return true; }
|
|
2090
2100
|
get el() { return index.getElement(this); }
|
|
@@ -2521,8 +2531,8 @@ const CTextField = class {
|
|
|
2521
2531
|
return;
|
|
2522
2532
|
this.type = this.type === 'password' ? 'text' : 'password';
|
|
2523
2533
|
};
|
|
2524
|
-
this.
|
|
2525
|
-
this.
|
|
2534
|
+
this.automaticFocus = false;
|
|
2535
|
+
this.automaticCapitalize = '';
|
|
2526
2536
|
this.autocorrect = '';
|
|
2527
2537
|
this.autocomplete = '';
|
|
2528
2538
|
this.disabled = false;
|
|
@@ -2581,7 +2591,9 @@ const CTextField = class {
|
|
|
2581
2591
|
onChange: this._handleChange,
|
|
2582
2592
|
onBlur: this._handleBlur,
|
|
2583
2593
|
},
|
|
2584
|
-
input: Object.assign(Object.assign(Object.assign({ type: this.type, min: this.min, max: this.max, step: this.step }, (!!this.autocomplete && { autocomplete: this.autocomplete })), (!!this.
|
|
2594
|
+
input: Object.assign(Object.assign(Object.assign({ type: this.type, min: this.min, max: this.max, step: this.step }, (!!this.autocomplete && { autocomplete: this.autocomplete })), (!!this.automaticCapitalize && {
|
|
2595
|
+
autocapitalize: this.automaticCapitalize,
|
|
2596
|
+
})), (!!this.autocorrect && { autocorrect: this.autocorrect })),
|
|
2585
2597
|
textArea: {
|
|
2586
2598
|
rows: this.rows,
|
|
2587
2599
|
},
|
|
@@ -2616,7 +2628,7 @@ const CTextField = class {
|
|
|
2616
2628
|
return (index.h("svg", { class: classes, viewBox: "0 0 24 24", onClick: this._togglePasswordVisibility }, index.h("path", { d: this.passwordIcon })));
|
|
2617
2629
|
}
|
|
2618
2630
|
render() {
|
|
2619
|
-
return (index.h(index.Host, { key: '
|
|
2631
|
+
return (index.h(index.Host, { key: '30e52b03222db98c2e7ea02e9055340a6cb5478a' }, index.h("c-input", { key: '7e0016c74fa52d4157ad4d19bd382f3b946bbaaf', autofocus: this.automaticFocus, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, shadow: this.shadow, type: this.type, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.value }, index.h("slot", { key: '42617ce4d85480bad4a4860cc89e9585f245854f', name: "pre", slot: "pre" }), this._renderInputElement(), this._renderPasswordToggle(), this._renderDateToggle(), index.h("slot", { key: 'e1621de972ff312ff35967e3fb8ac08bffedf8bd', name: "post" }))));
|
|
2620
2632
|
}
|
|
2621
2633
|
static get formAssociated() { return true; }
|
|
2622
2634
|
get hiddenEl() { return index.getElement(this); }
|