@rededor/cura 1.6.1-alpha.0 → 1.6.1-alpha.2
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/cura-accordion_18.cjs.entry.js +23 -4
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +3 -2
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.js +27 -2
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +19 -6
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -1
- package/dist/collection/components/cura-card/cura-card.stories.js +56 -25
- package/dist/collection/components/cura-card/cura-card.stories.js.map +1 -1
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js +6 -1
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +17 -3
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/collection/stories/blocks/index.js +9 -0
- package/dist/components/cura-calendar2.js +4 -2
- package/dist/components/cura-calendar2.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +6 -1
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-select2.js +17 -3
- package/dist/components/cura-select2.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/{p-2090e71a.entry.js → p-75f6e652.entry.js} +2 -2
- package/dist/cura/p-75f6e652.entry.js.map +1 -0
- package/dist/cura/p-e5abb2a4.entry.js +2 -0
- package/dist/cura/p-e5abb2a4.entry.js.map +1 -0
- package/dist/esm/cura-accordion_18.entry.js +23 -4
- package/dist/esm/cura-accordion_18.entry.js.map +1 -1
- package/dist/esm/cura-calendar.entry.js +3 -2
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +7 -0
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +11 -3
- package/dist/types/components/cura-card/cura-card.stories.d.ts +7 -98
- package/dist/types/components/cura-dropdown-search/cura-dropdown-search.d.ts +1 -0
- package/dist/types/components/forms/cura-select/cura-select.d.ts +3 -0
- package/dist/types/components.d.ts +12 -0
- package/package.json +15 -11
- package/dist/cura/p-2090e71a.entry.js.map +0 -1
- package/dist/cura/p-5b928e46.entry.js +0 -2
- package/dist/cura/p-5b928e46.entry.js.map +0 -1
|
@@ -672,8 +672,13 @@ const CuraDropdownSearch = class {
|
|
|
672
672
|
setTimeout(() => this.getSlotElements(), 10);
|
|
673
673
|
}
|
|
674
674
|
disconnectedCallback() {
|
|
675
|
+
this.removeAllListeners();
|
|
676
|
+
}
|
|
677
|
+
removeAllListeners() {
|
|
675
678
|
window === null || window === void 0 ? void 0 : window.removeEventListener('resize', this.handleWindowResize);
|
|
676
679
|
window === null || window === void 0 ? void 0 : window.removeEventListener('orientationchange', this.handleWindowResize);
|
|
680
|
+
this.host.removeEventListener('actionclick', this.handleOptionActionClick);
|
|
681
|
+
this.host.removeEventListener('selectoption', this.handleSelectOption);
|
|
677
682
|
}
|
|
678
683
|
moveHighlight(direction) {
|
|
679
684
|
if (!this.dropdownSelectableItems.length)
|
|
@@ -795,7 +800,7 @@ const CuraDropdownSearch = class {
|
|
|
795
800
|
};
|
|
796
801
|
}
|
|
797
802
|
render() {
|
|
798
|
-
return (index.h(index.Host, { key: '
|
|
803
|
+
return (index.h(index.Host, { key: 'e56264957327983c9a06eefe7f723b17d241c477', style: this.getHostCSSProperties() }, index.h("div", { key: '311a1facd2b0e9366f00b47e35bbcaa3d2a754dd', class: this.getClasses(), style: this.styles }, index.h("div", { key: 'd6f5345eaea63036c6855ee778ec1edefa5d20f7', class: "component-controls" }, this.isMobile && this.zoomState ? (index.h("cura-button-transparent", { fontColor: "dark", onClick: () => this.handleBackClick(), iconName: "arrowLeft", size: "large", iconOnly: true, color: "primary", id: "button-back" })) : '', index.h("cura-input-text", { key: '07887def77a37d0cd8ca9f3f044024cb07dbca9e', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: this.zoomState ? 'transparent' : 'default', required: this.required, iconName: this.icon || 'search', value: this.value, status: this.status, onValueChange: (ev) => this.handleInputValueChange(ev), onInput: (ev) => this._preventEvent(ev), onFocus: () => this.handleFocus(), onClick: (ev) => this._preventEvent(ev), onBlur: () => this.handleBlur(), onFocusout: () => this.handleFocusout(), onInputClear: (ev) => this.handleInputClear(ev), placeholder: this.placeholder, size: this.size, onKeyDown: (ev) => this.handleKeyDown(ev) }, index.h("slot", { key: 'e55d3c7ad869262f7663e85c6c12ccaeef66f9d0', name: "helperText" }))), index.h("div", { key: 'bd2ee09236489e4b8652b7e87ffd248967c372e9', class: "dropdown-container", onMouseOver: () => this.handleDropdownMouseOver() }, index.h("slot", { key: 'a15f32c8fc3d9646f84f3e9a25ab32a353e0b194', onSlotchange: () => this.handleSlotChange() })))));
|
|
799
804
|
}
|
|
800
805
|
get host() { return index.getElement(this); }
|
|
801
806
|
};
|
|
@@ -5210,6 +5215,12 @@ const CuraSelect = class {
|
|
|
5210
5215
|
return this.onOptiselected(event);
|
|
5211
5216
|
this.isOpen = !this.isOpen;
|
|
5212
5217
|
};
|
|
5218
|
+
this.handleClickOutside = (event) => {
|
|
5219
|
+
const clickedOutside = !this.host.contains(event.target);
|
|
5220
|
+
if (clickedOutside) {
|
|
5221
|
+
this.isOpen = false;
|
|
5222
|
+
}
|
|
5223
|
+
};
|
|
5213
5224
|
this.label = '';
|
|
5214
5225
|
this.placeholder = '';
|
|
5215
5226
|
this.value = '';
|
|
@@ -5296,6 +5307,7 @@ const CuraSelect = class {
|
|
|
5296
5307
|
*/
|
|
5297
5308
|
componentDidLoad() {
|
|
5298
5309
|
this.setupMutationObserver();
|
|
5310
|
+
this.addOutsideClickListener();
|
|
5299
5311
|
}
|
|
5300
5312
|
/**
|
|
5301
5313
|
* Lifecycle method called when the component is connected to the DOM.
|
|
@@ -5311,6 +5323,7 @@ const CuraSelect = class {
|
|
|
5311
5323
|
disconnectedCallback() {
|
|
5312
5324
|
var _a;
|
|
5313
5325
|
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
5326
|
+
this.removeOutsideClickListener();
|
|
5314
5327
|
}
|
|
5315
5328
|
initializeOptions() {
|
|
5316
5329
|
var _a;
|
|
@@ -5434,14 +5447,20 @@ const CuraSelect = class {
|
|
|
5434
5447
|
const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];
|
|
5435
5448
|
return index.h("cura-icon", { class: "feedback-icon", name: icon, iconset: "default", size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles });
|
|
5436
5449
|
}
|
|
5450
|
+
addOutsideClickListener() {
|
|
5451
|
+
document.addEventListener('click', this.handleClickOutside);
|
|
5452
|
+
}
|
|
5453
|
+
removeOutsideClickListener() {
|
|
5454
|
+
document.removeEventListener('click', this.handleClickOutside);
|
|
5455
|
+
}
|
|
5437
5456
|
render() {
|
|
5438
|
-
return (index.h(index.Host, { key: '
|
|
5457
|
+
return (index.h(index.Host, { key: '21289e8335a2dab29d78e1f6b689734a68c51f9a', style: this.styles }, index.h("div", { key: 'c9ff2b904c184f175fe8c354f38f79e9af613e55', class: this.getClasses(), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onClick: this.handleClick }, this.label && (index.h("cura-label", { key: 'ddd53f876c004b0da13cd5d418f33fc36b1d3fb5', class: "label", weight: "bold", size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && index.h("span", { key: 'c884cddfc967c5a9237f745fc14bef84a17403b7', class: "required" }, "* "))), index.h("div", { key: 'b97ff9564365911abe82914b120276755621e654', class: {
|
|
5439
5458
|
'cura-input-field': true,
|
|
5440
5459
|
'open': this.isOpen,
|
|
5441
|
-
} }, this.renderIcon(), index.h("input", { key: '
|
|
5460
|
+
} }, this.renderIcon(), index.h("input", { key: 'dc25c38fea06923ddeee5eff05dbcc380b72a1ba', type: "text", autocomplete: "off", onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), onKeyDown: this.handleKeyNavigation, "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error'), onInput: this.handleInputChange, style: this.styles, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.textInput, readonly: this.searchBehavior ? null : true }), index.h("button", { key: 'fef9e0aa81875cc558d7732c45da93043e4f6ef4', class: "up-down-button" }, index.h("cura-icon", { key: '79200899e32a5ac4b4759e0589c1faddced68103', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: "default" }))), index.h("cura-label", { key: '8d46fa4bc5f61d7fb8e84a0626d4f79e6687ff9f', class: "helper-text", size: "xsmall", color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, index.h("slot", { key: '9a42d25acea3e8320e6639545c5a550192224824' })), this.isOpen && (index.h("div", { key: '657fc9d3fc88f946dfd33fc85b2c1b8f074231ad', class: {
|
|
5442
5461
|
menu: true,
|
|
5443
5462
|
open: this.isOpen,
|
|
5444
|
-
} }, index.h("slot", { key: '
|
|
5463
|
+
} }, index.h("slot", { key: '6e18ba370c1eaef8b2cae03405bc1dc716633ec5', name: "option" }))))));
|
|
5445
5464
|
}
|
|
5446
5465
|
static get formAssociated() { return true; }
|
|
5447
5466
|
get host() { return index.getElement(this); }
|