Giter Club home page Giter Club logo

datepicker-enhanced's Introduction

DatePickerEnhanced

NPM version

简体中文 | English

A date picker enhanced component for element-plus

Demo

Features

  • New support for halfyear, quarteryear time point and year, halfyear and quarteryear time range selection

API Support for New Date Type

up to now

You can refer to DatePicker | Element Plus

*: extra support

Attributes

  • type: halfyear quarteryear yearrange halfyearrange quarteryearrange
  • modelValue / v-model: string | number | Date | (string | number | Date)[]
  • readonly?: boolean = false
  • disabled?: boolean = false
  • editable?: boolean = true
  • clearable?: boolean = true
  • placeholder?: string = ''
  • startPlaceholder?: string = ''
  • endPlaceholder?: string = ''
  • popperClass?: string = ''
  • rangeSeparator?: string = '-'
  • valueFormat?: string = ''
  • prefixIcon?: Component | null = Calendar
  • clearIcon?: Component | null = CircleClose
  • disabledDate?: (date: Date) => boolean = () => false
  • teleported?: boolean = false
  • size?: 'large' | 'default' | 'small' = 'default'
  • style?: StyleValue = ''
  • *wantEnd?: boolean = false
  • *allowSame?: boolean = true
wantEnd

By default, when a value is modified, the value passed is the starting value of the range,and you can get the end value by props of 'wantEnd'.

allowSame

By default, the start and end values of the range can be the same, and you can set the value to false to not allow the same value.

Events

  • visibleChange: (visible: boolean)

Methods

  • focus
  • handleOpen
  • handleClose

Usage Example

<script setup lang="ts">
import DatePickerEnhanced from 'datepicker-enhanced'
import 'datepicker-enhanced/dist/style.css'

import { ElDatePicker } from 'element-plus'

const extraType = ['halfyear', 'quarteryear', 'yearrange', 'halfyearrange', 'quarteryearrange']
const type = ref('halfyear')
</script>

<template>
  <template v-if="extraType.includes(type)">
    <DatePickerEnhanced v-model="value" :type="type" />
  </template>

  <template v-else>
    <ElDatePicker v-model="value" :type="type" />
  </template>
</template>

Beginning with

Vue-Component-Starter

datepicker-enhanced's People

Contributors

byronogis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

datepicker-enhanced's Issues

TypeError: Cannot read properties of null (reading 'isCE')

Describe the bug

TypeError: Cannot read properties of null (reading 'isCE')

Reproduction

no

System Info

"vue": "^3.2.47"

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

size属性不起作用,希望支持

Clear and concise description of the problem

设置size='' | 'large' | 'default' | 'small',希望能控制输入框大小

Suggested solution

设置size='' | 'large' | 'default' | 'small',希望能控制输入框大小

Alternative

设置size='' | 'large' | 'default' | 'small',希望能控制输入框大小

Additional context

设置size='' | 'large' | 'default' | 'small',希望能控制输入框大小

Validations

希望支持change事件

Clear and concise description of the problem

最基本的几个事件希望支持,至少支持change事件

Suggested solution

事件名 说明 类型
change 用户确认选定的值时触发  
blur 在组件 Input 失去焦点时触发  
focus 在组件 Input 获得焦点时触发  
calendar-change 在日历所选日期更改时触发  
panel-change 当日期面板改变时触发。  
visible-change 当 DatePicker 的下拉列表出现/消失时触发

Alternative

No response

Additional context

No response

Validations

webpack 不支持,只能用vite项目使用

Describe the bug

webpack 不支持,只能用vite项目使用

Reproduction

webpack 不支持,只能用vite项目使用

System Info

webpack 不支持,只能用vite项目使用

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.