Skip to content

Commit 27bafd3

Browse files
committed
chore: NS8 typings fix
1 parent 0c758fe commit 27bafd3

File tree

12 files changed

+50
-53
lines changed

12 files changed

+50
-53
lines changed

package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,35 @@
5555
"@angular/platform-browser": "~11.2.0",
5656
"@angular/platform-browser-dynamic": "~11.2.0",
5757
"@angular/router": "~11.2.0",
58-
"@commitlint/cli": "^12.0.1",
59-
"@commitlint/config-conventional": "^12.0.1",
60-
"@nativescript-community/text": "^1.4.9",
58+
"@commitlint/cli": "^12.1.1",
59+
"@commitlint/config-conventional": "^12.1.1",
60+
"@nativescript-community/text": "^1.4.11",
6161
"@nativescript/angular": "ns8",
62-
"@nativescript/core": "8.0.0-alpha.8",
62+
"@nativescript/core": "8.0.1",
6363
"@nativescript/eslint-plugin": "0.0.4",
6464
"@nativescript/hook": "~2.0.0",
65-
"@nativescript/types": "7.3.0",
66-
"@nativescript/webpack": "~4.0.1",
67-
"@types/node": "~14.14.35",
68-
"@typescript-eslint/eslint-plugin": "4.18.0",
69-
"@typescript-eslint/parser": "4.18.0",
65+
"@nativescript/types": "8.0.0",
66+
"@nativescript/webpack": "beta",
67+
"@types/node": "~14.14.41",
68+
"@typescript-eslint/eslint-plugin": "4.22.0",
69+
"@typescript-eslint/parser": "4.22.0",
7070
"cpy-cli": "~3.1.1",
71-
"eslint": "7.22.0",
72-
"eslint-config-prettier": "^8.1.0",
73-
"eslint-plugin-prettier": "^3.3.1",
74-
"eslint-plugin-vue": "^7.8.0",
71+
"eslint": "7.24.0",
72+
"eslint-config-prettier": "^8.2.0",
73+
"eslint-plugin-prettier": "^3.4.0",
74+
"eslint-plugin-vue": "^7.9.0",
7575
"globby": "^11.0.3",
76-
"husky": "^4.3.8",
76+
"husky": "^6.0.0",
7777
"lerna": "^4.0.0",
78-
"nativescript": "7.2.1",
79-
"nativescript-vue": "~2.8.4",
78+
"nativescript-vue": "~2.9.0",
8079
"ng-packagr": "~11.2.0",
8180
"prettier": "^2.2.1",
8281
"prompt": "^1.1.0",
8382
"rimraf": "^3.0.2",
8483
"rxjs": "^6.6.6",
8584
"ts-patch": "^1.3.2",
86-
"typedoc": "^0.20.33",
87-
"typescript": "~4.0.0",
85+
"typedoc": "^0.20.35",
86+
"typescript": "~4.2.4",
8887
"vue": "2.6.12"
8988
},
9089
"commitlint": {

src/bottom-navigation/index.android.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { TabStrip } from '@nativescript-community/ui-material-core/tab-navigatio
44
import { TabStripItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip-item';
55
// Types
66
// Requires
7-
import { Application, CSSType, Color, Enums, Font, Frame, ImageSource, Utils, View } from '@nativescript/core';
7+
import { Application, CSSType, Color, CoreTypes, Font, Frame, ImageSource, Utils, View } from '@nativescript/core';
88
import { getTransformedText } from '@nativescript/core/ui/text-base';
99
export { TabContentItem, TabStrip, TabStripItem };
1010

@@ -249,7 +249,7 @@ export class BottomNavigation extends TabNavigationBase {
249249
private _currentTransaction: androidx.fragment.app.FragmentTransaction;
250250
private _attachedToWindow = false;
251251
public _originalBackground: any;
252-
private _textTransform: Enums.TextTransformType = 'none';
252+
private _textTransform: CoreTypes.TextTransformType = 'none';
253253
private _selectedItemColor: Color;
254254
private _unSelectedItemColor: Color;
255255
fragments: androidx.fragment.app.Fragment[] = [];
@@ -685,9 +685,9 @@ export class BottomNavigation extends TabNavigationBase {
685685
});
686686
}
687687

688-
private getItemLabelTextTransform(tabStripItem: TabStripItem): Enums.TextTransformType {
688+
private getItemLabelTextTransform(tabStripItem: TabStripItem): CoreTypes.TextTransformType {
689689
const nestedLabel = tabStripItem.label;
690-
let textTransform: Enums.TextTransformType = null;
690+
let textTransform: CoreTypes.TextTransformType = null;
691691
if (nestedLabel && nestedLabel.style.textTransform !== 'initial') {
692692
textTransform = nestedLabel.style.textTransform;
693693
} else if (tabStripItem.style.textTransform !== 'initial') {
@@ -934,17 +934,17 @@ export class BottomNavigation extends TabNavigationBase {
934934
tabStripItem.nativeViewProtected.setTypeface(value.getAndroidTypeface());
935935
}
936936

937-
public setTabBarItemTextTransform(tabStripItem: TabStripItem, value: Enums.TextTransformType): void {
937+
public setTabBarItemTextTransform(tabStripItem: TabStripItem, value: CoreTypes.TextTransformType): void {
938938
const titleLabel = tabStripItem.label;
939939
const title = getTransformedText(titleLabel.text, value);
940940
tabStripItem.nativeViewProtected.setText(title);
941941
}
942942

943-
public getTabBarTextTransform(): Enums.TextTransformType {
943+
public getTabBarTextTransform(): CoreTypes.TextTransformType {
944944
return this._textTransform;
945945
}
946946

947-
public setTabBarTextTransform(value: Enums.TextTransformType): void {
947+
public setTabBarTextTransform(value: CoreTypes.TextTransformType): void {
948948
const items = this.tabStrip && this.tabStrip.items;
949949
if (items) {
950950
items.forEach((tabStripItem) => {

src/bottom-navigation/index.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TabStrip } from '@nativescript-community/ui-material-core/tab-navigatio
55
import { TabStripItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip-item';
66
// Types
77
// Requires
8-
import { CSSType, Color, Device, Enums, Font, Frame, IOSHelper, ImageSource, Property, Utils, View, booleanConverter } from '@nativescript/core';
8+
import { CSSType, Color, Device, CoreTypes, Font, Frame, IOSHelper, ImageSource, Property, Utils, View, booleanConverter } from '@nativescript/core';
99
import { getTransformedText } from '@nativescript/core/ui/text-base';
1010
import { iOSNativeHelper } from '@nativescript/core/utils';
1111
export { TabContentItem, TabStrip, TabStripItem };
@@ -439,7 +439,7 @@ export class BottomNavigation extends TabNavigationBase {
439439
this.setViewAttributes(tabStripItem.nativeView, tabStripItem.label);
440440
}
441441

442-
public setTabBarItemTextTransform(tabStripItem: TabStripItem, value: Enums.TextTransformType): void {
442+
public setTabBarItemTextTransform(tabStripItem: TabStripItem, value: CoreTypes.TextTransformType): void {
443443
tabStripItem.nativeView.title = getTransformedText(tabStripItem.label.text, value);
444444
}
445445

src/button/button.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
backgroundInternalProperty,
1414
colorProperty,
1515
profile,
16-
Enums
16+
CoreTypes
1717
} from '@nativescript/core';
1818
import { textAlignmentProperty, textTransformProperty } from '@nativescript/core/ui/text-base';
1919
import { ButtonBase, imageSourceProperty, srcProperty } from './button-common';
@@ -141,7 +141,7 @@ export class Button extends ButtonBase {
141141
setStrokeWidth(value) {
142142
this.nativeViewProtected.setStrokeWidth(value);
143143
}
144-
[textTransformProperty.setNative](value: Enums.TextTransformType) {
144+
[textTransformProperty.setNative](value: CoreTypes.TextTransformType) {
145145
this.nativeViewProtected.setAllCaps(value !== 'none');
146146
}
147147
[backgroundInternalProperty.getDefault]() {
@@ -169,7 +169,7 @@ export class Button extends ButtonBase {
169169
}
170170
}
171171

172-
[textAlignmentProperty.setNative](value: Enums.TextAlignmentType) {
172+
[textAlignmentProperty.setNative](value: CoreTypes.TextAlignmentType) {
173173
this.nativeTextViewProtected.setGravity(getHorizontalGravity(value) | getVerticalGravity(this.verticalTextAlignment));
174174
}
175175
[verticalTextAlignmentProperty.setNative](value: VerticalTextAlignment) {

src/button/button.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
borderTopRightRadiusProperty,
1414
colorProperty,
1515
fontInternalProperty,
16-
Enums,
16+
CoreTypes,
1717
} from '@nativescript/core';
1818
import { textTransformProperty } from '@nativescript/core/ui/text-base';
1919
import { ButtonBase, imageSourceProperty, srcProperty } from './button-common';
@@ -221,7 +221,7 @@ export class Button extends ButtonBase {
221221
}
222222
}
223223

224-
[textTransformProperty.setNative](value: Enums.TextTransformType) {
224+
[textTransformProperty.setNative](value: CoreTypes.TextTransformType) {
225225
this.nativeViewProtected.uppercaseTitle = value !== 'none';
226226
}
227227
[rippleColorProperty.setNative](color: Color) {

src/core/android/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { VerticalTextAlignment } from '@nativescript-community/text';
2-
import { Application, Color, Utils, ViewBase, profile, Enums } from '@nativescript/core';
2+
import { Application, Color, Utils, ViewBase, profile, CoreTypes } from '@nativescript/core';
33

44
let isPostLollipopVar: boolean;
55
export function isPostLollipop() {
@@ -249,7 +249,7 @@ export function getAttr(context: android.content.Context, id: string) {
249249
return context.getResources().getIdentifier(id, 'attr', context.getPackageName());
250250
}
251251

252-
export function getHorizontalGravity(textAlignment: Enums.TextAlignmentType) {
252+
export function getHorizontalGravity(textAlignment: CoreTypes.TextAlignmentType) {
253253
switch (textAlignment) {
254254
case 'initial':
255255
case 'left':

src/core/tab-navigation-base/tab-strip-item/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @module @nativescript-community/ui-material-core/tab-navigation-base/tab-strip-item
33
*/
4-
import { AddChildFromBuilder, CSSType, Color, Enums, Image, Label, PropertyChangeData, PseudoClassHandler, View, ViewBase } from '@nativescript/core';
4+
import { AddChildFromBuilder, CSSType, Color, CoreTypes, Image, Label, PropertyChangeData, PseudoClassHandler, View, ViewBase } from '@nativescript/core';
55
import { backgroundColorProperty, backgroundInternalProperty } from '@nativescript/core/ui/styling/style-properties';
66
import { textTransformProperty } from '@nativescript/core/ui/text-base';
77
import { TabStripItem as TabStripItemDefinition } from '.';
@@ -263,13 +263,13 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi
263263
return tabStripParent && tabStripParent.setTabBarItemBackgroundColor(this, value);
264264
}
265265

266-
[textTransformProperty.getDefault](): Enums.TextTransformType {
266+
[textTransformProperty.getDefault](): CoreTypes.TextTransformType {
267267
const parent = this.parent as TabStrip;
268268
const tabStripParent = parent && (parent.parent as TabNavigationBase);
269269

270270
return tabStripParent && tabStripParent.getTabBarItemTextTransform(this);
271271
}
272-
[textTransformProperty.setNative](value: Enums.TextTransformType) {
272+
[textTransformProperty.setNative](value: CoreTypes.TextTransformType) {
273273
const parent = this.parent as TabStrip;
274274
const tabStripParent = parent && (parent.parent as TabNavigationBase);
275275

src/dialogs/dialogs-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Color, Enums, Font, ImageSource, View, ViewBase } from '@nativescript/core';
1+
import { Color, CoreTypes, Font, ImageSource, View, ViewBase } from '@nativescript/core';
22

33
export interface MDCAlertControlerOptions {
44
buttonFont?: Font;

src/tabs/tabs.android.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Application, CoercibleProperty, Color, Enums, Font, Frame, ImageSource, Property, Utils, View, getTransformedText, isIOS } from '@nativescript/core';
1+
import { Application, CoercibleProperty, Color, CoreTypes, Font, Frame, ImageSource, Property, Utils, View, getTransformedText, isIOS } from '@nativescript/core';
22
import { TabStrip } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip';
33
import { TabStripItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-strip-item';
44
import { TabContentItem } from '@nativescript-community/ui-material-core/tab-navigation-base/tab-content-item';
@@ -397,7 +397,7 @@ export class Tabs extends TabsBase {
397397
private _pagerAdapter: androidx.viewpager.widget.PagerAdapter;
398398
private _androidViewId = -1;
399399
public _originalBackground: any;
400-
private _textTransform: Enums.TextTransformType = 'uppercase';
400+
private _textTransform: CoreTypes.TextTransformType = 'uppercase';
401401
private _selectedItemColor: Color;
402402
private _unSelectedItemColor: Color;
403403
fragments: androidx.fragment.app.Fragment[] = [];
@@ -693,9 +693,9 @@ export class Tabs extends TabsBase {
693693
});
694694
}
695695

696-
private getItemLabelTextTransform(tabStripItem: TabStripItem): Enums.TextTransformType {
696+
private getItemLabelTextTransform(tabStripItem: TabStripItem): CoreTypes.TextTransformType {
697697
const nestedLabel = tabStripItem.label;
698-
let textTransform: Enums.TextTransformType = null;
698+
let textTransform: CoreTypes.TextTransformType = null;
699699
if (nestedLabel && nestedLabel.style.textTransform !== 'initial') {
700700
textTransform = nestedLabel.style.textTransform;
701701
} else if (tabStripItem.style.textTransform !== 'initial') {
@@ -946,21 +946,21 @@ export class Tabs extends TabsBase {
946946
tabStripItem.nativeViewProtected.setTypeface(value.getAndroidTypeface());
947947
}
948948

949-
public getTabBarItemTextTransform(tabStripItem: TabStripItem): Enums.TextTransformType {
949+
public getTabBarItemTextTransform(tabStripItem: TabStripItem): CoreTypes.TextTransformType {
950950
return this.getItemLabelTextTransform(tabStripItem);
951951
}
952952

953-
public setTabBarItemTextTransform(tabStripItem: TabStripItem, value: Enums.TextTransformType): void {
953+
public setTabBarItemTextTransform(tabStripItem: TabStripItem, value: CoreTypes.TextTransformType): void {
954954
const nestedLabel = tabStripItem.label;
955955
const title = getTransformedText(nestedLabel.text, value);
956956
tabStripItem.nativeViewProtected.setText(title);
957957
}
958958

959-
public getTabBarTextTransform(): Enums.TextTransformType {
959+
public getTabBarTextTransform(): CoreTypes.TextTransformType {
960960
return this._textTransform;
961961
}
962962

963-
public setTabBarTextTransform(value: Enums.TextTransformType): void {
963+
public setTabBarTextTransform(value: CoreTypes.TextTransformType): void {
964964
const items = this.tabStrip && this.tabStrip.items;
965965
if (items) {
966966
items.forEach((tabStripItem) => {

src/textfield/textfield.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
profile,
3434
textAlignmentProperty,
3535
LengthType,
36-
Enums
36+
CoreTypes
3737
} from '@nativescript/core';
3838
import { secureProperty } from '@nativescript/core/ui/text-field';
3939
import { TextFieldBase } from './textfield.common';
@@ -302,7 +302,7 @@ export class TextField extends TextFieldBase {
302302
[paddingLeftProperty.setNative](value: LengthType) {
303303
org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
304304
}
305-
[textAlignmentProperty.setNative](value: Enums.TextAlignmentType) {
305+
[textAlignmentProperty.setNative](value: CoreTypes.TextAlignmentType) {
306306
this.nativeTextViewProtected.setGravity(getHorizontalGravity(value) | getVerticalGravity(this.verticalTextAlignment));
307307
}
308308
[verticalTextAlignmentProperty.setNative](value: VerticalTextAlignment) {

0 commit comments

Comments
 (0)