@react-native-ohos/slider 5.0.1-rc.1 → 5.1.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/.github/Examples/Slider-Android-Example.gif +0 -0
  2. package/.github/Examples/Slider-Web-Example.gif +0 -0
  3. package/.github/Examples/Slider-Windows-Example.gif +0 -0
  4. package/.github/Examples/Slider-iOS-Example.gif +0 -0
  5. package/.github/ISSUE_TEMPLATE/BUG_REPORT.md +38 -0
  6. package/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +14 -0
  7. package/.github/ISSUE_TEMPLATE/QUESTION.md +9 -0
  8. package/.github/PULL_REQUEST_TEMPLATE.md +11 -0
  9. package/.github/workflows/ReactNativeSlider-CI.yml +231 -0
  10. package/CHANGELOG.md +184 -0
  11. package/COMMITTERS.md +6 -0
  12. package/LICENSE +8 -8
  13. package/OAT.xml +73 -0
  14. package/README.OpenSource +10 -10
  15. package/README.md +12 -12
  16. package/babel.config.json +3 -0
  17. package/dist/RNCSliderNativeComponent.js +1 -1
  18. package/dist/Slider.js +1 -1
  19. package/dist/components/StepNumber.js +1 -1
  20. package/dist/components/StepsIndicator.js +1 -1
  21. package/dist/components/TrackMark.js +1 -1
  22. package/example/.eslintrc +19 -0
  23. package/example/.node-version +6 -0
  24. package/example/.prettierrc.js +7 -0
  25. package/example/.watchmanconfig +6 -0
  26. package/example/app.json +4 -0
  27. package/example/babel.config.js +9 -0
  28. package/example/contexts.ts +9 -0
  29. package/example/harmony/AppScope/app.json5 +10 -0
  30. package/example/harmony/AppScope/resources/base/element/string.json +8 -0
  31. package/example/harmony/AppScope/resources/base/media/app_icon.png +0 -0
  32. package/example/harmony/build-profile.template.json5 +36 -0
  33. package/example/harmony/codelinter.json +32 -0
  34. package/example/harmony/entry/build-profile.json5 +22 -0
  35. package/example/harmony/entry/hvigorfile.ts +8 -0
  36. package/example/harmony/entry/oh-package.json5 +11 -0
  37. package/example/harmony/entry/src/main/cpp/CMakeLists.txt +41 -0
  38. package/example/harmony/entry/src/main/cpp/PackageProvider.cpp +17 -0
  39. package/example/harmony/entry/src/main/ets/RNPackagesFactory.ets +13 -0
  40. package/example/harmony/entry/src/main/ets/assets/fonts/Pacifico-Regular.ttf +0 -0
  41. package/example/harmony/entry/src/main/ets/assets/fonts/StintUltraCondensed-Regular.ttf +0 -0
  42. package/example/harmony/entry/src/main/ets/entryability/EntryAbility.ets +27 -0
  43. package/example/harmony/entry/src/main/ets/pages/Index.ets +125 -0
  44. package/example/harmony/entry/src/main/ets/pages/SurfaceDeadlockTest.ets +135 -0
  45. package/example/harmony/entry/src/main/ets/pages/TouchDisplayer.ets +44 -0
  46. package/example/harmony/entry/src/main/module.json5 +52 -0
  47. package/example/harmony/entry/src/main/resources/base/element/color.json +8 -0
  48. package/example/harmony/entry/src/main/resources/base/element/string.json +16 -0
  49. package/example/harmony/entry/src/main/resources/base/media/icon.png +0 -0
  50. package/example/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
  51. package/example/harmony/entry/src/main/resources/rawfile/1.txt +1 -0
  52. package/example/harmony/format.ps1 +18 -0
  53. package/example/harmony/hvigor/hvigor-config.json5 +21 -0
  54. package/example/harmony/hvigorfile.ts +9 -0
  55. package/example/harmony/oh-package.json5 +12 -0
  56. package/example/index.js +11 -0
  57. package/example/jest.config.js +11 -0
  58. package/example/metro.config.js +30 -0
  59. package/example/package.json +58 -0
  60. package/example/react-native.config.js +11 -0
  61. package/example/scripts/create-build-profile.js +46 -0
  62. package/example/src/index.tsx +22 -0
  63. package/example/tsconfig.json +20 -0
  64. package/harmony/slider/README.OpenSource +1 -1
  65. package/harmony/slider/oh-package.json5 +10 -10
  66. package/harmony/slider.har +0 -0
  67. package/package.json +92 -98
  68. package/react-native.config.js +11 -0
  69. package/src/RNCSliderNativeComponent.ts +51 -47
  70. package/src/Slider.tsx +356 -350
  71. package/src/components/StepNumber.tsx +23 -17
  72. package/src/components/StepsIndicator.tsx +89 -83
  73. package/src/components/TrackMark.tsx +59 -50
  74. package/src/index.ts +9 -3
  75. package/src/utils/constants.ts +17 -11
  76. package/src/utils/styles.ts +61 -55
  77. package/tsconfig.json +23 -0
  78. package/typings/index.d.ts +214 -208
  79. package/harmony/slider/.idea/misc.xml +0 -6
  80. package/harmony/slider/.idea/modules.xml +0 -8
  81. package/harmony/slider/.idea/slider.iml +0 -8
  82. package/harmony/slider/oh-package-lock.json5 +0 -18
package/package.json CHANGED
@@ -1,98 +1,92 @@
1
- {
2
- "name": "@react-native-ohos/slider",
3
- "version": "5.0.1-rc.1",
4
- "license": "MIT",
5
- "author": "react-native-community",
6
- "homepage": "https://github.com/callstack/react-native-slider#readme",
7
- "description": "React Native component used to select a single value from a range of values.",
8
- "harmony": {
9
- "alias": "@react-native-community/slider"
10
- },
11
- "files": [
12
- "dist",
13
- "src",
14
- "typings",
15
- "harmony"
16
- ],
17
- "publishConfig": {
18
- "registry": "https://npm.pkg.github.com"
19
- },
20
- "main": "dist/Slider.js",
21
- "types": "typings/index.d.ts",
22
- "keywords": [
23
- "react-native",
24
- "react native",
25
- "slider"
26
- ],
27
- "scripts": {
28
- "prepare": "babel --extensions \".ts,.tsx\" --out-dir dist src",
29
- "lint": "npx eslint src",
30
- "test": "npx jest src"
31
- },
32
- "dependencies": {
33
- "@react-native-community/slider": "5.0.0"
34
- },
35
- "devDependencies": {
36
- "@babel/cli": "^7.8.4",
37
- "@babel/core": "^7.25.2",
38
- "@babel/preset-flow": "^7.9.0",
39
- "@babel/preset-typescript": "^7.18.6",
40
- "@babel/runtime": "^7.25.0",
41
- "@react-native-community/cli": "15.0.1",
42
- "@react-native-community/cli-platform-android": "15.0.1",
43
- "@react-native-community/cli-platform-ios": "15.0.1",
44
- "@react-native-community/eslint-config": "^3.2.0",
45
- "@react-native/babel-preset": "0.76.3",
46
- "@react-native/eslint-config": "0.76.3",
47
- "@react-native/metro-config": "0.76.3",
48
- "@react-native/typescript-config": "0.76.3",
49
- "@types/jest": "^28.1.8",
50
- "@types/react": "^18.2.6",
51
- "@types/react-test-renderer": "^18.0.0",
52
- "babel-jest": "^29.7.0",
53
- "babel-plugin-module-resolver": "5.0.0",
54
- "copyfiles": "^2.4.1",
55
- "eslint": "^8.19.0",
56
- "eslint-plugin-prettier": "4.2.1",
57
- "eslint-plugin-react": "^7.30.1",
58
- "eslint-plugin-react-native": "^4.0.0",
59
- "flow-bin": "^0.163.0",
60
- "jest": "^29.5.0",
61
- "prettier": "2.8.8",
62
- "react": "^18.3.1",
63
- "react-native": "^0.77.1",
64
- "react-native-windows": "^0.76.2",
65
- "react-test-renderer": "^18.3.1",
66
- "typescript": "^5.0.4"
67
- },
68
- "repository": {
69
- "type": "git",
70
- "url": "https://github.com/react-native-oh-library/react-native-slider.git"
71
- },
72
- "jest": {
73
- "preset": "react-native",
74
- "verbose": true,
75
- "modulePathIgnorePatterns": [
76
- "/e2e/"
77
- ]
78
- },
79
- "prettier": {
80
- "singleQuote": true,
81
- "trailingComma": "all",
82
- "bracketSpacing": false,
83
- "jsxBracketSameLine": true
84
- },
85
- "codegenConfig": {
86
- "name": "RNCSlider",
87
- "type": "components",
88
- "jsSrcsDir": "src",
89
- "android": {
90
- "javaPackageName": "com.reactnativecommunity.slider"
91
- },
92
- "ios": {
93
- "componentProvider": {
94
- "RNCSlider": "RNCSliderComponentView"
95
- }
96
- }
97
- }
98
- }
1
+ {
2
+ "name": "@react-native-ohos/slider",
3
+ "version": "5.1.2-rc.1",
4
+ "license": "MIT",
5
+ "author": "react-native-community",
6
+ "homepage": "https://gitcode.com/openharmony-sig/rntpc_react-native-slider/tree/br_rnoh0.77#readme",
7
+ "description": "React Native component used to select a single value from a range of values.",
8
+ "harmony": {
9
+ "alias": "@react-native-community/slider"
10
+ },
11
+ "publishConfig": {
12
+ "registry": "https://npm.pkg.github.com"
13
+ },
14
+ "main": "dist/Slider.js",
15
+ "types": "typings/index.d.ts",
16
+ "keywords": [
17
+ "react-native",
18
+ "react native",
19
+ "slider"
20
+ ],
21
+ "scripts": {
22
+ "prepare": "babel --extensions \".ts,.tsx\" --out-dir dist src",
23
+ "lint": "npx eslint src",
24
+ "test": "npx jest src"
25
+ },
26
+ "dependencies": {
27
+ "@react-native-community/slider": "5.1.1"
28
+ },
29
+ "devDependencies": {
30
+ "@babel/cli": "^7.8.4",
31
+ "@babel/core": "^7.25.2",
32
+ "@babel/preset-flow": "^7.9.0",
33
+ "@babel/preset-typescript": "^7.18.6",
34
+ "@babel/runtime": "^7.25.0",
35
+ "@react-native-community/cli": "^20.0.2",
36
+ "@react-native-community/cli-platform-android": "^20.0.2",
37
+ "@react-native-community/cli-platform-ios": "^20.0.2",
38
+ "@react-native-community/eslint-config": "^3.2.0",
39
+ "@react-native/babel-preset": "^0.81.1",
40
+ "@react-native/eslint-config": "^0.81.1",
41
+ "@react-native/metro-config": "^0.81.1",
42
+ "@react-native/typescript-config": "^0.81.1",
43
+ "@types/jest": "^28.1.8",
44
+ "@types/react": "^19.2.0",
45
+ "@types/react-test-renderer": "^19.1.0",
46
+ "babel-jest": "^29.7.0",
47
+ "babel-plugin-module-resolver": "5.0.0",
48
+ "copyfiles": "^2.4.1",
49
+ "eslint": "^8.19.0",
50
+ "eslint-plugin-prettier": "4.2.1",
51
+ "eslint-plugin-react": "^7.30.1",
52
+ "eslint-plugin-react-native": "^4.0.0",
53
+ "flow-bin": "^0.163.0",
54
+ "jest": "^29.5.0",
55
+ "prettier": "2.8.8",
56
+ "react": "^19.2.0",
57
+ "react-native": "^0.81.4",
58
+ "react-native-windows": "^0.76.2",
59
+ "react-test-renderer": "^19.2.0",
60
+ "typescript": "^5.0.4"
61
+ },
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "https://gitcode.com/openharmony-sig/rntpc_react-native-slider.git"
65
+ },
66
+ "jest": {
67
+ "preset": "react-native",
68
+ "verbose": true,
69
+ "modulePathIgnorePatterns": [
70
+ "/e2e/"
71
+ ]
72
+ },
73
+ "prettier": {
74
+ "singleQuote": true,
75
+ "trailingComma": "all",
76
+ "bracketSpacing": false,
77
+ "jsxBracketSameLine": true
78
+ },
79
+ "codegenConfig": {
80
+ "name": "RNCSlider",
81
+ "type": "components",
82
+ "jsSrcsDir": "src",
83
+ "android": {
84
+ "javaPackageName": "com.reactnativecommunity.slider"
85
+ },
86
+ "ios": {
87
+ "componentProvider": {
88
+ "RNCSlider": "RNCSliderComponentView"
89
+ }
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ dependency: {
3
+ platforms: {
4
+ android: {
5
+ libraryName: 'RNCSlider',
6
+ componentDescriptors: ['RNCSliderComponentDescriptor'],
7
+ cmakeListsPath: 'src/main/jni/CMakeLists.txt',
8
+ },
9
+ },
10
+ },
11
+ };
@@ -1,47 +1,51 @@
1
- import type {ColorValue, HostComponent, ViewProps} from 'react-native';
2
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
3
- //@ts-ignore
4
- import type {ImageSource} from 'react-native/Libraries/Image/ImageSource';
5
- import type {
6
- Float,
7
- WithDefault,
8
- DirectEventHandler,
9
- BubblingEventHandler,
10
- Double,
11
- } from 'react-native/Libraries/Types/CodegenTypes';
12
-
13
- type Event = Readonly<{
14
- value: Float;
15
- fromUser?: boolean;
16
- }>;
17
-
18
- export interface NativeProps extends ViewProps {
19
- accessibilityUnits?: string;
20
- accessibilityIncrements?: ReadonlyArray<string>;
21
- disabled?: WithDefault<boolean, false>;
22
- inverted?: WithDefault<boolean, false>;
23
- vertical?: WithDefault<boolean, false>;
24
- tapToSeek?: WithDefault<boolean, false>;
25
- maximumTrackImage?: ImageSource;
26
- maximumTrackTintColor?: ColorValue;
27
- maximumValue?: Double;
28
- minimumTrackImage?: ImageSource;
29
- minimumTrackTintColor?: ColorValue;
30
- minimumValue?: Double;
31
- onChange?: BubblingEventHandler<Event>;
32
- onRNCSliderSlidingStart?: DirectEventHandler<Event>;
33
- onRNCSliderSlidingComplete?: DirectEventHandler<Event>;
34
- onRNCSliderValueChange?: BubblingEventHandler<Event>;
35
- step?: Double;
36
- testID?: string;
37
- thumbImage?: ImageSource;
38
- thumbTintColor?: ColorValue;
39
- trackImage?: ImageSource;
40
- value?: Float;
41
- lowerLimit?: Float;
42
- upperLimit?: Float;
43
- }
44
-
45
- export default codegenNativeComponent<NativeProps>('RNCSlider', {
46
- interfaceOnly: true,
47
- }) as HostComponent<NativeProps>;
1
+ /*
2
+ * Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ import type {ColorValue, HostComponent, ViewProps} from 'react-native';
8
+ import {ImageSource, codegenNativeComponent} from 'react-native';
9
+ import type {
10
+ Float,
11
+ WithDefault,
12
+ DirectEventHandler,
13
+ BubblingEventHandler,
14
+ Double,
15
+ } from 'react-native/Libraries/Types/CodegenTypes';
16
+
17
+ type Event = Readonly<{
18
+ value: Float;
19
+ fromUser?: boolean;
20
+ }>;
21
+
22
+ export interface NativeProps extends ViewProps {
23
+ accessibilityUnits?: string;
24
+ accessibilityIncrements?: ReadonlyArray<string>;
25
+ disabled?: WithDefault<boolean, false>;
26
+ inverted?: WithDefault<boolean, false>;
27
+ vertical?: WithDefault<boolean, false>;
28
+ tapToSeek?: WithDefault<boolean, false>;
29
+ maximumTrackImage?: ImageSource;
30
+ maximumTrackTintColor?: ColorValue;
31
+ maximumValue?: Double;
32
+ minimumTrackImage?: ImageSource;
33
+ minimumTrackTintColor?: ColorValue;
34
+ minimumValue?: Double;
35
+ onChange?: BubblingEventHandler<Event>;
36
+ onRNCSliderSlidingStart?: DirectEventHandler<Event>;
37
+ onRNCSliderSlidingComplete?: DirectEventHandler<Event>;
38
+ onRNCSliderValueChange?: BubblingEventHandler<Event>;
39
+ step?: Double;
40
+ testID?: string;
41
+ thumbImage?: ImageSource;
42
+ thumbTintColor?: ColorValue;
43
+ trackImage?: ImageSource;
44
+ value?: Float;
45
+ lowerLimit?: Float;
46
+ upperLimit?: Float;
47
+ }
48
+
49
+ export default codegenNativeComponent<NativeProps>('RNCSlider', {
50
+ interfaceOnly: true,
51
+ }) as HostComponent<NativeProps>;