@carbon/web-components 2.54.0-rc.0 → 2.54.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/custom-elements.json +15 -4
- package/es/components/dropdown/dropdown.d.ts +3 -2
- package/es/components/dropdown/dropdown.d.ts.map +1 -1
- package/es/components/dropdown/dropdown.js +9 -2
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/fluid-form/fluid-form.d.ts +19 -0
- package/es/components/fluid-form/fluid-form.d.ts.map +1 -0
- package/es/components/fluid-form/fluid-form.js +44 -0
- package/es/components/fluid-form/fluid-form.js.map +1 -0
- package/es/components/fluid-form/fluid-form.scss.js +14 -0
- package/es/components/fluid-form/fluid-form.scss.js.map +1 -0
- package/es/components/fluid-form/index.d.ts +8 -0
- package/es/components/fluid-form/index.d.ts.map +1 -0
- package/es/components/fluid-form/index.js +8 -0
- package/es/components/fluid-number-input/fluid-number-input.scss.js +1 -1
- package/es/components/fluid-number-input/fluid-number-input.scss.js.map +1 -1
- package/es/components/fluid-password-input/fluid-password-input.scss.js +1 -1
- package/es/components/fluid-password-input/fluid-password-input.scss.js.map +1 -1
- package/es/components/fluid-select/fluid-select.scss.js +1 -1
- package/es/components/fluid-select/fluid-select.scss.js.map +1 -1
- package/es/components/fluid-text-input/fluid-text-input.scss.js +1 -1
- package/es/components/fluid-text-input/fluid-text-input.scss.js.map +1 -1
- package/es/components/fluid-textarea/fluid-textarea.scss.js +1 -1
- package/es/components/fluid-textarea/fluid-textarea.scss.js.map +1 -1
- package/es/components/icon/icon.d.ts +1 -1
- package/es/components/modal/modal.scss.js +1 -1
- package/es/components/modal/modal.scss.js.map +1 -1
- package/es/components/notification/actionable-notification.d.ts +1 -1
- package/es/components/notification/callout-notification.d.ts +1 -1
- package/es/components/notification/inline-notification.d.ts +1 -1
- package/es/components/password-input/password-input.d.ts.map +1 -1
- package/es/components/password-input/password-input.js +1 -1
- package/es/components/password-input/password-input.js.map +1 -1
- package/es/components/text-input/text-input.d.ts +2 -1
- package/es/components/text-input/text-input.d.ts.map +1 -1
- package/es/components/tile/selectable-tile.d.ts +1 -1
- package/es/components/time-picker/time-picker.d.ts +2 -1
- package/es/components/time-picker/time-picker.d.ts.map +1 -1
- package/es/globals/directives/spread.d.ts +1 -1
- package/es/globals/directives/spread.d.ts.map +1 -1
- package/es/globals/internal/icon-loader-utils.d.ts +1 -1
- package/es/globals/internal/icon-loader-utils.d.ts.map +1 -1
- package/es/globals/mixins/validity.d.ts +2 -1
- package/es/globals/mixins/validity.d.ts.map +1 -1
- package/es/globals/mixins/validity.js.map +1 -1
- package/es-custom/components/dropdown/dropdown.d.ts +3 -2
- package/es-custom/components/dropdown/dropdown.d.ts.map +1 -1
- package/es-custom/components/dropdown/dropdown.js +9 -2
- package/es-custom/components/dropdown/dropdown.js.map +1 -1
- package/es-custom/components/fluid-form/fluid-form.d.ts +19 -0
- package/es-custom/components/fluid-form/fluid-form.d.ts.map +1 -0
- package/es-custom/components/fluid-form/fluid-form.js +44 -0
- package/es-custom/components/fluid-form/fluid-form.js.map +1 -0
- package/es-custom/components/fluid-form/fluid-form.scss.js +14 -0
- package/es-custom/components/fluid-form/fluid-form.scss.js.map +1 -0
- package/es-custom/components/fluid-form/index.d.ts +8 -0
- package/es-custom/components/fluid-form/index.d.ts.map +1 -0
- package/es-custom/components/fluid-form/index.js +8 -0
- package/es-custom/components/fluid-number-input/fluid-number-input.scss.js +1 -1
- package/es-custom/components/fluid-number-input/fluid-number-input.scss.js.map +1 -1
- package/es-custom/components/fluid-password-input/fluid-password-input.scss.js +1 -1
- package/es-custom/components/fluid-password-input/fluid-password-input.scss.js.map +1 -1
- package/es-custom/components/fluid-select/fluid-select.scss.js +1 -1
- package/es-custom/components/fluid-select/fluid-select.scss.js.map +1 -1
- package/es-custom/components/fluid-text-input/fluid-text-input.scss.js +1 -1
- package/es-custom/components/fluid-text-input/fluid-text-input.scss.js.map +1 -1
- package/es-custom/components/fluid-textarea/fluid-textarea.scss.js +1 -1
- package/es-custom/components/fluid-textarea/fluid-textarea.scss.js.map +1 -1
- package/es-custom/components/icon/icon.d.ts +1 -1
- package/es-custom/components/modal/modal.scss.js +1 -1
- package/es-custom/components/modal/modal.scss.js.map +1 -1
- package/es-custom/components/notification/actionable-notification.d.ts +1 -1
- package/es-custom/components/notification/callout-notification.d.ts +1 -1
- package/es-custom/components/notification/inline-notification.d.ts +1 -1
- package/es-custom/components/password-input/password-input.d.ts.map +1 -1
- package/es-custom/components/password-input/password-input.js +1 -1
- package/es-custom/components/password-input/password-input.js.map +1 -1
- package/es-custom/components/text-input/text-input.d.ts +2 -1
- package/es-custom/components/text-input/text-input.d.ts.map +1 -1
- package/es-custom/components/tile/selectable-tile.d.ts +1 -1
- package/es-custom/components/time-picker/time-picker.d.ts +2 -1
- package/es-custom/components/time-picker/time-picker.d.ts.map +1 -1
- package/es-custom/globals/directives/spread.d.ts +1 -1
- package/es-custom/globals/directives/spread.d.ts.map +1 -1
- package/es-custom/globals/internal/icon-loader-utils.d.ts +1 -1
- package/es-custom/globals/internal/icon-loader-utils.d.ts.map +1 -1
- package/es-custom/globals/mixins/validity.d.ts +2 -1
- package/es-custom/globals/mixins/validity.d.ts.map +1 -1
- package/es-custom/globals/mixins/validity.js.map +1 -1
- package/lib/components/dropdown/dropdown.d.ts +3 -2
- package/lib/components/dropdown/dropdown.d.ts.map +1 -1
- package/lib/components/fluid-form/fluid-form.d.ts +19 -0
- package/lib/components/fluid-form/fluid-form.d.ts.map +1 -0
- package/lib/components/fluid-form/index.d.ts +8 -0
- package/lib/components/fluid-form/index.d.ts.map +1 -0
- package/lib/components/icon/icon.d.ts +1 -1
- package/lib/components/notification/actionable-notification.d.ts +1 -1
- package/lib/components/notification/callout-notification.d.ts +1 -1
- package/lib/components/notification/inline-notification.d.ts +1 -1
- package/lib/components/password-input/password-input.d.ts.map +1 -1
- package/lib/components/text-input/text-input.d.ts +2 -1
- package/lib/components/text-input/text-input.d.ts.map +1 -1
- package/lib/components/tile/selectable-tile.d.ts +1 -1
- package/lib/components/time-picker/time-picker.d.ts +2 -1
- package/lib/components/time-picker/time-picker.d.ts.map +1 -1
- package/lib/globals/directives/spread.d.ts +1 -1
- package/lib/globals/directives/spread.d.ts.map +1 -1
- package/lib/globals/internal/icon-loader-utils.d.ts +1 -1
- package/lib/globals/internal/icon-loader-utils.d.ts.map +1 -1
- package/lib/globals/mixins/validity.d.ts +2 -1
- package/lib/globals/mixins/validity.d.ts.map +1 -1
- package/package.json +8 -8
- package/scss/components/fluid-form/fluid-form.scss +24 -0
- package/scss/components/fluid-number-input/fluid-number-input.scss +3 -1
- package/scss/components/fluid-password-input/fluid-password-input.scss +1 -1
- package/scss/components/fluid-select/fluid-select.scss +3 -1
- package/scss/components/fluid-text-input/fluid-text-input.scss +3 -1
- package/scss/components/fluid-textarea/fluid-textarea.scss +3 -1
- package/scss/components/modal/modal.scss +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-input.js","names":["CDSTextInput","ifNonEmpty","styles","customElement"],"sources":["../../../src/components/password-input/password-input.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport View16 from '@carbon/icons/es/view/16.js';\nimport ViewOff16 from '@carbon/icons/es/view--off/16.js';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport '../tooltip';\nimport '../tooltip/tooltip-content';\nimport styles from './password-input.scss?lit';\nimport CDSTextInput from '../text-input/text-input';\nimport CDSTooltip from '../tooltip/tooltip';\n\nimport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n} from './defs';\n\nexport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n};\n/**\n * Password Input element. Supports all the usual attributes for textual input types\n *\n * @element cds-password-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-password-input`)\nclass CDSPasswordInput extends CDSTextInput {\n /**\n * The Show/Hide Password tooltip\n */\n @query(`${prefix}-tooltip`)\n private _passwordTooltip?: HTMLElement;\n\n /**\n * Handles `oninput` event on the `input`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property({\n type: String,\n attribute: 'hide-password-label',\n reflect: true,\n })\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property({\n type: String,\n attribute: 'show-password-label',\n reflect: true,\n })\n showPasswordLabel = 'Show password';\n\n /**\n * The native `<input>` type. Defaults to “password”.\n */\n @property({ reflect: true })\n type: INPUT_TYPE = INPUT_TYPE.PASSWORD;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property({\n type: String,\n attribute: 'tooltip-alignment',\n reflect: true,\n })\n tooltipAlignment = INPUT_TOOLTIP_ALIGNMENT.CENTER;\n\n /**\n * Set to true to use the fluid version.\n */\n @property({ type: Boolean })\n isFluid = false;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property({\n type: String,\n attribute: 'tooltip-position',\n reflect: true,\n })\n tooltipDirection = INPUT_TOOLTIP_DIRECTION.BOTTOM;\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n if (this.disabled) return;\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const {\n disabled,\n helperText,\n hideLabel,\n inline,\n invalid,\n invalidText,\n label,\n readonly,\n required,\n isFluid,\n size,\n type,\n warn,\n warnText,\n _handleInput: handleInput,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n const invalidIcon = iconLoader(WarningFilled16, {\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const warnIcon = iconLoader(WarningAltFilled16, {\n class: `${prefix}--text-input__invalid-icon ${prefix}--text-input__invalid-icon--warning`,\n });\n\n const normalizedProps: {\n disabled: boolean;\n invalid: boolean;\n warn: boolean;\n 'slot-name': string;\n 'slot-text': string;\n icon: ReturnType<typeof iconLoader>;\n } = {\n disabled: !readonly && disabled,\n invalid: !readonly && invalid,\n warn: !readonly && !invalid && warn,\n 'slot-name': '',\n 'slot-text': '',\n icon: null,\n };\n\n if (normalizedProps.invalid) {\n normalizedProps.icon = invalidIcon;\n normalizedProps['slot-name'] = 'invalid-text';\n normalizedProps['slot-text'] = invalidText;\n } else if (normalizedProps.warn) {\n normalizedProps.icon = warnIcon;\n normalizedProps['slot-name'] = 'warn-text';\n normalizedProps['slot-text'] = warnText;\n }\n\n const inputWrapperClasses = classMap({\n [`${prefix}--form-item`]: true,\n [`${prefix}--text-input-wrapper`]: true,\n [`${prefix}--password-input-wrapper`]: true,\n [`${prefix}--text-input-wrapper--inline`]: inline,\n [`${prefix}--text-input-wrapper--readonly`]: readonly,\n [`${prefix}--text-input-wrapper--inline--invalid`]:\n inline && normalizedProps.invalid,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--invalid`]: normalizedProps.invalid,\n [`${prefix}--text-input--warning`]: normalizedProps.warn,\n [`${prefix}--text-input--${size}`]: size !== undefined, // TODO v12 - remove this class\n [`${prefix}--password-input`]: true,\n });\n\n const fieldOuterWrapperClasses = classMap({\n [`${prefix}--text-input__field-outer-wrapper`]: true,\n [`${prefix}--text-input__field-outer-wrapper--inline`]: inline,\n });\n\n const fieldWrapperClasses = classMap({\n [`${prefix}--text-input__field-wrapper`]: true,\n [`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,\n [`${prefix}--layout--size-${size}`]: size !== undefined,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n [`${prefix}--label--disabled`]: normalizedProps.disabled,\n [`${prefix}--label--inline`]: inline,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled,\n [`${prefix}--form__helper-text--inline`]: inline,\n });\n\n const passwordIsVisible = type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? iconLoader(ViewOff16, { class: `${prefix}--icon-visibility-off` })\n : iconLoader(View16, { class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityTooltipClasses = classMap({\n [`${prefix}--toggle-password-tooltip`]: true,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordVisibilityButtonClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: normalizedProps.disabled || readonly,\n });\n\n const labelWrapper = html`<div class=\"${prefix}--text-input__label-wrapper\">\n <label class=\"${labelClasses}\"> ${label} </label>\n </div>`;\n\n const helper = helperText\n ? html`<div\n class=\"${helperTextClasses}\"\n id=\"helper-text\"\n ?hidden=\"${normalizedProps.invalid || normalizedProps.warn}\">\n <slot name=\"helper-text\"> ${helperText} </slot>\n </div>`\n : null;\n\n const validationMessage =\n normalizedProps.invalid || normalizedProps.warn\n ? html`<div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']}\n </slot>\n </div>`\n : null;\n\n let align = '';\n\n if (\n this.tooltipDirection === INPUT_TOOLTIP_DIRECTION.TOP ||\n this.tooltipDirection === INPUT_TOOLTIP_DIRECTION.BOTTOM\n ) {\n if (this.tooltipAlignment === INPUT_TOOLTIP_ALIGNMENT.CENTER) {\n align = this.tooltipDirection;\n }\n if (this.tooltipAlignment === INPUT_TOOLTIP_ALIGNMENT.END) {\n align = `${this.tooltipDirection}-right`;\n }\n if (this.tooltipAlignment === INPUT_TOOLTIP_ALIGNMENT.START) {\n align = `${this.tooltipDirection}-left`;\n }\n }\n\n if (this.tooltipDirection === 'right' || this.tooltipDirection === 'left') {\n align = this.tooltipDirection;\n }\n\n return html`\n <div class=\"${inputWrapperClasses}\">\n ${!inline\n ? labelWrapper\n : html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${labelWrapper}\n </div>`}\n <div class=\"${fieldOuterWrapperClasses}\">\n <div class=\"${fieldWrapperClasses}\" ?data-invalid=\"${invalid}\">\n ${normalizedProps.icon}\n <input\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${readonly}\"\n ?required=\"${required}\"\n type=\"${ifNonEmpty(type)}\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\" />\n <slot name=\"slug\" @slotchange=\"${handleSlotChange}\"></slot>\n <cds-tooltip\n align=\"${align}\"\n class=\"${passwordVisibilityTooltipClasses}\"\n .dropShadow=\"${false}\"\n ?disabled=\"${normalizedProps.disabled}\">\n <button\n ?disabled=\"${normalizedProps.disabled}\"\n type=\"button\"\n role=\"button\"\n class=\"${passwordVisibilityButtonClasses}\"\n aria-labelledby=\"content\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${passwordVisibilityIcon}\n </button>\n <cds-tooltip-content\n id=\"content\"\n ?toggle-password-tooltip-content=\"${!isFluid}\"\n ?hidden=\"${normalizedProps.disabled}\">\n ${passwordIsVisible\n ? this.hidePasswordLabel\n : this.showPasswordLabel}\n </cds-tooltip-content>\n </cds-tooltip>\n ${isFluid\n ? html`<hr class=\"${prefix}--text-input__divider\" />`\n : null}\n ${isFluid && !inline ? validationMessage : null}\n </div>\n ${/* Non-fluid: validation and helper outside field wrapper */ ''}\n ${!isFluid && !inline ? validationMessage || helper : null}\n </div>\n ${inline && !isFluid\n ? html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${!isFluid ? validationMessage || helper : null}\n </div>`\n : null}\n </div>\n `;\n }\n\n async firstUpdated() {\n await (this._passwordTooltip as CDSTooltip)?.updateComplete;\n this._passwordTooltip?.shadowRoot\n ?.querySelector(`.${prefix}--tooltip`)\n ?.classList.add(`${prefix}--icon-tooltip`);\n }\n /**\n * A selector that will return the slug item.\n *\n * remove in v12\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSPasswordInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAA,mBAAA,MACM,yBAAyBA,mBAAa;;;2BAyBtB;2BAUA;;;iBAuBV;;;;;;;;;CA7CV,aAAuB,EAAE,UAAiB;AACxC,OAAK,QAAS,OAA4B;;;;;CA4D5C,iCAAyC;AACvC,MAAI,KAAK,SAAU;AACnB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C,CAAA,EAAA,iBAAA,WAAA,QAAA,KAAA,EAAA;YAO3B,SAAS;CACR,MAAM;CACN,WAAW;CACX,SAAS;CACV,CAAC,CAAA,EAAA,iBAAA,WAAA,oBAAA,KAAA,EAAA;YAMD,SAAS,EAAE,MAAM,SAAS,CAAC,CAAA,EAAA,iBAAA,WAAA,WAAA,KAAA,EAAA;YAO3B,SAAS;CACR,MAAM;CACN,WAAW;CACX,SAAS;CACV,CAAC,CAAA,EAAA,iBAAA,WAAA,oBAAA,KAAA,EAAA;+BArEHC,cAAc,qBAA2B,CAAA,EAAA,iBAAA;AA0U1C,IAAA,yBAAe"}
|
|
1
|
+
{"version":3,"file":"password-input.js","names":["CDSTextInput","ifNonEmpty","styles","customElement"],"sources":["../../../src/components/password-input/password-input.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { prefix } from '../../globals/settings';\nimport View16 from '@carbon/icons/es/view/16.js';\nimport ViewOff16 from '@carbon/icons/es/view--off/16.js';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport '../tooltip';\nimport '../tooltip/tooltip-content';\nimport styles from './password-input.scss?lit';\nimport CDSTextInput from '../text-input/text-input';\nimport CDSTooltip from '../tooltip/tooltip';\n\nimport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n} from './defs';\n\nexport {\n INPUT_COLOR_SCHEME,\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n};\n/**\n * Password Input element. Supports all the usual attributes for textual input types\n *\n * @element cds-password-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-password-input`)\nclass CDSPasswordInput extends CDSTextInput {\n /**\n * The Show/Hide Password tooltip\n */\n @query(`${prefix}-tooltip`)\n private _passwordTooltip?: HTMLElement;\n\n /**\n * Handles `oninput` event on the `input`.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property({\n type: String,\n attribute: 'hide-password-label',\n reflect: true,\n })\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property({\n type: String,\n attribute: 'show-password-label',\n reflect: true,\n })\n showPasswordLabel = 'Show password';\n\n /**\n * The native `<input>` type. Defaults to “password”.\n */\n @property({ reflect: true })\n type: INPUT_TYPE = INPUT_TYPE.PASSWORD;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property({\n type: String,\n attribute: 'tooltip-alignment',\n reflect: true,\n })\n tooltipAlignment = INPUT_TOOLTIP_ALIGNMENT.END;\n\n /**\n * Set to true to use the fluid version.\n */\n @property({ type: Boolean })\n isFluid = false;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property({\n type: String,\n attribute: 'tooltip-position',\n reflect: true,\n })\n tooltipDirection = INPUT_TOOLTIP_DIRECTION.BOTTOM;\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n if (this.disabled) return;\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const {\n disabled,\n helperText,\n hideLabel,\n inline,\n invalid,\n invalidText,\n label,\n readonly,\n required,\n isFluid,\n size,\n type,\n warn,\n warnText,\n _handleInput: handleInput,\n _handleSlotChange: handleSlotChange,\n } = this;\n\n const invalidIcon = iconLoader(WarningFilled16, {\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const warnIcon = iconLoader(WarningAltFilled16, {\n class: `${prefix}--text-input__invalid-icon ${prefix}--text-input__invalid-icon--warning`,\n });\n\n const normalizedProps: {\n disabled: boolean;\n invalid: boolean;\n warn: boolean;\n 'slot-name': string;\n 'slot-text': string;\n icon: ReturnType<typeof iconLoader>;\n } = {\n disabled: !readonly && disabled,\n invalid: !readonly && invalid,\n warn: !readonly && !invalid && warn,\n 'slot-name': '',\n 'slot-text': '',\n icon: null,\n };\n\n if (normalizedProps.invalid) {\n normalizedProps.icon = invalidIcon;\n normalizedProps['slot-name'] = 'invalid-text';\n normalizedProps['slot-text'] = invalidText;\n } else if (normalizedProps.warn) {\n normalizedProps.icon = warnIcon;\n normalizedProps['slot-name'] = 'warn-text';\n normalizedProps['slot-text'] = warnText;\n }\n\n const inputWrapperClasses = classMap({\n [`${prefix}--form-item`]: true,\n [`${prefix}--text-input-wrapper`]: true,\n [`${prefix}--password-input-wrapper`]: true,\n [`${prefix}--text-input-wrapper--inline`]: inline,\n [`${prefix}--text-input-wrapper--readonly`]: readonly,\n [`${prefix}--text-input-wrapper--inline--invalid`]:\n inline && normalizedProps.invalid,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--invalid`]: normalizedProps.invalid,\n [`${prefix}--text-input--warning`]: normalizedProps.warn,\n [`${prefix}--text-input--${size}`]: size !== undefined, // TODO v12 - remove this class\n [`${prefix}--password-input`]: true,\n });\n\n const fieldOuterWrapperClasses = classMap({\n [`${prefix}--text-input__field-outer-wrapper`]: true,\n [`${prefix}--text-input__field-outer-wrapper--inline`]: inline,\n });\n\n const fieldWrapperClasses = classMap({\n [`${prefix}--text-input__field-wrapper`]: true,\n [`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,\n [`${prefix}--layout--size-${size}`]: size !== undefined,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n [`${prefix}--label--disabled`]: normalizedProps.disabled,\n [`${prefix}--label--inline`]: inline,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled,\n [`${prefix}--form__helper-text--inline`]: inline,\n });\n\n const passwordIsVisible = type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? iconLoader(ViewOff16, { class: `${prefix}--icon-visibility-off` })\n : iconLoader(View16, { class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityTooltipClasses = classMap({\n [`${prefix}--toggle-password-tooltip`]: true,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordVisibilityButtonClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: normalizedProps.disabled || readonly,\n });\n\n const labelWrapper = html`<div class=\"${prefix}--text-input__label-wrapper\">\n <label class=\"${labelClasses}\"> ${label} </label>\n </div>`;\n\n const helper = helperText\n ? html`<div\n class=\"${helperTextClasses}\"\n id=\"helper-text\"\n ?hidden=\"${normalizedProps.invalid || normalizedProps.warn}\">\n <slot name=\"helper-text\"> ${helperText} </slot>\n </div>`\n : null;\n\n const validationMessage =\n normalizedProps.invalid || normalizedProps.warn\n ? html`<div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!normalizedProps.invalid && !normalizedProps.warn}\">\n <slot name=\"${normalizedProps['slot-name']}\">\n ${normalizedProps['slot-text']}\n </slot>\n </div>`\n : null;\n\n let align = '';\n\n if (\n this.tooltipDirection === INPUT_TOOLTIP_DIRECTION.TOP ||\n this.tooltipDirection === INPUT_TOOLTIP_DIRECTION.BOTTOM\n ) {\n if (this.tooltipAlignment === INPUT_TOOLTIP_ALIGNMENT.CENTER) {\n align = this.tooltipDirection;\n }\n if (this.tooltipAlignment === INPUT_TOOLTIP_ALIGNMENT.END) {\n align = `${this.tooltipDirection}-right`;\n }\n if (this.tooltipAlignment === INPUT_TOOLTIP_ALIGNMENT.START) {\n align = `${this.tooltipDirection}-left`;\n }\n }\n\n if (this.tooltipDirection === 'right' || this.tooltipDirection === 'left') {\n align = this.tooltipDirection;\n }\n\n return html`\n <div class=\"${inputWrapperClasses}\">\n ${!inline\n ? labelWrapper\n : html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${labelWrapper}\n </div>`}\n <div class=\"${fieldOuterWrapperClasses}\">\n <div class=\"${fieldWrapperClasses}\" ?data-invalid=\"${invalid}\">\n ${normalizedProps.icon}\n <input\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${readonly}\"\n ?required=\"${required}\"\n type=\"${ifNonEmpty(type)}\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\" />\n <slot name=\"slug\" @slotchange=\"${handleSlotChange}\"></slot>\n <cds-tooltip\n align=\"${align}\"\n class=\"${passwordVisibilityTooltipClasses}\"\n .dropShadow=\"${false}\"\n ?disabled=\"${normalizedProps.disabled}\">\n <button\n ?disabled=\"${normalizedProps.disabled}\"\n type=\"button\"\n role=\"button\"\n class=\"${passwordVisibilityButtonClasses}\"\n aria-labelledby=\"content\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${passwordVisibilityIcon}\n </button>\n <cds-tooltip-content\n id=\"content\"\n ?toggle-password-tooltip-content=\"${!isFluid}\"\n ?hidden=\"${normalizedProps.disabled}\">\n ${passwordIsVisible\n ? this.hidePasswordLabel\n : this.showPasswordLabel}\n </cds-tooltip-content>\n </cds-tooltip>\n ${isFluid\n ? html`<hr class=\"${prefix}--text-input__divider\" />`\n : null}\n ${isFluid && !inline ? validationMessage : null}\n </div>\n ${/* Non-fluid: validation and helper outside field wrapper */ ''}\n ${!isFluid && !inline ? validationMessage || helper : null}\n </div>\n ${inline && !isFluid\n ? html`<div class=\"${prefix}--text-input__label-helper-wrapper\">\n ${!isFluid ? validationMessage || helper : null}\n </div>`\n : null}\n </div>\n `;\n }\n\n async firstUpdated() {\n await (this._passwordTooltip as CDSTooltip)?.updateComplete;\n this._passwordTooltip?.shadowRoot\n ?.querySelector(`.${prefix}--tooltip`)\n ?.classList.add(`${prefix}--icon-tooltip`);\n }\n /**\n * A selector that will return the slug item.\n *\n * remove in v12\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSPasswordInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,IAAA,mBAAA,MACM,yBAAyBA,mBAAa;;;2BAyBtB;2BAUA;;;iBAuBV;;;;;;;;;CA7CV,aAAuB,EAAE,UAAiB;AACxC,OAAK,QAAS,OAA4B;;;;;CA4D5C,iCAAyC;AACvC,MAAI,KAAK,SAAU;AACnB,OAAK,OACH,KAAK,SAAA,aAAA,SAAA;;CAGT,SAAS;EACP,MAAM,EACJ,UACA,YACA,WACA,QACA,SACA,aACA,OACA,UACA,UACA,SACA,MACA,MACA,MACA,UACA,cAAc,aACd,mBAAmB,qBACjB;EAEJ,MAAM,cAAc,WAAW,iBAAiB,EAC9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AA,WAAA,WAAA,KAAA,EAAA;YAO3B,SAAS;CACR,MAAM;CACN,WAAW;CACX,SAAS;CACV,CAAC,CAAA,EAAA,iBAAA,WAAA,oBAAA,KAAA,EAAA;+BArEHC,cAAc,qBAA2B,CAAA,EAAA,iBAAA;AA0U1C,IAAA,yBAAe"}
|
|
@@ -14,7 +14,8 @@ declare const CDSTextInput_base: (new (...args: any[]) => {
|
|
|
14
14
|
required: boolean;
|
|
15
15
|
requiredValidityMessage: string;
|
|
16
16
|
validityMessage: string;
|
|
17
|
-
value: string;
|
|
17
|
+
get value(): string;
|
|
18
|
+
set value(v: string): any;
|
|
18
19
|
checkValidity(): boolean;
|
|
19
20
|
setCustomValidity(validityMessage: string): void;
|
|
20
21
|
}) & (new (...args: any[]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.d.ts","sourceRoot":"","sources":["../../../src/components/text-input/text-input.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAavC,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,UAAU,EACX,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,UAAU,GACX,CAAC
|
|
1
|
+
{"version":3,"file":"text-input.d.ts","sourceRoot":"","sources":["../../../src/components/text-input/text-input.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAavC,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,UAAU,EACX,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,UAAU,GACX,CAAC;;;;;;;;;;;;;;;;;;AAEF;;;;;;;GAOG;AACH,c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IAEf;;;OAGG;IAEH,gBAAgB,0BAAkC;IAElD;;;OAGG;IAEH,gBAAgB,0BAAkC;IAElD;;OAEG;IAEH,IAAI,aAAmB;IAEvB;;OAEG;IAEH,eAAe,SAAM;IAErB;;OAEG;IACH,IACI,KAAK,WAQR;IAED,IAAI,KAAK,CAAC,KAAK,QAAA,EAUd;IAED;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAKhC,MAAM;IA8ON,OAAO;IAmBP;;;;OAIG;IACH,MAAM,KAAK,QAAQ,WAElB;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED,MAAM,CAAC,iBAAiB;;;;;;;MAGtB;IACF,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -49,7 +49,7 @@ declare class CDSSelectableTile extends CDSSelectableTile_base {
|
|
|
49
49
|
/**
|
|
50
50
|
* Handles the rendering of the icon.
|
|
51
51
|
*/
|
|
52
|
-
protected _renderIcon(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-svg").UnsafeSVGDirective> | import("lit-html").TemplateResult | null;
|
|
52
|
+
protected _renderIcon(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/unsafe-svg.js").UnsafeSVGDirective> | import("lit-html").TemplateResult | null;
|
|
53
53
|
/**
|
|
54
54
|
* Listener function for click interaction.
|
|
55
55
|
*
|
|
@@ -13,7 +13,8 @@ declare const CDSTimePicker_base: (new (...args: any[]) => {
|
|
|
13
13
|
required: boolean;
|
|
14
14
|
requiredValidityMessage: string;
|
|
15
15
|
validityMessage: string;
|
|
16
|
-
value: string;
|
|
16
|
+
get value(): string;
|
|
17
|
+
set value(v: string): any;
|
|
17
18
|
checkValidity(): boolean;
|
|
18
19
|
setCustomValidity(validityMessage: string): void;
|
|
19
20
|
}) & (new (...args: any[]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-picker.d.ts","sourceRoot":"","sources":["../../../src/components/time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ExD;;OAEG;IACH,IACI,KAAK,WAER;IAED,IAAI,KAAK,CAAC,KAAK,QAAA,EAOd;IAED,MAAM;IAqGN,OAAO,CAAC,iBAAiB,KAAA;IAkBzB,MAAM,KAAK,wBAAwB,WAElC;IAED,MAAM,CAAC,iBAAiB;;;;;;;MAGtB;IAEF,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -32,6 +32,6 @@ declare class SpreadDirective extends Directive {
|
|
|
32
32
|
*/
|
|
33
33
|
render(attributesInfo: AttributesInfo): AttributesInfo;
|
|
34
34
|
}
|
|
35
|
-
declare const spread: (attributesInfo: AttributesInfo) => import("lit-html/directive").DirectiveResult<typeof SpreadDirective>;
|
|
35
|
+
declare const spread: (attributesInfo: AttributesInfo) => import("lit-html/directive.js").DirectiveResult<typeof SpreadDirective>;
|
|
36
36
|
export default spread;
|
|
37
37
|
//# sourceMappingURL=spread.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spread.d.ts","sourceRoot":"","sources":["../../../src/globals/directives/spread.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,SAAS,EACT,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAQD;;;;;;GAMG;AACH,cAAM,eAAgB,SAAQ,SAAS;IACrC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC,IAAI,CAAC;IA8BvE;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,EAAE,cAAc;CAGtC;AAED,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"spread.d.ts","sourceRoot":"","sources":["../../../src/globals/directives/spread.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,SAAS,EACT,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAQD;;;;;;GAMG;AACH,cAAM,eAAgB,SAAQ,SAAS;IACrC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC,IAAI,CAAC;IA8BvE;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,EAAE,cAAc;CAGtC;AAED,QAAA,MAAM,MAAM,6GAA6B,CAAC;AAE1C,eAAe,MAAM,CAAC"}
|
|
@@ -28,5 +28,5 @@ export declare function carbonIconToSVG(descriptor: CarbonIcon, attributes?: Rec
|
|
|
28
28
|
/**
|
|
29
29
|
* Create an icon function that returns a Lit template with unsafeSVG
|
|
30
30
|
*/
|
|
31
|
-
export declare function createIconTemplate(descriptor: CarbonIcon): (attributes?: Record<string, string | number | undefined>) => import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/unsafe-svg").UnsafeSVGDirective>;
|
|
31
|
+
export declare function createIconTemplate(descriptor: CarbonIcon): (attributes?: Record<string, string | number | undefined>) => import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/unsafe-svg.js").UnsafeSVGDirective>;
|
|
32
32
|
//# sourceMappingURL=icon-loader-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-loader-utils.d.ts","sourceRoot":"","sources":["../../../src/globals/internal/icon-loader-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACvC,OAAO,EAAE,CAAC,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAAC;CACzC;AAGD,MAAM,WAA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C;CAChC;AAED,MAAM,MAAM,UAAU,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AASjE;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,UAAU,EACtB,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAM,UA+B7D;AAiBD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,IAC/C,aAAY,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAM,4HAIrE"}
|
|
@@ -29,7 +29,8 @@ declare const ValidityMixin: <T extends Constructor<HTMLElement>>(Base: T) => {
|
|
|
29
29
|
required: boolean;
|
|
30
30
|
requiredValidityMessage: string;
|
|
31
31
|
validityMessage: string;
|
|
32
|
-
value: string;
|
|
32
|
+
get value(): string;
|
|
33
|
+
set value(v: string): any;
|
|
33
34
|
checkValidity(): boolean;
|
|
34
35
|
setCustomValidity(validityMessage: string): void;
|
|
35
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validity.d.ts","sourceRoot":"","sources":["../../../src/globals/mixins/validity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,QAAQ,KAAK;IAEb;;OAEG;IACH,cAAc,aAAa;CAC5B;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,CAAC,WAAW,CAAC,EACvD,MAAM,CAAC,KACN;IAED,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG;QACpB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;QACvD,aAAa,IAAI,MAAM,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;QAClB,uBAAuB,EAAE,MAAM,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;QACxB,KAAK,
|
|
1
|
+
{"version":3,"file":"validity.d.ts","sourceRoot":"","sources":["../../../src/globals/mixins/validity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,QAAQ,KAAK;IAEb;;OAEG;IACH,cAAc,aAAa;CAC5B;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,CAAC,WAAW,CAAC,EACvD,MAAM,CAAC,KACN;IAED,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG;QACpB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;QACvD,aAAa,IAAI,MAAM,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;QAClB,uBAAuB,EAAE,MAAM,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,KAAK,IAAI,MAAM,CAAC;QACpB,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,OAAE;QACrB,aAAa,IAAI,OAAO,CAAC;QACzB,iBAAiB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;KAClD,CAAC;CACH,GAAG,CAgGH,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validity.js","names":[],"sources":["../../../src/globals/mixins/validity.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2020, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Form validation status.\n */\nexport enum VALIDATION_STATUS {\n /**\n * One indicating no validation error.\n */\n NO_ERROR = '',\n\n /**\n * One indicating missing required value.\n */\n ERROR_REQUIRED = 'required',\n}\n\n/**\n * @param Base The base class.\n * @returns A mix-in implementing `.setCustomValidity()` method.\n */\nconst ValidityMixin = <T extends Constructor<HTMLElement>>(\n Base: T\n): {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): {\n _getValidityMessage(state: string): string | undefined;\n _testValidity(): string;\n invalid: boolean;\n required: boolean;\n requiredValidityMessage: string;\n validityMessage: string;\n value: string;\n checkValidity(): boolean;\n setCustomValidity(validityMessage: string): void;\n };\n} & T => {\n abstract class ValidityMixinImpl extends Base {\n // Not using TypeScript `protected` due to: microsoft/TypeScript#17744\n // Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8\n /**\n * @param state The form validation status.\n * @returns The form validation error messages associated with the given status.\n * @protected\n */\n _getValidityMessage(state: string) {\n return {\n [VALIDATION_STATUS.NO_ERROR]: '',\n [VALIDATION_STATUS.ERROR_REQUIRED]: this.requiredValidityMessage,\n }[state];\n }\n\n // Not using TypeScript `protected` due to: microsoft/TypeScript#17744\n // Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8\n /**\n * Checks if the value meets the constraints.\n *\n * @returns `VALIDATION_STATUS.NO_ERROR` if the value meets the constraints. Some other values otherwise.\n * @protected\n */\n _testValidity(): string {\n const { required, value } = this;\n return required && !value\n ? VALIDATION_STATUS.ERROR_REQUIRED\n : VALIDATION_STATUS.NO_ERROR;\n }\n\n /**\n * `true` to show the UI of the invalid state.\n */\n abstract invalid: boolean;\n\n /**\n * `true` if the value is required.\n */\n abstract required: boolean;\n\n /**\n * The special validity message for `required`.\n */\n abstract requiredValidityMessage: string;\n\n /**\n * The validity message.\n */\n abstract validityMessage: string;\n\n /**\n * The value.\n */\n abstract value: string;\n\n /**\n * Checks if the value meets the constraints.\n * Fires cancelable `invalid` event if it doesn't.\n *\n * @returns `true` if the value meets the constraints. `false` otherwise.\n */\n checkValidity() {\n const status = this._testValidity();\n if (status !== VALIDATION_STATUS.NO_ERROR) {\n if (\n this.dispatchEvent(\n new CustomEvent('invalid', {\n bubbles: false,\n cancelable: true,\n composed: false,\n })\n )\n ) {\n this.invalid = true;\n this.validityMessage = this._getValidityMessage(status) as string;\n }\n return false;\n }\n this.invalid = false;\n this.validityMessage = '';\n return true;\n }\n\n /**\n * Sets the given custom validity message.\n *\n * @param validityMessage The custom validity message\n */\n setCustomValidity(validityMessage: string) {\n this.invalid = Boolean(validityMessage);\n this.validityMessage = validityMessage;\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return ValidityMixinImpl as any;\n};\n\nexport default ValidityMixin;\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,IAAY,oBAAL,yBAAA,mBAAA;;;;AAIL,mBAAA,cAAA;;;;AAKA,mBAAA,oBAAA;;KACD;;;;;AAMD,MAAM,iBACJ,
|
|
1
|
+
{"version":3,"file":"validity.js","names":[],"sources":["../../../src/globals/mixins/validity.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2020, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Form validation status.\n */\nexport enum VALIDATION_STATUS {\n /**\n * One indicating no validation error.\n */\n NO_ERROR = '',\n\n /**\n * One indicating missing required value.\n */\n ERROR_REQUIRED = 'required',\n}\n\n/**\n * @param Base The base class.\n * @returns A mix-in implementing `.setCustomValidity()` method.\n */\nconst ValidityMixin = <T extends Constructor<HTMLElement>>(\n Base: T\n): {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): {\n _getValidityMessage(state: string): string | undefined;\n _testValidity(): string;\n invalid: boolean;\n required: boolean;\n requiredValidityMessage: string;\n validityMessage: string;\n get value(): string;\n set value(v: string);\n checkValidity(): boolean;\n setCustomValidity(validityMessage: string): void;\n };\n} & T => {\n abstract class ValidityMixinImpl extends Base {\n // Not using TypeScript `protected` due to: microsoft/TypeScript#17744\n // Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8\n /**\n * @param state The form validation status.\n * @returns The form validation error messages associated with the given status.\n * @protected\n */\n _getValidityMessage(state: string) {\n return {\n [VALIDATION_STATUS.NO_ERROR]: '',\n [VALIDATION_STATUS.ERROR_REQUIRED]: this.requiredValidityMessage,\n }[state];\n }\n\n // Not using TypeScript `protected` due to: microsoft/TypeScript#17744\n // Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8\n /**\n * Checks if the value meets the constraints.\n *\n * @returns `VALIDATION_STATUS.NO_ERROR` if the value meets the constraints. Some other values otherwise.\n * @protected\n */\n _testValidity(): string {\n const { required, value } = this;\n return required && !value\n ? VALIDATION_STATUS.ERROR_REQUIRED\n : VALIDATION_STATUS.NO_ERROR;\n }\n\n /**\n * `true` to show the UI of the invalid state.\n */\n abstract invalid: boolean;\n\n /**\n * `true` if the value is required.\n */\n abstract required: boolean;\n\n /**\n * The special validity message for `required`.\n */\n abstract requiredValidityMessage: string;\n\n /**\n * The validity message.\n */\n abstract validityMessage: string;\n\n /**\n * The value.\n */\n abstract value: string;\n\n /**\n * Checks if the value meets the constraints.\n * Fires cancelable `invalid` event if it doesn't.\n *\n * @returns `true` if the value meets the constraints. `false` otherwise.\n */\n checkValidity() {\n const status = this._testValidity();\n if (status !== VALIDATION_STATUS.NO_ERROR) {\n if (\n this.dispatchEvent(\n new CustomEvent('invalid', {\n bubbles: false,\n cancelable: true,\n composed: false,\n })\n )\n ) {\n this.invalid = true;\n this.validityMessage = this._getValidityMessage(status) as string;\n }\n return false;\n }\n this.invalid = false;\n this.validityMessage = '';\n return true;\n }\n\n /**\n * Sets the given custom validity message.\n *\n * @param validityMessage The custom validity message\n */\n setCustomValidity(validityMessage: string) {\n this.invalid = Boolean(validityMessage);\n this.validityMessage = validityMessage;\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return ValidityMixinImpl as any;\n};\n\nexport default ValidityMixin;\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,IAAY,oBAAL,yBAAA,mBAAA;;;;AAIL,mBAAA,cAAA;;;;AAKA,mBAAA,oBAAA;;KACD;;;;;AAMD,MAAM,iBACJ,SAeO;CACP,MAAe,0BAA0B,KAAK;;;;;;EAQ5C,oBAAoB,OAAe;AACjC,UAAO;UACyB;kBACM,KAAK;IAC1C,CAAC;;;;;;;;EAWJ,gBAAwB;GACtB,MAAM,EAAE,UAAU,UAAU;AAC5B,UAAO,YAAY,CAAC,QAAA,aAAA;;;;;;;;EAoCtB,gBAAgB;GACd,MAAM,SAAS,KAAK,eAAe;AACnC,OAAI,WAAA,IAAuC;AACzC,QACE,KAAK,cACH,IAAI,YAAY,WAAW;KACzB,SAAS;KACT,YAAY;KACZ,UAAU;KACX,CAAC,CACH,EACD;AACA,UAAK,UAAU;AACf,UAAK,kBAAkB,KAAK,oBAAoB,OAAO;;AAEzD,WAAO;;AAET,QAAK,UAAU;AACf,QAAK,kBAAkB;AACvB,UAAO;;;;;;;EAQT,kBAAkB,iBAAyB;AACzC,QAAK,UAAU,QAAQ,gBAAgB;AACvC,QAAK,kBAAkB;;;AAI3B,QAAO"}
|
|
@@ -15,7 +15,8 @@ declare const CDSDropdown_base: (new (...args: any[]) => {
|
|
|
15
15
|
required: boolean;
|
|
16
16
|
requiredValidityMessage: string;
|
|
17
17
|
validityMessage: string;
|
|
18
|
-
value: string;
|
|
18
|
+
get value(): string;
|
|
19
|
+
set value(v: string): any;
|
|
19
20
|
checkValidity(): boolean;
|
|
20
21
|
setCustomValidity(validityMessage: string): void;
|
|
21
22
|
}) & {
|
|
@@ -307,7 +308,7 @@ declare class CDSDropdown extends CDSDropdown_base {
|
|
|
307
308
|
/**
|
|
308
309
|
* The value of the selected item.
|
|
309
310
|
*/
|
|
310
|
-
value: string;
|
|
311
|
+
accessor value: string;
|
|
311
312
|
/**
|
|
312
313
|
* Specify whether the control is currently in warning state
|
|
313
314
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,UAAU,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAkBvD,OA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;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED;;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED;;;;OAIG;IACH,MAAM,KAAK,QAAQ,WAElB;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED,MAAM,CAAC,iBAAiB;;;;;;;MAGtB;IAEF,MAAM,CAAC,MAAM,MAAU;IAEvB;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM;CAY7B;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -83,7 +83,7 @@ let CDSDropdown = class CDSDropdown extends ValidityMixin(HostListenerMixin(Form
|
|
|
83
83
|
this.label = "";
|
|
84
84
|
this.type = "";
|
|
85
85
|
this.validityMessage = "";
|
|
86
|
-
this
|
|
86
|
+
this.#_value_accessor_storage = "";
|
|
87
87
|
this.warn = false;
|
|
88
88
|
this.warnText = "";
|
|
89
89
|
}
|
|
@@ -544,6 +544,13 @@ let CDSDropdown = class CDSDropdown extends ValidityMixin(HostListenerMixin(Form
|
|
|
544
544
|
const { disabled, name, value } = this;
|
|
545
545
|
if (!disabled) formData.append(name, value);
|
|
546
546
|
}
|
|
547
|
+
#_value_accessor_storage;
|
|
548
|
+
get value() {
|
|
549
|
+
return this.#_value_accessor_storage;
|
|
550
|
+
}
|
|
551
|
+
set value(value) {
|
|
552
|
+
this.#_value_accessor_storage = value;
|
|
553
|
+
}
|
|
547
554
|
/**
|
|
548
555
|
* The computed aria-label for the toggle button based on open state.
|
|
549
556
|
*/
|
|
@@ -879,7 +886,7 @@ __decorate([property({ attribute: "toggle-label-open" })], CDSDropdown.prototype
|
|
|
879
886
|
__decorate([property({ attribute: "label" })], CDSDropdown.prototype, "label", void 0);
|
|
880
887
|
__decorate([property({ reflect: true })], CDSDropdown.prototype, "type", void 0);
|
|
881
888
|
__decorate([property({ attribute: "validity-message" })], CDSDropdown.prototype, "validityMessage", void 0);
|
|
882
|
-
__decorate([property({ reflect: true })], CDSDropdown.prototype, "value",
|
|
889
|
+
__decorate([property({ reflect: true })], CDSDropdown.prototype, "value", null);
|
|
883
890
|
__decorate([property({
|
|
884
891
|
type: Boolean,
|
|
885
892
|
reflect: true
|