iguazio.dashboard-react-controls 3.1.0 → 3.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsMenu.d.ts","sourceRoot":"","sources":["../../../src/lib/components/ActionsMenu/ActionsMenu.jsx"],"names":[],"mappings":";AAkCA;;;;;;gBAmJC"}
1
+ {"version":3,"file":"ActionsMenu.d.ts","sourceRoot":"","sources":["../../../src/lib/components/ActionsMenu/ActionsMenu.jsx"],"names":[],"mappings":";AAkCA;;;;;;gBAqJC"}
@@ -1,62 +1,61 @@
1
- import { jsxs as v, jsx as t } from "react/jsx-runtime";
2
- import { useState as f, useRef as l, useCallback as w, useEffect as p } from "react";
1
+ import { jsxs as M, jsx as n } from "react/jsx-runtime";
2
+ import { useState as f, useRef as a, useCallback as g, useEffect as p } from "react";
3
3
  import s from "prop-types";
4
- import { isEmpty as S } from "lodash";
5
- import D from "classnames";
6
- import L from "../../elements/ActionsMenuItem/ActionsMenuItem.mjs";
7
- import P from "../PopUpDialog/PopUpDialog.mjs";
4
+ import { isEmpty as D } from "lodash";
5
+ import L from "classnames";
6
+ import P from "../../elements/ActionsMenuItem/ActionsMenuItem.mjs";
7
+ import j from "../PopUpDialog/PopUpDialog.mjs";
8
8
  import k from "../RoundedIcon/RoundedIcon.mjs";
9
- import { ACTIONS_MENU as j } from "../../types.mjs";
9
+ import { ACTIONS_MENU as q } from "../../types.mjs";
10
10
  import H from "../../images/elipsis.svg.mjs";
11
11
  /* empty css */
12
12
  const I = ({
13
13
  dataItem: i = {},
14
14
  menu: c,
15
- menuPosition: _ = "",
15
+ menuPosition: h = "",
16
16
  time: y = 100,
17
- withQuickActions: b = !1
17
+ withQuickActions: _ = !1
18
18
  }) => {
19
- const [r, N] = f(c), [T, g] = f(!1), [a, o] = f(!1), E = l(), M = l(), x = l(), h = l();
19
+ const [[o, b], N] = f(c), [T, E] = f(!1), [r, t] = f(!1), x = a(), v = a(), C = a(), w = a();
20
20
  let d = null;
21
- const R = D(
21
+ const R = L(
22
22
  "actions-menu__container",
23
- b && "actions-menu__container_extended",
24
- a && "actions-menu__container-active"
25
- ), u = w(
23
+ _ && (o.length > 0 || b.length > 1) && "actions-menu__container_extended",
24
+ r && "actions-menu__container-active"
25
+ ), u = g(
26
26
  (e) => {
27
- e.target.closest(".actions-menu-button") || o(!1);
27
+ e.target.closest(".actions-menu-button") || t(!1);
28
28
  },
29
- [o]
30
- ), m = w(
29
+ [t]
30
+ ), m = g(
31
31
  (e) => {
32
- e.target.closest(".actions-menu__body") || o(!1);
32
+ e.target.closest(".actions-menu__body") || t(!1);
33
33
  },
34
- [o]
35
- ), C = () => {
36
- a && (d = setTimeout(() => {
37
- o(!1);
34
+ [t]
35
+ ), O = () => {
36
+ r && (d = setTimeout(() => {
37
+ t(!1);
38
38
  }, y));
39
- }, O = (e) => {
40
- var n;
41
- (n = h.current) != null && n.contains(e.target) && o(!1), d && clearTimeout(d);
39
+ }, S = (e) => {
40
+ var l;
41
+ (l = w.current) != null && l.contains(e.target) && t(!1), d && clearTimeout(d);
42
42
  };
43
43
  return p(() => {
44
- S(i) || N(typeof c == "function" ? c(i, _) : c);
45
- }, [i, c, _]), p(() => {
46
- var e;
47
- g((e = r[0]) == null ? void 0 : e.some((n) => n.icon));
48
- }, [r]), p(() => (window.addEventListener("click", u), window.addEventListener("scroll", m, !0), () => {
44
+ D(i) || N(typeof c == "function" ? c(i, h) : c);
45
+ }, [i, c, h]), p(() => {
46
+ E(o == null ? void 0 : o.some((e) => e.icon));
47
+ }, [o]), p(() => (window.addEventListener("click", u), window.addEventListener("scroll", m, !0), () => {
49
48
  window.removeEventListener("click", u), window.removeEventListener("scroll", m, !0);
50
- }), [u, m]), /* @__PURE__ */ v(
49
+ }), [u, m]), /* @__PURE__ */ M(
51
50
  "div",
52
51
  {
53
52
  className: R,
54
- onMouseOut: C,
55
- onMouseOver: O,
56
- ref: E,
53
+ onMouseOut: O,
54
+ onMouseOver: S,
55
+ ref: x,
57
56
  children: [
58
- b && /* @__PURE__ */ t("div", { className: "actions-menu__main-actions-wrapper", ref: h, children: r[1].map(
59
- (e) => !e.hidden && /* @__PURE__ */ t(
57
+ _ && /* @__PURE__ */ n("div", { className: "actions-menu__main-actions-wrapper", ref: w, children: b.map(
58
+ (e) => !e.hidden && /* @__PURE__ */ n(
60
59
  k,
61
60
  {
62
61
  disabled: e.disabled,
@@ -68,38 +67,38 @@ const I = ({
68
67
  e.label
69
68
  )
70
69
  ) }),
71
- r[0].length > 0 && /* @__PURE__ */ v("div", { className: "actions-menu", "data-testid": "actions-menu", children: [
72
- /* @__PURE__ */ t(
70
+ o.length > 0 && /* @__PURE__ */ M("div", { className: "actions-menu", "data-testid": "actions-menu", children: [
71
+ /* @__PURE__ */ n(
73
72
  k,
74
73
  {
75
74
  className: "actions-menu-button",
76
- isActive: a,
75
+ isActive: r,
77
76
  id: "actions-menu-button",
78
77
  onClick: () => {
79
- o((e) => !e);
78
+ t((e) => !e);
80
79
  },
81
- ref: M,
80
+ ref: v,
82
81
  tooltipText: "More actions",
83
- children: /* @__PURE__ */ t(H, {})
82
+ children: /* @__PURE__ */ n(H, {})
84
83
  }
85
84
  ),
86
- a && /* @__PURE__ */ t(
87
- P,
85
+ r && /* @__PURE__ */ n(
86
+ j,
88
87
  {
89
88
  className: "actions-menu__body",
90
89
  customPosition: {
91
- element: M,
90
+ element: v,
92
91
  position: "bottom-left",
93
92
  autoVerticalPosition: !0
94
93
  },
95
94
  headerIsHidden: !0,
96
- ref: x,
97
- children: /* @__PURE__ */ t("ul", { "data-testid": "actions-drop-down-menu", className: "actions-menu__list", children: r[0].map(
98
- (e, n) => !e.hidden && /* @__PURE__ */ t(
99
- L,
95
+ ref: C,
96
+ children: /* @__PURE__ */ n("ul", { "data-testid": "actions-drop-down-menu", className: "actions-menu__list", children: o.map(
97
+ (e, l) => !e.hidden && /* @__PURE__ */ n(
98
+ P,
100
99
  {
101
100
  dataItem: i,
102
- index: n,
101
+ index: l,
103
102
  isIconDisplayed: T,
104
103
  menuItem: e
105
104
  },
@@ -115,7 +114,7 @@ const I = ({
115
114
  };
116
115
  I.propTypes = {
117
116
  dataItem: s.oneOfType([s.object, s.string]),
118
- menu: j.isRequired,
117
+ menu: q.isRequired,
119
118
  menuPosition: s.string,
120
119
  time: s.number,
121
120
  withQuickActions: s.bool
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsMenu.mjs","sources":["../../../src/lib/components/ActionsMenu/ActionsMenu.jsx"],"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 React, { useCallback, useEffect, useRef, useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { isEmpty } from 'lodash'\nimport classnames from 'classnames'\n\nimport ActionsMenuItem from '../../elements/ActionsMenuItem/ActionsMenuItem'\nimport PopUpDialog from '../PopUpDialog/PopUpDialog'\nimport RoundedIcon from '../RoundedIcon/RoundedIcon'\n\nimport { ACTIONS_MENU } from '../../types'\n\nimport ActionMenuIcon from '../../images/elipsis.svg?react'\n\nimport './actionsMenu.scss'\n\nconst ActionsMenu = ({\n dataItem = {},\n menu,\n menuPosition = '',\n time = 100,\n withQuickActions = false\n}) => {\n const [actionMenu, setActionMenu] = useState(menu)\n const [isIconDisplayed, setIsIconDisplayed] = useState(false)\n const [isShowMenu, setIsShowMenu] = useState(false)\n const actionMenuRef = useRef()\n const actionMenuBtnRef = useRef()\n const dropDownMenuRef = useRef()\n const mainActionsWrapperRef = useRef()\n\n let idTimeout = null\n\n const actionMenuClassNames = classnames(\n 'actions-menu__container',\n withQuickActions && 'actions-menu__container_extended',\n isShowMenu && 'actions-menu__container-active'\n )\n\n const clickHandler = useCallback(\n event => {\n if (!event.target.closest('.actions-menu-button')) {\n setIsShowMenu(false)\n }\n },\n [setIsShowMenu]\n )\n\n const scrollHandler = useCallback(\n event => {\n if (!event.target.closest('.actions-menu__body')) {\n setIsShowMenu(false)\n }\n },\n [setIsShowMenu]\n )\n\n const onMouseOut = () => {\n if (isShowMenu) {\n idTimeout = setTimeout(() => {\n setIsShowMenu(false)\n }, time)\n }\n }\n\n const handleMouseOver = event => {\n if (mainActionsWrapperRef.current?.contains(event.target)) {\n setIsShowMenu(false)\n }\n\n if (idTimeout) clearTimeout(idTimeout)\n }\n\n useEffect(() => {\n if (!isEmpty(dataItem)) {\n setActionMenu(typeof menu === 'function' ? menu(dataItem, menuPosition) : menu)\n }\n }, [dataItem, menu, menuPosition])\n\n useEffect(() => {\n setIsIconDisplayed(actionMenu[0]?.some(menuItem => menuItem.icon))\n }, [actionMenu])\n\n useEffect(() => {\n window.addEventListener('click', clickHandler)\n window.addEventListener('scroll', scrollHandler, true)\n\n return () => {\n window.removeEventListener('click', clickHandler)\n window.removeEventListener('scroll', scrollHandler, true)\n }\n }, [clickHandler, scrollHandler])\n\n return (\n <div\n className={actionMenuClassNames}\n onMouseOut={onMouseOut}\n onMouseOver={handleMouseOver}\n ref={actionMenuRef}\n >\n {withQuickActions && (\n <div className=\"actions-menu__main-actions-wrapper\" ref={mainActionsWrapperRef}>\n {actionMenu[1].map(\n mainAction =>\n !mainAction.hidden && (\n <RoundedIcon\n disabled={mainAction.disabled}\n id={`quick-link-${mainAction.id}`}\n onClick={() => mainAction.onClick(dataItem)}\n tooltipText={mainAction.label}\n key={mainAction.label}\n >\n {mainAction.icon}\n </RoundedIcon>\n )\n )}\n </div>\n )}\n {actionMenu[0].length > 0 && (\n <div className=\"actions-menu\" data-testid=\"actions-menu\">\n <RoundedIcon\n className=\"actions-menu-button\"\n isActive={isShowMenu}\n id=\"actions-menu-button\"\n onClick={() => {\n setIsShowMenu(prevValue => !prevValue)\n }}\n ref={actionMenuBtnRef}\n tooltipText=\"More actions\"\n >\n <ActionMenuIcon />\n </RoundedIcon>\n {isShowMenu && (\n <PopUpDialog\n className=\"actions-menu__body\"\n customPosition={{\n element: actionMenuBtnRef,\n position: 'bottom-left',\n autoVerticalPosition: true\n }}\n headerIsHidden\n ref={dropDownMenuRef}\n >\n <ul data-testid=\"actions-drop-down-menu\" className=\"actions-menu__list\">\n {actionMenu[0].map(\n (menuItem, idx) =>\n !menuItem.hidden && (\n <ActionsMenuItem\n dataItem={dataItem}\n index={idx}\n isIconDisplayed={isIconDisplayed}\n key={menuItem.label}\n menuItem={menuItem}\n />\n )\n )}\n </ul>\n </PopUpDialog>\n )}\n </div>\n )}\n </div>\n )\n}\n\nActionsMenu.propTypes = {\n dataItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n menu: ACTIONS_MENU.isRequired,\n menuPosition: PropTypes.string,\n time: PropTypes.number,\n withQuickActions: PropTypes.bool\n}\n\nexport default ActionsMenu\n"],"names":["ActionsMenu","dataItem","menu","menuPosition","time","withQuickActions","actionMenu","setActionMenu","useState","isIconDisplayed","setIsIconDisplayed","isShowMenu","setIsShowMenu","actionMenuRef","useRef","actionMenuBtnRef","dropDownMenuRef","mainActionsWrapperRef","idTimeout","actionMenuClassNames","classnames","clickHandler","useCallback","event","scrollHandler","onMouseOut","handleMouseOver","_a","useEffect","isEmpty","menuItem","jsxs","jsx","mainAction","RoundedIcon","prevValue","ActionMenuIcon","PopUpDialog","idx","ActionsMenuItem","PropTypes","ACTIONS_MENU"],"mappings":";;;;;;;;;;;AAkCA,MAAMA,IAAc,CAAC;AAAA,EACnB,UAAAC,IAAW,CAAC;AAAA,EACZ,MAAAC;AAAA,EACA,cA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AAU;AAAA,cACV,gBAAgB;AAAA,gBACd,SAAStB;AAAA,gBACT,UAAU;AAAA,gBACV,sBAAsB;AAAA,cACxB;AAAA,cACA,gBAAc;AAAA,cACd,KAAKC;AAAA,cAEL,UAAA,gBAAAgB,EAAC,QAAG,eAAY,0BAAyB,WAAU,sBAChD,UAAA1B,EAAW,CAAC,EAAE;AAAA,gBACb,CAACwB,GAAUQ,MACT,CAACR,EAAS,UACR,gBAAAE;AAAA,kBAACO;AAAA,kBAAA;AAAA,oBACC,UAAAtC;AAAA,oBACA,OAAOqC;AAAA,oBACP,iBAAA7B;AAAA,oBAEA,UAAAqB;AAAA,kBAAA;AAAA,kBADKA,EAAS;AAAA,gBAAA;AAAA,cAEhB,EAGR,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAEJ,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ;AAEA9B,EAAY,YAAY;AAAA,EACtB,UAAUwC,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,MAAM,CAAC;AAAA,EAClE,MAAMC,EAAa;AAAA,EACnB,cAAcD,EAAU;AAAA,EACxB,MAAMA,EAAU;AAAA,EAChB,kBAAkBA,EAAU;AAC9B;"}
1
+ {"version":3,"file":"ActionsMenu.mjs","sources":["../../../src/lib/components/ActionsMenu/ActionsMenu.jsx"],"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 React, { useCallback, useEffect, useRef, useState } from 'react'\nimport PropTypes from 'prop-types'\nimport { isEmpty } from 'lodash'\nimport classnames from 'classnames'\n\nimport ActionsMenuItem from '../../elements/ActionsMenuItem/ActionsMenuItem'\nimport PopUpDialog from '../PopUpDialog/PopUpDialog'\nimport RoundedIcon from '../RoundedIcon/RoundedIcon'\n\nimport { ACTIONS_MENU } from '../../types'\n\nimport ActionMenuIcon from '../../images/elipsis.svg?react'\n\nimport './actionsMenu.scss'\n\nconst ActionsMenu = ({\n dataItem = {},\n menu,\n menuPosition = '',\n time = 100,\n withQuickActions = false\n}) => {\n const [[actionMenu, quickActions], setActionMenuContent] = useState(menu)\n const [isIconDisplayed, setIsIconDisplayed] = useState(false)\n const [isShowMenu, setIsShowMenu] = useState(false)\n const actionMenuRef = useRef()\n const actionMenuBtnRef = useRef()\n const dropDownMenuRef = useRef()\n const mainActionsWrapperRef = useRef()\n\n let idTimeout = null\n\n const actionMenuClassNames = classnames(\n 'actions-menu__container',\n withQuickActions &&\n (actionMenu.length > 0 || quickActions.length > 1) &&\n 'actions-menu__container_extended',\n isShowMenu && 'actions-menu__container-active'\n )\n\n const clickHandler = useCallback(\n event => {\n if (!event.target.closest('.actions-menu-button')) {\n setIsShowMenu(false)\n }\n },\n [setIsShowMenu]\n )\n\n const scrollHandler = useCallback(\n event => {\n if (!event.target.closest('.actions-menu__body')) {\n setIsShowMenu(false)\n }\n },\n [setIsShowMenu]\n )\n\n const onMouseOut = () => {\n if (isShowMenu) {\n idTimeout = setTimeout(() => {\n setIsShowMenu(false)\n }, time)\n }\n }\n\n const handleMouseOver = event => {\n if (mainActionsWrapperRef.current?.contains(event.target)) {\n setIsShowMenu(false)\n }\n\n if (idTimeout) clearTimeout(idTimeout)\n }\n\n useEffect(() => {\n if (!isEmpty(dataItem)) {\n setActionMenuContent(typeof menu === 'function' ? menu(dataItem, menuPosition) : menu)\n }\n }, [dataItem, menu, menuPosition])\n\n useEffect(() => {\n setIsIconDisplayed(actionMenu?.some(menuItem => menuItem.icon))\n }, [actionMenu])\n\n useEffect(() => {\n window.addEventListener('click', clickHandler)\n window.addEventListener('scroll', scrollHandler, true)\n\n return () => {\n window.removeEventListener('click', clickHandler)\n window.removeEventListener('scroll', scrollHandler, true)\n }\n }, [clickHandler, scrollHandler])\n\n return (\n <div\n className={actionMenuClassNames}\n onMouseOut={onMouseOut}\n onMouseOver={handleMouseOver}\n ref={actionMenuRef}\n >\n {withQuickActions && (\n <div className=\"actions-menu__main-actions-wrapper\" ref={mainActionsWrapperRef}>\n {quickActions.map(\n mainAction =>\n !mainAction.hidden && (\n <RoundedIcon\n disabled={mainAction.disabled}\n id={`quick-link-${mainAction.id}`}\n onClick={() => mainAction.onClick(dataItem)}\n tooltipText={mainAction.label}\n key={mainAction.label}\n >\n {mainAction.icon}\n </RoundedIcon>\n )\n )}\n </div>\n )}\n {actionMenu.length > 0 && (\n <div className=\"actions-menu\" data-testid=\"actions-menu\">\n <RoundedIcon\n className=\"actions-menu-button\"\n isActive={isShowMenu}\n id=\"actions-menu-button\"\n onClick={() => {\n setIsShowMenu(prevValue => !prevValue)\n }}\n ref={actionMenuBtnRef}\n tooltipText=\"More actions\"\n >\n <ActionMenuIcon />\n </RoundedIcon>\n {isShowMenu && (\n <PopUpDialog\n className=\"actions-menu__body\"\n customPosition={{\n element: actionMenuBtnRef,\n position: 'bottom-left',\n autoVerticalPosition: true\n }}\n headerIsHidden\n ref={dropDownMenuRef}\n >\n <ul data-testid=\"actions-drop-down-menu\" className=\"actions-menu__list\">\n {actionMenu.map(\n (menuItem, idx) =>\n !menuItem.hidden && (\n <ActionsMenuItem\n dataItem={dataItem}\n index={idx}\n isIconDisplayed={isIconDisplayed}\n key={menuItem.label}\n menuItem={menuItem}\n />\n )\n )}\n </ul>\n </PopUpDialog>\n )}\n </div>\n )}\n </div>\n )\n}\n\nActionsMenu.propTypes = {\n dataItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n menu: ACTIONS_MENU.isRequired,\n menuPosition: PropTypes.string,\n time: PropTypes.number,\n withQuickActions: PropTypes.bool\n}\n\nexport default ActionsMenu\n"],"names":["ActionsMenu","dataItem","menu","menuPosition","time","withQuickActions","actionMenu","quickActions","setActionMenuContent","useState","isIconDisplayed","setIsIconDisplayed","isShowMenu","setIsShowMenu","actionMenuRef","useRef","actionMenuBtnRef","dropDownMenuRef","mainActionsWrapperRef","idTimeout","actionMenuClassNames","classnames","clickHandler","useCallback","event","scrollHandler","onMouseOut","handleMouseOver","_a","useEffect","isEmpty","menuItem","jsxs","mainAction","jsx","RoundedIcon","prevValue","ActionMenuIcon","PopUpDialog","idx","ActionsMenuItem","PropTypes","ACTIONS_MENU"],"mappings":";;;;;;;;;;;AAkCA,MAAMA,IAAc,CAAC;AAAA,EACnB,UAAAC,IAAW,CAAC;AAAA,EACZ,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,MAAAC,IAAO;AAAA,EACP,kBAAAC,IAAmB;AACrB,MAAM;AACE,QAAA,CAAC,CAACC,GAAYC,CAAY,GAAGC,CAAoB,IAAIC,EAASP,CAAI,GAClE,CAACQ,GAAiBC,CAAkB,IAAIF,EAAS,EAAK,GACtD,CAACG,GAAYC,CAAa,IAAIJ,EAAS,EAAK,GAC5CK,IAAgBC,EAAO,GACvBC,IAAmBD,EAAO,GAC1BE,IAAkBF,EAAO,GACzBG,IAAwBH,EAAO;AAErC,MAAII,IAAY;AAEhB,QAAMC,IAAuBC;AAAA,IAC3B;AAAA,IACAhB,MACGC,EAAW,SAAS,KAAKC,EAAa,SAAS,MAChD;AAAA,IACFK,KAAc;AAAA,EAChB,GAEMU,IAAeC;AAAA,IACnB,CAASC,MAAA;AACP,MAAKA,EAAM,OAAO,QAAQ,sBAAsB,KAC9CX,EAAc,EAAK;AAAA,IAEvB;AAAA,IACA,CAACA,CAAa;AAAA,EAChB,GAEMY,IAAgBF;AAAA,IACpB,CAASC,MAAA;AACP,MAAKA,EAAM,OAAO,QAAQ,qBA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A,EACxB,MAAMA,EAAU;AAAA,EAChB,kBAAkBA,EAAU;AAC9B;"}
@@ -1,6 +1,6 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import o from "prop-types";
3
- import { useMemo as n } from "react";
3
+ import { useMemo as d } from "react";
4
4
  import { useDispatch as f } from "react-redux";
5
5
  import u from "../RoundedIcon/RoundedIcon.mjs";
6
6
  import b from "../TooltipTemplate/TextTooltipTemplate.mjs";
@@ -10,12 +10,12 @@ import { showErrorNotification as T } from "../../utils/notification.util.mjs";
10
10
  import g from "../../images/copy-to-clipboard-icon.svg.mjs";
11
11
  const C = ({
12
12
  children: i = null,
13
- className: c = "",
13
+ className: l = "",
14
14
  disabled: e = !1,
15
- textToCopy: t = "",
15
+ textToCopy: r = "",
16
16
  tooltipText: p
17
17
  }) => {
18
- const s = f(), l = n(() => e || !t, [e, t]), a = (m) => {
18
+ const s = f(), c = d(() => e || !r, [e, r]), a = (m) => {
19
19
  navigator.clipboard.writeText(m).then(() => {
20
20
  s(
21
21
  y({
@@ -24,22 +24,22 @@ const C = ({
24
24
  message: "Copied to clipboard successfully"
25
25
  })
26
26
  );
27
- }).catch((d) => {
28
- T(s, d, "", "Copy to clipboard failed");
27
+ }).catch((n) => {
28
+ T(s, n, "", "Copy to clipboard failed");
29
29
  });
30
30
  };
31
- return /* @__PURE__ */ r("div", { className: c, "data-testid": "copy-to-clipboard", children: i ? /* @__PURE__ */ r(h, { template: /* @__PURE__ */ r(b, { text: p }), textShow: !0, children: /* @__PURE__ */ r("span", { onClick: () => a(t), children: i }) }) : /* @__PURE__ */ r(
31
+ return /* @__PURE__ */ t("div", { className: l, "data-testid": "copy-to-clipboard", children: i ? /* @__PURE__ */ t(h, { template: /* @__PURE__ */ t(b, { text: p }), textShow: !0, children: /* @__PURE__ */ t("span", { onClick: () => a(r), children: i }) }) : /* @__PURE__ */ t(
32
32
  u,
33
33
  {
34
34
  tooltipText: p,
35
- onClick: () => a(t),
36
- disabled: l,
37
- children: /* @__PURE__ */ r(g, {})
35
+ onClick: () => a(r),
36
+ disabled: c,
37
+ children: /* @__PURE__ */ t(g, {})
38
38
  }
39
39
  ) });
40
40
  };
41
41
  C.propTypes = {
42
- children: o.oneOfType([o.string, o.array]),
42
+ children: o.oneOfType([o.string, o.array, o.element]),
43
43
  className: o.string,
44
44
  disabled: o.bool,
45
45
  textToCopy: o.string,
@@ -1 +1 @@
1
- {"version":3,"file":"CopyToClipboard.mjs","sources":["../../../src/lib/components/CopyToClipboard/CopyToClipboard.jsx"],"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 PropTypes from 'prop-types'\nimport { useMemo } from 'react'\nimport { useDispatch } from 'react-redux'\n\nimport RoundedIcon from '../RoundedIcon/RoundedIcon'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\nimport Tooltip from '../Tooltip/Tooltip'\n\nimport { setNotification } from '../../reducers/notificationReducer'\nimport { showErrorNotification } from '../../utils/notification.util'\n\nimport Copy from '../../images/copy-to-clipboard-icon.svg?react'\n\nconst CopyToClipboard = ({\n children = null,\n className = '',\n disabled = false,\n textToCopy = '',\n tooltipText\n}) => {\n const dispatch = useDispatch()\n const copyIsDisabled = useMemo(() => disabled || !textToCopy, [disabled, textToCopy])\n\n const copyToClipboard = textToCopy => {\n navigator.clipboard\n .writeText(textToCopy)\n .then(() => {\n dispatch(\n setNotification({\n status: 200,\n id: Math.random(),\n message: 'Copied to clipboard successfully'\n })\n )\n })\n .catch(error => {\n showErrorNotification(dispatch, error, '', 'Copy to clipboard failed')\n })\n }\n\n return (\n <div className={className} data-testid=\"copy-to-clipboard\">\n {children ? (\n <Tooltip template={<TextTooltipTemplate text={tooltipText} />} textShow>\n <span onClick={() => copyToClipboard(textToCopy)}>{children}</span>\n </Tooltip>\n ) : (\n <RoundedIcon\n tooltipText={tooltipText}\n onClick={() => copyToClipboard(textToCopy)}\n disabled={copyIsDisabled}\n >\n <Copy />\n </RoundedIcon>\n )}\n </div>\n )\n}\n\nCopyToClipboard.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n className: PropTypes.string,\n disabled: PropTypes.bool,\n textToCopy: PropTypes.string,\n tooltipText: PropTypes.string.isRequired\n}\n\nexport default CopyToClipboard\n"],"names":["CopyToClipboard","children","className","disabled","textToCopy","tooltipText","dispatch","useDispatch","copyIsDisabled","useMemo","copyToClipboard","setNotification","error","showErrorNotification","jsx","Tooltip","TextTooltipTemplate","RoundedIcon","Copy","PropTypes"],"mappings":";;;;;;;;;;AAgCA,MAAMA,IAAkB,CAAC;AAAA,EACvB,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,aAAAC;AACF,MAAM;AACJ,QAAMC,IAAWC,EAAY,GACvBC,IAAiBC,EAAQ,MAAMN,KAAY,CAACC,GAAY,CAACD,GAAUC,CAAU,CAAC,GAE9EM,IAAkB,CAAAN,MAAc;AACpC,cAAU,UACP,UAAUA,CAAU,EACpB,KAAK,MAAM;AACV,MAAAE;AAAA,QACEK,EAAgB;AAAA,UACd,QAAQ;AAAA,UACR,IAAI,KAAK,OAAO;AAAA,UAChB,SAAS;AAAA,QACV,CAAA;AAAA,MACH;AAAA,IAAA,CACD,EACA,MAAM,CAASC,MAAA;AACQ,MAAAC,EAAAP,GAAUM,GAAO,IAAI,0BAA0B;AAAA,IAAA,CACtE;AAAA,EACL;AAGE,SAAA,gBAAAE,EAAC,OAAI,EAAA,WAAAZ,GAAsB,eAAY,qBACpC,cACE,gBAAAY,EAAAC,GAAA,EAAQ,UAAU,gBAAAD,EAACE,GAAoB,EAAA,MAAMX,EAAa,CAAA,GAAI,UAAQ,IACrE,UAAA,gBAAAS,EAAC,QAAK,EAAA,SAAS,MAAMJ,EAAgBN,CAAU,GAAI,UAAAH,EAAS,CAAA,EAAA,CAC9D,IAEA,gBAAAa;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,aAAAZ;AAAA,MACA,SAAS,MAAMK,EAAgBN,CAAU;AAAA,MACzC,UAAUI;AAAA,MAEV,4BAACU,GAAK,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,GAGZ;AAEJ;AAEAlB,EAAgB,YAAY;AAAA,EAC1B,UAAUmB,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,KAAK,CAAC;AAAA,EACjE,WAAWA,EAAU;AAAA,EACrB,UAAUA,EAAU;AAAA,EACpB,YAAYA,EAAU;AAAA,EACtB,aAAaA,EAAU,OAAO;AAChC;"}
1
+ {"version":3,"file":"CopyToClipboard.mjs","sources":["../../../src/lib/components/CopyToClipboard/CopyToClipboard.jsx"],"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 PropTypes from 'prop-types'\nimport { useMemo } from 'react'\nimport { useDispatch } from 'react-redux'\n\nimport RoundedIcon from '../RoundedIcon/RoundedIcon'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\nimport Tooltip from '../Tooltip/Tooltip'\n\nimport { setNotification } from '../../reducers/notificationReducer'\nimport { showErrorNotification } from '../../utils/notification.util'\n\nimport Copy from '../../images/copy-to-clipboard-icon.svg?react'\n\nconst CopyToClipboard = ({\n children = null,\n className = '',\n disabled = false,\n textToCopy = '',\n tooltipText\n}) => {\n const dispatch = useDispatch()\n const copyIsDisabled = useMemo(() => disabled || !textToCopy, [disabled, textToCopy])\n\n const copyToClipboard = textToCopy => {\n navigator.clipboard\n .writeText(textToCopy)\n .then(() => {\n dispatch(\n setNotification({\n status: 200,\n id: Math.random(),\n message: 'Copied to clipboard successfully'\n })\n )\n })\n .catch(error => {\n showErrorNotification(dispatch, error, '', 'Copy to clipboard failed')\n })\n }\n\n return (\n <div className={className} data-testid=\"copy-to-clipboard\">\n {children ? (\n <Tooltip template={<TextTooltipTemplate text={tooltipText} />} textShow>\n <span onClick={() => copyToClipboard(textToCopy)}>{children}</span>\n </Tooltip>\n ) : (\n <RoundedIcon\n tooltipText={tooltipText}\n onClick={() => copyToClipboard(textToCopy)}\n disabled={copyIsDisabled}\n >\n <Copy />\n </RoundedIcon>\n )}\n </div>\n )\n}\n\nCopyToClipboard.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.element]),\n className: PropTypes.string,\n disabled: PropTypes.bool,\n textToCopy: PropTypes.string,\n tooltipText: PropTypes.string.isRequired\n}\n\nexport default CopyToClipboard\n"],"names":["CopyToClipboard","children","className","disabled","textToCopy","tooltipText","dispatch","useDispatch","copyIsDisabled","useMemo","copyToClipboard","setNotification","error","showErrorNotification","jsx","Tooltip","TextTooltipTemplate","RoundedIcon","Copy","PropTypes"],"mappings":";;;;;;;;;;AAgCA,MAAMA,IAAkB,CAAC;AAAA,EACvB,UAAAC,IA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":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"names":[],"mappings":";AAoCA;;;;;;;;;;;gBAmIC"}
1
+ {"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"names":[],"mappings":";AAkCA;;;;;;;;;;;gBAyHC"}
@@ -1,91 +1,82 @@
1
- import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
- import { cloneElement as x } from "react";
1
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
+ import { cloneElement as T } from "react";
3
3
  import s from "prop-types";
4
4
  import c from "classnames";
5
- import I from "../ChipCell/ChipCell.mjs";
6
- import _ from "../CopyToClipboard/CopyToClipboard.mjs";
7
- import O from "../../elements/TableLinkCell/TableLinkCell.mjs";
8
- import j from "../../elements/TableTypeCell/TableTypeCell.mjs";
5
+ import j from "../ChipCell/ChipCell.mjs";
6
+ import I from "../../elements/TableLinkCell/TableLinkCell.mjs";
7
+ import O from "../../elements/TableTypeCell/TableTypeCell.mjs";
9
8
  import i from "../TooltipTemplate/TextTooltipTemplate.mjs";
10
- import d from "../Tooltip/Tooltip.mjs";
11
- import { BUTTON_COPY_URI_CELL_TYPE as L } from "../../constants.mjs";
12
- import { getChipOptions as U } from "../../utils/chips.util.mjs";
13
- import { truncateUid as A } from "../../utils/string.util.mjs";
14
- import E from "../../images/arrow.svg.mjs";
15
- const P = ({
9
+ import p from "../Tooltip/Tooltip.mjs";
10
+ import { getChipOptions as A } from "../../utils/chips.util.mjs";
11
+ import { truncateUid as L } from "../../utils/string.util.mjs";
12
+ import _ from "../../images/arrow.svg.mjs";
13
+ const g = ({
16
14
  cellData: e,
17
15
  className: m = "",
18
16
  firstCell: h = !1,
19
17
  item: r,
20
18
  link: l = "",
21
- onClick: p = null,
19
+ onClick: d = null,
22
20
  selectItem: y = () => {
23
21
  },
24
- selectedItem: b = {},
22
+ selectedItem: N = {},
25
23
  showExpandButton: a = !1,
26
24
  toggleRow: u = null
27
25
  }) => {
28
- const { value: C, label: f, className: N } = r.state ?? {}, o = c(
26
+ const { value: b, label: f, className: v } = r.state ?? {}, o = c(
29
27
  "table-body__cell",
30
28
  e.className,
31
29
  m,
32
30
  e.bodyCellClassName,
33
- p && "link"
31
+ d && "link"
34
32
  );
35
- return e.template ? x(e.template, {
33
+ return e.template ? T(e.template, {
36
34
  className: m
37
35
  }) : l && e.type !== "hidden" ? /* @__PURE__ */ t(
38
- O,
36
+ I,
39
37
  {
40
38
  className: m,
41
39
  cellData: e,
42
40
  item: r,
43
41
  link: l,
44
42
  selectItem: y,
45
- selectedItem: b,
43
+ selectedItem: N,
46
44
  showExpandButton: a,
47
45
  toggleRow: u
48
46
  }
49
- ) : h && !l ? /* @__PURE__ */ v(
47
+ ) : h && !l ? /* @__PURE__ */ C(
50
48
  "td",
51
49
  {
52
- onClick: () => e.value && p && p(e.value),
50
+ onClick: () => e.value && d && d(e.value),
53
51
  className: o,
54
52
  children: [
55
53
  /* @__PURE__ */ t("div", { className: "data-ellipsis", children: e && /* @__PURE__ */ t(
56
- d,
54
+ p,
57
55
  {
58
56
  template: /* @__PURE__ */ t(i, { text: e.tooltip || e.value || "" }),
59
57
  children: e.value
60
58
  }
61
59
  ) }),
62
- r.state && C && f && /* @__PURE__ */ t(d, { className: "status", template: /* @__PURE__ */ t(i, { text: f }), children: /* @__PURE__ */ t("i", { className: N }) }),
63
- !r.state && r.status && /* @__PURE__ */ t(d, { className: "status", template: /* @__PURE__ */ t(i, { text: r.status }), children: /* @__PURE__ */ t("i", { className: `${r.status[0].toLowerCase()}${r.status.slice(1)}` }) }),
64
- a && /* @__PURE__ */ t(E, { onClick: (n) => u && u(n, r), className: "expand-arrow" })
60
+ r.state && b && f && /* @__PURE__ */ t(p, { className: "status", template: /* @__PURE__ */ t(i, { text: f }), children: /* @__PURE__ */ t("i", { className: v }) }),
61
+ !r.state && r.status && /* @__PURE__ */ t(p, { className: "status", template: /* @__PURE__ */ t(i, { text: r.status }), children: /* @__PURE__ */ t("i", { className: `${r.status[0].toLowerCase()}${r.status.slice(1)}` }) }),
62
+ a && /* @__PURE__ */ t(_, { onClick: (n) => u && u(n, r), className: "expand-arrow" })
65
63
  ]
66
64
  }
67
- ) : e.type === "type" ? /* @__PURE__ */ t(j, { className: m, cellData: e }) : e.type === "icons" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: e.value.map((n, T) => /* @__PURE__ */ t(
68
- d,
65
+ ) : e.type === "type" ? /* @__PURE__ */ t(O, { className: m, cellData: e }) : e.type === "icons" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: e.value.map((n, x) => /* @__PURE__ */ t(
66
+ p,
69
67
  {
70
68
  template: /* @__PURE__ */ t(i, { text: n.tooltip }),
71
69
  children: n.icon
72
70
  },
73
- n.tooltip + T
74
- )) }) : Array.isArray(e.value) ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: /* @__PURE__ */ t(I, { chipOptions: U(e.type), elements: e.value, tooltip: !0 }) }) : e.type === L ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: /* @__PURE__ */ t(
75
- _,
76
- {
77
- tooltipText: "Copy URI",
78
- textToCopy: e.actionHandler(r),
79
- disabled: e.disabled
80
- }
81
- ) }) : e.type === "hash" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: /* @__PURE__ */ t(d, { template: /* @__PURE__ */ t(i, { text: e.value }), children: /* @__PURE__ */ t("span", { children: A(e.value) }) }) }) : e.type === "hidden" ? null : e.type === "component" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: e.value }) : /* @__PURE__ */ t(
71
+ n.tooltip + x
72
+ )) }) : Array.isArray(e.value) ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: /* @__PURE__ */ t(j, { chipOptions: A(e.type), elements: e.value, tooltip: !0 }) }) : e.type === "hash" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: /* @__PURE__ */ t(p, { template: /* @__PURE__ */ t(i, { text: e.value }), children: /* @__PURE__ */ t("span", { children: L(e.value) }) }) }) : e.type === "hidden" ? null : e.type === "component" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: e.value }) : /* @__PURE__ */ t(
82
73
  "td",
83
74
  {
84
75
  "data-testid": e == null ? void 0 : e.headerId,
85
76
  className: o,
86
- onClick: () => e.value && p && p(e.value),
77
+ onClick: () => e.value && d && d(e.value),
87
78
  children: /* @__PURE__ */ t(
88
- d,
79
+ p,
89
80
  {
90
81
  className: "text_small",
91
82
  template: /* @__PURE__ */ t(i, { text: e.tooltip || e.value || "" }),
@@ -95,7 +86,7 @@ const P = ({
95
86
  }
96
87
  );
97
88
  };
98
- P.propTypes = {
89
+ g.propTypes = {
99
90
  cellData: s.object.isRequired,
100
91
  className: s.string,
101
92
  firstCell: s.bool,
@@ -108,6 +99,6 @@ P.propTypes = {
108
99
  toggleRow: s.func
109
100
  };
110
101
  export {
111
- P as default
102
+ g as default
112
103
  };
113
104
  //# sourceMappingURL=TableCell.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.mjs","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"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 React, { cloneElement } from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\n\nimport ChipCell from '../ChipCell/ChipCell'\nimport CopyToClipboard from '../CopyToClipboard/CopyToClipboard'\nimport TableLinkCell from '../../elements/TableLinkCell/TableLinkCell'\nimport TableTypeCell from '../../elements/TableTypeCell/TableTypeCell'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\nimport Tooltip from '../Tooltip/Tooltip'\n\nimport { BUTTON_COPY_URI_CELL_TYPE } from '../../constants'\nimport { getChipOptions } from '../../utils/chips.util'\nimport { truncateUid } from '../../utils/string.util'\n\nimport Arrow from '../../images/arrow.svg?react'\n\nconst TableCell = ({\n cellData,\n className = '',\n firstCell = false,\n item,\n link = '',\n onClick = null,\n selectItem = () => {},\n selectedItem = {},\n showExpandButton = false,\n toggleRow = null\n}) => {\n const { value: stateValue, label: stateLabel, className: stateClassName } = item.state ?? {}\n const cellClassNames = classnames(\n 'table-body__cell',\n cellData.className,\n className,\n cellData.bodyCellClassName,\n onClick && 'link'\n )\n\n if (cellData.template) {\n return cloneElement(cellData.template, {\n className\n })\n } else if (link && cellData.type !== 'hidden') {\n return (\n <TableLinkCell\n className={className}\n cellData={cellData}\n item={item}\n link={link}\n selectItem={selectItem}\n selectedItem={selectedItem}\n showExpandButton={showExpandButton}\n toggleRow={toggleRow}\n />\n )\n } else if (firstCell && !link) {\n return (\n <td\n onClick={() => cellData.value && onClick && onClick(cellData.value)}\n className={cellClassNames}\n >\n <div className=\"data-ellipsis\">\n {cellData && (\n <Tooltip\n template={<TextTooltipTemplate text={cellData.tooltip || cellData.value || ''} />}\n >\n {cellData.value}\n </Tooltip>\n )}\n </div>\n {item.state && stateValue && stateLabel && (\n <Tooltip className=\"status\" template={<TextTooltipTemplate text={stateLabel} />}>\n <i className={stateClassName} />\n </Tooltip>\n )}\n {!item.state && item.status && (\n <Tooltip className=\"status\" template={<TextTooltipTemplate text={item.status} />}>\n <i className={`${item.status[0].toLowerCase()}${item.status.slice(1)}`} />\n </Tooltip>\n )}\n {showExpandButton && (\n <Arrow onClick={e => toggleRow && toggleRow(e, item)} className=\"expand-arrow\" />\n )}\n </td>\n )\n } else if (cellData.type === 'type') {\n return <TableTypeCell className={className} cellData={cellData} />\n } else if (cellData.type === 'icons') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n {cellData.value.map((valueItem, index) => (\n <Tooltip\n key={valueItem.tooltip + index}\n template={<TextTooltipTemplate text={valueItem.tooltip} />}\n >\n {valueItem.icon}\n </Tooltip>\n ))}\n </td>\n )\n } else if (Array.isArray(cellData.value)) {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n <ChipCell chipOptions={getChipOptions(cellData.type)} elements={cellData.value} tooltip />\n </td>\n )\n } else if (cellData.type === BUTTON_COPY_URI_CELL_TYPE) {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n <CopyToClipboard\n tooltipText=\"Copy URI\"\n textToCopy={cellData.actionHandler(item)}\n disabled={cellData.disabled}\n />\n </td>\n )\n } else if (cellData.type === 'hash') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n <Tooltip template={<TextTooltipTemplate text={cellData.value} />}>\n <span>{truncateUid(cellData.value)}</span>\n </Tooltip>\n </td>\n )\n } else if (cellData.type === 'hidden') {\n return null\n } else if (cellData.type === 'component') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n {cellData.value}\n </td>\n )\n } else {\n return (\n <td\n data-testid={cellData?.headerId}\n className={cellClassNames}\n onClick={() => cellData.value && onClick && onClick(cellData.value)}\n >\n <Tooltip\n className=\"text_small\"\n template={<TextTooltipTemplate text={cellData.tooltip || cellData.value || ''} />}\n >\n {cellData.value}\n </Tooltip>\n </td>\n )\n }\n}\n\nTableCell.propTypes = {\n cellData: PropTypes.object.isRequired,\n className: PropTypes.string,\n firstCell: PropTypes.bool,\n item: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),\n link: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n onClick: PropTypes.func,\n selectItem: PropTypes.func,\n selectedItem: PropTypes.object,\n showExpandButton: PropTypes.bool,\n toggleRow: PropTypes.func\n}\n\nexport default TableCell\n"],"names":["TableCell","cellData","className","firstCell","item","link","onClick","selectItem","selectedItem","showExpandButton","toggleRow","stateValue","stateLabel","stateClassName","cellClassNames","classnames","cloneElement","jsx","TableLinkCell","jsxs","Tooltip","TextTooltipTemplate","Arrow","e","TableTypeCell","valueItem","index","ChipCell","getChipOptions","BUTTON_COPY_URI_CELL_TYPE","CopyToClipboard","PropTypes"],"mappings":";;;;;;;;;;;;;;AAoCA,MAAMA,IAAY,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC,IAAY;AAAA,EACZ,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,YAAAC,IAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAAC,IAAe,CAAC;AAAA,EAChB,kBAAAC,IAAmB;AAAA,EACnB,WAAAC,IAAY;AACd,MAAM;AACE,QAAA,EAAE,OAAOC,GAAY,OAAOC,GAAY,WAAWC,EAAe,IAAIT,EAAK,SAAS,CAAC,GACrFU,IAAiBC;AAAA,IACrB;AAAA,IACAd,EAAS;AAAA,IACTC;AAAA,IACAD,EAAS;AAAA,IACTK,KAAW;AAAA,EACb;AAEA,SAAIL,EAAS,WACJe,EAAaf,EAAS,UAAU;AAAA,IACrC,WAAAC;AAAA,EAAA,CACD,IACQG,KAAQJ,EAAS,SAAS,WAEjC,gBAAAgB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAhB;AAAA,MACA,UAAAD;AAAA,MACA,MAAAG;AAAA,MACA,MAAAC;AAAA,MACA,YAAAE;AAAA,MACA,cAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,WAAAC;AAAA,IAAA;AAAA,EACF,IAEOP,KAAa,CAACE,IAErB,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAS,MAAMlB,EAAS,SAASK,KAAWA,EAAQL,EAAS,K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AAA;AAAA,IACZ;AAAA,EACF;AAGN;AAEAD,EAAU,YAAY;AAAA,EACpB,UAAU+B,EAAU,OAAO;AAAA,EAC3B,WAAWA,EAAU;AAAA,EACrB,WAAWA,EAAU;AAAA,EACrB,MAAMA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EAC5D,MAAMA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EAC5D,SAASA,EAAU;AAAA,EACnB,YAAYA,EAAU;AAAA,EACtB,cAAcA,EAAU;AAAA,EACxB,kBAAkBA,EAAU;AAAA,EAC5B,WAAWA,EAAU;AACvB;"}
1
+ {"version":3,"file":"TableCell.mjs","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"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 React, { cloneElement } from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\n\nimport ChipCell from '../ChipCell/ChipCell'\nimport TableLinkCell from '../../elements/TableLinkCell/TableLinkCell'\nimport TableTypeCell from '../../elements/TableTypeCell/TableTypeCell'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\nimport Tooltip from '../Tooltip/Tooltip'\n\nimport { getChipOptions } from '../../utils/chips.util'\nimport { truncateUid } from '../../utils/string.util'\n\nimport Arrow from '../../images/arrow.svg?react'\n\nconst TableCell = ({\n cellData,\n className = '',\n firstCell = false,\n item,\n link = '',\n onClick = null,\n selectItem = () => {},\n selectedItem = {},\n showExpandButton = false,\n toggleRow = null\n}) => {\n const { value: stateValue, label: stateLabel, className: stateClassName } = item.state ?? {}\n const cellClassNames = classnames(\n 'table-body__cell',\n cellData.className,\n className,\n cellData.bodyCellClassName,\n onClick && 'link'\n )\n\n if (cellData.template) {\n return cloneElement(cellData.template, {\n className\n })\n } else if (link && cellData.type !== 'hidden') {\n return (\n <TableLinkCell\n className={className}\n cellData={cellData}\n item={item}\n link={link}\n selectItem={selectItem}\n selectedItem={selectedItem}\n showExpandButton={showExpandButton}\n toggleRow={toggleRow}\n />\n )\n } else if (firstCell && !link) {\n return (\n <td\n onClick={() => cellData.value && onClick && onClick(cellData.value)}\n className={cellClassNames}\n >\n <div className=\"data-ellipsis\">\n {cellData && (\n <Tooltip\n template={<TextTooltipTemplate text={cellData.tooltip || cellData.value || ''} />}\n >\n {cellData.value}\n </Tooltip>\n )}\n </div>\n {item.state && stateValue && stateLabel && (\n <Tooltip className=\"status\" template={<TextTooltipTemplate text={stateLabel} />}>\n <i className={stateClassName} />\n </Tooltip>\n )}\n {!item.state && item.status && (\n <Tooltip className=\"status\" template={<TextTooltipTemplate text={item.status} />}>\n <i className={`${item.status[0].toLowerCase()}${item.status.slice(1)}`} />\n </Tooltip>\n )}\n {showExpandButton && (\n <Arrow onClick={e => toggleRow && toggleRow(e, item)} className=\"expand-arrow\" />\n )}\n </td>\n )\n } else if (cellData.type === 'type') {\n return <TableTypeCell className={className} cellData={cellData} />\n } else if (cellData.type === 'icons') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n {cellData.value.map((valueItem, index) => (\n <Tooltip\n key={valueItem.tooltip + index}\n template={<TextTooltipTemplate text={valueItem.tooltip} />}\n >\n {valueItem.icon}\n </Tooltip>\n ))}\n </td>\n )\n } else if (Array.isArray(cellData.value)) {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n <ChipCell chipOptions={getChipOptions(cellData.type)} elements={cellData.value} tooltip />\n </td>\n )\n } else if (cellData.type === 'hash') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n <Tooltip template={<TextTooltipTemplate text={cellData.value} />}>\n <span>{truncateUid(cellData.value)}</span>\n </Tooltip>\n </td>\n )\n } else if (cellData.type === 'hidden') {\n return null\n } else if (cellData.type === 'component') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n {cellData.value}\n </td>\n )\n } else {\n return (\n <td\n data-testid={cellData?.headerId}\n className={cellClassNames}\n onClick={() => cellData.value && onClick && onClick(cellData.value)}\n >\n <Tooltip\n className=\"text_small\"\n template={<TextTooltipTemplate text={cellData.tooltip || cellData.value || ''} />}\n >\n {cellData.value}\n </Tooltip>\n </td>\n )\n }\n}\n\nTableCell.propTypes = {\n cellData: PropTypes.object.isRequired,\n className: PropTypes.string,\n firstCell: PropTypes.bool,\n item: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),\n link: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n onClick: PropTypes.func,\n selectItem: PropTypes.func,\n selectedItem: PropTypes.object,\n showExpandButton: PropTypes.bool,\n toggleRow: PropTypes.func\n}\n\nexport default TableCell\n"],"names":["TableCell","cellData","className","firstCell","item","link","onClick","selectItem","selectedItem","showExpandButton","toggleRow","stateValue","stateLabel","stateClassName","cellClassNames","classnames","cloneElement","jsx","TableLinkCell","jsxs","Tooltip","TextTooltipTemplate","Arrow","e","TableTypeCell","valueItem","index","ChipCell","getChipOptions","PropTypes"],"mappings":";;;;;;;;;;;;AAkCA,MAAMA,IAAY,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC,IAAY;AAAA,EACZ,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,YAAAC,IAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAAC,IAAe,CAAC;AAAA,EAChB,kBAAA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A,EAAS,SAAS,cAEzB,gBAAAgB,EAAC,QAAG,eAAahB,EAAS,UAAU,WAAWa,GAC5C,YAAS,MACZ,CAAA,IAIA,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAahB,KAAA,gBAAAA,EAAU;AAAA,MACvB,WAAWa;AAAA,MACX,SAAS,MAAMb,EAAS,SAASK,KAAWA,EAAQL,EAAS,KAAK;AAAA,MAElE,UAAA,gBAAAgB;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,4BAAWC,GAAoB,EAAA,MAAMpB,EAAS,WAAWA,EAAS,SAAS,IAAI;AAAA,UAE9E,UAASA,EAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ;AAAA,EACF;AAGN;AAEAD,EAAU,YAAY;AAAA,EACpB,UAAU6B,EAAU,OAAO;AAAA,EAC3B,WAAWA,EAAU;AAAA,EACrB,WAAWA,EAAU;AAAA,EACrB,MAAMA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EAC5D,MAAMA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EAC5D,SAASA,EAAU;AAAA,EACnB,YAAYA,EAAU;AAAA,EACtB,cAAcA,EAAU;AAAA,EACxB,kBAAkBA,EAAU;AAAA,EAC5B,WAAWA,EAAU;AACvB;"}
@@ -119,5 +119,4 @@ export const MODAL_MIN: "min";
119
119
  export const MODAL_MAX: "max";
120
120
  export const MAIN_TABLE_ID: "main-table";
121
121
  export const MAIN_TABLE_BODY_ID: "main-table-body";
122
- export const BUTTON_COPY_URI_CELL_TYPE: "buttonCopyURI";
123
122
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/lib/constants.js"],"names":[],"mappings":"AAmBA,oCAAqC,MAAM,CAAA;AAC3C,6BAA8B,MAAM,CAAA;AAEpC,4BAA6B,OAAO,CAAA;AACp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AAmB,KAAK,CAAA;AACxB,wBAAyB,WAAW,CAAA;AAIpC,6BAA8B,SAAS,CAAA;AACvC,+BAAgC,WAAW,CAAA;AAC3C,8BAA+B,UAAU,CAAA;AACzC,4BAA6B,QAAQ,CAAA;AACrC,2BAA4B,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBnC,2CAA4C,GAAG,CAAA;AAC/C,0CAA2C,GAAG,CAAA;AAC9C,yCAA0C,GAAG,CAAA;AAC7C,yCAA0C,GAAG,CAAA;AAC7C,gDAAiD,GAAG,CAAA;AACpD,4CAA6C,GAAG,CAAA;AAChD,oDAAqD,GAAG,CAAA;AACxD,0CAA2C,GAAG,CAAA;AAI9C,uBAAwB,IAAI,CAAA;AAC5B,uBAAwB,IAAI,CAAA;AAC5B,uBAAwB,IAAI,CAAA;AAC5B,wBAAyB,KAAK,CAAA;AAC9B,wBAAyB,KAAK,CAAA;AAI9B,4BAA6B,YAAY,CAAA;AACzC,iCAAkC,iBAAiB,CAAA"}
@@ -1,4 +1,4 @@
1
- const E = "view", t = "full", A = "dense", n = "normal", _ = "medium", T = "chunky", N = "Backspace", e = "Click", o = "Delete", s = "Tab", c = "Tab+Shift", L = "primary", O = "secondary", R = "tertiary", a = "danger", M = "label", i = {
1
+ const E = "view", t = "full", A = "dense", n = "normal", _ = "medium", T = "chunky", N = "Backspace", e = "Click", s = "Delete", o = "Tab", c = "Tab+Shift", L = "primary", O = "secondary", a = "tertiary", R = "danger", M = "label", i = {
2
2
  BEGIN_END_NOT_WITH: { LABEL: "Must not begin and end with", NAME: "beginEndNot" },
3
3
  BEGIN_END_WITH: { LABEL: "Must begin and end with", NAME: "beginEnd" },
4
4
  BEGIN_NOT_WITH: { LABEL: "Must not begin with", NAME: "beginNot" },
@@ -14,39 +14,38 @@ const E = "view", t = "full", A = "dense", n = "normal", _ = "medium", T = "chun
14
14
  REQUIRED: { LABEL: "This field is required", NAME: "required" },
15
15
  VALID_CHARACTERS_WITH_REFIX: { LABEL: "Valid characters", NAME: "validCharactersWithPrefix" },
16
16
  VALID_CHARACTERS: { LABEL: "Valid characters", NAME: "validCharacters" }
17
- }, I = 400, B = 403, D = 404, C = 409, S = 500, r = 502, U = 503, d = 504, l = "sm", h = "md", u = "lg", b = "min", H = "max", Y = "main-table", g = "main-table-body", W = "buttonCopyURI";
17
+ }, I = 400, D = 403, B = 404, C = 409, S = 500, r = 502, d = 503, U = 504, l = "sm", h = "md", u = "lg", b = "min", H = "max", g = "main-table", Y = "main-table-body";
18
18
  export {
19
19
  N as BACKSPACE,
20
20
  I as BADREQUEST_ERROR_STATUS_CODE,
21
21
  r as BAD_GATEWAY_ERROR_STATUS_CODE,
22
- W as BUTTON_COPY_URI_CELL_TYPE,
23
22
  e as CLICK,
24
23
  C as CONFLICT_ERROR_STATUS_CODE,
25
- a as DANGER_BUTTON,
26
- o as DELETE,
24
+ R as DANGER_BUTTON,
25
+ s as DELETE,
27
26
  T as DENSITY_CHUNKY,
28
27
  A as DENSITY_DENSE,
29
28
  _ as DENSITY_MEDIUM,
30
29
  n as DENSITY_NORMAL,
31
- B as FORBIDDEN_ERROR_STATUS_CODE,
30
+ D as FORBIDDEN_ERROR_STATUS_CODE,
32
31
  t as FULL_VIEW_MODE,
33
- d as GATEWAY_TIMEOUT_STATUS_CODE,
32
+ U as GATEWAY_TIMEOUT_STATUS_CODE,
34
33
  S as INTERNAL_SERVER_ERROR_STATUS_CODE,
35
34
  M as LABEL_BUTTON,
36
- g as MAIN_TABLE_BODY_ID,
37
- Y as MAIN_TABLE_ID,
35
+ Y as MAIN_TABLE_BODY_ID,
36
+ g as MAIN_TABLE_ID,
38
37
  u as MODAL_LG,
39
38
  H as MODAL_MAX,
40
39
  h as MODAL_MD,
41
40
  b as MODAL_MIN,
42
41
  l as MODAL_SM,
43
- D as NOTFOUND_ERROR_STATUS_CODE,
42
+ B as NOTFOUND_ERROR_STATUS_CODE,
44
43
  L as PRIMARY_BUTTON,
45
44
  O as SECONDARY_BUTTON,
46
- U as SERVICE_UNAVAILABLE_ERROR_STATUS_CODE,
47
- s as TAB,
45
+ d as SERVICE_UNAVAILABLE_ERROR_STATUS_CODE,
46
+ o as TAB,
48
47
  c as TAB_SHIFT,
49
- R as TERTIARY_BUTTON,
48
+ a as TERTIARY_BUTTON,
50
49
  E as VIEW_SEARCH_PARAMETER,
51
50
  i as validation
52
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","sources":["../src/lib/constants.js"],"sourcesContent":["/*\nCopyright 2022 Iguazio Systems Ltd.\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.\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.\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*/\n\n/*=========== GENERAL =============*/\n\nexport const VIEW_SEARCH_PARAMETER = 'view'\nexport const FULL_VIEW_MODE = 'full'\n\nexport const DENSITY_DENSE = 'dense'\nexport const DENSITY_NORMAL = 'normal'\nexport const DENSITY_MEDIUM = 'medium'\nexport const DENSITY_CHUNKY = 'chunky'\n\n/*=========== EVENT KEYS =============*/\nexport const BACKSPACE = 'Backspace'\nexport const CLICK = 'Click'\nexport const DELETE = 'Delete'\nexport const TAB = 'Tab'\nexport const TAB_SHIFT = 'Tab+Shift'\n\n/*=========== BUTTONS =============*/\n\nexport const PRIMARY_BUTTON = 'primary'\nexport const SECONDARY_BUTTON = 'secondary'\nexport const TERTIARY_BUTTON = 'tertiary'\nexport const DANGER_BUTTON = 'danger'\nexport const LABEL_BUTTON = 'label'\n\n/*=========== VALITATION =============*/\n\nexport const validation = {\n BEGIN_END_NOT_WITH: { LABEL: 'Must not begin and end with', NAME: 'beginEndNot' },\n BEGIN_END_WITH: { LABEL: 'Must begin and end with', NAME: 'beginEnd' },\n BEGIN_NOT_WITH: { LABEL: 'Must not begin with', NAME: 'beginNot' },\n BEGIN_WITH: { LABEL: 'Must begin with', NAME: 'begin' },\n END_NOT_WITH: { LABEL: 'Must not end with', NAME: 'endNot' },\n END_WITH: { LABEL: 'Must end with', NAME: 'end' },\n MUST_CONTAIN_EXACTLY_ONE: { LABEL: 'Must contain exactly one', NAME: 'exactlyOne' },\n MUST_HAVE_DOT_AFTER_AT: { LABEL: 'Must have at least one . after @', NAME: 'dotAfterAt' },\n MUST_NOT_BE: { LABEL: 'Must not be', NAME: 'mustNotBe' },\n NO_CONSECUTIVE_CHARACTER: { LABEL: 'No consecutive characters', NAME: 'noConsecutiveCharacters' },\n NOT_CONTAIN: { LABEL: 'Must not contain', NAME: 'notContainCharacters' },\n ONLY_AT_THE_BEGINNING: { LABEL: 'Only at the beginning', NAME: 'onlyAtTheBeginning' },\n REQUIRED: { LABEL: 'This field is required', NAME: 'required' },\n VALID_CHARACTERS_WITH_REFIX: { LABEL: 'Valid characters', NAME: 'validCharactersWithPrefix' },\n VALID_CHARACTERS: { LABEL: 'Valid characters', NAME: 'validCharacters' }\n}\n\n/*=========== STATUS CODES =============*/\n\nexport const BADREQUEST_ERROR_STATUS_CODE = 400\nexport const FORBIDDEN_ERROR_STATUS_CODE = 403\nexport const NOTFOUND_ERROR_STATUS_CODE = 404\nexport const CONFLICT_ERROR_STATUS_CODE = 409\nexport const INTERNAL_SERVER_ERROR_STATUS_CODE = 500\nexport const BAD_GATEWAY_ERROR_STATUS_CODE = 502\nexport const SERVICE_UNAVAILABLE_ERROR_STATUS_CODE = 503\nexport const GATEWAY_TIMEOUT_STATUS_CODE = 504\n\n/*=========== MODAL =============*/\n\nexport const MODAL_SM = 'sm'\nexport const MODAL_MD = 'md'\nexport const MODAL_LG = 'lg'\nexport const MODAL_MIN = 'min'\nexport const MODAL_MAX = 'max'\n\n/*=========== TABLE =============*/\n\nexport const MAIN_TABLE_ID = 'main-table'\nexport const MAIN_TABLE_BODY_ID = 'main-table-body'\nexport const BUTTON_COPY_URI_CELL_TYPE = 'buttonCopyURI'\n"],"names":["VIEW_SEARCH_PARAMETER","FULL_VIEW_MODE","DENSITY_DENSE","DENSITY_NORMAL","DENSITY_MEDIUM","DENSITY_CHUNKY","BACKSPACE","CLICK","DELETE","TAB","TAB_SHIFT","PRIMARY_BUTTON","SECONDARY_BUTTON","TERTIARY_BUTTON","DANGER_BUTTON","LABEL_BUTTON","validation","BADREQUEST_ERROR_STATUS_CODE","FORBIDDEN_ERROR_STATUS_CODE","NOTFOUND_ERROR_STATUS_CODE","CONFLICT_ERROR_STATUS_CODE","INTERNAL_SERVER_ERROR_STATUS_CODE","BAD_GATEWAY_ERROR_STATUS_CODE","SERVICE_UNAVAILABLE_ERROR_STATUS_CODE","GATEWAY_TIMEOUT_STATUS_CODE","MODAL_SM","MODAL_MD","MODAL_LG","MODAL_MIN","MODAL_MAX","MAIN_TABLE_ID","MAIN_TABLE_BODY_ID","BUTTON_COPY_URI_CELL_TYPE"],"mappings":"AAmBY,MAACA,IAAwB,QACxBC,IAAiB,QAEjBC,IAAgB,SAChBC,IAAiB,UACjBC,IAAiB,UACjBC,IAAiB,UAGjBC,IAAY,aACZC,IAAQ,SACRC,IAAS,UACTC,IAAM,OACNC,IAAY,aAIZC,IAAiB,WACjBC,IAAmB,aACnBC,IAAkB,YAClBC,IAAgB,UAChBC,IAAe,SAIfC,IAAa;AAAA,EACxB,oBAAoB,EAAE,OAAO,+BAA+B,MAAM,cAAe;AAAA,EACjF,gBAAgB,EAAE,OAAO,2BAA2B,MAAM,WAAY;AAAA,EACtE,gBAAgB,EAAE,OAAO,uBAAuB,MAAM,WAAY;AAAA,EAClE,YAAY,EAAE,OAAO,mBAAmB,MAAM,QAAS;AAAA,EACvD,cAAc,EAAE,OAAO,qBAAqB,MAAM,SAAU;AAAA,EAC5D,UAAU,EAAE,OAAO,iBAAiB,MAAM,MAAO;AAAA,EACjD,0BAA0B,EAAE,OAAO,4BAA4B,MAAM,aAAc;AAAA,EACnF,wBAAwB,EAAE,OAAO,oCAAoC,MAAM,aAAc;AAAA,EACzF,aAAa,EAAE,OAAO,eAAe,MAAM,YAAa;AAAA,EACxD,0BAA0B,EAAE,OAAO,6BAA6B,MAAM,0BAA2B;AAAA,EACjG,aAAa,EAAE,OAAO,oBAAoB,MAAM,uBAAwB;AAAA,EACxE,uBAAuB,EAAE,OAAO,yBAAyB,MAAM,qBAAsB;AAAA,EACrF,UAAU,EAAE,OAAO,0BAA0B,MAAM,WAAY;AAAA,EAC/D,6BAA6B,EAAE,OAAO,oBAAoB,MAAM,4BAA6B;AAAA,EAC7F,kBAAkB,EAAE,OAAO,oBAAoB,MAAM,kBAAiB;AACxE,GAIaC,IAA+B,KAC/BC,IAA8B,KAC9BC,IAA6B,KAC7BC,IAA6B,KAC7BC,IAAoC,KACpCC,IAAgC,KAChCC,IAAwC,KACxCC,IAA8B,KAI9BC,IAAW,MACXC,IAAW,MACXC,IAAW,MACXC,IAAY,OACZC,IAAY,OAIZC,IAAgB,cAChBC,IAAqB,mBACrBC,IAA4B;"}
1
+ {"version":3,"file":"constants.mjs","sources":["../src/lib/constants.js"],"sourcesContent":["/*\nCopyright 2022 Iguazio Systems Ltd.\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.\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.\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*/\n\n/*=========== GENERAL =============*/\n\nexport const VIEW_SEARCH_PARAMETER = 'view'\nexport const FULL_VIEW_MODE = 'full'\n\nexport const DENSITY_DENSE = 'dense'\nexport const DENSITY_NORMAL = 'normal'\nexport const DENSITY_MEDIUM = 'medium'\nexport const DENSITY_CHUNKY = 'chunky'\n\n/*=========== EVENT KEYS =============*/\nexport const BACKSPACE = 'Backspace'\nexport const CLICK = 'Click'\nexport const DELETE = 'Delete'\nexport const TAB = 'Tab'\nexport const TAB_SHIFT = 'Tab+Shift'\n\n/*=========== BUTTONS =============*/\n\nexport const PRIMARY_BUTTON = 'primary'\nexport const SECONDARY_BUTTON = 'secondary'\nexport const TERTIARY_BUTTON = 'tertiary'\nexport const DANGER_BUTTON = 'danger'\nexport const LABEL_BUTTON = 'label'\n\n/*=========== VALITATION =============*/\n\nexport const validation = {\n BEGIN_END_NOT_WITH: { LABEL: 'Must not begin and end with', NAME: 'beginEndNot' },\n BEGIN_END_WITH: { LABEL: 'Must begin and end with', NAME: 'beginEnd' },\n BEGIN_NOT_WITH: { LABEL: 'Must not begin with', NAME: 'beginNot' },\n BEGIN_WITH: { LABEL: 'Must begin with', NAME: 'begin' },\n END_NOT_WITH: { LABEL: 'Must not end with', NAME: 'endNot' },\n END_WITH: { LABEL: 'Must end with', NAME: 'end' },\n MUST_CONTAIN_EXACTLY_ONE: { LABEL: 'Must contain exactly one', NAME: 'exactlyOne' },\n MUST_HAVE_DOT_AFTER_AT: { LABEL: 'Must have at least one . after @', NAME: 'dotAfterAt' },\n MUST_NOT_BE: { LABEL: 'Must not be', NAME: 'mustNotBe' },\n NO_CONSECUTIVE_CHARACTER: { LABEL: 'No consecutive characters', NAME: 'noConsecutiveCharacters' },\n NOT_CONTAIN: { LABEL: 'Must not contain', NAME: 'notContainCharacters' },\n ONLY_AT_THE_BEGINNING: { LABEL: 'Only at the beginning', NAME: 'onlyAtTheBeginning' },\n REQUIRED: { LABEL: 'This field is required', NAME: 'required' },\n VALID_CHARACTERS_WITH_REFIX: { LABEL: 'Valid characters', NAME: 'validCharactersWithPrefix' },\n VALID_CHARACTERS: { LABEL: 'Valid characters', NAME: 'validCharacters' }\n}\n\n/*=========== STATUS CODES =============*/\n\nexport const BADREQUEST_ERROR_STATUS_CODE = 400\nexport const FORBIDDEN_ERROR_STATUS_CODE = 403\nexport const NOTFOUND_ERROR_STATUS_CODE = 404\nexport const CONFLICT_ERROR_STATUS_CODE = 409\nexport const INTERNAL_SERVER_ERROR_STATUS_CODE = 500\nexport const BAD_GATEWAY_ERROR_STATUS_CODE = 502\nexport const SERVICE_UNAVAILABLE_ERROR_STATUS_CODE = 503\nexport const GATEWAY_TIMEOUT_STATUS_CODE = 504\n\n/*=========== MODAL =============*/\n\nexport const MODAL_SM = 'sm'\nexport const MODAL_MD = 'md'\nexport const MODAL_LG = 'lg'\nexport const MODAL_MIN = 'min'\nexport const MODAL_MAX = 'max'\n\n/*=========== TABLE =============*/\n\nexport const MAIN_TABLE_ID = 'main-table'\nexport const MAIN_TABLE_BODY_ID = 'main-table-body'\n"],"names":["VIEW_SEARCH_PARAMETER","FULL_VIEW_MODE","DENSITY_DENSE","DENSITY_NORMAL","DENSITY_MEDIUM","DENSITY_CHUNKY","BACKSPACE","CLICK","DELETE","TAB","TAB_SHIFT","PRIMARY_BUTTON","SECONDARY_BUTTON","TERTIARY_BUTTON","DANGER_BUTTON","LABEL_BUTTON","validation","BADREQUEST_ERROR_STATUS_CODE","FORBIDDEN_ERROR_STATUS_CODE","NOTFOUND_ERROR_STATUS_CODE","CONFLICT_ERROR_STATUS_CODE","INTERNAL_SERVER_ERROR_STATUS_CODE","BAD_GATEWAY_ERROR_STATUS_CODE","SERVICE_UNAVAILABLE_ERROR_STATUS_CODE","GATEWAY_TIMEOUT_STATUS_CODE","MODAL_SM","MODAL_MD","MODAL_LG","MODAL_MIN","MODAL_MAX","MAIN_TABLE_ID","MAIN_TABLE_BODY_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