@umbra.ui/core 0.1.0
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/dist/components/controls/Dropdown/types.d.ts +5 -0
- package/dist/components/controls/Dropdown/types.d.ts.map +1 -0
- package/dist/components/controls/Dropdown/types.js +1 -0
- package/dist/components/controls/SegmentedControl/types.d.ts +6 -0
- package/dist/components/controls/SegmentedControl/types.d.ts.map +1 -0
- package/dist/components/controls/SegmentedControl/types.js +1 -0
- package/dist/components/dialogs/Alert/types.d.ts +7 -0
- package/dist/components/dialogs/Alert/types.d.ts.map +1 -0
- package/dist/components/dialogs/Alert/types.js +1 -0
- package/dist/components/dialogs/Toast/types.d.ts +34 -0
- package/dist/components/dialogs/Toast/types.d.ts.map +1 -0
- package/dist/components/dialogs/Toast/types.js +10 -0
- package/dist/components/dialogs/Toast/useToast.d.ts +36 -0
- package/dist/components/dialogs/Toast/useToast.d.ts.map +1 -0
- package/dist/components/dialogs/Toast/useToast.js +90 -0
- package/dist/components/indicators/Tooltip/tooltip.d.ts +3 -0
- package/dist/components/indicators/Tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/tooltip.js +33 -0
- package/dist/components/indicators/Tooltip/types.d.ts +14 -0
- package/dist/components/indicators/Tooltip/types.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/types.js +1 -0
- package/dist/components/indicators/Tooltip/useTooltip.d.ts +18 -0
- package/dist/components/indicators/Tooltip/useTooltip.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/useTooltip.js +57 -0
- package/dist/components/inputs/Tags/tag-bar-styles.d.ts +14 -0
- package/dist/components/inputs/Tags/tag-bar-styles.d.ts.map +1 -0
- package/dist/components/inputs/Tags/tag-bar-styles.js +313 -0
- package/dist/components/inputs/Tags/types.d.ts +93 -0
- package/dist/components/inputs/Tags/types.d.ts.map +1 -0
- package/dist/components/inputs/Tags/types.js +216 -0
- package/dist/components/inputs/search/types.d.ts +9 -0
- package/dist/components/inputs/search/types.d.ts.map +1 -0
- package/dist/components/inputs/search/types.js +1 -0
- package/dist/components/navigation/adaptive/types.d.ts +16 -0
- package/dist/components/navigation/adaptive/types.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/types.js +1 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts +27 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.js +40 -0
- package/dist/components/navigation/adaptive/useBreakpoints.d.ts +6 -0
- package/dist/components/navigation/adaptive/useBreakpoints.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useBreakpoints.js +37 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.d.ts +93 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.js +145 -0
- package/dist/components/navigation/adaptive/useViewAnimation.d.ts +31 -0
- package/dist/components/navigation/adaptive/useViewAnimation.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useViewAnimation.js +591 -0
- package/dist/components/navigation/adaptive/useViewResize.d.ts +52 -0
- package/dist/components/navigation/adaptive/useViewResize.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useViewResize.js +146 -0
- package/dist/components/navigation/navstack/useNavigationStack.d.ts +25 -0
- package/dist/components/navigation/navstack/useNavigationStack.d.ts.map +1 -0
- package/dist/components/navigation/navstack/useNavigationStack.js +133 -0
- package/dist/components/navigation/slideover/useSlideoverController.d.ts +20 -0
- package/dist/components/navigation/slideover/useSlideoverController.d.ts.map +1 -0
- package/dist/components/navigation/slideover/useSlideoverController.js +267 -0
- package/dist/components/navigation/splitview/useSplitViewController.d.ts +20 -0
- package/dist/components/navigation/splitview/useSplitViewController.d.ts.map +1 -0
- package/dist/components/navigation/splitview/useSplitViewController.js +325 -0
- package/dist/components/navigation/tabcontroller/types.d.ts +21 -0
- package/dist/components/navigation/tabcontroller/types.d.ts.map +1 -0
- package/dist/components/navigation/tabcontroller/types.js +1 -0
- package/dist/components/navigation/tabcontroller/useTabController.d.ts +5 -0
- package/dist/components/navigation/tabcontroller/useTabController.d.ts.map +1 -0
- package/dist/components/navigation/tabcontroller/useTabController.js +10 -0
- package/dist/components/navigation/types.d.ts +8 -0
- package/dist/components/navigation/types.d.ts.map +1 -0
- package/dist/components/navigation/types.js +1 -0
- package/dist/components/pickers/CollectionPicker/types.d.ts +11 -0
- package/dist/components/pickers/CollectionPicker/types.d.ts.map +1 -0
- package/dist/components/pickers/CollectionPicker/types.js +1 -0
- package/dist/components/pickers/ColorPicker/colors.d.ts +13 -0
- package/dist/components/pickers/ColorPicker/colors.d.ts.map +1 -0
- package/dist/components/pickers/ColorPicker/colors.js +266 -0
- package/dist/components/pickers/FilePicker/types.d.ts +10 -0
- package/dist/components/pickers/FilePicker/types.d.ts.map +1 -0
- package/dist/components/pickers/FilePicker/types.js +1 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +196 -0
- package/dist/theme.d.ts +73 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +279 -0
- package/dist/themes/blank.d.ts +7 -0
- package/dist/themes/blank.d.ts.map +1 -0
- package/dist/themes/blank.js +543 -0
- package/dist/themes/crimson-dark.d.ts +4 -0
- package/dist/themes/crimson-dark.d.ts.map +1 -0
- package/dist/themes/crimson-dark.js +552 -0
- package/dist/themes/cyan-light.d.ts +4 -0
- package/dist/themes/cyan-light.d.ts.map +1 -0
- package/dist/themes/cyan-light.js +552 -0
- package/dist/themes/dark.d.ts +4 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +551 -0
- package/dist/themes/gold-dark.d.ts +4 -0
- package/dist/themes/gold-dark.d.ts.map +1 -0
- package/dist/themes/gold-dark.js +552 -0
- package/dist/themes/grass-dark.d.ts +4 -0
- package/dist/themes/grass-dark.d.ts.map +1 -0
- package/dist/themes/grass-dark.js +552 -0
- package/dist/themes/indigo.d.ts +4 -0
- package/dist/themes/indigo.d.ts.map +1 -0
- package/dist/themes/indigo.js +552 -0
- package/dist/themes/light.d.ts +4 -0
- package/dist/themes/light.d.ts.map +1 -0
- package/dist/themes/light.js +551 -0
- package/dist/themes/orange-dark.d.ts +4 -0
- package/dist/themes/orange-dark.d.ts.map +1 -0
- package/dist/themes/orange-dark.js +551 -0
- package/dist/themes/orange-light.d.ts +4 -0
- package/dist/themes/orange-light.d.ts.map +1 -0
- package/dist/themes/orange-light.js +551 -0
- package/package.json +62 -0
- package/src/components/controls/Button/Button.vue +417 -0
- package/src/components/controls/Button/README.md +348 -0
- package/src/components/controls/Button/theme.css +200 -0
- package/src/components/controls/Checkbox/Checkbox.vue +164 -0
- package/src/components/controls/Checkbox/README.md +441 -0
- package/src/components/controls/Checkbox/theme.css +36 -0
- package/src/components/controls/Dropdown/Dropdown.vue +476 -0
- package/src/components/controls/Dropdown/README.md +370 -0
- package/src/components/controls/Dropdown/theme.css +50 -0
- package/src/components/controls/Dropdown/types.ts +6 -0
- package/src/components/controls/IconButton/IconButton.vue +267 -0
- package/src/components/controls/IconButton/README.md +502 -0
- package/src/components/controls/IconButton/theme.css +89 -0
- package/src/components/controls/Radio/README.md +591 -0
- package/src/components/controls/Radio/Radio.vue +89 -0
- package/src/components/controls/Radio/theme.css +14 -0
- package/src/components/controls/RangeSlider/README.md +608 -0
- package/src/components/controls/RangeSlider/RangeSlider.vue +535 -0
- package/src/components/controls/RangeSlider/theme.css +80 -0
- package/src/components/controls/SegmentedControl/README.md +587 -0
- package/src/components/controls/SegmentedControl/SegmentedControl.vue +284 -0
- package/src/components/controls/SegmentedControl/theme.css +60 -0
- package/src/components/controls/SegmentedControl/types.ts +5 -0
- package/src/components/controls/Slider/README.md +627 -0
- package/src/components/controls/Slider/Slider.vue +260 -0
- package/src/components/controls/Slider/theme.css +74 -0
- package/src/components/controls/Stepper/README.md +601 -0
- package/src/components/controls/Stepper/Stepper.vue +103 -0
- package/src/components/controls/Stepper/theme.css +53 -0
- package/src/components/controls/Switch/README.md +667 -0
- package/src/components/controls/Switch/Switch.vue +127 -0
- package/src/components/controls/Switch/theme.css +42 -0
- package/src/components/dialogs/Alert/Alert.vue +218 -0
- package/src/components/dialogs/Alert/README.md +450 -0
- package/src/components/dialogs/Alert/theme.css +44 -0
- package/src/components/dialogs/Alert/types.ts +11 -0
- package/src/components/dialogs/Toast/README.md +522 -0
- package/src/components/dialogs/Toast/Toast.vue +296 -0
- package/src/components/dialogs/Toast/ToastContainer.vue +330 -0
- package/src/components/dialogs/Toast/theme.css +44 -0
- package/src/components/dialogs/Toast/types.ts +46 -0
- package/src/components/dialogs/Toast/useToast.ts +127 -0
- package/src/components/indicators/ProgressBar/ProgressBar.vue +98 -0
- package/src/components/indicators/ProgressBar/README.md +744 -0
- package/src/components/indicators/ProgressBar/theme.css +36 -0
- package/src/components/indicators/Tooltip/README.md +723 -0
- package/src/components/indicators/Tooltip/TooltipProvider.vue +142 -0
- package/src/components/indicators/Tooltip/theme.css +18 -0
- package/src/components/indicators/Tooltip/tooltip.ts +48 -0
- package/src/components/indicators/Tooltip/types.ts +15 -0
- package/src/components/indicators/Tooltip/useTooltip.ts +71 -0
- package/src/components/inputs/AutogrowTextView/AutogrowTextView.vue +110 -0
- package/src/components/inputs/AutogrowTextView/README.md +643 -0
- package/src/components/inputs/AutogrowTextView/theme.css +28 -0
- package/src/components/inputs/InputCard/InputCard.vue +600 -0
- package/src/components/inputs/InputCard/README.md +636 -0
- package/src/components/inputs/InputEmail/InputEmail.vue +698 -0
- package/src/components/inputs/InputEmail/README.md +764 -0
- package/src/components/inputs/InputNumber/InputNumber.vue +300 -0
- package/src/components/inputs/InputNumber/README.md +749 -0
- package/src/components/inputs/InputPhone/InputPhone.vue +645 -0
- package/src/components/inputs/InputPhone/README.md +636 -0
- package/src/components/inputs/InputSecure/InputSecure.vue +646 -0
- package/src/components/inputs/InputSecure/README.md +771 -0
- package/src/components/inputs/InputText/InputText.vue +225 -0
- package/src/components/inputs/InputText/README.md +844 -0
- package/src/components/inputs/OTP/OTP.vue +349 -0
- package/src/components/inputs/OTP/README.md +736 -0
- package/src/components/inputs/OTP/theme.css +50 -0
- package/src/components/inputs/StringCapture/README.md +718 -0
- package/src/components/inputs/StringCapture/StringCapture.vue +315 -0
- package/src/components/inputs/StringCapture/theme.css +86 -0
- package/src/components/inputs/Tags/README.md +897 -0
- package/src/components/inputs/Tags/TagBar.vue +793 -0
- package/src/components/inputs/Tags/TagCreation.vue +219 -0
- package/src/components/inputs/Tags/TagPicker.vue +380 -0
- package/src/components/inputs/Tags/tag-bar-styles.ts +354 -0
- package/src/components/inputs/Tags/theme.css +121 -0
- package/src/components/inputs/Tags/types.ts +346 -0
- package/src/components/inputs/search/README.md +759 -0
- package/src/components/inputs/search/SearchBar.vue +394 -0
- package/src/components/inputs/search/SearchResults.vue +310 -0
- package/src/components/inputs/search/theme.css +187 -0
- package/src/components/inputs/search/types.ts +8 -0
- package/src/components/inputs/theme.css +102 -0
- package/src/components/menus/ActionMenu/ActionMenu.vue +383 -0
- package/src/components/menus/ActionMenu/README.md +825 -0
- package/src/components/menus/ActionMenu/theme.css +93 -0
- package/src/components/models/Popover/Popover.vue +551 -0
- package/src/components/models/Popover/README.md +885 -0
- package/src/components/models/Popover/theme.css +52 -0
- package/src/components/models/Sheet/README.md +1159 -0
- package/src/components/models/Sheet/Sheet.vue +465 -0
- package/src/components/models/Sheet/theme.css +72 -0
- package/src/components/models/Sidebar/README.md +1228 -0
- package/src/components/models/Sidebar/Sidebar.vue +480 -0
- package/src/components/models/Sidebar/theme.css +90 -0
- package/src/components/navigation/adaptive/AdaptiveLayout.vue +779 -0
- package/src/components/navigation/adaptive/AdaptiveLayoutBreadcrumbs.vue +192 -0
- package/src/components/navigation/adaptive/AdaptiveLayoutMenuButton.vue +149 -0
- package/src/components/navigation/adaptive/README.md +768 -0
- package/src/components/navigation/adaptive/types.ts +19 -0
- package/src/components/navigation/adaptive/useAdaptiveLayout.ts +89 -0
- package/src/components/navigation/adaptive/useBreakpoints.ts +41 -0
- package/src/components/navigation/adaptive/useContainerMonitor.ts +214 -0
- package/src/components/navigation/adaptive/useViewAnimation.ts +721 -0
- package/src/components/navigation/adaptive/useViewResize.ts +211 -0
- package/src/components/navigation/navstack/NavigationStack.vue +180 -0
- package/src/components/navigation/navstack/README.md +994 -0
- package/src/components/navigation/navstack/useNavigationStack.ts +164 -0
- package/src/components/navigation/slideover/README.md +1275 -0
- package/src/components/navigation/slideover/SlideoverController.vue +287 -0
- package/src/components/navigation/slideover/useSlideoverController.ts +320 -0
- package/src/components/navigation/splitview/README.md +1115 -0
- package/src/components/navigation/splitview/SplitViewController.vue +176 -0
- package/src/components/navigation/splitview/useSplitViewController.ts +388 -0
- package/src/components/navigation/tabcontroller/README.md +919 -0
- package/src/components/navigation/tabcontroller/TabController.vue +307 -0
- package/src/components/navigation/tabcontroller/TabItem.vue +57 -0
- package/src/components/navigation/tabcontroller/types.ts +24 -0
- package/src/components/navigation/tabcontroller/useTabController.ts +18 -0
- package/src/components/navigation/theme.css +91 -0
- package/src/components/navigation/types.ts +7 -0
- package/src/components/pickers/CollectionPicker/CollectionPicker.vue +398 -0
- package/src/components/pickers/CollectionPicker/README.md +1115 -0
- package/src/components/pickers/CollectionPicker/theme.css +14 -0
- package/src/components/pickers/CollectionPicker/types.ts +11 -0
- package/src/components/pickers/ColorPicker/ColorPicker.vue +376 -0
- package/src/components/pickers/ColorPicker/README.md +1439 -0
- package/src/components/pickers/ColorPicker/colors.ts +299 -0
- package/src/components/pickers/ColorPicker/theme.css +32 -0
- package/src/components/pickers/DatePicker/DatePicker.vue +660 -0
- package/src/components/pickers/DatePicker/README.md +1195 -0
- package/src/components/pickers/DatePicker/theme.css +22 -0
- package/src/components/pickers/FilePicker/FilePicker.vue +534 -0
- package/src/components/pickers/FilePicker/README.md +1542 -0
- package/src/components/pickers/FilePicker/theme.css +48 -0
- package/src/components/pickers/FilePicker/types.ts +10 -0
- package/src/components/pickers/IconPicker/IconPicker.vue +327 -0
- package/src/components/pickers/IconPicker/README.md +1161 -0
- package/src/components/pickers/IconPicker/theme.css +28 -0
- package/src/components/pickers/theme.css +82 -0
- package/src/components/views/MarkdownViewer/MarkdownViewer.vue +442 -0
- package/src/components/views/MarkdownViewer/README.md +833 -0
- package/src/components/views/MarkdownViewer/theme.css +130 -0
- package/src/index.ts +263 -0
- package/src/theme.ts +378 -0
- package/src/themes/crimson-dark.ts +556 -0
- package/src/themes/cyan-light.ts +556 -0
- package/src/themes/dark.ts +557 -0
- package/src/themes/gold-dark.ts +556 -0
- package/src/themes/grass-dark.ts +556 -0
- package/src/themes/indigo.ts +556 -0
- package/src/themes/light.ts +557 -0
- package/src/themes/orange-dark.ts +557 -0
- package/src/themes/orange-light.ts +557 -0
- package/src/vue.d.ts +45 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef } from "vue";
|
|
2
|
+
import type { View, InternalView } from "./types";
|
|
3
|
+
import type { useResponsiveContainer } from "./useContainerMonitor";
|
|
4
|
+
type ResponsiveMonitor = ReturnType<typeof useResponsiveContainer>;
|
|
5
|
+
interface AdaptiveLayoutState {
|
|
6
|
+
views: Ref<InternalView[]>;
|
|
7
|
+
offScreenViewsLeading: ComputedRef<InternalView[]>;
|
|
8
|
+
offScreenViewsTrailing: ComputedRef<InternalView[]>;
|
|
9
|
+
onScreenViews: ComputedRef<InternalView[]>;
|
|
10
|
+
overlayViews: ComputedRef<InternalView[]>;
|
|
11
|
+
monitor: Ref<ResponsiveMonitor | null>;
|
|
12
|
+
methods: {
|
|
13
|
+
add: (view: View, animated?: boolean) => void;
|
|
14
|
+
remove: (id: string, animated?: boolean) => void;
|
|
15
|
+
replace: (id: string, view: View, animated?: boolean) => void;
|
|
16
|
+
show: (id: string, animated?: boolean) => void;
|
|
17
|
+
hide: (id: string, animated?: boolean) => void;
|
|
18
|
+
push: (id: string, animated?: boolean) => void;
|
|
19
|
+
pop: (id: string, animated?: boolean) => void;
|
|
20
|
+
setMethods: (methods: any) => void;
|
|
21
|
+
setMonitor: (monitor: ResponsiveMonitor) => void;
|
|
22
|
+
};
|
|
23
|
+
initialized: Ref<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export declare const useAdaptiveLayoutState: (key?: string | symbol) => AdaptiveLayoutState;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=useAdaptiveLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAdaptiveLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/adaptive/useAdaptiveLayout.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAAG,EACR,KAAK,WAAW,EACjB,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEnE,UAAU,mBAAmB;IAC3B,KAAK,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;IAC3B,qBAAqB,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACnD,sBAAsB,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACpD,aAAa,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IAC3C,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IAC1C,OAAO,EAAE,GAAG,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE;QACP,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QAC9C,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QACjD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QAC9D,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QAC/C,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QAC/C,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QAC/C,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QAC9C,UAAU,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;QACnC,UAAU,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;KAClD,CAAC;IACF,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CAC3B;AAID,eAAO,MAAM,sBAAsB,GAAI,MAAK,MAAM,GAAG,MAAiB,wBAoDrE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ref, computed, reactive, shallowRef, } from "vue";
|
|
2
|
+
const layoutStates = new Map();
|
|
3
|
+
export const useAdaptiveLayoutState = (key = Symbol()) => {
|
|
4
|
+
if (!layoutStates.has(key)) {
|
|
5
|
+
const views = ref([]);
|
|
6
|
+
const initialized = ref(false);
|
|
7
|
+
const monitor = shallowRef(null);
|
|
8
|
+
const offScreenViewsLeading = computed(() => views.value.filter((view) => view.location === "leading"));
|
|
9
|
+
const offScreenViewsTrailing = computed(() => views.value.filter((view) => view.location === "trailing"));
|
|
10
|
+
const onScreenViews = computed(() => views.value.filter((view) => view.location === "onscreen"));
|
|
11
|
+
const overlayViews = computed(() => views.value.filter((view) => view.location === "overlay"));
|
|
12
|
+
const methods = reactive({
|
|
13
|
+
add: () => console.warn("Layout not initialized"),
|
|
14
|
+
remove: () => console.warn("Layout not initialized"),
|
|
15
|
+
replace: () => console.warn("Layout not initialized"),
|
|
16
|
+
show: () => console.warn("Layout not initialized"),
|
|
17
|
+
hide: () => console.warn("Layout not initialized"),
|
|
18
|
+
push: () => console.warn("Layout not initialized"),
|
|
19
|
+
pop: () => console.warn("Layout not initialized"),
|
|
20
|
+
setMethods: (newMethods) => {
|
|
21
|
+
Object.assign(methods, newMethods);
|
|
22
|
+
initialized.value = true;
|
|
23
|
+
},
|
|
24
|
+
setMonitor: (newMonitor) => {
|
|
25
|
+
monitor.value = newMonitor;
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
layoutStates.set(key, {
|
|
29
|
+
views,
|
|
30
|
+
offScreenViewsLeading,
|
|
31
|
+
offScreenViewsTrailing,
|
|
32
|
+
onScreenViews,
|
|
33
|
+
overlayViews,
|
|
34
|
+
monitor,
|
|
35
|
+
methods,
|
|
36
|
+
initialized,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return layoutStates.get(key);
|
|
40
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Ref } from "vue";
|
|
2
|
+
import { InternalView } from "./types";
|
|
3
|
+
export declare const useBreakpoints: (views: Ref<InternalView[]>) => {
|
|
4
|
+
setupForBreakpoint: (oldBreakpoint: string | null, currentBreakpoint: string | null) => void;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=useBreakpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoints.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/adaptive/useBreakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG,CAAC,YAAY,EAAE,CAAC;wCAEtC,MAAM,GAAG,IAAI,qBACT,MAAM,GAAG,IAAI;CAkCnC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const useBreakpoints = (views) => {
|
|
2
|
+
const setupForBreakpoint = (oldBreakpoint, currentBreakpoint) => {
|
|
3
|
+
switch (currentBreakpoint) {
|
|
4
|
+
case "mobile":
|
|
5
|
+
// Mark all views except the 1st one in location 'trailing'
|
|
6
|
+
views.value.forEach((view, index) => {
|
|
7
|
+
if (index === 0) {
|
|
8
|
+
view.location = "onscreen";
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
view.location = "trailing";
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
break;
|
|
15
|
+
case "tablet":
|
|
16
|
+
// Mark all views except the last one in location 'leading'
|
|
17
|
+
views.value.forEach((view, index) => {
|
|
18
|
+
if (index === views.value.length - 1) {
|
|
19
|
+
view.location = "onscreen";
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
view.location = "leading";
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
break;
|
|
26
|
+
case "desktop":
|
|
27
|
+
// Mark all views for location 'onscreen'
|
|
28
|
+
views.value.forEach((view) => {
|
|
29
|
+
view.location = "onscreen";
|
|
30
|
+
});
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
setupForBreakpoint,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
export declare const DEFAULT_BREAKPOINTS: {
|
|
3
|
+
readonly mobile: {
|
|
4
|
+
readonly min: 0;
|
|
5
|
+
readonly max: 639;
|
|
6
|
+
};
|
|
7
|
+
readonly tablet: {
|
|
8
|
+
readonly min: 640;
|
|
9
|
+
readonly max: 1023;
|
|
10
|
+
};
|
|
11
|
+
readonly desktop: {
|
|
12
|
+
readonly min: 1024;
|
|
13
|
+
readonly max: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type BreakpointName = string;
|
|
17
|
+
export interface BreakpointRange {
|
|
18
|
+
min: number;
|
|
19
|
+
max: number;
|
|
20
|
+
}
|
|
21
|
+
export interface BreakpointConfig {
|
|
22
|
+
[key: BreakpointName]: BreakpointRange;
|
|
23
|
+
}
|
|
24
|
+
export interface ContainerMonitorOptions {
|
|
25
|
+
breakpoints?: BreakpointConfig;
|
|
26
|
+
debounceMs?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ContainerDimensions {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}
|
|
32
|
+
export declare const useContainerMonitor: (elementRef: Ref<HTMLElement | undefined>, options?: ContainerMonitorOptions) => {
|
|
33
|
+
isBreakpoint: (name: BreakpointName) => boolean;
|
|
34
|
+
isBreakpointOrAbove: (name: BreakpointName) => boolean;
|
|
35
|
+
isBreakpointOrBelow: (name: BreakpointName) => boolean;
|
|
36
|
+
isBetweenBreakpoints: (min: BreakpointName, max: BreakpointName) => boolean;
|
|
37
|
+
restart: () => void;
|
|
38
|
+
breakpoints: {
|
|
39
|
+
readonly mobile: {
|
|
40
|
+
readonly min: 0;
|
|
41
|
+
readonly max: 639;
|
|
42
|
+
};
|
|
43
|
+
readonly tablet: {
|
|
44
|
+
readonly min: 640;
|
|
45
|
+
readonly max: 1023;
|
|
46
|
+
};
|
|
47
|
+
readonly desktop: {
|
|
48
|
+
readonly min: 1024;
|
|
49
|
+
readonly max: number;
|
|
50
|
+
};
|
|
51
|
+
} | BreakpointConfig;
|
|
52
|
+
dimensions: Ref<{
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
}, ContainerDimensions | {
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
}>;
|
|
59
|
+
currentBreakpoint: Ref<string | null, string | null>;
|
|
60
|
+
previousBreakpoint: Ref<string | null, string | null>;
|
|
61
|
+
};
|
|
62
|
+
export declare const useResponsiveContainer: (elementRef: Ref<HTMLElement | undefined>, customBreakpoints?: Partial<BreakpointConfig>) => {
|
|
63
|
+
isBreakpoint: (name: BreakpointName) => boolean;
|
|
64
|
+
isBreakpointOrAbove: (name: BreakpointName) => boolean;
|
|
65
|
+
isBreakpointOrBelow: (name: BreakpointName) => boolean;
|
|
66
|
+
isBetweenBreakpoints: (min: BreakpointName, max: BreakpointName) => boolean;
|
|
67
|
+
restart: () => void;
|
|
68
|
+
breakpoints: {
|
|
69
|
+
readonly mobile: {
|
|
70
|
+
readonly min: 0;
|
|
71
|
+
readonly max: 639;
|
|
72
|
+
};
|
|
73
|
+
readonly tablet: {
|
|
74
|
+
readonly min: 640;
|
|
75
|
+
readonly max: 1023;
|
|
76
|
+
};
|
|
77
|
+
readonly desktop: {
|
|
78
|
+
readonly min: 1024;
|
|
79
|
+
readonly max: number;
|
|
80
|
+
};
|
|
81
|
+
} | BreakpointConfig;
|
|
82
|
+
dimensions: Ref<{
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
}, ContainerDimensions | {
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
}>;
|
|
89
|
+
currentBreakpoint: Ref<string | null, string | null>;
|
|
90
|
+
previousBreakpoint: Ref<string | null, string | null>;
|
|
91
|
+
};
|
|
92
|
+
export { DEFAULT_BREAKPOINTS as breakpoints };
|
|
93
|
+
//# sourceMappingURL=useContainerMonitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContainerMonitor.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/adaptive/useContainerMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAGtE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAItB,CAAC;AAGX,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,cAAc,GAAG,eAAe,CAAC;CACxC;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAgBD,eAAO,MAAM,mBAAmB,GAC9B,YAAY,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EACxC,UAAS,uBAA4B;yBAyBT,cAAc,KAAG,OAAO;gCAIjB,cAAc,KAAG,OAAO;gCAUxB,cAAc,KAAG,OAAO;gCAWpD,cAAc,OACd,cAAc,KAClB,OAAO;;;;;;;;;;;;;;;;;eAxEH,MAAM;gBACL,MAAM;;eADP,MAAM;gBACL,MAAM;;;;CA0Kf,CAAC;AAGF,eAAO,MAAM,sBAAsB,GACjC,YAAY,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,EACxC,oBAAoB,OAAO,CAAC,gBAAgB,CAAC;yBAnIjB,cAAc,KAAG,OAAO;gCAIjB,cAAc,KAAG,OAAO;gCAUxB,cAAc,KAAG,OAAO;gCAWpD,cAAc,OACd,cAAc,KAClB,OAAO;;;;;;;;;;;;;;;;;eAxEH,MAAM;gBACL,MAAM;;eADP,MAAM;gBACL,MAAM;;;;CAsLf,CAAC;AAGF,OAAO,EAAE,mBAAmB,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { ref, computed, onMounted, onUnmounted } from "vue";
|
|
2
|
+
// Default breakpoint configuration
|
|
3
|
+
export const DEFAULT_BREAKPOINTS = {
|
|
4
|
+
mobile: { min: 0, max: 639 },
|
|
5
|
+
tablet: { min: 640, max: 1023 },
|
|
6
|
+
desktop: { min: 1024, max: Infinity },
|
|
7
|
+
};
|
|
8
|
+
// Utility function to find the current breakpoint
|
|
9
|
+
const findCurrentBreakpoint = (width, breakpoints) => {
|
|
10
|
+
for (const [name, range] of Object.entries(breakpoints)) {
|
|
11
|
+
if (width >= range.min && width <= range.max) {
|
|
12
|
+
return name;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
// Main composable
|
|
18
|
+
export const useContainerMonitor = (elementRef, options = {}) => {
|
|
19
|
+
const { breakpoints = DEFAULT_BREAKPOINTS, debounceMs = 16, // ~60fps
|
|
20
|
+
} = options;
|
|
21
|
+
// Reactive state
|
|
22
|
+
const dimensions = ref({ width: 0, height: 0 });
|
|
23
|
+
const currentBreakpoint = ref(null);
|
|
24
|
+
const previousBreakpoint = ref(null);
|
|
25
|
+
// Computed properties for easy breakpoint checking
|
|
26
|
+
const breakpointQueries = computed(() => {
|
|
27
|
+
const queries = {};
|
|
28
|
+
Object.keys(breakpoints).forEach((name) => {
|
|
29
|
+
queries[`is${name.charAt(0).toUpperCase() + name.slice(1)}`] =
|
|
30
|
+
currentBreakpoint.value === name;
|
|
31
|
+
});
|
|
32
|
+
return queries;
|
|
33
|
+
});
|
|
34
|
+
// Utility functions for responsive checks
|
|
35
|
+
const isBreakpoint = (name) => {
|
|
36
|
+
return currentBreakpoint.value === name;
|
|
37
|
+
};
|
|
38
|
+
const isBreakpointOrAbove = (name) => {
|
|
39
|
+
if (!currentBreakpoint.value)
|
|
40
|
+
return false;
|
|
41
|
+
const currentWidth = dimensions.value.width;
|
|
42
|
+
const targetRange = breakpoints[name];
|
|
43
|
+
if (!targetRange)
|
|
44
|
+
return false;
|
|
45
|
+
return currentWidth >= targetRange.min;
|
|
46
|
+
};
|
|
47
|
+
const isBreakpointOrBelow = (name) => {
|
|
48
|
+
if (!currentBreakpoint.value)
|
|
49
|
+
return false;
|
|
50
|
+
const currentWidth = dimensions.value.width;
|
|
51
|
+
const targetRange = breakpoints[name];
|
|
52
|
+
if (!targetRange)
|
|
53
|
+
return false;
|
|
54
|
+
return currentWidth <= targetRange.max;
|
|
55
|
+
};
|
|
56
|
+
const isBetweenBreakpoints = (min, max) => {
|
|
57
|
+
const currentWidth = dimensions.value.width;
|
|
58
|
+
const minRange = breakpoints[min];
|
|
59
|
+
const maxRange = breakpoints[max];
|
|
60
|
+
if (!minRange || !maxRange)
|
|
61
|
+
return false;
|
|
62
|
+
return currentWidth >= minRange.min && currentWidth <= maxRange.max;
|
|
63
|
+
};
|
|
64
|
+
// Resize observer and debouncing
|
|
65
|
+
let resizeObserver = null;
|
|
66
|
+
let debounceTimer = null;
|
|
67
|
+
const updateDimensions = (entries) => {
|
|
68
|
+
if (debounceTimer) {
|
|
69
|
+
clearTimeout(debounceTimer);
|
|
70
|
+
}
|
|
71
|
+
debounceTimer = window.setTimeout(() => {
|
|
72
|
+
const entry = entries[0];
|
|
73
|
+
if (!entry)
|
|
74
|
+
return;
|
|
75
|
+
const { width, height } = entry.contentRect;
|
|
76
|
+
// Update dimensions
|
|
77
|
+
dimensions.value = { width, height };
|
|
78
|
+
// Update breakpoint
|
|
79
|
+
const newBreakpoint = findCurrentBreakpoint(width, breakpoints);
|
|
80
|
+
if (newBreakpoint !== currentBreakpoint.value) {
|
|
81
|
+
previousBreakpoint.value = currentBreakpoint.value;
|
|
82
|
+
currentBreakpoint.value = newBreakpoint;
|
|
83
|
+
}
|
|
84
|
+
}, debounceMs);
|
|
85
|
+
};
|
|
86
|
+
// Initialize observer
|
|
87
|
+
const startObserver = () => {
|
|
88
|
+
if (!elementRef.value || resizeObserver)
|
|
89
|
+
return;
|
|
90
|
+
resizeObserver = new ResizeObserver(updateDimensions);
|
|
91
|
+
resizeObserver.observe(elementRef.value);
|
|
92
|
+
// Get initial dimensions
|
|
93
|
+
const rect = elementRef.value.getBoundingClientRect();
|
|
94
|
+
dimensions.value = { width: rect.width, height: rect.height };
|
|
95
|
+
currentBreakpoint.value = findCurrentBreakpoint(rect.width, breakpoints);
|
|
96
|
+
};
|
|
97
|
+
const stopObserver = () => {
|
|
98
|
+
if (resizeObserver) {
|
|
99
|
+
resizeObserver.disconnect();
|
|
100
|
+
resizeObserver = null;
|
|
101
|
+
}
|
|
102
|
+
if (debounceTimer) {
|
|
103
|
+
clearTimeout(debounceTimer);
|
|
104
|
+
debounceTimer = null;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
// Lifecycle hooks
|
|
108
|
+
onMounted(() => {
|
|
109
|
+
startObserver();
|
|
110
|
+
});
|
|
111
|
+
onUnmounted(() => {
|
|
112
|
+
stopObserver();
|
|
113
|
+
});
|
|
114
|
+
// Watch for element ref changes
|
|
115
|
+
const restart = () => {
|
|
116
|
+
stopObserver();
|
|
117
|
+
startObserver();
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
// Reactive state
|
|
121
|
+
dimensions,
|
|
122
|
+
currentBreakpoint,
|
|
123
|
+
previousBreakpoint,
|
|
124
|
+
// Computed breakpoint queries (isTablet, isMobile, etc.)
|
|
125
|
+
...breakpointQueries.value,
|
|
126
|
+
// Utility functions
|
|
127
|
+
isBreakpoint,
|
|
128
|
+
isBreakpointOrAbove,
|
|
129
|
+
isBreakpointOrBelow,
|
|
130
|
+
isBetweenBreakpoints,
|
|
131
|
+
// Control functions
|
|
132
|
+
restart,
|
|
133
|
+
// Configuration
|
|
134
|
+
breakpoints,
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
// Convenience composable for common use cases
|
|
138
|
+
export const useResponsiveContainer = (elementRef, customBreakpoints) => {
|
|
139
|
+
const breakpoints = customBreakpoints
|
|
140
|
+
? { ...DEFAULT_BREAKPOINTS, ...customBreakpoints }
|
|
141
|
+
: DEFAULT_BREAKPOINTS;
|
|
142
|
+
return useContainerMonitor(elementRef, { breakpoints });
|
|
143
|
+
};
|
|
144
|
+
// Export default breakpoints for convenience
|
|
145
|
+
export { DEFAULT_BREAKPOINTS as breakpoints };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
import { InternalView } from "./types";
|
|
3
|
+
export declare const useViewAnimation: (views: Ref<InternalView[]>, instanceKey: string, containerDimensions: Ref<{
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}>, padding: string, gap: string) => {
|
|
7
|
+
splitViewShow: (id: string) => Promise<void>;
|
|
8
|
+
splitViewHide: (id: string) => Promise<void>;
|
|
9
|
+
splitViewPush: (id?: string | null) => Promise<void>;
|
|
10
|
+
splitViewPop: (id?: string | null) => Promise<void>;
|
|
11
|
+
slideoverShow: (id: string) => Promise<void>;
|
|
12
|
+
slideoverHide: () => Promise<void>;
|
|
13
|
+
slideoverPush: (id?: string | null) => Promise<void>;
|
|
14
|
+
slideoverPop: (id?: string | null) => Promise<void>;
|
|
15
|
+
navstackShow: (id: string) => Promise<void>;
|
|
16
|
+
navstackPush: () => Promise<void>;
|
|
17
|
+
navstackPop: (id: string) => Promise<void>;
|
|
18
|
+
getOffscreenLeadingId: () => string;
|
|
19
|
+
getOffscreenTrailingId: () => string;
|
|
20
|
+
getOnscreenId: () => string;
|
|
21
|
+
getViewId: (view: InternalView) => string;
|
|
22
|
+
getDarkenId: () => string;
|
|
23
|
+
getOverlayId: () => string;
|
|
24
|
+
getViewElements: () => HTMLElement[];
|
|
25
|
+
isOnscreen: (view: InternalView) => boolean;
|
|
26
|
+
hasPrecedingViews: (id: string, location: string) => boolean;
|
|
27
|
+
isOverlayOpen: Ref<boolean, boolean>;
|
|
28
|
+
getSingleViewBefore: (id: string) => InternalView | null;
|
|
29
|
+
getSingleViewAfter: (id: string) => InternalView | null;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=useViewAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewAnimation.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/adaptive/useViewAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAcvC,eAAO,MAAM,gBAAgB,GAC3B,OAAO,GAAG,CAAC,YAAY,EAAE,CAAC,EAC1B,aAAa,MAAM,EACnB,qBAAqB,GAAG,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,EAC3D,SAAS,MAAM,EACf,KAAK,MAAM;wBAuNsB,MAAM;wBAMN,MAAM;yBAUN,MAAM,GAAG,IAAI;wBAgBd,MAAM,GAAG,IAAI;wBAwLZ,MAAM;;yBA0CN,MAAM,GAAG,IAAI;wBAkDd,MAAM,GAAG,IAAI;uBAgEb,MAAM;;sBAYP,MAAM;;;;sBA3iBZ,YAAY;;;2BAIT,WAAW,EAAE;uBA6Ff,YAAY;4BAIP,MAAM,YAAY,MAAM;;8BAhCtB,MAAM,KAAG,YAAY,GAAG,IAAI;6BAU7B,MAAM,KAAG,YAAY,GAAG,IAAI;CA+jB7D,CAAC"}
|