@haiilo/catalyst 0.10.2 → 0.10.7
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 +1 -1
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/{p-942b9736.entry.js → p-eddcea2b.entry.js} +3 -3
- package/dist/catalyst/p-eddcea2b.entry.js.map +1 -0
- package/dist/catalyst/scss/_variables.scss +1 -1
- package/dist/catalyst/scss/index.scss +52 -0
- package/dist/cjs/cat-alert_21.cjs.entry.js +10 -5
- package/dist/cjs/cat-alert_21.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-button/cat-button.css +10 -10
- package/dist/collection/components/cat-card/cat-card.css +15 -15
- package/dist/collection/components/cat-radio/cat-radio.js +1 -2
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +40 -2
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.css +1 -0
- package/dist/collection/scss/_variables.scss +1 -1
- package/dist/collection/scss/index.scss +52 -0
- package/dist/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.js +1 -1
- package/dist/components/cat-card.js.map +1 -1
- package/dist/components/cat-radio-group.js +10 -3
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +1 -2
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable.js +1 -1
- package/dist/components/cat-scrollable.js.map +1 -1
- package/dist/esm/cat-alert_21.entry.js +10 -5
- package/dist/esm/cat-alert_21.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +3 -0
- package/dist/types/components.d.ts +7 -0
- package/package.json +2 -2
- package/dist/catalyst/p-942b9736.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-card.js","mappings":";;AAAA,MAAM,UAAU,GAAG
|
|
1
|
+
{"file":"cat-card.js","mappings":";;AAAA,MAAM,UAAU,GAAG,m1BAAm1B;;MCWz1BA,SAAO;;;;;;EAClB,MAAM;IACJ,QACE,EAAC,IAAI,QACH,eAAa,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;","names":["CatCard"],"sources":["./src/components/cat-card/cat-card.scss?tag=cat-card&encapsulation=shadow","./src/components/cat-card/cat-card.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n$-padding: 1.25rem;\n\n:host {\n display: block;\n margin-bottom: $cat-body-margin-bottom;\n border-radius: cat-border-radius('l');\n background-color: cat-token('color.ui.background.body');\n padding: $-padding;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n::slotted(nav) {\n margin: #{$cat-body-margin-bottom * 0.5 - $-padding} #{-$-padding} !important;\n}\n\n::slotted(:last-child) {\n margin-bottom: 0;\n}\n\n// --- pull out helper classes\n\n::slotted(.cat-card-pull) {\n margin: -$-padding !important;\n width: calc(100% + #{2 * $-padding}) !important;\n height: calc(100% + #{2 * $-padding}) !important;\n}\n\n::slotted(.cat-card-pull-h) {\n margin-left: -$-padding !important;\n margin-right: -$-padding !important;\n width: calc(100% + #{2 * $-padding}) !important;\n}\n\n::slotted(.cat-card-pull-v) {\n margin-top: -$-padding !important;\n margin-bottom: -$-padding !important;\n height: calc(100% + #{2 * $-padding}) !important;\n}\n\n::slotted(.cat-card-pull-t) {\n margin-top: -$-padding !important;\n}\n\n::slotted(.cat-card-pull-l) {\n margin-left: -$-padding !important;\n}\n\n::slotted(.cat-card-pull-r) {\n margin-right: -$-padding !important;\n}\n\n::slotted(.cat-card-pull-b) {\n margin-bottom: -$-padding !important;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n/**\n * Cards are surfaces that display content and actions on a single topic. They\n * should be easy to scan for relevant and actionable information.\n */\n@Component({\n tag: 'cat-card',\n styleUrl: 'cat-card.scss',\n shadow: true\n})\nexport class CatCard {\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
const catRadioGroupCss = ":host{display:block}:host([hidden]){display:none}";
|
|
4
4
|
|
|
@@ -7,6 +7,7 @@ const CatRadioGroup$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
9
9
|
this.__attachShadow();
|
|
10
|
+
this.catChange = createEvent(this, "catChange", 7);
|
|
10
11
|
this.catRadioGroup = [];
|
|
11
12
|
/**
|
|
12
13
|
* Whether this radio group is disabled.
|
|
@@ -62,8 +63,13 @@ const CatRadioGroup$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
62
63
|
if (catRadioElement && catRadioElement.checked) {
|
|
63
64
|
const catRadioElements = this.catRadioGroup.filter(value => value !== catRadioElement);
|
|
64
65
|
catRadioElements.forEach(value => (value.checked = false));
|
|
65
|
-
this.
|
|
66
|
+
this.value = catRadioElement.value;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.value = undefined;
|
|
66
70
|
}
|
|
71
|
+
this.updateTabIndex();
|
|
72
|
+
this.catChange.emit();
|
|
67
73
|
}
|
|
68
74
|
render() {
|
|
69
75
|
return (h("div", { role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", null)));
|
|
@@ -87,7 +93,8 @@ const CatRadioGroup$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
87
93
|
"name": [1],
|
|
88
94
|
"disabled": [4],
|
|
89
95
|
"a11yLabel": [1, "a11y-label"],
|
|
90
|
-
"labelLeft": [4, "label-left"]
|
|
96
|
+
"labelLeft": [4, "label-left"],
|
|
97
|
+
"value": [1025]
|
|
91
98
|
}, [[0, "keydown", "onKeydown"], [0, "input", "onInput"]]]);
|
|
92
99
|
function defineCustomElement$1() {
|
|
93
100
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-radio-group.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,mDAAmD;;MCO/DA,eAAa;EAL1B
|
|
1
|
+
{"file":"cat-radio-group.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,mDAAmD;;MCO/DA,eAAa;EAL1B;;;;;IAMU,kBAAa,GAA0B,EAAE,CAAC;;;;IAY1C,aAAQ,GAAG,KAAK,CAAC;;;;IAWjB,cAAS,GAAG,KAAK,CAAC;GAqF3B;EAlFC,aAAa,CAAC,OAAgB;IAC5B,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ;MACjC,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC;KACzB,CAAC,CAAC;GACJ;EAGD,iBAAiB,CAAC,QAAiB;IACjC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ;MACjC,IAAI,QAAQ,EAAE;QACZ,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;OAC9B;KACF,CAAC,CAAC;GACJ;EAGD,kBAAkB,CAAC,SAAkB;IACnC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ;MACjC,IAAI,SAAS,EAAE;QACb,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;OAChC;KACF,CAAC,CAAC;GACJ;EAED,gBAAgB;IACd,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC;IAChF,IAAI,CAAC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;;;;;","names":["CatRadioGroup"],"sources":["./src/components/cat-radio-group/cat-radio-group.scss?tag=cat-radio-group&encapsulation=shadow","./src/components/cat-radio-group/cat-radio-group.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cat-radio-group',\n styleUrl: 'cat-radio-group.scss',\n shadow: true\n})\nexport class CatRadioGroup {\n private catRadioGroup: HTMLCatRadioElement[] = [];\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * The name of the radio group component.\n */\n @Prop() name?: string;\n\n /**\n * Whether this radio group is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Adds an accessible label for the radio group that\n * it is only shown in assistive technologies, like screen readers.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Whether the label of the radios should appear to the left of them.\n */\n @Prop() labelLeft = false;\n\n @Watch('name')\n onNameChanged(newName?: string) {\n this.catRadioGroup.forEach(catRadio => {\n catRadio.name = newName;\n });\n }\n\n @Watch('disabled')\n onDisabledChanged(disabled: boolean) {\n this.catRadioGroup.forEach(catRadio => {\n if (disabled) {\n catRadio.disabled = disabled;\n }\n });\n }\n\n @Watch('labelLeft')\n onLabelLeftChanged(labelLeft: boolean) {\n this.catRadioGroup.forEach(catRadio => {\n if (labelLeft) {\n catRadio.labelLeft = labelLeft;\n }\n });\n }\n\n componentDidLoad(): void {\n this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));\n this.onNameChanged(this.name);\n this.onDisabledChanged(this.disabled);\n this.onLabelLeftChanged(this.labelLeft);\n this.updateTabIndex();\n }\n\n @Listen('keydown')\n onKeydown(event: KeyboardEvent): void {\n if (['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(event.key) && this.catRadioGroup.length) {\n const targetElements = this.catRadioGroup.filter(catRadio => !catRadio.disabled);\n const activeElement = document.activeElement as HTMLCatRadioElement;\n const activeIdx = this.catRadioGroup.findIndex(catRadio => catRadio === activeElement);\n const activeOff = ['ArrowDown', 'ArrowRight'].includes(event.key) ? 1 : -1;\n const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;\n targetElements[targetIdx].setFocus();\n targetElements[targetIdx].shadowRoot?.querySelector('input')?.click();\n this.updateTabIndex();\n event.preventDefault();\n }\n }\n\n @Listen('input')\n onInput(event: MouseEvent): void {\n const catRadioElement = this.catRadioGroup.find(value => value === event.target);\n if (catRadioElement && catRadioElement.checked) {\n const catRadioElements = this.catRadioGroup.filter(value => value !== catRadioElement);\n catRadioElements.forEach(value => (value.checked = false));\n this.value = catRadioElement.value;\n } else {\n this.value = undefined;\n }\n this.updateTabIndex();\n this.catChange.emit();\n }\n\n @Prop({ mutable: true }) value?: string;\n\n @Event() catChange!: EventEmitter;\n\n render() {\n return (\n <div role=\"radiogroup\" aria-label={this.a11yLabel}>\n <slot></slot>\n </div>\n );\n }\n\n private updateTabIndex() {\n if (this.catRadioGroup.length) {\n this.catRadioGroup.forEach(value => value.shadowRoot?.querySelector('input')?.setAttribute('tabindex', '-1'));\n const checkedRadioIndex = this.catRadioGroup.findIndex(value => value.checked);\n this.catRadioGroup[checkedRadioIndex >= 0 ? checkedRadioIndex : 0].shadowRoot\n ?.querySelector('input')\n ?.setAttribute('tabindex', '0');\n }\n }\n}\n"],"version":3}
|
|
@@ -64,7 +64,6 @@ const CatRadio$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
64
64
|
}
|
|
65
65
|
onChange(event) {
|
|
66
66
|
this.checked = true;
|
|
67
|
-
this.value = this.input.value;
|
|
68
67
|
this.catChange.emit(event);
|
|
69
68
|
}
|
|
70
69
|
onFocus(event) {
|
|
@@ -82,7 +81,7 @@ const CatRadio$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
82
81
|
"labelHidden": [4, "label-hidden"],
|
|
83
82
|
"name": [1],
|
|
84
83
|
"required": [4],
|
|
85
|
-
"value": [
|
|
84
|
+
"value": [1],
|
|
86
85
|
"hint": [1],
|
|
87
86
|
"labelLeft": [4, "label-left"],
|
|
88
87
|
"hasSlottedLabel": [32],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-radio.js","mappings":";;;;AAAA,MAAM,WAAW,GAAG,w8CAAw8C;;ACI59C,IAAI,YAAY,GAAG,CAAC,CAAC;MAeRA,UAAQ;EALrB;;;;;;;IAMmB,OAAE,GAAG,aAAa,EAAE,YAAY,EAAE,CAAC;IAK3C,oBAAe,GAAG,KAAK,CAAC;;;;IAKR,YAAO,GAAG,KAAK,CAAC;;;;IAKjC,aAAQ,GAAG,KAAK,CAAC;;;;IAKjB,UAAK,GAAG,EAAE,CAAC;;;;IAKX,gBAAW,GAAG,KAAK,CAAC;;;;IAUpB,aAAQ,GAAG,KAAK,CAAC;;;;IAejB,cAAS,GAAG,KAAK,CAAC;GA0F3B;
|
|
1
|
+
{"file":"cat-radio.js","mappings":";;;;AAAA,MAAM,WAAW,GAAG,w8CAAw8C;;ACI59C,IAAI,YAAY,GAAG,CAAC,CAAC;MAeRA,UAAQ;EALrB;;;;;;;IAMmB,OAAE,GAAG,aAAa,EAAE,YAAY,EAAE,CAAC;IAK3C,oBAAe,GAAG,KAAK,CAAC;;;;IAKR,YAAO,GAAG,KAAK,CAAC;;;;IAKjC,aAAQ,GAAG,KAAK,CAAC;;;;IAKjB,UAAK,GAAG,EAAE,CAAC;;;;IAKX,gBAAW,GAAG,KAAK,CAAC;;;;IAUpB,aAAQ,GAAG,KAAK,CAAC;;;;IAejB,cAAS,GAAG,KAAK,CAAC;GA0F3B;EAzEC,mBAAmB;IACjB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1E,IAAI,CAAC,IAAI,CAAC,KAA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C,KAAK,CAC9D,CACD,EACP,IAAI,CAAC,WAAW,CACZ,EACP;GACH;EAED,IAAY,WAAW;IACrB,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IACzE,QACE,CAAC,IAAI,CAAC,IAAI,IAAI,cAAc,MAC1B,EAAC,WAAW,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ,GAAI,CAC3F,EACD;GACH;EAEO,QAAQ,CAAC,KAAY;IAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC5B;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC3B;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatRadio","log"],"sources":["./src/components/cat-radio/cat-radio.scss?tag=cat-radio&encapsulation=shadow","./src/components/cat-radio/cat-radio.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'src/components/cat-form-hint/cat-form-hint';\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nlabel {\n display: flex;\n gap: 0.5rem;\n @include cat-body('m');\n cursor: pointer;\n}\n\n.label-left {\n flex-direction: row-reverse;\n}\n\n.radio {\n display: flex;\n position: relative;\n}\n\n.circle {\n position: absolute;\n width: calc(cat-size('xs') / 2);\n height: calc(cat-size('xs') / 2);\n background-color: cat-token('color.theme.primary.bg');\n border-radius: 10rem;\n top: calc(50% - cat-size('xs') / 4);\n left: calc(50% - cat-size('xs') / 4);\n visibility: hidden;\n}\n\ninput {\n margin: 0;\n width: calc(cat-size('m') / 2);\n height: calc(cat-size('m') / 2);\n appearance: none;\n background-color: cat-token('color.ui.background.input');\n border: 1px solid cat-token('color.ui.border.input');\n border-radius: 10rem;\n cursor: inherit;\n\n &:checked {\n border-color: cat-token('color.theme.primary.bg');\n\n + .circle {\n visibility: visible;\n }\n }\n\n &:focus-visible {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n}\n\n.label {\n flex: 1 1 auto;\n\n .is-hidden & {\n @include cat-visually-hidden;\n }\n}\n\n.is-disabled {\n cursor: not-allowed;\n color: cat-token('color.ui.font.muted');\n\n input {\n background-color: cat-token('color.ui.background.inputDisabled');\n\n &:checked {\n border-color: cat-token('color.ui.border.input');\n }\n }\n\n .circle {\n background-color: cat-token('color.ui.border.input');\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Radio Buttons are graphical interface elements that allow user to choose\n * only one of a predefined set of mutually exclusive options.\n *\n * @slot hint - Optional hint element to be displayed with the radio.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-radio',\n styleUrl: 'cat-radio.scss',\n shadow: true\n})\nexport class CatRadio {\n private readonly id = `cat-radio-${++nextUniqueId}`;\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Whether this radio is checked.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Whether this radio is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The label of the radio that is visible.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the radio component.\n */\n @Prop() name?: string;\n\n /**\n * Whether the radio is required.\n */\n @Prop() required = false;\n\n /**\n * The value of the radio component.\n */\n @Prop() value?: string;\n\n /**\n * Optional hint text(s) to be displayed with the radio.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the radio component.\n */\n @Prop() labelLeft = false;\n\n /**\n * Emitted when the radio is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the radio received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the radio loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on radio', this);\n }\n }\n\n /**\n * Sets focus on the radio. Use this method instead of `radio.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n role=\"radio\"\n aria-checked={this.checked ? 'true' : 'false'}\n >\n <span class=\"radio\">\n <input\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"radio\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onInput={this.onChange.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"circle\"></span>\n </span>\n <span class=\"label\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hintSection}\n </Host>\n );\n }\n\n private get hintSection() {\n const hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n return (\n (this.hint || hasSlottedHint) && (\n <CatFormHint hint={this.hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n )\n );\n }\n\n private onChange(event: Event) {\n this.checked = true;\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"],"version":3}
|
|
@@ -1220,7 +1220,7 @@ function takeUntil(notifier) {
|
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
|
-
const catScrollableCss = ":host{overflow:hidden;position:relative;display:flex}:host([hidden]){display:none}.shadow-bottom,.shadow-right,.shadow-left,.shadow-top{position:absolute;transition:box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)}.shadow-top{z-index:2;width:100%;top:0}.shadow-left{z-index:4;height:100%;left:0}.shadow-right{z-index:4;height:100%;right:0}.shadow-bottom{z-index:2;width:100%;bottom:0}.scrollable-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.scrollable-wrapper.cat-scrollable-top .shadow-top,.scrollable-wrapper.cat-scrollable-bottom .shadow-bottom,.scrollable-wrapper.cat-scrollable-left .shadow-left,.scrollable-wrapper.cat-scrollable-right .shadow-right{box-shadow:0 0 4px 1px rgba(16, 29, 48, 0.2)}.scrollable-content{overflow:hidden;white-space:nowrap}.scrollable-content.scroll-x{overflow-x:auto}.scrollable-content.scroll-y{overflow-y:auto}.scrollable-content.no-overscroll{overscroll-behavior:contain}";
|
|
1223
|
+
const catScrollableCss = ":host{overflow:hidden;position:relative;display:flex}:host([hidden]){display:none}.shadow-bottom,.shadow-right,.shadow-left,.shadow-top{position:absolute;transition:box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)}.shadow-top{z-index:2;width:100%;top:0}.shadow-left{z-index:4;height:100%;left:0}.shadow-right{z-index:4;height:100%;right:0}.shadow-bottom{z-index:2;width:100%;bottom:0}.scrollable-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.scrollable-wrapper.cat-scrollable-top .shadow-top,.scrollable-wrapper.cat-scrollable-bottom .shadow-bottom,.scrollable-wrapper.cat-scrollable-left .shadow-left,.scrollable-wrapper.cat-scrollable-right .shadow-right{box-shadow:0 0 4px 1px rgba(16, 29, 48, 0.2)}.scrollable-content{width:100%;overflow:hidden;white-space:nowrap}.scrollable-content.scroll-x{overflow-x:auto}.scrollable-content.scroll-y{overflow-y:auto}.scrollable-content.no-overscroll{overscroll-behavior:contain}";
|
|
1224
1224
|
|
|
1225
1225
|
const CatScrollable$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
1226
1226
|
constructor() {
|