@pdf-viewer/react 0.4.0-beta.1 → 0.4.0-beta.2
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/Container-cea98fc1.js +37 -0
- package/dist/RPLayout-608b83dd.js +2756 -0
- package/dist/components/RPController.js +16 -47
- package/dist/components/RPDocument.js +13 -4
- package/dist/components/RPDropFileZone.js +18 -17
- package/dist/components/RPViewer.js +12 -22
- package/dist/components/layout/Container.js +6 -26
- package/dist/components/layout/RPLayout.js +14 -57
- package/dist/components/layout/WrapperLayout.js +9 -8
- package/dist/components/layout/sidebar/RPSidebar.js +9 -32
- package/dist/components/layout/sidebar/RPSplitter.js +9 -7
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +7 -21
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +9 -23
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +2 -2
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +7 -19
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +8 -19
- package/dist/components/page/AnnotationLayer.js +9 -23
- package/dist/components/page/CanvasLayer.js +7 -22
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +8 -22
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +7 -22
- package/dist/components/ui/Checkbox.js +242 -130
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginateContext.js +3 -3
- package/dist/contexts/PrintContext.js +2 -2
- package/dist/contexts/RPDocumentContext.js +33 -25
- package/dist/contexts/SearchContext.js +3 -3
- package/dist/contexts/ThumbnailsContext.js +4 -4
- package/dist/{index-3459164c.js → index-8049287f.js} +982 -952
- package/dist/main.js +31 -32
- package/dist/types/components/layout/RPLayout.d.ts +1 -2
- package/dist/types/contexts/RPDocumentContext.d.ts +4 -2
- package/dist/types/main.d.ts +1 -0
- package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
- package/dist/types/utils/types.d.ts +9 -2
- package/dist/utils/hooks/useFileDownload.js +7 -22
- package/dist/utils/hooks/useLicense.js +15 -23
- package/dist/utils/hooks/useLoadPdf.js +27 -27
- package/dist/utils/hooks/usePaginate.js +8 -21
- package/dist/utils/hooks/usePrint.js +7 -22
- package/dist/utils/hooks/useScrollToPage.js +9 -21
- package/dist/utils/hooks/useSearch.js +9 -22
- package/dist/utils/hooks/useThumbnail.js +7 -22
- package/dist/utils/hooks/useVirtualReactWindow.js +9 -21
- package/package.json +1 -1
- package/dist/Container.module-cb7b45b9.js +0 -14
- package/dist/RPSplitter.module-13d612c4.js +0 -7
- package/dist/RPTheme.module-f756e5cd.js +0 -7
- package/dist/Thumbnails-06fa1aa5.js +0 -2657
- package/dist/WrapperLayout.module-147bc943.js +0 -6
- package/dist/index-743c36f0.js +0 -139
- /package/dist/assets/{RPTheme.css → RPDropFileZone.css} +0 -0
- /package/dist/assets/{Thumbnails.css → RPLayout.css} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as h, Fragment as $, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { u as A, c as B, a as K, b as z } from "../../index-743c36f0.js";
|
|
4
3
|
import "react-dom";
|
|
5
|
-
import { CheckIcon as
|
|
6
|
-
import '../../assets/Checkbox.css';function
|
|
4
|
+
import { CheckIcon as V } from "../icons/CheckIcon.js";
|
|
5
|
+
import '../../assets/Checkbox.css';function A(e, t) {
|
|
7
6
|
if (typeof e == "function")
|
|
8
7
|
return e(t);
|
|
9
8
|
e != null && (e.current = t);
|
|
@@ -12,41 +11,154 @@ function I(...e) {
|
|
|
12
11
|
return (t) => {
|
|
13
12
|
let n = !1;
|
|
14
13
|
const r = e.map((o) => {
|
|
15
|
-
const
|
|
16
|
-
return !n && typeof
|
|
14
|
+
const s = A(o, t);
|
|
15
|
+
return !n && typeof s == "function" && (n = !0), s;
|
|
17
16
|
});
|
|
18
17
|
if (n)
|
|
19
18
|
return () => {
|
|
20
19
|
for (let o = 0; o < r.length; o++) {
|
|
21
|
-
const
|
|
22
|
-
typeof
|
|
20
|
+
const s = r[o];
|
|
21
|
+
typeof s == "function" ? s() : A(e[o], null);
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
|
-
function
|
|
26
|
+
function _(...e) {
|
|
28
27
|
return i.useCallback(I(...e), e);
|
|
29
28
|
}
|
|
29
|
+
function q(e, t = []) {
|
|
30
|
+
let n = [];
|
|
31
|
+
function r(s, u) {
|
|
32
|
+
const c = i.createContext(u), a = n.length;
|
|
33
|
+
n = [...n, u];
|
|
34
|
+
const l = (d) => {
|
|
35
|
+
var y;
|
|
36
|
+
const { scope: f, children: m, ...b } = d, v = ((y = f == null ? void 0 : f[e]) == null ? void 0 : y[a]) || c, k = i.useMemo(() => b, Object.values(b));
|
|
37
|
+
return /* @__PURE__ */ h(v.Provider, { value: k, children: m });
|
|
38
|
+
};
|
|
39
|
+
l.displayName = s + "Provider";
|
|
40
|
+
function p(d, f) {
|
|
41
|
+
var v;
|
|
42
|
+
const m = ((v = f == null ? void 0 : f[e]) == null ? void 0 : v[a]) || c, b = i.useContext(m);
|
|
43
|
+
if (b)
|
|
44
|
+
return b;
|
|
45
|
+
if (u !== void 0)
|
|
46
|
+
return u;
|
|
47
|
+
throw new Error(`\`${d}\` must be used within \`${s}\``);
|
|
48
|
+
}
|
|
49
|
+
return [l, p];
|
|
50
|
+
}
|
|
51
|
+
const o = () => {
|
|
52
|
+
const s = n.map((u) => i.createContext(u));
|
|
53
|
+
return function(c) {
|
|
54
|
+
const a = (c == null ? void 0 : c[e]) || s;
|
|
55
|
+
return i.useMemo(
|
|
56
|
+
() => ({ [`__scope${e}`]: { ...c, [e]: a } }),
|
|
57
|
+
[c, a]
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
return o.scopeName = e, [r, K(o, ...t)];
|
|
62
|
+
}
|
|
63
|
+
function K(...e) {
|
|
64
|
+
const t = e[0];
|
|
65
|
+
if (e.length === 1)
|
|
66
|
+
return t;
|
|
67
|
+
const n = () => {
|
|
68
|
+
const r = e.map((o) => ({
|
|
69
|
+
useScope: o(),
|
|
70
|
+
scopeName: o.scopeName
|
|
71
|
+
}));
|
|
72
|
+
return function(s) {
|
|
73
|
+
const u = r.reduce((c, { useScope: a, scopeName: l }) => {
|
|
74
|
+
const d = a(s)[`__scope${l}`];
|
|
75
|
+
return { ...c, ...d };
|
|
76
|
+
}, {});
|
|
77
|
+
return i.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
return n.scopeName = t.scopeName, n;
|
|
81
|
+
}
|
|
30
82
|
function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
31
83
|
return function(o) {
|
|
32
84
|
if (e == null || e(o), n === !1 || !o.defaultPrevented)
|
|
33
85
|
return t == null ? void 0 : t(o);
|
|
34
86
|
};
|
|
35
87
|
}
|
|
36
|
-
function
|
|
88
|
+
function T(e) {
|
|
89
|
+
const t = i.useRef(e);
|
|
90
|
+
return i.useEffect(() => {
|
|
91
|
+
t.current = e;
|
|
92
|
+
}), i.useMemo(() => (...n) => {
|
|
93
|
+
var r;
|
|
94
|
+
return (r = t.current) == null ? void 0 : r.call(t, ...n);
|
|
95
|
+
}, []);
|
|
96
|
+
}
|
|
97
|
+
function X({
|
|
98
|
+
prop: e,
|
|
99
|
+
defaultProp: t,
|
|
100
|
+
onChange: n = () => {
|
|
101
|
+
}
|
|
102
|
+
}) {
|
|
103
|
+
const [r, o] = Z({ defaultProp: t, onChange: n }), s = e !== void 0, u = s ? e : r, c = T(n), a = i.useCallback(
|
|
104
|
+
(l) => {
|
|
105
|
+
if (s) {
|
|
106
|
+
const d = typeof l == "function" ? l(e) : l;
|
|
107
|
+
d !== e && c(d);
|
|
108
|
+
} else
|
|
109
|
+
o(l);
|
|
110
|
+
},
|
|
111
|
+
[s, e, o, c]
|
|
112
|
+
);
|
|
113
|
+
return [u, a];
|
|
114
|
+
}
|
|
115
|
+
function Z({
|
|
116
|
+
defaultProp: e,
|
|
117
|
+
onChange: t
|
|
118
|
+
}) {
|
|
119
|
+
const n = i.useState(e), [r] = n, o = i.useRef(r), s = T(t);
|
|
120
|
+
return i.useEffect(() => {
|
|
121
|
+
o.current !== r && (s(r), o.current = r);
|
|
122
|
+
}, [r, o, s]), n;
|
|
123
|
+
}
|
|
124
|
+
function G(e) {
|
|
37
125
|
const t = i.useRef({ value: e, previous: e });
|
|
38
126
|
return i.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
39
127
|
}
|
|
40
|
-
|
|
128
|
+
var R = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
|
|
129
|
+
};
|
|
130
|
+
function H(e) {
|
|
131
|
+
const [t, n] = i.useState(void 0);
|
|
132
|
+
return R(() => {
|
|
133
|
+
if (e) {
|
|
134
|
+
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
135
|
+
const r = new ResizeObserver((o) => {
|
|
136
|
+
if (!Array.isArray(o) || !o.length)
|
|
137
|
+
return;
|
|
138
|
+
const s = o[0];
|
|
139
|
+
let u, c;
|
|
140
|
+
if ("borderBoxSize" in s) {
|
|
141
|
+
const a = s.borderBoxSize, l = Array.isArray(a) ? a[0] : a;
|
|
142
|
+
u = l.inlineSize, c = l.blockSize;
|
|
143
|
+
} else
|
|
144
|
+
u = e.offsetWidth, c = e.offsetHeight;
|
|
145
|
+
n({ width: u, height: c });
|
|
146
|
+
});
|
|
147
|
+
return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
|
|
148
|
+
} else
|
|
149
|
+
n(void 0);
|
|
150
|
+
}, [e]), t;
|
|
151
|
+
}
|
|
152
|
+
function J(e, t) {
|
|
41
153
|
return i.useReducer((n, r) => t[n][r] ?? n, e);
|
|
42
154
|
}
|
|
43
|
-
var
|
|
44
|
-
const { present: t, children: n } = e, r =
|
|
45
|
-
return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref:
|
|
155
|
+
var D = (e) => {
|
|
156
|
+
const { present: t, children: n } = e, r = Q(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), s = _(r.ref, Y(o));
|
|
157
|
+
return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: s }) : null;
|
|
46
158
|
};
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
const [t, n] = i.useState(), r = i.useRef({}), o = i.useRef(e),
|
|
159
|
+
D.displayName = "Presence";
|
|
160
|
+
function Q(e) {
|
|
161
|
+
const [t, n] = i.useState(), r = i.useRef({}), o = i.useRef(e), s = i.useRef("none"), u = e ? "mounted" : "unmounted", [c, a] = J(u, {
|
|
50
162
|
mounted: {
|
|
51
163
|
UNMOUNT: "unmounted",
|
|
52
164
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -60,63 +172,63 @@ function G(e) {
|
|
|
60
172
|
}
|
|
61
173
|
});
|
|
62
174
|
return i.useEffect(() => {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
const
|
|
175
|
+
const l = g(r.current);
|
|
176
|
+
s.current = c === "mounted" ? l : "none";
|
|
177
|
+
}, [c]), R(() => {
|
|
178
|
+
const l = r.current, p = o.current;
|
|
67
179
|
if (p !== e) {
|
|
68
|
-
const
|
|
69
|
-
e ?
|
|
180
|
+
const f = s.current, m = g(l);
|
|
181
|
+
e ? a("MOUNT") : m === "none" || (l == null ? void 0 : l.display) === "none" ? a("UNMOUNT") : a(p && f !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
70
182
|
}
|
|
71
|
-
}, [e,
|
|
183
|
+
}, [e, a]), R(() => {
|
|
72
184
|
if (t) {
|
|
73
|
-
let
|
|
74
|
-
const p = t.ownerDocument.defaultView ?? window,
|
|
75
|
-
const
|
|
76
|
-
if (m.target === t &&
|
|
77
|
-
const
|
|
78
|
-
t.style.animationFillMode = "forwards",
|
|
79
|
-
t.style.animationFillMode === "forwards" && (t.style.animationFillMode =
|
|
185
|
+
let l;
|
|
186
|
+
const p = t.ownerDocument.defaultView ?? window, d = (m) => {
|
|
187
|
+
const v = g(r.current).includes(m.animationName);
|
|
188
|
+
if (m.target === t && v && (a("ANIMATION_END"), !o.current)) {
|
|
189
|
+
const k = t.style.animationFillMode;
|
|
190
|
+
t.style.animationFillMode = "forwards", l = p.setTimeout(() => {
|
|
191
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = k);
|
|
80
192
|
});
|
|
81
193
|
}
|
|
82
|
-
},
|
|
83
|
-
m.target === t && (
|
|
194
|
+
}, f = (m) => {
|
|
195
|
+
m.target === t && (s.current = g(r.current));
|
|
84
196
|
};
|
|
85
|
-
return t.addEventListener("animationstart",
|
|
86
|
-
p.clearTimeout(
|
|
197
|
+
return t.addEventListener("animationstart", f), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
|
|
198
|
+
p.clearTimeout(l), t.removeEventListener("animationstart", f), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
|
|
87
199
|
};
|
|
88
200
|
} else
|
|
89
|
-
|
|
90
|
-
}, [t,
|
|
91
|
-
isPresent: ["mounted", "unmountSuspended"].includes(
|
|
92
|
-
ref: i.useCallback((
|
|
93
|
-
|
|
201
|
+
a("ANIMATION_END");
|
|
202
|
+
}, [t, a]), {
|
|
203
|
+
isPresent: ["mounted", "unmountSuspended"].includes(c),
|
|
204
|
+
ref: i.useCallback((l) => {
|
|
205
|
+
l && (r.current = getComputedStyle(l)), n(l);
|
|
94
206
|
}, [])
|
|
95
207
|
};
|
|
96
208
|
}
|
|
97
|
-
function
|
|
209
|
+
function g(e) {
|
|
98
210
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
99
211
|
}
|
|
100
|
-
function
|
|
212
|
+
function Y(e) {
|
|
101
213
|
var r, o;
|
|
102
214
|
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
103
215
|
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
104
216
|
}
|
|
105
|
-
var
|
|
106
|
-
const { children: n, ...r } = e, o = i.Children.toArray(n),
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
return /* @__PURE__ */
|
|
217
|
+
var U = i.forwardRef((e, t) => {
|
|
218
|
+
const { children: n, ...r } = e, o = i.Children.toArray(n), s = o.find(te);
|
|
219
|
+
if (s) {
|
|
220
|
+
const u = s.props.children, c = o.map((a) => a === s ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : a);
|
|
221
|
+
return /* @__PURE__ */ h(E, { ...r, ref: t, children: i.isValidElement(u) ? i.cloneElement(u, void 0, c) : null });
|
|
110
222
|
}
|
|
111
|
-
return /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ h(E, { ...r, ref: t, children: n });
|
|
112
224
|
});
|
|
113
|
-
|
|
225
|
+
U.displayName = "Slot";
|
|
114
226
|
var E = i.forwardRef((e, t) => {
|
|
115
227
|
const { children: n, ...r } = e;
|
|
116
228
|
if (i.isValidElement(n)) {
|
|
117
|
-
const o =
|
|
229
|
+
const o = re(n);
|
|
118
230
|
return i.cloneElement(n, {
|
|
119
|
-
...
|
|
231
|
+
...ne(r, n.props),
|
|
120
232
|
// @ts-ignore
|
|
121
233
|
ref: t ? I(t, o) : o
|
|
122
234
|
});
|
|
@@ -124,26 +236,26 @@ var E = i.forwardRef((e, t) => {
|
|
|
124
236
|
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
125
237
|
});
|
|
126
238
|
E.displayName = "SlotClone";
|
|
127
|
-
var
|
|
128
|
-
function
|
|
129
|
-
return i.isValidElement(e) && e.type ===
|
|
239
|
+
var ee = ({ children: e }) => /* @__PURE__ */ h($, { children: e });
|
|
240
|
+
function te(e) {
|
|
241
|
+
return i.isValidElement(e) && e.type === ee;
|
|
130
242
|
}
|
|
131
|
-
function
|
|
243
|
+
function ne(e, t) {
|
|
132
244
|
const n = { ...t };
|
|
133
245
|
for (const r in t) {
|
|
134
|
-
const o = e[r],
|
|
135
|
-
/^on[A-Z]/.test(r) ? o &&
|
|
136
|
-
|
|
137
|
-
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...
|
|
246
|
+
const o = e[r], s = t[r];
|
|
247
|
+
/^on[A-Z]/.test(r) ? o && s ? n[r] = (...c) => {
|
|
248
|
+
s(...c), o(...c);
|
|
249
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...s } : r === "className" && (n[r] = [o, s].filter(Boolean).join(" "));
|
|
138
250
|
}
|
|
139
251
|
return { ...e, ...n };
|
|
140
252
|
}
|
|
141
|
-
function
|
|
253
|
+
function re(e) {
|
|
142
254
|
var r, o;
|
|
143
255
|
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
144
256
|
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
145
257
|
}
|
|
146
|
-
var
|
|
258
|
+
var oe = [
|
|
147
259
|
"a",
|
|
148
260
|
"button",
|
|
149
261
|
"div",
|
|
@@ -160,85 +272,85 @@ var te = [
|
|
|
160
272
|
"span",
|
|
161
273
|
"svg",
|
|
162
274
|
"ul"
|
|
163
|
-
],
|
|
275
|
+
], W = oe.reduce((e, t) => {
|
|
164
276
|
const n = i.forwardRef((r, o) => {
|
|
165
|
-
const { asChild:
|
|
166
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
277
|
+
const { asChild: s, ...u } = r, c = s ? U : t;
|
|
278
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ h(c, { ...u, ref: o });
|
|
167
279
|
});
|
|
168
280
|
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
169
|
-
}, {}), w = "Checkbox", [
|
|
281
|
+
}, {}), w = "Checkbox", [se, me] = q(w), [ie, ce] = se(w), z = i.forwardRef(
|
|
170
282
|
(e, t) => {
|
|
171
283
|
const {
|
|
172
284
|
__scopeCheckbox: n,
|
|
173
285
|
name: r,
|
|
174
286
|
checked: o,
|
|
175
|
-
defaultChecked:
|
|
176
|
-
required:
|
|
177
|
-
disabled:
|
|
178
|
-
value:
|
|
179
|
-
onCheckedChange:
|
|
287
|
+
defaultChecked: s,
|
|
288
|
+
required: u,
|
|
289
|
+
disabled: c,
|
|
290
|
+
value: a = "on",
|
|
291
|
+
onCheckedChange: l,
|
|
180
292
|
form: p,
|
|
181
|
-
...
|
|
182
|
-
} = e, [
|
|
293
|
+
...d
|
|
294
|
+
} = e, [f, m] = i.useState(null), b = _(t, (C) => m(C)), v = i.useRef(!1), k = f ? p || !!f.closest("form") : !0, [y = !1, S] = X({
|
|
183
295
|
prop: o,
|
|
184
|
-
defaultProp:
|
|
185
|
-
onChange:
|
|
186
|
-
}),
|
|
296
|
+
defaultProp: s,
|
|
297
|
+
onChange: l
|
|
298
|
+
}), F = i.useRef(y);
|
|
187
299
|
return i.useEffect(() => {
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
return
|
|
300
|
+
const C = f == null ? void 0 : f.form;
|
|
301
|
+
if (C) {
|
|
302
|
+
const x = () => S(F.current);
|
|
303
|
+
return C.addEventListener("reset", x), () => C.removeEventListener("reset", x);
|
|
192
304
|
}
|
|
193
|
-
}, [
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
|
|
305
|
+
}, [f, S]), /* @__PURE__ */ M(ie, { scope: n, state: y, disabled: c, children: [
|
|
306
|
+
/* @__PURE__ */ h(
|
|
307
|
+
W.button,
|
|
196
308
|
{
|
|
197
309
|
type: "button",
|
|
198
310
|
role: "checkbox",
|
|
199
|
-
"aria-checked":
|
|
200
|
-
"aria-required":
|
|
201
|
-
"data-state":
|
|
202
|
-
"data-disabled":
|
|
203
|
-
disabled:
|
|
204
|
-
value:
|
|
205
|
-
...
|
|
206
|
-
ref:
|
|
207
|
-
onKeyDown: O(e.onKeyDown, (
|
|
208
|
-
|
|
311
|
+
"aria-checked": N(y) ? "mixed" : y,
|
|
312
|
+
"aria-required": u,
|
|
313
|
+
"data-state": B(y),
|
|
314
|
+
"data-disabled": c ? "" : void 0,
|
|
315
|
+
disabled: c,
|
|
316
|
+
value: a,
|
|
317
|
+
...d,
|
|
318
|
+
ref: b,
|
|
319
|
+
onKeyDown: O(e.onKeyDown, (C) => {
|
|
320
|
+
C.key === "Enter" && C.preventDefault();
|
|
209
321
|
}),
|
|
210
|
-
onClick: O(e.onClick, (
|
|
211
|
-
|
|
322
|
+
onClick: O(e.onClick, (C) => {
|
|
323
|
+
S((x) => N(x) ? !0 : !x), k && (v.current = C.isPropagationStopped(), v.current || C.stopPropagation());
|
|
212
324
|
})
|
|
213
325
|
}
|
|
214
326
|
),
|
|
215
|
-
|
|
216
|
-
|
|
327
|
+
k && /* @__PURE__ */ h(
|
|
328
|
+
ue,
|
|
217
329
|
{
|
|
218
|
-
control:
|
|
219
|
-
bubbles: !
|
|
330
|
+
control: f,
|
|
331
|
+
bubbles: !v.current,
|
|
220
332
|
name: r,
|
|
221
|
-
value:
|
|
222
|
-
checked:
|
|
223
|
-
required:
|
|
224
|
-
disabled:
|
|
333
|
+
value: a,
|
|
334
|
+
checked: y,
|
|
335
|
+
required: u,
|
|
336
|
+
disabled: c,
|
|
225
337
|
form: p,
|
|
226
338
|
style: { transform: "translateX(-100%)" },
|
|
227
|
-
defaultChecked:
|
|
339
|
+
defaultChecked: N(s) ? !1 : s
|
|
228
340
|
}
|
|
229
341
|
)
|
|
230
342
|
] });
|
|
231
343
|
}
|
|
232
344
|
);
|
|
233
|
-
|
|
345
|
+
z.displayName = w;
|
|
234
346
|
var L = "CheckboxIndicator", j = i.forwardRef(
|
|
235
347
|
(e, t) => {
|
|
236
|
-
const { __scopeCheckbox: n, forceMount: r, ...o } = e,
|
|
237
|
-
return /* @__PURE__ */
|
|
238
|
-
|
|
348
|
+
const { __scopeCheckbox: n, forceMount: r, ...o } = e, s = ce(L, n);
|
|
349
|
+
return /* @__PURE__ */ h(D, { present: r || N(s.state) || s.state === !0, children: /* @__PURE__ */ h(
|
|
350
|
+
W.span,
|
|
239
351
|
{
|
|
240
|
-
"data-state":
|
|
241
|
-
"data-disabled":
|
|
352
|
+
"data-state": B(s.state),
|
|
353
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
242
354
|
...o,
|
|
243
355
|
ref: t,
|
|
244
356
|
style: { pointerEvents: "none", ...e.style }
|
|
@@ -247,28 +359,28 @@ var L = "CheckboxIndicator", j = i.forwardRef(
|
|
|
247
359
|
}
|
|
248
360
|
);
|
|
249
361
|
j.displayName = L;
|
|
250
|
-
var
|
|
251
|
-
const { control: t, checked: n, bubbles: r = !0, defaultChecked: o, ...
|
|
362
|
+
var ue = (e) => {
|
|
363
|
+
const { control: t, checked: n, bubbles: r = !0, defaultChecked: o, ...s } = e, u = i.useRef(null), c = G(n), a = H(t);
|
|
252
364
|
i.useEffect(() => {
|
|
253
|
-
const p =
|
|
254
|
-
if (
|
|
255
|
-
const
|
|
256
|
-
p.indeterminate =
|
|
365
|
+
const p = u.current, d = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(d, "checked").set;
|
|
366
|
+
if (c !== n && m) {
|
|
367
|
+
const b = new Event("click", { bubbles: r });
|
|
368
|
+
p.indeterminate = N(n), m.call(p, N(n) ? !1 : n), p.dispatchEvent(b);
|
|
257
369
|
}
|
|
258
|
-
}, [
|
|
259
|
-
const
|
|
260
|
-
return /* @__PURE__ */
|
|
370
|
+
}, [c, n, r]);
|
|
371
|
+
const l = i.useRef(N(n) ? !1 : n);
|
|
372
|
+
return /* @__PURE__ */ h(
|
|
261
373
|
"input",
|
|
262
374
|
{
|
|
263
375
|
type: "checkbox",
|
|
264
376
|
"aria-hidden": !0,
|
|
265
|
-
defaultChecked: o ??
|
|
266
|
-
...
|
|
377
|
+
defaultChecked: o ?? l.current,
|
|
378
|
+
...s,
|
|
267
379
|
tabIndex: -1,
|
|
268
|
-
ref:
|
|
380
|
+
ref: u,
|
|
269
381
|
style: {
|
|
270
382
|
...e.style,
|
|
271
|
-
...
|
|
383
|
+
...a,
|
|
272
384
|
position: "absolute",
|
|
273
385
|
pointerEvents: "none",
|
|
274
386
|
opacity: 0,
|
|
@@ -277,25 +389,25 @@ var ie = (e) => {
|
|
|
277
389
|
}
|
|
278
390
|
);
|
|
279
391
|
};
|
|
280
|
-
function
|
|
392
|
+
function N(e) {
|
|
281
393
|
return e === "indeterminate";
|
|
282
394
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
395
|
+
function B(e) {
|
|
396
|
+
return N(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
285
397
|
}
|
|
286
|
-
var
|
|
398
|
+
var ae = z, le = j;
|
|
287
399
|
const P = {
|
|
288
400
|
"rp-checkbox": "_rp-checkbox_11dq0_1",
|
|
289
401
|
"rp-checkbox-indicator": "_rp-checkbox-indicator_11dq0_18"
|
|
290
|
-
},
|
|
402
|
+
}, he = ({
|
|
291
403
|
children: e,
|
|
292
404
|
value: t,
|
|
293
405
|
name: n,
|
|
294
406
|
onChange: r
|
|
295
407
|
}) => /* @__PURE__ */ M("div", { style: { display: "flex", alignItems: "center", position: "relative" }, children: [
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ h(ae, { className: P["rp-checkbox"], checked: t, id: n, onCheckedChange: r, children: /* @__PURE__ */ h(le, { className: P["rp-checkbox-indicator"], children: /* @__PURE__ */ h(V, {}) }) }),
|
|
409
|
+
/* @__PURE__ */ h("label", { className: P["rp-checkbox-label"], htmlFor: n, children: e })
|
|
298
410
|
] });
|
|
299
411
|
export {
|
|
300
|
-
|
|
412
|
+
he as UICheckbox
|
|
301
413
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { R as l, T as c, P as p, C as _ } from "../../index-
|
|
2
|
+
import { R as l, T as c, P as p, C as _ } from "../../index-8049287f.js";
|
|
3
3
|
import { c as A } from "../../clsx-0c6e471a.js";
|
|
4
4
|
import '../../assets/DropDown.css';const F = "_slideDownAndFade_1000s_1", w = "_slideLeftAndFade_1000s_1", m = "_slideUpAndFade_1000s_1", f = "_slideRightAndFade_1000s_1", g = {
|
|
5
5
|
"rp-dropdown-content": "_rp-dropdown-content_1000s_1",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { P as p, k as n, u as P } from "../RPLayout-608b83dd.js";
|
|
4
4
|
import "./RPDocumentContext.js";
|
|
5
5
|
import "../utils/appConsole.js";
|
|
6
6
|
import "./InitialStateContext.js";
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
p as PaginateContext,
|
|
9
9
|
n as PaginateProvider,
|
|
10
|
-
|
|
10
|
+
P as usePaginateContext
|
|
11
11
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { p as e, q as n, c as p } from "../RPLayout-608b83dd.js";
|
|
4
4
|
export {
|
|
5
5
|
e as PrintContext,
|
|
6
6
|
n as PrintProvider,
|
|
7
|
-
|
|
7
|
+
p as usePrintContext
|
|
8
8
|
};
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useLoadPdf as
|
|
4
|
-
import { usePdfProperties as
|
|
5
|
-
import { LoaderIcon as
|
|
6
|
-
import { appConsole as
|
|
7
|
-
const c =
|
|
2
|
+
import { createContext as x, useState as a, useEffect as C, useMemo as g, useContext as v } from "react";
|
|
3
|
+
import { useLoadPdf as D } from "../utils/hooks/useLoadPdf.js";
|
|
4
|
+
import { usePdfProperties as S } from "../utils/hooks/usePdfProperties.js";
|
|
5
|
+
import { LoaderIcon as y } from "../components/icons/LoaderIcon.js";
|
|
6
|
+
import { appConsole as j } from "../utils/appConsole.js";
|
|
7
|
+
const c = x({
|
|
8
8
|
pdf: void 0,
|
|
9
9
|
pages: /* @__PURE__ */ new Map(),
|
|
10
10
|
setPdfSrc: () => {
|
|
11
11
|
},
|
|
12
12
|
setFilename: () => {
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
},
|
|
14
|
+
loading: !1
|
|
15
|
+
}), E = ({
|
|
16
|
+
children: t,
|
|
17
|
+
src: e,
|
|
18
|
+
characterMap: l,
|
|
19
|
+
onLoadError: u,
|
|
20
|
+
onLoaded: P
|
|
21
|
+
}) => {
|
|
22
|
+
const [o, i] = a(e), { pdf: n, pages: s, loading: p } = D(o, l, { onLoadError: u, onLoaded: P }), [d, f] = a(), m = S(o, n, d);
|
|
23
|
+
C(() => {
|
|
24
|
+
f(e == null ? void 0 : e.split("/").pop()), i(e);
|
|
18
25
|
}, [e]);
|
|
19
|
-
const
|
|
26
|
+
const h = g(() => ({
|
|
20
27
|
pdf: n,
|
|
21
|
-
pages:
|
|
28
|
+
pages: s,
|
|
22
29
|
pdfSrc: o,
|
|
23
|
-
setPdfSrc:
|
|
24
|
-
pdfProperties:
|
|
30
|
+
setPdfSrc: i,
|
|
31
|
+
pdfProperties: m,
|
|
25
32
|
setFilename: f,
|
|
26
|
-
filename:
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
filename: d,
|
|
34
|
+
loading: p
|
|
35
|
+
}), [n, s, o, m, p]);
|
|
36
|
+
return /* @__PURE__ */ r(c.Provider, { value: h, children: n ? t : /* @__PURE__ */ r(
|
|
29
37
|
"div",
|
|
30
38
|
{
|
|
31
39
|
style: {
|
|
@@ -35,15 +43,15 @@ const c = l({
|
|
|
35
43
|
height: "100%",
|
|
36
44
|
width: "100%"
|
|
37
45
|
},
|
|
38
|
-
children: /* @__PURE__ */ r(
|
|
46
|
+
children: /* @__PURE__ */ r(y, {})
|
|
39
47
|
}
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
const t =
|
|
43
|
-
return t.pdf ||
|
|
48
|
+
) });
|
|
49
|
+
}, R = () => {
|
|
50
|
+
const t = v(c);
|
|
51
|
+
return t.pdf || j.error("Please use this hooks inside children component of RPDocument"), t;
|
|
44
52
|
};
|
|
45
53
|
export {
|
|
46
|
-
|
|
54
|
+
E as DocumentProvider,
|
|
47
55
|
c as default,
|
|
48
|
-
|
|
56
|
+
R as useDocumentContext
|
|
49
57
|
};
|