diff --git a/.changeset/moody-fireants-push.md b/.changeset/moody-fireants-push.md new file mode 100644 index 000000000..3d9dd2ba6 --- /dev/null +++ b/.changeset/moody-fireants-push.md @@ -0,0 +1,5 @@ +--- +"@alauda/ui": patch +--- + +feat: form item support plain input diff --git a/.changeset/sharp-steaks-do.md b/.changeset/sharp-steaks-do.md new file mode 100644 index 000000000..e3d1f9b8e --- /dev/null +++ b/.changeset/sharp-steaks-do.md @@ -0,0 +1,5 @@ +--- +"@alauda/ui": patch +--- + +fix: table placeholder will scroll as the header scrolls horizontally diff --git a/.changeset/sixty-toys-exist.md b/.changeset/sixty-toys-exist.md new file mode 100644 index 000000000..4288653dd --- /dev/null +++ b/.changeset/sixty-toys-exist.md @@ -0,0 +1,5 @@ +--- +"@alauda/ui": patch +--- + +fix: breadcrumb height diff --git a/.eslintignore b/.eslintignore index 0878362e1..6d0777a14 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,6 +2,6 @@ coverage dist release CHANGELOG.md -/tslint-rules +/.angular !/.*.js jest.setup.ts diff --git a/.eslintrc b/.eslintrc index 7bf5f4e24..28e03be6f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,25 +4,58 @@ "requireConfigFile": false }, "overrides": [ + { + "files": "*.mdx", + "rules": { + "no-unused-expressions": "off" + } + }, + { + "files": "*.ts", + "excludedFiles": [ + "*.spec.ts", + "**/stories/**/*.ts" + ], + "rules": { + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": [ + "aui" + ], + "style": "kebab-case" + } + ], + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": [ + "aui" + ], + "style": "camelCase" + } + ] + } + }, { "files": "*.spec.ts", "rules": { + "@angular-eslint/prefer-on-push-component-change-detection": "off", "@typescript-eslint/no-extraneous-class": "off", "jest/expect-expect": "off", "jest/no-export": "off", - "sonarjs/no-duplicate-string": 0 + "sonarjs/no-duplicate-string": "off" } } ], "rules": { - "accessor-pairs": "off", "@angular-eslint/no-inputs-metadata-property": "off", "@angular-eslint/no-output-native": "off", "@angular-eslint/no-input-rename": "off", "@angular-eslint/no-output-rename": "off", "@angular-eslint/no-host-metadata-property": "off", - "@typescript-eslint/no-useless-constructor": "off", - "@typescript-eslint/no-unsafe-call": "off", "@typescript-eslint/no-unsafe-argument": "off" } } diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cf75727d2..64f4ae800 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,14 +9,14 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: "CodeQL" +name: 'CodeQL' on: push: - branches: [ master ] + branches: [master] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [master] schedule: - cron: '33 11 * * 2' @@ -32,39 +32,39 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + language: ['javascript'] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + #- run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 5c256c945..7ace150f9 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -10,28 +10,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16 + cache: yarn - name: Link Yarn global binaries into PATH run: echo "$(yarn global bin)" >> $GITHUB_PATH - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies run: yarn --frozen-lockfile diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index f499ab8b6..f4da50496 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -13,28 +13,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16 + cache: yarn - name: Link Yarn global binaries into PATH run: echo "$(yarn global bin)" >> $GITHUB_PATH - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies run: yarn --frozen-lockfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bba9e85ff..a80b9b9bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,41 +11,29 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16 + cache: yarn - name: Link Yarn global binaries into PATH run: echo "$(yarn global bin)" >> $GITHUB_PATH - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install Dependencies - # https://github.com/atlassian/changesets/issues/246 - run: | - yarn --frozen-lockfile - rm -rf .git/hooks/commit-msg + run: yarn --frozen-lockfile - name: Create Release Pull Request or Publish to npm id: changesets uses: changesets/action@master with: + commit: 'chore: release @alauda/ui' + title: 'chore: release @alauda/ui' # This expects you to have a script called release which does a build for your packages and calls changeset publish publish: yarn release env: diff --git a/.github/workflows/stories.yml b/.github/workflows/stories.yml index c92c22b3b..3abaede99 100644 --- a/.github/workflows/stories.yml +++ b/.github/workflows/stories.yml @@ -10,28 +10,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16 + cache: yarn - name: Link Yarn global binaries into PATH run: echo "$(yarn global bin)" >> $GITHUB_PATH - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies run: yarn --frozen-lockfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb815b89e..496238cd3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,28 +8,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16 + cache: yarn - name: Link Yarn global binaries into PATH run: echo "$(yarn global bin)" >> $GITHUB_PATH - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install Dependencies run: yarn --frozen-lockfile diff --git a/.remarkrc b/.remarkrc index 929ab5aff..8f576f80b 100644 --- a/.remarkrc +++ b/.remarkrc @@ -1,9 +1,14 @@ { "plugins": [ - "@1stg/remark-config", + "@1stg/config", + "gfm", [ "lint-no-file-name-irregular-characters", false + ], + [ + "lint-no-duplicate-headings", + false ] ] } diff --git a/.stylelintrc b/.stylelintrc index 3f557a60e..3b8525f40 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -3,8 +3,6 @@ "rules": { "no-descending-specificity": null, "plugin/no-unsupported-browser-features": null, - "scss/no-duplicate-dollar-variables": null, - "no-invalid-position-at-import-rule": null, "selector-class-pattern": null, "selector-type-no-unknown": [ true, @@ -14,5 +12,33 @@ ] } ] - } + }, + "overrides": [ + { + "files": "**/*.scss", + "rules": { + "no-invalid-position-at-import-rule": [ + true, + { + "ignoreAtRules": [ + "use" + ] + } + ], + "scss/no-duplicate-dollar-variables": null, + "scss/function-no-unknown": [ + true, + { + "ignoreFunctions": [ + "get-height-calc", + "use-rgb", + "use-rgba", + "use-text-color", + "use-var" + ] + } + ] + } + } + ] } diff --git a/README.md b/README.md index 48dd36c4e..dc6a4bc2f 100644 --- a/README.md +++ b/README.md @@ -85,4 +85,4 @@ yarn build ## LICENCE -[MIT](LICENCE) © [Alauda](http://www.alauda.io) +[MIT](LICENSE) © [Alauda](http://www.alauda.io) diff --git a/ng-package.json b/ng-package.json index 910e5437e..02e501803 100644 --- a/ng-package.json +++ b/ng-package.json @@ -2,6 +2,6 @@ "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "dest": "./release", "lib": { - "entryFile": "./src/public-api.ts" + "entryFile": "./src/index.ts" } } diff --git a/package.json b/package.json index f4a3a9f79..c14e4ca39 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,10 @@ "debug": "yarn build:lib -p ng-package.debug.json && yarn build:copy --debug", "dev": "yarn start", "lint": "run-p lint:*", - "lint:es": "PARSER_NO_WATCH=true eslint . --cache --ext js,md,mdx,ts -f friendly", - "lint:style": "stylelint --cache '{src,stories}/**/*.{html,scss}'", - "lint:ts": "tslint -p . -t stylish", - "lint:tsc": "tsc -p tsconfig.json --noEmit", - "postinstall": "simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0", + "lint:es": "eslint . --cache -f friendly", + "lint:style": "stylelint --cache '{src,stories}/**/*.{html,scss,ts}'", + "lint:tsc": "tsc -p . --noEmit", + "prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0", "prerelease": "yarn build", "release": "changeset publish", "start": "yarn storybook", @@ -50,64 +49,58 @@ "rxjs": "^7.0.0" }, "devDependencies": { - "@1stg/app-config": "3.0.0", - "@1stg/tslint-config": "3.0.0", - "@angular-devkit/build-angular": "^13.2.3", - "@angular-devkit/core": "^13.2.3", - "@angular/animations": "^13.2.2", - "@angular/cdk": "^13.2.2", - "@angular/cli": "^13.2.3", - "@angular/common": "^13.2.2", - "@angular/compiler": "^13.2.2", - "@angular/compiler-cli": "^13.2.2", - "@angular/core": "^13.2.2", - "@angular/forms": "^13.2.2", - "@angular/platform-browser": "^13.2.2", - "@angular/platform-browser-dynamic": "^13.2.2", - "@babel/runtime": "^7.17.2", - "@changesets/changelog-github": "^0.4.3", - "@changesets/cli": "^2.21.0", - "@storybook/addon-actions": "^6.4.18", - "@storybook/addon-docs": "^6.4.18", + "@1stg/app-config": "^3.5.0", + "@angular-devkit/build-angular": "^13.3.2", + "@angular-devkit/core": "^13.3.2", + "@angular/animations": "^13.3.2", + "@angular/cdk": "^13.3.2", + "@angular/cli": "^13.3.2", + "@angular/common": "^13.3.2", + "@angular/compiler": "^13.3.2", + "@angular/compiler-cli": "^13.3.2", + "@angular/core": "^13.3.2", + "@angular/forms": "^13.3.2", + "@angular/platform-browser": "^13.3.2", + "@angular/platform-browser-dynamic": "^13.3.2", + "@changesets/changelog-github": "^0.4.4", + "@changesets/cli": "^2.22.0", + "@storybook/addon-actions": "^6.4.20", + "@storybook/addon-docs": "^6.4.20", "@storybook/addon-knobs": "^6.1.21", - "@storybook/addon-storysource": "^6.4.18", - "@storybook/addons": "^6.4.18", - "@storybook/angular": "^6.4.18", - "@storybook/builder-webpack5": "^6.4.18", - "@storybook/cli": "^6.4.18", - "@storybook/manager-webpack5": "^6.4.18", - "@storybook/source-loader": "^6.4.18", + "@storybook/addon-storysource": "^6.4.20", + "@storybook/addons": "^6.4.20", + "@storybook/angular": "^6.4.20", + "@storybook/builder-webpack5": "^6.4.20", + "@storybook/cli": "^6.4.20", + "@storybook/manager-webpack5": "^6.4.20", + "@storybook/source-loader": "^6.4.20", "@types/chroma-js": "^2.1.3", "@types/file-saver": "^2.0.5", - "@types/jest": "^27.4.0", - "@types/node": "^16.11.24", + "@types/jest": "^27.4.1", + "@types/node": "^17.0.23", "@types/resize-observer-browser": "^0.1.5", "chroma-js": "^2.1.2", - "clipboard-polyfill": "^3.0.2", - "css-loader": "^6.6.0", - "dayjs": "^1.10.4", + "css-loader": "^6.7.1", + "dayjs": "^1.11.0", "file-saver": "^2.0.5", "gulp": "^4.0.2", "gulp-dart-sass": "^1.0.2", "jest": "^27.5.1", - "jest-junit": "^13.0.0", + "jest-junit": "^13.1.0", "jest-preset-angular": "^11.1.1", - "ng-packagr": "^13.2.1", - "npm-run-all": "^4.1.5", + "ng-packagr": "^13.3.0", + "patch-package": "^6.4.7", "postcss": "^8.4.6", + "remark-gfm": "^3.0.1", "rxjs": "^7.5.4", "sass-loader": "^12.6.0", "storybook-dark-mode": "^1.0.8", "style-loader": "^3.3.1", - "tsconfig-paths-webpack-plugin": "^3.5.2", - "tslib": "^2.1.0", - "tslint": "^6.1.3", - "typescript": "^4.5.5", - "webpack": "^5.68.0", - "yarn-deduplicate": "^3.1.0" + "webpack": "^5.71.0", + "zone.js": "^0.11.5" }, "resolutions": { - "lint-staged": "11.1.4" + "prettier": "^2.6.2" }, "publishConfig": { "access": "public", diff --git a/patches/eslint-mdx+2.0.0-next.1.patch b/patches/eslint-mdx+2.0.0-next.1.patch new file mode 100644 index 000000000..c1e687bae --- /dev/null +++ b/patches/eslint-mdx+2.0.0-next.1.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/eslint-mdx/lib/parser.js b/node_modules/eslint-mdx/lib/parser.js +index 88e9c2e..dc94af5 100644 +--- a/node_modules/eslint-mdx/lib/parser.js ++++ b/node_modules/eslint-mdx/lib/parser.js +@@ -6,7 +6,7 @@ const path_1 = tslib_1.__importDefault(require("path")); + const helpers_1 = require("./helpers"); + const processor_1 = require("./processor"); + const traverse_1 = require("./traverse"); +-exports.AST_PROPS = ['body', 'comments']; ++exports.AST_PROPS = []; + exports.DEFAULT_EXTENSIONS = ['.mdx']; + exports.MARKDOWN_EXTENSIONS = ['.md']; + class Parser { diff --git a/scripts/publish-version.js b/scripts/publish-version.js index 940fcfe62..330ad891c 100644 --- a/scripts/publish-version.js +++ b/scripts/publish-version.js @@ -1,6 +1,5 @@ const { execSync } = require('child_process'); -// eslint-disable-next-line node/no-extraneous-require const semver = require('semver'); let version = process.env.PUBLISH_VERSION || 'patch'; diff --git a/src/accordion/accordion-item/accordion-item.component.html b/src/accordion/accordion-item/accordion-item.component.html index 10eb9d591..d33c7040f 100644 --- a/src/accordion/accordion-item/accordion-item.component.html +++ b/src/accordion/accordion-item/accordion-item.component.html @@ -22,7 +22,10 @@ [id]="id" [@expand]="expanded ? 'expanded' : 'collapsed'" > -
+
diff --git a/src/accordion/accordion-item/accordion-item.component.ts b/src/accordion/accordion-item/accordion-item.component.ts index 1ef46dcc0..4d4301000 100644 --- a/src/accordion/accordion-item/accordion-item.component.ts +++ b/src/accordion/accordion-item/accordion-item.component.ts @@ -48,7 +48,8 @@ export class AccordionItemContentDirective {} }) export class AccordionItemComponent extends CdkAccordionItem - implements AfterContentInit { + implements AfterContentInit +{ @Input() background = true; diff --git a/src/accordion/accordion.component.html b/src/accordion/accordion.component.html index c448b5ffe..a3e1f7f68 100644 --- a/src/accordion/accordion.component.html +++ b/src/accordion/accordion.component.html @@ -1,3 +1,6 @@ -
+
diff --git a/src/accordion/accordion.component.spec.ts b/src/accordion/accordion.component.spec.ts index 46d2cf488..274e3bea2 100644 --- a/src/accordion/accordion.component.spec.ts +++ b/src/accordion/accordion.component.spec.ts @@ -2,7 +2,7 @@ import { Component, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { AccordionComponent, AccordionModule } from '../public-api'; +import { AccordionComponent, AccordionModule } from '.'; describe('AccordionComponent', () => { let fixture: ComponentFixture; @@ -44,7 +44,11 @@ describe('AccordionComponent', () => { @Component({ template: ` - +
header1
content
diff --git a/src/accordion/accordion.module.ts b/src/accordion/accordion.module.ts index 851ff26e4..acb7d0434 100644 --- a/src/accordion/accordion.module.ts +++ b/src/accordion/accordion.module.ts @@ -2,8 +2,8 @@ import { CdkAccordionModule } from '@angular/cdk/accordion'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ButtonModule } from '../button/public-api'; -import { IconModule } from '../icon/public-api'; +import { ButtonModule } from '../button'; +import { IconModule } from '../icon'; import { AccordionItemComponent, diff --git a/src/accordion/public-api.ts b/src/accordion/public-api.ts deleted file mode 100644 index 281d42f0c..000000000 --- a/src/accordion/public-api.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './accordion-item/accordion-item.component'; -export * from './accordion.component'; -export * from './accordion.module'; diff --git a/src/anchor/anchor.directive.ts b/src/anchor/anchor.directive.ts index f5f1629a9..0463325ac 100644 --- a/src/anchor/anchor.directive.ts +++ b/src/anchor/anchor.directive.ts @@ -29,7 +29,6 @@ import { AnchorComponent } from './anchor.component'; let uid = 0; @Directive() -// tslint:disable-next-line: directive-class-suffix export class AnchorDirectiveChild { readonly parent: AnchorDirective; diff --git a/src/anchor/public-api.ts b/src/anchor/public-api.ts deleted file mode 100644 index 7ac8cccf7..000000000 --- a/src/anchor/public-api.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './anchor.component'; -export * from './anchor.directive'; -export * from './anchor.module'; -export * from './types'; -export * from './utils'; diff --git a/src/autocomplete/autocomplete.component.html b/src/autocomplete/autocomplete.component.html index d3c551a4f..b5970152d 100644 --- a/src/autocomplete/autocomplete.component.html +++ b/src/autocomplete/autocomplete.component.html @@ -5,7 +5,10 @@ [style.minWidth]="width" (mousedown)="$event.preventDefault()" > -
+
) => combineLatest(suggestions.map(suggestion => suggestion.visible$)), ), - map(visible => visible.some(value => value)), + map(visible => visible.some(Boolean)), distinctUntilChanged(), debounceTime(0), tap(() => { diff --git a/src/autocomplete/autocomplete.directive.ts b/src/autocomplete/autocomplete.directive.ts index 734ed7319..96ce079bb 100644 --- a/src/autocomplete/autocomplete.directive.ts +++ b/src/autocomplete/autocomplete.directive.ts @@ -1,4 +1,3 @@ -// tslint:disable: no-output-rename import { Overlay } from '@angular/cdk/overlay'; import { AfterViewInit, @@ -20,11 +19,7 @@ import { NgControl } from '@angular/forms'; import { BehaviorSubject, Observable, Subject, fromEvent } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { - BaseTooltip, - TooltipTrigger, - TooltipType, -} from '../tooltip/public-api'; +import { BaseTooltip, TooltipTrigger, TooltipType } from '../tooltip'; import { scrollIntoView } from '../utils'; import { AutocompleteComponent } from './autocomplete.component'; diff --git a/src/autocomplete/autocomplete.module.ts b/src/autocomplete/autocomplete.module.ts index 81260f1a9..59cc26db9 100644 --- a/src/autocomplete/autocomplete.module.ts +++ b/src/autocomplete/autocomplete.module.ts @@ -2,7 +2,7 @@ import { OverlayModule } from '@angular/cdk/overlay'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { TooltipModule } from '../tooltip/public-api'; +import { TooltipModule } from '../tooltip'; import { AutocompletePlaceholderComponent } from './autocomplete-placeholder.component'; import { AutocompleteComponent } from './autocomplete.component'; diff --git a/src/autocomplete/public-api.ts b/src/autocomplete/public-api.ts deleted file mode 100644 index 0402de319..000000000 --- a/src/autocomplete/public-api.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './autocomplete.directive'; -export * from './autocomplete.component'; -export * from './suggestion/suggestion.component'; -export * from './suggestion-group/suggestion-group.component'; -export * from './autocomplete-placeholder.component'; -export * from './helper-directives'; -export * from './autocomplete.module'; -export * from './autocomplete.types'; diff --git a/src/autocomplete/suggestion-group/suggestion-group.component.html b/src/autocomplete/suggestion-group/suggestion-group.component.html index 9154f7420..8a07daaa5 100644 --- a/src/autocomplete/suggestion-group/suggestion-group.component.html +++ b/src/autocomplete/suggestion-group/suggestion-group.component.html @@ -1,4 +1,7 @@ -
+
diff --git a/src/autocomplete/suggestion-group/suggestion-group.component.ts b/src/autocomplete/suggestion-group/suggestion-group.component.ts index a96879b3f..ee3bacab5 100644 --- a/src/autocomplete/suggestion-group/suggestion-group.component.ts +++ b/src/autocomplete/suggestion-group/suggestion-group.component.ts @@ -40,7 +40,7 @@ export class SuggestionGroupComponent implements AfterContentInit { ? combineLatest(options.map(node => node.visible$)) : of([false]), ), - map(visible => visible.some(value => value)), + map(visible => visible.some(Boolean)), publishReplay(1), refCount(), ); diff --git a/src/back-top/back-top.component.html b/src/back-top/back-top.component.html index 14134a89c..09aa63175 100644 --- a/src/back-top/back-top.component.html +++ b/src/back-top/back-top.component.html @@ -3,5 +3,8 @@ (click)="handleClick($event)" [class.show]="isDisplayed$ | async" > - +
diff --git a/src/back-top/public-api.ts b/src/back-top/public-api.ts deleted file mode 100644 index 2131a7706..000000000 --- a/src/back-top/public-api.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './back-top.component'; -export * from './back-top.module'; diff --git a/src/breadcrumb/breadcrumb-item.component.html b/src/breadcrumb/breadcrumb-item.component.html index 2ab80953b..07b1a11f2 100644 --- a/src/breadcrumb/breadcrumb-item.component.html +++ b/src/breadcrumb/breadcrumb-item.component.html @@ -2,6 +2,9 @@ {{ separator }} - +
diff --git a/src/breadcrumb/breadcrumb.module.ts b/src/breadcrumb/breadcrumb.module.ts index fcb970837..b00855e9b 100644 --- a/src/breadcrumb/breadcrumb.module.ts +++ b/src/breadcrumb/breadcrumb.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IconModule } from '../icon/public-api'; +import { IconModule } from '../icon'; import { BreadcrumbItemComponent } from './breadcrumb-item.component'; import { BreadcrumbComponent } from './breadcrumb.component'; diff --git a/src/breadcrumb/public-api.ts b/src/breadcrumb/public-api.ts deleted file mode 100644 index d08d89dd8..000000000 --- a/src/breadcrumb/public-api.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './breadcrumb-item.component'; -export * from './breadcrumb.component'; -export * from './breadcrumb.module'; diff --git a/src/button/button.component.html b/src/button/button.component.html index 0a9503ad2..2a608d9e9 100644 --- a/src/button/button.component.html +++ b/src/button/button.component.html @@ -1,2 +1,6 @@ - + diff --git a/src/button/button.component.scss b/src/button/button.component.scss index d2e015318..b5f9192f6 100644 --- a/src/button/button.component.scss +++ b/src/button/button.component.scss @@ -204,6 +204,7 @@ $button-size: ( &.isPlain { color: use-text-color(main); + &[disabled] { color: use-rgb(n-6); } @@ -243,6 +244,7 @@ $button-size: ( &.isPlain { color: use-text-color(main); + &[disabled] { color: use-rgb(n-6); } @@ -298,12 +300,15 @@ $button-size: ( &--primary { @include colorful-button(primary); } + &--success { @include colorful-button(green); } + &--warning { @include colorful-button(yellow); } + &--danger { @include colorful-button(red); } diff --git a/src/button/button.component.spec.ts b/src/button/button.component.spec.ts index 0845cd2a5..aaffe456d 100644 --- a/src/button/button.component.spec.ts +++ b/src/button/button.component.spec.ts @@ -4,7 +4,7 @@ import { By } from '@angular/platform-browser'; import { ComponentSize } from '../types'; -import { ButtonModule, ButtonType } from './public-api'; +import { ButtonModule, ButtonType } from '.'; describe('ButtonComponent', () => { let fixture: ComponentFixture; diff --git a/src/button/button.component.ts b/src/button/button.component.ts index fb5c4cadf..9e146bd12 100644 --- a/src/button/button.component.ts +++ b/src/button/button.component.ts @@ -16,7 +16,7 @@ import { ButtonType } from './button.types'; const prefix = 'aui-button--'; @Component({ - // tslint:disable-next-line: component-selector + // eslint-disable-next-line @angular-eslint/component-selector selector: 'button[aui-button]', templateUrl: './button.component.html', styleUrls: ['./button.component.scss'], diff --git a/src/button/button.module.ts b/src/button/button.module.ts index 61fdf201b..3d595f197 100644 --- a/src/button/button.module.ts +++ b/src/button/button.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IconModule } from '../icon/public-api'; +import { IconModule } from '../icon'; import { ButtonGroupComponent } from './button-group/button-group.component'; import { ButtonComponent } from './button.component'; diff --git a/src/button/public-api.ts b/src/button/public-api.ts deleted file mode 100644 index 634cd6a4a..000000000 --- a/src/button/public-api.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './button.module'; -export * from './button.component'; -export * from './button-group/button-group.component'; -export * from './button.types'; diff --git a/src/card/card.component.html b/src/card/card.component.html index db750db23..b9592f194 100644 --- a/src/card/card.component.html +++ b/src/card/card.component.html @@ -1,4 +1,7 @@ -
+
diff --git a/src/card/helper-directives.ts b/src/card/helper-directives.ts index e06b38778..277e22d00 100644 --- a/src/card/helper-directives.ts +++ b/src/card/helper-directives.ts @@ -1,4 +1,3 @@ -// tslint:disable: no-host-metadata-property import { Directive } from '@angular/core'; @Directive({ diff --git a/src/card/public-api.ts b/src/card/public-api.ts deleted file mode 100644 index f54fd90fe..000000000 --- a/src/card/public-api.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './section.component'; -export * from './card.component'; -export * from './card.module'; -export * from './helper-directives'; diff --git a/src/checkbox/checkbox-group/checkbox-group.component.spec.ts b/src/checkbox/checkbox-group/checkbox-group.component.spec.ts index 6290a4ac9..399db1870 100644 --- a/src/checkbox/checkbox-group/checkbox-group.component.spec.ts +++ b/src/checkbox/checkbox-group/checkbox-group.component.spec.ts @@ -24,10 +24,12 @@ describe('CheckboxGroupComponent', () => { fixture = TestBed.createComponent(TestComponent); fixture.detectChanges(); ins = fixture.componentInstance; - el1 = fixture.debugElement.query(By.css('.group1 aui-checkbox-group')) - .nativeElement; - el2 = fixture.debugElement.query(By.css('.group2 aui-checkbox-group')) - .nativeElement; + el1 = fixture.debugElement.query( + By.css('.group1 aui-checkbox-group'), + ).nativeElement; + el2 = fixture.debugElement.query( + By.css('.group2 aui-checkbox-group'), + ).nativeElement; }); it('should checkbox init checked state by value array', fakeAsync(() => { @@ -74,12 +76,22 @@ describe('CheckboxGroupComponent', () => { box0 box1 box2 - box3 + box3
- - + + {{ v.name }} diff --git a/src/checkbox/checkbox-group/checkbox-group.component.ts b/src/checkbox/checkbox-group/checkbox-group.component.ts index b5005719a..fb2433937 100644 --- a/src/checkbox/checkbox-group/checkbox-group.component.ts +++ b/src/checkbox/checkbox-group/checkbox-group.component.ts @@ -9,8 +9,8 @@ import { } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { CommonFormControl } from '../../form/public-api'; -import { TrackFn } from '../../select/public-api'; +import { CommonFormControl } from '../../form'; +import { TrackFn } from '../../select'; import { CheckboxComponent } from '../checkbox.component'; @Component({ diff --git a/src/checkbox/checkbox.component.html b/src/checkbox/checkbox.component.html index 0cf12395b..7d5e6e091 100644 --- a/src/checkbox/checkbox.component.html +++ b/src/checkbox/checkbox.component.html @@ -16,7 +16,10 @@ (click)="onClick()" (blur)="onBlur()" /> -
- +
diff --git a/src/date-picker/calendar/panel/picker-panel.ts b/src/date-picker/calendar/panel/picker-panel.ts index 6225ab283..7c8b1b0aa 100644 --- a/src/date-picker/calendar/panel/picker-panel.ts +++ b/src/date-picker/calendar/panel/picker-panel.ts @@ -132,15 +132,26 @@ export class PickerPanelComponent implements OnChanges { this.panelData = [[]]; } const [...values] = getDatePanelIterable(date, navRange, this.weekStartDay); - if (navRange === DateNavRange.Month) { - colCounts = DAY_PANEL_COLUMN_COUNT; - rowCounts = DAY_PANEL_ROW_COUNT; - } else if (navRange === DateNavRange.Decade) { - colCounts = YEAR_PANEL_COLUMN_COUNT; - rowCounts = YEAR_PANEL_ROW_COUNT; - } else if (navRange === DateNavRange.Year) { - colCounts = MONTH_PANEL_COLUMN_COUNT; - rowCounts = MONTH_PANEL_ROW_COUNT; + switch (navRange) { + case DateNavRange.Month: { + colCounts = DAY_PANEL_COLUMN_COUNT; + rowCounts = DAY_PANEL_ROW_COUNT; + + break; + } + case DateNavRange.Decade: { + colCounts = YEAR_PANEL_COLUMN_COUNT; + rowCounts = YEAR_PANEL_ROW_COUNT; + + break; + } + case DateNavRange.Year: { + colCounts = MONTH_PANEL_COLUMN_COUNT; + rowCounts = MONTH_PANEL_ROW_COUNT; + + break; + } + // No default } for (let k = 0; k < rowCounts; k++) { const row = []; diff --git a/src/date-picker/calendar/range-picker-panel/style.scss b/src/date-picker/calendar/range-picker-panel/style.scss index 713d31b93..1a6cae6a1 100644 --- a/src/date-picker/calendar/range-picker-panel/style.scss +++ b/src/date-picker/calendar/range-picker-panel/style.scss @@ -12,27 +12,33 @@ $block: aui-date-range-picker-panel; .placeholder { color: use-text-color(placeholder); + &.separator { margin-inline: 12px; } } + .date-value { color: use-text-color(main); } + .date-holder { display: inline-block; margin-right: 8px; width: 82px; } + .panel__wrapper { width: $range-picker-header-width; display: flex; justify-content: center; } } + &__header { display: flex; justify-content: space-between; + aui-calendar-header { flex: 0 0 $range-picker-header-width; } @@ -43,11 +49,13 @@ $block: aui-date-range-picker-panel; justify-content: space-between; margin: 16px 0; } + &__footer { .aui-time-picker { width: 88px; } } + &__footer-content { display: flex; align-items: center; diff --git a/src/date-picker/calendar/range-picker-panel/template.html b/src/date-picker/calendar/range-picker-panel/template.html index 8a76b4d6b..4adc11d19 100644 --- a/src/date-picker/calendar/range-picker-panel/template.html +++ b/src/date-picker/calendar/range-picker-panel/template.html @@ -54,7 +54,10 @@ (confirm)="confirmValue(rangeValue)" *ngIf="showFooter && showTime" > -
+
- {{ placeholder }} - {{ - value | date: FOOTER_DATE_FORMAT - }} + + {{ placeholder }} + {{ value | date: FOOTER_DATE_FORMAT }} diff --git a/src/date-picker/calendar/util.ts b/src/date-picker/calendar/util.ts index e01c20668..64ead5998 100644 --- a/src/date-picker/calendar/util.ts +++ b/src/date-picker/calendar/util.ts @@ -36,18 +36,29 @@ export function getDatePanelIterable( let firstData: Dayjs; let counts = 0; date = date.clone(); - if (navRange === DateNavRange.Month) { - firstData = date.date(-1).day(weekStartDay); - if (firstData.isAfter(date)) { - firstData = firstData.subtract(1, 'week'); + switch (navRange) { + case DateNavRange.Month: { + firstData = date.date(-1).day(weekStartDay); + if (firstData.isAfter(date)) { + firstData = firstData.subtract(1, 'week'); + } + counts = DAY_PANEL_COLUMN_COUNT * DAY_PANEL_ROW_COUNT; + + break; + } + case DateNavRange.Year: { + firstData = date.month(0); + counts = MONTH_PANEL_COLUMN_COUNT * MONTH_PANEL_ROW_COUNT; + + break; } - counts = DAY_PANEL_COLUMN_COUNT * DAY_PANEL_ROW_COUNT; - } else if (navRange === DateNavRange.Year) { - firstData = date.month(0); - counts = MONTH_PANEL_COLUMN_COUNT * MONTH_PANEL_ROW_COUNT; - } else if (navRange === DateNavRange.Decade) { - firstData = date.subtract(1, YEAR); - counts = YEAR_PANEL_COLUMN_COUNT * YEAR_PANEL_ROW_COUNT; + case DateNavRange.Decade: { + firstData = date.subtract(1, YEAR); + counts = YEAR_PANEL_COLUMN_COUNT * YEAR_PANEL_ROW_COUNT; + + break; + } + // No default } let i = 0; return { @@ -181,10 +192,10 @@ export function updateDateByTimeModel(date: Dayjs, time: TimePickerModel) { : date; } -export const composeDisabledDateFn = (...fns: DisabledDateFn[]) => ( - date: Dayjs, - navRange: DateNavRange, -) => !fns.filter(i => !!i).every(fn => !fn(date, navRange)); +export const composeDisabledDateFn = + (...fns: DisabledDateFn[]) => + (date: Dayjs, navRange: DateNavRange) => + !fns.filter(i => !!i).every(fn => !fn(date, navRange)); export function minDate(a: Dayjs, b: Dayjs, unit: UnitType = 'date') { return !a ? b : !b ? a : a.isBefore(b, unit) ? a : b; diff --git a/src/date-picker/date-picker.module.ts b/src/date-picker/date-picker.module.ts index cdf3af2c6..cfe4c86e5 100644 --- a/src/date-picker/date-picker.module.ts +++ b/src/date-picker/date-picker.module.ts @@ -2,12 +2,12 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ButtonModule } from '../button/public-api'; -import { I18nModule } from '../i18n/public-api'; +import { ButtonModule } from '../button'; +import { I18nModule } from '../i18n'; import { IconModule } from '../icon/icon.module'; -import { InputModule } from '../input/public-api'; -import { TimePickerModule } from '../time-picker/public-api'; -import { TooltipModule } from '../tooltip/public-api'; +import { InputModule } from '../input'; +import { TimePickerModule } from '../time-picker'; +import { TooltipModule } from '../tooltip'; import { DatePickerPanelComponent } from './calendar/date-picker-panel/component'; import { CalendarFooterComponent } from './calendar/footer/component'; diff --git a/src/date-picker/date-picker.type.ts b/src/date-picker/date-picker.type.ts index fd442cb6f..1c0e49ee8 100644 --- a/src/date-picker/date-picker.type.ts +++ b/src/date-picker/date-picker.type.ts @@ -5,9 +5,7 @@ export enum Side { Right = 'right', } -export type DisabledTimeFn = ( - date?: ConfigType, -) => { +export type DisabledTimeFn = (date?: ConfigType) => { hours: () => number[]; minutes: (hour?: number) => number[]; seconds: (hour?: number, minute?: number) => number[]; diff --git a/src/date-picker/date-picker/date-picker.component.ts b/src/date-picker/date-picker/date-picker.component.ts index 09a5fdcd4..9c9a88ec4 100644 --- a/src/date-picker/date-picker/date-picker.component.ts +++ b/src/date-picker/date-picker/date-picker.component.ts @@ -21,7 +21,6 @@ import { DateNavRange, DisabledTimeFn } from '../date-picker.type'; selector: 'aui-date-picker', templateUrl: './date-picker.template.html', changeDetection: ChangeDetectionStrategy.OnPush, - // tslint:disable-next-line: validate-decorators encapsulation: ViewEncapsulation.Emulated, providers: [ { @@ -34,7 +33,8 @@ import { DateNavRange, DisabledTimeFn } from '../date-picker.type'; }) export class DatePickerComponent extends CommonFormControl - implements OnInit { + implements OnInit +{ @Input() clearable = true; diff --git a/src/date-picker/public-api.ts b/src/date-picker/public-api.ts deleted file mode 100644 index 6e57e9061..000000000 --- a/src/date-picker/public-api.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './date-picker.module'; -export * from './range-picker/range-picker.component'; -export * from './date-picker.type'; -export * from './calendar/footer/component'; -export * from './calendar/header/component'; -export * from './calendar/panel/picker-panel'; -export * from './calendar/range-picker-panel/component'; -export * from './calendar/date-picker-panel/component'; -export * from './calendar/constant'; -export * from './trigger/trigger.component'; -export * from './date-picker/date-picker.component'; diff --git a/src/date-picker/range-picker/range-picker.component.ts b/src/date-picker/range-picker/range-picker.component.ts index 127793621..5895b1363 100644 --- a/src/date-picker/range-picker/range-picker.component.ts +++ b/src/date-picker/range-picker/range-picker.component.ts @@ -18,7 +18,6 @@ import { DisabledDateFn, DisabledTimeFn } from '../date-picker.type'; selector: 'aui-range-picker', templateUrl: './range-picker.template.html', // provide tooltip class - // tslint:disable-next-line: validate-decorators encapsulation: ViewEncapsulation.Emulated, providers: [ { diff --git a/src/date-picker/trigger/trigger.component.ts b/src/date-picker/trigger/trigger.component.ts index 7a60ee1ef..d430c3d85 100644 --- a/src/date-picker/trigger/trigger.component.ts +++ b/src/date-picker/trigger/trigger.component.ts @@ -18,7 +18,6 @@ const bem = buildBem('aui-date-picker-trigger'); @Component({ selector: 'aui-date-picker-trigger', templateUrl: './trigger.template.html', - // tslint:disable-next-line: validate-decorators encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styleUrls: ['./trigger.style.scss'], diff --git a/src/date-picker/trigger/trigger.template.html b/src/date-picker/trigger/trigger.template.html index 7eeda24d7..f71884087 100644 --- a/src/date-picker/trigger/trigger.template.html +++ b/src/date-picker/trigger/trigger.template.html @@ -21,9 +21,11 @@ (blur)="leftFocus = false; blur.next()" [placeholder]="startPlaceholder || ('start_date' | auiI18n)" /> - {{ - 'to' | auiI18n - }} + {{ 'to' | auiI18n }} - + { return 'check_circle_s'; case ConfirmType.Danger: return 'exclamation_triangle_s'; - case ConfirmType.Primary: - case ConfirmType.Warning: default: return 'exclamation_circle_s'; } diff --git a/src/dialog/dialog-content/dialog-header.component.html b/src/dialog/dialog-content/dialog-header.component.html index a8eef0944..255f2c990 100644 --- a/src/dialog/dialog-content/dialog-header.component.html +++ b/src/dialog/dialog-content/dialog-header.component.html @@ -1,4 +1,7 @@ -
+
+
diff --git a/src/dialog/dialog.component.ts b/src/dialog/dialog.component.ts index e9b4fac3c..3d4468d15 100644 --- a/src/dialog/dialog.component.ts +++ b/src/dialog/dialog.component.ts @@ -23,7 +23,7 @@ import { throwDialogContentAlreadyAttachedError } from './utils'; templateUrl: './dialog.component.html', styleUrls: ['./dialog.component.scss'], encapsulation: ViewEncapsulation.None, - // tslint:disable-next-line:validate-decorators + // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection changeDetection: ChangeDetectionStrategy.Default, preserveWhitespaces: false, }) diff --git a/src/dialog/dialog.module.ts b/src/dialog/dialog.module.ts index b4da72c53..0227c3415 100644 --- a/src/dialog/dialog.module.ts +++ b/src/dialog/dialog.module.ts @@ -3,8 +3,8 @@ import { PortalModule } from '@angular/cdk/portal'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ButtonModule } from '../button/public-api'; -import { IconModule } from '../icon/public-api'; +import { ButtonModule } from '../button'; +import { IconModule } from '../icon'; import { ConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component'; import { DialogCloseDirective } from './dialog-content/dialog-close.directive'; diff --git a/src/dialog/dialog.service.spec.ts b/src/dialog/dialog.service.spec.ts index 9f29dad10..c6c72059f 100644 --- a/src/dialog/dialog.service.spec.ts +++ b/src/dialog/dialog.service.spec.ts @@ -1,5 +1,11 @@ import { OverlayContainer } from '@angular/cdk/overlay'; -import { Component, NgModule, TemplateRef, ViewChild } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + NgModule, + TemplateRef, + ViewChild, +} from '@angular/core'; import { ComponentFixture, TestBed, @@ -9,7 +15,7 @@ import { } from '@angular/core/testing'; import { timer } from 'rxjs'; -import { DialogModule, DialogService, DialogSize } from './public-api'; +import { DialogModule, DialogService, DialogSize } from '.'; describe('DialogService', () => { let fixture: ComponentFixture; @@ -112,6 +118,7 @@ describe('DialogService', () => { content: 'custom content', }) .catch(() => { + // eslint-disable-next-line jest/no-conditional-expect expect(ocEl.querySelector('aui-dialog')).toBeNull(); resolve(); }); @@ -194,6 +201,7 @@ describe('DialogService', () => { // eslint-disable-next-line sonarjs/no-identical-functions .catch(() => { const t2 = Date.now(); + // eslint-disable-next-line jest/no-conditional-expect expect(t2 - t1).toBeGreaterThanOrEqual(100); resolve(); }); @@ -220,14 +228,16 @@ describe('DialogService', () => { // eslint-disable-next-line sonarjs/no-identical-functions .catch(() => { const t2 = Date.now(); + // eslint-disable-next-line jest/no-conditional-expect expect(t2 - t1).toBeGreaterThanOrEqual(100); resolve(); }); fixture.detectChanges(); - const cancelBtn: HTMLButtonElement = ocEl.querySelector( + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- no idea + const cancelBtn = ocEl.querySelector( '.aui-confirm-dialog__cancel-button', - ); + ) as HTMLButtonElement; cancelBtn.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -278,9 +288,15 @@ describe('DialogService', () => { template: ` title - + `, + changeDetection: ChangeDetectionStrategy.OnPush, }) class TestComponent { result: any; @@ -289,18 +305,24 @@ class TestComponent { } @Component({ - // tslint:disable-next-line: component-selector selector: 'test-dialog-content', template: ` title content
- - + +
`, + changeDetection: ChangeDetectionStrategy.OnPush, }) class DialogContentComponent {} diff --git a/src/dialog/dialog.service.ts b/src/dialog/dialog.service.ts index 886b14984..db9e7665d 100644 --- a/src/dialog/dialog.service.ts +++ b/src/dialog/dialog.service.ts @@ -97,17 +97,15 @@ export class DialogService { private hiddenPrevDialog() { if (this.openDialogs.length > 0) { - this.openDialogs[ - this.openDialogs.length - 1 - ].dialogInstance.hidden = true; + this.openDialogs[this.openDialogs.length - 1].dialogInstance.hidden = + true; } } private showPrevDialog() { if (this.openDialogs.length > 0) { - this.openDialogs[ - this.openDialogs.length - 1 - ].dialogInstance.hidden = false; + this.openDialogs[this.openDialogs.length - 1].dialogInstance.hidden = + false; } } diff --git a/src/dialog/public-api.ts b/src/dialog/public-api.ts deleted file mode 100644 index 012c4f98a..000000000 --- a/src/dialog/public-api.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './dialog.module'; -export * from './dialog.service'; -export * from './dialog.types'; -export * from './dialog-ref'; -export * from './dialog-config'; -export * from './confirm-dialog/confirm-dialog-config'; -export * from './dialog-content/dialog-close.directive'; -export * from './dialog-content/dialog-content.component'; -export * from './dialog-content/dialog-footer.component'; -export * from './dialog-content/dialog-header.component'; -export * from './dialog.component'; diff --git a/src/drawer/component/drawer.component.html b/src/drawer/component/drawer.component.html index c79187ee5..a57e3145e 100644 --- a/src/drawer/component/drawer.component.html +++ b/src/drawer/component/drawer.component.html @@ -31,7 +31,11 @@ >
-
+
@@ -49,7 +53,10 @@
-