...
 
Commits (8)
    https://gitcode.net/jd/nutui-react/-/commit/8d3718c829e7892873aeb07fff6b0a26a2afaa48 feat: next 分支增加 GitHub Actions 检查 (#884) 2023-04-06T16:33:58+08:00 eiinu 44915689+eiinu@users.noreply.github.com * feat: 更新 node 版本 增加 github action * fix: 移除 pnpm/setup * fix: update test.yaml * fix: remove build:taro:site https://gitcode.net/jd/nutui-react/-/commit/0319411e47f3428fde88bbf569d7681cb0142703 chore: add merge-props utils 2023-04-07T18:29:54+08:00 oasis-cloud suanbanren@foxmail.com https://gitcode.net/jd/nutui-react/-/commit/f7c507237113afe3dd5f9575681f6d723fd5d263 chore: icons 版本 2023-04-10T10:40:01+08:00 oasis-cloud suanbanren@foxmail.com https://gitcode.net/jd/nutui-react/-/commit/b37700eb8fc625f20e228390b8bbed47672a1040 chore: 更新 reactRefresh,删除 pnpm-lock 2023-04-10T11:01:22+08:00 oasis-cloud suanbanren@foxmail.com https://gitcode.net/jd/nutui-react/-/commit/127853cc5d9639fc389e2a9e582fe7adc187fd7b chore: github ci 需要使用 lock 文件 2023-04-10T15:00:18+08:00 oasis-cloud suanbanren@foxmail.com https://gitcode.net/jd/nutui-react/-/commit/b2f9fc01ac9e17eade53eceda15c93ec39f48427 chore: 提取 pxCheck 到 utils 中 2023-04-10T17:44:35+08:00 oasis-cloud suanbanren@foxmail.com https://gitcode.net/jd/nutui-react/-/commit/c81c79349a351427db448c911b086b602320fa96 chore: 语言切换逻辑修复 2023-04-10T18:59:48+08:00 oasis-cloud suanbanren@foxmail.com https://gitcode.net/jd/nutui-react/-/commit/56a1ec838f55978481d84a7ca14c148fb16ca75b fix: 修复在 style 中设置 css 变量出现的类型错误 (#897) 2023-04-11T18:38:05+08:00 oasis-cloud suanbanren@foxmail.com
name: CI
on:
push:
branches:
- next
pull_request:
branches:
- next
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install pnpm
run: corepack enable
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run test cases
run: npm run test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install pnpm
run: corepack enable
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build NutUI-React
run: npm run build
- name: Build NutUI-React-Taro
run: npm run build:taro
- name: Build NutUI-React Demo
run: npm run build:site
\ No newline at end of file
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
"dependencies": { "dependencies": {
"@babel/runtime": "^7.16.5", "@babel/runtime": "^7.16.5",
"@bem-react/classname": "^1.5.10", "@bem-react/classname": "^1.5.10",
"@nutui/icons-react": "0.0.1-beta.5", "@nutui/icons-react": "0.0.1-beta.7",
"@nutui/icons-react-taro": "0.0.1-beta.5", "@nutui/icons-react-taro": "0.0.1-beta.7",
"@react-spring/web": "~9.6.1", "@react-spring/web": "~9.6.1",
"@use-gesture/react": "10.2.20", "@use-gesture/react": "10.2.20",
"async-validator": "^4.2.5", "async-validator": "^4.2.5",
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
"@types/jest": "^27.4.1", "@types/jest": "^27.4.1",
"@types/loadable__component": "^5.13.3", "@types/loadable__component": "^5.13.3",
"@types/lodash.kebabcase": "^4.1.6", "@types/lodash.kebabcase": "^4.1.6",
"@types/node": "^15.3.1", "@types/node": "^16.14.0",
"@types/react": "^18.0.17", "@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6", "@types/react-dom": "^18.0.6",
"@types/react-router-dom": "^5.1.7", "@types/react-router-dom": "^5.1.7",
...@@ -141,7 +141,6 @@ ...@@ -141,7 +141,6 @@
"@typescript-eslint/eslint-plugin": "^4.24.0", "@typescript-eslint/eslint-plugin": "^4.24.0",
"@typescript-eslint/parser": "^4.24.0", "@typescript-eslint/parser": "^4.24.0",
"@vitejs/plugin-react": "^1.1.3", "@vitejs/plugin-react": "^1.1.3",
"@vitejs/plugin-react-refresh": "^1.3.1",
"autoprefixer": "^10.4.0", "autoprefixer": "^10.4.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"babel-plugin-react-scoped-css": "^1.1.1", "babel-plugin-react-scoped-css": "^1.1.1",
......
此差异已折叠。
...@@ -19,6 +19,7 @@ export interface BarrageProps { ...@@ -19,6 +19,7 @@ export interface BarrageProps {
rows: number rows: number
top: number top: number
} }
const defaultProps = { const defaultProps = {
barrageList: [], barrageList: [],
frequency: 500, frequency: 500,
...@@ -87,13 +88,13 @@ const InternalBarrage: ForwardRefRenderFunction< ...@@ -87,13 +88,13 @@ const InternalBarrage: ForwardRefRenderFunction<
let width = 100 let width = 100
query query
.select('.nut-barrage__body' + timeId.current) .select('.nut-barrage__body' + timeId.current)
.boundingClientRect((rec) => { .boundingClientRect((rec: any) => {
width = rec.width || 300 width = rec.width || 300
}) })
query query
.select('.nut-barrage__item' + index) .select('.nut-barrage__item' + index)
.boundingClientRect((recs) => { .boundingClientRect((recs: any) => {
let height = recs.height let height = recs.height
let nodeTop = (index % rows) * (height + top) + 20 + 'px' let nodeTop = (index % rows) * (height + top) + 20 + 'px'
styleInfo(index, nodeTop, width) styleInfo(index, nodeTop, width)
......
...@@ -855,6 +855,7 @@ export const CalendarItem = React.forwardRef< ...@@ -855,6 +855,7 @@ export const CalendarItem = React.forwardRef<
<ScrollView <ScrollView
scrollTop={scrollTop} scrollTop={scrollTop}
scrollY scrollY
type="list"
scrollWithAnimation={scrollWithAnimation} scrollWithAnimation={scrollWithAnimation}
className="nut-calendar-content" className="nut-calendar-content"
onScroll={monthsViewScroll} onScroll={monthsViewScroll}
......
...@@ -12,7 +12,8 @@ interface DialogWrapperProps { ...@@ -12,7 +12,8 @@ interface DialogWrapperProps {
} }
export const DialogWrapper: FunctionComponent< export const DialogWrapper: FunctionComponent<
Partial<DialogWrapperProps> & Omit<HTMLAttributes<HTMLDivElement>, 'title'> Partial<DialogWrapperProps> &
Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'content'>
> = (props) => { > = (props) => {
const { visible, lockScroll } = props const { visible, lockScroll } = props
......
...@@ -24,7 +24,7 @@ const defaultProps = { ...@@ -24,7 +24,7 @@ const defaultProps = {
export const BaseDialog = forwardRef( export const BaseDialog = forwardRef(
( (
props: Partial<BasicDialogProps> & props: Partial<BasicDialogProps> &
Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'content'>,
ref ref
) => { ) => {
const { locale } = useConfig() const { locale } = useConfig()
......
...@@ -231,6 +231,7 @@ export const Elevator: FunctionComponent< ...@@ -231,6 +231,7 @@ export const Elevator: FunctionComponent<
<ScrollView <ScrollView
scrollTop={scrollTop} scrollTop={scrollTop}
scrollY scrollY
type="list"
className={b('list__inner')} className={b('list__inner')}
ref={listview} ref={listview}
onScroll={listViewScroll} onScroll={listViewScroll}
......
...@@ -103,7 +103,7 @@ export const Infiniteloading: FunctionComponent< ...@@ -103,7 +103,7 @@ export const Infiniteloading: FunctionComponent<
const getScrollHeight = () => { const getScrollHeight = () => {
const parentElement = getParentElement('scroller') const parentElement = getParentElement('scroller')
parentElement parentElement
.boundingClientRect((rect) => { .boundingClientRect((rect: any) => {
scrollHeight.current = rect.height scrollHeight.current = rect.height
}) })
.exec() .exec()
...@@ -197,6 +197,7 @@ export const Infiniteloading: FunctionComponent< ...@@ -197,6 +197,7 @@ export const Infiniteloading: FunctionComponent<
className={classes} className={classes}
scrollY scrollY
id="scroller" id="scroller"
type="list"
style={{ height: '100%' }} style={{ height: '100%' }}
onScroll={scrollAction} onScroll={scrollAction}
onScrollToLower={lower} onScrollToLower={lower}
......
...@@ -177,6 +177,7 @@ export const VirtualList: FunctionComponent< ...@@ -177,6 +177,7 @@ export const VirtualList: FunctionComponent<
<ScrollView <ScrollView
scrollTop={0} scrollTop={0}
scrollY scrollY
type="list"
ref={scrollRef} ref={scrollRef}
className="nut-virtuallist" className="nut-virtuallist"
style={{ style={{
......
此差异已折叠。
...@@ -116,7 +116,7 @@ const WithNavRouter = (C: LoadableComponent<any>) => { ...@@ -116,7 +116,7 @@ const WithNavRouter = (C: LoadableComponent<any>) => {
className={'dark-model'} className={'dark-model'}
src="https://img14.360buyimg.com/imagetools/jfs/t1/135168/8/21387/6193/625fa81aEe07cc347/55ad5bc2580c53a6.png" src="https://img14.360buyimg.com/imagetools/jfs/t1/135168/8/21387/6193/625fa81aEe07cc347/55ad5bc2580c53a6.png"
alt="" alt=""
onClick={() => handleSwitchDarkModel()} onClick={() => handleSwitchLocale()}
/> />
</div> </div>
</div> </div>
......
export function mergeProps<T, U>(
defaultProps: T,
props: U
): { [Key in Extract<keyof T, keyof U>]: U[Key] } &
{ [Key in Exclude<keyof U, keyof T>]?: U[Key] } {
return { ...defaultProps, ...props }
}
export const pxCheck = (value: string | number): string => {
return Number.isNaN(Number(value)) ? String(value) : `${value}px`
}
...@@ -2,7 +2,7 @@ import type { CSSProperties, ReactNode } from 'react' ...@@ -2,7 +2,7 @@ import type { CSSProperties, ReactNode } from 'react'
export interface BasicComponent { export interface BasicComponent {
className?: string className?: string
style?: CSSProperties style?: CSSProperties & Record<`--${string}`, string | number>
children?: ReactNode children?: ReactNode
} }
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
const path = require('path') const path = require('path')
const atImport = require('postcss-import') const atImport = require('postcss-import')
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
import path from 'path' import path from 'path'
import config from './src/config.json' import config from './src/config.json'
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
import path from 'path' import path from 'path'
import commonjs from '@rollup/plugin-commonjs' import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript' import typescript from '@rollup/plugin-typescript'
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
const path = require('path') const path = require('path')
const atImport = require('postcss-import') const atImport = require('postcss-import')
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
import autoprefixer from 'autoprefixer' import autoprefixer from 'autoprefixer'
const path = require('path') const path = require('path')
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
import autoprefixer from 'autoprefixer' import autoprefixer from 'autoprefixer'
const path = require('path') const path = require('path')
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
import autoprefixer from 'autoprefixer' import autoprefixer from 'autoprefixer'
const atImport = require('postcss-import') const atImport = require('postcss-import')
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh' import reactRefresh from '@vitejs/plugin-react'
const atImport = require('postcss-import') const atImport = require('postcss-import')
const path = require('path') const path = require('path')
......