@memobit/libs 3.26.4 → 3.28.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/components/Banner/Banner2.js +15 -13
- package/dist/components/BoldText/BoldText.js +5 -0
- package/dist/components/Calendar/Calendar2.js +108 -135
- package/dist/components/ColorPicker/ColorPicker.css +1 -1
- package/dist/components/ColorPicker/ColorPicker2.js +114 -114
- package/dist/components/ConfirmDialog/ConfirmDialog2.js +13 -11
- package/dist/components/ConfirmPopover/ConfirmPopover2.js +26 -24
- package/dist/components/ContextMenu/ContextMenu2.js +46 -33
- package/dist/components/ControlPanel/ControlPanel2.js +95 -93
- package/dist/components/ControlPanel/ControlPanelFilter.js +205 -193
- package/dist/components/ControlPanel/ControlPanelOptions.js +190 -185
- package/dist/components/DataView/DataView.CardView.js +83 -81
- package/dist/components/DataView/DataView.ColumnSelector.js +27 -25
- package/dist/components/DataView/DataView.TableView.js +74 -72
- package/dist/components/DataView/DataView2.js +169 -167
- package/dist/components/DatePicker/DatePicker2.js +71 -69
- package/dist/components/Drawer/Drawer2.js +58 -55
- package/dist/components/Dropdown/Dropdown2.js +187 -189
- package/dist/components/InputDate/InputDate2.js +43 -41
- package/dist/components/InputSearch/InputSearch2.js +27 -25
- package/dist/components/MenuBar/MenuBar.css +1 -0
- package/dist/components/MenuBar/MenuBar2.js +46 -0
- package/dist/components/Modal/Modal2.js +49 -47
- package/dist/components/Pagination/Pagination2.js +44 -47
- package/dist/components/ScrollToTop/ScrollToTop2.js +18 -16
- package/dist/components/ThemeSettings/ThemeSettings2.js +131 -123
- package/dist/components/TipsOfTheDay/TipsOfTheDay2.js +16 -12
- package/dist/components/Toast/Toast2.js +38 -33
- package/dist/components/ToolButton/ToolButton.css +1 -0
- package/dist/components/ToolButton/ToolButton2.js +36 -0
- package/dist/components/ToolPalette/ToolPalette.css +1 -0
- package/dist/components/ToolPalette/ToolPalette2.js +83 -0
- package/dist/components/Toolbar/Toolbar2.js +58 -56
- package/dist/contexts/LanguageContext/LanguageContext.context.js +9 -0
- package/dist/contexts/LanguageContext/LanguageContext.js +19 -0
- package/dist/contexts/LanguageContext/libMessages.js +240 -0
- package/dist/helpers/Datetime.js +84 -68
- package/dist/helpers/Language.js +8 -0
- package/dist/helpers/Pagination.js +5 -4
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useLanguage.js +16 -0
- package/dist/index.d.ts +133 -6
- package/dist/index.js +417 -399
- package/dist/memobit-icons.json +4 -0
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
package/dist/helpers/Datetime.js
CHANGED
|
@@ -1,102 +1,118 @@
|
|
|
1
1
|
var m = (t) => {
|
|
2
2
|
if (t < 60) return `${t} min`;
|
|
3
|
-
const e = Math.floor(t / 60),
|
|
4
|
-
return
|
|
3
|
+
const e = Math.floor(t / 60), a = t % 60;
|
|
4
|
+
return a === 0 ? `${e}h` : `${e}h ${a}min`;
|
|
5
5
|
}, d = (t) => {
|
|
6
6
|
if (t == null || isNaN(t)) return "0:00";
|
|
7
|
-
const e = Math.floor(t),
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
7
|
+
const e = Math.floor(t), a = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = e % 60, i = n.toString().padStart(2, "0"), g = r.toString().padStart(2, "0");
|
|
8
|
+
return a === 0 ? `${n}:${g}` : `${a}:${i}:${g}`;
|
|
9
|
+
}, l = {
|
|
10
|
+
en: [
|
|
11
|
+
"Jan",
|
|
12
|
+
"Feb",
|
|
13
|
+
"Mar",
|
|
14
|
+
"Apr",
|
|
15
|
+
"May",
|
|
16
|
+
"Jun",
|
|
17
|
+
"Jul",
|
|
18
|
+
"Aug",
|
|
19
|
+
"Sep",
|
|
20
|
+
"Oct",
|
|
21
|
+
"Nov",
|
|
22
|
+
"Dec"
|
|
23
|
+
],
|
|
24
|
+
ro: [
|
|
25
|
+
"ian",
|
|
26
|
+
"feb",
|
|
27
|
+
"mar",
|
|
28
|
+
"apr",
|
|
29
|
+
"mai",
|
|
30
|
+
"iun",
|
|
31
|
+
"iul",
|
|
32
|
+
"aug",
|
|
33
|
+
"sep",
|
|
34
|
+
"oct",
|
|
35
|
+
"nov",
|
|
36
|
+
"dec"
|
|
37
|
+
]
|
|
38
|
+
}, c = (t, e, a = "en") => {
|
|
39
|
+
const n = t.getFullYear(), r = t.getMonth(), i = String(r + 1).padStart(2, "0"), g = l[a][r], o = String(t.getDate()).padStart(2, "0"), D = String(t.getHours()).padStart(2, "0"), s = String(t.getMinutes()).padStart(2, "0"), u = String(t.getSeconds()).padStart(2, "0");
|
|
40
|
+
return e.replace("YYYY", String(n)).replace("MMM", g).replace("MM", i).replace("DD", o).replace("HH", D).replace("mm", s).replace("ss", u);
|
|
41
|
+
}, p = (t) => {
|
|
42
|
+
const [e, a, n] = t.split("-").map(Number);
|
|
43
|
+
return new Date(e, a - 1, n).toLocaleDateString("en-US");
|
|
44
|
+
}, v = () => {
|
|
29
45
|
const t = /* @__PURE__ */ new Date();
|
|
30
46
|
return (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
|
|
31
|
-
},
|
|
32
|
-
const [
|
|
33
|
-
return c(new Date(
|
|
34
|
-
}, y = (t) => {
|
|
35
|
-
const
|
|
36
|
-
return isNaN(
|
|
47
|
+
}, M = "DD MMM YYYY", f = "DD MMM YYYY HH:mm", T = (t, e = "en") => {
|
|
48
|
+
const [a, n, r] = t.split("-").map(Number);
|
|
49
|
+
return c(new Date(a, n - 1, r), M, e);
|
|
50
|
+
}, y = (t, e = "en") => {
|
|
51
|
+
const a = new Date(t.replace(" ", "T"));
|
|
52
|
+
return isNaN(a.getTime()) ? t : c(a, f, e);
|
|
37
53
|
}, w = (t) => {
|
|
38
|
-
const e = Math.floor(t / 365),
|
|
39
|
-
return e > 0 &&
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
}, Y = (t, e) => new Date(t, e + 1, 0).getDate(), $ = (t, e,
|
|
44
|
-
const
|
|
45
|
-
let i =
|
|
46
|
-
|
|
54
|
+
const e = Math.floor(t / 365), a = Math.round((t - e * 365) / 30);
|
|
55
|
+
return e > 0 && a > 0 ? `${e}y ${a}m` : e > 0 ? `${e}y` : `${a}m`;
|
|
56
|
+
}, h = (t, e) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate(), S = (t, e, a) => {
|
|
57
|
+
const n = t.getTime();
|
|
58
|
+
return n >= e.getTime() && n <= a.getTime();
|
|
59
|
+
}, Y = (t, e) => new Date(t, e + 1, 0).getDate(), $ = (t, e, a = 0) => {
|
|
60
|
+
const n = new Date(t, e, 1), r = new Date(t, e + 1, 0).getDate();
|
|
61
|
+
let i = n.getDay();
|
|
62
|
+
a === 1 && (i = i === 0 ? 6 : i - 1);
|
|
47
63
|
const g = [];
|
|
48
64
|
let o = [];
|
|
49
|
-
const
|
|
50
|
-
for (let s = i - 1; s >= 0; s--) o.push(new Date(t, e - 1,
|
|
51
|
-
for (let s = 1; s <=
|
|
65
|
+
const D = new Date(t, e, 0).getDate();
|
|
66
|
+
for (let s = i - 1; s >= 0; s--) o.push(new Date(t, e - 1, D - s));
|
|
67
|
+
for (let s = 1; s <= r; s++)
|
|
52
68
|
o.push(new Date(t, e, s)), o.length === 7 && (g.push(o), o = []);
|
|
53
69
|
if (o.length > 0) {
|
|
54
70
|
const s = 7 - o.length;
|
|
55
|
-
for (let
|
|
71
|
+
for (let u = 1; u <= s; u++) o.push(new Date(t, e + 1, u));
|
|
56
72
|
g.push(o);
|
|
57
73
|
}
|
|
58
74
|
return g;
|
|
59
|
-
}, N = (t) =>
|
|
60
|
-
const e = new Date(t.getFullYear(), t.getMonth(), t.getDate()),
|
|
61
|
-
e.setDate(e.getDate() -
|
|
62
|
-
const
|
|
63
|
-
return
|
|
75
|
+
}, N = (t) => h(t, /* @__PURE__ */ new Date()), A = (t) => {
|
|
76
|
+
const e = new Date(t.getFullYear(), t.getMonth(), t.getDate()), a = (e.getDay() + 6) % 7;
|
|
77
|
+
e.setDate(e.getDate() - a + 3);
|
|
78
|
+
const n = new Date(e.getFullYear(), 0, 4), r = (n.getDay() + 6) % 7;
|
|
79
|
+
return n.setDate(n.getDate() - r + 3), 1 + Math.round((e.getTime() - n.getTime()) / 6048e5);
|
|
64
80
|
}, F = (t) => {
|
|
65
81
|
const e = t.getDay();
|
|
66
82
|
return e === 0 || e === 6;
|
|
67
83
|
}, b = (t, e) => {
|
|
68
|
-
const
|
|
69
|
-
return
|
|
84
|
+
const a = new Date(t);
|
|
85
|
+
return a.setDate(a.getDate() + e), a;
|
|
70
86
|
}, I = (t, e) => {
|
|
71
|
-
const
|
|
72
|
-
return
|
|
87
|
+
const a = new Date(t);
|
|
88
|
+
return a.setMonth(a.getMonth() + e), a;
|
|
73
89
|
}, H = (t, e) => {
|
|
74
|
-
const
|
|
75
|
-
return
|
|
90
|
+
const a = new Date(t.getFullYear(), t.getMonth(), t.getDate()), n = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
91
|
+
return a.getTime() < n.getTime();
|
|
76
92
|
}, O = (t, e) => {
|
|
77
|
-
const
|
|
78
|
-
return
|
|
93
|
+
const a = new Date(t.getFullYear(), t.getMonth(), t.getDate()), n = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
94
|
+
return a.getTime() > n.getTime();
|
|
79
95
|
}, _ = (t) => {
|
|
80
96
|
if (!t) return null;
|
|
81
97
|
const e = new Date(t);
|
|
82
98
|
if (Number.isNaN(e.getTime())) return null;
|
|
83
|
-
const
|
|
84
|
-
if (Math.abs(
|
|
85
|
-
if (Math.abs(
|
|
86
|
-
const
|
|
87
|
-
if (Math.abs(
|
|
88
|
-
const i = Math.round(
|
|
99
|
+
const a = e.getTime() - Date.now(), n = Math.round(a / 6e4);
|
|
100
|
+
if (Math.abs(n) < 1) return "just now";
|
|
101
|
+
if (Math.abs(n) < 60) return `${Math.abs(n)}m ago`;
|
|
102
|
+
const r = Math.round(n / 60);
|
|
103
|
+
if (Math.abs(r) < 24) return `${Math.abs(r)}h ago`;
|
|
104
|
+
const i = Math.round(r / 24);
|
|
89
105
|
return `${Math.abs(i)}d ago`;
|
|
90
106
|
};
|
|
91
107
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
108
|
+
M as APP_DATE_FORMAT,
|
|
109
|
+
f as APP_DATE_TIME_FORMAT,
|
|
94
110
|
b as addDays,
|
|
95
111
|
I as addMonths,
|
|
96
|
-
|
|
112
|
+
T as formatAppDate,
|
|
97
113
|
y as formatAppDateTime,
|
|
98
114
|
c as formatDate,
|
|
99
|
-
|
|
115
|
+
p as formatDateLocale,
|
|
100
116
|
m as formatDuration,
|
|
101
117
|
w as formatRelativeDuration,
|
|
102
118
|
_ as formatRelativeTime,
|
|
@@ -104,11 +120,11 @@ export {
|
|
|
104
120
|
Y as getDaysInMonth,
|
|
105
121
|
A as getIsoWeek,
|
|
106
122
|
$ as getMonthMatrix,
|
|
107
|
-
|
|
123
|
+
v as getTodayDateString,
|
|
108
124
|
O as isAfter,
|
|
109
125
|
H as isBefore,
|
|
110
126
|
S as isDateInRange,
|
|
111
|
-
|
|
127
|
+
h as isSameDay,
|
|
112
128
|
N as isToday,
|
|
113
129
|
F as isWeekend
|
|
114
130
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { libMessages as M } from "../contexts/LanguageContext/libMessages.js";
|
|
2
|
+
var l = (n, s, r, c, b, x = "en") => {
|
|
3
|
+
const i = s ? (c - 1) * n + 1 : 0, o = Math.min(c * n, s), p = b ? ` ${b}` : "", v = M[x];
|
|
4
|
+
return s === r ? v.resultsCount(i, o, r, p) : v.resultsCountFiltered(i, o, s, r, p);
|
|
4
5
|
};
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
l as getResultsCount
|
|
7
8
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LanguageContext as g } from "../contexts/LanguageContext/LanguageContext.context.js";
|
|
2
|
+
import { useContext as u, useMemo as o } from "react";
|
|
3
|
+
var n = () => u(g), r = (e) => e[n().language], l = () => {
|
|
4
|
+
const { language: e, setLanguage: a } = n();
|
|
5
|
+
return o(() => ({
|
|
6
|
+
label: e === "en" ? "Română" : "English",
|
|
7
|
+
icon: "language",
|
|
8
|
+
isActive: !1,
|
|
9
|
+
onClick: () => a(e === "en" ? "ro" : "en")
|
|
10
|
+
}), [e, a]);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
n as useLanguage,
|
|
14
|
+
l as useLanguageMenuItem,
|
|
15
|
+
r as useMessages
|
|
16
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -311,6 +311,13 @@ export declare interface BMIRange {
|
|
|
311
311
|
percentage: number;
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
/** Renders the `**bold**` parts of a text, so a translated sentence stays whole even when its emphasis moves. */
|
|
315
|
+
export declare const BoldText: FC<BoldTextProps>;
|
|
316
|
+
|
|
317
|
+
declare interface BoldTextProps {
|
|
318
|
+
text: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
314
321
|
export declare const Breadcrumb: default_2.FC<BreadcrumbProps>;
|
|
315
322
|
|
|
316
323
|
export declare interface BreadcrumbItem {
|
|
@@ -612,6 +619,11 @@ export declare interface ColorPickerProps {
|
|
|
612
619
|
*/
|
|
613
620
|
swatches?: string[];
|
|
614
621
|
swatchesLabel?: string;
|
|
622
|
+
/**
|
|
623
|
+
* Without the card around it (border, padding, background) and as wide as its container: for a picker that
|
|
624
|
+
* sits in a side panel rather than a popover. The gradient's height follows `--color-picker-field-height`.
|
|
625
|
+
*/
|
|
626
|
+
bare?: boolean;
|
|
615
627
|
}
|
|
616
628
|
|
|
617
629
|
export declare interface ColProps {
|
|
@@ -701,13 +713,22 @@ export declare interface ConfirmPopoverProps {
|
|
|
701
713
|
offset?: number;
|
|
702
714
|
}
|
|
703
715
|
|
|
704
|
-
export declare const ContextMenu: ({ target, onClose, children, autoClose }: ContextMenuProps) => ReactPortal | null;
|
|
716
|
+
export declare const ContextMenu: ({ target, position, onClose, children, autoClose }: ContextMenuProps) => ReactPortal | null;
|
|
705
717
|
|
|
706
718
|
declare interface ContextMenuProps {
|
|
707
719
|
autoClose?: boolean;
|
|
708
720
|
children: ReactElement;
|
|
709
721
|
onClose?: () => void;
|
|
710
|
-
|
|
722
|
+
/** The element the menu opens below. Not needed when `position` is given. */
|
|
723
|
+
target?: EventTarget | null;
|
|
724
|
+
/**
|
|
725
|
+
* Opens the menu at a point in the viewport instead of below an element: pass a right-click's `clientX` and
|
|
726
|
+
* `clientY` for a menu at the cursor. Wins over `target` when both are given.
|
|
727
|
+
*/
|
|
728
|
+
position?: {
|
|
729
|
+
x: number;
|
|
730
|
+
y: number;
|
|
731
|
+
} | null;
|
|
711
732
|
}
|
|
712
733
|
|
|
713
734
|
export declare interface ContextToastAction {
|
|
@@ -1480,6 +1501,8 @@ declare interface DropdownProps {
|
|
|
1480
1501
|
allowCustomValue?: boolean;
|
|
1481
1502
|
autofocus?: boolean;
|
|
1482
1503
|
className?: string;
|
|
1504
|
+
/** Shows the clear (×) button once something is selected. Turn it off when a value must always be set. Defaults to true. */
|
|
1505
|
+
clearable?: boolean;
|
|
1483
1506
|
disabled?: boolean;
|
|
1484
1507
|
error?: string;
|
|
1485
1508
|
highlighted?: boolean;
|
|
@@ -1795,9 +1818,9 @@ export declare interface FolderBrowserModalProps {
|
|
|
1795
1818
|
|
|
1796
1819
|
export declare const format2Digits: (val: number | string) => number;
|
|
1797
1820
|
|
|
1798
|
-
export declare const formatAppDate: (dateStr: string) => string;
|
|
1821
|
+
export declare const formatAppDate: (dateStr: string, language?: Language) => string;
|
|
1799
1822
|
|
|
1800
|
-
export declare const formatAppDateTime: (dateStr: string) => string;
|
|
1823
|
+
export declare const formatAppDateTime: (dateStr: string, language?: Language) => string;
|
|
1801
1824
|
|
|
1802
1825
|
export declare const formatBigNumber: (value: number) => string;
|
|
1803
1826
|
|
|
@@ -1807,7 +1830,7 @@ export declare const formatBytes: (bytes: number, decimals?: number) => string;
|
|
|
1807
1830
|
* Formats a date according to the specified format string
|
|
1808
1831
|
* Supported tokens: YYYY, MMM, MM, DD, HH, mm, ss
|
|
1809
1832
|
*/
|
|
1810
|
-
export declare const formatDate: (date: Date, format: string) => string;
|
|
1833
|
+
export declare const formatDate: (date: Date, format: string, language?: Language) => string;
|
|
1811
1834
|
|
|
1812
1835
|
export declare const formatDateLocale: (dateStr: string) => string;
|
|
1813
1836
|
|
|
@@ -1897,7 +1920,7 @@ export declare const getPercentsOf2Numbers: (aInput: number, bInput: number) =>
|
|
|
1897
1920
|
|
|
1898
1921
|
export declare const getRangeLabel: (range: BMIRange, index: number, total: number) => string;
|
|
1899
1922
|
|
|
1900
|
-
export declare const getResultsCount: (visiblePageSize: number, filteredItemsCount: number, totalItemsCount: number, currentPage: number, itemNoun?: string) => string;
|
|
1923
|
+
export declare const getResultsCount: (visiblePageSize: number, filteredItemsCount: number, totalItemsCount: number, currentPage: number, itemNoun?: string, language?: Language) => string;
|
|
1901
1924
|
|
|
1902
1925
|
export { getThemeConfig }
|
|
1903
1926
|
|
|
@@ -2509,6 +2532,23 @@ export declare interface JourneyWizardProps {
|
|
|
2509
2532
|
width?: string;
|
|
2510
2533
|
}
|
|
2511
2534
|
|
|
2535
|
+
export declare type Language = 'en' | 'ro';
|
|
2536
|
+
|
|
2537
|
+
export declare const LanguageContext: Context<LanguageContextValue>;
|
|
2538
|
+
|
|
2539
|
+
export declare interface LanguageContextValue {
|
|
2540
|
+
language: Language;
|
|
2541
|
+
setLanguage: (language: Language) => void;
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
export declare function LanguageProvider({ children, language, onLanguageChange }: LanguageProviderProps): JSX.Element;
|
|
2545
|
+
|
|
2546
|
+
declare interface LanguageProviderProps {
|
|
2547
|
+
children: ReactNode;
|
|
2548
|
+
language: Language;
|
|
2549
|
+
onLanguageChange: (language: Language) => void;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2512
2552
|
export declare const LIB_BUILD_DATE: string;
|
|
2513
2553
|
|
|
2514
2554
|
export declare const LIB_BUILD_ID: string;
|
|
@@ -2546,6 +2586,13 @@ export declare const loadImageElement: (source: Blob | string) => Promise<HTMLIm
|
|
|
2546
2586
|
|
|
2547
2587
|
export declare const Loading: default_2.FC;
|
|
2548
2588
|
|
|
2589
|
+
/**
|
|
2590
|
+
* A set of UI texts, once per language. A messages file writes `const ro: typeof en`, so a key
|
|
2591
|
+
* missing from either side fails the typecheck. Text with variables is a function, which lets each
|
|
2592
|
+
* language place the variables and pick its own plural.
|
|
2593
|
+
*/
|
|
2594
|
+
export declare type Localized<T> = Record<Language, T>;
|
|
2595
|
+
|
|
2549
2596
|
export declare type LogicalOperator = 'and' | 'or';
|
|
2550
2597
|
|
|
2551
2598
|
export declare interface LoginCredentials {
|
|
@@ -2597,6 +2644,29 @@ export declare const matchesKeyFilter: (filterValue: string | string[] | null |
|
|
|
2597
2644
|
|
|
2598
2645
|
export declare const matchStringsByLogicalOperator: (searchItems: string[], targetString: string, operator: LogicalOperator) => boolean;
|
|
2599
2646
|
|
|
2647
|
+
/**
|
|
2648
|
+
* A desktop menu bar: File, Edit, Image… A click opens a menu; while one is open, hovering another switches to it,
|
|
2649
|
+
* as in Windows. Esc or a click elsewhere closes it. Shortcuts are only shown: handling the keys is the app's job.
|
|
2650
|
+
*/
|
|
2651
|
+
export declare const MenuBar: ({ menus, className }: MenuBarProps) => JSX.Element;
|
|
2652
|
+
|
|
2653
|
+
export declare type MenuBarEntry = {
|
|
2654
|
+
label: string;
|
|
2655
|
+
shortcut?: string;
|
|
2656
|
+
onSelect: () => void;
|
|
2657
|
+
disabled?: boolean;
|
|
2658
|
+
} | 'separator';
|
|
2659
|
+
|
|
2660
|
+
export declare interface MenuBarMenu {
|
|
2661
|
+
label: string;
|
|
2662
|
+
entries: MenuBarEntry[];
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
export declare interface MenuBarProps {
|
|
2666
|
+
menus: MenuBarMenu[];
|
|
2667
|
+
className?: string;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2600
2670
|
export declare const MenuHamburger: FC<MenuHamburgerProps>;
|
|
2601
2671
|
|
|
2602
2672
|
export declare interface MenuHamburgerItem {
|
|
@@ -3040,6 +3110,9 @@ declare interface RichTextEditorProps {
|
|
|
3040
3110
|
value?: string;
|
|
3041
3111
|
}
|
|
3042
3112
|
|
|
3113
|
+
/** A counted Romanian noun: "1 lună", "3 luni", "20 de luni". */
|
|
3114
|
+
export declare const roCount: (count: number, one: string, many: string) => string;
|
|
3115
|
+
|
|
3043
3116
|
export declare const RollingNumber: FC<RollingNumberProps>;
|
|
3044
3117
|
|
|
3045
3118
|
export declare type RollingNumberDirection = 'up' | 'down' | 'none';
|
|
@@ -3704,6 +3777,54 @@ export declare interface ToolbarSortValue {
|
|
|
3704
3777
|
field: string;
|
|
3705
3778
|
}
|
|
3706
3779
|
|
|
3780
|
+
/** An icon-only toolbar button, its label in a Tooltip rather than a native title. */
|
|
3781
|
+
export declare const ToolButton: ({ icon, hint, onClick, disabled, active, danger, mirrored, badge, hintPosition, className }: ToolButtonProps) => JSX.Element;
|
|
3782
|
+
|
|
3783
|
+
export declare interface ToolButtonProps {
|
|
3784
|
+
icon: IconName | ReactElement;
|
|
3785
|
+
/** What it does, with its shortcut if any ("Rotate right (Ctrl+R)"), shown in a Tooltip. */
|
|
3786
|
+
hint: string;
|
|
3787
|
+
onClick: () => void;
|
|
3788
|
+
disabled?: boolean;
|
|
3789
|
+
/** Shown pressed: the current tool, or a toggle that is on. */
|
|
3790
|
+
active?: boolean;
|
|
3791
|
+
/** Red, for the destructive action of a toolbar. */
|
|
3792
|
+
danger?: boolean;
|
|
3793
|
+
/** Flips the icon, e.g. to turn a clockwise arrow into the counter-clockwise one. */
|
|
3794
|
+
mirrored?: boolean;
|
|
3795
|
+
/** A short tag on the icon's corner that sets it apart from the plain action, e.g. "WEB" on a floppy. */
|
|
3796
|
+
badge?: string;
|
|
3797
|
+
hintPosition?: TooltipPosition;
|
|
3798
|
+
className?: string;
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
/**
|
|
3802
|
+
* A tool column, as in an image editor. Items that share a group share a slot showing the one last used: clicking the
|
|
3803
|
+
* slot again moves to the next item of the group, right-clicking lists them all. A corner mark shows which slots hold more.
|
|
3804
|
+
*/
|
|
3805
|
+
export declare const ToolPalette: ({ items, activeId, onSelect, columns, children, className }: ToolPaletteProps) => JSX.Element;
|
|
3806
|
+
|
|
3807
|
+
export declare interface ToolPaletteItem {
|
|
3808
|
+
id: string;
|
|
3809
|
+
label: string;
|
|
3810
|
+
icon: IconName | ReactElement;
|
|
3811
|
+
/** Shown in the hint and the group menu, e.g. "M". */
|
|
3812
|
+
shortcut?: string;
|
|
3813
|
+
/** Items with the same group share one slot, as Photoshop's marquees do. Defaults to the item's own id. */
|
|
3814
|
+
group?: string;
|
|
3815
|
+
}
|
|
3816
|
+
|
|
3817
|
+
export declare interface ToolPaletteProps {
|
|
3818
|
+
items: ToolPaletteItem[];
|
|
3819
|
+
activeId: string;
|
|
3820
|
+
onSelect: (id: string) => void;
|
|
3821
|
+
/** Slots per row. Defaults to 2, which keeps a long set of tools on screen in a small window. */
|
|
3822
|
+
columns?: number;
|
|
3823
|
+
/** Shown under the tools, e.g. the foreground and background colours. */
|
|
3824
|
+
children?: ReactNode;
|
|
3825
|
+
className?: string;
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3707
3828
|
export declare const Tooltip: default_2.FC<TooltipProps>;
|
|
3708
3829
|
|
|
3709
3830
|
export declare type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -3876,6 +3997,10 @@ export declare interface UseHighlightReturn {
|
|
|
3876
3997
|
highlight: (...ids: ListMotionKey[]) => void;
|
|
3877
3998
|
}
|
|
3878
3999
|
|
|
4000
|
+
export declare const useLanguage: () => LanguageContextValue;
|
|
4001
|
+
|
|
4002
|
+
export declare const useLanguageMenuItem: () => MenuHamburgerItem;
|
|
4003
|
+
|
|
3879
4004
|
/**
|
|
3880
4005
|
* Animates a keyed list as it changes: items that join fade and grow in, items that leave fade
|
|
3881
4006
|
* out where they stood, and the rest slide to their new places instead of jumping (FLIP).
|
|
@@ -3905,6 +4030,8 @@ export declare interface UseListMotionReturn {
|
|
|
3905
4030
|
skipNext: () => void;
|
|
3906
4031
|
}
|
|
3907
4032
|
|
|
4033
|
+
export declare const useMessages: <T>(messages: Localized<T>) => T;
|
|
4034
|
+
|
|
3908
4035
|
/**
|
|
3909
4036
|
* Hook pentru multiple popover-uri cu ID-uri
|
|
3910
4037
|
* Util când ai multe popover-uri și vrei să le controlezi individual
|