70 lines
2.4 KiB
JavaScript
70 lines
2.4 KiB
JavaScript
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createVNode as _createVNode } from "vue";
|
|
// Styles
|
|
import "./VSystemBar.css";
|
|
|
|
// Composables
|
|
import { useBackgroundColor } from "../../composables/color.js";
|
|
import { makeComponentProps } from "../../composables/component.js";
|
|
import { makeElevationProps, useElevation } from "../../composables/elevation.js";
|
|
import { makeLayoutItemProps, useLayoutItem } from "../../composables/layout.js";
|
|
import { makeRoundedProps, useRounded } from "../../composables/rounded.js";
|
|
import { useSsrBoot } from "../../composables/ssrBoot.js";
|
|
import { makeTagProps } from "../../composables/tag.js";
|
|
import { makeThemeProps, provideTheme } from "../../composables/theme.js"; // Utilities
|
|
import { computed, shallowRef, toRef } from 'vue';
|
|
import { genericComponent, propsFactory, useRender } from "../../util/index.js";
|
|
export const makeVSystemBarProps = propsFactory({
|
|
color: String,
|
|
height: [Number, String],
|
|
window: Boolean,
|
|
...makeComponentProps(),
|
|
...makeElevationProps(),
|
|
...makeLayoutItemProps(),
|
|
...makeRoundedProps(),
|
|
...makeTagProps(),
|
|
...makeThemeProps()
|
|
}, 'VSystemBar');
|
|
export const VSystemBar = genericComponent()({
|
|
name: 'VSystemBar',
|
|
props: makeVSystemBarProps(),
|
|
setup(props, {
|
|
slots
|
|
}) {
|
|
const {
|
|
themeClasses
|
|
} = provideTheme(props);
|
|
const {
|
|
backgroundColorClasses,
|
|
backgroundColorStyles
|
|
} = useBackgroundColor(() => props.color);
|
|
const {
|
|
elevationClasses
|
|
} = useElevation(props);
|
|
const {
|
|
roundedClasses
|
|
} = useRounded(props);
|
|
const {
|
|
ssrBootStyles
|
|
} = useSsrBoot();
|
|
const height = computed(() => props.height ?? (props.window ? 32 : 24));
|
|
const {
|
|
layoutItemStyles
|
|
} = useLayoutItem({
|
|
id: props.name,
|
|
order: computed(() => parseInt(props.order, 10)),
|
|
position: shallowRef('top'),
|
|
layoutSize: height,
|
|
elementSize: height,
|
|
active: computed(() => true),
|
|
absolute: toRef(() => props.absolute)
|
|
});
|
|
useRender(() => _createVNode(props.tag, {
|
|
"class": _normalizeClass(['v-system-bar', {
|
|
'v-system-bar--window': props.window
|
|
}, themeClasses.value, backgroundColorClasses.value, elevationClasses.value, roundedClasses.value, props.class]),
|
|
"style": _normalizeStyle([backgroundColorStyles.value, layoutItemStyles.value, ssrBootStyles.value, props.style])
|
|
}, slots));
|
|
return {};
|
|
}
|
|
});
|
|
//# sourceMappingURL=VSystemBar.js.map
|