@vuu-ui/vuu-table 0.8.69 → 0.8.71
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/cjs/cell-renderers/checkbox-cell/CheckboxCell.js +1 -10
- package/cjs/cell-renderers/checkbox-cell/CheckboxCell.js.map +1 -1
- package/esm/cell-renderers/checkbox-cell/CheckboxCell.js +2 -11
- package/esm/cell-renderers/checkbox-cell/CheckboxCell.js.map +1 -1
- package/package.json +9 -9
- package/cjs/cell-renderers/checkbox-cell/CheckboxCell.css.js +0 -6
- package/cjs/cell-renderers/checkbox-cell/CheckboxCell.css.js.map +0 -1
- package/esm/cell-renderers/checkbox-cell/CheckboxCell.css.js +0 -4
- package/esm/cell-renderers/checkbox-cell/CheckboxCell.css.js.map +0 -1
|
@@ -5,18 +5,9 @@ var react = require('react');
|
|
|
5
5
|
var vuuUiControls = require('@vuu-ui/vuu-ui-controls');
|
|
6
6
|
var core = require('@salt-ds/core');
|
|
7
7
|
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
8
|
-
var styles = require('@salt-ds/styles');
|
|
9
|
-
var window = require('@salt-ds/window');
|
|
10
|
-
var CheckboxCell$1 = require('./CheckboxCell.css.js');
|
|
11
8
|
|
|
12
9
|
const CheckboxCell = react.memo(
|
|
13
10
|
({ column, columnMap, onCommit = vuuUiControls.WarnCommit, row }) => {
|
|
14
|
-
const targetWindow = window.useWindow();
|
|
15
|
-
styles.useComponentCssInjection({
|
|
16
|
-
testId: "vuu-checkbox-cell",
|
|
17
|
-
css: CheckboxCell$1,
|
|
18
|
-
window: targetWindow
|
|
19
|
-
});
|
|
20
11
|
const dataIdx = columnMap[column.name];
|
|
21
12
|
const isChecked = !!row[dataIdx];
|
|
22
13
|
const handleCommit = react.useCallback(
|
|
@@ -29,7 +20,7 @@ const CheckboxCell = react.memo(
|
|
|
29
20
|
},
|
|
30
21
|
[onCommit]
|
|
31
22
|
);
|
|
32
|
-
return column.editable ? /* @__PURE__ */ jsxRuntime.jsx(core.Checkbox, { checked: isChecked, onClick: handleCommit(!isChecked) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
return column.editable ? /* @__PURE__ */ jsxRuntime.jsx(core.Checkbox, { checked: isChecked, onClick: handleCommit(!isChecked) }) : /* @__PURE__ */ jsxRuntime.jsx(core.Checkbox, { checked: isChecked, disabled: true });
|
|
33
24
|
},
|
|
34
25
|
vuuUtils.dataColumnAndKeyUnchanged
|
|
35
26
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCell.js","sources":["../../../src/cell-renderers/checkbox-cell/CheckboxCell.tsx"],"sourcesContent":["import { memo, useCallback } from \"react\";\nimport { TableCellRendererProps } from \"@vuu-ui/vuu-table-types\";\nimport {
|
|
1
|
+
{"version":3,"file":"CheckboxCell.js","sources":["../../../src/cell-renderers/checkbox-cell/CheckboxCell.tsx"],"sourcesContent":["import { memo, useCallback } from \"react\";\nimport { TableCellRendererProps } from \"@vuu-ui/vuu-table-types\";\nimport { WarnCommit } from \"@vuu-ui/vuu-ui-controls\";\nimport { Checkbox } from \"@salt-ds/core\";\nimport {\n dataColumnAndKeyUnchanged,\n dispatchCustomEvent,\n registerComponent,\n} from \"@vuu-ui/vuu-utils\";\n\nexport const CheckboxCell: React.FC<TableCellRendererProps> = memo(\n ({ column, columnMap, onCommit = WarnCommit, row }) => {\n const dataIdx = columnMap[column.name];\n const isChecked = !!row[dataIdx];\n\n const handleCommit = useCallback(\n (value) => async (evt: React.MouseEvent) => {\n const res = await onCommit(value);\n if (res === true) {\n dispatchCustomEvent(evt.target as HTMLElement, \"vuu-commit\");\n }\n return res;\n },\n [onCommit]\n );\n\n return column.editable ? (\n <Checkbox checked={isChecked} onClick={handleCommit(!isChecked)} />\n ) : (\n <Checkbox checked={isChecked} disabled={true} />\n );\n },\n dataColumnAndKeyUnchanged\n);\nCheckboxCell.displayName = \"CheckboxCell\";\n\nregisterComponent(\"checkbox-cell\", CheckboxCell, \"cell-renderer\", {\n serverDataType: \"boolean\",\n});\n"],"names":["memo","WarnCommit","useCallback","dispatchCustomEvent","jsx","Checkbox","dataColumnAndKeyUnchanged","registerComponent"],"mappings":";;;;;;;;AAUO,MAAM,YAAiD,GAAAA,UAAA;AAAA,EAC5D,CAAC,EAAE,MAAA,EAAQ,WAAW,QAAW,GAAAC,wBAAA,EAAY,KAAU,KAAA;AACrD,IAAM,MAAA,OAAA,GAAU,SAAU,CAAA,MAAA,CAAO,IAAI,CAAA,CAAA;AACrC,IAAA,MAAM,SAAY,GAAA,CAAC,CAAC,GAAA,CAAI,OAAO,CAAA,CAAA;AAE/B,IAAA,MAAM,YAAe,GAAAC,iBAAA;AAAA,MACnB,CAAC,KAAU,KAAA,OAAO,GAA0B,KAAA;AAC1C,QAAM,MAAA,GAAA,GAAM,MAAM,QAAA,CAAS,KAAK,CAAA,CAAA;AAChC,QAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,UAAoBC,4BAAA,CAAA,GAAA,CAAI,QAAuB,YAAY,CAAA,CAAA;AAAA,SAC7D;AACA,QAAO,OAAA,GAAA,CAAA;AAAA,OACT;AAAA,MACA,CAAC,QAAQ,CAAA;AAAA,KACX,CAAA;AAEA,IAAA,OAAO,OAAO,QACZ,mBAAAC,cAAA,CAACC,aAAS,EAAA,EAAA,OAAA,EAAS,WAAW,OAAS,EAAA,YAAA,CAAa,CAAC,SAAS,GAAG,CAEjE,mBAAAD,cAAA,CAACC,iBAAS,OAAS,EAAA,SAAA,EAAW,UAAU,IAAM,EAAA,CAAA,CAAA;AAAA,GAElD;AAAA,EACAC,kCAAA;AACF,EAAA;AACA,YAAA,CAAa,WAAc,GAAA,cAAA,CAAA;AAE3BC,0BAAkB,CAAA,eAAA,EAAiB,cAAc,eAAiB,EAAA;AAAA,EAChE,cAAgB,EAAA,SAAA;AAClB,CAAC,CAAA;;;;"}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { memo, useCallback } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { WarnCommit } from '@vuu-ui/vuu-ui-controls';
|
|
4
4
|
import { Checkbox } from '@salt-ds/core';
|
|
5
5
|
import { dispatchCustomEvent, dataColumnAndKeyUnchanged, registerComponent } from '@vuu-ui/vuu-utils';
|
|
6
|
-
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
7
|
-
import { useWindow } from '@salt-ds/window';
|
|
8
|
-
import checkboxCss from './CheckboxCell.css.js';
|
|
9
6
|
|
|
10
7
|
const CheckboxCell = memo(
|
|
11
8
|
({ column, columnMap, onCommit = WarnCommit, row }) => {
|
|
12
|
-
const targetWindow = useWindow();
|
|
13
|
-
useComponentCssInjection({
|
|
14
|
-
testId: "vuu-checkbox-cell",
|
|
15
|
-
css: checkboxCss,
|
|
16
|
-
window: targetWindow
|
|
17
|
-
});
|
|
18
9
|
const dataIdx = columnMap[column.name];
|
|
19
10
|
const isChecked = !!row[dataIdx];
|
|
20
11
|
const handleCommit = useCallback(
|
|
@@ -27,7 +18,7 @@ const CheckboxCell = memo(
|
|
|
27
18
|
},
|
|
28
19
|
[onCommit]
|
|
29
20
|
);
|
|
30
|
-
return column.editable ? /* @__PURE__ */ jsx(Checkbox, { checked: isChecked, onClick: handleCommit(!isChecked) }) : /* @__PURE__ */ jsx(
|
|
21
|
+
return column.editable ? /* @__PURE__ */ jsx(Checkbox, { checked: isChecked, onClick: handleCommit(!isChecked) }) : /* @__PURE__ */ jsx(Checkbox, { checked: isChecked, disabled: true });
|
|
31
22
|
},
|
|
32
23
|
dataColumnAndKeyUnchanged
|
|
33
24
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCell.js","sources":["../../../src/cell-renderers/checkbox-cell/CheckboxCell.tsx"],"sourcesContent":["import { memo, useCallback } from \"react\";\nimport { TableCellRendererProps } from \"@vuu-ui/vuu-table-types\";\nimport {
|
|
1
|
+
{"version":3,"file":"CheckboxCell.js","sources":["../../../src/cell-renderers/checkbox-cell/CheckboxCell.tsx"],"sourcesContent":["import { memo, useCallback } from \"react\";\nimport { TableCellRendererProps } from \"@vuu-ui/vuu-table-types\";\nimport { WarnCommit } from \"@vuu-ui/vuu-ui-controls\";\nimport { Checkbox } from \"@salt-ds/core\";\nimport {\n dataColumnAndKeyUnchanged,\n dispatchCustomEvent,\n registerComponent,\n} from \"@vuu-ui/vuu-utils\";\n\nexport const CheckboxCell: React.FC<TableCellRendererProps> = memo(\n ({ column, columnMap, onCommit = WarnCommit, row }) => {\n const dataIdx = columnMap[column.name];\n const isChecked = !!row[dataIdx];\n\n const handleCommit = useCallback(\n (value) => async (evt: React.MouseEvent) => {\n const res = await onCommit(value);\n if (res === true) {\n dispatchCustomEvent(evt.target as HTMLElement, \"vuu-commit\");\n }\n return res;\n },\n [onCommit]\n );\n\n return column.editable ? (\n <Checkbox checked={isChecked} onClick={handleCommit(!isChecked)} />\n ) : (\n <Checkbox checked={isChecked} disabled={true} />\n );\n },\n dataColumnAndKeyUnchanged\n);\nCheckboxCell.displayName = \"CheckboxCell\";\n\nregisterComponent(\"checkbox-cell\", CheckboxCell, \"cell-renderer\", {\n serverDataType: \"boolean\",\n});\n"],"names":[],"mappings":";;;;;;AAUO,MAAM,YAAiD,GAAA,IAAA;AAAA,EAC5D,CAAC,EAAE,MAAA,EAAQ,WAAW,QAAW,GAAA,UAAA,EAAY,KAAU,KAAA;AACrD,IAAM,MAAA,OAAA,GAAU,SAAU,CAAA,MAAA,CAAO,IAAI,CAAA,CAAA;AACrC,IAAA,MAAM,SAAY,GAAA,CAAC,CAAC,GAAA,CAAI,OAAO,CAAA,CAAA;AAE/B,IAAA,MAAM,YAAe,GAAA,WAAA;AAAA,MACnB,CAAC,KAAU,KAAA,OAAO,GAA0B,KAAA;AAC1C,QAAM,MAAA,GAAA,GAAM,MAAM,QAAA,CAAS,KAAK,CAAA,CAAA;AAChC,QAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,UAAoB,mBAAA,CAAA,GAAA,CAAI,QAAuB,YAAY,CAAA,CAAA;AAAA,SAC7D;AACA,QAAO,OAAA,GAAA,CAAA;AAAA,OACT;AAAA,MACA,CAAC,QAAQ,CAAA;AAAA,KACX,CAAA;AAEA,IAAA,OAAO,OAAO,QACZ,mBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,OAAA,EAAS,WAAW,OAAS,EAAA,YAAA,CAAa,CAAC,SAAS,GAAG,CAEjE,mBAAA,GAAA,CAAC,YAAS,OAAS,EAAA,SAAA,EAAW,UAAU,IAAM,EAAA,CAAA,CAAA;AAAA,GAElD;AAAA,EACA,yBAAA;AACF,EAAA;AACA,YAAA,CAAa,WAAc,GAAA,cAAA,CAAA;AAE3B,iBAAkB,CAAA,eAAA,EAAiB,cAAc,eAAiB,EAAA;AAAA,EAChE,cAAgB,EAAA,SAAA;AAClB,CAAC,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
2
|
+
"version": "0.8.71",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@vuu-ui/vuu-data-types": "0.8.
|
|
7
|
-
"@vuu-ui/vuu-table-types": "0.8.
|
|
8
|
-
"@vuu-ui/vuu-protocol-types": "0.8.
|
|
6
|
+
"@vuu-ui/vuu-data-types": "0.8.71",
|
|
7
|
+
"@vuu-ui/vuu-table-types": "0.8.71",
|
|
8
|
+
"@vuu-ui/vuu-protocol-types": "0.8.71"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@salt-ds/core": "1.27.1",
|
|
12
12
|
"@salt-ds/styles": "0.2.1",
|
|
13
13
|
"@salt-ds/window": "0.1.1",
|
|
14
|
-
"@vuu-ui/vuu-data-react": "0.8.
|
|
15
|
-
"@vuu-ui/vuu-layout": "0.8.
|
|
16
|
-
"@vuu-ui/vuu-popups": "0.8.
|
|
17
|
-
"@vuu-ui/vuu-ui-controls": "0.8.
|
|
18
|
-
"@vuu-ui/vuu-utils": "0.8.
|
|
14
|
+
"@vuu-ui/vuu-data-react": "0.8.71",
|
|
15
|
+
"@vuu-ui/vuu-layout": "0.8.71",
|
|
16
|
+
"@vuu-ui/vuu-popups": "0.8.71",
|
|
17
|
+
"@vuu-ui/vuu-ui-controls": "0.8.71",
|
|
18
|
+
"@vuu-ui/vuu-utils": "0.8.71"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"clsx": "^2.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCell.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCell.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|