@usecapsule/core-components 2.0.6 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/capsule/capsule.esm.js +1 -1
- package/dist/capsule/capsule.esm.js.map +1 -1
- package/dist/capsule/{p-a95ec4df.entry.js → p-415384b7.entry.js} +2 -2
- package/dist/capsule/{p-193ac141.entry.js → p-4d957466.entry.js} +2 -2
- package/dist/capsule/{p-cb8dc0a4.entry.js → p-6b02ea8d.entry.js} +2 -2
- package/dist/capsule/p-b2997f3c.js +3 -0
- package/dist/capsule/p-b2997f3c.js.map +1 -0
- package/dist/capsule/{p-d7be092d.entry.js → p-b76350fd.entry.js} +2 -2
- package/dist/capsule/{p-7c738dc5.entry.js → p-f2af4351.entry.js} +5 -5
- package/dist/capsule/p-f2af4351.entry.js.map +1 -0
- package/dist/capsule/{p-0cab90fa.entry.js → p-fa4e3c14.entry.js} +2 -2
- package/dist/cjs/capsule.cjs.js +2 -2
- package/dist/cjs/cpsl-alert_18.cjs.entry.js +63 -10
- package/dist/cjs/cpsl-alert_18.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-animation.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-col.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-grid.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-info-box.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
- package/dist/cjs/{index-3fccb5b4.js → index-87ba56f9.js} +8 -3
- package/dist/cjs/index-87ba56f9.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.css +33 -2
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +92 -9
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.js +33 -1
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/esm/capsule.js +3 -3
- package/dist/esm/cpsl-alert_18.entry.js +63 -10
- package/dist/esm/cpsl-alert_18.entry.js.map +1 -1
- package/dist/esm/cpsl-animation.entry.js +1 -1
- package/dist/esm/cpsl-col.entry.js +1 -1
- package/dist/esm/cpsl-grid.entry.js +1 -1
- package/dist/esm/cpsl-info-box.entry.js +1 -1
- package/dist/esm/cpsl-row.entry.js +1 -1
- package/dist/esm/{index-f00e090c.js → index-fd970ca2.js} +8 -3
- package/dist/esm/index-fd970ca2.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/cpsl-dropdown/cpsl-dropdown.d.ts +10 -1
- package/dist/types/components/cpsl-input/cpsl-input.d.ts +2 -0
- package/dist/types/components.d.ts +22 -1
- package/package.json +2 -2
- package/dist/capsule/p-6fb7c4d1.js +0 -3
- package/dist/capsule/p-6fb7c4d1.js.map +0 -1
- package/dist/capsule/p-7c738dc5.entry.js.map +0 -1
- package/dist/cjs/index-3fccb5b4.js.map +0 -1
- package/dist/esm/index-f00e090c.js.map +0 -1
- /package/dist/capsule/{p-a95ec4df.entry.js.map → p-415384b7.entry.js.map} +0 -0
- /package/dist/capsule/{p-193ac141.entry.js.map → p-4d957466.entry.js.map} +0 -0
- /package/dist/capsule/{p-cb8dc0a4.entry.js.map → p-6b02ea8d.entry.js.map} +0 -0
- /package/dist/capsule/{p-d7be092d.entry.js.map → p-b76350fd.entry.js.map} +0 -0
- /package/dist/capsule/{p-0cab90fa.entry.js.map → p-fa4e3c14.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as d,h as o,H as r}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as d,h as o,H as r}from"./p-b2997f3c.js";const a=":host{--box-border-radius:var(--cpsl-border-radius-info-box);--box-padding-top:16px;--box-padding-bottom:16px;--box-padding-start:16px;--box-padding-end:16px;--box-border-width:1px}.info-box-container{border-radius:var(--input-border-radius);-webkit-padding-start:var(--box-padding-start);padding-inline-start:var(--box-padding-start);-webkit-padding-end:var(--box-padding-end);padding-inline-end:var(--box-padding-end);padding-top:var(--box-padding-top);padding-bottom:var(--box-padding-bottom);display:flex;background-color:var(--cpsl-color-background-secondary);border:var(--box-border-width) solid var(--cpsl-color-input-border-placeholder);border-radius:var(--box-border-radius)}";const n=a;const i=class{constructor(o){d(this,o)}render(){return o(r,{key:"c3adc346763da83e631c71bbc4f1ce7aad99ba04"},o("div",{key:"c03ce70d8c94d42264216c1376d81f8601a45656",class:"info-box-container"},o("slot",{key:"3ae35495b7371479d0ad8e731011fb8b06a2c0d9"})))}};i.style=n;export{i as cpsl_info_box};
|
2
|
+
//# sourceMappingURL=p-fa4e3c14.entry.js.map
|
package/dist/cjs/capsule.cjs.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-87ba56f9.js');
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
7
7
|
|
8
8
|
/*
|
@@ -19,7 +19,7 @@ const patchBrowser = () => {
|
|
19
19
|
|
20
20
|
patchBrowser().then(async (options) => {
|
21
21
|
await appGlobals.globalScripts();
|
22
|
-
return index.bootstrapLazy([["cpsl-animation.cjs",[[1,"cpsl-animation",{"src":[1],"replayAnimation":[64]}]]],["cpsl-col.cjs",[[1,"cpsl-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]]]],["cpsl-grid.cjs",[[1,"cpsl-grid",{"fixed":[4]}]]],["cpsl-info-box.cjs",[[1,"cpsl-info-box"]]],["cpsl-row.cjs",[[1,"cpsl-row"]]],["cpsl-alert_18.cjs",[[1,"cpsl-code-input",{"code":[1025],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"length":[2],"type":[1]}],[1,"cpsl-input",{"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"noAutoDisable":[4,"no-auto-disable"],"autofocus":[4],"disabled":[4],"enterkeyhint":[1],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"inputmode":[1],"label":[1],"max":[8],"maxlength":[2],"min":[8],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"startIconSrc":[1,"start-icon-src"],"startIcon":[1,"start-icon"],"step":[1],"type":[1],"value":[1025],"hasFocus":[32]},null,{"disabled":["handleDisable"]}],[1,"cpsl-modal",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"footerExpanded":[4,"footer-expanded"],"footerTransitionDuration":[2,"footer-transition-duration"],"noOverlay":[4,"no-overlay"],"open":[4],"hasFooter":[32]},null,{"footerExpanded":["toggleHeight"],"open":["toggleModal"]}],[1,"cpsl-slide-button",{"disabled":[4],"endIcon":[1,"end-icon"],"endText":[1,"end-text"],"startIcon":[1,"start-icon"],"startText":[1,"start-text"]}],[1,"cpsl-tile-button",{"src":[1],"icon":[1]}],[1,"cpsl-alert",{"type":[1],"icon":[1]}],[1,"cpsl-button",{"disabled":[516],"variant":[513]}],[1,"cpsl-divider"],[1,"cpsl-dropdown",{"width":[1],"items":[16],"isOpen":[32],"
|
22
|
+
return index.bootstrapLazy([["cpsl-animation.cjs",[[1,"cpsl-animation",{"src":[1],"replayAnimation":[64]}]]],["cpsl-col.cjs",[[1,"cpsl-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]]]],["cpsl-grid.cjs",[[1,"cpsl-grid",{"fixed":[4]}]]],["cpsl-info-box.cjs",[[1,"cpsl-info-box"]]],["cpsl-row.cjs",[[1,"cpsl-row"]]],["cpsl-alert_18.cjs",[[1,"cpsl-code-input",{"code":[1025],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"length":[2],"type":[1]}],[1,"cpsl-input",{"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"noAutoDisable":[4,"no-auto-disable"],"autofocus":[4],"disabled":[4],"enterkeyhint":[1],"errorText":[1,"error-text"],"helperText":[1,"helper-text"],"inputmode":[1],"label":[1],"max":[8],"maxlength":[2],"min":[8],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"startIconSrc":[1,"start-icon-src"],"startIcon":[1,"start-icon"],"step":[1],"type":[1],"value":[1025],"hasFocus":[32]},null,{"disabled":["handleDisable"]}],[1,"cpsl-modal",{"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"],"footerExpanded":[4,"footer-expanded"],"footerTransitionDuration":[2,"footer-transition-duration"],"noOverlay":[4,"no-overlay"],"open":[4],"hasFooter":[32]},null,{"footerExpanded":["toggleHeight"],"open":["toggleModal"]}],[1,"cpsl-slide-button",{"disabled":[4],"endIcon":[1,"end-icon"],"endText":[1,"end-text"],"startIcon":[1,"start-icon"],"startText":[1,"start-text"]}],[1,"cpsl-tile-button",{"src":[1],"icon":[1]}],[1,"cpsl-alert",{"type":[1],"icon":[1]}],[1,"cpsl-button",{"disabled":[516],"variant":[513]}],[1,"cpsl-divider"],[1,"cpsl-dropdown",{"width":[1],"hasCpslSearch":[4,"has-cpsl-search"],"items":[16],"selectedItem":[1040],"isOpen":[32],"searchQuery":[32],"filteredItems":[32]},[[9,"resize","handleResize"]],{"selectedItem":["handleSelectedItemChange"],"isOpen":["handleOpenChange"]}],[1,"cpsl-pill",{"text":[1]}],[1,"cpsl-progress-indicator",{"totalSteps":[2,"total-steps"],"step":[2]}],[1,"cpsl-qr-code",{"url":[1],"imageSrc":[1,"image-src"],"size":[2]}],[1,"cpsl-spinner",{"size":[2],"speed":[2]}],[1,"cpsl-tab",{"selected":[4],"tab":[1]},[[8,"cpslTabsChanged","onTabsChanged"],[8,"cpslTabsInit","onTabsInit"]]],[1,"cpsl-tabs",{"fullWidth":[4,"full-width"],"selectedTab":[1,"selected-tab"],"selectedTabRect":[32],"loaded":[32]},null,{"fullWidth":["updateSlider"],"selectedTab":["updateTab"]}],[1,"cpsl-text",{"color":[1],"variant":[1],"weight":[1]}],[1,"cpsl-overlay",{"open":[4],"enterTransitionDuration":[2,"enter-transition-duration"],"exitTransitionDuration":[2,"exit-transition-duration"]},null,{"open":["toggleHeight"]}],[1,"cpsl-icon",{"src":[1],"icon":[1]}]]]], options);
|
23
23
|
});
|
24
24
|
|
25
25
|
exports.setNonce = index.setNonce;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-87ba56f9.js');
|
6
6
|
const constants = require('./constants-4bb85cc5.js');
|
7
7
|
const _commonjsHelpers = require('./_commonjsHelpers-b3309d7b.js');
|
8
8
|
|
@@ -4789,7 +4789,7 @@ const CpslDivider = class {
|
|
4789
4789
|
};
|
4790
4790
|
CpslDivider.style = CpslDividerStyle0;
|
4791
4791
|
|
4792
|
-
const cpslDropdownCss = ":host{display:block;position:relative;font-family:Arial, sans-serif;--input-color:var(--cpsl-color-text-primary);--container-background-color:var(--cpsl-color-input-surface-default);--container-border-color:var(--cpsl-color-input-border-active);--scrollbar-color:var(--cpsl-color-text-subtle);--divider-color:var(--cpsl-color-divider);--input-placeholder-color:var(--cpsl-color-text-secondary);--input-font-size:var(--cpsl-font-size-body-m);--button-hover-color:var(--cpsl-color-tile-button-surface-hover);font-family:var(--cpsl-font-family, inherit)}.input-container{position:relative;width:100%}::slotted(cpsl-dropdown){position:absolute;width:100%;top:100%;left:0;z-index:2}.dropdown-button{display:flex;width:100%;padding:0 4px;background:none;border:none;align-items:center;justify-content:space-between;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--input-color)}.dropdown-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}.dropdown-button div{margin-left:8px;display:flex;align-items:center}.dropdown-options{display:none;position:fixed;list-style:none;padding:0;margin-top:4px;border:1px solid var(--container-border-color);border-radius:8px;z-index:999999999999;overflow-y:auto;max-height:300px;box-sizing:border-box;}.dropdown-options.open{display:block}.dropdown-options li{padding:8px;cursor:pointer;display:flex;align-items:center;border-bottom:1px solid var(--cpsl-color-divider);color:var(--input-color);background:var(--container-background-color);font-size:var(--input-font-size)}.dropdown-options li:hover{background-color:var(--button-hover-color)}.dropdown-options li svg{width:24px;height:24px;margin-right:8px;padding:0 8px;vertical-align:middle;}.dropdown-options::-webkit-scrollbar{width:8px;height:8px;background-color:
|
4792
|
+
const cpslDropdownCss = ":host{display:block;position:relative;font-family:Arial, sans-serif;--input-color:var(--cpsl-color-text-primary);--container-background-color:var(--cpsl-color-input-surface-default);--container-border-color:var(--cpsl-color-input-border-active);--scrollbar-color:var(--cpsl-color-text-subtle);--divider-color:var(--cpsl-color-divider);--input-placeholder-color:var(--cpsl-color-text-secondary);--input-font-size:var(--cpsl-font-size-body-m);--button-hover-color:var(--cpsl-color-tile-button-surface-hover);font-family:var(--cpsl-font-family, inherit)}.input-container{position:relative;width:100%}::slotted(cpsl-dropdown){position:absolute;width:100%;top:100%;left:0;z-index:2}.dropdown-button{display:flex;width:100%;padding:0 4px;background:none;border:none;align-items:center;justify-content:space-between;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--input-color)}.dropdown-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}.dropdown-button div{margin-left:8px;display:flex;align-items:center}.dropdown-options{display:none;position:fixed;list-style:none;padding:0;margin-top:4px;border:1px solid var(--container-border-color);border-radius:8px;z-index:999999999999;overflow-y:auto;max-height:300px;box-sizing:border-box;background-color:var(--container-background-color);}.dropdown-options.open{display:block}.dropdown-options li{padding:8px;cursor:pointer;display:flex;align-items:center;border-bottom:1px solid var(--cpsl-color-divider);color:var(--input-color);background:var(--container-background-color);font-size:var(--input-font-size)}.dropdown-options li:hover{background-color:var(--button-hover-color)}.dropdown-options li svg{width:24px;height:24px;margin-right:8px;padding:0 8px;vertical-align:middle;}.dropdown-options::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;}.dropdown-options::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color);border-radius:10px;border:2px solid transparent;background-clip:content-box;height:8px}.dropdown-options::-webkit-scrollbar-track{background:transparent;}.dropdown-value{margin-left:8px;color:var(--cpsl-color-text-secondary)}.dropdown-button .chevron{transition:transform 0.3s ease}.dropdown-button .chevron.closed{transform:rotate(180deg)}.search-bar{padding:0;border-bottom:1px solid var(--cpsl-color-divider);position:sticky;top:0;background:var(--container-background-color);z-index:1;}.search-bar input{width:100%;padding:8px;border:none;box-sizing:border-box;font-size:var(--input-font-size);color:var(--input-color);background-color:var(--container-background-color);border-radius:0;}.search-bar input::placeholder{color:var(--input-placeholder-color)}.search-bar input:focus{outline:none;border-color:transparent;}";
|
4793
4793
|
const CpslDropdownStyle0 = cpslDropdownCss;
|
4794
4794
|
|
4795
4795
|
const CpslDropdown = class {
|
@@ -4799,22 +4799,46 @@ const CpslDropdown = class {
|
|
4799
4799
|
this.toggleDropdown = () => {
|
4800
4800
|
this.isOpen = !this.isOpen;
|
4801
4801
|
};
|
4802
|
-
this.selectItem = (item) => {
|
4802
|
+
this.selectItem = (item, emitEvent = true) => {
|
4803
4803
|
this.selectedItem = item;
|
4804
|
-
this.
|
4805
|
-
|
4804
|
+
this.isOpen = false;
|
4805
|
+
if (emitEvent) {
|
4806
|
+
this.selectedItemChange.emit(this.selectedItem);
|
4807
|
+
}
|
4806
4808
|
};
|
4807
4809
|
this.handleItemSelect = (item) => () => {
|
4808
4810
|
this.selectItem(item);
|
4809
4811
|
};
|
4812
|
+
this.handleSearchQueryChange = (event) => {
|
4813
|
+
const target = event.target;
|
4814
|
+
this.searchQuery = target.value;
|
4815
|
+
this.filteredItems = this.items.filter(item => item.label.toLowerCase().includes(this.searchQuery.toLowerCase()));
|
4816
|
+
};
|
4817
|
+
this.handleClickOutside = (event) => {
|
4818
|
+
if (this.isOpen && !this.el.contains(event.target)) {
|
4819
|
+
this.isOpen = false;
|
4820
|
+
}
|
4821
|
+
};
|
4810
4822
|
this.width = '100%';
|
4823
|
+
this.hasCpslSearch = false;
|
4811
4824
|
this.isOpen = false;
|
4812
|
-
this.
|
4825
|
+
this.searchQuery = '';
|
4826
|
+
this.filteredItems = [];
|
4813
4827
|
this.items = [];
|
4828
|
+
this.selectedItem = null;
|
4829
|
+
}
|
4830
|
+
handleSelectedItemChange(newValue) {
|
4831
|
+
if (newValue !== null) {
|
4832
|
+
this.selectItem(newValue, false);
|
4833
|
+
}
|
4814
4834
|
}
|
4815
4835
|
handleOpenChange() {
|
4816
4836
|
if (this.isOpen) {
|
4817
4837
|
this.adjustPosition();
|
4838
|
+
this.addClickOutsideListener();
|
4839
|
+
}
|
4840
|
+
else {
|
4841
|
+
this.removeClickOutsideListener();
|
4818
4842
|
}
|
4819
4843
|
}
|
4820
4844
|
handleResize() {
|
@@ -4832,20 +4856,36 @@ const CpslDropdown = class {
|
|
4832
4856
|
dropdownOptions.style.left = `${parentRect.x}px`;
|
4833
4857
|
dropdownOptions.style.top = `${parentRect.y + parentRect.height}px`;
|
4834
4858
|
const availableHeight = viewportHeight - parentRect.bottom;
|
4835
|
-
dropdownOptions.style.maxHeight = `${availableHeight -
|
4859
|
+
dropdownOptions.style.maxHeight = `${availableHeight - 8}px`;
|
4836
4860
|
}
|
4837
4861
|
}
|
4862
|
+
addClickOutsideListener() {
|
4863
|
+
window.addEventListener('click', this.handleClickOutside);
|
4864
|
+
}
|
4865
|
+
removeClickOutsideListener() {
|
4866
|
+
window.removeEventListener('click', this.handleClickOutside);
|
4867
|
+
}
|
4838
4868
|
componentWillLoad() {
|
4839
4869
|
if (this.items.length > 0) {
|
4840
|
-
this.
|
4870
|
+
this.filteredItems = [...this.items];
|
4871
|
+
if (this.selectedItem !== null) {
|
4872
|
+
this.selectItem(this.selectedItem, false);
|
4873
|
+
}
|
4874
|
+
else {
|
4875
|
+
this.selectedItem = this.items[0];
|
4876
|
+
}
|
4841
4877
|
}
|
4842
4878
|
}
|
4879
|
+
disconnectedCallback() {
|
4880
|
+
this.removeClickOutsideListener();
|
4881
|
+
}
|
4843
4882
|
render() {
|
4844
4883
|
var _a, _b, _c;
|
4845
|
-
return (index.h(index.Host, { key: '
|
4884
|
+
return (index.h(index.Host, { key: '93306d21ee902e6d21089a161bef7955e01ab2a1', style: { width: this.width } }, index.h("button", { key: 'de614383df91a5684e165f0c3a455c35686fe6de', class: "dropdown-button", onClick: this.toggleDropdown }, `${((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.selectedLabel) || ((_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.label)} ${(_c = this.selectedItem) === null || _c === void 0 ? void 0 : _c.value}`, index.h("div", { key: 'd972fade95a22889977066c652ac3b092d8add58', class: `chevron ${this.isOpen ? '' : 'closed'}`, innerHTML: Icons['chevronUp'] })), index.h("ul", { key: 'd98ac4916d595f13f1126cc912eeaf337cdc7582', class: { 'dropdown-options': true, 'open': this.isOpen }, style: { width: this.width } }, this.hasCpslSearch && (index.h("li", { class: "search-bar" }, index.h("input", { type: "text", placeholder: "Search...", value: this.searchQuery, onInput: this.handleSearchQueryChange }))), this.filteredItems.map(item => index.h("li", { onClick: this.handleItemSelect(item) }, index.h("span", { innerHTML: Icons[item.icon] }), item.label, " ", index.h("span", { class: "dropdown-value" }, item.value))))));
|
4846
4885
|
}
|
4847
4886
|
get el() { return index.getElement(this); }
|
4848
4887
|
static get watchers() { return {
|
4888
|
+
"selectedItem": ["handleSelectedItemChange"],
|
4849
4889
|
"isOpen": ["handleOpenChange"]
|
4850
4890
|
}; }
|
4851
4891
|
};
|
@@ -4876,6 +4916,7 @@ const CpslInput = class {
|
|
4876
4916
|
this.cpslChange = index.createEvent(this, "cpslChange", 7);
|
4877
4917
|
this.cpslBlur = index.createEvent(this, "cpslBlur", 7);
|
4878
4918
|
this.cpslFocus = index.createEvent(this, "cpslFocus", 7);
|
4919
|
+
this.cpslPaste = index.createEvent(this, "cpslPaste", 7);
|
4879
4920
|
this.inputId = `cpsl-input-${inputIds++}`;
|
4880
4921
|
this.onInput = (ev) => {
|
4881
4922
|
const input = ev.target;
|
@@ -4900,6 +4941,18 @@ const CpslInput = class {
|
|
4900
4941
|
this.focusedValue = this.value;
|
4901
4942
|
this.cpslFocus.emit(ev);
|
4902
4943
|
};
|
4944
|
+
this.onPaste = (ev) => {
|
4945
|
+
var _a;
|
4946
|
+
ev.stopPropagation();
|
4947
|
+
ev.preventDefault();
|
4948
|
+
const input = ev.target;
|
4949
|
+
const pasteData = ((_a = ev.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text')) || '';
|
4950
|
+
input.value = pasteData;
|
4951
|
+
this.value = pasteData;
|
4952
|
+
pasteData === '' ? this.disableSlots() : this.enableSlots();
|
4953
|
+
this.cpslPaste.emit(ev);
|
4954
|
+
this.emitValueChange(ev);
|
4955
|
+
};
|
4903
4956
|
this.focusInput = () => {
|
4904
4957
|
this.nativeInput.focus();
|
4905
4958
|
};
|
@@ -4976,7 +5029,7 @@ const CpslInput = class {
|
|
4976
5029
|
}
|
4977
5030
|
render() {
|
4978
5031
|
var _a;
|
4979
|
-
return (index.h(index.Host, { key: '
|
5032
|
+
return (index.h(index.Host, { key: 'd056945f2cfe5bff44af5987d2a9591fb1a3cd4c', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) } }, this.label && (index.h("label", { class: "label", htmlFor: this.inputId }, this.label)), index.h("div", { key: '4599fe40c9ebbaf3c0e21c1cc365325163a1054d', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, index.h("slot", { key: '5404baae8ccc419431f88379e1266fd69ca41670', name: "start" }), index.h("input", { key: '9cab32fee2375ac5e65f41140674275b1c18c039', class: "native-input", id: this.inputId, disabled: this.disabled, 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, type: this.type, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), index.h("slot", { key: '75ab014ee4e8b87375b67dfda539b59833168b46', name: "end" })), (this.errorText || this.helperText) && (index.h("div", { class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, index.h("cpsl-icon", { icon: Boolean(this.errorText) ? 'alertCircle' : 'infoCircle' }), index.h("span", null, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
|
4980
5033
|
}
|
4981
5034
|
get el() { return index.getElement(this); }
|
4982
5035
|
static get watchers() { return {
|