@vuesax-alpha/nightly
Version:
A Component Library for Vue 3
55 lines (52 loc) • 1.75 kB
JavaScript
import { defineComponent, computed, provide, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from 'vue';
import '../../../hooks/index.mjs';
import '../../../tokens/index.mjs';
import { rowProps } from './row.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
import { rowContextKey } from '../../../tokens/row.mjs';
const __default__ = defineComponent({
name: "VsRow"
});
const _sfc_main = defineComponent({
...__default__,
props: rowProps,
setup(__props) {
const props = __props;
const ns = useNamespace("row");
const gutter = computed(() => props.gutter);
provide(rowContextKey, {
gutter
});
const style = computed(() => {
const styles = {};
if (!props.gutter) {
return styles;
}
styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
return styles;
});
const rowKls = computed(() => [
ns.b(),
ns.is(`justify-${props.justify}`, props.justify !== "start"),
ns.is(`align-${props.align}`, props.align !== "top"),
ns.is(`direction-${props.direction}`, props.direction !== "row")
]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(rowKls.value),
style: normalizeStyle(style.value)
},
[
renderSlot(_ctx.$slots, "default")
],
6
);
};
}
});
var Row = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/vuesax-alpha/vuesax-alpha/packages/components/row/src/row.vue"]]);
export { Row as default };
//# sourceMappingURL=row2.mjs.map