@six-group/ui-library 0.0.0-insider.9277796 → 0.0.0-insider.a358260
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/six-checkbox.cjs.entry.js +57 -46
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/six-input.cjs.entry.js +107 -81
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-radio.cjs.entry.js +56 -51
- package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/six-range.cjs.entry.js +114 -75
- package/dist/cjs/six-range.cjs.entry.js.map +1 -1
- package/dist/cjs/six-select.cjs.entry.js +298 -239
- package/dist/cjs/six-select.cjs.entry.js.map +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js +97 -74
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/slot-ad537f24.js.map +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.js +62 -49
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
- package/dist/collection/components/six-input/six-input.js +130 -117
- package/dist/collection/components/six-input/six-input.js.map +1 -1
- package/dist/collection/components/six-radio/six-radio.js +60 -53
- package/dist/collection/components/six-radio/six-radio.js.map +1 -1
- package/dist/collection/components/six-range/six-range.js +121 -76
- package/dist/collection/components/six-range/six-range.js.map +1 -1
- package/dist/collection/components/six-select/six-select.js +248 -240
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-select/util.js +52 -0
- package/dist/collection/components/six-select/util.js.map +1 -0
- package/dist/collection/components/six-textarea/six-textarea.js +115 -105
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
- package/dist/collection/utils/slot.js.map +1 -1
- package/dist/components/six-checkbox.js +57 -46
- package/dist/components/six-checkbox.js.map +1 -1
- package/dist/components/six-input2.js +107 -81
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-radio.js +56 -51
- package/dist/components/six-radio.js.map +1 -1
- package/dist/components/six-range.js +114 -75
- package/dist/components/six-range.js.map +1 -1
- package/dist/components/six-select.js +299 -240
- package/dist/components/six-select.js.map +1 -1
- package/dist/components/six-textarea.js +97 -74
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components/slot.js.map +1 -1
- package/dist/components.json +51 -41
- package/dist/esm/six-checkbox.entry.js +57 -46
- package/dist/esm/six-checkbox.entry.js.map +1 -1
- package/dist/esm/six-input.entry.js +107 -81
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-radio.entry.js +56 -51
- package/dist/esm/six-radio.entry.js.map +1 -1
- package/dist/esm/six-range.entry.js +114 -75
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-select.entry.js +299 -240
- package/dist/esm/six-select.entry.js.map +1 -1
- package/dist/esm/six-textarea.entry.js +97 -74
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/slot-6f3984c7.js.map +1 -1
- package/dist/types/components/six-checkbox/six-checkbox.d.ts +21 -17
- package/dist/types/components/six-input/six-input.d.ts +27 -36
- package/dist/types/components/six-radio/six-radio.d.ts +10 -11
- package/dist/types/components/six-range/six-range.d.ts +24 -20
- package/dist/types/components/six-select/six-select.d.ts +35 -40
- package/dist/types/components/six-select/util.d.ts +7 -0
- package/dist/types/components/six-textarea/six-textarea.d.ts +22 -31
- package/dist/types/components.d.ts +20 -28
- package/dist/types/utils/testing.d.ts +1 -1
- package/dist/ui-library/p-163f2bb0.entry.js +2 -0
- package/dist/ui-library/p-163f2bb0.entry.js.map +1 -0
- package/dist/ui-library/{p-14f20bbb.entry.js → p-394a2a12.entry.js} +2 -2
- package/dist/ui-library/p-394a2a12.entry.js.map +1 -0
- package/dist/ui-library/{p-7e0cc4ae.entry.js → p-3c635d0a.entry.js} +2 -2
- package/dist/ui-library/p-3c635d0a.entry.js.map +1 -0
- package/dist/ui-library/p-5a25d6fb.entry.js +2 -0
- package/dist/ui-library/p-5a25d6fb.entry.js.map +1 -0
- package/dist/ui-library/{p-90dc6af4.entry.js → p-97cc839c.entry.js} +2 -2
- package/dist/ui-library/p-97cc839c.entry.js.map +1 -0
- package/dist/ui-library/p-b4dfb7cf.js.map +1 -1
- package/dist/ui-library/p-f604e067.entry.js +2 -0
- package/dist/ui-library/p-f604e067.entry.js.map +1 -0
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/package.json +13 -14
- package/dist/ui-library/p-0d79b0c6.entry.js +0 -2
- package/dist/ui-library/p-0d79b0c6.entry.js.map +0 -1
- package/dist/ui-library/p-14f20bbb.entry.js.map +0 -1
- package/dist/ui-library/p-7e0cc4ae.entry.js.map +0 -1
- package/dist/ui-library/p-835c3ff7.entry.js +0 -2
- package/dist/ui-library/p-835c3ff7.entry.js.map +0 -1
- package/dist/ui-library/p-90dc6af4.entry.js.map +0 -1
- package/dist/ui-library/p-edc96efc.entry.js +0 -2
- package/dist/ui-library/p-edc96efc.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-textarea.entry.js","mappings":";;;;;AAAA,MAAM,cAAc,GAAG,ywKAAywK;;ACMhyK,IAAI,EAAE,GAAG,CAAC,CAAC;MAuBE,WAAW;;;;;;;;IACtB,YAAO,GAAG,YAAY,EAAE,EAAE,EAAE,CAAC;IAC7B,YAAO,GAAG,kBAAkB,EAAE,EAAE,CAAC;IACjC,eAAU,GAAG,sBAAsB,EAAE,EAAE,CAAC;IACxC,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAGvC,oBAAe,GAAG,EAAE,CAAC;IACrB,qBAAgB,GAAG,KAAK,CAAC;IAEhB,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;;IA6HvC,iBAAY,GAAG,EAAE,CAAC;oBAzHN,KAAK;2BACE,KAAK;4BACJ,KAAK;wBACT,KAAK;gBAGiC,QAAQ;gBAGtC,EAAE;iBAGc,EAAE;iBAGlC,EAAE;oBAGC,EAAE;qBAGD,EAAE;;gB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,UAAU,EACf,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,EACjC,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,KAAK,EAAC,mBAAmB,EACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,IAAI,CAAC,SAAS,qBACR,IAAI,CAAC,OAAO,EAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,GACvB,CACE,CACM,EACd;GACH;;;;;;;;;;;;;;","names":[],"sources":["./src/components/six-textarea/six-textarea.scss?tag=six-textarea&encapsulation=shadow","./src/components/six-textarea/six-textarea.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.textarea {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n line-height: var(--six-line-height-normal);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &:hover:not(.textarea--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .textarea__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &.textarea--focused:not(.textarea--disabled) {\n background-color: var(--six-input-background-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n border-color: var(--six-input-border-color-focus);\n color: var(--six-input-color-focus);\n\n .textarea__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.textarea--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .textarea__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n}\n\n.textarea__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: 1.4;\n color: var(--sl-input-color);\n border: none;\n background: none;\n box-shadow: none;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.textarea--invalid:not(.textarea--disabled):not(.textarea--focused) {\n border-color: var(--six-input-border-color-danger);\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.textarea--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-small);\n }\n}\n\n.textarea--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-medium);\n }\n}\n\n.textarea--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Resize types\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.textarea--resize-none .textarea__control {\n resize: none;\n}\n\n.textarea--resize-vertical .textarea__control {\n resize: vertical;\n}\n\n.textarea--resize-auto .textarea__control {\n height: auto;\n resize: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The textarea's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the input.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, textarea, and help text.\n * @part label - The textarea label.\n * @part textarea - The textarea control.\n * @part help-text - The textarea help text.\n */\n@Component({\n tag: 'six-textarea',\n styleUrl: 'six-textarea.scss',\n shadow: true,\n})\nexport class SixTextarea {\n inputId = `textarea-${++id}`;\n labelId = `textarea-label-${id}`;\n helpTextId = `textarea-help-text-${id}`;\n errorTextId = `input-error-text-${id}`;\n resizeObserver: ResizeObserver;\n textarea: HTMLTextAreaElement;\n customErrorText = '';\n customValidation = false;\n\n readonly eventListeners = new EventListeners();\n\n @Element() host: HTMLSixTextareaElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasErrorTextSlot = false;\n @State() hasLabelSlot = false;\n\n /** The textarea's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The textarea's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The textarea's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** The textarea's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** The textarea's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The textarea's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText = '';\n\n /** The textarea's placeholder text. */\n @Prop() placeholder: string;\n\n /** The number of rows to display by default. */\n @Prop() rows = 4;\n\n /** Controls how the textarea can be resized. */\n @Prop() resize: 'none' | 'vertical' | 'auto' = 'vertical';\n\n /** Set to true to disable the textarea. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true for a readonly textarea. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength: number;\n\n /** The textarea's required attribute. */\n @Prop({ reflect: true }) required: boolean;\n\n /**\n * This will be true when the control is in an invalid state. Validity is determined by props such as `required`,\n * `minlength`, and `maxlength` using the browser's constraint validation API.\n */\n @Prop({ mutable: true, reflect: true }) invalid = false;\n\n /** The textarea's autocaptialize attribute. */\n @Prop() autocapitalize: string;\n\n /** The textarea's autocorrect attribute. */\n @Prop() autocorrect: string;\n\n /** The textarea's autocomplete attribute. */\n @Prop() autocomplete: string;\n\n /** The textarea's autofocus attribute. */\n @Prop() autofocus: boolean;\n\n /** The textarea's spellcheck attribute. */\n @Prop() spellcheck: boolean;\n\n /** The textarea's inputmode attribute. */\n @Prop() inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to display the error text on blur and not when typing */\n @Prop() errorOnBlur = false;\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-change' }) sixChange: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-input' }) sixInput: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-textarea-focus' }) sixFocus: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-blur' }) sixBlur: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted whenever the value changes. Access the new value via event.target.value.\n * six-textarea-value-change will emit whenever the value changes.\n * So be it on textarea or when dynamically set. six-textarea-input will only be emitted when the user enters data,\n * but not when a value is dynamically set. six-textarea-change will only be emitted when the user either presses enter\n * or leaves the textarea field after entering some data.\n * */\n\n @Event({ eventName: 'six-textarea-value-change' }) sixValueChange: EventEmitter<EmptyPayload>;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('rows')\n handleRowsChange() {\n if (this.textarea) {\n this.setTextareaHeight();\n }\n }\n\n @Watch('value')\n handleValueChange() {\n if (!this.textarea) {\n return;\n }\n this.textarea.value = this.value;\n this.invalid = !this.textarea.checkValidity();\n this.sixValueChange.emit();\n }\n\n /** default value the textarea will be reverted to when reset is executed */\n private defaultValue = '';\n\n connectedCallback() {\n this.handleChange = this.handleChange.bind(this);\n this.handleInput = this.handleInput.bind(this);\n this.handleInvalid = this.handleInvalid.bind(this);\n this.handleBlur = this.handleBlur.bind(this);\n this.handleFocus = this.handleFocus.bind(this);\n this.handleSlotChange = this.handleSlotChange.bind(this);\n\n this.host.shadowRoot.addEventListener('slotchange', this.handleSlotChange);\n }\n\n componentWillLoad() {\n this.defaultValue = this.value || '';\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n this.setTextareaHeight();\n this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight());\n this.resizeObserver.observe(this.textarea);\n this.eventListeners.add(this.textarea, 'invalid', (event) => {\n if (this.customValidation || (!this.hasErrorTextSlot && !this.errorText && !this.customErrorText)) {\n this.customErrorText = this.textarea.validationMessage;\n }\n event.preventDefault();\n });\n }\n\n disconnectedCallback() {\n this.resizeObserver.unobserve(this.textarea);\n this.host.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the textarea. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.textarea.focus(options);\n }\n\n /** Removes focus fromt the textarea. */\n @Method()\n async removeFocus() {\n this.textarea.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.textarea.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.textarea.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n this.textarea.setRangeText(replacement, start, end, selectMode);\n\n if (this.value !== this.textarea.value) {\n this.value = this.textarea.value;\n this.setTextareaHeight();\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n @Method()\n async reportValidity() {\n return this.textarea.reportValidity();\n }\n\n /** Checks for validity. */\n @Method()\n async checkValidity() {\n return this.textarea.validity.valid;\n }\n\n /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */\n @Method()\n async setCustomValidity(message: string) {\n this.customErrorText = '';\n this.customValidation = message !== '';\n this.textarea.setCustomValidity(message);\n this.invalid = !this.textarea.checkValidity();\n }\n\n /** Resets the formcontrol */\n @Method()\n async reset() {\n this.value = this.defaultValue;\n this.customErrorText = '';\n this.customValidation = false;\n this.textarea.setCustomValidity('');\n this.invalid = false;\n }\n\n handleChange() {\n this.sixChange.emit();\n }\n\n handleInput() {\n this.value = this.textarea.value;\n this.setTextareaHeight();\n this.sixInput.emit();\n }\n\n handleInvalid() {\n this.invalid = true;\n }\n\n handleBlur() {\n this.hasFocus = false;\n this.sixBlur.emit();\n }\n\n handleFocus() {\n this.hasFocus = true;\n this.sixFocus.emit();\n }\n\n handleSlotChange() {\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n }\n\n setTextareaHeight() {\n if (this.resize === 'auto') {\n this.textarea.style.height = 'auto';\n this.textarea.style.height = this.textarea.scrollHeight + 'px';\n } else {\n this.textarea.style.height = undefined;\n }\n }\n\n displayError() {\n return this.invalid && (!this.errorOnBlur || !this.hasFocus);\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.customErrorText ? this.customErrorText : this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.displayError()}\n >\n <div\n part=\"base\"\n class={{\n textarea: true,\n\n // Sizes\n 'textarea--small': this.size === 'small',\n 'textarea--medium': this.size === 'medium',\n 'textarea--large': this.size === 'large',\n\n // States\n 'textarea--disabled': this.disabled,\n 'textarea--focused': this.hasFocus,\n 'textarea--empty': this.value?.length === 0,\n 'textarea--invalid': this.invalid,\n\n // Modifiers\n 'textarea--resize-none': this.resize === 'none',\n 'textarea--resize-vertical': this.resize === 'vertical',\n 'textarea--resize-auto': this.resize === 'auto',\n }}\n >\n <textarea\n part=\"textarea\"\n ref={(el) => (this.textarea = el)}\n id={this.inputId}\n class=\"textarea__control\"\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readOnly={this.readonly}\n rows={this.rows}\n minLength={this.minlength}\n maxLength={this.maxlength}\n value={this.value}\n autoCapitalize={this.autocapitalize}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onInvalid={this.handleInvalid}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n </FormControl>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"six-textarea.entry.js","mappings":";;;;;AAAA,MAAM,cAAc,GAAG,ywKAAywK;;ACMhyK,IAAI,EAAE,GAAG,CAAC,CAAC;MAuBE,WAAW;;;;;;;IACd,YAAO,GAAG,YAAY,EAAE,EAAE,EAAE,CAAC;IAC7B,YAAO,GAAG,kBAAkB,EAAE,EAAE,CAAC;IACjC,eAAU,GAAG,sBAAsB,EAAE,EAAE,CAAC;IACxC,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAEvC,oBAAe,GAAG,EAAE,CAAC;IACrB,qBAAgB,GAAG,KAAK,CAAC;IACzB,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;;IAqHtC,iBAAY,GAAG,EAAE,CAAC;IAwHlB,iBAAY,GAAG;MACrB,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,EAAE;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;QACvC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;OACvB;KACF,CAAC;IAEM,gBAAW,GAAG;MACpB,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,EAAE;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;QACvC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;OACtB;KACF,CAAC;IAEM,eAAU,GAAG;MACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;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EAAE,IAAI,CAAC,MAAM,KAAK,UAAU;QACvD,uBAAuB,EAAE,IAAI,CAAC,MAAM,KAAK,MAAM;OAChD,IAED,gBACE,IAAI,EAAC,UAAU,EACf,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACvC,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,KAAK,EAAC,mBAAmB,EACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,EACtB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,IAAI,CAAC,SAAS,qBACR,IAAI,CAAC,OAAO,EAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,GACvB,CACE,CACM,EACd;GACH;;;;;;;;;;;;;;","names":[],"sources":["./src/components/six-textarea/six-textarea.scss?tag=six-textarea&encapsulation=shadow","./src/components/six-textarea/six-textarea.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.textarea {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n line-height: var(--six-line-height-normal);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &:hover:not(.textarea--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .textarea__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &.textarea--focused:not(.textarea--disabled) {\n background-color: var(--six-input-background-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n border-color: var(--six-input-border-color-focus);\n color: var(--six-input-color-focus);\n\n .textarea__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.textarea--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .textarea__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n}\n\n.textarea__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: 1.4;\n color: var(--sl-input-color);\n border: none;\n background: none;\n box-shadow: none;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.textarea--invalid:not(.textarea--disabled):not(.textarea--focused) {\n border-color: var(--six-input-border-color-danger);\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.textarea--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-small);\n }\n}\n\n.textarea--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-medium);\n }\n}\n\n.textarea--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Resize types\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.textarea--resize-none .textarea__control {\n resize: none;\n}\n\n.textarea--resize-vertical .textarea__control {\n resize: vertical;\n}\n\n.textarea--resize-auto .textarea__control {\n height: auto;\n resize: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The textarea's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the input.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, textarea, and help text.\n * @part label - The textarea label.\n * @part textarea - The textarea control.\n * @part help-text - The textarea help text.\n */\n@Component({\n tag: 'six-textarea',\n styleUrl: 'six-textarea.scss',\n shadow: true,\n})\nexport class SixTextarea {\n private inputId = `textarea-${++id}`;\n private labelId = `textarea-label-${id}`;\n private helpTextId = `textarea-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeTextarea?: HTMLTextAreaElement;\n private customErrorText = '';\n private customValidation = false;\n private eventListeners = new EventListeners();\n private resizeObserver?: ResizeObserver;\n\n @Element() host!: HTMLSixTextareaElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasErrorTextSlot = false;\n @State() hasLabelSlot = false;\n\n /** The textarea's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The textarea's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The textarea's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** The textarea's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** The textarea's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The textarea's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText = '';\n\n /** The textarea's placeholder text. */\n @Prop() placeholder?: string;\n\n /** The number of rows to display by default. */\n @Prop() rows = 4;\n\n /** Controls how the textarea can be resized. */\n @Prop() resize: 'none' | 'vertical' | 'auto' = 'vertical';\n\n /** Set to true to disable the textarea. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true for a readonly textarea. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The textarea's required attribute. */\n @Prop({ reflect: true }) required = false;\n\n /**\n * This will be true when the control is in an invalid state. Validity is determined by props such as `required`,\n * `minlength`, and `maxlength` using the browser's constraint validation API.\n */\n @Prop({ mutable: true, reflect: true }) invalid = false;\n\n /** The textarea's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The textarea's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The textarea's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The textarea's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** The textarea's spellcheck attribute. */\n @Prop() spellcheck = false;\n\n /** The textarea's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to display the error text on blur and not when typing */\n @Prop() errorOnBlur = false;\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-textarea-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('rows')\n handleRowsChange() {\n if (this.nativeTextarea != null) {\n this.setTextareaHeight(this.nativeTextarea);\n }\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeTextarea != null) {\n if (this.nativeTextarea.value !== this.value) {\n this.nativeTextarea.value = this.value;\n }\n this.invalid = !this.nativeTextarea.checkValidity();\n }\n }\n\n /** default value the textarea will be reverted to when reset is executed */\n private defaultValue = '';\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n componentWillLoad() {\n this.defaultValue = this.value || '';\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeTextarea = this.nativeTextarea;\n if (nativeTextarea == null) {\n return;\n }\n this.setTextareaHeight(nativeTextarea);\n this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight(nativeTextarea));\n this.resizeObserver.observe(nativeTextarea);\n this.eventListeners.add(nativeTextarea, 'invalid', (event) => {\n this.invalid = true;\n if (this.customValidation || (!this.hasErrorTextSlot && this.errorText === '' && this.customErrorText === '')) {\n this.customErrorText = nativeTextarea.validationMessage;\n }\n event.preventDefault();\n });\n }\n\n disconnectedCallback() {\n if (this.nativeTextarea != null) {\n this.resizeObserver?.unobserve(this.nativeTextarea);\n }\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the textarea. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeTextarea?.focus(options);\n }\n\n /** Removes focus fromt the textarea. */\n @Method()\n async removeFocus() {\n this.nativeTextarea?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeTextarea?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeTextarea?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeTextarea == null) {\n return;\n }\n this.nativeTextarea.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeTextarea.value) {\n this.value = this.nativeTextarea.value;\n this.setTextareaHeight(this.nativeTextarea);\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n @Method()\n async reportValidity() {\n return this.nativeTextarea?.reportValidity();\n }\n\n /** Checks for validity. */\n @Method()\n async checkValidity() {\n if (this.nativeTextarea == null) {\n return true;\n }\n return this.nativeTextarea.validity.valid;\n }\n\n /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */\n @Method()\n async setCustomValidity(message: string) {\n this.customErrorText = '';\n this.customValidation = message !== '';\n if (this.nativeTextarea != null) {\n this.nativeTextarea.setCustomValidity(message);\n this.invalid = !this.nativeTextarea.checkValidity();\n }\n }\n\n /** Resets the formcontrol */\n @Method()\n async reset() {\n this.value = this.defaultValue;\n this.customErrorText = '';\n this.customValidation = false;\n this.nativeTextarea?.setCustomValidity('');\n this.invalid = false;\n }\n\n private handleChange = () => {\n if (this.nativeTextarea != null) {\n this.value = this.nativeTextarea.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = () => {\n if (this.nativeTextarea != null) {\n this.value = this.nativeTextarea.value;\n this.setTextareaHeight(this.nativeTextarea);\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleSlotChange = () => {\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n };\n\n private setTextareaHeight(nativeTextarea: HTMLTextAreaElement) {\n if (this.resize === 'auto') {\n nativeTextarea.style.height = 'auto';\n const height = nativeTextarea.scrollHeight + 1;\n nativeTextarea.style.height = height + 'px';\n } else {\n nativeTextarea.style.height = '';\n }\n }\n\n private displayError() {\n return this.invalid && (!this.errorOnBlur || !this.hasFocus);\n }\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.customErrorText != null ? this.customErrorText : this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.displayError()}\n >\n <div\n part=\"base\"\n class={{\n textarea: true,\n\n // Sizes\n 'textarea--small': this.size === 'small',\n 'textarea--medium': this.size === 'medium',\n 'textarea--large': this.size === 'large',\n\n // States\n 'textarea--disabled': this.disabled,\n 'textarea--focused': this.hasFocus,\n 'textarea--empty': this.getValue().length === 0,\n 'textarea--invalid': this.invalid,\n\n // Modifiers\n 'textarea--resize-none': this.resize === 'none',\n 'textarea--resize-vertical': this.resize === 'vertical',\n 'textarea--resize-auto': this.resize === 'auto',\n }}\n >\n <textarea\n part=\"textarea\"\n ref={(el) => (this.nativeTextarea = el)}\n id={this.inputId}\n class=\"textarea__control\"\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readOnly={this.readonly}\n rows={this.rows}\n minLength={this.minlength}\n maxLength={this.maxlength}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n </FormControl>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"slot-6f3984c7.js","mappings":"AAAA;AAqBA;AACA;AACA;AACA;SACgB,cAAc,CAAC,IAAqB;EAClD,MAAM,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC;EAChE,IAAI,IAAI,GAAG,EAAE,CAAC;EAEd,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI;IAClB,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;MACpC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC;KAC1B;GACF,CAAC,CAAC;EAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;AACA;AACA;AACA;SACgB,OAAO,CAAC,EAAe,EAAE,IAAa;;EAEpD,IAAI,IAAI,EAAE;IACR,OAAO,EAAE,CAAC,aAAa,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC;GACtD;;EAGD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI;IACzC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;MACtE,OAAO,IAAI,CAAC;KACb;IAED,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE;MACvC,MAAM,EAAE,GAAG,IAAmB,CAAC;MAC/B,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;QAC5B,OAAO,IAAI,CAAC;OACb;KACF;IAED,OAAO,KAAK,CAAC;GACd,CAAC,CAAC;AACL,CAAC;AAID,MAAM,SAAS,GAAG,CAAmB,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAe,sCAAW,GAAG,KAAE,CAAC,CAAC,GAAG,CAAC,IAAG,CAAC;MAE3E,iBAAiB,GAC5B,CAAmB,KAAQ,KAC3B,CAAwB,IAAO,KAC7B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;GACjB,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;GAC1C,MAAM,CAAC,SAAS,EAAE,EAAuB,EAAE;MAErC,eAAe,GAAG,CAAwB,EAAe,eACpE,OAAA,MAAA,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,0CAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAQ,CAAA;;;;","names":[],"sources":["./src/utils/slot.ts"],"sourcesContent":["//\n// Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated\n// HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.\n//\nexport function getInnerHTML(slot: HTMLSlotElement): string {\n const nodes = slot.assignedNodes({ flatten: true });\n let html = '';\n\n [...nodes].map((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as HTMLElement).outerHTML;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n }\n });\n\n return html;\n}\n\n//\n// Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a\n// string. This is useful because we can't use slot.textContent as an alternative.\n//\nexport function getTextContent(slot: HTMLSlotElement): string {\n const nodes = slot ? slot.assignedNodes({ flatten: true }) : [];\n let text = '';\n\n [...nodes].map((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n\n//\n// Determines whether an element has a slot. If name is specified, the function will look for a corresponding named\n// slot, otherwise it will look for a \"default\" slot (e.g. a non-empty text node or an element with no slot attribute).\n//\nexport function hasSlot(el: HTMLElement, name?: string) {\n // Look for a named slot\n if (name) {\n return el.querySelector(`[slot=\"${name}\"]`) !== null;\n }\n\n // Look for a default slot\n return Array.from(el.childNodes).some((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n}\n\ntype AvailableSlots<T> = { readonly [K in keyof T]: boolean };\n\nconst fromPairs = <T extends string>(acc, [k, v]: [T, boolean]) => ({ ...acc, [k]: v });\n\nexport const getAvailableSlots =\n <T extends object>(slots: T) =>\n <E extends HTMLElement>(host: E): AvailableSlots<T> =>\n Object.values(slots)\n .map((name) => [name, hasSlot(host, name)])\n .reduce(fromPairs, {} as AvailableSlots<T>);\n\nexport const getSlotChildren = <T extends HTMLElement>(el: HTMLElement) =>\n el.querySelector('slot')?.assignedElements({ flatten: true }) as T[];\n"],"version":3}
|
|
1
|
+
{"file":"slot-6f3984c7.js","mappings":"AAAA;AAqBA;AACA;AACA;AACA;SACgB,cAAc,CAAC,IAAqB;EAClD,MAAM,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC;EAChE,IAAI,IAAI,GAAG,EAAE,CAAC;EAEd,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAA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E,OAAA,MAAA,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,0CAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAQ,CAAA;;;;","names":[],"sources":["./src/utils/slot.ts"],"sourcesContent":["//\n// Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated\n// HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.\n//\nexport function getInnerHTML(slot: HTMLSlotElement): string {\n const nodes = slot.assignedNodes({ flatten: true });\n let html = '';\n\n [...nodes].map((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as HTMLElement).outerHTML;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n }\n });\n\n return html;\n}\n\n//\n// Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a\n// string. This is useful because we can't use slot.textContent as an alternative.\n//\nexport function getTextContent(slot: HTMLSlotElement): string {\n const nodes = slot ? slot.assignedNodes({ flatten: true }) : [];\n let text = '';\n\n [...nodes].map((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n\n//\n// Determines whether an element has a slot. If name is specified, the function will look for a corresponding named\n// slot, otherwise it will look for a \"default\" slot (e.g. a non-empty text node or an element with no slot attribute).\n//\nexport function hasSlot(el: HTMLElement, name?: string): boolean {\n // Look for a named slot\n if (name) {\n return el.querySelector(`[slot=\"${name}\"]`) !== null;\n }\n\n // Look for a default slot\n return Array.from(el.childNodes).some((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n}\n\ntype AvailableSlots<T> = { readonly [K in keyof T]: boolean };\n\nconst fromPairs = <T extends string>(acc, [k, v]: [T, boolean]) => ({ ...acc, [k]: v });\n\nexport const getAvailableSlots =\n <T extends object>(slots: T) =>\n <E extends HTMLElement>(host: E): AvailableSlots<T> =>\n Object.values(slots)\n .map((name) => [name, hasSlot(host, name)])\n .reduce(fromPairs, {} as AvailableSlots<T>);\n\nexport const getSlotChildren = <T extends HTMLElement>(el: HTMLElement) =>\n el.querySelector('slot')?.assignedElements({ flatten: true }) as T[];\n"],"version":3}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { EmptyPayload } from '../../utils/types';
|
|
3
|
-
import { EventListeners } from '../../utils/event-listeners';
|
|
4
3
|
/**
|
|
5
4
|
* @since 1.0
|
|
6
5
|
* @status stable
|
|
@@ -17,21 +16,27 @@ import { EventListeners } from '../../utils/event-listeners';
|
|
|
17
16
|
* @part text - The checkbox text rendered to the right.
|
|
18
17
|
*/
|
|
19
18
|
export declare class SixCheckbox {
|
|
20
|
-
inputId
|
|
21
|
-
labelId
|
|
22
|
-
textId
|
|
23
|
-
errorTextId
|
|
24
|
-
|
|
25
|
-
customErrorText
|
|
26
|
-
customValidation
|
|
27
|
-
|
|
19
|
+
private inputId;
|
|
20
|
+
private labelId;
|
|
21
|
+
private textId;
|
|
22
|
+
private errorTextId;
|
|
23
|
+
private nativeInput?;
|
|
24
|
+
private customErrorText;
|
|
25
|
+
private customValidation;
|
|
26
|
+
private eventListeners;
|
|
28
27
|
host: HTMLSixCheckboxElement;
|
|
29
28
|
hasFocus: boolean;
|
|
30
29
|
hasLabelSlot: boolean;
|
|
31
30
|
hasErrorTextSlot: boolean;
|
|
32
31
|
/** The checkbox's name attribute. */
|
|
33
32
|
name: string;
|
|
34
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* The value of the checkbox does not mean if it's checked or not, use the `checked`
|
|
35
|
+
* property for that.
|
|
36
|
+
*
|
|
37
|
+
* The value of a checkbox is analogous to the value of an `<input type="checkbox">`,
|
|
38
|
+
* it's only used when the checkbox participates in a native `<form>`.
|
|
39
|
+
*/
|
|
35
40
|
value: string;
|
|
36
41
|
/** Set to true to disable the checkbox. */
|
|
37
42
|
disabled: boolean;
|
|
@@ -75,12 +80,11 @@ export declare class SixCheckbox {
|
|
|
75
80
|
setCustomValidity(message: string): Promise<void>;
|
|
76
81
|
/** Resets the formcontrol */
|
|
77
82
|
reset(): Promise<void>;
|
|
78
|
-
handleChange
|
|
79
|
-
handleBlur
|
|
80
|
-
handleFocus
|
|
81
|
-
handleMouseDown
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
displayError(): boolean;
|
|
83
|
+
private handleChange;
|
|
84
|
+
private handleBlur;
|
|
85
|
+
private handleFocus;
|
|
86
|
+
private handleMouseDown;
|
|
87
|
+
private handleSlotChange;
|
|
88
|
+
private displayError;
|
|
85
89
|
render(): any;
|
|
86
90
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { EmptyPayload } from '../../utils/types';
|
|
3
|
-
import { EventListeners } from '../../utils/event-listeners';
|
|
4
3
|
/**
|
|
5
4
|
* @since 1.0
|
|
6
5
|
* @status stable
|
|
@@ -27,14 +26,14 @@ import { EventListeners } from '../../utils/event-listeners';
|
|
|
27
26
|
* @part help-text - The input help text.
|
|
28
27
|
*/
|
|
29
28
|
export declare class SixInput {
|
|
30
|
-
inputId
|
|
31
|
-
labelId
|
|
32
|
-
helpTextId
|
|
33
|
-
errorTextId
|
|
34
|
-
|
|
35
|
-
customErrorText
|
|
36
|
-
customValidation
|
|
37
|
-
|
|
29
|
+
private inputId;
|
|
30
|
+
private labelId;
|
|
31
|
+
private helpTextId;
|
|
32
|
+
private errorTextId;
|
|
33
|
+
private nativeInput?;
|
|
34
|
+
private customErrorText;
|
|
35
|
+
private customValidation;
|
|
36
|
+
private eventListeners;
|
|
38
37
|
host: HTMLSixInputElement;
|
|
39
38
|
hasFocus: boolean;
|
|
40
39
|
hasHelpTextSlot: boolean;
|
|
@@ -58,29 +57,29 @@ export declare class SixInput {
|
|
|
58
57
|
/** The input's error text. Alternatively, you can use the error-text slot. */
|
|
59
58
|
errorText: string;
|
|
60
59
|
/** The input's placeholder text. */
|
|
61
|
-
placeholder
|
|
60
|
+
placeholder?: string;
|
|
62
61
|
/** Set to true to disable the input. */
|
|
63
62
|
disabled: boolean;
|
|
64
63
|
/** Set to true to make the input readonly. */
|
|
65
64
|
readonly: boolean;
|
|
66
65
|
/** The minimum length of input that will be considered valid. */
|
|
67
|
-
minlength
|
|
66
|
+
minlength?: number;
|
|
68
67
|
/** The maximum length of input that will be considered valid. */
|
|
69
|
-
maxlength
|
|
68
|
+
maxlength?: number;
|
|
70
69
|
/** The input's minimum value. */
|
|
71
|
-
min
|
|
70
|
+
min?: number;
|
|
72
71
|
/** The input's maximum value. */
|
|
73
|
-
max
|
|
72
|
+
max?: number;
|
|
74
73
|
/** The input's step attribute. */
|
|
75
|
-
step
|
|
74
|
+
step?: number;
|
|
76
75
|
/** A pattern to validate input against. */
|
|
77
|
-
pattern
|
|
76
|
+
pattern?: string;
|
|
78
77
|
/** Set to true to make the input a required field. */
|
|
79
78
|
required: boolean;
|
|
80
79
|
/** The input's autocaptialize attribute. */
|
|
81
80
|
autocapitalize: string;
|
|
82
81
|
/** The input's autocorrect attribute. */
|
|
83
|
-
autocorrect:
|
|
82
|
+
autocorrect: 'on' | 'off';
|
|
84
83
|
/** The input's autocomplete attribute. */
|
|
85
84
|
autocomplete: string;
|
|
86
85
|
/** The input's autofocus attribute. */
|
|
@@ -97,7 +96,7 @@ export declare class SixInput {
|
|
|
97
96
|
/** Set to true to add a password toggle button for password inputs. */
|
|
98
97
|
togglePassword: boolean;
|
|
99
98
|
/** The input's inputmode attribute. */
|
|
100
|
-
inputmode
|
|
99
|
+
inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
101
100
|
/** Set to render as line */
|
|
102
101
|
line: boolean;
|
|
103
102
|
/** Set to display the error text on blur and not when typing */
|
|
@@ -114,14 +113,6 @@ export declare class SixInput {
|
|
|
114
113
|
sixFocus: EventEmitter<EmptyPayload>;
|
|
115
114
|
/** Emitted when the control loses focus. Access the new value via event.target.value. */
|
|
116
115
|
sixBlur: EventEmitter<EmptyPayload>;
|
|
117
|
-
/**
|
|
118
|
-
* Emitted whenever the value changes. Access the new value via event.target.value.
|
|
119
|
-
* six-input-value-change will emit whenever the value changes.
|
|
120
|
-
* So be it on input or when dynamically set. six-input-input will only be emitted when the user enters data,
|
|
121
|
-
* but not when a value is dynamically set. six-input-change will only be emitted when the user either presses enter
|
|
122
|
-
* or leaves the input field after entering some data.
|
|
123
|
-
* */
|
|
124
|
-
sixValueChange: EventEmitter<EmptyPayload>;
|
|
125
116
|
/** defaultValue which the input will be reverted to when executing reset */
|
|
126
117
|
private defaultValue;
|
|
127
118
|
connectedCallback(): void;
|
|
@@ -145,21 +136,21 @@ export declare class SixInput {
|
|
|
145
136
|
/** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */
|
|
146
137
|
setCustomValidity(message: string): Promise<void>;
|
|
147
138
|
/** Returns the native input's validity */
|
|
148
|
-
getValidity(): Promise<ValidityState>;
|
|
139
|
+
getValidity(): Promise<ValidityState | undefined>;
|
|
149
140
|
/** Returns the native input's validity */
|
|
150
141
|
isValid(): Promise<boolean>;
|
|
151
142
|
/** Returns the native input's validationMessage */
|
|
152
143
|
getValidationMessage(): Promise<string>;
|
|
153
144
|
/** Resets the formcontrol */
|
|
154
145
|
reset(): Promise<void>;
|
|
155
|
-
handleChange
|
|
156
|
-
handleInput
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
146
|
+
private handleChange;
|
|
147
|
+
private handleInput;
|
|
148
|
+
private handleBlur;
|
|
149
|
+
private handleFocus;
|
|
150
|
+
private handleClearClick;
|
|
151
|
+
private handlePasswordToggle;
|
|
152
|
+
private handleSlotChange;
|
|
153
|
+
private displayError;
|
|
154
|
+
private getValue;
|
|
164
155
|
render(): any;
|
|
165
156
|
}
|
|
@@ -14,9 +14,9 @@ import { EmptyPayload } from '../../utils/types';
|
|
|
14
14
|
* @part label - The radio label.
|
|
15
15
|
*/
|
|
16
16
|
export declare class SixRadio {
|
|
17
|
-
inputId
|
|
18
|
-
labelId
|
|
19
|
-
|
|
17
|
+
private inputId;
|
|
18
|
+
private labelId;
|
|
19
|
+
private nativeInput?;
|
|
20
20
|
host: HTMLSixRadioElement;
|
|
21
21
|
hasFocus: boolean;
|
|
22
22
|
/** The radio's name attribute. */
|
|
@@ -41,7 +41,6 @@ export declare class SixRadio {
|
|
|
41
41
|
sixFocus: EventEmitter<EmptyPayload>;
|
|
42
42
|
/** default state whether the radio button should be checked or not when resetting */
|
|
43
43
|
private defaultState;
|
|
44
|
-
connectedCallback(): void;
|
|
45
44
|
componentWillLoad(): void;
|
|
46
45
|
/** Sets focus on the radio. */
|
|
47
46
|
setFocus(options?: FocusOptions): Promise<void>;
|
|
@@ -55,12 +54,12 @@ export declare class SixRadio {
|
|
|
55
54
|
setCustomValidity(message: string): Promise<void>;
|
|
56
55
|
/** Resets the formcontrol */
|
|
57
56
|
reset(): Promise<void>;
|
|
58
|
-
getAllRadios
|
|
59
|
-
getSiblingRadios
|
|
60
|
-
handleClick
|
|
61
|
-
handleBlur
|
|
62
|
-
handleFocus
|
|
63
|
-
handleKeyDown
|
|
64
|
-
handleMouseDown
|
|
57
|
+
private getAllRadios;
|
|
58
|
+
private getSiblingRadios;
|
|
59
|
+
private handleClick;
|
|
60
|
+
private handleBlur;
|
|
61
|
+
private handleFocus;
|
|
62
|
+
private handleKeyDown;
|
|
63
|
+
private handleMouseDown;
|
|
65
64
|
render(): any;
|
|
66
65
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { EmptyPayload } from '../../utils/types';
|
|
3
|
-
import { EventListeners } from '../../utils/event-listeners';
|
|
4
3
|
/**
|
|
5
4
|
* @since 1.0
|
|
6
5
|
* @status stable
|
|
@@ -16,16 +15,16 @@ import { EventListeners } from '../../utils/event-listeners';
|
|
|
16
15
|
* @part tooltip - The range tooltip.
|
|
17
16
|
*/
|
|
18
17
|
export declare class SixRange {
|
|
19
|
-
inputId
|
|
20
|
-
labelId
|
|
21
|
-
helpTextId
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
private inputId;
|
|
19
|
+
private labelId;
|
|
20
|
+
private helpTextId;
|
|
21
|
+
private customErrorText;
|
|
22
|
+
private customValidation;
|
|
23
|
+
private errorTextId;
|
|
24
|
+
private eventListeners;
|
|
25
|
+
private resizeObserver?;
|
|
26
|
+
private output?;
|
|
27
|
+
private nativeInput?;
|
|
29
28
|
host: HTMLSixRangeElement;
|
|
30
29
|
hasFocus: boolean;
|
|
31
30
|
hasHelpTextSlot: boolean;
|
|
@@ -85,17 +84,22 @@ export declare class SixRange {
|
|
|
85
84
|
setCustomValidity(message: string): Promise<void>;
|
|
86
85
|
/** Resets the formcontrol */
|
|
87
86
|
reset(): Promise<void>;
|
|
88
|
-
handleInput
|
|
89
|
-
handleBlur
|
|
90
|
-
handleFocus
|
|
91
|
-
handleSlotChange
|
|
92
|
-
handleTouchStart
|
|
93
|
-
displayError
|
|
94
|
-
syncTooltip
|
|
87
|
+
private handleInput;
|
|
88
|
+
private handleBlur;
|
|
89
|
+
private handleFocus;
|
|
90
|
+
private handleSlotChange;
|
|
91
|
+
private handleTouchStart;
|
|
92
|
+
private displayError;
|
|
93
|
+
private syncTooltip;
|
|
94
|
+
private isFirefox;
|
|
95
|
+
private update;
|
|
96
|
+
/**
|
|
97
|
+
* from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range#value
|
|
98
|
+
*/
|
|
99
|
+
private getDefaultValue;
|
|
95
100
|
/**
|
|
96
101
|
* For Firefox this functionality is not needed because it is supported by standard CSS.
|
|
97
102
|
*/
|
|
98
|
-
calculateColorRunnableTrack
|
|
99
|
-
isFirefox(): boolean;
|
|
103
|
+
private calculateColorRunnableTrack;
|
|
100
104
|
render(): any;
|
|
101
105
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { EmptyPayload } from '../../utils/types';
|
|
3
|
-
import { EventListeners } from '../../utils/event-listeners';
|
|
4
3
|
import { SixMenuItemData } from '../six-menu/six-menu';
|
|
5
4
|
export interface SixSelectChangePayload {
|
|
6
5
|
value: string | string[];
|
|
@@ -28,19 +27,19 @@ export interface SixSelectChangePayload {
|
|
|
28
27
|
* @part tags - The container in which multiselect options are rendered.
|
|
29
28
|
*/
|
|
30
29
|
export declare class SixSelect {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
private inputId;
|
|
31
|
+
private labelId;
|
|
32
|
+
private helpTextId;
|
|
33
|
+
private errorTextId;
|
|
34
|
+
private touched;
|
|
35
|
+
private customErrorText;
|
|
36
|
+
private customValidation;
|
|
37
|
+
private box?;
|
|
38
|
+
private dropdown?;
|
|
39
|
+
private inputElement?;
|
|
40
|
+
private menu?;
|
|
41
|
+
private resizeObserver?;
|
|
42
|
+
private eventListeners;
|
|
44
43
|
host: HTMLSixSelectElement;
|
|
45
44
|
hasFocus: boolean;
|
|
46
45
|
hasHelpTextSlot: boolean;
|
|
@@ -48,7 +47,7 @@ export declare class SixSelect {
|
|
|
48
47
|
hasLabelSlot: boolean;
|
|
49
48
|
isOpen: boolean;
|
|
50
49
|
displayLabel: string;
|
|
51
|
-
displayTags:
|
|
50
|
+
displayTags: HTMLSixSelectElement[];
|
|
52
51
|
/** Set to true to enable multiselect. */
|
|
53
52
|
multiple: boolean;
|
|
54
53
|
/**
|
|
@@ -63,7 +62,7 @@ export declare class SixSelect {
|
|
|
63
62
|
/** The select's placeholder text. */
|
|
64
63
|
placeholder: string;
|
|
65
64
|
/** The filter's placeholder text. */
|
|
66
|
-
filterPlaceholder
|
|
65
|
+
filterPlaceholder?: string;
|
|
67
66
|
/** The debounce for the filter callbacks. */
|
|
68
67
|
filterDebounce: number;
|
|
69
68
|
/** The select's size. */
|
|
@@ -117,7 +116,8 @@ export declare class SixSelect {
|
|
|
117
116
|
handleDisabledChange(): void;
|
|
118
117
|
handleLabelChange(): void;
|
|
119
118
|
handleMultipleChange(): void;
|
|
120
|
-
handleValueChange(): void;
|
|
119
|
+
handleValueChange(newValue: unknown, oldValue: unknown): void;
|
|
120
|
+
private update;
|
|
121
121
|
/** Emitted when the control's value changes. */
|
|
122
122
|
sixChange: EventEmitter<SixSelectChangePayload>;
|
|
123
123
|
/** Emitted when the control gains focus. */
|
|
@@ -136,29 +136,24 @@ export declare class SixSelect {
|
|
|
136
136
|
setCustomValidity(message: string): Promise<void>;
|
|
137
137
|
/** Resets the formcontrol */
|
|
138
138
|
reset(): Promise<void>;
|
|
139
|
-
getItemLabel
|
|
140
|
-
getItems
|
|
141
|
-
hasMenuItems
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
handleSlotChange(): void;
|
|
156
|
-
handleTagInteraction(event: KeyboardEvent | MouseEvent): void;
|
|
157
|
-
resizeMenu(): void;
|
|
158
|
-
syncItemsFromValue(): void;
|
|
139
|
+
private getItemLabel;
|
|
140
|
+
private getItems;
|
|
141
|
+
private hasMenuItems;
|
|
142
|
+
private handleBlur;
|
|
143
|
+
private handleFocus;
|
|
144
|
+
private handleInvalid;
|
|
145
|
+
private handleClearClick;
|
|
146
|
+
private clearValues;
|
|
147
|
+
private handleSelectAll;
|
|
148
|
+
private handleKeyDown;
|
|
149
|
+
private handleLabelClick;
|
|
150
|
+
private handleMenuShow;
|
|
151
|
+
private handleMenuHide;
|
|
152
|
+
private handleSlotChange;
|
|
153
|
+
private handleTagInteraction;
|
|
154
|
+
private resizeMenu;
|
|
159
155
|
private extractLabelForSelectedItem;
|
|
160
|
-
|
|
161
|
-
displayError
|
|
156
|
+
private toggleItem;
|
|
157
|
+
private displayError;
|
|
162
158
|
render(): any;
|
|
163
|
-
private hasSelection;
|
|
164
159
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MenuItem {
|
|
2
|
+
value: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function getValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): string | string[];
|
|
5
|
+
export declare function isValidValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): boolean;
|
|
6
|
+
export declare function valueEquals(a: string | string[], b: string | string[]): boolean;
|
|
7
|
+
export declare function isValueEmpty(value: string | string[]): boolean;
|