alinea
Version:
Headless git-based CMS
34 lines (32 loc) • 827 B
JavaScript
import "../../chunks/chunk-NZLE2WMY.js";
// src/field/tabs/Tabs.ts
import { Field } from "alinea/core/Field";
import {
section
} from "alinea/core/Section";
import { Type, type } from "alinea/core/Type";
import { entries, fromEntries } from "alinea/core/util/Objects";
import { viewKeys } from "alinea/dashboard/editor/ViewKeys";
var TabsSection = class {
constructor(types) {
this.types = types;
this.definition = fromEntries(types.flatMap(entries));
this.fields = fromEntries(
types.flatMap(entries).filter(([key, field]) => Field.isField(field))
);
this.sections = types.flatMap(Type.sections);
}
view = viewKeys.TabsView;
definition;
fields;
sections;
};
function tabs(...types) {
return section(new TabsSection(types));
}
var tab = type;
export {
TabsSection,
tab,
tabs
};