react-table-edit 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -4
- package/dist/index.mjs +13 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -34,6 +34,7 @@ type Props = {
|
|
|
34
34
|
handleAdd?: any;
|
|
35
35
|
options: any[];
|
|
36
36
|
isMulti?: boolean;
|
|
37
|
+
noHeader?: boolean;
|
|
37
38
|
maxHeight?: number;
|
|
38
39
|
columns?: IFColumnSelectTable[];
|
|
39
40
|
decimalSeparator?: string;
|
|
@@ -70,6 +71,7 @@ type ISettingFormElement = {
|
|
|
70
71
|
type ISettingSelectElement = {
|
|
71
72
|
isClearable?: boolean;
|
|
72
73
|
isMulti?: boolean;
|
|
74
|
+
noHeader?: boolean;
|
|
73
75
|
loadOptions?: any;
|
|
74
76
|
defaultValue?: any;
|
|
75
77
|
fieldValue?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ type Props = {
|
|
|
34
34
|
handleAdd?: any;
|
|
35
35
|
options: any[];
|
|
36
36
|
isMulti?: boolean;
|
|
37
|
+
noHeader?: boolean;
|
|
37
38
|
maxHeight?: number;
|
|
38
39
|
columns?: IFColumnSelectTable[];
|
|
39
40
|
decimalSeparator?: string;
|
|
@@ -70,6 +71,7 @@ type ISettingFormElement = {
|
|
|
70
71
|
type ISettingSelectElement = {
|
|
71
72
|
isClearable?: boolean;
|
|
72
73
|
isMulti?: boolean;
|
|
74
|
+
noHeader?: boolean;
|
|
73
75
|
loadOptions?: any;
|
|
74
76
|
defaultValue?: any;
|
|
75
77
|
fieldValue?: string;
|
package/dist/index.js
CHANGED
|
@@ -1581,7 +1581,7 @@ var import_classnames11 = __toESM(require("classnames"));
|
|
|
1581
1581
|
var import_moment = __toESM(require("moment"));
|
|
1582
1582
|
var import_becoxy_icons5 = require("becoxy-icons");
|
|
1583
1583
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1584
|
-
var defaultMaxHeight =
|
|
1584
|
+
var defaultMaxHeight = 250;
|
|
1585
1585
|
var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
|
|
1586
1586
|
const {
|
|
1587
1587
|
id,
|
|
@@ -1605,6 +1605,7 @@ var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1605
1605
|
component,
|
|
1606
1606
|
formatOptionLabel,
|
|
1607
1607
|
isMulti,
|
|
1608
|
+
noHeader,
|
|
1608
1609
|
isDisabled,
|
|
1609
1610
|
showFooter,
|
|
1610
1611
|
onPaste
|
|
@@ -1622,7 +1623,13 @@ var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1622
1623
|
const isSelectedAll = (0, import_react12.useMemo)(() => {
|
|
1623
1624
|
return isMulti === true && (optionsLoad ? optionsLoad : options).length > 0 && value?.length >= (optionsLoad ? optionsLoad : options).length;
|
|
1624
1625
|
}, [optionsLoad, options, value]);
|
|
1625
|
-
const defaultColumns = [
|
|
1626
|
+
const defaultColumns = noHeader ? [
|
|
1627
|
+
{
|
|
1628
|
+
headerText: "Name",
|
|
1629
|
+
field: fieldLabel ?? "label",
|
|
1630
|
+
width: menuWidth
|
|
1631
|
+
}
|
|
1632
|
+
] : [
|
|
1626
1633
|
{
|
|
1627
1634
|
field: "key",
|
|
1628
1635
|
headerText: "Code",
|
|
@@ -1894,7 +1901,7 @@ var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1894
1901
|
)
|
|
1895
1902
|
}
|
|
1896
1903
|
),
|
|
1897
|
-
(columns ? columns : defaultColumns).map((col, indexCol) => {
|
|
1904
|
+
(columns && !noHeader ? columns : defaultColumns).map((col, indexCol) => {
|
|
1898
1905
|
let valueDisplay = row[col.field];
|
|
1899
1906
|
if (col.type === "numeric" || col.typeCondition && col.typeCondition(row) === "numeric") {
|
|
1900
1907
|
valueDisplay = formartNumberic(row[col.field], decimalSeparator ?? ".", thousandSeparator ?? ",", col.fraction ?? 0, true) ?? 0;
|
|
@@ -1962,7 +1969,7 @@ var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1962
1969
|
let countDisplay = 0;
|
|
1963
1970
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1964
1971
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", { style: { width: "100%" }, children: [
|
|
1965
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { className: "r-select-row", role: "row", children: [
|
|
1972
|
+
!noHeader && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { className: "r-select-row", role: "row", children: [
|
|
1966
1973
|
isMulti && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { className: (0, import_classnames11.default)(`r-select-headercell`), style: { width: 40, top: `0px` }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1967
1974
|
"div",
|
|
1968
1975
|
{
|
|
@@ -2107,6 +2114,7 @@ var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2107
2114
|
style: {
|
|
2108
2115
|
width: menuWidth ? menuWidth : "min-content",
|
|
2109
2116
|
position: "fixed",
|
|
2117
|
+
borderRadius: 3,
|
|
2110
2118
|
zIndex: 9999
|
|
2111
2119
|
},
|
|
2112
2120
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.DropdownItem, { className: (0, import_classnames11.default)("p-0 menu-select-table"), style: { borderRadius: "6px" }, tag: "div", header: true, children: dropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
@@ -2598,6 +2606,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
2598
2606
|
loadOptions: col.selectSettings?.loadOptions,
|
|
2599
2607
|
handleAdd: col.selectSettings?.handAddNew,
|
|
2600
2608
|
isMulti: col.selectSettings?.isMulti,
|
|
2609
|
+
noHeader: col.selectSettings?.noHeader,
|
|
2601
2610
|
invalid: col.validate && col.validate(row[col.field], row),
|
|
2602
2611
|
maxHeight: col.selectSettings?.heightPopup ? Number(col.selectSettings?.heightPopup) : void 0,
|
|
2603
2612
|
menuWidth: col.selectSettings?.widthPopup ? Number(col.selectSettings?.widthPopup) : void 0,
|
package/dist/index.mjs
CHANGED
|
@@ -1547,7 +1547,7 @@ import classnames6 from "classnames";
|
|
|
1547
1547
|
import moment from "moment";
|
|
1548
1548
|
import { Plus as Plus2 } from "becoxy-icons";
|
|
1549
1549
|
import { Fragment as Fragment13, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1550
|
-
var defaultMaxHeight =
|
|
1550
|
+
var defaultMaxHeight = 250;
|
|
1551
1551
|
var SelectTable = forwardRef2((props, ref) => {
|
|
1552
1552
|
const {
|
|
1553
1553
|
id,
|
|
@@ -1571,6 +1571,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1571
1571
|
component,
|
|
1572
1572
|
formatOptionLabel,
|
|
1573
1573
|
isMulti,
|
|
1574
|
+
noHeader,
|
|
1574
1575
|
isDisabled,
|
|
1575
1576
|
showFooter,
|
|
1576
1577
|
onPaste
|
|
@@ -1588,7 +1589,13 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1588
1589
|
const isSelectedAll = useMemo(() => {
|
|
1589
1590
|
return isMulti === true && (optionsLoad ? optionsLoad : options).length > 0 && value?.length >= (optionsLoad ? optionsLoad : options).length;
|
|
1590
1591
|
}, [optionsLoad, options, value]);
|
|
1591
|
-
const defaultColumns = [
|
|
1592
|
+
const defaultColumns = noHeader ? [
|
|
1593
|
+
{
|
|
1594
|
+
headerText: "Name",
|
|
1595
|
+
field: fieldLabel ?? "label",
|
|
1596
|
+
width: menuWidth
|
|
1597
|
+
}
|
|
1598
|
+
] : [
|
|
1592
1599
|
{
|
|
1593
1600
|
field: "key",
|
|
1594
1601
|
headerText: "Code",
|
|
@@ -1860,7 +1867,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1860
1867
|
)
|
|
1861
1868
|
}
|
|
1862
1869
|
),
|
|
1863
|
-
(columns ? columns : defaultColumns).map((col, indexCol) => {
|
|
1870
|
+
(columns && !noHeader ? columns : defaultColumns).map((col, indexCol) => {
|
|
1864
1871
|
let valueDisplay = row[col.field];
|
|
1865
1872
|
if (col.type === "numeric" || col.typeCondition && col.typeCondition(row) === "numeric") {
|
|
1866
1873
|
valueDisplay = formartNumberic(row[col.field], decimalSeparator ?? ".", thousandSeparator ?? ",", col.fraction ?? 0, true) ?? 0;
|
|
@@ -1928,7 +1935,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1928
1935
|
let countDisplay = 0;
|
|
1929
1936
|
return /* @__PURE__ */ jsxs12(Fragment13, { children: [
|
|
1930
1937
|
/* @__PURE__ */ jsxs12("table", { style: { width: "100%" }, children: [
|
|
1931
|
-
/* @__PURE__ */ jsx12("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ jsxs12("tr", { className: "r-select-row", role: "row", children: [
|
|
1938
|
+
!noHeader && /* @__PURE__ */ jsx12("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ jsxs12("tr", { className: "r-select-row", role: "row", children: [
|
|
1932
1939
|
isMulti && /* @__PURE__ */ jsx12("th", { className: classnames6(`r-select-headercell`), style: { width: 40, top: `0px` }, children: /* @__PURE__ */ jsx12(
|
|
1933
1940
|
"div",
|
|
1934
1941
|
{
|
|
@@ -2073,6 +2080,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
2073
2080
|
style: {
|
|
2074
2081
|
width: menuWidth ? menuWidth : "min-content",
|
|
2075
2082
|
position: "fixed",
|
|
2083
|
+
borderRadius: 3,
|
|
2076
2084
|
zIndex: 9999
|
|
2077
2085
|
},
|
|
2078
2086
|
children: /* @__PURE__ */ jsx12(DropdownItem2, { className: classnames6("p-0 menu-select-table"), style: { borderRadius: "6px" }, tag: "div", header: true, children: dropdownOpen && /* @__PURE__ */ jsx12(
|
|
@@ -2564,6 +2572,7 @@ var TableEdit = forwardRef3((props, ref) => {
|
|
|
2564
2572
|
loadOptions: col.selectSettings?.loadOptions,
|
|
2565
2573
|
handleAdd: col.selectSettings?.handAddNew,
|
|
2566
2574
|
isMulti: col.selectSettings?.isMulti,
|
|
2575
|
+
noHeader: col.selectSettings?.noHeader,
|
|
2567
2576
|
invalid: col.validate && col.validate(row[col.field], row),
|
|
2568
2577
|
maxHeight: col.selectSettings?.heightPopup ? Number(col.selectSettings?.heightPopup) : void 0,
|
|
2569
2578
|
menuWidth: col.selectSettings?.widthPopup ? Number(col.selectSettings?.widthPopup) : void 0,
|