@plitzi/sdk-elements 0.39.15 → 0.39.16
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/CHANGELOG.md +14 -0
- package/dist/elements/declarations/index.d.ts +115 -1
- package/dist/elements/declarations/index.mjs +19 -15
- package/dist/elements/index.d.ts +3 -1
- package/dist/elements/index.mjs +14 -12
- package/dist/elements/settings.mjs +18 -14
- package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.d.ts +6 -1
- package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.mjs +4 -3
- package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.d.ts +3 -2
- package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.mjs +23 -12
- package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.d.ts +2 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.mjs +5 -2
- package/dist/elements/structure/Disclosure/DisclosureSummary/index.d.ts +2 -0
- package/dist/elements/structure/Disclosure/index.d.ts +2 -0
- package/dist/elements/structure/Table/Settings.d.ts +8 -0
- package/dist/elements/structure/Table/Settings.mjs +25 -0
- package/dist/elements/structure/Table/Table.d.ts +25 -0
- package/dist/elements/structure/Table/Table.mjs +79 -0
- package/dist/elements/structure/Table/TableColumn/Settings.d.ts +8 -0
- package/dist/elements/structure/Table/TableColumn/Settings.mjs +31 -0
- package/dist/elements/structure/Table/TableColumn/TableColumn.d.ts +20 -0
- package/dist/elements/structure/Table/TableColumn/TableColumn.mjs +25 -0
- package/dist/elements/structure/Table/TableColumn/declaration.d.ts +47 -0
- package/dist/elements/structure/Table/TableColumn/declaration.mjs +36 -0
- package/dist/elements/structure/Table/TableColumn/index.d.ts +45 -0
- package/dist/elements/structure/Table/TableColumn/index.mjs +5 -0
- package/dist/elements/structure/Table/TablePart.d.ts +6 -0
- package/dist/elements/structure/Table/TablePart.mjs +4 -0
- package/dist/elements/structure/Table/declaration.d.ts +73 -0
- package/dist/elements/structure/Table/declaration.mjs +57 -0
- package/dist/elements/structure/Table/index.d.ts +118 -0
- package/dist/elements/structure/Table/index.mjs +9 -0
- package/dist/index.d.ts +117 -0
- package/dist/index.mjs +21 -19
- package/package.json +7 -7
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import { TablePartContext as t } from "./TablePart.mjs";
|
|
3
|
+
import n from "../../../dataSource/sourceStore.mjs";
|
|
4
|
+
import r from "../../../dataSource/useRegisterSource.mjs";
|
|
5
|
+
import i from "../../../Element/hocs/withElement.mjs";
|
|
6
|
+
import a from "../../../Element/hooks/useElement.mjs";
|
|
7
|
+
import { RootElement as o } from "../../../Element/RootElement.mjs";
|
|
8
|
+
import s from "../List/modes/ListControlled/ListControlledItem.mjs";
|
|
9
|
+
import { rowKeys as c } from "../List/modes/ListControlled/rowKeys.mjs";
|
|
10
|
+
import { useCallback as l, useMemo as u, useRef as d } from "react";
|
|
11
|
+
import { StoreProvider as f } from "@plitzi/nexus/react";
|
|
12
|
+
import { usePlitzi as p } from "@plitzi/sdk-shared/hooks";
|
|
13
|
+
import { getPathsFromObject as m } from "@plitzi/sdk-shared/helpers";
|
|
14
|
+
import { get as h } from "@plitzi/plitzi-ui/helpers";
|
|
15
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
16
|
+
import v from "clsx";
|
|
17
|
+
import { getSourceName as y } from "@plitzi/sdk-shared/dataSource/helpers";
|
|
18
|
+
import { replaceEqualDeep as b } from "@plitzi/sdk-shared/helpers/replaceEqualDeep";
|
|
19
|
+
// src/elements/structure/Table/Table.tsx
|
|
20
|
+
var x = [], S = ({ ref: i, className: S = "", children: C, items: w = [], itemKey: T, caption: E = "" }) => {
|
|
21
|
+
let { id: D, definition: { label: O, styleSelectors: k } } = a(), A = y(e.sourceType, D), { settings: { previewMode: j } } = p(), M = d(x), N = u(() => {
|
|
22
|
+
let e = b(M.current, Array.isArray(w) ? w : x);
|
|
23
|
+
return M.current = e, e;
|
|
24
|
+
}, [w]), P = u(() => c(N, T), [N, T]), F = l(() => m({
|
|
25
|
+
item: h(N, "0", {}),
|
|
26
|
+
index: 0
|
|
27
|
+
}).reduce((e, t) => [...e, {
|
|
28
|
+
path: t,
|
|
29
|
+
name: t
|
|
30
|
+
}], []), [N]), I = u(() => n(A, { items: N }), [A, N]);
|
|
31
|
+
r({
|
|
32
|
+
id: D,
|
|
33
|
+
source: A,
|
|
34
|
+
name: O || `Table - ${D}`,
|
|
35
|
+
fields: F
|
|
36
|
+
});
|
|
37
|
+
let L = N.length === 0 && !j ? [{}] : N;
|
|
38
|
+
return /* @__PURE__ */ _(o, {
|
|
39
|
+
ref: i,
|
|
40
|
+
tag: "table",
|
|
41
|
+
className: v("plitzi-component__table", S),
|
|
42
|
+
children: [
|
|
43
|
+
E && /* @__PURE__ */ g("caption", {
|
|
44
|
+
className: v("plitzi-component__table-caption", k.caption),
|
|
45
|
+
children: E
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ g("thead", {
|
|
48
|
+
className: v("plitzi-component__table-head", k.head),
|
|
49
|
+
children: /* @__PURE__ */ g("tr", { children: /* @__PURE__ */ g(t, {
|
|
50
|
+
value: "head",
|
|
51
|
+
children: C
|
|
52
|
+
}) })
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ g(f, {
|
|
55
|
+
inherit: "live",
|
|
56
|
+
name: `Table:${D}`,
|
|
57
|
+
value: I,
|
|
58
|
+
children: /* @__PURE__ */ g("tbody", {
|
|
59
|
+
className: "plitzi-component__table-body",
|
|
60
|
+
children: L.map((e, n) => /* @__PURE__ */ g("tr", {
|
|
61
|
+
className: v("plitzi-component__table-row", k.row),
|
|
62
|
+
children: /* @__PURE__ */ g(t, {
|
|
63
|
+
value: "row",
|
|
64
|
+
children: /* @__PURE__ */ g(s, {
|
|
65
|
+
rowKey: P[n] ?? n,
|
|
66
|
+
index: n,
|
|
67
|
+
isTemplate: !1,
|
|
68
|
+
record: e,
|
|
69
|
+
source: A,
|
|
70
|
+
children: C
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}, P[n] ?? n))
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
}, C = i(S);
|
|
79
|
+
export { S as Table, C as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type SettingsProps = {
|
|
2
|
+
header?: string;
|
|
3
|
+
rowHeader?: boolean;
|
|
4
|
+
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
5
|
+
};
|
|
6
|
+
/** A column's settings: its header, and whether its cell names its row. */
|
|
7
|
+
declare const Settings: ({ header, rowHeader, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
8
|
+
export default Settings;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import e from "../../../useSettingsUpdate.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "@plitzi/plitzi-ui/Checkbox";
|
|
4
|
+
import i from "@plitzi/plitzi-ui/Input";
|
|
5
|
+
// src/elements/structure/Table/TableColumn/Settings.tsx
|
|
6
|
+
var a = ({ header: a = "", rowHeader: o = !1, onUpdate: s }) => {
|
|
7
|
+
let c = e(s);
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: "flex flex-col gap-4 py-2",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ t(i, {
|
|
12
|
+
value: a,
|
|
13
|
+
label: "Header",
|
|
14
|
+
placeholder: "e.g. Plan, Price",
|
|
15
|
+
onChange: c.text("header"),
|
|
16
|
+
size: "xs"
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ t(r, {
|
|
19
|
+
label: "Names its row",
|
|
20
|
+
size: "xs",
|
|
21
|
+
checked: o,
|
|
22
|
+
onChange: c.checked("rowHeader")
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ t("span", {
|
|
25
|
+
className: "text-ui-fg-subtle text-xs",
|
|
26
|
+
children: "On, each cell of this column is read as its row’s header — a product’s name in a comparison."
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export { a as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
export type TableColumnProps = {
|
|
3
|
+
ref?: RefObject<HTMLElement>;
|
|
4
|
+
className?: string;
|
|
5
|
+
/** What each row's cell holds: the elements a row draws, its item in hand (`row.item`). */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** The column's header, in the table's head: what its cells are (`<th scope="col">`). */
|
|
8
|
+
header?: string;
|
|
9
|
+
/** Whether this column's cell names its row — a product's name — read as the row's header (`<th scope="row">`). */
|
|
10
|
+
rowHeader?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* One column of a table: its header in the head, and in each row that row's cell. One element drawn in both, so its
|
|
14
|
+
* `visible` shows or hides the whole column, and its class styles its header and its cells alike (the `header` slot
|
|
15
|
+
* the header alone).
|
|
16
|
+
*/
|
|
17
|
+
declare const TableColumn: ({ ref, className, children, header, rowHeader }: TableColumnProps) => import('react').JSX.Element;
|
|
18
|
+
declare const _default: import('react').FC<import('../../../..').WithElementProps<TableColumnProps>>;
|
|
19
|
+
export default _default;
|
|
20
|
+
export { TableColumn };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import e from "../../../../Element/hocs/withElement.mjs";
|
|
2
|
+
import t from "../../../../Element/hooks/useElement.mjs";
|
|
3
|
+
import { RootElement as n } from "../../../../Element/RootElement.mjs";
|
|
4
|
+
import { TablePartContext as r } from "../TablePart.mjs";
|
|
5
|
+
import { use as i } from "react";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
import o from "clsx";
|
|
8
|
+
// src/elements/structure/Table/TableColumn/TableColumn.tsx
|
|
9
|
+
var s = ({ ref: e, className: s = "", children: c, header: l = "", rowHeader: u = !1 }) => {
|
|
10
|
+
let d = i(r), { definition: { styleSelectors: f } } = t();
|
|
11
|
+
return d === "head" ? /* @__PURE__ */ a(n, {
|
|
12
|
+
ref: e,
|
|
13
|
+
tag: "th",
|
|
14
|
+
scope: "col",
|
|
15
|
+
className: o("plitzi-component__table-column", "plitzi-component__table-header", s, f.header),
|
|
16
|
+
children: l
|
|
17
|
+
}) : /* @__PURE__ */ a(n, {
|
|
18
|
+
ref: e,
|
|
19
|
+
tag: u ? "th" : "td",
|
|
20
|
+
...u ? { scope: "row" } : {},
|
|
21
|
+
className: o("plitzi-component__table-column", s),
|
|
22
|
+
children: c
|
|
23
|
+
});
|
|
24
|
+
}, c = e(s);
|
|
25
|
+
export { s as TableColumn, c as default };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { TableColumnProps } from './TableColumn';
|
|
2
|
+
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
3
|
+
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
|
+
export type TableColumnAttributes = AuthorableAttributes<TableColumnProps>;
|
|
5
|
+
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
|
+
readonly type: "tableColumn";
|
|
7
|
+
readonly ancestorType: "table";
|
|
8
|
+
readonly content: {
|
|
9
|
+
readonly attributes: {
|
|
10
|
+
readonly header: "";
|
|
11
|
+
readonly rowHeader: false;
|
|
12
|
+
};
|
|
13
|
+
readonly definition: {
|
|
14
|
+
readonly label: "Table Column";
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly items: [];
|
|
17
|
+
readonly styleSelectors: {
|
|
18
|
+
readonly header: "";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
readonly market: {
|
|
22
|
+
readonly category: "structure";
|
|
23
|
+
readonly icon: "fa-solid fa-table-columns";
|
|
24
|
+
};
|
|
25
|
+
readonly defaultStyle: {
|
|
26
|
+
readonly style: {
|
|
27
|
+
readonly base: {
|
|
28
|
+
readonly default: {
|
|
29
|
+
readonly padding: "8px 12px";
|
|
30
|
+
readonly 'vertical-align': "top";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly header: {
|
|
34
|
+
readonly default: {
|
|
35
|
+
readonly 'font-weight': "600";
|
|
36
|
+
readonly 'white-space': "nowrap";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
readonly subTypes: {};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}, Partial<{
|
|
44
|
+
header?: string | undefined;
|
|
45
|
+
rowHeader?: boolean | undefined;
|
|
46
|
+
}>>;
|
|
47
|
+
export default declaration;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring";
|
|
2
|
+
// src/elements/structure/Table/TableColumn/declaration.ts
|
|
3
|
+
var t = e()({
|
|
4
|
+
type: "tableColumn",
|
|
5
|
+
ancestorType: "table",
|
|
6
|
+
content: {
|
|
7
|
+
attributes: {
|
|
8
|
+
header: "",
|
|
9
|
+
rowHeader: !1
|
|
10
|
+
},
|
|
11
|
+
definition: {
|
|
12
|
+
label: "Table Column",
|
|
13
|
+
description: "One column of a table: its `header` in the head (`<th scope=\"col\">`), and in each row the cell its children draw, the row in hand. `rowHeader` makes its cell name its row (`<th scope=\"row\">`). Its `visible` shows or hides the whole column; its class styles the header and the cells, the `header` slot the header alone.",
|
|
14
|
+
items: [],
|
|
15
|
+
styleSelectors: { header: "" }
|
|
16
|
+
},
|
|
17
|
+
market: {
|
|
18
|
+
category: "structure",
|
|
19
|
+
icon: "fa-solid fa-table-columns"
|
|
20
|
+
},
|
|
21
|
+
defaultStyle: {
|
|
22
|
+
style: {
|
|
23
|
+
base: { default: {
|
|
24
|
+
padding: "8px 12px",
|
|
25
|
+
"vertical-align": "top"
|
|
26
|
+
} },
|
|
27
|
+
header: { default: {
|
|
28
|
+
"font-weight": "600",
|
|
29
|
+
"white-space": "nowrap"
|
|
30
|
+
} }
|
|
31
|
+
},
|
|
32
|
+
subTypes: {}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export { t as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare const TableColumn: import('react').FC<import('../../../..').WithElementProps<import('./TableColumn').TableColumnProps>> & {
|
|
2
|
+
readonly type: "tableColumn";
|
|
3
|
+
readonly ancestorType: "table";
|
|
4
|
+
readonly content: {
|
|
5
|
+
readonly attributes: {
|
|
6
|
+
readonly header: "";
|
|
7
|
+
readonly rowHeader: false;
|
|
8
|
+
};
|
|
9
|
+
readonly definition: {
|
|
10
|
+
readonly label: "Table Column";
|
|
11
|
+
readonly description: string;
|
|
12
|
+
readonly items: [];
|
|
13
|
+
readonly styleSelectors: {
|
|
14
|
+
readonly header: "";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly market: {
|
|
18
|
+
readonly category: "structure";
|
|
19
|
+
readonly icon: "fa-solid fa-table-columns";
|
|
20
|
+
};
|
|
21
|
+
readonly defaultStyle: {
|
|
22
|
+
readonly style: {
|
|
23
|
+
readonly base: {
|
|
24
|
+
readonly default: {
|
|
25
|
+
readonly padding: "8px 12px";
|
|
26
|
+
readonly 'vertical-align': "top";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly header: {
|
|
30
|
+
readonly default: {
|
|
31
|
+
readonly 'font-weight': "600";
|
|
32
|
+
readonly 'white-space': "nowrap";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly subTypes: {};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
} & {
|
|
40
|
+
content: import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
41
|
+
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
42
|
+
header?: string | undefined;
|
|
43
|
+
rowHeader?: boolean | undefined;
|
|
44
|
+
}>>;
|
|
45
|
+
export default TableColumn;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a table's columns are drawn: its head — each column its header, a `<th scope="col">` — or one of its rows — each
|
|
3
|
+
* column that row's cell. A column is one element drawn in both, so it shows or hides, and is styled, as one.
|
|
4
|
+
*/
|
|
5
|
+
export type TablePart = 'head' | 'row';
|
|
6
|
+
export declare const TablePartContext: import('react').Context<TablePart>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TableProps } from './Table';
|
|
2
|
+
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
3
|
+
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
|
+
export type TableAttributes = AuthorableAttributes<TableProps>;
|
|
5
|
+
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
|
+
readonly type: "table";
|
|
7
|
+
readonly sourceType: "table";
|
|
8
|
+
readonly publishes: {
|
|
9
|
+
readonly items: "Every row it draws, as its items give them";
|
|
10
|
+
readonly item: "Inside a row: that row's item";
|
|
11
|
+
readonly index: "Inside a row: its place, from 0";
|
|
12
|
+
};
|
|
13
|
+
readonly content: {
|
|
14
|
+
readonly attributes: {
|
|
15
|
+
readonly items: readonly [];
|
|
16
|
+
readonly caption: "";
|
|
17
|
+
};
|
|
18
|
+
readonly definition: {
|
|
19
|
+
readonly label: "Table";
|
|
20
|
+
readonly description: string;
|
|
21
|
+
readonly items: [];
|
|
22
|
+
readonly styleSelectors: {
|
|
23
|
+
readonly caption: "";
|
|
24
|
+
readonly head: "";
|
|
25
|
+
readonly row: "";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly builder: {
|
|
29
|
+
readonly itemsAllowed: ["tableColumn"];
|
|
30
|
+
};
|
|
31
|
+
readonly market: {
|
|
32
|
+
readonly category: "structure";
|
|
33
|
+
readonly icon: "fa-solid fa-table";
|
|
34
|
+
};
|
|
35
|
+
readonly defaultStyle: {
|
|
36
|
+
readonly style: {
|
|
37
|
+
readonly base: {
|
|
38
|
+
readonly default: {
|
|
39
|
+
readonly width: "100%";
|
|
40
|
+
readonly 'border-collapse': "collapse";
|
|
41
|
+
readonly 'text-align': "left";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly caption: {
|
|
45
|
+
readonly default: {
|
|
46
|
+
readonly 'text-align': "left";
|
|
47
|
+
readonly 'padding-bottom': "8px";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly head: {
|
|
51
|
+
readonly default: {
|
|
52
|
+
readonly 'border-bottom-width': "1px";
|
|
53
|
+
readonly 'border-bottom-style': "solid";
|
|
54
|
+
readonly 'border-bottom-color': "currentColor";
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
readonly row: {
|
|
58
|
+
readonly default: {
|
|
59
|
+
readonly 'border-bottom-width': "1px";
|
|
60
|
+
readonly 'border-bottom-style': "solid";
|
|
61
|
+
readonly 'border-bottom-color': "rgba(127, 127, 127, 0.25)";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly subTypes: {};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, Partial<{
|
|
69
|
+
caption?: string | undefined;
|
|
70
|
+
items?: unknown[] | undefined;
|
|
71
|
+
itemKey?: string | undefined;
|
|
72
|
+
}>>;
|
|
73
|
+
export default declaration;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring";
|
|
2
|
+
// src/elements/structure/Table/declaration.ts
|
|
3
|
+
var t = e()({
|
|
4
|
+
type: "table",
|
|
5
|
+
sourceType: "table",
|
|
6
|
+
publishes: {
|
|
7
|
+
items: "Every row it draws, as its items give them",
|
|
8
|
+
item: "Inside a row: that row's item",
|
|
9
|
+
index: "Inside a row: its place, from 0"
|
|
10
|
+
},
|
|
11
|
+
content: {
|
|
12
|
+
attributes: {
|
|
13
|
+
items: [],
|
|
14
|
+
caption: ""
|
|
15
|
+
},
|
|
16
|
+
definition: {
|
|
17
|
+
label: "Table",
|
|
18
|
+
description: "A table of data — a <table> read as one by screen readers and search engines: its children are `tableColumn`s, each a header in its head and a cell in every row, and it draws one row per entry of its items (bound to a source like a list). A column whose `visible` changes is gone from the head and every row at once. Its `caption` says what the table is.",
|
|
19
|
+
items: [],
|
|
20
|
+
styleSelectors: {
|
|
21
|
+
caption: "",
|
|
22
|
+
head: "",
|
|
23
|
+
row: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
builder: { itemsAllowed: ["tableColumn"] },
|
|
27
|
+
market: {
|
|
28
|
+
category: "structure",
|
|
29
|
+
icon: "fa-solid fa-table"
|
|
30
|
+
},
|
|
31
|
+
defaultStyle: {
|
|
32
|
+
style: {
|
|
33
|
+
base: { default: {
|
|
34
|
+
width: "100%",
|
|
35
|
+
"border-collapse": "collapse",
|
|
36
|
+
"text-align": "left"
|
|
37
|
+
} },
|
|
38
|
+
caption: { default: {
|
|
39
|
+
"text-align": "left",
|
|
40
|
+
"padding-bottom": "8px"
|
|
41
|
+
} },
|
|
42
|
+
head: { default: {
|
|
43
|
+
"border-bottom-width": "1px",
|
|
44
|
+
"border-bottom-style": "solid",
|
|
45
|
+
"border-bottom-color": "currentColor"
|
|
46
|
+
} },
|
|
47
|
+
row: { default: {
|
|
48
|
+
"border-bottom-width": "1px",
|
|
49
|
+
"border-bottom-style": "solid",
|
|
50
|
+
"border-bottom-color": "rgba(127, 127, 127, 0.25)"
|
|
51
|
+
} }
|
|
52
|
+
},
|
|
53
|
+
subTypes: {}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export { t as default };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
declare const Table: import('react').FC<import('../../..').WithElementProps<import('./Table').TableProps<unknown>>> & {
|
|
2
|
+
plugins: {
|
|
3
|
+
tableColumn: import('react').FC<import('../../..').WithElementProps<import('.').TableColumnProps>> & {
|
|
4
|
+
readonly type: "tableColumn";
|
|
5
|
+
readonly ancestorType: "table";
|
|
6
|
+
readonly content: {
|
|
7
|
+
readonly attributes: {
|
|
8
|
+
readonly header: "";
|
|
9
|
+
readonly rowHeader: false;
|
|
10
|
+
};
|
|
11
|
+
readonly definition: {
|
|
12
|
+
readonly label: "Table Column";
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly items: [];
|
|
15
|
+
readonly styleSelectors: {
|
|
16
|
+
readonly header: "";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly market: {
|
|
20
|
+
readonly category: "structure";
|
|
21
|
+
readonly icon: "fa-solid fa-table-columns";
|
|
22
|
+
};
|
|
23
|
+
readonly defaultStyle: {
|
|
24
|
+
readonly style: {
|
|
25
|
+
readonly base: {
|
|
26
|
+
readonly default: {
|
|
27
|
+
readonly padding: "8px 12px";
|
|
28
|
+
readonly 'vertical-align': "top";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly header: {
|
|
32
|
+
readonly default: {
|
|
33
|
+
readonly 'font-weight': "600";
|
|
34
|
+
readonly 'white-space': "nowrap";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly subTypes: {};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} & {
|
|
42
|
+
content: import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
43
|
+
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
44
|
+
header?: string | undefined;
|
|
45
|
+
rowHeader?: boolean | undefined;
|
|
46
|
+
}>>;
|
|
47
|
+
};
|
|
48
|
+
type: "table";
|
|
49
|
+
sourceType: "table";
|
|
50
|
+
publishes: {
|
|
51
|
+
readonly items: "Every row it draws, as its items give them";
|
|
52
|
+
readonly item: "Inside a row: that row's item";
|
|
53
|
+
readonly index: "Inside a row: its place, from 0";
|
|
54
|
+
};
|
|
55
|
+
content: {
|
|
56
|
+
readonly attributes: {
|
|
57
|
+
readonly items: readonly [];
|
|
58
|
+
readonly caption: "";
|
|
59
|
+
};
|
|
60
|
+
readonly definition: {
|
|
61
|
+
readonly label: "Table";
|
|
62
|
+
readonly description: string;
|
|
63
|
+
readonly items: [];
|
|
64
|
+
readonly styleSelectors: {
|
|
65
|
+
readonly caption: "";
|
|
66
|
+
readonly head: "";
|
|
67
|
+
readonly row: "";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
readonly builder: {
|
|
71
|
+
readonly itemsAllowed: ["tableColumn"];
|
|
72
|
+
};
|
|
73
|
+
readonly market: {
|
|
74
|
+
readonly category: "structure";
|
|
75
|
+
readonly icon: "fa-solid fa-table";
|
|
76
|
+
};
|
|
77
|
+
readonly defaultStyle: {
|
|
78
|
+
readonly style: {
|
|
79
|
+
readonly base: {
|
|
80
|
+
readonly default: {
|
|
81
|
+
readonly width: "100%";
|
|
82
|
+
readonly 'border-collapse': "collapse";
|
|
83
|
+
readonly 'text-align': "left";
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
readonly caption: {
|
|
87
|
+
readonly default: {
|
|
88
|
+
readonly 'text-align': "left";
|
|
89
|
+
readonly 'padding-bottom': "8px";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
readonly head: {
|
|
93
|
+
readonly default: {
|
|
94
|
+
readonly 'border-bottom-width': "1px";
|
|
95
|
+
readonly 'border-bottom-style': "solid";
|
|
96
|
+
readonly 'border-bottom-color': "currentColor";
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
readonly row: {
|
|
100
|
+
readonly default: {
|
|
101
|
+
readonly 'border-bottom-width': "1px";
|
|
102
|
+
readonly 'border-bottom-style': "solid";
|
|
103
|
+
readonly 'border-bottom-color': "rgba(127, 127, 127, 0.25)";
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
readonly subTypes: {};
|
|
108
|
+
};
|
|
109
|
+
} & import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
110
|
+
__attributes: Partial<{
|
|
111
|
+
caption?: string | undefined;
|
|
112
|
+
items?: unknown[] | undefined;
|
|
113
|
+
itemKey?: string | undefined;
|
|
114
|
+
}>;
|
|
115
|
+
};
|
|
116
|
+
export default Table;
|
|
117
|
+
export type { TableProps } from './Table';
|
|
118
|
+
export type { TableColumnProps } from './TableColumn/TableColumn';
|