YearPickerTextField

If you want a year, you'll have a year.

Example

Anno selezionato:

Props

    đŸ•šī¸ standard props
    menuOpened
    boolean
    Indicates if the menu is opened.
    false
    openingId
    string
    The identifier of the element opening the menu.
    'year-picker-text-field'
    selectedYear
    number
    The currently selected year.
    undefined
    placeholder
    string
    The placeholder text for the input field.
    undefined
    mobileDialog
    boolean
    Determines if a dialog should be shown on mobile.
    true
    maxYearInRange
    number
    The maximum year available in the range.
    2100
    minYearInRange
    number
    The minimum year available in the range.
    1900
    disabled
    boolean
    Disables the component.
    false
    class
    object
    Class bindings for the component.
    {}
    🎨 style props
    No data available

Slots

    activatorSnippet
    Default slot for the activator snippet.
    Default content:
    
    <SimpleTextField
      bind:value={mask.value}
      onfocus={() => handleTextFieldFocus(mAndDown)}
      onkeydown={handleInputChange}
      bind:input={inputElement}
      {placeholder}
      class={clazz.textfield}
      {disabled}
      {appendSnippet}
      {appendInnerSnippet}
      {prependSnippet}
    >
      {#snippet prependInnerSnippet({ iconSize, prependInnerIcon })}
        {#if prependInnerInternalSnippet}
          {@render prependInnerInternalSnippet({ prependInnerIcon, iconSize })}
        {:else}
          <Icon
            name="mdi-calendar"
            onclick={() => menuOpened = !menuOpened}
          ></Icon>
        {/if}
      {/snippet}
    </SimpleTextField>
          
    Available variables:
    NameTypeDescription
    maskInputMaskThe input mask instance.
    handleTextFieldFocusfunctionFunction to handle text field focus.
    handleInputChangefunctionFunction to handle input changes.
    inputElementHTMLElementThe input element.
    placeholderstringThe placeholder text.
    disabledbooleanIndicates if the input is disabled.
    prependSnippet
    Slot for prepending an icon outside the field.
    Default content:
    
    {#if !!prependIcon}
      <Icon name={prependIcon} --icon-size={iconSize}></Icon>
    {/if}
        
    Available variables:
    NameTypeDescription
    prependIconstring | undefinedIcon to display.
    iconSizestringSize of the icon.
    prependInnerSnippet
    Slot for prepending an icon inside the field.
    Default content:
    
    <Icon
      name="mdi-calendar"
      onclick={() => menuOpened = !menuOpened}
    ></Icon>
        
    Available variables:
    NameTypeDescription
    prependInnerIconstring | undefinedIcon to display.
    iconSizestringSize of the icon.
    appendSnippet
    Slot for appending an icon outside the field.
    Default content:
    
    {#if !!appendIcon}
      <Icon name={appendIcon} --icon-size={iconSize}></Icon>
    {/if}
        
    Available variables:
    NameTypeDescription
    appendIconstring | undefinedIcon to display.
    iconSizestringSize of the icon.
    appendInnerSnippet
    Slot for appending an icon inside the field.
    Default content:
    
    {#if !!appendInnerIcon}
      <Icon name={appendInnerIcon} --icon-size={iconSize}></Icon>
    {/if}
        
    Available variables:
    NameTypeDescription
    appendInnerIconstring | undefinedIcon to display.
    iconSizestringSize of the icon.

Events

    oninput
    Fired when the input value changes.
    AttributeTypeDescription
    yearnumber | undefinedThe selected year or undefined if no year is selected.
    onyearClick
    Fired when a year is clicked.
    AttributeTypeDescription
    yearnumberThe clicked year.