From 45b0dac4c34eb49c8ffec9e7f340f15586497826 Mon Sep 17 00:00:00 2001
From: oasis <12181600+oasis-cloud@users.noreply.github.com>
Date: Thu, 14 Nov 2024 18:02:53 +0800
Subject: [PATCH] feat(v14): pagination (#2752)
* feat(v14): pagination
* feat(v14): pagination
* chore: delete rn
* chore: delete rn
* chore: delete rn
---
.github/workflows/ci.yml | 12 ++---
gulpfile.js | 22 +++++-----
.../scripts/taro/generate-nutui-taro.js | 24 +++++-----
scripts/taro/generate-nutui-taro.js | 44 +++++++++----------
src/config.json | 1 +
src/packages/pagination/pagination.scss | 18 +++-----
src/packages/pagination/pagination.taro.tsx | 1 +
src/packages/pagination/pagination.tsx | 1 +
src/styles/variables.scss | 7 ++-
9 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 958dcf0e4..a9e3f959d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -30,7 +30,7 @@ jobs:
run: pnpm install
- name: Run linter
- run: npm run lint
+ run: pnpm lint
test:
if: ${{ github.event_name == 'pull_request' }}
@@ -50,7 +50,7 @@ jobs:
run: pnpm install
- name: Run test
- run: npm run test
+ run: pnpm test
- name: Upload coverage reports to Codecov
if: ${{ always() }}
@@ -76,17 +76,17 @@ jobs:
run: pnpm install
- name: Build NutUI-React
- run: npm run build
+ run: pnpm build
- name: Build NutUI-React-Taro
- run: npm run build:taro
+ run: pnpm build:taro
- name: Build NutUI-React Demo
- run: npm run build:site
+ run: pnpm build:site
- name: Build NutUI-React Taro H5 Demo
if: github.ref == 'refs/heads/next'
- run: npm run build:taro:site
+ run: pnpm build:taro:site
add-label:
if: ${{ github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
diff --git a/gulpfile.js b/gulpfile.js
index 6b9b76868..6aba063d5 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -42,11 +42,11 @@ gulp.task('watch', () => {
interval,
gulp.series(`${argv}copyTaro`)
)
- gulp.watch(
- `src/packages/${argv}/${argv}.rn.tsx`,
- interval,
- gulp.series(`${argv}copyRN`)
- )
+ // gulp.watch(
+ // `src/packages/${argv}/${argv}.rn.tsx`,
+ // interval,
+ // gulp.series(`${argv}copyRN`)
+ // )
})
const watchTasks = []
// eslint-disable-next-line array-callback-return
@@ -121,10 +121,10 @@ argvs.forEach((argv) => {
.pipe(insert.prepend(`import "./${argv}.harmony.css";\n`))
.pipe(gulp.dest(`${targetBaseUrl}/`))
})
- gulp.task(`${argv}copyRN`, () => {
- return gulp
- .src(`src/packages/${argv}/${argv}.rn.tsx`)
- .pipe(insert.prepend(`import "./${argv}.harmony.css";\n`))
- .pipe(gulp.dest(`${targetBaseUrl}/`))
- })
+ // gulp.task(`${argv}copyRN`, () => {
+ // return gulp
+ // .src(`src/packages/${argv}/${argv}.rn.tsx`)
+ // .pipe(insert.prepend(`import "./${argv}.harmony.css";\n`))
+ // .pipe(gulp.dest(`${targetBaseUrl}/`))
+ // })
})
diff --git a/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js b/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js
index d238105c7..241b20aa3 100644
--- a/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js
+++ b/packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js
@@ -57,18 +57,18 @@ fs.outputFile(
}
)
-let fileRNStr = `${importRNStr}
-${importScssStr}
-export { ${packages.join(',')} };`
-fs.outputFile(
- path.resolve(__dirname, '../../nutui-react/packages/nutui.react.rn.ts'),
- fileRNStr,
- 'utf8',
- (error) => {
- if (error) throw error
- }
-)
-
+// let fileRNStr = `${importRNStr}
+// ${importScssStr}
+// export { ${packages.join(',')} };`
+// fs.outputFile(
+// path.resolve(__dirname, '../../nutui-react/packages/nutui.react.rn.ts'),
+// fileRNStr,
+// 'utf8',
+// (error) => {
+// if (error) throw error
+// }
+// )
+//
let taroScssfileStr = `
${importScssStr}
export default { "NutUI":"NutUI-Taro" };`
diff --git a/scripts/taro/generate-nutui-taro.js b/scripts/taro/generate-nutui-taro.js
index 4272c1337..c64b754cc 100644
--- a/scripts/taro/generate-nutui-taro.js
+++ b/scripts/taro/generate-nutui-taro.js
@@ -69,29 +69,29 @@ fs.outputFile(
)
-let fileRNStrBuild = `${importRNStr}
-export { ${packages.join(',')} };`
-
-fs.outputFile(
- path.resolve(__dirname, '../../src/packages/nutui.react.build.rn.ts'),
- fileRNStrBuild,
- 'utf8',
- (error) => {
- if (error) throw error
- }
-)
+// let fileRNStrBuild = `${importRNStr}
+// export { ${packages.join(',')} };`
+//
+// fs.outputFile(
+// path.resolve(__dirname, '../../src/packages/nutui.react.build.rn.ts'),
+// fileRNStrBuild,
+// 'utf8',
+// (error) => {
+// if (error) throw error
+// }
+// )
-let fileRNStr = `${importRNStr}
-${importScssStr}
-export { ${packages.join(',')} };`
-fs.outputFile(
- path.resolve(__dirname, '../../src/packages/nutui.react.rn.ts'),
- fileRNStr,
- 'utf8',
- (error) => {
- if (error) throw error
- }
-)
+// let fileRNStr = `${importRNStr}
+// ${importScssStr}
+// export { ${packages.join(',')} };`
+// fs.outputFile(
+// path.resolve(__dirname, '../../src/packages/nutui.react.rn.ts'),
+// fileRNStr,
+// 'utf8',
+// (error) => {
+// if (error) throw error
+// }
+// )
let taroScssfileStr = `
${importScssStr}
diff --git a/src/config.json b/src/config.json
index 36d40185c..471698fbc 100644
--- a/src/config.json
+++ b/src/config.json
@@ -1031,6 +1031,7 @@
"sort": 6,
"show": true,
"taro": true,
+ "v14": true,
"author": "lkjh3214"
},
{
diff --git a/src/packages/pagination/pagination.scss b/src/packages/pagination/pagination.scss
index 7d86f96b5..28505fbfd 100644
--- a/src/packages/pagination/pagination.scss
+++ b/src/packages/pagination/pagination.scss
@@ -67,10 +67,11 @@
}
.nut-pagination-lite {
- width: $pagination-lite-width;
height: $pagination-lite-height;
+ padding: 0 $spacing-xs;
display: flex;
flex-direction: row;
+ align-items: center;
color: $color-primary-text;
background-color: $pagination-lite-background-color;
border-radius: $pagination-lite-radius;
@@ -78,18 +79,11 @@
.nut-pagination-lite-active,
.nut-pagination-lite-default {
- display: flex;
- align-items: center;
- justify-content: center;
- width: $pagination-lite-height;
- height: $pagination-lite-height;
- font-size: $font-size-s;
+ font-size: $font-size-xs;
color: $pagination-lite-color;
- font-weight: 400;
}
-.nut-pagination-lite-active {
- border-radius: $pagination-lite-radius;
- font-size: $font-size-s;
- background-color: $pagination-lite-active-background-color;
+.nut-pagination-lite-spliterator {
+ font-size: $font-size-xs;
+ color: $pagination-lite-color;
}
diff --git a/src/packages/pagination/pagination.taro.tsx b/src/packages/pagination/pagination.taro.tsx
index ad0a11dd6..fa06c5b93 100644
--- a/src/packages/pagination/pagination.taro.tsx
+++ b/src/packages/pagination/pagination.taro.tsx
@@ -161,6 +161,7 @@ export const Pagination: FunctionComponent<
{mode === 'lite' && (