@getpara/core-components 1.15.0 → 1.16.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.
@@ -16941,35 +16941,18 @@ const CpslPopover = class {
16941
16941
  default:
16942
16942
  triggerCallbacks = [
16943
16943
  {
16944
- eventName: 'mousedown',
16945
- callback: e => {
16944
+ eventName: 'click',
16945
+ callback: (e) => {
16946
16946
  var _a;
16947
16947
  const targetId = (_a = e.target.id) !== null && _a !== void 0 ? _a : '';
16948
16948
  if (targetId === 'ignore-click') {
16949
16949
  return;
16950
16950
  }
16951
- if (this.preventBlur) {
16952
- e.preventDefault();
16953
- }
16954
16951
  if (!this.open) {
16955
16952
  this.present();
16956
16953
  }
16957
16954
  },
16958
16955
  },
16959
- {
16960
- eventName: 'touchstart',
16961
- callback: e => {
16962
- var _a;
16963
- const targetId = (_a = e.target.id) !== null && _a !== void 0 ? _a : '';
16964
- if (targetId === 'ignore-click') {
16965
- return;
16966
- }
16967
- if (this.preventBlur) {
16968
- e.preventDefault();
16969
- }
16970
- this.present();
16971
- },
16972
- },
16973
16956
  ];
16974
16957
  break;
16975
16958
  }
@@ -17120,7 +17103,7 @@ const CpslPopover = class {
17120
17103
  }
17121
17104
  render() {
17122
17105
  var _a;
17123
- return (index.h(index.Host, { key: 'c3859c18680e0272f9cf0666a6a3866018792b9e', class: {
17106
+ return (index.h(index.Host, { key: '10c267166cb8ccb9c9eff6b3e865804688d31b95', class: {
17124
17107
  'open': this.open,
17125
17108
  'transform-h-left': this.transformOriginHorizontal === 'left',
17126
17109
  'transform-h-center': this.transformOriginHorizontal === 'center',
@@ -17132,9 +17115,9 @@ const CpslPopover = class {
17132
17115
  top: `${this.positionY}px`,
17133
17116
  left: `${this.positionX}px`,
17134
17117
  width: !this.open ? '0px' : this.autoWidth ? 'auto' : `${(_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.clientWidth}px`,
17135
- } }, index.h("div", { key: 'e63691a6db3cba1fe0f2accba92e0946a14a3281', id: "container", class: { container: true, open: this.open }, style: {
17118
+ } }, index.h("div", { key: '292d9e8e45996b711b8979d4a38c054a04306f48', id: "container", class: { container: true, open: this.open }, style: {
17136
17119
  visibility: this.hasSetInitialPosition ? 'visible' : 'hidden',
17137
- } }, index.h("slot", { key: '1028b9eda17405877a541a4aa50cc714ebb14e5b' }))));
17120
+ } }, index.h("slot", { key: 'aca410ff44bf9c77cb3eea6da1bd349bdc87287d' }))));
17138
17121
  }
17139
17122
  get el() { return index.getElement(this); }
17140
17123
  static get watchers() { return {
@@ -21428,10 +21411,10 @@ const CpslSelect = class {
21428
21411
  render() {
21429
21412
  var _a, _b, _c, _d, _e;
21430
21413
  const selectedValueAsString = Array.isArray(this.selectedValue) ? this.selectedValue.join(', ') : this.selectedValue;
21431
- return (index.h(index.Host, { key: 'f7c2db799e3462ef83fd0e7b29a3fd88a2d69e38', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': this.hasSelectedItem } }, this.label && (index.h("label", { key: '8629dcd2d81bbf631962f84c551b2e2a3c96dd33', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? index.h("span", { class: "optional-label" }, "(optional)") : '')), index.h("div", { key: 'f01a1d57e48256e4b1898beeebb4c01275966aa6', 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: 'eb8a31b3254990d3f4165275561b21fe9e9abaf9', name: "selected-item" }), index.h("div", { key: 'a78cec861e87ac9702477bddf10ec4c66cf37626', class: { 'selected-container-content': true, 'hidden': this.hasSelectedItem && this.showFormattedSelectedItem }, id: "selected-container-content", style: {} }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (index.h("cpsl-text", { key: '74fdd4ff8ad178376220d89890f507b304298be4', 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: '7f0f942c54e7b72279fbff7cba99b1a84105b912', part: "icon", class: { 'chevron': true, 'open': !this.noIconAnimation && this.popoverOpen, 'has-value': this.hasSelectedItem }, icon: this.icon }), index.h("input", { key: '43e2fbcd9d13168ecdd9fadb2047591480cf2c42', 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: '926ef9d6f59215260143f133104e63a46ecedc1f', part: "popover", autoWidth: this.autoWidth, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, index.h("div", { key: '90520534785a584d539d5ef8e49ff394d2f4c3d7', part: "dropdown", class: "dropdown" }, this.showSearch && (index.h("div", { key: 'e0cf6cf0e4d0c17981b78428ff3ceeb049cebba5', class: "search-container" }, index.h("cpsl-input", { key: 'e1d3bc0a68026b0cbbca0677a30b26934b6296be', onClick: e => e.stopPropagation(), placeholder: (_d = this.searchPlaceholder) !== null && _d !== void 0 ? _d : 'Search', value: "", onCpslInput: e => {
21414
+ return (index.h(index.Host, { key: 'f7c2db799e3462ef83fd0e7b29a3fd88a2d69e38', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': this.hasSelectedItem } }, this.label && (index.h("label", { key: '8629dcd2d81bbf631962f84c551b2e2a3c96dd33', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? index.h("span", { class: "optional-label" }, "(optional)") : '')), index.h("div", { key: '581836944bb5c01766bd0ec13f6bf5e1149cd7e7', part: "select-container", id: "select-container", class: { 'select-container': true, 'error-container': Boolean(this.errorText) }, onClick: this.handleClick }, this.hasSelectedItem && this.showFormattedSelectedItem && index.h("slot", { key: '39d58ccf94664d9d6c01a2b7dc5369fa77f224e2', name: "selected-item" }), index.h("div", { key: '511122f39895b25a0624497be7cb99c6ec9b92ba', class: { 'selected-container-content': true, 'hidden': this.hasSelectedItem && this.showFormattedSelectedItem }, id: "selected-container-content", style: {} }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (index.h("cpsl-text", { key: 'd8ad96dab7e5b298d621ffc0621298c3ecc05907', 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: '787c3d3dff16bd68d3526604523f130ca329e8c9', part: "icon", class: { 'chevron': true, 'open': !this.noIconAnimation && this.popoverOpen, 'has-value': this.hasSelectedItem }, icon: this.icon }), index.h("input", { key: 'b606c940537173d3d8f4d66e131d7b624779713c', 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: '272c71c9466bd5f301be9c02da68ac78dc95b087', part: "popover", autoWidth: this.autoWidth, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, index.h("div", { key: 'e8d9dde383da411ebfe8a238e8e3d0b37c0cbdde', part: "dropdown", class: "dropdown" }, this.showSearch && (index.h("div", { key: '571f898c5ad668bd55373a4c3aceff8e4c9f990c', class: "search-container" }, index.h("cpsl-input", { key: 'faef8d5df2c800564c6dfb9176dbfa35592089fd', onClick: e => e.stopPropagation(), placeholder: (_d = this.searchPlaceholder) !== null && _d !== void 0 ? _d : 'Search', value: "", onCpslInput: e => {
21432
21415
  e.stopPropagation();
21433
21416
  this.cpslSearchChange.emit(e.detail.value);
21434
- } }))), index.h("div", { key: '4f12646017f6b9c95a717188d7329750e8bdf74e', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, index.h("slot", { key: '33fd8a222ea76686c6d00ed388decb5ab10b98d8', name: "items" }))))), (this.errorText || this.helperText) && (index.h("div", { key: 'f9e99bd7e2a4c4eb98ea540c2ba0ed9a1e0feb67', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, index.h("span", { key: 'eae52c7b8dad9a6f702abb01f9f8205d7a96a82d' }, (_e = this.errorText) !== null && _e !== void 0 ? _e : this.helperText)))));
21417
+ } }))), index.h("div", { key: '2a7a58fe4cac9ef5c6e193c7520c7fc5d4bdbec5', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, index.h("slot", { key: 'a0630a42e11c011ed5404e05a7ea1933da90e8fc', name: "items" }))))), (this.errorText || this.helperText) && (index.h("div", { key: 'cee93a66e762e3c111edcaf8f57379d9ed106369', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, index.h("span", { key: '438123416a44bbd84b6fa908a9ba21635d808400' }, (_e = this.errorText) !== null && _e !== void 0 ? _e : this.helperText)))));
21435
21418
  }
21436
21419
  get el() { return index.getElement(this); }
21437
21420
  static get watchers() { return {
@@ -21455,7 +21438,10 @@ const CpslSelectItem = class {
21455
21438
  this.value = undefined;
21456
21439
  }
21457
21440
  render() {
21458
- return (index.h(index.Host, { key: '532ed86577783bc61c40a18de178e63d16cf24c1' }, index.h("div", { key: 'ebf183f51dc2082e853cda6f490ab1b1a2c72f99', part: "outer-container", class: "outer-container", onClick: this.handleItemClick }, index.h("div", { key: '1e2c94c4e4a61638fc7a0439a36672bc22f47d28', part: "inner-container", class: { 'inner-container': true, 'selected': this.selected } }, index.h("slot", { key: 'a5c01c9f324912eff3c7958370bbec29050e4f4a' })))));
21441
+ return (index.h(index.Host, { key: '532ed86577783bc61c40a18de178e63d16cf24c1' }, index.h("div", { key: 'c96fd4ab69add9b97726ef5869da0f4ef4353b23', part: "outer-container", class: "outer-container", onClick: e => {
21442
+ this.handleItemClick();
21443
+ e.stopPropagation();
21444
+ } }, index.h("div", { key: '0dd87fde160b31a3609ee41b550066279c9f00d6', part: "inner-container", class: { 'inner-container': true, 'selected': this.selected } }, index.h("slot", { key: 'c526deb812322490f235d34d7d98f30eb2f6a19e' })))));
21459
21445
  }
21460
21446
  };
21461
21447
  CpslSelectItem.style = CpslSelectItemStyle0;