@20baht/ui 0.1.1 → 0.2.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/baht-form.js +30 -28
- package/dist/components/baht-workflow.js +27 -26
- package/dist/components/define.js +1 -1
- package/dist/components/primitives/baht-repeater.d.ts +7 -1
- package/dist/components/primitives/baht-repeater.js +68 -65
- package/dist/components/primitives/tag-map.d.ts +13 -2
- package/dist/components/primitives/tag-map.js +21 -32
- package/dist/custom-elements.json +43 -4
- package/dist/react.d.ts +354 -545
- package/dist/register.d.ts +10 -10
- package/dist/register.js +10 -10
- package/dist/ssr.js +1 -1
- package/dist/web-types.json +6 -1
- package/package.json +3 -2
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { nothing as d, html as l } from "lit";
|
|
2
|
-
import { property as
|
|
3
|
-
import { repeat as
|
|
2
|
+
import { property as f, state as R } from "lit/decorators.js";
|
|
3
|
+
import { repeat as b } from "lit/directives/repeat.js";
|
|
4
4
|
import { html as w } from "lit/static-html.js";
|
|
5
|
-
import { hasDom as
|
|
6
|
-
import { BahtFieldBase as
|
|
7
|
-
import {
|
|
8
|
-
import { defaultValue as
|
|
5
|
+
import { hasDom as F } from "../base.js";
|
|
6
|
+
import { BahtFieldBase as S } from "../field-base.js";
|
|
7
|
+
import { tagForField as m, staticTag as v, WIDTH_CLASS as k } from "./tag-map.js";
|
|
8
|
+
import { defaultValue as $, validateField as _, displayValue as O, t as n } from "@20baht/engine";
|
|
9
9
|
import { customElement as T } from "../define.js";
|
|
10
10
|
import { ReferenceLabels as x } from "../reference-labels.js";
|
|
11
11
|
import "./baht-button.js";
|
|
12
12
|
import "./baht-modal.js";
|
|
13
|
-
var I = Object.defineProperty, q = Object.getOwnPropertyDescriptor, c = (e, t, r,
|
|
14
|
-
for (var
|
|
15
|
-
(s = e[a]) && (
|
|
16
|
-
return
|
|
13
|
+
var I = Object.defineProperty, q = Object.getOwnPropertyDescriptor, c = (e, t, r, o) => {
|
|
14
|
+
for (var i = o > 1 ? void 0 : o ? q(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
15
|
+
(s = e[a]) && (i = (o ? s(t, r, i) : s(i)) || i);
|
|
16
|
+
return o && i && I(t, r, i), i;
|
|
17
17
|
};
|
|
18
18
|
const D = 4;
|
|
19
|
-
let p = class extends
|
|
19
|
+
let p = class extends S {
|
|
20
20
|
constructor() {
|
|
21
|
-
super(...arguments), this.rowErrors = [], this.rowStates = {}, this.rowLookup = null, this.draft = null, this.labels = new x(() => {
|
|
21
|
+
super(...arguments), this.rowErrors = [], this.rowStates = {}, this.rowLookup = null, this.registry = {}, this.draft = null, this.labels = new x(() => {
|
|
22
22
|
this.requestUpdate();
|
|
23
23
|
}), this.subFieldsCache = [];
|
|
24
24
|
}
|
|
@@ -31,13 +31,13 @@ let p = class extends F {
|
|
|
31
31
|
return e !== this.subFieldsSource && (this.subFieldsSource = e, this.subFieldsCache = [...e ?? []].sort((t, r) => t.order - r.order).filter((t) => t.type !== "repeater")), this.subFieldsCache;
|
|
32
32
|
}
|
|
33
33
|
patchRow(e, t, r) {
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const o = [...this.rows];
|
|
35
|
+
o[e] = { ...o[e], [t]: r }, this.emitInput(o);
|
|
36
36
|
}
|
|
37
37
|
blankRow() {
|
|
38
38
|
const e = {};
|
|
39
39
|
for (const t of this.subFields)
|
|
40
|
-
t.type === "label" || t.type === "section" || (e[t.key] =
|
|
40
|
+
t.type === "label" || t.type === "section" || (e[t.key] = $(t));
|
|
41
41
|
return e;
|
|
42
42
|
}
|
|
43
43
|
addRow() {
|
|
@@ -49,7 +49,7 @@ let p = class extends F {
|
|
|
49
49
|
/** Pending keystrokes in any row land in the array before the host reads it. */
|
|
50
50
|
flushTyped() {
|
|
51
51
|
var e;
|
|
52
|
-
if (!
|
|
52
|
+
if (!F()) {
|
|
53
53
|
super.flushTyped();
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
@@ -67,15 +67,15 @@ let p = class extends F {
|
|
|
67
67
|
/** A stored id in the row table: its label once known, the id until then. */
|
|
68
68
|
referenceLabel(e, t) {
|
|
69
69
|
var a;
|
|
70
|
-
const r = `${e.reference ?? ""}\0${t}`,
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
return
|
|
70
|
+
const r = `${e.reference ?? ""}\0${t}`, o = this.labels.get(r);
|
|
71
|
+
if (o !== void 0) return o;
|
|
72
|
+
const i = (a = this.lookupOf(e, () => ({}))) == null ? void 0 : a.resolve;
|
|
73
|
+
return i && this.labels.request(r, t, i), t;
|
|
74
74
|
}
|
|
75
75
|
errorFor(e, t) {
|
|
76
|
-
var
|
|
76
|
+
var o;
|
|
77
77
|
const r = `${this.field.key}[${e}].${t}`;
|
|
78
|
-
return ((
|
|
78
|
+
return ((o = this.rowErrors.find((i) => i.key === r)) == null ? void 0 : o.message) ?? null;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Sub-controls render declaratively (one static-tag template per primitive, rows
|
|
@@ -83,21 +83,21 @@ let p = class extends F {
|
|
|
83
83
|
* focus, same as <baht-form> — and the whole thing renders on the server.
|
|
84
84
|
*/
|
|
85
85
|
renderSub(e, t, r) {
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
86
|
+
const o = m(r.type, this.registry);
|
|
87
|
+
if (!o) return d;
|
|
88
|
+
const i = v(o), a = k[r.width ?? "full"] ?? "baht-field--w-full", s = this.rowStates[`${this.field.key}[${t}].${r.key}`], h = (y) => {
|
|
89
89
|
y.stopPropagation();
|
|
90
90
|
const { value: g } = y.detail;
|
|
91
91
|
this.patchRow(t, r.key, g);
|
|
92
|
-
},
|
|
92
|
+
}, u = r.hidden === !0 || s !== void 0 && !s.visible;
|
|
93
93
|
return l`<div
|
|
94
|
-
class="baht-field ${a}${
|
|
94
|
+
class="baht-field ${a}${u ? " baht-field--hidden" : ""}"
|
|
95
95
|
data-key=${r.key}
|
|
96
96
|
data-type=${r.type}
|
|
97
97
|
>
|
|
98
|
-
${w`<${
|
|
98
|
+
${w`<${i}
|
|
99
99
|
.field=${r}
|
|
100
|
-
.value=${Object.hasOwn(e, r.key) ? e[r.key] :
|
|
100
|
+
.value=${Object.hasOwn(e, r.key) ? e[r.key] : $(r)}
|
|
101
101
|
.disabled=${this.disabled || s !== void 0 && !s.enabled}
|
|
102
102
|
.readonly=${this.readonly || ((s == null ? void 0 : s.readonly) ?? !1)}
|
|
103
103
|
.required=${s ? s.required : !!r.required}
|
|
@@ -105,19 +105,19 @@ let p = class extends F {
|
|
|
105
105
|
.debounce=${this.debounce}
|
|
106
106
|
.lookup=${this.lookupOf(r, () => this.rows[t] ?? {})}
|
|
107
107
|
@baht-input=${h}
|
|
108
|
-
></${
|
|
108
|
+
></${i}>`}
|
|
109
109
|
</div>`;
|
|
110
110
|
}
|
|
111
111
|
/** The dialog's copy of a row: edits stay in it until Save. */
|
|
112
112
|
renderDraftSub(e, t) {
|
|
113
113
|
var s;
|
|
114
|
-
const r = m
|
|
114
|
+
const r = m(t.type, this.registry);
|
|
115
115
|
if (!r || t.hidden) return d;
|
|
116
|
-
const
|
|
117
|
-
return l`<div class="baht-field ${
|
|
118
|
-
${w`<${
|
|
116
|
+
const o = v(r), i = k[t.width ?? "full"] ?? "baht-field--w-full", a = ((s = e.errors.find((h) => h.key === t.key)) == null ? void 0 : s.message) ?? null;
|
|
117
|
+
return l`<div class="baht-field ${i}" data-key=${t.key} data-type=${t.type}>
|
|
118
|
+
${w`<${o}
|
|
119
119
|
.field=${t}
|
|
120
|
-
.value=${Object.hasOwn(e.row, t.key) ? e.row[t.key] :
|
|
120
|
+
.value=${Object.hasOwn(e.row, t.key) ? e.row[t.key] : $(t)}
|
|
121
121
|
.required=${!!t.required}
|
|
122
122
|
.error=${a}
|
|
123
123
|
.debounce=${this.debounce}
|
|
@@ -127,10 +127,10 @@ let p = class extends F {
|
|
|
127
127
|
})}
|
|
128
128
|
@baht-input=${(h) => {
|
|
129
129
|
h.stopPropagation();
|
|
130
|
-
const { value:
|
|
131
|
-
this.draft && (this.draft = { ...this.draft, row: { ...this.draft.row, [t.key]:
|
|
130
|
+
const { value: u } = h.detail;
|
|
131
|
+
this.draft && (this.draft = { ...this.draft, row: { ...this.draft.row, [t.key]: u } });
|
|
132
132
|
}}
|
|
133
|
-
></${
|
|
133
|
+
></${o}>`}
|
|
134
134
|
</div>`;
|
|
135
135
|
}
|
|
136
136
|
saveDraft() {
|
|
@@ -138,7 +138,7 @@ let p = class extends F {
|
|
|
138
138
|
const e = this.draft;
|
|
139
139
|
if (!e) return;
|
|
140
140
|
const t = this.subFields.flatMap(
|
|
141
|
-
(
|
|
141
|
+
(o) => o.type === "label" || o.type === "section" || o.hidden ? [] : _(o, e.row[o.key], this.registry, e.row, {})
|
|
142
142
|
);
|
|
143
143
|
if (t.length > 0) {
|
|
144
144
|
this.draft = { ...e, errors: t };
|
|
@@ -148,12 +148,12 @@ let p = class extends F {
|
|
|
148
148
|
e.index === null ? r.push(e.row) : r[e.index] = e.row, this.draft = null, this.emitInput(r);
|
|
149
149
|
}
|
|
150
150
|
cellText(e, t) {
|
|
151
|
-
const r = O(e, t[e.key]);
|
|
152
|
-
return r.kind === "text" ? e.type === "reference" ? this.referenceLabel(e, r.text) : r.text : r.kind === "chips" ? r.items.join(", ") : r.kind === "files" ? r.items.map((
|
|
151
|
+
const r = O(e, t[e.key], e.options, this.registry);
|
|
152
|
+
return r.kind === "text" ? e.type === "reference" ? this.referenceLabel(e, r.text) : r.text : r.kind === "chips" ? r.items.join(", ") : r.kind === "files" ? r.items.map((o) => o.name).join(", ") : "";
|
|
153
153
|
}
|
|
154
154
|
/** `row_editor: 'dialog'`: the rows as a table, one opened at a time in a modal. */
|
|
155
155
|
renderTable(e, t) {
|
|
156
|
-
const r = this.subFields.filter((
|
|
156
|
+
const r = this.subFields.filter((i) => i.type !== "label" && i.type !== "section" && !i.hidden).slice(0, D), o = this.draft;
|
|
157
157
|
return l`<div
|
|
158
158
|
class="baht-repeater baht-repeater--table"
|
|
159
159
|
id=${this.controlId}
|
|
@@ -164,17 +164,17 @@ let p = class extends F {
|
|
|
164
164
|
${this.rows.length > 0 ? l`<table class="baht-repeater-table">
|
|
165
165
|
<thead>
|
|
166
166
|
<tr>
|
|
167
|
-
${r.map((
|
|
167
|
+
${r.map((i) => l`<th scope="col">${i.label ?? i.key}</th>`)}
|
|
168
168
|
${e ? l`<th scope="col"></th>` : d}
|
|
169
169
|
</tr>
|
|
170
170
|
</thead>
|
|
171
171
|
<tbody>
|
|
172
172
|
${this.rows.map(
|
|
173
|
-
(
|
|
173
|
+
(i, a) => l`<tr
|
|
174
174
|
data-row=${a}
|
|
175
175
|
class=${this.rowErrors.some((s) => s.key.startsWith(`${this.field.key}[${String(a)}]`)) ? "baht-repeater-table-row--invalid" : ""}
|
|
176
176
|
>
|
|
177
|
-
${r.map((s) => l`<td>${this.cellText(s,
|
|
177
|
+
${r.map((s) => l`<td>${this.cellText(s, i)}</td>`)}
|
|
178
178
|
${e ? l`<td class="baht-repeater-table-actions">
|
|
179
179
|
<button
|
|
180
180
|
type="button"
|
|
@@ -182,7 +182,7 @@ let p = class extends F {
|
|
|
182
182
|
aria-label=${n("editRowN", { n: a + 1 })}
|
|
183
183
|
title=${n("editRowN", { n: a + 1 })}
|
|
184
184
|
@click=${() => {
|
|
185
|
-
this.draft = { index: a, row: { ...
|
|
185
|
+
this.draft = { index: a, row: { ...i }, errors: [] };
|
|
186
186
|
}}
|
|
187
187
|
>
|
|
188
188
|
✎
|
|
@@ -214,17 +214,17 @@ let p = class extends F {
|
|
|
214
214
|
+ ${this.field.add_label ?? n("addRow")}
|
|
215
215
|
</button>` : d}
|
|
216
216
|
<baht-modal
|
|
217
|
-
.open=${
|
|
217
|
+
.open=${o !== null}
|
|
218
218
|
.heading=${this.field.label ?? ""}
|
|
219
|
-
@baht-close=${(
|
|
220
|
-
|
|
219
|
+
@baht-close=${(i) => {
|
|
220
|
+
i.stopPropagation(), this.draft = null;
|
|
221
221
|
}}
|
|
222
222
|
>
|
|
223
223
|
<div class="baht-repeater-dialog">
|
|
224
|
-
${
|
|
224
|
+
${o ? b(
|
|
225
225
|
this.subFields,
|
|
226
|
-
(
|
|
227
|
-
(
|
|
226
|
+
(i) => i.key,
|
|
227
|
+
(i) => this.renderDraftSub(o, i)
|
|
228
228
|
) : d}
|
|
229
229
|
<div class="baht-repeater-dialog-actions">
|
|
230
230
|
<baht-button
|
|
@@ -255,27 +255,27 @@ let p = class extends F {
|
|
|
255
255
|
aria-labelledby=${this.field.label ? this.labelId : d}
|
|
256
256
|
aria-describedby=${this.describedBy}
|
|
257
257
|
>
|
|
258
|
-
${
|
|
258
|
+
${b(
|
|
259
259
|
e,
|
|
260
|
-
(
|
|
261
|
-
(
|
|
260
|
+
(o, i) => i,
|
|
261
|
+
(o, i) => l`<div
|
|
262
262
|
class="baht-repeater-row"
|
|
263
|
-
data-row=${
|
|
263
|
+
data-row=${i}
|
|
264
264
|
role="group"
|
|
265
|
-
aria-label=${n("row", { n:
|
|
265
|
+
aria-label=${n("row", { n: i + 1 })}
|
|
266
266
|
>
|
|
267
|
-
${
|
|
267
|
+
${b(
|
|
268
268
|
this.subFields,
|
|
269
269
|
(a) => a.key,
|
|
270
|
-
(a) => this.renderSub(
|
|
270
|
+
(a) => this.renderSub(o, i, a)
|
|
271
271
|
)}
|
|
272
272
|
${t ? l`<button
|
|
273
273
|
type="button"
|
|
274
274
|
class="baht-repeater-remove"
|
|
275
|
-
aria-label=${n("removeRowN", { n:
|
|
276
|
-
title=${n("removeRowN", { n:
|
|
275
|
+
aria-label=${n("removeRowN", { n: i + 1 })}
|
|
276
|
+
title=${n("removeRowN", { n: i + 1 })}
|
|
277
277
|
@click=${() => {
|
|
278
|
-
this.removeRow(
|
|
278
|
+
this.removeRow(i);
|
|
279
279
|
}}
|
|
280
280
|
>
|
|
281
281
|
✕
|
|
@@ -296,14 +296,17 @@ let p = class extends F {
|
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
298
|
c([
|
|
299
|
-
|
|
299
|
+
f({ attribute: !1 })
|
|
300
300
|
], p.prototype, "rowErrors", 2);
|
|
301
301
|
c([
|
|
302
|
-
|
|
302
|
+
f({ attribute: !1 })
|
|
303
303
|
], p.prototype, "rowStates", 2);
|
|
304
304
|
c([
|
|
305
|
-
|
|
305
|
+
f({ attribute: !1 })
|
|
306
306
|
], p.prototype, "rowLookup", 2);
|
|
307
|
+
c([
|
|
308
|
+
f({ attribute: !1 })
|
|
309
|
+
], p.prototype, "registry", 2);
|
|
307
310
|
c([
|
|
308
311
|
R()
|
|
309
312
|
], p.prototype, "draft", 2);
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { StaticValue } from 'lit/static-html.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { BuiltInFieldType, Registry } from '@20baht/engine';
|
|
3
|
+
/**
|
|
4
|
+
* field descriptor `type` -> primitive tag (used by <baht-form>, <baht-repeater>
|
|
5
|
+
* and the builder), read from the engine's one table of built-in types. Lives in its own module
|
|
6
|
+
* so baht-repeater can read it without importing the primitives barrel (which would be circular).
|
|
7
|
+
*/
|
|
8
|
+
export declare const TAG_FOR_TYPE: Record<BuiltInFieldType, string>;
|
|
4
9
|
/** `field.width` -> layout class, shared by <baht-form> and <baht-repeater>. */
|
|
5
10
|
export declare const WIDTH_CLASS: Record<string, string>;
|
|
6
11
|
export declare function staticTag(tag: string): StaticValue;
|
|
12
|
+
/**
|
|
13
|
+
* The tag that renders a field type: the built-in primitive, else the element the app
|
|
14
|
+
* registered for a type of its own (`registry.fieldTypes[type].tag`, spec 01 §5.1). Undefined
|
|
15
|
+
* for a type nobody knows, and for a registered tag that is not a custom element name.
|
|
16
|
+
*/
|
|
17
|
+
export declare function tagForField(type: string, registry: Pick<Registry, 'fieldTypes'> | undefined): string | undefined;
|
|
@@ -1,39 +1,28 @@
|
|
|
1
|
-
import { unsafeStatic as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
textarea: "baht-textarea",
|
|
7
|
-
markdown: "baht-markdown",
|
|
8
|
-
number: "baht-number",
|
|
9
|
-
currency: "baht-currency",
|
|
10
|
-
dropdown: "baht-select",
|
|
11
|
-
multiselect: "baht-multiselect",
|
|
12
|
-
checkbox: "baht-checkbox",
|
|
13
|
-
radio: "baht-radio",
|
|
14
|
-
toggle: "baht-toggle",
|
|
15
|
-
date: "baht-datepicker",
|
|
16
|
-
time: e,
|
|
17
|
-
file: "baht-file",
|
|
18
|
-
label: "baht-text",
|
|
19
|
-
section: "baht-section",
|
|
20
|
-
repeater: "baht-repeater",
|
|
21
|
-
tags: "baht-tags",
|
|
22
|
-
rating: "baht-rating",
|
|
23
|
-
range: "baht-range",
|
|
24
|
-
reference: "baht-reference-picker"
|
|
25
|
-
}, c = {
|
|
1
|
+
import { unsafeStatic as f } from "lit/static-html.js";
|
|
2
|
+
import { BUILT_IN_FIELD_TYPES as T, BUILT_IN_TYPES as l, builtInType as r, fieldTypeSpec as _ } from "@20baht/engine";
|
|
3
|
+
const E = Object.fromEntries(
|
|
4
|
+
T.map((t) => [t, l[t].tag])
|
|
5
|
+
), I = {
|
|
26
6
|
"1/4": "baht-field--w-1-4",
|
|
27
7
|
"1/2": "baht-field--w-1-2",
|
|
28
8
|
"3/4": "baht-field--w-3-4",
|
|
29
9
|
full: "baht-field--w-full"
|
|
30
|
-
},
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
return
|
|
10
|
+
}, o = /* @__PURE__ */ new Map();
|
|
11
|
+
function d(t) {
|
|
12
|
+
let e = o.get(t);
|
|
13
|
+
return e || (e = f(t), o.set(t, e)), e;
|
|
14
|
+
}
|
|
15
|
+
const c = /^[a-z][a-z0-9._]*-[a-z0-9._-]*$/;
|
|
16
|
+
function S(t, e) {
|
|
17
|
+
var a;
|
|
18
|
+
const n = r(t);
|
|
19
|
+
if (n) return n.tag;
|
|
20
|
+
const i = (a = _(e, t)) == null ? void 0 : a.tag;
|
|
21
|
+
return i !== void 0 && c.test(i) ? i : void 0;
|
|
34
22
|
}
|
|
35
23
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
E as TAG_FOR_TYPE,
|
|
25
|
+
I as WIDTH_CLASS,
|
|
26
|
+
d as staticTag,
|
|
27
|
+
S as tagForField
|
|
39
28
|
};
|
|
@@ -29096,6 +29096,15 @@
|
|
|
29096
29096
|
"default": "null",
|
|
29097
29097
|
"description": "Set by the host form: what makes a `reference` column searchable."
|
|
29098
29098
|
},
|
|
29099
|
+
{
|
|
29100
|
+
"kind": "field",
|
|
29101
|
+
"name": "registry",
|
|
29102
|
+
"type": {
|
|
29103
|
+
"text": "Registry"
|
|
29104
|
+
},
|
|
29105
|
+
"default": "{}",
|
|
29106
|
+
"description": "Set by the host form: its registry. A column of a type of the app's own (spec 01 §5.1)\nrenders, reads and checks through `registry.fieldTypes`; the row dialog runs the column's\n`custom` validators from it."
|
|
29107
|
+
},
|
|
29099
29108
|
{
|
|
29100
29109
|
"kind": "field",
|
|
29101
29110
|
"name": "draft",
|
|
@@ -45069,10 +45078,8 @@
|
|
|
45069
45078
|
{
|
|
45070
45079
|
"kind": "variable",
|
|
45071
45080
|
"name": "TAG_FOR_TYPE",
|
|
45072
|
-
"
|
|
45073
|
-
|
|
45074
|
-
},
|
|
45075
|
-
"default": "{ text: INPUT, email: INPUT, password: INPUT, textarea: 'baht-textarea', markdown: 'baht-markdown', number: 'baht-number', currency: 'baht-currency', dropdown: 'baht-select', multiselect: 'baht-multiselect', checkbox: 'baht-checkbox', radio: 'baht-radio', toggle: 'baht-toggle', date: 'baht-datepicker', time: INPUT, file: 'baht-file', label: 'baht-text', section: 'baht-section', repeater: 'baht-repeater', tags: 'baht-tags', rating: 'baht-rating', range: 'baht-range', reference: 'baht-reference-picker', }"
|
|
45081
|
+
"default": "Object.fromEntries( BUILT_IN_FIELD_TYPES.map((type) => [type, BUILT_IN_TYPES[type].tag]), )",
|
|
45082
|
+
"description": "field descriptor `type` -> primitive tag (used by <baht-form>, <baht-repeater>\nand the builder), read from the engine's one table of built-in types. Lives in its own module\nso baht-repeater can read it without importing the primitives barrel (which would be circular)."
|
|
45076
45083
|
},
|
|
45077
45084
|
{
|
|
45078
45085
|
"kind": "variable",
|
|
@@ -45099,6 +45106,30 @@
|
|
|
45099
45106
|
}
|
|
45100
45107
|
}
|
|
45101
45108
|
]
|
|
45109
|
+
},
|
|
45110
|
+
{
|
|
45111
|
+
"kind": "function",
|
|
45112
|
+
"name": "tagForField",
|
|
45113
|
+
"return": {
|
|
45114
|
+
"type": {
|
|
45115
|
+
"text": "string | undefined"
|
|
45116
|
+
}
|
|
45117
|
+
},
|
|
45118
|
+
"parameters": [
|
|
45119
|
+
{
|
|
45120
|
+
"name": "type",
|
|
45121
|
+
"type": {
|
|
45122
|
+
"text": "string"
|
|
45123
|
+
}
|
|
45124
|
+
},
|
|
45125
|
+
{
|
|
45126
|
+
"name": "registry",
|
|
45127
|
+
"type": {
|
|
45128
|
+
"text": "Pick<Registry, 'fieldTypes'> | undefined"
|
|
45129
|
+
}
|
|
45130
|
+
}
|
|
45131
|
+
],
|
|
45132
|
+
"description": "The tag that renders a field type: the built-in primitive, else the element the app\nregistered for a type of its own (`registry.fieldTypes[type].tag`, spec 01 §5.1). Undefined\nfor a type nobody knows, and for a registered tag that is not a custom element name."
|
|
45102
45133
|
}
|
|
45103
45134
|
],
|
|
45104
45135
|
"exports": [
|
|
@@ -45125,6 +45156,14 @@
|
|
|
45125
45156
|
"name": "staticTag",
|
|
45126
45157
|
"module": "src/components/primitives/tag-map.ts"
|
|
45127
45158
|
}
|
|
45159
|
+
},
|
|
45160
|
+
{
|
|
45161
|
+
"kind": "js",
|
|
45162
|
+
"name": "tagForField",
|
|
45163
|
+
"declaration": {
|
|
45164
|
+
"name": "tagForField",
|
|
45165
|
+
"module": "src/components/primitives/tag-map.ts"
|
|
45166
|
+
}
|
|
45128
45167
|
}
|
|
45129
45168
|
]
|
|
45130
45169
|
},
|