@ck-ui/component-library 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DropdownFooter-CYkg2g5d.js +89 -0
- package/dist/{OptionList-BNaH2PnX.js → OptionList-DN1xZbnV.js} +29 -29
- package/dist/assets/DropdownFooter-DjdPf69A.css +1 -0
- package/dist/assets/index-B81zpOpq.css +1 -0
- package/dist/assets/index-BoQKDmZt.css +1 -0
- package/dist/assets/index-Cdmws__2.css +1 -0
- package/dist/assets/index-CtR-jzNi.css +1 -0
- package/dist/assets/index-PKpDB4Cl.css +1 -0
- package/dist/assets/index-i-aBFBOq.css +1 -0
- package/dist/assets/{styles-CbbBUzsN.css → styles-Bqfs9eXV.css} +1 -1
- package/dist/assets/styles-CYxKrBqL.css +1 -0
- package/dist/assets/styles-CZCmGNUn.css +1 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.js +53 -47
- package/dist/components/CKCheckbox/index.d.ts.map +1 -1
- package/dist/components/CKCheckbox/index.js +22 -21
- package/dist/components/CostComparatorTable/_helpers/CostCell.d.ts +3 -1
- package/dist/components/CostComparatorTable/_helpers/CostCell.d.ts.map +1 -1
- package/dist/components/CostComparatorTable/_helpers/CostCell.js +30 -28
- package/dist/components/CostComparatorTable/_helpers/HeaderCheckbox.js +1 -1
- package/dist/components/CostComparatorTable/_types/costComparatorTable.types.d.ts +7 -0
- package/dist/components/CostComparatorTable/_types/costComparatorTable.types.d.ts.map +1 -1
- package/dist/components/CostComparatorTable/index.d.ts +1 -1
- package/dist/components/CostComparatorTable/index.d.ts.map +1 -1
- package/dist/components/CostComparatorTable/index.js +93 -85
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +1685 -1651
- package/dist/components/DateRangePicker/_types/dateRangePicker.types.d.ts +10 -0
- package/dist/components/DateRangePicker/_types/dateRangePicker.types.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/builders.js +141 -141
- package/dist/components/FusionChart/_config/helpers.js +2 -2
- package/dist/components/FusionChart/_helpers/doughnutHelper.d.ts.map +1 -1
- package/dist/components/FusionChart/_helpers/doughnutHelper.js +56 -43
- package/dist/components/FusionChart/index.d.ts.map +1 -1
- package/dist/components/FusionChart/index.js +356 -340
- package/dist/components/Loader/_types/loader.types.d.ts +10 -0
- package/dist/components/Loader/_types/loader.types.d.ts.map +1 -0
- package/dist/components/Loader/_types/loader.types.js +1 -0
- package/dist/components/Loader/index.d.ts +6 -0
- package/dist/components/Loader/index.d.ts.map +1 -0
- package/dist/components/Loader/index.js +37 -0
- package/dist/components/MAVDropdown/_types/mavDropdown.types.d.ts +27 -0
- package/dist/components/MAVDropdown/_types/mavDropdown.types.d.ts.map +1 -0
- package/dist/components/MAVDropdown/_types/mavDropdown.types.js +1 -0
- package/dist/components/MAVDropdown/index.d.ts +6 -0
- package/dist/components/MAVDropdown/index.d.ts.map +1 -0
- package/dist/components/MAVDropdown/index.js +162 -0
- package/dist/components/MetricCards/Component/CardWithIconAndForecast/index.js +33 -33
- package/dist/components/MultiSelect/SimpleMultiSelect.d.ts +22 -0
- package/dist/components/MultiSelect/SimpleMultiSelect.d.ts.map +1 -0
- package/dist/components/MultiSelect/SimpleMultiSelect.js +221 -0
- package/dist/components/MultiSelect/_helpers/DropdownFooter.js +1 -1
- package/dist/components/MultiSelect/_helpers/OptionRow.js +1 -1
- package/dist/components/MultiSelect/_helpers/OverflowMenu.js +1 -1
- package/dist/components/MultiSelect/_helpers/OverflowMenuItem.js +1 -1
- package/dist/components/MultiSelect/_helpers/SearchResult.js +1 -1
- package/dist/components/MultiSelect/_helpers/TagContent.d.ts.map +1 -1
- package/dist/components/MultiSelect/_helpers/TagContent.js +20 -19
- package/dist/components/MultiSelect/_helpers/TriggerButton.d.ts.map +1 -1
- package/dist/components/MultiSelect/_helpers/TriggerButton.js +39 -34
- package/dist/components/MultiSelect/_types/type.d.ts +3 -0
- package/dist/components/MultiSelect/_types/type.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.js +133 -131
- package/dist/components/ProfileDropdown/_types/profileDropdown.types.d.ts +28 -0
- package/dist/components/ProfileDropdown/_types/profileDropdown.types.d.ts.map +1 -0
- package/dist/components/ProfileDropdown/_types/profileDropdown.types.js +13 -0
- package/dist/components/ProfileDropdown/constants.d.ts +3 -0
- package/dist/components/ProfileDropdown/constants.d.ts.map +1 -0
- package/dist/components/ProfileDropdown/constants.js +8 -0
- package/dist/components/ProfileDropdown/index.d.ts +6 -0
- package/dist/components/ProfileDropdown/index.d.ts.map +1 -0
- package/dist/components/ProfileDropdown/index.js +154 -0
- package/dist/components/Search/index.js +35 -35
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.d.ts +2 -1
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.d.ts.map +1 -1
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +7 -3
- package/dist/components/SingleSelectDropdown/_types/singleSelectDropdown.types.d.ts +2 -2
- package/dist/components/SingleSelectDropdown/_types/singleSelectDropdown.types.d.ts.map +1 -1
- package/dist/components/SingleSelectDropdown/index.d.ts +1 -1
- package/dist/components/SingleSelectDropdown/index.d.ts.map +1 -1
- package/dist/components/SingleSelectDropdown/index.js +61 -57
- package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.d.ts +1 -0
- package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.d.ts.map +1 -1
- package/dist/components/Table/_helpers/ColumnManager/ColumnConfig.js +39 -40
- package/dist/components/Table/_helpers/ColumnManager/index.d.ts.map +1 -1
- package/dist/components/Table/_helpers/ColumnManager/index.js +453 -448
- package/dist/components/Table/_helpers/ExpandableRow/index.d.ts.map +1 -1
- package/dist/components/Table/_helpers/ExpandableRow/index.js +30 -20
- package/dist/components/Table/_helpers/GroupedHeader/index.d.ts +2 -2
- package/dist/components/Table/_helpers/GroupedHeader/index.d.ts.map +1 -1
- package/dist/components/Table/_helpers/GroupedHeader/index.js +79 -87
- package/dist/components/Table/_helpers/TableFilterModal/OptionList.js +1 -1
- package/dist/components/Table/_helpers/TableFilterModal/index.js +14 -14
- package/dist/components/Table/_helpers/TableRows.d.ts +1 -1
- package/dist/components/Table/_helpers/TableRows.d.ts.map +1 -1
- package/dist/components/Table/_helpers/TableRows.js +288 -283
- package/dist/components/Table/_types/table.types.d.ts +9 -3
- package/dist/components/Table/_types/table.types.d.ts.map +1 -1
- package/dist/components/Table/_utils/table.utils.d.ts +3 -0
- package/dist/components/Table/_utils/table.utils.d.ts.map +1 -1
- package/dist/components/Table/_utils/table.utils.js +73 -23
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +382 -357
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +91 -81
- package/dist/styles.module-BXby6f8d.js +16 -0
- package/dist/styles.module-Dojg5FTS.js +41 -0
- package/package.json +1 -1
- package/dist/DropdownFooter-C20yRiDR.js +0 -84
- package/dist/assets/DropdownFooter-C7Cml53c.css +0 -1
- package/dist/assets/index-BQ0m7FKV.css +0 -1
- package/dist/assets/index-Dudb2XKF.css +0 -1
- package/dist/assets/index-w7AdSPwF.css +0 -1
- package/dist/assets/styles-BA66-SUu.css +0 -1
- package/dist/assets/styles-CflOKRvX.css +0 -1
- package/dist/styles.module-CCyijXTv.js +0 -16
- package/dist/styles.module-CmWIIYpK.js +0 -41
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as b, jsx as
|
|
1
|
+
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as p, useLayoutEffect as m } from "react";
|
|
3
3
|
import { LG as _ } from "../../constants.js";
|
|
4
|
-
import { mergeClasses as
|
|
5
|
-
import '../../assets/index-rrYSS2rl.css';const
|
|
4
|
+
import { mergeClasses as x } from "../../utils/mergeClasses.js";
|
|
5
|
+
import '../../assets/index-rrYSS2rl.css';const c = {
|
|
6
6
|
"ckds-checkbox-wrapper": "_ckds-checkbox-wrapper_2erx7_1",
|
|
7
7
|
"ckds-checkbox": "_ckds-checkbox_2erx7_1",
|
|
8
8
|
"ckds-checkbox-sm": "_ckds-checkbox-sm_2erx7_63",
|
|
@@ -11,49 +11,50 @@ import '../../assets/index-rrYSS2rl.css';const e = {
|
|
|
11
11
|
"ckds-checkbox-indeterminate": "_ckds-checkbox-indeterminate_2erx7_99"
|
|
12
12
|
};
|
|
13
13
|
function w({
|
|
14
|
-
checked:
|
|
15
|
-
indeterminate:
|
|
16
|
-
onChange:
|
|
14
|
+
checked: o,
|
|
15
|
+
indeterminate: s = !1,
|
|
16
|
+
onChange: t,
|
|
17
17
|
wrapperClassName: d = "",
|
|
18
18
|
classname: h = "",
|
|
19
19
|
disabled: a = !1,
|
|
20
20
|
size: i = _,
|
|
21
21
|
...n
|
|
22
22
|
}) {
|
|
23
|
-
const
|
|
23
|
+
const k = p(null);
|
|
24
24
|
return m(() => {
|
|
25
|
-
|
|
26
|
-
}, [
|
|
25
|
+
k.current && (k.current.indeterminate = s, k.current.checked = !!o);
|
|
26
|
+
}, [s, o]), /* @__PURE__ */ b(
|
|
27
27
|
"label",
|
|
28
28
|
{
|
|
29
|
-
className:
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
className: x(
|
|
30
|
+
c["ckds-checkbox-wrapper"],
|
|
31
|
+
c[d]
|
|
32
32
|
),
|
|
33
33
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
35
|
"input",
|
|
36
36
|
{
|
|
37
|
-
ref:
|
|
37
|
+
ref: k,
|
|
38
38
|
type: "checkbox",
|
|
39
|
-
checked:
|
|
39
|
+
checked: o,
|
|
40
40
|
onChange: (r) => {
|
|
41
|
-
|
|
41
|
+
t?.(r.target.checked);
|
|
42
42
|
},
|
|
43
43
|
onClick: (r) => r.stopPropagation(),
|
|
44
44
|
disabled: a,
|
|
45
45
|
...n
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
49
|
"span",
|
|
50
50
|
{
|
|
51
|
-
className:
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
className: x(
|
|
52
|
+
c["ckds-checkbox"],
|
|
53
|
+
c[`ckds-checkbox-${i}`],
|
|
54
|
+
s && c["ckds-checkbox-indeterminate"],
|
|
54
55
|
h
|
|
55
56
|
),
|
|
56
|
-
children:
|
|
57
|
+
children: s ? /* @__PURE__ */ e("svg", { className: c["ckds-checkbox-tick"], viewBox: "0 0 16 16", children: /* @__PURE__ */ e("path", { d: "M4 8H12" }) }) : /* @__PURE__ */ e("svg", { className: c["ckds-checkbox-tick"], viewBox: "0 0 16 16", children: /* @__PURE__ */ e("path", { d: "M4 8.5L7 11.5L12 5.5" }) })
|
|
57
58
|
}
|
|
58
59
|
)
|
|
59
60
|
]
|
|
@@ -21,6 +21,8 @@ interface CostCellProps<TRow> {
|
|
|
21
21
|
formatValue: FormatValue<TRow>;
|
|
22
22
|
/** Consumer-supplied diff-class resolver. */
|
|
23
23
|
compareValues: CompareValues;
|
|
24
|
+
/** Column text alignment, forwarded from the column definition. */
|
|
25
|
+
align?: "left" | "center" | "right";
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Body cell wrapper that handles:
|
|
@@ -31,6 +33,6 @@ interface CostCellProps<TRow> {
|
|
|
31
33
|
* The library never produces color classes itself — `compareValues` is what
|
|
32
34
|
* chooses them. We just apply the returned class to the cell wrapper.
|
|
33
35
|
*/
|
|
34
|
-
export declare function CostCell<TRow extends Record<string, unknown>>({ columnKey, columnIndex, orderedKeys, row, valueMapKey, value, comparatorMode, selected, formatValue, compareValues, }: CostCellProps<TRow>): ReactNode;
|
|
36
|
+
export declare function CostCell<TRow extends Record<string, unknown>>({ columnKey, columnIndex, orderedKeys, row, valueMapKey, value, comparatorMode, selected, formatValue, compareValues, align, }: CostCellProps<TRow>): ReactNode;
|
|
35
37
|
export {};
|
|
36
38
|
//# sourceMappingURL=CostCell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostCell.d.ts","sourceRoot":"","sources":["../../../../lib/components/CostComparatorTable/_helpers/CostCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEtF,UAAU,aAAa,CAAC,IAAI;IAC1B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oEAAoE;IACpE,GAAG,EAAE,IAAI,CAAC;IACV,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,8BAA8B;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mCAAmC;IACnC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,6CAA6C;IAC7C,aAAa,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"CostCell.d.ts","sourceRoot":"","sources":["../../../../lib/components/CostComparatorTable/_helpers/CostCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEtF,UAAU,aAAa,CAAC,IAAI;IAC1B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oEAAoE;IACpE,GAAG,EAAE,IAAI,CAAC;IACV,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,8BAA8B;IAC9B,cAAc,EAAE,OAAO,CAAC;IACxB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mCAAmC;IACnC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,6CAA6C;IAC7C,aAAa,EAAE,aAAa,CAAC;IAC7B,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC7D,SAAS,EACT,WAAW,EACX,WAAW,EACX,GAAG,EACH,WAAW,EACX,KAAK,EACL,cAAc,EACd,QAAQ,EACR,WAAW,EACX,aAAa,EACb,KAAK,GACN,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,SAAS,CAoCjC"}
|
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { s as d } from "../../../styles.module-
|
|
4
|
-
import { mergeClasses as
|
|
3
|
+
import { s as d } from "../../../styles.module-BXby6f8d.js";
|
|
4
|
+
import { mergeClasses as g } from "../../../utils/mergeClasses.js";
|
|
5
5
|
import { pickPrecision as V } from "../_utils/costComparator.utils.js";
|
|
6
|
-
function
|
|
6
|
+
function O({
|
|
7
7
|
columnKey: s,
|
|
8
8
|
columnIndex: e,
|
|
9
|
-
orderedKeys:
|
|
10
|
-
row:
|
|
11
|
-
valueMapKey:
|
|
9
|
+
orderedKeys: n,
|
|
10
|
+
row: t,
|
|
11
|
+
valueMapKey: r,
|
|
12
12
|
value: b,
|
|
13
|
-
comparatorMode:
|
|
14
|
-
selected:
|
|
15
|
-
formatValue:
|
|
16
|
-
compareValues: p
|
|
13
|
+
comparatorMode: x,
|
|
14
|
+
selected: o,
|
|
15
|
+
formatValue: C,
|
|
16
|
+
compareValues: p,
|
|
17
|
+
align: k
|
|
17
18
|
}) {
|
|
18
|
-
const
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
21
|
-
if (!
|
|
19
|
+
const i = Number(b ?? 0), m = V(i);
|
|
20
|
+
let l = "", a = !1;
|
|
21
|
+
if (x)
|
|
22
|
+
if (!o.includes(s))
|
|
22
23
|
a = !0;
|
|
23
24
|
else {
|
|
24
|
-
const c =
|
|
25
|
+
const c = o.indexOf(s);
|
|
25
26
|
if (c > 0) {
|
|
26
|
-
const
|
|
27
|
-
|
|
27
|
+
const f = o[c - 1], v = u(t, r, f);
|
|
28
|
+
l = p(i, v, m);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
else if (e > 0) {
|
|
31
|
-
const c =
|
|
32
|
-
|
|
32
|
+
const c = n[e - 1], f = u(t, r, c);
|
|
33
|
+
l = p(i, f, m);
|
|
33
34
|
}
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ N(
|
|
35
36
|
"span",
|
|
36
37
|
{
|
|
37
|
-
className:
|
|
38
|
+
className: g(
|
|
38
39
|
d["ckds-cost-cell"],
|
|
39
40
|
a ? d["ckds-disabled"] : "",
|
|
40
|
-
|
|
41
|
+
l
|
|
41
42
|
),
|
|
42
|
-
|
|
43
|
+
style: { textAlign: k },
|
|
44
|
+
children: C(i, t, s)
|
|
43
45
|
}
|
|
44
46
|
);
|
|
45
47
|
}
|
|
46
|
-
function u(s, e,
|
|
47
|
-
const
|
|
48
|
-
return Number(
|
|
48
|
+
function u(s, e, n) {
|
|
49
|
+
const r = s[e];
|
|
50
|
+
return Number(r?.[n] ?? 0);
|
|
49
51
|
}
|
|
50
52
|
export {
|
|
51
|
-
|
|
53
|
+
O as CostCell
|
|
52
54
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as d, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { CKCheckbox as h } from "../../CKCheckbox/index.js";
|
|
3
|
-
import { s as e } from "../../../styles.module-
|
|
3
|
+
import { s as e } from "../../../styles.module-BXby6f8d.js";
|
|
4
4
|
function l({ label: c, checked: r, disabled: a, onToggle: o }) {
|
|
5
5
|
return /* @__PURE__ */ d("span", { className: `${e["ckds-header-checkbox"]} ${a ? e["ckds-disabled"] : ""}`, children: [
|
|
6
6
|
/* @__PURE__ */ s(
|
|
@@ -3,10 +3,13 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
* One date / period column the user can compare across.
|
|
4
4
|
* `key` is the lookup key used inside each row's value map (e.g. "01-Jan").
|
|
5
5
|
* `label` is what is shown in the header cell.
|
|
6
|
+
* `align` controls text alignment for the header and cells of this column.
|
|
6
7
|
*/
|
|
7
8
|
export interface ComparatorColumn {
|
|
8
9
|
key: string;
|
|
9
10
|
label?: string;
|
|
11
|
+
/** Text alignment for the column header and cells. Defaults to "left". */
|
|
12
|
+
align?: "left" | "center" | "right";
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* Granularity hint. Used by the default header sorter to parse keys
|
|
@@ -70,6 +73,10 @@ export interface CostComparatorTableProps<TRow extends Record<string, unknown>>
|
|
|
70
73
|
/** Sticky behaviour. Defaults to first + last (group + total). */
|
|
71
74
|
stickyStart?: "none" | "first" | "firstTwo";
|
|
72
75
|
stickyEnd?: "none" | "last";
|
|
76
|
+
/** Text alignment for the group (service) column. Defaults to "left". */
|
|
77
|
+
groupColumnAlign?: "left" | "center" | "right";
|
|
78
|
+
/** Text alignment for the total column. Defaults to "left". */
|
|
79
|
+
totalColumnAlign?: "left" | "center" | "right";
|
|
73
80
|
}
|
|
74
81
|
/**
|
|
75
82
|
* Shape of every row CustomTable actually receives after we flatten.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"costComparatorTable.types.d.ts","sourceRoot":"","sources":["../../../../lib/components/CostComparatorTable/_types/costComparatorTable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"costComparatorTable.types.d.ts","sourceRoot":"","sources":["../../../../lib/components/CostComparatorTable/_types/costComparatorTable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,CAAC,IAAI,IAAI,CAC9B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,IAAI,GAAG,SAAS,EACrB,SAAS,EAAE,MAAM,KACd,SAAS,CAAC;AAEf;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,KACd,MAAM,CAAC;AAEZ,MAAM,WAAW,wBAAwB,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5E,mBAAmB;IACnB,IAAI,EAAE,IAAI,EAAE,CAAC;IAEb,6EAA6E;IAC7E,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAEtC,gFAAgF;IAChF,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAE/B;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B,8EAA8E;IAC9E,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAE/C,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,IAAI,CAAE,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -18,6 +18,6 @@ import { CostComparatorTableProps } from './_types/costComparatorTable.types';
|
|
|
18
18
|
* on every render — required for the comparator toggle and selection state
|
|
19
19
|
* to flow through to the header checkboxes.
|
|
20
20
|
*/
|
|
21
|
-
export declare function CostComparatorTable<TRow extends Record<string, unknown>>({ data, comparatorColumns, groupKey, totalKey, valueKey, serviceHeader, footerTotalKey, granularity, formatValue, compareValues, legend, toggleLabel, maxHeight, virtualization, stickyStart, stickyEnd, }: CostComparatorTableProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function CostComparatorTable<TRow extends Record<string, unknown>>({ data, comparatorColumns, groupKey, totalKey, valueKey, serviceHeader, footerTotalKey, granularity, formatValue, compareValues, legend, toggleLabel, maxHeight, virtualization, stickyStart, stickyEnd, groupColumnAlign, totalColumnAlign, }: CostComparatorTableProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export default CostComparatorTable;
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/CostComparatorTable/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,oCAAoC,CAAC;AAI5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACxE,IAAI,EACJ,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAyB,EACzB,cAAwB,EACxB,WAAqB,EACrB,WAAW,EACX,aAAa,EACb,MAAM,EACN,WAAoC,EACpC,SAAS,EACT,cAAsB,EACtB,WAAqB,EACrB,SAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/CostComparatorTable/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,oCAAoC,CAAC;AAI5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACxE,IAAI,EACJ,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAyB,EACzB,cAAwB,EACxB,WAAqB,EACrB,WAAW,EACX,aAAa,EACb,MAAM,EACN,WAAoC,EACpC,SAAS,EACT,cAAsB,EACtB,WAAqB,EACrB,SAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,EAAE,wBAAwB,CAAC,IAAI,CAAC,2CAiMhC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,177 +1,185 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { CustomTable as
|
|
4
|
-
import { Toggle as
|
|
5
|
-
import { CostCell as
|
|
6
|
-
import { HeaderCheckbox as
|
|
7
|
-
import { sortSelectedHeaders as
|
|
8
|
-
import { s as r } from "../../styles.module-
|
|
9
|
-
import { mergeClasses as
|
|
10
|
-
function
|
|
1
|
+
import { jsx as l, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useMemo as p } from "react";
|
|
3
|
+
import { CustomTable as P } from "../Table/index.js";
|
|
4
|
+
import { Toggle as Q } from "../Toggle/index.js";
|
|
5
|
+
import { CostCell as U } from "./_helpers/CostCell.js";
|
|
6
|
+
import { HeaderCheckbox as W } from "./_helpers/HeaderCheckbox.js";
|
|
7
|
+
import { sortSelectedHeaders as X } from "./_utils/costComparator.utils.js";
|
|
8
|
+
import { s as r } from "../../styles.module-BXby6f8d.js";
|
|
9
|
+
import { mergeClasses as Y } from "../../utils/mergeClasses.js";
|
|
10
|
+
function le({
|
|
11
11
|
data: b,
|
|
12
|
-
comparatorColumns:
|
|
13
|
-
groupKey:
|
|
14
|
-
totalKey:
|
|
12
|
+
comparatorColumns: t,
|
|
13
|
+
groupKey: N,
|
|
14
|
+
totalKey: h,
|
|
15
15
|
valueKey: n,
|
|
16
|
-
serviceHeader:
|
|
17
|
-
footerTotalKey:
|
|
18
|
-
granularity:
|
|
16
|
+
serviceHeader: M = "Service",
|
|
17
|
+
footerTotalKey: T = "Total",
|
|
18
|
+
granularity: w = "Daily",
|
|
19
19
|
formatValue: i,
|
|
20
|
-
compareValues:
|
|
21
|
-
legend:
|
|
22
|
-
toggleLabel:
|
|
23
|
-
maxHeight:
|
|
24
|
-
virtualization:
|
|
25
|
-
stickyStart:
|
|
26
|
-
stickyEnd:
|
|
20
|
+
compareValues: x,
|
|
21
|
+
legend: S,
|
|
22
|
+
toggleLabel: z = "Cost Comparator Mode",
|
|
23
|
+
maxHeight: F,
|
|
24
|
+
virtualization: H = !1,
|
|
25
|
+
stickyStart: u = "first",
|
|
26
|
+
stickyEnd: D = "last",
|
|
27
|
+
groupColumnAlign: _,
|
|
28
|
+
totalColumnAlign: m
|
|
27
29
|
}) {
|
|
28
|
-
const [c,
|
|
29
|
-
() =>
|
|
30
|
-
[
|
|
31
|
-
),
|
|
30
|
+
const [c, L] = R(!1), [g, C] = R([]), j = p(
|
|
31
|
+
() => t.map((s) => s.key),
|
|
32
|
+
[t]
|
|
33
|
+
), q = p(
|
|
32
34
|
() => b.map((s) => {
|
|
33
|
-
const d = s[n] ?? {},
|
|
34
|
-
__group: s[
|
|
35
|
-
__total: Number(s[
|
|
35
|
+
const d = s[n] ?? {}, o = {
|
|
36
|
+
__group: s[N],
|
|
37
|
+
__total: Number(s[h] ?? 0),
|
|
36
38
|
__original: s
|
|
37
39
|
};
|
|
38
|
-
for (const e of
|
|
39
|
-
|
|
40
|
-
return
|
|
40
|
+
for (const e of t)
|
|
41
|
+
o[e.key] = d[e.key];
|
|
42
|
+
return o;
|
|
41
43
|
}),
|
|
42
|
-
[b,
|
|
43
|
-
),
|
|
44
|
+
[b, t, N, h, n]
|
|
45
|
+
), B = p(() => {
|
|
44
46
|
const s = {
|
|
45
47
|
accessorKey: "__group",
|
|
46
|
-
header:
|
|
48
|
+
header: M,
|
|
47
49
|
enableSorting: !1,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
align: _,
|
|
51
|
+
cell: (e) => /* @__PURE__ */ l("span", { style: { textAlign: _ }, children: e.getValue() })
|
|
52
|
+
}, d = t.map((e, k) => {
|
|
53
|
+
const a = e.label ?? e.key, v = g.includes(e.key), I = c && !v;
|
|
51
54
|
return {
|
|
52
55
|
accessorKey: e.key,
|
|
53
56
|
enableSorting: !1,
|
|
57
|
+
align: e.align,
|
|
54
58
|
header: () => c ? /* @__PURE__ */ l(
|
|
55
|
-
|
|
59
|
+
W,
|
|
56
60
|
{
|
|
57
61
|
label: a,
|
|
58
|
-
checked:
|
|
59
|
-
disabled:
|
|
62
|
+
checked: v,
|
|
63
|
+
disabled: I,
|
|
60
64
|
onToggle: () => {
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
return
|
|
65
|
+
C((f) => {
|
|
66
|
+
const J = f.includes(e.key) ? f.filter((O) => O !== e.key) : [...f, e.key];
|
|
67
|
+
return X(J, w, t);
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
) : /* @__PURE__ */ l("span", { className: r["ckds-header-label"], children: a }),
|
|
68
72
|
cell: (f) => /* @__PURE__ */ l(
|
|
69
|
-
|
|
73
|
+
U,
|
|
70
74
|
{
|
|
71
75
|
columnKey: e.key,
|
|
72
76
|
columnIndex: k,
|
|
73
|
-
orderedKeys:
|
|
77
|
+
orderedKeys: j,
|
|
74
78
|
row: f.row.original.__original,
|
|
75
79
|
valueMapKey: n,
|
|
76
80
|
value: f.getValue(),
|
|
77
81
|
comparatorMode: c,
|
|
78
82
|
selected: g,
|
|
79
83
|
formatValue: i,
|
|
80
|
-
compareValues:
|
|
84
|
+
compareValues: x,
|
|
85
|
+
align: e.align
|
|
81
86
|
}
|
|
82
87
|
)
|
|
83
88
|
};
|
|
84
|
-
}),
|
|
89
|
+
}), o = {
|
|
85
90
|
accessorKey: "__total",
|
|
86
91
|
header: "Total",
|
|
87
92
|
enableSorting: !1,
|
|
88
|
-
|
|
93
|
+
align: m,
|
|
94
|
+
cell: (e) => /* @__PURE__ */ l("span", { className: r["ckds-total-cell"], style: { textAlign: m }, children: i(
|
|
89
95
|
Number(e.getValue() ?? 0),
|
|
90
96
|
e.row.original.__original,
|
|
91
97
|
"__total"
|
|
92
98
|
) })
|
|
93
99
|
};
|
|
94
100
|
return {
|
|
95
|
-
columns: [s, ...d,
|
|
101
|
+
columns: [s, ...d, o],
|
|
96
102
|
columnVisibility: {},
|
|
97
103
|
wrapText: !1,
|
|
98
104
|
stripedRows: !1,
|
|
99
|
-
stickyStart:
|
|
100
|
-
stickyEnd:
|
|
105
|
+
stickyStart: u,
|
|
106
|
+
stickyEnd: D
|
|
101
107
|
};
|
|
102
108
|
}, [
|
|
103
|
-
|
|
109
|
+
t,
|
|
104
110
|
c,
|
|
105
111
|
g,
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
w,
|
|
113
|
+
j,
|
|
108
114
|
n,
|
|
109
115
|
i,
|
|
116
|
+
x,
|
|
110
117
|
M,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
u,
|
|
119
|
+
D,
|
|
120
|
+
_,
|
|
121
|
+
m
|
|
122
|
+
]), G = p(() => {
|
|
115
123
|
const s = {};
|
|
116
|
-
for (const e of
|
|
124
|
+
for (const e of t) s[e.key] = 0;
|
|
117
125
|
let d = 0;
|
|
118
126
|
for (const e of b) {
|
|
119
127
|
const k = e[n] ?? {};
|
|
120
|
-
for (const a of
|
|
128
|
+
for (const a of t)
|
|
121
129
|
s[a.key] = (s[a.key] ?? 0) + Number(k[a.key] ?? 0);
|
|
122
|
-
d += Number(e[
|
|
130
|
+
d += Number(e[h] ?? 0);
|
|
123
131
|
}
|
|
124
|
-
const
|
|
125
|
-
for (const e of
|
|
132
|
+
const o = { __group: T };
|
|
133
|
+
for (const e of t) {
|
|
126
134
|
const k = s[e.key], a = c && !g.includes(e.key);
|
|
127
|
-
|
|
135
|
+
o[e.key] = /* @__PURE__ */ l("span", { className: Y(a ? r["ckds-disabled"] : ""), children: i(k, void 0, e.key) });
|
|
128
136
|
}
|
|
129
|
-
return
|
|
137
|
+
return o.__total = i(d, void 0, "__total"), o;
|
|
130
138
|
}, [
|
|
131
139
|
b,
|
|
132
|
-
|
|
140
|
+
t,
|
|
133
141
|
n,
|
|
134
|
-
|
|
135
|
-
|
|
142
|
+
h,
|
|
143
|
+
T,
|
|
136
144
|
c,
|
|
137
145
|
g,
|
|
138
146
|
i
|
|
139
147
|
]);
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ y("div", { className: r["ckds-cost-comparator-wrapper"], children: [
|
|
149
|
+
/* @__PURE__ */ y("div", { className: r["ckds-cost-comparator-toolbar"], children: [
|
|
150
|
+
/* @__PURE__ */ y("label", { className: r["ckds-cost-comparator-toggle"], children: [
|
|
143
151
|
/* @__PURE__ */ l(
|
|
144
|
-
|
|
152
|
+
Q,
|
|
145
153
|
{
|
|
146
154
|
checked: c,
|
|
147
155
|
onChange: (s) => {
|
|
148
|
-
|
|
156
|
+
L(s), C([]);
|
|
149
157
|
},
|
|
150
158
|
size: "small"
|
|
151
159
|
}
|
|
152
160
|
),
|
|
153
|
-
/* @__PURE__ */ l("span", { className: r["ckds-cost-comparator-toggle-label"], children:
|
|
161
|
+
/* @__PURE__ */ l("span", { className: r["ckds-cost-comparator-toggle-label"], children: z })
|
|
154
162
|
] }),
|
|
155
|
-
|
|
163
|
+
S ? /* @__PURE__ */ l("div", { className: r["ckds-cost-comparator-legend"], children: S }) : null
|
|
156
164
|
] }),
|
|
157
165
|
/* @__PURE__ */ l(
|
|
158
|
-
|
|
166
|
+
P,
|
|
159
167
|
{
|
|
160
168
|
config: {
|
|
161
169
|
headers: [],
|
|
162
170
|
showColumnManager: !1,
|
|
163
171
|
showFilters: !1
|
|
164
172
|
},
|
|
165
|
-
data:
|
|
166
|
-
externalTableConfig:
|
|
167
|
-
totalRow:
|
|
168
|
-
maxHeight:
|
|
169
|
-
virtualization:
|
|
173
|
+
data: q,
|
|
174
|
+
externalTableConfig: B,
|
|
175
|
+
totalRow: G,
|
|
176
|
+
maxHeight: F,
|
|
177
|
+
virtualization: H
|
|
170
178
|
}
|
|
171
179
|
)
|
|
172
180
|
] });
|
|
173
181
|
}
|
|
174
182
|
export {
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
le as CostComparatorTable,
|
|
184
|
+
le as default
|
|
177
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAelG,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,oBAAoB,EAGrB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AA+H9D,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../lib/components/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAelG,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,oBAAoB,EAGrB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AA+H9D,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2a1D,CAAC"}
|