Skip to content

Commit

Permalink
feat: remove angular component
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Feb 8, 2020
1 parent a5d9ec1 commit 90afa39
Show file tree
Hide file tree
Showing 28 changed files with 116 additions and 1,346 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
packages/@(core|vue|react|angular)/@(src|demo)/**/*.d.ts
packages/@(core|vue|react)/@(src|demo)/**/*.d.ts
*.d.ts
34 changes: 1 addition & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
[![Downloads](https://img.shields.io/npm/dm/select2-component.svg)](https://www.npmjs.com/package/select2-component)
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fplantain-00%2Fselect2-component%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/select2-component)

A vuejs, reactjs and angular select component.
A vuejs and reactjs select component.

## features

+ vuejs component
+ reactjs component
+ angular component
+ select one
+ options or groups
+ scroll
Expand All @@ -26,8 +25,6 @@ A vuejs, reactjs and angular select component.
+ placeholder
+ custom component(vuejs and reactjs only)
+ multiple selection
+ material style(angular only)
+ form binding(angular only)

## link css

Expand Down Expand Up @@ -89,32 +86,6 @@ or

the online demo: <https://plantain-00.github.io/select2-component/packages/react/demo>

## angular component

`npm i select2-angular-component`

```ts
import { Select2Module } from "select2-angular-component";

@NgModule({
imports: [BrowserModule, FormsModule, Select2Module],
declarations: [MainComponent],
bootstrap: [MainComponent],
})
class MainModule { }
```

```html
<select2 [data]="data"
[value]="value"
(update)="update($event)">
</select2>
```

the online demo: <https://plantain-00.github.io/select2-component/packages/angular/demo/jit>

the AOT online demo: <https://plantain-00.github.io/select2-component/packages/angular/demo/aot>

## properties and events of the component

name | type | description
Expand All @@ -126,9 +97,6 @@ minCountForSearch | number? = 6 | hide search box if `options.length < minCountF
placeholder | string? | the placeholder string if nothing selected
customSearchEnabled | boolean? | will trigger `search` event, and disable inside filter
multiple | boolean? | select multiple options
material | `""` or `true` | enable material style(angular only)
editPattern | (str: string) => string | use it for change the pattern of the filter search(angular only)
ngModel/id/required/disabled/readonly/tabIndex | just like a `select` control | (angular only)
update | (value: [Select2UpdateValue](#select2-data-structure)) => void | triggered when user select an option
open | () => void | triggered when user open the options
search | (text: string) => void | triggered when search text changed
Expand Down
29 changes: 5 additions & 24 deletions clean-scripts.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
const { Service, executeScriptAsync } = require('clean-scripts')
const { watch } = require('watch-then-execute')

const tsFiles = `"packages/@(core|vue|react|angular)/@(src|demo)/**/*.@(ts|tsx)" "spec/**/*.ts" "screenshots/**/*.ts"`
const tsFiles = `"packages/@(core|vue|react)/@(src|demo)/**/*.@(ts|tsx)" "spec/**/*.ts" "screenshots/**/*.ts"`
const lessFiles = `"packages/core/src/**/*.less"`
const jsFiles = `"*.config.js" "spec/**/*.config.js"`
const excludeTsFiles = `"packages/@(core|vue|react|angular)/@(src|demo)/**/*.d.ts"`
const excludeTsFiles = `"packages/@(core|vue|react)/@(src|demo)/**/*.d.ts"`

const vueTemplateCommand = `file2variable-cli --config packages/vue/src/file2variable.config.js`
const angularTemplateCommand = `file2variable-cli packages/angular/src/index.template.html -o packages/angular/src/variables.ts --html-minify --base packages/angular/src`

const tscCoreSrcCommand = `ngc -p packages/core/src`
const tscCoreSrcCommand = `tsc -p packages/core/src`
const tscVueSrcCommand = `tsc -p packages/vue/src`
const tscReactSrcCommand = `tsc -p packages/react/src`
const tscAngularSrcCommand = `ngc -p packages/angular/src`

const tscCoreDemoCommand = `ngc -p packages/core/demo`
const tscCoreDemoCommand = `tsc -p packages/core/demo`
const tscVueDemoCommand = `tsc -p packages/vue/demo`
const tscReactDemoCommand = `tsc -p packages/react/demo`
const tscAngularDemoCommand = `ngc -p packages/angular/demo`

const webpackVueCommand = `webpack --config packages/vue/demo/webpack.config.js`
const webpackReactCommand = `webpack --config packages/react/demo/webpack.config.js`
const webpackAngularJitCommand = `webpack --config packages/angular/demo/jit/webpack.config.js`
const webpackAngularAotCommand = `webpack --config packages/angular/demo/aot/webpack.config.js`

const revStaticCommand = `rev-static`
const cssCommand = [
Expand Down Expand Up @@ -53,20 +48,11 @@ module.exports = {
isDev ? undefined : `rollup --config packages/react/src/rollup.config.js`,
tscReactDemoCommand,
webpackReactCommand
],
angular: [
angularTemplateCommand,
tscAngularSrcCommand,
tscAngularDemoCommand,
{
webpackAngularJitCommand: isDev ? undefined : webpackAngularJitCommand,
webpackAngularAotCommand
}
]
}
],
css: cssCommand,
clean: `rimraf "packages/@(core|vue|react|angular)/demo/**/@(*.bundle-*.js|*.bundle-*.css)"`
clean: `rimraf "packages/@(core|vue|react)/demo/**/@(*.bundle-*.js|*.bundle-*.css)"`
},
revStaticCommand
],
Expand All @@ -88,19 +74,14 @@ module.exports = {
},
watch: {
vueTemplateCommand: `${vueTemplateCommand} --watch`,
angularTemplateCommand: `${angularTemplateCommand} --watch`,
tscCoreSrcCommand: `${tscCoreSrcCommand} --watch`,
tscVueSrcCommand: `${tscVueSrcCommand} --watch`,
tscReactSrcCommand: `${tscReactSrcCommand} --watch`,
tscAngularSrcCommand: `${tscAngularSrcCommand} --watch`,
tscCoreDemoCommand: `${tscCoreDemoCommand} --watch`,
tscVueDemoCommand: `${tscVueDemoCommand} --watch`,
tscReactDemoCommand: `${tscReactDemoCommand} --watch`,
tscAngularDemoCommand: `${tscAngularDemoCommand} --watch`,
webpackVueCommand: `${webpackVueCommand} --watch`,
webpackReactCommand: `${webpackReactCommand} --watch`,
webpackAngularJitCommand: `${webpackAngularJitCommand} --watch`,
webpackAngularAotCommand: `${webpackAngularAotCommand} --watch`,
less: () => watch(['src/**/*.less'], [], () => executeScriptAsync(cssCommand)),
rev: `${revStaticCommand} --watch`
},
Expand Down
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "select2-component",
"private": true,
"description": "A vuejs, reactjs and angular select component.",
"description": "A vuejs and reactjs select component.",
"scripts": {
"bootstrap": "lerna bootstrap -- --frozen-lockfile",
"build": "clean-scripts build",
Expand All @@ -26,17 +26,14 @@
},
"homepage": "https://github.com/plantain-00/select2-component#readme",
"devDependencies": {
"@angular/compiler": "8.2.14",
"@angular/compiler-cli": "8.2.14",
"@angular/core": "8.2.14",
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@rollup/plugin-commonjs": "11.0.1",
"@rollup/plugin-node-resolve": "7.0.0",
"@types/jasmine": "3.5.2",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-node-resolve": "7.1.1",
"@types/jasmine": "3.5.3",
"@types/puppeteer": "2.0.0",
"@typescript-eslint/eslint-plugin": "2.18.0",
"@typescript-eslint/parser": "2.18.0",
"@typescript-eslint/eslint-plugin": "2.19.0",
"@typescript-eslint/parser": "2.19.0",
"autoprefixer": "9.7.4",
"clean-css-cli": "4.3.0",
"clean-scripts": "1.12.1",
Expand All @@ -58,15 +55,15 @@
"markdownlint-cli": "0.21.0",
"no-unused-export": "1.10.0",
"postcss-cli": "7.1.0",
"puppeteer": "2.1.0",
"puppeteer": "2.1.1",
"rev-static": "3.4.3",
"rimraf": "3.0.1",
"rollup": "1.31.0",
"rollup-plugin-uglify": "6.0.4",
"stylelint": "13.0.0",
"stylelint-config-standard": "19.0.0",
"type-coverage": "2.4.0",
"typescript": "3.5.3",
"typescript": "3.7.5",
"watch-then-execute": "1.1.1",
"webpack": "4.41.5",
"webpack-cli": "3.3.10"
Expand Down
3 changes: 0 additions & 3 deletions packages/angular/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions packages/angular/demo/aot/index.ejs.html

This file was deleted.

11 changes: 0 additions & 11 deletions packages/angular/demo/aot/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/angular/demo/aot/webpack.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions packages/angular/demo/jit/index.ejs.html

This file was deleted.

10 changes: 0 additions & 10 deletions packages/angular/demo/jit/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/angular/demo/jit/webpack.config.js

This file was deleted.

0 comments on commit 90afa39

Please sign in to comment.