pixel-react 1.10.2 → 1.10.3

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.
@@ -2,4 +2,6 @@ import { TreeNodeProps } from '../../../ComponentProps/TreeNodeProps';
2
2
  export declare const addNewRow: (treeData: TreeNodeProps[], newNode: {
3
3
  action?: "addAbove" | "addBelow" | "addInside";
4
4
  sourceId?: string;
5
+ error?: string;
6
+ value?: string;
5
7
  }) => TreeNodeProps[];
@@ -26,6 +26,8 @@ export interface TableBodyProps {
26
26
  newNode?: {
27
27
  sourceId?: string;
28
28
  action?: 'addAbove' | 'addBelow' | 'addInside';
29
+ value?: string;
30
+ error?: string;
29
31
  };
30
32
  onAddConfirm?: (_name: string) => void;
31
33
  onAddCancel?: () => void;
@@ -67,6 +69,8 @@ export interface TreeTableProps {
67
69
  newNode?: {
68
70
  sourceId?: string;
69
71
  action?: 'addAbove' | 'addBelow' | 'addInside';
72
+ value?: string;
73
+ error?: string;
70
74
  };
71
75
  onAddConfirm?: (_name: string) => void;
72
76
  onAddCancel?: () => void;
package/lib/index.d.ts CHANGED
@@ -1785,6 +1785,8 @@ interface TreeTableProps {
1785
1785
  newNode?: {
1786
1786
  sourceId?: string;
1787
1787
  action?: 'addAbove' | 'addBelow' | 'addInside';
1788
+ value?: string;
1789
+ error?: string;
1788
1790
  };
1789
1791
  onAddConfirm?: (_name: string) => void;
1790
1792
  onAddCancel?: () => void;
package/lib/index.esm.js CHANGED
@@ -14448,6 +14448,7 @@ const AddModule = ({
14448
14448
  error,
14449
14449
  value = ''
14450
14450
  }) => {
14451
+ console.log('🚀 ~ value:', value);
14451
14452
  const [text, setText] = useState(value);
14452
14453
  return jsxs(Fragment, {
14453
14454
  children: [jsxs("div", {
@@ -14455,7 +14456,8 @@ const AddModule = ({
14455
14456
  children: [jsx("input", {
14456
14457
  type: "text",
14457
14458
  className: "add-module-input",
14458
- onChange: e => setText(e.target.value)
14459
+ onChange: e => setText(e.target.value),
14460
+ value: text
14459
14461
  }), jsx(Icon, {
14460
14462
  className: "icons",
14461
14463
  name: "update_icon",
@@ -14465,7 +14467,9 @@ const AddModule = ({
14465
14467
  name: "close",
14466
14468
  onClick: onCancel
14467
14469
  })]
14468
- }), error]
14470
+ }), jsx("small", {
14471
+ children: error
14472
+ })]
14469
14473
  });
14470
14474
  };
14471
14475
 
@@ -14522,7 +14526,8 @@ const TableCell = /*#__PURE__*/React__default.memo(({
14522
14526
  }), node.isNewNode && col.isTree ? jsx(AddModule, {
14523
14527
  onCancel: onAddCancel,
14524
14528
  onConfirm: onAddConfirm,
14525
- error: node?.error || ''
14529
+ error: node?.error || '',
14530
+ value: node.value
14526
14531
  }) : jsx("span", {
14527
14532
  className: "tree-table-td-content-text",
14528
14533
  children: prepareData(node, col)
@@ -14565,7 +14570,9 @@ const TableRow = /*#__PURE__*/React__default.memo(({
14565
14570
  const addNewRow = (treeData, newNode) => {
14566
14571
  const {
14567
14572
  sourceId,
14568
- action
14573
+ action,
14574
+ value = '',
14575
+ error = ''
14569
14576
  } = newNode;
14570
14577
  if (!sourceId || !action) return treeData;
14571
14578
  const nodeMap = new Map(treeData.map(node => [node.key, node]));
@@ -14577,7 +14584,9 @@ const addNewRow = (treeData, newNode) => {
14577
14584
  hierarchy: sourceNode.hierarchy,
14578
14585
  sourceId: sourceNode.key,
14579
14586
  isNewNode: true,
14580
- key: 'new-node'
14587
+ key: 'new-node',
14588
+ value,
14589
+ error
14581
14590
  };
14582
14591
  switch (action) {
14583
14592
  case 'addAbove':
@@ -14643,7 +14652,11 @@ const TreeTable = ({
14643
14652
  loadMore = () => {},
14644
14653
  tableBorder,
14645
14654
  height = 'auto',
14646
- newNode = {},
14655
+ newNode = {
14656
+ action: 'addInside',
14657
+ sourceId: 'PAG1013',
14658
+ value: 'newNode'
14659
+ },
14647
14660
  onAddConfirm = _name => {},
14648
14661
  onAddCancel = () => {}
14649
14662
  }) => {