@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
|
@@ -10,19 +10,19 @@ import { paddingTopProperty, paddingRightProperty, paddingBottomProperty, paddin
|
|
|
10
10
|
import { getClass } from '../../../utils/types';
|
|
11
11
|
import { profile } from '../../../profiling';
|
|
12
12
|
import * as ssm from '../../styling/style-scope';
|
|
13
|
-
|
|
13
|
+
let domNodeModule;
|
|
14
14
|
function ensuredomNodeModule() {
|
|
15
15
|
if (!domNodeModule) {
|
|
16
16
|
domNodeModule = require('../../../debugger/dom-node');
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
let styleScopeModule;
|
|
20
20
|
function ensureStyleScopeModule() {
|
|
21
21
|
if (!styleScopeModule) {
|
|
22
22
|
styleScopeModule = require('../../styling/style-scope');
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
const defaultBindingSource = {};
|
|
26
26
|
/**
|
|
27
27
|
* Gets an ancestor from a given type.
|
|
28
28
|
* @param view - Starting view (child view).
|
|
@@ -30,16 +30,16 @@ var defaultBindingSource = {};
|
|
|
30
30
|
* Returns an instance of a view (if found), otherwise undefined.
|
|
31
31
|
*/
|
|
32
32
|
export function getAncestor(view, criterion) {
|
|
33
|
-
|
|
33
|
+
let matcher = null;
|
|
34
34
|
if (typeof criterion === 'string') {
|
|
35
|
-
matcher =
|
|
35
|
+
matcher = (view) => view.typeName === criterion;
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
matcher =
|
|
38
|
+
matcher = (view) => view instanceof criterion;
|
|
39
39
|
}
|
|
40
|
-
for (
|
|
41
|
-
if (matcher(
|
|
42
|
-
return
|
|
40
|
+
for (let parent = view.parent; parent != null; parent = parent.parent) {
|
|
41
|
+
if (matcher(parent)) {
|
|
42
|
+
return parent;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return null;
|
|
@@ -57,8 +57,8 @@ export function getViewById(view, id) {
|
|
|
57
57
|
if (view.id === id) {
|
|
58
58
|
return view;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
let retVal;
|
|
61
|
+
const descendantsCallback = function (child) {
|
|
62
62
|
if (child.id === id) {
|
|
63
63
|
retVal = child;
|
|
64
64
|
// break the iteration by returning false
|
|
@@ -82,8 +82,8 @@ export function getViewByDomId(view, domId) {
|
|
|
82
82
|
if (view._domId === domId) {
|
|
83
83
|
return view;
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
let retVal;
|
|
86
|
+
const descendantsCallback = function (child) {
|
|
87
87
|
if (view._domId === domId) {
|
|
88
88
|
retVal = child;
|
|
89
89
|
// break the iteration by returning false
|
|
@@ -105,11 +105,11 @@ export function querySelectorAll(view, selector) {
|
|
|
105
105
|
if (!view) {
|
|
106
106
|
return [];
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
const retVal = [];
|
|
109
109
|
if (view[selector]) {
|
|
110
110
|
retVal.push(view);
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
const descendantsCallback = function (child) {
|
|
113
113
|
if (child[selector]) {
|
|
114
114
|
retVal.push(child);
|
|
115
115
|
}
|
|
@@ -127,8 +127,8 @@ export function eachDescendant(view, callback) {
|
|
|
127
127
|
if (!callback || !view) {
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
let continueIteration;
|
|
131
|
+
const localCallback = function (child) {
|
|
132
132
|
continueIteration = callback(child);
|
|
133
133
|
if (continueIteration) {
|
|
134
134
|
child.eachChild(localCallback);
|
|
@@ -137,7 +137,7 @@ export function eachDescendant(view, callback) {
|
|
|
137
137
|
};
|
|
138
138
|
view.eachChild(localCallback);
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
let viewIdCounter = 1;
|
|
141
141
|
// const contextMap = new WeakMap<Object, Map<string, WeakRef<Object>[]>>();
|
|
142
142
|
// function getNativeView(context: Object, typeName: string): Object {
|
|
143
143
|
// let typeMap = contextMap.get(context);
|
|
@@ -188,25 +188,24 @@ var SuspendType;
|
|
|
188
188
|
}
|
|
189
189
|
SuspendType.toString = toString;
|
|
190
190
|
})(SuspendType || (SuspendType = {}));
|
|
191
|
-
|
|
191
|
+
const DEFAULT_VIEW_PADDINGS = new Map();
|
|
192
192
|
/**
|
|
193
193
|
*
|
|
194
194
|
* @nsView ViewBase
|
|
195
195
|
*/
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
_this._onUnloadedCalled = false;
|
|
196
|
+
export class ViewBase extends Observable {
|
|
197
|
+
constructor() {
|
|
198
|
+
super();
|
|
199
|
+
this._onLoadedCalled = false;
|
|
200
|
+
this._onUnloadedCalled = false;
|
|
202
201
|
/**
|
|
203
202
|
* Default visual state, defaults to 'normal'
|
|
204
203
|
*
|
|
205
204
|
* @nsProperty
|
|
206
205
|
*/
|
|
207
|
-
|
|
208
|
-
/* "ui/styling/style-scope" */
|
|
209
|
-
|
|
206
|
+
this.defaultVisualState = 'normal';
|
|
207
|
+
/* "ui/styling/style-scope" */ this._cssState = new ssm.CssState(new WeakRef(this));
|
|
208
|
+
this.pseudoClassAliases = {
|
|
210
209
|
highlighted: ['active', 'pressed'],
|
|
211
210
|
};
|
|
212
211
|
/**
|
|
@@ -215,148 +214,110 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
215
214
|
* of CSS variables/classes. That variable ensures that _addViewToNativeVisualTree
|
|
216
215
|
* is not called in _setupAsRootView
|
|
217
216
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
Object.defineProperty(ViewBase.prototype, "android", {
|
|
286
|
-
get: function () {
|
|
287
|
-
// this._disableNativeViewRecycling = true;
|
|
288
|
-
return this._androidView;
|
|
289
|
-
},
|
|
290
|
-
enumerable: false,
|
|
291
|
-
configurable: true
|
|
292
|
-
});
|
|
293
|
-
Object.defineProperty(ViewBase.prototype, "ios", {
|
|
294
|
-
get: function () {
|
|
295
|
-
// this._disableNativeViewRecycling = true;
|
|
296
|
-
return this._iosView;
|
|
297
|
-
},
|
|
298
|
-
enumerable: false,
|
|
299
|
-
configurable: true
|
|
300
|
-
});
|
|
301
|
-
Object.defineProperty(ViewBase.prototype, "isLoaded", {
|
|
302
|
-
get: function () {
|
|
303
|
-
return this._isLoaded;
|
|
304
|
-
},
|
|
305
|
-
enumerable: false,
|
|
306
|
-
configurable: true
|
|
307
|
-
});
|
|
308
|
-
Object.defineProperty(ViewBase.prototype, 'class', {
|
|
309
|
-
get: function () {
|
|
310
|
-
return this.className;
|
|
311
|
-
},
|
|
312
|
-
set: function (v) {
|
|
313
|
-
this.className = v;
|
|
314
|
-
},
|
|
315
|
-
enumerable: false,
|
|
316
|
-
configurable: true
|
|
317
|
-
});
|
|
217
|
+
this.mIsRootView = false;
|
|
218
|
+
this._domId = viewIdCounter++;
|
|
219
|
+
this._style = new Style(new WeakRef(this));
|
|
220
|
+
this.cssClasses = new Set();
|
|
221
|
+
this.cssPseudoClasses = new Set();
|
|
222
|
+
this.cssPseudoClasses.add(this.defaultVisualState);
|
|
223
|
+
this.notify({ eventName: ViewBase.createdEvent, type: this.constructor.name, object: this });
|
|
224
|
+
}
|
|
225
|
+
// Used in Angular. TODO: remove from here
|
|
226
|
+
/**
|
|
227
|
+
* Gets the template parent or the native parent. Sets the template parent.
|
|
228
|
+
*/
|
|
229
|
+
get parentNode() {
|
|
230
|
+
return this._templateParent || this.parent;
|
|
231
|
+
}
|
|
232
|
+
set parentNode(node) {
|
|
233
|
+
this._templateParent = node;
|
|
234
|
+
}
|
|
235
|
+
get nativeView() {
|
|
236
|
+
// this._disableNativeViewRecycling = true;
|
|
237
|
+
return this.nativeViewProtected;
|
|
238
|
+
}
|
|
239
|
+
set nativeView(value) {
|
|
240
|
+
this.setNativeView(value);
|
|
241
|
+
}
|
|
242
|
+
// TODO: Use Type.prototype.typeName instead.
|
|
243
|
+
/**
|
|
244
|
+
* Gets the name of the constructor function for this instance. E.g. for a Button class this will return "Button".
|
|
245
|
+
*/
|
|
246
|
+
get typeName() {
|
|
247
|
+
return getClass(this);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Gets the style object associated to this view.
|
|
251
|
+
*/
|
|
252
|
+
get style() {
|
|
253
|
+
return this._style;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
*
|
|
257
|
+
* @nsProperty
|
|
258
|
+
*/
|
|
259
|
+
set style(inlineStyle /* | string */) {
|
|
260
|
+
if (typeof inlineStyle === 'string') {
|
|
261
|
+
this.setInlineStyle(inlineStyle);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
throw new Error('View.style property is read-only.');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
get android() {
|
|
268
|
+
// this._disableNativeViewRecycling = true;
|
|
269
|
+
return this._androidView;
|
|
270
|
+
}
|
|
271
|
+
get ios() {
|
|
272
|
+
// this._disableNativeViewRecycling = true;
|
|
273
|
+
return this._iosView;
|
|
274
|
+
}
|
|
275
|
+
get isLoaded() {
|
|
276
|
+
return this._isLoaded;
|
|
277
|
+
}
|
|
278
|
+
get ['class']() {
|
|
279
|
+
return this.className;
|
|
280
|
+
}
|
|
281
|
+
set ['class'](v) {
|
|
282
|
+
this.className = v;
|
|
283
|
+
}
|
|
318
284
|
/**
|
|
319
285
|
* Returns the child view with the specified id.
|
|
320
286
|
*/
|
|
321
|
-
|
|
287
|
+
getViewById(id) {
|
|
322
288
|
return getViewById(this, id);
|
|
323
|
-
}
|
|
289
|
+
}
|
|
324
290
|
/**
|
|
325
291
|
* Returns the child view with the specified domId.
|
|
326
292
|
*/
|
|
327
|
-
|
|
293
|
+
getViewByDomId(domId) {
|
|
328
294
|
return getViewByDomId(this, domId);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
},
|
|
340
|
-
enumerable: false,
|
|
341
|
-
configurable: true
|
|
342
|
-
});
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Gets owner page. This is a read-only property.
|
|
298
|
+
*/
|
|
299
|
+
get page() {
|
|
300
|
+
if (this.parent) {
|
|
301
|
+
return this.parent.page;
|
|
302
|
+
}
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
343
305
|
/**
|
|
344
306
|
* @unstable
|
|
345
307
|
* Ensures a dom-node for this view.
|
|
346
308
|
*/
|
|
347
|
-
|
|
309
|
+
ensureDomNode() {
|
|
348
310
|
if (!this.domNode) {
|
|
349
311
|
ensuredomNodeModule();
|
|
350
312
|
this.domNode = new domNodeModule.DOMNode(this);
|
|
351
313
|
}
|
|
352
|
-
}
|
|
314
|
+
}
|
|
353
315
|
// Overridden so we don't raise `propertyChange`
|
|
354
316
|
// The property will raise its own event.
|
|
355
|
-
|
|
317
|
+
set(name, value) {
|
|
356
318
|
this[name] = WrappedValue.unwrap(value);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
var _this = this;
|
|
319
|
+
}
|
|
320
|
+
onLoaded() {
|
|
360
321
|
this.setFlag(Flags.superOnLoadedCalled, true);
|
|
361
322
|
if (this._isLoaded) {
|
|
362
323
|
return;
|
|
@@ -364,58 +325,57 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
364
325
|
this._isLoaded = true;
|
|
365
326
|
this._cssState.onLoaded();
|
|
366
327
|
this._resumeNativeUpdates(SuspendType.Loaded);
|
|
367
|
-
this.eachChild(
|
|
368
|
-
|
|
328
|
+
this.eachChild((child) => {
|
|
329
|
+
this.loadView(child);
|
|
369
330
|
return true;
|
|
370
331
|
});
|
|
371
332
|
this._emit('loaded');
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
var _this = this;
|
|
333
|
+
}
|
|
334
|
+
onUnloaded() {
|
|
375
335
|
this.setFlag(Flags.superOnUnloadedCalled, true);
|
|
376
336
|
if (!this._isLoaded) {
|
|
377
337
|
return;
|
|
378
338
|
}
|
|
379
339
|
this._suspendNativeUpdates(SuspendType.Loaded);
|
|
380
|
-
this.eachChild(
|
|
381
|
-
|
|
340
|
+
this.eachChild((child) => {
|
|
341
|
+
this.unloadView(child);
|
|
382
342
|
return true;
|
|
383
343
|
});
|
|
384
344
|
this._isLoaded = false;
|
|
385
345
|
this._cssState.onUnloaded();
|
|
386
346
|
this._emit('unloaded');
|
|
387
|
-
}
|
|
388
|
-
|
|
347
|
+
}
|
|
348
|
+
_layoutParent() {
|
|
389
349
|
if (this.parent) {
|
|
390
350
|
this.parent._layoutParent();
|
|
391
351
|
}
|
|
392
|
-
}
|
|
393
|
-
|
|
352
|
+
}
|
|
353
|
+
_suspendNativeUpdates(type) {
|
|
394
354
|
if (type) {
|
|
395
355
|
this._suspendNativeUpdatesCount = this._suspendNativeUpdatesCount | type;
|
|
396
356
|
}
|
|
397
357
|
else {
|
|
398
358
|
this._suspendNativeUpdatesCount++;
|
|
399
359
|
}
|
|
400
|
-
}
|
|
401
|
-
|
|
360
|
+
}
|
|
361
|
+
_resumeNativeUpdates(type) {
|
|
402
362
|
if (type) {
|
|
403
363
|
this._suspendNativeUpdatesCount = this._suspendNativeUpdatesCount & ~type;
|
|
404
364
|
}
|
|
405
365
|
else {
|
|
406
366
|
if ((this._suspendNativeUpdatesCount & SuspendType.IncrementalCountMask) === 0) {
|
|
407
|
-
throw new Error(
|
|
367
|
+
throw new Error(`Invalid call to ${this}._resumeNativeUpdates`);
|
|
408
368
|
}
|
|
409
369
|
this._suspendNativeUpdatesCount--;
|
|
410
370
|
}
|
|
411
371
|
if (!this._suspendNativeUpdatesCount) {
|
|
412
372
|
this.onResumeNativeUpdates();
|
|
413
373
|
}
|
|
414
|
-
}
|
|
374
|
+
}
|
|
415
375
|
/**
|
|
416
376
|
* Allow multiple updates to be performed on the instance at once.
|
|
417
377
|
*/
|
|
418
|
-
|
|
378
|
+
_batchUpdate(callback) {
|
|
419
379
|
try {
|
|
420
380
|
this._suspendNativeUpdates(SuspendType.Incremental);
|
|
421
381
|
return callback();
|
|
@@ -423,8 +383,8 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
423
383
|
finally {
|
|
424
384
|
this._resumeNativeUpdates(SuspendType.Incremental);
|
|
425
385
|
}
|
|
426
|
-
}
|
|
427
|
-
|
|
386
|
+
}
|
|
387
|
+
setFlag(flag, value) {
|
|
428
388
|
switch (flag) {
|
|
429
389
|
case Flags.superOnLoadedCalled:
|
|
430
390
|
this._onLoadedCalled = value;
|
|
@@ -433,91 +393,88 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
433
393
|
this._onUnloadedCalled = value;
|
|
434
394
|
break;
|
|
435
395
|
}
|
|
436
|
-
}
|
|
437
|
-
|
|
396
|
+
}
|
|
397
|
+
isFlagSet(flag) {
|
|
438
398
|
switch (flag) {
|
|
439
399
|
case Flags.superOnLoadedCalled:
|
|
440
400
|
return this._onLoadedCalled;
|
|
441
401
|
case Flags.superOnUnloadedCalled:
|
|
442
402
|
return this._onUnloadedCalled;
|
|
443
403
|
}
|
|
444
|
-
}
|
|
445
|
-
|
|
404
|
+
}
|
|
405
|
+
callFunctionWithSuper(flag, func) {
|
|
446
406
|
this.setFlag(flag, false);
|
|
447
407
|
func();
|
|
448
408
|
if (!this.isFlagSet(flag)) {
|
|
449
|
-
throw new Error(
|
|
409
|
+
throw new Error(`super.${flag} not called in ${this}`);
|
|
450
410
|
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
};
|
|
460
|
-
ViewBase.prototype.notifyPseudoClassChanged = function (pseudoClass) {
|
|
411
|
+
}
|
|
412
|
+
callLoaded() {
|
|
413
|
+
this.callFunctionWithSuper(Flags.superOnLoadedCalled, () => this.onLoaded());
|
|
414
|
+
}
|
|
415
|
+
callUnloaded() {
|
|
416
|
+
this.callFunctionWithSuper(Flags.superOnUnloadedCalled, () => this.onUnloaded());
|
|
417
|
+
}
|
|
418
|
+
notifyPseudoClassChanged(pseudoClass) {
|
|
461
419
|
this.notify({ eventName: ':' + pseudoClass, object: this });
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
|
|
420
|
+
}
|
|
421
|
+
getAllAliasedStates(name) {
|
|
422
|
+
const allStates = [name];
|
|
465
423
|
if (name in this.pseudoClassAliases) {
|
|
466
|
-
for (
|
|
424
|
+
for (let i = 0, length = this.pseudoClassAliases[name].length; i < length; i++) {
|
|
467
425
|
allStates.push(this.pseudoClassAliases[name][i]);
|
|
468
426
|
}
|
|
469
427
|
}
|
|
470
428
|
return allStates;
|
|
471
|
-
}
|
|
429
|
+
}
|
|
472
430
|
/**
|
|
473
431
|
* @protected
|
|
474
432
|
* @unstable
|
|
475
433
|
* A widget can call this method to add a matching css pseudo class.
|
|
476
434
|
*/
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
for (
|
|
435
|
+
addPseudoClass(name) {
|
|
436
|
+
const allStates = this.getAllAliasedStates(name);
|
|
437
|
+
for (let i = 0, length = allStates.length; i < length; i++) {
|
|
480
438
|
if (!this.cssPseudoClasses.has(allStates[i])) {
|
|
481
439
|
this.cssPseudoClasses.add(allStates[i]);
|
|
482
440
|
this.notifyPseudoClassChanged(allStates[i]);
|
|
483
441
|
}
|
|
484
442
|
}
|
|
485
|
-
}
|
|
443
|
+
}
|
|
486
444
|
/**
|
|
487
445
|
* @protected
|
|
488
446
|
* @unstable
|
|
489
447
|
* A widget can call this method to discard matching css pseudo class.
|
|
490
448
|
*/
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
for (
|
|
449
|
+
deletePseudoClass(name) {
|
|
450
|
+
const allStates = this.getAllAliasedStates(name);
|
|
451
|
+
for (let i = 0, length = allStates.length; i < length; i++) {
|
|
494
452
|
if (this.cssPseudoClasses.has(allStates[i])) {
|
|
495
453
|
this.cssPseudoClasses.delete(allStates[i]);
|
|
496
454
|
this.notifyPseudoClassChanged(allStates[i]);
|
|
497
455
|
}
|
|
498
456
|
}
|
|
499
|
-
}
|
|
500
|
-
|
|
457
|
+
}
|
|
458
|
+
bindingContextChanged(data) {
|
|
501
459
|
this.bindings.get('bindingContext').bind(data.value);
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
var targetProperty = options.targetProperty;
|
|
460
|
+
}
|
|
461
|
+
bind(options, source = defaultBindingSource) {
|
|
462
|
+
const targetProperty = options.targetProperty;
|
|
506
463
|
this.unbind(targetProperty);
|
|
507
464
|
if (!this.bindings) {
|
|
508
465
|
this.bindings = new Map();
|
|
509
466
|
}
|
|
510
|
-
|
|
467
|
+
const binding = new Binding(this, options);
|
|
511
468
|
this.bindings.set(targetProperty, binding);
|
|
512
|
-
|
|
469
|
+
let bindingSource = source;
|
|
513
470
|
if (bindingSource === defaultBindingSource) {
|
|
514
471
|
bindingSource = this.bindingContext;
|
|
515
472
|
binding.sourceIsBindingContext = true;
|
|
516
473
|
if (targetProperty === 'bindingContext') {
|
|
517
474
|
this.bindingContextBoundToParentBindingContextChanged = true;
|
|
518
|
-
|
|
519
|
-
if (
|
|
520
|
-
|
|
475
|
+
const parent = this.parent;
|
|
476
|
+
if (parent) {
|
|
477
|
+
parent.on('bindingContextChange', this.bindingContextChanged, this);
|
|
521
478
|
}
|
|
522
479
|
else {
|
|
523
480
|
this.shouldAddHandlerToParentBindingContextChanged = true;
|
|
@@ -525,13 +482,13 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
525
482
|
}
|
|
526
483
|
}
|
|
527
484
|
binding.bind(bindingSource);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
|
|
485
|
+
}
|
|
486
|
+
unbind(property) {
|
|
487
|
+
const bindings = this.bindings;
|
|
531
488
|
if (!bindings) {
|
|
532
489
|
return;
|
|
533
490
|
}
|
|
534
|
-
|
|
491
|
+
const binding = bindings.get(property);
|
|
535
492
|
if (binding) {
|
|
536
493
|
binding.unbind();
|
|
537
494
|
bindings.delete(property);
|
|
@@ -539,53 +496,51 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
539
496
|
if (property === 'bindingContext') {
|
|
540
497
|
this.shouldAddHandlerToParentBindingContextChanged = false;
|
|
541
498
|
this.bindingContextBoundToParentBindingContextChanged = false;
|
|
542
|
-
|
|
543
|
-
if (
|
|
544
|
-
|
|
499
|
+
const parent = this.parent;
|
|
500
|
+
if (parent) {
|
|
501
|
+
parent.off('bindingContextChange', this.bindingContextChanged, this);
|
|
545
502
|
}
|
|
546
503
|
}
|
|
547
504
|
}
|
|
548
505
|
}
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
var _this = this;
|
|
552
|
-
if (currentRun === void 0) { currentRun = 0; }
|
|
506
|
+
}
|
|
507
|
+
performLayout(currentRun = 0) {
|
|
553
508
|
// if there's an animation in progress we need to delay the layout
|
|
554
509
|
// we've added a guard of 5000 milliseconds execution
|
|
555
510
|
// to make sure that the layout will happen even if the animation haven't finished in 5 seconds
|
|
556
511
|
if (this._shouldDelayLayout() && currentRun < 100) {
|
|
557
|
-
setTimeout(
|
|
512
|
+
setTimeout(() => this.performLayout(currentRun), currentRun);
|
|
558
513
|
currentRun++;
|
|
559
514
|
}
|
|
560
515
|
else {
|
|
561
516
|
this.parent.requestLayout();
|
|
562
517
|
}
|
|
563
|
-
}
|
|
518
|
+
}
|
|
564
519
|
/**
|
|
565
520
|
* Invalidates the layout of the view and triggers a new layout pass.
|
|
566
521
|
*/
|
|
567
|
-
|
|
522
|
+
requestLayout() {
|
|
568
523
|
// Default implementation for non View instances (like TabViewItem).
|
|
569
|
-
|
|
524
|
+
const parent = this.parent;
|
|
570
525
|
if (parent) {
|
|
571
526
|
this.performLayout();
|
|
572
527
|
}
|
|
573
|
-
}
|
|
528
|
+
}
|
|
574
529
|
/**
|
|
575
530
|
* Iterates over children of type ViewBase.
|
|
576
531
|
* @param callback Called for each child of type ViewBase. Iteration stops if this method returns falsy value.
|
|
577
532
|
*/
|
|
578
|
-
|
|
533
|
+
eachChild(callback) {
|
|
579
534
|
//
|
|
580
|
-
}
|
|
581
|
-
|
|
535
|
+
}
|
|
536
|
+
_inheritStyles(view) {
|
|
582
537
|
propagateInheritableProperties(this, view);
|
|
583
538
|
view._inheritStyleScope(this._styleScope);
|
|
584
539
|
propagateInheritableCssProperties(this.style, view.style);
|
|
585
|
-
}
|
|
586
|
-
|
|
540
|
+
}
|
|
541
|
+
_addView(view, atIndex) {
|
|
587
542
|
if (Trace.isEnabled()) {
|
|
588
|
-
Trace.write(
|
|
543
|
+
Trace.write(`${this}._addView(${view}, ${atIndex})`, Trace.categories.ViewHierarchy);
|
|
589
544
|
}
|
|
590
545
|
if (!view) {
|
|
591
546
|
throw new Error('Expecting a valid View instance.');
|
|
@@ -602,11 +557,11 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
602
557
|
if (this.domNode) {
|
|
603
558
|
this.domNode.onChildAdded(view);
|
|
604
559
|
}
|
|
605
|
-
}
|
|
560
|
+
}
|
|
606
561
|
/**
|
|
607
562
|
* Method is intended to be overridden by inheritors and used as "protected"
|
|
608
563
|
*/
|
|
609
|
-
|
|
564
|
+
_addViewCore(view, atIndex) {
|
|
610
565
|
this._inheritStyles(view);
|
|
611
566
|
if (this._context) {
|
|
612
567
|
view._setupUI(this._context, atIndex);
|
|
@@ -614,38 +569,38 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
614
569
|
if (this._isLoaded) {
|
|
615
570
|
this.loadView(view);
|
|
616
571
|
}
|
|
617
|
-
}
|
|
572
|
+
}
|
|
618
573
|
/**
|
|
619
574
|
* Load view.
|
|
620
575
|
* @param view to load.
|
|
621
576
|
*/
|
|
622
|
-
|
|
577
|
+
loadView(view) {
|
|
623
578
|
if (view && !view.isLoaded) {
|
|
624
579
|
view.callLoaded();
|
|
625
580
|
}
|
|
626
|
-
}
|
|
581
|
+
}
|
|
627
582
|
/**
|
|
628
583
|
* When returning true the callLoaded method will be run in setTimeout
|
|
629
584
|
* Method is intended to be overridden by inheritors and used as "protected"
|
|
630
585
|
*/
|
|
631
|
-
|
|
586
|
+
_shouldDelayLayout() {
|
|
632
587
|
return false;
|
|
633
|
-
}
|
|
588
|
+
}
|
|
634
589
|
/**
|
|
635
590
|
* Unload view.
|
|
636
591
|
* @param view to unload.
|
|
637
592
|
*/
|
|
638
|
-
|
|
593
|
+
unloadView(view) {
|
|
639
594
|
if (view && view.isLoaded) {
|
|
640
595
|
view.callUnloaded();
|
|
641
596
|
}
|
|
642
|
-
}
|
|
597
|
+
}
|
|
643
598
|
/**
|
|
644
599
|
* Core logic for removing a child view from this instance. Used by the framework to handle lifecycle events more centralized. Do not use outside the UI Stack implementation.
|
|
645
600
|
*/
|
|
646
|
-
|
|
601
|
+
_removeView(view) {
|
|
647
602
|
if (Trace.isEnabled()) {
|
|
648
|
-
Trace.write(
|
|
603
|
+
Trace.write(`${this}._removeView(${view})`, Trace.categories.ViewHierarchy);
|
|
649
604
|
}
|
|
650
605
|
if (view.parent !== this) {
|
|
651
606
|
throw new Error('View not added to this instance. View: ' + view + ' CurrentParent: ' + view.parent + ' ExpectedParent: ' + this);
|
|
@@ -656,27 +611,27 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
656
611
|
this._removeViewCore(view);
|
|
657
612
|
view.parent = undefined;
|
|
658
613
|
view._parentChanged(this);
|
|
659
|
-
}
|
|
614
|
+
}
|
|
660
615
|
/**
|
|
661
616
|
* Method is intended to be overridden by inheritors and used as "protected"
|
|
662
617
|
*/
|
|
663
|
-
|
|
618
|
+
_removeViewCore(view) {
|
|
664
619
|
this.unloadView(view);
|
|
665
620
|
if (view._context) {
|
|
666
621
|
view._tearDownUI();
|
|
667
622
|
}
|
|
668
|
-
}
|
|
623
|
+
}
|
|
669
624
|
/**
|
|
670
625
|
* Creates a native view.
|
|
671
626
|
* Returns either android.view.View or UIView.
|
|
672
627
|
*/
|
|
673
|
-
|
|
628
|
+
createNativeView() {
|
|
674
629
|
return undefined;
|
|
675
|
-
}
|
|
630
|
+
}
|
|
676
631
|
/**
|
|
677
632
|
* Clean up references to the native view.
|
|
678
633
|
*/
|
|
679
|
-
|
|
634
|
+
disposeNativeView() {
|
|
680
635
|
// Unset those values so that view will check for resize after being removed and re-added to view-tree
|
|
681
636
|
this._oldLeft = 0;
|
|
682
637
|
this._oldTop = 0;
|
|
@@ -686,20 +641,20 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
686
641
|
eventName: ViewBase.disposeNativeViewEvent,
|
|
687
642
|
object: this,
|
|
688
643
|
});
|
|
689
|
-
}
|
|
644
|
+
}
|
|
690
645
|
/**
|
|
691
646
|
* Initializes properties/listeners of the native view.
|
|
692
647
|
*/
|
|
693
|
-
|
|
648
|
+
initNativeView() {
|
|
694
649
|
//
|
|
695
|
-
}
|
|
650
|
+
}
|
|
696
651
|
/**
|
|
697
652
|
* Resets properties/listeners set to the native view.
|
|
698
653
|
*/
|
|
699
|
-
|
|
654
|
+
resetNativeView() {
|
|
700
655
|
//
|
|
701
|
-
}
|
|
702
|
-
|
|
656
|
+
}
|
|
657
|
+
resetNativeViewInternal() {
|
|
703
658
|
// const nativeView = this.nativeViewProtected;
|
|
704
659
|
// if (nativeView && __ANDROID__) {
|
|
705
660
|
// const recycle = this.recycleNativeView;
|
|
@@ -716,23 +671,23 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
716
671
|
// if (this._cssState) {
|
|
717
672
|
// this._cancelAllAnimations();
|
|
718
673
|
// }
|
|
719
|
-
}
|
|
720
|
-
|
|
674
|
+
}
|
|
675
|
+
_setupAsRootView(context) {
|
|
721
676
|
this.mIsRootView = true;
|
|
722
677
|
this._setupUI(context);
|
|
723
678
|
this.mIsRootView = false;
|
|
724
|
-
}
|
|
679
|
+
}
|
|
725
680
|
/**
|
|
726
681
|
* Setups the UI for ViewBase and all its children recursively.
|
|
727
682
|
* This method should *not* be overridden by derived views.
|
|
728
683
|
*/
|
|
729
|
-
|
|
684
|
+
_setupUI(context /* android.content.Context */, atIndex, parentIsLoaded) {
|
|
730
685
|
if (this._context === context) {
|
|
731
686
|
// this check is unnecessary as this function should never be called when this._context === context as it means the view was somehow detached,
|
|
732
687
|
// which is only possible by setting reusable = true. Adding it either way for feature flag safety
|
|
733
688
|
if (this.reusable) {
|
|
734
689
|
if (!this.mIsRootView && this.parent && !this._isAddedToNativeVisualTree) {
|
|
735
|
-
|
|
690
|
+
const nativeIndex = this.parent._childIndexToNativeChildIndex(atIndex);
|
|
736
691
|
this._isAddedToNativeVisualTree = this.parent._addViewToNativeVisualTree(this, nativeIndex);
|
|
737
692
|
}
|
|
738
693
|
}
|
|
@@ -744,7 +699,7 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
744
699
|
this._context = context;
|
|
745
700
|
// This will account for nativeView that is created in createNativeView, recycled
|
|
746
701
|
// or for backward compatibility - set before _setupUI in iOS constructor.
|
|
747
|
-
|
|
702
|
+
let nativeView = this.nativeViewProtected;
|
|
748
703
|
// if (__ANDROID__) {
|
|
749
704
|
// const recycle = this.recycleNativeView;
|
|
750
705
|
// if (recycle === "always" || (recycle === "auto" && !this._disableNativeViewRecycling)) {
|
|
@@ -760,11 +715,11 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
760
715
|
if (this._androidView !== nativeView || !this.reusable) {
|
|
761
716
|
this._androidView = nativeView;
|
|
762
717
|
if (nativeView) {
|
|
763
|
-
|
|
718
|
+
const className = this.constructor.name;
|
|
764
719
|
if (this._isPaddingRelative === undefined) {
|
|
765
720
|
this._isPaddingRelative = nativeView.isPaddingRelative();
|
|
766
721
|
}
|
|
767
|
-
|
|
722
|
+
let result /* android.graphics.Rect */ = DEFAULT_VIEW_PADDINGS.get(className) || nativeView.defaultPaddings;
|
|
768
723
|
if (result === undefined) {
|
|
769
724
|
DEFAULT_VIEW_PADDINGS.set(className, org.nativescript.widgets.ViewHelper.getPadding(nativeView));
|
|
770
725
|
nativeView.defaultPaddings = DEFAULT_VIEW_PADDINGS.get(className);
|
|
@@ -777,7 +732,7 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
777
732
|
this._defaultPaddingRight = result.right;
|
|
778
733
|
this._defaultPaddingBottom = result.bottom;
|
|
779
734
|
this._defaultPaddingLeft = result.left;
|
|
780
|
-
|
|
735
|
+
const style = this.style;
|
|
781
736
|
if (!paddingTopProperty.isSet(style)) {
|
|
782
737
|
this.effectivePaddingTop = this._defaultPaddingTop;
|
|
783
738
|
}
|
|
@@ -798,21 +753,21 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
798
753
|
}
|
|
799
754
|
this.setNativeView(nativeView);
|
|
800
755
|
if (!this.mIsRootView && this.parent) {
|
|
801
|
-
|
|
756
|
+
const nativeIndex = this.parent._childIndexToNativeChildIndex(atIndex);
|
|
802
757
|
this._isAddedToNativeVisualTree = this.parent._addViewToNativeVisualTree(this, nativeIndex);
|
|
803
758
|
}
|
|
804
759
|
this._resumeNativeUpdates(SuspendType.UISetup);
|
|
805
|
-
this.eachChild(
|
|
760
|
+
this.eachChild((child) => {
|
|
806
761
|
child._setupUI(context);
|
|
807
762
|
return true;
|
|
808
763
|
});
|
|
809
|
-
}
|
|
764
|
+
}
|
|
810
765
|
/**
|
|
811
766
|
* Set the nativeView field performing extra checks and updates to the native properties on the new view.
|
|
812
767
|
* Use in cases where the createNativeView is not suitable.
|
|
813
768
|
* As an example use in item controls where the native parent view will create the native views for child items.
|
|
814
769
|
*/
|
|
815
|
-
|
|
770
|
+
setNativeView(value) {
|
|
816
771
|
if (this.__nativeView === value) {
|
|
817
772
|
return;
|
|
818
773
|
}
|
|
@@ -826,30 +781,30 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
826
781
|
this.initNativeView();
|
|
827
782
|
this._resumeNativeUpdates(SuspendType.NativeView);
|
|
828
783
|
}
|
|
829
|
-
}
|
|
784
|
+
}
|
|
830
785
|
/**
|
|
831
786
|
* Tears down the UI of a reusable node by making it no longer reusable.
|
|
832
787
|
* @see _tearDownUI
|
|
833
788
|
* @param forceDestroyChildren Force destroy the children (even if they are reusable)
|
|
834
789
|
*/
|
|
835
|
-
|
|
790
|
+
destroyNode(forceDestroyChildren) {
|
|
836
791
|
this.reusable = false;
|
|
837
792
|
this.callUnloaded();
|
|
838
793
|
this._tearDownUI(forceDestroyChildren);
|
|
839
|
-
}
|
|
794
|
+
}
|
|
840
795
|
/**
|
|
841
796
|
* Tears down the UI for ViewBase and all its children recursively.
|
|
842
797
|
* This method should *not* be overridden by derived views.
|
|
843
798
|
*/
|
|
844
|
-
|
|
799
|
+
_tearDownUI(force) {
|
|
845
800
|
// No context means we are already teared down.
|
|
846
801
|
if (!this._context) {
|
|
847
802
|
return;
|
|
848
803
|
}
|
|
849
|
-
|
|
804
|
+
const preserveNativeView = this.reusable && !force;
|
|
850
805
|
this.resetNativeViewInternal();
|
|
851
806
|
if (!preserveNativeView) {
|
|
852
|
-
this.eachChild(
|
|
807
|
+
this.eachChild((child) => {
|
|
853
808
|
child._tearDownUI(force);
|
|
854
809
|
return true;
|
|
855
810
|
});
|
|
@@ -886,50 +841,46 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
886
841
|
this.domNode.dispose();
|
|
887
842
|
this.domNode = undefined;
|
|
888
843
|
}
|
|
889
|
-
}
|
|
890
|
-
|
|
844
|
+
}
|
|
845
|
+
_childIndexToNativeChildIndex(index) {
|
|
891
846
|
return index;
|
|
892
|
-
}
|
|
847
|
+
}
|
|
893
848
|
/**
|
|
894
849
|
* Performs the core logic of adding a child view to the native visual tree. Returns true if the view's native representation has been successfully added, false otherwise.
|
|
895
850
|
* Method is intended to be overridden by inheritors and used as "protected".
|
|
896
851
|
*/
|
|
897
|
-
|
|
852
|
+
_addViewToNativeVisualTree(view, atIndex) {
|
|
898
853
|
if (view._isAddedToNativeVisualTree) {
|
|
899
854
|
throw new Error('Child already added to the native visual tree.');
|
|
900
855
|
}
|
|
901
856
|
return true;
|
|
902
|
-
}
|
|
857
|
+
}
|
|
903
858
|
/**
|
|
904
859
|
* Method is intended to be overridden by inheritors and used as "protected"
|
|
905
860
|
*/
|
|
906
|
-
|
|
861
|
+
_removeViewFromNativeVisualTree(view) {
|
|
907
862
|
view._isAddedToNativeVisualTree = false;
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
enumerable: false,
|
|
917
|
-
configurable: true
|
|
918
|
-
});
|
|
919
|
-
ViewBase.prototype._addVisualState = function (state) {
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* @deprecated
|
|
866
|
+
*/
|
|
867
|
+
get visualState() {
|
|
868
|
+
return this._visualState;
|
|
869
|
+
}
|
|
870
|
+
_addVisualState(state) {
|
|
920
871
|
this.deletePseudoClass(this.defaultVisualState);
|
|
921
872
|
this.addPseudoClass(state);
|
|
922
|
-
}
|
|
923
|
-
|
|
873
|
+
}
|
|
874
|
+
_removeVisualState(state) {
|
|
924
875
|
this.deletePseudoClass(state);
|
|
925
876
|
if (!this.cssPseudoClasses.size) {
|
|
926
877
|
this.addPseudoClass(this.defaultVisualState);
|
|
927
878
|
}
|
|
928
|
-
}
|
|
879
|
+
}
|
|
929
880
|
/**
|
|
930
881
|
* @deprecated Use View._addVisualState() and View._removeVisualState() instead.
|
|
931
882
|
*/
|
|
932
|
-
|
|
883
|
+
_goToVisualState(state) {
|
|
933
884
|
console.log('_goToVisualState() is deprecated. Use View._addVisualState() and View._removeVisualState() instead.');
|
|
934
885
|
if (Trace.isEnabled()) {
|
|
935
886
|
Trace.write(this + ' going to state: ' + state, Trace.categories.Style);
|
|
@@ -940,30 +891,30 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
940
891
|
this.deletePseudoClass(this._visualState);
|
|
941
892
|
this._visualState = state;
|
|
942
893
|
this.addPseudoClass(state);
|
|
943
|
-
}
|
|
894
|
+
}
|
|
944
895
|
/**
|
|
945
896
|
* @deprecated
|
|
946
897
|
*
|
|
947
898
|
* This used to be the way to set attribute values in early {N} versions.
|
|
948
899
|
* Now attributes are expected to be set as plain properties on the view instances.
|
|
949
900
|
*/
|
|
950
|
-
|
|
901
|
+
_applyXmlAttribute(attribute, value) {
|
|
951
902
|
console.log('ViewBase._applyXmlAttribute(...) is deprecated; set attributes as plain properties instead');
|
|
952
903
|
if (attribute === 'style' || attribute === 'rows' || attribute === 'columns' || attribute === 'fontAttributes') {
|
|
953
904
|
this[attribute] = value;
|
|
954
905
|
return true;
|
|
955
906
|
}
|
|
956
907
|
return false;
|
|
957
|
-
}
|
|
958
|
-
|
|
908
|
+
}
|
|
909
|
+
setInlineStyle(style) {
|
|
959
910
|
if (typeof style !== 'string') {
|
|
960
911
|
throw new Error('Parameter should be valid CSS string!');
|
|
961
912
|
}
|
|
962
913
|
ensureStyleScopeModule();
|
|
963
914
|
styleScopeModule.applyInlineStyle(this, style, undefined);
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
|
|
915
|
+
}
|
|
916
|
+
_parentChanged(oldParent) {
|
|
917
|
+
const newParent = this.parent;
|
|
967
918
|
//Overridden
|
|
968
919
|
if (oldParent) {
|
|
969
920
|
clearInheritedProperties(this);
|
|
@@ -975,38 +926,38 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
975
926
|
newParent.on('bindingContextChange', this.bindingContextChanged, this);
|
|
976
927
|
this.bindings.get('bindingContext').bind(newParent.bindingContext);
|
|
977
928
|
}
|
|
978
|
-
}
|
|
979
|
-
|
|
929
|
+
}
|
|
930
|
+
onResumeNativeUpdates() {
|
|
980
931
|
// Apply native setters...
|
|
981
932
|
initNativeView(this, undefined, undefined);
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
|
|
933
|
+
}
|
|
934
|
+
toString() {
|
|
935
|
+
let str = this.typeName;
|
|
985
936
|
if (this.id) {
|
|
986
|
-
str +=
|
|
937
|
+
str += `<${this.id}>`;
|
|
987
938
|
}
|
|
988
939
|
else {
|
|
989
|
-
str +=
|
|
940
|
+
str += `(${this._domId})`;
|
|
990
941
|
}
|
|
991
|
-
|
|
942
|
+
const source = Source.get(this);
|
|
992
943
|
if (source) {
|
|
993
|
-
str +=
|
|
944
|
+
str += `@${source};`;
|
|
994
945
|
}
|
|
995
946
|
return str;
|
|
996
|
-
}
|
|
947
|
+
}
|
|
997
948
|
/**
|
|
998
949
|
* @private
|
|
999
950
|
* Notifies each child's css state for change, recursively.
|
|
1000
951
|
* Either the style scope, className or id properties were changed.
|
|
1001
952
|
*/
|
|
1002
|
-
|
|
953
|
+
_onCssStateChange() {
|
|
1003
954
|
this._cssState.onChange();
|
|
1004
|
-
eachDescendant(this,
|
|
955
|
+
eachDescendant(this, (child) => {
|
|
1005
956
|
child._cssState.onChange();
|
|
1006
957
|
return true;
|
|
1007
958
|
});
|
|
1008
|
-
}
|
|
1009
|
-
|
|
959
|
+
}
|
|
960
|
+
_inheritStyleScope(styleScope) {
|
|
1010
961
|
// If we are styleScope don't inherit parent stylescope.
|
|
1011
962
|
// TODO: Consider adding parent scope and merge selectors.
|
|
1012
963
|
if (this._isStyleScopeHost) {
|
|
@@ -1015,123 +966,117 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
1015
966
|
if (this._styleScope !== styleScope) {
|
|
1016
967
|
this._styleScope = styleScope;
|
|
1017
968
|
this._onCssStateChange();
|
|
1018
|
-
this.eachChild(
|
|
969
|
+
this.eachChild((child) => {
|
|
1019
970
|
child._inheritStyleScope(styleScope);
|
|
1020
971
|
return true;
|
|
1021
972
|
});
|
|
1022
973
|
}
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
|
|
974
|
+
}
|
|
975
|
+
showModal(moduleOrView, modalOptions) {
|
|
976
|
+
const parent = this.parent;
|
|
1026
977
|
return parent && parent.showModal(moduleOrView, modalOptions);
|
|
1027
|
-
}
|
|
978
|
+
}
|
|
1028
979
|
/**
|
|
1029
980
|
* Closes the current modal view that this page is showing.
|
|
1030
981
|
* @param context - Any context you want to pass back to the host when closing the modal view.
|
|
1031
982
|
*/
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1035
|
-
args[_i] = arguments[_i];
|
|
1036
|
-
}
|
|
1037
|
-
var parent = this.parent;
|
|
983
|
+
closeModal(...args) {
|
|
984
|
+
const parent = this.parent;
|
|
1038
985
|
if (parent) {
|
|
1039
|
-
parent.closeModal
|
|
986
|
+
parent.closeModal(...args);
|
|
1040
987
|
}
|
|
1041
|
-
}
|
|
988
|
+
}
|
|
1042
989
|
/**
|
|
1043
990
|
* Method is intended to be overridden by inheritors and used as "protected"
|
|
1044
991
|
*/
|
|
1045
|
-
|
|
1046
|
-
eachDescendant(this,
|
|
992
|
+
_dialogClosed() {
|
|
993
|
+
eachDescendant(this, (child) => {
|
|
1047
994
|
child._dialogClosed();
|
|
1048
995
|
return true;
|
|
1049
996
|
});
|
|
1050
|
-
}
|
|
997
|
+
}
|
|
1051
998
|
/**
|
|
1052
999
|
* Method is intended to be overridden by inheritors and used as "protected"
|
|
1053
1000
|
*/
|
|
1054
|
-
|
|
1055
|
-
eachDescendant(this,
|
|
1001
|
+
_onRootViewReset() {
|
|
1002
|
+
eachDescendant(this, (child) => {
|
|
1056
1003
|
child._onRootViewReset();
|
|
1057
1004
|
return true;
|
|
1058
1005
|
});
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
}(Observable));
|
|
1134
|
-
export { ViewBase };
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* String value used when hooking to loaded event.
|
|
1010
|
+
*
|
|
1011
|
+
* @nsEvent loaded
|
|
1012
|
+
*/
|
|
1013
|
+
ViewBase.loadedEvent = 'loaded';
|
|
1014
|
+
/**
|
|
1015
|
+
* String value used when hooking to unloaded event.
|
|
1016
|
+
*
|
|
1017
|
+
* @nsEvent unloaded
|
|
1018
|
+
*/
|
|
1019
|
+
ViewBase.unloadedEvent = 'unloaded';
|
|
1020
|
+
/**
|
|
1021
|
+
* String value used when hooking to creation event
|
|
1022
|
+
*
|
|
1023
|
+
* @nsEvent created
|
|
1024
|
+
*/
|
|
1025
|
+
ViewBase.createdEvent = 'created';
|
|
1026
|
+
/**
|
|
1027
|
+
* String value used when hooking to disposeNativeView event
|
|
1028
|
+
*
|
|
1029
|
+
* @nsEvent disposeNativeView
|
|
1030
|
+
*/
|
|
1031
|
+
ViewBase.disposeNativeViewEvent = 'disposeNativeView';
|
|
1032
|
+
__decorate([
|
|
1033
|
+
profile,
|
|
1034
|
+
__metadata("design:type", Function),
|
|
1035
|
+
__metadata("design:paramtypes", []),
|
|
1036
|
+
__metadata("design:returntype", void 0)
|
|
1037
|
+
], ViewBase.prototype, "onLoaded", null);
|
|
1038
|
+
__decorate([
|
|
1039
|
+
profile,
|
|
1040
|
+
__metadata("design:type", Function),
|
|
1041
|
+
__metadata("design:paramtypes", []),
|
|
1042
|
+
__metadata("design:returntype", void 0)
|
|
1043
|
+
], ViewBase.prototype, "onUnloaded", null);
|
|
1044
|
+
__decorate([
|
|
1045
|
+
profile,
|
|
1046
|
+
__metadata("design:type", Function),
|
|
1047
|
+
__metadata("design:paramtypes", [String]),
|
|
1048
|
+
__metadata("design:returntype", void 0)
|
|
1049
|
+
], ViewBase.prototype, "addPseudoClass", null);
|
|
1050
|
+
__decorate([
|
|
1051
|
+
profile,
|
|
1052
|
+
__metadata("design:type", Function),
|
|
1053
|
+
__metadata("design:paramtypes", [String]),
|
|
1054
|
+
__metadata("design:returntype", void 0)
|
|
1055
|
+
], ViewBase.prototype, "deletePseudoClass", null);
|
|
1056
|
+
__decorate([
|
|
1057
|
+
profile,
|
|
1058
|
+
__metadata("design:type", Function),
|
|
1059
|
+
__metadata("design:paramtypes", []),
|
|
1060
|
+
__metadata("design:returntype", void 0)
|
|
1061
|
+
], ViewBase.prototype, "requestLayout", null);
|
|
1062
|
+
__decorate([
|
|
1063
|
+
profile,
|
|
1064
|
+
__metadata("design:type", Function),
|
|
1065
|
+
__metadata("design:paramtypes", [ViewBase, Number]),
|
|
1066
|
+
__metadata("design:returntype", void 0)
|
|
1067
|
+
], ViewBase.prototype, "_addView", null);
|
|
1068
|
+
__decorate([
|
|
1069
|
+
profile,
|
|
1070
|
+
__metadata("design:type", Function),
|
|
1071
|
+
__metadata("design:paramtypes", [Object, Number, Boolean]),
|
|
1072
|
+
__metadata("design:returntype", void 0)
|
|
1073
|
+
], ViewBase.prototype, "_setupUI", null);
|
|
1074
|
+
__decorate([
|
|
1075
|
+
profile,
|
|
1076
|
+
__metadata("design:type", Function),
|
|
1077
|
+
__metadata("design:paramtypes", [Boolean]),
|
|
1078
|
+
__metadata("design:returntype", void 0)
|
|
1079
|
+
], ViewBase.prototype, "_tearDownUI", null);
|
|
1135
1080
|
ViewBase.prototype.isCollapsed = false;
|
|
1136
1081
|
ViewBase.prototype._oldLeft = 0;
|
|
1137
1082
|
ViewBase.prototype._oldTop = 0;
|
|
@@ -1161,29 +1106,29 @@ ViewBase.prototype._isViewBase = true;
|
|
|
1161
1106
|
ViewBase.prototype.recycleNativeView = 'never';
|
|
1162
1107
|
ViewBase.prototype.reusable = false;
|
|
1163
1108
|
ViewBase.prototype._suspendNativeUpdatesCount = SuspendType.Loaded | SuspendType.NativeView | SuspendType.UISetup;
|
|
1164
|
-
export
|
|
1109
|
+
export const bindingContextProperty = new InheritedProperty({
|
|
1165
1110
|
name: 'bindingContext',
|
|
1166
1111
|
});
|
|
1167
1112
|
bindingContextProperty.register(ViewBase);
|
|
1168
|
-
export
|
|
1113
|
+
export const hiddenProperty = new Property({
|
|
1169
1114
|
name: 'hidden',
|
|
1170
1115
|
defaultValue: false,
|
|
1171
1116
|
affectsLayout: __APPLE__,
|
|
1172
1117
|
valueConverter: booleanConverter,
|
|
1173
|
-
valueChanged:
|
|
1118
|
+
valueChanged: (target, oldValue, newValue) => {
|
|
1174
1119
|
if (target) {
|
|
1175
1120
|
target.isCollapsed = !!newValue;
|
|
1176
1121
|
}
|
|
1177
1122
|
},
|
|
1178
1123
|
});
|
|
1179
1124
|
hiddenProperty.register(ViewBase);
|
|
1180
|
-
export
|
|
1125
|
+
export const classNameProperty = new Property({
|
|
1181
1126
|
name: 'className',
|
|
1182
|
-
valueChanged
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1127
|
+
valueChanged(view, oldValue, newValue) {
|
|
1128
|
+
const cssClasses = view.cssClasses;
|
|
1129
|
+
const rootViewsCssClasses = CSSUtils.getSystemCssClasses();
|
|
1130
|
+
const shouldAddModalRootViewCssClasses = cssClasses.has(CSSUtils.MODAL_ROOT_VIEW_CSS_CLASS);
|
|
1131
|
+
const shouldAddRootViewCssClasses = cssClasses.has(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
|
1187
1132
|
cssClasses.clear();
|
|
1188
1133
|
if (shouldAddModalRootViewCssClasses) {
|
|
1189
1134
|
cssClasses.add(CSSUtils.MODAL_ROOT_VIEW_CSS_CLASS);
|
|
@@ -1191,24 +1136,24 @@ export var classNameProperty = new Property({
|
|
|
1191
1136
|
else if (shouldAddRootViewCssClasses) {
|
|
1192
1137
|
cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
|
|
1193
1138
|
}
|
|
1194
|
-
rootViewsCssClasses.forEach(
|
|
1139
|
+
rootViewsCssClasses.forEach((c) => cssClasses.add(c));
|
|
1195
1140
|
if (typeof newValue === 'string' && newValue !== '') {
|
|
1196
|
-
newValue.split(' ').forEach(
|
|
1141
|
+
newValue.split(' ').forEach((c) => cssClasses.add(c));
|
|
1197
1142
|
}
|
|
1198
1143
|
view._onCssStateChange();
|
|
1199
1144
|
},
|
|
1200
1145
|
});
|
|
1201
1146
|
classNameProperty.register(ViewBase);
|
|
1202
|
-
export
|
|
1147
|
+
export const idProperty = new Property({
|
|
1203
1148
|
name: 'id',
|
|
1204
|
-
valueChanged:
|
|
1149
|
+
valueChanged: (view, oldValue, newValue) => view._onCssStateChange(),
|
|
1205
1150
|
});
|
|
1206
1151
|
idProperty.register(ViewBase);
|
|
1207
|
-
export
|
|
1152
|
+
export const defaultVisualStateProperty = new Property({
|
|
1208
1153
|
name: 'defaultVisualState',
|
|
1209
1154
|
defaultValue: 'normal',
|
|
1210
|
-
valueChanged
|
|
1211
|
-
|
|
1155
|
+
valueChanged(target, oldValue, newValue) {
|
|
1156
|
+
const value = newValue || 'normal';
|
|
1212
1157
|
// Append new default if old one is currently applied
|
|
1213
1158
|
if (target.cssPseudoClasses && target.cssPseudoClasses.has(oldValue)) {
|
|
1214
1159
|
target.deletePseudoClass(oldValue);
|
|
@@ -1218,13 +1163,13 @@ export var defaultVisualStateProperty = new Property({
|
|
|
1218
1163
|
});
|
|
1219
1164
|
defaultVisualStateProperty.register(ViewBase);
|
|
1220
1165
|
export function booleanConverter(v) {
|
|
1221
|
-
|
|
1166
|
+
const lowercase = (v + '').toLowerCase();
|
|
1222
1167
|
if (lowercase === 'true') {
|
|
1223
1168
|
return true;
|
|
1224
1169
|
}
|
|
1225
1170
|
else if (lowercase === 'false') {
|
|
1226
1171
|
return false;
|
|
1227
1172
|
}
|
|
1228
|
-
throw new Error(
|
|
1173
|
+
throw new Error(`Invalid boolean: ${v}`);
|
|
1229
1174
|
}
|
|
1230
1175
|
//# sourceMappingURL=index.js.map
|