@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
|
@@ -668,8 +668,13 @@ const CuraDropdownSearch = class {
|
|
|
668
668
|
setTimeout(() => this.getSlotElements(), 10);
|
|
669
669
|
}
|
|
670
670
|
disconnectedCallback() {
|
|
671
|
+
this.removeAllListeners();
|
|
672
|
+
}
|
|
673
|
+
removeAllListeners() {
|
|
671
674
|
window === null || window === void 0 ? void 0 : window.removeEventListener('resize', this.handleWindowResize);
|
|
672
675
|
window === null || window === void 0 ? void 0 : window.removeEventListener('orientationchange', this.handleWindowResize);
|
|
676
|
+
this.host.removeEventListener('actionclick', this.handleOptionActionClick);
|
|
677
|
+
this.host.removeEventListener('selectoption', this.handleSelectOption);
|
|
673
678
|
}
|
|
674
679
|
moveHighlight(direction) {
|
|
675
680
|
if (!this.dropdownSelectableItems.length)
|
|
@@ -791,7 +796,7 @@ const CuraDropdownSearch = class {
|
|
|
791
796
|
};
|
|
792
797
|
}
|
|
793
798
|
render() {
|
|
794
|
-
return (h(Host, { key: '
|
|
799
|
+
return (h(Host, { key: 'e56264957327983c9a06eefe7f723b17d241c477', style: this.getHostCSSProperties() }, h("div", { key: '311a1facd2b0e9366f00b47e35bbcaa3d2a754dd', class: this.getClasses(), style: this.styles }, h("div", { key: 'd6f5345eaea63036c6855ee778ec1edefa5d20f7', class: "component-controls" }, this.isMobile && this.zoomState ? (h("cura-button-transparent", { fontColor: "dark", onClick: () => this.handleBackClick(), iconName: "arrowLeft", size: "large", iconOnly: true, color: "primary", id: "button-back" })) : '', 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) }, h("slot", { key: 'e55d3c7ad869262f7663e85c6c12ccaeef66f9d0', name: "helperText" }))), h("div", { key: 'bd2ee09236489e4b8652b7e87ffd248967c372e9', class: "dropdown-container", onMouseOver: () => this.handleDropdownMouseOver() }, h("slot", { key: 'a15f32c8fc3d9646f84f3e9a25ab32a353e0b194', onSlotchange: () => this.handleSlotChange() })))));
|
|
795
800
|
}
|
|
796
801
|
get host() { return getElement(this); }
|
|
797
802
|
};
|
|
@@ -5206,6 +5211,12 @@ const CuraSelect = class {
|
|
|
5206
5211
|
return this.onOptiselected(event);
|
|
5207
5212
|
this.isOpen = !this.isOpen;
|
|
5208
5213
|
};
|
|
5214
|
+
this.handleClickOutside = (event) => {
|
|
5215
|
+
const clickedOutside = !this.host.contains(event.target);
|
|
5216
|
+
if (clickedOutside) {
|
|
5217
|
+
this.isOpen = false;
|
|
5218
|
+
}
|
|
5219
|
+
};
|
|
5209
5220
|
this.label = '';
|
|
5210
5221
|
this.placeholder = '';
|
|
5211
5222
|
this.value = '';
|
|
@@ -5292,6 +5303,7 @@ const CuraSelect = class {
|
|
|
5292
5303
|
*/
|
|
5293
5304
|
componentDidLoad() {
|
|
5294
5305
|
this.setupMutationObserver();
|
|
5306
|
+
this.addOutsideClickListener();
|
|
5295
5307
|
}
|
|
5296
5308
|
/**
|
|
5297
5309
|
* Lifecycle method called when the component is connected to the DOM.
|
|
@@ -5307,6 +5319,7 @@ const CuraSelect = class {
|
|
|
5307
5319
|
disconnectedCallback() {
|
|
5308
5320
|
var _a;
|
|
5309
5321
|
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
5322
|
+
this.removeOutsideClickListener();
|
|
5310
5323
|
}
|
|
5311
5324
|
initializeOptions() {
|
|
5312
5325
|
var _a;
|
|
@@ -5430,14 +5443,20 @@ const CuraSelect = class {
|
|
|
5430
5443
|
const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];
|
|
5431
5444
|
return h("cura-icon", { class: "feedback-icon", name: icon, iconset: "default", size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles });
|
|
5432
5445
|
}
|
|
5446
|
+
addOutsideClickListener() {
|
|
5447
|
+
document.addEventListener('click', this.handleClickOutside);
|
|
5448
|
+
}
|
|
5449
|
+
removeOutsideClickListener() {
|
|
5450
|
+
document.removeEventListener('click', this.handleClickOutside);
|
|
5451
|
+
}
|
|
5433
5452
|
render() {
|
|
5434
|
-
return (h(Host, { key: '
|
|
5453
|
+
return (h(Host, { key: '21289e8335a2dab29d78e1f6b689734a68c51f9a', style: this.styles }, h("div", { key: 'c9ff2b904c184f175fe8c354f38f79e9af613e55', class: this.getClasses(), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onClick: this.handleClick }, this.label && (h("cura-label", { key: 'ddd53f876c004b0da13cd5d418f33fc36b1d3fb5', class: "label", weight: "bold", size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && h("span", { key: 'c884cddfc967c5a9237f745fc14bef84a17403b7', class: "required" }, "* "))), h("div", { key: 'b97ff9564365911abe82914b120276755621e654', class: {
|
|
5435
5454
|
'cura-input-field': true,
|
|
5436
5455
|
'open': this.isOpen,
|
|
5437
|
-
} }, this.renderIcon(), h("input", { key: '
|
|
5456
|
+
} }, this.renderIcon(), 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 }), h("button", { key: 'fef9e0aa81875cc558d7732c45da93043e4f6ef4', class: "up-down-button" }, 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" }))), h("cura-label", { key: '8d46fa4bc5f61d7fb8e84a0626d4f79e6687ff9f', class: "helper-text", size: "xsmall", color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, h("slot", { key: '9a42d25acea3e8320e6639545c5a550192224824' })), this.isOpen && (h("div", { key: '657fc9d3fc88f946dfd33fc85b2c1b8f074231ad', class: {
|
|
5438
5457
|
menu: true,
|
|
5439
5458
|
open: this.isOpen,
|
|
5440
|
-
} }, h("slot", { key: '
|
|
5459
|
+
} }, h("slot", { key: '6e18ba370c1eaef8b2cae03405bc1dc716633ec5', name: "option" }))))));
|
|
5441
5460
|
}
|
|
5442
5461
|
static get formAssociated() { return true; }
|
|
5443
5462
|
get host() { return getElement(this); }
|