@haiilo/catalyst 10.24.2 → 10.25.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.
- package/dist/catalyst/catalyst.css +11 -0
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/{p-a18011a6.entry.js → p-6475f57c.entry.js} +2 -2
- package/dist/catalyst/p-6475f57c.entry.js.map +1 -0
- package/dist/catalyst/scss/core/_notification.scss +12 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +20 -10
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +2 -2
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-tag/cat-tag.js +36 -8
- package/dist/collection/components/cat-tag/cat-tag.js.map +1 -1
- package/dist/collection/scss/core/_notification.scss +12 -0
- package/dist/components/cat-dropdown2.js +2 -2
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-tag.js +19 -8
- package/dist/components/cat-tag.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +20 -10
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cat-tag/cat-tag.d.ts +6 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +2 -2
- package/dist/catalyst/p-a18011a6.entry.js.map +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use '../variables' as *;
|
|
2
2
|
@use '../mixins' as *;
|
|
3
3
|
|
|
4
|
+
$mobile-side-padding: 0.5rem;
|
|
5
|
+
|
|
4
6
|
.cat-toastify {
|
|
5
7
|
display: flex;
|
|
6
8
|
border-radius: cat-border-radius('l');
|
|
@@ -24,6 +26,16 @@
|
|
|
24
26
|
--cat-secondary-text-active: #{cat-token('color.theme.secondaryInverted.textActive', $wrap: false)};
|
|
25
27
|
background: cat-token('color.ui.background.surfaceInverted');
|
|
26
28
|
}
|
|
29
|
+
|
|
30
|
+
@include until('xs') {
|
|
31
|
+
transform: translate($mobile-side-padding, -1rem) !important;
|
|
32
|
+
width: calc(100% - #{$mobile-side-padding * 2});
|
|
33
|
+
max-width: calc(100% - #{$mobile-side-padding * 2});
|
|
34
|
+
margin-left: 0;
|
|
35
|
+
margin-right: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
}
|
|
27
39
|
}
|
|
28
40
|
|
|
29
41
|
.cat-toastify-wrapper {
|
|
@@ -8559,6 +8559,7 @@ const CatDropdown = class {
|
|
|
8559
8559
|
return; // busy or closed
|
|
8560
8560
|
}
|
|
8561
8561
|
this.isOpen = null;
|
|
8562
|
+
this.trap?.deactivate();
|
|
8562
8563
|
this.content.classList.remove('show');
|
|
8563
8564
|
// give CSS transition time to apply
|
|
8564
8565
|
setTimeout(() => {
|
|
@@ -8566,12 +8567,11 @@ const CatDropdown = class {
|
|
|
8566
8567
|
this.content.classList.remove('show');
|
|
8567
8568
|
this.content.style.display = '';
|
|
8568
8569
|
this.trigger?.setAttribute('aria-expanded', 'false');
|
|
8569
|
-
this.trap?.deactivate();
|
|
8570
8570
|
this.catClose.emit();
|
|
8571
8571
|
}, timeTransitionS);
|
|
8572
8572
|
}
|
|
8573
8573
|
render() {
|
|
8574
|
-
return (index.h(index.Host, { key: '
|
|
8574
|
+
return (index.h(index.Host, { key: '3ead90dae1ac492a0cb592d7cf7a50fd42f26ca7' }, index.h("slot", { key: 'b91bba7772b2a90850be2ac85b82ec7691ae031d', name: "anchor", ref: el => (this.anchorSlot = el) }), index.h("slot", { key: 'f7e07ffed988133cbccafb8f8c73fdb52757d9fb', name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { key: '868a0578cd30cac249959e0961b0425e56048af9', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, index.h("slot", { key: '19fb6b5b92599ed1ae21aac591271957a6e7b060', name: "content" }))));
|
|
8575
8575
|
}
|
|
8576
8576
|
componentDidLoad() {
|
|
8577
8577
|
this.initAnchor();
|
|
@@ -13168,6 +13168,7 @@ const CatTag = class {
|
|
|
13168
13168
|
this.errors = undefined;
|
|
13169
13169
|
this.errorUpdate = 0;
|
|
13170
13170
|
this.tagCreationChars = [' '];
|
|
13171
|
+
this.addOnBlur = false;
|
|
13171
13172
|
}
|
|
13172
13173
|
get id() {
|
|
13173
13174
|
return this.identifier || this._id;
|
|
@@ -13183,13 +13184,7 @@ const CatTag = class {
|
|
|
13183
13184
|
const isInputFocused = this.hostElement.shadowRoot?.activeElement === this.input;
|
|
13184
13185
|
if (['Enter', ...this.tagCreationChars].includes(event.key) && isInputFocused) {
|
|
13185
13186
|
event.preventDefault();
|
|
13186
|
-
|
|
13187
|
-
this.value = [...(this.value ?? []), this.input.value.trim()];
|
|
13188
|
-
this.catChange.emit(this.value);
|
|
13189
|
-
}
|
|
13190
|
-
if (this.input) {
|
|
13191
|
-
this.input.value = '';
|
|
13192
|
-
}
|
|
13187
|
+
this.addInputValue();
|
|
13193
13188
|
}
|
|
13194
13189
|
else if (['Backspace'].includes(event.key) &&
|
|
13195
13190
|
this.input?.selectionStart === 0 &&
|
|
@@ -13213,7 +13208,7 @@ const CatTag = class {
|
|
|
13213
13208
|
}
|
|
13214
13209
|
}
|
|
13215
13210
|
render() {
|
|
13216
|
-
return (index.h(index.Host, { key: '
|
|
13211
|
+
return (index.h(index.Host, { key: '04de7eb41f8c5517c927a416d2d34afd092abed7' }, index.h("div", { key: 'a459eec9bdb227075df6d9ccfc81508ccd60467d', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { key: 'f012f015e602b52ea6b57662bf8f9b3789fbc20d', htmlFor: `tags-${this.id}-input`, part: "label" }, index.h("span", { key: '3302bde705d78c59003650af8c85ad415997b2af', class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { key: '2f8bbb5696d92268d04b162023fdc37a27d62cde', name: "label" })) || this.label, index.h("div", { key: '8804dd6eaf4c8057c5318694d856d3c28d63a812', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { key: '682da9fc4cfb49b945eaf296d63f9774df570efa', class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { key: '860bca7b5fc8cf0c7c555a5e45ce34312362400e', class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.required'), ")"))))))), index.h("div", { key: '04197f0876dac237f865ba4f5948a444a27f2f2e', class: { 'input-wrapper': true, 'input-disabled': this.disabled, 'input-invalid': this.invalid } }, this.value?.map(value => (index.h("div", { class: "tag-pill" }, index.h("span", null, value), !this.disabled && (index.h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: of.catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(value), tabIndex: -1 }))))), index.h("div", { key: 'b85aa4cd1520f4e477d649f9fd8300eb25fe2d3b', class: "input-inner-wrapper" }, index.h("input", { key: 'a4a28b1ca647e68970f1a6e3c6d852df7e43d00d', ...this.nativeAttributes, part: "input", id: `tags-${this.id}-input`, class: "tags-input", role: "combobox", ref: el => (this.input = el), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined, onInput: this.onInput.bind(this), onBlur: this.onBlur.bind(this), placeholder: this.placeholder, disabled: this.disabled }), this.clearable && !this.disabled && (this.value?.length ?? 0) > 0 && (index.h("cat-button", { key: 'e29fdad3d4ad47db287ada8544cf71baa12add40', class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": of.catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.invalid && index.h("cat-icon", { key: '8b443ee821d4dfbdaeec41a945c70d60760ffa42', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }))), this.hasHint && (index.h(CatFormHint, { key: '5f8f1115296726c536849ec4c574e8beaa53b157', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap }))));
|
|
13217
13212
|
}
|
|
13218
13213
|
get hasHint() {
|
|
13219
13214
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -13233,6 +13228,21 @@ const CatTag = class {
|
|
|
13233
13228
|
}
|
|
13234
13229
|
}
|
|
13235
13230
|
}
|
|
13231
|
+
onBlur() {
|
|
13232
|
+
if (this.addOnBlur) {
|
|
13233
|
+
this.addInputValue();
|
|
13234
|
+
}
|
|
13235
|
+
}
|
|
13236
|
+
addInputValue() {
|
|
13237
|
+
const inputValue = this.input?.value.trim();
|
|
13238
|
+
if (inputValue && !this.value?.includes(inputValue)) {
|
|
13239
|
+
this.value = [...(this.value ?? []), inputValue];
|
|
13240
|
+
this.catChange.emit(this.value);
|
|
13241
|
+
}
|
|
13242
|
+
if (this.input) {
|
|
13243
|
+
this.input.value = '';
|
|
13244
|
+
}
|
|
13245
|
+
}
|
|
13236
13246
|
clear() {
|
|
13237
13247
|
this.value = [];
|
|
13238
13248
|
this.catChange.emit(this.value);
|