iguazio.dashboard-react-controls 3.2.25 → 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.
@@ -1,8 +1,9 @@
1
- import { ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { TooltipContent } from '@/components/ui/tooltip';
2
3
  type EllipsisTooltipProps = {
3
4
  children: ReactNode;
4
5
  className?: string;
5
- };
6
- declare const EllipsisTooltip: ({ children, className }: EllipsisTooltipProps) => import("react/jsx-runtime").JSX.Element;
6
+ } & Omit<ComponentPropsWithoutRef<typeof TooltipContent>, 'children'>;
7
+ declare const EllipsisTooltip: ({ children, className, ...tooltipContentProps }: EllipsisTooltipProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export default EllipsisTooltip;
8
9
  //# sourceMappingURL=EllipsisTooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EllipsisTooltip.d.ts","sourceRoot":"","sources":["../../../../src/lib/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAA;AAK9D,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,QAAA,MAAM,eAAe,GAAI,yBAAyB,oBAAoB,4CA0BrE,CAAA;AAED,eAAe,eAAe,CAAA"}
1
+ {"version":3,"file":"EllipsisTooltip.d.ts","sourceRoot":"","sources":["../../../../src/lib/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAA;AAE7E,OAAO,EAAW,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAGjF,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,EAAE,UAAU,CAAC,CAAA;AAErE,QAAA,MAAM,eAAe,GAAI,iDAAiD,oBAAoB,4CA6B7F,CAAA;AAED,eAAe,eAAe,CAAA"}
@@ -1,20 +1,28 @@
1
- import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import { useRef as f, useState as a, useEffect as d } from "react";
3
- import { Tooltip as u, TooltipTrigger as m, TooltipContent as p } from "../ui/tooltip.mjs";
4
- import { cn as x } from "../../lib/utils.mjs";
5
- const N = ({ children: e, className: i }) => {
6
- const s = f(null), [l, n] = a(!1);
7
- d(() => {
8
- const o = s.current;
9
- o && n(o.scrollWidth > o.clientWidth);
10
- }, [e]);
11
- const r = /* @__PURE__ */ t("div", { ref: s, className: x("truncate overflow-hidden text-ellipsis w-full", i), children: e });
12
- return l ? /* @__PURE__ */ c(u, { children: [
13
- /* @__PURE__ */ t(m, { asChild: !0, children: r }),
14
- /* @__PURE__ */ t(p, { className: "break-words *:text-white [&_*]:text-white", children: /* @__PURE__ */ t("div", { className: "select-text", children: e }) })
15
- ] }) : r;
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import { useRef as d, useState as p } from "react";
3
+ import { Tooltip as u, TooltipTrigger as h, TooltipContent as m } from "../ui/tooltip.mjs";
4
+ import { cn as w } from "../../lib/utils.mjs";
5
+ const C = ({ children: o, className: s, ...l }) => {
6
+ const e = d(null), [n, r] = p(!1), i = (a) => {
7
+ if (!a) {
8
+ r(!1);
9
+ return;
10
+ }
11
+ e.current && r(e.current.scrollWidth > e.current.clientWidth);
12
+ }, c = /* @__PURE__ */ t("div", { ref: e, className: w("truncate overflow-hidden text-ellipsis w-full", s), children: o });
13
+ return /* @__PURE__ */ f(u, { open: n, onOpenChange: i, children: [
14
+ /* @__PURE__ */ t(h, { asChild: !0, children: c }),
15
+ /* @__PURE__ */ t(
16
+ m,
17
+ {
18
+ className: "break-words *:text-white [&_*]:text-white",
19
+ ...l,
20
+ children: /* @__PURE__ */ t("div", { className: "select-text", children: o })
21
+ }
22
+ )
23
+ ] });
16
24
  };
17
25
  export {
18
- N as default
26
+ C as default
19
27
  };
20
28
  //# sourceMappingURL=EllipsisTooltip.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EllipsisTooltip.mjs","sources":["../../../../src/lib/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, useState } from 'react'\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'\nimport { cn } from '@/lib/utils'\n\ntype EllipsisTooltipProps = {\n children: ReactNode\n className?: string\n}\n\nconst EllipsisTooltip = ({ children, className }: EllipsisTooltipProps) => {\n const ref = useRef<HTMLDivElement>(null)\n const [isOverflowed, setIsOverflowed] = useState(false)\n\n useEffect(() => {\n const text = ref.current\n if (!text) return\n setIsOverflowed(text.scrollWidth > text.clientWidth)\n }, [children])\n\n const content = (\n <div ref={ref} className={cn('truncate overflow-hidden text-ellipsis w-full', className)}>\n {children}\n </div>\n )\n\n if (!isOverflowed) return content\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{content}</TooltipTrigger>\n <TooltipContent className=\"break-words *:text-white [&_*]:text-white\">\n <div className=\"select-text\">{children}</div>\n </TooltipContent>\n </Tooltip>\n )\n}\n\nexport default EllipsisTooltip\n"],"names":["EllipsisTooltip","children","className","ref","useRef","isOverflowed","setIsOverflowed","useState","useEffect","text","content","cn","Tooltip","jsx","TooltipTrigger","TooltipContent"],"mappings":";;;;AAUA,MAAMA,IAAkB,CAAC,EAAE,UAAAC,GAAU,WAAAC,QAAsC;AACzE,QAAMC,IAAMC,EAAuB,IAAI,GACjC,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK;AAEtD,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAON,EAAI;AACjB,IAAKM,KACLH,EAAgBG,EAAK,cAAcA,EAAK,WAAW;AAAA,EACrD,GAAG,CAACR,CAAQ,CAAC;AAEb,QAAMS,sBACH,OAAA,EAAI,KAAAP,GAAU,WAAWQ,EAAG,iDAAiDT,CAAS,GACpF,UAAAD,EAAA,CACH;AAGF,SAAKI,sBAGFO,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAe,SAAO,IAAE,UAAAJ,GAAQ;AAAA,IACjC,gBAAAG,EAACE,KAAe,WAAU,6CACxB,4BAAC,OAAA,EAAI,WAAU,eAAe,UAAAd,EAAA,CAAS,EAAA,CACzC;AAAA,EAAA,GACF,IARwBS;AAU5B;"}
1
+ {"version":3,"file":"EllipsisTooltip.mjs","sources":["../../../../src/lib/nextGenComponents/components/EllipsisTooltip/EllipsisTooltip.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef, ReactNode, useRef, useState } from 'react'\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'\nimport { cn } from '@/lib/utils'\n\ntype EllipsisTooltipProps = {\n children: ReactNode\n className?: string\n} & Omit<ComponentPropsWithoutRef<typeof TooltipContent>, 'children'>\n\nconst EllipsisTooltip = ({ children, className, ...tooltipContentProps }: EllipsisTooltipProps) => {\n const ref = useRef<HTMLDivElement>(null)\n const [isOverflowed, setIsOverflowed] = useState(false)\n\n const handleOpenChange = (open: boolean) => {\n if (!open) {\n setIsOverflowed(false)\n return\n }\n if (ref.current) setIsOverflowed(ref.current.scrollWidth > ref.current.clientWidth)\n }\n\n const content = (\n <div ref={ref} className={cn('truncate overflow-hidden text-ellipsis w-full', className)}>\n {children}\n </div>\n )\n\n return (\n <Tooltip open={isOverflowed} onOpenChange={handleOpenChange}>\n <TooltipTrigger asChild>{content}</TooltipTrigger>\n <TooltipContent\n className=\"break-words *:text-white [&_*]:text-white\"\n {...tooltipContentProps}\n >\n <div className=\"select-text\">{children}</div>\n </TooltipContent>\n </Tooltip>\n )\n}\n\nexport default EllipsisTooltip\n"],"names":["EllipsisTooltip","children","className","tooltipContentProps","ref","useRef","isOverflowed","setIsOverflowed","useState","handleOpenChange","open","content","cn","jsxs","Tooltip","jsx","TooltipTrigger","TooltipContent"],"mappings":";;;;AAUA,MAAMA,IAAkB,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,QAAgD;AACjG,QAAMC,IAAMC,EAAuB,IAAI,GACjC,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK,GAEhDC,IAAmB,CAACC,MAAkB;AAC1C,QAAI,CAACA,GAAM;AACT,MAAAH,EAAgB,EAAK;AACrB;AAAA,IACF;AACA,IAAIH,EAAI,WAASG,EAAgBH,EAAI,QAAQ,cAAcA,EAAI,QAAQ,WAAW;AAAA,EACpF,GAEMO,sBACH,OAAA,EAAI,KAAAP,GAAU,WAAWQ,EAAG,iDAAiDV,CAAS,GACpF,UAAAD,EAAA,CACH;AAGF,SACE,gBAAAY,EAACC,GAAA,EAAQ,MAAMR,GAAc,cAAcG,GACzC,UAAA;AAAA,IAAA,gBAAAM,EAACC,GAAA,EAAe,SAAO,IAAE,UAAAL,GAAQ;AAAA,IACjC,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACT,GAAGd;AAAA,QAEJ,UAAA,gBAAAY,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAd,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EACzC,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"datetime.util.d.ts","sourceRoot":"","sources":["../../src/lib/utils/datetime.util.js"],"names":[],"mappings":"AAqBA,6CASC;AAED,qCAAmD;AAE5C;;;;;;;yBA8BN;AAEM;;;EAYN;AAEM,gEAyBN;AAEM,2EAEN;AAEM,kGAON"}
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 m() {
3
- const e = /* @__PURE__ */ new Set(["en-GB", "en-US"]);
4
- return (navigator.languages || [navigator.language]).find((o) => e.has(o)) || "en-US";
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 c = m(), d = (e, t, n = {
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 = c) => {
14
- if (!e)
15
- return t;
16
- const r = new Date(e);
17
- return isNaN(r) || typeof r != "object" || !(r instanceof Date) || isNaN(r) ? t : new Intl.DateTimeFormat(o, {
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
- ...n
21
- }).format(r);
22
- }, g = (e) => {
23
- const [t, n] = e.split(":");
24
- return n ? {
25
- hour: t.replace(/_/g, "0"),
26
- minute: n.replace(/_/g, "0")
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 = (e) => (a.updateLocale("en", {
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(e).fromNow()), p = (e, t) => a(e).format(t), y = (e = [], t, n = !0) => [...e].sort((o, r) => {
51
- const s = Date.parse(o[t]), u = Date.parse(r[t]);
52
- return n ? s - u : u - s;
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
- d as formatDatetime,
56
- p as getDateAndTimeByFormat,
57
- g as getFormatTime,
58
- m as getSupportedLocale,
55
+ g as formatDatetime,
56
+ y as getDateAndTimeByFormat,
57
+ p as getFormatTime,
58
+ c as getSupportedLocale,
59
59
  h as getTimeElapsedByDate,
60
- y as sortListByDate,
61
- c as supportedLocale
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","formatDatetime","datetime","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,GAEpCI,IAAiB,CAC5BC,GACAC,GACAC,IAAU;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACZ,GACEL,IAASC,MACN;AACH,MAAI,CAACE;AACH,WAAOC;AAGT,QAAME,IAAO,IAAI,KAAKH,CAAQ;AAE9B,SAAI,MAAMG,CAAI,KAIP,OAAOA,KAAS,YAAY,EAAEA,aAAgB,SAAS,MAAMA,CAAI,IAH/DF,IAKL,IAAI,KAAK,eAAeJ,GAAQ;AAAA,IAC9B,iBAAiB;AAAA,IACjB,UAAU;AAAA,IACV,GAAGK;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;"}
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.25",
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.3",
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.2",
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",