@akylas/nativescript 8.6.4 → 8.6.5
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.
- package/accessibility/accessibility-properties.js +1 -0
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service.android.js +8 -4
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-types.d.ts +27 -27
- package/accessibility/accessibility-types.js +28 -28
- package/accessibility/accessibility-types.js.map +1 -1
- package/accessibility/index.android.d.ts +1 -1
- package/accessibility/index.android.js +72 -239
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.d.ts +1 -1
- package/accessibility/index.ios.d.ts +1 -1
- package/accessibility/index.ios.js.map +1 -1
- package/application/application-common.js +7 -3
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +2 -1
- package/application-settings/index.android.js +37 -6
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.ios.js +27 -1
- package/application-settings/index.ios.js.map +1 -1
- package/core-types/index.d.ts +8 -4
- package/core-types/index.js +8 -4
- package/core-types/index.js.map +1 -1
- package/data/observable/index.d.ts +10 -4
- package/data/observable/index.js +101 -99
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.d.ts +1 -1
- package/data/virtual-array/index.d.ts +1 -1
- package/file-system/file-system-access.android.js +136 -186
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +2 -0
- package/file-system/file-system-access.ios.js.map +1 -1
- package/global-types.d.ts +2 -0
- package/image-asset/image-asset-common.d.ts +1 -0
- package/image-asset/image-asset-common.js +6 -4
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.d.ts +1 -0
- package/image-asset/index.android.js +13 -4
- package/image-asset/index.android.js.map +1 -1
- package/image-asset/index.d.ts +4 -1
- package/image-asset/index.ios.d.ts +1 -0
- package/image-asset/index.ios.js +27 -0
- package/image-asset/index.ios.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/ui/action-bar/index.android.js +3 -34
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/activity-indicator/index.android.js +2 -1
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/animation/index.ios.d.ts +4 -4
- package/ui/animation/index.ios.js +130 -105
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +1 -1
- package/ui/animation/keyframe-animation.js +8 -3
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/button/index.android.d.ts +0 -1
- package/ui/button/index.android.js +0 -7
- package/ui/button/index.android.js.map +1 -1
- package/ui/core/properties/index.d.ts +3 -2
- package/ui/core/properties/index.js +50 -56
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.d.ts +1 -0
- package/ui/core/view/index.android.js +82 -123
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +6 -6
- package/ui/core/view/index.ios.js +54 -24
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +2 -2
- package/ui/core/view/view-common.js +18 -7
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +2 -0
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.d.ts +5 -10
- package/ui/core/view-base/index.js +26 -38
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/editable-text-base/index.android.d.ts +0 -1
- package/ui/editable-text-base/index.android.js +0 -4
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +2 -2
- package/ui/frame/frame-common.js +2 -2
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-interfaces.d.ts +3 -0
- package/ui/frame/index.android.js +8 -1
- package/ui/frame/index.android.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +2 -2
- package/ui/html-view/index.android.d.ts +0 -1
- package/ui/html-view/index.android.js +0 -4
- package/ui/html-view/index.android.js.map +1 -1
- package/ui/image/index.android.d.ts +0 -1
- package/ui/image/index.android.js +0 -4
- package/ui/image/index.android.js.map +1 -1
- package/ui/label/index.android.js +0 -1
- package/ui/label/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.d.ts +0 -1
- package/ui/layouts/flexbox-layout/index.android.js +0 -4
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/grid-layout-common.d.ts +6 -10
- package/ui/layouts/grid-layout/grid-layout-common.js +4 -51
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.d.ts +0 -1
- package/ui/layouts/grid-layout/index.android.js +6 -16
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +0 -1
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.js +1 -1
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +0 -3
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +2 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +1 -1
- package/ui/placeholder/placeholder-common.d.ts +2 -1
- package/ui/slider/index.android.d.ts +0 -1
- package/ui/slider/index.android.js +0 -7
- package/ui/slider/index.android.js.map +1 -1
- package/ui/styling/background-common.d.ts +2 -1
- package/ui/styling/background-common.js +30 -42
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.js +26 -24
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +9 -0
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/css-utils.js +1 -0
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font-common.d.ts +11 -8
- package/ui/styling/font-common.js +48 -2
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font.android.d.ts +1 -8
- package/ui/styling/font.android.js +1 -19
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.d.ts +4 -0
- package/ui/styling/font.ios.d.ts +1 -7
- package/ui/styling/font.ios.js +1 -19
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/style-properties.d.ts +1 -1
- package/ui/styling/style-properties.js +121 -130
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/tab-view/index.android.d.ts +0 -1
- package/ui/tab-view/index.android.js +0 -7
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/text-base/index.android.d.ts +0 -7
- package/ui/text-base/index.android.js +11 -47
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +0 -6
- package/ui/text-base/index.ios.d.ts +1 -0
- package/ui/text-base/index.ios.js +25 -17
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/text-base-common.d.ts +0 -1
- package/ui/text-base/text-base-common.js +0 -1
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.android.js +0 -1
- package/ui/text-field/index.android.js.map +1 -1
- package/ui/text-view/index.android.d.ts +0 -1
- package/ui/text-view/index.android.js +0 -4
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/transition/page-transition.android.js +5 -0
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/web-view/web-view-interfaces.d.ts +2 -1
- package/utils/index.android.d.ts +1 -0
- package/utils/index.android.js +10 -0
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +5 -0
- package/utils/index.ios.d.ts +1 -0
- package/utils/index.ios.js +4 -0
- package/utils/index.ios.js.map +1 -1
- package/platforms/dist/package/platforms/android/widgets-release.aar +0 -0
|
@@ -44,7 +44,7 @@ export declare const paddingRightProperty: CssProperty<Style, CoreTypes.LengthTy
|
|
|
44
44
|
export declare const paddingTopProperty: CssProperty<Style, CoreTypes.LengthType>;
|
|
45
45
|
export declare const paddingBottomProperty: CssProperty<Style, CoreTypes.LengthType>;
|
|
46
46
|
export declare const horizontalAlignmentProperty: CssProperty<Style, CoreTypes.HorizontalAlignmentType>;
|
|
47
|
-
export declare const verticalAlignmentProperty: CssProperty<Style, CoreTypes.
|
|
47
|
+
export declare const verticalAlignmentProperty: CssProperty<Style, CoreTypes.VerticalAlignmentType>;
|
|
48
48
|
export declare const rotateProperty: CssAnimationProperty<Style, number>;
|
|
49
49
|
export declare const rotateXProperty: CssAnimationProperty<Style, number>;
|
|
50
50
|
export declare const rotateYProperty: CssAnimationProperty<Style, number>;
|
|
@@ -57,16 +57,12 @@ function convertToStringCommon(length) {
|
|
|
57
57
|
return val + length.unit;
|
|
58
58
|
}
|
|
59
59
|
function toDevicePixelsCommon(length, auto = Number.NaN, parentAvailableWidth = Number.NaN) {
|
|
60
|
-
if (length
|
|
61
|
-
// tslint:disable-line
|
|
60
|
+
if (length === 'auto' || !length) {
|
|
62
61
|
return auto;
|
|
63
62
|
}
|
|
64
63
|
if (typeof length === 'number') {
|
|
65
64
|
return layout.round(layout.toDevicePixels(length));
|
|
66
65
|
}
|
|
67
|
-
if (!length) {
|
|
68
|
-
return auto;
|
|
69
|
-
}
|
|
70
66
|
switch (length.unit) {
|
|
71
67
|
case 'px':
|
|
72
68
|
return layout.round(length.value);
|
|
@@ -92,25 +88,16 @@ export var PercentLength;
|
|
|
92
88
|
}
|
|
93
89
|
if (typeof fromValue === 'string') {
|
|
94
90
|
let stringValue = fromValue.trim();
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// if only % or % is not last we treat it as invalid value.
|
|
99
|
-
if (percentIndex !== stringValue.length - 1 || percentIndex === 0) {
|
|
100
|
-
value = Number.NaN;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
// Normalize result to values between -1 and 1
|
|
104
|
-
value = parseFloat(stringValue.substring(0, stringValue.length - 1).trim()) / 100;
|
|
105
|
-
}
|
|
91
|
+
if (stringValue.endsWith('%')) {
|
|
92
|
+
// Normalize result to values between -1 and 1
|
|
93
|
+
const value = parseFloat(stringValue.substring(0, stringValue.length - 1).trim()) / 100;
|
|
106
94
|
if (isNaN(value) || !isFinite(value)) {
|
|
107
95
|
throw new Error(`Invalid value: ${fromValue}`);
|
|
108
96
|
}
|
|
109
97
|
return { unit: '%', value };
|
|
110
98
|
}
|
|
111
|
-
else if (stringValue.
|
|
112
|
-
|
|
113
|
-
const value = parseFloat(stringValue);
|
|
99
|
+
else if (stringValue.endsWith('px')) {
|
|
100
|
+
const value = parseFloat(stringValue.slice(-2).trim());
|
|
114
101
|
if (isNaN(value) || !isFinite(value)) {
|
|
115
102
|
throw new Error(`Invalid value: ${fromValue}`);
|
|
116
103
|
}
|
|
@@ -136,14 +123,13 @@ export var PercentLength;
|
|
|
136
123
|
export var Length;
|
|
137
124
|
(function (Length) {
|
|
138
125
|
function parse(fromValue) {
|
|
139
|
-
if (fromValue == 'auto') {
|
|
140
|
-
// tslint:disable-line
|
|
141
|
-
return 'auto';
|
|
142
|
-
}
|
|
143
126
|
if (typeof fromValue === 'string') {
|
|
127
|
+
if (fromValue === 'auto') {
|
|
128
|
+
return 'auto';
|
|
129
|
+
}
|
|
144
130
|
let stringValue = fromValue.trim();
|
|
145
|
-
if (stringValue.
|
|
146
|
-
stringValue = stringValue.
|
|
131
|
+
if (stringValue.endsWith('px')) {
|
|
132
|
+
stringValue = stringValue.slice(0, -2).trim();
|
|
147
133
|
const value = parseFloat(stringValue);
|
|
148
134
|
if (isNaN(value) || !isFinite(value)) {
|
|
149
135
|
throw new Error(`Invalid value: ${stringValue}`);
|
|
@@ -364,14 +350,14 @@ horizontalAlignmentProperty.register(Style);
|
|
|
364
350
|
export const verticalAlignmentProperty = new CssProperty({
|
|
365
351
|
name: 'verticalAlignment',
|
|
366
352
|
cssName: 'vertical-align',
|
|
367
|
-
defaultValue: CoreTypes.
|
|
353
|
+
defaultValue: CoreTypes.VerticalAlignment.stretch,
|
|
368
354
|
affectsLayout: __IOS__,
|
|
369
|
-
valueConverter: CoreTypes.
|
|
355
|
+
valueConverter: CoreTypes.VerticalAlignment.parse,
|
|
370
356
|
});
|
|
371
357
|
verticalAlignmentProperty.register(Style);
|
|
372
358
|
function parseThickness(value) {
|
|
373
359
|
if (typeof value === 'string') {
|
|
374
|
-
const arr = value.split(
|
|
360
|
+
const arr = value.split(' ');
|
|
375
361
|
let top;
|
|
376
362
|
let right;
|
|
377
363
|
let bottom;
|
|
@@ -495,11 +481,11 @@ export const scaleYProperty = new CssAnimationProperty({
|
|
|
495
481
|
});
|
|
496
482
|
scaleYProperty.register(Style);
|
|
497
483
|
function parseDIPs(value) {
|
|
498
|
-
if (value.
|
|
499
|
-
return layout.toDeviceIndependentPixels(parseFloat(value.
|
|
484
|
+
if (value.endsWith('px')) {
|
|
485
|
+
return layout.toDeviceIndependentPixels(parseFloat(value.trim().slice(-2).trim()));
|
|
500
486
|
}
|
|
501
487
|
else {
|
|
502
|
-
return parseFloat(value.
|
|
488
|
+
return parseFloat(value.slice(-3).trim());
|
|
503
489
|
}
|
|
504
490
|
}
|
|
505
491
|
export const translateXProperty = new CssAnimationProperty({
|
|
@@ -676,15 +662,38 @@ export const backgroundInternalProperty = new CssProperty({
|
|
|
676
662
|
name: 'backgroundInternal',
|
|
677
663
|
cssName: '_backgroundInternal',
|
|
678
664
|
defaultValue: Background.default,
|
|
665
|
+
equalityComparer: (value1, value2, target) => {
|
|
666
|
+
if (value1 === value2) {
|
|
667
|
+
const view = target.viewRef.get();
|
|
668
|
+
// if view layout or updates are suspended we will check the backgroundInternal at the end
|
|
669
|
+
if (value1.isDirty && !view._suspendNativeUpdatesCount) {
|
|
670
|
+
value1.isDirty = false;
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
return true;
|
|
674
|
+
}
|
|
675
|
+
return Background.equals(value1, value2);
|
|
676
|
+
},
|
|
679
677
|
});
|
|
680
678
|
backgroundInternalProperty.register(Style);
|
|
679
|
+
function backgroundInternalSubPropertyValueChanged(block) {
|
|
680
|
+
return function (target, oldValue, newValue) {
|
|
681
|
+
const newBackgroundInternal = block(target, oldValue, newValue);
|
|
682
|
+
const view = target.viewRef.get();
|
|
683
|
+
if (target.backgroundInternal !== newBackgroundInternal || !view._suspendNativeUpdatesCount) {
|
|
684
|
+
target.backgroundInternal = newBackgroundInternal;
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
// let s not go through another property set which takes time during batch updates
|
|
688
|
+
// we will check and update backgroundInternal once the update is done
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
}
|
|
681
692
|
// const pattern: RegExp = /url\(('|")(.*?)\1\)/;
|
|
682
693
|
export const backgroundImageProperty = new CssProperty({
|
|
683
694
|
name: 'backgroundImage',
|
|
684
695
|
cssName: 'background-image',
|
|
685
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
686
|
-
target.backgroundInternal = target.backgroundInternal.withImage(newValue);
|
|
687
|
-
},
|
|
696
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withImage(newValue)),
|
|
688
697
|
equalityComparer: (value1, value2) => {
|
|
689
698
|
if (value1 instanceof LinearGradient && value2 instanceof LinearGradient) {
|
|
690
699
|
return LinearGradient.equals(value1, value2);
|
|
@@ -707,9 +716,7 @@ backgroundImageProperty.register(Style);
|
|
|
707
716
|
export const backgroundColorProperty = new CssAnimationProperty({
|
|
708
717
|
name: 'backgroundColor',
|
|
709
718
|
cssName: 'background-color',
|
|
710
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
711
|
-
target.backgroundInternal = target.backgroundInternal.withColor(newValue);
|
|
712
|
-
},
|
|
719
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withColor(newValue)),
|
|
713
720
|
equalityComparer: Color.equals,
|
|
714
721
|
valueConverter: colorConverter,
|
|
715
722
|
});
|
|
@@ -718,25 +725,19 @@ export const backgroundRepeatProperty = new CssProperty({
|
|
|
718
725
|
name: 'backgroundRepeat',
|
|
719
726
|
cssName: 'background-repeat',
|
|
720
727
|
valueConverter: CoreTypes.BackgroundRepeat.parse,
|
|
721
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
722
|
-
target.backgroundInternal = target.backgroundInternal.withRepeat(newValue);
|
|
723
|
-
},
|
|
728
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withRepeat(newValue)),
|
|
724
729
|
});
|
|
725
730
|
backgroundRepeatProperty.register(Style);
|
|
726
731
|
export const backgroundSizeProperty = new CssProperty({
|
|
727
732
|
name: 'backgroundSize',
|
|
728
733
|
cssName: 'background-size',
|
|
729
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
730
|
-
target.backgroundInternal = target.backgroundInternal.withSize(newValue);
|
|
731
|
-
},
|
|
734
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withSize(newValue)),
|
|
732
735
|
});
|
|
733
736
|
backgroundSizeProperty.register(Style);
|
|
734
737
|
export const backgroundPositionProperty = new CssProperty({
|
|
735
738
|
name: 'backgroundPosition',
|
|
736
739
|
cssName: 'background-position',
|
|
737
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
738
|
-
target.backgroundInternal = target.backgroundInternal.withPosition(newValue);
|
|
739
|
-
},
|
|
740
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withPosition(newValue)),
|
|
740
741
|
});
|
|
741
742
|
backgroundPositionProperty.register(Style);
|
|
742
743
|
function convertToBackgrounds(value) {
|
|
@@ -858,9 +859,7 @@ borderColorProperty.register(Style);
|
|
|
858
859
|
export const borderTopColorProperty = new CssProperty({
|
|
859
860
|
name: 'borderTopColor',
|
|
860
861
|
cssName: 'border-top-color',
|
|
861
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
862
|
-
target.backgroundInternal = target.backgroundInternal.withBorderTopColor(newValue);
|
|
863
|
-
},
|
|
862
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withBorderTopColor(newValue)),
|
|
864
863
|
equalityComparer: Color.equals,
|
|
865
864
|
valueConverter: colorConverter,
|
|
866
865
|
});
|
|
@@ -868,9 +867,7 @@ borderTopColorProperty.register(Style);
|
|
|
868
867
|
export const borderRightColorProperty = new CssProperty({
|
|
869
868
|
name: 'borderRightColor',
|
|
870
869
|
cssName: 'border-right-color',
|
|
871
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
872
|
-
target.backgroundInternal = target.backgroundInternal.withBorderRightColor(newValue);
|
|
873
|
-
},
|
|
870
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withBorderRightColor(newValue)),
|
|
874
871
|
equalityComparer: Color.equals,
|
|
875
872
|
valueConverter: colorConverter,
|
|
876
873
|
});
|
|
@@ -878,9 +875,7 @@ borderRightColorProperty.register(Style);
|
|
|
878
875
|
export const borderBottomColorProperty = new CssProperty({
|
|
879
876
|
name: 'borderBottomColor',
|
|
880
877
|
cssName: 'border-bottom-color',
|
|
881
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
882
|
-
target.backgroundInternal = target.backgroundInternal.withBorderBottomColor(newValue);
|
|
883
|
-
},
|
|
878
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withBorderBottomColor(newValue)),
|
|
884
879
|
equalityComparer: Color.equals,
|
|
885
880
|
valueConverter: colorConverter,
|
|
886
881
|
});
|
|
@@ -888,9 +883,7 @@ borderBottomColorProperty.register(Style);
|
|
|
888
883
|
export const borderLeftColorProperty = new CssProperty({
|
|
889
884
|
name: 'borderLeftColor',
|
|
890
885
|
cssName: 'border-left-color',
|
|
891
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
892
|
-
target.backgroundInternal = target.backgroundInternal.withBorderLeftColor(newValue);
|
|
893
|
-
},
|
|
886
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withBorderLeftColor(newValue)),
|
|
894
887
|
equalityComparer: Color.equals,
|
|
895
888
|
valueConverter: colorConverter,
|
|
896
889
|
});
|
|
@@ -934,7 +927,7 @@ export const borderTopWidthProperty = new CssProperty({
|
|
|
934
927
|
defaultValue: CoreTypes.zeroLength,
|
|
935
928
|
affectsLayout: __IOS__,
|
|
936
929
|
equalityComparer: Length.equals,
|
|
937
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
930
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
938
931
|
let value = Length.toDevicePixels(newValue, 0);
|
|
939
932
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
940
933
|
value = 0;
|
|
@@ -946,8 +939,8 @@ export const borderTopWidthProperty = new CssProperty({
|
|
|
946
939
|
else {
|
|
947
940
|
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
948
941
|
}
|
|
949
|
-
|
|
950
|
-
},
|
|
942
|
+
return target.backgroundInternal.withBorderTopWidth(value);
|
|
943
|
+
}),
|
|
951
944
|
valueConverter: Length.parse,
|
|
952
945
|
});
|
|
953
946
|
borderTopWidthProperty.register(Style);
|
|
@@ -957,7 +950,7 @@ export const borderRightWidthProperty = new CssProperty({
|
|
|
957
950
|
defaultValue: CoreTypes.zeroLength,
|
|
958
951
|
affectsLayout: __IOS__,
|
|
959
952
|
equalityComparer: Length.equals,
|
|
960
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
953
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
961
954
|
let value = Length.toDevicePixels(newValue, 0);
|
|
962
955
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
963
956
|
value = 0;
|
|
@@ -969,8 +962,8 @@ export const borderRightWidthProperty = new CssProperty({
|
|
|
969
962
|
else {
|
|
970
963
|
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
971
964
|
}
|
|
972
|
-
|
|
973
|
-
},
|
|
965
|
+
return target.backgroundInternal.withBorderRightWidth(value);
|
|
966
|
+
}),
|
|
974
967
|
valueConverter: Length.parse,
|
|
975
968
|
});
|
|
976
969
|
borderRightWidthProperty.register(Style);
|
|
@@ -980,7 +973,7 @@ export const borderBottomWidthProperty = new CssProperty({
|
|
|
980
973
|
defaultValue: CoreTypes.zeroLength,
|
|
981
974
|
affectsLayout: __IOS__,
|
|
982
975
|
equalityComparer: Length.equals,
|
|
983
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
976
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
984
977
|
let value = Length.toDevicePixels(newValue, 0);
|
|
985
978
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
986
979
|
value = 0;
|
|
@@ -992,8 +985,8 @@ export const borderBottomWidthProperty = new CssProperty({
|
|
|
992
985
|
else {
|
|
993
986
|
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
994
987
|
}
|
|
995
|
-
|
|
996
|
-
},
|
|
988
|
+
return target.backgroundInternal.withBorderBottomWidth(value);
|
|
989
|
+
}),
|
|
997
990
|
valueConverter: Length.parse,
|
|
998
991
|
});
|
|
999
992
|
borderBottomWidthProperty.register(Style);
|
|
@@ -1003,7 +996,7 @@ export const borderLeftWidthProperty = new CssProperty({
|
|
|
1003
996
|
defaultValue: CoreTypes.zeroLength,
|
|
1004
997
|
affectsLayout: __IOS__,
|
|
1005
998
|
equalityComparer: Length.equals,
|
|
1006
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
999
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
1007
1000
|
let value = Length.toDevicePixels(newValue, 0);
|
|
1008
1001
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1009
1002
|
value = 0;
|
|
@@ -1015,8 +1008,8 @@ export const borderLeftWidthProperty = new CssProperty({
|
|
|
1015
1008
|
else {
|
|
1016
1009
|
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
1017
1010
|
}
|
|
1018
|
-
|
|
1019
|
-
},
|
|
1011
|
+
return target.backgroundInternal.withBorderLeftWidth(value);
|
|
1012
|
+
}),
|
|
1020
1013
|
valueConverter: Length.parse,
|
|
1021
1014
|
});
|
|
1022
1015
|
borderLeftWidthProperty.register(Style);
|
|
@@ -1056,13 +1049,13 @@ export const borderTopLeftRadiusProperty = new CssProperty({
|
|
|
1056
1049
|
cssName: 'border-top-left-radius',
|
|
1057
1050
|
defaultValue: 0,
|
|
1058
1051
|
affectsLayout: __IOS__,
|
|
1059
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
1052
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
1060
1053
|
let value = Length.toDevicePixels(newValue, 0);
|
|
1061
1054
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1062
1055
|
value = 0;
|
|
1063
1056
|
}
|
|
1064
|
-
|
|
1065
|
-
},
|
|
1057
|
+
return target.backgroundInternal.withBorderTopLeftRadius(value);
|
|
1058
|
+
}),
|
|
1066
1059
|
valueConverter: Length.parse,
|
|
1067
1060
|
equalityComparer: Length.equals,
|
|
1068
1061
|
});
|
|
@@ -1072,13 +1065,13 @@ export const borderTopRightRadiusProperty = new CssProperty({
|
|
|
1072
1065
|
cssName: 'border-top-right-radius',
|
|
1073
1066
|
defaultValue: 0,
|
|
1074
1067
|
affectsLayout: __IOS__,
|
|
1075
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
1068
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
1076
1069
|
let value = Length.toDevicePixels(newValue, 0);
|
|
1077
1070
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1078
1071
|
value = 0;
|
|
1079
1072
|
}
|
|
1080
|
-
|
|
1081
|
-
},
|
|
1073
|
+
return target.backgroundInternal.withBorderTopRightRadius(value);
|
|
1074
|
+
}),
|
|
1082
1075
|
valueConverter: Length.parse,
|
|
1083
1076
|
equalityComparer: Length.equals,
|
|
1084
1077
|
});
|
|
@@ -1088,13 +1081,13 @@ export const borderBottomRightRadiusProperty = new CssProperty({
|
|
|
1088
1081
|
cssName: 'border-bottom-right-radius',
|
|
1089
1082
|
defaultValue: 0,
|
|
1090
1083
|
affectsLayout: __IOS__,
|
|
1091
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
1084
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
1092
1085
|
let value = Length.toDevicePixels(newValue, 0);
|
|
1093
1086
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1094
1087
|
value = 0;
|
|
1095
1088
|
}
|
|
1096
|
-
|
|
1097
|
-
},
|
|
1089
|
+
return target.backgroundInternal.withBorderBottomRightRadius(value);
|
|
1090
|
+
}),
|
|
1098
1091
|
valueConverter: Length.parse,
|
|
1099
1092
|
equalityComparer: Length.equals,
|
|
1100
1093
|
});
|
|
@@ -1104,13 +1097,13 @@ export const borderBottomLeftRadiusProperty = new CssProperty({
|
|
|
1104
1097
|
cssName: 'border-bottom-left-radius',
|
|
1105
1098
|
defaultValue: 0,
|
|
1106
1099
|
affectsLayout: __IOS__,
|
|
1107
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
1100
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
1108
1101
|
let value = Length.toDevicePixels(newValue, 0);
|
|
1109
1102
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1110
1103
|
value = 0;
|
|
1111
1104
|
}
|
|
1112
|
-
|
|
1113
|
-
},
|
|
1105
|
+
return target.backgroundInternal.withBorderBottomLeftRadius(value);
|
|
1106
|
+
}),
|
|
1114
1107
|
valueConverter: Length.parse,
|
|
1115
1108
|
equalityComparer: Length.equals,
|
|
1116
1109
|
});
|
|
@@ -1118,8 +1111,8 @@ borderBottomLeftRadiusProperty.register(Style);
|
|
|
1118
1111
|
const boxShadowProperty = new CssProperty({
|
|
1119
1112
|
name: 'boxShadow',
|
|
1120
1113
|
cssName: 'box-shadow',
|
|
1121
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
1122
|
-
|
|
1114
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
1115
|
+
return target.backgroundInternal.withBoxShadow(newValue
|
|
1123
1116
|
? {
|
|
1124
1117
|
inset: newValue.inset,
|
|
1125
1118
|
offsetX: Length.toDevicePixels(newValue.offsetX, 0),
|
|
@@ -1129,14 +1122,14 @@ const boxShadowProperty = new CssProperty({
|
|
|
1129
1122
|
color: newValue.color,
|
|
1130
1123
|
}
|
|
1131
1124
|
: null);
|
|
1132
|
-
},
|
|
1125
|
+
}),
|
|
1133
1126
|
valueConverter: (value) => {
|
|
1134
1127
|
return parseCSSShadow(value);
|
|
1135
1128
|
},
|
|
1136
1129
|
});
|
|
1137
1130
|
boxShadowProperty.register(Style);
|
|
1138
1131
|
function isNonNegativeFiniteNumber(value) {
|
|
1139
|
-
return isFinite(value) &&
|
|
1132
|
+
return isFinite(value) && value >= 0;
|
|
1140
1133
|
}
|
|
1141
1134
|
const supportedPaths = ['rect', 'circle', 'ellipse', 'polygon', 'inset'];
|
|
1142
1135
|
function isClipPathValid(value) {
|
|
@@ -1149,12 +1142,12 @@ function isClipPathValid(value) {
|
|
|
1149
1142
|
export const clipPathProperty = new CssProperty({
|
|
1150
1143
|
name: 'clipPath',
|
|
1151
1144
|
cssName: 'clip-path',
|
|
1152
|
-
valueChanged: (target, oldValue, newValue) => {
|
|
1145
|
+
valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
|
|
1153
1146
|
if (!isClipPathValid(newValue)) {
|
|
1154
1147
|
throw new Error('clip-path is not valid.');
|
|
1155
1148
|
}
|
|
1156
|
-
|
|
1157
|
-
},
|
|
1149
|
+
return target.backgroundInternal.withClipPath(newValue);
|
|
1150
|
+
}),
|
|
1158
1151
|
});
|
|
1159
1152
|
clipPathProperty.register(Style);
|
|
1160
1153
|
function isFloatValueConverter(value) {
|
|
@@ -1193,44 +1186,60 @@ export const colorProperty = new InheritedCssProperty({
|
|
|
1193
1186
|
colorProperty.register(Style);
|
|
1194
1187
|
export const fontInternalProperty = new CssProperty({
|
|
1195
1188
|
name: 'fontInternal',
|
|
1189
|
+
defaultValue: Font.default,
|
|
1196
1190
|
cssName: '_fontInternal',
|
|
1191
|
+
equalityComparer: (value1, value2, target) => {
|
|
1192
|
+
if (value1 === value2) {
|
|
1193
|
+
const view = target.viewRef.get();
|
|
1194
|
+
// if view layout or updates are suspended we will check the backgroundInternal at the end
|
|
1195
|
+
if (value1.isDirty && !view._suspendNativeUpdatesCount) {
|
|
1196
|
+
value1.isDirty = false;
|
|
1197
|
+
return false;
|
|
1198
|
+
}
|
|
1199
|
+
return true;
|
|
1200
|
+
}
|
|
1201
|
+
return Font.equals(value1, value2);
|
|
1202
|
+
},
|
|
1197
1203
|
});
|
|
1198
1204
|
fontInternalProperty.register(Style);
|
|
1205
|
+
function fontInternalSubPropertyValueChanged(block, shouldIgnore) {
|
|
1206
|
+
return function (target, oldValue, newValue) {
|
|
1207
|
+
if (shouldIgnore?.(target, oldValue, newValue)) {
|
|
1208
|
+
return;
|
|
1209
|
+
}
|
|
1210
|
+
let newFontInternal = block(target, oldValue, newValue);
|
|
1211
|
+
if (newFontInternal.isEqualToDefaultFont()) {
|
|
1212
|
+
newFontInternal = unsetValue;
|
|
1213
|
+
}
|
|
1214
|
+
const view = target.viewRef.get();
|
|
1215
|
+
if (target.fontInternal !== newFontInternal || !view._suspendNativeUpdatesCount) {
|
|
1216
|
+
target.fontInternal = newFontInternal;
|
|
1217
|
+
}
|
|
1218
|
+
else {
|
|
1219
|
+
// let s not go through another property set which takes time during batch updates
|
|
1220
|
+
// we will check and update fontInternal once the update is done
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1199
1224
|
export const fontFamilyProperty = new InheritedCssProperty({
|
|
1200
1225
|
name: 'fontFamily',
|
|
1201
1226
|
cssName: 'font-family',
|
|
1202
1227
|
affectsLayout: __IOS__,
|
|
1203
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
1204
|
-
const currentFont = target.fontInternal || Font.default;
|
|
1205
|
-
if (currentFont.fontFamily !== newValue) {
|
|
1206
|
-
const newFont = currentFont.withFontFamily(newValue);
|
|
1207
|
-
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1208
|
-
}
|
|
1209
|
-
},
|
|
1228
|
+
valueChanged: fontInternalSubPropertyValueChanged((target, oldValue, newValue) => target.fontInternal.withFontFamily(newValue)),
|
|
1210
1229
|
});
|
|
1211
1230
|
fontFamilyProperty.register(Style);
|
|
1212
1231
|
export const fontScaleInternalProperty = new InheritedCssProperty({
|
|
1213
1232
|
name: 'fontScaleInternal',
|
|
1214
1233
|
cssName: '_fontScaleInternal',
|
|
1215
1234
|
defaultValue: 1.0,
|
|
1216
|
-
valueConverter:
|
|
1235
|
+
valueConverter: parseFloat,
|
|
1217
1236
|
});
|
|
1218
1237
|
fontScaleInternalProperty.register(Style);
|
|
1219
1238
|
export const fontSizeProperty = new InheritedCssProperty({
|
|
1220
1239
|
name: 'fontSize',
|
|
1221
1240
|
cssName: 'font-size',
|
|
1222
1241
|
affectsLayout: __IOS__,
|
|
1223
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
1224
|
-
const view = target.viewRef.get();
|
|
1225
|
-
if (view?.['handleFontSize'] === true) {
|
|
1226
|
-
return;
|
|
1227
|
-
}
|
|
1228
|
-
const currentFont = target.fontInternal || Font.default;
|
|
1229
|
-
if (currentFont.fontSize !== newValue) {
|
|
1230
|
-
const newFont = currentFont.withFontSize(newValue);
|
|
1231
|
-
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1232
|
-
}
|
|
1233
|
-
},
|
|
1242
|
+
valueChanged: fontInternalSubPropertyValueChanged((target, oldValue, newValue) => target.fontInternal.withFontSize(newValue), (target) => target.viewRef.get()?.['handleFontSize'] === true),
|
|
1234
1243
|
valueConverter: (v) => parseFloat(v),
|
|
1235
1244
|
});
|
|
1236
1245
|
fontSizeProperty.register(Style);
|
|
@@ -1240,13 +1249,7 @@ export const fontStyleProperty = new InheritedCssProperty({
|
|
|
1240
1249
|
affectsLayout: __IOS__,
|
|
1241
1250
|
defaultValue: FontStyle.NORMAL,
|
|
1242
1251
|
valueConverter: FontStyle.parse,
|
|
1243
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
1244
|
-
const currentFont = target.fontInternal || Font.default;
|
|
1245
|
-
if (currentFont.fontStyle !== newValue) {
|
|
1246
|
-
const newFont = currentFont.withFontStyle(newValue);
|
|
1247
|
-
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1248
|
-
}
|
|
1249
|
-
},
|
|
1252
|
+
valueChanged: fontInternalSubPropertyValueChanged((target, oldValue, newValue) => target.fontInternal.withFontStyle(newValue)),
|
|
1250
1253
|
});
|
|
1251
1254
|
fontStyleProperty.register(Style);
|
|
1252
1255
|
export const fontWeightProperty = new InheritedCssProperty({
|
|
@@ -1255,13 +1258,7 @@ export const fontWeightProperty = new InheritedCssProperty({
|
|
|
1255
1258
|
affectsLayout: __IOS__,
|
|
1256
1259
|
defaultValue: FontWeight.NORMAL,
|
|
1257
1260
|
valueConverter: FontWeight.parse,
|
|
1258
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
1259
|
-
const currentFont = target.fontInternal || Font.default;
|
|
1260
|
-
if (currentFont.fontWeight !== newValue) {
|
|
1261
|
-
const newFont = currentFont.withFontWeight(newValue);
|
|
1262
|
-
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1263
|
-
}
|
|
1264
|
-
},
|
|
1261
|
+
valueChanged: fontInternalSubPropertyValueChanged((target, oldValue, newValue) => target.fontInternal.withFontWeight(newValue)),
|
|
1265
1262
|
});
|
|
1266
1263
|
fontWeightProperty.register(Style);
|
|
1267
1264
|
const fontProperty = new ShorthandProperty({
|
|
@@ -1296,13 +1293,7 @@ export const fontVariationSettingsProperty = new InheritedCssProperty({
|
|
|
1296
1293
|
name: 'fontVariationSettings',
|
|
1297
1294
|
cssName: 'font-variation-settings',
|
|
1298
1295
|
affectsLayout: __IOS__,
|
|
1299
|
-
valueChanged: (target, oldValue, newValue) =>
|
|
1300
|
-
const currentFont = target.fontInternal || Font.default;
|
|
1301
|
-
if (currentFont.fontVariationSettings !== newValue) {
|
|
1302
|
-
const newFont = currentFont.withFontVariationSettings(newValue);
|
|
1303
|
-
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1304
|
-
}
|
|
1305
|
-
},
|
|
1296
|
+
valueChanged: fontInternalSubPropertyValueChanged((target, oldValue, newValue) => target.fontInternal.withFontVariationSettings(newValue)),
|
|
1306
1297
|
valueConverter: (value) => {
|
|
1307
1298
|
return FontVariationSettings.parse(value);
|
|
1308
1299
|
},
|
|
@@ -1317,7 +1308,7 @@ export const visibilityProperty = new CssProperty({
|
|
|
1317
1308
|
valueChanged: (target, oldValue, newValue) => {
|
|
1318
1309
|
const view = target.viewRef.get();
|
|
1319
1310
|
if (view) {
|
|
1320
|
-
view.isCollapsed = newValue === CoreTypes.Visibility.collapse;
|
|
1311
|
+
view.isCollapsed = newValue === CoreTypes.Visibility.collapse || newValue === CoreTypes.Visibility.collapsed;
|
|
1321
1312
|
}
|
|
1322
1313
|
else {
|
|
1323
1314
|
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|