1 | import * as m from 'mithril';
|
2 |
|
3 | export const Compote = m;
|
4 |
|
5 |
|
6 |
|
7 | export const a = tag('a');
|
8 | export const abbr = tag('abbr');
|
9 | export const acronym = tag('acronym');
|
10 | export const address = tag('address');
|
11 | export const applet = tag('applet');
|
12 | export const area = tag('area');
|
13 | export const article = tag('article');
|
14 | export const aside = tag('aside');
|
15 | export const audio = tag('audio');
|
16 | export const b = tag('b');
|
17 | export const base = tag('base');
|
18 | export const basefont = tag('basefont');
|
19 | export const bdo = tag('bdo');
|
20 | export const big = tag('big');
|
21 | export const blockquote = tag('blockquote');
|
22 | export const body = tag('body');
|
23 | export const br = tag('br');
|
24 | export const button = tag('button');
|
25 | export const canvas = tag('canvas');
|
26 | export const caption = tag('caption');
|
27 | export const center = tag('center');
|
28 | export const circle = tag('circle');
|
29 | export const cite = tag('cite');
|
30 | export const clippath = tag('clippath');
|
31 | export const code = tag('code');
|
32 | export const col = tag('col');
|
33 | export const colgroup = tag('colgroup');
|
34 |
|
35 | export const datalist = tag('datalist');
|
36 | export const dd = tag('dd');
|
37 | export const defs = tag('defs');
|
38 | export const del = tag('del');
|
39 | export const desc = tag('desc');
|
40 | export const dfn = tag('dfn');
|
41 | export const dir = tag('dir');
|
42 | export const div = tag('div');
|
43 | export const dl = tag('dl');
|
44 | export const dt = tag('dt');
|
45 | export const ellipse = tag('ellipse');
|
46 | export const em = tag('em');
|
47 | export const embed = tag('embed');
|
48 | export const feblend = tag('feblend');
|
49 | export const fecolormatrix = tag('fecolormatrix');
|
50 | export const fecomponenttransfer = tag('fecomponenttransfer');
|
51 | export const fecomposite = tag('fecomposite');
|
52 | export const feconvolvematrix = tag('feconvolvematrix');
|
53 | export const fediffuselighting = tag('fediffuselighting');
|
54 | export const fedisplacementmap = tag('fedisplacementmap');
|
55 | export const fedistantlight = tag('fedistantlight');
|
56 | export const feflood = tag('feflood');
|
57 | export const fefunca = tag('fefunca');
|
58 | export const fefuncb = tag('fefuncb');
|
59 | export const fefuncg = tag('fefuncg');
|
60 | export const fefuncr = tag('fefuncr');
|
61 | export const fegaussianblur = tag('fegaussianblur');
|
62 | export const feimage = tag('feimage');
|
63 | export const femerge = tag('femerge');
|
64 | export const femergenode = tag('femergenode');
|
65 | export const femorphology = tag('femorphology');
|
66 | export const feoffset = tag('feoffset');
|
67 | export const fepointlight = tag('fepointlight');
|
68 | export const fespecularlighting = tag('fespecularlighting');
|
69 | export const fespotlight = tag('fespotlight');
|
70 | export const fetile = tag('fetile');
|
71 | export const feturbulence = tag('feturbulence');
|
72 | export const fieldset = tag('fieldset');
|
73 | export const figcaption = tag('figcaption');
|
74 | export const figure = tag('figure');
|
75 | export const filter = tag('filter');
|
76 | export const font = tag('font');
|
77 | export const footer = tag('footer');
|
78 | export const foreignobject = tag('foreignobject');
|
79 | export const form = tag('form');
|
80 | export const frame = tag('frame');
|
81 | export const frameset = tag('frameset');
|
82 | export const g = tag('g');
|
83 | export const h1 = tag('h1');
|
84 | export const h2 = tag('h2');
|
85 | export const h3 = tag('h3');
|
86 | export const h4 = tag('h4');
|
87 | export const h5 = tag('h5');
|
88 | export const h6 = tag('h6');
|
89 | export const head = tag('head');
|
90 | export const header = tag('header');
|
91 | export const hgroup = tag('hgroup');
|
92 | export const hr = tag('hr');
|
93 | export const html = tag('html');
|
94 | export const i = tag('i');
|
95 | export const iframe = tag('iframe');
|
96 | export const image = tag('image');
|
97 | export const img = tag('img');
|
98 | export const input = tag('input');
|
99 | export const ins = tag('ins');
|
100 | export const isindex = tag('isindex');
|
101 | export const kbd = tag('kbd');
|
102 | export const keygen = tag('keygen');
|
103 | export const label = tag('label');
|
104 | export const legend = tag('legend');
|
105 | export const li = tag('li');
|
106 | export const line = tag('line');
|
107 | export const lineargradient = tag('lineargradient');
|
108 | export const link = tag('link');
|
109 | export const listing = tag('listing');
|
110 | export const map = tag('map');
|
111 | export const mark = tag('mark');
|
112 | export const marker = tag('marker');
|
113 | export const marquee = tag('marquee');
|
114 | export const mask = tag('mask');
|
115 | export const menu = tag('menu');
|
116 | export const meta = tag('meta');
|
117 | export const metadata = tag('metadata');
|
118 | export const meter = tag('meter');
|
119 | export const nav = tag('nav');
|
120 | export const nextid = tag('nextid');
|
121 | export const nobr = tag('nobr');
|
122 | export const noframes = tag('noframes');
|
123 | export const noscript = tag('noscript');
|
124 | export const object = tag('object');
|
125 | export const ol = tag('ol');
|
126 | export const optgroup = tag('optgroup');
|
127 | export const option = tag('option');
|
128 |
|
129 | export const p = tag('p');
|
130 | export const param = tag('param');
|
131 | export const path = tag('path');
|
132 | export const pattern = tag('pattern');
|
133 | export const picture = tag('picture');
|
134 | export const plaintext = tag('plaintext');
|
135 | export const polygon = tag('polygon');
|
136 | export const polyline = tag('polyline');
|
137 | export const pre = tag('pre');
|
138 | export const progress = tag('progress');
|
139 | export const q = tag('q');
|
140 | export const radialgradient = tag('radialgradient');
|
141 | export const rect = tag('rect');
|
142 | export const rt = tag('rt');
|
143 | export const ruby = tag('ruby');
|
144 | export const s = tag('s');
|
145 | export const samp = tag('samp');
|
146 | export const script = tag('script');
|
147 | export const section = tag('section');
|
148 | export const select = tag('select');
|
149 | export const small = tag('small');
|
150 | export const source = tag('source');
|
151 | export const span = tag('span');
|
152 | export const stop = tag('stop');
|
153 | export const strike = tag('strike');
|
154 | export const strong = tag('strong');
|
155 | export const style = tag('style');
|
156 | export const sub = tag('sub');
|
157 | export const sup = tag('sup');
|
158 | export const svg = tag('svg');
|
159 |
|
160 | export const symbol = tag('symbol');
|
161 | export const table = tag('table');
|
162 | export const tbody = tag('tbody');
|
163 | export const td = tag('td');
|
164 | export const template = tag('template');
|
165 | export const text = tag('text');
|
166 | export const textpath = tag('textpath');
|
167 | export const textarea = tag('textarea');
|
168 | export const tfoot = tag('tfoot');
|
169 | export const th = tag('th');
|
170 | export const thead = tag('thead');
|
171 |
|
172 | export const title = tag('title');
|
173 | export const tr = tag('tr');
|
174 | export const track = tag('track');
|
175 | export const tspan = tag('tspan');
|
176 | export const tt = tag('tt');
|
177 | export const u = tag('u');
|
178 | export const ul = tag('ul');
|
179 | export const use = tag('use');
|
180 |
|
181 | export const video = tag('video');
|
182 | export const view = tag('view');
|
183 | export const wbr = tag('wbr');
|
184 |
|
185 | export const xmp = tag('xmp');
|
186 |
|
187 | export function tag<TagNameType extends keyof ElementTagNameMap, ElementType extends ElementTagNameMap[TagNameType]>(tagName: TagNameType) {
|
188 | return function (properties?: CustomProperties & RecursivePartial<ElementType>, children?: m.Children) {
|
189 | return Compote(tagName, properties, children);
|
190 | };
|
191 | }
|
192 |
|
193 | export type RecursivePartial<T> = {
|
194 | [P in keyof T]?: RecursivePartial<T[P]>;
|
195 | };
|
196 |
|
197 | type CustomProperties = {
|
198 | key?: number | string;
|
199 |
|
200 | oninit?(node?: ComponentNode): void;
|
201 | oncreate?(node?: ComponentNode): void;
|
202 |
|
203 | onbeforeupdate?(newNode?: ComponentNode, oldNode?: ComponentNode): void | boolean;
|
204 | onupdate?(node?: ComponentNode): void;
|
205 |
|
206 | onbeforeremove?(node?: ComponentNode): void | Promise<any>;
|
207 | onremove?(node?: ComponentNode): void;
|
208 | };
|
209 |
|
210 | export type ComponentNode = m.Vnode<any, any> & { dom: HTMLElement };
|