@oliasoft-open-source/react-ui-library 4.6.9-beta-1 → 4.6.10
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/404.html +1 -0
- package/dist/assets/{index-faqWAJWP.js → index-D5bNrBhF.js} +11 -7
- package/dist/assets/{index-ChHypG1u.css → index-UHom3TOS.css} +16 -10
- package/dist/global.css +16 -10
- package/dist/index.d.ts +0 -22
- package/dist/index.html +1 -1
- package/dist/index.js +18 -158
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-Z5sK3XI3.js → Color-6VNJS4EI-S5le4vNb.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-V4NlgkVD.js → DocsRenderer-NNNQARDV-QgL8NKiF.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-V3YHNWJZ-n5RY-jXL.js → WithTooltip-V3YHNWJZ-7B-rXcBp.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-rvf_KSkf.js → accordion.stories-Ckfdc3yE.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-7YupNRlV.js → buttons-and-links-l1cdvk0B.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-6R0hRdCq.js → casing-loads.stories-qq7nVcz2.js} +1 -1
- package/dist/storybook/assets/{cell.stories-aDJ0YBLq.js → cell.stories-7M24NqPM.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-XLYdcxXs.js → chunk-HLWAVYOI-wmzLJ9-h.js} +1 -1
- package/dist/storybook/assets/{color-NxP93yaH.js → color-VB4JH33E.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-ZuAa6172.js → file-input.stories-CKHDJSbg.js} +1 -1
- package/dist/storybook/assets/{footer.stories-ZMPDPnnC.js → footer.stories-rwoGk_OR.js} +1 -1
- package/dist/storybook/assets/{form.stories-raJ_-60i.js → form.stories-2_i-WsPk.js} +1 -1
- package/dist/storybook/assets/{formation.stories-hf47ETfS.js → formation.stories-DzFYQPb4.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-yKw2uSJu.js → formatter-SWP5E3XI-UrDl3kuy.js} +1 -1
- package/dist/storybook/assets/{iframe-ZAYt1_h5.js → iframe-77cal8Df.js} +2 -2
- package/dist/storybook/assets/{index-oOnKy0ih.js → index-mn0MBpQz.js} +5 -5
- package/dist/storybook/assets/{input-validation-ZAH73PKA.js → input-validation-_eS0j_cT.js} +1 -1
- package/dist/storybook/assets/{inputs-q_polzRu.js → inputs-CWq4teY0.js} +1 -1
- package/dist/storybook/assets/{layout-forms-7gaTsqRb.js → layout-forms-3N4vPD6K.js} +1 -1
- package/dist/storybook/assets/{layout-general-lhXJ2QUn.js → layout-general-hNBHlVLN.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-lItMcm8V.js → padding-and-spacing-rtBkdyAx.js} +1 -1
- package/dist/storybook/assets/{preview-H9heiVBM.js → preview-oqNaWrXT.js} +1 -1
- package/dist/storybook/assets/{preview-k7tq6q9C.js → preview-p_RCboWj.js} +2 -2
- package/dist/storybook/assets/row.stories-c7qJDc3O.js +130 -0
- package/dist/storybook/assets/{syntaxhighlighter-B5GMVT5T-gS3HJKcc.js → syntaxhighlighter-B5GMVT5T-GPi2Sox4.js} +1 -1
- package/dist/storybook/assets/table-plX5wbPy.js +1 -0
- package/dist/storybook/assets/table-smKT-hbF.css +1 -0
- package/dist/storybook/assets/table.stories-data-9T_1BLo6.js +1 -0
- package/dist/storybook/assets/{table.stories-G14SBspc.js → table.stories-w4weqjQS.js} +1 -1
- package/dist/storybook/assets/{textarea-KPKJt9L7.js → textarea-XY_iUfzV.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-7DZ5m1lo.js → textarea.stories-tpIT4O3R.js} +1 -1
- package/dist/storybook/assets/{title.stories-fKMID_pc.js → title.stories-o7fCo4X-.js} +4 -4
- package/dist/storybook/assets/{unit-table.stories-ddutc_iU.js → unit-table.stories-uJ7dutYc.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/stories.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/row.stories-G_GPRlN5.js +0 -122
- package/dist/storybook/assets/table-PWodWi0p.css +0 -1
- package/dist/storybook/assets/table-oIcCiJqg.js +0 -1
- package/dist/storybook/assets/table.stories-data-Bg4REEx4.js +0 -1
package/package.json
CHANGED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as R}from"./index-RfLt4OUa.js";import{T as c}from"./table-oIcCiJqg.js";import{T as V}from"./text-6KQ6ntOV.js";import{t as g,s as W,u as B}from"./table.stories-data-Bg4REEx4.js";import"./index-VW3EWkuE.js";import"./index.es-VXFRDikp.js";import"./inheritsLoose-8sb_A2v4.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./lodash-Bmg8FrMx.js";import"./actions-eW7plDvv.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./button-yLYf8aC9.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./tooltip-gljV_DQ0.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-AvGkZ8ae.js";import"./help-icon-4sFVvBkZ.js";import"./pagination-yFWOmymz.js";import"./select-xiPCWaz8.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-w-UScEUy.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-hrCn3Rag.js";import"./index-qZmQ7nA9.js";import"./index-cCpkwrS5.js";import"./check-box-TRAFDvOc.js";import"./slider-at3_DXQg.js";import"./index-ugi_ZH6T.js";import"./popover-YDVuwgEX.js";import"./flex-RYZsoWEN.js";const Me={title:"Basic/Table/Row",component:c,args:{table:{...g}}},b=n=>o.jsx(c,{...n}),i=b.bind({});i.args={table:W};const p=b.bind({});p.args={table:B};const t=b.bind({});t.args={table:{...g,striped:!1}};t.parameters={docs:{description:{story:"`striped: false` removes tinted background on alternative rows."}}};const m=()=>{const[n,e]=R.useState(null),a=r=>e(n===r?null:r);return o.jsx(c,{table:{...g,striped:!1,rows:g.rows.map((r,u)=>({...r,onRowClick:()=>a(u),expandedContent:{content:n===u?o.jsx("div",{children:"Example expanded content"}):null}}))}})},w=()=>{const n={draggable:!0,headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{noDrag:!0,cells:[{value:"Undraggable"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},e=(s,d,l)=>{const x=[...s];return s[l].noDrag?s:(x.splice(l,0,x.splice(d,1)[0]),x)},[a,r]=R.useState(n.rows),u=s=>{const{to:d,from:l}=s;e(a,l,d),r(e(a,l,d))};return o.jsx(c,{table:{...n,rows:a},onListReorder:u})},v=()=>{const[n,e]=R.useState("Hover any row!"),a=[1,2,3,4,5].map(r=>({cells:[{value:`Row ${r}`},{value:`${r**2}`}],onRowMouseEnter:()=>e(`Hovering row ${r}`),onRowMouseLeave:()=>e("Not hovering any row...")}));return o.jsxs(o.Fragment,{children:[o.jsx(V,{children:n}),o.jsx(c,{table:{fixedWidth:"100%",headers:[{cells:[{value:"Description"},{value:"Value"}],onRowMouseEnter:()=>e("Hovering header row"),onRowMouseLeave:()=>e("Not hovering any row...")}],rows:a}})]})};var y,D,E;i.parameters={...i.parameters,docs:{...(y=i.parameters)==null?void 0:y.docs,source:{originalSource:`args => {
|
|
2
|
-
return <Table
|
|
3
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
|
-
{...args} />;
|
|
5
|
-
}`,...(E=(D=i.parameters)==null?void 0:D.docs)==null?void 0:E.source}}};var h,T,f;p.parameters={...p.parameters,docs:{...(h=p.parameters)==null?void 0:h.docs,source:{originalSource:`args => {
|
|
6
|
-
return <Table
|
|
7
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
8
|
-
{...args} />;
|
|
9
|
-
}`,...(f=(T=p.parameters)==null?void 0:T.docs)==null?void 0:f.source}}};var S,j,k;t.parameters={...t.parameters,docs:{...(S=t.parameters)==null?void 0:S.docs,source:{originalSource:`args => {
|
|
10
|
-
return <Table
|
|
11
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
12
|
-
{...args} />;
|
|
13
|
-
}`,...(k=(j=t.parameters)==null?void 0:j.docs)==null?void 0:k.source}}};var A,L,M;m.parameters={...m.parameters,docs:{...(A=m.parameters)==null?void 0:A.docs,source:{originalSource:`() => {
|
|
14
|
-
const [expandedRow, setExpandedRow] = useState<number | null>(null);
|
|
15
|
-
const toggleExpandedRow = (rowIndex: number) => expandedRow === rowIndex ? setExpandedRow(null) : setExpandedRow(rowIndex);
|
|
16
|
-
return <Table table={{
|
|
17
|
-
...storyData.table,
|
|
18
|
-
striped: false,
|
|
19
|
-
rows: storyData.table.rows.map((row, index) => ({
|
|
20
|
-
...row,
|
|
21
|
-
onRowClick: () => toggleExpandedRow(index),
|
|
22
|
-
expandedContent: {
|
|
23
|
-
content: expandedRow === index ? <div>Example expanded content</div> : null
|
|
24
|
-
}
|
|
25
|
-
}))
|
|
26
|
-
}} />;
|
|
27
|
-
}`,...(M=(L=m.parameters)==null?void 0:L.docs)==null?void 0:M.source}}};var N,C,F;w.parameters={...w.parameters,docs:{...(N=w.parameters)==null?void 0:N.docs,source:{originalSource:`() => {
|
|
28
|
-
const withDragAndDrop = {
|
|
29
|
-
draggable: true,
|
|
30
|
-
headers: [{
|
|
31
|
-
cells: [{
|
|
32
|
-
value: 'Name'
|
|
33
|
-
}, {
|
|
34
|
-
value: 'Weight (kg)'
|
|
35
|
-
}, {
|
|
36
|
-
value: 'Energy (kcal / 100g)'
|
|
37
|
-
}, {
|
|
38
|
-
value: 'Origin'
|
|
39
|
-
}]
|
|
40
|
-
}],
|
|
41
|
-
rows: [{
|
|
42
|
-
noDrag: true,
|
|
43
|
-
cells: [{
|
|
44
|
-
value: 'Undraggable'
|
|
45
|
-
}, {
|
|
46
|
-
value: 100
|
|
47
|
-
}, {
|
|
48
|
-
value: 361
|
|
49
|
-
}, {
|
|
50
|
-
value: 'Vietnam'
|
|
51
|
-
}]
|
|
52
|
-
}, {
|
|
53
|
-
cells: [{
|
|
54
|
-
value: 'Buckwheat'
|
|
55
|
-
}, {
|
|
56
|
-
value: 50
|
|
57
|
-
}, {
|
|
58
|
-
value: 358
|
|
59
|
-
}, {
|
|
60
|
-
value: 'Poland'
|
|
61
|
-
}]
|
|
62
|
-
}, {
|
|
63
|
-
cells: [{
|
|
64
|
-
value: 'Couscous'
|
|
65
|
-
}, {
|
|
66
|
-
value: 10
|
|
67
|
-
}, {
|
|
68
|
-
value: 368
|
|
69
|
-
}, {
|
|
70
|
-
value: 'France'
|
|
71
|
-
}]
|
|
72
|
-
}]
|
|
73
|
-
};
|
|
74
|
-
const arraymove = (arr: any, from: any, to: any) => {
|
|
75
|
-
const copy = [...arr];
|
|
76
|
-
if (arr[to].noDrag) {
|
|
77
|
-
return arr;
|
|
78
|
-
}
|
|
79
|
-
copy.splice(to, 0, copy.splice(from, 1)[0]);
|
|
80
|
-
return copy;
|
|
81
|
-
};
|
|
82
|
-
const [rows, setRows] = useState(withDragAndDrop.rows);
|
|
83
|
-
const onListReorder = (reorderData: any) => {
|
|
84
|
-
const {
|
|
85
|
-
to,
|
|
86
|
-
from
|
|
87
|
-
} = reorderData;
|
|
88
|
-
arraymove(rows, from, to);
|
|
89
|
-
setRows(arraymove(rows, from, to));
|
|
90
|
-
};
|
|
91
|
-
return <Table table={{
|
|
92
|
-
...withDragAndDrop,
|
|
93
|
-
rows
|
|
94
|
-
}} onListReorder={onListReorder} />;
|
|
95
|
-
}`,...(F=(C=w.parameters)==null?void 0:C.docs)==null?void 0:F.source}}};var H,$,O;v.parameters={...v.parameters,docs:{...(H=v.parameters)==null?void 0:H.docs,source:{originalSource:`() => {
|
|
96
|
-
const [displayText, setDisplayText] = useState('Hover any row!');
|
|
97
|
-
const rows = [1, 2, 3, 4, 5].map(val => ({
|
|
98
|
-
cells: [{
|
|
99
|
-
value: \`Row \${val}\`
|
|
100
|
-
}, {
|
|
101
|
-
value: \`\${val ** 2}\`
|
|
102
|
-
}],
|
|
103
|
-
onRowMouseEnter: () => setDisplayText(\`Hovering row \${val}\`),
|
|
104
|
-
onRowMouseLeave: () => setDisplayText('Not hovering any row...')
|
|
105
|
-
}));
|
|
106
|
-
return <>
|
|
107
|
-
<Text>{displayText}</Text>
|
|
108
|
-
<Table table={{
|
|
109
|
-
fixedWidth: '100%',
|
|
110
|
-
headers: [{
|
|
111
|
-
cells: [{
|
|
112
|
-
value: 'Description'
|
|
113
|
-
}, {
|
|
114
|
-
value: 'Value'
|
|
115
|
-
}],
|
|
116
|
-
onRowMouseEnter: () => setDisplayText(\`Hovering header row\`),
|
|
117
|
-
onRowMouseLeave: () => setDisplayText('Not hovering any row...')
|
|
118
|
-
}],
|
|
119
|
-
rows
|
|
120
|
-
}} />
|
|
121
|
-
</>;
|
|
122
|
-
}`,...(O=($=v.parameters)==null?void 0:$.docs)==null?void 0:O.source}}};const Ne=["ActiveRow","RowFocusEvent","NotStriped","Expandable","DragAndDrop","OnRowEnter"];export{i as ActiveRow,w as DragAndDrop,m as Expandable,t as NotStriped,v as OnRowEnter,p as RowFocusEvent,Ne as __namedExportsOrder,Me as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._inputInTable_y9car_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_y9car_1:not(:hover){border-color:transparent}._inputInTable_y9car_1:not(:focus){box-shadow:none}._inputHover_y9car_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_y9car_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_y9car_25,._inputWarning_y9car_26{position:relative}._inputError_y9car_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_y9car_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_y9car_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_y9car_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_y9car_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_y9car_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_y9car_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_y9car_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_y9car_67::-webkit-scrollbar{display:none}:root{--color-background-table-header: var(--color-neutral-150);--color-background-table-row-tinted: var(--color-neutral-50)}html[data-theme=dark]{--color-background-table-header: var(--color-neutral-800);--color-background-table-row-tinted: var(--color-neutral-800)}._wrapper_y9car_85{border-radius:inherit;max-height:100%;max-width:100%;display:flex;flex-direction:column;overflow:hidden}._wrapper_y9car_85._bordered_y9car_93{border-radius:var(--border-radius);border:1px solid var(--color-border);box-shadow:var(--shadow-card)}._scroll_y9car_98{overflow-y:auto;border-radius:inherit;flex:1;min-height:0}._scroll_y9car_98:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}._table_y9car_108{background:var(--color-background-raised);color:var(--color-text);border-collapse:separate;border-spacing:0;border-radius:inherit;width:100%;font-variant-numeric:tabular-nums}._table_y9car_108>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_y9car_108>:first-child>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}._table_y9car_108>:first-child>:first-child>:first-child{border-top-left-radius:inherit}._table_y9car_108>:first-child>:first-child>:last-child{border-top-right-radius:inherit}._table_y9car_108>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_y9car_108>:last-child>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}._table_y9car_108>:last-child>:last-child>:first-child{border-bottom-left-radius:inherit}._table_y9car_108>:last-child>:last-child>:last-child{border-bottom-right-radius:inherit}th,td{padding:var(--padding-input)!important;height:var(--size);background:inherit;border-color:var(--color-border);border-style:solid;border-width:0}th:not(:first-child),td:not(:first-child){border-left-width:1px}._table_y9car_108>*:not(:last-child)>tr th,._table_y9car_108>*:not(:last-child)>tr td,._table_y9car_108>*:last-child>tr:not(:last-child) th,._table_y9car_108>*:last-child>tr:not(:last-child) td{border-bottom-width:1px}@-moz-document url-prefix(){tr{height:var(--size)}td,th{height:100%}}thead{position:sticky;top:0;overflow:hidden;z-index:5}thead tr{background-color:var(--color-background-table-header)}tbody{overflow:hidden}tbody tr{background-color:var(--color-background-raised)}._striped_y9car_188 tbody tr:nth-child(2n){background-color:var(--color-background-table-row-tinted)}._title_zn5s7_1{background-color:var(--color-background-cardheader);border-bottom:1px solid var(--color-border);padding:var(--padding-xxs) var(--padding-sm);display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;border-top-left-radius:inherit;border-top-right-radius:inherit;flex-shrink:0}._footer_4sumy_1{background-color:var(--color-background-table-header);z-index:4;overflow:hidden;flex-shrink:0}._section_4sumy_7{padding:var(--padding-input);display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--color-border)}._clickableRow_11d5t_1{cursor:pointer}._hoverableRow_11d5t_4:not(._rowActive_11d5t_4):hover,._clickableRow_11d5t_1:not(._rowActive_11d5t_4):hover{background-color:var(--color-background-listitem-hover)!important}._expandableRow_11d5t_8._flush_11d5t_8{padding:0!important;height:auto!important}._rowActive_11d5t_4{position:relative;background-color:var(--color-background-listitem-active)!important}._rowActive_11d5t_4:after{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;border-top-left-radius:inherit;border-bottom-left-radius:inherit;transition:background .3s;background:var(--color-background-primary)}._dragIconCell_11d5t_28{width:var(--size);min-width:var(--size);position:relative}._dragIcon_11d5t_28{display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;color:var(--color-text-faint)}._dragIcon_11d5t_28:hover{color:var(--color-text-primary-hover)}._dragIcon_11d5t_28:active{color:var(--color-text-primary-active)}._inputInTable_u3xdj_1{background-color:transparent;border-radius:inherit!important;height:var(--size);min-height:100%}._inputInTable_u3xdj_1:not(:hover){border-color:transparent}._inputInTable_u3xdj_1:not(:focus){box-shadow:none}._inputHover_u3xdj_13{position:relative;border-color:var(--color-border-hover);z-index:2}._inputFocus_u3xdj_18{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputError_u3xdj_25,._inputWarning_u3xdj_26{position:relative}._inputError_u3xdj_25{z-index:2;border-color:var(--color-border-error);color:var(--color-text-error)!important;background-color:var(--color-background-error-muted)}._inputError_u3xdj_25:hover{border-color:var(--color-border-error-hover)!important}._inputError_u3xdj_25:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputWarning_u3xdj_26{z-index:1;border-color:var(--color-border-warning);color:var(--color-text-warning)!important;background-color:var(--color-background-warning-muted)}._inputWarning_u3xdj_26:hover{border-color:var(--color-border-warning-hover)!important}._inputWarning_u3xdj_26:focus{position:relative;outline:none!important;border-color:var(--color-border-focus)!important;box-shadow:var(--shadow-focus);z-index:3}._inputDisabled_u3xdj_61{pointer-events:none;background-color:var(--color-background-disabled);color:var(--color-text-muted);box-shadow:none}._hideScrollbars_u3xdj_67{scrollbar-width:none;-ms-overflow-style:none}._hideScrollbars_u3xdj_67::-webkit-scrollbar{display:none}._cell_u3xdj_77 a{cursor:pointer;color:var(--color-text-primary)}._cell_u3xdj_77 a:hover{color:var(--color-text-primary-hover)}._cell_u3xdj_77 a:active{color:var(--color-text-primary-active)}._cell_u3xdj_77 a._disabledLink_u3xdj_87{color:var(--color-text-faint)!important;cursor:default!important}._inputWrapper_u3xdj_91{height:100%;border-radius:inherit}._inputWrapper_u3xdj_91>span,._inputWrapper_u3xdj_91>span>span,._inputWrapper_u3xdj_91>span>span>div{height:100%;border-radius:inherit}._inputWrapper_u3xdj_91>div,._inputWrapper_u3xdj_91>div>span{height:100%;border-radius:inherit}._breakWord_u3xdj_106{word-break:break-word}._inputCell_u3xdj_109{padding:0!important}._sliderCell_u3xdj_112{padding-top:0!important;padding-bottom:0!important}._staticCell_u3xdj_116{padding:0!important}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119{line-height:1.25;min-height:100%;padding:var(--padding-input);position:relative;border-radius:inherit;display:flex;align-items:center}tbody ._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119{color:var(--color-text-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._error_u3xdj_131,._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._warning_u3xdj_132{border:1px solid transparent}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._error_u3xdj_131{background-color:var(--color-background-error-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._warning_u3xdj_132{background-color:var(--color-background-warning-muted)}._staticCell_u3xdj_116 ._staticCellContent_u3xdj_119._unit_u3xdj_141{font-weight:400}._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119{position:relative;padding-right:calc(var(--size) + var(--padding-xxs))!important;cursor:pointer!important}._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119:hover{background-color:#0000000d!important}[data-theme=dark] ._sortingCell_u3xdj_144 ._staticCellContent_u3xdj_119:hover{background-color:#ffffff1a!important}._sortingCell_u3xdj_144 ._sortingCellIcon_u3xdj_155{font-size:var(--size-xs);position:absolute;right:var(--padding-input-x);top:50%;transform:translateY(-50%);display:flex}._sortingCell_u3xdj_144 ._sortingCellIcon_u3xdj_155>*{display:flex}._icon_u3xdj_166{display:inline-flex;margin-left:var(--padding-xxs)}._checkBoxCell_u3xdj_170{padding-block:0!important;width:var(--size)}._iconCellWrapper_u3xdj_174{display:flex;justify-content:center}._actionsCell_u3xdj_178{width:var(--size-sm);padding:0 calc((var(--size) - var(--size-sm)) / 2)!important;position:sticky;right:0;background:inherit;z-index:4}._rightAligned_u3xdj_186{text-align:right!important}._rightAligned_u3xdj_186 ._staticCellContent_u3xdj_119{justify-content:flex-end}._centerAligned_u3xdj_192{text-align:center!important}._centerAligned_u3xdj_192 ._staticCellContent_u3xdj_119{justify-content:center}._leftAligned_u3xdj_198{text-align:left!important}._popover_u3xdj_201{padding:var(--padding-input)}._disabledPointerEvents_u3xdj_204{pointer-events:none}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-FsUICBgo.js";import{r as T}from"./index-RfLt4OUa.js";import{c as N}from"./index-VW3EWkuE.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-VXFRDikp.js";import{l as Fe}from"./lodash-Bmg8FrMx.js";import{A as ge}from"./actions-eW7plDvv.js";import{H as $e}from"./heading-AvGkZ8ae.js";import{P as Be}from"./pagination-yFWOmymz.js";import{A as b,I as $}from"./common-types-U65vzrrz.js";import{I as Oe}from"./input-w-UScEUy.js";import{N as Me}from"./number-input-hrCn3Rag.js";import{S as Ue}from"./select-xiPCWaz8.js";import{D as Ge}from"./disabled-context-urNQThQz.js";import{i as B}from"./types-5uVBABF4.js";import{T as fe}from"./tooltip-gljV_DQ0.js";import{C as Xe}from"./check-box-TRAFDvOc.js";import{S as ze}from"./slider-at3_DXQg.js";import{I as O}from"./icon-8EQazuuW.js";import{P as Je}from"./popover-YDVuwgEX.js";import{H as Ee}from"./help-icon-4sFVvBkZ.js";import{T as ne}from"./text-6KQ6ntOV.js";const Ke="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Qe="_inputFocus_y9car_18",Ze="_inputError_y9car_25",en="_inputWarning_y9car_26",nn="_inputDisabled_y9car_61",tn="_hideScrollbars_y9car_67",rn="_wrapper_y9car_85",an="_bordered_y9car_93",ln="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",H={inputInTable:Ke,inputHover:Ye,inputFocus:Qe,inputError:Ze,inputWarning:en,inputDisabled:nn,hideScrollbars:tn,wrapper:rn,bordered:an,scroll:ln,table:on,striped:sn},dn="_title_zn5s7_1",cn={title:dn},G=({name:e=null,actions:t=null,actionsRight:r=!1,testId:l})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const u=n.jsx(ge,{actions:t});return r?u:n.jsx("div",{children:u})};return n.jsxs("div",{className:cn.title,children:[a?n.jsx($e,{children:n.jsx("span",{"data-testid":l,children:e})}):null,s()]})};try{G.displayName="Title",G.__docgenInfo={description:"",displayName:"Title",props:{name:{defaultValue:{value:"null"},description:"",name:"name",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},actions:{defaultValue:{value:"null"},description:"",name:"actions",required:!1,type:{name:"any"}},actionsRight:{defaultValue:{value:"false"},description:"",name:"actionsRight",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const un="_footer_4sumy_1",pn="_section_4sumy_7",te={footer:un,section:pn},X=({colSpan:e,pagination:t,actions:r,content:l})=>{const a=r&&r.length,o=l!=null,s=()=>{var d,p;if(t){const{rowCount:c,rowsPerPage:g}=t,y=Number((p=(d=g==null?void 0:g.options)==null?void 0:d[0])==null?void 0:p.value);return c>y}return!1};return a||o||s()?n.jsxs("div",{className:te.footer,children:[o?n.jsx("div",{className:te.section,children:n.jsx("div",{children:l})}):null,a||s()?n.jsxs("div",{className:te.section,children:[s()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ge,{actions:r})})]}):null]}):null};try{X.displayName="Footer",X.__docgenInfo={description:"",displayName:"Footer",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!1,type:{name:"number"}},pagination:{defaultValue:null,description:"",name:"pagination",required:!0,type:{name:"IPagination"}},actions:{defaultValue:null,description:"",name:"actions",required:!1,type:{name:"IAction[]"}},content:{defaultValue:null,description:"",name:"content",required:!1,type:{name:"ReactNode"}}}}}catch{}const Se=e=>{const t=Math.max(...e.reduce((r,l)=>{const a=l.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},mn=(e,t)=>{const r=[Se(t),Se(e)];return Math.max(...r)},Ve=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),_n=(e,t)=>Ve(t)>0||Ve(e)>0,z=({table:e,children:t})=>{const{rows:r,infiniteScroll:l}=e,a=Math.ceil(window.innerHeight/30),[o,s]=l?T.useState(a):[r.length,null],[u,d]=l?T.useState(o<r.length):[!1,null],p=()=>{if(o>=r.length&&d){d(!1);return}s&&s(o+a)};return n.jsx("div",{id:"scrollWrapper",className:H.scroll,children:l?n.jsx(He,{dataLength:Math.min(r.length,o+a),next:p,hasMore:u,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};try{z.displayName="TableScrollWrapper",z.__docgenInfo={description:"",displayName:"TableScrollWrapper",props:{table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"ITableProps"}}}}}catch{}const yn="_clickableRow_11d5t_1",gn="_hoverableRow_11d5t_4",fn="_rowActive_11d5t_4",hn="_expandableRow_11d5t_8",bn="_flush_11d5t_8",xn="_dragIconCell_11d5t_28",Cn="_dragIcon_11d5t_28",R={clickableRow:yn,hoverableRow:gn,rowActive:fn,expandableRow:hn,flush:bn,dragIconCell:xn,dragIcon:Cn},J=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:N(R.expandableRow,r?R.flush:""),children:t})});try{J.displayName="ExpandedContentRow",J.__docgenInfo={description:"",displayName:"ExpandedContentRow",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},flush:{defaultValue:null,description:"",name:"flush",required:!1,type:{name:"boolean"}}}}}catch{}const Te=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:l,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:l){case b.LEFT:return r?b.LEFT:t.leftAligned;case b.RIGHT:return r?b.RIGHT:t.rightAligned;case b.CENTER:return r?b.CENTER:t.centerAligned;default:return r?b.LEFT:t.leftAligned}},In=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const l=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return l&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},jn="_inputInTable_u3xdj_1",Nn="_inputHover_u3xdj_13",wn="_inputFocus_u3xdj_18",An="_inputError_u3xdj_25",vn="_inputWarning_u3xdj_26",Rn="_inputDisabled_u3xdj_61",Sn="_hideScrollbars_u3xdj_67",Vn="_cell_u3xdj_77",Tn="_disabledLink_u3xdj_87",qn="_inputWrapper_u3xdj_91",En="_breakWord_u3xdj_106",kn="_inputCell_u3xdj_109",Wn="_sliderCell_u3xdj_112",Hn="_staticCell_u3xdj_116",Pn="_staticCellContent_u3xdj_119",Ln="_error_u3xdj_131",Dn="_warning_u3xdj_132",Fn="_unit_u3xdj_141",$n="_sortingCell_u3xdj_144",Bn="_sortingCellIcon_u3xdj_155",On="_icon_u3xdj_166",Mn="_checkBoxCell_u3xdj_170",Un="_iconCellWrapper_u3xdj_174",Gn="_actionsCell_u3xdj_178",Xn="_rightAligned_u3xdj_186",zn="_centerAligned_u3xdj_192",Jn="_leftAligned_u3xdj_198",Kn="_popover_u3xdj_201",Yn="_disabledPointerEvents_u3xdj_204",i={inputInTable:jn,inputHover:Nn,inputFocus:wn,inputError:An,inputWarning:vn,inputDisabled:Rn,hideScrollbars:Sn,cell:Vn,disabledLink:Tn,inputWrapper:qn,breakWord:En,inputCell:kn,sliderCell:Wn,staticCell:Hn,staticCellContent:Pn,error:Ln,warning:Dn,unit:Fn,sortingCell:$n,sortingCellIcon:Bn,icon:On,checkBoxCell:Mn,iconCellWrapper:Un,actionsCell:Gn,rightAligned:Xn,centerAligned:zn,leftAligned:Jn,popover:Kn,disabledPointerEvents:Yn},K=({cell:e,columnAlignment:t,testId:r,type:l})=>n.jsx(Oe,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,onPaste:a=>{var o;return(o=e.onPaste)==null?void 0:o.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===b.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:l});try{K.displayName="InputCell",K.__docgenInfo={description:"",displayName:"InputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IInputCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}},type:{defaultValue:null,description:"",name:"type",required:!1,type:{name:"enum",value:[{value:'"text"'},{value:'"date"'}]}}}}}catch{}const re=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var l;return(l=e.onChange)==null?void 0:l.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left,tabIndex:e.disabled?-1:0,testId:t,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue});try{re.displayName="NumberInputCell",re.__docgenInfo={description:"",displayName:"NumberInputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"INumberInputCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ae=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ue,{name:e.name,borderRadius:0,options:e.options,onChange:l=>{var a;return(a=e.onChange)==null?void 0:a.call(e,l)},onCreate:e.onCreate?l=>e.onCreate&&e.onCreate(l):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,multi:e.multi,right:t===b.RIGHT,testId:r,tabIndex:e.disabled?-1:0});try{ae.displayName="SelectCell",ae.__docgenInfo={description:"",displayName:"SelectCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISelectCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const le=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:i.inputWrapper,children:e.type==="Input"?n.jsx(K,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(re,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(K,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(ae,{cell:e,columnAlignment:t,testId:r}):null});try{le.displayName="InputCellWrapper",le.__docgenInfo={description:"",displayName:"InputCellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const oe=({cell:e,testId:t})=>{const r=T.useContext(Ge),{error:l,warning:a,tooltip:o,maxTooltipWidth:s}=e,u=d=>B(d);return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!a,text:o||l||a,enabled:u(o)||u(l)||u(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:N(i.staticCellContent,l?i.error:a?i.warning:""),children:n.jsx("a",{className:N((e.disabled||r)&&i.disabledLink),onClick:e.disabled||r?void 0:d=>{var p;d.stopPropagation(),(p=e.onClick)==null||p.call(e,d)},"data-testid":t,children:e.value})})})})};try{oe.displayName="LinkCell",oe.__docgenInfo={description:"",displayName:"LinkCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILinkCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ie=({cell:e,testId:t})=>n.jsx(Xe,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});try{ie.displayName="CheckBoxCell",ie.__docgenInfo={description:"",displayName:"CheckBoxCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ICheckBoxCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const se=({cell:e})=>n.jsx("div",{className:i.inputWrapper,children:n.jsx(ze,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})});try{se.displayName="SliderCell",se.__docgenInfo={description:"",displayName:"SliderCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISliderCell"}}}}}catch{}const de=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:i.iconCellWrapper,children:n.jsx(fe,{text:t,enabled:!!t&&B(t),display:"flex",placement:"top-center",children:n.jsx(O,{icon:r})})})};try{de.displayName="IconCell",de.__docgenInfo={description:"",displayName:"IconCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IIconCell"}}}}}catch{}const ce=({cell:e})=>n.jsx(ge,{actions:e.actions});try{ce.displayName="ActionsCell",ce.__docgenInfo={description:"",displayName:"ActionsCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IActionCell"}}}}}catch{}const ue=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip})}):null};try{ue.displayName="CellHelpIcon",ue.__docgenInfo={description:"",displayName:"CellHelpIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IHelpIconCell"}}}}}catch{}const pe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};try{pe.displayName="CellLibraryIcon",pe.__docgenInfo={description:"",displayName:"CellLibraryIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILibraryIconCell"}}}}}catch{}const me=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:l}=e;return t?n.jsxs("span",{className:i.sortingCellIcon,children:[r==="down"?n.jsx(ne,{link:!0,children:n.jsx(O,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(ne,{link:!0,children:n.jsx(O,{icon:$.SORT_DESCENDING})}):n.jsx(ne,{faint:!0,children:n.jsx(O,{icon:$.SORT_DESCENDING})}),l&&r?n.jsx("sup",{children:l}):null]}):null};try{me.displayName="Sort",me.__docgenInfo={description:"",displayName:"Sort",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISortCell"}}}}}catch{}const Y=({cell:e,isHeader:t,testId:r})=>{const{error:l,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:u,onSort:d,type:p}=e,c=n.jsxs("div",{className:N(i.staticCellContent,p==="Unit"?i.unit:"",l?i.error:a?i.warning:""),onClick:u?g=>d&&d(g):()=>{},"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ue,{cell:e}),n.jsx(pe,{cell:e}),n.jsx(me,{cell:e})]}):null]});return n.jsx("div",{className:i.inputWrapper,children:n.jsx(fe,{error:!!l,warning:!!a,text:o||l||a,enabled:o&&B(o)||l&&B(l)||a&&B(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:c})})};try{Y.displayName="StaticCell",Y.__docgenInfo={description:"",displayName:"StaticCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IStaticCell"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const _e=({cell:e,testId:t})=>{const{content:r,fullWidth:l,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Je,{content:r,fullWidth:l,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:i.popover,children:n.jsx(Y,{cell:e,testId:t})})})};try{_e.displayName="PopoverCell",_e.__docgenInfo={description:"",displayName:"PopoverCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IPopoverCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ye=({cell:e,isHeader:t,columnAlignment:r,testId:l})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(le,{cell:e,columnAlignment:r,testId:l});case"Link":return n.jsx(oe,{cell:e,testId:l});case"CheckBox":return n.jsx(ie,{cell:e,testId:l});case"Slider":return n.jsx(se,{cell:e});case"Icon":return n.jsx(de,{cell:e});case"Actions":return n.jsx(ce,{cell:e});case"Popover":return n.jsx(_e,{cell:e});default:return n.jsx(Y,{cell:e,isHeader:t,testId:l})}};try{ye.displayName="CellWrapper",ye.__docgenInfo={description:"",displayName:"CellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}var S=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e.AUTO_UNIT="AutoUnit",e))(S||{});const Q=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:l=b.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:u,colSpan:d,rowSpan:p,width:c}=e,g=T.useRef(null),y={bodyAlignment:l,headerAlignment:r,isHeader:t},P=Te(y,i),x=Te(y,i,!0),L=e.type===S.INPUT||e.type===S.NUMBER_INPUT||e.type===S.SELECT||e.type===S.POPOVER?i.inputCell:e.type===S.SLIDER?i.sliderCell:e.type===S.CHECKBOX?i.checkBoxCell:e.type===S.ACTIONS?i.actionsCell:i.staticCell,w=N(i.cell,L,e.hasSort?i.sortingCell:null,P,e.breakWord?i.breakWord:""),q=c??a??((o==null?void 0:o.isDragging)&&g.current&&g.current.offsetWidth)??void 0,C={width:q,minWidth:q,...u},A=t?"th":"td";return n.jsx(A,{ref:g,className:w,style:C,colSpan:d,rowSpan:p,children:n.jsx(ye,{cell:e,columnAlignment:x??b.RIGHT,isHeader:t,testId:s})})};try{Q.displayName="Cell",Q.__docgenInfo={description:"",displayName:"Cell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!1,type:{name:"TCellShape"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnHeaderAlignment:{defaultValue:null,description:"",name:"columnHeaderAlignment",required:!1,type:{name:"string"}},columnAlignment:{defaultValue:{value:"Align.LEFT"},description:"",name:"columnAlignment",required:!1,type:{name:"Align.LEFT | Align.RIGHT | null"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},snapshot:{defaultValue:null,description:"",name:"snapshot",required:!1,type:{name:"any"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const F=({row:e,rowIndex:t,isHeader:r=!1,columnCount:l,colSpan:a,columnHeaderAlignments:o=[],columnAlignment:s=[],hasRowActions:u,draggableTable:d=!1,snapshot:p=null,provided:c=null,width:g,columnWidths:y,testId:P})=>{const x=T.useRef(null),L=In(o,r,t),{onRowClick:w,onRowFocus:q,onRowMouseEnter:C,onRowMouseLeave:A,expandedContent:I,active:Z}=e,E=e.cells.map((h,v)=>{const he=`${r?0:1}_${t}_${v}`;return n.jsx(Q,{cell:h,isHeader:r,columnAlignment:s[v],columnHeaderAlignment:L[v],width:y?y[v]:void 0,snapshot:p,testId:h.testId},he)}),V=u&&n.jsx(Q,{cell:{type:S.ACTIONS,actions:e.actions},isHeader:r},l),k=(h,v)=>({minWidth:h&&`${g}px`,width:h&&"100%",display:h&&"table",background:h&&"var(--color-background-listitem-active)",border:h&&"var(--color-border)",borderTop:h&&0,opacity:h&&.1,...v}),W=()=>e.noDrag?n.jsx("td",{"aria-labelledby":"unique-label-id"}):n.jsx("td",{className:R.dragIconCell,children:n.jsx("div",{...c.dragHandleProps,className:R.dragIcon,children:n.jsx(O,{icon:$.DRAG})})});return r?n.jsxs(n.Fragment,{children:[n.jsxs("tr",{ref:x,onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w?R.clickableRow:null,C?R.hoverableRow:null),children:[d?n.jsx("th",{}):null,E,V]},t),I&&I.content?n.jsx(J,{colSpan:a,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]}):n.jsxs(n.Fragment,{children:[n.jsxs("tr",{onClick:w,onMouseEnter:C,onMouseLeave:A,onFocus:q,className:N(w&&!w.noStyle?R.clickableRow:null,C&&!C.noStyle?R.hoverableRow:null,Z?R.rowActive:null),ref:(c==null?void 0:c.innerRef)||null,...(c==null?void 0:c.draggableProps)||null,style:p&&c?k(p.isDragging,c.draggableProps.style):null,children:[d?W():null,E,V]},t),I&&I.content?n.jsx(J,{colSpan:a,flush:I.flush===!0,children:I.content},`${t}_expanded_content`):null]})};try{F.displayName="Row",F.__docgenInfo={description:"",displayName:"Row",props:{row:{defaultValue:null,description:"",name:"row",required:!0,type:{name:"TRowType"}},rowIndex:{defaultValue:null,description:"",name:"rowIndex",required:!0,type:{name:"number"}},isHeader:{defaultValue:{value:"false"},description:"",name:"isHeader",required:!1,type:{name:"boolean"}},columnCount:{defaultValue:null,description:"",name:"columnCount",required:!0,type:{name:"number"}},colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},columnHeaderAlignments:{defaultValue:{value:"[]"},description:"",name:"columnHeaderAlignments",required:!1,type:{name:"string[] | string[][]"}},columnAlignment:{defaultValue:{value:"[]"},description:"",name:"columnAlignment",required:!1,type:{name:"string[]"}},hasRowActions:{defaultValue:null,description:"",name:"hasRowActions",required:!0,type:{name:"boolean"}},draggableTable:{defaultValue:{value:"false"},description:"",name:"draggableTable",required:!1,type:{name:"boolean"}},snapshot:{defaultValue:{value:"null"},description:"",name:"snapshot",required:!1,type:{name:"any"}},provided:{defaultValue:{value:"null"},description:"",name:"provided",required:!1,type:{name:"any"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},columnWidths:{defaultValue:null,description:"",name:"columnWidths",required:!1,type:{name:"string[]"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const qe=e=>{var Ie,je,Ne,we,Ae,ve,Re;const{onListReorder:t=()=>{},table:r}=e,{columnWidths:l,footer:a,name:o,rows:s=[],actions:u,actionsRight:d,columnHeaderAlignments:p,columnAlignment:c,striped:g=!0,testId:y,draggable:P,defaultEmptyRow:x=null,onAddRow:L=null,bordered:w=!0,maxHeight:q,fixedWidth:C}=r,A=T.useRef(null),[I,Z]=T.useState({width:0,height:0});T.useEffect(()=>{A.current&&Z({width:A.current.offsetWidth,height:A.current.offsetHeight})},[]);const E=Fe.get(e,"table.headers",[]),V=mn(s,E),k=_n(s,E),W=V+(k?1:0),h=a?((je=(Ie=a==null?void 0:a.pagination)==null?void 0:Ie.rowsPerPage)==null?void 0:je.value)===0||Number((Ne=a==null?void 0:a.pagination)==null?void 0:Ne.selectedPage)>=Number((we=a==null?void 0:a.pagination)==null?void 0:we.rowCount)/Number((ve=(Ae=a==null?void 0:a.pagination)==null?void 0:Ae.rowsPerPage)==null?void 0:ve.value):!0,v=((Re=x==null?void 0:x.cells)==null?void 0:Re.length)&&L&&h,ke={cells:v?x.cells.map((m,j)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var M;const f=(M=_==null?void 0:_.target)==null?void 0:M.value,D={...x,cells:x.cells.map((U,We)=>({...U,value:We===j?f:U==null?void 0:U.value}))};L({newRow:D})}}:{...m,disabled:!0}):null,testId:y?`${y}-last-empty-row`:void 0},ee=v?s.concat(ke):s,be={...r,rows:ee},xe=N(H.wrapper,w?H.bordered:""),Ce={maxHeight:q,width:C,display:C==="auto"?"inline-flex":"flex"};return P?n.jsxs("div",{ref:A,className:xe,style:Ce,children:[n.jsx(G,{actions:u,actionsRight:d,name:o,testId:y&&`${y}-title`}),n.jsx(Pe,{onDragEnd:m=>{var f,D;const j=(f=m==null?void 0:m.source)==null?void 0:f.index,_=(D=m==null?void 0:m.destination)==null?void 0:D.index;typeof j=="number"&&typeof _=="number"&&t({from:j,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(z,{table:be,children:({visibleRows:j})=>n.jsxs("table",{className:N(H.table,g?H.striped:""),"data-testid":y,ref:m.innerRef,children:[n.jsx("thead",{children:E.map((_,f)=>n.jsx(F,{rowIndex:f,isHeader:!0,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p,draggableTable:P},`0_${f}`))}),n.jsxs("tbody",{children:[ee.slice(0,j).map((_,f)=>n.jsx(De,{draggableId:f+"",index:f,isDragDisabled:_.noDrag,children:(D,M)=>n.jsx(F,{rowIndex:f,row:_,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,provided:D,snapshot:M,draggableTable:P,width:I.width},`1_${f}`)},`index_${f}`)),m.placeholder]})]})})})}),a&&n.jsx(X,{pagination:a.pagination,actions:a.actions,content:a.content})]}):n.jsxs("div",{className:xe,style:Ce,children:[n.jsx(G,{actions:u,actionsRight:d,name:o,testId:y&&`${y}-title`}),n.jsx(z,{table:be,children:({visibleRows:m})=>n.jsxs("table",{className:N(H.table,g?H.striped:""),"data-testid":y,children:[n.jsx("thead",{children:E.map((j,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:ee.slice(0,m).map((j,_)=>n.jsx(F,{rowIndex:_,row:j,columnCount:V,columnWidths:l,colSpan:W,hasRowActions:k,columnAlignment:c},`1_${_}`))})]})}),a&&n.jsx(X,{colSpan:W,pagination:a.pagination,actions:a.actions,content:a.content})]})};try{qe.displayName="Table",qe.__docgenInfo={description:"",displayName:"Table",props:{onListReorder:{defaultValue:null,description:"",name:"onListReorder",required:!1,type:{name:"((obj: { from: number; to: number; }) => void)"}},table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"{ name?: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; ... 18 more ...; actions?: any; }"}}}}}catch{}export{S as C,qe as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./jsx-runtime-FsUICBgo.js";import{I as o,T as c}from"./common-types-U65vzrrz.js";import{F as v}from"./flex-RYZsoWEN.js";import{M as p}from"./actions-eW7plDvv.js";import{T as d}from"./text-6KQ6ntOV.js";import{I as n}from"./icon-8EQazuuW.js";import{M as r}from"./types-VB5zD18b.js";const e={headers:[{cells:[{value:"Name"},{value:"Weight"},{value:"Energy"},{value:"Origin"}]}],rows:[{cells:[{value:"Brown rice",testId:"table-tbody-cell-brown-rice"},{value:100,testId:"table-tbody-cell-100"},{value:361,testId:"table-tbody-cell-361"},{value:"Vietnam",testId:"table-tbody-cell-vietnam"}]},{cells:[{value:"Buckwheat",testId:"table-tbody-cell-buckwheat"},{value:50,testId:"table-tbody-cell-50"},{value:358,testId:"table-tbody-cell-358"},{value:"Poland",testId:"table-tbody-cell-poland"}]},{cells:[{value:"Couscous",testId:"table-tbody-cell-couscous"},{value:10,testId:"table-tbody-cell-10"},{value:368,testId:"table-tbody-cell-368"},{value:"France",testId:"table-tbody-cell-france"}]}]},S={...e,columnWidths:["200px","20%","100px","auto"]},x={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,style:{width:"200px",background:"var(--color-background-table-header)",fontWeight:"bold"}}))}))},F={...e,rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{value:100},{value:361},{value:"Vietnam"}]},...e.rows]},D={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",searchable:!1,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}]},L={...e,rows:e.rows.map((l,t)=>({...l,active:t===0,onRowClick:()=>{}}))},A={...e,name:"Food"},E={...e,name:a.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",a.jsx(n,{icon:o.STAR})]})},u=[{childComponent:a.jsx(p,{menu:{label:"Import food",trigger:c.DROP_DOWN_BUTTON,sections:[{type:r.HEADING,label:"Import options"},{type:r.OPTION,label:"Import from csv"},{type:r.OPTION,label:"Import from library"}],small:!0}})}],P={...e,name:"Food",actions:u,testId:"table-child-component"},V={...e,actions:u,actionsRight:!0},i={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",native:!0,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}],bordered:!0,infiniteScroll:!0,maxHeight:"500px",stickyHeaders:!0,rows:Array.from({length:100},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]})}},B={...i,maxHeight:"100%"},N={...i,rows:Array.from({length:1},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},O={...i,draggable:!0},j={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>a.jsxs("ul",{children:[a.jsx("li",{children:"Carrots"}),a.jsx("li",{children:"Chocolate"}),a.jsx("li",{children:"Chorizo"})]}),T={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:a.jsxs("div",{children:["Some ",a.jsx(d,{bold:!0,children:"bold content"})]})}]}]},m={...e,headers:[{cells:[{value:""},{value:"Stats",colSpan:2},{value:""}]},...e.headers],rows:[...e.rows,{cells:[{value:"Total",colSpan:4}]}]},H={...e,headers:[{cells:[{value:"Name",colSpan:2},{value:"Origin",rowSpan:2}]},{cells:[{value:"English"},{value:"Chinese"}]}],rows:[{cells:[{type:"Input",value:"Brown rice"},{type:"Input",value:"糙米"},{type:"Select",options:[{label:"China",value:"China"},{label:"France",value:"France"},{label:"Poland",value:"Poland"}],value:{label:"China",value:"China"},rowSpan:2}]},{cells:[{type:"Input",value:"White rice"},{type:"Input",value:"白米"}]}]},q={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},R={...e,columnAlignment:["left","right","right","left"]},M={...m,columnAlignment:["left","right","right","left","right"],columnHeaderAlignments:[["","center",""],["","right","right",""]]},s={fixedWidth:"auto",headers:[{cells:[{value:"Input",testId:"with-editable-cells-cell-name",width:"140px"},{value:"Select (native)",width:"140px"},{value:"Number Input",width:"140px"},{value:"Select (custom)",width:"140px"},{value:"Slider",width:"140px"},{value:"Static"}]}],rows:[{cells:[{value:"Buckwheat",type:"Input",onChange:()=>{},testId:"table-tbody-cell-buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{value:361,type:"NumberInput",onChange:()=>{}},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Poland",value:"Poland"},onChange:()=>{}},{type:"Slider",value:50,min:0,max:100,onChange:()=>{}},{value:361}]},{cells:[{value:"Arborio rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-arborio",error:"Error"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},error:"Error"},{value:361,type:"NumberInput",onChange:()=>{},error:"Error"},{type:"Select",options:[{label:"France",value:"France"},{label:"Italy",value:"Italy"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Italy",value:"Italy"},onChange:()=>{},error:"Error"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},error:"Error"},{value:361,error:"Error"}]},{cells:[{value:"Couscous",type:"Input",onChange:()=>{},testId:"table-tbody-cell-couscous",warning:"Warning"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},warning:"Warning"},{value:361,type:"NumberInput",onChange:()=>{},warning:"Warning"},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"France",value:"France"},onChange:()=>{},warning:"Warning"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},warning:"Warning"},{value:361,warning:"Warning"}]}]},U={...e,headers:e.headers.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]})),rows:e.rows.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]}))},J={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,disabled:!0}))}))},z={...e,headers:[...e.headers,{cells:[{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}}]}]},_={headers:[{cells:[{value:"Name"},{value:"Weight (kg)",hasSort:!0,sort:"up",sortPriority:1,onSort:()=>{}},{value:"Energy (kcal / 100g)",hasSort:!0,sort:"down",sortPriority:2,onSort:()=>{}},{value:"Origin",hasSort:!0,sort:"",sortPriority:1,onSort:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},G={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.SUCCESS,color:"var(--color-text-success)"}),tooltip:"Success tooltip here",width:"var(--size)"},{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.WARNING,color:"var(--color-text-warning)"}),tooltip:"Warning tooltip here",width:"var(--size)"},{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{type:"Icon",icon:a.jsx(n,{icon:o.ERROR,color:"var(--color-text-error)"}),tooltip:"Error tooltip here",width:"var(--size)"},{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},$={headers:[{cells:[{value:"Lorem"},{value:"Ipsum"}]}],rows:[{cells:[{type:"Link",value:"Link text",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Disabled link text",disabled:!0,onClick:()=>console.log("Link clicked")}]},{cells:[{type:"Link",value:"Static warning link",warning:"Warning message",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Static error link",error:"Error message",onClick:()=>console.log("Link clicked")}]}]},X={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"test",icon:"minus",onClick:()=>{},hidden:!0}]}]},K={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]}]},Q={...e,footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]}),pagination:{rowCount:500,selectedPage:10,rowsPerPage:{onChange:()=>{},options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:20},goTo:{onChange:()=>{}},onSelectPage:()=>{},small:!0},actions:[{label:"Star",icon:"star",onClick:()=>{}}]}},Y={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(t=>({...t,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},Z={columnWidths:[void 0,"100px","100px","100px",void 0],columnAlignment:["left","right","left","left","left","right"],columnHeaderAlignments:[["left","right","left","left","left","right"]],headers:[{cells:[{value:"Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeius mod tempor incididunt laboreet dolore magna aliqua"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Static"},{value:"Static Right"}]}],rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},disabled:!0},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{},error:"Error"},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice",warning:"Warning message"},{value:"Static warning",warning:"Warning message"},{value:"100"}]},{cells:[{value:"Buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{}},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice"},{type:"Link",value:"Static error link",error:"Error message"},{value:"100"}]}]},ee={fixedWidth:"auto",headers:[{cells:[{value:"Name"},{value:"Date of birth"}]}],rows:[{cells:[{value:"John Smith",width:"140px"},{value:"1980-05-05",type:"DateInput",width:"110px"}]},{cells:[{value:"Jane Doe",width:"140px"},{value:"1984-12-12",type:"DateInput",width:"110px"}]}]};export{N as A,O as B,D as C,A as D,E,P as F,z as G,_ as H,V as I,Y as J,s as a,J as b,ee as c,m as d,q as e,f,W as g,H as h,U as i,G as j,$ as k,X as l,K as m,T as n,x as o,F as p,Z as q,Q as r,L as s,e as t,j as u,S as v,R as w,M as x,i as y,B as z};
|