@nativescript-community/ui-material-core 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +1559 -0
  2. package/LICENSE +201 -0
  3. package/README.md +5 -0
  4. package/android/utils.d.ts +44 -0
  5. package/android/utils.js +257 -0
  6. package/android/utils.js.map +1 -0
  7. package/cssproperties.d.ts +7 -0
  8. package/cssproperties.js +49 -0
  9. package/cssproperties.js.map +1 -0
  10. package/index.android.d.ts +42 -0
  11. package/index.android.js +318 -0
  12. package/index.android.js.map +1 -0
  13. package/index.common.d.ts +9 -0
  14. package/index.common.js +79 -0
  15. package/index.common.js.map +1 -0
  16. package/index.d.ts +67 -0
  17. package/index.ios.d.ts +46 -0
  18. package/index.ios.js +336 -0
  19. package/index.ios.js.map +1 -0
  20. package/package.json +55 -0
  21. package/platforms/android/AndroidManifest.xml +2 -0
  22. package/platforms/android/include.gradle +10 -0
  23. package/platforms/android/java/com/nativescript/material/core/BottomNavigationBar.java +309 -0
  24. package/platforms/android/java/com/nativescript/material/core/TabItemSpec.java +15 -0
  25. package/platforms/android/java/com/nativescript/material/core/TabLayout.java +441 -0
  26. package/platforms/android/java/com/nativescript/material/core/TabStrip.java +264 -0
  27. package/platforms/android/java/com/nativescript/material/core/TabViewPager.java +62 -0
  28. package/platforms/android/java/com/nativescript/material/core/TabsBar.java +442 -0
  29. package/platforms/android/java/com/nativescript/material/core/Utils.java +105 -0
  30. package/platforms/android/res/layout/material_page.xml +33 -0
  31. package/platforms/android/ui_material_core.aar +0 -0
  32. package/platforms/ios/Podfile +2 -0
  33. package/pnpm-lock.yaml +83 -0
  34. package/postinstall.d.ts +0 -0
  35. package/postinstall.js +2 -0
  36. package/postinstall.js.map +1 -0
  37. package/preuninstall.d.ts +0 -0
  38. package/preuninstall.js +2 -0
  39. package/preuninstall.js.map +1 -0
  40. package/scripts/before-prepare.js +28 -0
  41. package/scripts/before-prepare.js.map +1 -0
  42. package/tab-navigation-base/react/index.d.ts +60 -0
  43. package/tab-navigation-base/react/index.js +117 -0
  44. package/tab-navigation-base/react/index.js.map +1 -0
  45. package/tab-navigation-base/tab-content-item/index.android.d.ts +14 -0
  46. package/tab-navigation-base/tab-content-item/index.android.js +46 -0
  47. package/tab-navigation-base/tab-content-item/index.android.js.map +1 -0
  48. package/tab-navigation-base/tab-content-item/index.d.ts +11 -0
  49. package/tab-navigation-base/tab-content-item/index.ios.d.ts +7 -0
  50. package/tab-navigation-base/tab-content-item/index.ios.js +13 -0
  51. package/tab-navigation-base/tab-content-item/index.ios.js.map +1 -0
  52. package/tab-navigation-base/tab-content-item/tab-content-item-common.d.ts +7 -0
  53. package/tab-navigation-base/tab-content-item/tab-content-item-common.js +22 -0
  54. package/tab-navigation-base/tab-content-item/tab-content-item-common.js.map +1 -0
  55. package/tab-navigation-base/tab-navigation-base/index.d.ts +67 -0
  56. package/tab-navigation-base/tab-navigation-base/index.js +234 -0
  57. package/tab-navigation-base/tab-navigation-base/index.js.map +1 -0
  58. package/tab-navigation-base/tab-strip/index.d.ts +24 -0
  59. package/tab-navigation-base/tab-strip/index.js +151 -0
  60. package/tab-navigation-base/tab-strip/index.js.map +1 -0
  61. package/tab-navigation-base/tab-strip-item/index.d.ts +34 -0
  62. package/tab-navigation-base/tab-strip-item/index.js +215 -0
  63. package/tab-navigation-base/tab-strip-item/index.js.map +1 -0
  64. package/textbase/cssproperties.d.ts +16 -0
  65. package/textbase/cssproperties.js +103 -0
  66. package/textbase/cssproperties.js.map +1 -0
  67. package/tsconfig.hooks.json +17 -0
@@ -0,0 +1,318 @@
1
+ import { Application, Button, Color, Length, PercentLength, View, androidDynamicElevationOffsetProperty, androidElevationProperty, backgroundInternalProperty } from '@nativescript/core';
2
+ import { createRippleDrawable, createStateListAnimator, getAttrColor, getColorStateList, handleClearFocus, isPostLollipop, isPostMarshmallow } from './android/utils';
3
+ import { CornerFamily, applyMixins } from './index.common';
4
+ import { cssProperty, dynamicElevationOffsetProperty, elevationProperty, rippleColorProperty } from './cssproperties';
5
+ import { ad } from '@nativescript/core/utils';
6
+ export * from './cssproperties';
7
+ export { applyMixins };
8
+ function createCornerTreatment(cornerFamily) {
9
+ switch (cornerFamily) {
10
+ case CornerFamily.CUT:
11
+ return new com.google.android.material.shape.CutCornerTreatment();
12
+ default:
13
+ case CornerFamily.ROUNDED:
14
+ return new com.google.android.material.shape.RoundedCornerTreatment();
15
+ }
16
+ }
17
+ export class Themer {
18
+ constructor() {
19
+ this._shapes = {};
20
+ }
21
+ getOrcreateAppColorScheme() {
22
+ }
23
+ getAppColorScheme() {
24
+ }
25
+ setPrimaryColor(value) {
26
+ this.primaryColor = value;
27
+ }
28
+ getPrimaryColor() {
29
+ if (!this.primaryColor) {
30
+ this.primaryColor = new Color(getAttrColor(Application.android.startActivity, 'colorPrimary'));
31
+ }
32
+ return this.primaryColor;
33
+ }
34
+ setOnPrimaryColor(value) {
35
+ this.onPrimaryColor = value;
36
+ }
37
+ getOnPrimaryColor() {
38
+ if (!this.onPrimaryColor) {
39
+ this.onPrimaryColor = new Color(getAttrColor(Application.android.startActivity, 'colorOnPrimary'));
40
+ }
41
+ return this.onPrimaryColor;
42
+ }
43
+ setAccentColor(value) {
44
+ if (!this.accentColor) {
45
+ this.accentColor = new Color(getAttrColor(Application.android.startActivity, 'colorAccent'));
46
+ }
47
+ this.accentColor = value;
48
+ }
49
+ getAccentColor() {
50
+ return this.accentColor;
51
+ }
52
+ setSurfaceColor(value) {
53
+ this.surfaceColor = value;
54
+ }
55
+ getSurfaceColor() {
56
+ return this.surfaceColor;
57
+ }
58
+ setOnSurfaceColor(value) {
59
+ this.onSurfaceColor = value;
60
+ }
61
+ getOnSurfaceColor() {
62
+ return this.onSurfaceColor;
63
+ }
64
+ setPrimaryColorVariant(value) {
65
+ this.primaryColorVariant = value;
66
+ }
67
+ getPrimaryColorVariant() {
68
+ if (!this.primaryColorVariant) {
69
+ this.primaryColorVariant = new Color(getAttrColor(Application.android.context, 'colorSecondary'));
70
+ }
71
+ return this.primaryColorVariant;
72
+ }
73
+ setSecondaryColor(value) {
74
+ this.secondaryColor = value;
75
+ }
76
+ getSecondaryColor() {
77
+ return this.secondaryColor;
78
+ }
79
+ getControlHighlightColor() {
80
+ if (!this.controlHighlightColor) {
81
+ this.controlHighlightColor = new Color(getAttrColor(Application.android.context, 'colorControlHighlight'));
82
+ }
83
+ return this.controlHighlightColor;
84
+ }
85
+ getShape(key) {
86
+ return this._shapes[key] || null;
87
+ }
88
+ createShape(key, options) {
89
+ const builder = com.google.android.material.shape.ShapeAppearanceModel.builder();
90
+ if (options.cornerFamily) {
91
+ builder.setAllCorners(createCornerTreatment(options.cornerFamily));
92
+ }
93
+ if (options.cornerFamilyBottomRight) {
94
+ builder.setBottomRightCorner(createCornerTreatment(options.cornerFamilyBottomRight));
95
+ }
96
+ if (options.cornerFamilyBottomLeft) {
97
+ builder.setBottomLeftCorner(createCornerTreatment(options.cornerFamilyBottomLeft));
98
+ }
99
+ if (options.cornerFamilyTopLeft) {
100
+ builder.setTopLeftCorner(createCornerTreatment(options.cornerFamilyTopLeft));
101
+ }
102
+ if (options.cornerFamilyTopRight) {
103
+ builder.setTopRightCorner(createCornerTreatment(options.cornerFamilyTopRight));
104
+ }
105
+ if (options.cornerSize !== undefined) {
106
+ if (typeof options.cornerSize === 'object') {
107
+ if (options.cornerSize.unit === '%') {
108
+ builder.setAllCornerSizes(new com.google.android.material.shape.RelativeCornerSize(options.cornerSize.value));
109
+ }
110
+ else {
111
+ builder.setAllCornerSizes(PercentLength.toDevicePixels(options.cornerSize));
112
+ }
113
+ }
114
+ else {
115
+ builder.setAllCornerSizes(PercentLength.toDevicePixels(options.cornerSize));
116
+ }
117
+ }
118
+ if (options.cornerSizeBottomLeft !== undefined) {
119
+ if (typeof options.cornerSizeBottomLeft === 'object') {
120
+ if (options.cornerSizeBottomLeft.unit === '%') {
121
+ builder.setBottomLeftCornerSize(new com.google.android.material.shape.RelativeCornerSize(options.cornerSizeBottomLeft.value));
122
+ }
123
+ else {
124
+ builder.setBottomLeftCornerSize(PercentLength.toDevicePixels(options.cornerSizeBottomLeft));
125
+ }
126
+ }
127
+ else {
128
+ builder.setBottomLeftCornerSize(PercentLength.toDevicePixels(options.cornerSizeBottomLeft));
129
+ }
130
+ }
131
+ if (options.cornerSizeBottomRight !== undefined) {
132
+ if (typeof options.cornerSizeBottomRight === 'object') {
133
+ if (options.cornerSizeBottomRight.unit === '%') {
134
+ builder.setBottomRightCornerSize(new com.google.android.material.shape.RelativeCornerSize(options.cornerSizeBottomRight.value));
135
+ }
136
+ else {
137
+ builder.setBottomRightCornerSize(PercentLength.toDevicePixels(options.cornerSizeBottomRight));
138
+ }
139
+ }
140
+ else {
141
+ builder.setBottomRightCornerSize(PercentLength.toDevicePixels(options.cornerSizeBottomRight));
142
+ }
143
+ }
144
+ if (options.cornerSizeTopRight !== undefined) {
145
+ if (typeof options.cornerSizeTopRight === 'object') {
146
+ if (options.cornerSizeTopRight.unit === '%') {
147
+ builder.setTopRightCornerSize(new com.google.android.material.shape.RelativeCornerSize(options.cornerSizeTopRight.value));
148
+ }
149
+ else {
150
+ builder.setTopRightCornerSize(PercentLength.toDevicePixels(options.cornerSizeTopRight));
151
+ }
152
+ }
153
+ else {
154
+ builder.setTopRightCornerSize(PercentLength.toDevicePixels(options.cornerSizeTopRight));
155
+ }
156
+ }
157
+ if (options.cornerSizeTopLeft !== undefined) {
158
+ if (typeof options.cornerSizeTopLeft === 'object') {
159
+ if (options.cornerSizeTopLeft.unit === '%') {
160
+ builder.setTopLeftCornerSize(new com.google.android.material.shape.RelativeCornerSize(options.cornerSizeTopLeft.value));
161
+ }
162
+ else {
163
+ builder.setTopLeftCornerSize(PercentLength.toDevicePixels(options.cornerSizeTopLeft));
164
+ }
165
+ }
166
+ else {
167
+ builder.setTopLeftCornerSize(PercentLength.toDevicePixels(options.cornerSizeTopLeft));
168
+ }
169
+ }
170
+ this._shapes[key] = builder.build();
171
+ }
172
+ }
173
+ export const themer = new Themer();
174
+ export function install() { }
175
+ export function getRippleColor(color) {
176
+ if (color) {
177
+ const temp = color instanceof Color ? color : new Color(color);
178
+ return new Color(temp.a !== 255 ? temp.a : 61.5, temp.r, temp.g, temp.b).android;
179
+ }
180
+ return null;
181
+ }
182
+ let mixinInstalled = false;
183
+ export function overrideViewBase() {
184
+ const NSView = require('@nativescript/core').View;
185
+ class ViewWithElevationAndRipple extends View {
186
+ constructor() {
187
+ super(...arguments);
188
+ this.elevation = 0;
189
+ this.dynamicElevationOffset = 0;
190
+ }
191
+ getRippleColor() {
192
+ if (this.rippleColor) {
193
+ return getRippleColor(this.rippleColor);
194
+ }
195
+ return getRippleColor(themer.getAccentColor());
196
+ }
197
+ setRippleDrawable(view, radius = 0) {
198
+ if (!this.rippleDrawable) {
199
+ this.rippleDrawable = createRippleDrawable(this.getRippleColor(), radius);
200
+ if (isPostMarshmallow()) {
201
+ view.setForeground(this.rippleDrawable);
202
+ }
203
+ }
204
+ }
205
+ [rippleColorProperty.setNative](color) {
206
+ const rippleColor = getRippleColor(color);
207
+ const nativeViewProtected = this.nativeViewProtected;
208
+ if (this instanceof Button && isPostMarshmallow()) {
209
+ const foreground = nativeViewProtected.getForeground();
210
+ if (foreground instanceof android.graphics.drawable.RippleDrawable) {
211
+ foreground.setColor(getColorStateList(rippleColor));
212
+ return;
213
+ }
214
+ const background = nativeViewProtected.getBackground();
215
+ if (background instanceof android.graphics.drawable.RippleDrawable) {
216
+ background.setColor(getColorStateList(rippleColor));
217
+ return;
218
+ }
219
+ }
220
+ nativeViewProtected.setClickable(this.isUserInteractionEnabled);
221
+ const rippleDrawable = this.rippleDrawable;
222
+ if (!rippleDrawable) {
223
+ this.setRippleDrawable(nativeViewProtected, Length.toDevicePixels(this.style.borderTopLeftRadius));
224
+ }
225
+ else {
226
+ if (isPostLollipop()) {
227
+ rippleDrawable.setColor(getColorStateList(rippleColor));
228
+ }
229
+ else if (rippleDrawable.rippleShape) {
230
+ rippleDrawable.rippleShape.getPaint().setColor(rippleColor);
231
+ }
232
+ }
233
+ }
234
+ [backgroundInternalProperty.setNative](value) {
235
+ if (this.nativeViewProtected) {
236
+ if (value instanceof android.graphics.drawable.Drawable) {
237
+ }
238
+ else {
239
+ if (this.rippleDrawable || (value.color && this instanceof Button && this.rippleColor)) {
240
+ this.rippleDrawable = null;
241
+ this.setRippleDrawable(this.nativeViewProtected, value.borderTopLeftRadius);
242
+ }
243
+ }
244
+ }
245
+ }
246
+ requestFocus() {
247
+ this.focus();
248
+ }
249
+ clearFocus() {
250
+ handleClearFocus(this.nativeViewProtected);
251
+ ad.dismissSoftInput(this.nativeViewProtected);
252
+ }
253
+ getDefaultElevation() {
254
+ const result = this instanceof Button ? 2 : 0;
255
+ return result;
256
+ }
257
+ getDefaultDynamicElevationOffset() {
258
+ const result = this instanceof Button ? 6 : 0;
259
+ return result;
260
+ }
261
+ [elevationProperty.setNative](value) {
262
+ if (isPostLollipop()) {
263
+ this.createStateListAnimator();
264
+ }
265
+ else {
266
+ const newValue = Length.toDevicePixels(typeof value === 'string' ? Length.parse(value) : value, 0);
267
+ androidx.core.view.ViewCompat.setElevation(this.nativeViewProtected, newValue);
268
+ }
269
+ }
270
+ createStateListAnimator() {
271
+ if (!this.createStateListAnimatorTimeout) {
272
+ this.createStateListAnimatorTimeout = setTimeout(() => {
273
+ this.createStateListAnimatorTimeout = null;
274
+ createStateListAnimator(this, this.nativeViewProtected);
275
+ });
276
+ }
277
+ }
278
+ [dynamicElevationOffsetProperty.setNative](value) {
279
+ this.nativeViewProtected.setClickable(this.isUserInteractionEnabled);
280
+ if (isPostLollipop()) {
281
+ this.createStateListAnimator();
282
+ }
283
+ else {
284
+ const newValue = Length.toDevicePixels(typeof value === 'string' ? Length.parse(value) : value, 0);
285
+ androidx.core.view.ViewCompat.setTranslationZ(this.nativeViewProtected, newValue);
286
+ }
287
+ }
288
+ }
289
+ __decorate([
290
+ cssProperty,
291
+ __metadata("design:type", Object)
292
+ ], ViewWithElevationAndRipple.prototype, "elevation", void 0);
293
+ __decorate([
294
+ cssProperty,
295
+ __metadata("design:type", Object)
296
+ ], ViewWithElevationAndRipple.prototype, "dynamicElevationOffset", void 0);
297
+ __decorate([
298
+ cssProperty,
299
+ __metadata("design:type", Color)
300
+ ], ViewWithElevationAndRipple.prototype, "rippleColor", void 0);
301
+ applyMixins(NSView, [ViewWithElevationAndRipple]);
302
+ class ViewOverride extends View {
303
+ [androidElevationProperty.setNative](value) {
304
+ this[elevationProperty.setNative](value);
305
+ }
306
+ [androidDynamicElevationOffsetProperty.setNative](value) {
307
+ this[dynamicElevationOffsetProperty.setNative](value);
308
+ }
309
+ }
310
+ applyMixins(NSView, [ViewOverride], { override: true });
311
+ }
312
+ export function installMixins() {
313
+ if (!mixinInstalled) {
314
+ mixinInstalled = true;
315
+ overrideViewBase();
316
+ }
317
+ }
318
+ //# sourceMappingURL=index.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.android.js","sourceRoot":"../src/","sources":["index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EAEX,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAa,EACb,IAAI,EACJ,qCAAqC,EACrC,wBAAwB,EACxB,0BAA0B,EAE7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAqB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzL,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtH,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,SAAS,q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MAAM,YAAa,SAAQ,IAAI;QAC3B,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,KAAa;YAE9C,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QACD,CAAC,qCAAqC,CAAC,SAAS,CAAC,CAAC,KAAa;YAE3D,IAAI,CAAC,8BAA8B,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1D,CAAC;KACJ;IACD,WAAW,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,aAAa;IACzB,IAAI,CAAC,cAAc,EAAE;QACjB,cAAc,GAAG,IAAI,CAAC;QACtB,gBAAgB,EAAE,CAAC;KACtB;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare enum CornerFamily {
2
+ CUT = "cut",
3
+ ROUNDED = "rounded"
4
+ }
5
+ export declare function applyMixins(derivedCtor: any, baseCtors: any[], options?: {
6
+ after?: boolean;
7
+ override?: boolean;
8
+ omit?: (string | symbol)[];
9
+ }): void;
@@ -0,0 +1,79 @@
1
+ export var CornerFamily;
2
+ (function (CornerFamily) {
3
+ CornerFamily["CUT"] = "cut";
4
+ CornerFamily["ROUNDED"] = "rounded";
5
+ })(CornerFamily || (CornerFamily = {}));
6
+ export function applyMixins(derivedCtor, baseCtors, options) {
7
+ const omits = options && options.omit ? options.omit : [];
8
+ baseCtors.forEach((baseCtor) => {
9
+ Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
10
+ if (omits.indexOf(name) !== -1) {
11
+ return;
12
+ }
13
+ const descriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
14
+ if (name === 'constructor')
15
+ return;
16
+ if (descriptor && (descriptor.get || descriptor.set)) {
17
+ Object.defineProperty(derivedCtor.prototype, name, descriptor);
18
+ }
19
+ else {
20
+ const oldImpl = derivedCtor.prototype[name];
21
+ if (!oldImpl) {
22
+ derivedCtor.prototype[name] = baseCtor.prototype[name];
23
+ }
24
+ else {
25
+ derivedCtor.prototype[name] = function (...args) {
26
+ if (options) {
27
+ if (options.override) {
28
+ return baseCtor.prototype[name].apply(this, args);
29
+ }
30
+ else if (options.after) {
31
+ oldImpl.apply(this, args);
32
+ return baseCtor.prototype[name].apply(this, args);
33
+ }
34
+ else {
35
+ baseCtor.prototype[name].apply(this, args);
36
+ return oldImpl.apply(this, args);
37
+ }
38
+ }
39
+ else {
40
+ baseCtor.prototype[name].apply(this, args);
41
+ return oldImpl.apply(this, args);
42
+ }
43
+ };
44
+ }
45
+ }
46
+ });
47
+ Object.getOwnPropertySymbols(baseCtor.prototype).forEach((symbol) => {
48
+ if (omits.indexOf(symbol) !== -1) {
49
+ return;
50
+ }
51
+ const oldImpl = derivedCtor.prototype[symbol];
52
+ if (!oldImpl) {
53
+ derivedCtor.prototype[symbol] = baseCtor.prototype[symbol];
54
+ }
55
+ else {
56
+ derivedCtor.prototype[symbol] = function (...args) {
57
+ if (options) {
58
+ if (options.override) {
59
+ return baseCtor.prototype[symbol].apply(this, args);
60
+ }
61
+ else if (options.after) {
62
+ oldImpl.apply(this, args);
63
+ return baseCtor.prototype[symbol].apply(this, args);
64
+ }
65
+ else {
66
+ baseCtor.prototype[symbol].apply(this, args);
67
+ return oldImpl.apply(this, args);
68
+ }
69
+ }
70
+ else {
71
+ baseCtor.prototype[symbol].apply(this, args);
72
+ return oldImpl.apply(this, args);
73
+ }
74
+ };
75
+ }
76
+ });
77
+ });
78
+ }
79
+ //# sourceMappingURL=index.common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.common.js","sourceRoot":"../src/","sources":["index.common.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,mCAAmB,CAAA;AACvB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED,MAAM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ACtB,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;4BAC1B,OAAO,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;yBACvD;6BAAM;4BACH,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;4BAC7C,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;yBACpC;qBACJ;yBAAM;wBACH,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;wBAC7C,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;qBACpC;gBACL,CAAC,CAAC;aACL;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Material Core component
3
+ * @module @nativescript-community/ui-material-core
4
+ */
5
+
6
+ import { Color, CoreTypes, PercentLength } from '@nativescript/core';
7
+
8
+ declare module '@nativescript/core/ui/core/view' {
9
+ interface View {
10
+ _getRootFragmentManager(): androidx.fragment.app.FragmentManager;
11
+ clearFocus(): void;
12
+ requestFocus(): void;
13
+ }
14
+ }
15
+
16
+ export interface TypographyOptions {
17
+ fontFamily?: string;
18
+ fontSize?: number;
19
+ }
20
+
21
+ import { CornerFamily } from './index.common';
22
+ export { CornerFamily };
23
+ export interface ShapeProperties {
24
+ cornerSize?: number | CoreTypes.LengthPercentUnit | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;
25
+ cornerSizeTopRight?: number | CoreTypes.LengthPercentUnit | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;
26
+ cornerSizeBottomLeft?: number | CoreTypes.LengthPercentUnit | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;
27
+ cornerSizeTopLeft?: number | CoreTypes.LengthPercentUnit | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;
28
+ cornerSizeBottomRight?: number | CoreTypes.LengthPercentUnit | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;
29
+ cornerFamily?: CornerFamily;
30
+ cornerFamilyTopLeft?: CornerFamily;
31
+ cornerFamilyTopRight?: CornerFamily;
32
+ cornerFamilyBottomRight?: CornerFamily;
33
+ cornerFamilyBottomLeft?: CornerFamily;
34
+ }
35
+
36
+ export class Themer {
37
+ getOrcreateAppColorScheme();
38
+ getAppColorScheme();
39
+ setPrimaryColor(value: string | Color);
40
+ getPrimaryColor(): string | Color;
41
+ getSecondaryColor(): string | Color;
42
+ setSecondaryColor(value: string | Color);
43
+ setAccentColor(value: string | Color);
44
+ getAccentColor(): string | Color;
45
+ setPrimaryColorVariant(value: string | Color);
46
+ getPrimaryColorVariant(): string | Color;
47
+ setSurfaceColor(value: string | Color);
48
+ getSurfaceColor(): string | Color;
49
+ setOnSurfaceColor(value: string | Color);
50
+ getOnSurfaceColor(): string | Color;
51
+ setOnPrimaryColor(value: string | Color);
52
+ getOnPrimaryColor(): string | Color;
53
+ createShape(key: string, options: ShapeProperties);
54
+ getShape(key: string): any;
55
+ }
56
+
57
+ export let themer: Themer;
58
+
59
+ export { applyMixins } from './index.common';
60
+ export * from './cssproperties';
61
+
62
+ export function install();
63
+ export function installMixins();
64
+ export function getRippleColor(color: string | Color): any;
65
+
66
+ type Constructor<T = {}> = new (...args: any[]) => T;
67
+ export function mixin<T1 extends Constructor, T2 extends Constructor>(mix1: T1, mix2: T2): (new (...args: any[]) => InstanceType<T1> & InstanceType<T2>) & T1 & T2;
package/index.ios.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { Color } from '@nativescript/core';
2
+ import { ShapeProperties, TypographyOptions } from '.';
3
+ import { applyMixins } from './index.common';
4
+ export * from './cssproperties';
5
+ export { applyMixins };
6
+ export declare class Themer {
7
+ appColorScheme: MDCSemanticColorScheme;
8
+ appTypoScheme: MDCTypographyScheme;
9
+ primaryColor: string | Color;
10
+ onPrimaryColor: string | Color;
11
+ secondaryColor: string | Color;
12
+ accentColor: string | Color;
13
+ primaryColorVariant: string | Color;
14
+ surfaceColor: string | Color;
15
+ onSurfaceColor: string | Color;
16
+ constructor();
17
+ getOrcreateAppColorScheme(): MDCSemanticColorScheme;
18
+ getAppColorScheme(): MDCSemanticColorScheme;
19
+ setPrimaryColor(value: string | Color): void;
20
+ getPrimaryColor(): string | Color;
21
+ setOnPrimaryColor(value: any): void;
22
+ getOnPrimaryColor(): string | Color;
23
+ setSecondaryColor(value: string | Color): void;
24
+ getSecondaryColor(): string | Color;
25
+ setAccentColor(value: string | Color): void;
26
+ getAccentColor(): string | Color;
27
+ setSurfaceColor(value: string | Color): void;
28
+ getSurfaceColor(): string | Color;
29
+ setOnSurfaceColor(value: string | Color): void;
30
+ getOnSurfaceColor(): string | Color;
31
+ setPrimaryColorVariant(value: string | Color): void;
32
+ getPrimaryColorVariant(): string | Color;
33
+ getOrcreateAppTypographyScheme(): MDCTypographyScheme;
34
+ getAppTypographyScheme(): MDCTypographyScheme;
35
+ setButtonTypography(args: TypographyOptions): void;
36
+ _shapes: {
37
+ [k: string]: MDCShapeScheme;
38
+ };
39
+ getShape(key: string): MDCShapeScheme;
40
+ createShape(key: string, options: ShapeProperties): void;
41
+ }
42
+ export declare const themer: Themer;
43
+ export declare function install(): void;
44
+ export declare function getRippleColor(color: string | Color): UIColor;
45
+ export declare function overrideViewBase(): void;
46
+ export declare function installMixins(): void;