@revolist/ui 4.0.4-rc → 4.0.5-rc
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/OWNERSHIP.md +1 -1
- package/README.md +16 -0
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/badge.view-D30pMUfi.js +14 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/{calendar-xpZ0v3xf.js → calendar-DsXIhybL.js} +19 -19
- package/_chunks/chart-frame-CuZABXVI.js +141 -0
- package/_chunks/check-BwI7iCAm.js +4 -0
- package/_chunks/choice-chips-BhP8MZjs.js +126 -0
- package/_chunks/{color-palette-D8vyPfld.js → color-palette-DMJUChWC.js} +20 -22
- package/_chunks/color-picker-B4TQvxxB.js +143 -0
- package/_chunks/{component-C_T2VN5u.js → component-qKctqdzk.js} +281 -265
- package/_chunks/configurator-actions-C19O1rda.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/{control-AHKXD5Eu.js → control-BkWukVt9.js} +13 -13
- package/_chunks/{controls-DsNi8V8I.js → controls-BLQnWEd7.js} +147 -155
- package/_chunks/{date-control-DrVFX13g.js → date-control-Cgw5PwlZ.js} +1 -1
- package/_chunks/date-time-B8rK5gpC.js +784 -0
- package/_chunks/{dialog.parts-CKGkC5zP.js → dialog.parts-BSbvnEwX.js} +21 -21
- package/_chunks/{duration-CL68Em0o.js → duration-DwFXonEV.js} +1 -4
- package/_chunks/editor-popup-BaaxL89T.js +81 -0
- package/_chunks/field-configurator-1eQP0tKy.js +223 -0
- package/_chunks/icon-toolbar-xbqa0hu9.js +128 -0
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/mount-D1i5DLRn.js +266 -0
- package/_chunks/native-control-DO0d1kgx.js +636 -0
- package/_chunks/{number-input-BKwA5FnM.js → number-input-s9ddPwX6.js} +7 -7
- package/_chunks/{picker-h1P5RUgp.js → picker-AY05b41W.js} +2 -2
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
- package/_chunks/{popup-CT2uD3go.js → popup-UXGCiv3n.js} +97 -97
- package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-BEs_QFZC.js} +1 -1
- package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-A49l172e.js} +1 -1
- package/_chunks/request-trail-DCOfa5zw.js +753 -0
- package/_chunks/rich-text-xfMWadGi.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
- package/_chunks/tooltip-D4xkio5G.js +54 -0
- package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
- package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
- package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
- package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
- package/ai/_chat.scss +28 -3
- package/ai/_style.scss +55 -2
- package/ai/chat.d.ts +3 -1
- package/ai/components.d.ts +13 -2
- package/ai/index.d.ts +1 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +17 -1
- package/ai/results/_style.scss +80 -0
- package/ai/results/index.d.ts +11 -0
- package/ai/results/metrics.d.ts +5 -0
- package/ai/results/table.d.ts +5 -0
- package/ai/results/text.d.ts +5 -0
- package/ai/results/types.d.ts +29 -0
- package/ai/transcript.d.ts +2 -0
- package/ai/translations.d.ts +1 -1
- package/assignee/index.js +2 -2
- package/avatar/index.js +32 -31
- package/badge.view.d.ts +8 -0
- package/brush-range/component.js +28 -27
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +16 -16
- package/calendar/_calendar.scss +2 -2
- package/calendar/calendar.js +1 -1
- package/calendar/index.js +2 -2
- package/choice-chips/index.d.ts +3 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +6 -1
- package/configurator-actions.d.ts +67 -0
- package/configurator-actions.js +1 -0
- package/configurator-aggregation-list.d.ts +14 -0
- package/configurator-aggregation-list.js +61 -0
- package/configurator-drop-zone.d.ts +38 -0
- package/configurator-drop-zone.js +64 -0
- package/configurator-field-icon.d.ts +10 -0
- package/configurator-field-icon.js +1 -0
- package/configurator-focus.d.ts +4 -0
- package/configurator-focus.js +39 -0
- package/configurator-sections.d.ts +42 -0
- package/configurator-sections.js +71 -0
- package/control-presentation.js +24 -19
- package/controls.d.ts +1 -2
- package/controls.js +4 -3
- package/core/editor-popup.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popup-ownership.d.ts +2 -0
- package/core/title-tooltip.d.ts +2 -0
- package/core/tooltip-session.d.ts +29 -0
- package/core/tooltip-surface.d.ts +13 -0
- package/core/tooltip-text.d.ts +6 -0
- package/core/tooltip.d.ts +35 -0
- package/core/top-layer-popup.d.ts +4 -0
- package/core/top-layer-popup.js +1 -23
- package/date-time/index.js +1 -1
- package/date-time/style.scss +50 -7
- package/date-time/time-selection.d.ts +3 -1
- package/dialog/dialog.dom.js +8 -8
- package/dialog/dialog.parts.js +1 -1
- package/distribution-chart/_distribution-chart.scss +1 -57
- package/distribution-chart/area-chart.js +1 -1
- package/distribution-chart/bar-chart.js +1 -1
- package/distribution-chart/line-chart.js +1 -1
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.js +2 -1
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +1 -1
- package/field-configurator.d.ts +19 -0
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/filter/filters/slider/_slider.scss +0 -17
- package/filter/filters/slider/control.js +2 -0
- package/filter/filters/slider/runtime.js +49 -22
- package/filter/filters/slider/single.js +1 -1
- package/filter-badge.js +1 -1
- package/filter-controls.js +1 -1
- package/form-controls/index.js +6 -6
- package/form-controls/presentation.js +12 -12
- package/formatting/control-tooltip.d.ts +2 -27
- package/formatting/index.js +22 -21
- package/formatting/styles.scss +2 -47
- package/framework.js +215 -208
- package/history-controls.js +27 -1
- package/icon-toolbar.d.ts +58 -0
- package/icon-toolbar.js +1 -0
- package/masked-input/index.js +1 -1
- package/native-control.d.ts +1 -2
- package/native-control.js +1 -1
- package/native-styles.css +1 -1
- package/native.js +45 -42
- package/number-input/index.js +1 -1
- package/package.json +36 -1
- package/pagination.js +1 -1
- package/pdf-viewer/index.js +1 -1
- package/pickers.d.ts +5 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +7 -0
- package/preact.js +68 -61
- package/rating-choice.js +1 -1
- package/react.d.ts +5 -0
- package/react.js +67 -65
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-popup.js +1 -1
- package/resource-picker/resource-picker.js +4 -4
- package/rich-text/engine.d.ts +1 -0
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +4 -0
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +2 -0
- package/rich-text/style.scss +165 -70
- package/rich-text/syntax.d.ts +5 -0
- package/rich-text/translations.d.ts +2 -0
- package/select.d.ts +3 -1
- package/select.js +1 -1
- package/status-feedback/exit-snapshot.js +4 -4
- package/status-feedback/popover.js +4 -4
- package/styles/_compositions.scss +3 -3
- package/styles/_field-configurator.scss +146 -0
- package/styles/_fields-grid.scss +35 -0
- package/styles/_primitives.scss +25 -18
- package/styles/configurator-actions.scss +141 -0
- package/styles/legacy-pagination.css +19 -2
- package/styles.css +1 -1
- package/surfaces.d.ts +3 -0
- package/surfaces.js +34 -131
- package/surfaces.view.d.ts +4 -34
- package/svelte.js +1 -1
- package/switch/index.js +15 -14
- package/time-grid.js +37 -36
- package/timeline-track/index.js +2 -2
- package/ui.css +1 -1
- package/vue.d.ts +24 -9
- package/vue.js +118 -116
- package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
- package/_chunks/choice-chips-CHQTUdLs.js +0 -110
- package/_chunks/color-picker-CudqPYZo.js +0 -138
- package/_chunks/control-tooltip-uscKfAnV.js +0 -100
- package/_chunks/date-time-qIhp5vaX.js +0 -768
- package/_chunks/editor-popup-WDdtVDNA.js +0 -81
- package/_chunks/history-controls-B3u3INEK.js +0 -27
- package/_chunks/mount-DQ1cpppK.js +0 -257
- package/_chunks/native-control-C_yok8_-.js +0 -605
- package/_chunks/request-trail-DSlFix6i.js +0 -618
- package/_chunks/rich-text-CH7gIqOS.js +0 -636
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import { c as e, i as t } from "./preact.module-BBM36DnO.js";
|
|
2
2
|
import { i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
|
|
3
3
|
import { t as o } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
4
|
+
import { createControlId as s } from "../core/control-id.js";
|
|
5
|
+
import { n as c, t as l } from "./popover-controller-D-AvKQ7B.js";
|
|
6
|
+
import { SvgIcon as u } from "../icons/icon.js";
|
|
7
|
+
import { l as d, n as f } from "./native-control-DO0d1kgx.js";
|
|
8
|
+
import { n as p } from "./popup-UXGCiv3n.js";
|
|
9
|
+
import { t as m } from "./chevron-down-GbplLa6s.js";
|
|
10
|
+
import { E as h, F as g, L as _, P as v, b as y, g as b, l as x, p as S, t as C } from "./controls-BLQnWEd7.js";
|
|
11
|
+
import { t as w } from "./chevron-left-D0nc4Z5S.js";
|
|
12
|
+
import { t as T } from "./chevron-right-sxHQMSkq.js";
|
|
13
|
+
import { t as E } from "./xmark-DD_PBvZI.js";
|
|
14
|
+
import { t as D } from "./tooltip-text-BXsUEmBH.js";
|
|
15
|
+
import { DialogController as O, attachMenuKeyboard as k } from "../surfaces.js";
|
|
16
|
+
import { t as A } from "./rotate-right-Iha5ScJ1.js";
|
|
17
|
+
import { t as j } from "./chevron-up-BLuNMPDn.js";
|
|
18
|
+
import { avatarTemplate as M } from "../avatar/index.js";
|
|
19
|
+
import { renderProgressBar as ee } from "../progress/bar.js";
|
|
20
|
+
import { t as te } from "./plus-CbGRkIGl.js";
|
|
21
|
+
import { t as ne } from "./minus-BOAR3A1C.js";
|
|
22
|
+
import { SearchInput as re } from "../search-input/index.js";
|
|
19
23
|
import { s as N } from "./iso-B0YHBK7m.js";
|
|
20
24
|
import { f as P, h as F, o as I } from "./model-mPO2tG2f.js";
|
|
21
|
-
import { n as L, t as R } from "./date-control-
|
|
22
|
-
import { t as z } from "./calendar-
|
|
23
|
-
import { t as B } from "./
|
|
25
|
+
import { n as L, t as R } from "./date-control-Cgw5PwlZ.js";
|
|
26
|
+
import { t as z } from "./calendar-DsXIhybL.js";
|
|
27
|
+
import { t as B } from "./magnifying-glass-CvrTDSkB.js";
|
|
28
|
+
import { t as V } from "./controller-hRBm_Lfz.js";
|
|
24
29
|
//#region src/pickers.tsx
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */ o(
|
|
30
|
+
function H(e) {
|
|
31
|
+
return /* @__PURE__ */ o(d, {
|
|
27
32
|
...e,
|
|
28
33
|
className: `rv-combobox ${e.className ?? ""}`,
|
|
29
34
|
config: {
|
|
@@ -33,8 +38,8 @@ function V(e) {
|
|
|
33
38
|
}
|
|
34
39
|
});
|
|
35
40
|
}
|
|
36
|
-
function
|
|
37
|
-
return /* @__PURE__ */ o(
|
|
41
|
+
function U(e) {
|
|
42
|
+
return /* @__PURE__ */ o(d, {
|
|
38
43
|
...e,
|
|
39
44
|
className: `rv-multi-select ${e.className ?? ""}`,
|
|
40
45
|
config: {
|
|
@@ -43,50 +48,61 @@ function H(e) {
|
|
|
43
48
|
}
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
|
-
function
|
|
47
|
-
return j(e, t);
|
|
48
|
-
}
|
|
49
|
-
function te(t) {
|
|
51
|
+
function ie(t) {
|
|
50
52
|
return M(e, t);
|
|
51
53
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
function ae(t) {
|
|
55
|
+
return ee(e, t);
|
|
56
|
+
}
|
|
57
|
+
function W({ open: e, anchor: t, appendTo: n, closeOnOutside: r, closeOnEscape: s, onClose: c, children: u, label: d, className: f = "", role: p = "dialog" }) {
|
|
58
|
+
let m = a(null), h = a(c);
|
|
59
|
+
h.current = c;
|
|
60
|
+
let g = a({
|
|
61
|
+
closeOnOutside: r,
|
|
62
|
+
closeOnEscape: s
|
|
63
|
+
}).current;
|
|
64
|
+
return g.closeOnOutside = r, g.closeOnEscape = s, i(() => {
|
|
65
|
+
if (!e || !t || !m.current) return;
|
|
66
|
+
let r = m.current, i = new l(), a = !0;
|
|
57
67
|
i.open({
|
|
58
68
|
anchor: t,
|
|
59
69
|
appendTo: n,
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
get closeOnOutside() {
|
|
71
|
+
return g.closeOnOutside;
|
|
72
|
+
},
|
|
73
|
+
get closeOnEscape() {
|
|
74
|
+
return g.closeOnEscape;
|
|
75
|
+
},
|
|
76
|
+
content: m.current,
|
|
77
|
+
display: p === "menu" ? "grid" : void 0,
|
|
62
78
|
onClose: () => {
|
|
63
|
-
a &&
|
|
79
|
+
a && h.current();
|
|
64
80
|
}
|
|
65
81
|
});
|
|
66
|
-
let o =
|
|
82
|
+
let o = p === "menu" ? k(r, () => i.close(), g) : void 0;
|
|
67
83
|
return () => {
|
|
68
84
|
a = !1, o?.(), i.destroy(), r.hidden = !0;
|
|
69
85
|
};
|
|
70
86
|
}, [
|
|
71
87
|
e,
|
|
72
88
|
t,
|
|
73
|
-
|
|
89
|
+
p,
|
|
74
90
|
n
|
|
75
91
|
]), /* @__PURE__ */ o("div", {
|
|
76
|
-
ref:
|
|
77
|
-
class: `rv-popover ${
|
|
78
|
-
role:
|
|
79
|
-
"aria-label":
|
|
92
|
+
ref: m,
|
|
93
|
+
class: `rv-popover ${p === "menu" ? "rv-menu " : ""}${f}`,
|
|
94
|
+
role: p,
|
|
95
|
+
"aria-label": d,
|
|
80
96
|
hidden: !e,
|
|
81
|
-
children: e ?
|
|
97
|
+
children: e ? u : null
|
|
82
98
|
});
|
|
83
99
|
}
|
|
84
|
-
function
|
|
100
|
+
function oe({ text: e, children: t }) {
|
|
85
101
|
let n = a(null);
|
|
86
102
|
return i(() => {
|
|
87
103
|
let t = n.current;
|
|
88
104
|
if (!t) return;
|
|
89
|
-
let r = new
|
|
105
|
+
let r = new c(), i, a = () => {
|
|
90
106
|
let n = t.querySelector("button, input, a[href], [tabindex]") ?? t;
|
|
91
107
|
n !== i && (r.bind(n, e), i = n);
|
|
92
108
|
};
|
|
@@ -106,7 +122,7 @@ function ne({ text: e, children: t }) {
|
|
|
106
122
|
children: t
|
|
107
123
|
});
|
|
108
124
|
}
|
|
109
|
-
function G({ open: e, title: r, closeLabel: s, onClose: c, children: l, footer:
|
|
125
|
+
function G({ open: e, title: r, closeLabel: s, onClose: c, children: l, footer: u, draggable: d, returnFocus: f }) {
|
|
110
126
|
let m = a(null), h = a(c);
|
|
111
127
|
h.current = c;
|
|
112
128
|
let [g, _] = n();
|
|
@@ -115,11 +131,11 @@ function G({ open: e, title: r, closeLabel: s, onClose: c, children: l, footer:
|
|
|
115
131
|
_(void 0);
|
|
116
132
|
return;
|
|
117
133
|
}
|
|
118
|
-
let t = new
|
|
134
|
+
let t = new O(m.current.ownerDocument), n = !0, i = t.open({
|
|
119
135
|
title: r,
|
|
120
136
|
closeLabel: s,
|
|
121
|
-
draggable:
|
|
122
|
-
returnFocus:
|
|
137
|
+
draggable: d,
|
|
138
|
+
returnFocus: f,
|
|
123
139
|
surfaceClass: "rv-ui-dialog",
|
|
124
140
|
onClose: () => {
|
|
125
141
|
_(void 0), n && h.current();
|
|
@@ -135,25 +151,25 @@ function G({ open: e, title: r, closeLabel: s, onClose: c, children: l, footer:
|
|
|
135
151
|
e,
|
|
136
152
|
r,
|
|
137
153
|
s,
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
d,
|
|
155
|
+
f
|
|
140
156
|
]), /* @__PURE__ */ o(t, { children: [
|
|
141
157
|
/* @__PURE__ */ o("span", {
|
|
142
158
|
ref: m,
|
|
143
159
|
hidden: !0
|
|
144
160
|
}),
|
|
145
|
-
g &&
|
|
146
|
-
g &&
|
|
161
|
+
g && p(l, g.body),
|
|
162
|
+
g && u && p(u, g.footer)
|
|
147
163
|
] });
|
|
148
164
|
}
|
|
149
|
-
function
|
|
165
|
+
function se({ onConfirm: e, confirmLabel: n, cancelLabel: r, pending: i, ...a }) {
|
|
150
166
|
return /* @__PURE__ */ o(G, {
|
|
151
167
|
...a,
|
|
152
|
-
footer: /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(
|
|
168
|
+
footer: /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(C, {
|
|
153
169
|
disabled: i,
|
|
154
170
|
onClick: a.onClose,
|
|
155
171
|
children: r
|
|
156
|
-
}), /* @__PURE__ */ o(
|
|
172
|
+
}), /* @__PURE__ */ o(C, {
|
|
157
173
|
variant: "primary",
|
|
158
174
|
disabled: i,
|
|
159
175
|
onClick: e,
|
|
@@ -161,55 +177,55 @@ function re({ onConfirm: e, confirmLabel: n, cancelLabel: r, pending: i, ...a })
|
|
|
161
177
|
})] })
|
|
162
178
|
});
|
|
163
179
|
}
|
|
164
|
-
function
|
|
165
|
-
let [
|
|
180
|
+
function ce({ value: e, onChange: t, label: r, openLabel: a, disabled: c, readOnly: l, ...d }) {
|
|
181
|
+
let [f, p] = n(!1), [m, h] = n(null), [g, _] = n(e && N(e) ? e : F()), [v, y] = n(P(g, d.calendarSystem)), [b] = n(() => s("rv-date-picker"));
|
|
166
182
|
return i(() => {
|
|
167
|
-
(c || l) &&
|
|
183
|
+
(c || l) && p(!1);
|
|
168
184
|
}, [c, l]), /* @__PURE__ */ o("div", {
|
|
169
185
|
class: "rv-date-picker",
|
|
170
186
|
children: [
|
|
171
187
|
/* @__PURE__ */ o(R, {
|
|
172
188
|
label: r,
|
|
173
189
|
value: e ?? "",
|
|
174
|
-
minDate:
|
|
175
|
-
maxDate:
|
|
190
|
+
minDate: d.minDate,
|
|
191
|
+
maxDate: d.maxDate,
|
|
176
192
|
disabled: c,
|
|
177
193
|
readOnly: l,
|
|
178
194
|
onChange: (e) => {
|
|
179
|
-
typeof e != "string" || c || l || e && (
|
|
195
|
+
typeof e != "string" || c || l || e && (d.minDate && e < d.minDate || d.maxDate && e > d.maxDate) || (!e || N(e)) && t(e || void 0);
|
|
180
196
|
}
|
|
181
197
|
}),
|
|
182
|
-
/* @__PURE__ */ o(
|
|
183
|
-
ref:
|
|
198
|
+
/* @__PURE__ */ o(C, {
|
|
199
|
+
ref: h,
|
|
184
200
|
"aria-label": a,
|
|
185
201
|
"aria-haspopup": "dialog",
|
|
186
|
-
"aria-expanded":
|
|
202
|
+
"aria-expanded": f,
|
|
187
203
|
"aria-controls": b,
|
|
188
204
|
disabled: c || l,
|
|
189
205
|
onClick: () => {
|
|
190
|
-
e && N(e) && (
|
|
206
|
+
e && N(e) && (_(e), y(P(e, d.calendarSystem))), p(!f);
|
|
191
207
|
},
|
|
192
|
-
children: /* @__PURE__ */ o(
|
|
208
|
+
children: /* @__PURE__ */ o(u, { svg: L })
|
|
193
209
|
}),
|
|
194
210
|
/* @__PURE__ */ o(W, {
|
|
195
|
-
open:
|
|
196
|
-
anchor:
|
|
197
|
-
onClose: () =>
|
|
211
|
+
open: f,
|
|
212
|
+
anchor: m,
|
|
213
|
+
onClose: () => p(!1),
|
|
198
214
|
label: r,
|
|
199
215
|
children: /* @__PURE__ */ o("div", {
|
|
200
216
|
id: b,
|
|
201
217
|
children: /* @__PURE__ */ o(z, {
|
|
202
|
-
...
|
|
203
|
-
month:
|
|
204
|
-
focusedDate:
|
|
218
|
+
...d,
|
|
219
|
+
month: v,
|
|
220
|
+
focusedDate: g,
|
|
205
221
|
selection: e ? {
|
|
206
222
|
from: e,
|
|
207
223
|
to: e
|
|
208
224
|
} : void 0,
|
|
209
225
|
onMonthChange: y,
|
|
210
|
-
onFocusedDateChange:
|
|
226
|
+
onFocusedDateChange: _,
|
|
211
227
|
onSelect: (e) => {
|
|
212
|
-
t(e),
|
|
228
|
+
t(e), p(!1), m?.focus();
|
|
213
229
|
}
|
|
214
230
|
})
|
|
215
231
|
})
|
|
@@ -217,13 +233,13 @@ function ie({ value: e, onChange: t, label: r, openLabel: a, disabled: c, readOn
|
|
|
217
233
|
]
|
|
218
234
|
});
|
|
219
235
|
}
|
|
220
|
-
function
|
|
221
|
-
let [
|
|
236
|
+
function le({ value: e, onChange: t, label: r, fromLabel: a, toLabel: c, openLabel: l, disabled: d, readOnly: f, ...p }) {
|
|
237
|
+
let [m, h] = n(!1), [g, _] = n(null), [v, y] = n(), [b, x] = n(e?.from ?? F()), [S, w] = n(P(b, p.calendarSystem)), [T] = n(() => s("rv-date-picker"));
|
|
222
238
|
i(() => {
|
|
223
|
-
(
|
|
224
|
-
}, [
|
|
239
|
+
(d || f) && (h(!1), y(void 0));
|
|
240
|
+
}, [d, f]);
|
|
225
241
|
let E = (n, r) => {
|
|
226
|
-
if (
|
|
242
|
+
if (d || f || !N(r) || p.minDate && r < p.minDate || p.maxDate && r > p.maxDate) return;
|
|
227
243
|
let i = r;
|
|
228
244
|
t(I(n === "from" ? i : e?.from ?? i, n === "to" ? i : e?.to ?? i));
|
|
229
245
|
};
|
|
@@ -235,10 +251,10 @@ function ae({ value: e, onChange: t, label: r, fromLabel: a, toLabel: c, openLab
|
|
|
235
251
|
/* @__PURE__ */ o(R, {
|
|
236
252
|
label: a,
|
|
237
253
|
value: e?.from ?? "",
|
|
238
|
-
disabled:
|
|
239
|
-
readOnly:
|
|
240
|
-
minDate:
|
|
241
|
-
maxDate:
|
|
254
|
+
disabled: d,
|
|
255
|
+
readOnly: f,
|
|
256
|
+
minDate: p.minDate,
|
|
257
|
+
maxDate: p.maxDate,
|
|
242
258
|
onChange: (e) => {
|
|
243
259
|
typeof e == "string" && E("from", e);
|
|
244
260
|
}
|
|
@@ -246,44 +262,44 @@ function ae({ value: e, onChange: t, label: r, fromLabel: a, toLabel: c, openLab
|
|
|
246
262
|
/* @__PURE__ */ o(R, {
|
|
247
263
|
label: c,
|
|
248
264
|
value: e?.to ?? "",
|
|
249
|
-
disabled:
|
|
250
|
-
readOnly:
|
|
251
|
-
minDate:
|
|
252
|
-
maxDate:
|
|
265
|
+
disabled: d,
|
|
266
|
+
readOnly: f,
|
|
267
|
+
minDate: p.minDate,
|
|
268
|
+
maxDate: p.maxDate,
|
|
253
269
|
onChange: (e) => {
|
|
254
270
|
typeof e == "string" && E("to", e);
|
|
255
271
|
}
|
|
256
272
|
}),
|
|
257
|
-
/* @__PURE__ */ o(
|
|
258
|
-
ref:
|
|
259
|
-
disabled:
|
|
273
|
+
/* @__PURE__ */ o(C, {
|
|
274
|
+
ref: _,
|
|
275
|
+
disabled: d || f,
|
|
260
276
|
"aria-label": l,
|
|
261
277
|
"aria-haspopup": "dialog",
|
|
262
|
-
"aria-expanded":
|
|
278
|
+
"aria-expanded": m,
|
|
263
279
|
"aria-controls": T,
|
|
264
280
|
onClick: () => {
|
|
265
|
-
y(void 0), e && (x(e.from), w(P(e.from,
|
|
281
|
+
y(void 0), e && (x(e.from), w(P(e.from, p.calendarSystem))), h(!m);
|
|
266
282
|
},
|
|
267
|
-
children: /* @__PURE__ */ o(
|
|
283
|
+
children: /* @__PURE__ */ o(u, { svg: L })
|
|
268
284
|
}),
|
|
269
285
|
/* @__PURE__ */ o(W, {
|
|
270
|
-
open:
|
|
271
|
-
anchor:
|
|
286
|
+
open: m,
|
|
287
|
+
anchor: g,
|
|
272
288
|
onClose: () => {
|
|
273
|
-
|
|
289
|
+
h(!1), y(void 0);
|
|
274
290
|
},
|
|
275
291
|
label: r,
|
|
276
292
|
children: /* @__PURE__ */ o("div", {
|
|
277
293
|
id: T,
|
|
278
294
|
children: /* @__PURE__ */ o(z, {
|
|
279
|
-
...
|
|
295
|
+
...p,
|
|
280
296
|
month: S,
|
|
281
297
|
focusedDate: b,
|
|
282
|
-
selection:
|
|
298
|
+
selection: v ? I(v, b) : e,
|
|
283
299
|
onMonthChange: w,
|
|
284
300
|
onFocusedDateChange: x,
|
|
285
301
|
onSelect: (e) => {
|
|
286
|
-
|
|
302
|
+
v ? (t(I(v, e)), y(void 0), h(!1), g?.focus()) : y(e);
|
|
287
303
|
}
|
|
288
304
|
})
|
|
289
305
|
})
|
|
@@ -362,28 +378,28 @@ function X(e, t) {
|
|
|
362
378
|
//#endregion
|
|
363
379
|
//#region src/pdf-viewer/icons.ts
|
|
364
380
|
var Z = {
|
|
365
|
-
previous:
|
|
366
|
-
next:
|
|
381
|
+
previous: w,
|
|
382
|
+
next: T,
|
|
367
383
|
document: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l80 0 0-112c0-35.3 28.7-64 64-64l176 0 0-165.5c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM240 380c-11 0-20 9-20 20l0 128c0 11 9 20 20 20s20-9 20-20l0-28 12 0c33.1 0 60-26.9 60-60s-26.9-60-60-60l-32 0zm32 80l-12 0 0-40 12 0c11 0 20 9 20 20s-9 20-20 20zm96-80c-11 0-20 9-20 20l0 128c0 11 9 20 20 20l32 0c28.7 0 52-23.3 52-52l0-64c0-28.7-23.3-52-52-52l-32 0zm20 128l0-88 12 0c6.6 0 12 5.4 12 12l0 64c0 6.6-5.4 12-12 12l-12 0zm88-108l0 128c0 11 9 20 20 20s20-9 20-20l0-44 28 0c11 0 20-9 20-20s-9-20-20-20l-28 0 0-24 28 0c11 0 20-9 20-20s-9-20-20-20l-48 0c-11 0-20 9-20 20z\"/></svg>",
|
|
368
384
|
open: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M56 225.6L32.4 296.2 32.4 96c0-35.3 28.7-64 64-64l138.7 0c13.8 0 27.3 4.5 38.4 12.8l38.4 28.8c5.5 4.2 12.3 6.4 19.2 6.4l117.3 0c35.3 0 64 28.7 64 64l0 16-365.4 0c-41.3 0-78 26.4-91.1 65.6zM477.8 448L99 448c-32.8 0-55.9-32.1-45.5-63.2l48-144C108 221.2 126.4 208 147 208l378.8 0c32.8 0 55.9 32.1 45.5 63.2l-48 144c-6.5 19.6-24.9 32.8-45.5 32.8z\"/></svg>",
|
|
369
|
-
search:
|
|
370
|
-
minus:
|
|
371
|
-
plus:
|
|
372
|
-
rotate:
|
|
385
|
+
search: B,
|
|
386
|
+
minus: ne,
|
|
387
|
+
plus: te,
|
|
388
|
+
rotate: A,
|
|
373
389
|
download: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 242.7 256 32zM64 320c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-46.9 0-56.6 56.6c-31.2 31.2-81.9 31.2-113.1 0L110.9 320 64 320zm304 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"/></svg>",
|
|
374
390
|
print: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M64 64C64 28.7 92.7 0 128 0L341.5 0c17 0 33.3 6.7 45.3 18.7l42.5 42.5c12 12 18.7 28.3 18.7 45.3l0 37.5-384 0 0-80zM0 256c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 96c0 17.7-14.3 32-32 32l-32 0 0 64c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64l0-64-32 0c-17.7 0-32-14.3-32-32l0-96zM128 416l0 32 256 0 0-96-256 0 0 64zM456 272a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"/></svg>",
|
|
375
|
-
close:
|
|
376
|
-
up:
|
|
377
|
-
down:
|
|
391
|
+
close: E,
|
|
392
|
+
up: j,
|
|
393
|
+
down: m,
|
|
378
394
|
more: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M64 144a56 56 0 1 1 0-112 56 56 0 1 1 0 112zm0 224c30.9 0 56 25.1 56 56s-25.1 56-56 56-56-25.1-56-56 25.1-56 56-56zm56-112c0 30.9-25.1 56-56 56s-56-25.1-56-56 25.1-56 56-56 56 25.1 56 56z\"/></svg>"
|
|
379
395
|
};
|
|
380
396
|
//#endregion
|
|
381
397
|
//#region src/pdf-viewer/toolbar.tsx
|
|
382
398
|
function Q(e) {
|
|
383
|
-
let { controller: r, state:
|
|
384
|
-
let t =
|
|
399
|
+
let { controller: r, state: s } = e, c = J(e.text), l = Y(e.config), p = s.status === "ready", m = (e) => l.buttons?.[e] !== !1, h = (e) => {
|
|
400
|
+
let t = l.buttons?.[e];
|
|
385
401
|
return t === !1 ? {} : t ?? {};
|
|
386
|
-
},
|
|
402
|
+
}, _ = (t) => X(e.config, t), [x, w] = n(!1), T = a(null), E = a(null), [D, O] = n(String(s.page || "")), k = Number.isFinite(l.zoomStep) && l.zoomStep > 1 ? l.zoomStep : 1.25, A = [...new Set((l.zoomLevels ?? [
|
|
387
403
|
"page-width",
|
|
388
404
|
"page-fit",
|
|
389
405
|
.5,
|
|
@@ -395,22 +411,22 @@ function Q(e) {
|
|
|
395
411
|
3,
|
|
396
412
|
5
|
|
397
413
|
]).filter((e) => e === "page-width" || e === "page-fit" || typeof e == "number" && Number.isFinite(e) && e >= .25 && e <= 5))];
|
|
398
|
-
A.includes(
|
|
399
|
-
O(String(
|
|
400
|
-
}, [
|
|
414
|
+
A.includes(s.zoom) || A.push(s.zoom), i(() => {
|
|
415
|
+
O(String(s.page || ""));
|
|
416
|
+
}, [s.page, r]), i(() => {
|
|
401
417
|
w(!1);
|
|
402
418
|
}, [
|
|
403
419
|
e.config,
|
|
404
|
-
|
|
420
|
+
p,
|
|
405
421
|
r
|
|
406
422
|
]), i(() => {
|
|
407
|
-
if (!
|
|
423
|
+
if (!x) return;
|
|
408
424
|
E.current?.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
|
|
409
425
|
let e = T.current, t = new ResizeObserver(() => {
|
|
410
426
|
e && !e.getClientRects().length && w(!1);
|
|
411
427
|
});
|
|
412
428
|
return e && t.observe(e), () => t.disconnect();
|
|
413
|
-
}, [
|
|
429
|
+
}, [x]);
|
|
414
430
|
let j = () => {
|
|
415
431
|
w(!1), T.current?.focus({ preventScroll: !0 });
|
|
416
432
|
}, M = () => {
|
|
@@ -424,88 +440,88 @@ function Q(e) {
|
|
|
424
440
|
"rotate",
|
|
425
441
|
"download",
|
|
426
442
|
"print"
|
|
427
|
-
].some(
|
|
428
|
-
label:
|
|
429
|
-
className: `rv-pdf-viewer__toolbar rv-toolbar--surface ${
|
|
443
|
+
].some(_) ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(v, {
|
|
444
|
+
label: c.toolbar,
|
|
445
|
+
className: `rv-pdf-viewer__toolbar rv-toolbar--surface ${l.className ?? ""}`,
|
|
430
446
|
children: [
|
|
431
|
-
|
|
447
|
+
_("open") && /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(C, {
|
|
432
448
|
variant: "ghost",
|
|
433
449
|
size: "compact",
|
|
434
|
-
...
|
|
435
|
-
title:
|
|
436
|
-
"aria-label":
|
|
450
|
+
...h("open"),
|
|
451
|
+
title: h("open").title ?? c.open,
|
|
452
|
+
"aria-label": c.open,
|
|
437
453
|
onClick: () => e.onOpen(),
|
|
438
|
-
children: [/* @__PURE__ */ o(
|
|
454
|
+
children: [/* @__PURE__ */ o(u, { svg: Z.open }), /* @__PURE__ */ o("span", {
|
|
439
455
|
class: "rv-pdf-viewer__open-label",
|
|
440
|
-
children:
|
|
456
|
+
children: c.open
|
|
441
457
|
})]
|
|
442
458
|
}) }),
|
|
443
|
-
|
|
444
|
-
label:
|
|
445
|
-
children: /* @__PURE__ */ o(
|
|
446
|
-
page:
|
|
447
|
-
pageCount:
|
|
459
|
+
_("navigation") && (l.boundaryButtons || m("previous") || m("next") || l.showPageInput !== !1 || l.showPageCount !== !1) && /* @__PURE__ */ o(g, {
|
|
460
|
+
label: c.page,
|
|
461
|
+
children: /* @__PURE__ */ o(y, {
|
|
462
|
+
page: s.page - 1,
|
|
463
|
+
pageCount: s.pageCount,
|
|
448
464
|
onChange: (e) => r.goToPage(e + 1),
|
|
449
|
-
label:
|
|
450
|
-
previousLabel:
|
|
451
|
-
nextLabel:
|
|
452
|
-
firstLabel:
|
|
453
|
-
lastLabel:
|
|
465
|
+
label: c.page,
|
|
466
|
+
previousLabel: c.previous,
|
|
467
|
+
nextLabel: c.next,
|
|
468
|
+
firstLabel: c.first,
|
|
469
|
+
lastLabel: c.last,
|
|
454
470
|
variant: "icons",
|
|
455
|
-
disabled: !
|
|
456
|
-
boundaryButtons:
|
|
471
|
+
disabled: !p,
|
|
472
|
+
boundaryButtons: l.boundaryButtons,
|
|
457
473
|
buttons: {
|
|
458
|
-
first:
|
|
459
|
-
previous:
|
|
460
|
-
next:
|
|
461
|
-
last:
|
|
474
|
+
first: l.buttons?.first,
|
|
475
|
+
previous: l.buttons?.previous,
|
|
476
|
+
next: l.buttons?.next,
|
|
477
|
+
last: l.buttons?.last
|
|
462
478
|
},
|
|
463
|
-
children: [
|
|
479
|
+
children: [l.showPageInput !== !1 && /* @__PURE__ */ o(f, {
|
|
464
480
|
class: "rv-pdf-viewer__page-input",
|
|
465
481
|
type: "number",
|
|
466
482
|
min: 1,
|
|
467
|
-
max:
|
|
468
|
-
disabled: !
|
|
469
|
-
"aria-label":
|
|
483
|
+
max: s.pageCount || 1,
|
|
484
|
+
disabled: !p,
|
|
485
|
+
"aria-label": c.page,
|
|
470
486
|
value: D,
|
|
471
487
|
onInput: (e) => O(e.currentTarget.value),
|
|
472
488
|
onChange: M,
|
|
473
489
|
onKeyDown: (e) => {
|
|
474
|
-
e.key === "Enter" && (e.preventDefault(), M()), e.key === "Escape" && (e.preventDefault(), O(String(
|
|
490
|
+
e.key === "Enter" && (e.preventDefault(), M()), e.key === "Escape" && (e.preventDefault(), O(String(s.page)));
|
|
475
491
|
}
|
|
476
|
-
}),
|
|
492
|
+
}), l.showPageCount !== !1 && /* @__PURE__ */ o("span", {
|
|
477
493
|
class: "rv-pdf-viewer__page-count",
|
|
478
|
-
children: q(
|
|
479
|
-
of:
|
|
480
|
-
pages:
|
|
494
|
+
children: q(c.pageCount, {
|
|
495
|
+
of: c.of,
|
|
496
|
+
pages: s.pageCount
|
|
481
497
|
})
|
|
482
498
|
})]
|
|
483
499
|
})
|
|
484
500
|
}),
|
|
485
|
-
|
|
486
|
-
label:
|
|
501
|
+
_("zoom") && (m("zoomOut") || m("zoomIn") || l.showZoomSelect !== !1) && /* @__PURE__ */ o(g, {
|
|
502
|
+
label: c.zoom,
|
|
487
503
|
children: [
|
|
488
|
-
|
|
489
|
-
...
|
|
490
|
-
label:
|
|
504
|
+
m("zoomOut") && /* @__PURE__ */ o(S, {
|
|
505
|
+
...h("zoomOut"),
|
|
506
|
+
label: c.zoomOut,
|
|
491
507
|
icon: Z.minus,
|
|
492
508
|
size: "compact",
|
|
493
|
-
disabled: !
|
|
494
|
-
onClick: () => r.setZoom(
|
|
509
|
+
disabled: !p || s.scale <= .25 || !!h("zoomOut").disabled,
|
|
510
|
+
onClick: () => r.setZoom(s.scale / k)
|
|
495
511
|
}),
|
|
496
|
-
|
|
512
|
+
l.showZoomSelect !== !1 && /* @__PURE__ */ o("div", {
|
|
497
513
|
class: "rv-pdf-viewer__zoom-select",
|
|
498
|
-
children: /* @__PURE__ */ o(
|
|
514
|
+
children: /* @__PURE__ */ o(d, {
|
|
499
515
|
className: "rv-select",
|
|
500
516
|
config: {
|
|
501
|
-
ariaLabel:
|
|
517
|
+
ariaLabel: c.zoom,
|
|
502
518
|
portalTarget: e.appendTo
|
|
503
519
|
},
|
|
504
|
-
disabled: !
|
|
505
|
-
value: String(
|
|
520
|
+
disabled: !p,
|
|
521
|
+
value: String(s.zoom),
|
|
506
522
|
source: A.map((e) => ({
|
|
507
523
|
value: String(e),
|
|
508
|
-
label: e === "page-width" ?
|
|
524
|
+
label: e === "page-width" ? c.fitWidth : e === "page-fit" ? c.fitPage : q(c.zoomPercentage, { percent: Math.round(e * 100) })
|
|
509
525
|
})),
|
|
510
526
|
onChange: (e) => {
|
|
511
527
|
let t = String(e);
|
|
@@ -513,111 +529,111 @@ function Q(e) {
|
|
|
513
529
|
}
|
|
514
530
|
})
|
|
515
531
|
}),
|
|
516
|
-
|
|
517
|
-
...
|
|
518
|
-
label:
|
|
532
|
+
m("zoomIn") && /* @__PURE__ */ o(S, {
|
|
533
|
+
...h("zoomIn"),
|
|
534
|
+
label: c.zoomIn,
|
|
519
535
|
icon: Z.plus,
|
|
520
536
|
size: "compact",
|
|
521
|
-
disabled: !
|
|
522
|
-
onClick: () => r.setZoom(
|
|
537
|
+
disabled: !p || s.scale >= 5 || !!h("zoomIn").disabled,
|
|
538
|
+
onClick: () => r.setZoom(s.scale * k)
|
|
523
539
|
})
|
|
524
540
|
]
|
|
525
541
|
}),
|
|
526
|
-
|
|
527
|
-
...
|
|
528
|
-
label:
|
|
542
|
+
_("search") && /* @__PURE__ */ o(g, { children: m("search") && /* @__PURE__ */ o(S, {
|
|
543
|
+
...h("search"),
|
|
544
|
+
label: c.search,
|
|
529
545
|
icon: Z.search,
|
|
530
546
|
size: "compact",
|
|
531
|
-
disabled: !
|
|
547
|
+
disabled: !p || !!h("search").disabled,
|
|
532
548
|
"aria-expanded": e.searchOpen,
|
|
533
549
|
"aria-controls": e.searchId,
|
|
534
550
|
"aria-keyshortcuts": "Control+f Meta+f",
|
|
535
551
|
onClick: (t) => e.onToggleSearch(t.currentTarget)
|
|
536
552
|
}) }),
|
|
537
|
-
(
|
|
553
|
+
(_("rotate") || _("download") || _("print")) && /* @__PURE__ */ o(g, {
|
|
538
554
|
className: "rv-pdf-viewer__actions rv-pdf-viewer__desktop-actions",
|
|
539
555
|
children: [
|
|
540
|
-
|
|
541
|
-
...
|
|
542
|
-
label:
|
|
556
|
+
_("rotate") && /* @__PURE__ */ o(S, {
|
|
557
|
+
...h("rotate"),
|
|
558
|
+
label: c.rotate,
|
|
543
559
|
icon: Z.rotate,
|
|
544
560
|
size: "compact",
|
|
545
|
-
disabled: !
|
|
561
|
+
disabled: !p || !!h("rotate").disabled,
|
|
546
562
|
onClick: () => r.rotate()
|
|
547
563
|
}),
|
|
548
|
-
|
|
549
|
-
...
|
|
550
|
-
label:
|
|
564
|
+
_("download") && /* @__PURE__ */ o(S, {
|
|
565
|
+
...h("download"),
|
|
566
|
+
label: c.download,
|
|
551
567
|
icon: Z.download,
|
|
552
568
|
size: "compact",
|
|
553
|
-
disabled: !
|
|
569
|
+
disabled: !p || !!h("download").disabled,
|
|
554
570
|
onClick: () => void r.download()
|
|
555
571
|
}),
|
|
556
|
-
|
|
557
|
-
...
|
|
558
|
-
label:
|
|
572
|
+
_("print") && /* @__PURE__ */ o(S, {
|
|
573
|
+
...h("print"),
|
|
574
|
+
label: c.print,
|
|
559
575
|
icon: Z.print,
|
|
560
576
|
size: "compact",
|
|
561
|
-
disabled: !
|
|
562
|
-
busy:
|
|
577
|
+
disabled: !p || s.printing || !!h("print").disabled,
|
|
578
|
+
busy: s.printing,
|
|
563
579
|
onClick: () => void r.print()
|
|
564
580
|
})
|
|
565
581
|
]
|
|
566
582
|
}),
|
|
567
|
-
(
|
|
583
|
+
(_("rotate") || _("download") || _("print")) && /* @__PURE__ */ o(g, {
|
|
568
584
|
className: "rv-pdf-viewer__more",
|
|
569
|
-
children: /* @__PURE__ */ o(
|
|
585
|
+
children: /* @__PURE__ */ o(C, {
|
|
570
586
|
ref: T,
|
|
571
587
|
variant: "ghost",
|
|
572
588
|
size: "compact",
|
|
573
589
|
className: "rv-btn-icon",
|
|
574
|
-
title:
|
|
575
|
-
"aria-label":
|
|
590
|
+
title: c.more,
|
|
591
|
+
"aria-label": c.more,
|
|
576
592
|
"aria-haspopup": "menu",
|
|
577
|
-
"aria-expanded":
|
|
578
|
-
disabled: !
|
|
579
|
-
onClick: () => w(!
|
|
593
|
+
"aria-expanded": x,
|
|
594
|
+
disabled: !p,
|
|
595
|
+
onClick: () => w(!x),
|
|
580
596
|
onKeyDown: (e) => {
|
|
581
597
|
e.key === "ArrowDown" && (e.preventDefault(), w(!0));
|
|
582
598
|
},
|
|
583
|
-
children: /* @__PURE__ */ o(
|
|
599
|
+
children: /* @__PURE__ */ o(u, { svg: Z.more })
|
|
584
600
|
})
|
|
585
601
|
})
|
|
586
602
|
]
|
|
587
603
|
}), /* @__PURE__ */ o(W, {
|
|
588
|
-
open:
|
|
604
|
+
open: x,
|
|
589
605
|
anchor: T.current,
|
|
590
606
|
appendTo: e.appendTo,
|
|
591
607
|
onClose: () => w(!1),
|
|
592
608
|
role: "menu",
|
|
593
|
-
label:
|
|
609
|
+
label: c.more,
|
|
594
610
|
children: /* @__PURE__ */ o("div", {
|
|
595
611
|
ref: E,
|
|
596
612
|
class: "rv-pdf-viewer__menu",
|
|
597
613
|
children: [
|
|
598
|
-
|
|
599
|
-
className:
|
|
600
|
-
disabled: !!
|
|
614
|
+
_("rotate") && /* @__PURE__ */ o(b, {
|
|
615
|
+
className: h("rotate").className,
|
|
616
|
+
disabled: !!h("rotate").disabled,
|
|
601
617
|
onClick: () => {
|
|
602
618
|
r.rotate(), j();
|
|
603
619
|
},
|
|
604
|
-
children: [/* @__PURE__ */ o(
|
|
620
|
+
children: [/* @__PURE__ */ o(u, { svg: Z.rotate }), c.rotate]
|
|
605
621
|
}),
|
|
606
|
-
|
|
607
|
-
className:
|
|
608
|
-
disabled: !!
|
|
622
|
+
_("download") && /* @__PURE__ */ o(b, {
|
|
623
|
+
className: h("download").className,
|
|
624
|
+
disabled: !!h("download").disabled,
|
|
609
625
|
onClick: () => {
|
|
610
626
|
r.download(), j();
|
|
611
627
|
},
|
|
612
|
-
children: [/* @__PURE__ */ o(
|
|
628
|
+
children: [/* @__PURE__ */ o(u, { svg: Z.download }), c.download]
|
|
613
629
|
}),
|
|
614
|
-
|
|
615
|
-
className:
|
|
616
|
-
disabled:
|
|
630
|
+
_("print") && /* @__PURE__ */ o(b, {
|
|
631
|
+
className: h("print").className,
|
|
632
|
+
disabled: s.printing || !!h("print").disabled,
|
|
617
633
|
onClick: () => {
|
|
618
634
|
r.print(), j();
|
|
619
635
|
},
|
|
620
|
-
children: [/* @__PURE__ */ o(
|
|
636
|
+
children: [/* @__PURE__ */ o(u, { svg: Z.print }), c.print]
|
|
621
637
|
})
|
|
622
638
|
]
|
|
623
639
|
})
|
|
@@ -625,10 +641,10 @@ function Q(e) {
|
|
|
625
641
|
}
|
|
626
642
|
//#endregion
|
|
627
643
|
//#region src/pdf-viewer/search-bar.tsx
|
|
628
|
-
function
|
|
629
|
-
let
|
|
644
|
+
function ue({ id: e, controller: t, state: n, text: r, onClose: a, inputRef: s }) {
|
|
645
|
+
let c = n.status === "ready";
|
|
630
646
|
return i(() => {
|
|
631
|
-
|
|
647
|
+
s.current?.focus();
|
|
632
648
|
}, []), /* @__PURE__ */ o("div", {
|
|
633
649
|
id: e,
|
|
634
650
|
class: "rv-pdf-viewer__search",
|
|
@@ -637,13 +653,13 @@ function oe({ id: e, controller: t, state: n, text: r, onClose: a, inputRef: c }
|
|
|
637
653
|
onKeyDown: (e) => {
|
|
638
654
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), a());
|
|
639
655
|
},
|
|
640
|
-
children: [/* @__PURE__ */ o(
|
|
641
|
-
icon: /* @__PURE__ */ o(
|
|
642
|
-
inputRef:
|
|
656
|
+
children: [/* @__PURE__ */ o(re, {
|
|
657
|
+
icon: /* @__PURE__ */ o(u, { svg: Z.search }),
|
|
658
|
+
inputRef: s,
|
|
643
659
|
"aria-label": r.search,
|
|
644
660
|
placeholder: r.search,
|
|
645
661
|
value: n.query,
|
|
646
|
-
disabled: !
|
|
662
|
+
disabled: !c,
|
|
647
663
|
onValueChange: (e) => t.search(e),
|
|
648
664
|
onKeyDown: (e) => {
|
|
649
665
|
e.key === "Enter" && (e.preventDefault(), t.search(n.query, e.shiftKey, !0));
|
|
@@ -660,21 +676,21 @@ function oe({ id: e, controller: t, state: n, text: r, onClose: a, inputRef: c }
|
|
|
660
676
|
matches: r.matches
|
|
661
677
|
}) : r.noMatches : ""
|
|
662
678
|
}),
|
|
663
|
-
/* @__PURE__ */ o(
|
|
679
|
+
/* @__PURE__ */ o(S, {
|
|
664
680
|
label: r.previousMatch,
|
|
665
681
|
icon: Z.up,
|
|
666
682
|
size: "compact",
|
|
667
|
-
disabled: !
|
|
683
|
+
disabled: !c || !n.matchCount,
|
|
668
684
|
onClick: () => t.search(n.query, !0, !0)
|
|
669
685
|
}),
|
|
670
|
-
/* @__PURE__ */ o(
|
|
686
|
+
/* @__PURE__ */ o(S, {
|
|
671
687
|
label: r.nextMatch,
|
|
672
688
|
icon: Z.down,
|
|
673
689
|
size: "compact",
|
|
674
|
-
disabled: !
|
|
690
|
+
disabled: !c || !n.matchCount,
|
|
675
691
|
onClick: () => t.search(n.query, !1, !0)
|
|
676
692
|
}),
|
|
677
|
-
/* @__PURE__ */ o(
|
|
693
|
+
/* @__PURE__ */ o(S, {
|
|
678
694
|
label: r.closeSearch,
|
|
679
695
|
icon: Z.close,
|
|
680
696
|
size: "compact",
|
|
@@ -686,15 +702,15 @@ function oe({ id: e, controller: t, state: n, text: r, onClose: a, inputRef: c }
|
|
|
686
702
|
}
|
|
687
703
|
//#endregion
|
|
688
704
|
//#region src/pdf-viewer/header.tsx
|
|
689
|
-
function
|
|
705
|
+
function de({ state: e, text: n, onCancelPrint: r, showDetails: i = !0 }) {
|
|
690
706
|
let a = e.status === "ready";
|
|
691
707
|
return /* @__PURE__ */ o("header", {
|
|
692
708
|
class: "rv-pdf-viewer__header",
|
|
693
709
|
children: [
|
|
694
|
-
i && /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(
|
|
710
|
+
i && /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(u, {
|
|
695
711
|
svg: Z.document,
|
|
696
712
|
className: "rv-svg-icon rv-pdf-viewer__document-icon"
|
|
697
|
-
}), /* @__PURE__ */ o(
|
|
713
|
+
}), /* @__PURE__ */ o(D, {
|
|
698
714
|
class: "rv-pdf-viewer__filename",
|
|
699
715
|
title: e.fileName,
|
|
700
716
|
children: e.fileName
|
|
@@ -708,7 +724,7 @@ function se({ state: e, text: n, onCancelPrint: r, showDetails: i = !0 }) {
|
|
|
708
724
|
pages: e.pageCount
|
|
709
725
|
}) : ""
|
|
710
726
|
}),
|
|
711
|
-
e.printing && /* @__PURE__ */ o(
|
|
727
|
+
e.printing && /* @__PURE__ */ o(C, {
|
|
712
728
|
variant: "ghost",
|
|
713
729
|
size: "compact",
|
|
714
730
|
onClick: () => r(),
|
|
@@ -719,24 +735,24 @@ function se({ state: e, text: n, onCancelPrint: r, showDetails: i = !0 }) {
|
|
|
719
735
|
}
|
|
720
736
|
//#endregion
|
|
721
737
|
//#region src/pdf-viewer/status.tsx
|
|
722
|
-
function
|
|
723
|
-
return e.status === "loading" ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(
|
|
738
|
+
function fe({ state: e, text: n, controller: r, canOpen: i, onOpen: a }) {
|
|
739
|
+
return e.status === "loading" ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(h, { label: n.loading }), /* @__PURE__ */ o("span", { children: n.loading })] }) : e.status === "error" ? /* @__PURE__ */ o(_, {
|
|
724
740
|
tone: "danger",
|
|
725
741
|
title: n.error,
|
|
726
742
|
description: n.errorDescription,
|
|
727
|
-
actions: /* @__PURE__ */ o(t, { children: [r.canRetry && /* @__PURE__ */ o(
|
|
743
|
+
actions: /* @__PURE__ */ o(t, { children: [r.canRetry && /* @__PURE__ */ o(C, {
|
|
728
744
|
size: "compact",
|
|
729
745
|
onClick: () => void r.retry(),
|
|
730
746
|
children: n.retry
|
|
731
|
-
}), i && /* @__PURE__ */ o(
|
|
747
|
+
}), i && /* @__PURE__ */ o(C, {
|
|
732
748
|
size: "compact",
|
|
733
749
|
onClick: () => a(),
|
|
734
750
|
children: n.open
|
|
735
751
|
})] })
|
|
736
|
-
}) : /* @__PURE__ */ o(
|
|
752
|
+
}) : /* @__PURE__ */ o(x, {
|
|
737
753
|
title: n.empty,
|
|
738
754
|
description: n.emptyHint,
|
|
739
|
-
children: i && /* @__PURE__ */ o(
|
|
755
|
+
children: i && /* @__PURE__ */ o(C, {
|
|
740
756
|
variant: "primary",
|
|
741
757
|
onClick: () => a(),
|
|
742
758
|
children: n.open
|
|
@@ -745,8 +761,8 @@ function ce({ state: e, text: n, controller: r, canOpen: i, onOpen: a }) {
|
|
|
745
761
|
}
|
|
746
762
|
//#endregion
|
|
747
763
|
//#region src/pdf-viewer/component.tsx
|
|
748
|
-
function
|
|
749
|
-
let t = r(() => new
|
|
764
|
+
function pe(e) {
|
|
765
|
+
let t = r(() => new V(e), [
|
|
750
766
|
e.workerSrc,
|
|
751
767
|
e.documentOptions,
|
|
752
768
|
e.initialPage,
|
|
@@ -759,13 +775,13 @@ function le(e) {
|
|
|
759
775
|
});
|
|
760
776
|
}
|
|
761
777
|
function $(e) {
|
|
762
|
-
let { controller: t } = e, [r,
|
|
763
|
-
let t =
|
|
778
|
+
let { controller: t } = e, [r, c] = n(t.snapshot), [l, u] = n(!1), [d] = n(() => s("rv-pdf-search")), p = a(null), m = a(null), h = a(null), g = a(null), v = a(null), y = J(e.text), b = r.status === "ready", x = Y(e.toolbar).buttons, S = (e) => {
|
|
779
|
+
let t = x?.[e];
|
|
764
780
|
return t !== !1 && !t?.disabled;
|
|
765
|
-
},
|
|
766
|
-
t.setCallbacks(e), t.setPrintTitle(
|
|
767
|
-
let n = t.subscribe(
|
|
768
|
-
return t.attach(
|
|
781
|
+
}, C = X(e.toolbar, "search") && S("search"), w = X(e.toolbar, "open") && S("open");
|
|
782
|
+
t.setCallbacks(e), t.setPrintTitle(y.printDocument), i(() => {
|
|
783
|
+
let n = t.subscribe(c);
|
|
784
|
+
return t.attach(h.current).catch(() => {}), e.onReady?.(t), () => {
|
|
769
785
|
n(), t.destroy();
|
|
770
786
|
};
|
|
771
787
|
}, [t]), i(() => {
|
|
@@ -777,87 +793,87 @@ function $(e) {
|
|
|
777
793
|
]);
|
|
778
794
|
let T = () => {
|
|
779
795
|
t.clearSearch(), u(!1);
|
|
780
|
-
let e =
|
|
781
|
-
e?.isConnected && !e.hasAttribute("disabled") ? e.focus({ preventScroll: !0 }) :
|
|
796
|
+
let e = p.current;
|
|
797
|
+
e?.isConnected && !e.hasAttribute("disabled") ? e.focus({ preventScroll: !0 }) : h.current?.focus({ preventScroll: !0 });
|
|
782
798
|
}, E = (e) => {
|
|
783
|
-
|
|
799
|
+
l || (p.current = e), u(!0), v.current?.focus();
|
|
784
800
|
};
|
|
785
801
|
i(() => {
|
|
786
|
-
|
|
787
|
-
}, [
|
|
802
|
+
C || (t.clearSearch(), u(!1), l && h.current?.focus({ preventScroll: !0 }));
|
|
803
|
+
}, [C, t]);
|
|
788
804
|
let D = {
|
|
789
805
|
controller: t,
|
|
790
806
|
state: r,
|
|
791
|
-
text:
|
|
807
|
+
text: y,
|
|
792
808
|
config: e.toolbar,
|
|
793
|
-
searchOpen:
|
|
809
|
+
searchOpen: l,
|
|
794
810
|
searchId: d,
|
|
795
|
-
appendTo:
|
|
811
|
+
appendTo: m.current ?? void 0,
|
|
796
812
|
onOpen: () => g.current?.click(),
|
|
797
|
-
onToggleSearch: (e) =>
|
|
813
|
+
onToggleSearch: (e) => l ? T() : E(e)
|
|
798
814
|
};
|
|
799
815
|
return /* @__PURE__ */ o("section", {
|
|
800
|
-
ref:
|
|
816
|
+
ref: m,
|
|
801
817
|
class: `rv-pdf-viewer ${e.className ?? ""}`,
|
|
802
818
|
style: { height: e.height ?? 640 },
|
|
803
|
-
"aria-label":
|
|
819
|
+
"aria-label": y.viewer,
|
|
804
820
|
onKeyDown: (e) => {
|
|
805
|
-
(e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f" &&
|
|
821
|
+
(e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f" && b && C && (e.preventDefault(), E(e.target));
|
|
806
822
|
},
|
|
807
823
|
children: [
|
|
808
|
-
(e.showHeader !== !1 || r.printing) && /* @__PURE__ */ o(
|
|
824
|
+
(e.showHeader !== !1 || r.printing) && /* @__PURE__ */ o(de, {
|
|
809
825
|
showDetails: e.showHeader !== !1,
|
|
810
826
|
state: r,
|
|
811
|
-
text:
|
|
827
|
+
text: y,
|
|
812
828
|
onCancelPrint: () => t.cancelPrint()
|
|
813
829
|
}),
|
|
814
830
|
e.toolbar !== !1 && (e.renderToolbar ? e.renderToolbar(t, r, D) : /* @__PURE__ */ o(Q, { ...D })),
|
|
815
|
-
/* @__PURE__ */ o(
|
|
831
|
+
/* @__PURE__ */ o(f, {
|
|
816
832
|
ref: g,
|
|
817
833
|
type: "file",
|
|
818
834
|
accept: "application/pdf,.pdf",
|
|
819
835
|
hidden: !0,
|
|
820
|
-
"aria-label":
|
|
836
|
+
"aria-label": y.open,
|
|
821
837
|
onChange: (e) => {
|
|
822
838
|
let n = e.currentTarget.files?.[0];
|
|
823
839
|
e.currentTarget.value = "", n && t.load(n);
|
|
824
840
|
}
|
|
825
841
|
}),
|
|
826
|
-
|
|
827
|
-
inputRef:
|
|
842
|
+
l && C && /* @__PURE__ */ o(ue, {
|
|
843
|
+
inputRef: v,
|
|
828
844
|
id: d,
|
|
829
845
|
controller: t,
|
|
830
846
|
state: r,
|
|
831
|
-
text:
|
|
847
|
+
text: y,
|
|
832
848
|
onClose: T
|
|
833
849
|
}),
|
|
834
850
|
/* @__PURE__ */ o("div", {
|
|
835
851
|
class: "rv-pdf-viewer__body",
|
|
836
852
|
"aria-busy": r.status === "loading",
|
|
837
853
|
children: [/* @__PURE__ */ o("div", {
|
|
838
|
-
ref:
|
|
854
|
+
ref: h,
|
|
839
855
|
class: "rv-pdf-viewer__viewport",
|
|
840
856
|
tabIndex: 0,
|
|
841
857
|
role: "region",
|
|
842
|
-
"aria-label":
|
|
843
|
-
}), !
|
|
858
|
+
"aria-label": y.pages
|
|
859
|
+
}), !b && /* @__PURE__ */ o("div", {
|
|
844
860
|
class: "rv-pdf-viewer__status",
|
|
845
|
-
children: e.renderStatus ? e.renderStatus(r) : /* @__PURE__ */ o(
|
|
861
|
+
children: e.renderStatus ? e.renderStatus(r) : /* @__PURE__ */ o(fe, {
|
|
846
862
|
state: r,
|
|
847
|
-
text:
|
|
863
|
+
text: y,
|
|
848
864
|
controller: t,
|
|
849
865
|
canOpen: w,
|
|
850
866
|
onOpen: D.onOpen
|
|
851
867
|
})
|
|
852
868
|
})]
|
|
853
869
|
}),
|
|
854
|
-
|
|
870
|
+
b && r.error && /* @__PURE__ */ o(_, {
|
|
855
871
|
className: "rv-pdf-viewer__error",
|
|
856
872
|
tone: "danger",
|
|
857
|
-
description:
|
|
873
|
+
description: y.operationError
|
|
858
874
|
})
|
|
859
875
|
]
|
|
860
876
|
});
|
|
861
877
|
}
|
|
862
878
|
//#endregion
|
|
863
|
-
export {
|
|
879
|
+
export { ie as a, ce as c, U as d, W as f, K as i, le as l, oe as m, $ as n, H as o, ae as p, Q as r, se as s, pe as t, G as u };
|