ngx-promise-buttons 1.0.0 → 1.0.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.
- package/.editorconfig +13 -0
- package/.github/FUNDING.yml +12 -0
- package/.travis.yml +21 -0
- package/CHANGELOG.md +0 -0
- package/CONTRIBUTING.md +36 -0
- package/README.md +12 -30
- package/angular.json +180 -0
- package/e2e/protractor.conf.js +32 -0
- package/e2e/src/app.e2e-spec.ts +23 -0
- package/e2e/src/app.po.ts +11 -0
- package/e2e/tsconfig.json +13 -0
- package/logo.png +0 -0
- package/package.json +87 -38
- package/projects/ngx-promise-buttons/karma.conf.js +32 -0
- package/projects/ngx-promise-buttons/ng-package.json +10 -0
- package/projects/ngx-promise-buttons/package.json +26 -0
- package/projects/ngx-promise-buttons/src/default-promise-btn-config.ts +10 -0
- package/projects/ngx-promise-buttons/src/index.ts +2 -0
- package/projects/ngx-promise-buttons/src/promise-btn-config.ts +7 -0
- package/projects/ngx-promise-buttons/src/promise-btn.directive.spec.ts +597 -0
- package/projects/ngx-promise-buttons/src/promise-btn.directive.ts +247 -0
- package/projects/ngx-promise-buttons/src/provider.ts +14 -0
- package/projects/ngx-promise-buttons/src/test.ts +16 -0
- package/projects/ngx-promise-buttons/src/user-cfg.ts +3 -0
- package/projects/ngx-promise-buttons/tsconfig.lib.json +27 -0
- package/projects/ngx-promise-buttons/tsconfig.lib.prod.json +10 -0
- package/projects/ngx-promise-buttons/tsconfig.spec.json +17 -0
- package/projects/ngx-promise-buttons/tslint.json +25 -0
- package/projects/ngx-promise-buttons/yarn.lock +9 -0
- package/projects/ngx-promise-buttons-demo/e2e/protractor.conf.js +30 -0
- package/projects/ngx-promise-buttons-demo/e2e/tsconfig.json +14 -0
- package/projects/ngx-promise-buttons-demo/karma.conf.js +56 -0
- package/projects/ngx-promise-buttons-demo/src/app/app.component.css +6 -0
- package/projects/ngx-promise-buttons-demo/src/app/app.component.html +109 -0
- package/projects/ngx-promise-buttons-demo/src/app/app.component.spec.ts +29 -0
- package/projects/ngx-promise-buttons-demo/src/app/app.component.ts +208 -0
- package/projects/ngx-promise-buttons-demo/src/assets/.gitkeep +0 -0
- package/projects/ngx-promise-buttons-demo/src/environments/environment.prod.ts +3 -0
- package/projects/ngx-promise-buttons-demo/src/environments/environment.ts +8 -0
- package/projects/ngx-promise-buttons-demo/src/favicon.ico +0 -0
- package/projects/ngx-promise-buttons-demo/src/index.html +72 -0
- package/projects/ngx-promise-buttons-demo/src/main.ts +11 -0
- package/projects/ngx-promise-buttons-demo/src/polyfills.ts +63 -0
- package/projects/ngx-promise-buttons-demo/src/styles.scss +135 -0
- package/projects/ngx-promise-buttons-demo/tsconfig.app.json +14 -0
- package/projects/ngx-promise-buttons-demo/tsconfig.spec.json +18 -0
- package/projects/ngx-promise-buttons-demo/tslint.json +156 -0
- package/scripts/copy-readme-to-demo.js +15 -0
- package/tsconfig.build-lib.json +32 -0
- package/tsconfig.json +41 -0
- package/wallaby.js +90 -0
- package/fesm2022/ngx-promise-buttons.mjs +0 -261
- package/fesm2022/ngx-promise-buttons.mjs.map +0 -1
- package/types/ngx-promise-buttons.d.ts +0 -79
package/.editorconfig
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Editor configuration, see http://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
|
+
[*.md]
|
|
12
|
+
max_line_length = off
|
|
13
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: [meysamsahragard] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
+
patreon: # Replace with a single Patreon username
|
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
otechie: # Replace with a single Otechie username
|
|
12
|
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
package/.travis.yml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
language: node_js
|
|
2
|
+
node_js:
|
|
3
|
+
- "12"
|
|
4
|
+
|
|
5
|
+
cache:
|
|
6
|
+
yarn: true
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
script:
|
|
10
|
+
- yarn
|
|
11
|
+
- yarn test-coverage
|
|
12
|
+
|
|
13
|
+
addons:
|
|
14
|
+
apt:
|
|
15
|
+
sources:
|
|
16
|
+
- ubuntu-toolchain-r-test
|
|
17
|
+
# required by node-gyp to build some packages
|
|
18
|
+
packages:
|
|
19
|
+
- g++-4.8
|
|
20
|
+
|
|
21
|
+
after_success: 'npm run coveralls'
|
package/CHANGELOG.md
ADDED
|
File without changes
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# How to contribute to this repository
|
|
2
|
+
Create a fork of this repository and check it out.
|
|
3
|
+
|
|
4
|
+
To make everything work you need to symlink the src directory to the app folder once. You can do this manually or by running `npm run link-mod`.
|
|
5
|
+
|
|
6
|
+
Once this is done you can run `npm start` to start the development server.
|
|
7
|
+
|
|
8
|
+
If you implement a new feature it is always a good idea to also add an example of it to the demo application.
|
|
9
|
+
|
|
10
|
+
## Commit guidelines
|
|
11
|
+
In general this repo tries to adhere to the [angular commit guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit).
|
|
12
|
+
|
|
13
|
+
## Dev tasks
|
|
14
|
+
There are several scripts defined in the package.json
|
|
15
|
+
|
|
16
|
+
`npm start`: Starts the development server.
|
|
17
|
+
|
|
18
|
+
`npm run` **test-watch**: Runs the unit tests via karma.
|
|
19
|
+
|
|
20
|
+
`npm run` **test**: Runs the unit tests once.
|
|
21
|
+
|
|
22
|
+
`npm run` **test-coverage**: Runs the unit tests with a coverage report.
|
|
23
|
+
|
|
24
|
+
`npm run` **build**: Creates a compiled version of your library inside the dist folder.
|
|
25
|
+
|
|
26
|
+
`npm run` **demo.deploy**:
|
|
27
|
+
Builds the demo app to demo/dist, copies the readme to it and publishes everything to github pages.
|
|
28
|
+
|
|
29
|
+
`npm run` **release.changelog**:
|
|
30
|
+
Creates a changelog based on the [angular commit conventions](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
|
|
31
|
+
|
|
32
|
+
`npm run` **link-mod**: Creates a symlink to the module inside the demo/src folder. This is required for compiling the app with aot.
|
|
33
|
+
|
|
34
|
+
`npm run` **lint**: Lints all demo and library files
|
|
35
|
+
|
|
36
|
+
`npm run` **e2e**: Runs the end2end tests.
|
package/README.md
CHANGED
|
@@ -27,17 +27,13 @@ Install it via npm:
|
|
|
27
27
|
npm install ngx-promise-buttons -S
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Add it to your app using bootstrapApplication:
|
|
31
31
|
```typescript
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
imports: [
|
|
36
|
-
NgxPromiseButtonModule.forRoot(),
|
|
32
|
+
bootstrapApplication(AppComponent, {
|
|
33
|
+
providers: [
|
|
34
|
+
provideNgxPromiseButtons({ handleCurrentBtnOnly: true }),
|
|
37
35
|
],
|
|
38
|
-
})
|
|
39
|
-
export class MainAppModule {
|
|
40
|
-
}
|
|
36
|
+
});
|
|
41
37
|
```
|
|
42
38
|
Using the buttons is easy. Just pass a promise to the directive:
|
|
43
39
|
```html
|
|
@@ -68,28 +64,14 @@ There are selectors you can use to style. There is the `.is-loading` class on th
|
|
|
68
64
|
|
|
69
65
|
|
|
70
66
|
## Configuration
|
|
71
|
-
|
|
67
|
+
You can pass a config object to provideNgxPromiseButtons:
|
|
72
68
|
```typescript
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// your custom config goes here
|
|
80
|
-
spinnerTpl: '<span class="btn-spinner"></span>',
|
|
81
|
-
// disable buttons when promise is pending
|
|
82
|
-
disableBtn: true,
|
|
83
|
-
// the class used to indicate a pending promise
|
|
84
|
-
btnLoadingClass: 'is-loading',
|
|
85
|
-
// only disable and show is-loading class for clicked button,
|
|
86
|
-
// even when they share the same promise
|
|
87
|
-
handleCurrentBtnOnly: false,
|
|
88
|
-
}),
|
|
89
|
-
],
|
|
90
|
-
})
|
|
91
|
-
export class MainAppModule {
|
|
92
|
-
}
|
|
69
|
+
provideNgxPromiseButtons({
|
|
70
|
+
spinnerTpl: '<span class="btn-spinner"></span>',
|
|
71
|
+
disableBtn: true,
|
|
72
|
+
btnLoadingClass: 'is-loading',
|
|
73
|
+
handleCurrentBtnOnly: false,
|
|
74
|
+
});
|
|
93
75
|
```
|
|
94
76
|
|
|
95
77
|
## Using observables
|
package/angular.json
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"ngx-promise-buttons-demo": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"schematics": {
|
|
9
|
+
"@schematics/angular:component": {
|
|
10
|
+
"style": "scss"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"root": "projects/ngx-promise-buttons-demo",
|
|
14
|
+
"sourceRoot": "projects/ngx-promise-buttons-demo/src",
|
|
15
|
+
"prefix": "app",
|
|
16
|
+
"architect": {
|
|
17
|
+
"build": {
|
|
18
|
+
"builder": "@angular-devkit/build-angular:application",
|
|
19
|
+
"options": {
|
|
20
|
+
"outputPath": {
|
|
21
|
+
"base": "../../dist/demo"
|
|
22
|
+
},
|
|
23
|
+
"index": "projects/ngx-promise-buttons-demo/src/index.html",
|
|
24
|
+
"polyfills": [
|
|
25
|
+
"projects/ngx-promise-buttons-demo/src/polyfills.ts"
|
|
26
|
+
],
|
|
27
|
+
"tsConfig": "projects/ngx-promise-buttons-demo/tsconfig.app.json",
|
|
28
|
+
"assets": [
|
|
29
|
+
"projects/ngx-promise-buttons-demo/src/favicon.ico",
|
|
30
|
+
"projects/ngx-promise-buttons-demo/src/assets"
|
|
31
|
+
],
|
|
32
|
+
"styles": [
|
|
33
|
+
"projects/ngx-promise-buttons-demo/src/styles.scss"
|
|
34
|
+
],
|
|
35
|
+
"scripts": [],
|
|
36
|
+
"extractLicenses": false,
|
|
37
|
+
"sourceMap": true,
|
|
38
|
+
"optimization": false,
|
|
39
|
+
"namedChunks": true,
|
|
40
|
+
"browser": "projects/ngx-promise-buttons-demo/src/main.ts"
|
|
41
|
+
},
|
|
42
|
+
"configurations": {
|
|
43
|
+
"production": {
|
|
44
|
+
"fileReplacements": [
|
|
45
|
+
{
|
|
46
|
+
"replace": "projects/ngx-promise-buttons-demo/src/environments/environment.ts",
|
|
47
|
+
"with": "projects/ngx-promise-buttons-demo/src/environments/environment.prod.ts"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"optimization": true,
|
|
51
|
+
"outputHashing": "all",
|
|
52
|
+
"sourceMap": false,
|
|
53
|
+
"namedChunks": false,
|
|
54
|
+
"extractLicenses": true,
|
|
55
|
+
"budgets": [
|
|
56
|
+
{
|
|
57
|
+
"type": "initial",
|
|
58
|
+
"maximumWarning": "2mb",
|
|
59
|
+
"maximumError": "5mb"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "anyComponentStyle",
|
|
63
|
+
"maximumWarning": "6kb"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"defaultConfiguration": ""
|
|
69
|
+
},
|
|
70
|
+
"serve": {
|
|
71
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
72
|
+
"options": {
|
|
73
|
+
"buildTarget": "ngx-promise-buttons-demo:build"
|
|
74
|
+
},
|
|
75
|
+
"configurations": {
|
|
76
|
+
"production": {
|
|
77
|
+
"buildTarget": "ngx-promise-buttons-demo:build:production"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"extract-i18n": {
|
|
82
|
+
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
83
|
+
"options": {
|
|
84
|
+
"buildTarget": "ngx-promise-buttons-demo:build"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"lint": {
|
|
88
|
+
"builder": "@angular-devkit/build-angular:tslint",
|
|
89
|
+
"options": {
|
|
90
|
+
"tsConfig": [
|
|
91
|
+
"projects/ngx-promise-buttons-demo/tsconfig.app.json",
|
|
92
|
+
"projects/ngx-promise-buttons-demo/e2e/tsconfig.json"
|
|
93
|
+
],
|
|
94
|
+
"exclude": [
|
|
95
|
+
"**/node_modules/**"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"e2e": {
|
|
100
|
+
"builder": "@angular-devkit/build-angular:protractor",
|
|
101
|
+
"options": {
|
|
102
|
+
"protractorConfig": "projects/ngx-promise-buttons-demo/e2e/protractor.conf.js",
|
|
103
|
+
"devServerTarget": "ngx-promise-buttons-demo:serve"
|
|
104
|
+
},
|
|
105
|
+
"configurations": {
|
|
106
|
+
"production": {
|
|
107
|
+
"devServerTarget": "ngx-promise-buttons-demo:serve:production"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"ngx-promise-buttons": {
|
|
114
|
+
"projectType": "library",
|
|
115
|
+
"root": "projects/ngx-promise-buttons",
|
|
116
|
+
"sourceRoot": "projects/ngx-promise-buttons/src",
|
|
117
|
+
"prefix": "lib",
|
|
118
|
+
"architect": {
|
|
119
|
+
"build": {
|
|
120
|
+
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
121
|
+
"options": {
|
|
122
|
+
"tsConfig": "projects/ngx-promise-buttons/tsconfig.lib.json",
|
|
123
|
+
"project": "projects/ngx-promise-buttons/ng-package.json"
|
|
124
|
+
},
|
|
125
|
+
"configurations": {
|
|
126
|
+
"production": {
|
|
127
|
+
"tsConfig": "projects/ngx-promise-buttons/tsconfig.lib.prod.json"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"test": {
|
|
132
|
+
"builder": "@angular-devkit/build-angular:karma",
|
|
133
|
+
"options": {
|
|
134
|
+
"main": "projects/ngx-promise-buttons/src/test.ts",
|
|
135
|
+
"tsConfig": "projects/ngx-promise-buttons/tsconfig.spec.json",
|
|
136
|
+
"karmaConfig": "projects/ngx-promise-buttons/karma.conf.js"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"lint": {
|
|
140
|
+
"builder": "@angular-devkit/build-angular:tslint",
|
|
141
|
+
"options": {
|
|
142
|
+
"tsConfig": [
|
|
143
|
+
"projects/ngx-promise-buttons/tsconfig.lib.json",
|
|
144
|
+
"projects/ngx-promise-buttons/tsconfig.spec.json"
|
|
145
|
+
],
|
|
146
|
+
"exclude": [
|
|
147
|
+
"**/node_modules/**"
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"schematics": {
|
|
155
|
+
"@schematics/angular:component": {
|
|
156
|
+
"type": "component"
|
|
157
|
+
},
|
|
158
|
+
"@schematics/angular:directive": {
|
|
159
|
+
"type": "directive"
|
|
160
|
+
},
|
|
161
|
+
"@schematics/angular:service": {
|
|
162
|
+
"type": "service"
|
|
163
|
+
},
|
|
164
|
+
"@schematics/angular:guard": {
|
|
165
|
+
"typeSeparator": "."
|
|
166
|
+
},
|
|
167
|
+
"@schematics/angular:interceptor": {
|
|
168
|
+
"typeSeparator": "."
|
|
169
|
+
},
|
|
170
|
+
"@schematics/angular:module": {
|
|
171
|
+
"typeSeparator": "."
|
|
172
|
+
},
|
|
173
|
+
"@schematics/angular:pipe": {
|
|
174
|
+
"typeSeparator": "."
|
|
175
|
+
},
|
|
176
|
+
"@schematics/angular:resolver": {
|
|
177
|
+
"typeSeparator": "."
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 } = 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
|
+
baseUrl: 'http://localhost:4200/',
|
|
20
|
+
framework: 'jasmine',
|
|
21
|
+
jasmineNodeOpts: {
|
|
22
|
+
showColors: true,
|
|
23
|
+
defaultTimeoutInterval: 30000,
|
|
24
|
+
print: function() {}
|
|
25
|
+
},
|
|
26
|
+
onPrepare() {
|
|
27
|
+
require('ts-node').register({
|
|
28
|
+
project: require('path').join(__dirname, './tsconfig.json')
|
|
29
|
+
});
|
|
30
|
+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AppPage } from './app.po';
|
|
2
|
+
import { browser, logging } from 'protractor';
|
|
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', () => {
|
|
12
|
+
page.navigateTo();
|
|
13
|
+
expect(page.getTitleText()).toEqual('Welcome to angular-material-css-vars!');
|
|
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
|
+
});
|
package/logo.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,38 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ngx-promise-buttons",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"./
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "ngx-promise-buttons",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+ssh://git@github.com/meysamsahragard/ngx-promise-buttons.git"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"ng": "ng",
|
|
11
|
+
"start": "ng serve",
|
|
12
|
+
"build": "ng build",
|
|
13
|
+
"test": "ng test --browsers ChromeHeadless --watch=false",
|
|
14
|
+
"lint": "ng lint",
|
|
15
|
+
"e2e": "ng e2e",
|
|
16
|
+
"demo": "run-s demo.build demo.copy-readme demo.gh-pages",
|
|
17
|
+
"demo.build": "ng build --aot --configuration production --base-href='./'",
|
|
18
|
+
"demo.copy-readme": "node scripts/copy-readme-to-demo.js",
|
|
19
|
+
"demo.gh-pages": "gh-pages -d dist/demo",
|
|
20
|
+
"lib": "run-s lib.build copy",
|
|
21
|
+
"lib.build": "ng build --configuration production ngx-promise-buttons",
|
|
22
|
+
"copy": "run-s copy.licence copy.readme",
|
|
23
|
+
"copy.licence": "copyfiles ./LICENSE ./dist/ngx-promise-buttons",
|
|
24
|
+
"copy.readme": "copyfiles ./README.md ./dist/ngx-promise-buttons",
|
|
25
|
+
"pub": "run-s lib && cd ./dist/ngx-promise-buttons/ && npm publish && cd .. && cd ..",
|
|
26
|
+
"patch": "npm version patch && cd ./projects/ngx-promise-buttons && npm version patch && cd .. && cd .. && git add . && git commit -am\"chore: update lib version\"",
|
|
27
|
+
"patch-release_": "run-s lib demo patch pub",
|
|
28
|
+
"patch-release": "npm run patch-release_",
|
|
29
|
+
"major": "npm version major && cd ./projects/ngx-promise-buttons && npm version major && cd .. && cd .. && git add . && git commit -am\"chore: update lib version\"",
|
|
30
|
+
"major-release_": "run-s lib demo major pub",
|
|
31
|
+
"major-release": "npm run major-release_",
|
|
32
|
+
"test-coverage": "ng test --browsers ChromeHeadless --code-coverage --watch=false",
|
|
33
|
+
"coveralls": "YOURPACKAGE_COVERAGE=1 cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@angular-devkit/build-angular": "^21.0.4",
|
|
37
|
+
"@angular/cli": "^21.0.4",
|
|
38
|
+
"@angular/common": "^21.0.6",
|
|
39
|
+
"@angular/compiler": "^21.0.6",
|
|
40
|
+
"@angular/compiler-cli": "^21.0.6",
|
|
41
|
+
"@angular/core": "^21.0.6",
|
|
42
|
+
"@angular/forms": "^21.0.6",
|
|
43
|
+
"@angular/platform-browser": "^21.0.6",
|
|
44
|
+
"@angular/platform-browser-dynamic": "^21.0.6",
|
|
45
|
+
"@angular/router": "^21.0.6",
|
|
46
|
+
"@types/bluebird": "^3.5.29",
|
|
47
|
+
"@types/core-js": "^2.5.2",
|
|
48
|
+
"@types/jasmine": "~3.6.0",
|
|
49
|
+
"@types/jquery": "^3.3.32",
|
|
50
|
+
"@types/node": "^13.7.0",
|
|
51
|
+
"angular2-template-loader": "^0.6.2",
|
|
52
|
+
"bluebird": "^3.7.2",
|
|
53
|
+
"bootstrap": "^4.4.1",
|
|
54
|
+
"bootstrap-material-design": "^4.1.2",
|
|
55
|
+
"codelyzer": "^6.0.0",
|
|
56
|
+
"conventional-changelog-cli": "^2.0.31",
|
|
57
|
+
"conventional-github-releaser": "^3.1.3",
|
|
58
|
+
"copyfiles": "^2.2.0",
|
|
59
|
+
"core-js": "^3.6.4",
|
|
60
|
+
"coveralls": "^3.0.9",
|
|
61
|
+
"gh-pages": "^2.2.0",
|
|
62
|
+
"intl": "^1.2.5",
|
|
63
|
+
"jasmine-core": "~3.10",
|
|
64
|
+
"jasmine-spec-reporter": "~5.0.0",
|
|
65
|
+
"jquery": "^3.5.0",
|
|
66
|
+
"karma": "~6.3.16",
|
|
67
|
+
"karma-chrome-launcher": "~3.1.0",
|
|
68
|
+
"karma-cli": "~2.0.0",
|
|
69
|
+
"karma-coverage-istanbul-reporter": "~3.0.2",
|
|
70
|
+
"karma-jasmine": "~4.0.0",
|
|
71
|
+
"karma-jasmine-html-reporter": "^1.5.0",
|
|
72
|
+
"karma-phantomjs-launcher": "^1.0.4",
|
|
73
|
+
"marked": "^2.0.0",
|
|
74
|
+
"ng-packagr": "^21.0.1",
|
|
75
|
+
"npm-run-all": "^4.1.5",
|
|
76
|
+
"protractor": "~7.0.0",
|
|
77
|
+
"reflect-metadata": "^0.1.13",
|
|
78
|
+
"rxjs": "^6.5.4",
|
|
79
|
+
"ts-node": "~8.6.2",
|
|
80
|
+
"tslib": "^2.0.0",
|
|
81
|
+
"tslint": "~6.1.0",
|
|
82
|
+
"typescript": "~5.9.3",
|
|
83
|
+
"wallaby-webpack": "3.9.15",
|
|
84
|
+
"web-animations-js": "^2.3.2",
|
|
85
|
+
"zone.js": "~0.15.1"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: '',
|
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
+
plugins: [
|
|
9
|
+
require('karma-jasmine'),
|
|
10
|
+
require('karma-chrome-launcher'),
|
|
11
|
+
require('karma-jasmine-html-reporter'),
|
|
12
|
+
require('karma-coverage-istanbul-reporter'),
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
+
],
|
|
15
|
+
client: {
|
|
16
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
17
|
+
},
|
|
18
|
+
coverageIstanbulReporter: {
|
|
19
|
+
dir: require('path').join(__dirname, '../../coverage/ngx-promise-buttons'),
|
|
20
|
+
reports: ['html', 'lcovonly', 'text-summary'],
|
|
21
|
+
fixWebpackSourcePaths: true
|
|
22
|
+
},
|
|
23
|
+
reporters: ['progress', 'kjhtml'],
|
|
24
|
+
port: 9876,
|
|
25
|
+
colors: true,
|
|
26
|
+
logLevel: config.LOG_INFO,
|
|
27
|
+
autoWatch: true,
|
|
28
|
+
browsers: ['Chrome'],
|
|
29
|
+
singleRun: false,
|
|
30
|
+
restartOnFileChange: true
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ngx-promise-buttons",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Chilled loading buttons for angular",
|
|
5
|
+
"author": "meysamsahragard <contact@super-productivity.com> (http://super-productivity.com)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+ssh://git@github.com/meysamsahragard/ngx-promise-buttons.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"angular",
|
|
13
|
+
"javascript",
|
|
14
|
+
"typescript",
|
|
15
|
+
"button",
|
|
16
|
+
"promise",
|
|
17
|
+
"spinner"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"tslib": "^2.0.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@angular/common": ">=9.0.4",
|
|
24
|
+
"@angular/core": ">=9.0.4"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {PromiseBtnConfig} from './promise-btn-config';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_CFG: PromiseBtnConfig = {
|
|
4
|
+
spinnerTpl: '<span class="btn-spinner"></span>',
|
|
5
|
+
disableBtn: true,
|
|
6
|
+
btnLoadingClass: 'is-loading',
|
|
7
|
+
handleCurrentBtnOnly: false,
|
|
8
|
+
minDuration: null,
|
|
9
|
+
};
|
|
10
|
+
|