Skip to content

Commit 8654371

Browse files
committed
ng-element-plus
0 parents  commit 8654371

File tree

97 files changed

+2612
-0
lines changed

Some content is hidden

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

97 files changed

+2612
-0
lines changed

.browserslistrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.gitignore

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db
47+
package-lock.json

README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<h1 align="center">
2+
Ng-Element-Plus
3+
</h1>
4+
5+
<div align="center">
6+
7+
Ng-Element-UI extension component.
8+
9+
</div>
10+
11+
## Components completion status
12+
13+
- [x] watermark
14+
15+
## Environment Support
16+
17+
- Angular `^11.0.0` [![npm package](https://img.shields.io/npm/v/ng-element-plus.svg?style=flat-square)](https://www.npmjs.com/package/ng-element-plus)
18+
19+
## Installation
20+
21+
```bash
22+
npm install ng-element-plus
23+
```
24+
25+
## Usage
26+
27+
Import the component modules you want to use into your `app.module.ts`
28+
29+
```typescript
30+
import { NpWatermarkModule } from 'ng-element-plus/watermark';
31+
32+
@NgModule({
33+
imports: [ NpWatermarkModule ]
34+
})
35+
export class AppModule {
36+
}
37+
```
38+
39+
40+
## Development
41+
42+
```bash
43+
$ git clone https://github.com/ng-element/ng-element-plus.git
44+
$ cd ng-element-plus
45+
$ npm install
46+
$ ng serve
47+
```
48+
49+
## License
50+
51+
MIT

angular.json

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"cli": {
4+
"analytics": "5f2ba477-ccfb-46d1-b8fd-0140f10f85bb"
5+
},
6+
"version": 1,
7+
"newProjectRoot": "projects",
8+
"projects": {
9+
"ng-element-plus": {
10+
"projectType": "application",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"style": "scss"
14+
},
15+
"@schematics/angular:application": {
16+
"strict": true
17+
}
18+
},
19+
"root": "",
20+
"sourceRoot": "src",
21+
"prefix": "app",
22+
"architect": {
23+
"build": {
24+
"builder": "@angular-devkit/build-angular:browser",
25+
"options": {
26+
"outputPath": "dist/ng-element-plus",
27+
"index": "src/index.html",
28+
"main": "src/main.ts",
29+
"polyfills": "src/polyfills.ts",
30+
"tsConfig": "tsconfig.app.json",
31+
"aot": true,
32+
"assets": [
33+
"src/favicon.ico",
34+
"src/assets"
35+
],
36+
"styles": [
37+
"node_modules/ng-element-ui/ng-element-ui.css",
38+
"projects/ng-element-plus/ng-element-plus.scss",
39+
"src/styles.scss"
40+
],
41+
"scripts": []
42+
},
43+
"configurations": {
44+
"production": {
45+
"fileReplacements": [
46+
{
47+
"replace": "src/environments/environment.ts",
48+
"with": "src/environments/environment.prod.ts"
49+
}
50+
],
51+
"optimization": true,
52+
"outputHashing": "all",
53+
"sourceMap": false,
54+
"namedChunks": false,
55+
"extractLicenses": true,
56+
"vendorChunk": false,
57+
"buildOptimizer": true,
58+
"budgets": [
59+
{
60+
"type": "initial",
61+
"maximumWarning": "500kb",
62+
"maximumError": "1mb"
63+
},
64+
{
65+
"type": "anyComponentStyle",
66+
"maximumWarning": "2kb",
67+
"maximumError": "4kb"
68+
}
69+
]
70+
}
71+
}
72+
},
73+
"serve": {
74+
"builder": "@angular-devkit/build-angular:dev-server",
75+
"options": {
76+
"browserTarget": "ng-element-plus:build"
77+
},
78+
"configurations": {
79+
"production": {
80+
"browserTarget": "ng-element-plus:build:production"
81+
}
82+
}
83+
},
84+
"extract-i18n": {
85+
"builder": "@angular-devkit/build-angular:extract-i18n",
86+
"options": {
87+
"browserTarget": "ng-element-plus:build"
88+
}
89+
},
90+
"test": {
91+
"builder": "@angular-devkit/build-angular:karma",
92+
"options": {
93+
"main": "src/test.ts",
94+
"polyfills": "src/polyfills.ts",
95+
"tsConfig": "tsconfig.spec.json",
96+
"karmaConfig": "karma.conf.js",
97+
"assets": [
98+
"src/favicon.ico",
99+
"src/assets"
100+
],
101+
"styles": [
102+
"src/styles.scss"
103+
],
104+
"scripts": []
105+
}
106+
},
107+
"lint": {
108+
"builder": "@angular-devkit/build-angular:tslint",
109+
"options": {
110+
"tsConfig": [
111+
"tsconfig.app.json",
112+
"tsconfig.spec.json",
113+
"e2e/tsconfig.json"
114+
],
115+
"exclude": [
116+
"**/node_modules/**"
117+
]
118+
}
119+
},
120+
"e2e": {
121+
"builder": "@angular-devkit/build-angular:protractor",
122+
"options": {
123+
"protractorConfig": "e2e/protractor.conf.js",
124+
"devServerTarget": "ng-element-plus:serve"
125+
},
126+
"configurations": {
127+
"production": {
128+
"devServerTarget": "ng-element-plus:serve:production"
129+
}
130+
}
131+
}
132+
}
133+
},
134+
"ng-element-plus-lib": {
135+
"projectType": "library",
136+
"root": "projects/ng-element-plus",
137+
"sourceRoot": "projects/ng-element-plus",
138+
"prefix": "np",
139+
"architect": {
140+
"build": {
141+
"builder": "@angular-devkit/build-angular:ng-packagr",
142+
"options": {
143+
"tsConfig": "projects/ng-element-plus/tsconfig.lib.json",
144+
"project": "projects/ng-element-plus/ng-package.json"
145+
},
146+
"configurations": {
147+
"production": {
148+
"tsConfig": "projects/ng-element-plus/tsconfig.lib.prod.json"
149+
}
150+
}
151+
},
152+
"test": {
153+
"builder": "@angular-devkit/build-angular:karma",
154+
"options": {
155+
"main": "projects/ng-element-plus/test.ts",
156+
"tsConfig": "projects/ng-element-plus/tsconfig.spec.json",
157+
"karmaConfig": "projects/ng-element-plus/karma.conf.js"
158+
}
159+
},
160+
"lint": {
161+
"builder": "@angular-devkit/build-angular:tslint",
162+
"options": {
163+
"tsConfig": [
164+
"projects/ng-element-plus/tsconfig.lib.json",
165+
"projects/ng-element-plus/tsconfig.spec.json"
166+
],
167+
"exclude": [
168+
"**/node_modules/**"
169+
]
170+
}
171+
}
172+
}
173+
}
174+
},
175+
"defaultProject": "ng-element-plus"
176+
}

e2e/protractor.conf.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// @ts-check
2+
// Protractor configuration file, see link for more information
3+
// https://github.com/angular/protractor/blob/master/lib/config.ts
4+
5+
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
6+
7+
/**
8+
* @type { import("protractor").Config }
9+
*/
10+
exports.config = {
11+
allScriptsTimeout: 11000,
12+
specs: [
13+
'./src/**/*.e2e-spec.ts'
14+
],
15+
capabilities: {
16+
browserName: 'chrome'
17+
},
18+
directConnect: true,
19+
SELENIUM_PROMISE_MANAGER: false,
20+
baseUrl: 'http://localhost:4200/',
21+
framework: 'jasmine',
22+
jasmineNodeOpts: {
23+
showColors: true,
24+
defaultTimeoutInterval: 30000,
25+
print: function() {}
26+
},
27+
onPrepare() {
28+
require('ts-node').register({
29+
project: require('path').join(__dirname, './tsconfig.json')
30+
});
31+
jasmine.getEnv().addReporter(new SpecReporter({
32+
spec: {
33+
displayStacktrace: StacktraceOption.PRETTY
34+
}
35+
}));
36+
}
37+
};

e2e/src/app.e2e-spec.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { browser, logging } from 'protractor';
2+
import { AppPage } from './app.po';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', async () => {
12+
await page.navigateTo();
13+
expect(await page.getTitleText()).toEqual('ng-element-plus app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

e2e/src/app.po.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
async navigateTo(): Promise<unknown> {
5+
return browser.get(browser.baseUrl);
6+
}
7+
8+
async getTitleText(): Promise<string> {
9+
return element(by.css('app-root .content span')).getText();
10+
}
11+
}

0 commit comments

Comments
 (0)