@rhi-zone/rainbow-ui 0.2.0-alpha.4 → 0.2.0-alpha.6
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/{html-C8SnQjvU.js → html-Bl4HvyCp.js} +98 -96
- package/dist/html.d.ts +47 -2
- package/dist/html.js +49 -48
- package/dist/index.js +36 -35
- package/dist/widget.d.ts +22 -6
- package/dist/widget.js +191 -187
- package/package.json +1 -1
|
@@ -40,50 +40,50 @@ const u = (t, ...s) => e("html")(t, ...s), m = (t, ...s) => e("head")(t, ...s),
|
|
|
40
40
|
}, v = (t, s) => {
|
|
41
41
|
const n = document.createElement("title");
|
|
42
42
|
return c(n, t), n.textContent = s, { _tag: "title", node: n };
|
|
43
|
-
}, _ = (t, ...s) => e("div")(t, ...s), y = (t, ...s) => e("section")(t, ...s), x = (t, ...s) => e("article")(t, ...s), E = (t, ...s) => e("aside")(t, ...s), k = (t, ...s) => e("header")(t, ...s), S = (t, ...s) => e("footer")(t, ...s), C = (t, ...s) => e("main")(t, ...s), N = (t, ...s) => e("nav")(t, ...s), j = (t, ...s) => e("h1")(t, ...s), w = (t, ...s) => e("h2")(t, ...s), G = (t, ...s) => e("h3")(t, ...s), O = (t, ...s) => e("h4")(t, ...s), q = (t, ...s) => e("h5")(t, ...s), T = (t, ...s) => e("h6")(t, ...s), P = (t, ...s) => e("p")(t, ...s), A = (t, ...s) => e("a")(t, ...s), V = (t, ...s) => e("span")(t, ...s), z = (t, ...s) => e("em")(t, ...s), I = (t, ...s) => e("strong")(t, ...s), M = (t, ...s) => e("code")(t, ...s), B = (t, ...s) => e("pre")(t, ...s), D = (t, ...s) => e("blockquote")(t, ...s), F = (t, ...s) => e("i")(t, ...s), H = (t, ...s) => e("b")(t, ...s), J = (t, ...s) => e("small")(t, ...s), K = (t, ...s) => e("abbr")(t, ...s), L = () => ({ _tag: "br", node: document.createElement("br") }), Q = (t = {}) => l("hr")(t), R = (t) => l("img")(t), U = (t, ...s) => e("ul")(t, ...s), W = (t, ...s) => e("ol")(t, ...s), X = (t, ...s) => e("li")(t, ...s), Y = (t, ...s) => e("dl")(t, ...s), Z = (t, ...s) => e("dt")(t, ...s), $ = (t, ...s) => e("dd")(t, ...s), tt = (t, ...s) => e("table")(t, ...s), st = (t, ...s) => e("thead")(t, ...s), et = (t, ...s) => e("tbody")(t, ...s), nt = (t, ...s) => e("tfoot")(t, ...s), at = (t, ...s) => e("tr")(t, ...s), ot = (t, ...s) => e("th")(t, ...s), ct = (t, ...s) => e("td")(t, ...s), rt = (t, ...s) => e("form")(t, ...s), lt = (t) => l("input")(t), it = (t, ...s) => e("label")(t, ...s), dt = (t, ...s) => e("fieldset")(t, ...s), ut = (t, ...s) => e("
|
|
43
|
+
}, _ = (t, ...s) => e("div")(t, ...s), y = (t, ...s) => e("section")(t, ...s), x = (t, ...s) => e("article")(t, ...s), E = (t, ...s) => e("aside")(t, ...s), k = (t, ...s) => e("header")(t, ...s), S = (t, ...s) => e("footer")(t, ...s), C = (t, ...s) => e("main")(t, ...s), N = (t, ...s) => e("nav")(t, ...s), j = (t, ...s) => e("h1")(t, ...s), w = (t, ...s) => e("h2")(t, ...s), G = (t, ...s) => e("h3")(t, ...s), O = (t, ...s) => e("h4")(t, ...s), q = (t, ...s) => e("h5")(t, ...s), T = (t, ...s) => e("h6")(t, ...s), P = (t, ...s) => e("p")(t, ...s), A = (t, ...s) => e("a")(t, ...s), V = (t, ...s) => e("span")(t, ...s), z = (t, ...s) => e("em")(t, ...s), I = (t, ...s) => e("strong")(t, ...s), M = (t, ...s) => e("code")(t, ...s), B = (t, ...s) => e("pre")(t, ...s), D = (t, ...s) => e("blockquote")(t, ...s), F = (t, ...s) => e("i")(t, ...s), H = (t, ...s) => e("b")(t, ...s), J = (t, ...s) => e("small")(t, ...s), K = (t, ...s) => e("abbr")(t, ...s), L = () => ({ _tag: "br", node: document.createElement("br") }), Q = (t = {}) => l("hr")(t), R = (t) => l("img")(t), U = (t, ...s) => e("ul")(t, ...s), W = (t, ...s) => e("ol")(t, ...s), X = (t, ...s) => e("li")(t, ...s), Y = (t, ...s) => e("dl")(t, ...s), Z = (t, ...s) => e("dt")(t, ...s), $ = (t, ...s) => e("dd")(t, ...s), tt = (t, ...s) => e("table")(t, ...s), st = (t, ...s) => e("thead")(t, ...s), et = (t, ...s) => e("tbody")(t, ...s), nt = (t, ...s) => e("tfoot")(t, ...s), at = (t, ...s) => e("tr")(t, ...s), ot = (t, ...s) => e("th")(t, ...s), ct = (t, ...s) => e("td")(t, ...s), rt = (t, ...s) => e("form")(t, ...s), lt = (t) => l("input")(t), it = (t, ...s) => e("label")(t, ...s), dt = (t, ...s) => e("fieldset")(t, ...s), ut = (t, ...s) => e("legend")(t, ...s), mt = (t, ...s) => e("select")(t, ...s), pt = (t, s) => {
|
|
44
44
|
const n = document.createElement("option");
|
|
45
45
|
return c(n, t), s !== void 0 && (n.textContent = s), { _tag: "option", node: n };
|
|
46
|
-
},
|
|
46
|
+
}, gt = (t, s) => {
|
|
47
47
|
const n = document.createElement("textarea");
|
|
48
48
|
return c(n, t), s !== void 0 && (n.textContent = s), { _tag: "textarea", node: n };
|
|
49
|
-
},
|
|
49
|
+
}, ft = (t, ...s) => e("button")(t, ...s), ht = (t) => l("iframe")(t), bt = (t, ...s) => e("video")(t, ...s), vt = (t, ...s) => e("audio")(t, ...s), _t = (t) => l("source")(t), yt = (t) => l("canvas")(t), xt = (t, ...s) => {
|
|
50
50
|
const n = document.createElementNS(i, "svg");
|
|
51
51
|
return c(n, t), d(n, s), { _tag: "svg", node: n };
|
|
52
|
-
},
|
|
53
|
-
function
|
|
52
|
+
}, Et = (t) => r("circle")(t), kt = (t) => r("ellipse")(t), St = (t) => r("rect")(t), Ct = (t) => r("line")(t), Nt = (t) => r("polyline")(t), jt = (t) => r("polygon")(t), wt = (t) => r("path")(t), Gt = (t, ...s) => o("text")(t, ...s), Ot = (t, ...s) => o("tspan")(t, ...s), qt = (t, ...s) => o("g")(t, ...s), Tt = (t, ...s) => o("defs")(t, ...s), Pt = (t, ...s) => o("symbol")(t, ...s), At = (t) => r("use")(t), Vt = (t, ...s) => o("clipPath")(t, ...s), zt = (t, ...s) => o("mask")(t, ...s), It = (t, ...s) => o("linearGradient")(t, ...s), Mt = (t, ...s) => o("radialGradient")(t, ...s), Bt = (t) => r("stop")(t), Dt = (t, ...s) => o("pattern")(t, ...s), Ft = (t) => r("image")(t), Ht = (t, ...s) => o("foreignObject")(t, ...s);
|
|
53
|
+
function Jt(t) {
|
|
54
54
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Kt(t) {
|
|
57
57
|
return document.createTextNode(t);
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
60
60
|
__proto__: null,
|
|
61
61
|
a: A,
|
|
62
62
|
abbr: K,
|
|
63
63
|
article: x,
|
|
64
64
|
aside: E,
|
|
65
|
-
audio:
|
|
65
|
+
audio: vt,
|
|
66
66
|
b: H,
|
|
67
67
|
blockquote: D,
|
|
68
68
|
body: p,
|
|
69
69
|
br: L,
|
|
70
|
-
button:
|
|
71
|
-
canvas:
|
|
72
|
-
circle:
|
|
73
|
-
clipPath:
|
|
70
|
+
button: ft,
|
|
71
|
+
canvas: yt,
|
|
72
|
+
circle: Et,
|
|
73
|
+
clipPath: Vt,
|
|
74
74
|
code: M,
|
|
75
75
|
dd: $,
|
|
76
|
-
defs:
|
|
76
|
+
defs: Tt,
|
|
77
77
|
div: _,
|
|
78
78
|
dl: Y,
|
|
79
79
|
dt: Z,
|
|
80
|
-
ellipse:
|
|
80
|
+
ellipse: kt,
|
|
81
81
|
em: z,
|
|
82
82
|
fieldset: dt,
|
|
83
83
|
footer: S,
|
|
84
|
-
foreignObject:
|
|
84
|
+
foreignObject: Ht,
|
|
85
85
|
form: rt,
|
|
86
|
-
g:
|
|
86
|
+
g: qt,
|
|
87
87
|
h1: j,
|
|
88
88
|
h2: w,
|
|
89
89
|
h3: G,
|
|
@@ -95,64 +95,65 @@ const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
95
95
|
hr: Q,
|
|
96
96
|
htmlEl: u,
|
|
97
97
|
i: F,
|
|
98
|
-
iframe:
|
|
98
|
+
iframe: ht,
|
|
99
99
|
img: R,
|
|
100
100
|
input: lt,
|
|
101
101
|
label: it,
|
|
102
|
+
legend: ut,
|
|
102
103
|
li: X,
|
|
103
|
-
line:
|
|
104
|
-
linearGradient:
|
|
104
|
+
line: Ct,
|
|
105
|
+
linearGradient: It,
|
|
105
106
|
link: f,
|
|
106
107
|
main: C,
|
|
107
|
-
mask:
|
|
108
|
+
mask: zt,
|
|
108
109
|
meta: g,
|
|
109
110
|
nav: N,
|
|
110
111
|
ol: W,
|
|
111
|
-
option:
|
|
112
|
+
option: pt,
|
|
112
113
|
p: P,
|
|
113
|
-
path:
|
|
114
|
-
pattern:
|
|
115
|
-
polygon:
|
|
116
|
-
polyline:
|
|
114
|
+
path: wt,
|
|
115
|
+
pattern: Dt,
|
|
116
|
+
polygon: jt,
|
|
117
|
+
polyline: Nt,
|
|
117
118
|
pre: B,
|
|
118
|
-
radialGradient:
|
|
119
|
-
rect:
|
|
119
|
+
radialGradient: Mt,
|
|
120
|
+
rect: St,
|
|
120
121
|
script: h,
|
|
121
122
|
section: y,
|
|
122
|
-
select:
|
|
123
|
+
select: mt,
|
|
123
124
|
small: J,
|
|
124
|
-
source:
|
|
125
|
+
source: _t,
|
|
125
126
|
span: V,
|
|
126
|
-
stop:
|
|
127
|
+
stop: Bt,
|
|
127
128
|
strong: I,
|
|
128
129
|
style: b,
|
|
129
|
-
svg:
|
|
130
|
-
svgImage:
|
|
131
|
-
svgText:
|
|
132
|
-
symbol:
|
|
130
|
+
svg: xt,
|
|
131
|
+
svgImage: Ft,
|
|
132
|
+
svgText: Gt,
|
|
133
|
+
symbol: Pt,
|
|
133
134
|
table: tt,
|
|
134
135
|
tbody: et,
|
|
135
136
|
td: ct,
|
|
136
|
-
text:
|
|
137
|
-
textNode:
|
|
138
|
-
textarea:
|
|
137
|
+
text: Jt,
|
|
138
|
+
textNode: Kt,
|
|
139
|
+
textarea: gt,
|
|
139
140
|
tfoot: nt,
|
|
140
141
|
th: ot,
|
|
141
142
|
thead: st,
|
|
142
143
|
title_: v,
|
|
143
144
|
tr: at,
|
|
144
|
-
tspan:
|
|
145
|
+
tspan: Ot,
|
|
145
146
|
ul: U,
|
|
146
|
-
use:
|
|
147
|
-
video:
|
|
147
|
+
use: At,
|
|
148
|
+
video: bt
|
|
148
149
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
149
150
|
export {
|
|
150
|
-
|
|
151
|
+
N as $,
|
|
151
152
|
dt as A,
|
|
152
153
|
S as B,
|
|
153
|
-
|
|
154
|
+
Ht as C,
|
|
154
155
|
rt as D,
|
|
155
|
-
|
|
156
|
+
qt as E,
|
|
156
157
|
j as F,
|
|
157
158
|
w as G,
|
|
158
159
|
G as H,
|
|
@@ -164,75 +165,76 @@ export {
|
|
|
164
165
|
Q as N,
|
|
165
166
|
u as O,
|
|
166
167
|
F as P,
|
|
167
|
-
|
|
168
|
+
ht as Q,
|
|
168
169
|
R,
|
|
169
170
|
it as S,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
ut as T,
|
|
172
|
+
X as U,
|
|
173
|
+
Ct as V,
|
|
174
|
+
It as W,
|
|
175
|
+
f as X,
|
|
176
|
+
C as Y,
|
|
177
|
+
zt as Z,
|
|
178
|
+
g as _,
|
|
178
179
|
A as a,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
180
|
+
W as a0,
|
|
181
|
+
P as a1,
|
|
182
|
+
wt as a2,
|
|
183
|
+
Dt as a3,
|
|
184
|
+
jt as a4,
|
|
185
|
+
Nt as a5,
|
|
186
|
+
B as a6,
|
|
187
|
+
Mt as a7,
|
|
188
|
+
St as a8,
|
|
189
|
+
h as a9,
|
|
190
|
+
y as aa,
|
|
191
|
+
J as ab,
|
|
192
|
+
_t as ac,
|
|
193
|
+
V as ad,
|
|
194
|
+
Bt as ae,
|
|
195
|
+
I as af,
|
|
196
|
+
b as ag,
|
|
197
|
+
xt as ah,
|
|
198
|
+
Ft as ai,
|
|
199
|
+
Gt as aj,
|
|
200
|
+
Pt as ak,
|
|
201
|
+
tt as al,
|
|
202
|
+
et as am,
|
|
203
|
+
ct as an,
|
|
203
204
|
Jt as ao,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
at,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
Kt as ap,
|
|
206
|
+
nt as aq,
|
|
207
|
+
ot as ar,
|
|
208
|
+
st as as,
|
|
209
|
+
v as at,
|
|
210
|
+
at as au,
|
|
211
|
+
Ot as av,
|
|
212
|
+
U as aw,
|
|
213
|
+
At as ax,
|
|
214
|
+
bt as ay,
|
|
213
215
|
K as b,
|
|
214
216
|
x as c,
|
|
215
217
|
E as d,
|
|
216
|
-
|
|
218
|
+
vt as e,
|
|
217
219
|
H as f,
|
|
218
220
|
D as g,
|
|
219
|
-
|
|
221
|
+
Lt as h,
|
|
220
222
|
lt as i,
|
|
221
223
|
p as j,
|
|
222
224
|
L as k,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
ft as l,
|
|
226
|
+
yt as m,
|
|
227
|
+
Et as n,
|
|
228
|
+
pt as o,
|
|
229
|
+
Vt as p,
|
|
228
230
|
M as q,
|
|
229
231
|
$ as r,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
232
|
+
mt as s,
|
|
233
|
+
gt as t,
|
|
234
|
+
Tt as u,
|
|
233
235
|
_ as v,
|
|
234
236
|
Y as w,
|
|
235
237
|
Z as x,
|
|
236
|
-
|
|
238
|
+
kt as y,
|
|
237
239
|
z
|
|
238
240
|
};
|
package/dist/html.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export type FormEl = El<"form", HTMLFormElement>;
|
|
|
66
66
|
export type InputEl = El<"input", HTMLInputElement>;
|
|
67
67
|
export type LabelEl = El<"label", HTMLLabelElement>;
|
|
68
68
|
export type FieldsetEl = El<"fieldset", HTMLFieldSetElement>;
|
|
69
|
+
export type LegendEl = El<"legend", HTMLLegendElement>;
|
|
69
70
|
export type SelectEl = El<"select", HTMLSelectElement>;
|
|
70
71
|
export type OptionEl = El<"option", HTMLOptionElement>;
|
|
71
72
|
export type TextareaEl = El<"textarea", HTMLTextAreaElement>;
|
|
@@ -113,10 +114,53 @@ export type RowContent = TrEl;
|
|
|
113
114
|
export type CellContent = TdEl | ThEl;
|
|
114
115
|
export type ListItemContent = LiEl;
|
|
115
116
|
export type SelectContent = OptionEl;
|
|
117
|
+
export type LegendContent = LegendEl;
|
|
116
118
|
export type DefinitionListContent = DtEl | DdEl;
|
|
117
119
|
export type SvgContent = CircleEl | EllipseEl | RectEl | LineEl | PolylineEl | PolygonEl | PathEl | TextEl | TspanEl | GEl | DefsEl | SymbolEl | UseEl | ClipPathEl | MaskEl | LinearGradientEl | RadialGradientEl | StopEl | PatternEl | SvgImageEl | ForeignObjectEl;
|
|
118
|
-
export type AnyEl = FlowContent | HeadContent | RowContent | CellContent | ListItemContent | SelectContent | SourceEl | TableSectionContent | DefinitionListContent | HtmlEl | HeadEl | BodyEl | SvgContent;
|
|
119
|
-
export type
|
|
120
|
+
export type AnyEl = FlowContent | HeadContent | RowContent | CellContent | ListItemContent | SelectContent | LegendContent | SourceEl | TableSectionContent | DefinitionListContent | HtmlEl | HeadEl | BodyEl | SvgContent;
|
|
121
|
+
export type AriaAttrs = {
|
|
122
|
+
role?: 'button' | 'dialog' | 'navigation' | 'main' | 'list' | 'listitem' | 'alert' | 'status' | 'region' | 'banner' | 'contentinfo' | 'search' | 'form' | 'img' | 'presentation' | 'none' | 'grid' | 'row' | 'cell' | 'columnheader' | 'rowheader' | 'table' | 'tab' | 'tablist' | 'tabpanel' | 'checkbox' | 'radio' | 'combobox' | 'listbox' | 'option' | 'menuitem' | 'menu' | 'menubar' | 'separator' | 'slider' | 'spinbutton' | 'textbox' | 'progressbar' | 'tooltip' | 'tree' | 'treeitem' | 'treegrid' | string;
|
|
123
|
+
'aria-label'?: string;
|
|
124
|
+
'aria-labelledby'?: string;
|
|
125
|
+
'aria-describedby'?: string;
|
|
126
|
+
'aria-hidden'?: 'true' | 'false';
|
|
127
|
+
'aria-live'?: 'off' | 'polite' | 'assertive';
|
|
128
|
+
'aria-busy'?: 'true' | 'false';
|
|
129
|
+
'aria-expanded'?: 'true' | 'false';
|
|
130
|
+
'aria-selected'?: 'true' | 'false';
|
|
131
|
+
'aria-checked'?: 'true' | 'false' | 'mixed';
|
|
132
|
+
'aria-pressed'?: 'true' | 'false' | 'mixed';
|
|
133
|
+
'aria-disabled'?: 'true' | 'false';
|
|
134
|
+
'aria-required'?: 'true' | 'false';
|
|
135
|
+
'aria-invalid'?: 'true' | 'false' | 'grammar' | 'spelling';
|
|
136
|
+
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
|
|
137
|
+
'aria-haspopup'?: 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
138
|
+
'aria-controls'?: string;
|
|
139
|
+
'aria-owns'?: string;
|
|
140
|
+
'aria-activedescendant'?: string;
|
|
141
|
+
'aria-level'?: number;
|
|
142
|
+
'aria-posinset'?: number;
|
|
143
|
+
'aria-setsize'?: number;
|
|
144
|
+
'aria-colcount'?: number;
|
|
145
|
+
'aria-colindex'?: number;
|
|
146
|
+
'aria-rowcount'?: number;
|
|
147
|
+
'aria-rowindex'?: number;
|
|
148
|
+
'aria-valuemax'?: number;
|
|
149
|
+
'aria-valuemin'?: number;
|
|
150
|
+
'aria-valuenow'?: number;
|
|
151
|
+
'aria-valuetext'?: string;
|
|
152
|
+
'aria-sort'?: 'ascending' | 'descending' | 'none' | 'other';
|
|
153
|
+
'aria-orientation'?: 'horizontal' | 'vertical';
|
|
154
|
+
'aria-autocomplete'?: 'inline' | 'list' | 'both' | 'none';
|
|
155
|
+
'aria-multiselectable'?: 'true' | 'false';
|
|
156
|
+
'aria-readonly'?: 'true' | 'false';
|
|
157
|
+
'aria-modal'?: 'true' | 'false';
|
|
158
|
+
'aria-placeholder'?: string;
|
|
159
|
+
'aria-errormessage'?: string;
|
|
160
|
+
'aria-roledescription'?: string;
|
|
161
|
+
'aria-keyshortcuts'?: string;
|
|
162
|
+
};
|
|
163
|
+
export type GlobalAttrs = AriaAttrs & {
|
|
120
164
|
id?: string;
|
|
121
165
|
class?: string;
|
|
122
166
|
style?: string;
|
|
@@ -458,6 +502,7 @@ export declare const form: (attrs: FormAttrs, ...children: (FlowContent | string
|
|
|
458
502
|
export declare const input: (attrs: InputAttrs) => InputEl;
|
|
459
503
|
export declare const label: (attrs: LabelAttrs, ...children: (PhrasingContent | string)[]) => LabelEl;
|
|
460
504
|
export declare const fieldset: (attrs: GlobalAttrs, ...children: (FlowContent | string)[]) => FieldsetEl;
|
|
505
|
+
export declare const legend: (attrs: GlobalAttrs, ...children: (PhrasingContent | string)[]) => LegendEl;
|
|
461
506
|
export declare const select: (attrs: SelectAttrs, ...children: SelectContent[]) => SelectEl;
|
|
462
507
|
export declare const option: (attrs: OptionAttrs, content?: string) => OptionEl;
|
|
463
508
|
export declare const textarea: (attrs: TextareaAttrs, content?: string) => TextareaEl;
|
package/dist/html.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, b as t, c as l, d as o, e as i, f as r, g as d, j as n, k as p, l as c, m as h, n as b, p as m, q as g, r as f, u, v, w as
|
|
1
|
+
import { a as e, b as t, c as l, d as o, e as i, f as r, g as d, j as n, k as p, l as c, m as h, n as b, p as m, q as g, r as f, u, v, w as y, x, y as k, z as j, A as q, B as G, C as w, D as E, E as I, F as N, G as O, H as P, I as T, J as _, K as z, L as A, M as B, N as C, O as D, P as F, Q as H, R as J, i as K, S as L, T as M, U as Q, V as R, W as S, X as U, Y as V, Z as W, _ as X, $ as Y, a0 as Z, o as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as la, a6 as oa, a7 as ia, a8 as ra, a9 as da, aa as na, s as pa, ab as ca, ac as ha, ad as ba, ae as ma, af as ga, ag as fa, ah as ua, ai as va, aj as ya, ak as xa, al as ka, am as ja, an as qa, ao as Ga, ap as wa, t as Ea, aq as Ia, ar as Na, as as Oa, at as Pa, au as Ta, av as _a, aw as za, ax as Aa, ay as Ba } from "./html-Bl4HvyCp.js";
|
|
2
2
|
export {
|
|
3
3
|
e as a,
|
|
4
4
|
t as abbr,
|
|
@@ -17,8 +17,8 @@ export {
|
|
|
17
17
|
f as dd,
|
|
18
18
|
u as defs,
|
|
19
19
|
v as div,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
y as dl,
|
|
21
|
+
x as dt,
|
|
22
22
|
k as ellipse,
|
|
23
23
|
j as em,
|
|
24
24
|
q as fieldset,
|
|
@@ -41,50 +41,51 @@ export {
|
|
|
41
41
|
J as img,
|
|
42
42
|
K as input,
|
|
43
43
|
L as label,
|
|
44
|
-
M as
|
|
45
|
-
Q as
|
|
46
|
-
R as
|
|
47
|
-
S as
|
|
48
|
-
U as
|
|
49
|
-
V as
|
|
50
|
-
W as
|
|
51
|
-
X as
|
|
52
|
-
Y as
|
|
53
|
-
Z as
|
|
54
|
-
$ as
|
|
55
|
-
aa as
|
|
56
|
-
sa as
|
|
57
|
-
ea as
|
|
58
|
-
ta as
|
|
59
|
-
la as
|
|
60
|
-
oa as
|
|
61
|
-
ia as
|
|
62
|
-
ra as
|
|
63
|
-
da as
|
|
64
|
-
na as
|
|
65
|
-
pa as
|
|
66
|
-
ca as
|
|
67
|
-
ha as
|
|
68
|
-
ba as
|
|
69
|
-
ma as
|
|
70
|
-
ga as
|
|
71
|
-
fa as
|
|
72
|
-
ua as
|
|
73
|
-
va as
|
|
44
|
+
M as legend,
|
|
45
|
+
Q as li,
|
|
46
|
+
R as line,
|
|
47
|
+
S as linearGradient,
|
|
48
|
+
U as link,
|
|
49
|
+
V as main,
|
|
50
|
+
W as mask,
|
|
51
|
+
X as meta,
|
|
52
|
+
Y as nav,
|
|
53
|
+
Z as ol,
|
|
54
|
+
$ as option,
|
|
55
|
+
aa as p,
|
|
56
|
+
sa as path,
|
|
57
|
+
ea as pattern,
|
|
58
|
+
ta as polygon,
|
|
59
|
+
la as polyline,
|
|
60
|
+
oa as pre,
|
|
61
|
+
ia as radialGradient,
|
|
62
|
+
ra as rect,
|
|
63
|
+
da as script,
|
|
64
|
+
na as section,
|
|
65
|
+
pa as select,
|
|
66
|
+
ca as small,
|
|
67
|
+
ha as source,
|
|
68
|
+
ba as span,
|
|
69
|
+
ma as stop,
|
|
70
|
+
ga as strong,
|
|
71
|
+
fa as style,
|
|
72
|
+
ua as svg,
|
|
73
|
+
va as svgImage,
|
|
74
|
+
ya as svgText,
|
|
74
75
|
xa as symbol,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
ka as table,
|
|
77
|
+
ja as tbody,
|
|
78
|
+
qa as td,
|
|
79
|
+
Ga as text,
|
|
80
|
+
wa as textNode,
|
|
81
|
+
Ea as textarea,
|
|
82
|
+
Ia as tfoot,
|
|
83
|
+
Na as th,
|
|
84
|
+
Oa as thead,
|
|
85
|
+
Pa as title_,
|
|
86
|
+
Ta as tr,
|
|
87
|
+
_a as tspan,
|
|
88
|
+
za as ul,
|
|
89
|
+
Aa as use,
|
|
90
|
+
Ba as video
|
|
90
91
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { above as
|
|
3
|
-
import { createForm as
|
|
1
|
+
import { h as l } from "./html-Bl4HvyCp.js";
|
|
2
|
+
import { above as g, beside as p, bindAttr as f, bindCheckbox as x, bindClass as S, bindInput as w, bindSelect as W, bindShow as v, bindText as y, checkboxWidget as k, concat as C, dynamic as E, each as F, eachKeyed as A, focus as I, foldWidget as K, h as L, inputWidget as N, lift as B, map as D, match as J, mount as T, narrow as V, numberInputWidget as j, on as q, prop as z, register as G, selectWidget as H, show as M, slot as O, stack as P, subscribe as Q, subscribeNow as R, template as U, textareaWidget as X, watchAll as Y, withScope as Z } from "./widget.js";
|
|
3
|
+
import { createForm as $, createFormState as ee, isDirty as te, isFormValid as ne, shouldShowError as oe } from "./form-state.js";
|
|
4
4
|
import { signal as a } from "@rhi-zone/rainbow";
|
|
5
|
-
import { attrBoolean as
|
|
5
|
+
import { attrBoolean as re, attrJson as se, attrNumber as ae, attrString as ce, attrsFrom as de, defineElement as be } from "./elements.js";
|
|
6
6
|
function d(e, n, t, r, o) {
|
|
7
7
|
const i = e(
|
|
8
8
|
n,
|
|
@@ -23,12 +23,12 @@ function b(e) {
|
|
|
23
23
|
return e.addEventListener("change", t), [n, () => e.removeEventListener("change", t)];
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
g as above,
|
|
27
|
+
re as attrBoolean,
|
|
28
|
+
se as attrJson,
|
|
29
|
+
ae as attrNumber,
|
|
30
|
+
ce as attrString,
|
|
31
|
+
de as attrsFrom,
|
|
32
32
|
p as beside,
|
|
33
33
|
f as bindAttr,
|
|
34
34
|
x as bindCheckbox,
|
|
@@ -40,37 +40,38 @@ export {
|
|
|
40
40
|
b as bindingsStoreSignal,
|
|
41
41
|
k as checkboxWidget,
|
|
42
42
|
C as concat,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
$ as createForm,
|
|
44
|
+
ee as createFormState,
|
|
45
|
+
be as defineElement,
|
|
46
46
|
E as dynamic,
|
|
47
47
|
F as each,
|
|
48
48
|
A as eachKeyed,
|
|
49
49
|
I as focus,
|
|
50
50
|
K as foldWidget,
|
|
51
51
|
L as h,
|
|
52
|
-
|
|
52
|
+
l as html,
|
|
53
53
|
N as inputWidget,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
te as isDirty,
|
|
55
|
+
ne as isFormValid,
|
|
56
56
|
d as keybindsContext,
|
|
57
|
-
B as
|
|
58
|
-
D as
|
|
59
|
-
J as
|
|
60
|
-
T as
|
|
61
|
-
V as
|
|
62
|
-
j as
|
|
63
|
-
q as
|
|
64
|
-
z as
|
|
65
|
-
G as
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
M as
|
|
69
|
-
O as
|
|
70
|
-
P as
|
|
71
|
-
Q as
|
|
72
|
-
R as
|
|
73
|
-
U as
|
|
74
|
-
X as
|
|
75
|
-
Y as
|
|
57
|
+
B as lift,
|
|
58
|
+
D as map,
|
|
59
|
+
J as match,
|
|
60
|
+
T as mount,
|
|
61
|
+
V as narrow,
|
|
62
|
+
j as numberInputWidget,
|
|
63
|
+
q as on,
|
|
64
|
+
z as prop,
|
|
65
|
+
G as register,
|
|
66
|
+
H as selectWidget,
|
|
67
|
+
oe as shouldShowError,
|
|
68
|
+
M as show,
|
|
69
|
+
O as slot,
|
|
70
|
+
P as stack,
|
|
71
|
+
Q as subscribe,
|
|
72
|
+
R as subscribeNow,
|
|
73
|
+
U as template,
|
|
74
|
+
X as textareaWidget,
|
|
75
|
+
Y as watchAll,
|
|
76
|
+
Z as withScope
|
|
76
77
|
};
|
package/dist/widget.d.ts
CHANGED
|
@@ -458,19 +458,35 @@ export declare function selectWidget(options: {
|
|
|
458
458
|
label: string;
|
|
459
459
|
}[], attrs?: SelectAttrs): Widget<string, SelectEl>;
|
|
460
460
|
/**
|
|
461
|
-
* A reactive child: either a
|
|
462
|
-
*
|
|
461
|
+
* A reactive child: either a plain string or a widget that accepts the same
|
|
462
|
+
* signal type `T` and returns any element.
|
|
463
|
+
*
|
|
464
|
+
* `AnyEl` is intentionally excluded. Passing a pre-built element directly would
|
|
465
|
+
* require `cloneNode(true)` on each widget invocation, silently dropping event
|
|
466
|
+
* listeners. Use `lift(el)` to wrap a freshly-built element instead.
|
|
467
|
+
*/
|
|
468
|
+
export type RChild<T> = string | Widget<T, AnyEl>;
|
|
469
|
+
/**
|
|
470
|
+
* Lift a static element into the widget context. Use this to pass a
|
|
471
|
+
* pre-built `AnyEl` as a child to an `h.*` reactive factory:
|
|
472
|
+
*
|
|
473
|
+
* h.div({}, lift(iconEl), reactiveChild)
|
|
474
|
+
*
|
|
475
|
+
* The element is inserted as-is — no cloning — so event listeners are
|
|
476
|
+
* preserved. Only use `lift` when the element is freshly built at widget
|
|
477
|
+
* call time (i.e. inside the widget function body). Do NOT lift a module-
|
|
478
|
+
* level static element — it can only have one parent at a time.
|
|
463
479
|
*/
|
|
464
|
-
export
|
|
480
|
+
export declare function lift<T, E extends AnyEl>(el: E): Widget<T, E>;
|
|
465
481
|
/**
|
|
466
482
|
* Reactive hyperscript factories — the same element tags as `html.ts` but
|
|
467
483
|
* returning `Widget<T, El>` instead of `El`. Import as:
|
|
468
484
|
*
|
|
469
485
|
* import { h } from '@rhi-zone/rainbow-ui/widget'
|
|
470
486
|
*
|
|
471
|
-
* Widget children receive the same signal as their parent.
|
|
472
|
-
*
|
|
473
|
-
*
|
|
487
|
+
* Widget children receive the same signal as their parent. String children
|
|
488
|
+
* create fresh text nodes. To pass a pre-built element, wrap it with `lift(el)`
|
|
489
|
+
* so it is inserted directly without cloning — preserving event listeners.
|
|
474
490
|
*/
|
|
475
491
|
export declare const h: {
|
|
476
492
|
readonly div: <T>(attrs: GlobalAttrs, ...children: RChild<T>[]) => (s: Signal<T>) => El<"div", HTMLDivElement>;
|
package/dist/widget.js
CHANGED
|
@@ -1,350 +1,353 @@
|
|
|
1
1
|
import { index as E, stateful as L, field as W, lens as B, tagged as $, signal as j } from "@rhi-zone/rainbow";
|
|
2
|
-
import { i as _, s as F, o as I, t as O } from "./html-
|
|
3
|
-
let
|
|
2
|
+
import { i as _, s as F, o as I, t as O } from "./html-Bl4HvyCp.js";
|
|
3
|
+
let k = null;
|
|
4
4
|
function l(e) {
|
|
5
|
-
|
|
5
|
+
k == null || k.push(e);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
return
|
|
7
|
+
function m(e) {
|
|
8
|
+
const t = k, o = [];
|
|
9
|
+
k = o;
|
|
10
|
+
const n = e();
|
|
11
|
+
return k = t, [n, () => {
|
|
12
12
|
for (const c of o) c();
|
|
13
13
|
}];
|
|
14
14
|
}
|
|
15
15
|
function V(e) {
|
|
16
|
-
return
|
|
16
|
+
return m(e);
|
|
17
17
|
}
|
|
18
|
-
function w(e,
|
|
19
|
-
l(e.subscribe(
|
|
18
|
+
function w(e, t) {
|
|
19
|
+
l(e.subscribe(t));
|
|
20
20
|
}
|
|
21
21
|
function H(e) {
|
|
22
22
|
l(e);
|
|
23
23
|
}
|
|
24
|
-
function R(e,
|
|
25
|
-
const [
|
|
26
|
-
return o.appendChild(
|
|
27
|
-
|
|
24
|
+
function R(e, t, o) {
|
|
25
|
+
const [n, c] = m(() => e(t));
|
|
26
|
+
return o.appendChild(n.node), () => {
|
|
27
|
+
n.node.remove(), c();
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function P(e,
|
|
31
|
-
return (o) => e(o.focus(
|
|
30
|
+
function P(e, t) {
|
|
31
|
+
return (o) => e(o.focus(t));
|
|
32
32
|
}
|
|
33
|
-
function U(e,
|
|
34
|
-
return P(e, W(
|
|
33
|
+
function U(e, t) {
|
|
34
|
+
return P(e, W(t));
|
|
35
35
|
}
|
|
36
|
-
function z(e,
|
|
36
|
+
function z(e, t) {
|
|
37
37
|
return (o) => {
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const n = document.createElement("div");
|
|
39
|
+
n.dataset.narrow = "";
|
|
40
40
|
let c = null, r = null;
|
|
41
|
-
const
|
|
42
|
-
r =
|
|
43
|
-
const [a, f] =
|
|
44
|
-
c = f,
|
|
41
|
+
const u = o, d = () => {
|
|
42
|
+
r = u.narrow(t);
|
|
43
|
+
const [a, f] = m(() => e(r));
|
|
44
|
+
c = f, n.appendChild(a.node);
|
|
45
45
|
};
|
|
46
46
|
return w(o, (a) => {
|
|
47
|
-
const f =
|
|
48
|
-
f !== void 0 && c === null ?
|
|
49
|
-
}),
|
|
47
|
+
const f = t.view(a);
|
|
48
|
+
f !== void 0 && c === null ? d() : f === void 0 && c !== null && (c(), c = null, r = null, n.replaceChildren());
|
|
49
|
+
}), t.view(o.get()) !== void 0 && d(), l(() => c == null ? void 0 : c()), { _tag: "div", node: n };
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
function D(e) {
|
|
53
|
-
return (
|
|
54
|
-
const o =
|
|
55
|
-
|
|
53
|
+
return (t) => {
|
|
54
|
+
const o = t, n = document.createElement("div");
|
|
55
|
+
n.dataset.each = "";
|
|
56
56
|
let c = [];
|
|
57
|
-
const r = (
|
|
57
|
+
const r = (d) => {
|
|
58
58
|
for (const s of c) s();
|
|
59
|
-
c = [],
|
|
60
|
-
for (let s = 0; s <
|
|
59
|
+
c = [], n.replaceChildren();
|
|
60
|
+
for (let s = 0; s < d.length; s++) {
|
|
61
61
|
const a = s, f = B(
|
|
62
62
|
(p) => p[a],
|
|
63
63
|
(p, h) => {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
64
|
+
const g = [...h];
|
|
65
|
+
return g[a] = p, g;
|
|
66
66
|
}
|
|
67
|
-
),
|
|
68
|
-
c.push(C),
|
|
67
|
+
), b = o.focus(f), [v, C] = m(() => e(b));
|
|
68
|
+
c.push(C), n.appendChild(v.node);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
r(
|
|
72
|
-
const
|
|
73
|
-
return w(
|
|
74
|
-
for (const
|
|
75
|
-
}), { _tag: "div", node:
|
|
71
|
+
r(t.get());
|
|
72
|
+
const u = t.map((d) => d.length);
|
|
73
|
+
return w(u, () => r(t.get())), l(() => {
|
|
74
|
+
for (const d of c) d();
|
|
75
|
+
}), { _tag: "div", node: n };
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function G(e,
|
|
78
|
+
function G(e, t) {
|
|
79
79
|
return (o) => {
|
|
80
|
-
const
|
|
80
|
+
const n = o, c = document.createElement("div");
|
|
81
81
|
c.dataset.beside = "";
|
|
82
|
-
const r =
|
|
83
|
-
return c.appendChild(
|
|
82
|
+
const r = n.focus(E(0)), u = n.focus(E(1)), [d, s] = m(() => e(r)), [a, f] = m(() => t(u));
|
|
83
|
+
return c.appendChild(d.node), c.appendChild(a.node), l(s), l(f), { _tag: "div", node: c };
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function J(e,
|
|
86
|
+
function J(e, t) {
|
|
87
87
|
return (o) => {
|
|
88
|
-
const
|
|
88
|
+
const n = o, c = document.createElement("div");
|
|
89
89
|
c.dataset.above = "";
|
|
90
|
-
const r =
|
|
91
|
-
return c.appendChild(
|
|
90
|
+
const r = n.focus(E(0)), u = n.focus(E(1)), [d, s] = m(() => e(r)), [a, f] = m(() => t(u));
|
|
91
|
+
return c.appendChild(d.node), c.appendChild(a.node), l(s), l(f), { _tag: "div", node: c };
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function Q(e,
|
|
94
|
+
function Q(e, t) {
|
|
95
95
|
return (o) => {
|
|
96
|
-
const
|
|
97
|
-
return n
|
|
96
|
+
const n = L(e, o);
|
|
97
|
+
return t(n);
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function X(e,
|
|
100
|
+
function X(e, t) {
|
|
101
101
|
return (o) => {
|
|
102
|
-
const
|
|
103
|
-
return e(
|
|
102
|
+
const n = o.narrow(t);
|
|
103
|
+
return e(n);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function Y(e,
|
|
106
|
+
function Y(e, t) {
|
|
107
107
|
return (o) => {
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const [c, r] =
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
108
|
+
const n = document.createElement("div");
|
|
109
|
+
n.dataset.show = "";
|
|
110
|
+
const [c, r] = m(() => e(o));
|
|
111
|
+
n.appendChild(c.node), l(r);
|
|
112
|
+
const u = (d) => {
|
|
113
|
+
n.style.display = t(d) ? "" : "none";
|
|
114
114
|
};
|
|
115
|
-
return
|
|
115
|
+
return u(o.get()), w(o, u), { _tag: "div", node: n };
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function Z(e,
|
|
118
|
+
function Z(e, t) {
|
|
119
119
|
return (o) => {
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
const [c, r] =
|
|
123
|
-
return
|
|
120
|
+
const n = document.createElement("div");
|
|
121
|
+
n.dataset.concat = "";
|
|
122
|
+
const [c, r] = m(() => e(o)), [u, d] = m(() => t(o));
|
|
123
|
+
return n.appendChild(c.node), n.appendChild(u.node), l(r), l(d), { _tag: "div", node: n };
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
function ee(...e) {
|
|
127
|
-
return (
|
|
127
|
+
return (t) => {
|
|
128
128
|
const o = document.createElement("div");
|
|
129
129
|
o.dataset.stack = "";
|
|
130
|
-
for (const
|
|
131
|
-
const [c, r] =
|
|
130
|
+
for (const n of e) {
|
|
131
|
+
const [c, r] = m(() => n(t));
|
|
132
132
|
o.appendChild(c.node), l(r);
|
|
133
133
|
}
|
|
134
134
|
return { _tag: "div", node: o };
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function te(e,
|
|
138
|
-
const
|
|
139
|
-
return
|
|
137
|
+
function te(e, t, o) {
|
|
138
|
+
const n = document.createElement("template");
|
|
139
|
+
return n.innerHTML = e, (c) => {
|
|
140
140
|
const r = document.createElement("div");
|
|
141
|
-
r.dataset.templ = "", r.appendChild(
|
|
142
|
-
const
|
|
143
|
-
for (const
|
|
144
|
-
const s =
|
|
141
|
+
r.dataset.templ = "", r.appendChild(n.content.cloneNode(!0));
|
|
142
|
+
const u = {};
|
|
143
|
+
for (const d of Object.keys(t)) {
|
|
144
|
+
const s = t[d], a = r.querySelector(`${s}[data-ref="${d}"]`);
|
|
145
145
|
if (a === null)
|
|
146
146
|
throw new Error(
|
|
147
|
-
`templ: ref "${
|
|
147
|
+
`templ: ref "${d}" not found — expected <${s} data-ref="${d}"> in template`
|
|
148
148
|
);
|
|
149
|
-
d
|
|
149
|
+
u[d] = { _tag: s, node: a };
|
|
150
150
|
}
|
|
151
|
-
return o(c,
|
|
151
|
+
return o(c, u), { _tag: "div", node: r };
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function ne(e,
|
|
155
|
-
const c = (
|
|
154
|
+
function ne(e, t, o, n) {
|
|
155
|
+
const c = (n == null ? void 0 : n.container) ?? "div", r = document.createElement(c);
|
|
156
156
|
r.dataset.eachKeyed = "";
|
|
157
|
-
const
|
|
158
|
-
const
|
|
157
|
+
const u = /* @__PURE__ */ new Map(), d = (a, f) => {
|
|
158
|
+
const b = j(f);
|
|
159
159
|
let v = !1, C = () => {
|
|
160
160
|
};
|
|
161
|
-
"set" in e && (C =
|
|
161
|
+
"set" in e && (C = b.subscribe((g) => {
|
|
162
162
|
if (v) return;
|
|
163
|
-
const x = e.get(), N = x.findIndex((
|
|
164
|
-
if (N !== -1 && !Object.is(x[N],
|
|
165
|
-
const
|
|
166
|
-
|
|
163
|
+
const x = e.get(), N = x.findIndex((y) => t(y) === a);
|
|
164
|
+
if (N !== -1 && !Object.is(x[N], g)) {
|
|
165
|
+
const y = [...x];
|
|
166
|
+
y[N] = g, e.set(y);
|
|
167
167
|
}
|
|
168
168
|
}));
|
|
169
|
-
const [p, h] =
|
|
169
|
+
const [p, h] = m(() => o(b));
|
|
170
170
|
return {
|
|
171
|
-
itemSignal:
|
|
171
|
+
itemSignal: b,
|
|
172
172
|
childNode: p.node,
|
|
173
173
|
cleanup: () => {
|
|
174
174
|
h(), C();
|
|
175
175
|
},
|
|
176
|
-
setFromParent: (
|
|
177
|
-
v = !0,
|
|
176
|
+
setFromParent: (g) => {
|
|
177
|
+
v = !0, b.set(g), v = !1;
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
}, s = (a) => {
|
|
181
181
|
var C;
|
|
182
|
-
const f = a.map(
|
|
183
|
-
for (const [p, h] of
|
|
184
|
-
|
|
182
|
+
const f = a.map(t), b = new Set(f);
|
|
183
|
+
for (const [p, h] of u)
|
|
184
|
+
b.has(p) || (h.cleanup(), (C = h.childNode.parentNode) == null || C.removeChild(h.childNode), u.delete(p));
|
|
185
185
|
for (let p = 0; p < a.length; p++) {
|
|
186
|
-
const h = f[p],
|
|
187
|
-
|
|
186
|
+
const h = f[p], g = a[p];
|
|
187
|
+
u.has(h) ? u.get(h).setFromParent(g) : u.set(h, d(h, g));
|
|
188
188
|
}
|
|
189
189
|
let v = null;
|
|
190
190
|
for (let p = a.length - 1; p >= 0; p--) {
|
|
191
|
-
const h =
|
|
191
|
+
const h = u.get(f[p]);
|
|
192
192
|
(h.childNode.parentNode !== r || h.childNode.nextSibling !== v) && r.insertBefore(h.childNode, v), v = h.childNode;
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
return s(e.get()), w(e, s), l(() => {
|
|
196
|
-
for (const a of
|
|
196
|
+
for (const a of u.values()) a.cleanup();
|
|
197
197
|
}), { _tag: c, node: r };
|
|
198
198
|
}
|
|
199
|
-
function A(e,
|
|
200
|
-
const
|
|
201
|
-
e.addEventListener(
|
|
199
|
+
function A(e, t, o) {
|
|
200
|
+
const n = o;
|
|
201
|
+
e.addEventListener(t, n), l(() => e.removeEventListener(t, n));
|
|
202
202
|
}
|
|
203
|
-
function S(e,
|
|
204
|
-
e.value =
|
|
205
|
-
const o = () =>
|
|
203
|
+
function S(e, t) {
|
|
204
|
+
e.value = t.get();
|
|
205
|
+
const o = () => t.set(e.value);
|
|
206
206
|
e.addEventListener("input", o);
|
|
207
|
-
const
|
|
207
|
+
const n = t.subscribe((r) => {
|
|
208
208
|
e.value !== r && (e.value = r);
|
|
209
209
|
}), c = () => {
|
|
210
|
-
e.removeEventListener("input", o),
|
|
210
|
+
e.removeEventListener("input", o), n();
|
|
211
211
|
};
|
|
212
212
|
return l(c), c;
|
|
213
213
|
}
|
|
214
|
-
function T(e,
|
|
215
|
-
A(e, "change", () =>
|
|
214
|
+
function T(e, t) {
|
|
215
|
+
A(e, "change", () => t.set(e.value)), w(t, (o) => {
|
|
216
216
|
e.value !== o && (e.value = o);
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
function q(e,
|
|
220
|
-
A(e, "change", () =>
|
|
219
|
+
function q(e, t) {
|
|
220
|
+
A(e, "change", () => t.set(e.checked)), w(t, (o) => {
|
|
221
221
|
e.checked !== o && (e.checked = o);
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
function oe(e,
|
|
225
|
-
|
|
224
|
+
function oe(e, t) {
|
|
225
|
+
t(e.get()), l(e.subscribe(t));
|
|
226
226
|
}
|
|
227
|
-
function ce(e,
|
|
228
|
-
e.textContent =
|
|
227
|
+
function ce(e, t) {
|
|
228
|
+
e.textContent = t.get(), l(t.subscribe((o) => {
|
|
229
229
|
e.textContent = o;
|
|
230
230
|
}));
|
|
231
231
|
}
|
|
232
|
-
function re(e,
|
|
233
|
-
e.setAttribute(
|
|
234
|
-
e.setAttribute(
|
|
232
|
+
function re(e, t, o) {
|
|
233
|
+
e.setAttribute(t, o.get()), l(o.subscribe((n) => {
|
|
234
|
+
e.setAttribute(t, n);
|
|
235
235
|
}));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
e.classList.toggle(
|
|
239
|
-
e.classList.toggle(
|
|
237
|
+
function ue(e, t, o) {
|
|
238
|
+
e.classList.toggle(t, o.get()), l(o.subscribe((n) => {
|
|
239
|
+
e.classList.toggle(t, n);
|
|
240
240
|
}));
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
|
|
244
|
-
const o = e.map((
|
|
242
|
+
function de(e, t) {
|
|
243
|
+
t();
|
|
244
|
+
const o = e.map((n) => n.subscribe(t));
|
|
245
245
|
return () => {
|
|
246
|
-
for (const
|
|
246
|
+
for (const n of o) n();
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
function ie(e,
|
|
250
|
-
return e.style.display =
|
|
249
|
+
function ie(e, t) {
|
|
250
|
+
return e.style.display = t.get() ? "" : "none", t.subscribe((o) => {
|
|
251
251
|
e.style.display = o ? "" : "none";
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
function ae(e,
|
|
254
|
+
function ae(e, t) {
|
|
255
255
|
return (o) => {
|
|
256
|
-
const
|
|
257
|
-
|
|
256
|
+
const n = document.createElement("div");
|
|
257
|
+
n.dataset.match = "";
|
|
258
258
|
let c = null, r = null;
|
|
259
|
-
const
|
|
260
|
-
const s =
|
|
259
|
+
const u = (d) => {
|
|
260
|
+
const s = d[e];
|
|
261
261
|
if (s === r) return;
|
|
262
|
-
c == null || c(), c = null,
|
|
263
|
-
const a =
|
|
262
|
+
c == null || c(), c = null, n.replaceChildren(), r = s;
|
|
263
|
+
const a = t[s];
|
|
264
264
|
if (a == null) return;
|
|
265
265
|
const f = o.narrow($(e, s));
|
|
266
|
-
let
|
|
267
|
-
[
|
|
266
|
+
let b;
|
|
267
|
+
[b, c] = m(
|
|
268
268
|
() => a(f)
|
|
269
|
-
),
|
|
269
|
+
), n.appendChild(b.node);
|
|
270
270
|
};
|
|
271
|
-
return w(o,
|
|
271
|
+
return w(o, u), u(o.get()), l(() => c == null ? void 0 : c()), { _tag: "div", node: n };
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
function se(e,
|
|
274
|
+
function se(e, t) {
|
|
275
275
|
const o = document.createElement("div");
|
|
276
276
|
o.dataset.foldWidget = "";
|
|
277
|
-
let
|
|
277
|
+
let n = null;
|
|
278
278
|
const c = (r) => {
|
|
279
|
-
|
|
280
|
-
let
|
|
279
|
+
n !== null && (n(), n = null), o.replaceChildren();
|
|
280
|
+
let u = null;
|
|
281
281
|
switch (r.status) {
|
|
282
282
|
case "notAsked":
|
|
283
|
-
|
|
283
|
+
u = t.notAsked ?? null;
|
|
284
284
|
break;
|
|
285
285
|
case "loading":
|
|
286
|
-
|
|
286
|
+
u = t.loading ?? null;
|
|
287
287
|
break;
|
|
288
288
|
case "failure":
|
|
289
|
-
|
|
289
|
+
u = t.failure ? () => t.failure(r.error) : null;
|
|
290
290
|
break;
|
|
291
291
|
case "success":
|
|
292
|
-
|
|
292
|
+
u = t.success ? () => t.success(r.value) : null;
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
|
-
if (
|
|
296
|
-
let
|
|
297
|
-
[
|
|
295
|
+
if (u !== null) {
|
|
296
|
+
let d;
|
|
297
|
+
[d, n] = m(u), o.appendChild(d.node);
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
|
-
return c(e.get()), l(e.subscribe(c)), l(() =>
|
|
300
|
+
return c(e.get()), l(e.subscribe(c)), l(() => n == null ? void 0 : n()), { _tag: "div", node: o };
|
|
301
301
|
}
|
|
302
302
|
function le(e) {
|
|
303
|
-
return (
|
|
304
|
-
const o =
|
|
305
|
-
return
|
|
303
|
+
return (t) => {
|
|
304
|
+
const o = t, n = _(e ?? {});
|
|
305
|
+
return n.node.value = o.get(), S(n.node, o), n;
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
function fe(e) {
|
|
309
|
-
return (
|
|
310
|
-
const o =
|
|
311
|
-
return
|
|
309
|
+
return (t) => {
|
|
310
|
+
const o = t, n = O(e ?? {});
|
|
311
|
+
return n.node.value = o.get(), S(n.node, o), n;
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
function pe(e) {
|
|
315
|
-
return (
|
|
316
|
-
const o =
|
|
317
|
-
return
|
|
315
|
+
return (t) => {
|
|
316
|
+
const o = t, n = _({ ...e, type: "checkbox" });
|
|
317
|
+
return n.node.checked = o.get(), q(n.node, o), n;
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
320
|
function he(e) {
|
|
321
|
-
return (
|
|
322
|
-
const o =
|
|
323
|
-
return
|
|
324
|
-
const c =
|
|
321
|
+
return (t) => {
|
|
322
|
+
const o = t, n = _({ ...e, type: "number" });
|
|
323
|
+
return n.node.value = String(o.get()), A(n.node, "input", () => {
|
|
324
|
+
const c = n.node.valueAsNumber;
|
|
325
325
|
isNaN(c) || o.set(c);
|
|
326
|
-
}), w(
|
|
327
|
-
|
|
328
|
-
}),
|
|
326
|
+
}), w(t, (c) => {
|
|
327
|
+
n.node.valueAsNumber !== c && (n.node.value = String(c));
|
|
328
|
+
}), n;
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function me(e, t) {
|
|
332
332
|
return (o) => {
|
|
333
|
-
const
|
|
334
|
-
return c.node.value =
|
|
333
|
+
const n = o, c = F(t ?? {}, ...e.map((r) => I({ value: r.value }, r.label)));
|
|
334
|
+
return c.node.value = n.get(), T(c.node, n), c;
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
+
function be(e) {
|
|
338
|
+
return (t) => e;
|
|
339
|
+
}
|
|
337
340
|
function i(e) {
|
|
338
|
-
return (
|
|
341
|
+
return (t, ...o) => (n) => {
|
|
339
342
|
const c = document.createElement(e);
|
|
340
|
-
for (const [r,
|
|
341
|
-
|
|
343
|
+
for (const [r, u] of Object.entries(t))
|
|
344
|
+
u == null || u === !1 || c.setAttribute(r, u === !0 ? "" : String(u));
|
|
342
345
|
for (const r of o)
|
|
343
|
-
typeof r == "function" ? c.appendChild(r(
|
|
346
|
+
typeof r == "function" ? c.appendChild(r(n).node) : c.appendChild(document.createTextNode(r));
|
|
344
347
|
return { _tag: e, node: c };
|
|
345
348
|
};
|
|
346
349
|
}
|
|
347
|
-
const
|
|
350
|
+
const ge = {
|
|
348
351
|
// Sectioning / flow
|
|
349
352
|
div: i("div"),
|
|
350
353
|
section: i("section"),
|
|
@@ -378,13 +381,13 @@ const me = {
|
|
|
378
381
|
form: i("form"),
|
|
379
382
|
fieldset: i("fieldset")
|
|
380
383
|
};
|
|
381
|
-
function
|
|
382
|
-
const c = o(
|
|
384
|
+
function ve(e, t, o, n) {
|
|
385
|
+
const c = o(t.get());
|
|
383
386
|
if (c === void 0) {
|
|
384
387
|
e.remove();
|
|
385
388
|
return;
|
|
386
389
|
}
|
|
387
|
-
const r = c(
|
|
390
|
+
const r = c(n ?? t);
|
|
388
391
|
e.replaceWith(r.node);
|
|
389
392
|
}
|
|
390
393
|
export {
|
|
@@ -392,7 +395,7 @@ export {
|
|
|
392
395
|
G as beside,
|
|
393
396
|
re as bindAttr,
|
|
394
397
|
q as bindCheckbox,
|
|
395
|
-
|
|
398
|
+
ue as bindClass,
|
|
396
399
|
S as bindInput,
|
|
397
400
|
T as bindSelect,
|
|
398
401
|
ie as bindShow,
|
|
@@ -404,8 +407,9 @@ export {
|
|
|
404
407
|
ne as eachKeyed,
|
|
405
408
|
P as focus,
|
|
406
409
|
se as foldWidget,
|
|
407
|
-
|
|
410
|
+
ge as h,
|
|
408
411
|
le as inputWidget,
|
|
412
|
+
be as lift,
|
|
409
413
|
X as map,
|
|
410
414
|
ae as match,
|
|
411
415
|
R as mount,
|
|
@@ -414,14 +418,14 @@ export {
|
|
|
414
418
|
A as on,
|
|
415
419
|
U as prop,
|
|
416
420
|
H as register,
|
|
417
|
-
|
|
421
|
+
me as selectWidget,
|
|
418
422
|
Y as show,
|
|
419
|
-
|
|
423
|
+
ve as slot,
|
|
420
424
|
ee as stack,
|
|
421
425
|
w as subscribe,
|
|
422
426
|
oe as subscribeNow,
|
|
423
427
|
te as template,
|
|
424
428
|
fe as textareaWidget,
|
|
425
|
-
|
|
429
|
+
de as watchAll,
|
|
426
430
|
V as withScope
|
|
427
431
|
};
|