Skip to content

Commit ea27f60

Browse files
committed
chore: move to @nativescript-community
1 parent 8c7b5dd commit ea27f60

File tree

139 files changed

+3182
-1106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+3182
-1106
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: './tools/.eslintrc.js'
3+
};

.gitignore

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,56 @@
1-
platforms
2-
node_modules
3-
hooks
4-
.vscode/
5-
.idea/
6-
*.DS_Store
7-
bin
8-
package-lock.json
1+
# NativeScript
2+
hooks/
3+
node_modules/
4+
/platforms/
95

10-
*.js
6+
# NativeScript Template
117
*.js.map
8+
!ngcc.config.js
9+
!webpack.config.js
10+
11+
# Logs
12+
logs
1213
*.log
13-
*.d.ts
14-
*.tgz
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
18+
# General
19+
.DS_Store
20+
.AppleDouble
21+
.LSOverride
22+
.idea
23+
.cloud
24+
.project
25+
tmp/
26+
package-lock.json
27+
28+
!.eslintrc.js
29+
!.prettierrc.js
1530

16-
demo/lib
17-
demo/app/*.js
18-
demo/*.d.ts
19-
demo/platforms
20-
demo/node_modules
21-
demo/.vscode
22-
demo-ng/app/*.js
23-
demo-ng/*.d.ts
24-
demo-ng/platforms
25-
demo-ng/node_modules
26-
demo-ng/.vscode
27-
src/angular/index.d.ts
28-
src/angular/index.metadata.json
31+
!e2e/*.js
32+
!detox.config.js
33+
devices.js
34+
35+
*.framework
36+
**/*.js.map
37+
src/**/*.js
38+
packages/**/*.js
39+
packages/**/*.d.ts
40+
bin
41+
build
42+
Pods
43+
!packages/platforms
44+
/packages/**/*.aar
45+
*.xcuserdatad
46+
/packages/README.md
47+
packages/**/*js.map
48+
packages/**/*js
49+
packages/**/angular/*.json
50+
packages/*.ngsummary.json
51+
packages/*.metadata.json
52+
packages/angular
53+
packages/typings
54+
pnpm-lock.yaml
2955

30-
!webpack.*.js
31-
!index.d.ts
32-
!src/*.d.ts
33-
!references.d.ts
34-
!src/typings/*
35-
!demo-ng/ngcc.config.js
56+
/blueprint.md

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "demo-ng"]
2+
path = demo-ng
3+
url = [email protected]:nativescript-community/plugin-seed-demo-ng.git
4+
[submodule "tools"]
5+
path = tools
6+
url = [email protected]:nativescript-community/plugin-seed-tools.git

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false
3+
loglevel=error

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package-lock.json
2+
node_modules/
3+
plugin/
4+
docs/

.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
printWidth: 200,
3+
semi: true,
4+
tabWidth: 4,
5+
trailingComma: 'none',
6+
singleQuote: true
7+
};

README.md

Lines changed: 143 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,122 @@
1-
<a align="center" href="https://www.npmjs.com/package/@nstudio/nativescript-checkbox">
2-
<h3 align="center">NativeScript Checkbox</h3>
3-
</a>
4-
<h4 align="center">A NativeScript plugin to provide a checkbox widget, radio buttons are also possible.</h4>
1+
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
2+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!
20+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
21+
<h1 align="center">@nativescript-community/ui-checkbox</h1>
22+
<p align="center">
23+
<a href="https://npmcharts.com/compare/@nativescript-community/ui-checkbox?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/ui-checkbox.svg" height="20"/></a>
24+
<a href="https://www.npmjs.com/package/@nativescript-community/ui-checkbox"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/ui-checkbox.svg" height="20"/></a>
25+
</p>
526

627
<p align="center">
7-
<a href="https://www.npmjs.com/package/@nstudio/nativescript-checkbox">
8-
<img src="https://github.com/nstudio/nativescript-checkbox/workflows/Build%20CI/badge.svg" alt="Action Build">
9-
</a>
10-
<a href="https://www.npmjs.com/package/@nstudio/nativescript-checkbox">
11-
<img src="https://img.shields.io/npm/dt/nativescript-checkbox.svg?label=npm%20downloads" alt="npm">
12-
</a>
13-
<a href="https://github.com/@nstudio/nativescript-checkbox/stargazers">
14-
<img src="https://img.shields.io/github/stars/@nstudio/nativescript-checkbox.svg" alt="stars">
15-
</a>
16-
<br />
28+
<b>NativeScript plugin for checkbox.</b></br>
29+
<sub><sub>
1730
</p>
1831

19-
---
32+
<br />
2033

21-
### Installation
2234

23-
From your command prompt/terminal go to your app's root folder and execute:
35+
| <img src="https://github.com/nativescript-community/ui-checkbox/raw/master/images/demo-ios.gif" height="500" /> | <img src="https://github.com/nativescript-community/ui-checkbox/raw/master/images/demo-android.gif" height="500" /> |
36+
| --- | ----------- |
37+
| iOS Demo | Android Demo |
2438

25-
#### NativeScript 7+:
2639

27-
```bash
28-
ns plugin add @nstudio/nativescript-checkbox
29-
```
40+
[](#table-of-contents)
3041

31-
#### NativeScript prior to 7:
42+
## Table of Contents
3243

33-
```bash
34-
tns plugin add @nstudio/[email protected]
35-
```
44+
* [Installation](#installation)
45+
* [Platform controls used:](#platform-controls-used)
46+
* [API](#api)
47+
* [Properties](#properties)
48+
* [Events](#events)
49+
* [API](#api-1)
50+
* [Css Styling](#css-styling)
51+
* [Styling [Android]](#styling-android)
52+
* [Angular Usage Sample:](#angular-usage-sample)
53+
* [NativeScript-Vue Usage Sample](#nativescript-vue-usage-sample)
54+
* [Demos](#demos)
55+
* [Demos and Development](#demos-and-development)
56+
* [Setup](#setup)
57+
* [Build](#build)
58+
* [Demos](#demos-1)
59+
* [Questions](#questions)
60+
61+
62+
[](#installation)
63+
64+
## Installation
65+
Run the following command from the root of your project:
66+
67+
`ns plugin add @nativescript-community/ui-checkbox`
3668

3769
#### Platform controls used:
3870

3971
| Android | iOS |
4072
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------- |
4173
| [Android CheckBox](https://developer.android.com/reference/android/widget/CheckBox.html) | [BEMCheckBox](http://cocoapods.org/pods/BEMCheckBox) |
4274

43-
## Sample Usage
4475

45-
| Android Sample | iOS Sample |
46-
| ---------------------------------- | ------------------------------------- |
47-
| ![Sample1](./screens/checkbox.gif) | ![Sample2](./screens/iosCheckbox.gif) |
76+
[](#api)
77+
78+
## API
79+
80+
81+
[](#properties)
82+
83+
## Properties
84+
85+
- **checked** - boolean
86+
- **text** - text to use with the checkbox
87+
- **fillColor** - Color of the checkbox element
88+
- **boxType** - Either 'square' (default) or 'circle'. It's recommended to use 'circle' for radiobuttons. Note that plugin version 3.0.0 switched the default for iOS to 'square' for alignment with Android. Still want `circle` on iOS and `square` on Android? Just make the `boxType` value conditional.
89+
90+
91+
[](#events)
92+
93+
## Events
94+
95+
- **checkedChange** - Use a reference to the CheckBox component to grab it's `checked` property when this event fires to see the new value.
96+
4897

49-
## Usage
98+
[](#api)
99+
100+
## API
101+
102+
- **toggle()** - Change the checked state of the view to the inverse of its current state.
103+
104+
105+
[](#css-styling)
106+
107+
## Css Styling
108+
109+
- **color** - set the text label color
110+
- **font-size** - checkbox is sized to text from here : default 15
111+
- **border-width** - set the line width of the checkbox element: iOS only
112+
113+
114+
[](#styling-android)
115+
116+
## Styling [Android]
117+
118+
- **checkStyle** - set to the name of your drawable
119+
- **checkPadding** - set the padding of the checkbox
50120

51121
###
52122

@@ -56,7 +126,7 @@ tns plugin add @nstudio/[email protected]
56126
xmlns:CheckBox="@nstudio/nativescript-checkbox" loaded="pageLoaded">
57127
<ActionBar title="Native Checkbox" />
58128
<StackLayout>
59-
<CheckBox:CheckBox checked="{{ checkProp }}" text="{{ myCheckText }}" fillColor="{{ myCheckColor }}" id="myCheckbox" />
129+
<CheckBox:CheckBox checked="checkProp" text="myCheckText" fillColor="myCheckColor" id="myCheckbox" />
60130
<CheckBox:CheckBox text="CheckBox Label" checked="false" />
61131
</StackLayout>
62132
</Page>
@@ -141,56 +211,63 @@ And in your template, use it as:
141211

142212
Use `checked` instead of `v-model`. [See #99](https://github.com/nstudio/nativescript-checkbox/issues/99).
143213

144-
## Properties
145214

146-
- **checked** - boolean
147-
- **text** - text to use with the checkbox
148-
- **fillColor** - Color of the checkbox element
149-
- **boxType** - Either 'square' (default) or 'circle'. It's recommended to use 'circle' for radiobuttons. Note that plugin version 3.0.0 switched the default for iOS to 'square' for alignment with Android. Still want `circle` on iOS and `square` on Android? Just make the `boxType` value conditional.
150215

151-
## Events
216+
[](#demos)
152217

153-
- **checkedChange** - Use a reference to the CheckBox component to grab it's `checked` property when this event fires to see the new value.
218+
## Demos
219+
This repository includes Angular, Vue.js, and Svelte demos. In order to run these execute the following in your shell:
220+
```shell
221+
$ git clone https://github.com/@nativescript-community/ui-checkbox
222+
$ cd ui-checkbox
223+
$ npm i
224+
$ npm run setup
225+
$ npm run build # && npm run build.angular
226+
$ cd demo-ng # or demo-vue or demo-svelte
227+
$ ns run ios|android
228+
```
154229

155-
## API
156230

157-
- **toggle()** - Change the checked state of the view to the inverse of its current state.
231+
[](#demos-and-development)
158232

159-
## Css Styling
233+
## Demos and Development
160234

161-
- **color** - set the text label color
162-
- **font-size** - checkbox is sized to text from here : default 15
163-
- **border-width** - set the line width of the checkbox element: iOS only
164235

165-
## Styling [Android]
236+
### Setup
166237

167-
- **checkStyle** - set to the name of your drawable
168-
- **checkPadding** - set the padding of the checkbox
238+
To run the demos, you must clone this repo **recursively**.
239+
240+
```
241+
git clone https://github.com/@nativescript-community/ui-checkbox.git --recursive
242+
```
169243

170-
Add the following to `app/App_Resources/Android/drawable/checkbox_grey.xml`
244+
**Install Dependencies:**
245+
```bash
246+
npm i # or 'yarn install' or 'pnpm install'
247+
```
248+
249+
**Interactive Menu:**
171250

172-
```xml
173-
<?xml version="1.0" encoding="utf-8"?>
251+
To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
174252

175-
<selector xmlns:android="http://schemas.android.com/apk/res/android">
176-
<item android:state_enabled="false" android:state_checked="true" android:drawable="@drawable/ic_checkbox_checked_incomplete" />
177-
<item android:state_enabled="false" android:state_checked="false" android:drawable="@drawable/ic_checkbox_grey_incomplete" />
178-
<item android:state_checked="true" android:drawable="@drawable/ic_checkbox_checked_grey"/>
179-
<item android:state_checked="false" android:drawable="@drawable/ic_checkbox_grey" />
180-
</selector>
253+
### Build
254+
255+
```bash
256+
npm run build
257+
258+
npm run build.angular # or for Angular
181259
```
182260

183-
## Radiobuttons, anyone?
261+
### Demos
262+
263+
```bash
264+
npm run demo.[ng|react|svelte|vue].[ios|android]
184265

185-
Want to use radiobutton behavior for your checkboxes (only one option possible within a group)?
186-
Set `boxType="circle"` and check out the second tab in the [Angular demo](demo-ng/), here's a screenshot:
266+
npm run demo.svelte.ios # Example
267+
```
187268

188-
<img src="./screens/radiobuttons.png" width="225px"/>
269+
[](#questions)
189270

190-
## Contributing & Running Demo Apps
271+
## Questions
191272

192-
- Execute from root:
193-
- For android: `npm run demo.android`
194-
- For iOS: `npm run demo.ios`
195-
- `npm run demo.ng.android` (for angular android)
196-
- `npm run demo.ng.ios` (for angular ios)
273+
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).

config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"readme": true,
3+
"angular": true,
4+
"demos": [
5+
"ng"
6+
]
7+
}

demo-ng

Submodule demo-ng added at df95dbf

0 commit comments

Comments
 (0)