@haiilo/catalyst 3.0.2 → 4.1.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.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/p-8d6a31b9.entry.js +10 -0
- package/dist/catalyst/p-8d6a31b9.entry.js.map +1 -0
- package/dist/catalyst/p-919eea27.js +3 -0
- package/dist/catalyst/p-919eea27.js.map +1 -0
- package/dist/catalyst/p-ccfebe33.js.map +1 -1
- package/dist/cjs/cat-alert_24.cjs.entry.js +129 -28
- package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
- package/dist/cjs/cat-icon-registry-671af264.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +2 -2
- package/dist/cjs/{index-22e41d18.js → index-c4542095.js} +65 -4
- package/dist/cjs/index-c4542095.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/cat-button/cat-button.js +17 -2
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +16 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js +13 -0
- package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js.map +1 -0
- package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +244 -8
- package/dist/collection/components/cat-input/cat-input.js +101 -13
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +16 -1
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.css +252 -0
- package/dist/collection/components/cat-select/cat-select.js +95 -9
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.css +261 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +102 -10
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +16 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/components/cat-button2.js +3 -2
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +2 -1
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-form-hint-utils.js +17 -0
- package/dist/components/cat-form-hint-utils.js.map +1 -0
- package/dist/components/cat-form-hint.js +2 -1
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-input.js +43 -9
- package/dist/components/cat-input.js.map +1 -1
- package/dist/components/cat-radio.js +2 -1
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-select2.js +40 -9
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-textarea.js +50 -7
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +2 -1
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/esm/cat-alert_24.entry.js +129 -28
- package/dist/esm/cat-alert_24.entry.js.map +1 -1
- package/dist/esm/cat-icon-registry-d6b80490.js.map +1 -1
- package/dist/esm/catalyst.js +2 -2
- package/dist/esm/{index-7b85fb91.js → index-524906f7.js} +65 -4
- package/dist/esm/index-524906f7.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/cat-button/cat-button.d.ts +6 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +6 -0
- package/dist/types/components/cat-form-hint/cat-form-hint-utils.d.ts +4 -0
- package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +1 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +1 -1
- package/dist/types/components/cat-input/cat-input.d.ts +27 -1
- package/dist/types/components/cat-radio/cat-radio.d.ts +6 -0
- package/dist/types/components/cat-select/cat-select.d.ts +28 -2
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +27 -1
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +6 -0
- package/dist/types/components.d.ts +105 -0
- package/package.json +3 -2
- package/dist/catalyst/p-1c6eace6.js +0 -3
- package/dist/catalyst/p-1c6eace6.js.map +0 -1
- package/dist/catalyst/p-6865acc8.entry.js +0 -10
- package/dist/catalyst/p-6865acc8.entry.js.map +0 -1
- package/dist/cjs/index-22e41d18.js.map +0 -1
- package/dist/esm/index-7b85fb91.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;EALtB;IAWW,cAAS,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACK,YAAO,GAAmC,UAAU,CAAC;IAE7D;;OAEG;IACK,UAAK,GAA+D,WAAW,CAAC;IAExF;;OAEG;IACK,WAAM,GAAG,KAAK,CAAC;IAEvB;;OAEG;IACK,SAAI,GAAkC,GAAG,CAAC;IAgBlD;;;OAGG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;;;OAIG;IACK,YAAO,GAAG,KAAK,CAAC;IAExB;;OAEG;IACK,WAAM,GAAG,KAAK,CAAC;IAEvB;;OAEG;IACK,eAAU,GAAG,KAAK,CAA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,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: true\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'secondary';\n\n /**\n * Set the button into an active state.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * The SVG source of an icon to be displayed in the button. This takes\n * precenedence over the `icon` name.\n */\n @Prop() iconSrc?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: string;\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n /**\n * Programmatically move focus to the button. Use this method instead of\n * `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\n }\n\n render() {\n if (this.url) {\n return (\n <a\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n );\n } else {\n return (\n <button\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize} part=\"prefix\"></cat-icon>\n ) : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\">\n <slot></slot>\n </span>\n ),\n this.hasSuffixIcon ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize} part=\"suffix\"></cat-icon>\n ) : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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"]}
|
|
1
|
+
{"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: true\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'secondary';\n\n /**\n * Set the button into an active state.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * The SVG source of an icon to be displayed in the button. This takes\n * precenedence over the `icon` name.\n */\n @Prop() iconSrc?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: string;\n\n /**\n * Attributes that will be added to the native HTML button element\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n /**\n * Programmatically move focus to the button. Use this method instead of\n * `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\n }\n\n render() {\n if (this.url) {\n return (\n <a\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n );\n } else {\n return (\n <button\n {...this.nativeAttributes}\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n aria-current={this.a11yCurrent}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize} part=\"prefix\"></cat-icon>\n ) : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\">\n <slot></slot>\n </span>\n ),\n this.hasSuffixIcon ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize} part=\"suffix\"></cat-icon>\n ) : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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"]}
|
|
@@ -84,7 +84,7 @@ export class CatCheckbox {
|
|
|
84
84
|
render() {
|
|
85
85
|
return (h(Host, null,
|
|
86
86
|
h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } },
|
|
87
|
-
h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }),
|
|
87
|
+
h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })),
|
|
88
88
|
h("span", { class: "box", "aria-hidden": "true", part: "checkbox" },
|
|
89
89
|
h("svg", { class: "check", viewBox: "0 0 12 10" },
|
|
90
90
|
h("polyline", { points: "1.5 6 4.5 9 10.5 1" })),
|
|
@@ -312,6 +312,21 @@ export class CatCheckbox {
|
|
|
312
312
|
"attribute": "label-left",
|
|
313
313
|
"reflect": false,
|
|
314
314
|
"defaultValue": "false"
|
|
315
|
+
},
|
|
316
|
+
"nativeAttributes": {
|
|
317
|
+
"type": "unknown",
|
|
318
|
+
"mutable": false,
|
|
319
|
+
"complexType": {
|
|
320
|
+
"original": "{ [key: string]: string }",
|
|
321
|
+
"resolved": "undefined | { [key: string]: string; }",
|
|
322
|
+
"references": {}
|
|
323
|
+
},
|
|
324
|
+
"required": false,
|
|
325
|
+
"optional": true,
|
|
326
|
+
"docs": {
|
|
327
|
+
"tags": [],
|
|
328
|
+
"text": "Attributes that will be added to the native HTML input element."
|
|
329
|
+
}
|
|
315
330
|
}
|
|
316
331
|
}; }
|
|
317
332
|
static get states() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;EALxB;IAMmB,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;IAS/C,oBAAe,GAAG,KAAK,CAAC;IAEjC;;OAEG;IACsB,YAAO,GAAG,KAAK,CAAC;IAEzC;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAOzB;;OAEG;IACK,kBAAa,GAAG,KAAK,CAAC;IAE9B;;OAEG;IACK,UAAK,GAAG,EAAE,CAAC;IAEnB;;OAEG;IACK,gBAAW,GAAG,KAAK,CAAC;IAO5B;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAYzB;;OAEG;IACK,cAAS,GAAG,KAAK,CAAC;
|
|
1
|
+
{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C,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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 * Checkboxes are used to let a user choose one or more options from a limited\n * number of options.\n *\n * @slot hint - Optional hint element to be displayed with the checkbox.\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 checkbox - The checkbox element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\n shadow: true\n})\nexport class CatCheckbox {\n private readonly _id = `cat-checkbox-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Checked state of the checkbox\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop() indeterminate = false;\n\n /**\n * Label of the checkbox which is presented in the UI\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 input\n */\n @Prop() name?: string;\n\n /**\n * Required state of the checkbox\n */\n @Prop() required = false;\n\n /**\n * The value of the checkbox\n */\n @Prop({ mutable: true }) value?: string | boolean;\n\n /**\n * Optional hint text(s) to be displayed with the checkbox.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the checkbox.\n */\n @Prop() labelLeft = false;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the checked status of the checkbox is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the checkbox received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad() {\n if (this.input && this.indeterminate) {\n this.input.indeterminate = true;\n }\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Programmatically move focus to the checkbox. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the checkbox. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the checkbox.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\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 >\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value !== undefined ? String(this.value) : this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"box\" aria-hidden=\"true\" part=\"checkbox\">\n <svg class=\"check\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n <svg class=\"dash\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 5 10.5 5\"></polyline>\n </svg>\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 onInput(event: Event) {\n this.checked = this.input.checked;\n\n if (!this.value || typeof this.value === 'boolean') {\n this.value = this.checked;\n }\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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { CatFormHint } from './cat-form-hint';
|
|
3
|
+
import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';
|
|
4
|
+
export function buildHintSection(hostElement, id, hint, errorMap) {
|
|
5
|
+
const errors = Object.entries(errorMap || {});
|
|
6
|
+
if (errors.length) {
|
|
7
|
+
return (h("div", { id: id + '-hint' }, errors.map(([key, params]) => (h(CatFormHint, { hint: i18n.t(`error.${key}`, params), class: "cat-text-danger" })))));
|
|
8
|
+
}
|
|
9
|
+
const hasSlottedHint = !!hostElement.querySelector('[slot="hint"]');
|
|
10
|
+
return ((hint || hasSlottedHint) && (h("div", { id: id + '-hint' },
|
|
11
|
+
h(CatFormHint, { hint: hint, slottedHint: hasSlottedHint && h("slot", { name: "hint" }) }))));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=cat-form-hint-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cat-form-hint-utils.js","sourceRoot":"","sources":["../../../src/components/cat-form-hint/cat-form-hint-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAKxE,MAAM,UAAU,gBAAgB,CAC9B,WAAwB,EACxB,EAAU,EACV,IAAmC,EACnC,QAA8B;EAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;EAC9C,IAAI,MAAM,CAAC,MAAM,EAAE;IACjB,OAAO,CACL,WAAK,EAAE,EAAE,EAAE,GAAG,OAAO,IAClB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAC7B,EAAC,WAAW,IAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,KAAK,EAAC,iBAAiB,GAAG,CAC9E,CAAC,CACE,CACP,CAAC;GACH;EAED,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;EACpE,OAAO,CACL,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAC1B,WAAK,EAAE,EAAE,EAAE,GAAG,OAAO;IACnB,EAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ,GAAI,CACjF,CACP,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { CatFormHint } from './cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ErrorMap = { [key: string]: any };\n\nexport function buildHintSection(\n hostElement: HTMLElement,\n id: string,\n hint: string | string[] | undefined,\n errorMap: ErrorMap | undefined\n) {\n const errors = Object.entries(errorMap || {});\n if (errors.length) {\n return (\n <div id={id + '-hint'}>\n {errors.map(([key, params]) => (\n <CatFormHint hint={i18n.t(`error.${key}`, params)} class=\"cat-text-danger\" />\n ))}\n </div>\n );\n }\n\n const hasSlottedHint = !!hostElement.querySelector('[slot=\"hint\"]');\n return (\n (hint || hasSlottedHint) && (\n <div id={id + '-hint'}>\n <CatFormHint hint={hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n </div>\n )\n );\n}\n"]}
|
|
@@ -6,10 +6,11 @@ import { h } from '@stencil/core';
|
|
|
6
6
|
* @return a JSX.Element
|
|
7
7
|
*/
|
|
8
8
|
export const CatFormHint = props => {
|
|
9
|
+
var _a;
|
|
9
10
|
const { hint, slottedHint } = props;
|
|
10
11
|
return (h("div", { class: "hint-section" }, [
|
|
11
12
|
hint &&
|
|
12
|
-
(Array.isArray(hint) ? hint.map(item => h("p", { class:
|
|
13
|
+
(Array.isArray(hint) ? (hint.map(item => { var _a; return h("p", { class: ((_a = props.class) !== null && _a !== void 0 ? _a : '') + ' input-hint' }, item); })) : (h("p", { class: ((_a = props.class) !== null && _a !== void 0 ? _a : '') + ' input-hint' }, hint))),
|
|
13
14
|
slottedHint
|
|
14
15
|
]));
|
|
15
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-form-hint.js","sourceRoot":"","sources":["../../../src/components/cat-form-hint/cat-form-hint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAuB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"cat-form-hint.js","sourceRoot":"","sources":["../../../src/components/cat-form-hint/cat-form-hint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAuB,MAAM,eAAe,CAAC;AAcvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAA0C,KAAK,CAAC,EAAE;;EACxE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;EACpC,OAAO,CACL,WAAK,KAAK,EAAC,cAAc,IACtB;IACC,IAAI;MACF,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACrB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,SAAG,KAAK,EAAE,CAAC,MAAA,KAAK,CAAC,KAAK,mCAAI,EAAE,CAAC,GAAG,aAAa,IAAG,IAAI,CAAK,CAAA,EAAA,CAAC,CAC5E,CAAC,CAAC,CAAC,CACF,SAAG,KAAK,EAAE,CAAC,MAAA,KAAK,CAAC,KAAK,mCAAI,EAAE,CAAC,GAAG,aAAa,IAAG,IAAI,CAAK,CAC1D,CAAC;IACJ,WAAW;GACZ,CACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { h, FunctionalComponent } from '@stencil/core';\n\n/**\n * Properties of CatFormHint.\n *\n * @property hint - Optional hint text(s) of the form field.\n * @property slottedHint - Optional hint element of the form field.\n */\ninterface CatFormHintProps {\n hint?: string | string[];\n slottedHint?: HTMLSlotElement;\n class?: string;\n}\n\n/**\n * CatFormHint is a functional component that represents the hint area of form elements.\n *\n * @param props - {@link CatFormHintProps}\n * @return a JSX.Element\n */\nexport const CatFormHint: FunctionalComponent<CatFormHintProps> = props => {\n const { hint, slottedHint } = props;\n return (\n <div class=\"hint-section\">\n {[\n hint &&\n (Array.isArray(hint) ? (\n hint.map(item => <p class={(props.class ?? '') + ' input-hint'}>{item}</p>)\n ) : (\n <p class={(props.class ?? '') + ' input-hint'}>{hint}</p>\n )),\n slottedHint\n ]}\n </div>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-i18n-registry.js","sourceRoot":"","sources":["../../../src/components/cat-i18n/cat-i18n-registry.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,MAAM,OAAO,eAAe;EAM1B;IACE,mBAAmB;IAJJ,OAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACnD,SAAI,GAAwB,IAAI,GAAG,EAAE,CAAC;IAKrD,2EAA2E;IAC3E,yEAAyE;IACzE,yEAAyE;IACzE,4EAA4E;IAC5E,yEAAyE;IACzE,0EAA0E;IAC1E,oBAAoB;IACpB,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE;MAC9C,MAAM,EAAE,MAAM,EAAE,GAAI,KAAqB,IAAI,EAAE,CAAC;MAChD,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;QACnC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;OAC7B;IACH,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE;MAChD,MAAM,EAAE,MAAM,EAAE,GAAI,KAAqB,IAAI,EAAE,CAAC;MAChD,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;QACnC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;OAClB;IACH,CAAC,CAAC,CAAC;EACL,CAAC;EAED,MAAM,CAAC,WAAW;IA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AAC,MAAM,eAAe,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import log from 'loglevel';\n\nexport class CatI18nRegistry {\n private static instance: CatI18nRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly i18n: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when messages are added or removed in other\n // applications and add or remove messages if the event was not dispatched\n // by this registry.\n window.addEventListener('cat-i18n-set', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.set(detail.i18n, true);\n }\n });\n window.addEventListener('cat-i18n-clear', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.clear(true);\n }\n });\n }\n\n static getInstance(): CatI18nRegistry {\n if (!CatI18nRegistry.instance) {\n CatI18nRegistry.instance = new CatI18nRegistry();\n }\n return CatI18nRegistry.instance;\n }\n\n set(i18n: { [key: string]: string }, silent = false): void {\n const i18nEntries = Object.entries(i18n);\n i18nEntries.forEach(([key, message]) => this.i18n.set(key, message));\n log.info(`[CatI18nRegistry] Registered ${i18nEntries.length !== 1 ? 'messages' : 'message'}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-i18n-set', { i18n, id: this.id }));\n }\n\n clear(silent = false): void {\n this.i18n.clear();\n log.info(`[CatI18nRegistry] Cleared messages`);\n !silent && window.dispatchEvent(this.buildEvent('cat-i18n-clear'));\n }\n\n t(key: string, params?: { [key: string]: unknown }): string {\n const message = this.i18n.get(key);\n if (message === undefined) {\n log.error(`[CatI18nRegistry] Unknown message key: ${key}`);\n return key;\n }\n return message.replace(/{{\\s*([-a-zA-Z._]+)\\s*}}/g, (_match, key) => `${params?.[key] ?? ''}`);\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catI18nRegistry = CatI18nRegistry.getInstance();\n"]}
|
|
@@ -17,6 +17,240 @@
|
|
|
17
17
|
margin: 0 !important;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
.cat-bg-primary {
|
|
21
|
+
background-color: rgb(var(--cat-primary-bg, 0, 129, 148)) !important;
|
|
22
|
+
color: rgb(var(--cat-primary-fill, 255, 255, 255)) !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cat-bg-primary-hover {
|
|
26
|
+
transition: background-color 0.13s, color 0.13s;
|
|
27
|
+
}
|
|
28
|
+
.cat-bg-primary-hover:hover {
|
|
29
|
+
background-color: rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;
|
|
30
|
+
color: rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cat-text-primary,
|
|
34
|
+
.cat-link-primary {
|
|
35
|
+
color: rgb(var(--cat-primary-text, 0, 129, 148)) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cat-link-primary,
|
|
39
|
+
.cat-text-primary-hover {
|
|
40
|
+
transition: color 0.13s;
|
|
41
|
+
}
|
|
42
|
+
.cat-link-primary:hover,
|
|
43
|
+
.cat-text-primary-hover:hover {
|
|
44
|
+
color: rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important;
|
|
45
|
+
}
|
|
46
|
+
.cat-link-primary:active,
|
|
47
|
+
.cat-text-primary-hover:active {
|
|
48
|
+
color: rgb(var(--cat-primary-text-active, 2, 99, 113)) !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cat-bg-primaryInverted {
|
|
52
|
+
background-color: #93b4f2 !important;
|
|
53
|
+
color: black !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.cat-bg-primaryInverted-hover {
|
|
57
|
+
transition: background-color 0.13s, color 0.13s;
|
|
58
|
+
}
|
|
59
|
+
.cat-bg-primaryInverted-hover:hover {
|
|
60
|
+
background-color: #93b4f2 !important;
|
|
61
|
+
color: black !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cat-text-primaryInverted,
|
|
65
|
+
.cat-link-primaryInverted {
|
|
66
|
+
color: #93b4f2 !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cat-link-primaryInverted,
|
|
70
|
+
.cat-text-primaryInverted-hover {
|
|
71
|
+
transition: color 0.13s;
|
|
72
|
+
}
|
|
73
|
+
.cat-link-primaryInverted:hover,
|
|
74
|
+
.cat-text-primaryInverted-hover:hover {
|
|
75
|
+
color: #93b4f2 !important;
|
|
76
|
+
}
|
|
77
|
+
.cat-link-primaryInverted:active,
|
|
78
|
+
.cat-text-primaryInverted-hover:active {
|
|
79
|
+
color: #93b4f2 !important;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cat-bg-secondary {
|
|
83
|
+
background-color: rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;
|
|
84
|
+
color: rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.cat-bg-secondary-hover {
|
|
88
|
+
transition: background-color 0.13s, color 0.13s;
|
|
89
|
+
}
|
|
90
|
+
.cat-bg-secondary-hover:hover {
|
|
91
|
+
background-color: rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;
|
|
92
|
+
color: rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.cat-text-secondary,
|
|
96
|
+
.cat-link-secondary {
|
|
97
|
+
color: rgb(var(--cat-secondary-text, 0, 0, 0)) !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.cat-link-secondary,
|
|
101
|
+
.cat-text-secondary-hover {
|
|
102
|
+
transition: color 0.13s;
|
|
103
|
+
}
|
|
104
|
+
.cat-link-secondary:hover,
|
|
105
|
+
.cat-text-secondary-hover:hover {
|
|
106
|
+
color: rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important;
|
|
107
|
+
}
|
|
108
|
+
.cat-link-secondary:active,
|
|
109
|
+
.cat-text-secondary-hover:active {
|
|
110
|
+
color: rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cat-bg-secondaryInverted {
|
|
114
|
+
background-color: #697687 !important;
|
|
115
|
+
color: black !important;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.cat-bg-secondaryInverted-hover {
|
|
119
|
+
transition: background-color 0.13s, color 0.13s;
|
|
120
|
+
}
|
|
121
|
+
.cat-bg-secondaryInverted-hover:hover {
|
|
122
|
+
background-color: #697687 !important;
|
|
123
|
+
color: black !important;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.cat-text-secondaryInverted,
|
|
127
|
+
.cat-link-secondaryInverted {
|
|
128
|
+
color: white !important;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.cat-link-secondaryInverted,
|
|
132
|
+
.cat-text-secondaryInverted-hover {
|
|
133
|
+
transition: color 0.13s;
|
|
134
|
+
}
|
|
135
|
+
.cat-link-secondaryInverted:hover,
|
|
136
|
+
.cat-text-secondaryInverted-hover:hover {
|
|
137
|
+
color: white !important;
|
|
138
|
+
}
|
|
139
|
+
.cat-link-secondaryInverted:active,
|
|
140
|
+
.cat-text-secondaryInverted-hover:active {
|
|
141
|
+
color: white !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.cat-bg-success {
|
|
145
|
+
background-color: rgb(var(--cat-success-bg-, 0, 132, 88)) !important;
|
|
146
|
+
color: rgb(var(--cat-success-fill, 255, 255, 255)) !important;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.cat-bg-success-hover {
|
|
150
|
+
transition: background-color 0.13s, color 0.13s;
|
|
151
|
+
}
|
|
152
|
+
.cat-bg-success-hover:hover {
|
|
153
|
+
background-color: rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;
|
|
154
|
+
color: rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cat-text-success,
|
|
158
|
+
.cat-link-success {
|
|
159
|
+
color: rgb(var(--cat-success-text, 0, 132, 88)) !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.cat-link-success,
|
|
163
|
+
.cat-text-success-hover {
|
|
164
|
+
transition: color 0.13s;
|
|
165
|
+
}
|
|
166
|
+
.cat-link-success:hover,
|
|
167
|
+
.cat-text-success-hover:hover {
|
|
168
|
+
color: rgb(var(--cat-success-text-hover, 0, 117, 78)) !important;
|
|
169
|
+
}
|
|
170
|
+
.cat-link-success:active,
|
|
171
|
+
.cat-text-success-hover:active {
|
|
172
|
+
color: rgb(var(--cat-success-text-active, 0, 105, 70)) !important;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.cat-bg-warning {
|
|
176
|
+
background-color: rgb(var(--cat-warning-bg, 255, 206, 128)) !important;
|
|
177
|
+
color: rgb(var(--cat-warning-fill, 0, 0, 0)) !important;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.cat-bg-warning-hover {
|
|
181
|
+
transition: background-color 0.13s, color 0.13s;
|
|
182
|
+
}
|
|
183
|
+
.cat-bg-warning-hover:hover {
|
|
184
|
+
background-color: rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;
|
|
185
|
+
color: rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.cat-text-warning,
|
|
189
|
+
.cat-link-warning {
|
|
190
|
+
color: rgb(var(--cat-warning-text, 159, 97, 0)) !important;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.cat-link-warning,
|
|
194
|
+
.cat-text-warning-hover {
|
|
195
|
+
transition: color 0.13s;
|
|
196
|
+
}
|
|
197
|
+
.cat-link-warning:hover,
|
|
198
|
+
.cat-text-warning-hover:hover {
|
|
199
|
+
color: rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important;
|
|
200
|
+
}
|
|
201
|
+
.cat-link-warning:active,
|
|
202
|
+
.cat-text-warning-hover:active {
|
|
203
|
+
color: rgb(var(--cat-warning-text-active, 159, 97, 0)) !important;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.cat-bg-danger {
|
|
207
|
+
background-color: rgb(var(--cat-danger-bg, 217, 52, 13)) !important;
|
|
208
|
+
color: rgb(var(--cat-danger-fill, 255, 255, 255)) !important;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.cat-bg-danger-hover {
|
|
212
|
+
transition: background-color 0.13s, color 0.13s;
|
|
213
|
+
}
|
|
214
|
+
.cat-bg-danger-hover:hover {
|
|
215
|
+
background-color: rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;
|
|
216
|
+
color: rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.cat-text-danger,
|
|
220
|
+
.cat-link-danger {
|
|
221
|
+
color: rgb(var(--cat-danger-text, 217, 52, 13)) !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.cat-link-danger,
|
|
225
|
+
.cat-text-danger-hover {
|
|
226
|
+
transition: color 0.13s;
|
|
227
|
+
}
|
|
228
|
+
.cat-link-danger:hover,
|
|
229
|
+
.cat-text-danger-hover:hover {
|
|
230
|
+
color: rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important;
|
|
231
|
+
}
|
|
232
|
+
.cat-link-danger:active,
|
|
233
|
+
.cat-text-danger-hover:active {
|
|
234
|
+
color: rgb(var(--cat-danger-text-active, 174, 42, 10)) !important;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.cat-active {
|
|
238
|
+
color: rgb(var(--cat-primary-text, 0, 129, 148)) !important;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.cat-muted {
|
|
242
|
+
color: rgb(var(--cat-font-color-muted, 105, 118, 135)) !important;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.cat-text-reset {
|
|
246
|
+
color: inherit !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.cat-link-reset {
|
|
250
|
+
color: inherit !important;
|
|
251
|
+
text-decoration: inherit !important;
|
|
252
|
+
}
|
|
253
|
+
|
|
20
254
|
:host {
|
|
21
255
|
display: flex;
|
|
22
256
|
flex-direction: column;
|
|
@@ -56,18 +290,20 @@
|
|
|
56
290
|
.input-wrapper:not(.input-disabled):hover {
|
|
57
291
|
box-shadow: 0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224));
|
|
58
292
|
}
|
|
293
|
+
.input-wrapper:not(.input-disabled):hover.input-invalid {
|
|
294
|
+
box-shadow: 0 0 0 2px rgba(var(--cat-danger-bg, 217, 52, 13), 0.2);
|
|
295
|
+
}
|
|
59
296
|
.input-wrapper:not(.input-disabled):focus-within {
|
|
60
297
|
outline: 2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));
|
|
61
298
|
}
|
|
62
|
-
.input-wrapper:
|
|
63
|
-
|
|
299
|
+
.input-wrapper:not(.input-disabled):focus-within.input-invalid {
|
|
300
|
+
outline: 2px solid rgba(var(--cat-danger-bg, 217, 52, 13), 0.2);
|
|
64
301
|
}
|
|
65
|
-
|
|
66
|
-
:
|
|
67
|
-
box-shadow: 0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13));
|
|
302
|
+
.input-wrapper.input-invalid {
|
|
303
|
+
box-shadow: 0 0 0 1px rgba(var(--cat-danger-bg, 217, 52, 13), 0.2);
|
|
68
304
|
}
|
|
69
|
-
:
|
|
70
|
-
|
|
305
|
+
.input-wrapper:has(input:-webkit-autofill), .input-wrapper:has(input:-webkit-autofill):hover, .input-wrapper:has(input:-webkit-autofill):focus {
|
|
306
|
+
background-color: #e8f0fe;
|
|
71
307
|
}
|
|
72
308
|
|
|
73
309
|
label {
|
|
@@ -85,7 +321,7 @@ label.hidden {
|
|
|
85
321
|
border: 0 !important;
|
|
86
322
|
}
|
|
87
323
|
|
|
88
|
-
.
|
|
324
|
+
.label-optional {
|
|
89
325
|
margin-left: 0.25rem;
|
|
90
326
|
font-size: 0.75rem;
|
|
91
327
|
line-height: 1rem;
|