@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
|
@@ -8,7 +8,7 @@ var UNSPECIFIED = layout.UNSPECIFIED;
|
|
|
8
8
|
var MEASURED_SIZE_MASK = layout.MEASURED_SIZE_MASK;
|
|
9
9
|
var MEASURED_STATE_TOO_SMALL = layout.MEASURED_STATE_TOO_SMALL;
|
|
10
10
|
function requestFlexboxLayout(value) {
|
|
11
|
-
|
|
11
|
+
const flexbox = this.parent;
|
|
12
12
|
if (flexbox instanceof FlexboxLayoutBase) {
|
|
13
13
|
flexbox.requestLayout();
|
|
14
14
|
}
|
|
@@ -18,40 +18,34 @@ View.prototype[flexGrowProperty.setNative] = requestFlexboxLayout;
|
|
|
18
18
|
View.prototype[flexShrinkProperty.setNative] = requestFlexboxLayout;
|
|
19
19
|
View.prototype[flexWrapBeforeProperty.setNative] = requestFlexboxLayout;
|
|
20
20
|
View.prototype[alignSelfProperty.setNative] = requestFlexboxLayout;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const MATCH_PARENT = -1;
|
|
22
|
+
const WRAP_CONTENT = -2;
|
|
23
|
+
const View_sUseZeroUnspecifiedMeasureSpec = true; // NOTE: android version < M
|
|
24
24
|
// Long ints may not be safe in JavaScript
|
|
25
|
-
|
|
25
|
+
const MAX_SIZE = 0x00ffffff & MEASURED_SIZE_MASK;
|
|
26
26
|
var makeMeasureSpec = layout.makeMeasureSpec;
|
|
27
27
|
var getMeasureSpecMode = layout.getMeasureSpecMode;
|
|
28
28
|
var getMeasureSpecSize = layout.getMeasureSpecSize;
|
|
29
29
|
// `eachLayoutChild` iterates over children, and we need more - indexed access.
|
|
30
30
|
// This class tries to accomodate that by collecting all children in an
|
|
31
31
|
// array no more than once per measure.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _this = this;
|
|
32
|
+
class MeasureContext {
|
|
33
|
+
constructor(owner) {
|
|
35
34
|
this.owner = owner;
|
|
36
35
|
this.children = [];
|
|
37
|
-
this.owner.eachLayoutChild(
|
|
38
|
-
|
|
36
|
+
this.owner.eachLayoutChild((child) => {
|
|
37
|
+
this.children.push(child);
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
enumerable: false,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
MeasureContext.prototype.childAt = function (index) {
|
|
40
|
+
get childrenCount() {
|
|
41
|
+
return this.children.length;
|
|
42
|
+
}
|
|
43
|
+
childAt(index) {
|
|
49
44
|
return this.children[index];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function FlexLine() {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
class FlexLine {
|
|
48
|
+
constructor() {
|
|
55
49
|
this._left = Number.MAX_VALUE;
|
|
56
50
|
this._top = Number.MAX_VALUE;
|
|
57
51
|
this._right = Number.MAX_VALUE;
|
|
@@ -65,91 +59,49 @@ var FlexLine = /** @class */ (function () {
|
|
|
65
59
|
this._maxBaseline = 0;
|
|
66
60
|
this._indicesAlignSelfStretch = [];
|
|
67
61
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
enumerable: false,
|
|
87
|
-
configurable: true
|
|
88
|
-
});
|
|
89
|
-
Object.defineProperty(FlexLine.prototype, "bottom", {
|
|
90
|
-
get: function () {
|
|
91
|
-
return this._bottom;
|
|
92
|
-
},
|
|
93
|
-
enumerable: false,
|
|
94
|
-
configurable: true
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(FlexLine.prototype, "mainSize", {
|
|
97
|
-
get: function () {
|
|
98
|
-
return this._mainSize;
|
|
99
|
-
},
|
|
100
|
-
enumerable: false,
|
|
101
|
-
configurable: true
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(FlexLine.prototype, "crossSize", {
|
|
104
|
-
get: function () {
|
|
105
|
-
return this._crossSize;
|
|
106
|
-
},
|
|
107
|
-
enumerable: false,
|
|
108
|
-
configurable: true
|
|
109
|
-
});
|
|
110
|
-
Object.defineProperty(FlexLine.prototype, "itemCount", {
|
|
111
|
-
get: function () {
|
|
112
|
-
return this._itemCount;
|
|
113
|
-
},
|
|
114
|
-
enumerable: false,
|
|
115
|
-
configurable: true
|
|
116
|
-
});
|
|
117
|
-
Object.defineProperty(FlexLine.prototype, "totalFlexGrow", {
|
|
118
|
-
get: function () {
|
|
119
|
-
return this._totalFlexGrow;
|
|
120
|
-
},
|
|
121
|
-
enumerable: false,
|
|
122
|
-
configurable: true
|
|
123
|
-
});
|
|
124
|
-
Object.defineProperty(FlexLine.prototype, "totalFlexShrink", {
|
|
125
|
-
get: function () {
|
|
126
|
-
return this._totalFlexShrink;
|
|
127
|
-
},
|
|
128
|
-
enumerable: false,
|
|
129
|
-
configurable: true
|
|
130
|
-
});
|
|
131
|
-
return FlexLine;
|
|
132
|
-
}());
|
|
133
|
-
var Order = /** @class */ (function () {
|
|
134
|
-
function Order() {
|
|
62
|
+
get left() {
|
|
63
|
+
return this._left;
|
|
64
|
+
}
|
|
65
|
+
get top() {
|
|
66
|
+
return this._top;
|
|
67
|
+
}
|
|
68
|
+
get right() {
|
|
69
|
+
return this._right;
|
|
70
|
+
}
|
|
71
|
+
get bottom() {
|
|
72
|
+
return this._bottom;
|
|
73
|
+
}
|
|
74
|
+
get mainSize() {
|
|
75
|
+
return this._mainSize;
|
|
76
|
+
}
|
|
77
|
+
get crossSize() {
|
|
78
|
+
return this._crossSize;
|
|
135
79
|
}
|
|
136
|
-
|
|
80
|
+
get itemCount() {
|
|
81
|
+
return this._itemCount;
|
|
82
|
+
}
|
|
83
|
+
get totalFlexGrow() {
|
|
84
|
+
return this._totalFlexGrow;
|
|
85
|
+
}
|
|
86
|
+
get totalFlexShrink() {
|
|
87
|
+
return this._totalFlexShrink;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
class Order {
|
|
91
|
+
compareTo(another) {
|
|
137
92
|
if (this.order !== another.order) {
|
|
138
93
|
return this.order - another.order;
|
|
139
94
|
}
|
|
140
95
|
return this.index - another.index;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
__extends(FlexboxLayout, _super);
|
|
146
|
-
function FlexboxLayout() {
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export class FlexboxLayout extends FlexboxLayoutBase {
|
|
99
|
+
constructor() {
|
|
147
100
|
// Omit divider
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return _this;
|
|
101
|
+
super(...arguments);
|
|
102
|
+
this._flexLines = [];
|
|
151
103
|
}
|
|
152
|
-
|
|
104
|
+
onMeasure(widthMeasureSpec, heightMeasureSpec) {
|
|
153
105
|
this.measureContext = new MeasureContext(this);
|
|
154
106
|
// Omit: super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
|
155
107
|
if (this._isOrderChangedFromLastMeasurement) {
|
|
@@ -171,116 +123,110 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
171
123
|
throw new Error('Invalid value for the flex direction is set: ' + this.flexDirection);
|
|
172
124
|
}
|
|
173
125
|
this._childrenFrozen.length = 0;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
126
|
+
}
|
|
127
|
+
_getReorderedChildAt(index) {
|
|
128
|
+
let child;
|
|
177
129
|
if (index < 0 || index >= this._reorderedIndices.length) {
|
|
178
130
|
child = null;
|
|
179
131
|
}
|
|
180
132
|
else {
|
|
181
|
-
|
|
133
|
+
const reorderedIndex = this._reorderedIndices[index];
|
|
182
134
|
child = this.measureContext.childAt(reorderedIndex);
|
|
183
135
|
}
|
|
184
136
|
return child;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
137
|
+
}
|
|
138
|
+
_createReorderedIndices() {
|
|
139
|
+
const childCount = this.measureContext.childrenCount;
|
|
140
|
+
const orders = this._createOrders(childCount);
|
|
189
141
|
return this._sortOrdersIntoReorderedIndices(childCount, orders);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
orders.sort(function (a, b) { return a.compareTo(b); });
|
|
142
|
+
}
|
|
143
|
+
_sortOrdersIntoReorderedIndices(childCount, orders) {
|
|
144
|
+
orders.sort((a, b) => a.compareTo(b));
|
|
194
145
|
if (!this._orderCache) {
|
|
195
146
|
this._orderCache = [];
|
|
196
147
|
}
|
|
197
148
|
this._orderCache.length = 0;
|
|
198
|
-
|
|
199
|
-
orders.forEach(
|
|
149
|
+
const reorderedIndices = [];
|
|
150
|
+
orders.forEach((order, i) => {
|
|
200
151
|
reorderedIndices[i] = order.index;
|
|
201
|
-
|
|
152
|
+
this._orderCache[i] = order.order;
|
|
202
153
|
});
|
|
203
154
|
return reorderedIndices;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
for (
|
|
208
|
-
|
|
209
|
-
|
|
155
|
+
}
|
|
156
|
+
_createOrders(childCount) {
|
|
157
|
+
const orders = [];
|
|
158
|
+
for (let i = 0; i < childCount; i++) {
|
|
159
|
+
const child = this.measureContext.childAt(i);
|
|
160
|
+
const order = new Order();
|
|
210
161
|
order.order = FlexboxLayout.getOrder(child);
|
|
211
162
|
order.index = i;
|
|
212
163
|
orders.push(order);
|
|
213
164
|
}
|
|
214
165
|
return orders;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
166
|
+
}
|
|
167
|
+
get _isOrderChangedFromLastMeasurement() {
|
|
168
|
+
const childCount = this.measureContext.childrenCount;
|
|
169
|
+
if (!this._orderCache) {
|
|
170
|
+
this._orderCache = [];
|
|
171
|
+
}
|
|
172
|
+
if (this._orderCache.length !== childCount) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
for (let i = 0; i < childCount; i++) {
|
|
176
|
+
const view = this.measureContext.childAt(i);
|
|
177
|
+
if (view === null) {
|
|
178
|
+
continue;
|
|
221
179
|
}
|
|
222
|
-
if (
|
|
180
|
+
if (FlexboxLayout.getOrder(view) !== this._orderCache[i]) {
|
|
223
181
|
return true;
|
|
224
182
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return false;
|
|
235
|
-
},
|
|
236
|
-
enumerable: false,
|
|
237
|
-
configurable: true
|
|
238
|
-
});
|
|
239
|
-
FlexboxLayout.prototype._measureHorizontal = function (widthMeasureSpec, heightMeasureSpec) {
|
|
240
|
-
var _this = this;
|
|
241
|
-
var widthSize = getMeasureSpecSize(widthMeasureSpec);
|
|
242
|
-
var widthMode = getMeasureSpecMode(widthMeasureSpec);
|
|
243
|
-
var heightSize = getMeasureSpecSize(heightMeasureSpec);
|
|
244
|
-
var heightMode = getMeasureSpecMode(heightMeasureSpec);
|
|
245
|
-
var childState = 0;
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
_measureHorizontal(widthMeasureSpec, heightMeasureSpec) {
|
|
187
|
+
const widthSize = getMeasureSpecSize(widthMeasureSpec);
|
|
188
|
+
const widthMode = getMeasureSpecMode(widthMeasureSpec);
|
|
189
|
+
const heightSize = getMeasureSpecSize(heightMeasureSpec);
|
|
190
|
+
const heightMode = getMeasureSpecMode(heightMeasureSpec);
|
|
191
|
+
let childState = 0;
|
|
246
192
|
this._flexLines.length = 0;
|
|
247
|
-
(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
193
|
+
(() => {
|
|
194
|
+
const childCount = this.measureContext.childrenCount;
|
|
195
|
+
const paddingStart = FlexboxLayout.getPaddingStart(this);
|
|
196
|
+
const paddingEnd = FlexboxLayout.getPaddingEnd(this);
|
|
197
|
+
let largestHeightInRow = Number.MIN_VALUE;
|
|
198
|
+
let flexLine = new FlexLine();
|
|
199
|
+
let indexInFlexLine = 0;
|
|
254
200
|
flexLine._mainSize = paddingStart + paddingEnd;
|
|
255
|
-
for (
|
|
256
|
-
|
|
201
|
+
for (let i = 0; i < childCount; i++) {
|
|
202
|
+
const child = this._getReorderedChildAt(i);
|
|
257
203
|
if (child === null) {
|
|
258
|
-
|
|
204
|
+
this._addFlexLineIfLastFlexItem(i, childCount, flexLine);
|
|
259
205
|
continue;
|
|
260
206
|
}
|
|
261
207
|
else if (child.isCollapsed) {
|
|
262
208
|
flexLine._itemCount++;
|
|
263
|
-
|
|
209
|
+
this._addFlexLineIfLastFlexItem(i, childCount, flexLine);
|
|
264
210
|
continue;
|
|
265
211
|
}
|
|
266
212
|
child._updateEffectiveLayoutValues(widthSize, widthMode, heightSize, heightMode);
|
|
267
|
-
|
|
213
|
+
const lp = child; // child.style;
|
|
268
214
|
if (FlexboxLayout.getAlignSelf(child) === 'stretch') {
|
|
269
215
|
flexLine._indicesAlignSelfStretch.push(i);
|
|
270
216
|
}
|
|
271
|
-
|
|
217
|
+
let childWidth = lp.effectiveWidth;
|
|
272
218
|
if (FlexBasisPercent.DEFAULT /*lp.flexBasisPercent*/ !== FlexBasisPercent.DEFAULT && widthMode === EXACTLY) {
|
|
273
219
|
childWidth = Math.round(widthSize * FlexBasisPercent.DEFAULT /*lp.flexBasisPercent*/);
|
|
274
220
|
}
|
|
275
|
-
|
|
276
|
-
|
|
221
|
+
const childWidthMeasureSpec = FlexboxLayout.getChildMeasureSpec(widthMeasureSpec, lp.effectivePaddingLeft + lp.effectivePaddingRight + lp.effectiveMarginLeft + lp.effectiveMarginRight, childWidth < 0 ? WRAP_CONTENT : childWidth);
|
|
222
|
+
const childHeightMeasureSpec = FlexboxLayout.getChildMeasureSpec(heightMeasureSpec, lp.effectivePaddingTop + lp.effectivePaddingBottom + lp.effectiveMarginTop + lp.effectiveMarginBottom, lp.effectiveHeight < 0 ? WRAP_CONTENT : lp.effectiveHeight);
|
|
277
223
|
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
|
278
|
-
|
|
224
|
+
this._checkSizeConstraints(child);
|
|
279
225
|
childState = View.combineMeasuredStates(childState, child.getMeasuredState());
|
|
280
226
|
largestHeightInRow = Math.max(largestHeightInRow, child.getMeasuredHeight() + lp.effectiveMarginTop + lp.effectiveMarginBottom);
|
|
281
|
-
if (
|
|
227
|
+
if (this._isWrapRequired(child, widthMode, widthSize, flexLine._mainSize, child.getMeasuredWidth() + lp.effectiveMarginLeft + lp.effectiveMarginRight, i, indexInFlexLine)) {
|
|
282
228
|
if (flexLine.itemCount > 0) {
|
|
283
|
-
|
|
229
|
+
this._addFlexLine(flexLine);
|
|
284
230
|
}
|
|
285
231
|
flexLine = new FlexLine();
|
|
286
232
|
flexLine._itemCount = 1;
|
|
@@ -297,58 +243,58 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
297
243
|
flexLine._totalFlexShrink += FlexboxLayout.getFlexShrink(child);
|
|
298
244
|
flexLine._crossSize = Math.max(flexLine._crossSize, largestHeightInRow);
|
|
299
245
|
// Omit divider
|
|
300
|
-
if (
|
|
246
|
+
if (this.flexWrap !== FlexWrap.WRAP_REVERSE) {
|
|
301
247
|
flexLine._maxBaseline = Math.max(flexLine._maxBaseline, FlexboxLayout.getBaseline(child) + lp.effectiveMarginTop);
|
|
302
248
|
}
|
|
303
249
|
else {
|
|
304
250
|
flexLine._maxBaseline = Math.max(flexLine._maxBaseline, child.getMeasuredHeight() - FlexboxLayout.getBaseline(child) + lp.effectiveMarginBottom);
|
|
305
251
|
}
|
|
306
|
-
|
|
252
|
+
this._addFlexLineIfLastFlexItem(i, childCount, flexLine);
|
|
307
253
|
}
|
|
308
254
|
})();
|
|
309
255
|
this._determineMainSize(this.flexDirection, widthMeasureSpec, heightMeasureSpec);
|
|
310
256
|
if (this.alignItems === AlignItems.BASELINE) {
|
|
311
|
-
|
|
312
|
-
this._flexLines.forEach(
|
|
313
|
-
|
|
314
|
-
for (
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
if (
|
|
318
|
-
|
|
257
|
+
let viewIndex = 0;
|
|
258
|
+
this._flexLines.forEach((flexLine) => {
|
|
259
|
+
let largestHeightInLine = Number.MIN_VALUE;
|
|
260
|
+
for (let i = viewIndex; i < viewIndex + flexLine._itemCount; i++) {
|
|
261
|
+
const child = this._getReorderedChildAt(i);
|
|
262
|
+
const lp = child; // .style;
|
|
263
|
+
if (this.flexWrap !== FlexWrap.WRAP_REVERSE) {
|
|
264
|
+
let marginTop = flexLine._maxBaseline - FlexboxLayout.getBaseline(child);
|
|
319
265
|
marginTop = Math.max(marginTop, lp.effectiveMarginTop);
|
|
320
266
|
largestHeightInLine = Math.max(largestHeightInLine, child.getActualSize().height + marginTop + lp.effectiveMarginBottom);
|
|
321
267
|
}
|
|
322
268
|
else {
|
|
323
|
-
|
|
269
|
+
let marginBottom = flexLine._maxBaseline - child.getMeasuredHeight() + FlexboxLayout.getBaseline(child);
|
|
324
270
|
marginBottom = Math.max(marginBottom, lp.effectiveMarginBottom);
|
|
325
271
|
largestHeightInLine = Math.max(largestHeightInLine, child.getActualSize().height + lp.effectiveMarginTop + marginBottom);
|
|
326
272
|
}
|
|
327
273
|
}
|
|
328
274
|
flexLine._crossSize = largestHeightInLine;
|
|
329
|
-
|
|
275
|
+
viewIndex += flexLine.itemCount;
|
|
330
276
|
});
|
|
331
277
|
}
|
|
332
278
|
this._determineCrossSize(this.flexDirection, widthMeasureSpec, heightMeasureSpec, this.effectivePaddingTop + this.effectivePaddingBottom);
|
|
333
279
|
this._stretchViews(this.flexDirection, this.alignItems);
|
|
334
280
|
this._setMeasuredDimensionForFlex(this.flexDirection, widthMeasureSpec, heightMeasureSpec, childState);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
281
|
+
}
|
|
282
|
+
_measureVertical(widthMeasureSpec, heightMeasureSpec) {
|
|
283
|
+
const widthSize = getMeasureSpecSize(widthMeasureSpec);
|
|
284
|
+
const widthMode = getMeasureSpecMode(widthMeasureSpec);
|
|
285
|
+
const heightSize = getMeasureSpecSize(heightMeasureSpec);
|
|
286
|
+
const heightMode = getMeasureSpecMode(heightMeasureSpec);
|
|
287
|
+
let childState = 0;
|
|
342
288
|
this._flexLines.length = 0;
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
289
|
+
const childCount = this.measureContext.childrenCount;
|
|
290
|
+
const paddingTop = this.effectivePaddingTop;
|
|
291
|
+
const paddingBottom = this.effectivePaddingBottom;
|
|
292
|
+
let largestWidthInColumn = Number.MIN_VALUE;
|
|
293
|
+
let flexLine = new FlexLine();
|
|
348
294
|
flexLine._mainSize = paddingTop + paddingBottom;
|
|
349
|
-
|
|
350
|
-
for (
|
|
351
|
-
|
|
295
|
+
let indexInFlexLine = 0;
|
|
296
|
+
for (let i = 0; i < childCount; i++) {
|
|
297
|
+
const child = this._getReorderedChildAt(i);
|
|
352
298
|
if (child === null) {
|
|
353
299
|
this._addFlexLineIfLastFlexItem(i, childCount, flexLine);
|
|
354
300
|
continue;
|
|
@@ -359,17 +305,17 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
359
305
|
continue;
|
|
360
306
|
}
|
|
361
307
|
child._updateEffectiveLayoutValues(widthSize, widthMode, heightSize, heightMode);
|
|
362
|
-
|
|
308
|
+
const lp = child; // .style;
|
|
363
309
|
if (FlexboxLayout.getAlignSelf(child) === 'stretch') {
|
|
364
310
|
flexLine._indicesAlignSelfStretch.push(i);
|
|
365
311
|
}
|
|
366
|
-
|
|
312
|
+
let childHeight = lp.effectiveHeight;
|
|
367
313
|
// TODO: This should always be false
|
|
368
314
|
if (FlexBasisPercent.DEFAULT /* lp.flexBasisPercent */ !== FlexBasisPercent.DEFAULT && heightMode === EXACTLY) {
|
|
369
315
|
childHeight = Math.round(heightSize * FlexBasisPercent.DEFAULT /* lp.flexBasisPercent */);
|
|
370
316
|
}
|
|
371
|
-
|
|
372
|
-
|
|
317
|
+
const childWidthMeasureSpec = FlexboxLayout.getChildMeasureSpec(widthMeasureSpec, this.effectivePaddingLeft + this.effectivePaddingRight + lp.effectiveMarginLeft + lp.effectiveMarginRight, lp.effectiveWidth < 0 ? WRAP_CONTENT : lp.effectiveWidth);
|
|
318
|
+
const childHeightMeasureSpec = FlexboxLayout.getChildMeasureSpec(heightMeasureSpec, this.effectivePaddingTop + this.effectivePaddingBottom + lp.effectiveMarginTop + lp.effectiveMarginBottom, childHeight < 0 ? WRAP_CONTENT : childHeight);
|
|
373
319
|
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
|
374
320
|
this._checkSizeConstraints(child);
|
|
375
321
|
childState = View.combineMeasuredStates(childState, child.getMeasuredState());
|
|
@@ -399,12 +345,12 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
399
345
|
this._determineCrossSize(this.flexDirection, widthMeasureSpec, heightMeasureSpec, this.effectivePaddingLeft + this.effectivePaddingRight);
|
|
400
346
|
this._stretchViews(this.flexDirection, this.alignItems);
|
|
401
347
|
this._setMeasuredDimensionForFlex(this.flexDirection, widthMeasureSpec, heightMeasureSpec, childState);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
348
|
+
}
|
|
349
|
+
_checkSizeConstraints(view) {
|
|
350
|
+
let needsMeasure = false;
|
|
351
|
+
let childWidth = view.getMeasuredWidth();
|
|
352
|
+
let childHeight = view.getMeasuredHeight();
|
|
353
|
+
const minWidth = view.effectiveMinWidth;
|
|
408
354
|
view.effectiveMinWidth = 0;
|
|
409
355
|
if (view.getMeasuredWidth() < minWidth) {
|
|
410
356
|
needsMeasure = true;
|
|
@@ -414,7 +360,7 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
414
360
|
needsMeasure = true;
|
|
415
361
|
childWidth = MAX_SIZE /*lp.maxWidth*/;
|
|
416
362
|
}
|
|
417
|
-
|
|
363
|
+
const minHeight = view.effectiveMinHeight;
|
|
418
364
|
view.effectiveMinHeight = 0;
|
|
419
365
|
if (childHeight < minHeight) {
|
|
420
366
|
needsMeasure = true;
|
|
@@ -429,25 +375,24 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
429
375
|
}
|
|
430
376
|
view.effectiveMinWidth = minWidth;
|
|
431
377
|
view.effectiveMinHeight = minHeight;
|
|
432
|
-
}
|
|
433
|
-
|
|
378
|
+
}
|
|
379
|
+
_addFlexLineIfLastFlexItem(childIndex, childCount, flexLine) {
|
|
434
380
|
if (childIndex === childCount - 1 && flexLine.itemCount !== 0) {
|
|
435
381
|
this._addFlexLine(flexLine);
|
|
436
382
|
}
|
|
437
|
-
}
|
|
438
|
-
|
|
383
|
+
}
|
|
384
|
+
_addFlexLine(flexLine) {
|
|
439
385
|
// Omit divider
|
|
440
386
|
this._flexLines.push(flexLine);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
var paddingAlongMainAxis;
|
|
387
|
+
}
|
|
388
|
+
_determineMainSize(flexDirection, widthMeasureSpec, heightMeasureSpec) {
|
|
389
|
+
let mainSize;
|
|
390
|
+
let paddingAlongMainAxis;
|
|
446
391
|
switch (flexDirection) {
|
|
447
392
|
case FlexDirection.ROW:
|
|
448
393
|
case FlexDirection.ROW_REVERSE: {
|
|
449
|
-
|
|
450
|
-
|
|
394
|
+
const widthMode = getMeasureSpecMode(widthMeasureSpec);
|
|
395
|
+
const widthSize = getMeasureSpecSize(widthMeasureSpec);
|
|
451
396
|
if (widthMode === EXACTLY) {
|
|
452
397
|
mainSize = widthSize;
|
|
453
398
|
}
|
|
@@ -459,8 +404,8 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
459
404
|
}
|
|
460
405
|
case FlexDirection.COLUMN:
|
|
461
406
|
case FlexDirection.COLUMN_REVERSE: {
|
|
462
|
-
|
|
463
|
-
|
|
407
|
+
const heightMode = getMeasureSpecMode(heightMeasureSpec);
|
|
408
|
+
const heightSize = getMeasureSpecSize(heightMeasureSpec);
|
|
464
409
|
if (heightMode === EXACTLY) {
|
|
465
410
|
mainSize = heightSize;
|
|
466
411
|
}
|
|
@@ -473,30 +418,30 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
473
418
|
default:
|
|
474
419
|
throw new Error('Invalid flex direction: ' + flexDirection);
|
|
475
420
|
}
|
|
476
|
-
|
|
477
|
-
this._flexLines.forEach(
|
|
421
|
+
let childIndex = 0;
|
|
422
|
+
this._flexLines.forEach((flexLine) => {
|
|
478
423
|
if (flexLine.mainSize < mainSize) {
|
|
479
|
-
childIndex =
|
|
424
|
+
childIndex = this._expandFlexItems(flexLine, flexDirection, mainSize, paddingAlongMainAxis, childIndex);
|
|
480
425
|
}
|
|
481
426
|
else {
|
|
482
|
-
childIndex =
|
|
427
|
+
childIndex = this._shrinkFlexItems(flexLine, flexDirection, mainSize, paddingAlongMainAxis, childIndex);
|
|
483
428
|
}
|
|
484
429
|
});
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
430
|
+
}
|
|
431
|
+
_expandFlexItems(flexLine, flexDirection, maxMainSize, paddingAlongMainAxis, startIndex) {
|
|
432
|
+
let childIndex = startIndex;
|
|
488
433
|
if (flexLine._totalFlexGrow <= 0 || maxMainSize < flexLine._mainSize) {
|
|
489
434
|
childIndex += flexLine._itemCount;
|
|
490
435
|
return childIndex;
|
|
491
436
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
437
|
+
const sizeBeforeExpand = flexLine._mainSize;
|
|
438
|
+
let needsReexpand = false;
|
|
439
|
+
const pendingSpace = maxMainSize - flexLine._mainSize;
|
|
440
|
+
const unitSpace = pendingSpace / flexLine._totalFlexGrow;
|
|
496
441
|
flexLine._mainSize = paddingAlongMainAxis + flexLine._dividerLengthInMainSize;
|
|
497
|
-
|
|
498
|
-
for (
|
|
499
|
-
|
|
442
|
+
let accumulatedRoundError = 0;
|
|
443
|
+
for (let i = 0; i < flexLine.itemCount; i++) {
|
|
444
|
+
const child = this._getReorderedChildAt(childIndex);
|
|
500
445
|
if (child === null) {
|
|
501
446
|
continue;
|
|
502
447
|
}
|
|
@@ -504,12 +449,12 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
504
449
|
childIndex++;
|
|
505
450
|
continue;
|
|
506
451
|
}
|
|
507
|
-
|
|
452
|
+
const lp = child; // .style;
|
|
508
453
|
if (this._isMainAxisDirectionHorizontal(flexDirection)) {
|
|
509
454
|
if (!this._childrenFrozen[childIndex]) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
455
|
+
const flexGrow = FlexboxLayout.getFlexGrow(child);
|
|
456
|
+
const rawCalculatedWidth = child.getMeasuredWidth() + unitSpace * flexGrow + accumulatedRoundError;
|
|
457
|
+
let roundedCalculatedWidth = Math.round(rawCalculatedWidth);
|
|
513
458
|
// TODO: MAX_SIZE is so big, this is always false:
|
|
514
459
|
if (roundedCalculatedWidth > MAX_SIZE /* lp.maxWidth */) {
|
|
515
460
|
needsReexpand = true;
|
|
@@ -526,9 +471,9 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
526
471
|
}
|
|
527
472
|
else {
|
|
528
473
|
if (!this._childrenFrozen[childIndex]) {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
474
|
+
const flexGrow = FlexboxLayout.getFlexGrow(child);
|
|
475
|
+
const rawCalculatedHeight = child.getMeasuredHeight() + unitSpace * flexGrow + accumulatedRoundError;
|
|
476
|
+
let roundedCalculatedHeight = Math.round(rawCalculatedHeight);
|
|
532
477
|
// TODO: MAX_SIZE is so big this is always false:
|
|
533
478
|
if (roundedCalculatedHeight > MAX_SIZE /*lp.maxHeight*/) {
|
|
534
479
|
needsReexpand = true;
|
|
@@ -549,20 +494,20 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
549
494
|
this._expandFlexItems(flexLine, flexDirection, maxMainSize, paddingAlongMainAxis, startIndex);
|
|
550
495
|
}
|
|
551
496
|
return childIndex;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
497
|
+
}
|
|
498
|
+
_shrinkFlexItems(flexLine, flexDirection, maxMainSize, paddingAlongMainAxis, startIndex) {
|
|
499
|
+
let childIndex = startIndex;
|
|
500
|
+
const sizeBeforeShrink = flexLine._mainSize;
|
|
556
501
|
if (flexLine._totalFlexShrink <= 0 || maxMainSize > flexLine._mainSize) {
|
|
557
502
|
childIndex += flexLine.itemCount;
|
|
558
503
|
return childIndex;
|
|
559
504
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
505
|
+
let needsReshrink = false;
|
|
506
|
+
const unitShrink = (flexLine._mainSize - maxMainSize) / flexLine._totalFlexShrink;
|
|
507
|
+
let accumulatedRoundError = 0;
|
|
563
508
|
flexLine._mainSize = paddingAlongMainAxis + flexLine._dividerLengthInMainSize;
|
|
564
|
-
for (
|
|
565
|
-
|
|
509
|
+
for (let i = 0; i < flexLine.itemCount; i++) {
|
|
510
|
+
const child = this._getReorderedChildAt(childIndex);
|
|
566
511
|
if (child === null) {
|
|
567
512
|
continue;
|
|
568
513
|
}
|
|
@@ -570,14 +515,14 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
570
515
|
childIndex++;
|
|
571
516
|
continue;
|
|
572
517
|
}
|
|
573
|
-
|
|
518
|
+
const lp = child; // .style;
|
|
574
519
|
if (this._isMainAxisDirectionHorizontal(flexDirection)) {
|
|
575
520
|
// The direction of main axis is horizontal
|
|
576
521
|
if (!this._childrenFrozen[childIndex]) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
522
|
+
const flexShrink = FlexboxLayout.getFlexShrink(child);
|
|
523
|
+
const rawCalculatedWidth = child.getMeasuredWidth() - unitShrink * flexShrink + accumulatedRoundError;
|
|
524
|
+
let roundedCalculatedWidth = Math.round(rawCalculatedWidth);
|
|
525
|
+
const minWidth = child.effectiveMinWidth;
|
|
581
526
|
child.effectiveMinWidth = 0;
|
|
582
527
|
if (roundedCalculatedWidth < minWidth) {
|
|
583
528
|
needsReshrink = true;
|
|
@@ -588,12 +533,12 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
588
533
|
else {
|
|
589
534
|
accumulatedRoundError = rawCalculatedWidth - roundedCalculatedWidth;
|
|
590
535
|
}
|
|
591
|
-
|
|
536
|
+
const childWidthMeasureSpec = makeMeasureSpec(roundedCalculatedWidth, EXACTLY);
|
|
592
537
|
// NOTE: for controls that support internal content wrapping (e.g. UILabel) reducing the width
|
|
593
538
|
// might result in increased height e.g. text that could be shown on one line for larger
|
|
594
539
|
// width needs to be wrapped in two when width is reduced.
|
|
595
540
|
// As a result we cannot unconditionally measure with EXACTLY the current measured height
|
|
596
|
-
|
|
541
|
+
const childHeightMeasureSpec = FlexboxLayout.getChildMeasureSpec(this._currentHeightMeasureSpec, lp.effectivePaddingTop + lp.effectivePaddingBottom + lp.effectiveMarginTop + lp.effectiveMarginBottom, lp.effectiveHeight < 0 ? WRAP_CONTENT : lp.effectiveHeight);
|
|
597
542
|
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
|
598
543
|
child.effectiveMinWidth = minWidth;
|
|
599
544
|
// make sure crossSize is up-to-date as child calculated height might have increased
|
|
@@ -603,10 +548,10 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
603
548
|
}
|
|
604
549
|
else {
|
|
605
550
|
if (!this._childrenFrozen[childIndex]) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
551
|
+
const flexShrink = FlexboxLayout.getFlexShrink(child);
|
|
552
|
+
const rawCalculatedHeight = child.getMeasuredHeight() - unitShrink * flexShrink + accumulatedRoundError;
|
|
553
|
+
let roundedCalculatedHeight = Math.round(rawCalculatedHeight);
|
|
554
|
+
const minHeight = child.effectiveMinHeight;
|
|
610
555
|
child.effectiveMinHeight = 0;
|
|
611
556
|
if (roundedCalculatedHeight < minHeight) {
|
|
612
557
|
needsReshrink = true;
|
|
@@ -628,11 +573,10 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
628
573
|
this._shrinkFlexItems(flexLine, flexDirection, maxMainSize, paddingAlongMainAxis, startIndex);
|
|
629
574
|
}
|
|
630
575
|
return childIndex;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
var size;
|
|
576
|
+
}
|
|
577
|
+
_determineCrossSize(flexDirection, widthMeasureSpec, heightMeasureSpec, paddingAlongCrossAxis) {
|
|
578
|
+
let mode;
|
|
579
|
+
let size;
|
|
636
580
|
switch (flexDirection) {
|
|
637
581
|
case FlexDirection.ROW:
|
|
638
582
|
case FlexDirection.ROW_REVERSE:
|
|
@@ -648,24 +592,24 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
648
592
|
throw new Error('Invalid flex direction: ' + flexDirection);
|
|
649
593
|
}
|
|
650
594
|
if (mode === EXACTLY) {
|
|
651
|
-
|
|
595
|
+
const totalCrossSize = this._getSumOfCrossSize() + paddingAlongCrossAxis;
|
|
652
596
|
if (this._flexLines.length === 1) {
|
|
653
597
|
this._flexLines[0]._crossSize = size - paddingAlongCrossAxis;
|
|
654
598
|
}
|
|
655
|
-
else if (this._flexLines.length >= 2 &&
|
|
599
|
+
else if (this._flexLines.length >= 2 && totalCrossSize < size) {
|
|
656
600
|
switch (this.alignContent) {
|
|
657
601
|
case AlignContent.STRETCH:
|
|
658
|
-
(
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
for (
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
if (i ===
|
|
602
|
+
(() => {
|
|
603
|
+
const freeSpaceUnit = (size - totalCrossSize) / this._flexLines.length;
|
|
604
|
+
let accumulatedError = 0;
|
|
605
|
+
for (let i = 0, flexLinesSize = this._flexLines.length; i < flexLinesSize; i++) {
|
|
606
|
+
const flexLine = this._flexLines[i];
|
|
607
|
+
let newCrossSizeAsFloat = flexLine._crossSize + freeSpaceUnit;
|
|
608
|
+
if (i === this._flexLines.length - 1) {
|
|
665
609
|
newCrossSizeAsFloat += accumulatedError;
|
|
666
610
|
accumulatedError = 0;
|
|
667
611
|
}
|
|
668
|
-
|
|
612
|
+
let newCrossSize = Math.round(newCrossSizeAsFloat);
|
|
669
613
|
accumulatedError += newCrossSizeAsFloat - newCrossSize;
|
|
670
614
|
if (accumulatedError > 1) {
|
|
671
615
|
newCrossSize += 1;
|
|
@@ -680,34 +624,34 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
680
624
|
})();
|
|
681
625
|
break;
|
|
682
626
|
case AlignContent.SPACE_AROUND:
|
|
683
|
-
(
|
|
684
|
-
|
|
685
|
-
|
|
627
|
+
(() => {
|
|
628
|
+
let spaceTopAndBottom = size - totalCrossSize;
|
|
629
|
+
const numberOfSpaces = this._flexLines.length * 2;
|
|
686
630
|
spaceTopAndBottom = spaceTopAndBottom / numberOfSpaces;
|
|
687
|
-
|
|
688
|
-
|
|
631
|
+
const newFlexLines = [];
|
|
632
|
+
const dummySpaceFlexLine = new FlexLine();
|
|
689
633
|
dummySpaceFlexLine._crossSize = spaceTopAndBottom;
|
|
690
|
-
|
|
634
|
+
this._flexLines.forEach((flexLine) => {
|
|
691
635
|
newFlexLines.push(dummySpaceFlexLine);
|
|
692
636
|
newFlexLines.push(flexLine);
|
|
693
637
|
newFlexLines.push(dummySpaceFlexLine);
|
|
694
638
|
});
|
|
695
|
-
|
|
639
|
+
this._flexLines = newFlexLines;
|
|
696
640
|
})();
|
|
697
641
|
break;
|
|
698
642
|
case AlignContent.SPACE_BETWEEN:
|
|
699
|
-
(
|
|
700
|
-
|
|
701
|
-
|
|
643
|
+
(() => {
|
|
644
|
+
let spaceBetweenFlexLine = size - totalCrossSize;
|
|
645
|
+
const numberOfSpaces = this._flexLines.length - 1;
|
|
702
646
|
spaceBetweenFlexLine = spaceBetweenFlexLine / numberOfSpaces;
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
for (
|
|
706
|
-
|
|
647
|
+
let accumulatedError = 0;
|
|
648
|
+
const newFlexLines = [];
|
|
649
|
+
for (let i = 0, flexLineSize = this._flexLines.length; i < flexLineSize; i++) {
|
|
650
|
+
const flexLine = this._flexLines[i];
|
|
707
651
|
newFlexLines.push(flexLine);
|
|
708
|
-
if (i !==
|
|
709
|
-
|
|
710
|
-
if (i ===
|
|
652
|
+
if (i !== this._flexLines.length - 1) {
|
|
653
|
+
const dummySpaceFlexLine = new FlexLine();
|
|
654
|
+
if (i === this._flexLines.length - 2) {
|
|
711
655
|
dummySpaceFlexLine._crossSize = Math.round(spaceBetweenFlexLine + accumulatedError);
|
|
712
656
|
accumulatedError = 0;
|
|
713
657
|
}
|
|
@@ -726,20 +670,20 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
726
670
|
newFlexLines.push(dummySpaceFlexLine);
|
|
727
671
|
}
|
|
728
672
|
}
|
|
729
|
-
|
|
673
|
+
this._flexLines = newFlexLines;
|
|
730
674
|
})();
|
|
731
675
|
break;
|
|
732
676
|
case AlignContent.CENTER: {
|
|
733
|
-
|
|
677
|
+
let spaceAboveAndBottom = size - totalCrossSize;
|
|
734
678
|
spaceAboveAndBottom = spaceAboveAndBottom / 2;
|
|
735
|
-
|
|
736
|
-
|
|
679
|
+
const newFlexLines = [];
|
|
680
|
+
const dummySpaceFlexLine = new FlexLine();
|
|
737
681
|
dummySpaceFlexLine._crossSize = spaceAboveAndBottom;
|
|
738
|
-
for (
|
|
682
|
+
for (let i = 0, flexLineSize = this._flexLines.length; i < flexLineSize; i++) {
|
|
739
683
|
if (i === 0) {
|
|
740
684
|
newFlexLines.push(dummySpaceFlexLine);
|
|
741
685
|
}
|
|
742
|
-
|
|
686
|
+
const flexLine = this._flexLines[i];
|
|
743
687
|
newFlexLines.push(flexLine);
|
|
744
688
|
if (i === this._flexLines.length - 1) {
|
|
745
689
|
newFlexLines.push(dummySpaceFlexLine);
|
|
@@ -749,8 +693,8 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
749
693
|
break;
|
|
750
694
|
}
|
|
751
695
|
case AlignContent.FLEX_END: {
|
|
752
|
-
|
|
753
|
-
|
|
696
|
+
const spaceTop = size - totalCrossSize;
|
|
697
|
+
const dummySpaceFlexLine = new FlexLine();
|
|
754
698
|
dummySpaceFlexLine._crossSize = spaceTop;
|
|
755
699
|
this._flexLines.unshift(dummySpaceFlexLine);
|
|
756
700
|
break;
|
|
@@ -758,26 +702,25 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
758
702
|
}
|
|
759
703
|
}
|
|
760
704
|
}
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
var _this = this;
|
|
705
|
+
}
|
|
706
|
+
_stretchViews(flexDirection, alignItems) {
|
|
764
707
|
if (alignItems === AlignItems.STRETCH) {
|
|
765
|
-
|
|
766
|
-
this._flexLines.forEach(
|
|
767
|
-
for (
|
|
768
|
-
|
|
769
|
-
|
|
708
|
+
let viewIndex = 0;
|
|
709
|
+
this._flexLines.forEach((flexLine) => {
|
|
710
|
+
for (let i = 0; i < flexLine.itemCount; i++, viewIndex++) {
|
|
711
|
+
const view = this._getReorderedChildAt(viewIndex);
|
|
712
|
+
const alignSelf = FlexboxLayout.getAlignSelf(view);
|
|
770
713
|
if (alignSelf !== 'auto' && alignSelf !== 'stretch') {
|
|
771
714
|
continue;
|
|
772
715
|
}
|
|
773
716
|
switch (flexDirection) {
|
|
774
717
|
case FlexDirection.ROW:
|
|
775
718
|
case FlexDirection.ROW_REVERSE:
|
|
776
|
-
|
|
719
|
+
this._stretchViewVertically(view, flexLine._crossSize);
|
|
777
720
|
break;
|
|
778
721
|
case FlexDirection.COLUMN:
|
|
779
722
|
case FlexDirection.COLUMN_REVERSE:
|
|
780
|
-
|
|
723
|
+
this._stretchViewHorizontally(view, flexLine._crossSize);
|
|
781
724
|
break;
|
|
782
725
|
default:
|
|
783
726
|
throw new Error('Invalid flex direction: ' + flexDirection);
|
|
@@ -786,17 +729,17 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
786
729
|
});
|
|
787
730
|
}
|
|
788
731
|
else {
|
|
789
|
-
this._flexLines.forEach(
|
|
790
|
-
flexLine._indicesAlignSelfStretch.forEach(
|
|
791
|
-
|
|
732
|
+
this._flexLines.forEach((flexLine) => {
|
|
733
|
+
flexLine._indicesAlignSelfStretch.forEach((index) => {
|
|
734
|
+
const view = this._getReorderedChildAt(index);
|
|
792
735
|
switch (flexDirection) {
|
|
793
736
|
case FlexDirection.ROW:
|
|
794
737
|
case FlexDirection.ROW_REVERSE:
|
|
795
|
-
|
|
738
|
+
this._stretchViewVertically(view, flexLine._crossSize);
|
|
796
739
|
break;
|
|
797
740
|
case FlexDirection.COLUMN:
|
|
798
741
|
case FlexDirection.COLUMN_REVERSE:
|
|
799
|
-
|
|
742
|
+
this._stretchViewHorizontally(view, flexLine._crossSize);
|
|
800
743
|
break;
|
|
801
744
|
default:
|
|
802
745
|
throw new Error('Invalid flex direction: ' + flexDirection);
|
|
@@ -804,30 +747,30 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
804
747
|
});
|
|
805
748
|
});
|
|
806
749
|
}
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
|
|
750
|
+
}
|
|
751
|
+
_stretchViewVertically(view, crossSize) {
|
|
752
|
+
let newHeight = crossSize - view.effectiveMarginTop - view.effectiveMarginBottom;
|
|
810
753
|
newHeight = Math.max(newHeight, 0);
|
|
811
|
-
|
|
812
|
-
|
|
754
|
+
const originalMeasuredWidth = view.getMeasuredWidth();
|
|
755
|
+
let childWidthMeasureSpec = FlexboxLayout.getChildMeasureSpec(this._currentWidthMeasureSpec, view.effectivePaddingLeft + view.effectivePaddingRight + view.effectiveMarginLeft + view.effectiveMarginRight, view.effectiveWidth < 0 ? WRAP_CONTENT : Math.min(view.effectiveWidth, originalMeasuredWidth));
|
|
813
756
|
view.measure(childWidthMeasureSpec, makeMeasureSpec(newHeight, EXACTLY));
|
|
814
757
|
if (originalMeasuredWidth > view.getMeasuredWidth()) {
|
|
815
758
|
childWidthMeasureSpec = makeMeasureSpec(originalMeasuredWidth, EXACTLY);
|
|
816
759
|
view.measure(childWidthMeasureSpec, makeMeasureSpec(newHeight, EXACTLY));
|
|
817
760
|
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
|
|
761
|
+
}
|
|
762
|
+
_stretchViewHorizontally(view, crossSize) {
|
|
763
|
+
let newWidth = crossSize - view.effectiveMarginLeft - view.effectiveMarginRight;
|
|
821
764
|
newWidth = Math.max(newWidth, 0);
|
|
822
765
|
view.measure(makeMeasureSpec(newWidth, EXACTLY), makeMeasureSpec(view.getMeasuredHeight(), EXACTLY));
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
766
|
+
}
|
|
767
|
+
_setMeasuredDimensionForFlex(flexDirection, widthMeasureSpec, heightMeasureSpec, childState) {
|
|
768
|
+
const widthMode = getMeasureSpecMode(widthMeasureSpec);
|
|
769
|
+
let widthSize = getMeasureSpecSize(widthMeasureSpec);
|
|
770
|
+
const heightMode = getMeasureSpecMode(heightMeasureSpec);
|
|
771
|
+
let heightSize = getMeasureSpecSize(heightMeasureSpec);
|
|
772
|
+
let calculatedMaxHeight;
|
|
773
|
+
let calculatedMaxWidth;
|
|
831
774
|
switch (flexDirection) {
|
|
832
775
|
case FlexDirection.ROW:
|
|
833
776
|
case FlexDirection.ROW_REVERSE:
|
|
@@ -842,7 +785,7 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
842
785
|
default:
|
|
843
786
|
throw new Error('Invalid flex direction: ' + flexDirection);
|
|
844
787
|
}
|
|
845
|
-
|
|
788
|
+
let widthSizeAndState;
|
|
846
789
|
switch (widthMode) {
|
|
847
790
|
case EXACTLY:
|
|
848
791
|
if (widthSize < calculatedMaxWidth) {
|
|
@@ -867,7 +810,7 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
867
810
|
default:
|
|
868
811
|
throw new Error('Unknown width mode is set: ' + widthMode);
|
|
869
812
|
}
|
|
870
|
-
|
|
813
|
+
let heightSizeAndState;
|
|
871
814
|
switch (heightMode) {
|
|
872
815
|
case EXACTLY:
|
|
873
816
|
if (heightSize < calculatedMaxHeight) {
|
|
@@ -893,8 +836,8 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
893
836
|
throw new Error('Unknown height mode is set: ' + heightMode);
|
|
894
837
|
}
|
|
895
838
|
this.setMeasuredDimension(widthSizeAndState, heightSizeAndState);
|
|
896
|
-
}
|
|
897
|
-
|
|
839
|
+
}
|
|
840
|
+
_isWrapRequired(child, mode, maxSize, currentLength, childLength, childAbsoluteIndex, childRelativeIndexInFlexLine) {
|
|
898
841
|
if (this.flexWrap === FlexWrap.NOWRAP) {
|
|
899
842
|
return false;
|
|
900
843
|
}
|
|
@@ -906,20 +849,20 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
906
849
|
}
|
|
907
850
|
// Omit divider
|
|
908
851
|
return maxSize < currentLength + childLength;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
return this._flexLines.reduce(
|
|
912
|
-
}
|
|
913
|
-
|
|
852
|
+
}
|
|
853
|
+
_getLargestMainSize() {
|
|
854
|
+
return this._flexLines.reduce((max, flexLine) => Math.max(max, flexLine.mainSize), Number.MIN_VALUE);
|
|
855
|
+
}
|
|
856
|
+
_getSumOfCrossSize() {
|
|
914
857
|
// Omit divider
|
|
915
|
-
return this._flexLines.reduce(
|
|
916
|
-
}
|
|
917
|
-
|
|
858
|
+
return this._flexLines.reduce((sum, flexLine) => sum + flexLine._crossSize, 0);
|
|
859
|
+
}
|
|
860
|
+
_isMainAxisDirectionHorizontal(flexDirection) {
|
|
918
861
|
return flexDirection === FlexDirection.ROW || flexDirection === FlexDirection.ROW_REVERSE;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
862
|
+
}
|
|
863
|
+
onLayout(left, top, right, bottom) {
|
|
864
|
+
const insets = this.getSafeAreaInsets();
|
|
865
|
+
let isRtl;
|
|
923
866
|
switch (this.flexDirection) {
|
|
924
867
|
case FlexDirection.ROW:
|
|
925
868
|
isRtl = false;
|
|
@@ -946,26 +889,25 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
946
889
|
default:
|
|
947
890
|
throw new Error('Invalid flex direction is set: ' + this.flexDirection);
|
|
948
891
|
}
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
var _this = this;
|
|
892
|
+
}
|
|
893
|
+
_layoutHorizontal(isRtl, left, top, right, bottom, insets) {
|
|
952
894
|
// include insets
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
895
|
+
const paddingLeft = this.effectivePaddingLeft + insets.left;
|
|
896
|
+
const paddingTop = this.effectivePaddingTop + insets.top;
|
|
897
|
+
const paddingRight = this.effectivePaddingRight + insets.right;
|
|
898
|
+
const paddingBottom = this.effectivePaddingBottom + insets.bottom;
|
|
899
|
+
let childLeft;
|
|
900
|
+
let currentViewIndex = 0;
|
|
901
|
+
const height = bottom - top;
|
|
902
|
+
const width = right - left;
|
|
961
903
|
// include insets
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
this._flexLines.forEach(
|
|
904
|
+
let childBottom = height - paddingBottom;
|
|
905
|
+
let childTop = paddingTop;
|
|
906
|
+
let childRight;
|
|
907
|
+
this._flexLines.forEach((flexLine, i) => {
|
|
966
908
|
// Omit divider
|
|
967
|
-
|
|
968
|
-
switch (
|
|
909
|
+
let spaceBetweenItem = 0.0;
|
|
910
|
+
switch (this.justifyContent) {
|
|
969
911
|
case JustifyContent.FLEX_START:
|
|
970
912
|
childLeft = paddingLeft;
|
|
971
913
|
childRight = width - paddingRight;
|
|
@@ -987,17 +929,17 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
987
929
|
break;
|
|
988
930
|
case JustifyContent.SPACE_BETWEEN: {
|
|
989
931
|
childLeft = paddingLeft;
|
|
990
|
-
|
|
932
|
+
const denominator = flexLine.itemCount !== 1 ? flexLine.itemCount - 1 : 1.0;
|
|
991
933
|
spaceBetweenItem = (width - insets.left - insets.right - flexLine.mainSize) / denominator;
|
|
992
934
|
childRight = width - paddingRight;
|
|
993
935
|
break;
|
|
994
936
|
}
|
|
995
937
|
default:
|
|
996
|
-
throw new Error('Invalid justifyContent is set: ' +
|
|
938
|
+
throw new Error('Invalid justifyContent is set: ' + this.justifyContent);
|
|
997
939
|
}
|
|
998
940
|
spaceBetweenItem = Math.max(spaceBetweenItem, 0);
|
|
999
|
-
for (
|
|
1000
|
-
|
|
941
|
+
for (let j = 0; j < flexLine.itemCount; j++) {
|
|
942
|
+
const child = this._getReorderedChildAt(currentViewIndex);
|
|
1001
943
|
if (child === null) {
|
|
1002
944
|
continue;
|
|
1003
945
|
}
|
|
@@ -1005,30 +947,30 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1005
947
|
currentViewIndex++;
|
|
1006
948
|
continue;
|
|
1007
949
|
}
|
|
1008
|
-
|
|
950
|
+
const lp = child; // .style;
|
|
1009
951
|
childLeft += lp.effectiveMarginLeft;
|
|
1010
952
|
childRight -= lp.effectiveMarginRight;
|
|
1011
953
|
// Omit divider
|
|
1012
|
-
if (
|
|
954
|
+
if (this.flexWrap === FlexWrap.WRAP_REVERSE) {
|
|
1013
955
|
if (isRtl) {
|
|
1014
|
-
|
|
956
|
+
this._layoutSingleChildHorizontal(child, flexLine, this.flexWrap, this.alignItems, Math.round(childRight) - child.getMeasuredWidth(), childBottom - child.getMeasuredHeight(), Math.round(childRight), childBottom);
|
|
1015
957
|
}
|
|
1016
958
|
else {
|
|
1017
|
-
|
|
959
|
+
this._layoutSingleChildHorizontal(child, flexLine, this.flexWrap, this.alignItems, Math.round(childLeft), childBottom - child.getMeasuredHeight(), Math.round(childLeft) + child.getMeasuredWidth(), childBottom);
|
|
1018
960
|
}
|
|
1019
961
|
}
|
|
1020
962
|
else {
|
|
1021
963
|
if (isRtl) {
|
|
1022
|
-
|
|
964
|
+
this._layoutSingleChildHorizontal(child, flexLine, this.flexWrap, this.alignItems, Math.round(childRight) - child.getMeasuredWidth(), childTop, Math.round(childRight), childTop + child.getMeasuredHeight());
|
|
1023
965
|
}
|
|
1024
966
|
else {
|
|
1025
|
-
|
|
967
|
+
this._layoutSingleChildHorizontal(child, flexLine, this.flexWrap, this.alignItems, Math.round(childLeft), childTop, Math.round(childLeft) + child.getMeasuredWidth(), childTop + child.getMeasuredHeight());
|
|
1026
968
|
}
|
|
1027
969
|
}
|
|
1028
970
|
childLeft += child.getMeasuredWidth() + spaceBetweenItem + lp.effectiveMarginRight;
|
|
1029
971
|
childRight -= child.getMeasuredWidth() + spaceBetweenItem + lp.effectiveMarginLeft;
|
|
1030
972
|
currentViewIndex++;
|
|
1031
|
-
|
|
973
|
+
const bounds = child._getCurrentLayoutBounds();
|
|
1032
974
|
flexLine._left = Math.min(flexLine._left, bounds.left - lp.effectiveMarginLeft);
|
|
1033
975
|
flexLine._top = Math.min(flexLine._top, bounds.top - lp.effectiveMarginTop);
|
|
1034
976
|
flexLine._right = Math.max(flexLine._right, bounds.right + lp.effectiveMarginRight);
|
|
@@ -1037,14 +979,14 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1037
979
|
childTop += flexLine._crossSize;
|
|
1038
980
|
childBottom -= flexLine._crossSize;
|
|
1039
981
|
});
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
982
|
+
}
|
|
983
|
+
_layoutSingleChildHorizontal(view, flexLine, flexWrap, alignItems, left, top, right, bottom) {
|
|
984
|
+
const lp = view; // .style;
|
|
985
|
+
const alignSelf = FlexboxLayout.getAlignSelf(view);
|
|
1044
986
|
if (alignSelf !== 'auto') {
|
|
1045
987
|
alignItems = alignSelf;
|
|
1046
988
|
}
|
|
1047
|
-
|
|
989
|
+
const crossSize = flexLine._crossSize;
|
|
1048
990
|
switch (alignItems) {
|
|
1049
991
|
case AlignItems.FLEX_START:
|
|
1050
992
|
case AlignItems.STRETCH:
|
|
@@ -1057,12 +999,12 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1057
999
|
break;
|
|
1058
1000
|
case AlignItems.BASELINE:
|
|
1059
1001
|
if (flexWrap !== FlexWrap.WRAP_REVERSE) {
|
|
1060
|
-
|
|
1002
|
+
let marginTop = flexLine._maxBaseline - FlexboxLayout.getBaseline(view);
|
|
1061
1003
|
marginTop = Math.max(marginTop, lp.effectiveMarginTop);
|
|
1062
1004
|
view.layout(left, top + marginTop, right, bottom + marginTop);
|
|
1063
1005
|
}
|
|
1064
1006
|
else {
|
|
1065
|
-
|
|
1007
|
+
let marginBottom = flexLine._maxBaseline - view.getMeasuredHeight() + FlexboxLayout.getBaseline(view);
|
|
1066
1008
|
marginBottom = Math.max(marginBottom, lp.effectiveMarginBottom);
|
|
1067
1009
|
view.layout(left, top - marginBottom, right, bottom - marginBottom);
|
|
1068
1010
|
}
|
|
@@ -1076,7 +1018,7 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1076
1018
|
}
|
|
1077
1019
|
break;
|
|
1078
1020
|
case AlignItems.CENTER: {
|
|
1079
|
-
|
|
1021
|
+
const topFromCrossAxis = (crossSize - view.getMeasuredHeight()) / 2;
|
|
1080
1022
|
if (flexWrap !== FlexWrap.WRAP_REVERSE) {
|
|
1081
1023
|
view.layout(left, top + topFromCrossAxis + lp.effectiveMarginTop - lp.effectiveMarginBottom, right, top + topFromCrossAxis + view.getMeasuredHeight() + lp.effectiveMarginTop - lp.effectiveMarginBottom);
|
|
1082
1024
|
}
|
|
@@ -1086,24 +1028,23 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1086
1028
|
break;
|
|
1087
1029
|
}
|
|
1088
1030
|
}
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
this._flexLines.forEach(function (flexLine) {
|
|
1031
|
+
}
|
|
1032
|
+
_layoutVertical(isRtl, fromBottomToTop, left, top, right, bottom, insets) {
|
|
1033
|
+
const paddingLeft = this.effectivePaddingLeft + insets.left;
|
|
1034
|
+
const paddingTop = this.effectivePaddingTop + insets.top;
|
|
1035
|
+
const paddingRight = this.effectivePaddingRight + insets.right;
|
|
1036
|
+
const paddingBottom = this.effectivePaddingBottom + insets.bottom;
|
|
1037
|
+
let childLeft = paddingLeft;
|
|
1038
|
+
let currentViewIndex = 0;
|
|
1039
|
+
const width = right - left;
|
|
1040
|
+
const height = bottom - top;
|
|
1041
|
+
let childRight = width - paddingRight;
|
|
1042
|
+
let childTop;
|
|
1043
|
+
let childBottom;
|
|
1044
|
+
this._flexLines.forEach((flexLine) => {
|
|
1104
1045
|
// Omit divider.
|
|
1105
|
-
|
|
1106
|
-
switch (
|
|
1046
|
+
let spaceBetweenItem = 0.0;
|
|
1047
|
+
switch (this.justifyContent) {
|
|
1107
1048
|
case JustifyContent.FLEX_START:
|
|
1108
1049
|
childTop = paddingTop;
|
|
1109
1050
|
childBottom = height - paddingBottom;
|
|
@@ -1125,17 +1066,17 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1125
1066
|
break;
|
|
1126
1067
|
case JustifyContent.SPACE_BETWEEN: {
|
|
1127
1068
|
childTop = paddingTop;
|
|
1128
|
-
|
|
1069
|
+
const denominator = flexLine.itemCount !== 1 ? flexLine.itemCount - 1 : 1.0;
|
|
1129
1070
|
spaceBetweenItem = (height - insets.top - insets.bottom - flexLine.mainSize) / denominator;
|
|
1130
1071
|
childBottom = height - paddingBottom;
|
|
1131
1072
|
break;
|
|
1132
1073
|
}
|
|
1133
1074
|
default:
|
|
1134
|
-
throw new Error('Invalid justifyContent is set: ' +
|
|
1075
|
+
throw new Error('Invalid justifyContent is set: ' + this.justifyContent);
|
|
1135
1076
|
}
|
|
1136
1077
|
spaceBetweenItem = Math.max(spaceBetweenItem, 0);
|
|
1137
|
-
for (
|
|
1138
|
-
|
|
1078
|
+
for (let j = 0; j < flexLine.itemCount; j++) {
|
|
1079
|
+
const child = this._getReorderedChildAt(currentViewIndex);
|
|
1139
1080
|
if (child === null) {
|
|
1140
1081
|
continue;
|
|
1141
1082
|
}
|
|
@@ -1143,30 +1084,30 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1143
1084
|
currentViewIndex++;
|
|
1144
1085
|
continue;
|
|
1145
1086
|
}
|
|
1146
|
-
|
|
1087
|
+
const lp = child; // .style;
|
|
1147
1088
|
childTop += lp.effectiveMarginTop;
|
|
1148
1089
|
childBottom -= lp.effectiveMarginBottom;
|
|
1149
1090
|
// Omit divider.
|
|
1150
1091
|
if (isRtl) {
|
|
1151
1092
|
if (fromBottomToTop) {
|
|
1152
|
-
|
|
1093
|
+
this._layoutSingleChildVertical(child, flexLine, true, this.alignItems, childRight - child.getMeasuredWidth(), Math.round(childBottom) - child.getMeasuredHeight(), childRight, Math.round(childBottom));
|
|
1153
1094
|
}
|
|
1154
1095
|
else {
|
|
1155
|
-
|
|
1096
|
+
this._layoutSingleChildVertical(child, flexLine, true, this.alignItems, childRight - child.getMeasuredWidth(), Math.round(childTop), childRight, Math.round(childTop) + child.getMeasuredHeight());
|
|
1156
1097
|
}
|
|
1157
1098
|
}
|
|
1158
1099
|
else {
|
|
1159
1100
|
if (fromBottomToTop) {
|
|
1160
|
-
|
|
1101
|
+
this._layoutSingleChildVertical(child, flexLine, false, this.alignItems, childLeft, Math.round(childBottom) - child.getMeasuredHeight(), childLeft + child.getMeasuredWidth(), Math.round(childBottom));
|
|
1161
1102
|
}
|
|
1162
1103
|
else {
|
|
1163
|
-
|
|
1104
|
+
this._layoutSingleChildVertical(child, flexLine, false, this.alignItems, childLeft, Math.round(childTop), childLeft + child.getMeasuredWidth(), Math.round(childTop) + child.getMeasuredHeight());
|
|
1164
1105
|
}
|
|
1165
1106
|
}
|
|
1166
1107
|
childTop += child.getMeasuredHeight() + spaceBetweenItem + lp.effectiveMarginBottom;
|
|
1167
1108
|
childBottom -= child.getMeasuredHeight() + spaceBetweenItem + lp.effectiveMarginTop;
|
|
1168
1109
|
currentViewIndex++;
|
|
1169
|
-
|
|
1110
|
+
const bounds = child._getCurrentLayoutBounds();
|
|
1170
1111
|
flexLine._left = Math.min(flexLine._left, bounds.left - lp.effectiveMarginLeft);
|
|
1171
1112
|
flexLine._top = Math.min(flexLine._top, bounds.top - lp.effectiveMarginTop);
|
|
1172
1113
|
flexLine._right = Math.max(flexLine._right, bounds.right + lp.effectiveMarginRight);
|
|
@@ -1175,14 +1116,14 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1175
1116
|
childLeft += flexLine.crossSize;
|
|
1176
1117
|
childRight -= flexLine.crossSize;
|
|
1177
1118
|
});
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1119
|
+
}
|
|
1120
|
+
_layoutSingleChildVertical(view, flexLine, isRtl, alignItems, left, top, right, bottom) {
|
|
1121
|
+
const lp = view; // .style;
|
|
1122
|
+
const alignSelf = FlexboxLayout.getAlignSelf(view);
|
|
1182
1123
|
if (alignSelf !== 'auto') {
|
|
1183
1124
|
alignItems = alignSelf;
|
|
1184
1125
|
}
|
|
1185
|
-
|
|
1126
|
+
const crossSize = flexLine.crossSize;
|
|
1186
1127
|
switch (alignItems) {
|
|
1187
1128
|
case AlignItems.FLEX_START:
|
|
1188
1129
|
case AlignItems.STRETCH:
|
|
@@ -1205,7 +1146,7 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1205
1146
|
}
|
|
1206
1147
|
break;
|
|
1207
1148
|
case AlignItems.CENTER: {
|
|
1208
|
-
|
|
1149
|
+
const leftFromCrossAxis = (crossSize - view.getMeasuredWidth()) / 2;
|
|
1209
1150
|
if (!isRtl) {
|
|
1210
1151
|
view.layout(left + leftFromCrossAxis + lp.effectiveMarginLeft - lp.effectiveMarginRight, top, right + leftFromCrossAxis + lp.effectiveMarginLeft - lp.effectiveMarginRight, bottom);
|
|
1211
1152
|
}
|
|
@@ -1215,16 +1156,16 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1215
1156
|
break;
|
|
1216
1157
|
}
|
|
1217
1158
|
}
|
|
1218
|
-
}
|
|
1159
|
+
}
|
|
1219
1160
|
// Omit divider in onDraw(), drawDividersHorizontal, drawDividersVertical, drawVerticalDivider
|
|
1220
1161
|
// requestLayout on set flexDirection, set flexWrap, set justifyContent, set alignItems, set alignContent
|
|
1221
1162
|
// NOTE Consider moving to View if frequently used
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1163
|
+
static getChildMeasureSpec(spec, padding, childDimension) {
|
|
1164
|
+
const specMode = layout.getMeasureSpecMode(spec);
|
|
1165
|
+
const specSize = layout.getMeasureSpecSize(spec);
|
|
1166
|
+
const size = Math.max(0, specSize - padding);
|
|
1167
|
+
let resultSize = 0;
|
|
1168
|
+
let resultMode = 0;
|
|
1228
1169
|
switch (specMode) {
|
|
1229
1170
|
// Parent has imposed an exact size on us
|
|
1230
1171
|
case EXACTLY:
|
|
@@ -1271,10 +1212,8 @@ var FlexboxLayout = /** @class */ (function (_super) {
|
|
|
1271
1212
|
break;
|
|
1272
1213
|
}
|
|
1273
1214
|
return layout.makeMeasureSpec(resultSize, resultMode);
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
}(FlexboxLayoutBase));
|
|
1277
|
-
export { FlexboxLayout };
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1278
1217
|
(function (FlexboxLayout) {
|
|
1279
1218
|
function getBaseline(child) {
|
|
1280
1219
|
// TODO: Check if we support baseline for iOS.
|