@getpara/core-components 1.7.0 → 2.0.0-dev.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.
@@ -21401,11 +21401,11 @@ const CpslSelect = class {
21401
21401
  }
21402
21402
  render() {
21403
21403
  var _a, _b, _c, _d, _e;
21404
- const selectedValueAsString = Array.isArray(this.selectedValue) ? this.selectedValue.join(', ') : this.selectedValue;
21405
- return (index.h(index.Host, { key: 'b2cf6a54a8e1613128c5e6c852b53e752c66b24a', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': this.hasSelectedItem } }, this.label && (index.h("label", { key: 'd79a35cde5c5c5d9c22b6c8de85e7cf36afc512e', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? index.h("span", { class: "optional-label" }, "(optional)") : '')), index.h("div", { key: '748bbd58ed4a6623d4e58b6da244aaf00bd23068', part: "select-container", id: "select-container", class: { 'select-container': true, 'error-container': Boolean(this.errorText) }, onMouseDown: this.handleClick }, this.hasSelectedItem && this.showFormattedSelectedItem && index.h("slot", { key: '21600540039afb807f827657459a9ad7a4851df1', name: "selected-item" }), index.h("div", { key: '8fa8319aa7d3738b8ac75b028a2e30606cdd6038', class: { 'selected-container-content': true, 'hidden': this.hasSelectedItem && this.showFormattedSelectedItem }, id: "selected-container-content", style: {} }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (index.h("cpsl-text", { key: '6d4a639dcb42b27154b02461a4dc02deb879dea5', class: { 'selected-text': true, 'placeholder': !this.selectedValue }, part: "selected-text", color: this.selectedItemColor, variant: this.selectedItemVariant, weight: this.selectedItemWeight }, !this.selectedValue ? ((_a = this.placeholder) !== null && _a !== void 0 ? _a : 'Select') : ((_c = (_b = this.formatValue) === null || _b === void 0 ? void 0 : _b.call(this, this.selectedValue)) !== null && _c !== void 0 ? _c : selectedValueAsString)))), index.h("cpsl-icon", { key: 'f3b1b1b7407e839c3b4a9a0f20c40e33af805b7a', part: "icon", class: { 'chevron': true, 'open': !this.noIconAnimation && this.popoverOpen, 'has-value': this.hasSelectedItem }, icon: this.icon }), index.h("input", { key: '2590796cd4c320c5ae62a9c203f649d3ee582bc3', id: this.inputId, disabled: this.disabled, class: { disabled: this.disabled }, value: this.selectedValue, onFocus: this.onFocus, onBlur: this.onBlur, onKeyPress: this.handleEnterPress, inputmode: "none" }), index.h("cpsl-popover", { key: 'd159f40989070c4cba12346386e6866ed6123e20', part: "popover", autoWidth: this.autoWidth, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, index.h("div", { key: '1d2c107f595de6523782bd792111aa3830df75db', part: "dropdown", class: "dropdown" }, this.showSearch && (index.h("div", { key: '559403261a208be7bd7e3275437df87e82964a10', class: "search-container" }, index.h("cpsl-input", { key: 'c4daa89e27279643295ae30620d8d5b98ea456cf', onClick: e => e.stopPropagation(), placeholder: (_d = this.searchPlaceholder) !== null && _d !== void 0 ? _d : 'Search', value: "", onCpslInput: e => {
21404
+ const selectedValueAsString = typeof this.selectedValue === 'string' ? this.selectedValue : this.selectedValue.join(', ');
21405
+ return (index.h(index.Host, { key: '0b366a3c097d845993afaa7d27c894c5c0f03e44', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': this.hasSelectedItem } }, this.label && (index.h("label", { key: 'cfa4ae1a802f98d1beeea74bce33dd1844f821bf', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? index.h("span", { class: "optional-label" }, "(optional)") : '')), index.h("div", { key: '971c488bbadbaa9ade8e17d0ec91bbaaccd1c3df', part: "select-container", id: "select-container", class: { 'select-container': true, 'error-container': Boolean(this.errorText) }, onMouseDown: this.handleClick }, this.hasSelectedItem && this.showFormattedSelectedItem && index.h("slot", { key: 'c4cb233ece4d06a3cc7ef4b7aa5d9ccb6fada6c2', name: "selected-item" }), index.h("div", { key: '78e52b91db67e50205601902074610c4841d73db', class: { 'selected-container-content': true, 'hidden': this.hasSelectedItem && this.showFormattedSelectedItem }, id: "selected-container-content", style: {} }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (index.h("cpsl-text", { key: '682ce440ce404b1549eec38f6a523026eb48ea0d', class: { 'selected-text': true, 'placeholder': !this.selectedValue }, part: "selected-text", color: this.selectedItemColor, variant: this.selectedItemVariant, weight: this.selectedItemWeight }, !this.selectedValue ? ((_a = this.placeholder) !== null && _a !== void 0 ? _a : 'Select') : ((_c = (_b = this.formatValue) === null || _b === void 0 ? void 0 : _b.call(this, this.selectedValue)) !== null && _c !== void 0 ? _c : selectedValueAsString)))), index.h("cpsl-icon", { key: '96355103fb2e94e3c2bce8be308c643de03cb94c', part: "icon", class: { 'chevron': true, 'open': !this.noIconAnimation && this.popoverOpen, 'has-value': this.hasSelectedItem }, icon: this.icon }), index.h("input", { key: '60eb6ad37fcaa568b3166f10b6c8dd59b8ca6e10', id: this.inputId, disabled: this.disabled, class: { disabled: this.disabled }, value: this.selectedValue, onFocus: this.onFocus, onBlur: this.onBlur, onKeyPress: this.handleEnterPress, inputmode: "none" }), index.h("cpsl-popover", { key: '4bd5c2e243c05671786dded417234bdb3ae4e5ef', part: "popover", autoWidth: this.autoWidth, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, index.h("div", { key: '0d1bb3a829f31e211cc99e28e3650d21a353ec75', part: "dropdown", class: "dropdown" }, this.showSearch && (index.h("div", { key: 'af48dfde2c8fd8717b9602ad6870a7b8da86c6db', class: "search-container" }, index.h("cpsl-input", { key: '3a3d0197b1fe0f6a91568fb2c0530a34d8f68c8d', onClick: e => e.stopPropagation(), placeholder: (_d = this.searchPlaceholder) !== null && _d !== void 0 ? _d : 'Search', value: "", onCpslInput: e => {
21406
21406
  e.stopPropagation();
21407
21407
  this.cpslSearchChange.emit(e.detail.value);
21408
- } }))), index.h("div", { key: '0c17584f09e80d2391747bc79acde90c7d9a227b', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, index.h("slot", { key: '334b72d0128b48d96005988b4e64a35d36a8bd78', name: "items" }))))), (this.errorText || this.helperText) && (index.h("div", { key: '58f2f1f4c80383012183c4da303be1c7fc0c5a57', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, index.h("span", { key: '19fe193e8b79aeb370d5f984cbf4bc9d9dca5b1a' }, (_e = this.errorText) !== null && _e !== void 0 ? _e : this.helperText)))));
21408
+ } }))), index.h("div", { key: 'fb7d1dc0be277669ad804766f7ebb03218268a17', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, index.h("slot", { key: 'f63682b1d61aeab270cd2bf8683bf9b2f100274d', name: "items" }))))), (this.errorText || this.helperText) && (index.h("div", { key: '66ff41128e6faa920cd1a3e7cea36995921b89b6', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, index.h("span", { key: '77f56f4d6c7bff3836cdb54392b7938a0aa2ef9a' }, (_e = this.errorText) !== null && _e !== void 0 ? _e : this.helperText)))));
21409
21409
  }
21410
21410
  get el() { return index.getElement(this); }
21411
21411
  static get watchers() { return {