Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
1c1ef86
feat: 初始化pickerview
irisSong Jan 16, 2025
3acf368
feat: add pickerView
irisSong Jan 22, 2025
2e3a00a
feat: add tiled demo
irisSong Jan 22, 2025
c651e62
refactor: 重构h5
irisSong Jan 24, 2025
e60df8e
fix: 适配demo
irisSong Jan 24, 2025
43fc55a
feat: 增加级联功能
irisSong Jan 26, 2025
4ce2688
fix: 级联优化
irisSong Feb 10, 2025
28c4e2c
feat: pickerview增加级联效果
irisSong Feb 11, 2025
bc3fb35
fix: 更新taro版本
irisSong Feb 11, 2025
b0b635c
fix: 移除冗余代码+解决form中滚动未结束死循环问题
irisSong Feb 11, 2025
85d5d40
fix: 移除console
irisSong Feb 12, 2025
7a27934
fix: 更新pickerview
irisSong Feb 12, 2025
a030ff4
fix: update test
irisSong Feb 12, 2025
f436c51
fix: update error
irisSong Feb 12, 2025
6a6bc39
fix: update error
irisSong Feb 12, 2025
10be5cd
fix: update demo
irisSong Feb 12, 2025
80f20a1
Merge remote-tracking branch 'upstream/feat_v3.x' into feat_v3.x_pick…
irisSong Feb 12, 2025
8ad7392
fix: update test
irisSong Feb 12, 2025
95b5423
feat: 添加异步demo
irisSong Feb 12, 2025
fe66362
fix: update doc
irisSong Feb 12, 2025
aa5f2ea
fix: 同步pickerview变更
irisSong Feb 12, 2025
b5987b9
fix: 解决小程序控制条样式问题+demo7取消不还原问题
irisSong Feb 12, 2025
0ae1a26
fix: datepicker类型同步更新
irisSong Feb 12, 2025
ce3b37b
fix: 合并主分支
irisSong Feb 12, 2025
26f9319
fix: update test
irisSong Feb 12, 2025
d5118f6
fix: 修改标签
irisSong Feb 13, 2025
a787f7d
feat: add test
irisSong Feb 13, 2025
c10fcc7
fix: update doc and test
irisSong Feb 13, 2025
9e32bcd
fix: adjust the dependency package location
irisSong Feb 13, 2025
ae272de
Merge remote-tracking branch 'upstream/feat_v3.x' into feat_v3.x_pick…
irisSong Feb 13, 2025
f539b83
fix: adjust the dependency package path
irisSong Feb 13, 2025
f06ec00
fix: adjust the dependency package path
irisSong Feb 13, 2025
b67dfca
fix: adjust the dependency package path
irisSong Feb 13, 2025
9905564
fix: update doc props type
irisSong Feb 13, 2025
0c448c8
fix: adjust note
irisSong Feb 13, 2025
cc30cb0
chore: merge v3.x
irisSong Feb 13, 2025
b699d60
Merge branch 'feat_v3.x_picker' of https://github.com/irisSong/nutui-…
irisSong Feb 13, 2025
7760169
fix: adjust the dependency package path
irisSong Feb 13, 2025
86855f0
fix: 合并最新的pickerview
irisSong Feb 13, 2025
88d4f80
fix: optimize details
irisSong Feb 13, 2025
654d1e0
fix: update test
irisSong Feb 13, 2025
507f18c
fix: merge pickerview
irisSong Feb 13, 2025
d9628e7
fix: path not compilable
irisSong Feb 13, 2025
38296d3
fix: key error
irisSong Feb 13, 2025
dc14741
Merge branch 'feat_v3.x_pickerview' into feat_v3.x_picker
irisSong Feb 14, 2025
65238d3
fix: update datepicker test
irisSong Feb 14, 2025
15630d6
Merge remote-tracking branch 'upstream/feat_v3.x' into feat_v3.x_picker
irisSong Feb 14, 2025
369fec3
fix: hidden entry
irisSong Feb 14, 2025
eb899ee
Merge remote-tracking branch 'upstream/feat_v3.x' into feat_v3.x_picker
irisSong Feb 17, 2025
b458e92
fix: modify config
irisSong Feb 17, 2025
ffba77f
fix: remove repeat config
irisSong Feb 17, 2025
2b2f34e
fix: datepicker优化
irisSong Feb 20, 2025
3ccf9bc
fix: datepicker优化
irisSong Feb 20, 2025
9d26816
fix: 取消后还原初始值
irisSong Feb 20, 2025
3e208b1
fix: 受控的使用
irisSong Feb 21, 2025
f0e4d6c
fix: 支持指令式调用
irisSong Feb 21, 2025
db6b0b7
refactor: datepicker taro
irisSong Feb 21, 2025
fe9ddcf
chore: 移除注释
irisSong Feb 24, 2025
a3d2345
chore: 更新单测引入方式+picker提取pickerProps
irisSong Feb 24, 2025
fb6dfae
fix: ts类型修正
irisSong Feb 24, 2025
f6edf91
fix: 修改组件引入路径
irisSong Feb 25, 2025
9688104
fix: ts类型和单测修正
irisSong Feb 25, 2025
f81ef99
fix: 弹窗动效还原
irisSong Feb 25, 2025
f278479
fix: remove console
irisSong Feb 25, 2025
6e04100
fix: 弹窗动效还原
irisSong Feb 25, 2025
9d672c6
Merge branch 'feat_v3.x_datepickerview' into feat_datepickerview
irisSong Feb 25, 2025
9031780
feat: datepickerview初始化
irisSong Feb 26, 2025
7816059
fix: 合并picker分支
irisSong Feb 26, 2025
43d134c
Merge remote-tracking branch 'upstream/feat_v3.x' into feat_v3.x_date…
irisSong Feb 26, 2025
3fbf988
Merge remote-tracking branch 'upstream/feat_v3.x' into feat_v3.x_picker
irisSong Feb 26, 2025
6789d5a
Merge branch 'feat_v3.x_picker' into feat_datepickerview
irisSong Feb 26, 2025
7f8309d
fix: 合并picker
irisSong Feb 26, 2025
fd9d3ec
fix: ts fixed
irisSong Feb 26, 2025
c1bea93
fix: ts lint
irisSong Feb 26, 2025
6c11115
fix: 初版完成
irisSong Feb 26, 2025
2f0a40e
Merge branch 'feat_v3.x_datepickerview' into refactor_datepicker
irisSong Feb 27, 2025
3a7f51c
fix: 合并picker版本
irisSong Feb 27, 2025
f4742e8
Merge branch 'feat_v3.x_datepickerview' into feat_datepickerview
irisSong Feb 27, 2025
e6a6337
fix: 修改pickerprops路径
irisSong Feb 27, 2025
593e727
fix: 移除console
irisSong Feb 27, 2025
6392141
fix: 修改类型
irisSong Feb 27, 2025
b854693
fix: demo修正同步
irisSong Feb 27, 2025
7497787
fix: pickerprops导出路径修改
irisSong Feb 27, 2025
70abe4f
fix: popover demo修改
irisSong Feb 27, 2025
0c933d4
fix: 合并refactor_datepicker
irisSong Feb 27, 2025
b082b51
Merge remote-tracking branch 'upstream/feat_v3.x' into refactor_datep…
irisSong Feb 27, 2025
6befb47
fix: demo丰富
irisSong Feb 27, 2025
3c3e865
feat: test
irisSong Feb 27, 2025
f459311
Merge remote-tracking branch 'upstream/feat_v3.x' into feat_datepicke…
irisSong Feb 27, 2025
29a6b47
fix: update doc
irisSong Feb 27, 2025
381f113
fix: 优化比较方法
irisSong Feb 27, 2025
438950a
fix: taro导出文件修改+demo ts类型修改
irisSong Feb 28, 2025
dd4d13b
Merge branch 'refactor_datepicker' into feat_datepickerview
irisSong Feb 28, 2025
484f828
fix: 合并3.x
irisSong Mar 4, 2025
12da798
fix: pr修改
irisSong Mar 4, 2025
e14d223
fix: 修改ts报错
irisSong Mar 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,17 @@
"dd": true
},
{
"version": "3.0.0",
"name": "Col",
"type": "component",
"cName": "列",
"desc": "布局组件中的列",
"sort": 3,
"show": false,
"exportEmpty": true,
"author": "yushuang24",
"dd": true
},
"version": "3.0.0",
"name": "Col",
"type": "component",
"cName": "列",
"desc": "布局组件中的列",
"sort": 3,
"show": false,
"exportEmpty": true,
"author": "yushuang24",
"dd": true
},
{
"version": "3.0.0",
"name": "Row",
Expand Down Expand Up @@ -584,6 +584,19 @@
"author": "dsj",
"dd": false
},
{
"version": "3.0.0",
"name": "DatePickerView",
"type": "component",
"cName": "日期选择器视图",
"desc": "DatePickerView 是 DatePicker 的内容区域",
"sort": 16,
"show": true,
"taro": true,
"v15": false,
"dd": false,
"author": "songsong"
},
{
"version": "2.0.0",
"name": "Form",
Expand Down
13 changes: 8 additions & 5 deletions src/packages/datepicker/datepicker.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import React, {
ForwardRefRenderFunction,
useImperativeHandle,
} from 'react'
import isEqual from 'react-fast-compare'
import classNames from 'classnames'
import { View } from '@tarojs/components'
import Picker from '@/packages/picker/index.taro'
import { useConfig } from '@/packages/configprovider/index.taro'
Expand Down Expand Up @@ -77,6 +79,9 @@ const InternalPicker: ForwardRefRenderFunction<
seconds: lang.seconds,
}

const classPrefix = 'nut-datepicker'
const cls = classNames(classPrefix, className)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cls 没有用到~

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cls 没有用到~

已修改


const [pickerValue, setPickerValue] = useState<PickerValue[]>([])
const [pickerOptions, setPickerOptions] = useState<PickerOptions[]>([])

Expand Down Expand Up @@ -111,9 +116,8 @@ const InternalPicker: ForwardRefRenderFunction<
selectedOptions: PickerOptions,
index: number
) => {
const isEqual = new Date(innerDate)?.getTime() === newDate?.getTime()
if (newDate && isDate(newDate)) {
if (!isEqual) {
if (!isEqual(new Date(selectedDate)?.getTime(), newDate?.getTime())) {
setInnerDate(formatValue(newDate, startDate, endDate))
}
onChange?.(
Expand All @@ -130,8 +134,7 @@ const InternalPicker: ForwardRefRenderFunction<

const handleConfirmDateComparison = (newDate: Date | null) => {
if (newDate && isDate(newDate)) {
const isEqual = new Date(selectedDate)?.getTime() === newDate?.getTime()
if (!isEqual) {
if (!isEqual(new Date(selectedDate)?.getTime(), newDate?.getTime())) {
setSelectedDate(formatValue(newDate, startDate, endDate))
}
}
Expand Down Expand Up @@ -223,7 +226,7 @@ const InternalPicker: ForwardRefRenderFunction<
return (
<>
{typeof children === 'function' && children(selectedDate)}
<View className={`nut-datepicker ${className}`} style={style} {...rest}>
<View className={cls} style={style} {...rest}>
{pickerOptions.length && (
<Picker
{...pickerProps}
Expand Down
13 changes: 8 additions & 5 deletions src/packages/datepicker/datepicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import React, {
ForwardRefRenderFunction,
useImperativeHandle,
} from 'react'
import isEqual from 'react-fast-compare'
import classNames from 'classnames'
import Picker from '@/packages/picker'
import { useConfig } from '@/packages/configprovider'
import { usePropsValue } from '@/hooks/use-props-value'
Expand Down Expand Up @@ -75,6 +77,9 @@ const InternalPicker: ForwardRefRenderFunction<
seconds: lang.seconds,
}

const classPrefix = 'nut-datepicker'
const cls = classNames(classPrefix, className)

const [pickerValue, setPickerValue] = useState<PickerValue[]>([])
const [pickerOptions, setPickerOptions] = useState<PickerOptions[]>([])

Expand Down Expand Up @@ -109,9 +114,8 @@ const InternalPicker: ForwardRefRenderFunction<
selectedOptions: PickerOptions,
index: number
) => {
const isEqual = new Date(innerDate)?.getTime() === newDate?.getTime()
if (newDate && isDate(newDate)) {
if (!isEqual) {
if (!isEqual(new Date(selectedDate)?.getTime(), newDate?.getTime())) {
setInnerDate(formatValue(newDate, startDate, endDate))
}
onChange?.(
Expand All @@ -128,8 +132,7 @@ const InternalPicker: ForwardRefRenderFunction<

const handleConfirmDateComparison = (newDate: Date | null) => {
if (newDate && isDate(newDate)) {
const isEqual = new Date(selectedDate)?.getTime() === newDate?.getTime()
if (!isEqual) {
if (!isEqual(new Date(selectedDate)?.getTime(), newDate?.getTime())) {
setSelectedDate(formatValue(newDate, startDate, endDate))
}
}
Expand Down Expand Up @@ -221,7 +224,7 @@ const InternalPicker: ForwardRefRenderFunction<
return (
<>
{typeof children === 'function' && children(selectedDate)}
<div className={`nut-datepicker ${className}`} style={style} {...rest}>
<div className={cls} style={style} {...rest}>
{pickerOptions.length && (
<Picker
{...pickerProps}
Expand Down
Loading
Loading