@rededor/cura 1.8.0 → 1.8.2-alpha.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/cjs/cura-accordion_20.cjs.entry.js +4 -4
- package/dist/cjs/cura-accordion_20.cjs.entry.js.map +1 -1
- package/dist/cjs/index-BK9MSAiE.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +3 -3
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +2 -2
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/components/cura-calendar.js +1 -1
- package/dist/components/cura-dropdown-search.js +1 -1
- package/dist/components/cura-input-date.js +3 -3
- package/dist/components/cura-input-text.js +1 -1
- package/dist/components/cura-select.js +1 -1
- package/dist/components/{p-e-P5qR3J.js → p-BGnJiNyu.js} +3 -3
- package/dist/components/{p-e-P5qR3J.js.map → p-BGnJiNyu.js.map} +1 -1
- package/dist/components/{p-y6Cly9DJ.js → p-BTt-pVTn.js} +4 -4
- package/dist/components/p-BTt-pVTn.js.map +1 -0
- package/dist/components/{p-zz_zOPBZ.js → p-CgMS6FUK.js} +4 -4
- package/dist/components/p-CgMS6FUK.js.map +1 -0
- package/dist/components/p-D1cPOZpG.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/p-PPMZr_VE.js.map +1 -1
- package/dist/cura/{p-fc3b57a8.entry.js → p-d8aeca82.entry.js} +2 -2
- package/dist/cura/p-d8aeca82.entry.js.map +1 -0
- package/dist/esm/cura-accordion_20.entry.js +4 -4
- package/dist/esm/cura-accordion_20.entry.js.map +1 -1
- package/dist/esm/index-OdKytJIH.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/p-y6Cly9DJ.js.map +0 -1
- package/dist/components/p-zz_zOPBZ.js.map +0 -1
- package/dist/cura/p-fc3b57a8.entry.js.map +0 -1
|
@@ -213,7 +213,7 @@ export class CuraInputText {
|
|
|
213
213
|
return 'neutral-black';
|
|
214
214
|
return 'neutral-dark';
|
|
215
215
|
})();
|
|
216
|
-
return (h("div", { style: this.styles, class: "helper-text", part: "cura-input-text-helper" }, isDefault && (h("cura-label", { size: helperTextSize, lineHeight: "xsmall", color: colorText }, h("slot", null))), isError && this.mode ===
|
|
216
|
+
return (h("div", { style: this.styles, class: "helper-text", part: "cura-input-text-helper" }, isDefault && (h("cura-label", { size: helperTextSize, lineHeight: "xsmall", color: colorText }, h("slot", null))), isError && this.mode === 'default' && (h("cura-label", { size: helperTextSize, lineHeight: "xsmall", color: "error-dark" }, h("slot", null))), isError && this.mode === 'transparent' && (h("cura-label", { size: helperTextSize, lineHeight: "xsmall", color: "neutral-black" }, h("slot", null))), isSuccess && (h("cura-label", { size: helperTextSize, lineHeight: "xsmall", color: "success-dark" }, h("slot", null)))));
|
|
217
217
|
}
|
|
218
218
|
handleMouseEnter() {
|
|
219
219
|
this.isHovered = true;
|
|
@@ -361,7 +361,7 @@ export class CuraInputText {
|
|
|
361
361
|
e.preventDefault();
|
|
362
362
|
}
|
|
363
363
|
render() {
|
|
364
|
-
return (h(Host, { key: '
|
|
364
|
+
return (h(Host, { key: 'ca2aecb12b93ceb875b3009b250aaad74cdae987', role: "textbox", "aria-disabled": this.disabled, "aria-required": this.required, "aria-invalid": this.status === 'error' }, h("div", { key: 'cf01002eab6f77101c36e03c5cf849d7aaeac09e', style: this.styles, onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), class: Object.assign({ 'cura-input-group': true }, this.getClasses()) }, h("div", { key: '632acdd25d3b425b26c6bd10b60f92f37af834c3', class: "input-wrapper" }, this.label && (h("cura-label", { key: '0cc9fa6b402907f8292188ff7450945d6e31edd8', class: "label", weight: "bold", size: this.size === 'large' ? 'small' : 'xsmall', color: this.getLabelColor() }, this.label, " ", this.required && h("span", { key: 'aebf6ded909742c6d09c963172064b3035a5f141', class: "required" }, "* "))), h("div", { key: '8906d48f519c5053936d55d4ad9c4bc3570c70d4', class: "cura-input-field", part: "cura-input-field", style: this.styles }, this.renderIcon(), h("input", { key: 'e0954c117932336172cb4bc83ccc18038341dcd3', name: this.name ? this.name : '', type: this.type, onKeyDown: event => this.handleKeyDown(event), onBlur: this.handleInputBlur.bind(this), onFocus: this.handleInputFocus.bind(this), onInput: event => this.handleInputChange(event), class: this.getClasses(), style: this.styles, placeholder: this.placeholder, disabled: this.disabled || this.isLoading, required: this.required, readonly: this.readOnly, maxlength: this.maxlength, value: this.value !== undefined && this.value !== null ? this.value : '', inputmode: this.maskPreset ? 'tel' : this.inputMode, ref: ref => (this.inputRef = ref), autocomplete: this.autocomplete }), !!this.clearIcon && !this.readOnly && !this.isLoading && !this.disabled && this.value && this.isFocused && (h("cura-icon", { key: '26ea6fcc1cd8df12ee9d0c40f1d20600d696fbe9', size: this.size === 'large' || this.mode === 'transparent' ? 20 : 16, color: "primary-base", name: "closeCircle", iconset: "default", class: "clear-button", onMouseDown: () => this.handleClearInput() })), this.isLoading && h("cura-loader-circle", { key: '292a9c476520f9d03a9d7c2f4242d103dd157b90', size: this.size === 'large' ? 'medium' : 'small', color: "primary-base" })), this.renderHelperText()))));
|
|
365
365
|
}
|
|
366
366
|
static get is() { return "cura-input-text"; }
|
|
367
367
|
static get encapsulation() { return "shadow"; }
|
|
@@ -647,7 +647,7 @@ export class CuraInputText {
|
|
|
647
647
|
"references": {
|
|
648
648
|
"MaskPreset": {
|
|
649
649
|
"location": "local",
|
|
650
|
-
"path": "/
|
|
650
|
+
"path": "/home/marcus/Documentos/www/rededor/web/cura/packages/component-lib/src/components/forms/cura-input-text/cura-input-text.tsx",
|
|
651
651
|
"id": "src/components/forms/cura-input-text/cura-input-text.tsx::MaskPreset"
|
|
652
652
|
}
|
|
653
653
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-input-text.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-input-text/cura-input-text.tsx"],"names":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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Watch, Event, EventEmitter, AttachInternals, Method, Element } from '@stencil/core';\nimport IMask, { FactoryArg, InputMask } from 'imask';\nimport { maskOptions, MaskOptionsMap } from './mask-presets/input-mask-presets';\nimport { checkMobile, checkIOS, fakeInputIOSHack } from '../../../utils/utils';\nexport type MaskPreset = keyof MaskOptionsMap;\n@Component({\n tag: 'cura-input-text',\n styleUrl: 'cura-input-text.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraInputText {\n @Element() host: HTMLElement;\n /**\n * Mode of the input: 'default' or 'transparent' (default: 'default')\n */\n @Prop({ reflect: true, mutable: true }) mode: 'default' | 'transparent' | string = 'default';\n\n /**\n * Indicates input status(default: default)\n */\n\n @Prop({ reflect: true, mutable: true }) status: 'error' | 'success' | 'default' | string = 'default';\n\n /**\n * Size of the input mode default: 'small', 'medium', or 'large' (default: 'medium')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' | string = 'medium';\n\n /**\n * Type of the input: 'text', 'number' (default: 'text')\n */\n @Prop({ reflect: true }) type: string = 'text';\n\n /**\n * Type of the input: 'text', 'number' (default: 'text')\n */\n @Prop({ reflect: true }) inputMode: string = 'text';\n\n /**\n * Label text for the input\n */\n @Prop({ reflect: true }) label?: string = '';\n\n /**\n * Name text for the input\n */\n @Prop({ reflect: true }) name?: string = '';\n\n /**\n * Placeholder text for the input\n */\n @Prop({ reflect: true }) placeholder?: string | null = null;\n\n /**\n * Value of the input field\n */\n @Prop({ reflect: true, mutable: true }) value: string | number = '';\n\n /**\n * Whether to display a cura icon (default: null)\n */\n @Prop({ reflect: true, mutable: true }) iconName?: string = '';\n\n /**\n * Helper text displayed below the input\n */\n @Prop({ reflect: true, mutable: true }) helperText?: string;\n\n /**\n * Whether the input is disabled (default: false)\n */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /**\n * Whether the input is required (default: false)\n */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /**\n * Mask preset for input formatting: 'cpf', 'cnpj', 'phone', 'date', etc. Uses IMask library.\n * @see: https://imask.js.org/\n */\n @Prop() maskPreset?: MaskPreset;\n\n /*\n * Controls whether the selection functionality is active\n */\n @Prop({ reflect: true, mutable: true }) enableSelectionMode: boolean = false;\n\n /**\n * Regular expression for custom input masking. Uses IMask library.\n * @see: https://imask.js.org/\n */\n @Prop({ reflect: true, mutable: true }) maskRegex?: string | null;\n\n /**\n * Advanced mask object to be used with IMask library\n * @see: https://imask.js.org/\n */\n @Prop({ reflect: true, mutable: true }) maskAdvanced?: any | string | null;\n\n /**\n * Maximum length of the input value (default: undefined)\n */\n @Prop({ reflect: true, mutable: true }) maxlength?: number | undefined;\n\n /**\n * Whether the input is read-only (default: false)\n */\n @Prop({ reflect: true }) readOnly?: boolean = false;\n\n /**\n * Whether the input is in loading state (default: false)\n */\n @Prop({ reflect: true, mutable: true }) isLoading?: boolean = false;\n\n /**\n * Internal state: Whether the input is hovered (default: false)\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused (default: false)\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Styles object for dynamic styling\n */\n @State() styles: { [key: string]: string } = {};\n\n /**\n * Icon button name for the clear button (default: 'closeCircle')\n */\n @Prop({ reflect: true, mutable: true }) clearIcon?: boolean = true;\n\n /**\n * Removes the alertCircle icon when necessary(as used in CuraDropdownSearch)\n */\n @Prop() hideErrorIcon: boolean = false;\n\n /**\n * Defines whether the input should have autocomplete\n */\n @Prop({ reflect: true }) autocomplete?: string = 'on';\n\n /**\n * Emitted when the value of the input changes\n * @type {EventEmitter<string | number>}\n */\n @Event() valueChange: EventEmitter<string | number>;\n\n /**\n * Emitted when the clear button is clicked\n * @type {EventEmitter<string | number>}\n */\n @Event() inputClear: EventEmitter<string | number>;\n\n @AttachInternals() internals: ElementInternals;\n\n inputRef!: HTMLInputElement;\n\n @Method()\n async setFocus() {\n // IOS needs large timeout value to work\n const timeoutMs = checkMobile() && checkIOS() ? 1000 : 200;\n // IOS fake input hack\n let fakeInput = fakeInputIOSHack(this.host);\n setTimeout(() => {\n this.inputRef.focus();\n if (fakeInput) fakeInput.remove();\n }, timeoutMs);\n }\n\n /**\n * Instance of InputMask is returned when IMask constructor is called.\n */\n maskedInput: InputMask<FactoryArg>;\n weights: { [key: string]: string };\n breakpoints: any;\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.value = state.value;\n this.applyValueToMask();\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.handleClearInput();\n this.internals.setValidity({});\n this.internals.setFormValue('');\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n @Watch('styles')\n connectedCallback() {\n this.styles['--primary-base'] = window.CuraAPI.theme.colors.getColor(`primary-base`);\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-black'] = window.CuraAPI.theme.colors.getColor(`neutral-black`);\n this.styles['--neutral-medium'] = window.CuraAPI.theme.colors.getColor(`neutral-medium`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--success-dark'] = window.CuraAPI.theme.colors.getColor(`success-dark`);\n this.styles['--success-darker'] = window.CuraAPI.theme.colors.getColor(`success-darker`);\n this.styles['--success-lighter'] = window.CuraAPI.theme.colors.getColor(`success-lighter`);\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor(`error-lighter`);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor(`error-dark`);\n this.styles['--error-darker'] = window.CuraAPI.theme.colors.getColor(`error-darker`);\n this.styles['--error-base'] = window.CuraAPI.theme.colors.getColor(`error-base`);\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor(`info-base`);\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.breakpoints = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--font-weight-bold'] = this.weights.bold;\n this.styles['--font-weight-regular'] = this.weights.regular;\n }\n\n @Watch('size')\n getClasses() {\n return {\n [this.size.toLowerCase()]: this.mode === 'default',\n disabled: this.disabled,\n isLoading: this.isLoading,\n isFocused: this.isFocused && !this.disabled && !this.readOnly && !this.isLoading,\n isHovered: this.isHovered,\n [this.status]: true,\n transparent: this.mode === 'transparent',\n selection: this.enableSelectionMode,\n };\n }\n\n getLabelColor() {\n if (!!this.disabled) {\n return 'neutral-medium';\n } else if (this.isLoading && this.mode === 'transparent' && !this.isHovered) {\n return 'neutral-dark';\n } else if (((this.isFocused || this.isHovered || this.status === 'success' || this.status === 'error') && !this.readOnly) || this.isHovered) {\n return 'neutral-black';\n } else {\n return 'neutral-dark';\n }\n }\n\n @Watch('status')\n @Watch('mode')\n renderIcon() {\n if ((this.iconName === '' && this.status === 'default') || (this.mode === 'transparent' && this.isLoading) || (this.mode === 'transparent' && this.status === 'default')) {\n return;\n }\n // Used when input is rendered in cura-dropdown-search with error status\n if (this.status === 'error' && this.hideErrorIcon) {\n return;\n }\n\n const iconSizeDefaultMode = this.size === 'large' ? 20 : 16;\n const baseIconSize = this.mode === 'transparent' ? 20 : iconSizeDefaultMode;\n\n const iconMap: { [key: string]: { name: string; color: string } } = {\n loading: { name: this.iconName, color: 'primary-base' },\n success: { name: 'checkCircle', color: 'success-dark' },\n error: { name: 'alertCircle', color: 'error-dark' },\n default: { name: this.iconName, color: 'neutral-dark' },\n disabled: { name: this.iconName, color: 'neutral-medium' },\n };\n\n const iconConfig = iconMap[this.isLoading ? 'loading' : this.disabled ? 'disabled' : this.status || 'default'];\n\n return (\n <div class=\"feedback-icon\" style={this.styles}>\n <cura-icon name={iconConfig.name} iconset=\"default\" size={baseIconSize} color={iconConfig.color} />\n </div>\n );\n }\n\n renderHelperText() {\n const isError = this.status === 'error';\n const isSuccess = this.status === 'success';\n const isDefault = this.status === 'default';\n const helperTextSize = this.size === 'large' ? 'small' : 'xsmall';\n const colorText = (() => {\n if (this.disabled) return 'neutral-medium';\n if (this.isLoading) return 'primary-base';\n if (this.isFocused || this.isHovered) return 'neutral-black';\n return 'neutral-dark';\n })();\n\n return (\n <div style={this.styles} class=\"helper-text\" part=\"cura-input-text-helper\">\n {isDefault && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color={colorText}>\n <slot></slot>\n </cura-label>\n )}\n {isError && this.mode === \"default\" && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color=\"error-dark\">\n <slot></slot>\n </cura-label>\n )}\n {isError && this.mode === \"transparent\" && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color=\"neutral-black\">\n <slot></slot>\n </cura-label>\n )}\n {isSuccess && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color=\"success-dark\">\n <slot></slot>\n </cura-label>\n )}\n </div>\n );\n }\n\n handleMouseEnter() {\n this.isHovered = true;\n }\n handleMouseLeave() {\n this.isHovered = false;\n }\n\n componentDidLoad() {\n this.initializeMask();\n }\n\n disconnectedCallback() {\n this.destroyMask();\n }\n\n handleMaskUpdate() {\n if (this.maskedInput) {\n this.maskedInput.updateValue();\n }\n }\n\n handleClearInput() {\n this.handleMaskUpdate();\n this.value = '';\n this.inputRef.value = '';\n this.valueChange.emit(this.value);\n this.inputClear.emit(this.value);\n this.handleMaskUpdate();\n this.setFocus();\n }\n\n handleInputFocus() {\n this.handleMaskUpdate();\n this.isFocused = true;\n }\n\n handleInputBlur() {\n this.handleMaskUpdate();\n setTimeout(() => {\n this.isFocused = false;\n }, 150);\n }\n\n shouldDisplayMask() {\n return this.maskPreset || this.maskRegex || this.maskAdvanced;\n }\n\n @Watch('maskPreset')\n @Watch('maskRegex')\n @Watch('maskAdvanced')\n initializeMask() {\n if (this.shouldDisplayMask()) {\n if (this.maskedInput) {\n this.destroyMask();\n }\n if (this.maskPreset) {\n this.initializePresetMask();\n } else if (this.maskRegex) {\n this.initializeRegexMask();\n } else if (this.maskAdvanced) {\n this.initializeAdvancedMask();\n }\n this.applyValueToMask();\n } else {\n this.clearMaskValue();\n }\n }\n\n initializeRegexMask() {\n const cleanedRegexString = this.maskRegex.replace(/^\\/|\\/[gimsuy]*$/g, '');\n const flags = (this.maskRegex.match(/\\/[gimsuy]*$/g) || [''])[0].slice(1);\n this.maskedInput = IMask(this.inputRef, { mask: new RegExp(cleanedRegexString, flags) });\n }\n\n initializePresetMask() {\n const options = maskOptions[this.maskPreset];\n\n if (options) {\n this.maskedInput = IMask(this.inputRef, options);\n } else {\n console.error(`Mask preset \"${this.maskPreset}\" not found.`);\n }\n }\n\n initializeAdvancedMask() {\n if (!this.inputRef) return;\n\n try {\n const config = typeof this.maskAdvanced === 'string' ? JSON.parse(this.maskAdvanced) : this.maskAdvanced;\n this.maskedInput = IMask(this.inputRef, config);\n } catch (error) {\n console.error('Error defining maskAdvanced:', error);\n }\n }\n\n applyValueToMask() {\n if (this.maskedInput) {\n if (this.maskedInput.mask === Date || this.maskedInput.mask === Number) {\n this.maskedInput.typedValue = this.value;\n } else {\n this.value = this.maskedInput.value;\n }\n this.handleMaskUpdate();\n }\n }\n\n clearMaskValue() {\n this.inputRef.value = this.value as string;\n }\n\n destroyMask() {\n if (this.maskedInput) {\n this.maskedInput.destroy();\n this.maskedInput = undefined;\n }\n }\n\n handleInputChange(event: any) {\n const inputValue = event.target.value;\n\n this.valueChange.emit(inputValue);\n\n if (this.type === 'number') {\n this.handleNumberInputChange(inputValue);\n } else {\n this.handleTextInputChange(inputValue);\n }\n this.internals.setFormValue(this.value as string);\n }\n\n handleNumberInputChange(inputValue: string) {\n const numericValue = parseFloat(inputValue);\n if (!isNaN(numericValue)) {\n this.value = numericValue;\n } else {\n console.error('Invalid numeric input:', inputValue);\n }\n }\n\n handleTextInputChange(inputValue: string) {\n if (this.maskedInput) {\n if (this.maskedInput.mask instanceof Date || this.maskedInput.mask === Number) {\n this.maskedInput.typedValue = inputValue;\n this.value = this.maskedInput.typedValue;\n }\n this.value = this.maskedInput.value;\n } else {\n this.value = inputValue;\n }\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.type === 'number') {\n this.handleBlockInvalidNumber(event);\n }\n }\n\n handleBlockInvalidNumber(e: KeyboardEvent) {\n if (['e', 'E', '+', '-'].includes(e.key)) e.preventDefault();\n }\n\n render() {\n return (\n <Host role=\"textbox\"\n aria-disabled={this.disabled}\n aria-required={this.required}\n aria-invalid={this.status === 'error'}>\n <div\n style={this.styles}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n class={{\n 'cura-input-group': true,\n ...this.getClasses(),\n }}\n >\n <div class=\"input-wrapper\">\n {this.label && (\n <cura-label class=\"label\" weight=\"bold\" size={this.size === 'large' ? 'small' : 'xsmall'} color={this.getLabelColor()}>\n {this.label} {this.required && <span class=\"required\">* </span>}\n </cura-label>\n )}\n <div class=\"cura-input-field\" part=\"cura-input-field\" style={this.styles}>\n {this.renderIcon()}\n <input\n name={this.name ? this.name : ''}\n type={this.type}\n onKeyDown={event => this.handleKeyDown(event)}\n onBlur={this.handleInputBlur.bind(this)}\n onFocus={this.handleInputFocus.bind(this)}\n onInput={event => this.handleInputChange(event)}\n class={this.getClasses()}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled || this.isLoading}\n required={this.required}\n readonly={this.readOnly}\n maxlength={this.maxlength}\n value={this.value !== undefined && this.value !== null ? this.value : ''}\n inputmode={this.maskPreset ? 'tel' : this.inputMode}\n ref={ref => (this.inputRef = ref)}\n autocomplete={this.autocomplete}\n />\n {!!this.clearIcon && !this.readOnly && !this.isLoading && !this.disabled && this.value && this.isFocused && (\n <cura-icon\n size={this.size === 'large' || this.mode === 'transparent' ? 20 : 16}\n color=\"primary-base\"\n name=\"closeCircle\"\n iconset=\"default\"\n class=\"clear-button\"\n onClick={() => this.handleClearInput()}\n />\n )}\n {this.isLoading && <cura-loader-circle size={this.size === 'large' ? 'medium' : 'small'} color=\"primary-base\"></cura-loader-circle>}\n </div>\n {this.renderHelperText()}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cura-input-text.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-input-text/cura-input-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAgB,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9H,OAAO,KAAgC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAkB,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ/E,MAAM,OAAO,aAAa;IAN1B;QAQE;;WAEG;QACqC,SAAI,GAAuC,SAAS,CAAC;QAE7F;;WAEG;QAEqC,WAAM,GAA6C,SAAS,CAAC;QAErG;;W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S,EACjB,KAAK,EAAC,cAAc,EACpB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAC1C,CACH;wBACA,IAAI,CAAC,SAAS,IAAI,2EAAoB,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAC,cAAc,GAAsB,CAC/H;oBACL,IAAI,CAAC,gBAAgB,EAAE,CACpB,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Watch, Event, EventEmitter, AttachInternals, Method, Element } from '@stencil/core';\nimport IMask, { FactoryArg, InputMask } from 'imask';\nimport { maskOptions, MaskOptionsMap } from './mask-presets/input-mask-presets';\nimport { checkMobile, checkIOS, fakeInputIOSHack } from '../../../utils/utils';\nexport type MaskPreset = keyof MaskOptionsMap;\n@Component({\n tag: 'cura-input-text',\n styleUrl: 'cura-input-text.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraInputText {\n @Element() host: HTMLElement;\n /**\n * Mode of the input: 'default' or 'transparent' (default: 'default')\n */\n @Prop({ reflect: true, mutable: true }) mode: 'default' | 'transparent' | string = 'default';\n\n /**\n * Indicates input status(default: default)\n */\n\n @Prop({ reflect: true, mutable: true }) status: 'error' | 'success' | 'default' | string = 'default';\n\n /**\n * Size of the input mode default: 'small', 'medium', or 'large' (default: 'medium')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' | string = 'medium';\n\n /**\n * Type of the input: 'text', 'number' (default: 'text')\n */\n @Prop({ reflect: true }) type: string = 'text';\n\n /**\n * Type of the input: 'text', 'number' (default: 'text')\n */\n @Prop({ reflect: true }) inputMode: string = 'text';\n\n /**\n * Label text for the input\n */\n @Prop({ reflect: true }) label?: string = '';\n\n /**\n * Name text for the input\n */\n @Prop({ reflect: true }) name?: string = '';\n\n /**\n * Placeholder text for the input\n */\n @Prop({ reflect: true }) placeholder?: string | null = null;\n\n /**\n * Value of the input field\n */\n @Prop({ reflect: true, mutable: true }) value: string | number = '';\n\n /**\n * Whether to display a cura icon (default: null)\n */\n @Prop({ reflect: true, mutable: true }) iconName?: string = '';\n\n /**\n * Helper text displayed below the input\n */\n @Prop({ reflect: true, mutable: true }) helperText?: string;\n\n /**\n * Whether the input is disabled (default: false)\n */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /**\n * Whether the input is required (default: false)\n */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /**\n * Mask preset for input formatting: 'cpf', 'cnpj', 'phone', 'date', etc. Uses IMask library.\n * @see: https://imask.js.org/\n */\n @Prop() maskPreset?: MaskPreset;\n\n /*\n * Controls whether the selection functionality is active\n */\n @Prop({ reflect: true, mutable: true }) enableSelectionMode: boolean = false;\n\n /**\n * Regular expression for custom input masking. Uses IMask library.\n * @see: https://imask.js.org/\n */\n @Prop({ reflect: true, mutable: true }) maskRegex?: string | null;\n\n /**\n * Advanced mask object to be used with IMask library\n * @see: https://imask.js.org/\n */\n @Prop({ reflect: true, mutable: true }) maskAdvanced?: any | string | null;\n\n /**\n * Maximum length of the input value (default: undefined)\n */\n @Prop({ reflect: true, mutable: true }) maxlength?: number | undefined;\n\n /**\n * Whether the input is read-only (default: false)\n */\n @Prop({ reflect: true }) readOnly?: boolean = false;\n\n /**\n * Whether the input is in loading state (default: false)\n */\n @Prop({ reflect: true, mutable: true }) isLoading?: boolean = false;\n\n /**\n * Internal state: Whether the input is hovered (default: false)\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused (default: false)\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Styles object for dynamic styling\n */\n @State() styles: { [key: string]: string } = {};\n\n /**\n * Icon button name for the clear button (default: 'closeCircle')\n */\n @Prop({ reflect: true, mutable: true }) clearIcon?: boolean = true;\n\n /**\n * Removes the alertCircle icon when necessary(as used in CuraDropdownSearch)\n */\n @Prop() hideErrorIcon: boolean = false;\n\n /**\n * Defines whether the input should have autocomplete\n */\n @Prop({ reflect: true }) autocomplete?: string = 'on';\n\n /**\n * Emitted when the value of the input changes\n * @type {EventEmitter<string | number>}\n */\n @Event() valueChange: EventEmitter<string | number>;\n\n /**\n * Emitted when the clear button is clicked\n * @type {EventEmitter<string | number>}\n */\n @Event() inputClear: EventEmitter<string | number>;\n\n @AttachInternals() internals: ElementInternals;\n\n inputRef!: HTMLInputElement;\n\n @Method()\n async setFocus() {\n // IOS needs large timeout value to work\n const timeoutMs = checkMobile() && checkIOS() ? 1000 : 200;\n // IOS fake input hack\n let fakeInput = fakeInputIOSHack(this.host);\n setTimeout(() => {\n this.inputRef.focus();\n if (fakeInput) fakeInput.remove();\n }, timeoutMs);\n }\n\n /**\n * Instance of InputMask is returned when IMask constructor is called.\n */\n maskedInput: InputMask<FactoryArg>;\n weights: { [key: string]: string };\n breakpoints: any;\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.value = state.value;\n this.applyValueToMask();\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.handleClearInput();\n this.internals.setValidity({});\n this.internals.setFormValue('');\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n @Watch('styles')\n connectedCallback() {\n this.styles['--primary-base'] = window.CuraAPI.theme.colors.getColor(`primary-base`);\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-black'] = window.CuraAPI.theme.colors.getColor(`neutral-black`);\n this.styles['--neutral-medium'] = window.CuraAPI.theme.colors.getColor(`neutral-medium`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--success-dark'] = window.CuraAPI.theme.colors.getColor(`success-dark`);\n this.styles['--success-darker'] = window.CuraAPI.theme.colors.getColor(`success-darker`);\n this.styles['--success-lighter'] = window.CuraAPI.theme.colors.getColor(`success-lighter`);\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor(`error-lighter`);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor(`error-dark`);\n this.styles['--error-darker'] = window.CuraAPI.theme.colors.getColor(`error-darker`);\n this.styles['--error-base'] = window.CuraAPI.theme.colors.getColor(`error-base`);\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor(`info-base`);\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.breakpoints = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--font-weight-bold'] = this.weights.bold;\n this.styles['--font-weight-regular'] = this.weights.regular;\n }\n\n @Watch('size')\n getClasses() {\n return {\n [this.size.toLowerCase()]: this.mode === 'default',\n disabled: this.disabled,\n isLoading: this.isLoading,\n isFocused: this.isFocused && !this.disabled && !this.readOnly && !this.isLoading,\n isHovered: this.isHovered,\n [this.status]: true,\n transparent: this.mode === 'transparent',\n selection: this.enableSelectionMode,\n };\n }\n\n getLabelColor() {\n if (!!this.disabled) {\n return 'neutral-medium';\n } else if (this.isLoading && this.mode === 'transparent' && !this.isHovered) {\n return 'neutral-dark';\n } else if (((this.isFocused || this.isHovered || this.status === 'success' || this.status === 'error') && !this.readOnly) || this.isHovered) {\n return 'neutral-black';\n } else {\n return 'neutral-dark';\n }\n }\n\n @Watch('status')\n @Watch('mode')\n renderIcon() {\n if ((this.iconName === '' && this.status === 'default') || (this.mode === 'transparent' && this.isLoading) || (this.mode === 'transparent' && this.status === 'default')) {\n return;\n }\n // Used when input is rendered in cura-dropdown-search with error status\n if (this.status === 'error' && this.hideErrorIcon) {\n return;\n }\n\n const iconSizeDefaultMode = this.size === 'large' ? 20 : 16;\n const baseIconSize = this.mode === 'transparent' ? 20 : iconSizeDefaultMode;\n\n const iconMap: { [key: string]: { name: string; color: string } } = {\n loading: { name: this.iconName, color: 'primary-base' },\n success: { name: 'checkCircle', color: 'success-dark' },\n error: { name: 'alertCircle', color: 'error-dark' },\n default: { name: this.iconName, color: 'neutral-dark' },\n disabled: { name: this.iconName, color: 'neutral-medium' },\n };\n\n const iconConfig = iconMap[this.isLoading ? 'loading' : this.disabled ? 'disabled' : this.status || 'default'];\n\n return (\n <div class=\"feedback-icon\" style={this.styles}>\n <cura-icon name={iconConfig.name} iconset=\"default\" size={baseIconSize} color={iconConfig.color} />\n </div>\n );\n }\n\n renderHelperText() {\n const isError = this.status === 'error';\n const isSuccess = this.status === 'success';\n const isDefault = this.status === 'default';\n const helperTextSize = this.size === 'large' ? 'small' : 'xsmall';\n const colorText = (() => {\n if (this.disabled) return 'neutral-medium';\n if (this.isLoading) return 'primary-base';\n if (this.isFocused || this.isHovered) return 'neutral-black';\n return 'neutral-dark';\n })();\n\n return (\n <div style={this.styles} class=\"helper-text\" part=\"cura-input-text-helper\">\n {isDefault && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color={colorText}>\n <slot></slot>\n </cura-label>\n )}\n {isError && this.mode === 'default' && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color=\"error-dark\">\n <slot></slot>\n </cura-label>\n )}\n {isError && this.mode === 'transparent' && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color=\"neutral-black\">\n <slot></slot>\n </cura-label>\n )}\n {isSuccess && (\n <cura-label size={helperTextSize} lineHeight=\"xsmall\" color=\"success-dark\">\n <slot></slot>\n </cura-label>\n )}\n </div>\n );\n }\n\n handleMouseEnter() {\n this.isHovered = true;\n }\n handleMouseLeave() {\n this.isHovered = false;\n }\n\n componentDidLoad() {\n this.initializeMask();\n }\n\n disconnectedCallback() {\n this.destroyMask();\n }\n\n handleMaskUpdate() {\n if (this.maskedInput) {\n this.maskedInput.updateValue();\n }\n }\n\n handleClearInput() {\n this.handleMaskUpdate();\n this.value = '';\n this.inputRef.value = '';\n this.valueChange.emit(this.value);\n this.inputClear.emit(this.value);\n this.handleMaskUpdate();\n this.setFocus();\n }\n\n handleInputFocus() {\n this.handleMaskUpdate();\n this.isFocused = true;\n }\n\n handleInputBlur() {\n this.handleMaskUpdate();\n setTimeout(() => {\n this.isFocused = false;\n }, 150);\n }\n\n shouldDisplayMask() {\n return this.maskPreset || this.maskRegex || this.maskAdvanced;\n }\n\n @Watch('maskPreset')\n @Watch('maskRegex')\n @Watch('maskAdvanced')\n initializeMask() {\n if (this.shouldDisplayMask()) {\n if (this.maskedInput) {\n this.destroyMask();\n }\n if (this.maskPreset) {\n this.initializePresetMask();\n } else if (this.maskRegex) {\n this.initializeRegexMask();\n } else if (this.maskAdvanced) {\n this.initializeAdvancedMask();\n }\n this.applyValueToMask();\n } else {\n this.clearMaskValue();\n }\n }\n\n initializeRegexMask() {\n const cleanedRegexString = this.maskRegex.replace(/^\\/|\\/[gimsuy]*$/g, '');\n const flags = (this.maskRegex.match(/\\/[gimsuy]*$/g) || [''])[0].slice(1);\n this.maskedInput = IMask(this.inputRef, { mask: new RegExp(cleanedRegexString, flags) });\n }\n\n initializePresetMask() {\n const options = maskOptions[this.maskPreset];\n\n if (options) {\n this.maskedInput = IMask(this.inputRef, options);\n } else {\n console.error(`Mask preset \"${this.maskPreset}\" not found.`);\n }\n }\n\n initializeAdvancedMask() {\n if (!this.inputRef) return;\n\n try {\n const config = typeof this.maskAdvanced === 'string' ? JSON.parse(this.maskAdvanced) : this.maskAdvanced;\n this.maskedInput = IMask(this.inputRef, config);\n } catch (error) {\n console.error('Error defining maskAdvanced:', error);\n }\n }\n\n applyValueToMask() {\n if (this.maskedInput) {\n if (this.maskedInput.mask === Date || this.maskedInput.mask === Number) {\n this.maskedInput.typedValue = this.value;\n } else {\n this.value = this.maskedInput.value;\n }\n this.handleMaskUpdate();\n }\n }\n\n clearMaskValue() {\n this.inputRef.value = this.value as string;\n }\n\n destroyMask() {\n if (this.maskedInput) {\n this.maskedInput.destroy();\n this.maskedInput = undefined;\n }\n }\n\n handleInputChange(event: any) {\n const inputValue = event.target.value;\n\n this.valueChange.emit(inputValue);\n\n if (this.type === 'number') {\n this.handleNumberInputChange(inputValue);\n } else {\n this.handleTextInputChange(inputValue);\n }\n this.internals.setFormValue(this.value as string);\n }\n\n handleNumberInputChange(inputValue: string) {\n const numericValue = parseFloat(inputValue);\n if (!isNaN(numericValue)) {\n this.value = numericValue;\n } else {\n console.error('Invalid numeric input:', inputValue);\n }\n }\n\n handleTextInputChange(inputValue: string) {\n if (this.maskedInput) {\n if (this.maskedInput.mask instanceof Date || this.maskedInput.mask === Number) {\n this.maskedInput.typedValue = inputValue;\n this.value = this.maskedInput.typedValue;\n }\n this.value = this.maskedInput.value;\n } else {\n this.value = inputValue;\n }\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.type === 'number') {\n this.handleBlockInvalidNumber(event);\n }\n }\n\n handleBlockInvalidNumber(e: KeyboardEvent) {\n if (['e', 'E', '+', '-'].includes(e.key)) e.preventDefault();\n }\n\n render() {\n return (\n <Host role=\"textbox\" aria-disabled={this.disabled} aria-required={this.required} aria-invalid={this.status === 'error'}>\n <div\n style={this.styles}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n class={{\n 'cura-input-group': true,\n ...this.getClasses(),\n }}\n >\n <div class=\"input-wrapper\">\n {this.label && (\n <cura-label class=\"label\" weight=\"bold\" size={this.size === 'large' ? 'small' : 'xsmall'} color={this.getLabelColor()}>\n {this.label} {this.required && <span class=\"required\">* </span>}\n </cura-label>\n )}\n <div class=\"cura-input-field\" part=\"cura-input-field\" style={this.styles}>\n {this.renderIcon()}\n <input\n name={this.name ? this.name : ''}\n type={this.type}\n onKeyDown={event => this.handleKeyDown(event)}\n onBlur={this.handleInputBlur.bind(this)}\n onFocus={this.handleInputFocus.bind(this)}\n onInput={event => this.handleInputChange(event)}\n class={this.getClasses()}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled || this.isLoading}\n required={this.required}\n readonly={this.readOnly}\n maxlength={this.maxlength}\n value={this.value !== undefined && this.value !== null ? this.value : ''}\n inputmode={this.maskPreset ? 'tel' : this.inputMode}\n ref={ref => (this.inputRef = ref)}\n autocomplete={this.autocomplete}\n />\n {!!this.clearIcon && !this.readOnly && !this.isLoading && !this.disabled && this.value && this.isFocused && (\n <cura-icon\n size={this.size === 'large' || this.mode === 'transparent' ? 20 : 16}\n color=\"primary-base\"\n name=\"closeCircle\"\n iconset=\"default\"\n class=\"clear-button\"\n onMouseDown={() => this.handleClearInput()}\n />\n )}\n {this.isLoading && <cura-loader-circle size={this.size === 'large' ? 'medium' : 'small'} color=\"primary-base\"></cura-loader-circle>}\n </div>\n {this.renderHelperText()}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -205,14 +205,14 @@ export class CuraSelect {
|
|
|
205
205
|
* Initializes the options for the select component.
|
|
206
206
|
*/
|
|
207
207
|
componentWillLoad() {
|
|
208
|
-
|
|
208
|
+
this.initializeOptions();
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Lifecycle method called after the component is rendered.
|
|
212
212
|
* Initializes select-related functionality.
|
|
213
213
|
*/
|
|
214
214
|
componentDidLoad() {
|
|
215
|
-
this.initializeOptions();
|
|
215
|
+
// this.initializeOptions();
|
|
216
216
|
this.setupMutationObserver();
|
|
217
217
|
this.addOutsideClickListener();
|
|
218
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-select.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-select/cura-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQtH,MAAM,OAAO,UAAU;IANvB;QAOE;;;WAGG;QACsB,UAAK,GAAW,EAAE,CAAC;QAE5C;;;WAGG;QACsB,gBAAW,GAAW,EAAE,CAAC;QAElD;;;WAGG;QACqC,UAAK,GAAW,EAAE,CAAC;QAE3D;;;WAGG;QACsB,SAAI,GAA8B,SAAS,CAAC;QAErE;;;WAGG;QACsB,SAAI,GAAiC,QAAQ,CAAC;QAIvE;;;WAGG;QACqC,WAAM,GAAoC,SAAS,CAAC;QAE5F;;;WAGG;QACsB,aAAQ,GAAY,KAAK,CAAC;QAEnD;;;WAGG;QACsB,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E,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE;oBAEzC,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, h, Event, EventEmitter, AttachInternals, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-select',\n styleUrl: 'cura-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraSelect {\n /**\n * The label text for the select component.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) label: string = '';\n\n /**\n * Placeholder text for the input field.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n\n /**\n * Current value of the select component.\n * Reflects as an attribute in the DOM and is mutable.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Display mode of the select component.\n * Can be 'default' or 'transparent'.\n */\n @Prop({ reflect: true }) mode: 'default' | 'transparent' = 'default';\n\n /**\n * Size of the select component.\n * Can be 'small', 'medium', or 'large'.\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n @Prop() iconName?: string;\n\n /**\n * Status of the select component.\n * Can be 'success', 'error', or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'success' | 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the select component is required.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Enable / Disable search at options by term.\n * Default: false\n */\n @Prop({ reflect: true }) searchBehavior: boolean = false;\n\n /**\n * The search will be sensitive to accents.\n * Default: true\n */\n @Prop({ reflect: true }) caseSensitive: boolean = true;\n\n /**\n * CSS max-height property for dropdown item.\n * Can also be used by css property --max-height.\n * Default: 285px\n */\n @Prop({ reflect: true }) maxHeight: string = '285px';\n\n /**\n * Internal state: Whether the input is hovered.\n * Default: false\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused.\n * Default: false\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Whether the dropdown menu is open.\n * Default: false\n */\n @State() isOpen: boolean = false;\n\n /**\n * Internal state: Collection of options for the select component.\n */\n @State() options: NodeListOf<HTMLCuraSelectOptionElement>;\n\n @State() activeIndex = -1;\n\n @Watch('activeIndex')\n updateOptionHighlights(newActiveINdex: number) {\n this.options.forEach((option, index) => ((option as any).active = index === newActiveINdex));\n }\n\n @State() textInput = '';\n\n @Watch('textInput')\n /**\n * Filters the options based on the current input value.\n */\n filterOptions(newText) {\n this.searchTermInput.emit(newText);\n\n if (!this.isOpen || !this.searchBehavior) {\n return;\n }\n\n const removeAccents = (str: string) => {\n return str.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n };\n\n let searchTerm = newText;\n if (!this.caseSensitive) {\n searchTerm = removeAccents(searchTerm).toLocaleLowerCase();\n }\n\n this.options.forEach(option => {\n let optionValue = option.textContent || '';\n if (!this.caseSensitive) {\n optionValue = removeAccents(optionValue?.toLowerCase());\n }\n const isVisible = optionValue.includes(searchTerm);\n option.style.display = isVisible ? 'block' : 'none';\n });\n }\n\n /**\n * Reference to the host element of the component.\n */\n @Element() host: HTMLElement;\n\n /**\n * Event emitted when an option is selected.\n */\n @Event() selected: EventEmitter;\n\n /**\n * Event emitted when an option is searched.\n */\n @Event() searchTermInput: EventEmitter;\n\n /**\n * MutationObserver to watch changes in the component.\n */\n mutationObserver: MutationObserver;\n\n /**\n * Styles to be applied to the component.\n */\n styles = {};\n\n /**\n * Theme object containing font and color information.\n */\n theme = window.CuraAPI.theme;\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.textInput = state.value;\n this.updateSelectedOption();\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.textInput = '';\n this.clearSelectedAttributes();\n this.internals.setFormValue('');\n this.internals.setValidity({});\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Lifecycle method called before the component is rendered.\n * Initializes the options for the select component.\n */\n componentWillLoad() {\n // this.initializeOptions();\n }\n /**\n * Lifecycle method called after the component is rendered.\n * Initializes select-related functionality.\n */\n componentDidLoad() {\n this.initializeOptions();\n this.setupMutationObserver();\n this.addOutsideClickListener();\n }\n /**\n * Lifecycle method called when the component is connected to the DOM.\n * Applies styles based on the theme.\n */\n connectedCallback() {\n this.applyStyles();\n }\n /**\n * Lifecycle method called when the component is disconnected from the DOM.\n * Disconnects the MutationObserver if it exists.\n */\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.removeOutsideClickListener();\n }\n\n initializeOptions() {\n this.options = this.host.querySelectorAll<HTMLCuraSelectOptionElement>('cura-select-option');\n this.options.forEach(option => {\n option.setAttribute('size', this.size);\n\n const isSelected = this.value === option.value;\n option.setAttribute('selected', JSON.stringify(isSelected));\n\n if (isSelected) {\n this.value = option.value;\n this.internals.setFormValue(option.value);\n }\n });\n\n this.textInput = Array.from(this.options).find(option => option.value === this.value)?.textContent || this.textInput;\n }\n /**\n * Applies styles to the component based on the theme.\n */\n applyStyles() {\n const { fonts, colors } = this.theme;\n const fontWeights = fonts.getWeights();\n\n this.styles = {\n ...this.styles,\n '--font-weight-medium': fontWeights.medium,\n '--font-weight-bold': fontWeights.bold,\n '--font-weight-regular': fontWeights.regular,\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-size': fonts.getSize(),\n };\n\n const colorKeys = [\n 'primary-base',\n 'neutral-purewhite',\n 'neutral-white',\n 'neutral-black',\n 'neutral-medium',\n 'neutral-light',\n 'neutral-base',\n 'neutral-dark',\n 'success-dark',\n 'success-darker',\n 'success-lighter',\n 'error-lighter',\n 'error-dark',\n 'error-darker',\n 'error-base',\n 'info-base',\n ];\n\n colorKeys.forEach(key => {\n this.styles[`--${key}`] = colors.getColor(key);\n });\n }\n /**\n * Sets up a MutationObserver to watch for changes in the component.\n */\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver(this.handleMutations);\n this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });\n }\n /**\n * Handles mutations observed by the MutationObserver.\n * Updates the selected option or filters options based on the mutation type.\n */\n handleMutations = (mutations: MutationRecord[]) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n if (mutation.attributeName === 'selected') this.updateSelectedOption();\n }\n });\n };\n /**\n * Handles the selection of an option.\n */\n onOptiselected = (event: Event) => {\n const selectedOption = event.target as HTMLElement;\n this.clearSelectedAttributes();\n selectedOption.setAttribute('selected', 'true');\n };\n\n @Watch('value')\n handleValueChange(newValue: string) {\n this.clearSelectedAttributes();\n\n const selectedOption = this.host.querySelector(`cura-select-option[value=\"${newValue}\"]`);\n\n if (!selectedOption) {\n return;\n }\n\n selectedOption.setAttribute('selected', 'true');\n }\n\n updateSelectedOption() {\n const selectedOptionElement = this.host.querySelector<HTMLCuraSelectOptionElement>('cura-select-option[selected]');\n\n if (!selectedOptionElement) {\n return;\n }\n\n this.value = selectedOptionElement.value;\n this.internals.setFormValue(this.value);\n\n if (this.textInput !== selectedOptionElement.textContent) {\n this.textInput = selectedOptionElement.textContent;\n this.isOpen = false;\n this.selected.emit(selectedOptionElement.value);\n }\n }\n\n /**\n * Clears the 'selected' attribute from all options.\n */\n clearSelectedAttributes() {\n this.options.forEach(option => option.removeAttribute('selected'));\n }\n\n handleKeyNavigation = (event: KeyboardEvent) => {\n const { code: keyCode } = event;\n\n if (!this.isOpen && keyCode === 'ArrowDown') {\n this.isOpen = true;\n this.activeIndex = 0;\n\n return;\n }\n\n if (keyCode === 'ArrowDown') {\n event.preventDefault();\n this.updateActiveIndex(1);\n }\n\n if (keyCode === 'ArrowUp') {\n event.preventDefault();\n this.updateActiveIndex(-1);\n }\n\n if (keyCode === 'Enter' || keyCode === 'Space') {\n this.options[this.activeIndex]?.click();\n }\n\n if (keyCode === 'Escape') {\n this.isOpen = false;\n }\n };\n\n updateActiveIndex(direction: number) {\n if (this.options.length === 0) return;\n this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;\n }\n\n handleInputChange = (e: Event) => {\n this.textInput = (e.target as HTMLInputElement).value;\n this.isOpen = this.textInput.length > 0;\n this.internals.setFormValue(this.textInput);\n };\n\n getClasses() {\n return {\n wrapper: true,\n label: !!this.label,\n disabled: this.disabled,\n transparent: this.mode === 'transparent',\n [this.size.toLowerCase()]: true,\n [this.status.toLowerCase()]: true,\n };\n }\n\n /**\n * Determines the color based on the item type and component state.\n */\n getColor(item: 'label' | 'text' | 'icon') {\n if (this.disabled) return 'neutral-medium';\n\n const isStatusDefault = this.status === 'default';\n const isHoveredOrFocused = this.isFocused || this.isHovered;\n\n if (item === 'label') {\n if (!isStatusDefault || isHoveredOrFocused) return 'neutral-black';\n return 'neutral-dark';\n }\n\n if (isHoveredOrFocused && isStatusDefault) return 'neutral-black';\n if (this.status === 'success') return 'success-dark';\n if (this.status === 'error') return 'error-dark';\n\n return 'neutral-dark';\n }\n\n /**\n * Renders the icon based on the component's status.\n */\n renderIcon() {\n if (this.status === 'default' && !this.iconName) return null;\n const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];\n return <cura-icon class=\"feedback-icon\" name={icon} iconset=\"default\" size={this.size === 'large' ? 20 : 16} color={this.getColor('icon')} style={this.styles} />;\n }\n\n handleClick = (event: MouseEvent) => {\n if (this.disabled) return event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'CURA-SELECT-OPTION') return this.onOptiselected(event);\n this.isOpen = !this.isOpen;\n };\n\n handleClickOutside = (event: MouseEvent) => {\n const clickedOutside = !this.host.contains(event.target as Node);\n if (clickedOutside) {\n this.isOpen = false;\n }\n };\n\n private addOutsideClickListener() {\n document.addEventListener('click', this.handleClickOutside);\n }\n\n private removeOutsideClickListener() {\n document.removeEventListener('click', this.handleClickOutside);\n }\n\n render() {\n return (\n <Host style={this.styles}\n role=\"combobox\"\n aria-label={this.label}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}>\n <div class={this.getClasses()} onMouseEnter={() => (this.isHovered = true)} onMouseLeave={() => (this.isHovered = false)} onClick={this.handleClick}>\n {this.label && (\n <cura-label class=\"label\" weight=\"bold\" size={this.size === 'large' ? 'small' : 'xsmall'} color={this.getColor('label')}>\n {this.label} {this.required && <span class=\"required\">* </span>}\n </cura-label>\n )}\n\n <div\n class={{\n 'cura-input-field': true,\n 'open': this.isOpen,\n }}\n >\n {this.renderIcon()}\n <input\n type=\"text\"\n autocomplete=\"off\"\n onFocus={() => (this.isFocused = true)}\n onBlur={() => (this.isFocused = false)}\n onKeyDown={this.handleKeyNavigation}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}\n onInput={this.handleInputChange}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.textInput}\n readonly={this.searchBehavior ? null : true}\n />\n <button class=\"up-down-button\">\n <cura-icon name={this.isOpen ? 'up' : 'down'} class=\"up-down-icon\" color={this.disabled ? 'neutral-dark' : 'primary-base'} size={16} iconset=\"default\" />\n </button>\n </div>\n <cura-label class=\"helper-text\" size=\"xsmall\" color={this.getColor('text')} weight={this.mode === 'transparent' ? 'bold' : 'regular'}>\n <slot></slot>\n </cura-label>\n {this.isOpen && (\n <div\n class={{\n menu: true,\n open: this.isOpen,\n }}\n style={{ '--max-height': this.maxHeight }}\n >\n <slot name=\"option\"></slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cura-select.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-select/cura-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQtH,MAAM,OAAO,UAAU;IANvB;QAOE;;;WAGG;QACsB,UAAK,GAAW,EAAE,CAAC;QAE5C;;;WAGG;QACsB,gBAAW,GAAW,EAAE,CAAC;QAElD;;;WAGG;QACqC,UAAK,GAAW,EAAE,CAAC;QAE3D;;;WAGG;QACsB,SAAI,GAA8B,SAAS,CAAC;QAErE;;;WAGG;QACsB,SAAI,GAAiC,QAAQ,CAAC;QAIvE;;;WAGG;QACqC,WAAM,GAAoC,SAAS,CAAC;QAE5F;;;WAGG;QACsB,aAAQ,GAAY,KAAK,CAAC;QAEnD;;;WAGG;QACsB,aAAQ,GAAY,KAAK,CAAC;QAEnD;;;WAGG;QACsB,mBAAc,GAAY,KAAK,CAAC;QAEzD;;;WAGG;QACsB,kBAAa,GAAY,IAAI,CAAC;QAEtD;;;;WAIG;QACsB,cAAS,GAAW,OAAO,CAAC;QAEtD;;;WAGG;QACM,cAAS,GAAY,KAAK,CAAC;QAEpC;;;WAGG;QACM,cAAS,GAAY,KAAK,CAAC;QAEpC;;;WAGG;QACM,WAAM,GAAY,KAAK,CAAC;QAOxB,gBAAW,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, h, Event, EventEmitter, AttachInternals, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-select',\n styleUrl: 'cura-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraSelect {\n /**\n * The label text for the select component.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) label: string = '';\n\n /**\n * Placeholder text for the input field.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n\n /**\n * Current value of the select component.\n * Reflects as an attribute in the DOM and is mutable.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Display mode of the select component.\n * Can be 'default' or 'transparent'.\n */\n @Prop({ reflect: true }) mode: 'default' | 'transparent' = 'default';\n\n /**\n * Size of the select component.\n * Can be 'small', 'medium', or 'large'.\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n @Prop() iconName?: string;\n\n /**\n * Status of the select component.\n * Can be 'success', 'error', or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'success' | 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the select component is required.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Enable / Disable search at options by term.\n * Default: false\n */\n @Prop({ reflect: true }) searchBehavior: boolean = false;\n\n /**\n * The search will be sensitive to accents.\n * Default: true\n */\n @Prop({ reflect: true }) caseSensitive: boolean = true;\n\n /**\n * CSS max-height property for dropdown item.\n * Can also be used by css property --max-height.\n * Default: 285px\n */\n @Prop({ reflect: true }) maxHeight: string = '285px';\n\n /**\n * Internal state: Whether the input is hovered.\n * Default: false\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused.\n * Default: false\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Whether the dropdown menu is open.\n * Default: false\n */\n @State() isOpen: boolean = false;\n\n /**\n * Internal state: Collection of options for the select component.\n */\n @State() options: NodeListOf<HTMLCuraSelectOptionElement>;\n\n @State() activeIndex = -1;\n\n @Watch('activeIndex')\n updateOptionHighlights(newActiveINdex: number) {\n this.options.forEach((option, index) => ((option as any).active = index === newActiveINdex));\n }\n\n @State() textInput = '';\n\n @Watch('textInput')\n /**\n * Filters the options based on the current input value.\n */\n filterOptions(newText) {\n this.searchTermInput.emit(newText);\n\n if (!this.isOpen || !this.searchBehavior) {\n return;\n }\n\n const removeAccents = (str: string) => {\n return str.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n };\n\n let searchTerm = newText;\n if (!this.caseSensitive) {\n searchTerm = removeAccents(searchTerm).toLocaleLowerCase();\n }\n\n this.options.forEach(option => {\n let optionValue = option.textContent || '';\n if (!this.caseSensitive) {\n optionValue = removeAccents(optionValue?.toLowerCase());\n }\n const isVisible = optionValue.includes(searchTerm);\n option.style.display = isVisible ? 'block' : 'none';\n });\n }\n\n /**\n * Reference to the host element of the component.\n */\n @Element() host: HTMLElement;\n\n /**\n * Event emitted when an option is selected.\n */\n @Event() selected: EventEmitter;\n\n /**\n * Event emitted when an option is searched.\n */\n @Event() searchTermInput: EventEmitter;\n\n /**\n * MutationObserver to watch changes in the component.\n */\n mutationObserver: MutationObserver;\n\n /**\n * Styles to be applied to the component.\n */\n styles = {};\n\n /**\n * Theme object containing font and color information.\n */\n theme = window.CuraAPI.theme;\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.textInput = state.value;\n this.updateSelectedOption();\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.textInput = '';\n this.clearSelectedAttributes();\n this.internals.setFormValue('');\n this.internals.setValidity({});\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Lifecycle method called before the component is rendered.\n * Initializes the options for the select component.\n */\n componentWillLoad() {\n this.initializeOptions();\n }\n /**\n * Lifecycle method called after the component is rendered.\n * Initializes select-related functionality.\n */\n componentDidLoad() {\n // this.initializeOptions();\n this.setupMutationObserver();\n this.addOutsideClickListener();\n }\n /**\n * Lifecycle method called when the component is connected to the DOM.\n * Applies styles based on the theme.\n */\n connectedCallback() {\n this.applyStyles();\n }\n /**\n * Lifecycle method called when the component is disconnected from the DOM.\n * Disconnects the MutationObserver if it exists.\n */\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.removeOutsideClickListener();\n }\n\n initializeOptions() {\n this.options = this.host.querySelectorAll<HTMLCuraSelectOptionElement>('cura-select-option');\n this.options.forEach(option => {\n option.setAttribute('size', this.size);\n\n const isSelected = this.value === option.value;\n option.setAttribute('selected', JSON.stringify(isSelected));\n\n if (isSelected) {\n this.value = option.value;\n this.internals.setFormValue(option.value);\n }\n });\n\n this.textInput = Array.from(this.options).find(option => option.value === this.value)?.textContent || this.textInput;\n }\n /**\n * Applies styles to the component based on the theme.\n */\n applyStyles() {\n const { fonts, colors } = this.theme;\n const fontWeights = fonts.getWeights();\n\n this.styles = {\n ...this.styles,\n '--font-weight-medium': fontWeights.medium,\n '--font-weight-bold': fontWeights.bold,\n '--font-weight-regular': fontWeights.regular,\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-size': fonts.getSize(),\n };\n\n const colorKeys = [\n 'primary-base',\n 'neutral-purewhite',\n 'neutral-white',\n 'neutral-black',\n 'neutral-medium',\n 'neutral-light',\n 'neutral-base',\n 'neutral-dark',\n 'success-dark',\n 'success-darker',\n 'success-lighter',\n 'error-lighter',\n 'error-dark',\n 'error-darker',\n 'error-base',\n 'info-base',\n ];\n\n colorKeys.forEach(key => {\n this.styles[`--${key}`] = colors.getColor(key);\n });\n }\n /**\n * Sets up a MutationObserver to watch for changes in the component.\n */\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver(this.handleMutations);\n this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });\n }\n /**\n * Handles mutations observed by the MutationObserver.\n * Updates the selected option or filters options based on the mutation type.\n */\n handleMutations = (mutations: MutationRecord[]) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n if (mutation.attributeName === 'selected') this.updateSelectedOption();\n }\n });\n };\n /**\n * Handles the selection of an option.\n */\n onOptiselected = (event: Event) => {\n const selectedOption = event.target as HTMLElement;\n this.clearSelectedAttributes();\n selectedOption.setAttribute('selected', 'true');\n };\n\n @Watch('value')\n handleValueChange(newValue: string) {\n this.clearSelectedAttributes();\n\n const selectedOption = this.host.querySelector(`cura-select-option[value=\"${newValue}\"]`);\n\n if (!selectedOption) {\n return;\n }\n\n selectedOption.setAttribute('selected', 'true');\n }\n\n updateSelectedOption() {\n const selectedOptionElement = this.host.querySelector<HTMLCuraSelectOptionElement>('cura-select-option[selected]');\n\n if (!selectedOptionElement) {\n return;\n }\n\n this.value = selectedOptionElement.value;\n this.internals.setFormValue(this.value);\n\n if (this.textInput !== selectedOptionElement.textContent) {\n this.textInput = selectedOptionElement.textContent;\n this.isOpen = false;\n this.selected.emit(selectedOptionElement.value);\n }\n }\n\n /**\n * Clears the 'selected' attribute from all options.\n */\n clearSelectedAttributes() {\n this.options.forEach(option => option.removeAttribute('selected'));\n }\n\n handleKeyNavigation = (event: KeyboardEvent) => {\n const { code: keyCode } = event;\n\n if (!this.isOpen && keyCode === 'ArrowDown') {\n this.isOpen = true;\n this.activeIndex = 0;\n\n return;\n }\n\n if (keyCode === 'ArrowDown') {\n event.preventDefault();\n this.updateActiveIndex(1);\n }\n\n if (keyCode === 'ArrowUp') {\n event.preventDefault();\n this.updateActiveIndex(-1);\n }\n\n if (keyCode === 'Enter' || keyCode === 'Space') {\n this.options[this.activeIndex]?.click();\n }\n\n if (keyCode === 'Escape') {\n this.isOpen = false;\n }\n };\n\n updateActiveIndex(direction: number) {\n if (this.options.length === 0) return;\n this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;\n }\n\n handleInputChange = (e: Event) => {\n this.textInput = (e.target as HTMLInputElement).value;\n this.isOpen = this.textInput.length > 0;\n this.internals.setFormValue(this.textInput);\n };\n\n getClasses() {\n return {\n wrapper: true,\n label: !!this.label,\n disabled: this.disabled,\n transparent: this.mode === 'transparent',\n [this.size.toLowerCase()]: true,\n [this.status.toLowerCase()]: true,\n };\n }\n\n /**\n * Determines the color based on the item type and component state.\n */\n getColor(item: 'label' | 'text' | 'icon') {\n if (this.disabled) return 'neutral-medium';\n\n const isStatusDefault = this.status === 'default';\n const isHoveredOrFocused = this.isFocused || this.isHovered;\n\n if (item === 'label') {\n if (!isStatusDefault || isHoveredOrFocused) return 'neutral-black';\n return 'neutral-dark';\n }\n\n if (isHoveredOrFocused && isStatusDefault) return 'neutral-black';\n if (this.status === 'success') return 'success-dark';\n if (this.status === 'error') return 'error-dark';\n\n return 'neutral-dark';\n }\n\n /**\n * Renders the icon based on the component's status.\n */\n renderIcon() {\n if (this.status === 'default' && !this.iconName) return null;\n const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];\n return <cura-icon class=\"feedback-icon\" name={icon} iconset=\"default\" size={this.size === 'large' ? 20 : 16} color={this.getColor('icon')} style={this.styles} />;\n }\n\n handleClick = (event: MouseEvent) => {\n if (this.disabled) return event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'CURA-SELECT-OPTION') return this.onOptiselected(event);\n this.isOpen = !this.isOpen;\n };\n\n handleClickOutside = (event: MouseEvent) => {\n const clickedOutside = !this.host.contains(event.target as Node);\n if (clickedOutside) {\n this.isOpen = false;\n }\n };\n\n private addOutsideClickListener() {\n document.addEventListener('click', this.handleClickOutside);\n }\n\n private removeOutsideClickListener() {\n document.removeEventListener('click', this.handleClickOutside);\n }\n\n render() {\n return (\n <Host style={this.styles}\n role=\"combobox\"\n aria-label={this.label}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}>\n <div class={this.getClasses()} onMouseEnter={() => (this.isHovered = true)} onMouseLeave={() => (this.isHovered = false)} onClick={this.handleClick}>\n {this.label && (\n <cura-label class=\"label\" weight=\"bold\" size={this.size === 'large' ? 'small' : 'xsmall'} color={this.getColor('label')}>\n {this.label} {this.required && <span class=\"required\">* </span>}\n </cura-label>\n )}\n\n <div\n class={{\n 'cura-input-field': true,\n 'open': this.isOpen,\n }}\n >\n {this.renderIcon()}\n <input\n type=\"text\"\n autocomplete=\"off\"\n onFocus={() => (this.isFocused = true)}\n onBlur={() => (this.isFocused = false)}\n onKeyDown={this.handleKeyNavigation}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}\n onInput={this.handleInputChange}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.textInput}\n readonly={this.searchBehavior ? null : true}\n />\n <button class=\"up-down-button\">\n <cura-icon name={this.isOpen ? 'up' : 'down'} class=\"up-down-icon\" color={this.disabled ? 'neutral-dark' : 'primary-base'} size={16} iconset=\"default\" />\n </button>\n </div>\n <cura-label class=\"helper-text\" size=\"xsmall\" color={this.getColor('text')} weight={this.mode === 'transparent' ? 'bold' : 'regular'}>\n <slot></slot>\n </cura-label>\n {this.isOpen && (\n <div\n class={{\n menu: true,\n open: this.isOpen,\n }}\n style={{ '--max-height': this.maxHeight }}\n >\n <slot name=\"option\"></slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, e as createEvent, h, d as Host } from './p-D1cPOZpG.js';
|
|
2
|
-
import { a as addBodyScrollLockClass, r as removeBodyScrollLockClass, c as checkMobile, b as checkIOS, d as defineCustomElement$4 } from './p-
|
|
2
|
+
import { a as addBodyScrollLockClass, r as removeBodyScrollLockClass, c as checkMobile, b as checkIOS, d as defineCustomElement$4 } from './p-CgMS6FUK.js';
|
|
3
3
|
import { d as defineCustomElement$6 } from './p-BRDqwZ4N.js';
|
|
4
4
|
import { d as defineCustomElement$5 } from './p-B5aO1chh.js';
|
|
5
5
|
import { d as defineCustomElement$3 } from './p-DR1RHrEX.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, e as createEvent, h, d as Host } from './p-D1cPOZpG.js';
|
|
2
2
|
import { d as defineCustomElement$9 } from './p-BRDqwZ4N.js';
|
|
3
|
-
import { i as isBefore, a as isAfter, d as defineCustomElement$8 } from './p-
|
|
3
|
+
import { i as isBefore, a as isAfter, d as defineCustomElement$8 } from './p-BGnJiNyu.js';
|
|
4
4
|
import { d as defineCustomElement$7 } from './p-B5aO1chh.js';
|
|
5
|
-
import { d as defineCustomElement$6 } from './p-
|
|
5
|
+
import { d as defineCustomElement$6 } from './p-CgMS6FUK.js';
|
|
6
6
|
import { d as defineCustomElement$5 } from './p-DR1RHrEX.js';
|
|
7
7
|
import { d as defineCustomElement$4 } from './p-Dqm2sAwv.js';
|
|
8
|
-
import { d as defineCustomElement$3 } from './p-
|
|
8
|
+
import { d as defineCustomElement$3 } from './p-BTt-pVTn.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './p-DpIu_Oxz.js';
|
|
10
10
|
|
|
11
11
|
const curaInputDateCss = ":host{display:block}.container{display:flex;flex-direction:column;position:relative}.container .calendar{padding:0px calc(var(--cura-spacing-base) * 3px);margin-top:-8px;border-radius:0px 0px 4px 4px;border-top:0px;border-right:2px solid #D4D4D4;border-bottom:2px solid #D4D4D4;border-left:2px solid #D4D4D4;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));position:absolute;top:100%;z-index:10;display:none;opacity:0;pointer-events:none}.container .calendar.visible{box-sizing:border-box;display:block;opacity:1;pointer-events:all;width:100%;background-color:#fff}";
|
|
@@ -3,7 +3,7 @@ import { d as defineCustomElement$6 } from './p-BRDqwZ4N.js';
|
|
|
3
3
|
import { d as defineCustomElement$5 } from './p-B5aO1chh.js';
|
|
4
4
|
import { d as defineCustomElement$4 } from './p-DR1RHrEX.js';
|
|
5
5
|
import { d as defineCustomElement$3 } from './p-Dqm2sAwv.js';
|
|
6
|
-
import { d as defineCustomElement$2 } from './p-
|
|
6
|
+
import { d as defineCustomElement$2 } from './p-BTt-pVTn.js';
|
|
7
7
|
import { d as defineCustomElement$1 } from './p-DpIu_Oxz.js';
|
|
8
8
|
|
|
9
9
|
function _typeof(o) {
|
|
@@ -7027,6 +7027,6 @@ function defineCustomElement() {
|
|
|
7027
7027
|
}
|
|
7028
7028
|
|
|
7029
7029
|
export { CuraCalendar as C, isAfter as a, defineCustomElement as d, isBefore as i };
|
|
7030
|
-
//# sourceMappingURL=p-
|
|
7030
|
+
//# sourceMappingURL=p-BGnJiNyu.js.map
|
|
7031
7031
|
|
|
7032
|
-
//# sourceMappingURL=p-
|
|
7032
|
+
//# sourceMappingURL=p-BGnJiNyu.js.map
|