@rttui/skin-anocca 1.0.35 → 1.0.36
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/README.md +62 -1
- package/dist/cjs/cell.cjs +102 -0
- package/dist/cjs/cell.cjs.map +10 -0
- package/dist/cjs/cell_avatar.cjs +62 -0
- package/dist/cjs/cell_avatar.cjs.map +10 -0
- package/dist/cjs/cell_avatar_with_text.cjs +80 -0
- package/dist/cjs/cell_avatar_with_text.cjs.map +10 -0
- package/dist/cjs/cell_badge.cjs +66 -0
- package/dist/cjs/cell_badge.cjs.map +10 -0
- package/dist/cjs/cell_currency.cjs +57 -0
- package/dist/cjs/cell_currency.cjs.map +10 -0
- package/dist/cjs/cell_link.cjs +78 -0
- package/dist/cjs/cell_link.cjs.map +10 -0
- package/dist/cjs/cell_number.cjs +48 -0
- package/dist/cjs/cell_number.cjs.map +10 -0
- package/dist/cjs/cell_percent.cjs +56 -0
- package/dist/cjs/cell_percent.cjs.map +10 -0
- package/dist/cjs/cell_tag.cjs +53 -0
- package/dist/cjs/cell_tag.cjs.map +10 -0
- package/dist/cjs/cell_text.cjs +47 -0
- package/dist/cjs/cell_text.cjs.map +10 -0
- package/dist/cjs/cell_text_bold.cjs +51 -0
- package/dist/cjs/cell_text_bold.cjs.map +10 -0
- package/dist/cjs/checkbox.cjs +80 -0
- package/dist/cjs/checkbox.cjs.map +10 -0
- package/dist/cjs/expand_button.cjs +84 -0
- package/dist/cjs/expand_button.cjs.map +10 -0
- package/dist/cjs/index.cjs +27 -1
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/resizer.cjs +8 -1
- package/dist/cjs/resizer.cjs.map +3 -3
- package/dist/mjs/cell.mjs +72 -0
- package/dist/mjs/cell.mjs.map +10 -0
- package/dist/mjs/cell_avatar.mjs +32 -0
- package/dist/mjs/cell_avatar.mjs.map +10 -0
- package/dist/mjs/cell_avatar_with_text.mjs +50 -0
- package/dist/mjs/cell_avatar_with_text.mjs.map +10 -0
- package/dist/mjs/cell_badge.mjs +36 -0
- package/dist/mjs/cell_badge.mjs.map +10 -0
- package/dist/mjs/cell_currency.mjs +27 -0
- package/dist/mjs/cell_currency.mjs.map +10 -0
- package/dist/mjs/cell_link.mjs +48 -0
- package/dist/mjs/cell_link.mjs.map +10 -0
- package/dist/mjs/cell_number.mjs +18 -0
- package/dist/mjs/cell_number.mjs.map +10 -0
- package/dist/mjs/cell_percent.mjs +26 -0
- package/dist/mjs/cell_percent.mjs.map +10 -0
- package/dist/mjs/cell_tag.mjs +23 -0
- package/dist/mjs/cell_tag.mjs.map +10 -0
- package/dist/mjs/cell_text.mjs +17 -0
- package/dist/mjs/cell_text.mjs.map +10 -0
- package/dist/mjs/cell_text_bold.mjs +21 -0
- package/dist/mjs/cell_text_bold.mjs.map +10 -0
- package/dist/mjs/checkbox.mjs +50 -0
- package/dist/mjs/checkbox.mjs.map +10 -0
- package/dist/mjs/expand_button.mjs +54 -0
- package/dist/mjs/expand_button.mjs.map +10 -0
- package/dist/mjs/index.mjs +27 -1
- package/dist/mjs/index.mjs.map +3 -3
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/resizer.mjs +8 -1
- package/dist/mjs/resizer.mjs.map +3 -3
- package/dist/types/cell.d.ts +3 -0
- package/dist/types/cell_avatar.d.ts +3 -0
- package/dist/types/cell_avatar_with_text.d.ts +3 -0
- package/dist/types/cell_badge.d.ts +3 -0
- package/dist/types/cell_currency.d.ts +3 -0
- package/dist/types/cell_link.d.ts +8 -0
- package/dist/types/cell_number.d.ts +6 -0
- package/dist/types/cell_percent.d.ts +7 -0
- package/dist/types/cell_tag.d.ts +6 -0
- package/dist/types/cell_text.d.ts +6 -0
- package/dist/types/cell_text_bold.d.ts +7 -0
- package/dist/types/checkbox.d.ts +3 -0
- package/dist/types/expand_button.d.ts +2 -0
- package/dist/types/index.d.ts +13 -0
- package/package.json +2 -2
@@ -0,0 +1,56 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
6
|
+
var __toCommonJS = (from) => {
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
8
|
+
if (entry)
|
9
|
+
return entry;
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
}));
|
16
|
+
__moduleCache.set(from, entry);
|
17
|
+
return entry;
|
18
|
+
};
|
19
|
+
var __export = (target, all) => {
|
20
|
+
for (var name in all)
|
21
|
+
__defProp(target, name, {
|
22
|
+
get: all[name],
|
23
|
+
enumerable: true,
|
24
|
+
configurable: true,
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
// packages/skin-anocca/src/cell_percent.tsx
|
30
|
+
var exports_cell_percent = {};
|
31
|
+
__export(exports_cell_percent, {
|
32
|
+
CellPercent: () => CellPercent
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(exports_cell_percent);
|
35
|
+
var jsx_runtime = require("react/jsx-runtime");
|
36
|
+
var CellPercent = ({
|
37
|
+
value,
|
38
|
+
fractionDigits = 2
|
39
|
+
}) => {
|
40
|
+
const formatter = new Intl.NumberFormat("en-US", {
|
41
|
+
style: "percent",
|
42
|
+
minimumFractionDigits: fractionDigits,
|
43
|
+
maximumFractionDigits: fractionDigits
|
44
|
+
});
|
45
|
+
const defaultStyle = {
|
46
|
+
fontSize: "0.875rem",
|
47
|
+
color: "rgb(107 114 128)",
|
48
|
+
fontVariantNumeric: "tabular-nums"
|
49
|
+
};
|
50
|
+
return /* @__PURE__ */ jsx_runtime.jsx("span", {
|
51
|
+
style: { ...defaultStyle },
|
52
|
+
children: formatter.format(value)
|
53
|
+
});
|
54
|
+
};
|
55
|
+
|
56
|
+
//# debugId=8A94C5DA37E9973C64756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/cell_percent.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import { CellPercentProps } from \"@rttui/core\";\nimport React from \"react\";\n\n/**\n * CellPercent component for the Anocca skin.\n * Formats a number as a percentage.\n */\nexport const CellPercent: React.FC<CellPercentProps> = ({\n value,\n fractionDigits = 2,\n}) => {\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"percent\",\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n });\n\n const defaultStyle: React.CSSProperties = {\n fontSize: \"0.875rem\", // text-sm\n color: \"rgb(107 114 128)\", // text-gray-500\n fontVariantNumeric: \"tabular-nums\",\n // Anocca doesn't have dark mode built-in like Tailwind,\n // so we only define the light mode color here.\n };\n\n return <span style={{ ...defaultStyle }}>{formatter.format(value)}</span>;\n};\n"
|
6
|
+
],
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,cAA0C;AAAA,EACrD;AAAA,EACA,iBAAiB;AAAA,MACb;AAAA,EACJ,MAAM,YAAY,IAAI,KAAK,aAAa,SAAS;AAAA,IAC/C,OAAO;AAAA,IACP,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EACzB,CAAC;AAAA,EAED,MAAM,eAAoC;AAAA,IACxC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,oBAAoB;AAAA,EAGtB;AAAA,EAEA,uBAAO,gBAA6D,QAA7D;AAAA,IAAM,OAAO,KAAK,aAAa;AAAA,IAA/B,UAAmC,UAAU,OAAO,KAAK;AAAA,GAAI;AAAA;",
|
8
|
+
"debugId": "8A94C5DA37E9973C64756E2164756E21",
|
9
|
+
"names": []
|
10
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
6
|
+
var __toCommonJS = (from) => {
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
8
|
+
if (entry)
|
9
|
+
return entry;
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
}));
|
16
|
+
__moduleCache.set(from, entry);
|
17
|
+
return entry;
|
18
|
+
};
|
19
|
+
var __export = (target, all) => {
|
20
|
+
for (var name in all)
|
21
|
+
__defProp(target, name, {
|
22
|
+
get: all[name],
|
23
|
+
enumerable: true,
|
24
|
+
configurable: true,
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
// packages/skin-anocca/src/cell_tag.tsx
|
30
|
+
var exports_cell_tag = {};
|
31
|
+
__export(exports_cell_tag, {
|
32
|
+
CellTag: () => CellTag
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(exports_cell_tag);
|
35
|
+
var jsx_runtime = require("react/jsx-runtime");
|
36
|
+
var CellTag = ({ children }) => {
|
37
|
+
const style = {
|
38
|
+
display: "inline-block",
|
39
|
+
padding: "0.25rem 0.5rem",
|
40
|
+
fontSize: "0.75rem",
|
41
|
+
fontWeight: 500,
|
42
|
+
color: "#4b5563",
|
43
|
+
backgroundColor: "#f3f4f6",
|
44
|
+
borderRadius: "0.375rem",
|
45
|
+
border: "1px solid rgba(209, 213, 219, 0.2)"
|
46
|
+
};
|
47
|
+
return /* @__PURE__ */ jsx_runtime.jsx("div", {
|
48
|
+
style,
|
49
|
+
children
|
50
|
+
});
|
51
|
+
};
|
52
|
+
|
53
|
+
//# debugId=135E7F76CCBF4A9964756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/cell_tag.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import React from \"react\";\n\ntype CellTagProps = {\n children: React.ReactNode;\n};\n\nexport const CellTag: React.FC<CellTagProps> = ({ children }) => {\n const style: React.CSSProperties = {\n display: \"inline-block\",\n padding: \"0.25rem 0.5rem\",\n fontSize: \"0.75rem\",\n fontWeight: 500,\n color: \"#4b5563\",\n backgroundColor: \"#f3f4f6\",\n borderRadius: \"0.375rem\",\n border: \"1px solid rgba(209, 213, 219, 0.2)\",\n };\n\n return <div style={style}>{children}</div>;\n};\n"
|
6
|
+
],
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAM,UAAkC,GAAG,eAAe;AAAA,EAC/D,MAAM,QAA6B;AAAA,IACjC,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,QAAQ;AAAA,EACV;AAAA,EAEA,uBAAO,gBAA+B,OAA/B;AAAA,IAAK;AAAA,IAAL;AAAA,GAA+B;AAAA;",
|
8
|
+
"debugId": "135E7F76CCBF4A9964756E2164756E21",
|
9
|
+
"names": []
|
10
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
6
|
+
var __toCommonJS = (from) => {
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
8
|
+
if (entry)
|
9
|
+
return entry;
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
}));
|
16
|
+
__moduleCache.set(from, entry);
|
17
|
+
return entry;
|
18
|
+
};
|
19
|
+
var __export = (target, all) => {
|
20
|
+
for (var name in all)
|
21
|
+
__defProp(target, name, {
|
22
|
+
get: all[name],
|
23
|
+
enumerable: true,
|
24
|
+
configurable: true,
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
// packages/skin-anocca/src/cell_text.tsx
|
30
|
+
var exports_cell_text = {};
|
31
|
+
__export(exports_cell_text, {
|
32
|
+
CellText: () => CellText
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(exports_cell_text);
|
35
|
+
var jsx_runtime = require("react/jsx-runtime");
|
36
|
+
var CellText = ({ children }) => {
|
37
|
+
const style = {
|
38
|
+
fontSize: "0.875rem",
|
39
|
+
color: "#6b7280"
|
40
|
+
};
|
41
|
+
return /* @__PURE__ */ jsx_runtime.jsx("span", {
|
42
|
+
style,
|
43
|
+
children
|
44
|
+
});
|
45
|
+
};
|
46
|
+
|
47
|
+
//# debugId=1DD2081396E55A6A64756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/cell_text.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import React from \"react\";\n\ntype CellTextProps = {\n children: React.ReactNode;\n};\n\nexport const CellText: React.FC<CellTextProps> = ({ children }) => {\n const style: React.CSSProperties = {\n fontSize: \"0.875rem\",\n color: \"#6b7280\",\n };\n\n return <span style={style}>{children}</span>;\n};\n"
|
6
|
+
],
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAM,WAAoC,GAAG,eAAe;AAAA,EACjE,MAAM,QAA6B;AAAA,IACjC,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EAEA,uBAAO,gBAAgC,QAAhC;AAAA,IAAM;AAAA,IAAN;AAAA,GAAgC;AAAA;",
|
8
|
+
"debugId": "1DD2081396E55A6A64756E2164756E21",
|
9
|
+
"names": []
|
10
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
6
|
+
var __toCommonJS = (from) => {
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
8
|
+
if (entry)
|
9
|
+
return entry;
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
}));
|
16
|
+
__moduleCache.set(from, entry);
|
17
|
+
return entry;
|
18
|
+
};
|
19
|
+
var __export = (target, all) => {
|
20
|
+
for (var name in all)
|
21
|
+
__defProp(target, name, {
|
22
|
+
get: all[name],
|
23
|
+
enumerable: true,
|
24
|
+
configurable: true,
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
// packages/skin-anocca/src/cell_text_bold.tsx
|
30
|
+
var exports_cell_text_bold = {};
|
31
|
+
__export(exports_cell_text_bold, {
|
32
|
+
CellTextBold: () => CellTextBold
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(exports_cell_text_bold);
|
35
|
+
var jsx_runtime = require("react/jsx-runtime");
|
36
|
+
var CellTextBold = ({
|
37
|
+
children,
|
38
|
+
className
|
39
|
+
}) => {
|
40
|
+
const style = {
|
41
|
+
fontSize: "0.875rem",
|
42
|
+
fontWeight: 500
|
43
|
+
};
|
44
|
+
return /* @__PURE__ */ jsx_runtime.jsx("span", {
|
45
|
+
style,
|
46
|
+
className,
|
47
|
+
children
|
48
|
+
});
|
49
|
+
};
|
50
|
+
|
51
|
+
//# debugId=444BEA47C2CDC38D64756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/cell_text_bold.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import React from \"react\";\n\ntype CellTextBoldProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport const CellTextBold: React.FC<CellTextBoldProps> = ({\n children,\n className,\n}) => {\n const style: React.CSSProperties = {\n fontSize: \"0.875rem\",\n fontWeight: 500,\n };\n\n return (\n <span style={style} className={className}>\n {children}\n </span>\n );\n};\n"
|
6
|
+
],
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,eAA4C;AAAA,EACvD;AAAA,EACA;AAAA,MACI;AAAA,EACJ,MAAM,QAA6B;AAAA,IACjC,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EAEA,uBACE,gBAEE,QAFF;AAAA,IAAM;AAAA,IAAc;AAAA,IAApB;AAAA,GAEE;AAAA;",
|
8
|
+
"debugId": "444BEA47C2CDC38D64756E2164756E21",
|
9
|
+
"names": []
|
10
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
6
|
+
var __toCommonJS = (from) => {
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
8
|
+
if (entry)
|
9
|
+
return entry;
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
}));
|
16
|
+
__moduleCache.set(from, entry);
|
17
|
+
return entry;
|
18
|
+
};
|
19
|
+
var __export = (target, all) => {
|
20
|
+
for (var name in all)
|
21
|
+
__defProp(target, name, {
|
22
|
+
get: all[name],
|
23
|
+
enumerable: true,
|
24
|
+
configurable: true,
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
// packages/skin-anocca/src/checkbox.tsx
|
30
|
+
var exports_checkbox = {};
|
31
|
+
__export(exports_checkbox, {
|
32
|
+
Checkbox: () => Checkbox
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(exports_checkbox);
|
35
|
+
var import_react = require("react");
|
36
|
+
var import_core = require("@rttui/core");
|
37
|
+
var jsx_runtime = require("react/jsx-runtime");
|
38
|
+
var Checkbox = ({ getProps, onChange }) => {
|
39
|
+
const resolvedRef = import_react.useRef(null);
|
40
|
+
const { checked, indeterminate, disabled, value } = import_core.useTableProps({
|
41
|
+
callback: () => {
|
42
|
+
return getProps();
|
43
|
+
},
|
44
|
+
dependencies: [{ type: "tanstack_table" }],
|
45
|
+
areCallbackOutputEqual: import_core.shallowEqual,
|
46
|
+
shouldUnmount: () => {
|
47
|
+
try {
|
48
|
+
getProps();
|
49
|
+
return false;
|
50
|
+
} catch (e) {
|
51
|
+
return true;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
});
|
55
|
+
import_react.useLayoutEffect(() => {
|
56
|
+
if (resolvedRef.current) {
|
57
|
+
resolvedRef.current.indeterminate = !!indeterminate;
|
58
|
+
}
|
59
|
+
}, [resolvedRef, indeterminate]);
|
60
|
+
const style = {
|
61
|
+
width: "16px",
|
62
|
+
height: "16px",
|
63
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
64
|
+
margin: "auto"
|
65
|
+
};
|
66
|
+
return /* @__PURE__ */ jsx_runtime.jsx("input", {
|
67
|
+
type: "checkbox",
|
68
|
+
ref: resolvedRef,
|
69
|
+
style,
|
70
|
+
checked: !!checked,
|
71
|
+
onChange: onChange ? (ev) => {
|
72
|
+
onChange()(ev);
|
73
|
+
} : undefined,
|
74
|
+
disabled,
|
75
|
+
value,
|
76
|
+
"aria-checked": indeterminate ? "mixed" : checked ? "true" : "false"
|
77
|
+
});
|
78
|
+
};
|
79
|
+
|
80
|
+
//# debugId=BD0E1D357230DF1F64756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/checkbox.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import React, { useLayoutEffect, useRef } from \"react\";\nimport { CheckboxProps, shallowEqual, useTableProps } from \"@rttui/core\";\n\n// Implement the Checkbox component for the Anocca skin\nexport const Checkbox: React.FC<CheckboxProps> = ({ getProps, onChange }) => {\n const resolvedRef = useRef<HTMLInputElement>(null);\n\n // Use the core hook to get checkbox state based on table context\n const { checked, indeterminate, disabled, value } = useTableProps({\n callback: () => {\n // getProps is expected to return the state { checked, indeterminate, disabled, value }\n // This allows the checkbox to reflect header/row/cell specific selection states\n return getProps();\n },\n dependencies: [{ type: \"tanstack_table\" }], // Re-evaluate when table state changes\n areCallbackOutputEqual: shallowEqual, // Optimize re-renders\n shouldUnmount: () => {\n // Attempt to call getProps to see if the context is still valid\n // If it throws (e.g., row is removed), the component should unmount\n try {\n getProps();\n return false;\n } catch (e) {\n return true;\n }\n },\n });\n\n // Apply indeterminate state imperatively\n useLayoutEffect(() => {\n if (resolvedRef.current) {\n resolvedRef.current.indeterminate = !!indeterminate;\n }\n }, [resolvedRef, indeterminate]);\n\n // Basic styling for the checkbox - Anocca skin might provide custom styling\n const style: React.CSSProperties = {\n width: \"16px\", // Equivalent to size-4\n height: \"16px\",\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n // Add some margin for spacing if needed\n margin: \"auto\", // Center it if used within a flex/grid container\n };\n\n return (\n <input\n type=\"checkbox\"\n ref={resolvedRef}\n style={style}\n checked={!!checked} // Ensure checked is boolean\n onChange={\n onChange\n ? (ev) => {\n // The onChange from props returns the actual handler function\n onChange()(ev);\n }\n : undefined\n }\n disabled={disabled}\n value={value}\n aria-checked={indeterminate ? \"mixed\" : checked ? \"true\" : \"false\"}\n />\n );\n}; "
|
6
|
+
],
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA+C,IAA/C;AAC2D,IAA3D;AAAA;AAGO,IAAM,WAAoC,GAAG,UAAU,eAAe;AAAA,EAC3E,MAAM,cAAc,oBAAyB,IAAI;AAAA,EAGjD,QAAQ,SAAS,eAAe,UAAU,UAAU,0BAAc;AAAA,IAChE,UAAU,MAAM;AAAA,MAGd,OAAO,SAAS;AAAA;AAAA,IAElB,cAAc,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAAA,IACzC,wBAAwB;AAAA,IACxB,eAAe,MAAM;AAAA,MAGnB,IAAI;AAAA,QACF,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO,GAAG;AAAA,QACV,OAAO;AAAA;AAAA;AAAA,EAGb,CAAC;AAAA,EAGD,6BAAgB,MAAM;AAAA,IACpB,IAAI,YAAY,SAAS;AAAA,MACvB,YAAY,QAAQ,kBAAkB;AAAA,IACxC;AAAA,KACC,CAAC,aAAa,aAAa,CAAC;AAAA,EAG/B,MAAM,QAA6B;AAAA,IACjC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,WAAW,gBAAgB;AAAA,IAEnC,QAAQ;AAAA,EACV;AAAA,EAEA,uBACE,gBAAC,SAAD;AAAA,IACE,MAAK;AAAA,IACL,KAAK;AAAA,IACL;AAAA,IACA,WAAW;AAAA,IACX,UACE,WACI,CAAC,OAAO;AAAA,MAEN,SAAS,EAAE,EAAE;AAAA,QAEf;AAAA,IAEN;AAAA,IACA;AAAA,IACA,gBAAc,gBAAgB,UAAU,UAAU,SAAS;AAAA,GAC7D;AAAA;",
|
8
|
+
"debugId": "BD0E1D357230DF1F64756E2164756E21",
|
9
|
+
"names": []
|
10
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
6
|
+
var __toCommonJS = (from) => {
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
8
|
+
if (entry)
|
9
|
+
return entry;
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
}));
|
16
|
+
__moduleCache.set(from, entry);
|
17
|
+
return entry;
|
18
|
+
};
|
19
|
+
var __export = (target, all) => {
|
20
|
+
for (var name in all)
|
21
|
+
__defProp(target, name, {
|
22
|
+
get: all[name],
|
23
|
+
enumerable: true,
|
24
|
+
configurable: true,
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
// packages/skin-anocca/src/expand_button.tsx
|
30
|
+
var exports_expand_button = {};
|
31
|
+
__export(exports_expand_button, {
|
32
|
+
ExpandButton: () => ExpandButton
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(exports_expand_button);
|
35
|
+
var import_core = require("@rttui/core");
|
36
|
+
var import_fi = require("react-icons/fi");
|
37
|
+
var jsx_runtime = require("react/jsx-runtime");
|
38
|
+
var ExpandButton = () => {
|
39
|
+
const { canExpand, isExpanded } = import_core.useRowProps({
|
40
|
+
callback: (vrow) => {
|
41
|
+
const row = vrow.row;
|
42
|
+
return {
|
43
|
+
canExpand: row.getCanExpand(),
|
44
|
+
isExpanded: row.getIsExpanded()
|
45
|
+
};
|
46
|
+
},
|
47
|
+
areCallbackOutputEqual: import_core.shallowEqual,
|
48
|
+
dependencies: [{ type: "tanstack_table" }]
|
49
|
+
});
|
50
|
+
const rowRef = import_core.useRowRef();
|
51
|
+
if (!canExpand) {
|
52
|
+
return null;
|
53
|
+
}
|
54
|
+
const buttonStyle = {
|
55
|
+
display: "flex",
|
56
|
+
alignItems: "center",
|
57
|
+
justifyContent: "center",
|
58
|
+
width: "24px",
|
59
|
+
height: "24px",
|
60
|
+
border: "none",
|
61
|
+
background: "transparent",
|
62
|
+
cursor: "pointer",
|
63
|
+
borderRadius: "50%"
|
64
|
+
};
|
65
|
+
const iconStyle = {
|
66
|
+
width: "16px",
|
67
|
+
height: "16px",
|
68
|
+
color: "#4b5563"
|
69
|
+
};
|
70
|
+
const IconComponent = isExpanded ? import_fi.FiChevronDown : import_fi.FiChevronRight;
|
71
|
+
return /* @__PURE__ */ jsx_runtime.jsx("button", {
|
72
|
+
onClick: (e) => {
|
73
|
+
e.stopPropagation();
|
74
|
+
rowRef()?.row.toggleExpanded();
|
75
|
+
},
|
76
|
+
style: buttonStyle,
|
77
|
+
"aria-label": isExpanded ? "Collapse row" : "Expand row",
|
78
|
+
children: /* @__PURE__ */ jsx_runtime.jsx(IconComponent, {
|
79
|
+
style: iconStyle
|
80
|
+
})
|
81
|
+
});
|
82
|
+
};
|
83
|
+
|
84
|
+
//# debugId=C2B60557AF70A69064756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/expand_button.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import React from \"react\";\nimport { useRowProps, useRowRef, shallowEqual } from \"@rttui/core\";\nimport { FiChevronDown, FiChevronRight } from \"react-icons/fi\"; // Using react-icons as per guidelines\n\n// No specific props needed for ExpandButton itself as it uses context hooks\n\n// Implement the ExpandButton component for the Anocca skin\nexport const ExpandButton: React.FC = () => {\n // Use core hooks to get row expansion state\n const { canExpand, isExpanded } = useRowProps({\n callback: (vrow) => {\n const row = vrow.row;\n return {\n canExpand: row.getCanExpand(),\n isExpanded: row.getIsExpanded(),\n };\n },\n areCallbackOutputEqual: shallowEqual,\n dependencies: [{ type: \"tanstack_table\" }], // Dependency on table state changes\n });\n\n const rowRef = useRowRef(); // Get a ref to the row API\n\n // If the row cannot be expanded, render nothing\n if (!canExpand) {\n return null;\n }\n\n // Basic button styling - Anocca skin will likely provide more specific styles\n const buttonStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"24px\", // Equivalent to w-6\n height: \"24px\", // Equivalent to h-6\n border: \"none\",\n background: \"transparent\",\n cursor: \"pointer\",\n borderRadius: \"50%\", // Equivalent to rounded-full\n // Placeholder hover effect - Anocca might use different colors or effects\n // ':hover': { backgroundColor: '#f3f4f6' }\n // Hover pseudo-class cannot be applied via inline styles directly\n };\n\n // Basic icon styling - Anocca might have specific icon colors/sizes\n const iconStyle: React.CSSProperties = {\n width: \"16px\", // Equivalent to w-4\n height: \"16px\", // Equivalent to h-4\n color: \"#4b5563\", // Placeholder color (text-gray-600)\n };\n\n const IconComponent = isExpanded ? FiChevronDown : FiChevronRight;\n\n return (\n <button\n onClick={(e) => {\n e.stopPropagation(); // Prevent row click event if needed\n rowRef()?.row.toggleExpanded();\n }}\n style={buttonStyle}\n aria-label={isExpanded ? \"Collapse row\" : \"Expand row\"}\n >\n <IconComponent style={iconStyle} />\n </button>\n );\n}; "
|
6
|
+
],
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACqD,IAArD;AAC8C,IAA9C;AAAA;AAKO,IAAM,eAAyB,MAAM;AAAA,EAE1C,QAAQ,WAAW,eAAe,wBAAY;AAAA,IAC5C,UAAU,CAAC,SAAS;AAAA,MAClB,MAAM,MAAM,KAAK;AAAA,MACjB,OAAO;AAAA,QACL,WAAW,IAAI,aAAa;AAAA,QAC5B,YAAY,IAAI,cAAc;AAAA,MAChC;AAAA;AAAA,IAEF,wBAAwB;AAAA,IACxB,cAAc,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAAA,EAC3C,CAAC;AAAA,EAED,MAAM,SAAS,sBAAU;AAAA,EAGzB,KAAK,WAAW;AAAA,IACd,OAAO;AAAA,EACT;AAAA,EAGA,MAAM,cAAmC;AAAA,IACvC,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,cAAc;AAAA,EAIhB;AAAA,EAGA,MAAM,YAAiC;AAAA,IACrC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EAEA,MAAM,gBAAgB,aAAa,0BAAgB;AAAA,EAEnD,uBACE,gBASE,UATF;AAAA,IACE,SAAS,CAAC,MAAM;AAAA,MACd,EAAE,gBAAgB;AAAA,MAClB,OAAO,GAAG,IAAI,eAAe;AAAA;AAAA,IAE/B,OAAO;AAAA,IACP,cAAY,aAAa,iBAAiB;AAAA,IAN5C,0BAQE,gBAAC,eAAD;AAAA,MAAe,OAAO;AAAA,KAAW;AAAA,GACjC;AAAA;",
|
8
|
+
"debugId": "C2B60557AF70A69064756E2164756E21",
|
9
|
+
"names": []
|
10
|
+
}
|
package/dist/cjs/index.cjs
CHANGED
@@ -33,6 +33,19 @@ __export(exports_src, {
|
|
33
33
|
RowPinButtons: () => import_row_pin_buttons.RowPinButtons,
|
34
34
|
Resizer: () => import_resizer.Resizer,
|
35
35
|
HeaderPinButtons: () => import_header_pin_buttons.HeaderPinButtons,
|
36
|
+
ExpandButton: () => import_expand_button.ExpandButton,
|
37
|
+
Checkbox: () => import_checkbox.Checkbox,
|
38
|
+
CellTextBold: () => import_cell_text_bold.CellTextBold,
|
39
|
+
CellText: () => import_cell_text.CellText,
|
40
|
+
CellTag: () => import_cell_tag.CellTag,
|
41
|
+
CellPercent: () => import_cell_percent.CellPercent,
|
42
|
+
CellNumber: () => import_cell_number.CellNumber,
|
43
|
+
CellLink: () => import_cell_link.CellLink,
|
44
|
+
CellCurrency: () => import_cell_currency.CellCurrency,
|
45
|
+
CellBadge: () => import_cell_badge.CellBadge,
|
46
|
+
CellAvatarWithText: () => import_cell_avatar_with_text.CellAvatarWithText,
|
47
|
+
CellAvatar: () => import_cell_avatar.CellAvatar,
|
48
|
+
Cell: () => import_cell.Cell,
|
36
49
|
AnoccaSkin: () => import_anocca_skin.AnoccaSkin
|
37
50
|
});
|
38
51
|
module.exports = __toCommonJS(exports_src);
|
@@ -41,5 +54,18 @@ var import_table_header_row = require("./table_header_row.cjs");
|
|
41
54
|
var import_header_pin_buttons = require("./header_pin_buttons.cjs");
|
42
55
|
var import_row_pin_buttons = require("./row_pin_buttons.cjs");
|
43
56
|
var import_resizer = require("./resizer.cjs");
|
57
|
+
var import_cell_avatar = require("./cell_avatar.cjs");
|
58
|
+
var import_cell_avatar_with_text = require("./cell_avatar_with_text.cjs");
|
59
|
+
var import_cell_number = require("./cell_number.cjs");
|
60
|
+
var import_cell_tag = require("./cell_tag.cjs");
|
61
|
+
var import_cell_text = require("./cell_text.cjs");
|
62
|
+
var import_expand_button = require("./expand_button.cjs");
|
63
|
+
var import_checkbox = require("./checkbox.cjs");
|
64
|
+
var import_cell_text_bold = require("./cell_text_bold.cjs");
|
65
|
+
var import_cell_currency = require("./cell_currency.cjs");
|
66
|
+
var import_cell_badge = require("./cell_badge.cjs");
|
67
|
+
var import_cell = require("./cell.cjs");
|
68
|
+
var import_cell_link = require("./cell_link.cjs");
|
69
|
+
var import_cell_percent = require("./cell_percent.cjs");
|
44
70
|
|
45
|
-
//# debugId=
|
71
|
+
//# debugId=BB9CA6290CFFBBBB64756E2164756E21
|
package/dist/cjs/index.cjs.map
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/index.ts"],
|
4
4
|
"sourcesContent": [
|
5
|
-
"export { AnoccaSkin } from \"./anocca_skin.cjs\";\nexport { TableHeaderRow } from \"./table_header_row.cjs\";\nexport { HeaderPinButtons } from \"./header_pin_buttons.cjs\";\nexport { RowPinButtons } from \"./row_pin_buttons.cjs\";\nexport { Resizer } from \"./resizer.cjs\"
|
5
|
+
"export { AnoccaSkin } from \"./anocca_skin.cjs\";\nexport { TableHeaderRow } from \"./table_header_row.cjs\";\nexport { HeaderPinButtons } from \"./header_pin_buttons.cjs\";\nexport { RowPinButtons } from \"./row_pin_buttons.cjs\";\nexport { Resizer } from \"./resizer.cjs\";\nexport { CellAvatar } from \"./cell_avatar.cjs\";\nexport { CellAvatarWithText } from \"./cell_avatar_with_text.cjs\";\nexport { CellNumber } from \"./cell_number.cjs\";\nexport { CellTag } from \"./cell_tag.cjs\";\nexport { CellText } from \"./cell_text.cjs\";\nexport { ExpandButton } from \"./expand_button.cjs\";\nexport { Checkbox } from \"./checkbox.cjs\";\nexport { CellTextBold } from \"./cell_text_bold.cjs\";\nexport { CellCurrency } from \"./cell_currency.cjs\";\nexport { CellBadge } from \"./cell_badge.cjs\";\nexport { Cell } from \"./cell.cjs\";\nexport { CellLink } from \"./cell_link.cjs\";\nexport { CellPercent } from \"./cell_percent.cjs\";\n"
|
6
6
|
],
|
7
|
-
"mappings": "
|
8
|
-
"debugId": "
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA2B,IAA3B;AAC+B,IAA/B;AACiC,IAAjC;AAC8B,IAA9B;AACwB,IAAxB;AAC2B,IAA3B;AACmC,IAAnC;AAC2B,IAA3B;AACwB,IAAxB;AACyB,IAAzB;AAC6B,IAA7B;AACyB,IAAzB;AAC6B,IAA7B;AAC6B,IAA7B;AAC0B,IAA1B;AACqB,IAArB;AACyB,IAAzB;AAC4B,IAA5B;",
|
8
|
+
"debugId": "BB9CA6290CFFBBBB64756E2164756E21",
|
9
9
|
"names": []
|
10
10
|
}
|
package/dist/cjs/package.json
CHANGED
package/dist/cjs/resizer.cjs
CHANGED
@@ -90,6 +90,13 @@ function Resizer() {
|
|
90
90
|
ev.stopPropagation();
|
91
91
|
ev.preventDefault();
|
92
92
|
},
|
93
|
+
onClick: (ev) => {
|
94
|
+
if (ev.metaKey) {
|
95
|
+
ev.stopPropagation();
|
96
|
+
ev.preventDefault();
|
97
|
+
crushHeader(colRef().header);
|
98
|
+
}
|
99
|
+
},
|
93
100
|
onMouseDown: (ev) => colRef().header.getResizeHandler()(ev),
|
94
101
|
onTouchStart: (ev) => colRef().header.getResizeHandler()(ev),
|
95
102
|
className: `resizer ${isResizing ? "isResizing" : ""}`,
|
@@ -115,4 +122,4 @@ function Resizer() {
|
|
115
122
|
});
|
116
123
|
}
|
117
124
|
|
118
|
-
//# debugId=
|
125
|
+
//# debugId=F608CD74A330E2FC64756E2164756E21
|
package/dist/cjs/resizer.cjs.map
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/resizer.tsx"],
|
4
4
|
"sourcesContent": [
|
5
|
-
"import { Box } from \"@mui/material\";\nimport { useColRef, useCrushHeader } from \"@rttui/core\";\nimport { useColProps } from \"@rttui/core\";\nimport React from \"react\";\nimport { shallowEqual } from \"@rttui/core\";\nexport function Resizer() {\n const crushHeader = useCrushHeader();\n\n const { canResize, isResizing } = useColProps({\n callback: ({ column }) => {\n return {\n canResize: column.getCanResize(),\n isResizing: column.getIsResizing(),\n };\n },\n areCallbackOutputEqual: shallowEqual,\n dependencies: [{ type: \"tanstack_table\" }],\n });\n\n const colRef = useColRef();\n\n React.useEffect(() => {\n if (!isResizing) {\n return;\n }\n const preventDefault = (e: Event) => {\n e.preventDefault();\n };\n document.body.addEventListener(\"select\", preventDefault);\n document.body.addEventListener(\"selectstart\", preventDefault);\n document.body.style.userSelect = \"none\";\n return () => {\n document.body.removeEventListener(\"select\", preventDefault);\n document.body.removeEventListener(\"selectstart\", preventDefault);\n document.body.style.userSelect = \"auto\";\n };\n }, [isResizing]);\n\n if (!canResize) {\n return null;\n }\n\n return (\n <>\n {canResize && (\n <Box\n onDoubleClick={(ev) => {\n crushHeader(colRef().header);\n ev.stopPropagation();\n ev.preventDefault();\n }}\n onMouseDown={(ev: any) => colRef().header.getResizeHandler()(ev)}\n onTouchStart={(ev: any) => colRef().header.getResizeHandler()(ev)}\n className={`resizer ${isResizing ? \"isResizing\" : \"\"}`}\n sx={{\n position: \"absolute\",\n right: 0,\n top: 0,\n bottom: 0,\n width: \"3px\",\n cursor: \"col-resize\",\n userSelect: \"none\",\n touchAction: \"none\",\n opacity: 0,\n backgroundColor: (theme) => theme.palette.text.secondary,\n transition: \"opacity 0.2s\",\n \"&.isResizing\": {\n backgroundColor: (theme) => theme.palette.primary.main,\n opacity: 1,\n width: \"1px\",\n },\n }}\n />\n )}\n </>\n );\n}\n"
|
5
|
+
"import { Box } from \"@mui/material\";\nimport { useColRef, useCrushHeader } from \"@rttui/core\";\nimport { useColProps } from \"@rttui/core\";\nimport React from \"react\";\nimport { shallowEqual } from \"@rttui/core\";\nexport function Resizer() {\n const crushHeader = useCrushHeader();\n\n const { canResize, isResizing } = useColProps({\n callback: ({ column }) => {\n return {\n canResize: column.getCanResize(),\n isResizing: column.getIsResizing(),\n };\n },\n areCallbackOutputEqual: shallowEqual,\n dependencies: [{ type: \"tanstack_table\" }],\n });\n\n const colRef = useColRef();\n\n React.useEffect(() => {\n if (!isResizing) {\n return;\n }\n const preventDefault = (e: Event) => {\n e.preventDefault();\n };\n document.body.addEventListener(\"select\", preventDefault);\n document.body.addEventListener(\"selectstart\", preventDefault);\n document.body.style.userSelect = \"none\";\n return () => {\n document.body.removeEventListener(\"select\", preventDefault);\n document.body.removeEventListener(\"selectstart\", preventDefault);\n document.body.style.userSelect = \"auto\";\n };\n }, [isResizing]);\n\n if (!canResize) {\n return null;\n }\n\n return (\n <>\n {canResize && (\n <Box\n onDoubleClick={(ev) => {\n crushHeader(colRef().header);\n ev.stopPropagation();\n ev.preventDefault();\n }}\n onClick={(ev) => {\n if (ev.metaKey) {\n ev.stopPropagation();\n ev.preventDefault();\n crushHeader(colRef().header);\n }\n }}\n onMouseDown={(ev: any) => colRef().header.getResizeHandler()(ev)}\n onTouchStart={(ev: any) => colRef().header.getResizeHandler()(ev)}\n className={`resizer ${isResizing ? \"isResizing\" : \"\"}`}\n sx={{\n position: \"absolute\",\n right: 0,\n top: 0,\n bottom: 0,\n width: \"3px\",\n cursor: \"col-resize\",\n userSelect: \"none\",\n touchAction: \"none\",\n opacity: 0,\n backgroundColor: (theme) => theme.palette.text.secondary,\n transition: \"opacity 0.2s\",\n \"&.isResizing\": {\n backgroundColor: (theme) => theme.palette.primary.main,\n opacity: 1,\n width: \"1px\",\n },\n }}\n />\n )}\n </>\n );\n}\n"
|
6
6
|
],
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAoB,IAApB;AAC0C,IAA1C;AAC4B,IAA5B;AACkB,IAAlB;AAC6B,IAA7B;AAAA;AAC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ef } from "@rttui/core";
|
3
|
+
import { CellText } from "./cell_text.mjs";
|
4
|
+
import { CellTextBold } from "./cell_text_bold.mjs";
|
5
|
+
import { Checkbox } from "./checkbox.mjs";
|
6
|
+
import { ExpandButton } from "./expand_button.mjs";
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
8
|
+
var Cell = ({
|
9
|
+
children,
|
10
|
+
checkbox = false,
|
11
|
+
expandButton = false,
|
12
|
+
pinButtons = false,
|
13
|
+
highlightSelected = false
|
14
|
+
}) => {
|
15
|
+
const { depth, isSelected } = useRowProps({
|
16
|
+
callback: (vrow) => {
|
17
|
+
const row = vrow.row;
|
18
|
+
return {
|
19
|
+
depth: row.depth,
|
20
|
+
isSelected: row.getIsSelected()
|
21
|
+
};
|
22
|
+
},
|
23
|
+
areCallbackOutputEqual: shallowEqual,
|
24
|
+
dependencies: [{ type: "tanstack_table" }]
|
25
|
+
});
|
26
|
+
const rowRef = useRowRef();
|
27
|
+
const containerStyle = {
|
28
|
+
display: "flex",
|
29
|
+
alignItems: "center",
|
30
|
+
gap: "8px",
|
31
|
+
paddingLeft: `${depth * 20}px`
|
32
|
+
};
|
33
|
+
const useBold = highlightSelected && isSelected;
|
34
|
+
return /* @__PURE__ */ jsxs("div", {
|
35
|
+
style: containerStyle,
|
36
|
+
children: [
|
37
|
+
checkbox && /* @__PURE__ */ jsx(Checkbox, {
|
38
|
+
getProps: () => {
|
39
|
+
const row = rowRef()?.row;
|
40
|
+
if (!row)
|
41
|
+
return {};
|
42
|
+
return {
|
43
|
+
checked: row.getIsSelected(),
|
44
|
+
disabled: !row.getCanSelect(),
|
45
|
+
indeterminate: row.getIsSomeSelected()
|
46
|
+
};
|
47
|
+
},
|
48
|
+
onChange: () => {
|
49
|
+
return (event) => {
|
50
|
+
rowRef()?.row.toggleSelected(event.target.checked);
|
51
|
+
};
|
52
|
+
}
|
53
|
+
}),
|
54
|
+
expandButton && /* @__PURE__ */ jsx(ExpandButton, {}),
|
55
|
+
pinButtons && /* @__PURE__ */ jsx("span", {
|
56
|
+
style: { fontStyle: "italic", fontSize: "0.8em" },
|
57
|
+
children: "(Pin)"
|
58
|
+
}),
|
59
|
+
useBold ? /* @__PURE__ */ jsx(CellTextBold, {
|
60
|
+
className: "anocca-selected-cell-text",
|
61
|
+
children
|
62
|
+
}) : /* @__PURE__ */ jsx(CellText, {
|
63
|
+
children
|
64
|
+
})
|
65
|
+
]
|
66
|
+
});
|
67
|
+
};
|
68
|
+
export {
|
69
|
+
Cell
|
70
|
+
};
|
71
|
+
|
72
|
+
//# debugId=C16936508E08347F64756E2164756E21
|