-
-
Notifications
You must be signed in to change notification settings - Fork 80
iOS Slider numberOfDiscreteValues fix #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Slider numberOfDiscreteValues fix #395
Conversation
@dangrima90 thanks that looks good! |
I've ran into an issue when trying to run lerna notice cli v5.1.6
lerna info Executing command in 18 packages: "npm run build.all"
lerna info run Ran npm script 'build.all' in '@nativescript-community/ui-material-core' in 12.8s:
> @nativescript-community/[email protected] build.all /Code/ui-material-components/packages/core
> npm run build
> @nativescript-community/[email protected] build /Code/ui-material-components/packages/core
> npm run tsc
> @nativescript-community/[email protected] tsc /Code/ui-material-components/packages/core
> ../../node_modules/.bin/cpy '**/*.d.ts' '../../packages/core' --cwd=../../src/core --parents && ../../node_modules/.bin/tsc -d
lerna info run Ran npm script 'build.all' in '@nativescript-community/ui-material-snackbar' in 43.5s:
> @nativescript-community/[email protected] build.all /Code/ui-material-components/packages/snackbar
> npm run build
> @nativescript-community/[email protected] build /Codeui-material-components/packages/snackbar
> npm run tsc
> @nativescript-community/[email protected] tsc /Code/ui-material-components/packages/snackbar
> ../../node_modules/.bin/cpy ../../src/snackbar/snackbar.d.ts ./ && ../../node_modules/.bin/tsc -d
lerna info run Ran npm script 'build.all' in '@nativescript-community/ui-material-core-tabs' in 48.5s:
> @nativescript-community/[email protected] build.all /Code/ui-material-components/packages/core-tabs
> npm run build
> @nativescript-community/[email protected] build /Code/ui-material-components/packages/core-tabs
> npm run tsc
> @nativescript-community/[email protected] tsc /Code/ui-material-components/packages/core-tabs
> ../../node_modules/.bin/cpy '**/*.d.ts' '../../packages/core-tabs' --cwd=../../src/core-tabs --parents && ../../node_modules/.bin/tsc -d
lerna ERR! npm run build.all exited 1 in '@nativescript-community/ui-material-floatingactionbutton'
lerna ERR! npm run build.all stdout:
> @nativescript-community/[email protected] build.all /Code/ui-material-components/packages/floatingactionbutton
> npm run build && npm run build.angular
> @nativescript-community/[email protected] build /Code/ui-material-components/packages/floatingactionbutton
> npm run tsc
> @nativescript-community/[email protected] tsc /Code/ui-material-components/packages/floatingactionbutton
> ../../node_modules/.bin/cpy ../../src/floatingactionbutton/floatingactionbutton.d.ts ./ && ../../node_modules/.bin/tsc -d
> @nativescript-community/[email protected] build.angular /Code/ui-material-components/packages/floatingactionbutton
> ../../node_modules/.bin/ng-packagr -p ../../src/floatingactionbutton/angular/package.json -c ../../src/floatingactionbutton/angular/tsconfig.json
Building Angular Package
------------------------------------------------------------------------------
Building entry point '@nativescript-community/ui-material-floatingactionbutton-angular'
------------------------------------------------------------------------------
lerna ERR! npm run build.all stderr:
WARNING: Found configuration in /Code/ui-material-components/src/floatingactionbutton/angular/package.json.
Configuring ng-packagr in "package.json" is deprecated. Use "ng-package.json" instead.
(node:6533) ExperimentalWarning: The ESM module loader is experimental.
- Compiling with Angular sources in Ivy full compilation mode.
✖ Compiling with Angular sources in Ivy full compilation mode.
The requested module 'sourcemap-codec' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from 'sourcemap-codec';
const { decode, encode } = pkg;
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @nativescript-community/[email protected] build.angular: `../../node_modules/.bin/ng-packagr -p ../../src/floatingactionbutton/angular/package.json -c ../../src/floatingactionbutton/angular/tsconfig.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @nativescript-community/[email protected] build.angular script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dg/.npm/_logs/2022-06-26T11_11_56_799Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @nativescript-community/[email protected] build.all: `npm run build && npm run build.angular`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @nativescript-community/[email protected] build.all script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dg/.npm/_logs/2022-06-26T11_11_56_867Z-debug.log
lerna ERR! npm run build.all exited 1 in '@nativescript-community/ui-material-floatingactionbutton'
lerna WARN complete Waiting for 12 child processes to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @nativescript-community/[email protected] build.all: `lerna run build.all`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @nativescript-community/[email protected] build.all script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dg/.npm/_logs/2022-06-26T11_11_57_028Z-debug.log |
@dangrima90 ok it is weird as it works here but your angular version is too "new" and does not support the current repo structure |
@farfromrefug understood 👍 it's my first time setting up this project on my machine so it could be that it's a recent angular change. It could be that on your environment if you clean your node modules you might get the same issue? |
Here's a small fix on iOS so that
numberOfDiscreteValues
has the correct value.With the previous logic the slider resulted in always being continuous as it calculated the min/max difference rather than the amount of values in the range.
Examples
Range 0 - 10
Steps 1
Calculation 10 - 0 / 1 = 10
New Calculation (10 - 0 + 1) / 1 = 11
Range 5 - 100
Steps 5
Calculation 100 - 5 / 5 = 19
New Calculation (100 - 5 + 1) / 5 = 20 (Actual value is 19.2 but code is using
Math.ceil()
to get a whole number)Tested this locally on my project, unfortunately I wasn't able to run the demo apps within this project itself. But I think it should be fine.
Let me know if any other updates are required.