Kaynağa Gözat

@uppy/angular: update ng version (#3503)

* @uppy/angular: update ng version

* hack to allow the publish of the Angular package

* fix @types/webpack-dev-server resolution (the package is deprecated anyway)

* Add Storybook back

* Fix default value of Input

* Update README

* Apply suggestions from code review

* fix @types/react version conflict

* Update packages/@uppy/angular/.storybook/tsconfig.json
Antoine du Hamel 3 yıl önce
ebeveyn
işleme
666f6acd88
51 değiştirilmiş dosya ile 727 ekleme ve 291 silme
  1. 2 0
      .github/workflows/release.yml
  2. 4 1
      package.json
  3. 1 1
      packages/@uppy/angular/.gitignore
  4. 0 1
      packages/@uppy/angular/.npmignore
  5. 14 3
      packages/@uppy/angular/.storybook/main.js
  6. 0 1
      packages/@uppy/angular/.storybook/preview-head.html
  7. 14 0
      packages/@uppy/angular/.storybook/preview.js
  8. 4 2
      packages/@uppy/angular/.storybook/tsconfig.json
  9. 12 22
      packages/@uppy/angular/README.md
  10. 15 24
      packages/@uppy/angular/angular.json
  11. 33 50
      packages/@uppy/angular/package.json
  12. 0 13
      packages/@uppy/angular/projects/angular/README.md
  13. 1 1
      packages/@uppy/angular/projects/uppy/angular/.eslintrc.json
  14. 33 0
      packages/@uppy/angular/projects/uppy/angular/README.md
  15. 0 0
      packages/@uppy/angular/projects/uppy/angular/karma.conf.js
  16. 0 0
      packages/@uppy/angular/projects/uppy/angular/ng-package.json
  17. 4 1
      packages/@uppy/angular/projects/uppy/angular/package.json
  18. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal-demo.component.ts
  19. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.component.spec.ts
  20. 8 8
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.component.ts
  21. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.module.ts
  22. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.stories.ts
  23. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard-demo.component.ts
  24. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.component.spec.ts
  25. 2 2
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.component.ts
  26. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.module.ts
  27. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.stories.ts
  28. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop-demo.component.ts
  29. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.spec.ts
  30. 2 2
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.ts
  31. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.module.ts
  32. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.stories.ts
  33. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar-demo.component.ts
  34. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.spec.ts
  35. 2 2
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.ts
  36. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.module.ts
  37. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.stories.ts
  38. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar-demo.component.ts
  39. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.component.spec.ts
  40. 2 2
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.component.ts
  41. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.module.ts
  42. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.stories.ts
  43. 12 9
      packages/@uppy/angular/projects/uppy/angular/src/lib/utils/wrapper.ts
  44. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/public-api.ts
  45. 0 0
      packages/@uppy/angular/projects/uppy/angular/src/test.ts
  46. 1 1
      packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.json
  47. 0 0
      packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.prod.json
  48. 1 1
      packages/@uppy/angular/projects/uppy/angular/tsconfig.spec.json
  49. 0 19
      packages/@uppy/angular/tsconfig.base.json
  50. 35 14
      packages/@uppy/angular/tsconfig.json
  51. 525 111
      yarn.lock

+ 2 - 0
.github/workflows/release.yml

@@ -31,6 +31,8 @@ jobs:
         run: cp README.md packages/uppy/.
       - name: Build before publishing
         run: corepack yarn run build
+      - name: Hack to allow the publish of the Angular package
+        run: corepack yarn workspace @uppy/angular prepublishOnly
       - name: Login to NPM
         run: corepack yarn config set npmAuthToken ${{ toJSON(secrets.NPM_TOKEN) }}
       - name: Publish to NPM

+ 4 - 1
package.json

@@ -32,6 +32,7 @@
   "workspaces": [
     "examples/*",
     "packages/@uppy/*",
+    "packages/@uppy/angular/projects/uppy/*",
     "packages/uppy",
     "private/*",
     "test/endtoend",
@@ -129,7 +130,7 @@
     "build:companion": "yarn workspace @uppy/companion build",
     "build:css": "yarn node ./bin/build-css.js",
     "build:svelte": "yarn workspace @uppy/svelte build",
-    "build:angular": "yarn workspace @uppy/angular build:release",
+    "build:angular": "yarn workspace angular build:release",
     "build:js": "npm-run-all build:lib build:companion build:locale-pack build:svelte build:angular build:bundle",
     "build:lib": "yarn node ./bin/build-lib.js",
     "build:locale-pack": "yarn workspace @uppy-dev/locale-pack build && eslint packages/@uppy/locales/src/en_US.js --fix && yarn workspace @uppy-dev/locale-pack test unused",
@@ -201,6 +202,8 @@
   "resolutions": {
     "@types/redis": "2",
     "@types/eslint@^7.2.13": "^8.2.0",
+    "@types/react": "^17",
+    "@types/webpack-dev-server": "^4",
     "npm-auth-to-token@1.0.0": "patch:npm-auth-to-token@npm:1.0.0#.yarn/patches/npm-auth-to-token-npm-1.0.0-c288ce201f",
     "babel-plugin-transform-commonjs@1.1.6": "patch:babel-plugin-transform-commonjs@npm:1.1.6#.yarn/patches/babel-plugin-transform-commonjs-npm-1.1.6-0007fa2809",
     "exifr": "patch:exifr@npm:7.1.3#.yarn/patches/exifr-npm-7.1.3-e3f1c7a57d"

+ 1 - 1
packages/@uppy/angular/.gitignore

@@ -14,7 +14,6 @@
 
 # profiling files
 chrome-profiler-events*.json
-speed-measure-plugin*.json
 
 # IDEs and editors
 /.idea
@@ -34,6 +33,7 @@ speed-measure-plugin*.json
 .history/*
 
 # misc
+/.angular/cache
 /.sass-cache
 /connect.lock
 /coverage

+ 0 - 1
packages/@uppy/angular/.npmignore

@@ -1 +0,0 @@
-# This file need to be there so .gitignored files are still uploaded to the npm registry.

+ 14 - 3
packages/@uppy/angular/.storybook/main.js

@@ -1,4 +1,15 @@
 module.exports = {
-  stories: ['../projects/**/*.stories.ts'],
-  addons: ['@storybook/addon-actions', '@storybook/addon-links', '@storybook/addon-notes'],
-};
+  "stories": [
+    "../stories/**/*.stories.mdx",
+    "../stories/**/*.stories.@(js|jsx|ts|tsx)"
+  ],
+  "addons": [
+    "@storybook/addon-links",
+    "@storybook/addon-essentials",
+    "@storybook/addon-interactions"
+  ],
+  "framework": "@storybook/angular",
+  "core": {
+    "builder": "webpack5"
+  }
+}

+ 0 - 1
packages/@uppy/angular/.storybook/preview-head.html

@@ -1 +0,0 @@
-<link href="https://transloadit.edgly.net/releases/uppy/v1.18.0/uppy.min.css" rel="stylesheet">

+ 14 - 0
packages/@uppy/angular/.storybook/preview.js

@@ -0,0 +1,14 @@
+import { setCompodocJson } from "@storybook/addon-docs/angular";
+import docJson from "../documentation.json";
+setCompodocJson(docJson);
+
+export const parameters = {
+  actions: { argTypesRegex: "^on[A-Z].*" },
+  controls: {
+    matchers: {
+      color: /(background|color)$/i,
+      date: /Date$/,
+    },
+  },
+  docs: { inlineStories: true },
+}

+ 4 - 2
packages/@uppy/angular/.storybook/tsconfig.json

@@ -1,9 +1,10 @@
 {
-  "extends": "../projects/angular/tsconfig.lib.json",
+  "extends": "../projects/uppy/angular/tsconfig.lib.json",
   "compilerOptions": {
     "types": [
       "node"
-    ]
+    ],
+    "allowSyntheticDefaultImports": true
   },
   "exclude": [
     "../src/test.ts",
@@ -11,6 +12,7 @@
     "../projects/**/*.spec.ts"
   ],
   "include": [
+    "../src/**/*",
     "../projects/**/*"
   ],
   "files": [

+ 12 - 22
packages/@uppy/angular/README.md

@@ -1,33 +1,23 @@
-# @uppy/angular
+# Angular
 
-<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
+This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.4.
 
-<a href="https://www.npmjs.com/package/@uppy/angular"><img src="https://img.shields.io/npm/v/@uppy/angular.svg?style=flat-square"></a> <a href="https://travis-ci.org/transloadit/uppy"><img src="https://img.shields.io/travis/transloadit/uppy/main.svg?style=flat-square" alt="Build Status"></a>
+## Development server
 
-Angular component wrappers around Uppy’s officially maintained UI plugins.
+Run `yarn workspace angular start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
 
-Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
+## Code scaffolding
 
-## Example
+Run `yarn workspace angular ng generate component component-name` to generate a new component. You can also use `yarn workspace angular ng generate directive|pipe|service|class|guard|interface|enum|module`.
 
-```ts
-// TODO
-```
+## Build
 
-## Installation
+Run `yarn build:angular` to build the project. The build artifacts will be stored in the `dist/` directory.
 
-```bash
-$ npm install @uppy/angular --save
-```
+## Running unit tests
 
-We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
+Run `yarn workspace angular test` to execute the unit tests via [Karma](https://karma-runner.github.io).
 
-Alternatively, you can also use this plugin in a pre-built bundle from Transloadit’s CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
+## Further help
 
-## Documentation
-
-Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/).
-
-## License
-
-[The MIT License](./LICENSE).
+To get more help on the Angular CLI use `yarn workspace angular ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

+ 15 - 24
packages/@uppy/angular/angular.json

@@ -3,46 +3,37 @@
   "version": 1,
   "newProjectRoot": "projects",
   "projects": {
-    "angular": {
+    "@uppy/angular": {
       "projectType": "library",
-      "root": "projects/angular",
-      "sourceRoot": "projects/angular/src",
-      "prefix": "uppy",
+      "root": "projects/uppy/angular",
+      "sourceRoot": "projects/uppy/angular/src",
+      "prefix": "lib",
       "architect": {
         "build": {
           "builder": "@angular-devkit/build-angular:ng-packagr",
           "options": {
-            "tsConfig": "projects/angular/tsconfig.lib.json",
-            "project": "projects/angular/ng-package.json"
+            "project": "projects/uppy/angular/ng-package.json"
           },
           "configurations": {
             "production": {
-              "tsConfig": "projects/angular/tsconfig.lib.prod.json"
+              "tsConfig": "projects/uppy/angular/tsconfig.lib.prod.json"
+            },
+            "development": {
+              "tsConfig": "projects/uppy/angular/tsconfig.lib.json"
             }
-          }
+          },
+          "defaultConfiguration": "production"
         },
         "test": {
           "builder": "@angular-devkit/build-angular:karma",
           "options": {
-            "main": "projects/angular/src/test.ts",
-            "tsConfig": "projects/angular/tsconfig.spec.json",
-            "karmaConfig": "projects/angular/karma.conf.js"
-          }
-        },
-        "lint": {
-          "builder": "@angular-eslint/builder:lint",
-          "options": {
-            "lintFilePatterns": [
-              "projects/angular/**/*.ts",
-              "projects/angular/**/*.html"
-            ]
+            "main": "projects/uppy/angular/src/test.ts",
+            "tsConfig": "projects/uppy/angular/tsconfig.spec.json",
+            "karmaConfig": "projects/uppy/angular/karma.conf.js"
           }
         }
       }
     }
   },
-  "defaultProject": "angular",
-  "cli": {
-    "defaultCollection": "@angular-eslint/schematics"
-  }
+  "defaultProject": "@uppy/angular"
 }

+ 33 - 50
packages/@uppy/angular/package.json

@@ -1,18 +1,18 @@
 {
-  "name": "@uppy/angular",
-  "version": "0.2.8",
-  "module": "dist/angular/esm2020/public-api.mjs",
-  "types": "dist/angular/uppy-angular.d.ts",
+  "name": "angular",
+  "version": "0.0.0",
   "scripts": {
     "ng": "ng",
-    "start": "start-storybook -p 6006",
-    "build": "ng build",
-    "build:release": "ng build --prod",
-    "test": "ng test",
-    "lint": "ng lint",
-    "e2e": "ng e2e",
-    "build-storybook": "build-storybook"
+    "start": "ng serve",
+    "build": "ng build @uppy/angular --configuration development",
+    "build:release": "ng build",
+    "build-storybook": "npm run docs:json && build-storybook",
+    "docs:json": "compodoc -p ./tsconfig.json -e json -d .",
+    "storybook": "npm run docs:json && start-storybook -p 6006",
+    "watch": "ng build --watch --configuration development",
+    "test": "ng test"
   },
+  "private": true,
   "dependencies": {
     "@angular/animations": ">= 11",
     "@angular/common": ">= 11",
@@ -27,55 +27,38 @@
     "@uppy/progress-bar": "workspace:^",
     "@uppy/status-bar": "workspace:^",
     "prop-types": "^15.7.2",
-    "rxjs": "^6.5.3",
-    "tslib": "^2.0.0",
-    "zone.js": "~0.11.3"
+    "rxjs": "~7.4.0",
+    "tslib": "^2.3.0",
+    "zone.js": "~0.11.4"
   },
   "peerDependencies": {
     "@uppy/core": ">=1"
   },
   "devDependencies": {
     "@angular-devkit/build-angular": ">= 11",
-    "@angular-eslint/builder": ">= 11",
-    "@angular-eslint/eslint-plugin": ">= 11",
-    "@angular-eslint/eslint-plugin-template": ">= 11",
-    "@angular-eslint/schematics": ">= 11",
-    "@angular-eslint/template-parser": ">= 11",
     "@angular/cli": ">= 11",
     "@angular/compiler-cli": ">= 11",
-    "@babel/core": "^7.10.5",
-    "@storybook/addon-actions": "^6.2.7",
-    "@storybook/addon-links": "^6.2.7",
-    "@storybook/addon-notes": "^5.3.19",
-    "@storybook/addons": "^5.3.21",
-    "@storybook/angular": "^6.2.7",
-    "@types/jasmine": "~3.6.0",
-    "@types/jasminewd2": "~2.0.3",
+    "@babel/core": "^7.17.5",
+    "@compodoc/compodoc": "^1.1.19",
+    "@storybook/addon-actions": "^6.5.0-alpha.42",
+    "@storybook/addon-essentials": "^6.5.0-alpha.42",
+    "@storybook/addon-interactions": "^6.5.0-alpha.42",
+    "@storybook/addon-links": "^6.5.0-alpha.42",
+    "@storybook/angular": "^6.5.0-alpha.42",
+    "@storybook/builder-webpack5": "^6.5.0-alpha.42",
+    "@storybook/manager-webpack5": "^6.5.0-alpha.42",
+    "@storybook/testing-library": "^0.0.9",
+    "@types/jasmine": "~3.10.0",
     "@types/node": "^12.11.1",
-    "@typescript-eslint/eslint-plugin": "^5.0.0",
-    "@typescript-eslint/parser": "^5.0.0",
-    "babel-loader": "^8.1.0",
-    "eslint": "^8.0.0",
-    "eslint-plugin-import": "^2.22.1",
-    "eslint-plugin-jsdoc": "^37.0.0",
-    "eslint-plugin-prefer-arrow": "^1.2.3",
-    "jasmine-core": "~3.6.0",
-    "jasmine-spec-reporter": "~7.0.0",
-    "karma": "~6.3.9",
+    "babel-loader": "^8.2.3",
+    "jasmine-core": "~3.10.0",
+    "karma": "~6.3.0",
     "karma-chrome-launcher": "~3.1.0",
-    "karma-coverage-istanbul-reporter": "~3.0.2",
+    "karma-coverage": "~2.0.3",
+    "karma-coverage-istanbul-reporter": "^3.0.3",
     "karma-jasmine": "~4.0.0",
-    "karma-jasmine-html-reporter": "^1.5.0",
+    "karma-jasmine-html-reporter": "~1.7.0",
     "ng-packagr": "^13.0.0",
-    "protractor": "~7.0.0",
-    "redux": "^4.1.2",
-    "ts-node": "~8.3.0",
-    "typescript": "~4.4"
-  },
-  "publishConfig": {
-    "access": "public"
-  },
-  "files": [
-    "/dist"
-  ]
+    "typescript": "~4.4.3"
+  }
 }

+ 0 - 13
packages/@uppy/angular/projects/angular/README.md

@@ -1,13 +0,0 @@
-# Uppy Angular Integration
-
-## Build
-
-Run `ng build @uppy/angular` to build the project. The build artifacts will be stored in the `dist/` directory.
-
-## Publishing
-
-After building your library with `ng build @uppy/angular`, go to the dist folder `cd dist/@uppy/angular` and run `npm publish`.
-
-## Running unit tests
-
-Run `ng test @uppy/angular` to execute the unit tests via [Karma](https://karma-runner.github.io).

+ 1 - 1
packages/@uppy/angular/projects/angular/.eslintrc.json → packages/@uppy/angular/projects/uppy/angular/.eslintrc.json

@@ -1,5 +1,5 @@
 {
-  "extends": "../../.eslintrc.json",
+  "extends": "../../../.eslintrc.json",
   "ignorePatterns": [
     "!**/*"
   ],

+ 33 - 0
packages/@uppy/angular/projects/uppy/angular/README.md

@@ -0,0 +1,33 @@
+# @uppy/angular
+
+<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
+
+<a href="https://www.npmjs.com/package/@uppy/angular"><img src="https://img.shields.io/npm/v/@uppy/angular.svg?style=flat-square"></a> <a href="https://travis-ci.org/transloadit/uppy"><img src="https://img.shields.io/travis/transloadit/uppy/main.svg?style=flat-square" alt="Build Status"></a>
+
+Angular component wrappers around Uppy’s officially maintained UI plugins.
+
+Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
+
+## Example
+
+```ts
+// TODO
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/angular --save
+```
+
+We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
+
+Alternatively, you can also use this plugin in a pre-built bundle from Transloadit’s CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
+
+## Documentation
+
+Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/).
+
+## License
+
+[The MIT License](./LICENSE).

+ 0 - 0
packages/@uppy/angular/projects/angular/karma.conf.js → packages/@uppy/angular/projects/uppy/angular/karma.conf.js


+ 0 - 0
packages/@uppy/angular/projects/angular/ng-package.json → packages/@uppy/angular/projects/uppy/angular/ng-package.json


+ 4 - 1
packages/@uppy/angular/projects/angular/package.json → packages/@uppy/angular/projects/uppy/angular/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@uppy/angular",
   "description": "Angular component wrappers around Uppy's official UI plugins.",
-  "version": "0.0.1",
+  "version": "0.2.8",
   "license": "MIT",
   "homepage": "https://uppy.io",
   "keywords": [
@@ -18,6 +18,9 @@
     "type": "git",
     "url": "git+https://github.com/transloadit/uppy.git"
   },
+  "scripts": {
+    "prepublishOnly": "rm -fr * && cp -r ../../dist/angular .."
+  },
   "peerDependencies": {
     "@angular/common": ">= 11",
     "@angular/core": ">= 11",

+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard-modal/dashboard-modal-demo.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal-demo.component.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard-modal/dashboard-modal.component.spec.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.component.spec.ts


+ 8 - 8
packages/@uppy/angular/projects/angular/src/lib/components/dashboard-modal/dashboard-modal.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.component.ts

@@ -10,9 +10,9 @@ import { UppyAngularWrapper } from '../../utils/wrapper';
   changeDetection: ChangeDetectionStrategy.OnPush
 })
 export class DashboardModalComponent extends UppyAngularWrapper<Dashboard> implements OnDestroy, OnChanges {
-  @Input() uppy: Uppy;
-  @Input() props: DashboardOptions;
-  @Input() open: boolean;
+  @Input() uppy: Uppy = new Uppy;
+  @Input() props: DashboardOptions = {};
+  @Input() open: boolean = false;
 
   constructor(public el: ElementRef) {
     super();
@@ -29,12 +29,12 @@ export class DashboardModalComponent extends UppyAngularWrapper<Dashboard> imple
   ngOnChanges(changes: SimpleChanges): void {
     this.handleChanges(changes, Dashboard);
     // Handle dashboard-modal specific changes
-    if (changes.open && this.open !== changes.open.previousValue) {
-      if(this.open && !changes.open.previousValue) {
-        this.plugin.openModal()
+    if (changes['open'] && this.open !== changes['open'].previousValue) {
+      if(this.open && !changes['open'].previousValue) {
+        this.plugin!.openModal()
       }
-      if (!this.open && changes.open.previousValue) {
-        this.plugin.closeModal()
+      if (!this.open && changes['open'].previousValue) {
+        this.plugin!.closeModal()
       }
     }
   }

+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard-modal/dashboard-modal.module.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.module.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard-modal/dashboard-modal.stories.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.stories.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard/dashboard-demo.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard-demo.component.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard/dashboard.component.spec.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.component.spec.ts


+ 2 - 2
packages/@uppy/angular/projects/angular/src/lib/components/dashboard/dashboard.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.component.ts

@@ -10,8 +10,8 @@ import { UppyAngularWrapper } from '../../utils/wrapper';
   changeDetection: ChangeDetectionStrategy.OnPush
 })
 export class DashboardComponent extends UppyAngularWrapper implements OnDestroy, OnChanges {
-  @Input() uppy: Uppy;
-  @Input() props: DashboardOptions;
+  @Input() uppy: Uppy = new Uppy;
+  @Input() props: DashboardOptions = {};
 
   constructor(public el: ElementRef) {
     super();

+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard/dashboard.module.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.module.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/dashboard/dashboard.stories.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/dashboard/dashboard.stories.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/drag-drop/drag-drop-demo.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop-demo.component.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/drag-drop/drag-drop.component.spec.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.spec.ts


+ 2 - 2
packages/@uppy/angular/projects/angular/src/lib/components/drag-drop/drag-drop.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.ts

@@ -10,8 +10,8 @@ import { UppyAngularWrapper } from '../../utils/wrapper';
   changeDetection: ChangeDetectionStrategy.OnPush
 })
 export class DragDropComponent extends UppyAngularWrapper implements OnDestroy, OnChanges {
-  @Input() uppy: Uppy;
-  @Input() props: DragDropOptions;
+  @Input() uppy: Uppy = new Uppy;
+  @Input() props: DragDropOptions = {};
 
   constructor(public el: ElementRef) {
     super();

+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/drag-drop/drag-drop.module.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.module.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/drag-drop/drag-drop.stories.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.stories.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/progress-bar/progress-bar-demo.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar-demo.component.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/progress-bar/progress-bar.component.spec.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.spec.ts


+ 2 - 2
packages/@uppy/angular/projects/angular/src/lib/components/progress-bar/progress-bar.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.ts

@@ -10,8 +10,8 @@ import { UppyAngularWrapper } from '../../utils/wrapper';
   changeDetection: ChangeDetectionStrategy.OnPush
 })
 export class ProgressBarComponent extends UppyAngularWrapper implements OnDestroy, OnChanges {
-  @Input() uppy: Uppy;
-  @Input() props: ProgressBarOptions;
+  @Input() uppy: Uppy = new Uppy;
+  @Input() props: ProgressBarOptions = {};
 
   constructor(public el: ElementRef) {
     super();

+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/progress-bar/progress-bar.module.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.module.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/progress-bar/progress-bar.stories.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.stories.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/status-bar/status-bar-demo.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar-demo.component.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/status-bar/status-bar.component.spec.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.component.spec.ts


+ 2 - 2
packages/@uppy/angular/projects/angular/src/lib/components/status-bar/status-bar.component.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.component.ts

@@ -10,8 +10,8 @@ import { UppyAngularWrapper } from '../../utils/wrapper';
   changeDetection: ChangeDetectionStrategy.OnPush
 })
 export class StatusBarComponent extends UppyAngularWrapper implements OnDestroy, OnChanges  {
-  @Input() uppy: Uppy;
-  @Input() props: StatusBarOptions;
+  @Input() uppy: Uppy = new Uppy;
+  @Input() props: StatusBarOptions = {};
 
   constructor(public el: ElementRef) {
     super();

+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/status-bar/status-bar.module.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.module.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/lib/components/status-bar/status-bar.stories.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/components/status-bar/status-bar.stories.ts


+ 12 - 9
packages/@uppy/angular/projects/angular/src/lib/utils/wrapper.ts → packages/@uppy/angular/projects/uppy/angular/src/lib/utils/wrapper.ts

@@ -1,14 +1,17 @@
-import { Uppy, UIPlugin } from '@uppy/core';
-import { ElementRef, SimpleChanges } from '@angular/core';
+import type { Uppy, UIPlugin } from '@uppy/core';
+import type { ElementRef, SimpleChanges } from '@angular/core';
+import type { DragDropOptions } from '@uppy/drag-drop';
+import type { StatusBarOptions } from '@uppy/status-bar';
+import type { ProgressBarOptions } from '@uppy/progress-bar';
 
 export abstract class UppyAngularWrapper<PluginType extends UIPlugin  = UIPlugin> {
-    abstract props;
+    abstract props: DragDropOptions|StatusBarOptions|ProgressBarOptions;
     abstract el: ElementRef
     abstract uppy: Uppy;
     private options: any;
-    plugin: PluginType;
+    plugin: PluginType | undefined;
 
-    onMount(defaultOptions, plugin) {
+    onMount(defaultOptions: Record<string, unknown>, plugin: new (uppy: Uppy, opts: Record<string, unknown>) => UIPlugin) {
       this.options = {
         ...defaultOptions,
         ...this.props,
@@ -20,20 +23,20 @@ export abstract class UppyAngularWrapper<PluginType extends UIPlugin  = UIPlugin
 
     handleChanges(changes: SimpleChanges, plugin: any): void {
       // Without the last part of this conditional, it tries to uninstall before the plugin is mounted
-      if (changes.uppy && this.uppy !== changes.uppy.previousValue && changes.uppy.previousValue !== undefined) {
-          this.uninstall(changes.uppy.previousValue);
+      if (changes['uppy'] && this.uppy !== changes['uppy'].previousValue && changes['uppy'].previousValue !== undefined) {
+          this.uninstall(changes['uppy'].previousValue);
           this.uppy.use(plugin, this.options);
       }
       this.options = { ...this.options, ...this.props }
       this.plugin = this.uppy.getPlugin(this.options.id) as PluginType;
-      if(changes.props && this.props !== changes.props.previousValue && changes.props.previousValue !== undefined) {
+      if(changes['props'] && this.props !== changes['props'].previousValue && changes['props'].previousValue !== undefined) {
         this.plugin.setOptions({ ...this.options })
       }
     }
 
     uninstall(uppy = this.uppy): void {
         console.log('Uninstalling...')
-        uppy.removePlugin(this.plugin);
+        uppy.removePlugin(this.plugin!);
     }
 
 }

+ 0 - 0
packages/@uppy/angular/projects/angular/src/public-api.ts → packages/@uppy/angular/projects/uppy/angular/src/public-api.ts


+ 0 - 0
packages/@uppy/angular/projects/angular/src/test.ts → packages/@uppy/angular/projects/uppy/angular/src/test.ts


+ 1 - 1
packages/@uppy/angular/projects/angular/tsconfig.lib.json → packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.json

@@ -1,5 +1,5 @@
 {
-  "extends": "../../tsconfig.base.json",
+  "extends": "../../../tsconfig.json",
   "compilerOptions": {
     "outDir": "../../out-tsc/lib",
     "target": "es2015",

+ 0 - 0
packages/@uppy/angular/projects/angular/tsconfig.lib.prod.json → packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.prod.json


+ 1 - 1
packages/@uppy/angular/projects/angular/tsconfig.spec.json → packages/@uppy/angular/projects/uppy/angular/tsconfig.spec.json

@@ -1,6 +1,6 @@
 /* To learn more about this file see: https://angular.io/config/tsconfig. */
 {
-  "extends": "../../tsconfig.base.json",
+  "extends": "../../../tsconfig.json",
   "compilerOptions": {
     "outDir": "../../out-tsc/spec",
     "types": [

+ 0 - 19
packages/@uppy/angular/tsconfig.base.json

@@ -1,19 +0,0 @@
-{
-  "compileOnSave": false,
-  "compilerOptions": {
-    "baseUrl": "./",
-    "outDir": "./dist/out-tsc",
-    "sourceMap": true,
-    "declaration": false,
-    "downlevelIteration": true,
-    "experimentalDecorators": true,
-    "moduleResolution": "node",
-    "importHelpers": true,
-    "target": "es2015",
-    "module": "es2020",
-    "lib": ["es2018", "dom"],
-    "paths": {
-      "angular": ["dist/angular/angular", "dist/angular"]
-    }
-  }
-}

+ 35 - 14
packages/@uppy/angular/tsconfig.json

@@ -1,17 +1,38 @@
-/*
-  This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
-  It is not intended to be used to perform a compilation.
-
-  To learn more about this file see: https://angular.io/config/solution-tsconfig.
-*/
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
 {
-  "files": [],
-  "references": [
-    {
-      "path": "./projects/angular/tsconfig.lib.json"
+  "compileOnSave": false,
+  "compilerOptions": {
+    "paths": {
+      "@uppy/angular": [
+        "dist/uppy/angular/uppy-angular",
+        "dist/uppy/angular"
+      ]
     },
-    {
-      "path": "./projects/angular/tsconfig.spec.json"
-    }
-]
+    "baseUrl": "./",
+    "outDir": "./dist/out-tsc",
+    "forceConsistentCasingInFileNames": true,
+    "strict": true,
+    "noImplicitOverride": true,
+    "noPropertyAccessFromIndexSignature": true,
+    "noImplicitReturns": true,
+    "noFallthroughCasesInSwitch": true,
+    "sourceMap": true,
+    "declaration": false,
+    "downlevelIteration": true,
+    "experimentalDecorators": true,
+    "moduleResolution": "node",
+    "importHelpers": true,
+    "target": "es2017",
+    "module": "es2020",
+    "lib": [
+      "es2020",
+      "dom"
+    ]
+  },
+  "angularCompilerOptions": {
+    "enableI18nLegacyMessageIdFormat": false,
+    "strictInjectionParameters": true,
+    "strictInputAccessModifiers": true,
+    "strictTemplates": true
+  }
 }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 525 - 111
yarn.lock


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor