@nativescript/core 9.1.0-dev.0 → 9.1.0-next.2
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/application/application-common.d.ts +1 -3
- package/application/application-common.js +5 -44
- package/application/application-common.js.map +1 -1
- package/application/application.android.d.ts +17 -1
- package/application/application.android.js +6 -5
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +0 -9
- package/application/application.ios.d.ts +18 -2
- package/application/application.ios.js +169 -16
- package/application/application.ios.js.map +1 -1
- package/color/index.d.ts +0 -5
- package/config/config.interface.d.ts +6 -0
- package/core-types/index.d.ts +2 -2
- package/css/CSS3Parser.js +3 -2
- package/css/CSS3Parser.js.map +1 -1
- package/data/observable/index.js +37 -9
- package/data/observable/index.js.map +1 -1
- package/debugger/dom-types.js +31 -1
- package/debugger/dom-types.js.map +1 -1
- package/fetch/index.mjs +2 -2
- package/file-system/file-system-access.ios.js +18 -10
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +3 -3
- package/global-types.d.ts +0 -1
- package/globals/index.js +4 -1
- package/globals/index.js.map +1 -1
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js.map +1 -1
- package/http/http-request-internal/index.android.d.ts +7 -1
- package/http/http-request-internal/index.android.js.map +1 -1
- package/http/http-request-internal/index.ios.d.ts +7 -1
- package/http/http-request-internal/index.ios.js.map +1 -1
- package/image-source/index.android.d.ts +0 -1
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.d.ts +0 -5
- package/image-source/index.ios.d.ts +0 -1
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +1 -0
- package/inspector_modules.js +1 -1
- package/inspector_modules.js.map +1 -1
- package/package.json +4 -6
- package/platform/common.d.ts +0 -2
- package/platform/common.js +0 -2
- package/platform/common.js.map +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +14 -14
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/Resources/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +1 -1
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +1 -1
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
- package/references.d.ts +0 -4
- package/trace/index.d.ts +2 -2
- package/ui/action-bar/action-bar-common.js +0 -1
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.ios.js +0 -1
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +1 -1
- package/ui/builder/index.d.ts +0 -1
- package/ui/builder/index.js +10 -3
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.d.ts +2 -9
- package/ui/button/index.android.js +7 -24
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.d.ts +2 -9
- package/ui/button/index.ios.js +17 -72
- package/ui/button/index.ios.js.map +1 -1
- package/ui/core/bindable/index.js +2 -1
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/property-shared.js +11 -2
- package/ui/core/properties/property-shared.js.map +1 -1
- package/ui/core/view/index.android.d.ts +1 -0
- package/ui/core/view/index.android.js +39 -10
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +33 -1
- package/ui/core/view/index.ios.d.ts +1 -0
- package/ui/core/view/index.ios.js +28 -6
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +18 -2
- package/ui/core/view/view-common.js +48 -6
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +1 -0
- package/ui/core/view/view-helper/index.ios.d.ts +10 -0
- package/ui/core/view/view-helper/index.ios.js +33 -5
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +21 -3
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.d.ts +37 -18
- package/ui/core/view-base/index.js +98 -65
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +13 -13
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +2 -1
- package/ui/frame/frame-common.js +2 -2
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-helper-for-android.d.ts +4 -4
- package/ui/frame/frame-helper-for-android.js +29 -11
- package/ui/frame/frame-helper-for-android.js.map +1 -1
- package/ui/frame/index.android.d.ts +6 -11
- package/ui/frame/index.android.js +46 -59
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +12 -21
- package/ui/frame/index.ios.d.ts +2 -2
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/image/image-common.js +1 -1
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +13 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/label/index.ios.d.ts +2 -5
- package/ui/label/index.ios.js +12 -44
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/index.ios.js +3 -0
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js +3 -0
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +9 -17
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +11 -64
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.d.ts +5 -0
- package/ui/layouts/flexbox-layout/index.android.js +15 -0
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.d.ts +19 -1
- package/ui/layouts/flexbox-layout/index.ios.d.ts +2 -0
- package/ui/layouts/flexbox-layout/index.ios.js +244 -193
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +3 -0
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.d.ts +1 -0
- package/ui/layouts/layout-base-common.js +21 -0
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.d.ts +3 -10
- package/ui/layouts/layout-base.android.js +7 -24
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +3 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js +3 -0
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/list-view/index.android.js +3 -2
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +13 -1
- package/ui/list-view/index.ios.d.ts +5 -3
- package/ui/list-view/index.ios.js +63 -27
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +15 -0
- package/ui/list-view/list-view-common.js +19 -0
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.d.ts +1 -0
- package/ui/page/index.android.js +4 -0
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.d.ts +3 -1
- package/ui/page/index.ios.js +23 -6
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +5 -2
- package/ui/page/page-common.js.map +1 -1
- package/ui/repeater/index.d.ts +2 -1
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.d.ts +11 -0
- package/ui/scroll-view/index.ios.d.ts +3 -1
- package/ui/scroll-view/index.ios.js +28 -8
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +6 -0
- package/ui/scroll-view/scroll-view-common.js +8 -0
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.d.ts +5 -1
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/styling/css-selector.d.ts +20 -5
- package/ui/styling/css-selector.js +134 -28
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/font.d.ts +0 -4
- package/ui/styling/style/index.d.ts +6 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +5 -0
- package/ui/styling/style-properties.js +157 -95
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +9 -1
- package/ui/styling/style-scope.js +41 -16
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.ios.js +2 -1
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.d.ts +3 -1
- package/ui/tab-view/index.android.js +56 -46
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.d.ts +10 -1
- package/ui/tab-view/index.ios.js +22 -4
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.d.ts +6 -1
- package/ui/tab-view/tab-view-common.js +12 -3
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/index.android.d.ts +3 -10
- package/ui/text-base/index.android.js +15 -32
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +5 -3
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-field/index.ios.d.ts +2 -9
- package/ui/text-field/index.ios.js +2 -23
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.d.ts +2 -9
- package/ui/text-view/index.ios.js +20 -72
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/transition/index.d.ts +2 -1
- package/ui/transition/modal-transition.ios.js +33 -5
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.ios.d.ts +5 -0
- package/ui/transition/page-transition.ios.js +296 -33
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.d.ts +3 -0
- package/ui/transition/shared-transition-helper.android.js +9 -0
- package/ui/transition/shared-transition-helper.android.js.map +1 -1
- package/ui/transition/shared-transition-helper.d.ts +7 -0
- package/ui/transition/shared-transition-helper.ios.d.ts +36 -0
- package/ui/transition/shared-transition-helper.ios.js +765 -89
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.d.ts +67 -0
- package/ui/transition/shared-transition.js +62 -2
- package/ui/transition/shared-transition.js.map +1 -1
- package/utils/debug-source.js +0 -3
- package/utils/debug-source.js.map +1 -1
- package/utils/layout-helper/index.ios.js +11 -3
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/native-helper.android.d.ts +66 -2
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.ios.d.ts +105 -2
- package/utils/native-helper.ios.js +15 -4
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/native-helper.types.d.ts +2 -0
- package/utils/platform-check.d.ts +1 -1
- package/utils/platform-check.js.map +1 -1
- package/animation-frame/animation-native.windows.d.ts +0 -1
- package/animation-frame/animation-native.windows.js +0 -4
- package/animation-frame/animation-native.windows.js.map +0 -1
- package/application/application.windows.d.ts +0 -27
- package/application/application.windows.js +0 -331
- package/application/application.windows.js.map +0 -1
- package/application/helpers.windows.d.ts +0 -8
- package/application/helpers.windows.js +0 -12
- package/application/helpers.windows.js.map +0 -1
- package/application/index.windows.d.ts +0 -2
- package/application/index.windows.js +0 -3
- package/application/index.windows.js.map +0 -1
- package/application/window-helper.windows.d.ts +0 -29
- package/application/window-helper.windows.js +0 -159
- package/application/window-helper.windows.js.map +0 -1
- package/application-settings/index.windows.d.ts +0 -11
- package/application-settings/index.windows.js +0 -93
- package/application-settings/index.windows.js.map +0 -1
- package/color/index.windows.d.ts +0 -8
- package/color/index.windows.js +0 -19
- package/color/index.windows.js.map +0 -1
- package/connectivity/index.windows.d.ts +0 -11
- package/connectivity/index.windows.js +0 -50
- package/connectivity/index.windows.js.map +0 -1
- package/debugger/webinspector-network.windows.d.ts +0 -79
- package/debugger/webinspector-network.windows.js +0 -307
- package/debugger/webinspector-network.windows.js.map +0 -1
- package/file-system/file-system-access.windows.d.ts +0 -76
- package/file-system/file-system-access.windows.js +0 -476
- package/file-system/file-system-access.windows.js.map +0 -1
- package/fps-meter/fps-native.windows.d.ts +0 -8
- package/fps-meter/fps-native.windows.js +0 -40
- package/fps-meter/fps-native.windows.js.map +0 -1
- package/http/http-request/index.windows.d.ts +0 -2
- package/http/http-request/index.windows.js +0 -41
- package/http/http-request/index.windows.js.map +0 -1
- package/http/http-request-internal/index.windows.d.ts +0 -4
- package/http/http-request-internal/index.windows.js +0 -134
- package/http/http-request-internal/index.windows.js.map +0 -1
- package/image-asset/index.windows.d.ts +0 -9
- package/image-asset/index.windows.js +0 -34
- package/image-asset/index.windows.js.map +0 -1
- package/image-source/index.windows.d.ts +0 -52
- package/image-source/index.windows.js +0 -498
- package/image-source/index.windows.js.map +0 -1
- package/platform/device/index.windows.d.ts +0 -18
- package/platform/device/index.windows.js +0 -94
- package/platform/device/index.windows.js.map +0 -1
- package/platform/screen/index.windows.d.ts +0 -13
- package/platform/screen/index.windows.js +0 -25
- package/platform/screen/index.windows.js.map +0 -1
- package/platforms/windows/arm64/NativeScript.Widgets.dll +0 -0
- package/platforms/windows/arm64/NativeScript.Widgets.winmd +0 -0
- package/platforms/windows/x64/NativeScript.Widgets.dll +0 -0
- package/platforms/windows/x64/NativeScript.Widgets.winmd +0 -0
- package/plugin.props +0 -12
- package/plugin.targets +0 -71
- package/text/index.windows.d.ts +0 -9
- package/text/index.windows.js +0 -12
- package/text/index.windows.js.map +0 -1
- package/timer/index.windows.d.ts +0 -4
- package/timer/index.windows.js +0 -14
- package/timer/index.windows.js.map +0 -1
- package/ui/action-bar/index.windows.d.ts +0 -12
- package/ui/action-bar/index.windows.js +0 -36
- package/ui/action-bar/index.windows.js.map +0 -1
- package/ui/activity-indicator/index.windows.d.ts +0 -15
- package/ui/activity-indicator/index.windows.js +0 -65
- package/ui/activity-indicator/index.windows.js.map +0 -1
- package/ui/animation/index.windows.d.ts +0 -19
- package/ui/animation/index.windows.js +0 -603
- package/ui/animation/index.windows.js.map +0 -1
- package/ui/button/index.windows.d.ts +0 -13
- package/ui/button/index.windows.js +0 -73
- package/ui/button/index.windows.js.map +0 -1
- package/ui/core/control-state-change/index.windows.d.ts +0 -4
- package/ui/core/control-state-change/index.windows.js +0 -6
- package/ui/core/control-state-change/index.windows.js.map +0 -1
- package/ui/core/view/index.windows.d.ts +0 -120
- package/ui/core/view/index.windows.js +0 -2178
- package/ui/core/view/index.windows.js.map +0 -1
- package/ui/core/view/view-helper/index.windows.d.ts +0 -3
- package/ui/core/view/view-helper/index.windows.js +0 -4
- package/ui/core/view/view-helper/index.windows.js.map +0 -1
- package/ui/date-picker/index.windows.d.ts +0 -22
- package/ui/date-picker/index.windows.js +0 -97
- package/ui/date-picker/index.windows.js.map +0 -1
- package/ui/dialogs/index.windows.d.ts +0 -17
- package/ui/dialogs/index.windows.js +0 -471
- package/ui/dialogs/index.windows.js.map +0 -1
- package/ui/editable-text-base/index.windows.d.ts +0 -27
- package/ui/editable-text-base/index.windows.js +0 -165
- package/ui/editable-text-base/index.windows.js.map +0 -1
- package/ui/embedding/index.windows.d.ts +0 -1
- package/ui/embedding/index.windows.js +0 -4
- package/ui/embedding/index.windows.js.map +0 -1
- package/ui/frame/index.windows.d.ts +0 -52
- package/ui/frame/index.windows.js +0 -778
- package/ui/frame/index.windows.js.map +0 -1
- package/ui/gestures/index.windows.d.ts +0 -35
- package/ui/gestures/index.windows.js +0 -483
- package/ui/gestures/index.windows.js.map +0 -1
- package/ui/html-view/index.windows.d.ts +0 -18
- package/ui/html-view/index.windows.js +0 -191
- package/ui/html-view/index.windows.js.map +0 -1
- package/ui/image/index.windows.d.ts +0 -17
- package/ui/image/index.windows.js +0 -132
- package/ui/image/index.windows.js.map +0 -1
- package/ui/image/symbol-effects.windows.d.ts +0 -5
- package/ui/image/symbol-effects.windows.js +0 -8
- package/ui/image/symbol-effects.windows.js.map +0 -1
- package/ui/image-cache/index.windows.d.ts +0 -11
- package/ui/image-cache/index.windows.js +0 -48
- package/ui/image-cache/index.windows.js.map +0 -1
- package/ui/label/index.windows.d.ts +0 -15
- package/ui/label/index.windows.js +0 -66
- package/ui/label/index.windows.js.map +0 -1
- package/ui/layouts/absolute-layout/index.windows.d.ts +0 -8
- package/ui/layouts/absolute-layout/index.windows.js +0 -47
- package/ui/layouts/absolute-layout/index.windows.js.map +0 -1
- package/ui/layouts/dock-layout/index.windows.d.ts +0 -19
- package/ui/layouts/dock-layout/index.windows.js +0 -202
- package/ui/layouts/dock-layout/index.windows.js.map +0 -1
- package/ui/layouts/flexbox-layout/index.windows.d.ts +0 -27
- package/ui/layouts/flexbox-layout/index.windows.js +0 -188
- package/ui/layouts/flexbox-layout/index.windows.js.map +0 -1
- package/ui/layouts/grid-layout/index.windows.d.ts +0 -20
- package/ui/layouts/grid-layout/index.windows.js +0 -130
- package/ui/layouts/grid-layout/index.windows.js.map +0 -1
- package/ui/layouts/layout-base.windows.d.ts +0 -4
- package/ui/layouts/layout-base.windows.js +0 -5
- package/ui/layouts/layout-base.windows.js.map +0 -1
- package/ui/layouts/liquid-glass/index.windows.d.ts +0 -4
- package/ui/layouts/liquid-glass/index.windows.js +0 -5
- package/ui/layouts/liquid-glass/index.windows.js.map +0 -1
- package/ui/layouts/liquid-glass-container/index.windows.d.ts +0 -4
- package/ui/layouts/liquid-glass-container/index.windows.js +0 -5
- package/ui/layouts/liquid-glass-container/index.windows.js.map +0 -1
- package/ui/layouts/root-layout/index.windows.d.ts +0 -13
- package/ui/layouts/root-layout/index.windows.js +0 -160
- package/ui/layouts/root-layout/index.windows.js.map +0 -1
- package/ui/layouts/stack-layout/index.windows.d.ts +0 -13
- package/ui/layouts/stack-layout/index.windows.js +0 -63
- package/ui/layouts/stack-layout/index.windows.js.map +0 -1
- package/ui/layouts/wrap-layout/index.windows.d.ts +0 -20
- package/ui/layouts/wrap-layout/index.windows.js +0 -182
- package/ui/layouts/wrap-layout/index.windows.js.map +0 -1
- package/ui/list-picker/index.windows.d.ts +0 -19
- package/ui/list-picker/index.windows.js +0 -75
- package/ui/list-picker/index.windows.js.map +0 -1
- package/ui/list-view/index.windows.d.ts +0 -60
- package/ui/list-view/index.windows.js +0 -842
- package/ui/list-view/index.windows.js.map +0 -1
- package/ui/page/index.windows.d.ts +0 -12
- package/ui/page/index.windows.js +0 -42
- package/ui/page/index.windows.js.map +0 -1
- package/ui/progress/index.windows.d.ts +0 -20
- package/ui/progress/index.windows.js +0 -65
- package/ui/progress/index.windows.js.map +0 -1
- package/ui/scroll-view/index.windows.d.ts +0 -29
- package/ui/scroll-view/index.windows.js +0 -192
- package/ui/scroll-view/index.windows.js.map +0 -1
- package/ui/search-bar/index.windows.d.ts +0 -19
- package/ui/search-bar/index.windows.js +0 -91
- package/ui/search-bar/index.windows.js.map +0 -1
- package/ui/segmented-bar/index.windows.d.ts +0 -23
- package/ui/segmented-bar/index.windows.js +0 -117
- package/ui/segmented-bar/index.windows.js.map +0 -1
- package/ui/slider/index.windows.d.ts +0 -25
- package/ui/slider/index.windows.js +0 -134
- package/ui/slider/index.windows.js.map +0 -1
- package/ui/split-view/index.windows.d.ts +0 -49
- package/ui/split-view/index.windows.js +0 -549
- package/ui/split-view/index.windows.js.map +0 -1
- package/ui/styling/background.windows.d.ts +0 -2
- package/ui/styling/background.windows.js +0 -2
- package/ui/styling/background.windows.js.map +0 -1
- package/ui/styling/font.windows.d.ts +0 -25
- package/ui/styling/font.windows.js +0 -213
- package/ui/styling/font.windows.js.map +0 -1
- package/ui/switch/index.windows.d.ts +0 -20
- package/ui/switch/index.windows.js +0 -97
- package/ui/switch/index.windows.js.map +0 -1
- package/ui/tab-view/index.windows.d.ts +0 -29
- package/ui/tab-view/index.windows.js +0 -268
- package/ui/tab-view/index.windows.js.map +0 -1
- package/ui/text-base/index.windows.d.ts +0 -47
- package/ui/text-base/index.windows.js +0 -639
- package/ui/text-base/index.windows.js.map +0 -1
- package/ui/text-field/index.windows.d.ts +0 -23
- package/ui/text-field/index.windows.js +0 -186
- package/ui/text-field/index.windows.js.map +0 -1
- package/ui/text-view/index.windows.d.ts +0 -12
- package/ui/text-view/index.windows.js +0 -47
- package/ui/text-view/index.windows.js.map +0 -1
- package/ui/time-picker/index.windows.d.ts +0 -18
- package/ui/time-picker/index.windows.js +0 -77
- package/ui/time-picker/index.windows.js.map +0 -1
- package/ui/transition/fade-transition.windows.d.ts +0 -3
- package/ui/transition/fade-transition.windows.js +0 -4
- package/ui/transition/fade-transition.windows.js.map +0 -1
- package/ui/transition/index.windows.d.ts +0 -20
- package/ui/transition/index.windows.js +0 -30
- package/ui/transition/index.windows.js.map +0 -1
- package/ui/transition/modal-transition.windows.d.ts +0 -3
- package/ui/transition/modal-transition.windows.js +0 -4
- package/ui/transition/modal-transition.windows.js.map +0 -1
- package/ui/transition/page-transition.windows.d.ts +0 -3
- package/ui/transition/page-transition.windows.js +0 -4
- package/ui/transition/page-transition.windows.js.map +0 -1
- package/ui/transition/shared-transition-helper.windows.d.ts +0 -30
- package/ui/transition/shared-transition-helper.windows.js +0 -155
- package/ui/transition/shared-transition-helper.windows.js.map +0 -1
- package/ui/transition/slide-transition.windows.d.ts +0 -3
- package/ui/transition/slide-transition.windows.js +0 -4
- package/ui/transition/slide-transition.windows.js.map +0 -1
- package/ui/utils.windows.d.ts +0 -9
- package/ui/utils.windows.js +0 -21
- package/ui/utils.windows.js.map +0 -1
- package/ui/web-view/index.windows.d.ts +0 -23
- package/ui/web-view/index.windows.js +0 -115
- package/ui/web-view/index.windows.js.map +0 -1
- package/utils/constants.windows.d.ts +0 -2
- package/utils/constants.windows.js +0 -5
- package/utils/constants.windows.js.map +0 -1
- package/utils/index.windows.d.ts +0 -20
- package/utils/index.windows.js +0 -94
- package/utils/index.windows.js.map +0 -1
- package/utils/layout-helper/index.windows.d.ts +0 -25
- package/utils/layout-helper/index.windows.js +0 -74
- package/utils/layout-helper/index.windows.js.map +0 -1
- package/utils/mainthread-helper.windows.d.ts +0 -3
- package/utils/mainthread-helper.windows.js +0 -18
- package/utils/mainthread-helper.windows.js.map +0 -1
- package/utils/native-helper.windows.d.ts +0 -8
- package/utils/native-helper.windows.js +0 -101
- package/utils/native-helper.windows.js.map +0 -1
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { Font as FontBase, parseFontFamily, genericFontFamilies, FontWeight } from './font-common';
|
|
2
|
-
export * from './font-common';
|
|
3
|
-
export const fontFamilyCache = new Map();
|
|
4
|
-
// Maps lowercase font family name / filename stem → ms-appx:///app/fonts/<file>#<face> URI.
|
|
5
|
-
// `score` resolves conflicts when several files share a family (e.g. Muli-*.ttf all expose
|
|
6
|
-
// family "Muli"): exact stem==family match > "regular" styles > anything else.
|
|
7
|
-
const _fontNameToUri = new Map();
|
|
8
|
-
let _scanStarted = false;
|
|
9
|
-
let _scanCompleted = false;
|
|
10
|
-
const _onScanReady = [];
|
|
11
|
-
function _completeScan() {
|
|
12
|
-
if (_scanCompleted)
|
|
13
|
-
return;
|
|
14
|
-
_scanCompleted = true;
|
|
15
|
-
const cbs = _onScanReady.splice(0);
|
|
16
|
-
for (const cb of cbs)
|
|
17
|
-
cb();
|
|
18
|
-
}
|
|
19
|
-
function _registerFont(key, uri, score) {
|
|
20
|
-
const k = key.toLowerCase();
|
|
21
|
-
const existing = _fontNameToUri.get(k);
|
|
22
|
-
if (!existing || score > existing.score) {
|
|
23
|
-
_fontNameToUri.set(k, { uri, score });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
// Scans the app package's app/fonts/ directory once, synchronously, via the C++ FontHelper
|
|
27
|
-
// (DirectWrite font-set enumeration). XAML FontFamily URIs need the font's REAL family name
|
|
28
|
-
// after '#' (Muli-Regular.ttf must be referenced as ...Muli-Regular.ttf#Muli), so each font
|
|
29
|
-
// registers three lookup keys:
|
|
30
|
-
// filename stem → uri#win32Family (matches Android's filename-based lookup)
|
|
31
|
-
// win32 family → uri#win32Family (e.g. "Muli Black")
|
|
32
|
-
// typographic family → uri#typoFamily (e.g. "Muli" — groups all weights)
|
|
33
|
-
function ensureFontsScan() {
|
|
34
|
-
if (_scanStarted)
|
|
35
|
-
return;
|
|
36
|
-
_scanStarted = true;
|
|
37
|
-
try {
|
|
38
|
-
const root = Windows.ApplicationModel.Package.Current.InstalledLocation.Path;
|
|
39
|
-
const listing = NativeScript.Widgets.FontHelper.ScanFontsDirectory(root + '\\app\\fonts');
|
|
40
|
-
const norm = (s) => s.toLowerCase().replace(/[\s_-]/g, '');
|
|
41
|
-
for (const line of String(listing || '').split('\n')) {
|
|
42
|
-
if (!line)
|
|
43
|
-
continue;
|
|
44
|
-
const [fileName, win32Family, typoFamily] = line.split('|');
|
|
45
|
-
if (!fileName)
|
|
46
|
-
continue;
|
|
47
|
-
const stem = fileName.replace(/\.[^.]+$/, '');
|
|
48
|
-
const baseUri = `ms-appx:///app/fonts/${fileName}`;
|
|
49
|
-
const legacy = win32Family || typoFamily || stem;
|
|
50
|
-
// Exact stem↔family match (Pacifico.ttf#Pacifico) outranks "regular" styles
|
|
51
|
-
// (Muli-Regular.ttf for family "Muli"), which outrank Bold/Italic variants.
|
|
52
|
-
// Scored per KEY: Muli-Black.ttf scores 3 for "Muli Black" but only 1 for "Muli",
|
|
53
|
-
// so the plain "Muli" key ends up at Muli-Regular.ttf, not the Black variant.
|
|
54
|
-
const scoreFor = (key) => (norm(stem) === norm(key) ? 3 : (/regular/i.test(stem) ? 2 : 1));
|
|
55
|
-
_registerFont(stem, `${baseUri}#${legacy}`, 3); // stem key is unique per file
|
|
56
|
-
_registerFont(legacy, `${baseUri}#${legacy}`, scoreFor(legacy));
|
|
57
|
-
if (typoFamily && norm(typoFamily) !== norm(legacy)) {
|
|
58
|
-
_registerFont(typoFamily, `${baseUri}#${typoFamily}`, scoreFor(typoFamily));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (_e) { }
|
|
63
|
-
_completeScan();
|
|
64
|
-
}
|
|
65
|
-
export var windows;
|
|
66
|
-
(function (windows) {
|
|
67
|
-
function triggerFontScan() {
|
|
68
|
-
ensureFontsScan();
|
|
69
|
-
}
|
|
70
|
-
windows.triggerFontScan = triggerFontScan;
|
|
71
|
-
function whenFontScanReady(callback) {
|
|
72
|
-
if (_scanCompleted) {
|
|
73
|
-
callback();
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
_onScanReady.push(callback);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
windows.whenFontScanReady = whenFontScanReady;
|
|
80
|
-
})(windows || (windows = {}));
|
|
81
|
-
// CSS generic families → Windows system fonts.
|
|
82
|
-
const _genericFamilyMap = new Map([
|
|
83
|
-
[genericFontFamilies.sansSerif, 'Segoe UI'],
|
|
84
|
-
[genericFontFamilies.serif, 'Times New Roman'],
|
|
85
|
-
[genericFontFamilies.monospace, 'Consolas'],
|
|
86
|
-
[genericFontFamilies.system, 'Segoe UI'],
|
|
87
|
-
['system-ui', 'Segoe UI'],
|
|
88
|
-
]);
|
|
89
|
-
// Resolves one CSS font-family token to a XAML-usable source: app-font URI, system font name,
|
|
90
|
-
// or ms-appx path. Returns null for empty tokens.
|
|
91
|
-
function _resolveFamilyToken(raw) {
|
|
92
|
-
let f = String(raw || '').trim();
|
|
93
|
-
if ((f.startsWith('"') && f.endsWith('"')) || (f.startsWith("'") && f.endsWith("'"))) {
|
|
94
|
-
f = f.substring(1, f.length - 1).trim();
|
|
95
|
-
}
|
|
96
|
-
if (!f)
|
|
97
|
-
return null;
|
|
98
|
-
// NativeScript tilde path: ~/fonts/Foo.ttf#Foo → app/fonts/Foo.ttf#Foo.
|
|
99
|
-
if (f.startsWith('~/')) {
|
|
100
|
-
f = 'app/' + f.substring(2);
|
|
101
|
-
}
|
|
102
|
-
// Strip non-ms-appx URI scheme prefixes (e.g. font://, sys://).
|
|
103
|
-
if (!/^ms-appx/i.test(f)) {
|
|
104
|
-
f = f.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//, '');
|
|
105
|
-
}
|
|
106
|
-
if (f.includes('/') || f.includes('\\')) {
|
|
107
|
-
// Path (with or without #face) — normalise to ms-appx.
|
|
108
|
-
return /^ms-appx/i.test(f) ? f : 'ms-appx:///' + f.replace(/^\/+/, '');
|
|
109
|
-
}
|
|
110
|
-
const generic = _genericFamilyMap.get(f.toLowerCase());
|
|
111
|
-
if (generic)
|
|
112
|
-
return generic;
|
|
113
|
-
// Bare family name: app-packaged font URI when scanned, else system font name.
|
|
114
|
-
return _fontNameToUri.get(f.toLowerCase())?.uri ?? f;
|
|
115
|
-
}
|
|
116
|
-
// Builds the XAML FontFamily source string for a CSS font-family list. XAML FontFamily natively
|
|
117
|
-
// supports comma-separated fallbacks ("ms-appx:///app/fonts/Muli.ttf#Muli, Segoe UI"), so all
|
|
118
|
-
// resolvable candidates are kept in order.
|
|
119
|
-
function _resolveFamilySource(fontFamilyValue) {
|
|
120
|
-
const tokens = parseFontFamily(String(fontFamilyValue || ''));
|
|
121
|
-
const resolved = [];
|
|
122
|
-
for (const token of tokens) {
|
|
123
|
-
const source = _resolveFamilyToken(token);
|
|
124
|
-
if (source && !resolved.includes(source)) {
|
|
125
|
-
resolved.push(source);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return resolved.join(', ');
|
|
129
|
-
}
|
|
130
|
-
function createFontFamilyCandidate(candidate) {
|
|
131
|
-
if (!candidate)
|
|
132
|
-
return null;
|
|
133
|
-
try {
|
|
134
|
-
if (fontFamilyCache.has(candidate)) {
|
|
135
|
-
return fontFamilyCache.get(candidate) ?? null;
|
|
136
|
-
}
|
|
137
|
-
const ff = new Microsoft.UI.Xaml.Media.FontFamily(candidate);
|
|
138
|
-
fontFamilyCache.set(candidate, ff);
|
|
139
|
-
return ff;
|
|
140
|
-
}
|
|
141
|
-
catch (err) {
|
|
142
|
-
fontFamilyCache.set(candidate, null);
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
export function getFontFamilyCached(family) {
|
|
147
|
-
windows.triggerFontScan();
|
|
148
|
-
const source = _resolveFamilySource(family);
|
|
149
|
-
if (!source)
|
|
150
|
-
return null;
|
|
151
|
-
return createFontFamilyCandidate(source);
|
|
152
|
-
}
|
|
153
|
-
export function applyFontFamilyTo(target, fontFamilyValue) {
|
|
154
|
-
if (!target || !fontFamilyValue)
|
|
155
|
-
return;
|
|
156
|
-
const ff = getFontFamilyCached(fontFamilyValue);
|
|
157
|
-
if (ff) {
|
|
158
|
-
try {
|
|
159
|
-
target.FontFamily = ff;
|
|
160
|
-
}
|
|
161
|
-
catch (_e) { }
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
export function clearFontFamilyCache() {
|
|
165
|
-
fontFamilyCache.clear();
|
|
166
|
-
}
|
|
167
|
-
export class Font extends FontBase {
|
|
168
|
-
constructor(family, size, style, weight, scale, variationSettings) {
|
|
169
|
-
super(family, size, style, weight, scale, variationSettings ?? undefined);
|
|
170
|
-
}
|
|
171
|
-
withFontFamily(family) {
|
|
172
|
-
return new Font(family, this.fontSize, this.fontStyle, this.fontWeight, 1, this.fontVariationSettings ?? undefined);
|
|
173
|
-
}
|
|
174
|
-
withFontStyle(style) {
|
|
175
|
-
return new Font(this.fontFamily, this.fontSize, style, this.fontWeight, this.fontScale, this.fontVariationSettings ?? undefined);
|
|
176
|
-
}
|
|
177
|
-
withFontWeight(weight) {
|
|
178
|
-
return new Font(this.fontFamily, this.fontSize, this.fontStyle, weight, this.fontScale, this.fontVariationSettings ?? undefined);
|
|
179
|
-
}
|
|
180
|
-
withFontSize(size) {
|
|
181
|
-
return new Font(this.fontFamily, size, this.fontStyle, this.fontWeight, this.fontScale, this.fontVariationSettings ?? undefined);
|
|
182
|
-
}
|
|
183
|
-
withFontScale(scale) {
|
|
184
|
-
return new Font(this.fontFamily, this.fontSize, this.fontStyle, this.fontWeight, scale, this.fontVariationSettings ?? undefined);
|
|
185
|
-
}
|
|
186
|
-
withFontVariationSettings(variationSettings) {
|
|
187
|
-
return new Font(this.fontFamily, this.fontSize, this.fontStyle, this.fontWeight, this.fontScale, variationSettings ?? undefined);
|
|
188
|
-
}
|
|
189
|
-
getAndroidTypeface() {
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
getWindowsFontDescriptor(defaultFont) {
|
|
193
|
-
const families = parseFontFamily(this.fontFamily);
|
|
194
|
-
const fontSize = this.fontSize ? this.fontSize * (this.fontScale ?? 1) : (defaultFont?.pointSize ?? 0);
|
|
195
|
-
return {
|
|
196
|
-
fontFamily: families,
|
|
197
|
-
fontFamilyNative: getFontFamilyCached(this.fontFamily),
|
|
198
|
-
fontSize,
|
|
199
|
-
fontWeight: this.fontWeight ?? FontWeight.NORMAL,
|
|
200
|
-
fontVariationSettings: this.fontVariationSettings ?? undefined,
|
|
201
|
-
isBold: this.isBold,
|
|
202
|
-
isItalic: this.isItalic,
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
applyWindowsFont(target) {
|
|
206
|
-
applyFontFamilyTo(target, this.fontFamily);
|
|
207
|
-
}
|
|
208
|
-
getUIFont(defaultFont) {
|
|
209
|
-
return undefined;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
Font.default = new Font(undefined, undefined);
|
|
213
|
-
//# sourceMappingURL=font.windows.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"font.windows.js","sourceRoot":"","sources":["../../../../../packages/core/ui/styling/font.windows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAyB,MAAM,eAAe,CAAC;AAG1H,cAAc,eAAe,CAAC;AAG9B,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAqD,CAAC;AAE5F,4FAA4F;AAC5F,2FAA2F;AAC3F,+EAA+E;AAC/E,MAAM,cAAc,GAAG,IAAI,GAAG,EAA0C,CAAC;AACzE,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,MAAM,YAAY,GAAsB,EAAE,CAAC;AAE3C,SAAS,aAAa;IAClB,IAAI,cAAc;Q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AS,CAAC;IACrB,CAAC;;AAvDM,YAAO,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export * from './switch-common';
|
|
2
|
-
import { SwitchBase, checkedProperty, offBackgroundColorProperty } from './switch-common';
|
|
3
|
-
import { colorProperty, backgroundColorProperty, backgroundInternalProperty } from '../styling/style-properties';
|
|
4
|
-
import { Color } from '../../color';
|
|
5
|
-
export declare class Switch extends SwitchBase {
|
|
6
|
-
[checkedProperty.getDefault]: () => boolean;
|
|
7
|
-
[checkedProperty.setNative]: (value: boolean) => void;
|
|
8
|
-
[colorProperty.setNative]: (value: number | Color) => void;
|
|
9
|
-
[backgroundColorProperty.setNative]: (value: number | Color) => void;
|
|
10
|
-
[backgroundInternalProperty.setNative]: (_value: any) => void;
|
|
11
|
-
[offBackgroundColorProperty.setNative]: (value: number | Color) => void;
|
|
12
|
-
nativeViewProtected: Microsoft.UI.Xaml.Controls.ToggleSwitch;
|
|
13
|
-
private _toggledHandler;
|
|
14
|
-
private _windows;
|
|
15
|
-
constructor();
|
|
16
|
-
createNativeView(): Microsoft.UI.Xaml.Controls.ToggleSwitch;
|
|
17
|
-
get windows(): Microsoft.UI.Xaml.Controls.ToggleSwitch;
|
|
18
|
-
initNativeView(): void;
|
|
19
|
-
disposeNativeView(): void;
|
|
20
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
export * from './switch-common';
|
|
2
|
-
import { SwitchBase, checkedProperty, offBackgroundColorProperty } from './switch-common';
|
|
3
|
-
import { colorProperty, backgroundColorProperty, backgroundInternalProperty } from '../styling/style-properties';
|
|
4
|
-
import { Color } from '../../color';
|
|
5
|
-
export class Switch extends SwitchBase {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this._toggledHandler = null;
|
|
9
|
-
// WinRT deferred to createNativeView() — keeps constructor pure-JS.
|
|
10
|
-
}
|
|
11
|
-
createNativeView() {
|
|
12
|
-
this._windows = new Microsoft.UI.Xaml.Controls.ToggleSwitch();
|
|
13
|
-
return this._windows;
|
|
14
|
-
}
|
|
15
|
-
get windows() {
|
|
16
|
-
return this._windows;
|
|
17
|
-
}
|
|
18
|
-
initNativeView() {
|
|
19
|
-
super.initNativeView();
|
|
20
|
-
const that = new WeakRef(this);
|
|
21
|
-
const native = this.nativeViewProtected;
|
|
22
|
-
// Toggled is a generic TypedEventHandler<ToggleSwitch, RoutedEventArgs> — the runtime can't derive
|
|
23
|
-
// the parameterized GUID from a plain assignment, so build via asDelegate (can throw; keep guarded).
|
|
24
|
-
const handler = (s) => {
|
|
25
|
-
const owner = that.deref();
|
|
26
|
-
if (!owner)
|
|
27
|
-
return;
|
|
28
|
-
checkedProperty.nativeValueChange(owner, s.IsOn ?? false);
|
|
29
|
-
};
|
|
30
|
-
this._toggledHandler = handler;
|
|
31
|
-
try {
|
|
32
|
-
const typeName = 'Windows.Foundation.TypedEventHandler`2<Microsoft.UI.Xaml.Controls.ToggleSwitch,Microsoft.UI.Xaml.RoutedEventArgs>';
|
|
33
|
-
native.Toggled = NSWinRT.asDelegate(typeName, handler);
|
|
34
|
-
}
|
|
35
|
-
catch (_e) {
|
|
36
|
-
native.Toggled = handler;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
disposeNativeView() {
|
|
40
|
-
const native = this.nativeViewProtected;
|
|
41
|
-
if (native && this._toggledHandler) {
|
|
42
|
-
native.Toggled = null;
|
|
43
|
-
this._toggledHandler = null;
|
|
44
|
-
}
|
|
45
|
-
super.disposeNativeView();
|
|
46
|
-
}
|
|
47
|
-
[checkedProperty.getDefault]() {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
[checkedProperty.setNative](value) {
|
|
51
|
-
if (this.nativeViewProtected) {
|
|
52
|
-
this.nativeViewProtected.IsOn = !!value;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
[colorProperty.setNative](value) {
|
|
56
|
-
if (!this.nativeViewProtected)
|
|
57
|
-
return;
|
|
58
|
-
const resources = this.nativeViewProtected.Resources;
|
|
59
|
-
if (value instanceof Color) {
|
|
60
|
-
const color = new Microsoft.UI.Xaml.Media.SolidColorBrush(value.windows);
|
|
61
|
-
resources.Insert('ToggleSwitchKnobFillOn', color);
|
|
62
|
-
resources.Insert('ToggleSwitchKnobFillOff', color);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
resources.Remove('ToggleSwitchKnobFillOn');
|
|
66
|
-
resources.Remove('ToggleSwitchKnobFillOff');
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
[backgroundColorProperty.setNative](value) {
|
|
70
|
-
if (!this.nativeViewProtected)
|
|
71
|
-
return;
|
|
72
|
-
if (!this.offBackgroundColor || this.checked) {
|
|
73
|
-
const resources = this.nativeViewProtected.Resources;
|
|
74
|
-
if (value instanceof Color) {
|
|
75
|
-
resources.Insert('ToggleSwitchFillOn', new Microsoft.UI.Xaml.Media.SolidColorBrush(value.windows));
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
resources.Remove('ToggleSwitchFillOn');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
[backgroundInternalProperty.setNative](_value) { }
|
|
83
|
-
[offBackgroundColorProperty.setNative](value) {
|
|
84
|
-
if (!this.nativeViewProtected)
|
|
85
|
-
return;
|
|
86
|
-
if (!this.checked) {
|
|
87
|
-
const resources = this.nativeViewProtected.Resources;
|
|
88
|
-
if (value instanceof Color) {
|
|
89
|
-
resources.Insert('ToggleSwitchFillOff', new Microsoft.UI.Xaml.Media.SolidColorBrush(value.windows));
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
resources.Remove('ToggleSwitchFillOff');
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=index.windows.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":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';
|
|
2
|
-
import { TabViewBase, TabViewItemBase } from './tab-view-common';
|
|
3
|
-
export declare class TabViewItem extends TabViewItemBase {
|
|
4
|
-
_update(): void;
|
|
5
|
-
}
|
|
6
|
-
export declare class TabView extends TabViewBase {
|
|
7
|
-
nativeViewProtected: Microsoft.UI.Xaml.Controls.Grid;
|
|
8
|
-
private _outerGrid;
|
|
9
|
-
private _tabStrip;
|
|
10
|
-
private _contentArea;
|
|
11
|
-
private _tabButtons;
|
|
12
|
-
private _tabButtonDelegates;
|
|
13
|
-
createNativeView(): Microsoft.UI.Xaml.Controls.Grid;
|
|
14
|
-
get windows(): Microsoft.UI.Xaml.Controls.Grid;
|
|
15
|
-
_addChildFromBuilder(name: string, value: any): void;
|
|
16
|
-
initNativeView(): void;
|
|
17
|
-
onItemsChanged(oldItems: any[], newItems: any[]): void;
|
|
18
|
-
onLoaded(): void;
|
|
19
|
-
onSelectedIndexChanged(oldIndex: number, newIndex: number): void;
|
|
20
|
-
disposeNativeView(): void;
|
|
21
|
-
_updateTabButton(item: TabViewItemBase): void;
|
|
22
|
-
private _buildButtonContent;
|
|
23
|
-
private _rebuildTabStrip;
|
|
24
|
-
private _createTabButton;
|
|
25
|
-
private _clearTabButtons;
|
|
26
|
-
private _clearContent;
|
|
27
|
-
private _showContent;
|
|
28
|
-
private _highlightTab;
|
|
29
|
-
}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
export * from './tab-view-common';
|
|
2
|
-
import { TabViewBase, TabViewItemBase } from './tab-view-common';
|
|
3
|
-
import { ImageSource } from '../../image-source';
|
|
4
|
-
import { knownFolders, path as fsPath } from '../../file-system';
|
|
5
|
-
const TAB_HEIGHT = 48;
|
|
6
|
-
// Resolves a tab `iconSource` (res://, ~/, file/abs path, http(s)) to a native bitmap and applies it.
|
|
7
|
-
function resolveIconBitmap(src, apply) {
|
|
8
|
-
if (!src)
|
|
9
|
-
return;
|
|
10
|
-
try {
|
|
11
|
-
if (src.indexOf('res://') === 0) {
|
|
12
|
-
const imgSrc = ImageSource.fromResourceSync(src.substring('res://'.length));
|
|
13
|
-
if (imgSrc?.windows)
|
|
14
|
-
apply(imgSrc.windows);
|
|
15
|
-
}
|
|
16
|
-
else if (src.indexOf('~/') === 0) {
|
|
17
|
-
const filePath = fsPath.join(knownFolders.currentApp().path, src.replace('~/', ''));
|
|
18
|
-
const imgSrc = ImageSource.fromFileSync(filePath);
|
|
19
|
-
if (imgSrc?.windows)
|
|
20
|
-
apply(imgSrc.windows);
|
|
21
|
-
}
|
|
22
|
-
else if (src.indexOf('http') === 0) {
|
|
23
|
-
ImageSource.fromUrl(src).then((imgSrc) => { if (imgSrc?.windows)
|
|
24
|
-
apply(imgSrc.windows); }).catch(() => { });
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
const imgSrc = ImageSource.fromFileSync(src);
|
|
28
|
-
if (imgSrc?.windows)
|
|
29
|
-
apply(imgSrc.windows);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch (_e) { }
|
|
33
|
-
}
|
|
34
|
-
export class TabViewItem extends TabViewItemBase {
|
|
35
|
-
_update() {
|
|
36
|
-
const parent = this.parent;
|
|
37
|
-
if (!parent)
|
|
38
|
-
return;
|
|
39
|
-
parent._updateTabButton(this);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export class TabView extends TabViewBase {
|
|
43
|
-
constructor() {
|
|
44
|
-
super(...arguments);
|
|
45
|
-
this._tabButtons = [];
|
|
46
|
-
// Held to prevent V8 from GC'ing the JS wrappers (a collected delegate goes dead on click).
|
|
47
|
-
this._tabButtonDelegates = [];
|
|
48
|
-
}
|
|
49
|
-
createNativeView() {
|
|
50
|
-
this._outerGrid = new Microsoft.UI.Xaml.Controls.Grid();
|
|
51
|
-
const r0 = new Microsoft.UI.Xaml.Controls.RowDefinition();
|
|
52
|
-
r0.Height = { Value: 1, GridUnitType: Microsoft.UI.Xaml.GridUnitType.Auto };
|
|
53
|
-
const r1 = new Microsoft.UI.Xaml.Controls.RowDefinition();
|
|
54
|
-
r1.Height = { Value: 1, GridUnitType: Microsoft.UI.Xaml.GridUnitType.Star };
|
|
55
|
-
this._outerGrid.RowDefinitions.Append(r0);
|
|
56
|
-
this._outerGrid.RowDefinitions.Append(r1);
|
|
57
|
-
this._tabStrip = new Microsoft.UI.Xaml.Controls.StackPanel();
|
|
58
|
-
this._tabStrip.Orientation = Microsoft.UI.Xaml.Controls.Orientation.Horizontal;
|
|
59
|
-
Microsoft.UI.Xaml.Controls.Grid.SetRow(this._tabStrip, 0);
|
|
60
|
-
this._outerGrid.Children.Append(this._tabStrip);
|
|
61
|
-
this._contentArea = new Microsoft.UI.Xaml.Controls.Grid();
|
|
62
|
-
Microsoft.UI.Xaml.Controls.Grid.SetRow(this._contentArea, 1);
|
|
63
|
-
this._outerGrid.Children.Append(this._contentArea);
|
|
64
|
-
return this._outerGrid;
|
|
65
|
-
}
|
|
66
|
-
get windows() {
|
|
67
|
-
return this._outerGrid;
|
|
68
|
-
}
|
|
69
|
-
_addChildFromBuilder(name, value) {
|
|
70
|
-
if (value instanceof TabViewItemBase) {
|
|
71
|
-
value.canBeLoaded = true;
|
|
72
|
-
}
|
|
73
|
-
super._addChildFromBuilder(name, value);
|
|
74
|
-
if (value instanceof TabViewItemBase) {
|
|
75
|
-
this._rebuildTabStrip();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
initNativeView() {
|
|
79
|
-
super.initNativeView();
|
|
80
|
-
this._rebuildTabStrip();
|
|
81
|
-
}
|
|
82
|
-
onItemsChanged(oldItems, newItems) {
|
|
83
|
-
this._clearTabButtons();
|
|
84
|
-
if (this._tabStrip)
|
|
85
|
-
this._tabStrip.Children.Clear();
|
|
86
|
-
this._clearContent();
|
|
87
|
-
if (newItems) {
|
|
88
|
-
for (const item of newItems) {
|
|
89
|
-
item.canBeLoaded = true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
super.onItemsChanged(oldItems, newItems);
|
|
93
|
-
if (!newItems)
|
|
94
|
-
return;
|
|
95
|
-
this._rebuildTabStrip();
|
|
96
|
-
if (this.isLoaded) {
|
|
97
|
-
this._showContent(Math.max(0, this.selectedIndex ?? 0));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
onLoaded() {
|
|
101
|
-
super.onLoaded();
|
|
102
|
-
this._clearContent();
|
|
103
|
-
const idx = Math.max(0, this.selectedIndex ?? 0);
|
|
104
|
-
this._showContent(idx);
|
|
105
|
-
this._highlightTab(idx);
|
|
106
|
-
}
|
|
107
|
-
onSelectedIndexChanged(oldIndex, newIndex) {
|
|
108
|
-
super.onSelectedIndexChanged(oldIndex, newIndex);
|
|
109
|
-
this._clearContent();
|
|
110
|
-
this._showContent(newIndex);
|
|
111
|
-
this._highlightTab(newIndex);
|
|
112
|
-
}
|
|
113
|
-
disposeNativeView() {
|
|
114
|
-
this._clearTabButtons();
|
|
115
|
-
super.disposeNativeView();
|
|
116
|
-
}
|
|
117
|
-
_updateTabButton(item) {
|
|
118
|
-
if (!this.items)
|
|
119
|
-
return;
|
|
120
|
-
const idx = this.items.indexOf(item);
|
|
121
|
-
if (idx >= 0 && idx < this._tabButtons.length) {
|
|
122
|
-
this._tabButtons[idx].Content = this._buildButtonContent(item);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// WinUI Button shows only its string Content unless given a UIElement, so an icon-only tab
|
|
126
|
-
// needs an Image element; if both title and icon are present they are stacked vertically.
|
|
127
|
-
_buildButtonContent(item) {
|
|
128
|
-
const title = item?.title ?? '';
|
|
129
|
-
const iconSrc = item?.iconSource;
|
|
130
|
-
if (!iconSrc) {
|
|
131
|
-
return title;
|
|
132
|
-
}
|
|
133
|
-
const img = new Microsoft.UI.Xaml.Controls.Image();
|
|
134
|
-
img.Width = 24;
|
|
135
|
-
img.Height = 24;
|
|
136
|
-
img.Stretch = 2; // Uniform
|
|
137
|
-
resolveIconBitmap(iconSrc, (bmp) => { try {
|
|
138
|
-
img.Source = bmp;
|
|
139
|
-
}
|
|
140
|
-
catch (_e) { } });
|
|
141
|
-
if (!title) {
|
|
142
|
-
return img;
|
|
143
|
-
}
|
|
144
|
-
const stack = new Microsoft.UI.Xaml.Controls.StackPanel();
|
|
145
|
-
stack.Orientation = Microsoft.UI.Xaml.Controls.Orientation.Vertical;
|
|
146
|
-
stack.HorizontalAlignment = 1; // Center
|
|
147
|
-
const tb = new Microsoft.UI.Xaml.Controls.TextBlock();
|
|
148
|
-
tb.Text = title;
|
|
149
|
-
tb.FontSize = 12;
|
|
150
|
-
tb.HorizontalAlignment = 1; // Center
|
|
151
|
-
stack.Children.Append(img);
|
|
152
|
-
stack.Children.Append(tb);
|
|
153
|
-
return stack;
|
|
154
|
-
}
|
|
155
|
-
_rebuildTabStrip() {
|
|
156
|
-
if (!this._tabStrip)
|
|
157
|
-
return;
|
|
158
|
-
this._clearTabButtons();
|
|
159
|
-
this._tabStrip.Children.Clear();
|
|
160
|
-
const items = this.items;
|
|
161
|
-
if (!items)
|
|
162
|
-
return;
|
|
163
|
-
for (let i = 0; i < items.length; i++) {
|
|
164
|
-
this._createTabButton(items[i], i);
|
|
165
|
-
}
|
|
166
|
-
this._highlightTab(Math.max(0, this.selectedIndex ?? 0));
|
|
167
|
-
}
|
|
168
|
-
_createTabButton(item, index) {
|
|
169
|
-
const btn = new Microsoft.UI.Xaml.Controls.Button();
|
|
170
|
-
btn.Content = this._buildButtonContent(item);
|
|
171
|
-
btn.MinWidth = 80;
|
|
172
|
-
btn.Height = TAB_HEIGHT;
|
|
173
|
-
const that = new WeakRef(this);
|
|
174
|
-
const fn = () => {
|
|
175
|
-
const owner = that.deref();
|
|
176
|
-
if (owner)
|
|
177
|
-
owner.selectedIndex = index;
|
|
178
|
-
};
|
|
179
|
-
const del = NSWinRT.asDelegate('Microsoft.UI.Xaml.RoutedEventHandler', fn);
|
|
180
|
-
btn.Click = del;
|
|
181
|
-
this._tabButtonDelegates[index] = del;
|
|
182
|
-
this._tabButtons[index] = btn;
|
|
183
|
-
this._tabStrip.Children.Append(btn);
|
|
184
|
-
}
|
|
185
|
-
_clearTabButtons() {
|
|
186
|
-
for (const btn of this._tabButtons) {
|
|
187
|
-
if (btn)
|
|
188
|
-
btn.Click = null;
|
|
189
|
-
}
|
|
190
|
-
this._tabButtons = [];
|
|
191
|
-
this._tabButtonDelegates = [];
|
|
192
|
-
}
|
|
193
|
-
_clearContent() {
|
|
194
|
-
if (!this._contentArea)
|
|
195
|
-
return;
|
|
196
|
-
const children = this._contentArea.Children;
|
|
197
|
-
for (let i = children.Size - 1; i >= 0; i--) {
|
|
198
|
-
try {
|
|
199
|
-
children.RemoveAt(i);
|
|
200
|
-
}
|
|
201
|
-
catch (_e) { }
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
_showContent(index) {
|
|
205
|
-
if (!this._contentArea)
|
|
206
|
-
return;
|
|
207
|
-
const items = this.items;
|
|
208
|
-
if (!items || index < 0 || index >= items.length)
|
|
209
|
-
return;
|
|
210
|
-
const item = items[index];
|
|
211
|
-
const view = item?.view;
|
|
212
|
-
const native = view?.nativeViewProtected;
|
|
213
|
-
if (native) {
|
|
214
|
-
try {
|
|
215
|
-
native.HorizontalAlignment = 3; // Stretch
|
|
216
|
-
native.VerticalAlignment = 3; // Stretch
|
|
217
|
-
this._contentArea.Children.Append(native);
|
|
218
|
-
}
|
|
219
|
-
catch (_e) {
|
|
220
|
-
console.error('[TabView] _showContent: failed to append native view for tab', index, _e);
|
|
221
|
-
}
|
|
222
|
-
// Ensure the NS view is marked loaded so Repeaters flush _isDirty and bindings
|
|
223
|
-
// propagate. super.onLoaded() loads all tabs, but if something races (e.g. items
|
|
224
|
-
// set after the first load), this guarantees the shown view is always live.
|
|
225
|
-
if (view && !view.isLoaded) {
|
|
226
|
-
try {
|
|
227
|
-
view.callLoaded?.();
|
|
228
|
-
}
|
|
229
|
-
catch (_e) { }
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
else if (!native) {
|
|
233
|
-
// nativeViewProtected not yet created — defer until after the layout pass.
|
|
234
|
-
setTimeout(() => {
|
|
235
|
-
if (!this._contentArea)
|
|
236
|
-
return;
|
|
237
|
-
const deferred = this.items?.[index]?.view;
|
|
238
|
-
const n = deferred?.nativeViewProtected;
|
|
239
|
-
if (n) {
|
|
240
|
-
try {
|
|
241
|
-
n.HorizontalAlignment = 3;
|
|
242
|
-
n.VerticalAlignment = 3;
|
|
243
|
-
this._clearContent();
|
|
244
|
-
this._contentArea.Children.Append(n);
|
|
245
|
-
}
|
|
246
|
-
catch (_e) { }
|
|
247
|
-
if (deferred && !deferred.isLoaded) {
|
|
248
|
-
try {
|
|
249
|
-
deferred.callLoaded?.();
|
|
250
|
-
}
|
|
251
|
-
catch (_e) { }
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}, 0);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
_highlightTab(selectedIndex) {
|
|
258
|
-
for (let i = 0; i < this._tabButtons.length; i++) {
|
|
259
|
-
const btn = this._tabButtons[i];
|
|
260
|
-
if (!btn)
|
|
261
|
-
continue;
|
|
262
|
-
btn.FontWeight = i === selectedIndex
|
|
263
|
-
? Microsoft.UI.Text.FontWeights.Bold
|
|
264
|
-
: Microsoft.UI.Text.FontWeights.Normal;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
//# sourceMappingURL=index.windows.js.map
|