@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.
Files changed (45) hide show
  1. package/dist/cjs/c-autocomplete_34.cjs.entry.js +28 -16
  2. package/dist/cjs/c-autocomplete_34.cjs.entry.js.map +1 -1
  3. package/dist/cjs/c-slider.cjs.entry.js +2 -2
  4. package/dist/cjs/c-slider.cjs.entry.js.map +1 -1
  5. package/dist/cjs/csc-ui.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/c-input/c-input.js +5 -24
  8. package/dist/collection/components/c-input/c-input.js.map +1 -1
  9. package/dist/collection/components/c-select/c-select.js +18 -7
  10. package/dist/collection/components/c-select/c-select.js.map +1 -1
  11. package/dist/collection/components/c-slider/c-slider.js +3 -3
  12. package/dist/collection/components/c-slider/c-slider.js.map +1 -1
  13. package/dist/collection/components/c-text-field/c-text-field.js +8 -6
  14. package/dist/collection/components/c-text-field/c-text-field.js.map +1 -1
  15. package/dist/components/c-autocomplete.js +1 -1
  16. package/dist/components/c-input.js +1 -1
  17. package/dist/components/c-select.js +19 -8
  18. package/dist/components/c-select.js.map +1 -1
  19. package/dist/components/c-slider.js +3 -3
  20. package/dist/components/c-slider.js.map +1 -1
  21. package/dist/components/c-text-field.js +9 -7
  22. package/dist/components/c-text-field.js.map +1 -1
  23. package/dist/components/{p-aa75dd47.js → p-fc209a6c.js} +6 -8
  24. package/dist/components/p-fc209a6c.js.map +1 -0
  25. package/dist/csc-ui/csc-ui.esm.js +1 -1
  26. package/dist/csc-ui/csc-ui.esm.js.map +1 -1
  27. package/dist/csc-ui/{p-af181b9b.entry.js → p-1727bdd2.entry.js} +2 -2
  28. package/dist/csc-ui/p-1727bdd2.entry.js.map +1 -0
  29. package/dist/csc-ui/{p-23b2eb59.entry.js → p-77699a28.entry.js} +2 -2
  30. package/dist/csc-ui/p-77699a28.entry.js.map +1 -0
  31. package/dist/esm/c-autocomplete_34.entry.js +28 -16
  32. package/dist/esm/c-autocomplete_34.entry.js.map +1 -1
  33. package/dist/esm/c-slider.entry.js +2 -2
  34. package/dist/esm/c-slider.entry.js.map +1 -1
  35. package/dist/esm/csc-ui.js +1 -1
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/types/components/c-input/c-input.d.ts +1 -2
  38. package/dist/types/components/c-slider/c-slider.d.ts +1 -1
  39. package/dist/types/components/c-text-field/c-text-field.d.ts +2 -2
  40. package/dist/types/components.d.ts +14 -22
  41. package/package.json +1 -1
  42. package/vscode-data.json +4 -8
  43. package/dist/components/p-aa75dd47.js.map +0 -1
  44. package/dist/csc-ui/p-23b2eb59.entry.js.map +0 -1
  45. package/dist/csc-ui/p-af181b9b.entry.js.map +0 -1
@@ -1074,9 +1074,8 @@ const CInput = class {
1074
1074
  }
1075
1075
  };
1076
1076
  this.active = false;
1077
- this.autofocus = false;
1077
+ this.automaticFocus = false;
1078
1078
  this.disabled = false;
1079
- this.form = false;
1080
1079
  this.hideDetails = false;
1081
1080
  this.hint = '';
1082
1081
  this.hostId = undefined;
@@ -1128,7 +1127,7 @@ const CInput = class {
1128
1127
  }
1129
1128
  componentDidLoad() {
1130
1129
  var _a, _b, _c, _d;
1131
- if (this.autofocus) {
1130
+ if (this.automaticFocus) {
1132
1131
  setTimeout(() => {
1133
1132
  this._onFocus(false);
1134
1133
  }, 500);
@@ -1245,9 +1244,9 @@ const CInput = class {
1245
1244
  filled: !!this.value,
1246
1245
  [`c-input--${this.variant}`]: true,
1247
1246
  };
1248
- return (h(Host, { key: '8df4b85dd9057e4d954da4a657c6474aadb743a0', disabled: this.disabled }, h("div", { key: 'cb93dcf7f01f004481eb1a9bed4455cbca19dd4f', id: 'announce-' + this.inputId, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), h("div", { key: '7bb1b2c4d71754e485f8c57e4be4a0d1e21588ee', class: containerClasses }, h("div", { key: 'f2e61ecc315027879116e7c87231c4b4f65db093', class: "c-input__control" }, h("div", { key: '129cb0aa738383b33996fccb32e62b4377ed8239', class: "c-input__slot", onClick: () => this._onFocus() }, this._renderBorders(), h("div", { key: '31549a2d3111589e030c594edbef9f5515bd5788', class: "c-input__field", style: {
1247
+ return (h(Host, { key: '3eaed9b18bae4e0d5891d3aaf05258a2f004d510', disabled: this.disabled }, h("div", { key: '91f379e0225ec22f735ecfb0027d69eeeed782d9', id: 'announce-' + this.inputId, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), h("div", { key: 'b88a244f97c62653ab6f26dbf907849bd1adbf4c', class: containerClasses }, h("div", { key: '85244770af3e46cbaf8da75304c2af39bccd32f8', class: "c-input__control" }, h("div", { key: '74e11458e36a8fc2efcafff74af9b6b00ed723ed', class: "c-input__slot", onClick: () => this._onFocus() }, this._renderBorders(), h("div", { key: 'da43ec53065b0961700ae79f624a1652deaf895e', class: "c-input__field", style: {
1249
1248
  '--_c-input-label-position': this.preSlotWidth + 'px',
1250
- } }, h("slot", { key: 'f9b76639f024469385ff536df00ba2641a15e50d', name: "pre" }), this._renderLabel(), h("slot", { key: '585e92fb496018f945fcc024638c05e81805d84f' }))), this.variant === 'select' && h("slot", { key: '3174455400819721c9b56be54dd50ba661725b0d', name: "dropdown" }), !this.hideDetails && (h("c-message", { key: '3584e85a898d7705dbf6658ccd9a598029d870b6', hint: this.hint, inputId: this.inputId, valid: this.valid, validation: this.validation }))))));
1249
+ } }, h("slot", { key: 'df38e347976436b599536f9d0ab5cbb5ac3fa545', name: "pre" }), this._renderLabel(), h("slot", { key: '6d3de5e123c8867a3ed0c11a63811245b68b03e3' }))), this.variant === 'select' && h("slot", { key: '86333618f43eba0c502219e856c7ed0be891a7b4', name: "dropdown" }), !this.hideDetails && (h("c-message", { key: 'd83e818f53579dfbf25d838f615d5479e8454705', hint: this.hint, inputId: this.inputId, valid: this.valid, validation: this.validation }))))));
1251
1250
  }
1252
1251
  get el() { return getElement(this); }
1253
1252
  static get watchers() { return {
@@ -1782,9 +1781,10 @@ const CSelect = class {
1782
1781
  this._lastKeyPressTime = null;
1783
1782
  this._searchString = '';
1784
1783
  this._toggleDropdown = (event) => {
1784
+ var _a;
1785
1785
  event.stopPropagation();
1786
1786
  if (this.dropdownVisible) {
1787
- this._dropdownElement.close();
1787
+ (_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
1788
1788
  return;
1789
1789
  }
1790
1790
  this._dropdownElement.open();
@@ -1892,6 +1892,7 @@ const CSelect = class {
1892
1892
  this._dropdownElement.updateList();
1893
1893
  }
1894
1894
  handleKeyDown(event) {
1895
+ var _a, _b, _c;
1895
1896
  const alphanumeric = /^[0-9a-zA-Z ]+$/;
1896
1897
  if (this.disabled)
1897
1898
  return;
@@ -1914,12 +1915,12 @@ const CSelect = class {
1914
1915
  }
1915
1916
  if (event.key === 'Escape') {
1916
1917
  this._preventDialogOpen = true;
1917
- this._dropdownElement.close();
1918
+ (_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
1918
1919
  this._inputElement.focus();
1919
1920
  return;
1920
1921
  }
1921
1922
  if (event.key === 'Tab') {
1922
- this._dropdownElement.close();
1923
+ (_b = this._dropdownElement) === null || _b === void 0 ? void 0 : _b.close();
1923
1924
  }
1924
1925
  if (event.key === 'ArrowDown') {
1925
1926
  event.preventDefault();
@@ -1937,7 +1938,7 @@ const CSelect = class {
1937
1938
  if (event.key === 'ArrowUp') {
1938
1939
  event.preventDefault();
1939
1940
  if (this.currentIndex === 0) {
1940
- this._dropdownElement.close();
1941
+ (_c = this._dropdownElement) === null || _c === void 0 ? void 0 : _c.close();
1941
1942
  this._inputElement.focus();
1942
1943
  }
1943
1944
  if (!this.dropdownVisible) {
@@ -1977,10 +1978,19 @@ const CSelect = class {
1977
1978
  this._selectOption(this.returnObject ? v : { name: v, value: v });
1978
1979
  }
1979
1980
  onSelectOption(event) {
1981
+ var _a, _b;
1982
+ if (this.returnObject &&
1983
+ this.value.value === event.detail.value) {
1984
+ (_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
1985
+ }
1986
+ if (!this.returnObject && this.value === event.detail.value) {
1987
+ (_b = this._dropdownElement) === null || _b === void 0 ? void 0 : _b.close();
1988
+ }
1980
1989
  this._setValue(event.detail);
1981
1990
  }
1982
1991
  _selectOption({ value, name }) {
1983
- this._dropdownElement.close();
1992
+ var _a;
1993
+ (_a = this._dropdownElement) === null || _a === void 0 ? void 0 : _a.close();
1984
1994
  const selection = this._setCurrentIndex({ name, value });
1985
1995
  if (this.optionElementsExist && this.optionAsSelection && selection) {
1986
1996
  const clone = selection.cloneNode(true);
@@ -2075,12 +2085,12 @@ const CSelect = class {
2075
2085
  }
2076
2086
  render() {
2077
2087
  const itemType = this.optionElementsExist ? 'option' : 'item';
2078
- return (h(Host, { key: '52f875ca03cb88ec39c013c42e235b572ed01cdf' }, h("c-dropdown", { key: '4d3f14c317780b32430e871526359509173d9115', 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" }, h("c-input", { key: 'c7885524a9a8879856dfce1619e4691654075270', 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() }, h("slot", { key: '82809542fbc315e95e30de7b3e2fc1dedad208af', name: "pre", slot: "pre" }), h("div", { key: '3e52607084d4c0f571a4f4c1158d62593fa0778f', class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading &&
2088
+ return (h(Host, { key: '44469f8a65994971033ccdd17db364a7a2b05031' }, 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" }, 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() }, h("slot", { key: 'e90aa3e9c71cb220dd36b4c48aa606d5432e9216', name: "pre", slot: "pre" }), h("div", { key: '542869bf1a8e162798e2d7e38964383d643ac6c5', class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading &&
2079
2089
  this.value &&
2080
2090
  this.clearable &&
2081
2091
  this._renderReset(), !this.loading &&
2082
2092
  (!this.value || !this.clearable) &&
2083
- this._renderChevron(), h("slot", { key: '89b436dbbd01e3d74317da154870dd37f62d131b', onSlotchange: () => this._onSlotChange() })), h("slot", { key: '7fc00de1ddf7dfdf38c752372127356796c4037e', name: "post", slot: "post" })))));
2093
+ this._renderChevron(), h("slot", { key: '403cf21005383c491f3bbe42517fae4f1785375e', onSlotchange: () => this._onSlotChange() })), h("slot", { key: '810329ec1606db953c64c58ee9e77a954aaf2de8', name: "post", slot: "post" })))));
2084
2094
  }
2085
2095
  static get formAssociated() { return true; }
2086
2096
  get el() { return getElement(this); }
@@ -2517,8 +2527,8 @@ const CTextField = class {
2517
2527
  return;
2518
2528
  this.type = this.type === 'password' ? 'text' : 'password';
2519
2529
  };
2520
- this.autofocus = false;
2521
- this.autocapitalize = '';
2530
+ this.automaticFocus = false;
2531
+ this.automaticCapitalize = '';
2522
2532
  this.autocorrect = '';
2523
2533
  this.autocomplete = '';
2524
2534
  this.disabled = false;
@@ -2577,7 +2587,9 @@ const CTextField = class {
2577
2587
  onChange: this._handleChange,
2578
2588
  onBlur: this._handleBlur,
2579
2589
  },
2580
- 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.autocapitalize && { autocapitalize: this.autocapitalize })), (!!this.autocorrect && { autocorrect: this.autocorrect })),
2590
+ 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 && {
2591
+ autocapitalize: this.automaticCapitalize,
2592
+ })), (!!this.autocorrect && { autocorrect: this.autocorrect })),
2581
2593
  textArea: {
2582
2594
  rows: this.rows,
2583
2595
  },
@@ -2612,7 +2624,7 @@ const CTextField = class {
2612
2624
  return (h("svg", { class: classes, viewBox: "0 0 24 24", onClick: this._togglePasswordVisibility }, h("path", { d: this.passwordIcon })));
2613
2625
  }
2614
2626
  render() {
2615
- return (h(Host, { key: 'a39563142d4a2f2e1415eef938c18635997d23fe' }, h("c-input", { key: '25fc5c909c8ebedf42f2995601ffd1a921319281', autofocus: this.autofocus, 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 }, h("slot", { key: '7d5b4b6002c1dce838fc96989c598913d6a35d94', name: "pre", slot: "pre" }), this._renderInputElement(), this._renderPasswordToggle(), this._renderDateToggle(), h("slot", { key: '645c6982401d0a1baa7119eba9ce20a5c296eece', name: "post" }))));
2627
+ return (h(Host, { key: '30e52b03222db98c2e7ea02e9055340a6cb5478a' }, 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 }, h("slot", { key: '42617ce4d85480bad4a4860cc89e9585f245854f', name: "pre", slot: "pre" }), this._renderInputElement(), this._renderPasswordToggle(), this._renderDateToggle(), h("slot", { key: 'e1621de972ff312ff35967e3fb8ac08bffedf8bd', name: "post" }))));
2616
2628
  }
2617
2629
  static get formAssociated() { return true; }
2618
2630
  get hiddenEl() { return getElement(this); }