iguazio.dashboard-react-controls 3.2.24 → 3.2.26
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/Loader/Loader.d.ts +3 -1
- package/dist/components/Loader/Loader.d.ts.map +1 -1
- package/dist/components/Loader/Loader.mjs +10 -8
- package/dist/components/Loader/Loader.mjs.map +1 -1
- package/dist/images/navbar-closed-icon.svg +3 -0
- package/dist/images/navbar-closed-icon.svg.mjs +6 -0
- package/dist/images/navbar-closed-icon.svg.mjs.map +1 -0
- package/dist/images/navbar-opened-icon.svg +3 -0
- package/dist/images/navbar-opened-icon.svg.mjs +6 -0
- package/dist/images/navbar-opened-icon.svg.mjs.map +1 -0
- package/dist/index.css +1 -1
- package/dist/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.d.ts +4 -3
- package/dist/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.d.ts.map +1 -1
- package/dist/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.mjs +24 -16
- package/dist/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.mjs.map +1 -1
- package/dist/nextGenComponents/components/index.d.ts +1 -0
- package/dist/nextGenComponents/components/index.d.ts.map +1 -1
- package/dist/nextGenComponents/components/index.mjs +74 -50
- package/dist/nextGenComponents/components/index.mjs.map +1 -1
- package/dist/nextGenComponents/components/ui/sidebar.d.ts +76 -0
- package/dist/nextGenComponents/components/ui/sidebar.d.ts.map +1 -0
- package/dist/nextGenComponents/components/ui/sidebar.mjs +539 -0
- package/dist/nextGenComponents/components/ui/sidebar.mjs.map +1 -0
- package/dist/nextGenComponents/index.mjs +99 -75
- package/dist/nextGenComponents/index.mjs.map +1 -1
- package/dist/utils/datetime.util.d.ts.map +1 -1
- package/dist/utils/datetime.util.mjs +26 -26
- package/dist/utils/datetime.util.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
import "./components/index.mjs";
|
|
2
2
|
import { useTableStore as t } from "./stores/tableStore.mjs";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
3
|
+
import { default as n } from "./components/RowActions/ActionMenu/ActionMenu.mjs";
|
|
4
|
+
import { default as l, getBadgeColor as p } from "./components/Badge/Badge.mjs";
|
|
5
5
|
import { default as u } from "./components/BadgeCell/BadgeCell.mjs";
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Calendar as
|
|
8
|
-
import { Card as
|
|
9
|
-
import { Checkbox as
|
|
10
|
-
import { Collapsible as B, CollapsibleContent as
|
|
11
|
-
import { default as
|
|
6
|
+
import { Button as f } from "./components/ui/button.mjs";
|
|
7
|
+
import { Calendar as g } from "./components/ui/calendar.mjs";
|
|
8
|
+
import { Card as s, CardContent as x, CardDescription as D, CardFooter as C, CardHeader as c, CardTitle as M } from "./components/ui/card.mjs";
|
|
9
|
+
import { Checkbox as w } from "./components/ui/checkbox.mjs";
|
|
10
|
+
import { Collapsible as B, CollapsibleContent as I, CollapsibleTrigger as v } from "./components/ui/collapsible.mjs";
|
|
11
|
+
import { default as G, default as F } from "./components/EllipsisTooltip/EllipsisTooltip.mjs";
|
|
12
12
|
import { default as R } from "./components/DataTable/DataTable.mjs";
|
|
13
|
-
import { default as
|
|
14
|
-
import { Dialog as
|
|
15
|
-
import { DropdownMenu as W, DropdownMenuCheckboxItem as X, DropdownMenuContent as Y, DropdownMenuGroup as Z, DropdownMenuItem as _, DropdownMenuLabel as $, DropdownMenuPortal as oo, DropdownMenuRadioGroup as eo, DropdownMenuRadioItem as ro, DropdownMenuSeparator as to, DropdownMenuShortcut as ao, DropdownMenuSub as
|
|
16
|
-
import { default as
|
|
17
|
-
import { Input as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { Pagination as
|
|
13
|
+
import { default as k } from "./components/DetailsPanel/DetailsPanel.mjs";
|
|
14
|
+
import { Dialog as H, DialogBody as E, DialogClose as N, DialogContent as O, DialogDescription as U, DialogFooter as V, DialogHeader as j, DialogOverlay as q, DialogPortal as z, DialogTitle as J, DialogTrigger as K } from "./components/ui/dialog.mjs";
|
|
15
|
+
import { DropdownMenu as W, DropdownMenuCheckboxItem as X, DropdownMenuContent as Y, DropdownMenuGroup as Z, DropdownMenuItem as _, DropdownMenuLabel as $, DropdownMenuPortal as oo, DropdownMenuRadioGroup as eo, DropdownMenuRadioItem as ro, DropdownMenuSeparator as to, DropdownMenuShortcut as ao, DropdownMenuSub as no, DropdownMenuSubContent as io, DropdownMenuSubTrigger as lo, DropdownMenuTrigger as po } from "./components/ui/dropdown-menu.mjs";
|
|
16
|
+
import { default as So } from "./components/FilterPopover/FilterPopover.mjs";
|
|
17
|
+
import { Input as bo } from "./components/ui/input.mjs";
|
|
18
|
+
import { default as mo } from "./components/Loader/Loader.mjs";
|
|
19
|
+
import { default as xo, SelectArrow as Do } from "./components/MultiSelectField/MultiSelectField.mjs";
|
|
20
|
+
import { Pagination as co, PaginationContent as Mo, PaginationEllipsis as To, PaginationItem as wo, PaginationLink as Po, PaginationNext as Bo, PaginationPrevious as Io } from "./components/ui/pagination.mjs";
|
|
21
21
|
import { default as Ao } from "./components/PaginationControls/PaginationControls.mjs";
|
|
22
|
-
import { Popover as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
22
|
+
import { Popover as Fo, PopoverContent as Lo, PopoverTrigger as Ro } from "./components/ui/popover.mjs";
|
|
23
|
+
import { default as ko } from "./components/RefreshButton/RefreshButton.mjs";
|
|
24
|
+
import { default as Ho } from "./components/RowActions/RowActions.mjs";
|
|
25
25
|
import { ScrollArea as No, ScrollBar as Oo } from "./components/ui/scroll-area.mjs";
|
|
26
26
|
import { Select as Vo, SelectContent as jo, SelectGroup as qo, SelectItem as zo, SelectLabel as Jo, SelectScrollDownButton as Ko, SelectScrollUpButton as Qo, SelectSeparator as Wo, SelectTrigger as Xo, SelectValue as Yo } from "./components/ui/select.mjs";
|
|
27
27
|
import { Separator as _o } from "./components/ui/separator.mjs";
|
|
28
|
-
import {
|
|
29
|
-
import { default as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
28
|
+
import { Sidebar as oe, SidebarContent as ee, SidebarFooter as re, SidebarGroup as te, SidebarGroupAction as ae, SidebarGroupContent as ne, SidebarGroupLabel as ie, SidebarHeader as le, SidebarInput as pe, SidebarInset as de, SidebarMenu as ue, SidebarMenuAction as Se, SidebarMenuBadge as fe, SidebarMenuButton as be, SidebarMenuItem as ge, SidebarMenuSub as me, SidebarMenuSubButton as se, SidebarMenuSubItem as xe, SidebarProvider as De, SidebarRail as Ce, SidebarSeparator as ce, SidebarTrigger as Me, useSidebar as Te } from "./components/ui/sidebar.mjs";
|
|
29
|
+
import { default as Pe } from "./components/RowActions/SingleActionButton/SingleActionButton.mjs";
|
|
30
|
+
import { default as Ie } from "./components/StatsCard/StatsCard.mjs";
|
|
31
|
+
import { Tabs as Ae, TabsContent as Ge, TabsList as Fe, TabsTrigger as Le } from "./components/ui/tabs.mjs";
|
|
32
|
+
import { default as he } from "./components/TimeFilterDropdown/TimeFilterDropdown.mjs";
|
|
33
|
+
import { Tooltip as ye, TooltipContent as He, TooltipProvider as Ee, TooltipTrigger as Ne } from "./components/ui/tooltip.mjs";
|
|
34
|
+
import { cn as Ue } from "./lib/utils.mjs";
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
n as ActionMenu,
|
|
37
|
+
l as Badge,
|
|
37
38
|
u as BadgeCell,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
f as Button,
|
|
40
|
+
g as Calendar,
|
|
41
|
+
s as Card,
|
|
42
|
+
x as CardContent,
|
|
43
|
+
D as CardDescription,
|
|
44
|
+
C as CardFooter,
|
|
45
|
+
c as CardHeader,
|
|
46
|
+
M as CardTitle,
|
|
47
|
+
w as Checkbox,
|
|
47
48
|
B as Collapsible,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
I as CollapsibleContent,
|
|
50
|
+
v as CollapsibleTrigger,
|
|
51
|
+
G as CopyButton,
|
|
51
52
|
R as DataTable,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
k as DetailsPanel,
|
|
54
|
+
H as Dialog,
|
|
55
|
+
E as DialogBody,
|
|
55
56
|
N as DialogClose,
|
|
56
57
|
O as DialogContent,
|
|
57
58
|
U as DialogDescription,
|
|
@@ -72,32 +73,32 @@ export {
|
|
|
72
73
|
ro as DropdownMenuRadioItem,
|
|
73
74
|
to as DropdownMenuSeparator,
|
|
74
75
|
ao as DropdownMenuShortcut,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
no as DropdownMenuSub,
|
|
77
|
+
io as DropdownMenuSubContent,
|
|
78
|
+
lo as DropdownMenuSubTrigger,
|
|
79
|
+
po as DropdownMenuTrigger,
|
|
80
|
+
F as EllipsisTooltip,
|
|
81
|
+
So as FilterPopover,
|
|
82
|
+
bo as Input,
|
|
83
|
+
mo as Loader,
|
|
84
|
+
xo as MultiSelectField,
|
|
85
|
+
co as Pagination,
|
|
86
|
+
Mo as PaginationContent,
|
|
86
87
|
Ao as PaginationControls,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
To as PaginationEllipsis,
|
|
89
|
+
wo as PaginationItem,
|
|
90
|
+
Po as PaginationLink,
|
|
90
91
|
Bo as PaginationNext,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
Io as PaginationPrevious,
|
|
93
|
+
Fo as Popover,
|
|
94
|
+
Lo as PopoverContent,
|
|
94
95
|
Ro as PopoverTrigger,
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
ko as RefreshButton,
|
|
97
|
+
Ho as RowActions,
|
|
97
98
|
No as ScrollArea,
|
|
98
99
|
Oo as ScrollBar,
|
|
99
100
|
Vo as Select,
|
|
100
|
-
|
|
101
|
+
Do as SelectArrow,
|
|
101
102
|
jo as SelectContent,
|
|
102
103
|
qo as SelectGroup,
|
|
103
104
|
zo as SelectItem,
|
|
@@ -108,19 +109,42 @@ export {
|
|
|
108
109
|
Xo as SelectTrigger,
|
|
109
110
|
Yo as SelectValue,
|
|
110
111
|
_o as Separator,
|
|
111
|
-
oe as
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
112
|
+
oe as Sidebar,
|
|
113
|
+
ee as SidebarContent,
|
|
114
|
+
re as SidebarFooter,
|
|
115
|
+
te as SidebarGroup,
|
|
116
|
+
ae as SidebarGroupAction,
|
|
117
|
+
ne as SidebarGroupContent,
|
|
118
|
+
ie as SidebarGroupLabel,
|
|
119
|
+
le as SidebarHeader,
|
|
120
|
+
pe as SidebarInput,
|
|
121
|
+
de as SidebarInset,
|
|
122
|
+
ue as SidebarMenu,
|
|
123
|
+
Se as SidebarMenuAction,
|
|
124
|
+
fe as SidebarMenuBadge,
|
|
125
|
+
be as SidebarMenuButton,
|
|
126
|
+
ge as SidebarMenuItem,
|
|
127
|
+
me as SidebarMenuSub,
|
|
128
|
+
se as SidebarMenuSubButton,
|
|
129
|
+
xe as SidebarMenuSubItem,
|
|
130
|
+
De as SidebarProvider,
|
|
131
|
+
Ce as SidebarRail,
|
|
132
|
+
ce as SidebarSeparator,
|
|
133
|
+
Me as SidebarTrigger,
|
|
134
|
+
Pe as SingleActionButton,
|
|
135
|
+
Ie as StatsCard,
|
|
136
|
+
Ae as Tabs,
|
|
137
|
+
Ge as TabsContent,
|
|
138
|
+
Fe as TabsList,
|
|
139
|
+
Le as TabsTrigger,
|
|
140
|
+
he as TimeFilterDropdown,
|
|
141
|
+
ye as Tooltip,
|
|
142
|
+
He as TooltipContent,
|
|
143
|
+
Ee as TooltipProvider,
|
|
144
|
+
Ne as TooltipTrigger,
|
|
145
|
+
Ue as cn,
|
|
146
|
+
p as getBadgeColor,
|
|
147
|
+
Te as useSidebar,
|
|
124
148
|
t as useTableStore
|
|
125
149
|
};
|
|
126
150
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime.util.d.ts","sourceRoot":"","sources":["../../src/lib/utils/datetime.util.js"],"names":[],"mappings":"AAqBA,6CASC;AAED,qCAAmD;
|
|
1
|
+
{"version":3,"file":"datetime.util.d.ts","sourceRoot":"","sources":["../../src/lib/utils/datetime.util.js"],"names":[],"mappings":"AAqBA,6CASC;AAED,qCAAmD;AAc5C;;;;;;;yBA8BN;AAEM;;;EAYN;AAEM,gEAyBN;AAEM,2EAEN;AAEM,kGAON"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import a from "moment";
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return (navigator.languages || [navigator.language]).find((o) =>
|
|
2
|
+
function c() {
|
|
3
|
+
const t = /* @__PURE__ */ new Set(["en-GB", "en-US"]);
|
|
4
|
+
return (navigator.languages || [navigator.language]).find((o) => t.has(o)) || "en-US";
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const m = c(), i = (t) => typeof t == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(t) && !/Z$|[+-]\d{2}:?\d{2}$/.test(t) ? t + "Z" : t, g = (t, e, r = {
|
|
7
7
|
year: "numeric",
|
|
8
8
|
month: "short",
|
|
9
9
|
day: "numeric",
|
|
10
10
|
hour: "2-digit",
|
|
11
11
|
minute: "2-digit",
|
|
12
12
|
second: "2-digit"
|
|
13
|
-
}, o =
|
|
14
|
-
if (!
|
|
15
|
-
return
|
|
16
|
-
const
|
|
17
|
-
return isNaN(
|
|
13
|
+
}, o = m) => {
|
|
14
|
+
if (!t)
|
|
15
|
+
return e;
|
|
16
|
+
const n = new Date(i(t));
|
|
17
|
+
return isNaN(n) || typeof n != "object" || !(n instanceof Date) || isNaN(n) ? e : new Intl.DateTimeFormat(o, {
|
|
18
18
|
numberingSystem: "latn",
|
|
19
19
|
calendar: "gregory",
|
|
20
|
-
...
|
|
21
|
-
}).format(
|
|
22
|
-
},
|
|
23
|
-
const [
|
|
24
|
-
return
|
|
25
|
-
hour:
|
|
26
|
-
minute:
|
|
20
|
+
...r
|
|
21
|
+
}).format(n);
|
|
22
|
+
}, p = (t) => {
|
|
23
|
+
const [e, r] = t.split(":");
|
|
24
|
+
return r ? {
|
|
25
|
+
hour: e.replace(/_/g, "0"),
|
|
26
|
+
minute: r.replace(/_/g, "0")
|
|
27
27
|
} : {
|
|
28
28
|
hour: "0",
|
|
29
29
|
minute: "0"
|
|
30
30
|
};
|
|
31
|
-
}, h = (
|
|
31
|
+
}, h = (t) => (a.updateLocale("en", {
|
|
32
32
|
relativeTime: {
|
|
33
33
|
future: "in %s",
|
|
34
34
|
past: "%s ago",
|
|
@@ -47,17 +47,17 @@ const c = m(), d = (e, t, n = {
|
|
|
47
47
|
y: "a year",
|
|
48
48
|
yy: "%d years"
|
|
49
49
|
}
|
|
50
|
-
}), a.utc(
|
|
51
|
-
const s = Date.parse(o[
|
|
52
|
-
return
|
|
50
|
+
}), a.utc(t).fromNow()), y = (t, e) => a(t).format(e), f = (t = [], e, r = !0) => [...t].sort((o, n) => {
|
|
51
|
+
const s = Date.parse(o[e]), u = Date.parse(n[e]);
|
|
52
|
+
return r ? s - u : u - s;
|
|
53
53
|
});
|
|
54
54
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
g as formatDatetime,
|
|
56
|
+
y as getDateAndTimeByFormat,
|
|
57
|
+
p as getFormatTime,
|
|
58
|
+
c as getSupportedLocale,
|
|
59
59
|
h as getTimeElapsedByDate,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
f as sortListByDate,
|
|
61
|
+
m as supportedLocale
|
|
62
62
|
};
|
|
63
63
|
//# sourceMappingURL=datetime.util.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime.util.mjs","sources":["../../src/lib/utils/datetime.util.js"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport moment from 'moment'\n\nexport function getSupportedLocale() {\n const SUPPORTED_LOCALES = new Set(['en-GB', 'en-US'])\n\n const userLocales = navigator.languages || [navigator.language]\n\n // browser always returns locales in descending order of preference\n const match = userLocales.find(locale => SUPPORTED_LOCALES.has(locale))\n\n return match || 'en-US'\n}\n\nexport const supportedLocale = getSupportedLocale()\n\nexport const formatDatetime = (\n datetime,\n invalidDateMessage,\n options = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n },\n locale = supportedLocale\n) => {\n if (!datetime) {\n return invalidDateMessage\n }\n\n const date = new Date(datetime)\n\n if (isNaN(date)) {\n return invalidDateMessage\n }\n\n return typeof date !== 'object' || !(date instanceof Date) || isNaN(date)\n ? invalidDateMessage\n : new Intl.DateTimeFormat(locale, {\n numberingSystem: 'latn',\n calendar: 'gregory',\n ...options\n }).format(date)\n}\n\nexport const getFormatTime = time => {\n const [hour, minute] = time.split(':')\n if (!minute) {\n return {\n hour: '0',\n minute: '0'\n }\n }\n return {\n hour: hour.replace(/_/g, '0'),\n minute: minute.replace(/_/g, '0')\n }\n}\n\nexport const getTimeElapsedByDate = creationDate => {\n moment.updateLocale('en', {\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years'\n }\n })\n\n const time = moment.utc(creationDate)\n\n return time.fromNow()\n}\n\nexport const getDateAndTimeByFormat = (date, dateFormat) => {\n return moment(date).format(dateFormat)\n}\n\nexport const sortListByDate = (list = [], field, isAscending = true) => {\n return [...list].sort((prevElem, nextElem) => {\n const prev = Date.parse(prevElem[field])\n const next = Date.parse(nextElem[field])\n\n return isAscending ? prev - next : next - prev\n })\n}\n"],"names":["getSupportedLocale","SUPPORTED_LOCALES","locale","supportedLocale","
|
|
1
|
+
{"version":3,"file":"datetime.util.mjs","sources":["../../src/lib/utils/datetime.util.js"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport moment from 'moment'\n\nexport function getSupportedLocale() {\n const SUPPORTED_LOCALES = new Set(['en-GB', 'en-US'])\n\n const userLocales = navigator.languages || [navigator.language]\n\n // browser always returns locales in descending order of preference\n const match = userLocales.find(locale => SUPPORTED_LOCALES.has(locale))\n\n return match || 'en-US'\n}\n\nexport const supportedLocale = getSupportedLocale()\n\nconst normalizeDatetimeString = datetime => {\n if (\n typeof datetime === 'string' &&\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}/.test(datetime) &&\n !/Z$|[+-]\\d{2}:?\\d{2}$/.test(datetime)\n ) {\n return datetime + 'Z'\n }\n\n return datetime\n}\n\nexport const formatDatetime = (\n datetime,\n invalidDateMessage,\n options = {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n },\n locale = supportedLocale\n) => {\n if (!datetime) {\n return invalidDateMessage\n }\n\n const date = new Date(normalizeDatetimeString(datetime))\n\n if (isNaN(date)) {\n return invalidDateMessage\n }\n\n return typeof date !== 'object' || !(date instanceof Date) || isNaN(date)\n ? invalidDateMessage\n : new Intl.DateTimeFormat(locale, {\n numberingSystem: 'latn',\n calendar: 'gregory',\n ...options\n }).format(date)\n}\n\nexport const getFormatTime = time => {\n const [hour, minute] = time.split(':')\n if (!minute) {\n return {\n hour: '0',\n minute: '0'\n }\n }\n return {\n hour: hour.replace(/_/g, '0'),\n minute: minute.replace(/_/g, '0')\n }\n}\n\nexport const getTimeElapsedByDate = creationDate => {\n moment.updateLocale('en', {\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years'\n }\n })\n\n const time = moment.utc(creationDate)\n\n return time.fromNow()\n}\n\nexport const getDateAndTimeByFormat = (date, dateFormat) => {\n return moment(date).format(dateFormat)\n}\n\nexport const sortListByDate = (list = [], field, isAscending = true) => {\n return [...list].sort((prevElem, nextElem) => {\n const prev = Date.parse(prevElem[field])\n const next = Date.parse(nextElem[field])\n\n return isAscending ? prev - next : next - prev\n })\n}\n"],"names":["getSupportedLocale","SUPPORTED_LOCALES","locale","supportedLocale","normalizeDatetimeString","datetime","formatDatetime","invalidDateMessage","options","date","getFormatTime","time","hour","minute","getTimeElapsedByDate","creationDate","moment","getDateAndTimeByFormat","dateFormat","sortListByDate","list","field","isAscending","prevElem","nextElem","prev","next"],"mappings":";AAqBO,SAASA,IAAqB;AACnC,QAAMC,IAAoB,oBAAI,IAAI,CAAC,SAAS,OAAO,CAAC;AAOpD,UALoB,UAAU,aAAa,CAAC,UAAU,QAAQ,GAGpC,KAAK,CAAAC,MAAUD,EAAkB,IAAIC,CAAM,CAAC,KAEtD;AAClB;AAEY,MAACC,IAAkBH,EAAkB,GAE3CI,IAA0B,CAAAC,MAE5B,OAAOA,KAAa,YACpB,iCAAiC,KAAKA,CAAQ,KAC9C,CAAC,uBAAuB,KAAKA,CAAQ,IAE9BA,IAAW,MAGbA,GAGIC,IAAiB,CAC5BD,GACAE,GACAC,IAAU;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACZ,GACEN,IAASC,MACN;AACH,MAAI,CAACE;AACH,WAAOE;AAGT,QAAME,IAAO,IAAI,KAAKL,EAAwBC,CAAQ,CAAC;AAEvD,SAAI,MAAMI,CAAI,KAIP,OAAOA,KAAS,YAAY,EAAEA,aAAgB,SAAS,MAAMA,CAAI,IAH/DF,IAKL,IAAI,KAAK,eAAeL,GAAQ;AAAA,IAC9B,iBAAiB;AAAA,IACjB,UAAU;AAAA,IACV,GAAGM;AAAA,EACX,CAAO,EAAE,OAAOC,CAAI;AACpB,GAEaC,IAAgB,CAAAC,MAAQ;AACnC,QAAM,CAACC,GAAMC,CAAM,IAAIF,EAAK,MAAM,GAAG;AACrC,SAAKE,IAME;AAAA,IACL,MAAMD,EAAK,QAAQ,MAAM,GAAG;AAAA,IAC5B,QAAQC,EAAO,QAAQ,MAAM,GAAG;AAAA,EACpC,IARW;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,EACd;AAMA,GAEaC,IAAuB,CAAAC,OAClCC,EAAO,aAAa,MAAM;AAAA,EACxB,cAAc;AAAA,IACZ,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,GAAG;AAAA,IACH,IAAI;AAAA,EACV;AACA,CAAG,GAEYA,EAAO,IAAID,CAAY,EAExB,QAAO,IAGRE,IAAyB,CAACR,GAAMS,MACpCF,EAAOP,CAAI,EAAE,OAAOS,CAAU,GAG1BC,IAAiB,CAACC,IAAO,CAAA,GAAIC,GAAOC,IAAc,OACtD,CAAC,GAAGF,CAAI,EAAE,KAAK,CAACG,GAAUC,MAAa;AAC5C,QAAMC,IAAO,KAAK,MAAMF,EAASF,CAAK,CAAC,GACjCK,IAAO,KAAK,MAAMF,EAASH,CAAK,CAAC;AAEvC,SAAOC,IAAcG,IAAOC,IAAOA,IAAOD;AAC5C,CAAC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.26",
|
|
4
4
|
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
"react-final-form-arrays": "^3.1.4",
|
|
120
120
|
"react-modal-promise": "^1.0.2",
|
|
121
121
|
"react-redux": "^7.2.9",
|
|
122
|
-
"react-router-dom": "6.30.
|
|
122
|
+
"react-router-dom": "^6.30.4",
|
|
123
123
|
"react-transition-group": "^4.4.5",
|
|
124
124
|
"sass": "^1.72.0",
|
|
125
125
|
"tsup": "^8.3.6",
|
|
126
126
|
"typescript": "^5.7.3",
|
|
127
127
|
"typescript-eslint": "^8.23.0",
|
|
128
|
-
"vite": "^6.4.
|
|
128
|
+
"vite": "^6.4.3",
|
|
129
129
|
"vite-plugin-commonjs": "^0.10.4",
|
|
130
130
|
"vite-plugin-eslint": "^1.8.1",
|
|
131
131
|
"vite-plugin-static-copy": "^2.2.0",
|