@sincpro/mobile-ui 3.1.0 → 3.3.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/Dialog/Dialog.EditValue.js +6 -19
- package/dist/Dialog/Dialog.Sheet.js +48 -12
- package/dist/Dialog/OverlayHost.d.ts +2 -1
- package/dist/Dialog/OverlayHost.js +36 -2
- package/dist/Dialog/SheetSurface.d.ts +19 -0
- package/dist/Dialog/SheetSurface.js +279 -225
- package/dist/Display/Display.DocumentPreview.d.ts +15 -0
- package/dist/Display/Display.DocumentPreview.js +349 -0
- package/dist/Display/Display.DocumentViewer.d.ts +15 -0
- package/dist/Display/Display.DocumentViewer.js +465 -0
- package/dist/Display/Display.SwipeableRow.js +30 -23
- package/dist/Display/document-pages.d.ts +21 -0
- package/dist/Display/document-pages.js +282 -0
- package/dist/Display/document-renderer.d.ts +30 -0
- package/dist/Display/document-renderer.js +28 -0
- package/dist/Display/icon-map.d.ts +10 -10
- package/dist/Display/icon-map.js +14 -10
- package/dist/Display/index.d.ts +8 -0
- package/dist/Display/index.js +6 -0
- package/dist/Form/Form.DatePicker.js +2 -0
- package/dist/Form/Form.Input.d.ts +1 -1
- package/dist/Form/Form.Input.js +234 -215
- package/dist/Form/Form.KeyboardToolbarHost.js +78 -37
- package/dist/Form/Form.PickerField.js +133 -156
- package/dist/Form/Form.RadioButton.d.ts +1 -0
- package/dist/Form/Form.RadioButton.js +11 -122
- package/dist/Form/Form.Select.d.ts +2 -1
- package/dist/Form/Form.Select.js +183 -286
- package/dist/Form/choice-row.d.ts +15 -0
- package/dist/Form/choice-row.js +236 -0
- package/dist/theme/active.d.ts +2 -0
- package/dist/theme/active.js +13 -0
- package/dist/theme/useTheme.d.ts +4 -0
- package/dist/theme/useTheme.js +7 -12
- package/dist/utils/document.d.ts +18 -0
- package/dist/utils/document.js +46 -0
- package/package.json +4 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { documentRenderer } from "./document-renderer.js";
|
|
3
|
+
import { documentImageUri, documentMimeType, isImageMimeType, mimeTypeLabel } from "../utils/document.js";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
export let DocumentStatus = /*#__PURE__*/function (DocumentStatus) {
|
|
6
|
+
DocumentStatus["LOADING"] = "loading";
|
|
7
|
+
DocumentStatus["READY"] = "ready";
|
|
8
|
+
DocumentStatus["UNSUPPORTED"] = "unsupported";
|
|
9
|
+
DocumentStatus["ERROR"] = "error";
|
|
10
|
+
return DocumentStatus;
|
|
11
|
+
}({});
|
|
12
|
+
export function documentMeta(label, isImage, pageCount) {
|
|
13
|
+
if (isImage || pageCount === 0) return label;
|
|
14
|
+
return `${label} · ${pageCount} ${pageCount === 1 ? "página" : "páginas"}`;
|
|
15
|
+
}
|
|
16
|
+
export function documentHeading(state) {
|
|
17
|
+
return state.isImage ? state.label : `Documento ${state.label}`;
|
|
18
|
+
}
|
|
19
|
+
export function useDocumentPages(source, maxWidth, firstPageOnly, override) {
|
|
20
|
+
const $ = _c(45);
|
|
21
|
+
let isImage;
|
|
22
|
+
let renderer;
|
|
23
|
+
let t0;
|
|
24
|
+
if ($[0] !== override || $[1] !== source) {
|
|
25
|
+
const detected = documentMimeType(source);
|
|
26
|
+
renderer = override ?? documentRenderer(detected);
|
|
27
|
+
isImage = !renderer && isImageMimeType(detected);
|
|
28
|
+
t0 = renderer?.label ?? mimeTypeLabel(detected);
|
|
29
|
+
$[0] = override;
|
|
30
|
+
$[1] = source;
|
|
31
|
+
$[2] = isImage;
|
|
32
|
+
$[3] = renderer;
|
|
33
|
+
$[4] = t0;
|
|
34
|
+
} else {
|
|
35
|
+
isImage = $[2];
|
|
36
|
+
renderer = $[3];
|
|
37
|
+
t0 = $[4];
|
|
38
|
+
}
|
|
39
|
+
const label = t0;
|
|
40
|
+
const isUri = "uri" in source;
|
|
41
|
+
const value = isUri ? source.uri : source.base64;
|
|
42
|
+
const {
|
|
43
|
+
mimeType
|
|
44
|
+
} = source;
|
|
45
|
+
const [attempt, setAttempt] = useState(0);
|
|
46
|
+
const [rendered, setRendered] = useState(null);
|
|
47
|
+
const [pageFailure, setPageFailure] = useState(null);
|
|
48
|
+
let t1;
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[5] !== attempt || $[6] !== firstPageOnly || $[7] !== isUri || $[8] !== maxWidth || $[9] !== mimeType || $[10] !== renderer || $[11] !== value) {
|
|
51
|
+
t1 = () => {
|
|
52
|
+
if (!renderer) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const controller = new AbortController();
|
|
56
|
+
const target = isUri ? {
|
|
57
|
+
uri: value,
|
|
58
|
+
mimeType
|
|
59
|
+
} : {
|
|
60
|
+
base64: value,
|
|
61
|
+
mimeType
|
|
62
|
+
};
|
|
63
|
+
const request = {
|
|
64
|
+
renderer,
|
|
65
|
+
value,
|
|
66
|
+
isUri,
|
|
67
|
+
mimeType,
|
|
68
|
+
maxWidth,
|
|
69
|
+
firstPageOnly,
|
|
70
|
+
attempt
|
|
71
|
+
};
|
|
72
|
+
renderer.render(target, {
|
|
73
|
+
maxWidth,
|
|
74
|
+
firstPageOnly,
|
|
75
|
+
signal: controller.signal
|
|
76
|
+
}).then(result => {
|
|
77
|
+
if (!controller.signal.aborted) {
|
|
78
|
+
setRendered({
|
|
79
|
+
...request,
|
|
80
|
+
failed: false,
|
|
81
|
+
...result
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}, error => {
|
|
85
|
+
if (controller.signal.aborted) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
console.error(`[Document] ${renderer.label} preview failed`, error);
|
|
89
|
+
setRendered({
|
|
90
|
+
...request,
|
|
91
|
+
failed: true,
|
|
92
|
+
pageCount: 0,
|
|
93
|
+
pages: []
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
return () => controller.abort();
|
|
97
|
+
};
|
|
98
|
+
t2 = [renderer, isUri, value, mimeType, maxWidth, firstPageOnly, attempt];
|
|
99
|
+
$[5] = attempt;
|
|
100
|
+
$[6] = firstPageOnly;
|
|
101
|
+
$[7] = isUri;
|
|
102
|
+
$[8] = maxWidth;
|
|
103
|
+
$[9] = mimeType;
|
|
104
|
+
$[10] = renderer;
|
|
105
|
+
$[11] = value;
|
|
106
|
+
$[12] = t1;
|
|
107
|
+
$[13] = t2;
|
|
108
|
+
} else {
|
|
109
|
+
t1 = $[12];
|
|
110
|
+
t2 = $[13];
|
|
111
|
+
}
|
|
112
|
+
useEffect(t1, t2);
|
|
113
|
+
let t3;
|
|
114
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
115
|
+
t3 = () => setAttempt(_temp);
|
|
116
|
+
$[14] = t3;
|
|
117
|
+
} else {
|
|
118
|
+
t3 = $[14];
|
|
119
|
+
}
|
|
120
|
+
let t4;
|
|
121
|
+
if ($[15] !== attempt || $[16] !== value) {
|
|
122
|
+
t4 = () => setPageFailure({
|
|
123
|
+
value,
|
|
124
|
+
attempt
|
|
125
|
+
});
|
|
126
|
+
$[15] = attempt;
|
|
127
|
+
$[16] = value;
|
|
128
|
+
$[17] = t4;
|
|
129
|
+
} else {
|
|
130
|
+
t4 = $[17];
|
|
131
|
+
}
|
|
132
|
+
let t5;
|
|
133
|
+
if ($[18] !== attempt || $[19] !== isImage || $[20] !== label || $[21] !== t4) {
|
|
134
|
+
t5 = {
|
|
135
|
+
label,
|
|
136
|
+
isImage,
|
|
137
|
+
attempt,
|
|
138
|
+
retry: t3,
|
|
139
|
+
reportPageError: t4
|
|
140
|
+
};
|
|
141
|
+
$[18] = attempt;
|
|
142
|
+
$[19] = isImage;
|
|
143
|
+
$[20] = label;
|
|
144
|
+
$[21] = t4;
|
|
145
|
+
$[22] = t5;
|
|
146
|
+
} else {
|
|
147
|
+
t5 = $[22];
|
|
148
|
+
}
|
|
149
|
+
const base = t5;
|
|
150
|
+
let t6;
|
|
151
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
152
|
+
t6 = [];
|
|
153
|
+
$[23] = t6;
|
|
154
|
+
} else {
|
|
155
|
+
t6 = $[23];
|
|
156
|
+
}
|
|
157
|
+
let t7;
|
|
158
|
+
if ($[24] !== base) {
|
|
159
|
+
t7 = {
|
|
160
|
+
...base,
|
|
161
|
+
pageCount: 0,
|
|
162
|
+
pages: t6
|
|
163
|
+
};
|
|
164
|
+
$[24] = base;
|
|
165
|
+
$[25] = t7;
|
|
166
|
+
} else {
|
|
167
|
+
t7 = $[25];
|
|
168
|
+
}
|
|
169
|
+
const empty = t7;
|
|
170
|
+
const pageFailed = pageFailure?.value === value && pageFailure.attempt === attempt;
|
|
171
|
+
if (pageFailed) {
|
|
172
|
+
let t8;
|
|
173
|
+
if ($[26] !== empty) {
|
|
174
|
+
t8 = {
|
|
175
|
+
...empty,
|
|
176
|
+
status: DocumentStatus.ERROR
|
|
177
|
+
};
|
|
178
|
+
$[26] = empty;
|
|
179
|
+
$[27] = t8;
|
|
180
|
+
} else {
|
|
181
|
+
t8 = $[27];
|
|
182
|
+
}
|
|
183
|
+
return t8;
|
|
184
|
+
}
|
|
185
|
+
if (isImage) {
|
|
186
|
+
let t8;
|
|
187
|
+
if ($[28] !== source) {
|
|
188
|
+
t8 = documentImageUri(source);
|
|
189
|
+
$[28] = source;
|
|
190
|
+
$[29] = t8;
|
|
191
|
+
} else {
|
|
192
|
+
t8 = $[29];
|
|
193
|
+
}
|
|
194
|
+
let t9;
|
|
195
|
+
if ($[30] !== t8) {
|
|
196
|
+
t9 = [{
|
|
197
|
+
uri: t8
|
|
198
|
+
}];
|
|
199
|
+
$[30] = t8;
|
|
200
|
+
$[31] = t9;
|
|
201
|
+
} else {
|
|
202
|
+
t9 = $[31];
|
|
203
|
+
}
|
|
204
|
+
let t10;
|
|
205
|
+
if ($[32] !== base || $[33] !== t9) {
|
|
206
|
+
t10 = {
|
|
207
|
+
...base,
|
|
208
|
+
status: DocumentStatus.READY,
|
|
209
|
+
pageCount: 1,
|
|
210
|
+
pages: t9
|
|
211
|
+
};
|
|
212
|
+
$[32] = base;
|
|
213
|
+
$[33] = t9;
|
|
214
|
+
$[34] = t10;
|
|
215
|
+
} else {
|
|
216
|
+
t10 = $[34];
|
|
217
|
+
}
|
|
218
|
+
return t10;
|
|
219
|
+
}
|
|
220
|
+
if (!renderer) {
|
|
221
|
+
let t8;
|
|
222
|
+
if ($[35] !== empty) {
|
|
223
|
+
t8 = {
|
|
224
|
+
...empty,
|
|
225
|
+
status: DocumentStatus.UNSUPPORTED
|
|
226
|
+
};
|
|
227
|
+
$[35] = empty;
|
|
228
|
+
$[36] = t8;
|
|
229
|
+
} else {
|
|
230
|
+
t8 = $[36];
|
|
231
|
+
}
|
|
232
|
+
return t8;
|
|
233
|
+
}
|
|
234
|
+
const current = rendered?.renderer === renderer && rendered.value === value && rendered.isUri === isUri && rendered.mimeType === mimeType && rendered.maxWidth === maxWidth && rendered.firstPageOnly === firstPageOnly && rendered.attempt === attempt ? rendered : null;
|
|
235
|
+
if (!current) {
|
|
236
|
+
let t8;
|
|
237
|
+
if ($[37] !== empty) {
|
|
238
|
+
t8 = {
|
|
239
|
+
...empty,
|
|
240
|
+
status: DocumentStatus.LOADING
|
|
241
|
+
};
|
|
242
|
+
$[37] = empty;
|
|
243
|
+
$[38] = t8;
|
|
244
|
+
} else {
|
|
245
|
+
t8 = $[38];
|
|
246
|
+
}
|
|
247
|
+
return t8;
|
|
248
|
+
}
|
|
249
|
+
if (current.failed) {
|
|
250
|
+
let t8;
|
|
251
|
+
if ($[39] !== empty) {
|
|
252
|
+
t8 = {
|
|
253
|
+
...empty,
|
|
254
|
+
status: DocumentStatus.ERROR
|
|
255
|
+
};
|
|
256
|
+
$[39] = empty;
|
|
257
|
+
$[40] = t8;
|
|
258
|
+
} else {
|
|
259
|
+
t8 = $[40];
|
|
260
|
+
}
|
|
261
|
+
return t8;
|
|
262
|
+
}
|
|
263
|
+
let t8;
|
|
264
|
+
if ($[41] !== base || $[42] !== current.pageCount || $[43] !== current.pages) {
|
|
265
|
+
t8 = {
|
|
266
|
+
...base,
|
|
267
|
+
status: DocumentStatus.READY,
|
|
268
|
+
pageCount: current.pageCount,
|
|
269
|
+
pages: current.pages
|
|
270
|
+
};
|
|
271
|
+
$[41] = base;
|
|
272
|
+
$[42] = current.pageCount;
|
|
273
|
+
$[43] = current.pages;
|
|
274
|
+
$[44] = t8;
|
|
275
|
+
} else {
|
|
276
|
+
t8 = $[44];
|
|
277
|
+
}
|
|
278
|
+
return t8;
|
|
279
|
+
}
|
|
280
|
+
function _temp(previous) {
|
|
281
|
+
return previous + 1;
|
|
282
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DocumentPage, DocumentSource } from "../utils/document.js";
|
|
2
|
+
/**
|
|
3
|
+
* The design system shows pages; turning a document into pages is the app's job. Register
|
|
4
|
+
* one renderer per MIME type at startup (`"image/*"` matches every image):
|
|
5
|
+
*
|
|
6
|
+
* registerDocumentRenderers({
|
|
7
|
+
* "application/pdf": { label: "PDF", render: renderPdfPages },
|
|
8
|
+
* "text/html": { label: "HTML", render: renderHtmlPages },
|
|
9
|
+
* });
|
|
10
|
+
*
|
|
11
|
+
* A component can override it with its `renderer` prop; keep that object stable (module
|
|
12
|
+
* scope), since a new one starts a new render. Images without a renderer load natively;
|
|
13
|
+
* any other type without one shows that the preview is unavailable.
|
|
14
|
+
*/
|
|
15
|
+
export interface DocumentRenderRequest {
|
|
16
|
+
maxWidth: number;
|
|
17
|
+
firstPageOnly: boolean;
|
|
18
|
+
signal: AbortSignal;
|
|
19
|
+
}
|
|
20
|
+
export interface DocumentRenderResult {
|
|
21
|
+
pageCount: number;
|
|
22
|
+
pages: DocumentPage[];
|
|
23
|
+
}
|
|
24
|
+
export interface DocumentRenderer {
|
|
25
|
+
label: string;
|
|
26
|
+
render: (source: DocumentSource, request: DocumentRenderRequest) => Promise<DocumentRenderResult>;
|
|
27
|
+
}
|
|
28
|
+
export declare function registerDocumentRenderers(entries: Record<string, DocumentRenderer | null>): void;
|
|
29
|
+
export declare function resetDocumentRenderers(): void;
|
|
30
|
+
export declare function documentRenderer(mimeType: string | undefined): DocumentRenderer | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The design system shows pages; turning a document into pages is the app's job. Register
|
|
3
|
+
* one renderer per MIME type at startup (`"image/*"` matches every image):
|
|
4
|
+
*
|
|
5
|
+
* registerDocumentRenderers({
|
|
6
|
+
* "application/pdf": { label: "PDF", render: renderPdfPages },
|
|
7
|
+
* "text/html": { label: "HTML", render: renderHtmlPages },
|
|
8
|
+
* });
|
|
9
|
+
*
|
|
10
|
+
* A component can override it with its `renderer` prop; keep that object stable (module
|
|
11
|
+
* scope), since a new one starts a new render. Images without a renderer load natively;
|
|
12
|
+
* any other type without one shows that the preview is unavailable.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const renderers = new Map();
|
|
16
|
+
export function registerDocumentRenderers(entries) {
|
|
17
|
+
for (const [mimeType, renderer] of Object.entries(entries)) {
|
|
18
|
+
if (renderer) renderers.set(mimeType.toLowerCase(), renderer);else renderers.delete(mimeType.toLowerCase());
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function resetDocumentRenderers() {
|
|
22
|
+
renderers.clear();
|
|
23
|
+
}
|
|
24
|
+
export function documentRenderer(mimeType) {
|
|
25
|
+
if (!mimeType) return undefined;
|
|
26
|
+
const type = mimeType.toLowerCase();
|
|
27
|
+
return renderers.get(type) ?? renderers.get(`${type.split("/")[0]}/*`);
|
|
28
|
+
}
|
|
@@ -10,7 +10,7 @@ export declare const ICON_MAP: {
|
|
|
10
10
|
readonly md: "add";
|
|
11
11
|
};
|
|
12
12
|
readonly "add-circle": {
|
|
13
|
-
readonly sf: "plus.circle
|
|
13
|
+
readonly sf: "plus.circle";
|
|
14
14
|
readonly md: "add_circle";
|
|
15
15
|
};
|
|
16
16
|
readonly archive: {
|
|
@@ -90,7 +90,7 @@ export declare const ICON_MAP: {
|
|
|
90
90
|
readonly md: "delete";
|
|
91
91
|
};
|
|
92
92
|
readonly dismiss: {
|
|
93
|
-
readonly sf: "xmark.circle
|
|
93
|
+
readonly sf: "xmark.circle";
|
|
94
94
|
readonly md: "cancel";
|
|
95
95
|
};
|
|
96
96
|
readonly document: {
|
|
@@ -118,7 +118,7 @@ export declare const ICON_MAP: {
|
|
|
118
118
|
readonly md: "inbox";
|
|
119
119
|
};
|
|
120
120
|
readonly error: {
|
|
121
|
-
readonly sf: "exclamationmark.circle
|
|
121
|
+
readonly sf: "exclamationmark.circle";
|
|
122
122
|
readonly md: "error";
|
|
123
123
|
};
|
|
124
124
|
readonly expand: {
|
|
@@ -146,7 +146,7 @@ export declare const ICON_MAP: {
|
|
|
146
146
|
readonly md: "visibility_off";
|
|
147
147
|
};
|
|
148
148
|
readonly home: {
|
|
149
|
-
readonly sf: "house
|
|
149
|
+
readonly sf: "house";
|
|
150
150
|
readonly md: "home";
|
|
151
151
|
};
|
|
152
152
|
readonly image: {
|
|
@@ -158,7 +158,7 @@ export declare const ICON_MAP: {
|
|
|
158
158
|
readonly md: "inbox";
|
|
159
159
|
};
|
|
160
160
|
readonly info: {
|
|
161
|
-
readonly sf: "info.circle
|
|
161
|
+
readonly sf: "info.circle";
|
|
162
162
|
readonly md: "info";
|
|
163
163
|
};
|
|
164
164
|
readonly link: {
|
|
@@ -206,7 +206,7 @@ export declare const ICON_MAP: {
|
|
|
206
206
|
readonly md: "more_vert";
|
|
207
207
|
};
|
|
208
208
|
readonly mute: {
|
|
209
|
-
readonly sf: "speaker.slash
|
|
209
|
+
readonly sf: "speaker.slash";
|
|
210
210
|
readonly md: "volume_off";
|
|
211
211
|
};
|
|
212
212
|
readonly next: {
|
|
@@ -290,11 +290,11 @@ export declare const ICON_MAP: {
|
|
|
290
290
|
readonly md: "share";
|
|
291
291
|
};
|
|
292
292
|
readonly stop: {
|
|
293
|
-
readonly sf: "hand.raised
|
|
293
|
+
readonly sf: "hand.raised";
|
|
294
294
|
readonly md: "front_hand";
|
|
295
295
|
};
|
|
296
296
|
readonly success: {
|
|
297
|
-
readonly sf: "checkmark.circle
|
|
297
|
+
readonly sf: "checkmark.circle";
|
|
298
298
|
readonly md: "check_circle";
|
|
299
299
|
};
|
|
300
300
|
readonly sync: {
|
|
@@ -326,7 +326,7 @@ export declare const ICON_MAP: {
|
|
|
326
326
|
readonly md: "visibility";
|
|
327
327
|
};
|
|
328
328
|
readonly volume: {
|
|
329
|
-
readonly sf: "speaker.wave.2
|
|
329
|
+
readonly sf: "speaker.wave.2";
|
|
330
330
|
readonly md: "volume_up";
|
|
331
331
|
};
|
|
332
332
|
readonly wallet: {
|
|
@@ -334,7 +334,7 @@ export declare const ICON_MAP: {
|
|
|
334
334
|
readonly md: "wallet";
|
|
335
335
|
};
|
|
336
336
|
readonly warning: {
|
|
337
|
-
readonly sf: "exclamationmark.triangle
|
|
337
|
+
readonly sf: "exclamationmark.triangle";
|
|
338
338
|
readonly md: "warning";
|
|
339
339
|
};
|
|
340
340
|
readonly wifi: {
|
package/dist/Display/icon-map.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
// Android and web draw from Material Symbols 400, an outline-only font. SF Symbols use the
|
|
2
|
+
// outline variant too, so an icon looks the same on both platforms. Only glyphs that are
|
|
3
|
+
// solid in Material as well (play, pause) or whose fill is the meaning against an empty pair
|
|
4
|
+
// (rating / rating-empty, bookmark / bookmark-empty) use `.fill`.
|
|
1
5
|
export const ICON_MAP = {
|
|
2
6
|
add: {
|
|
3
7
|
sf: "plus",
|
|
4
8
|
md: "add"
|
|
5
9
|
},
|
|
6
10
|
"add-circle": {
|
|
7
|
-
sf: "plus.circle
|
|
11
|
+
sf: "plus.circle",
|
|
8
12
|
md: "add_circle"
|
|
9
13
|
},
|
|
10
14
|
archive: {
|
|
@@ -84,7 +88,7 @@ export const ICON_MAP = {
|
|
|
84
88
|
md: "delete"
|
|
85
89
|
},
|
|
86
90
|
dismiss: {
|
|
87
|
-
sf: "xmark.circle
|
|
91
|
+
sf: "xmark.circle",
|
|
88
92
|
md: "cancel"
|
|
89
93
|
},
|
|
90
94
|
document: {
|
|
@@ -112,7 +116,7 @@ export const ICON_MAP = {
|
|
|
112
116
|
md: "inbox"
|
|
113
117
|
},
|
|
114
118
|
error: {
|
|
115
|
-
sf: "exclamationmark.circle
|
|
119
|
+
sf: "exclamationmark.circle",
|
|
116
120
|
md: "error"
|
|
117
121
|
},
|
|
118
122
|
expand: {
|
|
@@ -140,7 +144,7 @@ export const ICON_MAP = {
|
|
|
140
144
|
md: "visibility_off"
|
|
141
145
|
},
|
|
142
146
|
home: {
|
|
143
|
-
sf: "house
|
|
147
|
+
sf: "house",
|
|
144
148
|
md: "home"
|
|
145
149
|
},
|
|
146
150
|
image: {
|
|
@@ -152,7 +156,7 @@ export const ICON_MAP = {
|
|
|
152
156
|
md: "inbox"
|
|
153
157
|
},
|
|
154
158
|
info: {
|
|
155
|
-
sf: "info.circle
|
|
159
|
+
sf: "info.circle",
|
|
156
160
|
md: "info"
|
|
157
161
|
},
|
|
158
162
|
link: {
|
|
@@ -200,7 +204,7 @@ export const ICON_MAP = {
|
|
|
200
204
|
md: "more_vert"
|
|
201
205
|
},
|
|
202
206
|
mute: {
|
|
203
|
-
sf: "speaker.slash
|
|
207
|
+
sf: "speaker.slash",
|
|
204
208
|
md: "volume_off"
|
|
205
209
|
},
|
|
206
210
|
next: {
|
|
@@ -284,11 +288,11 @@ export const ICON_MAP = {
|
|
|
284
288
|
md: "share"
|
|
285
289
|
},
|
|
286
290
|
stop: {
|
|
287
|
-
sf: "hand.raised
|
|
291
|
+
sf: "hand.raised",
|
|
288
292
|
md: "front_hand"
|
|
289
293
|
},
|
|
290
294
|
success: {
|
|
291
|
-
sf: "checkmark.circle
|
|
295
|
+
sf: "checkmark.circle",
|
|
292
296
|
md: "check_circle"
|
|
293
297
|
},
|
|
294
298
|
sync: {
|
|
@@ -320,7 +324,7 @@ export const ICON_MAP = {
|
|
|
320
324
|
md: "visibility"
|
|
321
325
|
},
|
|
322
326
|
volume: {
|
|
323
|
-
sf: "speaker.wave.2
|
|
327
|
+
sf: "speaker.wave.2",
|
|
324
328
|
md: "volume_up"
|
|
325
329
|
},
|
|
326
330
|
wallet: {
|
|
@@ -328,7 +332,7 @@ export const ICON_MAP = {
|
|
|
328
332
|
md: "wallet"
|
|
329
333
|
},
|
|
330
334
|
warning: {
|
|
331
|
-
sf: "exclamationmark.triangle
|
|
335
|
+
sf: "exclamationmark.triangle",
|
|
332
336
|
md: "warning"
|
|
333
337
|
},
|
|
334
338
|
wifi: {
|
package/dist/Display/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ import CountRecords from "./Display.CountRecords.js";
|
|
|
8
8
|
import DataTable from "./Display.DataTable.js";
|
|
9
9
|
import Date from "./Display.Date.js";
|
|
10
10
|
import Divider from "./Display.Divider.js";
|
|
11
|
+
import DocumentPreview from "./Display.DocumentPreview.js";
|
|
12
|
+
import DocumentViewer from "./Display.DocumentViewer.js";
|
|
11
13
|
import ExpoImage from "./Display.ExpoImage.js";
|
|
12
14
|
import GradientSurface from "./Display.GradientSurface.js";
|
|
13
15
|
import IconBadge from "./Display.IconBadge.js";
|
|
@@ -70,6 +72,8 @@ export declare const Display: {
|
|
|
70
72
|
Tag: typeof Tag;
|
|
71
73
|
Image: typeof DisplayImage;
|
|
72
74
|
ExpoImage: typeof ExpoImage;
|
|
75
|
+
DocumentPreview: typeof DocumentPreview;
|
|
76
|
+
DocumentViewer: typeof DocumentViewer;
|
|
73
77
|
MediaCard: typeof MediaCard;
|
|
74
78
|
MediaEmbed: typeof MediaEmbed;
|
|
75
79
|
Story: typeof Story;
|
|
@@ -109,13 +113,17 @@ export { type BadgeProps, BadgeVariants };
|
|
|
109
113
|
export type { AmountSummaryRootProps, AmountSummaryRowProps, AmountSummaryTotalProps, } from "./Display.AmountSummary.js";
|
|
110
114
|
export type { CarouselControlsProps, CarouselProps, } from "./Display.Carousel.js";
|
|
111
115
|
export type { CircleButtonProps } from "./Display.CircleButton.js";
|
|
116
|
+
export type { DocumentPreviewProps } from "./Display.DocumentPreview.js";
|
|
117
|
+
export type { DocumentViewerProps } from "./Display.DocumentViewer.js";
|
|
112
118
|
export type { IconProps } from "./Display.Icon.js";
|
|
113
119
|
export type { ListGroupProps } from "./Display.ListGroup.js";
|
|
114
120
|
export type { ListItemProps } from "./Display.ListItem.js";
|
|
115
121
|
export type { MenuCardProps } from "./Display.MenuCard.js";
|
|
116
122
|
export type { MenuGridItem } from "./Display.MenuGrid.js";
|
|
117
123
|
export { defineStatuses, resolveStatus, type StatusBadgeProps, type StatusDefinition, type StatusMap, type StatusTone, } from "./Display.StatusBadge.js";
|
|
124
|
+
export { type DocumentRenderer, type DocumentRenderRequest, type DocumentRenderResult, registerDocumentRenderers, resetDocumentRenderers, } from "./document-renderer.js";
|
|
118
125
|
export { ICON_FONT_FAMILY, ICON_FONTS } from "./icon-font.js";
|
|
119
126
|
export { type BuiltInIconName, ICON_NAMES, type IconName, } from "./icon-map.js";
|
|
120
127
|
export { type CustomIconRegistry, type CustomIconRenderer, registerIcons, } from "./icon-registry.js";
|
|
128
|
+
export { documentBase64, documentMimeType, type DocumentPage, type DocumentSource, } from "../utils/document.js";
|
|
121
129
|
export default Display;
|
package/dist/Display/index.js
CHANGED
|
@@ -12,6 +12,8 @@ import CountRecords from "./Display.CountRecords.js";
|
|
|
12
12
|
import DataTable from "./Display.DataTable.js";
|
|
13
13
|
import Date from "./Display.Date.js";
|
|
14
14
|
import Divider from "./Display.Divider.js";
|
|
15
|
+
import DocumentPreview from "./Display.DocumentPreview.js";
|
|
16
|
+
import DocumentViewer from "./Display.DocumentViewer.js";
|
|
15
17
|
import ExpoImage from "./Display.ExpoImage.js";
|
|
16
18
|
import GradientSurface from "./Display.GradientSurface.js";
|
|
17
19
|
import Icon from "./Display.Icon.js";
|
|
@@ -58,6 +60,8 @@ export const Display = {
|
|
|
58
60
|
Tag,
|
|
59
61
|
Image: DisplayImage,
|
|
60
62
|
ExpoImage,
|
|
63
|
+
DocumentPreview,
|
|
64
|
+
DocumentViewer,
|
|
61
65
|
MediaCard,
|
|
62
66
|
MediaEmbed,
|
|
63
67
|
Story,
|
|
@@ -95,7 +99,9 @@ export const Display = {
|
|
|
95
99
|
};
|
|
96
100
|
export { BadgeVariants };
|
|
97
101
|
export { defineStatuses, resolveStatus } from "./Display.StatusBadge.js";
|
|
102
|
+
export { registerDocumentRenderers, resetDocumentRenderers } from "./document-renderer.js";
|
|
98
103
|
export { ICON_FONT_FAMILY, ICON_FONTS } from "./icon-font.js";
|
|
99
104
|
export { ICON_NAMES } from "./icon-map.js";
|
|
100
105
|
export { registerIcons } from "./icon-registry.js";
|
|
106
|
+
export { documentBase64, documentMimeType } from "../utils/document.js";
|
|
101
107
|
export default Display;
|
|
@@ -49,6 +49,7 @@ function withClockTime(base, time) {
|
|
|
49
49
|
next.setHours(time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds());
|
|
50
50
|
return next;
|
|
51
51
|
}
|
|
52
|
+
const CALENDAR_SNAP_POINTS = ["90%"];
|
|
52
53
|
function DatePicker(t0) {
|
|
53
54
|
const $ = _c(107);
|
|
54
55
|
const {
|
|
@@ -464,6 +465,7 @@ function DatePicker(t0) {
|
|
|
464
465
|
title: "Aplicar"
|
|
465
466
|
}),
|
|
466
467
|
onClose: close,
|
|
468
|
+
snapPoints: mode === "date" ? CALENDAR_SNAP_POINTS : undefined,
|
|
467
469
|
title: label ?? (mode === "time" ? "Seleccionar hora" : "Seleccionar fecha"),
|
|
468
470
|
visible: open,
|
|
469
471
|
children: [open ? _jsx(View, {
|
|
@@ -21,5 +21,5 @@ export interface FormInputProps extends Omit<TextInputProps, "secureTextEntry">
|
|
|
21
21
|
* | `card` | bodySmall, semibold | card surface, rounded-lg, ≥48 | 8 |
|
|
22
22
|
* | `outline` | bodyLarge | border only, rounded, 44 high | 16 |
|
|
23
23
|
*/
|
|
24
|
-
declare function FormInput({ label, error, tooltip, look, secure, style, multiline, numberOfLines, onFocus, onBlur, className, ref, ...props }: FormInputProps): import("react").JSX.Element;
|
|
24
|
+
declare function FormInput({ label, error, tooltip, look, secure, style, multiline, numberOfLines, onFocus, onBlur, onSubmitEditing, submitBehavior, className, ref, ...props }: FormInputProps): import("react").JSX.Element;
|
|
25
25
|
export default FormInput;
|