@molecule/app-ui-react-native 1.0.10 → 2.1.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/README.md +211 -331
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +2 -2
- package/dist/components/Card.d.ts +3 -2
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Card.js +11 -3
- package/dist/components/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +4 -7
- package/dist/components/Input.d.ts +13 -2
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +5 -11
- package/dist/components/Layout.d.ts +3 -2
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/Layout.js +2 -2
- package/dist/components/Select.d.ts +2 -2
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +4 -6
- package/dist/components/Switch.d.ts +2 -2
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +3 -7
- package/dist/components/Textarea.d.ts +13 -2
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea.js +2 -6
- package/dist/elements/Anchor.d.ts +15 -0
- package/dist/elements/Anchor.d.ts.map +1 -0
- package/dist/elements/Anchor.js +57 -0
- package/dist/elements/Box.d.ts +19 -0
- package/dist/elements/Box.d.ts.map +1 -0
- package/dist/elements/Box.js +150 -0
- package/dist/elements/CheckField.d.ts +18 -0
- package/dist/elements/CheckField.d.ts.map +1 -0
- package/dist/elements/CheckField.js +103 -0
- package/dist/elements/Disclosure.d.ts +11 -0
- package/dist/elements/Disclosure.d.ts.map +1 -0
- package/dist/elements/Disclosure.js +67 -0
- package/dist/elements/Fieldset.d.ts +16 -0
- package/dist/elements/Fieldset.d.ts.map +1 -0
- package/dist/elements/Fieldset.js +34 -0
- package/dist/elements/FileField.d.ts +12 -0
- package/dist/elements/FileField.d.ts.map +1 -0
- package/dist/elements/FileField.js +111 -0
- package/dist/elements/FormArea.d.ts +18 -0
- package/dist/elements/FormArea.d.ts.map +1 -0
- package/dist/elements/FormArea.js +42 -0
- package/dist/elements/GlyphIcon.d.ts +19 -0
- package/dist/elements/GlyphIcon.d.ts.map +1 -0
- package/dist/elements/GlyphIcon.js +43 -0
- package/dist/elements/Image.d.ts +17 -0
- package/dist/elements/Image.d.ts.map +1 -0
- package/dist/elements/Image.js +26 -0
- package/dist/elements/Link.d.ts +20 -0
- package/dist/elements/Link.d.ts.map +1 -0
- package/dist/elements/Link.js +53 -0
- package/dist/elements/Pressable.d.ts +18 -0
- package/dist/elements/Pressable.d.ts.map +1 -0
- package/dist/elements/Pressable.js +107 -0
- package/dist/elements/PulseDots.d.ts +15 -0
- package/dist/elements/PulseDots.d.ts.map +1 -0
- package/dist/elements/PulseDots.js +78 -0
- package/dist/elements/RangeField.d.ts +11 -0
- package/dist/elements/RangeField.d.ts.map +1 -0
- package/dist/elements/RangeField.js +259 -0
- package/dist/elements/RichText.d.ts +23 -0
- package/dist/elements/RichText.d.ts.map +1 -0
- package/dist/elements/RichText.js +55 -0
- package/dist/elements/Rule.d.ts +11 -0
- package/dist/elements/Rule.d.ts.map +1 -0
- package/dist/elements/Rule.js +19 -0
- package/dist/elements/ScrollArea.d.ts +21 -0
- package/dist/elements/ScrollArea.d.ts.map +1 -0
- package/dist/elements/ScrollArea.js +101 -0
- package/dist/elements/SelectAction.d.ts +20 -0
- package/dist/elements/SelectAction.d.ts.map +1 -0
- package/dist/elements/SelectAction.js +113 -0
- package/dist/elements/SelectField.d.ts +11 -0
- package/dist/elements/SelectField.d.ts.map +1 -0
- package/dist/elements/SelectField.js +220 -0
- package/dist/elements/SelectMenu.d.ts +19 -0
- package/dist/elements/SelectMenu.d.ts.map +1 -0
- package/dist/elements/SelectMenu.js +122 -0
- package/dist/elements/Svg.d.ts +155 -0
- package/dist/elements/Svg.d.ts.map +1 -0
- package/dist/elements/Svg.js +525 -0
- package/dist/elements/TableBox.d.ts +19 -0
- package/dist/elements/TableBox.d.ts.map +1 -0
- package/dist/elements/TableBox.js +87 -0
- package/dist/elements/TableCell.d.ts +16 -0
- package/dist/elements/TableCell.d.ts.map +1 -0
- package/dist/elements/TableCell.js +69 -0
- package/dist/elements/Text.d.ts +17 -0
- package/dist/elements/Text.d.ts.map +1 -0
- package/dist/elements/Text.js +96 -0
- package/dist/elements/TextField.d.ts +25 -0
- package/dist/elements/TextField.d.ts.map +1 -0
- package/dist/elements/TextField.js +257 -0
- package/dist/elements/accessibility.d.ts +36 -0
- package/dist/elements/accessibility.d.ts.map +1 -0
- package/dist/elements/accessibility.js +239 -0
- package/dist/elements/className.d.ts +45 -0
- package/dist/elements/className.d.ts.map +1 -0
- package/dist/elements/className.js +8 -0
- package/dist/elements/decimal.d.ts +5 -0
- package/dist/elements/decimal.d.ts.map +1 -0
- package/dist/elements/decimal.js +11 -0
- package/dist/elements/documentUrl.d.ts +35 -0
- package/dist/elements/documentUrl.d.ts.map +1 -0
- package/dist/elements/documentUrl.js +89 -0
- package/dist/elements/drag-drop.d.ts +11 -0
- package/dist/elements/drag-drop.d.ts.map +1 -0
- package/dist/elements/drag-drop.js +277 -0
- package/dist/elements/drag.d.ts +47 -0
- package/dist/elements/drag.d.ts.map +1 -0
- package/dist/elements/drag.js +362 -0
- package/dist/elements/events.d.ts +45 -0
- package/dist/elements/events.d.ts.map +1 -0
- package/dist/elements/events.js +101 -0
- package/dist/elements/fieldBounds.d.ts +5 -0
- package/dist/elements/fieldBounds.d.ts.map +1 -0
- package/dist/elements/fieldBounds.js +60 -0
- package/dist/elements/flow.d.ts +36 -0
- package/dist/elements/flow.d.ts.map +1 -0
- package/dist/elements/flow.js +47 -0
- package/dist/elements/form.d.ts +48 -0
- package/dist/elements/form.d.ts.map +1 -0
- package/dist/elements/form.js +112 -0
- package/dist/elements/grid.d.ts +96 -0
- package/dist/elements/grid.d.ts.map +1 -0
- package/dist/elements/grid.js +272 -0
- package/dist/elements/index.d.ts +36 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/index.js +35 -0
- package/dist/elements/inherited.d.ts +181 -0
- package/dist/elements/inherited.d.ts.map +1 -0
- package/dist/elements/inherited.js +512 -0
- package/dist/elements/labels.d.ts +39 -0
- package/dist/elements/labels.d.ts.map +1 -0
- package/dist/elements/labels.js +163 -0
- package/dist/elements/measure.d.ts +27 -0
- package/dist/elements/measure.d.ts.map +1 -0
- package/dist/elements/measure.js +24 -0
- package/dist/elements/outsidePress.d.ts +31 -0
- package/dist/elements/outsidePress.d.ts.map +1 -0
- package/dist/elements/outsidePress.js +94 -0
- package/dist/elements/paste.d.ts +22 -0
- package/dist/elements/paste.d.ts.map +1 -0
- package/dist/elements/paste.js +49 -0
- package/dist/elements/press.d.ts +41 -0
- package/dist/elements/press.d.ts.map +1 -0
- package/dist/elements/press.js +131 -0
- package/dist/elements/rangeKeyboard.d.ts +41 -0
- package/dist/elements/rangeKeyboard.d.ts.map +1 -0
- package/dist/elements/rangeKeyboard.js +58 -0
- package/dist/elements/rangeValues.d.ts +20 -0
- package/dist/elements/rangeValues.d.ts.map +1 -0
- package/dist/elements/rangeValues.js +101 -0
- package/dist/elements/ref.d.ts +16 -0
- package/dist/elements/ref.d.ts.map +1 -0
- package/dist/elements/ref.js +22 -0
- package/dist/elements/reveal.d.ts +8 -0
- package/dist/elements/reveal.d.ts.map +1 -0
- package/dist/elements/reveal.js +10 -0
- package/dist/elements/scrollReveal.d.ts +19 -0
- package/dist/elements/scrollReveal.d.ts.map +1 -0
- package/dist/elements/scrollReveal.js +52 -0
- package/dist/elements/selectOptions.d.ts +25 -0
- package/dist/elements/selectOptions.d.ts.map +1 -0
- package/dist/elements/selectOptions.js +60 -0
- package/dist/elements/style.d.ts +30 -0
- package/dist/elements/style.d.ts.map +1 -0
- package/dist/elements/style.js +363 -0
- package/dist/elements/svgHover.d.ts +41 -0
- package/dist/elements/svgHover.d.ts.map +1 -0
- package/dist/elements/svgHover.js +152 -0
- package/dist/elements/table.d.ts +52 -0
- package/dist/elements/table.d.ts.map +1 -0
- package/dist/elements/table.js +104 -0
- package/dist/elements/types.d.ts +25 -0
- package/dist/elements/types.d.ts.map +1 -0
- package/dist/elements/types.js +8 -0
- package/dist/elements/viewport.d.ts +53 -0
- package/dist/elements/viewport.d.ts.map +1 -0
- package/dist/elements/viewport.js +62 -0
- package/dist/elements/wheelZoom.d.ts +11 -0
- package/dist/elements/wheelZoom.d.ts.map +1 -0
- package/dist/elements/wheelZoom.js +7 -0
- package/dist/index.d.ts +11 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/platform/focus.d.ts +31 -0
- package/dist/platform/focus.d.ts.map +1 -0
- package/dist/platform/focus.js +86 -0
- package/dist/platform/index.d.ts +31 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +179 -0
- package/dist/platform/layout.d.ts +13 -0
- package/dist/platform/layout.d.ts.map +1 -0
- package/dist/platform/layout.js +15 -0
- package/dist/platform/position.d.ts +5 -0
- package/dist/platform/position.d.ts.map +1 -0
- package/dist/platform/position.js +177 -0
- package/dist/platform/stack.d.ts +86 -0
- package/dist/platform/stack.d.ts.map +1 -0
- package/dist/platform/stack.js +318 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +66 -8
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native styles of the elements.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { Platform, processColor } from 'react-native';
|
|
7
|
+
/**
|
|
8
|
+
* Whether a value is a percentage length (`'50%'`).
|
|
9
|
+
*
|
|
10
|
+
* @param value - A CSS value.
|
|
11
|
+
* @returns Whether it is one.
|
|
12
|
+
*/
|
|
13
|
+
function isPercent(value) {
|
|
14
|
+
return typeof value === 'string' && /^-?\d+(?:\.\d+)?%$/.test(value);
|
|
15
|
+
}
|
|
16
|
+
/** The web's root font size, which a `rem` length is a multiple of. */
|
|
17
|
+
const ROOT_FONT_SIZE = 16;
|
|
18
|
+
/**
|
|
19
|
+
* A CSS length a device can draw: a number, a pixel string (`'4px'` is 4), a `rem` string at the
|
|
20
|
+
* web's root font size (`'2rem'` is 32) or a percentage.
|
|
21
|
+
*
|
|
22
|
+
* @param value - A CSS value.
|
|
23
|
+
* @returns The length, or `undefined` when a device cannot draw it (`'2em'`, `calc()`).
|
|
24
|
+
*/
|
|
25
|
+
function length(value) {
|
|
26
|
+
if (typeof value === 'number')
|
|
27
|
+
return value;
|
|
28
|
+
if (isPercent(value))
|
|
29
|
+
return value;
|
|
30
|
+
if (typeof value === 'string' && /^-?\d+(?:\.\d+)?px$/.test(value))
|
|
31
|
+
return Number.parseFloat(value);
|
|
32
|
+
if (typeof value === 'string' && /^-?\d+(?:\.\d+)?rem$/.test(value))
|
|
33
|
+
return Number.parseFloat(value) * ROOT_FONT_SIZE;
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A CSS number a device can draw: a number, or a pixel string for pixel-only properties.
|
|
38
|
+
*
|
|
39
|
+
* @param value - A CSS value.
|
|
40
|
+
* @returns The number, or `undefined`.
|
|
41
|
+
*/
|
|
42
|
+
function pixels(value) {
|
|
43
|
+
const l = length(value);
|
|
44
|
+
return typeof l === 'number' ? l : undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A plain number (`flex: 1`, `opacity: '0.5'`).
|
|
48
|
+
*
|
|
49
|
+
* @param value - A CSS value.
|
|
50
|
+
* @returns The number, or `undefined`.
|
|
51
|
+
*/
|
|
52
|
+
function plainNumber(value) {
|
|
53
|
+
if (typeof value === 'number')
|
|
54
|
+
return value;
|
|
55
|
+
if (typeof value === 'string' && /^-?\d+(?:\.\d+)?$/.test(value))
|
|
56
|
+
return Number(value);
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A colour a device can draw: any string but a CSS variable or a computed one.
|
|
61
|
+
*
|
|
62
|
+
* @param value - A CSS value.
|
|
63
|
+
* @returns The colour, or `undefined`.
|
|
64
|
+
*/
|
|
65
|
+
function color(value) {
|
|
66
|
+
return typeof value === 'string' && !/var\(|calc\(|color-mix\(/.test(value) ? value : undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* One of a closed set of keywords.
|
|
70
|
+
*
|
|
71
|
+
* @param value - A CSS value.
|
|
72
|
+
* @param options - The keywords.
|
|
73
|
+
* @returns The keyword, or `undefined`.
|
|
74
|
+
*/
|
|
75
|
+
function keyword(value, options) {
|
|
76
|
+
return options.find((option) => option === value);
|
|
77
|
+
}
|
|
78
|
+
const LENGTH_KEYS = [
|
|
79
|
+
'top',
|
|
80
|
+
'right',
|
|
81
|
+
'bottom',
|
|
82
|
+
'left',
|
|
83
|
+
'width',
|
|
84
|
+
'height',
|
|
85
|
+
'minWidth',
|
|
86
|
+
'minHeight',
|
|
87
|
+
'maxWidth',
|
|
88
|
+
'maxHeight',
|
|
89
|
+
'padding',
|
|
90
|
+
'paddingTop',
|
|
91
|
+
'paddingRight',
|
|
92
|
+
'paddingBottom',
|
|
93
|
+
'paddingLeft',
|
|
94
|
+
];
|
|
95
|
+
const MARGIN_KEYS = ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft'];
|
|
96
|
+
const PIXEL_KEYS = [
|
|
97
|
+
'gap',
|
|
98
|
+
'rowGap',
|
|
99
|
+
'columnGap',
|
|
100
|
+
'borderWidth',
|
|
101
|
+
'borderTopWidth',
|
|
102
|
+
'borderRightWidth',
|
|
103
|
+
'borderBottomWidth',
|
|
104
|
+
'borderLeftWidth',
|
|
105
|
+
'borderRadius',
|
|
106
|
+
'borderTopLeftRadius',
|
|
107
|
+
'borderTopRightRadius',
|
|
108
|
+
'borderBottomLeftRadius',
|
|
109
|
+
'borderBottomRightRadius',
|
|
110
|
+
'fontSize',
|
|
111
|
+
'letterSpacing',
|
|
112
|
+
];
|
|
113
|
+
const NUMBER_KEYS = ['flex', 'flexGrow', 'flexShrink', 'zIndex', 'opacity'];
|
|
114
|
+
const COLOR_KEYS = [
|
|
115
|
+
'backgroundColor',
|
|
116
|
+
'borderColor',
|
|
117
|
+
'borderTopColor',
|
|
118
|
+
'borderRightColor',
|
|
119
|
+
'borderBottomColor',
|
|
120
|
+
'borderLeftColor',
|
|
121
|
+
'color',
|
|
122
|
+
];
|
|
123
|
+
/**
|
|
124
|
+
* The part of an element's CSS a device can draw: the keys {@link TextStyle} names, with values a
|
|
125
|
+
* device understands (pixel strings become numbers; `'2rem'`, `calc()` and `var()` are left out).
|
|
126
|
+
*
|
|
127
|
+
* @param css - CSS written for the web (`webStyle`).
|
|
128
|
+
* @returns The native style.
|
|
129
|
+
*/
|
|
130
|
+
export function drawable(css) {
|
|
131
|
+
const out = {};
|
|
132
|
+
const background = color(css.background);
|
|
133
|
+
if (background && processColor(background) != null)
|
|
134
|
+
out.backgroundColor = background;
|
|
135
|
+
for (const key of LENGTH_KEYS) {
|
|
136
|
+
const value = length(css[key]);
|
|
137
|
+
if (value !== undefined)
|
|
138
|
+
out[key] = value;
|
|
139
|
+
}
|
|
140
|
+
for (const key of MARGIN_KEYS) {
|
|
141
|
+
const value = css[key] === 'auto' ? 'auto' : length(css[key]);
|
|
142
|
+
if (value !== undefined)
|
|
143
|
+
out[key] = value;
|
|
144
|
+
}
|
|
145
|
+
for (const key of PIXEL_KEYS) {
|
|
146
|
+
const value = pixels(css[key]);
|
|
147
|
+
if (value !== undefined)
|
|
148
|
+
out[key] = value;
|
|
149
|
+
}
|
|
150
|
+
for (const key of NUMBER_KEYS) {
|
|
151
|
+
const value = plainNumber(css[key]);
|
|
152
|
+
if (value !== undefined)
|
|
153
|
+
out[key] = value;
|
|
154
|
+
}
|
|
155
|
+
const ratio = css.aspectRatio;
|
|
156
|
+
const terms = typeof ratio === 'string' ? ratio.trim().split(/\s*\/\s*/) : [ratio];
|
|
157
|
+
if (terms.length <= 2) {
|
|
158
|
+
const numerator = plainNumber(terms[0]);
|
|
159
|
+
const denominator = terms.length === 1 ? 1 : plainNumber(terms[1]);
|
|
160
|
+
if (numerator && denominator && numerator > 0 && denominator > 0) {
|
|
161
|
+
const value = numerator / denominator;
|
|
162
|
+
if (Number.isFinite(value) && value > 0)
|
|
163
|
+
out.aspectRatio = value;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
for (const key of COLOR_KEYS) {
|
|
167
|
+
const value = color(css[key]);
|
|
168
|
+
if (value !== undefined)
|
|
169
|
+
out[key] = value;
|
|
170
|
+
}
|
|
171
|
+
const basis = css.flexBasis === 'auto' ? 'auto' : length(css.flexBasis);
|
|
172
|
+
if (basis !== undefined)
|
|
173
|
+
out.flexBasis = basis;
|
|
174
|
+
const lineHeight = pixels(css.lineHeight);
|
|
175
|
+
if (lineHeight !== undefined)
|
|
176
|
+
out.lineHeight = `${lineHeight}px`;
|
|
177
|
+
const display = keyword(css.display, ['flex', 'none']);
|
|
178
|
+
if (display)
|
|
179
|
+
out.display = display;
|
|
180
|
+
const position = keyword(css.position, ['relative', 'absolute']);
|
|
181
|
+
if (position)
|
|
182
|
+
out.position = position;
|
|
183
|
+
const direction = keyword(css.flexDirection, [
|
|
184
|
+
'row',
|
|
185
|
+
'column',
|
|
186
|
+
'row-reverse',
|
|
187
|
+
'column-reverse',
|
|
188
|
+
]);
|
|
189
|
+
if (direction)
|
|
190
|
+
out.flexDirection = direction;
|
|
191
|
+
const wrap = keyword(css.flexWrap, ['wrap', 'nowrap', 'wrap-reverse']);
|
|
192
|
+
if (wrap)
|
|
193
|
+
out.flexWrap = wrap;
|
|
194
|
+
const items = ['flex-start', 'flex-end', 'center', 'stretch', 'baseline'];
|
|
195
|
+
const alignItems = keyword(css.alignItems, items);
|
|
196
|
+
if (alignItems)
|
|
197
|
+
out.alignItems = alignItems;
|
|
198
|
+
const alignSelf = keyword(css.alignSelf, ['auto', ...items]);
|
|
199
|
+
if (alignSelf)
|
|
200
|
+
out.alignSelf = alignSelf;
|
|
201
|
+
const spacing = [
|
|
202
|
+
'flex-start',
|
|
203
|
+
'flex-end',
|
|
204
|
+
'center',
|
|
205
|
+
'space-between',
|
|
206
|
+
'space-around',
|
|
207
|
+
'space-evenly',
|
|
208
|
+
];
|
|
209
|
+
const justify = keyword(css.justifyContent, spacing);
|
|
210
|
+
if (justify)
|
|
211
|
+
out.justifyContent = justify;
|
|
212
|
+
const alignContent = keyword(css.alignContent, [...spacing, 'stretch']);
|
|
213
|
+
if (alignContent)
|
|
214
|
+
out.alignContent = alignContent;
|
|
215
|
+
const overflow = keyword(css.overflow, ['visible', 'hidden']);
|
|
216
|
+
if (overflow)
|
|
217
|
+
out.overflow = overflow;
|
|
218
|
+
const pointerEvents = keyword(css.pointerEvents, ['auto', 'none']);
|
|
219
|
+
if (pointerEvents)
|
|
220
|
+
out.pointerEvents = pointerEvents;
|
|
221
|
+
const borderStyle = keyword(css.borderStyle, ['solid', 'dotted', 'dashed']);
|
|
222
|
+
if (borderStyle)
|
|
223
|
+
out.borderStyle = borderStyle;
|
|
224
|
+
const weights = [
|
|
225
|
+
'normal',
|
|
226
|
+
'bold',
|
|
227
|
+
'100',
|
|
228
|
+
'200',
|
|
229
|
+
'300',
|
|
230
|
+
'400',
|
|
231
|
+
'500',
|
|
232
|
+
'600',
|
|
233
|
+
'700',
|
|
234
|
+
'800',
|
|
235
|
+
'900',
|
|
236
|
+
];
|
|
237
|
+
const fontWeight = keyword(typeof css.fontWeight === 'number' ? String(css.fontWeight) : css.fontWeight, weights);
|
|
238
|
+
if (fontWeight)
|
|
239
|
+
out.fontWeight = fontWeight;
|
|
240
|
+
const fontStyle = keyword(css.fontStyle, ['normal', 'italic']);
|
|
241
|
+
if (fontStyle)
|
|
242
|
+
out.fontStyle = fontStyle;
|
|
243
|
+
const textAlign = keyword(css.textAlign, ['left', 'right', 'center', 'justify']);
|
|
244
|
+
if (textAlign)
|
|
245
|
+
out.textAlign = textAlign;
|
|
246
|
+
const transform = keyword(css.textTransform, [
|
|
247
|
+
'none',
|
|
248
|
+
'uppercase',
|
|
249
|
+
'lowercase',
|
|
250
|
+
'capitalize',
|
|
251
|
+
]);
|
|
252
|
+
if (transform)
|
|
253
|
+
out.textTransform = transform;
|
|
254
|
+
const decoration = keyword(css.textDecorationLine, [
|
|
255
|
+
'none',
|
|
256
|
+
'underline',
|
|
257
|
+
'line-through',
|
|
258
|
+
'underline line-through',
|
|
259
|
+
]);
|
|
260
|
+
if (decoration)
|
|
261
|
+
out.textDecorationLine = decoration;
|
|
262
|
+
return out;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* An element's native style: its `style`, then what a device can draw of its `webStyle` (the
|
|
266
|
+
* web kit applies them in the same order).
|
|
267
|
+
*
|
|
268
|
+
* @param style - The element's `style`.
|
|
269
|
+
* @param webStyle - The element's `webStyle`.
|
|
270
|
+
* @returns The style, or `undefined` when there is none.
|
|
271
|
+
*/
|
|
272
|
+
export function nativeStyle(style, webStyle) {
|
|
273
|
+
if (!style && !webStyle)
|
|
274
|
+
return undefined;
|
|
275
|
+
const merged = { ...style, ...(webStyle ? drawable(webStyle) : {}) };
|
|
276
|
+
const { lineHeight, ...rest } = merged;
|
|
277
|
+
const out = lineHeight === undefined ? rest : { ...rest, lineHeight: Number.parseFloat(lineHeight) };
|
|
278
|
+
const transform = nativeTransform(webStyle?.transform);
|
|
279
|
+
return transform ? { ...out, transform } : out;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* A CSS `transform` a device can draw, as React Native's list of steps: `translateX`,
|
|
283
|
+
* `translateY` and `translate` (pixels or percentages), `scale`, `scaleX`, `scaleY` and
|
|
284
|
+
* `rotate` (degrees).
|
|
285
|
+
*
|
|
286
|
+
* @param css - The CSS value (`'translateX(-40%)'`).
|
|
287
|
+
* @returns The steps, or `undefined` when there is none or a step is one a device cannot draw.
|
|
288
|
+
*/
|
|
289
|
+
function nativeTransform(css) {
|
|
290
|
+
if (typeof css !== 'string' || css.trim() === '' || css.trim() === 'none')
|
|
291
|
+
return undefined;
|
|
292
|
+
const steps = [];
|
|
293
|
+
const pattern = /([a-zA-Z]+)\(([^)]*)\)/g;
|
|
294
|
+
let rest = css;
|
|
295
|
+
for (const [whole, name, body] of css.matchAll(pattern)) {
|
|
296
|
+
rest = rest.replace(whole, '');
|
|
297
|
+
const args = (body ?? '').split(',').map((arg) => arg.trim());
|
|
298
|
+
const step = transformStep(name ?? '', args);
|
|
299
|
+
if (!step)
|
|
300
|
+
return undefined;
|
|
301
|
+
steps.push(...step);
|
|
302
|
+
}
|
|
303
|
+
return rest.trim() === '' && steps.length > 0 ? steps : undefined;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* The native steps of one CSS transform function.
|
|
307
|
+
*
|
|
308
|
+
* @param name - The function's name.
|
|
309
|
+
* @param args - Its arguments.
|
|
310
|
+
* @returns The steps, or `undefined` when a device cannot draw it.
|
|
311
|
+
*/
|
|
312
|
+
function transformStep(name, args) {
|
|
313
|
+
const [first, second] = args;
|
|
314
|
+
switch (name) {
|
|
315
|
+
case 'translateX': {
|
|
316
|
+
const x = length(first);
|
|
317
|
+
return x === undefined ? undefined : [{ translateX: x }];
|
|
318
|
+
}
|
|
319
|
+
case 'translateY': {
|
|
320
|
+
const y = length(first);
|
|
321
|
+
return y === undefined ? undefined : [{ translateY: y }];
|
|
322
|
+
}
|
|
323
|
+
case 'translate': {
|
|
324
|
+
const x = length(first);
|
|
325
|
+
const y = second === undefined ? 0 : length(second);
|
|
326
|
+
return x === undefined || y === undefined ? undefined : [{ translateX: x }, { translateY: y }];
|
|
327
|
+
}
|
|
328
|
+
case 'scale': {
|
|
329
|
+
const x = plainNumber(first);
|
|
330
|
+
const y = second === undefined ? x : plainNumber(second);
|
|
331
|
+
if (x === undefined || y === undefined)
|
|
332
|
+
return undefined;
|
|
333
|
+
return x === y ? [{ scale: x }] : [{ scaleX: x }, { scaleY: y }];
|
|
334
|
+
}
|
|
335
|
+
case 'scaleX': {
|
|
336
|
+
const x = plainNumber(first);
|
|
337
|
+
return x === undefined ? undefined : [{ scaleX: x }];
|
|
338
|
+
}
|
|
339
|
+
case 'scaleY': {
|
|
340
|
+
const y = plainNumber(first);
|
|
341
|
+
return y === undefined ? undefined : [{ scaleY: y }];
|
|
342
|
+
}
|
|
343
|
+
case 'rotate':
|
|
344
|
+
return first !== undefined && /^-?\d+(?:\.\d+)?deg$/.test(first)
|
|
345
|
+
? [{ rotate: first }]
|
|
346
|
+
: undefined;
|
|
347
|
+
default:
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/** The monospace font of the platform. */
|
|
352
|
+
const MONOSPACE = Platform.select({ ios: 'Menlo', default: 'monospace' });
|
|
353
|
+
/**
|
|
354
|
+
* The defaults a browser (with the reference stylesheet's reset) gives a text tag, which a native
|
|
355
|
+
* `Text` does not have.
|
|
356
|
+
*/
|
|
357
|
+
export const TEXT_TAG_STYLE = {
|
|
358
|
+
em: { fontStyle: 'italic' },
|
|
359
|
+
code: { fontFamily: MONOSPACE },
|
|
360
|
+
kbd: { fontFamily: MONOSPACE },
|
|
361
|
+
pre: { fontFamily: MONOSPACE },
|
|
362
|
+
mark: { backgroundColor: '#ffff00', color: '#000000' },
|
|
363
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hosts shape hover on the native SVG viewport without claiming the touch responder.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type RefObject } from 'react';
|
|
7
|
+
import type { View, ViewProps } from 'react-native';
|
|
8
|
+
import type { Rect } from 'react-native-svg';
|
|
9
|
+
import type { SvgProps, SvgRectProps } from '@molecule/app-ui';
|
|
10
|
+
type Point = {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
type HoverTarget = {
|
|
15
|
+
hit(viewport: Point, svg: Point): boolean;
|
|
16
|
+
enter: NonNullable<SvgRectProps['onMouseEnter']>;
|
|
17
|
+
};
|
|
18
|
+
type RegisterHover = (id: string, target: HoverTarget) => () => void;
|
|
19
|
+
type HoverHandlers = Pick<ViewProps, 'onPointerEnter' | 'onPointerMoveCapture' | 'onPointerLeave'>;
|
|
20
|
+
/** Shape registrations are owned by the enclosing canvas. */
|
|
21
|
+
export declare const SvgHoverScope: import("react").Context<RegisterHover | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Tracks pointer entry and movement at the canvas, even when the native event targets a shape.
|
|
24
|
+
*
|
|
25
|
+
* @param props - The viewport's coordinate system and hit-testing mode.
|
|
26
|
+
* @returns The host ref, registration function and pointer handlers.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useSvgHover(props: Pick<SvgProps, 'viewBox' | 'preserveAspectRatio' | 'style'>): {
|
|
29
|
+
host: RefObject<View | null>;
|
|
30
|
+
register: RegisterHover;
|
|
31
|
+
handlers: HoverHandlers;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Registers a hover-enabled rectangle with the canvas and keeps the native shape's transform.
|
|
35
|
+
*
|
|
36
|
+
* @param props - The rectangle's geometry, hover listener and hit-testing mode.
|
|
37
|
+
* @returns The rectangle's native ref.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useRectHover(props: SvgRectProps): RefObject<Rect | null> | undefined;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=svgHover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svgHover.d.ts","sourceRoot":"","sources":["../../src/elements/svgHover.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAgB,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAI9D,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AACrC,KAAK,WAAW,GAAG;IACjB,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAAA;IACzC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAA;CACjD,CAAA;AACD,KAAK,aAAa,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,MAAM,IAAI,CAAA;AACpE,KAAK,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,GAAG,sBAAsB,GAAG,gBAAgB,CAAC,CAAA;AAElG,6DAA6D;AAC7D,eAAO,MAAM,aAAa,+CAA4C,CAAA;AA6BtE;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,qBAAqB,GAAG,OAAO,CAAC,GAAG;IAC/F,IAAI,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IAC5B,QAAQ,EAAE,aAAa,CAAA;IACvB,QAAQ,EAAE,aAAa,CAAA;CACxB,CA6DA;AA4BD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,SAAS,CAiBpF"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hosts shape hover on the native SVG viewport without claiming the touch responder.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createContext, useCallback, useContext, useId, useLayoutEffect, useRef, useState, } from 'react';
|
|
7
|
+
import { mouseEvent } from './events.js';
|
|
8
|
+
/** Shape registrations are owned by the enclosing canvas. */
|
|
9
|
+
export const SvgHoverScope = createContext(null);
|
|
10
|
+
/** Converts a viewport point to the canvas's view box, including letterboxing and slicing. */
|
|
11
|
+
function drawingPoint(point, width, height, viewBox, aspect) {
|
|
12
|
+
const [minX, minY, vbWidth, vbHeight] = (viewBox ?? '')
|
|
13
|
+
.trim()
|
|
14
|
+
.split(/[\s,]+/)
|
|
15
|
+
.map(Number);
|
|
16
|
+
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !(vbWidth > 0 && vbHeight > 0)) {
|
|
17
|
+
return point;
|
|
18
|
+
}
|
|
19
|
+
const [align, mode] = (aspect ?? 'xMidYMid meet').trim().split(/\s+/);
|
|
20
|
+
const sx = width / vbWidth;
|
|
21
|
+
const sy = height / vbHeight;
|
|
22
|
+
if (align === 'none')
|
|
23
|
+
return { x: point.x / sx + minX, y: point.y / sy + minY };
|
|
24
|
+
const scale = mode === 'slice' ? Math.max(sx, sy) : Math.min(sx, sy);
|
|
25
|
+
const extraX = width - vbWidth * scale;
|
|
26
|
+
const extraY = height - vbHeight * scale;
|
|
27
|
+
const dx = align?.startsWith('xMin') ? 0 : align?.startsWith('xMax') ? extraX : extraX / 2;
|
|
28
|
+
const dy = align?.endsWith('YMin') ? 0 : align?.endsWith('YMax') ? extraY : extraY / 2;
|
|
29
|
+
return { x: (point.x - dx) / scale + minX, y: (point.y - dy) / scale + minY };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Tracks pointer entry and movement at the canvas, even when the native event targets a shape.
|
|
33
|
+
*
|
|
34
|
+
* @param props - The viewport's coordinate system and hit-testing mode.
|
|
35
|
+
* @returns The host ref, registration function and pointer handlers.
|
|
36
|
+
*/
|
|
37
|
+
export function useSvgHover(props) {
|
|
38
|
+
const host = useRef(null);
|
|
39
|
+
const targets = useRef(new Map());
|
|
40
|
+
const hovered = useRef(undefined);
|
|
41
|
+
const sequence = useRef({ received: 0, handled: 0 });
|
|
42
|
+
const [active, setActive] = useState(false);
|
|
43
|
+
const register = useCallback((id, target) => {
|
|
44
|
+
targets.current.set(id, target);
|
|
45
|
+
setActive(true);
|
|
46
|
+
return () => {
|
|
47
|
+
targets.current.delete(id);
|
|
48
|
+
if (targets.current.size === 0)
|
|
49
|
+
setActive(false);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
const leave = () => {
|
|
53
|
+
hovered.current = undefined;
|
|
54
|
+
sequence.current.handled = ++sequence.current.received;
|
|
55
|
+
};
|
|
56
|
+
const move = (event) => {
|
|
57
|
+
const pointer = event.nativeEvent;
|
|
58
|
+
if (pointer.pointerType !== 'mouse' && !(pointer.pointerType === 'pen' && !pointer.buttons)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const sample = ++sequence.current.received;
|
|
62
|
+
// measure() and the pointer's page coordinates share the enclosing React root, including
|
|
63
|
+
// when it is a modal. The event's offset may be relative to a nested SVG shape.
|
|
64
|
+
host.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
|
|
65
|
+
if (sample <= sequence.current.handled)
|
|
66
|
+
return;
|
|
67
|
+
sequence.current.handled = sample;
|
|
68
|
+
const point = { x: pointer.pageX - pageX, y: pointer.pageY - pageY };
|
|
69
|
+
const inside = point.x >= 0 && point.x < width && point.y >= 0 && point.y < height;
|
|
70
|
+
const svg = inside
|
|
71
|
+
? drawingPoint(point, width, height, props.viewBox, props.preserveAspectRatio)
|
|
72
|
+
: undefined;
|
|
73
|
+
let match;
|
|
74
|
+
if (svg) {
|
|
75
|
+
for (const entry of targets.current) {
|
|
76
|
+
if (entry[1].hit(point, svg))
|
|
77
|
+
match = entry;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const id = match?.[0];
|
|
81
|
+
if (id === hovered.current)
|
|
82
|
+
return;
|
|
83
|
+
hovered.current = id;
|
|
84
|
+
match?.[1].enter(Object.assign(mouseEvent(event, pointer.button), {
|
|
85
|
+
clientX: pointer.clientX,
|
|
86
|
+
clientY: pointer.clientY,
|
|
87
|
+
buttons: pointer.buttons,
|
|
88
|
+
altKey: pointer.altKey,
|
|
89
|
+
ctrlKey: pointer.ctrlKey,
|
|
90
|
+
metaKey: pointer.metaKey,
|
|
91
|
+
shiftKey: pointer.shiftKey,
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const handlers = active && props.style?.pointerEvents !== 'none'
|
|
96
|
+
? { onPointerEnter: move, onPointerMoveCapture: move, onPointerLeave: leave }
|
|
97
|
+
: {};
|
|
98
|
+
return { host, register, handlers };
|
|
99
|
+
}
|
|
100
|
+
/** Uses the pinned SVG shape's matrix, which includes its transforms and the viewport mapping. */
|
|
101
|
+
function localPoint(shape, viewport) {
|
|
102
|
+
const matrix = shape?.getScreenCTM?.();
|
|
103
|
+
if (!matrix)
|
|
104
|
+
return undefined;
|
|
105
|
+
const { a, b, c, d, e, f } = matrix;
|
|
106
|
+
const determinant = a * d - b * c;
|
|
107
|
+
if (!Number.isFinite(determinant) || determinant === 0)
|
|
108
|
+
return null;
|
|
109
|
+
const x = viewport.x - e;
|
|
110
|
+
const y = viewport.y - f;
|
|
111
|
+
return { x: (d * x - c * y) / determinant, y: (a * y - b * x) / determinant };
|
|
112
|
+
}
|
|
113
|
+
/** Tests a rectangle's actual local outline, including rounded corners. */
|
|
114
|
+
function inRect(point, props) {
|
|
115
|
+
const { x = 0, y = 0, width, height, rx, ry } = props;
|
|
116
|
+
const dx = point.x - x;
|
|
117
|
+
const dy = point.y - y;
|
|
118
|
+
if (!(dx >= 0 && dx < width && dy >= 0 && dy < height))
|
|
119
|
+
return false;
|
|
120
|
+
const radiusX = Math.min(rx ?? ry ?? 0, width / 2);
|
|
121
|
+
const radiusY = Math.min(ry ?? rx ?? 0, height / 2);
|
|
122
|
+
if (radiusX <= 0 || radiusY <= 0)
|
|
123
|
+
return true;
|
|
124
|
+
const cornerX = Math.max(radiusX - dx, dx - width + radiusX, 0) / radiusX;
|
|
125
|
+
const cornerY = Math.max(radiusY - dy, dy - height + radiusY, 0) / radiusY;
|
|
126
|
+
return cornerX ** 2 + cornerY ** 2 <= 1;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Registers a hover-enabled rectangle with the canvas and keeps the native shape's transform.
|
|
130
|
+
*
|
|
131
|
+
* @param props - The rectangle's geometry, hover listener and hit-testing mode.
|
|
132
|
+
* @returns The rectangle's native ref.
|
|
133
|
+
*/
|
|
134
|
+
export function useRectHover(props) {
|
|
135
|
+
const id = useId();
|
|
136
|
+
const register = useContext(SvgHoverScope);
|
|
137
|
+
const shape = useRef(null);
|
|
138
|
+
const { onMouseEnter } = props;
|
|
139
|
+
const pointerEvents = props.style?.pointerEvents ?? props.pointerEvents;
|
|
140
|
+
useLayoutEffect(() => {
|
|
141
|
+
if (!register || !onMouseEnter || pointerEvents === 'none')
|
|
142
|
+
return;
|
|
143
|
+
return register(id, {
|
|
144
|
+
enter: onMouseEnter,
|
|
145
|
+
hit: (viewport, svg) => {
|
|
146
|
+
const point = localPoint(shape.current, viewport);
|
|
147
|
+
return point !== null && inRect(point ?? svg, props);
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
}, [id, onMouseEnter, pointerEvents, props, register]);
|
|
151
|
+
return onMouseEnter && pointerEvents !== 'none' ? shape : undefined;
|
|
152
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column sizes and row positions shared by native table elements.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/** A cell's position and explicitly requested column width. */
|
|
7
|
+
export interface CellTrack {
|
|
8
|
+
column: number;
|
|
9
|
+
span: number;
|
|
10
|
+
fixed?: number | string;
|
|
11
|
+
}
|
|
12
|
+
/** A cell that has registered with a table, with its measured width when it needs one. */
|
|
13
|
+
export interface CellMeasure {
|
|
14
|
+
track: CellTrack;
|
|
15
|
+
natural?: number;
|
|
16
|
+
}
|
|
17
|
+
/** The colspan limit used by HTML cells. */
|
|
18
|
+
export declare function cellSpan(span: number | undefined): number;
|
|
19
|
+
/** A native layout dimension that fixes a column, or undefined for an automatic width. */
|
|
20
|
+
export declare function fixedLength(width: unknown): number | string | undefined;
|
|
21
|
+
/** Resolves a fixed dimension against the table's proposed width. */
|
|
22
|
+
export declare function widthIn(width: number | string | undefined, available: number | undefined): number | undefined;
|
|
23
|
+
/** Whether the table needs to measure the content of this cell before it can lay it out. */
|
|
24
|
+
export declare function needsNaturalWidth(track: CellTrack): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Resolves a table's column widths from the widest unspanned cells. Fixed columns
|
|
27
|
+
* keep their widths. When there is room, auto columns grow in proportion to their
|
|
28
|
+
* natural widths. A wide table keeps its natural sizes so the scroll area can pan.
|
|
29
|
+
*
|
|
30
|
+
* @param available - The table or viewport width.
|
|
31
|
+
* @param cells - The mounted cells and their measurements.
|
|
32
|
+
* @returns The width of each column from left to right.
|
|
33
|
+
*/
|
|
34
|
+
export declare function tableColumnWidths(available: number, cells: readonly CellMeasure[]): number[];
|
|
35
|
+
interface TableLayoutValue {
|
|
36
|
+
register(id: string, track: CellTrack): () => void;
|
|
37
|
+
measure(id: string, track: CellTrack, natural: number): void;
|
|
38
|
+
widths: number[] | undefined;
|
|
39
|
+
}
|
|
40
|
+
/** A table's current column widths and the callbacks its cells use to report dimensions. */
|
|
41
|
+
export declare function useTableLayout(available: number | undefined): TableLayoutValue;
|
|
42
|
+
/** The shared layout of the nearest table. */
|
|
43
|
+
export declare const TableLayout: import("react").Context<TableLayoutValue | null>;
|
|
44
|
+
/** The starting column assigned by the nearest row. */
|
|
45
|
+
export declare const TableColumn: import("react").Context<number | undefined>;
|
|
46
|
+
/** A row's position within its own group. */
|
|
47
|
+
export declare const TableRowPosition: import("react").Context<{
|
|
48
|
+
first: boolean;
|
|
49
|
+
last: boolean;
|
|
50
|
+
} | undefined>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/elements/table.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB;AAED,0FAA0F;AAC1F,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,4CAA4C;AAC5C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAIzD;AAED,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAIvE;AAED,qEAAqE;AACrE,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAClC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,SAAS,CAKpB;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAE3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,EAAE,CAsB5F;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,IAAI,CAAA;IAClD,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CAC7B;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,CA6B9E;AAED,8CAA8C;AAC9C,eAAO,MAAM,WAAW,kDAA+C,CAAA;AAEvE,uDAAuD;AACvD,eAAO,MAAM,WAAW,6CAA+C,CAAA;AAEvE,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB;WAA0B,OAAO;UAAQ,OAAO;cAE5E,CAAA"}
|