@nativescript/core 8.9.0-napi-es5.0 → 8.9.0-napi.1
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/abortcontroller/abortsignal.js +16 -23
- package/abortcontroller/abortsignal.js.map +1 -1
- package/abortcontroller/index.js +14 -20
- package/abortcontroller/index.js.map +1 -1
- package/accessibility/accessibility-common.js +8 -8
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.js +27 -27
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-properties.js +22 -23
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.js +12 -22
- package/accessibility/accessibility-service-common.js.map +1 -1
- package/accessibility/accessibility-service.android.js +27 -39
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.ios.js +14 -17
- package/accessibility/accessibility-service.ios.js.map +1 -1
- package/accessibility/font-scale-common.js +2 -2
- package/accessibility/font-scale-common.js.map +1 -1
- package/accessibility/font-scale.android.js +7 -8
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/font-scale.ios.js +9 -10
- package/accessibility/font-scale.ios.js.map +1 -1
- package/accessibility/index.android.js +77 -83
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.ios.js +34 -36
- package/accessibility/index.ios.js.map +1 -1
- package/animation-frame/animation-native.ios.js +1 -1
- package/animation-frame/animation-native.ios.js.map +1 -1
- package/animation-frame/index.js +16 -16
- package/animation-frame/index.js.map +1 -1
- package/application/application-common.js +196 -214
- package/application/application-common.js.map +1 -1
- package/application/application-shims.js +39 -39
- package/application/application-shims.js.map +1 -1
- package/application/application.android.js +110 -149
- package/application/application.android.js.map +1 -1
- package/application/application.ios.js +162 -197
- package/application/application.ios.js.map +1 -1
- package/application-settings/index.android.js +11 -11
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.ios.js +1 -1
- package/application-settings/index.ios.js.map +1 -1
- package/bundle-entry-points.js +1 -1
- package/bundle-entry-points.js.map +1 -1
- package/color/color-common.js +157 -200
- package/color/color-common.js.map +1 -1
- package/color/index.android.js +4 -14
- package/color/index.android.js.map +1 -1
- package/color/index.ios.js +14 -24
- package/color/index.ios.js.map +1 -1
- package/color/known-colors.js +144 -144
- package/color/known-colors.js.map +1 -1
- package/connectivity/index.android.js +23 -23
- package/connectivity/index.android.js.map +1 -1
- package/connectivity/index.ios.js +25 -25
- package/connectivity/index.ios.js.map +1 -1
- package/console/index.js +20 -24
- package/console/index.js.map +1 -1
- package/core-types/index.js +38 -38
- package/core-types/index.js.map +1 -1
- package/css/CSS3Parser.js +104 -106
- package/css/CSS3Parser.js.map +1 -1
- package/css/CSSNativeScript.js +29 -34
- package/css/CSSNativeScript.js.map +1 -1
- package/css/css-tree-parser.js.map +1 -1
- package/css/parser.js +158 -178
- package/css/parser.js.map +1 -1
- package/css/system-classes.js +9 -9
- package/css/system-classes.js.map +1 -1
- package/css-mediaquery/index.js +27 -29
- package/css-mediaquery/index.js.map +1 -1
- package/data/observable/index.js +115 -124
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.js +119 -176
- package/data/observable-array/index.js.map +1 -1
- package/data/virtual-array/index.js +61 -74
- package/data/virtual-array/index.js.map +1 -1
- package/debugger/InspectorBackendCommands.js +137 -161
- package/debugger/InspectorBackendCommands.js.map +1 -1
- package/debugger/devtools-elements.common.js +20 -20
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +2 -2
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-node.js +61 -73
- package/debugger/dom-node.js.map +1 -1
- package/debugger/index.js +19 -19
- package/debugger/index.js.map +1 -1
- package/debugger/webinspector-css.js +25 -30
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.js +38 -43
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.js +103 -132
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.js +100 -128
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/file-system/file-system-access.android.js +414 -421
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +203 -213
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.js +294 -372
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.js +15 -18
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.js +9 -11
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/fps-meter/index.js +11 -11
- package/fps-meter/index.js.map +1 -1
- package/globals/index.js +88 -112
- package/globals/index.js.map +1 -1
- package/http/http-request/http-request-common.js +5 -5
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.js +53 -54
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js +56 -58
- package/http/http-request/index.ios.js.map +1 -1
- package/http/index.js +19 -19
- package/http/index.js.map +1 -1
- package/image-asset/image-asset-common.js +25 -37
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.js +17 -25
- package/image-asset/index.android.js.map +1 -1
- package/image-asset/index.ios.js +25 -35
- package/image-asset/index.ios.js.map +1 -1
- package/image-source/image-source-common.js +2 -2
- package/image-source/image-source-common.js.map +1 -1
- package/image-source/index.android.js +152 -178
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +177 -203
- package/image-source/index.ios.js.map +1 -1
- package/index.js +4 -8
- package/index.js.map +1 -1
- package/matrix/index.js +17 -27
- package/matrix/index.js.map +1 -1
- package/media-query-list/index.js +61 -87
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/index.js +21 -24
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +24 -24
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.js +46 -46
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +1 -1
- package/platform/common.js +5 -5
- package/platform/common.js.map +1 -1
- package/platform/device/index.android.js +68 -107
- package/platform/device/index.android.js.map +1 -1
- package/platform/device/index.ios.js +62 -101
- package/platform/device/index.ios.js.map +1 -1
- package/platform/screen/index.android.js +32 -63
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.js +29 -60
- package/platform/screen/index.ios.js.map +1 -1
- package/profiling/index.js +40 -47
- package/profiling/index.js.map +1 -1
- package/text/text-common.js +36 -49
- package/text/text-common.js.map +1 -1
- package/timer/index.android.js +20 -30
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js +12 -22
- package/timer/index.ios.js.map +1 -1
- package/trace/index.js +26 -36
- package/trace/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +193 -252
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +170 -212
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +208 -251
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/activity-indicator-common.js +6 -11
- package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
- package/ui/activity-indicator/index.android.js +20 -26
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +23 -31
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.js +43 -50
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.js +3 -5
- package/ui/animation/animation-interfaces.js.map +1 -1
- package/ui/animation/index.android.js +90 -94
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.js +225 -191
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.js +67 -89
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.js +31 -31
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.js +37 -37
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +54 -59
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.js +128 -158
- package/ui/builder/xml2ui.js.map +1 -1
- package/ui/button/button-common.js +18 -25
- package/ui/button/button-common.js.map +1 -1
- package/ui/button/index.android.js +69 -80
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.js +103 -114
- package/ui/button/index.ios.js.map +1 -1
- package/ui/content-view/index.js +60 -78
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-expressions.js +93 -101
- package/ui/core/bindable/bindable-expressions.js.map +1 -1
- package/ui/core/bindable/bindable-resources.js +1 -1
- package/ui/core/bindable/index.js +136 -141
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/control-state-change/index.android.js +5 -7
- package/ui/core/control-state-change/index.android.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +9 -13
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/properties/index.js +440 -489
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.js +348 -384
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.ios.js +364 -400
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.js +655 -944
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.android.js +15 -19
- package/ui/core/view/view-helper/index.android.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.js +81 -85
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +44 -49
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.js +371 -426
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/weak-event-listener/index.js +25 -26
- package/ui/core/weak-event-listener/index.js.map +1 -1
- package/ui/date-picker/date-picker-common.js +30 -35
- package/ui/date-picker/date-picker-common.js.map +1 -1
- package/ui/date-picker/index.android.js +43 -51
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +51 -61
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +18 -18
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +86 -98
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +67 -80
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js +29 -35
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.js +106 -112
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.ios.js +47 -53
- package/ui/editable-text-base/index.ios.js.map +1 -1
- package/ui/embedding/index.android.js +2 -3
- package/ui/embedding/index.android.js.map +1 -1
- package/ui/frame/activity.android.js +44 -44
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/callbacks/activity-callbacks.js +118 -123
- package/ui/frame/callbacks/activity-callbacks.js.map +1 -1
- package/ui/frame/callbacks/fragment-callbacks.js +139 -141
- package/ui/frame/callbacks/fragment-callbacks.js.map +1 -1
- package/ui/frame/fragment.android.js +21 -21
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.ios.js +1 -1
- package/ui/frame/fragment.transitions.android.js +105 -114
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +1 -1
- package/ui/frame/frame-common.js +249 -285
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-helpers.js +1 -1
- package/ui/frame/frame-helpers.js.map +1 -1
- package/ui/frame/frame-stack.js +4 -4
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.js +239 -291
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.js +133 -167
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.js +15 -29
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.js +108 -124
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +108 -121
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +42 -48
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/html-view-common.js +9 -14
- package/ui/html-view/html-view-common.js.map +1 -1
- package/ui/html-view/index.android.js +37 -43
- package/ui/html-view/index.android.js.map +1 -1
- package/ui/html-view/index.ios.js +62 -73
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +47 -57
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +54 -59
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.ios.js +65 -72
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image/symbol-effects-common.js +2 -6
- package/ui/image/symbol-effects-common.js.map +1 -1
- package/ui/image/symbol-effects.android.js +4 -10
- package/ui/image/symbol-effects.android.js.map +1 -1
- package/ui/image/symbol-effects.ios.js +7 -11
- package/ui/image/symbol-effects.ios.js.map +1 -1
- package/ui/image-cache/image-cache-common.js +57 -61
- package/ui/image-cache/image-cache-common.js.map +1 -1
- package/ui/image-cache/index.android.js +23 -27
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +24 -29
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/label/index.android.js +29 -38
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.js +89 -102
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +25 -30
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +6 -12
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.ios.js +32 -40
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/dock-layout-common.js +16 -21
- package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
- package/ui/layouts/dock-layout/index.android.js +11 -17
- package/ui/layouts/dock-layout/index.android.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js +45 -53
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +90 -115
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.js +92 -97
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +366 -427
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/grid-layout-common.js +159 -211
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.js +49 -55
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +340 -348
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.js +78 -106
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.js +25 -31
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +21 -27
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/root-layout/index.android.js +47 -46
- package/ui/layouts/root-layout/index.android.js.map +1 -1
- package/ui/layouts/root-layout/index.ios.js +54 -53
- package/ui/layouts/root-layout/index.ios.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-common.js +186 -190
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/layouts/stack-layout/index.android.js +6 -12
- package/ui/layouts/stack-layout/index.android.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +62 -69
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/stack-layout-common.js +7 -12
- package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +10 -16
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js +70 -76
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +13 -18
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js +42 -48
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +26 -36
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-picker/list-picker-common.js +27 -32
- package/ui/list-picker/list-picker-common.js.map +1 -1
- package/ui/list-view/index.android.js +98 -110
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.ios.js +121 -137
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js +100 -116
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.js +57 -65
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.ios.js +98 -107
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.js +113 -145
- package/ui/page/page-common.js.map +1 -1
- package/ui/placeholder/index.android.js +10 -16
- package/ui/placeholder/index.android.js.map +1 -1
- package/ui/placeholder/index.js +6 -12
- package/ui/placeholder/index.js.map +1 -1
- package/ui/progress/index.android.js +28 -34
- package/ui/progress/index.android.js.map +1 -1
- package/ui/progress/index.ios.js +29 -39
- package/ui/progress/index.ios.js.map +1 -1
- package/ui/progress/progress-common.js +11 -16
- package/ui/progress/progress-common.js.map +1 -1
- package/ui/proxy-view-container/index.js +90 -111
- package/ui/proxy-view-container/index.js.map +1 -1
- package/ui/repeater/index.js +100 -112
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.android.d.ts +1 -1
- package/ui/scroll-view/index.android.js +75 -95
- package/ui/scroll-view/index.android.js.map +1 -1
- package/ui/scroll-view/index.ios.js +72 -92
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.js +45 -65
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +88 -94
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +74 -88
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/search-bar/search-bar-common.js +13 -18
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/index.android.js +98 -112
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js +63 -80
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.js +61 -81
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/slider/index.android.js +43 -49
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js +49 -59
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/slider/slider-common.js +28 -35
- package/ui/slider/slider-common.js.map +1 -1
- package/ui/styling/background-common.js +98 -100
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.js +35 -38
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +252 -258
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/box-shadow.js +2 -6
- package/ui/styling/box-shadow.js.map +1 -1
- package/ui/styling/converters.js +7 -7
- package/ui/styling/converters.js.map +1 -1
- package/ui/styling/css-animation-parser.js +56 -69
- package/ui/styling/css-animation-parser.js.map +1 -1
- package/ui/styling/css-selector.js +425 -522
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-shadow.js +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js +3 -3
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-utils.js +22 -22
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font-common.js +44 -59
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font.android.js +34 -42
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +49 -54
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/linear-gradient.js +13 -17
- package/ui/styling/linear-gradient.js.map +1 -1
- package/ui/styling/style/index.js +36 -47
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.js +291 -306
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js +377 -416
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +41 -47
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js +57 -66
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/switch/switch-common.js +11 -16
- package/ui/switch/switch-common.js.map +1 -1
- package/ui/tab-view/index.android.js +187 -206
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +161 -177
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.js +143 -197
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/formatted-string.js +105 -158
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.android.js +130 -136
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +112 -120
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.js +102 -158
- package/ui/text-base/span.js.map +1 -1
- package/ui/text-base/text-base-common.js +181 -268
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.android.js +18 -24
- package/ui/text-field/index.android.js.map +1 -1
- package/ui/text-field/index.ios.js +70 -80
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-field/text-field-common.js +8 -13
- package/ui/text-field/text-field-common.js.map +1 -1
- package/ui/text-view/index.android.js +13 -19
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/text-view/index.ios.js +116 -124
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/text-view/text-view-common.js +3 -9
- package/ui/text-view/text-view-common.js.map +1 -1
- package/ui/time-picker/index.android.js +18 -24
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +61 -69
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/time-picker/time-picker-common.js +37 -42
- package/ui/time-picker/time-picker-common.js.map +1 -1
- package/ui/transition/fade-transition.android.js +8 -14
- package/ui/transition/fade-transition.android.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +4 -10
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/flip-transition.android.js +14 -18
- package/ui/transition/flip-transition.android.js.map +1 -1
- package/ui/transition/index.android.js +24 -27
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.ios.js +18 -22
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.js +4 -10
- package/ui/transition/modal-transition.android.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +18 -25
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js +57 -71
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +19 -27
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.js +8 -12
- package/ui/transition/shared-transition-helper.android.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +442 -539
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +77 -76
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.android.js +17 -22
- package/ui/transition/slide-transition.android.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +7 -11
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/utils.ios.js +13 -13
- package/ui/utils.ios.js.map +1 -1
- package/ui/web-view/index.android.js +50 -64
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +50 -73
- package/ui/web-view/index.ios.js.map +1 -1
- package/ui/web-view/web-view-common.js +29 -43
- package/ui/web-view/web-view-common.js.map +1 -1
- package/utils/android/index.js +26 -27
- package/utils/android/index.js.map +1 -1
- package/utils/common.js +49 -65
- package/utils/common.js.map +1 -1
- package/utils/constants.android.js +1 -1
- package/utils/constants.android.js.map +1 -1
- package/utils/constants.ios.js +1 -1
- package/utils/constants.ios.js.map +1 -1
- package/utils/debug.js +32 -54
- package/utils/debug.js.map +1 -1
- package/utils/index.android.js +40 -36
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.js +9 -9
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.js +45 -42
- package/utils/ios/index.js.map +1 -1
- package/utils/layout-helper/index.android.js +4 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.ios.js +2 -2
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.js +13 -13
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/lazy.js +2 -2
- package/utils/lazy.js.map +1 -1
- package/utils/macrotask-scheduler.js +6 -6
- package/utils/macrotask-scheduler.js.map +1 -1
- package/utils/mainthread-helper.android.js +4 -4
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/mainthread-helper.ios.js +1 -1
- package/utils/mainthread-helper.ios.js.map +1 -1
- package/utils/module-merge.js +1 -1
- package/utils/module-merge.js.map +1 -1
- package/utils/native-helper.android.js +19 -19
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.ios.js +16 -23
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/number-utils.js +3 -3
- package/utils/number-utils.js.map +1 -1
- package/utils/platform-check.js +6 -6
- package/utils/platform-check.js.map +1 -1
- package/utils/types.js +33 -43
- package/utils/types.js.map +1 -1
- package/wgc/crypto/SubtleCrypto.js +132 -167
- package/wgc/crypto/SubtleCrypto.js.map +1 -1
- package/wgc/crypto/index.d.ts +1 -1
- package/wgc/crypto/index.js +10 -18
- package/wgc/crypto/index.js.map +1 -1
- package/xhr/index.js +226 -308
- package/xhr/index.js.map +1 -1
- package/xml/index.js +78 -118
- package/xml/index.js.map +1 -1
|
@@ -50,15 +50,13 @@ function convertToStringCommon(length) {
|
|
|
50
50
|
if (typeof length === 'number') {
|
|
51
51
|
return length.toString();
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
let val = length.value;
|
|
54
54
|
if (length.unit === '%') {
|
|
55
55
|
val *= 100;
|
|
56
56
|
}
|
|
57
57
|
return val + length.unit;
|
|
58
58
|
}
|
|
59
|
-
function toDevicePixelsCommon(length, auto, parentAvailableWidth) {
|
|
60
|
-
if (auto === void 0) { auto = Number.NaN; }
|
|
61
|
-
if (parentAvailableWidth === void 0) { parentAvailableWidth = Number.NaN; }
|
|
59
|
+
function toDevicePixelsCommon(length, auto = Number.NaN, parentAvailableWidth = Number.NaN) {
|
|
62
60
|
if (length == 'auto') {
|
|
63
61
|
// tslint:disable-line
|
|
64
62
|
return auto;
|
|
@@ -87,10 +85,10 @@ export var PercentLength;
|
|
|
87
85
|
return 'auto';
|
|
88
86
|
}
|
|
89
87
|
if (typeof fromValue === 'string') {
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
let stringValue = fromValue.trim();
|
|
89
|
+
const percentIndex = stringValue.indexOf('%');
|
|
92
90
|
if (percentIndex !== -1) {
|
|
93
|
-
|
|
91
|
+
let value;
|
|
94
92
|
// if only % or % is not last we treat it as invalid value.
|
|
95
93
|
if (percentIndex !== stringValue.length - 1 || percentIndex === 0) {
|
|
96
94
|
value = Number.NaN;
|
|
@@ -100,22 +98,22 @@ export var PercentLength;
|
|
|
100
98
|
value = parseFloat(stringValue.substring(0, stringValue.length - 1).trim()) / 100;
|
|
101
99
|
}
|
|
102
100
|
if (isNaN(value) || !isFinite(value)) {
|
|
103
|
-
throw new Error(
|
|
101
|
+
throw new Error(`Invalid value: ${fromValue}`);
|
|
104
102
|
}
|
|
105
|
-
return { unit: '%', value
|
|
103
|
+
return { unit: '%', value };
|
|
106
104
|
}
|
|
107
105
|
else if (stringValue.indexOf('px') !== -1) {
|
|
108
106
|
stringValue = stringValue.replace('px', '').trim();
|
|
109
|
-
|
|
107
|
+
const value = parseFloat(stringValue);
|
|
110
108
|
if (isNaN(value) || !isFinite(value)) {
|
|
111
|
-
throw new Error(
|
|
109
|
+
throw new Error(`Invalid value: ${fromValue}`);
|
|
112
110
|
}
|
|
113
|
-
return { unit: 'px', value
|
|
111
|
+
return { unit: 'px', value };
|
|
114
112
|
}
|
|
115
113
|
else {
|
|
116
|
-
|
|
114
|
+
const value = parseFloat(stringValue);
|
|
117
115
|
if (isNaN(value) || !isFinite(value)) {
|
|
118
|
-
throw new Error(
|
|
116
|
+
throw new Error(`Invalid value: ${fromValue}`);
|
|
119
117
|
}
|
|
120
118
|
return value;
|
|
121
119
|
}
|
|
@@ -137,19 +135,19 @@ export var Length;
|
|
|
137
135
|
return 'auto';
|
|
138
136
|
}
|
|
139
137
|
if (typeof fromValue === 'string') {
|
|
140
|
-
|
|
138
|
+
let stringValue = fromValue.trim();
|
|
141
139
|
if (stringValue.indexOf('px') !== -1) {
|
|
142
140
|
stringValue = stringValue.replace('px', '').trim();
|
|
143
|
-
|
|
141
|
+
const value = parseFloat(stringValue);
|
|
144
142
|
if (isNaN(value) || !isFinite(value)) {
|
|
145
|
-
throw new Error(
|
|
143
|
+
throw new Error(`Invalid value: ${stringValue}`);
|
|
146
144
|
}
|
|
147
|
-
return { unit: 'px', value
|
|
145
|
+
return { unit: 'px', value };
|
|
148
146
|
}
|
|
149
147
|
else {
|
|
150
|
-
|
|
148
|
+
const value = parseFloat(stringValue);
|
|
151
149
|
if (isNaN(value) || !isFinite(value)) {
|
|
152
|
-
throw new Error(
|
|
150
|
+
throw new Error(`Invalid value: ${stringValue}`);
|
|
153
151
|
}
|
|
154
152
|
return value;
|
|
155
153
|
}
|
|
@@ -163,52 +161,52 @@ export var Length;
|
|
|
163
161
|
Length.toDevicePixels = toDevicePixelsCommon;
|
|
164
162
|
Length.convertToString = convertToStringCommon;
|
|
165
163
|
})(Length || (Length = {}));
|
|
166
|
-
export
|
|
164
|
+
export const minWidthProperty = new CssProperty({
|
|
167
165
|
name: 'minWidth',
|
|
168
166
|
cssName: 'min-width',
|
|
169
167
|
defaultValue: CoreTypes.zeroLength,
|
|
170
168
|
affectsLayout: global.isIOS,
|
|
171
169
|
equalityComparer: Length.equals,
|
|
172
|
-
valueChanged:
|
|
173
|
-
|
|
170
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
171
|
+
const view = target.viewRef.get();
|
|
174
172
|
if (view) {
|
|
175
173
|
view.effectiveMinWidth = Length.toDevicePixels(newValue, 0);
|
|
176
174
|
}
|
|
177
175
|
else {
|
|
178
|
-
Trace.write(
|
|
176
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
179
177
|
}
|
|
180
178
|
},
|
|
181
179
|
valueConverter: Length.parse,
|
|
182
180
|
});
|
|
183
181
|
minWidthProperty.register(Style);
|
|
184
|
-
export
|
|
182
|
+
export const minHeightProperty = new CssProperty({
|
|
185
183
|
name: 'minHeight',
|
|
186
184
|
cssName: 'min-height',
|
|
187
185
|
defaultValue: CoreTypes.zeroLength,
|
|
188
186
|
affectsLayout: global.isIOS,
|
|
189
187
|
equalityComparer: Length.equals,
|
|
190
|
-
valueChanged:
|
|
191
|
-
|
|
188
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
189
|
+
const view = target.viewRef.get();
|
|
192
190
|
if (view) {
|
|
193
191
|
view.effectiveMinHeight = Length.toDevicePixels(newValue, 0);
|
|
194
192
|
}
|
|
195
193
|
else {
|
|
196
|
-
Trace.write(
|
|
194
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
197
195
|
}
|
|
198
196
|
},
|
|
199
197
|
valueConverter: Length.parse,
|
|
200
198
|
});
|
|
201
199
|
minHeightProperty.register(Style);
|
|
202
|
-
export
|
|
200
|
+
export const widthProperty = new CssAnimationProperty({
|
|
203
201
|
name: 'width',
|
|
204
202
|
cssName: 'width',
|
|
205
203
|
defaultValue: 'auto',
|
|
206
204
|
equalityComparer: Length.equals,
|
|
207
205
|
// TODO: CSSAnimationProperty was needed for keyframe (copying other impls), but `affectsLayout` does not exist
|
|
208
206
|
// on the animation property, so fake it here. x_x
|
|
209
|
-
valueChanged:
|
|
207
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
210
208
|
if (global.isIOS) {
|
|
211
|
-
|
|
209
|
+
const view = target.viewRef.get();
|
|
212
210
|
if (view) {
|
|
213
211
|
view.requestLayout();
|
|
214
212
|
}
|
|
@@ -217,16 +215,16 @@ export var widthProperty = new CssAnimationProperty({
|
|
|
217
215
|
valueConverter: PercentLength.parse,
|
|
218
216
|
});
|
|
219
217
|
widthProperty.register(Style);
|
|
220
|
-
export
|
|
218
|
+
export const heightProperty = new CssAnimationProperty({
|
|
221
219
|
name: 'height',
|
|
222
220
|
cssName: 'height',
|
|
223
221
|
defaultValue: 'auto',
|
|
224
222
|
equalityComparer: Length.equals,
|
|
225
223
|
// TODO: CSSAnimationProperty was needed for keyframe (copying other impls), but `affectsLayout` does not exist
|
|
226
224
|
// on the animation property, so fake it here. -_-
|
|
227
|
-
valueChanged:
|
|
225
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
228
226
|
if (global.isIOS) {
|
|
229
|
-
|
|
227
|
+
const view = target.viewRef.get();
|
|
230
228
|
if (view) {
|
|
231
229
|
view.requestLayout();
|
|
232
230
|
}
|
|
@@ -235,19 +233,19 @@ export var heightProperty = new CssAnimationProperty({
|
|
|
235
233
|
valueConverter: PercentLength.parse,
|
|
236
234
|
});
|
|
237
235
|
heightProperty.register(Style);
|
|
238
|
-
|
|
236
|
+
const marginProperty = new ShorthandProperty({
|
|
239
237
|
name: 'margin',
|
|
240
238
|
cssName: 'margin',
|
|
241
239
|
getter: function () {
|
|
242
240
|
if (PercentLength.equals(this.marginTop, this.marginRight) && PercentLength.equals(this.marginTop, this.marginBottom) && PercentLength.equals(this.marginTop, this.marginLeft)) {
|
|
243
241
|
return this.marginTop;
|
|
244
242
|
}
|
|
245
|
-
return
|
|
243
|
+
return `${PercentLength.convertToString(this.marginTop)} ${PercentLength.convertToString(this.marginRight)} ${PercentLength.convertToString(this.marginBottom)} ${PercentLength.convertToString(this.marginLeft)}`;
|
|
246
244
|
},
|
|
247
245
|
converter: convertToMargins,
|
|
248
246
|
});
|
|
249
247
|
marginProperty.register(Style);
|
|
250
|
-
export
|
|
248
|
+
export const marginLeftProperty = new CssProperty({
|
|
251
249
|
name: 'marginLeft',
|
|
252
250
|
cssName: 'margin-left',
|
|
253
251
|
defaultValue: CoreTypes.zeroLength,
|
|
@@ -256,7 +254,7 @@ export var marginLeftProperty = new CssProperty({
|
|
|
256
254
|
valueConverter: PercentLength.parse,
|
|
257
255
|
});
|
|
258
256
|
marginLeftProperty.register(Style);
|
|
259
|
-
export
|
|
257
|
+
export const marginRightProperty = new CssProperty({
|
|
260
258
|
name: 'marginRight',
|
|
261
259
|
cssName: 'margin-right',
|
|
262
260
|
defaultValue: CoreTypes.zeroLength,
|
|
@@ -265,7 +263,7 @@ export var marginRightProperty = new CssProperty({
|
|
|
265
263
|
valueConverter: PercentLength.parse,
|
|
266
264
|
});
|
|
267
265
|
marginRightProperty.register(Style);
|
|
268
|
-
export
|
|
266
|
+
export const marginTopProperty = new CssProperty({
|
|
269
267
|
name: 'marginTop',
|
|
270
268
|
cssName: 'margin-top',
|
|
271
269
|
defaultValue: CoreTypes.zeroLength,
|
|
@@ -274,7 +272,7 @@ export var marginTopProperty = new CssProperty({
|
|
|
274
272
|
valueConverter: PercentLength.parse,
|
|
275
273
|
});
|
|
276
274
|
marginTopProperty.register(Style);
|
|
277
|
-
export
|
|
275
|
+
export const marginBottomProperty = new CssProperty({
|
|
278
276
|
name: 'marginBottom',
|
|
279
277
|
cssName: 'margin-bottom',
|
|
280
278
|
defaultValue: CoreTypes.zeroLength,
|
|
@@ -283,91 +281,91 @@ export var marginBottomProperty = new CssProperty({
|
|
|
283
281
|
valueConverter: PercentLength.parse,
|
|
284
282
|
});
|
|
285
283
|
marginBottomProperty.register(Style);
|
|
286
|
-
|
|
284
|
+
const paddingProperty = new ShorthandProperty({
|
|
287
285
|
name: 'padding',
|
|
288
286
|
cssName: 'padding',
|
|
289
287
|
getter: function () {
|
|
290
288
|
if (Length.equals(this.paddingTop, this.paddingRight) && Length.equals(this.paddingTop, this.paddingBottom) && Length.equals(this.paddingTop, this.paddingLeft)) {
|
|
291
289
|
return this.paddingTop;
|
|
292
290
|
}
|
|
293
|
-
return
|
|
291
|
+
return `${Length.convertToString(this.paddingTop)} ${Length.convertToString(this.paddingRight)} ${Length.convertToString(this.paddingBottom)} ${Length.convertToString(this.paddingLeft)}`;
|
|
294
292
|
},
|
|
295
293
|
converter: convertToPaddings,
|
|
296
294
|
});
|
|
297
295
|
paddingProperty.register(Style);
|
|
298
|
-
export
|
|
296
|
+
export const paddingLeftProperty = new CssProperty({
|
|
299
297
|
name: 'paddingLeft',
|
|
300
298
|
cssName: 'padding-left',
|
|
301
299
|
defaultValue: CoreTypes.zeroLength,
|
|
302
300
|
affectsLayout: global.isIOS,
|
|
303
301
|
equalityComparer: Length.equals,
|
|
304
|
-
valueChanged:
|
|
305
|
-
|
|
302
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
303
|
+
const view = target.viewRef.get();
|
|
306
304
|
if (view) {
|
|
307
305
|
view.effectivePaddingLeft = Length.toDevicePixels(newValue, 0);
|
|
308
306
|
}
|
|
309
307
|
else {
|
|
310
|
-
Trace.write(
|
|
308
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
311
309
|
}
|
|
312
310
|
},
|
|
313
311
|
valueConverter: Length.parse,
|
|
314
312
|
});
|
|
315
313
|
paddingLeftProperty.register(Style);
|
|
316
|
-
export
|
|
314
|
+
export const paddingRightProperty = new CssProperty({
|
|
317
315
|
name: 'paddingRight',
|
|
318
316
|
cssName: 'padding-right',
|
|
319
317
|
defaultValue: CoreTypes.zeroLength,
|
|
320
318
|
affectsLayout: global.isIOS,
|
|
321
319
|
equalityComparer: Length.equals,
|
|
322
|
-
valueChanged:
|
|
323
|
-
|
|
320
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
321
|
+
const view = target.viewRef.get();
|
|
324
322
|
if (view) {
|
|
325
323
|
view.effectivePaddingRight = Length.toDevicePixels(newValue, 0);
|
|
326
324
|
}
|
|
327
325
|
else {
|
|
328
|
-
Trace.write(
|
|
326
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
329
327
|
}
|
|
330
328
|
},
|
|
331
329
|
valueConverter: Length.parse,
|
|
332
330
|
});
|
|
333
331
|
paddingRightProperty.register(Style);
|
|
334
|
-
export
|
|
332
|
+
export const paddingTopProperty = new CssProperty({
|
|
335
333
|
name: 'paddingTop',
|
|
336
334
|
cssName: 'padding-top',
|
|
337
335
|
defaultValue: CoreTypes.zeroLength,
|
|
338
336
|
affectsLayout: global.isIOS,
|
|
339
337
|
equalityComparer: Length.equals,
|
|
340
|
-
valueChanged:
|
|
341
|
-
|
|
338
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
339
|
+
const view = target.viewRef.get();
|
|
342
340
|
if (view) {
|
|
343
341
|
view.effectivePaddingTop = Length.toDevicePixels(newValue, 0);
|
|
344
342
|
}
|
|
345
343
|
else {
|
|
346
|
-
Trace.write(
|
|
344
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
347
345
|
}
|
|
348
346
|
},
|
|
349
347
|
valueConverter: Length.parse,
|
|
350
348
|
});
|
|
351
349
|
paddingTopProperty.register(Style);
|
|
352
|
-
export
|
|
350
|
+
export const paddingBottomProperty = new CssProperty({
|
|
353
351
|
name: 'paddingBottom',
|
|
354
352
|
cssName: 'padding-bottom',
|
|
355
353
|
defaultValue: CoreTypes.zeroLength,
|
|
356
354
|
affectsLayout: global.isIOS,
|
|
357
355
|
equalityComparer: Length.equals,
|
|
358
|
-
valueChanged:
|
|
359
|
-
|
|
356
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
357
|
+
const view = target.viewRef.get();
|
|
360
358
|
if (view) {
|
|
361
359
|
view.effectivePaddingBottom = Length.toDevicePixels(newValue, 0);
|
|
362
360
|
}
|
|
363
361
|
else {
|
|
364
|
-
Trace.write(
|
|
362
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
365
363
|
}
|
|
366
364
|
},
|
|
367
365
|
valueConverter: Length.parse,
|
|
368
366
|
});
|
|
369
367
|
paddingBottomProperty.register(Style);
|
|
370
|
-
export
|
|
368
|
+
export const horizontalAlignmentProperty = new CssProperty({
|
|
371
369
|
name: 'horizontalAlignment',
|
|
372
370
|
cssName: 'horizontal-align',
|
|
373
371
|
defaultValue: CoreTypes.HorizontalAlignment.stretch,
|
|
@@ -375,7 +373,7 @@ export var horizontalAlignmentProperty = new CssProperty({
|
|
|
375
373
|
valueConverter: CoreTypes.HorizontalAlignment.parse,
|
|
376
374
|
});
|
|
377
375
|
horizontalAlignmentProperty.register(Style);
|
|
378
|
-
export
|
|
376
|
+
export const verticalAlignmentProperty = new CssProperty({
|
|
379
377
|
name: 'verticalAlignment',
|
|
380
378
|
cssName: 'vertical-align',
|
|
381
379
|
defaultValue: CoreTypes.VerticalAlignmentText.stretch,
|
|
@@ -385,31 +383,31 @@ export var verticalAlignmentProperty = new CssProperty({
|
|
|
385
383
|
verticalAlignmentProperty.register(Style);
|
|
386
384
|
function parseThickness(value) {
|
|
387
385
|
if (typeof value === 'string') {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
386
|
+
const arr = value.split(/[ ,]+/);
|
|
387
|
+
let top;
|
|
388
|
+
let right;
|
|
389
|
+
let bottom;
|
|
390
|
+
let left;
|
|
393
391
|
if (arr.length === 1) {
|
|
394
|
-
|
|
392
|
+
top = arr[0];
|
|
395
393
|
right = arr[0];
|
|
396
394
|
bottom = arr[0];
|
|
397
395
|
left = arr[0];
|
|
398
396
|
}
|
|
399
397
|
else if (arr.length === 2) {
|
|
400
|
-
|
|
398
|
+
top = arr[0];
|
|
401
399
|
bottom = arr[0];
|
|
402
400
|
right = arr[1];
|
|
403
401
|
left = arr[1];
|
|
404
402
|
}
|
|
405
403
|
else if (arr.length === 3) {
|
|
406
|
-
|
|
404
|
+
top = arr[0];
|
|
407
405
|
right = arr[1];
|
|
408
406
|
left = arr[1];
|
|
409
407
|
bottom = arr[2];
|
|
410
408
|
}
|
|
411
409
|
else if (arr.length === 4) {
|
|
412
|
-
|
|
410
|
+
top = arr[0];
|
|
413
411
|
right = arr[1];
|
|
414
412
|
bottom = arr[2];
|
|
415
413
|
left = arr[3];
|
|
@@ -418,7 +416,7 @@ function parseThickness(value) {
|
|
|
418
416
|
throw new Error('Expected 1, 2, 3 or 4 parameters. Actual: ' + value);
|
|
419
417
|
}
|
|
420
418
|
return {
|
|
421
|
-
top:
|
|
419
|
+
top: top,
|
|
422
420
|
right: right,
|
|
423
421
|
bottom: bottom,
|
|
424
422
|
left: left,
|
|
@@ -430,7 +428,7 @@ function parseThickness(value) {
|
|
|
430
428
|
}
|
|
431
429
|
function convertToMargins(value) {
|
|
432
430
|
if (typeof value === 'string' && value !== 'auto') {
|
|
433
|
-
|
|
431
|
+
const thickness = parseThickness(value);
|
|
434
432
|
return [
|
|
435
433
|
[marginTopProperty, PercentLength.parse(thickness.top)],
|
|
436
434
|
[marginRightProperty, PercentLength.parse(thickness.right)],
|
|
@@ -449,7 +447,7 @@ function convertToMargins(value) {
|
|
|
449
447
|
}
|
|
450
448
|
function convertToPaddings(value) {
|
|
451
449
|
if (typeof value === 'string' && value !== 'auto') {
|
|
452
|
-
|
|
450
|
+
const thickness = parseThickness(value);
|
|
453
451
|
return [
|
|
454
452
|
[paddingTopProperty, Length.parse(thickness.top)],
|
|
455
453
|
[paddingRightProperty, Length.parse(thickness.right)],
|
|
@@ -466,42 +464,42 @@ function convertToPaddings(value) {
|
|
|
466
464
|
];
|
|
467
465
|
}
|
|
468
466
|
}
|
|
469
|
-
export
|
|
467
|
+
export const rotateProperty = new CssAnimationProperty({
|
|
470
468
|
name: 'rotate',
|
|
471
469
|
cssName: 'rotate',
|
|
472
470
|
defaultValue: 0,
|
|
473
471
|
valueConverter: parseFloat,
|
|
474
472
|
});
|
|
475
473
|
rotateProperty.register(Style);
|
|
476
|
-
export
|
|
474
|
+
export const rotateXProperty = new CssAnimationProperty({
|
|
477
475
|
name: 'rotateX',
|
|
478
476
|
cssName: 'rotatex',
|
|
479
477
|
defaultValue: 0,
|
|
480
478
|
valueConverter: parseFloat,
|
|
481
479
|
});
|
|
482
480
|
rotateXProperty.register(Style);
|
|
483
|
-
export
|
|
481
|
+
export const rotateYProperty = new CssAnimationProperty({
|
|
484
482
|
name: 'rotateY',
|
|
485
483
|
cssName: 'rotatey',
|
|
486
484
|
defaultValue: 0,
|
|
487
485
|
valueConverter: parseFloat,
|
|
488
486
|
});
|
|
489
487
|
rotateYProperty.register(Style);
|
|
490
|
-
export
|
|
488
|
+
export const perspectiveProperty = new CssAnimationProperty({
|
|
491
489
|
name: 'perspective',
|
|
492
490
|
cssName: 'perspective',
|
|
493
491
|
defaultValue: 1000,
|
|
494
492
|
valueConverter: parseFloat,
|
|
495
493
|
});
|
|
496
494
|
perspectiveProperty.register(Style);
|
|
497
|
-
export
|
|
495
|
+
export const scaleXProperty = new CssAnimationProperty({
|
|
498
496
|
name: 'scaleX',
|
|
499
497
|
cssName: 'scaleX',
|
|
500
498
|
defaultValue: 1,
|
|
501
499
|
valueConverter: parseFloat,
|
|
502
500
|
});
|
|
503
501
|
scaleXProperty.register(Style);
|
|
504
|
-
export
|
|
502
|
+
export const scaleYProperty = new CssAnimationProperty({
|
|
505
503
|
name: 'scaleY',
|
|
506
504
|
cssName: 'scaleY',
|
|
507
505
|
defaultValue: 1,
|
|
@@ -516,118 +514,106 @@ function parseDIPs(value) {
|
|
|
516
514
|
return parseFloat(value.replace('dip', '').trim());
|
|
517
515
|
}
|
|
518
516
|
}
|
|
519
|
-
export
|
|
517
|
+
export const translateXProperty = new CssAnimationProperty({
|
|
520
518
|
name: 'translateX',
|
|
521
519
|
cssName: 'translateX',
|
|
522
520
|
defaultValue: 0,
|
|
523
521
|
valueConverter: parseDIPs,
|
|
524
522
|
});
|
|
525
523
|
translateXProperty.register(Style);
|
|
526
|
-
export
|
|
524
|
+
export const translateYProperty = new CssAnimationProperty({
|
|
527
525
|
name: 'translateY',
|
|
528
526
|
cssName: 'translateY',
|
|
529
527
|
defaultValue: 0,
|
|
530
528
|
valueConverter: parseDIPs,
|
|
531
529
|
});
|
|
532
530
|
translateYProperty.register(Style);
|
|
533
|
-
|
|
531
|
+
const transformProperty = new ShorthandProperty({
|
|
534
532
|
name: 'transform',
|
|
535
533
|
cssName: 'transform',
|
|
536
534
|
getter: function () {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
535
|
+
const scaleX = this.scaleX;
|
|
536
|
+
const scaleY = this.scaleY;
|
|
537
|
+
const translateX = this.translateX;
|
|
538
|
+
const translateY = this.translateY;
|
|
539
|
+
const rotate = this.rotate;
|
|
540
|
+
const rotateX = this.rotateX;
|
|
541
|
+
const rotateY = this.rotateY;
|
|
542
|
+
let result = '';
|
|
545
543
|
if (translateX !== 0 || translateY !== 0) {
|
|
546
|
-
result +=
|
|
544
|
+
result += `translate(${translateX}, ${translateY}) `;
|
|
547
545
|
}
|
|
548
546
|
if (scaleX !== 1 || scaleY !== 1) {
|
|
549
|
-
result +=
|
|
547
|
+
result += `scale(${scaleX}, ${scaleY}) `;
|
|
550
548
|
}
|
|
551
549
|
if (rotateX !== 0 || rotateY !== 0 || rotate !== 0) {
|
|
552
|
-
result +=
|
|
553
|
-
result +=
|
|
550
|
+
result += `rotate(${rotateX}, ${rotateY}, ${rotate}) `;
|
|
551
|
+
result += `rotate (${rotate})`;
|
|
554
552
|
}
|
|
555
553
|
return result.trim();
|
|
556
554
|
},
|
|
557
555
|
converter: convertToTransform,
|
|
558
556
|
});
|
|
559
557
|
transformProperty.register(Style);
|
|
560
|
-
|
|
558
|
+
const IDENTITY_TRANSFORMATION = {
|
|
561
559
|
translate: { x: 0, y: 0 },
|
|
562
560
|
rotate: { x: 0, y: 0, z: 0 },
|
|
563
561
|
scale: { x: 1, y: 1 },
|
|
564
562
|
};
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
scale:
|
|
569
|
-
scale3d:
|
|
570
|
-
scaleX:
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
value: { x: x, y: IDENTITY_TRANSFORMATION.translate.y },
|
|
591
|
-
});
|
|
592
|
-
},
|
|
593
|
-
translateY: function (_a) {
|
|
594
|
-
var y = _a.y;
|
|
595
|
-
return ({
|
|
596
|
-
property: 'translate',
|
|
597
|
-
value: { y: y, x: IDENTITY_TRANSFORMATION.translate.x },
|
|
598
|
-
});
|
|
599
|
-
},
|
|
600
|
-
rotate3d: function (value) { return ({ property: 'rotate', value: value }); },
|
|
601
|
-
rotateX: function (x) { return ({
|
|
563
|
+
const TRANSFORM_SPLITTER = new RegExp(/\s*(.+?)\((.*?)\)/g);
|
|
564
|
+
const TRANSFORMATIONS = Object.freeze(['rotate', 'rotateX', 'rotateY', 'rotate3d', 'translate', 'translate3d', 'translateX', 'translateY', 'scale', 'scale3d', 'scaleX', 'scaleY']);
|
|
565
|
+
const STYLE_TRANSFORMATION_MAP = Object.freeze({
|
|
566
|
+
scale: (value) => ({ property: 'scale', value }),
|
|
567
|
+
scale3d: (value) => ({ property: 'scale', value }),
|
|
568
|
+
scaleX: ({ x }) => ({
|
|
569
|
+
property: 'scale',
|
|
570
|
+
value: { x, y: IDENTITY_TRANSFORMATION.scale.y },
|
|
571
|
+
}),
|
|
572
|
+
scaleY: ({ y }) => ({
|
|
573
|
+
property: 'scale',
|
|
574
|
+
value: { y, x: IDENTITY_TRANSFORMATION.scale.x },
|
|
575
|
+
}),
|
|
576
|
+
translate: (value) => ({ property: 'translate', value }),
|
|
577
|
+
translate3d: (value) => ({ property: 'translate', value }),
|
|
578
|
+
translateX: ({ x }) => ({
|
|
579
|
+
property: 'translate',
|
|
580
|
+
value: { x, y: IDENTITY_TRANSFORMATION.translate.y },
|
|
581
|
+
}),
|
|
582
|
+
translateY: ({ y }) => ({
|
|
583
|
+
property: 'translate',
|
|
584
|
+
value: { y, x: IDENTITY_TRANSFORMATION.translate.x },
|
|
585
|
+
}),
|
|
586
|
+
rotate3d: (value) => ({ property: 'rotate', value }),
|
|
587
|
+
rotateX: (x) => ({
|
|
602
588
|
property: 'rotate',
|
|
603
589
|
value: {
|
|
604
|
-
x
|
|
590
|
+
x,
|
|
605
591
|
y: IDENTITY_TRANSFORMATION.rotate.y,
|
|
606
592
|
z: IDENTITY_TRANSFORMATION.rotate.z,
|
|
607
593
|
},
|
|
608
|
-
})
|
|
609
|
-
rotateY:
|
|
594
|
+
}),
|
|
595
|
+
rotateY: (y) => ({
|
|
610
596
|
property: 'rotate',
|
|
611
597
|
value: {
|
|
612
598
|
x: IDENTITY_TRANSFORMATION.rotate.x,
|
|
613
|
-
y
|
|
599
|
+
y,
|
|
614
600
|
z: IDENTITY_TRANSFORMATION.rotate.z,
|
|
615
601
|
},
|
|
616
|
-
})
|
|
617
|
-
rotate:
|
|
602
|
+
}),
|
|
603
|
+
rotate: (z) => ({
|
|
618
604
|
property: 'rotate',
|
|
619
605
|
value: {
|
|
620
606
|
x: IDENTITY_TRANSFORMATION.rotate.x,
|
|
621
607
|
y: IDENTITY_TRANSFORMATION.rotate.y,
|
|
622
|
-
z
|
|
608
|
+
z,
|
|
623
609
|
},
|
|
624
|
-
})
|
|
610
|
+
}),
|
|
625
611
|
});
|
|
626
612
|
function convertToTransform(value) {
|
|
627
613
|
if (value === unsetValue) {
|
|
628
614
|
value = 'none';
|
|
629
615
|
}
|
|
630
|
-
|
|
616
|
+
const { translate, rotate, scale } = transformConverter(value);
|
|
631
617
|
return [
|
|
632
618
|
[translateXProperty, translate.x],
|
|
633
619
|
[translateYProperty, translate.y],
|
|
@@ -639,80 +625,79 @@ function convertToTransform(value) {
|
|
|
639
625
|
];
|
|
640
626
|
}
|
|
641
627
|
export function transformConverter(text) {
|
|
642
|
-
|
|
628
|
+
const transformations = parseTransformString(text);
|
|
643
629
|
if (text === 'none' || text === '' || !transformations.length) {
|
|
644
630
|
return IDENTITY_TRANSFORMATION;
|
|
645
631
|
}
|
|
646
|
-
|
|
632
|
+
const usedTransforms = transformations.map((t) => t.property);
|
|
647
633
|
if (!hasDuplicates(usedTransforms)) {
|
|
648
|
-
|
|
649
|
-
transformations.forEach(
|
|
650
|
-
|
|
634
|
+
const fullTransformations = { ...IDENTITY_TRANSFORMATION };
|
|
635
|
+
transformations.forEach((transform) => {
|
|
636
|
+
fullTransformations[transform.property] = transform.value;
|
|
651
637
|
});
|
|
652
|
-
return
|
|
638
|
+
return fullTransformations;
|
|
653
639
|
}
|
|
654
|
-
|
|
655
|
-
|
|
640
|
+
const affineMatrix = transformations.map(getTransformMatrix).reduce(multiplyAffine2d);
|
|
641
|
+
const cssMatrix = matrixArrayToCssMatrix(affineMatrix);
|
|
656
642
|
return decompose2DTransformMatrix(cssMatrix);
|
|
657
643
|
}
|
|
658
644
|
// using general regex and manually checking the matched
|
|
659
645
|
// properties is faster than using more specific regex
|
|
660
646
|
// https://jsperf.com/cssparse
|
|
661
647
|
function parseTransformString(text) {
|
|
662
|
-
|
|
663
|
-
|
|
648
|
+
const matches = [];
|
|
649
|
+
let match;
|
|
664
650
|
while ((match = TRANSFORM_SPLITTER.exec(text)) !== null) {
|
|
665
|
-
|
|
666
|
-
|
|
651
|
+
const property = match[1];
|
|
652
|
+
const value = convertTransformValue(property, match[2]);
|
|
667
653
|
if (TRANSFORMATIONS.indexOf(property) !== -1) {
|
|
668
|
-
matches.push(normalizeTransformation({ property
|
|
654
|
+
matches.push(normalizeTransformation({ property, value }));
|
|
669
655
|
}
|
|
670
656
|
}
|
|
671
657
|
return matches;
|
|
672
658
|
}
|
|
673
|
-
function normalizeTransformation(
|
|
674
|
-
var property = _a.property, value = _a.value;
|
|
659
|
+
function normalizeTransformation({ property, value }) {
|
|
675
660
|
return STYLE_TRANSFORMATION_MAP[property](value);
|
|
676
661
|
}
|
|
677
662
|
function convertTransformValue(property, stringValue) {
|
|
678
663
|
// eslint-disable-next-line prefer-const
|
|
679
|
-
|
|
664
|
+
let [x, y, z] = stringValue.split(',').map(parseFloat);
|
|
680
665
|
if (property === 'translate') {
|
|
681
|
-
y
|
|
666
|
+
y ?? (y = IDENTITY_TRANSFORMATION.translate.y);
|
|
682
667
|
}
|
|
683
668
|
else {
|
|
684
|
-
y
|
|
685
|
-
z
|
|
669
|
+
y ?? (y = x);
|
|
670
|
+
z ?? (z = y);
|
|
686
671
|
}
|
|
687
672
|
if (property === 'rotate' || property === 'rotateX' || property === 'rotateY') {
|
|
688
673
|
return stringValue.slice(-3) === 'rad' ? radiansToDegrees(x) : x;
|
|
689
674
|
}
|
|
690
|
-
return { x
|
|
675
|
+
return { x, y, z };
|
|
691
676
|
}
|
|
692
677
|
// Background properties.
|
|
693
|
-
|
|
678
|
+
const backgroundProperty = new ShorthandProperty({
|
|
694
679
|
name: 'background',
|
|
695
680
|
cssName: 'background',
|
|
696
681
|
getter: function () {
|
|
697
|
-
return
|
|
682
|
+
return `${this.backgroundColor} ${this.backgroundImage} ${this.backgroundRepeat} ${this.backgroundPosition}`;
|
|
698
683
|
},
|
|
699
684
|
converter: convertToBackgrounds,
|
|
700
685
|
});
|
|
701
686
|
backgroundProperty.register(Style);
|
|
702
|
-
export
|
|
687
|
+
export const backgroundInternalProperty = new CssProperty({
|
|
703
688
|
name: 'backgroundInternal',
|
|
704
689
|
cssName: '_backgroundInternal',
|
|
705
690
|
defaultValue: Background.default,
|
|
706
691
|
});
|
|
707
692
|
backgroundInternalProperty.register(Style);
|
|
708
693
|
// const pattern: RegExp = /url\(('|")(.*?)\1\)/;
|
|
709
|
-
export
|
|
694
|
+
export const backgroundImageProperty = new CssProperty({
|
|
710
695
|
name: 'backgroundImage',
|
|
711
696
|
cssName: 'background-image',
|
|
712
|
-
valueChanged:
|
|
697
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
713
698
|
target.backgroundInternal = target.backgroundInternal.withImage(newValue);
|
|
714
699
|
},
|
|
715
|
-
equalityComparer:
|
|
700
|
+
equalityComparer: (value1, value2) => {
|
|
716
701
|
if (value1 instanceof LinearGradient && value2 instanceof LinearGradient) {
|
|
717
702
|
return LinearGradient.equals(value1, value2);
|
|
718
703
|
}
|
|
@@ -720,9 +705,9 @@ export var backgroundImageProperty = new CssProperty({
|
|
|
720
705
|
return value1 === value2;
|
|
721
706
|
}
|
|
722
707
|
},
|
|
723
|
-
valueConverter:
|
|
708
|
+
valueConverter: (value) => {
|
|
724
709
|
if (typeof value === 'string') {
|
|
725
|
-
|
|
710
|
+
const parsed = parseBackground(value);
|
|
726
711
|
if (parsed) {
|
|
727
712
|
value = typeof parsed.value.image === 'object' ? LinearGradient.parse(parsed.value.image) : value;
|
|
728
713
|
}
|
|
@@ -731,57 +716,57 @@ export var backgroundImageProperty = new CssProperty({
|
|
|
731
716
|
},
|
|
732
717
|
});
|
|
733
718
|
backgroundImageProperty.register(Style);
|
|
734
|
-
export
|
|
719
|
+
export const backgroundColorProperty = new CssAnimationProperty({
|
|
735
720
|
name: 'backgroundColor',
|
|
736
721
|
cssName: 'background-color',
|
|
737
|
-
valueChanged:
|
|
722
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
738
723
|
target.backgroundInternal = target.backgroundInternal.withColor(newValue);
|
|
739
724
|
},
|
|
740
725
|
equalityComparer: Color.equals,
|
|
741
|
-
valueConverter:
|
|
726
|
+
valueConverter: (value) => new Color(value),
|
|
742
727
|
});
|
|
743
728
|
backgroundColorProperty.register(Style);
|
|
744
|
-
export
|
|
729
|
+
export const backgroundRepeatProperty = new CssProperty({
|
|
745
730
|
name: 'backgroundRepeat',
|
|
746
731
|
cssName: 'background-repeat',
|
|
747
732
|
valueConverter: CoreTypes.BackgroundRepeat.parse,
|
|
748
|
-
valueChanged:
|
|
733
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
749
734
|
target.backgroundInternal = target.backgroundInternal.withRepeat(newValue);
|
|
750
735
|
},
|
|
751
736
|
});
|
|
752
737
|
backgroundRepeatProperty.register(Style);
|
|
753
|
-
export
|
|
738
|
+
export const backgroundSizeProperty = new CssProperty({
|
|
754
739
|
name: 'backgroundSize',
|
|
755
740
|
cssName: 'background-size',
|
|
756
|
-
valueChanged:
|
|
741
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
757
742
|
target.backgroundInternal = target.backgroundInternal.withSize(newValue);
|
|
758
743
|
},
|
|
759
744
|
});
|
|
760
745
|
backgroundSizeProperty.register(Style);
|
|
761
|
-
export
|
|
746
|
+
export const backgroundPositionProperty = new CssProperty({
|
|
762
747
|
name: 'backgroundPosition',
|
|
763
748
|
cssName: 'background-position',
|
|
764
|
-
valueChanged:
|
|
749
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
765
750
|
target.backgroundInternal = target.backgroundInternal.withPosition(newValue);
|
|
766
751
|
},
|
|
767
752
|
});
|
|
768
753
|
backgroundPositionProperty.register(Style);
|
|
769
754
|
function convertToBackgrounds(value) {
|
|
770
755
|
if (typeof value === 'string') {
|
|
771
|
-
|
|
772
|
-
|
|
756
|
+
const backgrounds = parseBackground(value).value;
|
|
757
|
+
let backgroundColor = unsetValue;
|
|
773
758
|
if (backgrounds.color) {
|
|
774
759
|
backgroundColor = backgrounds.color instanceof Color ? backgrounds.color : new Color(backgrounds.color);
|
|
775
760
|
}
|
|
776
|
-
|
|
761
|
+
let backgroundImage;
|
|
777
762
|
if (typeof backgrounds.image === 'object' && backgrounds.image) {
|
|
778
763
|
backgroundImage = LinearGradient.parse(backgrounds.image);
|
|
779
764
|
}
|
|
780
765
|
else {
|
|
781
766
|
backgroundImage = backgrounds.image || unsetValue;
|
|
782
767
|
}
|
|
783
|
-
|
|
784
|
-
|
|
768
|
+
const backgroundRepeat = backgrounds.repeat || unsetValue;
|
|
769
|
+
const backgroundPosition = backgrounds.position ? backgrounds.position.text : unsetValue;
|
|
785
770
|
return [
|
|
786
771
|
[backgroundColorProperty, backgroundColor],
|
|
787
772
|
[backgroundImageProperty, backgroundImage],
|
|
@@ -799,7 +784,7 @@ function convertToBackgrounds(value) {
|
|
|
799
784
|
}
|
|
800
785
|
}
|
|
801
786
|
function parseBorderColor(value) {
|
|
802
|
-
|
|
787
|
+
const result = {
|
|
803
788
|
top: undefined,
|
|
804
789
|
right: undefined,
|
|
805
790
|
bottom: undefined,
|
|
@@ -809,48 +794,48 @@ function parseBorderColor(value) {
|
|
|
809
794
|
result.top = result.right = result.bottom = result.left = new Color(value);
|
|
810
795
|
return result;
|
|
811
796
|
}
|
|
812
|
-
|
|
797
|
+
const arr = value.split(/[ ,]+/);
|
|
813
798
|
if (arr.length === 1) {
|
|
814
|
-
|
|
799
|
+
const arr0 = new Color(arr[0]);
|
|
815
800
|
result.top = arr0;
|
|
816
801
|
result.right = arr0;
|
|
817
802
|
result.bottom = arr0;
|
|
818
803
|
result.left = arr0;
|
|
819
804
|
}
|
|
820
805
|
else if (arr.length === 2) {
|
|
821
|
-
|
|
822
|
-
|
|
806
|
+
const arr0 = new Color(arr[0]);
|
|
807
|
+
const arr1 = new Color(arr[1]);
|
|
823
808
|
result.top = arr0;
|
|
824
809
|
result.right = arr1;
|
|
825
810
|
result.bottom = arr0;
|
|
826
811
|
result.left = arr1;
|
|
827
812
|
}
|
|
828
813
|
else if (arr.length === 3) {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
814
|
+
const arr0 = new Color(arr[0]);
|
|
815
|
+
const arr1 = new Color(arr[1]);
|
|
816
|
+
const arr2 = new Color(arr[2]);
|
|
832
817
|
result.top = arr0;
|
|
833
818
|
result.right = arr1;
|
|
834
819
|
result.bottom = arr2;
|
|
835
820
|
result.left = arr1;
|
|
836
821
|
}
|
|
837
822
|
else if (arr.length === 4) {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
823
|
+
const arr0 = new Color(arr[0]);
|
|
824
|
+
const arr1 = new Color(arr[1]);
|
|
825
|
+
const arr2 = new Color(arr[2]);
|
|
826
|
+
const arr3 = new Color(arr[3]);
|
|
842
827
|
result.top = arr0;
|
|
843
828
|
result.right = arr1;
|
|
844
829
|
result.bottom = arr2;
|
|
845
830
|
result.left = arr3;
|
|
846
831
|
}
|
|
847
832
|
else {
|
|
848
|
-
throw new Error(
|
|
833
|
+
throw new Error(`Expected 1, 2, 3 or 4 parameters. Actual: ${value}`);
|
|
849
834
|
}
|
|
850
835
|
return result;
|
|
851
836
|
}
|
|
852
837
|
// Border Color properties.
|
|
853
|
-
|
|
838
|
+
const borderColorProperty = new ShorthandProperty({
|
|
854
839
|
name: 'borderColor',
|
|
855
840
|
cssName: 'border-color',
|
|
856
841
|
getter: function () {
|
|
@@ -858,12 +843,12 @@ var borderColorProperty = new ShorthandProperty({
|
|
|
858
843
|
return this.borderTopColor;
|
|
859
844
|
}
|
|
860
845
|
else {
|
|
861
|
-
return
|
|
846
|
+
return `${this.borderTopColor} ${this.borderRightColor} ${this.borderBottomColor} ${this.borderLeftColor}`;
|
|
862
847
|
}
|
|
863
848
|
},
|
|
864
849
|
converter: function (value) {
|
|
865
850
|
if (typeof value === 'string') {
|
|
866
|
-
|
|
851
|
+
const fourColors = parseBorderColor(value);
|
|
867
852
|
return [
|
|
868
853
|
[borderTopColorProperty, fourColors.top],
|
|
869
854
|
[borderRightColorProperty, fourColors.right],
|
|
@@ -882,48 +867,48 @@ var borderColorProperty = new ShorthandProperty({
|
|
|
882
867
|
},
|
|
883
868
|
});
|
|
884
869
|
borderColorProperty.register(Style);
|
|
885
|
-
export
|
|
870
|
+
export const borderTopColorProperty = new CssProperty({
|
|
886
871
|
name: 'borderTopColor',
|
|
887
872
|
cssName: 'border-top-color',
|
|
888
|
-
valueChanged:
|
|
873
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
889
874
|
target.backgroundInternal = target.backgroundInternal.withBorderTopColor(newValue);
|
|
890
875
|
},
|
|
891
876
|
equalityComparer: Color.equals,
|
|
892
|
-
valueConverter:
|
|
877
|
+
valueConverter: (value) => new Color(value),
|
|
893
878
|
});
|
|
894
879
|
borderTopColorProperty.register(Style);
|
|
895
|
-
export
|
|
880
|
+
export const borderRightColorProperty = new CssProperty({
|
|
896
881
|
name: 'borderRightColor',
|
|
897
882
|
cssName: 'border-right-color',
|
|
898
|
-
valueChanged:
|
|
883
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
899
884
|
target.backgroundInternal = target.backgroundInternal.withBorderRightColor(newValue);
|
|
900
885
|
},
|
|
901
886
|
equalityComparer: Color.equals,
|
|
902
|
-
valueConverter:
|
|
887
|
+
valueConverter: (value) => new Color(value),
|
|
903
888
|
});
|
|
904
889
|
borderRightColorProperty.register(Style);
|
|
905
|
-
export
|
|
890
|
+
export const borderBottomColorProperty = new CssProperty({
|
|
906
891
|
name: 'borderBottomColor',
|
|
907
892
|
cssName: 'border-bottom-color',
|
|
908
|
-
valueChanged:
|
|
893
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
909
894
|
target.backgroundInternal = target.backgroundInternal.withBorderBottomColor(newValue);
|
|
910
895
|
},
|
|
911
896
|
equalityComparer: Color.equals,
|
|
912
|
-
valueConverter:
|
|
897
|
+
valueConverter: (value) => new Color(value),
|
|
913
898
|
});
|
|
914
899
|
borderBottomColorProperty.register(Style);
|
|
915
|
-
export
|
|
900
|
+
export const borderLeftColorProperty = new CssProperty({
|
|
916
901
|
name: 'borderLeftColor',
|
|
917
902
|
cssName: 'border-left-color',
|
|
918
|
-
valueChanged:
|
|
903
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
919
904
|
target.backgroundInternal = target.backgroundInternal.withBorderLeftColor(newValue);
|
|
920
905
|
},
|
|
921
906
|
equalityComparer: Color.equals,
|
|
922
|
-
valueConverter:
|
|
907
|
+
valueConverter: (value) => new Color(value),
|
|
923
908
|
});
|
|
924
909
|
borderLeftColorProperty.register(Style);
|
|
925
910
|
// Border Width properties.
|
|
926
|
-
|
|
911
|
+
const borderWidthProperty = new ShorthandProperty({
|
|
927
912
|
name: 'borderWidth',
|
|
928
913
|
cssName: 'border-width',
|
|
929
914
|
getter: function () {
|
|
@@ -931,12 +916,12 @@ var borderWidthProperty = new ShorthandProperty({
|
|
|
931
916
|
return this.borderTopWidth;
|
|
932
917
|
}
|
|
933
918
|
else {
|
|
934
|
-
return
|
|
919
|
+
return `${Length.convertToString(this.borderTopWidth)} ${Length.convertToString(this.borderRightWidth)} ${Length.convertToString(this.borderBottomWidth)} ${Length.convertToString(this.borderLeftWidth)}`;
|
|
935
920
|
}
|
|
936
921
|
},
|
|
937
922
|
converter: function (value) {
|
|
938
923
|
if (typeof value === 'string' && value !== 'auto') {
|
|
939
|
-
|
|
924
|
+
const borderWidths = parseThickness(value);
|
|
940
925
|
return [
|
|
941
926
|
[borderTopWidthProperty, borderWidths.top],
|
|
942
927
|
[borderRightWidthProperty, borderWidths.right],
|
|
@@ -955,92 +940,92 @@ var borderWidthProperty = new ShorthandProperty({
|
|
|
955
940
|
},
|
|
956
941
|
});
|
|
957
942
|
borderWidthProperty.register(Style);
|
|
958
|
-
export
|
|
943
|
+
export const borderTopWidthProperty = new CssProperty({
|
|
959
944
|
name: 'borderTopWidth',
|
|
960
945
|
cssName: 'border-top-width',
|
|
961
946
|
defaultValue: CoreTypes.zeroLength,
|
|
962
947
|
affectsLayout: global.isIOS,
|
|
963
948
|
equalityComparer: Length.equals,
|
|
964
|
-
valueChanged:
|
|
965
|
-
|
|
949
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
950
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
966
951
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
967
|
-
throw new Error(
|
|
952
|
+
throw new Error(`border-top-width should be Non-Negative Finite number. Value: ${value}`);
|
|
968
953
|
}
|
|
969
|
-
|
|
954
|
+
const view = target.viewRef.get();
|
|
970
955
|
if (view) {
|
|
971
956
|
view.effectiveBorderTopWidth = value;
|
|
972
957
|
}
|
|
973
958
|
else {
|
|
974
|
-
Trace.write(
|
|
959
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
975
960
|
}
|
|
976
961
|
target.backgroundInternal = target.backgroundInternal.withBorderTopWidth(value);
|
|
977
962
|
},
|
|
978
963
|
valueConverter: Length.parse,
|
|
979
964
|
});
|
|
980
965
|
borderTopWidthProperty.register(Style);
|
|
981
|
-
export
|
|
966
|
+
export const borderRightWidthProperty = new CssProperty({
|
|
982
967
|
name: 'borderRightWidth',
|
|
983
968
|
cssName: 'border-right-width',
|
|
984
969
|
defaultValue: CoreTypes.zeroLength,
|
|
985
970
|
affectsLayout: global.isIOS,
|
|
986
971
|
equalityComparer: Length.equals,
|
|
987
|
-
valueChanged:
|
|
988
|
-
|
|
972
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
973
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
989
974
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
990
|
-
throw new Error(
|
|
975
|
+
throw new Error(`border-right-width should be Non-Negative Finite number. Value: ${value}`);
|
|
991
976
|
}
|
|
992
|
-
|
|
977
|
+
const view = target.viewRef.get();
|
|
993
978
|
if (view) {
|
|
994
979
|
view.effectiveBorderRightWidth = value;
|
|
995
980
|
}
|
|
996
981
|
else {
|
|
997
|
-
Trace.write(
|
|
982
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
998
983
|
}
|
|
999
984
|
target.backgroundInternal = target.backgroundInternal.withBorderRightWidth(value);
|
|
1000
985
|
},
|
|
1001
986
|
valueConverter: Length.parse,
|
|
1002
987
|
});
|
|
1003
988
|
borderRightWidthProperty.register(Style);
|
|
1004
|
-
export
|
|
989
|
+
export const borderBottomWidthProperty = new CssProperty({
|
|
1005
990
|
name: 'borderBottomWidth',
|
|
1006
991
|
cssName: 'border-bottom-width',
|
|
1007
992
|
defaultValue: CoreTypes.zeroLength,
|
|
1008
993
|
affectsLayout: global.isIOS,
|
|
1009
994
|
equalityComparer: Length.equals,
|
|
1010
|
-
valueChanged:
|
|
1011
|
-
|
|
995
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
996
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
1012
997
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1013
|
-
throw new Error(
|
|
998
|
+
throw new Error(`border-bottom-width should be Non-Negative Finite number. Value: ${value}`);
|
|
1014
999
|
}
|
|
1015
|
-
|
|
1000
|
+
const view = target.viewRef.get();
|
|
1016
1001
|
if (view) {
|
|
1017
1002
|
view.effectiveBorderBottomWidth = value;
|
|
1018
1003
|
}
|
|
1019
1004
|
else {
|
|
1020
|
-
Trace.write(
|
|
1005
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
1021
1006
|
}
|
|
1022
1007
|
target.backgroundInternal = target.backgroundInternal.withBorderBottomWidth(value);
|
|
1023
1008
|
},
|
|
1024
1009
|
valueConverter: Length.parse,
|
|
1025
1010
|
});
|
|
1026
1011
|
borderBottomWidthProperty.register(Style);
|
|
1027
|
-
export
|
|
1012
|
+
export const borderLeftWidthProperty = new CssProperty({
|
|
1028
1013
|
name: 'borderLeftWidth',
|
|
1029
1014
|
cssName: 'border-left-width',
|
|
1030
1015
|
defaultValue: CoreTypes.zeroLength,
|
|
1031
1016
|
affectsLayout: global.isIOS,
|
|
1032
1017
|
equalityComparer: Length.equals,
|
|
1033
|
-
valueChanged:
|
|
1034
|
-
|
|
1018
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1019
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
1035
1020
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1036
|
-
throw new Error(
|
|
1021
|
+
throw new Error(`border-left-width should be Non-Negative Finite number. Value: ${value}`);
|
|
1037
1022
|
}
|
|
1038
|
-
|
|
1023
|
+
const view = target.viewRef.get();
|
|
1039
1024
|
if (view) {
|
|
1040
1025
|
view.effectiveBorderLeftWidth = value;
|
|
1041
1026
|
}
|
|
1042
1027
|
else {
|
|
1043
|
-
Trace.write(
|
|
1028
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
1044
1029
|
}
|
|
1045
1030
|
target.backgroundInternal = target.backgroundInternal.withBorderLeftWidth(value);
|
|
1046
1031
|
},
|
|
@@ -1048,18 +1033,18 @@ export var borderLeftWidthProperty = new CssProperty({
|
|
|
1048
1033
|
});
|
|
1049
1034
|
borderLeftWidthProperty.register(Style);
|
|
1050
1035
|
// Border Radius properties.
|
|
1051
|
-
|
|
1036
|
+
const borderRadiusProperty = new ShorthandProperty({
|
|
1052
1037
|
name: 'borderRadius',
|
|
1053
1038
|
cssName: 'border-radius',
|
|
1054
1039
|
getter: function () {
|
|
1055
1040
|
if (Length.equals(this.borderTopLeftRadius, this.borderTopRightRadius) && Length.equals(this.borderTopLeftRadius, this.borderBottomRightRadius) && Length.equals(this.borderTopLeftRadius, this.borderBottomLeftRadius)) {
|
|
1056
1041
|
return this.borderTopLeftRadius;
|
|
1057
1042
|
}
|
|
1058
|
-
return
|
|
1043
|
+
return `${Length.convertToString(this.borderTopLeftRadius)} ${Length.convertToString(this.borderTopRightRadius)} ${Length.convertToString(this.borderBottomRightRadius)} ${Length.convertToString(this.borderBottomLeftRadius)}`;
|
|
1059
1044
|
},
|
|
1060
1045
|
converter: function (value) {
|
|
1061
1046
|
if (typeof value === 'string') {
|
|
1062
|
-
|
|
1047
|
+
const borderRadius = parseThickness(value);
|
|
1063
1048
|
return [
|
|
1064
1049
|
[borderTopLeftRadiusProperty, borderRadius.top],
|
|
1065
1050
|
[borderTopRightRadiusProperty, borderRadius.right],
|
|
@@ -1078,15 +1063,15 @@ var borderRadiusProperty = new ShorthandProperty({
|
|
|
1078
1063
|
},
|
|
1079
1064
|
});
|
|
1080
1065
|
borderRadiusProperty.register(Style);
|
|
1081
|
-
export
|
|
1066
|
+
export const borderTopLeftRadiusProperty = new CssProperty({
|
|
1082
1067
|
name: 'borderTopLeftRadius',
|
|
1083
1068
|
cssName: 'border-top-left-radius',
|
|
1084
1069
|
defaultValue: 0,
|
|
1085
1070
|
affectsLayout: global.isIOS,
|
|
1086
|
-
valueChanged:
|
|
1087
|
-
|
|
1071
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1072
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
1088
1073
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1089
|
-
throw new Error(
|
|
1074
|
+
throw new Error(`border-top-left-radius should be Non-Negative Finite number. Value: ${value}`);
|
|
1090
1075
|
}
|
|
1091
1076
|
target.backgroundInternal = target.backgroundInternal.withBorderTopLeftRadius(value);
|
|
1092
1077
|
},
|
|
@@ -1094,15 +1079,15 @@ export var borderTopLeftRadiusProperty = new CssProperty({
|
|
|
1094
1079
|
equalityComparer: Length.equals,
|
|
1095
1080
|
});
|
|
1096
1081
|
borderTopLeftRadiusProperty.register(Style);
|
|
1097
|
-
export
|
|
1082
|
+
export const borderTopRightRadiusProperty = new CssProperty({
|
|
1098
1083
|
name: 'borderTopRightRadius',
|
|
1099
1084
|
cssName: 'border-top-right-radius',
|
|
1100
1085
|
defaultValue: 0,
|
|
1101
1086
|
affectsLayout: global.isIOS,
|
|
1102
|
-
valueChanged:
|
|
1103
|
-
|
|
1087
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1088
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
1104
1089
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1105
|
-
throw new Error(
|
|
1090
|
+
throw new Error(`border-top-right-radius should be Non-Negative Finite number. Value: ${value}`);
|
|
1106
1091
|
}
|
|
1107
1092
|
target.backgroundInternal = target.backgroundInternal.withBorderTopRightRadius(value);
|
|
1108
1093
|
},
|
|
@@ -1110,15 +1095,15 @@ export var borderTopRightRadiusProperty = new CssProperty({
|
|
|
1110
1095
|
equalityComparer: Length.equals,
|
|
1111
1096
|
});
|
|
1112
1097
|
borderTopRightRadiusProperty.register(Style);
|
|
1113
|
-
export
|
|
1098
|
+
export const borderBottomRightRadiusProperty = new CssProperty({
|
|
1114
1099
|
name: 'borderBottomRightRadius',
|
|
1115
1100
|
cssName: 'border-bottom-right-radius',
|
|
1116
1101
|
defaultValue: 0,
|
|
1117
1102
|
affectsLayout: global.isIOS,
|
|
1118
|
-
valueChanged:
|
|
1119
|
-
|
|
1103
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1104
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
1120
1105
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1121
|
-
throw new Error(
|
|
1106
|
+
throw new Error(`border-bottom-right-radius should be Non-Negative Finite number. Value: ${value}`);
|
|
1122
1107
|
}
|
|
1123
1108
|
target.backgroundInternal = target.backgroundInternal.withBorderBottomRightRadius(value);
|
|
1124
1109
|
},
|
|
@@ -1126,15 +1111,15 @@ export var borderBottomRightRadiusProperty = new CssProperty({
|
|
|
1126
1111
|
equalityComparer: Length.equals,
|
|
1127
1112
|
});
|
|
1128
1113
|
borderBottomRightRadiusProperty.register(Style);
|
|
1129
|
-
export
|
|
1114
|
+
export const borderBottomLeftRadiusProperty = new CssProperty({
|
|
1130
1115
|
name: 'borderBottomLeftRadius',
|
|
1131
1116
|
cssName: 'border-bottom-left-radius',
|
|
1132
1117
|
defaultValue: 0,
|
|
1133
1118
|
affectsLayout: global.isIOS,
|
|
1134
|
-
valueChanged:
|
|
1135
|
-
|
|
1119
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1120
|
+
const value = Length.toDevicePixels(newValue, 0);
|
|
1136
1121
|
if (!isNonNegativeFiniteNumber(value)) {
|
|
1137
|
-
throw new Error(
|
|
1122
|
+
throw new Error(`border-bottom-left-radius should be Non-Negative Finite number. Value: ${value}`);
|
|
1138
1123
|
}
|
|
1139
1124
|
target.backgroundInternal = target.backgroundInternal.withBorderBottomLeftRadius(value);
|
|
1140
1125
|
},
|
|
@@ -1142,10 +1127,10 @@ export var borderBottomLeftRadiusProperty = new CssProperty({
|
|
|
1142
1127
|
equalityComparer: Length.equals,
|
|
1143
1128
|
});
|
|
1144
1129
|
borderBottomLeftRadiusProperty.register(Style);
|
|
1145
|
-
|
|
1130
|
+
const boxShadowProperty = new CssProperty({
|
|
1146
1131
|
name: 'boxShadow',
|
|
1147
1132
|
cssName: 'box-shadow',
|
|
1148
|
-
valueChanged:
|
|
1133
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1149
1134
|
target.backgroundInternal = target.backgroundInternal.withBoxShadow(newValue
|
|
1150
1135
|
? {
|
|
1151
1136
|
inset: newValue.inset,
|
|
@@ -1157,7 +1142,7 @@ var boxShadowProperty = new CssProperty({
|
|
|
1157
1142
|
}
|
|
1158
1143
|
: null);
|
|
1159
1144
|
},
|
|
1160
|
-
valueConverter:
|
|
1145
|
+
valueConverter: (value) => {
|
|
1161
1146
|
return parseCSSShadow(value);
|
|
1162
1147
|
},
|
|
1163
1148
|
});
|
|
@@ -1165,18 +1150,18 @@ boxShadowProperty.register(Style);
|
|
|
1165
1150
|
function isNonNegativeFiniteNumber(value) {
|
|
1166
1151
|
return isFinite(value) && !isNaN(value) && value >= 0;
|
|
1167
1152
|
}
|
|
1168
|
-
|
|
1153
|
+
const supportedPaths = ['rect', 'circle', 'ellipse', 'polygon', 'inset'];
|
|
1169
1154
|
function isClipPathValid(value) {
|
|
1170
1155
|
if (!value) {
|
|
1171
1156
|
return true;
|
|
1172
1157
|
}
|
|
1173
|
-
|
|
1158
|
+
const functionName = value.substring(0, value.indexOf('(')).trim();
|
|
1174
1159
|
return supportedPaths.indexOf(functionName) !== -1;
|
|
1175
1160
|
}
|
|
1176
|
-
export
|
|
1161
|
+
export const clipPathProperty = new CssProperty({
|
|
1177
1162
|
name: 'clipPath',
|
|
1178
1163
|
cssName: 'clip-path',
|
|
1179
|
-
valueChanged:
|
|
1164
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1180
1165
|
if (!isClipPathValid(newValue)) {
|
|
1181
1166
|
throw new Error('clip-path is not valid.');
|
|
1182
1167
|
}
|
|
@@ -1185,116 +1170,116 @@ export var clipPathProperty = new CssProperty({
|
|
|
1185
1170
|
});
|
|
1186
1171
|
clipPathProperty.register(Style);
|
|
1187
1172
|
function isFloatValueConverter(value) {
|
|
1188
|
-
|
|
1173
|
+
const newValue = parseFloat(value);
|
|
1189
1174
|
if (isNaN(newValue)) {
|
|
1190
|
-
throw new Error(
|
|
1175
|
+
throw new Error(`Invalid value: ${newValue}`);
|
|
1191
1176
|
}
|
|
1192
1177
|
return newValue;
|
|
1193
1178
|
}
|
|
1194
|
-
export
|
|
1179
|
+
export const zIndexProperty = new CssProperty({
|
|
1195
1180
|
name: 'zIndex',
|
|
1196
1181
|
cssName: 'z-index',
|
|
1197
1182
|
valueConverter: isFloatValueConverter,
|
|
1198
1183
|
});
|
|
1199
1184
|
zIndexProperty.register(Style);
|
|
1200
1185
|
function opacityConverter(value) {
|
|
1201
|
-
|
|
1186
|
+
const newValue = parseFloat(value);
|
|
1202
1187
|
if (!isNaN(newValue) && 0 <= newValue && newValue <= 1) {
|
|
1203
1188
|
return newValue;
|
|
1204
1189
|
}
|
|
1205
|
-
throw new Error(
|
|
1190
|
+
throw new Error(`Opacity should be between [0, 1]. Value: ${newValue}`);
|
|
1206
1191
|
}
|
|
1207
|
-
export
|
|
1192
|
+
export const opacityProperty = new CssAnimationProperty({
|
|
1208
1193
|
name: 'opacity',
|
|
1209
1194
|
cssName: 'opacity',
|
|
1210
1195
|
defaultValue: 1,
|
|
1211
1196
|
valueConverter: opacityConverter,
|
|
1212
1197
|
});
|
|
1213
1198
|
opacityProperty.register(Style);
|
|
1214
|
-
export
|
|
1199
|
+
export const colorProperty = new InheritedCssProperty({
|
|
1215
1200
|
name: 'color',
|
|
1216
1201
|
cssName: 'color',
|
|
1217
1202
|
equalityComparer: Color.equals,
|
|
1218
|
-
valueConverter:
|
|
1203
|
+
valueConverter: (v) => new Color(v),
|
|
1219
1204
|
});
|
|
1220
1205
|
colorProperty.register(Style);
|
|
1221
|
-
export
|
|
1206
|
+
export const fontInternalProperty = new CssProperty({
|
|
1222
1207
|
name: 'fontInternal',
|
|
1223
1208
|
cssName: '_fontInternal',
|
|
1224
1209
|
});
|
|
1225
1210
|
fontInternalProperty.register(Style);
|
|
1226
|
-
export
|
|
1211
|
+
export const fontFamilyProperty = new InheritedCssProperty({
|
|
1227
1212
|
name: 'fontFamily',
|
|
1228
1213
|
cssName: 'font-family',
|
|
1229
1214
|
affectsLayout: global.isIOS,
|
|
1230
|
-
valueChanged:
|
|
1231
|
-
|
|
1215
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1216
|
+
const currentFont = target.fontInternal || Font.default;
|
|
1232
1217
|
if (currentFont.fontFamily !== newValue) {
|
|
1233
|
-
|
|
1218
|
+
const newFont = currentFont.withFontFamily(newValue);
|
|
1234
1219
|
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1235
1220
|
}
|
|
1236
1221
|
},
|
|
1237
1222
|
});
|
|
1238
1223
|
fontFamilyProperty.register(Style);
|
|
1239
|
-
export
|
|
1224
|
+
export const fontScaleInternalProperty = new InheritedCssProperty({
|
|
1240
1225
|
name: 'fontScaleInternal',
|
|
1241
1226
|
cssName: '_fontScaleInternal',
|
|
1242
1227
|
defaultValue: 1.0,
|
|
1243
|
-
valueConverter:
|
|
1228
|
+
valueConverter: (v) => parseFloat(v),
|
|
1244
1229
|
});
|
|
1245
1230
|
fontScaleInternalProperty.register(Style);
|
|
1246
|
-
export
|
|
1231
|
+
export const fontSizeProperty = new InheritedCssProperty({
|
|
1247
1232
|
name: 'fontSize',
|
|
1248
1233
|
cssName: 'font-size',
|
|
1249
1234
|
affectsLayout: global.isIOS,
|
|
1250
|
-
valueChanged:
|
|
1235
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1251
1236
|
if (target.viewRef['handleFontSize'] === true) {
|
|
1252
1237
|
return;
|
|
1253
1238
|
}
|
|
1254
|
-
|
|
1239
|
+
const currentFont = target.fontInternal || Font.default;
|
|
1255
1240
|
if (currentFont.fontSize !== newValue) {
|
|
1256
|
-
|
|
1241
|
+
const newFont = currentFont.withFontSize(newValue);
|
|
1257
1242
|
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1258
1243
|
}
|
|
1259
1244
|
},
|
|
1260
|
-
valueConverter:
|
|
1245
|
+
valueConverter: (v) => parseFloat(v),
|
|
1261
1246
|
});
|
|
1262
1247
|
fontSizeProperty.register(Style);
|
|
1263
|
-
export
|
|
1248
|
+
export const fontStyleProperty = new InheritedCssProperty({
|
|
1264
1249
|
name: 'fontStyle',
|
|
1265
1250
|
cssName: 'font-style',
|
|
1266
1251
|
affectsLayout: global.isIOS,
|
|
1267
1252
|
defaultValue: FontStyle.NORMAL,
|
|
1268
1253
|
valueConverter: FontStyle.parse,
|
|
1269
|
-
valueChanged:
|
|
1270
|
-
|
|
1254
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1255
|
+
const currentFont = target.fontInternal || Font.default;
|
|
1271
1256
|
if (currentFont.fontStyle !== newValue) {
|
|
1272
|
-
|
|
1257
|
+
const newFont = currentFont.withFontStyle(newValue);
|
|
1273
1258
|
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1274
1259
|
}
|
|
1275
1260
|
},
|
|
1276
1261
|
});
|
|
1277
1262
|
fontStyleProperty.register(Style);
|
|
1278
|
-
export
|
|
1263
|
+
export const fontWeightProperty = new InheritedCssProperty({
|
|
1279
1264
|
name: 'fontWeight',
|
|
1280
1265
|
cssName: 'font-weight',
|
|
1281
1266
|
affectsLayout: global.isIOS,
|
|
1282
1267
|
defaultValue: FontWeight.NORMAL,
|
|
1283
1268
|
valueConverter: FontWeight.parse,
|
|
1284
|
-
valueChanged:
|
|
1285
|
-
|
|
1269
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1270
|
+
const currentFont = target.fontInternal || Font.default;
|
|
1286
1271
|
if (currentFont.fontWeight !== newValue) {
|
|
1287
|
-
|
|
1272
|
+
const newFont = currentFont.withFontWeight(newValue);
|
|
1288
1273
|
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1289
1274
|
}
|
|
1290
1275
|
},
|
|
1291
1276
|
});
|
|
1292
1277
|
fontWeightProperty.register(Style);
|
|
1293
|
-
|
|
1278
|
+
const fontProperty = new ShorthandProperty({
|
|
1294
1279
|
name: 'font',
|
|
1295
1280
|
cssName: 'font',
|
|
1296
1281
|
getter: function () {
|
|
1297
|
-
return
|
|
1282
|
+
return `${this.fontStyle} ${this.fontWeight} ${this.fontSize} ${this.fontFamily}`;
|
|
1298
1283
|
},
|
|
1299
1284
|
converter: function (value) {
|
|
1300
1285
|
if (value === unsetValue) {
|
|
@@ -1306,8 +1291,8 @@ var fontProperty = new ShorthandProperty({
|
|
|
1306
1291
|
];
|
|
1307
1292
|
}
|
|
1308
1293
|
else {
|
|
1309
|
-
|
|
1310
|
-
|
|
1294
|
+
const font = parseFont(value);
|
|
1295
|
+
const fontSize = parseFloat(font.fontSize);
|
|
1311
1296
|
return [
|
|
1312
1297
|
[fontStyleProperty, font.fontStyle],
|
|
1313
1298
|
[fontWeightProperty, font.fontWeight],
|
|
@@ -1318,46 +1303,46 @@ var fontProperty = new ShorthandProperty({
|
|
|
1318
1303
|
},
|
|
1319
1304
|
});
|
|
1320
1305
|
fontProperty.register(Style);
|
|
1321
|
-
export
|
|
1306
|
+
export const fontVariationSettingsProperty = new InheritedCssProperty({
|
|
1322
1307
|
name: 'fontVariationSettings',
|
|
1323
1308
|
cssName: 'font-variation-settings',
|
|
1324
1309
|
affectsLayout: global.isIOS,
|
|
1325
|
-
valueChanged:
|
|
1326
|
-
|
|
1310
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1311
|
+
const currentFont = target.fontInternal || Font.default;
|
|
1327
1312
|
if (currentFont.fontVariationSettings !== newValue) {
|
|
1328
|
-
|
|
1313
|
+
const newFont = currentFont.withFontVariationSettings(newValue);
|
|
1329
1314
|
target.fontInternal = Font.equals(Font.default, newFont) ? unsetValue : newFont;
|
|
1330
1315
|
}
|
|
1331
1316
|
},
|
|
1332
|
-
valueConverter:
|
|
1317
|
+
valueConverter: (value) => {
|
|
1333
1318
|
return FontVariationSettings.parse(value);
|
|
1334
1319
|
},
|
|
1335
1320
|
});
|
|
1336
1321
|
fontVariationSettingsProperty.register(Style);
|
|
1337
|
-
export
|
|
1322
|
+
export const visibilityProperty = new CssProperty({
|
|
1338
1323
|
name: 'visibility',
|
|
1339
1324
|
cssName: 'visibility',
|
|
1340
1325
|
defaultValue: CoreTypes.Visibility.visible,
|
|
1341
1326
|
affectsLayout: global.isIOS,
|
|
1342
1327
|
valueConverter: CoreTypes.Visibility.parse,
|
|
1343
|
-
valueChanged:
|
|
1344
|
-
|
|
1328
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1329
|
+
const view = target.viewRef.get();
|
|
1345
1330
|
if (view) {
|
|
1346
1331
|
view.isCollapsed = newValue === CoreTypes.Visibility.collapse;
|
|
1347
1332
|
}
|
|
1348
1333
|
else {
|
|
1349
|
-
Trace.write(
|
|
1334
|
+
Trace.write(`${newValue} not set to view's property because ".viewRef" is cleared`, Trace.categories.Style, Trace.messageType.warn);
|
|
1350
1335
|
}
|
|
1351
1336
|
},
|
|
1352
1337
|
});
|
|
1353
1338
|
visibilityProperty.register(Style);
|
|
1354
|
-
export
|
|
1339
|
+
export const androidElevationProperty = new CssProperty({
|
|
1355
1340
|
name: 'androidElevation',
|
|
1356
1341
|
cssName: 'android-elevation',
|
|
1357
1342
|
valueConverter: parseFloat,
|
|
1358
1343
|
});
|
|
1359
1344
|
androidElevationProperty.register(Style);
|
|
1360
|
-
export
|
|
1345
|
+
export const androidDynamicElevationOffsetProperty = new CssProperty({
|
|
1361
1346
|
name: 'androidDynamicElevationOffset',
|
|
1362
1347
|
cssName: 'android-dynamic-elevation-offset',
|
|
1363
1348
|
valueConverter: parseFloat,
|