Skip to content

Commit d190123

Browse files
committedMar 6, 2023
chore: add package scripts, cleanup code
1 parent 1275fe1 commit d190123

17 files changed

+209
-142
lines changed
 

‎angular.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
},
6969
{
7070
"type": "anyComponentStyle",
71-
"maximumWarning": "2kb",
72-
"maximumError": "4kb"
71+
"maximumWarning": "500kb",
72+
"maximumError": "1mb"
7373
}
7474
],
7575
"fileReplacements": [

‎package.json

+1-8
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,10 @@
1919
"@angular/common": "<15.0.0",
2020
"@angular/compiler": "<15.0.0",
2121
"@angular/core": "<15.0.0",
22-
"@angular/flex-layout": "^14.0.0-beta.41",
2322
"@angular/forms": "<15.0.0",
23+
"@angular/localize": "<15.0.0",
2424
"@angular/platform-browser": "<15.0.0",
25-
"@angular/platform-browser-dynamic": "<15.0.0",
26-
"@angular/platform-server": "<15.0.0",
27-
"@angular/router": "<15.0.0",
28-
"bootstrap": "<4.0.0",
29-
"diacritics": "^1.3.0",
3025
"dropzone": "^6.0.0-beta.2",
31-
"i18n-iso-countries": "^7.5.0",
3226
"moment": "^2.29.4",
3327
"rxjs": "^7.8.0",
3428
"tslib": "^2.3.0",
@@ -43,7 +37,6 @@
4337
"@angular-eslint/template-parser": "<15.0.0",
4438
"@angular/cli": "<15.0.0",
4539
"@angular/compiler-cli": "<15.0.0",
46-
"@angular/localize": "14.2.12",
4740
"@commitlint/cli": "^17.4.4",
4841
"@commitlint/config-conventional": "^17.4.4",
4942
"@types/diacritics": "^1.3.1",

‎packages/demo/package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "demo",
3+
"version": "14.0.0",
4+
"license": "MIT",
5+
"repository": "https://github.com/Liquid-JS/nxt-components.git",
6+
"private": true,
7+
"scripts": {
8+
"serve": "ng serve demo",
9+
"build": "ng build demo --configuration \"production\"",
10+
"lint": "ng lint demo",
11+
"lint:fix": "yarn lint --fix",
12+
"lint:sass": "stylelint \"src/**/*.scss\"",
13+
"lint:sass:fix": "yarn lint:sass --fix"
14+
},
15+
"dependencies": {
16+
"@angular/cdk": "<15.0.0",
17+
"@angular/common": "<15.0.0",
18+
"@angular/compiler": "<15.0.0",
19+
"@angular/core": "<15.0.0",
20+
"@angular/flex-layout": "^14.0.0-beta.41",
21+
"@angular/forms": "<15.0.0",
22+
"@angular/platform-browser": "<15.0.0",
23+
"@angular/platform-browser-dynamic": "<15.0.0",
24+
"@angular/router": "<15.0.0",
25+
"bootstrap": "<4.0.0",
26+
"diacritics": "^1.3.0",
27+
"i18n-iso-countries": "^7.5.0",
28+
"rxjs": "^7.8.0",
29+
"tslib": "^2.3.0",
30+
"zone.js": "^0.12.0"
31+
}
32+
}

‎packages/demo/src/polyfills.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/***************************************************************************************************
22
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
33
*/
4-
import '@angular/localize/init';
4+
import '@angular/localize/init'
55
/**
66
* This file includes polyfills needed by Angular and is loaded before the app.
77
* You can add your own extra polyfills to this file.

‎packages/dropzone-wrapper/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"version": "14.0.0",
66
"license": "MIT",
77
"repository": "https://github.com/Liquid-JS/nxt-components.git",
8+
"scripts": {
9+
"watch": "ng build dropzone-wrapper --configuration \"development\" --watch",
10+
"build": "ng build dropzone-wrapper --configuration \"production\"",
11+
"lint": "ng lint dropzone-wrapper",
12+
"lint:fix": "yarn lint --fix",
13+
"lint:sass": "stylelint \"src/**/*.scss\"",
14+
"lint:sass:fix": "yarn lint:sass --fix",
15+
"test": "ng test dropzone-wrapper"
16+
},
817
"peerDependencies": {
918
"@angular/common": "^14.2.0",
1019
"@angular/core": "^14.2.0",

‎packages/dropzone-wrapper/src/lib/dropzone.component.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @angular-eslint/no-output-rename */
12
import { isPlatformBrowser } from '@angular/common'
23
import { Component, EventEmitter, Inject, Input, OnInit, Output, PLATFORM_ID, ViewChild, ViewEncapsulation } from '@angular/core'
34
import { DropzoneDirective } from './dropzone.directive'
@@ -60,14 +61,17 @@ export class DropzoneComponent implements OnInit {
6061

6162
@ViewChild(DropzoneDirective, { static: true }) directiveRef?: DropzoneDirective
6263

63-
constructor(@Inject(PLATFORM_ID) private platformId: Object) { }
64+
constructor(
65+
// eslint-disable-next-line @typescript-eslint/ban-types
66+
@Inject(PLATFORM_ID) private readonly platformId: Object
67+
) { }
6468

6569
ngOnInit(): void {
6670
if (!isPlatformBrowser(this.platformId)) {
6771
return
6872
}
6973

70-
window.setTimeout(() => {
74+
setTimeout(() => {
7175
DropzoneEvents.forEach((eventName: DropzoneEvent) => {
7276
if (this.directiveRef) {
7377
const output = `DZ_${eventName.toUpperCase()}`

‎packages/dropzone-wrapper/src/lib/dropzone.directive.ts

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
/* eslint-disable @angular-eslint/no-output-rename */
2+
/* eslint-disable @angular-eslint/no-conflicting-lifecycle */
13
import { isPlatformBrowser } from '@angular/common'
24
import { Directive, DoCheck, ElementRef, EventEmitter, Inject, Input, KeyValueDiffer, KeyValueDiffers, NgZone, OnChanges, OnDestroy, OnInit, Optional, Output, PLATFORM_ID, Renderer2, SimpleChanges } from '@angular/core'
35
import Dropzone from 'dropzone'
4-
import { DropzoneConfig, DropzoneConfigInterface, DropzoneEvent, DropzoneEvents, DROPZONE_CONFIG } from './dropzone.interfaces'
6+
import { DropzoneConfig, DropzoneConfigInterface, DropzoneEvent, DropzoneEvents, NXT_DROPZONE_CONFIG } from './dropzone.interfaces'
57

68
@Directive({
79
selector: '[nxtDropzone]',
@@ -51,9 +53,18 @@ export class DropzoneDirective implements OnInit, OnDestroy, DoCheck, OnChanges
5153
@Output('queueComplete') DZ_QUEUECOMPLETE = new EventEmitter<any>()
5254
@Output('totalUploadProgress') DZ_TOTALUPLOADPROGRESS = new EventEmitter<any>()
5355

54-
constructor(private zone: NgZone, private renderer: Renderer2, private elementRef: ElementRef<HTMLElement>,
55-
private differs: KeyValueDiffers, @Inject(PLATFORM_ID) private platformId: Object,
56-
@Optional() @Inject(DROPZONE_CONFIG) private defaults: DropzoneConfigInterface) {
56+
constructor(
57+
private readonly zone: NgZone,
58+
private readonly renderer: Renderer2,
59+
private readonly elementRef: ElementRef<HTMLElement>,
60+
private readonly differs: KeyValueDiffers,
61+
@Inject(PLATFORM_ID)
62+
// eslint-disable-next-line @typescript-eslint/ban-types
63+
private readonly platformId: Object,
64+
@Optional()
65+
@Inject(NXT_DROPZONE_CONFIG)
66+
private readonly defaults?: DropzoneConfigInterface | undefined
67+
) {
5768
const dz = Dropzone
5869

5970
dz.autoDiscover = false
@@ -82,7 +93,7 @@ export class DropzoneDirective implements OnInit, OnDestroy, DoCheck, OnChanges
8293
this.instance.disable()
8394
}
8495

85-
if (this.DZ_INIT.observers.length) {
96+
if (this.DZ_INIT.observed) {
8697
this.zone.run(() => {
8798
this.DZ_INIT.emit(this.instance)
8899
})
@@ -116,7 +127,7 @@ export class DropzoneDirective implements OnInit, OnDestroy, DoCheck, OnChanges
116127

117128
const emitter = this[output as keyof DropzoneDirective] as EventEmitter<any>
118129

119-
if (emitter.observers.length > 0) {
130+
if (emitter.observed) {
120131
this.zone.run(() => {
121132
emitter.emit(args)
122133
})

‎packages/flags/.stylelintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../.stylelintrc.json"
3+
}

‎packages/flags/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"version": "14.0.0",
66
"license": "MIT",
77
"repository": "https://github.com/Liquid-JS/nxt-components.git",
8+
"scripts": {
9+
"watch": "ng build flags --configuration \"development\" --watch",
10+
"build": "ng build flags --configuration \"production\"",
11+
"lint": "ng lint flags",
12+
"lint:fix": "yarn lint --fix",
13+
"lint:sass": "stylelint \"src/**/*.scss\"",
14+
"lint:sass:fix": "yarn lint:sass --fix",
15+
"test": "ng test flags"
16+
},
817
"peerDependencies": {
918
"@angular/common": "^14.2.0",
1019
"@angular/core": "^14.2.0"

‎packages/json-view/.stylelintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../.stylelintrc.json"
3+
}

‎packages/json-view/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"version": "14.0.0",
66
"license": "MIT",
77
"repository": "https://github.com/Liquid-JS/nxt-components.git",
8+
"scripts": {
9+
"watch": "ng build json-view --configuration \"development\" --watch",
10+
"build": "ng build json-view --configuration \"production\"",
11+
"lint": "ng lint json-view",
12+
"lint:fix": "yarn lint --fix",
13+
"lint:sass": "stylelint \"src/**/*.scss\"",
14+
"lint:sass:fix": "yarn lint:sass --fix",
15+
"test": "ng test json-view"
16+
},
817
"peerDependencies": {
918
"@angular/common": "^14.2.0",
1019
"@angular/core": "^14.2.0"
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../.stylelintrc.json"
3+
}

‎packages/pick-datetime/assets/picker.scss

+6-11
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
7070
right: 0;
7171
z-index: $cdk-z-index-overlay-backdrop;
7272
pointer-events: auto;
73-
-webkit-tap-highlight-color: transparent;
7473
transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function;
7574
opacity: 0;
7675

@@ -142,7 +141,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
142141
box-sizing: border-box;
143142
display: block;
144143
padding: 1.5em;
145-
box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12);
144+
box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12);
146145
border-radius: 2px;
147146
overflow: auto;
148147
background: #fff;
@@ -272,9 +271,7 @@ $theme-color: #3f51b5;
272271
text-align: center;
273272
outline: 0;
274273
color: rgba(0, 0, 0, 0.85);
275-
-webkit-appearance: none;
276-
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
277-
-webkit-tap-highlight-color: transparent;
274+
appearance: none;
278275
}
279276

280277
.nxt-dt-calendar-cell-content {
@@ -404,7 +401,7 @@ $theme-color: #3f51b5;
404401
left: 50%;
405402
border-radius: 50%;
406403
transform: translateX(-50%);
407-
background-color: currentColor;
404+
background-color: currentcolor;
408405
}
409406

410407
&:before {
@@ -421,7 +418,6 @@ $theme-color: #3f51b5;
421418
cursor: pointer;
422419
outline: none;
423420
border: none;
424-
-webkit-tap-highlight-color: transparent;
425421
display: inline-block;
426422
white-space: nowrap;
427423
text-decoration: none;
@@ -480,7 +476,7 @@ $theme-color: #3f51b5;
480476
svg {
481477
width: 50%;
482478
height: 50%;
483-
fill: currentColor;
479+
fill: currentcolor;
484480
}
485481
}
486482

@@ -572,7 +568,6 @@ $theme-color: #3f51b5;
572568
.nxt-dt-container-info {
573569
padding: 0 .5em;
574570
cursor: pointer;
575-
-webkit-tap-highlight-color: transparent;
576571

577572
.nxt-dt-container-range {
578573
outline: none;
@@ -597,7 +592,7 @@ $theme-color: #3f51b5;
597592
.nxt-dt-container-disabled,
598593
.nxt-dt-trigger-disabled {
599594
opacity: 0.35;
600-
filter: Alpha(Opacity = 35);
595+
filter: Alpha(opacity = 35);
601596
background-image: none;
602597
cursor: default !important;
603598
}
@@ -609,7 +604,7 @@ $theme-color: #3f51b5;
609604
color: $theme-color;
610605

611606
.nxt-dt-timer-hour12-box {
612-
border: 1px solid currentColor;
607+
border: 1px solid currentcolor;
613608
border-radius: 2px;
614609
transition: background 200ms ease;
615610

‎packages/pick-datetime/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"version": "14.0.0",
66
"license": "MIT",
77
"repository": "https://github.com/Liquid-JS/nxt-components.git",
8+
"scripts": {
9+
"watch": "ng build pick-datetime --configuration \"development\" --watch",
10+
"build": "ng build pick-datetime --configuration \"production\"",
11+
"lint": "ng lint pick-datetime",
12+
"lint:fix": "yarn lint --fix",
13+
"lint:sass": "stylelint \"src/**/*.scss\"",
14+
"lint:sass:fix": "yarn lint:sass --fix",
15+
"test": "ng test pick-datetime"
16+
},
817
"peerDependencies": {
918
"@angular/animations": "^14.2.0",
1019
"@angular/common": "^14.2.0",

‎packages/pick-datetime/src/lib/date-time/calendar-body/calendar-body.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class CalendarCell {
1616
@Component({
1717
// eslint-disable-next-line @angular-eslint/component-selector
1818
selector: '[nxtDateTimeCalendarBody]',
19-
exportAs: 'dateTimeCalendarBody',
19+
exportAs: 'nxtDateTimeCalendarBody',
2020
templateUrl: './calendar-body.component.html',
2121
styleUrls: ['./calendar-body.component.scss'],
2222
preserveWhitespaces: false,

‎packages/pick-datetime/src/lib/date-time/date-time-picker-input.directive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const NXT_DATETIME_VALIDATORS: any = {
2222

2323
@Directive({
2424
selector: 'input[nxtDateTime]',
25-
exportAs: 'dateTimeInput',
25+
exportAs: 'nxtDateTimeInput',
2626
providers: [
2727
NXT_DATETIME_VALUE_ACCESSOR,
2828
NXT_DATETIME_VALIDATORS

‎yarn.lock

+97-110
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.