iguazio.dashboard-react-controls 3.2.7 → 3.2.9
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/FormToggle/FormToggle.d.ts +7 -1
- package/dist/components/FormToggle/FormToggle.d.ts.map +1 -1
- package/dist/components/FormToggle/FormToggle.mjs +56 -33
- package/dist/components/FormToggle/FormToggle.mjs.map +1 -1
- package/dist/components/TableCell/TableCell.d.ts.map +1 -1
- package/dist/components/TableCell/TableCell.mjs +47 -46
- package/dist/components/TableCell/TableCell.mjs.map +1 -1
- package/dist/elements/TableTagStatusCell/TableTagStatusCell.d.ts +16 -0
- package/dist/elements/TableTagStatusCell/TableTagStatusCell.d.ts.map +1 -0
- package/dist/elements/TableTagStatusCell/TableTagStatusCell.mjs +49 -0
- package/dist/elements/TableTagStatusCell/TableTagStatusCell.mjs.map +1 -0
- package/dist/elements/index.d.ts +2 -1
- package/dist/elements/index.d.ts.map +1 -1
- package/dist/elements/index.mjs +10 -8
- package/dist/elements/index.mjs.map +1 -1
- package/dist/hooks/useDetailsHeader.hook.mjs +15 -15
- package/dist/hooks/useDetailsHeader.hook.mjs.map +1 -1
- package/dist/images/batch-step-badge.svg +4 -0
- package/dist/images/choice-step-badge.svg +4 -0
- package/dist/images/custom-step-badge.svg +4 -0
- package/dist/images/error-step-badge.svg +4 -0
- package/dist/images/events-step-badge.svg +8 -0
- package/dist/images/filter-step-badge.svg +4 -0
- package/dist/images/genai-step-badge.svg +4 -0
- package/dist/images/kafka-icon.svg +3 -0
- package/dist/images/legend-queue-icon.svg +5 -0
- package/dist/images/legend.svg +12 -0
- package/dist/images/mlrun-hub-step-badge.svg +4 -0
- package/dist/images/remote-step-badge.svg +4 -0
- package/dist/images/response-indicator.svg +4 -0
- package/dist/images/router-step-badge.svg +4 -0
- package/dist/images/v3io-icon.svg +3 -0
- package/dist/index.css +1 -1
- package/dist/scss/colors.scss +4 -0
- package/dist/utils/datetime.util.d.ts.map +1 -1
- package/dist/utils/datetime.util.mjs +18 -23
- package/dist/utils/datetime.util.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
export default FormToggle;
|
|
2
|
-
declare function FormToggle({ density, label, name, onChange, ...inputProps }: {
|
|
2
|
+
declare function FormToggle({ className, density, label, labelTip, name, readOnly, onChange, ...inputProps }: {
|
|
3
3
|
[x: string]: any;
|
|
4
|
+
className?: string;
|
|
4
5
|
density?: string;
|
|
5
6
|
label?: string;
|
|
7
|
+
labelTip?: string;
|
|
6
8
|
name: any;
|
|
9
|
+
readOnly?: boolean;
|
|
7
10
|
onChange?: () => void;
|
|
8
11
|
}): JSX.Element;
|
|
9
12
|
declare namespace FormToggle {
|
|
10
13
|
namespace propTypes {
|
|
14
|
+
export let className: any;
|
|
11
15
|
export { DENSITY as density };
|
|
12
16
|
export let label: any;
|
|
17
|
+
export let labelTip: any;
|
|
13
18
|
export let name: any;
|
|
19
|
+
export let readOnly: any;
|
|
14
20
|
export let onChange: any;
|
|
15
21
|
}
|
|
16
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormToggle.d.ts","sourceRoot":"","sources":["../../../src/lib/components/FormToggle/FormToggle.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FormToggle.d.ts","sourceRoot":"","sources":["../../../src/lib/components/FormToggle/FormToggle.jsx"],"names":[],"mappings":";AA0BA;;;;;;;;;gBAkDC;;;;;;;;;;;;wBAtDuB,gBAAgB"}
|
|
@@ -1,48 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Field as
|
|
6
|
-
import
|
|
3
|
+
import _ from "classnames";
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import { Field as h } from "react-final-form";
|
|
6
|
+
import N from "../Tip/Tip.mjs";
|
|
7
|
+
import { DENSITY as x } from "../../types.mjs";
|
|
7
8
|
/* empty css */
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const b = ({
|
|
10
|
+
className: a = "",
|
|
11
|
+
density: m = "",
|
|
12
|
+
label: t = "",
|
|
13
|
+
labelTip: o = "",
|
|
14
|
+
name: e,
|
|
15
|
+
readOnly: c = !1,
|
|
16
|
+
onChange: s = () => {
|
|
17
|
+
},
|
|
18
|
+
...d
|
|
19
|
+
}) => {
|
|
20
|
+
const p = _(
|
|
21
|
+
"form-field-toggle",
|
|
11
22
|
"form-field__wrapper",
|
|
12
|
-
|
|
23
|
+
m && `form-field__wrapper-${m}`,
|
|
24
|
+
(t || o) && "form-field-toggle_has-label",
|
|
25
|
+
a
|
|
13
26
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
"
|
|
27
|
+
return /* @__PURE__ */ l(h, { name: e, value: d.value, type: "checkbox", children: ({ input: i }) => /* @__PURE__ */ f(
|
|
28
|
+
"div",
|
|
16
29
|
{
|
|
17
|
-
className:
|
|
30
|
+
className: p,
|
|
18
31
|
"data-testid": e ? `${e}-form-field-toggle` : "form-field-toggle",
|
|
19
32
|
children: [
|
|
20
|
-
t && /* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
(t || o) && /* @__PURE__ */ f("label", { htmlFor: e, className: "form-field-toggle__label", children: [
|
|
34
|
+
t,
|
|
35
|
+
o && /* @__PURE__ */ l(N, { text: o })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ f("label", { htmlFor: e, className: "form-field-toggle__toggle-wrapper", children: [
|
|
38
|
+
/* @__PURE__ */ l(
|
|
39
|
+
"input",
|
|
40
|
+
{
|
|
41
|
+
type: "checkbox",
|
|
42
|
+
"data-testid": e ? `${e}-form-toggle` : "form-toggle",
|
|
43
|
+
id: e,
|
|
44
|
+
...i,
|
|
45
|
+
...d,
|
|
46
|
+
value: String(i.checked),
|
|
47
|
+
disabled: c,
|
|
48
|
+
onChange: (g) => {
|
|
49
|
+
s == null || s(g), i.onChange(g);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ l("span", { className: "form-field-toggle__switch" })
|
|
54
|
+
] })
|
|
35
55
|
]
|
|
36
56
|
}
|
|
37
57
|
) });
|
|
38
58
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
b.propTypes = {
|
|
60
|
+
className: r.string,
|
|
61
|
+
density: x,
|
|
62
|
+
label: r.string,
|
|
63
|
+
labelTip: r.string,
|
|
64
|
+
name: r.string.isRequired,
|
|
65
|
+
readOnly: r.bool,
|
|
66
|
+
onChange: r.func
|
|
44
67
|
};
|
|
45
68
|
export {
|
|
46
|
-
|
|
69
|
+
b as default
|
|
47
70
|
};
|
|
48
71
|
//# sourceMappingURL=FormToggle.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormToggle.mjs","sources":["../../../src/lib/components/FormToggle/FormToggle.jsx"],"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*/\nimport React from 'react'\nimport classnames from 'classnames'\nimport PropTypes from 'prop-types'\nimport { Field } from 'react-final-form'\n\nimport { DENSITY } from '../../types.js'\n\nimport './formToggle.scss'\n\nconst FormToggle = ({ density = ''
|
|
1
|
+
{"version":3,"file":"FormToggle.mjs","sources":["../../../src/lib/components/FormToggle/FormToggle.jsx"],"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*/\nimport React from 'react'\nimport classnames from 'classnames'\nimport PropTypes from 'prop-types'\nimport { Field } from 'react-final-form'\n\nimport Tip from '../Tip/Tip'\nimport { DENSITY } from '../../types.js'\n\nimport './formToggle.scss'\n\nconst FormToggle = ({\n className = '',\n density = '',\n label = '',\n labelTip = '',\n name,\n readOnly = false,\n onChange = () => {},\n ...inputProps\n}) => {\n const formFieldClassNames = classnames(\n 'form-field-toggle',\n 'form-field__wrapper',\n density && `form-field__wrapper-${density}`,\n (label || labelTip) && 'form-field-toggle_has-label',\n className\n )\n\n return (\n <Field name={name} value={inputProps.value} type=\"checkbox\">\n {({ input }) => (\n <div\n className={formFieldClassNames}\n data-testid={name ? `${name}-form-field-toggle` : 'form-field-toggle'}\n >\n {(label || labelTip) && (\n <label htmlFor={name} className=\"form-field-toggle__label\">\n {label}\n {labelTip && <Tip text={labelTip} />}\n </label>\n )}\n <label htmlFor={name} className=\"form-field-toggle__toggle-wrapper\">\n <input\n type=\"checkbox\"\n data-testid={name ? `${name}-form-toggle` : 'form-toggle'}\n id={name}\n {...{ ...input, ...inputProps }}\n value={String(input.checked)}\n disabled={readOnly}\n onChange={event => {\n onChange?.(event)\n input.onChange(event)\n }}\n />\n <span className=\"form-field-toggle__switch\" />\n </label>\n </div>\n )}\n </Field>\n )\n}\n\nFormToggle.propTypes = {\n className: PropTypes.string,\n density: DENSITY,\n label: PropTypes.string,\n labelTip: PropTypes.string,\n name: PropTypes.string.isRequired,\n readOnly: PropTypes.bool,\n onChange: PropTypes.func\n}\n\nexport default FormToggle\n"],"names":["FormToggle","className","density","label","labelTip","name","readOnly","onChange","inputProps","formFieldClassNames","classnames","jsx","Field","input","jsxs","Tip","event","PropTypes","DENSITY"],"mappings":";;;;;;;;AA0BA,MAAMA,IAAa,CAAC;AAAA,EAClB,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW,MAAM;AAAA,EAAC;AAAA,EAClB,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAsBC;AAAA,IAC1B;AAAA,IACA;AAAA,IACAR,KAAW,uBAAuBA,CAAO;AAAA,KACxCC,KAASC,MAAa;AAAA,IACvBH;AAAA,EAAA;AAGF,SACE,gBAAAU,EAACC,GAAA,EAAM,MAAAP,GAAY,OAAOG,EAAW,OAAO,MAAK,YAC9C,UAAA,CAAC,EAAE,OAAAK,EAAA,MACF,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWL;AAAA,MACX,eAAaJ,IAAO,GAAGA,CAAI,uBAAuB;AAAA,MAEhD,UAAA;AAAA,SAAAF,KAASC,MACT,gBAAAU,EAAC,SAAA,EAAM,SAAST,GAAM,WAAU,4BAC7B,UAAA;AAAA,UAAAF;AAAA,UACAC,KAAY,gBAAAO,EAACI,GAAA,EAAI,MAAMX,EAAA,CAAU;AAAA,QAAA,GACpC;AAAA,QAEF,gBAAAU,EAAC,SAAA,EAAM,SAAST,GAAM,WAAU,qCAC9B,UAAA;AAAA,UAAA,gBAAAM;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,eAAaN,IAAO,GAAGA,CAAI,iBAAiB;AAAA,cAC5C,IAAIA;AAAA,cACE,GAAGQ;AAAA,cAAO,GAAGL;AAAA,cACnB,OAAO,OAAOK,EAAM,OAAO;AAAA,cAC3B,UAAUP;AAAA,cACV,UAAU,CAAAU,MAAS;AACjB,gBAAAT,KAAA,QAAAA,EAAWS,IACXH,EAAM,SAASG,CAAK;AAAA,cACtB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEF,gBAAAL,EAAC,QAAA,EAAK,WAAU,4BAAA,CAA4B;AAAA,QAAA,EAAA,CAC9C;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEAX,EAAW,YAAY;AAAA,EACrB,WAAWiB,EAAU;AAAA,EACrB,SAASC;AAAA,EACT,OAAOD,EAAU;AAAA,EACjB,UAAUA,EAAU;AAAA,EACpB,MAAMA,EAAU,OAAO;AAAA,EACvB,UAAUA,EAAU;AAAA,EACpB,UAAUA,EAAU;AACtB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"names":[],"mappings":";AAmCA;;;;;;;;;;;gBAiIC"}
|
|
@@ -1,99 +1,100 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { cloneElement as
|
|
1
|
+
import { jsx as s, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { cloneElement as C } from "react";
|
|
3
3
|
import t from "prop-types";
|
|
4
4
|
import c from "classnames";
|
|
5
|
-
import
|
|
5
|
+
import p from "../Tooltip/Tooltip.mjs";
|
|
6
6
|
import j from "../ReadOnlyChips/ReadOnlyChips.mjs";
|
|
7
7
|
import I from "../../elements/TableLinkCell/TableLinkCell.mjs";
|
|
8
|
-
import O from "../../elements/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
|
|
8
|
+
import O from "../../elements/TableTagStatusCell/TableTagStatusCell.mjs";
|
|
9
|
+
import g from "../../elements/TableTypeCell/TableTypeCell.mjs";
|
|
10
|
+
import d from "../TooltipTemplate/TextTooltipTemplate.mjs";
|
|
11
|
+
import { getChipOptions as w } from "../../utils/chips.util.mjs";
|
|
12
|
+
import { truncateUid as A } from "../../utils/string.util.mjs";
|
|
13
|
+
import L from "../../images/arrow.svg.mjs";
|
|
14
|
+
const S = ({
|
|
14
15
|
cellData: e,
|
|
15
|
-
className:
|
|
16
|
+
className: n = "",
|
|
16
17
|
firstCell: h = !1,
|
|
17
18
|
item: r,
|
|
18
|
-
link:
|
|
19
|
-
onClick:
|
|
19
|
+
link: u = "",
|
|
20
|
+
onClick: o = null,
|
|
20
21
|
selectItem: y = () => {
|
|
21
22
|
},
|
|
22
23
|
selectedItem: b = {},
|
|
23
|
-
showExpandButton:
|
|
24
|
-
toggleRow:
|
|
24
|
+
showExpandButton: f = !1,
|
|
25
|
+
toggleRow: l = null
|
|
25
26
|
}) => {
|
|
26
|
-
const { value:
|
|
27
|
+
const { value: v, label: a, className: N } = r.state ?? {}, i = c(
|
|
27
28
|
"table-body__cell",
|
|
28
29
|
e.className,
|
|
29
|
-
|
|
30
|
+
n,
|
|
30
31
|
e.bodyCellClassName,
|
|
31
|
-
|
|
32
|
+
o && "link"
|
|
32
33
|
);
|
|
33
|
-
return e.template ?
|
|
34
|
-
className:
|
|
35
|
-
}) :
|
|
34
|
+
return e.template ? C(e.template, {
|
|
35
|
+
className: n
|
|
36
|
+
}) : u && e.type !== "hidden" ? /* @__PURE__ */ s(
|
|
36
37
|
I,
|
|
37
38
|
{
|
|
38
|
-
className:
|
|
39
|
+
className: n,
|
|
39
40
|
cellData: e,
|
|
40
41
|
item: r,
|
|
41
|
-
link:
|
|
42
|
+
link: u,
|
|
42
43
|
selectItem: y,
|
|
43
44
|
selectedItem: b,
|
|
44
|
-
showExpandButton:
|
|
45
|
-
toggleRow:
|
|
45
|
+
showExpandButton: f,
|
|
46
|
+
toggleRow: l
|
|
46
47
|
}
|
|
47
|
-
) : h && !
|
|
48
|
+
) : h && !u ? /* @__PURE__ */ x(
|
|
48
49
|
"td",
|
|
49
50
|
{
|
|
50
|
-
onClick: () => e.value &&
|
|
51
|
-
className:
|
|
51
|
+
onClick: () => e.value && o && o(e.value),
|
|
52
|
+
className: i,
|
|
52
53
|
children: [
|
|
53
54
|
/* @__PURE__ */ s("div", { className: "data-ellipsis", children: e && /* @__PURE__ */ s(
|
|
54
|
-
|
|
55
|
+
p,
|
|
55
56
|
{
|
|
56
|
-
template: /* @__PURE__ */ s(
|
|
57
|
+
template: /* @__PURE__ */ s(d, { text: e.tooltip || e.value || "" }),
|
|
57
58
|
children: e.value
|
|
58
59
|
}
|
|
59
60
|
) }),
|
|
60
|
-
r.state &&
|
|
61
|
-
!r.state && r.status && /* @__PURE__ */ s(
|
|
62
|
-
|
|
61
|
+
r.state && v && a && /* @__PURE__ */ s(p, { className: "status", template: /* @__PURE__ */ s(d, { text: a }), children: /* @__PURE__ */ s("i", { className: N }) }),
|
|
62
|
+
!r.state && r.status && /* @__PURE__ */ s(p, { className: "status", template: /* @__PURE__ */ s(d, { text: r.status }), children: /* @__PURE__ */ s("i", { className: `${r.status[0].toLowerCase()}${r.status.slice(1)}` }) }),
|
|
63
|
+
f && /* @__PURE__ */ s(L, { onClick: (m) => l && l(m, r), className: "expand-arrow" })
|
|
63
64
|
]
|
|
64
65
|
}
|
|
65
|
-
) : e.type === "type" ? /* @__PURE__ */ s(
|
|
66
|
-
|
|
66
|
+
) : e.type === "type" ? /* @__PURE__ */ s(g, { className: n, cellData: e }) : e.type === "icons" ? /* @__PURE__ */ s("td", { "data-testid": e.headerId, className: i, children: e.value.map((m, T) => /* @__PURE__ */ s(
|
|
67
|
+
p,
|
|
67
68
|
{
|
|
68
|
-
template: /* @__PURE__ */ s(
|
|
69
|
-
children:
|
|
69
|
+
template: /* @__PURE__ */ s(d, { text: m.tooltip }),
|
|
70
|
+
children: m.icon
|
|
70
71
|
},
|
|
71
|
-
|
|
72
|
-
)) }) : Array.isArray(e.value) ? /* @__PURE__ */ s("td", { "data-testid": e.headerId, className:
|
|
72
|
+
m.tooltip + T
|
|
73
|
+
)) }) : Array.isArray(e.value) ? /* @__PURE__ */ s("td", { "data-testid": e.headerId, className: i, children: /* @__PURE__ */ s(
|
|
73
74
|
j,
|
|
74
75
|
{
|
|
75
|
-
chipOptions:
|
|
76
|
+
chipOptions: w(e.type),
|
|
76
77
|
labels: e.value,
|
|
77
78
|
shortChips: !0
|
|
78
79
|
}
|
|
79
|
-
) }) : e.type === "hash" ? /* @__PURE__ */ s("td", { "data-testid": e.headerId, className:
|
|
80
|
+
) }) : e.type === "hash" ? /* @__PURE__ */ s("td", { "data-testid": e.headerId, className: i, children: /* @__PURE__ */ s(p, { template: /* @__PURE__ */ s(d, { text: e.value }), children: /* @__PURE__ */ s("span", { children: A(e.value) }) }) }) : e.type === "hidden" ? null : e.type === "component" ? /* @__PURE__ */ s("td", { "data-testid": e.headerId, className: i, children: e.value }) : e.showStatus && e.showTag ? /* @__PURE__ */ s(O, { className: n, cellData: e, item: r, onClick: o }) : /* @__PURE__ */ s(
|
|
80
81
|
"td",
|
|
81
82
|
{
|
|
82
83
|
"data-testid": e == null ? void 0 : e.headerId,
|
|
83
|
-
className:
|
|
84
|
-
onClick: () => e.value &&
|
|
84
|
+
className: i,
|
|
85
|
+
onClick: () => e.value && o && o(e.value),
|
|
85
86
|
children: /* @__PURE__ */ s(
|
|
86
|
-
|
|
87
|
+
p,
|
|
87
88
|
{
|
|
88
89
|
className: "text_small",
|
|
89
|
-
template: /* @__PURE__ */ s(
|
|
90
|
+
template: /* @__PURE__ */ s(d, { text: e.tooltip || e.value || "" }),
|
|
90
91
|
children: e.value
|
|
91
92
|
}
|
|
92
93
|
)
|
|
93
94
|
}
|
|
94
95
|
);
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
+
S.propTypes = {
|
|
97
98
|
cellData: t.object.isRequired,
|
|
98
99
|
className: t.string,
|
|
99
100
|
firstCell: t.bool,
|
|
@@ -106,6 +107,6 @@ g.propTypes = {
|
|
|
106
107
|
toggleRow: t.func
|
|
107
108
|
};
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
S as default
|
|
110
111
|
};
|
|
111
112
|
//# 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 Tooltip from '../Tooltip/Tooltip'\nimport ReadOnlyChips from '../ReadOnlyChips/ReadOnlyChips'\nimport TableLinkCell from '../../elements/TableLinkCell/TableLinkCell'\nimport TableTypeCell from '../../elements/TableTypeCell/TableTypeCell'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\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 <ReadOnlyChips\n chipOptions={getChipOptions(cellData.type)}\n labels={cellData.value}\n shortChips\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","ReadOnlyChips","getChipOptions","PropTypes"],"mappings":"
|
|
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 Tooltip from '../Tooltip/Tooltip'\nimport ReadOnlyChips from '../ReadOnlyChips/ReadOnlyChips'\nimport TableLinkCell from '../../elements/TableLinkCell/TableLinkCell'\nimport TableTagStatusCell from '../../elements/TableTagStatusCell/TableTagStatusCell'\nimport TableTypeCell from '../../elements/TableTypeCell/TableTypeCell'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\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 <ReadOnlyChips\n chipOptions={getChipOptions(cellData.type)}\n labels={cellData.value}\n shortChips\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 if (cellData.showStatus && cellData.showTag) {\n return (\n <TableTagStatusCell className={className} cellData={cellData} item={item} onClick={onClick} />\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","ReadOnlyChips","getChipOptions","TableTagStatusCell","PropTypes"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default TableTagStatusCell;
|
|
2
|
+
declare function TableTagStatusCell({ cellData, className, item, onClick }: {
|
|
3
|
+
cellData?: {};
|
|
4
|
+
className?: string;
|
|
5
|
+
item: any;
|
|
6
|
+
onClick?: any;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
declare namespace TableTagStatusCell {
|
|
9
|
+
namespace propTypes {
|
|
10
|
+
let cellData: any;
|
|
11
|
+
let className: any;
|
|
12
|
+
let item: any;
|
|
13
|
+
let onClick: any;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=TableTagStatusCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableTagStatusCell.d.ts","sourceRoot":"","sources":["../../../src/lib/elements/TableTagStatusCell/TableTagStatusCell.jsx"],"names":[],"mappings":";AA4BA;;;;;gBAuCC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import l from "prop-types";
|
|
4
|
+
import i from "classnames";
|
|
5
|
+
import r from "../../components/Tooltip/Tooltip.mjs";
|
|
6
|
+
import o from "../../components/TooltipTemplate/TextTooltipTemplate.mjs";
|
|
7
|
+
/* empty css */
|
|
8
|
+
const N = ({ cellData: e = {}, className: m = "", item: a, onClick: t = null }) => {
|
|
9
|
+
const d = i(
|
|
10
|
+
"table-body__cell",
|
|
11
|
+
"tag-status-cell",
|
|
12
|
+
e.className,
|
|
13
|
+
m,
|
|
14
|
+
e.bodyCellClassName,
|
|
15
|
+
t && "link"
|
|
16
|
+
), { value: n, label: p, className: u } = (a == null ? void 0 : a.state) ?? {};
|
|
17
|
+
return /* @__PURE__ */ s(
|
|
18
|
+
"td",
|
|
19
|
+
{
|
|
20
|
+
"data-testid": (e == null ? void 0 : e.headerId) ?? "table-tag-status-cell",
|
|
21
|
+
className: d,
|
|
22
|
+
onClick: () => e.value && (t == null ? void 0 : t(e.value)),
|
|
23
|
+
children: /* @__PURE__ */ c("div", { className: "cell-wrapper", children: [
|
|
24
|
+
/* @__PURE__ */ c("div", { className: "cell-content", children: [
|
|
25
|
+
/* @__PURE__ */ s(
|
|
26
|
+
r,
|
|
27
|
+
{
|
|
28
|
+
className: "cell-name",
|
|
29
|
+
template: /* @__PURE__ */ s(o, { text: e.tooltip || e.value || "" }),
|
|
30
|
+
children: e.value
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
n && p && /* @__PURE__ */ s(r, { className: "cell-status", template: /* @__PURE__ */ s(o, { text: p }), children: /* @__PURE__ */ s("i", { className: u }) })
|
|
34
|
+
] }),
|
|
35
|
+
(a == null ? void 0 : a.tag) && /* @__PURE__ */ s(r, { className: "cell-tag", template: /* @__PURE__ */ s(o, { text: a.tag }), children: /* @__PURE__ */ s("span", { className: "cell-subtext", children: a.tag }) })
|
|
36
|
+
] })
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
N.propTypes = {
|
|
41
|
+
cellData: l.object.isRequired,
|
|
42
|
+
className: l.string,
|
|
43
|
+
item: l.oneOfType([l.object, l.bool]).isRequired,
|
|
44
|
+
onClick: l.func
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
N as default
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=TableTagStatusCell.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableTagStatusCell.mjs","sources":["../../../src/lib/elements/TableTagStatusCell/TableTagStatusCell.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 from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\n\nimport Tooltip from '../../components/Tooltip/Tooltip'\nimport TextTooltipTemplate from '../../components/TooltipTemplate/TextTooltipTemplate'\n\nimport './tableTagStatusCell.scss'\n\nconst TableTagStatusCell = ({ cellData = {}, className = '', item, onClick = null }) => {\n const tableCellClassNames = classnames(\n 'table-body__cell',\n 'tag-status-cell',\n cellData.className,\n className,\n cellData.bodyCellClassName,\n onClick && 'link'\n )\n const { value: stateValue, label: stateLabel, className: stateClassName } = item?.state ?? {}\n\n return (\n <td\n data-testid={cellData?.headerId ?? 'table-tag-status-cell'}\n className={tableCellClassNames}\n onClick={() => cellData.value && onClick?.(cellData.value)}\n >\n <div className=\"cell-wrapper\">\n <div className=\"cell-content\">\n <Tooltip\n className=\"cell-name\"\n template={<TextTooltipTemplate text={cellData.tooltip || cellData.value || ''} />}\n >\n {cellData.value}\n </Tooltip>\n {stateValue && stateLabel && (\n <Tooltip className=\"cell-status\" template={<TextTooltipTemplate text={stateLabel} />}>\n <i className={stateClassName} />\n </Tooltip>\n )}\n </div>\n {item?.tag && (\n <Tooltip className=\"cell-tag\" template={<TextTooltipTemplate text={item.tag} />}>\n <span className=\"cell-subtext\">{item.tag}</span>\n </Tooltip>\n )}\n </div>\n </td>\n )\n}\n\nTableTagStatusCell.propTypes = {\n cellData: PropTypes.object.isRequired,\n className: PropTypes.string,\n item: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]).isRequired,\n onClick: PropTypes.func\n}\n\nexport default TableTagStatusCell\n"],"names":["TableTagStatusCell","cellData","className","item","onClick","tableCellClassNames","classnames","stateValue","stateLabel","stateClassName","jsx","jsxs","Tooltip","TextTooltipTemplate","PropTypes"],"mappings":";;;;;;;AA4BA,MAAMA,IAAqB,CAAC,EAAE,UAAAC,IAAW,IAAI,WAAAC,IAAY,IAAI,MAAAC,GAAM,SAAAC,IAAU,WAAW;AACtF,QAAMC,IAAsBC;AAAA,IAC1B;AAAA,IACA;AAAA,IACAL,EAAS;AAAA,IACTC;AAAA,IACAD,EAAS;AAAA,IACTG,KAAW;AAAA,EAAA,GAEP,EAAE,OAAOG,GAAY,OAAOC,GAAY,WAAWC,EAAA,KAAmBN,KAAA,gBAAAA,EAAM,UAAS,CAAA;AAE3F,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,gBAAaT,KAAA,gBAAAA,EAAU,aAAY;AAAA,MACnC,WAAWI;AAAA,MACX,SAAS,MAAMJ,EAAS,UAASG,KAAA,gBAAAA,EAAUH,EAAS;AAAA,MAEpD,UAAA,gBAAAU,EAAC,OAAA,EAAI,WAAU,gBACb,UAAA;AAAA,QAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,gBACb,UAAA;AAAA,UAAA,gBAAAD;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,4BAAWC,GAAA,EAAoB,MAAMZ,EAAS,WAAWA,EAAS,SAAS,IAAI;AAAA,cAE9E,UAAAA,EAAS;AAAA,YAAA;AAAA,UAAA;AAAA,UAEXM,KAAcC,KACb,gBAAAE,EAACE,GAAA,EAAQ,WAAU,eAAc,UAAU,gBAAAF,EAACG,GAAA,EAAoB,MAAML,GAAY,GAChF,UAAA,gBAAAE,EAAC,KAAA,EAAE,WAAWD,GAAgB,EAAA,CAChC;AAAA,QAAA,GAEJ;AAAA,SACCN,KAAA,gBAAAA,EAAM,QACL,gBAAAO,EAACE,KAAQ,WAAU,YAAW,UAAU,gBAAAF,EAACG,GAAA,EAAoB,MAAMV,EAAK,IAAA,CAAK,GAC3E,UAAA,gBAAAO,EAAC,QAAA,EAAK,WAAU,gBAAgB,UAAAP,EAAK,KAAI,EAAA,CAC3C;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAH,EAAmB,YAAY;AAAA,EAC7B,UAAUc,EAAU,OAAO;AAAA,EAC3B,WAAWA,EAAU;AAAA,EACrB,MAAMA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC,EAAE;AAAA,EAC9D,SAASA,EAAU;AACrB;"}
|
package/dist/elements/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import OptionsMenu from './OptionsMenu/OptionsMenu';
|
|
|
5
5
|
import SelectOption from './SelectOption/SelectOption';
|
|
6
6
|
import TableHead from './TableHead/TableHead';
|
|
7
7
|
import TableLinkCell from './TableLinkCell/TableLinkCell';
|
|
8
|
+
import TableTagStatusCell from './TableTagStatusCell/TableTagStatusCell';
|
|
8
9
|
import TableTypeCell from './TableTypeCell/TableTypeCell';
|
|
9
10
|
import ValidationTemplate from './ValidationTemplate/ValidationTemplate';
|
|
10
|
-
export { ActionsMenuItem, FormActionButton, FormRowActions, OptionsMenu, SelectOption, TableHead, TableLinkCell, TableTypeCell, ValidationTemplate };
|
|
11
|
+
export { ActionsMenuItem, FormActionButton, FormRowActions, OptionsMenu, SelectOption, TableHead, TableLinkCell, TableTagStatusCell, TableTypeCell, ValidationTemplate };
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/elements/index.js"],"names":[],"mappings":"4BAiB4B,mCAAmC;6BAClC,qCAAqC;2BACvC,iCAAiC;wBACpC,2BAA2B;yBAC1B,6BAA6B;sBAChC,uBAAuB;0BACnB,+BAA+B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/elements/index.js"],"names":[],"mappings":"4BAiB4B,mCAAmC;6BAClC,qCAAqC;2BACvC,iCAAiC;wBACpC,2BAA2B;yBAC1B,6BAA6B;sBAChC,uBAAuB;0BACnB,+BAA+B;+BAC1B,yCAAyC;0BAC9C,+BAA+B;+BAC1B,yCAAyC"}
|
package/dist/elements/index.mjs
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
1
|
+
import { default as a } from "./ActionsMenuItem/ActionsMenuItem.mjs";
|
|
2
|
+
import { default as l } from "./FormActionButton/FormActionButton.mjs";
|
|
3
3
|
import { default as f } from "./FormRowActions/FormRowActions.mjs";
|
|
4
4
|
import { default as p } from "./OptionsMenu/OptionsMenu.mjs";
|
|
5
5
|
import { default as u } from "./SelectOption/SelectOption.mjs";
|
|
6
6
|
import { default as n } from "./TableHead/TableHead.mjs";
|
|
7
7
|
import { default as i } from "./TableLinkCell/TableLinkCell.mjs";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as A } from "./
|
|
8
|
+
import { default as b } from "./TableTagStatusCell/TableTagStatusCell.mjs";
|
|
9
|
+
import { default as A } from "./TableTypeCell/TableTypeCell.mjs";
|
|
10
|
+
import { default as F } from "./ValidationTemplate/ValidationTemplate.mjs";
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
a as ActionsMenuItem,
|
|
13
|
+
l as FormActionButton,
|
|
13
14
|
f as FormRowActions,
|
|
14
15
|
p as OptionsMenu,
|
|
15
16
|
u as SelectOption,
|
|
16
17
|
n as TableHead,
|
|
17
18
|
i as TableLinkCell,
|
|
18
|
-
|
|
19
|
-
A as
|
|
19
|
+
b as TableTagStatusCell,
|
|
20
|
+
A as TableTypeCell,
|
|
21
|
+
F as ValidationTemplate
|
|
20
22
|
};
|
|
21
23
|
//# 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":";;;;;;;;;;"}
|
|
@@ -18,7 +18,7 @@ import te from "../images/ml-enlarge.svg.mjs";
|
|
|
18
18
|
import oe from "../images/history.svg.mjs";
|
|
19
19
|
import ne from "../images/ml-minimize.svg.mjs";
|
|
20
20
|
import re from "../images/refresh.svg.mjs";
|
|
21
|
-
const
|
|
21
|
+
const S = ({
|
|
22
22
|
actionButton: t = null,
|
|
23
23
|
actionsMenu: c,
|
|
24
24
|
applyChanges: d,
|
|
@@ -31,20 +31,20 @@ const B = ({
|
|
|
31
31
|
handleCancelClick: u,
|
|
32
32
|
handleRefresh: h = null,
|
|
33
33
|
headerRef: T,
|
|
34
|
-
isDetailsPopUp:
|
|
34
|
+
isDetailsPopUp: l = !1,
|
|
35
35
|
isDetailsScreen: w,
|
|
36
36
|
location: p,
|
|
37
37
|
navigate: f,
|
|
38
38
|
pageData: g,
|
|
39
|
-
params:
|
|
39
|
+
params: a,
|
|
40
40
|
renderCustomElements: b = null,
|
|
41
41
|
renderStatus: _ = null,
|
|
42
42
|
renderTitle: q,
|
|
43
43
|
selectedItem: k,
|
|
44
44
|
showAllVersions: N = null,
|
|
45
|
-
tab:
|
|
45
|
+
tab: V = "",
|
|
46
46
|
viewMode: A = "",
|
|
47
|
-
withActionMenu:
|
|
47
|
+
withActionMenu: B = !0,
|
|
48
48
|
withToggleViewBtn: I = !1
|
|
49
49
|
}) => /* @__PURE__ */ r("div", { className: "item-header", ref: T, children: [
|
|
50
50
|
/* @__PURE__ */ r("div", { className: "item-header__data", children: [
|
|
@@ -53,7 +53,7 @@ const B = ({
|
|
|
53
53
|
] }),
|
|
54
54
|
/* @__PURE__ */ i("div", { className: "item-header__custom-elements", children: b && b() }),
|
|
55
55
|
/* @__PURE__ */ r("div", { className: "item-header__buttons", children: [
|
|
56
|
-
o.changes.counter > 0 && !
|
|
56
|
+
o.changes.counter > 0 && !l && /* @__PURE__ */ r(M, { children: [
|
|
57
57
|
/* @__PURE__ */ i(
|
|
58
58
|
j,
|
|
59
59
|
{
|
|
@@ -116,9 +116,9 @@ const B = ({
|
|
|
116
116
|
children: /* @__PURE__ */ i(re, {})
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
-
|
|
119
|
+
B && /* @__PURE__ */ i(W, { dataItem: k, menu: c, time: 500 }),
|
|
120
120
|
/* @__PURE__ */ r("div", { className: "item-header__navigation-buttons", children: [
|
|
121
|
-
I && !
|
|
121
|
+
I && !l && /* @__PURE__ */ r(M, { children: [
|
|
122
122
|
A !== y && /* @__PURE__ */ i(
|
|
123
123
|
s,
|
|
124
124
|
{
|
|
@@ -146,7 +146,7 @@ const B = ({
|
|
|
146
146
|
}
|
|
147
147
|
)
|
|
148
148
|
] }),
|
|
149
|
-
!g.details.
|
|
149
|
+
!g.details.hideCloseBtn && (l ? /* @__PURE__ */ i(
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
152
152
|
className: "details-close-btn",
|
|
@@ -159,7 +159,7 @@ const B = ({
|
|
|
159
159
|
{
|
|
160
160
|
className: "details-close-btn",
|
|
161
161
|
"data-testid": "details-close-btn",
|
|
162
|
-
to: m ? m(k.name) : C(
|
|
162
|
+
to: m ? m(k.name) : C(a, g.page, V),
|
|
163
163
|
onClick: u,
|
|
164
164
|
children: /* @__PURE__ */ i(s, { tooltipText: "Close", id: "details-close", children: /* @__PURE__ */ i($, {}) })
|
|
165
165
|
}
|
|
@@ -167,7 +167,7 @@ const B = ({
|
|
|
167
167
|
] })
|
|
168
168
|
] })
|
|
169
169
|
] });
|
|
170
|
-
|
|
170
|
+
S.propTypes = {
|
|
171
171
|
actionButton: Q,
|
|
172
172
|
actionsMenu: K.isRequired,
|
|
173
173
|
applyChanges: e.func.isRequired,
|
|
@@ -197,24 +197,24 @@ B.propTypes = {
|
|
|
197
197
|
withToggleViewBtn: e.bool
|
|
198
198
|
};
|
|
199
199
|
const Ne = ({ handleCancel: t, handleShowWarning: c, isDetailsPopUp: d, pageData: R }) => {
|
|
200
|
-
const n = O((
|
|
200
|
+
const n = O((a) => a.commonDetailsStore), o = F(), m = D(), C = U(), v = ee(window.location.search), { actionButton: u, withToggleViewBtn: h, showAllVersions: T } = R.details, l = H(), w = z(), p = async (a, b) => {
|
|
201
201
|
await ie(
|
|
202
202
|
n.changes,
|
|
203
203
|
o
|
|
204
|
-
) && b(
|
|
204
|
+
) && b(a);
|
|
205
205
|
}, f = x(() => {
|
|
206
206
|
n.changes.counter > 0 ? c(!0) : t && t();
|
|
207
207
|
}, [n.changes.counter, t, c]), g = x(() => {
|
|
208
208
|
t && (n.changes.counter === 0 || d) && t();
|
|
209
209
|
}, [n.changes.counter, t, d]);
|
|
210
210
|
return {
|
|
211
|
-
DetailsHeaderContainer:
|
|
211
|
+
DetailsHeaderContainer: S,
|
|
212
212
|
actionButton: u,
|
|
213
213
|
commonDetailsStore: n,
|
|
214
214
|
handleActionClick: p,
|
|
215
215
|
handleBackClick: f,
|
|
216
216
|
handleCancelClick: g,
|
|
217
|
-
headerRef:
|
|
217
|
+
headerRef: l,
|
|
218
218
|
location: w,
|
|
219
219
|
navigate: C,
|
|
220
220
|
params: m,
|