@six-group/ui-library 0.0.0-insider.03e5196 → 0.0.0-insider.3f37dd4

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.
Files changed (71) hide show
  1. package/dist/cjs/six-checkbox.cjs.entry.js +57 -46
  2. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  3. package/dist/cjs/six-input.cjs.entry.js +107 -81
  4. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  5. package/dist/cjs/six-radio.cjs.entry.js +56 -51
  6. package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
  7. package/dist/cjs/six-range.cjs.entry.js +114 -75
  8. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  9. package/dist/cjs/six-textarea.cjs.entry.js +97 -74
  10. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  11. package/dist/cjs/slot-ad537f24.js.map +1 -1
  12. package/dist/collection/components/six-checkbox/six-checkbox.js +62 -49
  13. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  14. package/dist/collection/components/six-input/six-input.js +130 -117
  15. package/dist/collection/components/six-input/six-input.js.map +1 -1
  16. package/dist/collection/components/six-radio/six-radio.js +60 -53
  17. package/dist/collection/components/six-radio/six-radio.js.map +1 -1
  18. package/dist/collection/components/six-range/six-range.js +121 -76
  19. package/dist/collection/components/six-range/six-range.js.map +1 -1
  20. package/dist/collection/components/six-textarea/six-textarea.js +115 -105
  21. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  22. package/dist/collection/utils/slot.js.map +1 -1
  23. package/dist/components/six-checkbox.js +57 -46
  24. package/dist/components/six-checkbox.js.map +1 -1
  25. package/dist/components/six-input2.js +107 -81
  26. package/dist/components/six-input2.js.map +1 -1
  27. package/dist/components/six-radio.js +56 -51
  28. package/dist/components/six-radio.js.map +1 -1
  29. package/dist/components/six-range.js +114 -75
  30. package/dist/components/six-range.js.map +1 -1
  31. package/dist/components/six-textarea.js +97 -74
  32. package/dist/components/six-textarea.js.map +1 -1
  33. package/dist/components/slot.js.map +1 -1
  34. package/dist/components.json +45 -35
  35. package/dist/esm/six-checkbox.entry.js +57 -46
  36. package/dist/esm/six-checkbox.entry.js.map +1 -1
  37. package/dist/esm/six-input.entry.js +107 -81
  38. package/dist/esm/six-input.entry.js.map +1 -1
  39. package/dist/esm/six-radio.entry.js +56 -51
  40. package/dist/esm/six-radio.entry.js.map +1 -1
  41. package/dist/esm/six-range.entry.js +114 -75
  42. package/dist/esm/six-range.entry.js.map +1 -1
  43. package/dist/esm/six-textarea.entry.js +97 -74
  44. package/dist/esm/six-textarea.entry.js.map +1 -1
  45. package/dist/esm/slot-6f3984c7.js.map +1 -1
  46. package/dist/types/components/six-checkbox/six-checkbox.d.ts +21 -17
  47. package/dist/types/components/six-input/six-input.d.ts +27 -36
  48. package/dist/types/components/six-radio/six-radio.d.ts +10 -11
  49. package/dist/types/components/six-range/six-range.d.ts +24 -20
  50. package/dist/types/components/six-textarea/six-textarea.d.ts +22 -31
  51. package/dist/types/components.d.ts +19 -27
  52. package/dist/ui-library/{p-14f20bbb.entry.js → p-394a2a12.entry.js} +2 -2
  53. package/dist/ui-library/p-394a2a12.entry.js.map +1 -0
  54. package/dist/ui-library/{p-7e0cc4ae.entry.js → p-3c635d0a.entry.js} +2 -2
  55. package/dist/ui-library/p-3c635d0a.entry.js.map +1 -0
  56. package/dist/ui-library/p-5a25d6fb.entry.js +2 -0
  57. package/dist/ui-library/p-5a25d6fb.entry.js.map +1 -0
  58. package/dist/ui-library/{p-90dc6af4.entry.js → p-97cc839c.entry.js} +2 -2
  59. package/dist/ui-library/p-97cc839c.entry.js.map +1 -0
  60. package/dist/ui-library/p-b4dfb7cf.js.map +1 -1
  61. package/dist/ui-library/p-f604e067.entry.js +2 -0
  62. package/dist/ui-library/p-f604e067.entry.js.map +1 -0
  63. package/dist/ui-library/ui-library.esm.js +1 -1
  64. package/package.json +9 -9
  65. package/dist/ui-library/p-0d79b0c6.entry.js +0 -2
  66. package/dist/ui-library/p-0d79b0c6.entry.js.map +0 -1
  67. package/dist/ui-library/p-14f20bbb.entry.js.map +0 -1
  68. package/dist/ui-library/p-7e0cc4ae.entry.js.map +0 -1
  69. package/dist/ui-library/p-90dc6af4.entry.js.map +0 -1
  70. package/dist/ui-library/p-edc96efc.entry.js +0 -2
  71. package/dist/ui-library/p-edc96efc.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"six-checkbox.js","sourceRoot":"","sources":["../../../src/components/six-checkbox/six-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,WAAW,MAAM,uDAAuD,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;GAcG;AAOH,MAAM,OAAO,WAAW;;IACtB,YAAO,GAAG,YAAY,EAAE,EAAE,EAAE,CAAC;IAC7B,YAAO,GAAG,kBAAkB,EAAE,EAAE,CAAC;IACjC,WAAM,GAAG,iBAAiB,EAAE,EAAE,CAAC;IAC/B,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAEvC,oBAAe,GAAG,EAAE,CAAC;IACrB,qBAAgB,GAAG,KAAK,CAAC;IAEhB,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAiE/C,qFAAqF;IAC7E,iBAAY,GAAG,KAAK,CAAC;oBA9DT,KAAK;wBACD,KAAK;4BACD,KAAK;;;oBASd,KAAK;oBAGL,KAAK;iBAGR,EAAE;qBAGE,EAAE;mBAG4B,KAAK;yBAGC,KAAK;mBAGX,KAAK;uBAGjC,KAAK;;EAa3B,mBAAmB;IACjB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Method, Prop, State, Watch, h, Element } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\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 checkbox label.\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 control - The checkbox control.\n * @part checked-icon - The container the wraps the checked icon.\n * @part indeterminate-icon - The container that wraps the indeterminate icon.\n * @part text - The checkbox text rendered to the right.\n */\n\n@Component({\n tag: 'six-checkbox',\n styleUrl: 'six-checkbox.scss',\n shadow: true,\n})\nexport class SixCheckbox {\n inputId = `checkbox-${++id}`;\n labelId = `checkbox-label-${id}`;\n textId = `checkbox-text-${id}`;\n errorTextId = `input-error-text-${id}`;\n input: HTMLInputElement;\n customErrorText = '';\n customValidation = false;\n\n readonly eventListeners = new EventListeners();\n\n @Element() host: HTMLSixCheckboxElement;\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasErrorTextSlot = false;\n\n /** The checkbox's name attribute. */\n @Prop() name: string;\n\n /** The checkbox's value attribute. */\n @Prop() value: string;\n\n /** Set to true to disable the checkbox. */\n @Prop() disabled = false;\n\n /** Set to true to make the checkbox a required field. */\n @Prop() required = false;\n\n /** The checkbox label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** The checkbox's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText = '';\n\n /** Set to true to draw the checkbox in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** Set to true to draw the checkbox in an indeterminate state. */\n @Prop({ mutable: true, reflect: true }) indeterminate = false;\n\n /** This will be true when the control is in an invalid state. Validity is determined by the `required` prop. */\n @Prop({ mutable: true, reflect: true }) invalid = false;\n\n /** Set to display the error text on blur and not when typing */\n @Prop() errorOnBlur = false;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-checkbox-blur' }) sixBlur: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-checkbox-change' }) sixChange: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-checkbox-focus' }) sixFocus: EventEmitter<EmptyPayload>;\n\n @Watch('checked')\n @Watch('indeterminate')\n handleCheckedChange() {\n if (!this.input) {\n return;\n }\n this.input.checked = this.checked;\n this.input.indeterminate = this.indeterminate;\n this.invalid = !this.input.checkValidity();\n this.sixChange.emit();\n }\n\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n /** default state whether the radio button should be checked or not when resetting */\n private defaultState = false;\n\n connectedCallback() {\n this.handleChange = this.handleChange.bind(this);\n this.handleBlur = this.handleBlur.bind(this);\n this.handleFocus = this.handleFocus.bind(this);\n this.handleMouseDown = this.handleMouseDown.bind(this);\n this.handleInvalid = this.handleInvalid.bind(this);\n\n this.host.shadowRoot.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n this.host.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n componentWillLoad() {\n this.defaultState = this.checked;\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n this.input.indeterminate = this.indeterminate;\n this.eventListeners.add(this.input, 'invalid', (event) => {\n if (this.customValidation || (!this.hasErrorTextSlot && !this.errorText && !this.customErrorText)) {\n this.customErrorText = this.input.validationMessage;\n }\n event.preventDefault();\n });\n }\n\n /** Sets focus on the checkbox. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n @Method()\n async removeFocus() {\n this.input.blur();\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.input.reportValidity();\n }\n\n /** Checks for validity. */\n @Method()\n async checkValidity() {\n return this.input.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.input.setCustomValidity(message);\n this.invalid = !this.input.checkValidity();\n }\n\n /** Resets the formcontrol */\n @Method()\n async reset() {\n this.checked = this.defaultState;\n this.customErrorText = '';\n this.customValidation = false;\n this.input.setCustomValidity('');\n this.invalid = false;\n }\n\n handleChange() {\n this.checked = this.input.checked;\n this.indeterminate = false;\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 handleMouseDown(event: MouseEvent) {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.input.focus();\n }\n\n handleInvalid() {\n this.invalid = true;\n }\n\n handleSlotChange() {\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\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 errorTextId={this.errorTextId}\n errorText={this.customErrorText ? this.customErrorText : this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.displayError()}\n >\n <label\n part=\"base\"\n class={{\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--invalid': this.invalid,\n 'checkbox--indeterminate': this.indeterminate,\n }}\n htmlFor={this.inputId}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"checkbox__control\">\n {this.checked && (\n <span part=\"checked-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(3.428571, 3.428571)\">\n <path d=\"M0,5.71428571 L3.42857143,9.14285714\"></path>\n <path d=\"M9.14285714,0 L3.42857143,9.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n {!this.checked && this.indeterminate && (\n <span part=\"indeterminate-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(2.285714, 6.857143)\">\n <path d=\"M10.2857143,1.14285714 L1.14285714,1.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n <input\n ref={(el) => (this.input = el)}\n id={this.inputId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"checkbox\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onChange={this.handleChange}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onInvalid={this.handleInvalid}\n />\n </span>\n\n <span part=\"text\" id={this.textId} class=\"checkbox__text\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-checkbox.js","sourceRoot":"","sources":["../../../src/components/six-checkbox/six-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,WAAW,MAAM,uDAAuD,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;GAcG;AAOH,MAAM,OAAO,WAAW;;IACd,YAAO,GAAG,YAAY,EAAE,EAAE,EAAE,CAAC;IAC7B,YAAO,GAAG,kBAAkB,EAAE,EAAE,CAAC;IACjC,WAAM,GAAG,iBAAiB,EAAE,EAAE,CAAC;IAC/B,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAEvC,oBAAe,GAAG,EAAE,CAAC;IACrB,qBAAgB,GAAG,KAAK,CAAC;IACzB,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAuE9C,qFAAqF;IAC7E,iBAAY,GAAG,KAAK,CAAC;IAgFrB,iBAAY,GAAG,GAAG,EAAE;MAC1B,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;OAC5B;IACH,CAAC,CAAC;IAEM,eAAU,GAAG,GAAG,EAAE;MACxB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;MACtB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC,CAAC;IAEM,gBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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 { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\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 checkbox label.\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 control - The checkbox control.\n * @part checked-icon - The container the wraps the checked icon.\n * @part indeterminate-icon - The container that wraps the indeterminate icon.\n * @part text - The checkbox text rendered to the right.\n */\n\n@Component({\n tag: 'six-checkbox',\n styleUrl: 'six-checkbox.scss',\n shadow: true,\n})\nexport class SixCheckbox {\n private inputId = `checkbox-${++id}`;\n private labelId = `checkbox-label-${id}`;\n private textId = `checkbox-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private customErrorText = '';\n private customValidation = false;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixCheckboxElement;\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasErrorTextSlot = false;\n\n /** The checkbox's name attribute. */\n @Prop() name = '';\n\n /**\n * The value of the checkbox does not mean if it's checked or not, use the `checked`\n * property for that.\n *\n * The value of a checkbox is analogous to the value of an `<input type=\"checkbox\">`,\n * it's only used when the checkbox participates in a native `<form>`.\n */\n @Prop() value = 'on';\n\n /** Set to true to disable the checkbox. */\n @Prop() disabled = false;\n\n /** Set to true to make the checkbox a required field. */\n @Prop() required = false;\n\n /** The checkbox label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** The checkbox's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText = '';\n\n /** Set to true to draw the checkbox in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** Set to true to draw the checkbox in an indeterminate state. */\n @Prop({ mutable: true, reflect: true }) indeterminate = false;\n\n /** This will be true when the control is in an invalid state. Validity is determined by the `required` prop. */\n @Prop({ mutable: true, reflect: true }) invalid = false;\n\n /** Set to display the error text on blur and not when typing */\n @Prop() errorOnBlur = false;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-checkbox-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-checkbox-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-checkbox-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('checked')\n @Watch('indeterminate')\n handleCheckedChange() {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.checked = this.checked;\n this.nativeInput.indeterminate = this.indeterminate;\n this.invalid = !this.nativeInput.checkValidity();\n this.sixChange.emit();\n }\n\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n /** default state whether the radio button should be checked or not when resetting */\n private defaultState = false;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n componentWillLoad() {\n this.defaultState = this.checked;\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n\n nativeInput.indeterminate = this.indeterminate;\n this.eventListeners.add(nativeInput, 'invalid', (event) => {\n this.invalid = true;\n if (this.customValidation || (!this.hasErrorTextSlot && this.errorText === '' && this.customErrorText === '')) {\n this.customErrorText = nativeInput.validationMessage;\n }\n event.preventDefault();\n });\n }\n\n /** Sets focus on the checkbox. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\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.nativeInput?.reportValidity();\n }\n\n /** Checks for validity. */\n @Method()\n async checkValidity() {\n if (this.nativeInput == null) {\n return true;\n }\n return this.nativeInput.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.nativeInput != null) {\n this.nativeInput.setCustomValidity(message);\n this.invalid = !this.nativeInput.checkValidity();\n }\n }\n\n /** Resets the formcontrol */\n @Method()\n async reset() {\n this.checked = this.defaultState;\n this.customErrorText = '';\n this.customValidation = false;\n this.nativeInput?.setCustomValidity('');\n this.invalid = false;\n }\n\n private handleChange = () => {\n if (this.nativeInput != null) {\n this.checked = this.nativeInput.checked;\n this.indeterminate = false;\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 handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.nativeInput?.focus();\n };\n\n private handleSlotChange() {\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n }\n\n private 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 errorTextId={this.errorTextId}\n errorText={this.customErrorText != null ? this.customErrorText : this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.displayError()}\n >\n <label\n part=\"base\"\n class={{\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--invalid': this.invalid,\n 'checkbox--indeterminate': this.indeterminate,\n }}\n htmlFor={this.inputId}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"checkbox__control\">\n {this.checked && (\n <span part=\"checked-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(3.428571, 3.428571)\">\n <path d=\"M0,5.71428571 L3.42857143,9.14285714\"></path>\n <path d=\"M9.14285714,0 L3.42857143,9.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n {!this.checked && this.indeterminate && (\n <span part=\"indeterminate-icon\" class=\"checkbox__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" stroke-linecap=\"round\">\n <g stroke=\"currentColor\" stroke-width=\"2\">\n <g transform=\"translate(2.285714, 6.857143)\">\n <path d=\"M10.2857143,1.14285714 L1.14285714,1.14285714\"></path>\n </g>\n </g>\n </g>\n </svg>\n </span>\n )}\n\n <input\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"checkbox\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onChange={this.handleChange}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n />\n </span>\n\n <span part=\"text\" id={this.textId} class=\"checkbox__text\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"]}
@@ -44,6 +44,44 @@ export class SixInput {
44
44
  this.eventListeners = new EventListeners();
45
45
  /** defaultValue which the input will be reverted to when executing reset */
46
46
  this.defaultValue = '';
47
+ this.handleChange = () => {
48
+ if (this.nativeInput != null) {
49
+ this.value = this.nativeInput.value;
50
+ this.sixChange.emit();
51
+ }
52
+ };
53
+ this.handleInput = () => {
54
+ if (this.nativeInput != null) {
55
+ this.value = this.nativeInput.value;
56
+ this.sixInput.emit();
57
+ }
58
+ };
59
+ this.handleBlur = () => {
60
+ this.hasFocus = false;
61
+ this.sixBlur.emit();
62
+ };
63
+ this.handleFocus = () => {
64
+ this.hasFocus = true;
65
+ this.sixFocus.emit();
66
+ };
67
+ this.handleClearClick = (event) => {
68
+ this.value = '';
69
+ this.sixClear.emit();
70
+ this.sixInput.emit();
71
+ this.sixChange.emit();
72
+ if (this.nativeInput != null) {
73
+ this.nativeInput.focus();
74
+ }
75
+ event.stopPropagation();
76
+ };
77
+ this.handlePasswordToggle = () => {
78
+ this.isPasswordVisible = !this.isPasswordVisible;
79
+ };
80
+ this.handleSlotChange = () => {
81
+ this.hasHelpTextSlot = hasSlot(this.host, 'help-text');
82
+ this.hasErrorTextSlot = hasSlot(this.host, 'error-text');
83
+ this.hasLabelSlot = hasSlot(this.host, 'label');
84
+ };
47
85
  this.hasFocus = false;
48
86
  this.hasHelpTextSlot = false;
49
87
  this.hasErrorTextSlot = false;
@@ -66,12 +104,12 @@ export class SixInput {
66
104
  this.max = undefined;
67
105
  this.step = undefined;
68
106
  this.pattern = undefined;
69
- this.required = undefined;
70
- this.autocapitalize = undefined;
71
- this.autocorrect = undefined;
72
- this.autocomplete = undefined;
73
- this.autofocus = undefined;
74
- this.spellcheck = undefined;
107
+ this.required = false;
108
+ this.autocapitalize = 'off';
109
+ this.autocorrect = 'off';
110
+ this.autocomplete = 'off';
111
+ this.autofocus = false;
112
+ this.spellcheck = false;
75
113
  this.invalid = false;
76
114
  this.clearable = false;
77
115
  this.togglePassword = false;
@@ -83,141 +121,130 @@ export class SixInput {
83
121
  this.handleSlotChange();
84
122
  }
85
123
  handleValueChange() {
86
- if (!this.input) {
87
- return;
124
+ this.value = this.getValue();
125
+ if (this.nativeInput != null) {
126
+ if (this.nativeInput.value !== this.value) {
127
+ this.nativeInput.value = this.value;
128
+ }
129
+ this.invalid = !this.nativeInput.checkValidity();
88
130
  }
89
- this.input.value = this.value;
90
- this.invalid = !this.input.checkValidity();
91
- this.sixValueChange.emit();
92
131
  }
93
132
  connectedCallback() {
94
- this.handleChange = this.handleChange.bind(this);
95
- this.handleInput = this.handleInput.bind(this);
96
- this.handleInvalid = this.handleInvalid.bind(this);
97
- this.handleBlur = this.handleBlur.bind(this);
98
- this.handleFocus = this.handleFocus.bind(this);
99
- this.handleClearClick = this.handleClearClick.bind(this);
100
- this.handlePasswordToggle = this.handlePasswordToggle.bind(this);
101
- this.handleSlotChange = this.handleSlotChange.bind(this);
102
- this.host.shadowRoot.addEventListener('slotchange', this.handleSlotChange);
133
+ var _a;
134
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.addEventListener('slotchange', this.handleSlotChange);
103
135
  }
104
136
  componentWillLoad() {
105
- this.defaultValue = this.value;
137
+ this.defaultValue = this.getValue();
106
138
  this.handleSlotChange();
107
139
  }
108
140
  componentDidLoad() {
109
- this.eventListeners.add(this.input, 'invalid', (event) => {
110
- if (this.customValidation || (!this.hasErrorTextSlot && !this.errorText && !this.customErrorText)) {
111
- this.customErrorText = this.input.validationMessage;
141
+ const nativeInput = this.nativeInput;
142
+ if (nativeInput == null) {
143
+ return;
144
+ }
145
+ this.eventListeners.add(nativeInput, 'invalid', (event) => {
146
+ this.invalid = true;
147
+ if (this.customValidation || (!this.hasErrorTextSlot && this.errorText === '' && this.customErrorText === '')) {
148
+ this.customErrorText = nativeInput.validationMessage;
112
149
  }
113
150
  event.preventDefault();
114
151
  });
115
152
  }
116
153
  disconnectedCallback() {
117
- this.host.shadowRoot.removeEventListener('slotchange', this.handleSlotChange);
154
+ var _a;
155
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeEventListener('slotchange', this.handleSlotChange);
118
156
  this.eventListeners.removeAll();
119
157
  }
120
158
  /** Sets focus on the input. */
121
159
  async setFocus(options) {
122
- this.input.focus(options);
160
+ var _a;
161
+ (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.focus(options);
123
162
  }
124
163
  /** Removes focus from the input. */
125
164
  async removeFocus() {
126
- this.input.blur();
165
+ var _a;
166
+ (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.blur();
127
167
  }
128
168
  /** Selects all the text in the input. */
129
169
  async select() {
130
- return this.input.select();
170
+ var _a;
171
+ return (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.select();
131
172
  }
132
173
  /** Sets the start and end positions of the text selection (0-based). */
133
174
  async setSelectionRange(selectionStart, selectionEnd, selectionDirection = 'none') {
134
- return this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
175
+ var _a;
176
+ return (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
135
177
  }
136
178
  /** Replaces a range of text with a new string. */
137
179
  async setRangeText(replacement, start, end, selectMode = 'preserve') {
138
- this.input.setRangeText(replacement, start, end, selectMode);
139
- if (this.value !== this.input.value) {
140
- this.value = this.input.value;
180
+ if (this.nativeInput == null) {
181
+ return;
182
+ }
183
+ this.nativeInput.setRangeText(replacement, start, end, selectMode);
184
+ if (this.getValue() !== this.nativeInput.value) {
185
+ this.value = this.nativeInput.value;
141
186
  this.sixChange.emit();
142
187
  this.sixInput.emit();
143
188
  }
144
189
  }
145
190
  /** Checks for validity and shows the browser's validation message if the control is invalid. */
146
191
  async reportValidity() {
147
- return this.input.reportValidity();
192
+ var _a;
193
+ return (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.reportValidity();
148
194
  }
149
195
  /** Checks for validity. */
150
196
  async checkValidity() {
151
- return this.input.validity.valid;
197
+ if (this.nativeInput == null) {
198
+ return true;
199
+ }
200
+ return this.nativeInput.validity.valid;
152
201
  }
153
202
  /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */
154
203
  async setCustomValidity(message) {
155
204
  this.customErrorText = '';
156
205
  this.customValidation = message !== '';
157
- this.input.setCustomValidity(message);
158
- this.invalid = !this.input.checkValidity();
206
+ if (this.nativeInput != null) {
207
+ this.nativeInput.setCustomValidity(message);
208
+ this.invalid = !this.nativeInput.checkValidity();
209
+ }
159
210
  }
160
211
  /** Returns the native input's validity */
161
212
  async getValidity() {
162
- return this.input.validity;
213
+ var _a;
214
+ return (_a = this === null || this === void 0 ? void 0 : this.nativeInput) === null || _a === void 0 ? void 0 : _a.validity;
163
215
  }
164
216
  /** Returns the native input's validity */
165
217
  async isValid() {
166
- return this.input.validity.valid;
218
+ if (this.nativeInput == null) {
219
+ return true;
220
+ }
221
+ return this.nativeInput.validity.valid;
167
222
  }
168
223
  /** Returns the native input's validationMessage */
169
224
  async getValidationMessage() {
170
- return this.input.validationMessage;
225
+ if (this.nativeInput == null) {
226
+ return '';
227
+ }
228
+ return this.nativeInput.validationMessage;
171
229
  }
172
230
  /** Resets the formcontrol */
173
231
  async reset() {
232
+ var _a;
174
233
  this.value = this.defaultValue;
175
234
  this.customErrorText = '';
176
235
  this.customValidation = false;
177
- this.input.setCustomValidity('');
236
+ (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.setCustomValidity('');
178
237
  this.invalid = false;
179
238
  }
180
- handleChange() {
181
- this.value = this.input.value;
182
- this.sixChange.emit();
183
- }
184
- handleInput() {
185
- this.value = this.input.value;
186
- this.sixInput.emit();
187
- }
188
- handleInvalid() {
189
- this.invalid = true;
190
- }
191
- handleBlur() {
192
- this.hasFocus = false;
193
- this.sixBlur.emit();
194
- }
195
- handleFocus() {
196
- this.hasFocus = true;
197
- this.sixFocus.emit();
198
- }
199
- handleClearClick(event) {
200
- this.value = '';
201
- this.sixClear.emit();
202
- this.sixInput.emit();
203
- this.sixChange.emit();
204
- this.input.focus();
205
- event.stopPropagation();
206
- }
207
- handlePasswordToggle() {
208
- this.isPasswordVisible = !this.isPasswordVisible;
209
- }
210
- handleSlotChange() {
211
- this.hasHelpTextSlot = hasSlot(this.host, 'help-text');
212
- this.hasErrorTextSlot = hasSlot(this.host, 'error-text');
213
- this.hasLabelSlot = hasSlot(this.host, 'label');
214
- }
215
239
  displayError() {
216
240
  return this.invalid && (!this.errorOnBlur || !this.hasFocus);
217
241
  }
218
- render() {
242
+ getValue() {
219
243
  var _a;
220
- return (h(FormControl, { inputId: this.inputId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, helpTextId: this.helpTextId, helpText: this.helpText, hasHelpTextSlot: this.hasHelpTextSlot, errorTextId: this.errorTextId, errorText: this.customErrorText ? this.customErrorText : this.errorText, hasErrorTextSlot: this.hasErrorTextSlot, size: this.size, disabled: this.disabled, required: this.required, displayError: this.displayError() }, h("div", { part: "base", class: {
244
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : '').toString();
245
+ }
246
+ render() {
247
+ return (h(FormControl, { inputId: this.inputId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, helpTextId: this.helpTextId, helpText: this.helpText, hasHelpTextSlot: this.hasHelpTextSlot, errorTextId: this.errorTextId, errorText: this.customErrorText != null ? this.customErrorText : this.errorText, hasErrorTextSlot: this.hasErrorTextSlot, size: this.size, disabled: this.disabled, required: this.required, displayError: this.displayError() }, h("div", { part: "base", class: {
221
248
  input: true,
222
249
  // Sizes
223
250
  'input--small': this.size === 'small',
@@ -228,12 +255,12 @@ export class SixInput {
228
255
  'input--pill': this.pill,
229
256
  'input--disabled': this.disabled,
230
257
  'input--focused': this.hasFocus,
231
- 'input--empty': ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) === 0,
258
+ 'input--empty': this.getValue().length === 0,
232
259
  'input--invalid': this.invalid,
233
- } }, h("span", { part: "prefix", class: "input__prefix" }, h("slot", { name: "prefix" })), h("input", { part: "input", ref: (el) => (this.input = el), id: this.inputId, size: 1, class: {
260
+ } }, h("span", { part: "prefix", class: "input__prefix" }, h("slot", { name: "prefix" })), h("input", { part: "input", ref: (el) => (this.nativeInput = el), id: this.inputId, size: 1, class: {
234
261
  input__control: true,
235
262
  input__control__prefix: hasSlot(this.host, 'prefix'),
236
- }, type: this.type === 'password' && this.isPasswordVisible ? 'text' : this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, minLength: this.minlength, maxLength: this.maxlength, min: this.min, max: this.max, step: this.step, value: this.value, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, spellcheck: this.spellcheck, pattern: this.pattern, required: this.required, inputMode: this.inputmode, "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-invalid": this.invalid ? 'true' : 'false', onChange: this.handleChange, onInput: this.handleInput, onInvalid: this.handleInvalid, onFocus: this.handleFocus, onBlur: this.handleBlur, "data-testid": "input-control" }), this.clearable && (h("button", { part: "clear-button", class: "input__clear", type: "button", onClick: this.handleClearClick, tabindex: "-1", "data-testid": "input-clear-button" }, h("slot", { name: "clear-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "clear")))), this.togglePassword && (h("button", { part: "password-toggle-button", class: "input__password-toggle", type: "button", onClick: this.handlePasswordToggle, tabindex: "-1" }, this.isPasswordVisible ? (h("slot", { name: "show-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility_off"))) : (h("slot", { name: "hide-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility"))))), h("span", { part: "suffix", class: "input__suffix" }, h("slot", { name: "suffix" })))));
263
+ }, type: this.type === 'password' && this.isPasswordVisible ? 'text' : this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, minLength: this.minlength, maxLength: this.maxlength, min: this.min, max: this.max, step: this.step, value: this.getValue(), autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, spellcheck: this.spellcheck, pattern: this.pattern, required: this.required, inputMode: this.inputmode, "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-invalid": this.invalid ? 'true' : 'false', onChange: this.handleChange, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, "data-testid": "input-control" }), this.clearable && (h("button", { part: "clear-button", class: "input__clear", type: "button", onClick: this.handleClearClick, tabindex: "-1", "data-testid": "input-clear-button" }, h("slot", { name: "clear-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "clear")))), this.togglePassword && (h("button", { part: "password-toggle-button", class: "input__password-toggle", type: "button", onClick: this.handlePasswordToggle, tabindex: "-1" }, this.isPasswordVisible ? (h("slot", { name: "show-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility_off"))) : (h("slot", { name: "hide-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility"))))), h("span", { part: "suffix", class: "input__suffix" }, h("slot", { name: "suffix" })))));
237
264
  }
238
265
  static get is() { return "six-input"; }
239
266
  static get encapsulation() { return "shadow"; }
@@ -402,7 +429,7 @@ export class SixInput {
402
429
  "references": {}
403
430
  },
404
431
  "required": false,
405
- "optional": false,
432
+ "optional": true,
406
433
  "docs": {
407
434
  "tags": [],
408
435
  "text": "The input's placeholder text."
@@ -455,7 +482,7 @@ export class SixInput {
455
482
  "references": {}
456
483
  },
457
484
  "required": false,
458
- "optional": false,
485
+ "optional": true,
459
486
  "docs": {
460
487
  "tags": [],
461
488
  "text": "The minimum length of input that will be considered valid."
@@ -472,7 +499,7 @@ export class SixInput {
472
499
  "references": {}
473
500
  },
474
501
  "required": false,
475
- "optional": false,
502
+ "optional": true,
476
503
  "docs": {
477
504
  "tags": [],
478
505
  "text": "The maximum length of input that will be considered valid."
@@ -489,7 +516,7 @@ export class SixInput {
489
516
  "references": {}
490
517
  },
491
518
  "required": false,
492
- "optional": false,
519
+ "optional": true,
493
520
  "docs": {
494
521
  "tags": [],
495
522
  "text": "The input's minimum value."
@@ -506,7 +533,7 @@ export class SixInput {
506
533
  "references": {}
507
534
  },
508
535
  "required": false,
509
- "optional": false,
536
+ "optional": true,
510
537
  "docs": {
511
538
  "tags": [],
512
539
  "text": "The input's maximum value."
@@ -523,7 +550,7 @@ export class SixInput {
523
550
  "references": {}
524
551
  },
525
552
  "required": false,
526
- "optional": false,
553
+ "optional": true,
527
554
  "docs": {
528
555
  "tags": [],
529
556
  "text": "The input's step attribute."
@@ -540,7 +567,7 @@ export class SixInput {
540
567
  "references": {}
541
568
  },
542
569
  "required": false,
543
- "optional": false,
570
+ "optional": true,
544
571
  "docs": {
545
572
  "tags": [],
546
573
  "text": "A pattern to validate input against."
@@ -563,7 +590,8 @@ export class SixInput {
563
590
  "text": "Set to true to make the input a required field."
564
591
  },
565
592
  "attribute": "required",
566
- "reflect": true
593
+ "reflect": true,
594
+ "defaultValue": "false"
567
595
  },
568
596
  "autocapitalize": {
569
597
  "type": "string",
@@ -580,14 +608,15 @@ export class SixInput {
580
608
  "text": "The input's autocaptialize attribute."
581
609
  },
582
610
  "attribute": "autocapitalize",
583
- "reflect": false
611
+ "reflect": false,
612
+ "defaultValue": "'off'"
584
613
  },
585
614
  "autocorrect": {
586
615
  "type": "string",
587
616
  "mutable": false,
588
617
  "complexType": {
589
- "original": "string",
590
- "resolved": "string",
618
+ "original": "'on' | 'off'",
619
+ "resolved": "\"off\" | \"on\"",
591
620
  "references": {}
592
621
  },
593
622
  "required": false,
@@ -597,7 +626,8 @@ export class SixInput {
597
626
  "text": "The input's autocorrect attribute."
598
627
  },
599
628
  "attribute": "autocorrect",
600
- "reflect": false
629
+ "reflect": false,
630
+ "defaultValue": "'off'"
601
631
  },
602
632
  "autocomplete": {
603
633
  "type": "string",
@@ -614,7 +644,8 @@ export class SixInput {
614
644
  "text": "The input's autocomplete attribute."
615
645
  },
616
646
  "attribute": "autocomplete",
617
- "reflect": false
647
+ "reflect": false,
648
+ "defaultValue": "'off'"
618
649
  },
619
650
  "autofocus": {
620
651
  "type": "boolean",
@@ -631,7 +662,8 @@ export class SixInput {
631
662
  "text": "The input's autofocus attribute."
632
663
  },
633
664
  "attribute": "autofocus",
634
- "reflect": false
665
+ "reflect": false,
666
+ "defaultValue": "false"
635
667
  },
636
668
  "spellcheck": {
637
669
  "type": "boolean",
@@ -648,7 +680,8 @@ export class SixInput {
648
680
  "text": "Enables spell checking on the input."
649
681
  },
650
682
  "attribute": "spellcheck",
651
- "reflect": false
683
+ "reflect": false,
684
+ "defaultValue": "false"
652
685
  },
653
686
  "invalid": {
654
687
  "type": "boolean",
@@ -713,7 +746,7 @@ export class SixInput {
713
746
  "references": {}
714
747
  },
715
748
  "required": false,
716
- "optional": false,
749
+ "optional": true,
717
750
  "docs": {
718
751
  "tags": [],
719
752
  "text": "The input's inputmode attribute."
@@ -869,26 +902,6 @@ export class SixInput {
869
902
  }
870
903
  }
871
904
  }
872
- }, {
873
- "method": "sixValueChange",
874
- "name": "six-input-value-change",
875
- "bubbles": true,
876
- "cancelable": true,
877
- "composed": true,
878
- "docs": {
879
- "tags": [],
880
- "text": "Emitted whenever the value changes. Access the new value via event.target.value.\nsix-input-value-change will emit whenever the value changes.\nSo be it on input or when dynamically set. six-input-input will only be emitted when the user enters data,\nbut not when a value is dynamically set. six-input-change will only be emitted when the user either presses enter\nor leaves the input field after entering some data."
881
- },
882
- "complexType": {
883
- "original": "EmptyPayload",
884
- "resolved": "undefined",
885
- "references": {
886
- "EmptyPayload": {
887
- "location": "import",
888
- "path": "../../utils/types"
889
- }
890
- }
891
- }
892
905
  }];
893
906
  }
894
907
  static get methods() {
@@ -1053,7 +1066,7 @@ export class SixInput {
1053
1066
  },
1054
1067
  "getValidity": {
1055
1068
  "complexType": {
1056
- "signature": "() => Promise<ValidityState>",
1069
+ "signature": "() => Promise<ValidityState | undefined>",
1057
1070
  "parameters": [],
1058
1071
  "references": {
1059
1072
  "Promise": {