UNPKG

@lion/ui

Version:

A package of extendable web components

86 lines (82 loc) 190 kB
--- parts: - API Table - Input Datepicker title: 'Input Datepicker: API Table' eleventyNavigation: key: API Table >> Input Datepicker title: API Table order: 90 parent: Input Datepicker --- # Input Datepicker: API Table ## class: `LionInputDatepicker`, `lion-input-datepicker` ### Fields | Name | Privacy | Type | Default | Description | Inherited From | | --------------------------------- | --------- | ----------------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | | `allowCrossRootRegistration` | public | `boolean` | `false` | To encourage accessibility best practices, \`form-element-register\` events&#xA;do not pierce through shadow roots. This forces the developer to create form groups and fieldsets that automatically allow the creation of accessible relationships in the same dom tree.&#xA;Use this option if you know what you're doing. It will then be possible to nest FormControls&#xA;inside shadow dom. See https\://lion.js.org/fundamentals/rationales/accessibility/#shadow-roots-and-accessibility | LionField | | `autocomplete` | public | `string \| undefined` | `undefined` | Delegates this property to input/textarea/select. | NativeTextFieldMixin | | `autofocus` | public | `boolean` | `false` | | LionField | | `calendarHeading` | public | `string` | | The heading to be added on top of the calendar overlay.&#xA;Naming chosen from an Application Developer perspective.&#xA;For a Subclasser 'calendarOverlayHeading' would be more appropriate. | | | `config` | public | `Partial<OverlayConfig>` | `{}` | Configure the many options of the \`OverlayController\` | OverlayMixin | | `defaultValidators` | public | `Validator[]` | `[]` | Used by Subclassers to add default Validators to a particular FormControl.&#xA;A date input for instance, always needs the isDate validator. | LionField | | `dirty` | public | `boolean` | `false` | True when user has changed the value of the field. | LionField | | `disabled` | public | `boolean` | `false` | | LionField | | `fieldName` | public | `string` | | Will be used in validation messages to refer to the current field | LionField | | `filled` | public | `boolean` | `false` | True when the modelValue is non-empty (see \_isEmpty in FormControlMixin) | LionField | | `focused` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) is focused.&#xA;Reflects to attribute '\[focused]' as a styling hook | LionField | | `focusedVisible` | public | `boolean` | `false` | Whether the focusable element within (\`.\_focusableNode\`) matches ':focus-visible'&#xA;Reflects to attribute '\[focused-visible]' as a styling hook&#xA;See: https\://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible | LionField | | `formatOn` | protected | `string` | `'change'` | Event that will trigger formatting (more precise, visual update of the view, so the&#xA;user sees the formatted value)&#xA;Default: 'change' | LionField | | `formatOptions` | public | | `({ mode: 'auto' })` | Configuration object that will be available inside the formatter function | LionField | | `formattedValue` | public | `string\|undefined` | `undefined` | The view value is the result of the formatter function (when available).&#xA;The result will be stored in the native \_inputNode (usually an input\[type=text]).&#xA;&#xA;Examples:&#xA;- For a date input, this would be '20/01/1999' (dependent on locale).&#xA;- For a number input, this could be '1,234.56' (a String representation of modelValue&#xA;1234.56) | LionField | | `formatter` | public | | `formatDate` | Converts modelValue to formattedValue (formattedValue will be synced with&#xA;\`.\_inputNode.value\`)&#xA;For instance, a Date object to a localized date. | LionField | | `hasArrow` | public | `boolean` | `true` | | ArrowMixin | | `hasFeedbackFor` | public | `ValidationType[]` | `[]` | As soon as validation happens (after modelValue/validators/validator param change), this&#xA;array is updated with the active ValidationTypes ('error'\|'warning'\|'success'\|'info' etc.).&#xA;Notice the difference with \`.showsFeedbackFor\`, which filters \`.hasFeedbackFor\` based on&#xA;\`.feedbackCondition()\`.&#xA;&#xA;For styling purposes, will be reflected to \[has-feedback-for="error warning"]. This can&#xA;be useful for subtle visual feedback on keyup, like a red/green border around an input. | LionField | | `helpText` | public | `string` | | The helpt text for the input node.&#xA;When no light dom defined via \[slot=help-text], this value will be used | LionField | | `isPending` | public | `boolean` | `false` | Flag indicating whether async validation is pending.&#xA;Creates attribute \[is-pending] as a styling hook | LionField | | `label` | public | `string` | | The label text for the input node.&#xA;When no light dom defined via \[slot=label], this value will be used. | LionField | | `labelSrOnly` | public | `boolean` | `false` | The label will only be visible for srceen readers when true | LionField | | `modelValue` | public | | | | LionField | | `name` | public | `string` | `''` | The name the element will be registered with to the .formElements collection&#xA;of the parent. Also, it serves as the key of key/value pairs in&#xA; modelValue/serializedValue objects | LionField | | `opened` | public | `boolean` | `false` | If you add the opened attribute a dialog will be opened on page load. The invoker can be left out&#xA;in case the user does not need to be able to reopen the dialog. | OverlayMixin | | `operationMode` | public | `OperationMode` | | Types of input interaction of the FormControl (for instance 'enter'\|'select'\|'upload') | LionField | | `parser` | public | | | Converts viewValue to modelValue&#xA;For instance, a localized date to a Date Object | LionField | | `placeholder` | public | `string` | `''` | | LionInput | | `prefilled` | public | `boolean` | `false` | True when user has left non-empty field or input is prefilled.&#xA;The name must be seen from the point of view of the input field:&#xA;once the user enters the input field, the value is non-empty. | LionField | | `readOnly` | public | `boolean` | `false` | A Boolean attribute which, if present, indicates that the user should not be able to edit&#xA;the value of the input. The difference between disabled and readonly is that read-only&#xA;controls can still function, whereas disabled controls generally do not function as&#xA;controls until they are enabled.&#xA;(From: https\://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) | LionField | | `selectionEnd` | public | `number` | | | NativeTextFieldMixin | | `selectionStart` | public | `number` | | | NativeTextFieldMixin | | `serializedValue` | public | `string\|undefined` | `undefined` | The serialized version of the model value.&#xA;This value exists for maximal compatibility with the platform API.&#xA;The serialized value can be an interface in context where data binding is not&#xA;supported and a serialized string needs to be set.&#xA;&#xA;Examples:&#xA;- For a date input, this would be the iso format of a date, e.g. '1999-01-20'.&#xA;- For a number input this would be the String representation of a float ('1234.56'&#xA; instead of 1234.56)&#xA;&#xA;When no parser is available, the value is usually the same as the formattedValue&#xA;(being \_inputNode.value) | LionField | | `showsFeedbackFor` | public | `ValidationType[]` | `[]` | Based on outcome of feedbackCondition, this array decides what ValidationTypes should be&#xA;shown in validationFeedback, based on meta data like interaction states.&#xA;&#xA;For styling purposes, it reflects it \`\[shows-feedback-for="error warning"]\` | LionField | | `slots` | public | | | Adds ".\_feedbackNode" as described below | LionField | | `submitted` | public | | | | LionField | | `touched` | public | `boolean` | `false` | True when user has focused and left(blurred) the field. | LionField | | `type` | public | `string` | `'text'` | | LionInput | | `validationStates` | public | `ValidationStates` | `{}` | The outcome of a validation 'round'. Keyed by ValidationType and Validator name | LionField | | `validators` | public | `Validator[]` | `[]` | Used by Application Developers to add Validators to a FormControl. | LionField | | `value` | public | | | The view value. Will be delegated to \`.\_inputNode.value\`&#xA;&#xA;Note: Overrides the implementation from FormatMixin | LionField | | `_allValidators` | protected | `(Validator \| MetaValidator)[]` | | Combination of validators provided by Application Developer and the default validators | LionField | | `_ariaDescribedNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-describedby of \`.\_inputNode\` | LionField | | `_ariaLabelledNodes` | public | `HTMLElement[]` | `[]` | Contains all elements that should end up in aria-labelledby of \`.\_inputNode\` | LionField | | `_arrowNode` | protected | | | | ArrowMixin | | `_calendarInvokerSlot` | protected | `string` | `'suffix'` | The slot to put the invoker button in. Can be 'prefix', 'suffix', 'before' and 'after'.&#xA;Default will be 'suffix'. | | | `_calendarNode` | protected | `LionCalendar` | | | | | `_feedbackConditionMeta` | protected | | | Allows Subclassers to add meta info for feedbackCondition | LionField | | `_feedbackNode` | protected | | | Element where validation feedback will be rendered to | LionField | | `_focusableNode` | protected | `HTMLElement` | | The focusable element:&#xA;could be an input, textarea, select, button or any other element with tabindex > -1 | LionField | | `_focusCentralDateOnCalendarOpen` | protected | `boolean` | `true` | | | | `_helpTextNode` | protected | | | Element where help text will be rendered to | LionField | | `_hideOnUserSelect` | protected | `boolean` | `true` | | | | `_inputId` | protected | `string` | | Unique id that can be used in all light dom | LionField | | `_inputNode` | protected | `HTMLInputElement \| HTMLTextAreaElement` | | The interactive (form) element. Can be a native element like input/textarea/select or&#xA;an element with tabindex > -1 | LionField | | `_invokerNode` | protected | | | | | | `_isHandlingCalendarUserInput` | protected | `boolean` | `false` | | | | `_isHandlingUserInput` | protected | `boolean` | `false` | Flag that will be set when user interaction takes place (for instance after an 'input'&#xA;event). Will be added as meta info to the \`model-value-changed\` event. Depending on&#xA;whether a user is interacting, formatting logic will be handled differently. | LionField | | `_isPasting` | protected | `boolean` | `false` | Whether the user is pasting content. Allows Subclassers to do this in their subclass: | LionField | | `_isRepropagationEndpoint` | public | `boolean` | `false` | By default, a field with \_repropagationRole 'choice-group' will act as an&#xA;'endpoint'. This means it will be considered as an individual field: for&#xA;a select, individual options will not be part of the formPath. They&#xA;will.&#xA;Similarly, components that (a11y wise) need to be fieldsets, but 'interaction wise'&#xA;(from Application Developer perspective) need to be more like fields&#xA;(think of an amount-input with a currency select box next to it), can set this&#xA;to true to hide private internals in the formPath. | LionField | | `_labelNode` | protected | | | Element where label will be rendered to | LionField | | `_leaveEvent` | protected | `string` | `'blur'` | The event that triggers the touched state | LionField | | `_overlayBackdropNode` | protected | | | | OverlayMixin | | `_overlayContentNode` | protected | | | | OverlayMixin | | `_overlayContentWrapperNode` | protected | | | | OverlayMixin | | `_overlayInvokerNode` | protected | | | | OverlayMix